From 6b54911a6c9c8637873b4839f69a3817e53cda3c Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Thu, 11 Jun 2026 20:32:32 +0200 Subject: [PATCH 01/96] fix(ci): make the Nix build work with NES_ENABLE_MEOS=OFF and stock paho-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. --- CMakeLists.txt | 7 +++ flake.nix | 4 ++ nes-physical-operators/CMakeLists.txt | 6 +- .../Aggregation/Function/Meos/CMakeLists.txt | 2 + .../src/Functions/Meos/CMakeLists.txt | 2 + nes-plugins/CMakeLists.txt | 55 ++++++++++--------- nes-plugins/Sinks/MQTTSink/CMakeLists.txt | 9 ++- nes-plugins/Sources/MQTTSource/CMakeLists.txt | 9 ++- .../LowerToPhysicalWindowedAggregation.cpp | 4 ++ 9 files changed, 67 insertions(+), 31 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9dcaa97099..c67d32c34d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -239,6 +239,13 @@ endif () add_custom_target(build_all_plugins) +# Declared here so add_compile_definitions reaches all sibling nes-* targets. +# nes-plugins/CMakeLists.txt re-declares the same option (no-op when cached). +option(NES_ENABLE_MEOS "Enable MEOS plugin (requires libmeos installed on the system)" ON) +if(NES_ENABLE_MEOS) + add_compile_definitions(NES_ENABLE_MEOS) +endif() + # Add target for common lib, which contains a minimal set # of shared functionality used by all components of nes file(GLOB NES_DIRECTORIES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "nes-*") diff --git a/flake.nix b/flake.nix index 2d9788a4de..026e310022 100644 --- a/flake.nix +++ b/flake.nix @@ -54,6 +54,8 @@ tbb python3 openjdk21 + paho-mqtt-c + paho-mqtt-cpp ]) ++ [ follyPkg antlr4Pkg ]; antlr4Jar = pkgs.fetchurl { @@ -244,6 +246,7 @@ "-DNES_ENABLES_TESTS=ON" "-DCMAKE_MODULE_PATH=${libdwarfModule}/share/cmake/Modules" "-DANTLR4_JAR_LOCATION=${antlr4Jar}" + "-DNES_ENABLE_MEOS=OFF" ]; enableParallelBuilding = true; @@ -347,6 +350,7 @@ "-DLLVM_DIR=${commonCmakeEnv.LLVM_DIR}" "-DANTLR4_JAR_LOCATION=${antlr4Jar}" "-DCMAKE_MODULE_PATH=${libdwarfModule}/share/cmake/Modules" + "-DNES_ENABLE_MEOS=OFF" ]; shellHook = '' unset NES_PREBUILT_VCPKG_ROOT diff --git a/nes-physical-operators/CMakeLists.txt b/nes-physical-operators/CMakeLists.txt index c38afaf4db..b62a5922a9 100644 --- a/nes-physical-operators/CMakeLists.txt +++ b/nes-physical-operators/CMakeLists.txt @@ -19,7 +19,11 @@ get_source(nes-physical-operators NES_PHYSICAL_OPERATORS_SOURCE_FILES) # Add Library add_library(nes-physical-operators ${NES_PHYSICAL_OPERATORS_SOURCE_FILES}) -target_link_libraries(nes-physical-operators PUBLIC nes-sources nes-sinks nes-nautilus nes-meos) +if(NES_ENABLE_MEOS) + target_link_libraries(nes-physical-operators PUBLIC nes-sources nes-sinks nes-nautilus nes-meos) +else() + target_link_libraries(nes-physical-operators PUBLIC nes-sources nes-sinks nes-nautilus) +endif() target_include_directories(nes-physical-operators PUBLIC $ $) diff --git a/nes-physical-operators/src/Aggregation/Function/Meos/CMakeLists.txt b/nes-physical-operators/src/Aggregation/Function/Meos/CMakeLists.txt index c34e12f47e..0b107d5c2a 100644 --- a/nes-physical-operators/src/Aggregation/Function/Meos/CMakeLists.txt +++ b/nes-physical-operators/src/Aggregation/Function/Meos/CMakeLists.txt @@ -10,5 +10,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +if(NES_ENABLE_MEOS) add_plugin(TemporalSequence AggregationPhysicalFunction nes-physical-operators TemporalSequenceAggregationPhysicalFunction.cpp) add_plugin(Var AggregationPhysicalFunction nes-physical-operators VarAggregationFunction.cpp) +endif() diff --git a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt index 516cdce4c3..cf83ac5aad 100644 --- a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt @@ -10,9 +10,11 @@ # See the License for the specific language governing permissions and # limitations under the License. +if(NES_ENABLE_MEOS) add_plugin(TemporalIntersects PhysicalFunction nes-physical-operators TemporalIntersectsPhysicalFunction.cpp) add_plugin(TemporalIntersectsGeometry PhysicalFunction nes-physical-operators TemporalIntersectsGeometryPhysicalFunction.cpp) add_plugin(TemporalAIntersectsGeometry PhysicalFunction nes-physical-operators TemporalAIntersectsGeometryPhysicalFunction.cpp) add_plugin(TemporalEContainsGeometry PhysicalFunction nes-physical-operators TemporalEContainsGeometryPhysicalFunction.cpp) add_plugin(TemporalEDWithinGeometry PhysicalFunction nes-physical-operators TemporalEDWithinGeometryPhysicalFunction.cpp) add_plugin(TemporalAtStBox PhysicalFunction nes-physical-operators TemporalAtStBoxPhysicalFunction.cpp) +endif() diff --git a/nes-plugins/CMakeLists.txt b/nes-plugins/CMakeLists.txt index e666dd616e..3d33385853 100644 --- a/nes-plugins/CMakeLists.txt +++ b/nes-plugins/CMakeLists.txt @@ -20,33 +20,36 @@ activate_optional_plugin("Sources/TCPSource" ON) # Enable the Generator source plugin; required by systests and repl tests activate_optional_plugin("Sources/GeneratorSource" ON) activate_optional_plugin("Sinks/VoidSink" ON) -activate_optional_plugin("Sources/MQTTSource" ON) -activate_optional_plugin("Sinks/MQTTSink" ON) - -# MEOS is a dependency -activate_optional_plugin("MEOS" ON) -message(STATUS "Enable MEOS Plugin") - -# Detect the platform -if (APPLE) - message(STATUS "Building on macOS") - # Set the include and library directories for Homebrew (macOS) - set(MEOS_INCLUDE_DIR "/opt/homebrew/include" CACHE PATH "Path to MEOS include directory") - set(MEOS_PLUGIN_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include" CACHE PATH "Path to MEOS plugin include directory") - include_directories(SYSTEM ${MEOS_INCLUDE_DIR} ${MEOS_PLUGIN_INCLUDE_DIR}) - include_directories(SYSTEM ${MEOS_INCLUDE_DIR} ${MEOS_PLUGIN_INCLUDE_DIR}) - link_directories(${MEOS_LIBRARY_DIR} ) - -else() - message(STATUS "Building on Linux") - - # Default behavior for Linux - find_package(meos REQUIRED) - if(meos_FOUND) - message(STATUS "MEOS found: include=${meos_INCLUDE_DIR}, library=${meos}") - include_directories(SYSTEM ${meos_INCLUDE_DIR}) +option(NES_ENABLE_MQTT "Enable MQTT source and sink plugins (requires PahoMqttCpp)" ON) +activate_optional_plugin("Sources/MQTTSource" ${NES_ENABLE_MQTT}) +activate_optional_plugin("Sinks/MQTTSink" ${NES_ENABLE_MQTT}) + +option(NES_ENABLE_MEOS "Enable MEOS plugin (requires libmeos installed on the system)" ON) +activate_optional_plugin("MEOS" ${NES_ENABLE_MEOS}) +if (NES_ENABLE_MEOS) + message(STATUS "Enable MEOS Plugin") + + # Detect the platform + if (APPLE) + message(STATUS "Building on macOS") + # Set the include and library directories for Homebrew (macOS) + set(MEOS_INCLUDE_DIR "/opt/homebrew/include" CACHE PATH "Path to MEOS include directory") + set(MEOS_PLUGIN_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include" CACHE PATH "Path to MEOS plugin include directory") + include_directories(SYSTEM ${MEOS_INCLUDE_DIR} ${MEOS_PLUGIN_INCLUDE_DIR}) + include_directories(SYSTEM ${MEOS_INCLUDE_DIR} ${MEOS_PLUGIN_INCLUDE_DIR}) + link_directories(${MEOS_LIBRARY_DIR} ) + else() - message(FATAL_ERROR "MEOS library not found") + message(STATUS "Building on Linux") + + # Default behavior for Linux + find_package(meos REQUIRED) + if(meos_FOUND) + message(STATUS "MEOS found: include=${meos_INCLUDE_DIR}, library=${meos}") + include_directories(SYSTEM ${meos_INCLUDE_DIR}) + else() + message(FATAL_ERROR "MEOS library not found") + endif() endif() endif() diff --git a/nes-plugins/Sinks/MQTTSink/CMakeLists.txt b/nes-plugins/Sinks/MQTTSink/CMakeLists.txt index 4bf42deeab..80b3122e89 100644 --- a/nes-plugins/Sinks/MQTTSink/CMakeLists.txt +++ b/nes-plugins/Sinks/MQTTSink/CMakeLists.txt @@ -23,5 +23,10 @@ target_include_directories(mqtt_sink_validation_plugin_library ) find_package(PahoMqttCpp CONFIG REQUIRED) -target_link_libraries(mqtt_sink_plugin_library PRIVATE PahoMqttCpp::paho-mqttpp3-static) -target_link_libraries(mqtt_sink_validation_plugin_library PRIVATE PahoMqttCpp::paho-mqttpp3-static) +if(TARGET PahoMqttCpp::paho-mqttpp3-static) + target_link_libraries(mqtt_sink_plugin_library PRIVATE PahoMqttCpp::paho-mqttpp3-static) + target_link_libraries(mqtt_sink_validation_plugin_library PRIVATE PahoMqttCpp::paho-mqttpp3-static) +else() + target_link_libraries(mqtt_sink_plugin_library PRIVATE PahoMqttCpp::paho-mqttpp3) + target_link_libraries(mqtt_sink_validation_plugin_library PRIVATE PahoMqttCpp::paho-mqttpp3) +endif() diff --git a/nes-plugins/Sources/MQTTSource/CMakeLists.txt b/nes-plugins/Sources/MQTTSource/CMakeLists.txt index 9f9ed0dd17..27db6702a0 100644 --- a/nes-plugins/Sources/MQTTSource/CMakeLists.txt +++ b/nes-plugins/Sources/MQTTSource/CMakeLists.txt @@ -23,5 +23,10 @@ target_include_directories(mqtt_source_validation_plugin_library ) find_package(PahoMqttCpp CONFIG REQUIRED) -target_link_libraries(mqtt_source_plugin_library PRIVATE PahoMqttCpp::paho-mqttpp3-static) -target_link_libraries(mqtt_source_validation_plugin_library PRIVATE PahoMqttCpp::paho-mqttpp3-static) +if(TARGET PahoMqttCpp::paho-mqttpp3-static) + target_link_libraries(mqtt_source_plugin_library PRIVATE PahoMqttCpp::paho-mqttpp3-static) + target_link_libraries(mqtt_source_validation_plugin_library PRIVATE PahoMqttCpp::paho-mqttpp3-static) +else() + target_link_libraries(mqtt_source_plugin_library PRIVATE PahoMqttCpp::paho-mqttpp3) + target_link_libraries(mqtt_source_validation_plugin_library PRIVATE PahoMqttCpp::paho-mqttpp3) +endif() diff --git a/nes-query-optimizer/src/RewriteRules/LowerToPhysical/LowerToPhysicalWindowedAggregation.cpp b/nes-query-optimizer/src/RewriteRules/LowerToPhysical/LowerToPhysicalWindowedAggregation.cpp index c994b91a9d..eb667c31ed 100644 --- a/nes-query-optimizer/src/RewriteRules/LowerToPhysical/LowerToPhysicalWindowedAggregation.cpp +++ b/nes-query-optimizer/src/RewriteRules/LowerToPhysical/LowerToPhysicalWindowedAggregation.cpp @@ -54,8 +54,10 @@ #include #include // Special-case lowering for TEMPORAL_SEQUENCE (multi-input) aggregation +#ifdef NES_ENABLE_MEOS #include #include +#endif namespace NES { @@ -128,6 +130,7 @@ getAggregationPhysicalFunctions(const WindowedAggregationLogicalOperator& logica const auto name = descriptor->getName(); // Custom lowering path for TEMPORAL_SEQUENCE: needs three field functions (lon, lat, ts) +#ifdef NES_ENABLE_MEOS if (name == std::string_view("TemporalSequence")) { auto tsDescriptor = std::dynamic_pointer_cast(descriptor); @@ -159,6 +162,7 @@ getAggregationPhysicalFunctions(const WindowedAggregationLogicalOperator& logica aggregationPhysicalFunctions.push_back(std::move(phys)); continue; } +#endif // Default path: use registry for single-input aggregations auto aggregationInputFunction = QueryCompilation::FunctionProvider::lowerFunction(descriptor->onField); From a23e82941b27ec8f546f7ebe1e88feffd33927c0 Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Thu, 11 Jun 2026 19:43:52 +0200 Subject: [PATCH 02/96] feat(nebula): wire per-event tfloat_sin/tfloat_cos/tfloat_tan (W44) 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. --- .../Meos/TfloatCosLogicalFunction.hpp | 53 +++++++++ .../Meos/TfloatSinLogicalFunction.hpp | 53 +++++++++ .../Meos/TfloatTanLogicalFunction.hpp | 53 +++++++++ .../src/Functions/Meos/CMakeLists.txt | 3 + .../Meos/TfloatCosLogicalFunction.cpp | 102 ++++++++++++++++++ .../Meos/TfloatSinLogicalFunction.cpp | 102 ++++++++++++++++++ .../Meos/TfloatTanLogicalFunction.cpp | 102 ++++++++++++++++++ .../Meos/TfloatCosPhysicalFunction.hpp | 42 ++++++++ .../Meos/TfloatSinPhysicalFunction.hpp | 42 ++++++++ .../Meos/TfloatTanPhysicalFunction.hpp | 42 ++++++++ .../src/Functions/Meos/CMakeLists.txt | 3 + .../Meos/TfloatCosPhysicalFunction.cpp | 87 +++++++++++++++ .../Meos/TfloatSinPhysicalFunction.cpp | 87 +++++++++++++++ .../Meos/TfloatTanPhysicalFunction.cpp | 87 +++++++++++++++ nes-sql-parser/AntlrSQL.g4 | 5 +- .../src/AntlrSQLQueryPlanCreator.cpp | 87 +++++++++++++++ 16 files changed, 949 insertions(+), 1 deletion(-) create mode 100644 nes-logical-operators/include/Functions/Meos/TfloatCosLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TfloatSinLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TfloatTanLogicalFunction.hpp create mode 100644 nes-logical-operators/src/Functions/Meos/TfloatCosLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TfloatSinLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TfloatTanLogicalFunction.cpp create mode 100644 nes-physical-operators/include/Functions/Meos/TfloatCosPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TfloatSinPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TfloatTanPhysicalFunction.hpp create mode 100644 nes-physical-operators/src/Functions/Meos/TfloatCosPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TfloatSinPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TfloatTanPhysicalFunction.cpp diff --git a/nes-logical-operators/include/Functions/Meos/TfloatCosLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TfloatCosLogicalFunction.hpp new file mode 100644 index 0000000000..24b170ae4a --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TfloatCosLogicalFunction.hpp @@ -0,0 +1,53 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event tfloat_cos: single-instant tfloat transform, value extracted -> double. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `tfloat_cos`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. + */ +class TfloatCosLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TfloatCos"; + + TfloatCosLogicalFunction(LogicalFunction value, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TfloatSinLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TfloatSinLogicalFunction.hpp new file mode 100644 index 0000000000..310cc68ce4 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TfloatSinLogicalFunction.hpp @@ -0,0 +1,53 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event tfloat_sin: single-instant tfloat transform, value extracted -> double. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `tfloat_sin`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. + */ +class TfloatSinLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TfloatSin"; + + TfloatSinLogicalFunction(LogicalFunction value, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TfloatTanLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TfloatTanLogicalFunction.hpp new file mode 100644 index 0000000000..e5a4fe48a1 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TfloatTanLogicalFunction.hpp @@ -0,0 +1,53 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event tfloat_tan: single-instant tfloat transform, value extracted -> double. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `tfloat_tan`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. + */ +class TfloatTanLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TfloatTan"; + + TfloatTanLogicalFunction(LogicalFunction value, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt index 474ba11608..afc5785b55 100644 --- a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt @@ -18,3 +18,6 @@ add_plugin(TemporalAIntersectsGeometry LogicalFunction nes-logical-operators Tem add_plugin(TemporalEContainsGeometry LogicalFunction nes-logical-operators TemporalEContainsGeometryLogicalFunction.cpp) add_plugin(TemporalEDWithinGeometry LogicalFunction nes-logical-operators TemporalEDWithinGeometryLogicalFunction.cpp) add_plugin(TemporalAtStBox LogicalFunction nes-logical-operators TemporalAtStBoxLogicalFunction.cpp) +add_plugin(TfloatCos LogicalFunction nes-logical-operators TfloatCosLogicalFunction.cpp) +add_plugin(TfloatSin LogicalFunction nes-logical-operators TfloatSinLogicalFunction.cpp) +add_plugin(TfloatTan LogicalFunction nes-logical-operators TfloatTanLogicalFunction.cpp) diff --git a/nes-logical-operators/src/Functions/Meos/TfloatCosLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TfloatCosLogicalFunction.cpp new file mode 100644 index 0000000000..eb907da9d1 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TfloatCosLogicalFunction.cpp @@ -0,0 +1,102 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TfloatCosLogicalFunction::TfloatCosLogicalFunction(LogicalFunction value, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(2); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(ts)); +} + +DataType TfloatCosLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction TfloatCosLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector TfloatCosLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction TfloatCosLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 2, "TfloatCosLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view TfloatCosLogicalFunction::getType() const { return NAME; } + +bool TfloatCosLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string TfloatCosLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TfloatCosLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction TfloatCosLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTfloatCosLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 2, + "TfloatCosLogicalFunction requires 2 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + return TfloatCosLogicalFunction(std::move(arg0), std::move(arg1)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TfloatSinLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TfloatSinLogicalFunction.cpp new file mode 100644 index 0000000000..5c47c9dfb1 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TfloatSinLogicalFunction.cpp @@ -0,0 +1,102 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TfloatSinLogicalFunction::TfloatSinLogicalFunction(LogicalFunction value, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(2); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(ts)); +} + +DataType TfloatSinLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction TfloatSinLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector TfloatSinLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction TfloatSinLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 2, "TfloatSinLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view TfloatSinLogicalFunction::getType() const { return NAME; } + +bool TfloatSinLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string TfloatSinLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TfloatSinLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction TfloatSinLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTfloatSinLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 2, + "TfloatSinLogicalFunction requires 2 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + return TfloatSinLogicalFunction(std::move(arg0), std::move(arg1)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TfloatTanLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TfloatTanLogicalFunction.cpp new file mode 100644 index 0000000000..6ba0768d9f --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TfloatTanLogicalFunction.cpp @@ -0,0 +1,102 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TfloatTanLogicalFunction::TfloatTanLogicalFunction(LogicalFunction value, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(2); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(ts)); +} + +DataType TfloatTanLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction TfloatTanLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector TfloatTanLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction TfloatTanLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 2, "TfloatTanLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view TfloatTanLogicalFunction::getType() const { return NAME; } + +bool TfloatTanLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string TfloatTanLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TfloatTanLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction TfloatTanLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTfloatTanLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 2, + "TfloatTanLogicalFunction requires 2 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + return TfloatTanLogicalFunction(std::move(arg0), std::move(arg1)); +} + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TfloatCosPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TfloatCosPhysicalFunction.hpp new file mode 100644 index 0000000000..34d43117b7 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TfloatCosPhysicalFunction.hpp @@ -0,0 +1,42 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `tfloat_cos`. + * + * Per-event tfloat_cos: single-instant tfloat transform, value extracted -> double. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TfloatCosPhysicalFunction : public PhysicalFunctionConcept { +public: + TfloatCosPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TfloatSinPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TfloatSinPhysicalFunction.hpp new file mode 100644 index 0000000000..5e682a44fc --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TfloatSinPhysicalFunction.hpp @@ -0,0 +1,42 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `tfloat_sin`. + * + * Per-event tfloat_sin: single-instant tfloat transform, value extracted -> double. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TfloatSinPhysicalFunction : public PhysicalFunctionConcept { +public: + TfloatSinPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TfloatTanPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TfloatTanPhysicalFunction.hpp new file mode 100644 index 0000000000..0af2a0d03c --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TfloatTanPhysicalFunction.hpp @@ -0,0 +1,42 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `tfloat_tan`. + * + * Per-event tfloat_tan: single-instant tfloat transform, value extracted -> double. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TfloatTanPhysicalFunction : public PhysicalFunctionConcept { +public: + TfloatTanPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt index cf83ac5aad..b6c45ca0c6 100644 --- a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt @@ -17,4 +17,7 @@ add_plugin(TemporalAIntersectsGeometry PhysicalFunction nes-physical-operators T add_plugin(TemporalEContainsGeometry PhysicalFunction nes-physical-operators TemporalEContainsGeometryPhysicalFunction.cpp) add_plugin(TemporalEDWithinGeometry PhysicalFunction nes-physical-operators TemporalEDWithinGeometryPhysicalFunction.cpp) add_plugin(TemporalAtStBox PhysicalFunction nes-physical-operators TemporalAtStBoxPhysicalFunction.cpp) +add_plugin(TfloatCos PhysicalFunction nes-physical-operators TfloatCosPhysicalFunction.cpp) +add_plugin(TfloatSin PhysicalFunction nes-physical-operators TfloatSinPhysicalFunction.cpp) +add_plugin(TfloatTan PhysicalFunction nes-physical-operators TfloatTanPhysicalFunction.cpp) endif() diff --git a/nes-physical-operators/src/Functions/Meos/TfloatCosPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TfloatCosPhysicalFunction.cpp new file mode 100644 index 0000000000..0094b419db --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TfloatCosPhysicalFunction.cpp @@ -0,0 +1,87 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +TfloatCosPhysicalFunction::TfloatCosPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(2); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal TfloatCosPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto ts = parameterValues[1].cast>(); + + const auto result = nautilus::invoke( + +[](double value, uint64_t ts) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string tempWkt = fmt::format("{}@{}", value, MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tfloat_in(tempWkt.c_str()); + if (!temp) return 0.0; + Temporal* res = tfloat_cos(temp); + free(temp); + if (!res) return 0.0; + double r = tfloat_start_value(res); + free(res); + return r; + } catch (const std::exception&) { return 0.0; } + }, + value, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTfloatCosPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 2, + "TfloatCosPhysicalFunction requires 2 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + return TfloatCosPhysicalFunction(std::move(arg0), std::move(arg1)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TfloatSinPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TfloatSinPhysicalFunction.cpp new file mode 100644 index 0000000000..de62924a86 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TfloatSinPhysicalFunction.cpp @@ -0,0 +1,87 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +TfloatSinPhysicalFunction::TfloatSinPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(2); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal TfloatSinPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto ts = parameterValues[1].cast>(); + + const auto result = nautilus::invoke( + +[](double value, uint64_t ts) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string tempWkt = fmt::format("{}@{}", value, MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tfloat_in(tempWkt.c_str()); + if (!temp) return 0.0; + Temporal* res = tfloat_sin(temp); + free(temp); + if (!res) return 0.0; + double r = tfloat_start_value(res); + free(res); + return r; + } catch (const std::exception&) { return 0.0; } + }, + value, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTfloatSinPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 2, + "TfloatSinPhysicalFunction requires 2 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + return TfloatSinPhysicalFunction(std::move(arg0), std::move(arg1)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TfloatTanPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TfloatTanPhysicalFunction.cpp new file mode 100644 index 0000000000..0111ebc7ce --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TfloatTanPhysicalFunction.cpp @@ -0,0 +1,87 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +TfloatTanPhysicalFunction::TfloatTanPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(2); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal TfloatTanPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto ts = parameterValues[1].cast>(); + + const auto result = nautilus::invoke( + +[](double value, uint64_t ts) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string tempWkt = fmt::format("{}@{}", value, MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tfloat_in(tempWkt.c_str()); + if (!temp) return 0.0; + Temporal* res = tfloat_tan(temp); + free(temp); + if (!res) return 0.0; + double r = tfloat_start_value(res); + free(res); + return r; + } catch (const std::exception&) { return 0.0; } + }, + value, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTfloatTanPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 2, + "TfloatTanPhysicalFunction requires 2 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + return TfloatTanPhysicalFunction(std::move(arg0), std::move(arg1)); +} + +} // namespace NES diff --git a/nes-sql-parser/AntlrSQL.g4 b/nes-sql-parser/AntlrSQL.g4 index 256726e087..9e6c7cdb13 100644 --- a/nes-sql-parser/AntlrSQL.g4 +++ b/nes-sql-parser/AntlrSQL.g4 @@ -295,7 +295,7 @@ timeUnit: MS timestampParameter: name=identifier; -functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | EDWITHIN_TGEO_GEO | TGEO_AT_STBOX; +functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | EDWITHIN_TGEO_GEO | TGEO_AT_STBOX | TFLOAT_COS | TFLOAT_SIN | TFLOAT_TAN; sinkClause: INTO sink (',' sink)*; @@ -488,6 +488,9 @@ TEMPORAL_AINTERSECTS_GEOMETRY: 'TEMPORAL_AINTERSECTS_GEOMETRY' | 'temporal_ainte TEMPORAL_ECONTAINS_GEOMETRY: 'TEMPORAL_ECONTAINS_GEOMETRY' | 'temporal_econtains_geometry'; EDWITHIN_TGEO_GEO: 'EDWITHIN_TGEO_GEO' | 'edwithin_tgeo_geo'; TGEO_AT_STBOX: 'TGEO_AT_STBOX' | 'tgeo_at_stbox'; +TFLOAT_COS: 'TFLOAT_COS' | 'tfloat_cos'; +TFLOAT_SIN: 'TFLOAT_SIN' | 'tfloat_sin'; +TFLOAT_TAN: 'TFLOAT_TAN' | 'tfloat_tan'; WATERMARK: 'WATERMARK' | 'watermark'; OFFSET: 'OFFSET' | 'offset'; LOCALHOST: 'LOCALHOST' | 'localhost'; diff --git a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp index 4e9f1d7642..e3a39cb9ba 100644 --- a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp +++ b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp @@ -69,6 +69,9 @@ #include #include #include +#include +#include +#include #include #include #include @@ -1187,6 +1190,90 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont TemporalAtStBoxLogicalFunction(lonFunction, latFunction, timestampFunction, stboxFunction, borderFlag)); } break; + /* BEGIN CODEGEN PARSER GLUE: TFLOAT_COS */ + case AntlrSQLLexer::TFLOAT_COS: + { + const auto argCount = context->expression().size(); + if (argCount != 2) + throw InvalidQuerySyntax("TFLOAT_COS requires exactly 2 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(TfloatCosLogicalFunction(a0, a1)); + } + break; + /* END CODEGEN PARSER GLUE: TFLOAT_COS */ + /* BEGIN CODEGEN PARSER GLUE: TFLOAT_SIN */ + case AntlrSQLLexer::TFLOAT_SIN: + { + const auto argCount = context->expression().size(); + if (argCount != 2) + throw InvalidQuerySyntax("TFLOAT_SIN requires exactly 2 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(TfloatSinLogicalFunction(a0, a1)); + } + break; + /* END CODEGEN PARSER GLUE: TFLOAT_SIN */ + /* BEGIN CODEGEN PARSER GLUE: TFLOAT_TAN */ + case AntlrSQLLexer::TFLOAT_TAN: + { + const auto argCount = context->expression().size(); + if (argCount != 2) + throw InvalidQuerySyntax("TFLOAT_TAN requires exactly 2 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(TfloatTanLogicalFunction(a0, a1)); + } + break; + /* END CODEGEN PARSER GLUE: TFLOAT_TAN */ default: /// Check if the function is a constructor for a datatype From be23758e7d19e850366a54086bc5f09f39aee48d Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Fri, 12 Jun 2026 00:24:55 +0200 Subject: [PATCH 03/96] feat(nebula): wire per-event tfloat_ceil/floor/radians/degrees (W45) 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. --- .../Meos/TfloatCeilLogicalFunction.hpp | 53 ++++++++ .../Meos/TfloatDegreesLogicalFunction.hpp | 53 ++++++++ .../Meos/TfloatFloorLogicalFunction.hpp | 53 ++++++++ .../Meos/TfloatRadiansLogicalFunction.hpp | 53 ++++++++ .../src/Functions/Meos/CMakeLists.txt | 4 + .../Meos/TfloatCeilLogicalFunction.cpp | 102 +++++++++++++++ .../Meos/TfloatDegreesLogicalFunction.cpp | 102 +++++++++++++++ .../Meos/TfloatFloorLogicalFunction.cpp | 102 +++++++++++++++ .../Meos/TfloatRadiansLogicalFunction.cpp | 102 +++++++++++++++ .../Meos/TfloatCeilPhysicalFunction.hpp | 42 +++++++ .../Meos/TfloatDegreesPhysicalFunction.hpp | 42 +++++++ .../Meos/TfloatFloorPhysicalFunction.hpp | 42 +++++++ .../Meos/TfloatRadiansPhysicalFunction.hpp | 42 +++++++ .../src/Functions/Meos/CMakeLists.txt | 4 + .../Meos/TfloatCeilPhysicalFunction.cpp | 87 +++++++++++++ .../Meos/TfloatDegreesPhysicalFunction.cpp | 87 +++++++++++++ .../Meos/TfloatFloorPhysicalFunction.cpp | 87 +++++++++++++ .../Meos/TfloatRadiansPhysicalFunction.cpp | 87 +++++++++++++ nes-sql-parser/AntlrSQL.g4 | 6 +- .../src/AntlrSQLQueryPlanCreator.cpp | 116 ++++++++++++++++++ 20 files changed, 1265 insertions(+), 1 deletion(-) create mode 100644 nes-logical-operators/include/Functions/Meos/TfloatCeilLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TfloatDegreesLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TfloatFloorLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TfloatRadiansLogicalFunction.hpp create mode 100644 nes-logical-operators/src/Functions/Meos/TfloatCeilLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TfloatDegreesLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TfloatFloorLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TfloatRadiansLogicalFunction.cpp create mode 100644 nes-physical-operators/include/Functions/Meos/TfloatCeilPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TfloatDegreesPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TfloatFloorPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TfloatRadiansPhysicalFunction.hpp create mode 100644 nes-physical-operators/src/Functions/Meos/TfloatCeilPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TfloatDegreesPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TfloatFloorPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TfloatRadiansPhysicalFunction.cpp diff --git a/nes-logical-operators/include/Functions/Meos/TfloatCeilLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TfloatCeilLogicalFunction.hpp new file mode 100644 index 0000000000..e731cb516a --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TfloatCeilLogicalFunction.hpp @@ -0,0 +1,53 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event tfloat_ceil: single-instant tfloat transform, value extracted -> double. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `tfloat_ceil`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. + */ +class TfloatCeilLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TfloatCeil"; + + TfloatCeilLogicalFunction(LogicalFunction value, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TfloatDegreesLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TfloatDegreesLogicalFunction.hpp new file mode 100644 index 0000000000..80b70008c3 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TfloatDegreesLogicalFunction.hpp @@ -0,0 +1,53 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event tfloat_degrees: single-instant tfloat transform, value extracted -> double. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `tfloat_degrees` (normalize=false). Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. + */ +class TfloatDegreesLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TfloatDegrees"; + + TfloatDegreesLogicalFunction(LogicalFunction value, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TfloatFloorLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TfloatFloorLogicalFunction.hpp new file mode 100644 index 0000000000..8734d8a205 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TfloatFloorLogicalFunction.hpp @@ -0,0 +1,53 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event tfloat_floor: single-instant tfloat transform, value extracted -> double. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `tfloat_floor`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. + */ +class TfloatFloorLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TfloatFloor"; + + TfloatFloorLogicalFunction(LogicalFunction value, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TfloatRadiansLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TfloatRadiansLogicalFunction.hpp new file mode 100644 index 0000000000..cc5271f409 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TfloatRadiansLogicalFunction.hpp @@ -0,0 +1,53 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event tfloat_radians: single-instant tfloat transform, value extracted -> double. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `tfloat_radians`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. + */ +class TfloatRadiansLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TfloatRadians"; + + TfloatRadiansLogicalFunction(LogicalFunction value, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt index afc5785b55..42cd5a93f8 100644 --- a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt @@ -18,6 +18,10 @@ add_plugin(TemporalAIntersectsGeometry LogicalFunction nes-logical-operators Tem add_plugin(TemporalEContainsGeometry LogicalFunction nes-logical-operators TemporalEContainsGeometryLogicalFunction.cpp) add_plugin(TemporalEDWithinGeometry LogicalFunction nes-logical-operators TemporalEDWithinGeometryLogicalFunction.cpp) add_plugin(TemporalAtStBox LogicalFunction nes-logical-operators TemporalAtStBoxLogicalFunction.cpp) +add_plugin(TfloatCeil LogicalFunction nes-logical-operators TfloatCeilLogicalFunction.cpp) add_plugin(TfloatCos LogicalFunction nes-logical-operators TfloatCosLogicalFunction.cpp) +add_plugin(TfloatDegrees LogicalFunction nes-logical-operators TfloatDegreesLogicalFunction.cpp) +add_plugin(TfloatFloor LogicalFunction nes-logical-operators TfloatFloorLogicalFunction.cpp) +add_plugin(TfloatRadians LogicalFunction nes-logical-operators TfloatRadiansLogicalFunction.cpp) add_plugin(TfloatSin LogicalFunction nes-logical-operators TfloatSinLogicalFunction.cpp) add_plugin(TfloatTan LogicalFunction nes-logical-operators TfloatTanLogicalFunction.cpp) diff --git a/nes-logical-operators/src/Functions/Meos/TfloatCeilLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TfloatCeilLogicalFunction.cpp new file mode 100644 index 0000000000..79c19c517a --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TfloatCeilLogicalFunction.cpp @@ -0,0 +1,102 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TfloatCeilLogicalFunction::TfloatCeilLogicalFunction(LogicalFunction value, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(2); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(ts)); +} + +DataType TfloatCeilLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction TfloatCeilLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector TfloatCeilLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction TfloatCeilLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 2, "TfloatCeilLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view TfloatCeilLogicalFunction::getType() const { return NAME; } + +bool TfloatCeilLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string TfloatCeilLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TfloatCeilLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction TfloatCeilLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTfloatCeilLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 2, + "TfloatCeilLogicalFunction requires 2 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + return TfloatCeilLogicalFunction(std::move(arg0), std::move(arg1)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TfloatDegreesLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TfloatDegreesLogicalFunction.cpp new file mode 100644 index 0000000000..d7ecfd0f63 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TfloatDegreesLogicalFunction.cpp @@ -0,0 +1,102 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TfloatDegreesLogicalFunction::TfloatDegreesLogicalFunction(LogicalFunction value, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(2); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(ts)); +} + +DataType TfloatDegreesLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction TfloatDegreesLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector TfloatDegreesLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction TfloatDegreesLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 2, "TfloatDegreesLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view TfloatDegreesLogicalFunction::getType() const { return NAME; } + +bool TfloatDegreesLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string TfloatDegreesLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TfloatDegreesLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction TfloatDegreesLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTfloatDegreesLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 2, + "TfloatDegreesLogicalFunction requires 2 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + return TfloatDegreesLogicalFunction(std::move(arg0), std::move(arg1)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TfloatFloorLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TfloatFloorLogicalFunction.cpp new file mode 100644 index 0000000000..3c9196c92e --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TfloatFloorLogicalFunction.cpp @@ -0,0 +1,102 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TfloatFloorLogicalFunction::TfloatFloorLogicalFunction(LogicalFunction value, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(2); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(ts)); +} + +DataType TfloatFloorLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction TfloatFloorLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector TfloatFloorLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction TfloatFloorLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 2, "TfloatFloorLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view TfloatFloorLogicalFunction::getType() const { return NAME; } + +bool TfloatFloorLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string TfloatFloorLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TfloatFloorLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction TfloatFloorLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTfloatFloorLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 2, + "TfloatFloorLogicalFunction requires 2 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + return TfloatFloorLogicalFunction(std::move(arg0), std::move(arg1)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TfloatRadiansLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TfloatRadiansLogicalFunction.cpp new file mode 100644 index 0000000000..fff28b7bca --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TfloatRadiansLogicalFunction.cpp @@ -0,0 +1,102 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TfloatRadiansLogicalFunction::TfloatRadiansLogicalFunction(LogicalFunction value, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(2); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(ts)); +} + +DataType TfloatRadiansLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction TfloatRadiansLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector TfloatRadiansLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction TfloatRadiansLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 2, "TfloatRadiansLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view TfloatRadiansLogicalFunction::getType() const { return NAME; } + +bool TfloatRadiansLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string TfloatRadiansLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TfloatRadiansLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction TfloatRadiansLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTfloatRadiansLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 2, + "TfloatRadiansLogicalFunction requires 2 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + return TfloatRadiansLogicalFunction(std::move(arg0), std::move(arg1)); +} + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TfloatCeilPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TfloatCeilPhysicalFunction.hpp new file mode 100644 index 0000000000..984628086f --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TfloatCeilPhysicalFunction.hpp @@ -0,0 +1,42 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `tfloat_ceil`. + * + * Per-event tfloat_ceil: single-instant tfloat transform, value extracted -> double. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TfloatCeilPhysicalFunction : public PhysicalFunctionConcept { +public: + TfloatCeilPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TfloatDegreesPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TfloatDegreesPhysicalFunction.hpp new file mode 100644 index 0000000000..261eb72f71 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TfloatDegreesPhysicalFunction.hpp @@ -0,0 +1,42 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `tfloat_degrees`. + * + * Per-event tfloat_degrees (normalize=false): single-instant tfloat transform, value extracted -> double. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TfloatDegreesPhysicalFunction : public PhysicalFunctionConcept { +public: + TfloatDegreesPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TfloatFloorPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TfloatFloorPhysicalFunction.hpp new file mode 100644 index 0000000000..0e557615a4 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TfloatFloorPhysicalFunction.hpp @@ -0,0 +1,42 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `tfloat_floor`. + * + * Per-event tfloat_floor: single-instant tfloat transform, value extracted -> double. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TfloatFloorPhysicalFunction : public PhysicalFunctionConcept { +public: + TfloatFloorPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TfloatRadiansPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TfloatRadiansPhysicalFunction.hpp new file mode 100644 index 0000000000..35d25c6f0b --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TfloatRadiansPhysicalFunction.hpp @@ -0,0 +1,42 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `tfloat_radians`. + * + * Per-event tfloat_radians: single-instant tfloat transform, value extracted -> double. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TfloatRadiansPhysicalFunction : public PhysicalFunctionConcept { +public: + TfloatRadiansPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt index b6c45ca0c6..01078c3d7e 100644 --- a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt @@ -17,7 +17,11 @@ add_plugin(TemporalAIntersectsGeometry PhysicalFunction nes-physical-operators T add_plugin(TemporalEContainsGeometry PhysicalFunction nes-physical-operators TemporalEContainsGeometryPhysicalFunction.cpp) add_plugin(TemporalEDWithinGeometry PhysicalFunction nes-physical-operators TemporalEDWithinGeometryPhysicalFunction.cpp) add_plugin(TemporalAtStBox PhysicalFunction nes-physical-operators TemporalAtStBoxPhysicalFunction.cpp) +add_plugin(TfloatCeil PhysicalFunction nes-physical-operators TfloatCeilPhysicalFunction.cpp) add_plugin(TfloatCos PhysicalFunction nes-physical-operators TfloatCosPhysicalFunction.cpp) +add_plugin(TfloatDegrees PhysicalFunction nes-physical-operators TfloatDegreesPhysicalFunction.cpp) +add_plugin(TfloatFloor PhysicalFunction nes-physical-operators TfloatFloorPhysicalFunction.cpp) +add_plugin(TfloatRadians PhysicalFunction nes-physical-operators TfloatRadiansPhysicalFunction.cpp) add_plugin(TfloatSin PhysicalFunction nes-physical-operators TfloatSinPhysicalFunction.cpp) add_plugin(TfloatTan PhysicalFunction nes-physical-operators TfloatTanPhysicalFunction.cpp) endif() diff --git a/nes-physical-operators/src/Functions/Meos/TfloatCeilPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TfloatCeilPhysicalFunction.cpp new file mode 100644 index 0000000000..bb3c5d6d7b --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TfloatCeilPhysicalFunction.cpp @@ -0,0 +1,87 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +TfloatCeilPhysicalFunction::TfloatCeilPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(2); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal TfloatCeilPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto ts = parameterValues[1].cast>(); + + const auto result = nautilus::invoke( + +[](double value, uint64_t ts) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string tempWkt = fmt::format("{}@{}", value, MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tfloat_in(tempWkt.c_str()); + if (!temp) return 0.0; + Temporal* res = tfloat_ceil(temp); + free(temp); + if (!res) return 0.0; + double r = tfloat_start_value(res); + free(res); + return r; + } catch (const std::exception&) { return 0.0; } + }, + value, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTfloatCeilPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 2, + "TfloatCeilPhysicalFunction requires 2 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + return TfloatCeilPhysicalFunction(std::move(arg0), std::move(arg1)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TfloatDegreesPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TfloatDegreesPhysicalFunction.cpp new file mode 100644 index 0000000000..30871136e7 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TfloatDegreesPhysicalFunction.cpp @@ -0,0 +1,87 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +TfloatDegreesPhysicalFunction::TfloatDegreesPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(2); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal TfloatDegreesPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto ts = parameterValues[1].cast>(); + + const auto result = nautilus::invoke( + +[](double value, uint64_t ts) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string tempWkt = fmt::format("{}@{}", value, MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tfloat_in(tempWkt.c_str()); + if (!temp) return 0.0; + Temporal* res = tfloat_degrees(temp, false); + free(temp); + if (!res) return 0.0; + double r = tfloat_start_value(res); + free(res); + return r; + } catch (const std::exception&) { return 0.0; } + }, + value, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTfloatDegreesPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 2, + "TfloatDegreesPhysicalFunction requires 2 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + return TfloatDegreesPhysicalFunction(std::move(arg0), std::move(arg1)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TfloatFloorPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TfloatFloorPhysicalFunction.cpp new file mode 100644 index 0000000000..3a3ba34521 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TfloatFloorPhysicalFunction.cpp @@ -0,0 +1,87 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +TfloatFloorPhysicalFunction::TfloatFloorPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(2); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal TfloatFloorPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto ts = parameterValues[1].cast>(); + + const auto result = nautilus::invoke( + +[](double value, uint64_t ts) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string tempWkt = fmt::format("{}@{}", value, MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tfloat_in(tempWkt.c_str()); + if (!temp) return 0.0; + Temporal* res = tfloat_floor(temp); + free(temp); + if (!res) return 0.0; + double r = tfloat_start_value(res); + free(res); + return r; + } catch (const std::exception&) { return 0.0; } + }, + value, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTfloatFloorPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 2, + "TfloatFloorPhysicalFunction requires 2 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + return TfloatFloorPhysicalFunction(std::move(arg0), std::move(arg1)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TfloatRadiansPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TfloatRadiansPhysicalFunction.cpp new file mode 100644 index 0000000000..7988802ffb --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TfloatRadiansPhysicalFunction.cpp @@ -0,0 +1,87 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +TfloatRadiansPhysicalFunction::TfloatRadiansPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(2); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal TfloatRadiansPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto ts = parameterValues[1].cast>(); + + const auto result = nautilus::invoke( + +[](double value, uint64_t ts) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string tempWkt = fmt::format("{}@{}", value, MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tfloat_in(tempWkt.c_str()); + if (!temp) return 0.0; + Temporal* res = tfloat_radians(temp); + free(temp); + if (!res) return 0.0; + double r = tfloat_start_value(res); + free(res); + return r; + } catch (const std::exception&) { return 0.0; } + }, + value, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTfloatRadiansPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 2, + "TfloatRadiansPhysicalFunction requires 2 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + return TfloatRadiansPhysicalFunction(std::move(arg0), std::move(arg1)); +} + +} // namespace NES diff --git a/nes-sql-parser/AntlrSQL.g4 b/nes-sql-parser/AntlrSQL.g4 index 9e6c7cdb13..27c7a40be8 100644 --- a/nes-sql-parser/AntlrSQL.g4 +++ b/nes-sql-parser/AntlrSQL.g4 @@ -295,7 +295,7 @@ timeUnit: MS timestampParameter: name=identifier; -functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | EDWITHIN_TGEO_GEO | TGEO_AT_STBOX | TFLOAT_COS | TFLOAT_SIN | TFLOAT_TAN; +functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | EDWITHIN_TGEO_GEO | TGEO_AT_STBOX | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_FLOOR | TFLOAT_RADIANS | TFLOAT_SIN | TFLOAT_TAN; sinkClause: INTO sink (',' sink)*; @@ -488,7 +488,11 @@ TEMPORAL_AINTERSECTS_GEOMETRY: 'TEMPORAL_AINTERSECTS_GEOMETRY' | 'temporal_ainte TEMPORAL_ECONTAINS_GEOMETRY: 'TEMPORAL_ECONTAINS_GEOMETRY' | 'temporal_econtains_geometry'; EDWITHIN_TGEO_GEO: 'EDWITHIN_TGEO_GEO' | 'edwithin_tgeo_geo'; TGEO_AT_STBOX: 'TGEO_AT_STBOX' | 'tgeo_at_stbox'; +TFLOAT_CEIL: 'TFLOAT_CEIL' | 'tfloat_ceil'; TFLOAT_COS: 'TFLOAT_COS' | 'tfloat_cos'; +TFLOAT_DEGREES: 'TFLOAT_DEGREES' | 'tfloat_degrees'; +TFLOAT_FLOOR: 'TFLOAT_FLOOR' | 'tfloat_floor'; +TFLOAT_RADIANS: 'TFLOAT_RADIANS' | 'tfloat_radians'; TFLOAT_SIN: 'TFLOAT_SIN' | 'tfloat_sin'; TFLOAT_TAN: 'TFLOAT_TAN' | 'tfloat_tan'; WATERMARK: 'WATERMARK' | 'watermark'; diff --git a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp index e3a39cb9ba..48405d5879 100644 --- a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp +++ b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp @@ -69,7 +69,11 @@ #include #include #include +#include #include +#include +#include +#include #include #include #include @@ -1274,6 +1278,118 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont } break; /* END CODEGEN PARSER GLUE: TFLOAT_TAN */ + /* BEGIN CODEGEN PARSER GLUE: TFLOAT_CEIL */ + case AntlrSQLLexer::TFLOAT_CEIL: + { + const auto argCount = context->expression().size(); + if (argCount != 2) + throw InvalidQuerySyntax("TFLOAT_CEIL requires exactly 2 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(TfloatCeilLogicalFunction(a0, a1)); + } + break; + /* END CODEGEN PARSER GLUE: TFLOAT_CEIL */ + /* BEGIN CODEGEN PARSER GLUE: TFLOAT_DEGREES */ + case AntlrSQLLexer::TFLOAT_DEGREES: + { + const auto argCount = context->expression().size(); + if (argCount != 2) + throw InvalidQuerySyntax("TFLOAT_DEGREES requires exactly 2 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(TfloatDegreesLogicalFunction(a0, a1)); + } + break; + /* END CODEGEN PARSER GLUE: TFLOAT_DEGREES */ + /* BEGIN CODEGEN PARSER GLUE: TFLOAT_FLOOR */ + case AntlrSQLLexer::TFLOAT_FLOOR: + { + const auto argCount = context->expression().size(); + if (argCount != 2) + throw InvalidQuerySyntax("TFLOAT_FLOOR requires exactly 2 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(TfloatFloorLogicalFunction(a0, a1)); + } + break; + /* END CODEGEN PARSER GLUE: TFLOAT_FLOOR */ + /* BEGIN CODEGEN PARSER GLUE: TFLOAT_RADIANS */ + case AntlrSQLLexer::TFLOAT_RADIANS: + { + const auto argCount = context->expression().size(); + if (argCount != 2) + throw InvalidQuerySyntax("TFLOAT_RADIANS requires exactly 2 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(TfloatRadiansLogicalFunction(a0, a1)); + } + break; + /* END CODEGEN PARSER GLUE: TFLOAT_RADIANS */ default: /// Check if the function is a constructor for a datatype From 384c4c3d8c79e3c6853237cd61b1dec3f00b16c3 Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Fri, 12 Jun 2026 05:22:56 +0200 Subject: [PATCH 04/96] feat(nebula): wire per-event tfloat_shift_value/scale_value (W46) 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. --- .../Meos/TfloatScaleValueLogicalFunction.hpp | 54 +++++++++ .../Meos/TfloatShiftValueLogicalFunction.hpp | 54 +++++++++ .../src/Functions/Meos/CMakeLists.txt | 2 + .../Meos/TfloatScaleValueLogicalFunction.cpp | 105 ++++++++++++++++++ .../Meos/TfloatShiftValueLogicalFunction.cpp | 105 ++++++++++++++++++ .../Meos/TfloatScaleValuePhysicalFunction.hpp | 44 ++++++++ .../Meos/TfloatShiftValuePhysicalFunction.hpp | 44 ++++++++ .../src/Functions/Meos/CMakeLists.txt | 2 + .../Meos/TfloatScaleValuePhysicalFunction.cpp | 91 +++++++++++++++ .../Meos/TfloatShiftValuePhysicalFunction.cpp | 91 +++++++++++++++ nes-sql-parser/AntlrSQL.g4 | 4 +- .../src/AntlrSQLQueryPlanCreator.cpp | 60 ++++++++++ 12 files changed, 655 insertions(+), 1 deletion(-) create mode 100644 nes-logical-operators/include/Functions/Meos/TfloatScaleValueLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TfloatShiftValueLogicalFunction.hpp create mode 100644 nes-logical-operators/src/Functions/Meos/TfloatScaleValueLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TfloatShiftValueLogicalFunction.cpp create mode 100644 nes-physical-operators/include/Functions/Meos/TfloatScaleValuePhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TfloatShiftValuePhysicalFunction.hpp create mode 100644 nes-physical-operators/src/Functions/Meos/TfloatScaleValuePhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TfloatShiftValuePhysicalFunction.cpp diff --git a/nes-logical-operators/include/Functions/Meos/TfloatScaleValueLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TfloatScaleValueLogicalFunction.hpp new file mode 100644 index 0000000000..ad47c78148 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TfloatScaleValueLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event tfloat_scale_value: scales the value of a single-instant tfloat by a width. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `tfloat_scale_value`. Takes (value:FLOAT64, ts:UINT64, width:FLOAT64), + * constructs a single-instant temporal, applies the scale, and returns FLOAT64. + */ +class TfloatScaleValueLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TfloatScaleValue"; + + TfloatScaleValueLogicalFunction(LogicalFunction value, + LogicalFunction ts, + LogicalFunction width); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TfloatShiftValueLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TfloatShiftValueLogicalFunction.hpp new file mode 100644 index 0000000000..7d721d6c1b --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TfloatShiftValueLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event tfloat_shift_value: shifts the value of a single-instant tfloat by a scalar. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `tfloat_shift_value`. Takes (value:FLOAT64, ts:UINT64, shift:FLOAT64), + * constructs a single-instant temporal, applies the shift, and returns FLOAT64. + */ +class TfloatShiftValueLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TfloatShiftValue"; + + TfloatShiftValueLogicalFunction(LogicalFunction value, + LogicalFunction ts, + LogicalFunction shift); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt index 42cd5a93f8..6b1d4b92fa 100644 --- a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt @@ -23,5 +23,7 @@ add_plugin(TfloatCos LogicalFunction nes-logical-operators TfloatCosLogicalFunct add_plugin(TfloatDegrees LogicalFunction nes-logical-operators TfloatDegreesLogicalFunction.cpp) add_plugin(TfloatFloor LogicalFunction nes-logical-operators TfloatFloorLogicalFunction.cpp) add_plugin(TfloatRadians LogicalFunction nes-logical-operators TfloatRadiansLogicalFunction.cpp) +add_plugin(TfloatScaleValue LogicalFunction nes-logical-operators TfloatScaleValueLogicalFunction.cpp) +add_plugin(TfloatShiftValue LogicalFunction nes-logical-operators TfloatShiftValueLogicalFunction.cpp) add_plugin(TfloatSin LogicalFunction nes-logical-operators TfloatSinLogicalFunction.cpp) add_plugin(TfloatTan LogicalFunction nes-logical-operators TfloatTanLogicalFunction.cpp) diff --git a/nes-logical-operators/src/Functions/Meos/TfloatScaleValueLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TfloatScaleValueLogicalFunction.cpp new file mode 100644 index 0000000000..7631f17ea6 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TfloatScaleValueLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TfloatScaleValueLogicalFunction::TfloatScaleValueLogicalFunction(LogicalFunction value, + LogicalFunction ts, + LogicalFunction width) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(width)); +} + +DataType TfloatScaleValueLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction TfloatScaleValueLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector TfloatScaleValueLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction TfloatScaleValueLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "TfloatScaleValueLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view TfloatScaleValueLogicalFunction::getType() const { return NAME; } + +bool TfloatScaleValueLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string TfloatScaleValueLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TfloatScaleValueLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction TfloatScaleValueLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTfloatScaleValueLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "TfloatScaleValueLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return TfloatScaleValueLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TfloatShiftValueLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TfloatShiftValueLogicalFunction.cpp new file mode 100644 index 0000000000..d4c4cea5de --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TfloatShiftValueLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TfloatShiftValueLogicalFunction::TfloatShiftValueLogicalFunction(LogicalFunction value, + LogicalFunction ts, + LogicalFunction shift) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(shift)); +} + +DataType TfloatShiftValueLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction TfloatShiftValueLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector TfloatShiftValueLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction TfloatShiftValueLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "TfloatShiftValueLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view TfloatShiftValueLogicalFunction::getType() const { return NAME; } + +bool TfloatShiftValueLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string TfloatShiftValueLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TfloatShiftValueLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction TfloatShiftValueLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTfloatShiftValueLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "TfloatShiftValueLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return TfloatShiftValueLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TfloatScaleValuePhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TfloatScaleValuePhysicalFunction.hpp new file mode 100644 index 0000000000..776ae3e08b --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TfloatScaleValuePhysicalFunction.hpp @@ -0,0 +1,44 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `tfloat_scale_value`. + * + * Per-event tfloat_scale_value: scales a single-instant tfloat by a width, value extracted -> double. + * Takes (value:FLOAT64, ts:UINT64, width:FLOAT64). + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TfloatScaleValuePhysicalFunction : public PhysicalFunctionConcept { +public: + TfloatScaleValuePhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction, + PhysicalFunction widthFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TfloatShiftValuePhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TfloatShiftValuePhysicalFunction.hpp new file mode 100644 index 0000000000..f8cc2632b2 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TfloatShiftValuePhysicalFunction.hpp @@ -0,0 +1,44 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `tfloat_shift_value`. + * + * Per-event tfloat_shift_value: shifts a single-instant tfloat by a scalar, value extracted -> double. + * Takes (value:FLOAT64, ts:UINT64, shift:FLOAT64). + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TfloatShiftValuePhysicalFunction : public PhysicalFunctionConcept { +public: + TfloatShiftValuePhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction, + PhysicalFunction shiftFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt index 01078c3d7e..d62de9237e 100644 --- a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt @@ -22,6 +22,8 @@ add_plugin(TfloatCos PhysicalFunction nes-physical-operators TfloatCosPhysicalFu add_plugin(TfloatDegrees PhysicalFunction nes-physical-operators TfloatDegreesPhysicalFunction.cpp) add_plugin(TfloatFloor PhysicalFunction nes-physical-operators TfloatFloorPhysicalFunction.cpp) add_plugin(TfloatRadians PhysicalFunction nes-physical-operators TfloatRadiansPhysicalFunction.cpp) +add_plugin(TfloatScaleValue PhysicalFunction nes-physical-operators TfloatScaleValuePhysicalFunction.cpp) +add_plugin(TfloatShiftValue PhysicalFunction nes-physical-operators TfloatShiftValuePhysicalFunction.cpp) add_plugin(TfloatSin PhysicalFunction nes-physical-operators TfloatSinPhysicalFunction.cpp) add_plugin(TfloatTan PhysicalFunction nes-physical-operators TfloatTanPhysicalFunction.cpp) endif() diff --git a/nes-physical-operators/src/Functions/Meos/TfloatScaleValuePhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TfloatScaleValuePhysicalFunction.cpp new file mode 100644 index 0000000000..ddf3cb4de1 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TfloatScaleValuePhysicalFunction.cpp @@ -0,0 +1,91 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +TfloatScaleValuePhysicalFunction::TfloatScaleValuePhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction, + PhysicalFunction widthFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(widthFunction)); +} + +VarVal TfloatScaleValuePhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto ts = parameterValues[1].cast>(); + auto width = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double value, uint64_t ts, double width) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string tempWkt = fmt::format("{}@{}", value, MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tfloat_in(tempWkt.c_str()); + if (!temp) return 0.0; + Temporal* res = tfloat_scale_value(temp, width); + free(temp); + if (!res) return 0.0; + double r = tfloat_start_value(res); + free(res); + return r; + } catch (const std::exception&) { return 0.0; } + }, + value, ts, width); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTfloatScaleValuePhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "TfloatScaleValuePhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return TfloatScaleValuePhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TfloatShiftValuePhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TfloatShiftValuePhysicalFunction.cpp new file mode 100644 index 0000000000..3f5de19d9f --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TfloatShiftValuePhysicalFunction.cpp @@ -0,0 +1,91 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +TfloatShiftValuePhysicalFunction::TfloatShiftValuePhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction, + PhysicalFunction shiftFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(shiftFunction)); +} + +VarVal TfloatShiftValuePhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto ts = parameterValues[1].cast>(); + auto shift = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double value, uint64_t ts, double shift) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string tempWkt = fmt::format("{}@{}", value, MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tfloat_in(tempWkt.c_str()); + if (!temp) return 0.0; + Temporal* res = tfloat_shift_value(temp, shift); + free(temp); + if (!res) return 0.0; + double r = tfloat_start_value(res); + free(res); + return r; + } catch (const std::exception&) { return 0.0; } + }, + value, ts, shift); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTfloatShiftValuePhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "TfloatShiftValuePhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return TfloatShiftValuePhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-sql-parser/AntlrSQL.g4 b/nes-sql-parser/AntlrSQL.g4 index 27c7a40be8..8f7b599c8e 100644 --- a/nes-sql-parser/AntlrSQL.g4 +++ b/nes-sql-parser/AntlrSQL.g4 @@ -295,7 +295,7 @@ timeUnit: MS timestampParameter: name=identifier; -functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | EDWITHIN_TGEO_GEO | TGEO_AT_STBOX | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_FLOOR | TFLOAT_RADIANS | TFLOAT_SIN | TFLOAT_TAN; +functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | EDWITHIN_TGEO_GEO | TGEO_AT_STBOX | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_FLOOR | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN; sinkClause: INTO sink (',' sink)*; @@ -493,6 +493,8 @@ TFLOAT_COS: 'TFLOAT_COS' | 'tfloat_cos'; TFLOAT_DEGREES: 'TFLOAT_DEGREES' | 'tfloat_degrees'; TFLOAT_FLOOR: 'TFLOAT_FLOOR' | 'tfloat_floor'; TFLOAT_RADIANS: 'TFLOAT_RADIANS' | 'tfloat_radians'; +TFLOAT_SCALE_VALUE: 'TFLOAT_SCALE_VALUE' | 'tfloat_scale_value'; +TFLOAT_SHIFT_VALUE: 'TFLOAT_SHIFT_VALUE' | 'tfloat_shift_value'; TFLOAT_SIN: 'TFLOAT_SIN' | 'tfloat_sin'; TFLOAT_TAN: 'TFLOAT_TAN' | 'tfloat_tan'; WATERMARK: 'WATERMARK' | 'watermark'; diff --git a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp index 48405d5879..ef6e63e327 100644 --- a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp +++ b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp @@ -74,6 +74,8 @@ #include #include #include +#include +#include #include #include #include @@ -1390,6 +1392,64 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont } break; /* END CODEGEN PARSER GLUE: TFLOAT_RADIANS */ + /* BEGIN CODEGEN PARSER GLUE: TFLOAT_SCALE_VALUE */ + case AntlrSQLLexer::TFLOAT_SCALE_VALUE: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("TFLOAT_SCALE_VALUE requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(TfloatScaleValueLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: TFLOAT_SCALE_VALUE */ + /* BEGIN CODEGEN PARSER GLUE: TFLOAT_SHIFT_VALUE */ + case AntlrSQLLexer::TFLOAT_SHIFT_VALUE: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("TFLOAT_SHIFT_VALUE requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(TfloatShiftValueLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: TFLOAT_SHIFT_VALUE */ default: /// Check if the function is a constructor for a datatype From 02ee1160ca170b0736e98eed048d205bb8bd2762 Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Fri, 12 Jun 2026 05:29:41 +0200 Subject: [PATCH 05/96] feat(meos): add TNUMBER_ABS and TFLOAT_SHIFT_SCALE_VALUE NES operators (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. --- .../TfloatShiftScaleValueLogicalFunction.hpp | 55 +++++++++ .../Meos/TnumberAbsLogicalFunction.hpp | 53 +++++++++ .../src/Functions/Meos/CMakeLists.txt | 2 + .../TfloatShiftScaleValueLogicalFunction.cpp | 108 ++++++++++++++++++ .../Meos/TnumberAbsLogicalFunction.cpp | 102 +++++++++++++++++ .../TfloatShiftScaleValuePhysicalFunction.hpp | 44 +++++++ .../Meos/TnumberAbsPhysicalFunction.hpp | 42 +++++++ .../src/Functions/Meos/CMakeLists.txt | 2 + .../TfloatShiftScaleValuePhysicalFunction.cpp | 95 +++++++++++++++ .../Meos/TnumberAbsPhysicalFunction.cpp | 87 ++++++++++++++ nes-sql-parser/AntlrSQL.g4 | 4 +- .../src/AntlrSQLQueryPlanCreator.cpp | 60 ++++++++++ 12 files changed, 653 insertions(+), 1 deletion(-) create mode 100644 nes-logical-operators/include/Functions/Meos/TfloatShiftScaleValueLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TnumberAbsLogicalFunction.hpp create mode 100644 nes-logical-operators/src/Functions/Meos/TfloatShiftScaleValueLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TnumberAbsLogicalFunction.cpp create mode 100644 nes-physical-operators/include/Functions/Meos/TfloatShiftScaleValuePhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TnumberAbsPhysicalFunction.hpp create mode 100644 nes-physical-operators/src/Functions/Meos/TfloatShiftScaleValuePhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TnumberAbsPhysicalFunction.cpp diff --git a/nes-logical-operators/include/Functions/Meos/TfloatShiftScaleValueLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TfloatShiftScaleValueLogicalFunction.hpp new file mode 100644 index 0000000000..b4c2b90990 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TfloatShiftScaleValueLogicalFunction.hpp @@ -0,0 +1,55 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event tfloat_shift_scale_value: shifts and scales a single-instant tfloat by shift and width. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `tfloat_shift_scale_value`. Takes (value:FLOAT64, ts:UINT64, shift:FLOAT64, width:FLOAT64), + * constructs a single-instant temporal, applies shift+scale, and returns FLOAT64. + */ +class TfloatShiftScaleValueLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TfloatShiftScaleValue"; + + TfloatShiftScaleValueLogicalFunction(LogicalFunction value, + LogicalFunction ts, + LogicalFunction shift, + LogicalFunction width); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TnumberAbsLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TnumberAbsLogicalFunction.hpp new file mode 100644 index 0000000000..6fe10d29d1 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TnumberAbsLogicalFunction.hpp @@ -0,0 +1,53 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event tnumber_abs: single-instant tnumber transform, value extracted -> double. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `tnumber_abs`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. + */ +class TnumberAbsLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TnumberAbs"; + + TnumberAbsLogicalFunction(LogicalFunction value, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt index 6b1d4b92fa..01154d9eee 100644 --- a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt @@ -24,6 +24,8 @@ add_plugin(TfloatDegrees LogicalFunction nes-logical-operators TfloatDegreesLogi add_plugin(TfloatFloor LogicalFunction nes-logical-operators TfloatFloorLogicalFunction.cpp) add_plugin(TfloatRadians LogicalFunction nes-logical-operators TfloatRadiansLogicalFunction.cpp) add_plugin(TfloatScaleValue LogicalFunction nes-logical-operators TfloatScaleValueLogicalFunction.cpp) +add_plugin(TfloatShiftScaleValue LogicalFunction nes-logical-operators TfloatShiftScaleValueLogicalFunction.cpp) add_plugin(TfloatShiftValue LogicalFunction nes-logical-operators TfloatShiftValueLogicalFunction.cpp) add_plugin(TfloatSin LogicalFunction nes-logical-operators TfloatSinLogicalFunction.cpp) add_plugin(TfloatTan LogicalFunction nes-logical-operators TfloatTanLogicalFunction.cpp) +add_plugin(TnumberAbs LogicalFunction nes-logical-operators TnumberAbsLogicalFunction.cpp) diff --git a/nes-logical-operators/src/Functions/Meos/TfloatShiftScaleValueLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TfloatShiftScaleValueLogicalFunction.cpp new file mode 100644 index 0000000000..ef6f4c2a71 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TfloatShiftScaleValueLogicalFunction.cpp @@ -0,0 +1,108 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TfloatShiftScaleValueLogicalFunction::TfloatShiftScaleValueLogicalFunction(LogicalFunction value, + LogicalFunction ts, + LogicalFunction shift, + LogicalFunction width) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(4); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(shift)); + parameters.push_back(std::move(width)); +} + +DataType TfloatShiftScaleValueLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction TfloatShiftScaleValueLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector TfloatShiftScaleValueLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction TfloatShiftScaleValueLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 4, "TfloatShiftScaleValueLogicalFunction requires 4 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view TfloatShiftScaleValueLogicalFunction::getType() const { return NAME; } + +bool TfloatShiftScaleValueLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string TfloatShiftScaleValueLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TfloatShiftScaleValueLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction TfloatShiftScaleValueLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTfloatShiftScaleValueLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 4, + "TfloatShiftScaleValueLogicalFunction requires 4 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + return TfloatShiftScaleValueLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TnumberAbsLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TnumberAbsLogicalFunction.cpp new file mode 100644 index 0000000000..5b67053833 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TnumberAbsLogicalFunction.cpp @@ -0,0 +1,102 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TnumberAbsLogicalFunction::TnumberAbsLogicalFunction(LogicalFunction value, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(2); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(ts)); +} + +DataType TnumberAbsLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction TnumberAbsLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector TnumberAbsLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction TnumberAbsLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 2, "TnumberAbsLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view TnumberAbsLogicalFunction::getType() const { return NAME; } + +bool TnumberAbsLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string TnumberAbsLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TnumberAbsLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction TnumberAbsLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTnumberAbsLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 2, + "TnumberAbsLogicalFunction requires 2 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + return TnumberAbsLogicalFunction(std::move(arg0), std::move(arg1)); +} + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TfloatShiftScaleValuePhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TfloatShiftScaleValuePhysicalFunction.hpp new file mode 100644 index 0000000000..efdb1e1c98 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TfloatShiftScaleValuePhysicalFunction.hpp @@ -0,0 +1,44 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `tfloat_shift_scale_value`. + * + * Per-event tfloat_shift_scale_value: shifts and scales a single-instant tfloat. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TfloatShiftScaleValuePhysicalFunction : public PhysicalFunctionConcept { +public: + TfloatShiftScaleValuePhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction, + PhysicalFunction shiftFunction, + PhysicalFunction widthFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TnumberAbsPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TnumberAbsPhysicalFunction.hpp new file mode 100644 index 0000000000..9c1c46c10d --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TnumberAbsPhysicalFunction.hpp @@ -0,0 +1,42 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `tnumber_abs`. + * + * Per-event tnumber_abs: single-instant tnumber transform, value extracted -> double. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TnumberAbsPhysicalFunction : public PhysicalFunctionConcept { +public: + TnumberAbsPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt index d62de9237e..ad801dc314 100644 --- a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt @@ -23,7 +23,9 @@ add_plugin(TfloatDegrees PhysicalFunction nes-physical-operators TfloatDegreesPh add_plugin(TfloatFloor PhysicalFunction nes-physical-operators TfloatFloorPhysicalFunction.cpp) add_plugin(TfloatRadians PhysicalFunction nes-physical-operators TfloatRadiansPhysicalFunction.cpp) add_plugin(TfloatScaleValue PhysicalFunction nes-physical-operators TfloatScaleValuePhysicalFunction.cpp) +add_plugin(TfloatShiftScaleValue PhysicalFunction nes-physical-operators TfloatShiftScaleValuePhysicalFunction.cpp) add_plugin(TfloatShiftValue PhysicalFunction nes-physical-operators TfloatShiftValuePhysicalFunction.cpp) add_plugin(TfloatSin PhysicalFunction nes-physical-operators TfloatSinPhysicalFunction.cpp) add_plugin(TfloatTan PhysicalFunction nes-physical-operators TfloatTanPhysicalFunction.cpp) +add_plugin(TnumberAbs PhysicalFunction nes-physical-operators TnumberAbsPhysicalFunction.cpp) endif() diff --git a/nes-physical-operators/src/Functions/Meos/TfloatShiftScaleValuePhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TfloatShiftScaleValuePhysicalFunction.cpp new file mode 100644 index 0000000000..7095a9c943 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TfloatShiftScaleValuePhysicalFunction.cpp @@ -0,0 +1,95 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +TfloatShiftScaleValuePhysicalFunction::TfloatShiftScaleValuePhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction, + PhysicalFunction shiftFunction, + PhysicalFunction widthFunction) +{ + parameterFunctions.reserve(4); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(shiftFunction)); + parameterFunctions.push_back(std::move(widthFunction)); +} + +VarVal TfloatShiftScaleValuePhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto ts = parameterValues[1].cast>(); + auto shift = parameterValues[2].cast>(); + auto width = parameterValues[3].cast>(); + + const auto result = nautilus::invoke( + +[](double value, uint64_t ts, double shift, double width) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string tempWkt = fmt::format("{}@{}", value, MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tfloat_in(tempWkt.c_str()); + if (!temp) return 0.0; + Temporal* res = tfloat_shift_scale_value(temp, shift, width); + free(temp); + if (!res) return 0.0; + double r = tfloat_start_value(res); + free(res); + return r; + } catch (const std::exception&) { return 0.0; } + }, + value, ts, shift, width); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTfloatShiftScaleValuePhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 4, + "TfloatShiftScaleValuePhysicalFunction requires 4 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + return TfloatShiftScaleValuePhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TnumberAbsPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TnumberAbsPhysicalFunction.cpp new file mode 100644 index 0000000000..d61f38178c --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TnumberAbsPhysicalFunction.cpp @@ -0,0 +1,87 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +TnumberAbsPhysicalFunction::TnumberAbsPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(2); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal TnumberAbsPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto ts = parameterValues[1].cast>(); + + const auto result = nautilus::invoke( + +[](double value, uint64_t ts) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string tempWkt = fmt::format("{}@{}", value, MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tfloat_in(tempWkt.c_str()); + if (!temp) return 0.0; + Temporal* res = tnumber_abs(temp); + free(temp); + if (!res) return 0.0; + double r = tfloat_start_value(res); + free(res); + return r; + } catch (const std::exception&) { return 0.0; } + }, + value, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTnumberAbsPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 2, + "TnumberAbsPhysicalFunction requires 2 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + return TnumberAbsPhysicalFunction(std::move(arg0), std::move(arg1)); +} + +} // namespace NES diff --git a/nes-sql-parser/AntlrSQL.g4 b/nes-sql-parser/AntlrSQL.g4 index 8f7b599c8e..eaeea079a1 100644 --- a/nes-sql-parser/AntlrSQL.g4 +++ b/nes-sql-parser/AntlrSQL.g4 @@ -295,7 +295,7 @@ timeUnit: MS timestampParameter: name=identifier; -functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | EDWITHIN_TGEO_GEO | TGEO_AT_STBOX | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_FLOOR | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN; +functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | EDWITHIN_TGEO_GEO | TGEO_AT_STBOX | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_FLOOR | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TNUMBER_ABS; sinkClause: INTO sink (',' sink)*; @@ -494,9 +494,11 @@ TFLOAT_DEGREES: 'TFLOAT_DEGREES' | 'tfloat_degrees'; TFLOAT_FLOOR: 'TFLOAT_FLOOR' | 'tfloat_floor'; TFLOAT_RADIANS: 'TFLOAT_RADIANS' | 'tfloat_radians'; TFLOAT_SCALE_VALUE: 'TFLOAT_SCALE_VALUE' | 'tfloat_scale_value'; +TFLOAT_SHIFT_SCALE_VALUE: 'TFLOAT_SHIFT_SCALE_VALUE' | 'tfloat_shift_scale_value'; TFLOAT_SHIFT_VALUE: 'TFLOAT_SHIFT_VALUE' | 'tfloat_shift_value'; TFLOAT_SIN: 'TFLOAT_SIN' | 'tfloat_sin'; TFLOAT_TAN: 'TFLOAT_TAN' | 'tfloat_tan'; +TNUMBER_ABS: 'TNUMBER_ABS' | 'tnumber_abs'; WATERMARK: 'WATERMARK' | 'watermark'; OFFSET: 'OFFSET' | 'offset'; LOCALHOST: 'LOCALHOST' | 'localhost'; diff --git a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp index ef6e63e327..1043181e7a 100644 --- a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp +++ b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp @@ -75,9 +75,11 @@ #include #include #include +#include #include #include #include +#include #include #include #include @@ -1450,6 +1452,64 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont } break; /* END CODEGEN PARSER GLUE: TFLOAT_SHIFT_VALUE */ + /* BEGIN CODEGEN PARSER GLUE: TFLOAT_SHIFT_SCALE_VALUE */ + case AntlrSQLLexer::TFLOAT_SHIFT_SCALE_VALUE: + { + const auto argCount = context->expression().size(); + if (argCount != 4) + throw InvalidQuerySyntax("TFLOAT_SHIFT_SCALE_VALUE requires exactly 4 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a3 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(TfloatShiftScaleValueLogicalFunction(a0, a1, a2, a3)); + } + break; + /* END CODEGEN PARSER GLUE: TFLOAT_SHIFT_SCALE_VALUE */ + /* BEGIN CODEGEN PARSER GLUE: TNUMBER_ABS */ + case AntlrSQLLexer::TNUMBER_ABS: + { + const auto argCount = context->expression().size(); + if (argCount != 2) + throw InvalidQuerySyntax("TNUMBER_ABS requires exactly 2 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(TnumberAbsLogicalFunction(a0, a1)); + } + break; + /* END CODEGEN PARSER GLUE: TNUMBER_ABS */ default: /// Check if the function is a constructor for a datatype From 6ff9b082e5f0e25fcf9fe48a4d54adc3fe8ee247 Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Fri, 12 Jun 2026 05:35:38 +0200 Subject: [PATCH 06/96] feat(meos): add ADD/SUB/MUL/DIV_TFLOAT_FLOAT NES operators (W48) 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. --- .../Meos/AddTfloatFloatLogicalFunction.hpp | 54 ++++++++ .../Meos/DivTfloatFloatLogicalFunction.hpp | 54 ++++++++ .../Meos/MulTfloatFloatLogicalFunction.hpp | 54 ++++++++ .../Meos/SubTfloatFloatLogicalFunction.hpp | 54 ++++++++ .../Meos/AddTfloatFloatLogicalFunction.cpp | 105 +++++++++++++++ .../src/Functions/Meos/CMakeLists.txt | 4 + .../Meos/DivTfloatFloatLogicalFunction.cpp | 105 +++++++++++++++ .../Meos/MulTfloatFloatLogicalFunction.cpp | 105 +++++++++++++++ .../Meos/SubTfloatFloatLogicalFunction.cpp | 105 +++++++++++++++ .../Meos/AddTfloatFloatPhysicalFunction.hpp | 43 +++++++ .../Meos/DivTfloatFloatPhysicalFunction.hpp | 43 +++++++ .../Meos/MulTfloatFloatPhysicalFunction.hpp | 43 +++++++ .../Meos/SubTfloatFloatPhysicalFunction.hpp | 43 +++++++ .../Meos/AddTfloatFloatPhysicalFunction.cpp | 91 +++++++++++++ .../src/Functions/Meos/CMakeLists.txt | 4 + .../Meos/DivTfloatFloatPhysicalFunction.cpp | 91 +++++++++++++ .../Meos/MulTfloatFloatPhysicalFunction.cpp | 91 +++++++++++++ .../Meos/SubTfloatFloatPhysicalFunction.cpp | 91 +++++++++++++ nes-sql-parser/AntlrSQL.g4 | 6 +- .../src/AntlrSQLQueryPlanCreator.cpp | 120 ++++++++++++++++++ 20 files changed, 1305 insertions(+), 1 deletion(-) create mode 100644 nes-logical-operators/include/Functions/Meos/AddTfloatFloatLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/DivTfloatFloatLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/MulTfloatFloatLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/SubTfloatFloatLogicalFunction.hpp create mode 100644 nes-logical-operators/src/Functions/Meos/AddTfloatFloatLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/DivTfloatFloatLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/MulTfloatFloatLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/SubTfloatFloatLogicalFunction.cpp create mode 100644 nes-physical-operators/include/Functions/Meos/AddTfloatFloatPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/DivTfloatFloatPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/MulTfloatFloatPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/SubTfloatFloatPhysicalFunction.hpp create mode 100644 nes-physical-operators/src/Functions/Meos/AddTfloatFloatPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/DivTfloatFloatPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/MulTfloatFloatPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/SubTfloatFloatPhysicalFunction.cpp diff --git a/nes-logical-operators/include/Functions/Meos/AddTfloatFloatLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AddTfloatFloatLogicalFunction.hpp new file mode 100644 index 0000000000..7fbbb663c8 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AddTfloatFloatLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event add_tfloat_float: adds a constant to a single-instant tfloat value. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `add_tfloat_float`. Takes (value:FLOAT64, ts:UINT64, addend:FLOAT64), + * constructs a single-instant temporal, applies the addition, and returns FLOAT64. + */ +class AddTfloatFloatLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AddTfloatFloat"; + + AddTfloatFloatLogicalFunction(LogicalFunction value, + LogicalFunction ts, + LogicalFunction addend); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/DivTfloatFloatLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/DivTfloatFloatLogicalFunction.hpp new file mode 100644 index 0000000000..f028b28994 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/DivTfloatFloatLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event div_tfloat_float: divides a single-instant tfloat value by a constant. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `div_tfloat_float`. Takes (value:FLOAT64, ts:UINT64, divisor:FLOAT64), + * constructs a single-instant temporal, applies the division, and returns FLOAT64. + */ +class DivTfloatFloatLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "DivTfloatFloat"; + + DivTfloatFloatLogicalFunction(LogicalFunction value, + LogicalFunction ts, + LogicalFunction divisor); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/MulTfloatFloatLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/MulTfloatFloatLogicalFunction.hpp new file mode 100644 index 0000000000..a2f3606cca --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/MulTfloatFloatLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event mul_tfloat_float: multiplies a single-instant tfloat value by a constant. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `mul_tfloat_float`. Takes (value:FLOAT64, ts:UINT64, factor:FLOAT64), + * constructs a single-instant temporal, applies the multiplication, and returns FLOAT64. + */ +class MulTfloatFloatLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "MulTfloatFloat"; + + MulTfloatFloatLogicalFunction(LogicalFunction value, + LogicalFunction ts, + LogicalFunction factor); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/SubTfloatFloatLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/SubTfloatFloatLogicalFunction.hpp new file mode 100644 index 0000000000..ea5a1a9d26 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/SubTfloatFloatLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event sub_tfloat_float: subtracts a constant from a single-instant tfloat value. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `sub_tfloat_float`. Takes (value:FLOAT64, ts:UINT64, subtrahend:FLOAT64), + * constructs a single-instant temporal, applies the subtraction, and returns FLOAT64. + */ +class SubTfloatFloatLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "SubTfloatFloat"; + + SubTfloatFloatLogicalFunction(LogicalFunction value, + LogicalFunction ts, + LogicalFunction subtrahend); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AddTfloatFloatLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AddTfloatFloatLogicalFunction.cpp new file mode 100644 index 0000000000..6cc26a04a5 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AddTfloatFloatLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AddTfloatFloatLogicalFunction::AddTfloatFloatLogicalFunction(LogicalFunction value, + LogicalFunction ts, + LogicalFunction addend) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(addend)); +} + +DataType AddTfloatFloatLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AddTfloatFloatLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AddTfloatFloatLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AddTfloatFloatLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "AddTfloatFloatLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AddTfloatFloatLogicalFunction::getType() const { return NAME; } + +bool AddTfloatFloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AddTfloatFloatLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction AddTfloatFloatLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction AddTfloatFloatLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAddTfloatFloatLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "AddTfloatFloatLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return AddTfloatFloatLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt index 01154d9eee..1f40833d3b 100644 --- a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt @@ -24,6 +24,10 @@ add_plugin(TfloatDegrees LogicalFunction nes-logical-operators TfloatDegreesLogi add_plugin(TfloatFloor LogicalFunction nes-logical-operators TfloatFloorLogicalFunction.cpp) add_plugin(TfloatRadians LogicalFunction nes-logical-operators TfloatRadiansLogicalFunction.cpp) add_plugin(TfloatScaleValue LogicalFunction nes-logical-operators TfloatScaleValueLogicalFunction.cpp) +add_plugin(AddTfloatFloat LogicalFunction nes-logical-operators AddTfloatFloatLogicalFunction.cpp) +add_plugin(DivTfloatFloat LogicalFunction nes-logical-operators DivTfloatFloatLogicalFunction.cpp) +add_plugin(MulTfloatFloat LogicalFunction nes-logical-operators MulTfloatFloatLogicalFunction.cpp) +add_plugin(SubTfloatFloat LogicalFunction nes-logical-operators SubTfloatFloatLogicalFunction.cpp) add_plugin(TfloatShiftScaleValue LogicalFunction nes-logical-operators TfloatShiftScaleValueLogicalFunction.cpp) add_plugin(TfloatShiftValue LogicalFunction nes-logical-operators TfloatShiftValueLogicalFunction.cpp) add_plugin(TfloatSin LogicalFunction nes-logical-operators TfloatSinLogicalFunction.cpp) diff --git a/nes-logical-operators/src/Functions/Meos/DivTfloatFloatLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/DivTfloatFloatLogicalFunction.cpp new file mode 100644 index 0000000000..a9bb9268b7 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/DivTfloatFloatLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +DivTfloatFloatLogicalFunction::DivTfloatFloatLogicalFunction(LogicalFunction value, + LogicalFunction ts, + LogicalFunction divisor) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(divisor)); +} + +DataType DivTfloatFloatLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction DivTfloatFloatLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector DivTfloatFloatLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction DivTfloatFloatLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "DivTfloatFloatLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view DivTfloatFloatLogicalFunction::getType() const { return NAME; } + +bool DivTfloatFloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string DivTfloatFloatLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction DivTfloatFloatLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction DivTfloatFloatLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterDivTfloatFloatLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "DivTfloatFloatLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return DivTfloatFloatLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/MulTfloatFloatLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/MulTfloatFloatLogicalFunction.cpp new file mode 100644 index 0000000000..c28dba03cf --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/MulTfloatFloatLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +MulTfloatFloatLogicalFunction::MulTfloatFloatLogicalFunction(LogicalFunction value, + LogicalFunction ts, + LogicalFunction factor) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(factor)); +} + +DataType MulTfloatFloatLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction MulTfloatFloatLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector MulTfloatFloatLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction MulTfloatFloatLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "MulTfloatFloatLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view MulTfloatFloatLogicalFunction::getType() const { return NAME; } + +bool MulTfloatFloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string MulTfloatFloatLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction MulTfloatFloatLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction MulTfloatFloatLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterMulTfloatFloatLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "MulTfloatFloatLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return MulTfloatFloatLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/SubTfloatFloatLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/SubTfloatFloatLogicalFunction.cpp new file mode 100644 index 0000000000..d1eda09525 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/SubTfloatFloatLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +SubTfloatFloatLogicalFunction::SubTfloatFloatLogicalFunction(LogicalFunction value, + LogicalFunction ts, + LogicalFunction subtrahend) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(subtrahend)); +} + +DataType SubTfloatFloatLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction SubTfloatFloatLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector SubTfloatFloatLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction SubTfloatFloatLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "SubTfloatFloatLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view SubTfloatFloatLogicalFunction::getType() const { return NAME; } + +bool SubTfloatFloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string SubTfloatFloatLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction SubTfloatFloatLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction SubTfloatFloatLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterSubTfloatFloatLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "SubTfloatFloatLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return SubTfloatFloatLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AddTfloatFloatPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AddTfloatFloatPhysicalFunction.hpp new file mode 100644 index 0000000000..599af33b95 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AddTfloatFloatPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `add_tfloat_float`. + * + * Per-event add_tfloat_float: adds a constant to a single-instant tfloat value. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class AddTfloatFloatPhysicalFunction : public PhysicalFunctionConcept { +public: + AddTfloatFloatPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction, + PhysicalFunction addendFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/DivTfloatFloatPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/DivTfloatFloatPhysicalFunction.hpp new file mode 100644 index 0000000000..c221eba2e9 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/DivTfloatFloatPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `div_tfloat_float`. + * + * Per-event div_tfloat_float: divides a single-instant tfloat value by a constant. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class DivTfloatFloatPhysicalFunction : public PhysicalFunctionConcept { +public: + DivTfloatFloatPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction, + PhysicalFunction divisorFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/MulTfloatFloatPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/MulTfloatFloatPhysicalFunction.hpp new file mode 100644 index 0000000000..5014e03f50 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/MulTfloatFloatPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `mul_tfloat_float`. + * + * Per-event mul_tfloat_float: multiplies a single-instant tfloat value by a constant. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class MulTfloatFloatPhysicalFunction : public PhysicalFunctionConcept { +public: + MulTfloatFloatPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction, + PhysicalFunction factorFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/SubTfloatFloatPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/SubTfloatFloatPhysicalFunction.hpp new file mode 100644 index 0000000000..f1ed79336a --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/SubTfloatFloatPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `sub_tfloat_float`. + * + * Per-event sub_tfloat_float: subtracts a constant from a single-instant tfloat value. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class SubTfloatFloatPhysicalFunction : public PhysicalFunctionConcept { +public: + SubTfloatFloatPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction, + PhysicalFunction subtrahendFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AddTfloatFloatPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AddTfloatFloatPhysicalFunction.cpp new file mode 100644 index 0000000000..75dc0a3994 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AddTfloatFloatPhysicalFunction.cpp @@ -0,0 +1,91 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +AddTfloatFloatPhysicalFunction::AddTfloatFloatPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction, + PhysicalFunction addendFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(addendFunction)); +} + +VarVal AddTfloatFloatPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto ts = parameterValues[1].cast>(); + auto addend = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double value, uint64_t ts, double addend) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string tempWkt = fmt::format("{}@{}", value, MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tfloat_in(tempWkt.c_str()); + if (!temp) return 0.0; + Temporal* res = add_tfloat_float(temp, addend); + free(temp); + if (!res) return 0.0; + double r = tfloat_start_value(res); + free(res); + return r; + } catch (const std::exception&) { return 0.0; } + }, + value, ts, addend); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAddTfloatFloatPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "AddTfloatFloatPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return AddTfloatFloatPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt index ad801dc314..fcfbe5b9ba 100644 --- a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt @@ -23,6 +23,10 @@ add_plugin(TfloatDegrees PhysicalFunction nes-physical-operators TfloatDegreesPh add_plugin(TfloatFloor PhysicalFunction nes-physical-operators TfloatFloorPhysicalFunction.cpp) add_plugin(TfloatRadians PhysicalFunction nes-physical-operators TfloatRadiansPhysicalFunction.cpp) add_plugin(TfloatScaleValue PhysicalFunction nes-physical-operators TfloatScaleValuePhysicalFunction.cpp) +add_plugin(AddTfloatFloat PhysicalFunction nes-physical-operators AddTfloatFloatPhysicalFunction.cpp) +add_plugin(DivTfloatFloat PhysicalFunction nes-physical-operators DivTfloatFloatPhysicalFunction.cpp) +add_plugin(MulTfloatFloat PhysicalFunction nes-physical-operators MulTfloatFloatPhysicalFunction.cpp) +add_plugin(SubTfloatFloat PhysicalFunction nes-physical-operators SubTfloatFloatPhysicalFunction.cpp) add_plugin(TfloatShiftScaleValue PhysicalFunction nes-physical-operators TfloatShiftScaleValuePhysicalFunction.cpp) add_plugin(TfloatShiftValue PhysicalFunction nes-physical-operators TfloatShiftValuePhysicalFunction.cpp) add_plugin(TfloatSin PhysicalFunction nes-physical-operators TfloatSinPhysicalFunction.cpp) diff --git a/nes-physical-operators/src/Functions/Meos/DivTfloatFloatPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/DivTfloatFloatPhysicalFunction.cpp new file mode 100644 index 0000000000..c0f7e9da02 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/DivTfloatFloatPhysicalFunction.cpp @@ -0,0 +1,91 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +DivTfloatFloatPhysicalFunction::DivTfloatFloatPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction, + PhysicalFunction divisorFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(divisorFunction)); +} + +VarVal DivTfloatFloatPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto ts = parameterValues[1].cast>(); + auto divisor = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double value, uint64_t ts, double divisor) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string tempWkt = fmt::format("{}@{}", value, MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tfloat_in(tempWkt.c_str()); + if (!temp) return 0.0; + Temporal* res = div_tfloat_float(temp, divisor); + free(temp); + if (!res) return 0.0; + double r = tfloat_start_value(res); + free(res); + return r; + } catch (const std::exception&) { return 0.0; } + }, + value, ts, divisor); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterDivTfloatFloatPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "DivTfloatFloatPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return DivTfloatFloatPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/MulTfloatFloatPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/MulTfloatFloatPhysicalFunction.cpp new file mode 100644 index 0000000000..80205907b6 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/MulTfloatFloatPhysicalFunction.cpp @@ -0,0 +1,91 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +MulTfloatFloatPhysicalFunction::MulTfloatFloatPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction, + PhysicalFunction factorFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(factorFunction)); +} + +VarVal MulTfloatFloatPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto ts = parameterValues[1].cast>(); + auto factor = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double value, uint64_t ts, double factor) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string tempWkt = fmt::format("{}@{}", value, MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tfloat_in(tempWkt.c_str()); + if (!temp) return 0.0; + Temporal* res = mul_tfloat_float(temp, factor); + free(temp); + if (!res) return 0.0; + double r = tfloat_start_value(res); + free(res); + return r; + } catch (const std::exception&) { return 0.0; } + }, + value, ts, factor); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterMulTfloatFloatPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "MulTfloatFloatPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return MulTfloatFloatPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/SubTfloatFloatPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/SubTfloatFloatPhysicalFunction.cpp new file mode 100644 index 0000000000..75e6eb5c39 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/SubTfloatFloatPhysicalFunction.cpp @@ -0,0 +1,91 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +SubTfloatFloatPhysicalFunction::SubTfloatFloatPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction, + PhysicalFunction subtrahendFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(subtrahendFunction)); +} + +VarVal SubTfloatFloatPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto ts = parameterValues[1].cast>(); + auto subtrahend = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double value, uint64_t ts, double subtrahend) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string tempWkt = fmt::format("{}@{}", value, MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tfloat_in(tempWkt.c_str()); + if (!temp) return 0.0; + Temporal* res = sub_tfloat_float(temp, subtrahend); + free(temp); + if (!res) return 0.0; + double r = tfloat_start_value(res); + free(res); + return r; + } catch (const std::exception&) { return 0.0; } + }, + value, ts, subtrahend); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterSubTfloatFloatPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "SubTfloatFloatPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return SubTfloatFloatPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-sql-parser/AntlrSQL.g4 b/nes-sql-parser/AntlrSQL.g4 index eaeea079a1..893cd4b5d3 100644 --- a/nes-sql-parser/AntlrSQL.g4 +++ b/nes-sql-parser/AntlrSQL.g4 @@ -295,7 +295,7 @@ timeUnit: MS timestampParameter: name=identifier; -functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | EDWITHIN_TGEO_GEO | TGEO_AT_STBOX | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_FLOOR | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TNUMBER_ABS; +functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | EDWITHIN_TGEO_GEO | TGEO_AT_STBOX | ADD_TFLOAT_FLOAT | DIV_TFLOAT_FLOAT | MUL_TFLOAT_FLOAT | SUB_TFLOAT_FLOAT | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_FLOOR | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TNUMBER_ABS; sinkClause: INTO sink (',' sink)*; @@ -488,6 +488,10 @@ TEMPORAL_AINTERSECTS_GEOMETRY: 'TEMPORAL_AINTERSECTS_GEOMETRY' | 'temporal_ainte TEMPORAL_ECONTAINS_GEOMETRY: 'TEMPORAL_ECONTAINS_GEOMETRY' | 'temporal_econtains_geometry'; EDWITHIN_TGEO_GEO: 'EDWITHIN_TGEO_GEO' | 'edwithin_tgeo_geo'; TGEO_AT_STBOX: 'TGEO_AT_STBOX' | 'tgeo_at_stbox'; +ADD_TFLOAT_FLOAT: 'ADD_TFLOAT_FLOAT' | 'add_tfloat_float'; +DIV_TFLOAT_FLOAT: 'DIV_TFLOAT_FLOAT' | 'div_tfloat_float'; +MUL_TFLOAT_FLOAT: 'MUL_TFLOAT_FLOAT' | 'mul_tfloat_float'; +SUB_TFLOAT_FLOAT: 'SUB_TFLOAT_FLOAT' | 'sub_tfloat_float'; TFLOAT_CEIL: 'TFLOAT_CEIL' | 'tfloat_ceil'; TFLOAT_COS: 'TFLOAT_COS' | 'tfloat_cos'; TFLOAT_DEGREES: 'TFLOAT_DEGREES' | 'tfloat_degrees'; diff --git a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp index 1043181e7a..6fc7f008dc 100644 --- a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp +++ b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp @@ -69,6 +69,10 @@ #include #include #include +#include +#include +#include +#include #include #include #include @@ -1510,6 +1514,122 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont } break; /* END CODEGEN PARSER GLUE: TNUMBER_ABS */ + /* BEGIN CODEGEN PARSER GLUE: ADD_TFLOAT_FLOAT */ + case AntlrSQLLexer::ADD_TFLOAT_FLOAT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("ADD_TFLOAT_FLOAT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AddTfloatFloatLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: ADD_TFLOAT_FLOAT */ + /* BEGIN CODEGEN PARSER GLUE: DIV_TFLOAT_FLOAT */ + case AntlrSQLLexer::DIV_TFLOAT_FLOAT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("DIV_TFLOAT_FLOAT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(DivTfloatFloatLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: DIV_TFLOAT_FLOAT */ + /* BEGIN CODEGEN PARSER GLUE: MUL_TFLOAT_FLOAT */ + case AntlrSQLLexer::MUL_TFLOAT_FLOAT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("MUL_TFLOAT_FLOAT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(MulTfloatFloatLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: MUL_TFLOAT_FLOAT */ + /* BEGIN CODEGEN PARSER GLUE: SUB_TFLOAT_FLOAT */ + case AntlrSQLLexer::SUB_TFLOAT_FLOAT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("SUB_TFLOAT_FLOAT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(SubTfloatFloatLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: SUB_TFLOAT_FLOAT */ default: /// Check if the function is a constructor for a datatype From d376592e03840130b55e045d7733b36c5e15a53b Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Fri, 12 Jun 2026 05:44:15 +0200 Subject: [PATCH 07/96] feat(meos): add ADD/SUB/MUL/DIV_TNUMBER_TNUMBER NES operators (W49) 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. --- .../Meos/AddTnumberTnumberLogicalFunction.hpp | 54 ++++++++ .../Meos/DivTnumberTnumberLogicalFunction.hpp | 54 ++++++++ .../Meos/MulTnumberTnumberLogicalFunction.hpp | 54 ++++++++ .../Meos/SubTnumberTnumberLogicalFunction.hpp | 54 ++++++++ .../Meos/AddTnumberTnumberLogicalFunction.cpp | 105 +++++++++++++++ .../src/Functions/Meos/CMakeLists.txt | 4 + .../Meos/DivTnumberTnumberLogicalFunction.cpp | 105 +++++++++++++++ .../Meos/MulTnumberTnumberLogicalFunction.cpp | 105 +++++++++++++++ .../Meos/SubTnumberTnumberLogicalFunction.cpp | 105 +++++++++++++++ .../AddTnumberTnumberPhysicalFunction.hpp | 43 +++++++ .../DivTnumberTnumberPhysicalFunction.hpp | 43 +++++++ .../MulTnumberTnumberPhysicalFunction.hpp | 43 +++++++ .../SubTnumberTnumberPhysicalFunction.hpp | 43 +++++++ .../AddTnumberTnumberPhysicalFunction.cpp | 94 ++++++++++++++ .../src/Functions/Meos/CMakeLists.txt | 4 + .../DivTnumberTnumberPhysicalFunction.cpp | 94 ++++++++++++++ .../MulTnumberTnumberPhysicalFunction.cpp | 94 ++++++++++++++ .../SubTnumberTnumberPhysicalFunction.cpp | 94 ++++++++++++++ nes-sql-parser/AntlrSQL.g4 | 6 +- .../src/AntlrSQLQueryPlanCreator.cpp | 120 ++++++++++++++++++ 20 files changed, 1317 insertions(+), 1 deletion(-) create mode 100644 nes-logical-operators/include/Functions/Meos/AddTnumberTnumberLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/DivTnumberTnumberLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/MulTnumberTnumberLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/SubTnumberTnumberLogicalFunction.hpp create mode 100644 nes-logical-operators/src/Functions/Meos/AddTnumberTnumberLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/DivTnumberTnumberLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/MulTnumberTnumberLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/SubTnumberTnumberLogicalFunction.cpp create mode 100644 nes-physical-operators/include/Functions/Meos/AddTnumberTnumberPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/DivTnumberTnumberPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/MulTnumberTnumberPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/SubTnumberTnumberPhysicalFunction.hpp create mode 100644 nes-physical-operators/src/Functions/Meos/AddTnumberTnumberPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/DivTnumberTnumberPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/MulTnumberTnumberPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/SubTnumberTnumberPhysicalFunction.cpp diff --git a/nes-logical-operators/include/Functions/Meos/AddTnumberTnumberLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AddTnumberTnumberLogicalFunction.hpp new file mode 100644 index 0000000000..eb6bf59984 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AddTnumberTnumberLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event add_tnumber_tnumber: element-wise addition of two single-instant tnumbers. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `add_tnumber_tnumber`. Takes (value1:FLOAT64, value2:FLOAT64, ts:UINT64), + * constructs two co-instant temporals, applies the addition, and returns FLOAT64. + */ +class AddTnumberTnumberLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AddTnumberTnumber"; + + AddTnumberTnumberLogicalFunction(LogicalFunction value1, + LogicalFunction value2, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/DivTnumberTnumberLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/DivTnumberTnumberLogicalFunction.hpp new file mode 100644 index 0000000000..e85de51c18 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/DivTnumberTnumberLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event div_tnumber_tnumber: element-wise division of two single-instant tnumbers. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `div_tnumber_tnumber`. Takes (value1:FLOAT64, value2:FLOAT64, ts:UINT64), + * constructs two co-instant temporals, applies the division, and returns FLOAT64. + */ +class DivTnumberTnumberLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "DivTnumberTnumber"; + + DivTnumberTnumberLogicalFunction(LogicalFunction value1, + LogicalFunction value2, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/MulTnumberTnumberLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/MulTnumberTnumberLogicalFunction.hpp new file mode 100644 index 0000000000..e3898c52ed --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/MulTnumberTnumberLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event mul_tnumber_tnumber: element-wise multiplication of two single-instant tnumbers. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `mul_tnumber_tnumber`. Takes (value1:FLOAT64, value2:FLOAT64, ts:UINT64), + * constructs two co-instant temporals, applies the multiplication, and returns FLOAT64. + */ +class MulTnumberTnumberLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "MulTnumberTnumber"; + + MulTnumberTnumberLogicalFunction(LogicalFunction value1, + LogicalFunction value2, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/SubTnumberTnumberLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/SubTnumberTnumberLogicalFunction.hpp new file mode 100644 index 0000000000..94891a2836 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/SubTnumberTnumberLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event sub_tnumber_tnumber: element-wise subtraction of two single-instant tnumbers. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `sub_tnumber_tnumber`. Takes (value1:FLOAT64, value2:FLOAT64, ts:UINT64), + * constructs two co-instant temporals, applies the subtraction, and returns FLOAT64. + */ +class SubTnumberTnumberLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "SubTnumberTnumber"; + + SubTnumberTnumberLogicalFunction(LogicalFunction value1, + LogicalFunction value2, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AddTnumberTnumberLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AddTnumberTnumberLogicalFunction.cpp new file mode 100644 index 0000000000..223f155801 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AddTnumberTnumberLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AddTnumberTnumberLogicalFunction::AddTnumberTnumberLogicalFunction(LogicalFunction value1, + LogicalFunction value2, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value1)); + parameters.push_back(std::move(value2)); + parameters.push_back(std::move(ts)); +} + +DataType AddTnumberTnumberLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AddTnumberTnumberLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AddTnumberTnumberLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AddTnumberTnumberLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "AddTnumberTnumberLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AddTnumberTnumberLogicalFunction::getType() const { return NAME; } + +bool AddTnumberTnumberLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AddTnumberTnumberLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction AddTnumberTnumberLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction AddTnumberTnumberLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAddTnumberTnumberLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "AddTnumberTnumberLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return AddTnumberTnumberLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt index 1f40833d3b..c2debfca0e 100644 --- a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt @@ -25,6 +25,10 @@ add_plugin(TfloatFloor LogicalFunction nes-logical-operators TfloatFloorLogicalF add_plugin(TfloatRadians LogicalFunction nes-logical-operators TfloatRadiansLogicalFunction.cpp) add_plugin(TfloatScaleValue LogicalFunction nes-logical-operators TfloatScaleValueLogicalFunction.cpp) add_plugin(AddTfloatFloat LogicalFunction nes-logical-operators AddTfloatFloatLogicalFunction.cpp) +add_plugin(AddTnumberTnumber LogicalFunction nes-logical-operators AddTnumberTnumberLogicalFunction.cpp) +add_plugin(DivTnumberTnumber LogicalFunction nes-logical-operators DivTnumberTnumberLogicalFunction.cpp) +add_plugin(MulTnumberTnumber LogicalFunction nes-logical-operators MulTnumberTnumberLogicalFunction.cpp) +add_plugin(SubTnumberTnumber LogicalFunction nes-logical-operators SubTnumberTnumberLogicalFunction.cpp) add_plugin(DivTfloatFloat LogicalFunction nes-logical-operators DivTfloatFloatLogicalFunction.cpp) add_plugin(MulTfloatFloat LogicalFunction nes-logical-operators MulTfloatFloatLogicalFunction.cpp) add_plugin(SubTfloatFloat LogicalFunction nes-logical-operators SubTfloatFloatLogicalFunction.cpp) diff --git a/nes-logical-operators/src/Functions/Meos/DivTnumberTnumberLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/DivTnumberTnumberLogicalFunction.cpp new file mode 100644 index 0000000000..fc7b32aa87 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/DivTnumberTnumberLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +DivTnumberTnumberLogicalFunction::DivTnumberTnumberLogicalFunction(LogicalFunction value1, + LogicalFunction value2, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value1)); + parameters.push_back(std::move(value2)); + parameters.push_back(std::move(ts)); +} + +DataType DivTnumberTnumberLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction DivTnumberTnumberLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector DivTnumberTnumberLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction DivTnumberTnumberLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "DivTnumberTnumberLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view DivTnumberTnumberLogicalFunction::getType() const { return NAME; } + +bool DivTnumberTnumberLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string DivTnumberTnumberLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction DivTnumberTnumberLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction DivTnumberTnumberLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterDivTnumberTnumberLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "DivTnumberTnumberLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return DivTnumberTnumberLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/MulTnumberTnumberLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/MulTnumberTnumberLogicalFunction.cpp new file mode 100644 index 0000000000..9d5d5fa562 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/MulTnumberTnumberLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +MulTnumberTnumberLogicalFunction::MulTnumberTnumberLogicalFunction(LogicalFunction value1, + LogicalFunction value2, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value1)); + parameters.push_back(std::move(value2)); + parameters.push_back(std::move(ts)); +} + +DataType MulTnumberTnumberLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction MulTnumberTnumberLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector MulTnumberTnumberLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction MulTnumberTnumberLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "MulTnumberTnumberLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view MulTnumberTnumberLogicalFunction::getType() const { return NAME; } + +bool MulTnumberTnumberLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string MulTnumberTnumberLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction MulTnumberTnumberLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction MulTnumberTnumberLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterMulTnumberTnumberLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "MulTnumberTnumberLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return MulTnumberTnumberLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/SubTnumberTnumberLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/SubTnumberTnumberLogicalFunction.cpp new file mode 100644 index 0000000000..844fe38ede --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/SubTnumberTnumberLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +SubTnumberTnumberLogicalFunction::SubTnumberTnumberLogicalFunction(LogicalFunction value1, + LogicalFunction value2, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value1)); + parameters.push_back(std::move(value2)); + parameters.push_back(std::move(ts)); +} + +DataType SubTnumberTnumberLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction SubTnumberTnumberLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector SubTnumberTnumberLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction SubTnumberTnumberLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "SubTnumberTnumberLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view SubTnumberTnumberLogicalFunction::getType() const { return NAME; } + +bool SubTnumberTnumberLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string SubTnumberTnumberLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction SubTnumberTnumberLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction SubTnumberTnumberLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterSubTnumberTnumberLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "SubTnumberTnumberLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return SubTnumberTnumberLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AddTnumberTnumberPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AddTnumberTnumberPhysicalFunction.hpp new file mode 100644 index 0000000000..c45dd431d3 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AddTnumberTnumberPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `add_tnumber_tnumber`. + * + * Per-event element-wise addition of two co-instant tnumbers. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class AddTnumberTnumberPhysicalFunction : public PhysicalFunctionConcept { +public: + AddTnumberTnumberPhysicalFunction(PhysicalFunction value1Function, + PhysicalFunction value2Function, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/DivTnumberTnumberPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/DivTnumberTnumberPhysicalFunction.hpp new file mode 100644 index 0000000000..3fde0ad5da --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/DivTnumberTnumberPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `div_tnumber_tnumber`. + * + * Per-event element-wise division of two co-instant tnumbers. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class DivTnumberTnumberPhysicalFunction : public PhysicalFunctionConcept { +public: + DivTnumberTnumberPhysicalFunction(PhysicalFunction value1Function, + PhysicalFunction value2Function, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/MulTnumberTnumberPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/MulTnumberTnumberPhysicalFunction.hpp new file mode 100644 index 0000000000..f3b4af1bcf --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/MulTnumberTnumberPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `mul_tnumber_tnumber`. + * + * Per-event element-wise multiplication of two co-instant tnumbers. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class MulTnumberTnumberPhysicalFunction : public PhysicalFunctionConcept { +public: + MulTnumberTnumberPhysicalFunction(PhysicalFunction value1Function, + PhysicalFunction value2Function, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/SubTnumberTnumberPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/SubTnumberTnumberPhysicalFunction.hpp new file mode 100644 index 0000000000..8e411da16d --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/SubTnumberTnumberPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `sub_tnumber_tnumber`. + * + * Per-event element-wise subtraction of two co-instant tnumbers. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class SubTnumberTnumberPhysicalFunction : public PhysicalFunctionConcept { +public: + SubTnumberTnumberPhysicalFunction(PhysicalFunction value1Function, + PhysicalFunction value2Function, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AddTnumberTnumberPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AddTnumberTnumberPhysicalFunction.cpp new file mode 100644 index 0000000000..6f709c0ceb --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AddTnumberTnumberPhysicalFunction.cpp @@ -0,0 +1,94 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +AddTnumberTnumberPhysicalFunction::AddTnumberTnumberPhysicalFunction(PhysicalFunction value1Function, + PhysicalFunction value2Function, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(value1Function)); + parameterFunctions.push_back(std::move(value2Function)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal AddTnumberTnumberPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value1 = parameterValues[0].cast>(); + auto value2 = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double value1, double value2, uint64_t ts) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + const std::string tsStr = MEOS::Meos::convertEpochToTimestamp(ts); + std::string wkt1 = fmt::format("{}@{}", value1, tsStr); + std::string wkt2 = fmt::format("{}@{}", value2, tsStr); + Temporal* t1 = tfloat_in(wkt1.c_str()); + Temporal* t2 = tfloat_in(wkt2.c_str()); + if (!t1 || !t2) { free(t1); free(t2); return 0.0; } + Temporal* res = add_tnumber_tnumber(t1, t2); + free(t1); free(t2); + if (!res) return 0.0; + double r = tfloat_start_value(res); + free(res); + return r; + } catch (const std::exception&) { return 0.0; } + }, + value1, value2, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAddTnumberTnumberPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "AddTnumberTnumberPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return AddTnumberTnumberPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt index fcfbe5b9ba..de2aeb2de3 100644 --- a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt @@ -24,6 +24,10 @@ add_plugin(TfloatFloor PhysicalFunction nes-physical-operators TfloatFloorPhysic add_plugin(TfloatRadians PhysicalFunction nes-physical-operators TfloatRadiansPhysicalFunction.cpp) add_plugin(TfloatScaleValue PhysicalFunction nes-physical-operators TfloatScaleValuePhysicalFunction.cpp) add_plugin(AddTfloatFloat PhysicalFunction nes-physical-operators AddTfloatFloatPhysicalFunction.cpp) +add_plugin(AddTnumberTnumber PhysicalFunction nes-physical-operators AddTnumberTnumberPhysicalFunction.cpp) +add_plugin(DivTnumberTnumber PhysicalFunction nes-physical-operators DivTnumberTnumberPhysicalFunction.cpp) +add_plugin(MulTnumberTnumber PhysicalFunction nes-physical-operators MulTnumberTnumberPhysicalFunction.cpp) +add_plugin(SubTnumberTnumber PhysicalFunction nes-physical-operators SubTnumberTnumberPhysicalFunction.cpp) add_plugin(DivTfloatFloat PhysicalFunction nes-physical-operators DivTfloatFloatPhysicalFunction.cpp) add_plugin(MulTfloatFloat PhysicalFunction nes-physical-operators MulTfloatFloatPhysicalFunction.cpp) add_plugin(SubTfloatFloat PhysicalFunction nes-physical-operators SubTfloatFloatPhysicalFunction.cpp) diff --git a/nes-physical-operators/src/Functions/Meos/DivTnumberTnumberPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/DivTnumberTnumberPhysicalFunction.cpp new file mode 100644 index 0000000000..1cab4168d2 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/DivTnumberTnumberPhysicalFunction.cpp @@ -0,0 +1,94 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +DivTnumberTnumberPhysicalFunction::DivTnumberTnumberPhysicalFunction(PhysicalFunction value1Function, + PhysicalFunction value2Function, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(value1Function)); + parameterFunctions.push_back(std::move(value2Function)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal DivTnumberTnumberPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value1 = parameterValues[0].cast>(); + auto value2 = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double value1, double value2, uint64_t ts) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + const std::string tsStr = MEOS::Meos::convertEpochToTimestamp(ts); + std::string wkt1 = fmt::format("{}@{}", value1, tsStr); + std::string wkt2 = fmt::format("{}@{}", value2, tsStr); + Temporal* t1 = tfloat_in(wkt1.c_str()); + Temporal* t2 = tfloat_in(wkt2.c_str()); + if (!t1 || !t2) { free(t1); free(t2); return 0.0; } + Temporal* res = div_tnumber_tnumber(t1, t2); + free(t1); free(t2); + if (!res) return 0.0; + double r = tfloat_start_value(res); + free(res); + return r; + } catch (const std::exception&) { return 0.0; } + }, + value1, value2, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterDivTnumberTnumberPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "DivTnumberTnumberPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return DivTnumberTnumberPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/MulTnumberTnumberPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/MulTnumberTnumberPhysicalFunction.cpp new file mode 100644 index 0000000000..30f600c42b --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/MulTnumberTnumberPhysicalFunction.cpp @@ -0,0 +1,94 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +MulTnumberTnumberPhysicalFunction::MulTnumberTnumberPhysicalFunction(PhysicalFunction value1Function, + PhysicalFunction value2Function, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(value1Function)); + parameterFunctions.push_back(std::move(value2Function)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal MulTnumberTnumberPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value1 = parameterValues[0].cast>(); + auto value2 = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double value1, double value2, uint64_t ts) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + const std::string tsStr = MEOS::Meos::convertEpochToTimestamp(ts); + std::string wkt1 = fmt::format("{}@{}", value1, tsStr); + std::string wkt2 = fmt::format("{}@{}", value2, tsStr); + Temporal* t1 = tfloat_in(wkt1.c_str()); + Temporal* t2 = tfloat_in(wkt2.c_str()); + if (!t1 || !t2) { free(t1); free(t2); return 0.0; } + Temporal* res = mul_tnumber_tnumber(t1, t2); + free(t1); free(t2); + if (!res) return 0.0; + double r = tfloat_start_value(res); + free(res); + return r; + } catch (const std::exception&) { return 0.0; } + }, + value1, value2, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterMulTnumberTnumberPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "MulTnumberTnumberPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return MulTnumberTnumberPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/SubTnumberTnumberPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/SubTnumberTnumberPhysicalFunction.cpp new file mode 100644 index 0000000000..4c57908824 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/SubTnumberTnumberPhysicalFunction.cpp @@ -0,0 +1,94 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +SubTnumberTnumberPhysicalFunction::SubTnumberTnumberPhysicalFunction(PhysicalFunction value1Function, + PhysicalFunction value2Function, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(value1Function)); + parameterFunctions.push_back(std::move(value2Function)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal SubTnumberTnumberPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value1 = parameterValues[0].cast>(); + auto value2 = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double value1, double value2, uint64_t ts) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + const std::string tsStr = MEOS::Meos::convertEpochToTimestamp(ts); + std::string wkt1 = fmt::format("{}@{}", value1, tsStr); + std::string wkt2 = fmt::format("{}@{}", value2, tsStr); + Temporal* t1 = tfloat_in(wkt1.c_str()); + Temporal* t2 = tfloat_in(wkt2.c_str()); + if (!t1 || !t2) { free(t1); free(t2); return 0.0; } + Temporal* res = sub_tnumber_tnumber(t1, t2); + free(t1); free(t2); + if (!res) return 0.0; + double r = tfloat_start_value(res); + free(res); + return r; + } catch (const std::exception&) { return 0.0; } + }, + value1, value2, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterSubTnumberTnumberPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "SubTnumberTnumberPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return SubTnumberTnumberPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-sql-parser/AntlrSQL.g4 b/nes-sql-parser/AntlrSQL.g4 index 893cd4b5d3..379cf86cd1 100644 --- a/nes-sql-parser/AntlrSQL.g4 +++ b/nes-sql-parser/AntlrSQL.g4 @@ -295,7 +295,7 @@ timeUnit: MS timestampParameter: name=identifier; -functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | EDWITHIN_TGEO_GEO | TGEO_AT_STBOX | ADD_TFLOAT_FLOAT | DIV_TFLOAT_FLOAT | MUL_TFLOAT_FLOAT | SUB_TFLOAT_FLOAT | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_FLOOR | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TNUMBER_ABS; +functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | EDWITHIN_TGEO_GEO | TGEO_AT_STBOX | ADD_TFLOAT_FLOAT | ADD_TNUMBER_TNUMBER | DIV_TFLOAT_FLOAT | DIV_TNUMBER_TNUMBER | MUL_TFLOAT_FLOAT | MUL_TNUMBER_TNUMBER | SUB_TFLOAT_FLOAT | SUB_TNUMBER_TNUMBER | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_FLOOR | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TNUMBER_ABS; sinkClause: INTO sink (',' sink)*; @@ -489,9 +489,13 @@ TEMPORAL_ECONTAINS_GEOMETRY: 'TEMPORAL_ECONTAINS_GEOMETRY' | 'temporal_econtains EDWITHIN_TGEO_GEO: 'EDWITHIN_TGEO_GEO' | 'edwithin_tgeo_geo'; TGEO_AT_STBOX: 'TGEO_AT_STBOX' | 'tgeo_at_stbox'; ADD_TFLOAT_FLOAT: 'ADD_TFLOAT_FLOAT' | 'add_tfloat_float'; +ADD_TNUMBER_TNUMBER: 'ADD_TNUMBER_TNUMBER' | 'add_tnumber_tnumber'; DIV_TFLOAT_FLOAT: 'DIV_TFLOAT_FLOAT' | 'div_tfloat_float'; +DIV_TNUMBER_TNUMBER: 'DIV_TNUMBER_TNUMBER' | 'div_tnumber_tnumber'; MUL_TFLOAT_FLOAT: 'MUL_TFLOAT_FLOAT' | 'mul_tfloat_float'; +MUL_TNUMBER_TNUMBER: 'MUL_TNUMBER_TNUMBER' | 'mul_tnumber_tnumber'; SUB_TFLOAT_FLOAT: 'SUB_TFLOAT_FLOAT' | 'sub_tfloat_float'; +SUB_TNUMBER_TNUMBER: 'SUB_TNUMBER_TNUMBER' | 'sub_tnumber_tnumber'; TFLOAT_CEIL: 'TFLOAT_CEIL' | 'tfloat_ceil'; TFLOAT_COS: 'TFLOAT_COS' | 'tfloat_cos'; TFLOAT_DEGREES: 'TFLOAT_DEGREES' | 'tfloat_degrees'; diff --git a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp index 6fc7f008dc..8af91b5966 100644 --- a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp +++ b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp @@ -70,9 +70,13 @@ #include #include #include +#include #include +#include #include +#include #include +#include #include #include #include @@ -1630,6 +1634,122 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont } break; /* END CODEGEN PARSER GLUE: SUB_TFLOAT_FLOAT */ + /* BEGIN CODEGEN PARSER GLUE: ADD_TNUMBER_TNUMBER */ + case AntlrSQLLexer::ADD_TNUMBER_TNUMBER: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("ADD_TNUMBER_TNUMBER requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AddTnumberTnumberLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: ADD_TNUMBER_TNUMBER */ + /* BEGIN CODEGEN PARSER GLUE: DIV_TNUMBER_TNUMBER */ + case AntlrSQLLexer::DIV_TNUMBER_TNUMBER: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("DIV_TNUMBER_TNUMBER requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(DivTnumberTnumberLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: DIV_TNUMBER_TNUMBER */ + /* BEGIN CODEGEN PARSER GLUE: MUL_TNUMBER_TNUMBER */ + case AntlrSQLLexer::MUL_TNUMBER_TNUMBER: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("MUL_TNUMBER_TNUMBER requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(MulTnumberTnumberLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: MUL_TNUMBER_TNUMBER */ + /* BEGIN CODEGEN PARSER GLUE: SUB_TNUMBER_TNUMBER */ + case AntlrSQLLexer::SUB_TNUMBER_TNUMBER: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("SUB_TNUMBER_TNUMBER requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(SubTnumberTnumberLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: SUB_TNUMBER_TNUMBER */ default: /// Check if the function is a constructor for a datatype From 69172abb64d87bcdeb9f200768bafb5aed4f0945 Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Fri, 12 Jun 2026 05:52:35 +0200 Subject: [PATCH 08/96] feat(meos): add TEMPORAL_ROUND, TDISTANCE_TFLOAT_FLOAT, TDISTANCE_TNUMBER_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. --- .../TdistanceTfloatFloatLogicalFunction.hpp | 54 +++++++++ ...TdistanceTnumberTnumberLogicalFunction.hpp | 54 +++++++++ .../Meos/TemporalRoundLogicalFunction.hpp | 54 +++++++++ .../src/Functions/Meos/CMakeLists.txt | 3 + .../TdistanceTfloatFloatLogicalFunction.cpp | 105 ++++++++++++++++++ ...TdistanceTnumberTnumberLogicalFunction.cpp | 105 ++++++++++++++++++ .../Meos/TemporalRoundLogicalFunction.cpp | 105 ++++++++++++++++++ .../TdistanceTfloatFloatPhysicalFunction.hpp | 43 +++++++ ...distanceTnumberTnumberPhysicalFunction.hpp | 43 +++++++ .../Meos/TemporalRoundPhysicalFunction.hpp | 43 +++++++ .../src/Functions/Meos/CMakeLists.txt | 3 + .../TdistanceTfloatFloatPhysicalFunction.cpp | 91 +++++++++++++++ ...distanceTnumberTnumberPhysicalFunction.cpp | 94 ++++++++++++++++ .../Meos/TemporalRoundPhysicalFunction.cpp | 91 +++++++++++++++ nes-sql-parser/AntlrSQL.g4 | 5 +- .../src/AntlrSQLQueryPlanCreator.cpp | 90 +++++++++++++++ 16 files changed, 982 insertions(+), 1 deletion(-) create mode 100644 nes-logical-operators/include/Functions/Meos/TdistanceTfloatFloatLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TdistanceTnumberTnumberLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TemporalRoundLogicalFunction.hpp create mode 100644 nes-logical-operators/src/Functions/Meos/TdistanceTfloatFloatLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TdistanceTnumberTnumberLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TemporalRoundLogicalFunction.cpp create mode 100644 nes-physical-operators/include/Functions/Meos/TdistanceTfloatFloatPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TdistanceTnumberTnumberPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TemporalRoundPhysicalFunction.hpp create mode 100644 nes-physical-operators/src/Functions/Meos/TdistanceTfloatFloatPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TdistanceTnumberTnumberPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TemporalRoundPhysicalFunction.cpp diff --git a/nes-logical-operators/include/Functions/Meos/TdistanceTfloatFloatLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TdistanceTfloatFloatLogicalFunction.hpp new file mode 100644 index 0000000000..0404bd65b5 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TdistanceTfloatFloatLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event tdistance_tfloat_float: distance between a single-instant tfloat and a float. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `tdistance_tfloat_float`. Takes (value:FLOAT64, ts:UINT64, d:FLOAT64), + * constructs a single-instant temporal, applies the distance function, and returns FLOAT64. + */ +class TdistanceTfloatFloatLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TdistanceTfloatFloat"; + + TdistanceTfloatFloatLogicalFunction(LogicalFunction value, + LogicalFunction ts, + LogicalFunction d); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TdistanceTnumberTnumberLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TdistanceTnumberTnumberLogicalFunction.hpp new file mode 100644 index 0000000000..1f9f544348 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TdistanceTnumberTnumberLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event tdistance_tnumber_tnumber: distance between two co-instant tnumber values. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `tdistance_tnumber_tnumber`. Takes (value1:FLOAT64, value2:FLOAT64, ts:UINT64), + * constructs two co-instant temporals, applies the distance function, and returns FLOAT64. + */ +class TdistanceTnumberTnumberLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TdistanceTnumberTnumber"; + + TdistanceTnumberTnumberLogicalFunction(LogicalFunction value1, + LogicalFunction value2, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TemporalRoundLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TemporalRoundLogicalFunction.hpp new file mode 100644 index 0000000000..987761a0df --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TemporalRoundLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event temporal_round: rounds a single-instant tfloat to N decimal places. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `temporal_round`. Takes (value:FLOAT64, ts:UINT64, maxdd:FLOAT64→int), + * constructs a single-instant temporal, applies the rounding, and returns FLOAT64. + */ +class TemporalRoundLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TemporalRound"; + + TemporalRoundLogicalFunction(LogicalFunction value, + LogicalFunction ts, + LogicalFunction maxdd); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt index c2debfca0e..a58cf4184b 100644 --- a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt @@ -26,6 +26,9 @@ add_plugin(TfloatRadians LogicalFunction nes-logical-operators TfloatRadiansLogi add_plugin(TfloatScaleValue LogicalFunction nes-logical-operators TfloatScaleValueLogicalFunction.cpp) add_plugin(AddTfloatFloat LogicalFunction nes-logical-operators AddTfloatFloatLogicalFunction.cpp) add_plugin(AddTnumberTnumber LogicalFunction nes-logical-operators AddTnumberTnumberLogicalFunction.cpp) +add_plugin(TdistanceTfloatFloat LogicalFunction nes-logical-operators TdistanceTfloatFloatLogicalFunction.cpp) +add_plugin(TdistanceTnumberTnumber LogicalFunction nes-logical-operators TdistanceTnumberTnumberLogicalFunction.cpp) +add_plugin(TemporalRound LogicalFunction nes-logical-operators TemporalRoundLogicalFunction.cpp) add_plugin(DivTnumberTnumber LogicalFunction nes-logical-operators DivTnumberTnumberLogicalFunction.cpp) add_plugin(MulTnumberTnumber LogicalFunction nes-logical-operators MulTnumberTnumberLogicalFunction.cpp) add_plugin(SubTnumberTnumber LogicalFunction nes-logical-operators SubTnumberTnumberLogicalFunction.cpp) diff --git a/nes-logical-operators/src/Functions/Meos/TdistanceTfloatFloatLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TdistanceTfloatFloatLogicalFunction.cpp new file mode 100644 index 0000000000..3532410708 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TdistanceTfloatFloatLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TdistanceTfloatFloatLogicalFunction::TdistanceTfloatFloatLogicalFunction(LogicalFunction value, + LogicalFunction ts, + LogicalFunction d) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(d)); +} + +DataType TdistanceTfloatFloatLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction TdistanceTfloatFloatLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector TdistanceTfloatFloatLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction TdistanceTfloatFloatLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "TdistanceTfloatFloatLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view TdistanceTfloatFloatLogicalFunction::getType() const { return NAME; } + +bool TdistanceTfloatFloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string TdistanceTfloatFloatLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TdistanceTfloatFloatLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction TdistanceTfloatFloatLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTdistanceTfloatFloatLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "TdistanceTfloatFloatLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return TdistanceTfloatFloatLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TdistanceTnumberTnumberLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TdistanceTnumberTnumberLogicalFunction.cpp new file mode 100644 index 0000000000..2ff41374c1 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TdistanceTnumberTnumberLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TdistanceTnumberTnumberLogicalFunction::TdistanceTnumberTnumberLogicalFunction(LogicalFunction value1, + LogicalFunction value2, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value1)); + parameters.push_back(std::move(value2)); + parameters.push_back(std::move(ts)); +} + +DataType TdistanceTnumberTnumberLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction TdistanceTnumberTnumberLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector TdistanceTnumberTnumberLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction TdistanceTnumberTnumberLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "TdistanceTnumberTnumberLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view TdistanceTnumberTnumberLogicalFunction::getType() const { return NAME; } + +bool TdistanceTnumberTnumberLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string TdistanceTnumberTnumberLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TdistanceTnumberTnumberLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction TdistanceTnumberTnumberLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTdistanceTnumberTnumberLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "TdistanceTnumberTnumberLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return TdistanceTnumberTnumberLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TemporalRoundLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TemporalRoundLogicalFunction.cpp new file mode 100644 index 0000000000..95163814fd --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TemporalRoundLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TemporalRoundLogicalFunction::TemporalRoundLogicalFunction(LogicalFunction value, + LogicalFunction ts, + LogicalFunction maxdd) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(maxdd)); +} + +DataType TemporalRoundLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction TemporalRoundLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector TemporalRoundLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction TemporalRoundLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "TemporalRoundLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view TemporalRoundLogicalFunction::getType() const { return NAME; } + +bool TemporalRoundLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string TemporalRoundLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TemporalRoundLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction TemporalRoundLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTemporalRoundLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "TemporalRoundLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return TemporalRoundLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TdistanceTfloatFloatPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TdistanceTfloatFloatPhysicalFunction.hpp new file mode 100644 index 0000000000..06bf692313 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TdistanceTfloatFloatPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `tdistance_tfloat_float`. + * + * Per-event tdistance_tfloat_float: distance between a single-instant tfloat and a float. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TdistanceTfloatFloatPhysicalFunction : public PhysicalFunctionConcept { +public: + TdistanceTfloatFloatPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction, + PhysicalFunction dFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TdistanceTnumberTnumberPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TdistanceTnumberTnumberPhysicalFunction.hpp new file mode 100644 index 0000000000..107d00bae1 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TdistanceTnumberTnumberPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `tdistance_tnumber_tnumber`. + * + * Per-event tdistance_tnumber_tnumber: distance between two co-instant tnumber values. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TdistanceTnumberTnumberPhysicalFunction : public PhysicalFunctionConcept { +public: + TdistanceTnumberTnumberPhysicalFunction(PhysicalFunction value1Function, + PhysicalFunction value2Function, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TemporalRoundPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TemporalRoundPhysicalFunction.hpp new file mode 100644 index 0000000000..4b169faee3 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TemporalRoundPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `temporal_round`. + * + * Per-event temporal_round: rounds a single-instant tfloat to N decimal places. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TemporalRoundPhysicalFunction : public PhysicalFunctionConcept { +public: + TemporalRoundPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction, + PhysicalFunction maxddFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt index de2aeb2de3..d3c9c131b4 100644 --- a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt @@ -25,6 +25,9 @@ add_plugin(TfloatRadians PhysicalFunction nes-physical-operators TfloatRadiansPh add_plugin(TfloatScaleValue PhysicalFunction nes-physical-operators TfloatScaleValuePhysicalFunction.cpp) add_plugin(AddTfloatFloat PhysicalFunction nes-physical-operators AddTfloatFloatPhysicalFunction.cpp) add_plugin(AddTnumberTnumber PhysicalFunction nes-physical-operators AddTnumberTnumberPhysicalFunction.cpp) +add_plugin(TdistanceTfloatFloat PhysicalFunction nes-physical-operators TdistanceTfloatFloatPhysicalFunction.cpp) +add_plugin(TdistanceTnumberTnumber PhysicalFunction nes-physical-operators TdistanceTnumberTnumberPhysicalFunction.cpp) +add_plugin(TemporalRound PhysicalFunction nes-physical-operators TemporalRoundPhysicalFunction.cpp) add_plugin(DivTnumberTnumber PhysicalFunction nes-physical-operators DivTnumberTnumberPhysicalFunction.cpp) add_plugin(MulTnumberTnumber PhysicalFunction nes-physical-operators MulTnumberTnumberPhysicalFunction.cpp) add_plugin(SubTnumberTnumber PhysicalFunction nes-physical-operators SubTnumberTnumberPhysicalFunction.cpp) diff --git a/nes-physical-operators/src/Functions/Meos/TdistanceTfloatFloatPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TdistanceTfloatFloatPhysicalFunction.cpp new file mode 100644 index 0000000000..f32584b1fc --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TdistanceTfloatFloatPhysicalFunction.cpp @@ -0,0 +1,91 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +TdistanceTfloatFloatPhysicalFunction::TdistanceTfloatFloatPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction, + PhysicalFunction dFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(dFunction)); +} + +VarVal TdistanceTfloatFloatPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto ts = parameterValues[1].cast>(); + auto d = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double value, uint64_t ts, double d) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string tempWkt = fmt::format("{}@{}", value, MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tfloat_in(tempWkt.c_str()); + if (!temp) return 0.0; + Temporal* res = tdistance_tfloat_float(temp, d); + free(temp); + if (!res) return 0.0; + double r = tfloat_start_value(res); + free(res); + return r; + } catch (const std::exception&) { return 0.0; } + }, + value, ts, d); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTdistanceTfloatFloatPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "TdistanceTfloatFloatPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return TdistanceTfloatFloatPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TdistanceTnumberTnumberPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TdistanceTnumberTnumberPhysicalFunction.cpp new file mode 100644 index 0000000000..26696f4bb7 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TdistanceTnumberTnumberPhysicalFunction.cpp @@ -0,0 +1,94 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +TdistanceTnumberTnumberPhysicalFunction::TdistanceTnumberTnumberPhysicalFunction(PhysicalFunction value1Function, + PhysicalFunction value2Function, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(value1Function)); + parameterFunctions.push_back(std::move(value2Function)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal TdistanceTnumberTnumberPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value1 = parameterValues[0].cast>(); + auto value2 = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double value1, double value2, uint64_t ts) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + const std::string tsStr = MEOS::Meos::convertEpochToTimestamp(ts); + std::string wkt1 = fmt::format("{}@{}", value1, tsStr); + std::string wkt2 = fmt::format("{}@{}", value2, tsStr); + Temporal* t1 = tfloat_in(wkt1.c_str()); + Temporal* t2 = tfloat_in(wkt2.c_str()); + if (!t1 || !t2) { free(t1); free(t2); return 0.0; } + Temporal* res = tdistance_tnumber_tnumber(t1, t2); + free(t1); free(t2); + if (!res) return 0.0; + double r = tfloat_start_value(res); + free(res); + return r; + } catch (const std::exception&) { return 0.0; } + }, + value1, value2, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTdistanceTnumberTnumberPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "TdistanceTnumberTnumberPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return TdistanceTnumberTnumberPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TemporalRoundPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TemporalRoundPhysicalFunction.cpp new file mode 100644 index 0000000000..8836fe5bdf --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TemporalRoundPhysicalFunction.cpp @@ -0,0 +1,91 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +TemporalRoundPhysicalFunction::TemporalRoundPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction, + PhysicalFunction maxddFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(maxddFunction)); +} + +VarVal TemporalRoundPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto ts = parameterValues[1].cast>(); + auto maxdd = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double value, uint64_t ts, double maxdd_d) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string tempWkt = fmt::format("{}@{}", value, MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tfloat_in(tempWkt.c_str()); + if (!temp) return 0.0; + Temporal* res = temporal_round(temp, static_cast(maxdd_d)); + free(temp); + if (!res) return 0.0; + double r = tfloat_start_value(res); + free(res); + return r; + } catch (const std::exception&) { return 0.0; } + }, + value, ts, maxdd); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTemporalRoundPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "TemporalRoundPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return TemporalRoundPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-sql-parser/AntlrSQL.g4 b/nes-sql-parser/AntlrSQL.g4 index 379cf86cd1..f4fd7a6858 100644 --- a/nes-sql-parser/AntlrSQL.g4 +++ b/nes-sql-parser/AntlrSQL.g4 @@ -295,7 +295,7 @@ timeUnit: MS timestampParameter: name=identifier; -functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | EDWITHIN_TGEO_GEO | TGEO_AT_STBOX | ADD_TFLOAT_FLOAT | ADD_TNUMBER_TNUMBER | DIV_TFLOAT_FLOAT | DIV_TNUMBER_TNUMBER | MUL_TFLOAT_FLOAT | MUL_TNUMBER_TNUMBER | SUB_TFLOAT_FLOAT | SUB_TNUMBER_TNUMBER | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_FLOOR | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TNUMBER_ABS; +functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | EDWITHIN_TGEO_GEO | TGEO_AT_STBOX | ADD_TFLOAT_FLOAT | ADD_TNUMBER_TNUMBER | DIV_TFLOAT_FLOAT | DIV_TNUMBER_TNUMBER | MUL_TFLOAT_FLOAT | MUL_TNUMBER_TNUMBER | SUB_TFLOAT_FLOAT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_FLOOR | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TNUMBER_ABS; sinkClause: INTO sink (',' sink)*; @@ -496,6 +496,9 @@ MUL_TFLOAT_FLOAT: 'MUL_TFLOAT_FLOAT' | 'mul_tfloat_float'; MUL_TNUMBER_TNUMBER: 'MUL_TNUMBER_TNUMBER' | 'mul_tnumber_tnumber'; SUB_TFLOAT_FLOAT: 'SUB_TFLOAT_FLOAT' | 'sub_tfloat_float'; SUB_TNUMBER_TNUMBER: 'SUB_TNUMBER_TNUMBER' | 'sub_tnumber_tnumber'; +TDISTANCE_TFLOAT_FLOAT: 'TDISTANCE_TFLOAT_FLOAT' | 'tdistance_tfloat_float'; +TDISTANCE_TNUMBER_TNUMBER: 'TDISTANCE_TNUMBER_TNUMBER' | 'tdistance_tnumber_tnumber'; +TEMPORAL_ROUND: 'TEMPORAL_ROUND' | 'temporal_round'; TFLOAT_CEIL: 'TFLOAT_CEIL' | 'tfloat_ceil'; TFLOAT_COS: 'TFLOAT_COS' | 'tfloat_cos'; TFLOAT_DEGREES: 'TFLOAT_DEGREES' | 'tfloat_degrees'; diff --git a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp index 8af91b5966..de68032c01 100644 --- a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp +++ b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp @@ -77,6 +77,9 @@ #include #include #include +#include +#include +#include #include #include #include @@ -1751,6 +1754,93 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont break; /* END CODEGEN PARSER GLUE: SUB_TNUMBER_TNUMBER */ + case AntlrSQLLexer::TDISTANCE_TFLOAT_FLOAT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("TDISTANCE_TFLOAT_FLOAT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(TdistanceTfloatFloatLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: TDISTANCE_TFLOAT_FLOAT */ + + case AntlrSQLLexer::TDISTANCE_TNUMBER_TNUMBER: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("TDISTANCE_TNUMBER_TNUMBER requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(TdistanceTnumberTnumberLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: TDISTANCE_TNUMBER_TNUMBER */ + + case AntlrSQLLexer::TEMPORAL_ROUND: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("TEMPORAL_ROUND requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(TemporalRoundLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: TEMPORAL_ROUND */ + default: /// Check if the function is a constructor for a datatype if (const auto dataType = DataTypeProvider::tryProvideDataType(funcName); dataType.has_value()) From b789cafb8df066c736a178f512cc54143e85ee60 Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Fri, 12 Jun 2026 05:58:40 +0200 Subject: [PATCH 09/96] feat(meos): add ADD/SUB/MUL/DIV_TINT_INT NES operators (W51) 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. --- .../Meos/AddTintIntLogicalFunction.hpp | 54 ++++++++ .../Meos/DivTintIntLogicalFunction.hpp | 54 ++++++++ .../Meos/MulTintIntLogicalFunction.hpp | 54 ++++++++ .../Meos/SubTintIntLogicalFunction.hpp | 54 ++++++++ .../Meos/AddTintIntLogicalFunction.cpp | 105 +++++++++++++++ .../src/Functions/Meos/CMakeLists.txt | 4 + .../Meos/DivTintIntLogicalFunction.cpp | 105 +++++++++++++++ .../Meos/MulTintIntLogicalFunction.cpp | 105 +++++++++++++++ .../Meos/SubTintIntLogicalFunction.cpp | 105 +++++++++++++++ .../Meos/AddTintIntPhysicalFunction.hpp | 43 +++++++ .../Meos/DivTintIntPhysicalFunction.hpp | 43 +++++++ .../Meos/MulTintIntPhysicalFunction.hpp | 43 +++++++ .../Meos/SubTintIntPhysicalFunction.hpp | 43 +++++++ .../Meos/AddTintIntPhysicalFunction.cpp | 91 +++++++++++++ .../src/Functions/Meos/CMakeLists.txt | 4 + .../Meos/DivTintIntPhysicalFunction.cpp | 91 +++++++++++++ .../Meos/MulTintIntPhysicalFunction.cpp | 91 +++++++++++++ .../Meos/SubTintIntPhysicalFunction.cpp | 91 +++++++++++++ nes-sql-parser/AntlrSQL.g4 | 6 +- .../src/AntlrSQLQueryPlanCreator.cpp | 121 ++++++++++++++++++ 20 files changed, 1306 insertions(+), 1 deletion(-) create mode 100644 nes-logical-operators/include/Functions/Meos/AddTintIntLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/DivTintIntLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/MulTintIntLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/SubTintIntLogicalFunction.hpp create mode 100644 nes-logical-operators/src/Functions/Meos/AddTintIntLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/DivTintIntLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/MulTintIntLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/SubTintIntLogicalFunction.cpp create mode 100644 nes-physical-operators/include/Functions/Meos/AddTintIntPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/DivTintIntPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/MulTintIntPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/SubTintIntPhysicalFunction.hpp create mode 100644 nes-physical-operators/src/Functions/Meos/AddTintIntPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/DivTintIntPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/MulTintIntPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/SubTintIntPhysicalFunction.cpp diff --git a/nes-logical-operators/include/Functions/Meos/AddTintIntLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AddTintIntLogicalFunction.hpp new file mode 100644 index 0000000000..c38de2cff9 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AddTintIntLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event add_tint_int: adds a constant integer to a single-instant tint value. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `add_tint_int`. Takes (value:FLOAT64, ts:UINT64, addend:FLOAT64→int), + * constructs a single-instant temporal, applies the addition, and returns FLOAT64. + */ +class AddTintIntLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AddTintInt"; + + AddTintIntLogicalFunction(LogicalFunction value, + LogicalFunction ts, + LogicalFunction addend); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/DivTintIntLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/DivTintIntLogicalFunction.hpp new file mode 100644 index 0000000000..3c201c5b16 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/DivTintIntLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event div_tint_int: divides a single-instant tint value by a constant integer. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `div_tint_int`. Takes (value:FLOAT64, ts:UINT64, divisor:FLOAT64→int), + * constructs a single-instant temporal, applies the division, and returns FLOAT64. + */ +class DivTintIntLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "DivTintInt"; + + DivTintIntLogicalFunction(LogicalFunction value, + LogicalFunction ts, + LogicalFunction divisor); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/MulTintIntLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/MulTintIntLogicalFunction.hpp new file mode 100644 index 0000000000..bf2fbb90b5 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/MulTintIntLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event mul_tint_int: multiplies a single-instant tint value by a constant integer. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `mul_tint_int`. Takes (value:FLOAT64, ts:UINT64, multiplier:FLOAT64→int), + * constructs a single-instant temporal, applies the multiplication, and returns FLOAT64. + */ +class MulTintIntLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "MulTintInt"; + + MulTintIntLogicalFunction(LogicalFunction value, + LogicalFunction ts, + LogicalFunction multiplier); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/SubTintIntLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/SubTintIntLogicalFunction.hpp new file mode 100644 index 0000000000..49c77fc4d3 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/SubTintIntLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event sub_tint_int: subtracts a constant integer from a single-instant tint value. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `sub_tint_int`. Takes (value:FLOAT64, ts:UINT64, subtrahend:FLOAT64→int), + * constructs a single-instant temporal, applies the subtraction, and returns FLOAT64. + */ +class SubTintIntLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "SubTintInt"; + + SubTintIntLogicalFunction(LogicalFunction value, + LogicalFunction ts, + LogicalFunction subtrahend); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AddTintIntLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AddTintIntLogicalFunction.cpp new file mode 100644 index 0000000000..a788921856 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AddTintIntLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AddTintIntLogicalFunction::AddTintIntLogicalFunction(LogicalFunction value, + LogicalFunction ts, + LogicalFunction addend) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(addend)); +} + +DataType AddTintIntLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AddTintIntLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AddTintIntLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AddTintIntLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "AddTintIntLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AddTintIntLogicalFunction::getType() const { return NAME; } + +bool AddTintIntLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AddTintIntLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction AddTintIntLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction AddTintIntLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAddTintIntLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "AddTintIntLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return AddTintIntLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt index a58cf4184b..5734d5a728 100644 --- a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt @@ -25,12 +25,16 @@ add_plugin(TfloatFloor LogicalFunction nes-logical-operators TfloatFloorLogicalF add_plugin(TfloatRadians LogicalFunction nes-logical-operators TfloatRadiansLogicalFunction.cpp) add_plugin(TfloatScaleValue LogicalFunction nes-logical-operators TfloatScaleValueLogicalFunction.cpp) add_plugin(AddTfloatFloat LogicalFunction nes-logical-operators AddTfloatFloatLogicalFunction.cpp) +add_plugin(AddTintInt LogicalFunction nes-logical-operators AddTintIntLogicalFunction.cpp) add_plugin(AddTnumberTnumber LogicalFunction nes-logical-operators AddTnumberTnumberLogicalFunction.cpp) add_plugin(TdistanceTfloatFloat LogicalFunction nes-logical-operators TdistanceTfloatFloatLogicalFunction.cpp) add_plugin(TdistanceTnumberTnumber LogicalFunction nes-logical-operators TdistanceTnumberTnumberLogicalFunction.cpp) add_plugin(TemporalRound LogicalFunction nes-logical-operators TemporalRoundLogicalFunction.cpp) +add_plugin(DivTintInt LogicalFunction nes-logical-operators DivTintIntLogicalFunction.cpp) add_plugin(DivTnumberTnumber LogicalFunction nes-logical-operators DivTnumberTnumberLogicalFunction.cpp) +add_plugin(MulTintInt LogicalFunction nes-logical-operators MulTintIntLogicalFunction.cpp) add_plugin(MulTnumberTnumber LogicalFunction nes-logical-operators MulTnumberTnumberLogicalFunction.cpp) +add_plugin(SubTintInt LogicalFunction nes-logical-operators SubTintIntLogicalFunction.cpp) add_plugin(SubTnumberTnumber LogicalFunction nes-logical-operators SubTnumberTnumberLogicalFunction.cpp) add_plugin(DivTfloatFloat LogicalFunction nes-logical-operators DivTfloatFloatLogicalFunction.cpp) add_plugin(MulTfloatFloat LogicalFunction nes-logical-operators MulTfloatFloatLogicalFunction.cpp) diff --git a/nes-logical-operators/src/Functions/Meos/DivTintIntLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/DivTintIntLogicalFunction.cpp new file mode 100644 index 0000000000..723116937f --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/DivTintIntLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +DivTintIntLogicalFunction::DivTintIntLogicalFunction(LogicalFunction value, + LogicalFunction ts, + LogicalFunction divisor) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(divisor)); +} + +DataType DivTintIntLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction DivTintIntLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector DivTintIntLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction DivTintIntLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "DivTintIntLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view DivTintIntLogicalFunction::getType() const { return NAME; } + +bool DivTintIntLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string DivTintIntLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction DivTintIntLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction DivTintIntLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterDivTintIntLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "DivTintIntLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return DivTintIntLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/MulTintIntLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/MulTintIntLogicalFunction.cpp new file mode 100644 index 0000000000..e973fe3aa8 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/MulTintIntLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +MulTintIntLogicalFunction::MulTintIntLogicalFunction(LogicalFunction value, + LogicalFunction ts, + LogicalFunction multiplier) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(multiplier)); +} + +DataType MulTintIntLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction MulTintIntLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector MulTintIntLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction MulTintIntLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "MulTintIntLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view MulTintIntLogicalFunction::getType() const { return NAME; } + +bool MulTintIntLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string MulTintIntLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction MulTintIntLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction MulTintIntLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterMulTintIntLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "MulTintIntLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return MulTintIntLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/SubTintIntLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/SubTintIntLogicalFunction.cpp new file mode 100644 index 0000000000..1b18e51bce --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/SubTintIntLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +SubTintIntLogicalFunction::SubTintIntLogicalFunction(LogicalFunction value, + LogicalFunction ts, + LogicalFunction subtrahend) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(subtrahend)); +} + +DataType SubTintIntLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction SubTintIntLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector SubTintIntLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction SubTintIntLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "SubTintIntLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view SubTintIntLogicalFunction::getType() const { return NAME; } + +bool SubTintIntLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string SubTintIntLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction SubTintIntLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction SubTintIntLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterSubTintIntLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "SubTintIntLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return SubTintIntLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AddTintIntPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AddTintIntPhysicalFunction.hpp new file mode 100644 index 0000000000..e2fd8daba7 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AddTintIntPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `add_tint_int`. + * + * Per-event add_tint_int: adds a constant integer to a single-instant tint value. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class AddTintIntPhysicalFunction : public PhysicalFunctionConcept { +public: + AddTintIntPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction, + PhysicalFunction addendFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/DivTintIntPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/DivTintIntPhysicalFunction.hpp new file mode 100644 index 0000000000..40c7f5a1a3 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/DivTintIntPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `div_tint_int`. + * + * Per-event div_tint_int: divides a single-instant tint value by a constant integer. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class DivTintIntPhysicalFunction : public PhysicalFunctionConcept { +public: + DivTintIntPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction, + PhysicalFunction divisorFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/MulTintIntPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/MulTintIntPhysicalFunction.hpp new file mode 100644 index 0000000000..8f3215281f --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/MulTintIntPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `mul_tint_int`. + * + * Per-event mul_tint_int: multiplies a single-instant tint value by a constant integer. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class MulTintIntPhysicalFunction : public PhysicalFunctionConcept { +public: + MulTintIntPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction, + PhysicalFunction multiplierFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/SubTintIntPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/SubTintIntPhysicalFunction.hpp new file mode 100644 index 0000000000..d7792e3f00 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/SubTintIntPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `sub_tint_int`. + * + * Per-event sub_tint_int: subtracts a constant integer from a single-instant tint value. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class SubTintIntPhysicalFunction : public PhysicalFunctionConcept { +public: + SubTintIntPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction, + PhysicalFunction subtrahendFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AddTintIntPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AddTintIntPhysicalFunction.cpp new file mode 100644 index 0000000000..031a677e61 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AddTintIntPhysicalFunction.cpp @@ -0,0 +1,91 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +AddTintIntPhysicalFunction::AddTintIntPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction, + PhysicalFunction addendFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(addendFunction)); +} + +VarVal AddTintIntPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto ts = parameterValues[1].cast>(); + auto addend = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double value, uint64_t ts, double addend_d) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string tempWkt = fmt::format("{}@{}", static_cast(value), MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tint_in(tempWkt.c_str()); + if (!temp) return 0.0; + Temporal* res = add_tint_int(temp, static_cast(addend_d)); + free(temp); + if (!res) return 0.0; + double r = static_cast(tint_start_value(res)); + free(res); + return r; + } catch (const std::exception&) { return 0.0; } + }, + value, ts, addend); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAddTintIntPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "AddTintIntPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return AddTintIntPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt index d3c9c131b4..1b7168a2c2 100644 --- a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt @@ -24,12 +24,16 @@ add_plugin(TfloatFloor PhysicalFunction nes-physical-operators TfloatFloorPhysic add_plugin(TfloatRadians PhysicalFunction nes-physical-operators TfloatRadiansPhysicalFunction.cpp) add_plugin(TfloatScaleValue PhysicalFunction nes-physical-operators TfloatScaleValuePhysicalFunction.cpp) add_plugin(AddTfloatFloat PhysicalFunction nes-physical-operators AddTfloatFloatPhysicalFunction.cpp) +add_plugin(AddTintInt PhysicalFunction nes-physical-operators AddTintIntPhysicalFunction.cpp) add_plugin(AddTnumberTnumber PhysicalFunction nes-physical-operators AddTnumberTnumberPhysicalFunction.cpp) add_plugin(TdistanceTfloatFloat PhysicalFunction nes-physical-operators TdistanceTfloatFloatPhysicalFunction.cpp) add_plugin(TdistanceTnumberTnumber PhysicalFunction nes-physical-operators TdistanceTnumberTnumberPhysicalFunction.cpp) add_plugin(TemporalRound PhysicalFunction nes-physical-operators TemporalRoundPhysicalFunction.cpp) +add_plugin(DivTintInt PhysicalFunction nes-physical-operators DivTintIntPhysicalFunction.cpp) add_plugin(DivTnumberTnumber PhysicalFunction nes-physical-operators DivTnumberTnumberPhysicalFunction.cpp) +add_plugin(MulTintInt PhysicalFunction nes-physical-operators MulTintIntPhysicalFunction.cpp) add_plugin(MulTnumberTnumber PhysicalFunction nes-physical-operators MulTnumberTnumberPhysicalFunction.cpp) +add_plugin(SubTintInt PhysicalFunction nes-physical-operators SubTintIntPhysicalFunction.cpp) add_plugin(SubTnumberTnumber PhysicalFunction nes-physical-operators SubTnumberTnumberPhysicalFunction.cpp) add_plugin(DivTfloatFloat PhysicalFunction nes-physical-operators DivTfloatFloatPhysicalFunction.cpp) add_plugin(MulTfloatFloat PhysicalFunction nes-physical-operators MulTfloatFloatPhysicalFunction.cpp) diff --git a/nes-physical-operators/src/Functions/Meos/DivTintIntPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/DivTintIntPhysicalFunction.cpp new file mode 100644 index 0000000000..540c8b52e3 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/DivTintIntPhysicalFunction.cpp @@ -0,0 +1,91 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +DivTintIntPhysicalFunction::DivTintIntPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction, + PhysicalFunction divisorFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(divisorFunction)); +} + +VarVal DivTintIntPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto ts = parameterValues[1].cast>(); + auto divisor = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double value, uint64_t ts, double divisor_d) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string tempWkt = fmt::format("{}@{}", static_cast(value), MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tint_in(tempWkt.c_str()); + if (!temp) return 0.0; + Temporal* res = div_tint_int(temp, static_cast(divisor_d)); + free(temp); + if (!res) return 0.0; + double r = static_cast(tint_start_value(res)); + free(res); + return r; + } catch (const std::exception&) { return 0.0; } + }, + value, ts, divisor); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterDivTintIntPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "DivTintIntPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return DivTintIntPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/MulTintIntPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/MulTintIntPhysicalFunction.cpp new file mode 100644 index 0000000000..18b90450ae --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/MulTintIntPhysicalFunction.cpp @@ -0,0 +1,91 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +MulTintIntPhysicalFunction::MulTintIntPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction, + PhysicalFunction multiplierFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(multiplierFunction)); +} + +VarVal MulTintIntPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto ts = parameterValues[1].cast>(); + auto multiplier = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double value, uint64_t ts, double multiplier_d) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string tempWkt = fmt::format("{}@{}", static_cast(value), MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tint_in(tempWkt.c_str()); + if (!temp) return 0.0; + Temporal* res = mul_tint_int(temp, static_cast(multiplier_d)); + free(temp); + if (!res) return 0.0; + double r = static_cast(tint_start_value(res)); + free(res); + return r; + } catch (const std::exception&) { return 0.0; } + }, + value, ts, multiplier); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterMulTintIntPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "MulTintIntPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return MulTintIntPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/SubTintIntPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/SubTintIntPhysicalFunction.cpp new file mode 100644 index 0000000000..c086705591 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/SubTintIntPhysicalFunction.cpp @@ -0,0 +1,91 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +SubTintIntPhysicalFunction::SubTintIntPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction, + PhysicalFunction subtrahendFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(subtrahendFunction)); +} + +VarVal SubTintIntPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto ts = parameterValues[1].cast>(); + auto subtrahend = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double value, uint64_t ts, double subtrahend_d) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string tempWkt = fmt::format("{}@{}", static_cast(value), MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tint_in(tempWkt.c_str()); + if (!temp) return 0.0; + Temporal* res = sub_tint_int(temp, static_cast(subtrahend_d)); + free(temp); + if (!res) return 0.0; + double r = static_cast(tint_start_value(res)); + free(res); + return r; + } catch (const std::exception&) { return 0.0; } + }, + value, ts, subtrahend); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterSubTintIntPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "SubTintIntPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return SubTintIntPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-sql-parser/AntlrSQL.g4 b/nes-sql-parser/AntlrSQL.g4 index f4fd7a6858..f41484aa70 100644 --- a/nes-sql-parser/AntlrSQL.g4 +++ b/nes-sql-parser/AntlrSQL.g4 @@ -295,7 +295,7 @@ timeUnit: MS timestampParameter: name=identifier; -functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | EDWITHIN_TGEO_GEO | TGEO_AT_STBOX | ADD_TFLOAT_FLOAT | ADD_TNUMBER_TNUMBER | DIV_TFLOAT_FLOAT | DIV_TNUMBER_TNUMBER | MUL_TFLOAT_FLOAT | MUL_TNUMBER_TNUMBER | SUB_TFLOAT_FLOAT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_FLOOR | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TNUMBER_ABS; +functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | EDWITHIN_TGEO_GEO | TGEO_AT_STBOX | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_FLOOR | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TNUMBER_ABS; sinkClause: INTO sink (',' sink)*; @@ -489,12 +489,16 @@ TEMPORAL_ECONTAINS_GEOMETRY: 'TEMPORAL_ECONTAINS_GEOMETRY' | 'temporal_econtains EDWITHIN_TGEO_GEO: 'EDWITHIN_TGEO_GEO' | 'edwithin_tgeo_geo'; TGEO_AT_STBOX: 'TGEO_AT_STBOX' | 'tgeo_at_stbox'; ADD_TFLOAT_FLOAT: 'ADD_TFLOAT_FLOAT' | 'add_tfloat_float'; +ADD_TINT_INT: 'ADD_TINT_INT' | 'add_tint_int'; ADD_TNUMBER_TNUMBER: 'ADD_TNUMBER_TNUMBER' | 'add_tnumber_tnumber'; DIV_TFLOAT_FLOAT: 'DIV_TFLOAT_FLOAT' | 'div_tfloat_float'; +DIV_TINT_INT: 'DIV_TINT_INT' | 'div_tint_int'; DIV_TNUMBER_TNUMBER: 'DIV_TNUMBER_TNUMBER' | 'div_tnumber_tnumber'; MUL_TFLOAT_FLOAT: 'MUL_TFLOAT_FLOAT' | 'mul_tfloat_float'; +MUL_TINT_INT: 'MUL_TINT_INT' | 'mul_tint_int'; MUL_TNUMBER_TNUMBER: 'MUL_TNUMBER_TNUMBER' | 'mul_tnumber_tnumber'; SUB_TFLOAT_FLOAT: 'SUB_TFLOAT_FLOAT' | 'sub_tfloat_float'; +SUB_TINT_INT: 'SUB_TINT_INT' | 'sub_tint_int'; SUB_TNUMBER_TNUMBER: 'SUB_TNUMBER_TNUMBER' | 'sub_tnumber_tnumber'; TDISTANCE_TFLOAT_FLOAT: 'TDISTANCE_TFLOAT_FLOAT' | 'tdistance_tfloat_float'; TDISTANCE_TNUMBER_TNUMBER: 'TDISTANCE_TNUMBER_TNUMBER' | 'tdistance_tnumber_tnumber'; diff --git a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp index de68032c01..0ed1f77265 100644 --- a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp +++ b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp @@ -70,12 +70,16 @@ #include #include #include +#include #include #include +#include #include #include +#include #include #include +#include #include #include #include @@ -1637,6 +1641,123 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont } break; /* END CODEGEN PARSER GLUE: SUB_TFLOAT_FLOAT */ + + case AntlrSQLLexer::ADD_TINT_INT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("ADD_TINT_INT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AddTintIntLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: ADD_TINT_INT */ + + case AntlrSQLLexer::DIV_TINT_INT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("DIV_TINT_INT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(DivTintIntLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: DIV_TINT_INT */ + + case AntlrSQLLexer::MUL_TINT_INT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("MUL_TINT_INT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(MulTintIntLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: MUL_TINT_INT */ + + case AntlrSQLLexer::SUB_TINT_INT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("SUB_TINT_INT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(SubTintIntLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: SUB_TINT_INT */ + /* BEGIN CODEGEN PARSER GLUE: ADD_TNUMBER_TNUMBER */ case AntlrSQLLexer::ADD_TNUMBER_TNUMBER: { From e64267ac6c6d0ee90bd167a1426e69f387a0784b Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Fri, 12 Jun 2026 06:07:19 +0200 Subject: [PATCH 10/96] feat(meos): add TDISTANCE_TINT_INT, TINT_SHIFT_VALUE, TINT_SCALE_VALUE, TINT_SHIFT_SCALE_VALUE NES operators (W52) --- .../Meos/TdistanceTintIntLogicalFunction.hpp | 54 ++++++++ .../Meos/TintScaleValueLogicalFunction.hpp | 54 ++++++++ .../TintShiftScaleValueLogicalFunction.hpp | 55 ++++++++ .../Meos/TintShiftValueLogicalFunction.hpp | 54 ++++++++ .../src/Functions/Meos/CMakeLists.txt | 4 + .../Meos/TdistanceTintIntLogicalFunction.cpp | 105 +++++++++++++++ .../Meos/TintScaleValueLogicalFunction.cpp | 105 +++++++++++++++ .../TintShiftScaleValueLogicalFunction.cpp | 108 ++++++++++++++++ .../Meos/TintShiftValueLogicalFunction.cpp | 105 +++++++++++++++ .../Meos/TdistanceTintIntPhysicalFunction.hpp | 44 +++++++ .../Meos/TintScaleValuePhysicalFunction.hpp | 44 +++++++ .../TintShiftScaleValuePhysicalFunction.hpp | 45 +++++++ .../Meos/TintShiftValuePhysicalFunction.hpp | 44 +++++++ .../src/Functions/Meos/CMakeLists.txt | 4 + .../Meos/TdistanceTintIntPhysicalFunction.cpp | 91 +++++++++++++ .../Meos/TintScaleValuePhysicalFunction.cpp | 91 +++++++++++++ .../TintShiftScaleValuePhysicalFunction.cpp | 95 ++++++++++++++ .../Meos/TintShiftValuePhysicalFunction.cpp | 91 +++++++++++++ nes-sql-parser/AntlrSQL.g4 | 6 +- .../src/AntlrSQLQueryPlanCreator.cpp | 121 ++++++++++++++++++ 20 files changed, 1319 insertions(+), 1 deletion(-) create mode 100644 nes-logical-operators/include/Functions/Meos/TdistanceTintIntLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TintScaleValueLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TintShiftScaleValueLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TintShiftValueLogicalFunction.hpp create mode 100644 nes-logical-operators/src/Functions/Meos/TdistanceTintIntLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TintScaleValueLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TintShiftScaleValueLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TintShiftValueLogicalFunction.cpp create mode 100644 nes-physical-operators/include/Functions/Meos/TdistanceTintIntPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TintScaleValuePhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TintShiftScaleValuePhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TintShiftValuePhysicalFunction.hpp create mode 100644 nes-physical-operators/src/Functions/Meos/TdistanceTintIntPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TintScaleValuePhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TintShiftScaleValuePhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TintShiftValuePhysicalFunction.cpp diff --git a/nes-logical-operators/include/Functions/Meos/TdistanceTintIntLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TdistanceTintIntLogicalFunction.hpp new file mode 100644 index 0000000000..a8baa981f0 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TdistanceTintIntLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event tdistance_tint_int: distance between a single-instant tint and an integer. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `tdistance_tint_int`. Takes (value:FLOAT64, ts:UINT64, d:FLOAT64→int), + * constructs a single-instant temporal, applies the distance function, and returns FLOAT64. + */ +class TdistanceTintIntLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TdistanceTintInt"; + + TdistanceTintIntLogicalFunction(LogicalFunction value, + LogicalFunction ts, + LogicalFunction d); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TintScaleValueLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TintScaleValueLogicalFunction.hpp new file mode 100644 index 0000000000..eaf261f031 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TintScaleValueLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event tint_scale_value: scales a single-instant tint to a given width. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `tint_scale_value`. Takes (value:FLOAT64, ts:UINT64, width:FLOAT64→int), + * constructs a single-instant temporal, applies the scale, and returns FLOAT64. + */ +class TintScaleValueLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TintScaleValue"; + + TintScaleValueLogicalFunction(LogicalFunction value, + LogicalFunction ts, + LogicalFunction width); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TintShiftScaleValueLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TintShiftScaleValueLogicalFunction.hpp new file mode 100644 index 0000000000..4b3ec6c91e --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TintShiftScaleValueLogicalFunction.hpp @@ -0,0 +1,55 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event tint_shift_scale_value: shifts and scales a single-instant tint. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `tint_shift_scale_value`. Takes (value:FLOAT64, ts:UINT64, shift:FLOAT64→int, width:FLOAT64→int), + * constructs a single-instant temporal, applies the shift-and-scale, and returns FLOAT64. + */ +class TintShiftScaleValueLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TintShiftScaleValue"; + + TintShiftScaleValueLogicalFunction(LogicalFunction value, + LogicalFunction ts, + LogicalFunction shift, + LogicalFunction width); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TintShiftValueLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TintShiftValueLogicalFunction.hpp new file mode 100644 index 0000000000..ebf94d3dd8 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TintShiftValueLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event tint_shift_value: shifts a single-instant tint by a constant integer. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `tint_shift_value`. Takes (value:FLOAT64, ts:UINT64, shift:FLOAT64→int), + * constructs a single-instant temporal, applies the shift, and returns FLOAT64. + */ +class TintShiftValueLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TintShiftValue"; + + TintShiftValueLogicalFunction(LogicalFunction value, + LogicalFunction ts, + LogicalFunction shift); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt index 5734d5a728..49cd3f9231 100644 --- a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt @@ -28,8 +28,12 @@ add_plugin(AddTfloatFloat LogicalFunction nes-logical-operators AddTfloatFloatLo add_plugin(AddTintInt LogicalFunction nes-logical-operators AddTintIntLogicalFunction.cpp) add_plugin(AddTnumberTnumber LogicalFunction nes-logical-operators AddTnumberTnumberLogicalFunction.cpp) add_plugin(TdistanceTfloatFloat LogicalFunction nes-logical-operators TdistanceTfloatFloatLogicalFunction.cpp) +add_plugin(TdistanceTintInt LogicalFunction nes-logical-operators TdistanceTintIntLogicalFunction.cpp) add_plugin(TdistanceTnumberTnumber LogicalFunction nes-logical-operators TdistanceTnumberTnumberLogicalFunction.cpp) add_plugin(TemporalRound LogicalFunction nes-logical-operators TemporalRoundLogicalFunction.cpp) +add_plugin(TintScaleValue LogicalFunction nes-logical-operators TintScaleValueLogicalFunction.cpp) +add_plugin(TintShiftScaleValue LogicalFunction nes-logical-operators TintShiftScaleValueLogicalFunction.cpp) +add_plugin(TintShiftValue LogicalFunction nes-logical-operators TintShiftValueLogicalFunction.cpp) add_plugin(DivTintInt LogicalFunction nes-logical-operators DivTintIntLogicalFunction.cpp) add_plugin(DivTnumberTnumber LogicalFunction nes-logical-operators DivTnumberTnumberLogicalFunction.cpp) add_plugin(MulTintInt LogicalFunction nes-logical-operators MulTintIntLogicalFunction.cpp) diff --git a/nes-logical-operators/src/Functions/Meos/TdistanceTintIntLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TdistanceTintIntLogicalFunction.cpp new file mode 100644 index 0000000000..01517365af --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TdistanceTintIntLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TdistanceTintIntLogicalFunction::TdistanceTintIntLogicalFunction(LogicalFunction value, + LogicalFunction ts, + LogicalFunction d) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(d)); +} + +DataType TdistanceTintIntLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction TdistanceTintIntLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector TdistanceTintIntLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction TdistanceTintIntLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "TdistanceTintIntLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view TdistanceTintIntLogicalFunction::getType() const { return NAME; } + +bool TdistanceTintIntLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string TdistanceTintIntLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TdistanceTintIntLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction TdistanceTintIntLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTdistanceTintIntLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "TdistanceTintIntLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return TdistanceTintIntLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TintScaleValueLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TintScaleValueLogicalFunction.cpp new file mode 100644 index 0000000000..d51aadcdef --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TintScaleValueLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TintScaleValueLogicalFunction::TintScaleValueLogicalFunction(LogicalFunction value, + LogicalFunction ts, + LogicalFunction width) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(width)); +} + +DataType TintScaleValueLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction TintScaleValueLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector TintScaleValueLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction TintScaleValueLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "TintScaleValueLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view TintScaleValueLogicalFunction::getType() const { return NAME; } + +bool TintScaleValueLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string TintScaleValueLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TintScaleValueLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction TintScaleValueLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTintScaleValueLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "TintScaleValueLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return TintScaleValueLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TintShiftScaleValueLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TintShiftScaleValueLogicalFunction.cpp new file mode 100644 index 0000000000..b4096559fb --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TintShiftScaleValueLogicalFunction.cpp @@ -0,0 +1,108 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TintShiftScaleValueLogicalFunction::TintShiftScaleValueLogicalFunction(LogicalFunction value, + LogicalFunction ts, + LogicalFunction shift, + LogicalFunction width) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(4); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(shift)); + parameters.push_back(std::move(width)); +} + +DataType TintShiftScaleValueLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction TintShiftScaleValueLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector TintShiftScaleValueLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction TintShiftScaleValueLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 4, "TintShiftScaleValueLogicalFunction requires 4 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view TintShiftScaleValueLogicalFunction::getType() const { return NAME; } + +bool TintShiftScaleValueLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string TintShiftScaleValueLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TintShiftScaleValueLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction TintShiftScaleValueLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTintShiftScaleValueLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 4, + "TintShiftScaleValueLogicalFunction requires 4 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + return TintShiftScaleValueLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TintShiftValueLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TintShiftValueLogicalFunction.cpp new file mode 100644 index 0000000000..c540e6ea81 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TintShiftValueLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TintShiftValueLogicalFunction::TintShiftValueLogicalFunction(LogicalFunction value, + LogicalFunction ts, + LogicalFunction shift) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(shift)); +} + +DataType TintShiftValueLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction TintShiftValueLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector TintShiftValueLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction TintShiftValueLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "TintShiftValueLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view TintShiftValueLogicalFunction::getType() const { return NAME; } + +bool TintShiftValueLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string TintShiftValueLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TintShiftValueLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction TintShiftValueLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTintShiftValueLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "TintShiftValueLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return TintShiftValueLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TdistanceTintIntPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TdistanceTintIntPhysicalFunction.hpp new file mode 100644 index 0000000000..02d4ffe164 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TdistanceTintIntPhysicalFunction.hpp @@ -0,0 +1,44 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `tdistance_tint_int`. + * + * Per-event tdistance_tint_int: computes the temporal distance between a + * single-instant tint value and a constant integer. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TdistanceTintIntPhysicalFunction : public PhysicalFunctionConcept { +public: + TdistanceTintIntPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction, + PhysicalFunction dFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TintScaleValuePhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TintScaleValuePhysicalFunction.hpp new file mode 100644 index 0000000000..e55e1d9ad3 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TintScaleValuePhysicalFunction.hpp @@ -0,0 +1,44 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `tint_scale_value`. + * + * Per-event tint_scale_value: scales the value span of a single-instant tint + * to the given integer width. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TintScaleValuePhysicalFunction : public PhysicalFunctionConcept { +public: + TintScaleValuePhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction, + PhysicalFunction widthFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TintShiftScaleValuePhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TintShiftScaleValuePhysicalFunction.hpp new file mode 100644 index 0000000000..d6c7628c8c --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TintShiftScaleValuePhysicalFunction.hpp @@ -0,0 +1,45 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `tint_shift_scale_value`. + * + * Per-event tint_shift_scale_value: shifts the value span of a single-instant + * tint by a constant integer and scales it to the given integer width. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TintShiftScaleValuePhysicalFunction : public PhysicalFunctionConcept { +public: + TintShiftScaleValuePhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction, + PhysicalFunction shiftFunction, + PhysicalFunction widthFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TintShiftValuePhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TintShiftValuePhysicalFunction.hpp new file mode 100644 index 0000000000..f12e6e7240 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TintShiftValuePhysicalFunction.hpp @@ -0,0 +1,44 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `tint_shift_value`. + * + * Per-event tint_shift_value: shifts the value span of a single-instant tint + * by a constant integer. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TintShiftValuePhysicalFunction : public PhysicalFunctionConcept { +public: + TintShiftValuePhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction, + PhysicalFunction shiftFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt index 1b7168a2c2..5138cf9b1d 100644 --- a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt @@ -27,8 +27,12 @@ add_plugin(AddTfloatFloat PhysicalFunction nes-physical-operators AddTfloatFloat add_plugin(AddTintInt PhysicalFunction nes-physical-operators AddTintIntPhysicalFunction.cpp) add_plugin(AddTnumberTnumber PhysicalFunction nes-physical-operators AddTnumberTnumberPhysicalFunction.cpp) add_plugin(TdistanceTfloatFloat PhysicalFunction nes-physical-operators TdistanceTfloatFloatPhysicalFunction.cpp) +add_plugin(TdistanceTintInt PhysicalFunction nes-physical-operators TdistanceTintIntPhysicalFunction.cpp) add_plugin(TdistanceTnumberTnumber PhysicalFunction nes-physical-operators TdistanceTnumberTnumberPhysicalFunction.cpp) add_plugin(TemporalRound PhysicalFunction nes-physical-operators TemporalRoundPhysicalFunction.cpp) +add_plugin(TintScaleValue PhysicalFunction nes-physical-operators TintScaleValuePhysicalFunction.cpp) +add_plugin(TintShiftScaleValue PhysicalFunction nes-physical-operators TintShiftScaleValuePhysicalFunction.cpp) +add_plugin(TintShiftValue PhysicalFunction nes-physical-operators TintShiftValuePhysicalFunction.cpp) add_plugin(DivTintInt PhysicalFunction nes-physical-operators DivTintIntPhysicalFunction.cpp) add_plugin(DivTnumberTnumber PhysicalFunction nes-physical-operators DivTnumberTnumberPhysicalFunction.cpp) add_plugin(MulTintInt PhysicalFunction nes-physical-operators MulTintIntPhysicalFunction.cpp) diff --git a/nes-physical-operators/src/Functions/Meos/TdistanceTintIntPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TdistanceTintIntPhysicalFunction.cpp new file mode 100644 index 0000000000..fc43b94327 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TdistanceTintIntPhysicalFunction.cpp @@ -0,0 +1,91 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +TdistanceTintIntPhysicalFunction::TdistanceTintIntPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction, + PhysicalFunction dFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(dFunction)); +} + +VarVal TdistanceTintIntPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto ts = parameterValues[1].cast>(); + auto d = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double value, uint64_t ts, double d_val) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string tempWkt = fmt::format("{}@{}", static_cast(value), MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tint_in(tempWkt.c_str()); + if (!temp) return 0.0; + Temporal* res = tdistance_tint_int(temp, static_cast(d_val)); + free(temp); + if (!res) return 0.0; + double r = static_cast(tint_start_value(res)); + free(res); + return r; + } catch (const std::exception&) { return 0.0; } + }, + value, ts, d); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTdistanceTintIntPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "TdistanceTintIntPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return TdistanceTintIntPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TintScaleValuePhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TintScaleValuePhysicalFunction.cpp new file mode 100644 index 0000000000..aebbb9ed6b --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TintScaleValuePhysicalFunction.cpp @@ -0,0 +1,91 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +TintScaleValuePhysicalFunction::TintScaleValuePhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction, + PhysicalFunction widthFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(widthFunction)); +} + +VarVal TintScaleValuePhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto ts = parameterValues[1].cast>(); + auto width = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double value, uint64_t ts, double width_d) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string tempWkt = fmt::format("{}@{}", static_cast(value), MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tint_in(tempWkt.c_str()); + if (!temp) return 0.0; + Temporal* res = tint_scale_value(temp, static_cast(width_d)); + free(temp); + if (!res) return 0.0; + double r = static_cast(tint_start_value(res)); + free(res); + return r; + } catch (const std::exception&) { return 0.0; } + }, + value, ts, width); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTintScaleValuePhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "TintScaleValuePhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return TintScaleValuePhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TintShiftScaleValuePhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TintShiftScaleValuePhysicalFunction.cpp new file mode 100644 index 0000000000..ff1780d328 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TintShiftScaleValuePhysicalFunction.cpp @@ -0,0 +1,95 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +TintShiftScaleValuePhysicalFunction::TintShiftScaleValuePhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction, + PhysicalFunction shiftFunction, + PhysicalFunction widthFunction) +{ + parameterFunctions.reserve(4); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(shiftFunction)); + parameterFunctions.push_back(std::move(widthFunction)); +} + +VarVal TintShiftScaleValuePhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto ts = parameterValues[1].cast>(); + auto shift = parameterValues[2].cast>(); + auto width = parameterValues[3].cast>(); + + const auto result = nautilus::invoke( + +[](double value, uint64_t ts, double shift_d, double width_d) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string tempWkt = fmt::format("{}@{}", static_cast(value), MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tint_in(tempWkt.c_str()); + if (!temp) return 0.0; + Temporal* res = tint_shift_scale_value(temp, static_cast(shift_d), static_cast(width_d)); + free(temp); + if (!res) return 0.0; + double r = static_cast(tint_start_value(res)); + free(res); + return r; + } catch (const std::exception&) { return 0.0; } + }, + value, ts, shift, width); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTintShiftScaleValuePhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 4, + "TintShiftScaleValuePhysicalFunction requires 4 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + return TintShiftScaleValuePhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TintShiftValuePhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TintShiftValuePhysicalFunction.cpp new file mode 100644 index 0000000000..608e63b0f7 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TintShiftValuePhysicalFunction.cpp @@ -0,0 +1,91 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +TintShiftValuePhysicalFunction::TintShiftValuePhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction, + PhysicalFunction shiftFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(shiftFunction)); +} + +VarVal TintShiftValuePhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto ts = parameterValues[1].cast>(); + auto shift = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double value, uint64_t ts, double shift_d) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string tempWkt = fmt::format("{}@{}", static_cast(value), MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tint_in(tempWkt.c_str()); + if (!temp) return 0.0; + Temporal* res = tint_shift_value(temp, static_cast(shift_d)); + free(temp); + if (!res) return 0.0; + double r = static_cast(tint_start_value(res)); + free(res); + return r; + } catch (const std::exception&) { return 0.0; } + }, + value, ts, shift); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTintShiftValuePhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "TintShiftValuePhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return TintShiftValuePhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-sql-parser/AntlrSQL.g4 b/nes-sql-parser/AntlrSQL.g4 index f41484aa70..4afbde6abd 100644 --- a/nes-sql-parser/AntlrSQL.g4 +++ b/nes-sql-parser/AntlrSQL.g4 @@ -295,7 +295,7 @@ timeUnit: MS timestampParameter: name=identifier; -functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | EDWITHIN_TGEO_GEO | TGEO_AT_STBOX | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_FLOOR | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TNUMBER_ABS; +functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | EDWITHIN_TGEO_GEO | TGEO_AT_STBOX | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_FLOOR | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TNUMBER_ABS; sinkClause: INTO sink (',' sink)*; @@ -501,6 +501,7 @@ SUB_TFLOAT_FLOAT: 'SUB_TFLOAT_FLOAT' | 'sub_tfloat_float'; SUB_TINT_INT: 'SUB_TINT_INT' | 'sub_tint_int'; SUB_TNUMBER_TNUMBER: 'SUB_TNUMBER_TNUMBER' | 'sub_tnumber_tnumber'; TDISTANCE_TFLOAT_FLOAT: 'TDISTANCE_TFLOAT_FLOAT' | 'tdistance_tfloat_float'; +TDISTANCE_TINT_INT: 'TDISTANCE_TINT_INT' | 'tdistance_tint_int'; TDISTANCE_TNUMBER_TNUMBER: 'TDISTANCE_TNUMBER_TNUMBER' | 'tdistance_tnumber_tnumber'; TEMPORAL_ROUND: 'TEMPORAL_ROUND' | 'temporal_round'; TFLOAT_CEIL: 'TFLOAT_CEIL' | 'tfloat_ceil'; @@ -513,6 +514,9 @@ TFLOAT_SHIFT_SCALE_VALUE: 'TFLOAT_SHIFT_SCALE_VALUE' | 'tfloat_shift_scale_value TFLOAT_SHIFT_VALUE: 'TFLOAT_SHIFT_VALUE' | 'tfloat_shift_value'; TFLOAT_SIN: 'TFLOAT_SIN' | 'tfloat_sin'; TFLOAT_TAN: 'TFLOAT_TAN' | 'tfloat_tan'; +TINT_SCALE_VALUE: 'TINT_SCALE_VALUE' | 'tint_scale_value'; +TINT_SHIFT_SCALE_VALUE: 'TINT_SHIFT_SCALE_VALUE' | 'tint_shift_scale_value'; +TINT_SHIFT_VALUE: 'TINT_SHIFT_VALUE' | 'tint_shift_value'; TNUMBER_ABS: 'TNUMBER_ABS' | 'tnumber_abs'; WATERMARK: 'WATERMARK' | 'watermark'; OFFSET: 'OFFSET' | 'offset'; diff --git a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp index 0ed1f77265..cc8764f9be 100644 --- a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp +++ b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp @@ -82,6 +82,7 @@ #include #include #include +#include #include #include #include @@ -94,6 +95,9 @@ #include #include #include +#include +#include +#include #include #include #include @@ -1903,6 +1907,35 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont } break; /* END CODEGEN PARSER GLUE: TDISTANCE_TFLOAT_FLOAT */ + /* BEGIN CODEGEN PARSER GLUE: TDISTANCE_TINT_INT */ + case AntlrSQLLexer::TDISTANCE_TINT_INT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("TDISTANCE_TINT_INT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(TdistanceTintIntLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: TDISTANCE_TINT_INT */ case AntlrSQLLexer::TDISTANCE_TNUMBER_TNUMBER: { @@ -1961,6 +1994,94 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont } break; /* END CODEGEN PARSER GLUE: TEMPORAL_ROUND */ + /* BEGIN CODEGEN PARSER GLUE: TINT_SCALE_VALUE */ + case AntlrSQLLexer::TINT_SCALE_VALUE: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("TINT_SCALE_VALUE requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(TintScaleValueLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: TINT_SCALE_VALUE */ + /* BEGIN CODEGEN PARSER GLUE: TINT_SHIFT_SCALE_VALUE */ + case AntlrSQLLexer::TINT_SHIFT_SCALE_VALUE: + { + const auto argCount = context->expression().size(); + if (argCount != 4) + throw InvalidQuerySyntax("TINT_SHIFT_SCALE_VALUE requires exactly 4 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a3 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(TintShiftScaleValueLogicalFunction(a0, a1, a2, a3)); + } + break; + /* END CODEGEN PARSER GLUE: TINT_SHIFT_SCALE_VALUE */ + /* BEGIN CODEGEN PARSER GLUE: TINT_SHIFT_VALUE */ + case AntlrSQLLexer::TINT_SHIFT_VALUE: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("TINT_SHIFT_VALUE requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(TintShiftValueLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: TINT_SHIFT_VALUE */ default: /// Check if the function is a constructor for a datatype From 9be67595e06abffd285bc027f2af0ebb7deeaf41 Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Fri, 12 Jun 2026 06:12:05 +0200 Subject: [PATCH 11/96] feat(meos): add TFLOAT_TO_TINT and TINT_TO_TFLOAT type-conversion NES operators (W53) --- .../Meos/TfloatToTintLogicalFunction.hpp | 53 +++++++++ .../Meos/TintToTfloatLogicalFunction.hpp | 53 +++++++++ .../src/Functions/Meos/CMakeLists.txt | 2 + .../Meos/TfloatToTintLogicalFunction.cpp | 102 ++++++++++++++++++ .../Meos/TintToTfloatLogicalFunction.cpp | 102 ++++++++++++++++++ .../Meos/TfloatToTintPhysicalFunction.hpp | 42 ++++++++ .../Meos/TintToTfloatPhysicalFunction.hpp | 42 ++++++++ .../src/Functions/Meos/CMakeLists.txt | 2 + .../Meos/TfloatToTintPhysicalFunction.cpp | 87 +++++++++++++++ .../Meos/TintToTfloatPhysicalFunction.cpp | 88 +++++++++++++++ nes-sql-parser/AntlrSQL.g4 | 4 +- .../src/AntlrSQLQueryPlanCreator.cpp | 58 ++++++++++ 12 files changed, 634 insertions(+), 1 deletion(-) create mode 100644 nes-logical-operators/include/Functions/Meos/TfloatToTintLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TintToTfloatLogicalFunction.hpp create mode 100644 nes-logical-operators/src/Functions/Meos/TfloatToTintLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TintToTfloatLogicalFunction.cpp create mode 100644 nes-physical-operators/include/Functions/Meos/TfloatToTintPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TintToTfloatPhysicalFunction.hpp create mode 100644 nes-physical-operators/src/Functions/Meos/TfloatToTintPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TintToTfloatPhysicalFunction.cpp diff --git a/nes-logical-operators/include/Functions/Meos/TfloatToTintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TfloatToTintLogicalFunction.hpp new file mode 100644 index 0000000000..0d47f35168 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TfloatToTintLogicalFunction.hpp @@ -0,0 +1,53 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event tfloat_to_tint: converts a single-instant tfloat to tint, returns FLOAT64. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `tfloat_to_tint`. Takes (value:FLOAT64, ts:UINT64), constructs a single-instant + * temporal float, truncates to integer, and returns FLOAT64. + */ +class TfloatToTintLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TfloatToTint"; + + TfloatToTintLogicalFunction(LogicalFunction value, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TintToTfloatLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TintToTfloatLogicalFunction.hpp new file mode 100644 index 0000000000..6de528f985 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TintToTfloatLogicalFunction.hpp @@ -0,0 +1,53 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event tint_to_tfloat: converts a single-instant tint to tfloat, returns FLOAT64. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `tint_to_tfloat`. Takes (value:FLOAT64, ts:UINT64), constructs a single-instant + * temporal integer, promotes to float, and returns FLOAT64. + */ +class TintToTfloatLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TintToTfloat"; + + TintToTfloatLogicalFunction(LogicalFunction value, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt index 49cd3f9231..4657c2f4fb 100644 --- a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt @@ -47,4 +47,6 @@ add_plugin(TfloatShiftScaleValue LogicalFunction nes-logical-operators TfloatShi add_plugin(TfloatShiftValue LogicalFunction nes-logical-operators TfloatShiftValueLogicalFunction.cpp) add_plugin(TfloatSin LogicalFunction nes-logical-operators TfloatSinLogicalFunction.cpp) add_plugin(TfloatTan LogicalFunction nes-logical-operators TfloatTanLogicalFunction.cpp) +add_plugin(TfloatToTint LogicalFunction nes-logical-operators TfloatToTintLogicalFunction.cpp) +add_plugin(TintToTfloat LogicalFunction nes-logical-operators TintToTfloatLogicalFunction.cpp) add_plugin(TnumberAbs LogicalFunction nes-logical-operators TnumberAbsLogicalFunction.cpp) diff --git a/nes-logical-operators/src/Functions/Meos/TfloatToTintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TfloatToTintLogicalFunction.cpp new file mode 100644 index 0000000000..63bf97d316 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TfloatToTintLogicalFunction.cpp @@ -0,0 +1,102 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TfloatToTintLogicalFunction::TfloatToTintLogicalFunction(LogicalFunction value, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(2); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(ts)); +} + +DataType TfloatToTintLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction TfloatToTintLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector TfloatToTintLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction TfloatToTintLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 2, "TfloatToTintLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view TfloatToTintLogicalFunction::getType() const { return NAME; } + +bool TfloatToTintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string TfloatToTintLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TfloatToTintLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction TfloatToTintLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTfloatToTintLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 2, + "TfloatToTintLogicalFunction requires 2 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + return TfloatToTintLogicalFunction(std::move(arg0), std::move(arg1)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TintToTfloatLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TintToTfloatLogicalFunction.cpp new file mode 100644 index 0000000000..08c9e80ad4 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TintToTfloatLogicalFunction.cpp @@ -0,0 +1,102 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TintToTfloatLogicalFunction::TintToTfloatLogicalFunction(LogicalFunction value, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(2); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(ts)); +} + +DataType TintToTfloatLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction TintToTfloatLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector TintToTfloatLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction TintToTfloatLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 2, "TintToTfloatLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view TintToTfloatLogicalFunction::getType() const { return NAME; } + +bool TintToTfloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string TintToTfloatLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TintToTfloatLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction TintToTfloatLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTintToTfloatLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 2, + "TintToTfloatLogicalFunction requires 2 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + return TintToTfloatLogicalFunction(std::move(arg0), std::move(arg1)); +} + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TfloatToTintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TfloatToTintPhysicalFunction.hpp new file mode 100644 index 0000000000..48c2bd2f92 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TfloatToTintPhysicalFunction.hpp @@ -0,0 +1,42 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `tfloat_to_tint`. + * + * Per-event tfloat_to_tint: single-instant tfloat converted to tint, result extracted -> double. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TfloatToTintPhysicalFunction : public PhysicalFunctionConcept { +public: + TfloatToTintPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TintToTfloatPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TintToTfloatPhysicalFunction.hpp new file mode 100644 index 0000000000..c338179d9b --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TintToTfloatPhysicalFunction.hpp @@ -0,0 +1,42 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `tint_to_tfloat`. + * + * Per-event tint_to_tfloat: single-instant tint promoted to tfloat, result extracted -> double. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TintToTfloatPhysicalFunction : public PhysicalFunctionConcept { +public: + TintToTfloatPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt index 5138cf9b1d..68c2b6a81c 100644 --- a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt @@ -46,5 +46,7 @@ add_plugin(TfloatShiftScaleValue PhysicalFunction nes-physical-operators TfloatS add_plugin(TfloatShiftValue PhysicalFunction nes-physical-operators TfloatShiftValuePhysicalFunction.cpp) add_plugin(TfloatSin PhysicalFunction nes-physical-operators TfloatSinPhysicalFunction.cpp) add_plugin(TfloatTan PhysicalFunction nes-physical-operators TfloatTanPhysicalFunction.cpp) +add_plugin(TfloatToTint PhysicalFunction nes-physical-operators TfloatToTintPhysicalFunction.cpp) +add_plugin(TintToTfloat PhysicalFunction nes-physical-operators TintToTfloatPhysicalFunction.cpp) add_plugin(TnumberAbs PhysicalFunction nes-physical-operators TnumberAbsPhysicalFunction.cpp) endif() diff --git a/nes-physical-operators/src/Functions/Meos/TfloatToTintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TfloatToTintPhysicalFunction.cpp new file mode 100644 index 0000000000..1c2f2cca6d --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TfloatToTintPhysicalFunction.cpp @@ -0,0 +1,87 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +TfloatToTintPhysicalFunction::TfloatToTintPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(2); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal TfloatToTintPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto ts = parameterValues[1].cast>(); + + const auto result = nautilus::invoke( + +[](double value, uint64_t ts) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string tempWkt = fmt::format("{}@{}", value, MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tfloat_in(tempWkt.c_str()); + if (!temp) return 0.0; + Temporal* res = tfloat_to_tint(temp); + free(temp); + if (!res) return 0.0; + double r = static_cast(tint_start_value(res)); + free(res); + return r; + } catch (const std::exception&) { return 0.0; } + }, + value, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTfloatToTintPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 2, + "TfloatToTintPhysicalFunction requires 2 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + return TfloatToTintPhysicalFunction(std::move(arg0), std::move(arg1)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TintToTfloatPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TintToTfloatPhysicalFunction.cpp new file mode 100644 index 0000000000..23eb9eb5dc --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TintToTfloatPhysicalFunction.cpp @@ -0,0 +1,88 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +TintToTfloatPhysicalFunction::TintToTfloatPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(2); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal TintToTfloatPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto ts = parameterValues[1].cast>(); + + const auto result = nautilus::invoke( + +[](double value, uint64_t ts) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string tempWkt = fmt::format("{}@{}", static_cast(value), + MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tint_in(tempWkt.c_str()); + if (!temp) return 0.0; + Temporal* res = tint_to_tfloat(temp); + free(temp); + if (!res) return 0.0; + double r = tfloat_start_value(res); + free(res); + return r; + } catch (const std::exception&) { return 0.0; } + }, + value, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTintToTfloatPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 2, + "TintToTfloatPhysicalFunction requires 2 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + return TintToTfloatPhysicalFunction(std::move(arg0), std::move(arg1)); +} + +} // namespace NES diff --git a/nes-sql-parser/AntlrSQL.g4 b/nes-sql-parser/AntlrSQL.g4 index 4afbde6abd..904df4a954 100644 --- a/nes-sql-parser/AntlrSQL.g4 +++ b/nes-sql-parser/AntlrSQL.g4 @@ -295,7 +295,7 @@ timeUnit: MS timestampParameter: name=identifier; -functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | EDWITHIN_TGEO_GEO | TGEO_AT_STBOX | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_FLOOR | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TNUMBER_ABS; +functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | EDWITHIN_TGEO_GEO | TGEO_AT_STBOX | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_FLOOR | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TFLOAT | TNUMBER_ABS; sinkClause: INTO sink (',' sink)*; @@ -514,9 +514,11 @@ TFLOAT_SHIFT_SCALE_VALUE: 'TFLOAT_SHIFT_SCALE_VALUE' | 'tfloat_shift_scale_value TFLOAT_SHIFT_VALUE: 'TFLOAT_SHIFT_VALUE' | 'tfloat_shift_value'; TFLOAT_SIN: 'TFLOAT_SIN' | 'tfloat_sin'; TFLOAT_TAN: 'TFLOAT_TAN' | 'tfloat_tan'; +TFLOAT_TO_TINT: 'TFLOAT_TO_TINT' | 'tfloat_to_tint'; TINT_SCALE_VALUE: 'TINT_SCALE_VALUE' | 'tint_scale_value'; TINT_SHIFT_SCALE_VALUE: 'TINT_SHIFT_SCALE_VALUE' | 'tint_shift_scale_value'; TINT_SHIFT_VALUE: 'TINT_SHIFT_VALUE' | 'tint_shift_value'; +TINT_TO_TFLOAT: 'TINT_TO_TFLOAT' | 'tint_to_tfloat'; TNUMBER_ABS: 'TNUMBER_ABS' | 'tnumber_abs'; WATERMARK: 'WATERMARK' | 'watermark'; OFFSET: 'OFFSET' | 'offset'; diff --git a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp index cc8764f9be..ffecad8e62 100644 --- a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp +++ b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp @@ -95,9 +95,11 @@ #include #include #include +#include #include #include #include +#include #include #include #include @@ -1301,6 +1303,34 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont } break; /* END CODEGEN PARSER GLUE: TFLOAT_TAN */ + /* BEGIN CODEGEN PARSER GLUE: TFLOAT_TO_TINT */ + case AntlrSQLLexer::TFLOAT_TO_TINT: + { + const auto argCount = context->expression().size(); + if (argCount != 2) + throw InvalidQuerySyntax("TFLOAT_TO_TINT requires exactly 2 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(TfloatToTintLogicalFunction(a0, a1)); + } + break; + /* END CODEGEN PARSER GLUE: TFLOAT_TO_TINT */ /* BEGIN CODEGEN PARSER GLUE: TFLOAT_CEIL */ case AntlrSQLLexer::TFLOAT_CEIL: { @@ -2082,6 +2112,34 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont } break; /* END CODEGEN PARSER GLUE: TINT_SHIFT_VALUE */ + /* BEGIN CODEGEN PARSER GLUE: TINT_TO_TFLOAT */ + case AntlrSQLLexer::TINT_TO_TFLOAT: + { + const auto argCount = context->expression().size(); + if (argCount != 2) + throw InvalidQuerySyntax("TINT_TO_TFLOAT requires exactly 2 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(TintToTfloatLogicalFunction(a0, a1)); + } + break; + /* END CODEGEN PARSER GLUE: TINT_TO_TFLOAT */ default: /// Check if the function is a constructor for a datatype From e53bbc132459a4902fc6b1550da98ce2787188a8 Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Fri, 12 Jun 2026 06:18:42 +0200 Subject: [PATCH 12/96] feat(meos): add tbigint type-conversion NES operators TBIGINT_TO_TINT, TBIGINT_TO_TFLOAT, TINT_TO_TBIGINT, TFLOAT_TO_TBIGINT (W54) --- .../Meos/TbigintToTfloatLogicalFunction.hpp | 53 ++++++++ .../Meos/TbigintToTintLogicalFunction.hpp | 53 ++++++++ .../Meos/TfloatToTbigintLogicalFunction.hpp | 53 ++++++++ .../Meos/TintToTbigintLogicalFunction.hpp | 53 ++++++++ .../src/Functions/Meos/CMakeLists.txt | 4 + .../Meos/TbigintToTfloatLogicalFunction.cpp | 102 +++++++++++++++ .../Meos/TbigintToTintLogicalFunction.cpp | 102 +++++++++++++++ .../Meos/TfloatToTbigintLogicalFunction.cpp | 102 +++++++++++++++ .../Meos/TintToTbigintLogicalFunction.cpp | 102 +++++++++++++++ .../Meos/TbigintToTfloatPhysicalFunction.hpp | 42 +++++++ .../Meos/TbigintToTintPhysicalFunction.hpp | 42 +++++++ .../Meos/TfloatToTbigintPhysicalFunction.hpp | 42 +++++++ .../Meos/TintToTbigintPhysicalFunction.hpp | 42 +++++++ .../src/Functions/Meos/CMakeLists.txt | 4 + .../Meos/TbigintToTfloatPhysicalFunction.cpp | 87 +++++++++++++ .../Meos/TbigintToTintPhysicalFunction.cpp | 87 +++++++++++++ .../Meos/TfloatToTbigintPhysicalFunction.cpp | 87 +++++++++++++ .../Meos/TintToTbigintPhysicalFunction.cpp | 87 +++++++++++++ nes-sql-parser/AntlrSQL.g4 | 6 +- .../src/AntlrSQLQueryPlanCreator.cpp | 116 ++++++++++++++++++ 20 files changed, 1265 insertions(+), 1 deletion(-) create mode 100644 nes-logical-operators/include/Functions/Meos/TbigintToTfloatLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TbigintToTintLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TfloatToTbigintLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TintToTbigintLogicalFunction.hpp create mode 100644 nes-logical-operators/src/Functions/Meos/TbigintToTfloatLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TbigintToTintLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TfloatToTbigintLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TintToTbigintLogicalFunction.cpp create mode 100644 nes-physical-operators/include/Functions/Meos/TbigintToTfloatPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TbigintToTintPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TfloatToTbigintPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TintToTbigintPhysicalFunction.hpp create mode 100644 nes-physical-operators/src/Functions/Meos/TbigintToTfloatPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TbigintToTintPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TfloatToTbigintPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TintToTbigintPhysicalFunction.cpp diff --git a/nes-logical-operators/include/Functions/Meos/TbigintToTfloatLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TbigintToTfloatLogicalFunction.hpp new file mode 100644 index 0000000000..aafccec021 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TbigintToTfloatLogicalFunction.hpp @@ -0,0 +1,53 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event tbigint_to_tfloat: converts a single-instant tbigint to tfloat, returns FLOAT64. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `tbigint_to_tfloat`. Takes (value:FLOAT64, ts:UINT64), constructs a single-instant + * temporal bigint, widens to float, and returns FLOAT64. + */ +class TbigintToTfloatLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TbigintToTfloat"; + + TbigintToTfloatLogicalFunction(LogicalFunction value, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TbigintToTintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TbigintToTintLogicalFunction.hpp new file mode 100644 index 0000000000..78e9cbb7d3 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TbigintToTintLogicalFunction.hpp @@ -0,0 +1,53 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event tbigint_to_tint: converts a single-instant tbigint to tint, returns FLOAT64. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `tbigint_to_tint`. Takes (value:FLOAT64, ts:UINT64), constructs a single-instant + * temporal bigint, narrows to integer, and returns FLOAT64. + */ +class TbigintToTintLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TbigintToTint"; + + TbigintToTintLogicalFunction(LogicalFunction value, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TfloatToTbigintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TfloatToTbigintLogicalFunction.hpp new file mode 100644 index 0000000000..67a04b12b5 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TfloatToTbigintLogicalFunction.hpp @@ -0,0 +1,53 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event tfloat_to_tbigint: converts a single-instant tfloat to tbigint, returns FLOAT64. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `tfloat_to_tbigint`. Takes (value:FLOAT64, ts:UINT64), constructs a single-instant + * temporal float, truncates to bigint, and returns FLOAT64. + */ +class TfloatToTbigintLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TfloatToTbigint"; + + TfloatToTbigintLogicalFunction(LogicalFunction value, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TintToTbigintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TintToTbigintLogicalFunction.hpp new file mode 100644 index 0000000000..f9460e7edd --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TintToTbigintLogicalFunction.hpp @@ -0,0 +1,53 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event tint_to_tbigint: converts a single-instant tint to tbigint, returns FLOAT64. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `tint_to_tbigint`. Takes (value:FLOAT64, ts:UINT64), constructs a single-instant + * temporal integer, widens to bigint, and returns FLOAT64. + */ +class TintToTbigintLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TintToTbigint"; + + TintToTbigintLogicalFunction(LogicalFunction value, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt index 4657c2f4fb..50e5392a95 100644 --- a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt @@ -47,6 +47,10 @@ add_plugin(TfloatShiftScaleValue LogicalFunction nes-logical-operators TfloatShi add_plugin(TfloatShiftValue LogicalFunction nes-logical-operators TfloatShiftValueLogicalFunction.cpp) add_plugin(TfloatSin LogicalFunction nes-logical-operators TfloatSinLogicalFunction.cpp) add_plugin(TfloatTan LogicalFunction nes-logical-operators TfloatTanLogicalFunction.cpp) +add_plugin(TbigintToTfloat LogicalFunction nes-logical-operators TbigintToTfloatLogicalFunction.cpp) +add_plugin(TbigintToTint LogicalFunction nes-logical-operators TbigintToTintLogicalFunction.cpp) +add_plugin(TfloatToTbigint LogicalFunction nes-logical-operators TfloatToTbigintLogicalFunction.cpp) add_plugin(TfloatToTint LogicalFunction nes-logical-operators TfloatToTintLogicalFunction.cpp) +add_plugin(TintToTbigint LogicalFunction nes-logical-operators TintToTbigintLogicalFunction.cpp) add_plugin(TintToTfloat LogicalFunction nes-logical-operators TintToTfloatLogicalFunction.cpp) add_plugin(TnumberAbs LogicalFunction nes-logical-operators TnumberAbsLogicalFunction.cpp) diff --git a/nes-logical-operators/src/Functions/Meos/TbigintToTfloatLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TbigintToTfloatLogicalFunction.cpp new file mode 100644 index 0000000000..65b2a6cefd --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TbigintToTfloatLogicalFunction.cpp @@ -0,0 +1,102 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TbigintToTfloatLogicalFunction::TbigintToTfloatLogicalFunction(LogicalFunction value, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(2); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(ts)); +} + +DataType TbigintToTfloatLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction TbigintToTfloatLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector TbigintToTfloatLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction TbigintToTfloatLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 2, "TbigintToTfloatLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view TbigintToTfloatLogicalFunction::getType() const { return NAME; } + +bool TbigintToTfloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string TbigintToTfloatLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TbigintToTfloatLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction TbigintToTfloatLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTbigintToTfloatLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 2, + "TbigintToTfloatLogicalFunction requires 2 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + return TbigintToTfloatLogicalFunction(std::move(arg0), std::move(arg1)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TbigintToTintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TbigintToTintLogicalFunction.cpp new file mode 100644 index 0000000000..312df7d30a --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TbigintToTintLogicalFunction.cpp @@ -0,0 +1,102 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TbigintToTintLogicalFunction::TbigintToTintLogicalFunction(LogicalFunction value, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(2); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(ts)); +} + +DataType TbigintToTintLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction TbigintToTintLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector TbigintToTintLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction TbigintToTintLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 2, "TbigintToTintLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view TbigintToTintLogicalFunction::getType() const { return NAME; } + +bool TbigintToTintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string TbigintToTintLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TbigintToTintLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction TbigintToTintLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTbigintToTintLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 2, + "TbigintToTintLogicalFunction requires 2 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + return TbigintToTintLogicalFunction(std::move(arg0), std::move(arg1)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TfloatToTbigintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TfloatToTbigintLogicalFunction.cpp new file mode 100644 index 0000000000..b86add8d10 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TfloatToTbigintLogicalFunction.cpp @@ -0,0 +1,102 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TfloatToTbigintLogicalFunction::TfloatToTbigintLogicalFunction(LogicalFunction value, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(2); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(ts)); +} + +DataType TfloatToTbigintLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction TfloatToTbigintLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector TfloatToTbigintLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction TfloatToTbigintLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 2, "TfloatToTbigintLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view TfloatToTbigintLogicalFunction::getType() const { return NAME; } + +bool TfloatToTbigintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string TfloatToTbigintLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TfloatToTbigintLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction TfloatToTbigintLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTfloatToTbigintLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 2, + "TfloatToTbigintLogicalFunction requires 2 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + return TfloatToTbigintLogicalFunction(std::move(arg0), std::move(arg1)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TintToTbigintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TintToTbigintLogicalFunction.cpp new file mode 100644 index 0000000000..681eb6857d --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TintToTbigintLogicalFunction.cpp @@ -0,0 +1,102 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TintToTbigintLogicalFunction::TintToTbigintLogicalFunction(LogicalFunction value, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(2); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(ts)); +} + +DataType TintToTbigintLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction TintToTbigintLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector TintToTbigintLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction TintToTbigintLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 2, "TintToTbigintLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view TintToTbigintLogicalFunction::getType() const { return NAME; } + +bool TintToTbigintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string TintToTbigintLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TintToTbigintLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction TintToTbigintLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTintToTbigintLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 2, + "TintToTbigintLogicalFunction requires 2 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + return TintToTbigintLogicalFunction(std::move(arg0), std::move(arg1)); +} + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TbigintToTfloatPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TbigintToTfloatPhysicalFunction.hpp new file mode 100644 index 0000000000..a59b288ff5 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TbigintToTfloatPhysicalFunction.hpp @@ -0,0 +1,42 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `tbigint_to_tfloat`. + * + * Per-event tbigint_to_tfloat: single-instant tbigint converted to tfloat, result extracted -> double. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TbigintToTfloatPhysicalFunction : public PhysicalFunctionConcept { +public: + TbigintToTfloatPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TbigintToTintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TbigintToTintPhysicalFunction.hpp new file mode 100644 index 0000000000..a122dcf560 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TbigintToTintPhysicalFunction.hpp @@ -0,0 +1,42 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `tbigint_to_tint`. + * + * Per-event tbigint_to_tint: single-instant tbigint converted to tint, result extracted -> double. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TbigintToTintPhysicalFunction : public PhysicalFunctionConcept { +public: + TbigintToTintPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TfloatToTbigintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TfloatToTbigintPhysicalFunction.hpp new file mode 100644 index 0000000000..0a6d8397fb --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TfloatToTbigintPhysicalFunction.hpp @@ -0,0 +1,42 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `tfloat_to_tbigint`. + * + * Per-event tfloat_to_tbigint: single-instant tfloat converted to tbigint, result extracted -> double. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TfloatToTbigintPhysicalFunction : public PhysicalFunctionConcept { +public: + TfloatToTbigintPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TintToTbigintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TintToTbigintPhysicalFunction.hpp new file mode 100644 index 0000000000..0d761ed1a8 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TintToTbigintPhysicalFunction.hpp @@ -0,0 +1,42 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `tint_to_tbigint`. + * + * Per-event tint_to_tbigint: single-instant tint converted to tbigint, result extracted -> double. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TintToTbigintPhysicalFunction : public PhysicalFunctionConcept { +public: + TintToTbigintPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt index 68c2b6a81c..3b10b0af05 100644 --- a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt @@ -46,7 +46,11 @@ add_plugin(TfloatShiftScaleValue PhysicalFunction nes-physical-operators TfloatS add_plugin(TfloatShiftValue PhysicalFunction nes-physical-operators TfloatShiftValuePhysicalFunction.cpp) add_plugin(TfloatSin PhysicalFunction nes-physical-operators TfloatSinPhysicalFunction.cpp) add_plugin(TfloatTan PhysicalFunction nes-physical-operators TfloatTanPhysicalFunction.cpp) +add_plugin(TbigintToTfloat PhysicalFunction nes-physical-operators TbigintToTfloatPhysicalFunction.cpp) +add_plugin(TbigintToTint PhysicalFunction nes-physical-operators TbigintToTintPhysicalFunction.cpp) +add_plugin(TfloatToTbigint PhysicalFunction nes-physical-operators TfloatToTbigintPhysicalFunction.cpp) add_plugin(TfloatToTint PhysicalFunction nes-physical-operators TfloatToTintPhysicalFunction.cpp) +add_plugin(TintToTbigint PhysicalFunction nes-physical-operators TintToTbigintPhysicalFunction.cpp) add_plugin(TintToTfloat PhysicalFunction nes-physical-operators TintToTfloatPhysicalFunction.cpp) add_plugin(TnumberAbs PhysicalFunction nes-physical-operators TnumberAbsPhysicalFunction.cpp) endif() diff --git a/nes-physical-operators/src/Functions/Meos/TbigintToTfloatPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TbigintToTfloatPhysicalFunction.cpp new file mode 100644 index 0000000000..a8ba3a08b4 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TbigintToTfloatPhysicalFunction.cpp @@ -0,0 +1,87 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +TbigintToTfloatPhysicalFunction::TbigintToTfloatPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(2); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal TbigintToTfloatPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto ts = parameterValues[1].cast>(); + + const auto result = nautilus::invoke( + +[](double value, uint64_t ts) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string tempWkt = fmt::format("{}@{}", static_cast(value), MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tbigint_in(tempWkt.c_str()); + if (!temp) return 0.0; + Temporal* res = tbigint_to_tfloat(temp); + free(temp); + if (!res) return 0.0; + double r = tfloat_start_value(res); + free(res); + return r; + } catch (const std::exception&) { return 0.0; } + }, + value, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTbigintToTfloatPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 2, + "TbigintToTfloatPhysicalFunction requires 2 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + return TbigintToTfloatPhysicalFunction(std::move(arg0), std::move(arg1)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TbigintToTintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TbigintToTintPhysicalFunction.cpp new file mode 100644 index 0000000000..32a231a74a --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TbigintToTintPhysicalFunction.cpp @@ -0,0 +1,87 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +TbigintToTintPhysicalFunction::TbigintToTintPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(2); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal TbigintToTintPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto ts = parameterValues[1].cast>(); + + const auto result = nautilus::invoke( + +[](double value, uint64_t ts) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string tempWkt = fmt::format("{}@{}", static_cast(value), MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tbigint_in(tempWkt.c_str()); + if (!temp) return 0.0; + Temporal* res = tbigint_to_tint(temp); + free(temp); + if (!res) return 0.0; + double r = static_cast(tint_start_value(res)); + free(res); + return r; + } catch (const std::exception&) { return 0.0; } + }, + value, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTbigintToTintPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 2, + "TbigintToTintPhysicalFunction requires 2 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + return TbigintToTintPhysicalFunction(std::move(arg0), std::move(arg1)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TfloatToTbigintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TfloatToTbigintPhysicalFunction.cpp new file mode 100644 index 0000000000..9549684d2b --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TfloatToTbigintPhysicalFunction.cpp @@ -0,0 +1,87 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +TfloatToTbigintPhysicalFunction::TfloatToTbigintPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(2); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal TfloatToTbigintPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto ts = parameterValues[1].cast>(); + + const auto result = nautilus::invoke( + +[](double value, uint64_t ts) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string tempWkt = fmt::format("{}@{}", value, MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tfloat_in(tempWkt.c_str()); + if (!temp) return 0.0; + Temporal* res = tfloat_to_tbigint(temp); + free(temp); + if (!res) return 0.0; + double r = static_cast(tbigint_start_value(res)); + free(res); + return r; + } catch (const std::exception&) { return 0.0; } + }, + value, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTfloatToTbigintPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 2, + "TfloatToTbigintPhysicalFunction requires 2 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + return TfloatToTbigintPhysicalFunction(std::move(arg0), std::move(arg1)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TintToTbigintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TintToTbigintPhysicalFunction.cpp new file mode 100644 index 0000000000..36a685a163 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TintToTbigintPhysicalFunction.cpp @@ -0,0 +1,87 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +TintToTbigintPhysicalFunction::TintToTbigintPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(2); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal TintToTbigintPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto ts = parameterValues[1].cast>(); + + const auto result = nautilus::invoke( + +[](double value, uint64_t ts) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string tempWkt = fmt::format("{}@{}", static_cast(value), MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tint_in(tempWkt.c_str()); + if (!temp) return 0.0; + Temporal* res = tint_to_tbigint(temp); + free(temp); + if (!res) return 0.0; + double r = static_cast(tbigint_start_value(res)); + free(res); + return r; + } catch (const std::exception&) { return 0.0; } + }, + value, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTintToTbigintPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 2, + "TintToTbigintPhysicalFunction requires 2 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + return TintToTbigintPhysicalFunction(std::move(arg0), std::move(arg1)); +} + +} // namespace NES diff --git a/nes-sql-parser/AntlrSQL.g4 b/nes-sql-parser/AntlrSQL.g4 index 904df4a954..3c0413fb45 100644 --- a/nes-sql-parser/AntlrSQL.g4 +++ b/nes-sql-parser/AntlrSQL.g4 @@ -295,7 +295,7 @@ timeUnit: MS timestampParameter: name=identifier; -functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | EDWITHIN_TGEO_GEO | TGEO_AT_STBOX | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_FLOOR | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TFLOAT | TNUMBER_ABS; +functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | EDWITHIN_TGEO_GEO | TGEO_AT_STBOX | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_FLOOR | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS; sinkClause: INTO sink (',' sink)*; @@ -500,6 +500,8 @@ MUL_TNUMBER_TNUMBER: 'MUL_TNUMBER_TNUMBER' | 'mul_tnumber_tnumber'; SUB_TFLOAT_FLOAT: 'SUB_TFLOAT_FLOAT' | 'sub_tfloat_float'; SUB_TINT_INT: 'SUB_TINT_INT' | 'sub_tint_int'; SUB_TNUMBER_TNUMBER: 'SUB_TNUMBER_TNUMBER' | 'sub_tnumber_tnumber'; +TBIGINT_TO_TFLOAT: 'TBIGINT_TO_TFLOAT' | 'tbigint_to_tfloat'; +TBIGINT_TO_TINT: 'TBIGINT_TO_TINT' | 'tbigint_to_tint'; TDISTANCE_TFLOAT_FLOAT: 'TDISTANCE_TFLOAT_FLOAT' | 'tdistance_tfloat_float'; TDISTANCE_TINT_INT: 'TDISTANCE_TINT_INT' | 'tdistance_tint_int'; TDISTANCE_TNUMBER_TNUMBER: 'TDISTANCE_TNUMBER_TNUMBER' | 'tdistance_tnumber_tnumber'; @@ -514,10 +516,12 @@ TFLOAT_SHIFT_SCALE_VALUE: 'TFLOAT_SHIFT_SCALE_VALUE' | 'tfloat_shift_scale_value TFLOAT_SHIFT_VALUE: 'TFLOAT_SHIFT_VALUE' | 'tfloat_shift_value'; TFLOAT_SIN: 'TFLOAT_SIN' | 'tfloat_sin'; TFLOAT_TAN: 'TFLOAT_TAN' | 'tfloat_tan'; +TFLOAT_TO_TBIGINT: 'TFLOAT_TO_TBIGINT' | 'tfloat_to_tbigint'; TFLOAT_TO_TINT: 'TFLOAT_TO_TINT' | 'tfloat_to_tint'; TINT_SCALE_VALUE: 'TINT_SCALE_VALUE' | 'tint_scale_value'; TINT_SHIFT_SCALE_VALUE: 'TINT_SHIFT_SCALE_VALUE' | 'tint_shift_scale_value'; TINT_SHIFT_VALUE: 'TINT_SHIFT_VALUE' | 'tint_shift_value'; +TINT_TO_TBIGINT: 'TINT_TO_TBIGINT' | 'tint_to_tbigint'; TINT_TO_TFLOAT: 'TINT_TO_TFLOAT' | 'tint_to_tfloat'; TNUMBER_ABS: 'TNUMBER_ABS' | 'tnumber_abs'; WATERMARK: 'WATERMARK' | 'watermark'; diff --git a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp index ffecad8e62..427782a1ea 100644 --- a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp +++ b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp @@ -81,6 +81,8 @@ #include #include #include +#include +#include #include #include #include @@ -95,10 +97,12 @@ #include #include #include +#include #include #include #include #include +#include #include #include #include @@ -1303,6 +1307,34 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont } break; /* END CODEGEN PARSER GLUE: TFLOAT_TAN */ + /* BEGIN CODEGEN PARSER GLUE: TFLOAT_TO_TBIGINT */ + case AntlrSQLLexer::TFLOAT_TO_TBIGINT: + { + const auto argCount = context->expression().size(); + if (argCount != 2) + throw InvalidQuerySyntax("TFLOAT_TO_TBIGINT requires exactly 2 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(TfloatToTbigintLogicalFunction(a0, a1)); + } + break; + /* END CODEGEN PARSER GLUE: TFLOAT_TO_TBIGINT */ /* BEGIN CODEGEN PARSER GLUE: TFLOAT_TO_TINT */ case AntlrSQLLexer::TFLOAT_TO_TINT: { @@ -1908,6 +1940,62 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont } break; /* END CODEGEN PARSER GLUE: SUB_TNUMBER_TNUMBER */ + /* BEGIN CODEGEN PARSER GLUE: TBIGINT_TO_TFLOAT */ + case AntlrSQLLexer::TBIGINT_TO_TFLOAT: + { + const auto argCount = context->expression().size(); + if (argCount != 2) + throw InvalidQuerySyntax("TBIGINT_TO_TFLOAT requires exactly 2 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(TbigintToTfloatLogicalFunction(a0, a1)); + } + break; + /* END CODEGEN PARSER GLUE: TBIGINT_TO_TFLOAT */ + /* BEGIN CODEGEN PARSER GLUE: TBIGINT_TO_TINT */ + case AntlrSQLLexer::TBIGINT_TO_TINT: + { + const auto argCount = context->expression().size(); + if (argCount != 2) + throw InvalidQuerySyntax("TBIGINT_TO_TINT requires exactly 2 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(TbigintToTintLogicalFunction(a0, a1)); + } + break; + /* END CODEGEN PARSER GLUE: TBIGINT_TO_TINT */ case AntlrSQLLexer::TDISTANCE_TFLOAT_FLOAT: { @@ -2112,6 +2200,34 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont } break; /* END CODEGEN PARSER GLUE: TINT_SHIFT_VALUE */ + /* BEGIN CODEGEN PARSER GLUE: TINT_TO_TBIGINT */ + case AntlrSQLLexer::TINT_TO_TBIGINT: + { + const auto argCount = context->expression().size(); + if (argCount != 2) + throw InvalidQuerySyntax("TINT_TO_TBIGINT requires exactly 2 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(TintToTbigintLogicalFunction(a0, a1)); + } + break; + /* END CODEGEN PARSER GLUE: TINT_TO_TBIGINT */ /* BEGIN CODEGEN PARSER GLUE: TINT_TO_TFLOAT */ case AntlrSQLLexer::TINT_TO_TFLOAT: { From 677ea809cd9deeb98df40015f74705a545669853 Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Fri, 12 Jun 2026 06:24:39 +0200 Subject: [PATCH 13/96] feat(meos): add ADD/SUB/MUL/DIV_TBIGINT_BIGINT NES operators (W55) --- .../Meos/AddTbigintBigintLogicalFunction.hpp | 54 ++++++++ .../Meos/DivTbigintBigintLogicalFunction.hpp | 54 ++++++++ .../Meos/MulTbigintBigintLogicalFunction.hpp | 54 ++++++++ .../Meos/SubTbigintBigintLogicalFunction.hpp | 54 ++++++++ .../Meos/AddTbigintBigintLogicalFunction.cpp | 105 +++++++++++++++ .../src/Functions/Meos/CMakeLists.txt | 4 + .../Meos/DivTbigintBigintLogicalFunction.cpp | 105 +++++++++++++++ .../Meos/MulTbigintBigintLogicalFunction.cpp | 105 +++++++++++++++ .../Meos/SubTbigintBigintLogicalFunction.cpp | 105 +++++++++++++++ .../Meos/AddTbigintBigintPhysicalFunction.hpp | 43 +++++++ .../Meos/DivTbigintBigintPhysicalFunction.hpp | 43 +++++++ .../Meos/MulTbigintBigintPhysicalFunction.hpp | 43 +++++++ .../Meos/SubTbigintBigintPhysicalFunction.hpp | 43 +++++++ .../Meos/AddTbigintBigintPhysicalFunction.cpp | 92 ++++++++++++++ .../src/Functions/Meos/CMakeLists.txt | 4 + .../Meos/DivTbigintBigintPhysicalFunction.cpp | 92 ++++++++++++++ .../Meos/MulTbigintBigintPhysicalFunction.cpp | 92 ++++++++++++++ .../Meos/SubTbigintBigintPhysicalFunction.cpp | 92 ++++++++++++++ nes-sql-parser/AntlrSQL.g4 | 6 +- .../src/AntlrSQLQueryPlanCreator.cpp | 120 ++++++++++++++++++ 20 files changed, 1309 insertions(+), 1 deletion(-) create mode 100644 nes-logical-operators/include/Functions/Meos/AddTbigintBigintLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/DivTbigintBigintLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/MulTbigintBigintLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/SubTbigintBigintLogicalFunction.hpp create mode 100644 nes-logical-operators/src/Functions/Meos/AddTbigintBigintLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/DivTbigintBigintLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/MulTbigintBigintLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/SubTbigintBigintLogicalFunction.cpp create mode 100644 nes-physical-operators/include/Functions/Meos/AddTbigintBigintPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/DivTbigintBigintPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/MulTbigintBigintPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/SubTbigintBigintPhysicalFunction.hpp create mode 100644 nes-physical-operators/src/Functions/Meos/AddTbigintBigintPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/DivTbigintBigintPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/MulTbigintBigintPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/SubTbigintBigintPhysicalFunction.cpp diff --git a/nes-logical-operators/include/Functions/Meos/AddTbigintBigintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AddTbigintBigintLogicalFunction.hpp new file mode 100644 index 0000000000..c97f49cb16 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AddTbigintBigintLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event add_tbigint_bigint: adds a constant int64 to a single-instant tbigint value. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `add_tbigint_bigint`. Takes (value:FLOAT64, ts:UINT64, addend:FLOAT64→int64), + * constructs a single-instant temporal, applies the addition, and returns FLOAT64. + */ +class AddTbigintBigintLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AddTbigintBigint"; + + AddTbigintBigintLogicalFunction(LogicalFunction value, + LogicalFunction ts, + LogicalFunction addend); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/DivTbigintBigintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/DivTbigintBigintLogicalFunction.hpp new file mode 100644 index 0000000000..48d916f76d --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/DivTbigintBigintLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event div_tbigint_bigint: divides a single-instant tbigint value by a constant int64. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `div_tbigint_bigint`. Takes (value:FLOAT64, ts:UINT64, divisor:FLOAT64→int64), + * constructs a single-instant temporal, applies the division, and returns FLOAT64. + */ +class DivTbigintBigintLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "DivTbigintBigint"; + + DivTbigintBigintLogicalFunction(LogicalFunction value, + LogicalFunction ts, + LogicalFunction divisor); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/MulTbigintBigintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/MulTbigintBigintLogicalFunction.hpp new file mode 100644 index 0000000000..ff857a8773 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/MulTbigintBigintLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event mul_tbigint_bigint: multiplies a single-instant tbigint value by a constant int64. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `mul_tbigint_bigint`. Takes (value:FLOAT64, ts:UINT64, factor:FLOAT64→int64), + * constructs a single-instant temporal, applies the multiplication, and returns FLOAT64. + */ +class MulTbigintBigintLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "MulTbigintBigint"; + + MulTbigintBigintLogicalFunction(LogicalFunction value, + LogicalFunction ts, + LogicalFunction factor); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/SubTbigintBigintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/SubTbigintBigintLogicalFunction.hpp new file mode 100644 index 0000000000..c1ff3f9a15 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/SubTbigintBigintLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event sub_tbigint_bigint: subtracts a constant int64 from a single-instant tbigint value. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `sub_tbigint_bigint`. Takes (value:FLOAT64, ts:UINT64, subtrahend:FLOAT64→int64), + * constructs a single-instant temporal, applies the subtraction, and returns FLOAT64. + */ +class SubTbigintBigintLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "SubTbigintBigint"; + + SubTbigintBigintLogicalFunction(LogicalFunction value, + LogicalFunction ts, + LogicalFunction subtrahend); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AddTbigintBigintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AddTbigintBigintLogicalFunction.cpp new file mode 100644 index 0000000000..68d4e06d74 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AddTbigintBigintLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AddTbigintBigintLogicalFunction::AddTbigintBigintLogicalFunction(LogicalFunction value, + LogicalFunction ts, + LogicalFunction addend) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(addend)); +} + +DataType AddTbigintBigintLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AddTbigintBigintLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AddTbigintBigintLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AddTbigintBigintLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "AddTbigintBigintLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AddTbigintBigintLogicalFunction::getType() const { return NAME; } + +bool AddTbigintBigintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AddTbigintBigintLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction AddTbigintBigintLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction AddTbigintBigintLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAddTbigintBigintLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "AddTbigintBigintLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return AddTbigintBigintLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt index 50e5392a95..58a9c60a18 100644 --- a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt @@ -25,6 +25,7 @@ add_plugin(TfloatFloor LogicalFunction nes-logical-operators TfloatFloorLogicalF add_plugin(TfloatRadians LogicalFunction nes-logical-operators TfloatRadiansLogicalFunction.cpp) add_plugin(TfloatScaleValue LogicalFunction nes-logical-operators TfloatScaleValueLogicalFunction.cpp) add_plugin(AddTfloatFloat LogicalFunction nes-logical-operators AddTfloatFloatLogicalFunction.cpp) +add_plugin(AddTbigintBigint LogicalFunction nes-logical-operators AddTbigintBigintLogicalFunction.cpp) add_plugin(AddTintInt LogicalFunction nes-logical-operators AddTintIntLogicalFunction.cpp) add_plugin(AddTnumberTnumber LogicalFunction nes-logical-operators AddTnumberTnumberLogicalFunction.cpp) add_plugin(TdistanceTfloatFloat LogicalFunction nes-logical-operators TdistanceTfloatFloatLogicalFunction.cpp) @@ -34,10 +35,13 @@ add_plugin(TemporalRound LogicalFunction nes-logical-operators TemporalRoundLogi add_plugin(TintScaleValue LogicalFunction nes-logical-operators TintScaleValueLogicalFunction.cpp) add_plugin(TintShiftScaleValue LogicalFunction nes-logical-operators TintShiftScaleValueLogicalFunction.cpp) add_plugin(TintShiftValue LogicalFunction nes-logical-operators TintShiftValueLogicalFunction.cpp) +add_plugin(DivTbigintBigint LogicalFunction nes-logical-operators DivTbigintBigintLogicalFunction.cpp) add_plugin(DivTintInt LogicalFunction nes-logical-operators DivTintIntLogicalFunction.cpp) add_plugin(DivTnumberTnumber LogicalFunction nes-logical-operators DivTnumberTnumberLogicalFunction.cpp) +add_plugin(MulTbigintBigint LogicalFunction nes-logical-operators MulTbigintBigintLogicalFunction.cpp) add_plugin(MulTintInt LogicalFunction nes-logical-operators MulTintIntLogicalFunction.cpp) add_plugin(MulTnumberTnumber LogicalFunction nes-logical-operators MulTnumberTnumberLogicalFunction.cpp) +add_plugin(SubTbigintBigint LogicalFunction nes-logical-operators SubTbigintBigintLogicalFunction.cpp) add_plugin(SubTintInt LogicalFunction nes-logical-operators SubTintIntLogicalFunction.cpp) add_plugin(SubTnumberTnumber LogicalFunction nes-logical-operators SubTnumberTnumberLogicalFunction.cpp) add_plugin(DivTfloatFloat LogicalFunction nes-logical-operators DivTfloatFloatLogicalFunction.cpp) diff --git a/nes-logical-operators/src/Functions/Meos/DivTbigintBigintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/DivTbigintBigintLogicalFunction.cpp new file mode 100644 index 0000000000..3f200be7c9 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/DivTbigintBigintLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +DivTbigintBigintLogicalFunction::DivTbigintBigintLogicalFunction(LogicalFunction value, + LogicalFunction ts, + LogicalFunction divisor) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(divisor)); +} + +DataType DivTbigintBigintLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction DivTbigintBigintLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector DivTbigintBigintLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction DivTbigintBigintLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "DivTbigintBigintLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view DivTbigintBigintLogicalFunction::getType() const { return NAME; } + +bool DivTbigintBigintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string DivTbigintBigintLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction DivTbigintBigintLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction DivTbigintBigintLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterDivTbigintBigintLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "DivTbigintBigintLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return DivTbigintBigintLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/MulTbigintBigintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/MulTbigintBigintLogicalFunction.cpp new file mode 100644 index 0000000000..0d1e68e0d1 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/MulTbigintBigintLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +MulTbigintBigintLogicalFunction::MulTbigintBigintLogicalFunction(LogicalFunction value, + LogicalFunction ts, + LogicalFunction factor) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(factor)); +} + +DataType MulTbigintBigintLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction MulTbigintBigintLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector MulTbigintBigintLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction MulTbigintBigintLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "MulTbigintBigintLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view MulTbigintBigintLogicalFunction::getType() const { return NAME; } + +bool MulTbigintBigintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string MulTbigintBigintLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction MulTbigintBigintLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction MulTbigintBigintLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterMulTbigintBigintLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "MulTbigintBigintLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return MulTbigintBigintLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/SubTbigintBigintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/SubTbigintBigintLogicalFunction.cpp new file mode 100644 index 0000000000..ba377c8c8a --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/SubTbigintBigintLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +SubTbigintBigintLogicalFunction::SubTbigintBigintLogicalFunction(LogicalFunction value, + LogicalFunction ts, + LogicalFunction subtrahend) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(subtrahend)); +} + +DataType SubTbigintBigintLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction SubTbigintBigintLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector SubTbigintBigintLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction SubTbigintBigintLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "SubTbigintBigintLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view SubTbigintBigintLogicalFunction::getType() const { return NAME; } + +bool SubTbigintBigintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string SubTbigintBigintLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction SubTbigintBigintLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction SubTbigintBigintLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterSubTbigintBigintLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "SubTbigintBigintLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return SubTbigintBigintLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AddTbigintBigintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AddTbigintBigintPhysicalFunction.hpp new file mode 100644 index 0000000000..86f61b764c --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AddTbigintBigintPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `add_tbigint_bigint`. + * + * Per-event add_tbigint_bigint: adds a constant int64 to a single-instant tbigint value. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class AddTbigintBigintPhysicalFunction : public PhysicalFunctionConcept { +public: + AddTbigintBigintPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction, + PhysicalFunction addendFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/DivTbigintBigintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/DivTbigintBigintPhysicalFunction.hpp new file mode 100644 index 0000000000..aafdd6ad39 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/DivTbigintBigintPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `div_tbigint_bigint`. + * + * Per-event div_tbigint_bigint: divides a single-instant tbigint value by a constant int64. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class DivTbigintBigintPhysicalFunction : public PhysicalFunctionConcept { +public: + DivTbigintBigintPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction, + PhysicalFunction divisorFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/MulTbigintBigintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/MulTbigintBigintPhysicalFunction.hpp new file mode 100644 index 0000000000..3736f42e2d --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/MulTbigintBigintPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `mul_tbigint_bigint`. + * + * Per-event mul_tbigint_bigint: multiplies a single-instant tbigint value by a constant int64. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class MulTbigintBigintPhysicalFunction : public PhysicalFunctionConcept { +public: + MulTbigintBigintPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction, + PhysicalFunction factorFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/SubTbigintBigintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/SubTbigintBigintPhysicalFunction.hpp new file mode 100644 index 0000000000..5e42e74482 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/SubTbigintBigintPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `sub_tbigint_bigint`. + * + * Per-event sub_tbigint_bigint: subtracts a constant int64 from a single-instant tbigint value. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class SubTbigintBigintPhysicalFunction : public PhysicalFunctionConcept { +public: + SubTbigintBigintPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction, + PhysicalFunction subtrahendFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AddTbigintBigintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AddTbigintBigintPhysicalFunction.cpp new file mode 100644 index 0000000000..0744733c6f --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AddTbigintBigintPhysicalFunction.cpp @@ -0,0 +1,92 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +AddTbigintBigintPhysicalFunction::AddTbigintBigintPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction, + PhysicalFunction addendFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(addendFunction)); +} + +VarVal AddTbigintBigintPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto ts = parameterValues[1].cast>(); + auto addend = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double value, uint64_t ts, double addend_d) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string tempWkt = fmt::format("{}@{}", static_cast(value), + MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tbigint_in(tempWkt.c_str()); + if (!temp) return 0.0; + Temporal* res = add_tbigint_bigint(temp, static_cast(addend_d)); + free(temp); + if (!res) return 0.0; + double r = static_cast(tbigint_start_value(res)); + free(res); + return r; + } catch (const std::exception&) { return 0.0; } + }, + value, ts, addend); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAddTbigintBigintPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "AddTbigintBigintPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return AddTbigintBigintPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt index 3b10b0af05..96feed49a1 100644 --- a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt @@ -24,6 +24,7 @@ add_plugin(TfloatFloor PhysicalFunction nes-physical-operators TfloatFloorPhysic add_plugin(TfloatRadians PhysicalFunction nes-physical-operators TfloatRadiansPhysicalFunction.cpp) add_plugin(TfloatScaleValue PhysicalFunction nes-physical-operators TfloatScaleValuePhysicalFunction.cpp) add_plugin(AddTfloatFloat PhysicalFunction nes-physical-operators AddTfloatFloatPhysicalFunction.cpp) +add_plugin(AddTbigintBigint PhysicalFunction nes-physical-operators AddTbigintBigintPhysicalFunction.cpp) add_plugin(AddTintInt PhysicalFunction nes-physical-operators AddTintIntPhysicalFunction.cpp) add_plugin(AddTnumberTnumber PhysicalFunction nes-physical-operators AddTnumberTnumberPhysicalFunction.cpp) add_plugin(TdistanceTfloatFloat PhysicalFunction nes-physical-operators TdistanceTfloatFloatPhysicalFunction.cpp) @@ -33,10 +34,13 @@ add_plugin(TemporalRound PhysicalFunction nes-physical-operators TemporalRoundPh add_plugin(TintScaleValue PhysicalFunction nes-physical-operators TintScaleValuePhysicalFunction.cpp) add_plugin(TintShiftScaleValue PhysicalFunction nes-physical-operators TintShiftScaleValuePhysicalFunction.cpp) add_plugin(TintShiftValue PhysicalFunction nes-physical-operators TintShiftValuePhysicalFunction.cpp) +add_plugin(DivTbigintBigint PhysicalFunction nes-physical-operators DivTbigintBigintPhysicalFunction.cpp) add_plugin(DivTintInt PhysicalFunction nes-physical-operators DivTintIntPhysicalFunction.cpp) add_plugin(DivTnumberTnumber PhysicalFunction nes-physical-operators DivTnumberTnumberPhysicalFunction.cpp) +add_plugin(MulTbigintBigint PhysicalFunction nes-physical-operators MulTbigintBigintPhysicalFunction.cpp) add_plugin(MulTintInt PhysicalFunction nes-physical-operators MulTintIntPhysicalFunction.cpp) add_plugin(MulTnumberTnumber PhysicalFunction nes-physical-operators MulTnumberTnumberPhysicalFunction.cpp) +add_plugin(SubTbigintBigint PhysicalFunction nes-physical-operators SubTbigintBigintPhysicalFunction.cpp) add_plugin(SubTintInt PhysicalFunction nes-physical-operators SubTintIntPhysicalFunction.cpp) add_plugin(SubTnumberTnumber PhysicalFunction nes-physical-operators SubTnumberTnumberPhysicalFunction.cpp) add_plugin(DivTfloatFloat PhysicalFunction nes-physical-operators DivTfloatFloatPhysicalFunction.cpp) diff --git a/nes-physical-operators/src/Functions/Meos/DivTbigintBigintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/DivTbigintBigintPhysicalFunction.cpp new file mode 100644 index 0000000000..381188aedf --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/DivTbigintBigintPhysicalFunction.cpp @@ -0,0 +1,92 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +DivTbigintBigintPhysicalFunction::DivTbigintBigintPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction, + PhysicalFunction divisorFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(divisorFunction)); +} + +VarVal DivTbigintBigintPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto ts = parameterValues[1].cast>(); + auto divisor = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double value, uint64_t ts, double divisor_d) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string tempWkt = fmt::format("{}@{}", static_cast(value), + MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tbigint_in(tempWkt.c_str()); + if (!temp) return 0.0; + Temporal* res = div_tbigint_bigint(temp, static_cast(divisor_d)); + free(temp); + if (!res) return 0.0; + double r = static_cast(tbigint_start_value(res)); + free(res); + return r; + } catch (const std::exception&) { return 0.0; } + }, + value, ts, divisor); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterDivTbigintBigintPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "DivTbigintBigintPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return DivTbigintBigintPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/MulTbigintBigintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/MulTbigintBigintPhysicalFunction.cpp new file mode 100644 index 0000000000..b99b8a6441 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/MulTbigintBigintPhysicalFunction.cpp @@ -0,0 +1,92 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +MulTbigintBigintPhysicalFunction::MulTbigintBigintPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction, + PhysicalFunction factorFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(factorFunction)); +} + +VarVal MulTbigintBigintPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto ts = parameterValues[1].cast>(); + auto factor = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double value, uint64_t ts, double factor_d) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string tempWkt = fmt::format("{}@{}", static_cast(value), + MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tbigint_in(tempWkt.c_str()); + if (!temp) return 0.0; + Temporal* res = mul_tbigint_bigint(temp, static_cast(factor_d)); + free(temp); + if (!res) return 0.0; + double r = static_cast(tbigint_start_value(res)); + free(res); + return r; + } catch (const std::exception&) { return 0.0; } + }, + value, ts, factor); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterMulTbigintBigintPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "MulTbigintBigintPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return MulTbigintBigintPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/SubTbigintBigintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/SubTbigintBigintPhysicalFunction.cpp new file mode 100644 index 0000000000..f625c29498 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/SubTbigintBigintPhysicalFunction.cpp @@ -0,0 +1,92 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +SubTbigintBigintPhysicalFunction::SubTbigintBigintPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction, + PhysicalFunction subtrahendFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(subtrahendFunction)); +} + +VarVal SubTbigintBigintPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto ts = parameterValues[1].cast>(); + auto subtrahend = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double value, uint64_t ts, double subtrahend_d) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string tempWkt = fmt::format("{}@{}", static_cast(value), + MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tbigint_in(tempWkt.c_str()); + if (!temp) return 0.0; + Temporal* res = sub_tbigint_bigint(temp, static_cast(subtrahend_d)); + free(temp); + if (!res) return 0.0; + double r = static_cast(tbigint_start_value(res)); + free(res); + return r; + } catch (const std::exception&) { return 0.0; } + }, + value, ts, subtrahend); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterSubTbigintBigintPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "SubTbigintBigintPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return SubTbigintBigintPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-sql-parser/AntlrSQL.g4 b/nes-sql-parser/AntlrSQL.g4 index 3c0413fb45..390a9bf826 100644 --- a/nes-sql-parser/AntlrSQL.g4 +++ b/nes-sql-parser/AntlrSQL.g4 @@ -295,7 +295,7 @@ timeUnit: MS timestampParameter: name=identifier; -functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | EDWITHIN_TGEO_GEO | TGEO_AT_STBOX | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_FLOOR | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS; +functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | EDWITHIN_TGEO_GEO | TGEO_AT_STBOX | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_FLOOR | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS; sinkClause: INTO sink (',' sink)*; @@ -488,15 +488,19 @@ TEMPORAL_AINTERSECTS_GEOMETRY: 'TEMPORAL_AINTERSECTS_GEOMETRY' | 'temporal_ainte TEMPORAL_ECONTAINS_GEOMETRY: 'TEMPORAL_ECONTAINS_GEOMETRY' | 'temporal_econtains_geometry'; EDWITHIN_TGEO_GEO: 'EDWITHIN_TGEO_GEO' | 'edwithin_tgeo_geo'; TGEO_AT_STBOX: 'TGEO_AT_STBOX' | 'tgeo_at_stbox'; +ADD_TBIGINT_BIGINT: 'ADD_TBIGINT_BIGINT' | 'add_tbigint_bigint'; ADD_TFLOAT_FLOAT: 'ADD_TFLOAT_FLOAT' | 'add_tfloat_float'; ADD_TINT_INT: 'ADD_TINT_INT' | 'add_tint_int'; ADD_TNUMBER_TNUMBER: 'ADD_TNUMBER_TNUMBER' | 'add_tnumber_tnumber'; +DIV_TBIGINT_BIGINT: 'DIV_TBIGINT_BIGINT' | 'div_tbigint_bigint'; DIV_TFLOAT_FLOAT: 'DIV_TFLOAT_FLOAT' | 'div_tfloat_float'; DIV_TINT_INT: 'DIV_TINT_INT' | 'div_tint_int'; DIV_TNUMBER_TNUMBER: 'DIV_TNUMBER_TNUMBER' | 'div_tnumber_tnumber'; +MUL_TBIGINT_BIGINT: 'MUL_TBIGINT_BIGINT' | 'mul_tbigint_bigint'; MUL_TFLOAT_FLOAT: 'MUL_TFLOAT_FLOAT' | 'mul_tfloat_float'; MUL_TINT_INT: 'MUL_TINT_INT' | 'mul_tint_int'; MUL_TNUMBER_TNUMBER: 'MUL_TNUMBER_TNUMBER' | 'mul_tnumber_tnumber'; +SUB_TBIGINT_BIGINT: 'SUB_TBIGINT_BIGINT' | 'sub_tbigint_bigint'; SUB_TFLOAT_FLOAT: 'SUB_TFLOAT_FLOAT' | 'sub_tfloat_float'; SUB_TINT_INT: 'SUB_TINT_INT' | 'sub_tint_int'; SUB_TNUMBER_TNUMBER: 'SUB_TNUMBER_TNUMBER' | 'sub_tnumber_tnumber'; diff --git a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp index 427782a1ea..065bc99553 100644 --- a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp +++ b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp @@ -69,15 +69,19 @@ #include #include #include +#include #include #include #include +#include #include #include #include +#include #include #include #include +#include #include #include #include @@ -1707,6 +1711,35 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont } break; /* END CODEGEN PARSER GLUE: SUB_TFLOAT_FLOAT */ + /* BEGIN CODEGEN PARSER GLUE: ADD_TBIGINT_BIGINT */ + case AntlrSQLLexer::ADD_TBIGINT_BIGINT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("ADD_TBIGINT_BIGINT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AddTbigintBigintLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: ADD_TBIGINT_BIGINT */ case AntlrSQLLexer::ADD_TINT_INT: { @@ -1736,6 +1769,35 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont } break; /* END CODEGEN PARSER GLUE: ADD_TINT_INT */ + /* BEGIN CODEGEN PARSER GLUE: DIV_TBIGINT_BIGINT */ + case AntlrSQLLexer::DIV_TBIGINT_BIGINT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("DIV_TBIGINT_BIGINT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(DivTbigintBigintLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: DIV_TBIGINT_BIGINT */ case AntlrSQLLexer::DIV_TINT_INT: { @@ -1765,6 +1827,35 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont } break; /* END CODEGEN PARSER GLUE: DIV_TINT_INT */ + /* BEGIN CODEGEN PARSER GLUE: MUL_TBIGINT_BIGINT */ + case AntlrSQLLexer::MUL_TBIGINT_BIGINT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("MUL_TBIGINT_BIGINT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(MulTbigintBigintLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: MUL_TBIGINT_BIGINT */ case AntlrSQLLexer::MUL_TINT_INT: { @@ -1794,6 +1885,35 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont } break; /* END CODEGEN PARSER GLUE: MUL_TINT_INT */ + /* BEGIN CODEGEN PARSER GLUE: SUB_TBIGINT_BIGINT */ + case AntlrSQLLexer::SUB_TBIGINT_BIGINT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("SUB_TBIGINT_BIGINT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(SubTbigintBigintLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: SUB_TBIGINT_BIGINT */ case AntlrSQLLexer::SUB_TINT_INT: { From 6e878c9bf04fbae98b66f692d7ac06399768d804 Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Fri, 12 Jun 2026 06:29:36 +0200 Subject: [PATCH 14/96] feat(meos): add TBIGINT_SHIFT_VALUE, TBIGINT_SCALE_VALUE, TBIGINT_SHIFT_SCALE_VALUE NES operators (W56) --- .../Meos/TbigintScaleValueLogicalFunction.hpp | 54 +++++++++ .../TbigintShiftScaleValueLogicalFunction.hpp | 55 +++++++++ .../Meos/TbigintShiftValueLogicalFunction.hpp | 54 +++++++++ .../src/Functions/Meos/CMakeLists.txt | 3 + .../Meos/TbigintScaleValueLogicalFunction.cpp | 105 +++++++++++++++++ .../TbigintShiftScaleValueLogicalFunction.cpp | 108 ++++++++++++++++++ .../Meos/TbigintShiftValueLogicalFunction.cpp | 105 +++++++++++++++++ .../TbigintScaleValuePhysicalFunction.hpp | 44 +++++++ ...TbigintShiftScaleValuePhysicalFunction.hpp | 45 ++++++++ .../TbigintShiftValuePhysicalFunction.hpp | 44 +++++++ .../src/Functions/Meos/CMakeLists.txt | 3 + .../TbigintScaleValuePhysicalFunction.cpp | 91 +++++++++++++++ ...TbigintShiftScaleValuePhysicalFunction.cpp | 95 +++++++++++++++ .../TbigintShiftValuePhysicalFunction.cpp | 91 +++++++++++++++ nes-sql-parser/AntlrSQL.g4 | 5 +- .../src/AntlrSQLQueryPlanCreator.cpp | 91 +++++++++++++++ 16 files changed, 992 insertions(+), 1 deletion(-) create mode 100644 nes-logical-operators/include/Functions/Meos/TbigintScaleValueLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TbigintShiftScaleValueLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TbigintShiftValueLogicalFunction.hpp create mode 100644 nes-logical-operators/src/Functions/Meos/TbigintScaleValueLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TbigintShiftScaleValueLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TbigintShiftValueLogicalFunction.cpp create mode 100644 nes-physical-operators/include/Functions/Meos/TbigintScaleValuePhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TbigintShiftScaleValuePhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TbigintShiftValuePhysicalFunction.hpp create mode 100644 nes-physical-operators/src/Functions/Meos/TbigintScaleValuePhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TbigintShiftScaleValuePhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TbigintShiftValuePhysicalFunction.cpp diff --git a/nes-logical-operators/include/Functions/Meos/TbigintScaleValueLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TbigintScaleValueLogicalFunction.hpp new file mode 100644 index 0000000000..5bac4a42f7 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TbigintScaleValueLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event tbigint_scale_value: scales a single-instant tbigint to a given int64_t width. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `tbigint_scale_value`. Takes (value:FLOAT64, ts:UINT64, width:FLOAT64→int64_t), + * constructs a single-instant temporal, applies the scale, and returns FLOAT64. + */ +class TbigintScaleValueLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TbigintScaleValue"; + + TbigintScaleValueLogicalFunction(LogicalFunction value, + LogicalFunction ts, + LogicalFunction width); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TbigintShiftScaleValueLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TbigintShiftScaleValueLogicalFunction.hpp new file mode 100644 index 0000000000..5dde046e33 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TbigintShiftScaleValueLogicalFunction.hpp @@ -0,0 +1,55 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event tbigint_shift_scale_value: shifts and scales a single-instant tbigint. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `tbigint_shift_scale_value`. Takes (value:FLOAT64, ts:UINT64, shift:FLOAT64→int64_t, width:FLOAT64→int64_t), + * constructs a single-instant temporal, applies the shift-and-scale, and returns FLOAT64. + */ +class TbigintShiftScaleValueLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TbigintShiftScaleValue"; + + TbigintShiftScaleValueLogicalFunction(LogicalFunction value, + LogicalFunction ts, + LogicalFunction shift, + LogicalFunction width); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TbigintShiftValueLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TbigintShiftValueLogicalFunction.hpp new file mode 100644 index 0000000000..0944b75091 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TbigintShiftValueLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event tbigint_shift_value: shifts a single-instant tbigint by a constant int64_t. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `tbigint_shift_value`. Takes (value:FLOAT64, ts:UINT64, shift:FLOAT64→int64_t), + * constructs a single-instant temporal, applies the shift, and returns FLOAT64. + */ +class TbigintShiftValueLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TbigintShiftValue"; + + TbigintShiftValueLogicalFunction(LogicalFunction value, + LogicalFunction ts, + LogicalFunction shift); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt index 58a9c60a18..dfd88823a8 100644 --- a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt @@ -51,6 +51,9 @@ add_plugin(TfloatShiftScaleValue LogicalFunction nes-logical-operators TfloatShi add_plugin(TfloatShiftValue LogicalFunction nes-logical-operators TfloatShiftValueLogicalFunction.cpp) add_plugin(TfloatSin LogicalFunction nes-logical-operators TfloatSinLogicalFunction.cpp) add_plugin(TfloatTan LogicalFunction nes-logical-operators TfloatTanLogicalFunction.cpp) +add_plugin(TbigintScaleValue LogicalFunction nes-logical-operators TbigintScaleValueLogicalFunction.cpp) +add_plugin(TbigintShiftScaleValue LogicalFunction nes-logical-operators TbigintShiftScaleValueLogicalFunction.cpp) +add_plugin(TbigintShiftValue LogicalFunction nes-logical-operators TbigintShiftValueLogicalFunction.cpp) add_plugin(TbigintToTfloat LogicalFunction nes-logical-operators TbigintToTfloatLogicalFunction.cpp) add_plugin(TbigintToTint LogicalFunction nes-logical-operators TbigintToTintLogicalFunction.cpp) add_plugin(TfloatToTbigint LogicalFunction nes-logical-operators TfloatToTbigintLogicalFunction.cpp) diff --git a/nes-logical-operators/src/Functions/Meos/TbigintScaleValueLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TbigintScaleValueLogicalFunction.cpp new file mode 100644 index 0000000000..e8e23a4277 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TbigintScaleValueLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TbigintScaleValueLogicalFunction::TbigintScaleValueLogicalFunction(LogicalFunction value, + LogicalFunction ts, + LogicalFunction width) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(width)); +} + +DataType TbigintScaleValueLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction TbigintScaleValueLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector TbigintScaleValueLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction TbigintScaleValueLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "TbigintScaleValueLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view TbigintScaleValueLogicalFunction::getType() const { return NAME; } + +bool TbigintScaleValueLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string TbigintScaleValueLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TbigintScaleValueLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction TbigintScaleValueLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTbigintScaleValueLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "TbigintScaleValueLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return TbigintScaleValueLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TbigintShiftScaleValueLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TbigintShiftScaleValueLogicalFunction.cpp new file mode 100644 index 0000000000..ea572eba5d --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TbigintShiftScaleValueLogicalFunction.cpp @@ -0,0 +1,108 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TbigintShiftScaleValueLogicalFunction::TbigintShiftScaleValueLogicalFunction(LogicalFunction value, + LogicalFunction ts, + LogicalFunction shift, + LogicalFunction width) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(4); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(shift)); + parameters.push_back(std::move(width)); +} + +DataType TbigintShiftScaleValueLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction TbigintShiftScaleValueLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector TbigintShiftScaleValueLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction TbigintShiftScaleValueLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 4, "TbigintShiftScaleValueLogicalFunction requires 4 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view TbigintShiftScaleValueLogicalFunction::getType() const { return NAME; } + +bool TbigintShiftScaleValueLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string TbigintShiftScaleValueLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TbigintShiftScaleValueLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction TbigintShiftScaleValueLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTbigintShiftScaleValueLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 4, + "TbigintShiftScaleValueLogicalFunction requires 4 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + return TbigintShiftScaleValueLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TbigintShiftValueLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TbigintShiftValueLogicalFunction.cpp new file mode 100644 index 0000000000..090ac77e50 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TbigintShiftValueLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TbigintShiftValueLogicalFunction::TbigintShiftValueLogicalFunction(LogicalFunction value, + LogicalFunction ts, + LogicalFunction shift) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(shift)); +} + +DataType TbigintShiftValueLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction TbigintShiftValueLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector TbigintShiftValueLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction TbigintShiftValueLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "TbigintShiftValueLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view TbigintShiftValueLogicalFunction::getType() const { return NAME; } + +bool TbigintShiftValueLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string TbigintShiftValueLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TbigintShiftValueLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction TbigintShiftValueLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTbigintShiftValueLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "TbigintShiftValueLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return TbigintShiftValueLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TbigintScaleValuePhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TbigintScaleValuePhysicalFunction.hpp new file mode 100644 index 0000000000..5965e5c4dc --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TbigintScaleValuePhysicalFunction.hpp @@ -0,0 +1,44 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `tbigint_scale_value`. + * + * Per-event tbigint_scale_value: scales the value span of a single-instant tbigint + * to a given int64_t width. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TbigintScaleValuePhysicalFunction : public PhysicalFunctionConcept { +public: + TbigintScaleValuePhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction, + PhysicalFunction widthFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TbigintShiftScaleValuePhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TbigintShiftScaleValuePhysicalFunction.hpp new file mode 100644 index 0000000000..63758b98e2 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TbigintShiftScaleValuePhysicalFunction.hpp @@ -0,0 +1,45 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `tbigint_shift_scale_value`. + * + * Per-event tbigint_shift_scale_value: shifts the value span of a single-instant + * tbigint by a constant int64_t and scales it to the given int64_t width. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TbigintShiftScaleValuePhysicalFunction : public PhysicalFunctionConcept { +public: + TbigintShiftScaleValuePhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction, + PhysicalFunction shiftFunction, + PhysicalFunction widthFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TbigintShiftValuePhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TbigintShiftValuePhysicalFunction.hpp new file mode 100644 index 0000000000..7acf342692 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TbigintShiftValuePhysicalFunction.hpp @@ -0,0 +1,44 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `tbigint_shift_value`. + * + * Per-event tbigint_shift_value: shifts the value span of a single-instant tbigint + * by a constant int64_t. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TbigintShiftValuePhysicalFunction : public PhysicalFunctionConcept { +public: + TbigintShiftValuePhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction, + PhysicalFunction shiftFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt index 96feed49a1..0f6b6edc49 100644 --- a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt @@ -50,6 +50,9 @@ add_plugin(TfloatShiftScaleValue PhysicalFunction nes-physical-operators TfloatS add_plugin(TfloatShiftValue PhysicalFunction nes-physical-operators TfloatShiftValuePhysicalFunction.cpp) add_plugin(TfloatSin PhysicalFunction nes-physical-operators TfloatSinPhysicalFunction.cpp) add_plugin(TfloatTan PhysicalFunction nes-physical-operators TfloatTanPhysicalFunction.cpp) +add_plugin(TbigintScaleValue PhysicalFunction nes-physical-operators TbigintScaleValuePhysicalFunction.cpp) +add_plugin(TbigintShiftScaleValue PhysicalFunction nes-physical-operators TbigintShiftScaleValuePhysicalFunction.cpp) +add_plugin(TbigintShiftValue PhysicalFunction nes-physical-operators TbigintShiftValuePhysicalFunction.cpp) add_plugin(TbigintToTfloat PhysicalFunction nes-physical-operators TbigintToTfloatPhysicalFunction.cpp) add_plugin(TbigintToTint PhysicalFunction nes-physical-operators TbigintToTintPhysicalFunction.cpp) add_plugin(TfloatToTbigint PhysicalFunction nes-physical-operators TfloatToTbigintPhysicalFunction.cpp) diff --git a/nes-physical-operators/src/Functions/Meos/TbigintScaleValuePhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TbigintScaleValuePhysicalFunction.cpp new file mode 100644 index 0000000000..dc8c1fcfd9 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TbigintScaleValuePhysicalFunction.cpp @@ -0,0 +1,91 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +TbigintScaleValuePhysicalFunction::TbigintScaleValuePhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction, + PhysicalFunction widthFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(widthFunction)); +} + +VarVal TbigintScaleValuePhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto ts = parameterValues[1].cast>(); + auto width = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double value, uint64_t ts, double width_d) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string tempWkt = fmt::format("{}@{}", static_cast(value), MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tbigint_in(tempWkt.c_str()); + if (!temp) return 0.0; + Temporal* res = tbigint_scale_value(temp, static_cast(width_d)); + free(temp); + if (!res) return 0.0; + double r = static_cast(tbigint_start_value(res)); + free(res); + return r; + } catch (const std::exception&) { return 0.0; } + }, + value, ts, width); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTbigintScaleValuePhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "TbigintScaleValuePhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return TbigintScaleValuePhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TbigintShiftScaleValuePhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TbigintShiftScaleValuePhysicalFunction.cpp new file mode 100644 index 0000000000..b0e2632357 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TbigintShiftScaleValuePhysicalFunction.cpp @@ -0,0 +1,95 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +TbigintShiftScaleValuePhysicalFunction::TbigintShiftScaleValuePhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction, + PhysicalFunction shiftFunction, + PhysicalFunction widthFunction) +{ + parameterFunctions.reserve(4); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(shiftFunction)); + parameterFunctions.push_back(std::move(widthFunction)); +} + +VarVal TbigintShiftScaleValuePhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto ts = parameterValues[1].cast>(); + auto shift = parameterValues[2].cast>(); + auto width = parameterValues[3].cast>(); + + const auto result = nautilus::invoke( + +[](double value, uint64_t ts, double shift_d, double width_d) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string tempWkt = fmt::format("{}@{}", static_cast(value), MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tbigint_in(tempWkt.c_str()); + if (!temp) return 0.0; + Temporal* res = tbigint_shift_scale_value(temp, static_cast(shift_d), static_cast(width_d)); + free(temp); + if (!res) return 0.0; + double r = static_cast(tbigint_start_value(res)); + free(res); + return r; + } catch (const std::exception&) { return 0.0; } + }, + value, ts, shift, width); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTbigintShiftScaleValuePhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 4, + "TbigintShiftScaleValuePhysicalFunction requires 4 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + return TbigintShiftScaleValuePhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TbigintShiftValuePhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TbigintShiftValuePhysicalFunction.cpp new file mode 100644 index 0000000000..c2d8da4f88 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TbigintShiftValuePhysicalFunction.cpp @@ -0,0 +1,91 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +TbigintShiftValuePhysicalFunction::TbigintShiftValuePhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction, + PhysicalFunction shiftFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(shiftFunction)); +} + +VarVal TbigintShiftValuePhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto ts = parameterValues[1].cast>(); + auto shift = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double value, uint64_t ts, double shift_d) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string tempWkt = fmt::format("{}@{}", static_cast(value), MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tbigint_in(tempWkt.c_str()); + if (!temp) return 0.0; + Temporal* res = tbigint_shift_value(temp, static_cast(shift_d)); + free(temp); + if (!res) return 0.0; + double r = static_cast(tbigint_start_value(res)); + free(res); + return r; + } catch (const std::exception&) { return 0.0; } + }, + value, ts, shift); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTbigintShiftValuePhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "TbigintShiftValuePhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return TbigintShiftValuePhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-sql-parser/AntlrSQL.g4 b/nes-sql-parser/AntlrSQL.g4 index 390a9bf826..ed8e0abcec 100644 --- a/nes-sql-parser/AntlrSQL.g4 +++ b/nes-sql-parser/AntlrSQL.g4 @@ -295,7 +295,7 @@ timeUnit: MS timestampParameter: name=identifier; -functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | EDWITHIN_TGEO_GEO | TGEO_AT_STBOX | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_FLOOR | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS; +functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | EDWITHIN_TGEO_GEO | TGEO_AT_STBOX | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_FLOOR | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS; sinkClause: INTO sink (',' sink)*; @@ -504,6 +504,9 @@ SUB_TBIGINT_BIGINT: 'SUB_TBIGINT_BIGINT' | 'sub_tbigint_bigint'; SUB_TFLOAT_FLOAT: 'SUB_TFLOAT_FLOAT' | 'sub_tfloat_float'; SUB_TINT_INT: 'SUB_TINT_INT' | 'sub_tint_int'; SUB_TNUMBER_TNUMBER: 'SUB_TNUMBER_TNUMBER' | 'sub_tnumber_tnumber'; +TBIGINT_SCALE_VALUE: 'TBIGINT_SCALE_VALUE' | 'tbigint_scale_value'; +TBIGINT_SHIFT_SCALE_VALUE: 'TBIGINT_SHIFT_SCALE_VALUE' | 'tbigint_shift_scale_value'; +TBIGINT_SHIFT_VALUE: 'TBIGINT_SHIFT_VALUE' | 'tbigint_shift_value'; TBIGINT_TO_TFLOAT: 'TBIGINT_TO_TFLOAT' | 'tbigint_to_tfloat'; TBIGINT_TO_TINT: 'TBIGINT_TO_TINT' | 'tbigint_to_tint'; TDISTANCE_TFLOAT_FLOAT: 'TDISTANCE_TFLOAT_FLOAT' | 'tdistance_tfloat_float'; diff --git a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp index 065bc99553..4fab4d252e 100644 --- a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp +++ b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp @@ -85,6 +85,9 @@ #include #include #include +#include +#include +#include #include #include #include @@ -2060,6 +2063,94 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont } break; /* END CODEGEN PARSER GLUE: SUB_TNUMBER_TNUMBER */ + /* BEGIN CODEGEN PARSER GLUE: TBIGINT_SCALE_VALUE */ + case AntlrSQLLexer::TBIGINT_SCALE_VALUE: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("TBIGINT_SCALE_VALUE requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(TbigintScaleValueLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: TBIGINT_SCALE_VALUE */ + /* BEGIN CODEGEN PARSER GLUE: TBIGINT_SHIFT_SCALE_VALUE */ + case AntlrSQLLexer::TBIGINT_SHIFT_SCALE_VALUE: + { + const auto argCount = context->expression().size(); + if (argCount != 4) + throw InvalidQuerySyntax("TBIGINT_SHIFT_SCALE_VALUE requires exactly 4 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a3 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(TbigintShiftScaleValueLogicalFunction(a0, a1, a2, a3)); + } + break; + /* END CODEGEN PARSER GLUE: TBIGINT_SHIFT_SCALE_VALUE */ + /* BEGIN CODEGEN PARSER GLUE: TBIGINT_SHIFT_VALUE */ + case AntlrSQLLexer::TBIGINT_SHIFT_VALUE: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("TBIGINT_SHIFT_VALUE requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(TbigintShiftValueLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: TBIGINT_SHIFT_VALUE */ /* BEGIN CODEGEN PARSER GLUE: TBIGINT_TO_TFLOAT */ case AntlrSQLLexer::TBIGINT_TO_TFLOAT: { From 09eb3474aee3b0cd4e1b7dd3c168ea8f22b16dee Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Fri, 12 Jun 2026 06:39:52 +0200 Subject: [PATCH 15/96] feat(meos): add ADD/SUB/MUL/DIV_FLOAT_TFLOAT reversed NES operators (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. --- .../Meos/AddFloatTfloatLogicalFunction.hpp | 54 ++++++++ .../Meos/DivFloatTfloatLogicalFunction.hpp | 54 ++++++++ .../Meos/MulFloatTfloatLogicalFunction.hpp | 54 ++++++++ .../Meos/SubFloatTfloatLogicalFunction.hpp | 54 ++++++++ .../Meos/AddFloatTfloatLogicalFunction.cpp | 105 +++++++++++++++ .../src/Functions/Meos/CMakeLists.txt | 4 + .../Meos/DivFloatTfloatLogicalFunction.cpp | 105 +++++++++++++++ .../Meos/MulFloatTfloatLogicalFunction.cpp | 105 +++++++++++++++ .../Meos/SubFloatTfloatLogicalFunction.cpp | 105 +++++++++++++++ .../Meos/AddFloatTfloatPhysicalFunction.hpp | 43 +++++++ .../Meos/DivFloatTfloatPhysicalFunction.hpp | 43 +++++++ .../Meos/MulFloatTfloatPhysicalFunction.hpp | 43 +++++++ .../Meos/SubFloatTfloatPhysicalFunction.hpp | 43 +++++++ .../Meos/AddFloatTfloatPhysicalFunction.cpp | 91 +++++++++++++ .../src/Functions/Meos/CMakeLists.txt | 4 + .../Meos/DivFloatTfloatPhysicalFunction.cpp | 91 +++++++++++++ .../Meos/MulFloatTfloatPhysicalFunction.cpp | 91 +++++++++++++ .../Meos/SubFloatTfloatPhysicalFunction.cpp | 91 +++++++++++++ nes-sql-parser/AntlrSQL.g4 | 6 +- .../src/AntlrSQLQueryPlanCreator.cpp | 120 ++++++++++++++++++ 20 files changed, 1305 insertions(+), 1 deletion(-) create mode 100644 nes-logical-operators/include/Functions/Meos/AddFloatTfloatLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/DivFloatTfloatLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/MulFloatTfloatLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/SubFloatTfloatLogicalFunction.hpp create mode 100644 nes-logical-operators/src/Functions/Meos/AddFloatTfloatLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/DivFloatTfloatLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/MulFloatTfloatLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/SubFloatTfloatLogicalFunction.cpp create mode 100644 nes-physical-operators/include/Functions/Meos/AddFloatTfloatPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/DivFloatTfloatPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/MulFloatTfloatPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/SubFloatTfloatPhysicalFunction.hpp create mode 100644 nes-physical-operators/src/Functions/Meos/AddFloatTfloatPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/DivFloatTfloatPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/MulFloatTfloatPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/SubFloatTfloatPhysicalFunction.cpp diff --git a/nes-logical-operators/include/Functions/Meos/AddFloatTfloatLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AddFloatTfloatLogicalFunction.hpp new file mode 100644 index 0000000000..1454a1dc3a --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AddFloatTfloatLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event add_float_tfloat: adds a constant to a single-instant tfloat value. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `add_float_tfloat`. Takes (scalar:FLOAT64, value:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the addition, and returns FLOAT64. + */ +class AddFloatTfloatLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AddFloatTfloat"; + + AddFloatTfloatLogicalFunction(LogicalFunction scalar, + LogicalFunction value, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/DivFloatTfloatLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/DivFloatTfloatLogicalFunction.hpp new file mode 100644 index 0000000000..78060cbec2 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/DivFloatTfloatLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event div_float_tfloat: divides a constant by a single-instant tfloat value. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `div_float_tfloat`. Takes (scalar:FLOAT64, value:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the division, and returns FLOAT64. + */ +class DivFloatTfloatLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "DivFloatTfloat"; + + DivFloatTfloatLogicalFunction(LogicalFunction scalar, + LogicalFunction value, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/MulFloatTfloatLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/MulFloatTfloatLogicalFunction.hpp new file mode 100644 index 0000000000..c4f788803b --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/MulFloatTfloatLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event mul_float_tfloat: multiplies a constant by a single-instant tfloat value. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `mul_float_tfloat`. Takes (scalar:FLOAT64, value:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the multiplication, and returns FLOAT64. + */ +class MulFloatTfloatLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "MulFloatTfloat"; + + MulFloatTfloatLogicalFunction(LogicalFunction scalar, + LogicalFunction value, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/SubFloatTfloatLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/SubFloatTfloatLogicalFunction.hpp new file mode 100644 index 0000000000..a0ec1c5683 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/SubFloatTfloatLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event sub_float_tfloat: subtracts a single-instant tfloat value from a constant. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `sub_float_tfloat`. Takes (scalar:FLOAT64, value:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the subtraction, and returns FLOAT64. + */ +class SubFloatTfloatLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "SubFloatTfloat"; + + SubFloatTfloatLogicalFunction(LogicalFunction scalar, + LogicalFunction value, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AddFloatTfloatLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AddFloatTfloatLogicalFunction.cpp new file mode 100644 index 0000000000..80d3f44e21 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AddFloatTfloatLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AddFloatTfloatLogicalFunction::AddFloatTfloatLogicalFunction(LogicalFunction scalar, + LogicalFunction value, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(scalar)); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(ts)); +} + +DataType AddFloatTfloatLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AddFloatTfloatLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AddFloatTfloatLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AddFloatTfloatLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "AddFloatTfloatLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AddFloatTfloatLogicalFunction::getType() const { return NAME; } + +bool AddFloatTfloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AddFloatTfloatLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction AddFloatTfloatLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction AddFloatTfloatLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAddFloatTfloatLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "AddFloatTfloatLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return AddFloatTfloatLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt index dfd88823a8..1c4f89f633 100644 --- a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt @@ -24,6 +24,7 @@ add_plugin(TfloatDegrees LogicalFunction nes-logical-operators TfloatDegreesLogi add_plugin(TfloatFloor LogicalFunction nes-logical-operators TfloatFloorLogicalFunction.cpp) add_plugin(TfloatRadians LogicalFunction nes-logical-operators TfloatRadiansLogicalFunction.cpp) add_plugin(TfloatScaleValue LogicalFunction nes-logical-operators TfloatScaleValueLogicalFunction.cpp) +add_plugin(AddFloatTfloat LogicalFunction nes-logical-operators AddFloatTfloatLogicalFunction.cpp) add_plugin(AddTfloatFloat LogicalFunction nes-logical-operators AddTfloatFloatLogicalFunction.cpp) add_plugin(AddTbigintBigint LogicalFunction nes-logical-operators AddTbigintBigintLogicalFunction.cpp) add_plugin(AddTintInt LogicalFunction nes-logical-operators AddTintIntLogicalFunction.cpp) @@ -44,8 +45,11 @@ add_plugin(MulTnumberTnumber LogicalFunction nes-logical-operators MulTnumberTnu add_plugin(SubTbigintBigint LogicalFunction nes-logical-operators SubTbigintBigintLogicalFunction.cpp) add_plugin(SubTintInt LogicalFunction nes-logical-operators SubTintIntLogicalFunction.cpp) add_plugin(SubTnumberTnumber LogicalFunction nes-logical-operators SubTnumberTnumberLogicalFunction.cpp) +add_plugin(DivFloatTfloat LogicalFunction nes-logical-operators DivFloatTfloatLogicalFunction.cpp) add_plugin(DivTfloatFloat LogicalFunction nes-logical-operators DivTfloatFloatLogicalFunction.cpp) +add_plugin(MulFloatTfloat LogicalFunction nes-logical-operators MulFloatTfloatLogicalFunction.cpp) add_plugin(MulTfloatFloat LogicalFunction nes-logical-operators MulTfloatFloatLogicalFunction.cpp) +add_plugin(SubFloatTfloat LogicalFunction nes-logical-operators SubFloatTfloatLogicalFunction.cpp) add_plugin(SubTfloatFloat LogicalFunction nes-logical-operators SubTfloatFloatLogicalFunction.cpp) add_plugin(TfloatShiftScaleValue LogicalFunction nes-logical-operators TfloatShiftScaleValueLogicalFunction.cpp) add_plugin(TfloatShiftValue LogicalFunction nes-logical-operators TfloatShiftValueLogicalFunction.cpp) diff --git a/nes-logical-operators/src/Functions/Meos/DivFloatTfloatLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/DivFloatTfloatLogicalFunction.cpp new file mode 100644 index 0000000000..321d299422 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/DivFloatTfloatLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +DivFloatTfloatLogicalFunction::DivFloatTfloatLogicalFunction(LogicalFunction scalar, + LogicalFunction value, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(scalar)); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(ts)); +} + +DataType DivFloatTfloatLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction DivFloatTfloatLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector DivFloatTfloatLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction DivFloatTfloatLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "DivFloatTfloatLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view DivFloatTfloatLogicalFunction::getType() const { return NAME; } + +bool DivFloatTfloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string DivFloatTfloatLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction DivFloatTfloatLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction DivFloatTfloatLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterDivFloatTfloatLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "DivFloatTfloatLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return DivFloatTfloatLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/MulFloatTfloatLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/MulFloatTfloatLogicalFunction.cpp new file mode 100644 index 0000000000..7a38b56a88 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/MulFloatTfloatLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +MulFloatTfloatLogicalFunction::MulFloatTfloatLogicalFunction(LogicalFunction scalar, + LogicalFunction value, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(scalar)); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(ts)); +} + +DataType MulFloatTfloatLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction MulFloatTfloatLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector MulFloatTfloatLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction MulFloatTfloatLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "MulFloatTfloatLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view MulFloatTfloatLogicalFunction::getType() const { return NAME; } + +bool MulFloatTfloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string MulFloatTfloatLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction MulFloatTfloatLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction MulFloatTfloatLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterMulFloatTfloatLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "MulFloatTfloatLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return MulFloatTfloatLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/SubFloatTfloatLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/SubFloatTfloatLogicalFunction.cpp new file mode 100644 index 0000000000..30d298ffb2 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/SubFloatTfloatLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +SubFloatTfloatLogicalFunction::SubFloatTfloatLogicalFunction(LogicalFunction scalar, + LogicalFunction value, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(scalar)); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(ts)); +} + +DataType SubFloatTfloatLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction SubFloatTfloatLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector SubFloatTfloatLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction SubFloatTfloatLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "SubFloatTfloatLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view SubFloatTfloatLogicalFunction::getType() const { return NAME; } + +bool SubFloatTfloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string SubFloatTfloatLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction SubFloatTfloatLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction SubFloatTfloatLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterSubFloatTfloatLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "SubFloatTfloatLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return SubFloatTfloatLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AddFloatTfloatPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AddFloatTfloatPhysicalFunction.hpp new file mode 100644 index 0000000000..8c37def1c6 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AddFloatTfloatPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `add_float_tfloat`. + * + * Per-event add_float_tfloat: adds a constant to a single-instant tfloat value. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class AddFloatTfloatPhysicalFunction : public PhysicalFunctionConcept { +public: + AddFloatTfloatPhysicalFunction(PhysicalFunction scalarFunction, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/DivFloatTfloatPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/DivFloatTfloatPhysicalFunction.hpp new file mode 100644 index 0000000000..3ac3044b9b --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/DivFloatTfloatPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `div_float_tfloat`. + * + * Per-event div_float_tfloat: divides a constant by a single-instant tfloat value. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class DivFloatTfloatPhysicalFunction : public PhysicalFunctionConcept { +public: + DivFloatTfloatPhysicalFunction(PhysicalFunction scalarFunction, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/MulFloatTfloatPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/MulFloatTfloatPhysicalFunction.hpp new file mode 100644 index 0000000000..c9b029f509 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/MulFloatTfloatPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `mul_float_tfloat`. + * + * Per-event mul_float_tfloat: multiplies a constant by a single-instant tfloat value. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class MulFloatTfloatPhysicalFunction : public PhysicalFunctionConcept { +public: + MulFloatTfloatPhysicalFunction(PhysicalFunction scalarFunction, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/SubFloatTfloatPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/SubFloatTfloatPhysicalFunction.hpp new file mode 100644 index 0000000000..bc997c36cc --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/SubFloatTfloatPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `sub_float_tfloat`. + * + * Per-event sub_float_tfloat: subtracts a single-instant tfloat value from a constant. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class SubFloatTfloatPhysicalFunction : public PhysicalFunctionConcept { +public: + SubFloatTfloatPhysicalFunction(PhysicalFunction scalarFunction, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AddFloatTfloatPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AddFloatTfloatPhysicalFunction.cpp new file mode 100644 index 0000000000..50cf48bbf9 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AddFloatTfloatPhysicalFunction.cpp @@ -0,0 +1,91 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +AddFloatTfloatPhysicalFunction::AddFloatTfloatPhysicalFunction(PhysicalFunction scalarFunction, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(scalarFunction)); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal AddFloatTfloatPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto scalar = parameterValues[0].cast>(); + auto value = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double scalar, double value, uint64_t ts) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string tempWkt = fmt::format("{}@{}", value, MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tfloat_in(tempWkt.c_str()); + if (!temp) return 0.0; + Temporal* res = add_float_tfloat(scalar, temp); + free(temp); + if (!res) return 0.0; + double r = tfloat_start_value(res); + free(res); + return r; + } catch (const std::exception&) { return 0.0; } + }, + scalar, value, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAddFloatTfloatPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "AddFloatTfloatPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return AddFloatTfloatPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt index 0f6b6edc49..68e4937d0f 100644 --- a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt @@ -23,6 +23,7 @@ add_plugin(TfloatDegrees PhysicalFunction nes-physical-operators TfloatDegreesPh add_plugin(TfloatFloor PhysicalFunction nes-physical-operators TfloatFloorPhysicalFunction.cpp) add_plugin(TfloatRadians PhysicalFunction nes-physical-operators TfloatRadiansPhysicalFunction.cpp) add_plugin(TfloatScaleValue PhysicalFunction nes-physical-operators TfloatScaleValuePhysicalFunction.cpp) +add_plugin(AddFloatTfloat PhysicalFunction nes-physical-operators AddFloatTfloatPhysicalFunction.cpp) add_plugin(AddTfloatFloat PhysicalFunction nes-physical-operators AddTfloatFloatPhysicalFunction.cpp) add_plugin(AddTbigintBigint PhysicalFunction nes-physical-operators AddTbigintBigintPhysicalFunction.cpp) add_plugin(AddTintInt PhysicalFunction nes-physical-operators AddTintIntPhysicalFunction.cpp) @@ -43,8 +44,11 @@ add_plugin(MulTnumberTnumber PhysicalFunction nes-physical-operators MulTnumberT add_plugin(SubTbigintBigint PhysicalFunction nes-physical-operators SubTbigintBigintPhysicalFunction.cpp) add_plugin(SubTintInt PhysicalFunction nes-physical-operators SubTintIntPhysicalFunction.cpp) add_plugin(SubTnumberTnumber PhysicalFunction nes-physical-operators SubTnumberTnumberPhysicalFunction.cpp) +add_plugin(DivFloatTfloat PhysicalFunction nes-physical-operators DivFloatTfloatPhysicalFunction.cpp) add_plugin(DivTfloatFloat PhysicalFunction nes-physical-operators DivTfloatFloatPhysicalFunction.cpp) +add_plugin(MulFloatTfloat PhysicalFunction nes-physical-operators MulFloatTfloatPhysicalFunction.cpp) add_plugin(MulTfloatFloat PhysicalFunction nes-physical-operators MulTfloatFloatPhysicalFunction.cpp) +add_plugin(SubFloatTfloat PhysicalFunction nes-physical-operators SubFloatTfloatPhysicalFunction.cpp) add_plugin(SubTfloatFloat PhysicalFunction nes-physical-operators SubTfloatFloatPhysicalFunction.cpp) add_plugin(TfloatShiftScaleValue PhysicalFunction nes-physical-operators TfloatShiftScaleValuePhysicalFunction.cpp) add_plugin(TfloatShiftValue PhysicalFunction nes-physical-operators TfloatShiftValuePhysicalFunction.cpp) diff --git a/nes-physical-operators/src/Functions/Meos/DivFloatTfloatPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/DivFloatTfloatPhysicalFunction.cpp new file mode 100644 index 0000000000..f920a90108 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/DivFloatTfloatPhysicalFunction.cpp @@ -0,0 +1,91 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +DivFloatTfloatPhysicalFunction::DivFloatTfloatPhysicalFunction(PhysicalFunction scalarFunction, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(scalarFunction)); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal DivFloatTfloatPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto scalar = parameterValues[0].cast>(); + auto value = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double scalar, double value, uint64_t ts) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string tempWkt = fmt::format("{}@{}", value, MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tfloat_in(tempWkt.c_str()); + if (!temp) return 0.0; + Temporal* res = div_float_tfloat(scalar, temp); + free(temp); + if (!res) return 0.0; + double r = tfloat_start_value(res); + free(res); + return r; + } catch (const std::exception&) { return 0.0; } + }, + scalar, value, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterDivFloatTfloatPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "DivFloatTfloatPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return DivFloatTfloatPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/MulFloatTfloatPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/MulFloatTfloatPhysicalFunction.cpp new file mode 100644 index 0000000000..94fe98aa57 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/MulFloatTfloatPhysicalFunction.cpp @@ -0,0 +1,91 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +MulFloatTfloatPhysicalFunction::MulFloatTfloatPhysicalFunction(PhysicalFunction scalarFunction, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(scalarFunction)); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal MulFloatTfloatPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto scalar = parameterValues[0].cast>(); + auto value = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double scalar, double value, uint64_t ts) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string tempWkt = fmt::format("{}@{}", value, MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tfloat_in(tempWkt.c_str()); + if (!temp) return 0.0; + Temporal* res = mul_float_tfloat(scalar, temp); + free(temp); + if (!res) return 0.0; + double r = tfloat_start_value(res); + free(res); + return r; + } catch (const std::exception&) { return 0.0; } + }, + scalar, value, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterMulFloatTfloatPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "MulFloatTfloatPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return MulFloatTfloatPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/SubFloatTfloatPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/SubFloatTfloatPhysicalFunction.cpp new file mode 100644 index 0000000000..1f4e5254ac --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/SubFloatTfloatPhysicalFunction.cpp @@ -0,0 +1,91 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +SubFloatTfloatPhysicalFunction::SubFloatTfloatPhysicalFunction(PhysicalFunction scalarFunction, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(scalarFunction)); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal SubFloatTfloatPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto scalar = parameterValues[0].cast>(); + auto value = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double scalar, double value, uint64_t ts) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string tempWkt = fmt::format("{}@{}", value, MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tfloat_in(tempWkt.c_str()); + if (!temp) return 0.0; + Temporal* res = sub_float_tfloat(scalar, temp); + free(temp); + if (!res) return 0.0; + double r = tfloat_start_value(res); + free(res); + return r; + } catch (const std::exception&) { return 0.0; } + }, + scalar, value, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterSubFloatTfloatPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "SubFloatTfloatPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return SubFloatTfloatPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-sql-parser/AntlrSQL.g4 b/nes-sql-parser/AntlrSQL.g4 index ed8e0abcec..674ef5c733 100644 --- a/nes-sql-parser/AntlrSQL.g4 +++ b/nes-sql-parser/AntlrSQL.g4 @@ -295,7 +295,7 @@ timeUnit: MS timestampParameter: name=identifier; -functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | EDWITHIN_TGEO_GEO | TGEO_AT_STBOX | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_FLOOR | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS; +functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | EDWITHIN_TGEO_GEO | TGEO_AT_STBOX | ADD_FLOAT_TFLOAT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_FLOAT_TFLOAT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_FLOAT_TFLOAT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_FLOAT_TFLOAT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_FLOOR | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS; sinkClause: INTO sink (',' sink)*; @@ -488,18 +488,22 @@ TEMPORAL_AINTERSECTS_GEOMETRY: 'TEMPORAL_AINTERSECTS_GEOMETRY' | 'temporal_ainte TEMPORAL_ECONTAINS_GEOMETRY: 'TEMPORAL_ECONTAINS_GEOMETRY' | 'temporal_econtains_geometry'; EDWITHIN_TGEO_GEO: 'EDWITHIN_TGEO_GEO' | 'edwithin_tgeo_geo'; TGEO_AT_STBOX: 'TGEO_AT_STBOX' | 'tgeo_at_stbox'; +ADD_FLOAT_TFLOAT: 'ADD_FLOAT_TFLOAT' | 'add_float_tfloat'; ADD_TBIGINT_BIGINT: 'ADD_TBIGINT_BIGINT' | 'add_tbigint_bigint'; ADD_TFLOAT_FLOAT: 'ADD_TFLOAT_FLOAT' | 'add_tfloat_float'; ADD_TINT_INT: 'ADD_TINT_INT' | 'add_tint_int'; ADD_TNUMBER_TNUMBER: 'ADD_TNUMBER_TNUMBER' | 'add_tnumber_tnumber'; +DIV_FLOAT_TFLOAT: 'DIV_FLOAT_TFLOAT' | 'div_float_tfloat'; DIV_TBIGINT_BIGINT: 'DIV_TBIGINT_BIGINT' | 'div_tbigint_bigint'; DIV_TFLOAT_FLOAT: 'DIV_TFLOAT_FLOAT' | 'div_tfloat_float'; DIV_TINT_INT: 'DIV_TINT_INT' | 'div_tint_int'; DIV_TNUMBER_TNUMBER: 'DIV_TNUMBER_TNUMBER' | 'div_tnumber_tnumber'; +MUL_FLOAT_TFLOAT: 'MUL_FLOAT_TFLOAT' | 'mul_float_tfloat'; MUL_TBIGINT_BIGINT: 'MUL_TBIGINT_BIGINT' | 'mul_tbigint_bigint'; MUL_TFLOAT_FLOAT: 'MUL_TFLOAT_FLOAT' | 'mul_tfloat_float'; MUL_TINT_INT: 'MUL_TINT_INT' | 'mul_tint_int'; MUL_TNUMBER_TNUMBER: 'MUL_TNUMBER_TNUMBER' | 'mul_tnumber_tnumber'; +SUB_FLOAT_TFLOAT: 'SUB_FLOAT_TFLOAT' | 'sub_float_tfloat'; SUB_TBIGINT_BIGINT: 'SUB_TBIGINT_BIGINT' | 'sub_tbigint_bigint'; SUB_TFLOAT_FLOAT: 'SUB_TFLOAT_FLOAT' | 'sub_tfloat_float'; SUB_TINT_INT: 'SUB_TINT_INT' | 'sub_tint_int'; diff --git a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp index 4fab4d252e..06f381369f 100644 --- a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp +++ b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp @@ -69,18 +69,22 @@ #include #include #include +#include #include #include #include #include +#include #include #include #include #include +#include #include #include #include #include +#include #include #include #include @@ -1598,6 +1602,35 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont } break; /* END CODEGEN PARSER GLUE: TNUMBER_ABS */ + /* BEGIN CODEGEN PARSER GLUE: ADD_FLOAT_TFLOAT */ + case AntlrSQLLexer::ADD_FLOAT_TFLOAT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("ADD_FLOAT_TFLOAT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AddFloatTfloatLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: ADD_FLOAT_TFLOAT */ /* BEGIN CODEGEN PARSER GLUE: ADD_TFLOAT_FLOAT */ case AntlrSQLLexer::ADD_TFLOAT_FLOAT: { @@ -1627,6 +1660,35 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont } break; /* END CODEGEN PARSER GLUE: ADD_TFLOAT_FLOAT */ + /* BEGIN CODEGEN PARSER GLUE: DIV_FLOAT_TFLOAT */ + case AntlrSQLLexer::DIV_FLOAT_TFLOAT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("DIV_FLOAT_TFLOAT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(DivFloatTfloatLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: DIV_FLOAT_TFLOAT */ /* BEGIN CODEGEN PARSER GLUE: DIV_TFLOAT_FLOAT */ case AntlrSQLLexer::DIV_TFLOAT_FLOAT: { @@ -1656,6 +1718,35 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont } break; /* END CODEGEN PARSER GLUE: DIV_TFLOAT_FLOAT */ + /* BEGIN CODEGEN PARSER GLUE: MUL_FLOAT_TFLOAT */ + case AntlrSQLLexer::MUL_FLOAT_TFLOAT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("MUL_FLOAT_TFLOAT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(MulFloatTfloatLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: MUL_FLOAT_TFLOAT */ /* BEGIN CODEGEN PARSER GLUE: MUL_TFLOAT_FLOAT */ case AntlrSQLLexer::MUL_TFLOAT_FLOAT: { @@ -1685,6 +1776,35 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont } break; /* END CODEGEN PARSER GLUE: MUL_TFLOAT_FLOAT */ + /* BEGIN CODEGEN PARSER GLUE: SUB_FLOAT_TFLOAT */ + case AntlrSQLLexer::SUB_FLOAT_TFLOAT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("SUB_FLOAT_TFLOAT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(SubFloatTfloatLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: SUB_FLOAT_TFLOAT */ /* BEGIN CODEGEN PARSER GLUE: SUB_TFLOAT_FLOAT */ case AntlrSQLLexer::SUB_TFLOAT_FLOAT: { From e7a09dc598f6576734f94dc4babdb32c694e6c25 Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Fri, 12 Jun 2026 06:46:22 +0200 Subject: [PATCH 16/96] feat(meos): add ADD/SUB/MUL/DIV_INT_TINT reversed NES operators (W58) 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. --- .../Meos/AddIntTintLogicalFunction.hpp | 54 ++++++++ .../Meos/DivIntTintLogicalFunction.hpp | 54 ++++++++ .../Meos/MulIntTintLogicalFunction.hpp | 54 ++++++++ .../Meos/SubIntTintLogicalFunction.hpp | 54 ++++++++ .../Meos/AddIntTintLogicalFunction.cpp | 105 +++++++++++++++ .../src/Functions/Meos/CMakeLists.txt | 4 + .../Meos/DivIntTintLogicalFunction.cpp | 105 +++++++++++++++ .../Meos/MulIntTintLogicalFunction.cpp | 105 +++++++++++++++ .../Meos/SubIntTintLogicalFunction.cpp | 105 +++++++++++++++ .../Meos/AddIntTintPhysicalFunction.hpp | 43 +++++++ .../Meos/DivIntTintPhysicalFunction.hpp | 43 +++++++ .../Meos/MulIntTintPhysicalFunction.hpp | 43 +++++++ .../Meos/SubIntTintPhysicalFunction.hpp | 43 +++++++ .../Meos/AddIntTintPhysicalFunction.cpp | 91 +++++++++++++ .../src/Functions/Meos/CMakeLists.txt | 4 + .../Meos/DivIntTintPhysicalFunction.cpp | 91 +++++++++++++ .../Meos/MulIntTintPhysicalFunction.cpp | 91 +++++++++++++ .../Meos/SubIntTintPhysicalFunction.cpp | 91 +++++++++++++ nes-sql-parser/AntlrSQL.g4 | 6 +- .../src/AntlrSQLQueryPlanCreator.cpp | 120 ++++++++++++++++++ 20 files changed, 1305 insertions(+), 1 deletion(-) create mode 100644 nes-logical-operators/include/Functions/Meos/AddIntTintLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/DivIntTintLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/MulIntTintLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/SubIntTintLogicalFunction.hpp create mode 100644 nes-logical-operators/src/Functions/Meos/AddIntTintLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/DivIntTintLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/MulIntTintLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/SubIntTintLogicalFunction.cpp create mode 100644 nes-physical-operators/include/Functions/Meos/AddIntTintPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/DivIntTintPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/MulIntTintPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/SubIntTintPhysicalFunction.hpp create mode 100644 nes-physical-operators/src/Functions/Meos/AddIntTintPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/DivIntTintPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/MulIntTintPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/SubIntTintPhysicalFunction.cpp diff --git a/nes-logical-operators/include/Functions/Meos/AddIntTintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AddIntTintLogicalFunction.hpp new file mode 100644 index 0000000000..db3ef60e22 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AddIntTintLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event add_int_tint: adds a constant to a single-instant tint value. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `add_int_tint`. Takes (scalar:FLOAT64, value:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the addition, and returns FLOAT64. + */ +class AddIntTintLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AddIntTint"; + + AddIntTintLogicalFunction(LogicalFunction scalar, + LogicalFunction value, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/DivIntTintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/DivIntTintLogicalFunction.hpp new file mode 100644 index 0000000000..f48f877b8b --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/DivIntTintLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event div_int_tint: divides a constant by a single-instant tint value. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `div_int_tint`. Takes (scalar:FLOAT64, value:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the division, and returns FLOAT64. + */ +class DivIntTintLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "DivIntTint"; + + DivIntTintLogicalFunction(LogicalFunction scalar, + LogicalFunction value, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/MulIntTintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/MulIntTintLogicalFunction.hpp new file mode 100644 index 0000000000..a2f0f7f2b3 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/MulIntTintLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event mul_int_tint: multiplies a constant by a single-instant tint value. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `mul_int_tint`. Takes (scalar:FLOAT64, value:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the multiplication, and returns FLOAT64. + */ +class MulIntTintLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "MulIntTint"; + + MulIntTintLogicalFunction(LogicalFunction scalar, + LogicalFunction value, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/SubIntTintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/SubIntTintLogicalFunction.hpp new file mode 100644 index 0000000000..5e3f4a8c94 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/SubIntTintLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event sub_int_tint: subtracts a single-instant tint value from a constant. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `sub_int_tint`. Takes (scalar:FLOAT64, value:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the subtraction, and returns FLOAT64. + */ +class SubIntTintLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "SubIntTint"; + + SubIntTintLogicalFunction(LogicalFunction scalar, + LogicalFunction value, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AddIntTintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AddIntTintLogicalFunction.cpp new file mode 100644 index 0000000000..184848e839 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AddIntTintLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AddIntTintLogicalFunction::AddIntTintLogicalFunction(LogicalFunction scalar, + LogicalFunction value, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(scalar)); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(ts)); +} + +DataType AddIntTintLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AddIntTintLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AddIntTintLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AddIntTintLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "AddIntTintLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AddIntTintLogicalFunction::getType() const { return NAME; } + +bool AddIntTintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AddIntTintLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction AddIntTintLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction AddIntTintLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAddIntTintLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "AddIntTintLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return AddIntTintLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt index 1c4f89f633..b183f783d5 100644 --- a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt @@ -27,6 +27,7 @@ add_plugin(TfloatScaleValue LogicalFunction nes-logical-operators TfloatScaleVal add_plugin(AddFloatTfloat LogicalFunction nes-logical-operators AddFloatTfloatLogicalFunction.cpp) add_plugin(AddTfloatFloat LogicalFunction nes-logical-operators AddTfloatFloatLogicalFunction.cpp) add_plugin(AddTbigintBigint LogicalFunction nes-logical-operators AddTbigintBigintLogicalFunction.cpp) +add_plugin(AddIntTint LogicalFunction nes-logical-operators AddIntTintLogicalFunction.cpp) add_plugin(AddTintInt LogicalFunction nes-logical-operators AddTintIntLogicalFunction.cpp) add_plugin(AddTnumberTnumber LogicalFunction nes-logical-operators AddTnumberTnumberLogicalFunction.cpp) add_plugin(TdistanceTfloatFloat LogicalFunction nes-logical-operators TdistanceTfloatFloatLogicalFunction.cpp) @@ -37,12 +38,15 @@ add_plugin(TintScaleValue LogicalFunction nes-logical-operators TintScaleValueLo add_plugin(TintShiftScaleValue LogicalFunction nes-logical-operators TintShiftScaleValueLogicalFunction.cpp) add_plugin(TintShiftValue LogicalFunction nes-logical-operators TintShiftValueLogicalFunction.cpp) add_plugin(DivTbigintBigint LogicalFunction nes-logical-operators DivTbigintBigintLogicalFunction.cpp) +add_plugin(DivIntTint LogicalFunction nes-logical-operators DivIntTintLogicalFunction.cpp) add_plugin(DivTintInt LogicalFunction nes-logical-operators DivTintIntLogicalFunction.cpp) add_plugin(DivTnumberTnumber LogicalFunction nes-logical-operators DivTnumberTnumberLogicalFunction.cpp) add_plugin(MulTbigintBigint LogicalFunction nes-logical-operators MulTbigintBigintLogicalFunction.cpp) +add_plugin(MulIntTint LogicalFunction nes-logical-operators MulIntTintLogicalFunction.cpp) add_plugin(MulTintInt LogicalFunction nes-logical-operators MulTintIntLogicalFunction.cpp) add_plugin(MulTnumberTnumber LogicalFunction nes-logical-operators MulTnumberTnumberLogicalFunction.cpp) add_plugin(SubTbigintBigint LogicalFunction nes-logical-operators SubTbigintBigintLogicalFunction.cpp) +add_plugin(SubIntTint LogicalFunction nes-logical-operators SubIntTintLogicalFunction.cpp) add_plugin(SubTintInt LogicalFunction nes-logical-operators SubTintIntLogicalFunction.cpp) add_plugin(SubTnumberTnumber LogicalFunction nes-logical-operators SubTnumberTnumberLogicalFunction.cpp) add_plugin(DivFloatTfloat LogicalFunction nes-logical-operators DivFloatTfloatLogicalFunction.cpp) diff --git a/nes-logical-operators/src/Functions/Meos/DivIntTintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/DivIntTintLogicalFunction.cpp new file mode 100644 index 0000000000..5abd6ce582 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/DivIntTintLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +DivIntTintLogicalFunction::DivIntTintLogicalFunction(LogicalFunction scalar, + LogicalFunction value, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(scalar)); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(ts)); +} + +DataType DivIntTintLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction DivIntTintLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector DivIntTintLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction DivIntTintLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "DivIntTintLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view DivIntTintLogicalFunction::getType() const { return NAME; } + +bool DivIntTintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string DivIntTintLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction DivIntTintLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction DivIntTintLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterDivIntTintLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "DivIntTintLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return DivIntTintLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/MulIntTintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/MulIntTintLogicalFunction.cpp new file mode 100644 index 0000000000..6b5cc688ee --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/MulIntTintLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +MulIntTintLogicalFunction::MulIntTintLogicalFunction(LogicalFunction scalar, + LogicalFunction value, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(scalar)); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(ts)); +} + +DataType MulIntTintLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction MulIntTintLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector MulIntTintLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction MulIntTintLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "MulIntTintLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view MulIntTintLogicalFunction::getType() const { return NAME; } + +bool MulIntTintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string MulIntTintLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction MulIntTintLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction MulIntTintLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterMulIntTintLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "MulIntTintLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return MulIntTintLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/SubIntTintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/SubIntTintLogicalFunction.cpp new file mode 100644 index 0000000000..137088701d --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/SubIntTintLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +SubIntTintLogicalFunction::SubIntTintLogicalFunction(LogicalFunction scalar, + LogicalFunction value, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(scalar)); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(ts)); +} + +DataType SubIntTintLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction SubIntTintLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector SubIntTintLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction SubIntTintLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "SubIntTintLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view SubIntTintLogicalFunction::getType() const { return NAME; } + +bool SubIntTintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string SubIntTintLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction SubIntTintLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction SubIntTintLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterSubIntTintLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "SubIntTintLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return SubIntTintLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AddIntTintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AddIntTintPhysicalFunction.hpp new file mode 100644 index 0000000000..086b9058c2 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AddIntTintPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `add_int_tint`. + * + * Per-event add_int_tint: adds a constant to a single-instant tint value. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class AddIntTintPhysicalFunction : public PhysicalFunctionConcept { +public: + AddIntTintPhysicalFunction(PhysicalFunction scalarFunction, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/DivIntTintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/DivIntTintPhysicalFunction.hpp new file mode 100644 index 0000000000..e368a96708 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/DivIntTintPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `div_int_tint`. + * + * Per-event div_int_tint: divides a constant by a single-instant tint value. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class DivIntTintPhysicalFunction : public PhysicalFunctionConcept { +public: + DivIntTintPhysicalFunction(PhysicalFunction scalarFunction, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/MulIntTintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/MulIntTintPhysicalFunction.hpp new file mode 100644 index 0000000000..c5799619f8 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/MulIntTintPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `mul_int_tint`. + * + * Per-event mul_int_tint: multiplies a constant by a single-instant tint value. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class MulIntTintPhysicalFunction : public PhysicalFunctionConcept { +public: + MulIntTintPhysicalFunction(PhysicalFunction scalarFunction, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/SubIntTintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/SubIntTintPhysicalFunction.hpp new file mode 100644 index 0000000000..051774283e --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/SubIntTintPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `sub_int_tint`. + * + * Per-event sub_int_tint: subtracts a single-instant tint value from a constant. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class SubIntTintPhysicalFunction : public PhysicalFunctionConcept { +public: + SubIntTintPhysicalFunction(PhysicalFunction scalarFunction, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AddIntTintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AddIntTintPhysicalFunction.cpp new file mode 100644 index 0000000000..f6cb83b692 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AddIntTintPhysicalFunction.cpp @@ -0,0 +1,91 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +AddIntTintPhysicalFunction::AddIntTintPhysicalFunction(PhysicalFunction scalarFunction, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(scalarFunction)); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal AddIntTintPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto scalar = parameterValues[0].cast>(); + auto value = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double scalar_d, double value_d, uint64_t ts) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string tempWkt = fmt::format("{}@{}", static_cast(value_d), MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tint_in(tempWkt.c_str()); + if (!temp) return 0.0; + Temporal* res = add_int_tint(static_cast(scalar_d), temp); + free(temp); + if (!res) return 0.0; + double r = static_cast(tint_start_value(res)); + free(res); + return r; + } catch (const std::exception&) { return 0.0; } + }, + scalar, value, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAddIntTintPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "AddIntTintPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return AddIntTintPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt index 68e4937d0f..d6ede70801 100644 --- a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt @@ -26,6 +26,7 @@ add_plugin(TfloatScaleValue PhysicalFunction nes-physical-operators TfloatScaleV add_plugin(AddFloatTfloat PhysicalFunction nes-physical-operators AddFloatTfloatPhysicalFunction.cpp) add_plugin(AddTfloatFloat PhysicalFunction nes-physical-operators AddTfloatFloatPhysicalFunction.cpp) add_plugin(AddTbigintBigint PhysicalFunction nes-physical-operators AddTbigintBigintPhysicalFunction.cpp) +add_plugin(AddIntTint PhysicalFunction nes-physical-operators AddIntTintPhysicalFunction.cpp) add_plugin(AddTintInt PhysicalFunction nes-physical-operators AddTintIntPhysicalFunction.cpp) add_plugin(AddTnumberTnumber PhysicalFunction nes-physical-operators AddTnumberTnumberPhysicalFunction.cpp) add_plugin(TdistanceTfloatFloat PhysicalFunction nes-physical-operators TdistanceTfloatFloatPhysicalFunction.cpp) @@ -36,12 +37,15 @@ add_plugin(TintScaleValue PhysicalFunction nes-physical-operators TintScaleValue add_plugin(TintShiftScaleValue PhysicalFunction nes-physical-operators TintShiftScaleValuePhysicalFunction.cpp) add_plugin(TintShiftValue PhysicalFunction nes-physical-operators TintShiftValuePhysicalFunction.cpp) add_plugin(DivTbigintBigint PhysicalFunction nes-physical-operators DivTbigintBigintPhysicalFunction.cpp) +add_plugin(DivIntTint PhysicalFunction nes-physical-operators DivIntTintPhysicalFunction.cpp) add_plugin(DivTintInt PhysicalFunction nes-physical-operators DivTintIntPhysicalFunction.cpp) add_plugin(DivTnumberTnumber PhysicalFunction nes-physical-operators DivTnumberTnumberPhysicalFunction.cpp) add_plugin(MulTbigintBigint PhysicalFunction nes-physical-operators MulTbigintBigintPhysicalFunction.cpp) +add_plugin(MulIntTint PhysicalFunction nes-physical-operators MulIntTintPhysicalFunction.cpp) add_plugin(MulTintInt PhysicalFunction nes-physical-operators MulTintIntPhysicalFunction.cpp) add_plugin(MulTnumberTnumber PhysicalFunction nes-physical-operators MulTnumberTnumberPhysicalFunction.cpp) add_plugin(SubTbigintBigint PhysicalFunction nes-physical-operators SubTbigintBigintPhysicalFunction.cpp) +add_plugin(SubIntTint PhysicalFunction nes-physical-operators SubIntTintPhysicalFunction.cpp) add_plugin(SubTintInt PhysicalFunction nes-physical-operators SubTintIntPhysicalFunction.cpp) add_plugin(SubTnumberTnumber PhysicalFunction nes-physical-operators SubTnumberTnumberPhysicalFunction.cpp) add_plugin(DivFloatTfloat PhysicalFunction nes-physical-operators DivFloatTfloatPhysicalFunction.cpp) diff --git a/nes-physical-operators/src/Functions/Meos/DivIntTintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/DivIntTintPhysicalFunction.cpp new file mode 100644 index 0000000000..d612334db7 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/DivIntTintPhysicalFunction.cpp @@ -0,0 +1,91 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +DivIntTintPhysicalFunction::DivIntTintPhysicalFunction(PhysicalFunction scalarFunction, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(scalarFunction)); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal DivIntTintPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto scalar = parameterValues[0].cast>(); + auto value = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double scalar_d, double value_d, uint64_t ts) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string tempWkt = fmt::format("{}@{}", static_cast(value_d), MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tint_in(tempWkt.c_str()); + if (!temp) return 0.0; + Temporal* res = div_int_tint(static_cast(scalar_d), temp); + free(temp); + if (!res) return 0.0; + double r = static_cast(tint_start_value(res)); + free(res); + return r; + } catch (const std::exception&) { return 0.0; } + }, + scalar, value, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterDivIntTintPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "DivIntTintPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return DivIntTintPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/MulIntTintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/MulIntTintPhysicalFunction.cpp new file mode 100644 index 0000000000..19b58599e9 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/MulIntTintPhysicalFunction.cpp @@ -0,0 +1,91 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +MulIntTintPhysicalFunction::MulIntTintPhysicalFunction(PhysicalFunction scalarFunction, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(scalarFunction)); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal MulIntTintPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto scalar = parameterValues[0].cast>(); + auto value = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double scalar_d, double value_d, uint64_t ts) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string tempWkt = fmt::format("{}@{}", static_cast(value_d), MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tint_in(tempWkt.c_str()); + if (!temp) return 0.0; + Temporal* res = mul_int_tint(static_cast(scalar_d), temp); + free(temp); + if (!res) return 0.0; + double r = static_cast(tint_start_value(res)); + free(res); + return r; + } catch (const std::exception&) { return 0.0; } + }, + scalar, value, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterMulIntTintPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "MulIntTintPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return MulIntTintPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/SubIntTintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/SubIntTintPhysicalFunction.cpp new file mode 100644 index 0000000000..07f4ec11c7 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/SubIntTintPhysicalFunction.cpp @@ -0,0 +1,91 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +SubIntTintPhysicalFunction::SubIntTintPhysicalFunction(PhysicalFunction scalarFunction, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(scalarFunction)); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal SubIntTintPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto scalar = parameterValues[0].cast>(); + auto value = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double scalar_d, double value_d, uint64_t ts) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string tempWkt = fmt::format("{}@{}", static_cast(value_d), MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tint_in(tempWkt.c_str()); + if (!temp) return 0.0; + Temporal* res = sub_int_tint(static_cast(scalar_d), temp); + free(temp); + if (!res) return 0.0; + double r = static_cast(tint_start_value(res)); + free(res); + return r; + } catch (const std::exception&) { return 0.0; } + }, + scalar, value, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterSubIntTintPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "SubIntTintPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return SubIntTintPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-sql-parser/AntlrSQL.g4 b/nes-sql-parser/AntlrSQL.g4 index 674ef5c733..e38329c1d3 100644 --- a/nes-sql-parser/AntlrSQL.g4 +++ b/nes-sql-parser/AntlrSQL.g4 @@ -295,7 +295,7 @@ timeUnit: MS timestampParameter: name=identifier; -functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | EDWITHIN_TGEO_GEO | TGEO_AT_STBOX | ADD_FLOAT_TFLOAT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_FLOAT_TFLOAT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_FLOAT_TFLOAT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_FLOAT_TFLOAT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_FLOOR | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS; +functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | EDWITHIN_TGEO_GEO | TGEO_AT_STBOX | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_FLOOR | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS; sinkClause: INTO sink (',' sink)*; @@ -491,21 +491,25 @@ TGEO_AT_STBOX: 'TGEO_AT_STBOX' | 'tgeo_at_stbox'; ADD_FLOAT_TFLOAT: 'ADD_FLOAT_TFLOAT' | 'add_float_tfloat'; ADD_TBIGINT_BIGINT: 'ADD_TBIGINT_BIGINT' | 'add_tbigint_bigint'; ADD_TFLOAT_FLOAT: 'ADD_TFLOAT_FLOAT' | 'add_tfloat_float'; +ADD_INT_TINT: 'ADD_INT_TINT' | 'add_int_tint'; ADD_TINT_INT: 'ADD_TINT_INT' | 'add_tint_int'; ADD_TNUMBER_TNUMBER: 'ADD_TNUMBER_TNUMBER' | 'add_tnumber_tnumber'; DIV_FLOAT_TFLOAT: 'DIV_FLOAT_TFLOAT' | 'div_float_tfloat'; DIV_TBIGINT_BIGINT: 'DIV_TBIGINT_BIGINT' | 'div_tbigint_bigint'; DIV_TFLOAT_FLOAT: 'DIV_TFLOAT_FLOAT' | 'div_tfloat_float'; +DIV_INT_TINT: 'DIV_INT_TINT' | 'div_int_tint'; DIV_TINT_INT: 'DIV_TINT_INT' | 'div_tint_int'; DIV_TNUMBER_TNUMBER: 'DIV_TNUMBER_TNUMBER' | 'div_tnumber_tnumber'; MUL_FLOAT_TFLOAT: 'MUL_FLOAT_TFLOAT' | 'mul_float_tfloat'; MUL_TBIGINT_BIGINT: 'MUL_TBIGINT_BIGINT' | 'mul_tbigint_bigint'; MUL_TFLOAT_FLOAT: 'MUL_TFLOAT_FLOAT' | 'mul_tfloat_float'; +MUL_INT_TINT: 'MUL_INT_TINT' | 'mul_int_tint'; MUL_TINT_INT: 'MUL_TINT_INT' | 'mul_tint_int'; MUL_TNUMBER_TNUMBER: 'MUL_TNUMBER_TNUMBER' | 'mul_tnumber_tnumber'; SUB_FLOAT_TFLOAT: 'SUB_FLOAT_TFLOAT' | 'sub_float_tfloat'; SUB_TBIGINT_BIGINT: 'SUB_TBIGINT_BIGINT' | 'sub_tbigint_bigint'; SUB_TFLOAT_FLOAT: 'SUB_TFLOAT_FLOAT' | 'sub_tfloat_float'; +SUB_INT_TINT: 'SUB_INT_TINT' | 'sub_int_tint'; SUB_TINT_INT: 'SUB_TINT_INT' | 'sub_tint_int'; SUB_TNUMBER_TNUMBER: 'SUB_TNUMBER_TNUMBER' | 'sub_tnumber_tnumber'; TBIGINT_SCALE_VALUE: 'TBIGINT_SCALE_VALUE' | 'tbigint_scale_value'; diff --git a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp index 06f381369f..c7666a5cdc 100644 --- a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp +++ b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp @@ -72,21 +72,25 @@ #include #include #include +#include #include #include #include #include #include +#include #include #include #include #include #include +#include #include #include #include #include #include +#include #include #include #include @@ -1863,6 +1867,35 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont } break; /* END CODEGEN PARSER GLUE: ADD_TBIGINT_BIGINT */ + /* BEGIN CODEGEN PARSER GLUE: ADD_INT_TINT */ + case AntlrSQLLexer::ADD_INT_TINT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("ADD_INT_TINT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AddIntTintLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: ADD_INT_TINT */ case AntlrSQLLexer::ADD_TINT_INT: { @@ -1921,6 +1954,35 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont } break; /* END CODEGEN PARSER GLUE: DIV_TBIGINT_BIGINT */ + /* BEGIN CODEGEN PARSER GLUE: DIV_INT_TINT */ + case AntlrSQLLexer::DIV_INT_TINT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("DIV_INT_TINT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(DivIntTintLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: DIV_INT_TINT */ case AntlrSQLLexer::DIV_TINT_INT: { @@ -1979,6 +2041,35 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont } break; /* END CODEGEN PARSER GLUE: MUL_TBIGINT_BIGINT */ + /* BEGIN CODEGEN PARSER GLUE: MUL_INT_TINT */ + case AntlrSQLLexer::MUL_INT_TINT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("MUL_INT_TINT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(MulIntTintLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: MUL_INT_TINT */ case AntlrSQLLexer::MUL_TINT_INT: { @@ -2037,6 +2128,35 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont } break; /* END CODEGEN PARSER GLUE: SUB_TBIGINT_BIGINT */ + /* BEGIN CODEGEN PARSER GLUE: SUB_INT_TINT */ + case AntlrSQLLexer::SUB_INT_TINT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("SUB_INT_TINT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(SubIntTintLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: SUB_INT_TINT */ case AntlrSQLLexer::SUB_TINT_INT: { From 8a4f6c9a9465c53cb9e23a277dc1a930b6d58b2b Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Fri, 12 Jun 2026 06:53:10 +0200 Subject: [PATCH 17/96] feat(meos): add ADD/SUB/MUL/DIV_BIGINT_TBIGINT reversed NES operators (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. --- .../Meos/AddBigintTbigintLogicalFunction.hpp | 54 ++++++++ .../Meos/DivBigintTbigintLogicalFunction.hpp | 54 ++++++++ .../Meos/MulBigintTbigintLogicalFunction.hpp | 54 ++++++++ .../Meos/SubBigintTbigintLogicalFunction.hpp | 54 ++++++++ .../Meos/AddBigintTbigintLogicalFunction.cpp | 105 +++++++++++++++ .../src/Functions/Meos/CMakeLists.txt | 4 + .../Meos/DivBigintTbigintLogicalFunction.cpp | 105 +++++++++++++++ .../Meos/MulBigintTbigintLogicalFunction.cpp | 105 +++++++++++++++ .../Meos/SubBigintTbigintLogicalFunction.cpp | 105 +++++++++++++++ .../Meos/AddBigintTbigintPhysicalFunction.hpp | 43 +++++++ .../Meos/DivBigintTbigintPhysicalFunction.hpp | 43 +++++++ .../Meos/MulBigintTbigintPhysicalFunction.hpp | 43 +++++++ .../Meos/SubBigintTbigintPhysicalFunction.hpp | 43 +++++++ .../Meos/AddBigintTbigintPhysicalFunction.cpp | 92 ++++++++++++++ .../src/Functions/Meos/CMakeLists.txt | 4 + .../Meos/DivBigintTbigintPhysicalFunction.cpp | 92 ++++++++++++++ .../Meos/MulBigintTbigintPhysicalFunction.cpp | 92 ++++++++++++++ .../Meos/SubBigintTbigintPhysicalFunction.cpp | 92 ++++++++++++++ nes-sql-parser/AntlrSQL.g4 | 6 +- .../src/AntlrSQLQueryPlanCreator.cpp | 120 ++++++++++++++++++ 20 files changed, 1309 insertions(+), 1 deletion(-) create mode 100644 nes-logical-operators/include/Functions/Meos/AddBigintTbigintLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/DivBigintTbigintLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/MulBigintTbigintLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/SubBigintTbigintLogicalFunction.hpp create mode 100644 nes-logical-operators/src/Functions/Meos/AddBigintTbigintLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/DivBigintTbigintLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/MulBigintTbigintLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/SubBigintTbigintLogicalFunction.cpp create mode 100644 nes-physical-operators/include/Functions/Meos/AddBigintTbigintPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/DivBigintTbigintPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/MulBigintTbigintPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/SubBigintTbigintPhysicalFunction.hpp create mode 100644 nes-physical-operators/src/Functions/Meos/AddBigintTbigintPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/DivBigintTbigintPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/MulBigintTbigintPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/SubBigintTbigintPhysicalFunction.cpp diff --git a/nes-logical-operators/include/Functions/Meos/AddBigintTbigintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AddBigintTbigintLogicalFunction.hpp new file mode 100644 index 0000000000..99a8dcb629 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AddBigintTbigintLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event add_bigint_tbigint: adds a constant int64 scalar to a single-instant tbigint value. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `add_bigint_tbigint`. Takes (scalar:FLOAT64→int64, value:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the addition, and returns FLOAT64. + */ +class AddBigintTbigintLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AddBigintTbigint"; + + AddBigintTbigintLogicalFunction(LogicalFunction scalar, + LogicalFunction value, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/DivBigintTbigintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/DivBigintTbigintLogicalFunction.hpp new file mode 100644 index 0000000000..993b9666e1 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/DivBigintTbigintLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event div_bigint_tbigint: divides a constant int64 scalar by a single-instant tbigint value. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `div_bigint_tbigint`. Takes (scalar:FLOAT64→int64, value:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the division, and returns FLOAT64. + */ +class DivBigintTbigintLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "DivBigintTbigint"; + + DivBigintTbigintLogicalFunction(LogicalFunction scalar, + LogicalFunction value, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/MulBigintTbigintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/MulBigintTbigintLogicalFunction.hpp new file mode 100644 index 0000000000..bc3e2244f5 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/MulBigintTbigintLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event mul_bigint_tbigint: multiplies a constant int64 scalar by a single-instant tbigint value. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `mul_bigint_tbigint`. Takes (scalar:FLOAT64→int64, value:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the multiplication, and returns FLOAT64. + */ +class MulBigintTbigintLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "MulBigintTbigint"; + + MulBigintTbigintLogicalFunction(LogicalFunction scalar, + LogicalFunction value, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/SubBigintTbigintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/SubBigintTbigintLogicalFunction.hpp new file mode 100644 index 0000000000..dfd0d17747 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/SubBigintTbigintLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event sub_bigint_tbigint: subtracts a single-instant tbigint value from a constant int64 scalar. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `sub_bigint_tbigint`. Takes (scalar:FLOAT64→int64, value:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the subtraction, and returns FLOAT64. + */ +class SubBigintTbigintLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "SubBigintTbigint"; + + SubBigintTbigintLogicalFunction(LogicalFunction scalar, + LogicalFunction value, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AddBigintTbigintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AddBigintTbigintLogicalFunction.cpp new file mode 100644 index 0000000000..4c0eae2820 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AddBigintTbigintLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AddBigintTbigintLogicalFunction::AddBigintTbigintLogicalFunction(LogicalFunction scalar, + LogicalFunction value, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(scalar)); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(ts)); +} + +DataType AddBigintTbigintLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AddBigintTbigintLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AddBigintTbigintLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AddBigintTbigintLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "AddBigintTbigintLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AddBigintTbigintLogicalFunction::getType() const { return NAME; } + +bool AddBigintTbigintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AddBigintTbigintLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction AddBigintTbigintLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction AddBigintTbigintLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAddBigintTbigintLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "AddBigintTbigintLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return AddBigintTbigintLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt index b183f783d5..a99de0cdb4 100644 --- a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt @@ -26,6 +26,7 @@ add_plugin(TfloatRadians LogicalFunction nes-logical-operators TfloatRadiansLogi add_plugin(TfloatScaleValue LogicalFunction nes-logical-operators TfloatScaleValueLogicalFunction.cpp) add_plugin(AddFloatTfloat LogicalFunction nes-logical-operators AddFloatTfloatLogicalFunction.cpp) add_plugin(AddTfloatFloat LogicalFunction nes-logical-operators AddTfloatFloatLogicalFunction.cpp) +add_plugin(AddBigintTbigint LogicalFunction nes-logical-operators AddBigintTbigintLogicalFunction.cpp) add_plugin(AddTbigintBigint LogicalFunction nes-logical-operators AddTbigintBigintLogicalFunction.cpp) add_plugin(AddIntTint LogicalFunction nes-logical-operators AddIntTintLogicalFunction.cpp) add_plugin(AddTintInt LogicalFunction nes-logical-operators AddTintIntLogicalFunction.cpp) @@ -37,14 +38,17 @@ add_plugin(TemporalRound LogicalFunction nes-logical-operators TemporalRoundLogi add_plugin(TintScaleValue LogicalFunction nes-logical-operators TintScaleValueLogicalFunction.cpp) add_plugin(TintShiftScaleValue LogicalFunction nes-logical-operators TintShiftScaleValueLogicalFunction.cpp) add_plugin(TintShiftValue LogicalFunction nes-logical-operators TintShiftValueLogicalFunction.cpp) +add_plugin(DivBigintTbigint LogicalFunction nes-logical-operators DivBigintTbigintLogicalFunction.cpp) add_plugin(DivTbigintBigint LogicalFunction nes-logical-operators DivTbigintBigintLogicalFunction.cpp) add_plugin(DivIntTint LogicalFunction nes-logical-operators DivIntTintLogicalFunction.cpp) add_plugin(DivTintInt LogicalFunction nes-logical-operators DivTintIntLogicalFunction.cpp) add_plugin(DivTnumberTnumber LogicalFunction nes-logical-operators DivTnumberTnumberLogicalFunction.cpp) +add_plugin(MulBigintTbigint LogicalFunction nes-logical-operators MulBigintTbigintLogicalFunction.cpp) add_plugin(MulTbigintBigint LogicalFunction nes-logical-operators MulTbigintBigintLogicalFunction.cpp) add_plugin(MulIntTint LogicalFunction nes-logical-operators MulIntTintLogicalFunction.cpp) add_plugin(MulTintInt LogicalFunction nes-logical-operators MulTintIntLogicalFunction.cpp) add_plugin(MulTnumberTnumber LogicalFunction nes-logical-operators MulTnumberTnumberLogicalFunction.cpp) +add_plugin(SubBigintTbigint LogicalFunction nes-logical-operators SubBigintTbigintLogicalFunction.cpp) add_plugin(SubTbigintBigint LogicalFunction nes-logical-operators SubTbigintBigintLogicalFunction.cpp) add_plugin(SubIntTint LogicalFunction nes-logical-operators SubIntTintLogicalFunction.cpp) add_plugin(SubTintInt LogicalFunction nes-logical-operators SubTintIntLogicalFunction.cpp) diff --git a/nes-logical-operators/src/Functions/Meos/DivBigintTbigintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/DivBigintTbigintLogicalFunction.cpp new file mode 100644 index 0000000000..166a3c2100 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/DivBigintTbigintLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +DivBigintTbigintLogicalFunction::DivBigintTbigintLogicalFunction(LogicalFunction scalar, + LogicalFunction value, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(scalar)); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(ts)); +} + +DataType DivBigintTbigintLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction DivBigintTbigintLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector DivBigintTbigintLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction DivBigintTbigintLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "DivBigintTbigintLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view DivBigintTbigintLogicalFunction::getType() const { return NAME; } + +bool DivBigintTbigintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string DivBigintTbigintLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction DivBigintTbigintLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction DivBigintTbigintLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterDivBigintTbigintLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "DivBigintTbigintLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return DivBigintTbigintLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/MulBigintTbigintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/MulBigintTbigintLogicalFunction.cpp new file mode 100644 index 0000000000..97c43c36c7 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/MulBigintTbigintLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +MulBigintTbigintLogicalFunction::MulBigintTbigintLogicalFunction(LogicalFunction scalar, + LogicalFunction value, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(scalar)); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(ts)); +} + +DataType MulBigintTbigintLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction MulBigintTbigintLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector MulBigintTbigintLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction MulBigintTbigintLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "MulBigintTbigintLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view MulBigintTbigintLogicalFunction::getType() const { return NAME; } + +bool MulBigintTbigintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string MulBigintTbigintLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction MulBigintTbigintLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction MulBigintTbigintLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterMulBigintTbigintLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "MulBigintTbigintLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return MulBigintTbigintLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/SubBigintTbigintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/SubBigintTbigintLogicalFunction.cpp new file mode 100644 index 0000000000..1d28d41eeb --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/SubBigintTbigintLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +SubBigintTbigintLogicalFunction::SubBigintTbigintLogicalFunction(LogicalFunction scalar, + LogicalFunction value, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(scalar)); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(ts)); +} + +DataType SubBigintTbigintLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction SubBigintTbigintLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector SubBigintTbigintLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction SubBigintTbigintLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "SubBigintTbigintLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view SubBigintTbigintLogicalFunction::getType() const { return NAME; } + +bool SubBigintTbigintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string SubBigintTbigintLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction SubBigintTbigintLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction SubBigintTbigintLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterSubBigintTbigintLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "SubBigintTbigintLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return SubBigintTbigintLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AddBigintTbigintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AddBigintTbigintPhysicalFunction.hpp new file mode 100644 index 0000000000..002afad790 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AddBigintTbigintPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `add_bigint_tbigint`. + * + * Per-event add_bigint_tbigint: adds a constant int64 scalar to a single-instant tbigint value. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class AddBigintTbigintPhysicalFunction : public PhysicalFunctionConcept { +public: + AddBigintTbigintPhysicalFunction(PhysicalFunction scalarFunction, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/DivBigintTbigintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/DivBigintTbigintPhysicalFunction.hpp new file mode 100644 index 0000000000..388ea20550 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/DivBigintTbigintPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `div_bigint_tbigint`. + * + * Per-event div_bigint_tbigint: divides a constant int64 scalar by a single-instant tbigint value. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class DivBigintTbigintPhysicalFunction : public PhysicalFunctionConcept { +public: + DivBigintTbigintPhysicalFunction(PhysicalFunction scalarFunction, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/MulBigintTbigintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/MulBigintTbigintPhysicalFunction.hpp new file mode 100644 index 0000000000..8e83307019 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/MulBigintTbigintPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `mul_bigint_tbigint`. + * + * Per-event mul_bigint_tbigint: multiplies a constant int64 scalar by a single-instant tbigint value. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class MulBigintTbigintPhysicalFunction : public PhysicalFunctionConcept { +public: + MulBigintTbigintPhysicalFunction(PhysicalFunction scalarFunction, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/SubBigintTbigintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/SubBigintTbigintPhysicalFunction.hpp new file mode 100644 index 0000000000..3c3558ab49 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/SubBigintTbigintPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `sub_bigint_tbigint`. + * + * Per-event sub_bigint_tbigint: subtracts a single-instant tbigint value from a constant int64 scalar. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class SubBigintTbigintPhysicalFunction : public PhysicalFunctionConcept { +public: + SubBigintTbigintPhysicalFunction(PhysicalFunction scalarFunction, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AddBigintTbigintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AddBigintTbigintPhysicalFunction.cpp new file mode 100644 index 0000000000..524b303ad8 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AddBigintTbigintPhysicalFunction.cpp @@ -0,0 +1,92 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +AddBigintTbigintPhysicalFunction::AddBigintTbigintPhysicalFunction(PhysicalFunction scalarFunction, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(scalarFunction)); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal AddBigintTbigintPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto scalar = parameterValues[0].cast>(); + auto value = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double scalar_d, double value_d, uint64_t ts) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string tempWkt = fmt::format("{}@{}", static_cast(value_d), + MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tbigint_in(tempWkt.c_str()); + if (!temp) return 0.0; + Temporal* res = add_bigint_tbigint(static_cast(scalar_d), temp); + free(temp); + if (!res) return 0.0; + double r = static_cast(tbigint_start_value(res)); + free(res); + return r; + } catch (const std::exception&) { return 0.0; } + }, + scalar, value, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAddBigintTbigintPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "AddBigintTbigintPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return AddBigintTbigintPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt index d6ede70801..036d4bdf7d 100644 --- a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt @@ -25,6 +25,7 @@ add_plugin(TfloatRadians PhysicalFunction nes-physical-operators TfloatRadiansPh add_plugin(TfloatScaleValue PhysicalFunction nes-physical-operators TfloatScaleValuePhysicalFunction.cpp) add_plugin(AddFloatTfloat PhysicalFunction nes-physical-operators AddFloatTfloatPhysicalFunction.cpp) add_plugin(AddTfloatFloat PhysicalFunction nes-physical-operators AddTfloatFloatPhysicalFunction.cpp) +add_plugin(AddBigintTbigint PhysicalFunction nes-physical-operators AddBigintTbigintPhysicalFunction.cpp) add_plugin(AddTbigintBigint PhysicalFunction nes-physical-operators AddTbigintBigintPhysicalFunction.cpp) add_plugin(AddIntTint PhysicalFunction nes-physical-operators AddIntTintPhysicalFunction.cpp) add_plugin(AddTintInt PhysicalFunction nes-physical-operators AddTintIntPhysicalFunction.cpp) @@ -36,14 +37,17 @@ add_plugin(TemporalRound PhysicalFunction nes-physical-operators TemporalRoundPh add_plugin(TintScaleValue PhysicalFunction nes-physical-operators TintScaleValuePhysicalFunction.cpp) add_plugin(TintShiftScaleValue PhysicalFunction nes-physical-operators TintShiftScaleValuePhysicalFunction.cpp) add_plugin(TintShiftValue PhysicalFunction nes-physical-operators TintShiftValuePhysicalFunction.cpp) +add_plugin(DivBigintTbigint PhysicalFunction nes-physical-operators DivBigintTbigintPhysicalFunction.cpp) add_plugin(DivTbigintBigint PhysicalFunction nes-physical-operators DivTbigintBigintPhysicalFunction.cpp) add_plugin(DivIntTint PhysicalFunction nes-physical-operators DivIntTintPhysicalFunction.cpp) add_plugin(DivTintInt PhysicalFunction nes-physical-operators DivTintIntPhysicalFunction.cpp) add_plugin(DivTnumberTnumber PhysicalFunction nes-physical-operators DivTnumberTnumberPhysicalFunction.cpp) +add_plugin(MulBigintTbigint PhysicalFunction nes-physical-operators MulBigintTbigintPhysicalFunction.cpp) add_plugin(MulTbigintBigint PhysicalFunction nes-physical-operators MulTbigintBigintPhysicalFunction.cpp) add_plugin(MulIntTint PhysicalFunction nes-physical-operators MulIntTintPhysicalFunction.cpp) add_plugin(MulTintInt PhysicalFunction nes-physical-operators MulTintIntPhysicalFunction.cpp) add_plugin(MulTnumberTnumber PhysicalFunction nes-physical-operators MulTnumberTnumberPhysicalFunction.cpp) +add_plugin(SubBigintTbigint PhysicalFunction nes-physical-operators SubBigintTbigintPhysicalFunction.cpp) add_plugin(SubTbigintBigint PhysicalFunction nes-physical-operators SubTbigintBigintPhysicalFunction.cpp) add_plugin(SubIntTint PhysicalFunction nes-physical-operators SubIntTintPhysicalFunction.cpp) add_plugin(SubTintInt PhysicalFunction nes-physical-operators SubTintIntPhysicalFunction.cpp) diff --git a/nes-physical-operators/src/Functions/Meos/DivBigintTbigintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/DivBigintTbigintPhysicalFunction.cpp new file mode 100644 index 0000000000..5d79d2132b --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/DivBigintTbigintPhysicalFunction.cpp @@ -0,0 +1,92 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +DivBigintTbigintPhysicalFunction::DivBigintTbigintPhysicalFunction(PhysicalFunction scalarFunction, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(scalarFunction)); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal DivBigintTbigintPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto scalar = parameterValues[0].cast>(); + auto value = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double scalar_d, double value_d, uint64_t ts) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string tempWkt = fmt::format("{}@{}", static_cast(value_d), + MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tbigint_in(tempWkt.c_str()); + if (!temp) return 0.0; + Temporal* res = div_bigint_tbigint(static_cast(scalar_d), temp); + free(temp); + if (!res) return 0.0; + double r = static_cast(tbigint_start_value(res)); + free(res); + return r; + } catch (const std::exception&) { return 0.0; } + }, + scalar, value, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterDivBigintTbigintPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "DivBigintTbigintPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return DivBigintTbigintPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/MulBigintTbigintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/MulBigintTbigintPhysicalFunction.cpp new file mode 100644 index 0000000000..0919846d1d --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/MulBigintTbigintPhysicalFunction.cpp @@ -0,0 +1,92 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +MulBigintTbigintPhysicalFunction::MulBigintTbigintPhysicalFunction(PhysicalFunction scalarFunction, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(scalarFunction)); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal MulBigintTbigintPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto scalar = parameterValues[0].cast>(); + auto value = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double scalar_d, double value_d, uint64_t ts) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string tempWkt = fmt::format("{}@{}", static_cast(value_d), + MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tbigint_in(tempWkt.c_str()); + if (!temp) return 0.0; + Temporal* res = mul_bigint_tbigint(static_cast(scalar_d), temp); + free(temp); + if (!res) return 0.0; + double r = static_cast(tbigint_start_value(res)); + free(res); + return r; + } catch (const std::exception&) { return 0.0; } + }, + scalar, value, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterMulBigintTbigintPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "MulBigintTbigintPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return MulBigintTbigintPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/SubBigintTbigintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/SubBigintTbigintPhysicalFunction.cpp new file mode 100644 index 0000000000..a6331aec84 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/SubBigintTbigintPhysicalFunction.cpp @@ -0,0 +1,92 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +SubBigintTbigintPhysicalFunction::SubBigintTbigintPhysicalFunction(PhysicalFunction scalarFunction, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(scalarFunction)); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal SubBigintTbigintPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto scalar = parameterValues[0].cast>(); + auto value = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double scalar_d, double value_d, uint64_t ts) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string tempWkt = fmt::format("{}@{}", static_cast(value_d), + MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tbigint_in(tempWkt.c_str()); + if (!temp) return 0.0; + Temporal* res = sub_bigint_tbigint(static_cast(scalar_d), temp); + free(temp); + if (!res) return 0.0; + double r = static_cast(tbigint_start_value(res)); + free(res); + return r; + } catch (const std::exception&) { return 0.0; } + }, + scalar, value, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterSubBigintTbigintPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "SubBigintTbigintPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return SubBigintTbigintPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-sql-parser/AntlrSQL.g4 b/nes-sql-parser/AntlrSQL.g4 index e38329c1d3..b65b957e47 100644 --- a/nes-sql-parser/AntlrSQL.g4 +++ b/nes-sql-parser/AntlrSQL.g4 @@ -295,7 +295,7 @@ timeUnit: MS timestampParameter: name=identifier; -functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | EDWITHIN_TGEO_GEO | TGEO_AT_STBOX | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_FLOOR | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS; +functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | EDWITHIN_TGEO_GEO | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_FLOOR | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS; sinkClause: INTO sink (',' sink)*; @@ -488,24 +488,28 @@ TEMPORAL_AINTERSECTS_GEOMETRY: 'TEMPORAL_AINTERSECTS_GEOMETRY' | 'temporal_ainte TEMPORAL_ECONTAINS_GEOMETRY: 'TEMPORAL_ECONTAINS_GEOMETRY' | 'temporal_econtains_geometry'; EDWITHIN_TGEO_GEO: 'EDWITHIN_TGEO_GEO' | 'edwithin_tgeo_geo'; TGEO_AT_STBOX: 'TGEO_AT_STBOX' | 'tgeo_at_stbox'; +ADD_BIGINT_TBIGINT: 'ADD_BIGINT_TBIGINT' | 'add_bigint_tbigint'; ADD_FLOAT_TFLOAT: 'ADD_FLOAT_TFLOAT' | 'add_float_tfloat'; ADD_TBIGINT_BIGINT: 'ADD_TBIGINT_BIGINT' | 'add_tbigint_bigint'; ADD_TFLOAT_FLOAT: 'ADD_TFLOAT_FLOAT' | 'add_tfloat_float'; ADD_INT_TINT: 'ADD_INT_TINT' | 'add_int_tint'; ADD_TINT_INT: 'ADD_TINT_INT' | 'add_tint_int'; ADD_TNUMBER_TNUMBER: 'ADD_TNUMBER_TNUMBER' | 'add_tnumber_tnumber'; +DIV_BIGINT_TBIGINT: 'DIV_BIGINT_TBIGINT' | 'div_bigint_tbigint'; DIV_FLOAT_TFLOAT: 'DIV_FLOAT_TFLOAT' | 'div_float_tfloat'; DIV_TBIGINT_BIGINT: 'DIV_TBIGINT_BIGINT' | 'div_tbigint_bigint'; DIV_TFLOAT_FLOAT: 'DIV_TFLOAT_FLOAT' | 'div_tfloat_float'; DIV_INT_TINT: 'DIV_INT_TINT' | 'div_int_tint'; DIV_TINT_INT: 'DIV_TINT_INT' | 'div_tint_int'; DIV_TNUMBER_TNUMBER: 'DIV_TNUMBER_TNUMBER' | 'div_tnumber_tnumber'; +MUL_BIGINT_TBIGINT: 'MUL_BIGINT_TBIGINT' | 'mul_bigint_tbigint'; MUL_FLOAT_TFLOAT: 'MUL_FLOAT_TFLOAT' | 'mul_float_tfloat'; MUL_TBIGINT_BIGINT: 'MUL_TBIGINT_BIGINT' | 'mul_tbigint_bigint'; MUL_TFLOAT_FLOAT: 'MUL_TFLOAT_FLOAT' | 'mul_tfloat_float'; MUL_INT_TINT: 'MUL_INT_TINT' | 'mul_int_tint'; MUL_TINT_INT: 'MUL_TINT_INT' | 'mul_tint_int'; MUL_TNUMBER_TNUMBER: 'MUL_TNUMBER_TNUMBER' | 'mul_tnumber_tnumber'; +SUB_BIGINT_TBIGINT: 'SUB_BIGINT_TBIGINT' | 'sub_bigint_tbigint'; SUB_FLOAT_TFLOAT: 'SUB_FLOAT_TFLOAT' | 'sub_float_tfloat'; SUB_TBIGINT_BIGINT: 'SUB_TBIGINT_BIGINT' | 'sub_tbigint_bigint'; SUB_TFLOAT_FLOAT: 'SUB_TFLOAT_FLOAT' | 'sub_tfloat_float'; diff --git a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp index c7666a5cdc..f14eea84b1 100644 --- a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp +++ b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp @@ -69,24 +69,28 @@ #include #include #include +#include #include #include #include #include #include #include +#include #include #include #include #include #include #include +#include #include #include #include #include #include #include +#include #include #include #include @@ -1838,6 +1842,35 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont } break; /* END CODEGEN PARSER GLUE: SUB_TFLOAT_FLOAT */ + /* BEGIN CODEGEN PARSER GLUE: ADD_BIGINT_TBIGINT */ + case AntlrSQLLexer::ADD_BIGINT_TBIGINT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("ADD_BIGINT_TBIGINT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AddBigintTbigintLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: ADD_BIGINT_TBIGINT */ /* BEGIN CODEGEN PARSER GLUE: ADD_TBIGINT_BIGINT */ case AntlrSQLLexer::ADD_TBIGINT_BIGINT: { @@ -1925,6 +1958,35 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont } break; /* END CODEGEN PARSER GLUE: ADD_TINT_INT */ + /* BEGIN CODEGEN PARSER GLUE: DIV_BIGINT_TBIGINT */ + case AntlrSQLLexer::DIV_BIGINT_TBIGINT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("DIV_BIGINT_TBIGINT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(DivBigintTbigintLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: DIV_BIGINT_TBIGINT */ /* BEGIN CODEGEN PARSER GLUE: DIV_TBIGINT_BIGINT */ case AntlrSQLLexer::DIV_TBIGINT_BIGINT: { @@ -2012,6 +2074,35 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont } break; /* END CODEGEN PARSER GLUE: DIV_TINT_INT */ + /* BEGIN CODEGEN PARSER GLUE: MUL_BIGINT_TBIGINT */ + case AntlrSQLLexer::MUL_BIGINT_TBIGINT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("MUL_BIGINT_TBIGINT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(MulBigintTbigintLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: MUL_BIGINT_TBIGINT */ /* BEGIN CODEGEN PARSER GLUE: MUL_TBIGINT_BIGINT */ case AntlrSQLLexer::MUL_TBIGINT_BIGINT: { @@ -2099,6 +2190,35 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont } break; /* END CODEGEN PARSER GLUE: MUL_TINT_INT */ + /* BEGIN CODEGEN PARSER GLUE: SUB_BIGINT_TBIGINT */ + case AntlrSQLLexer::SUB_BIGINT_TBIGINT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("SUB_BIGINT_TBIGINT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(SubBigintTbigintLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: SUB_BIGINT_TBIGINT */ /* BEGIN CODEGEN PARSER GLUE: SUB_TBIGINT_BIGINT */ case AntlrSQLLexer::SUB_TBIGINT_BIGINT: { From 5d3a3c92e6860f667f8b2977c57ab73172493fbb Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Fri, 12 Jun 2026 08:34:22 +0200 Subject: [PATCH 18/96] feat(meos): add TFLOAT_EXP, TFLOAT_LN, TFLOAT_LOG10 NES operators (W60) 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. --- .../Meos/TfloatExpLogicalFunction.hpp | 53 +++++++++ .../Meos/TfloatLnLogicalFunction.hpp | 53 +++++++++ .../Meos/TfloatLog10LogicalFunction.hpp | 53 +++++++++ .../src/Functions/Meos/CMakeLists.txt | 3 + .../Meos/TfloatExpLogicalFunction.cpp | 102 ++++++++++++++++++ .../Meos/TfloatLnLogicalFunction.cpp | 102 ++++++++++++++++++ .../Meos/TfloatLog10LogicalFunction.cpp | 102 ++++++++++++++++++ .../Meos/TfloatExpPhysicalFunction.hpp | 42 ++++++++ .../Meos/TfloatLnPhysicalFunction.hpp | 42 ++++++++ .../Meos/TfloatLog10PhysicalFunction.hpp | 42 ++++++++ .../src/Functions/Meos/CMakeLists.txt | 3 + .../Meos/TfloatExpPhysicalFunction.cpp | 87 +++++++++++++++ .../Meos/TfloatLnPhysicalFunction.cpp | 87 +++++++++++++++ .../Meos/TfloatLog10PhysicalFunction.cpp | 87 +++++++++++++++ nes-sql-parser/AntlrSQL.g4 | 5 +- .../src/AntlrSQLQueryPlanCreator.cpp | 87 +++++++++++++++ 16 files changed, 949 insertions(+), 1 deletion(-) create mode 100644 nes-logical-operators/include/Functions/Meos/TfloatExpLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TfloatLnLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TfloatLog10LogicalFunction.hpp create mode 100644 nes-logical-operators/src/Functions/Meos/TfloatExpLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TfloatLnLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TfloatLog10LogicalFunction.cpp create mode 100644 nes-physical-operators/include/Functions/Meos/TfloatExpPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TfloatLnPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TfloatLog10PhysicalFunction.hpp create mode 100644 nes-physical-operators/src/Functions/Meos/TfloatExpPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TfloatLnPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TfloatLog10PhysicalFunction.cpp diff --git a/nes-logical-operators/include/Functions/Meos/TfloatExpLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TfloatExpLogicalFunction.hpp new file mode 100644 index 0000000000..a006015a7b --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TfloatExpLogicalFunction.hpp @@ -0,0 +1,53 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event tfloat_exp: single-instant tfloat transform, value extracted -> double. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `tfloat_exp`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. + */ +class TfloatExpLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TfloatExp"; + + TfloatExpLogicalFunction(LogicalFunction value, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TfloatLnLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TfloatLnLogicalFunction.hpp new file mode 100644 index 0000000000..2924cce5ff --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TfloatLnLogicalFunction.hpp @@ -0,0 +1,53 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event tfloat_ln: single-instant tfloat transform, value extracted -> double. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `tfloat_ln`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. + */ +class TfloatLnLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TfloatLn"; + + TfloatLnLogicalFunction(LogicalFunction value, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TfloatLog10LogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TfloatLog10LogicalFunction.hpp new file mode 100644 index 0000000000..0b3703d878 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TfloatLog10LogicalFunction.hpp @@ -0,0 +1,53 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event tfloat_log10: single-instant tfloat transform, value extracted -> double. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `tfloat_log10`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. + */ +class TfloatLog10LogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TfloatLog10"; + + TfloatLog10LogicalFunction(LogicalFunction value, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt index a99de0cdb4..269767f962 100644 --- a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt @@ -21,7 +21,10 @@ add_plugin(TemporalAtStBox LogicalFunction nes-logical-operators TemporalAtStBox add_plugin(TfloatCeil LogicalFunction nes-logical-operators TfloatCeilLogicalFunction.cpp) add_plugin(TfloatCos LogicalFunction nes-logical-operators TfloatCosLogicalFunction.cpp) add_plugin(TfloatDegrees LogicalFunction nes-logical-operators TfloatDegreesLogicalFunction.cpp) +add_plugin(TfloatExp LogicalFunction nes-logical-operators TfloatExpLogicalFunction.cpp) add_plugin(TfloatFloor LogicalFunction nes-logical-operators TfloatFloorLogicalFunction.cpp) +add_plugin(TfloatLn LogicalFunction nes-logical-operators TfloatLnLogicalFunction.cpp) +add_plugin(TfloatLog10 LogicalFunction nes-logical-operators TfloatLog10LogicalFunction.cpp) add_plugin(TfloatRadians LogicalFunction nes-logical-operators TfloatRadiansLogicalFunction.cpp) add_plugin(TfloatScaleValue LogicalFunction nes-logical-operators TfloatScaleValueLogicalFunction.cpp) add_plugin(AddFloatTfloat LogicalFunction nes-logical-operators AddFloatTfloatLogicalFunction.cpp) diff --git a/nes-logical-operators/src/Functions/Meos/TfloatExpLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TfloatExpLogicalFunction.cpp new file mode 100644 index 0000000000..bf6a97e365 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TfloatExpLogicalFunction.cpp @@ -0,0 +1,102 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TfloatExpLogicalFunction::TfloatExpLogicalFunction(LogicalFunction value, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(2); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(ts)); +} + +DataType TfloatExpLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction TfloatExpLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector TfloatExpLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction TfloatExpLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 2, "TfloatExpLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view TfloatExpLogicalFunction::getType() const { return NAME; } + +bool TfloatExpLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string TfloatExpLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TfloatExpLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction TfloatExpLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTfloatExpLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 2, + "TfloatExpLogicalFunction requires 2 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + return TfloatExpLogicalFunction(std::move(arg0), std::move(arg1)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TfloatLnLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TfloatLnLogicalFunction.cpp new file mode 100644 index 0000000000..2d12b9baa5 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TfloatLnLogicalFunction.cpp @@ -0,0 +1,102 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TfloatLnLogicalFunction::TfloatLnLogicalFunction(LogicalFunction value, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(2); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(ts)); +} + +DataType TfloatLnLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction TfloatLnLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector TfloatLnLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction TfloatLnLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 2, "TfloatLnLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view TfloatLnLogicalFunction::getType() const { return NAME; } + +bool TfloatLnLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string TfloatLnLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TfloatLnLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction TfloatLnLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTfloatLnLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 2, + "TfloatLnLogicalFunction requires 2 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + return TfloatLnLogicalFunction(std::move(arg0), std::move(arg1)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TfloatLog10LogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TfloatLog10LogicalFunction.cpp new file mode 100644 index 0000000000..22fe17e9ba --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TfloatLog10LogicalFunction.cpp @@ -0,0 +1,102 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TfloatLog10LogicalFunction::TfloatLog10LogicalFunction(LogicalFunction value, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(2); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(ts)); +} + +DataType TfloatLog10LogicalFunction::getDataType() const { return dataType; } + +LogicalFunction TfloatLog10LogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector TfloatLog10LogicalFunction::getChildren() const { return parameters; } + +LogicalFunction TfloatLog10LogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 2, "TfloatLog10LogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view TfloatLog10LogicalFunction::getType() const { return NAME; } + +bool TfloatLog10LogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string TfloatLog10LogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TfloatLog10LogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction TfloatLog10LogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTfloatLog10LogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 2, + "TfloatLog10LogicalFunction requires 2 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + return TfloatLog10LogicalFunction(std::move(arg0), std::move(arg1)); +} + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TfloatExpPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TfloatExpPhysicalFunction.hpp new file mode 100644 index 0000000000..3f4c0e84be --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TfloatExpPhysicalFunction.hpp @@ -0,0 +1,42 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `tfloat_exp`. + * + * Per-event tfloat_exp: single-instant tfloat transform, value extracted -> double. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TfloatExpPhysicalFunction : public PhysicalFunctionConcept { +public: + TfloatExpPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TfloatLnPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TfloatLnPhysicalFunction.hpp new file mode 100644 index 0000000000..e2539cd8f5 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TfloatLnPhysicalFunction.hpp @@ -0,0 +1,42 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `tfloat_ln`. + * + * Per-event tfloat_ln: single-instant tfloat transform, value extracted -> double. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TfloatLnPhysicalFunction : public PhysicalFunctionConcept { +public: + TfloatLnPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TfloatLog10PhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TfloatLog10PhysicalFunction.hpp new file mode 100644 index 0000000000..47439e84e8 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TfloatLog10PhysicalFunction.hpp @@ -0,0 +1,42 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `tfloat_log10`. + * + * Per-event tfloat_log10: single-instant tfloat transform, value extracted -> double. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TfloatLog10PhysicalFunction : public PhysicalFunctionConcept { +public: + TfloatLog10PhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt index 036d4bdf7d..36c772b8d9 100644 --- a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt @@ -20,7 +20,10 @@ add_plugin(TemporalAtStBox PhysicalFunction nes-physical-operators TemporalAtStB add_plugin(TfloatCeil PhysicalFunction nes-physical-operators TfloatCeilPhysicalFunction.cpp) add_plugin(TfloatCos PhysicalFunction nes-physical-operators TfloatCosPhysicalFunction.cpp) add_plugin(TfloatDegrees PhysicalFunction nes-physical-operators TfloatDegreesPhysicalFunction.cpp) +add_plugin(TfloatExp PhysicalFunction nes-physical-operators TfloatExpPhysicalFunction.cpp) add_plugin(TfloatFloor PhysicalFunction nes-physical-operators TfloatFloorPhysicalFunction.cpp) +add_plugin(TfloatLn PhysicalFunction nes-physical-operators TfloatLnPhysicalFunction.cpp) +add_plugin(TfloatLog10 PhysicalFunction nes-physical-operators TfloatLog10PhysicalFunction.cpp) add_plugin(TfloatRadians PhysicalFunction nes-physical-operators TfloatRadiansPhysicalFunction.cpp) add_plugin(TfloatScaleValue PhysicalFunction nes-physical-operators TfloatScaleValuePhysicalFunction.cpp) add_plugin(AddFloatTfloat PhysicalFunction nes-physical-operators AddFloatTfloatPhysicalFunction.cpp) diff --git a/nes-physical-operators/src/Functions/Meos/TfloatExpPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TfloatExpPhysicalFunction.cpp new file mode 100644 index 0000000000..be30a495cc --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TfloatExpPhysicalFunction.cpp @@ -0,0 +1,87 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +TfloatExpPhysicalFunction::TfloatExpPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(2); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal TfloatExpPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto ts = parameterValues[1].cast>(); + + const auto result = nautilus::invoke( + +[](double value, uint64_t ts) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string tempWkt = fmt::format("{}@{}", value, MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tfloat_in(tempWkt.c_str()); + if (!temp) return 0.0; + Temporal* res = tfloat_exp(temp); + free(temp); + if (!res) return 0.0; + double r = tfloat_start_value(res); + free(res); + return r; + } catch (const std::exception&) { return 0.0; } + }, + value, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTfloatExpPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 2, + "TfloatExpPhysicalFunction requires 2 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + return TfloatExpPhysicalFunction(std::move(arg0), std::move(arg1)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TfloatLnPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TfloatLnPhysicalFunction.cpp new file mode 100644 index 0000000000..78550610c8 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TfloatLnPhysicalFunction.cpp @@ -0,0 +1,87 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +TfloatLnPhysicalFunction::TfloatLnPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(2); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal TfloatLnPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto ts = parameterValues[1].cast>(); + + const auto result = nautilus::invoke( + +[](double value, uint64_t ts) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string tempWkt = fmt::format("{}@{}", value, MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tfloat_in(tempWkt.c_str()); + if (!temp) return 0.0; + Temporal* res = tfloat_ln(temp); + free(temp); + if (!res) return 0.0; + double r = tfloat_start_value(res); + free(res); + return r; + } catch (const std::exception&) { return 0.0; } + }, + value, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTfloatLnPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 2, + "TfloatLnPhysicalFunction requires 2 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + return TfloatLnPhysicalFunction(std::move(arg0), std::move(arg1)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TfloatLog10PhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TfloatLog10PhysicalFunction.cpp new file mode 100644 index 0000000000..59fba49cc9 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TfloatLog10PhysicalFunction.cpp @@ -0,0 +1,87 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +TfloatLog10PhysicalFunction::TfloatLog10PhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(2); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal TfloatLog10PhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto ts = parameterValues[1].cast>(); + + const auto result = nautilus::invoke( + +[](double value, uint64_t ts) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string tempWkt = fmt::format("{}@{}", value, MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tfloat_in(tempWkt.c_str()); + if (!temp) return 0.0; + Temporal* res = tfloat_log10(temp); + free(temp); + if (!res) return 0.0; + double r = tfloat_start_value(res); + free(res); + return r; + } catch (const std::exception&) { return 0.0; } + }, + value, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTfloatLog10PhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 2, + "TfloatLog10PhysicalFunction requires 2 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + return TfloatLog10PhysicalFunction(std::move(arg0), std::move(arg1)); +} + +} // namespace NES diff --git a/nes-sql-parser/AntlrSQL.g4 b/nes-sql-parser/AntlrSQL.g4 index b65b957e47..141cb35cf1 100644 --- a/nes-sql-parser/AntlrSQL.g4 +++ b/nes-sql-parser/AntlrSQL.g4 @@ -295,7 +295,7 @@ timeUnit: MS timestampParameter: name=identifier; -functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | EDWITHIN_TGEO_GEO | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_FLOOR | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS; +functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | EDWITHIN_TGEO_GEO | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS; sinkClause: INTO sink (',' sink)*; @@ -528,7 +528,10 @@ TEMPORAL_ROUND: 'TEMPORAL_ROUND' | 'temporal_round'; TFLOAT_CEIL: 'TFLOAT_CEIL' | 'tfloat_ceil'; TFLOAT_COS: 'TFLOAT_COS' | 'tfloat_cos'; TFLOAT_DEGREES: 'TFLOAT_DEGREES' | 'tfloat_degrees'; +TFLOAT_EXP: 'TFLOAT_EXP' | 'tfloat_exp'; TFLOAT_FLOOR: 'TFLOAT_FLOOR' | 'tfloat_floor'; +TFLOAT_LN: 'TFLOAT_LN' | 'tfloat_ln'; +TFLOAT_LOG10: 'TFLOAT_LOG10' | 'tfloat_log10'; TFLOAT_RADIANS: 'TFLOAT_RADIANS' | 'tfloat_radians'; TFLOAT_SCALE_VALUE: 'TFLOAT_SCALE_VALUE' | 'tfloat_scale_value'; TFLOAT_SHIFT_SCALE_VALUE: 'TFLOAT_SHIFT_SCALE_VALUE' | 'tfloat_shift_scale_value'; diff --git a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp index f14eea84b1..e5d23de442 100644 --- a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp +++ b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp @@ -109,7 +109,10 @@ #include #include #include +#include #include +#include +#include #include #include #include @@ -1438,6 +1441,34 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont } break; /* END CODEGEN PARSER GLUE: TFLOAT_DEGREES */ + /* BEGIN CODEGEN PARSER GLUE: TFLOAT_EXP */ + case AntlrSQLLexer::TFLOAT_EXP: + { + const auto argCount = context->expression().size(); + if (argCount != 2) + throw InvalidQuerySyntax("TFLOAT_EXP requires exactly 2 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(TfloatExpLogicalFunction(a0, a1)); + } + break; + /* END CODEGEN PARSER GLUE: TFLOAT_EXP */ /* BEGIN CODEGEN PARSER GLUE: TFLOAT_FLOOR */ case AntlrSQLLexer::TFLOAT_FLOOR: { @@ -1466,6 +1497,62 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont } break; /* END CODEGEN PARSER GLUE: TFLOAT_FLOOR */ + /* BEGIN CODEGEN PARSER GLUE: TFLOAT_LN */ + case AntlrSQLLexer::TFLOAT_LN: + { + const auto argCount = context->expression().size(); + if (argCount != 2) + throw InvalidQuerySyntax("TFLOAT_LN requires exactly 2 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(TfloatLnLogicalFunction(a0, a1)); + } + break; + /* END CODEGEN PARSER GLUE: TFLOAT_LN */ + /* BEGIN CODEGEN PARSER GLUE: TFLOAT_LOG10 */ + case AntlrSQLLexer::TFLOAT_LOG10: + { + const auto argCount = context->expression().size(); + if (argCount != 2) + throw InvalidQuerySyntax("TFLOAT_LOG10 requires exactly 2 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(TfloatLog10LogicalFunction(a0, a1)); + } + break; + /* END CODEGEN PARSER GLUE: TFLOAT_LOG10 */ /* BEGIN CODEGEN PARSER GLUE: TFLOAT_RADIANS */ case AntlrSQLLexer::TFLOAT_RADIANS: { From 367ebadf9c23316f0775f373d3f76739a976b29c Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Fri, 12 Jun 2026 08:43:23 +0200 Subject: [PATCH 19/96] feat(meos): add EVER_EQ/GE/GT/LE/LT/NE_TFLOAT_FLOAT NES operators (W61) 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. --- .../Meos/EverEqTfloatFloatLogicalFunction.hpp | 54 ++++++ .../Meos/EverGeTfloatFloatLogicalFunction.hpp | 54 ++++++ .../Meos/EverGtTfloatFloatLogicalFunction.hpp | 54 ++++++ .../Meos/EverLeTfloatFloatLogicalFunction.hpp | 54 ++++++ .../Meos/EverLtTfloatFloatLogicalFunction.hpp | 54 ++++++ .../Meos/EverNeTfloatFloatLogicalFunction.hpp | 54 ++++++ .../src/Functions/Meos/CMakeLists.txt | 6 + .../Meos/EverEqTfloatFloatLogicalFunction.cpp | 105 ++++++++++ .../Meos/EverGeTfloatFloatLogicalFunction.cpp | 105 ++++++++++ .../Meos/EverGtTfloatFloatLogicalFunction.cpp | 105 ++++++++++ .../Meos/EverLeTfloatFloatLogicalFunction.cpp | 105 ++++++++++ .../Meos/EverLtTfloatFloatLogicalFunction.cpp | 105 ++++++++++ .../Meos/EverNeTfloatFloatLogicalFunction.cpp | 105 ++++++++++ .../EverEqTfloatFloatPhysicalFunction.hpp | 43 +++++ .../EverGeTfloatFloatPhysicalFunction.hpp | 43 +++++ .../EverGtTfloatFloatPhysicalFunction.hpp | 43 +++++ .../EverLeTfloatFloatPhysicalFunction.hpp | 43 +++++ .../EverLtTfloatFloatPhysicalFunction.hpp | 43 +++++ .../EverNeTfloatFloatPhysicalFunction.hpp | 43 +++++ .../src/Functions/Meos/CMakeLists.txt | 6 + .../EverEqTfloatFloatPhysicalFunction.cpp | 88 +++++++++ .../EverGeTfloatFloatPhysicalFunction.cpp | 88 +++++++++ .../EverGtTfloatFloatPhysicalFunction.cpp | 88 +++++++++ .../EverLeTfloatFloatPhysicalFunction.cpp | 88 +++++++++ .../EverLtTfloatFloatPhysicalFunction.cpp | 88 +++++++++ .../EverNeTfloatFloatPhysicalFunction.cpp | 88 +++++++++ nes-sql-parser/AntlrSQL.g4 | 8 +- .../src/AntlrSQLQueryPlanCreator.cpp | 180 ++++++++++++++++++ 28 files changed, 1939 insertions(+), 1 deletion(-) create mode 100644 nes-logical-operators/include/Functions/Meos/EverEqTfloatFloatLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverGeTfloatFloatLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverGtTfloatFloatLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverLeTfloatFloatLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverLtTfloatFloatLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverNeTfloatFloatLogicalFunction.hpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverEqTfloatFloatLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverGeTfloatFloatLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverGtTfloatFloatLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverLeTfloatFloatLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverLtTfloatFloatLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverNeTfloatFloatLogicalFunction.cpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverEqTfloatFloatPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverGeTfloatFloatPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverGtTfloatFloatPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverLeTfloatFloatPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverLtTfloatFloatPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverNeTfloatFloatPhysicalFunction.hpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverEqTfloatFloatPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverGeTfloatFloatPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverGtTfloatFloatPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverLeTfloatFloatPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverLtTfloatFloatPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverNeTfloatFloatPhysicalFunction.cpp diff --git a/nes-logical-operators/include/Functions/Meos/EverEqTfloatFloatLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverEqTfloatFloatLogicalFunction.hpp new file mode 100644 index 0000000000..c70acdbb92 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverEqTfloatFloatLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event ever_eq_tfloat_float: tests if a single-instant tfloat value ever equals a threshold. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ever_eq_tfloat_float`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class EverEqTfloatFloatLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverEqTfloatFloat"; + + EverEqTfloatFloatLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverGeTfloatFloatLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverGeTfloatFloatLogicalFunction.hpp new file mode 100644 index 0000000000..22b39d8182 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverGeTfloatFloatLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event ever_ge_tfloat_float: tests if a single-instant tfloat value is ever >= a threshold. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ever_ge_tfloat_float`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class EverGeTfloatFloatLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverGeTfloatFloat"; + + EverGeTfloatFloatLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverGtTfloatFloatLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverGtTfloatFloatLogicalFunction.hpp new file mode 100644 index 0000000000..52f96894e9 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverGtTfloatFloatLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event ever_gt_tfloat_float: tests if a single-instant tfloat value is ever > a threshold. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ever_gt_tfloat_float`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class EverGtTfloatFloatLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverGtTfloatFloat"; + + EverGtTfloatFloatLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverLeTfloatFloatLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverLeTfloatFloatLogicalFunction.hpp new file mode 100644 index 0000000000..ac1bc8a633 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverLeTfloatFloatLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event ever_le_tfloat_float: tests if a single-instant tfloat value is ever <= a threshold. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ever_le_tfloat_float`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class EverLeTfloatFloatLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverLeTfloatFloat"; + + EverLeTfloatFloatLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverLtTfloatFloatLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverLtTfloatFloatLogicalFunction.hpp new file mode 100644 index 0000000000..599a583fb2 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverLtTfloatFloatLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event ever_lt_tfloat_float: tests if a single-instant tfloat value is ever < a threshold. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ever_lt_tfloat_float`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class EverLtTfloatFloatLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverLtTfloatFloat"; + + EverLtTfloatFloatLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverNeTfloatFloatLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverNeTfloatFloatLogicalFunction.hpp new file mode 100644 index 0000000000..08568d04ac --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverNeTfloatFloatLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event ever_ne_tfloat_float: tests if a single-instant tfloat value ever differs from a threshold. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ever_ne_tfloat_float`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class EverNeTfloatFloatLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverNeTfloatFloat"; + + EverNeTfloatFloatLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt index 269767f962..0c35460553 100644 --- a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt @@ -76,3 +76,9 @@ add_plugin(TfloatToTint LogicalFunction nes-logical-operators TfloatToTintLogica add_plugin(TintToTbigint LogicalFunction nes-logical-operators TintToTbigintLogicalFunction.cpp) add_plugin(TintToTfloat LogicalFunction nes-logical-operators TintToTfloatLogicalFunction.cpp) add_plugin(TnumberAbs LogicalFunction nes-logical-operators TnumberAbsLogicalFunction.cpp) +add_plugin(EverEqTfloatFloat LogicalFunction nes-logical-operators EverEqTfloatFloatLogicalFunction.cpp) +add_plugin(EverGeTfloatFloat LogicalFunction nes-logical-operators EverGeTfloatFloatLogicalFunction.cpp) +add_plugin(EverGtTfloatFloat LogicalFunction nes-logical-operators EverGtTfloatFloatLogicalFunction.cpp) +add_plugin(EverLeTfloatFloat LogicalFunction nes-logical-operators EverLeTfloatFloatLogicalFunction.cpp) +add_plugin(EverLtTfloatFloat LogicalFunction nes-logical-operators EverLtTfloatFloatLogicalFunction.cpp) +add_plugin(EverNeTfloatFloat LogicalFunction nes-logical-operators EverNeTfloatFloatLogicalFunction.cpp) diff --git a/nes-logical-operators/src/Functions/Meos/EverEqTfloatFloatLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverEqTfloatFloatLogicalFunction.cpp new file mode 100644 index 0000000000..58a752c660 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverEqTfloatFloatLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EverEqTfloatFloatLogicalFunction::EverEqTfloatFloatLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType EverEqTfloatFloatLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverEqTfloatFloatLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EverEqTfloatFloatLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverEqTfloatFloatLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "EverEqTfloatFloatLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EverEqTfloatFloatLogicalFunction::getType() const { return NAME; } + +bool EverEqTfloatFloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EverEqTfloatFloatLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction EverEqTfloatFloatLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction EverEqTfloatFloatLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverEqTfloatFloatLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "EverEqTfloatFloatLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return EverEqTfloatFloatLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverGeTfloatFloatLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverGeTfloatFloatLogicalFunction.cpp new file mode 100644 index 0000000000..c5e65c1630 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverGeTfloatFloatLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EverGeTfloatFloatLogicalFunction::EverGeTfloatFloatLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType EverGeTfloatFloatLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverGeTfloatFloatLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EverGeTfloatFloatLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverGeTfloatFloatLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "EverGeTfloatFloatLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EverGeTfloatFloatLogicalFunction::getType() const { return NAME; } + +bool EverGeTfloatFloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EverGeTfloatFloatLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction EverGeTfloatFloatLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction EverGeTfloatFloatLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverGeTfloatFloatLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "EverGeTfloatFloatLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return EverGeTfloatFloatLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverGtTfloatFloatLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverGtTfloatFloatLogicalFunction.cpp new file mode 100644 index 0000000000..59d09da9f5 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverGtTfloatFloatLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EverGtTfloatFloatLogicalFunction::EverGtTfloatFloatLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType EverGtTfloatFloatLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverGtTfloatFloatLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EverGtTfloatFloatLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverGtTfloatFloatLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "EverGtTfloatFloatLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EverGtTfloatFloatLogicalFunction::getType() const { return NAME; } + +bool EverGtTfloatFloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EverGtTfloatFloatLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction EverGtTfloatFloatLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction EverGtTfloatFloatLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverGtTfloatFloatLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "EverGtTfloatFloatLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return EverGtTfloatFloatLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverLeTfloatFloatLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverLeTfloatFloatLogicalFunction.cpp new file mode 100644 index 0000000000..d8da3f26e7 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverLeTfloatFloatLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EverLeTfloatFloatLogicalFunction::EverLeTfloatFloatLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType EverLeTfloatFloatLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverLeTfloatFloatLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EverLeTfloatFloatLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverLeTfloatFloatLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "EverLeTfloatFloatLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EverLeTfloatFloatLogicalFunction::getType() const { return NAME; } + +bool EverLeTfloatFloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EverLeTfloatFloatLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction EverLeTfloatFloatLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction EverLeTfloatFloatLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverLeTfloatFloatLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "EverLeTfloatFloatLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return EverLeTfloatFloatLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverLtTfloatFloatLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverLtTfloatFloatLogicalFunction.cpp new file mode 100644 index 0000000000..4dec444034 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverLtTfloatFloatLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EverLtTfloatFloatLogicalFunction::EverLtTfloatFloatLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType EverLtTfloatFloatLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverLtTfloatFloatLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EverLtTfloatFloatLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverLtTfloatFloatLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "EverLtTfloatFloatLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EverLtTfloatFloatLogicalFunction::getType() const { return NAME; } + +bool EverLtTfloatFloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EverLtTfloatFloatLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction EverLtTfloatFloatLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction EverLtTfloatFloatLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverLtTfloatFloatLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "EverLtTfloatFloatLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return EverLtTfloatFloatLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverNeTfloatFloatLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverNeTfloatFloatLogicalFunction.cpp new file mode 100644 index 0000000000..5ce1fbdbb9 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverNeTfloatFloatLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EverNeTfloatFloatLogicalFunction::EverNeTfloatFloatLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType EverNeTfloatFloatLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverNeTfloatFloatLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EverNeTfloatFloatLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverNeTfloatFloatLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "EverNeTfloatFloatLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EverNeTfloatFloatLogicalFunction::getType() const { return NAME; } + +bool EverNeTfloatFloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EverNeTfloatFloatLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction EverNeTfloatFloatLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction EverNeTfloatFloatLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverNeTfloatFloatLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "EverNeTfloatFloatLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return EverNeTfloatFloatLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverEqTfloatFloatPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverEqTfloatFloatPhysicalFunction.hpp new file mode 100644 index 0000000000..6a639a7d81 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverEqTfloatFloatPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `ever_eq_tfloat_float`. + * + * Per-event ever_eq_tfloat_float: tests if a single-instant tfloat value ever equals a threshold. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class EverEqTfloatFloatPhysicalFunction : public PhysicalFunctionConcept { +public: + EverEqTfloatFloatPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverGeTfloatFloatPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverGeTfloatFloatPhysicalFunction.hpp new file mode 100644 index 0000000000..71be2abc10 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverGeTfloatFloatPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `ever_ge_tfloat_float`. + * + * Per-event ever_ge_tfloat_float: tests if a single-instant tfloat value is ever >= a threshold. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class EverGeTfloatFloatPhysicalFunction : public PhysicalFunctionConcept { +public: + EverGeTfloatFloatPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverGtTfloatFloatPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverGtTfloatFloatPhysicalFunction.hpp new file mode 100644 index 0000000000..1d16f7234f --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverGtTfloatFloatPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `ever_gt_tfloat_float`. + * + * Per-event ever_gt_tfloat_float: tests if a single-instant tfloat value is ever > a threshold. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class EverGtTfloatFloatPhysicalFunction : public PhysicalFunctionConcept { +public: + EverGtTfloatFloatPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverLeTfloatFloatPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverLeTfloatFloatPhysicalFunction.hpp new file mode 100644 index 0000000000..6b2c963040 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverLeTfloatFloatPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `ever_le_tfloat_float`. + * + * Per-event ever_le_tfloat_float: tests if a single-instant tfloat value is ever <= a threshold. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class EverLeTfloatFloatPhysicalFunction : public PhysicalFunctionConcept { +public: + EverLeTfloatFloatPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverLtTfloatFloatPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverLtTfloatFloatPhysicalFunction.hpp new file mode 100644 index 0000000000..cc393311c9 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverLtTfloatFloatPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `ever_lt_tfloat_float`. + * + * Per-event ever_lt_tfloat_float: tests if a single-instant tfloat value is ever < a threshold. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class EverLtTfloatFloatPhysicalFunction : public PhysicalFunctionConcept { +public: + EverLtTfloatFloatPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverNeTfloatFloatPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverNeTfloatFloatPhysicalFunction.hpp new file mode 100644 index 0000000000..61ae514722 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverNeTfloatFloatPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `ever_ne_tfloat_float`. + * + * Per-event ever_ne_tfloat_float: tests if a single-instant tfloat value ever differs from a threshold. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class EverNeTfloatFloatPhysicalFunction : public PhysicalFunctionConcept { +public: + EverNeTfloatFloatPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt index 36c772b8d9..43cddd97b6 100644 --- a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt @@ -75,4 +75,10 @@ add_plugin(TfloatToTint PhysicalFunction nes-physical-operators TfloatToTintPhys add_plugin(TintToTbigint PhysicalFunction nes-physical-operators TintToTbigintPhysicalFunction.cpp) add_plugin(TintToTfloat PhysicalFunction nes-physical-operators TintToTfloatPhysicalFunction.cpp) add_plugin(TnumberAbs PhysicalFunction nes-physical-operators TnumberAbsPhysicalFunction.cpp) +add_plugin(EverEqTfloatFloat PhysicalFunction nes-physical-operators EverEqTfloatFloatPhysicalFunction.cpp) +add_plugin(EverGeTfloatFloat PhysicalFunction nes-physical-operators EverGeTfloatFloatPhysicalFunction.cpp) +add_plugin(EverGtTfloatFloat PhysicalFunction nes-physical-operators EverGtTfloatFloatPhysicalFunction.cpp) +add_plugin(EverLeTfloatFloat PhysicalFunction nes-physical-operators EverLeTfloatFloatPhysicalFunction.cpp) +add_plugin(EverLtTfloatFloat PhysicalFunction nes-physical-operators EverLtTfloatFloatPhysicalFunction.cpp) +add_plugin(EverNeTfloatFloat PhysicalFunction nes-physical-operators EverNeTfloatFloatPhysicalFunction.cpp) endif() diff --git a/nes-physical-operators/src/Functions/Meos/EverEqTfloatFloatPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverEqTfloatFloatPhysicalFunction.cpp new file mode 100644 index 0000000000..86aa083ad2 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverEqTfloatFloatPhysicalFunction.cpp @@ -0,0 +1,88 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +EverEqTfloatFloatPhysicalFunction::EverEqTfloatFloatPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(thresholdFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal EverEqTfloatFloatPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto threshold = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double value, double threshold, uint64_t ts) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string tempWkt = fmt::format("{}@{}", value, MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tfloat_in(tempWkt.c_str()); + if (!temp) return 0.0; + int r = ever_eq_tfloat_float(temp, threshold); + free(temp); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + value, threshold, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverEqTfloatFloatPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "EverEqTfloatFloatPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return EverEqTfloatFloatPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverGeTfloatFloatPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverGeTfloatFloatPhysicalFunction.cpp new file mode 100644 index 0000000000..d234284498 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverGeTfloatFloatPhysicalFunction.cpp @@ -0,0 +1,88 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +EverGeTfloatFloatPhysicalFunction::EverGeTfloatFloatPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(thresholdFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal EverGeTfloatFloatPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto threshold = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double value, double threshold, uint64_t ts) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string tempWkt = fmt::format("{}@{}", value, MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tfloat_in(tempWkt.c_str()); + if (!temp) return 0.0; + int r = ever_ge_tfloat_float(temp, threshold); + free(temp); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + value, threshold, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverGeTfloatFloatPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "EverGeTfloatFloatPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return EverGeTfloatFloatPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverGtTfloatFloatPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverGtTfloatFloatPhysicalFunction.cpp new file mode 100644 index 0000000000..a8ba01257d --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverGtTfloatFloatPhysicalFunction.cpp @@ -0,0 +1,88 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +EverGtTfloatFloatPhysicalFunction::EverGtTfloatFloatPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(thresholdFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal EverGtTfloatFloatPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto threshold = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double value, double threshold, uint64_t ts) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string tempWkt = fmt::format("{}@{}", value, MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tfloat_in(tempWkt.c_str()); + if (!temp) return 0.0; + int r = ever_gt_tfloat_float(temp, threshold); + free(temp); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + value, threshold, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverGtTfloatFloatPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "EverGtTfloatFloatPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return EverGtTfloatFloatPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverLeTfloatFloatPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverLeTfloatFloatPhysicalFunction.cpp new file mode 100644 index 0000000000..2724078153 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverLeTfloatFloatPhysicalFunction.cpp @@ -0,0 +1,88 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +EverLeTfloatFloatPhysicalFunction::EverLeTfloatFloatPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(thresholdFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal EverLeTfloatFloatPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto threshold = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double value, double threshold, uint64_t ts) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string tempWkt = fmt::format("{}@{}", value, MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tfloat_in(tempWkt.c_str()); + if (!temp) return 0.0; + int r = ever_le_tfloat_float(temp, threshold); + free(temp); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + value, threshold, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverLeTfloatFloatPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "EverLeTfloatFloatPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return EverLeTfloatFloatPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverLtTfloatFloatPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverLtTfloatFloatPhysicalFunction.cpp new file mode 100644 index 0000000000..7717a654f2 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverLtTfloatFloatPhysicalFunction.cpp @@ -0,0 +1,88 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +EverLtTfloatFloatPhysicalFunction::EverLtTfloatFloatPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(thresholdFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal EverLtTfloatFloatPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto threshold = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double value, double threshold, uint64_t ts) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string tempWkt = fmt::format("{}@{}", value, MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tfloat_in(tempWkt.c_str()); + if (!temp) return 0.0; + int r = ever_lt_tfloat_float(temp, threshold); + free(temp); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + value, threshold, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverLtTfloatFloatPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "EverLtTfloatFloatPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return EverLtTfloatFloatPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverNeTfloatFloatPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverNeTfloatFloatPhysicalFunction.cpp new file mode 100644 index 0000000000..681b87ea0e --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverNeTfloatFloatPhysicalFunction.cpp @@ -0,0 +1,88 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +EverNeTfloatFloatPhysicalFunction::EverNeTfloatFloatPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(thresholdFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal EverNeTfloatFloatPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto threshold = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double value, double threshold, uint64_t ts) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string tempWkt = fmt::format("{}@{}", value, MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tfloat_in(tempWkt.c_str()); + if (!temp) return 0.0; + int r = ever_ne_tfloat_float(temp, threshold); + free(temp); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + value, threshold, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverNeTfloatFloatPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "EverNeTfloatFloatPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return EverNeTfloatFloatPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-sql-parser/AntlrSQL.g4 b/nes-sql-parser/AntlrSQL.g4 index 141cb35cf1..ec195f471d 100644 --- a/nes-sql-parser/AntlrSQL.g4 +++ b/nes-sql-parser/AntlrSQL.g4 @@ -295,7 +295,7 @@ timeUnit: MS timestampParameter: name=identifier; -functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | EDWITHIN_TGEO_GEO | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS; +functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | EDWITHIN_TGEO_GEO | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS; sinkClause: INTO sink (',' sink)*; @@ -487,6 +487,12 @@ TEMPORAL_EINTERSECTS_GEOMETRY: 'TEMPORAL_EINTERSECTS_GEOMETRY' | 'temporal_einte TEMPORAL_AINTERSECTS_GEOMETRY: 'TEMPORAL_AINTERSECTS_GEOMETRY' | 'temporal_aintersects_geometry'; TEMPORAL_ECONTAINS_GEOMETRY: 'TEMPORAL_ECONTAINS_GEOMETRY' | 'temporal_econtains_geometry'; EDWITHIN_TGEO_GEO: 'EDWITHIN_TGEO_GEO' | 'edwithin_tgeo_geo'; +EVER_EQ_TFLOAT_FLOAT: 'EVER_EQ_TFLOAT_FLOAT' | 'ever_eq_tfloat_float'; +EVER_GE_TFLOAT_FLOAT: 'EVER_GE_TFLOAT_FLOAT' | 'ever_ge_tfloat_float'; +EVER_GT_TFLOAT_FLOAT: 'EVER_GT_TFLOAT_FLOAT' | 'ever_gt_tfloat_float'; +EVER_LE_TFLOAT_FLOAT: 'EVER_LE_TFLOAT_FLOAT' | 'ever_le_tfloat_float'; +EVER_LT_TFLOAT_FLOAT: 'EVER_LT_TFLOAT_FLOAT' | 'ever_lt_tfloat_float'; +EVER_NE_TFLOAT_FLOAT: 'EVER_NE_TFLOAT_FLOAT' | 'ever_ne_tfloat_float'; TGEO_AT_STBOX: 'TGEO_AT_STBOX' | 'tgeo_at_stbox'; ADD_BIGINT_TBIGINT: 'ADD_BIGINT_TBIGINT' | 'add_bigint_tbigint'; ADD_FLOAT_TFLOAT: 'ADD_FLOAT_TFLOAT' | 'add_float_tfloat'; diff --git a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp index e5d23de442..545ac88c27 100644 --- a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp +++ b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp @@ -127,6 +127,12 @@ #include #include #include +#include +#include +#include +#include +#include +#include #include #include #include @@ -2914,6 +2920,180 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont } break; /* END CODEGEN PARSER GLUE: TINT_TO_TFLOAT */ + /* BEGIN CODEGEN PARSER GLUE: EVER_EQ_TFLOAT_FLOAT */ + case AntlrSQLLexer::EVER_EQ_TFLOAT_FLOAT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("EVER_EQ_TFLOAT_FLOAT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverEqTfloatFloatLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: EVER_EQ_TFLOAT_FLOAT */ + /* BEGIN CODEGEN PARSER GLUE: EVER_GE_TFLOAT_FLOAT */ + case AntlrSQLLexer::EVER_GE_TFLOAT_FLOAT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("EVER_GE_TFLOAT_FLOAT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverGeTfloatFloatLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: EVER_GE_TFLOAT_FLOAT */ + /* BEGIN CODEGEN PARSER GLUE: EVER_GT_TFLOAT_FLOAT */ + case AntlrSQLLexer::EVER_GT_TFLOAT_FLOAT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("EVER_GT_TFLOAT_FLOAT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverGtTfloatFloatLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: EVER_GT_TFLOAT_FLOAT */ + /* BEGIN CODEGEN PARSER GLUE: EVER_LE_TFLOAT_FLOAT */ + case AntlrSQLLexer::EVER_LE_TFLOAT_FLOAT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("EVER_LE_TFLOAT_FLOAT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverLeTfloatFloatLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: EVER_LE_TFLOAT_FLOAT */ + /* BEGIN CODEGEN PARSER GLUE: EVER_LT_TFLOAT_FLOAT */ + case AntlrSQLLexer::EVER_LT_TFLOAT_FLOAT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("EVER_LT_TFLOAT_FLOAT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverLtTfloatFloatLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: EVER_LT_TFLOAT_FLOAT */ + /* BEGIN CODEGEN PARSER GLUE: EVER_NE_TFLOAT_FLOAT */ + case AntlrSQLLexer::EVER_NE_TFLOAT_FLOAT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("EVER_NE_TFLOAT_FLOAT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverNeTfloatFloatLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: EVER_NE_TFLOAT_FLOAT */ default: /// Check if the function is a constructor for a datatype From 2c9998dec9fb03bdbac655d15643b028c21b5eb9 Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Fri, 12 Jun 2026 08:50:09 +0200 Subject: [PATCH 20/96] feat(meos): add ALWAYS_EQ/GE/GT/LE/LT/NE_TFLOAT_FLOAT NES operators (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. --- .../AlwaysEqTfloatFloatLogicalFunction.hpp | 54 ++++++ .../AlwaysGeTfloatFloatLogicalFunction.hpp | 54 ++++++ .../AlwaysGtTfloatFloatLogicalFunction.hpp | 54 ++++++ .../AlwaysLeTfloatFloatLogicalFunction.hpp | 54 ++++++ .../AlwaysLtTfloatFloatLogicalFunction.hpp | 54 ++++++ .../AlwaysNeTfloatFloatLogicalFunction.hpp | 54 ++++++ .../AlwaysEqTfloatFloatLogicalFunction.cpp | 105 ++++++++++ .../AlwaysGeTfloatFloatLogicalFunction.cpp | 105 ++++++++++ .../AlwaysGtTfloatFloatLogicalFunction.cpp | 105 ++++++++++ .../AlwaysLeTfloatFloatLogicalFunction.cpp | 105 ++++++++++ .../AlwaysLtTfloatFloatLogicalFunction.cpp | 105 ++++++++++ .../AlwaysNeTfloatFloatLogicalFunction.cpp | 105 ++++++++++ .../src/Functions/Meos/CMakeLists.txt | 6 + .../AlwaysEqTfloatFloatPhysicalFunction.hpp | 43 +++++ .../AlwaysGeTfloatFloatPhysicalFunction.hpp | 43 +++++ .../AlwaysGtTfloatFloatPhysicalFunction.hpp | 43 +++++ .../AlwaysLeTfloatFloatPhysicalFunction.hpp | 43 +++++ .../AlwaysLtTfloatFloatPhysicalFunction.hpp | 43 +++++ .../AlwaysNeTfloatFloatPhysicalFunction.hpp | 43 +++++ .../AlwaysEqTfloatFloatPhysicalFunction.cpp | 88 +++++++++ .../AlwaysGeTfloatFloatPhysicalFunction.cpp | 88 +++++++++ .../AlwaysGtTfloatFloatPhysicalFunction.cpp | 88 +++++++++ .../AlwaysLeTfloatFloatPhysicalFunction.cpp | 88 +++++++++ .../AlwaysLtTfloatFloatPhysicalFunction.cpp | 88 +++++++++ .../AlwaysNeTfloatFloatPhysicalFunction.cpp | 88 +++++++++ .../src/Functions/Meos/CMakeLists.txt | 6 + nes-sql-parser/AntlrSQL.g4 | 8 +- .../src/AntlrSQLQueryPlanCreator.cpp | 180 ++++++++++++++++++ 28 files changed, 1939 insertions(+), 1 deletion(-) create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysEqTfloatFloatLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysGeTfloatFloatLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysGtTfloatFloatLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysLeTfloatFloatLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysLtTfloatFloatLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysNeTfloatFloatLogicalFunction.hpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysEqTfloatFloatLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysGeTfloatFloatLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysGtTfloatFloatLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysLeTfloatFloatLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysLtTfloatFloatLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysNeTfloatFloatLogicalFunction.cpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysEqTfloatFloatPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysGeTfloatFloatPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysGtTfloatFloatPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysLeTfloatFloatPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysLtTfloatFloatPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysNeTfloatFloatPhysicalFunction.hpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysEqTfloatFloatPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysGeTfloatFloatPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysGtTfloatFloatPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysLeTfloatFloatPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysLtTfloatFloatPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysNeTfloatFloatPhysicalFunction.cpp diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysEqTfloatFloatLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysEqTfloatFloatLogicalFunction.hpp new file mode 100644 index 0000000000..4feb84d46e --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysEqTfloatFloatLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event always_eq_tfloat_float: tests if a single-instant tfloat value always equals a threshold. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `always_eq_tfloat_float`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class AlwaysEqTfloatFloatLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysEqTfloatFloat"; + + AlwaysEqTfloatFloatLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysGeTfloatFloatLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysGeTfloatFloatLogicalFunction.hpp new file mode 100644 index 0000000000..a7ef047a6b --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysGeTfloatFloatLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event always_ge_tfloat_float: tests if a single-instant tfloat value always is greater than or equal to a threshold. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `always_ge_tfloat_float`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class AlwaysGeTfloatFloatLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysGeTfloatFloat"; + + AlwaysGeTfloatFloatLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysGtTfloatFloatLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysGtTfloatFloatLogicalFunction.hpp new file mode 100644 index 0000000000..f85e4558e1 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysGtTfloatFloatLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event always_gt_tfloat_float: tests if a single-instant tfloat value always is greater than a threshold. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `always_gt_tfloat_float`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class AlwaysGtTfloatFloatLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysGtTfloatFloat"; + + AlwaysGtTfloatFloatLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysLeTfloatFloatLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysLeTfloatFloatLogicalFunction.hpp new file mode 100644 index 0000000000..1ce49d77a7 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysLeTfloatFloatLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event always_le_tfloat_float: tests if a single-instant tfloat value always is less than or equal to a threshold. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `always_le_tfloat_float`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class AlwaysLeTfloatFloatLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysLeTfloatFloat"; + + AlwaysLeTfloatFloatLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysLtTfloatFloatLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysLtTfloatFloatLogicalFunction.hpp new file mode 100644 index 0000000000..fbf9801378 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysLtTfloatFloatLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event always_lt_tfloat_float: tests if a single-instant tfloat value always is less than a threshold. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `always_lt_tfloat_float`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class AlwaysLtTfloatFloatLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysLtTfloatFloat"; + + AlwaysLtTfloatFloatLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysNeTfloatFloatLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysNeTfloatFloatLogicalFunction.hpp new file mode 100644 index 0000000000..7a80868519 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysNeTfloatFloatLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event always_ne_tfloat_float: tests if a single-instant tfloat value always is not equal to a threshold. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `always_ne_tfloat_float`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class AlwaysNeTfloatFloatLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysNeTfloatFloat"; + + AlwaysNeTfloatFloatLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysEqTfloatFloatLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysEqTfloatFloatLogicalFunction.cpp new file mode 100644 index 0000000000..d7a01dae71 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysEqTfloatFloatLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AlwaysEqTfloatFloatLogicalFunction::AlwaysEqTfloatFloatLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType AlwaysEqTfloatFloatLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysEqTfloatFloatLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AlwaysEqTfloatFloatLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysEqTfloatFloatLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "AlwaysEqTfloatFloatLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AlwaysEqTfloatFloatLogicalFunction::getType() const { return NAME; } + +bool AlwaysEqTfloatFloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AlwaysEqTfloatFloatLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction AlwaysEqTfloatFloatLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction AlwaysEqTfloatFloatLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysEqTfloatFloatLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "AlwaysEqTfloatFloatLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return AlwaysEqTfloatFloatLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysGeTfloatFloatLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysGeTfloatFloatLogicalFunction.cpp new file mode 100644 index 0000000000..712d202b14 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysGeTfloatFloatLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AlwaysGeTfloatFloatLogicalFunction::AlwaysGeTfloatFloatLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType AlwaysGeTfloatFloatLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysGeTfloatFloatLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AlwaysGeTfloatFloatLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysGeTfloatFloatLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "AlwaysGeTfloatFloatLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AlwaysGeTfloatFloatLogicalFunction::getType() const { return NAME; } + +bool AlwaysGeTfloatFloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AlwaysGeTfloatFloatLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction AlwaysGeTfloatFloatLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction AlwaysGeTfloatFloatLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysGeTfloatFloatLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "AlwaysGeTfloatFloatLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return AlwaysGeTfloatFloatLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysGtTfloatFloatLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysGtTfloatFloatLogicalFunction.cpp new file mode 100644 index 0000000000..8edb267dca --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysGtTfloatFloatLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AlwaysGtTfloatFloatLogicalFunction::AlwaysGtTfloatFloatLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType AlwaysGtTfloatFloatLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysGtTfloatFloatLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AlwaysGtTfloatFloatLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysGtTfloatFloatLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "AlwaysGtTfloatFloatLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AlwaysGtTfloatFloatLogicalFunction::getType() const { return NAME; } + +bool AlwaysGtTfloatFloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AlwaysGtTfloatFloatLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction AlwaysGtTfloatFloatLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction AlwaysGtTfloatFloatLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysGtTfloatFloatLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "AlwaysGtTfloatFloatLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return AlwaysGtTfloatFloatLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysLeTfloatFloatLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysLeTfloatFloatLogicalFunction.cpp new file mode 100644 index 0000000000..95d2c44151 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysLeTfloatFloatLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AlwaysLeTfloatFloatLogicalFunction::AlwaysLeTfloatFloatLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType AlwaysLeTfloatFloatLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysLeTfloatFloatLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AlwaysLeTfloatFloatLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysLeTfloatFloatLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "AlwaysLeTfloatFloatLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AlwaysLeTfloatFloatLogicalFunction::getType() const { return NAME; } + +bool AlwaysLeTfloatFloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AlwaysLeTfloatFloatLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction AlwaysLeTfloatFloatLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction AlwaysLeTfloatFloatLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysLeTfloatFloatLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "AlwaysLeTfloatFloatLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return AlwaysLeTfloatFloatLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysLtTfloatFloatLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysLtTfloatFloatLogicalFunction.cpp new file mode 100644 index 0000000000..44fedc6124 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysLtTfloatFloatLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AlwaysLtTfloatFloatLogicalFunction::AlwaysLtTfloatFloatLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType AlwaysLtTfloatFloatLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysLtTfloatFloatLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AlwaysLtTfloatFloatLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysLtTfloatFloatLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "AlwaysLtTfloatFloatLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AlwaysLtTfloatFloatLogicalFunction::getType() const { return NAME; } + +bool AlwaysLtTfloatFloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AlwaysLtTfloatFloatLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction AlwaysLtTfloatFloatLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction AlwaysLtTfloatFloatLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysLtTfloatFloatLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "AlwaysLtTfloatFloatLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return AlwaysLtTfloatFloatLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysNeTfloatFloatLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysNeTfloatFloatLogicalFunction.cpp new file mode 100644 index 0000000000..fab1dbb741 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysNeTfloatFloatLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AlwaysNeTfloatFloatLogicalFunction::AlwaysNeTfloatFloatLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType AlwaysNeTfloatFloatLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysNeTfloatFloatLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AlwaysNeTfloatFloatLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysNeTfloatFloatLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "AlwaysNeTfloatFloatLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AlwaysNeTfloatFloatLogicalFunction::getType() const { return NAME; } + +bool AlwaysNeTfloatFloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AlwaysNeTfloatFloatLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction AlwaysNeTfloatFloatLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction AlwaysNeTfloatFloatLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysNeTfloatFloatLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "AlwaysNeTfloatFloatLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return AlwaysNeTfloatFloatLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt index 0c35460553..f80fb56ab9 100644 --- a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt @@ -82,3 +82,9 @@ add_plugin(EverGtTfloatFloat LogicalFunction nes-logical-operators EverGtTfloatF add_plugin(EverLeTfloatFloat LogicalFunction nes-logical-operators EverLeTfloatFloatLogicalFunction.cpp) add_plugin(EverLtTfloatFloat LogicalFunction nes-logical-operators EverLtTfloatFloatLogicalFunction.cpp) add_plugin(EverNeTfloatFloat LogicalFunction nes-logical-operators EverNeTfloatFloatLogicalFunction.cpp) +add_plugin(AlwaysEqTfloatFloat LogicalFunction nes-logical-operators AlwaysEqTfloatFloatLogicalFunction.cpp) +add_plugin(AlwaysGeTfloatFloat LogicalFunction nes-logical-operators AlwaysGeTfloatFloatLogicalFunction.cpp) +add_plugin(AlwaysGtTfloatFloat LogicalFunction nes-logical-operators AlwaysGtTfloatFloatLogicalFunction.cpp) +add_plugin(AlwaysLeTfloatFloat LogicalFunction nes-logical-operators AlwaysLeTfloatFloatLogicalFunction.cpp) +add_plugin(AlwaysLtTfloatFloat LogicalFunction nes-logical-operators AlwaysLtTfloatFloatLogicalFunction.cpp) +add_plugin(AlwaysNeTfloatFloat LogicalFunction nes-logical-operators AlwaysNeTfloatFloatLogicalFunction.cpp) diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysEqTfloatFloatPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysEqTfloatFloatPhysicalFunction.hpp new file mode 100644 index 0000000000..0e439990e7 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysEqTfloatFloatPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `always_eq_tfloat_float`. + * + * Per-event always_eq_tfloat_float: tests if a single-instant tfloat value always equals a threshold. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class AlwaysEqTfloatFloatPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysEqTfloatFloatPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysGeTfloatFloatPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysGeTfloatFloatPhysicalFunction.hpp new file mode 100644 index 0000000000..4bda09b03d --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysGeTfloatFloatPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `always_ge_tfloat_float`. + * + * Per-event always_ge_tfloat_float: tests if a single-instant tfloat value always is greater than or equal to a threshold. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class AlwaysGeTfloatFloatPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysGeTfloatFloatPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysGtTfloatFloatPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysGtTfloatFloatPhysicalFunction.hpp new file mode 100644 index 0000000000..7272583f06 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysGtTfloatFloatPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `always_gt_tfloat_float`. + * + * Per-event always_gt_tfloat_float: tests if a single-instant tfloat value always is greater than a threshold. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class AlwaysGtTfloatFloatPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysGtTfloatFloatPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysLeTfloatFloatPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysLeTfloatFloatPhysicalFunction.hpp new file mode 100644 index 0000000000..38e9384ce4 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysLeTfloatFloatPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `always_le_tfloat_float`. + * + * Per-event always_le_tfloat_float: tests if a single-instant tfloat value always is less than or equal to a threshold. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class AlwaysLeTfloatFloatPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysLeTfloatFloatPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysLtTfloatFloatPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysLtTfloatFloatPhysicalFunction.hpp new file mode 100644 index 0000000000..bce18200bf --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysLtTfloatFloatPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `always_lt_tfloat_float`. + * + * Per-event always_lt_tfloat_float: tests if a single-instant tfloat value always is less than a threshold. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class AlwaysLtTfloatFloatPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysLtTfloatFloatPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysNeTfloatFloatPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysNeTfloatFloatPhysicalFunction.hpp new file mode 100644 index 0000000000..bb6fd34c50 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysNeTfloatFloatPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `always_ne_tfloat_float`. + * + * Per-event always_ne_tfloat_float: tests if a single-instant tfloat value always is not equal to a threshold. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class AlwaysNeTfloatFloatPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysNeTfloatFloatPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysEqTfloatFloatPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysEqTfloatFloatPhysicalFunction.cpp new file mode 100644 index 0000000000..d80ba1d066 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysEqTfloatFloatPhysicalFunction.cpp @@ -0,0 +1,88 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +AlwaysEqTfloatFloatPhysicalFunction::AlwaysEqTfloatFloatPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(thresholdFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal AlwaysEqTfloatFloatPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto threshold = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double value, double threshold, uint64_t ts) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string tempWkt = fmt::format("{}@{}", value, MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tfloat_in(tempWkt.c_str()); + if (!temp) return 0.0; + int r = always_eq_tfloat_float(temp, threshold); + free(temp); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + value, threshold, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysEqTfloatFloatPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "AlwaysEqTfloatFloatPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return AlwaysEqTfloatFloatPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysGeTfloatFloatPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysGeTfloatFloatPhysicalFunction.cpp new file mode 100644 index 0000000000..58d7b4dfa2 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysGeTfloatFloatPhysicalFunction.cpp @@ -0,0 +1,88 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +AlwaysGeTfloatFloatPhysicalFunction::AlwaysGeTfloatFloatPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(thresholdFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal AlwaysGeTfloatFloatPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto threshold = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double value, double threshold, uint64_t ts) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string tempWkt = fmt::format("{}@{}", value, MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tfloat_in(tempWkt.c_str()); + if (!temp) return 0.0; + int r = always_ge_tfloat_float(temp, threshold); + free(temp); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + value, threshold, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysGeTfloatFloatPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "AlwaysGeTfloatFloatPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return AlwaysGeTfloatFloatPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysGtTfloatFloatPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysGtTfloatFloatPhysicalFunction.cpp new file mode 100644 index 0000000000..734a308e51 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysGtTfloatFloatPhysicalFunction.cpp @@ -0,0 +1,88 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +AlwaysGtTfloatFloatPhysicalFunction::AlwaysGtTfloatFloatPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(thresholdFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal AlwaysGtTfloatFloatPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto threshold = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double value, double threshold, uint64_t ts) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string tempWkt = fmt::format("{}@{}", value, MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tfloat_in(tempWkt.c_str()); + if (!temp) return 0.0; + int r = always_gt_tfloat_float(temp, threshold); + free(temp); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + value, threshold, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysGtTfloatFloatPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "AlwaysGtTfloatFloatPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return AlwaysGtTfloatFloatPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysLeTfloatFloatPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysLeTfloatFloatPhysicalFunction.cpp new file mode 100644 index 0000000000..8fbcab93d5 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysLeTfloatFloatPhysicalFunction.cpp @@ -0,0 +1,88 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +AlwaysLeTfloatFloatPhysicalFunction::AlwaysLeTfloatFloatPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(thresholdFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal AlwaysLeTfloatFloatPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto threshold = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double value, double threshold, uint64_t ts) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string tempWkt = fmt::format("{}@{}", value, MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tfloat_in(tempWkt.c_str()); + if (!temp) return 0.0; + int r = always_le_tfloat_float(temp, threshold); + free(temp); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + value, threshold, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysLeTfloatFloatPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "AlwaysLeTfloatFloatPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return AlwaysLeTfloatFloatPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysLtTfloatFloatPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysLtTfloatFloatPhysicalFunction.cpp new file mode 100644 index 0000000000..e3c12b1c89 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysLtTfloatFloatPhysicalFunction.cpp @@ -0,0 +1,88 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +AlwaysLtTfloatFloatPhysicalFunction::AlwaysLtTfloatFloatPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(thresholdFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal AlwaysLtTfloatFloatPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto threshold = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double value, double threshold, uint64_t ts) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string tempWkt = fmt::format("{}@{}", value, MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tfloat_in(tempWkt.c_str()); + if (!temp) return 0.0; + int r = always_lt_tfloat_float(temp, threshold); + free(temp); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + value, threshold, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysLtTfloatFloatPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "AlwaysLtTfloatFloatPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return AlwaysLtTfloatFloatPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysNeTfloatFloatPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysNeTfloatFloatPhysicalFunction.cpp new file mode 100644 index 0000000000..769c701a99 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysNeTfloatFloatPhysicalFunction.cpp @@ -0,0 +1,88 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +AlwaysNeTfloatFloatPhysicalFunction::AlwaysNeTfloatFloatPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(thresholdFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal AlwaysNeTfloatFloatPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto threshold = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double value, double threshold, uint64_t ts) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string tempWkt = fmt::format("{}@{}", value, MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tfloat_in(tempWkt.c_str()); + if (!temp) return 0.0; + int r = always_ne_tfloat_float(temp, threshold); + free(temp); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + value, threshold, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysNeTfloatFloatPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "AlwaysNeTfloatFloatPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return AlwaysNeTfloatFloatPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt index 43cddd97b6..1cf15e45be 100644 --- a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt @@ -81,4 +81,10 @@ add_plugin(EverGtTfloatFloat PhysicalFunction nes-physical-operators EverGtTfloa add_plugin(EverLeTfloatFloat PhysicalFunction nes-physical-operators EverLeTfloatFloatPhysicalFunction.cpp) add_plugin(EverLtTfloatFloat PhysicalFunction nes-physical-operators EverLtTfloatFloatPhysicalFunction.cpp) add_plugin(EverNeTfloatFloat PhysicalFunction nes-physical-operators EverNeTfloatFloatPhysicalFunction.cpp) +add_plugin(AlwaysEqTfloatFloat PhysicalFunction nes-physical-operators AlwaysEqTfloatFloatPhysicalFunction.cpp) +add_plugin(AlwaysGeTfloatFloat PhysicalFunction nes-physical-operators AlwaysGeTfloatFloatPhysicalFunction.cpp) +add_plugin(AlwaysGtTfloatFloat PhysicalFunction nes-physical-operators AlwaysGtTfloatFloatPhysicalFunction.cpp) +add_plugin(AlwaysLeTfloatFloat PhysicalFunction nes-physical-operators AlwaysLeTfloatFloatPhysicalFunction.cpp) +add_plugin(AlwaysLtTfloatFloat PhysicalFunction nes-physical-operators AlwaysLtTfloatFloatPhysicalFunction.cpp) +add_plugin(AlwaysNeTfloatFloat PhysicalFunction nes-physical-operators AlwaysNeTfloatFloatPhysicalFunction.cpp) endif() diff --git a/nes-sql-parser/AntlrSQL.g4 b/nes-sql-parser/AntlrSQL.g4 index ec195f471d..28cd19856c 100644 --- a/nes-sql-parser/AntlrSQL.g4 +++ b/nes-sql-parser/AntlrSQL.g4 @@ -295,7 +295,7 @@ timeUnit: MS timestampParameter: name=identifier; -functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | EDWITHIN_TGEO_GEO | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS; +functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | EDWITHIN_TGEO_GEO | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS; sinkClause: INTO sink (',' sink)*; @@ -486,6 +486,12 @@ TEMPORAL_SEQUENCE: 'TEMPORAL_SEQUENCE' | 'temporal_sequence'; TEMPORAL_EINTERSECTS_GEOMETRY: 'TEMPORAL_EINTERSECTS_GEOMETRY' | 'temporal_eintersects_geometry'; TEMPORAL_AINTERSECTS_GEOMETRY: 'TEMPORAL_AINTERSECTS_GEOMETRY' | 'temporal_aintersects_geometry'; TEMPORAL_ECONTAINS_GEOMETRY: 'TEMPORAL_ECONTAINS_GEOMETRY' | 'temporal_econtains_geometry'; +ALWAYS_EQ_TFLOAT_FLOAT: 'ALWAYS_EQ_TFLOAT_FLOAT' | 'always_eq_tfloat_float'; +ALWAYS_GE_TFLOAT_FLOAT: 'ALWAYS_GE_TFLOAT_FLOAT' | 'always_ge_tfloat_float'; +ALWAYS_GT_TFLOAT_FLOAT: 'ALWAYS_GT_TFLOAT_FLOAT' | 'always_gt_tfloat_float'; +ALWAYS_LE_TFLOAT_FLOAT: 'ALWAYS_LE_TFLOAT_FLOAT' | 'always_le_tfloat_float'; +ALWAYS_LT_TFLOAT_FLOAT: 'ALWAYS_LT_TFLOAT_FLOAT' | 'always_lt_tfloat_float'; +ALWAYS_NE_TFLOAT_FLOAT: 'ALWAYS_NE_TFLOAT_FLOAT' | 'always_ne_tfloat_float'; EDWITHIN_TGEO_GEO: 'EDWITHIN_TGEO_GEO' | 'edwithin_tgeo_geo'; EVER_EQ_TFLOAT_FLOAT: 'EVER_EQ_TFLOAT_FLOAT' | 'ever_eq_tfloat_float'; EVER_GE_TFLOAT_FLOAT: 'EVER_GE_TFLOAT_FLOAT' | 'ever_ge_tfloat_float'; diff --git a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp index 545ac88c27..40fe84a909 100644 --- a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp +++ b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp @@ -133,6 +133,12 @@ #include #include #include +#include +#include +#include +#include +#include +#include #include #include #include @@ -3094,6 +3100,180 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont } break; /* END CODEGEN PARSER GLUE: EVER_NE_TFLOAT_FLOAT */ + /* BEGIN CODEGEN PARSER GLUE: ALWAYS_EQ_TFLOAT_FLOAT */ + case AntlrSQLLexer::ALWAYS_EQ_TFLOAT_FLOAT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("ALWAYS_EQ_TFLOAT_FLOAT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AlwaysEqTfloatFloatLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: ALWAYS_EQ_TFLOAT_FLOAT */ + /* BEGIN CODEGEN PARSER GLUE: ALWAYS_GE_TFLOAT_FLOAT */ + case AntlrSQLLexer::ALWAYS_GE_TFLOAT_FLOAT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("ALWAYS_GE_TFLOAT_FLOAT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AlwaysGeTfloatFloatLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: ALWAYS_GE_TFLOAT_FLOAT */ + /* BEGIN CODEGEN PARSER GLUE: ALWAYS_GT_TFLOAT_FLOAT */ + case AntlrSQLLexer::ALWAYS_GT_TFLOAT_FLOAT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("ALWAYS_GT_TFLOAT_FLOAT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AlwaysGtTfloatFloatLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: ALWAYS_GT_TFLOAT_FLOAT */ + /* BEGIN CODEGEN PARSER GLUE: ALWAYS_LE_TFLOAT_FLOAT */ + case AntlrSQLLexer::ALWAYS_LE_TFLOAT_FLOAT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("ALWAYS_LE_TFLOAT_FLOAT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AlwaysLeTfloatFloatLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: ALWAYS_LE_TFLOAT_FLOAT */ + /* BEGIN CODEGEN PARSER GLUE: ALWAYS_LT_TFLOAT_FLOAT */ + case AntlrSQLLexer::ALWAYS_LT_TFLOAT_FLOAT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("ALWAYS_LT_TFLOAT_FLOAT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AlwaysLtTfloatFloatLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: ALWAYS_LT_TFLOAT_FLOAT */ + /* BEGIN CODEGEN PARSER GLUE: ALWAYS_NE_TFLOAT_FLOAT */ + case AntlrSQLLexer::ALWAYS_NE_TFLOAT_FLOAT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("ALWAYS_NE_TFLOAT_FLOAT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AlwaysNeTfloatFloatLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: ALWAYS_NE_TFLOAT_FLOAT */ default: /// Check if the function is a constructor for a datatype From d5446af260c5c3ae8ba0f8c39be4e255fd6c8088 Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Fri, 12 Jun 2026 08:55:56 +0200 Subject: [PATCH 21/96] feat(meos): add EVER_EQ/GE/GT/LE/LT/NE_TINT_INT NES operators (W63) 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. --- .../Meos/EverEqTintIntLogicalFunction.hpp | 54 ++++++ .../Meos/EverGeTintIntLogicalFunction.hpp | 54 ++++++ .../Meos/EverGtTintIntLogicalFunction.hpp | 54 ++++++ .../Meos/EverLeTintIntLogicalFunction.hpp | 54 ++++++ .../Meos/EverLtTintIntLogicalFunction.hpp | 54 ++++++ .../Meos/EverNeTintIntLogicalFunction.hpp | 54 ++++++ .../src/Functions/Meos/CMakeLists.txt | 6 + .../Meos/EverEqTintIntLogicalFunction.cpp | 105 ++++++++++ .../Meos/EverGeTintIntLogicalFunction.cpp | 105 ++++++++++ .../Meos/EverGtTintIntLogicalFunction.cpp | 105 ++++++++++ .../Meos/EverLeTintIntLogicalFunction.cpp | 105 ++++++++++ .../Meos/EverLtTintIntLogicalFunction.cpp | 105 ++++++++++ .../Meos/EverNeTintIntLogicalFunction.cpp | 105 ++++++++++ .../Meos/EverEqTintIntPhysicalFunction.hpp | 43 +++++ .../Meos/EverGeTintIntPhysicalFunction.hpp | 43 +++++ .../Meos/EverGtTintIntPhysicalFunction.hpp | 43 +++++ .../Meos/EverLeTintIntPhysicalFunction.hpp | 43 +++++ .../Meos/EverLtTintIntPhysicalFunction.hpp | 43 +++++ .../Meos/EverNeTintIntPhysicalFunction.hpp | 43 +++++ .../src/Functions/Meos/CMakeLists.txt | 6 + .../Meos/EverEqTintIntPhysicalFunction.cpp | 88 +++++++++ .../Meos/EverGeTintIntPhysicalFunction.cpp | 88 +++++++++ .../Meos/EverGtTintIntPhysicalFunction.cpp | 88 +++++++++ .../Meos/EverLeTintIntPhysicalFunction.cpp | 88 +++++++++ .../Meos/EverLtTintIntPhysicalFunction.cpp | 88 +++++++++ .../Meos/EverNeTintIntPhysicalFunction.cpp | 88 +++++++++ nes-sql-parser/AntlrSQL.g4 | 8 +- .../src/AntlrSQLQueryPlanCreator.cpp | 180 ++++++++++++++++++ 28 files changed, 1939 insertions(+), 1 deletion(-) create mode 100644 nes-logical-operators/include/Functions/Meos/EverEqTintIntLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverGeTintIntLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverGtTintIntLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverLeTintIntLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverLtTintIntLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverNeTintIntLogicalFunction.hpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverEqTintIntLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverGeTintIntLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverGtTintIntLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverLeTintIntLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverLtTintIntLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverNeTintIntLogicalFunction.cpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverEqTintIntPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverGeTintIntPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverGtTintIntPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverLeTintIntPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverLtTintIntPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverNeTintIntPhysicalFunction.hpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverEqTintIntPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverGeTintIntPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverGtTintIntPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverLeTintIntPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverLtTintIntPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverNeTintIntPhysicalFunction.cpp diff --git a/nes-logical-operators/include/Functions/Meos/EverEqTintIntLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverEqTintIntLogicalFunction.hpp new file mode 100644 index 0000000000..e744c59456 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverEqTintIntLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event ever_eq_tint_int: tests if a single-instant tint value ever equals a threshold. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ever_eq_tint_int`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class EverEqTintIntLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverEqTintInt"; + + EverEqTintIntLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverGeTintIntLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverGeTintIntLogicalFunction.hpp new file mode 100644 index 0000000000..7412b45a33 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverGeTintIntLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event ever_ge_tint_int: tests if a single-instant tint value ever is >= a threshold. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ever_ge_tint_int`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class EverGeTintIntLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverGeTintInt"; + + EverGeTintIntLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverGtTintIntLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverGtTintIntLogicalFunction.hpp new file mode 100644 index 0000000000..d23b02d567 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverGtTintIntLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event ever_gt_tint_int: tests if a single-instant tint value ever is > a threshold. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ever_gt_tint_int`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class EverGtTintIntLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverGtTintInt"; + + EverGtTintIntLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverLeTintIntLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverLeTintIntLogicalFunction.hpp new file mode 100644 index 0000000000..a8e893d848 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverLeTintIntLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event ever_le_tint_int: tests if a single-instant tint value ever is <= a threshold. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ever_le_tint_int`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class EverLeTintIntLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverLeTintInt"; + + EverLeTintIntLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverLtTintIntLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverLtTintIntLogicalFunction.hpp new file mode 100644 index 0000000000..081cc445a5 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverLtTintIntLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event ever_lt_tint_int: tests if a single-instant tint value ever is < a threshold. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ever_lt_tint_int`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class EverLtTintIntLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverLtTintInt"; + + EverLtTintIntLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverNeTintIntLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverNeTintIntLogicalFunction.hpp new file mode 100644 index 0000000000..92c335e27b --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverNeTintIntLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event ever_ne_tint_int: tests if a single-instant tint value ever is != a threshold. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ever_ne_tint_int`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class EverNeTintIntLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverNeTintInt"; + + EverNeTintIntLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt index f80fb56ab9..be5e7a0bc2 100644 --- a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt @@ -88,3 +88,9 @@ add_plugin(AlwaysGtTfloatFloat LogicalFunction nes-logical-operators AlwaysGtTfl add_plugin(AlwaysLeTfloatFloat LogicalFunction nes-logical-operators AlwaysLeTfloatFloatLogicalFunction.cpp) add_plugin(AlwaysLtTfloatFloat LogicalFunction nes-logical-operators AlwaysLtTfloatFloatLogicalFunction.cpp) add_plugin(AlwaysNeTfloatFloat LogicalFunction nes-logical-operators AlwaysNeTfloatFloatLogicalFunction.cpp) +add_plugin(EverEqTintInt LogicalFunction nes-logical-operators EverEqTintIntLogicalFunction.cpp) +add_plugin(EverGeTintInt LogicalFunction nes-logical-operators EverGeTintIntLogicalFunction.cpp) +add_plugin(EverGtTintInt LogicalFunction nes-logical-operators EverGtTintIntLogicalFunction.cpp) +add_plugin(EverLeTintInt LogicalFunction nes-logical-operators EverLeTintIntLogicalFunction.cpp) +add_plugin(EverLtTintInt LogicalFunction nes-logical-operators EverLtTintIntLogicalFunction.cpp) +add_plugin(EverNeTintInt LogicalFunction nes-logical-operators EverNeTintIntLogicalFunction.cpp) diff --git a/nes-logical-operators/src/Functions/Meos/EverEqTintIntLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverEqTintIntLogicalFunction.cpp new file mode 100644 index 0000000000..1bbb6b868e --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverEqTintIntLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EverEqTintIntLogicalFunction::EverEqTintIntLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType EverEqTintIntLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverEqTintIntLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EverEqTintIntLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverEqTintIntLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "EverEqTintIntLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EverEqTintIntLogicalFunction::getType() const { return NAME; } + +bool EverEqTintIntLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EverEqTintIntLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction EverEqTintIntLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction EverEqTintIntLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverEqTintIntLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "EverEqTintIntLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return EverEqTintIntLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverGeTintIntLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverGeTintIntLogicalFunction.cpp new file mode 100644 index 0000000000..16960ea72f --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverGeTintIntLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EverGeTintIntLogicalFunction::EverGeTintIntLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType EverGeTintIntLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverGeTintIntLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EverGeTintIntLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverGeTintIntLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "EverGeTintIntLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EverGeTintIntLogicalFunction::getType() const { return NAME; } + +bool EverGeTintIntLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EverGeTintIntLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction EverGeTintIntLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction EverGeTintIntLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverGeTintIntLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "EverGeTintIntLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return EverGeTintIntLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverGtTintIntLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverGtTintIntLogicalFunction.cpp new file mode 100644 index 0000000000..5b91ec4001 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverGtTintIntLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EverGtTintIntLogicalFunction::EverGtTintIntLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType EverGtTintIntLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverGtTintIntLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EverGtTintIntLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverGtTintIntLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "EverGtTintIntLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EverGtTintIntLogicalFunction::getType() const { return NAME; } + +bool EverGtTintIntLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EverGtTintIntLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction EverGtTintIntLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction EverGtTintIntLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverGtTintIntLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "EverGtTintIntLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return EverGtTintIntLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverLeTintIntLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverLeTintIntLogicalFunction.cpp new file mode 100644 index 0000000000..3ea5fc988d --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverLeTintIntLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EverLeTintIntLogicalFunction::EverLeTintIntLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType EverLeTintIntLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverLeTintIntLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EverLeTintIntLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverLeTintIntLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "EverLeTintIntLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EverLeTintIntLogicalFunction::getType() const { return NAME; } + +bool EverLeTintIntLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EverLeTintIntLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction EverLeTintIntLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction EverLeTintIntLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverLeTintIntLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "EverLeTintIntLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return EverLeTintIntLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverLtTintIntLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverLtTintIntLogicalFunction.cpp new file mode 100644 index 0000000000..86d0846523 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverLtTintIntLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EverLtTintIntLogicalFunction::EverLtTintIntLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType EverLtTintIntLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverLtTintIntLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EverLtTintIntLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverLtTintIntLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "EverLtTintIntLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EverLtTintIntLogicalFunction::getType() const { return NAME; } + +bool EverLtTintIntLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EverLtTintIntLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction EverLtTintIntLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction EverLtTintIntLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverLtTintIntLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "EverLtTintIntLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return EverLtTintIntLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverNeTintIntLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverNeTintIntLogicalFunction.cpp new file mode 100644 index 0000000000..a734230251 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverNeTintIntLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EverNeTintIntLogicalFunction::EverNeTintIntLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType EverNeTintIntLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverNeTintIntLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EverNeTintIntLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverNeTintIntLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "EverNeTintIntLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EverNeTintIntLogicalFunction::getType() const { return NAME; } + +bool EverNeTintIntLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EverNeTintIntLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction EverNeTintIntLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction EverNeTintIntLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverNeTintIntLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "EverNeTintIntLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return EverNeTintIntLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverEqTintIntPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverEqTintIntPhysicalFunction.hpp new file mode 100644 index 0000000000..733617927d --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverEqTintIntPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `ever_eq_tint_int`. + * + * Per-event ever_eq_tint_int: tests if a single-instant tint value ever equals a threshold. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class EverEqTintIntPhysicalFunction : public PhysicalFunctionConcept { +public: + EverEqTintIntPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverGeTintIntPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverGeTintIntPhysicalFunction.hpp new file mode 100644 index 0000000000..1dc5cec153 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverGeTintIntPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `ever_ge_tint_int`. + * + * Per-event ever_ge_tint_int: tests if a single-instant tint value ever is >= a threshold. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class EverGeTintIntPhysicalFunction : public PhysicalFunctionConcept { +public: + EverGeTintIntPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverGtTintIntPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverGtTintIntPhysicalFunction.hpp new file mode 100644 index 0000000000..0f9b5870f8 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverGtTintIntPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `ever_gt_tint_int`. + * + * Per-event ever_gt_tint_int: tests if a single-instant tint value ever is > a threshold. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class EverGtTintIntPhysicalFunction : public PhysicalFunctionConcept { +public: + EverGtTintIntPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverLeTintIntPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverLeTintIntPhysicalFunction.hpp new file mode 100644 index 0000000000..1754b67658 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverLeTintIntPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `ever_le_tint_int`. + * + * Per-event ever_le_tint_int: tests if a single-instant tint value ever is <= a threshold. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class EverLeTintIntPhysicalFunction : public PhysicalFunctionConcept { +public: + EverLeTintIntPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverLtTintIntPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverLtTintIntPhysicalFunction.hpp new file mode 100644 index 0000000000..5631102874 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverLtTintIntPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `ever_lt_tint_int`. + * + * Per-event ever_lt_tint_int: tests if a single-instant tint value ever is < a threshold. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class EverLtTintIntPhysicalFunction : public PhysicalFunctionConcept { +public: + EverLtTintIntPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverNeTintIntPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverNeTintIntPhysicalFunction.hpp new file mode 100644 index 0000000000..f6473e9e59 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverNeTintIntPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `ever_ne_tint_int`. + * + * Per-event ever_ne_tint_int: tests if a single-instant tint value ever is != a threshold. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class EverNeTintIntPhysicalFunction : public PhysicalFunctionConcept { +public: + EverNeTintIntPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt index 1cf15e45be..420c67c1c7 100644 --- a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt @@ -87,4 +87,10 @@ add_plugin(AlwaysGtTfloatFloat PhysicalFunction nes-physical-operators AlwaysGtT add_plugin(AlwaysLeTfloatFloat PhysicalFunction nes-physical-operators AlwaysLeTfloatFloatPhysicalFunction.cpp) add_plugin(AlwaysLtTfloatFloat PhysicalFunction nes-physical-operators AlwaysLtTfloatFloatPhysicalFunction.cpp) add_plugin(AlwaysNeTfloatFloat PhysicalFunction nes-physical-operators AlwaysNeTfloatFloatPhysicalFunction.cpp) +add_plugin(EverEqTintInt PhysicalFunction nes-physical-operators EverEqTintIntPhysicalFunction.cpp) +add_plugin(EverGeTintInt PhysicalFunction nes-physical-operators EverGeTintIntPhysicalFunction.cpp) +add_plugin(EverGtTintInt PhysicalFunction nes-physical-operators EverGtTintIntPhysicalFunction.cpp) +add_plugin(EverLeTintInt PhysicalFunction nes-physical-operators EverLeTintIntPhysicalFunction.cpp) +add_plugin(EverLtTintInt PhysicalFunction nes-physical-operators EverLtTintIntPhysicalFunction.cpp) +add_plugin(EverNeTintInt PhysicalFunction nes-physical-operators EverNeTintIntPhysicalFunction.cpp) endif() diff --git a/nes-physical-operators/src/Functions/Meos/EverEqTintIntPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverEqTintIntPhysicalFunction.cpp new file mode 100644 index 0000000000..15d58a4f09 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverEqTintIntPhysicalFunction.cpp @@ -0,0 +1,88 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +EverEqTintIntPhysicalFunction::EverEqTintIntPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(thresholdFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal EverEqTintIntPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto threshold = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double value, double threshold, uint64_t ts) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string tempWkt = fmt::format("{}@{}", static_cast(value), MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tint_in(tempWkt.c_str()); + if (!temp) return 0.0; + int r = ever_eq_tint_int(temp, static_cast(threshold)); + free(temp); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + value, threshold, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverEqTintIntPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "EverEqTintIntPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return EverEqTintIntPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverGeTintIntPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverGeTintIntPhysicalFunction.cpp new file mode 100644 index 0000000000..582a28b16f --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverGeTintIntPhysicalFunction.cpp @@ -0,0 +1,88 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +EverGeTintIntPhysicalFunction::EverGeTintIntPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(thresholdFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal EverGeTintIntPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto threshold = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double value, double threshold, uint64_t ts) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string tempWkt = fmt::format("{}@{}", static_cast(value), MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tint_in(tempWkt.c_str()); + if (!temp) return 0.0; + int r = ever_ge_tint_int(temp, static_cast(threshold)); + free(temp); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + value, threshold, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverGeTintIntPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "EverGeTintIntPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return EverGeTintIntPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverGtTintIntPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverGtTintIntPhysicalFunction.cpp new file mode 100644 index 0000000000..4c9a2188cc --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverGtTintIntPhysicalFunction.cpp @@ -0,0 +1,88 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +EverGtTintIntPhysicalFunction::EverGtTintIntPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(thresholdFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal EverGtTintIntPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto threshold = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double value, double threshold, uint64_t ts) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string tempWkt = fmt::format("{}@{}", static_cast(value), MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tint_in(tempWkt.c_str()); + if (!temp) return 0.0; + int r = ever_gt_tint_int(temp, static_cast(threshold)); + free(temp); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + value, threshold, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverGtTintIntPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "EverGtTintIntPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return EverGtTintIntPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverLeTintIntPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverLeTintIntPhysicalFunction.cpp new file mode 100644 index 0000000000..76a79ac980 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverLeTintIntPhysicalFunction.cpp @@ -0,0 +1,88 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +EverLeTintIntPhysicalFunction::EverLeTintIntPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(thresholdFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal EverLeTintIntPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto threshold = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double value, double threshold, uint64_t ts) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string tempWkt = fmt::format("{}@{}", static_cast(value), MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tint_in(tempWkt.c_str()); + if (!temp) return 0.0; + int r = ever_le_tint_int(temp, static_cast(threshold)); + free(temp); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + value, threshold, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverLeTintIntPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "EverLeTintIntPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return EverLeTintIntPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverLtTintIntPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverLtTintIntPhysicalFunction.cpp new file mode 100644 index 0000000000..d44fcd56b5 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverLtTintIntPhysicalFunction.cpp @@ -0,0 +1,88 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +EverLtTintIntPhysicalFunction::EverLtTintIntPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(thresholdFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal EverLtTintIntPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto threshold = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double value, double threshold, uint64_t ts) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string tempWkt = fmt::format("{}@{}", static_cast(value), MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tint_in(tempWkt.c_str()); + if (!temp) return 0.0; + int r = ever_lt_tint_int(temp, static_cast(threshold)); + free(temp); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + value, threshold, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverLtTintIntPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "EverLtTintIntPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return EverLtTintIntPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverNeTintIntPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverNeTintIntPhysicalFunction.cpp new file mode 100644 index 0000000000..01efb51d81 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverNeTintIntPhysicalFunction.cpp @@ -0,0 +1,88 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +EverNeTintIntPhysicalFunction::EverNeTintIntPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(thresholdFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal EverNeTintIntPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto threshold = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double value, double threshold, uint64_t ts) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string tempWkt = fmt::format("{}@{}", static_cast(value), MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tint_in(tempWkt.c_str()); + if (!temp) return 0.0; + int r = ever_ne_tint_int(temp, static_cast(threshold)); + free(temp); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + value, threshold, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverNeTintIntPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "EverNeTintIntPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return EverNeTintIntPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-sql-parser/AntlrSQL.g4 b/nes-sql-parser/AntlrSQL.g4 index 28cd19856c..0397f7cc02 100644 --- a/nes-sql-parser/AntlrSQL.g4 +++ b/nes-sql-parser/AntlrSQL.g4 @@ -295,7 +295,7 @@ timeUnit: MS timestampParameter: name=identifier; -functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | EDWITHIN_TGEO_GEO | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS; +functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | EDWITHIN_TGEO_GEO | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS; sinkClause: INTO sink (',' sink)*; @@ -499,6 +499,12 @@ EVER_GT_TFLOAT_FLOAT: 'EVER_GT_TFLOAT_FLOAT' | 'ever_gt_tfloat_float'; EVER_LE_TFLOAT_FLOAT: 'EVER_LE_TFLOAT_FLOAT' | 'ever_le_tfloat_float'; EVER_LT_TFLOAT_FLOAT: 'EVER_LT_TFLOAT_FLOAT' | 'ever_lt_tfloat_float'; EVER_NE_TFLOAT_FLOAT: 'EVER_NE_TFLOAT_FLOAT' | 'ever_ne_tfloat_float'; +EVER_EQ_TINT_INT: 'EVER_EQ_TINT_INT' | 'ever_eq_tint_int'; +EVER_GE_TINT_INT: 'EVER_GE_TINT_INT' | 'ever_ge_tint_int'; +EVER_GT_TINT_INT: 'EVER_GT_TINT_INT' | 'ever_gt_tint_int'; +EVER_LE_TINT_INT: 'EVER_LE_TINT_INT' | 'ever_le_tint_int'; +EVER_LT_TINT_INT: 'EVER_LT_TINT_INT' | 'ever_lt_tint_int'; +EVER_NE_TINT_INT: 'EVER_NE_TINT_INT' | 'ever_ne_tint_int'; TGEO_AT_STBOX: 'TGEO_AT_STBOX' | 'tgeo_at_stbox'; ADD_BIGINT_TBIGINT: 'ADD_BIGINT_TBIGINT' | 'add_bigint_tbigint'; ADD_FLOAT_TFLOAT: 'ADD_FLOAT_TFLOAT' | 'add_float_tfloat'; diff --git a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp index 40fe84a909..a95b1e1ad1 100644 --- a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp +++ b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp @@ -133,6 +133,12 @@ #include #include #include +#include +#include +#include +#include +#include +#include #include #include #include @@ -3100,6 +3106,180 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont } break; /* END CODEGEN PARSER GLUE: EVER_NE_TFLOAT_FLOAT */ + /* BEGIN CODEGEN PARSER GLUE: EVER_EQ_TINT_INT */ + case AntlrSQLLexer::EVER_EQ_TINT_INT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("EVER_EQ_TINT_INT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverEqTintIntLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: EVER_EQ_TINT_INT */ + /* BEGIN CODEGEN PARSER GLUE: EVER_GE_TINT_INT */ + case AntlrSQLLexer::EVER_GE_TINT_INT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("EVER_GE_TINT_INT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverGeTintIntLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: EVER_GE_TINT_INT */ + /* BEGIN CODEGEN PARSER GLUE: EVER_GT_TINT_INT */ + case AntlrSQLLexer::EVER_GT_TINT_INT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("EVER_GT_TINT_INT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverGtTintIntLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: EVER_GT_TINT_INT */ + /* BEGIN CODEGEN PARSER GLUE: EVER_LE_TINT_INT */ + case AntlrSQLLexer::EVER_LE_TINT_INT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("EVER_LE_TINT_INT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverLeTintIntLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: EVER_LE_TINT_INT */ + /* BEGIN CODEGEN PARSER GLUE: EVER_LT_TINT_INT */ + case AntlrSQLLexer::EVER_LT_TINT_INT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("EVER_LT_TINT_INT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverLtTintIntLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: EVER_LT_TINT_INT */ + /* BEGIN CODEGEN PARSER GLUE: EVER_NE_TINT_INT */ + case AntlrSQLLexer::EVER_NE_TINT_INT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("EVER_NE_TINT_INT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverNeTintIntLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: EVER_NE_TINT_INT */ /* BEGIN CODEGEN PARSER GLUE: ALWAYS_EQ_TFLOAT_FLOAT */ case AntlrSQLLexer::ALWAYS_EQ_TFLOAT_FLOAT: { From 0dc2fef5f3db052a594ab7a5446c53d116a15fe1 Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Fri, 12 Jun 2026 09:01:58 +0200 Subject: [PATCH 22/96] feat(meos): add ALWAYS_EQ/GE/GT/LE/LT/NE_TINT_INT NES operators (W64) 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. --- .../Meos/AlwaysEqTintIntLogicalFunction.hpp | 54 ++++++ .../Meos/AlwaysGeTintIntLogicalFunction.hpp | 54 ++++++ .../Meos/AlwaysGtTintIntLogicalFunction.hpp | 54 ++++++ .../Meos/AlwaysLeTintIntLogicalFunction.hpp | 54 ++++++ .../Meos/AlwaysLtTintIntLogicalFunction.hpp | 54 ++++++ .../Meos/AlwaysNeTintIntLogicalFunction.hpp | 54 ++++++ .../Meos/AlwaysEqTintIntLogicalFunction.cpp | 105 ++++++++++ .../Meos/AlwaysGeTintIntLogicalFunction.cpp | 105 ++++++++++ .../Meos/AlwaysGtTintIntLogicalFunction.cpp | 105 ++++++++++ .../Meos/AlwaysLeTintIntLogicalFunction.cpp | 105 ++++++++++ .../Meos/AlwaysLtTintIntLogicalFunction.cpp | 105 ++++++++++ .../Meos/AlwaysNeTintIntLogicalFunction.cpp | 105 ++++++++++ .../src/Functions/Meos/CMakeLists.txt | 6 + .../Meos/AlwaysEqTintIntPhysicalFunction.hpp | 43 +++++ .../Meos/AlwaysGeTintIntPhysicalFunction.hpp | 43 +++++ .../Meos/AlwaysGtTintIntPhysicalFunction.hpp | 43 +++++ .../Meos/AlwaysLeTintIntPhysicalFunction.hpp | 43 +++++ .../Meos/AlwaysLtTintIntPhysicalFunction.hpp | 43 +++++ .../Meos/AlwaysNeTintIntPhysicalFunction.hpp | 43 +++++ .../Meos/AlwaysEqTintIntPhysicalFunction.cpp | 88 +++++++++ .../Meos/AlwaysGeTintIntPhysicalFunction.cpp | 88 +++++++++ .../Meos/AlwaysGtTintIntPhysicalFunction.cpp | 88 +++++++++ .../Meos/AlwaysLeTintIntPhysicalFunction.cpp | 88 +++++++++ .../Meos/AlwaysLtTintIntPhysicalFunction.cpp | 88 +++++++++ .../Meos/AlwaysNeTintIntPhysicalFunction.cpp | 88 +++++++++ .../src/Functions/Meos/CMakeLists.txt | 6 + nes-sql-parser/AntlrSQL.g4 | 8 +- .../src/AntlrSQLQueryPlanCreator.cpp | 180 ++++++++++++++++++ 28 files changed, 1939 insertions(+), 1 deletion(-) create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysEqTintIntLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysGeTintIntLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysGtTintIntLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysLeTintIntLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysLtTintIntLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysNeTintIntLogicalFunction.hpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysEqTintIntLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysGeTintIntLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysGtTintIntLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysLeTintIntLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysLtTintIntLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysNeTintIntLogicalFunction.cpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysEqTintIntPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysGeTintIntPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysGtTintIntPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysLeTintIntPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysLtTintIntPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysNeTintIntPhysicalFunction.hpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysEqTintIntPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysGeTintIntPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysGtTintIntPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysLeTintIntPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysLtTintIntPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysNeTintIntPhysicalFunction.cpp diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysEqTintIntLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysEqTintIntLogicalFunction.hpp new file mode 100644 index 0000000000..81cadb7f63 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysEqTintIntLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event always_eq_tint_int: tests if a single-instant tint value always equals a threshold. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `always_eq_tint_int`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class AlwaysEqTintIntLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysEqTintInt"; + + AlwaysEqTintIntLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysGeTintIntLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysGeTintIntLogicalFunction.hpp new file mode 100644 index 0000000000..2a6fb630b5 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysGeTintIntLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event always_ge_tint_int: tests if a single-instant tint value always is greater than or equal to a threshold. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `always_ge_tint_int`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class AlwaysGeTintIntLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysGeTintInt"; + + AlwaysGeTintIntLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysGtTintIntLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysGtTintIntLogicalFunction.hpp new file mode 100644 index 0000000000..cb8089aa89 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysGtTintIntLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event always_gt_tint_int: tests if a single-instant tint value always is greater than a threshold. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `always_gt_tint_int`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class AlwaysGtTintIntLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysGtTintInt"; + + AlwaysGtTintIntLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysLeTintIntLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysLeTintIntLogicalFunction.hpp new file mode 100644 index 0000000000..10bde702b8 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysLeTintIntLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event always_le_tint_int: tests if a single-instant tint value always is less than or equal to a threshold. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `always_le_tint_int`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class AlwaysLeTintIntLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysLeTintInt"; + + AlwaysLeTintIntLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysLtTintIntLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysLtTintIntLogicalFunction.hpp new file mode 100644 index 0000000000..260aa2d34d --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysLtTintIntLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event always_lt_tint_int: tests if a single-instant tint value always is less than a threshold. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `always_lt_tint_int`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class AlwaysLtTintIntLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysLtTintInt"; + + AlwaysLtTintIntLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysNeTintIntLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysNeTintIntLogicalFunction.hpp new file mode 100644 index 0000000000..ab97eaf8c4 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysNeTintIntLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event always_ne_tint_int: tests if a single-instant tint value always does not equal a threshold. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `always_ne_tint_int`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class AlwaysNeTintIntLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysNeTintInt"; + + AlwaysNeTintIntLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysEqTintIntLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysEqTintIntLogicalFunction.cpp new file mode 100644 index 0000000000..25a4b5176e --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysEqTintIntLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AlwaysEqTintIntLogicalFunction::AlwaysEqTintIntLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType AlwaysEqTintIntLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysEqTintIntLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AlwaysEqTintIntLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysEqTintIntLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "AlwaysEqTintIntLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AlwaysEqTintIntLogicalFunction::getType() const { return NAME; } + +bool AlwaysEqTintIntLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AlwaysEqTintIntLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction AlwaysEqTintIntLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction AlwaysEqTintIntLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysEqTintIntLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "AlwaysEqTintIntLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return AlwaysEqTintIntLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysGeTintIntLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysGeTintIntLogicalFunction.cpp new file mode 100644 index 0000000000..98a51fe375 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysGeTintIntLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AlwaysGeTintIntLogicalFunction::AlwaysGeTintIntLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType AlwaysGeTintIntLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysGeTintIntLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AlwaysGeTintIntLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysGeTintIntLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "AlwaysGeTintIntLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AlwaysGeTintIntLogicalFunction::getType() const { return NAME; } + +bool AlwaysGeTintIntLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AlwaysGeTintIntLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction AlwaysGeTintIntLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction AlwaysGeTintIntLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysGeTintIntLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "AlwaysGeTintIntLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return AlwaysGeTintIntLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysGtTintIntLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysGtTintIntLogicalFunction.cpp new file mode 100644 index 0000000000..7060f1d054 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysGtTintIntLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AlwaysGtTintIntLogicalFunction::AlwaysGtTintIntLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType AlwaysGtTintIntLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysGtTintIntLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AlwaysGtTintIntLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysGtTintIntLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "AlwaysGtTintIntLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AlwaysGtTintIntLogicalFunction::getType() const { return NAME; } + +bool AlwaysGtTintIntLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AlwaysGtTintIntLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction AlwaysGtTintIntLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction AlwaysGtTintIntLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysGtTintIntLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "AlwaysGtTintIntLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return AlwaysGtTintIntLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysLeTintIntLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysLeTintIntLogicalFunction.cpp new file mode 100644 index 0000000000..6ce9d79efb --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysLeTintIntLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AlwaysLeTintIntLogicalFunction::AlwaysLeTintIntLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType AlwaysLeTintIntLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysLeTintIntLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AlwaysLeTintIntLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysLeTintIntLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "AlwaysLeTintIntLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AlwaysLeTintIntLogicalFunction::getType() const { return NAME; } + +bool AlwaysLeTintIntLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AlwaysLeTintIntLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction AlwaysLeTintIntLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction AlwaysLeTintIntLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysLeTintIntLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "AlwaysLeTintIntLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return AlwaysLeTintIntLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysLtTintIntLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysLtTintIntLogicalFunction.cpp new file mode 100644 index 0000000000..20fcc7fb98 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysLtTintIntLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AlwaysLtTintIntLogicalFunction::AlwaysLtTintIntLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType AlwaysLtTintIntLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysLtTintIntLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AlwaysLtTintIntLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysLtTintIntLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "AlwaysLtTintIntLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AlwaysLtTintIntLogicalFunction::getType() const { return NAME; } + +bool AlwaysLtTintIntLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AlwaysLtTintIntLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction AlwaysLtTintIntLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction AlwaysLtTintIntLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysLtTintIntLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "AlwaysLtTintIntLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return AlwaysLtTintIntLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysNeTintIntLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysNeTintIntLogicalFunction.cpp new file mode 100644 index 0000000000..b9f82b9867 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysNeTintIntLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AlwaysNeTintIntLogicalFunction::AlwaysNeTintIntLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType AlwaysNeTintIntLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysNeTintIntLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AlwaysNeTintIntLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysNeTintIntLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "AlwaysNeTintIntLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AlwaysNeTintIntLogicalFunction::getType() const { return NAME; } + +bool AlwaysNeTintIntLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AlwaysNeTintIntLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction AlwaysNeTintIntLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction AlwaysNeTintIntLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysNeTintIntLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "AlwaysNeTintIntLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return AlwaysNeTintIntLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt index be5e7a0bc2..18adc03f99 100644 --- a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt @@ -94,3 +94,9 @@ add_plugin(EverGtTintInt LogicalFunction nes-logical-operators EverGtTintIntLogi add_plugin(EverLeTintInt LogicalFunction nes-logical-operators EverLeTintIntLogicalFunction.cpp) add_plugin(EverLtTintInt LogicalFunction nes-logical-operators EverLtTintIntLogicalFunction.cpp) add_plugin(EverNeTintInt LogicalFunction nes-logical-operators EverNeTintIntLogicalFunction.cpp) +add_plugin(AlwaysEqTintInt LogicalFunction nes-logical-operators AlwaysEqTintIntLogicalFunction.cpp) +add_plugin(AlwaysGeTintInt LogicalFunction nes-logical-operators AlwaysGeTintIntLogicalFunction.cpp) +add_plugin(AlwaysGtTintInt LogicalFunction nes-logical-operators AlwaysGtTintIntLogicalFunction.cpp) +add_plugin(AlwaysLeTintInt LogicalFunction nes-logical-operators AlwaysLeTintIntLogicalFunction.cpp) +add_plugin(AlwaysLtTintInt LogicalFunction nes-logical-operators AlwaysLtTintIntLogicalFunction.cpp) +add_plugin(AlwaysNeTintInt LogicalFunction nes-logical-operators AlwaysNeTintIntLogicalFunction.cpp) diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysEqTintIntPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysEqTintIntPhysicalFunction.hpp new file mode 100644 index 0000000000..bd447a115a --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysEqTintIntPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `always_eq_tint_int`. + * + * Per-event always_eq_tint_int: tests if a single-instant tint value always equals a threshold. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class AlwaysEqTintIntPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysEqTintIntPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysGeTintIntPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysGeTintIntPhysicalFunction.hpp new file mode 100644 index 0000000000..ab84836820 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysGeTintIntPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `always_ge_tint_int`. + * + * Per-event always_ge_tint_int: tests if a single-instant tint value always is greater than or equal to a threshold. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class AlwaysGeTintIntPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysGeTintIntPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysGtTintIntPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysGtTintIntPhysicalFunction.hpp new file mode 100644 index 0000000000..f8d58ce187 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysGtTintIntPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `always_gt_tint_int`. + * + * Per-event always_gt_tint_int: tests if a single-instant tint value always is greater than a threshold. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class AlwaysGtTintIntPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysGtTintIntPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysLeTintIntPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysLeTintIntPhysicalFunction.hpp new file mode 100644 index 0000000000..5fcc072903 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysLeTintIntPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `always_le_tint_int`. + * + * Per-event always_le_tint_int: tests if a single-instant tint value always is less than or equal to a threshold. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class AlwaysLeTintIntPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysLeTintIntPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysLtTintIntPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysLtTintIntPhysicalFunction.hpp new file mode 100644 index 0000000000..bfaa3c74ad --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysLtTintIntPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `always_lt_tint_int`. + * + * Per-event always_lt_tint_int: tests if a single-instant tint value always is less than a threshold. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class AlwaysLtTintIntPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysLtTintIntPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysNeTintIntPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysNeTintIntPhysicalFunction.hpp new file mode 100644 index 0000000000..da81199476 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysNeTintIntPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `always_ne_tint_int`. + * + * Per-event always_ne_tint_int: tests if a single-instant tint value always does not equal a threshold. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class AlwaysNeTintIntPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysNeTintIntPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysEqTintIntPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysEqTintIntPhysicalFunction.cpp new file mode 100644 index 0000000000..acf460907c --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysEqTintIntPhysicalFunction.cpp @@ -0,0 +1,88 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +AlwaysEqTintIntPhysicalFunction::AlwaysEqTintIntPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(thresholdFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal AlwaysEqTintIntPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto threshold = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double value, double threshold, uint64_t ts) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string tempWkt = fmt::format("{}@{}", static_cast(value), MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tint_in(tempWkt.c_str()); + if (!temp) return 0.0; + int r = always_eq_tint_int(temp, static_cast(threshold)); + free(temp); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + value, threshold, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysEqTintIntPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "AlwaysEqTintIntPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return AlwaysEqTintIntPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysGeTintIntPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysGeTintIntPhysicalFunction.cpp new file mode 100644 index 0000000000..10b57b46b0 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysGeTintIntPhysicalFunction.cpp @@ -0,0 +1,88 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +AlwaysGeTintIntPhysicalFunction::AlwaysGeTintIntPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(thresholdFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal AlwaysGeTintIntPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto threshold = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double value, double threshold, uint64_t ts) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string tempWkt = fmt::format("{}@{}", static_cast(value), MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tint_in(tempWkt.c_str()); + if (!temp) return 0.0; + int r = always_ge_tint_int(temp, static_cast(threshold)); + free(temp); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + value, threshold, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysGeTintIntPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "AlwaysGeTintIntPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return AlwaysGeTintIntPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysGtTintIntPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysGtTintIntPhysicalFunction.cpp new file mode 100644 index 0000000000..9000b7a404 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysGtTintIntPhysicalFunction.cpp @@ -0,0 +1,88 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +AlwaysGtTintIntPhysicalFunction::AlwaysGtTintIntPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(thresholdFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal AlwaysGtTintIntPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto threshold = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double value, double threshold, uint64_t ts) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string tempWkt = fmt::format("{}@{}", static_cast(value), MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tint_in(tempWkt.c_str()); + if (!temp) return 0.0; + int r = always_gt_tint_int(temp, static_cast(threshold)); + free(temp); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + value, threshold, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysGtTintIntPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "AlwaysGtTintIntPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return AlwaysGtTintIntPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysLeTintIntPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysLeTintIntPhysicalFunction.cpp new file mode 100644 index 0000000000..2bc48852c9 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysLeTintIntPhysicalFunction.cpp @@ -0,0 +1,88 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +AlwaysLeTintIntPhysicalFunction::AlwaysLeTintIntPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(thresholdFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal AlwaysLeTintIntPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto threshold = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double value, double threshold, uint64_t ts) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string tempWkt = fmt::format("{}@{}", static_cast(value), MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tint_in(tempWkt.c_str()); + if (!temp) return 0.0; + int r = always_le_tint_int(temp, static_cast(threshold)); + free(temp); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + value, threshold, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysLeTintIntPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "AlwaysLeTintIntPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return AlwaysLeTintIntPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysLtTintIntPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysLtTintIntPhysicalFunction.cpp new file mode 100644 index 0000000000..f4a3efe5b0 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysLtTintIntPhysicalFunction.cpp @@ -0,0 +1,88 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +AlwaysLtTintIntPhysicalFunction::AlwaysLtTintIntPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(thresholdFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal AlwaysLtTintIntPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto threshold = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double value, double threshold, uint64_t ts) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string tempWkt = fmt::format("{}@{}", static_cast(value), MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tint_in(tempWkt.c_str()); + if (!temp) return 0.0; + int r = always_lt_tint_int(temp, static_cast(threshold)); + free(temp); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + value, threshold, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysLtTintIntPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "AlwaysLtTintIntPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return AlwaysLtTintIntPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysNeTintIntPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysNeTintIntPhysicalFunction.cpp new file mode 100644 index 0000000000..0d7634b12d --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysNeTintIntPhysicalFunction.cpp @@ -0,0 +1,88 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +AlwaysNeTintIntPhysicalFunction::AlwaysNeTintIntPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(thresholdFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal AlwaysNeTintIntPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto threshold = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double value, double threshold, uint64_t ts) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string tempWkt = fmt::format("{}@{}", static_cast(value), MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tint_in(tempWkt.c_str()); + if (!temp) return 0.0; + int r = always_ne_tint_int(temp, static_cast(threshold)); + free(temp); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + value, threshold, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysNeTintIntPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "AlwaysNeTintIntPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return AlwaysNeTintIntPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt index 420c67c1c7..c31c9c6034 100644 --- a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt @@ -93,4 +93,10 @@ add_plugin(EverGtTintInt PhysicalFunction nes-physical-operators EverGtTintIntPh add_plugin(EverLeTintInt PhysicalFunction nes-physical-operators EverLeTintIntPhysicalFunction.cpp) add_plugin(EverLtTintInt PhysicalFunction nes-physical-operators EverLtTintIntPhysicalFunction.cpp) add_plugin(EverNeTintInt PhysicalFunction nes-physical-operators EverNeTintIntPhysicalFunction.cpp) +add_plugin(AlwaysEqTintInt PhysicalFunction nes-physical-operators AlwaysEqTintIntPhysicalFunction.cpp) +add_plugin(AlwaysGeTintInt PhysicalFunction nes-physical-operators AlwaysGeTintIntPhysicalFunction.cpp) +add_plugin(AlwaysGtTintInt PhysicalFunction nes-physical-operators AlwaysGtTintIntPhysicalFunction.cpp) +add_plugin(AlwaysLeTintInt PhysicalFunction nes-physical-operators AlwaysLeTintIntPhysicalFunction.cpp) +add_plugin(AlwaysLtTintInt PhysicalFunction nes-physical-operators AlwaysLtTintIntPhysicalFunction.cpp) +add_plugin(AlwaysNeTintInt PhysicalFunction nes-physical-operators AlwaysNeTintIntPhysicalFunction.cpp) endif() diff --git a/nes-sql-parser/AntlrSQL.g4 b/nes-sql-parser/AntlrSQL.g4 index 0397f7cc02..4dfe041161 100644 --- a/nes-sql-parser/AntlrSQL.g4 +++ b/nes-sql-parser/AntlrSQL.g4 @@ -295,7 +295,7 @@ timeUnit: MS timestampParameter: name=identifier; -functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | EDWITHIN_TGEO_GEO | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS; +functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | EDWITHIN_TGEO_GEO | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS; sinkClause: INTO sink (',' sink)*; @@ -492,6 +492,12 @@ ALWAYS_GT_TFLOAT_FLOAT: 'ALWAYS_GT_TFLOAT_FLOAT' | 'always_gt_tfloat_float'; ALWAYS_LE_TFLOAT_FLOAT: 'ALWAYS_LE_TFLOAT_FLOAT' | 'always_le_tfloat_float'; ALWAYS_LT_TFLOAT_FLOAT: 'ALWAYS_LT_TFLOAT_FLOAT' | 'always_lt_tfloat_float'; ALWAYS_NE_TFLOAT_FLOAT: 'ALWAYS_NE_TFLOAT_FLOAT' | 'always_ne_tfloat_float'; +ALWAYS_EQ_TINT_INT: 'ALWAYS_EQ_TINT_INT' | 'always_eq_tint_int'; +ALWAYS_GE_TINT_INT: 'ALWAYS_GE_TINT_INT' | 'always_ge_tint_int'; +ALWAYS_GT_TINT_INT: 'ALWAYS_GT_TINT_INT' | 'always_gt_tint_int'; +ALWAYS_LE_TINT_INT: 'ALWAYS_LE_TINT_INT' | 'always_le_tint_int'; +ALWAYS_LT_TINT_INT: 'ALWAYS_LT_TINT_INT' | 'always_lt_tint_int'; +ALWAYS_NE_TINT_INT: 'ALWAYS_NE_TINT_INT' | 'always_ne_tint_int'; EDWITHIN_TGEO_GEO: 'EDWITHIN_TGEO_GEO' | 'edwithin_tgeo_geo'; EVER_EQ_TFLOAT_FLOAT: 'EVER_EQ_TFLOAT_FLOAT' | 'ever_eq_tfloat_float'; EVER_GE_TFLOAT_FLOAT: 'EVER_GE_TFLOAT_FLOAT' | 'ever_ge_tfloat_float'; diff --git a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp index a95b1e1ad1..12eec3b344 100644 --- a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp +++ b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp @@ -133,6 +133,12 @@ #include #include #include +#include +#include +#include +#include +#include +#include #include #include #include @@ -3280,6 +3286,180 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont } break; /* END CODEGEN PARSER GLUE: EVER_NE_TINT_INT */ + /* BEGIN CODEGEN PARSER GLUE: ALWAYS_EQ_TINT_INT */ + case AntlrSQLLexer::ALWAYS_EQ_TINT_INT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("ALWAYS_EQ_TINT_INT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AlwaysEqTintIntLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: ALWAYS_EQ_TINT_INT */ + /* BEGIN CODEGEN PARSER GLUE: ALWAYS_GE_TINT_INT */ + case AntlrSQLLexer::ALWAYS_GE_TINT_INT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("ALWAYS_GE_TINT_INT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AlwaysGeTintIntLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: ALWAYS_GE_TINT_INT */ + /* BEGIN CODEGEN PARSER GLUE: ALWAYS_GT_TINT_INT */ + case AntlrSQLLexer::ALWAYS_GT_TINT_INT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("ALWAYS_GT_TINT_INT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AlwaysGtTintIntLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: ALWAYS_GT_TINT_INT */ + /* BEGIN CODEGEN PARSER GLUE: ALWAYS_LE_TINT_INT */ + case AntlrSQLLexer::ALWAYS_LE_TINT_INT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("ALWAYS_LE_TINT_INT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AlwaysLeTintIntLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: ALWAYS_LE_TINT_INT */ + /* BEGIN CODEGEN PARSER GLUE: ALWAYS_LT_TINT_INT */ + case AntlrSQLLexer::ALWAYS_LT_TINT_INT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("ALWAYS_LT_TINT_INT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AlwaysLtTintIntLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: ALWAYS_LT_TINT_INT */ + /* BEGIN CODEGEN PARSER GLUE: ALWAYS_NE_TINT_INT */ + case AntlrSQLLexer::ALWAYS_NE_TINT_INT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("ALWAYS_NE_TINT_INT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AlwaysNeTintIntLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: ALWAYS_NE_TINT_INT */ /* BEGIN CODEGEN PARSER GLUE: ALWAYS_EQ_TFLOAT_FLOAT */ case AntlrSQLLexer::ALWAYS_EQ_TFLOAT_FLOAT: { From 346aed152c314d6b1ad449c3e6ec6a43fb30472f Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Fri, 12 Jun 2026 09:05:08 +0200 Subject: [PATCH 23/96] feat(meos): add EVER_EQ/GE/GT/LE/LT/NE_TBIGINT_BIGINT NES operators (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. --- .../EverEqTbigintBigintLogicalFunction.hpp | 54 ++++++ .../EverGeTbigintBigintLogicalFunction.hpp | 54 ++++++ .../EverGtTbigintBigintLogicalFunction.hpp | 54 ++++++ .../EverLeTbigintBigintLogicalFunction.hpp | 54 ++++++ .../EverLtTbigintBigintLogicalFunction.hpp | 54 ++++++ .../EverNeTbigintBigintLogicalFunction.hpp | 54 ++++++ .../src/Functions/Meos/CMakeLists.txt | 6 + .../EverEqTbigintBigintLogicalFunction.cpp | 105 ++++++++++ .../EverGeTbigintBigintLogicalFunction.cpp | 105 ++++++++++ .../EverGtTbigintBigintLogicalFunction.cpp | 105 ++++++++++ .../EverLeTbigintBigintLogicalFunction.cpp | 105 ++++++++++ .../EverLtTbigintBigintLogicalFunction.cpp | 105 ++++++++++ .../EverNeTbigintBigintLogicalFunction.cpp | 105 ++++++++++ .../EverEqTbigintBigintPhysicalFunction.hpp | 43 +++++ .../EverGeTbigintBigintPhysicalFunction.hpp | 43 +++++ .../EverGtTbigintBigintPhysicalFunction.hpp | 43 +++++ .../EverLeTbigintBigintPhysicalFunction.hpp | 43 +++++ .../EverLtTbigintBigintPhysicalFunction.hpp | 43 +++++ .../EverNeTbigintBigintPhysicalFunction.hpp | 43 +++++ .../src/Functions/Meos/CMakeLists.txt | 6 + .../EverEqTbigintBigintPhysicalFunction.cpp | 88 +++++++++ .../EverGeTbigintBigintPhysicalFunction.cpp | 88 +++++++++ .../EverGtTbigintBigintPhysicalFunction.cpp | 88 +++++++++ .../EverLeTbigintBigintPhysicalFunction.cpp | 88 +++++++++ .../EverLtTbigintBigintPhysicalFunction.cpp | 88 +++++++++ .../EverNeTbigintBigintPhysicalFunction.cpp | 88 +++++++++ nes-sql-parser/AntlrSQL.g4 | 8 +- .../src/AntlrSQLQueryPlanCreator.cpp | 180 ++++++++++++++++++ 28 files changed, 1939 insertions(+), 1 deletion(-) create mode 100644 nes-logical-operators/include/Functions/Meos/EverEqTbigintBigintLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverGeTbigintBigintLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverGtTbigintBigintLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverLeTbigintBigintLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverLtTbigintBigintLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverNeTbigintBigintLogicalFunction.hpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverEqTbigintBigintLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverGeTbigintBigintLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverGtTbigintBigintLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverLeTbigintBigintLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverLtTbigintBigintLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverNeTbigintBigintLogicalFunction.cpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverEqTbigintBigintPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverGeTbigintBigintPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverGtTbigintBigintPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverLeTbigintBigintPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverLtTbigintBigintPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverNeTbigintBigintPhysicalFunction.hpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverEqTbigintBigintPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverGeTbigintBigintPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverGtTbigintBigintPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverLeTbigintBigintPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverLtTbigintBigintPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverNeTbigintBigintPhysicalFunction.cpp diff --git a/nes-logical-operators/include/Functions/Meos/EverEqTbigintBigintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverEqTbigintBigintLogicalFunction.hpp new file mode 100644 index 0000000000..53667c623c --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverEqTbigintBigintLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event ever_eq_tbigint_bigint: tests if a single-instant tbigint value ever eqs a threshold. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ever_eq_tbigint_bigint`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class EverEqTbigintBigintLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverEqTbigintBigint"; + + EverEqTbigintBigintLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverGeTbigintBigintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverGeTbigintBigintLogicalFunction.hpp new file mode 100644 index 0000000000..fb283efa26 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverGeTbigintBigintLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event ever_ge_tbigint_bigint: tests if a single-instant tbigint value ever ges a threshold. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ever_ge_tbigint_bigint`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class EverGeTbigintBigintLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverGeTbigintBigint"; + + EverGeTbigintBigintLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverGtTbigintBigintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverGtTbigintBigintLogicalFunction.hpp new file mode 100644 index 0000000000..80fa5cf7e0 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverGtTbigintBigintLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event ever_gt_tbigint_bigint: tests if a single-instant tbigint value ever gts a threshold. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ever_gt_tbigint_bigint`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class EverGtTbigintBigintLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverGtTbigintBigint"; + + EverGtTbigintBigintLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverLeTbigintBigintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverLeTbigintBigintLogicalFunction.hpp new file mode 100644 index 0000000000..e85cf1183b --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverLeTbigintBigintLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event ever_le_tbigint_bigint: tests if a single-instant tbigint value ever les a threshold. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ever_le_tbigint_bigint`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class EverLeTbigintBigintLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverLeTbigintBigint"; + + EverLeTbigintBigintLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverLtTbigintBigintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverLtTbigintBigintLogicalFunction.hpp new file mode 100644 index 0000000000..91456fee24 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverLtTbigintBigintLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event ever_lt_tbigint_bigint: tests if a single-instant tbigint value ever lts a threshold. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ever_lt_tbigint_bigint`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class EverLtTbigintBigintLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverLtTbigintBigint"; + + EverLtTbigintBigintLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverNeTbigintBigintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverNeTbigintBigintLogicalFunction.hpp new file mode 100644 index 0000000000..5e78502677 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverNeTbigintBigintLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event ever_ne_tbigint_bigint: tests if a single-instant tbigint value ever nes a threshold. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ever_ne_tbigint_bigint`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class EverNeTbigintBigintLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverNeTbigintBigint"; + + EverNeTbigintBigintLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt index 18adc03f99..27a547c802 100644 --- a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt @@ -100,3 +100,9 @@ add_plugin(AlwaysGtTintInt LogicalFunction nes-logical-operators AlwaysGtTintInt add_plugin(AlwaysLeTintInt LogicalFunction nes-logical-operators AlwaysLeTintIntLogicalFunction.cpp) add_plugin(AlwaysLtTintInt LogicalFunction nes-logical-operators AlwaysLtTintIntLogicalFunction.cpp) add_plugin(AlwaysNeTintInt LogicalFunction nes-logical-operators AlwaysNeTintIntLogicalFunction.cpp) +add_plugin(EverEqTbigintBigint LogicalFunction nes-logical-operators EverEqTbigintBigintLogicalFunction.cpp) +add_plugin(EverGeTbigintBigint LogicalFunction nes-logical-operators EverGeTbigintBigintLogicalFunction.cpp) +add_plugin(EverGtTbigintBigint LogicalFunction nes-logical-operators EverGtTbigintBigintLogicalFunction.cpp) +add_plugin(EverLeTbigintBigint LogicalFunction nes-logical-operators EverLeTbigintBigintLogicalFunction.cpp) +add_plugin(EverLtTbigintBigint LogicalFunction nes-logical-operators EverLtTbigintBigintLogicalFunction.cpp) +add_plugin(EverNeTbigintBigint LogicalFunction nes-logical-operators EverNeTbigintBigintLogicalFunction.cpp) diff --git a/nes-logical-operators/src/Functions/Meos/EverEqTbigintBigintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverEqTbigintBigintLogicalFunction.cpp new file mode 100644 index 0000000000..63cb64adc8 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverEqTbigintBigintLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EverEqTbigintBigintLogicalFunction::EverEqTbigintBigintLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType EverEqTbigintBigintLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverEqTbigintBigintLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EverEqTbigintBigintLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverEqTbigintBigintLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "EverEqTbigintBigintLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EverEqTbigintBigintLogicalFunction::getType() const { return NAME; } + +bool EverEqTbigintBigintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EverEqTbigintBigintLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction EverEqTbigintBigintLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction EverEqTbigintBigintLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverEqTbigintBigintLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "EverEqTbigintBigintLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return EverEqTbigintBigintLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverGeTbigintBigintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverGeTbigintBigintLogicalFunction.cpp new file mode 100644 index 0000000000..b1d661e0b8 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverGeTbigintBigintLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EverGeTbigintBigintLogicalFunction::EverGeTbigintBigintLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType EverGeTbigintBigintLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverGeTbigintBigintLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EverGeTbigintBigintLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverGeTbigintBigintLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "EverGeTbigintBigintLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EverGeTbigintBigintLogicalFunction::getType() const { return NAME; } + +bool EverGeTbigintBigintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EverGeTbigintBigintLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction EverGeTbigintBigintLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction EverGeTbigintBigintLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverGeTbigintBigintLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "EverGeTbigintBigintLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return EverGeTbigintBigintLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverGtTbigintBigintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverGtTbigintBigintLogicalFunction.cpp new file mode 100644 index 0000000000..f8689bed1f --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverGtTbigintBigintLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EverGtTbigintBigintLogicalFunction::EverGtTbigintBigintLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType EverGtTbigintBigintLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverGtTbigintBigintLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EverGtTbigintBigintLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverGtTbigintBigintLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "EverGtTbigintBigintLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EverGtTbigintBigintLogicalFunction::getType() const { return NAME; } + +bool EverGtTbigintBigintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EverGtTbigintBigintLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction EverGtTbigintBigintLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction EverGtTbigintBigintLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverGtTbigintBigintLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "EverGtTbigintBigintLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return EverGtTbigintBigintLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverLeTbigintBigintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverLeTbigintBigintLogicalFunction.cpp new file mode 100644 index 0000000000..24d09cd35e --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverLeTbigintBigintLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EverLeTbigintBigintLogicalFunction::EverLeTbigintBigintLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType EverLeTbigintBigintLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverLeTbigintBigintLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EverLeTbigintBigintLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverLeTbigintBigintLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "EverLeTbigintBigintLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EverLeTbigintBigintLogicalFunction::getType() const { return NAME; } + +bool EverLeTbigintBigintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EverLeTbigintBigintLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction EverLeTbigintBigintLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction EverLeTbigintBigintLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverLeTbigintBigintLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "EverLeTbigintBigintLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return EverLeTbigintBigintLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverLtTbigintBigintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverLtTbigintBigintLogicalFunction.cpp new file mode 100644 index 0000000000..010345f59c --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverLtTbigintBigintLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EverLtTbigintBigintLogicalFunction::EverLtTbigintBigintLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType EverLtTbigintBigintLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverLtTbigintBigintLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EverLtTbigintBigintLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverLtTbigintBigintLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "EverLtTbigintBigintLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EverLtTbigintBigintLogicalFunction::getType() const { return NAME; } + +bool EverLtTbigintBigintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EverLtTbigintBigintLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction EverLtTbigintBigintLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction EverLtTbigintBigintLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverLtTbigintBigintLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "EverLtTbigintBigintLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return EverLtTbigintBigintLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverNeTbigintBigintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverNeTbigintBigintLogicalFunction.cpp new file mode 100644 index 0000000000..1c385ff7af --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverNeTbigintBigintLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EverNeTbigintBigintLogicalFunction::EverNeTbigintBigintLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType EverNeTbigintBigintLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverNeTbigintBigintLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EverNeTbigintBigintLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverNeTbigintBigintLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "EverNeTbigintBigintLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EverNeTbigintBigintLogicalFunction::getType() const { return NAME; } + +bool EverNeTbigintBigintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EverNeTbigintBigintLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction EverNeTbigintBigintLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction EverNeTbigintBigintLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverNeTbigintBigintLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "EverNeTbigintBigintLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return EverNeTbigintBigintLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverEqTbigintBigintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverEqTbigintBigintPhysicalFunction.hpp new file mode 100644 index 0000000000..0d9dd4195f --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverEqTbigintBigintPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `ever_eq_tbigint_bigint`. + * + * Per-event ever_eq_tbigint_bigint: tests if a single-instant tbigint value ever eqs a threshold. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class EverEqTbigintBigintPhysicalFunction : public PhysicalFunctionConcept { +public: + EverEqTbigintBigintPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverGeTbigintBigintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverGeTbigintBigintPhysicalFunction.hpp new file mode 100644 index 0000000000..390aee0c48 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverGeTbigintBigintPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `ever_ge_tbigint_bigint`. + * + * Per-event ever_ge_tbigint_bigint: tests if a single-instant tbigint value ever ges a threshold. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class EverGeTbigintBigintPhysicalFunction : public PhysicalFunctionConcept { +public: + EverGeTbigintBigintPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverGtTbigintBigintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverGtTbigintBigintPhysicalFunction.hpp new file mode 100644 index 0000000000..a13411d83f --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverGtTbigintBigintPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `ever_gt_tbigint_bigint`. + * + * Per-event ever_gt_tbigint_bigint: tests if a single-instant tbigint value ever gts a threshold. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class EverGtTbigintBigintPhysicalFunction : public PhysicalFunctionConcept { +public: + EverGtTbigintBigintPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverLeTbigintBigintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverLeTbigintBigintPhysicalFunction.hpp new file mode 100644 index 0000000000..8e99ab050c --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverLeTbigintBigintPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `ever_le_tbigint_bigint`. + * + * Per-event ever_le_tbigint_bigint: tests if a single-instant tbigint value ever les a threshold. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class EverLeTbigintBigintPhysicalFunction : public PhysicalFunctionConcept { +public: + EverLeTbigintBigintPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverLtTbigintBigintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverLtTbigintBigintPhysicalFunction.hpp new file mode 100644 index 0000000000..cbb8e2338b --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverLtTbigintBigintPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `ever_lt_tbigint_bigint`. + * + * Per-event ever_lt_tbigint_bigint: tests if a single-instant tbigint value ever lts a threshold. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class EverLtTbigintBigintPhysicalFunction : public PhysicalFunctionConcept { +public: + EverLtTbigintBigintPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverNeTbigintBigintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverNeTbigintBigintPhysicalFunction.hpp new file mode 100644 index 0000000000..54ff0c5f7b --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverNeTbigintBigintPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `ever_ne_tbigint_bigint`. + * + * Per-event ever_ne_tbigint_bigint: tests if a single-instant tbigint value ever nes a threshold. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class EverNeTbigintBigintPhysicalFunction : public PhysicalFunctionConcept { +public: + EverNeTbigintBigintPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt index c31c9c6034..340d0c6aaa 100644 --- a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt @@ -99,4 +99,10 @@ add_plugin(AlwaysGtTintInt PhysicalFunction nes-physical-operators AlwaysGtTintI add_plugin(AlwaysLeTintInt PhysicalFunction nes-physical-operators AlwaysLeTintIntPhysicalFunction.cpp) add_plugin(AlwaysLtTintInt PhysicalFunction nes-physical-operators AlwaysLtTintIntPhysicalFunction.cpp) add_plugin(AlwaysNeTintInt PhysicalFunction nes-physical-operators AlwaysNeTintIntPhysicalFunction.cpp) +add_plugin(EverEqTbigintBigint PhysicalFunction nes-physical-operators EverEqTbigintBigintPhysicalFunction.cpp) +add_plugin(EverGeTbigintBigint PhysicalFunction nes-physical-operators EverGeTbigintBigintPhysicalFunction.cpp) +add_plugin(EverGtTbigintBigint PhysicalFunction nes-physical-operators EverGtTbigintBigintPhysicalFunction.cpp) +add_plugin(EverLeTbigintBigint PhysicalFunction nes-physical-operators EverLeTbigintBigintPhysicalFunction.cpp) +add_plugin(EverLtTbigintBigint PhysicalFunction nes-physical-operators EverLtTbigintBigintPhysicalFunction.cpp) +add_plugin(EverNeTbigintBigint PhysicalFunction nes-physical-operators EverNeTbigintBigintPhysicalFunction.cpp) endif() diff --git a/nes-physical-operators/src/Functions/Meos/EverEqTbigintBigintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverEqTbigintBigintPhysicalFunction.cpp new file mode 100644 index 0000000000..bbbda8e3b1 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverEqTbigintBigintPhysicalFunction.cpp @@ -0,0 +1,88 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +EverEqTbigintBigintPhysicalFunction::EverEqTbigintBigintPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(thresholdFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal EverEqTbigintBigintPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto threshold = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double value, double threshold, uint64_t ts) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string tempWkt = fmt::format("{}@{}", static_cast(value), MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tbigint_in(tempWkt.c_str()); + if (!temp) return 0.0; + int r = ever_eq_tbigint_bigint(temp, static_cast(threshold)); + free(temp); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + value, threshold, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverEqTbigintBigintPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "EverEqTbigintBigintPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return EverEqTbigintBigintPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverGeTbigintBigintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverGeTbigintBigintPhysicalFunction.cpp new file mode 100644 index 0000000000..66e760ca67 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverGeTbigintBigintPhysicalFunction.cpp @@ -0,0 +1,88 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +EverGeTbigintBigintPhysicalFunction::EverGeTbigintBigintPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(thresholdFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal EverGeTbigintBigintPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto threshold = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double value, double threshold, uint64_t ts) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string tempWkt = fmt::format("{}@{}", static_cast(value), MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tbigint_in(tempWkt.c_str()); + if (!temp) return 0.0; + int r = ever_ge_tbigint_bigint(temp, static_cast(threshold)); + free(temp); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + value, threshold, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverGeTbigintBigintPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "EverGeTbigintBigintPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return EverGeTbigintBigintPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverGtTbigintBigintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverGtTbigintBigintPhysicalFunction.cpp new file mode 100644 index 0000000000..fc74e3aef9 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverGtTbigintBigintPhysicalFunction.cpp @@ -0,0 +1,88 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +EverGtTbigintBigintPhysicalFunction::EverGtTbigintBigintPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(thresholdFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal EverGtTbigintBigintPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto threshold = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double value, double threshold, uint64_t ts) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string tempWkt = fmt::format("{}@{}", static_cast(value), MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tbigint_in(tempWkt.c_str()); + if (!temp) return 0.0; + int r = ever_gt_tbigint_bigint(temp, static_cast(threshold)); + free(temp); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + value, threshold, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverGtTbigintBigintPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "EverGtTbigintBigintPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return EverGtTbigintBigintPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverLeTbigintBigintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverLeTbigintBigintPhysicalFunction.cpp new file mode 100644 index 0000000000..b1b012d279 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverLeTbigintBigintPhysicalFunction.cpp @@ -0,0 +1,88 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +EverLeTbigintBigintPhysicalFunction::EverLeTbigintBigintPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(thresholdFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal EverLeTbigintBigintPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto threshold = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double value, double threshold, uint64_t ts) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string tempWkt = fmt::format("{}@{}", static_cast(value), MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tbigint_in(tempWkt.c_str()); + if (!temp) return 0.0; + int r = ever_le_tbigint_bigint(temp, static_cast(threshold)); + free(temp); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + value, threshold, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverLeTbigintBigintPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "EverLeTbigintBigintPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return EverLeTbigintBigintPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverLtTbigintBigintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverLtTbigintBigintPhysicalFunction.cpp new file mode 100644 index 0000000000..d28da880aa --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverLtTbigintBigintPhysicalFunction.cpp @@ -0,0 +1,88 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +EverLtTbigintBigintPhysicalFunction::EverLtTbigintBigintPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(thresholdFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal EverLtTbigintBigintPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto threshold = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double value, double threshold, uint64_t ts) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string tempWkt = fmt::format("{}@{}", static_cast(value), MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tbigint_in(tempWkt.c_str()); + if (!temp) return 0.0; + int r = ever_lt_tbigint_bigint(temp, static_cast(threshold)); + free(temp); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + value, threshold, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverLtTbigintBigintPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "EverLtTbigintBigintPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return EverLtTbigintBigintPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverNeTbigintBigintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverNeTbigintBigintPhysicalFunction.cpp new file mode 100644 index 0000000000..b102a2901b --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverNeTbigintBigintPhysicalFunction.cpp @@ -0,0 +1,88 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +EverNeTbigintBigintPhysicalFunction::EverNeTbigintBigintPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(thresholdFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal EverNeTbigintBigintPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto threshold = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double value, double threshold, uint64_t ts) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string tempWkt = fmt::format("{}@{}", static_cast(value), MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tbigint_in(tempWkt.c_str()); + if (!temp) return 0.0; + int r = ever_ne_tbigint_bigint(temp, static_cast(threshold)); + free(temp); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + value, threshold, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverNeTbigintBigintPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "EverNeTbigintBigintPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return EverNeTbigintBigintPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-sql-parser/AntlrSQL.g4 b/nes-sql-parser/AntlrSQL.g4 index 4dfe041161..8866198a2d 100644 --- a/nes-sql-parser/AntlrSQL.g4 +++ b/nes-sql-parser/AntlrSQL.g4 @@ -295,7 +295,7 @@ timeUnit: MS timestampParameter: name=identifier; -functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | EDWITHIN_TGEO_GEO | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS; +functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | EDWITHIN_TGEO_GEO | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS; sinkClause: INTO sink (',' sink)*; @@ -499,6 +499,12 @@ ALWAYS_LE_TINT_INT: 'ALWAYS_LE_TINT_INT' | 'always_le_tint_int'; ALWAYS_LT_TINT_INT: 'ALWAYS_LT_TINT_INT' | 'always_lt_tint_int'; ALWAYS_NE_TINT_INT: 'ALWAYS_NE_TINT_INT' | 'always_ne_tint_int'; EDWITHIN_TGEO_GEO: 'EDWITHIN_TGEO_GEO' | 'edwithin_tgeo_geo'; +EVER_EQ_TBIGINT_BIGINT: 'EVER_EQ_TBIGINT_BIGINT' | 'ever_eq_tbigint_bigint'; +EVER_GE_TBIGINT_BIGINT: 'EVER_GE_TBIGINT_BIGINT' | 'ever_ge_tbigint_bigint'; +EVER_GT_TBIGINT_BIGINT: 'EVER_GT_TBIGINT_BIGINT' | 'ever_gt_tbigint_bigint'; +EVER_LE_TBIGINT_BIGINT: 'EVER_LE_TBIGINT_BIGINT' | 'ever_le_tbigint_bigint'; +EVER_LT_TBIGINT_BIGINT: 'EVER_LT_TBIGINT_BIGINT' | 'ever_lt_tbigint_bigint'; +EVER_NE_TBIGINT_BIGINT: 'EVER_NE_TBIGINT_BIGINT' | 'ever_ne_tbigint_bigint'; EVER_EQ_TFLOAT_FLOAT: 'EVER_EQ_TFLOAT_FLOAT' | 'ever_eq_tfloat_float'; EVER_GE_TFLOAT_FLOAT: 'EVER_GE_TFLOAT_FLOAT' | 'ever_ge_tfloat_float'; EVER_GT_TFLOAT_FLOAT: 'EVER_GT_TFLOAT_FLOAT' | 'ever_gt_tfloat_float'; diff --git a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp index 12eec3b344..f1b94976e1 100644 --- a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp +++ b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp @@ -133,6 +133,12 @@ #include #include #include +#include +#include +#include +#include +#include +#include #include #include #include @@ -2938,6 +2944,180 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont } break; /* END CODEGEN PARSER GLUE: TINT_TO_TFLOAT */ + /* BEGIN CODEGEN PARSER GLUE: EVER_EQ_TBIGINT_BIGINT */ + case AntlrSQLLexer::EVER_EQ_TBIGINT_BIGINT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("EVER_EQ_TBIGINT_BIGINT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverEqTbigintBigintLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: EVER_EQ_TBIGINT_BIGINT */ + /* BEGIN CODEGEN PARSER GLUE: EVER_GE_TBIGINT_BIGINT */ + case AntlrSQLLexer::EVER_GE_TBIGINT_BIGINT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("EVER_GE_TBIGINT_BIGINT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverGeTbigintBigintLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: EVER_GE_TBIGINT_BIGINT */ + /* BEGIN CODEGEN PARSER GLUE: EVER_GT_TBIGINT_BIGINT */ + case AntlrSQLLexer::EVER_GT_TBIGINT_BIGINT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("EVER_GT_TBIGINT_BIGINT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverGtTbigintBigintLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: EVER_GT_TBIGINT_BIGINT */ + /* BEGIN CODEGEN PARSER GLUE: EVER_LE_TBIGINT_BIGINT */ + case AntlrSQLLexer::EVER_LE_TBIGINT_BIGINT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("EVER_LE_TBIGINT_BIGINT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverLeTbigintBigintLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: EVER_LE_TBIGINT_BIGINT */ + /* BEGIN CODEGEN PARSER GLUE: EVER_LT_TBIGINT_BIGINT */ + case AntlrSQLLexer::EVER_LT_TBIGINT_BIGINT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("EVER_LT_TBIGINT_BIGINT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverLtTbigintBigintLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: EVER_LT_TBIGINT_BIGINT */ + /* BEGIN CODEGEN PARSER GLUE: EVER_NE_TBIGINT_BIGINT */ + case AntlrSQLLexer::EVER_NE_TBIGINT_BIGINT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("EVER_NE_TBIGINT_BIGINT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverNeTbigintBigintLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: EVER_NE_TBIGINT_BIGINT */ /* BEGIN CODEGEN PARSER GLUE: EVER_EQ_TFLOAT_FLOAT */ case AntlrSQLLexer::EVER_EQ_TFLOAT_FLOAT: { From d8510a7a4553ffb3c9d4d5103c167592df432595 Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Fri, 12 Jun 2026 09:10:25 +0200 Subject: [PATCH 24/96] feat(meos): add ALWAYS_EQ/GE/GT/LE/LT/NE_TBIGINT_BIGINT NES operators (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. --- .../AlwaysEqTbigintBigintLogicalFunction.hpp | 54 ++++++ .../AlwaysGeTbigintBigintLogicalFunction.hpp | 54 ++++++ .../AlwaysGtTbigintBigintLogicalFunction.hpp | 54 ++++++ .../AlwaysLeTbigintBigintLogicalFunction.hpp | 54 ++++++ .../AlwaysLtTbigintBigintLogicalFunction.hpp | 54 ++++++ .../AlwaysNeTbigintBigintLogicalFunction.hpp | 54 ++++++ .../AlwaysEqTbigintBigintLogicalFunction.cpp | 105 ++++++++++ .../AlwaysGeTbigintBigintLogicalFunction.cpp | 105 ++++++++++ .../AlwaysGtTbigintBigintLogicalFunction.cpp | 105 ++++++++++ .../AlwaysLeTbigintBigintLogicalFunction.cpp | 105 ++++++++++ .../AlwaysLtTbigintBigintLogicalFunction.cpp | 105 ++++++++++ .../AlwaysNeTbigintBigintLogicalFunction.cpp | 105 ++++++++++ .../src/Functions/Meos/CMakeLists.txt | 6 + .../AlwaysEqTbigintBigintPhysicalFunction.hpp | 43 +++++ .../AlwaysGeTbigintBigintPhysicalFunction.hpp | 43 +++++ .../AlwaysGtTbigintBigintPhysicalFunction.hpp | 43 +++++ .../AlwaysLeTbigintBigintPhysicalFunction.hpp | 43 +++++ .../AlwaysLtTbigintBigintPhysicalFunction.hpp | 43 +++++ .../AlwaysNeTbigintBigintPhysicalFunction.hpp | 43 +++++ .../AlwaysEqTbigintBigintPhysicalFunction.cpp | 88 +++++++++ .../AlwaysGeTbigintBigintPhysicalFunction.cpp | 88 +++++++++ .../AlwaysGtTbigintBigintPhysicalFunction.cpp | 88 +++++++++ .../AlwaysLeTbigintBigintPhysicalFunction.cpp | 88 +++++++++ .../AlwaysLtTbigintBigintPhysicalFunction.cpp | 88 +++++++++ .../AlwaysNeTbigintBigintPhysicalFunction.cpp | 88 +++++++++ .../src/Functions/Meos/CMakeLists.txt | 6 + nes-sql-parser/AntlrSQL.g4 | 8 +- .../src/AntlrSQLQueryPlanCreator.cpp | 180 ++++++++++++++++++ 28 files changed, 1939 insertions(+), 1 deletion(-) create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysEqTbigintBigintLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysGeTbigintBigintLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysGtTbigintBigintLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysLeTbigintBigintLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysLtTbigintBigintLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysNeTbigintBigintLogicalFunction.hpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysEqTbigintBigintLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysGeTbigintBigintLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysGtTbigintBigintLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysLeTbigintBigintLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysLtTbigintBigintLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysNeTbigintBigintLogicalFunction.cpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysEqTbigintBigintPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysGeTbigintBigintPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysGtTbigintBigintPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysLeTbigintBigintPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysLtTbigintBigintPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysNeTbigintBigintPhysicalFunction.hpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysEqTbigintBigintPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysGeTbigintBigintPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysGtTbigintBigintPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysLeTbigintBigintPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysLtTbigintBigintPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysNeTbigintBigintPhysicalFunction.cpp diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysEqTbigintBigintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysEqTbigintBigintLogicalFunction.hpp new file mode 100644 index 0000000000..73cacef859 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysEqTbigintBigintLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event always_eq_tbigint_bigint: tests if a single-instant tbigint value always eqs a threshold. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `always_eq_tbigint_bigint`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class AlwaysEqTbigintBigintLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysEqTbigintBigint"; + + AlwaysEqTbigintBigintLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysGeTbigintBigintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysGeTbigintBigintLogicalFunction.hpp new file mode 100644 index 0000000000..a31094c055 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysGeTbigintBigintLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event always_ge_tbigint_bigint: tests if a single-instant tbigint value always ges a threshold. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `always_ge_tbigint_bigint`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class AlwaysGeTbigintBigintLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysGeTbigintBigint"; + + AlwaysGeTbigintBigintLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysGtTbigintBigintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysGtTbigintBigintLogicalFunction.hpp new file mode 100644 index 0000000000..545679adb1 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysGtTbigintBigintLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event always_gt_tbigint_bigint: tests if a single-instant tbigint value always gts a threshold. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `always_gt_tbigint_bigint`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class AlwaysGtTbigintBigintLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysGtTbigintBigint"; + + AlwaysGtTbigintBigintLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysLeTbigintBigintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysLeTbigintBigintLogicalFunction.hpp new file mode 100644 index 0000000000..4a536e136f --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysLeTbigintBigintLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event always_le_tbigint_bigint: tests if a single-instant tbigint value always les a threshold. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `always_le_tbigint_bigint`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class AlwaysLeTbigintBigintLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysLeTbigintBigint"; + + AlwaysLeTbigintBigintLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysLtTbigintBigintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysLtTbigintBigintLogicalFunction.hpp new file mode 100644 index 0000000000..6f59e4f7d2 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysLtTbigintBigintLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event always_lt_tbigint_bigint: tests if a single-instant tbigint value always lts a threshold. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `always_lt_tbigint_bigint`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class AlwaysLtTbigintBigintLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysLtTbigintBigint"; + + AlwaysLtTbigintBigintLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysNeTbigintBigintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysNeTbigintBigintLogicalFunction.hpp new file mode 100644 index 0000000000..34d9e07bff --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysNeTbigintBigintLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event always_ne_tbigint_bigint: tests if a single-instant tbigint value always nes a threshold. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `always_ne_tbigint_bigint`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class AlwaysNeTbigintBigintLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysNeTbigintBigint"; + + AlwaysNeTbigintBigintLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysEqTbigintBigintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysEqTbigintBigintLogicalFunction.cpp new file mode 100644 index 0000000000..98b2a73558 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysEqTbigintBigintLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AlwaysEqTbigintBigintLogicalFunction::AlwaysEqTbigintBigintLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType AlwaysEqTbigintBigintLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysEqTbigintBigintLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AlwaysEqTbigintBigintLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysEqTbigintBigintLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "AlwaysEqTbigintBigintLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AlwaysEqTbigintBigintLogicalFunction::getType() const { return NAME; } + +bool AlwaysEqTbigintBigintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AlwaysEqTbigintBigintLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction AlwaysEqTbigintBigintLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction AlwaysEqTbigintBigintLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysEqTbigintBigintLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "AlwaysEqTbigintBigintLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return AlwaysEqTbigintBigintLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysGeTbigintBigintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysGeTbigintBigintLogicalFunction.cpp new file mode 100644 index 0000000000..d433b0175f --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysGeTbigintBigintLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AlwaysGeTbigintBigintLogicalFunction::AlwaysGeTbigintBigintLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType AlwaysGeTbigintBigintLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysGeTbigintBigintLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AlwaysGeTbigintBigintLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysGeTbigintBigintLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "AlwaysGeTbigintBigintLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AlwaysGeTbigintBigintLogicalFunction::getType() const { return NAME; } + +bool AlwaysGeTbigintBigintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AlwaysGeTbigintBigintLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction AlwaysGeTbigintBigintLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction AlwaysGeTbigintBigintLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysGeTbigintBigintLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "AlwaysGeTbigintBigintLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return AlwaysGeTbigintBigintLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysGtTbigintBigintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysGtTbigintBigintLogicalFunction.cpp new file mode 100644 index 0000000000..3bd42528ad --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysGtTbigintBigintLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AlwaysGtTbigintBigintLogicalFunction::AlwaysGtTbigintBigintLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType AlwaysGtTbigintBigintLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysGtTbigintBigintLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AlwaysGtTbigintBigintLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysGtTbigintBigintLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "AlwaysGtTbigintBigintLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AlwaysGtTbigintBigintLogicalFunction::getType() const { return NAME; } + +bool AlwaysGtTbigintBigintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AlwaysGtTbigintBigintLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction AlwaysGtTbigintBigintLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction AlwaysGtTbigintBigintLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysGtTbigintBigintLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "AlwaysGtTbigintBigintLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return AlwaysGtTbigintBigintLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysLeTbigintBigintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysLeTbigintBigintLogicalFunction.cpp new file mode 100644 index 0000000000..86223eed0a --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysLeTbigintBigintLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AlwaysLeTbigintBigintLogicalFunction::AlwaysLeTbigintBigintLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType AlwaysLeTbigintBigintLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysLeTbigintBigintLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AlwaysLeTbigintBigintLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysLeTbigintBigintLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "AlwaysLeTbigintBigintLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AlwaysLeTbigintBigintLogicalFunction::getType() const { return NAME; } + +bool AlwaysLeTbigintBigintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AlwaysLeTbigintBigintLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction AlwaysLeTbigintBigintLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction AlwaysLeTbigintBigintLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysLeTbigintBigintLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "AlwaysLeTbigintBigintLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return AlwaysLeTbigintBigintLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysLtTbigintBigintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysLtTbigintBigintLogicalFunction.cpp new file mode 100644 index 0000000000..404fab0558 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysLtTbigintBigintLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AlwaysLtTbigintBigintLogicalFunction::AlwaysLtTbigintBigintLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType AlwaysLtTbigintBigintLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysLtTbigintBigintLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AlwaysLtTbigintBigintLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysLtTbigintBigintLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "AlwaysLtTbigintBigintLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AlwaysLtTbigintBigintLogicalFunction::getType() const { return NAME; } + +bool AlwaysLtTbigintBigintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AlwaysLtTbigintBigintLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction AlwaysLtTbigintBigintLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction AlwaysLtTbigintBigintLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysLtTbigintBigintLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "AlwaysLtTbigintBigintLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return AlwaysLtTbigintBigintLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysNeTbigintBigintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysNeTbigintBigintLogicalFunction.cpp new file mode 100644 index 0000000000..f6ff33b4c6 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysNeTbigintBigintLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AlwaysNeTbigintBigintLogicalFunction::AlwaysNeTbigintBigintLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType AlwaysNeTbigintBigintLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysNeTbigintBigintLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AlwaysNeTbigintBigintLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysNeTbigintBigintLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "AlwaysNeTbigintBigintLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AlwaysNeTbigintBigintLogicalFunction::getType() const { return NAME; } + +bool AlwaysNeTbigintBigintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AlwaysNeTbigintBigintLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction AlwaysNeTbigintBigintLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction AlwaysNeTbigintBigintLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysNeTbigintBigintLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "AlwaysNeTbigintBigintLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return AlwaysNeTbigintBigintLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt index 27a547c802..3eeb41115c 100644 --- a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt @@ -106,3 +106,9 @@ add_plugin(EverGtTbigintBigint LogicalFunction nes-logical-operators EverGtTbigi add_plugin(EverLeTbigintBigint LogicalFunction nes-logical-operators EverLeTbigintBigintLogicalFunction.cpp) add_plugin(EverLtTbigintBigint LogicalFunction nes-logical-operators EverLtTbigintBigintLogicalFunction.cpp) add_plugin(EverNeTbigintBigint LogicalFunction nes-logical-operators EverNeTbigintBigintLogicalFunction.cpp) +add_plugin(AlwaysEqTbigintBigint LogicalFunction nes-logical-operators AlwaysEqTbigintBigintLogicalFunction.cpp) +add_plugin(AlwaysGeTbigintBigint LogicalFunction nes-logical-operators AlwaysGeTbigintBigintLogicalFunction.cpp) +add_plugin(AlwaysGtTbigintBigint LogicalFunction nes-logical-operators AlwaysGtTbigintBigintLogicalFunction.cpp) +add_plugin(AlwaysLeTbigintBigint LogicalFunction nes-logical-operators AlwaysLeTbigintBigintLogicalFunction.cpp) +add_plugin(AlwaysLtTbigintBigint LogicalFunction nes-logical-operators AlwaysLtTbigintBigintLogicalFunction.cpp) +add_plugin(AlwaysNeTbigintBigint LogicalFunction nes-logical-operators AlwaysNeTbigintBigintLogicalFunction.cpp) diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysEqTbigintBigintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysEqTbigintBigintPhysicalFunction.hpp new file mode 100644 index 0000000000..1a2954e0d9 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysEqTbigintBigintPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `always_eq_tbigint_bigint`. + * + * Per-event always_eq_tbigint_bigint: tests if a single-instant tbigint value always eqs a threshold. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class AlwaysEqTbigintBigintPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysEqTbigintBigintPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysGeTbigintBigintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysGeTbigintBigintPhysicalFunction.hpp new file mode 100644 index 0000000000..696a10033e --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysGeTbigintBigintPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `always_ge_tbigint_bigint`. + * + * Per-event always_ge_tbigint_bigint: tests if a single-instant tbigint value always ges a threshold. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class AlwaysGeTbigintBigintPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysGeTbigintBigintPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysGtTbigintBigintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysGtTbigintBigintPhysicalFunction.hpp new file mode 100644 index 0000000000..057d173cb8 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysGtTbigintBigintPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `always_gt_tbigint_bigint`. + * + * Per-event always_gt_tbigint_bigint: tests if a single-instant tbigint value always gts a threshold. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class AlwaysGtTbigintBigintPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysGtTbigintBigintPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysLeTbigintBigintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysLeTbigintBigintPhysicalFunction.hpp new file mode 100644 index 0000000000..7eaec26d2a --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysLeTbigintBigintPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `always_le_tbigint_bigint`. + * + * Per-event always_le_tbigint_bigint: tests if a single-instant tbigint value always les a threshold. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class AlwaysLeTbigintBigintPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysLeTbigintBigintPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysLtTbigintBigintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysLtTbigintBigintPhysicalFunction.hpp new file mode 100644 index 0000000000..576af1c9b3 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysLtTbigintBigintPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `always_lt_tbigint_bigint`. + * + * Per-event always_lt_tbigint_bigint: tests if a single-instant tbigint value always lts a threshold. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class AlwaysLtTbigintBigintPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysLtTbigintBigintPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysNeTbigintBigintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysNeTbigintBigintPhysicalFunction.hpp new file mode 100644 index 0000000000..3841644db4 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysNeTbigintBigintPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `always_ne_tbigint_bigint`. + * + * Per-event always_ne_tbigint_bigint: tests if a single-instant tbigint value always nes a threshold. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class AlwaysNeTbigintBigintPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysNeTbigintBigintPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysEqTbigintBigintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysEqTbigintBigintPhysicalFunction.cpp new file mode 100644 index 0000000000..83f88e654b --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysEqTbigintBigintPhysicalFunction.cpp @@ -0,0 +1,88 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +AlwaysEqTbigintBigintPhysicalFunction::AlwaysEqTbigintBigintPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(thresholdFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal AlwaysEqTbigintBigintPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto threshold = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double value, double threshold, uint64_t ts) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string tempWkt = fmt::format("{}@{}", static_cast(value), MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tbigint_in(tempWkt.c_str()); + if (!temp) return 0.0; + int r = always_eq_tbigint_bigint(temp, static_cast(threshold)); + free(temp); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + value, threshold, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysEqTbigintBigintPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "AlwaysEqTbigintBigintPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return AlwaysEqTbigintBigintPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysGeTbigintBigintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysGeTbigintBigintPhysicalFunction.cpp new file mode 100644 index 0000000000..d16a0b080a --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysGeTbigintBigintPhysicalFunction.cpp @@ -0,0 +1,88 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +AlwaysGeTbigintBigintPhysicalFunction::AlwaysGeTbigintBigintPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(thresholdFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal AlwaysGeTbigintBigintPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto threshold = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double value, double threshold, uint64_t ts) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string tempWkt = fmt::format("{}@{}", static_cast(value), MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tbigint_in(tempWkt.c_str()); + if (!temp) return 0.0; + int r = always_ge_tbigint_bigint(temp, static_cast(threshold)); + free(temp); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + value, threshold, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysGeTbigintBigintPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "AlwaysGeTbigintBigintPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return AlwaysGeTbigintBigintPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysGtTbigintBigintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysGtTbigintBigintPhysicalFunction.cpp new file mode 100644 index 0000000000..e1fd28cdb2 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysGtTbigintBigintPhysicalFunction.cpp @@ -0,0 +1,88 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +AlwaysGtTbigintBigintPhysicalFunction::AlwaysGtTbigintBigintPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(thresholdFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal AlwaysGtTbigintBigintPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto threshold = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double value, double threshold, uint64_t ts) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string tempWkt = fmt::format("{}@{}", static_cast(value), MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tbigint_in(tempWkt.c_str()); + if (!temp) return 0.0; + int r = always_gt_tbigint_bigint(temp, static_cast(threshold)); + free(temp); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + value, threshold, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysGtTbigintBigintPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "AlwaysGtTbigintBigintPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return AlwaysGtTbigintBigintPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysLeTbigintBigintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysLeTbigintBigintPhysicalFunction.cpp new file mode 100644 index 0000000000..18083698c0 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysLeTbigintBigintPhysicalFunction.cpp @@ -0,0 +1,88 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +AlwaysLeTbigintBigintPhysicalFunction::AlwaysLeTbigintBigintPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(thresholdFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal AlwaysLeTbigintBigintPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto threshold = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double value, double threshold, uint64_t ts) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string tempWkt = fmt::format("{}@{}", static_cast(value), MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tbigint_in(tempWkt.c_str()); + if (!temp) return 0.0; + int r = always_le_tbigint_bigint(temp, static_cast(threshold)); + free(temp); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + value, threshold, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysLeTbigintBigintPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "AlwaysLeTbigintBigintPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return AlwaysLeTbigintBigintPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysLtTbigintBigintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysLtTbigintBigintPhysicalFunction.cpp new file mode 100644 index 0000000000..1c222e3c3f --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysLtTbigintBigintPhysicalFunction.cpp @@ -0,0 +1,88 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +AlwaysLtTbigintBigintPhysicalFunction::AlwaysLtTbigintBigintPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(thresholdFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal AlwaysLtTbigintBigintPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto threshold = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double value, double threshold, uint64_t ts) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string tempWkt = fmt::format("{}@{}", static_cast(value), MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tbigint_in(tempWkt.c_str()); + if (!temp) return 0.0; + int r = always_lt_tbigint_bigint(temp, static_cast(threshold)); + free(temp); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + value, threshold, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysLtTbigintBigintPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "AlwaysLtTbigintBigintPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return AlwaysLtTbigintBigintPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysNeTbigintBigintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysNeTbigintBigintPhysicalFunction.cpp new file mode 100644 index 0000000000..b8848188c2 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysNeTbigintBigintPhysicalFunction.cpp @@ -0,0 +1,88 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +AlwaysNeTbigintBigintPhysicalFunction::AlwaysNeTbigintBigintPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(thresholdFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal AlwaysNeTbigintBigintPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto threshold = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double value, double threshold, uint64_t ts) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string tempWkt = fmt::format("{}@{}", static_cast(value), MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tbigint_in(tempWkt.c_str()); + if (!temp) return 0.0; + int r = always_ne_tbigint_bigint(temp, static_cast(threshold)); + free(temp); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + value, threshold, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysNeTbigintBigintPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "AlwaysNeTbigintBigintPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return AlwaysNeTbigintBigintPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt index 340d0c6aaa..9f732075af 100644 --- a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt @@ -105,4 +105,10 @@ add_plugin(EverGtTbigintBigint PhysicalFunction nes-physical-operators EverGtTbi add_plugin(EverLeTbigintBigint PhysicalFunction nes-physical-operators EverLeTbigintBigintPhysicalFunction.cpp) add_plugin(EverLtTbigintBigint PhysicalFunction nes-physical-operators EverLtTbigintBigintPhysicalFunction.cpp) add_plugin(EverNeTbigintBigint PhysicalFunction nes-physical-operators EverNeTbigintBigintPhysicalFunction.cpp) +add_plugin(AlwaysEqTbigintBigint PhysicalFunction nes-physical-operators AlwaysEqTbigintBigintPhysicalFunction.cpp) +add_plugin(AlwaysGeTbigintBigint PhysicalFunction nes-physical-operators AlwaysGeTbigintBigintPhysicalFunction.cpp) +add_plugin(AlwaysGtTbigintBigint PhysicalFunction nes-physical-operators AlwaysGtTbigintBigintPhysicalFunction.cpp) +add_plugin(AlwaysLeTbigintBigint PhysicalFunction nes-physical-operators AlwaysLeTbigintBigintPhysicalFunction.cpp) +add_plugin(AlwaysLtTbigintBigint PhysicalFunction nes-physical-operators AlwaysLtTbigintBigintPhysicalFunction.cpp) +add_plugin(AlwaysNeTbigintBigint PhysicalFunction nes-physical-operators AlwaysNeTbigintBigintPhysicalFunction.cpp) endif() diff --git a/nes-sql-parser/AntlrSQL.g4 b/nes-sql-parser/AntlrSQL.g4 index 8866198a2d..b753ebd7cd 100644 --- a/nes-sql-parser/AntlrSQL.g4 +++ b/nes-sql-parser/AntlrSQL.g4 @@ -295,7 +295,7 @@ timeUnit: MS timestampParameter: name=identifier; -functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | EDWITHIN_TGEO_GEO | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS; +functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | EDWITHIN_TGEO_GEO | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS; sinkClause: INTO sink (',' sink)*; @@ -486,6 +486,12 @@ TEMPORAL_SEQUENCE: 'TEMPORAL_SEQUENCE' | 'temporal_sequence'; TEMPORAL_EINTERSECTS_GEOMETRY: 'TEMPORAL_EINTERSECTS_GEOMETRY' | 'temporal_eintersects_geometry'; TEMPORAL_AINTERSECTS_GEOMETRY: 'TEMPORAL_AINTERSECTS_GEOMETRY' | 'temporal_aintersects_geometry'; TEMPORAL_ECONTAINS_GEOMETRY: 'TEMPORAL_ECONTAINS_GEOMETRY' | 'temporal_econtains_geometry'; +ALWAYS_EQ_TBIGINT_BIGINT: 'ALWAYS_EQ_TBIGINT_BIGINT' | 'always_eq_tbigint_bigint'; +ALWAYS_GE_TBIGINT_BIGINT: 'ALWAYS_GE_TBIGINT_BIGINT' | 'always_ge_tbigint_bigint'; +ALWAYS_GT_TBIGINT_BIGINT: 'ALWAYS_GT_TBIGINT_BIGINT' | 'always_gt_tbigint_bigint'; +ALWAYS_LE_TBIGINT_BIGINT: 'ALWAYS_LE_TBIGINT_BIGINT' | 'always_le_tbigint_bigint'; +ALWAYS_LT_TBIGINT_BIGINT: 'ALWAYS_LT_TBIGINT_BIGINT' | 'always_lt_tbigint_bigint'; +ALWAYS_NE_TBIGINT_BIGINT: 'ALWAYS_NE_TBIGINT_BIGINT' | 'always_ne_tbigint_bigint'; ALWAYS_EQ_TFLOAT_FLOAT: 'ALWAYS_EQ_TFLOAT_FLOAT' | 'always_eq_tfloat_float'; ALWAYS_GE_TFLOAT_FLOAT: 'ALWAYS_GE_TFLOAT_FLOAT' | 'always_ge_tfloat_float'; ALWAYS_GT_TFLOAT_FLOAT: 'ALWAYS_GT_TFLOAT_FLOAT' | 'always_gt_tfloat_float'; diff --git a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp index f1b94976e1..3f76393001 100644 --- a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp +++ b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp @@ -133,6 +133,12 @@ #include #include #include +#include +#include +#include +#include +#include +#include #include #include #include @@ -3640,6 +3646,180 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont } break; /* END CODEGEN PARSER GLUE: ALWAYS_NE_TINT_INT */ + /* BEGIN CODEGEN PARSER GLUE: ALWAYS_EQ_TBIGINT_BIGINT */ + case AntlrSQLLexer::ALWAYS_EQ_TBIGINT_BIGINT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("ALWAYS_EQ_TBIGINT_BIGINT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AlwaysEqTbigintBigintLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: ALWAYS_EQ_TBIGINT_BIGINT */ + /* BEGIN CODEGEN PARSER GLUE: ALWAYS_GE_TBIGINT_BIGINT */ + case AntlrSQLLexer::ALWAYS_GE_TBIGINT_BIGINT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("ALWAYS_GE_TBIGINT_BIGINT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AlwaysGeTbigintBigintLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: ALWAYS_GE_TBIGINT_BIGINT */ + /* BEGIN CODEGEN PARSER GLUE: ALWAYS_GT_TBIGINT_BIGINT */ + case AntlrSQLLexer::ALWAYS_GT_TBIGINT_BIGINT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("ALWAYS_GT_TBIGINT_BIGINT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AlwaysGtTbigintBigintLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: ALWAYS_GT_TBIGINT_BIGINT */ + /* BEGIN CODEGEN PARSER GLUE: ALWAYS_LE_TBIGINT_BIGINT */ + case AntlrSQLLexer::ALWAYS_LE_TBIGINT_BIGINT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("ALWAYS_LE_TBIGINT_BIGINT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AlwaysLeTbigintBigintLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: ALWAYS_LE_TBIGINT_BIGINT */ + /* BEGIN CODEGEN PARSER GLUE: ALWAYS_LT_TBIGINT_BIGINT */ + case AntlrSQLLexer::ALWAYS_LT_TBIGINT_BIGINT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("ALWAYS_LT_TBIGINT_BIGINT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AlwaysLtTbigintBigintLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: ALWAYS_LT_TBIGINT_BIGINT */ + /* BEGIN CODEGEN PARSER GLUE: ALWAYS_NE_TBIGINT_BIGINT */ + case AntlrSQLLexer::ALWAYS_NE_TBIGINT_BIGINT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("ALWAYS_NE_TBIGINT_BIGINT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AlwaysNeTbigintBigintLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: ALWAYS_NE_TBIGINT_BIGINT */ /* BEGIN CODEGEN PARSER GLUE: ALWAYS_EQ_TFLOAT_FLOAT */ case AntlrSQLLexer::ALWAYS_EQ_TFLOAT_FLOAT: { From 370d9863d6d86d2cf9137a899c787ce70e4c92c1 Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Fri, 12 Jun 2026 09:46:22 +0200 Subject: [PATCH 25/96] feat(meos): add EVER_EQ/GE/GT/LE/LT/NE_TFLOAT_TFLOAT NES operators (W67) --- .../EverEqTfloatTfloatLogicalFunction.hpp | 54 ++++++ .../EverGeTfloatTfloatLogicalFunction.hpp | 54 ++++++ .../EverGtTfloatTfloatLogicalFunction.hpp | 54 ++++++ .../EverLeTfloatTfloatLogicalFunction.hpp | 54 ++++++ .../EverLtTfloatTfloatLogicalFunction.hpp | 54 ++++++ .../EverNeTfloatTfloatLogicalFunction.hpp | 54 ++++++ .../src/Functions/Meos/CMakeLists.txt | 6 + .../EverEqTfloatTfloatLogicalFunction.cpp | 105 ++++++++++ .../EverGeTfloatTfloatLogicalFunction.cpp | 105 ++++++++++ .../EverGtTfloatTfloatLogicalFunction.cpp | 105 ++++++++++ .../EverLeTfloatTfloatLogicalFunction.cpp | 105 ++++++++++ .../EverLtTfloatTfloatLogicalFunction.cpp | 105 ++++++++++ .../EverNeTfloatTfloatLogicalFunction.cpp | 105 ++++++++++ .../EverEqTfloatTfloatPhysicalFunction.hpp | 43 +++++ .../EverGeTfloatTfloatPhysicalFunction.hpp | 43 +++++ .../EverGtTfloatTfloatPhysicalFunction.hpp | 43 +++++ .../EverLeTfloatTfloatPhysicalFunction.hpp | 43 +++++ .../EverLtTfloatTfloatPhysicalFunction.hpp | 43 +++++ .../EverNeTfloatTfloatPhysicalFunction.hpp | 43 +++++ .../src/Functions/Meos/CMakeLists.txt | 6 + .../EverEqTfloatTfloatPhysicalFunction.cpp | 93 +++++++++ .../EverGeTfloatTfloatPhysicalFunction.cpp | 93 +++++++++ .../EverGtTfloatTfloatPhysicalFunction.cpp | 93 +++++++++ .../EverLeTfloatTfloatPhysicalFunction.cpp | 93 +++++++++ .../EverLtTfloatTfloatPhysicalFunction.cpp | 93 +++++++++ .../EverNeTfloatTfloatPhysicalFunction.cpp | 93 +++++++++ nes-sql-parser/AntlrSQL.g4 | 8 +- .../src/AntlrSQLQueryPlanCreator.cpp | 180 ++++++++++++++++++ 28 files changed, 1969 insertions(+), 1 deletion(-) create mode 100644 nes-logical-operators/include/Functions/Meos/EverEqTfloatTfloatLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverGeTfloatTfloatLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverGtTfloatTfloatLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverLeTfloatTfloatLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverLtTfloatTfloatLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverNeTfloatTfloatLogicalFunction.hpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverEqTfloatTfloatLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverGeTfloatTfloatLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverGtTfloatTfloatLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverLeTfloatTfloatLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverLtTfloatTfloatLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverNeTfloatTfloatLogicalFunction.cpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverEqTfloatTfloatPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverGeTfloatTfloatPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverGtTfloatTfloatPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverLeTfloatTfloatPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverLtTfloatTfloatPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverNeTfloatTfloatPhysicalFunction.hpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverEqTfloatTfloatPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverGeTfloatTfloatPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverGtTfloatTfloatPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverLeTfloatTfloatPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverLtTfloatTfloatPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverNeTfloatTfloatPhysicalFunction.cpp diff --git a/nes-logical-operators/include/Functions/Meos/EverEqTfloatTfloatLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverEqTfloatTfloatLogicalFunction.hpp new file mode 100644 index 0000000000..2443348121 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverEqTfloatTfloatLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event ever_eq_tfloat_tfloat: tests if two single-instant tfloat values are ever equal. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ever_eq_tfloat_tfloat`. Takes (value1:FLOAT64, value2:FLOAT64, ts:UINT64), + * constructs two single-instant temporals, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class EverEqTfloatTfloatLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverEqTfloatTfloat"; + + EverEqTfloatTfloatLogicalFunction(LogicalFunction value1, + LogicalFunction value2, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverGeTfloatTfloatLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverGeTfloatTfloatLogicalFunction.hpp new file mode 100644 index 0000000000..11ea682b4a --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverGeTfloatTfloatLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event ever_ge_tfloat_tfloat: tests if a single-instant tfloat value is ever >= another. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ever_ge_tfloat_tfloat`. Takes (value1:FLOAT64, value2:FLOAT64, ts:UINT64), + * constructs two single-instant temporals, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class EverGeTfloatTfloatLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverGeTfloatTfloat"; + + EverGeTfloatTfloatLogicalFunction(LogicalFunction value1, + LogicalFunction value2, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverGtTfloatTfloatLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverGtTfloatTfloatLogicalFunction.hpp new file mode 100644 index 0000000000..205f5637b5 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverGtTfloatTfloatLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event ever_gt_tfloat_tfloat: tests if a single-instant tfloat value is ever > another. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ever_gt_tfloat_tfloat`. Takes (value1:FLOAT64, value2:FLOAT64, ts:UINT64), + * constructs two single-instant temporals, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class EverGtTfloatTfloatLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverGtTfloatTfloat"; + + EverGtTfloatTfloatLogicalFunction(LogicalFunction value1, + LogicalFunction value2, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverLeTfloatTfloatLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverLeTfloatTfloatLogicalFunction.hpp new file mode 100644 index 0000000000..9cf126509e --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverLeTfloatTfloatLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event ever_le_tfloat_tfloat: tests if a single-instant tfloat value is ever <= another. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ever_le_tfloat_tfloat`. Takes (value1:FLOAT64, value2:FLOAT64, ts:UINT64), + * constructs two single-instant temporals, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class EverLeTfloatTfloatLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverLeTfloatTfloat"; + + EverLeTfloatTfloatLogicalFunction(LogicalFunction value1, + LogicalFunction value2, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverLtTfloatTfloatLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverLtTfloatTfloatLogicalFunction.hpp new file mode 100644 index 0000000000..fe27023924 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverLtTfloatTfloatLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event ever_lt_tfloat_tfloat: tests if a single-instant tfloat value is ever < another. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ever_lt_tfloat_tfloat`. Takes (value1:FLOAT64, value2:FLOAT64, ts:UINT64), + * constructs two single-instant temporals, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class EverLtTfloatTfloatLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverLtTfloatTfloat"; + + EverLtTfloatTfloatLogicalFunction(LogicalFunction value1, + LogicalFunction value2, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverNeTfloatTfloatLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverNeTfloatTfloatLogicalFunction.hpp new file mode 100644 index 0000000000..91ca1b6e82 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverNeTfloatTfloatLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event ever_ne_tfloat_tfloat: tests if two single-instant tfloat values are ever not equal. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ever_ne_tfloat_tfloat`. Takes (value1:FLOAT64, value2:FLOAT64, ts:UINT64), + * constructs two single-instant temporals, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class EverNeTfloatTfloatLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverNeTfloatTfloat"; + + EverNeTfloatTfloatLogicalFunction(LogicalFunction value1, + LogicalFunction value2, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt index 3eeb41115c..b80b84b37f 100644 --- a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt @@ -112,3 +112,9 @@ add_plugin(AlwaysGtTbigintBigint LogicalFunction nes-logical-operators AlwaysGtT add_plugin(AlwaysLeTbigintBigint LogicalFunction nes-logical-operators AlwaysLeTbigintBigintLogicalFunction.cpp) add_plugin(AlwaysLtTbigintBigint LogicalFunction nes-logical-operators AlwaysLtTbigintBigintLogicalFunction.cpp) add_plugin(AlwaysNeTbigintBigint LogicalFunction nes-logical-operators AlwaysNeTbigintBigintLogicalFunction.cpp) +add_plugin(EverEqTfloatTfloat LogicalFunction nes-logical-operators EverEqTfloatTfloatLogicalFunction.cpp) +add_plugin(EverGeTfloatTfloat LogicalFunction nes-logical-operators EverGeTfloatTfloatLogicalFunction.cpp) +add_plugin(EverGtTfloatTfloat LogicalFunction nes-logical-operators EverGtTfloatTfloatLogicalFunction.cpp) +add_plugin(EverLeTfloatTfloat LogicalFunction nes-logical-operators EverLeTfloatTfloatLogicalFunction.cpp) +add_plugin(EverLtTfloatTfloat LogicalFunction nes-logical-operators EverLtTfloatTfloatLogicalFunction.cpp) +add_plugin(EverNeTfloatTfloat LogicalFunction nes-logical-operators EverNeTfloatTfloatLogicalFunction.cpp) diff --git a/nes-logical-operators/src/Functions/Meos/EverEqTfloatTfloatLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverEqTfloatTfloatLogicalFunction.cpp new file mode 100644 index 0000000000..1cfd5aa230 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverEqTfloatTfloatLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EverEqTfloatTfloatLogicalFunction::EverEqTfloatTfloatLogicalFunction(LogicalFunction value1, + LogicalFunction value2, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value1)); + parameters.push_back(std::move(value2)); + parameters.push_back(std::move(ts)); +} + +DataType EverEqTfloatTfloatLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverEqTfloatTfloatLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EverEqTfloatTfloatLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverEqTfloatTfloatLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "EverEqTfloatTfloatLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EverEqTfloatTfloatLogicalFunction::getType() const { return NAME; } + +bool EverEqTfloatTfloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EverEqTfloatTfloatLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction EverEqTfloatTfloatLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction EverEqTfloatTfloatLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverEqTfloatTfloatLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "EverEqTfloatTfloatLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return EverEqTfloatTfloatLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverGeTfloatTfloatLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverGeTfloatTfloatLogicalFunction.cpp new file mode 100644 index 0000000000..c715da9225 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverGeTfloatTfloatLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EverGeTfloatTfloatLogicalFunction::EverGeTfloatTfloatLogicalFunction(LogicalFunction value1, + LogicalFunction value2, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value1)); + parameters.push_back(std::move(value2)); + parameters.push_back(std::move(ts)); +} + +DataType EverGeTfloatTfloatLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverGeTfloatTfloatLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EverGeTfloatTfloatLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverGeTfloatTfloatLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "EverGeTfloatTfloatLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EverGeTfloatTfloatLogicalFunction::getType() const { return NAME; } + +bool EverGeTfloatTfloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EverGeTfloatTfloatLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction EverGeTfloatTfloatLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction EverGeTfloatTfloatLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverGeTfloatTfloatLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "EverGeTfloatTfloatLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return EverGeTfloatTfloatLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverGtTfloatTfloatLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverGtTfloatTfloatLogicalFunction.cpp new file mode 100644 index 0000000000..efed7082b8 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverGtTfloatTfloatLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EverGtTfloatTfloatLogicalFunction::EverGtTfloatTfloatLogicalFunction(LogicalFunction value1, + LogicalFunction value2, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value1)); + parameters.push_back(std::move(value2)); + parameters.push_back(std::move(ts)); +} + +DataType EverGtTfloatTfloatLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverGtTfloatTfloatLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EverGtTfloatTfloatLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverGtTfloatTfloatLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "EverGtTfloatTfloatLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EverGtTfloatTfloatLogicalFunction::getType() const { return NAME; } + +bool EverGtTfloatTfloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EverGtTfloatTfloatLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction EverGtTfloatTfloatLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction EverGtTfloatTfloatLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverGtTfloatTfloatLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "EverGtTfloatTfloatLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return EverGtTfloatTfloatLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverLeTfloatTfloatLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverLeTfloatTfloatLogicalFunction.cpp new file mode 100644 index 0000000000..3cbc28baab --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverLeTfloatTfloatLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EverLeTfloatTfloatLogicalFunction::EverLeTfloatTfloatLogicalFunction(LogicalFunction value1, + LogicalFunction value2, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value1)); + parameters.push_back(std::move(value2)); + parameters.push_back(std::move(ts)); +} + +DataType EverLeTfloatTfloatLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverLeTfloatTfloatLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EverLeTfloatTfloatLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverLeTfloatTfloatLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "EverLeTfloatTfloatLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EverLeTfloatTfloatLogicalFunction::getType() const { return NAME; } + +bool EverLeTfloatTfloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EverLeTfloatTfloatLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction EverLeTfloatTfloatLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction EverLeTfloatTfloatLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverLeTfloatTfloatLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "EverLeTfloatTfloatLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return EverLeTfloatTfloatLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverLtTfloatTfloatLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverLtTfloatTfloatLogicalFunction.cpp new file mode 100644 index 0000000000..316aad8049 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverLtTfloatTfloatLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EverLtTfloatTfloatLogicalFunction::EverLtTfloatTfloatLogicalFunction(LogicalFunction value1, + LogicalFunction value2, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value1)); + parameters.push_back(std::move(value2)); + parameters.push_back(std::move(ts)); +} + +DataType EverLtTfloatTfloatLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverLtTfloatTfloatLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EverLtTfloatTfloatLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverLtTfloatTfloatLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "EverLtTfloatTfloatLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EverLtTfloatTfloatLogicalFunction::getType() const { return NAME; } + +bool EverLtTfloatTfloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EverLtTfloatTfloatLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction EverLtTfloatTfloatLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction EverLtTfloatTfloatLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverLtTfloatTfloatLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "EverLtTfloatTfloatLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return EverLtTfloatTfloatLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverNeTfloatTfloatLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverNeTfloatTfloatLogicalFunction.cpp new file mode 100644 index 0000000000..fbfa005278 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverNeTfloatTfloatLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EverNeTfloatTfloatLogicalFunction::EverNeTfloatTfloatLogicalFunction(LogicalFunction value1, + LogicalFunction value2, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value1)); + parameters.push_back(std::move(value2)); + parameters.push_back(std::move(ts)); +} + +DataType EverNeTfloatTfloatLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverNeTfloatTfloatLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EverNeTfloatTfloatLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverNeTfloatTfloatLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "EverNeTfloatTfloatLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EverNeTfloatTfloatLogicalFunction::getType() const { return NAME; } + +bool EverNeTfloatTfloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EverNeTfloatTfloatLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction EverNeTfloatTfloatLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction EverNeTfloatTfloatLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverNeTfloatTfloatLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "EverNeTfloatTfloatLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return EverNeTfloatTfloatLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverEqTfloatTfloatPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverEqTfloatTfloatPhysicalFunction.hpp new file mode 100644 index 0000000000..eeff2788fc --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverEqTfloatTfloatPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `ever_eq_tfloat_tfloat`. + * + * Per-event ever_eq_tfloat_tfloat: tests if two single-instant tfloat values are ever equal. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class EverEqTfloatTfloatPhysicalFunction : public PhysicalFunctionConcept { +public: + EverEqTfloatTfloatPhysicalFunction(PhysicalFunction value1Function, + PhysicalFunction value2Function, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverGeTfloatTfloatPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverGeTfloatTfloatPhysicalFunction.hpp new file mode 100644 index 0000000000..59b68f7814 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverGeTfloatTfloatPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `ever_ge_tfloat_tfloat`. + * + * Per-event ever_ge_tfloat_tfloat: tests if a single-instant tfloat value is ever >= another. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class EverGeTfloatTfloatPhysicalFunction : public PhysicalFunctionConcept { +public: + EverGeTfloatTfloatPhysicalFunction(PhysicalFunction value1Function, + PhysicalFunction value2Function, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverGtTfloatTfloatPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverGtTfloatTfloatPhysicalFunction.hpp new file mode 100644 index 0000000000..37d9efc312 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverGtTfloatTfloatPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `ever_gt_tfloat_tfloat`. + * + * Per-event ever_gt_tfloat_tfloat: tests if a single-instant tfloat value is ever > another. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class EverGtTfloatTfloatPhysicalFunction : public PhysicalFunctionConcept { +public: + EverGtTfloatTfloatPhysicalFunction(PhysicalFunction value1Function, + PhysicalFunction value2Function, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverLeTfloatTfloatPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverLeTfloatTfloatPhysicalFunction.hpp new file mode 100644 index 0000000000..c654b70c34 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverLeTfloatTfloatPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `ever_le_tfloat_tfloat`. + * + * Per-event ever_le_tfloat_tfloat: tests if a single-instant tfloat value is ever <= another. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class EverLeTfloatTfloatPhysicalFunction : public PhysicalFunctionConcept { +public: + EverLeTfloatTfloatPhysicalFunction(PhysicalFunction value1Function, + PhysicalFunction value2Function, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverLtTfloatTfloatPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverLtTfloatTfloatPhysicalFunction.hpp new file mode 100644 index 0000000000..abdae5a08c --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverLtTfloatTfloatPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `ever_lt_tfloat_tfloat`. + * + * Per-event ever_lt_tfloat_tfloat: tests if a single-instant tfloat value is ever < another. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class EverLtTfloatTfloatPhysicalFunction : public PhysicalFunctionConcept { +public: + EverLtTfloatTfloatPhysicalFunction(PhysicalFunction value1Function, + PhysicalFunction value2Function, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverNeTfloatTfloatPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverNeTfloatTfloatPhysicalFunction.hpp new file mode 100644 index 0000000000..b442c9ac73 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverNeTfloatTfloatPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `ever_ne_tfloat_tfloat`. + * + * Per-event ever_ne_tfloat_tfloat: tests if two single-instant tfloat values are ever not equal. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class EverNeTfloatTfloatPhysicalFunction : public PhysicalFunctionConcept { +public: + EverNeTfloatTfloatPhysicalFunction(PhysicalFunction value1Function, + PhysicalFunction value2Function, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt index 9f732075af..87a11b5c6d 100644 --- a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt @@ -111,4 +111,10 @@ add_plugin(AlwaysGtTbigintBigint PhysicalFunction nes-physical-operators AlwaysG add_plugin(AlwaysLeTbigintBigint PhysicalFunction nes-physical-operators AlwaysLeTbigintBigintPhysicalFunction.cpp) add_plugin(AlwaysLtTbigintBigint PhysicalFunction nes-physical-operators AlwaysLtTbigintBigintPhysicalFunction.cpp) add_plugin(AlwaysNeTbigintBigint PhysicalFunction nes-physical-operators AlwaysNeTbigintBigintPhysicalFunction.cpp) +add_plugin(EverEqTfloatTfloat PhysicalFunction nes-physical-operators EverEqTfloatTfloatPhysicalFunction.cpp) +add_plugin(EverGeTfloatTfloat PhysicalFunction nes-physical-operators EverGeTfloatTfloatPhysicalFunction.cpp) +add_plugin(EverGtTfloatTfloat PhysicalFunction nes-physical-operators EverGtTfloatTfloatPhysicalFunction.cpp) +add_plugin(EverLeTfloatTfloat PhysicalFunction nes-physical-operators EverLeTfloatTfloatPhysicalFunction.cpp) +add_plugin(EverLtTfloatTfloat PhysicalFunction nes-physical-operators EverLtTfloatTfloatPhysicalFunction.cpp) +add_plugin(EverNeTfloatTfloat PhysicalFunction nes-physical-operators EverNeTfloatTfloatPhysicalFunction.cpp) endif() diff --git a/nes-physical-operators/src/Functions/Meos/EverEqTfloatTfloatPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverEqTfloatTfloatPhysicalFunction.cpp new file mode 100644 index 0000000000..ceddb1b1f3 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverEqTfloatTfloatPhysicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +EverEqTfloatTfloatPhysicalFunction::EverEqTfloatTfloatPhysicalFunction(PhysicalFunction value1Function, + PhysicalFunction value2Function, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(value1Function)); + parameterFunctions.push_back(std::move(value2Function)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal EverEqTfloatTfloatPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value1 = parameterValues[0].cast>(); + auto value2 = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double v1, double v2, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt1 = fmt::format("{}@{}", v1, ts_str); + std::string wkt2 = fmt::format("{}@{}", v2, ts_str); + Temporal* temp1 = tfloat_in(wkt1.c_str()); + if (!temp1) return 0.0; + Temporal* temp2 = tfloat_in(wkt2.c_str()); + if (!temp2) { free(temp1); return 0.0; } + int r = ever_eq_tfloat_tfloat(temp1, temp2); + free(temp1); + free(temp2); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + value1, value2, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverEqTfloatTfloatPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "EverEqTfloatTfloatPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return EverEqTfloatTfloatPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverGeTfloatTfloatPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverGeTfloatTfloatPhysicalFunction.cpp new file mode 100644 index 0000000000..730cdc1662 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverGeTfloatTfloatPhysicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +EverGeTfloatTfloatPhysicalFunction::EverGeTfloatTfloatPhysicalFunction(PhysicalFunction value1Function, + PhysicalFunction value2Function, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(value1Function)); + parameterFunctions.push_back(std::move(value2Function)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal EverGeTfloatTfloatPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value1 = parameterValues[0].cast>(); + auto value2 = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double v1, double v2, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt1 = fmt::format("{}@{}", v1, ts_str); + std::string wkt2 = fmt::format("{}@{}", v2, ts_str); + Temporal* temp1 = tfloat_in(wkt1.c_str()); + if (!temp1) return 0.0; + Temporal* temp2 = tfloat_in(wkt2.c_str()); + if (!temp2) { free(temp1); return 0.0; } + int r = ever_ge_tfloat_tfloat(temp1, temp2); + free(temp1); + free(temp2); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + value1, value2, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverGeTfloatTfloatPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "EverGeTfloatTfloatPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return EverGeTfloatTfloatPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverGtTfloatTfloatPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverGtTfloatTfloatPhysicalFunction.cpp new file mode 100644 index 0000000000..dcacfb2aa6 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverGtTfloatTfloatPhysicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +EverGtTfloatTfloatPhysicalFunction::EverGtTfloatTfloatPhysicalFunction(PhysicalFunction value1Function, + PhysicalFunction value2Function, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(value1Function)); + parameterFunctions.push_back(std::move(value2Function)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal EverGtTfloatTfloatPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value1 = parameterValues[0].cast>(); + auto value2 = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double v1, double v2, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt1 = fmt::format("{}@{}", v1, ts_str); + std::string wkt2 = fmt::format("{}@{}", v2, ts_str); + Temporal* temp1 = tfloat_in(wkt1.c_str()); + if (!temp1) return 0.0; + Temporal* temp2 = tfloat_in(wkt2.c_str()); + if (!temp2) { free(temp1); return 0.0; } + int r = ever_gt_tfloat_tfloat(temp1, temp2); + free(temp1); + free(temp2); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + value1, value2, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverGtTfloatTfloatPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "EverGtTfloatTfloatPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return EverGtTfloatTfloatPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverLeTfloatTfloatPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverLeTfloatTfloatPhysicalFunction.cpp new file mode 100644 index 0000000000..8013c8d2d1 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverLeTfloatTfloatPhysicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +EverLeTfloatTfloatPhysicalFunction::EverLeTfloatTfloatPhysicalFunction(PhysicalFunction value1Function, + PhysicalFunction value2Function, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(value1Function)); + parameterFunctions.push_back(std::move(value2Function)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal EverLeTfloatTfloatPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value1 = parameterValues[0].cast>(); + auto value2 = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double v1, double v2, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt1 = fmt::format("{}@{}", v1, ts_str); + std::string wkt2 = fmt::format("{}@{}", v2, ts_str); + Temporal* temp1 = tfloat_in(wkt1.c_str()); + if (!temp1) return 0.0; + Temporal* temp2 = tfloat_in(wkt2.c_str()); + if (!temp2) { free(temp1); return 0.0; } + int r = ever_le_tfloat_tfloat(temp1, temp2); + free(temp1); + free(temp2); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + value1, value2, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverLeTfloatTfloatPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "EverLeTfloatTfloatPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return EverLeTfloatTfloatPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverLtTfloatTfloatPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverLtTfloatTfloatPhysicalFunction.cpp new file mode 100644 index 0000000000..7a7d7b92f6 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverLtTfloatTfloatPhysicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +EverLtTfloatTfloatPhysicalFunction::EverLtTfloatTfloatPhysicalFunction(PhysicalFunction value1Function, + PhysicalFunction value2Function, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(value1Function)); + parameterFunctions.push_back(std::move(value2Function)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal EverLtTfloatTfloatPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value1 = parameterValues[0].cast>(); + auto value2 = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double v1, double v2, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt1 = fmt::format("{}@{}", v1, ts_str); + std::string wkt2 = fmt::format("{}@{}", v2, ts_str); + Temporal* temp1 = tfloat_in(wkt1.c_str()); + if (!temp1) return 0.0; + Temporal* temp2 = tfloat_in(wkt2.c_str()); + if (!temp2) { free(temp1); return 0.0; } + int r = ever_lt_tfloat_tfloat(temp1, temp2); + free(temp1); + free(temp2); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + value1, value2, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverLtTfloatTfloatPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "EverLtTfloatTfloatPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return EverLtTfloatTfloatPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverNeTfloatTfloatPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverNeTfloatTfloatPhysicalFunction.cpp new file mode 100644 index 0000000000..73d26c8047 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverNeTfloatTfloatPhysicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +EverNeTfloatTfloatPhysicalFunction::EverNeTfloatTfloatPhysicalFunction(PhysicalFunction value1Function, + PhysicalFunction value2Function, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(value1Function)); + parameterFunctions.push_back(std::move(value2Function)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal EverNeTfloatTfloatPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value1 = parameterValues[0].cast>(); + auto value2 = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double v1, double v2, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt1 = fmt::format("{}@{}", v1, ts_str); + std::string wkt2 = fmt::format("{}@{}", v2, ts_str); + Temporal* temp1 = tfloat_in(wkt1.c_str()); + if (!temp1) return 0.0; + Temporal* temp2 = tfloat_in(wkt2.c_str()); + if (!temp2) { free(temp1); return 0.0; } + int r = ever_ne_tfloat_tfloat(temp1, temp2); + free(temp1); + free(temp2); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + value1, value2, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverNeTfloatTfloatPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "EverNeTfloatTfloatPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return EverNeTfloatTfloatPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-sql-parser/AntlrSQL.g4 b/nes-sql-parser/AntlrSQL.g4 index b753ebd7cd..f05a26eed2 100644 --- a/nes-sql-parser/AntlrSQL.g4 +++ b/nes-sql-parser/AntlrSQL.g4 @@ -295,7 +295,7 @@ timeUnit: MS timestampParameter: name=identifier; -functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | EDWITHIN_TGEO_GEO | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS; +functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | EDWITHIN_TGEO_GEO | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS; sinkClause: INTO sink (',' sink)*; @@ -517,6 +517,12 @@ EVER_GT_TFLOAT_FLOAT: 'EVER_GT_TFLOAT_FLOAT' | 'ever_gt_tfloat_float'; EVER_LE_TFLOAT_FLOAT: 'EVER_LE_TFLOAT_FLOAT' | 'ever_le_tfloat_float'; EVER_LT_TFLOAT_FLOAT: 'EVER_LT_TFLOAT_FLOAT' | 'ever_lt_tfloat_float'; EVER_NE_TFLOAT_FLOAT: 'EVER_NE_TFLOAT_FLOAT' | 'ever_ne_tfloat_float'; +EVER_EQ_TFLOAT_TFLOAT: 'EVER_EQ_TFLOAT_TFLOAT' | 'ever_eq_tfloat_tfloat'; +EVER_GE_TFLOAT_TFLOAT: 'EVER_GE_TFLOAT_TFLOAT' | 'ever_ge_tfloat_tfloat'; +EVER_GT_TFLOAT_TFLOAT: 'EVER_GT_TFLOAT_TFLOAT' | 'ever_gt_tfloat_tfloat'; +EVER_LE_TFLOAT_TFLOAT: 'EVER_LE_TFLOAT_TFLOAT' | 'ever_le_tfloat_tfloat'; +EVER_LT_TFLOAT_TFLOAT: 'EVER_LT_TFLOAT_TFLOAT' | 'ever_lt_tfloat_tfloat'; +EVER_NE_TFLOAT_TFLOAT: 'EVER_NE_TFLOAT_TFLOAT' | 'ever_ne_tfloat_tfloat'; EVER_EQ_TINT_INT: 'EVER_EQ_TINT_INT' | 'ever_eq_tint_int'; EVER_GE_TINT_INT: 'EVER_GE_TINT_INT' | 'ever_ge_tint_int'; EVER_GT_TINT_INT: 'EVER_GT_TINT_INT' | 'ever_gt_tint_int'; diff --git a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp index 3f76393001..416af8aba6 100644 --- a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp +++ b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp @@ -145,6 +145,12 @@ #include #include #include +#include +#include +#include +#include +#include +#include #include #include #include @@ -3298,6 +3304,180 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont } break; /* END CODEGEN PARSER GLUE: EVER_NE_TFLOAT_FLOAT */ + /* BEGIN CODEGEN PARSER GLUE: EVER_EQ_TFLOAT_TFLOAT */ + case AntlrSQLLexer::EVER_EQ_TFLOAT_TFLOAT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("EVER_EQ_TFLOAT_TFLOAT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverEqTfloatTfloatLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: EVER_EQ_TFLOAT_TFLOAT */ + /* BEGIN CODEGEN PARSER GLUE: EVER_GE_TFLOAT_TFLOAT */ + case AntlrSQLLexer::EVER_GE_TFLOAT_TFLOAT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("EVER_GE_TFLOAT_TFLOAT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverGeTfloatTfloatLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: EVER_GE_TFLOAT_TFLOAT */ + /* BEGIN CODEGEN PARSER GLUE: EVER_GT_TFLOAT_TFLOAT */ + case AntlrSQLLexer::EVER_GT_TFLOAT_TFLOAT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("EVER_GT_TFLOAT_TFLOAT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverGtTfloatTfloatLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: EVER_GT_TFLOAT_TFLOAT */ + /* BEGIN CODEGEN PARSER GLUE: EVER_LE_TFLOAT_TFLOAT */ + case AntlrSQLLexer::EVER_LE_TFLOAT_TFLOAT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("EVER_LE_TFLOAT_TFLOAT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverLeTfloatTfloatLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: EVER_LE_TFLOAT_TFLOAT */ + /* BEGIN CODEGEN PARSER GLUE: EVER_LT_TFLOAT_TFLOAT */ + case AntlrSQLLexer::EVER_LT_TFLOAT_TFLOAT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("EVER_LT_TFLOAT_TFLOAT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverLtTfloatTfloatLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: EVER_LT_TFLOAT_TFLOAT */ + /* BEGIN CODEGEN PARSER GLUE: EVER_NE_TFLOAT_TFLOAT */ + case AntlrSQLLexer::EVER_NE_TFLOAT_TFLOAT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("EVER_NE_TFLOAT_TFLOAT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverNeTfloatTfloatLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: EVER_NE_TFLOAT_TFLOAT */ /* BEGIN CODEGEN PARSER GLUE: EVER_EQ_TINT_INT */ case AntlrSQLLexer::EVER_EQ_TINT_INT: { From 5086ace45f62d393f6cbe135021c3282a971b543 Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Fri, 12 Jun 2026 09:48:35 +0200 Subject: [PATCH 26/96] feat(meos): add ALWAYS_EQ/GE/GT/LE/LT/NE_TFLOAT_TFLOAT NES operators (W68) --- .../AlwaysEqTfloatTfloatLogicalFunction.hpp | 54 ++++++ .../AlwaysGeTfloatTfloatLogicalFunction.hpp | 54 ++++++ .../AlwaysGtTfloatTfloatLogicalFunction.hpp | 54 ++++++ .../AlwaysLeTfloatTfloatLogicalFunction.hpp | 54 ++++++ .../AlwaysLtTfloatTfloatLogicalFunction.hpp | 54 ++++++ .../AlwaysNeTfloatTfloatLogicalFunction.hpp | 54 ++++++ .../AlwaysEqTfloatTfloatLogicalFunction.cpp | 105 ++++++++++ .../AlwaysGeTfloatTfloatLogicalFunction.cpp | 105 ++++++++++ .../AlwaysGtTfloatTfloatLogicalFunction.cpp | 105 ++++++++++ .../AlwaysLeTfloatTfloatLogicalFunction.cpp | 105 ++++++++++ .../AlwaysLtTfloatTfloatLogicalFunction.cpp | 105 ++++++++++ .../AlwaysNeTfloatTfloatLogicalFunction.cpp | 105 ++++++++++ .../src/Functions/Meos/CMakeLists.txt | 6 + .../AlwaysEqTfloatTfloatPhysicalFunction.hpp | 43 +++++ .../AlwaysGeTfloatTfloatPhysicalFunction.hpp | 43 +++++ .../AlwaysGtTfloatTfloatPhysicalFunction.hpp | 43 +++++ .../AlwaysLeTfloatTfloatPhysicalFunction.hpp | 43 +++++ .../AlwaysLtTfloatTfloatPhysicalFunction.hpp | 43 +++++ .../AlwaysNeTfloatTfloatPhysicalFunction.hpp | 43 +++++ .../AlwaysEqTfloatTfloatPhysicalFunction.cpp | 93 +++++++++ .../AlwaysGeTfloatTfloatPhysicalFunction.cpp | 93 +++++++++ .../AlwaysGtTfloatTfloatPhysicalFunction.cpp | 93 +++++++++ .../AlwaysLeTfloatTfloatPhysicalFunction.cpp | 93 +++++++++ .../AlwaysLtTfloatTfloatPhysicalFunction.cpp | 93 +++++++++ .../AlwaysNeTfloatTfloatPhysicalFunction.cpp | 93 +++++++++ .../src/Functions/Meos/CMakeLists.txt | 6 + nes-sql-parser/AntlrSQL.g4 | 8 +- .../src/AntlrSQLQueryPlanCreator.cpp | 180 ++++++++++++++++++ 28 files changed, 1969 insertions(+), 1 deletion(-) create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysEqTfloatTfloatLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysGeTfloatTfloatLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysGtTfloatTfloatLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysLeTfloatTfloatLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysLtTfloatTfloatLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysNeTfloatTfloatLogicalFunction.hpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysEqTfloatTfloatLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysGeTfloatTfloatLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysGtTfloatTfloatLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysLeTfloatTfloatLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysLtTfloatTfloatLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysNeTfloatTfloatLogicalFunction.cpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysEqTfloatTfloatPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysGeTfloatTfloatPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysGtTfloatTfloatPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysLeTfloatTfloatPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysLtTfloatTfloatPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysNeTfloatTfloatPhysicalFunction.hpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysEqTfloatTfloatPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysGeTfloatTfloatPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysGtTfloatTfloatPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysLeTfloatTfloatPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysLtTfloatTfloatPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysNeTfloatTfloatPhysicalFunction.cpp diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysEqTfloatTfloatLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysEqTfloatTfloatLogicalFunction.hpp new file mode 100644 index 0000000000..8f3bf14907 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysEqTfloatTfloatLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event always_eq_tfloat_tfloat: tests if two single-instant tfloat values are always equal. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `always_eq_tfloat_tfloat`. Takes (value1:FLOAT64, value2:FLOAT64, ts:UINT64), + * constructs two single-instant temporals, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class AlwaysEqTfloatTfloatLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysEqTfloatTfloat"; + + AlwaysEqTfloatTfloatLogicalFunction(LogicalFunction value1, + LogicalFunction value2, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysGeTfloatTfloatLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysGeTfloatTfloatLogicalFunction.hpp new file mode 100644 index 0000000000..c28f61b9d0 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysGeTfloatTfloatLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event always_ge_tfloat_tfloat: tests if two single-instant tfloat values are always greater or equal. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `always_ge_tfloat_tfloat`. Takes (value1:FLOAT64, value2:FLOAT64, ts:UINT64), + * constructs two single-instant temporals, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class AlwaysGeTfloatTfloatLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysGeTfloatTfloat"; + + AlwaysGeTfloatTfloatLogicalFunction(LogicalFunction value1, + LogicalFunction value2, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysGtTfloatTfloatLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysGtTfloatTfloatLogicalFunction.hpp new file mode 100644 index 0000000000..bb6e69d20c --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysGtTfloatTfloatLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event always_gt_tfloat_tfloat: tests if two single-instant tfloat values are always greater than. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `always_gt_tfloat_tfloat`. Takes (value1:FLOAT64, value2:FLOAT64, ts:UINT64), + * constructs two single-instant temporals, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class AlwaysGtTfloatTfloatLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysGtTfloatTfloat"; + + AlwaysGtTfloatTfloatLogicalFunction(LogicalFunction value1, + LogicalFunction value2, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysLeTfloatTfloatLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysLeTfloatTfloatLogicalFunction.hpp new file mode 100644 index 0000000000..e0da946b69 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysLeTfloatTfloatLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event always_le_tfloat_tfloat: tests if two single-instant tfloat values are always less or equal. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `always_le_tfloat_tfloat`. Takes (value1:FLOAT64, value2:FLOAT64, ts:UINT64), + * constructs two single-instant temporals, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class AlwaysLeTfloatTfloatLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysLeTfloatTfloat"; + + AlwaysLeTfloatTfloatLogicalFunction(LogicalFunction value1, + LogicalFunction value2, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysLtTfloatTfloatLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysLtTfloatTfloatLogicalFunction.hpp new file mode 100644 index 0000000000..b230fad6a6 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysLtTfloatTfloatLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event always_lt_tfloat_tfloat: tests if two single-instant tfloat values are always less than. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `always_lt_tfloat_tfloat`. Takes (value1:FLOAT64, value2:FLOAT64, ts:UINT64), + * constructs two single-instant temporals, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class AlwaysLtTfloatTfloatLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysLtTfloatTfloat"; + + AlwaysLtTfloatTfloatLogicalFunction(LogicalFunction value1, + LogicalFunction value2, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysNeTfloatTfloatLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysNeTfloatTfloatLogicalFunction.hpp new file mode 100644 index 0000000000..89a2173d8b --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysNeTfloatTfloatLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event always_ne_tfloat_tfloat: tests if two single-instant tfloat values are always not equal. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `always_ne_tfloat_tfloat`. Takes (value1:FLOAT64, value2:FLOAT64, ts:UINT64), + * constructs two single-instant temporals, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class AlwaysNeTfloatTfloatLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysNeTfloatTfloat"; + + AlwaysNeTfloatTfloatLogicalFunction(LogicalFunction value1, + LogicalFunction value2, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysEqTfloatTfloatLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysEqTfloatTfloatLogicalFunction.cpp new file mode 100644 index 0000000000..ac2546cc62 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysEqTfloatTfloatLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AlwaysEqTfloatTfloatLogicalFunction::AlwaysEqTfloatTfloatLogicalFunction(LogicalFunction value1, + LogicalFunction value2, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value1)); + parameters.push_back(std::move(value2)); + parameters.push_back(std::move(ts)); +} + +DataType AlwaysEqTfloatTfloatLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysEqTfloatTfloatLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AlwaysEqTfloatTfloatLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysEqTfloatTfloatLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "AlwaysEqTfloatTfloatLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AlwaysEqTfloatTfloatLogicalFunction::getType() const { return NAME; } + +bool AlwaysEqTfloatTfloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AlwaysEqTfloatTfloatLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction AlwaysEqTfloatTfloatLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction AlwaysEqTfloatTfloatLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysEqTfloatTfloatLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "AlwaysEqTfloatTfloatLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return AlwaysEqTfloatTfloatLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysGeTfloatTfloatLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysGeTfloatTfloatLogicalFunction.cpp new file mode 100644 index 0000000000..fb64432927 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysGeTfloatTfloatLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AlwaysGeTfloatTfloatLogicalFunction::AlwaysGeTfloatTfloatLogicalFunction(LogicalFunction value1, + LogicalFunction value2, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value1)); + parameters.push_back(std::move(value2)); + parameters.push_back(std::move(ts)); +} + +DataType AlwaysGeTfloatTfloatLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysGeTfloatTfloatLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AlwaysGeTfloatTfloatLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysGeTfloatTfloatLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "AlwaysGeTfloatTfloatLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AlwaysGeTfloatTfloatLogicalFunction::getType() const { return NAME; } + +bool AlwaysGeTfloatTfloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AlwaysGeTfloatTfloatLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction AlwaysGeTfloatTfloatLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction AlwaysGeTfloatTfloatLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysGeTfloatTfloatLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "AlwaysGeTfloatTfloatLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return AlwaysGeTfloatTfloatLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysGtTfloatTfloatLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysGtTfloatTfloatLogicalFunction.cpp new file mode 100644 index 0000000000..8ca501b834 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysGtTfloatTfloatLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AlwaysGtTfloatTfloatLogicalFunction::AlwaysGtTfloatTfloatLogicalFunction(LogicalFunction value1, + LogicalFunction value2, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value1)); + parameters.push_back(std::move(value2)); + parameters.push_back(std::move(ts)); +} + +DataType AlwaysGtTfloatTfloatLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysGtTfloatTfloatLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AlwaysGtTfloatTfloatLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysGtTfloatTfloatLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "AlwaysGtTfloatTfloatLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AlwaysGtTfloatTfloatLogicalFunction::getType() const { return NAME; } + +bool AlwaysGtTfloatTfloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AlwaysGtTfloatTfloatLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction AlwaysGtTfloatTfloatLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction AlwaysGtTfloatTfloatLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysGtTfloatTfloatLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "AlwaysGtTfloatTfloatLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return AlwaysGtTfloatTfloatLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysLeTfloatTfloatLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysLeTfloatTfloatLogicalFunction.cpp new file mode 100644 index 0000000000..ac3b1f7bd5 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysLeTfloatTfloatLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AlwaysLeTfloatTfloatLogicalFunction::AlwaysLeTfloatTfloatLogicalFunction(LogicalFunction value1, + LogicalFunction value2, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value1)); + parameters.push_back(std::move(value2)); + parameters.push_back(std::move(ts)); +} + +DataType AlwaysLeTfloatTfloatLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysLeTfloatTfloatLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AlwaysLeTfloatTfloatLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysLeTfloatTfloatLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "AlwaysLeTfloatTfloatLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AlwaysLeTfloatTfloatLogicalFunction::getType() const { return NAME; } + +bool AlwaysLeTfloatTfloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AlwaysLeTfloatTfloatLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction AlwaysLeTfloatTfloatLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction AlwaysLeTfloatTfloatLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysLeTfloatTfloatLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "AlwaysLeTfloatTfloatLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return AlwaysLeTfloatTfloatLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysLtTfloatTfloatLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysLtTfloatTfloatLogicalFunction.cpp new file mode 100644 index 0000000000..d8ca815dbb --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysLtTfloatTfloatLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AlwaysLtTfloatTfloatLogicalFunction::AlwaysLtTfloatTfloatLogicalFunction(LogicalFunction value1, + LogicalFunction value2, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value1)); + parameters.push_back(std::move(value2)); + parameters.push_back(std::move(ts)); +} + +DataType AlwaysLtTfloatTfloatLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysLtTfloatTfloatLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AlwaysLtTfloatTfloatLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysLtTfloatTfloatLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "AlwaysLtTfloatTfloatLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AlwaysLtTfloatTfloatLogicalFunction::getType() const { return NAME; } + +bool AlwaysLtTfloatTfloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AlwaysLtTfloatTfloatLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction AlwaysLtTfloatTfloatLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction AlwaysLtTfloatTfloatLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysLtTfloatTfloatLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "AlwaysLtTfloatTfloatLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return AlwaysLtTfloatTfloatLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysNeTfloatTfloatLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysNeTfloatTfloatLogicalFunction.cpp new file mode 100644 index 0000000000..7ca2a0efa2 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysNeTfloatTfloatLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AlwaysNeTfloatTfloatLogicalFunction::AlwaysNeTfloatTfloatLogicalFunction(LogicalFunction value1, + LogicalFunction value2, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value1)); + parameters.push_back(std::move(value2)); + parameters.push_back(std::move(ts)); +} + +DataType AlwaysNeTfloatTfloatLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysNeTfloatTfloatLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AlwaysNeTfloatTfloatLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysNeTfloatTfloatLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "AlwaysNeTfloatTfloatLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AlwaysNeTfloatTfloatLogicalFunction::getType() const { return NAME; } + +bool AlwaysNeTfloatTfloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AlwaysNeTfloatTfloatLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction AlwaysNeTfloatTfloatLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction AlwaysNeTfloatTfloatLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysNeTfloatTfloatLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "AlwaysNeTfloatTfloatLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return AlwaysNeTfloatTfloatLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt index b80b84b37f..05b6e980fa 100644 --- a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt @@ -118,3 +118,9 @@ add_plugin(EverGtTfloatTfloat LogicalFunction nes-logical-operators EverGtTfloat add_plugin(EverLeTfloatTfloat LogicalFunction nes-logical-operators EverLeTfloatTfloatLogicalFunction.cpp) add_plugin(EverLtTfloatTfloat LogicalFunction nes-logical-operators EverLtTfloatTfloatLogicalFunction.cpp) add_plugin(EverNeTfloatTfloat LogicalFunction nes-logical-operators EverNeTfloatTfloatLogicalFunction.cpp) +add_plugin(AlwaysEqTfloatTfloat LogicalFunction nes-logical-operators AlwaysEqTfloatTfloatLogicalFunction.cpp) +add_plugin(AlwaysGeTfloatTfloat LogicalFunction nes-logical-operators AlwaysGeTfloatTfloatLogicalFunction.cpp) +add_plugin(AlwaysGtTfloatTfloat LogicalFunction nes-logical-operators AlwaysGtTfloatTfloatLogicalFunction.cpp) +add_plugin(AlwaysLeTfloatTfloat LogicalFunction nes-logical-operators AlwaysLeTfloatTfloatLogicalFunction.cpp) +add_plugin(AlwaysLtTfloatTfloat LogicalFunction nes-logical-operators AlwaysLtTfloatTfloatLogicalFunction.cpp) +add_plugin(AlwaysNeTfloatTfloat LogicalFunction nes-logical-operators AlwaysNeTfloatTfloatLogicalFunction.cpp) diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysEqTfloatTfloatPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysEqTfloatTfloatPhysicalFunction.hpp new file mode 100644 index 0000000000..fe0a51875f --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysEqTfloatTfloatPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `always_eq_tfloat_tfloat`. + * + * Per-event always_eq_tfloat_tfloat: tests if two single-instant tfloat values are always equal. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class AlwaysEqTfloatTfloatPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysEqTfloatTfloatPhysicalFunction(PhysicalFunction value1Function, + PhysicalFunction value2Function, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysGeTfloatTfloatPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysGeTfloatTfloatPhysicalFunction.hpp new file mode 100644 index 0000000000..41c3741fa8 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysGeTfloatTfloatPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `always_ge_tfloat_tfloat`. + * + * Per-event always_ge_tfloat_tfloat: tests if two single-instant tfloat values are always greater or equal. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class AlwaysGeTfloatTfloatPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysGeTfloatTfloatPhysicalFunction(PhysicalFunction value1Function, + PhysicalFunction value2Function, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysGtTfloatTfloatPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysGtTfloatTfloatPhysicalFunction.hpp new file mode 100644 index 0000000000..61431a3674 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysGtTfloatTfloatPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `always_gt_tfloat_tfloat`. + * + * Per-event always_gt_tfloat_tfloat: tests if two single-instant tfloat values are always greater than. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class AlwaysGtTfloatTfloatPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysGtTfloatTfloatPhysicalFunction(PhysicalFunction value1Function, + PhysicalFunction value2Function, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysLeTfloatTfloatPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysLeTfloatTfloatPhysicalFunction.hpp new file mode 100644 index 0000000000..fcd7715d02 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysLeTfloatTfloatPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `always_le_tfloat_tfloat`. + * + * Per-event always_le_tfloat_tfloat: tests if two single-instant tfloat values are always less or equal. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class AlwaysLeTfloatTfloatPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysLeTfloatTfloatPhysicalFunction(PhysicalFunction value1Function, + PhysicalFunction value2Function, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysLtTfloatTfloatPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysLtTfloatTfloatPhysicalFunction.hpp new file mode 100644 index 0000000000..7a56b6e4f1 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysLtTfloatTfloatPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `always_lt_tfloat_tfloat`. + * + * Per-event always_lt_tfloat_tfloat: tests if two single-instant tfloat values are always less than. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class AlwaysLtTfloatTfloatPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysLtTfloatTfloatPhysicalFunction(PhysicalFunction value1Function, + PhysicalFunction value2Function, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysNeTfloatTfloatPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysNeTfloatTfloatPhysicalFunction.hpp new file mode 100644 index 0000000000..18664359c9 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysNeTfloatTfloatPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `always_ne_tfloat_tfloat`. + * + * Per-event always_ne_tfloat_tfloat: tests if two single-instant tfloat values are always not equal. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class AlwaysNeTfloatTfloatPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysNeTfloatTfloatPhysicalFunction(PhysicalFunction value1Function, + PhysicalFunction value2Function, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysEqTfloatTfloatPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysEqTfloatTfloatPhysicalFunction.cpp new file mode 100644 index 0000000000..e9761f6eca --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysEqTfloatTfloatPhysicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +AlwaysEqTfloatTfloatPhysicalFunction::AlwaysEqTfloatTfloatPhysicalFunction(PhysicalFunction value1Function, + PhysicalFunction value2Function, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(value1Function)); + parameterFunctions.push_back(std::move(value2Function)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal AlwaysEqTfloatTfloatPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value1 = parameterValues[0].cast>(); + auto value2 = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double v1, double v2, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt1 = fmt::format("{}@{}", v1, ts_str); + std::string wkt2 = fmt::format("{}@{}", v2, ts_str); + Temporal* temp1 = tfloat_in(wkt1.c_str()); + if (!temp1) return 0.0; + Temporal* temp2 = tfloat_in(wkt2.c_str()); + if (!temp2) { free(temp1); return 0.0; } + int r = always_eq_tfloat_tfloat(temp1, temp2); + free(temp1); + free(temp2); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + value1, value2, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysEqTfloatTfloatPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "AlwaysEqTfloatTfloatPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return AlwaysEqTfloatTfloatPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysGeTfloatTfloatPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysGeTfloatTfloatPhysicalFunction.cpp new file mode 100644 index 0000000000..9e102a9140 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysGeTfloatTfloatPhysicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +AlwaysGeTfloatTfloatPhysicalFunction::AlwaysGeTfloatTfloatPhysicalFunction(PhysicalFunction value1Function, + PhysicalFunction value2Function, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(value1Function)); + parameterFunctions.push_back(std::move(value2Function)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal AlwaysGeTfloatTfloatPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value1 = parameterValues[0].cast>(); + auto value2 = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double v1, double v2, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt1 = fmt::format("{}@{}", v1, ts_str); + std::string wkt2 = fmt::format("{}@{}", v2, ts_str); + Temporal* temp1 = tfloat_in(wkt1.c_str()); + if (!temp1) return 0.0; + Temporal* temp2 = tfloat_in(wkt2.c_str()); + if (!temp2) { free(temp1); return 0.0; } + int r = always_ge_tfloat_tfloat(temp1, temp2); + free(temp1); + free(temp2); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + value1, value2, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysGeTfloatTfloatPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "AlwaysGeTfloatTfloatPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return AlwaysGeTfloatTfloatPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysGtTfloatTfloatPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysGtTfloatTfloatPhysicalFunction.cpp new file mode 100644 index 0000000000..1c03be6bd5 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysGtTfloatTfloatPhysicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +AlwaysGtTfloatTfloatPhysicalFunction::AlwaysGtTfloatTfloatPhysicalFunction(PhysicalFunction value1Function, + PhysicalFunction value2Function, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(value1Function)); + parameterFunctions.push_back(std::move(value2Function)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal AlwaysGtTfloatTfloatPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value1 = parameterValues[0].cast>(); + auto value2 = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double v1, double v2, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt1 = fmt::format("{}@{}", v1, ts_str); + std::string wkt2 = fmt::format("{}@{}", v2, ts_str); + Temporal* temp1 = tfloat_in(wkt1.c_str()); + if (!temp1) return 0.0; + Temporal* temp2 = tfloat_in(wkt2.c_str()); + if (!temp2) { free(temp1); return 0.0; } + int r = always_gt_tfloat_tfloat(temp1, temp2); + free(temp1); + free(temp2); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + value1, value2, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysGtTfloatTfloatPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "AlwaysGtTfloatTfloatPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return AlwaysGtTfloatTfloatPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysLeTfloatTfloatPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysLeTfloatTfloatPhysicalFunction.cpp new file mode 100644 index 0000000000..43810ec571 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysLeTfloatTfloatPhysicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +AlwaysLeTfloatTfloatPhysicalFunction::AlwaysLeTfloatTfloatPhysicalFunction(PhysicalFunction value1Function, + PhysicalFunction value2Function, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(value1Function)); + parameterFunctions.push_back(std::move(value2Function)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal AlwaysLeTfloatTfloatPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value1 = parameterValues[0].cast>(); + auto value2 = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double v1, double v2, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt1 = fmt::format("{}@{}", v1, ts_str); + std::string wkt2 = fmt::format("{}@{}", v2, ts_str); + Temporal* temp1 = tfloat_in(wkt1.c_str()); + if (!temp1) return 0.0; + Temporal* temp2 = tfloat_in(wkt2.c_str()); + if (!temp2) { free(temp1); return 0.0; } + int r = always_le_tfloat_tfloat(temp1, temp2); + free(temp1); + free(temp2); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + value1, value2, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysLeTfloatTfloatPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "AlwaysLeTfloatTfloatPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return AlwaysLeTfloatTfloatPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysLtTfloatTfloatPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysLtTfloatTfloatPhysicalFunction.cpp new file mode 100644 index 0000000000..965cf849b9 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysLtTfloatTfloatPhysicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +AlwaysLtTfloatTfloatPhysicalFunction::AlwaysLtTfloatTfloatPhysicalFunction(PhysicalFunction value1Function, + PhysicalFunction value2Function, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(value1Function)); + parameterFunctions.push_back(std::move(value2Function)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal AlwaysLtTfloatTfloatPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value1 = parameterValues[0].cast>(); + auto value2 = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double v1, double v2, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt1 = fmt::format("{}@{}", v1, ts_str); + std::string wkt2 = fmt::format("{}@{}", v2, ts_str); + Temporal* temp1 = tfloat_in(wkt1.c_str()); + if (!temp1) return 0.0; + Temporal* temp2 = tfloat_in(wkt2.c_str()); + if (!temp2) { free(temp1); return 0.0; } + int r = always_lt_tfloat_tfloat(temp1, temp2); + free(temp1); + free(temp2); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + value1, value2, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysLtTfloatTfloatPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "AlwaysLtTfloatTfloatPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return AlwaysLtTfloatTfloatPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysNeTfloatTfloatPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysNeTfloatTfloatPhysicalFunction.cpp new file mode 100644 index 0000000000..aa70122aa1 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysNeTfloatTfloatPhysicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +AlwaysNeTfloatTfloatPhysicalFunction::AlwaysNeTfloatTfloatPhysicalFunction(PhysicalFunction value1Function, + PhysicalFunction value2Function, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(value1Function)); + parameterFunctions.push_back(std::move(value2Function)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal AlwaysNeTfloatTfloatPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value1 = parameterValues[0].cast>(); + auto value2 = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double v1, double v2, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt1 = fmt::format("{}@{}", v1, ts_str); + std::string wkt2 = fmt::format("{}@{}", v2, ts_str); + Temporal* temp1 = tfloat_in(wkt1.c_str()); + if (!temp1) return 0.0; + Temporal* temp2 = tfloat_in(wkt2.c_str()); + if (!temp2) { free(temp1); return 0.0; } + int r = always_ne_tfloat_tfloat(temp1, temp2); + free(temp1); + free(temp2); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + value1, value2, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysNeTfloatTfloatPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "AlwaysNeTfloatTfloatPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return AlwaysNeTfloatTfloatPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt index 87a11b5c6d..b085495f7f 100644 --- a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt @@ -117,4 +117,10 @@ add_plugin(EverGtTfloatTfloat PhysicalFunction nes-physical-operators EverGtTflo add_plugin(EverLeTfloatTfloat PhysicalFunction nes-physical-operators EverLeTfloatTfloatPhysicalFunction.cpp) add_plugin(EverLtTfloatTfloat PhysicalFunction nes-physical-operators EverLtTfloatTfloatPhysicalFunction.cpp) add_plugin(EverNeTfloatTfloat PhysicalFunction nes-physical-operators EverNeTfloatTfloatPhysicalFunction.cpp) +add_plugin(AlwaysEqTfloatTfloat PhysicalFunction nes-physical-operators AlwaysEqTfloatTfloatPhysicalFunction.cpp) +add_plugin(AlwaysGeTfloatTfloat PhysicalFunction nes-physical-operators AlwaysGeTfloatTfloatPhysicalFunction.cpp) +add_plugin(AlwaysGtTfloatTfloat PhysicalFunction nes-physical-operators AlwaysGtTfloatTfloatPhysicalFunction.cpp) +add_plugin(AlwaysLeTfloatTfloat PhysicalFunction nes-physical-operators AlwaysLeTfloatTfloatPhysicalFunction.cpp) +add_plugin(AlwaysLtTfloatTfloat PhysicalFunction nes-physical-operators AlwaysLtTfloatTfloatPhysicalFunction.cpp) +add_plugin(AlwaysNeTfloatTfloat PhysicalFunction nes-physical-operators AlwaysNeTfloatTfloatPhysicalFunction.cpp) endif() diff --git a/nes-sql-parser/AntlrSQL.g4 b/nes-sql-parser/AntlrSQL.g4 index f05a26eed2..6eb4800e5c 100644 --- a/nes-sql-parser/AntlrSQL.g4 +++ b/nes-sql-parser/AntlrSQL.g4 @@ -295,7 +295,7 @@ timeUnit: MS timestampParameter: name=identifier; -functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | EDWITHIN_TGEO_GEO | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS; +functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | EDWITHIN_TGEO_GEO | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS; sinkClause: INTO sink (',' sink)*; @@ -498,6 +498,12 @@ ALWAYS_GT_TFLOAT_FLOAT: 'ALWAYS_GT_TFLOAT_FLOAT' | 'always_gt_tfloat_float'; ALWAYS_LE_TFLOAT_FLOAT: 'ALWAYS_LE_TFLOAT_FLOAT' | 'always_le_tfloat_float'; ALWAYS_LT_TFLOAT_FLOAT: 'ALWAYS_LT_TFLOAT_FLOAT' | 'always_lt_tfloat_float'; ALWAYS_NE_TFLOAT_FLOAT: 'ALWAYS_NE_TFLOAT_FLOAT' | 'always_ne_tfloat_float'; +ALWAYS_EQ_TFLOAT_TFLOAT: 'ALWAYS_EQ_TFLOAT_TFLOAT' | 'always_eq_tfloat_tfloat'; +ALWAYS_GE_TFLOAT_TFLOAT: 'ALWAYS_GE_TFLOAT_TFLOAT' | 'always_ge_tfloat_tfloat'; +ALWAYS_GT_TFLOAT_TFLOAT: 'ALWAYS_GT_TFLOAT_TFLOAT' | 'always_gt_tfloat_tfloat'; +ALWAYS_LE_TFLOAT_TFLOAT: 'ALWAYS_LE_TFLOAT_TFLOAT' | 'always_le_tfloat_tfloat'; +ALWAYS_LT_TFLOAT_TFLOAT: 'ALWAYS_LT_TFLOAT_TFLOAT' | 'always_lt_tfloat_tfloat'; +ALWAYS_NE_TFLOAT_TFLOAT: 'ALWAYS_NE_TFLOAT_TFLOAT' | 'always_ne_tfloat_tfloat'; ALWAYS_EQ_TINT_INT: 'ALWAYS_EQ_TINT_INT' | 'always_eq_tint_int'; ALWAYS_GE_TINT_INT: 'ALWAYS_GE_TINT_INT' | 'always_ge_tint_int'; ALWAYS_GT_TINT_INT: 'ALWAYS_GT_TINT_INT' | 'always_gt_tint_int'; diff --git a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp index 416af8aba6..4055e8a63e 100644 --- a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp +++ b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp @@ -169,6 +169,12 @@ #include #include #include +#include +#include +#include +#include +#include +#include #include #include #include @@ -4174,6 +4180,180 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont } break; /* END CODEGEN PARSER GLUE: ALWAYS_NE_TFLOAT_FLOAT */ + /* BEGIN CODEGEN PARSER GLUE: ALWAYS_EQ_TFLOAT_TFLOAT */ + case AntlrSQLLexer::ALWAYS_EQ_TFLOAT_TFLOAT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("ALWAYS_EQ_TFLOAT_TFLOAT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AlwaysEqTfloatTfloatLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: ALWAYS_EQ_TFLOAT_TFLOAT */ + /* BEGIN CODEGEN PARSER GLUE: ALWAYS_GE_TFLOAT_TFLOAT */ + case AntlrSQLLexer::ALWAYS_GE_TFLOAT_TFLOAT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("ALWAYS_GE_TFLOAT_TFLOAT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AlwaysGeTfloatTfloatLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: ALWAYS_GE_TFLOAT_TFLOAT */ + /* BEGIN CODEGEN PARSER GLUE: ALWAYS_GT_TFLOAT_TFLOAT */ + case AntlrSQLLexer::ALWAYS_GT_TFLOAT_TFLOAT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("ALWAYS_GT_TFLOAT_TFLOAT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AlwaysGtTfloatTfloatLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: ALWAYS_GT_TFLOAT_TFLOAT */ + /* BEGIN CODEGEN PARSER GLUE: ALWAYS_LE_TFLOAT_TFLOAT */ + case AntlrSQLLexer::ALWAYS_LE_TFLOAT_TFLOAT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("ALWAYS_LE_TFLOAT_TFLOAT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AlwaysLeTfloatTfloatLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: ALWAYS_LE_TFLOAT_TFLOAT */ + /* BEGIN CODEGEN PARSER GLUE: ALWAYS_LT_TFLOAT_TFLOAT */ + case AntlrSQLLexer::ALWAYS_LT_TFLOAT_TFLOAT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("ALWAYS_LT_TFLOAT_TFLOAT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AlwaysLtTfloatTfloatLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: ALWAYS_LT_TFLOAT_TFLOAT */ + /* BEGIN CODEGEN PARSER GLUE: ALWAYS_NE_TFLOAT_TFLOAT */ + case AntlrSQLLexer::ALWAYS_NE_TFLOAT_TFLOAT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("ALWAYS_NE_TFLOAT_TFLOAT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AlwaysNeTfloatTfloatLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: ALWAYS_NE_TFLOAT_TFLOAT */ default: /// Check if the function is a constructor for a datatype From db4e63690f6387f0ec42e1e4c6a912df38362121 Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Fri, 12 Jun 2026 09:52:29 +0200 Subject: [PATCH 27/96] feat(meos): add EVER_EQ/GE/GT/LE/LT/NE_TINT_TINT NES operators (W69) --- .../Meos/EverEqTintTintLogicalFunction.hpp | 54 ++++++ .../Meos/EverGeTintTintLogicalFunction.hpp | 54 ++++++ .../Meos/EverGtTintTintLogicalFunction.hpp | 54 ++++++ .../Meos/EverLeTintTintLogicalFunction.hpp | 54 ++++++ .../Meos/EverLtTintTintLogicalFunction.hpp | 54 ++++++ .../Meos/EverNeTintTintLogicalFunction.hpp | 54 ++++++ .../src/Functions/Meos/CMakeLists.txt | 6 + .../Meos/EverEqTintTintLogicalFunction.cpp | 105 ++++++++++ .../Meos/EverGeTintTintLogicalFunction.cpp | 105 ++++++++++ .../Meos/EverGtTintTintLogicalFunction.cpp | 105 ++++++++++ .../Meos/EverLeTintTintLogicalFunction.cpp | 105 ++++++++++ .../Meos/EverLtTintTintLogicalFunction.cpp | 105 ++++++++++ .../Meos/EverNeTintTintLogicalFunction.cpp | 105 ++++++++++ .../Meos/EverEqTintTintPhysicalFunction.hpp | 43 +++++ .../Meos/EverGeTintTintPhysicalFunction.hpp | 43 +++++ .../Meos/EverGtTintTintPhysicalFunction.hpp | 43 +++++ .../Meos/EverLeTintTintPhysicalFunction.hpp | 43 +++++ .../Meos/EverLtTintTintPhysicalFunction.hpp | 43 +++++ .../Meos/EverNeTintTintPhysicalFunction.hpp | 43 +++++ .../src/Functions/Meos/CMakeLists.txt | 6 + .../Meos/EverEqTintTintPhysicalFunction.cpp | 93 +++++++++ .../Meos/EverGeTintTintPhysicalFunction.cpp | 93 +++++++++ .../Meos/EverGtTintTintPhysicalFunction.cpp | 93 +++++++++ .../Meos/EverLeTintTintPhysicalFunction.cpp | 93 +++++++++ .../Meos/EverLtTintTintPhysicalFunction.cpp | 93 +++++++++ .../Meos/EverNeTintTintPhysicalFunction.cpp | 93 +++++++++ nes-sql-parser/AntlrSQL.g4 | 8 +- .../src/AntlrSQLQueryPlanCreator.cpp | 180 ++++++++++++++++++ 28 files changed, 1969 insertions(+), 1 deletion(-) create mode 100644 nes-logical-operators/include/Functions/Meos/EverEqTintTintLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverGeTintTintLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverGtTintTintLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverLeTintTintLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverLtTintTintLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverNeTintTintLogicalFunction.hpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverEqTintTintLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverGeTintTintLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverGtTintTintLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverLeTintTintLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverLtTintTintLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverNeTintTintLogicalFunction.cpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverEqTintTintPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverGeTintTintPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverGtTintTintPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverLeTintTintPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverLtTintTintPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverNeTintTintPhysicalFunction.hpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverEqTintTintPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverGeTintTintPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverGtTintTintPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverLeTintTintPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverLtTintTintPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverNeTintTintPhysicalFunction.cpp diff --git a/nes-logical-operators/include/Functions/Meos/EverEqTintTintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverEqTintTintLogicalFunction.hpp new file mode 100644 index 0000000000..7ec4f8404c --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverEqTintTintLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event ever_eq_tint_tfloat: tests if two single-instant tint values are ever equal. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ever_eq_tint_tfloat`. Takes (value1:FLOAT64, value2:FLOAT64, ts:UINT64), + * constructs two single-instant temporals, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class EverEqTintTfloatLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverEqTintTfloat"; + + EverEqTintTfloatLogicalFunction(LogicalFunction value1, + LogicalFunction value2, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverGeTintTintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverGeTintTintLogicalFunction.hpp new file mode 100644 index 0000000000..c3ecd8b446 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverGeTintTintLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event ever_ge_tint_tfloat: tests if two single-instant tint values are ever greater or equal. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ever_ge_tint_tfloat`. Takes (value1:FLOAT64, value2:FLOAT64, ts:UINT64), + * constructs two single-instant temporals, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class EverGeTintTfloatLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverGeTintTfloat"; + + EverGeTintTfloatLogicalFunction(LogicalFunction value1, + LogicalFunction value2, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverGtTintTintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverGtTintTintLogicalFunction.hpp new file mode 100644 index 0000000000..03d8dbfcdd --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverGtTintTintLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event ever_gt_tint_tfloat: tests if two single-instant tint values are ever greater than. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ever_gt_tint_tfloat`. Takes (value1:FLOAT64, value2:FLOAT64, ts:UINT64), + * constructs two single-instant temporals, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class EverGtTintTfloatLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverGtTintTfloat"; + + EverGtTintTfloatLogicalFunction(LogicalFunction value1, + LogicalFunction value2, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverLeTintTintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverLeTintTintLogicalFunction.hpp new file mode 100644 index 0000000000..be4bf55c75 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverLeTintTintLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event ever_le_tint_tfloat: tests if two single-instant tint values are ever less or equal. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ever_le_tint_tfloat`. Takes (value1:FLOAT64, value2:FLOAT64, ts:UINT64), + * constructs two single-instant temporals, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class EverLeTintTfloatLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverLeTintTfloat"; + + EverLeTintTfloatLogicalFunction(LogicalFunction value1, + LogicalFunction value2, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverLtTintTintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverLtTintTintLogicalFunction.hpp new file mode 100644 index 0000000000..094d80a783 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverLtTintTintLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event ever_lt_tint_tfloat: tests if two single-instant tint values are ever less than. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ever_lt_tint_tfloat`. Takes (value1:FLOAT64, value2:FLOAT64, ts:UINT64), + * constructs two single-instant temporals, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class EverLtTintTfloatLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverLtTintTfloat"; + + EverLtTintTfloatLogicalFunction(LogicalFunction value1, + LogicalFunction value2, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverNeTintTintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverNeTintTintLogicalFunction.hpp new file mode 100644 index 0000000000..ae4ac26264 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverNeTintTintLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event ever_ne_tint_tfloat: tests if two single-instant tint values are ever not equal. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ever_ne_tint_tfloat`. Takes (value1:FLOAT64, value2:FLOAT64, ts:UINT64), + * constructs two single-instant temporals, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class EverNeTintTfloatLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverNeTintTfloat"; + + EverNeTintTfloatLogicalFunction(LogicalFunction value1, + LogicalFunction value2, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt index 05b6e980fa..0159b5ecb0 100644 --- a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt @@ -124,3 +124,9 @@ add_plugin(AlwaysGtTfloatTfloat LogicalFunction nes-logical-operators AlwaysGtTf add_plugin(AlwaysLeTfloatTfloat LogicalFunction nes-logical-operators AlwaysLeTfloatTfloatLogicalFunction.cpp) add_plugin(AlwaysLtTfloatTfloat LogicalFunction nes-logical-operators AlwaysLtTfloatTfloatLogicalFunction.cpp) add_plugin(AlwaysNeTfloatTfloat LogicalFunction nes-logical-operators AlwaysNeTfloatTfloatLogicalFunction.cpp) +add_plugin(EverEqTintTint LogicalFunction nes-logical-operators EverEqTintTintLogicalFunction.cpp) +add_plugin(EverGeTintTint LogicalFunction nes-logical-operators EverGeTintTintLogicalFunction.cpp) +add_plugin(EverGtTintTint LogicalFunction nes-logical-operators EverGtTintTintLogicalFunction.cpp) +add_plugin(EverLeTintTint LogicalFunction nes-logical-operators EverLeTintTintLogicalFunction.cpp) +add_plugin(EverLtTintTint LogicalFunction nes-logical-operators EverLtTintTintLogicalFunction.cpp) +add_plugin(EverNeTintTint LogicalFunction nes-logical-operators EverNeTintTintLogicalFunction.cpp) diff --git a/nes-logical-operators/src/Functions/Meos/EverEqTintTintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverEqTintTintLogicalFunction.cpp new file mode 100644 index 0000000000..36354c8967 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverEqTintTintLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EverEqTintTfloatLogicalFunction::EverEqTintTfloatLogicalFunction(LogicalFunction value1, + LogicalFunction value2, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value1)); + parameters.push_back(std::move(value2)); + parameters.push_back(std::move(ts)); +} + +DataType EverEqTintTfloatLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverEqTintTfloatLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EverEqTintTfloatLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverEqTintTfloatLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "EverEqTintTfloatLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EverEqTintTfloatLogicalFunction::getType() const { return NAME; } + +bool EverEqTintTfloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EverEqTintTfloatLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction EverEqTintTfloatLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction EverEqTintTfloatLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverEqTintTfloatLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "EverEqTintTfloatLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return EverEqTintTfloatLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverGeTintTintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverGeTintTintLogicalFunction.cpp new file mode 100644 index 0000000000..40a41a043e --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverGeTintTintLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EverGeTintTfloatLogicalFunction::EverGeTintTfloatLogicalFunction(LogicalFunction value1, + LogicalFunction value2, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value1)); + parameters.push_back(std::move(value2)); + parameters.push_back(std::move(ts)); +} + +DataType EverGeTintTfloatLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverGeTintTfloatLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EverGeTintTfloatLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverGeTintTfloatLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "EverGeTintTfloatLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EverGeTintTfloatLogicalFunction::getType() const { return NAME; } + +bool EverGeTintTfloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EverGeTintTfloatLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction EverGeTintTfloatLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction EverGeTintTfloatLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverGeTintTfloatLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "EverGeTintTfloatLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return EverGeTintTfloatLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverGtTintTintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverGtTintTintLogicalFunction.cpp new file mode 100644 index 0000000000..5c58d78fda --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverGtTintTintLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EverGtTintTfloatLogicalFunction::EverGtTintTfloatLogicalFunction(LogicalFunction value1, + LogicalFunction value2, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value1)); + parameters.push_back(std::move(value2)); + parameters.push_back(std::move(ts)); +} + +DataType EverGtTintTfloatLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverGtTintTfloatLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EverGtTintTfloatLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverGtTintTfloatLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "EverGtTintTfloatLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EverGtTintTfloatLogicalFunction::getType() const { return NAME; } + +bool EverGtTintTfloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EverGtTintTfloatLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction EverGtTintTfloatLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction EverGtTintTfloatLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverGtTintTfloatLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "EverGtTintTfloatLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return EverGtTintTfloatLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverLeTintTintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverLeTintTintLogicalFunction.cpp new file mode 100644 index 0000000000..079b5d64c0 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverLeTintTintLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EverLeTintTfloatLogicalFunction::EverLeTintTfloatLogicalFunction(LogicalFunction value1, + LogicalFunction value2, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value1)); + parameters.push_back(std::move(value2)); + parameters.push_back(std::move(ts)); +} + +DataType EverLeTintTfloatLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverLeTintTfloatLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EverLeTintTfloatLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverLeTintTfloatLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "EverLeTintTfloatLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EverLeTintTfloatLogicalFunction::getType() const { return NAME; } + +bool EverLeTintTfloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EverLeTintTfloatLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction EverLeTintTfloatLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction EverLeTintTfloatLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverLeTintTfloatLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "EverLeTintTfloatLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return EverLeTintTfloatLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverLtTintTintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverLtTintTintLogicalFunction.cpp new file mode 100644 index 0000000000..39aa65da2f --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverLtTintTintLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EverLtTintTfloatLogicalFunction::EverLtTintTfloatLogicalFunction(LogicalFunction value1, + LogicalFunction value2, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value1)); + parameters.push_back(std::move(value2)); + parameters.push_back(std::move(ts)); +} + +DataType EverLtTintTfloatLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverLtTintTfloatLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EverLtTintTfloatLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverLtTintTfloatLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "EverLtTintTfloatLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EverLtTintTfloatLogicalFunction::getType() const { return NAME; } + +bool EverLtTintTfloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EverLtTintTfloatLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction EverLtTintTfloatLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction EverLtTintTfloatLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverLtTintTfloatLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "EverLtTintTfloatLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return EverLtTintTfloatLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverNeTintTintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverNeTintTintLogicalFunction.cpp new file mode 100644 index 0000000000..5a73940882 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverNeTintTintLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EverNeTintTfloatLogicalFunction::EverNeTintTfloatLogicalFunction(LogicalFunction value1, + LogicalFunction value2, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value1)); + parameters.push_back(std::move(value2)); + parameters.push_back(std::move(ts)); +} + +DataType EverNeTintTfloatLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverNeTintTfloatLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EverNeTintTfloatLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverNeTintTfloatLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "EverNeTintTfloatLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EverNeTintTfloatLogicalFunction::getType() const { return NAME; } + +bool EverNeTintTfloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EverNeTintTfloatLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction EverNeTintTfloatLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction EverNeTintTfloatLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverNeTintTfloatLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "EverNeTintTfloatLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return EverNeTintTfloatLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverEqTintTintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverEqTintTintPhysicalFunction.hpp new file mode 100644 index 0000000000..77d542711b --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverEqTintTintPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `ever_eq_tint_tfloat`. + * + * Per-event ever_eq_tint_tfloat: tests if two single-instant tfloat values are ever equal. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class EverEqTintTfloatPhysicalFunction : public PhysicalFunctionConcept { +public: + EverEqTintTfloatPhysicalFunction(PhysicalFunction value1Function, + PhysicalFunction value2Function, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverGeTintTintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverGeTintTintPhysicalFunction.hpp new file mode 100644 index 0000000000..e0f449ef14 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverGeTintTintPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `ever_ge_tint_tfloat`. + * + * Per-event ever_ge_tint_tfloat: tests if two single-instant tfloat values are ever greater or equal. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class EverGeTintTfloatPhysicalFunction : public PhysicalFunctionConcept { +public: + EverGeTintTfloatPhysicalFunction(PhysicalFunction value1Function, + PhysicalFunction value2Function, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverGtTintTintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverGtTintTintPhysicalFunction.hpp new file mode 100644 index 0000000000..6bed523848 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverGtTintTintPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `ever_gt_tint_tfloat`. + * + * Per-event ever_gt_tint_tfloat: tests if two single-instant tfloat values are ever greater than. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class EverGtTintTfloatPhysicalFunction : public PhysicalFunctionConcept { +public: + EverGtTintTfloatPhysicalFunction(PhysicalFunction value1Function, + PhysicalFunction value2Function, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverLeTintTintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverLeTintTintPhysicalFunction.hpp new file mode 100644 index 0000000000..15a53b5bdf --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverLeTintTintPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `ever_le_tint_tfloat`. + * + * Per-event ever_le_tint_tfloat: tests if two single-instant tfloat values are ever less or equal. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class EverLeTintTfloatPhysicalFunction : public PhysicalFunctionConcept { +public: + EverLeTintTfloatPhysicalFunction(PhysicalFunction value1Function, + PhysicalFunction value2Function, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverLtTintTintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverLtTintTintPhysicalFunction.hpp new file mode 100644 index 0000000000..b483fd4afc --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverLtTintTintPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `ever_lt_tint_tfloat`. + * + * Per-event ever_lt_tint_tfloat: tests if two single-instant tfloat values are ever less than. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class EverLtTintTfloatPhysicalFunction : public PhysicalFunctionConcept { +public: + EverLtTintTfloatPhysicalFunction(PhysicalFunction value1Function, + PhysicalFunction value2Function, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverNeTintTintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverNeTintTintPhysicalFunction.hpp new file mode 100644 index 0000000000..070a0b888a --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverNeTintTintPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `ever_ne_tint_tfloat`. + * + * Per-event ever_ne_tint_tfloat: tests if two single-instant tfloat values are ever not equal. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class EverNeTintTfloatPhysicalFunction : public PhysicalFunctionConcept { +public: + EverNeTintTfloatPhysicalFunction(PhysicalFunction value1Function, + PhysicalFunction value2Function, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt index b085495f7f..fe43ef7386 100644 --- a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt @@ -123,4 +123,10 @@ add_plugin(AlwaysGtTfloatTfloat PhysicalFunction nes-physical-operators AlwaysGt add_plugin(AlwaysLeTfloatTfloat PhysicalFunction nes-physical-operators AlwaysLeTfloatTfloatPhysicalFunction.cpp) add_plugin(AlwaysLtTfloatTfloat PhysicalFunction nes-physical-operators AlwaysLtTfloatTfloatPhysicalFunction.cpp) add_plugin(AlwaysNeTfloatTfloat PhysicalFunction nes-physical-operators AlwaysNeTfloatTfloatPhysicalFunction.cpp) +add_plugin(EverEqTintTint PhysicalFunction nes-physical-operators EverEqTintTintPhysicalFunction.cpp) +add_plugin(EverGeTintTint PhysicalFunction nes-physical-operators EverGeTintTintPhysicalFunction.cpp) +add_plugin(EverGtTintTint PhysicalFunction nes-physical-operators EverGtTintTintPhysicalFunction.cpp) +add_plugin(EverLeTintTint PhysicalFunction nes-physical-operators EverLeTintTintPhysicalFunction.cpp) +add_plugin(EverLtTintTint PhysicalFunction nes-physical-operators EverLtTintTintPhysicalFunction.cpp) +add_plugin(EverNeTintTint PhysicalFunction nes-physical-operators EverNeTintTintPhysicalFunction.cpp) endif() diff --git a/nes-physical-operators/src/Functions/Meos/EverEqTintTintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverEqTintTintPhysicalFunction.cpp new file mode 100644 index 0000000000..caa3038238 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverEqTintTintPhysicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +EverEqTintTintPhysicalFunction::EverEqTintTintPhysicalFunction(PhysicalFunction value1Function, + PhysicalFunction value2Function, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(value1Function)); + parameterFunctions.push_back(std::move(value2Function)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal EverEqTintTintPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value1 = parameterValues[0].cast>(); + auto value2 = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double v1, double v2, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt1 = fmt::format("{}@{}", static_cast(v1), ts_str); + std::string wkt2 = fmt::format("{}@{}", static_cast(v2), ts_str); + Temporal* temp1 = tint_in(wkt1.c_str()); + if (!temp1) return 0.0; + Temporal* temp2 = tint_in(wkt2.c_str()); + if (!temp2) { free(temp1); return 0.0; } + int r = ever_eq_tint_tint(temp1, temp2); + free(temp1); + free(temp2); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + value1, value2, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverEqTintTintPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "EverEqTintTintPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return EverEqTintTintPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverGeTintTintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverGeTintTintPhysicalFunction.cpp new file mode 100644 index 0000000000..7a82536015 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverGeTintTintPhysicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +EverGeTintTintPhysicalFunction::EverGeTintTintPhysicalFunction(PhysicalFunction value1Function, + PhysicalFunction value2Function, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(value1Function)); + parameterFunctions.push_back(std::move(value2Function)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal EverGeTintTintPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value1 = parameterValues[0].cast>(); + auto value2 = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double v1, double v2, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt1 = fmt::format("{}@{}", static_cast(v1), ts_str); + std::string wkt2 = fmt::format("{}@{}", static_cast(v2), ts_str); + Temporal* temp1 = tint_in(wkt1.c_str()); + if (!temp1) return 0.0; + Temporal* temp2 = tint_in(wkt2.c_str()); + if (!temp2) { free(temp1); return 0.0; } + int r = ever_ge_tint_tint(temp1, temp2); + free(temp1); + free(temp2); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + value1, value2, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverGeTintTintPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "EverGeTintTintPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return EverGeTintTintPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverGtTintTintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverGtTintTintPhysicalFunction.cpp new file mode 100644 index 0000000000..b5a76c9e8d --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverGtTintTintPhysicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +EverGtTintTintPhysicalFunction::EverGtTintTintPhysicalFunction(PhysicalFunction value1Function, + PhysicalFunction value2Function, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(value1Function)); + parameterFunctions.push_back(std::move(value2Function)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal EverGtTintTintPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value1 = parameterValues[0].cast>(); + auto value2 = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double v1, double v2, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt1 = fmt::format("{}@{}", static_cast(v1), ts_str); + std::string wkt2 = fmt::format("{}@{}", static_cast(v2), ts_str); + Temporal* temp1 = tint_in(wkt1.c_str()); + if (!temp1) return 0.0; + Temporal* temp2 = tint_in(wkt2.c_str()); + if (!temp2) { free(temp1); return 0.0; } + int r = ever_gt_tint_tint(temp1, temp2); + free(temp1); + free(temp2); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + value1, value2, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverGtTintTintPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "EverGtTintTintPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return EverGtTintTintPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverLeTintTintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverLeTintTintPhysicalFunction.cpp new file mode 100644 index 0000000000..26f58ed26b --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverLeTintTintPhysicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +EverLeTintTintPhysicalFunction::EverLeTintTintPhysicalFunction(PhysicalFunction value1Function, + PhysicalFunction value2Function, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(value1Function)); + parameterFunctions.push_back(std::move(value2Function)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal EverLeTintTintPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value1 = parameterValues[0].cast>(); + auto value2 = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double v1, double v2, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt1 = fmt::format("{}@{}", static_cast(v1), ts_str); + std::string wkt2 = fmt::format("{}@{}", static_cast(v2), ts_str); + Temporal* temp1 = tint_in(wkt1.c_str()); + if (!temp1) return 0.0; + Temporal* temp2 = tint_in(wkt2.c_str()); + if (!temp2) { free(temp1); return 0.0; } + int r = ever_le_tint_tint(temp1, temp2); + free(temp1); + free(temp2); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + value1, value2, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverLeTintTintPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "EverLeTintTintPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return EverLeTintTintPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverLtTintTintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverLtTintTintPhysicalFunction.cpp new file mode 100644 index 0000000000..584074e9f2 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverLtTintTintPhysicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +EverLtTintTintPhysicalFunction::EverLtTintTintPhysicalFunction(PhysicalFunction value1Function, + PhysicalFunction value2Function, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(value1Function)); + parameterFunctions.push_back(std::move(value2Function)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal EverLtTintTintPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value1 = parameterValues[0].cast>(); + auto value2 = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double v1, double v2, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt1 = fmt::format("{}@{}", static_cast(v1), ts_str); + std::string wkt2 = fmt::format("{}@{}", static_cast(v2), ts_str); + Temporal* temp1 = tint_in(wkt1.c_str()); + if (!temp1) return 0.0; + Temporal* temp2 = tint_in(wkt2.c_str()); + if (!temp2) { free(temp1); return 0.0; } + int r = ever_lt_tint_tint(temp1, temp2); + free(temp1); + free(temp2); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + value1, value2, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverLtTintTintPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "EverLtTintTintPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return EverLtTintTintPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverNeTintTintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverNeTintTintPhysicalFunction.cpp new file mode 100644 index 0000000000..168fc072c8 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverNeTintTintPhysicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +EverNeTintTintPhysicalFunction::EverNeTintTintPhysicalFunction(PhysicalFunction value1Function, + PhysicalFunction value2Function, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(value1Function)); + parameterFunctions.push_back(std::move(value2Function)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal EverNeTintTintPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value1 = parameterValues[0].cast>(); + auto value2 = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double v1, double v2, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt1 = fmt::format("{}@{}", static_cast(v1), ts_str); + std::string wkt2 = fmt::format("{}@{}", static_cast(v2), ts_str); + Temporal* temp1 = tint_in(wkt1.c_str()); + if (!temp1) return 0.0; + Temporal* temp2 = tint_in(wkt2.c_str()); + if (!temp2) { free(temp1); return 0.0; } + int r = ever_ne_tint_tint(temp1, temp2); + free(temp1); + free(temp2); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + value1, value2, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverNeTintTintPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "EverNeTintTintPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return EverNeTintTintPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-sql-parser/AntlrSQL.g4 b/nes-sql-parser/AntlrSQL.g4 index 6eb4800e5c..b6b2681172 100644 --- a/nes-sql-parser/AntlrSQL.g4 +++ b/nes-sql-parser/AntlrSQL.g4 @@ -295,7 +295,7 @@ timeUnit: MS timestampParameter: name=identifier; -functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | EDWITHIN_TGEO_GEO | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS; +functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | EDWITHIN_TGEO_GEO | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS; sinkClause: INTO sink (',' sink)*; @@ -535,6 +535,12 @@ EVER_GT_TINT_INT: 'EVER_GT_TINT_INT' | 'ever_gt_tint_int'; EVER_LE_TINT_INT: 'EVER_LE_TINT_INT' | 'ever_le_tint_int'; EVER_LT_TINT_INT: 'EVER_LT_TINT_INT' | 'ever_lt_tint_int'; EVER_NE_TINT_INT: 'EVER_NE_TINT_INT' | 'ever_ne_tint_int'; +EVER_EQ_TINT_TINT: 'EVER_EQ_TINT_TINT' | 'ever_eq_tint_tint'; +EVER_GE_TINT_TINT: 'EVER_GE_TINT_TINT' | 'ever_ge_tint_tint'; +EVER_GT_TINT_TINT: 'EVER_GT_TINT_TINT' | 'ever_gt_tint_tint'; +EVER_LE_TINT_TINT: 'EVER_LE_TINT_TINT' | 'ever_le_tint_tint'; +EVER_LT_TINT_TINT: 'EVER_LT_TINT_TINT' | 'ever_lt_tint_tint'; +EVER_NE_TINT_TINT: 'EVER_NE_TINT_TINT' | 'ever_ne_tint_tint'; TGEO_AT_STBOX: 'TGEO_AT_STBOX' | 'tgeo_at_stbox'; ADD_BIGINT_TBIGINT: 'ADD_BIGINT_TBIGINT' | 'add_bigint_tbigint'; ADD_FLOAT_TFLOAT: 'ADD_FLOAT_TFLOAT' | 'add_float_tfloat'; diff --git a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp index 4055e8a63e..26d9aebd29 100644 --- a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp +++ b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp @@ -163,6 +163,12 @@ #include #include #include +#include +#include +#include +#include +#include +#include #include #include #include @@ -3658,6 +3664,180 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont } break; /* END CODEGEN PARSER GLUE: EVER_NE_TINT_INT */ + /* BEGIN CODEGEN PARSER GLUE: EVER_EQ_TINT_TINT */ + case AntlrSQLLexer::EVER_EQ_TINT_TINT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("EVER_EQ_TINT_TINT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverEqTintTintLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: EVER_EQ_TINT_TINT */ + /* BEGIN CODEGEN PARSER GLUE: EVER_GE_TINT_TINT */ + case AntlrSQLLexer::EVER_GE_TINT_TINT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("EVER_GE_TINT_TINT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverGeTintTintLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: EVER_GE_TINT_TINT */ + /* BEGIN CODEGEN PARSER GLUE: EVER_GT_TINT_TINT */ + case AntlrSQLLexer::EVER_GT_TINT_TINT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("EVER_GT_TINT_TINT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverGtTintTintLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: EVER_GT_TINT_TINT */ + /* BEGIN CODEGEN PARSER GLUE: EVER_LE_TINT_TINT */ + case AntlrSQLLexer::EVER_LE_TINT_TINT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("EVER_LE_TINT_TINT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverLeTintTintLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: EVER_LE_TINT_TINT */ + /* BEGIN CODEGEN PARSER GLUE: EVER_LT_TINT_TINT */ + case AntlrSQLLexer::EVER_LT_TINT_TINT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("EVER_LT_TINT_TINT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverLtTintTintLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: EVER_LT_TINT_TINT */ + /* BEGIN CODEGEN PARSER GLUE: EVER_NE_TINT_TINT */ + case AntlrSQLLexer::EVER_NE_TINT_TINT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("EVER_NE_TINT_TINT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverNeTintTintLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: EVER_NE_TINT_TINT */ /* BEGIN CODEGEN PARSER GLUE: ALWAYS_EQ_TINT_INT */ case AntlrSQLLexer::ALWAYS_EQ_TINT_INT: { From e15dee48771dbd534abafd56596ebb4aa6ec7ba7 Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Fri, 12 Jun 2026 09:53:49 +0200 Subject: [PATCH 28/96] feat(meos): add ALWAYS_EQ/GE/GT/LE/LT/NE_TINT_TINT NES operators (W70) --- .../Meos/AlwaysEqTintTintLogicalFunction.hpp | 54 ++++++ .../Meos/AlwaysGeTintTintLogicalFunction.hpp | 54 ++++++ .../Meos/AlwaysGtTintTintLogicalFunction.hpp | 54 ++++++ .../Meos/AlwaysLeTintTintLogicalFunction.hpp | 54 ++++++ .../Meos/AlwaysLtTintTintLogicalFunction.hpp | 54 ++++++ .../Meos/AlwaysNeTintTintLogicalFunction.hpp | 54 ++++++ .../Meos/AlwaysEqTintTintLogicalFunction.cpp | 105 ++++++++++ .../Meos/AlwaysGeTintTintLogicalFunction.cpp | 105 ++++++++++ .../Meos/AlwaysGtTintTintLogicalFunction.cpp | 105 ++++++++++ .../Meos/AlwaysLeTintTintLogicalFunction.cpp | 105 ++++++++++ .../Meos/AlwaysLtTintTintLogicalFunction.cpp | 105 ++++++++++ .../Meos/AlwaysNeTintTintLogicalFunction.cpp | 105 ++++++++++ .../src/Functions/Meos/CMakeLists.txt | 6 + .../Meos/AlwaysEqTintTintPhysicalFunction.hpp | 43 +++++ .../Meos/AlwaysGeTintTintPhysicalFunction.hpp | 43 +++++ .../Meos/AlwaysGtTintTintPhysicalFunction.hpp | 43 +++++ .../Meos/AlwaysLeTintTintPhysicalFunction.hpp | 43 +++++ .../Meos/AlwaysLtTintTintPhysicalFunction.hpp | 43 +++++ .../Meos/AlwaysNeTintTintPhysicalFunction.hpp | 43 +++++ .../Meos/AlwaysEqTintTintPhysicalFunction.cpp | 93 +++++++++ .../Meos/AlwaysGeTintTintPhysicalFunction.cpp | 93 +++++++++ .../Meos/AlwaysGtTintTintPhysicalFunction.cpp | 93 +++++++++ .../Meos/AlwaysLeTintTintPhysicalFunction.cpp | 93 +++++++++ .../Meos/AlwaysLtTintTintPhysicalFunction.cpp | 93 +++++++++ .../Meos/AlwaysNeTintTintPhysicalFunction.cpp | 93 +++++++++ .../src/Functions/Meos/CMakeLists.txt | 6 + nes-sql-parser/AntlrSQL.g4 | 8 +- .../src/AntlrSQLQueryPlanCreator.cpp | 180 ++++++++++++++++++ 28 files changed, 1969 insertions(+), 1 deletion(-) create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysEqTintTintLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysGeTintTintLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysGtTintTintLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysLeTintTintLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysLtTintTintLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysNeTintTintLogicalFunction.hpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysEqTintTintLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysGeTintTintLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysGtTintTintLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysLeTintTintLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysLtTintTintLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysNeTintTintLogicalFunction.cpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysEqTintTintPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysGeTintTintPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysGtTintTintPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysLeTintTintPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysLtTintTintPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysNeTintTintPhysicalFunction.hpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysEqTintTintPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysGeTintTintPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysGtTintTintPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysLeTintTintPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysLtTintTintPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysNeTintTintPhysicalFunction.cpp diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysEqTintTintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysEqTintTintLogicalFunction.hpp new file mode 100644 index 0000000000..2e44a89f3a --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysEqTintTintLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event always_eq_tint_tfloat: tests if two single-instant tint values are always equal. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `always_eq_tint_tfloat`. Takes (value1:FLOAT64, value2:FLOAT64, ts:UINT64), + * constructs two single-instant temporals, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class AlwaysEqTintTfloatLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysEqTintTfloat"; + + AlwaysEqTintTfloatLogicalFunction(LogicalFunction value1, + LogicalFunction value2, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysGeTintTintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysGeTintTintLogicalFunction.hpp new file mode 100644 index 0000000000..feb35315bc --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysGeTintTintLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event always_ge_tint_tfloat: tests if two single-instant tint values are always greater or equal. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `always_ge_tint_tfloat`. Takes (value1:FLOAT64, value2:FLOAT64, ts:UINT64), + * constructs two single-instant temporals, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class AlwaysGeTintTfloatLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysGeTintTfloat"; + + AlwaysGeTintTfloatLogicalFunction(LogicalFunction value1, + LogicalFunction value2, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysGtTintTintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysGtTintTintLogicalFunction.hpp new file mode 100644 index 0000000000..51e6feaca9 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysGtTintTintLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event always_gt_tint_tfloat: tests if two single-instant tint values are always greater than. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `always_gt_tint_tfloat`. Takes (value1:FLOAT64, value2:FLOAT64, ts:UINT64), + * constructs two single-instant temporals, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class AlwaysGtTintTfloatLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysGtTintTfloat"; + + AlwaysGtTintTfloatLogicalFunction(LogicalFunction value1, + LogicalFunction value2, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysLeTintTintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysLeTintTintLogicalFunction.hpp new file mode 100644 index 0000000000..337148ee0e --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysLeTintTintLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event always_le_tint_tfloat: tests if two single-instant tint values are always less or equal. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `always_le_tint_tfloat`. Takes (value1:FLOAT64, value2:FLOAT64, ts:UINT64), + * constructs two single-instant temporals, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class AlwaysLeTintTfloatLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysLeTintTfloat"; + + AlwaysLeTintTfloatLogicalFunction(LogicalFunction value1, + LogicalFunction value2, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysLtTintTintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysLtTintTintLogicalFunction.hpp new file mode 100644 index 0000000000..0a9b5343c1 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysLtTintTintLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event always_lt_tint_tfloat: tests if two single-instant tint values are always less than. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `always_lt_tint_tfloat`. Takes (value1:FLOAT64, value2:FLOAT64, ts:UINT64), + * constructs two single-instant temporals, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class AlwaysLtTintTfloatLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysLtTintTfloat"; + + AlwaysLtTintTfloatLogicalFunction(LogicalFunction value1, + LogicalFunction value2, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysNeTintTintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysNeTintTintLogicalFunction.hpp new file mode 100644 index 0000000000..73341c243e --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysNeTintTintLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event always_ne_tint_tfloat: tests if two single-instant tint values are always not equal. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `always_ne_tint_tfloat`. Takes (value1:FLOAT64, value2:FLOAT64, ts:UINT64), + * constructs two single-instant temporals, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class AlwaysNeTintTfloatLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysNeTintTfloat"; + + AlwaysNeTintTfloatLogicalFunction(LogicalFunction value1, + LogicalFunction value2, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysEqTintTintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysEqTintTintLogicalFunction.cpp new file mode 100644 index 0000000000..4cdcffdd64 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysEqTintTintLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AlwaysEqTintTfloatLogicalFunction::AlwaysEqTintTfloatLogicalFunction(LogicalFunction value1, + LogicalFunction value2, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value1)); + parameters.push_back(std::move(value2)); + parameters.push_back(std::move(ts)); +} + +DataType AlwaysEqTintTfloatLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysEqTintTfloatLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AlwaysEqTintTfloatLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysEqTintTfloatLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "AlwaysEqTintTfloatLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AlwaysEqTintTfloatLogicalFunction::getType() const { return NAME; } + +bool AlwaysEqTintTfloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AlwaysEqTintTfloatLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction AlwaysEqTintTfloatLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction AlwaysEqTintTfloatLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysEqTintTfloatLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "AlwaysEqTintTfloatLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return AlwaysEqTintTfloatLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysGeTintTintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysGeTintTintLogicalFunction.cpp new file mode 100644 index 0000000000..fb4f6f2a8e --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysGeTintTintLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AlwaysGeTintTfloatLogicalFunction::AlwaysGeTintTfloatLogicalFunction(LogicalFunction value1, + LogicalFunction value2, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value1)); + parameters.push_back(std::move(value2)); + parameters.push_back(std::move(ts)); +} + +DataType AlwaysGeTintTfloatLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysGeTintTfloatLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AlwaysGeTintTfloatLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysGeTintTfloatLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "AlwaysGeTintTfloatLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AlwaysGeTintTfloatLogicalFunction::getType() const { return NAME; } + +bool AlwaysGeTintTfloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AlwaysGeTintTfloatLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction AlwaysGeTintTfloatLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction AlwaysGeTintTfloatLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysGeTintTfloatLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "AlwaysGeTintTfloatLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return AlwaysGeTintTfloatLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysGtTintTintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysGtTintTintLogicalFunction.cpp new file mode 100644 index 0000000000..09c753625b --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysGtTintTintLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AlwaysGtTintTfloatLogicalFunction::AlwaysGtTintTfloatLogicalFunction(LogicalFunction value1, + LogicalFunction value2, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value1)); + parameters.push_back(std::move(value2)); + parameters.push_back(std::move(ts)); +} + +DataType AlwaysGtTintTfloatLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysGtTintTfloatLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AlwaysGtTintTfloatLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysGtTintTfloatLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "AlwaysGtTintTfloatLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AlwaysGtTintTfloatLogicalFunction::getType() const { return NAME; } + +bool AlwaysGtTintTfloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AlwaysGtTintTfloatLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction AlwaysGtTintTfloatLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction AlwaysGtTintTfloatLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysGtTintTfloatLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "AlwaysGtTintTfloatLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return AlwaysGtTintTfloatLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysLeTintTintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysLeTintTintLogicalFunction.cpp new file mode 100644 index 0000000000..356758b0cc --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysLeTintTintLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AlwaysLeTintTfloatLogicalFunction::AlwaysLeTintTfloatLogicalFunction(LogicalFunction value1, + LogicalFunction value2, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value1)); + parameters.push_back(std::move(value2)); + parameters.push_back(std::move(ts)); +} + +DataType AlwaysLeTintTfloatLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysLeTintTfloatLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AlwaysLeTintTfloatLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysLeTintTfloatLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "AlwaysLeTintTfloatLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AlwaysLeTintTfloatLogicalFunction::getType() const { return NAME; } + +bool AlwaysLeTintTfloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AlwaysLeTintTfloatLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction AlwaysLeTintTfloatLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction AlwaysLeTintTfloatLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysLeTintTfloatLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "AlwaysLeTintTfloatLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return AlwaysLeTintTfloatLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysLtTintTintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysLtTintTintLogicalFunction.cpp new file mode 100644 index 0000000000..e88014e58e --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysLtTintTintLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AlwaysLtTintTfloatLogicalFunction::AlwaysLtTintTfloatLogicalFunction(LogicalFunction value1, + LogicalFunction value2, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value1)); + parameters.push_back(std::move(value2)); + parameters.push_back(std::move(ts)); +} + +DataType AlwaysLtTintTfloatLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysLtTintTfloatLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AlwaysLtTintTfloatLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysLtTintTfloatLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "AlwaysLtTintTfloatLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AlwaysLtTintTfloatLogicalFunction::getType() const { return NAME; } + +bool AlwaysLtTintTfloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AlwaysLtTintTfloatLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction AlwaysLtTintTfloatLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction AlwaysLtTintTfloatLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysLtTintTfloatLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "AlwaysLtTintTfloatLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return AlwaysLtTintTfloatLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysNeTintTintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysNeTintTintLogicalFunction.cpp new file mode 100644 index 0000000000..83bcedc991 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysNeTintTintLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AlwaysNeTintTfloatLogicalFunction::AlwaysNeTintTfloatLogicalFunction(LogicalFunction value1, + LogicalFunction value2, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value1)); + parameters.push_back(std::move(value2)); + parameters.push_back(std::move(ts)); +} + +DataType AlwaysNeTintTfloatLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysNeTintTfloatLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AlwaysNeTintTfloatLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysNeTintTfloatLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "AlwaysNeTintTfloatLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AlwaysNeTintTfloatLogicalFunction::getType() const { return NAME; } + +bool AlwaysNeTintTfloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AlwaysNeTintTfloatLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction AlwaysNeTintTfloatLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction AlwaysNeTintTfloatLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysNeTintTfloatLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "AlwaysNeTintTfloatLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return AlwaysNeTintTfloatLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt index 0159b5ecb0..93056d8fe8 100644 --- a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt @@ -130,3 +130,9 @@ add_plugin(EverGtTintTint LogicalFunction nes-logical-operators EverGtTintTintLo add_plugin(EverLeTintTint LogicalFunction nes-logical-operators EverLeTintTintLogicalFunction.cpp) add_plugin(EverLtTintTint LogicalFunction nes-logical-operators EverLtTintTintLogicalFunction.cpp) add_plugin(EverNeTintTint LogicalFunction nes-logical-operators EverNeTintTintLogicalFunction.cpp) +add_plugin(AlwaysEqTintTint LogicalFunction nes-logical-operators AlwaysEqTintTintLogicalFunction.cpp) +add_plugin(AlwaysGeTintTint LogicalFunction nes-logical-operators AlwaysGeTintTintLogicalFunction.cpp) +add_plugin(AlwaysGtTintTint LogicalFunction nes-logical-operators AlwaysGtTintTintLogicalFunction.cpp) +add_plugin(AlwaysLeTintTint LogicalFunction nes-logical-operators AlwaysLeTintTintLogicalFunction.cpp) +add_plugin(AlwaysLtTintTint LogicalFunction nes-logical-operators AlwaysLtTintTintLogicalFunction.cpp) +add_plugin(AlwaysNeTintTint LogicalFunction nes-logical-operators AlwaysNeTintTintLogicalFunction.cpp) diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysEqTintTintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysEqTintTintPhysicalFunction.hpp new file mode 100644 index 0000000000..de9dea6e9a --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysEqTintTintPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `always_eq_tint_tfloat`. + * + * Per-event always_eq_tint_tfloat: tests if two single-instant tfloat values are ever equal. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class AlwaysEqTintTfloatPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysEqTintTfloatPhysicalFunction(PhysicalFunction value1Function, + PhysicalFunction value2Function, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysGeTintTintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysGeTintTintPhysicalFunction.hpp new file mode 100644 index 0000000000..7ec07a1a5e --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysGeTintTintPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `always_ge_tint_tfloat`. + * + * Per-event always_ge_tint_tfloat: tests if two single-instant tfloat values are ever greater or equal. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class AlwaysGeTintTfloatPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysGeTintTfloatPhysicalFunction(PhysicalFunction value1Function, + PhysicalFunction value2Function, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysGtTintTintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysGtTintTintPhysicalFunction.hpp new file mode 100644 index 0000000000..ee47873039 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysGtTintTintPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `always_gt_tint_tfloat`. + * + * Per-event always_gt_tint_tfloat: tests if two single-instant tfloat values are ever greater than. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class AlwaysGtTintTfloatPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysGtTintTfloatPhysicalFunction(PhysicalFunction value1Function, + PhysicalFunction value2Function, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysLeTintTintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysLeTintTintPhysicalFunction.hpp new file mode 100644 index 0000000000..38e8137ff1 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysLeTintTintPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `always_le_tint_tfloat`. + * + * Per-event always_le_tint_tfloat: tests if two single-instant tfloat values are ever less or equal. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class AlwaysLeTintTfloatPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysLeTintTfloatPhysicalFunction(PhysicalFunction value1Function, + PhysicalFunction value2Function, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysLtTintTintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysLtTintTintPhysicalFunction.hpp new file mode 100644 index 0000000000..ae9d97fd84 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysLtTintTintPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `always_lt_tint_tfloat`. + * + * Per-event always_lt_tint_tfloat: tests if two single-instant tfloat values are ever less than. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class AlwaysLtTintTfloatPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysLtTintTfloatPhysicalFunction(PhysicalFunction value1Function, + PhysicalFunction value2Function, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysNeTintTintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysNeTintTintPhysicalFunction.hpp new file mode 100644 index 0000000000..a2822cb82c --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysNeTintTintPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `always_ne_tint_tfloat`. + * + * Per-event always_ne_tint_tfloat: tests if two single-instant tfloat values are ever not equal. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class AlwaysNeTintTfloatPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysNeTintTfloatPhysicalFunction(PhysicalFunction value1Function, + PhysicalFunction value2Function, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysEqTintTintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysEqTintTintPhysicalFunction.cpp new file mode 100644 index 0000000000..e1c238acdd --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysEqTintTintPhysicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +AlwaysEqTintTintPhysicalFunction::AlwaysEqTintTintPhysicalFunction(PhysicalFunction value1Function, + PhysicalFunction value2Function, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(value1Function)); + parameterFunctions.push_back(std::move(value2Function)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal AlwaysEqTintTintPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value1 = parameterValues[0].cast>(); + auto value2 = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double v1, double v2, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt1 = fmt::format("{}@{}", static_cast(v1), ts_str); + std::string wkt2 = fmt::format("{}@{}", static_cast(v2), ts_str); + Temporal* temp1 = tint_in(wkt1.c_str()); + if (!temp1) return 0.0; + Temporal* temp2 = tint_in(wkt2.c_str()); + if (!temp2) { free(temp1); return 0.0; } + int r = always_eq_tint_tint(temp1, temp2); + free(temp1); + free(temp2); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + value1, value2, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysEqTintTintPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "AlwaysEqTintTintPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return AlwaysEqTintTintPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysGeTintTintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysGeTintTintPhysicalFunction.cpp new file mode 100644 index 0000000000..13abe21605 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysGeTintTintPhysicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +AlwaysGeTintTintPhysicalFunction::AlwaysGeTintTintPhysicalFunction(PhysicalFunction value1Function, + PhysicalFunction value2Function, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(value1Function)); + parameterFunctions.push_back(std::move(value2Function)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal AlwaysGeTintTintPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value1 = parameterValues[0].cast>(); + auto value2 = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double v1, double v2, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt1 = fmt::format("{}@{}", static_cast(v1), ts_str); + std::string wkt2 = fmt::format("{}@{}", static_cast(v2), ts_str); + Temporal* temp1 = tint_in(wkt1.c_str()); + if (!temp1) return 0.0; + Temporal* temp2 = tint_in(wkt2.c_str()); + if (!temp2) { free(temp1); return 0.0; } + int r = always_ge_tint_tint(temp1, temp2); + free(temp1); + free(temp2); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + value1, value2, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysGeTintTintPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "AlwaysGeTintTintPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return AlwaysGeTintTintPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysGtTintTintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysGtTintTintPhysicalFunction.cpp new file mode 100644 index 0000000000..e9f1824a0c --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysGtTintTintPhysicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +AlwaysGtTintTintPhysicalFunction::AlwaysGtTintTintPhysicalFunction(PhysicalFunction value1Function, + PhysicalFunction value2Function, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(value1Function)); + parameterFunctions.push_back(std::move(value2Function)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal AlwaysGtTintTintPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value1 = parameterValues[0].cast>(); + auto value2 = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double v1, double v2, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt1 = fmt::format("{}@{}", static_cast(v1), ts_str); + std::string wkt2 = fmt::format("{}@{}", static_cast(v2), ts_str); + Temporal* temp1 = tint_in(wkt1.c_str()); + if (!temp1) return 0.0; + Temporal* temp2 = tint_in(wkt2.c_str()); + if (!temp2) { free(temp1); return 0.0; } + int r = always_gt_tint_tint(temp1, temp2); + free(temp1); + free(temp2); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + value1, value2, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysGtTintTintPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "AlwaysGtTintTintPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return AlwaysGtTintTintPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysLeTintTintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysLeTintTintPhysicalFunction.cpp new file mode 100644 index 0000000000..974b4caaca --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysLeTintTintPhysicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +AlwaysLeTintTintPhysicalFunction::AlwaysLeTintTintPhysicalFunction(PhysicalFunction value1Function, + PhysicalFunction value2Function, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(value1Function)); + parameterFunctions.push_back(std::move(value2Function)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal AlwaysLeTintTintPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value1 = parameterValues[0].cast>(); + auto value2 = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double v1, double v2, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt1 = fmt::format("{}@{}", static_cast(v1), ts_str); + std::string wkt2 = fmt::format("{}@{}", static_cast(v2), ts_str); + Temporal* temp1 = tint_in(wkt1.c_str()); + if (!temp1) return 0.0; + Temporal* temp2 = tint_in(wkt2.c_str()); + if (!temp2) { free(temp1); return 0.0; } + int r = always_le_tint_tint(temp1, temp2); + free(temp1); + free(temp2); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + value1, value2, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysLeTintTintPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "AlwaysLeTintTintPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return AlwaysLeTintTintPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysLtTintTintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysLtTintTintPhysicalFunction.cpp new file mode 100644 index 0000000000..5649cde140 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysLtTintTintPhysicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +AlwaysLtTintTintPhysicalFunction::AlwaysLtTintTintPhysicalFunction(PhysicalFunction value1Function, + PhysicalFunction value2Function, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(value1Function)); + parameterFunctions.push_back(std::move(value2Function)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal AlwaysLtTintTintPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value1 = parameterValues[0].cast>(); + auto value2 = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double v1, double v2, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt1 = fmt::format("{}@{}", static_cast(v1), ts_str); + std::string wkt2 = fmt::format("{}@{}", static_cast(v2), ts_str); + Temporal* temp1 = tint_in(wkt1.c_str()); + if (!temp1) return 0.0; + Temporal* temp2 = tint_in(wkt2.c_str()); + if (!temp2) { free(temp1); return 0.0; } + int r = always_lt_tint_tint(temp1, temp2); + free(temp1); + free(temp2); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + value1, value2, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysLtTintTintPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "AlwaysLtTintTintPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return AlwaysLtTintTintPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysNeTintTintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysNeTintTintPhysicalFunction.cpp new file mode 100644 index 0000000000..8ca2ce0681 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysNeTintTintPhysicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +AlwaysNeTintTintPhysicalFunction::AlwaysNeTintTintPhysicalFunction(PhysicalFunction value1Function, + PhysicalFunction value2Function, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(value1Function)); + parameterFunctions.push_back(std::move(value2Function)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal AlwaysNeTintTintPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value1 = parameterValues[0].cast>(); + auto value2 = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double v1, double v2, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt1 = fmt::format("{}@{}", static_cast(v1), ts_str); + std::string wkt2 = fmt::format("{}@{}", static_cast(v2), ts_str); + Temporal* temp1 = tint_in(wkt1.c_str()); + if (!temp1) return 0.0; + Temporal* temp2 = tint_in(wkt2.c_str()); + if (!temp2) { free(temp1); return 0.0; } + int r = always_ne_tint_tint(temp1, temp2); + free(temp1); + free(temp2); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + value1, value2, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysNeTintTintPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "AlwaysNeTintTintPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return AlwaysNeTintTintPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt index fe43ef7386..74039cfadc 100644 --- a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt @@ -129,4 +129,10 @@ add_plugin(EverGtTintTint PhysicalFunction nes-physical-operators EverGtTintTint add_plugin(EverLeTintTint PhysicalFunction nes-physical-operators EverLeTintTintPhysicalFunction.cpp) add_plugin(EverLtTintTint PhysicalFunction nes-physical-operators EverLtTintTintPhysicalFunction.cpp) add_plugin(EverNeTintTint PhysicalFunction nes-physical-operators EverNeTintTintPhysicalFunction.cpp) +add_plugin(AlwaysEqTintTint PhysicalFunction nes-physical-operators AlwaysEqTintTintPhysicalFunction.cpp) +add_plugin(AlwaysGeTintTint PhysicalFunction nes-physical-operators AlwaysGeTintTintPhysicalFunction.cpp) +add_plugin(AlwaysGtTintTint PhysicalFunction nes-physical-operators AlwaysGtTintTintPhysicalFunction.cpp) +add_plugin(AlwaysLeTintTint PhysicalFunction nes-physical-operators AlwaysLeTintTintPhysicalFunction.cpp) +add_plugin(AlwaysLtTintTint PhysicalFunction nes-physical-operators AlwaysLtTintTintPhysicalFunction.cpp) +add_plugin(AlwaysNeTintTint PhysicalFunction nes-physical-operators AlwaysNeTintTintPhysicalFunction.cpp) endif() diff --git a/nes-sql-parser/AntlrSQL.g4 b/nes-sql-parser/AntlrSQL.g4 index b6b2681172..377064f091 100644 --- a/nes-sql-parser/AntlrSQL.g4 +++ b/nes-sql-parser/AntlrSQL.g4 @@ -295,7 +295,7 @@ timeUnit: MS timestampParameter: name=identifier; -functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | EDWITHIN_TGEO_GEO | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS; +functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS; sinkClause: INTO sink (',' sink)*; @@ -510,6 +510,12 @@ ALWAYS_GT_TINT_INT: 'ALWAYS_GT_TINT_INT' | 'always_gt_tint_int'; ALWAYS_LE_TINT_INT: 'ALWAYS_LE_TINT_INT' | 'always_le_tint_int'; ALWAYS_LT_TINT_INT: 'ALWAYS_LT_TINT_INT' | 'always_lt_tint_int'; ALWAYS_NE_TINT_INT: 'ALWAYS_NE_TINT_INT' | 'always_ne_tint_int'; +ALWAYS_EQ_TINT_TINT: 'ALWAYS_EQ_TINT_TINT' | 'always_eq_tint_tint'; +ALWAYS_GE_TINT_TINT: 'ALWAYS_GE_TINT_TINT' | 'always_ge_tint_tint'; +ALWAYS_GT_TINT_TINT: 'ALWAYS_GT_TINT_TINT' | 'always_gt_tint_tint'; +ALWAYS_LE_TINT_TINT: 'ALWAYS_LE_TINT_TINT' | 'always_le_tint_tint'; +ALWAYS_LT_TINT_TINT: 'ALWAYS_LT_TINT_TINT' | 'always_lt_tint_tint'; +ALWAYS_NE_TINT_TINT: 'ALWAYS_NE_TINT_TINT' | 'always_ne_tint_tint'; EDWITHIN_TGEO_GEO: 'EDWITHIN_TGEO_GEO' | 'edwithin_tgeo_geo'; EVER_EQ_TBIGINT_BIGINT: 'EVER_EQ_TBIGINT_BIGINT' | 'ever_eq_tbigint_bigint'; EVER_GE_TBIGINT_BIGINT: 'EVER_GE_TBIGINT_BIGINT' | 'ever_ge_tbigint_bigint'; diff --git a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp index 26d9aebd29..88b06371e1 100644 --- a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp +++ b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp @@ -157,6 +157,12 @@ #include #include #include +#include +#include +#include +#include +#include +#include #include #include #include @@ -4012,6 +4018,180 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont } break; /* END CODEGEN PARSER GLUE: ALWAYS_NE_TINT_INT */ + /* BEGIN CODEGEN PARSER GLUE: ALWAYS_EQ_TINT_TINT */ + case AntlrSQLLexer::ALWAYS_EQ_TINT_TINT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("ALWAYS_EQ_TINT_TINT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AlwaysEqTintTintLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: ALWAYS_EQ_TINT_TINT */ + /* BEGIN CODEGEN PARSER GLUE: ALWAYS_GE_TINT_TINT */ + case AntlrSQLLexer::ALWAYS_GE_TINT_TINT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("ALWAYS_GE_TINT_TINT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AlwaysGeTintTintLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: ALWAYS_GE_TINT_TINT */ + /* BEGIN CODEGEN PARSER GLUE: ALWAYS_GT_TINT_TINT */ + case AntlrSQLLexer::ALWAYS_GT_TINT_TINT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("ALWAYS_GT_TINT_TINT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AlwaysGtTintTintLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: ALWAYS_GT_TINT_TINT */ + /* BEGIN CODEGEN PARSER GLUE: ALWAYS_LE_TINT_TINT */ + case AntlrSQLLexer::ALWAYS_LE_TINT_TINT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("ALWAYS_LE_TINT_TINT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AlwaysLeTintTintLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: ALWAYS_LE_TINT_TINT */ + /* BEGIN CODEGEN PARSER GLUE: ALWAYS_LT_TINT_TINT */ + case AntlrSQLLexer::ALWAYS_LT_TINT_TINT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("ALWAYS_LT_TINT_TINT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AlwaysLtTintTintLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: ALWAYS_LT_TINT_TINT */ + /* BEGIN CODEGEN PARSER GLUE: ALWAYS_NE_TINT_TINT */ + case AntlrSQLLexer::ALWAYS_NE_TINT_TINT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("ALWAYS_NE_TINT_TINT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AlwaysNeTintTintLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: ALWAYS_NE_TINT_TINT */ /* BEGIN CODEGEN PARSER GLUE: ALWAYS_EQ_TBIGINT_BIGINT */ case AntlrSQLLexer::ALWAYS_EQ_TBIGINT_BIGINT: { From 93e8c255e0fc4f93e297dd56dd76aa4276500b12 Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Fri, 12 Jun 2026 09:55:19 +0200 Subject: [PATCH 29/96] feat(meos): add EVER_EQ/GE/GT/LE/LT/NE_TBIGINT_TBIGINT NES operators (W71) --- .../EverEqTbigintTbigintLogicalFunction.hpp | 54 ++++++ .../EverGeTbigintTbigintLogicalFunction.hpp | 54 ++++++ .../EverGtTbigintTbigintLogicalFunction.hpp | 54 ++++++ .../EverLeTbigintTbigintLogicalFunction.hpp | 54 ++++++ .../EverLtTbigintTbigintLogicalFunction.hpp | 54 ++++++ .../EverNeTbigintTbigintLogicalFunction.hpp | 54 ++++++ .../src/Functions/Meos/CMakeLists.txt | 6 + .../EverEqTbigintTbigintLogicalFunction.cpp | 105 ++++++++++ .../EverGeTbigintTbigintLogicalFunction.cpp | 105 ++++++++++ .../EverGtTbigintTbigintLogicalFunction.cpp | 105 ++++++++++ .../EverLeTbigintTbigintLogicalFunction.cpp | 105 ++++++++++ .../EverLtTbigintTbigintLogicalFunction.cpp | 105 ++++++++++ .../EverNeTbigintTbigintLogicalFunction.cpp | 105 ++++++++++ .../EverEqTbigintTbigintPhysicalFunction.hpp | 43 +++++ .../EverGeTbigintTbigintPhysicalFunction.hpp | 43 +++++ .../EverGtTbigintTbigintPhysicalFunction.hpp | 43 +++++ .../EverLeTbigintTbigintPhysicalFunction.hpp | 43 +++++ .../EverLtTbigintTbigintPhysicalFunction.hpp | 43 +++++ .../EverNeTbigintTbigintPhysicalFunction.hpp | 43 +++++ .../src/Functions/Meos/CMakeLists.txt | 6 + .../EverEqTbigintTbigintPhysicalFunction.cpp | 93 +++++++++ .../EverGeTbigintTbigintPhysicalFunction.cpp | 93 +++++++++ .../EverGtTbigintTbigintPhysicalFunction.cpp | 93 +++++++++ .../EverLeTbigintTbigintPhysicalFunction.cpp | 93 +++++++++ .../EverLtTbigintTbigintPhysicalFunction.cpp | 93 +++++++++ .../EverNeTbigintTbigintPhysicalFunction.cpp | 93 +++++++++ nes-sql-parser/AntlrSQL.g4 | 8 +- .../src/AntlrSQLQueryPlanCreator.cpp | 180 ++++++++++++++++++ 28 files changed, 1969 insertions(+), 1 deletion(-) create mode 100644 nes-logical-operators/include/Functions/Meos/EverEqTbigintTbigintLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverGeTbigintTbigintLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverGtTbigintTbigintLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverLeTbigintTbigintLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverLtTbigintTbigintLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverNeTbigintTbigintLogicalFunction.hpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverEqTbigintTbigintLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverGeTbigintTbigintLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverGtTbigintTbigintLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverLeTbigintTbigintLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverLtTbigintTbigintLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverNeTbigintTbigintLogicalFunction.cpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverEqTbigintTbigintPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverGeTbigintTbigintPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverGtTbigintTbigintPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverLeTbigintTbigintPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverLtTbigintTbigintPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverNeTbigintTbigintPhysicalFunction.hpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverEqTbigintTbigintPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverGeTbigintTbigintPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverGtTbigintTbigintPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverLeTbigintTbigintPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverLtTbigintTbigintPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverNeTbigintTbigintPhysicalFunction.cpp diff --git a/nes-logical-operators/include/Functions/Meos/EverEqTbigintTbigintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverEqTbigintTbigintLogicalFunction.hpp new file mode 100644 index 0000000000..51cd3d91d3 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverEqTbigintTbigintLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event ever_eq_tbigint_tfloat: tests if two single-instant tbigint values are ever equal. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ever_eq_tbigint_tfloat`. Takes (value1:FLOAT64, value2:FLOAT64, ts:UINT64), + * constructs two single-instant temporals, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class EverEqTbigintTfloatLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverEqTbigintTfloat"; + + EverEqTbigintTfloatLogicalFunction(LogicalFunction value1, + LogicalFunction value2, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverGeTbigintTbigintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverGeTbigintTbigintLogicalFunction.hpp new file mode 100644 index 0000000000..a69bc81c9e --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverGeTbigintTbigintLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event ever_ge_tbigint_tfloat: tests if two single-instant tbigint values are ever greater or equal. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ever_ge_tbigint_tfloat`. Takes (value1:FLOAT64, value2:FLOAT64, ts:UINT64), + * constructs two single-instant temporals, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class EverGeTbigintTfloatLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverGeTbigintTfloat"; + + EverGeTbigintTfloatLogicalFunction(LogicalFunction value1, + LogicalFunction value2, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverGtTbigintTbigintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverGtTbigintTbigintLogicalFunction.hpp new file mode 100644 index 0000000000..cfba85ca24 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverGtTbigintTbigintLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event ever_gt_tbigint_tfloat: tests if two single-instant tbigint values are ever greater than. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ever_gt_tbigint_tfloat`. Takes (value1:FLOAT64, value2:FLOAT64, ts:UINT64), + * constructs two single-instant temporals, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class EverGtTbigintTfloatLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverGtTbigintTfloat"; + + EverGtTbigintTfloatLogicalFunction(LogicalFunction value1, + LogicalFunction value2, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverLeTbigintTbigintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverLeTbigintTbigintLogicalFunction.hpp new file mode 100644 index 0000000000..941fa3b879 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverLeTbigintTbigintLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event ever_le_tbigint_tfloat: tests if two single-instant tbigint values are ever less or equal. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ever_le_tbigint_tfloat`. Takes (value1:FLOAT64, value2:FLOAT64, ts:UINT64), + * constructs two single-instant temporals, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class EverLeTbigintTfloatLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverLeTbigintTfloat"; + + EverLeTbigintTfloatLogicalFunction(LogicalFunction value1, + LogicalFunction value2, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverLtTbigintTbigintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverLtTbigintTbigintLogicalFunction.hpp new file mode 100644 index 0000000000..a7069b03a1 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverLtTbigintTbigintLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event ever_lt_tbigint_tfloat: tests if two single-instant tbigint values are ever less than. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ever_lt_tbigint_tfloat`. Takes (value1:FLOAT64, value2:FLOAT64, ts:UINT64), + * constructs two single-instant temporals, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class EverLtTbigintTfloatLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverLtTbigintTfloat"; + + EverLtTbigintTfloatLogicalFunction(LogicalFunction value1, + LogicalFunction value2, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverNeTbigintTbigintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverNeTbigintTbigintLogicalFunction.hpp new file mode 100644 index 0000000000..db0619a55b --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverNeTbigintTbigintLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event ever_ne_tbigint_tfloat: tests if two single-instant tbigint values are ever not equal. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ever_ne_tbigint_tfloat`. Takes (value1:FLOAT64, value2:FLOAT64, ts:UINT64), + * constructs two single-instant temporals, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class EverNeTbigintTfloatLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverNeTbigintTfloat"; + + EverNeTbigintTfloatLogicalFunction(LogicalFunction value1, + LogicalFunction value2, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt index 93056d8fe8..7b0c61ca48 100644 --- a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt @@ -136,3 +136,9 @@ add_plugin(AlwaysGtTintTint LogicalFunction nes-logical-operators AlwaysGtTintTi add_plugin(AlwaysLeTintTint LogicalFunction nes-logical-operators AlwaysLeTintTintLogicalFunction.cpp) add_plugin(AlwaysLtTintTint LogicalFunction nes-logical-operators AlwaysLtTintTintLogicalFunction.cpp) add_plugin(AlwaysNeTintTint LogicalFunction nes-logical-operators AlwaysNeTintTintLogicalFunction.cpp) +add_plugin(EverEqTbigintTbigint LogicalFunction nes-logical-operators EverEqTbigintTbigintLogicalFunction.cpp) +add_plugin(EverGeTbigintTbigint LogicalFunction nes-logical-operators EverGeTbigintTbigintLogicalFunction.cpp) +add_plugin(EverGtTbigintTbigint LogicalFunction nes-logical-operators EverGtTbigintTbigintLogicalFunction.cpp) +add_plugin(EverLeTbigintTbigint LogicalFunction nes-logical-operators EverLeTbigintTbigintLogicalFunction.cpp) +add_plugin(EverLtTbigintTbigint LogicalFunction nes-logical-operators EverLtTbigintTbigintLogicalFunction.cpp) +add_plugin(EverNeTbigintTbigint LogicalFunction nes-logical-operators EverNeTbigintTbigintLogicalFunction.cpp) diff --git a/nes-logical-operators/src/Functions/Meos/EverEqTbigintTbigintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverEqTbigintTbigintLogicalFunction.cpp new file mode 100644 index 0000000000..aff2bb3796 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverEqTbigintTbigintLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EverEqTbigintTfloatLogicalFunction::EverEqTbigintTfloatLogicalFunction(LogicalFunction value1, + LogicalFunction value2, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value1)); + parameters.push_back(std::move(value2)); + parameters.push_back(std::move(ts)); +} + +DataType EverEqTbigintTfloatLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverEqTbigintTfloatLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EverEqTbigintTfloatLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverEqTbigintTfloatLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "EverEqTbigintTfloatLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EverEqTbigintTfloatLogicalFunction::getType() const { return NAME; } + +bool EverEqTbigintTfloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EverEqTbigintTfloatLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction EverEqTbigintTfloatLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction EverEqTbigintTfloatLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverEqTbigintTfloatLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "EverEqTbigintTfloatLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return EverEqTbigintTfloatLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverGeTbigintTbigintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverGeTbigintTbigintLogicalFunction.cpp new file mode 100644 index 0000000000..124252845f --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverGeTbigintTbigintLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EverGeTbigintTfloatLogicalFunction::EverGeTbigintTfloatLogicalFunction(LogicalFunction value1, + LogicalFunction value2, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value1)); + parameters.push_back(std::move(value2)); + parameters.push_back(std::move(ts)); +} + +DataType EverGeTbigintTfloatLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverGeTbigintTfloatLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EverGeTbigintTfloatLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverGeTbigintTfloatLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "EverGeTbigintTfloatLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EverGeTbigintTfloatLogicalFunction::getType() const { return NAME; } + +bool EverGeTbigintTfloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EverGeTbigintTfloatLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction EverGeTbigintTfloatLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction EverGeTbigintTfloatLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverGeTbigintTfloatLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "EverGeTbigintTfloatLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return EverGeTbigintTfloatLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverGtTbigintTbigintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverGtTbigintTbigintLogicalFunction.cpp new file mode 100644 index 0000000000..1c3161aadd --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverGtTbigintTbigintLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EverGtTbigintTfloatLogicalFunction::EverGtTbigintTfloatLogicalFunction(LogicalFunction value1, + LogicalFunction value2, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value1)); + parameters.push_back(std::move(value2)); + parameters.push_back(std::move(ts)); +} + +DataType EverGtTbigintTfloatLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverGtTbigintTfloatLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EverGtTbigintTfloatLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverGtTbigintTfloatLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "EverGtTbigintTfloatLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EverGtTbigintTfloatLogicalFunction::getType() const { return NAME; } + +bool EverGtTbigintTfloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EverGtTbigintTfloatLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction EverGtTbigintTfloatLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction EverGtTbigintTfloatLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverGtTbigintTfloatLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "EverGtTbigintTfloatLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return EverGtTbigintTfloatLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverLeTbigintTbigintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverLeTbigintTbigintLogicalFunction.cpp new file mode 100644 index 0000000000..6a0d2b51ad --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverLeTbigintTbigintLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EverLeTbigintTfloatLogicalFunction::EverLeTbigintTfloatLogicalFunction(LogicalFunction value1, + LogicalFunction value2, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value1)); + parameters.push_back(std::move(value2)); + parameters.push_back(std::move(ts)); +} + +DataType EverLeTbigintTfloatLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverLeTbigintTfloatLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EverLeTbigintTfloatLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverLeTbigintTfloatLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "EverLeTbigintTfloatLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EverLeTbigintTfloatLogicalFunction::getType() const { return NAME; } + +bool EverLeTbigintTfloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EverLeTbigintTfloatLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction EverLeTbigintTfloatLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction EverLeTbigintTfloatLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverLeTbigintTfloatLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "EverLeTbigintTfloatLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return EverLeTbigintTfloatLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverLtTbigintTbigintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverLtTbigintTbigintLogicalFunction.cpp new file mode 100644 index 0000000000..715a85cc22 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverLtTbigintTbigintLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EverLtTbigintTfloatLogicalFunction::EverLtTbigintTfloatLogicalFunction(LogicalFunction value1, + LogicalFunction value2, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value1)); + parameters.push_back(std::move(value2)); + parameters.push_back(std::move(ts)); +} + +DataType EverLtTbigintTfloatLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverLtTbigintTfloatLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EverLtTbigintTfloatLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverLtTbigintTfloatLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "EverLtTbigintTfloatLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EverLtTbigintTfloatLogicalFunction::getType() const { return NAME; } + +bool EverLtTbigintTfloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EverLtTbigintTfloatLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction EverLtTbigintTfloatLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction EverLtTbigintTfloatLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverLtTbigintTfloatLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "EverLtTbigintTfloatLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return EverLtTbigintTfloatLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverNeTbigintTbigintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverNeTbigintTbigintLogicalFunction.cpp new file mode 100644 index 0000000000..c4bdbe9e42 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverNeTbigintTbigintLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EverNeTbigintTfloatLogicalFunction::EverNeTbigintTfloatLogicalFunction(LogicalFunction value1, + LogicalFunction value2, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value1)); + parameters.push_back(std::move(value2)); + parameters.push_back(std::move(ts)); +} + +DataType EverNeTbigintTfloatLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverNeTbigintTfloatLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EverNeTbigintTfloatLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverNeTbigintTfloatLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "EverNeTbigintTfloatLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EverNeTbigintTfloatLogicalFunction::getType() const { return NAME; } + +bool EverNeTbigintTfloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EverNeTbigintTfloatLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction EverNeTbigintTfloatLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction EverNeTbigintTfloatLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverNeTbigintTfloatLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "EverNeTbigintTfloatLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return EverNeTbigintTfloatLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverEqTbigintTbigintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverEqTbigintTbigintPhysicalFunction.hpp new file mode 100644 index 0000000000..feaa66970f --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverEqTbigintTbigintPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `ever_eq_tbigint_tfloat`. + * + * Per-event ever_eq_tbigint_tfloat: tests if two single-instant tfloat values are ever equal. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class EverEqTbigintTfloatPhysicalFunction : public PhysicalFunctionConcept { +public: + EverEqTbigintTfloatPhysicalFunction(PhysicalFunction value1Function, + PhysicalFunction value2Function, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverGeTbigintTbigintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverGeTbigintTbigintPhysicalFunction.hpp new file mode 100644 index 0000000000..c14497db81 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverGeTbigintTbigintPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `ever_ge_tbigint_tfloat`. + * + * Per-event ever_ge_tbigint_tfloat: tests if two single-instant tfloat values are ever greater or equal. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class EverGeTbigintTfloatPhysicalFunction : public PhysicalFunctionConcept { +public: + EverGeTbigintTfloatPhysicalFunction(PhysicalFunction value1Function, + PhysicalFunction value2Function, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverGtTbigintTbigintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverGtTbigintTbigintPhysicalFunction.hpp new file mode 100644 index 0000000000..7137cd04c1 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverGtTbigintTbigintPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `ever_gt_tbigint_tfloat`. + * + * Per-event ever_gt_tbigint_tfloat: tests if two single-instant tfloat values are ever greater than. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class EverGtTbigintTfloatPhysicalFunction : public PhysicalFunctionConcept { +public: + EverGtTbigintTfloatPhysicalFunction(PhysicalFunction value1Function, + PhysicalFunction value2Function, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverLeTbigintTbigintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverLeTbigintTbigintPhysicalFunction.hpp new file mode 100644 index 0000000000..f11bc3c16c --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverLeTbigintTbigintPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `ever_le_tbigint_tfloat`. + * + * Per-event ever_le_tbigint_tfloat: tests if two single-instant tfloat values are ever less or equal. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class EverLeTbigintTfloatPhysicalFunction : public PhysicalFunctionConcept { +public: + EverLeTbigintTfloatPhysicalFunction(PhysicalFunction value1Function, + PhysicalFunction value2Function, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverLtTbigintTbigintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverLtTbigintTbigintPhysicalFunction.hpp new file mode 100644 index 0000000000..bb25e34d09 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverLtTbigintTbigintPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `ever_lt_tbigint_tfloat`. + * + * Per-event ever_lt_tbigint_tfloat: tests if two single-instant tfloat values are ever less than. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class EverLtTbigintTfloatPhysicalFunction : public PhysicalFunctionConcept { +public: + EverLtTbigintTfloatPhysicalFunction(PhysicalFunction value1Function, + PhysicalFunction value2Function, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverNeTbigintTbigintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverNeTbigintTbigintPhysicalFunction.hpp new file mode 100644 index 0000000000..406dd8b083 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverNeTbigintTbigintPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `ever_ne_tbigint_tfloat`. + * + * Per-event ever_ne_tbigint_tfloat: tests if two single-instant tfloat values are ever not equal. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class EverNeTbigintTfloatPhysicalFunction : public PhysicalFunctionConcept { +public: + EverNeTbigintTfloatPhysicalFunction(PhysicalFunction value1Function, + PhysicalFunction value2Function, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt index 74039cfadc..1b06243f9f 100644 --- a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt @@ -135,4 +135,10 @@ add_plugin(AlwaysGtTintTint PhysicalFunction nes-physical-operators AlwaysGtTint add_plugin(AlwaysLeTintTint PhysicalFunction nes-physical-operators AlwaysLeTintTintPhysicalFunction.cpp) add_plugin(AlwaysLtTintTint PhysicalFunction nes-physical-operators AlwaysLtTintTintPhysicalFunction.cpp) add_plugin(AlwaysNeTintTint PhysicalFunction nes-physical-operators AlwaysNeTintTintPhysicalFunction.cpp) +add_plugin(EverEqTbigintTbigint PhysicalFunction nes-physical-operators EverEqTbigintTbigintPhysicalFunction.cpp) +add_plugin(EverGeTbigintTbigint PhysicalFunction nes-physical-operators EverGeTbigintTbigintPhysicalFunction.cpp) +add_plugin(EverGtTbigintTbigint PhysicalFunction nes-physical-operators EverGtTbigintTbigintPhysicalFunction.cpp) +add_plugin(EverLeTbigintTbigint PhysicalFunction nes-physical-operators EverLeTbigintTbigintPhysicalFunction.cpp) +add_plugin(EverLtTbigintTbigint PhysicalFunction nes-physical-operators EverLtTbigintTbigintPhysicalFunction.cpp) +add_plugin(EverNeTbigintTbigint PhysicalFunction nes-physical-operators EverNeTbigintTbigintPhysicalFunction.cpp) endif() diff --git a/nes-physical-operators/src/Functions/Meos/EverEqTbigintTbigintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverEqTbigintTbigintPhysicalFunction.cpp new file mode 100644 index 0000000000..6c74c63431 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverEqTbigintTbigintPhysicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +EverEqTbigintTbigintPhysicalFunction::EverEqTbigintTbigintPhysicalFunction(PhysicalFunction value1Function, + PhysicalFunction value2Function, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(value1Function)); + parameterFunctions.push_back(std::move(value2Function)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal EverEqTbigintTbigintPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value1 = parameterValues[0].cast>(); + auto value2 = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double v1, double v2, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt1 = fmt::format("{}@{}", static_cast(v1), ts_str); + std::string wkt2 = fmt::format("{}@{}", static_cast(v2), ts_str); + Temporal* temp1 = tbigint_in(wkt1.c_str()); + if (!temp1) return 0.0; + Temporal* temp2 = tbigint_in(wkt2.c_str()); + if (!temp2) { free(temp1); return 0.0; } + int r = ever_eq_tbigint_tbigint(temp1, temp2); + free(temp1); + free(temp2); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + value1, value2, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverEqTbigintTbigintPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "EverEqTbigintTbigintPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return EverEqTbigintTbigintPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverGeTbigintTbigintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverGeTbigintTbigintPhysicalFunction.cpp new file mode 100644 index 0000000000..09f5309356 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverGeTbigintTbigintPhysicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +EverGeTbigintTbigintPhysicalFunction::EverGeTbigintTbigintPhysicalFunction(PhysicalFunction value1Function, + PhysicalFunction value2Function, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(value1Function)); + parameterFunctions.push_back(std::move(value2Function)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal EverGeTbigintTbigintPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value1 = parameterValues[0].cast>(); + auto value2 = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double v1, double v2, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt1 = fmt::format("{}@{}", static_cast(v1), ts_str); + std::string wkt2 = fmt::format("{}@{}", static_cast(v2), ts_str); + Temporal* temp1 = tbigint_in(wkt1.c_str()); + if (!temp1) return 0.0; + Temporal* temp2 = tbigint_in(wkt2.c_str()); + if (!temp2) { free(temp1); return 0.0; } + int r = ever_ge_tbigint_tbigint(temp1, temp2); + free(temp1); + free(temp2); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + value1, value2, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverGeTbigintTbigintPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "EverGeTbigintTbigintPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return EverGeTbigintTbigintPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverGtTbigintTbigintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverGtTbigintTbigintPhysicalFunction.cpp new file mode 100644 index 0000000000..93d5cb0a0b --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverGtTbigintTbigintPhysicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +EverGtTbigintTbigintPhysicalFunction::EverGtTbigintTbigintPhysicalFunction(PhysicalFunction value1Function, + PhysicalFunction value2Function, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(value1Function)); + parameterFunctions.push_back(std::move(value2Function)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal EverGtTbigintTbigintPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value1 = parameterValues[0].cast>(); + auto value2 = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double v1, double v2, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt1 = fmt::format("{}@{}", static_cast(v1), ts_str); + std::string wkt2 = fmt::format("{}@{}", static_cast(v2), ts_str); + Temporal* temp1 = tbigint_in(wkt1.c_str()); + if (!temp1) return 0.0; + Temporal* temp2 = tbigint_in(wkt2.c_str()); + if (!temp2) { free(temp1); return 0.0; } + int r = ever_gt_tbigint_tbigint(temp1, temp2); + free(temp1); + free(temp2); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + value1, value2, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverGtTbigintTbigintPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "EverGtTbigintTbigintPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return EverGtTbigintTbigintPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverLeTbigintTbigintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverLeTbigintTbigintPhysicalFunction.cpp new file mode 100644 index 0000000000..f0492bd755 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverLeTbigintTbigintPhysicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +EverLeTbigintTbigintPhysicalFunction::EverLeTbigintTbigintPhysicalFunction(PhysicalFunction value1Function, + PhysicalFunction value2Function, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(value1Function)); + parameterFunctions.push_back(std::move(value2Function)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal EverLeTbigintTbigintPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value1 = parameterValues[0].cast>(); + auto value2 = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double v1, double v2, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt1 = fmt::format("{}@{}", static_cast(v1), ts_str); + std::string wkt2 = fmt::format("{}@{}", static_cast(v2), ts_str); + Temporal* temp1 = tbigint_in(wkt1.c_str()); + if (!temp1) return 0.0; + Temporal* temp2 = tbigint_in(wkt2.c_str()); + if (!temp2) { free(temp1); return 0.0; } + int r = ever_le_tbigint_tbigint(temp1, temp2); + free(temp1); + free(temp2); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + value1, value2, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverLeTbigintTbigintPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "EverLeTbigintTbigintPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return EverLeTbigintTbigintPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverLtTbigintTbigintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverLtTbigintTbigintPhysicalFunction.cpp new file mode 100644 index 0000000000..31e6ac9ee5 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverLtTbigintTbigintPhysicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +EverLtTbigintTbigintPhysicalFunction::EverLtTbigintTbigintPhysicalFunction(PhysicalFunction value1Function, + PhysicalFunction value2Function, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(value1Function)); + parameterFunctions.push_back(std::move(value2Function)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal EverLtTbigintTbigintPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value1 = parameterValues[0].cast>(); + auto value2 = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double v1, double v2, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt1 = fmt::format("{}@{}", static_cast(v1), ts_str); + std::string wkt2 = fmt::format("{}@{}", static_cast(v2), ts_str); + Temporal* temp1 = tbigint_in(wkt1.c_str()); + if (!temp1) return 0.0; + Temporal* temp2 = tbigint_in(wkt2.c_str()); + if (!temp2) { free(temp1); return 0.0; } + int r = ever_lt_tbigint_tbigint(temp1, temp2); + free(temp1); + free(temp2); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + value1, value2, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverLtTbigintTbigintPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "EverLtTbigintTbigintPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return EverLtTbigintTbigintPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverNeTbigintTbigintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverNeTbigintTbigintPhysicalFunction.cpp new file mode 100644 index 0000000000..1709c60c40 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverNeTbigintTbigintPhysicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +EverNeTbigintTbigintPhysicalFunction::EverNeTbigintTbigintPhysicalFunction(PhysicalFunction value1Function, + PhysicalFunction value2Function, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(value1Function)); + parameterFunctions.push_back(std::move(value2Function)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal EverNeTbigintTbigintPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value1 = parameterValues[0].cast>(); + auto value2 = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double v1, double v2, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt1 = fmt::format("{}@{}", static_cast(v1), ts_str); + std::string wkt2 = fmt::format("{}@{}", static_cast(v2), ts_str); + Temporal* temp1 = tbigint_in(wkt1.c_str()); + if (!temp1) return 0.0; + Temporal* temp2 = tbigint_in(wkt2.c_str()); + if (!temp2) { free(temp1); return 0.0; } + int r = ever_ne_tbigint_tbigint(temp1, temp2); + free(temp1); + free(temp2); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + value1, value2, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverNeTbigintTbigintPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "EverNeTbigintTbigintPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return EverNeTbigintTbigintPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-sql-parser/AntlrSQL.g4 b/nes-sql-parser/AntlrSQL.g4 index 377064f091..f7183b330e 100644 --- a/nes-sql-parser/AntlrSQL.g4 +++ b/nes-sql-parser/AntlrSQL.g4 @@ -295,7 +295,7 @@ timeUnit: MS timestampParameter: name=identifier; -functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS; +functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS; sinkClause: INTO sink (',' sink)*; @@ -523,6 +523,12 @@ EVER_GT_TBIGINT_BIGINT: 'EVER_GT_TBIGINT_BIGINT' | 'ever_gt_tbigint_bigint'; EVER_LE_TBIGINT_BIGINT: 'EVER_LE_TBIGINT_BIGINT' | 'ever_le_tbigint_bigint'; EVER_LT_TBIGINT_BIGINT: 'EVER_LT_TBIGINT_BIGINT' | 'ever_lt_tbigint_bigint'; EVER_NE_TBIGINT_BIGINT: 'EVER_NE_TBIGINT_BIGINT' | 'ever_ne_tbigint_bigint'; +EVER_EQ_TBIGINT_TBIGINT: 'EVER_EQ_TBIGINT_TBIGINT' | 'ever_eq_tbigint_tbigint'; +EVER_GE_TBIGINT_TBIGINT: 'EVER_GE_TBIGINT_TBIGINT' | 'ever_ge_tbigint_tbigint'; +EVER_GT_TBIGINT_TBIGINT: 'EVER_GT_TBIGINT_TBIGINT' | 'ever_gt_tbigint_tbigint'; +EVER_LE_TBIGINT_TBIGINT: 'EVER_LE_TBIGINT_TBIGINT' | 'ever_le_tbigint_tbigint'; +EVER_LT_TBIGINT_TBIGINT: 'EVER_LT_TBIGINT_TBIGINT' | 'ever_lt_tbigint_tbigint'; +EVER_NE_TBIGINT_TBIGINT: 'EVER_NE_TBIGINT_TBIGINT' | 'ever_ne_tbigint_tbigint'; EVER_EQ_TFLOAT_FLOAT: 'EVER_EQ_TFLOAT_FLOAT' | 'ever_eq_tfloat_float'; EVER_GE_TFLOAT_FLOAT: 'EVER_GE_TFLOAT_FLOAT' | 'ever_ge_tfloat_float'; EVER_GT_TFLOAT_FLOAT: 'EVER_GT_TFLOAT_FLOAT' | 'ever_gt_tfloat_float'; diff --git a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp index 88b06371e1..fec51869a0 100644 --- a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp +++ b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp @@ -145,6 +145,12 @@ #include #include #include +#include +#include +#include +#include +#include +#include #include #include #include @@ -3148,6 +3154,180 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont } break; /* END CODEGEN PARSER GLUE: EVER_NE_TBIGINT_BIGINT */ + /* BEGIN CODEGEN PARSER GLUE: EVER_EQ_TBIGINT_TBIGINT */ + case AntlrSQLLexer::EVER_EQ_TBIGINT_TBIGINT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("EVER_EQ_TBIGINT_TBIGINT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverEqTbigintTbigintLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: EVER_EQ_TBIGINT_TBIGINT */ + /* BEGIN CODEGEN PARSER GLUE: EVER_GE_TBIGINT_TBIGINT */ + case AntlrSQLLexer::EVER_GE_TBIGINT_TBIGINT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("EVER_GE_TBIGINT_TBIGINT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverGeTbigintTbigintLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: EVER_GE_TBIGINT_TBIGINT */ + /* BEGIN CODEGEN PARSER GLUE: EVER_GT_TBIGINT_TBIGINT */ + case AntlrSQLLexer::EVER_GT_TBIGINT_TBIGINT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("EVER_GT_TBIGINT_TBIGINT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverGtTbigintTbigintLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: EVER_GT_TBIGINT_TBIGINT */ + /* BEGIN CODEGEN PARSER GLUE: EVER_LE_TBIGINT_TBIGINT */ + case AntlrSQLLexer::EVER_LE_TBIGINT_TBIGINT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("EVER_LE_TBIGINT_TBIGINT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverLeTbigintTbigintLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: EVER_LE_TBIGINT_TBIGINT */ + /* BEGIN CODEGEN PARSER GLUE: EVER_LT_TBIGINT_TBIGINT */ + case AntlrSQLLexer::EVER_LT_TBIGINT_TBIGINT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("EVER_LT_TBIGINT_TBIGINT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverLtTbigintTbigintLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: EVER_LT_TBIGINT_TBIGINT */ + /* BEGIN CODEGEN PARSER GLUE: EVER_NE_TBIGINT_TBIGINT */ + case AntlrSQLLexer::EVER_NE_TBIGINT_TBIGINT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("EVER_NE_TBIGINT_TBIGINT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverNeTbigintTbigintLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: EVER_NE_TBIGINT_TBIGINT */ /* BEGIN CODEGEN PARSER GLUE: EVER_EQ_TFLOAT_FLOAT */ case AntlrSQLLexer::EVER_EQ_TFLOAT_FLOAT: { From d46cdc9df46a0599a46c3e11a6548a728d1a8f49 Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Fri, 12 Jun 2026 09:56:52 +0200 Subject: [PATCH 30/96] feat(meos): add ALWAYS_EQ/GE/GT/LE/LT/NE_TBIGINT_TBIGINT NES operators (W72) --- .../AlwaysEqTbigintTbigintLogicalFunction.hpp | 54 ++++++ .../AlwaysGeTbigintTbigintLogicalFunction.hpp | 54 ++++++ .../AlwaysGtTbigintTbigintLogicalFunction.hpp | 54 ++++++ .../AlwaysLeTbigintTbigintLogicalFunction.hpp | 54 ++++++ .../AlwaysLtTbigintTbigintLogicalFunction.hpp | 54 ++++++ .../AlwaysNeTbigintTbigintLogicalFunction.hpp | 54 ++++++ .../AlwaysEqTbigintTbigintLogicalFunction.cpp | 105 ++++++++++ .../AlwaysGeTbigintTbigintLogicalFunction.cpp | 105 ++++++++++ .../AlwaysGtTbigintTbigintLogicalFunction.cpp | 105 ++++++++++ .../AlwaysLeTbigintTbigintLogicalFunction.cpp | 105 ++++++++++ .../AlwaysLtTbigintTbigintLogicalFunction.cpp | 105 ++++++++++ .../AlwaysNeTbigintTbigintLogicalFunction.cpp | 105 ++++++++++ .../src/Functions/Meos/CMakeLists.txt | 6 + ...AlwaysEqTbigintTbigintPhysicalFunction.hpp | 43 +++++ ...AlwaysGeTbigintTbigintPhysicalFunction.hpp | 43 +++++ ...AlwaysGtTbigintTbigintPhysicalFunction.hpp | 43 +++++ ...AlwaysLeTbigintTbigintPhysicalFunction.hpp | 43 +++++ ...AlwaysLtTbigintTbigintPhysicalFunction.hpp | 43 +++++ ...AlwaysNeTbigintTbigintPhysicalFunction.hpp | 43 +++++ ...AlwaysEqTbigintTbigintPhysicalFunction.cpp | 93 +++++++++ ...AlwaysGeTbigintTbigintPhysicalFunction.cpp | 93 +++++++++ ...AlwaysGtTbigintTbigintPhysicalFunction.cpp | 93 +++++++++ ...AlwaysLeTbigintTbigintPhysicalFunction.cpp | 93 +++++++++ ...AlwaysLtTbigintTbigintPhysicalFunction.cpp | 93 +++++++++ ...AlwaysNeTbigintTbigintPhysicalFunction.cpp | 93 +++++++++ .../src/Functions/Meos/CMakeLists.txt | 6 + nes-sql-parser/AntlrSQL.g4 | 8 +- .../src/AntlrSQLQueryPlanCreator.cpp | 180 ++++++++++++++++++ 28 files changed, 1969 insertions(+), 1 deletion(-) create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysEqTbigintTbigintLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysGeTbigintTbigintLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysGtTbigintTbigintLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysLeTbigintTbigintLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysLtTbigintTbigintLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysNeTbigintTbigintLogicalFunction.hpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysEqTbigintTbigintLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysGeTbigintTbigintLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysGtTbigintTbigintLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysLeTbigintTbigintLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysLtTbigintTbigintLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysNeTbigintTbigintLogicalFunction.cpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysEqTbigintTbigintPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysGeTbigintTbigintPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysGtTbigintTbigintPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysLeTbigintTbigintPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysLtTbigintTbigintPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysNeTbigintTbigintPhysicalFunction.hpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysEqTbigintTbigintPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysGeTbigintTbigintPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysGtTbigintTbigintPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysLeTbigintTbigintPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysLtTbigintTbigintPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysNeTbigintTbigintPhysicalFunction.cpp diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysEqTbigintTbigintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysEqTbigintTbigintLogicalFunction.hpp new file mode 100644 index 0000000000..46b63578c9 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysEqTbigintTbigintLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event always_eq_tbigint_tfloat: tests if two single-instant tbigint values are always equal. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `always_eq_tbigint_tfloat`. Takes (value1:FLOAT64, value2:FLOAT64, ts:UINT64), + * constructs two single-instant temporals, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class AlwaysEqTbigintTfloatLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysEqTbigintTfloat"; + + AlwaysEqTbigintTfloatLogicalFunction(LogicalFunction value1, + LogicalFunction value2, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysGeTbigintTbigintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysGeTbigintTbigintLogicalFunction.hpp new file mode 100644 index 0000000000..37f9d8e151 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysGeTbigintTbigintLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event always_ge_tbigint_tfloat: tests if two single-instant tbigint values are always greater or equal. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `always_ge_tbigint_tfloat`. Takes (value1:FLOAT64, value2:FLOAT64, ts:UINT64), + * constructs two single-instant temporals, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class AlwaysGeTbigintTfloatLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysGeTbigintTfloat"; + + AlwaysGeTbigintTfloatLogicalFunction(LogicalFunction value1, + LogicalFunction value2, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysGtTbigintTbigintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysGtTbigintTbigintLogicalFunction.hpp new file mode 100644 index 0000000000..48addeef95 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysGtTbigintTbigintLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event always_gt_tbigint_tfloat: tests if two single-instant tbigint values are always greater than. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `always_gt_tbigint_tfloat`. Takes (value1:FLOAT64, value2:FLOAT64, ts:UINT64), + * constructs two single-instant temporals, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class AlwaysGtTbigintTfloatLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysGtTbigintTfloat"; + + AlwaysGtTbigintTfloatLogicalFunction(LogicalFunction value1, + LogicalFunction value2, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysLeTbigintTbigintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysLeTbigintTbigintLogicalFunction.hpp new file mode 100644 index 0000000000..6c5c2998b6 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysLeTbigintTbigintLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event always_le_tbigint_tfloat: tests if two single-instant tbigint values are always less or equal. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `always_le_tbigint_tfloat`. Takes (value1:FLOAT64, value2:FLOAT64, ts:UINT64), + * constructs two single-instant temporals, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class AlwaysLeTbigintTfloatLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysLeTbigintTfloat"; + + AlwaysLeTbigintTfloatLogicalFunction(LogicalFunction value1, + LogicalFunction value2, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysLtTbigintTbigintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysLtTbigintTbigintLogicalFunction.hpp new file mode 100644 index 0000000000..bef92d195e --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysLtTbigintTbigintLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event always_lt_tbigint_tfloat: tests if two single-instant tbigint values are always less than. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `always_lt_tbigint_tfloat`. Takes (value1:FLOAT64, value2:FLOAT64, ts:UINT64), + * constructs two single-instant temporals, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class AlwaysLtTbigintTfloatLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysLtTbigintTfloat"; + + AlwaysLtTbigintTfloatLogicalFunction(LogicalFunction value1, + LogicalFunction value2, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysNeTbigintTbigintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysNeTbigintTbigintLogicalFunction.hpp new file mode 100644 index 0000000000..47801d4c53 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysNeTbigintTbigintLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event always_ne_tbigint_tfloat: tests if two single-instant tbigint values are always not equal. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `always_ne_tbigint_tfloat`. Takes (value1:FLOAT64, value2:FLOAT64, ts:UINT64), + * constructs two single-instant temporals, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class AlwaysNeTbigintTfloatLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysNeTbigintTfloat"; + + AlwaysNeTbigintTfloatLogicalFunction(LogicalFunction value1, + LogicalFunction value2, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysEqTbigintTbigintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysEqTbigintTbigintLogicalFunction.cpp new file mode 100644 index 0000000000..7ca05704e4 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysEqTbigintTbigintLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AlwaysEqTbigintTfloatLogicalFunction::AlwaysEqTbigintTfloatLogicalFunction(LogicalFunction value1, + LogicalFunction value2, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value1)); + parameters.push_back(std::move(value2)); + parameters.push_back(std::move(ts)); +} + +DataType AlwaysEqTbigintTfloatLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysEqTbigintTfloatLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AlwaysEqTbigintTfloatLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysEqTbigintTfloatLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "AlwaysEqTbigintTfloatLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AlwaysEqTbigintTfloatLogicalFunction::getType() const { return NAME; } + +bool AlwaysEqTbigintTfloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AlwaysEqTbigintTfloatLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction AlwaysEqTbigintTfloatLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction AlwaysEqTbigintTfloatLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysEqTbigintTfloatLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "AlwaysEqTbigintTfloatLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return AlwaysEqTbigintTfloatLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysGeTbigintTbigintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysGeTbigintTbigintLogicalFunction.cpp new file mode 100644 index 0000000000..b97bd4c734 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysGeTbigintTbigintLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AlwaysGeTbigintTfloatLogicalFunction::AlwaysGeTbigintTfloatLogicalFunction(LogicalFunction value1, + LogicalFunction value2, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value1)); + parameters.push_back(std::move(value2)); + parameters.push_back(std::move(ts)); +} + +DataType AlwaysGeTbigintTfloatLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysGeTbigintTfloatLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AlwaysGeTbigintTfloatLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysGeTbigintTfloatLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "AlwaysGeTbigintTfloatLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AlwaysGeTbigintTfloatLogicalFunction::getType() const { return NAME; } + +bool AlwaysGeTbigintTfloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AlwaysGeTbigintTfloatLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction AlwaysGeTbigintTfloatLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction AlwaysGeTbigintTfloatLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysGeTbigintTfloatLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "AlwaysGeTbigintTfloatLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return AlwaysGeTbigintTfloatLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysGtTbigintTbigintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysGtTbigintTbigintLogicalFunction.cpp new file mode 100644 index 0000000000..794de5ab88 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysGtTbigintTbigintLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AlwaysGtTbigintTfloatLogicalFunction::AlwaysGtTbigintTfloatLogicalFunction(LogicalFunction value1, + LogicalFunction value2, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value1)); + parameters.push_back(std::move(value2)); + parameters.push_back(std::move(ts)); +} + +DataType AlwaysGtTbigintTfloatLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysGtTbigintTfloatLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AlwaysGtTbigintTfloatLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysGtTbigintTfloatLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "AlwaysGtTbigintTfloatLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AlwaysGtTbigintTfloatLogicalFunction::getType() const { return NAME; } + +bool AlwaysGtTbigintTfloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AlwaysGtTbigintTfloatLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction AlwaysGtTbigintTfloatLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction AlwaysGtTbigintTfloatLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysGtTbigintTfloatLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "AlwaysGtTbigintTfloatLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return AlwaysGtTbigintTfloatLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysLeTbigintTbigintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysLeTbigintTbigintLogicalFunction.cpp new file mode 100644 index 0000000000..33641ce8e0 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysLeTbigintTbigintLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AlwaysLeTbigintTfloatLogicalFunction::AlwaysLeTbigintTfloatLogicalFunction(LogicalFunction value1, + LogicalFunction value2, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value1)); + parameters.push_back(std::move(value2)); + parameters.push_back(std::move(ts)); +} + +DataType AlwaysLeTbigintTfloatLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysLeTbigintTfloatLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AlwaysLeTbigintTfloatLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysLeTbigintTfloatLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "AlwaysLeTbigintTfloatLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AlwaysLeTbigintTfloatLogicalFunction::getType() const { return NAME; } + +bool AlwaysLeTbigintTfloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AlwaysLeTbigintTfloatLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction AlwaysLeTbigintTfloatLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction AlwaysLeTbigintTfloatLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysLeTbigintTfloatLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "AlwaysLeTbigintTfloatLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return AlwaysLeTbigintTfloatLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysLtTbigintTbigintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysLtTbigintTbigintLogicalFunction.cpp new file mode 100644 index 0000000000..38e012aebc --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysLtTbigintTbigintLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AlwaysLtTbigintTfloatLogicalFunction::AlwaysLtTbigintTfloatLogicalFunction(LogicalFunction value1, + LogicalFunction value2, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value1)); + parameters.push_back(std::move(value2)); + parameters.push_back(std::move(ts)); +} + +DataType AlwaysLtTbigintTfloatLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysLtTbigintTfloatLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AlwaysLtTbigintTfloatLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysLtTbigintTfloatLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "AlwaysLtTbigintTfloatLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AlwaysLtTbigintTfloatLogicalFunction::getType() const { return NAME; } + +bool AlwaysLtTbigintTfloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AlwaysLtTbigintTfloatLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction AlwaysLtTbigintTfloatLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction AlwaysLtTbigintTfloatLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysLtTbigintTfloatLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "AlwaysLtTbigintTfloatLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return AlwaysLtTbigintTfloatLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysNeTbigintTbigintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysNeTbigintTbigintLogicalFunction.cpp new file mode 100644 index 0000000000..9a9eda9b8d --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysNeTbigintTbigintLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AlwaysNeTbigintTfloatLogicalFunction::AlwaysNeTbigintTfloatLogicalFunction(LogicalFunction value1, + LogicalFunction value2, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value1)); + parameters.push_back(std::move(value2)); + parameters.push_back(std::move(ts)); +} + +DataType AlwaysNeTbigintTfloatLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysNeTbigintTfloatLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AlwaysNeTbigintTfloatLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysNeTbigintTfloatLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "AlwaysNeTbigintTfloatLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AlwaysNeTbigintTfloatLogicalFunction::getType() const { return NAME; } + +bool AlwaysNeTbigintTfloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AlwaysNeTbigintTfloatLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction AlwaysNeTbigintTfloatLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction AlwaysNeTbigintTfloatLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysNeTbigintTfloatLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "AlwaysNeTbigintTfloatLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return AlwaysNeTbigintTfloatLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt index 7b0c61ca48..ff6190bffd 100644 --- a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt @@ -142,3 +142,9 @@ add_plugin(EverGtTbigintTbigint LogicalFunction nes-logical-operators EverGtTbig add_plugin(EverLeTbigintTbigint LogicalFunction nes-logical-operators EverLeTbigintTbigintLogicalFunction.cpp) add_plugin(EverLtTbigintTbigint LogicalFunction nes-logical-operators EverLtTbigintTbigintLogicalFunction.cpp) add_plugin(EverNeTbigintTbigint LogicalFunction nes-logical-operators EverNeTbigintTbigintLogicalFunction.cpp) +add_plugin(AlwaysEqTbigintTbigint LogicalFunction nes-logical-operators AlwaysEqTbigintTbigintLogicalFunction.cpp) +add_plugin(AlwaysGeTbigintTbigint LogicalFunction nes-logical-operators AlwaysGeTbigintTbigintLogicalFunction.cpp) +add_plugin(AlwaysGtTbigintTbigint LogicalFunction nes-logical-operators AlwaysGtTbigintTbigintLogicalFunction.cpp) +add_plugin(AlwaysLeTbigintTbigint LogicalFunction nes-logical-operators AlwaysLeTbigintTbigintLogicalFunction.cpp) +add_plugin(AlwaysLtTbigintTbigint LogicalFunction nes-logical-operators AlwaysLtTbigintTbigintLogicalFunction.cpp) +add_plugin(AlwaysNeTbigintTbigint LogicalFunction nes-logical-operators AlwaysNeTbigintTbigintLogicalFunction.cpp) diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysEqTbigintTbigintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysEqTbigintTbigintPhysicalFunction.hpp new file mode 100644 index 0000000000..d03da809cf --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysEqTbigintTbigintPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `always_eq_tbigint_tfloat`. + * + * Per-event always_eq_tbigint_tfloat: tests if two single-instant tfloat values are ever equal. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class AlwaysEqTbigintTfloatPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysEqTbigintTfloatPhysicalFunction(PhysicalFunction value1Function, + PhysicalFunction value2Function, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysGeTbigintTbigintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysGeTbigintTbigintPhysicalFunction.hpp new file mode 100644 index 0000000000..8d166e1d18 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysGeTbigintTbigintPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `always_ge_tbigint_tfloat`. + * + * Per-event always_ge_tbigint_tfloat: tests if two single-instant tfloat values are ever greater or equal. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class AlwaysGeTbigintTfloatPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysGeTbigintTfloatPhysicalFunction(PhysicalFunction value1Function, + PhysicalFunction value2Function, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysGtTbigintTbigintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysGtTbigintTbigintPhysicalFunction.hpp new file mode 100644 index 0000000000..85322c8557 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysGtTbigintTbigintPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `always_gt_tbigint_tfloat`. + * + * Per-event always_gt_tbigint_tfloat: tests if two single-instant tfloat values are ever greater than. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class AlwaysGtTbigintTfloatPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysGtTbigintTfloatPhysicalFunction(PhysicalFunction value1Function, + PhysicalFunction value2Function, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysLeTbigintTbigintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysLeTbigintTbigintPhysicalFunction.hpp new file mode 100644 index 0000000000..bbaf3b2281 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysLeTbigintTbigintPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `always_le_tbigint_tfloat`. + * + * Per-event always_le_tbigint_tfloat: tests if two single-instant tfloat values are ever less or equal. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class AlwaysLeTbigintTfloatPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysLeTbigintTfloatPhysicalFunction(PhysicalFunction value1Function, + PhysicalFunction value2Function, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysLtTbigintTbigintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysLtTbigintTbigintPhysicalFunction.hpp new file mode 100644 index 0000000000..ce560fd1c2 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysLtTbigintTbigintPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `always_lt_tbigint_tfloat`. + * + * Per-event always_lt_tbigint_tfloat: tests if two single-instant tfloat values are ever less than. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class AlwaysLtTbigintTfloatPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysLtTbigintTfloatPhysicalFunction(PhysicalFunction value1Function, + PhysicalFunction value2Function, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysNeTbigintTbigintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysNeTbigintTbigintPhysicalFunction.hpp new file mode 100644 index 0000000000..acf3065538 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysNeTbigintTbigintPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `always_ne_tbigint_tfloat`. + * + * Per-event always_ne_tbigint_tfloat: tests if two single-instant tfloat values are ever not equal. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class AlwaysNeTbigintTfloatPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysNeTbigintTfloatPhysicalFunction(PhysicalFunction value1Function, + PhysicalFunction value2Function, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysEqTbigintTbigintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysEqTbigintTbigintPhysicalFunction.cpp new file mode 100644 index 0000000000..bf44057630 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysEqTbigintTbigintPhysicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +AlwaysEqTbigintTbigintPhysicalFunction::AlwaysEqTbigintTbigintPhysicalFunction(PhysicalFunction value1Function, + PhysicalFunction value2Function, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(value1Function)); + parameterFunctions.push_back(std::move(value2Function)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal AlwaysEqTbigintTbigintPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value1 = parameterValues[0].cast>(); + auto value2 = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double v1, double v2, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt1 = fmt::format("{}@{}", static_cast(v1), ts_str); + std::string wkt2 = fmt::format("{}@{}", static_cast(v2), ts_str); + Temporal* temp1 = tbigint_in(wkt1.c_str()); + if (!temp1) return 0.0; + Temporal* temp2 = tbigint_in(wkt2.c_str()); + if (!temp2) { free(temp1); return 0.0; } + int r = always_eq_tbigint_tbigint(temp1, temp2); + free(temp1); + free(temp2); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + value1, value2, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysEqTbigintTbigintPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "AlwaysEqTbigintTbigintPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return AlwaysEqTbigintTbigintPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysGeTbigintTbigintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysGeTbigintTbigintPhysicalFunction.cpp new file mode 100644 index 0000000000..f810dcceb8 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysGeTbigintTbigintPhysicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +AlwaysGeTbigintTbigintPhysicalFunction::AlwaysGeTbigintTbigintPhysicalFunction(PhysicalFunction value1Function, + PhysicalFunction value2Function, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(value1Function)); + parameterFunctions.push_back(std::move(value2Function)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal AlwaysGeTbigintTbigintPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value1 = parameterValues[0].cast>(); + auto value2 = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double v1, double v2, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt1 = fmt::format("{}@{}", static_cast(v1), ts_str); + std::string wkt2 = fmt::format("{}@{}", static_cast(v2), ts_str); + Temporal* temp1 = tbigint_in(wkt1.c_str()); + if (!temp1) return 0.0; + Temporal* temp2 = tbigint_in(wkt2.c_str()); + if (!temp2) { free(temp1); return 0.0; } + int r = always_ge_tbigint_tbigint(temp1, temp2); + free(temp1); + free(temp2); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + value1, value2, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysGeTbigintTbigintPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "AlwaysGeTbigintTbigintPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return AlwaysGeTbigintTbigintPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysGtTbigintTbigintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysGtTbigintTbigintPhysicalFunction.cpp new file mode 100644 index 0000000000..06b7e7ee23 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysGtTbigintTbigintPhysicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +AlwaysGtTbigintTbigintPhysicalFunction::AlwaysGtTbigintTbigintPhysicalFunction(PhysicalFunction value1Function, + PhysicalFunction value2Function, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(value1Function)); + parameterFunctions.push_back(std::move(value2Function)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal AlwaysGtTbigintTbigintPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value1 = parameterValues[0].cast>(); + auto value2 = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double v1, double v2, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt1 = fmt::format("{}@{}", static_cast(v1), ts_str); + std::string wkt2 = fmt::format("{}@{}", static_cast(v2), ts_str); + Temporal* temp1 = tbigint_in(wkt1.c_str()); + if (!temp1) return 0.0; + Temporal* temp2 = tbigint_in(wkt2.c_str()); + if (!temp2) { free(temp1); return 0.0; } + int r = always_gt_tbigint_tbigint(temp1, temp2); + free(temp1); + free(temp2); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + value1, value2, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysGtTbigintTbigintPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "AlwaysGtTbigintTbigintPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return AlwaysGtTbigintTbigintPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysLeTbigintTbigintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysLeTbigintTbigintPhysicalFunction.cpp new file mode 100644 index 0000000000..d2cb50c242 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysLeTbigintTbigintPhysicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +AlwaysLeTbigintTbigintPhysicalFunction::AlwaysLeTbigintTbigintPhysicalFunction(PhysicalFunction value1Function, + PhysicalFunction value2Function, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(value1Function)); + parameterFunctions.push_back(std::move(value2Function)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal AlwaysLeTbigintTbigintPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value1 = parameterValues[0].cast>(); + auto value2 = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double v1, double v2, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt1 = fmt::format("{}@{}", static_cast(v1), ts_str); + std::string wkt2 = fmt::format("{}@{}", static_cast(v2), ts_str); + Temporal* temp1 = tbigint_in(wkt1.c_str()); + if (!temp1) return 0.0; + Temporal* temp2 = tbigint_in(wkt2.c_str()); + if (!temp2) { free(temp1); return 0.0; } + int r = always_le_tbigint_tbigint(temp1, temp2); + free(temp1); + free(temp2); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + value1, value2, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysLeTbigintTbigintPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "AlwaysLeTbigintTbigintPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return AlwaysLeTbigintTbigintPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysLtTbigintTbigintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysLtTbigintTbigintPhysicalFunction.cpp new file mode 100644 index 0000000000..6c704c5f0b --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysLtTbigintTbigintPhysicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +AlwaysLtTbigintTbigintPhysicalFunction::AlwaysLtTbigintTbigintPhysicalFunction(PhysicalFunction value1Function, + PhysicalFunction value2Function, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(value1Function)); + parameterFunctions.push_back(std::move(value2Function)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal AlwaysLtTbigintTbigintPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value1 = parameterValues[0].cast>(); + auto value2 = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double v1, double v2, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt1 = fmt::format("{}@{}", static_cast(v1), ts_str); + std::string wkt2 = fmt::format("{}@{}", static_cast(v2), ts_str); + Temporal* temp1 = tbigint_in(wkt1.c_str()); + if (!temp1) return 0.0; + Temporal* temp2 = tbigint_in(wkt2.c_str()); + if (!temp2) { free(temp1); return 0.0; } + int r = always_lt_tbigint_tbigint(temp1, temp2); + free(temp1); + free(temp2); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + value1, value2, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysLtTbigintTbigintPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "AlwaysLtTbigintTbigintPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return AlwaysLtTbigintTbigintPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysNeTbigintTbigintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysNeTbigintTbigintPhysicalFunction.cpp new file mode 100644 index 0000000000..1ea159194d --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysNeTbigintTbigintPhysicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +AlwaysNeTbigintTbigintPhysicalFunction::AlwaysNeTbigintTbigintPhysicalFunction(PhysicalFunction value1Function, + PhysicalFunction value2Function, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(value1Function)); + parameterFunctions.push_back(std::move(value2Function)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal AlwaysNeTbigintTbigintPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value1 = parameterValues[0].cast>(); + auto value2 = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double v1, double v2, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt1 = fmt::format("{}@{}", static_cast(v1), ts_str); + std::string wkt2 = fmt::format("{}@{}", static_cast(v2), ts_str); + Temporal* temp1 = tbigint_in(wkt1.c_str()); + if (!temp1) return 0.0; + Temporal* temp2 = tbigint_in(wkt2.c_str()); + if (!temp2) { free(temp1); return 0.0; } + int r = always_ne_tbigint_tbigint(temp1, temp2); + free(temp1); + free(temp2); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + value1, value2, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysNeTbigintTbigintPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "AlwaysNeTbigintTbigintPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return AlwaysNeTbigintTbigintPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt index 1b06243f9f..1bd1c2eae2 100644 --- a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt @@ -141,4 +141,10 @@ add_plugin(EverGtTbigintTbigint PhysicalFunction nes-physical-operators EverGtTb add_plugin(EverLeTbigintTbigint PhysicalFunction nes-physical-operators EverLeTbigintTbigintPhysicalFunction.cpp) add_plugin(EverLtTbigintTbigint PhysicalFunction nes-physical-operators EverLtTbigintTbigintPhysicalFunction.cpp) add_plugin(EverNeTbigintTbigint PhysicalFunction nes-physical-operators EverNeTbigintTbigintPhysicalFunction.cpp) +add_plugin(AlwaysEqTbigintTbigint PhysicalFunction nes-physical-operators AlwaysEqTbigintTbigintPhysicalFunction.cpp) +add_plugin(AlwaysGeTbigintTbigint PhysicalFunction nes-physical-operators AlwaysGeTbigintTbigintPhysicalFunction.cpp) +add_plugin(AlwaysGtTbigintTbigint PhysicalFunction nes-physical-operators AlwaysGtTbigintTbigintPhysicalFunction.cpp) +add_plugin(AlwaysLeTbigintTbigint PhysicalFunction nes-physical-operators AlwaysLeTbigintTbigintPhysicalFunction.cpp) +add_plugin(AlwaysLtTbigintTbigint PhysicalFunction nes-physical-operators AlwaysLtTbigintTbigintPhysicalFunction.cpp) +add_plugin(AlwaysNeTbigintTbigint PhysicalFunction nes-physical-operators AlwaysNeTbigintTbigintPhysicalFunction.cpp) endif() diff --git a/nes-sql-parser/AntlrSQL.g4 b/nes-sql-parser/AntlrSQL.g4 index f7183b330e..e445bb7205 100644 --- a/nes-sql-parser/AntlrSQL.g4 +++ b/nes-sql-parser/AntlrSQL.g4 @@ -295,7 +295,7 @@ timeUnit: MS timestampParameter: name=identifier; -functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS; +functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS; sinkClause: INTO sink (',' sink)*; @@ -492,6 +492,12 @@ ALWAYS_GT_TBIGINT_BIGINT: 'ALWAYS_GT_TBIGINT_BIGINT' | 'always_gt_tbigint_bigint ALWAYS_LE_TBIGINT_BIGINT: 'ALWAYS_LE_TBIGINT_BIGINT' | 'always_le_tbigint_bigint'; ALWAYS_LT_TBIGINT_BIGINT: 'ALWAYS_LT_TBIGINT_BIGINT' | 'always_lt_tbigint_bigint'; ALWAYS_NE_TBIGINT_BIGINT: 'ALWAYS_NE_TBIGINT_BIGINT' | 'always_ne_tbigint_bigint'; +ALWAYS_EQ_TBIGINT_TBIGINT: 'ALWAYS_EQ_TBIGINT_TBIGINT' | 'always_eq_tbigint_tbigint'; +ALWAYS_GE_TBIGINT_TBIGINT: 'ALWAYS_GE_TBIGINT_TBIGINT' | 'always_ge_tbigint_tbigint'; +ALWAYS_GT_TBIGINT_TBIGINT: 'ALWAYS_GT_TBIGINT_TBIGINT' | 'always_gt_tbigint_tbigint'; +ALWAYS_LE_TBIGINT_TBIGINT: 'ALWAYS_LE_TBIGINT_TBIGINT' | 'always_le_tbigint_tbigint'; +ALWAYS_LT_TBIGINT_TBIGINT: 'ALWAYS_LT_TBIGINT_TBIGINT' | 'always_lt_tbigint_tbigint'; +ALWAYS_NE_TBIGINT_TBIGINT: 'ALWAYS_NE_TBIGINT_TBIGINT' | 'always_ne_tbigint_tbigint'; ALWAYS_EQ_TFLOAT_FLOAT: 'ALWAYS_EQ_TFLOAT_FLOAT' | 'always_eq_tfloat_float'; ALWAYS_GE_TFLOAT_FLOAT: 'ALWAYS_GE_TFLOAT_FLOAT' | 'always_ge_tfloat_float'; ALWAYS_GT_TFLOAT_FLOAT: 'ALWAYS_GT_TFLOAT_FLOAT' | 'always_gt_tfloat_float'; diff --git a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp index fec51869a0..1c1b52c852 100644 --- a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp +++ b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp @@ -139,6 +139,12 @@ #include #include #include +#include +#include +#include +#include +#include +#include #include #include #include @@ -4546,6 +4552,180 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont } break; /* END CODEGEN PARSER GLUE: ALWAYS_NE_TBIGINT_BIGINT */ + /* BEGIN CODEGEN PARSER GLUE: ALWAYS_EQ_TBIGINT_TBIGINT */ + case AntlrSQLLexer::ALWAYS_EQ_TBIGINT_TBIGINT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("ALWAYS_EQ_TBIGINT_TBIGINT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AlwaysEqTbigintTbigintLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: ALWAYS_EQ_TBIGINT_TBIGINT */ + /* BEGIN CODEGEN PARSER GLUE: ALWAYS_GE_TBIGINT_TBIGINT */ + case AntlrSQLLexer::ALWAYS_GE_TBIGINT_TBIGINT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("ALWAYS_GE_TBIGINT_TBIGINT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AlwaysGeTbigintTbigintLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: ALWAYS_GE_TBIGINT_TBIGINT */ + /* BEGIN CODEGEN PARSER GLUE: ALWAYS_GT_TBIGINT_TBIGINT */ + case AntlrSQLLexer::ALWAYS_GT_TBIGINT_TBIGINT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("ALWAYS_GT_TBIGINT_TBIGINT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AlwaysGtTbigintTbigintLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: ALWAYS_GT_TBIGINT_TBIGINT */ + /* BEGIN CODEGEN PARSER GLUE: ALWAYS_LE_TBIGINT_TBIGINT */ + case AntlrSQLLexer::ALWAYS_LE_TBIGINT_TBIGINT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("ALWAYS_LE_TBIGINT_TBIGINT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AlwaysLeTbigintTbigintLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: ALWAYS_LE_TBIGINT_TBIGINT */ + /* BEGIN CODEGEN PARSER GLUE: ALWAYS_LT_TBIGINT_TBIGINT */ + case AntlrSQLLexer::ALWAYS_LT_TBIGINT_TBIGINT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("ALWAYS_LT_TBIGINT_TBIGINT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AlwaysLtTbigintTbigintLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: ALWAYS_LT_TBIGINT_TBIGINT */ + /* BEGIN CODEGEN PARSER GLUE: ALWAYS_NE_TBIGINT_TBIGINT */ + case AntlrSQLLexer::ALWAYS_NE_TBIGINT_TBIGINT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("ALWAYS_NE_TBIGINT_TBIGINT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AlwaysNeTbigintTbigintLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: ALWAYS_NE_TBIGINT_TBIGINT */ /* BEGIN CODEGEN PARSER GLUE: ALWAYS_EQ_TFLOAT_FLOAT */ case AntlrSQLLexer::ALWAYS_EQ_TFLOAT_FLOAT: { From 9b2ef756318ee5a614b55824dd7328eda370f883 Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Fri, 12 Jun 2026 10:14:02 +0200 Subject: [PATCH 31/96] feat(meos): add EVER/ALWAYS_EQ/GE/GT/LE/LT/NE reversed scalar NES operators (W73-W78) Adds 36 per-event NES operators for the reversed-argument scalar comparisons: EVER_{EQ,GE,GT,LE,LT,NE}_{FLOAT_TFLOAT,INT_TINT,BIGINT_TBIGINT} (W73/W75/W77) and ALWAYS_{EQ,GE,GT,LE,LT,NE}_{FLOAT_TFLOAT,INT_TINT,BIGINT_TBIGINT} (W74/W76/W78). Each 3-arg operator takes (scalar, temporal_value, ts:UINT64), builds a single-instant temporal from args 1-2, and calls the MEOS reversed-form function (e.g. ever_eq_float_tfloat(double, Temporal*)) with the scalar as the first argument. Wired across all five locations: logical/physical CMakeLists, AntlrSQL.g4 functionName rule and lexer section, and AntlrSQLQueryPlanCreator.cpp includes and case blocks. --- .../AlwaysEqBigintTbigintLogicalFunction.hpp | 54 + .../AlwaysEqFloatTfloatLogicalFunction.hpp | 54 + .../Meos/AlwaysEqIntTintLogicalFunction.hpp | 54 + .../AlwaysGeBigintTbigintLogicalFunction.hpp | 54 + .../AlwaysGeFloatTfloatLogicalFunction.hpp | 54 + .../Meos/AlwaysGeIntTintLogicalFunction.hpp | 54 + .../AlwaysGtBigintTbigintLogicalFunction.hpp | 54 + .../AlwaysGtFloatTfloatLogicalFunction.hpp | 54 + .../Meos/AlwaysGtIntTintLogicalFunction.hpp | 54 + .../AlwaysLeBigintTbigintLogicalFunction.hpp | 54 + .../AlwaysLeFloatTfloatLogicalFunction.hpp | 54 + .../Meos/AlwaysLeIntTintLogicalFunction.hpp | 54 + .../AlwaysLtBigintTbigintLogicalFunction.hpp | 54 + .../AlwaysLtFloatTfloatLogicalFunction.hpp | 54 + .../Meos/AlwaysLtIntTintLogicalFunction.hpp | 54 + .../AlwaysNeBigintTbigintLogicalFunction.hpp | 54 + .../AlwaysNeFloatTfloatLogicalFunction.hpp | 54 + .../Meos/AlwaysNeIntTintLogicalFunction.hpp | 54 + .../EverEqBigintTbigintLogicalFunction.hpp | 54 + .../Meos/EverEqFloatTfloatLogicalFunction.hpp | 54 + .../Meos/EverEqIntTintLogicalFunction.hpp | 54 + .../EverGeBigintTbigintLogicalFunction.hpp | 54 + .../Meos/EverGeFloatTfloatLogicalFunction.hpp | 54 + .../Meos/EverGeIntTintLogicalFunction.hpp | 54 + .../EverGtBigintTbigintLogicalFunction.hpp | 54 + .../Meos/EverGtFloatTfloatLogicalFunction.hpp | 54 + .../Meos/EverGtIntTintLogicalFunction.hpp | 54 + .../EverLeBigintTbigintLogicalFunction.hpp | 54 + .../Meos/EverLeFloatTfloatLogicalFunction.hpp | 54 + .../Meos/EverLeIntTintLogicalFunction.hpp | 54 + .../EverLtBigintTbigintLogicalFunction.hpp | 54 + .../Meos/EverLtFloatTfloatLogicalFunction.hpp | 54 + .../Meos/EverLtIntTintLogicalFunction.hpp | 54 + .../EverNeBigintTbigintLogicalFunction.hpp | 54 + .../Meos/EverNeFloatTfloatLogicalFunction.hpp | 54 + .../Meos/EverNeIntTintLogicalFunction.hpp | 54 + .../AlwaysEqBigintTbigintLogicalFunction.cpp | 105 ++ .../AlwaysEqFloatTfloatLogicalFunction.cpp | 105 ++ .../Meos/AlwaysEqIntTintLogicalFunction.cpp | 105 ++ .../AlwaysGeBigintTbigintLogicalFunction.cpp | 105 ++ .../AlwaysGeFloatTfloatLogicalFunction.cpp | 105 ++ .../Meos/AlwaysGeIntTintLogicalFunction.cpp | 105 ++ .../AlwaysGtBigintTbigintLogicalFunction.cpp | 105 ++ .../AlwaysGtFloatTfloatLogicalFunction.cpp | 105 ++ .../Meos/AlwaysGtIntTintLogicalFunction.cpp | 105 ++ .../AlwaysLeBigintTbigintLogicalFunction.cpp | 105 ++ .../AlwaysLeFloatTfloatLogicalFunction.cpp | 105 ++ .../Meos/AlwaysLeIntTintLogicalFunction.cpp | 105 ++ .../AlwaysLtBigintTbigintLogicalFunction.cpp | 105 ++ .../AlwaysLtFloatTfloatLogicalFunction.cpp | 105 ++ .../Meos/AlwaysLtIntTintLogicalFunction.cpp | 105 ++ .../AlwaysNeBigintTbigintLogicalFunction.cpp | 105 ++ .../AlwaysNeFloatTfloatLogicalFunction.cpp | 105 ++ .../Meos/AlwaysNeIntTintLogicalFunction.cpp | 105 ++ .../src/Functions/Meos/CMakeLists.txt | 36 + .../EverEqBigintTbigintLogicalFunction.cpp | 105 ++ .../Meos/EverEqFloatTfloatLogicalFunction.cpp | 105 ++ .../Meos/EverEqIntTintLogicalFunction.cpp | 105 ++ .../EverGeBigintTbigintLogicalFunction.cpp | 105 ++ .../Meos/EverGeFloatTfloatLogicalFunction.cpp | 105 ++ .../Meos/EverGeIntTintLogicalFunction.cpp | 105 ++ .../EverGtBigintTbigintLogicalFunction.cpp | 105 ++ .../Meos/EverGtFloatTfloatLogicalFunction.cpp | 105 ++ .../Meos/EverGtIntTintLogicalFunction.cpp | 105 ++ .../EverLeBigintTbigintLogicalFunction.cpp | 105 ++ .../Meos/EverLeFloatTfloatLogicalFunction.cpp | 105 ++ .../Meos/EverLeIntTintLogicalFunction.cpp | 105 ++ .../EverLtBigintTbigintLogicalFunction.cpp | 105 ++ .../Meos/EverLtFloatTfloatLogicalFunction.cpp | 105 ++ .../Meos/EverLtIntTintLogicalFunction.cpp | 105 ++ .../EverNeBigintTbigintLogicalFunction.cpp | 105 ++ .../Meos/EverNeFloatTfloatLogicalFunction.cpp | 105 ++ .../Meos/EverNeIntTintLogicalFunction.cpp | 105 ++ .../AlwaysEqBigintTbigintPhysicalFunction.hpp | 43 + .../AlwaysEqFloatTfloatPhysicalFunction.hpp | 43 + .../Meos/AlwaysEqIntTintPhysicalFunction.hpp | 43 + .../AlwaysGeBigintTbigintPhysicalFunction.hpp | 43 + .../AlwaysGeFloatTfloatPhysicalFunction.hpp | 43 + .../Meos/AlwaysGeIntTintPhysicalFunction.hpp | 43 + .../AlwaysGtBigintTbigintPhysicalFunction.hpp | 43 + .../AlwaysGtFloatTfloatPhysicalFunction.hpp | 43 + .../Meos/AlwaysGtIntTintPhysicalFunction.hpp | 43 + .../AlwaysLeBigintTbigintPhysicalFunction.hpp | 43 + .../AlwaysLeFloatTfloatPhysicalFunction.hpp | 43 + .../Meos/AlwaysLeIntTintPhysicalFunction.hpp | 43 + .../AlwaysLtBigintTbigintPhysicalFunction.hpp | 43 + .../AlwaysLtFloatTfloatPhysicalFunction.hpp | 43 + .../Meos/AlwaysLtIntTintPhysicalFunction.hpp | 43 + .../AlwaysNeBigintTbigintPhysicalFunction.hpp | 43 + .../AlwaysNeFloatTfloatPhysicalFunction.hpp | 43 + .../Meos/AlwaysNeIntTintPhysicalFunction.hpp | 43 + .../EverEqBigintTbigintPhysicalFunction.hpp | 43 + .../EverEqFloatTfloatPhysicalFunction.hpp | 43 + .../Meos/EverEqIntTintPhysicalFunction.hpp | 43 + .../EverGeBigintTbigintPhysicalFunction.hpp | 43 + .../EverGeFloatTfloatPhysicalFunction.hpp | 43 + .../Meos/EverGeIntTintPhysicalFunction.hpp | 43 + .../EverGtBigintTbigintPhysicalFunction.hpp | 43 + .../EverGtFloatTfloatPhysicalFunction.hpp | 43 + .../Meos/EverGtIntTintPhysicalFunction.hpp | 43 + .../EverLeBigintTbigintPhysicalFunction.hpp | 43 + .../EverLeFloatTfloatPhysicalFunction.hpp | 43 + .../Meos/EverLeIntTintPhysicalFunction.hpp | 43 + .../EverLtBigintTbigintPhysicalFunction.hpp | 43 + .../EverLtFloatTfloatPhysicalFunction.hpp | 43 + .../Meos/EverLtIntTintPhysicalFunction.hpp | 43 + .../EverNeBigintTbigintPhysicalFunction.hpp | 43 + .../EverNeFloatTfloatPhysicalFunction.hpp | 43 + .../Meos/EverNeIntTintPhysicalFunction.hpp | 43 + .../AlwaysEqBigintTbigintPhysicalFunction.cpp | 89 ++ .../AlwaysEqFloatTfloatPhysicalFunction.cpp | 89 ++ .../Meos/AlwaysEqIntTintPhysicalFunction.cpp | 89 ++ .../AlwaysGeBigintTbigintPhysicalFunction.cpp | 89 ++ .../AlwaysGeFloatTfloatPhysicalFunction.cpp | 89 ++ .../Meos/AlwaysGeIntTintPhysicalFunction.cpp | 89 ++ .../AlwaysGtBigintTbigintPhysicalFunction.cpp | 89 ++ .../AlwaysGtFloatTfloatPhysicalFunction.cpp | 89 ++ .../Meos/AlwaysGtIntTintPhysicalFunction.cpp | 89 ++ .../AlwaysLeBigintTbigintPhysicalFunction.cpp | 89 ++ .../AlwaysLeFloatTfloatPhysicalFunction.cpp | 89 ++ .../Meos/AlwaysLeIntTintPhysicalFunction.cpp | 89 ++ .../AlwaysLtBigintTbigintPhysicalFunction.cpp | 89 ++ .../AlwaysLtFloatTfloatPhysicalFunction.cpp | 89 ++ .../Meos/AlwaysLtIntTintPhysicalFunction.cpp | 89 ++ .../AlwaysNeBigintTbigintPhysicalFunction.cpp | 89 ++ .../AlwaysNeFloatTfloatPhysicalFunction.cpp | 89 ++ .../Meos/AlwaysNeIntTintPhysicalFunction.cpp | 89 ++ .../src/Functions/Meos/CMakeLists.txt | 36 + .../EverEqBigintTbigintPhysicalFunction.cpp | 89 ++ .../EverEqFloatTfloatPhysicalFunction.cpp | 89 ++ .../Meos/EverEqIntTintPhysicalFunction.cpp | 89 ++ .../EverGeBigintTbigintPhysicalFunction.cpp | 89 ++ .../EverGeFloatTfloatPhysicalFunction.cpp | 89 ++ .../Meos/EverGeIntTintPhysicalFunction.cpp | 89 ++ .../EverGtBigintTbigintPhysicalFunction.cpp | 89 ++ .../EverGtFloatTfloatPhysicalFunction.cpp | 89 ++ .../Meos/EverGtIntTintPhysicalFunction.cpp | 89 ++ .../EverLeBigintTbigintPhysicalFunction.cpp | 89 ++ .../EverLeFloatTfloatPhysicalFunction.cpp | 89 ++ .../Meos/EverLeIntTintPhysicalFunction.cpp | 89 ++ .../EverLtBigintTbigintPhysicalFunction.cpp | 89 ++ .../EverLtFloatTfloatPhysicalFunction.cpp | 89 ++ .../Meos/EverLtIntTintPhysicalFunction.cpp | 89 ++ .../EverNeBigintTbigintPhysicalFunction.cpp | 89 ++ .../EverNeFloatTfloatPhysicalFunction.cpp | 89 ++ .../Meos/EverNeIntTintPhysicalFunction.cpp | 89 ++ nes-sql-parser/AntlrSQL.g4 | 38 +- .../src/AntlrSQLQueryPlanCreator.cpp | 1110 ++++++++++++++++- 148 files changed, 11680 insertions(+), 16 deletions(-) create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysEqBigintTbigintLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysEqFloatTfloatLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysEqIntTintLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysGeBigintTbigintLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysGeFloatTfloatLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysGeIntTintLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysGtBigintTbigintLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysGtFloatTfloatLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysGtIntTintLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysLeBigintTbigintLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysLeFloatTfloatLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysLeIntTintLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysLtBigintTbigintLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysLtFloatTfloatLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysLtIntTintLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysNeBigintTbigintLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysNeFloatTfloatLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysNeIntTintLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverEqBigintTbigintLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverEqFloatTfloatLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverEqIntTintLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverGeBigintTbigintLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverGeFloatTfloatLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverGeIntTintLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverGtBigintTbigintLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverGtFloatTfloatLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverGtIntTintLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverLeBigintTbigintLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverLeFloatTfloatLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverLeIntTintLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverLtBigintTbigintLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverLtFloatTfloatLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverLtIntTintLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverNeBigintTbigintLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverNeFloatTfloatLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverNeIntTintLogicalFunction.hpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysEqBigintTbigintLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysEqFloatTfloatLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysEqIntTintLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysGeBigintTbigintLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysGeFloatTfloatLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysGeIntTintLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysGtBigintTbigintLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysGtFloatTfloatLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysGtIntTintLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysLeBigintTbigintLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysLeFloatTfloatLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysLeIntTintLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysLtBigintTbigintLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysLtFloatTfloatLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysLtIntTintLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysNeBigintTbigintLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysNeFloatTfloatLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysNeIntTintLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverEqBigintTbigintLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverEqFloatTfloatLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverEqIntTintLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverGeBigintTbigintLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverGeFloatTfloatLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverGeIntTintLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverGtBigintTbigintLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverGtFloatTfloatLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverGtIntTintLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverLeBigintTbigintLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverLeFloatTfloatLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverLeIntTintLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverLtBigintTbigintLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverLtFloatTfloatLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverLtIntTintLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverNeBigintTbigintLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverNeFloatTfloatLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverNeIntTintLogicalFunction.cpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysEqBigintTbigintPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysEqFloatTfloatPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysEqIntTintPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysGeBigintTbigintPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysGeFloatTfloatPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysGeIntTintPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysGtBigintTbigintPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysGtFloatTfloatPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysGtIntTintPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysLeBigintTbigintPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysLeFloatTfloatPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysLeIntTintPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysLtBigintTbigintPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysLtFloatTfloatPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysLtIntTintPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysNeBigintTbigintPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysNeFloatTfloatPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysNeIntTintPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverEqBigintTbigintPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverEqFloatTfloatPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverEqIntTintPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverGeBigintTbigintPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverGeFloatTfloatPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverGeIntTintPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverGtBigintTbigintPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverGtFloatTfloatPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverGtIntTintPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverLeBigintTbigintPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverLeFloatTfloatPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverLeIntTintPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverLtBigintTbigintPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverLtFloatTfloatPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverLtIntTintPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverNeBigintTbigintPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverNeFloatTfloatPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverNeIntTintPhysicalFunction.hpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysEqBigintTbigintPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysEqFloatTfloatPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysEqIntTintPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysGeBigintTbigintPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysGeFloatTfloatPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysGeIntTintPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysGtBigintTbigintPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysGtFloatTfloatPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysGtIntTintPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysLeBigintTbigintPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysLeFloatTfloatPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysLeIntTintPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysLtBigintTbigintPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysLtFloatTfloatPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysLtIntTintPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysNeBigintTbigintPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysNeFloatTfloatPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysNeIntTintPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverEqBigintTbigintPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverEqFloatTfloatPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverEqIntTintPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverGeBigintTbigintPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverGeFloatTfloatPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverGeIntTintPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverGtBigintTbigintPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverGtFloatTfloatPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverGtIntTintPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverLeBigintTbigintPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverLeFloatTfloatPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverLeIntTintPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverLtBigintTbigintPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverLtFloatTfloatPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverLtIntTintPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverNeBigintTbigintPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverNeFloatTfloatPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverNeIntTintPhysicalFunction.cpp diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysEqBigintTbigintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysEqBigintTbigintLogicalFunction.hpp new file mode 100644 index 0000000000..c913c19a88 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysEqBigintTbigintLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event always_eq_bigint_tbigint: tests if a single-instant tfloat value ever equals a threshold. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `always_eq_bigint_tbigint`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class AlwaysEqBigintTbigintLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysEqBigintTbigint"; + + AlwaysEqBigintTbigintLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysEqFloatTfloatLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysEqFloatTfloatLogicalFunction.hpp new file mode 100644 index 0000000000..04d802d4a6 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysEqFloatTfloatLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event always_eq_float_tfloat: tests if a scalar is ever eq to a single-instant tfloat value. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `always_eq_float_tfloat`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class AlwaysEqFloatTfloatLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysEqFloatTfloat"; + + AlwaysEqFloatTfloatLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysEqIntTintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysEqIntTintLogicalFunction.hpp new file mode 100644 index 0000000000..4dce2e23c9 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysEqIntTintLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event always_eq_int_tint: tests if a single-instant tfloat value ever equals a threshold. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `always_eq_int_tint`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class AlwaysEqIntTintLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysEqIntTint"; + + AlwaysEqIntTintLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysGeBigintTbigintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysGeBigintTbigintLogicalFunction.hpp new file mode 100644 index 0000000000..50be02fa7d --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysGeBigintTbigintLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event always_ge_bigint_tbigint: tests if a single-instant tfloat value ever equals a threshold. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `always_ge_bigint_tbigint`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class AlwaysGeBigintTbigintLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysGeBigintTbigint"; + + AlwaysGeBigintTbigintLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysGeFloatTfloatLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysGeFloatTfloatLogicalFunction.hpp new file mode 100644 index 0000000000..d4487cbe9d --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysGeFloatTfloatLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event always_ge_float_tfloat: tests if a scalar is ever ge to a single-instant tfloat value. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `always_ge_float_tfloat`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class AlwaysGeFloatTfloatLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysGeFloatTfloat"; + + AlwaysGeFloatTfloatLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysGeIntTintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysGeIntTintLogicalFunction.hpp new file mode 100644 index 0000000000..b235a0d3e9 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysGeIntTintLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event always_ge_int_tint: tests if a single-instant tfloat value ever equals a threshold. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `always_ge_int_tint`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class AlwaysGeIntTintLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysGeIntTint"; + + AlwaysGeIntTintLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysGtBigintTbigintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysGtBigintTbigintLogicalFunction.hpp new file mode 100644 index 0000000000..8a13220e59 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysGtBigintTbigintLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event always_gt_bigint_tbigint: tests if a single-instant tfloat value ever equals a threshold. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `always_gt_bigint_tbigint`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class AlwaysGtBigintTbigintLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysGtBigintTbigint"; + + AlwaysGtBigintTbigintLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysGtFloatTfloatLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysGtFloatTfloatLogicalFunction.hpp new file mode 100644 index 0000000000..486b70ae14 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysGtFloatTfloatLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event always_gt_float_tfloat: tests if a scalar is ever gt to a single-instant tfloat value. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `always_gt_float_tfloat`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class AlwaysGtFloatTfloatLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysGtFloatTfloat"; + + AlwaysGtFloatTfloatLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysGtIntTintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysGtIntTintLogicalFunction.hpp new file mode 100644 index 0000000000..889d38e00d --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysGtIntTintLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event always_gt_int_tint: tests if a single-instant tfloat value ever equals a threshold. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `always_gt_int_tint`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class AlwaysGtIntTintLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysGtIntTint"; + + AlwaysGtIntTintLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysLeBigintTbigintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysLeBigintTbigintLogicalFunction.hpp new file mode 100644 index 0000000000..de67cd5e6b --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysLeBigintTbigintLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event always_le_bigint_tbigint: tests if a single-instant tfloat value ever equals a threshold. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `always_le_bigint_tbigint`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class AlwaysLeBigintTbigintLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysLeBigintTbigint"; + + AlwaysLeBigintTbigintLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysLeFloatTfloatLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysLeFloatTfloatLogicalFunction.hpp new file mode 100644 index 0000000000..8eb944e4e6 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysLeFloatTfloatLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event always_le_float_tfloat: tests if a scalar is ever le to a single-instant tfloat value. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `always_le_float_tfloat`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class AlwaysLeFloatTfloatLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysLeFloatTfloat"; + + AlwaysLeFloatTfloatLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysLeIntTintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysLeIntTintLogicalFunction.hpp new file mode 100644 index 0000000000..9f58bb96b8 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysLeIntTintLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event always_le_int_tint: tests if a single-instant tfloat value ever equals a threshold. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `always_le_int_tint`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class AlwaysLeIntTintLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysLeIntTint"; + + AlwaysLeIntTintLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysLtBigintTbigintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysLtBigintTbigintLogicalFunction.hpp new file mode 100644 index 0000000000..890638fcd1 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysLtBigintTbigintLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event always_lt_bigint_tbigint: tests if a single-instant tfloat value ever equals a threshold. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `always_lt_bigint_tbigint`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class AlwaysLtBigintTbigintLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysLtBigintTbigint"; + + AlwaysLtBigintTbigintLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysLtFloatTfloatLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysLtFloatTfloatLogicalFunction.hpp new file mode 100644 index 0000000000..295b78e104 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysLtFloatTfloatLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event always_lt_float_tfloat: tests if a scalar is ever lt to a single-instant tfloat value. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `always_lt_float_tfloat`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class AlwaysLtFloatTfloatLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysLtFloatTfloat"; + + AlwaysLtFloatTfloatLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysLtIntTintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysLtIntTintLogicalFunction.hpp new file mode 100644 index 0000000000..df9002deea --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysLtIntTintLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event always_lt_int_tint: tests if a single-instant tfloat value ever equals a threshold. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `always_lt_int_tint`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class AlwaysLtIntTintLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysLtIntTint"; + + AlwaysLtIntTintLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysNeBigintTbigintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysNeBigintTbigintLogicalFunction.hpp new file mode 100644 index 0000000000..d869e96888 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysNeBigintTbigintLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event always_ne_bigint_tbigint: tests if a single-instant tfloat value ever equals a threshold. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `always_ne_bigint_tbigint`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class AlwaysNeBigintTbigintLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysNeBigintTbigint"; + + AlwaysNeBigintTbigintLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysNeFloatTfloatLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysNeFloatTfloatLogicalFunction.hpp new file mode 100644 index 0000000000..320d55e6fe --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysNeFloatTfloatLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event always_ne_float_tfloat: tests if a scalar is ever ne to a single-instant tfloat value. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `always_ne_float_tfloat`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class AlwaysNeFloatTfloatLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysNeFloatTfloat"; + + AlwaysNeFloatTfloatLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysNeIntTintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysNeIntTintLogicalFunction.hpp new file mode 100644 index 0000000000..facc26191c --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysNeIntTintLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event always_ne_int_tint: tests if a single-instant tfloat value ever equals a threshold. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `always_ne_int_tint`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class AlwaysNeIntTintLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysNeIntTint"; + + AlwaysNeIntTintLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverEqBigintTbigintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverEqBigintTbigintLogicalFunction.hpp new file mode 100644 index 0000000000..efae7f8ca1 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverEqBigintTbigintLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event ever_eq_bigint_tbigint: tests if a single-instant tfloat value ever equals a threshold. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ever_eq_bigint_tbigint`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class EverEqBigintTbigintLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverEqBigintTbigint"; + + EverEqBigintTbigintLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverEqFloatTfloatLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverEqFloatTfloatLogicalFunction.hpp new file mode 100644 index 0000000000..4666607d03 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverEqFloatTfloatLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event ever_eq_float_tfloat: tests if a scalar is ever eq to a single-instant tfloat value. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ever_eq_float_tfloat`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class EverEqFloatTfloatLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverEqFloatTfloat"; + + EverEqFloatTfloatLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverEqIntTintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverEqIntTintLogicalFunction.hpp new file mode 100644 index 0000000000..23b5a3ff73 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverEqIntTintLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event ever_eq_int_tint: tests if a single-instant tfloat value ever equals a threshold. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ever_eq_int_tint`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class EverEqIntTintLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverEqIntTint"; + + EverEqIntTintLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverGeBigintTbigintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverGeBigintTbigintLogicalFunction.hpp new file mode 100644 index 0000000000..a6958eeea1 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverGeBigintTbigintLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event ever_ge_bigint_tbigint: tests if a single-instant tfloat value ever equals a threshold. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ever_ge_bigint_tbigint`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class EverGeBigintTbigintLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverGeBigintTbigint"; + + EverGeBigintTbigintLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverGeFloatTfloatLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverGeFloatTfloatLogicalFunction.hpp new file mode 100644 index 0000000000..f7b2285a4a --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverGeFloatTfloatLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event ever_ge_float_tfloat: tests if a scalar is ever ge to a single-instant tfloat value. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ever_ge_float_tfloat`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class EverGeFloatTfloatLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverGeFloatTfloat"; + + EverGeFloatTfloatLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverGeIntTintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverGeIntTintLogicalFunction.hpp new file mode 100644 index 0000000000..ca303ca500 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverGeIntTintLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event ever_ge_int_tint: tests if a single-instant tfloat value ever equals a threshold. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ever_ge_int_tint`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class EverGeIntTintLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverGeIntTint"; + + EverGeIntTintLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverGtBigintTbigintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverGtBigintTbigintLogicalFunction.hpp new file mode 100644 index 0000000000..8b9627dc43 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverGtBigintTbigintLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event ever_gt_bigint_tbigint: tests if a single-instant tfloat value ever equals a threshold. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ever_gt_bigint_tbigint`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class EverGtBigintTbigintLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverGtBigintTbigint"; + + EverGtBigintTbigintLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverGtFloatTfloatLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverGtFloatTfloatLogicalFunction.hpp new file mode 100644 index 0000000000..f65720d26f --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverGtFloatTfloatLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event ever_gt_float_tfloat: tests if a scalar is ever gt to a single-instant tfloat value. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ever_gt_float_tfloat`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class EverGtFloatTfloatLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverGtFloatTfloat"; + + EverGtFloatTfloatLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverGtIntTintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverGtIntTintLogicalFunction.hpp new file mode 100644 index 0000000000..1ef281f21e --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverGtIntTintLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event ever_gt_int_tint: tests if a single-instant tfloat value ever equals a threshold. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ever_gt_int_tint`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class EverGtIntTintLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverGtIntTint"; + + EverGtIntTintLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverLeBigintTbigintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverLeBigintTbigintLogicalFunction.hpp new file mode 100644 index 0000000000..6b55c629a2 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverLeBigintTbigintLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event ever_le_bigint_tbigint: tests if a single-instant tfloat value ever equals a threshold. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ever_le_bigint_tbigint`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class EverLeBigintTbigintLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverLeBigintTbigint"; + + EverLeBigintTbigintLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverLeFloatTfloatLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverLeFloatTfloatLogicalFunction.hpp new file mode 100644 index 0000000000..bb4b73e4e7 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverLeFloatTfloatLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event ever_le_float_tfloat: tests if a scalar is ever le to a single-instant tfloat value. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ever_le_float_tfloat`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class EverLeFloatTfloatLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverLeFloatTfloat"; + + EverLeFloatTfloatLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverLeIntTintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverLeIntTintLogicalFunction.hpp new file mode 100644 index 0000000000..46271b029d --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverLeIntTintLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event ever_le_int_tint: tests if a single-instant tfloat value ever equals a threshold. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ever_le_int_tint`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class EverLeIntTintLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverLeIntTint"; + + EverLeIntTintLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverLtBigintTbigintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverLtBigintTbigintLogicalFunction.hpp new file mode 100644 index 0000000000..21c827c647 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverLtBigintTbigintLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event ever_lt_bigint_tbigint: tests if a single-instant tfloat value ever equals a threshold. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ever_lt_bigint_tbigint`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class EverLtBigintTbigintLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverLtBigintTbigint"; + + EverLtBigintTbigintLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverLtFloatTfloatLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverLtFloatTfloatLogicalFunction.hpp new file mode 100644 index 0000000000..02c3deed81 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverLtFloatTfloatLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event ever_lt_float_tfloat: tests if a scalar is ever lt to a single-instant tfloat value. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ever_lt_float_tfloat`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class EverLtFloatTfloatLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverLtFloatTfloat"; + + EverLtFloatTfloatLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverLtIntTintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverLtIntTintLogicalFunction.hpp new file mode 100644 index 0000000000..4d3c1ab05b --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverLtIntTintLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event ever_lt_int_tint: tests if a single-instant tfloat value ever equals a threshold. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ever_lt_int_tint`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class EverLtIntTintLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverLtIntTint"; + + EverLtIntTintLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverNeBigintTbigintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverNeBigintTbigintLogicalFunction.hpp new file mode 100644 index 0000000000..5b5ec3f630 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverNeBigintTbigintLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event ever_ne_bigint_tbigint: tests if a single-instant tfloat value ever equals a threshold. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ever_ne_bigint_tbigint`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class EverNeBigintTbigintLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverNeBigintTbigint"; + + EverNeBigintTbigintLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverNeFloatTfloatLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverNeFloatTfloatLogicalFunction.hpp new file mode 100644 index 0000000000..dfce0f7d4a --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverNeFloatTfloatLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event ever_ne_float_tfloat: tests if a scalar is ever ne to a single-instant tfloat value. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ever_ne_float_tfloat`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class EverNeFloatTfloatLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverNeFloatTfloat"; + + EverNeFloatTfloatLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverNeIntTintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverNeIntTintLogicalFunction.hpp new file mode 100644 index 0000000000..5de9645a64 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverNeIntTintLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event ever_ne_int_tint: tests if a single-instant tfloat value ever equals a threshold. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ever_ne_int_tint`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class EverNeIntTintLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverNeIntTint"; + + EverNeIntTintLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysEqBigintTbigintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysEqBigintTbigintLogicalFunction.cpp new file mode 100644 index 0000000000..165908ab0c --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysEqBigintTbigintLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AlwaysEqBigintTbigintLogicalFunction::AlwaysEqBigintTbigintLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType AlwaysEqBigintTbigintLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysEqBigintTbigintLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AlwaysEqBigintTbigintLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysEqBigintTbigintLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "AlwaysEqBigintTbigintLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AlwaysEqBigintTbigintLogicalFunction::getType() const { return NAME; } + +bool AlwaysEqBigintTbigintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AlwaysEqBigintTbigintLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction AlwaysEqBigintTbigintLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction AlwaysEqBigintTbigintLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysEqBigintTbigintLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "AlwaysEqBigintTbigintLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return AlwaysEqBigintTbigintLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysEqFloatTfloatLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysEqFloatTfloatLogicalFunction.cpp new file mode 100644 index 0000000000..236e3aae5b --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysEqFloatTfloatLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AlwaysEqFloatTfloatLogicalFunction::AlwaysEqFloatTfloatLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType AlwaysEqFloatTfloatLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysEqFloatTfloatLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AlwaysEqFloatTfloatLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysEqFloatTfloatLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "AlwaysEqFloatTfloatLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AlwaysEqFloatTfloatLogicalFunction::getType() const { return NAME; } + +bool AlwaysEqFloatTfloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AlwaysEqFloatTfloatLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction AlwaysEqFloatTfloatLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction AlwaysEqFloatTfloatLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysEqFloatTfloatLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "AlwaysEqFloatTfloatLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return AlwaysEqFloatTfloatLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysEqIntTintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysEqIntTintLogicalFunction.cpp new file mode 100644 index 0000000000..2d39421d29 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysEqIntTintLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AlwaysEqIntTintLogicalFunction::AlwaysEqIntTintLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType AlwaysEqIntTintLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysEqIntTintLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AlwaysEqIntTintLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysEqIntTintLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "AlwaysEqIntTintLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AlwaysEqIntTintLogicalFunction::getType() const { return NAME; } + +bool AlwaysEqIntTintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AlwaysEqIntTintLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction AlwaysEqIntTintLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction AlwaysEqIntTintLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysEqIntTintLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "AlwaysEqIntTintLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return AlwaysEqIntTintLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysGeBigintTbigintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysGeBigintTbigintLogicalFunction.cpp new file mode 100644 index 0000000000..1655a5f099 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysGeBigintTbigintLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AlwaysGeBigintTbigintLogicalFunction::AlwaysGeBigintTbigintLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType AlwaysGeBigintTbigintLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysGeBigintTbigintLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AlwaysGeBigintTbigintLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysGeBigintTbigintLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "AlwaysGeBigintTbigintLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AlwaysGeBigintTbigintLogicalFunction::getType() const { return NAME; } + +bool AlwaysGeBigintTbigintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AlwaysGeBigintTbigintLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction AlwaysGeBigintTbigintLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction AlwaysGeBigintTbigintLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysGeBigintTbigintLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "AlwaysGeBigintTbigintLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return AlwaysGeBigintTbigintLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysGeFloatTfloatLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysGeFloatTfloatLogicalFunction.cpp new file mode 100644 index 0000000000..c2271278ed --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysGeFloatTfloatLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AlwaysGeFloatTfloatLogicalFunction::AlwaysGeFloatTfloatLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType AlwaysGeFloatTfloatLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysGeFloatTfloatLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AlwaysGeFloatTfloatLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysGeFloatTfloatLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "AlwaysGeFloatTfloatLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AlwaysGeFloatTfloatLogicalFunction::getType() const { return NAME; } + +bool AlwaysGeFloatTfloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AlwaysGeFloatTfloatLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction AlwaysGeFloatTfloatLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction AlwaysGeFloatTfloatLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysGeFloatTfloatLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "AlwaysGeFloatTfloatLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return AlwaysGeFloatTfloatLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysGeIntTintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysGeIntTintLogicalFunction.cpp new file mode 100644 index 0000000000..e048ee1527 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysGeIntTintLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AlwaysGeIntTintLogicalFunction::AlwaysGeIntTintLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType AlwaysGeIntTintLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysGeIntTintLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AlwaysGeIntTintLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysGeIntTintLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "AlwaysGeIntTintLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AlwaysGeIntTintLogicalFunction::getType() const { return NAME; } + +bool AlwaysGeIntTintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AlwaysGeIntTintLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction AlwaysGeIntTintLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction AlwaysGeIntTintLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysGeIntTintLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "AlwaysGeIntTintLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return AlwaysGeIntTintLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysGtBigintTbigintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysGtBigintTbigintLogicalFunction.cpp new file mode 100644 index 0000000000..61388c58bc --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysGtBigintTbigintLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AlwaysGtBigintTbigintLogicalFunction::AlwaysGtBigintTbigintLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType AlwaysGtBigintTbigintLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysGtBigintTbigintLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AlwaysGtBigintTbigintLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysGtBigintTbigintLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "AlwaysGtBigintTbigintLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AlwaysGtBigintTbigintLogicalFunction::getType() const { return NAME; } + +bool AlwaysGtBigintTbigintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AlwaysGtBigintTbigintLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction AlwaysGtBigintTbigintLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction AlwaysGtBigintTbigintLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysGtBigintTbigintLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "AlwaysGtBigintTbigintLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return AlwaysGtBigintTbigintLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysGtFloatTfloatLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysGtFloatTfloatLogicalFunction.cpp new file mode 100644 index 0000000000..4c7037a18f --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysGtFloatTfloatLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AlwaysGtFloatTfloatLogicalFunction::AlwaysGtFloatTfloatLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType AlwaysGtFloatTfloatLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysGtFloatTfloatLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AlwaysGtFloatTfloatLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysGtFloatTfloatLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "AlwaysGtFloatTfloatLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AlwaysGtFloatTfloatLogicalFunction::getType() const { return NAME; } + +bool AlwaysGtFloatTfloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AlwaysGtFloatTfloatLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction AlwaysGtFloatTfloatLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction AlwaysGtFloatTfloatLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysGtFloatTfloatLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "AlwaysGtFloatTfloatLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return AlwaysGtFloatTfloatLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysGtIntTintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysGtIntTintLogicalFunction.cpp new file mode 100644 index 0000000000..a2bccc47c5 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysGtIntTintLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AlwaysGtIntTintLogicalFunction::AlwaysGtIntTintLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType AlwaysGtIntTintLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysGtIntTintLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AlwaysGtIntTintLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysGtIntTintLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "AlwaysGtIntTintLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AlwaysGtIntTintLogicalFunction::getType() const { return NAME; } + +bool AlwaysGtIntTintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AlwaysGtIntTintLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction AlwaysGtIntTintLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction AlwaysGtIntTintLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysGtIntTintLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "AlwaysGtIntTintLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return AlwaysGtIntTintLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysLeBigintTbigintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysLeBigintTbigintLogicalFunction.cpp new file mode 100644 index 0000000000..e90f5be0b9 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysLeBigintTbigintLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AlwaysLeBigintTbigintLogicalFunction::AlwaysLeBigintTbigintLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType AlwaysLeBigintTbigintLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysLeBigintTbigintLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AlwaysLeBigintTbigintLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysLeBigintTbigintLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "AlwaysLeBigintTbigintLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AlwaysLeBigintTbigintLogicalFunction::getType() const { return NAME; } + +bool AlwaysLeBigintTbigintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AlwaysLeBigintTbigintLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction AlwaysLeBigintTbigintLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction AlwaysLeBigintTbigintLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysLeBigintTbigintLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "AlwaysLeBigintTbigintLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return AlwaysLeBigintTbigintLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysLeFloatTfloatLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysLeFloatTfloatLogicalFunction.cpp new file mode 100644 index 0000000000..45900c97c2 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysLeFloatTfloatLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AlwaysLeFloatTfloatLogicalFunction::AlwaysLeFloatTfloatLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType AlwaysLeFloatTfloatLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysLeFloatTfloatLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AlwaysLeFloatTfloatLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysLeFloatTfloatLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "AlwaysLeFloatTfloatLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AlwaysLeFloatTfloatLogicalFunction::getType() const { return NAME; } + +bool AlwaysLeFloatTfloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AlwaysLeFloatTfloatLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction AlwaysLeFloatTfloatLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction AlwaysLeFloatTfloatLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysLeFloatTfloatLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "AlwaysLeFloatTfloatLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return AlwaysLeFloatTfloatLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysLeIntTintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysLeIntTintLogicalFunction.cpp new file mode 100644 index 0000000000..dfbe893fd9 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysLeIntTintLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AlwaysLeIntTintLogicalFunction::AlwaysLeIntTintLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType AlwaysLeIntTintLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysLeIntTintLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AlwaysLeIntTintLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysLeIntTintLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "AlwaysLeIntTintLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AlwaysLeIntTintLogicalFunction::getType() const { return NAME; } + +bool AlwaysLeIntTintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AlwaysLeIntTintLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction AlwaysLeIntTintLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction AlwaysLeIntTintLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysLeIntTintLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "AlwaysLeIntTintLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return AlwaysLeIntTintLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysLtBigintTbigintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysLtBigintTbigintLogicalFunction.cpp new file mode 100644 index 0000000000..4d67ea2436 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysLtBigintTbigintLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AlwaysLtBigintTbigintLogicalFunction::AlwaysLtBigintTbigintLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType AlwaysLtBigintTbigintLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysLtBigintTbigintLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AlwaysLtBigintTbigintLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysLtBigintTbigintLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "AlwaysLtBigintTbigintLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AlwaysLtBigintTbigintLogicalFunction::getType() const { return NAME; } + +bool AlwaysLtBigintTbigintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AlwaysLtBigintTbigintLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction AlwaysLtBigintTbigintLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction AlwaysLtBigintTbigintLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysLtBigintTbigintLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "AlwaysLtBigintTbigintLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return AlwaysLtBigintTbigintLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysLtFloatTfloatLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysLtFloatTfloatLogicalFunction.cpp new file mode 100644 index 0000000000..68eab07553 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysLtFloatTfloatLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AlwaysLtFloatTfloatLogicalFunction::AlwaysLtFloatTfloatLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType AlwaysLtFloatTfloatLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysLtFloatTfloatLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AlwaysLtFloatTfloatLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysLtFloatTfloatLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "AlwaysLtFloatTfloatLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AlwaysLtFloatTfloatLogicalFunction::getType() const { return NAME; } + +bool AlwaysLtFloatTfloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AlwaysLtFloatTfloatLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction AlwaysLtFloatTfloatLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction AlwaysLtFloatTfloatLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysLtFloatTfloatLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "AlwaysLtFloatTfloatLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return AlwaysLtFloatTfloatLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysLtIntTintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysLtIntTintLogicalFunction.cpp new file mode 100644 index 0000000000..186b96b2ca --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysLtIntTintLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AlwaysLtIntTintLogicalFunction::AlwaysLtIntTintLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType AlwaysLtIntTintLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysLtIntTintLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AlwaysLtIntTintLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysLtIntTintLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "AlwaysLtIntTintLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AlwaysLtIntTintLogicalFunction::getType() const { return NAME; } + +bool AlwaysLtIntTintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AlwaysLtIntTintLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction AlwaysLtIntTintLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction AlwaysLtIntTintLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysLtIntTintLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "AlwaysLtIntTintLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return AlwaysLtIntTintLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysNeBigintTbigintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysNeBigintTbigintLogicalFunction.cpp new file mode 100644 index 0000000000..69e726068e --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysNeBigintTbigintLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AlwaysNeBigintTbigintLogicalFunction::AlwaysNeBigintTbigintLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType AlwaysNeBigintTbigintLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysNeBigintTbigintLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AlwaysNeBigintTbigintLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysNeBigintTbigintLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "AlwaysNeBigintTbigintLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AlwaysNeBigintTbigintLogicalFunction::getType() const { return NAME; } + +bool AlwaysNeBigintTbigintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AlwaysNeBigintTbigintLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction AlwaysNeBigintTbigintLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction AlwaysNeBigintTbigintLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysNeBigintTbigintLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "AlwaysNeBigintTbigintLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return AlwaysNeBigintTbigintLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysNeFloatTfloatLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysNeFloatTfloatLogicalFunction.cpp new file mode 100644 index 0000000000..61d1593192 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysNeFloatTfloatLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AlwaysNeFloatTfloatLogicalFunction::AlwaysNeFloatTfloatLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType AlwaysNeFloatTfloatLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysNeFloatTfloatLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AlwaysNeFloatTfloatLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysNeFloatTfloatLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "AlwaysNeFloatTfloatLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AlwaysNeFloatTfloatLogicalFunction::getType() const { return NAME; } + +bool AlwaysNeFloatTfloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AlwaysNeFloatTfloatLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction AlwaysNeFloatTfloatLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction AlwaysNeFloatTfloatLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysNeFloatTfloatLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "AlwaysNeFloatTfloatLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return AlwaysNeFloatTfloatLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysNeIntTintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysNeIntTintLogicalFunction.cpp new file mode 100644 index 0000000000..c18fd96ceb --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysNeIntTintLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AlwaysNeIntTintLogicalFunction::AlwaysNeIntTintLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType AlwaysNeIntTintLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysNeIntTintLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AlwaysNeIntTintLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysNeIntTintLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "AlwaysNeIntTintLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AlwaysNeIntTintLogicalFunction::getType() const { return NAME; } + +bool AlwaysNeIntTintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AlwaysNeIntTintLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction AlwaysNeIntTintLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction AlwaysNeIntTintLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysNeIntTintLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "AlwaysNeIntTintLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return AlwaysNeIntTintLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt index ff6190bffd..09a8d54498 100644 --- a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt @@ -148,3 +148,39 @@ add_plugin(AlwaysGtTbigintTbigint LogicalFunction nes-logical-operators AlwaysGt add_plugin(AlwaysLeTbigintTbigint LogicalFunction nes-logical-operators AlwaysLeTbigintTbigintLogicalFunction.cpp) add_plugin(AlwaysLtTbigintTbigint LogicalFunction nes-logical-operators AlwaysLtTbigintTbigintLogicalFunction.cpp) add_plugin(AlwaysNeTbigintTbigint LogicalFunction nes-logical-operators AlwaysNeTbigintTbigintLogicalFunction.cpp) +add_plugin(EverEqFloatTfloat LogicalFunction nes-logical-operators EverEqFloatTfloatLogicalFunction.cpp) +add_plugin(EverGeFloatTfloat LogicalFunction nes-logical-operators EverGeFloatTfloatLogicalFunction.cpp) +add_plugin(EverGtFloatTfloat LogicalFunction nes-logical-operators EverGtFloatTfloatLogicalFunction.cpp) +add_plugin(EverLeFloatTfloat LogicalFunction nes-logical-operators EverLeFloatTfloatLogicalFunction.cpp) +add_plugin(EverLtFloatTfloat LogicalFunction nes-logical-operators EverLtFloatTfloatLogicalFunction.cpp) +add_plugin(EverNeFloatTfloat LogicalFunction nes-logical-operators EverNeFloatTfloatLogicalFunction.cpp) +add_plugin(EverEqIntTint LogicalFunction nes-logical-operators EverEqIntTintLogicalFunction.cpp) +add_plugin(EverGeIntTint LogicalFunction nes-logical-operators EverGeIntTintLogicalFunction.cpp) +add_plugin(EverGtIntTint LogicalFunction nes-logical-operators EverGtIntTintLogicalFunction.cpp) +add_plugin(EverLeIntTint LogicalFunction nes-logical-operators EverLeIntTintLogicalFunction.cpp) +add_plugin(EverLtIntTint LogicalFunction nes-logical-operators EverLtIntTintLogicalFunction.cpp) +add_plugin(EverNeIntTint LogicalFunction nes-logical-operators EverNeIntTintLogicalFunction.cpp) +add_plugin(EverEqBigintTbigint LogicalFunction nes-logical-operators EverEqBigintTbigintLogicalFunction.cpp) +add_plugin(EverGeBigintTbigint LogicalFunction nes-logical-operators EverGeBigintTbigintLogicalFunction.cpp) +add_plugin(EverGtBigintTbigint LogicalFunction nes-logical-operators EverGtBigintTbigintLogicalFunction.cpp) +add_plugin(EverLeBigintTbigint LogicalFunction nes-logical-operators EverLeBigintTbigintLogicalFunction.cpp) +add_plugin(EverLtBigintTbigint LogicalFunction nes-logical-operators EverLtBigintTbigintLogicalFunction.cpp) +add_plugin(EverNeBigintTbigint LogicalFunction nes-logical-operators EverNeBigintTbigintLogicalFunction.cpp) +add_plugin(AlwaysEqFloatTfloat LogicalFunction nes-logical-operators AlwaysEqFloatTfloatLogicalFunction.cpp) +add_plugin(AlwaysGeFloatTfloat LogicalFunction nes-logical-operators AlwaysGeFloatTfloatLogicalFunction.cpp) +add_plugin(AlwaysGtFloatTfloat LogicalFunction nes-logical-operators AlwaysGtFloatTfloatLogicalFunction.cpp) +add_plugin(AlwaysLeFloatTfloat LogicalFunction nes-logical-operators AlwaysLeFloatTfloatLogicalFunction.cpp) +add_plugin(AlwaysLtFloatTfloat LogicalFunction nes-logical-operators AlwaysLtFloatTfloatLogicalFunction.cpp) +add_plugin(AlwaysNeFloatTfloat LogicalFunction nes-logical-operators AlwaysNeFloatTfloatLogicalFunction.cpp) +add_plugin(AlwaysEqIntTint LogicalFunction nes-logical-operators AlwaysEqIntTintLogicalFunction.cpp) +add_plugin(AlwaysGeIntTint LogicalFunction nes-logical-operators AlwaysGeIntTintLogicalFunction.cpp) +add_plugin(AlwaysGtIntTint LogicalFunction nes-logical-operators AlwaysGtIntTintLogicalFunction.cpp) +add_plugin(AlwaysLeIntTint LogicalFunction nes-logical-operators AlwaysLeIntTintLogicalFunction.cpp) +add_plugin(AlwaysLtIntTint LogicalFunction nes-logical-operators AlwaysLtIntTintLogicalFunction.cpp) +add_plugin(AlwaysNeIntTint LogicalFunction nes-logical-operators AlwaysNeIntTintLogicalFunction.cpp) +add_plugin(AlwaysEqBigintTbigint LogicalFunction nes-logical-operators AlwaysEqBigintTbigintLogicalFunction.cpp) +add_plugin(AlwaysGeBigintTbigint LogicalFunction nes-logical-operators AlwaysGeBigintTbigintLogicalFunction.cpp) +add_plugin(AlwaysGtBigintTbigint LogicalFunction nes-logical-operators AlwaysGtBigintTbigintLogicalFunction.cpp) +add_plugin(AlwaysLeBigintTbigint LogicalFunction nes-logical-operators AlwaysLeBigintTbigintLogicalFunction.cpp) +add_plugin(AlwaysLtBigintTbigint LogicalFunction nes-logical-operators AlwaysLtBigintTbigintLogicalFunction.cpp) +add_plugin(AlwaysNeBigintTbigint LogicalFunction nes-logical-operators AlwaysNeBigintTbigintLogicalFunction.cpp) diff --git a/nes-logical-operators/src/Functions/Meos/EverEqBigintTbigintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverEqBigintTbigintLogicalFunction.cpp new file mode 100644 index 0000000000..bd7bc9bd8b --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverEqBigintTbigintLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EverEqBigintTbigintLogicalFunction::EverEqBigintTbigintLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType EverEqBigintTbigintLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverEqBigintTbigintLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EverEqBigintTbigintLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverEqBigintTbigintLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "EverEqBigintTbigintLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EverEqBigintTbigintLogicalFunction::getType() const { return NAME; } + +bool EverEqBigintTbigintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EverEqBigintTbigintLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction EverEqBigintTbigintLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction EverEqBigintTbigintLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverEqBigintTbigintLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "EverEqBigintTbigintLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return EverEqBigintTbigintLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverEqFloatTfloatLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverEqFloatTfloatLogicalFunction.cpp new file mode 100644 index 0000000000..d5f05bc4c5 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverEqFloatTfloatLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EverEqFloatTfloatLogicalFunction::EverEqFloatTfloatLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType EverEqFloatTfloatLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverEqFloatTfloatLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EverEqFloatTfloatLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverEqFloatTfloatLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "EverEqFloatTfloatLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EverEqFloatTfloatLogicalFunction::getType() const { return NAME; } + +bool EverEqFloatTfloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EverEqFloatTfloatLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction EverEqFloatTfloatLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction EverEqFloatTfloatLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverEqFloatTfloatLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "EverEqFloatTfloatLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return EverEqFloatTfloatLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverEqIntTintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverEqIntTintLogicalFunction.cpp new file mode 100644 index 0000000000..a8b84aa5c8 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverEqIntTintLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EverEqIntTintLogicalFunction::EverEqIntTintLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType EverEqIntTintLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverEqIntTintLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EverEqIntTintLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverEqIntTintLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "EverEqIntTintLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EverEqIntTintLogicalFunction::getType() const { return NAME; } + +bool EverEqIntTintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EverEqIntTintLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction EverEqIntTintLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction EverEqIntTintLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverEqIntTintLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "EverEqIntTintLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return EverEqIntTintLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverGeBigintTbigintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverGeBigintTbigintLogicalFunction.cpp new file mode 100644 index 0000000000..157c6360ea --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverGeBigintTbigintLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EverGeBigintTbigintLogicalFunction::EverGeBigintTbigintLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType EverGeBigintTbigintLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverGeBigintTbigintLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EverGeBigintTbigintLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverGeBigintTbigintLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "EverGeBigintTbigintLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EverGeBigintTbigintLogicalFunction::getType() const { return NAME; } + +bool EverGeBigintTbigintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EverGeBigintTbigintLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction EverGeBigintTbigintLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction EverGeBigintTbigintLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverGeBigintTbigintLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "EverGeBigintTbigintLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return EverGeBigintTbigintLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverGeFloatTfloatLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverGeFloatTfloatLogicalFunction.cpp new file mode 100644 index 0000000000..38b434e735 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverGeFloatTfloatLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EverGeFloatTfloatLogicalFunction::EverGeFloatTfloatLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType EverGeFloatTfloatLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverGeFloatTfloatLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EverGeFloatTfloatLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverGeFloatTfloatLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "EverGeFloatTfloatLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EverGeFloatTfloatLogicalFunction::getType() const { return NAME; } + +bool EverGeFloatTfloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EverGeFloatTfloatLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction EverGeFloatTfloatLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction EverGeFloatTfloatLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverGeFloatTfloatLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "EverGeFloatTfloatLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return EverGeFloatTfloatLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverGeIntTintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverGeIntTintLogicalFunction.cpp new file mode 100644 index 0000000000..92ecec6983 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverGeIntTintLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EverGeIntTintLogicalFunction::EverGeIntTintLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType EverGeIntTintLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverGeIntTintLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EverGeIntTintLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverGeIntTintLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "EverGeIntTintLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EverGeIntTintLogicalFunction::getType() const { return NAME; } + +bool EverGeIntTintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EverGeIntTintLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction EverGeIntTintLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction EverGeIntTintLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverGeIntTintLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "EverGeIntTintLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return EverGeIntTintLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverGtBigintTbigintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverGtBigintTbigintLogicalFunction.cpp new file mode 100644 index 0000000000..77d6ddc6bb --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverGtBigintTbigintLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EverGtBigintTbigintLogicalFunction::EverGtBigintTbigintLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType EverGtBigintTbigintLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverGtBigintTbigintLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EverGtBigintTbigintLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverGtBigintTbigintLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "EverGtBigintTbigintLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EverGtBigintTbigintLogicalFunction::getType() const { return NAME; } + +bool EverGtBigintTbigintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EverGtBigintTbigintLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction EverGtBigintTbigintLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction EverGtBigintTbigintLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverGtBigintTbigintLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "EverGtBigintTbigintLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return EverGtBigintTbigintLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverGtFloatTfloatLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverGtFloatTfloatLogicalFunction.cpp new file mode 100644 index 0000000000..c9b33257a7 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverGtFloatTfloatLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EverGtFloatTfloatLogicalFunction::EverGtFloatTfloatLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType EverGtFloatTfloatLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverGtFloatTfloatLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EverGtFloatTfloatLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverGtFloatTfloatLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "EverGtFloatTfloatLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EverGtFloatTfloatLogicalFunction::getType() const { return NAME; } + +bool EverGtFloatTfloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EverGtFloatTfloatLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction EverGtFloatTfloatLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction EverGtFloatTfloatLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverGtFloatTfloatLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "EverGtFloatTfloatLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return EverGtFloatTfloatLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverGtIntTintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverGtIntTintLogicalFunction.cpp new file mode 100644 index 0000000000..973c67c20c --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverGtIntTintLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EverGtIntTintLogicalFunction::EverGtIntTintLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType EverGtIntTintLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverGtIntTintLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EverGtIntTintLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverGtIntTintLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "EverGtIntTintLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EverGtIntTintLogicalFunction::getType() const { return NAME; } + +bool EverGtIntTintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EverGtIntTintLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction EverGtIntTintLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction EverGtIntTintLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverGtIntTintLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "EverGtIntTintLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return EverGtIntTintLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverLeBigintTbigintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverLeBigintTbigintLogicalFunction.cpp new file mode 100644 index 0000000000..08cf99bcde --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverLeBigintTbigintLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EverLeBigintTbigintLogicalFunction::EverLeBigintTbigintLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType EverLeBigintTbigintLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverLeBigintTbigintLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EverLeBigintTbigintLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverLeBigintTbigintLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "EverLeBigintTbigintLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EverLeBigintTbigintLogicalFunction::getType() const { return NAME; } + +bool EverLeBigintTbigintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EverLeBigintTbigintLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction EverLeBigintTbigintLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction EverLeBigintTbigintLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverLeBigintTbigintLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "EverLeBigintTbigintLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return EverLeBigintTbigintLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverLeFloatTfloatLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverLeFloatTfloatLogicalFunction.cpp new file mode 100644 index 0000000000..8557750a57 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverLeFloatTfloatLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EverLeFloatTfloatLogicalFunction::EverLeFloatTfloatLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType EverLeFloatTfloatLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverLeFloatTfloatLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EverLeFloatTfloatLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverLeFloatTfloatLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "EverLeFloatTfloatLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EverLeFloatTfloatLogicalFunction::getType() const { return NAME; } + +bool EverLeFloatTfloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EverLeFloatTfloatLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction EverLeFloatTfloatLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction EverLeFloatTfloatLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverLeFloatTfloatLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "EverLeFloatTfloatLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return EverLeFloatTfloatLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverLeIntTintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverLeIntTintLogicalFunction.cpp new file mode 100644 index 0000000000..1fe564e5a0 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverLeIntTintLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EverLeIntTintLogicalFunction::EverLeIntTintLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType EverLeIntTintLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverLeIntTintLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EverLeIntTintLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverLeIntTintLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "EverLeIntTintLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EverLeIntTintLogicalFunction::getType() const { return NAME; } + +bool EverLeIntTintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EverLeIntTintLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction EverLeIntTintLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction EverLeIntTintLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverLeIntTintLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "EverLeIntTintLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return EverLeIntTintLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverLtBigintTbigintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverLtBigintTbigintLogicalFunction.cpp new file mode 100644 index 0000000000..23a4675cd9 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverLtBigintTbigintLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EverLtBigintTbigintLogicalFunction::EverLtBigintTbigintLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType EverLtBigintTbigintLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverLtBigintTbigintLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EverLtBigintTbigintLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverLtBigintTbigintLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "EverLtBigintTbigintLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EverLtBigintTbigintLogicalFunction::getType() const { return NAME; } + +bool EverLtBigintTbigintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EverLtBigintTbigintLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction EverLtBigintTbigintLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction EverLtBigintTbigintLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverLtBigintTbigintLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "EverLtBigintTbigintLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return EverLtBigintTbigintLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverLtFloatTfloatLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverLtFloatTfloatLogicalFunction.cpp new file mode 100644 index 0000000000..c13e822a91 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverLtFloatTfloatLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EverLtFloatTfloatLogicalFunction::EverLtFloatTfloatLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType EverLtFloatTfloatLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverLtFloatTfloatLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EverLtFloatTfloatLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverLtFloatTfloatLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "EverLtFloatTfloatLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EverLtFloatTfloatLogicalFunction::getType() const { return NAME; } + +bool EverLtFloatTfloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EverLtFloatTfloatLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction EverLtFloatTfloatLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction EverLtFloatTfloatLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverLtFloatTfloatLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "EverLtFloatTfloatLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return EverLtFloatTfloatLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverLtIntTintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverLtIntTintLogicalFunction.cpp new file mode 100644 index 0000000000..f94b21badb --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverLtIntTintLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EverLtIntTintLogicalFunction::EverLtIntTintLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType EverLtIntTintLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverLtIntTintLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EverLtIntTintLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverLtIntTintLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "EverLtIntTintLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EverLtIntTintLogicalFunction::getType() const { return NAME; } + +bool EverLtIntTintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EverLtIntTintLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction EverLtIntTintLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction EverLtIntTintLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverLtIntTintLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "EverLtIntTintLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return EverLtIntTintLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverNeBigintTbigintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverNeBigintTbigintLogicalFunction.cpp new file mode 100644 index 0000000000..12e7611d5f --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverNeBigintTbigintLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EverNeBigintTbigintLogicalFunction::EverNeBigintTbigintLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType EverNeBigintTbigintLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverNeBigintTbigintLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EverNeBigintTbigintLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverNeBigintTbigintLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "EverNeBigintTbigintLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EverNeBigintTbigintLogicalFunction::getType() const { return NAME; } + +bool EverNeBigintTbigintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EverNeBigintTbigintLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction EverNeBigintTbigintLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction EverNeBigintTbigintLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverNeBigintTbigintLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "EverNeBigintTbigintLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return EverNeBigintTbigintLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverNeFloatTfloatLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverNeFloatTfloatLogicalFunction.cpp new file mode 100644 index 0000000000..2f9723e1a2 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverNeFloatTfloatLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EverNeFloatTfloatLogicalFunction::EverNeFloatTfloatLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType EverNeFloatTfloatLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverNeFloatTfloatLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EverNeFloatTfloatLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverNeFloatTfloatLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "EverNeFloatTfloatLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EverNeFloatTfloatLogicalFunction::getType() const { return NAME; } + +bool EverNeFloatTfloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EverNeFloatTfloatLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction EverNeFloatTfloatLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction EverNeFloatTfloatLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverNeFloatTfloatLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "EverNeFloatTfloatLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return EverNeFloatTfloatLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverNeIntTintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverNeIntTintLogicalFunction.cpp new file mode 100644 index 0000000000..4b26ccda1a --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverNeIntTintLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EverNeIntTintLogicalFunction::EverNeIntTintLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType EverNeIntTintLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverNeIntTintLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EverNeIntTintLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverNeIntTintLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "EverNeIntTintLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EverNeIntTintLogicalFunction::getType() const { return NAME; } + +bool EverNeIntTintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EverNeIntTintLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction EverNeIntTintLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction EverNeIntTintLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverNeIntTintLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "EverNeIntTintLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return EverNeIntTintLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysEqBigintTbigintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysEqBigintTbigintPhysicalFunction.hpp new file mode 100644 index 0000000000..2b35d1eec5 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysEqBigintTbigintPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `always_eq_bigint_tbigint`. + * + * Per-event always_eq_bigint_tbigint: tests if a single-instant tfloat value ever equals a threshold. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class AlwaysEqBigintTbigintPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysEqBigintTbigintPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysEqFloatTfloatPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysEqFloatTfloatPhysicalFunction.hpp new file mode 100644 index 0000000000..0aa62b3f59 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysEqFloatTfloatPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `always_eq_float_tfloat`. + * + * Per-event always_eq_float_tfloat: tests if a scalar is ever eq to a single-instant tfloat value. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class AlwaysEqFloatTfloatPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysEqFloatTfloatPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysEqIntTintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysEqIntTintPhysicalFunction.hpp new file mode 100644 index 0000000000..19b2376946 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysEqIntTintPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `always_eq_int_tint`. + * + * Per-event always_eq_int_tint: tests if a single-instant tfloat value ever equals a threshold. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class AlwaysEqIntTintPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysEqIntTintPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysGeBigintTbigintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysGeBigintTbigintPhysicalFunction.hpp new file mode 100644 index 0000000000..6273862456 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysGeBigintTbigintPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `always_ge_bigint_tbigint`. + * + * Per-event always_ge_bigint_tbigint: tests if a single-instant tfloat value ever equals a threshold. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class AlwaysGeBigintTbigintPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysGeBigintTbigintPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysGeFloatTfloatPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysGeFloatTfloatPhysicalFunction.hpp new file mode 100644 index 0000000000..e434ca62dc --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysGeFloatTfloatPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `always_ge_float_tfloat`. + * + * Per-event always_ge_float_tfloat: tests if a scalar is ever ge to a single-instant tfloat value. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class AlwaysGeFloatTfloatPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysGeFloatTfloatPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysGeIntTintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysGeIntTintPhysicalFunction.hpp new file mode 100644 index 0000000000..72c811601b --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysGeIntTintPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `always_ge_int_tint`. + * + * Per-event always_ge_int_tint: tests if a single-instant tfloat value ever equals a threshold. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class AlwaysGeIntTintPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysGeIntTintPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysGtBigintTbigintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysGtBigintTbigintPhysicalFunction.hpp new file mode 100644 index 0000000000..837f31024b --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysGtBigintTbigintPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `always_gt_bigint_tbigint`. + * + * Per-event always_gt_bigint_tbigint: tests if a single-instant tfloat value ever equals a threshold. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class AlwaysGtBigintTbigintPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysGtBigintTbigintPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysGtFloatTfloatPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysGtFloatTfloatPhysicalFunction.hpp new file mode 100644 index 0000000000..6ec423ab97 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysGtFloatTfloatPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `always_gt_float_tfloat`. + * + * Per-event always_gt_float_tfloat: tests if a scalar is ever gt to a single-instant tfloat value. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class AlwaysGtFloatTfloatPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysGtFloatTfloatPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysGtIntTintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysGtIntTintPhysicalFunction.hpp new file mode 100644 index 0000000000..0e1cf32b7b --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysGtIntTintPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `always_gt_int_tint`. + * + * Per-event always_gt_int_tint: tests if a single-instant tfloat value ever equals a threshold. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class AlwaysGtIntTintPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysGtIntTintPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysLeBigintTbigintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysLeBigintTbigintPhysicalFunction.hpp new file mode 100644 index 0000000000..b03bae0e62 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysLeBigintTbigintPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `always_le_bigint_tbigint`. + * + * Per-event always_le_bigint_tbigint: tests if a single-instant tfloat value ever equals a threshold. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class AlwaysLeBigintTbigintPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysLeBigintTbigintPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysLeFloatTfloatPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysLeFloatTfloatPhysicalFunction.hpp new file mode 100644 index 0000000000..3ea6b2b734 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysLeFloatTfloatPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `always_le_float_tfloat`. + * + * Per-event always_le_float_tfloat: tests if a scalar is ever le to a single-instant tfloat value. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class AlwaysLeFloatTfloatPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysLeFloatTfloatPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysLeIntTintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysLeIntTintPhysicalFunction.hpp new file mode 100644 index 0000000000..1c79f07981 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysLeIntTintPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `always_le_int_tint`. + * + * Per-event always_le_int_tint: tests if a single-instant tfloat value ever equals a threshold. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class AlwaysLeIntTintPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysLeIntTintPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysLtBigintTbigintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysLtBigintTbigintPhysicalFunction.hpp new file mode 100644 index 0000000000..111aa16311 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysLtBigintTbigintPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `always_lt_bigint_tbigint`. + * + * Per-event always_lt_bigint_tbigint: tests if a single-instant tfloat value ever equals a threshold. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class AlwaysLtBigintTbigintPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysLtBigintTbigintPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysLtFloatTfloatPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysLtFloatTfloatPhysicalFunction.hpp new file mode 100644 index 0000000000..af2ddb3254 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysLtFloatTfloatPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `always_lt_float_tfloat`. + * + * Per-event always_lt_float_tfloat: tests if a scalar is ever lt to a single-instant tfloat value. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class AlwaysLtFloatTfloatPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysLtFloatTfloatPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysLtIntTintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysLtIntTintPhysicalFunction.hpp new file mode 100644 index 0000000000..6ab3848163 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysLtIntTintPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `always_lt_int_tint`. + * + * Per-event always_lt_int_tint: tests if a single-instant tfloat value ever equals a threshold. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class AlwaysLtIntTintPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysLtIntTintPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysNeBigintTbigintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysNeBigintTbigintPhysicalFunction.hpp new file mode 100644 index 0000000000..1b3bccff1b --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysNeBigintTbigintPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `always_ne_bigint_tbigint`. + * + * Per-event always_ne_bigint_tbigint: tests if a single-instant tfloat value ever equals a threshold. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class AlwaysNeBigintTbigintPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysNeBigintTbigintPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysNeFloatTfloatPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysNeFloatTfloatPhysicalFunction.hpp new file mode 100644 index 0000000000..b8d7b84c15 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysNeFloatTfloatPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `always_ne_float_tfloat`. + * + * Per-event always_ne_float_tfloat: tests if a scalar is ever ne to a single-instant tfloat value. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class AlwaysNeFloatTfloatPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysNeFloatTfloatPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysNeIntTintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysNeIntTintPhysicalFunction.hpp new file mode 100644 index 0000000000..d38d41ae5a --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysNeIntTintPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `always_ne_int_tint`. + * + * Per-event always_ne_int_tint: tests if a single-instant tfloat value ever equals a threshold. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class AlwaysNeIntTintPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysNeIntTintPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverEqBigintTbigintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverEqBigintTbigintPhysicalFunction.hpp new file mode 100644 index 0000000000..25c40ac239 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverEqBigintTbigintPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `ever_eq_bigint_tbigint`. + * + * Per-event ever_eq_bigint_tbigint: tests if a single-instant tfloat value ever equals a threshold. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class EverEqBigintTbigintPhysicalFunction : public PhysicalFunctionConcept { +public: + EverEqBigintTbigintPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverEqFloatTfloatPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverEqFloatTfloatPhysicalFunction.hpp new file mode 100644 index 0000000000..f44db4fe5a --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverEqFloatTfloatPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `ever_eq_float_tfloat`. + * + * Per-event ever_eq_float_tfloat: tests if a scalar is ever eq to a single-instant tfloat value. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class EverEqFloatTfloatPhysicalFunction : public PhysicalFunctionConcept { +public: + EverEqFloatTfloatPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverEqIntTintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverEqIntTintPhysicalFunction.hpp new file mode 100644 index 0000000000..d6fdeaa53a --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverEqIntTintPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `ever_eq_int_tint`. + * + * Per-event ever_eq_int_tint: tests if a single-instant tfloat value ever equals a threshold. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class EverEqIntTintPhysicalFunction : public PhysicalFunctionConcept { +public: + EverEqIntTintPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverGeBigintTbigintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverGeBigintTbigintPhysicalFunction.hpp new file mode 100644 index 0000000000..5713b4fedb --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverGeBigintTbigintPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `ever_ge_bigint_tbigint`. + * + * Per-event ever_ge_bigint_tbigint: tests if a single-instant tfloat value ever equals a threshold. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class EverGeBigintTbigintPhysicalFunction : public PhysicalFunctionConcept { +public: + EverGeBigintTbigintPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverGeFloatTfloatPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverGeFloatTfloatPhysicalFunction.hpp new file mode 100644 index 0000000000..b41e5d0f7e --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverGeFloatTfloatPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `ever_ge_float_tfloat`. + * + * Per-event ever_ge_float_tfloat: tests if a scalar is ever ge to a single-instant tfloat value. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class EverGeFloatTfloatPhysicalFunction : public PhysicalFunctionConcept { +public: + EverGeFloatTfloatPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverGeIntTintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverGeIntTintPhysicalFunction.hpp new file mode 100644 index 0000000000..0d4aec75ec --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverGeIntTintPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `ever_ge_int_tint`. + * + * Per-event ever_ge_int_tint: tests if a single-instant tfloat value ever equals a threshold. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class EverGeIntTintPhysicalFunction : public PhysicalFunctionConcept { +public: + EverGeIntTintPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverGtBigintTbigintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverGtBigintTbigintPhysicalFunction.hpp new file mode 100644 index 0000000000..b8b9a59577 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverGtBigintTbigintPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `ever_gt_bigint_tbigint`. + * + * Per-event ever_gt_bigint_tbigint: tests if a single-instant tfloat value ever equals a threshold. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class EverGtBigintTbigintPhysicalFunction : public PhysicalFunctionConcept { +public: + EverGtBigintTbigintPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverGtFloatTfloatPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverGtFloatTfloatPhysicalFunction.hpp new file mode 100644 index 0000000000..cf44748abf --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverGtFloatTfloatPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `ever_gt_float_tfloat`. + * + * Per-event ever_gt_float_tfloat: tests if a scalar is ever gt to a single-instant tfloat value. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class EverGtFloatTfloatPhysicalFunction : public PhysicalFunctionConcept { +public: + EverGtFloatTfloatPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverGtIntTintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverGtIntTintPhysicalFunction.hpp new file mode 100644 index 0000000000..13d66aded4 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverGtIntTintPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `ever_gt_int_tint`. + * + * Per-event ever_gt_int_tint: tests if a single-instant tfloat value ever equals a threshold. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class EverGtIntTintPhysicalFunction : public PhysicalFunctionConcept { +public: + EverGtIntTintPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverLeBigintTbigintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverLeBigintTbigintPhysicalFunction.hpp new file mode 100644 index 0000000000..186b8bf9d2 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverLeBigintTbigintPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `ever_le_bigint_tbigint`. + * + * Per-event ever_le_bigint_tbigint: tests if a single-instant tfloat value ever equals a threshold. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class EverLeBigintTbigintPhysicalFunction : public PhysicalFunctionConcept { +public: + EverLeBigintTbigintPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverLeFloatTfloatPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverLeFloatTfloatPhysicalFunction.hpp new file mode 100644 index 0000000000..ad1b285874 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverLeFloatTfloatPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `ever_le_float_tfloat`. + * + * Per-event ever_le_float_tfloat: tests if a scalar is ever le to a single-instant tfloat value. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class EverLeFloatTfloatPhysicalFunction : public PhysicalFunctionConcept { +public: + EverLeFloatTfloatPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverLeIntTintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverLeIntTintPhysicalFunction.hpp new file mode 100644 index 0000000000..0260d63939 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverLeIntTintPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `ever_le_int_tint`. + * + * Per-event ever_le_int_tint: tests if a single-instant tfloat value ever equals a threshold. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class EverLeIntTintPhysicalFunction : public PhysicalFunctionConcept { +public: + EverLeIntTintPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverLtBigintTbigintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverLtBigintTbigintPhysicalFunction.hpp new file mode 100644 index 0000000000..3496b311cd --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverLtBigintTbigintPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `ever_lt_bigint_tbigint`. + * + * Per-event ever_lt_bigint_tbigint: tests if a single-instant tfloat value ever equals a threshold. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class EverLtBigintTbigintPhysicalFunction : public PhysicalFunctionConcept { +public: + EverLtBigintTbigintPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverLtFloatTfloatPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverLtFloatTfloatPhysicalFunction.hpp new file mode 100644 index 0000000000..02217926dd --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverLtFloatTfloatPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `ever_lt_float_tfloat`. + * + * Per-event ever_lt_float_tfloat: tests if a scalar is ever lt to a single-instant tfloat value. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class EverLtFloatTfloatPhysicalFunction : public PhysicalFunctionConcept { +public: + EverLtFloatTfloatPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverLtIntTintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverLtIntTintPhysicalFunction.hpp new file mode 100644 index 0000000000..f447038773 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverLtIntTintPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `ever_lt_int_tint`. + * + * Per-event ever_lt_int_tint: tests if a single-instant tfloat value ever equals a threshold. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class EverLtIntTintPhysicalFunction : public PhysicalFunctionConcept { +public: + EverLtIntTintPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverNeBigintTbigintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverNeBigintTbigintPhysicalFunction.hpp new file mode 100644 index 0000000000..61cdf7d943 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverNeBigintTbigintPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `ever_ne_bigint_tbigint`. + * + * Per-event ever_ne_bigint_tbigint: tests if a single-instant tfloat value ever equals a threshold. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class EverNeBigintTbigintPhysicalFunction : public PhysicalFunctionConcept { +public: + EverNeBigintTbigintPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverNeFloatTfloatPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverNeFloatTfloatPhysicalFunction.hpp new file mode 100644 index 0000000000..084a68f0f4 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverNeFloatTfloatPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `ever_ne_float_tfloat`. + * + * Per-event ever_ne_float_tfloat: tests if a scalar is ever ne to a single-instant tfloat value. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class EverNeFloatTfloatPhysicalFunction : public PhysicalFunctionConcept { +public: + EverNeFloatTfloatPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverNeIntTintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverNeIntTintPhysicalFunction.hpp new file mode 100644 index 0000000000..47c3375c13 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverNeIntTintPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `ever_ne_int_tint`. + * + * Per-event ever_ne_int_tint: tests if a single-instant tfloat value ever equals a threshold. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class EverNeIntTintPhysicalFunction : public PhysicalFunctionConcept { +public: + EverNeIntTintPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysEqBigintTbigintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysEqBigintTbigintPhysicalFunction.cpp new file mode 100644 index 0000000000..48bb0541a1 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysEqBigintTbigintPhysicalFunction.cpp @@ -0,0 +1,89 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +AlwaysEqBigintTbigintPhysicalFunction::AlwaysEqBigintTbigintPhysicalFunction(PhysicalFunction scalarFunction, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(scalarFunction)); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal AlwaysEqBigintTbigintPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto scalar = parameterValues[0].cast>(); + auto value = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double d, double v, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = fmt::format("{}@{}", static_cast(v), ts_str); + Temporal* temp = tbigint_in(wkt.c_str()); + if (!temp) return 0.0; + int r = always_eq_bigint_tbigint(static_cast(d), temp); + free(temp); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + scalar, value, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysEqBigintTbigintPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "AlwaysEqBigintTbigintPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return AlwaysEqBigintTbigintPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysEqFloatTfloatPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysEqFloatTfloatPhysicalFunction.cpp new file mode 100644 index 0000000000..adbad75361 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysEqFloatTfloatPhysicalFunction.cpp @@ -0,0 +1,89 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +AlwaysEqFloatTfloatPhysicalFunction::AlwaysEqFloatTfloatPhysicalFunction(PhysicalFunction scalarFunction, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(scalarFunction)); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal AlwaysEqFloatTfloatPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto scalar = parameterValues[0].cast>(); + auto value = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double d, double v, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = fmt::format("{}@{}", v, ts_str); + Temporal* temp = tfloat_in(wkt.c_str()); + if (!temp) return 0.0; + int r = always_eq_float_tfloat(d, temp); + free(temp); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + scalar, value, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysEqFloatTfloatPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "AlwaysEqFloatTfloatPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return AlwaysEqFloatTfloatPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysEqIntTintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysEqIntTintPhysicalFunction.cpp new file mode 100644 index 0000000000..a43043a402 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysEqIntTintPhysicalFunction.cpp @@ -0,0 +1,89 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +AlwaysEqIntTintPhysicalFunction::AlwaysEqIntTintPhysicalFunction(PhysicalFunction scalarFunction, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(scalarFunction)); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal AlwaysEqIntTintPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto scalar = parameterValues[0].cast>(); + auto value = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double d, double v, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = fmt::format("{}@{}", static_cast(v), ts_str); + Temporal* temp = tint_in(wkt.c_str()); + if (!temp) return 0.0; + int r = always_eq_int_tint(static_cast(d), temp); + free(temp); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + scalar, value, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysEqIntTintPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "AlwaysEqIntTintPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return AlwaysEqIntTintPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysGeBigintTbigintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysGeBigintTbigintPhysicalFunction.cpp new file mode 100644 index 0000000000..27ecad58bc --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysGeBigintTbigintPhysicalFunction.cpp @@ -0,0 +1,89 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +AlwaysGeBigintTbigintPhysicalFunction::AlwaysGeBigintTbigintPhysicalFunction(PhysicalFunction scalarFunction, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(scalarFunction)); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal AlwaysGeBigintTbigintPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto scalar = parameterValues[0].cast>(); + auto value = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double d, double v, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = fmt::format("{}@{}", static_cast(v), ts_str); + Temporal* temp = tbigint_in(wkt.c_str()); + if (!temp) return 0.0; + int r = always_ge_bigint_tbigint(static_cast(d), temp); + free(temp); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + scalar, value, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysGeBigintTbigintPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "AlwaysGeBigintTbigintPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return AlwaysGeBigintTbigintPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysGeFloatTfloatPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysGeFloatTfloatPhysicalFunction.cpp new file mode 100644 index 0000000000..93855a2293 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysGeFloatTfloatPhysicalFunction.cpp @@ -0,0 +1,89 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +AlwaysGeFloatTfloatPhysicalFunction::AlwaysGeFloatTfloatPhysicalFunction(PhysicalFunction scalarFunction, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(scalarFunction)); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal AlwaysGeFloatTfloatPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto scalar = parameterValues[0].cast>(); + auto value = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double d, double v, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = fmt::format("{}@{}", v, ts_str); + Temporal* temp = tfloat_in(wkt.c_str()); + if (!temp) return 0.0; + int r = always_ge_float_tfloat(d, temp); + free(temp); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + scalar, value, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysGeFloatTfloatPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "AlwaysGeFloatTfloatPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return AlwaysGeFloatTfloatPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysGeIntTintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysGeIntTintPhysicalFunction.cpp new file mode 100644 index 0000000000..83fec1d6f1 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysGeIntTintPhysicalFunction.cpp @@ -0,0 +1,89 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +AlwaysGeIntTintPhysicalFunction::AlwaysGeIntTintPhysicalFunction(PhysicalFunction scalarFunction, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(scalarFunction)); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal AlwaysGeIntTintPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto scalar = parameterValues[0].cast>(); + auto value = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double d, double v, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = fmt::format("{}@{}", static_cast(v), ts_str); + Temporal* temp = tint_in(wkt.c_str()); + if (!temp) return 0.0; + int r = always_ge_int_tint(static_cast(d), temp); + free(temp); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + scalar, value, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysGeIntTintPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "AlwaysGeIntTintPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return AlwaysGeIntTintPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysGtBigintTbigintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysGtBigintTbigintPhysicalFunction.cpp new file mode 100644 index 0000000000..02b2f7e25c --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysGtBigintTbigintPhysicalFunction.cpp @@ -0,0 +1,89 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +AlwaysGtBigintTbigintPhysicalFunction::AlwaysGtBigintTbigintPhysicalFunction(PhysicalFunction scalarFunction, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(scalarFunction)); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal AlwaysGtBigintTbigintPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto scalar = parameterValues[0].cast>(); + auto value = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double d, double v, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = fmt::format("{}@{}", static_cast(v), ts_str); + Temporal* temp = tbigint_in(wkt.c_str()); + if (!temp) return 0.0; + int r = always_gt_bigint_tbigint(static_cast(d), temp); + free(temp); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + scalar, value, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysGtBigintTbigintPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "AlwaysGtBigintTbigintPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return AlwaysGtBigintTbigintPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysGtFloatTfloatPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysGtFloatTfloatPhysicalFunction.cpp new file mode 100644 index 0000000000..9bf4cba71e --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysGtFloatTfloatPhysicalFunction.cpp @@ -0,0 +1,89 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +AlwaysGtFloatTfloatPhysicalFunction::AlwaysGtFloatTfloatPhysicalFunction(PhysicalFunction scalarFunction, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(scalarFunction)); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal AlwaysGtFloatTfloatPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto scalar = parameterValues[0].cast>(); + auto value = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double d, double v, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = fmt::format("{}@{}", v, ts_str); + Temporal* temp = tfloat_in(wkt.c_str()); + if (!temp) return 0.0; + int r = always_gt_float_tfloat(d, temp); + free(temp); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + scalar, value, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysGtFloatTfloatPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "AlwaysGtFloatTfloatPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return AlwaysGtFloatTfloatPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysGtIntTintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysGtIntTintPhysicalFunction.cpp new file mode 100644 index 0000000000..0c49bcb409 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysGtIntTintPhysicalFunction.cpp @@ -0,0 +1,89 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +AlwaysGtIntTintPhysicalFunction::AlwaysGtIntTintPhysicalFunction(PhysicalFunction scalarFunction, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(scalarFunction)); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal AlwaysGtIntTintPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto scalar = parameterValues[0].cast>(); + auto value = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double d, double v, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = fmt::format("{}@{}", static_cast(v), ts_str); + Temporal* temp = tint_in(wkt.c_str()); + if (!temp) return 0.0; + int r = always_gt_int_tint(static_cast(d), temp); + free(temp); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + scalar, value, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysGtIntTintPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "AlwaysGtIntTintPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return AlwaysGtIntTintPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysLeBigintTbigintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysLeBigintTbigintPhysicalFunction.cpp new file mode 100644 index 0000000000..7ab05b7beb --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysLeBigintTbigintPhysicalFunction.cpp @@ -0,0 +1,89 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +AlwaysLeBigintTbigintPhysicalFunction::AlwaysLeBigintTbigintPhysicalFunction(PhysicalFunction scalarFunction, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(scalarFunction)); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal AlwaysLeBigintTbigintPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto scalar = parameterValues[0].cast>(); + auto value = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double d, double v, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = fmt::format("{}@{}", static_cast(v), ts_str); + Temporal* temp = tbigint_in(wkt.c_str()); + if (!temp) return 0.0; + int r = always_le_bigint_tbigint(static_cast(d), temp); + free(temp); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + scalar, value, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysLeBigintTbigintPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "AlwaysLeBigintTbigintPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return AlwaysLeBigintTbigintPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysLeFloatTfloatPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysLeFloatTfloatPhysicalFunction.cpp new file mode 100644 index 0000000000..f69c9bd365 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysLeFloatTfloatPhysicalFunction.cpp @@ -0,0 +1,89 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +AlwaysLeFloatTfloatPhysicalFunction::AlwaysLeFloatTfloatPhysicalFunction(PhysicalFunction scalarFunction, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(scalarFunction)); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal AlwaysLeFloatTfloatPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto scalar = parameterValues[0].cast>(); + auto value = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double d, double v, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = fmt::format("{}@{}", v, ts_str); + Temporal* temp = tfloat_in(wkt.c_str()); + if (!temp) return 0.0; + int r = always_le_float_tfloat(d, temp); + free(temp); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + scalar, value, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysLeFloatTfloatPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "AlwaysLeFloatTfloatPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return AlwaysLeFloatTfloatPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysLeIntTintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysLeIntTintPhysicalFunction.cpp new file mode 100644 index 0000000000..1611434857 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysLeIntTintPhysicalFunction.cpp @@ -0,0 +1,89 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +AlwaysLeIntTintPhysicalFunction::AlwaysLeIntTintPhysicalFunction(PhysicalFunction scalarFunction, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(scalarFunction)); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal AlwaysLeIntTintPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto scalar = parameterValues[0].cast>(); + auto value = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double d, double v, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = fmt::format("{}@{}", static_cast(v), ts_str); + Temporal* temp = tint_in(wkt.c_str()); + if (!temp) return 0.0; + int r = always_le_int_tint(static_cast(d), temp); + free(temp); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + scalar, value, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysLeIntTintPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "AlwaysLeIntTintPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return AlwaysLeIntTintPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysLtBigintTbigintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysLtBigintTbigintPhysicalFunction.cpp new file mode 100644 index 0000000000..04418bb813 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysLtBigintTbigintPhysicalFunction.cpp @@ -0,0 +1,89 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +AlwaysLtBigintTbigintPhysicalFunction::AlwaysLtBigintTbigintPhysicalFunction(PhysicalFunction scalarFunction, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(scalarFunction)); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal AlwaysLtBigintTbigintPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto scalar = parameterValues[0].cast>(); + auto value = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double d, double v, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = fmt::format("{}@{}", static_cast(v), ts_str); + Temporal* temp = tbigint_in(wkt.c_str()); + if (!temp) return 0.0; + int r = always_lt_bigint_tbigint(static_cast(d), temp); + free(temp); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + scalar, value, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysLtBigintTbigintPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "AlwaysLtBigintTbigintPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return AlwaysLtBigintTbigintPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysLtFloatTfloatPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysLtFloatTfloatPhysicalFunction.cpp new file mode 100644 index 0000000000..224a4d41b0 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysLtFloatTfloatPhysicalFunction.cpp @@ -0,0 +1,89 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +AlwaysLtFloatTfloatPhysicalFunction::AlwaysLtFloatTfloatPhysicalFunction(PhysicalFunction scalarFunction, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(scalarFunction)); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal AlwaysLtFloatTfloatPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto scalar = parameterValues[0].cast>(); + auto value = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double d, double v, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = fmt::format("{}@{}", v, ts_str); + Temporal* temp = tfloat_in(wkt.c_str()); + if (!temp) return 0.0; + int r = always_lt_float_tfloat(d, temp); + free(temp); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + scalar, value, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysLtFloatTfloatPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "AlwaysLtFloatTfloatPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return AlwaysLtFloatTfloatPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysLtIntTintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysLtIntTintPhysicalFunction.cpp new file mode 100644 index 0000000000..c4d6aee74a --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysLtIntTintPhysicalFunction.cpp @@ -0,0 +1,89 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +AlwaysLtIntTintPhysicalFunction::AlwaysLtIntTintPhysicalFunction(PhysicalFunction scalarFunction, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(scalarFunction)); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal AlwaysLtIntTintPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto scalar = parameterValues[0].cast>(); + auto value = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double d, double v, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = fmt::format("{}@{}", static_cast(v), ts_str); + Temporal* temp = tint_in(wkt.c_str()); + if (!temp) return 0.0; + int r = always_lt_int_tint(static_cast(d), temp); + free(temp); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + scalar, value, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysLtIntTintPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "AlwaysLtIntTintPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return AlwaysLtIntTintPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysNeBigintTbigintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysNeBigintTbigintPhysicalFunction.cpp new file mode 100644 index 0000000000..efc2b248c5 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysNeBigintTbigintPhysicalFunction.cpp @@ -0,0 +1,89 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +AlwaysNeBigintTbigintPhysicalFunction::AlwaysNeBigintTbigintPhysicalFunction(PhysicalFunction scalarFunction, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(scalarFunction)); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal AlwaysNeBigintTbigintPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto scalar = parameterValues[0].cast>(); + auto value = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double d, double v, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = fmt::format("{}@{}", static_cast(v), ts_str); + Temporal* temp = tbigint_in(wkt.c_str()); + if (!temp) return 0.0; + int r = always_ne_bigint_tbigint(static_cast(d), temp); + free(temp); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + scalar, value, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysNeBigintTbigintPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "AlwaysNeBigintTbigintPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return AlwaysNeBigintTbigintPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysNeFloatTfloatPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysNeFloatTfloatPhysicalFunction.cpp new file mode 100644 index 0000000000..86929b6420 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysNeFloatTfloatPhysicalFunction.cpp @@ -0,0 +1,89 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +AlwaysNeFloatTfloatPhysicalFunction::AlwaysNeFloatTfloatPhysicalFunction(PhysicalFunction scalarFunction, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(scalarFunction)); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal AlwaysNeFloatTfloatPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto scalar = parameterValues[0].cast>(); + auto value = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double d, double v, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = fmt::format("{}@{}", v, ts_str); + Temporal* temp = tfloat_in(wkt.c_str()); + if (!temp) return 0.0; + int r = always_ne_float_tfloat(d, temp); + free(temp); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + scalar, value, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysNeFloatTfloatPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "AlwaysNeFloatTfloatPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return AlwaysNeFloatTfloatPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysNeIntTintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysNeIntTintPhysicalFunction.cpp new file mode 100644 index 0000000000..31a2bed532 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysNeIntTintPhysicalFunction.cpp @@ -0,0 +1,89 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +AlwaysNeIntTintPhysicalFunction::AlwaysNeIntTintPhysicalFunction(PhysicalFunction scalarFunction, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(scalarFunction)); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal AlwaysNeIntTintPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto scalar = parameterValues[0].cast>(); + auto value = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double d, double v, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = fmt::format("{}@{}", static_cast(v), ts_str); + Temporal* temp = tint_in(wkt.c_str()); + if (!temp) return 0.0; + int r = always_ne_int_tint(static_cast(d), temp); + free(temp); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + scalar, value, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysNeIntTintPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "AlwaysNeIntTintPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return AlwaysNeIntTintPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt index 1bd1c2eae2..bd3c465f90 100644 --- a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt @@ -147,4 +147,40 @@ add_plugin(AlwaysGtTbigintTbigint PhysicalFunction nes-physical-operators Always add_plugin(AlwaysLeTbigintTbigint PhysicalFunction nes-physical-operators AlwaysLeTbigintTbigintPhysicalFunction.cpp) add_plugin(AlwaysLtTbigintTbigint PhysicalFunction nes-physical-operators AlwaysLtTbigintTbigintPhysicalFunction.cpp) add_plugin(AlwaysNeTbigintTbigint PhysicalFunction nes-physical-operators AlwaysNeTbigintTbigintPhysicalFunction.cpp) +add_plugin(EverEqFloatTfloat PhysicalFunction nes-physical-operators EverEqFloatTfloatPhysicalFunction.cpp) +add_plugin(EverGeFloatTfloat PhysicalFunction nes-physical-operators EverGeFloatTfloatPhysicalFunction.cpp) +add_plugin(EverGtFloatTfloat PhysicalFunction nes-physical-operators EverGtFloatTfloatPhysicalFunction.cpp) +add_plugin(EverLeFloatTfloat PhysicalFunction nes-physical-operators EverLeFloatTfloatPhysicalFunction.cpp) +add_plugin(EverLtFloatTfloat PhysicalFunction nes-physical-operators EverLtFloatTfloatPhysicalFunction.cpp) +add_plugin(EverNeFloatTfloat PhysicalFunction nes-physical-operators EverNeFloatTfloatPhysicalFunction.cpp) +add_plugin(EverEqIntTint PhysicalFunction nes-physical-operators EverEqIntTintPhysicalFunction.cpp) +add_plugin(EverGeIntTint PhysicalFunction nes-physical-operators EverGeIntTintPhysicalFunction.cpp) +add_plugin(EverGtIntTint PhysicalFunction nes-physical-operators EverGtIntTintPhysicalFunction.cpp) +add_plugin(EverLeIntTint PhysicalFunction nes-physical-operators EverLeIntTintPhysicalFunction.cpp) +add_plugin(EverLtIntTint PhysicalFunction nes-physical-operators EverLtIntTintPhysicalFunction.cpp) +add_plugin(EverNeIntTint PhysicalFunction nes-physical-operators EverNeIntTintPhysicalFunction.cpp) +add_plugin(EverEqBigintTbigint PhysicalFunction nes-physical-operators EverEqBigintTbigintPhysicalFunction.cpp) +add_plugin(EverGeBigintTbigint PhysicalFunction nes-physical-operators EverGeBigintTbigintPhysicalFunction.cpp) +add_plugin(EverGtBigintTbigint PhysicalFunction nes-physical-operators EverGtBigintTbigintPhysicalFunction.cpp) +add_plugin(EverLeBigintTbigint PhysicalFunction nes-physical-operators EverLeBigintTbigintPhysicalFunction.cpp) +add_plugin(EverLtBigintTbigint PhysicalFunction nes-physical-operators EverLtBigintTbigintPhysicalFunction.cpp) +add_plugin(EverNeBigintTbigint PhysicalFunction nes-physical-operators EverNeBigintTbigintPhysicalFunction.cpp) +add_plugin(AlwaysEqFloatTfloat PhysicalFunction nes-physical-operators AlwaysEqFloatTfloatPhysicalFunction.cpp) +add_plugin(AlwaysGeFloatTfloat PhysicalFunction nes-physical-operators AlwaysGeFloatTfloatPhysicalFunction.cpp) +add_plugin(AlwaysGtFloatTfloat PhysicalFunction nes-physical-operators AlwaysGtFloatTfloatPhysicalFunction.cpp) +add_plugin(AlwaysLeFloatTfloat PhysicalFunction nes-physical-operators AlwaysLeFloatTfloatPhysicalFunction.cpp) +add_plugin(AlwaysLtFloatTfloat PhysicalFunction nes-physical-operators AlwaysLtFloatTfloatPhysicalFunction.cpp) +add_plugin(AlwaysNeFloatTfloat PhysicalFunction nes-physical-operators AlwaysNeFloatTfloatPhysicalFunction.cpp) +add_plugin(AlwaysEqIntTint PhysicalFunction nes-physical-operators AlwaysEqIntTintPhysicalFunction.cpp) +add_plugin(AlwaysGeIntTint PhysicalFunction nes-physical-operators AlwaysGeIntTintPhysicalFunction.cpp) +add_plugin(AlwaysGtIntTint PhysicalFunction nes-physical-operators AlwaysGtIntTintPhysicalFunction.cpp) +add_plugin(AlwaysLeIntTint PhysicalFunction nes-physical-operators AlwaysLeIntTintPhysicalFunction.cpp) +add_plugin(AlwaysLtIntTint PhysicalFunction nes-physical-operators AlwaysLtIntTintPhysicalFunction.cpp) +add_plugin(AlwaysNeIntTint PhysicalFunction nes-physical-operators AlwaysNeIntTintPhysicalFunction.cpp) +add_plugin(AlwaysEqBigintTbigint PhysicalFunction nes-physical-operators AlwaysEqBigintTbigintPhysicalFunction.cpp) +add_plugin(AlwaysGeBigintTbigint PhysicalFunction nes-physical-operators AlwaysGeBigintTbigintPhysicalFunction.cpp) +add_plugin(AlwaysGtBigintTbigint PhysicalFunction nes-physical-operators AlwaysGtBigintTbigintPhysicalFunction.cpp) +add_plugin(AlwaysLeBigintTbigint PhysicalFunction nes-physical-operators AlwaysLeBigintTbigintPhysicalFunction.cpp) +add_plugin(AlwaysLtBigintTbigint PhysicalFunction nes-physical-operators AlwaysLtBigintTbigintPhysicalFunction.cpp) +add_plugin(AlwaysNeBigintTbigint PhysicalFunction nes-physical-operators AlwaysNeBigintTbigintPhysicalFunction.cpp) endif() diff --git a/nes-physical-operators/src/Functions/Meos/EverEqBigintTbigintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverEqBigintTbigintPhysicalFunction.cpp new file mode 100644 index 0000000000..b287987b4f --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverEqBigintTbigintPhysicalFunction.cpp @@ -0,0 +1,89 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +EverEqBigintTbigintPhysicalFunction::EverEqBigintTbigintPhysicalFunction(PhysicalFunction scalarFunction, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(scalarFunction)); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal EverEqBigintTbigintPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto scalar = parameterValues[0].cast>(); + auto value = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double d, double v, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = fmt::format("{}@{}", static_cast(v), ts_str); + Temporal* temp = tbigint_in(wkt.c_str()); + if (!temp) return 0.0; + int r = ever_eq_bigint_tbigint(static_cast(d), temp); + free(temp); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + scalar, value, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverEqBigintTbigintPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "EverEqBigintTbigintPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return EverEqBigintTbigintPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverEqFloatTfloatPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverEqFloatTfloatPhysicalFunction.cpp new file mode 100644 index 0000000000..56093e5c87 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverEqFloatTfloatPhysicalFunction.cpp @@ -0,0 +1,89 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +EverEqFloatTfloatPhysicalFunction::EverEqFloatTfloatPhysicalFunction(PhysicalFunction scalarFunction, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(scalarFunction)); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal EverEqFloatTfloatPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto scalar = parameterValues[0].cast>(); + auto value = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double d, double v, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = fmt::format("{}@{}", v, ts_str); + Temporal* temp = tfloat_in(wkt.c_str()); + if (!temp) return 0.0; + int r = ever_eq_float_tfloat(d, temp); + free(temp); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + scalar, value, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverEqFloatTfloatPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "EverEqFloatTfloatPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return EverEqFloatTfloatPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverEqIntTintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverEqIntTintPhysicalFunction.cpp new file mode 100644 index 0000000000..0a6d80b3c6 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverEqIntTintPhysicalFunction.cpp @@ -0,0 +1,89 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +EverEqIntTintPhysicalFunction::EverEqIntTintPhysicalFunction(PhysicalFunction scalarFunction, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(scalarFunction)); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal EverEqIntTintPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto scalar = parameterValues[0].cast>(); + auto value = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double d, double v, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = fmt::format("{}@{}", static_cast(v), ts_str); + Temporal* temp = tint_in(wkt.c_str()); + if (!temp) return 0.0; + int r = ever_eq_int_tint(static_cast(d), temp); + free(temp); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + scalar, value, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverEqIntTintPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "EverEqIntTintPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return EverEqIntTintPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverGeBigintTbigintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverGeBigintTbigintPhysicalFunction.cpp new file mode 100644 index 0000000000..11e9eb48d4 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverGeBigintTbigintPhysicalFunction.cpp @@ -0,0 +1,89 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +EverGeBigintTbigintPhysicalFunction::EverGeBigintTbigintPhysicalFunction(PhysicalFunction scalarFunction, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(scalarFunction)); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal EverGeBigintTbigintPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto scalar = parameterValues[0].cast>(); + auto value = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double d, double v, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = fmt::format("{}@{}", static_cast(v), ts_str); + Temporal* temp = tbigint_in(wkt.c_str()); + if (!temp) return 0.0; + int r = ever_ge_bigint_tbigint(static_cast(d), temp); + free(temp); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + scalar, value, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverGeBigintTbigintPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "EverGeBigintTbigintPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return EverGeBigintTbigintPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverGeFloatTfloatPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverGeFloatTfloatPhysicalFunction.cpp new file mode 100644 index 0000000000..003cb07439 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverGeFloatTfloatPhysicalFunction.cpp @@ -0,0 +1,89 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +EverGeFloatTfloatPhysicalFunction::EverGeFloatTfloatPhysicalFunction(PhysicalFunction scalarFunction, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(scalarFunction)); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal EverGeFloatTfloatPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto scalar = parameterValues[0].cast>(); + auto value = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double d, double v, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = fmt::format("{}@{}", v, ts_str); + Temporal* temp = tfloat_in(wkt.c_str()); + if (!temp) return 0.0; + int r = ever_ge_float_tfloat(d, temp); + free(temp); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + scalar, value, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverGeFloatTfloatPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "EverGeFloatTfloatPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return EverGeFloatTfloatPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverGeIntTintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverGeIntTintPhysicalFunction.cpp new file mode 100644 index 0000000000..591d6da944 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverGeIntTintPhysicalFunction.cpp @@ -0,0 +1,89 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +EverGeIntTintPhysicalFunction::EverGeIntTintPhysicalFunction(PhysicalFunction scalarFunction, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(scalarFunction)); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal EverGeIntTintPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto scalar = parameterValues[0].cast>(); + auto value = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double d, double v, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = fmt::format("{}@{}", static_cast(v), ts_str); + Temporal* temp = tint_in(wkt.c_str()); + if (!temp) return 0.0; + int r = ever_ge_int_tint(static_cast(d), temp); + free(temp); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + scalar, value, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverGeIntTintPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "EverGeIntTintPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return EverGeIntTintPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverGtBigintTbigintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverGtBigintTbigintPhysicalFunction.cpp new file mode 100644 index 0000000000..93b2b47576 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverGtBigintTbigintPhysicalFunction.cpp @@ -0,0 +1,89 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +EverGtBigintTbigintPhysicalFunction::EverGtBigintTbigintPhysicalFunction(PhysicalFunction scalarFunction, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(scalarFunction)); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal EverGtBigintTbigintPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto scalar = parameterValues[0].cast>(); + auto value = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double d, double v, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = fmt::format("{}@{}", static_cast(v), ts_str); + Temporal* temp = tbigint_in(wkt.c_str()); + if (!temp) return 0.0; + int r = ever_gt_bigint_tbigint(static_cast(d), temp); + free(temp); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + scalar, value, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverGtBigintTbigintPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "EverGtBigintTbigintPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return EverGtBigintTbigintPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverGtFloatTfloatPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverGtFloatTfloatPhysicalFunction.cpp new file mode 100644 index 0000000000..21979000ba --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverGtFloatTfloatPhysicalFunction.cpp @@ -0,0 +1,89 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +EverGtFloatTfloatPhysicalFunction::EverGtFloatTfloatPhysicalFunction(PhysicalFunction scalarFunction, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(scalarFunction)); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal EverGtFloatTfloatPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto scalar = parameterValues[0].cast>(); + auto value = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double d, double v, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = fmt::format("{}@{}", v, ts_str); + Temporal* temp = tfloat_in(wkt.c_str()); + if (!temp) return 0.0; + int r = ever_gt_float_tfloat(d, temp); + free(temp); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + scalar, value, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverGtFloatTfloatPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "EverGtFloatTfloatPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return EverGtFloatTfloatPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverGtIntTintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverGtIntTintPhysicalFunction.cpp new file mode 100644 index 0000000000..a3cdf414ed --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverGtIntTintPhysicalFunction.cpp @@ -0,0 +1,89 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +EverGtIntTintPhysicalFunction::EverGtIntTintPhysicalFunction(PhysicalFunction scalarFunction, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(scalarFunction)); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal EverGtIntTintPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto scalar = parameterValues[0].cast>(); + auto value = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double d, double v, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = fmt::format("{}@{}", static_cast(v), ts_str); + Temporal* temp = tint_in(wkt.c_str()); + if (!temp) return 0.0; + int r = ever_gt_int_tint(static_cast(d), temp); + free(temp); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + scalar, value, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverGtIntTintPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "EverGtIntTintPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return EverGtIntTintPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverLeBigintTbigintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverLeBigintTbigintPhysicalFunction.cpp new file mode 100644 index 0000000000..df155c47aa --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverLeBigintTbigintPhysicalFunction.cpp @@ -0,0 +1,89 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +EverLeBigintTbigintPhysicalFunction::EverLeBigintTbigintPhysicalFunction(PhysicalFunction scalarFunction, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(scalarFunction)); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal EverLeBigintTbigintPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto scalar = parameterValues[0].cast>(); + auto value = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double d, double v, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = fmt::format("{}@{}", static_cast(v), ts_str); + Temporal* temp = tbigint_in(wkt.c_str()); + if (!temp) return 0.0; + int r = ever_le_bigint_tbigint(static_cast(d), temp); + free(temp); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + scalar, value, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverLeBigintTbigintPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "EverLeBigintTbigintPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return EverLeBigintTbigintPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverLeFloatTfloatPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverLeFloatTfloatPhysicalFunction.cpp new file mode 100644 index 0000000000..647b06a520 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverLeFloatTfloatPhysicalFunction.cpp @@ -0,0 +1,89 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +EverLeFloatTfloatPhysicalFunction::EverLeFloatTfloatPhysicalFunction(PhysicalFunction scalarFunction, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(scalarFunction)); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal EverLeFloatTfloatPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto scalar = parameterValues[0].cast>(); + auto value = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double d, double v, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = fmt::format("{}@{}", v, ts_str); + Temporal* temp = tfloat_in(wkt.c_str()); + if (!temp) return 0.0; + int r = ever_le_float_tfloat(d, temp); + free(temp); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + scalar, value, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverLeFloatTfloatPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "EverLeFloatTfloatPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return EverLeFloatTfloatPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverLeIntTintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverLeIntTintPhysicalFunction.cpp new file mode 100644 index 0000000000..b04ec7be4f --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverLeIntTintPhysicalFunction.cpp @@ -0,0 +1,89 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +EverLeIntTintPhysicalFunction::EverLeIntTintPhysicalFunction(PhysicalFunction scalarFunction, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(scalarFunction)); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal EverLeIntTintPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto scalar = parameterValues[0].cast>(); + auto value = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double d, double v, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = fmt::format("{}@{}", static_cast(v), ts_str); + Temporal* temp = tint_in(wkt.c_str()); + if (!temp) return 0.0; + int r = ever_le_int_tint(static_cast(d), temp); + free(temp); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + scalar, value, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverLeIntTintPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "EverLeIntTintPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return EverLeIntTintPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverLtBigintTbigintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverLtBigintTbigintPhysicalFunction.cpp new file mode 100644 index 0000000000..415516e939 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverLtBigintTbigintPhysicalFunction.cpp @@ -0,0 +1,89 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +EverLtBigintTbigintPhysicalFunction::EverLtBigintTbigintPhysicalFunction(PhysicalFunction scalarFunction, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(scalarFunction)); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal EverLtBigintTbigintPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto scalar = parameterValues[0].cast>(); + auto value = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double d, double v, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = fmt::format("{}@{}", static_cast(v), ts_str); + Temporal* temp = tbigint_in(wkt.c_str()); + if (!temp) return 0.0; + int r = ever_lt_bigint_tbigint(static_cast(d), temp); + free(temp); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + scalar, value, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverLtBigintTbigintPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "EverLtBigintTbigintPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return EverLtBigintTbigintPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverLtFloatTfloatPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverLtFloatTfloatPhysicalFunction.cpp new file mode 100644 index 0000000000..445ac1ee7f --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverLtFloatTfloatPhysicalFunction.cpp @@ -0,0 +1,89 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +EverLtFloatTfloatPhysicalFunction::EverLtFloatTfloatPhysicalFunction(PhysicalFunction scalarFunction, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(scalarFunction)); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal EverLtFloatTfloatPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto scalar = parameterValues[0].cast>(); + auto value = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double d, double v, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = fmt::format("{}@{}", v, ts_str); + Temporal* temp = tfloat_in(wkt.c_str()); + if (!temp) return 0.0; + int r = ever_lt_float_tfloat(d, temp); + free(temp); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + scalar, value, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverLtFloatTfloatPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "EverLtFloatTfloatPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return EverLtFloatTfloatPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverLtIntTintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverLtIntTintPhysicalFunction.cpp new file mode 100644 index 0000000000..6f3120d6ff --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverLtIntTintPhysicalFunction.cpp @@ -0,0 +1,89 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +EverLtIntTintPhysicalFunction::EverLtIntTintPhysicalFunction(PhysicalFunction scalarFunction, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(scalarFunction)); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal EverLtIntTintPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto scalar = parameterValues[0].cast>(); + auto value = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double d, double v, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = fmt::format("{}@{}", static_cast(v), ts_str); + Temporal* temp = tint_in(wkt.c_str()); + if (!temp) return 0.0; + int r = ever_lt_int_tint(static_cast(d), temp); + free(temp); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + scalar, value, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverLtIntTintPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "EverLtIntTintPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return EverLtIntTintPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverNeBigintTbigintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverNeBigintTbigintPhysicalFunction.cpp new file mode 100644 index 0000000000..e1bb0ccf09 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverNeBigintTbigintPhysicalFunction.cpp @@ -0,0 +1,89 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +EverNeBigintTbigintPhysicalFunction::EverNeBigintTbigintPhysicalFunction(PhysicalFunction scalarFunction, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(scalarFunction)); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal EverNeBigintTbigintPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto scalar = parameterValues[0].cast>(); + auto value = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double d, double v, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = fmt::format("{}@{}", static_cast(v), ts_str); + Temporal* temp = tbigint_in(wkt.c_str()); + if (!temp) return 0.0; + int r = ever_ne_bigint_tbigint(static_cast(d), temp); + free(temp); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + scalar, value, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverNeBigintTbigintPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "EverNeBigintTbigintPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return EverNeBigintTbigintPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverNeFloatTfloatPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverNeFloatTfloatPhysicalFunction.cpp new file mode 100644 index 0000000000..f0ca251bcd --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverNeFloatTfloatPhysicalFunction.cpp @@ -0,0 +1,89 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +EverNeFloatTfloatPhysicalFunction::EverNeFloatTfloatPhysicalFunction(PhysicalFunction scalarFunction, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(scalarFunction)); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal EverNeFloatTfloatPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto scalar = parameterValues[0].cast>(); + auto value = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double d, double v, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = fmt::format("{}@{}", v, ts_str); + Temporal* temp = tfloat_in(wkt.c_str()); + if (!temp) return 0.0; + int r = ever_ne_float_tfloat(d, temp); + free(temp); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + scalar, value, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverNeFloatTfloatPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "EverNeFloatTfloatPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return EverNeFloatTfloatPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverNeIntTintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverNeIntTintPhysicalFunction.cpp new file mode 100644 index 0000000000..e9ad540bb1 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverNeIntTintPhysicalFunction.cpp @@ -0,0 +1,89 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +EverNeIntTintPhysicalFunction::EverNeIntTintPhysicalFunction(PhysicalFunction scalarFunction, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(scalarFunction)); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal EverNeIntTintPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto scalar = parameterValues[0].cast>(); + auto value = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double d, double v, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = fmt::format("{}@{}", static_cast(v), ts_str); + Temporal* temp = tint_in(wkt.c_str()); + if (!temp) return 0.0; + int r = ever_ne_int_tint(static_cast(d), temp); + free(temp); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + scalar, value, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverNeIntTintPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "EverNeIntTintPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return EverNeIntTintPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-sql-parser/AntlrSQL.g4 b/nes-sql-parser/AntlrSQL.g4 index e445bb7205..648ccc7e2c 100644 --- a/nes-sql-parser/AntlrSQL.g4 +++ b/nes-sql-parser/AntlrSQL.g4 @@ -295,7 +295,7 @@ timeUnit: MS timestampParameter: name=identifier; -functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS; +functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS; sinkClause: INTO sink (',' sink)*; @@ -486,6 +486,12 @@ TEMPORAL_SEQUENCE: 'TEMPORAL_SEQUENCE' | 'temporal_sequence'; TEMPORAL_EINTERSECTS_GEOMETRY: 'TEMPORAL_EINTERSECTS_GEOMETRY' | 'temporal_eintersects_geometry'; TEMPORAL_AINTERSECTS_GEOMETRY: 'TEMPORAL_AINTERSECTS_GEOMETRY' | 'temporal_aintersects_geometry'; TEMPORAL_ECONTAINS_GEOMETRY: 'TEMPORAL_ECONTAINS_GEOMETRY' | 'temporal_econtains_geometry'; +ALWAYS_EQ_BIGINT_TBIGINT: 'ALWAYS_EQ_BIGINT_TBIGINT' | 'always_eq_bigint_tbigint'; +ALWAYS_GE_BIGINT_TBIGINT: 'ALWAYS_GE_BIGINT_TBIGINT' | 'always_ge_bigint_tbigint'; +ALWAYS_GT_BIGINT_TBIGINT: 'ALWAYS_GT_BIGINT_TBIGINT' | 'always_gt_bigint_tbigint'; +ALWAYS_LE_BIGINT_TBIGINT: 'ALWAYS_LE_BIGINT_TBIGINT' | 'always_le_bigint_tbigint'; +ALWAYS_LT_BIGINT_TBIGINT: 'ALWAYS_LT_BIGINT_TBIGINT' | 'always_lt_bigint_tbigint'; +ALWAYS_NE_BIGINT_TBIGINT: 'ALWAYS_NE_BIGINT_TBIGINT' | 'always_ne_bigint_tbigint'; ALWAYS_EQ_TBIGINT_BIGINT: 'ALWAYS_EQ_TBIGINT_BIGINT' | 'always_eq_tbigint_bigint'; ALWAYS_GE_TBIGINT_BIGINT: 'ALWAYS_GE_TBIGINT_BIGINT' | 'always_ge_tbigint_bigint'; ALWAYS_GT_TBIGINT_BIGINT: 'ALWAYS_GT_TBIGINT_BIGINT' | 'always_gt_tbigint_bigint'; @@ -498,6 +504,12 @@ ALWAYS_GT_TBIGINT_TBIGINT: 'ALWAYS_GT_TBIGINT_TBIGINT' | 'always_gt_tbigint_tbig ALWAYS_LE_TBIGINT_TBIGINT: 'ALWAYS_LE_TBIGINT_TBIGINT' | 'always_le_tbigint_tbigint'; ALWAYS_LT_TBIGINT_TBIGINT: 'ALWAYS_LT_TBIGINT_TBIGINT' | 'always_lt_tbigint_tbigint'; ALWAYS_NE_TBIGINT_TBIGINT: 'ALWAYS_NE_TBIGINT_TBIGINT' | 'always_ne_tbigint_tbigint'; +ALWAYS_EQ_FLOAT_TFLOAT: 'ALWAYS_EQ_FLOAT_TFLOAT' | 'always_eq_float_tfloat'; +ALWAYS_GE_FLOAT_TFLOAT: 'ALWAYS_GE_FLOAT_TFLOAT' | 'always_ge_float_tfloat'; +ALWAYS_GT_FLOAT_TFLOAT: 'ALWAYS_GT_FLOAT_TFLOAT' | 'always_gt_float_tfloat'; +ALWAYS_LE_FLOAT_TFLOAT: 'ALWAYS_LE_FLOAT_TFLOAT' | 'always_le_float_tfloat'; +ALWAYS_LT_FLOAT_TFLOAT: 'ALWAYS_LT_FLOAT_TFLOAT' | 'always_lt_float_tfloat'; +ALWAYS_NE_FLOAT_TFLOAT: 'ALWAYS_NE_FLOAT_TFLOAT' | 'always_ne_float_tfloat'; ALWAYS_EQ_TFLOAT_FLOAT: 'ALWAYS_EQ_TFLOAT_FLOAT' | 'always_eq_tfloat_float'; ALWAYS_GE_TFLOAT_FLOAT: 'ALWAYS_GE_TFLOAT_FLOAT' | 'always_ge_tfloat_float'; ALWAYS_GT_TFLOAT_FLOAT: 'ALWAYS_GT_TFLOAT_FLOAT' | 'always_gt_tfloat_float'; @@ -510,6 +522,12 @@ ALWAYS_GT_TFLOAT_TFLOAT: 'ALWAYS_GT_TFLOAT_TFLOAT' | 'always_gt_tfloat_tfloat'; ALWAYS_LE_TFLOAT_TFLOAT: 'ALWAYS_LE_TFLOAT_TFLOAT' | 'always_le_tfloat_tfloat'; ALWAYS_LT_TFLOAT_TFLOAT: 'ALWAYS_LT_TFLOAT_TFLOAT' | 'always_lt_tfloat_tfloat'; ALWAYS_NE_TFLOAT_TFLOAT: 'ALWAYS_NE_TFLOAT_TFLOAT' | 'always_ne_tfloat_tfloat'; +ALWAYS_EQ_INT_TINT: 'ALWAYS_EQ_INT_TINT' | 'always_eq_int_tint'; +ALWAYS_GE_INT_TINT: 'ALWAYS_GE_INT_TINT' | 'always_ge_int_tint'; +ALWAYS_GT_INT_TINT: 'ALWAYS_GT_INT_TINT' | 'always_gt_int_tint'; +ALWAYS_LE_INT_TINT: 'ALWAYS_LE_INT_TINT' | 'always_le_int_tint'; +ALWAYS_LT_INT_TINT: 'ALWAYS_LT_INT_TINT' | 'always_lt_int_tint'; +ALWAYS_NE_INT_TINT: 'ALWAYS_NE_INT_TINT' | 'always_ne_int_tint'; ALWAYS_EQ_TINT_INT: 'ALWAYS_EQ_TINT_INT' | 'always_eq_tint_int'; ALWAYS_GE_TINT_INT: 'ALWAYS_GE_TINT_INT' | 'always_ge_tint_int'; ALWAYS_GT_TINT_INT: 'ALWAYS_GT_TINT_INT' | 'always_gt_tint_int'; @@ -523,6 +541,12 @@ ALWAYS_LE_TINT_TINT: 'ALWAYS_LE_TINT_TINT' | 'always_le_tint_tint'; ALWAYS_LT_TINT_TINT: 'ALWAYS_LT_TINT_TINT' | 'always_lt_tint_tint'; ALWAYS_NE_TINT_TINT: 'ALWAYS_NE_TINT_TINT' | 'always_ne_tint_tint'; EDWITHIN_TGEO_GEO: 'EDWITHIN_TGEO_GEO' | 'edwithin_tgeo_geo'; +EVER_EQ_BIGINT_TBIGINT: 'EVER_EQ_BIGINT_TBIGINT' | 'ever_eq_bigint_tbigint'; +EVER_GE_BIGINT_TBIGINT: 'EVER_GE_BIGINT_TBIGINT' | 'ever_ge_bigint_tbigint'; +EVER_GT_BIGINT_TBIGINT: 'EVER_GT_BIGINT_TBIGINT' | 'ever_gt_bigint_tbigint'; +EVER_LE_BIGINT_TBIGINT: 'EVER_LE_BIGINT_TBIGINT' | 'ever_le_bigint_tbigint'; +EVER_LT_BIGINT_TBIGINT: 'EVER_LT_BIGINT_TBIGINT' | 'ever_lt_bigint_tbigint'; +EVER_NE_BIGINT_TBIGINT: 'EVER_NE_BIGINT_TBIGINT' | 'ever_ne_bigint_tbigint'; EVER_EQ_TBIGINT_BIGINT: 'EVER_EQ_TBIGINT_BIGINT' | 'ever_eq_tbigint_bigint'; EVER_GE_TBIGINT_BIGINT: 'EVER_GE_TBIGINT_BIGINT' | 'ever_ge_tbigint_bigint'; EVER_GT_TBIGINT_BIGINT: 'EVER_GT_TBIGINT_BIGINT' | 'ever_gt_tbigint_bigint'; @@ -535,6 +559,12 @@ EVER_GT_TBIGINT_TBIGINT: 'EVER_GT_TBIGINT_TBIGINT' | 'ever_gt_tbigint_tbigint'; EVER_LE_TBIGINT_TBIGINT: 'EVER_LE_TBIGINT_TBIGINT' | 'ever_le_tbigint_tbigint'; EVER_LT_TBIGINT_TBIGINT: 'EVER_LT_TBIGINT_TBIGINT' | 'ever_lt_tbigint_tbigint'; EVER_NE_TBIGINT_TBIGINT: 'EVER_NE_TBIGINT_TBIGINT' | 'ever_ne_tbigint_tbigint'; +EVER_EQ_FLOAT_TFLOAT: 'EVER_EQ_FLOAT_TFLOAT' | 'ever_eq_float_tfloat'; +EVER_GE_FLOAT_TFLOAT: 'EVER_GE_FLOAT_TFLOAT' | 'ever_ge_float_tfloat'; +EVER_GT_FLOAT_TFLOAT: 'EVER_GT_FLOAT_TFLOAT' | 'ever_gt_float_tfloat'; +EVER_LE_FLOAT_TFLOAT: 'EVER_LE_FLOAT_TFLOAT' | 'ever_le_float_tfloat'; +EVER_LT_FLOAT_TFLOAT: 'EVER_LT_FLOAT_TFLOAT' | 'ever_lt_float_tfloat'; +EVER_NE_FLOAT_TFLOAT: 'EVER_NE_FLOAT_TFLOAT' | 'ever_ne_float_tfloat'; EVER_EQ_TFLOAT_FLOAT: 'EVER_EQ_TFLOAT_FLOAT' | 'ever_eq_tfloat_float'; EVER_GE_TFLOAT_FLOAT: 'EVER_GE_TFLOAT_FLOAT' | 'ever_ge_tfloat_float'; EVER_GT_TFLOAT_FLOAT: 'EVER_GT_TFLOAT_FLOAT' | 'ever_gt_tfloat_float'; @@ -547,6 +577,12 @@ EVER_GT_TFLOAT_TFLOAT: 'EVER_GT_TFLOAT_TFLOAT' | 'ever_gt_tfloat_tfloat'; EVER_LE_TFLOAT_TFLOAT: 'EVER_LE_TFLOAT_TFLOAT' | 'ever_le_tfloat_tfloat'; EVER_LT_TFLOAT_TFLOAT: 'EVER_LT_TFLOAT_TFLOAT' | 'ever_lt_tfloat_tfloat'; EVER_NE_TFLOAT_TFLOAT: 'EVER_NE_TFLOAT_TFLOAT' | 'ever_ne_tfloat_tfloat'; +EVER_EQ_INT_TINT: 'EVER_EQ_INT_TINT' | 'ever_eq_int_tint'; +EVER_GE_INT_TINT: 'EVER_GE_INT_TINT' | 'ever_ge_int_tint'; +EVER_GT_INT_TINT: 'EVER_GT_INT_TINT' | 'ever_gt_int_tint'; +EVER_LE_INT_TINT: 'EVER_LE_INT_TINT' | 'ever_le_int_tint'; +EVER_LT_INT_TINT: 'EVER_LT_INT_TINT' | 'ever_lt_int_tint'; +EVER_NE_INT_TINT: 'EVER_NE_INT_TINT' | 'ever_ne_int_tint'; EVER_EQ_TINT_INT: 'EVER_EQ_TINT_INT' | 'ever_eq_tint_int'; EVER_GE_TINT_INT: 'EVER_GE_TINT_INT' | 'ever_ge_tint_int'; EVER_GT_TINT_INT: 'EVER_GT_TINT_INT' | 'ever_gt_tint_int'; diff --git a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp index 1c1b52c852..aa7d1263e5 100644 --- a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp +++ b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp @@ -199,6 +199,42 @@ #include #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include @@ -2986,6 +3022,180 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont } break; /* END CODEGEN PARSER GLUE: TINT_TO_TFLOAT */ + /* BEGIN CODEGEN PARSER GLUE: EVER_EQ_BIGINT_TBIGINT */ + case AntlrSQLLexer::EVER_EQ_BIGINT_TBIGINT: + {{ + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("EVER_EQ_BIGINT_TBIGINT requires exactly 3 arguments, but got {{}}", argCount); + + while (!helpers.top().constantBuilder.empty()) + {{ + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + }} + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverEqBigintTbigintLogicalFunction(a0, a1, a2)); + }} + break; + /* END CODEGEN PARSER GLUE: EVER_EQ_BIGINT_TBIGINT */ + /* BEGIN CODEGEN PARSER GLUE: EVER_GE_BIGINT_TBIGINT */ + case AntlrSQLLexer::EVER_GE_BIGINT_TBIGINT: + {{ + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("EVER_GE_BIGINT_TBIGINT requires exactly 3 arguments, but got {{}}", argCount); + + while (!helpers.top().constantBuilder.empty()) + {{ + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + }} + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverGeBigintTbigintLogicalFunction(a0, a1, a2)); + }} + break; + /* END CODEGEN PARSER GLUE: EVER_GE_BIGINT_TBIGINT */ + /* BEGIN CODEGEN PARSER GLUE: EVER_GT_BIGINT_TBIGINT */ + case AntlrSQLLexer::EVER_GT_BIGINT_TBIGINT: + {{ + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("EVER_GT_BIGINT_TBIGINT requires exactly 3 arguments, but got {{}}", argCount); + + while (!helpers.top().constantBuilder.empty()) + {{ + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + }} + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverGtBigintTbigintLogicalFunction(a0, a1, a2)); + }} + break; + /* END CODEGEN PARSER GLUE: EVER_GT_BIGINT_TBIGINT */ + /* BEGIN CODEGEN PARSER GLUE: EVER_LE_BIGINT_TBIGINT */ + case AntlrSQLLexer::EVER_LE_BIGINT_TBIGINT: + {{ + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("EVER_LE_BIGINT_TBIGINT requires exactly 3 arguments, but got {{}}", argCount); + + while (!helpers.top().constantBuilder.empty()) + {{ + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + }} + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverLeBigintTbigintLogicalFunction(a0, a1, a2)); + }} + break; + /* END CODEGEN PARSER GLUE: EVER_LE_BIGINT_TBIGINT */ + /* BEGIN CODEGEN PARSER GLUE: EVER_LT_BIGINT_TBIGINT */ + case AntlrSQLLexer::EVER_LT_BIGINT_TBIGINT: + {{ + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("EVER_LT_BIGINT_TBIGINT requires exactly 3 arguments, but got {{}}", argCount); + + while (!helpers.top().constantBuilder.empty()) + {{ + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + }} + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverLtBigintTbigintLogicalFunction(a0, a1, a2)); + }} + break; + /* END CODEGEN PARSER GLUE: EVER_LT_BIGINT_TBIGINT */ + /* BEGIN CODEGEN PARSER GLUE: EVER_NE_BIGINT_TBIGINT */ + case AntlrSQLLexer::EVER_NE_BIGINT_TBIGINT: + {{ + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("EVER_NE_BIGINT_TBIGINT requires exactly 3 arguments, but got {{}}", argCount); + + while (!helpers.top().constantBuilder.empty()) + {{ + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + }} + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverNeBigintTbigintLogicalFunction(a0, a1, a2)); + }} + break; + /* END CODEGEN PARSER GLUE: EVER_NE_BIGINT_TBIGINT */ /* BEGIN CODEGEN PARSER GLUE: EVER_EQ_TBIGINT_BIGINT */ case AntlrSQLLexer::EVER_EQ_TBIGINT_BIGINT: { @@ -3334,6 +3544,180 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont } break; /* END CODEGEN PARSER GLUE: EVER_NE_TBIGINT_TBIGINT */ + /* BEGIN CODEGEN PARSER GLUE: EVER_EQ_FLOAT_TFLOAT */ + case AntlrSQLLexer::EVER_EQ_FLOAT_TFLOAT: + {{ + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("EVER_EQ_FLOAT_TFLOAT requires exactly 3 arguments, but got {{}}", argCount); + + while (!helpers.top().constantBuilder.empty()) + {{ + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + }} + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverEqFloatTfloatLogicalFunction(a0, a1, a2)); + }} + break; + /* END CODEGEN PARSER GLUE: EVER_EQ_FLOAT_TFLOAT */ + /* BEGIN CODEGEN PARSER GLUE: EVER_GE_FLOAT_TFLOAT */ + case AntlrSQLLexer::EVER_GE_FLOAT_TFLOAT: + {{ + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("EVER_GE_FLOAT_TFLOAT requires exactly 3 arguments, but got {{}}", argCount); + + while (!helpers.top().constantBuilder.empty()) + {{ + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + }} + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverGeFloatTfloatLogicalFunction(a0, a1, a2)); + }} + break; + /* END CODEGEN PARSER GLUE: EVER_GE_FLOAT_TFLOAT */ + /* BEGIN CODEGEN PARSER GLUE: EVER_GT_FLOAT_TFLOAT */ + case AntlrSQLLexer::EVER_GT_FLOAT_TFLOAT: + {{ + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("EVER_GT_FLOAT_TFLOAT requires exactly 3 arguments, but got {{}}", argCount); + + while (!helpers.top().constantBuilder.empty()) + {{ + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + }} + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverGtFloatTfloatLogicalFunction(a0, a1, a2)); + }} + break; + /* END CODEGEN PARSER GLUE: EVER_GT_FLOAT_TFLOAT */ + /* BEGIN CODEGEN PARSER GLUE: EVER_LE_FLOAT_TFLOAT */ + case AntlrSQLLexer::EVER_LE_FLOAT_TFLOAT: + {{ + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("EVER_LE_FLOAT_TFLOAT requires exactly 3 arguments, but got {{}}", argCount); + + while (!helpers.top().constantBuilder.empty()) + {{ + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + }} + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverLeFloatTfloatLogicalFunction(a0, a1, a2)); + }} + break; + /* END CODEGEN PARSER GLUE: EVER_LE_FLOAT_TFLOAT */ + /* BEGIN CODEGEN PARSER GLUE: EVER_LT_FLOAT_TFLOAT */ + case AntlrSQLLexer::EVER_LT_FLOAT_TFLOAT: + {{ + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("EVER_LT_FLOAT_TFLOAT requires exactly 3 arguments, but got {{}}", argCount); + + while (!helpers.top().constantBuilder.empty()) + {{ + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + }} + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverLtFloatTfloatLogicalFunction(a0, a1, a2)); + }} + break; + /* END CODEGEN PARSER GLUE: EVER_LT_FLOAT_TFLOAT */ + /* BEGIN CODEGEN PARSER GLUE: EVER_NE_FLOAT_TFLOAT */ + case AntlrSQLLexer::EVER_NE_FLOAT_TFLOAT: + {{ + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("EVER_NE_FLOAT_TFLOAT requires exactly 3 arguments, but got {{}}", argCount); + + while (!helpers.top().constantBuilder.empty()) + {{ + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + }} + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverNeFloatTfloatLogicalFunction(a0, a1, a2)); + }} + break; + /* END CODEGEN PARSER GLUE: EVER_NE_FLOAT_TFLOAT */ /* BEGIN CODEGEN PARSER GLUE: EVER_EQ_TFLOAT_FLOAT */ case AntlrSQLLexer::EVER_EQ_TFLOAT_FLOAT: { @@ -3682,6 +4066,180 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont } break; /* END CODEGEN PARSER GLUE: EVER_NE_TFLOAT_TFLOAT */ + /* BEGIN CODEGEN PARSER GLUE: EVER_EQ_INT_TINT */ + case AntlrSQLLexer::EVER_EQ_INT_TINT: + {{ + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("EVER_EQ_INT_TINT requires exactly 3 arguments, but got {{}}", argCount); + + while (!helpers.top().constantBuilder.empty()) + {{ + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + }} + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverEqIntTintLogicalFunction(a0, a1, a2)); + }} + break; + /* END CODEGEN PARSER GLUE: EVER_EQ_INT_TINT */ + /* BEGIN CODEGEN PARSER GLUE: EVER_GE_INT_TINT */ + case AntlrSQLLexer::EVER_GE_INT_TINT: + {{ + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("EVER_GE_INT_TINT requires exactly 3 arguments, but got {{}}", argCount); + + while (!helpers.top().constantBuilder.empty()) + {{ + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + }} + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverGeIntTintLogicalFunction(a0, a1, a2)); + }} + break; + /* END CODEGEN PARSER GLUE: EVER_GE_INT_TINT */ + /* BEGIN CODEGEN PARSER GLUE: EVER_GT_INT_TINT */ + case AntlrSQLLexer::EVER_GT_INT_TINT: + {{ + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("EVER_GT_INT_TINT requires exactly 3 arguments, but got {{}}", argCount); + + while (!helpers.top().constantBuilder.empty()) + {{ + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + }} + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverGtIntTintLogicalFunction(a0, a1, a2)); + }} + break; + /* END CODEGEN PARSER GLUE: EVER_GT_INT_TINT */ + /* BEGIN CODEGEN PARSER GLUE: EVER_LE_INT_TINT */ + case AntlrSQLLexer::EVER_LE_INT_TINT: + {{ + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("EVER_LE_INT_TINT requires exactly 3 arguments, but got {{}}", argCount); + + while (!helpers.top().constantBuilder.empty()) + {{ + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + }} + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverLeIntTintLogicalFunction(a0, a1, a2)); + }} + break; + /* END CODEGEN PARSER GLUE: EVER_LE_INT_TINT */ + /* BEGIN CODEGEN PARSER GLUE: EVER_LT_INT_TINT */ + case AntlrSQLLexer::EVER_LT_INT_TINT: + {{ + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("EVER_LT_INT_TINT requires exactly 3 arguments, but got {{}}", argCount); + + while (!helpers.top().constantBuilder.empty()) + {{ + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + }} + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverLtIntTintLogicalFunction(a0, a1, a2)); + }} + break; + /* END CODEGEN PARSER GLUE: EVER_LT_INT_TINT */ + /* BEGIN CODEGEN PARSER GLUE: EVER_NE_INT_TINT */ + case AntlrSQLLexer::EVER_NE_INT_TINT: + {{ + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("EVER_NE_INT_TINT requires exactly 3 arguments, but got {{}}", argCount); + + while (!helpers.top().constantBuilder.empty()) + {{ + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + }} + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverNeIntTintLogicalFunction(a0, a1, a2)); + }} + break; + /* END CODEGEN PARSER GLUE: EVER_NE_INT_TINT */ /* BEGIN CODEGEN PARSER GLUE: EVER_EQ_TINT_INT */ case AntlrSQLLexer::EVER_EQ_TINT_INT: { @@ -3977,10 +4535,184 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont { const auto argCount = context->expression().size(); if (argCount != 3) - throw InvalidQuerySyntax("EVER_LT_TINT_TINT requires exactly 3 arguments, but got {}", argCount); + throw InvalidQuerySyntax("EVER_LT_TINT_TINT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverLtTintTintLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: EVER_LT_TINT_TINT */ + /* BEGIN CODEGEN PARSER GLUE: EVER_NE_TINT_TINT */ + case AntlrSQLLexer::EVER_NE_TINT_TINT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("EVER_NE_TINT_TINT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverNeTintTintLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: EVER_NE_TINT_TINT */ + /* BEGIN CODEGEN PARSER GLUE: ALWAYS_EQ_INT_TINT */ + case AntlrSQLLexer::ALWAYS_EQ_INT_TINT: + {{ + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("ALWAYS_EQ_INT_TINT requires exactly 3 arguments, but got {{}}", argCount); + + while (!helpers.top().constantBuilder.empty()) + {{ + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + }} + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AlwaysEqIntTintLogicalFunction(a0, a1, a2)); + }} + break; + /* END CODEGEN PARSER GLUE: ALWAYS_EQ_INT_TINT */ + /* BEGIN CODEGEN PARSER GLUE: ALWAYS_GE_INT_TINT */ + case AntlrSQLLexer::ALWAYS_GE_INT_TINT: + {{ + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("ALWAYS_GE_INT_TINT requires exactly 3 arguments, but got {{}}", argCount); + + while (!helpers.top().constantBuilder.empty()) + {{ + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + }} + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AlwaysGeIntTintLogicalFunction(a0, a1, a2)); + }} + break; + /* END CODEGEN PARSER GLUE: ALWAYS_GE_INT_TINT */ + /* BEGIN CODEGEN PARSER GLUE: ALWAYS_GT_INT_TINT */ + case AntlrSQLLexer::ALWAYS_GT_INT_TINT: + {{ + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("ALWAYS_GT_INT_TINT requires exactly 3 arguments, but got {{}}", argCount); + + while (!helpers.top().constantBuilder.empty()) + {{ + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + }} + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AlwaysGtIntTintLogicalFunction(a0, a1, a2)); + }} + break; + /* END CODEGEN PARSER GLUE: ALWAYS_GT_INT_TINT */ + /* BEGIN CODEGEN PARSER GLUE: ALWAYS_LE_INT_TINT */ + case AntlrSQLLexer::ALWAYS_LE_INT_TINT: + {{ + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("ALWAYS_LE_INT_TINT requires exactly 3 arguments, but got {{}}", argCount); + + while (!helpers.top().constantBuilder.empty()) + {{ + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + }} + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AlwaysLeIntTintLogicalFunction(a0, a1, a2)); + }} + break; + /* END CODEGEN PARSER GLUE: ALWAYS_LE_INT_TINT */ + /* BEGIN CODEGEN PARSER GLUE: ALWAYS_LT_INT_TINT */ + case AntlrSQLLexer::ALWAYS_LT_INT_TINT: + {{ + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("ALWAYS_LT_INT_TINT requires exactly 3 arguments, but got {{}}", argCount); while (!helpers.top().constantBuilder.empty()) - { + {{ auto constantValue = std::move(helpers.top().constantBuilder.back()); helpers.top().constantBuilder.pop_back(); DataType dataType; @@ -3991,25 +4723,25 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont else dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); - } + }} auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); - helpers.top().functionBuilder.emplace_back(EverLtTintTintLogicalFunction(a0, a1, a2)); - } + helpers.top().functionBuilder.emplace_back(AlwaysLtIntTintLogicalFunction(a0, a1, a2)); + }} break; - /* END CODEGEN PARSER GLUE: EVER_LT_TINT_TINT */ - /* BEGIN CODEGEN PARSER GLUE: EVER_NE_TINT_TINT */ - case AntlrSQLLexer::EVER_NE_TINT_TINT: - { + /* END CODEGEN PARSER GLUE: ALWAYS_LT_INT_TINT */ + /* BEGIN CODEGEN PARSER GLUE: ALWAYS_NE_INT_TINT */ + case AntlrSQLLexer::ALWAYS_NE_INT_TINT: + {{ const auto argCount = context->expression().size(); if (argCount != 3) - throw InvalidQuerySyntax("EVER_NE_TINT_TINT requires exactly 3 arguments, but got {}", argCount); + throw InvalidQuerySyntax("ALWAYS_NE_INT_TINT requires exactly 3 arguments, but got {{}}", argCount); while (!helpers.top().constantBuilder.empty()) - { + {{ auto constantValue = std::move(helpers.top().constantBuilder.back()); helpers.top().constantBuilder.pop_back(); DataType dataType; @@ -4020,16 +4752,16 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont else dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); - } + }} auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); - helpers.top().functionBuilder.emplace_back(EverNeTintTintLogicalFunction(a0, a1, a2)); - } + helpers.top().functionBuilder.emplace_back(AlwaysNeIntTintLogicalFunction(a0, a1, a2)); + }} break; - /* END CODEGEN PARSER GLUE: EVER_NE_TINT_TINT */ + /* END CODEGEN PARSER GLUE: ALWAYS_NE_INT_TINT */ /* BEGIN CODEGEN PARSER GLUE: ALWAYS_EQ_TINT_INT */ case AntlrSQLLexer::ALWAYS_EQ_TINT_INT: { @@ -4378,6 +5110,180 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont } break; /* END CODEGEN PARSER GLUE: ALWAYS_NE_TINT_TINT */ + /* BEGIN CODEGEN PARSER GLUE: ALWAYS_EQ_BIGINT_TBIGINT */ + case AntlrSQLLexer::ALWAYS_EQ_BIGINT_TBIGINT: + {{ + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("ALWAYS_EQ_BIGINT_TBIGINT requires exactly 3 arguments, but got {{}}", argCount); + + while (!helpers.top().constantBuilder.empty()) + {{ + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + }} + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AlwaysEqBigintTbigintLogicalFunction(a0, a1, a2)); + }} + break; + /* END CODEGEN PARSER GLUE: ALWAYS_EQ_BIGINT_TBIGINT */ + /* BEGIN CODEGEN PARSER GLUE: ALWAYS_GE_BIGINT_TBIGINT */ + case AntlrSQLLexer::ALWAYS_GE_BIGINT_TBIGINT: + {{ + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("ALWAYS_GE_BIGINT_TBIGINT requires exactly 3 arguments, but got {{}}", argCount); + + while (!helpers.top().constantBuilder.empty()) + {{ + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + }} + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AlwaysGeBigintTbigintLogicalFunction(a0, a1, a2)); + }} + break; + /* END CODEGEN PARSER GLUE: ALWAYS_GE_BIGINT_TBIGINT */ + /* BEGIN CODEGEN PARSER GLUE: ALWAYS_GT_BIGINT_TBIGINT */ + case AntlrSQLLexer::ALWAYS_GT_BIGINT_TBIGINT: + {{ + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("ALWAYS_GT_BIGINT_TBIGINT requires exactly 3 arguments, but got {{}}", argCount); + + while (!helpers.top().constantBuilder.empty()) + {{ + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + }} + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AlwaysGtBigintTbigintLogicalFunction(a0, a1, a2)); + }} + break; + /* END CODEGEN PARSER GLUE: ALWAYS_GT_BIGINT_TBIGINT */ + /* BEGIN CODEGEN PARSER GLUE: ALWAYS_LE_BIGINT_TBIGINT */ + case AntlrSQLLexer::ALWAYS_LE_BIGINT_TBIGINT: + {{ + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("ALWAYS_LE_BIGINT_TBIGINT requires exactly 3 arguments, but got {{}}", argCount); + + while (!helpers.top().constantBuilder.empty()) + {{ + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + }} + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AlwaysLeBigintTbigintLogicalFunction(a0, a1, a2)); + }} + break; + /* END CODEGEN PARSER GLUE: ALWAYS_LE_BIGINT_TBIGINT */ + /* BEGIN CODEGEN PARSER GLUE: ALWAYS_LT_BIGINT_TBIGINT */ + case AntlrSQLLexer::ALWAYS_LT_BIGINT_TBIGINT: + {{ + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("ALWAYS_LT_BIGINT_TBIGINT requires exactly 3 arguments, but got {{}}", argCount); + + while (!helpers.top().constantBuilder.empty()) + {{ + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + }} + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AlwaysLtBigintTbigintLogicalFunction(a0, a1, a2)); + }} + break; + /* END CODEGEN PARSER GLUE: ALWAYS_LT_BIGINT_TBIGINT */ + /* BEGIN CODEGEN PARSER GLUE: ALWAYS_NE_BIGINT_TBIGINT */ + case AntlrSQLLexer::ALWAYS_NE_BIGINT_TBIGINT: + {{ + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("ALWAYS_NE_BIGINT_TBIGINT requires exactly 3 arguments, but got {{}}", argCount); + + while (!helpers.top().constantBuilder.empty()) + {{ + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + }} + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AlwaysNeBigintTbigintLogicalFunction(a0, a1, a2)); + }} + break; + /* END CODEGEN PARSER GLUE: ALWAYS_NE_BIGINT_TBIGINT */ /* BEGIN CODEGEN PARSER GLUE: ALWAYS_EQ_TBIGINT_BIGINT */ case AntlrSQLLexer::ALWAYS_EQ_TBIGINT_BIGINT: { @@ -4726,6 +5632,180 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont } break; /* END CODEGEN PARSER GLUE: ALWAYS_NE_TBIGINT_TBIGINT */ + /* BEGIN CODEGEN PARSER GLUE: ALWAYS_EQ_FLOAT_TFLOAT */ + case AntlrSQLLexer::ALWAYS_EQ_FLOAT_TFLOAT: + {{ + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("ALWAYS_EQ_FLOAT_TFLOAT requires exactly 3 arguments, but got {{}}", argCount); + + while (!helpers.top().constantBuilder.empty()) + {{ + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + }} + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AlwaysEqFloatTfloatLogicalFunction(a0, a1, a2)); + }} + break; + /* END CODEGEN PARSER GLUE: ALWAYS_EQ_FLOAT_TFLOAT */ + /* BEGIN CODEGEN PARSER GLUE: ALWAYS_GE_FLOAT_TFLOAT */ + case AntlrSQLLexer::ALWAYS_GE_FLOAT_TFLOAT: + {{ + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("ALWAYS_GE_FLOAT_TFLOAT requires exactly 3 arguments, but got {{}}", argCount); + + while (!helpers.top().constantBuilder.empty()) + {{ + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + }} + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AlwaysGeFloatTfloatLogicalFunction(a0, a1, a2)); + }} + break; + /* END CODEGEN PARSER GLUE: ALWAYS_GE_FLOAT_TFLOAT */ + /* BEGIN CODEGEN PARSER GLUE: ALWAYS_GT_FLOAT_TFLOAT */ + case AntlrSQLLexer::ALWAYS_GT_FLOAT_TFLOAT: + {{ + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("ALWAYS_GT_FLOAT_TFLOAT requires exactly 3 arguments, but got {{}}", argCount); + + while (!helpers.top().constantBuilder.empty()) + {{ + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + }} + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AlwaysGtFloatTfloatLogicalFunction(a0, a1, a2)); + }} + break; + /* END CODEGEN PARSER GLUE: ALWAYS_GT_FLOAT_TFLOAT */ + /* BEGIN CODEGEN PARSER GLUE: ALWAYS_LE_FLOAT_TFLOAT */ + case AntlrSQLLexer::ALWAYS_LE_FLOAT_TFLOAT: + {{ + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("ALWAYS_LE_FLOAT_TFLOAT requires exactly 3 arguments, but got {{}}", argCount); + + while (!helpers.top().constantBuilder.empty()) + {{ + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + }} + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AlwaysLeFloatTfloatLogicalFunction(a0, a1, a2)); + }} + break; + /* END CODEGEN PARSER GLUE: ALWAYS_LE_FLOAT_TFLOAT */ + /* BEGIN CODEGEN PARSER GLUE: ALWAYS_LT_FLOAT_TFLOAT */ + case AntlrSQLLexer::ALWAYS_LT_FLOAT_TFLOAT: + {{ + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("ALWAYS_LT_FLOAT_TFLOAT requires exactly 3 arguments, but got {{}}", argCount); + + while (!helpers.top().constantBuilder.empty()) + {{ + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + }} + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AlwaysLtFloatTfloatLogicalFunction(a0, a1, a2)); + }} + break; + /* END CODEGEN PARSER GLUE: ALWAYS_LT_FLOAT_TFLOAT */ + /* BEGIN CODEGEN PARSER GLUE: ALWAYS_NE_FLOAT_TFLOAT */ + case AntlrSQLLexer::ALWAYS_NE_FLOAT_TFLOAT: + {{ + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("ALWAYS_NE_FLOAT_TFLOAT requires exactly 3 arguments, but got {{}}", argCount); + + while (!helpers.top().constantBuilder.empty()) + {{ + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + }} + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AlwaysNeFloatTfloatLogicalFunction(a0, a1, a2)); + }} + break; + /* END CODEGEN PARSER GLUE: ALWAYS_NE_FLOAT_TFLOAT */ /* BEGIN CODEGEN PARSER GLUE: ALWAYS_EQ_TFLOAT_FLOAT */ case AntlrSQLLexer::ALWAYS_EQ_TFLOAT_FLOAT: { From a24ec746418fb59b6c019a2a5fc46dcf81f5d7a5 Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Fri, 12 Jun 2026 10:21:26 +0200 Subject: [PATCH 32/96] feat(meos): add EVER/ALWAYS_EQ/NE_{TBOOL_BOOL,BOOL_TBOOL} NES operators (W79-W82) Adds 8 per-event NES operators for tbool comparisons: EVER_EQ/NE_TBOOL_BOOL, ALWAYS_EQ/NE_TBOOL_BOOL (temporal-first form) and EVER_EQ/NE_BOOL_TBOOL, ALWAYS_EQ/NE_BOOL_TBOOL (reversed scalar-first form). tbool supports only EQ and NE (no ordered comparisons). Each 3-arg operator takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64); the temporal arg maps non-zero double to 't', zero to 'f' and is parsed with tbool_in(). The reversed form passes the scalar bool as the first argument to ever_eq_bool_tbool / always_eq_bool_tbool. Wired across all five locations. --- .../Meos/AlwaysEqBoolTboolLogicalFunction.hpp | 54 ++++ .../Meos/AlwaysEqTboolBoolLogicalFunction.hpp | 54 ++++ .../Meos/AlwaysNeBoolTboolLogicalFunction.hpp | 54 ++++ .../Meos/AlwaysNeTboolBoolLogicalFunction.hpp | 54 ++++ .../Meos/EverEqBoolTboolLogicalFunction.hpp | 54 ++++ .../Meos/EverEqTboolBoolLogicalFunction.hpp | 54 ++++ .../Meos/EverNeBoolTboolLogicalFunction.hpp | 54 ++++ .../Meos/EverNeTboolBoolLogicalFunction.hpp | 54 ++++ .../Meos/AlwaysEqBoolTboolLogicalFunction.cpp | 105 ++++++++ .../Meos/AlwaysEqTboolBoolLogicalFunction.cpp | 105 ++++++++ .../Meos/AlwaysNeBoolTboolLogicalFunction.cpp | 105 ++++++++ .../Meos/AlwaysNeTboolBoolLogicalFunction.cpp | 105 ++++++++ .../src/Functions/Meos/CMakeLists.txt | 8 + .../Meos/EverEqBoolTboolLogicalFunction.cpp | 105 ++++++++ .../Meos/EverEqTboolBoolLogicalFunction.cpp | 105 ++++++++ .../Meos/EverNeBoolTboolLogicalFunction.cpp | 105 ++++++++ .../Meos/EverNeTboolBoolLogicalFunction.cpp | 105 ++++++++ .../AlwaysEqBoolTboolPhysicalFunction.hpp | 43 ++++ .../AlwaysEqTboolBoolPhysicalFunction.hpp | 43 ++++ .../AlwaysNeBoolTboolPhysicalFunction.hpp | 43 ++++ .../AlwaysNeTboolBoolPhysicalFunction.hpp | 43 ++++ .../Meos/EverEqBoolTboolPhysicalFunction.hpp | 43 ++++ .../Meos/EverEqTboolBoolPhysicalFunction.hpp | 43 ++++ .../Meos/EverNeBoolTboolPhysicalFunction.hpp | 43 ++++ .../Meos/EverNeTboolBoolPhysicalFunction.hpp | 43 ++++ .../AlwaysEqBoolTboolPhysicalFunction.cpp | 89 +++++++ .../AlwaysEqTboolBoolPhysicalFunction.cpp | 89 +++++++ .../AlwaysNeBoolTboolPhysicalFunction.cpp | 89 +++++++ .../AlwaysNeTboolBoolPhysicalFunction.cpp | 89 +++++++ .../src/Functions/Meos/CMakeLists.txt | 8 + .../Meos/EverEqBoolTboolPhysicalFunction.cpp | 89 +++++++ .../Meos/EverEqTboolBoolPhysicalFunction.cpp | 89 +++++++ .../Meos/EverNeBoolTboolPhysicalFunction.cpp | 89 +++++++ .../Meos/EverNeTboolBoolPhysicalFunction.cpp | 89 +++++++ nes-sql-parser/AntlrSQL.g4 | 10 +- .../src/AntlrSQLQueryPlanCreator.cpp | 240 ++++++++++++++++++ 36 files changed, 2593 insertions(+), 1 deletion(-) create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysEqBoolTboolLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysEqTboolBoolLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysNeBoolTboolLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysNeTboolBoolLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverEqBoolTboolLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverEqTboolBoolLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverNeBoolTboolLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverNeTboolBoolLogicalFunction.hpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysEqBoolTboolLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysEqTboolBoolLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysNeBoolTboolLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysNeTboolBoolLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverEqBoolTboolLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverEqTboolBoolLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverNeBoolTboolLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverNeTboolBoolLogicalFunction.cpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysEqBoolTboolPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysEqTboolBoolPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysNeBoolTboolPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysNeTboolBoolPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverEqBoolTboolPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverEqTboolBoolPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverNeBoolTboolPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverNeTboolBoolPhysicalFunction.hpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysEqBoolTboolPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysEqTboolBoolPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysNeBoolTboolPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysNeTboolBoolPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverEqBoolTboolPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverEqTboolBoolPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverNeBoolTboolPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverNeTboolBoolPhysicalFunction.cpp diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysEqBoolTboolLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysEqBoolTboolLogicalFunction.hpp new file mode 100644 index 0000000000..ef854f054f --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysEqBoolTboolLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event always_eq_bool_tbool: tests if a single-instant tfloat value ever equals a threshold. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `always_eq_bool_tbool`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class AlwaysEqBoolTboolLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysEqBoolTbool"; + + AlwaysEqBoolTboolLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysEqTboolBoolLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysEqTboolBoolLogicalFunction.hpp new file mode 100644 index 0000000000..c3bab7ca57 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysEqTboolBoolLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event always_eq_tbool_bool: tests if a single-instant tfloat value ever equals a threshold. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `always_eq_tbool_bool`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class AlwaysEqTboolBoolLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysEqTboolBool"; + + AlwaysEqTboolBoolLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysNeBoolTboolLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysNeBoolTboolLogicalFunction.hpp new file mode 100644 index 0000000000..2be1fc26db --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysNeBoolTboolLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event always_ne_bool_tbool: tests if a single-instant tfloat value ever equals a threshold. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `always_ne_bool_tbool`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class AlwaysNeBoolTboolLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysNeBoolTbool"; + + AlwaysNeBoolTboolLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysNeTboolBoolLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysNeTboolBoolLogicalFunction.hpp new file mode 100644 index 0000000000..f743a7c66b --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysNeTboolBoolLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event always_ne_tbool_bool: tests if a single-instant tfloat value ever equals a threshold. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `always_ne_tbool_bool`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class AlwaysNeTboolBoolLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysNeTboolBool"; + + AlwaysNeTboolBoolLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverEqBoolTboolLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverEqBoolTboolLogicalFunction.hpp new file mode 100644 index 0000000000..c0b490a099 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverEqBoolTboolLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event ever_eq_bool_tbool: tests if a single-instant tfloat value ever equals a threshold. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ever_eq_bool_tbool`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class EverEqBoolTboolLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverEqBoolTbool"; + + EverEqBoolTboolLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverEqTboolBoolLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverEqTboolBoolLogicalFunction.hpp new file mode 100644 index 0000000000..a313b66594 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverEqTboolBoolLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event ever_eq_tbool_bool: tests if a single-instant tfloat value ever equals a threshold. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ever_eq_tbool_bool`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class EverEqTboolBoolLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverEqTboolBool"; + + EverEqTboolBoolLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverNeBoolTboolLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverNeBoolTboolLogicalFunction.hpp new file mode 100644 index 0000000000..b77a9ea104 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverNeBoolTboolLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event ever_ne_bool_tbool: tests if a single-instant tfloat value ever equals a threshold. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ever_ne_bool_tbool`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class EverNeBoolTboolLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverNeBoolTbool"; + + EverNeBoolTboolLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverNeTboolBoolLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverNeTboolBoolLogicalFunction.hpp new file mode 100644 index 0000000000..07dca7e895 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverNeTboolBoolLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event ever_ne_tbool_bool: tests if a single-instant tfloat value ever equals a threshold. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ever_ne_tbool_bool`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class EverNeTboolBoolLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverNeTboolBool"; + + EverNeTboolBoolLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysEqBoolTboolLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysEqBoolTboolLogicalFunction.cpp new file mode 100644 index 0000000000..e2ffb93ddc --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysEqBoolTboolLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AlwaysEqBoolTboolLogicalFunction::AlwaysEqBoolTboolLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType AlwaysEqBoolTboolLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysEqBoolTboolLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AlwaysEqBoolTboolLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysEqBoolTboolLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "AlwaysEqBoolTboolLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AlwaysEqBoolTboolLogicalFunction::getType() const { return NAME; } + +bool AlwaysEqBoolTboolLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AlwaysEqBoolTboolLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction AlwaysEqBoolTboolLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction AlwaysEqBoolTboolLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysEqBoolTboolLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "AlwaysEqBoolTboolLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return AlwaysEqBoolTboolLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysEqTboolBoolLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysEqTboolBoolLogicalFunction.cpp new file mode 100644 index 0000000000..ae786168cc --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysEqTboolBoolLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AlwaysEqTboolBoolLogicalFunction::AlwaysEqTboolBoolLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType AlwaysEqTboolBoolLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysEqTboolBoolLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AlwaysEqTboolBoolLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysEqTboolBoolLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "AlwaysEqTboolBoolLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AlwaysEqTboolBoolLogicalFunction::getType() const { return NAME; } + +bool AlwaysEqTboolBoolLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AlwaysEqTboolBoolLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction AlwaysEqTboolBoolLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction AlwaysEqTboolBoolLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysEqTboolBoolLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "AlwaysEqTboolBoolLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return AlwaysEqTboolBoolLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysNeBoolTboolLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysNeBoolTboolLogicalFunction.cpp new file mode 100644 index 0000000000..79d74af6b7 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysNeBoolTboolLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AlwaysNeBoolTboolLogicalFunction::AlwaysNeBoolTboolLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType AlwaysNeBoolTboolLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysNeBoolTboolLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AlwaysNeBoolTboolLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysNeBoolTboolLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "AlwaysNeBoolTboolLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AlwaysNeBoolTboolLogicalFunction::getType() const { return NAME; } + +bool AlwaysNeBoolTboolLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AlwaysNeBoolTboolLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction AlwaysNeBoolTboolLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction AlwaysNeBoolTboolLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysNeBoolTboolLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "AlwaysNeBoolTboolLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return AlwaysNeBoolTboolLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysNeTboolBoolLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysNeTboolBoolLogicalFunction.cpp new file mode 100644 index 0000000000..3849ef5051 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysNeTboolBoolLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AlwaysNeTboolBoolLogicalFunction::AlwaysNeTboolBoolLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType AlwaysNeTboolBoolLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysNeTboolBoolLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AlwaysNeTboolBoolLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysNeTboolBoolLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "AlwaysNeTboolBoolLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AlwaysNeTboolBoolLogicalFunction::getType() const { return NAME; } + +bool AlwaysNeTboolBoolLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AlwaysNeTboolBoolLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction AlwaysNeTboolBoolLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction AlwaysNeTboolBoolLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysNeTboolBoolLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "AlwaysNeTboolBoolLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return AlwaysNeTboolBoolLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt index 09a8d54498..f9a47318c7 100644 --- a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt @@ -184,3 +184,11 @@ add_plugin(AlwaysGtBigintTbigint LogicalFunction nes-logical-operators AlwaysGtB add_plugin(AlwaysLeBigintTbigint LogicalFunction nes-logical-operators AlwaysLeBigintTbigintLogicalFunction.cpp) add_plugin(AlwaysLtBigintTbigint LogicalFunction nes-logical-operators AlwaysLtBigintTbigintLogicalFunction.cpp) add_plugin(AlwaysNeBigintTbigint LogicalFunction nes-logical-operators AlwaysNeBigintTbigintLogicalFunction.cpp) +add_plugin(EverEqTboolBool LogicalFunction nes-logical-operators EverEqTboolBoolLogicalFunction.cpp) +add_plugin(EverNeTboolBool LogicalFunction nes-logical-operators EverNeTboolBoolLogicalFunction.cpp) +add_plugin(EverEqBoolTbool LogicalFunction nes-logical-operators EverEqBoolTboolLogicalFunction.cpp) +add_plugin(EverNeBoolTbool LogicalFunction nes-logical-operators EverNeBoolTboolLogicalFunction.cpp) +add_plugin(AlwaysEqTboolBool LogicalFunction nes-logical-operators AlwaysEqTboolBoolLogicalFunction.cpp) +add_plugin(AlwaysNeTboolBool LogicalFunction nes-logical-operators AlwaysNeTboolBoolLogicalFunction.cpp) +add_plugin(AlwaysEqBoolTbool LogicalFunction nes-logical-operators AlwaysEqBoolTboolLogicalFunction.cpp) +add_plugin(AlwaysNeBoolTbool LogicalFunction nes-logical-operators AlwaysNeBoolTboolLogicalFunction.cpp) diff --git a/nes-logical-operators/src/Functions/Meos/EverEqBoolTboolLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverEqBoolTboolLogicalFunction.cpp new file mode 100644 index 0000000000..dfe6ced0b7 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverEqBoolTboolLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EverEqBoolTboolLogicalFunction::EverEqBoolTboolLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType EverEqBoolTboolLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverEqBoolTboolLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EverEqBoolTboolLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverEqBoolTboolLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "EverEqBoolTboolLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EverEqBoolTboolLogicalFunction::getType() const { return NAME; } + +bool EverEqBoolTboolLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EverEqBoolTboolLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction EverEqBoolTboolLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction EverEqBoolTboolLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverEqBoolTboolLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "EverEqBoolTboolLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return EverEqBoolTboolLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverEqTboolBoolLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverEqTboolBoolLogicalFunction.cpp new file mode 100644 index 0000000000..c47995fd5f --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverEqTboolBoolLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EverEqTboolBoolLogicalFunction::EverEqTboolBoolLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType EverEqTboolBoolLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverEqTboolBoolLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EverEqTboolBoolLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverEqTboolBoolLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "EverEqTboolBoolLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EverEqTboolBoolLogicalFunction::getType() const { return NAME; } + +bool EverEqTboolBoolLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EverEqTboolBoolLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction EverEqTboolBoolLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction EverEqTboolBoolLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverEqTboolBoolLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "EverEqTboolBoolLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return EverEqTboolBoolLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverNeBoolTboolLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverNeBoolTboolLogicalFunction.cpp new file mode 100644 index 0000000000..97a13892b0 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverNeBoolTboolLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EverNeBoolTboolLogicalFunction::EverNeBoolTboolLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType EverNeBoolTboolLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverNeBoolTboolLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EverNeBoolTboolLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverNeBoolTboolLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "EverNeBoolTboolLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EverNeBoolTboolLogicalFunction::getType() const { return NAME; } + +bool EverNeBoolTboolLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EverNeBoolTboolLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction EverNeBoolTboolLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction EverNeBoolTboolLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverNeBoolTboolLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "EverNeBoolTboolLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return EverNeBoolTboolLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverNeTboolBoolLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverNeTboolBoolLogicalFunction.cpp new file mode 100644 index 0000000000..a9bf43de76 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverNeTboolBoolLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EverNeTboolBoolLogicalFunction::EverNeTboolBoolLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType EverNeTboolBoolLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverNeTboolBoolLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EverNeTboolBoolLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverNeTboolBoolLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "EverNeTboolBoolLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EverNeTboolBoolLogicalFunction::getType() const { return NAME; } + +bool EverNeTboolBoolLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EverNeTboolBoolLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction EverNeTboolBoolLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction EverNeTboolBoolLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverNeTboolBoolLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "EverNeTboolBoolLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return EverNeTboolBoolLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysEqBoolTboolPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysEqBoolTboolPhysicalFunction.hpp new file mode 100644 index 0000000000..c98290da98 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysEqBoolTboolPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `always_eq_bool_tbool`. + * + * Per-event always_eq_bool_tbool: tests if a single-instant tfloat value ever equals a threshold. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class AlwaysEqBoolTboolPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysEqBoolTboolPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysEqTboolBoolPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysEqTboolBoolPhysicalFunction.hpp new file mode 100644 index 0000000000..f3bfd249ad --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysEqTboolBoolPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `always_eq_tbool_bool`. + * + * Per-event always_eq_tbool_bool: tests if a single-instant tfloat value ever equals a threshold. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class AlwaysEqTboolBoolPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysEqTboolBoolPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysNeBoolTboolPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysNeBoolTboolPhysicalFunction.hpp new file mode 100644 index 0000000000..deb38a50f1 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysNeBoolTboolPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `always_ne_bool_tbool`. + * + * Per-event always_ne_bool_tbool: tests if a single-instant tfloat value ever equals a threshold. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class AlwaysNeBoolTboolPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysNeBoolTboolPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysNeTboolBoolPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysNeTboolBoolPhysicalFunction.hpp new file mode 100644 index 0000000000..aa6c793541 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysNeTboolBoolPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `always_ne_tbool_bool`. + * + * Per-event always_ne_tbool_bool: tests if a single-instant tfloat value ever equals a threshold. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class AlwaysNeTboolBoolPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysNeTboolBoolPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverEqBoolTboolPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverEqBoolTboolPhysicalFunction.hpp new file mode 100644 index 0000000000..f51a3d12b2 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverEqBoolTboolPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `ever_eq_bool_tbool`. + * + * Per-event ever_eq_bool_tbool: tests if a single-instant tfloat value ever equals a threshold. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class EverEqBoolTboolPhysicalFunction : public PhysicalFunctionConcept { +public: + EverEqBoolTboolPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverEqTboolBoolPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverEqTboolBoolPhysicalFunction.hpp new file mode 100644 index 0000000000..50715d2d12 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverEqTboolBoolPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `ever_eq_tbool_bool`. + * + * Per-event ever_eq_tbool_bool: tests if a single-instant tfloat value ever equals a threshold. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class EverEqTboolBoolPhysicalFunction : public PhysicalFunctionConcept { +public: + EverEqTboolBoolPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverNeBoolTboolPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverNeBoolTboolPhysicalFunction.hpp new file mode 100644 index 0000000000..bda9de3732 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverNeBoolTboolPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `ever_ne_bool_tbool`. + * + * Per-event ever_ne_bool_tbool: tests if a single-instant tfloat value ever equals a threshold. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class EverNeBoolTboolPhysicalFunction : public PhysicalFunctionConcept { +public: + EverNeBoolTboolPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverNeTboolBoolPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverNeTboolBoolPhysicalFunction.hpp new file mode 100644 index 0000000000..fb18c1610b --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverNeTboolBoolPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `ever_ne_tbool_bool`. + * + * Per-event ever_ne_tbool_bool: tests if a single-instant tfloat value ever equals a threshold. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class EverNeTboolBoolPhysicalFunction : public PhysicalFunctionConcept { +public: + EverNeTboolBoolPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysEqBoolTboolPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysEqBoolTboolPhysicalFunction.cpp new file mode 100644 index 0000000000..58a56e62f0 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysEqBoolTboolPhysicalFunction.cpp @@ -0,0 +1,89 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +AlwaysEqBoolTboolPhysicalFunction::AlwaysEqBoolTboolPhysicalFunction(PhysicalFunction scalarFunction, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(scalarFunction)); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal AlwaysEqBoolTboolPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto scalar = parameterValues[0].cast>(); + auto value = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double b, double v, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = fmt::format("{}@{}", (v != 0.0 ? "t" : "f"), ts_str); + Temporal* temp = tbool_in(wkt.c_str()); + if (!temp) return 0.0; + int r = always_eq_bool_tbool(static_cast(b != 0.0), temp); + free(temp); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + scalar, value, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysEqBoolTboolPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "AlwaysEqBoolTboolPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return AlwaysEqBoolTboolPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysEqTboolBoolPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysEqTboolBoolPhysicalFunction.cpp new file mode 100644 index 0000000000..c661e73b5a --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysEqTboolBoolPhysicalFunction.cpp @@ -0,0 +1,89 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +AlwaysEqTboolBoolPhysicalFunction::AlwaysEqTboolBoolPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(thresholdFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal AlwaysEqTboolBoolPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto threshold = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double v, double thr, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = fmt::format("{}@{}", (v != 0.0 ? "t" : "f"), ts_str); + Temporal* temp = tbool_in(wkt.c_str()); + if (!temp) return 0.0; + int r = always_eq_tbool_bool(temp, static_cast(thr != 0.0)); + free(temp); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + value, threshold, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysEqTboolBoolPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "AlwaysEqTboolBoolPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return AlwaysEqTboolBoolPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysNeBoolTboolPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysNeBoolTboolPhysicalFunction.cpp new file mode 100644 index 0000000000..b459fba06d --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysNeBoolTboolPhysicalFunction.cpp @@ -0,0 +1,89 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +AlwaysNeBoolTboolPhysicalFunction::AlwaysNeBoolTboolPhysicalFunction(PhysicalFunction scalarFunction, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(scalarFunction)); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal AlwaysNeBoolTboolPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto scalar = parameterValues[0].cast>(); + auto value = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double b, double v, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = fmt::format("{}@{}", (v != 0.0 ? "t" : "f"), ts_str); + Temporal* temp = tbool_in(wkt.c_str()); + if (!temp) return 0.0; + int r = always_ne_bool_tbool(static_cast(b != 0.0), temp); + free(temp); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + scalar, value, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysNeBoolTboolPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "AlwaysNeBoolTboolPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return AlwaysNeBoolTboolPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysNeTboolBoolPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysNeTboolBoolPhysicalFunction.cpp new file mode 100644 index 0000000000..4d3b327a92 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysNeTboolBoolPhysicalFunction.cpp @@ -0,0 +1,89 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +AlwaysNeTboolBoolPhysicalFunction::AlwaysNeTboolBoolPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(thresholdFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal AlwaysNeTboolBoolPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto threshold = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double v, double thr, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = fmt::format("{}@{}", (v != 0.0 ? "t" : "f"), ts_str); + Temporal* temp = tbool_in(wkt.c_str()); + if (!temp) return 0.0; + int r = always_ne_tbool_bool(temp, static_cast(thr != 0.0)); + free(temp); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + value, threshold, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysNeTboolBoolPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "AlwaysNeTboolBoolPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return AlwaysNeTboolBoolPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt index bd3c465f90..7cab9483d8 100644 --- a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt @@ -183,4 +183,12 @@ add_plugin(AlwaysGtBigintTbigint PhysicalFunction nes-physical-operators AlwaysG add_plugin(AlwaysLeBigintTbigint PhysicalFunction nes-physical-operators AlwaysLeBigintTbigintPhysicalFunction.cpp) add_plugin(AlwaysLtBigintTbigint PhysicalFunction nes-physical-operators AlwaysLtBigintTbigintPhysicalFunction.cpp) add_plugin(AlwaysNeBigintTbigint PhysicalFunction nes-physical-operators AlwaysNeBigintTbigintPhysicalFunction.cpp) +add_plugin(EverEqTboolBool PhysicalFunction nes-physical-operators EverEqTboolBoolPhysicalFunction.cpp) +add_plugin(EverNeTboolBool PhysicalFunction nes-physical-operators EverNeTboolBoolPhysicalFunction.cpp) +add_plugin(AlwaysEqTboolBool PhysicalFunction nes-physical-operators AlwaysEqTboolBoolPhysicalFunction.cpp) +add_plugin(AlwaysNeTboolBool PhysicalFunction nes-physical-operators AlwaysNeTboolBoolPhysicalFunction.cpp) +add_plugin(EverEqBoolTbool PhysicalFunction nes-physical-operators EverEqBoolTboolPhysicalFunction.cpp) +add_plugin(EverNeBoolTbool PhysicalFunction nes-physical-operators EverNeBoolTboolPhysicalFunction.cpp) +add_plugin(AlwaysEqBoolTbool PhysicalFunction nes-physical-operators AlwaysEqBoolTboolPhysicalFunction.cpp) +add_plugin(AlwaysNeBoolTbool PhysicalFunction nes-physical-operators AlwaysNeBoolTboolPhysicalFunction.cpp) endif() diff --git a/nes-physical-operators/src/Functions/Meos/EverEqBoolTboolPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverEqBoolTboolPhysicalFunction.cpp new file mode 100644 index 0000000000..2bcf7b5d88 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverEqBoolTboolPhysicalFunction.cpp @@ -0,0 +1,89 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +EverEqBoolTboolPhysicalFunction::EverEqBoolTboolPhysicalFunction(PhysicalFunction scalarFunction, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(scalarFunction)); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal EverEqBoolTboolPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto scalar = parameterValues[0].cast>(); + auto value = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double b, double v, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = fmt::format("{}@{}", (v != 0.0 ? "t" : "f"), ts_str); + Temporal* temp = tbool_in(wkt.c_str()); + if (!temp) return 0.0; + int r = ever_eq_bool_tbool(static_cast(b != 0.0), temp); + free(temp); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + scalar, value, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverEqBoolTboolPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "EverEqBoolTboolPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return EverEqBoolTboolPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverEqTboolBoolPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverEqTboolBoolPhysicalFunction.cpp new file mode 100644 index 0000000000..b786054542 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverEqTboolBoolPhysicalFunction.cpp @@ -0,0 +1,89 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +EverEqTboolBoolPhysicalFunction::EverEqTboolBoolPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(thresholdFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal EverEqTboolBoolPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto threshold = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double v, double thr, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = fmt::format("{}@{}", (v != 0.0 ? "t" : "f"), ts_str); + Temporal* temp = tbool_in(wkt.c_str()); + if (!temp) return 0.0; + int r = ever_eq_tbool_bool(temp, static_cast(thr != 0.0)); + free(temp); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + value, threshold, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverEqTboolBoolPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "EverEqTboolBoolPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return EverEqTboolBoolPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverNeBoolTboolPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverNeBoolTboolPhysicalFunction.cpp new file mode 100644 index 0000000000..88fc83c45f --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverNeBoolTboolPhysicalFunction.cpp @@ -0,0 +1,89 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +EverNeBoolTboolPhysicalFunction::EverNeBoolTboolPhysicalFunction(PhysicalFunction scalarFunction, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(scalarFunction)); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal EverNeBoolTboolPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto scalar = parameterValues[0].cast>(); + auto value = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double b, double v, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = fmt::format("{}@{}", (v != 0.0 ? "t" : "f"), ts_str); + Temporal* temp = tbool_in(wkt.c_str()); + if (!temp) return 0.0; + int r = ever_ne_bool_tbool(static_cast(b != 0.0), temp); + free(temp); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + scalar, value, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverNeBoolTboolPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "EverNeBoolTboolPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return EverNeBoolTboolPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverNeTboolBoolPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverNeTboolBoolPhysicalFunction.cpp new file mode 100644 index 0000000000..6002b94504 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverNeTboolBoolPhysicalFunction.cpp @@ -0,0 +1,89 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +EverNeTboolBoolPhysicalFunction::EverNeTboolBoolPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(thresholdFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal EverNeTboolBoolPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto threshold = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double v, double thr, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = fmt::format("{}@{}", (v != 0.0 ? "t" : "f"), ts_str); + Temporal* temp = tbool_in(wkt.c_str()); + if (!temp) return 0.0; + int r = ever_ne_tbool_bool(temp, static_cast(thr != 0.0)); + free(temp); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + value, threshold, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverNeTboolBoolPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "EverNeTboolBoolPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return EverNeTboolBoolPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-sql-parser/AntlrSQL.g4 b/nes-sql-parser/AntlrSQL.g4 index 648ccc7e2c..ca13c40756 100644 --- a/nes-sql-parser/AntlrSQL.g4 +++ b/nes-sql-parser/AntlrSQL.g4 @@ -295,7 +295,7 @@ timeUnit: MS timestampParameter: name=identifier; -functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS; +functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS; sinkClause: INTO sink (',' sink)*; @@ -492,6 +492,8 @@ ALWAYS_GT_BIGINT_TBIGINT: 'ALWAYS_GT_BIGINT_TBIGINT' | 'always_gt_bigint_tbigint ALWAYS_LE_BIGINT_TBIGINT: 'ALWAYS_LE_BIGINT_TBIGINT' | 'always_le_bigint_tbigint'; ALWAYS_LT_BIGINT_TBIGINT: 'ALWAYS_LT_BIGINT_TBIGINT' | 'always_lt_bigint_tbigint'; ALWAYS_NE_BIGINT_TBIGINT: 'ALWAYS_NE_BIGINT_TBIGINT' | 'always_ne_bigint_tbigint'; +ALWAYS_EQ_BOOL_TBOOL: 'ALWAYS_EQ_BOOL_TBOOL' | 'always_eq_bool_tbool'; +ALWAYS_NE_BOOL_TBOOL: 'ALWAYS_NE_BOOL_TBOOL' | 'always_ne_bool_tbool'; ALWAYS_EQ_TBIGINT_BIGINT: 'ALWAYS_EQ_TBIGINT_BIGINT' | 'always_eq_tbigint_bigint'; ALWAYS_GE_TBIGINT_BIGINT: 'ALWAYS_GE_TBIGINT_BIGINT' | 'always_ge_tbigint_bigint'; ALWAYS_GT_TBIGINT_BIGINT: 'ALWAYS_GT_TBIGINT_BIGINT' | 'always_gt_tbigint_bigint'; @@ -504,6 +506,8 @@ ALWAYS_GT_TBIGINT_TBIGINT: 'ALWAYS_GT_TBIGINT_TBIGINT' | 'always_gt_tbigint_tbig ALWAYS_LE_TBIGINT_TBIGINT: 'ALWAYS_LE_TBIGINT_TBIGINT' | 'always_le_tbigint_tbigint'; ALWAYS_LT_TBIGINT_TBIGINT: 'ALWAYS_LT_TBIGINT_TBIGINT' | 'always_lt_tbigint_tbigint'; ALWAYS_NE_TBIGINT_TBIGINT: 'ALWAYS_NE_TBIGINT_TBIGINT' | 'always_ne_tbigint_tbigint'; +ALWAYS_EQ_TBOOL_BOOL: 'ALWAYS_EQ_TBOOL_BOOL' | 'always_eq_tbool_bool'; +ALWAYS_NE_TBOOL_BOOL: 'ALWAYS_NE_TBOOL_BOOL' | 'always_ne_tbool_bool'; ALWAYS_EQ_FLOAT_TFLOAT: 'ALWAYS_EQ_FLOAT_TFLOAT' | 'always_eq_float_tfloat'; ALWAYS_GE_FLOAT_TFLOAT: 'ALWAYS_GE_FLOAT_TFLOAT' | 'always_ge_float_tfloat'; ALWAYS_GT_FLOAT_TFLOAT: 'ALWAYS_GT_FLOAT_TFLOAT' | 'always_gt_float_tfloat'; @@ -547,6 +551,8 @@ EVER_GT_BIGINT_TBIGINT: 'EVER_GT_BIGINT_TBIGINT' | 'ever_gt_bigint_tbigint'; EVER_LE_BIGINT_TBIGINT: 'EVER_LE_BIGINT_TBIGINT' | 'ever_le_bigint_tbigint'; EVER_LT_BIGINT_TBIGINT: 'EVER_LT_BIGINT_TBIGINT' | 'ever_lt_bigint_tbigint'; EVER_NE_BIGINT_TBIGINT: 'EVER_NE_BIGINT_TBIGINT' | 'ever_ne_bigint_tbigint'; +EVER_EQ_BOOL_TBOOL: 'EVER_EQ_BOOL_TBOOL' | 'ever_eq_bool_tbool'; +EVER_NE_BOOL_TBOOL: 'EVER_NE_BOOL_TBOOL' | 'ever_ne_bool_tbool'; EVER_EQ_TBIGINT_BIGINT: 'EVER_EQ_TBIGINT_BIGINT' | 'ever_eq_tbigint_bigint'; EVER_GE_TBIGINT_BIGINT: 'EVER_GE_TBIGINT_BIGINT' | 'ever_ge_tbigint_bigint'; EVER_GT_TBIGINT_BIGINT: 'EVER_GT_TBIGINT_BIGINT' | 'ever_gt_tbigint_bigint'; @@ -559,6 +565,8 @@ EVER_GT_TBIGINT_TBIGINT: 'EVER_GT_TBIGINT_TBIGINT' | 'ever_gt_tbigint_tbigint'; EVER_LE_TBIGINT_TBIGINT: 'EVER_LE_TBIGINT_TBIGINT' | 'ever_le_tbigint_tbigint'; EVER_LT_TBIGINT_TBIGINT: 'EVER_LT_TBIGINT_TBIGINT' | 'ever_lt_tbigint_tbigint'; EVER_NE_TBIGINT_TBIGINT: 'EVER_NE_TBIGINT_TBIGINT' | 'ever_ne_tbigint_tbigint'; +EVER_EQ_TBOOL_BOOL: 'EVER_EQ_TBOOL_BOOL' | 'ever_eq_tbool_bool'; +EVER_NE_TBOOL_BOOL: 'EVER_NE_TBOOL_BOOL' | 'ever_ne_tbool_bool'; EVER_EQ_FLOAT_TFLOAT: 'EVER_EQ_FLOAT_TFLOAT' | 'ever_eq_float_tfloat'; EVER_GE_FLOAT_TFLOAT: 'EVER_GE_FLOAT_TFLOAT' | 'ever_ge_float_tfloat'; EVER_GT_FLOAT_TFLOAT: 'EVER_GT_FLOAT_TFLOAT' | 'ever_gt_float_tfloat'; diff --git a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp index aa7d1263e5..fdf7771230 100644 --- a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp +++ b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp @@ -235,6 +235,14 @@ #include #include #include +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include @@ -3544,6 +3552,64 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont } break; /* END CODEGEN PARSER GLUE: EVER_NE_TBIGINT_TBIGINT */ + /* BEGIN CODEGEN PARSER GLUE: EVER_EQ_BOOL_TBOOL */ + case AntlrSQLLexer::EVER_EQ_BOOL_TBOOL: + {{ + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("EVER_EQ_BOOL_TBOOL requires exactly 3 arguments, but got {{}}", argCount); + + while (!helpers.top().constantBuilder.empty()) + {{ + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + }} + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverEqBoolTboolLogicalFunction(a0, a1, a2)); + }} + break; + /* END CODEGEN PARSER GLUE: EVER_EQ_BOOL_TBOOL */ + /* BEGIN CODEGEN PARSER GLUE: EVER_NE_BOOL_TBOOL */ + case AntlrSQLLexer::EVER_NE_BOOL_TBOOL: + {{ + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("EVER_NE_BOOL_TBOOL requires exactly 3 arguments, but got {{}}", argCount); + + while (!helpers.top().constantBuilder.empty()) + {{ + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + }} + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverNeBoolTboolLogicalFunction(a0, a1, a2)); + }} + break; + /* END CODEGEN PARSER GLUE: EVER_NE_BOOL_TBOOL */ /* BEGIN CODEGEN PARSER GLUE: EVER_EQ_FLOAT_TFLOAT */ case AntlrSQLLexer::EVER_EQ_FLOAT_TFLOAT: {{ @@ -3718,6 +3784,64 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont }} break; /* END CODEGEN PARSER GLUE: EVER_NE_FLOAT_TFLOAT */ + /* BEGIN CODEGEN PARSER GLUE: EVER_EQ_TBOOL_BOOL */ + case AntlrSQLLexer::EVER_EQ_TBOOL_BOOL: + {{ + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("EVER_EQ_TBOOL_BOOL requires exactly 3 arguments, but got {{}}", argCount); + + while (!helpers.top().constantBuilder.empty()) + {{ + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + }} + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverEqTboolBoolLogicalFunction(a0, a1, a2)); + }} + break; + /* END CODEGEN PARSER GLUE: EVER_EQ_TBOOL_BOOL */ + /* BEGIN CODEGEN PARSER GLUE: EVER_NE_TBOOL_BOOL */ + case AntlrSQLLexer::EVER_NE_TBOOL_BOOL: + {{ + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("EVER_NE_TBOOL_BOOL requires exactly 3 arguments, but got {{}}", argCount); + + while (!helpers.top().constantBuilder.empty()) + {{ + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + }} + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverNeTboolBoolLogicalFunction(a0, a1, a2)); + }} + break; + /* END CODEGEN PARSER GLUE: EVER_NE_TBOOL_BOOL */ /* BEGIN CODEGEN PARSER GLUE: EVER_EQ_TFLOAT_FLOAT */ case AntlrSQLLexer::EVER_EQ_TFLOAT_FLOAT: { @@ -5632,6 +5756,64 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont } break; /* END CODEGEN PARSER GLUE: ALWAYS_NE_TBIGINT_TBIGINT */ + /* BEGIN CODEGEN PARSER GLUE: ALWAYS_EQ_BOOL_TBOOL */ + case AntlrSQLLexer::ALWAYS_EQ_BOOL_TBOOL: + {{ + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("ALWAYS_EQ_BOOL_TBOOL requires exactly 3 arguments, but got {{}}", argCount); + + while (!helpers.top().constantBuilder.empty()) + {{ + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + }} + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AlwaysEqBoolTboolLogicalFunction(a0, a1, a2)); + }} + break; + /* END CODEGEN PARSER GLUE: ALWAYS_EQ_BOOL_TBOOL */ + /* BEGIN CODEGEN PARSER GLUE: ALWAYS_NE_BOOL_TBOOL */ + case AntlrSQLLexer::ALWAYS_NE_BOOL_TBOOL: + {{ + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("ALWAYS_NE_BOOL_TBOOL requires exactly 3 arguments, but got {{}}", argCount); + + while (!helpers.top().constantBuilder.empty()) + {{ + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + }} + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AlwaysNeBoolTboolLogicalFunction(a0, a1, a2)); + }} + break; + /* END CODEGEN PARSER GLUE: ALWAYS_NE_BOOL_TBOOL */ /* BEGIN CODEGEN PARSER GLUE: ALWAYS_EQ_FLOAT_TFLOAT */ case AntlrSQLLexer::ALWAYS_EQ_FLOAT_TFLOAT: {{ @@ -5806,6 +5988,64 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont }} break; /* END CODEGEN PARSER GLUE: ALWAYS_NE_FLOAT_TFLOAT */ + /* BEGIN CODEGEN PARSER GLUE: ALWAYS_EQ_TBOOL_BOOL */ + case AntlrSQLLexer::ALWAYS_EQ_TBOOL_BOOL: + {{ + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("ALWAYS_EQ_TBOOL_BOOL requires exactly 3 arguments, but got {{}}", argCount); + + while (!helpers.top().constantBuilder.empty()) + {{ + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + }} + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AlwaysEqTboolBoolLogicalFunction(a0, a1, a2)); + }} + break; + /* END CODEGEN PARSER GLUE: ALWAYS_EQ_TBOOL_BOOL */ + /* BEGIN CODEGEN PARSER GLUE: ALWAYS_NE_TBOOL_BOOL */ + case AntlrSQLLexer::ALWAYS_NE_TBOOL_BOOL: + {{ + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("ALWAYS_NE_TBOOL_BOOL requires exactly 3 arguments, but got {{}}", argCount); + + while (!helpers.top().constantBuilder.empty()) + {{ + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + }} + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AlwaysNeTboolBoolLogicalFunction(a0, a1, a2)); + }} + break; + /* END CODEGEN PARSER GLUE: ALWAYS_NE_TBOOL_BOOL */ /* BEGIN CODEGEN PARSER GLUE: ALWAYS_EQ_TFLOAT_FLOAT */ case AntlrSQLLexer::ALWAYS_EQ_TFLOAT_FLOAT: { From 07e6c3864e8a35149d2e92d04f0dc1949d105e98 Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Fri, 12 Jun 2026 10:28:50 +0200 Subject: [PATCH 33/96] feat(meos): add EVER/ALWAYS_{EQ,GE,GT,LE,LT,NE}_TEMPORAL_TEMPORAL NES operators (W83-W84) --- ...lwaysEqTemporalTemporalLogicalFunction.hpp | 54 +++ ...lwaysGeTemporalTemporalLogicalFunction.hpp | 54 +++ ...lwaysGtTemporalTemporalLogicalFunction.hpp | 54 +++ ...lwaysLeTemporalTemporalLogicalFunction.hpp | 54 +++ ...lwaysLtTemporalTemporalLogicalFunction.hpp | 54 +++ ...lwaysNeTemporalTemporalLogicalFunction.hpp | 54 +++ .../EverEqTemporalTemporalLogicalFunction.hpp | 54 +++ .../EverGeTemporalTemporalLogicalFunction.hpp | 54 +++ .../EverGtTemporalTemporalLogicalFunction.hpp | 54 +++ .../EverLeTemporalTemporalLogicalFunction.hpp | 54 +++ .../EverLtTemporalTemporalLogicalFunction.hpp | 54 +++ .../EverNeTemporalTemporalLogicalFunction.hpp | 54 +++ ...lwaysEqTemporalTemporalLogicalFunction.cpp | 105 +++++ ...lwaysGeTemporalTemporalLogicalFunction.cpp | 105 +++++ ...lwaysGtTemporalTemporalLogicalFunction.cpp | 105 +++++ ...lwaysLeTemporalTemporalLogicalFunction.cpp | 105 +++++ ...lwaysLtTemporalTemporalLogicalFunction.cpp | 105 +++++ ...lwaysNeTemporalTemporalLogicalFunction.cpp | 105 +++++ .../src/Functions/Meos/CMakeLists.txt | 12 + .../EverEqTemporalTemporalLogicalFunction.cpp | 105 +++++ .../EverGeTemporalTemporalLogicalFunction.cpp | 105 +++++ .../EverGtTemporalTemporalLogicalFunction.cpp | 105 +++++ .../EverLeTemporalTemporalLogicalFunction.cpp | 105 +++++ .../EverLtTemporalTemporalLogicalFunction.cpp | 105 +++++ .../EverNeTemporalTemporalLogicalFunction.cpp | 105 +++++ ...waysEqTemporalTemporalPhysicalFunction.hpp | 43 +++ ...waysGeTemporalTemporalPhysicalFunction.hpp | 43 +++ ...waysGtTemporalTemporalPhysicalFunction.hpp | 43 +++ ...waysLeTemporalTemporalPhysicalFunction.hpp | 43 +++ ...waysLtTemporalTemporalPhysicalFunction.hpp | 43 +++ ...waysNeTemporalTemporalPhysicalFunction.hpp | 43 +++ ...EverEqTemporalTemporalPhysicalFunction.hpp | 43 +++ ...EverGeTemporalTemporalPhysicalFunction.hpp | 43 +++ ...EverGtTemporalTemporalPhysicalFunction.hpp | 43 +++ ...EverLeTemporalTemporalPhysicalFunction.hpp | 43 +++ ...EverLtTemporalTemporalPhysicalFunction.hpp | 43 +++ ...EverNeTemporalTemporalPhysicalFunction.hpp | 43 +++ ...waysEqTemporalTemporalPhysicalFunction.cpp | 93 +++++ ...waysGeTemporalTemporalPhysicalFunction.cpp | 93 +++++ ...waysGtTemporalTemporalPhysicalFunction.cpp | 93 +++++ ...waysLeTemporalTemporalPhysicalFunction.cpp | 93 +++++ ...waysLtTemporalTemporalPhysicalFunction.cpp | 93 +++++ ...waysNeTemporalTemporalPhysicalFunction.cpp | 93 +++++ .../src/Functions/Meos/CMakeLists.txt | 12 + ...EverEqTemporalTemporalPhysicalFunction.cpp | 93 +++++ ...EverGeTemporalTemporalPhysicalFunction.cpp | 93 +++++ ...EverGtTemporalTemporalPhysicalFunction.cpp | 93 +++++ ...EverLeTemporalTemporalPhysicalFunction.cpp | 93 +++++ ...EverLtTemporalTemporalPhysicalFunction.cpp | 93 +++++ ...EverNeTemporalTemporalPhysicalFunction.cpp | 93 +++++ nes-sql-parser/AntlrSQL.g4 | 14 +- .../src/AntlrSQLQueryPlanCreator.cpp | 360 ++++++++++++++++++ 52 files changed, 3937 insertions(+), 1 deletion(-) create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysEqTemporalTemporalLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysGeTemporalTemporalLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysGtTemporalTemporalLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysLeTemporalTemporalLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysLtTemporalTemporalLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysNeTemporalTemporalLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverEqTemporalTemporalLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverGeTemporalTemporalLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverGtTemporalTemporalLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverLeTemporalTemporalLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverLtTemporalTemporalLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverNeTemporalTemporalLogicalFunction.hpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysEqTemporalTemporalLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysGeTemporalTemporalLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysGtTemporalTemporalLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysLeTemporalTemporalLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysLtTemporalTemporalLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysNeTemporalTemporalLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverEqTemporalTemporalLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverGeTemporalTemporalLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverGtTemporalTemporalLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverLeTemporalTemporalLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverLtTemporalTemporalLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverNeTemporalTemporalLogicalFunction.cpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysEqTemporalTemporalPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysGeTemporalTemporalPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysGtTemporalTemporalPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysLeTemporalTemporalPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysLtTemporalTemporalPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysNeTemporalTemporalPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverEqTemporalTemporalPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverGeTemporalTemporalPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverGtTemporalTemporalPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverLeTemporalTemporalPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverLtTemporalTemporalPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverNeTemporalTemporalPhysicalFunction.hpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysEqTemporalTemporalPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysGeTemporalTemporalPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysGtTemporalTemporalPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysLeTemporalTemporalPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysLtTemporalTemporalPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysNeTemporalTemporalPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverEqTemporalTemporalPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverGeTemporalTemporalPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverGtTemporalTemporalPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverLeTemporalTemporalPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverLtTemporalTemporalPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverNeTemporalTemporalPhysicalFunction.cpp diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysEqTemporalTemporalLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysEqTemporalTemporalLogicalFunction.hpp new file mode 100644 index 0000000000..1119fd60d0 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysEqTemporalTemporalLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event always_eq_temporal_temporal: tests if a single-instant tfloat value ever equals a threshold. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `always_eq_temporal_temporal`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class AlwaysEqTemporalTemporalLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysEqTemporalTemporal"; + + AlwaysEqTemporalTemporalLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysGeTemporalTemporalLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysGeTemporalTemporalLogicalFunction.hpp new file mode 100644 index 0000000000..647c33addd --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysGeTemporalTemporalLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event always_ge_temporal_temporal: tests if a single-instant tfloat value ever equals a threshold. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `always_ge_temporal_temporal`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class AlwaysGeTemporalTemporalLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysGeTemporalTemporal"; + + AlwaysGeTemporalTemporalLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysGtTemporalTemporalLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysGtTemporalTemporalLogicalFunction.hpp new file mode 100644 index 0000000000..a7362efb30 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysGtTemporalTemporalLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event always_gt_temporal_temporal: tests if a single-instant tfloat value ever equals a threshold. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `always_gt_temporal_temporal`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class AlwaysGtTemporalTemporalLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysGtTemporalTemporal"; + + AlwaysGtTemporalTemporalLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysLeTemporalTemporalLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysLeTemporalTemporalLogicalFunction.hpp new file mode 100644 index 0000000000..4cd15d1b1f --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysLeTemporalTemporalLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event always_le_temporal_temporal: tests if a single-instant tfloat value ever equals a threshold. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `always_le_temporal_temporal`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class AlwaysLeTemporalTemporalLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysLeTemporalTemporal"; + + AlwaysLeTemporalTemporalLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysLtTemporalTemporalLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysLtTemporalTemporalLogicalFunction.hpp new file mode 100644 index 0000000000..7979f582d9 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysLtTemporalTemporalLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event always_lt_temporal_temporal: tests if a single-instant tfloat value ever equals a threshold. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `always_lt_temporal_temporal`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class AlwaysLtTemporalTemporalLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysLtTemporalTemporal"; + + AlwaysLtTemporalTemporalLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysNeTemporalTemporalLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysNeTemporalTemporalLogicalFunction.hpp new file mode 100644 index 0000000000..eb898a21e6 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysNeTemporalTemporalLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event always_ne_temporal_temporal: tests if a single-instant tfloat value ever equals a threshold. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `always_ne_temporal_temporal`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class AlwaysNeTemporalTemporalLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysNeTemporalTemporal"; + + AlwaysNeTemporalTemporalLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverEqTemporalTemporalLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverEqTemporalTemporalLogicalFunction.hpp new file mode 100644 index 0000000000..eba432b62b --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverEqTemporalTemporalLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event ever_eq_temporal_temporal: tests if a single-instant tfloat value ever equals a threshold. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ever_eq_temporal_temporal`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class EverEqTemporalTemporalLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverEqTemporalTemporal"; + + EverEqTemporalTemporalLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverGeTemporalTemporalLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverGeTemporalTemporalLogicalFunction.hpp new file mode 100644 index 0000000000..e871ad743d --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverGeTemporalTemporalLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event ever_ge_temporal_temporal: tests if a single-instant tfloat value ever equals a threshold. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ever_ge_temporal_temporal`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class EverGeTemporalTemporalLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverGeTemporalTemporal"; + + EverGeTemporalTemporalLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverGtTemporalTemporalLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverGtTemporalTemporalLogicalFunction.hpp new file mode 100644 index 0000000000..8731c8a6a5 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverGtTemporalTemporalLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event ever_gt_temporal_temporal: tests if a single-instant tfloat value ever equals a threshold. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ever_gt_temporal_temporal`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class EverGtTemporalTemporalLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverGtTemporalTemporal"; + + EverGtTemporalTemporalLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverLeTemporalTemporalLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverLeTemporalTemporalLogicalFunction.hpp new file mode 100644 index 0000000000..6463120db6 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverLeTemporalTemporalLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event ever_le_temporal_temporal: tests if a single-instant tfloat value ever equals a threshold. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ever_le_temporal_temporal`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class EverLeTemporalTemporalLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverLeTemporalTemporal"; + + EverLeTemporalTemporalLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverLtTemporalTemporalLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverLtTemporalTemporalLogicalFunction.hpp new file mode 100644 index 0000000000..87f20d2867 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverLtTemporalTemporalLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event ever_lt_temporal_temporal: tests if a single-instant tfloat value ever equals a threshold. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ever_lt_temporal_temporal`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class EverLtTemporalTemporalLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverLtTemporalTemporal"; + + EverLtTemporalTemporalLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverNeTemporalTemporalLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverNeTemporalTemporalLogicalFunction.hpp new file mode 100644 index 0000000000..7cec67dbac --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverNeTemporalTemporalLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event ever_ne_temporal_temporal: tests if a single-instant tfloat value ever equals a threshold. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ever_ne_temporal_temporal`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class EverNeTemporalTemporalLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverNeTemporalTemporal"; + + EverNeTemporalTemporalLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysEqTemporalTemporalLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysEqTemporalTemporalLogicalFunction.cpp new file mode 100644 index 0000000000..21b53dd08e --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysEqTemporalTemporalLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AlwaysEqTemporalTemporalLogicalFunction::AlwaysEqTemporalTemporalLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType AlwaysEqTemporalTemporalLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysEqTemporalTemporalLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AlwaysEqTemporalTemporalLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysEqTemporalTemporalLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "AlwaysEqTemporalTemporalLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AlwaysEqTemporalTemporalLogicalFunction::getType() const { return NAME; } + +bool AlwaysEqTemporalTemporalLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AlwaysEqTemporalTemporalLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction AlwaysEqTemporalTemporalLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction AlwaysEqTemporalTemporalLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysEqTemporalTemporalLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "AlwaysEqTemporalTemporalLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return AlwaysEqTemporalTemporalLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysGeTemporalTemporalLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysGeTemporalTemporalLogicalFunction.cpp new file mode 100644 index 0000000000..2a881ba8c9 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysGeTemporalTemporalLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AlwaysGeTemporalTemporalLogicalFunction::AlwaysGeTemporalTemporalLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType AlwaysGeTemporalTemporalLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysGeTemporalTemporalLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AlwaysGeTemporalTemporalLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysGeTemporalTemporalLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "AlwaysGeTemporalTemporalLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AlwaysGeTemporalTemporalLogicalFunction::getType() const { return NAME; } + +bool AlwaysGeTemporalTemporalLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AlwaysGeTemporalTemporalLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction AlwaysGeTemporalTemporalLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction AlwaysGeTemporalTemporalLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysGeTemporalTemporalLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "AlwaysGeTemporalTemporalLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return AlwaysGeTemporalTemporalLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysGtTemporalTemporalLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysGtTemporalTemporalLogicalFunction.cpp new file mode 100644 index 0000000000..16169b2eac --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysGtTemporalTemporalLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AlwaysGtTemporalTemporalLogicalFunction::AlwaysGtTemporalTemporalLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType AlwaysGtTemporalTemporalLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysGtTemporalTemporalLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AlwaysGtTemporalTemporalLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysGtTemporalTemporalLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "AlwaysGtTemporalTemporalLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AlwaysGtTemporalTemporalLogicalFunction::getType() const { return NAME; } + +bool AlwaysGtTemporalTemporalLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AlwaysGtTemporalTemporalLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction AlwaysGtTemporalTemporalLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction AlwaysGtTemporalTemporalLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysGtTemporalTemporalLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "AlwaysGtTemporalTemporalLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return AlwaysGtTemporalTemporalLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysLeTemporalTemporalLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysLeTemporalTemporalLogicalFunction.cpp new file mode 100644 index 0000000000..5e3005c912 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysLeTemporalTemporalLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AlwaysLeTemporalTemporalLogicalFunction::AlwaysLeTemporalTemporalLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType AlwaysLeTemporalTemporalLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysLeTemporalTemporalLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AlwaysLeTemporalTemporalLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysLeTemporalTemporalLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "AlwaysLeTemporalTemporalLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AlwaysLeTemporalTemporalLogicalFunction::getType() const { return NAME; } + +bool AlwaysLeTemporalTemporalLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AlwaysLeTemporalTemporalLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction AlwaysLeTemporalTemporalLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction AlwaysLeTemporalTemporalLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysLeTemporalTemporalLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "AlwaysLeTemporalTemporalLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return AlwaysLeTemporalTemporalLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysLtTemporalTemporalLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysLtTemporalTemporalLogicalFunction.cpp new file mode 100644 index 0000000000..b2cd2ba558 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysLtTemporalTemporalLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AlwaysLtTemporalTemporalLogicalFunction::AlwaysLtTemporalTemporalLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType AlwaysLtTemporalTemporalLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysLtTemporalTemporalLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AlwaysLtTemporalTemporalLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysLtTemporalTemporalLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "AlwaysLtTemporalTemporalLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AlwaysLtTemporalTemporalLogicalFunction::getType() const { return NAME; } + +bool AlwaysLtTemporalTemporalLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AlwaysLtTemporalTemporalLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction AlwaysLtTemporalTemporalLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction AlwaysLtTemporalTemporalLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysLtTemporalTemporalLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "AlwaysLtTemporalTemporalLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return AlwaysLtTemporalTemporalLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysNeTemporalTemporalLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysNeTemporalTemporalLogicalFunction.cpp new file mode 100644 index 0000000000..f1d5e995f7 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysNeTemporalTemporalLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AlwaysNeTemporalTemporalLogicalFunction::AlwaysNeTemporalTemporalLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType AlwaysNeTemporalTemporalLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysNeTemporalTemporalLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AlwaysNeTemporalTemporalLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysNeTemporalTemporalLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "AlwaysNeTemporalTemporalLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AlwaysNeTemporalTemporalLogicalFunction::getType() const { return NAME; } + +bool AlwaysNeTemporalTemporalLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AlwaysNeTemporalTemporalLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction AlwaysNeTemporalTemporalLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction AlwaysNeTemporalTemporalLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysNeTemporalTemporalLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "AlwaysNeTemporalTemporalLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return AlwaysNeTemporalTemporalLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt index f9a47318c7..f14f18a37c 100644 --- a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt @@ -192,3 +192,15 @@ add_plugin(AlwaysEqTboolBool LogicalFunction nes-logical-operators AlwaysEqTbool add_plugin(AlwaysNeTboolBool LogicalFunction nes-logical-operators AlwaysNeTboolBoolLogicalFunction.cpp) add_plugin(AlwaysEqBoolTbool LogicalFunction nes-logical-operators AlwaysEqBoolTboolLogicalFunction.cpp) add_plugin(AlwaysNeBoolTbool LogicalFunction nes-logical-operators AlwaysNeBoolTboolLogicalFunction.cpp) +add_plugin(EverEqTemporalTemporal LogicalFunction nes-logical-operators EverEqTemporalTemporalLogicalFunction.cpp) +add_plugin(EverGeTemporalTemporal LogicalFunction nes-logical-operators EverGeTemporalTemporalLogicalFunction.cpp) +add_plugin(EverGtTemporalTemporal LogicalFunction nes-logical-operators EverGtTemporalTemporalLogicalFunction.cpp) +add_plugin(EverLeTemporalTemporal LogicalFunction nes-logical-operators EverLeTemporalTemporalLogicalFunction.cpp) +add_plugin(EverLtTemporalTemporal LogicalFunction nes-logical-operators EverLtTemporalTemporalLogicalFunction.cpp) +add_plugin(EverNeTemporalTemporal LogicalFunction nes-logical-operators EverNeTemporalTemporalLogicalFunction.cpp) +add_plugin(AlwaysEqTemporalTemporal LogicalFunction nes-logical-operators AlwaysEqTemporalTemporalLogicalFunction.cpp) +add_plugin(AlwaysGeTemporalTemporal LogicalFunction nes-logical-operators AlwaysGeTemporalTemporalLogicalFunction.cpp) +add_plugin(AlwaysGtTemporalTemporal LogicalFunction nes-logical-operators AlwaysGtTemporalTemporalLogicalFunction.cpp) +add_plugin(AlwaysLeTemporalTemporal LogicalFunction nes-logical-operators AlwaysLeTemporalTemporalLogicalFunction.cpp) +add_plugin(AlwaysLtTemporalTemporal LogicalFunction nes-logical-operators AlwaysLtTemporalTemporalLogicalFunction.cpp) +add_plugin(AlwaysNeTemporalTemporal LogicalFunction nes-logical-operators AlwaysNeTemporalTemporalLogicalFunction.cpp) diff --git a/nes-logical-operators/src/Functions/Meos/EverEqTemporalTemporalLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverEqTemporalTemporalLogicalFunction.cpp new file mode 100644 index 0000000000..93b07cb056 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverEqTemporalTemporalLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EverEqTemporalTemporalLogicalFunction::EverEqTemporalTemporalLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType EverEqTemporalTemporalLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverEqTemporalTemporalLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EverEqTemporalTemporalLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverEqTemporalTemporalLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "EverEqTemporalTemporalLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EverEqTemporalTemporalLogicalFunction::getType() const { return NAME; } + +bool EverEqTemporalTemporalLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EverEqTemporalTemporalLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction EverEqTemporalTemporalLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction EverEqTemporalTemporalLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverEqTemporalTemporalLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "EverEqTemporalTemporalLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return EverEqTemporalTemporalLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverGeTemporalTemporalLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverGeTemporalTemporalLogicalFunction.cpp new file mode 100644 index 0000000000..5480aff699 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverGeTemporalTemporalLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EverGeTemporalTemporalLogicalFunction::EverGeTemporalTemporalLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType EverGeTemporalTemporalLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverGeTemporalTemporalLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EverGeTemporalTemporalLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverGeTemporalTemporalLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "EverGeTemporalTemporalLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EverGeTemporalTemporalLogicalFunction::getType() const { return NAME; } + +bool EverGeTemporalTemporalLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EverGeTemporalTemporalLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction EverGeTemporalTemporalLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction EverGeTemporalTemporalLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverGeTemporalTemporalLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "EverGeTemporalTemporalLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return EverGeTemporalTemporalLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverGtTemporalTemporalLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverGtTemporalTemporalLogicalFunction.cpp new file mode 100644 index 0000000000..ab18b264c2 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverGtTemporalTemporalLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EverGtTemporalTemporalLogicalFunction::EverGtTemporalTemporalLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType EverGtTemporalTemporalLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverGtTemporalTemporalLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EverGtTemporalTemporalLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverGtTemporalTemporalLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "EverGtTemporalTemporalLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EverGtTemporalTemporalLogicalFunction::getType() const { return NAME; } + +bool EverGtTemporalTemporalLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EverGtTemporalTemporalLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction EverGtTemporalTemporalLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction EverGtTemporalTemporalLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverGtTemporalTemporalLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "EverGtTemporalTemporalLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return EverGtTemporalTemporalLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverLeTemporalTemporalLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverLeTemporalTemporalLogicalFunction.cpp new file mode 100644 index 0000000000..14d8f2ccaa --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverLeTemporalTemporalLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EverLeTemporalTemporalLogicalFunction::EverLeTemporalTemporalLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType EverLeTemporalTemporalLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverLeTemporalTemporalLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EverLeTemporalTemporalLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverLeTemporalTemporalLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "EverLeTemporalTemporalLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EverLeTemporalTemporalLogicalFunction::getType() const { return NAME; } + +bool EverLeTemporalTemporalLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EverLeTemporalTemporalLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction EverLeTemporalTemporalLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction EverLeTemporalTemporalLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverLeTemporalTemporalLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "EverLeTemporalTemporalLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return EverLeTemporalTemporalLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverLtTemporalTemporalLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverLtTemporalTemporalLogicalFunction.cpp new file mode 100644 index 0000000000..93b8adbb06 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverLtTemporalTemporalLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EverLtTemporalTemporalLogicalFunction::EverLtTemporalTemporalLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType EverLtTemporalTemporalLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverLtTemporalTemporalLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EverLtTemporalTemporalLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverLtTemporalTemporalLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "EverLtTemporalTemporalLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EverLtTemporalTemporalLogicalFunction::getType() const { return NAME; } + +bool EverLtTemporalTemporalLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EverLtTemporalTemporalLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction EverLtTemporalTemporalLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction EverLtTemporalTemporalLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverLtTemporalTemporalLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "EverLtTemporalTemporalLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return EverLtTemporalTemporalLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverNeTemporalTemporalLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverNeTemporalTemporalLogicalFunction.cpp new file mode 100644 index 0000000000..db5ae7e632 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverNeTemporalTemporalLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EverNeTemporalTemporalLogicalFunction::EverNeTemporalTemporalLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType EverNeTemporalTemporalLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverNeTemporalTemporalLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EverNeTemporalTemporalLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverNeTemporalTemporalLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "EverNeTemporalTemporalLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EverNeTemporalTemporalLogicalFunction::getType() const { return NAME; } + +bool EverNeTemporalTemporalLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EverNeTemporalTemporalLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction EverNeTemporalTemporalLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction EverNeTemporalTemporalLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverNeTemporalTemporalLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "EverNeTemporalTemporalLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return EverNeTemporalTemporalLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysEqTemporalTemporalPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysEqTemporalTemporalPhysicalFunction.hpp new file mode 100644 index 0000000000..693c6f30a1 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysEqTemporalTemporalPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `always_eq_temporal_temporal`. + * + * Per-event always_eq_temporal_temporal: tests if a single-instant tfloat value ever equals a threshold. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class AlwaysEqTemporalTemporalPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysEqTemporalTemporalPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysGeTemporalTemporalPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysGeTemporalTemporalPhysicalFunction.hpp new file mode 100644 index 0000000000..9e8f9d6587 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysGeTemporalTemporalPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `always_ge_temporal_temporal`. + * + * Per-event always_ge_temporal_temporal: tests if a single-instant tfloat value ever equals a threshold. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class AlwaysGeTemporalTemporalPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysGeTemporalTemporalPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysGtTemporalTemporalPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysGtTemporalTemporalPhysicalFunction.hpp new file mode 100644 index 0000000000..dab636c409 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysGtTemporalTemporalPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `always_gt_temporal_temporal`. + * + * Per-event always_gt_temporal_temporal: tests if a single-instant tfloat value ever equals a threshold. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class AlwaysGtTemporalTemporalPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysGtTemporalTemporalPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysLeTemporalTemporalPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysLeTemporalTemporalPhysicalFunction.hpp new file mode 100644 index 0000000000..d5bfda04e0 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysLeTemporalTemporalPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `always_le_temporal_temporal`. + * + * Per-event always_le_temporal_temporal: tests if a single-instant tfloat value ever equals a threshold. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class AlwaysLeTemporalTemporalPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysLeTemporalTemporalPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysLtTemporalTemporalPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysLtTemporalTemporalPhysicalFunction.hpp new file mode 100644 index 0000000000..c735e0b348 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysLtTemporalTemporalPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `always_lt_temporal_temporal`. + * + * Per-event always_lt_temporal_temporal: tests if a single-instant tfloat value ever equals a threshold. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class AlwaysLtTemporalTemporalPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysLtTemporalTemporalPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysNeTemporalTemporalPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysNeTemporalTemporalPhysicalFunction.hpp new file mode 100644 index 0000000000..748bad3b24 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysNeTemporalTemporalPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `always_ne_temporal_temporal`. + * + * Per-event always_ne_temporal_temporal: tests if a single-instant tfloat value ever equals a threshold. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class AlwaysNeTemporalTemporalPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysNeTemporalTemporalPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverEqTemporalTemporalPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverEqTemporalTemporalPhysicalFunction.hpp new file mode 100644 index 0000000000..6b9cf6ba58 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverEqTemporalTemporalPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `ever_eq_temporal_temporal`. + * + * Per-event ever_eq_temporal_temporal: tests if a single-instant tfloat value ever equals a threshold. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class EverEqTemporalTemporalPhysicalFunction : public PhysicalFunctionConcept { +public: + EverEqTemporalTemporalPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverGeTemporalTemporalPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverGeTemporalTemporalPhysicalFunction.hpp new file mode 100644 index 0000000000..6106d2f3a9 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverGeTemporalTemporalPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `ever_ge_temporal_temporal`. + * + * Per-event ever_ge_temporal_temporal: tests if a single-instant tfloat value ever equals a threshold. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class EverGeTemporalTemporalPhysicalFunction : public PhysicalFunctionConcept { +public: + EverGeTemporalTemporalPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverGtTemporalTemporalPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverGtTemporalTemporalPhysicalFunction.hpp new file mode 100644 index 0000000000..44bf8ac0b5 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverGtTemporalTemporalPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `ever_gt_temporal_temporal`. + * + * Per-event ever_gt_temporal_temporal: tests if a single-instant tfloat value ever equals a threshold. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class EverGtTemporalTemporalPhysicalFunction : public PhysicalFunctionConcept { +public: + EverGtTemporalTemporalPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverLeTemporalTemporalPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverLeTemporalTemporalPhysicalFunction.hpp new file mode 100644 index 0000000000..595864ba80 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverLeTemporalTemporalPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `ever_le_temporal_temporal`. + * + * Per-event ever_le_temporal_temporal: tests if a single-instant tfloat value ever equals a threshold. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class EverLeTemporalTemporalPhysicalFunction : public PhysicalFunctionConcept { +public: + EverLeTemporalTemporalPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverLtTemporalTemporalPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverLtTemporalTemporalPhysicalFunction.hpp new file mode 100644 index 0000000000..92fecbd859 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverLtTemporalTemporalPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `ever_lt_temporal_temporal`. + * + * Per-event ever_lt_temporal_temporal: tests if a single-instant tfloat value ever equals a threshold. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class EverLtTemporalTemporalPhysicalFunction : public PhysicalFunctionConcept { +public: + EverLtTemporalTemporalPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverNeTemporalTemporalPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverNeTemporalTemporalPhysicalFunction.hpp new file mode 100644 index 0000000000..6c64b42b48 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverNeTemporalTemporalPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `ever_ne_temporal_temporal`. + * + * Per-event ever_ne_temporal_temporal: tests if a single-instant tfloat value ever equals a threshold. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class EverNeTemporalTemporalPhysicalFunction : public PhysicalFunctionConcept { +public: + EverNeTemporalTemporalPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysEqTemporalTemporalPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysEqTemporalTemporalPhysicalFunction.cpp new file mode 100644 index 0000000000..8761987aba --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysEqTemporalTemporalPhysicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +AlwaysEqTemporalTemporalPhysicalFunction::AlwaysEqTemporalTemporalPhysicalFunction(PhysicalFunction value1Function, + PhysicalFunction value2Function, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(value1Function)); + parameterFunctions.push_back(std::move(value2Function)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal AlwaysEqTemporalTemporalPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value1 = parameterValues[0].cast>(); + auto value2 = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double v1, double v2, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt1 = fmt::format("{}@{}", v1, ts_str); + std::string wkt2 = fmt::format("{}@{}", v2, ts_str); + Temporal* temp1 = tfloat_in(wkt1.c_str()); + if (!temp1) return 0.0; + Temporal* temp2 = tfloat_in(wkt2.c_str()); + if (!temp2) { free(temp1); return 0.0; } + int r = always_eq_temporal_temporal(temp1, temp2); + free(temp1); + free(temp2); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + value1, value2, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysEqTemporalTemporalPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "AlwaysEqTemporalTemporalPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return AlwaysEqTemporalTemporalPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysGeTemporalTemporalPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysGeTemporalTemporalPhysicalFunction.cpp new file mode 100644 index 0000000000..dcec06fad9 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysGeTemporalTemporalPhysicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +AlwaysGeTemporalTemporalPhysicalFunction::AlwaysGeTemporalTemporalPhysicalFunction(PhysicalFunction value1Function, + PhysicalFunction value2Function, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(value1Function)); + parameterFunctions.push_back(std::move(value2Function)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal AlwaysGeTemporalTemporalPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value1 = parameterValues[0].cast>(); + auto value2 = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double v1, double v2, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt1 = fmt::format("{}@{}", v1, ts_str); + std::string wkt2 = fmt::format("{}@{}", v2, ts_str); + Temporal* temp1 = tfloat_in(wkt1.c_str()); + if (!temp1) return 0.0; + Temporal* temp2 = tfloat_in(wkt2.c_str()); + if (!temp2) { free(temp1); return 0.0; } + int r = always_ge_temporal_temporal(temp1, temp2); + free(temp1); + free(temp2); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + value1, value2, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysGeTemporalTemporalPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "AlwaysGeTemporalTemporalPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return AlwaysGeTemporalTemporalPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysGtTemporalTemporalPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysGtTemporalTemporalPhysicalFunction.cpp new file mode 100644 index 0000000000..67ffaefc85 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysGtTemporalTemporalPhysicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +AlwaysGtTemporalTemporalPhysicalFunction::AlwaysGtTemporalTemporalPhysicalFunction(PhysicalFunction value1Function, + PhysicalFunction value2Function, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(value1Function)); + parameterFunctions.push_back(std::move(value2Function)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal AlwaysGtTemporalTemporalPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value1 = parameterValues[0].cast>(); + auto value2 = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double v1, double v2, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt1 = fmt::format("{}@{}", v1, ts_str); + std::string wkt2 = fmt::format("{}@{}", v2, ts_str); + Temporal* temp1 = tfloat_in(wkt1.c_str()); + if (!temp1) return 0.0; + Temporal* temp2 = tfloat_in(wkt2.c_str()); + if (!temp2) { free(temp1); return 0.0; } + int r = always_gt_temporal_temporal(temp1, temp2); + free(temp1); + free(temp2); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + value1, value2, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysGtTemporalTemporalPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "AlwaysGtTemporalTemporalPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return AlwaysGtTemporalTemporalPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysLeTemporalTemporalPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysLeTemporalTemporalPhysicalFunction.cpp new file mode 100644 index 0000000000..7220089652 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysLeTemporalTemporalPhysicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +AlwaysLeTemporalTemporalPhysicalFunction::AlwaysLeTemporalTemporalPhysicalFunction(PhysicalFunction value1Function, + PhysicalFunction value2Function, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(value1Function)); + parameterFunctions.push_back(std::move(value2Function)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal AlwaysLeTemporalTemporalPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value1 = parameterValues[0].cast>(); + auto value2 = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double v1, double v2, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt1 = fmt::format("{}@{}", v1, ts_str); + std::string wkt2 = fmt::format("{}@{}", v2, ts_str); + Temporal* temp1 = tfloat_in(wkt1.c_str()); + if (!temp1) return 0.0; + Temporal* temp2 = tfloat_in(wkt2.c_str()); + if (!temp2) { free(temp1); return 0.0; } + int r = always_le_temporal_temporal(temp1, temp2); + free(temp1); + free(temp2); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + value1, value2, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysLeTemporalTemporalPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "AlwaysLeTemporalTemporalPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return AlwaysLeTemporalTemporalPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysLtTemporalTemporalPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysLtTemporalTemporalPhysicalFunction.cpp new file mode 100644 index 0000000000..e1a743f20b --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysLtTemporalTemporalPhysicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +AlwaysLtTemporalTemporalPhysicalFunction::AlwaysLtTemporalTemporalPhysicalFunction(PhysicalFunction value1Function, + PhysicalFunction value2Function, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(value1Function)); + parameterFunctions.push_back(std::move(value2Function)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal AlwaysLtTemporalTemporalPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value1 = parameterValues[0].cast>(); + auto value2 = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double v1, double v2, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt1 = fmt::format("{}@{}", v1, ts_str); + std::string wkt2 = fmt::format("{}@{}", v2, ts_str); + Temporal* temp1 = tfloat_in(wkt1.c_str()); + if (!temp1) return 0.0; + Temporal* temp2 = tfloat_in(wkt2.c_str()); + if (!temp2) { free(temp1); return 0.0; } + int r = always_lt_temporal_temporal(temp1, temp2); + free(temp1); + free(temp2); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + value1, value2, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysLtTemporalTemporalPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "AlwaysLtTemporalTemporalPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return AlwaysLtTemporalTemporalPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysNeTemporalTemporalPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysNeTemporalTemporalPhysicalFunction.cpp new file mode 100644 index 0000000000..04d9aa9d38 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysNeTemporalTemporalPhysicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +AlwaysNeTemporalTemporalPhysicalFunction::AlwaysNeTemporalTemporalPhysicalFunction(PhysicalFunction value1Function, + PhysicalFunction value2Function, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(value1Function)); + parameterFunctions.push_back(std::move(value2Function)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal AlwaysNeTemporalTemporalPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value1 = parameterValues[0].cast>(); + auto value2 = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double v1, double v2, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt1 = fmt::format("{}@{}", v1, ts_str); + std::string wkt2 = fmt::format("{}@{}", v2, ts_str); + Temporal* temp1 = tfloat_in(wkt1.c_str()); + if (!temp1) return 0.0; + Temporal* temp2 = tfloat_in(wkt2.c_str()); + if (!temp2) { free(temp1); return 0.0; } + int r = always_ne_temporal_temporal(temp1, temp2); + free(temp1); + free(temp2); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + value1, value2, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysNeTemporalTemporalPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "AlwaysNeTemporalTemporalPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return AlwaysNeTemporalTemporalPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt index 7cab9483d8..dc9e89ae77 100644 --- a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt @@ -191,4 +191,16 @@ add_plugin(EverEqBoolTbool PhysicalFunction nes-physical-operators EverEqBoolTbo add_plugin(EverNeBoolTbool PhysicalFunction nes-physical-operators EverNeBoolTboolPhysicalFunction.cpp) add_plugin(AlwaysEqBoolTbool PhysicalFunction nes-physical-operators AlwaysEqBoolTboolPhysicalFunction.cpp) add_plugin(AlwaysNeBoolTbool PhysicalFunction nes-physical-operators AlwaysNeBoolTboolPhysicalFunction.cpp) +add_plugin(EverEqTemporalTemporal PhysicalFunction nes-physical-operators EverEqTemporalTemporalPhysicalFunction.cpp) +add_plugin(EverGeTemporalTemporal PhysicalFunction nes-physical-operators EverGeTemporalTemporalPhysicalFunction.cpp) +add_plugin(EverGtTemporalTemporal PhysicalFunction nes-physical-operators EverGtTemporalTemporalPhysicalFunction.cpp) +add_plugin(EverLeTemporalTemporal PhysicalFunction nes-physical-operators EverLeTemporalTemporalPhysicalFunction.cpp) +add_plugin(EverLtTemporalTemporal PhysicalFunction nes-physical-operators EverLtTemporalTemporalPhysicalFunction.cpp) +add_plugin(EverNeTemporalTemporal PhysicalFunction nes-physical-operators EverNeTemporalTemporalPhysicalFunction.cpp) +add_plugin(AlwaysEqTemporalTemporal PhysicalFunction nes-physical-operators AlwaysEqTemporalTemporalPhysicalFunction.cpp) +add_plugin(AlwaysGeTemporalTemporal PhysicalFunction nes-physical-operators AlwaysGeTemporalTemporalPhysicalFunction.cpp) +add_plugin(AlwaysGtTemporalTemporal PhysicalFunction nes-physical-operators AlwaysGtTemporalTemporalPhysicalFunction.cpp) +add_plugin(AlwaysLeTemporalTemporal PhysicalFunction nes-physical-operators AlwaysLeTemporalTemporalPhysicalFunction.cpp) +add_plugin(AlwaysLtTemporalTemporal PhysicalFunction nes-physical-operators AlwaysLtTemporalTemporalPhysicalFunction.cpp) +add_plugin(AlwaysNeTemporalTemporal PhysicalFunction nes-physical-operators AlwaysNeTemporalTemporalPhysicalFunction.cpp) endif() diff --git a/nes-physical-operators/src/Functions/Meos/EverEqTemporalTemporalPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverEqTemporalTemporalPhysicalFunction.cpp new file mode 100644 index 0000000000..4415273e71 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverEqTemporalTemporalPhysicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +EverEqTemporalTemporalPhysicalFunction::EverEqTemporalTemporalPhysicalFunction(PhysicalFunction value1Function, + PhysicalFunction value2Function, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(value1Function)); + parameterFunctions.push_back(std::move(value2Function)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal EverEqTemporalTemporalPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value1 = parameterValues[0].cast>(); + auto value2 = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double v1, double v2, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt1 = fmt::format("{}@{}", v1, ts_str); + std::string wkt2 = fmt::format("{}@{}", v2, ts_str); + Temporal* temp1 = tfloat_in(wkt1.c_str()); + if (!temp1) return 0.0; + Temporal* temp2 = tfloat_in(wkt2.c_str()); + if (!temp2) { free(temp1); return 0.0; } + int r = ever_eq_temporal_temporal(temp1, temp2); + free(temp1); + free(temp2); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + value1, value2, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverEqTemporalTemporalPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "EverEqTemporalTemporalPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return EverEqTemporalTemporalPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverGeTemporalTemporalPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverGeTemporalTemporalPhysicalFunction.cpp new file mode 100644 index 0000000000..7d790039ad --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverGeTemporalTemporalPhysicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +EverGeTemporalTemporalPhysicalFunction::EverGeTemporalTemporalPhysicalFunction(PhysicalFunction value1Function, + PhysicalFunction value2Function, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(value1Function)); + parameterFunctions.push_back(std::move(value2Function)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal EverGeTemporalTemporalPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value1 = parameterValues[0].cast>(); + auto value2 = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double v1, double v2, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt1 = fmt::format("{}@{}", v1, ts_str); + std::string wkt2 = fmt::format("{}@{}", v2, ts_str); + Temporal* temp1 = tfloat_in(wkt1.c_str()); + if (!temp1) return 0.0; + Temporal* temp2 = tfloat_in(wkt2.c_str()); + if (!temp2) { free(temp1); return 0.0; } + int r = ever_ge_temporal_temporal(temp1, temp2); + free(temp1); + free(temp2); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + value1, value2, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverGeTemporalTemporalPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "EverGeTemporalTemporalPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return EverGeTemporalTemporalPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverGtTemporalTemporalPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverGtTemporalTemporalPhysicalFunction.cpp new file mode 100644 index 0000000000..381e050f79 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverGtTemporalTemporalPhysicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +EverGtTemporalTemporalPhysicalFunction::EverGtTemporalTemporalPhysicalFunction(PhysicalFunction value1Function, + PhysicalFunction value2Function, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(value1Function)); + parameterFunctions.push_back(std::move(value2Function)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal EverGtTemporalTemporalPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value1 = parameterValues[0].cast>(); + auto value2 = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double v1, double v2, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt1 = fmt::format("{}@{}", v1, ts_str); + std::string wkt2 = fmt::format("{}@{}", v2, ts_str); + Temporal* temp1 = tfloat_in(wkt1.c_str()); + if (!temp1) return 0.0; + Temporal* temp2 = tfloat_in(wkt2.c_str()); + if (!temp2) { free(temp1); return 0.0; } + int r = ever_gt_temporal_temporal(temp1, temp2); + free(temp1); + free(temp2); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + value1, value2, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverGtTemporalTemporalPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "EverGtTemporalTemporalPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return EverGtTemporalTemporalPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverLeTemporalTemporalPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverLeTemporalTemporalPhysicalFunction.cpp new file mode 100644 index 0000000000..e7e3a8c02b --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverLeTemporalTemporalPhysicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +EverLeTemporalTemporalPhysicalFunction::EverLeTemporalTemporalPhysicalFunction(PhysicalFunction value1Function, + PhysicalFunction value2Function, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(value1Function)); + parameterFunctions.push_back(std::move(value2Function)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal EverLeTemporalTemporalPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value1 = parameterValues[0].cast>(); + auto value2 = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double v1, double v2, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt1 = fmt::format("{}@{}", v1, ts_str); + std::string wkt2 = fmt::format("{}@{}", v2, ts_str); + Temporal* temp1 = tfloat_in(wkt1.c_str()); + if (!temp1) return 0.0; + Temporal* temp2 = tfloat_in(wkt2.c_str()); + if (!temp2) { free(temp1); return 0.0; } + int r = ever_le_temporal_temporal(temp1, temp2); + free(temp1); + free(temp2); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + value1, value2, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverLeTemporalTemporalPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "EverLeTemporalTemporalPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return EverLeTemporalTemporalPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverLtTemporalTemporalPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverLtTemporalTemporalPhysicalFunction.cpp new file mode 100644 index 0000000000..5255e0db4e --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverLtTemporalTemporalPhysicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +EverLtTemporalTemporalPhysicalFunction::EverLtTemporalTemporalPhysicalFunction(PhysicalFunction value1Function, + PhysicalFunction value2Function, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(value1Function)); + parameterFunctions.push_back(std::move(value2Function)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal EverLtTemporalTemporalPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value1 = parameterValues[0].cast>(); + auto value2 = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double v1, double v2, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt1 = fmt::format("{}@{}", v1, ts_str); + std::string wkt2 = fmt::format("{}@{}", v2, ts_str); + Temporal* temp1 = tfloat_in(wkt1.c_str()); + if (!temp1) return 0.0; + Temporal* temp2 = tfloat_in(wkt2.c_str()); + if (!temp2) { free(temp1); return 0.0; } + int r = ever_lt_temporal_temporal(temp1, temp2); + free(temp1); + free(temp2); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + value1, value2, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverLtTemporalTemporalPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "EverLtTemporalTemporalPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return EverLtTemporalTemporalPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverNeTemporalTemporalPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverNeTemporalTemporalPhysicalFunction.cpp new file mode 100644 index 0000000000..4162a14864 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverNeTemporalTemporalPhysicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +EverNeTemporalTemporalPhysicalFunction::EverNeTemporalTemporalPhysicalFunction(PhysicalFunction value1Function, + PhysicalFunction value2Function, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(value1Function)); + parameterFunctions.push_back(std::move(value2Function)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal EverNeTemporalTemporalPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value1 = parameterValues[0].cast>(); + auto value2 = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double v1, double v2, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt1 = fmt::format("{}@{}", v1, ts_str); + std::string wkt2 = fmt::format("{}@{}", v2, ts_str); + Temporal* temp1 = tfloat_in(wkt1.c_str()); + if (!temp1) return 0.0; + Temporal* temp2 = tfloat_in(wkt2.c_str()); + if (!temp2) { free(temp1); return 0.0; } + int r = ever_ne_temporal_temporal(temp1, temp2); + free(temp1); + free(temp2); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + value1, value2, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverNeTemporalTemporalPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "EverNeTemporalTemporalPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return EverNeTemporalTemporalPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-sql-parser/AntlrSQL.g4 b/nes-sql-parser/AntlrSQL.g4 index ca13c40756..c9cf6273f7 100644 --- a/nes-sql-parser/AntlrSQL.g4 +++ b/nes-sql-parser/AntlrSQL.g4 @@ -295,7 +295,7 @@ timeUnit: MS timestampParameter: name=identifier; -functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS; +functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS; sinkClause: INTO sink (',' sink)*; @@ -508,6 +508,12 @@ ALWAYS_LT_TBIGINT_TBIGINT: 'ALWAYS_LT_TBIGINT_TBIGINT' | 'always_lt_tbigint_tbig ALWAYS_NE_TBIGINT_TBIGINT: 'ALWAYS_NE_TBIGINT_TBIGINT' | 'always_ne_tbigint_tbigint'; ALWAYS_EQ_TBOOL_BOOL: 'ALWAYS_EQ_TBOOL_BOOL' | 'always_eq_tbool_bool'; ALWAYS_NE_TBOOL_BOOL: 'ALWAYS_NE_TBOOL_BOOL' | 'always_ne_tbool_bool'; +ALWAYS_EQ_TEMPORAL_TEMPORAL: 'ALWAYS_EQ_TEMPORAL_TEMPORAL' | 'always_eq_temporal_temporal'; +ALWAYS_GE_TEMPORAL_TEMPORAL: 'ALWAYS_GE_TEMPORAL_TEMPORAL' | 'always_ge_temporal_temporal'; +ALWAYS_GT_TEMPORAL_TEMPORAL: 'ALWAYS_GT_TEMPORAL_TEMPORAL' | 'always_gt_temporal_temporal'; +ALWAYS_LE_TEMPORAL_TEMPORAL: 'ALWAYS_LE_TEMPORAL_TEMPORAL' | 'always_le_temporal_temporal'; +ALWAYS_LT_TEMPORAL_TEMPORAL: 'ALWAYS_LT_TEMPORAL_TEMPORAL' | 'always_lt_temporal_temporal'; +ALWAYS_NE_TEMPORAL_TEMPORAL: 'ALWAYS_NE_TEMPORAL_TEMPORAL' | 'always_ne_temporal_temporal'; ALWAYS_EQ_FLOAT_TFLOAT: 'ALWAYS_EQ_FLOAT_TFLOAT' | 'always_eq_float_tfloat'; ALWAYS_GE_FLOAT_TFLOAT: 'ALWAYS_GE_FLOAT_TFLOAT' | 'always_ge_float_tfloat'; ALWAYS_GT_FLOAT_TFLOAT: 'ALWAYS_GT_FLOAT_TFLOAT' | 'always_gt_float_tfloat'; @@ -567,6 +573,12 @@ EVER_LT_TBIGINT_TBIGINT: 'EVER_LT_TBIGINT_TBIGINT' | 'ever_lt_tbigint_tbigint'; EVER_NE_TBIGINT_TBIGINT: 'EVER_NE_TBIGINT_TBIGINT' | 'ever_ne_tbigint_tbigint'; EVER_EQ_TBOOL_BOOL: 'EVER_EQ_TBOOL_BOOL' | 'ever_eq_tbool_bool'; EVER_NE_TBOOL_BOOL: 'EVER_NE_TBOOL_BOOL' | 'ever_ne_tbool_bool'; +EVER_EQ_TEMPORAL_TEMPORAL: 'EVER_EQ_TEMPORAL_TEMPORAL' | 'ever_eq_temporal_temporal'; +EVER_GE_TEMPORAL_TEMPORAL: 'EVER_GE_TEMPORAL_TEMPORAL' | 'ever_ge_temporal_temporal'; +EVER_GT_TEMPORAL_TEMPORAL: 'EVER_GT_TEMPORAL_TEMPORAL' | 'ever_gt_temporal_temporal'; +EVER_LE_TEMPORAL_TEMPORAL: 'EVER_LE_TEMPORAL_TEMPORAL' | 'ever_le_temporal_temporal'; +EVER_LT_TEMPORAL_TEMPORAL: 'EVER_LT_TEMPORAL_TEMPORAL' | 'ever_lt_temporal_temporal'; +EVER_NE_TEMPORAL_TEMPORAL: 'EVER_NE_TEMPORAL_TEMPORAL' | 'ever_ne_temporal_temporal'; EVER_EQ_FLOAT_TFLOAT: 'EVER_EQ_FLOAT_TFLOAT' | 'ever_eq_float_tfloat'; EVER_GE_FLOAT_TFLOAT: 'EVER_GE_FLOAT_TFLOAT' | 'ever_ge_float_tfloat'; EVER_GT_FLOAT_TFLOAT: 'EVER_GT_FLOAT_TFLOAT' | 'ever_gt_float_tfloat'; diff --git a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp index fdf7771230..0efdee3342 100644 --- a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp +++ b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp @@ -243,6 +243,18 @@ #include #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include @@ -3842,6 +3854,180 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont }} break; /* END CODEGEN PARSER GLUE: EVER_NE_TBOOL_BOOL */ + /* BEGIN CODEGEN PARSER GLUE: EVER_EQ_TEMPORAL_TEMPORAL */ + case AntlrSQLLexer::EVER_EQ_TEMPORAL_TEMPORAL: + {{ + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("EVER_EQ_TEMPORAL_TEMPORAL requires exactly 3 arguments, but got {{}}", argCount); + + while (!helpers.top().constantBuilder.empty()) + {{ + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + }} + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverEqTemporalTemporalLogicalFunction(a0, a1, a2)); + }} + break; + /* END CODEGEN PARSER GLUE: EVER_EQ_TEMPORAL_TEMPORAL */ + /* BEGIN CODEGEN PARSER GLUE: EVER_GE_TEMPORAL_TEMPORAL */ + case AntlrSQLLexer::EVER_GE_TEMPORAL_TEMPORAL: + {{ + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("EVER_GE_TEMPORAL_TEMPORAL requires exactly 3 arguments, but got {{}}", argCount); + + while (!helpers.top().constantBuilder.empty()) + {{ + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + }} + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverGeTemporalTemporalLogicalFunction(a0, a1, a2)); + }} + break; + /* END CODEGEN PARSER GLUE: EVER_GE_TEMPORAL_TEMPORAL */ + /* BEGIN CODEGEN PARSER GLUE: EVER_GT_TEMPORAL_TEMPORAL */ + case AntlrSQLLexer::EVER_GT_TEMPORAL_TEMPORAL: + {{ + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("EVER_GT_TEMPORAL_TEMPORAL requires exactly 3 arguments, but got {{}}", argCount); + + while (!helpers.top().constantBuilder.empty()) + {{ + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + }} + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverGtTemporalTemporalLogicalFunction(a0, a1, a2)); + }} + break; + /* END CODEGEN PARSER GLUE: EVER_GT_TEMPORAL_TEMPORAL */ + /* BEGIN CODEGEN PARSER GLUE: EVER_LE_TEMPORAL_TEMPORAL */ + case AntlrSQLLexer::EVER_LE_TEMPORAL_TEMPORAL: + {{ + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("EVER_LE_TEMPORAL_TEMPORAL requires exactly 3 arguments, but got {{}}", argCount); + + while (!helpers.top().constantBuilder.empty()) + {{ + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + }} + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverLeTemporalTemporalLogicalFunction(a0, a1, a2)); + }} + break; + /* END CODEGEN PARSER GLUE: EVER_LE_TEMPORAL_TEMPORAL */ + /* BEGIN CODEGEN PARSER GLUE: EVER_LT_TEMPORAL_TEMPORAL */ + case AntlrSQLLexer::EVER_LT_TEMPORAL_TEMPORAL: + {{ + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("EVER_LT_TEMPORAL_TEMPORAL requires exactly 3 arguments, but got {{}}", argCount); + + while (!helpers.top().constantBuilder.empty()) + {{ + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + }} + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverLtTemporalTemporalLogicalFunction(a0, a1, a2)); + }} + break; + /* END CODEGEN PARSER GLUE: EVER_LT_TEMPORAL_TEMPORAL */ + /* BEGIN CODEGEN PARSER GLUE: EVER_NE_TEMPORAL_TEMPORAL */ + case AntlrSQLLexer::EVER_NE_TEMPORAL_TEMPORAL: + {{ + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("EVER_NE_TEMPORAL_TEMPORAL requires exactly 3 arguments, but got {{}}", argCount); + + while (!helpers.top().constantBuilder.empty()) + {{ + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + }} + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverNeTemporalTemporalLogicalFunction(a0, a1, a2)); + }} + break; + /* END CODEGEN PARSER GLUE: EVER_NE_TEMPORAL_TEMPORAL */ /* BEGIN CODEGEN PARSER GLUE: EVER_EQ_TFLOAT_FLOAT */ case AntlrSQLLexer::EVER_EQ_TFLOAT_FLOAT: { @@ -6046,6 +6232,180 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont }} break; /* END CODEGEN PARSER GLUE: ALWAYS_NE_TBOOL_BOOL */ + /* BEGIN CODEGEN PARSER GLUE: ALWAYS_EQ_TEMPORAL_TEMPORAL */ + case AntlrSQLLexer::ALWAYS_EQ_TEMPORAL_TEMPORAL: + {{ + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("ALWAYS_EQ_TEMPORAL_TEMPORAL requires exactly 3 arguments, but got {{}}", argCount); + + while (!helpers.top().constantBuilder.empty()) + {{ + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + }} + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AlwaysEqTemporalTemporalLogicalFunction(a0, a1, a2)); + }} + break; + /* END CODEGEN PARSER GLUE: ALWAYS_EQ_TEMPORAL_TEMPORAL */ + /* BEGIN CODEGEN PARSER GLUE: ALWAYS_GE_TEMPORAL_TEMPORAL */ + case AntlrSQLLexer::ALWAYS_GE_TEMPORAL_TEMPORAL: + {{ + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("ALWAYS_GE_TEMPORAL_TEMPORAL requires exactly 3 arguments, but got {{}}", argCount); + + while (!helpers.top().constantBuilder.empty()) + {{ + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + }} + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AlwaysGeTemporalTemporalLogicalFunction(a0, a1, a2)); + }} + break; + /* END CODEGEN PARSER GLUE: ALWAYS_GE_TEMPORAL_TEMPORAL */ + /* BEGIN CODEGEN PARSER GLUE: ALWAYS_GT_TEMPORAL_TEMPORAL */ + case AntlrSQLLexer::ALWAYS_GT_TEMPORAL_TEMPORAL: + {{ + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("ALWAYS_GT_TEMPORAL_TEMPORAL requires exactly 3 arguments, but got {{}}", argCount); + + while (!helpers.top().constantBuilder.empty()) + {{ + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + }} + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AlwaysGtTemporalTemporalLogicalFunction(a0, a1, a2)); + }} + break; + /* END CODEGEN PARSER GLUE: ALWAYS_GT_TEMPORAL_TEMPORAL */ + /* BEGIN CODEGEN PARSER GLUE: ALWAYS_LE_TEMPORAL_TEMPORAL */ + case AntlrSQLLexer::ALWAYS_LE_TEMPORAL_TEMPORAL: + {{ + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("ALWAYS_LE_TEMPORAL_TEMPORAL requires exactly 3 arguments, but got {{}}", argCount); + + while (!helpers.top().constantBuilder.empty()) + {{ + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + }} + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AlwaysLeTemporalTemporalLogicalFunction(a0, a1, a2)); + }} + break; + /* END CODEGEN PARSER GLUE: ALWAYS_LE_TEMPORAL_TEMPORAL */ + /* BEGIN CODEGEN PARSER GLUE: ALWAYS_LT_TEMPORAL_TEMPORAL */ + case AntlrSQLLexer::ALWAYS_LT_TEMPORAL_TEMPORAL: + {{ + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("ALWAYS_LT_TEMPORAL_TEMPORAL requires exactly 3 arguments, but got {{}}", argCount); + + while (!helpers.top().constantBuilder.empty()) + {{ + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + }} + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AlwaysLtTemporalTemporalLogicalFunction(a0, a1, a2)); + }} + break; + /* END CODEGEN PARSER GLUE: ALWAYS_LT_TEMPORAL_TEMPORAL */ + /* BEGIN CODEGEN PARSER GLUE: ALWAYS_NE_TEMPORAL_TEMPORAL */ + case AntlrSQLLexer::ALWAYS_NE_TEMPORAL_TEMPORAL: + {{ + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("ALWAYS_NE_TEMPORAL_TEMPORAL requires exactly 3 arguments, but got {{}}", argCount); + + while (!helpers.top().constantBuilder.empty()) + {{ + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + }} + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AlwaysNeTemporalTemporalLogicalFunction(a0, a1, a2)); + }} + break; + /* END CODEGEN PARSER GLUE: ALWAYS_NE_TEMPORAL_TEMPORAL */ /* BEGIN CODEGEN PARSER GLUE: ALWAYS_EQ_TFLOAT_FLOAT */ case AntlrSQLLexer::ALWAYS_EQ_TFLOAT_FLOAT: { From 78f8fc3e9b781140f396b68142ddce3c798e69c0 Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Fri, 12 Jun 2026 10:47:50 +0200 Subject: [PATCH 34/96] feat(meos): add TNOT_TBOOL, TAND_{BOOL_TBOOL,TBOOL_BOOL,TBOOL_TBOOL}, TOR_{BOOL_TBOOL,TBOOL_BOOL,TBOOL_TBOOL} NES operators (W85) --- .../Meos/TandBoolTboolLogicalFunction.hpp | 54 +++++ .../Meos/TandTboolBoolLogicalFunction.hpp | 54 +++++ .../Meos/TandTboolTboolLogicalFunction.hpp | 54 +++++ .../Meos/TnotTboolLogicalFunction.hpp | 53 +++++ .../Meos/TorBoolTboolLogicalFunction.hpp | 54 +++++ .../Meos/TorTboolBoolLogicalFunction.hpp | 54 +++++ .../Meos/TorTboolTboolLogicalFunction.hpp | 54 +++++ .../src/Functions/Meos/CMakeLists.txt | 7 + .../Meos/TandBoolTboolLogicalFunction.cpp | 105 +++++++++ .../Meos/TandTboolBoolLogicalFunction.cpp | 105 +++++++++ .../Meos/TandTboolTboolLogicalFunction.cpp | 105 +++++++++ .../Meos/TnotTboolLogicalFunction.cpp | 102 +++++++++ .../Meos/TorBoolTboolLogicalFunction.cpp | 105 +++++++++ .../Meos/TorTboolBoolLogicalFunction.cpp | 105 +++++++++ .../Meos/TorTboolTboolLogicalFunction.cpp | 105 +++++++++ .../Meos/TandBoolTboolPhysicalFunction.hpp | 43 ++++ .../Meos/TandTboolBoolPhysicalFunction.hpp | 43 ++++ .../Meos/TandTboolTboolPhysicalFunction.hpp | 43 ++++ .../Meos/TnotTboolPhysicalFunction.hpp | 42 ++++ .../Meos/TorBoolTboolPhysicalFunction.hpp | 43 ++++ .../Meos/TorTboolBoolPhysicalFunction.hpp | 43 ++++ .../Meos/TorTboolTboolPhysicalFunction.hpp | 43 ++++ .../src/Functions/Meos/CMakeLists.txt | 7 + .../Meos/TandBoolTboolPhysicalFunction.cpp | 92 ++++++++ .../Meos/TandTboolBoolPhysicalFunction.cpp | 92 ++++++++ .../Meos/TandTboolTboolPhysicalFunction.cpp | 95 ++++++++ .../Meos/TnotTboolPhysicalFunction.cpp | 88 ++++++++ .../Meos/TorBoolTboolPhysicalFunction.cpp | 92 ++++++++ .../Meos/TorTboolBoolPhysicalFunction.cpp | 92 ++++++++ .../Meos/TorTboolTboolPhysicalFunction.cpp | 95 ++++++++ nes-sql-parser/AntlrSQL.g4 | 9 +- .../src/AntlrSQLQueryPlanCreator.cpp | 209 ++++++++++++++++++ 32 files changed, 2286 insertions(+), 1 deletion(-) create mode 100644 nes-logical-operators/include/Functions/Meos/TandBoolTboolLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TandTboolBoolLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TandTboolTboolLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TnotTboolLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TorBoolTboolLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TorTboolBoolLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TorTboolTboolLogicalFunction.hpp create mode 100644 nes-logical-operators/src/Functions/Meos/TandBoolTboolLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TandTboolBoolLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TandTboolTboolLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TnotTboolLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TorBoolTboolLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TorTboolBoolLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TorTboolTboolLogicalFunction.cpp create mode 100644 nes-physical-operators/include/Functions/Meos/TandBoolTboolPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TandTboolBoolPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TandTboolTboolPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TnotTboolPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TorBoolTboolPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TorTboolBoolPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TorTboolTboolPhysicalFunction.hpp create mode 100644 nes-physical-operators/src/Functions/Meos/TandBoolTboolPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TandTboolBoolPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TandTboolTboolPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TnotTboolPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TorBoolTboolPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TorTboolBoolPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TorTboolTboolPhysicalFunction.cpp diff --git a/nes-logical-operators/include/Functions/Meos/TandBoolTboolLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TandBoolTboolLogicalFunction.hpp new file mode 100644 index 0000000000..eae9d72a0c --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TandBoolTboolLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event tand_bool_tbool: AND of a scalar bool and a single-instant tbool. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `tand_bool_tbool`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the operation, and returns FLOAT64 (0.0/1.0). + */ +class TandBoolTboolLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TandBoolTbool"; + + TandBoolTboolLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TandTboolBoolLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TandTboolBoolLogicalFunction.hpp new file mode 100644 index 0000000000..f7e834a10a --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TandTboolBoolLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event tand_tbool_bool: AND of a single-instant tbool and a scalar bool. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `tand_tbool_bool`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the operation, and returns FLOAT64 (0.0/1.0). + */ +class TandTboolBoolLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TandTboolBool"; + + TandTboolBoolLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TandTboolTboolLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TandTboolTboolLogicalFunction.hpp new file mode 100644 index 0000000000..1c5dd6679c --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TandTboolTboolLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event tand_tbool_tbool: AND of two single-instant tbools. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `tand_tbool_tbool`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the operation, and returns FLOAT64 (0.0/1.0). + */ +class TandTboolTboolLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TandTboolTbool"; + + TandTboolTboolLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TnotTboolLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TnotTboolLogicalFunction.hpp new file mode 100644 index 0000000000..a9f99b5e4c --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TnotTboolLogicalFunction.hpp @@ -0,0 +1,53 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event tnot_tbool: single-instant tbool negation, result extracted -> double. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `tnot_tbool`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. + */ +class TnotTboolLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TnotTbool"; + + TnotTboolLogicalFunction(LogicalFunction value, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TorBoolTboolLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TorBoolTboolLogicalFunction.hpp new file mode 100644 index 0000000000..f1c8088610 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TorBoolTboolLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event tor_bool_tbool: OR of a scalar bool and a single-instant tbool. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `tor_bool_tbool`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the operation, and returns FLOAT64 (0.0/1.0). + */ +class TorBoolTboolLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TorBoolTbool"; + + TorBoolTboolLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TorTboolBoolLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TorTboolBoolLogicalFunction.hpp new file mode 100644 index 0000000000..423e040e7e --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TorTboolBoolLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event tor_tbool_bool: OR of a single-instant tbool and a scalar bool. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `tor_tbool_bool`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the operation, and returns FLOAT64 (0.0/1.0). + */ +class TorTboolBoolLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TorTboolBool"; + + TorTboolBoolLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TorTboolTboolLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TorTboolTboolLogicalFunction.hpp new file mode 100644 index 0000000000..113d6fee9a --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TorTboolTboolLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event tor_tbool_tbool: OR of two single-instant tbools. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `tor_tbool_tbool`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the operation, and returns FLOAT64 (0.0/1.0). + */ +class TorTboolTboolLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TorTboolTbool"; + + TorTboolTboolLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt index f14f18a37c..4f6015011d 100644 --- a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt @@ -204,3 +204,10 @@ add_plugin(AlwaysGtTemporalTemporal LogicalFunction nes-logical-operators Always add_plugin(AlwaysLeTemporalTemporal LogicalFunction nes-logical-operators AlwaysLeTemporalTemporalLogicalFunction.cpp) add_plugin(AlwaysLtTemporalTemporal LogicalFunction nes-logical-operators AlwaysLtTemporalTemporalLogicalFunction.cpp) add_plugin(AlwaysNeTemporalTemporal LogicalFunction nes-logical-operators AlwaysNeTemporalTemporalLogicalFunction.cpp) +add_plugin(TandBoolTbool LogicalFunction nes-logical-operators TandBoolTboolLogicalFunction.cpp) +add_plugin(TandTboolBool LogicalFunction nes-logical-operators TandTboolBoolLogicalFunction.cpp) +add_plugin(TandTboolTbool LogicalFunction nes-logical-operators TandTboolTboolLogicalFunction.cpp) +add_plugin(TnotTbool LogicalFunction nes-logical-operators TnotTboolLogicalFunction.cpp) +add_plugin(TorBoolTbool LogicalFunction nes-logical-operators TorBoolTboolLogicalFunction.cpp) +add_plugin(TorTboolBool LogicalFunction nes-logical-operators TorTboolBoolLogicalFunction.cpp) +add_plugin(TorTboolTbool LogicalFunction nes-logical-operators TorTboolTboolLogicalFunction.cpp) diff --git a/nes-logical-operators/src/Functions/Meos/TandBoolTboolLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TandBoolTboolLogicalFunction.cpp new file mode 100644 index 0000000000..fc0338db82 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TandBoolTboolLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TandBoolTboolLogicalFunction::TandBoolTboolLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType TandBoolTboolLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction TandBoolTboolLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector TandBoolTboolLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction TandBoolTboolLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "TandBoolTboolLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view TandBoolTboolLogicalFunction::getType() const { return NAME; } + +bool TandBoolTboolLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string TandBoolTboolLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TandBoolTboolLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction TandBoolTboolLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTandBoolTboolLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "TandBoolTboolLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return TandBoolTboolLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TandTboolBoolLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TandTboolBoolLogicalFunction.cpp new file mode 100644 index 0000000000..5e7300f734 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TandTboolBoolLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TandTboolBoolLogicalFunction::TandTboolBoolLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType TandTboolBoolLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction TandTboolBoolLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector TandTboolBoolLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction TandTboolBoolLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "TandTboolBoolLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view TandTboolBoolLogicalFunction::getType() const { return NAME; } + +bool TandTboolBoolLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string TandTboolBoolLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TandTboolBoolLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction TandTboolBoolLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTandTboolBoolLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "TandTboolBoolLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return TandTboolBoolLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TandTboolTboolLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TandTboolTboolLogicalFunction.cpp new file mode 100644 index 0000000000..c8023935d5 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TandTboolTboolLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TandTboolTboolLogicalFunction::TandTboolTboolLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType TandTboolTboolLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction TandTboolTboolLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector TandTboolTboolLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction TandTboolTboolLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "TandTboolTboolLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view TandTboolTboolLogicalFunction::getType() const { return NAME; } + +bool TandTboolTboolLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string TandTboolTboolLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TandTboolTboolLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction TandTboolTboolLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTandTboolTboolLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "TandTboolTboolLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return TandTboolTboolLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TnotTboolLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TnotTboolLogicalFunction.cpp new file mode 100644 index 0000000000..91f7eb92e1 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TnotTboolLogicalFunction.cpp @@ -0,0 +1,102 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TnotTboolLogicalFunction::TnotTboolLogicalFunction(LogicalFunction value, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(2); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(ts)); +} + +DataType TnotTboolLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction TnotTboolLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector TnotTboolLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction TnotTboolLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 2, "TnotTboolLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view TnotTboolLogicalFunction::getType() const { return NAME; } + +bool TnotTboolLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string TnotTboolLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TnotTboolLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction TnotTboolLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTnotTboolLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 2, + "TnotTboolLogicalFunction requires 2 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + return TnotTboolLogicalFunction(std::move(arg0), std::move(arg1)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TorBoolTboolLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TorBoolTboolLogicalFunction.cpp new file mode 100644 index 0000000000..33d0326e8f --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TorBoolTboolLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TorBoolTboolLogicalFunction::TorBoolTboolLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType TorBoolTboolLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction TorBoolTboolLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector TorBoolTboolLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction TorBoolTboolLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "TorBoolTboolLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view TorBoolTboolLogicalFunction::getType() const { return NAME; } + +bool TorBoolTboolLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string TorBoolTboolLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TorBoolTboolLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction TorBoolTboolLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTorBoolTboolLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "TorBoolTboolLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return TorBoolTboolLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TorTboolBoolLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TorTboolBoolLogicalFunction.cpp new file mode 100644 index 0000000000..f185e26c88 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TorTboolBoolLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TorTboolBoolLogicalFunction::TorTboolBoolLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType TorTboolBoolLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction TorTboolBoolLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector TorTboolBoolLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction TorTboolBoolLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "TorTboolBoolLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view TorTboolBoolLogicalFunction::getType() const { return NAME; } + +bool TorTboolBoolLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string TorTboolBoolLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TorTboolBoolLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction TorTboolBoolLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTorTboolBoolLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "TorTboolBoolLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return TorTboolBoolLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TorTboolTboolLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TorTboolTboolLogicalFunction.cpp new file mode 100644 index 0000000000..32f064daed --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TorTboolTboolLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TorTboolTboolLogicalFunction::TorTboolTboolLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType TorTboolTboolLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction TorTboolTboolLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector TorTboolTboolLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction TorTboolTboolLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "TorTboolTboolLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view TorTboolTboolLogicalFunction::getType() const { return NAME; } + +bool TorTboolTboolLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string TorTboolTboolLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TorTboolTboolLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction TorTboolTboolLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTorTboolTboolLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "TorTboolTboolLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return TorTboolTboolLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TandBoolTboolPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TandBoolTboolPhysicalFunction.hpp new file mode 100644 index 0000000000..541123f801 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TandBoolTboolPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `tand_bool_tbool`. + * + * Per-event tand_bool_tbool: AND of a scalar bool and a single-instant tbool. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TandBoolTboolPhysicalFunction : public PhysicalFunctionConcept { +public: + TandBoolTboolPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TandTboolBoolPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TandTboolBoolPhysicalFunction.hpp new file mode 100644 index 0000000000..e7227db724 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TandTboolBoolPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `tand_tbool_bool`. + * + * Per-event tand_tbool_bool: AND of a single-instant tbool and a scalar bool. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TandTboolBoolPhysicalFunction : public PhysicalFunctionConcept { +public: + TandTboolBoolPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TandTboolTboolPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TandTboolTboolPhysicalFunction.hpp new file mode 100644 index 0000000000..cdbb608e49 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TandTboolTboolPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `tand_tbool_tbool`. + * + * Per-event tand_tbool_tbool: AND of two single-instant tbools. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TandTboolTboolPhysicalFunction : public PhysicalFunctionConcept { +public: + TandTboolTboolPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TnotTboolPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TnotTboolPhysicalFunction.hpp new file mode 100644 index 0000000000..6ef701368a --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TnotTboolPhysicalFunction.hpp @@ -0,0 +1,42 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `tnot_tbool`. + * + * Per-event tnot_tbool: single-instant tbool negation, result extracted -> double. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TnotTboolPhysicalFunction : public PhysicalFunctionConcept { +public: + TnotTboolPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TorBoolTboolPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TorBoolTboolPhysicalFunction.hpp new file mode 100644 index 0000000000..6f01525fca --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TorBoolTboolPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `tor_bool_tbool`. + * + * Per-event tor_bool_tbool: OR of a scalar bool and a single-instant tbool. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TorBoolTboolPhysicalFunction : public PhysicalFunctionConcept { +public: + TorBoolTboolPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TorTboolBoolPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TorTboolBoolPhysicalFunction.hpp new file mode 100644 index 0000000000..cc438a08e5 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TorTboolBoolPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `tor_tbool_bool`. + * + * Per-event tor_tbool_bool: OR of a single-instant tbool and a scalar bool. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TorTboolBoolPhysicalFunction : public PhysicalFunctionConcept { +public: + TorTboolBoolPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TorTboolTboolPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TorTboolTboolPhysicalFunction.hpp new file mode 100644 index 0000000000..e7334cdad2 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TorTboolTboolPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `tor_tbool_tbool`. + * + * Per-event tor_tbool_tbool: OR of two single-instant tbools. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TorTboolTboolPhysicalFunction : public PhysicalFunctionConcept { +public: + TorTboolTboolPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt index dc9e89ae77..be8913afa6 100644 --- a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt @@ -203,4 +203,11 @@ add_plugin(AlwaysGtTemporalTemporal PhysicalFunction nes-physical-operators Alwa add_plugin(AlwaysLeTemporalTemporal PhysicalFunction nes-physical-operators AlwaysLeTemporalTemporalPhysicalFunction.cpp) add_plugin(AlwaysLtTemporalTemporal PhysicalFunction nes-physical-operators AlwaysLtTemporalTemporalPhysicalFunction.cpp) add_plugin(AlwaysNeTemporalTemporal PhysicalFunction nes-physical-operators AlwaysNeTemporalTemporalPhysicalFunction.cpp) +add_plugin(TandBoolTbool PhysicalFunction nes-physical-operators TandBoolTboolPhysicalFunction.cpp) +add_plugin(TandTboolBool PhysicalFunction nes-physical-operators TandTboolBoolPhysicalFunction.cpp) +add_plugin(TandTboolTbool PhysicalFunction nes-physical-operators TandTboolTboolPhysicalFunction.cpp) +add_plugin(TnotTbool PhysicalFunction nes-physical-operators TnotTboolPhysicalFunction.cpp) +add_plugin(TorBoolTbool PhysicalFunction nes-physical-operators TorBoolTboolPhysicalFunction.cpp) +add_plugin(TorTboolBool PhysicalFunction nes-physical-operators TorTboolBoolPhysicalFunction.cpp) +add_plugin(TorTboolTbool PhysicalFunction nes-physical-operators TorTboolTboolPhysicalFunction.cpp) endif() diff --git a/nes-physical-operators/src/Functions/Meos/TandBoolTboolPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TandBoolTboolPhysicalFunction.cpp new file mode 100644 index 0000000000..16f0f24724 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TandBoolTboolPhysicalFunction.cpp @@ -0,0 +1,92 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +TandBoolTboolPhysicalFunction::TandBoolTboolPhysicalFunction(PhysicalFunction scalarFunction, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(scalarFunction)); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal TandBoolTboolPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto scalar = parameterValues[0].cast>(); + auto value = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double b, double v, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = fmt::format("{}@{}", (v != 0.0 ? "t" : "f"), ts_str); + Temporal* temp = tbool_in(wkt.c_str()); + if (!temp) return 0.0; + Temporal* res = tand_bool_tbool(static_cast(b != 0.0), temp); + free(temp); + if (!res) return 0.0; + bool r = tbool_start_value(res); + free(res); + return static_cast(r ? 1.0 : 0.0); + } catch (const std::exception&) { return 0.0; } + }, + scalar, value, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTandBoolTboolPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "TandBoolTboolPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return TandBoolTboolPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TandTboolBoolPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TandTboolBoolPhysicalFunction.cpp new file mode 100644 index 0000000000..ef430d4016 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TandTboolBoolPhysicalFunction.cpp @@ -0,0 +1,92 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +TandTboolBoolPhysicalFunction::TandTboolBoolPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction scalarFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(scalarFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal TandTboolBoolPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto scalar = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double v, double s, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = fmt::format("{}@{}", (v != 0.0 ? "t" : "f"), ts_str); + Temporal* temp = tbool_in(wkt.c_str()); + if (!temp) return 0.0; + Temporal* res = tand_tbool_bool(temp, static_cast(s != 0.0)); + free(temp); + if (!res) return 0.0; + bool r = tbool_start_value(res); + free(res); + return static_cast(r ? 1.0 : 0.0); + } catch (const std::exception&) { return 0.0; } + }, + value, scalar, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTandTboolBoolPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "TandTboolBoolPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return TandTboolBoolPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TandTboolTboolPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TandTboolTboolPhysicalFunction.cpp new file mode 100644 index 0000000000..ec1c4beb98 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TandTboolTboolPhysicalFunction.cpp @@ -0,0 +1,95 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +TandTboolTboolPhysicalFunction::TandTboolTboolPhysicalFunction(PhysicalFunction value1Function, + PhysicalFunction value2Function, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(value1Function)); + parameterFunctions.push_back(std::move(value2Function)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal TandTboolTboolPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value1 = parameterValues[0].cast>(); + auto value2 = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double v1, double v2, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt1 = fmt::format("{}@{}", (v1 != 0.0 ? "t" : "f"), ts_str); + std::string wkt2 = fmt::format("{}@{}", (v2 != 0.0 ? "t" : "f"), ts_str); + Temporal* temp1 = tbool_in(wkt1.c_str()); + if (!temp1) return 0.0; + Temporal* temp2 = tbool_in(wkt2.c_str()); + if (!temp2) { free(temp1); return 0.0; } + Temporal* res = tand_tbool_tbool(temp1, temp2); + free(temp1); free(temp2); + if (!res) return 0.0; + bool r = tbool_start_value(res); + free(res); + return static_cast(r ? 1.0 : 0.0); + } catch (const std::exception&) { return 0.0; } + }, + value1, value2, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTandTboolTboolPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "TandTboolTboolPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return TandTboolTboolPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TnotTboolPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TnotTboolPhysicalFunction.cpp new file mode 100644 index 0000000000..10c86464d8 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TnotTboolPhysicalFunction.cpp @@ -0,0 +1,88 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +TnotTboolPhysicalFunction::TnotTboolPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(2); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal TnotTboolPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto ts = parameterValues[1].cast>(); + + const auto result = nautilus::invoke( + +[](double v, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = fmt::format("{}@{}", (v != 0.0 ? "t" : "f"), ts_str); + Temporal* temp = tbool_in(wkt.c_str()); + if (!temp) return 0.0; + Temporal* res = tnot_tbool(temp); + free(temp); + if (!res) return 0.0; + bool r = tbool_start_value(res); + free(res); + return static_cast(r ? 1.0 : 0.0); + } catch (const std::exception&) { return 0.0; } + }, + value, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTnotTboolPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 2, + "TnotTboolPhysicalFunction requires 2 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + return TnotTboolPhysicalFunction(std::move(arg0), std::move(arg1)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TorBoolTboolPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TorBoolTboolPhysicalFunction.cpp new file mode 100644 index 0000000000..dbf186f3ff --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TorBoolTboolPhysicalFunction.cpp @@ -0,0 +1,92 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +TorBoolTboolPhysicalFunction::TorBoolTboolPhysicalFunction(PhysicalFunction scalarFunction, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(scalarFunction)); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal TorBoolTboolPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto scalar = parameterValues[0].cast>(); + auto value = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double b, double v, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = fmt::format("{}@{}", (v != 0.0 ? "t" : "f"), ts_str); + Temporal* temp = tbool_in(wkt.c_str()); + if (!temp) return 0.0; + Temporal* res = tor_bool_tbool(static_cast(b != 0.0), temp); + free(temp); + if (!res) return 0.0; + bool r = tbool_start_value(res); + free(res); + return static_cast(r ? 1.0 : 0.0); + } catch (const std::exception&) { return 0.0; } + }, + scalar, value, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTorBoolTboolPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "TorBoolTboolPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return TorBoolTboolPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TorTboolBoolPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TorTboolBoolPhysicalFunction.cpp new file mode 100644 index 0000000000..a39f01e2c7 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TorTboolBoolPhysicalFunction.cpp @@ -0,0 +1,92 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +TorTboolBoolPhysicalFunction::TorTboolBoolPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction scalarFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(scalarFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal TorTboolBoolPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto scalar = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double v, double s, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = fmt::format("{}@{}", (v != 0.0 ? "t" : "f"), ts_str); + Temporal* temp = tbool_in(wkt.c_str()); + if (!temp) return 0.0; + Temporal* res = tor_tbool_bool(temp, static_cast(s != 0.0)); + free(temp); + if (!res) return 0.0; + bool r = tbool_start_value(res); + free(res); + return static_cast(r ? 1.0 : 0.0); + } catch (const std::exception&) { return 0.0; } + }, + value, scalar, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTorTboolBoolPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "TorTboolBoolPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return TorTboolBoolPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TorTboolTboolPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TorTboolTboolPhysicalFunction.cpp new file mode 100644 index 0000000000..a27e8f674a --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TorTboolTboolPhysicalFunction.cpp @@ -0,0 +1,95 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +TorTboolTboolPhysicalFunction::TorTboolTboolPhysicalFunction(PhysicalFunction value1Function, + PhysicalFunction value2Function, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(value1Function)); + parameterFunctions.push_back(std::move(value2Function)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal TorTboolTboolPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value1 = parameterValues[0].cast>(); + auto value2 = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double v1, double v2, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt1 = fmt::format("{}@{}", (v1 != 0.0 ? "t" : "f"), ts_str); + std::string wkt2 = fmt::format("{}@{}", (v2 != 0.0 ? "t" : "f"), ts_str); + Temporal* temp1 = tbool_in(wkt1.c_str()); + if (!temp1) return 0.0; + Temporal* temp2 = tbool_in(wkt2.c_str()); + if (!temp2) { free(temp1); return 0.0; } + Temporal* res = tor_tbool_tbool(temp1, temp2); + free(temp1); free(temp2); + if (!res) return 0.0; + bool r = tbool_start_value(res); + free(res); + return static_cast(r ? 1.0 : 0.0); + } catch (const std::exception&) { return 0.0; } + }, + value1, value2, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTorTboolTboolPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "TorTboolTboolPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return TorTboolTboolPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-sql-parser/AntlrSQL.g4 b/nes-sql-parser/AntlrSQL.g4 index c9cf6273f7..8352c429ae 100644 --- a/nes-sql-parser/AntlrSQL.g4 +++ b/nes-sql-parser/AntlrSQL.g4 @@ -295,7 +295,7 @@ timeUnit: MS timestampParameter: name=identifier; -functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS; +functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL; sinkClause: INTO sink (',' sink)*; @@ -674,6 +674,13 @@ TINT_SHIFT_VALUE: 'TINT_SHIFT_VALUE' | 'tint_shift_value'; TINT_TO_TBIGINT: 'TINT_TO_TBIGINT' | 'tint_to_tbigint'; TINT_TO_TFLOAT: 'TINT_TO_TFLOAT' | 'tint_to_tfloat'; TNUMBER_ABS: 'TNUMBER_ABS' | 'tnumber_abs'; +TAND_BOOL_TBOOL: 'TAND_BOOL_TBOOL' | 'tand_bool_tbool'; +TAND_TBOOL_BOOL: 'TAND_TBOOL_BOOL' | 'tand_tbool_bool'; +TAND_TBOOL_TBOOL: 'TAND_TBOOL_TBOOL' | 'tand_tbool_tbool'; +TNOT_TBOOL: 'TNOT_TBOOL' | 'tnot_tbool'; +TOR_BOOL_TBOOL: 'TOR_BOOL_TBOOL' | 'tor_bool_tbool'; +TOR_TBOOL_BOOL: 'TOR_TBOOL_BOOL' | 'tor_tbool_bool'; +TOR_TBOOL_TBOOL: 'TOR_TBOOL_TBOOL' | 'tor_tbool_tbool'; WATERMARK: 'WATERMARK' | 'watermark'; OFFSET: 'OFFSET' | 'offset'; LOCALHOST: 'LOCALHOST' | 'localhost'; diff --git a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp index 0efdee3342..a16639422d 100644 --- a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp +++ b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp @@ -255,6 +255,13 @@ #include #include #include +#include +#include +#include +#include +#include +#include +#include #include #include #include @@ -6406,6 +6413,208 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont }} break; /* END CODEGEN PARSER GLUE: ALWAYS_NE_TEMPORAL_TEMPORAL */ + /* BEGIN CODEGEN PARSER GLUE: TNOT_TBOOL */ + case AntlrSQLLexer::TNOT_TBOOL: + { + const auto argCount = context->expression().size(); + if (argCount != 2) + throw InvalidQuerySyntax("TNOT_TBOOL requires exactly 2 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(TnotTboolLogicalFunction(a0, a1)); + } + break; + /* END CODEGEN PARSER GLUE: TNOT_TBOOL */ + /* BEGIN CODEGEN PARSER GLUE: TAND_BOOL_TBOOL */ + case AntlrSQLLexer::TAND_BOOL_TBOOL: + {{ + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("TAND_BOOL_TBOOL requires exactly 3 arguments, but got {{}}", argCount); + + while (!helpers.top().constantBuilder.empty()) + {{ + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + }} + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(TandBoolTboolLogicalFunction(a0, a1, a2)); + }} + break; + /* END CODEGEN PARSER GLUE: TAND_BOOL_TBOOL */ + /* BEGIN CODEGEN PARSER GLUE: TAND_TBOOL_BOOL */ + case AntlrSQLLexer::TAND_TBOOL_BOOL: + {{ + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("TAND_TBOOL_BOOL requires exactly 3 arguments, but got {{}}", argCount); + + while (!helpers.top().constantBuilder.empty()) + {{ + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + }} + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(TandTboolBoolLogicalFunction(a0, a1, a2)); + }} + break; + /* END CODEGEN PARSER GLUE: TAND_TBOOL_BOOL */ + /* BEGIN CODEGEN PARSER GLUE: TAND_TBOOL_TBOOL */ + case AntlrSQLLexer::TAND_TBOOL_TBOOL: + {{ + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("TAND_TBOOL_TBOOL requires exactly 3 arguments, but got {{}}", argCount); + + while (!helpers.top().constantBuilder.empty()) + {{ + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + }} + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(TandTboolTboolLogicalFunction(a0, a1, a2)); + }} + break; + /* END CODEGEN PARSER GLUE: TAND_TBOOL_TBOOL */ + /* BEGIN CODEGEN PARSER GLUE: TOR_BOOL_TBOOL */ + case AntlrSQLLexer::TOR_BOOL_TBOOL: + {{ + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("TOR_BOOL_TBOOL requires exactly 3 arguments, but got {{}}", argCount); + + while (!helpers.top().constantBuilder.empty()) + {{ + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + }} + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(TorBoolTboolLogicalFunction(a0, a1, a2)); + }} + break; + /* END CODEGEN PARSER GLUE: TOR_BOOL_TBOOL */ + /* BEGIN CODEGEN PARSER GLUE: TOR_TBOOL_BOOL */ + case AntlrSQLLexer::TOR_TBOOL_BOOL: + {{ + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("TOR_TBOOL_BOOL requires exactly 3 arguments, but got {{}}", argCount); + + while (!helpers.top().constantBuilder.empty()) + {{ + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + }} + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(TorTboolBoolLogicalFunction(a0, a1, a2)); + }} + break; + /* END CODEGEN PARSER GLUE: TOR_TBOOL_BOOL */ + /* BEGIN CODEGEN PARSER GLUE: TOR_TBOOL_TBOOL */ + case AntlrSQLLexer::TOR_TBOOL_TBOOL: + {{ + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("TOR_TBOOL_TBOOL requires exactly 3 arguments, but got {{}}", argCount); + + while (!helpers.top().constantBuilder.empty()) + {{ + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + }} + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(TorTboolTboolLogicalFunction(a0, a1, a2)); + }} + break; + /* END CODEGEN PARSER GLUE: TOR_TBOOL_TBOOL */ /* BEGIN CODEGEN PARSER GLUE: ALWAYS_EQ_TFLOAT_FLOAT */ case AntlrSQLLexer::ALWAYS_EQ_TFLOAT_FLOAT: { From e2baef1f5d49a86c00d1cdf9aa1b87fd62acee18 Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Fri, 12 Jun 2026 10:52:38 +0200 Subject: [PATCH 35/96] feat(meos): add TEQ_{BOOL_TBOOL,TBOOL_BOOL,FLOAT_TFLOAT,TFLOAT_FLOAT,INT_TINT,TINT_INT,TEMPORAL_TEMPORAL} NES operators (W86) --- .../Meos/TeqBoolTboolLogicalFunction.hpp | 54 +++++ .../Meos/TeqFloatTfloatLogicalFunction.hpp | 54 +++++ .../Meos/TeqIntTintLogicalFunction.hpp | 54 +++++ .../Meos/TeqTboolBoolLogicalFunction.hpp | 54 +++++ .../TeqTemporalTemporalLogicalFunction.hpp | 54 +++++ .../Meos/TeqTfloatFloatLogicalFunction.hpp | 54 +++++ .../Meos/TeqTintIntLogicalFunction.hpp | 54 +++++ .../src/Functions/Meos/CMakeLists.txt | 7 + .../Meos/TeqBoolTboolLogicalFunction.cpp | 105 +++++++++ .../Meos/TeqFloatTfloatLogicalFunction.cpp | 105 +++++++++ .../Meos/TeqIntTintLogicalFunction.cpp | 105 +++++++++ .../Meos/TeqTboolBoolLogicalFunction.cpp | 105 +++++++++ .../TeqTemporalTemporalLogicalFunction.cpp | 105 +++++++++ .../Meos/TeqTfloatFloatLogicalFunction.cpp | 105 +++++++++ .../Meos/TeqTintIntLogicalFunction.cpp | 105 +++++++++ .../Meos/TeqBoolTboolPhysicalFunction.hpp | 43 ++++ .../Meos/TeqFloatTfloatPhysicalFunction.hpp | 43 ++++ .../Meos/TeqIntTintPhysicalFunction.hpp | 43 ++++ .../Meos/TeqTboolBoolPhysicalFunction.hpp | 43 ++++ .../TeqTemporalTemporalPhysicalFunction.hpp | 43 ++++ .../Meos/TeqTfloatFloatPhysicalFunction.hpp | 43 ++++ .../Meos/TeqTintIntPhysicalFunction.hpp | 43 ++++ .../src/Functions/Meos/CMakeLists.txt | 7 + .../Meos/TeqBoolTboolPhysicalFunction.cpp | 93 ++++++++ .../Meos/TeqFloatTfloatPhysicalFunction.cpp | 92 ++++++++ .../Meos/TeqIntTintPhysicalFunction.cpp | 93 ++++++++ .../Meos/TeqTboolBoolPhysicalFunction.cpp | 93 ++++++++ .../TeqTemporalTemporalPhysicalFunction.cpp | 95 ++++++++ .../Meos/TeqTfloatFloatPhysicalFunction.cpp | 92 ++++++++ .../Meos/TeqTintIntPhysicalFunction.cpp | 93 ++++++++ nes-sql-parser/AntlrSQL.g4 | 9 +- .../src/AntlrSQLQueryPlanCreator.cpp | 210 ++++++++++++++++++ 32 files changed, 2297 insertions(+), 1 deletion(-) create mode 100644 nes-logical-operators/include/Functions/Meos/TeqBoolTboolLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TeqFloatTfloatLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TeqIntTintLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TeqTboolBoolLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TeqTemporalTemporalLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TeqTfloatFloatLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TeqTintIntLogicalFunction.hpp create mode 100644 nes-logical-operators/src/Functions/Meos/TeqBoolTboolLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TeqFloatTfloatLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TeqIntTintLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TeqTboolBoolLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TeqTemporalTemporalLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TeqTfloatFloatLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TeqTintIntLogicalFunction.cpp create mode 100644 nes-physical-operators/include/Functions/Meos/TeqBoolTboolPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TeqFloatTfloatPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TeqIntTintPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TeqTboolBoolPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TeqTemporalTemporalPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TeqTfloatFloatPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TeqTintIntPhysicalFunction.hpp create mode 100644 nes-physical-operators/src/Functions/Meos/TeqBoolTboolPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TeqFloatTfloatPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TeqIntTintPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TeqTboolBoolPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TeqTemporalTemporalPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TeqTfloatFloatPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TeqTintIntPhysicalFunction.cpp diff --git a/nes-logical-operators/include/Functions/Meos/TeqBoolTboolLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TeqBoolTboolLogicalFunction.hpp new file mode 100644 index 0000000000..883d67de55 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TeqBoolTboolLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief temporal EQ: scalar bool vs single-instant tbool + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `teq_bool_tbool`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class TeqBoolTboolLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TeqBoolTbool"; + + TeqBoolTboolLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TeqFloatTfloatLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TeqFloatTfloatLogicalFunction.hpp new file mode 100644 index 0000000000..c6112cca24 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TeqFloatTfloatLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief temporal EQ: scalar float vs single-instant tfloat + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `teq_float_tfloat`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class TeqFloatTfloatLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TeqFloatTfloat"; + + TeqFloatTfloatLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TeqIntTintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TeqIntTintLogicalFunction.hpp new file mode 100644 index 0000000000..345185f526 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TeqIntTintLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief temporal EQ: scalar int vs single-instant tint + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `teq_int_tint`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class TeqIntTintLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TeqIntTint"; + + TeqIntTintLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TeqTboolBoolLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TeqTboolBoolLogicalFunction.hpp new file mode 100644 index 0000000000..af9a60f4df --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TeqTboolBoolLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief temporal EQ: single-instant tbool vs scalar bool + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `teq_tbool_bool`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class TeqTboolBoolLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TeqTboolBool"; + + TeqTboolBoolLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TeqTemporalTemporalLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TeqTemporalTemporalLogicalFunction.hpp new file mode 100644 index 0000000000..d1e518268a --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TeqTemporalTemporalLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief temporal EQ: two single-instant tfloats + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `teq_temporal_temporal`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class TeqTemporalTemporalLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TeqTemporalTemporal"; + + TeqTemporalTemporalLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TeqTfloatFloatLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TeqTfloatFloatLogicalFunction.hpp new file mode 100644 index 0000000000..6716163be2 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TeqTfloatFloatLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief temporal EQ: single-instant tfloat vs scalar float + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `teq_tfloat_float`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class TeqTfloatFloatLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TeqTfloatFloat"; + + TeqTfloatFloatLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TeqTintIntLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TeqTintIntLogicalFunction.hpp new file mode 100644 index 0000000000..584f3b5784 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TeqTintIntLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief temporal EQ: single-instant tint vs scalar int + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `teq_tint_int`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class TeqTintIntLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TeqTintInt"; + + TeqTintIntLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt index 4f6015011d..9a3d850eea 100644 --- a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt @@ -211,3 +211,10 @@ add_plugin(TnotTbool LogicalFunction nes-logical-operators TnotTboolLogicalFunct add_plugin(TorBoolTbool LogicalFunction nes-logical-operators TorBoolTboolLogicalFunction.cpp) add_plugin(TorTboolBool LogicalFunction nes-logical-operators TorTboolBoolLogicalFunction.cpp) add_plugin(TorTboolTbool LogicalFunction nes-logical-operators TorTboolTboolLogicalFunction.cpp) +add_plugin(TeqBoolTbool LogicalFunction nes-logical-operators TeqBoolTboolLogicalFunction.cpp) +add_plugin(TeqFloatTfloat LogicalFunction nes-logical-operators TeqFloatTfloatLogicalFunction.cpp) +add_plugin(TeqIntTint LogicalFunction nes-logical-operators TeqIntTintLogicalFunction.cpp) +add_plugin(TeqTboolBool LogicalFunction nes-logical-operators TeqTboolBoolLogicalFunction.cpp) +add_plugin(TeqTemporalTemporal LogicalFunction nes-logical-operators TeqTemporalTemporalLogicalFunction.cpp) +add_plugin(TeqTfloatFloat LogicalFunction nes-logical-operators TeqTfloatFloatLogicalFunction.cpp) +add_plugin(TeqTintInt LogicalFunction nes-logical-operators TeqTintIntLogicalFunction.cpp) diff --git a/nes-logical-operators/src/Functions/Meos/TeqBoolTboolLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TeqBoolTboolLogicalFunction.cpp new file mode 100644 index 0000000000..96ca3ab52f --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TeqBoolTboolLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TeqBoolTboolLogicalFunction::TeqBoolTboolLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType TeqBoolTboolLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction TeqBoolTboolLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector TeqBoolTboolLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction TeqBoolTboolLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "TeqBoolTboolLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view TeqBoolTboolLogicalFunction::getType() const { return NAME; } + +bool TeqBoolTboolLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string TeqBoolTboolLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TeqBoolTboolLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction TeqBoolTboolLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTeqBoolTboolLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "TeqBoolTboolLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return TeqBoolTboolLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TeqFloatTfloatLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TeqFloatTfloatLogicalFunction.cpp new file mode 100644 index 0000000000..146580ca03 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TeqFloatTfloatLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TeqFloatTfloatLogicalFunction::TeqFloatTfloatLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType TeqFloatTfloatLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction TeqFloatTfloatLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector TeqFloatTfloatLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction TeqFloatTfloatLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "TeqFloatTfloatLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view TeqFloatTfloatLogicalFunction::getType() const { return NAME; } + +bool TeqFloatTfloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string TeqFloatTfloatLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TeqFloatTfloatLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction TeqFloatTfloatLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTeqFloatTfloatLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "TeqFloatTfloatLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return TeqFloatTfloatLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TeqIntTintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TeqIntTintLogicalFunction.cpp new file mode 100644 index 0000000000..2dff635453 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TeqIntTintLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TeqIntTintLogicalFunction::TeqIntTintLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType TeqIntTintLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction TeqIntTintLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector TeqIntTintLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction TeqIntTintLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "TeqIntTintLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view TeqIntTintLogicalFunction::getType() const { return NAME; } + +bool TeqIntTintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string TeqIntTintLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TeqIntTintLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction TeqIntTintLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTeqIntTintLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "TeqIntTintLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return TeqIntTintLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TeqTboolBoolLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TeqTboolBoolLogicalFunction.cpp new file mode 100644 index 0000000000..f0fb48a313 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TeqTboolBoolLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TeqTboolBoolLogicalFunction::TeqTboolBoolLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType TeqTboolBoolLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction TeqTboolBoolLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector TeqTboolBoolLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction TeqTboolBoolLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "TeqTboolBoolLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view TeqTboolBoolLogicalFunction::getType() const { return NAME; } + +bool TeqTboolBoolLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string TeqTboolBoolLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TeqTboolBoolLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction TeqTboolBoolLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTeqTboolBoolLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "TeqTboolBoolLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return TeqTboolBoolLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TeqTemporalTemporalLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TeqTemporalTemporalLogicalFunction.cpp new file mode 100644 index 0000000000..7a9473659e --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TeqTemporalTemporalLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TeqTemporalTemporalLogicalFunction::TeqTemporalTemporalLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType TeqTemporalTemporalLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction TeqTemporalTemporalLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector TeqTemporalTemporalLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction TeqTemporalTemporalLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "TeqTemporalTemporalLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view TeqTemporalTemporalLogicalFunction::getType() const { return NAME; } + +bool TeqTemporalTemporalLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string TeqTemporalTemporalLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TeqTemporalTemporalLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction TeqTemporalTemporalLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTeqTemporalTemporalLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "TeqTemporalTemporalLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return TeqTemporalTemporalLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TeqTfloatFloatLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TeqTfloatFloatLogicalFunction.cpp new file mode 100644 index 0000000000..96d07075e3 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TeqTfloatFloatLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TeqTfloatFloatLogicalFunction::TeqTfloatFloatLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType TeqTfloatFloatLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction TeqTfloatFloatLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector TeqTfloatFloatLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction TeqTfloatFloatLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "TeqTfloatFloatLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view TeqTfloatFloatLogicalFunction::getType() const { return NAME; } + +bool TeqTfloatFloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string TeqTfloatFloatLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TeqTfloatFloatLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction TeqTfloatFloatLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTeqTfloatFloatLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "TeqTfloatFloatLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return TeqTfloatFloatLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TeqTintIntLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TeqTintIntLogicalFunction.cpp new file mode 100644 index 0000000000..6de831d63c --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TeqTintIntLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TeqTintIntLogicalFunction::TeqTintIntLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType TeqTintIntLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction TeqTintIntLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector TeqTintIntLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction TeqTintIntLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "TeqTintIntLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view TeqTintIntLogicalFunction::getType() const { return NAME; } + +bool TeqTintIntLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string TeqTintIntLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TeqTintIntLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction TeqTintIntLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTeqTintIntLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "TeqTintIntLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return TeqTintIntLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TeqBoolTboolPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TeqBoolTboolPhysicalFunction.hpp new file mode 100644 index 0000000000..ef746e752b --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TeqBoolTboolPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `teq_bool_tbool`. + * + * temporal EQ: scalar bool vs single-instant tbool + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TeqBoolTboolPhysicalFunction : public PhysicalFunctionConcept { +public: + TeqBoolTboolPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TeqFloatTfloatPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TeqFloatTfloatPhysicalFunction.hpp new file mode 100644 index 0000000000..828a0eef12 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TeqFloatTfloatPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `teq_float_tfloat`. + * + * temporal EQ: scalar float vs single-instant tfloat + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TeqFloatTfloatPhysicalFunction : public PhysicalFunctionConcept { +public: + TeqFloatTfloatPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TeqIntTintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TeqIntTintPhysicalFunction.hpp new file mode 100644 index 0000000000..25cef38b59 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TeqIntTintPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `teq_int_tint`. + * + * temporal EQ: scalar int vs single-instant tint + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TeqIntTintPhysicalFunction : public PhysicalFunctionConcept { +public: + TeqIntTintPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TeqTboolBoolPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TeqTboolBoolPhysicalFunction.hpp new file mode 100644 index 0000000000..80a2c14469 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TeqTboolBoolPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `teq_tbool_bool`. + * + * temporal EQ: single-instant tbool vs scalar bool + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TeqTboolBoolPhysicalFunction : public PhysicalFunctionConcept { +public: + TeqTboolBoolPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TeqTemporalTemporalPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TeqTemporalTemporalPhysicalFunction.hpp new file mode 100644 index 0000000000..1561f021ec --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TeqTemporalTemporalPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `teq_temporal_temporal`. + * + * temporal EQ: two single-instant tfloats + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TeqTemporalTemporalPhysicalFunction : public PhysicalFunctionConcept { +public: + TeqTemporalTemporalPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TeqTfloatFloatPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TeqTfloatFloatPhysicalFunction.hpp new file mode 100644 index 0000000000..e74ffd19bf --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TeqTfloatFloatPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `teq_tfloat_float`. + * + * temporal EQ: single-instant tfloat vs scalar float + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TeqTfloatFloatPhysicalFunction : public PhysicalFunctionConcept { +public: + TeqTfloatFloatPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TeqTintIntPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TeqTintIntPhysicalFunction.hpp new file mode 100644 index 0000000000..c0e86313c6 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TeqTintIntPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `teq_tint_int`. + * + * temporal EQ: single-instant tint vs scalar int + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TeqTintIntPhysicalFunction : public PhysicalFunctionConcept { +public: + TeqTintIntPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt index be8913afa6..5005e9d8b2 100644 --- a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt @@ -210,4 +210,11 @@ add_plugin(TnotTbool PhysicalFunction nes-physical-operators TnotTboolPhysicalFu add_plugin(TorBoolTbool PhysicalFunction nes-physical-operators TorBoolTboolPhysicalFunction.cpp) add_plugin(TorTboolBool PhysicalFunction nes-physical-operators TorTboolBoolPhysicalFunction.cpp) add_plugin(TorTboolTbool PhysicalFunction nes-physical-operators TorTboolTboolPhysicalFunction.cpp) +add_plugin(TeqBoolTbool PhysicalFunction nes-physical-operators TeqBoolTboolPhysicalFunction.cpp) +add_plugin(TeqFloatTfloat PhysicalFunction nes-physical-operators TeqFloatTfloatPhysicalFunction.cpp) +add_plugin(TeqIntTint PhysicalFunction nes-physical-operators TeqIntTintPhysicalFunction.cpp) +add_plugin(TeqTboolBool PhysicalFunction nes-physical-operators TeqTboolBoolPhysicalFunction.cpp) +add_plugin(TeqTemporalTemporal PhysicalFunction nes-physical-operators TeqTemporalTemporalPhysicalFunction.cpp) +add_plugin(TeqTfloatFloat PhysicalFunction nes-physical-operators TeqTfloatFloatPhysicalFunction.cpp) +add_plugin(TeqTintInt PhysicalFunction nes-physical-operators TeqTintIntPhysicalFunction.cpp) endif() diff --git a/nes-physical-operators/src/Functions/Meos/TeqBoolTboolPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TeqBoolTboolPhysicalFunction.cpp new file mode 100644 index 0000000000..5b46a75014 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TeqBoolTboolPhysicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +TeqBoolTboolPhysicalFunction::TeqBoolTboolPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(thresholdFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal TeqBoolTboolPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto thresh = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double v, double s, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + bool sv = (v != 0.0); + std::string wkt = fmt::format("{}", (s != 0.0 ? "t" : "f")) + "@" + ts_str; + Temporal* temp = tbool_in(wkt.c_str()); + if (!temp) return 0.0; + Temporal* res = teq_bool_tbool(sv, temp); + free(temp); + if (!res) return 0.0; + bool r = tbool_start_value(res); + free(res); + return static_cast(r ? 1.0 : 0.0); + } catch (const std::exception&) { return 0.0; } + }, + value, thresh, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTeqBoolTboolPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "TeqBoolTboolPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return TeqBoolTboolPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TeqFloatTfloatPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TeqFloatTfloatPhysicalFunction.cpp new file mode 100644 index 0000000000..68f66f7508 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TeqFloatTfloatPhysicalFunction.cpp @@ -0,0 +1,92 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +TeqFloatTfloatPhysicalFunction::TeqFloatTfloatPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(thresholdFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal TeqFloatTfloatPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto thresh = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double v, double s, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = fmt::format("{}", s) + "@" + ts_str; + Temporal* temp = tfloat_in(wkt.c_str()); + if (!temp) return 0.0; + Temporal* res = teq_float_tfloat(v, temp); + free(temp); + if (!res) return 0.0; + bool r = tbool_start_value(res); + free(res); + return static_cast(r ? 1.0 : 0.0); + } catch (const std::exception&) { return 0.0; } + }, + value, thresh, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTeqFloatTfloatPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "TeqFloatTfloatPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return TeqFloatTfloatPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TeqIntTintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TeqIntTintPhysicalFunction.cpp new file mode 100644 index 0000000000..43a46c5389 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TeqIntTintPhysicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +TeqIntTintPhysicalFunction::TeqIntTintPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(thresholdFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal TeqIntTintPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto thresh = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double v, double s, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + int iv = static_cast(v); + std::string wkt = fmt::format("{}", static_cast(s)) + "@" + ts_str; + Temporal* temp = tint_in(wkt.c_str()); + if (!temp) return 0.0; + Temporal* res = teq_int_tint(iv, temp); + free(temp); + if (!res) return 0.0; + bool r = tbool_start_value(res); + free(res); + return static_cast(r ? 1.0 : 0.0); + } catch (const std::exception&) { return 0.0; } + }, + value, thresh, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTeqIntTintPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "TeqIntTintPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return TeqIntTintPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TeqTboolBoolPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TeqTboolBoolPhysicalFunction.cpp new file mode 100644 index 0000000000..71041e3dc8 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TeqTboolBoolPhysicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +TeqTboolBoolPhysicalFunction::TeqTboolBoolPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(thresholdFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal TeqTboolBoolPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto thresh = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double v, double s, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = fmt::format("{}", (v != 0.0 ? "t" : "f")) + "@" + ts_str; + Temporal* temp = tbool_in(wkt.c_str()); + if (!temp) return 0.0; + bool sv = (s != 0.0); + Temporal* res = teq_tbool_bool(temp, sv); + free(temp); + if (!res) return 0.0; + bool r = tbool_start_value(res); + free(res); + return static_cast(r ? 1.0 : 0.0); + } catch (const std::exception&) { return 0.0; } + }, + value, thresh, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTeqTboolBoolPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "TeqTboolBoolPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return TeqTboolBoolPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TeqTemporalTemporalPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TeqTemporalTemporalPhysicalFunction.cpp new file mode 100644 index 0000000000..2ebffbcfb4 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TeqTemporalTemporalPhysicalFunction.cpp @@ -0,0 +1,95 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +TeqTemporalTemporalPhysicalFunction::TeqTemporalTemporalPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(thresholdFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal TeqTemporalTemporalPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto thresh = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double v, double s, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt1 = fmt::format("{}", v) + "@" + ts_str; + Temporal* temp = tfloat_in(wkt1.c_str()); + if (!temp) return 0.0; + std::string wkt2 = fmt::format("{}", s) + "@" + ts_str; + Temporal* temp2 = tfloat_in(wkt2.c_str()); + if (!temp2) { free(temp); return 0.0; } + Temporal* res = teq_temporal_temporal(temp, temp2); + free(temp); free(temp2); + if (!res) return 0.0; + bool r = tbool_start_value(res); + free(res); + return static_cast(r ? 1.0 : 0.0); + } catch (const std::exception&) { return 0.0; } + }, + value, thresh, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTeqTemporalTemporalPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "TeqTemporalTemporalPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return TeqTemporalTemporalPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TeqTfloatFloatPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TeqTfloatFloatPhysicalFunction.cpp new file mode 100644 index 0000000000..d599cc0a6c --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TeqTfloatFloatPhysicalFunction.cpp @@ -0,0 +1,92 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +TeqTfloatFloatPhysicalFunction::TeqTfloatFloatPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(thresholdFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal TeqTfloatFloatPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto thresh = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double v, double s, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = fmt::format("{}", v) + "@" + ts_str; + Temporal* temp = tfloat_in(wkt.c_str()); + if (!temp) return 0.0; + Temporal* res = teq_tfloat_float(temp, s); + free(temp); + if (!res) return 0.0; + bool r = tbool_start_value(res); + free(res); + return static_cast(r ? 1.0 : 0.0); + } catch (const std::exception&) { return 0.0; } + }, + value, thresh, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTeqTfloatFloatPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "TeqTfloatFloatPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return TeqTfloatFloatPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TeqTintIntPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TeqTintIntPhysicalFunction.cpp new file mode 100644 index 0000000000..b2ead9a552 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TeqTintIntPhysicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +TeqTintIntPhysicalFunction::TeqTintIntPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(thresholdFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal TeqTintIntPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto thresh = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double v, double s, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = fmt::format("{}", static_cast(v)) + "@" + ts_str; + Temporal* temp = tint_in(wkt.c_str()); + if (!temp) return 0.0; + int iv = static_cast(s); + Temporal* res = teq_tint_int(temp, iv); + free(temp); + if (!res) return 0.0; + bool r = tbool_start_value(res); + free(res); + return static_cast(r ? 1.0 : 0.0); + } catch (const std::exception&) { return 0.0; } + }, + value, thresh, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTeqTintIntPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "TeqTintIntPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return TeqTintIntPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-sql-parser/AntlrSQL.g4 b/nes-sql-parser/AntlrSQL.g4 index 8352c429ae..0fcbd50d39 100644 --- a/nes-sql-parser/AntlrSQL.g4 +++ b/nes-sql-parser/AntlrSQL.g4 @@ -295,7 +295,7 @@ timeUnit: MS timestampParameter: name=identifier; -functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL; +functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT; sinkClause: INTO sink (',' sink)*; @@ -681,6 +681,13 @@ TNOT_TBOOL: 'TNOT_TBOOL' | 'tnot_tbool'; TOR_BOOL_TBOOL: 'TOR_BOOL_TBOOL' | 'tor_bool_tbool'; TOR_TBOOL_BOOL: 'TOR_TBOOL_BOOL' | 'tor_tbool_bool'; TOR_TBOOL_TBOOL: 'TOR_TBOOL_TBOOL' | 'tor_tbool_tbool'; +TEQ_BOOL_TBOOL: 'TEQ_BOOL_TBOOL' | 'teq_bool_tbool'; +TEQ_FLOAT_TFLOAT: 'TEQ_FLOAT_TFLOAT' | 'teq_float_tfloat'; +TEQ_INT_TINT: 'TEQ_INT_TINT' | 'teq_int_tint'; +TEQ_TBOOL_BOOL: 'TEQ_TBOOL_BOOL' | 'teq_tbool_bool'; +TEQ_TEMPORAL_TEMPORAL: 'TEQ_TEMPORAL_TEMPORAL' | 'teq_temporal_temporal'; +TEQ_TFLOAT_FLOAT: 'TEQ_TFLOAT_FLOAT' | 'teq_tfloat_float'; +TEQ_TINT_INT: 'TEQ_TINT_INT' | 'teq_tint_int'; WATERMARK: 'WATERMARK' | 'watermark'; OFFSET: 'OFFSET' | 'offset'; LOCALHOST: 'LOCALHOST' | 'localhost'; diff --git a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp index a16639422d..ead24af3c4 100644 --- a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp +++ b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp @@ -262,6 +262,13 @@ #include #include #include +#include +#include +#include +#include +#include +#include +#include #include #include #include @@ -6615,6 +6622,209 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont }} break; /* END CODEGEN PARSER GLUE: TOR_TBOOL_TBOOL */ + /* BEGIN CODEGEN PARSER GLUE: TEQ_BOOL_TBOOL */ + case AntlrSQLLexer::TEQ_BOOL_TBOOL: + {{ + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("TEQ_BOOL_TBOOL requires exactly 3 arguments, but got {{}}", argCount); + + while (!helpers.top().constantBuilder.empty()) + {{ + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + }} + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(TeqBoolTboolLogicalFunction(a0, a1, a2)); + }} + break; + /* END CODEGEN PARSER GLUE: TEQ_BOOL_TBOOL */ + /* BEGIN CODEGEN PARSER GLUE: TEQ_FLOAT_TFLOAT */ + case AntlrSQLLexer::TEQ_FLOAT_TFLOAT: + {{ + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("TEQ_FLOAT_TFLOAT requires exactly 3 arguments, but got {{}}", argCount); + + while (!helpers.top().constantBuilder.empty()) + {{ + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + }} + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(TeqFloatTfloatLogicalFunction(a0, a1, a2)); + }} + break; + /* END CODEGEN PARSER GLUE: TEQ_FLOAT_TFLOAT */ + /* BEGIN CODEGEN PARSER GLUE: TEQ_INT_TINT */ + case AntlrSQLLexer::TEQ_INT_TINT: + {{ + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("TEQ_INT_TINT requires exactly 3 arguments, but got {{}}", argCount); + + while (!helpers.top().constantBuilder.empty()) + {{ + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + }} + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(TeqIntTintLogicalFunction(a0, a1, a2)); + }} + break; + /* END CODEGEN PARSER GLUE: TEQ_INT_TINT */ + /* BEGIN CODEGEN PARSER GLUE: TEQ_TBOOL_BOOL */ + case AntlrSQLLexer::TEQ_TBOOL_BOOL: + {{ + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("TEQ_TBOOL_BOOL requires exactly 3 arguments, but got {{}}", argCount); + + while (!helpers.top().constantBuilder.empty()) + {{ + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + }} + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(TeqTboolBoolLogicalFunction(a0, a1, a2)); + }} + break; + /* END CODEGEN PARSER GLUE: TEQ_TBOOL_BOOL */ + /* BEGIN CODEGEN PARSER GLUE: TEQ_TEMPORAL_TEMPORAL */ + case AntlrSQLLexer::TEQ_TEMPORAL_TEMPORAL: + {{ + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("TEQ_TEMPORAL_TEMPORAL requires exactly 3 arguments, but got {{}}", argCount); + + while (!helpers.top().constantBuilder.empty()) + {{ + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + }} + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(TeqTemporalTemporalLogicalFunction(a0, a1, a2)); + }} + break; + /* END CODEGEN PARSER GLUE: TEQ_TEMPORAL_TEMPORAL */ + /* BEGIN CODEGEN PARSER GLUE: TEQ_TFLOAT_FLOAT */ + case AntlrSQLLexer::TEQ_TFLOAT_FLOAT: + {{ + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("TEQ_TFLOAT_FLOAT requires exactly 3 arguments, but got {{}}", argCount); + + while (!helpers.top().constantBuilder.empty()) + {{ + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + }} + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(TeqTfloatFloatLogicalFunction(a0, a1, a2)); + }} + break; + /* END CODEGEN PARSER GLUE: TEQ_TFLOAT_FLOAT */ + /* BEGIN CODEGEN PARSER GLUE: TEQ_TINT_INT */ + case AntlrSQLLexer::TEQ_TINT_INT: + {{ + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("TEQ_TINT_INT requires exactly 3 arguments, but got {{}}", argCount); + + while (!helpers.top().constantBuilder.empty()) + {{ + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + }} + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(TeqTintIntLogicalFunction(a0, a1, a2)); + }} + break; + /* END CODEGEN PARSER GLUE: TEQ_TINT_INT */ /* BEGIN CODEGEN PARSER GLUE: ALWAYS_EQ_TFLOAT_FLOAT */ case AntlrSQLLexer::ALWAYS_EQ_TFLOAT_FLOAT: { From 64af39c98959af1821f2fec9a8709974b21016a6 Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Fri, 12 Jun 2026 10:57:04 +0200 Subject: [PATCH 36/96] feat(meos): add TNE_{BOOL_TBOOL,TBOOL_BOOL,FLOAT_TFLOAT,TFLOAT_FLOAT,INT_TINT,TINT_INT,TEMPORAL_TEMPORAL} NES operators (W87) --- .../Meos/TneBoolTboolLogicalFunction.hpp | 54 +++++ .../Meos/TneFloatTfloatLogicalFunction.hpp | 54 +++++ .../Meos/TneIntTintLogicalFunction.hpp | 54 +++++ .../Meos/TneTboolBoolLogicalFunction.hpp | 54 +++++ .../TneTemporalTemporalLogicalFunction.hpp | 54 +++++ .../Meos/TneTfloatFloatLogicalFunction.hpp | 54 +++++ .../Meos/TneTintIntLogicalFunction.hpp | 54 +++++ .../src/Functions/Meos/CMakeLists.txt | 7 + .../Meos/TneBoolTboolLogicalFunction.cpp | 105 +++++++++ .../Meos/TneFloatTfloatLogicalFunction.cpp | 105 +++++++++ .../Meos/TneIntTintLogicalFunction.cpp | 105 +++++++++ .../Meos/TneTboolBoolLogicalFunction.cpp | 105 +++++++++ .../TneTemporalTemporalLogicalFunction.cpp | 105 +++++++++ .../Meos/TneTfloatFloatLogicalFunction.cpp | 105 +++++++++ .../Meos/TneTintIntLogicalFunction.cpp | 105 +++++++++ .../Meos/TneBoolTboolPhysicalFunction.hpp | 43 ++++ .../Meos/TneFloatTfloatPhysicalFunction.hpp | 43 ++++ .../Meos/TneIntTintPhysicalFunction.hpp | 43 ++++ .../Meos/TneTboolBoolPhysicalFunction.hpp | 43 ++++ .../TneTemporalTemporalPhysicalFunction.hpp | 43 ++++ .../Meos/TneTfloatFloatPhysicalFunction.hpp | 43 ++++ .../Meos/TneTintIntPhysicalFunction.hpp | 43 ++++ .../src/Functions/Meos/CMakeLists.txt | 7 + .../Meos/TneBoolTboolPhysicalFunction.cpp | 93 ++++++++ .../Meos/TneFloatTfloatPhysicalFunction.cpp | 92 ++++++++ .../Meos/TneIntTintPhysicalFunction.cpp | 93 ++++++++ .../Meos/TneTboolBoolPhysicalFunction.cpp | 93 ++++++++ .../TneTemporalTemporalPhysicalFunction.cpp | 95 ++++++++ .../Meos/TneTfloatFloatPhysicalFunction.cpp | 92 ++++++++ .../Meos/TneTintIntPhysicalFunction.cpp | 93 ++++++++ nes-sql-parser/AntlrSQL.g4 | 9 +- .../src/AntlrSQLQueryPlanCreator.cpp | 210 ++++++++++++++++++ 32 files changed, 2297 insertions(+), 1 deletion(-) create mode 100644 nes-logical-operators/include/Functions/Meos/TneBoolTboolLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TneFloatTfloatLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TneIntTintLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TneTboolBoolLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TneTemporalTemporalLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TneTfloatFloatLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TneTintIntLogicalFunction.hpp create mode 100644 nes-logical-operators/src/Functions/Meos/TneBoolTboolLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TneFloatTfloatLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TneIntTintLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TneTboolBoolLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TneTemporalTemporalLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TneTfloatFloatLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TneTintIntLogicalFunction.cpp create mode 100644 nes-physical-operators/include/Functions/Meos/TneBoolTboolPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TneFloatTfloatPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TneIntTintPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TneTboolBoolPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TneTemporalTemporalPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TneTfloatFloatPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TneTintIntPhysicalFunction.hpp create mode 100644 nes-physical-operators/src/Functions/Meos/TneBoolTboolPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TneFloatTfloatPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TneIntTintPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TneTboolBoolPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TneTemporalTemporalPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TneTfloatFloatPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TneTintIntPhysicalFunction.cpp diff --git a/nes-logical-operators/include/Functions/Meos/TneBoolTboolLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TneBoolTboolLogicalFunction.hpp new file mode 100644 index 0000000000..1de3118a9e --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TneBoolTboolLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief temporal NE: scalar bool vs single-instant tbool + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `tne_bool_tbool`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class TneBoolTboolLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TneBoolTbool"; + + TneBoolTboolLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TneFloatTfloatLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TneFloatTfloatLogicalFunction.hpp new file mode 100644 index 0000000000..5cdae702ce --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TneFloatTfloatLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief temporal NE: scalar float vs single-instant tfloat + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `tne_float_tfloat`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class TneFloatTfloatLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TneFloatTfloat"; + + TneFloatTfloatLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TneIntTintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TneIntTintLogicalFunction.hpp new file mode 100644 index 0000000000..9cbf66a925 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TneIntTintLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief temporal NE: scalar int vs single-instant tint + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `tne_int_tint`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class TneIntTintLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TneIntTint"; + + TneIntTintLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TneTboolBoolLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TneTboolBoolLogicalFunction.hpp new file mode 100644 index 0000000000..2414c7ca98 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TneTboolBoolLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief temporal NE: single-instant tbool vs scalar bool + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `tne_tbool_bool`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class TneTboolBoolLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TneTboolBool"; + + TneTboolBoolLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TneTemporalTemporalLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TneTemporalTemporalLogicalFunction.hpp new file mode 100644 index 0000000000..3e93e4a1b0 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TneTemporalTemporalLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief temporal NE: two single-instant tfloats + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `tne_temporal_temporal`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class TneTemporalTemporalLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TneTemporalTemporal"; + + TneTemporalTemporalLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TneTfloatFloatLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TneTfloatFloatLogicalFunction.hpp new file mode 100644 index 0000000000..e78377ecda --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TneTfloatFloatLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief temporal NE: single-instant tfloat vs scalar float + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `tne_tfloat_float`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class TneTfloatFloatLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TneTfloatFloat"; + + TneTfloatFloatLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TneTintIntLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TneTintIntLogicalFunction.hpp new file mode 100644 index 0000000000..e938a4313b --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TneTintIntLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief temporal NE: single-instant tint vs scalar int + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `tne_tint_int`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class TneTintIntLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TneTintInt"; + + TneTintIntLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt index 9a3d850eea..72afd241e5 100644 --- a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt @@ -218,3 +218,10 @@ add_plugin(TeqTboolBool LogicalFunction nes-logical-operators TeqTboolBoolLogica add_plugin(TeqTemporalTemporal LogicalFunction nes-logical-operators TeqTemporalTemporalLogicalFunction.cpp) add_plugin(TeqTfloatFloat LogicalFunction nes-logical-operators TeqTfloatFloatLogicalFunction.cpp) add_plugin(TeqTintInt LogicalFunction nes-logical-operators TeqTintIntLogicalFunction.cpp) +add_plugin(TneTboolBool LogicalFunction nes-logical-operators TneTboolBoolLogicalFunction.cpp) +add_plugin(TneBoolTbool LogicalFunction nes-logical-operators TneBoolTboolLogicalFunction.cpp) +add_plugin(TneTfloatFloat LogicalFunction nes-logical-operators TneTfloatFloatLogicalFunction.cpp) +add_plugin(TneFloatTfloat LogicalFunction nes-logical-operators TneFloatTfloatLogicalFunction.cpp) +add_plugin(TneTintInt LogicalFunction nes-logical-operators TneTintIntLogicalFunction.cpp) +add_plugin(TneIntTint LogicalFunction nes-logical-operators TneIntTintLogicalFunction.cpp) +add_plugin(TneTemporalTemporal LogicalFunction nes-logical-operators TneTemporalTemporalLogicalFunction.cpp) diff --git a/nes-logical-operators/src/Functions/Meos/TneBoolTboolLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TneBoolTboolLogicalFunction.cpp new file mode 100644 index 0000000000..c70f8b5ad8 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TneBoolTboolLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TneBoolTboolLogicalFunction::TneBoolTboolLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType TneBoolTboolLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction TneBoolTboolLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector TneBoolTboolLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction TneBoolTboolLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "TneBoolTboolLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view TneBoolTboolLogicalFunction::getType() const { return NAME; } + +bool TneBoolTboolLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string TneBoolTboolLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TneBoolTboolLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction TneBoolTboolLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTneBoolTboolLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "TneBoolTboolLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return TneBoolTboolLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TneFloatTfloatLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TneFloatTfloatLogicalFunction.cpp new file mode 100644 index 0000000000..53698fc13f --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TneFloatTfloatLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TneFloatTfloatLogicalFunction::TneFloatTfloatLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType TneFloatTfloatLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction TneFloatTfloatLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector TneFloatTfloatLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction TneFloatTfloatLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "TneFloatTfloatLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view TneFloatTfloatLogicalFunction::getType() const { return NAME; } + +bool TneFloatTfloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string TneFloatTfloatLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TneFloatTfloatLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction TneFloatTfloatLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTneFloatTfloatLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "TneFloatTfloatLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return TneFloatTfloatLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TneIntTintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TneIntTintLogicalFunction.cpp new file mode 100644 index 0000000000..9ae1544bad --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TneIntTintLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TneIntTintLogicalFunction::TneIntTintLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType TneIntTintLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction TneIntTintLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector TneIntTintLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction TneIntTintLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "TneIntTintLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view TneIntTintLogicalFunction::getType() const { return NAME; } + +bool TneIntTintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string TneIntTintLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TneIntTintLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction TneIntTintLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTneIntTintLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "TneIntTintLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return TneIntTintLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TneTboolBoolLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TneTboolBoolLogicalFunction.cpp new file mode 100644 index 0000000000..4e6d17868d --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TneTboolBoolLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TneTboolBoolLogicalFunction::TneTboolBoolLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType TneTboolBoolLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction TneTboolBoolLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector TneTboolBoolLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction TneTboolBoolLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "TneTboolBoolLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view TneTboolBoolLogicalFunction::getType() const { return NAME; } + +bool TneTboolBoolLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string TneTboolBoolLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TneTboolBoolLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction TneTboolBoolLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTneTboolBoolLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "TneTboolBoolLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return TneTboolBoolLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TneTemporalTemporalLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TneTemporalTemporalLogicalFunction.cpp new file mode 100644 index 0000000000..15230d5977 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TneTemporalTemporalLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TneTemporalTemporalLogicalFunction::TneTemporalTemporalLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType TneTemporalTemporalLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction TneTemporalTemporalLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector TneTemporalTemporalLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction TneTemporalTemporalLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "TneTemporalTemporalLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view TneTemporalTemporalLogicalFunction::getType() const { return NAME; } + +bool TneTemporalTemporalLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string TneTemporalTemporalLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TneTemporalTemporalLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction TneTemporalTemporalLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTneTemporalTemporalLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "TneTemporalTemporalLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return TneTemporalTemporalLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TneTfloatFloatLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TneTfloatFloatLogicalFunction.cpp new file mode 100644 index 0000000000..6ae75fcf41 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TneTfloatFloatLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TneTfloatFloatLogicalFunction::TneTfloatFloatLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType TneTfloatFloatLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction TneTfloatFloatLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector TneTfloatFloatLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction TneTfloatFloatLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "TneTfloatFloatLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view TneTfloatFloatLogicalFunction::getType() const { return NAME; } + +bool TneTfloatFloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string TneTfloatFloatLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TneTfloatFloatLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction TneTfloatFloatLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTneTfloatFloatLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "TneTfloatFloatLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return TneTfloatFloatLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TneTintIntLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TneTintIntLogicalFunction.cpp new file mode 100644 index 0000000000..92432fa878 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TneTintIntLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TneTintIntLogicalFunction::TneTintIntLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType TneTintIntLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction TneTintIntLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector TneTintIntLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction TneTintIntLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "TneTintIntLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view TneTintIntLogicalFunction::getType() const { return NAME; } + +bool TneTintIntLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string TneTintIntLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TneTintIntLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction TneTintIntLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTneTintIntLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "TneTintIntLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return TneTintIntLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TneBoolTboolPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TneBoolTboolPhysicalFunction.hpp new file mode 100644 index 0000000000..b9d2bfccf8 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TneBoolTboolPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `tne_bool_tbool`. + * + * temporal NE: scalar bool vs single-instant tbool + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TneBoolTboolPhysicalFunction : public PhysicalFunctionConcept { +public: + TneBoolTboolPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TneFloatTfloatPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TneFloatTfloatPhysicalFunction.hpp new file mode 100644 index 0000000000..8249e9e4c3 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TneFloatTfloatPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `tne_float_tfloat`. + * + * temporal NE: scalar float vs single-instant tfloat + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TneFloatTfloatPhysicalFunction : public PhysicalFunctionConcept { +public: + TneFloatTfloatPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TneIntTintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TneIntTintPhysicalFunction.hpp new file mode 100644 index 0000000000..fe6f8abb74 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TneIntTintPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `tne_int_tint`. + * + * temporal NE: scalar int vs single-instant tint + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TneIntTintPhysicalFunction : public PhysicalFunctionConcept { +public: + TneIntTintPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TneTboolBoolPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TneTboolBoolPhysicalFunction.hpp new file mode 100644 index 0000000000..543dab6dc5 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TneTboolBoolPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `tne_tbool_bool`. + * + * temporal NE: single-instant tbool vs scalar bool + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TneTboolBoolPhysicalFunction : public PhysicalFunctionConcept { +public: + TneTboolBoolPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TneTemporalTemporalPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TneTemporalTemporalPhysicalFunction.hpp new file mode 100644 index 0000000000..a505eafb90 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TneTemporalTemporalPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `tne_temporal_temporal`. + * + * temporal NE: two single-instant tfloats + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TneTemporalTemporalPhysicalFunction : public PhysicalFunctionConcept { +public: + TneTemporalTemporalPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TneTfloatFloatPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TneTfloatFloatPhysicalFunction.hpp new file mode 100644 index 0000000000..166bce1a7a --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TneTfloatFloatPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `tne_tfloat_float`. + * + * temporal NE: single-instant tfloat vs scalar float + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TneTfloatFloatPhysicalFunction : public PhysicalFunctionConcept { +public: + TneTfloatFloatPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TneTintIntPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TneTintIntPhysicalFunction.hpp new file mode 100644 index 0000000000..32c2aae1e4 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TneTintIntPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `tne_tint_int`. + * + * temporal NE: single-instant tint vs scalar int + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TneTintIntPhysicalFunction : public PhysicalFunctionConcept { +public: + TneTintIntPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt index 5005e9d8b2..7430f3fc05 100644 --- a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt @@ -217,4 +217,11 @@ add_plugin(TeqTboolBool PhysicalFunction nes-physical-operators TeqTboolBoolPhys add_plugin(TeqTemporalTemporal PhysicalFunction nes-physical-operators TeqTemporalTemporalPhysicalFunction.cpp) add_plugin(TeqTfloatFloat PhysicalFunction nes-physical-operators TeqTfloatFloatPhysicalFunction.cpp) add_plugin(TeqTintInt PhysicalFunction nes-physical-operators TeqTintIntPhysicalFunction.cpp) +add_plugin(TneTboolBool PhysicalFunction nes-physical-operators TneTboolBoolPhysicalFunction.cpp) +add_plugin(TneBoolTbool PhysicalFunction nes-physical-operators TneBoolTboolPhysicalFunction.cpp) +add_plugin(TneTfloatFloat PhysicalFunction nes-physical-operators TneTfloatFloatPhysicalFunction.cpp) +add_plugin(TneFloatTfloat PhysicalFunction nes-physical-operators TneFloatTfloatPhysicalFunction.cpp) +add_plugin(TneTintInt PhysicalFunction nes-physical-operators TneTintIntPhysicalFunction.cpp) +add_plugin(TneIntTint PhysicalFunction nes-physical-operators TneIntTintPhysicalFunction.cpp) +add_plugin(TneTemporalTemporal PhysicalFunction nes-physical-operators TneTemporalTemporalPhysicalFunction.cpp) endif() diff --git a/nes-physical-operators/src/Functions/Meos/TneBoolTboolPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TneBoolTboolPhysicalFunction.cpp new file mode 100644 index 0000000000..ca66826959 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TneBoolTboolPhysicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +TneBoolTboolPhysicalFunction::TneBoolTboolPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(thresholdFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal TneBoolTboolPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto thresh = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double v, double s, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + bool sv = (v != 0.0); + std::string wkt = fmt::format("{}", (s != 0.0 ? "t" : "f")) + "@" + ts_str; + Temporal* temp = tbool_in(wkt.c_str()); + if (!temp) return 0.0; + Temporal* res = tne_bool_tbool(sv, temp); + free(temp); + if (!res) return 0.0; + bool r = tbool_start_value(res); + free(res); + return static_cast(r ? 1.0 : 0.0); + } catch (const std::exception&) { return 0.0; } + }, + value, thresh, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTneBoolTboolPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "TneBoolTboolPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return TneBoolTboolPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TneFloatTfloatPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TneFloatTfloatPhysicalFunction.cpp new file mode 100644 index 0000000000..466d1f8d19 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TneFloatTfloatPhysicalFunction.cpp @@ -0,0 +1,92 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +TneFloatTfloatPhysicalFunction::TneFloatTfloatPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(thresholdFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal TneFloatTfloatPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto thresh = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double v, double s, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = fmt::format("{}", s) + "@" + ts_str; + Temporal* temp = tfloat_in(wkt.c_str()); + if (!temp) return 0.0; + Temporal* res = tne_float_tfloat(v, temp); + free(temp); + if (!res) return 0.0; + bool r = tbool_start_value(res); + free(res); + return static_cast(r ? 1.0 : 0.0); + } catch (const std::exception&) { return 0.0; } + }, + value, thresh, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTneFloatTfloatPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "TneFloatTfloatPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return TneFloatTfloatPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TneIntTintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TneIntTintPhysicalFunction.cpp new file mode 100644 index 0000000000..1dccbfc071 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TneIntTintPhysicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +TneIntTintPhysicalFunction::TneIntTintPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(thresholdFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal TneIntTintPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto thresh = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double v, double s, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + int iv = static_cast(v); + std::string wkt = fmt::format("{}", static_cast(s)) + "@" + ts_str; + Temporal* temp = tint_in(wkt.c_str()); + if (!temp) return 0.0; + Temporal* res = tne_int_tint(iv, temp); + free(temp); + if (!res) return 0.0; + bool r = tbool_start_value(res); + free(res); + return static_cast(r ? 1.0 : 0.0); + } catch (const std::exception&) { return 0.0; } + }, + value, thresh, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTneIntTintPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "TneIntTintPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return TneIntTintPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TneTboolBoolPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TneTboolBoolPhysicalFunction.cpp new file mode 100644 index 0000000000..f189f48fcf --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TneTboolBoolPhysicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +TneTboolBoolPhysicalFunction::TneTboolBoolPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(thresholdFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal TneTboolBoolPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto thresh = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double v, double s, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = fmt::format("{}", (v != 0.0 ? "t" : "f")) + "@" + ts_str; + Temporal* temp = tbool_in(wkt.c_str()); + if (!temp) return 0.0; + bool sv = (s != 0.0); + Temporal* res = tne_tbool_bool(temp, sv); + free(temp); + if (!res) return 0.0; + bool r = tbool_start_value(res); + free(res); + return static_cast(r ? 1.0 : 0.0); + } catch (const std::exception&) { return 0.0; } + }, + value, thresh, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTneTboolBoolPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "TneTboolBoolPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return TneTboolBoolPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TneTemporalTemporalPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TneTemporalTemporalPhysicalFunction.cpp new file mode 100644 index 0000000000..362eae034d --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TneTemporalTemporalPhysicalFunction.cpp @@ -0,0 +1,95 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +TneTemporalTemporalPhysicalFunction::TneTemporalTemporalPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(thresholdFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal TneTemporalTemporalPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto thresh = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double v, double s, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt1 = fmt::format("{}", v) + "@" + ts_str; + Temporal* temp1 = tfloat_in(wkt1.c_str()); + if (!temp1) return 0.0; + std::string wkt2 = fmt::format("{}", s) + "@" + ts_str; + Temporal* temp2 = tfloat_in(wkt2.c_str()); + if (!temp2) { free(temp1); return 0.0; } + Temporal* res = tne_temporal_temporal(temp1, temp2); + free(temp1); free(temp2); + if (!res) return 0.0; + bool r = tbool_start_value(res); + free(res); + return static_cast(r ? 1.0 : 0.0); + } catch (const std::exception&) { return 0.0; } + }, + value, thresh, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTneTemporalTemporalPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "TneTemporalTemporalPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return TneTemporalTemporalPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TneTfloatFloatPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TneTfloatFloatPhysicalFunction.cpp new file mode 100644 index 0000000000..b7d1b7a8b9 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TneTfloatFloatPhysicalFunction.cpp @@ -0,0 +1,92 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +TneTfloatFloatPhysicalFunction::TneTfloatFloatPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(thresholdFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal TneTfloatFloatPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto thresh = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double v, double s, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = fmt::format("{}", v) + "@" + ts_str; + Temporal* temp = tfloat_in(wkt.c_str()); + if (!temp) return 0.0; + Temporal* res = tne_tfloat_float(temp, s); + free(temp); + if (!res) return 0.0; + bool r = tbool_start_value(res); + free(res); + return static_cast(r ? 1.0 : 0.0); + } catch (const std::exception&) { return 0.0; } + }, + value, thresh, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTneTfloatFloatPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "TneTfloatFloatPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return TneTfloatFloatPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TneTintIntPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TneTintIntPhysicalFunction.cpp new file mode 100644 index 0000000000..5b6daac349 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TneTintIntPhysicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +TneTintIntPhysicalFunction::TneTintIntPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(thresholdFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal TneTintIntPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto thresh = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double v, double s, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = fmt::format("{}", static_cast(v)) + "@" + ts_str; + Temporal* temp = tint_in(wkt.c_str()); + if (!temp) return 0.0; + int iv = static_cast(s); + Temporal* res = tne_tint_int(temp, iv); + free(temp); + if (!res) return 0.0; + bool r = tbool_start_value(res); + free(res); + return static_cast(r ? 1.0 : 0.0); + } catch (const std::exception&) { return 0.0; } + }, + value, thresh, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTneTintIntPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "TneTintIntPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return TneTintIntPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-sql-parser/AntlrSQL.g4 b/nes-sql-parser/AntlrSQL.g4 index 0fcbd50d39..527e926cb9 100644 --- a/nes-sql-parser/AntlrSQL.g4 +++ b/nes-sql-parser/AntlrSQL.g4 @@ -295,7 +295,7 @@ timeUnit: MS timestampParameter: name=identifier; -functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT; +functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL; sinkClause: INTO sink (',' sink)*; @@ -688,6 +688,13 @@ TEQ_TBOOL_BOOL: 'TEQ_TBOOL_BOOL' | 'teq_tbool_bool'; TEQ_TEMPORAL_TEMPORAL: 'TEQ_TEMPORAL_TEMPORAL' | 'teq_temporal_temporal'; TEQ_TFLOAT_FLOAT: 'TEQ_TFLOAT_FLOAT' | 'teq_tfloat_float'; TEQ_TINT_INT: 'TEQ_TINT_INT' | 'teq_tint_int'; +TNE_TBOOL_BOOL: 'TNE_TBOOL_BOOL' | 'tne_tbool_bool'; +TNE_BOOL_TBOOL: 'TNE_BOOL_TBOOL' | 'tne_bool_tbool'; +TNE_TFLOAT_FLOAT: 'TNE_TFLOAT_FLOAT' | 'tne_tfloat_float'; +TNE_FLOAT_TFLOAT: 'TNE_FLOAT_TFLOAT' | 'tne_float_tfloat'; +TNE_TINT_INT: 'TNE_TINT_INT' | 'tne_tint_int'; +TNE_INT_TINT: 'TNE_INT_TINT' | 'tne_int_tint'; +TNE_TEMPORAL_TEMPORAL: 'TNE_TEMPORAL_TEMPORAL' | 'tne_temporal_temporal'; WATERMARK: 'WATERMARK' | 'watermark'; OFFSET: 'OFFSET' | 'offset'; LOCALHOST: 'LOCALHOST' | 'localhost'; diff --git a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp index ead24af3c4..62771e8da9 100644 --- a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp +++ b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp @@ -269,6 +269,13 @@ #include #include #include +#include +#include +#include +#include +#include +#include +#include #include #include #include @@ -6825,6 +6832,209 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont }} break; /* END CODEGEN PARSER GLUE: TEQ_TINT_INT */ + /* BEGIN CODEGEN PARSER GLUE: TNE_TBOOL_BOOL */ + case AntlrSQLLexer::TNE_TBOOL_BOOL: + {{ + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("TNE_TBOOL_BOOL requires exactly 3 arguments, but got {{}}", argCount); + + while (!helpers.top().constantBuilder.empty()) + {{ + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + }} + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(TneTboolBoolLogicalFunction(a0, a1, a2)); + }} + break; + /* END CODEGEN PARSER GLUE: TNE_TBOOL_BOOL */ + /* BEGIN CODEGEN PARSER GLUE: TNE_BOOL_TBOOL */ + case AntlrSQLLexer::TNE_BOOL_TBOOL: + {{ + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("TNE_BOOL_TBOOL requires exactly 3 arguments, but got {{}}", argCount); + + while (!helpers.top().constantBuilder.empty()) + {{ + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + }} + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(TneBoolTboolLogicalFunction(a0, a1, a2)); + }} + break; + /* END CODEGEN PARSER GLUE: TNE_BOOL_TBOOL */ + /* BEGIN CODEGEN PARSER GLUE: TNE_TFLOAT_FLOAT */ + case AntlrSQLLexer::TNE_TFLOAT_FLOAT: + {{ + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("TNE_TFLOAT_FLOAT requires exactly 3 arguments, but got {{}}", argCount); + + while (!helpers.top().constantBuilder.empty()) + {{ + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + }} + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(TneTfloatFloatLogicalFunction(a0, a1, a2)); + }} + break; + /* END CODEGEN PARSER GLUE: TNE_TFLOAT_FLOAT */ + /* BEGIN CODEGEN PARSER GLUE: TNE_FLOAT_TFLOAT */ + case AntlrSQLLexer::TNE_FLOAT_TFLOAT: + {{ + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("TNE_FLOAT_TFLOAT requires exactly 3 arguments, but got {{}}", argCount); + + while (!helpers.top().constantBuilder.empty()) + {{ + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + }} + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(TneFloatTfloatLogicalFunction(a0, a1, a2)); + }} + break; + /* END CODEGEN PARSER GLUE: TNE_FLOAT_TFLOAT */ + /* BEGIN CODEGEN PARSER GLUE: TNE_TINT_INT */ + case AntlrSQLLexer::TNE_TINT_INT: + {{ + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("TNE_TINT_INT requires exactly 3 arguments, but got {{}}", argCount); + + while (!helpers.top().constantBuilder.empty()) + {{ + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + }} + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(TneTintIntLogicalFunction(a0, a1, a2)); + }} + break; + /* END CODEGEN PARSER GLUE: TNE_TINT_INT */ + /* BEGIN CODEGEN PARSER GLUE: TNE_INT_TINT */ + case AntlrSQLLexer::TNE_INT_TINT: + {{ + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("TNE_INT_TINT requires exactly 3 arguments, but got {{}}", argCount); + + while (!helpers.top().constantBuilder.empty()) + {{ + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + }} + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(TneIntTintLogicalFunction(a0, a1, a2)); + }} + break; + /* END CODEGEN PARSER GLUE: TNE_INT_TINT */ + /* BEGIN CODEGEN PARSER GLUE: TNE_TEMPORAL_TEMPORAL */ + case AntlrSQLLexer::TNE_TEMPORAL_TEMPORAL: + {{ + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("TNE_TEMPORAL_TEMPORAL requires exactly 3 arguments, but got {{}}", argCount); + + while (!helpers.top().constantBuilder.empty()) + {{ + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + }} + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(TneTemporalTemporalLogicalFunction(a0, a1, a2)); + }} + break; + /* END CODEGEN PARSER GLUE: TNE_TEMPORAL_TEMPORAL */ /* BEGIN CODEGEN PARSER GLUE: ALWAYS_EQ_TFLOAT_FLOAT */ case AntlrSQLLexer::ALWAYS_EQ_TFLOAT_FLOAT: { From 0aae52004e2b94cf37ae1650b76438c307133ee0 Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Fri, 12 Jun 2026 10:57:41 +0200 Subject: [PATCH 37/96] feat(meos): add TGE_{FLOAT_TFLOAT,TFLOAT_FLOAT,INT_TINT,TINT_INT,TEMPORAL_TEMPORAL} NES operators (W88) --- .../Meos/TgeFloatTfloatLogicalFunction.hpp | 54 +++++++ .../Meos/TgeIntTintLogicalFunction.hpp | 54 +++++++ .../TgeTemporalTemporalLogicalFunction.hpp | 54 +++++++ .../Meos/TgeTfloatFloatLogicalFunction.hpp | 54 +++++++ .../Meos/TgeTintIntLogicalFunction.hpp | 54 +++++++ .../src/Functions/Meos/CMakeLists.txt | 5 + .../Meos/TgeFloatTfloatLogicalFunction.cpp | 105 ++++++++++++++ .../Meos/TgeIntTintLogicalFunction.cpp | 105 ++++++++++++++ .../TgeTemporalTemporalLogicalFunction.cpp | 105 ++++++++++++++ .../Meos/TgeTfloatFloatLogicalFunction.cpp | 105 ++++++++++++++ .../Meos/TgeTintIntLogicalFunction.cpp | 105 ++++++++++++++ .../Meos/TgeFloatTfloatPhysicalFunction.hpp | 43 ++++++ .../Meos/TgeIntTintPhysicalFunction.hpp | 43 ++++++ .../TgeTemporalTemporalPhysicalFunction.hpp | 43 ++++++ .../Meos/TgeTfloatFloatPhysicalFunction.hpp | 43 ++++++ .../Meos/TgeTintIntPhysicalFunction.hpp | 43 ++++++ .../src/Functions/Meos/CMakeLists.txt | 5 + .../Meos/TgeFloatTfloatPhysicalFunction.cpp | 92 ++++++++++++ .../Meos/TgeIntTintPhysicalFunction.cpp | 93 ++++++++++++ .../TgeTemporalTemporalPhysicalFunction.cpp | 95 ++++++++++++ .../Meos/TgeTfloatFloatPhysicalFunction.cpp | 92 ++++++++++++ .../Meos/TgeTintIntPhysicalFunction.cpp | 93 ++++++++++++ nes-sql-parser/AntlrSQL.g4 | 7 +- .../src/AntlrSQLQueryPlanCreator.cpp | 135 ++++++++++++++++++ 24 files changed, 1626 insertions(+), 1 deletion(-) create mode 100644 nes-logical-operators/include/Functions/Meos/TgeFloatTfloatLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TgeIntTintLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TgeTemporalTemporalLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TgeTfloatFloatLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TgeTintIntLogicalFunction.hpp create mode 100644 nes-logical-operators/src/Functions/Meos/TgeFloatTfloatLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TgeIntTintLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TgeTemporalTemporalLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TgeTfloatFloatLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TgeTintIntLogicalFunction.cpp create mode 100644 nes-physical-operators/include/Functions/Meos/TgeFloatTfloatPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TgeIntTintPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TgeTemporalTemporalPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TgeTfloatFloatPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TgeTintIntPhysicalFunction.hpp create mode 100644 nes-physical-operators/src/Functions/Meos/TgeFloatTfloatPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TgeIntTintPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TgeTemporalTemporalPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TgeTfloatFloatPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TgeTintIntPhysicalFunction.cpp diff --git a/nes-logical-operators/include/Functions/Meos/TgeFloatTfloatLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TgeFloatTfloatLogicalFunction.hpp new file mode 100644 index 0000000000..f5d29f03b1 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TgeFloatTfloatLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief temporal GE: scalar float vs single-instant tfloat + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `tge_float_tfloat`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class TgeFloatTfloatLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TgeFloatTfloat"; + + TgeFloatTfloatLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TgeIntTintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TgeIntTintLogicalFunction.hpp new file mode 100644 index 0000000000..520ebc852d --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TgeIntTintLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief temporal GE: scalar int vs single-instant tint + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `tge_int_tint`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class TgeIntTintLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TgeIntTint"; + + TgeIntTintLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TgeTemporalTemporalLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TgeTemporalTemporalLogicalFunction.hpp new file mode 100644 index 0000000000..1863d15afb --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TgeTemporalTemporalLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief temporal GE: two single-instant tfloats + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `tge_temporal_temporal`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class TgeTemporalTemporalLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TgeTemporalTemporal"; + + TgeTemporalTemporalLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TgeTfloatFloatLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TgeTfloatFloatLogicalFunction.hpp new file mode 100644 index 0000000000..b503951567 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TgeTfloatFloatLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief temporal GE: single-instant tfloat vs scalar float + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `tge_tfloat_float`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class TgeTfloatFloatLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TgeTfloatFloat"; + + TgeTfloatFloatLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TgeTintIntLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TgeTintIntLogicalFunction.hpp new file mode 100644 index 0000000000..339a944fd6 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TgeTintIntLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief temporal GE: single-instant tint vs scalar int + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `tge_tint_int`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class TgeTintIntLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TgeTintInt"; + + TgeTintIntLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt index 72afd241e5..c1cb0997aa 100644 --- a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt @@ -225,3 +225,8 @@ add_plugin(TneFloatTfloat LogicalFunction nes-logical-operators TneFloatTfloatLo add_plugin(TneTintInt LogicalFunction nes-logical-operators TneTintIntLogicalFunction.cpp) add_plugin(TneIntTint LogicalFunction nes-logical-operators TneIntTintLogicalFunction.cpp) add_plugin(TneTemporalTemporal LogicalFunction nes-logical-operators TneTemporalTemporalLogicalFunction.cpp) +add_plugin(TgeTfloatFloat LogicalFunction nes-logical-operators TgeTfloatFloatLogicalFunction.cpp) +add_plugin(TgeFloatTfloat LogicalFunction nes-logical-operators TgeFloatTfloatLogicalFunction.cpp) +add_plugin(TgeTintInt LogicalFunction nes-logical-operators TgeTintIntLogicalFunction.cpp) +add_plugin(TgeIntTint LogicalFunction nes-logical-operators TgeIntTintLogicalFunction.cpp) +add_plugin(TgeTemporalTemporal LogicalFunction nes-logical-operators TgeTemporalTemporalLogicalFunction.cpp) diff --git a/nes-logical-operators/src/Functions/Meos/TgeFloatTfloatLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TgeFloatTfloatLogicalFunction.cpp new file mode 100644 index 0000000000..1cfed39a8c --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TgeFloatTfloatLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TgeFloatTfloatLogicalFunction::TgeFloatTfloatLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType TgeFloatTfloatLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction TgeFloatTfloatLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector TgeFloatTfloatLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction TgeFloatTfloatLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "TgeFloatTfloatLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view TgeFloatTfloatLogicalFunction::getType() const { return NAME; } + +bool TgeFloatTfloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string TgeFloatTfloatLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TgeFloatTfloatLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction TgeFloatTfloatLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTgeFloatTfloatLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "TgeFloatTfloatLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return TgeFloatTfloatLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TgeIntTintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TgeIntTintLogicalFunction.cpp new file mode 100644 index 0000000000..77941fda80 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TgeIntTintLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TgeIntTintLogicalFunction::TgeIntTintLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType TgeIntTintLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction TgeIntTintLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector TgeIntTintLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction TgeIntTintLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "TgeIntTintLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view TgeIntTintLogicalFunction::getType() const { return NAME; } + +bool TgeIntTintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string TgeIntTintLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TgeIntTintLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction TgeIntTintLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTgeIntTintLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "TgeIntTintLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return TgeIntTintLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TgeTemporalTemporalLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TgeTemporalTemporalLogicalFunction.cpp new file mode 100644 index 0000000000..ff9c31e5c9 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TgeTemporalTemporalLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TgeTemporalTemporalLogicalFunction::TgeTemporalTemporalLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType TgeTemporalTemporalLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction TgeTemporalTemporalLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector TgeTemporalTemporalLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction TgeTemporalTemporalLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "TgeTemporalTemporalLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view TgeTemporalTemporalLogicalFunction::getType() const { return NAME; } + +bool TgeTemporalTemporalLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string TgeTemporalTemporalLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TgeTemporalTemporalLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction TgeTemporalTemporalLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTgeTemporalTemporalLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "TgeTemporalTemporalLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return TgeTemporalTemporalLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TgeTfloatFloatLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TgeTfloatFloatLogicalFunction.cpp new file mode 100644 index 0000000000..448d75c23d --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TgeTfloatFloatLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TgeTfloatFloatLogicalFunction::TgeTfloatFloatLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType TgeTfloatFloatLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction TgeTfloatFloatLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector TgeTfloatFloatLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction TgeTfloatFloatLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "TgeTfloatFloatLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view TgeTfloatFloatLogicalFunction::getType() const { return NAME; } + +bool TgeTfloatFloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string TgeTfloatFloatLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TgeTfloatFloatLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction TgeTfloatFloatLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTgeTfloatFloatLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "TgeTfloatFloatLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return TgeTfloatFloatLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TgeTintIntLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TgeTintIntLogicalFunction.cpp new file mode 100644 index 0000000000..5598f68354 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TgeTintIntLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TgeTintIntLogicalFunction::TgeTintIntLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType TgeTintIntLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction TgeTintIntLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector TgeTintIntLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction TgeTintIntLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "TgeTintIntLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view TgeTintIntLogicalFunction::getType() const { return NAME; } + +bool TgeTintIntLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string TgeTintIntLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TgeTintIntLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction TgeTintIntLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTgeTintIntLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "TgeTintIntLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return TgeTintIntLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TgeFloatTfloatPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TgeFloatTfloatPhysicalFunction.hpp new file mode 100644 index 0000000000..e089b1b7b6 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TgeFloatTfloatPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `tge_float_tfloat`. + * + * temporal GE: scalar float vs single-instant tfloat + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TgeFloatTfloatPhysicalFunction : public PhysicalFunctionConcept { +public: + TgeFloatTfloatPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TgeIntTintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TgeIntTintPhysicalFunction.hpp new file mode 100644 index 0000000000..6b66843036 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TgeIntTintPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `tge_int_tint`. + * + * temporal GE: scalar int vs single-instant tint + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TgeIntTintPhysicalFunction : public PhysicalFunctionConcept { +public: + TgeIntTintPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TgeTemporalTemporalPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TgeTemporalTemporalPhysicalFunction.hpp new file mode 100644 index 0000000000..a3b2075f4e --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TgeTemporalTemporalPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `tge_temporal_temporal`. + * + * temporal GE: two single-instant tfloats + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TgeTemporalTemporalPhysicalFunction : public PhysicalFunctionConcept { +public: + TgeTemporalTemporalPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TgeTfloatFloatPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TgeTfloatFloatPhysicalFunction.hpp new file mode 100644 index 0000000000..b8c3d84730 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TgeTfloatFloatPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `tge_tfloat_float`. + * + * temporal GE: single-instant tfloat vs scalar float + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TgeTfloatFloatPhysicalFunction : public PhysicalFunctionConcept { +public: + TgeTfloatFloatPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TgeTintIntPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TgeTintIntPhysicalFunction.hpp new file mode 100644 index 0000000000..9701a6abd7 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TgeTintIntPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `tge_tint_int`. + * + * temporal GE: single-instant tint vs scalar int + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TgeTintIntPhysicalFunction : public PhysicalFunctionConcept { +public: + TgeTintIntPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt index 7430f3fc05..14266c4da4 100644 --- a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt @@ -224,4 +224,9 @@ add_plugin(TneFloatTfloat PhysicalFunction nes-physical-operators TneFloatTfloat add_plugin(TneTintInt PhysicalFunction nes-physical-operators TneTintIntPhysicalFunction.cpp) add_plugin(TneIntTint PhysicalFunction nes-physical-operators TneIntTintPhysicalFunction.cpp) add_plugin(TneTemporalTemporal PhysicalFunction nes-physical-operators TneTemporalTemporalPhysicalFunction.cpp) +add_plugin(TgeTfloatFloat PhysicalFunction nes-physical-operators TgeTfloatFloatPhysicalFunction.cpp) +add_plugin(TgeFloatTfloat PhysicalFunction nes-physical-operators TgeFloatTfloatPhysicalFunction.cpp) +add_plugin(TgeTintInt PhysicalFunction nes-physical-operators TgeTintIntPhysicalFunction.cpp) +add_plugin(TgeIntTint PhysicalFunction nes-physical-operators TgeIntTintPhysicalFunction.cpp) +add_plugin(TgeTemporalTemporal PhysicalFunction nes-physical-operators TgeTemporalTemporalPhysicalFunction.cpp) endif() diff --git a/nes-physical-operators/src/Functions/Meos/TgeFloatTfloatPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TgeFloatTfloatPhysicalFunction.cpp new file mode 100644 index 0000000000..e32d3c5a60 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TgeFloatTfloatPhysicalFunction.cpp @@ -0,0 +1,92 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +TgeFloatTfloatPhysicalFunction::TgeFloatTfloatPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(thresholdFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal TgeFloatTfloatPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto thresh = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double v, double s, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = fmt::format("{}", s) + "@" + ts_str; + Temporal* temp = tfloat_in(wkt.c_str()); + if (!temp) return 0.0; + Temporal* res = tge_float_tfloat(v, temp); + free(temp); + if (!res) return 0.0; + bool r = tbool_start_value(res); + free(res); + return static_cast(r ? 1.0 : 0.0); + } catch (const std::exception&) { return 0.0; } + }, + value, thresh, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTgeFloatTfloatPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "TgeFloatTfloatPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return TgeFloatTfloatPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TgeIntTintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TgeIntTintPhysicalFunction.cpp new file mode 100644 index 0000000000..7f0f90b816 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TgeIntTintPhysicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +TgeIntTintPhysicalFunction::TgeIntTintPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(thresholdFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal TgeIntTintPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto thresh = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double v, double s, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + int iv = static_cast(v); + std::string wkt = fmt::format("{}", static_cast(s)) + "@" + ts_str; + Temporal* temp = tint_in(wkt.c_str()); + if (!temp) return 0.0; + Temporal* res = tge_int_tint(iv, temp); + free(temp); + if (!res) return 0.0; + bool r = tbool_start_value(res); + free(res); + return static_cast(r ? 1.0 : 0.0); + } catch (const std::exception&) { return 0.0; } + }, + value, thresh, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTgeIntTintPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "TgeIntTintPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return TgeIntTintPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TgeTemporalTemporalPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TgeTemporalTemporalPhysicalFunction.cpp new file mode 100644 index 0000000000..42a791a80d --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TgeTemporalTemporalPhysicalFunction.cpp @@ -0,0 +1,95 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +TgeTemporalTemporalPhysicalFunction::TgeTemporalTemporalPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(thresholdFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal TgeTemporalTemporalPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto thresh = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double v, double s, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt1 = fmt::format("{}", v) + "@" + ts_str; + Temporal* temp1 = tfloat_in(wkt1.c_str()); + if (!temp1) return 0.0; + std::string wkt2 = fmt::format("{}", s) + "@" + ts_str; + Temporal* temp2 = tfloat_in(wkt2.c_str()); + if (!temp2) { free(temp1); return 0.0; } + Temporal* res = tge_temporal_temporal(temp1, temp2); + free(temp1); free(temp2); + if (!res) return 0.0; + bool r = tbool_start_value(res); + free(res); + return static_cast(r ? 1.0 : 0.0); + } catch (const std::exception&) { return 0.0; } + }, + value, thresh, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTgeTemporalTemporalPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "TgeTemporalTemporalPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return TgeTemporalTemporalPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TgeTfloatFloatPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TgeTfloatFloatPhysicalFunction.cpp new file mode 100644 index 0000000000..88ef7cd166 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TgeTfloatFloatPhysicalFunction.cpp @@ -0,0 +1,92 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +TgeTfloatFloatPhysicalFunction::TgeTfloatFloatPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(thresholdFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal TgeTfloatFloatPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto thresh = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double v, double s, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = fmt::format("{}", v) + "@" + ts_str; + Temporal* temp = tfloat_in(wkt.c_str()); + if (!temp) return 0.0; + Temporal* res = tge_tfloat_float(temp, s); + free(temp); + if (!res) return 0.0; + bool r = tbool_start_value(res); + free(res); + return static_cast(r ? 1.0 : 0.0); + } catch (const std::exception&) { return 0.0; } + }, + value, thresh, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTgeTfloatFloatPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "TgeTfloatFloatPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return TgeTfloatFloatPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TgeTintIntPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TgeTintIntPhysicalFunction.cpp new file mode 100644 index 0000000000..ac371f4b9f --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TgeTintIntPhysicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +TgeTintIntPhysicalFunction::TgeTintIntPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(thresholdFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal TgeTintIntPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto thresh = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double v, double s, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = fmt::format("{}", static_cast(v)) + "@" + ts_str; + Temporal* temp = tint_in(wkt.c_str()); + if (!temp) return 0.0; + int iv = static_cast(s); + Temporal* res = tge_tint_int(temp, iv); + free(temp); + if (!res) return 0.0; + bool r = tbool_start_value(res); + free(res); + return static_cast(r ? 1.0 : 0.0); + } catch (const std::exception&) { return 0.0; } + }, + value, thresh, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTgeTintIntPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "TgeTintIntPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return TgeTintIntPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-sql-parser/AntlrSQL.g4 b/nes-sql-parser/AntlrSQL.g4 index 527e926cb9..cc4518b9cf 100644 --- a/nes-sql-parser/AntlrSQL.g4 +++ b/nes-sql-parser/AntlrSQL.g4 @@ -295,7 +295,7 @@ timeUnit: MS timestampParameter: name=identifier; -functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL; +functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL; sinkClause: INTO sink (',' sink)*; @@ -695,6 +695,11 @@ TNE_FLOAT_TFLOAT: 'TNE_FLOAT_TFLOAT' | 'tne_float_tfloat'; TNE_TINT_INT: 'TNE_TINT_INT' | 'tne_tint_int'; TNE_INT_TINT: 'TNE_INT_TINT' | 'tne_int_tint'; TNE_TEMPORAL_TEMPORAL: 'TNE_TEMPORAL_TEMPORAL' | 'tne_temporal_temporal'; +TGE_TFLOAT_FLOAT: 'TGE_TFLOAT_FLOAT' | 'tge_tfloat_float'; +TGE_FLOAT_TFLOAT: 'TGE_FLOAT_TFLOAT' | 'tge_float_tfloat'; +TGE_TINT_INT: 'TGE_TINT_INT' | 'tge_tint_int'; +TGE_INT_TINT: 'TGE_INT_TINT' | 'tge_int_tint'; +TGE_TEMPORAL_TEMPORAL: 'TGE_TEMPORAL_TEMPORAL' | 'tge_temporal_temporal'; WATERMARK: 'WATERMARK' | 'watermark'; OFFSET: 'OFFSET' | 'offset'; LOCALHOST: 'LOCALHOST' | 'localhost'; diff --git a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp index 62771e8da9..c45ea20dd3 100644 --- a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp +++ b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp @@ -276,6 +276,11 @@ #include #include #include +#include +#include +#include +#include +#include #include #include #include @@ -7035,6 +7040,136 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont }} break; /* END CODEGEN PARSER GLUE: TNE_TEMPORAL_TEMPORAL */ + /* BEGIN CODEGEN PARSER GLUE: TGE_TFLOAT_FLOAT */ + case AntlrSQLLexer::TGE_TFLOAT_FLOAT: + {{ + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("TGE_TFLOAT_FLOAT requires exactly 3 arguments, but got {{}}", argCount); + while (!helpers.top().constantBuilder.empty()) + {{ + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + }} + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + helpers.top().functionBuilder.emplace_back(TgeTfloatFloatLogicalFunction(a0, a1, a2)); + }} + break; + /* END CODEGEN PARSER GLUE: TGE_TFLOAT_FLOAT */ + /* BEGIN CODEGEN PARSER GLUE: TGE_FLOAT_TFLOAT */ + case AntlrSQLLexer::TGE_FLOAT_TFLOAT: + {{ + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("TGE_FLOAT_TFLOAT requires exactly 3 arguments, but got {{}}", argCount); + while (!helpers.top().constantBuilder.empty()) + {{ + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + }} + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + helpers.top().functionBuilder.emplace_back(TgeFloatTfloatLogicalFunction(a0, a1, a2)); + }} + break; + /* END CODEGEN PARSER GLUE: TGE_FLOAT_TFLOAT */ + /* BEGIN CODEGEN PARSER GLUE: TGE_TINT_INT */ + case AntlrSQLLexer::TGE_TINT_INT: + {{ + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("TGE_TINT_INT requires exactly 3 arguments, but got {{}}", argCount); + while (!helpers.top().constantBuilder.empty()) + {{ + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + }} + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + helpers.top().functionBuilder.emplace_back(TgeTintIntLogicalFunction(a0, a1, a2)); + }} + break; + /* END CODEGEN PARSER GLUE: TGE_TINT_INT */ + /* BEGIN CODEGEN PARSER GLUE: TGE_INT_TINT */ + case AntlrSQLLexer::TGE_INT_TINT: + {{ + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("TGE_INT_TINT requires exactly 3 arguments, but got {{}}", argCount); + while (!helpers.top().constantBuilder.empty()) + {{ + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + }} + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + helpers.top().functionBuilder.emplace_back(TgeIntTintLogicalFunction(a0, a1, a2)); + }} + break; + /* END CODEGEN PARSER GLUE: TGE_INT_TINT */ + /* BEGIN CODEGEN PARSER GLUE: TGE_TEMPORAL_TEMPORAL */ + case AntlrSQLLexer::TGE_TEMPORAL_TEMPORAL: + {{ + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("TGE_TEMPORAL_TEMPORAL requires exactly 3 arguments, but got {{}}", argCount); + while (!helpers.top().constantBuilder.empty()) + {{ + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + }} + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + helpers.top().functionBuilder.emplace_back(TgeTemporalTemporalLogicalFunction(a0, a1, a2)); + }} + break; + /* END CODEGEN PARSER GLUE: TGE_TEMPORAL_TEMPORAL */ /* BEGIN CODEGEN PARSER GLUE: ALWAYS_EQ_TFLOAT_FLOAT */ case AntlrSQLLexer::ALWAYS_EQ_TFLOAT_FLOAT: { From b1bcc1cc447db1fe47b9063f89369640051b36df Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Fri, 12 Jun 2026 10:58:12 +0200 Subject: [PATCH 38/96] feat(meos): add TGT_{FLOAT_TFLOAT,TFLOAT_FLOAT,INT_TINT,TINT_INT,TEMPORAL_TEMPORAL} NES operators (W89) --- .../Meos/TgtFloatTfloatLogicalFunction.hpp | 54 +++++++ .../Meos/TgtIntTintLogicalFunction.hpp | 54 +++++++ .../TgtTemporalTemporalLogicalFunction.hpp | 54 +++++++ .../Meos/TgtTfloatFloatLogicalFunction.hpp | 54 +++++++ .../Meos/TgtTintIntLogicalFunction.hpp | 54 +++++++ .../src/Functions/Meos/CMakeLists.txt | 5 + .../Meos/TgtFloatTfloatLogicalFunction.cpp | 105 ++++++++++++++ .../Meos/TgtIntTintLogicalFunction.cpp | 105 ++++++++++++++ .../TgtTemporalTemporalLogicalFunction.cpp | 105 ++++++++++++++ .../Meos/TgtTfloatFloatLogicalFunction.cpp | 105 ++++++++++++++ .../Meos/TgtTintIntLogicalFunction.cpp | 105 ++++++++++++++ .../Meos/TgtFloatTfloatPhysicalFunction.hpp | 43 ++++++ .../Meos/TgtIntTintPhysicalFunction.hpp | 43 ++++++ .../TgtTemporalTemporalPhysicalFunction.hpp | 43 ++++++ .../Meos/TgtTfloatFloatPhysicalFunction.hpp | 43 ++++++ .../Meos/TgtTintIntPhysicalFunction.hpp | 43 ++++++ .../src/Functions/Meos/CMakeLists.txt | 5 + .../Meos/TgtFloatTfloatPhysicalFunction.cpp | 92 ++++++++++++ .../Meos/TgtIntTintPhysicalFunction.cpp | 93 ++++++++++++ .../TgtTemporalTemporalPhysicalFunction.cpp | 95 ++++++++++++ .../Meos/TgtTfloatFloatPhysicalFunction.cpp | 92 ++++++++++++ .../Meos/TgtTintIntPhysicalFunction.cpp | 93 ++++++++++++ nes-sql-parser/AntlrSQL.g4 | 7 +- .../src/AntlrSQLQueryPlanCreator.cpp | 135 ++++++++++++++++++ 24 files changed, 1626 insertions(+), 1 deletion(-) create mode 100644 nes-logical-operators/include/Functions/Meos/TgtFloatTfloatLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TgtIntTintLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TgtTemporalTemporalLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TgtTfloatFloatLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TgtTintIntLogicalFunction.hpp create mode 100644 nes-logical-operators/src/Functions/Meos/TgtFloatTfloatLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TgtIntTintLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TgtTemporalTemporalLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TgtTfloatFloatLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TgtTintIntLogicalFunction.cpp create mode 100644 nes-physical-operators/include/Functions/Meos/TgtFloatTfloatPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TgtIntTintPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TgtTemporalTemporalPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TgtTfloatFloatPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TgtTintIntPhysicalFunction.hpp create mode 100644 nes-physical-operators/src/Functions/Meos/TgtFloatTfloatPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TgtIntTintPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TgtTemporalTemporalPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TgtTfloatFloatPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TgtTintIntPhysicalFunction.cpp diff --git a/nes-logical-operators/include/Functions/Meos/TgtFloatTfloatLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TgtFloatTfloatLogicalFunction.hpp new file mode 100644 index 0000000000..a09af69ddf --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TgtFloatTfloatLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief temporal GT: scalar float vs single-instant tfloat + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `tgt_float_tfloat`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class TgtFloatTfloatLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TgtFloatTfloat"; + + TgtFloatTfloatLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TgtIntTintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TgtIntTintLogicalFunction.hpp new file mode 100644 index 0000000000..45e8c6bdea --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TgtIntTintLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief temporal GT: scalar int vs single-instant tint + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `tgt_int_tint`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class TgtIntTintLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TgtIntTint"; + + TgtIntTintLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TgtTemporalTemporalLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TgtTemporalTemporalLogicalFunction.hpp new file mode 100644 index 0000000000..3fb1475804 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TgtTemporalTemporalLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief temporal GT: two single-instant tfloats + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `tgt_temporal_temporal`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class TgtTemporalTemporalLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TgtTemporalTemporal"; + + TgtTemporalTemporalLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TgtTfloatFloatLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TgtTfloatFloatLogicalFunction.hpp new file mode 100644 index 0000000000..c3edc575a6 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TgtTfloatFloatLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief temporal GT: single-instant tfloat vs scalar float + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `tgt_tfloat_float`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class TgtTfloatFloatLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TgtTfloatFloat"; + + TgtTfloatFloatLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TgtTintIntLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TgtTintIntLogicalFunction.hpp new file mode 100644 index 0000000000..150853283a --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TgtTintIntLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief temporal GT: single-instant tint vs scalar int + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `tgt_tint_int`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class TgtTintIntLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TgtTintInt"; + + TgtTintIntLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt index c1cb0997aa..360798a2c2 100644 --- a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt @@ -230,3 +230,8 @@ add_plugin(TgeFloatTfloat LogicalFunction nes-logical-operators TgeFloatTfloatLo add_plugin(TgeTintInt LogicalFunction nes-logical-operators TgeTintIntLogicalFunction.cpp) add_plugin(TgeIntTint LogicalFunction nes-logical-operators TgeIntTintLogicalFunction.cpp) add_plugin(TgeTemporalTemporal LogicalFunction nes-logical-operators TgeTemporalTemporalLogicalFunction.cpp) +add_plugin(TgtTfloatFloat LogicalFunction nes-logical-operators TgtTfloatFloatLogicalFunction.cpp) +add_plugin(TgtFloatTfloat LogicalFunction nes-logical-operators TgtFloatTfloatLogicalFunction.cpp) +add_plugin(TgtTintInt LogicalFunction nes-logical-operators TgtTintIntLogicalFunction.cpp) +add_plugin(TgtIntTint LogicalFunction nes-logical-operators TgtIntTintLogicalFunction.cpp) +add_plugin(TgtTemporalTemporal LogicalFunction nes-logical-operators TgtTemporalTemporalLogicalFunction.cpp) diff --git a/nes-logical-operators/src/Functions/Meos/TgtFloatTfloatLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TgtFloatTfloatLogicalFunction.cpp new file mode 100644 index 0000000000..cfa410e6f1 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TgtFloatTfloatLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TgtFloatTfloatLogicalFunction::TgtFloatTfloatLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType TgtFloatTfloatLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction TgtFloatTfloatLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector TgtFloatTfloatLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction TgtFloatTfloatLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "TgtFloatTfloatLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view TgtFloatTfloatLogicalFunction::getType() const { return NAME; } + +bool TgtFloatTfloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string TgtFloatTfloatLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TgtFloatTfloatLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction TgtFloatTfloatLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTgtFloatTfloatLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "TgtFloatTfloatLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return TgtFloatTfloatLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TgtIntTintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TgtIntTintLogicalFunction.cpp new file mode 100644 index 0000000000..9a7e98afbf --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TgtIntTintLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TgtIntTintLogicalFunction::TgtIntTintLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType TgtIntTintLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction TgtIntTintLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector TgtIntTintLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction TgtIntTintLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "TgtIntTintLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view TgtIntTintLogicalFunction::getType() const { return NAME; } + +bool TgtIntTintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string TgtIntTintLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TgtIntTintLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction TgtIntTintLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTgtIntTintLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "TgtIntTintLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return TgtIntTintLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TgtTemporalTemporalLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TgtTemporalTemporalLogicalFunction.cpp new file mode 100644 index 0000000000..28fb2ab498 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TgtTemporalTemporalLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TgtTemporalTemporalLogicalFunction::TgtTemporalTemporalLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType TgtTemporalTemporalLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction TgtTemporalTemporalLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector TgtTemporalTemporalLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction TgtTemporalTemporalLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "TgtTemporalTemporalLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view TgtTemporalTemporalLogicalFunction::getType() const { return NAME; } + +bool TgtTemporalTemporalLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string TgtTemporalTemporalLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TgtTemporalTemporalLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction TgtTemporalTemporalLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTgtTemporalTemporalLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "TgtTemporalTemporalLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return TgtTemporalTemporalLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TgtTfloatFloatLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TgtTfloatFloatLogicalFunction.cpp new file mode 100644 index 0000000000..248fc1010f --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TgtTfloatFloatLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TgtTfloatFloatLogicalFunction::TgtTfloatFloatLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType TgtTfloatFloatLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction TgtTfloatFloatLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector TgtTfloatFloatLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction TgtTfloatFloatLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "TgtTfloatFloatLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view TgtTfloatFloatLogicalFunction::getType() const { return NAME; } + +bool TgtTfloatFloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string TgtTfloatFloatLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TgtTfloatFloatLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction TgtTfloatFloatLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTgtTfloatFloatLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "TgtTfloatFloatLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return TgtTfloatFloatLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TgtTintIntLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TgtTintIntLogicalFunction.cpp new file mode 100644 index 0000000000..03c55b400a --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TgtTintIntLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TgtTintIntLogicalFunction::TgtTintIntLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType TgtTintIntLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction TgtTintIntLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector TgtTintIntLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction TgtTintIntLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "TgtTintIntLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view TgtTintIntLogicalFunction::getType() const { return NAME; } + +bool TgtTintIntLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string TgtTintIntLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TgtTintIntLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction TgtTintIntLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTgtTintIntLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "TgtTintIntLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return TgtTintIntLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TgtFloatTfloatPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TgtFloatTfloatPhysicalFunction.hpp new file mode 100644 index 0000000000..101111008c --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TgtFloatTfloatPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `tgt_float_tfloat`. + * + * temporal GT: scalar float vs single-instant tfloat + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TgtFloatTfloatPhysicalFunction : public PhysicalFunctionConcept { +public: + TgtFloatTfloatPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TgtIntTintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TgtIntTintPhysicalFunction.hpp new file mode 100644 index 0000000000..792f1bf20c --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TgtIntTintPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `tgt_int_tint`. + * + * temporal GT: scalar int vs single-instant tint + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TgtIntTintPhysicalFunction : public PhysicalFunctionConcept { +public: + TgtIntTintPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TgtTemporalTemporalPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TgtTemporalTemporalPhysicalFunction.hpp new file mode 100644 index 0000000000..6b4cd4889d --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TgtTemporalTemporalPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `tgt_temporal_temporal`. + * + * temporal GT: two single-instant tfloats + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TgtTemporalTemporalPhysicalFunction : public PhysicalFunctionConcept { +public: + TgtTemporalTemporalPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TgtTfloatFloatPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TgtTfloatFloatPhysicalFunction.hpp new file mode 100644 index 0000000000..1bc69bbba9 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TgtTfloatFloatPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `tgt_tfloat_float`. + * + * temporal GT: single-instant tfloat vs scalar float + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TgtTfloatFloatPhysicalFunction : public PhysicalFunctionConcept { +public: + TgtTfloatFloatPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TgtTintIntPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TgtTintIntPhysicalFunction.hpp new file mode 100644 index 0000000000..1f0f388683 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TgtTintIntPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `tgt_tint_int`. + * + * temporal GT: single-instant tint vs scalar int + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TgtTintIntPhysicalFunction : public PhysicalFunctionConcept { +public: + TgtTintIntPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt index 14266c4da4..c115a6726e 100644 --- a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt @@ -229,4 +229,9 @@ add_plugin(TgeFloatTfloat PhysicalFunction nes-physical-operators TgeFloatTfloat add_plugin(TgeTintInt PhysicalFunction nes-physical-operators TgeTintIntPhysicalFunction.cpp) add_plugin(TgeIntTint PhysicalFunction nes-physical-operators TgeIntTintPhysicalFunction.cpp) add_plugin(TgeTemporalTemporal PhysicalFunction nes-physical-operators TgeTemporalTemporalPhysicalFunction.cpp) +add_plugin(TgtTfloatFloat PhysicalFunction nes-physical-operators TgtTfloatFloatPhysicalFunction.cpp) +add_plugin(TgtFloatTfloat PhysicalFunction nes-physical-operators TgtFloatTfloatPhysicalFunction.cpp) +add_plugin(TgtTintInt PhysicalFunction nes-physical-operators TgtTintIntPhysicalFunction.cpp) +add_plugin(TgtIntTint PhysicalFunction nes-physical-operators TgtIntTintPhysicalFunction.cpp) +add_plugin(TgtTemporalTemporal PhysicalFunction nes-physical-operators TgtTemporalTemporalPhysicalFunction.cpp) endif() diff --git a/nes-physical-operators/src/Functions/Meos/TgtFloatTfloatPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TgtFloatTfloatPhysicalFunction.cpp new file mode 100644 index 0000000000..aa730bdfff --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TgtFloatTfloatPhysicalFunction.cpp @@ -0,0 +1,92 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +TgtFloatTfloatPhysicalFunction::TgtFloatTfloatPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(thresholdFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal TgtFloatTfloatPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto thresh = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double v, double s, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = fmt::format("{}", s) + "@" + ts_str; + Temporal* temp = tfloat_in(wkt.c_str()); + if (!temp) return 0.0; + Temporal* res = tgt_float_tfloat(v, temp); + free(temp); + if (!res) return 0.0; + bool r = tbool_start_value(res); + free(res); + return static_cast(r ? 1.0 : 0.0); + } catch (const std::exception&) { return 0.0; } + }, + value, thresh, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTgtFloatTfloatPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "TgtFloatTfloatPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return TgtFloatTfloatPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TgtIntTintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TgtIntTintPhysicalFunction.cpp new file mode 100644 index 0000000000..b90ecefb11 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TgtIntTintPhysicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +TgtIntTintPhysicalFunction::TgtIntTintPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(thresholdFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal TgtIntTintPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto thresh = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double v, double s, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + int iv = static_cast(v); + std::string wkt = fmt::format("{}", static_cast(s)) + "@" + ts_str; + Temporal* temp = tint_in(wkt.c_str()); + if (!temp) return 0.0; + Temporal* res = tgt_int_tint(iv, temp); + free(temp); + if (!res) return 0.0; + bool r = tbool_start_value(res); + free(res); + return static_cast(r ? 1.0 : 0.0); + } catch (const std::exception&) { return 0.0; } + }, + value, thresh, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTgtIntTintPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "TgtIntTintPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return TgtIntTintPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TgtTemporalTemporalPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TgtTemporalTemporalPhysicalFunction.cpp new file mode 100644 index 0000000000..8ebbf0a415 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TgtTemporalTemporalPhysicalFunction.cpp @@ -0,0 +1,95 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +TgtTemporalTemporalPhysicalFunction::TgtTemporalTemporalPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(thresholdFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal TgtTemporalTemporalPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto thresh = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double v, double s, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt1 = fmt::format("{}", v) + "@" + ts_str; + Temporal* temp1 = tfloat_in(wkt1.c_str()); + if (!temp1) return 0.0; + std::string wkt2 = fmt::format("{}", s) + "@" + ts_str; + Temporal* temp2 = tfloat_in(wkt2.c_str()); + if (!temp2) { free(temp1); return 0.0; } + Temporal* res = tgt_temporal_temporal(temp1, temp2); + free(temp1); free(temp2); + if (!res) return 0.0; + bool r = tbool_start_value(res); + free(res); + return static_cast(r ? 1.0 : 0.0); + } catch (const std::exception&) { return 0.0; } + }, + value, thresh, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTgtTemporalTemporalPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "TgtTemporalTemporalPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return TgtTemporalTemporalPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TgtTfloatFloatPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TgtTfloatFloatPhysicalFunction.cpp new file mode 100644 index 0000000000..18b7af8a43 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TgtTfloatFloatPhysicalFunction.cpp @@ -0,0 +1,92 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +TgtTfloatFloatPhysicalFunction::TgtTfloatFloatPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(thresholdFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal TgtTfloatFloatPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto thresh = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double v, double s, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = fmt::format("{}", v) + "@" + ts_str; + Temporal* temp = tfloat_in(wkt.c_str()); + if (!temp) return 0.0; + Temporal* res = tgt_tfloat_float(temp, s); + free(temp); + if (!res) return 0.0; + bool r = tbool_start_value(res); + free(res); + return static_cast(r ? 1.0 : 0.0); + } catch (const std::exception&) { return 0.0; } + }, + value, thresh, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTgtTfloatFloatPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "TgtTfloatFloatPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return TgtTfloatFloatPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TgtTintIntPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TgtTintIntPhysicalFunction.cpp new file mode 100644 index 0000000000..dd128e2716 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TgtTintIntPhysicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +TgtTintIntPhysicalFunction::TgtTintIntPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(thresholdFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal TgtTintIntPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto thresh = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double v, double s, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = fmt::format("{}", static_cast(v)) + "@" + ts_str; + Temporal* temp = tint_in(wkt.c_str()); + if (!temp) return 0.0; + int iv = static_cast(s); + Temporal* res = tgt_tint_int(temp, iv); + free(temp); + if (!res) return 0.0; + bool r = tbool_start_value(res); + free(res); + return static_cast(r ? 1.0 : 0.0); + } catch (const std::exception&) { return 0.0; } + }, + value, thresh, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTgtTintIntPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "TgtTintIntPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return TgtTintIntPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-sql-parser/AntlrSQL.g4 b/nes-sql-parser/AntlrSQL.g4 index cc4518b9cf..15a1bf5d5a 100644 --- a/nes-sql-parser/AntlrSQL.g4 +++ b/nes-sql-parser/AntlrSQL.g4 @@ -295,7 +295,7 @@ timeUnit: MS timestampParameter: name=identifier; -functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL; +functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL; sinkClause: INTO sink (',' sink)*; @@ -700,6 +700,11 @@ TGE_FLOAT_TFLOAT: 'TGE_FLOAT_TFLOAT' | 'tge_float_tfloat'; TGE_TINT_INT: 'TGE_TINT_INT' | 'tge_tint_int'; TGE_INT_TINT: 'TGE_INT_TINT' | 'tge_int_tint'; TGE_TEMPORAL_TEMPORAL: 'TGE_TEMPORAL_TEMPORAL' | 'tge_temporal_temporal'; +TGT_TFLOAT_FLOAT: 'TGT_TFLOAT_FLOAT' | 'tgt_tfloat_float'; +TGT_FLOAT_TFLOAT: 'TGT_FLOAT_TFLOAT' | 'tgt_float_tfloat'; +TGT_TINT_INT: 'TGT_TINT_INT' | 'tgt_tint_int'; +TGT_INT_TINT: 'TGT_INT_TINT' | 'tgt_int_tint'; +TGT_TEMPORAL_TEMPORAL: 'TGT_TEMPORAL_TEMPORAL' | 'tgt_temporal_temporal'; WATERMARK: 'WATERMARK' | 'watermark'; OFFSET: 'OFFSET' | 'offset'; LOCALHOST: 'LOCALHOST' | 'localhost'; diff --git a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp index c45ea20dd3..e2097d915c 100644 --- a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp +++ b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp @@ -281,6 +281,11 @@ #include #include #include +#include +#include +#include +#include +#include #include #include #include @@ -7170,6 +7175,136 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont }} break; /* END CODEGEN PARSER GLUE: TGE_TEMPORAL_TEMPORAL */ + /* BEGIN CODEGEN PARSER GLUE: TGT_TFLOAT_FLOAT */ + case AntlrSQLLexer::TGT_TFLOAT_FLOAT: + {{ + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("TGT_TFLOAT_FLOAT requires exactly 3 arguments, but got {{}}", argCount); + while (!helpers.top().constantBuilder.empty()) + {{ + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + }} + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + helpers.top().functionBuilder.emplace_back(TgtTfloatFloatLogicalFunction(a0, a1, a2)); + }} + break; + /* END CODEGEN PARSER GLUE: TGT_TFLOAT_FLOAT */ + /* BEGIN CODEGEN PARSER GLUE: TGT_FLOAT_TFLOAT */ + case AntlrSQLLexer::TGT_FLOAT_TFLOAT: + {{ + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("TGT_FLOAT_TFLOAT requires exactly 3 arguments, but got {{}}", argCount); + while (!helpers.top().constantBuilder.empty()) + {{ + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + }} + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + helpers.top().functionBuilder.emplace_back(TgtFloatTfloatLogicalFunction(a0, a1, a2)); + }} + break; + /* END CODEGEN PARSER GLUE: TGT_FLOAT_TFLOAT */ + /* BEGIN CODEGEN PARSER GLUE: TGT_TINT_INT */ + case AntlrSQLLexer::TGT_TINT_INT: + {{ + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("TGT_TINT_INT requires exactly 3 arguments, but got {{}}", argCount); + while (!helpers.top().constantBuilder.empty()) + {{ + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + }} + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + helpers.top().functionBuilder.emplace_back(TgtTintIntLogicalFunction(a0, a1, a2)); + }} + break; + /* END CODEGEN PARSER GLUE: TGT_TINT_INT */ + /* BEGIN CODEGEN PARSER GLUE: TGT_INT_TINT */ + case AntlrSQLLexer::TGT_INT_TINT: + {{ + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("TGT_INT_TINT requires exactly 3 arguments, but got {{}}", argCount); + while (!helpers.top().constantBuilder.empty()) + {{ + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + }} + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + helpers.top().functionBuilder.emplace_back(TgtIntTintLogicalFunction(a0, a1, a2)); + }} + break; + /* END CODEGEN PARSER GLUE: TGT_INT_TINT */ + /* BEGIN CODEGEN PARSER GLUE: TGT_TEMPORAL_TEMPORAL */ + case AntlrSQLLexer::TGT_TEMPORAL_TEMPORAL: + {{ + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("TGT_TEMPORAL_TEMPORAL requires exactly 3 arguments, but got {{}}", argCount); + while (!helpers.top().constantBuilder.empty()) + {{ + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + }} + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + helpers.top().functionBuilder.emplace_back(TgtTemporalTemporalLogicalFunction(a0, a1, a2)); + }} + break; + /* END CODEGEN PARSER GLUE: TGT_TEMPORAL_TEMPORAL */ /* BEGIN CODEGEN PARSER GLUE: ALWAYS_EQ_TFLOAT_FLOAT */ case AntlrSQLLexer::ALWAYS_EQ_TFLOAT_FLOAT: { From 79234ff127bd16d242e95bb7b9cfc015f0f533ac Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Fri, 12 Jun 2026 10:58:40 +0200 Subject: [PATCH 39/96] feat(meos): add TLE_{FLOAT_TFLOAT,TFLOAT_FLOAT,INT_TINT,TINT_INT,TEMPORAL_TEMPORAL} NES operators (W90) --- .../Meos/TleFloatTfloatLogicalFunction.hpp | 54 +++++++ .../Meos/TleIntTintLogicalFunction.hpp | 54 +++++++ .../TleTemporalTemporalLogicalFunction.hpp | 54 +++++++ .../Meos/TleTfloatFloatLogicalFunction.hpp | 54 +++++++ .../Meos/TleTintIntLogicalFunction.hpp | 54 +++++++ .../src/Functions/Meos/CMakeLists.txt | 5 + .../Meos/TleFloatTfloatLogicalFunction.cpp | 105 ++++++++++++++ .../Meos/TleIntTintLogicalFunction.cpp | 105 ++++++++++++++ .../TleTemporalTemporalLogicalFunction.cpp | 105 ++++++++++++++ .../Meos/TleTfloatFloatLogicalFunction.cpp | 105 ++++++++++++++ .../Meos/TleTintIntLogicalFunction.cpp | 105 ++++++++++++++ .../Meos/TleFloatTfloatPhysicalFunction.hpp | 43 ++++++ .../Meos/TleIntTintPhysicalFunction.hpp | 43 ++++++ .../TleTemporalTemporalPhysicalFunction.hpp | 43 ++++++ .../Meos/TleTfloatFloatPhysicalFunction.hpp | 43 ++++++ .../Meos/TleTintIntPhysicalFunction.hpp | 43 ++++++ .../src/Functions/Meos/CMakeLists.txt | 5 + .../Meos/TleFloatTfloatPhysicalFunction.cpp | 92 ++++++++++++ .../Meos/TleIntTintPhysicalFunction.cpp | 93 ++++++++++++ .../TleTemporalTemporalPhysicalFunction.cpp | 95 ++++++++++++ .../Meos/TleTfloatFloatPhysicalFunction.cpp | 92 ++++++++++++ .../Meos/TleTintIntPhysicalFunction.cpp | 93 ++++++++++++ nes-sql-parser/AntlrSQL.g4 | 7 +- .../src/AntlrSQLQueryPlanCreator.cpp | 135 ++++++++++++++++++ 24 files changed, 1626 insertions(+), 1 deletion(-) create mode 100644 nes-logical-operators/include/Functions/Meos/TleFloatTfloatLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TleIntTintLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TleTemporalTemporalLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TleTfloatFloatLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TleTintIntLogicalFunction.hpp create mode 100644 nes-logical-operators/src/Functions/Meos/TleFloatTfloatLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TleIntTintLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TleTemporalTemporalLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TleTfloatFloatLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TleTintIntLogicalFunction.cpp create mode 100644 nes-physical-operators/include/Functions/Meos/TleFloatTfloatPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TleIntTintPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TleTemporalTemporalPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TleTfloatFloatPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TleTintIntPhysicalFunction.hpp create mode 100644 nes-physical-operators/src/Functions/Meos/TleFloatTfloatPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TleIntTintPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TleTemporalTemporalPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TleTfloatFloatPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TleTintIntPhysicalFunction.cpp diff --git a/nes-logical-operators/include/Functions/Meos/TleFloatTfloatLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TleFloatTfloatLogicalFunction.hpp new file mode 100644 index 0000000000..b1fd622e7b --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TleFloatTfloatLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief temporal LE: scalar float vs single-instant tfloat + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `tle_float_tfloat`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class TleFloatTfloatLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TleFloatTfloat"; + + TleFloatTfloatLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TleIntTintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TleIntTintLogicalFunction.hpp new file mode 100644 index 0000000000..8d1d9f8d1e --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TleIntTintLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief temporal LE: scalar int vs single-instant tint + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `tle_int_tint`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class TleIntTintLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TleIntTint"; + + TleIntTintLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TleTemporalTemporalLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TleTemporalTemporalLogicalFunction.hpp new file mode 100644 index 0000000000..cf826911e5 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TleTemporalTemporalLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief temporal LE: two single-instant tfloats + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `tle_temporal_temporal`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class TleTemporalTemporalLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TleTemporalTemporal"; + + TleTemporalTemporalLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TleTfloatFloatLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TleTfloatFloatLogicalFunction.hpp new file mode 100644 index 0000000000..7b61305728 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TleTfloatFloatLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief temporal LE: single-instant tfloat vs scalar float + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `tle_tfloat_float`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class TleTfloatFloatLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TleTfloatFloat"; + + TleTfloatFloatLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TleTintIntLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TleTintIntLogicalFunction.hpp new file mode 100644 index 0000000000..ef0f527ed5 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TleTintIntLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief temporal LE: single-instant tint vs scalar int + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `tle_tint_int`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class TleTintIntLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TleTintInt"; + + TleTintIntLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt index 360798a2c2..8904abe40a 100644 --- a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt @@ -235,3 +235,8 @@ add_plugin(TgtFloatTfloat LogicalFunction nes-logical-operators TgtFloatTfloatLo add_plugin(TgtTintInt LogicalFunction nes-logical-operators TgtTintIntLogicalFunction.cpp) add_plugin(TgtIntTint LogicalFunction nes-logical-operators TgtIntTintLogicalFunction.cpp) add_plugin(TgtTemporalTemporal LogicalFunction nes-logical-operators TgtTemporalTemporalLogicalFunction.cpp) +add_plugin(TleTfloatFloat LogicalFunction nes-logical-operators TleTfloatFloatLogicalFunction.cpp) +add_plugin(TleFloatTfloat LogicalFunction nes-logical-operators TleFloatTfloatLogicalFunction.cpp) +add_plugin(TleTintInt LogicalFunction nes-logical-operators TleTintIntLogicalFunction.cpp) +add_plugin(TleIntTint LogicalFunction nes-logical-operators TleIntTintLogicalFunction.cpp) +add_plugin(TleTemporalTemporal LogicalFunction nes-logical-operators TleTemporalTemporalLogicalFunction.cpp) diff --git a/nes-logical-operators/src/Functions/Meos/TleFloatTfloatLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TleFloatTfloatLogicalFunction.cpp new file mode 100644 index 0000000000..d38e8db5b8 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TleFloatTfloatLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TleFloatTfloatLogicalFunction::TleFloatTfloatLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType TleFloatTfloatLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction TleFloatTfloatLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector TleFloatTfloatLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction TleFloatTfloatLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "TleFloatTfloatLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view TleFloatTfloatLogicalFunction::getType() const { return NAME; } + +bool TleFloatTfloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string TleFloatTfloatLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TleFloatTfloatLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction TleFloatTfloatLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTleFloatTfloatLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "TleFloatTfloatLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return TleFloatTfloatLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TleIntTintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TleIntTintLogicalFunction.cpp new file mode 100644 index 0000000000..aec8aff17e --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TleIntTintLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TleIntTintLogicalFunction::TleIntTintLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType TleIntTintLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction TleIntTintLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector TleIntTintLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction TleIntTintLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "TleIntTintLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view TleIntTintLogicalFunction::getType() const { return NAME; } + +bool TleIntTintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string TleIntTintLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TleIntTintLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction TleIntTintLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTleIntTintLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "TleIntTintLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return TleIntTintLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TleTemporalTemporalLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TleTemporalTemporalLogicalFunction.cpp new file mode 100644 index 0000000000..bf9d4b4aa9 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TleTemporalTemporalLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TleTemporalTemporalLogicalFunction::TleTemporalTemporalLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType TleTemporalTemporalLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction TleTemporalTemporalLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector TleTemporalTemporalLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction TleTemporalTemporalLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "TleTemporalTemporalLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view TleTemporalTemporalLogicalFunction::getType() const { return NAME; } + +bool TleTemporalTemporalLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string TleTemporalTemporalLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TleTemporalTemporalLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction TleTemporalTemporalLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTleTemporalTemporalLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "TleTemporalTemporalLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return TleTemporalTemporalLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TleTfloatFloatLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TleTfloatFloatLogicalFunction.cpp new file mode 100644 index 0000000000..58c9720fe3 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TleTfloatFloatLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TleTfloatFloatLogicalFunction::TleTfloatFloatLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType TleTfloatFloatLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction TleTfloatFloatLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector TleTfloatFloatLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction TleTfloatFloatLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "TleTfloatFloatLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view TleTfloatFloatLogicalFunction::getType() const { return NAME; } + +bool TleTfloatFloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string TleTfloatFloatLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TleTfloatFloatLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction TleTfloatFloatLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTleTfloatFloatLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "TleTfloatFloatLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return TleTfloatFloatLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TleTintIntLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TleTintIntLogicalFunction.cpp new file mode 100644 index 0000000000..7b307b6334 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TleTintIntLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TleTintIntLogicalFunction::TleTintIntLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType TleTintIntLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction TleTintIntLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector TleTintIntLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction TleTintIntLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "TleTintIntLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view TleTintIntLogicalFunction::getType() const { return NAME; } + +bool TleTintIntLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string TleTintIntLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TleTintIntLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction TleTintIntLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTleTintIntLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "TleTintIntLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return TleTintIntLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TleFloatTfloatPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TleFloatTfloatPhysicalFunction.hpp new file mode 100644 index 0000000000..b94ed0840d --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TleFloatTfloatPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `tle_float_tfloat`. + * + * temporal LE: scalar float vs single-instant tfloat + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TleFloatTfloatPhysicalFunction : public PhysicalFunctionConcept { +public: + TleFloatTfloatPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TleIntTintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TleIntTintPhysicalFunction.hpp new file mode 100644 index 0000000000..70e367064f --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TleIntTintPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `tle_int_tint`. + * + * temporal LE: scalar int vs single-instant tint + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TleIntTintPhysicalFunction : public PhysicalFunctionConcept { +public: + TleIntTintPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TleTemporalTemporalPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TleTemporalTemporalPhysicalFunction.hpp new file mode 100644 index 0000000000..f454e0a539 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TleTemporalTemporalPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `tle_temporal_temporal`. + * + * temporal LE: two single-instant tfloats + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TleTemporalTemporalPhysicalFunction : public PhysicalFunctionConcept { +public: + TleTemporalTemporalPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TleTfloatFloatPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TleTfloatFloatPhysicalFunction.hpp new file mode 100644 index 0000000000..eeb9616357 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TleTfloatFloatPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `tle_tfloat_float`. + * + * temporal LE: single-instant tfloat vs scalar float + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TleTfloatFloatPhysicalFunction : public PhysicalFunctionConcept { +public: + TleTfloatFloatPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TleTintIntPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TleTintIntPhysicalFunction.hpp new file mode 100644 index 0000000000..a80e8a9434 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TleTintIntPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `tle_tint_int`. + * + * temporal LE: single-instant tint vs scalar int + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TleTintIntPhysicalFunction : public PhysicalFunctionConcept { +public: + TleTintIntPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt index c115a6726e..1b75d342df 100644 --- a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt @@ -234,4 +234,9 @@ add_plugin(TgtFloatTfloat PhysicalFunction nes-physical-operators TgtFloatTfloat add_plugin(TgtTintInt PhysicalFunction nes-physical-operators TgtTintIntPhysicalFunction.cpp) add_plugin(TgtIntTint PhysicalFunction nes-physical-operators TgtIntTintPhysicalFunction.cpp) add_plugin(TgtTemporalTemporal PhysicalFunction nes-physical-operators TgtTemporalTemporalPhysicalFunction.cpp) +add_plugin(TleTfloatFloat PhysicalFunction nes-physical-operators TleTfloatFloatPhysicalFunction.cpp) +add_plugin(TleFloatTfloat PhysicalFunction nes-physical-operators TleFloatTfloatPhysicalFunction.cpp) +add_plugin(TleTintInt PhysicalFunction nes-physical-operators TleTintIntPhysicalFunction.cpp) +add_plugin(TleIntTint PhysicalFunction nes-physical-operators TleIntTintPhysicalFunction.cpp) +add_plugin(TleTemporalTemporal PhysicalFunction nes-physical-operators TleTemporalTemporalPhysicalFunction.cpp) endif() diff --git a/nes-physical-operators/src/Functions/Meos/TleFloatTfloatPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TleFloatTfloatPhysicalFunction.cpp new file mode 100644 index 0000000000..9e588a943f --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TleFloatTfloatPhysicalFunction.cpp @@ -0,0 +1,92 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +TleFloatTfloatPhysicalFunction::TleFloatTfloatPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(thresholdFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal TleFloatTfloatPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto thresh = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double v, double s, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = fmt::format("{}", s) + "@" + ts_str; + Temporal* temp = tfloat_in(wkt.c_str()); + if (!temp) return 0.0; + Temporal* res = tle_float_tfloat(v, temp); + free(temp); + if (!res) return 0.0; + bool r = tbool_start_value(res); + free(res); + return static_cast(r ? 1.0 : 0.0); + } catch (const std::exception&) { return 0.0; } + }, + value, thresh, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTleFloatTfloatPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "TleFloatTfloatPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return TleFloatTfloatPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TleIntTintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TleIntTintPhysicalFunction.cpp new file mode 100644 index 0000000000..718a24c5bf --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TleIntTintPhysicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +TleIntTintPhysicalFunction::TleIntTintPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(thresholdFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal TleIntTintPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto thresh = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double v, double s, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + int iv = static_cast(v); + std::string wkt = fmt::format("{}", static_cast(s)) + "@" + ts_str; + Temporal* temp = tint_in(wkt.c_str()); + if (!temp) return 0.0; + Temporal* res = tle_int_tint(iv, temp); + free(temp); + if (!res) return 0.0; + bool r = tbool_start_value(res); + free(res); + return static_cast(r ? 1.0 : 0.0); + } catch (const std::exception&) { return 0.0; } + }, + value, thresh, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTleIntTintPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "TleIntTintPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return TleIntTintPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TleTemporalTemporalPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TleTemporalTemporalPhysicalFunction.cpp new file mode 100644 index 0000000000..52ef2a907c --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TleTemporalTemporalPhysicalFunction.cpp @@ -0,0 +1,95 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +TleTemporalTemporalPhysicalFunction::TleTemporalTemporalPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(thresholdFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal TleTemporalTemporalPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto thresh = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double v, double s, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt1 = fmt::format("{}", v) + "@" + ts_str; + Temporal* temp1 = tfloat_in(wkt1.c_str()); + if (!temp1) return 0.0; + std::string wkt2 = fmt::format("{}", s) + "@" + ts_str; + Temporal* temp2 = tfloat_in(wkt2.c_str()); + if (!temp2) { free(temp1); return 0.0; } + Temporal* res = tle_temporal_temporal(temp1, temp2); + free(temp1); free(temp2); + if (!res) return 0.0; + bool r = tbool_start_value(res); + free(res); + return static_cast(r ? 1.0 : 0.0); + } catch (const std::exception&) { return 0.0; } + }, + value, thresh, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTleTemporalTemporalPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "TleTemporalTemporalPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return TleTemporalTemporalPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TleTfloatFloatPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TleTfloatFloatPhysicalFunction.cpp new file mode 100644 index 0000000000..f32e625511 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TleTfloatFloatPhysicalFunction.cpp @@ -0,0 +1,92 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +TleTfloatFloatPhysicalFunction::TleTfloatFloatPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(thresholdFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal TleTfloatFloatPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto thresh = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double v, double s, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = fmt::format("{}", v) + "@" + ts_str; + Temporal* temp = tfloat_in(wkt.c_str()); + if (!temp) return 0.0; + Temporal* res = tle_tfloat_float(temp, s); + free(temp); + if (!res) return 0.0; + bool r = tbool_start_value(res); + free(res); + return static_cast(r ? 1.0 : 0.0); + } catch (const std::exception&) { return 0.0; } + }, + value, thresh, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTleTfloatFloatPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "TleTfloatFloatPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return TleTfloatFloatPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TleTintIntPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TleTintIntPhysicalFunction.cpp new file mode 100644 index 0000000000..c4b082f408 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TleTintIntPhysicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +TleTintIntPhysicalFunction::TleTintIntPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(thresholdFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal TleTintIntPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto thresh = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double v, double s, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = fmt::format("{}", static_cast(v)) + "@" + ts_str; + Temporal* temp = tint_in(wkt.c_str()); + if (!temp) return 0.0; + int iv = static_cast(s); + Temporal* res = tle_tint_int(temp, iv); + free(temp); + if (!res) return 0.0; + bool r = tbool_start_value(res); + free(res); + return static_cast(r ? 1.0 : 0.0); + } catch (const std::exception&) { return 0.0; } + }, + value, thresh, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTleTintIntPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "TleTintIntPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return TleTintIntPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-sql-parser/AntlrSQL.g4 b/nes-sql-parser/AntlrSQL.g4 index 15a1bf5d5a..44a61b712f 100644 --- a/nes-sql-parser/AntlrSQL.g4 +++ b/nes-sql-parser/AntlrSQL.g4 @@ -295,7 +295,7 @@ timeUnit: MS timestampParameter: name=identifier; -functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL; +functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL; sinkClause: INTO sink (',' sink)*; @@ -705,6 +705,11 @@ TGT_FLOAT_TFLOAT: 'TGT_FLOAT_TFLOAT' | 'tgt_float_tfloat'; TGT_TINT_INT: 'TGT_TINT_INT' | 'tgt_tint_int'; TGT_INT_TINT: 'TGT_INT_TINT' | 'tgt_int_tint'; TGT_TEMPORAL_TEMPORAL: 'TGT_TEMPORAL_TEMPORAL' | 'tgt_temporal_temporal'; +TLE_TFLOAT_FLOAT: 'TLE_TFLOAT_FLOAT' | 'tle_tfloat_float'; +TLE_FLOAT_TFLOAT: 'TLE_FLOAT_TFLOAT' | 'tle_float_tfloat'; +TLE_TINT_INT: 'TLE_TINT_INT' | 'tle_tint_int'; +TLE_INT_TINT: 'TLE_INT_TINT' | 'tle_int_tint'; +TLE_TEMPORAL_TEMPORAL: 'TLE_TEMPORAL_TEMPORAL' | 'tle_temporal_temporal'; WATERMARK: 'WATERMARK' | 'watermark'; OFFSET: 'OFFSET' | 'offset'; LOCALHOST: 'LOCALHOST' | 'localhost'; diff --git a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp index e2097d915c..deeabc6731 100644 --- a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp +++ b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp @@ -286,6 +286,11 @@ #include #include #include +#include +#include +#include +#include +#include #include #include #include @@ -7305,6 +7310,136 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont }} break; /* END CODEGEN PARSER GLUE: TGT_TEMPORAL_TEMPORAL */ + /* BEGIN CODEGEN PARSER GLUE: TLE_TFLOAT_FLOAT */ + case AntlrSQLLexer::TLE_TFLOAT_FLOAT: + {{ + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("TLE_TFLOAT_FLOAT requires exactly 3 arguments, but got {{}}", argCount); + while (!helpers.top().constantBuilder.empty()) + {{ + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + }} + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + helpers.top().functionBuilder.emplace_back(TleTfloatFloatLogicalFunction(a0, a1, a2)); + }} + break; + /* END CODEGEN PARSER GLUE: TLE_TFLOAT_FLOAT */ + /* BEGIN CODEGEN PARSER GLUE: TLE_FLOAT_TFLOAT */ + case AntlrSQLLexer::TLE_FLOAT_TFLOAT: + {{ + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("TLE_FLOAT_TFLOAT requires exactly 3 arguments, but got {{}}", argCount); + while (!helpers.top().constantBuilder.empty()) + {{ + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + }} + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + helpers.top().functionBuilder.emplace_back(TleFloatTfloatLogicalFunction(a0, a1, a2)); + }} + break; + /* END CODEGEN PARSER GLUE: TLE_FLOAT_TFLOAT */ + /* BEGIN CODEGEN PARSER GLUE: TLE_TINT_INT */ + case AntlrSQLLexer::TLE_TINT_INT: + {{ + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("TLE_TINT_INT requires exactly 3 arguments, but got {{}}", argCount); + while (!helpers.top().constantBuilder.empty()) + {{ + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + }} + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + helpers.top().functionBuilder.emplace_back(TleTintIntLogicalFunction(a0, a1, a2)); + }} + break; + /* END CODEGEN PARSER GLUE: TLE_TINT_INT */ + /* BEGIN CODEGEN PARSER GLUE: TLE_INT_TINT */ + case AntlrSQLLexer::TLE_INT_TINT: + {{ + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("TLE_INT_TINT requires exactly 3 arguments, but got {{}}", argCount); + while (!helpers.top().constantBuilder.empty()) + {{ + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + }} + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + helpers.top().functionBuilder.emplace_back(TleIntTintLogicalFunction(a0, a1, a2)); + }} + break; + /* END CODEGEN PARSER GLUE: TLE_INT_TINT */ + /* BEGIN CODEGEN PARSER GLUE: TLE_TEMPORAL_TEMPORAL */ + case AntlrSQLLexer::TLE_TEMPORAL_TEMPORAL: + {{ + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("TLE_TEMPORAL_TEMPORAL requires exactly 3 arguments, but got {{}}", argCount); + while (!helpers.top().constantBuilder.empty()) + {{ + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + }} + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + helpers.top().functionBuilder.emplace_back(TleTemporalTemporalLogicalFunction(a0, a1, a2)); + }} + break; + /* END CODEGEN PARSER GLUE: TLE_TEMPORAL_TEMPORAL */ /* BEGIN CODEGEN PARSER GLUE: ALWAYS_EQ_TFLOAT_FLOAT */ case AntlrSQLLexer::ALWAYS_EQ_TFLOAT_FLOAT: { From 37bac27ce4bbde8880d1099900dbf8797d81ba16 Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Fri, 12 Jun 2026 10:59:08 +0200 Subject: [PATCH 40/96] feat(meos): add TLT_{FLOAT_TFLOAT,TFLOAT_FLOAT,INT_TINT,TINT_INT,TEMPORAL_TEMPORAL} NES operators (W91) --- .../Meos/TltFloatTfloatLogicalFunction.hpp | 54 +++++++ .../Meos/TltIntTintLogicalFunction.hpp | 54 +++++++ .../TltTemporalTemporalLogicalFunction.hpp | 54 +++++++ .../Meos/TltTfloatFloatLogicalFunction.hpp | 54 +++++++ .../Meos/TltTintIntLogicalFunction.hpp | 54 +++++++ .../src/Functions/Meos/CMakeLists.txt | 5 + .../Meos/TltFloatTfloatLogicalFunction.cpp | 105 ++++++++++++++ .../Meos/TltIntTintLogicalFunction.cpp | 105 ++++++++++++++ .../TltTemporalTemporalLogicalFunction.cpp | 105 ++++++++++++++ .../Meos/TltTfloatFloatLogicalFunction.cpp | 105 ++++++++++++++ .../Meos/TltTintIntLogicalFunction.cpp | 105 ++++++++++++++ .../Meos/TltFloatTfloatPhysicalFunction.hpp | 43 ++++++ .../Meos/TltIntTintPhysicalFunction.hpp | 43 ++++++ .../TltTemporalTemporalPhysicalFunction.hpp | 43 ++++++ .../Meos/TltTfloatFloatPhysicalFunction.hpp | 43 ++++++ .../Meos/TltTintIntPhysicalFunction.hpp | 43 ++++++ .../src/Functions/Meos/CMakeLists.txt | 5 + .../Meos/TltFloatTfloatPhysicalFunction.cpp | 92 ++++++++++++ .../Meos/TltIntTintPhysicalFunction.cpp | 93 ++++++++++++ .../TltTemporalTemporalPhysicalFunction.cpp | 95 ++++++++++++ .../Meos/TltTfloatFloatPhysicalFunction.cpp | 92 ++++++++++++ .../Meos/TltTintIntPhysicalFunction.cpp | 93 ++++++++++++ nes-sql-parser/AntlrSQL.g4 | 7 +- .../src/AntlrSQLQueryPlanCreator.cpp | 135 ++++++++++++++++++ 24 files changed, 1626 insertions(+), 1 deletion(-) create mode 100644 nes-logical-operators/include/Functions/Meos/TltFloatTfloatLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TltIntTintLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TltTemporalTemporalLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TltTfloatFloatLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TltTintIntLogicalFunction.hpp create mode 100644 nes-logical-operators/src/Functions/Meos/TltFloatTfloatLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TltIntTintLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TltTemporalTemporalLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TltTfloatFloatLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TltTintIntLogicalFunction.cpp create mode 100644 nes-physical-operators/include/Functions/Meos/TltFloatTfloatPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TltIntTintPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TltTemporalTemporalPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TltTfloatFloatPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TltTintIntPhysicalFunction.hpp create mode 100644 nes-physical-operators/src/Functions/Meos/TltFloatTfloatPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TltIntTintPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TltTemporalTemporalPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TltTfloatFloatPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TltTintIntPhysicalFunction.cpp diff --git a/nes-logical-operators/include/Functions/Meos/TltFloatTfloatLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TltFloatTfloatLogicalFunction.hpp new file mode 100644 index 0000000000..aa7d6f08d9 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TltFloatTfloatLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief temporal LT: scalar float vs single-instant tfloat + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `tlt_float_tfloat`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class TltFloatTfloatLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TltFloatTfloat"; + + TltFloatTfloatLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TltIntTintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TltIntTintLogicalFunction.hpp new file mode 100644 index 0000000000..901764a8d9 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TltIntTintLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief temporal LT: scalar int vs single-instant tint + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `tlt_int_tint`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class TltIntTintLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TltIntTint"; + + TltIntTintLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TltTemporalTemporalLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TltTemporalTemporalLogicalFunction.hpp new file mode 100644 index 0000000000..808172372c --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TltTemporalTemporalLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief temporal LT: two single-instant tfloats + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `tlt_temporal_temporal`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class TltTemporalTemporalLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TltTemporalTemporal"; + + TltTemporalTemporalLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TltTfloatFloatLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TltTfloatFloatLogicalFunction.hpp new file mode 100644 index 0000000000..ccfd508cb8 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TltTfloatFloatLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief temporal LT: single-instant tfloat vs scalar float + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `tlt_tfloat_float`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class TltTfloatFloatLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TltTfloatFloat"; + + TltTfloatFloatLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TltTintIntLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TltTintIntLogicalFunction.hpp new file mode 100644 index 0000000000..5964d62430 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TltTintIntLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief temporal LT: single-instant tint vs scalar int + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `tlt_tint_int`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), + * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + */ +class TltTintIntLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TltTintInt"; + + TltTintIntLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt index 8904abe40a..376f53b53c 100644 --- a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt @@ -240,3 +240,8 @@ add_plugin(TleFloatTfloat LogicalFunction nes-logical-operators TleFloatTfloatLo add_plugin(TleTintInt LogicalFunction nes-logical-operators TleTintIntLogicalFunction.cpp) add_plugin(TleIntTint LogicalFunction nes-logical-operators TleIntTintLogicalFunction.cpp) add_plugin(TleTemporalTemporal LogicalFunction nes-logical-operators TleTemporalTemporalLogicalFunction.cpp) +add_plugin(TltTfloatFloat LogicalFunction nes-logical-operators TltTfloatFloatLogicalFunction.cpp) +add_plugin(TltFloatTfloat LogicalFunction nes-logical-operators TltFloatTfloatLogicalFunction.cpp) +add_plugin(TltTintInt LogicalFunction nes-logical-operators TltTintIntLogicalFunction.cpp) +add_plugin(TltIntTint LogicalFunction nes-logical-operators TltIntTintLogicalFunction.cpp) +add_plugin(TltTemporalTemporal LogicalFunction nes-logical-operators TltTemporalTemporalLogicalFunction.cpp) diff --git a/nes-logical-operators/src/Functions/Meos/TltFloatTfloatLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TltFloatTfloatLogicalFunction.cpp new file mode 100644 index 0000000000..07b0f703d0 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TltFloatTfloatLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TltFloatTfloatLogicalFunction::TltFloatTfloatLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType TltFloatTfloatLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction TltFloatTfloatLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector TltFloatTfloatLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction TltFloatTfloatLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "TltFloatTfloatLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view TltFloatTfloatLogicalFunction::getType() const { return NAME; } + +bool TltFloatTfloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string TltFloatTfloatLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TltFloatTfloatLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction TltFloatTfloatLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTltFloatTfloatLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "TltFloatTfloatLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return TltFloatTfloatLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TltIntTintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TltIntTintLogicalFunction.cpp new file mode 100644 index 0000000000..170ffeb174 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TltIntTintLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TltIntTintLogicalFunction::TltIntTintLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType TltIntTintLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction TltIntTintLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector TltIntTintLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction TltIntTintLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "TltIntTintLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view TltIntTintLogicalFunction::getType() const { return NAME; } + +bool TltIntTintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string TltIntTintLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TltIntTintLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction TltIntTintLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTltIntTintLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "TltIntTintLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return TltIntTintLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TltTemporalTemporalLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TltTemporalTemporalLogicalFunction.cpp new file mode 100644 index 0000000000..16f0a1cc86 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TltTemporalTemporalLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TltTemporalTemporalLogicalFunction::TltTemporalTemporalLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType TltTemporalTemporalLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction TltTemporalTemporalLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector TltTemporalTemporalLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction TltTemporalTemporalLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "TltTemporalTemporalLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view TltTemporalTemporalLogicalFunction::getType() const { return NAME; } + +bool TltTemporalTemporalLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string TltTemporalTemporalLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TltTemporalTemporalLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction TltTemporalTemporalLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTltTemporalTemporalLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "TltTemporalTemporalLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return TltTemporalTemporalLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TltTfloatFloatLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TltTfloatFloatLogicalFunction.cpp new file mode 100644 index 0000000000..6a5ef0ee75 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TltTfloatFloatLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TltTfloatFloatLogicalFunction::TltTfloatFloatLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType TltTfloatFloatLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction TltTfloatFloatLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector TltTfloatFloatLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction TltTfloatFloatLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "TltTfloatFloatLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view TltTfloatFloatLogicalFunction::getType() const { return NAME; } + +bool TltTfloatFloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string TltTfloatFloatLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TltTfloatFloatLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction TltTfloatFloatLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTltTfloatFloatLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "TltTfloatFloatLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return TltTfloatFloatLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TltTintIntLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TltTintIntLogicalFunction.cpp new file mode 100644 index 0000000000..0d3dc85fa1 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TltTintIntLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TltTintIntLogicalFunction::TltTintIntLogicalFunction(LogicalFunction value, + LogicalFunction threshold, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(threshold)); + parameters.push_back(std::move(ts)); +} + +DataType TltTintIntLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction TltTintIntLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector TltTintIntLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction TltTintIntLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "TltTintIntLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view TltTintIntLogicalFunction::getType() const { return NAME; } + +bool TltTintIntLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string TltTintIntLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TltTintIntLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction TltTintIntLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTltTintIntLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "TltTintIntLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return TltTintIntLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TltFloatTfloatPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TltFloatTfloatPhysicalFunction.hpp new file mode 100644 index 0000000000..6f0ff75d04 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TltFloatTfloatPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `tlt_float_tfloat`. + * + * temporal LT: scalar float vs single-instant tfloat + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TltFloatTfloatPhysicalFunction : public PhysicalFunctionConcept { +public: + TltFloatTfloatPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TltIntTintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TltIntTintPhysicalFunction.hpp new file mode 100644 index 0000000000..8d56171971 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TltIntTintPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `tlt_int_tint`. + * + * temporal LT: scalar int vs single-instant tint + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TltIntTintPhysicalFunction : public PhysicalFunctionConcept { +public: + TltIntTintPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TltTemporalTemporalPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TltTemporalTemporalPhysicalFunction.hpp new file mode 100644 index 0000000000..e654fbf064 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TltTemporalTemporalPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `tlt_temporal_temporal`. + * + * temporal LT: two single-instant tfloats + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TltTemporalTemporalPhysicalFunction : public PhysicalFunctionConcept { +public: + TltTemporalTemporalPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TltTfloatFloatPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TltTfloatFloatPhysicalFunction.hpp new file mode 100644 index 0000000000..1e2de95d6c --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TltTfloatFloatPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `tlt_tfloat_float`. + * + * temporal LT: single-instant tfloat vs scalar float + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TltTfloatFloatPhysicalFunction : public PhysicalFunctionConcept { +public: + TltTfloatFloatPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TltTintIntPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TltTintIntPhysicalFunction.hpp new file mode 100644 index 0000000000..99c07ce804 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TltTintIntPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `tlt_tint_int`. + * + * temporal LT: single-instant tint vs scalar int + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TltTintIntPhysicalFunction : public PhysicalFunctionConcept { +public: + TltTintIntPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt index 1b75d342df..1329e88057 100644 --- a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt @@ -239,4 +239,9 @@ add_plugin(TleFloatTfloat PhysicalFunction nes-physical-operators TleFloatTfloat add_plugin(TleTintInt PhysicalFunction nes-physical-operators TleTintIntPhysicalFunction.cpp) add_plugin(TleIntTint PhysicalFunction nes-physical-operators TleIntTintPhysicalFunction.cpp) add_plugin(TleTemporalTemporal PhysicalFunction nes-physical-operators TleTemporalTemporalPhysicalFunction.cpp) +add_plugin(TltTfloatFloat PhysicalFunction nes-physical-operators TltTfloatFloatPhysicalFunction.cpp) +add_plugin(TltFloatTfloat PhysicalFunction nes-physical-operators TltFloatTfloatPhysicalFunction.cpp) +add_plugin(TltTintInt PhysicalFunction nes-physical-operators TltTintIntPhysicalFunction.cpp) +add_plugin(TltIntTint PhysicalFunction nes-physical-operators TltIntTintPhysicalFunction.cpp) +add_plugin(TltTemporalTemporal PhysicalFunction nes-physical-operators TltTemporalTemporalPhysicalFunction.cpp) endif() diff --git a/nes-physical-operators/src/Functions/Meos/TltFloatTfloatPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TltFloatTfloatPhysicalFunction.cpp new file mode 100644 index 0000000000..4dee7b9ee3 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TltFloatTfloatPhysicalFunction.cpp @@ -0,0 +1,92 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +TltFloatTfloatPhysicalFunction::TltFloatTfloatPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(thresholdFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal TltFloatTfloatPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto thresh = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double v, double s, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = fmt::format("{}", s) + "@" + ts_str; + Temporal* temp = tfloat_in(wkt.c_str()); + if (!temp) return 0.0; + Temporal* res = tlt_float_tfloat(v, temp); + free(temp); + if (!res) return 0.0; + bool r = tbool_start_value(res); + free(res); + return static_cast(r ? 1.0 : 0.0); + } catch (const std::exception&) { return 0.0; } + }, + value, thresh, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTltFloatTfloatPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "TltFloatTfloatPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return TltFloatTfloatPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TltIntTintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TltIntTintPhysicalFunction.cpp new file mode 100644 index 0000000000..6bed7490fa --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TltIntTintPhysicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +TltIntTintPhysicalFunction::TltIntTintPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(thresholdFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal TltIntTintPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto thresh = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double v, double s, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + int iv = static_cast(v); + std::string wkt = fmt::format("{}", static_cast(s)) + "@" + ts_str; + Temporal* temp = tint_in(wkt.c_str()); + if (!temp) return 0.0; + Temporal* res = tlt_int_tint(iv, temp); + free(temp); + if (!res) return 0.0; + bool r = tbool_start_value(res); + free(res); + return static_cast(r ? 1.0 : 0.0); + } catch (const std::exception&) { return 0.0; } + }, + value, thresh, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTltIntTintPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "TltIntTintPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return TltIntTintPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TltTemporalTemporalPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TltTemporalTemporalPhysicalFunction.cpp new file mode 100644 index 0000000000..3ee2eeb6e8 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TltTemporalTemporalPhysicalFunction.cpp @@ -0,0 +1,95 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +TltTemporalTemporalPhysicalFunction::TltTemporalTemporalPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(thresholdFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal TltTemporalTemporalPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto thresh = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double v, double s, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt1 = fmt::format("{}", v) + "@" + ts_str; + Temporal* temp1 = tfloat_in(wkt1.c_str()); + if (!temp1) return 0.0; + std::string wkt2 = fmt::format("{}", s) + "@" + ts_str; + Temporal* temp2 = tfloat_in(wkt2.c_str()); + if (!temp2) { free(temp1); return 0.0; } + Temporal* res = tlt_temporal_temporal(temp1, temp2); + free(temp1); free(temp2); + if (!res) return 0.0; + bool r = tbool_start_value(res); + free(res); + return static_cast(r ? 1.0 : 0.0); + } catch (const std::exception&) { return 0.0; } + }, + value, thresh, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTltTemporalTemporalPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "TltTemporalTemporalPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return TltTemporalTemporalPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TltTfloatFloatPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TltTfloatFloatPhysicalFunction.cpp new file mode 100644 index 0000000000..83bd3eb71d --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TltTfloatFloatPhysicalFunction.cpp @@ -0,0 +1,92 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +TltTfloatFloatPhysicalFunction::TltTfloatFloatPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(thresholdFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal TltTfloatFloatPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto thresh = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double v, double s, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = fmt::format("{}", v) + "@" + ts_str; + Temporal* temp = tfloat_in(wkt.c_str()); + if (!temp) return 0.0; + Temporal* res = tlt_tfloat_float(temp, s); + free(temp); + if (!res) return 0.0; + bool r = tbool_start_value(res); + free(res); + return static_cast(r ? 1.0 : 0.0); + } catch (const std::exception&) { return 0.0; } + }, + value, thresh, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTltTfloatFloatPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "TltTfloatFloatPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return TltTfloatFloatPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TltTintIntPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TltTintIntPhysicalFunction.cpp new file mode 100644 index 0000000000..f74e5f9da8 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TltTintIntPhysicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +TltTintIntPhysicalFunction::TltTintIntPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction thresholdFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(thresholdFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal TltTintIntPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto thresh = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double v, double s, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = fmt::format("{}", static_cast(v)) + "@" + ts_str; + Temporal* temp = tint_in(wkt.c_str()); + if (!temp) return 0.0; + int iv = static_cast(s); + Temporal* res = tlt_tint_int(temp, iv); + free(temp); + if (!res) return 0.0; + bool r = tbool_start_value(res); + free(res); + return static_cast(r ? 1.0 : 0.0); + } catch (const std::exception&) { return 0.0; } + }, + value, thresh, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTltTintIntPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "TltTintIntPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return TltTintIntPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-sql-parser/AntlrSQL.g4 b/nes-sql-parser/AntlrSQL.g4 index 44a61b712f..cb28c14e3f 100644 --- a/nes-sql-parser/AntlrSQL.g4 +++ b/nes-sql-parser/AntlrSQL.g4 @@ -295,7 +295,7 @@ timeUnit: MS timestampParameter: name=identifier; -functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL; +functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL; sinkClause: INTO sink (',' sink)*; @@ -710,6 +710,11 @@ TLE_FLOAT_TFLOAT: 'TLE_FLOAT_TFLOAT' | 'tle_float_tfloat'; TLE_TINT_INT: 'TLE_TINT_INT' | 'tle_tint_int'; TLE_INT_TINT: 'TLE_INT_TINT' | 'tle_int_tint'; TLE_TEMPORAL_TEMPORAL: 'TLE_TEMPORAL_TEMPORAL' | 'tle_temporal_temporal'; +TLT_TFLOAT_FLOAT: 'TLT_TFLOAT_FLOAT' | 'tlt_tfloat_float'; +TLT_FLOAT_TFLOAT: 'TLT_FLOAT_TFLOAT' | 'tlt_float_tfloat'; +TLT_TINT_INT: 'TLT_TINT_INT' | 'tlt_tint_int'; +TLT_INT_TINT: 'TLT_INT_TINT' | 'tlt_int_tint'; +TLT_TEMPORAL_TEMPORAL: 'TLT_TEMPORAL_TEMPORAL' | 'tlt_temporal_temporal'; WATERMARK: 'WATERMARK' | 'watermark'; OFFSET: 'OFFSET' | 'offset'; LOCALHOST: 'LOCALHOST' | 'localhost'; diff --git a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp index deeabc6731..f9544a8eae 100644 --- a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp +++ b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp @@ -291,6 +291,11 @@ #include #include #include +#include +#include +#include +#include +#include #include #include #include @@ -7440,6 +7445,136 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont }} break; /* END CODEGEN PARSER GLUE: TLE_TEMPORAL_TEMPORAL */ + /* BEGIN CODEGEN PARSER GLUE: TLT_TFLOAT_FLOAT */ + case AntlrSQLLexer::TLT_TFLOAT_FLOAT: + {{ + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("TLT_TFLOAT_FLOAT requires exactly 3 arguments, but got {{}}", argCount); + while (!helpers.top().constantBuilder.empty()) + {{ + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + }} + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + helpers.top().functionBuilder.emplace_back(TltTfloatFloatLogicalFunction(a0, a1, a2)); + }} + break; + /* END CODEGEN PARSER GLUE: TLT_TFLOAT_FLOAT */ + /* BEGIN CODEGEN PARSER GLUE: TLT_FLOAT_TFLOAT */ + case AntlrSQLLexer::TLT_FLOAT_TFLOAT: + {{ + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("TLT_FLOAT_TFLOAT requires exactly 3 arguments, but got {{}}", argCount); + while (!helpers.top().constantBuilder.empty()) + {{ + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + }} + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + helpers.top().functionBuilder.emplace_back(TltFloatTfloatLogicalFunction(a0, a1, a2)); + }} + break; + /* END CODEGEN PARSER GLUE: TLT_FLOAT_TFLOAT */ + /* BEGIN CODEGEN PARSER GLUE: TLT_TINT_INT */ + case AntlrSQLLexer::TLT_TINT_INT: + {{ + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("TLT_TINT_INT requires exactly 3 arguments, but got {{}}", argCount); + while (!helpers.top().constantBuilder.empty()) + {{ + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + }} + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + helpers.top().functionBuilder.emplace_back(TltTintIntLogicalFunction(a0, a1, a2)); + }} + break; + /* END CODEGEN PARSER GLUE: TLT_TINT_INT */ + /* BEGIN CODEGEN PARSER GLUE: TLT_INT_TINT */ + case AntlrSQLLexer::TLT_INT_TINT: + {{ + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("TLT_INT_TINT requires exactly 3 arguments, but got {{}}", argCount); + while (!helpers.top().constantBuilder.empty()) + {{ + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + }} + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + helpers.top().functionBuilder.emplace_back(TltIntTintLogicalFunction(a0, a1, a2)); + }} + break; + /* END CODEGEN PARSER GLUE: TLT_INT_TINT */ + /* BEGIN CODEGEN PARSER GLUE: TLT_TEMPORAL_TEMPORAL */ + case AntlrSQLLexer::TLT_TEMPORAL_TEMPORAL: + {{ + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("TLT_TEMPORAL_TEMPORAL requires exactly 3 arguments, but got {{}}", argCount); + while (!helpers.top().constantBuilder.empty()) + {{ + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + }} + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + helpers.top().functionBuilder.emplace_back(TltTemporalTemporalLogicalFunction(a0, a1, a2)); + }} + break; + /* END CODEGEN PARSER GLUE: TLT_TEMPORAL_TEMPORAL */ /* BEGIN CODEGEN PARSER GLUE: ALWAYS_EQ_TFLOAT_FLOAT */ case AntlrSQLLexer::ALWAYS_EQ_TFLOAT_FLOAT: { From 4fb570e83b2ee7fff99a752c7c7ab95651c3aefa Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Fri, 12 Jun 2026 11:06:32 +0200 Subject: [PATCH 41/96] feat(meos): add TBOOL_TO_TINT NES operator (W92) Adds a per-event NES scalar operator TBOOL_TO_TINT backed by the MEOS tbool_to_tint kernel. The 2-arg operator takes (value:FLOAT64, ts:UINT64), builds a single-instant tbool via tbool_in, delegates to tbool_to_tint, and extracts the tint result via tint_start_value returning FLOAT64. Wired across logical/physical CMakeLists, AntlrSQL.g4 functionName rule and lexer section, and AntlrSQLQueryPlanCreator.cpp. --- .../AlwaysEqTbigintTbigintLogicalFunction.hpp | 6 +- .../Meos/AlwaysEqTintTintLogicalFunction.hpp | 6 +- .../AlwaysGeTbigintTbigintLogicalFunction.hpp | 6 +- .../Meos/AlwaysGeTintTintLogicalFunction.hpp | 6 +- .../AlwaysGtTbigintTbigintLogicalFunction.hpp | 6 +- .../Meos/AlwaysGtTintTintLogicalFunction.hpp | 6 +- .../AlwaysLeTbigintTbigintLogicalFunction.hpp | 6 +- .../Meos/AlwaysLeTintTintLogicalFunction.hpp | 6 +- .../AlwaysLtTbigintTbigintLogicalFunction.hpp | 6 +- .../Meos/AlwaysLtTintTintLogicalFunction.hpp | 6 +- .../AlwaysNeTbigintTbigintLogicalFunction.hpp | 6 +- .../Meos/AlwaysNeTintTintLogicalFunction.hpp | 6 +- .../EverEqTbigintTbigintLogicalFunction.hpp | 6 +- .../Meos/EverEqTintTintLogicalFunction.hpp | 6 +- .../EverGeTbigintTbigintLogicalFunction.hpp | 6 +- .../Meos/EverGeTintTintLogicalFunction.hpp | 6 +- .../EverGtTbigintTbigintLogicalFunction.hpp | 6 +- .../Meos/EverGtTintTintLogicalFunction.hpp | 6 +- .../EverLeTbigintTbigintLogicalFunction.hpp | 6 +- .../Meos/EverLeTintTintLogicalFunction.hpp | 6 +- .../EverLtTbigintTbigintLogicalFunction.hpp | 6 +- .../Meos/EverLtTintTintLogicalFunction.hpp | 6 +- .../EverNeTbigintTbigintLogicalFunction.hpp | 6 +- .../Meos/EverNeTintTintLogicalFunction.hpp | 6 +- .../Meos/TboolToTintLogicalFunction.hpp | 53 +++++++++ .../AlwaysEqTbigintTbigintLogicalFunction.cpp | 32 +++--- .../Meos/AlwaysEqTintTintLogicalFunction.cpp | 32 +++--- .../AlwaysGeTbigintTbigintLogicalFunction.cpp | 32 +++--- .../Meos/AlwaysGeTintTintLogicalFunction.cpp | 32 +++--- .../AlwaysGtTbigintTbigintLogicalFunction.cpp | 32 +++--- .../Meos/AlwaysGtTintTintLogicalFunction.cpp | 32 +++--- .../AlwaysLeTbigintTbigintLogicalFunction.cpp | 32 +++--- .../Meos/AlwaysLeTintTintLogicalFunction.cpp | 32 +++--- .../AlwaysLtTbigintTbigintLogicalFunction.cpp | 32 +++--- .../Meos/AlwaysLtTintTintLogicalFunction.cpp | 32 +++--- .../AlwaysNeTbigintTbigintLogicalFunction.cpp | 32 +++--- .../Meos/AlwaysNeTintTintLogicalFunction.cpp | 32 +++--- .../src/Functions/Meos/CMakeLists.txt | 1 + .../EverEqTbigintTbigintLogicalFunction.cpp | 32 +++--- .../Meos/EverEqTintTintLogicalFunction.cpp | 32 +++--- .../EverGeTbigintTbigintLogicalFunction.cpp | 32 +++--- .../Meos/EverGeTintTintLogicalFunction.cpp | 32 +++--- .../EverGtTbigintTbigintLogicalFunction.cpp | 32 +++--- .../Meos/EverGtTintTintLogicalFunction.cpp | 32 +++--- .../EverLeTbigintTbigintLogicalFunction.cpp | 32 +++--- .../Meos/EverLeTintTintLogicalFunction.cpp | 32 +++--- .../EverLtTbigintTbigintLogicalFunction.cpp | 32 +++--- .../Meos/EverLtTintTintLogicalFunction.cpp | 32 +++--- .../EverNeTbigintTbigintLogicalFunction.cpp | 32 +++--- .../Meos/EverNeTintTintLogicalFunction.cpp | 32 +++--- .../Meos/TboolToTintLogicalFunction.cpp | 102 ++++++++++++++++++ ...AlwaysEqTbigintTbigintPhysicalFunction.hpp | 4 +- .../Meos/AlwaysEqTintTintPhysicalFunction.hpp | 4 +- ...AlwaysGeTbigintTbigintPhysicalFunction.hpp | 4 +- .../Meos/AlwaysGeTintTintPhysicalFunction.hpp | 4 +- ...AlwaysGtTbigintTbigintPhysicalFunction.hpp | 4 +- .../Meos/AlwaysGtTintTintPhysicalFunction.hpp | 4 +- ...AlwaysLeTbigintTbigintPhysicalFunction.hpp | 4 +- .../Meos/AlwaysLeTintTintPhysicalFunction.hpp | 4 +- ...AlwaysLtTbigintTbigintPhysicalFunction.hpp | 4 +- .../Meos/AlwaysLtTintTintPhysicalFunction.hpp | 4 +- ...AlwaysNeTbigintTbigintPhysicalFunction.hpp | 4 +- .../Meos/AlwaysNeTintTintPhysicalFunction.hpp | 4 +- .../EverEqTbigintTbigintPhysicalFunction.hpp | 4 +- .../Meos/EverEqTintTintPhysicalFunction.hpp | 4 +- .../EverGeTbigintTbigintPhysicalFunction.hpp | 4 +- .../Meos/EverGeTintTintPhysicalFunction.hpp | 4 +- .../EverGtTbigintTbigintPhysicalFunction.hpp | 4 +- .../Meos/EverGtTintTintPhysicalFunction.hpp | 4 +- .../EverLeTbigintTbigintPhysicalFunction.hpp | 4 +- .../Meos/EverLeTintTintPhysicalFunction.hpp | 4 +- .../EverLtTbigintTbigintPhysicalFunction.hpp | 4 +- .../Meos/EverLtTintTintPhysicalFunction.hpp | 4 +- .../EverNeTbigintTbigintPhysicalFunction.hpp | 4 +- .../Meos/EverNeTintTintPhysicalFunction.hpp | 4 +- .../Meos/TboolToTintPhysicalFunction.hpp | 42 ++++++++ ...AlwaysEqTbigintTbigintPhysicalFunction.cpp | 2 +- .../Meos/AlwaysEqTintTintPhysicalFunction.cpp | 2 +- ...AlwaysGeTbigintTbigintPhysicalFunction.cpp | 2 +- .../Meos/AlwaysGeTintTintPhysicalFunction.cpp | 2 +- ...AlwaysGtTbigintTbigintPhysicalFunction.cpp | 2 +- .../Meos/AlwaysGtTintTintPhysicalFunction.cpp | 2 +- ...AlwaysLeTbigintTbigintPhysicalFunction.cpp | 2 +- .../Meos/AlwaysLeTintTintPhysicalFunction.cpp | 2 +- ...AlwaysLtTbigintTbigintPhysicalFunction.cpp | 2 +- .../Meos/AlwaysLtTintTintPhysicalFunction.cpp | 2 +- ...AlwaysNeTbigintTbigintPhysicalFunction.cpp | 2 +- .../Meos/AlwaysNeTintTintPhysicalFunction.cpp | 2 +- .../src/Functions/Meos/CMakeLists.txt | 1 + .../EverEqTbigintTbigintPhysicalFunction.cpp | 2 +- .../Meos/EverEqTintTintPhysicalFunction.cpp | 2 +- .../EverGeTbigintTbigintPhysicalFunction.cpp | 2 +- .../Meos/EverGeTintTintPhysicalFunction.cpp | 2 +- .../EverGtTbigintTbigintPhysicalFunction.cpp | 2 +- .../Meos/EverGtTintTintPhysicalFunction.cpp | 2 +- .../EverLeTbigintTbigintPhysicalFunction.cpp | 2 +- .../Meos/EverLeTintTintPhysicalFunction.cpp | 2 +- .../EverLtTbigintTbigintPhysicalFunction.cpp | 2 +- .../Meos/EverLtTintTintPhysicalFunction.cpp | 2 +- .../EverNeTbigintTbigintPhysicalFunction.cpp | 2 +- .../Meos/EverNeTintTintPhysicalFunction.cpp | 2 +- .../Meos/TboolToTintPhysicalFunction.cpp | 88 +++++++++++++++ nes-sql-parser/AntlrSQL.g4 | 3 +- .../src/AntlrSQLQueryPlanCreator.cpp | 27 +++++ 104 files changed, 844 insertions(+), 529 deletions(-) create mode 100644 nes-logical-operators/include/Functions/Meos/TboolToTintLogicalFunction.hpp create mode 100644 nes-logical-operators/src/Functions/Meos/TboolToTintLogicalFunction.cpp create mode 100644 nes-physical-operators/include/Functions/Meos/TboolToTintPhysicalFunction.hpp create mode 100644 nes-physical-operators/src/Functions/Meos/TboolToTintPhysicalFunction.cpp diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysEqTbigintTbigintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysEqTbigintTbigintLogicalFunction.hpp index 46b63578c9..97cc441b0d 100644 --- a/nes-logical-operators/include/Functions/Meos/AlwaysEqTbigintTbigintLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/AlwaysEqTbigintTbigintLogicalFunction.hpp @@ -28,11 +28,11 @@ namespace NES { * `always_eq_tbigint_tfloat`. Takes (value1:FLOAT64, value2:FLOAT64, ts:UINT64), * constructs two single-instant temporals, applies the comparison, and returns FLOAT64 (0.0/1.0). */ -class AlwaysEqTbigintTfloatLogicalFunction : public LogicalFunctionConcept { +class AlwaysEqTbigintTbigintLogicalFunction : public LogicalFunctionConcept { public: - static constexpr std::string_view NAME = "AlwaysEqTbigintTfloat"; + static constexpr std::string_view NAME = "AlwaysEqTbigintTbigint"; - AlwaysEqTbigintTfloatLogicalFunction(LogicalFunction value1, + AlwaysEqTbigintTbigintLogicalFunction(LogicalFunction value1, LogicalFunction value2, LogicalFunction ts); diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysEqTintTintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysEqTintTintLogicalFunction.hpp index 2e44a89f3a..c3a0bb5113 100644 --- a/nes-logical-operators/include/Functions/Meos/AlwaysEqTintTintLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/AlwaysEqTintTintLogicalFunction.hpp @@ -28,11 +28,11 @@ namespace NES { * `always_eq_tint_tfloat`. Takes (value1:FLOAT64, value2:FLOAT64, ts:UINT64), * constructs two single-instant temporals, applies the comparison, and returns FLOAT64 (0.0/1.0). */ -class AlwaysEqTintTfloatLogicalFunction : public LogicalFunctionConcept { +class AlwaysEqTintTintLogicalFunction : public LogicalFunctionConcept { public: - static constexpr std::string_view NAME = "AlwaysEqTintTfloat"; + static constexpr std::string_view NAME = "AlwaysEqTintTint"; - AlwaysEqTintTfloatLogicalFunction(LogicalFunction value1, + AlwaysEqTintTintLogicalFunction(LogicalFunction value1, LogicalFunction value2, LogicalFunction ts); diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysGeTbigintTbigintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysGeTbigintTbigintLogicalFunction.hpp index 37f9d8e151..bce7503b9e 100644 --- a/nes-logical-operators/include/Functions/Meos/AlwaysGeTbigintTbigintLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/AlwaysGeTbigintTbigintLogicalFunction.hpp @@ -28,11 +28,11 @@ namespace NES { * `always_ge_tbigint_tfloat`. Takes (value1:FLOAT64, value2:FLOAT64, ts:UINT64), * constructs two single-instant temporals, applies the comparison, and returns FLOAT64 (0.0/1.0). */ -class AlwaysGeTbigintTfloatLogicalFunction : public LogicalFunctionConcept { +class AlwaysGeTbigintTbigintLogicalFunction : public LogicalFunctionConcept { public: - static constexpr std::string_view NAME = "AlwaysGeTbigintTfloat"; + static constexpr std::string_view NAME = "AlwaysGeTbigintTbigint"; - AlwaysGeTbigintTfloatLogicalFunction(LogicalFunction value1, + AlwaysGeTbigintTbigintLogicalFunction(LogicalFunction value1, LogicalFunction value2, LogicalFunction ts); diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysGeTintTintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysGeTintTintLogicalFunction.hpp index feb35315bc..86a2b57994 100644 --- a/nes-logical-operators/include/Functions/Meos/AlwaysGeTintTintLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/AlwaysGeTintTintLogicalFunction.hpp @@ -28,11 +28,11 @@ namespace NES { * `always_ge_tint_tfloat`. Takes (value1:FLOAT64, value2:FLOAT64, ts:UINT64), * constructs two single-instant temporals, applies the comparison, and returns FLOAT64 (0.0/1.0). */ -class AlwaysGeTintTfloatLogicalFunction : public LogicalFunctionConcept { +class AlwaysGeTintTintLogicalFunction : public LogicalFunctionConcept { public: - static constexpr std::string_view NAME = "AlwaysGeTintTfloat"; + static constexpr std::string_view NAME = "AlwaysGeTintTint"; - AlwaysGeTintTfloatLogicalFunction(LogicalFunction value1, + AlwaysGeTintTintLogicalFunction(LogicalFunction value1, LogicalFunction value2, LogicalFunction ts); diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysGtTbigintTbigintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysGtTbigintTbigintLogicalFunction.hpp index 48addeef95..a3f36fdd82 100644 --- a/nes-logical-operators/include/Functions/Meos/AlwaysGtTbigintTbigintLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/AlwaysGtTbigintTbigintLogicalFunction.hpp @@ -28,11 +28,11 @@ namespace NES { * `always_gt_tbigint_tfloat`. Takes (value1:FLOAT64, value2:FLOAT64, ts:UINT64), * constructs two single-instant temporals, applies the comparison, and returns FLOAT64 (0.0/1.0). */ -class AlwaysGtTbigintTfloatLogicalFunction : public LogicalFunctionConcept { +class AlwaysGtTbigintTbigintLogicalFunction : public LogicalFunctionConcept { public: - static constexpr std::string_view NAME = "AlwaysGtTbigintTfloat"; + static constexpr std::string_view NAME = "AlwaysGtTbigintTbigint"; - AlwaysGtTbigintTfloatLogicalFunction(LogicalFunction value1, + AlwaysGtTbigintTbigintLogicalFunction(LogicalFunction value1, LogicalFunction value2, LogicalFunction ts); diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysGtTintTintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysGtTintTintLogicalFunction.hpp index 51e6feaca9..09747a857c 100644 --- a/nes-logical-operators/include/Functions/Meos/AlwaysGtTintTintLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/AlwaysGtTintTintLogicalFunction.hpp @@ -28,11 +28,11 @@ namespace NES { * `always_gt_tint_tfloat`. Takes (value1:FLOAT64, value2:FLOAT64, ts:UINT64), * constructs two single-instant temporals, applies the comparison, and returns FLOAT64 (0.0/1.0). */ -class AlwaysGtTintTfloatLogicalFunction : public LogicalFunctionConcept { +class AlwaysGtTintTintLogicalFunction : public LogicalFunctionConcept { public: - static constexpr std::string_view NAME = "AlwaysGtTintTfloat"; + static constexpr std::string_view NAME = "AlwaysGtTintTint"; - AlwaysGtTintTfloatLogicalFunction(LogicalFunction value1, + AlwaysGtTintTintLogicalFunction(LogicalFunction value1, LogicalFunction value2, LogicalFunction ts); diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysLeTbigintTbigintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysLeTbigintTbigintLogicalFunction.hpp index 6c5c2998b6..7083b60b11 100644 --- a/nes-logical-operators/include/Functions/Meos/AlwaysLeTbigintTbigintLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/AlwaysLeTbigintTbigintLogicalFunction.hpp @@ -28,11 +28,11 @@ namespace NES { * `always_le_tbigint_tfloat`. Takes (value1:FLOAT64, value2:FLOAT64, ts:UINT64), * constructs two single-instant temporals, applies the comparison, and returns FLOAT64 (0.0/1.0). */ -class AlwaysLeTbigintTfloatLogicalFunction : public LogicalFunctionConcept { +class AlwaysLeTbigintTbigintLogicalFunction : public LogicalFunctionConcept { public: - static constexpr std::string_view NAME = "AlwaysLeTbigintTfloat"; + static constexpr std::string_view NAME = "AlwaysLeTbigintTbigint"; - AlwaysLeTbigintTfloatLogicalFunction(LogicalFunction value1, + AlwaysLeTbigintTbigintLogicalFunction(LogicalFunction value1, LogicalFunction value2, LogicalFunction ts); diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysLeTintTintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysLeTintTintLogicalFunction.hpp index 337148ee0e..3b93fac232 100644 --- a/nes-logical-operators/include/Functions/Meos/AlwaysLeTintTintLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/AlwaysLeTintTintLogicalFunction.hpp @@ -28,11 +28,11 @@ namespace NES { * `always_le_tint_tfloat`. Takes (value1:FLOAT64, value2:FLOAT64, ts:UINT64), * constructs two single-instant temporals, applies the comparison, and returns FLOAT64 (0.0/1.0). */ -class AlwaysLeTintTfloatLogicalFunction : public LogicalFunctionConcept { +class AlwaysLeTintTintLogicalFunction : public LogicalFunctionConcept { public: - static constexpr std::string_view NAME = "AlwaysLeTintTfloat"; + static constexpr std::string_view NAME = "AlwaysLeTintTint"; - AlwaysLeTintTfloatLogicalFunction(LogicalFunction value1, + AlwaysLeTintTintLogicalFunction(LogicalFunction value1, LogicalFunction value2, LogicalFunction ts); diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysLtTbigintTbigintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysLtTbigintTbigintLogicalFunction.hpp index bef92d195e..00a1ebe2c7 100644 --- a/nes-logical-operators/include/Functions/Meos/AlwaysLtTbigintTbigintLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/AlwaysLtTbigintTbigintLogicalFunction.hpp @@ -28,11 +28,11 @@ namespace NES { * `always_lt_tbigint_tfloat`. Takes (value1:FLOAT64, value2:FLOAT64, ts:UINT64), * constructs two single-instant temporals, applies the comparison, and returns FLOAT64 (0.0/1.0). */ -class AlwaysLtTbigintTfloatLogicalFunction : public LogicalFunctionConcept { +class AlwaysLtTbigintTbigintLogicalFunction : public LogicalFunctionConcept { public: - static constexpr std::string_view NAME = "AlwaysLtTbigintTfloat"; + static constexpr std::string_view NAME = "AlwaysLtTbigintTbigint"; - AlwaysLtTbigintTfloatLogicalFunction(LogicalFunction value1, + AlwaysLtTbigintTbigintLogicalFunction(LogicalFunction value1, LogicalFunction value2, LogicalFunction ts); diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysLtTintTintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysLtTintTintLogicalFunction.hpp index 0a9b5343c1..36ca1b4f50 100644 --- a/nes-logical-operators/include/Functions/Meos/AlwaysLtTintTintLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/AlwaysLtTintTintLogicalFunction.hpp @@ -28,11 +28,11 @@ namespace NES { * `always_lt_tint_tfloat`. Takes (value1:FLOAT64, value2:FLOAT64, ts:UINT64), * constructs two single-instant temporals, applies the comparison, and returns FLOAT64 (0.0/1.0). */ -class AlwaysLtTintTfloatLogicalFunction : public LogicalFunctionConcept { +class AlwaysLtTintTintLogicalFunction : public LogicalFunctionConcept { public: - static constexpr std::string_view NAME = "AlwaysLtTintTfloat"; + static constexpr std::string_view NAME = "AlwaysLtTintTint"; - AlwaysLtTintTfloatLogicalFunction(LogicalFunction value1, + AlwaysLtTintTintLogicalFunction(LogicalFunction value1, LogicalFunction value2, LogicalFunction ts); diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysNeTbigintTbigintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysNeTbigintTbigintLogicalFunction.hpp index 47801d4c53..c1bc0fee32 100644 --- a/nes-logical-operators/include/Functions/Meos/AlwaysNeTbigintTbigintLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/AlwaysNeTbigintTbigintLogicalFunction.hpp @@ -28,11 +28,11 @@ namespace NES { * `always_ne_tbigint_tfloat`. Takes (value1:FLOAT64, value2:FLOAT64, ts:UINT64), * constructs two single-instant temporals, applies the comparison, and returns FLOAT64 (0.0/1.0). */ -class AlwaysNeTbigintTfloatLogicalFunction : public LogicalFunctionConcept { +class AlwaysNeTbigintTbigintLogicalFunction : public LogicalFunctionConcept { public: - static constexpr std::string_view NAME = "AlwaysNeTbigintTfloat"; + static constexpr std::string_view NAME = "AlwaysNeTbigintTbigint"; - AlwaysNeTbigintTfloatLogicalFunction(LogicalFunction value1, + AlwaysNeTbigintTbigintLogicalFunction(LogicalFunction value1, LogicalFunction value2, LogicalFunction ts); diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysNeTintTintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysNeTintTintLogicalFunction.hpp index 73341c243e..b0a8fcb573 100644 --- a/nes-logical-operators/include/Functions/Meos/AlwaysNeTintTintLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/AlwaysNeTintTintLogicalFunction.hpp @@ -28,11 +28,11 @@ namespace NES { * `always_ne_tint_tfloat`. Takes (value1:FLOAT64, value2:FLOAT64, ts:UINT64), * constructs two single-instant temporals, applies the comparison, and returns FLOAT64 (0.0/1.0). */ -class AlwaysNeTintTfloatLogicalFunction : public LogicalFunctionConcept { +class AlwaysNeTintTintLogicalFunction : public LogicalFunctionConcept { public: - static constexpr std::string_view NAME = "AlwaysNeTintTfloat"; + static constexpr std::string_view NAME = "AlwaysNeTintTint"; - AlwaysNeTintTfloatLogicalFunction(LogicalFunction value1, + AlwaysNeTintTintLogicalFunction(LogicalFunction value1, LogicalFunction value2, LogicalFunction ts); diff --git a/nes-logical-operators/include/Functions/Meos/EverEqTbigintTbigintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverEqTbigintTbigintLogicalFunction.hpp index 51cd3d91d3..017259ffdc 100644 --- a/nes-logical-operators/include/Functions/Meos/EverEqTbigintTbigintLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/EverEqTbigintTbigintLogicalFunction.hpp @@ -28,11 +28,11 @@ namespace NES { * `ever_eq_tbigint_tfloat`. Takes (value1:FLOAT64, value2:FLOAT64, ts:UINT64), * constructs two single-instant temporals, applies the comparison, and returns FLOAT64 (0.0/1.0). */ -class EverEqTbigintTfloatLogicalFunction : public LogicalFunctionConcept { +class EverEqTbigintTbigintLogicalFunction : public LogicalFunctionConcept { public: - static constexpr std::string_view NAME = "EverEqTbigintTfloat"; + static constexpr std::string_view NAME = "EverEqTbigintTbigint"; - EverEqTbigintTfloatLogicalFunction(LogicalFunction value1, + EverEqTbigintTbigintLogicalFunction(LogicalFunction value1, LogicalFunction value2, LogicalFunction ts); diff --git a/nes-logical-operators/include/Functions/Meos/EverEqTintTintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverEqTintTintLogicalFunction.hpp index 7ec4f8404c..a644d244d8 100644 --- a/nes-logical-operators/include/Functions/Meos/EverEqTintTintLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/EverEqTintTintLogicalFunction.hpp @@ -28,11 +28,11 @@ namespace NES { * `ever_eq_tint_tfloat`. Takes (value1:FLOAT64, value2:FLOAT64, ts:UINT64), * constructs two single-instant temporals, applies the comparison, and returns FLOAT64 (0.0/1.0). */ -class EverEqTintTfloatLogicalFunction : public LogicalFunctionConcept { +class EverEqTintTintLogicalFunction : public LogicalFunctionConcept { public: - static constexpr std::string_view NAME = "EverEqTintTfloat"; + static constexpr std::string_view NAME = "EverEqTintTint"; - EverEqTintTfloatLogicalFunction(LogicalFunction value1, + EverEqTintTintLogicalFunction(LogicalFunction value1, LogicalFunction value2, LogicalFunction ts); diff --git a/nes-logical-operators/include/Functions/Meos/EverGeTbigintTbigintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverGeTbigintTbigintLogicalFunction.hpp index a69bc81c9e..37142f7d61 100644 --- a/nes-logical-operators/include/Functions/Meos/EverGeTbigintTbigintLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/EverGeTbigintTbigintLogicalFunction.hpp @@ -28,11 +28,11 @@ namespace NES { * `ever_ge_tbigint_tfloat`. Takes (value1:FLOAT64, value2:FLOAT64, ts:UINT64), * constructs two single-instant temporals, applies the comparison, and returns FLOAT64 (0.0/1.0). */ -class EverGeTbigintTfloatLogicalFunction : public LogicalFunctionConcept { +class EverGeTbigintTbigintLogicalFunction : public LogicalFunctionConcept { public: - static constexpr std::string_view NAME = "EverGeTbigintTfloat"; + static constexpr std::string_view NAME = "EverGeTbigintTbigint"; - EverGeTbigintTfloatLogicalFunction(LogicalFunction value1, + EverGeTbigintTbigintLogicalFunction(LogicalFunction value1, LogicalFunction value2, LogicalFunction ts); diff --git a/nes-logical-operators/include/Functions/Meos/EverGeTintTintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverGeTintTintLogicalFunction.hpp index c3ecd8b446..3bd4885934 100644 --- a/nes-logical-operators/include/Functions/Meos/EverGeTintTintLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/EverGeTintTintLogicalFunction.hpp @@ -28,11 +28,11 @@ namespace NES { * `ever_ge_tint_tfloat`. Takes (value1:FLOAT64, value2:FLOAT64, ts:UINT64), * constructs two single-instant temporals, applies the comparison, and returns FLOAT64 (0.0/1.0). */ -class EverGeTintTfloatLogicalFunction : public LogicalFunctionConcept { +class EverGeTintTintLogicalFunction : public LogicalFunctionConcept { public: - static constexpr std::string_view NAME = "EverGeTintTfloat"; + static constexpr std::string_view NAME = "EverGeTintTint"; - EverGeTintTfloatLogicalFunction(LogicalFunction value1, + EverGeTintTintLogicalFunction(LogicalFunction value1, LogicalFunction value2, LogicalFunction ts); diff --git a/nes-logical-operators/include/Functions/Meos/EverGtTbigintTbigintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverGtTbigintTbigintLogicalFunction.hpp index cfba85ca24..837cf44504 100644 --- a/nes-logical-operators/include/Functions/Meos/EverGtTbigintTbigintLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/EverGtTbigintTbigintLogicalFunction.hpp @@ -28,11 +28,11 @@ namespace NES { * `ever_gt_tbigint_tfloat`. Takes (value1:FLOAT64, value2:FLOAT64, ts:UINT64), * constructs two single-instant temporals, applies the comparison, and returns FLOAT64 (0.0/1.0). */ -class EverGtTbigintTfloatLogicalFunction : public LogicalFunctionConcept { +class EverGtTbigintTbigintLogicalFunction : public LogicalFunctionConcept { public: - static constexpr std::string_view NAME = "EverGtTbigintTfloat"; + static constexpr std::string_view NAME = "EverGtTbigintTbigint"; - EverGtTbigintTfloatLogicalFunction(LogicalFunction value1, + EverGtTbigintTbigintLogicalFunction(LogicalFunction value1, LogicalFunction value2, LogicalFunction ts); diff --git a/nes-logical-operators/include/Functions/Meos/EverGtTintTintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverGtTintTintLogicalFunction.hpp index 03d8dbfcdd..60eb612539 100644 --- a/nes-logical-operators/include/Functions/Meos/EverGtTintTintLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/EverGtTintTintLogicalFunction.hpp @@ -28,11 +28,11 @@ namespace NES { * `ever_gt_tint_tfloat`. Takes (value1:FLOAT64, value2:FLOAT64, ts:UINT64), * constructs two single-instant temporals, applies the comparison, and returns FLOAT64 (0.0/1.0). */ -class EverGtTintTfloatLogicalFunction : public LogicalFunctionConcept { +class EverGtTintTintLogicalFunction : public LogicalFunctionConcept { public: - static constexpr std::string_view NAME = "EverGtTintTfloat"; + static constexpr std::string_view NAME = "EverGtTintTint"; - EverGtTintTfloatLogicalFunction(LogicalFunction value1, + EverGtTintTintLogicalFunction(LogicalFunction value1, LogicalFunction value2, LogicalFunction ts); diff --git a/nes-logical-operators/include/Functions/Meos/EverLeTbigintTbigintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverLeTbigintTbigintLogicalFunction.hpp index 941fa3b879..eea6641179 100644 --- a/nes-logical-operators/include/Functions/Meos/EverLeTbigintTbigintLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/EverLeTbigintTbigintLogicalFunction.hpp @@ -28,11 +28,11 @@ namespace NES { * `ever_le_tbigint_tfloat`. Takes (value1:FLOAT64, value2:FLOAT64, ts:UINT64), * constructs two single-instant temporals, applies the comparison, and returns FLOAT64 (0.0/1.0). */ -class EverLeTbigintTfloatLogicalFunction : public LogicalFunctionConcept { +class EverLeTbigintTbigintLogicalFunction : public LogicalFunctionConcept { public: - static constexpr std::string_view NAME = "EverLeTbigintTfloat"; + static constexpr std::string_view NAME = "EverLeTbigintTbigint"; - EverLeTbigintTfloatLogicalFunction(LogicalFunction value1, + EverLeTbigintTbigintLogicalFunction(LogicalFunction value1, LogicalFunction value2, LogicalFunction ts); diff --git a/nes-logical-operators/include/Functions/Meos/EverLeTintTintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverLeTintTintLogicalFunction.hpp index be4bf55c75..2d0fdadbb9 100644 --- a/nes-logical-operators/include/Functions/Meos/EverLeTintTintLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/EverLeTintTintLogicalFunction.hpp @@ -28,11 +28,11 @@ namespace NES { * `ever_le_tint_tfloat`. Takes (value1:FLOAT64, value2:FLOAT64, ts:UINT64), * constructs two single-instant temporals, applies the comparison, and returns FLOAT64 (0.0/1.0). */ -class EverLeTintTfloatLogicalFunction : public LogicalFunctionConcept { +class EverLeTintTintLogicalFunction : public LogicalFunctionConcept { public: - static constexpr std::string_view NAME = "EverLeTintTfloat"; + static constexpr std::string_view NAME = "EverLeTintTint"; - EverLeTintTfloatLogicalFunction(LogicalFunction value1, + EverLeTintTintLogicalFunction(LogicalFunction value1, LogicalFunction value2, LogicalFunction ts); diff --git a/nes-logical-operators/include/Functions/Meos/EverLtTbigintTbigintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverLtTbigintTbigintLogicalFunction.hpp index a7069b03a1..6fc6916421 100644 --- a/nes-logical-operators/include/Functions/Meos/EverLtTbigintTbigintLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/EverLtTbigintTbigintLogicalFunction.hpp @@ -28,11 +28,11 @@ namespace NES { * `ever_lt_tbigint_tfloat`. Takes (value1:FLOAT64, value2:FLOAT64, ts:UINT64), * constructs two single-instant temporals, applies the comparison, and returns FLOAT64 (0.0/1.0). */ -class EverLtTbigintTfloatLogicalFunction : public LogicalFunctionConcept { +class EverLtTbigintTbigintLogicalFunction : public LogicalFunctionConcept { public: - static constexpr std::string_view NAME = "EverLtTbigintTfloat"; + static constexpr std::string_view NAME = "EverLtTbigintTbigint"; - EverLtTbigintTfloatLogicalFunction(LogicalFunction value1, + EverLtTbigintTbigintLogicalFunction(LogicalFunction value1, LogicalFunction value2, LogicalFunction ts); diff --git a/nes-logical-operators/include/Functions/Meos/EverLtTintTintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverLtTintTintLogicalFunction.hpp index 094d80a783..3167f87334 100644 --- a/nes-logical-operators/include/Functions/Meos/EverLtTintTintLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/EverLtTintTintLogicalFunction.hpp @@ -28,11 +28,11 @@ namespace NES { * `ever_lt_tint_tfloat`. Takes (value1:FLOAT64, value2:FLOAT64, ts:UINT64), * constructs two single-instant temporals, applies the comparison, and returns FLOAT64 (0.0/1.0). */ -class EverLtTintTfloatLogicalFunction : public LogicalFunctionConcept { +class EverLtTintTintLogicalFunction : public LogicalFunctionConcept { public: - static constexpr std::string_view NAME = "EverLtTintTfloat"; + static constexpr std::string_view NAME = "EverLtTintTint"; - EverLtTintTfloatLogicalFunction(LogicalFunction value1, + EverLtTintTintLogicalFunction(LogicalFunction value1, LogicalFunction value2, LogicalFunction ts); diff --git a/nes-logical-operators/include/Functions/Meos/EverNeTbigintTbigintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverNeTbigintTbigintLogicalFunction.hpp index db0619a55b..94a696be48 100644 --- a/nes-logical-operators/include/Functions/Meos/EverNeTbigintTbigintLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/EverNeTbigintTbigintLogicalFunction.hpp @@ -28,11 +28,11 @@ namespace NES { * `ever_ne_tbigint_tfloat`. Takes (value1:FLOAT64, value2:FLOAT64, ts:UINT64), * constructs two single-instant temporals, applies the comparison, and returns FLOAT64 (0.0/1.0). */ -class EverNeTbigintTfloatLogicalFunction : public LogicalFunctionConcept { +class EverNeTbigintTbigintLogicalFunction : public LogicalFunctionConcept { public: - static constexpr std::string_view NAME = "EverNeTbigintTfloat"; + static constexpr std::string_view NAME = "EverNeTbigintTbigint"; - EverNeTbigintTfloatLogicalFunction(LogicalFunction value1, + EverNeTbigintTbigintLogicalFunction(LogicalFunction value1, LogicalFunction value2, LogicalFunction ts); diff --git a/nes-logical-operators/include/Functions/Meos/EverNeTintTintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverNeTintTintLogicalFunction.hpp index ae4ac26264..6fa3556589 100644 --- a/nes-logical-operators/include/Functions/Meos/EverNeTintTintLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/EverNeTintTintLogicalFunction.hpp @@ -28,11 +28,11 @@ namespace NES { * `ever_ne_tint_tfloat`. Takes (value1:FLOAT64, value2:FLOAT64, ts:UINT64), * constructs two single-instant temporals, applies the comparison, and returns FLOAT64 (0.0/1.0). */ -class EverNeTintTfloatLogicalFunction : public LogicalFunctionConcept { +class EverNeTintTintLogicalFunction : public LogicalFunctionConcept { public: - static constexpr std::string_view NAME = "EverNeTintTfloat"; + static constexpr std::string_view NAME = "EverNeTintTint"; - EverNeTintTfloatLogicalFunction(LogicalFunction value1, + EverNeTintTintLogicalFunction(LogicalFunction value1, LogicalFunction value2, LogicalFunction ts); diff --git a/nes-logical-operators/include/Functions/Meos/TboolToTintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TboolToTintLogicalFunction.hpp new file mode 100644 index 0000000000..08065ed414 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TboolToTintLogicalFunction.hpp @@ -0,0 +1,53 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event tbool_to_tint: single-instant tbool cast to tint, result extracted -> double. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `tbool_to_tint`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. + */ +class TboolToTintLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TboolToTint"; + + TboolToTintLogicalFunction(LogicalFunction value, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysEqTbigintTbigintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysEqTbigintTbigintLogicalFunction.cpp index 7ca05704e4..6cf3e70c08 100644 --- a/nes-logical-operators/src/Functions/Meos/AlwaysEqTbigintTbigintLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/AlwaysEqTbigintTbigintLogicalFunction.cpp @@ -12,7 +12,7 @@ limitations under the License. */ -#include +#include #include #include @@ -26,7 +26,7 @@ namespace NES { -AlwaysEqTbigintTfloatLogicalFunction::AlwaysEqTbigintTfloatLogicalFunction(LogicalFunction value1, +AlwaysEqTbigintTbigintLogicalFunction::AlwaysEqTbigintTbigintLogicalFunction(LogicalFunction value1, LogicalFunction value2, LogicalFunction ts) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) @@ -37,31 +37,31 @@ AlwaysEqTbigintTfloatLogicalFunction::AlwaysEqTbigintTfloatLogicalFunction(Logic parameters.push_back(std::move(ts)); } -DataType AlwaysEqTbigintTfloatLogicalFunction::getDataType() const { return dataType; } +DataType AlwaysEqTbigintTbigintLogicalFunction::getDataType() const { return dataType; } -LogicalFunction AlwaysEqTbigintTfloatLogicalFunction::withDataType(const DataType& newDataType) const +LogicalFunction AlwaysEqTbigintTbigintLogicalFunction::withDataType(const DataType& newDataType) const { auto copy = *this; copy.dataType = newDataType; return copy; } -std::vector AlwaysEqTbigintTfloatLogicalFunction::getChildren() const { return parameters; } +std::vector AlwaysEqTbigintTbigintLogicalFunction::getChildren() const { return parameters; } -LogicalFunction AlwaysEqTbigintTfloatLogicalFunction::withChildren(const std::vector& children) const +LogicalFunction AlwaysEqTbigintTbigintLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 3, "AlwaysEqTbigintTfloatLogicalFunction requires 3 children, but got {}", children.size()); + PRECONDITION(children.size() == 3, "AlwaysEqTbigintTbigintLogicalFunction requires 3 children, but got {}", children.size()); auto copy = *this; copy.parameters = children; return copy; } -std::string_view AlwaysEqTbigintTfloatLogicalFunction::getType() const { return NAME; } +std::string_view AlwaysEqTbigintTbigintLogicalFunction::getType() const { return NAME; } -bool AlwaysEqTbigintTfloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +bool AlwaysEqTbigintTbigintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { - if (const auto* other = dynamic_cast(&rhs)) + if (const auto* other = dynamic_cast(&rhs)) return parameters == other->parameters; return false; } -std::string AlwaysEqTbigintTfloatLogicalFunction::explain(ExplainVerbosity verbosity) const +std::string AlwaysEqTbigintTbigintLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; for (size_t index = 0; index < parameters.size(); ++index) { @@ -71,7 +71,7 @@ std::string AlwaysEqTbigintTfloatLogicalFunction::explain(ExplainVerbosity verbo return fmt::format("{}({})", NAME, args); } -LogicalFunction AlwaysEqTbigintTfloatLogicalFunction::withInferredDataType(const Schema& schema) const +LogicalFunction AlwaysEqTbigintTbigintLogicalFunction::withInferredDataType(const Schema& schema) const { std::vector newChildren; newChildren.reserve(parameters.size()); @@ -80,7 +80,7 @@ LogicalFunction AlwaysEqTbigintTfloatLogicalFunction::withInferredDataType(const return withChildren(newChildren); } -SerializableFunction AlwaysEqTbigintTfloatLogicalFunction::serialize() const +SerializableFunction AlwaysEqTbigintTbigintLogicalFunction::serialize() const { SerializableFunction proto; proto.set_function_type(std::string(NAME)); @@ -90,16 +90,16 @@ SerializableFunction AlwaysEqTbigintTfloatLogicalFunction::serialize() const return proto; } -LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysEqTbigintTfloatLogicalFunction( +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysEqTbigintTbigintLogicalFunction( LogicalFunctionRegistryArguments arguments) { PRECONDITION(arguments.children.size() == 3, - "AlwaysEqTbigintTfloatLogicalFunction requires 3 children but got {}", + "AlwaysEqTbigintTbigintLogicalFunction requires 3 children but got {}", arguments.children.size()); auto arg0 = std::move(arguments.children[0]); auto arg1 = std::move(arguments.children[1]); auto arg2 = std::move(arguments.children[2]); - return AlwaysEqTbigintTfloatLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); + return AlwaysEqTbigintTbigintLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysEqTintTintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysEqTintTintLogicalFunction.cpp index 4cdcffdd64..0fefb0d570 100644 --- a/nes-logical-operators/src/Functions/Meos/AlwaysEqTintTintLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/AlwaysEqTintTintLogicalFunction.cpp @@ -12,7 +12,7 @@ limitations under the License. */ -#include +#include #include #include @@ -26,7 +26,7 @@ namespace NES { -AlwaysEqTintTfloatLogicalFunction::AlwaysEqTintTfloatLogicalFunction(LogicalFunction value1, +AlwaysEqTintTintLogicalFunction::AlwaysEqTintTintLogicalFunction(LogicalFunction value1, LogicalFunction value2, LogicalFunction ts) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) @@ -37,31 +37,31 @@ AlwaysEqTintTfloatLogicalFunction::AlwaysEqTintTfloatLogicalFunction(LogicalFunc parameters.push_back(std::move(ts)); } -DataType AlwaysEqTintTfloatLogicalFunction::getDataType() const { return dataType; } +DataType AlwaysEqTintTintLogicalFunction::getDataType() const { return dataType; } -LogicalFunction AlwaysEqTintTfloatLogicalFunction::withDataType(const DataType& newDataType) const +LogicalFunction AlwaysEqTintTintLogicalFunction::withDataType(const DataType& newDataType) const { auto copy = *this; copy.dataType = newDataType; return copy; } -std::vector AlwaysEqTintTfloatLogicalFunction::getChildren() const { return parameters; } +std::vector AlwaysEqTintTintLogicalFunction::getChildren() const { return parameters; } -LogicalFunction AlwaysEqTintTfloatLogicalFunction::withChildren(const std::vector& children) const +LogicalFunction AlwaysEqTintTintLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 3, "AlwaysEqTintTfloatLogicalFunction requires 3 children, but got {}", children.size()); + PRECONDITION(children.size() == 3, "AlwaysEqTintTintLogicalFunction requires 3 children, but got {}", children.size()); auto copy = *this; copy.parameters = children; return copy; } -std::string_view AlwaysEqTintTfloatLogicalFunction::getType() const { return NAME; } +std::string_view AlwaysEqTintTintLogicalFunction::getType() const { return NAME; } -bool AlwaysEqTintTfloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +bool AlwaysEqTintTintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { - if (const auto* other = dynamic_cast(&rhs)) + if (const auto* other = dynamic_cast(&rhs)) return parameters == other->parameters; return false; } -std::string AlwaysEqTintTfloatLogicalFunction::explain(ExplainVerbosity verbosity) const +std::string AlwaysEqTintTintLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; for (size_t index = 0; index < parameters.size(); ++index) { @@ -71,7 +71,7 @@ std::string AlwaysEqTintTfloatLogicalFunction::explain(ExplainVerbosity verbosit return fmt::format("{}({})", NAME, args); } -LogicalFunction AlwaysEqTintTfloatLogicalFunction::withInferredDataType(const Schema& schema) const +LogicalFunction AlwaysEqTintTintLogicalFunction::withInferredDataType(const Schema& schema) const { std::vector newChildren; newChildren.reserve(parameters.size()); @@ -80,7 +80,7 @@ LogicalFunction AlwaysEqTintTfloatLogicalFunction::withInferredDataType(const Sc return withChildren(newChildren); } -SerializableFunction AlwaysEqTintTfloatLogicalFunction::serialize() const +SerializableFunction AlwaysEqTintTintLogicalFunction::serialize() const { SerializableFunction proto; proto.set_function_type(std::string(NAME)); @@ -90,16 +90,16 @@ SerializableFunction AlwaysEqTintTfloatLogicalFunction::serialize() const return proto; } -LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysEqTintTfloatLogicalFunction( +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysEqTintTintLogicalFunction( LogicalFunctionRegistryArguments arguments) { PRECONDITION(arguments.children.size() == 3, - "AlwaysEqTintTfloatLogicalFunction requires 3 children but got {}", + "AlwaysEqTintTintLogicalFunction requires 3 children but got {}", arguments.children.size()); auto arg0 = std::move(arguments.children[0]); auto arg1 = std::move(arguments.children[1]); auto arg2 = std::move(arguments.children[2]); - return AlwaysEqTintTfloatLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); + return AlwaysEqTintTintLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysGeTbigintTbigintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysGeTbigintTbigintLogicalFunction.cpp index b97bd4c734..fb013e891c 100644 --- a/nes-logical-operators/src/Functions/Meos/AlwaysGeTbigintTbigintLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/AlwaysGeTbigintTbigintLogicalFunction.cpp @@ -12,7 +12,7 @@ limitations under the License. */ -#include +#include #include #include @@ -26,7 +26,7 @@ namespace NES { -AlwaysGeTbigintTfloatLogicalFunction::AlwaysGeTbigintTfloatLogicalFunction(LogicalFunction value1, +AlwaysGeTbigintTbigintLogicalFunction::AlwaysGeTbigintTbigintLogicalFunction(LogicalFunction value1, LogicalFunction value2, LogicalFunction ts) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) @@ -37,31 +37,31 @@ AlwaysGeTbigintTfloatLogicalFunction::AlwaysGeTbigintTfloatLogicalFunction(Logic parameters.push_back(std::move(ts)); } -DataType AlwaysGeTbigintTfloatLogicalFunction::getDataType() const { return dataType; } +DataType AlwaysGeTbigintTbigintLogicalFunction::getDataType() const { return dataType; } -LogicalFunction AlwaysGeTbigintTfloatLogicalFunction::withDataType(const DataType& newDataType) const +LogicalFunction AlwaysGeTbigintTbigintLogicalFunction::withDataType(const DataType& newDataType) const { auto copy = *this; copy.dataType = newDataType; return copy; } -std::vector AlwaysGeTbigintTfloatLogicalFunction::getChildren() const { return parameters; } +std::vector AlwaysGeTbigintTbigintLogicalFunction::getChildren() const { return parameters; } -LogicalFunction AlwaysGeTbigintTfloatLogicalFunction::withChildren(const std::vector& children) const +LogicalFunction AlwaysGeTbigintTbigintLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 3, "AlwaysGeTbigintTfloatLogicalFunction requires 3 children, but got {}", children.size()); + PRECONDITION(children.size() == 3, "AlwaysGeTbigintTbigintLogicalFunction requires 3 children, but got {}", children.size()); auto copy = *this; copy.parameters = children; return copy; } -std::string_view AlwaysGeTbigintTfloatLogicalFunction::getType() const { return NAME; } +std::string_view AlwaysGeTbigintTbigintLogicalFunction::getType() const { return NAME; } -bool AlwaysGeTbigintTfloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +bool AlwaysGeTbigintTbigintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { - if (const auto* other = dynamic_cast(&rhs)) + if (const auto* other = dynamic_cast(&rhs)) return parameters == other->parameters; return false; } -std::string AlwaysGeTbigintTfloatLogicalFunction::explain(ExplainVerbosity verbosity) const +std::string AlwaysGeTbigintTbigintLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; for (size_t index = 0; index < parameters.size(); ++index) { @@ -71,7 +71,7 @@ std::string AlwaysGeTbigintTfloatLogicalFunction::explain(ExplainVerbosity verbo return fmt::format("{}({})", NAME, args); } -LogicalFunction AlwaysGeTbigintTfloatLogicalFunction::withInferredDataType(const Schema& schema) const +LogicalFunction AlwaysGeTbigintTbigintLogicalFunction::withInferredDataType(const Schema& schema) const { std::vector newChildren; newChildren.reserve(parameters.size()); @@ -80,7 +80,7 @@ LogicalFunction AlwaysGeTbigintTfloatLogicalFunction::withInferredDataType(const return withChildren(newChildren); } -SerializableFunction AlwaysGeTbigintTfloatLogicalFunction::serialize() const +SerializableFunction AlwaysGeTbigintTbigintLogicalFunction::serialize() const { SerializableFunction proto; proto.set_function_type(std::string(NAME)); @@ -90,16 +90,16 @@ SerializableFunction AlwaysGeTbigintTfloatLogicalFunction::serialize() const return proto; } -LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysGeTbigintTfloatLogicalFunction( +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysGeTbigintTbigintLogicalFunction( LogicalFunctionRegistryArguments arguments) { PRECONDITION(arguments.children.size() == 3, - "AlwaysGeTbigintTfloatLogicalFunction requires 3 children but got {}", + "AlwaysGeTbigintTbigintLogicalFunction requires 3 children but got {}", arguments.children.size()); auto arg0 = std::move(arguments.children[0]); auto arg1 = std::move(arguments.children[1]); auto arg2 = std::move(arguments.children[2]); - return AlwaysGeTbigintTfloatLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); + return AlwaysGeTbigintTbigintLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysGeTintTintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysGeTintTintLogicalFunction.cpp index fb4f6f2a8e..7029bd2e0d 100644 --- a/nes-logical-operators/src/Functions/Meos/AlwaysGeTintTintLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/AlwaysGeTintTintLogicalFunction.cpp @@ -12,7 +12,7 @@ limitations under the License. */ -#include +#include #include #include @@ -26,7 +26,7 @@ namespace NES { -AlwaysGeTintTfloatLogicalFunction::AlwaysGeTintTfloatLogicalFunction(LogicalFunction value1, +AlwaysGeTintTintLogicalFunction::AlwaysGeTintTintLogicalFunction(LogicalFunction value1, LogicalFunction value2, LogicalFunction ts) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) @@ -37,31 +37,31 @@ AlwaysGeTintTfloatLogicalFunction::AlwaysGeTintTfloatLogicalFunction(LogicalFunc parameters.push_back(std::move(ts)); } -DataType AlwaysGeTintTfloatLogicalFunction::getDataType() const { return dataType; } +DataType AlwaysGeTintTintLogicalFunction::getDataType() const { return dataType; } -LogicalFunction AlwaysGeTintTfloatLogicalFunction::withDataType(const DataType& newDataType) const +LogicalFunction AlwaysGeTintTintLogicalFunction::withDataType(const DataType& newDataType) const { auto copy = *this; copy.dataType = newDataType; return copy; } -std::vector AlwaysGeTintTfloatLogicalFunction::getChildren() const { return parameters; } +std::vector AlwaysGeTintTintLogicalFunction::getChildren() const { return parameters; } -LogicalFunction AlwaysGeTintTfloatLogicalFunction::withChildren(const std::vector& children) const +LogicalFunction AlwaysGeTintTintLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 3, "AlwaysGeTintTfloatLogicalFunction requires 3 children, but got {}", children.size()); + PRECONDITION(children.size() == 3, "AlwaysGeTintTintLogicalFunction requires 3 children, but got {}", children.size()); auto copy = *this; copy.parameters = children; return copy; } -std::string_view AlwaysGeTintTfloatLogicalFunction::getType() const { return NAME; } +std::string_view AlwaysGeTintTintLogicalFunction::getType() const { return NAME; } -bool AlwaysGeTintTfloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +bool AlwaysGeTintTintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { - if (const auto* other = dynamic_cast(&rhs)) + if (const auto* other = dynamic_cast(&rhs)) return parameters == other->parameters; return false; } -std::string AlwaysGeTintTfloatLogicalFunction::explain(ExplainVerbosity verbosity) const +std::string AlwaysGeTintTintLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; for (size_t index = 0; index < parameters.size(); ++index) { @@ -71,7 +71,7 @@ std::string AlwaysGeTintTfloatLogicalFunction::explain(ExplainVerbosity verbosit return fmt::format("{}({})", NAME, args); } -LogicalFunction AlwaysGeTintTfloatLogicalFunction::withInferredDataType(const Schema& schema) const +LogicalFunction AlwaysGeTintTintLogicalFunction::withInferredDataType(const Schema& schema) const { std::vector newChildren; newChildren.reserve(parameters.size()); @@ -80,7 +80,7 @@ LogicalFunction AlwaysGeTintTfloatLogicalFunction::withInferredDataType(const Sc return withChildren(newChildren); } -SerializableFunction AlwaysGeTintTfloatLogicalFunction::serialize() const +SerializableFunction AlwaysGeTintTintLogicalFunction::serialize() const { SerializableFunction proto; proto.set_function_type(std::string(NAME)); @@ -90,16 +90,16 @@ SerializableFunction AlwaysGeTintTfloatLogicalFunction::serialize() const return proto; } -LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysGeTintTfloatLogicalFunction( +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysGeTintTintLogicalFunction( LogicalFunctionRegistryArguments arguments) { PRECONDITION(arguments.children.size() == 3, - "AlwaysGeTintTfloatLogicalFunction requires 3 children but got {}", + "AlwaysGeTintTintLogicalFunction requires 3 children but got {}", arguments.children.size()); auto arg0 = std::move(arguments.children[0]); auto arg1 = std::move(arguments.children[1]); auto arg2 = std::move(arguments.children[2]); - return AlwaysGeTintTfloatLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); + return AlwaysGeTintTintLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysGtTbigintTbigintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysGtTbigintTbigintLogicalFunction.cpp index 794de5ab88..5f6522a5e8 100644 --- a/nes-logical-operators/src/Functions/Meos/AlwaysGtTbigintTbigintLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/AlwaysGtTbigintTbigintLogicalFunction.cpp @@ -12,7 +12,7 @@ limitations under the License. */ -#include +#include #include #include @@ -26,7 +26,7 @@ namespace NES { -AlwaysGtTbigintTfloatLogicalFunction::AlwaysGtTbigintTfloatLogicalFunction(LogicalFunction value1, +AlwaysGtTbigintTbigintLogicalFunction::AlwaysGtTbigintTbigintLogicalFunction(LogicalFunction value1, LogicalFunction value2, LogicalFunction ts) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) @@ -37,31 +37,31 @@ AlwaysGtTbigintTfloatLogicalFunction::AlwaysGtTbigintTfloatLogicalFunction(Logic parameters.push_back(std::move(ts)); } -DataType AlwaysGtTbigintTfloatLogicalFunction::getDataType() const { return dataType; } +DataType AlwaysGtTbigintTbigintLogicalFunction::getDataType() const { return dataType; } -LogicalFunction AlwaysGtTbigintTfloatLogicalFunction::withDataType(const DataType& newDataType) const +LogicalFunction AlwaysGtTbigintTbigintLogicalFunction::withDataType(const DataType& newDataType) const { auto copy = *this; copy.dataType = newDataType; return copy; } -std::vector AlwaysGtTbigintTfloatLogicalFunction::getChildren() const { return parameters; } +std::vector AlwaysGtTbigintTbigintLogicalFunction::getChildren() const { return parameters; } -LogicalFunction AlwaysGtTbigintTfloatLogicalFunction::withChildren(const std::vector& children) const +LogicalFunction AlwaysGtTbigintTbigintLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 3, "AlwaysGtTbigintTfloatLogicalFunction requires 3 children, but got {}", children.size()); + PRECONDITION(children.size() == 3, "AlwaysGtTbigintTbigintLogicalFunction requires 3 children, but got {}", children.size()); auto copy = *this; copy.parameters = children; return copy; } -std::string_view AlwaysGtTbigintTfloatLogicalFunction::getType() const { return NAME; } +std::string_view AlwaysGtTbigintTbigintLogicalFunction::getType() const { return NAME; } -bool AlwaysGtTbigintTfloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +bool AlwaysGtTbigintTbigintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { - if (const auto* other = dynamic_cast(&rhs)) + if (const auto* other = dynamic_cast(&rhs)) return parameters == other->parameters; return false; } -std::string AlwaysGtTbigintTfloatLogicalFunction::explain(ExplainVerbosity verbosity) const +std::string AlwaysGtTbigintTbigintLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; for (size_t index = 0; index < parameters.size(); ++index) { @@ -71,7 +71,7 @@ std::string AlwaysGtTbigintTfloatLogicalFunction::explain(ExplainVerbosity verbo return fmt::format("{}({})", NAME, args); } -LogicalFunction AlwaysGtTbigintTfloatLogicalFunction::withInferredDataType(const Schema& schema) const +LogicalFunction AlwaysGtTbigintTbigintLogicalFunction::withInferredDataType(const Schema& schema) const { std::vector newChildren; newChildren.reserve(parameters.size()); @@ -80,7 +80,7 @@ LogicalFunction AlwaysGtTbigintTfloatLogicalFunction::withInferredDataType(const return withChildren(newChildren); } -SerializableFunction AlwaysGtTbigintTfloatLogicalFunction::serialize() const +SerializableFunction AlwaysGtTbigintTbigintLogicalFunction::serialize() const { SerializableFunction proto; proto.set_function_type(std::string(NAME)); @@ -90,16 +90,16 @@ SerializableFunction AlwaysGtTbigintTfloatLogicalFunction::serialize() const return proto; } -LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysGtTbigintTfloatLogicalFunction( +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysGtTbigintTbigintLogicalFunction( LogicalFunctionRegistryArguments arguments) { PRECONDITION(arguments.children.size() == 3, - "AlwaysGtTbigintTfloatLogicalFunction requires 3 children but got {}", + "AlwaysGtTbigintTbigintLogicalFunction requires 3 children but got {}", arguments.children.size()); auto arg0 = std::move(arguments.children[0]); auto arg1 = std::move(arguments.children[1]); auto arg2 = std::move(arguments.children[2]); - return AlwaysGtTbigintTfloatLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); + return AlwaysGtTbigintTbigintLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysGtTintTintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysGtTintTintLogicalFunction.cpp index 09c753625b..ac6ddd3730 100644 --- a/nes-logical-operators/src/Functions/Meos/AlwaysGtTintTintLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/AlwaysGtTintTintLogicalFunction.cpp @@ -12,7 +12,7 @@ limitations under the License. */ -#include +#include #include #include @@ -26,7 +26,7 @@ namespace NES { -AlwaysGtTintTfloatLogicalFunction::AlwaysGtTintTfloatLogicalFunction(LogicalFunction value1, +AlwaysGtTintTintLogicalFunction::AlwaysGtTintTintLogicalFunction(LogicalFunction value1, LogicalFunction value2, LogicalFunction ts) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) @@ -37,31 +37,31 @@ AlwaysGtTintTfloatLogicalFunction::AlwaysGtTintTfloatLogicalFunction(LogicalFunc parameters.push_back(std::move(ts)); } -DataType AlwaysGtTintTfloatLogicalFunction::getDataType() const { return dataType; } +DataType AlwaysGtTintTintLogicalFunction::getDataType() const { return dataType; } -LogicalFunction AlwaysGtTintTfloatLogicalFunction::withDataType(const DataType& newDataType) const +LogicalFunction AlwaysGtTintTintLogicalFunction::withDataType(const DataType& newDataType) const { auto copy = *this; copy.dataType = newDataType; return copy; } -std::vector AlwaysGtTintTfloatLogicalFunction::getChildren() const { return parameters; } +std::vector AlwaysGtTintTintLogicalFunction::getChildren() const { return parameters; } -LogicalFunction AlwaysGtTintTfloatLogicalFunction::withChildren(const std::vector& children) const +LogicalFunction AlwaysGtTintTintLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 3, "AlwaysGtTintTfloatLogicalFunction requires 3 children, but got {}", children.size()); + PRECONDITION(children.size() == 3, "AlwaysGtTintTintLogicalFunction requires 3 children, but got {}", children.size()); auto copy = *this; copy.parameters = children; return copy; } -std::string_view AlwaysGtTintTfloatLogicalFunction::getType() const { return NAME; } +std::string_view AlwaysGtTintTintLogicalFunction::getType() const { return NAME; } -bool AlwaysGtTintTfloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +bool AlwaysGtTintTintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { - if (const auto* other = dynamic_cast(&rhs)) + if (const auto* other = dynamic_cast(&rhs)) return parameters == other->parameters; return false; } -std::string AlwaysGtTintTfloatLogicalFunction::explain(ExplainVerbosity verbosity) const +std::string AlwaysGtTintTintLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; for (size_t index = 0; index < parameters.size(); ++index) { @@ -71,7 +71,7 @@ std::string AlwaysGtTintTfloatLogicalFunction::explain(ExplainVerbosity verbosit return fmt::format("{}({})", NAME, args); } -LogicalFunction AlwaysGtTintTfloatLogicalFunction::withInferredDataType(const Schema& schema) const +LogicalFunction AlwaysGtTintTintLogicalFunction::withInferredDataType(const Schema& schema) const { std::vector newChildren; newChildren.reserve(parameters.size()); @@ -80,7 +80,7 @@ LogicalFunction AlwaysGtTintTfloatLogicalFunction::withInferredDataType(const Sc return withChildren(newChildren); } -SerializableFunction AlwaysGtTintTfloatLogicalFunction::serialize() const +SerializableFunction AlwaysGtTintTintLogicalFunction::serialize() const { SerializableFunction proto; proto.set_function_type(std::string(NAME)); @@ -90,16 +90,16 @@ SerializableFunction AlwaysGtTintTfloatLogicalFunction::serialize() const return proto; } -LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysGtTintTfloatLogicalFunction( +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysGtTintTintLogicalFunction( LogicalFunctionRegistryArguments arguments) { PRECONDITION(arguments.children.size() == 3, - "AlwaysGtTintTfloatLogicalFunction requires 3 children but got {}", + "AlwaysGtTintTintLogicalFunction requires 3 children but got {}", arguments.children.size()); auto arg0 = std::move(arguments.children[0]); auto arg1 = std::move(arguments.children[1]); auto arg2 = std::move(arguments.children[2]); - return AlwaysGtTintTfloatLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); + return AlwaysGtTintTintLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysLeTbigintTbigintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysLeTbigintTbigintLogicalFunction.cpp index 33641ce8e0..0a306d9fb5 100644 --- a/nes-logical-operators/src/Functions/Meos/AlwaysLeTbigintTbigintLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/AlwaysLeTbigintTbigintLogicalFunction.cpp @@ -12,7 +12,7 @@ limitations under the License. */ -#include +#include #include #include @@ -26,7 +26,7 @@ namespace NES { -AlwaysLeTbigintTfloatLogicalFunction::AlwaysLeTbigintTfloatLogicalFunction(LogicalFunction value1, +AlwaysLeTbigintTbigintLogicalFunction::AlwaysLeTbigintTbigintLogicalFunction(LogicalFunction value1, LogicalFunction value2, LogicalFunction ts) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) @@ -37,31 +37,31 @@ AlwaysLeTbigintTfloatLogicalFunction::AlwaysLeTbigintTfloatLogicalFunction(Logic parameters.push_back(std::move(ts)); } -DataType AlwaysLeTbigintTfloatLogicalFunction::getDataType() const { return dataType; } +DataType AlwaysLeTbigintTbigintLogicalFunction::getDataType() const { return dataType; } -LogicalFunction AlwaysLeTbigintTfloatLogicalFunction::withDataType(const DataType& newDataType) const +LogicalFunction AlwaysLeTbigintTbigintLogicalFunction::withDataType(const DataType& newDataType) const { auto copy = *this; copy.dataType = newDataType; return copy; } -std::vector AlwaysLeTbigintTfloatLogicalFunction::getChildren() const { return parameters; } +std::vector AlwaysLeTbigintTbigintLogicalFunction::getChildren() const { return parameters; } -LogicalFunction AlwaysLeTbigintTfloatLogicalFunction::withChildren(const std::vector& children) const +LogicalFunction AlwaysLeTbigintTbigintLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 3, "AlwaysLeTbigintTfloatLogicalFunction requires 3 children, but got {}", children.size()); + PRECONDITION(children.size() == 3, "AlwaysLeTbigintTbigintLogicalFunction requires 3 children, but got {}", children.size()); auto copy = *this; copy.parameters = children; return copy; } -std::string_view AlwaysLeTbigintTfloatLogicalFunction::getType() const { return NAME; } +std::string_view AlwaysLeTbigintTbigintLogicalFunction::getType() const { return NAME; } -bool AlwaysLeTbigintTfloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +bool AlwaysLeTbigintTbigintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { - if (const auto* other = dynamic_cast(&rhs)) + if (const auto* other = dynamic_cast(&rhs)) return parameters == other->parameters; return false; } -std::string AlwaysLeTbigintTfloatLogicalFunction::explain(ExplainVerbosity verbosity) const +std::string AlwaysLeTbigintTbigintLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; for (size_t index = 0; index < parameters.size(); ++index) { @@ -71,7 +71,7 @@ std::string AlwaysLeTbigintTfloatLogicalFunction::explain(ExplainVerbosity verbo return fmt::format("{}({})", NAME, args); } -LogicalFunction AlwaysLeTbigintTfloatLogicalFunction::withInferredDataType(const Schema& schema) const +LogicalFunction AlwaysLeTbigintTbigintLogicalFunction::withInferredDataType(const Schema& schema) const { std::vector newChildren; newChildren.reserve(parameters.size()); @@ -80,7 +80,7 @@ LogicalFunction AlwaysLeTbigintTfloatLogicalFunction::withInferredDataType(const return withChildren(newChildren); } -SerializableFunction AlwaysLeTbigintTfloatLogicalFunction::serialize() const +SerializableFunction AlwaysLeTbigintTbigintLogicalFunction::serialize() const { SerializableFunction proto; proto.set_function_type(std::string(NAME)); @@ -90,16 +90,16 @@ SerializableFunction AlwaysLeTbigintTfloatLogicalFunction::serialize() const return proto; } -LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysLeTbigintTfloatLogicalFunction( +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysLeTbigintTbigintLogicalFunction( LogicalFunctionRegistryArguments arguments) { PRECONDITION(arguments.children.size() == 3, - "AlwaysLeTbigintTfloatLogicalFunction requires 3 children but got {}", + "AlwaysLeTbigintTbigintLogicalFunction requires 3 children but got {}", arguments.children.size()); auto arg0 = std::move(arguments.children[0]); auto arg1 = std::move(arguments.children[1]); auto arg2 = std::move(arguments.children[2]); - return AlwaysLeTbigintTfloatLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); + return AlwaysLeTbigintTbigintLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysLeTintTintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysLeTintTintLogicalFunction.cpp index 356758b0cc..f07de54f8e 100644 --- a/nes-logical-operators/src/Functions/Meos/AlwaysLeTintTintLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/AlwaysLeTintTintLogicalFunction.cpp @@ -12,7 +12,7 @@ limitations under the License. */ -#include +#include #include #include @@ -26,7 +26,7 @@ namespace NES { -AlwaysLeTintTfloatLogicalFunction::AlwaysLeTintTfloatLogicalFunction(LogicalFunction value1, +AlwaysLeTintTintLogicalFunction::AlwaysLeTintTintLogicalFunction(LogicalFunction value1, LogicalFunction value2, LogicalFunction ts) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) @@ -37,31 +37,31 @@ AlwaysLeTintTfloatLogicalFunction::AlwaysLeTintTfloatLogicalFunction(LogicalFunc parameters.push_back(std::move(ts)); } -DataType AlwaysLeTintTfloatLogicalFunction::getDataType() const { return dataType; } +DataType AlwaysLeTintTintLogicalFunction::getDataType() const { return dataType; } -LogicalFunction AlwaysLeTintTfloatLogicalFunction::withDataType(const DataType& newDataType) const +LogicalFunction AlwaysLeTintTintLogicalFunction::withDataType(const DataType& newDataType) const { auto copy = *this; copy.dataType = newDataType; return copy; } -std::vector AlwaysLeTintTfloatLogicalFunction::getChildren() const { return parameters; } +std::vector AlwaysLeTintTintLogicalFunction::getChildren() const { return parameters; } -LogicalFunction AlwaysLeTintTfloatLogicalFunction::withChildren(const std::vector& children) const +LogicalFunction AlwaysLeTintTintLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 3, "AlwaysLeTintTfloatLogicalFunction requires 3 children, but got {}", children.size()); + PRECONDITION(children.size() == 3, "AlwaysLeTintTintLogicalFunction requires 3 children, but got {}", children.size()); auto copy = *this; copy.parameters = children; return copy; } -std::string_view AlwaysLeTintTfloatLogicalFunction::getType() const { return NAME; } +std::string_view AlwaysLeTintTintLogicalFunction::getType() const { return NAME; } -bool AlwaysLeTintTfloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +bool AlwaysLeTintTintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { - if (const auto* other = dynamic_cast(&rhs)) + if (const auto* other = dynamic_cast(&rhs)) return parameters == other->parameters; return false; } -std::string AlwaysLeTintTfloatLogicalFunction::explain(ExplainVerbosity verbosity) const +std::string AlwaysLeTintTintLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; for (size_t index = 0; index < parameters.size(); ++index) { @@ -71,7 +71,7 @@ std::string AlwaysLeTintTfloatLogicalFunction::explain(ExplainVerbosity verbosit return fmt::format("{}({})", NAME, args); } -LogicalFunction AlwaysLeTintTfloatLogicalFunction::withInferredDataType(const Schema& schema) const +LogicalFunction AlwaysLeTintTintLogicalFunction::withInferredDataType(const Schema& schema) const { std::vector newChildren; newChildren.reserve(parameters.size()); @@ -80,7 +80,7 @@ LogicalFunction AlwaysLeTintTfloatLogicalFunction::withInferredDataType(const Sc return withChildren(newChildren); } -SerializableFunction AlwaysLeTintTfloatLogicalFunction::serialize() const +SerializableFunction AlwaysLeTintTintLogicalFunction::serialize() const { SerializableFunction proto; proto.set_function_type(std::string(NAME)); @@ -90,16 +90,16 @@ SerializableFunction AlwaysLeTintTfloatLogicalFunction::serialize() const return proto; } -LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysLeTintTfloatLogicalFunction( +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysLeTintTintLogicalFunction( LogicalFunctionRegistryArguments arguments) { PRECONDITION(arguments.children.size() == 3, - "AlwaysLeTintTfloatLogicalFunction requires 3 children but got {}", + "AlwaysLeTintTintLogicalFunction requires 3 children but got {}", arguments.children.size()); auto arg0 = std::move(arguments.children[0]); auto arg1 = std::move(arguments.children[1]); auto arg2 = std::move(arguments.children[2]); - return AlwaysLeTintTfloatLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); + return AlwaysLeTintTintLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysLtTbigintTbigintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysLtTbigintTbigintLogicalFunction.cpp index 38e012aebc..5077bf2a48 100644 --- a/nes-logical-operators/src/Functions/Meos/AlwaysLtTbigintTbigintLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/AlwaysLtTbigintTbigintLogicalFunction.cpp @@ -12,7 +12,7 @@ limitations under the License. */ -#include +#include #include #include @@ -26,7 +26,7 @@ namespace NES { -AlwaysLtTbigintTfloatLogicalFunction::AlwaysLtTbigintTfloatLogicalFunction(LogicalFunction value1, +AlwaysLtTbigintTbigintLogicalFunction::AlwaysLtTbigintTbigintLogicalFunction(LogicalFunction value1, LogicalFunction value2, LogicalFunction ts) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) @@ -37,31 +37,31 @@ AlwaysLtTbigintTfloatLogicalFunction::AlwaysLtTbigintTfloatLogicalFunction(Logic parameters.push_back(std::move(ts)); } -DataType AlwaysLtTbigintTfloatLogicalFunction::getDataType() const { return dataType; } +DataType AlwaysLtTbigintTbigintLogicalFunction::getDataType() const { return dataType; } -LogicalFunction AlwaysLtTbigintTfloatLogicalFunction::withDataType(const DataType& newDataType) const +LogicalFunction AlwaysLtTbigintTbigintLogicalFunction::withDataType(const DataType& newDataType) const { auto copy = *this; copy.dataType = newDataType; return copy; } -std::vector AlwaysLtTbigintTfloatLogicalFunction::getChildren() const { return parameters; } +std::vector AlwaysLtTbigintTbigintLogicalFunction::getChildren() const { return parameters; } -LogicalFunction AlwaysLtTbigintTfloatLogicalFunction::withChildren(const std::vector& children) const +LogicalFunction AlwaysLtTbigintTbigintLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 3, "AlwaysLtTbigintTfloatLogicalFunction requires 3 children, but got {}", children.size()); + PRECONDITION(children.size() == 3, "AlwaysLtTbigintTbigintLogicalFunction requires 3 children, but got {}", children.size()); auto copy = *this; copy.parameters = children; return copy; } -std::string_view AlwaysLtTbigintTfloatLogicalFunction::getType() const { return NAME; } +std::string_view AlwaysLtTbigintTbigintLogicalFunction::getType() const { return NAME; } -bool AlwaysLtTbigintTfloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +bool AlwaysLtTbigintTbigintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { - if (const auto* other = dynamic_cast(&rhs)) + if (const auto* other = dynamic_cast(&rhs)) return parameters == other->parameters; return false; } -std::string AlwaysLtTbigintTfloatLogicalFunction::explain(ExplainVerbosity verbosity) const +std::string AlwaysLtTbigintTbigintLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; for (size_t index = 0; index < parameters.size(); ++index) { @@ -71,7 +71,7 @@ std::string AlwaysLtTbigintTfloatLogicalFunction::explain(ExplainVerbosity verbo return fmt::format("{}({})", NAME, args); } -LogicalFunction AlwaysLtTbigintTfloatLogicalFunction::withInferredDataType(const Schema& schema) const +LogicalFunction AlwaysLtTbigintTbigintLogicalFunction::withInferredDataType(const Schema& schema) const { std::vector newChildren; newChildren.reserve(parameters.size()); @@ -80,7 +80,7 @@ LogicalFunction AlwaysLtTbigintTfloatLogicalFunction::withInferredDataType(const return withChildren(newChildren); } -SerializableFunction AlwaysLtTbigintTfloatLogicalFunction::serialize() const +SerializableFunction AlwaysLtTbigintTbigintLogicalFunction::serialize() const { SerializableFunction proto; proto.set_function_type(std::string(NAME)); @@ -90,16 +90,16 @@ SerializableFunction AlwaysLtTbigintTfloatLogicalFunction::serialize() const return proto; } -LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysLtTbigintTfloatLogicalFunction( +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysLtTbigintTbigintLogicalFunction( LogicalFunctionRegistryArguments arguments) { PRECONDITION(arguments.children.size() == 3, - "AlwaysLtTbigintTfloatLogicalFunction requires 3 children but got {}", + "AlwaysLtTbigintTbigintLogicalFunction requires 3 children but got {}", arguments.children.size()); auto arg0 = std::move(arguments.children[0]); auto arg1 = std::move(arguments.children[1]); auto arg2 = std::move(arguments.children[2]); - return AlwaysLtTbigintTfloatLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); + return AlwaysLtTbigintTbigintLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysLtTintTintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysLtTintTintLogicalFunction.cpp index e88014e58e..42cc4f81c5 100644 --- a/nes-logical-operators/src/Functions/Meos/AlwaysLtTintTintLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/AlwaysLtTintTintLogicalFunction.cpp @@ -12,7 +12,7 @@ limitations under the License. */ -#include +#include #include #include @@ -26,7 +26,7 @@ namespace NES { -AlwaysLtTintTfloatLogicalFunction::AlwaysLtTintTfloatLogicalFunction(LogicalFunction value1, +AlwaysLtTintTintLogicalFunction::AlwaysLtTintTintLogicalFunction(LogicalFunction value1, LogicalFunction value2, LogicalFunction ts) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) @@ -37,31 +37,31 @@ AlwaysLtTintTfloatLogicalFunction::AlwaysLtTintTfloatLogicalFunction(LogicalFunc parameters.push_back(std::move(ts)); } -DataType AlwaysLtTintTfloatLogicalFunction::getDataType() const { return dataType; } +DataType AlwaysLtTintTintLogicalFunction::getDataType() const { return dataType; } -LogicalFunction AlwaysLtTintTfloatLogicalFunction::withDataType(const DataType& newDataType) const +LogicalFunction AlwaysLtTintTintLogicalFunction::withDataType(const DataType& newDataType) const { auto copy = *this; copy.dataType = newDataType; return copy; } -std::vector AlwaysLtTintTfloatLogicalFunction::getChildren() const { return parameters; } +std::vector AlwaysLtTintTintLogicalFunction::getChildren() const { return parameters; } -LogicalFunction AlwaysLtTintTfloatLogicalFunction::withChildren(const std::vector& children) const +LogicalFunction AlwaysLtTintTintLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 3, "AlwaysLtTintTfloatLogicalFunction requires 3 children, but got {}", children.size()); + PRECONDITION(children.size() == 3, "AlwaysLtTintTintLogicalFunction requires 3 children, but got {}", children.size()); auto copy = *this; copy.parameters = children; return copy; } -std::string_view AlwaysLtTintTfloatLogicalFunction::getType() const { return NAME; } +std::string_view AlwaysLtTintTintLogicalFunction::getType() const { return NAME; } -bool AlwaysLtTintTfloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +bool AlwaysLtTintTintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { - if (const auto* other = dynamic_cast(&rhs)) + if (const auto* other = dynamic_cast(&rhs)) return parameters == other->parameters; return false; } -std::string AlwaysLtTintTfloatLogicalFunction::explain(ExplainVerbosity verbosity) const +std::string AlwaysLtTintTintLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; for (size_t index = 0; index < parameters.size(); ++index) { @@ -71,7 +71,7 @@ std::string AlwaysLtTintTfloatLogicalFunction::explain(ExplainVerbosity verbosit return fmt::format("{}({})", NAME, args); } -LogicalFunction AlwaysLtTintTfloatLogicalFunction::withInferredDataType(const Schema& schema) const +LogicalFunction AlwaysLtTintTintLogicalFunction::withInferredDataType(const Schema& schema) const { std::vector newChildren; newChildren.reserve(parameters.size()); @@ -80,7 +80,7 @@ LogicalFunction AlwaysLtTintTfloatLogicalFunction::withInferredDataType(const Sc return withChildren(newChildren); } -SerializableFunction AlwaysLtTintTfloatLogicalFunction::serialize() const +SerializableFunction AlwaysLtTintTintLogicalFunction::serialize() const { SerializableFunction proto; proto.set_function_type(std::string(NAME)); @@ -90,16 +90,16 @@ SerializableFunction AlwaysLtTintTfloatLogicalFunction::serialize() const return proto; } -LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysLtTintTfloatLogicalFunction( +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysLtTintTintLogicalFunction( LogicalFunctionRegistryArguments arguments) { PRECONDITION(arguments.children.size() == 3, - "AlwaysLtTintTfloatLogicalFunction requires 3 children but got {}", + "AlwaysLtTintTintLogicalFunction requires 3 children but got {}", arguments.children.size()); auto arg0 = std::move(arguments.children[0]); auto arg1 = std::move(arguments.children[1]); auto arg2 = std::move(arguments.children[2]); - return AlwaysLtTintTfloatLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); + return AlwaysLtTintTintLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysNeTbigintTbigintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysNeTbigintTbigintLogicalFunction.cpp index 9a9eda9b8d..3d2affb41d 100644 --- a/nes-logical-operators/src/Functions/Meos/AlwaysNeTbigintTbigintLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/AlwaysNeTbigintTbigintLogicalFunction.cpp @@ -12,7 +12,7 @@ limitations under the License. */ -#include +#include #include #include @@ -26,7 +26,7 @@ namespace NES { -AlwaysNeTbigintTfloatLogicalFunction::AlwaysNeTbigintTfloatLogicalFunction(LogicalFunction value1, +AlwaysNeTbigintTbigintLogicalFunction::AlwaysNeTbigintTbigintLogicalFunction(LogicalFunction value1, LogicalFunction value2, LogicalFunction ts) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) @@ -37,31 +37,31 @@ AlwaysNeTbigintTfloatLogicalFunction::AlwaysNeTbigintTfloatLogicalFunction(Logic parameters.push_back(std::move(ts)); } -DataType AlwaysNeTbigintTfloatLogicalFunction::getDataType() const { return dataType; } +DataType AlwaysNeTbigintTbigintLogicalFunction::getDataType() const { return dataType; } -LogicalFunction AlwaysNeTbigintTfloatLogicalFunction::withDataType(const DataType& newDataType) const +LogicalFunction AlwaysNeTbigintTbigintLogicalFunction::withDataType(const DataType& newDataType) const { auto copy = *this; copy.dataType = newDataType; return copy; } -std::vector AlwaysNeTbigintTfloatLogicalFunction::getChildren() const { return parameters; } +std::vector AlwaysNeTbigintTbigintLogicalFunction::getChildren() const { return parameters; } -LogicalFunction AlwaysNeTbigintTfloatLogicalFunction::withChildren(const std::vector& children) const +LogicalFunction AlwaysNeTbigintTbigintLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 3, "AlwaysNeTbigintTfloatLogicalFunction requires 3 children, but got {}", children.size()); + PRECONDITION(children.size() == 3, "AlwaysNeTbigintTbigintLogicalFunction requires 3 children, but got {}", children.size()); auto copy = *this; copy.parameters = children; return copy; } -std::string_view AlwaysNeTbigintTfloatLogicalFunction::getType() const { return NAME; } +std::string_view AlwaysNeTbigintTbigintLogicalFunction::getType() const { return NAME; } -bool AlwaysNeTbigintTfloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +bool AlwaysNeTbigintTbigintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { - if (const auto* other = dynamic_cast(&rhs)) + if (const auto* other = dynamic_cast(&rhs)) return parameters == other->parameters; return false; } -std::string AlwaysNeTbigintTfloatLogicalFunction::explain(ExplainVerbosity verbosity) const +std::string AlwaysNeTbigintTbigintLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; for (size_t index = 0; index < parameters.size(); ++index) { @@ -71,7 +71,7 @@ std::string AlwaysNeTbigintTfloatLogicalFunction::explain(ExplainVerbosity verbo return fmt::format("{}({})", NAME, args); } -LogicalFunction AlwaysNeTbigintTfloatLogicalFunction::withInferredDataType(const Schema& schema) const +LogicalFunction AlwaysNeTbigintTbigintLogicalFunction::withInferredDataType(const Schema& schema) const { std::vector newChildren; newChildren.reserve(parameters.size()); @@ -80,7 +80,7 @@ LogicalFunction AlwaysNeTbigintTfloatLogicalFunction::withInferredDataType(const return withChildren(newChildren); } -SerializableFunction AlwaysNeTbigintTfloatLogicalFunction::serialize() const +SerializableFunction AlwaysNeTbigintTbigintLogicalFunction::serialize() const { SerializableFunction proto; proto.set_function_type(std::string(NAME)); @@ -90,16 +90,16 @@ SerializableFunction AlwaysNeTbigintTfloatLogicalFunction::serialize() const return proto; } -LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysNeTbigintTfloatLogicalFunction( +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysNeTbigintTbigintLogicalFunction( LogicalFunctionRegistryArguments arguments) { PRECONDITION(arguments.children.size() == 3, - "AlwaysNeTbigintTfloatLogicalFunction requires 3 children but got {}", + "AlwaysNeTbigintTbigintLogicalFunction requires 3 children but got {}", arguments.children.size()); auto arg0 = std::move(arguments.children[0]); auto arg1 = std::move(arguments.children[1]); auto arg2 = std::move(arguments.children[2]); - return AlwaysNeTbigintTfloatLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); + return AlwaysNeTbigintTbigintLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysNeTintTintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysNeTintTintLogicalFunction.cpp index 83bcedc991..4908cd1db6 100644 --- a/nes-logical-operators/src/Functions/Meos/AlwaysNeTintTintLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/AlwaysNeTintTintLogicalFunction.cpp @@ -12,7 +12,7 @@ limitations under the License. */ -#include +#include #include #include @@ -26,7 +26,7 @@ namespace NES { -AlwaysNeTintTfloatLogicalFunction::AlwaysNeTintTfloatLogicalFunction(LogicalFunction value1, +AlwaysNeTintTintLogicalFunction::AlwaysNeTintTintLogicalFunction(LogicalFunction value1, LogicalFunction value2, LogicalFunction ts) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) @@ -37,31 +37,31 @@ AlwaysNeTintTfloatLogicalFunction::AlwaysNeTintTfloatLogicalFunction(LogicalFunc parameters.push_back(std::move(ts)); } -DataType AlwaysNeTintTfloatLogicalFunction::getDataType() const { return dataType; } +DataType AlwaysNeTintTintLogicalFunction::getDataType() const { return dataType; } -LogicalFunction AlwaysNeTintTfloatLogicalFunction::withDataType(const DataType& newDataType) const +LogicalFunction AlwaysNeTintTintLogicalFunction::withDataType(const DataType& newDataType) const { auto copy = *this; copy.dataType = newDataType; return copy; } -std::vector AlwaysNeTintTfloatLogicalFunction::getChildren() const { return parameters; } +std::vector AlwaysNeTintTintLogicalFunction::getChildren() const { return parameters; } -LogicalFunction AlwaysNeTintTfloatLogicalFunction::withChildren(const std::vector& children) const +LogicalFunction AlwaysNeTintTintLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 3, "AlwaysNeTintTfloatLogicalFunction requires 3 children, but got {}", children.size()); + PRECONDITION(children.size() == 3, "AlwaysNeTintTintLogicalFunction requires 3 children, but got {}", children.size()); auto copy = *this; copy.parameters = children; return copy; } -std::string_view AlwaysNeTintTfloatLogicalFunction::getType() const { return NAME; } +std::string_view AlwaysNeTintTintLogicalFunction::getType() const { return NAME; } -bool AlwaysNeTintTfloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +bool AlwaysNeTintTintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { - if (const auto* other = dynamic_cast(&rhs)) + if (const auto* other = dynamic_cast(&rhs)) return parameters == other->parameters; return false; } -std::string AlwaysNeTintTfloatLogicalFunction::explain(ExplainVerbosity verbosity) const +std::string AlwaysNeTintTintLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; for (size_t index = 0; index < parameters.size(); ++index) { @@ -71,7 +71,7 @@ std::string AlwaysNeTintTfloatLogicalFunction::explain(ExplainVerbosity verbosit return fmt::format("{}({})", NAME, args); } -LogicalFunction AlwaysNeTintTfloatLogicalFunction::withInferredDataType(const Schema& schema) const +LogicalFunction AlwaysNeTintTintLogicalFunction::withInferredDataType(const Schema& schema) const { std::vector newChildren; newChildren.reserve(parameters.size()); @@ -80,7 +80,7 @@ LogicalFunction AlwaysNeTintTfloatLogicalFunction::withInferredDataType(const Sc return withChildren(newChildren); } -SerializableFunction AlwaysNeTintTfloatLogicalFunction::serialize() const +SerializableFunction AlwaysNeTintTintLogicalFunction::serialize() const { SerializableFunction proto; proto.set_function_type(std::string(NAME)); @@ -90,16 +90,16 @@ SerializableFunction AlwaysNeTintTfloatLogicalFunction::serialize() const return proto; } -LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysNeTintTfloatLogicalFunction( +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysNeTintTintLogicalFunction( LogicalFunctionRegistryArguments arguments) { PRECONDITION(arguments.children.size() == 3, - "AlwaysNeTintTfloatLogicalFunction requires 3 children but got {}", + "AlwaysNeTintTintLogicalFunction requires 3 children but got {}", arguments.children.size()); auto arg0 = std::move(arguments.children[0]); auto arg1 = std::move(arguments.children[1]); auto arg2 = std::move(arguments.children[2]); - return AlwaysNeTintTfloatLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); + return AlwaysNeTintTintLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt index 376f53b53c..0f5902cc58 100644 --- a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt @@ -245,3 +245,4 @@ add_plugin(TltFloatTfloat LogicalFunction nes-logical-operators TltFloatTfloatLo add_plugin(TltTintInt LogicalFunction nes-logical-operators TltTintIntLogicalFunction.cpp) add_plugin(TltIntTint LogicalFunction nes-logical-operators TltIntTintLogicalFunction.cpp) add_plugin(TltTemporalTemporal LogicalFunction nes-logical-operators TltTemporalTemporalLogicalFunction.cpp) +add_plugin(TboolToTint LogicalFunction nes-logical-operators TboolToTintLogicalFunction.cpp) diff --git a/nes-logical-operators/src/Functions/Meos/EverEqTbigintTbigintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverEqTbigintTbigintLogicalFunction.cpp index aff2bb3796..82f535cc7b 100644 --- a/nes-logical-operators/src/Functions/Meos/EverEqTbigintTbigintLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/EverEqTbigintTbigintLogicalFunction.cpp @@ -12,7 +12,7 @@ limitations under the License. */ -#include +#include #include #include @@ -26,7 +26,7 @@ namespace NES { -EverEqTbigintTfloatLogicalFunction::EverEqTbigintTfloatLogicalFunction(LogicalFunction value1, +EverEqTbigintTbigintLogicalFunction::EverEqTbigintTbigintLogicalFunction(LogicalFunction value1, LogicalFunction value2, LogicalFunction ts) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) @@ -37,31 +37,31 @@ EverEqTbigintTfloatLogicalFunction::EverEqTbigintTfloatLogicalFunction(LogicalFu parameters.push_back(std::move(ts)); } -DataType EverEqTbigintTfloatLogicalFunction::getDataType() const { return dataType; } +DataType EverEqTbigintTbigintLogicalFunction::getDataType() const { return dataType; } -LogicalFunction EverEqTbigintTfloatLogicalFunction::withDataType(const DataType& newDataType) const +LogicalFunction EverEqTbigintTbigintLogicalFunction::withDataType(const DataType& newDataType) const { auto copy = *this; copy.dataType = newDataType; return copy; } -std::vector EverEqTbigintTfloatLogicalFunction::getChildren() const { return parameters; } +std::vector EverEqTbigintTbigintLogicalFunction::getChildren() const { return parameters; } -LogicalFunction EverEqTbigintTfloatLogicalFunction::withChildren(const std::vector& children) const +LogicalFunction EverEqTbigintTbigintLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 3, "EverEqTbigintTfloatLogicalFunction requires 3 children, but got {}", children.size()); + PRECONDITION(children.size() == 3, "EverEqTbigintTbigintLogicalFunction requires 3 children, but got {}", children.size()); auto copy = *this; copy.parameters = children; return copy; } -std::string_view EverEqTbigintTfloatLogicalFunction::getType() const { return NAME; } +std::string_view EverEqTbigintTbigintLogicalFunction::getType() const { return NAME; } -bool EverEqTbigintTfloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +bool EverEqTbigintTbigintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { - if (const auto* other = dynamic_cast(&rhs)) + if (const auto* other = dynamic_cast(&rhs)) return parameters == other->parameters; return false; } -std::string EverEqTbigintTfloatLogicalFunction::explain(ExplainVerbosity verbosity) const +std::string EverEqTbigintTbigintLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; for (size_t index = 0; index < parameters.size(); ++index) { @@ -71,7 +71,7 @@ std::string EverEqTbigintTfloatLogicalFunction::explain(ExplainVerbosity verbosi return fmt::format("{}({})", NAME, args); } -LogicalFunction EverEqTbigintTfloatLogicalFunction::withInferredDataType(const Schema& schema) const +LogicalFunction EverEqTbigintTbigintLogicalFunction::withInferredDataType(const Schema& schema) const { std::vector newChildren; newChildren.reserve(parameters.size()); @@ -80,7 +80,7 @@ LogicalFunction EverEqTbigintTfloatLogicalFunction::withInferredDataType(const S return withChildren(newChildren); } -SerializableFunction EverEqTbigintTfloatLogicalFunction::serialize() const +SerializableFunction EverEqTbigintTbigintLogicalFunction::serialize() const { SerializableFunction proto; proto.set_function_type(std::string(NAME)); @@ -90,16 +90,16 @@ SerializableFunction EverEqTbigintTfloatLogicalFunction::serialize() const return proto; } -LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverEqTbigintTfloatLogicalFunction( +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverEqTbigintTbigintLogicalFunction( LogicalFunctionRegistryArguments arguments) { PRECONDITION(arguments.children.size() == 3, - "EverEqTbigintTfloatLogicalFunction requires 3 children but got {}", + "EverEqTbigintTbigintLogicalFunction requires 3 children but got {}", arguments.children.size()); auto arg0 = std::move(arguments.children[0]); auto arg1 = std::move(arguments.children[1]); auto arg2 = std::move(arguments.children[2]); - return EverEqTbigintTfloatLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); + return EverEqTbigintTbigintLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverEqTintTintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverEqTintTintLogicalFunction.cpp index 36354c8967..fa5f4387f3 100644 --- a/nes-logical-operators/src/Functions/Meos/EverEqTintTintLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/EverEqTintTintLogicalFunction.cpp @@ -12,7 +12,7 @@ limitations under the License. */ -#include +#include #include #include @@ -26,7 +26,7 @@ namespace NES { -EverEqTintTfloatLogicalFunction::EverEqTintTfloatLogicalFunction(LogicalFunction value1, +EverEqTintTintLogicalFunction::EverEqTintTintLogicalFunction(LogicalFunction value1, LogicalFunction value2, LogicalFunction ts) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) @@ -37,31 +37,31 @@ EverEqTintTfloatLogicalFunction::EverEqTintTfloatLogicalFunction(LogicalFunction parameters.push_back(std::move(ts)); } -DataType EverEqTintTfloatLogicalFunction::getDataType() const { return dataType; } +DataType EverEqTintTintLogicalFunction::getDataType() const { return dataType; } -LogicalFunction EverEqTintTfloatLogicalFunction::withDataType(const DataType& newDataType) const +LogicalFunction EverEqTintTintLogicalFunction::withDataType(const DataType& newDataType) const { auto copy = *this; copy.dataType = newDataType; return copy; } -std::vector EverEqTintTfloatLogicalFunction::getChildren() const { return parameters; } +std::vector EverEqTintTintLogicalFunction::getChildren() const { return parameters; } -LogicalFunction EverEqTintTfloatLogicalFunction::withChildren(const std::vector& children) const +LogicalFunction EverEqTintTintLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 3, "EverEqTintTfloatLogicalFunction requires 3 children, but got {}", children.size()); + PRECONDITION(children.size() == 3, "EverEqTintTintLogicalFunction requires 3 children, but got {}", children.size()); auto copy = *this; copy.parameters = children; return copy; } -std::string_view EverEqTintTfloatLogicalFunction::getType() const { return NAME; } +std::string_view EverEqTintTintLogicalFunction::getType() const { return NAME; } -bool EverEqTintTfloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +bool EverEqTintTintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { - if (const auto* other = dynamic_cast(&rhs)) + if (const auto* other = dynamic_cast(&rhs)) return parameters == other->parameters; return false; } -std::string EverEqTintTfloatLogicalFunction::explain(ExplainVerbosity verbosity) const +std::string EverEqTintTintLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; for (size_t index = 0; index < parameters.size(); ++index) { @@ -71,7 +71,7 @@ std::string EverEqTintTfloatLogicalFunction::explain(ExplainVerbosity verbosity) return fmt::format("{}({})", NAME, args); } -LogicalFunction EverEqTintTfloatLogicalFunction::withInferredDataType(const Schema& schema) const +LogicalFunction EverEqTintTintLogicalFunction::withInferredDataType(const Schema& schema) const { std::vector newChildren; newChildren.reserve(parameters.size()); @@ -80,7 +80,7 @@ LogicalFunction EverEqTintTfloatLogicalFunction::withInferredDataType(const Sche return withChildren(newChildren); } -SerializableFunction EverEqTintTfloatLogicalFunction::serialize() const +SerializableFunction EverEqTintTintLogicalFunction::serialize() const { SerializableFunction proto; proto.set_function_type(std::string(NAME)); @@ -90,16 +90,16 @@ SerializableFunction EverEqTintTfloatLogicalFunction::serialize() const return proto; } -LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverEqTintTfloatLogicalFunction( +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverEqTintTintLogicalFunction( LogicalFunctionRegistryArguments arguments) { PRECONDITION(arguments.children.size() == 3, - "EverEqTintTfloatLogicalFunction requires 3 children but got {}", + "EverEqTintTintLogicalFunction requires 3 children but got {}", arguments.children.size()); auto arg0 = std::move(arguments.children[0]); auto arg1 = std::move(arguments.children[1]); auto arg2 = std::move(arguments.children[2]); - return EverEqTintTfloatLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); + return EverEqTintTintLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverGeTbigintTbigintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverGeTbigintTbigintLogicalFunction.cpp index 124252845f..c97dae065c 100644 --- a/nes-logical-operators/src/Functions/Meos/EverGeTbigintTbigintLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/EverGeTbigintTbigintLogicalFunction.cpp @@ -12,7 +12,7 @@ limitations under the License. */ -#include +#include #include #include @@ -26,7 +26,7 @@ namespace NES { -EverGeTbigintTfloatLogicalFunction::EverGeTbigintTfloatLogicalFunction(LogicalFunction value1, +EverGeTbigintTbigintLogicalFunction::EverGeTbigintTbigintLogicalFunction(LogicalFunction value1, LogicalFunction value2, LogicalFunction ts) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) @@ -37,31 +37,31 @@ EverGeTbigintTfloatLogicalFunction::EverGeTbigintTfloatLogicalFunction(LogicalFu parameters.push_back(std::move(ts)); } -DataType EverGeTbigintTfloatLogicalFunction::getDataType() const { return dataType; } +DataType EverGeTbigintTbigintLogicalFunction::getDataType() const { return dataType; } -LogicalFunction EverGeTbigintTfloatLogicalFunction::withDataType(const DataType& newDataType) const +LogicalFunction EverGeTbigintTbigintLogicalFunction::withDataType(const DataType& newDataType) const { auto copy = *this; copy.dataType = newDataType; return copy; } -std::vector EverGeTbigintTfloatLogicalFunction::getChildren() const { return parameters; } +std::vector EverGeTbigintTbigintLogicalFunction::getChildren() const { return parameters; } -LogicalFunction EverGeTbigintTfloatLogicalFunction::withChildren(const std::vector& children) const +LogicalFunction EverGeTbigintTbigintLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 3, "EverGeTbigintTfloatLogicalFunction requires 3 children, but got {}", children.size()); + PRECONDITION(children.size() == 3, "EverGeTbigintTbigintLogicalFunction requires 3 children, but got {}", children.size()); auto copy = *this; copy.parameters = children; return copy; } -std::string_view EverGeTbigintTfloatLogicalFunction::getType() const { return NAME; } +std::string_view EverGeTbigintTbigintLogicalFunction::getType() const { return NAME; } -bool EverGeTbigintTfloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +bool EverGeTbigintTbigintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { - if (const auto* other = dynamic_cast(&rhs)) + if (const auto* other = dynamic_cast(&rhs)) return parameters == other->parameters; return false; } -std::string EverGeTbigintTfloatLogicalFunction::explain(ExplainVerbosity verbosity) const +std::string EverGeTbigintTbigintLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; for (size_t index = 0; index < parameters.size(); ++index) { @@ -71,7 +71,7 @@ std::string EverGeTbigintTfloatLogicalFunction::explain(ExplainVerbosity verbosi return fmt::format("{}({})", NAME, args); } -LogicalFunction EverGeTbigintTfloatLogicalFunction::withInferredDataType(const Schema& schema) const +LogicalFunction EverGeTbigintTbigintLogicalFunction::withInferredDataType(const Schema& schema) const { std::vector newChildren; newChildren.reserve(parameters.size()); @@ -80,7 +80,7 @@ LogicalFunction EverGeTbigintTfloatLogicalFunction::withInferredDataType(const S return withChildren(newChildren); } -SerializableFunction EverGeTbigintTfloatLogicalFunction::serialize() const +SerializableFunction EverGeTbigintTbigintLogicalFunction::serialize() const { SerializableFunction proto; proto.set_function_type(std::string(NAME)); @@ -90,16 +90,16 @@ SerializableFunction EverGeTbigintTfloatLogicalFunction::serialize() const return proto; } -LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverGeTbigintTfloatLogicalFunction( +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverGeTbigintTbigintLogicalFunction( LogicalFunctionRegistryArguments arguments) { PRECONDITION(arguments.children.size() == 3, - "EverGeTbigintTfloatLogicalFunction requires 3 children but got {}", + "EverGeTbigintTbigintLogicalFunction requires 3 children but got {}", arguments.children.size()); auto arg0 = std::move(arguments.children[0]); auto arg1 = std::move(arguments.children[1]); auto arg2 = std::move(arguments.children[2]); - return EverGeTbigintTfloatLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); + return EverGeTbigintTbigintLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverGeTintTintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverGeTintTintLogicalFunction.cpp index 40a41a043e..af5b8871aa 100644 --- a/nes-logical-operators/src/Functions/Meos/EverGeTintTintLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/EverGeTintTintLogicalFunction.cpp @@ -12,7 +12,7 @@ limitations under the License. */ -#include +#include #include #include @@ -26,7 +26,7 @@ namespace NES { -EverGeTintTfloatLogicalFunction::EverGeTintTfloatLogicalFunction(LogicalFunction value1, +EverGeTintTintLogicalFunction::EverGeTintTintLogicalFunction(LogicalFunction value1, LogicalFunction value2, LogicalFunction ts) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) @@ -37,31 +37,31 @@ EverGeTintTfloatLogicalFunction::EverGeTintTfloatLogicalFunction(LogicalFunction parameters.push_back(std::move(ts)); } -DataType EverGeTintTfloatLogicalFunction::getDataType() const { return dataType; } +DataType EverGeTintTintLogicalFunction::getDataType() const { return dataType; } -LogicalFunction EverGeTintTfloatLogicalFunction::withDataType(const DataType& newDataType) const +LogicalFunction EverGeTintTintLogicalFunction::withDataType(const DataType& newDataType) const { auto copy = *this; copy.dataType = newDataType; return copy; } -std::vector EverGeTintTfloatLogicalFunction::getChildren() const { return parameters; } +std::vector EverGeTintTintLogicalFunction::getChildren() const { return parameters; } -LogicalFunction EverGeTintTfloatLogicalFunction::withChildren(const std::vector& children) const +LogicalFunction EverGeTintTintLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 3, "EverGeTintTfloatLogicalFunction requires 3 children, but got {}", children.size()); + PRECONDITION(children.size() == 3, "EverGeTintTintLogicalFunction requires 3 children, but got {}", children.size()); auto copy = *this; copy.parameters = children; return copy; } -std::string_view EverGeTintTfloatLogicalFunction::getType() const { return NAME; } +std::string_view EverGeTintTintLogicalFunction::getType() const { return NAME; } -bool EverGeTintTfloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +bool EverGeTintTintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { - if (const auto* other = dynamic_cast(&rhs)) + if (const auto* other = dynamic_cast(&rhs)) return parameters == other->parameters; return false; } -std::string EverGeTintTfloatLogicalFunction::explain(ExplainVerbosity verbosity) const +std::string EverGeTintTintLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; for (size_t index = 0; index < parameters.size(); ++index) { @@ -71,7 +71,7 @@ std::string EverGeTintTfloatLogicalFunction::explain(ExplainVerbosity verbosity) return fmt::format("{}({})", NAME, args); } -LogicalFunction EverGeTintTfloatLogicalFunction::withInferredDataType(const Schema& schema) const +LogicalFunction EverGeTintTintLogicalFunction::withInferredDataType(const Schema& schema) const { std::vector newChildren; newChildren.reserve(parameters.size()); @@ -80,7 +80,7 @@ LogicalFunction EverGeTintTfloatLogicalFunction::withInferredDataType(const Sche return withChildren(newChildren); } -SerializableFunction EverGeTintTfloatLogicalFunction::serialize() const +SerializableFunction EverGeTintTintLogicalFunction::serialize() const { SerializableFunction proto; proto.set_function_type(std::string(NAME)); @@ -90,16 +90,16 @@ SerializableFunction EverGeTintTfloatLogicalFunction::serialize() const return proto; } -LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverGeTintTfloatLogicalFunction( +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverGeTintTintLogicalFunction( LogicalFunctionRegistryArguments arguments) { PRECONDITION(arguments.children.size() == 3, - "EverGeTintTfloatLogicalFunction requires 3 children but got {}", + "EverGeTintTintLogicalFunction requires 3 children but got {}", arguments.children.size()); auto arg0 = std::move(arguments.children[0]); auto arg1 = std::move(arguments.children[1]); auto arg2 = std::move(arguments.children[2]); - return EverGeTintTfloatLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); + return EverGeTintTintLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverGtTbigintTbigintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverGtTbigintTbigintLogicalFunction.cpp index 1c3161aadd..53bbcb2c10 100644 --- a/nes-logical-operators/src/Functions/Meos/EverGtTbigintTbigintLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/EverGtTbigintTbigintLogicalFunction.cpp @@ -12,7 +12,7 @@ limitations under the License. */ -#include +#include #include #include @@ -26,7 +26,7 @@ namespace NES { -EverGtTbigintTfloatLogicalFunction::EverGtTbigintTfloatLogicalFunction(LogicalFunction value1, +EverGtTbigintTbigintLogicalFunction::EverGtTbigintTbigintLogicalFunction(LogicalFunction value1, LogicalFunction value2, LogicalFunction ts) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) @@ -37,31 +37,31 @@ EverGtTbigintTfloatLogicalFunction::EverGtTbigintTfloatLogicalFunction(LogicalFu parameters.push_back(std::move(ts)); } -DataType EverGtTbigintTfloatLogicalFunction::getDataType() const { return dataType; } +DataType EverGtTbigintTbigintLogicalFunction::getDataType() const { return dataType; } -LogicalFunction EverGtTbigintTfloatLogicalFunction::withDataType(const DataType& newDataType) const +LogicalFunction EverGtTbigintTbigintLogicalFunction::withDataType(const DataType& newDataType) const { auto copy = *this; copy.dataType = newDataType; return copy; } -std::vector EverGtTbigintTfloatLogicalFunction::getChildren() const { return parameters; } +std::vector EverGtTbigintTbigintLogicalFunction::getChildren() const { return parameters; } -LogicalFunction EverGtTbigintTfloatLogicalFunction::withChildren(const std::vector& children) const +LogicalFunction EverGtTbigintTbigintLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 3, "EverGtTbigintTfloatLogicalFunction requires 3 children, but got {}", children.size()); + PRECONDITION(children.size() == 3, "EverGtTbigintTbigintLogicalFunction requires 3 children, but got {}", children.size()); auto copy = *this; copy.parameters = children; return copy; } -std::string_view EverGtTbigintTfloatLogicalFunction::getType() const { return NAME; } +std::string_view EverGtTbigintTbigintLogicalFunction::getType() const { return NAME; } -bool EverGtTbigintTfloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +bool EverGtTbigintTbigintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { - if (const auto* other = dynamic_cast(&rhs)) + if (const auto* other = dynamic_cast(&rhs)) return parameters == other->parameters; return false; } -std::string EverGtTbigintTfloatLogicalFunction::explain(ExplainVerbosity verbosity) const +std::string EverGtTbigintTbigintLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; for (size_t index = 0; index < parameters.size(); ++index) { @@ -71,7 +71,7 @@ std::string EverGtTbigintTfloatLogicalFunction::explain(ExplainVerbosity verbosi return fmt::format("{}({})", NAME, args); } -LogicalFunction EverGtTbigintTfloatLogicalFunction::withInferredDataType(const Schema& schema) const +LogicalFunction EverGtTbigintTbigintLogicalFunction::withInferredDataType(const Schema& schema) const { std::vector newChildren; newChildren.reserve(parameters.size()); @@ -80,7 +80,7 @@ LogicalFunction EverGtTbigintTfloatLogicalFunction::withInferredDataType(const S return withChildren(newChildren); } -SerializableFunction EverGtTbigintTfloatLogicalFunction::serialize() const +SerializableFunction EverGtTbigintTbigintLogicalFunction::serialize() const { SerializableFunction proto; proto.set_function_type(std::string(NAME)); @@ -90,16 +90,16 @@ SerializableFunction EverGtTbigintTfloatLogicalFunction::serialize() const return proto; } -LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverGtTbigintTfloatLogicalFunction( +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverGtTbigintTbigintLogicalFunction( LogicalFunctionRegistryArguments arguments) { PRECONDITION(arguments.children.size() == 3, - "EverGtTbigintTfloatLogicalFunction requires 3 children but got {}", + "EverGtTbigintTbigintLogicalFunction requires 3 children but got {}", arguments.children.size()); auto arg0 = std::move(arguments.children[0]); auto arg1 = std::move(arguments.children[1]); auto arg2 = std::move(arguments.children[2]); - return EverGtTbigintTfloatLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); + return EverGtTbigintTbigintLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverGtTintTintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverGtTintTintLogicalFunction.cpp index 5c58d78fda..962f12e4cb 100644 --- a/nes-logical-operators/src/Functions/Meos/EverGtTintTintLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/EverGtTintTintLogicalFunction.cpp @@ -12,7 +12,7 @@ limitations under the License. */ -#include +#include #include #include @@ -26,7 +26,7 @@ namespace NES { -EverGtTintTfloatLogicalFunction::EverGtTintTfloatLogicalFunction(LogicalFunction value1, +EverGtTintTintLogicalFunction::EverGtTintTintLogicalFunction(LogicalFunction value1, LogicalFunction value2, LogicalFunction ts) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) @@ -37,31 +37,31 @@ EverGtTintTfloatLogicalFunction::EverGtTintTfloatLogicalFunction(LogicalFunction parameters.push_back(std::move(ts)); } -DataType EverGtTintTfloatLogicalFunction::getDataType() const { return dataType; } +DataType EverGtTintTintLogicalFunction::getDataType() const { return dataType; } -LogicalFunction EverGtTintTfloatLogicalFunction::withDataType(const DataType& newDataType) const +LogicalFunction EverGtTintTintLogicalFunction::withDataType(const DataType& newDataType) const { auto copy = *this; copy.dataType = newDataType; return copy; } -std::vector EverGtTintTfloatLogicalFunction::getChildren() const { return parameters; } +std::vector EverGtTintTintLogicalFunction::getChildren() const { return parameters; } -LogicalFunction EverGtTintTfloatLogicalFunction::withChildren(const std::vector& children) const +LogicalFunction EverGtTintTintLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 3, "EverGtTintTfloatLogicalFunction requires 3 children, but got {}", children.size()); + PRECONDITION(children.size() == 3, "EverGtTintTintLogicalFunction requires 3 children, but got {}", children.size()); auto copy = *this; copy.parameters = children; return copy; } -std::string_view EverGtTintTfloatLogicalFunction::getType() const { return NAME; } +std::string_view EverGtTintTintLogicalFunction::getType() const { return NAME; } -bool EverGtTintTfloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +bool EverGtTintTintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { - if (const auto* other = dynamic_cast(&rhs)) + if (const auto* other = dynamic_cast(&rhs)) return parameters == other->parameters; return false; } -std::string EverGtTintTfloatLogicalFunction::explain(ExplainVerbosity verbosity) const +std::string EverGtTintTintLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; for (size_t index = 0; index < parameters.size(); ++index) { @@ -71,7 +71,7 @@ std::string EverGtTintTfloatLogicalFunction::explain(ExplainVerbosity verbosity) return fmt::format("{}({})", NAME, args); } -LogicalFunction EverGtTintTfloatLogicalFunction::withInferredDataType(const Schema& schema) const +LogicalFunction EverGtTintTintLogicalFunction::withInferredDataType(const Schema& schema) const { std::vector newChildren; newChildren.reserve(parameters.size()); @@ -80,7 +80,7 @@ LogicalFunction EverGtTintTfloatLogicalFunction::withInferredDataType(const Sche return withChildren(newChildren); } -SerializableFunction EverGtTintTfloatLogicalFunction::serialize() const +SerializableFunction EverGtTintTintLogicalFunction::serialize() const { SerializableFunction proto; proto.set_function_type(std::string(NAME)); @@ -90,16 +90,16 @@ SerializableFunction EverGtTintTfloatLogicalFunction::serialize() const return proto; } -LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverGtTintTfloatLogicalFunction( +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverGtTintTintLogicalFunction( LogicalFunctionRegistryArguments arguments) { PRECONDITION(arguments.children.size() == 3, - "EverGtTintTfloatLogicalFunction requires 3 children but got {}", + "EverGtTintTintLogicalFunction requires 3 children but got {}", arguments.children.size()); auto arg0 = std::move(arguments.children[0]); auto arg1 = std::move(arguments.children[1]); auto arg2 = std::move(arguments.children[2]); - return EverGtTintTfloatLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); + return EverGtTintTintLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverLeTbigintTbigintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverLeTbigintTbigintLogicalFunction.cpp index 6a0d2b51ad..5232e0d088 100644 --- a/nes-logical-operators/src/Functions/Meos/EverLeTbigintTbigintLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/EverLeTbigintTbigintLogicalFunction.cpp @@ -12,7 +12,7 @@ limitations under the License. */ -#include +#include #include #include @@ -26,7 +26,7 @@ namespace NES { -EverLeTbigintTfloatLogicalFunction::EverLeTbigintTfloatLogicalFunction(LogicalFunction value1, +EverLeTbigintTbigintLogicalFunction::EverLeTbigintTbigintLogicalFunction(LogicalFunction value1, LogicalFunction value2, LogicalFunction ts) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) @@ -37,31 +37,31 @@ EverLeTbigintTfloatLogicalFunction::EverLeTbigintTfloatLogicalFunction(LogicalFu parameters.push_back(std::move(ts)); } -DataType EverLeTbigintTfloatLogicalFunction::getDataType() const { return dataType; } +DataType EverLeTbigintTbigintLogicalFunction::getDataType() const { return dataType; } -LogicalFunction EverLeTbigintTfloatLogicalFunction::withDataType(const DataType& newDataType) const +LogicalFunction EverLeTbigintTbigintLogicalFunction::withDataType(const DataType& newDataType) const { auto copy = *this; copy.dataType = newDataType; return copy; } -std::vector EverLeTbigintTfloatLogicalFunction::getChildren() const { return parameters; } +std::vector EverLeTbigintTbigintLogicalFunction::getChildren() const { return parameters; } -LogicalFunction EverLeTbigintTfloatLogicalFunction::withChildren(const std::vector& children) const +LogicalFunction EverLeTbigintTbigintLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 3, "EverLeTbigintTfloatLogicalFunction requires 3 children, but got {}", children.size()); + PRECONDITION(children.size() == 3, "EverLeTbigintTbigintLogicalFunction requires 3 children, but got {}", children.size()); auto copy = *this; copy.parameters = children; return copy; } -std::string_view EverLeTbigintTfloatLogicalFunction::getType() const { return NAME; } +std::string_view EverLeTbigintTbigintLogicalFunction::getType() const { return NAME; } -bool EverLeTbigintTfloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +bool EverLeTbigintTbigintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { - if (const auto* other = dynamic_cast(&rhs)) + if (const auto* other = dynamic_cast(&rhs)) return parameters == other->parameters; return false; } -std::string EverLeTbigintTfloatLogicalFunction::explain(ExplainVerbosity verbosity) const +std::string EverLeTbigintTbigintLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; for (size_t index = 0; index < parameters.size(); ++index) { @@ -71,7 +71,7 @@ std::string EverLeTbigintTfloatLogicalFunction::explain(ExplainVerbosity verbosi return fmt::format("{}({})", NAME, args); } -LogicalFunction EverLeTbigintTfloatLogicalFunction::withInferredDataType(const Schema& schema) const +LogicalFunction EverLeTbigintTbigintLogicalFunction::withInferredDataType(const Schema& schema) const { std::vector newChildren; newChildren.reserve(parameters.size()); @@ -80,7 +80,7 @@ LogicalFunction EverLeTbigintTfloatLogicalFunction::withInferredDataType(const S return withChildren(newChildren); } -SerializableFunction EverLeTbigintTfloatLogicalFunction::serialize() const +SerializableFunction EverLeTbigintTbigintLogicalFunction::serialize() const { SerializableFunction proto; proto.set_function_type(std::string(NAME)); @@ -90,16 +90,16 @@ SerializableFunction EverLeTbigintTfloatLogicalFunction::serialize() const return proto; } -LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverLeTbigintTfloatLogicalFunction( +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverLeTbigintTbigintLogicalFunction( LogicalFunctionRegistryArguments arguments) { PRECONDITION(arguments.children.size() == 3, - "EverLeTbigintTfloatLogicalFunction requires 3 children but got {}", + "EverLeTbigintTbigintLogicalFunction requires 3 children but got {}", arguments.children.size()); auto arg0 = std::move(arguments.children[0]); auto arg1 = std::move(arguments.children[1]); auto arg2 = std::move(arguments.children[2]); - return EverLeTbigintTfloatLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); + return EverLeTbigintTbigintLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverLeTintTintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverLeTintTintLogicalFunction.cpp index 079b5d64c0..71d801b989 100644 --- a/nes-logical-operators/src/Functions/Meos/EverLeTintTintLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/EverLeTintTintLogicalFunction.cpp @@ -12,7 +12,7 @@ limitations under the License. */ -#include +#include #include #include @@ -26,7 +26,7 @@ namespace NES { -EverLeTintTfloatLogicalFunction::EverLeTintTfloatLogicalFunction(LogicalFunction value1, +EverLeTintTintLogicalFunction::EverLeTintTintLogicalFunction(LogicalFunction value1, LogicalFunction value2, LogicalFunction ts) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) @@ -37,31 +37,31 @@ EverLeTintTfloatLogicalFunction::EverLeTintTfloatLogicalFunction(LogicalFunction parameters.push_back(std::move(ts)); } -DataType EverLeTintTfloatLogicalFunction::getDataType() const { return dataType; } +DataType EverLeTintTintLogicalFunction::getDataType() const { return dataType; } -LogicalFunction EverLeTintTfloatLogicalFunction::withDataType(const DataType& newDataType) const +LogicalFunction EverLeTintTintLogicalFunction::withDataType(const DataType& newDataType) const { auto copy = *this; copy.dataType = newDataType; return copy; } -std::vector EverLeTintTfloatLogicalFunction::getChildren() const { return parameters; } +std::vector EverLeTintTintLogicalFunction::getChildren() const { return parameters; } -LogicalFunction EverLeTintTfloatLogicalFunction::withChildren(const std::vector& children) const +LogicalFunction EverLeTintTintLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 3, "EverLeTintTfloatLogicalFunction requires 3 children, but got {}", children.size()); + PRECONDITION(children.size() == 3, "EverLeTintTintLogicalFunction requires 3 children, but got {}", children.size()); auto copy = *this; copy.parameters = children; return copy; } -std::string_view EverLeTintTfloatLogicalFunction::getType() const { return NAME; } +std::string_view EverLeTintTintLogicalFunction::getType() const { return NAME; } -bool EverLeTintTfloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +bool EverLeTintTintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { - if (const auto* other = dynamic_cast(&rhs)) + if (const auto* other = dynamic_cast(&rhs)) return parameters == other->parameters; return false; } -std::string EverLeTintTfloatLogicalFunction::explain(ExplainVerbosity verbosity) const +std::string EverLeTintTintLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; for (size_t index = 0; index < parameters.size(); ++index) { @@ -71,7 +71,7 @@ std::string EverLeTintTfloatLogicalFunction::explain(ExplainVerbosity verbosity) return fmt::format("{}({})", NAME, args); } -LogicalFunction EverLeTintTfloatLogicalFunction::withInferredDataType(const Schema& schema) const +LogicalFunction EverLeTintTintLogicalFunction::withInferredDataType(const Schema& schema) const { std::vector newChildren; newChildren.reserve(parameters.size()); @@ -80,7 +80,7 @@ LogicalFunction EverLeTintTfloatLogicalFunction::withInferredDataType(const Sche return withChildren(newChildren); } -SerializableFunction EverLeTintTfloatLogicalFunction::serialize() const +SerializableFunction EverLeTintTintLogicalFunction::serialize() const { SerializableFunction proto; proto.set_function_type(std::string(NAME)); @@ -90,16 +90,16 @@ SerializableFunction EverLeTintTfloatLogicalFunction::serialize() const return proto; } -LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverLeTintTfloatLogicalFunction( +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverLeTintTintLogicalFunction( LogicalFunctionRegistryArguments arguments) { PRECONDITION(arguments.children.size() == 3, - "EverLeTintTfloatLogicalFunction requires 3 children but got {}", + "EverLeTintTintLogicalFunction requires 3 children but got {}", arguments.children.size()); auto arg0 = std::move(arguments.children[0]); auto arg1 = std::move(arguments.children[1]); auto arg2 = std::move(arguments.children[2]); - return EverLeTintTfloatLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); + return EverLeTintTintLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverLtTbigintTbigintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverLtTbigintTbigintLogicalFunction.cpp index 715a85cc22..f91f384d07 100644 --- a/nes-logical-operators/src/Functions/Meos/EverLtTbigintTbigintLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/EverLtTbigintTbigintLogicalFunction.cpp @@ -12,7 +12,7 @@ limitations under the License. */ -#include +#include #include #include @@ -26,7 +26,7 @@ namespace NES { -EverLtTbigintTfloatLogicalFunction::EverLtTbigintTfloatLogicalFunction(LogicalFunction value1, +EverLtTbigintTbigintLogicalFunction::EverLtTbigintTbigintLogicalFunction(LogicalFunction value1, LogicalFunction value2, LogicalFunction ts) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) @@ -37,31 +37,31 @@ EverLtTbigintTfloatLogicalFunction::EverLtTbigintTfloatLogicalFunction(LogicalFu parameters.push_back(std::move(ts)); } -DataType EverLtTbigintTfloatLogicalFunction::getDataType() const { return dataType; } +DataType EverLtTbigintTbigintLogicalFunction::getDataType() const { return dataType; } -LogicalFunction EverLtTbigintTfloatLogicalFunction::withDataType(const DataType& newDataType) const +LogicalFunction EverLtTbigintTbigintLogicalFunction::withDataType(const DataType& newDataType) const { auto copy = *this; copy.dataType = newDataType; return copy; } -std::vector EverLtTbigintTfloatLogicalFunction::getChildren() const { return parameters; } +std::vector EverLtTbigintTbigintLogicalFunction::getChildren() const { return parameters; } -LogicalFunction EverLtTbigintTfloatLogicalFunction::withChildren(const std::vector& children) const +LogicalFunction EverLtTbigintTbigintLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 3, "EverLtTbigintTfloatLogicalFunction requires 3 children, but got {}", children.size()); + PRECONDITION(children.size() == 3, "EverLtTbigintTbigintLogicalFunction requires 3 children, but got {}", children.size()); auto copy = *this; copy.parameters = children; return copy; } -std::string_view EverLtTbigintTfloatLogicalFunction::getType() const { return NAME; } +std::string_view EverLtTbigintTbigintLogicalFunction::getType() const { return NAME; } -bool EverLtTbigintTfloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +bool EverLtTbigintTbigintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { - if (const auto* other = dynamic_cast(&rhs)) + if (const auto* other = dynamic_cast(&rhs)) return parameters == other->parameters; return false; } -std::string EverLtTbigintTfloatLogicalFunction::explain(ExplainVerbosity verbosity) const +std::string EverLtTbigintTbigintLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; for (size_t index = 0; index < parameters.size(); ++index) { @@ -71,7 +71,7 @@ std::string EverLtTbigintTfloatLogicalFunction::explain(ExplainVerbosity verbosi return fmt::format("{}({})", NAME, args); } -LogicalFunction EverLtTbigintTfloatLogicalFunction::withInferredDataType(const Schema& schema) const +LogicalFunction EverLtTbigintTbigintLogicalFunction::withInferredDataType(const Schema& schema) const { std::vector newChildren; newChildren.reserve(parameters.size()); @@ -80,7 +80,7 @@ LogicalFunction EverLtTbigintTfloatLogicalFunction::withInferredDataType(const S return withChildren(newChildren); } -SerializableFunction EverLtTbigintTfloatLogicalFunction::serialize() const +SerializableFunction EverLtTbigintTbigintLogicalFunction::serialize() const { SerializableFunction proto; proto.set_function_type(std::string(NAME)); @@ -90,16 +90,16 @@ SerializableFunction EverLtTbigintTfloatLogicalFunction::serialize() const return proto; } -LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverLtTbigintTfloatLogicalFunction( +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverLtTbigintTbigintLogicalFunction( LogicalFunctionRegistryArguments arguments) { PRECONDITION(arguments.children.size() == 3, - "EverLtTbigintTfloatLogicalFunction requires 3 children but got {}", + "EverLtTbigintTbigintLogicalFunction requires 3 children but got {}", arguments.children.size()); auto arg0 = std::move(arguments.children[0]); auto arg1 = std::move(arguments.children[1]); auto arg2 = std::move(arguments.children[2]); - return EverLtTbigintTfloatLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); + return EverLtTbigintTbigintLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverLtTintTintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverLtTintTintLogicalFunction.cpp index 39aa65da2f..1f47506dc4 100644 --- a/nes-logical-operators/src/Functions/Meos/EverLtTintTintLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/EverLtTintTintLogicalFunction.cpp @@ -12,7 +12,7 @@ limitations under the License. */ -#include +#include #include #include @@ -26,7 +26,7 @@ namespace NES { -EverLtTintTfloatLogicalFunction::EverLtTintTfloatLogicalFunction(LogicalFunction value1, +EverLtTintTintLogicalFunction::EverLtTintTintLogicalFunction(LogicalFunction value1, LogicalFunction value2, LogicalFunction ts) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) @@ -37,31 +37,31 @@ EverLtTintTfloatLogicalFunction::EverLtTintTfloatLogicalFunction(LogicalFunction parameters.push_back(std::move(ts)); } -DataType EverLtTintTfloatLogicalFunction::getDataType() const { return dataType; } +DataType EverLtTintTintLogicalFunction::getDataType() const { return dataType; } -LogicalFunction EverLtTintTfloatLogicalFunction::withDataType(const DataType& newDataType) const +LogicalFunction EverLtTintTintLogicalFunction::withDataType(const DataType& newDataType) const { auto copy = *this; copy.dataType = newDataType; return copy; } -std::vector EverLtTintTfloatLogicalFunction::getChildren() const { return parameters; } +std::vector EverLtTintTintLogicalFunction::getChildren() const { return parameters; } -LogicalFunction EverLtTintTfloatLogicalFunction::withChildren(const std::vector& children) const +LogicalFunction EverLtTintTintLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 3, "EverLtTintTfloatLogicalFunction requires 3 children, but got {}", children.size()); + PRECONDITION(children.size() == 3, "EverLtTintTintLogicalFunction requires 3 children, but got {}", children.size()); auto copy = *this; copy.parameters = children; return copy; } -std::string_view EverLtTintTfloatLogicalFunction::getType() const { return NAME; } +std::string_view EverLtTintTintLogicalFunction::getType() const { return NAME; } -bool EverLtTintTfloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +bool EverLtTintTintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { - if (const auto* other = dynamic_cast(&rhs)) + if (const auto* other = dynamic_cast(&rhs)) return parameters == other->parameters; return false; } -std::string EverLtTintTfloatLogicalFunction::explain(ExplainVerbosity verbosity) const +std::string EverLtTintTintLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; for (size_t index = 0; index < parameters.size(); ++index) { @@ -71,7 +71,7 @@ std::string EverLtTintTfloatLogicalFunction::explain(ExplainVerbosity verbosity) return fmt::format("{}({})", NAME, args); } -LogicalFunction EverLtTintTfloatLogicalFunction::withInferredDataType(const Schema& schema) const +LogicalFunction EverLtTintTintLogicalFunction::withInferredDataType(const Schema& schema) const { std::vector newChildren; newChildren.reserve(parameters.size()); @@ -80,7 +80,7 @@ LogicalFunction EverLtTintTfloatLogicalFunction::withInferredDataType(const Sche return withChildren(newChildren); } -SerializableFunction EverLtTintTfloatLogicalFunction::serialize() const +SerializableFunction EverLtTintTintLogicalFunction::serialize() const { SerializableFunction proto; proto.set_function_type(std::string(NAME)); @@ -90,16 +90,16 @@ SerializableFunction EverLtTintTfloatLogicalFunction::serialize() const return proto; } -LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverLtTintTfloatLogicalFunction( +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverLtTintTintLogicalFunction( LogicalFunctionRegistryArguments arguments) { PRECONDITION(arguments.children.size() == 3, - "EverLtTintTfloatLogicalFunction requires 3 children but got {}", + "EverLtTintTintLogicalFunction requires 3 children but got {}", arguments.children.size()); auto arg0 = std::move(arguments.children[0]); auto arg1 = std::move(arguments.children[1]); auto arg2 = std::move(arguments.children[2]); - return EverLtTintTfloatLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); + return EverLtTintTintLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverNeTbigintTbigintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverNeTbigintTbigintLogicalFunction.cpp index c4bdbe9e42..1561ed36fe 100644 --- a/nes-logical-operators/src/Functions/Meos/EverNeTbigintTbigintLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/EverNeTbigintTbigintLogicalFunction.cpp @@ -12,7 +12,7 @@ limitations under the License. */ -#include +#include #include #include @@ -26,7 +26,7 @@ namespace NES { -EverNeTbigintTfloatLogicalFunction::EverNeTbigintTfloatLogicalFunction(LogicalFunction value1, +EverNeTbigintTbigintLogicalFunction::EverNeTbigintTbigintLogicalFunction(LogicalFunction value1, LogicalFunction value2, LogicalFunction ts) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) @@ -37,31 +37,31 @@ EverNeTbigintTfloatLogicalFunction::EverNeTbigintTfloatLogicalFunction(LogicalFu parameters.push_back(std::move(ts)); } -DataType EverNeTbigintTfloatLogicalFunction::getDataType() const { return dataType; } +DataType EverNeTbigintTbigintLogicalFunction::getDataType() const { return dataType; } -LogicalFunction EverNeTbigintTfloatLogicalFunction::withDataType(const DataType& newDataType) const +LogicalFunction EverNeTbigintTbigintLogicalFunction::withDataType(const DataType& newDataType) const { auto copy = *this; copy.dataType = newDataType; return copy; } -std::vector EverNeTbigintTfloatLogicalFunction::getChildren() const { return parameters; } +std::vector EverNeTbigintTbigintLogicalFunction::getChildren() const { return parameters; } -LogicalFunction EverNeTbigintTfloatLogicalFunction::withChildren(const std::vector& children) const +LogicalFunction EverNeTbigintTbigintLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 3, "EverNeTbigintTfloatLogicalFunction requires 3 children, but got {}", children.size()); + PRECONDITION(children.size() == 3, "EverNeTbigintTbigintLogicalFunction requires 3 children, but got {}", children.size()); auto copy = *this; copy.parameters = children; return copy; } -std::string_view EverNeTbigintTfloatLogicalFunction::getType() const { return NAME; } +std::string_view EverNeTbigintTbigintLogicalFunction::getType() const { return NAME; } -bool EverNeTbigintTfloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +bool EverNeTbigintTbigintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { - if (const auto* other = dynamic_cast(&rhs)) + if (const auto* other = dynamic_cast(&rhs)) return parameters == other->parameters; return false; } -std::string EverNeTbigintTfloatLogicalFunction::explain(ExplainVerbosity verbosity) const +std::string EverNeTbigintTbigintLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; for (size_t index = 0; index < parameters.size(); ++index) { @@ -71,7 +71,7 @@ std::string EverNeTbigintTfloatLogicalFunction::explain(ExplainVerbosity verbosi return fmt::format("{}({})", NAME, args); } -LogicalFunction EverNeTbigintTfloatLogicalFunction::withInferredDataType(const Schema& schema) const +LogicalFunction EverNeTbigintTbigintLogicalFunction::withInferredDataType(const Schema& schema) const { std::vector newChildren; newChildren.reserve(parameters.size()); @@ -80,7 +80,7 @@ LogicalFunction EverNeTbigintTfloatLogicalFunction::withInferredDataType(const S return withChildren(newChildren); } -SerializableFunction EverNeTbigintTfloatLogicalFunction::serialize() const +SerializableFunction EverNeTbigintTbigintLogicalFunction::serialize() const { SerializableFunction proto; proto.set_function_type(std::string(NAME)); @@ -90,16 +90,16 @@ SerializableFunction EverNeTbigintTfloatLogicalFunction::serialize() const return proto; } -LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverNeTbigintTfloatLogicalFunction( +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverNeTbigintTbigintLogicalFunction( LogicalFunctionRegistryArguments arguments) { PRECONDITION(arguments.children.size() == 3, - "EverNeTbigintTfloatLogicalFunction requires 3 children but got {}", + "EverNeTbigintTbigintLogicalFunction requires 3 children but got {}", arguments.children.size()); auto arg0 = std::move(arguments.children[0]); auto arg1 = std::move(arguments.children[1]); auto arg2 = std::move(arguments.children[2]); - return EverNeTbigintTfloatLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); + return EverNeTbigintTbigintLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverNeTintTintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverNeTintTintLogicalFunction.cpp index 5a73940882..f6562fdcae 100644 --- a/nes-logical-operators/src/Functions/Meos/EverNeTintTintLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/EverNeTintTintLogicalFunction.cpp @@ -12,7 +12,7 @@ limitations under the License. */ -#include +#include #include #include @@ -26,7 +26,7 @@ namespace NES { -EverNeTintTfloatLogicalFunction::EverNeTintTfloatLogicalFunction(LogicalFunction value1, +EverNeTintTintLogicalFunction::EverNeTintTintLogicalFunction(LogicalFunction value1, LogicalFunction value2, LogicalFunction ts) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) @@ -37,31 +37,31 @@ EverNeTintTfloatLogicalFunction::EverNeTintTfloatLogicalFunction(LogicalFunction parameters.push_back(std::move(ts)); } -DataType EverNeTintTfloatLogicalFunction::getDataType() const { return dataType; } +DataType EverNeTintTintLogicalFunction::getDataType() const { return dataType; } -LogicalFunction EverNeTintTfloatLogicalFunction::withDataType(const DataType& newDataType) const +LogicalFunction EverNeTintTintLogicalFunction::withDataType(const DataType& newDataType) const { auto copy = *this; copy.dataType = newDataType; return copy; } -std::vector EverNeTintTfloatLogicalFunction::getChildren() const { return parameters; } +std::vector EverNeTintTintLogicalFunction::getChildren() const { return parameters; } -LogicalFunction EverNeTintTfloatLogicalFunction::withChildren(const std::vector& children) const +LogicalFunction EverNeTintTintLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 3, "EverNeTintTfloatLogicalFunction requires 3 children, but got {}", children.size()); + PRECONDITION(children.size() == 3, "EverNeTintTintLogicalFunction requires 3 children, but got {}", children.size()); auto copy = *this; copy.parameters = children; return copy; } -std::string_view EverNeTintTfloatLogicalFunction::getType() const { return NAME; } +std::string_view EverNeTintTintLogicalFunction::getType() const { return NAME; } -bool EverNeTintTfloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +bool EverNeTintTintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { - if (const auto* other = dynamic_cast(&rhs)) + if (const auto* other = dynamic_cast(&rhs)) return parameters == other->parameters; return false; } -std::string EverNeTintTfloatLogicalFunction::explain(ExplainVerbosity verbosity) const +std::string EverNeTintTintLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; for (size_t index = 0; index < parameters.size(); ++index) { @@ -71,7 +71,7 @@ std::string EverNeTintTfloatLogicalFunction::explain(ExplainVerbosity verbosity) return fmt::format("{}({})", NAME, args); } -LogicalFunction EverNeTintTfloatLogicalFunction::withInferredDataType(const Schema& schema) const +LogicalFunction EverNeTintTintLogicalFunction::withInferredDataType(const Schema& schema) const { std::vector newChildren; newChildren.reserve(parameters.size()); @@ -80,7 +80,7 @@ LogicalFunction EverNeTintTfloatLogicalFunction::withInferredDataType(const Sche return withChildren(newChildren); } -SerializableFunction EverNeTintTfloatLogicalFunction::serialize() const +SerializableFunction EverNeTintTintLogicalFunction::serialize() const { SerializableFunction proto; proto.set_function_type(std::string(NAME)); @@ -90,16 +90,16 @@ SerializableFunction EverNeTintTfloatLogicalFunction::serialize() const return proto; } -LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverNeTintTfloatLogicalFunction( +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverNeTintTintLogicalFunction( LogicalFunctionRegistryArguments arguments) { PRECONDITION(arguments.children.size() == 3, - "EverNeTintTfloatLogicalFunction requires 3 children but got {}", + "EverNeTintTintLogicalFunction requires 3 children but got {}", arguments.children.size()); auto arg0 = std::move(arguments.children[0]); auto arg1 = std::move(arguments.children[1]); auto arg2 = std::move(arguments.children[2]); - return EverNeTintTfloatLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); + return EverNeTintTintLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TboolToTintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TboolToTintLogicalFunction.cpp new file mode 100644 index 0000000000..7ffe35b195 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TboolToTintLogicalFunction.cpp @@ -0,0 +1,102 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TboolToTintLogicalFunction::TboolToTintLogicalFunction(LogicalFunction value, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(2); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(ts)); +} + +DataType TboolToTintLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction TboolToTintLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector TboolToTintLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction TboolToTintLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 2, "TboolToTintLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view TboolToTintLogicalFunction::getType() const { return NAME; } + +bool TboolToTintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string TboolToTintLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TboolToTintLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction TboolToTintLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTboolToTintLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 2, + "TboolToTintLogicalFunction requires 2 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + return TboolToTintLogicalFunction(std::move(arg0), std::move(arg1)); +} + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysEqTbigintTbigintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysEqTbigintTbigintPhysicalFunction.hpp index d03da809cf..5a2d1af1fb 100644 --- a/nes-physical-operators/include/Functions/Meos/AlwaysEqTbigintTbigintPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/AlwaysEqTbigintTbigintPhysicalFunction.hpp @@ -28,9 +28,9 @@ namespace NES { * * Generated by tools/codegen/codegen_nebula.py. */ -class AlwaysEqTbigintTfloatPhysicalFunction : public PhysicalFunctionConcept { +class AlwaysEqTbigintTbigintPhysicalFunction : public PhysicalFunctionConcept { public: - AlwaysEqTbigintTfloatPhysicalFunction(PhysicalFunction value1Function, + AlwaysEqTbigintTbigintPhysicalFunction(PhysicalFunction value1Function, PhysicalFunction value2Function, PhysicalFunction tsFunction); diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysEqTintTintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysEqTintTintPhysicalFunction.hpp index de9dea6e9a..207be5cf00 100644 --- a/nes-physical-operators/include/Functions/Meos/AlwaysEqTintTintPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/AlwaysEqTintTintPhysicalFunction.hpp @@ -28,9 +28,9 @@ namespace NES { * * Generated by tools/codegen/codegen_nebula.py. */ -class AlwaysEqTintTfloatPhysicalFunction : public PhysicalFunctionConcept { +class AlwaysEqTintTintPhysicalFunction : public PhysicalFunctionConcept { public: - AlwaysEqTintTfloatPhysicalFunction(PhysicalFunction value1Function, + AlwaysEqTintTintPhysicalFunction(PhysicalFunction value1Function, PhysicalFunction value2Function, PhysicalFunction tsFunction); diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysGeTbigintTbigintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysGeTbigintTbigintPhysicalFunction.hpp index 8d166e1d18..6a63d58931 100644 --- a/nes-physical-operators/include/Functions/Meos/AlwaysGeTbigintTbigintPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/AlwaysGeTbigintTbigintPhysicalFunction.hpp @@ -28,9 +28,9 @@ namespace NES { * * Generated by tools/codegen/codegen_nebula.py. */ -class AlwaysGeTbigintTfloatPhysicalFunction : public PhysicalFunctionConcept { +class AlwaysGeTbigintTbigintPhysicalFunction : public PhysicalFunctionConcept { public: - AlwaysGeTbigintTfloatPhysicalFunction(PhysicalFunction value1Function, + AlwaysGeTbigintTbigintPhysicalFunction(PhysicalFunction value1Function, PhysicalFunction value2Function, PhysicalFunction tsFunction); diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysGeTintTintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysGeTintTintPhysicalFunction.hpp index 7ec07a1a5e..7a2bcdc4e2 100644 --- a/nes-physical-operators/include/Functions/Meos/AlwaysGeTintTintPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/AlwaysGeTintTintPhysicalFunction.hpp @@ -28,9 +28,9 @@ namespace NES { * * Generated by tools/codegen/codegen_nebula.py. */ -class AlwaysGeTintTfloatPhysicalFunction : public PhysicalFunctionConcept { +class AlwaysGeTintTintPhysicalFunction : public PhysicalFunctionConcept { public: - AlwaysGeTintTfloatPhysicalFunction(PhysicalFunction value1Function, + AlwaysGeTintTintPhysicalFunction(PhysicalFunction value1Function, PhysicalFunction value2Function, PhysicalFunction tsFunction); diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysGtTbigintTbigintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysGtTbigintTbigintPhysicalFunction.hpp index 85322c8557..978b07d5ef 100644 --- a/nes-physical-operators/include/Functions/Meos/AlwaysGtTbigintTbigintPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/AlwaysGtTbigintTbigintPhysicalFunction.hpp @@ -28,9 +28,9 @@ namespace NES { * * Generated by tools/codegen/codegen_nebula.py. */ -class AlwaysGtTbigintTfloatPhysicalFunction : public PhysicalFunctionConcept { +class AlwaysGtTbigintTbigintPhysicalFunction : public PhysicalFunctionConcept { public: - AlwaysGtTbigintTfloatPhysicalFunction(PhysicalFunction value1Function, + AlwaysGtTbigintTbigintPhysicalFunction(PhysicalFunction value1Function, PhysicalFunction value2Function, PhysicalFunction tsFunction); diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysGtTintTintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysGtTintTintPhysicalFunction.hpp index ee47873039..b4eb7237d7 100644 --- a/nes-physical-operators/include/Functions/Meos/AlwaysGtTintTintPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/AlwaysGtTintTintPhysicalFunction.hpp @@ -28,9 +28,9 @@ namespace NES { * * Generated by tools/codegen/codegen_nebula.py. */ -class AlwaysGtTintTfloatPhysicalFunction : public PhysicalFunctionConcept { +class AlwaysGtTintTintPhysicalFunction : public PhysicalFunctionConcept { public: - AlwaysGtTintTfloatPhysicalFunction(PhysicalFunction value1Function, + AlwaysGtTintTintPhysicalFunction(PhysicalFunction value1Function, PhysicalFunction value2Function, PhysicalFunction tsFunction); diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysLeTbigintTbigintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysLeTbigintTbigintPhysicalFunction.hpp index bbaf3b2281..bb133b7e6c 100644 --- a/nes-physical-operators/include/Functions/Meos/AlwaysLeTbigintTbigintPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/AlwaysLeTbigintTbigintPhysicalFunction.hpp @@ -28,9 +28,9 @@ namespace NES { * * Generated by tools/codegen/codegen_nebula.py. */ -class AlwaysLeTbigintTfloatPhysicalFunction : public PhysicalFunctionConcept { +class AlwaysLeTbigintTbigintPhysicalFunction : public PhysicalFunctionConcept { public: - AlwaysLeTbigintTfloatPhysicalFunction(PhysicalFunction value1Function, + AlwaysLeTbigintTbigintPhysicalFunction(PhysicalFunction value1Function, PhysicalFunction value2Function, PhysicalFunction tsFunction); diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysLeTintTintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysLeTintTintPhysicalFunction.hpp index 38e8137ff1..da439e5478 100644 --- a/nes-physical-operators/include/Functions/Meos/AlwaysLeTintTintPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/AlwaysLeTintTintPhysicalFunction.hpp @@ -28,9 +28,9 @@ namespace NES { * * Generated by tools/codegen/codegen_nebula.py. */ -class AlwaysLeTintTfloatPhysicalFunction : public PhysicalFunctionConcept { +class AlwaysLeTintTintPhysicalFunction : public PhysicalFunctionConcept { public: - AlwaysLeTintTfloatPhysicalFunction(PhysicalFunction value1Function, + AlwaysLeTintTintPhysicalFunction(PhysicalFunction value1Function, PhysicalFunction value2Function, PhysicalFunction tsFunction); diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysLtTbigintTbigintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysLtTbigintTbigintPhysicalFunction.hpp index ce560fd1c2..944add04ff 100644 --- a/nes-physical-operators/include/Functions/Meos/AlwaysLtTbigintTbigintPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/AlwaysLtTbigintTbigintPhysicalFunction.hpp @@ -28,9 +28,9 @@ namespace NES { * * Generated by tools/codegen/codegen_nebula.py. */ -class AlwaysLtTbigintTfloatPhysicalFunction : public PhysicalFunctionConcept { +class AlwaysLtTbigintTbigintPhysicalFunction : public PhysicalFunctionConcept { public: - AlwaysLtTbigintTfloatPhysicalFunction(PhysicalFunction value1Function, + AlwaysLtTbigintTbigintPhysicalFunction(PhysicalFunction value1Function, PhysicalFunction value2Function, PhysicalFunction tsFunction); diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysLtTintTintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysLtTintTintPhysicalFunction.hpp index ae9d97fd84..4e0136a66c 100644 --- a/nes-physical-operators/include/Functions/Meos/AlwaysLtTintTintPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/AlwaysLtTintTintPhysicalFunction.hpp @@ -28,9 +28,9 @@ namespace NES { * * Generated by tools/codegen/codegen_nebula.py. */ -class AlwaysLtTintTfloatPhysicalFunction : public PhysicalFunctionConcept { +class AlwaysLtTintTintPhysicalFunction : public PhysicalFunctionConcept { public: - AlwaysLtTintTfloatPhysicalFunction(PhysicalFunction value1Function, + AlwaysLtTintTintPhysicalFunction(PhysicalFunction value1Function, PhysicalFunction value2Function, PhysicalFunction tsFunction); diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysNeTbigintTbigintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysNeTbigintTbigintPhysicalFunction.hpp index acf3065538..b07e1473ac 100644 --- a/nes-physical-operators/include/Functions/Meos/AlwaysNeTbigintTbigintPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/AlwaysNeTbigintTbigintPhysicalFunction.hpp @@ -28,9 +28,9 @@ namespace NES { * * Generated by tools/codegen/codegen_nebula.py. */ -class AlwaysNeTbigintTfloatPhysicalFunction : public PhysicalFunctionConcept { +class AlwaysNeTbigintTbigintPhysicalFunction : public PhysicalFunctionConcept { public: - AlwaysNeTbigintTfloatPhysicalFunction(PhysicalFunction value1Function, + AlwaysNeTbigintTbigintPhysicalFunction(PhysicalFunction value1Function, PhysicalFunction value2Function, PhysicalFunction tsFunction); diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysNeTintTintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysNeTintTintPhysicalFunction.hpp index a2822cb82c..782e592249 100644 --- a/nes-physical-operators/include/Functions/Meos/AlwaysNeTintTintPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/AlwaysNeTintTintPhysicalFunction.hpp @@ -28,9 +28,9 @@ namespace NES { * * Generated by tools/codegen/codegen_nebula.py. */ -class AlwaysNeTintTfloatPhysicalFunction : public PhysicalFunctionConcept { +class AlwaysNeTintTintPhysicalFunction : public PhysicalFunctionConcept { public: - AlwaysNeTintTfloatPhysicalFunction(PhysicalFunction value1Function, + AlwaysNeTintTintPhysicalFunction(PhysicalFunction value1Function, PhysicalFunction value2Function, PhysicalFunction tsFunction); diff --git a/nes-physical-operators/include/Functions/Meos/EverEqTbigintTbigintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverEqTbigintTbigintPhysicalFunction.hpp index feaa66970f..18cb76960a 100644 --- a/nes-physical-operators/include/Functions/Meos/EverEqTbigintTbigintPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/EverEqTbigintTbigintPhysicalFunction.hpp @@ -28,9 +28,9 @@ namespace NES { * * Generated by tools/codegen/codegen_nebula.py. */ -class EverEqTbigintTfloatPhysicalFunction : public PhysicalFunctionConcept { +class EverEqTbigintTbigintPhysicalFunction : public PhysicalFunctionConcept { public: - EverEqTbigintTfloatPhysicalFunction(PhysicalFunction value1Function, + EverEqTbigintTbigintPhysicalFunction(PhysicalFunction value1Function, PhysicalFunction value2Function, PhysicalFunction tsFunction); diff --git a/nes-physical-operators/include/Functions/Meos/EverEqTintTintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverEqTintTintPhysicalFunction.hpp index 77d542711b..68631d0f34 100644 --- a/nes-physical-operators/include/Functions/Meos/EverEqTintTintPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/EverEqTintTintPhysicalFunction.hpp @@ -28,9 +28,9 @@ namespace NES { * * Generated by tools/codegen/codegen_nebula.py. */ -class EverEqTintTfloatPhysicalFunction : public PhysicalFunctionConcept { +class EverEqTintTintPhysicalFunction : public PhysicalFunctionConcept { public: - EverEqTintTfloatPhysicalFunction(PhysicalFunction value1Function, + EverEqTintTintPhysicalFunction(PhysicalFunction value1Function, PhysicalFunction value2Function, PhysicalFunction tsFunction); diff --git a/nes-physical-operators/include/Functions/Meos/EverGeTbigintTbigintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverGeTbigintTbigintPhysicalFunction.hpp index c14497db81..6244735062 100644 --- a/nes-physical-operators/include/Functions/Meos/EverGeTbigintTbigintPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/EverGeTbigintTbigintPhysicalFunction.hpp @@ -28,9 +28,9 @@ namespace NES { * * Generated by tools/codegen/codegen_nebula.py. */ -class EverGeTbigintTfloatPhysicalFunction : public PhysicalFunctionConcept { +class EverGeTbigintTbigintPhysicalFunction : public PhysicalFunctionConcept { public: - EverGeTbigintTfloatPhysicalFunction(PhysicalFunction value1Function, + EverGeTbigintTbigintPhysicalFunction(PhysicalFunction value1Function, PhysicalFunction value2Function, PhysicalFunction tsFunction); diff --git a/nes-physical-operators/include/Functions/Meos/EverGeTintTintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverGeTintTintPhysicalFunction.hpp index e0f449ef14..830083a5e1 100644 --- a/nes-physical-operators/include/Functions/Meos/EverGeTintTintPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/EverGeTintTintPhysicalFunction.hpp @@ -28,9 +28,9 @@ namespace NES { * * Generated by tools/codegen/codegen_nebula.py. */ -class EverGeTintTfloatPhysicalFunction : public PhysicalFunctionConcept { +class EverGeTintTintPhysicalFunction : public PhysicalFunctionConcept { public: - EverGeTintTfloatPhysicalFunction(PhysicalFunction value1Function, + EverGeTintTintPhysicalFunction(PhysicalFunction value1Function, PhysicalFunction value2Function, PhysicalFunction tsFunction); diff --git a/nes-physical-operators/include/Functions/Meos/EverGtTbigintTbigintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverGtTbigintTbigintPhysicalFunction.hpp index 7137cd04c1..be6deeb4c3 100644 --- a/nes-physical-operators/include/Functions/Meos/EverGtTbigintTbigintPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/EverGtTbigintTbigintPhysicalFunction.hpp @@ -28,9 +28,9 @@ namespace NES { * * Generated by tools/codegen/codegen_nebula.py. */ -class EverGtTbigintTfloatPhysicalFunction : public PhysicalFunctionConcept { +class EverGtTbigintTbigintPhysicalFunction : public PhysicalFunctionConcept { public: - EverGtTbigintTfloatPhysicalFunction(PhysicalFunction value1Function, + EverGtTbigintTbigintPhysicalFunction(PhysicalFunction value1Function, PhysicalFunction value2Function, PhysicalFunction tsFunction); diff --git a/nes-physical-operators/include/Functions/Meos/EverGtTintTintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverGtTintTintPhysicalFunction.hpp index 6bed523848..696a35d40b 100644 --- a/nes-physical-operators/include/Functions/Meos/EverGtTintTintPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/EverGtTintTintPhysicalFunction.hpp @@ -28,9 +28,9 @@ namespace NES { * * Generated by tools/codegen/codegen_nebula.py. */ -class EverGtTintTfloatPhysicalFunction : public PhysicalFunctionConcept { +class EverGtTintTintPhysicalFunction : public PhysicalFunctionConcept { public: - EverGtTintTfloatPhysicalFunction(PhysicalFunction value1Function, + EverGtTintTintPhysicalFunction(PhysicalFunction value1Function, PhysicalFunction value2Function, PhysicalFunction tsFunction); diff --git a/nes-physical-operators/include/Functions/Meos/EverLeTbigintTbigintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverLeTbigintTbigintPhysicalFunction.hpp index f11bc3c16c..40eeceaf8d 100644 --- a/nes-physical-operators/include/Functions/Meos/EverLeTbigintTbigintPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/EverLeTbigintTbigintPhysicalFunction.hpp @@ -28,9 +28,9 @@ namespace NES { * * Generated by tools/codegen/codegen_nebula.py. */ -class EverLeTbigintTfloatPhysicalFunction : public PhysicalFunctionConcept { +class EverLeTbigintTbigintPhysicalFunction : public PhysicalFunctionConcept { public: - EverLeTbigintTfloatPhysicalFunction(PhysicalFunction value1Function, + EverLeTbigintTbigintPhysicalFunction(PhysicalFunction value1Function, PhysicalFunction value2Function, PhysicalFunction tsFunction); diff --git a/nes-physical-operators/include/Functions/Meos/EverLeTintTintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverLeTintTintPhysicalFunction.hpp index 15a53b5bdf..474f05f496 100644 --- a/nes-physical-operators/include/Functions/Meos/EverLeTintTintPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/EverLeTintTintPhysicalFunction.hpp @@ -28,9 +28,9 @@ namespace NES { * * Generated by tools/codegen/codegen_nebula.py. */ -class EverLeTintTfloatPhysicalFunction : public PhysicalFunctionConcept { +class EverLeTintTintPhysicalFunction : public PhysicalFunctionConcept { public: - EverLeTintTfloatPhysicalFunction(PhysicalFunction value1Function, + EverLeTintTintPhysicalFunction(PhysicalFunction value1Function, PhysicalFunction value2Function, PhysicalFunction tsFunction); diff --git a/nes-physical-operators/include/Functions/Meos/EverLtTbigintTbigintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverLtTbigintTbigintPhysicalFunction.hpp index bb25e34d09..b34d196a70 100644 --- a/nes-physical-operators/include/Functions/Meos/EverLtTbigintTbigintPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/EverLtTbigintTbigintPhysicalFunction.hpp @@ -28,9 +28,9 @@ namespace NES { * * Generated by tools/codegen/codegen_nebula.py. */ -class EverLtTbigintTfloatPhysicalFunction : public PhysicalFunctionConcept { +class EverLtTbigintTbigintPhysicalFunction : public PhysicalFunctionConcept { public: - EverLtTbigintTfloatPhysicalFunction(PhysicalFunction value1Function, + EverLtTbigintTbigintPhysicalFunction(PhysicalFunction value1Function, PhysicalFunction value2Function, PhysicalFunction tsFunction); diff --git a/nes-physical-operators/include/Functions/Meos/EverLtTintTintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverLtTintTintPhysicalFunction.hpp index b483fd4afc..7c86434ab6 100644 --- a/nes-physical-operators/include/Functions/Meos/EverLtTintTintPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/EverLtTintTintPhysicalFunction.hpp @@ -28,9 +28,9 @@ namespace NES { * * Generated by tools/codegen/codegen_nebula.py. */ -class EverLtTintTfloatPhysicalFunction : public PhysicalFunctionConcept { +class EverLtTintTintPhysicalFunction : public PhysicalFunctionConcept { public: - EverLtTintTfloatPhysicalFunction(PhysicalFunction value1Function, + EverLtTintTintPhysicalFunction(PhysicalFunction value1Function, PhysicalFunction value2Function, PhysicalFunction tsFunction); diff --git a/nes-physical-operators/include/Functions/Meos/EverNeTbigintTbigintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverNeTbigintTbigintPhysicalFunction.hpp index 406dd8b083..f6fe0c3bc3 100644 --- a/nes-physical-operators/include/Functions/Meos/EverNeTbigintTbigintPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/EverNeTbigintTbigintPhysicalFunction.hpp @@ -28,9 +28,9 @@ namespace NES { * * Generated by tools/codegen/codegen_nebula.py. */ -class EverNeTbigintTfloatPhysicalFunction : public PhysicalFunctionConcept { +class EverNeTbigintTbigintPhysicalFunction : public PhysicalFunctionConcept { public: - EverNeTbigintTfloatPhysicalFunction(PhysicalFunction value1Function, + EverNeTbigintTbigintPhysicalFunction(PhysicalFunction value1Function, PhysicalFunction value2Function, PhysicalFunction tsFunction); diff --git a/nes-physical-operators/include/Functions/Meos/EverNeTintTintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverNeTintTintPhysicalFunction.hpp index 070a0b888a..3dfabb9e8d 100644 --- a/nes-physical-operators/include/Functions/Meos/EverNeTintTintPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/EverNeTintTintPhysicalFunction.hpp @@ -28,9 +28,9 @@ namespace NES { * * Generated by tools/codegen/codegen_nebula.py. */ -class EverNeTintTfloatPhysicalFunction : public PhysicalFunctionConcept { +class EverNeTintTintPhysicalFunction : public PhysicalFunctionConcept { public: - EverNeTintTfloatPhysicalFunction(PhysicalFunction value1Function, + EverNeTintTintPhysicalFunction(PhysicalFunction value1Function, PhysicalFunction value2Function, PhysicalFunction tsFunction); diff --git a/nes-physical-operators/include/Functions/Meos/TboolToTintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TboolToTintPhysicalFunction.hpp new file mode 100644 index 0000000000..473cc7f507 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TboolToTintPhysicalFunction.hpp @@ -0,0 +1,42 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `tbool_to_tint`. + * + * Per-event tbool_to_tint: single-instant tbool cast to tint, result extracted -> double. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TboolToTintPhysicalFunction : public PhysicalFunctionConcept { +public: + TboolToTintPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysEqTbigintTbigintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysEqTbigintTbigintPhysicalFunction.cpp index bf44057630..3bbe7fcaba 100644 --- a/nes-physical-operators/src/Functions/Meos/AlwaysEqTbigintTbigintPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/AlwaysEqTbigintTbigintPhysicalFunction.cpp @@ -67,7 +67,7 @@ VarVal AlwaysEqTbigintTbigintPhysicalFunction::execute(const Record& record, Are if (!temp1) return 0.0; Temporal* temp2 = tbigint_in(wkt2.c_str()); if (!temp2) { free(temp1); return 0.0; } - int r = always_eq_tbigint_tbigint(temp1, temp2); + int r = always_eq_temporal_temporal(temp1, temp2); free(temp1); free(temp2); return static_cast(r); diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysEqTintTintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysEqTintTintPhysicalFunction.cpp index e1c238acdd..d60ec80d9b 100644 --- a/nes-physical-operators/src/Functions/Meos/AlwaysEqTintTintPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/AlwaysEqTintTintPhysicalFunction.cpp @@ -67,7 +67,7 @@ VarVal AlwaysEqTintTintPhysicalFunction::execute(const Record& record, ArenaRef& if (!temp1) return 0.0; Temporal* temp2 = tint_in(wkt2.c_str()); if (!temp2) { free(temp1); return 0.0; } - int r = always_eq_tint_tint(temp1, temp2); + int r = always_eq_temporal_temporal(temp1, temp2); free(temp1); free(temp2); return static_cast(r); diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysGeTbigintTbigintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysGeTbigintTbigintPhysicalFunction.cpp index f810dcceb8..8b6fab2658 100644 --- a/nes-physical-operators/src/Functions/Meos/AlwaysGeTbigintTbigintPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/AlwaysGeTbigintTbigintPhysicalFunction.cpp @@ -67,7 +67,7 @@ VarVal AlwaysGeTbigintTbigintPhysicalFunction::execute(const Record& record, Are if (!temp1) return 0.0; Temporal* temp2 = tbigint_in(wkt2.c_str()); if (!temp2) { free(temp1); return 0.0; } - int r = always_ge_tbigint_tbigint(temp1, temp2); + int r = always_ge_temporal_temporal(temp1, temp2); free(temp1); free(temp2); return static_cast(r); diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysGeTintTintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysGeTintTintPhysicalFunction.cpp index 13abe21605..eaad3fcdb3 100644 --- a/nes-physical-operators/src/Functions/Meos/AlwaysGeTintTintPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/AlwaysGeTintTintPhysicalFunction.cpp @@ -67,7 +67,7 @@ VarVal AlwaysGeTintTintPhysicalFunction::execute(const Record& record, ArenaRef& if (!temp1) return 0.0; Temporal* temp2 = tint_in(wkt2.c_str()); if (!temp2) { free(temp1); return 0.0; } - int r = always_ge_tint_tint(temp1, temp2); + int r = always_ge_temporal_temporal(temp1, temp2); free(temp1); free(temp2); return static_cast(r); diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysGtTbigintTbigintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysGtTbigintTbigintPhysicalFunction.cpp index 06b7e7ee23..0bcde3a315 100644 --- a/nes-physical-operators/src/Functions/Meos/AlwaysGtTbigintTbigintPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/AlwaysGtTbigintTbigintPhysicalFunction.cpp @@ -67,7 +67,7 @@ VarVal AlwaysGtTbigintTbigintPhysicalFunction::execute(const Record& record, Are if (!temp1) return 0.0; Temporal* temp2 = tbigint_in(wkt2.c_str()); if (!temp2) { free(temp1); return 0.0; } - int r = always_gt_tbigint_tbigint(temp1, temp2); + int r = always_gt_temporal_temporal(temp1, temp2); free(temp1); free(temp2); return static_cast(r); diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysGtTintTintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysGtTintTintPhysicalFunction.cpp index e9f1824a0c..139248ab9f 100644 --- a/nes-physical-operators/src/Functions/Meos/AlwaysGtTintTintPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/AlwaysGtTintTintPhysicalFunction.cpp @@ -67,7 +67,7 @@ VarVal AlwaysGtTintTintPhysicalFunction::execute(const Record& record, ArenaRef& if (!temp1) return 0.0; Temporal* temp2 = tint_in(wkt2.c_str()); if (!temp2) { free(temp1); return 0.0; } - int r = always_gt_tint_tint(temp1, temp2); + int r = always_gt_temporal_temporal(temp1, temp2); free(temp1); free(temp2); return static_cast(r); diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysLeTbigintTbigintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysLeTbigintTbigintPhysicalFunction.cpp index d2cb50c242..508776aa71 100644 --- a/nes-physical-operators/src/Functions/Meos/AlwaysLeTbigintTbigintPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/AlwaysLeTbigintTbigintPhysicalFunction.cpp @@ -67,7 +67,7 @@ VarVal AlwaysLeTbigintTbigintPhysicalFunction::execute(const Record& record, Are if (!temp1) return 0.0; Temporal* temp2 = tbigint_in(wkt2.c_str()); if (!temp2) { free(temp1); return 0.0; } - int r = always_le_tbigint_tbigint(temp1, temp2); + int r = always_le_temporal_temporal(temp1, temp2); free(temp1); free(temp2); return static_cast(r); diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysLeTintTintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysLeTintTintPhysicalFunction.cpp index 974b4caaca..2c95ea51f2 100644 --- a/nes-physical-operators/src/Functions/Meos/AlwaysLeTintTintPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/AlwaysLeTintTintPhysicalFunction.cpp @@ -67,7 +67,7 @@ VarVal AlwaysLeTintTintPhysicalFunction::execute(const Record& record, ArenaRef& if (!temp1) return 0.0; Temporal* temp2 = tint_in(wkt2.c_str()); if (!temp2) { free(temp1); return 0.0; } - int r = always_le_tint_tint(temp1, temp2); + int r = always_le_temporal_temporal(temp1, temp2); free(temp1); free(temp2); return static_cast(r); diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysLtTbigintTbigintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysLtTbigintTbigintPhysicalFunction.cpp index 6c704c5f0b..9eee745294 100644 --- a/nes-physical-operators/src/Functions/Meos/AlwaysLtTbigintTbigintPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/AlwaysLtTbigintTbigintPhysicalFunction.cpp @@ -67,7 +67,7 @@ VarVal AlwaysLtTbigintTbigintPhysicalFunction::execute(const Record& record, Are if (!temp1) return 0.0; Temporal* temp2 = tbigint_in(wkt2.c_str()); if (!temp2) { free(temp1); return 0.0; } - int r = always_lt_tbigint_tbigint(temp1, temp2); + int r = always_lt_temporal_temporal(temp1, temp2); free(temp1); free(temp2); return static_cast(r); diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysLtTintTintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysLtTintTintPhysicalFunction.cpp index 5649cde140..38f0a04581 100644 --- a/nes-physical-operators/src/Functions/Meos/AlwaysLtTintTintPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/AlwaysLtTintTintPhysicalFunction.cpp @@ -67,7 +67,7 @@ VarVal AlwaysLtTintTintPhysicalFunction::execute(const Record& record, ArenaRef& if (!temp1) return 0.0; Temporal* temp2 = tint_in(wkt2.c_str()); if (!temp2) { free(temp1); return 0.0; } - int r = always_lt_tint_tint(temp1, temp2); + int r = always_lt_temporal_temporal(temp1, temp2); free(temp1); free(temp2); return static_cast(r); diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysNeTbigintTbigintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysNeTbigintTbigintPhysicalFunction.cpp index 1ea159194d..23b78e2cf3 100644 --- a/nes-physical-operators/src/Functions/Meos/AlwaysNeTbigintTbigintPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/AlwaysNeTbigintTbigintPhysicalFunction.cpp @@ -67,7 +67,7 @@ VarVal AlwaysNeTbigintTbigintPhysicalFunction::execute(const Record& record, Are if (!temp1) return 0.0; Temporal* temp2 = tbigint_in(wkt2.c_str()); if (!temp2) { free(temp1); return 0.0; } - int r = always_ne_tbigint_tbigint(temp1, temp2); + int r = always_ne_temporal_temporal(temp1, temp2); free(temp1); free(temp2); return static_cast(r); diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysNeTintTintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysNeTintTintPhysicalFunction.cpp index 8ca2ce0681..470fcd6322 100644 --- a/nes-physical-operators/src/Functions/Meos/AlwaysNeTintTintPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/AlwaysNeTintTintPhysicalFunction.cpp @@ -67,7 +67,7 @@ VarVal AlwaysNeTintTintPhysicalFunction::execute(const Record& record, ArenaRef& if (!temp1) return 0.0; Temporal* temp2 = tint_in(wkt2.c_str()); if (!temp2) { free(temp1); return 0.0; } - int r = always_ne_tint_tint(temp1, temp2); + int r = always_ne_temporal_temporal(temp1, temp2); free(temp1); free(temp2); return static_cast(r); diff --git a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt index 1329e88057..5224235981 100644 --- a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt @@ -244,4 +244,5 @@ add_plugin(TltFloatTfloat PhysicalFunction nes-physical-operators TltFloatTfloat add_plugin(TltTintInt PhysicalFunction nes-physical-operators TltTintIntPhysicalFunction.cpp) add_plugin(TltIntTint PhysicalFunction nes-physical-operators TltIntTintPhysicalFunction.cpp) add_plugin(TltTemporalTemporal PhysicalFunction nes-physical-operators TltTemporalTemporalPhysicalFunction.cpp) +add_plugin(TboolToTint PhysicalFunction nes-physical-operators TboolToTintPhysicalFunction.cpp) endif() diff --git a/nes-physical-operators/src/Functions/Meos/EverEqTbigintTbigintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverEqTbigintTbigintPhysicalFunction.cpp index 6c74c63431..1af1b3e958 100644 --- a/nes-physical-operators/src/Functions/Meos/EverEqTbigintTbigintPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/EverEqTbigintTbigintPhysicalFunction.cpp @@ -67,7 +67,7 @@ VarVal EverEqTbigintTbigintPhysicalFunction::execute(const Record& record, Arena if (!temp1) return 0.0; Temporal* temp2 = tbigint_in(wkt2.c_str()); if (!temp2) { free(temp1); return 0.0; } - int r = ever_eq_tbigint_tbigint(temp1, temp2); + int r = ever_eq_temporal_temporal(temp1, temp2); free(temp1); free(temp2); return static_cast(r); diff --git a/nes-physical-operators/src/Functions/Meos/EverEqTintTintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverEqTintTintPhysicalFunction.cpp index caa3038238..238f23e8fb 100644 --- a/nes-physical-operators/src/Functions/Meos/EverEqTintTintPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/EverEqTintTintPhysicalFunction.cpp @@ -67,7 +67,7 @@ VarVal EverEqTintTintPhysicalFunction::execute(const Record& record, ArenaRef& a if (!temp1) return 0.0; Temporal* temp2 = tint_in(wkt2.c_str()); if (!temp2) { free(temp1); return 0.0; } - int r = ever_eq_tint_tint(temp1, temp2); + int r = ever_eq_temporal_temporal(temp1, temp2); free(temp1); free(temp2); return static_cast(r); diff --git a/nes-physical-operators/src/Functions/Meos/EverGeTbigintTbigintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverGeTbigintTbigintPhysicalFunction.cpp index 09f5309356..5135f72e3a 100644 --- a/nes-physical-operators/src/Functions/Meos/EverGeTbigintTbigintPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/EverGeTbigintTbigintPhysicalFunction.cpp @@ -67,7 +67,7 @@ VarVal EverGeTbigintTbigintPhysicalFunction::execute(const Record& record, Arena if (!temp1) return 0.0; Temporal* temp2 = tbigint_in(wkt2.c_str()); if (!temp2) { free(temp1); return 0.0; } - int r = ever_ge_tbigint_tbigint(temp1, temp2); + int r = ever_ge_temporal_temporal(temp1, temp2); free(temp1); free(temp2); return static_cast(r); diff --git a/nes-physical-operators/src/Functions/Meos/EverGeTintTintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverGeTintTintPhysicalFunction.cpp index 7a82536015..1f499cff83 100644 --- a/nes-physical-operators/src/Functions/Meos/EverGeTintTintPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/EverGeTintTintPhysicalFunction.cpp @@ -67,7 +67,7 @@ VarVal EverGeTintTintPhysicalFunction::execute(const Record& record, ArenaRef& a if (!temp1) return 0.0; Temporal* temp2 = tint_in(wkt2.c_str()); if (!temp2) { free(temp1); return 0.0; } - int r = ever_ge_tint_tint(temp1, temp2); + int r = ever_ge_temporal_temporal(temp1, temp2); free(temp1); free(temp2); return static_cast(r); diff --git a/nes-physical-operators/src/Functions/Meos/EverGtTbigintTbigintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverGtTbigintTbigintPhysicalFunction.cpp index 93d5cb0a0b..929d78d591 100644 --- a/nes-physical-operators/src/Functions/Meos/EverGtTbigintTbigintPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/EverGtTbigintTbigintPhysicalFunction.cpp @@ -67,7 +67,7 @@ VarVal EverGtTbigintTbigintPhysicalFunction::execute(const Record& record, Arena if (!temp1) return 0.0; Temporal* temp2 = tbigint_in(wkt2.c_str()); if (!temp2) { free(temp1); return 0.0; } - int r = ever_gt_tbigint_tbigint(temp1, temp2); + int r = ever_gt_temporal_temporal(temp1, temp2); free(temp1); free(temp2); return static_cast(r); diff --git a/nes-physical-operators/src/Functions/Meos/EverGtTintTintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverGtTintTintPhysicalFunction.cpp index b5a76c9e8d..778f6fdd73 100644 --- a/nes-physical-operators/src/Functions/Meos/EverGtTintTintPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/EverGtTintTintPhysicalFunction.cpp @@ -67,7 +67,7 @@ VarVal EverGtTintTintPhysicalFunction::execute(const Record& record, ArenaRef& a if (!temp1) return 0.0; Temporal* temp2 = tint_in(wkt2.c_str()); if (!temp2) { free(temp1); return 0.0; } - int r = ever_gt_tint_tint(temp1, temp2); + int r = ever_gt_temporal_temporal(temp1, temp2); free(temp1); free(temp2); return static_cast(r); diff --git a/nes-physical-operators/src/Functions/Meos/EverLeTbigintTbigintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverLeTbigintTbigintPhysicalFunction.cpp index f0492bd755..96d137f209 100644 --- a/nes-physical-operators/src/Functions/Meos/EverLeTbigintTbigintPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/EverLeTbigintTbigintPhysicalFunction.cpp @@ -67,7 +67,7 @@ VarVal EverLeTbigintTbigintPhysicalFunction::execute(const Record& record, Arena if (!temp1) return 0.0; Temporal* temp2 = tbigint_in(wkt2.c_str()); if (!temp2) { free(temp1); return 0.0; } - int r = ever_le_tbigint_tbigint(temp1, temp2); + int r = ever_le_temporal_temporal(temp1, temp2); free(temp1); free(temp2); return static_cast(r); diff --git a/nes-physical-operators/src/Functions/Meos/EverLeTintTintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverLeTintTintPhysicalFunction.cpp index 26f58ed26b..41e17ee5bb 100644 --- a/nes-physical-operators/src/Functions/Meos/EverLeTintTintPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/EverLeTintTintPhysicalFunction.cpp @@ -67,7 +67,7 @@ VarVal EverLeTintTintPhysicalFunction::execute(const Record& record, ArenaRef& a if (!temp1) return 0.0; Temporal* temp2 = tint_in(wkt2.c_str()); if (!temp2) { free(temp1); return 0.0; } - int r = ever_le_tint_tint(temp1, temp2); + int r = ever_le_temporal_temporal(temp1, temp2); free(temp1); free(temp2); return static_cast(r); diff --git a/nes-physical-operators/src/Functions/Meos/EverLtTbigintTbigintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverLtTbigintTbigintPhysicalFunction.cpp index 31e6ac9ee5..99866fcec8 100644 --- a/nes-physical-operators/src/Functions/Meos/EverLtTbigintTbigintPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/EverLtTbigintTbigintPhysicalFunction.cpp @@ -67,7 +67,7 @@ VarVal EverLtTbigintTbigintPhysicalFunction::execute(const Record& record, Arena if (!temp1) return 0.0; Temporal* temp2 = tbigint_in(wkt2.c_str()); if (!temp2) { free(temp1); return 0.0; } - int r = ever_lt_tbigint_tbigint(temp1, temp2); + int r = ever_lt_temporal_temporal(temp1, temp2); free(temp1); free(temp2); return static_cast(r); diff --git a/nes-physical-operators/src/Functions/Meos/EverLtTintTintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverLtTintTintPhysicalFunction.cpp index 584074e9f2..372f292528 100644 --- a/nes-physical-operators/src/Functions/Meos/EverLtTintTintPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/EverLtTintTintPhysicalFunction.cpp @@ -67,7 +67,7 @@ VarVal EverLtTintTintPhysicalFunction::execute(const Record& record, ArenaRef& a if (!temp1) return 0.0; Temporal* temp2 = tint_in(wkt2.c_str()); if (!temp2) { free(temp1); return 0.0; } - int r = ever_lt_tint_tint(temp1, temp2); + int r = ever_lt_temporal_temporal(temp1, temp2); free(temp1); free(temp2); return static_cast(r); diff --git a/nes-physical-operators/src/Functions/Meos/EverNeTbigintTbigintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverNeTbigintTbigintPhysicalFunction.cpp index 1709c60c40..b14946f449 100644 --- a/nes-physical-operators/src/Functions/Meos/EverNeTbigintTbigintPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/EverNeTbigintTbigintPhysicalFunction.cpp @@ -67,7 +67,7 @@ VarVal EverNeTbigintTbigintPhysicalFunction::execute(const Record& record, Arena if (!temp1) return 0.0; Temporal* temp2 = tbigint_in(wkt2.c_str()); if (!temp2) { free(temp1); return 0.0; } - int r = ever_ne_tbigint_tbigint(temp1, temp2); + int r = ever_ne_temporal_temporal(temp1, temp2); free(temp1); free(temp2); return static_cast(r); diff --git a/nes-physical-operators/src/Functions/Meos/EverNeTintTintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverNeTintTintPhysicalFunction.cpp index 168fc072c8..ecb0836662 100644 --- a/nes-physical-operators/src/Functions/Meos/EverNeTintTintPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/EverNeTintTintPhysicalFunction.cpp @@ -67,7 +67,7 @@ VarVal EverNeTintTintPhysicalFunction::execute(const Record& record, ArenaRef& a if (!temp1) return 0.0; Temporal* temp2 = tint_in(wkt2.c_str()); if (!temp2) { free(temp1); return 0.0; } - int r = ever_ne_tint_tint(temp1, temp2); + int r = ever_ne_temporal_temporal(temp1, temp2); free(temp1); free(temp2); return static_cast(r); diff --git a/nes-physical-operators/src/Functions/Meos/TboolToTintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TboolToTintPhysicalFunction.cpp new file mode 100644 index 0000000000..7f20b301ad --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TboolToTintPhysicalFunction.cpp @@ -0,0 +1,88 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +TboolToTintPhysicalFunction::TboolToTintPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(2); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal TboolToTintPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto ts = parameterValues[1].cast>(); + + const auto result = nautilus::invoke( + +[](double v, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = fmt::format("{}@{}", (v != 0.0 ? "t" : "f"), ts_str); + Temporal* temp = tbool_in(wkt.c_str()); + if (!temp) return 0.0; + Temporal* res = tbool_to_tint(temp); + free(temp); + if (!res) return 0.0; + int r = tint_start_value(res); + free(res); + return static_cast(r); + } catch (const std::exception&) { return 0.0; } + }, + value, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTboolToTintPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 2, + "TboolToTintPhysicalFunction requires 2 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + return TboolToTintPhysicalFunction(std::move(arg0), std::move(arg1)); +} + +} // namespace NES diff --git a/nes-sql-parser/AntlrSQL.g4 b/nes-sql-parser/AntlrSQL.g4 index cb28c14e3f..ce613ef640 100644 --- a/nes-sql-parser/AntlrSQL.g4 +++ b/nes-sql-parser/AntlrSQL.g4 @@ -295,7 +295,7 @@ timeUnit: MS timestampParameter: name=identifier; -functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL; +functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT; sinkClause: INTO sink (',' sink)*; @@ -715,6 +715,7 @@ TLT_FLOAT_TFLOAT: 'TLT_FLOAT_TFLOAT' | 'tlt_float_tfloat'; TLT_TINT_INT: 'TLT_TINT_INT' | 'tlt_tint_int'; TLT_INT_TINT: 'TLT_INT_TINT' | 'tlt_int_tint'; TLT_TEMPORAL_TEMPORAL: 'TLT_TEMPORAL_TEMPORAL' | 'tlt_temporal_temporal'; +TBOOL_TO_TINT: 'TBOOL_TO_TINT' | 'tbool_to_tint'; WATERMARK: 'WATERMARK' | 'watermark'; OFFSET: 'OFFSET' | 'offset'; LOCALHOST: 'LOCALHOST' | 'localhost'; diff --git a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp index f9544a8eae..fc61ea38d2 100644 --- a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp +++ b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp @@ -296,6 +296,7 @@ #include #include #include +#include #include #include #include @@ -7575,6 +7576,32 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont }} break; /* END CODEGEN PARSER GLUE: TLT_TEMPORAL_TEMPORAL */ + /* BEGIN CODEGEN PARSER GLUE: TBOOL_TO_TINT */ + case AntlrSQLLexer::TBOOL_TO_TINT: + { + const auto argCount = context->expression().size(); + if (argCount != 2) + throw InvalidQuerySyntax("TBOOL_TO_TINT requires exactly 2 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + helpers.top().functionBuilder.emplace_back(TboolToTintLogicalFunction(a0, a1)); + } + break; + /* END CODEGEN PARSER GLUE: TBOOL_TO_TINT */ /* BEGIN CODEGEN PARSER GLUE: ALWAYS_EQ_TFLOAT_FLOAT */ case AntlrSQLLexer::ALWAYS_EQ_TFLOAT_FLOAT: { From 31d073e19b8c2c8a0f71fe56e688505ba1422b3b Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Sun, 14 Jun 2026 06:01:40 +0200 Subject: [PATCH 42/96] feat(meos): add ttext scalar comparison NES operators (W93) Adds 28 per-event NES scalar operators covering ever/always/teq/tne comparisons between a single-instant ttext and a text literal, in both argument orders: EVER_{EQ,NE,GE,GT,LE,LT}_{TTEXT_TEXT,TEXT_TTEXT}, ALWAYS_{EQ,NE,GE,GT,LE,LT}_{TTEXT_TEXT,TEXT_TTEXT}, TEQ/TNE_{TTEXT_TEXT,TEXT_TTEXT}. Each operator takes (textValue:VARCHAR, textRef:VARCHAR, ts:UINT64), builds a single-instant ttext via ttext_in and converts the reference string to a text datum via cstring_to_text, then delegates to the corresponding MEOS ever_*/always_*/teq_*/tne_* kernel. ever/always variants return FLOAT64 1.0/0.0 directly; teq/tne extract the tbool result via tbool_start_value. Wired across logical/physical CMakeLists, AntlrSQL.g4 functionName rule and lexer section, and AntlrSQLQueryPlanCreator.cpp. --- .../Meos/AlwaysEqTextTtextLogicalFunction.hpp | 43 + .../Meos/AlwaysEqTtextTextLogicalFunction.hpp | 43 + .../Meos/AlwaysGeTextTtextLogicalFunction.hpp | 43 + .../Meos/AlwaysGeTtextTextLogicalFunction.hpp | 43 + .../Meos/AlwaysGtTextTtextLogicalFunction.hpp | 43 + .../Meos/AlwaysGtTtextTextLogicalFunction.hpp | 43 + .../Meos/AlwaysLeTextTtextLogicalFunction.hpp | 43 + .../Meos/AlwaysLeTtextTextLogicalFunction.hpp | 43 + .../Meos/AlwaysLtTextTtextLogicalFunction.hpp | 43 + .../Meos/AlwaysLtTtextTextLogicalFunction.hpp | 43 + .../Meos/AlwaysNeTextTtextLogicalFunction.hpp | 43 + .../Meos/AlwaysNeTtextTextLogicalFunction.hpp | 43 + .../Meos/EverEqTextTtextLogicalFunction.hpp | 43 + .../Meos/EverEqTtextTextLogicalFunction.hpp | 43 + .../Meos/EverGeTextTtextLogicalFunction.hpp | 43 + .../Meos/EverGeTtextTextLogicalFunction.hpp | 43 + .../Meos/EverGtTextTtextLogicalFunction.hpp | 43 + .../Meos/EverGtTtextTextLogicalFunction.hpp | 43 + .../Meos/EverLeTextTtextLogicalFunction.hpp | 43 + .../Meos/EverLeTtextTextLogicalFunction.hpp | 43 + .../Meos/EverLtTextTtextLogicalFunction.hpp | 43 + .../Meos/EverLtTtextTextLogicalFunction.hpp | 43 + .../Meos/EverNeTextTtextLogicalFunction.hpp | 43 + .../Meos/EverNeTtextTextLogicalFunction.hpp | 43 + .../Meos/TeqTextTtextLogicalFunction.hpp | 43 + .../Meos/TeqTtextTextLogicalFunction.hpp | 43 + .../Meos/TneTextTtextLogicalFunction.hpp | 43 + .../Meos/TneTtextTextLogicalFunction.hpp | 43 + .../Meos/AlwaysEqTextTtextLogicalFunction.cpp | 93 ++ .../Meos/AlwaysEqTtextTextLogicalFunction.cpp | 93 ++ .../Meos/AlwaysGeTextTtextLogicalFunction.cpp | 93 ++ .../Meos/AlwaysGeTtextTextLogicalFunction.cpp | 93 ++ .../Meos/AlwaysGtTextTtextLogicalFunction.cpp | 93 ++ .../Meos/AlwaysGtTtextTextLogicalFunction.cpp | 93 ++ .../Meos/AlwaysLeTextTtextLogicalFunction.cpp | 93 ++ .../Meos/AlwaysLeTtextTextLogicalFunction.cpp | 93 ++ .../Meos/AlwaysLtTextTtextLogicalFunction.cpp | 93 ++ .../Meos/AlwaysLtTtextTextLogicalFunction.cpp | 93 ++ .../Meos/AlwaysNeTextTtextLogicalFunction.cpp | 93 ++ .../Meos/AlwaysNeTtextTextLogicalFunction.cpp | 93 ++ .../src/Functions/Meos/CMakeLists.txt | 28 + .../Meos/EverEqTextTtextLogicalFunction.cpp | 93 ++ .../Meos/EverEqTtextTextLogicalFunction.cpp | 93 ++ .../Meos/EverGeTextTtextLogicalFunction.cpp | 93 ++ .../Meos/EverGeTtextTextLogicalFunction.cpp | 93 ++ .../Meos/EverGtTextTtextLogicalFunction.cpp | 93 ++ .../Meos/EverGtTtextTextLogicalFunction.cpp | 93 ++ .../Meos/EverLeTextTtextLogicalFunction.cpp | 93 ++ .../Meos/EverLeTtextTextLogicalFunction.cpp | 93 ++ .../Meos/EverLtTextTtextLogicalFunction.cpp | 93 ++ .../Meos/EverLtTtextTextLogicalFunction.cpp | 93 ++ .../Meos/EverNeTextTtextLogicalFunction.cpp | 93 ++ .../Meos/EverNeTtextTextLogicalFunction.cpp | 93 ++ .../Meos/TeqTextTtextLogicalFunction.cpp | 93 ++ .../Meos/TeqTtextTextLogicalFunction.cpp | 93 ++ .../Meos/TneTextTtextLogicalFunction.cpp | 93 ++ .../Meos/TneTtextTextLogicalFunction.cpp | 93 ++ .../AlwaysEqTextTtextPhysicalFunction.hpp | 36 + .../AlwaysEqTtextTextPhysicalFunction.hpp | 36 + .../AlwaysGeTextTtextPhysicalFunction.hpp | 36 + .../AlwaysGeTtextTextPhysicalFunction.hpp | 36 + .../AlwaysGtTextTtextPhysicalFunction.hpp | 36 + .../AlwaysGtTtextTextPhysicalFunction.hpp | 36 + .../AlwaysLeTextTtextPhysicalFunction.hpp | 36 + .../AlwaysLeTtextTextPhysicalFunction.hpp | 36 + .../AlwaysLtTextTtextPhysicalFunction.hpp | 36 + .../AlwaysLtTtextTextPhysicalFunction.hpp | 36 + .../AlwaysNeTextTtextPhysicalFunction.hpp | 36 + .../AlwaysNeTtextTextPhysicalFunction.hpp | 36 + .../Meos/EverEqTextTtextPhysicalFunction.hpp | 36 + .../Meos/EverEqTtextTextPhysicalFunction.hpp | 36 + .../Meos/EverGeTextTtextPhysicalFunction.hpp | 36 + .../Meos/EverGeTtextTextPhysicalFunction.hpp | 36 + .../Meos/EverGtTextTtextPhysicalFunction.hpp | 36 + .../Meos/EverGtTtextTextPhysicalFunction.hpp | 36 + .../Meos/EverLeTextTtextPhysicalFunction.hpp | 36 + .../Meos/EverLeTtextTextPhysicalFunction.hpp | 36 + .../Meos/EverLtTextTtextPhysicalFunction.hpp | 36 + .../Meos/EverLtTtextTextPhysicalFunction.hpp | 36 + .../Meos/EverNeTextTtextPhysicalFunction.hpp | 36 + .../Meos/EverNeTtextTextPhysicalFunction.hpp | 36 + .../Meos/TeqTextTtextPhysicalFunction.hpp | 36 + .../Meos/TeqTtextTextPhysicalFunction.hpp | 36 + .../Meos/TneTextTtextPhysicalFunction.hpp | 36 + .../Meos/TneTtextTextPhysicalFunction.hpp | 36 + .../AlwaysEqTextTtextPhysicalFunction.cpp | 90 ++ .../AlwaysEqTtextTextPhysicalFunction.cpp | 90 ++ .../AlwaysGeTextTtextPhysicalFunction.cpp | 90 ++ .../AlwaysGeTtextTextPhysicalFunction.cpp | 90 ++ .../AlwaysGtTextTtextPhysicalFunction.cpp | 90 ++ .../AlwaysGtTtextTextPhysicalFunction.cpp | 90 ++ .../AlwaysLeTextTtextPhysicalFunction.cpp | 90 ++ .../AlwaysLeTtextTextPhysicalFunction.cpp | 90 ++ .../AlwaysLtTextTtextPhysicalFunction.cpp | 90 ++ .../AlwaysLtTtextTextPhysicalFunction.cpp | 90 ++ .../AlwaysNeTextTtextPhysicalFunction.cpp | 90 ++ .../AlwaysNeTtextTextPhysicalFunction.cpp | 90 ++ .../src/Functions/Meos/CMakeLists.txt | 28 + .../Meos/EverEqTextTtextPhysicalFunction.cpp | 90 ++ .../Meos/EverEqTtextTextPhysicalFunction.cpp | 90 ++ .../Meos/EverGeTextTtextPhysicalFunction.cpp | 90 ++ .../Meos/EverGeTtextTextPhysicalFunction.cpp | 90 ++ .../Meos/EverGtTextTtextPhysicalFunction.cpp | 90 ++ .../Meos/EverGtTtextTextPhysicalFunction.cpp | 90 ++ .../Meos/EverLeTextTtextPhysicalFunction.cpp | 90 ++ .../Meos/EverLeTtextTextPhysicalFunction.cpp | 90 ++ .../Meos/EverLtTextTtextPhysicalFunction.cpp | 90 ++ .../Meos/EverLtTtextTextPhysicalFunction.cpp | 90 ++ .../Meos/EverNeTextTtextPhysicalFunction.cpp | 90 ++ .../Meos/EverNeTtextTextPhysicalFunction.cpp | 90 ++ .../Meos/TeqTextTtextPhysicalFunction.cpp | 93 ++ .../Meos/TeqTtextTextPhysicalFunction.cpp | 93 ++ .../Meos/TneTextTtextPhysicalFunction.cpp | 93 ++ .../Meos/TneTtextTextPhysicalFunction.cpp | 93 ++ nes-sql-parser/AntlrSQL.g4 | 30 +- .../src/AntlrSQLQueryPlanCreator.cpp | 840 ++++++++++++++++++ 116 files changed, 8273 insertions(+), 1 deletion(-) create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysEqTextTtextLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysEqTtextTextLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysGeTextTtextLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysGeTtextTextLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysGtTextTtextLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysGtTtextTextLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysLeTextTtextLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysLeTtextTextLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysLtTextTtextLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysLtTtextTextLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysNeTextTtextLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysNeTtextTextLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverEqTextTtextLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverEqTtextTextLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverGeTextTtextLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverGeTtextTextLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverGtTextTtextLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverGtTtextTextLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverLeTextTtextLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverLeTtextTextLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverLtTextTtextLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverLtTtextTextLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverNeTextTtextLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverNeTtextTextLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TeqTextTtextLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TeqTtextTextLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TneTextTtextLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TneTtextTextLogicalFunction.hpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysEqTextTtextLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysEqTtextTextLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysGeTextTtextLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysGeTtextTextLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysGtTextTtextLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysGtTtextTextLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysLeTextTtextLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysLeTtextTextLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysLtTextTtextLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysLtTtextTextLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysNeTextTtextLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysNeTtextTextLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverEqTextTtextLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverEqTtextTextLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverGeTextTtextLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverGeTtextTextLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverGtTextTtextLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverGtTtextTextLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverLeTextTtextLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverLeTtextTextLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverLtTextTtextLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverLtTtextTextLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverNeTextTtextLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverNeTtextTextLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TeqTextTtextLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TeqTtextTextLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TneTextTtextLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TneTtextTextLogicalFunction.cpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysEqTextTtextPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysEqTtextTextPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysGeTextTtextPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysGeTtextTextPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysGtTextTtextPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysGtTtextTextPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysLeTextTtextPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysLeTtextTextPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysLtTextTtextPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysLtTtextTextPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysNeTextTtextPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysNeTtextTextPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverEqTextTtextPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverEqTtextTextPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverGeTextTtextPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverGeTtextTextPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverGtTextTtextPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverGtTtextTextPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverLeTextTtextPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverLeTtextTextPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverLtTextTtextPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverLtTtextTextPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverNeTextTtextPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverNeTtextTextPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TeqTextTtextPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TeqTtextTextPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TneTextTtextPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TneTtextTextPhysicalFunction.hpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysEqTextTtextPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysEqTtextTextPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysGeTextTtextPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysGeTtextTextPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysGtTextTtextPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysGtTtextTextPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysLeTextTtextPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysLeTtextTextPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysLtTextTtextPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysLtTtextTextPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysNeTextTtextPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysNeTtextTextPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverEqTextTtextPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverEqTtextTextPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverGeTextTtextPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverGeTtextTextPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverGtTextTtextPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverGtTtextTextPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverLeTextTtextPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverLeTtextTextPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverLtTextTtextPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverLtTtextTextPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverNeTextTtextPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverNeTtextTextPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TeqTextTtextPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TeqTtextTextPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TneTextTtextPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TneTtextTextPhysicalFunction.cpp diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysEqTextTtextLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysEqTextTtextLogicalFunction.hpp new file mode 100644 index 0000000000..17ecec6cf6 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysEqTextTtextLogicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once +#include +#include +#include + +namespace NES { + +class AlwaysEqTextTtextLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysEqTextTtext"; + + AlwaysEqTextTtextLogicalFunction(LogicalFunction value, LogicalFunction ref, LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType&) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector&) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept&) const override; + std::string explain(ExplainVerbosity) const override; + LogicalFunction withInferredDataType(const Schema&) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysEqTtextTextLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysEqTtextTextLogicalFunction.hpp new file mode 100644 index 0000000000..819dc5fcba --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysEqTtextTextLogicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once +#include +#include +#include + +namespace NES { + +class AlwaysEqTtextTextLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysEqTtextText"; + + AlwaysEqTtextTextLogicalFunction(LogicalFunction value, LogicalFunction ref, LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType&) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector&) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept&) const override; + std::string explain(ExplainVerbosity) const override; + LogicalFunction withInferredDataType(const Schema&) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysGeTextTtextLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysGeTextTtextLogicalFunction.hpp new file mode 100644 index 0000000000..81b80ff5bb --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysGeTextTtextLogicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once +#include +#include +#include + +namespace NES { + +class AlwaysGeTextTtextLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysGeTextTtext"; + + AlwaysGeTextTtextLogicalFunction(LogicalFunction value, LogicalFunction ref, LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType&) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector&) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept&) const override; + std::string explain(ExplainVerbosity) const override; + LogicalFunction withInferredDataType(const Schema&) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysGeTtextTextLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysGeTtextTextLogicalFunction.hpp new file mode 100644 index 0000000000..532d087309 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysGeTtextTextLogicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once +#include +#include +#include + +namespace NES { + +class AlwaysGeTtextTextLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysGeTtextText"; + + AlwaysGeTtextTextLogicalFunction(LogicalFunction value, LogicalFunction ref, LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType&) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector&) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept&) const override; + std::string explain(ExplainVerbosity) const override; + LogicalFunction withInferredDataType(const Schema&) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysGtTextTtextLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysGtTextTtextLogicalFunction.hpp new file mode 100644 index 0000000000..223bf4e6e0 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysGtTextTtextLogicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once +#include +#include +#include + +namespace NES { + +class AlwaysGtTextTtextLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysGtTextTtext"; + + AlwaysGtTextTtextLogicalFunction(LogicalFunction value, LogicalFunction ref, LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType&) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector&) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept&) const override; + std::string explain(ExplainVerbosity) const override; + LogicalFunction withInferredDataType(const Schema&) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysGtTtextTextLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysGtTtextTextLogicalFunction.hpp new file mode 100644 index 0000000000..e66c6ecbe4 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysGtTtextTextLogicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once +#include +#include +#include + +namespace NES { + +class AlwaysGtTtextTextLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysGtTtextText"; + + AlwaysGtTtextTextLogicalFunction(LogicalFunction value, LogicalFunction ref, LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType&) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector&) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept&) const override; + std::string explain(ExplainVerbosity) const override; + LogicalFunction withInferredDataType(const Schema&) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysLeTextTtextLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysLeTextTtextLogicalFunction.hpp new file mode 100644 index 0000000000..df76e16f74 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysLeTextTtextLogicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once +#include +#include +#include + +namespace NES { + +class AlwaysLeTextTtextLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysLeTextTtext"; + + AlwaysLeTextTtextLogicalFunction(LogicalFunction value, LogicalFunction ref, LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType&) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector&) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept&) const override; + std::string explain(ExplainVerbosity) const override; + LogicalFunction withInferredDataType(const Schema&) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysLeTtextTextLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysLeTtextTextLogicalFunction.hpp new file mode 100644 index 0000000000..57dc16fb76 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysLeTtextTextLogicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once +#include +#include +#include + +namespace NES { + +class AlwaysLeTtextTextLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysLeTtextText"; + + AlwaysLeTtextTextLogicalFunction(LogicalFunction value, LogicalFunction ref, LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType&) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector&) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept&) const override; + std::string explain(ExplainVerbosity) const override; + LogicalFunction withInferredDataType(const Schema&) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysLtTextTtextLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysLtTextTtextLogicalFunction.hpp new file mode 100644 index 0000000000..2378a5f910 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysLtTextTtextLogicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once +#include +#include +#include + +namespace NES { + +class AlwaysLtTextTtextLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysLtTextTtext"; + + AlwaysLtTextTtextLogicalFunction(LogicalFunction value, LogicalFunction ref, LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType&) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector&) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept&) const override; + std::string explain(ExplainVerbosity) const override; + LogicalFunction withInferredDataType(const Schema&) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysLtTtextTextLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysLtTtextTextLogicalFunction.hpp new file mode 100644 index 0000000000..7a7fb42d99 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysLtTtextTextLogicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once +#include +#include +#include + +namespace NES { + +class AlwaysLtTtextTextLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysLtTtextText"; + + AlwaysLtTtextTextLogicalFunction(LogicalFunction value, LogicalFunction ref, LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType&) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector&) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept&) const override; + std::string explain(ExplainVerbosity) const override; + LogicalFunction withInferredDataType(const Schema&) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysNeTextTtextLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysNeTextTtextLogicalFunction.hpp new file mode 100644 index 0000000000..2369e43e97 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysNeTextTtextLogicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once +#include +#include +#include + +namespace NES { + +class AlwaysNeTextTtextLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysNeTextTtext"; + + AlwaysNeTextTtextLogicalFunction(LogicalFunction value, LogicalFunction ref, LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType&) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector&) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept&) const override; + std::string explain(ExplainVerbosity) const override; + LogicalFunction withInferredDataType(const Schema&) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysNeTtextTextLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysNeTtextTextLogicalFunction.hpp new file mode 100644 index 0000000000..8ed92a09ab --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysNeTtextTextLogicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once +#include +#include +#include + +namespace NES { + +class AlwaysNeTtextTextLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysNeTtextText"; + + AlwaysNeTtextTextLogicalFunction(LogicalFunction value, LogicalFunction ref, LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType&) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector&) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept&) const override; + std::string explain(ExplainVerbosity) const override; + LogicalFunction withInferredDataType(const Schema&) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverEqTextTtextLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverEqTextTtextLogicalFunction.hpp new file mode 100644 index 0000000000..f473cb3336 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverEqTextTtextLogicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once +#include +#include +#include + +namespace NES { + +class EverEqTextTtextLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverEqTextTtext"; + + EverEqTextTtextLogicalFunction(LogicalFunction value, LogicalFunction ref, LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType&) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector&) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept&) const override; + std::string explain(ExplainVerbosity) const override; + LogicalFunction withInferredDataType(const Schema&) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverEqTtextTextLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverEqTtextTextLogicalFunction.hpp new file mode 100644 index 0000000000..dbdcf2a10d --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverEqTtextTextLogicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once +#include +#include +#include + +namespace NES { + +class EverEqTtextTextLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverEqTtextText"; + + EverEqTtextTextLogicalFunction(LogicalFunction value, LogicalFunction ref, LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType&) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector&) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept&) const override; + std::string explain(ExplainVerbosity) const override; + LogicalFunction withInferredDataType(const Schema&) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverGeTextTtextLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverGeTextTtextLogicalFunction.hpp new file mode 100644 index 0000000000..0f53d4231a --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverGeTextTtextLogicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once +#include +#include +#include + +namespace NES { + +class EverGeTextTtextLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverGeTextTtext"; + + EverGeTextTtextLogicalFunction(LogicalFunction value, LogicalFunction ref, LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType&) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector&) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept&) const override; + std::string explain(ExplainVerbosity) const override; + LogicalFunction withInferredDataType(const Schema&) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverGeTtextTextLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverGeTtextTextLogicalFunction.hpp new file mode 100644 index 0000000000..6594911fef --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverGeTtextTextLogicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once +#include +#include +#include + +namespace NES { + +class EverGeTtextTextLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverGeTtextText"; + + EverGeTtextTextLogicalFunction(LogicalFunction value, LogicalFunction ref, LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType&) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector&) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept&) const override; + std::string explain(ExplainVerbosity) const override; + LogicalFunction withInferredDataType(const Schema&) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverGtTextTtextLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverGtTextTtextLogicalFunction.hpp new file mode 100644 index 0000000000..4710eee212 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverGtTextTtextLogicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once +#include +#include +#include + +namespace NES { + +class EverGtTextTtextLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverGtTextTtext"; + + EverGtTextTtextLogicalFunction(LogicalFunction value, LogicalFunction ref, LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType&) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector&) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept&) const override; + std::string explain(ExplainVerbosity) const override; + LogicalFunction withInferredDataType(const Schema&) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverGtTtextTextLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverGtTtextTextLogicalFunction.hpp new file mode 100644 index 0000000000..c44ef057f7 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverGtTtextTextLogicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once +#include +#include +#include + +namespace NES { + +class EverGtTtextTextLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverGtTtextText"; + + EverGtTtextTextLogicalFunction(LogicalFunction value, LogicalFunction ref, LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType&) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector&) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept&) const override; + std::string explain(ExplainVerbosity) const override; + LogicalFunction withInferredDataType(const Schema&) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverLeTextTtextLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverLeTextTtextLogicalFunction.hpp new file mode 100644 index 0000000000..4a1757c7be --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverLeTextTtextLogicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once +#include +#include +#include + +namespace NES { + +class EverLeTextTtextLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverLeTextTtext"; + + EverLeTextTtextLogicalFunction(LogicalFunction value, LogicalFunction ref, LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType&) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector&) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept&) const override; + std::string explain(ExplainVerbosity) const override; + LogicalFunction withInferredDataType(const Schema&) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverLeTtextTextLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverLeTtextTextLogicalFunction.hpp new file mode 100644 index 0000000000..9985d77c71 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverLeTtextTextLogicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once +#include +#include +#include + +namespace NES { + +class EverLeTtextTextLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverLeTtextText"; + + EverLeTtextTextLogicalFunction(LogicalFunction value, LogicalFunction ref, LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType&) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector&) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept&) const override; + std::string explain(ExplainVerbosity) const override; + LogicalFunction withInferredDataType(const Schema&) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverLtTextTtextLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverLtTextTtextLogicalFunction.hpp new file mode 100644 index 0000000000..b86921dc37 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverLtTextTtextLogicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once +#include +#include +#include + +namespace NES { + +class EverLtTextTtextLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverLtTextTtext"; + + EverLtTextTtextLogicalFunction(LogicalFunction value, LogicalFunction ref, LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType&) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector&) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept&) const override; + std::string explain(ExplainVerbosity) const override; + LogicalFunction withInferredDataType(const Schema&) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverLtTtextTextLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverLtTtextTextLogicalFunction.hpp new file mode 100644 index 0000000000..56d4d00c4b --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverLtTtextTextLogicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once +#include +#include +#include + +namespace NES { + +class EverLtTtextTextLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverLtTtextText"; + + EverLtTtextTextLogicalFunction(LogicalFunction value, LogicalFunction ref, LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType&) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector&) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept&) const override; + std::string explain(ExplainVerbosity) const override; + LogicalFunction withInferredDataType(const Schema&) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverNeTextTtextLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverNeTextTtextLogicalFunction.hpp new file mode 100644 index 0000000000..c6aec3694b --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverNeTextTtextLogicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once +#include +#include +#include + +namespace NES { + +class EverNeTextTtextLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverNeTextTtext"; + + EverNeTextTtextLogicalFunction(LogicalFunction value, LogicalFunction ref, LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType&) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector&) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept&) const override; + std::string explain(ExplainVerbosity) const override; + LogicalFunction withInferredDataType(const Schema&) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverNeTtextTextLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverNeTtextTextLogicalFunction.hpp new file mode 100644 index 0000000000..243a080cb7 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverNeTtextTextLogicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once +#include +#include +#include + +namespace NES { + +class EverNeTtextTextLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverNeTtextText"; + + EverNeTtextTextLogicalFunction(LogicalFunction value, LogicalFunction ref, LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType&) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector&) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept&) const override; + std::string explain(ExplainVerbosity) const override; + LogicalFunction withInferredDataType(const Schema&) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TeqTextTtextLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TeqTextTtextLogicalFunction.hpp new file mode 100644 index 0000000000..6d5387c671 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TeqTextTtextLogicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once +#include +#include +#include + +namespace NES { + +class TeqTextTtextLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TeqTextTtext"; + + TeqTextTtextLogicalFunction(LogicalFunction value, LogicalFunction ref, LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType&) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector&) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept&) const override; + std::string explain(ExplainVerbosity) const override; + LogicalFunction withInferredDataType(const Schema&) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TeqTtextTextLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TeqTtextTextLogicalFunction.hpp new file mode 100644 index 0000000000..123ba5ed3e --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TeqTtextTextLogicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once +#include +#include +#include + +namespace NES { + +class TeqTtextTextLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TeqTtextText"; + + TeqTtextTextLogicalFunction(LogicalFunction value, LogicalFunction ref, LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType&) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector&) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept&) const override; + std::string explain(ExplainVerbosity) const override; + LogicalFunction withInferredDataType(const Schema&) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TneTextTtextLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TneTextTtextLogicalFunction.hpp new file mode 100644 index 0000000000..493e5126e4 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TneTextTtextLogicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once +#include +#include +#include + +namespace NES { + +class TneTextTtextLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TneTextTtext"; + + TneTextTtextLogicalFunction(LogicalFunction value, LogicalFunction ref, LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType&) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector&) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept&) const override; + std::string explain(ExplainVerbosity) const override; + LogicalFunction withInferredDataType(const Schema&) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TneTtextTextLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TneTtextTextLogicalFunction.hpp new file mode 100644 index 0000000000..bf9813b0e3 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TneTtextTextLogicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once +#include +#include +#include + +namespace NES { + +class TneTtextTextLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TneTtextText"; + + TneTtextTextLogicalFunction(LogicalFunction value, LogicalFunction ref, LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType&) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector&) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept&) const override; + std::string explain(ExplainVerbosity) const override; + LogicalFunction withInferredDataType(const Schema&) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysEqTextTtextLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysEqTextTtextLogicalFunction.cpp new file mode 100644 index 0000000000..7e21a4fe38 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysEqTextTtextLogicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES { + +AlwaysEqTextTtextLogicalFunction::AlwaysEqTextTtextLogicalFunction( + LogicalFunction value, LogicalFunction ref, LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { + parameters = {std::move(value), std::move(ref), std::move(ts)}; +} + +DataType AlwaysEqTextTtextLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysEqTextTtextLogicalFunction::withDataType(const DataType& dt) const { + auto c = *this; c.dataType = dt; return c; +} + +std::vector AlwaysEqTextTtextLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysEqTextTtextLogicalFunction::withChildren(const std::vector& ch) const { + PRECONDITION(ch.size() == 3, "AlwaysEqTextTtext expects 3 params, got {}", ch.size()); + auto c = *this; c.parameters = ch; return c; +} + +std::string_view AlwaysEqTextTtextLogicalFunction::getType() const { return NAME; } + +bool AlwaysEqTextTtextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + const auto* o = dynamic_cast(&rhs); + return o && parameters == o->parameters; +} + +std::string AlwaysEqTextTtextLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("AlwaysEqTextTtext({}, {}, {})", + parameters[0].explain(v), parameters[1].explain(v), parameters[2].explain(v)); +} + +LogicalFunction AlwaysEqTextTtextLogicalFunction::withInferredDataType(const Schema& s) const { + std::vector ch; + ch.reserve(3); + for (auto& p : parameters) ch.push_back(p.withInferredDataType(s)); + auto isStr = [](const DataType& dt) { return dt.isType(DataType::Type::VARSIZED); }; + auto isTime = [](const DataType& dt) { return dt.isType(DataType::Type::UINT64); }; + INVARIANT(isStr(ch[0].getDataType()) && isStr(ch[1].getDataType()) && isTime(ch[2].getDataType()), + "AlwaysEqTextTtext: expects (VARCHAR, VARCHAR, UINT64)"); + return withChildren(ch); +} + +SerializableFunction AlwaysEqTextTtextLogicalFunction::serialize() const { + SerializableFunction sf; + sf.set_function_type(std::string(NAME)); + for (auto& p : parameters) *sf.add_children() = p.serialize(); + DataTypeSerializationUtil::serializeDataType(dataType, sf.mutable_data_type()); + return sf; +} + +LogicalFunctionRegistryReturnType +LogicalFunctionGeneratedRegistrar::RegisterAlwaysEqTextTtextLogicalFunction( + LogicalFunctionRegistryArguments arguments) { + PRECONDITION(arguments.children.size() == 3, + "AlwaysEqTextTtext expects 3 params, got {}", arguments.children.size()); + return AlwaysEqTextTtextLogicalFunction( + arguments.children[0], arguments.children[1], arguments.children[2]); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysEqTtextTextLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysEqTtextTextLogicalFunction.cpp new file mode 100644 index 0000000000..fa16a2e415 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysEqTtextTextLogicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES { + +AlwaysEqTtextTextLogicalFunction::AlwaysEqTtextTextLogicalFunction( + LogicalFunction value, LogicalFunction ref, LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { + parameters = {std::move(value), std::move(ref), std::move(ts)}; +} + +DataType AlwaysEqTtextTextLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysEqTtextTextLogicalFunction::withDataType(const DataType& dt) const { + auto c = *this; c.dataType = dt; return c; +} + +std::vector AlwaysEqTtextTextLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysEqTtextTextLogicalFunction::withChildren(const std::vector& ch) const { + PRECONDITION(ch.size() == 3, "AlwaysEqTtextText expects 3 params, got {}", ch.size()); + auto c = *this; c.parameters = ch; return c; +} + +std::string_view AlwaysEqTtextTextLogicalFunction::getType() const { return NAME; } + +bool AlwaysEqTtextTextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + const auto* o = dynamic_cast(&rhs); + return o && parameters == o->parameters; +} + +std::string AlwaysEqTtextTextLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("AlwaysEqTtextText({}, {}, {})", + parameters[0].explain(v), parameters[1].explain(v), parameters[2].explain(v)); +} + +LogicalFunction AlwaysEqTtextTextLogicalFunction::withInferredDataType(const Schema& s) const { + std::vector ch; + ch.reserve(3); + for (auto& p : parameters) ch.push_back(p.withInferredDataType(s)); + auto isStr = [](const DataType& dt) { return dt.isType(DataType::Type::VARSIZED); }; + auto isTime = [](const DataType& dt) { return dt.isType(DataType::Type::UINT64); }; + INVARIANT(isStr(ch[0].getDataType()) && isStr(ch[1].getDataType()) && isTime(ch[2].getDataType()), + "AlwaysEqTtextText: expects (VARCHAR, VARCHAR, UINT64)"); + return withChildren(ch); +} + +SerializableFunction AlwaysEqTtextTextLogicalFunction::serialize() const { + SerializableFunction sf; + sf.set_function_type(std::string(NAME)); + for (auto& p : parameters) *sf.add_children() = p.serialize(); + DataTypeSerializationUtil::serializeDataType(dataType, sf.mutable_data_type()); + return sf; +} + +LogicalFunctionRegistryReturnType +LogicalFunctionGeneratedRegistrar::RegisterAlwaysEqTtextTextLogicalFunction( + LogicalFunctionRegistryArguments arguments) { + PRECONDITION(arguments.children.size() == 3, + "AlwaysEqTtextText expects 3 params, got {}", arguments.children.size()); + return AlwaysEqTtextTextLogicalFunction( + arguments.children[0], arguments.children[1], arguments.children[2]); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysGeTextTtextLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysGeTextTtextLogicalFunction.cpp new file mode 100644 index 0000000000..78396dd1f5 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysGeTextTtextLogicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES { + +AlwaysGeTextTtextLogicalFunction::AlwaysGeTextTtextLogicalFunction( + LogicalFunction value, LogicalFunction ref, LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { + parameters = {std::move(value), std::move(ref), std::move(ts)}; +} + +DataType AlwaysGeTextTtextLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysGeTextTtextLogicalFunction::withDataType(const DataType& dt) const { + auto c = *this; c.dataType = dt; return c; +} + +std::vector AlwaysGeTextTtextLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysGeTextTtextLogicalFunction::withChildren(const std::vector& ch) const { + PRECONDITION(ch.size() == 3, "AlwaysGeTextTtext expects 3 params, got {}", ch.size()); + auto c = *this; c.parameters = ch; return c; +} + +std::string_view AlwaysGeTextTtextLogicalFunction::getType() const { return NAME; } + +bool AlwaysGeTextTtextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + const auto* o = dynamic_cast(&rhs); + return o && parameters == o->parameters; +} + +std::string AlwaysGeTextTtextLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("AlwaysGeTextTtext({}, {}, {})", + parameters[0].explain(v), parameters[1].explain(v), parameters[2].explain(v)); +} + +LogicalFunction AlwaysGeTextTtextLogicalFunction::withInferredDataType(const Schema& s) const { + std::vector ch; + ch.reserve(3); + for (auto& p : parameters) ch.push_back(p.withInferredDataType(s)); + auto isStr = [](const DataType& dt) { return dt.isType(DataType::Type::VARSIZED); }; + auto isTime = [](const DataType& dt) { return dt.isType(DataType::Type::UINT64); }; + INVARIANT(isStr(ch[0].getDataType()) && isStr(ch[1].getDataType()) && isTime(ch[2].getDataType()), + "AlwaysGeTextTtext: expects (VARCHAR, VARCHAR, UINT64)"); + return withChildren(ch); +} + +SerializableFunction AlwaysGeTextTtextLogicalFunction::serialize() const { + SerializableFunction sf; + sf.set_function_type(std::string(NAME)); + for (auto& p : parameters) *sf.add_children() = p.serialize(); + DataTypeSerializationUtil::serializeDataType(dataType, sf.mutable_data_type()); + return sf; +} + +LogicalFunctionRegistryReturnType +LogicalFunctionGeneratedRegistrar::RegisterAlwaysGeTextTtextLogicalFunction( + LogicalFunctionRegistryArguments arguments) { + PRECONDITION(arguments.children.size() == 3, + "AlwaysGeTextTtext expects 3 params, got {}", arguments.children.size()); + return AlwaysGeTextTtextLogicalFunction( + arguments.children[0], arguments.children[1], arguments.children[2]); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysGeTtextTextLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysGeTtextTextLogicalFunction.cpp new file mode 100644 index 0000000000..de309a500a --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysGeTtextTextLogicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES { + +AlwaysGeTtextTextLogicalFunction::AlwaysGeTtextTextLogicalFunction( + LogicalFunction value, LogicalFunction ref, LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { + parameters = {std::move(value), std::move(ref), std::move(ts)}; +} + +DataType AlwaysGeTtextTextLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysGeTtextTextLogicalFunction::withDataType(const DataType& dt) const { + auto c = *this; c.dataType = dt; return c; +} + +std::vector AlwaysGeTtextTextLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysGeTtextTextLogicalFunction::withChildren(const std::vector& ch) const { + PRECONDITION(ch.size() == 3, "AlwaysGeTtextText expects 3 params, got {}", ch.size()); + auto c = *this; c.parameters = ch; return c; +} + +std::string_view AlwaysGeTtextTextLogicalFunction::getType() const { return NAME; } + +bool AlwaysGeTtextTextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + const auto* o = dynamic_cast(&rhs); + return o && parameters == o->parameters; +} + +std::string AlwaysGeTtextTextLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("AlwaysGeTtextText({}, {}, {})", + parameters[0].explain(v), parameters[1].explain(v), parameters[2].explain(v)); +} + +LogicalFunction AlwaysGeTtextTextLogicalFunction::withInferredDataType(const Schema& s) const { + std::vector ch; + ch.reserve(3); + for (auto& p : parameters) ch.push_back(p.withInferredDataType(s)); + auto isStr = [](const DataType& dt) { return dt.isType(DataType::Type::VARSIZED); }; + auto isTime = [](const DataType& dt) { return dt.isType(DataType::Type::UINT64); }; + INVARIANT(isStr(ch[0].getDataType()) && isStr(ch[1].getDataType()) && isTime(ch[2].getDataType()), + "AlwaysGeTtextText: expects (VARCHAR, VARCHAR, UINT64)"); + return withChildren(ch); +} + +SerializableFunction AlwaysGeTtextTextLogicalFunction::serialize() const { + SerializableFunction sf; + sf.set_function_type(std::string(NAME)); + for (auto& p : parameters) *sf.add_children() = p.serialize(); + DataTypeSerializationUtil::serializeDataType(dataType, sf.mutable_data_type()); + return sf; +} + +LogicalFunctionRegistryReturnType +LogicalFunctionGeneratedRegistrar::RegisterAlwaysGeTtextTextLogicalFunction( + LogicalFunctionRegistryArguments arguments) { + PRECONDITION(arguments.children.size() == 3, + "AlwaysGeTtextText expects 3 params, got {}", arguments.children.size()); + return AlwaysGeTtextTextLogicalFunction( + arguments.children[0], arguments.children[1], arguments.children[2]); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysGtTextTtextLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysGtTextTtextLogicalFunction.cpp new file mode 100644 index 0000000000..0cfebc7906 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysGtTextTtextLogicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES { + +AlwaysGtTextTtextLogicalFunction::AlwaysGtTextTtextLogicalFunction( + LogicalFunction value, LogicalFunction ref, LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { + parameters = {std::move(value), std::move(ref), std::move(ts)}; +} + +DataType AlwaysGtTextTtextLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysGtTextTtextLogicalFunction::withDataType(const DataType& dt) const { + auto c = *this; c.dataType = dt; return c; +} + +std::vector AlwaysGtTextTtextLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysGtTextTtextLogicalFunction::withChildren(const std::vector& ch) const { + PRECONDITION(ch.size() == 3, "AlwaysGtTextTtext expects 3 params, got {}", ch.size()); + auto c = *this; c.parameters = ch; return c; +} + +std::string_view AlwaysGtTextTtextLogicalFunction::getType() const { return NAME; } + +bool AlwaysGtTextTtextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + const auto* o = dynamic_cast(&rhs); + return o && parameters == o->parameters; +} + +std::string AlwaysGtTextTtextLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("AlwaysGtTextTtext({}, {}, {})", + parameters[0].explain(v), parameters[1].explain(v), parameters[2].explain(v)); +} + +LogicalFunction AlwaysGtTextTtextLogicalFunction::withInferredDataType(const Schema& s) const { + std::vector ch; + ch.reserve(3); + for (auto& p : parameters) ch.push_back(p.withInferredDataType(s)); + auto isStr = [](const DataType& dt) { return dt.isType(DataType::Type::VARSIZED); }; + auto isTime = [](const DataType& dt) { return dt.isType(DataType::Type::UINT64); }; + INVARIANT(isStr(ch[0].getDataType()) && isStr(ch[1].getDataType()) && isTime(ch[2].getDataType()), + "AlwaysGtTextTtext: expects (VARCHAR, VARCHAR, UINT64)"); + return withChildren(ch); +} + +SerializableFunction AlwaysGtTextTtextLogicalFunction::serialize() const { + SerializableFunction sf; + sf.set_function_type(std::string(NAME)); + for (auto& p : parameters) *sf.add_children() = p.serialize(); + DataTypeSerializationUtil::serializeDataType(dataType, sf.mutable_data_type()); + return sf; +} + +LogicalFunctionRegistryReturnType +LogicalFunctionGeneratedRegistrar::RegisterAlwaysGtTextTtextLogicalFunction( + LogicalFunctionRegistryArguments arguments) { + PRECONDITION(arguments.children.size() == 3, + "AlwaysGtTextTtext expects 3 params, got {}", arguments.children.size()); + return AlwaysGtTextTtextLogicalFunction( + arguments.children[0], arguments.children[1], arguments.children[2]); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysGtTtextTextLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysGtTtextTextLogicalFunction.cpp new file mode 100644 index 0000000000..2bc4c83e01 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysGtTtextTextLogicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES { + +AlwaysGtTtextTextLogicalFunction::AlwaysGtTtextTextLogicalFunction( + LogicalFunction value, LogicalFunction ref, LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { + parameters = {std::move(value), std::move(ref), std::move(ts)}; +} + +DataType AlwaysGtTtextTextLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysGtTtextTextLogicalFunction::withDataType(const DataType& dt) const { + auto c = *this; c.dataType = dt; return c; +} + +std::vector AlwaysGtTtextTextLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysGtTtextTextLogicalFunction::withChildren(const std::vector& ch) const { + PRECONDITION(ch.size() == 3, "AlwaysGtTtextText expects 3 params, got {}", ch.size()); + auto c = *this; c.parameters = ch; return c; +} + +std::string_view AlwaysGtTtextTextLogicalFunction::getType() const { return NAME; } + +bool AlwaysGtTtextTextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + const auto* o = dynamic_cast(&rhs); + return o && parameters == o->parameters; +} + +std::string AlwaysGtTtextTextLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("AlwaysGtTtextText({}, {}, {})", + parameters[0].explain(v), parameters[1].explain(v), parameters[2].explain(v)); +} + +LogicalFunction AlwaysGtTtextTextLogicalFunction::withInferredDataType(const Schema& s) const { + std::vector ch; + ch.reserve(3); + for (auto& p : parameters) ch.push_back(p.withInferredDataType(s)); + auto isStr = [](const DataType& dt) { return dt.isType(DataType::Type::VARSIZED); }; + auto isTime = [](const DataType& dt) { return dt.isType(DataType::Type::UINT64); }; + INVARIANT(isStr(ch[0].getDataType()) && isStr(ch[1].getDataType()) && isTime(ch[2].getDataType()), + "AlwaysGtTtextText: expects (VARCHAR, VARCHAR, UINT64)"); + return withChildren(ch); +} + +SerializableFunction AlwaysGtTtextTextLogicalFunction::serialize() const { + SerializableFunction sf; + sf.set_function_type(std::string(NAME)); + for (auto& p : parameters) *sf.add_children() = p.serialize(); + DataTypeSerializationUtil::serializeDataType(dataType, sf.mutable_data_type()); + return sf; +} + +LogicalFunctionRegistryReturnType +LogicalFunctionGeneratedRegistrar::RegisterAlwaysGtTtextTextLogicalFunction( + LogicalFunctionRegistryArguments arguments) { + PRECONDITION(arguments.children.size() == 3, + "AlwaysGtTtextText expects 3 params, got {}", arguments.children.size()); + return AlwaysGtTtextTextLogicalFunction( + arguments.children[0], arguments.children[1], arguments.children[2]); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysLeTextTtextLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysLeTextTtextLogicalFunction.cpp new file mode 100644 index 0000000000..524c676048 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysLeTextTtextLogicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES { + +AlwaysLeTextTtextLogicalFunction::AlwaysLeTextTtextLogicalFunction( + LogicalFunction value, LogicalFunction ref, LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { + parameters = {std::move(value), std::move(ref), std::move(ts)}; +} + +DataType AlwaysLeTextTtextLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysLeTextTtextLogicalFunction::withDataType(const DataType& dt) const { + auto c = *this; c.dataType = dt; return c; +} + +std::vector AlwaysLeTextTtextLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysLeTextTtextLogicalFunction::withChildren(const std::vector& ch) const { + PRECONDITION(ch.size() == 3, "AlwaysLeTextTtext expects 3 params, got {}", ch.size()); + auto c = *this; c.parameters = ch; return c; +} + +std::string_view AlwaysLeTextTtextLogicalFunction::getType() const { return NAME; } + +bool AlwaysLeTextTtextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + const auto* o = dynamic_cast(&rhs); + return o && parameters == o->parameters; +} + +std::string AlwaysLeTextTtextLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("AlwaysLeTextTtext({}, {}, {})", + parameters[0].explain(v), parameters[1].explain(v), parameters[2].explain(v)); +} + +LogicalFunction AlwaysLeTextTtextLogicalFunction::withInferredDataType(const Schema& s) const { + std::vector ch; + ch.reserve(3); + for (auto& p : parameters) ch.push_back(p.withInferredDataType(s)); + auto isStr = [](const DataType& dt) { return dt.isType(DataType::Type::VARSIZED); }; + auto isTime = [](const DataType& dt) { return dt.isType(DataType::Type::UINT64); }; + INVARIANT(isStr(ch[0].getDataType()) && isStr(ch[1].getDataType()) && isTime(ch[2].getDataType()), + "AlwaysLeTextTtext: expects (VARCHAR, VARCHAR, UINT64)"); + return withChildren(ch); +} + +SerializableFunction AlwaysLeTextTtextLogicalFunction::serialize() const { + SerializableFunction sf; + sf.set_function_type(std::string(NAME)); + for (auto& p : parameters) *sf.add_children() = p.serialize(); + DataTypeSerializationUtil::serializeDataType(dataType, sf.mutable_data_type()); + return sf; +} + +LogicalFunctionRegistryReturnType +LogicalFunctionGeneratedRegistrar::RegisterAlwaysLeTextTtextLogicalFunction( + LogicalFunctionRegistryArguments arguments) { + PRECONDITION(arguments.children.size() == 3, + "AlwaysLeTextTtext expects 3 params, got {}", arguments.children.size()); + return AlwaysLeTextTtextLogicalFunction( + arguments.children[0], arguments.children[1], arguments.children[2]); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysLeTtextTextLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysLeTtextTextLogicalFunction.cpp new file mode 100644 index 0000000000..d2abaf2721 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysLeTtextTextLogicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES { + +AlwaysLeTtextTextLogicalFunction::AlwaysLeTtextTextLogicalFunction( + LogicalFunction value, LogicalFunction ref, LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { + parameters = {std::move(value), std::move(ref), std::move(ts)}; +} + +DataType AlwaysLeTtextTextLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysLeTtextTextLogicalFunction::withDataType(const DataType& dt) const { + auto c = *this; c.dataType = dt; return c; +} + +std::vector AlwaysLeTtextTextLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysLeTtextTextLogicalFunction::withChildren(const std::vector& ch) const { + PRECONDITION(ch.size() == 3, "AlwaysLeTtextText expects 3 params, got {}", ch.size()); + auto c = *this; c.parameters = ch; return c; +} + +std::string_view AlwaysLeTtextTextLogicalFunction::getType() const { return NAME; } + +bool AlwaysLeTtextTextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + const auto* o = dynamic_cast(&rhs); + return o && parameters == o->parameters; +} + +std::string AlwaysLeTtextTextLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("AlwaysLeTtextText({}, {}, {})", + parameters[0].explain(v), parameters[1].explain(v), parameters[2].explain(v)); +} + +LogicalFunction AlwaysLeTtextTextLogicalFunction::withInferredDataType(const Schema& s) const { + std::vector ch; + ch.reserve(3); + for (auto& p : parameters) ch.push_back(p.withInferredDataType(s)); + auto isStr = [](const DataType& dt) { return dt.isType(DataType::Type::VARSIZED); }; + auto isTime = [](const DataType& dt) { return dt.isType(DataType::Type::UINT64); }; + INVARIANT(isStr(ch[0].getDataType()) && isStr(ch[1].getDataType()) && isTime(ch[2].getDataType()), + "AlwaysLeTtextText: expects (VARCHAR, VARCHAR, UINT64)"); + return withChildren(ch); +} + +SerializableFunction AlwaysLeTtextTextLogicalFunction::serialize() const { + SerializableFunction sf; + sf.set_function_type(std::string(NAME)); + for (auto& p : parameters) *sf.add_children() = p.serialize(); + DataTypeSerializationUtil::serializeDataType(dataType, sf.mutable_data_type()); + return sf; +} + +LogicalFunctionRegistryReturnType +LogicalFunctionGeneratedRegistrar::RegisterAlwaysLeTtextTextLogicalFunction( + LogicalFunctionRegistryArguments arguments) { + PRECONDITION(arguments.children.size() == 3, + "AlwaysLeTtextText expects 3 params, got {}", arguments.children.size()); + return AlwaysLeTtextTextLogicalFunction( + arguments.children[0], arguments.children[1], arguments.children[2]); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysLtTextTtextLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysLtTextTtextLogicalFunction.cpp new file mode 100644 index 0000000000..edf0739950 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysLtTextTtextLogicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES { + +AlwaysLtTextTtextLogicalFunction::AlwaysLtTextTtextLogicalFunction( + LogicalFunction value, LogicalFunction ref, LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { + parameters = {std::move(value), std::move(ref), std::move(ts)}; +} + +DataType AlwaysLtTextTtextLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysLtTextTtextLogicalFunction::withDataType(const DataType& dt) const { + auto c = *this; c.dataType = dt; return c; +} + +std::vector AlwaysLtTextTtextLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysLtTextTtextLogicalFunction::withChildren(const std::vector& ch) const { + PRECONDITION(ch.size() == 3, "AlwaysLtTextTtext expects 3 params, got {}", ch.size()); + auto c = *this; c.parameters = ch; return c; +} + +std::string_view AlwaysLtTextTtextLogicalFunction::getType() const { return NAME; } + +bool AlwaysLtTextTtextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + const auto* o = dynamic_cast(&rhs); + return o && parameters == o->parameters; +} + +std::string AlwaysLtTextTtextLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("AlwaysLtTextTtext({}, {}, {})", + parameters[0].explain(v), parameters[1].explain(v), parameters[2].explain(v)); +} + +LogicalFunction AlwaysLtTextTtextLogicalFunction::withInferredDataType(const Schema& s) const { + std::vector ch; + ch.reserve(3); + for (auto& p : parameters) ch.push_back(p.withInferredDataType(s)); + auto isStr = [](const DataType& dt) { return dt.isType(DataType::Type::VARSIZED); }; + auto isTime = [](const DataType& dt) { return dt.isType(DataType::Type::UINT64); }; + INVARIANT(isStr(ch[0].getDataType()) && isStr(ch[1].getDataType()) && isTime(ch[2].getDataType()), + "AlwaysLtTextTtext: expects (VARCHAR, VARCHAR, UINT64)"); + return withChildren(ch); +} + +SerializableFunction AlwaysLtTextTtextLogicalFunction::serialize() const { + SerializableFunction sf; + sf.set_function_type(std::string(NAME)); + for (auto& p : parameters) *sf.add_children() = p.serialize(); + DataTypeSerializationUtil::serializeDataType(dataType, sf.mutable_data_type()); + return sf; +} + +LogicalFunctionRegistryReturnType +LogicalFunctionGeneratedRegistrar::RegisterAlwaysLtTextTtextLogicalFunction( + LogicalFunctionRegistryArguments arguments) { + PRECONDITION(arguments.children.size() == 3, + "AlwaysLtTextTtext expects 3 params, got {}", arguments.children.size()); + return AlwaysLtTextTtextLogicalFunction( + arguments.children[0], arguments.children[1], arguments.children[2]); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysLtTtextTextLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysLtTtextTextLogicalFunction.cpp new file mode 100644 index 0000000000..d9b3e39e33 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysLtTtextTextLogicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES { + +AlwaysLtTtextTextLogicalFunction::AlwaysLtTtextTextLogicalFunction( + LogicalFunction value, LogicalFunction ref, LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { + parameters = {std::move(value), std::move(ref), std::move(ts)}; +} + +DataType AlwaysLtTtextTextLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysLtTtextTextLogicalFunction::withDataType(const DataType& dt) const { + auto c = *this; c.dataType = dt; return c; +} + +std::vector AlwaysLtTtextTextLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysLtTtextTextLogicalFunction::withChildren(const std::vector& ch) const { + PRECONDITION(ch.size() == 3, "AlwaysLtTtextText expects 3 params, got {}", ch.size()); + auto c = *this; c.parameters = ch; return c; +} + +std::string_view AlwaysLtTtextTextLogicalFunction::getType() const { return NAME; } + +bool AlwaysLtTtextTextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + const auto* o = dynamic_cast(&rhs); + return o && parameters == o->parameters; +} + +std::string AlwaysLtTtextTextLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("AlwaysLtTtextText({}, {}, {})", + parameters[0].explain(v), parameters[1].explain(v), parameters[2].explain(v)); +} + +LogicalFunction AlwaysLtTtextTextLogicalFunction::withInferredDataType(const Schema& s) const { + std::vector ch; + ch.reserve(3); + for (auto& p : parameters) ch.push_back(p.withInferredDataType(s)); + auto isStr = [](const DataType& dt) { return dt.isType(DataType::Type::VARSIZED); }; + auto isTime = [](const DataType& dt) { return dt.isType(DataType::Type::UINT64); }; + INVARIANT(isStr(ch[0].getDataType()) && isStr(ch[1].getDataType()) && isTime(ch[2].getDataType()), + "AlwaysLtTtextText: expects (VARCHAR, VARCHAR, UINT64)"); + return withChildren(ch); +} + +SerializableFunction AlwaysLtTtextTextLogicalFunction::serialize() const { + SerializableFunction sf; + sf.set_function_type(std::string(NAME)); + for (auto& p : parameters) *sf.add_children() = p.serialize(); + DataTypeSerializationUtil::serializeDataType(dataType, sf.mutable_data_type()); + return sf; +} + +LogicalFunctionRegistryReturnType +LogicalFunctionGeneratedRegistrar::RegisterAlwaysLtTtextTextLogicalFunction( + LogicalFunctionRegistryArguments arguments) { + PRECONDITION(arguments.children.size() == 3, + "AlwaysLtTtextText expects 3 params, got {}", arguments.children.size()); + return AlwaysLtTtextTextLogicalFunction( + arguments.children[0], arguments.children[1], arguments.children[2]); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysNeTextTtextLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysNeTextTtextLogicalFunction.cpp new file mode 100644 index 0000000000..ae8f1344c2 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysNeTextTtextLogicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES { + +AlwaysNeTextTtextLogicalFunction::AlwaysNeTextTtextLogicalFunction( + LogicalFunction value, LogicalFunction ref, LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { + parameters = {std::move(value), std::move(ref), std::move(ts)}; +} + +DataType AlwaysNeTextTtextLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysNeTextTtextLogicalFunction::withDataType(const DataType& dt) const { + auto c = *this; c.dataType = dt; return c; +} + +std::vector AlwaysNeTextTtextLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysNeTextTtextLogicalFunction::withChildren(const std::vector& ch) const { + PRECONDITION(ch.size() == 3, "AlwaysNeTextTtext expects 3 params, got {}", ch.size()); + auto c = *this; c.parameters = ch; return c; +} + +std::string_view AlwaysNeTextTtextLogicalFunction::getType() const { return NAME; } + +bool AlwaysNeTextTtextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + const auto* o = dynamic_cast(&rhs); + return o && parameters == o->parameters; +} + +std::string AlwaysNeTextTtextLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("AlwaysNeTextTtext({}, {}, {})", + parameters[0].explain(v), parameters[1].explain(v), parameters[2].explain(v)); +} + +LogicalFunction AlwaysNeTextTtextLogicalFunction::withInferredDataType(const Schema& s) const { + std::vector ch; + ch.reserve(3); + for (auto& p : parameters) ch.push_back(p.withInferredDataType(s)); + auto isStr = [](const DataType& dt) { return dt.isType(DataType::Type::VARSIZED); }; + auto isTime = [](const DataType& dt) { return dt.isType(DataType::Type::UINT64); }; + INVARIANT(isStr(ch[0].getDataType()) && isStr(ch[1].getDataType()) && isTime(ch[2].getDataType()), + "AlwaysNeTextTtext: expects (VARCHAR, VARCHAR, UINT64)"); + return withChildren(ch); +} + +SerializableFunction AlwaysNeTextTtextLogicalFunction::serialize() const { + SerializableFunction sf; + sf.set_function_type(std::string(NAME)); + for (auto& p : parameters) *sf.add_children() = p.serialize(); + DataTypeSerializationUtil::serializeDataType(dataType, sf.mutable_data_type()); + return sf; +} + +LogicalFunctionRegistryReturnType +LogicalFunctionGeneratedRegistrar::RegisterAlwaysNeTextTtextLogicalFunction( + LogicalFunctionRegistryArguments arguments) { + PRECONDITION(arguments.children.size() == 3, + "AlwaysNeTextTtext expects 3 params, got {}", arguments.children.size()); + return AlwaysNeTextTtextLogicalFunction( + arguments.children[0], arguments.children[1], arguments.children[2]); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysNeTtextTextLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysNeTtextTextLogicalFunction.cpp new file mode 100644 index 0000000000..70c93952c5 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysNeTtextTextLogicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES { + +AlwaysNeTtextTextLogicalFunction::AlwaysNeTtextTextLogicalFunction( + LogicalFunction value, LogicalFunction ref, LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { + parameters = {std::move(value), std::move(ref), std::move(ts)}; +} + +DataType AlwaysNeTtextTextLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysNeTtextTextLogicalFunction::withDataType(const DataType& dt) const { + auto c = *this; c.dataType = dt; return c; +} + +std::vector AlwaysNeTtextTextLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysNeTtextTextLogicalFunction::withChildren(const std::vector& ch) const { + PRECONDITION(ch.size() == 3, "AlwaysNeTtextText expects 3 params, got {}", ch.size()); + auto c = *this; c.parameters = ch; return c; +} + +std::string_view AlwaysNeTtextTextLogicalFunction::getType() const { return NAME; } + +bool AlwaysNeTtextTextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + const auto* o = dynamic_cast(&rhs); + return o && parameters == o->parameters; +} + +std::string AlwaysNeTtextTextLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("AlwaysNeTtextText({}, {}, {})", + parameters[0].explain(v), parameters[1].explain(v), parameters[2].explain(v)); +} + +LogicalFunction AlwaysNeTtextTextLogicalFunction::withInferredDataType(const Schema& s) const { + std::vector ch; + ch.reserve(3); + for (auto& p : parameters) ch.push_back(p.withInferredDataType(s)); + auto isStr = [](const DataType& dt) { return dt.isType(DataType::Type::VARSIZED); }; + auto isTime = [](const DataType& dt) { return dt.isType(DataType::Type::UINT64); }; + INVARIANT(isStr(ch[0].getDataType()) && isStr(ch[1].getDataType()) && isTime(ch[2].getDataType()), + "AlwaysNeTtextText: expects (VARCHAR, VARCHAR, UINT64)"); + return withChildren(ch); +} + +SerializableFunction AlwaysNeTtextTextLogicalFunction::serialize() const { + SerializableFunction sf; + sf.set_function_type(std::string(NAME)); + for (auto& p : parameters) *sf.add_children() = p.serialize(); + DataTypeSerializationUtil::serializeDataType(dataType, sf.mutable_data_type()); + return sf; +} + +LogicalFunctionRegistryReturnType +LogicalFunctionGeneratedRegistrar::RegisterAlwaysNeTtextTextLogicalFunction( + LogicalFunctionRegistryArguments arguments) { + PRECONDITION(arguments.children.size() == 3, + "AlwaysNeTtextText expects 3 params, got {}", arguments.children.size()); + return AlwaysNeTtextTextLogicalFunction( + arguments.children[0], arguments.children[1], arguments.children[2]); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt index 0f5902cc58..1791eb41ff 100644 --- a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt @@ -246,3 +246,31 @@ add_plugin(TltTintInt LogicalFunction nes-logical-operators TltTintIntLogicalFun add_plugin(TltIntTint LogicalFunction nes-logical-operators TltIntTintLogicalFunction.cpp) add_plugin(TltTemporalTemporal LogicalFunction nes-logical-operators TltTemporalTemporalLogicalFunction.cpp) add_plugin(TboolToTint LogicalFunction nes-logical-operators TboolToTintLogicalFunction.cpp) +add_plugin(EverEqTtextText LogicalFunction nes-logical-operators EverEqTtextTextLogicalFunction.cpp) +add_plugin(EverNeTtextText LogicalFunction nes-logical-operators EverNeTtextTextLogicalFunction.cpp) +add_plugin(EverGeTtextText LogicalFunction nes-logical-operators EverGeTtextTextLogicalFunction.cpp) +add_plugin(EverGtTtextText LogicalFunction nes-logical-operators EverGtTtextTextLogicalFunction.cpp) +add_plugin(EverLeTtextText LogicalFunction nes-logical-operators EverLeTtextTextLogicalFunction.cpp) +add_plugin(EverLtTtextText LogicalFunction nes-logical-operators EverLtTtextTextLogicalFunction.cpp) +add_plugin(EverEqTextTtext LogicalFunction nes-logical-operators EverEqTextTtextLogicalFunction.cpp) +add_plugin(EverNeTextTtext LogicalFunction nes-logical-operators EverNeTextTtextLogicalFunction.cpp) +add_plugin(EverGeTextTtext LogicalFunction nes-logical-operators EverGeTextTtextLogicalFunction.cpp) +add_plugin(EverGtTextTtext LogicalFunction nes-logical-operators EverGtTextTtextLogicalFunction.cpp) +add_plugin(EverLeTextTtext LogicalFunction nes-logical-operators EverLeTextTtextLogicalFunction.cpp) +add_plugin(EverLtTextTtext LogicalFunction nes-logical-operators EverLtTextTtextLogicalFunction.cpp) +add_plugin(AlwaysEqTtextText LogicalFunction nes-logical-operators AlwaysEqTtextTextLogicalFunction.cpp) +add_plugin(AlwaysNeTtextText LogicalFunction nes-logical-operators AlwaysNeTtextTextLogicalFunction.cpp) +add_plugin(AlwaysGeTtextText LogicalFunction nes-logical-operators AlwaysGeTtextTextLogicalFunction.cpp) +add_plugin(AlwaysGtTtextText LogicalFunction nes-logical-operators AlwaysGtTtextTextLogicalFunction.cpp) +add_plugin(AlwaysLeTtextText LogicalFunction nes-logical-operators AlwaysLeTtextTextLogicalFunction.cpp) +add_plugin(AlwaysLtTtextText LogicalFunction nes-logical-operators AlwaysLtTtextTextLogicalFunction.cpp) +add_plugin(AlwaysEqTextTtext LogicalFunction nes-logical-operators AlwaysEqTextTtextLogicalFunction.cpp) +add_plugin(AlwaysNeTextTtext LogicalFunction nes-logical-operators AlwaysNeTextTtextLogicalFunction.cpp) +add_plugin(AlwaysGeTextTtext LogicalFunction nes-logical-operators AlwaysGeTextTtextLogicalFunction.cpp) +add_plugin(AlwaysGtTextTtext LogicalFunction nes-logical-operators AlwaysGtTextTtextLogicalFunction.cpp) +add_plugin(AlwaysLeTextTtext LogicalFunction nes-logical-operators AlwaysLeTextTtextLogicalFunction.cpp) +add_plugin(AlwaysLtTextTtext LogicalFunction nes-logical-operators AlwaysLtTextTtextLogicalFunction.cpp) +add_plugin(TeqTtextText LogicalFunction nes-logical-operators TeqTtextTextLogicalFunction.cpp) +add_plugin(TneTtextText LogicalFunction nes-logical-operators TneTtextTextLogicalFunction.cpp) +add_plugin(TeqTextTtext LogicalFunction nes-logical-operators TeqTextTtextLogicalFunction.cpp) +add_plugin(TneTextTtext LogicalFunction nes-logical-operators TneTextTtextLogicalFunction.cpp) diff --git a/nes-logical-operators/src/Functions/Meos/EverEqTextTtextLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverEqTextTtextLogicalFunction.cpp new file mode 100644 index 0000000000..904e7ebf6b --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverEqTextTtextLogicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES { + +EverEqTextTtextLogicalFunction::EverEqTextTtextLogicalFunction( + LogicalFunction value, LogicalFunction ref, LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { + parameters = {std::move(value), std::move(ref), std::move(ts)}; +} + +DataType EverEqTextTtextLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverEqTextTtextLogicalFunction::withDataType(const DataType& dt) const { + auto c = *this; c.dataType = dt; return c; +} + +std::vector EverEqTextTtextLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverEqTextTtextLogicalFunction::withChildren(const std::vector& ch) const { + PRECONDITION(ch.size() == 3, "EverEqTextTtext expects 3 params, got {}", ch.size()); + auto c = *this; c.parameters = ch; return c; +} + +std::string_view EverEqTextTtextLogicalFunction::getType() const { return NAME; } + +bool EverEqTextTtextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + const auto* o = dynamic_cast(&rhs); + return o && parameters == o->parameters; +} + +std::string EverEqTextTtextLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("EverEqTextTtext({}, {}, {})", + parameters[0].explain(v), parameters[1].explain(v), parameters[2].explain(v)); +} + +LogicalFunction EverEqTextTtextLogicalFunction::withInferredDataType(const Schema& s) const { + std::vector ch; + ch.reserve(3); + for (auto& p : parameters) ch.push_back(p.withInferredDataType(s)); + auto isStr = [](const DataType& dt) { return dt.isType(DataType::Type::VARSIZED); }; + auto isTime = [](const DataType& dt) { return dt.isType(DataType::Type::UINT64); }; + INVARIANT(isStr(ch[0].getDataType()) && isStr(ch[1].getDataType()) && isTime(ch[2].getDataType()), + "EverEqTextTtext: expects (VARCHAR, VARCHAR, UINT64)"); + return withChildren(ch); +} + +SerializableFunction EverEqTextTtextLogicalFunction::serialize() const { + SerializableFunction sf; + sf.set_function_type(std::string(NAME)); + for (auto& p : parameters) *sf.add_children() = p.serialize(); + DataTypeSerializationUtil::serializeDataType(dataType, sf.mutable_data_type()); + return sf; +} + +LogicalFunctionRegistryReturnType +LogicalFunctionGeneratedRegistrar::RegisterEverEqTextTtextLogicalFunction( + LogicalFunctionRegistryArguments arguments) { + PRECONDITION(arguments.children.size() == 3, + "EverEqTextTtext expects 3 params, got {}", arguments.children.size()); + return EverEqTextTtextLogicalFunction( + arguments.children[0], arguments.children[1], arguments.children[2]); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverEqTtextTextLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverEqTtextTextLogicalFunction.cpp new file mode 100644 index 0000000000..ab4ee6ed85 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverEqTtextTextLogicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES { + +EverEqTtextTextLogicalFunction::EverEqTtextTextLogicalFunction( + LogicalFunction value, LogicalFunction ref, LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { + parameters = {std::move(value), std::move(ref), std::move(ts)}; +} + +DataType EverEqTtextTextLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverEqTtextTextLogicalFunction::withDataType(const DataType& dt) const { + auto c = *this; c.dataType = dt; return c; +} + +std::vector EverEqTtextTextLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverEqTtextTextLogicalFunction::withChildren(const std::vector& ch) const { + PRECONDITION(ch.size() == 3, "EverEqTtextText expects 3 params, got {}", ch.size()); + auto c = *this; c.parameters = ch; return c; +} + +std::string_view EverEqTtextTextLogicalFunction::getType() const { return NAME; } + +bool EverEqTtextTextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + const auto* o = dynamic_cast(&rhs); + return o && parameters == o->parameters; +} + +std::string EverEqTtextTextLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("EverEqTtextText({}, {}, {})", + parameters[0].explain(v), parameters[1].explain(v), parameters[2].explain(v)); +} + +LogicalFunction EverEqTtextTextLogicalFunction::withInferredDataType(const Schema& s) const { + std::vector ch; + ch.reserve(3); + for (auto& p : parameters) ch.push_back(p.withInferredDataType(s)); + auto isStr = [](const DataType& dt) { return dt.isType(DataType::Type::VARSIZED); }; + auto isTime = [](const DataType& dt) { return dt.isType(DataType::Type::UINT64); }; + INVARIANT(isStr(ch[0].getDataType()) && isStr(ch[1].getDataType()) && isTime(ch[2].getDataType()), + "EverEqTtextText: expects (VARCHAR, VARCHAR, UINT64)"); + return withChildren(ch); +} + +SerializableFunction EverEqTtextTextLogicalFunction::serialize() const { + SerializableFunction sf; + sf.set_function_type(std::string(NAME)); + for (auto& p : parameters) *sf.add_children() = p.serialize(); + DataTypeSerializationUtil::serializeDataType(dataType, sf.mutable_data_type()); + return sf; +} + +LogicalFunctionRegistryReturnType +LogicalFunctionGeneratedRegistrar::RegisterEverEqTtextTextLogicalFunction( + LogicalFunctionRegistryArguments arguments) { + PRECONDITION(arguments.children.size() == 3, + "EverEqTtextText expects 3 params, got {}", arguments.children.size()); + return EverEqTtextTextLogicalFunction( + arguments.children[0], arguments.children[1], arguments.children[2]); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverGeTextTtextLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverGeTextTtextLogicalFunction.cpp new file mode 100644 index 0000000000..32514633a9 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverGeTextTtextLogicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES { + +EverGeTextTtextLogicalFunction::EverGeTextTtextLogicalFunction( + LogicalFunction value, LogicalFunction ref, LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { + parameters = {std::move(value), std::move(ref), std::move(ts)}; +} + +DataType EverGeTextTtextLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverGeTextTtextLogicalFunction::withDataType(const DataType& dt) const { + auto c = *this; c.dataType = dt; return c; +} + +std::vector EverGeTextTtextLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverGeTextTtextLogicalFunction::withChildren(const std::vector& ch) const { + PRECONDITION(ch.size() == 3, "EverGeTextTtext expects 3 params, got {}", ch.size()); + auto c = *this; c.parameters = ch; return c; +} + +std::string_view EverGeTextTtextLogicalFunction::getType() const { return NAME; } + +bool EverGeTextTtextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + const auto* o = dynamic_cast(&rhs); + return o && parameters == o->parameters; +} + +std::string EverGeTextTtextLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("EverGeTextTtext({}, {}, {})", + parameters[0].explain(v), parameters[1].explain(v), parameters[2].explain(v)); +} + +LogicalFunction EverGeTextTtextLogicalFunction::withInferredDataType(const Schema& s) const { + std::vector ch; + ch.reserve(3); + for (auto& p : parameters) ch.push_back(p.withInferredDataType(s)); + auto isStr = [](const DataType& dt) { return dt.isType(DataType::Type::VARSIZED); }; + auto isTime = [](const DataType& dt) { return dt.isType(DataType::Type::UINT64); }; + INVARIANT(isStr(ch[0].getDataType()) && isStr(ch[1].getDataType()) && isTime(ch[2].getDataType()), + "EverGeTextTtext: expects (VARCHAR, VARCHAR, UINT64)"); + return withChildren(ch); +} + +SerializableFunction EverGeTextTtextLogicalFunction::serialize() const { + SerializableFunction sf; + sf.set_function_type(std::string(NAME)); + for (auto& p : parameters) *sf.add_children() = p.serialize(); + DataTypeSerializationUtil::serializeDataType(dataType, sf.mutable_data_type()); + return sf; +} + +LogicalFunctionRegistryReturnType +LogicalFunctionGeneratedRegistrar::RegisterEverGeTextTtextLogicalFunction( + LogicalFunctionRegistryArguments arguments) { + PRECONDITION(arguments.children.size() == 3, + "EverGeTextTtext expects 3 params, got {}", arguments.children.size()); + return EverGeTextTtextLogicalFunction( + arguments.children[0], arguments.children[1], arguments.children[2]); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverGeTtextTextLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverGeTtextTextLogicalFunction.cpp new file mode 100644 index 0000000000..9e8108115b --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverGeTtextTextLogicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES { + +EverGeTtextTextLogicalFunction::EverGeTtextTextLogicalFunction( + LogicalFunction value, LogicalFunction ref, LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { + parameters = {std::move(value), std::move(ref), std::move(ts)}; +} + +DataType EverGeTtextTextLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverGeTtextTextLogicalFunction::withDataType(const DataType& dt) const { + auto c = *this; c.dataType = dt; return c; +} + +std::vector EverGeTtextTextLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverGeTtextTextLogicalFunction::withChildren(const std::vector& ch) const { + PRECONDITION(ch.size() == 3, "EverGeTtextText expects 3 params, got {}", ch.size()); + auto c = *this; c.parameters = ch; return c; +} + +std::string_view EverGeTtextTextLogicalFunction::getType() const { return NAME; } + +bool EverGeTtextTextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + const auto* o = dynamic_cast(&rhs); + return o && parameters == o->parameters; +} + +std::string EverGeTtextTextLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("EverGeTtextText({}, {}, {})", + parameters[0].explain(v), parameters[1].explain(v), parameters[2].explain(v)); +} + +LogicalFunction EverGeTtextTextLogicalFunction::withInferredDataType(const Schema& s) const { + std::vector ch; + ch.reserve(3); + for (auto& p : parameters) ch.push_back(p.withInferredDataType(s)); + auto isStr = [](const DataType& dt) { return dt.isType(DataType::Type::VARSIZED); }; + auto isTime = [](const DataType& dt) { return dt.isType(DataType::Type::UINT64); }; + INVARIANT(isStr(ch[0].getDataType()) && isStr(ch[1].getDataType()) && isTime(ch[2].getDataType()), + "EverGeTtextText: expects (VARCHAR, VARCHAR, UINT64)"); + return withChildren(ch); +} + +SerializableFunction EverGeTtextTextLogicalFunction::serialize() const { + SerializableFunction sf; + sf.set_function_type(std::string(NAME)); + for (auto& p : parameters) *sf.add_children() = p.serialize(); + DataTypeSerializationUtil::serializeDataType(dataType, sf.mutable_data_type()); + return sf; +} + +LogicalFunctionRegistryReturnType +LogicalFunctionGeneratedRegistrar::RegisterEverGeTtextTextLogicalFunction( + LogicalFunctionRegistryArguments arguments) { + PRECONDITION(arguments.children.size() == 3, + "EverGeTtextText expects 3 params, got {}", arguments.children.size()); + return EverGeTtextTextLogicalFunction( + arguments.children[0], arguments.children[1], arguments.children[2]); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverGtTextTtextLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverGtTextTtextLogicalFunction.cpp new file mode 100644 index 0000000000..8c77893390 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverGtTextTtextLogicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES { + +EverGtTextTtextLogicalFunction::EverGtTextTtextLogicalFunction( + LogicalFunction value, LogicalFunction ref, LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { + parameters = {std::move(value), std::move(ref), std::move(ts)}; +} + +DataType EverGtTextTtextLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverGtTextTtextLogicalFunction::withDataType(const DataType& dt) const { + auto c = *this; c.dataType = dt; return c; +} + +std::vector EverGtTextTtextLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverGtTextTtextLogicalFunction::withChildren(const std::vector& ch) const { + PRECONDITION(ch.size() == 3, "EverGtTextTtext expects 3 params, got {}", ch.size()); + auto c = *this; c.parameters = ch; return c; +} + +std::string_view EverGtTextTtextLogicalFunction::getType() const { return NAME; } + +bool EverGtTextTtextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + const auto* o = dynamic_cast(&rhs); + return o && parameters == o->parameters; +} + +std::string EverGtTextTtextLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("EverGtTextTtext({}, {}, {})", + parameters[0].explain(v), parameters[1].explain(v), parameters[2].explain(v)); +} + +LogicalFunction EverGtTextTtextLogicalFunction::withInferredDataType(const Schema& s) const { + std::vector ch; + ch.reserve(3); + for (auto& p : parameters) ch.push_back(p.withInferredDataType(s)); + auto isStr = [](const DataType& dt) { return dt.isType(DataType::Type::VARSIZED); }; + auto isTime = [](const DataType& dt) { return dt.isType(DataType::Type::UINT64); }; + INVARIANT(isStr(ch[0].getDataType()) && isStr(ch[1].getDataType()) && isTime(ch[2].getDataType()), + "EverGtTextTtext: expects (VARCHAR, VARCHAR, UINT64)"); + return withChildren(ch); +} + +SerializableFunction EverGtTextTtextLogicalFunction::serialize() const { + SerializableFunction sf; + sf.set_function_type(std::string(NAME)); + for (auto& p : parameters) *sf.add_children() = p.serialize(); + DataTypeSerializationUtil::serializeDataType(dataType, sf.mutable_data_type()); + return sf; +} + +LogicalFunctionRegistryReturnType +LogicalFunctionGeneratedRegistrar::RegisterEverGtTextTtextLogicalFunction( + LogicalFunctionRegistryArguments arguments) { + PRECONDITION(arguments.children.size() == 3, + "EverGtTextTtext expects 3 params, got {}", arguments.children.size()); + return EverGtTextTtextLogicalFunction( + arguments.children[0], arguments.children[1], arguments.children[2]); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverGtTtextTextLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverGtTtextTextLogicalFunction.cpp new file mode 100644 index 0000000000..d5c5d49221 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverGtTtextTextLogicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES { + +EverGtTtextTextLogicalFunction::EverGtTtextTextLogicalFunction( + LogicalFunction value, LogicalFunction ref, LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { + parameters = {std::move(value), std::move(ref), std::move(ts)}; +} + +DataType EverGtTtextTextLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverGtTtextTextLogicalFunction::withDataType(const DataType& dt) const { + auto c = *this; c.dataType = dt; return c; +} + +std::vector EverGtTtextTextLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverGtTtextTextLogicalFunction::withChildren(const std::vector& ch) const { + PRECONDITION(ch.size() == 3, "EverGtTtextText expects 3 params, got {}", ch.size()); + auto c = *this; c.parameters = ch; return c; +} + +std::string_view EverGtTtextTextLogicalFunction::getType() const { return NAME; } + +bool EverGtTtextTextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + const auto* o = dynamic_cast(&rhs); + return o && parameters == o->parameters; +} + +std::string EverGtTtextTextLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("EverGtTtextText({}, {}, {})", + parameters[0].explain(v), parameters[1].explain(v), parameters[2].explain(v)); +} + +LogicalFunction EverGtTtextTextLogicalFunction::withInferredDataType(const Schema& s) const { + std::vector ch; + ch.reserve(3); + for (auto& p : parameters) ch.push_back(p.withInferredDataType(s)); + auto isStr = [](const DataType& dt) { return dt.isType(DataType::Type::VARSIZED); }; + auto isTime = [](const DataType& dt) { return dt.isType(DataType::Type::UINT64); }; + INVARIANT(isStr(ch[0].getDataType()) && isStr(ch[1].getDataType()) && isTime(ch[2].getDataType()), + "EverGtTtextText: expects (VARCHAR, VARCHAR, UINT64)"); + return withChildren(ch); +} + +SerializableFunction EverGtTtextTextLogicalFunction::serialize() const { + SerializableFunction sf; + sf.set_function_type(std::string(NAME)); + for (auto& p : parameters) *sf.add_children() = p.serialize(); + DataTypeSerializationUtil::serializeDataType(dataType, sf.mutable_data_type()); + return sf; +} + +LogicalFunctionRegistryReturnType +LogicalFunctionGeneratedRegistrar::RegisterEverGtTtextTextLogicalFunction( + LogicalFunctionRegistryArguments arguments) { + PRECONDITION(arguments.children.size() == 3, + "EverGtTtextText expects 3 params, got {}", arguments.children.size()); + return EverGtTtextTextLogicalFunction( + arguments.children[0], arguments.children[1], arguments.children[2]); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverLeTextTtextLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverLeTextTtextLogicalFunction.cpp new file mode 100644 index 0000000000..7faac4fac6 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverLeTextTtextLogicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES { + +EverLeTextTtextLogicalFunction::EverLeTextTtextLogicalFunction( + LogicalFunction value, LogicalFunction ref, LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { + parameters = {std::move(value), std::move(ref), std::move(ts)}; +} + +DataType EverLeTextTtextLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverLeTextTtextLogicalFunction::withDataType(const DataType& dt) const { + auto c = *this; c.dataType = dt; return c; +} + +std::vector EverLeTextTtextLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverLeTextTtextLogicalFunction::withChildren(const std::vector& ch) const { + PRECONDITION(ch.size() == 3, "EverLeTextTtext expects 3 params, got {}", ch.size()); + auto c = *this; c.parameters = ch; return c; +} + +std::string_view EverLeTextTtextLogicalFunction::getType() const { return NAME; } + +bool EverLeTextTtextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + const auto* o = dynamic_cast(&rhs); + return o && parameters == o->parameters; +} + +std::string EverLeTextTtextLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("EverLeTextTtext({}, {}, {})", + parameters[0].explain(v), parameters[1].explain(v), parameters[2].explain(v)); +} + +LogicalFunction EverLeTextTtextLogicalFunction::withInferredDataType(const Schema& s) const { + std::vector ch; + ch.reserve(3); + for (auto& p : parameters) ch.push_back(p.withInferredDataType(s)); + auto isStr = [](const DataType& dt) { return dt.isType(DataType::Type::VARSIZED); }; + auto isTime = [](const DataType& dt) { return dt.isType(DataType::Type::UINT64); }; + INVARIANT(isStr(ch[0].getDataType()) && isStr(ch[1].getDataType()) && isTime(ch[2].getDataType()), + "EverLeTextTtext: expects (VARCHAR, VARCHAR, UINT64)"); + return withChildren(ch); +} + +SerializableFunction EverLeTextTtextLogicalFunction::serialize() const { + SerializableFunction sf; + sf.set_function_type(std::string(NAME)); + for (auto& p : parameters) *sf.add_children() = p.serialize(); + DataTypeSerializationUtil::serializeDataType(dataType, sf.mutable_data_type()); + return sf; +} + +LogicalFunctionRegistryReturnType +LogicalFunctionGeneratedRegistrar::RegisterEverLeTextTtextLogicalFunction( + LogicalFunctionRegistryArguments arguments) { + PRECONDITION(arguments.children.size() == 3, + "EverLeTextTtext expects 3 params, got {}", arguments.children.size()); + return EverLeTextTtextLogicalFunction( + arguments.children[0], arguments.children[1], arguments.children[2]); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverLeTtextTextLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverLeTtextTextLogicalFunction.cpp new file mode 100644 index 0000000000..b95fde42b0 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverLeTtextTextLogicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES { + +EverLeTtextTextLogicalFunction::EverLeTtextTextLogicalFunction( + LogicalFunction value, LogicalFunction ref, LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { + parameters = {std::move(value), std::move(ref), std::move(ts)}; +} + +DataType EverLeTtextTextLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverLeTtextTextLogicalFunction::withDataType(const DataType& dt) const { + auto c = *this; c.dataType = dt; return c; +} + +std::vector EverLeTtextTextLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverLeTtextTextLogicalFunction::withChildren(const std::vector& ch) const { + PRECONDITION(ch.size() == 3, "EverLeTtextText expects 3 params, got {}", ch.size()); + auto c = *this; c.parameters = ch; return c; +} + +std::string_view EverLeTtextTextLogicalFunction::getType() const { return NAME; } + +bool EverLeTtextTextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + const auto* o = dynamic_cast(&rhs); + return o && parameters == o->parameters; +} + +std::string EverLeTtextTextLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("EverLeTtextText({}, {}, {})", + parameters[0].explain(v), parameters[1].explain(v), parameters[2].explain(v)); +} + +LogicalFunction EverLeTtextTextLogicalFunction::withInferredDataType(const Schema& s) const { + std::vector ch; + ch.reserve(3); + for (auto& p : parameters) ch.push_back(p.withInferredDataType(s)); + auto isStr = [](const DataType& dt) { return dt.isType(DataType::Type::VARSIZED); }; + auto isTime = [](const DataType& dt) { return dt.isType(DataType::Type::UINT64); }; + INVARIANT(isStr(ch[0].getDataType()) && isStr(ch[1].getDataType()) && isTime(ch[2].getDataType()), + "EverLeTtextText: expects (VARCHAR, VARCHAR, UINT64)"); + return withChildren(ch); +} + +SerializableFunction EverLeTtextTextLogicalFunction::serialize() const { + SerializableFunction sf; + sf.set_function_type(std::string(NAME)); + for (auto& p : parameters) *sf.add_children() = p.serialize(); + DataTypeSerializationUtil::serializeDataType(dataType, sf.mutable_data_type()); + return sf; +} + +LogicalFunctionRegistryReturnType +LogicalFunctionGeneratedRegistrar::RegisterEverLeTtextTextLogicalFunction( + LogicalFunctionRegistryArguments arguments) { + PRECONDITION(arguments.children.size() == 3, + "EverLeTtextText expects 3 params, got {}", arguments.children.size()); + return EverLeTtextTextLogicalFunction( + arguments.children[0], arguments.children[1], arguments.children[2]); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverLtTextTtextLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverLtTextTtextLogicalFunction.cpp new file mode 100644 index 0000000000..0b0e26d872 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverLtTextTtextLogicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES { + +EverLtTextTtextLogicalFunction::EverLtTextTtextLogicalFunction( + LogicalFunction value, LogicalFunction ref, LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { + parameters = {std::move(value), std::move(ref), std::move(ts)}; +} + +DataType EverLtTextTtextLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverLtTextTtextLogicalFunction::withDataType(const DataType& dt) const { + auto c = *this; c.dataType = dt; return c; +} + +std::vector EverLtTextTtextLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverLtTextTtextLogicalFunction::withChildren(const std::vector& ch) const { + PRECONDITION(ch.size() == 3, "EverLtTextTtext expects 3 params, got {}", ch.size()); + auto c = *this; c.parameters = ch; return c; +} + +std::string_view EverLtTextTtextLogicalFunction::getType() const { return NAME; } + +bool EverLtTextTtextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + const auto* o = dynamic_cast(&rhs); + return o && parameters == o->parameters; +} + +std::string EverLtTextTtextLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("EverLtTextTtext({}, {}, {})", + parameters[0].explain(v), parameters[1].explain(v), parameters[2].explain(v)); +} + +LogicalFunction EverLtTextTtextLogicalFunction::withInferredDataType(const Schema& s) const { + std::vector ch; + ch.reserve(3); + for (auto& p : parameters) ch.push_back(p.withInferredDataType(s)); + auto isStr = [](const DataType& dt) { return dt.isType(DataType::Type::VARSIZED); }; + auto isTime = [](const DataType& dt) { return dt.isType(DataType::Type::UINT64); }; + INVARIANT(isStr(ch[0].getDataType()) && isStr(ch[1].getDataType()) && isTime(ch[2].getDataType()), + "EverLtTextTtext: expects (VARCHAR, VARCHAR, UINT64)"); + return withChildren(ch); +} + +SerializableFunction EverLtTextTtextLogicalFunction::serialize() const { + SerializableFunction sf; + sf.set_function_type(std::string(NAME)); + for (auto& p : parameters) *sf.add_children() = p.serialize(); + DataTypeSerializationUtil::serializeDataType(dataType, sf.mutable_data_type()); + return sf; +} + +LogicalFunctionRegistryReturnType +LogicalFunctionGeneratedRegistrar::RegisterEverLtTextTtextLogicalFunction( + LogicalFunctionRegistryArguments arguments) { + PRECONDITION(arguments.children.size() == 3, + "EverLtTextTtext expects 3 params, got {}", arguments.children.size()); + return EverLtTextTtextLogicalFunction( + arguments.children[0], arguments.children[1], arguments.children[2]); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverLtTtextTextLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverLtTtextTextLogicalFunction.cpp new file mode 100644 index 0000000000..2164cb10f1 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverLtTtextTextLogicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES { + +EverLtTtextTextLogicalFunction::EverLtTtextTextLogicalFunction( + LogicalFunction value, LogicalFunction ref, LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { + parameters = {std::move(value), std::move(ref), std::move(ts)}; +} + +DataType EverLtTtextTextLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverLtTtextTextLogicalFunction::withDataType(const DataType& dt) const { + auto c = *this; c.dataType = dt; return c; +} + +std::vector EverLtTtextTextLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverLtTtextTextLogicalFunction::withChildren(const std::vector& ch) const { + PRECONDITION(ch.size() == 3, "EverLtTtextText expects 3 params, got {}", ch.size()); + auto c = *this; c.parameters = ch; return c; +} + +std::string_view EverLtTtextTextLogicalFunction::getType() const { return NAME; } + +bool EverLtTtextTextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + const auto* o = dynamic_cast(&rhs); + return o && parameters == o->parameters; +} + +std::string EverLtTtextTextLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("EverLtTtextText({}, {}, {})", + parameters[0].explain(v), parameters[1].explain(v), parameters[2].explain(v)); +} + +LogicalFunction EverLtTtextTextLogicalFunction::withInferredDataType(const Schema& s) const { + std::vector ch; + ch.reserve(3); + for (auto& p : parameters) ch.push_back(p.withInferredDataType(s)); + auto isStr = [](const DataType& dt) { return dt.isType(DataType::Type::VARSIZED); }; + auto isTime = [](const DataType& dt) { return dt.isType(DataType::Type::UINT64); }; + INVARIANT(isStr(ch[0].getDataType()) && isStr(ch[1].getDataType()) && isTime(ch[2].getDataType()), + "EverLtTtextText: expects (VARCHAR, VARCHAR, UINT64)"); + return withChildren(ch); +} + +SerializableFunction EverLtTtextTextLogicalFunction::serialize() const { + SerializableFunction sf; + sf.set_function_type(std::string(NAME)); + for (auto& p : parameters) *sf.add_children() = p.serialize(); + DataTypeSerializationUtil::serializeDataType(dataType, sf.mutable_data_type()); + return sf; +} + +LogicalFunctionRegistryReturnType +LogicalFunctionGeneratedRegistrar::RegisterEverLtTtextTextLogicalFunction( + LogicalFunctionRegistryArguments arguments) { + PRECONDITION(arguments.children.size() == 3, + "EverLtTtextText expects 3 params, got {}", arguments.children.size()); + return EverLtTtextTextLogicalFunction( + arguments.children[0], arguments.children[1], arguments.children[2]); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverNeTextTtextLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverNeTextTtextLogicalFunction.cpp new file mode 100644 index 0000000000..99558ef377 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverNeTextTtextLogicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES { + +EverNeTextTtextLogicalFunction::EverNeTextTtextLogicalFunction( + LogicalFunction value, LogicalFunction ref, LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { + parameters = {std::move(value), std::move(ref), std::move(ts)}; +} + +DataType EverNeTextTtextLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverNeTextTtextLogicalFunction::withDataType(const DataType& dt) const { + auto c = *this; c.dataType = dt; return c; +} + +std::vector EverNeTextTtextLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverNeTextTtextLogicalFunction::withChildren(const std::vector& ch) const { + PRECONDITION(ch.size() == 3, "EverNeTextTtext expects 3 params, got {}", ch.size()); + auto c = *this; c.parameters = ch; return c; +} + +std::string_view EverNeTextTtextLogicalFunction::getType() const { return NAME; } + +bool EverNeTextTtextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + const auto* o = dynamic_cast(&rhs); + return o && parameters == o->parameters; +} + +std::string EverNeTextTtextLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("EverNeTextTtext({}, {}, {})", + parameters[0].explain(v), parameters[1].explain(v), parameters[2].explain(v)); +} + +LogicalFunction EverNeTextTtextLogicalFunction::withInferredDataType(const Schema& s) const { + std::vector ch; + ch.reserve(3); + for (auto& p : parameters) ch.push_back(p.withInferredDataType(s)); + auto isStr = [](const DataType& dt) { return dt.isType(DataType::Type::VARSIZED); }; + auto isTime = [](const DataType& dt) { return dt.isType(DataType::Type::UINT64); }; + INVARIANT(isStr(ch[0].getDataType()) && isStr(ch[1].getDataType()) && isTime(ch[2].getDataType()), + "EverNeTextTtext: expects (VARCHAR, VARCHAR, UINT64)"); + return withChildren(ch); +} + +SerializableFunction EverNeTextTtextLogicalFunction::serialize() const { + SerializableFunction sf; + sf.set_function_type(std::string(NAME)); + for (auto& p : parameters) *sf.add_children() = p.serialize(); + DataTypeSerializationUtil::serializeDataType(dataType, sf.mutable_data_type()); + return sf; +} + +LogicalFunctionRegistryReturnType +LogicalFunctionGeneratedRegistrar::RegisterEverNeTextTtextLogicalFunction( + LogicalFunctionRegistryArguments arguments) { + PRECONDITION(arguments.children.size() == 3, + "EverNeTextTtext expects 3 params, got {}", arguments.children.size()); + return EverNeTextTtextLogicalFunction( + arguments.children[0], arguments.children[1], arguments.children[2]); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverNeTtextTextLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverNeTtextTextLogicalFunction.cpp new file mode 100644 index 0000000000..b0b5c15c44 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverNeTtextTextLogicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES { + +EverNeTtextTextLogicalFunction::EverNeTtextTextLogicalFunction( + LogicalFunction value, LogicalFunction ref, LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { + parameters = {std::move(value), std::move(ref), std::move(ts)}; +} + +DataType EverNeTtextTextLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverNeTtextTextLogicalFunction::withDataType(const DataType& dt) const { + auto c = *this; c.dataType = dt; return c; +} + +std::vector EverNeTtextTextLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverNeTtextTextLogicalFunction::withChildren(const std::vector& ch) const { + PRECONDITION(ch.size() == 3, "EverNeTtextText expects 3 params, got {}", ch.size()); + auto c = *this; c.parameters = ch; return c; +} + +std::string_view EverNeTtextTextLogicalFunction::getType() const { return NAME; } + +bool EverNeTtextTextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + const auto* o = dynamic_cast(&rhs); + return o && parameters == o->parameters; +} + +std::string EverNeTtextTextLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("EverNeTtextText({}, {}, {})", + parameters[0].explain(v), parameters[1].explain(v), parameters[2].explain(v)); +} + +LogicalFunction EverNeTtextTextLogicalFunction::withInferredDataType(const Schema& s) const { + std::vector ch; + ch.reserve(3); + for (auto& p : parameters) ch.push_back(p.withInferredDataType(s)); + auto isStr = [](const DataType& dt) { return dt.isType(DataType::Type::VARSIZED); }; + auto isTime = [](const DataType& dt) { return dt.isType(DataType::Type::UINT64); }; + INVARIANT(isStr(ch[0].getDataType()) && isStr(ch[1].getDataType()) && isTime(ch[2].getDataType()), + "EverNeTtextText: expects (VARCHAR, VARCHAR, UINT64)"); + return withChildren(ch); +} + +SerializableFunction EverNeTtextTextLogicalFunction::serialize() const { + SerializableFunction sf; + sf.set_function_type(std::string(NAME)); + for (auto& p : parameters) *sf.add_children() = p.serialize(); + DataTypeSerializationUtil::serializeDataType(dataType, sf.mutable_data_type()); + return sf; +} + +LogicalFunctionRegistryReturnType +LogicalFunctionGeneratedRegistrar::RegisterEverNeTtextTextLogicalFunction( + LogicalFunctionRegistryArguments arguments) { + PRECONDITION(arguments.children.size() == 3, + "EverNeTtextText expects 3 params, got {}", arguments.children.size()); + return EverNeTtextTextLogicalFunction( + arguments.children[0], arguments.children[1], arguments.children[2]); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TeqTextTtextLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TeqTextTtextLogicalFunction.cpp new file mode 100644 index 0000000000..8af4dab43a --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TeqTextTtextLogicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES { + +TeqTextTtextLogicalFunction::TeqTextTtextLogicalFunction( + LogicalFunction value, LogicalFunction ref, LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { + parameters = {std::move(value), std::move(ref), std::move(ts)}; +} + +DataType TeqTextTtextLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction TeqTextTtextLogicalFunction::withDataType(const DataType& dt) const { + auto c = *this; c.dataType = dt; return c; +} + +std::vector TeqTextTtextLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction TeqTextTtextLogicalFunction::withChildren(const std::vector& ch) const { + PRECONDITION(ch.size() == 3, "TeqTextTtext expects 3 params, got {}", ch.size()); + auto c = *this; c.parameters = ch; return c; +} + +std::string_view TeqTextTtextLogicalFunction::getType() const { return NAME; } + +bool TeqTextTtextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + const auto* o = dynamic_cast(&rhs); + return o && parameters == o->parameters; +} + +std::string TeqTextTtextLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("TeqTextTtext({}, {}, {})", + parameters[0].explain(v), parameters[1].explain(v), parameters[2].explain(v)); +} + +LogicalFunction TeqTextTtextLogicalFunction::withInferredDataType(const Schema& s) const { + std::vector ch; + ch.reserve(3); + for (auto& p : parameters) ch.push_back(p.withInferredDataType(s)); + auto isStr = [](const DataType& dt) { return dt.isType(DataType::Type::VARSIZED); }; + auto isTime = [](const DataType& dt) { return dt.isType(DataType::Type::UINT64); }; + INVARIANT(isStr(ch[0].getDataType()) && isStr(ch[1].getDataType()) && isTime(ch[2].getDataType()), + "TeqTextTtext: expects (VARCHAR, VARCHAR, UINT64)"); + return withChildren(ch); +} + +SerializableFunction TeqTextTtextLogicalFunction::serialize() const { + SerializableFunction sf; + sf.set_function_type(std::string(NAME)); + for (auto& p : parameters) *sf.add_children() = p.serialize(); + DataTypeSerializationUtil::serializeDataType(dataType, sf.mutable_data_type()); + return sf; +} + +LogicalFunctionRegistryReturnType +LogicalFunctionGeneratedRegistrar::RegisterTeqTextTtextLogicalFunction( + LogicalFunctionRegistryArguments arguments) { + PRECONDITION(arguments.children.size() == 3, + "TeqTextTtext expects 3 params, got {}", arguments.children.size()); + return TeqTextTtextLogicalFunction( + arguments.children[0], arguments.children[1], arguments.children[2]); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TeqTtextTextLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TeqTtextTextLogicalFunction.cpp new file mode 100644 index 0000000000..3b4889b29c --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TeqTtextTextLogicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES { + +TeqTtextTextLogicalFunction::TeqTtextTextLogicalFunction( + LogicalFunction value, LogicalFunction ref, LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { + parameters = {std::move(value), std::move(ref), std::move(ts)}; +} + +DataType TeqTtextTextLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction TeqTtextTextLogicalFunction::withDataType(const DataType& dt) const { + auto c = *this; c.dataType = dt; return c; +} + +std::vector TeqTtextTextLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction TeqTtextTextLogicalFunction::withChildren(const std::vector& ch) const { + PRECONDITION(ch.size() == 3, "TeqTtextText expects 3 params, got {}", ch.size()); + auto c = *this; c.parameters = ch; return c; +} + +std::string_view TeqTtextTextLogicalFunction::getType() const { return NAME; } + +bool TeqTtextTextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + const auto* o = dynamic_cast(&rhs); + return o && parameters == o->parameters; +} + +std::string TeqTtextTextLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("TeqTtextText({}, {}, {})", + parameters[0].explain(v), parameters[1].explain(v), parameters[2].explain(v)); +} + +LogicalFunction TeqTtextTextLogicalFunction::withInferredDataType(const Schema& s) const { + std::vector ch; + ch.reserve(3); + for (auto& p : parameters) ch.push_back(p.withInferredDataType(s)); + auto isStr = [](const DataType& dt) { return dt.isType(DataType::Type::VARSIZED); }; + auto isTime = [](const DataType& dt) { return dt.isType(DataType::Type::UINT64); }; + INVARIANT(isStr(ch[0].getDataType()) && isStr(ch[1].getDataType()) && isTime(ch[2].getDataType()), + "TeqTtextText: expects (VARCHAR, VARCHAR, UINT64)"); + return withChildren(ch); +} + +SerializableFunction TeqTtextTextLogicalFunction::serialize() const { + SerializableFunction sf; + sf.set_function_type(std::string(NAME)); + for (auto& p : parameters) *sf.add_children() = p.serialize(); + DataTypeSerializationUtil::serializeDataType(dataType, sf.mutable_data_type()); + return sf; +} + +LogicalFunctionRegistryReturnType +LogicalFunctionGeneratedRegistrar::RegisterTeqTtextTextLogicalFunction( + LogicalFunctionRegistryArguments arguments) { + PRECONDITION(arguments.children.size() == 3, + "TeqTtextText expects 3 params, got {}", arguments.children.size()); + return TeqTtextTextLogicalFunction( + arguments.children[0], arguments.children[1], arguments.children[2]); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TneTextTtextLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TneTextTtextLogicalFunction.cpp new file mode 100644 index 0000000000..544b93b5ee --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TneTextTtextLogicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES { + +TneTextTtextLogicalFunction::TneTextTtextLogicalFunction( + LogicalFunction value, LogicalFunction ref, LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { + parameters = {std::move(value), std::move(ref), std::move(ts)}; +} + +DataType TneTextTtextLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction TneTextTtextLogicalFunction::withDataType(const DataType& dt) const { + auto c = *this; c.dataType = dt; return c; +} + +std::vector TneTextTtextLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction TneTextTtextLogicalFunction::withChildren(const std::vector& ch) const { + PRECONDITION(ch.size() == 3, "TneTextTtext expects 3 params, got {}", ch.size()); + auto c = *this; c.parameters = ch; return c; +} + +std::string_view TneTextTtextLogicalFunction::getType() const { return NAME; } + +bool TneTextTtextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + const auto* o = dynamic_cast(&rhs); + return o && parameters == o->parameters; +} + +std::string TneTextTtextLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("TneTextTtext({}, {}, {})", + parameters[0].explain(v), parameters[1].explain(v), parameters[2].explain(v)); +} + +LogicalFunction TneTextTtextLogicalFunction::withInferredDataType(const Schema& s) const { + std::vector ch; + ch.reserve(3); + for (auto& p : parameters) ch.push_back(p.withInferredDataType(s)); + auto isStr = [](const DataType& dt) { return dt.isType(DataType::Type::VARSIZED); }; + auto isTime = [](const DataType& dt) { return dt.isType(DataType::Type::UINT64); }; + INVARIANT(isStr(ch[0].getDataType()) && isStr(ch[1].getDataType()) && isTime(ch[2].getDataType()), + "TneTextTtext: expects (VARCHAR, VARCHAR, UINT64)"); + return withChildren(ch); +} + +SerializableFunction TneTextTtextLogicalFunction::serialize() const { + SerializableFunction sf; + sf.set_function_type(std::string(NAME)); + for (auto& p : parameters) *sf.add_children() = p.serialize(); + DataTypeSerializationUtil::serializeDataType(dataType, sf.mutable_data_type()); + return sf; +} + +LogicalFunctionRegistryReturnType +LogicalFunctionGeneratedRegistrar::RegisterTneTextTtextLogicalFunction( + LogicalFunctionRegistryArguments arguments) { + PRECONDITION(arguments.children.size() == 3, + "TneTextTtext expects 3 params, got {}", arguments.children.size()); + return TneTextTtextLogicalFunction( + arguments.children[0], arguments.children[1], arguments.children[2]); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TneTtextTextLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TneTtextTextLogicalFunction.cpp new file mode 100644 index 0000000000..7eacd1ff1a --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TneTtextTextLogicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES { + +TneTtextTextLogicalFunction::TneTtextTextLogicalFunction( + LogicalFunction value, LogicalFunction ref, LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { + parameters = {std::move(value), std::move(ref), std::move(ts)}; +} + +DataType TneTtextTextLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction TneTtextTextLogicalFunction::withDataType(const DataType& dt) const { + auto c = *this; c.dataType = dt; return c; +} + +std::vector TneTtextTextLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction TneTtextTextLogicalFunction::withChildren(const std::vector& ch) const { + PRECONDITION(ch.size() == 3, "TneTtextText expects 3 params, got {}", ch.size()); + auto c = *this; c.parameters = ch; return c; +} + +std::string_view TneTtextTextLogicalFunction::getType() const { return NAME; } + +bool TneTtextTextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + const auto* o = dynamic_cast(&rhs); + return o && parameters == o->parameters; +} + +std::string TneTtextTextLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("TneTtextText({}, {}, {})", + parameters[0].explain(v), parameters[1].explain(v), parameters[2].explain(v)); +} + +LogicalFunction TneTtextTextLogicalFunction::withInferredDataType(const Schema& s) const { + std::vector ch; + ch.reserve(3); + for (auto& p : parameters) ch.push_back(p.withInferredDataType(s)); + auto isStr = [](const DataType& dt) { return dt.isType(DataType::Type::VARSIZED); }; + auto isTime = [](const DataType& dt) { return dt.isType(DataType::Type::UINT64); }; + INVARIANT(isStr(ch[0].getDataType()) && isStr(ch[1].getDataType()) && isTime(ch[2].getDataType()), + "TneTtextText: expects (VARCHAR, VARCHAR, UINT64)"); + return withChildren(ch); +} + +SerializableFunction TneTtextTextLogicalFunction::serialize() const { + SerializableFunction sf; + sf.set_function_type(std::string(NAME)); + for (auto& p : parameters) *sf.add_children() = p.serialize(); + DataTypeSerializationUtil::serializeDataType(dataType, sf.mutable_data_type()); + return sf; +} + +LogicalFunctionRegistryReturnType +LogicalFunctionGeneratedRegistrar::RegisterTneTtextTextLogicalFunction( + LogicalFunctionRegistryArguments arguments) { + PRECONDITION(arguments.children.size() == 3, + "TneTtextText expects 3 params, got {}", arguments.children.size()); + return TneTtextTextLogicalFunction( + arguments.children[0], arguments.children[1], arguments.children[2]); +} + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysEqTextTtextPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysEqTextTtextPhysicalFunction.hpp new file mode 100644 index 0000000000..c153240e8c --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysEqTextTtextPhysicalFunction.hpp @@ -0,0 +1,36 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class AlwaysEqTextTtextPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysEqTextTtextPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction refFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysEqTtextTextPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysEqTtextTextPhysicalFunction.hpp new file mode 100644 index 0000000000..bb18e0e23b --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysEqTtextTextPhysicalFunction.hpp @@ -0,0 +1,36 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class AlwaysEqTtextTextPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysEqTtextTextPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction refFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysGeTextTtextPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysGeTextTtextPhysicalFunction.hpp new file mode 100644 index 0000000000..af0e9f151f --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysGeTextTtextPhysicalFunction.hpp @@ -0,0 +1,36 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class AlwaysGeTextTtextPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysGeTextTtextPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction refFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysGeTtextTextPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysGeTtextTextPhysicalFunction.hpp new file mode 100644 index 0000000000..532634173a --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysGeTtextTextPhysicalFunction.hpp @@ -0,0 +1,36 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class AlwaysGeTtextTextPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysGeTtextTextPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction refFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysGtTextTtextPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysGtTextTtextPhysicalFunction.hpp new file mode 100644 index 0000000000..bfd56b4d06 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysGtTextTtextPhysicalFunction.hpp @@ -0,0 +1,36 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class AlwaysGtTextTtextPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysGtTextTtextPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction refFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysGtTtextTextPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysGtTtextTextPhysicalFunction.hpp new file mode 100644 index 0000000000..0eefe82b23 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysGtTtextTextPhysicalFunction.hpp @@ -0,0 +1,36 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class AlwaysGtTtextTextPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysGtTtextTextPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction refFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysLeTextTtextPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysLeTextTtextPhysicalFunction.hpp new file mode 100644 index 0000000000..8926066803 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysLeTextTtextPhysicalFunction.hpp @@ -0,0 +1,36 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class AlwaysLeTextTtextPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysLeTextTtextPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction refFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysLeTtextTextPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysLeTtextTextPhysicalFunction.hpp new file mode 100644 index 0000000000..0458033afd --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysLeTtextTextPhysicalFunction.hpp @@ -0,0 +1,36 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class AlwaysLeTtextTextPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysLeTtextTextPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction refFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysLtTextTtextPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysLtTextTtextPhysicalFunction.hpp new file mode 100644 index 0000000000..d4f63548ce --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysLtTextTtextPhysicalFunction.hpp @@ -0,0 +1,36 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class AlwaysLtTextTtextPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysLtTextTtextPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction refFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysLtTtextTextPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysLtTtextTextPhysicalFunction.hpp new file mode 100644 index 0000000000..9c3f5862d3 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysLtTtextTextPhysicalFunction.hpp @@ -0,0 +1,36 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class AlwaysLtTtextTextPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysLtTtextTextPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction refFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysNeTextTtextPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysNeTextTtextPhysicalFunction.hpp new file mode 100644 index 0000000000..30bb284e6d --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysNeTextTtextPhysicalFunction.hpp @@ -0,0 +1,36 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class AlwaysNeTextTtextPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysNeTextTtextPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction refFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysNeTtextTextPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysNeTtextTextPhysicalFunction.hpp new file mode 100644 index 0000000000..22d74b1704 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysNeTtextTextPhysicalFunction.hpp @@ -0,0 +1,36 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class AlwaysNeTtextTextPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysNeTtextTextPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction refFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverEqTextTtextPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverEqTextTtextPhysicalFunction.hpp new file mode 100644 index 0000000000..219398d2d4 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverEqTextTtextPhysicalFunction.hpp @@ -0,0 +1,36 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class EverEqTextTtextPhysicalFunction : public PhysicalFunctionConcept { +public: + EverEqTextTtextPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction refFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverEqTtextTextPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverEqTtextTextPhysicalFunction.hpp new file mode 100644 index 0000000000..28c8346c06 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverEqTtextTextPhysicalFunction.hpp @@ -0,0 +1,36 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class EverEqTtextTextPhysicalFunction : public PhysicalFunctionConcept { +public: + EverEqTtextTextPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction refFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverGeTextTtextPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverGeTextTtextPhysicalFunction.hpp new file mode 100644 index 0000000000..c033017647 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverGeTextTtextPhysicalFunction.hpp @@ -0,0 +1,36 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class EverGeTextTtextPhysicalFunction : public PhysicalFunctionConcept { +public: + EverGeTextTtextPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction refFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverGeTtextTextPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverGeTtextTextPhysicalFunction.hpp new file mode 100644 index 0000000000..e75180efa1 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverGeTtextTextPhysicalFunction.hpp @@ -0,0 +1,36 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class EverGeTtextTextPhysicalFunction : public PhysicalFunctionConcept { +public: + EverGeTtextTextPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction refFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverGtTextTtextPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverGtTextTtextPhysicalFunction.hpp new file mode 100644 index 0000000000..9b919651de --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverGtTextTtextPhysicalFunction.hpp @@ -0,0 +1,36 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class EverGtTextTtextPhysicalFunction : public PhysicalFunctionConcept { +public: + EverGtTextTtextPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction refFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverGtTtextTextPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverGtTtextTextPhysicalFunction.hpp new file mode 100644 index 0000000000..e9cb4b2425 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverGtTtextTextPhysicalFunction.hpp @@ -0,0 +1,36 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class EverGtTtextTextPhysicalFunction : public PhysicalFunctionConcept { +public: + EverGtTtextTextPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction refFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverLeTextTtextPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverLeTextTtextPhysicalFunction.hpp new file mode 100644 index 0000000000..5b13de2733 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverLeTextTtextPhysicalFunction.hpp @@ -0,0 +1,36 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class EverLeTextTtextPhysicalFunction : public PhysicalFunctionConcept { +public: + EverLeTextTtextPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction refFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverLeTtextTextPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverLeTtextTextPhysicalFunction.hpp new file mode 100644 index 0000000000..9b40274844 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverLeTtextTextPhysicalFunction.hpp @@ -0,0 +1,36 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class EverLeTtextTextPhysicalFunction : public PhysicalFunctionConcept { +public: + EverLeTtextTextPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction refFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverLtTextTtextPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverLtTextTtextPhysicalFunction.hpp new file mode 100644 index 0000000000..ff1d4e1de3 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverLtTextTtextPhysicalFunction.hpp @@ -0,0 +1,36 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class EverLtTextTtextPhysicalFunction : public PhysicalFunctionConcept { +public: + EverLtTextTtextPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction refFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverLtTtextTextPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverLtTtextTextPhysicalFunction.hpp new file mode 100644 index 0000000000..d3f18c8fd8 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverLtTtextTextPhysicalFunction.hpp @@ -0,0 +1,36 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class EverLtTtextTextPhysicalFunction : public PhysicalFunctionConcept { +public: + EverLtTtextTextPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction refFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverNeTextTtextPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverNeTextTtextPhysicalFunction.hpp new file mode 100644 index 0000000000..43f3c09e8e --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverNeTextTtextPhysicalFunction.hpp @@ -0,0 +1,36 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class EverNeTextTtextPhysicalFunction : public PhysicalFunctionConcept { +public: + EverNeTextTtextPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction refFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverNeTtextTextPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverNeTtextTextPhysicalFunction.hpp new file mode 100644 index 0000000000..729ae700a2 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverNeTtextTextPhysicalFunction.hpp @@ -0,0 +1,36 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class EverNeTtextTextPhysicalFunction : public PhysicalFunctionConcept { +public: + EverNeTtextTextPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction refFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TeqTextTtextPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TeqTextTtextPhysicalFunction.hpp new file mode 100644 index 0000000000..0493ddbfe0 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TeqTextTtextPhysicalFunction.hpp @@ -0,0 +1,36 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class TeqTextTtextPhysicalFunction : public PhysicalFunctionConcept { +public: + TeqTextTtextPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction refFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TeqTtextTextPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TeqTtextTextPhysicalFunction.hpp new file mode 100644 index 0000000000..61ae8ba132 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TeqTtextTextPhysicalFunction.hpp @@ -0,0 +1,36 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class TeqTtextTextPhysicalFunction : public PhysicalFunctionConcept { +public: + TeqTtextTextPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction refFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TneTextTtextPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TneTextTtextPhysicalFunction.hpp new file mode 100644 index 0000000000..ec18b8bbd9 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TneTextTtextPhysicalFunction.hpp @@ -0,0 +1,36 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class TneTextTtextPhysicalFunction : public PhysicalFunctionConcept { +public: + TneTextTtextPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction refFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TneTtextTextPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TneTtextTextPhysicalFunction.hpp new file mode 100644 index 0000000000..99e46706ba --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TneTtextTextPhysicalFunction.hpp @@ -0,0 +1,36 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class TneTtextTextPhysicalFunction : public PhysicalFunctionConcept { +public: + TneTtextTextPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction refFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysEqTextTtextPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysEqTextTtextPhysicalFunction.cpp new file mode 100644 index 0000000000..1d0db7a137 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysEqTextTtextPhysicalFunction.cpp @@ -0,0 +1,90 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +} + +namespace NES { + +AlwaysEqTextTtextPhysicalFunction::AlwaysEqTextTtextPhysicalFunction( + PhysicalFunction valueFunction, PhysicalFunction refFunction, PhysicalFunction tsFunction) +{ + paramFns.reserve(3); + paramFns.push_back(std::move(valueFunction)); + paramFns.push_back(std::move(refFunction)); + paramFns.push_back(std::move(tsFunction)); +} + +VarVal AlwaysEqTextTtextPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto ref = paramFns[0].execute(record, arena).cast(); + auto value = paramFns[1].execute(record, arena).cast(); + auto ts = paramFns[2].execute(record, arena).cast>(); + + const auto result = nautilus::invoke( + +[](const char* r, uint32_t rsz, const char* v, uint32_t vsz, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ref_str(r, rsz); + std::string val_str(v, vsz); + while (!ref_str.empty() && (ref_str.front() == '\'' || ref_str.front() == '"')) ref_str = ref_str.substr(1); + while (!ref_str.empty() && (ref_str.back() == '\'' || ref_str.back() == '"')) ref_str = ref_str.substr(0, ref_str.size()-1); + while (!val_str.empty() && (val_str.front() == '\'' || val_str.front() == '"')) val_str = val_str.substr(1); + while (!val_str.empty() && (val_str.back() == '\'' || val_str.back() == '"')) val_str = val_str.substr(0, val_str.size()-1); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = "'" + val_str + "'@" + ts_str; + Temporal* temp = ttext_in(wkt.c_str()); + if (!temp) return 0.0; + text* txt = cstring_to_text(ref_str.c_str()); + if (!txt) { free(temp); return 0.0; } + int result = always_eq_text_ttext(txt, temp); + free(temp); + free(txt); + return static_cast(result); + } catch (const std::exception&) { return 0.0; } + }, + ref, value, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysEqTextTtextPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "AlwaysEqTextTtextPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + return AlwaysEqTextTtextPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysEqTtextTextPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysEqTtextTextPhysicalFunction.cpp new file mode 100644 index 0000000000..93bdd51e9e --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysEqTtextTextPhysicalFunction.cpp @@ -0,0 +1,90 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +} + +namespace NES { + +AlwaysEqTtextTextPhysicalFunction::AlwaysEqTtextTextPhysicalFunction( + PhysicalFunction valueFunction, PhysicalFunction refFunction, PhysicalFunction tsFunction) +{ + paramFns.reserve(3); + paramFns.push_back(std::move(valueFunction)); + paramFns.push_back(std::move(refFunction)); + paramFns.push_back(std::move(tsFunction)); +} + +VarVal AlwaysEqTtextTextPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto value = paramFns[0].execute(record, arena).cast(); + auto ref = paramFns[1].execute(record, arena).cast(); + auto ts = paramFns[2].execute(record, arena).cast>(); + + const auto result = nautilus::invoke( + +[](const char* v, uint32_t vsz, const char* r, uint32_t rsz, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string val_str(v, vsz); + std::string ref_str(r, rsz); + while (!val_str.empty() && (val_str.front() == '\'' || val_str.front() == '"')) val_str = val_str.substr(1); + while (!val_str.empty() && (val_str.back() == '\'' || val_str.back() == '"')) val_str = val_str.substr(0, val_str.size()-1); + while (!ref_str.empty() && (ref_str.front() == '\'' || ref_str.front() == '"')) ref_str = ref_str.substr(1); + while (!ref_str.empty() && (ref_str.back() == '\'' || ref_str.back() == '"')) ref_str = ref_str.substr(0, ref_str.size()-1); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = "'" + val_str + "'@" + ts_str; + Temporal* temp = ttext_in(wkt.c_str()); + if (!temp) return 0.0; + text* txt = cstring_to_text(ref_str.c_str()); + if (!txt) { free(temp); return 0.0; } + int result = always_eq_ttext_text(temp, txt); + free(temp); + free(txt); + return static_cast(result); + } catch (const std::exception&) { return 0.0; } + }, + value, ref, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysEqTtextTextPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "AlwaysEqTtextTextPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + return AlwaysEqTtextTextPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysGeTextTtextPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysGeTextTtextPhysicalFunction.cpp new file mode 100644 index 0000000000..955a72eb30 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysGeTextTtextPhysicalFunction.cpp @@ -0,0 +1,90 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +} + +namespace NES { + +AlwaysGeTextTtextPhysicalFunction::AlwaysGeTextTtextPhysicalFunction( + PhysicalFunction valueFunction, PhysicalFunction refFunction, PhysicalFunction tsFunction) +{ + paramFns.reserve(3); + paramFns.push_back(std::move(valueFunction)); + paramFns.push_back(std::move(refFunction)); + paramFns.push_back(std::move(tsFunction)); +} + +VarVal AlwaysGeTextTtextPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto ref = paramFns[0].execute(record, arena).cast(); + auto value = paramFns[1].execute(record, arena).cast(); + auto ts = paramFns[2].execute(record, arena).cast>(); + + const auto result = nautilus::invoke( + +[](const char* r, uint32_t rsz, const char* v, uint32_t vsz, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ref_str(r, rsz); + std::string val_str(v, vsz); + while (!ref_str.empty() && (ref_str.front() == '\'' || ref_str.front() == '"')) ref_str = ref_str.substr(1); + while (!ref_str.empty() && (ref_str.back() == '\'' || ref_str.back() == '"')) ref_str = ref_str.substr(0, ref_str.size()-1); + while (!val_str.empty() && (val_str.front() == '\'' || val_str.front() == '"')) val_str = val_str.substr(1); + while (!val_str.empty() && (val_str.back() == '\'' || val_str.back() == '"')) val_str = val_str.substr(0, val_str.size()-1); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = "'" + val_str + "'@" + ts_str; + Temporal* temp = ttext_in(wkt.c_str()); + if (!temp) return 0.0; + text* txt = cstring_to_text(ref_str.c_str()); + if (!txt) { free(temp); return 0.0; } + int result = always_ge_text_ttext(txt, temp); + free(temp); + free(txt); + return static_cast(result); + } catch (const std::exception&) { return 0.0; } + }, + ref, value, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysGeTextTtextPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "AlwaysGeTextTtextPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + return AlwaysGeTextTtextPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysGeTtextTextPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysGeTtextTextPhysicalFunction.cpp new file mode 100644 index 0000000000..403605380d --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysGeTtextTextPhysicalFunction.cpp @@ -0,0 +1,90 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +} + +namespace NES { + +AlwaysGeTtextTextPhysicalFunction::AlwaysGeTtextTextPhysicalFunction( + PhysicalFunction valueFunction, PhysicalFunction refFunction, PhysicalFunction tsFunction) +{ + paramFns.reserve(3); + paramFns.push_back(std::move(valueFunction)); + paramFns.push_back(std::move(refFunction)); + paramFns.push_back(std::move(tsFunction)); +} + +VarVal AlwaysGeTtextTextPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto value = paramFns[0].execute(record, arena).cast(); + auto ref = paramFns[1].execute(record, arena).cast(); + auto ts = paramFns[2].execute(record, arena).cast>(); + + const auto result = nautilus::invoke( + +[](const char* v, uint32_t vsz, const char* r, uint32_t rsz, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string val_str(v, vsz); + std::string ref_str(r, rsz); + while (!val_str.empty() && (val_str.front() == '\'' || val_str.front() == '"')) val_str = val_str.substr(1); + while (!val_str.empty() && (val_str.back() == '\'' || val_str.back() == '"')) val_str = val_str.substr(0, val_str.size()-1); + while (!ref_str.empty() && (ref_str.front() == '\'' || ref_str.front() == '"')) ref_str = ref_str.substr(1); + while (!ref_str.empty() && (ref_str.back() == '\'' || ref_str.back() == '"')) ref_str = ref_str.substr(0, ref_str.size()-1); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = "'" + val_str + "'@" + ts_str; + Temporal* temp = ttext_in(wkt.c_str()); + if (!temp) return 0.0; + text* txt = cstring_to_text(ref_str.c_str()); + if (!txt) { free(temp); return 0.0; } + int result = always_ge_ttext_text(temp, txt); + free(temp); + free(txt); + return static_cast(result); + } catch (const std::exception&) { return 0.0; } + }, + value, ref, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysGeTtextTextPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "AlwaysGeTtextTextPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + return AlwaysGeTtextTextPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysGtTextTtextPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysGtTextTtextPhysicalFunction.cpp new file mode 100644 index 0000000000..e2627e708b --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysGtTextTtextPhysicalFunction.cpp @@ -0,0 +1,90 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +} + +namespace NES { + +AlwaysGtTextTtextPhysicalFunction::AlwaysGtTextTtextPhysicalFunction( + PhysicalFunction valueFunction, PhysicalFunction refFunction, PhysicalFunction tsFunction) +{ + paramFns.reserve(3); + paramFns.push_back(std::move(valueFunction)); + paramFns.push_back(std::move(refFunction)); + paramFns.push_back(std::move(tsFunction)); +} + +VarVal AlwaysGtTextTtextPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto ref = paramFns[0].execute(record, arena).cast(); + auto value = paramFns[1].execute(record, arena).cast(); + auto ts = paramFns[2].execute(record, arena).cast>(); + + const auto result = nautilus::invoke( + +[](const char* r, uint32_t rsz, const char* v, uint32_t vsz, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ref_str(r, rsz); + std::string val_str(v, vsz); + while (!ref_str.empty() && (ref_str.front() == '\'' || ref_str.front() == '"')) ref_str = ref_str.substr(1); + while (!ref_str.empty() && (ref_str.back() == '\'' || ref_str.back() == '"')) ref_str = ref_str.substr(0, ref_str.size()-1); + while (!val_str.empty() && (val_str.front() == '\'' || val_str.front() == '"')) val_str = val_str.substr(1); + while (!val_str.empty() && (val_str.back() == '\'' || val_str.back() == '"')) val_str = val_str.substr(0, val_str.size()-1); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = "'" + val_str + "'@" + ts_str; + Temporal* temp = ttext_in(wkt.c_str()); + if (!temp) return 0.0; + text* txt = cstring_to_text(ref_str.c_str()); + if (!txt) { free(temp); return 0.0; } + int result = always_gt_text_ttext(txt, temp); + free(temp); + free(txt); + return static_cast(result); + } catch (const std::exception&) { return 0.0; } + }, + ref, value, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysGtTextTtextPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "AlwaysGtTextTtextPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + return AlwaysGtTextTtextPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysGtTtextTextPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysGtTtextTextPhysicalFunction.cpp new file mode 100644 index 0000000000..e2743d07c7 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysGtTtextTextPhysicalFunction.cpp @@ -0,0 +1,90 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +} + +namespace NES { + +AlwaysGtTtextTextPhysicalFunction::AlwaysGtTtextTextPhysicalFunction( + PhysicalFunction valueFunction, PhysicalFunction refFunction, PhysicalFunction tsFunction) +{ + paramFns.reserve(3); + paramFns.push_back(std::move(valueFunction)); + paramFns.push_back(std::move(refFunction)); + paramFns.push_back(std::move(tsFunction)); +} + +VarVal AlwaysGtTtextTextPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto value = paramFns[0].execute(record, arena).cast(); + auto ref = paramFns[1].execute(record, arena).cast(); + auto ts = paramFns[2].execute(record, arena).cast>(); + + const auto result = nautilus::invoke( + +[](const char* v, uint32_t vsz, const char* r, uint32_t rsz, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string val_str(v, vsz); + std::string ref_str(r, rsz); + while (!val_str.empty() && (val_str.front() == '\'' || val_str.front() == '"')) val_str = val_str.substr(1); + while (!val_str.empty() && (val_str.back() == '\'' || val_str.back() == '"')) val_str = val_str.substr(0, val_str.size()-1); + while (!ref_str.empty() && (ref_str.front() == '\'' || ref_str.front() == '"')) ref_str = ref_str.substr(1); + while (!ref_str.empty() && (ref_str.back() == '\'' || ref_str.back() == '"')) ref_str = ref_str.substr(0, ref_str.size()-1); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = "'" + val_str + "'@" + ts_str; + Temporal* temp = ttext_in(wkt.c_str()); + if (!temp) return 0.0; + text* txt = cstring_to_text(ref_str.c_str()); + if (!txt) { free(temp); return 0.0; } + int result = always_gt_ttext_text(temp, txt); + free(temp); + free(txt); + return static_cast(result); + } catch (const std::exception&) { return 0.0; } + }, + value, ref, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysGtTtextTextPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "AlwaysGtTtextTextPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + return AlwaysGtTtextTextPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysLeTextTtextPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysLeTextTtextPhysicalFunction.cpp new file mode 100644 index 0000000000..0e5a9d1aee --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysLeTextTtextPhysicalFunction.cpp @@ -0,0 +1,90 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +} + +namespace NES { + +AlwaysLeTextTtextPhysicalFunction::AlwaysLeTextTtextPhysicalFunction( + PhysicalFunction valueFunction, PhysicalFunction refFunction, PhysicalFunction tsFunction) +{ + paramFns.reserve(3); + paramFns.push_back(std::move(valueFunction)); + paramFns.push_back(std::move(refFunction)); + paramFns.push_back(std::move(tsFunction)); +} + +VarVal AlwaysLeTextTtextPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto ref = paramFns[0].execute(record, arena).cast(); + auto value = paramFns[1].execute(record, arena).cast(); + auto ts = paramFns[2].execute(record, arena).cast>(); + + const auto result = nautilus::invoke( + +[](const char* r, uint32_t rsz, const char* v, uint32_t vsz, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ref_str(r, rsz); + std::string val_str(v, vsz); + while (!ref_str.empty() && (ref_str.front() == '\'' || ref_str.front() == '"')) ref_str = ref_str.substr(1); + while (!ref_str.empty() && (ref_str.back() == '\'' || ref_str.back() == '"')) ref_str = ref_str.substr(0, ref_str.size()-1); + while (!val_str.empty() && (val_str.front() == '\'' || val_str.front() == '"')) val_str = val_str.substr(1); + while (!val_str.empty() && (val_str.back() == '\'' || val_str.back() == '"')) val_str = val_str.substr(0, val_str.size()-1); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = "'" + val_str + "'@" + ts_str; + Temporal* temp = ttext_in(wkt.c_str()); + if (!temp) return 0.0; + text* txt = cstring_to_text(ref_str.c_str()); + if (!txt) { free(temp); return 0.0; } + int result = always_le_text_ttext(txt, temp); + free(temp); + free(txt); + return static_cast(result); + } catch (const std::exception&) { return 0.0; } + }, + ref, value, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysLeTextTtextPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "AlwaysLeTextTtextPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + return AlwaysLeTextTtextPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysLeTtextTextPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysLeTtextTextPhysicalFunction.cpp new file mode 100644 index 0000000000..1b17b2c5a1 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysLeTtextTextPhysicalFunction.cpp @@ -0,0 +1,90 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +} + +namespace NES { + +AlwaysLeTtextTextPhysicalFunction::AlwaysLeTtextTextPhysicalFunction( + PhysicalFunction valueFunction, PhysicalFunction refFunction, PhysicalFunction tsFunction) +{ + paramFns.reserve(3); + paramFns.push_back(std::move(valueFunction)); + paramFns.push_back(std::move(refFunction)); + paramFns.push_back(std::move(tsFunction)); +} + +VarVal AlwaysLeTtextTextPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto value = paramFns[0].execute(record, arena).cast(); + auto ref = paramFns[1].execute(record, arena).cast(); + auto ts = paramFns[2].execute(record, arena).cast>(); + + const auto result = nautilus::invoke( + +[](const char* v, uint32_t vsz, const char* r, uint32_t rsz, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string val_str(v, vsz); + std::string ref_str(r, rsz); + while (!val_str.empty() && (val_str.front() == '\'' || val_str.front() == '"')) val_str = val_str.substr(1); + while (!val_str.empty() && (val_str.back() == '\'' || val_str.back() == '"')) val_str = val_str.substr(0, val_str.size()-1); + while (!ref_str.empty() && (ref_str.front() == '\'' || ref_str.front() == '"')) ref_str = ref_str.substr(1); + while (!ref_str.empty() && (ref_str.back() == '\'' || ref_str.back() == '"')) ref_str = ref_str.substr(0, ref_str.size()-1); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = "'" + val_str + "'@" + ts_str; + Temporal* temp = ttext_in(wkt.c_str()); + if (!temp) return 0.0; + text* txt = cstring_to_text(ref_str.c_str()); + if (!txt) { free(temp); return 0.0; } + int result = always_le_ttext_text(temp, txt); + free(temp); + free(txt); + return static_cast(result); + } catch (const std::exception&) { return 0.0; } + }, + value, ref, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysLeTtextTextPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "AlwaysLeTtextTextPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + return AlwaysLeTtextTextPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysLtTextTtextPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysLtTextTtextPhysicalFunction.cpp new file mode 100644 index 0000000000..ca73bb826e --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysLtTextTtextPhysicalFunction.cpp @@ -0,0 +1,90 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +} + +namespace NES { + +AlwaysLtTextTtextPhysicalFunction::AlwaysLtTextTtextPhysicalFunction( + PhysicalFunction valueFunction, PhysicalFunction refFunction, PhysicalFunction tsFunction) +{ + paramFns.reserve(3); + paramFns.push_back(std::move(valueFunction)); + paramFns.push_back(std::move(refFunction)); + paramFns.push_back(std::move(tsFunction)); +} + +VarVal AlwaysLtTextTtextPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto ref = paramFns[0].execute(record, arena).cast(); + auto value = paramFns[1].execute(record, arena).cast(); + auto ts = paramFns[2].execute(record, arena).cast>(); + + const auto result = nautilus::invoke( + +[](const char* r, uint32_t rsz, const char* v, uint32_t vsz, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ref_str(r, rsz); + std::string val_str(v, vsz); + while (!ref_str.empty() && (ref_str.front() == '\'' || ref_str.front() == '"')) ref_str = ref_str.substr(1); + while (!ref_str.empty() && (ref_str.back() == '\'' || ref_str.back() == '"')) ref_str = ref_str.substr(0, ref_str.size()-1); + while (!val_str.empty() && (val_str.front() == '\'' || val_str.front() == '"')) val_str = val_str.substr(1); + while (!val_str.empty() && (val_str.back() == '\'' || val_str.back() == '"')) val_str = val_str.substr(0, val_str.size()-1); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = "'" + val_str + "'@" + ts_str; + Temporal* temp = ttext_in(wkt.c_str()); + if (!temp) return 0.0; + text* txt = cstring_to_text(ref_str.c_str()); + if (!txt) { free(temp); return 0.0; } + int result = always_lt_text_ttext(txt, temp); + free(temp); + free(txt); + return static_cast(result); + } catch (const std::exception&) { return 0.0; } + }, + ref, value, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysLtTextTtextPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "AlwaysLtTextTtextPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + return AlwaysLtTextTtextPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysLtTtextTextPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysLtTtextTextPhysicalFunction.cpp new file mode 100644 index 0000000000..eae1a0dc44 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysLtTtextTextPhysicalFunction.cpp @@ -0,0 +1,90 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +} + +namespace NES { + +AlwaysLtTtextTextPhysicalFunction::AlwaysLtTtextTextPhysicalFunction( + PhysicalFunction valueFunction, PhysicalFunction refFunction, PhysicalFunction tsFunction) +{ + paramFns.reserve(3); + paramFns.push_back(std::move(valueFunction)); + paramFns.push_back(std::move(refFunction)); + paramFns.push_back(std::move(tsFunction)); +} + +VarVal AlwaysLtTtextTextPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto value = paramFns[0].execute(record, arena).cast(); + auto ref = paramFns[1].execute(record, arena).cast(); + auto ts = paramFns[2].execute(record, arena).cast>(); + + const auto result = nautilus::invoke( + +[](const char* v, uint32_t vsz, const char* r, uint32_t rsz, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string val_str(v, vsz); + std::string ref_str(r, rsz); + while (!val_str.empty() && (val_str.front() == '\'' || val_str.front() == '"')) val_str = val_str.substr(1); + while (!val_str.empty() && (val_str.back() == '\'' || val_str.back() == '"')) val_str = val_str.substr(0, val_str.size()-1); + while (!ref_str.empty() && (ref_str.front() == '\'' || ref_str.front() == '"')) ref_str = ref_str.substr(1); + while (!ref_str.empty() && (ref_str.back() == '\'' || ref_str.back() == '"')) ref_str = ref_str.substr(0, ref_str.size()-1); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = "'" + val_str + "'@" + ts_str; + Temporal* temp = ttext_in(wkt.c_str()); + if (!temp) return 0.0; + text* txt = cstring_to_text(ref_str.c_str()); + if (!txt) { free(temp); return 0.0; } + int result = always_lt_ttext_text(temp, txt); + free(temp); + free(txt); + return static_cast(result); + } catch (const std::exception&) { return 0.0; } + }, + value, ref, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysLtTtextTextPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "AlwaysLtTtextTextPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + return AlwaysLtTtextTextPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysNeTextTtextPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysNeTextTtextPhysicalFunction.cpp new file mode 100644 index 0000000000..83e39a5bfa --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysNeTextTtextPhysicalFunction.cpp @@ -0,0 +1,90 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +} + +namespace NES { + +AlwaysNeTextTtextPhysicalFunction::AlwaysNeTextTtextPhysicalFunction( + PhysicalFunction valueFunction, PhysicalFunction refFunction, PhysicalFunction tsFunction) +{ + paramFns.reserve(3); + paramFns.push_back(std::move(valueFunction)); + paramFns.push_back(std::move(refFunction)); + paramFns.push_back(std::move(tsFunction)); +} + +VarVal AlwaysNeTextTtextPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto ref = paramFns[0].execute(record, arena).cast(); + auto value = paramFns[1].execute(record, arena).cast(); + auto ts = paramFns[2].execute(record, arena).cast>(); + + const auto result = nautilus::invoke( + +[](const char* r, uint32_t rsz, const char* v, uint32_t vsz, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ref_str(r, rsz); + std::string val_str(v, vsz); + while (!ref_str.empty() && (ref_str.front() == '\'' || ref_str.front() == '"')) ref_str = ref_str.substr(1); + while (!ref_str.empty() && (ref_str.back() == '\'' || ref_str.back() == '"')) ref_str = ref_str.substr(0, ref_str.size()-1); + while (!val_str.empty() && (val_str.front() == '\'' || val_str.front() == '"')) val_str = val_str.substr(1); + while (!val_str.empty() && (val_str.back() == '\'' || val_str.back() == '"')) val_str = val_str.substr(0, val_str.size()-1); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = "'" + val_str + "'@" + ts_str; + Temporal* temp = ttext_in(wkt.c_str()); + if (!temp) return 0.0; + text* txt = cstring_to_text(ref_str.c_str()); + if (!txt) { free(temp); return 0.0; } + int result = always_ne_text_ttext(txt, temp); + free(temp); + free(txt); + return static_cast(result); + } catch (const std::exception&) { return 0.0; } + }, + ref, value, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysNeTextTtextPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "AlwaysNeTextTtextPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + return AlwaysNeTextTtextPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysNeTtextTextPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysNeTtextTextPhysicalFunction.cpp new file mode 100644 index 0000000000..d962d3476a --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysNeTtextTextPhysicalFunction.cpp @@ -0,0 +1,90 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +} + +namespace NES { + +AlwaysNeTtextTextPhysicalFunction::AlwaysNeTtextTextPhysicalFunction( + PhysicalFunction valueFunction, PhysicalFunction refFunction, PhysicalFunction tsFunction) +{ + paramFns.reserve(3); + paramFns.push_back(std::move(valueFunction)); + paramFns.push_back(std::move(refFunction)); + paramFns.push_back(std::move(tsFunction)); +} + +VarVal AlwaysNeTtextTextPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto value = paramFns[0].execute(record, arena).cast(); + auto ref = paramFns[1].execute(record, arena).cast(); + auto ts = paramFns[2].execute(record, arena).cast>(); + + const auto result = nautilus::invoke( + +[](const char* v, uint32_t vsz, const char* r, uint32_t rsz, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string val_str(v, vsz); + std::string ref_str(r, rsz); + while (!val_str.empty() && (val_str.front() == '\'' || val_str.front() == '"')) val_str = val_str.substr(1); + while (!val_str.empty() && (val_str.back() == '\'' || val_str.back() == '"')) val_str = val_str.substr(0, val_str.size()-1); + while (!ref_str.empty() && (ref_str.front() == '\'' || ref_str.front() == '"')) ref_str = ref_str.substr(1); + while (!ref_str.empty() && (ref_str.back() == '\'' || ref_str.back() == '"')) ref_str = ref_str.substr(0, ref_str.size()-1); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = "'" + val_str + "'@" + ts_str; + Temporal* temp = ttext_in(wkt.c_str()); + if (!temp) return 0.0; + text* txt = cstring_to_text(ref_str.c_str()); + if (!txt) { free(temp); return 0.0; } + int result = always_ne_ttext_text(temp, txt); + free(temp); + free(txt); + return static_cast(result); + } catch (const std::exception&) { return 0.0; } + }, + value, ref, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysNeTtextTextPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "AlwaysNeTtextTextPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + return AlwaysNeTtextTextPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt index 5224235981..7a1ba07400 100644 --- a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt @@ -245,4 +245,32 @@ add_plugin(TltTintInt PhysicalFunction nes-physical-operators TltTintIntPhysical add_plugin(TltIntTint PhysicalFunction nes-physical-operators TltIntTintPhysicalFunction.cpp) add_plugin(TltTemporalTemporal PhysicalFunction nes-physical-operators TltTemporalTemporalPhysicalFunction.cpp) add_plugin(TboolToTint PhysicalFunction nes-physical-operators TboolToTintPhysicalFunction.cpp) +add_plugin(EverEqTtextText PhysicalFunction nes-physical-operators EverEqTtextTextPhysicalFunction.cpp) +add_plugin(EverNeTtextText PhysicalFunction nes-physical-operators EverNeTtextTextPhysicalFunction.cpp) +add_plugin(EverGeTtextText PhysicalFunction nes-physical-operators EverGeTtextTextPhysicalFunction.cpp) +add_plugin(EverGtTtextText PhysicalFunction nes-physical-operators EverGtTtextTextPhysicalFunction.cpp) +add_plugin(EverLeTtextText PhysicalFunction nes-physical-operators EverLeTtextTextPhysicalFunction.cpp) +add_plugin(EverLtTtextText PhysicalFunction nes-physical-operators EverLtTtextTextPhysicalFunction.cpp) +add_plugin(EverEqTextTtext PhysicalFunction nes-physical-operators EverEqTextTtextPhysicalFunction.cpp) +add_plugin(EverNeTextTtext PhysicalFunction nes-physical-operators EverNeTextTtextPhysicalFunction.cpp) +add_plugin(EverGeTextTtext PhysicalFunction nes-physical-operators EverGeTextTtextPhysicalFunction.cpp) +add_plugin(EverGtTextTtext PhysicalFunction nes-physical-operators EverGtTextTtextPhysicalFunction.cpp) +add_plugin(EverLeTextTtext PhysicalFunction nes-physical-operators EverLeTextTtextPhysicalFunction.cpp) +add_plugin(EverLtTextTtext PhysicalFunction nes-physical-operators EverLtTextTtextPhysicalFunction.cpp) +add_plugin(AlwaysEqTtextText PhysicalFunction nes-physical-operators AlwaysEqTtextTextPhysicalFunction.cpp) +add_plugin(AlwaysNeTtextText PhysicalFunction nes-physical-operators AlwaysNeTtextTextPhysicalFunction.cpp) +add_plugin(AlwaysGeTtextText PhysicalFunction nes-physical-operators AlwaysGeTtextTextPhysicalFunction.cpp) +add_plugin(AlwaysGtTtextText PhysicalFunction nes-physical-operators AlwaysGtTtextTextPhysicalFunction.cpp) +add_plugin(AlwaysLeTtextText PhysicalFunction nes-physical-operators AlwaysLeTtextTextPhysicalFunction.cpp) +add_plugin(AlwaysLtTtextText PhysicalFunction nes-physical-operators AlwaysLtTtextTextPhysicalFunction.cpp) +add_plugin(AlwaysEqTextTtext PhysicalFunction nes-physical-operators AlwaysEqTextTtextPhysicalFunction.cpp) +add_plugin(AlwaysNeTextTtext PhysicalFunction nes-physical-operators AlwaysNeTextTtextPhysicalFunction.cpp) +add_plugin(AlwaysGeTextTtext PhysicalFunction nes-physical-operators AlwaysGeTextTtextPhysicalFunction.cpp) +add_plugin(AlwaysGtTextTtext PhysicalFunction nes-physical-operators AlwaysGtTextTtextPhysicalFunction.cpp) +add_plugin(AlwaysLeTextTtext PhysicalFunction nes-physical-operators AlwaysLeTextTtextPhysicalFunction.cpp) +add_plugin(AlwaysLtTextTtext PhysicalFunction nes-physical-operators AlwaysLtTextTtextPhysicalFunction.cpp) +add_plugin(TeqTtextText PhysicalFunction nes-physical-operators TeqTtextTextPhysicalFunction.cpp) +add_plugin(TneTtextText PhysicalFunction nes-physical-operators TneTtextTextPhysicalFunction.cpp) +add_plugin(TeqTextTtext PhysicalFunction nes-physical-operators TeqTextTtextPhysicalFunction.cpp) +add_plugin(TneTextTtext PhysicalFunction nes-physical-operators TneTextTtextPhysicalFunction.cpp) endif() diff --git a/nes-physical-operators/src/Functions/Meos/EverEqTextTtextPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverEqTextTtextPhysicalFunction.cpp new file mode 100644 index 0000000000..b220c17db5 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverEqTextTtextPhysicalFunction.cpp @@ -0,0 +1,90 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +} + +namespace NES { + +EverEqTextTtextPhysicalFunction::EverEqTextTtextPhysicalFunction( + PhysicalFunction valueFunction, PhysicalFunction refFunction, PhysicalFunction tsFunction) +{ + paramFns.reserve(3); + paramFns.push_back(std::move(valueFunction)); + paramFns.push_back(std::move(refFunction)); + paramFns.push_back(std::move(tsFunction)); +} + +VarVal EverEqTextTtextPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto ref = paramFns[0].execute(record, arena).cast(); + auto value = paramFns[1].execute(record, arena).cast(); + auto ts = paramFns[2].execute(record, arena).cast>(); + + const auto result = nautilus::invoke( + +[](const char* r, uint32_t rsz, const char* v, uint32_t vsz, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ref_str(r, rsz); + std::string val_str(v, vsz); + while (!ref_str.empty() && (ref_str.front() == '\'' || ref_str.front() == '"')) ref_str = ref_str.substr(1); + while (!ref_str.empty() && (ref_str.back() == '\'' || ref_str.back() == '"')) ref_str = ref_str.substr(0, ref_str.size()-1); + while (!val_str.empty() && (val_str.front() == '\'' || val_str.front() == '"')) val_str = val_str.substr(1); + while (!val_str.empty() && (val_str.back() == '\'' || val_str.back() == '"')) val_str = val_str.substr(0, val_str.size()-1); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = "'" + val_str + "'@" + ts_str; + Temporal* temp = ttext_in(wkt.c_str()); + if (!temp) return 0.0; + text* txt = cstring_to_text(ref_str.c_str()); + if (!txt) { free(temp); return 0.0; } + int result = ever_eq_text_ttext(txt, temp); + free(temp); + free(txt); + return static_cast(result); + } catch (const std::exception&) { return 0.0; } + }, + ref, value, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverEqTextTtextPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "EverEqTextTtextPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + return EverEqTextTtextPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverEqTtextTextPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverEqTtextTextPhysicalFunction.cpp new file mode 100644 index 0000000000..6e40e212b4 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverEqTtextTextPhysicalFunction.cpp @@ -0,0 +1,90 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +} + +namespace NES { + +EverEqTtextTextPhysicalFunction::EverEqTtextTextPhysicalFunction( + PhysicalFunction valueFunction, PhysicalFunction refFunction, PhysicalFunction tsFunction) +{ + paramFns.reserve(3); + paramFns.push_back(std::move(valueFunction)); + paramFns.push_back(std::move(refFunction)); + paramFns.push_back(std::move(tsFunction)); +} + +VarVal EverEqTtextTextPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto value = paramFns[0].execute(record, arena).cast(); + auto ref = paramFns[1].execute(record, arena).cast(); + auto ts = paramFns[2].execute(record, arena).cast>(); + + const auto result = nautilus::invoke( + +[](const char* v, uint32_t vsz, const char* r, uint32_t rsz, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string val_str(v, vsz); + std::string ref_str(r, rsz); + while (!val_str.empty() && (val_str.front() == '\'' || val_str.front() == '"')) val_str = val_str.substr(1); + while (!val_str.empty() && (val_str.back() == '\'' || val_str.back() == '"')) val_str = val_str.substr(0, val_str.size()-1); + while (!ref_str.empty() && (ref_str.front() == '\'' || ref_str.front() == '"')) ref_str = ref_str.substr(1); + while (!ref_str.empty() && (ref_str.back() == '\'' || ref_str.back() == '"')) ref_str = ref_str.substr(0, ref_str.size()-1); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = "'" + val_str + "'@" + ts_str; + Temporal* temp = ttext_in(wkt.c_str()); + if (!temp) return 0.0; + text* txt = cstring_to_text(ref_str.c_str()); + if (!txt) { free(temp); return 0.0; } + int result = ever_eq_ttext_text(temp, txt); + free(temp); + free(txt); + return static_cast(result); + } catch (const std::exception&) { return 0.0; } + }, + value, ref, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverEqTtextTextPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "EverEqTtextTextPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + return EverEqTtextTextPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverGeTextTtextPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverGeTextTtextPhysicalFunction.cpp new file mode 100644 index 0000000000..492b064d6b --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverGeTextTtextPhysicalFunction.cpp @@ -0,0 +1,90 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +} + +namespace NES { + +EverGeTextTtextPhysicalFunction::EverGeTextTtextPhysicalFunction( + PhysicalFunction valueFunction, PhysicalFunction refFunction, PhysicalFunction tsFunction) +{ + paramFns.reserve(3); + paramFns.push_back(std::move(valueFunction)); + paramFns.push_back(std::move(refFunction)); + paramFns.push_back(std::move(tsFunction)); +} + +VarVal EverGeTextTtextPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto ref = paramFns[0].execute(record, arena).cast(); + auto value = paramFns[1].execute(record, arena).cast(); + auto ts = paramFns[2].execute(record, arena).cast>(); + + const auto result = nautilus::invoke( + +[](const char* r, uint32_t rsz, const char* v, uint32_t vsz, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ref_str(r, rsz); + std::string val_str(v, vsz); + while (!ref_str.empty() && (ref_str.front() == '\'' || ref_str.front() == '"')) ref_str = ref_str.substr(1); + while (!ref_str.empty() && (ref_str.back() == '\'' || ref_str.back() == '"')) ref_str = ref_str.substr(0, ref_str.size()-1); + while (!val_str.empty() && (val_str.front() == '\'' || val_str.front() == '"')) val_str = val_str.substr(1); + while (!val_str.empty() && (val_str.back() == '\'' || val_str.back() == '"')) val_str = val_str.substr(0, val_str.size()-1); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = "'" + val_str + "'@" + ts_str; + Temporal* temp = ttext_in(wkt.c_str()); + if (!temp) return 0.0; + text* txt = cstring_to_text(ref_str.c_str()); + if (!txt) { free(temp); return 0.0; } + int result = ever_ge_text_ttext(txt, temp); + free(temp); + free(txt); + return static_cast(result); + } catch (const std::exception&) { return 0.0; } + }, + ref, value, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverGeTextTtextPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "EverGeTextTtextPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + return EverGeTextTtextPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverGeTtextTextPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverGeTtextTextPhysicalFunction.cpp new file mode 100644 index 0000000000..1205e71ec5 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverGeTtextTextPhysicalFunction.cpp @@ -0,0 +1,90 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +} + +namespace NES { + +EverGeTtextTextPhysicalFunction::EverGeTtextTextPhysicalFunction( + PhysicalFunction valueFunction, PhysicalFunction refFunction, PhysicalFunction tsFunction) +{ + paramFns.reserve(3); + paramFns.push_back(std::move(valueFunction)); + paramFns.push_back(std::move(refFunction)); + paramFns.push_back(std::move(tsFunction)); +} + +VarVal EverGeTtextTextPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto value = paramFns[0].execute(record, arena).cast(); + auto ref = paramFns[1].execute(record, arena).cast(); + auto ts = paramFns[2].execute(record, arena).cast>(); + + const auto result = nautilus::invoke( + +[](const char* v, uint32_t vsz, const char* r, uint32_t rsz, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string val_str(v, vsz); + std::string ref_str(r, rsz); + while (!val_str.empty() && (val_str.front() == '\'' || val_str.front() == '"')) val_str = val_str.substr(1); + while (!val_str.empty() && (val_str.back() == '\'' || val_str.back() == '"')) val_str = val_str.substr(0, val_str.size()-1); + while (!ref_str.empty() && (ref_str.front() == '\'' || ref_str.front() == '"')) ref_str = ref_str.substr(1); + while (!ref_str.empty() && (ref_str.back() == '\'' || ref_str.back() == '"')) ref_str = ref_str.substr(0, ref_str.size()-1); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = "'" + val_str + "'@" + ts_str; + Temporal* temp = ttext_in(wkt.c_str()); + if (!temp) return 0.0; + text* txt = cstring_to_text(ref_str.c_str()); + if (!txt) { free(temp); return 0.0; } + int result = ever_ge_ttext_text(temp, txt); + free(temp); + free(txt); + return static_cast(result); + } catch (const std::exception&) { return 0.0; } + }, + value, ref, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverGeTtextTextPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "EverGeTtextTextPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + return EverGeTtextTextPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverGtTextTtextPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverGtTextTtextPhysicalFunction.cpp new file mode 100644 index 0000000000..a2cdb95ab0 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverGtTextTtextPhysicalFunction.cpp @@ -0,0 +1,90 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +} + +namespace NES { + +EverGtTextTtextPhysicalFunction::EverGtTextTtextPhysicalFunction( + PhysicalFunction valueFunction, PhysicalFunction refFunction, PhysicalFunction tsFunction) +{ + paramFns.reserve(3); + paramFns.push_back(std::move(valueFunction)); + paramFns.push_back(std::move(refFunction)); + paramFns.push_back(std::move(tsFunction)); +} + +VarVal EverGtTextTtextPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto ref = paramFns[0].execute(record, arena).cast(); + auto value = paramFns[1].execute(record, arena).cast(); + auto ts = paramFns[2].execute(record, arena).cast>(); + + const auto result = nautilus::invoke( + +[](const char* r, uint32_t rsz, const char* v, uint32_t vsz, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ref_str(r, rsz); + std::string val_str(v, vsz); + while (!ref_str.empty() && (ref_str.front() == '\'' || ref_str.front() == '"')) ref_str = ref_str.substr(1); + while (!ref_str.empty() && (ref_str.back() == '\'' || ref_str.back() == '"')) ref_str = ref_str.substr(0, ref_str.size()-1); + while (!val_str.empty() && (val_str.front() == '\'' || val_str.front() == '"')) val_str = val_str.substr(1); + while (!val_str.empty() && (val_str.back() == '\'' || val_str.back() == '"')) val_str = val_str.substr(0, val_str.size()-1); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = "'" + val_str + "'@" + ts_str; + Temporal* temp = ttext_in(wkt.c_str()); + if (!temp) return 0.0; + text* txt = cstring_to_text(ref_str.c_str()); + if (!txt) { free(temp); return 0.0; } + int result = ever_gt_text_ttext(txt, temp); + free(temp); + free(txt); + return static_cast(result); + } catch (const std::exception&) { return 0.0; } + }, + ref, value, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverGtTextTtextPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "EverGtTextTtextPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + return EverGtTextTtextPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverGtTtextTextPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverGtTtextTextPhysicalFunction.cpp new file mode 100644 index 0000000000..8840ab0cad --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverGtTtextTextPhysicalFunction.cpp @@ -0,0 +1,90 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +} + +namespace NES { + +EverGtTtextTextPhysicalFunction::EverGtTtextTextPhysicalFunction( + PhysicalFunction valueFunction, PhysicalFunction refFunction, PhysicalFunction tsFunction) +{ + paramFns.reserve(3); + paramFns.push_back(std::move(valueFunction)); + paramFns.push_back(std::move(refFunction)); + paramFns.push_back(std::move(tsFunction)); +} + +VarVal EverGtTtextTextPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto value = paramFns[0].execute(record, arena).cast(); + auto ref = paramFns[1].execute(record, arena).cast(); + auto ts = paramFns[2].execute(record, arena).cast>(); + + const auto result = nautilus::invoke( + +[](const char* v, uint32_t vsz, const char* r, uint32_t rsz, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string val_str(v, vsz); + std::string ref_str(r, rsz); + while (!val_str.empty() && (val_str.front() == '\'' || val_str.front() == '"')) val_str = val_str.substr(1); + while (!val_str.empty() && (val_str.back() == '\'' || val_str.back() == '"')) val_str = val_str.substr(0, val_str.size()-1); + while (!ref_str.empty() && (ref_str.front() == '\'' || ref_str.front() == '"')) ref_str = ref_str.substr(1); + while (!ref_str.empty() && (ref_str.back() == '\'' || ref_str.back() == '"')) ref_str = ref_str.substr(0, ref_str.size()-1); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = "'" + val_str + "'@" + ts_str; + Temporal* temp = ttext_in(wkt.c_str()); + if (!temp) return 0.0; + text* txt = cstring_to_text(ref_str.c_str()); + if (!txt) { free(temp); return 0.0; } + int result = ever_gt_ttext_text(temp, txt); + free(temp); + free(txt); + return static_cast(result); + } catch (const std::exception&) { return 0.0; } + }, + value, ref, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverGtTtextTextPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "EverGtTtextTextPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + return EverGtTtextTextPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverLeTextTtextPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverLeTextTtextPhysicalFunction.cpp new file mode 100644 index 0000000000..b813d4dc2c --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverLeTextTtextPhysicalFunction.cpp @@ -0,0 +1,90 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +} + +namespace NES { + +EverLeTextTtextPhysicalFunction::EverLeTextTtextPhysicalFunction( + PhysicalFunction valueFunction, PhysicalFunction refFunction, PhysicalFunction tsFunction) +{ + paramFns.reserve(3); + paramFns.push_back(std::move(valueFunction)); + paramFns.push_back(std::move(refFunction)); + paramFns.push_back(std::move(tsFunction)); +} + +VarVal EverLeTextTtextPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto ref = paramFns[0].execute(record, arena).cast(); + auto value = paramFns[1].execute(record, arena).cast(); + auto ts = paramFns[2].execute(record, arena).cast>(); + + const auto result = nautilus::invoke( + +[](const char* r, uint32_t rsz, const char* v, uint32_t vsz, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ref_str(r, rsz); + std::string val_str(v, vsz); + while (!ref_str.empty() && (ref_str.front() == '\'' || ref_str.front() == '"')) ref_str = ref_str.substr(1); + while (!ref_str.empty() && (ref_str.back() == '\'' || ref_str.back() == '"')) ref_str = ref_str.substr(0, ref_str.size()-1); + while (!val_str.empty() && (val_str.front() == '\'' || val_str.front() == '"')) val_str = val_str.substr(1); + while (!val_str.empty() && (val_str.back() == '\'' || val_str.back() == '"')) val_str = val_str.substr(0, val_str.size()-1); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = "'" + val_str + "'@" + ts_str; + Temporal* temp = ttext_in(wkt.c_str()); + if (!temp) return 0.0; + text* txt = cstring_to_text(ref_str.c_str()); + if (!txt) { free(temp); return 0.0; } + int result = ever_le_text_ttext(txt, temp); + free(temp); + free(txt); + return static_cast(result); + } catch (const std::exception&) { return 0.0; } + }, + ref, value, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverLeTextTtextPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "EverLeTextTtextPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + return EverLeTextTtextPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverLeTtextTextPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverLeTtextTextPhysicalFunction.cpp new file mode 100644 index 0000000000..9e5b4da4b4 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverLeTtextTextPhysicalFunction.cpp @@ -0,0 +1,90 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +} + +namespace NES { + +EverLeTtextTextPhysicalFunction::EverLeTtextTextPhysicalFunction( + PhysicalFunction valueFunction, PhysicalFunction refFunction, PhysicalFunction tsFunction) +{ + paramFns.reserve(3); + paramFns.push_back(std::move(valueFunction)); + paramFns.push_back(std::move(refFunction)); + paramFns.push_back(std::move(tsFunction)); +} + +VarVal EverLeTtextTextPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto value = paramFns[0].execute(record, arena).cast(); + auto ref = paramFns[1].execute(record, arena).cast(); + auto ts = paramFns[2].execute(record, arena).cast>(); + + const auto result = nautilus::invoke( + +[](const char* v, uint32_t vsz, const char* r, uint32_t rsz, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string val_str(v, vsz); + std::string ref_str(r, rsz); + while (!val_str.empty() && (val_str.front() == '\'' || val_str.front() == '"')) val_str = val_str.substr(1); + while (!val_str.empty() && (val_str.back() == '\'' || val_str.back() == '"')) val_str = val_str.substr(0, val_str.size()-1); + while (!ref_str.empty() && (ref_str.front() == '\'' || ref_str.front() == '"')) ref_str = ref_str.substr(1); + while (!ref_str.empty() && (ref_str.back() == '\'' || ref_str.back() == '"')) ref_str = ref_str.substr(0, ref_str.size()-1); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = "'" + val_str + "'@" + ts_str; + Temporal* temp = ttext_in(wkt.c_str()); + if (!temp) return 0.0; + text* txt = cstring_to_text(ref_str.c_str()); + if (!txt) { free(temp); return 0.0; } + int result = ever_le_ttext_text(temp, txt); + free(temp); + free(txt); + return static_cast(result); + } catch (const std::exception&) { return 0.0; } + }, + value, ref, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverLeTtextTextPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "EverLeTtextTextPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + return EverLeTtextTextPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverLtTextTtextPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverLtTextTtextPhysicalFunction.cpp new file mode 100644 index 0000000000..2d712dac08 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverLtTextTtextPhysicalFunction.cpp @@ -0,0 +1,90 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +} + +namespace NES { + +EverLtTextTtextPhysicalFunction::EverLtTextTtextPhysicalFunction( + PhysicalFunction valueFunction, PhysicalFunction refFunction, PhysicalFunction tsFunction) +{ + paramFns.reserve(3); + paramFns.push_back(std::move(valueFunction)); + paramFns.push_back(std::move(refFunction)); + paramFns.push_back(std::move(tsFunction)); +} + +VarVal EverLtTextTtextPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto ref = paramFns[0].execute(record, arena).cast(); + auto value = paramFns[1].execute(record, arena).cast(); + auto ts = paramFns[2].execute(record, arena).cast>(); + + const auto result = nautilus::invoke( + +[](const char* r, uint32_t rsz, const char* v, uint32_t vsz, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ref_str(r, rsz); + std::string val_str(v, vsz); + while (!ref_str.empty() && (ref_str.front() == '\'' || ref_str.front() == '"')) ref_str = ref_str.substr(1); + while (!ref_str.empty() && (ref_str.back() == '\'' || ref_str.back() == '"')) ref_str = ref_str.substr(0, ref_str.size()-1); + while (!val_str.empty() && (val_str.front() == '\'' || val_str.front() == '"')) val_str = val_str.substr(1); + while (!val_str.empty() && (val_str.back() == '\'' || val_str.back() == '"')) val_str = val_str.substr(0, val_str.size()-1); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = "'" + val_str + "'@" + ts_str; + Temporal* temp = ttext_in(wkt.c_str()); + if (!temp) return 0.0; + text* txt = cstring_to_text(ref_str.c_str()); + if (!txt) { free(temp); return 0.0; } + int result = ever_lt_text_ttext(txt, temp); + free(temp); + free(txt); + return static_cast(result); + } catch (const std::exception&) { return 0.0; } + }, + ref, value, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverLtTextTtextPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "EverLtTextTtextPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + return EverLtTextTtextPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverLtTtextTextPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverLtTtextTextPhysicalFunction.cpp new file mode 100644 index 0000000000..925aef9102 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverLtTtextTextPhysicalFunction.cpp @@ -0,0 +1,90 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +} + +namespace NES { + +EverLtTtextTextPhysicalFunction::EverLtTtextTextPhysicalFunction( + PhysicalFunction valueFunction, PhysicalFunction refFunction, PhysicalFunction tsFunction) +{ + paramFns.reserve(3); + paramFns.push_back(std::move(valueFunction)); + paramFns.push_back(std::move(refFunction)); + paramFns.push_back(std::move(tsFunction)); +} + +VarVal EverLtTtextTextPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto value = paramFns[0].execute(record, arena).cast(); + auto ref = paramFns[1].execute(record, arena).cast(); + auto ts = paramFns[2].execute(record, arena).cast>(); + + const auto result = nautilus::invoke( + +[](const char* v, uint32_t vsz, const char* r, uint32_t rsz, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string val_str(v, vsz); + std::string ref_str(r, rsz); + while (!val_str.empty() && (val_str.front() == '\'' || val_str.front() == '"')) val_str = val_str.substr(1); + while (!val_str.empty() && (val_str.back() == '\'' || val_str.back() == '"')) val_str = val_str.substr(0, val_str.size()-1); + while (!ref_str.empty() && (ref_str.front() == '\'' || ref_str.front() == '"')) ref_str = ref_str.substr(1); + while (!ref_str.empty() && (ref_str.back() == '\'' || ref_str.back() == '"')) ref_str = ref_str.substr(0, ref_str.size()-1); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = "'" + val_str + "'@" + ts_str; + Temporal* temp = ttext_in(wkt.c_str()); + if (!temp) return 0.0; + text* txt = cstring_to_text(ref_str.c_str()); + if (!txt) { free(temp); return 0.0; } + int result = ever_lt_ttext_text(temp, txt); + free(temp); + free(txt); + return static_cast(result); + } catch (const std::exception&) { return 0.0; } + }, + value, ref, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverLtTtextTextPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "EverLtTtextTextPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + return EverLtTtextTextPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverNeTextTtextPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverNeTextTtextPhysicalFunction.cpp new file mode 100644 index 0000000000..d1da80d397 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverNeTextTtextPhysicalFunction.cpp @@ -0,0 +1,90 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +} + +namespace NES { + +EverNeTextTtextPhysicalFunction::EverNeTextTtextPhysicalFunction( + PhysicalFunction valueFunction, PhysicalFunction refFunction, PhysicalFunction tsFunction) +{ + paramFns.reserve(3); + paramFns.push_back(std::move(valueFunction)); + paramFns.push_back(std::move(refFunction)); + paramFns.push_back(std::move(tsFunction)); +} + +VarVal EverNeTextTtextPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto ref = paramFns[0].execute(record, arena).cast(); + auto value = paramFns[1].execute(record, arena).cast(); + auto ts = paramFns[2].execute(record, arena).cast>(); + + const auto result = nautilus::invoke( + +[](const char* r, uint32_t rsz, const char* v, uint32_t vsz, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ref_str(r, rsz); + std::string val_str(v, vsz); + while (!ref_str.empty() && (ref_str.front() == '\'' || ref_str.front() == '"')) ref_str = ref_str.substr(1); + while (!ref_str.empty() && (ref_str.back() == '\'' || ref_str.back() == '"')) ref_str = ref_str.substr(0, ref_str.size()-1); + while (!val_str.empty() && (val_str.front() == '\'' || val_str.front() == '"')) val_str = val_str.substr(1); + while (!val_str.empty() && (val_str.back() == '\'' || val_str.back() == '"')) val_str = val_str.substr(0, val_str.size()-1); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = "'" + val_str + "'@" + ts_str; + Temporal* temp = ttext_in(wkt.c_str()); + if (!temp) return 0.0; + text* txt = cstring_to_text(ref_str.c_str()); + if (!txt) { free(temp); return 0.0; } + int result = ever_ne_text_ttext(txt, temp); + free(temp); + free(txt); + return static_cast(result); + } catch (const std::exception&) { return 0.0; } + }, + ref, value, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverNeTextTtextPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "EverNeTextTtextPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + return EverNeTextTtextPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverNeTtextTextPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverNeTtextTextPhysicalFunction.cpp new file mode 100644 index 0000000000..2b3d082952 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverNeTtextTextPhysicalFunction.cpp @@ -0,0 +1,90 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +} + +namespace NES { + +EverNeTtextTextPhysicalFunction::EverNeTtextTextPhysicalFunction( + PhysicalFunction valueFunction, PhysicalFunction refFunction, PhysicalFunction tsFunction) +{ + paramFns.reserve(3); + paramFns.push_back(std::move(valueFunction)); + paramFns.push_back(std::move(refFunction)); + paramFns.push_back(std::move(tsFunction)); +} + +VarVal EverNeTtextTextPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto value = paramFns[0].execute(record, arena).cast(); + auto ref = paramFns[1].execute(record, arena).cast(); + auto ts = paramFns[2].execute(record, arena).cast>(); + + const auto result = nautilus::invoke( + +[](const char* v, uint32_t vsz, const char* r, uint32_t rsz, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string val_str(v, vsz); + std::string ref_str(r, rsz); + while (!val_str.empty() && (val_str.front() == '\'' || val_str.front() == '"')) val_str = val_str.substr(1); + while (!val_str.empty() && (val_str.back() == '\'' || val_str.back() == '"')) val_str = val_str.substr(0, val_str.size()-1); + while (!ref_str.empty() && (ref_str.front() == '\'' || ref_str.front() == '"')) ref_str = ref_str.substr(1); + while (!ref_str.empty() && (ref_str.back() == '\'' || ref_str.back() == '"')) ref_str = ref_str.substr(0, ref_str.size()-1); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = "'" + val_str + "'@" + ts_str; + Temporal* temp = ttext_in(wkt.c_str()); + if (!temp) return 0.0; + text* txt = cstring_to_text(ref_str.c_str()); + if (!txt) { free(temp); return 0.0; } + int result = ever_ne_ttext_text(temp, txt); + free(temp); + free(txt); + return static_cast(result); + } catch (const std::exception&) { return 0.0; } + }, + value, ref, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverNeTtextTextPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "EverNeTtextTextPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + return EverNeTtextTextPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TeqTextTtextPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TeqTextTtextPhysicalFunction.cpp new file mode 100644 index 0000000000..35fc159b03 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TeqTextTtextPhysicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +} + +namespace NES { + +TeqTextTtextPhysicalFunction::TeqTextTtextPhysicalFunction( + PhysicalFunction valueFunction, PhysicalFunction refFunction, PhysicalFunction tsFunction) +{ + paramFns.reserve(3); + paramFns.push_back(std::move(valueFunction)); + paramFns.push_back(std::move(refFunction)); + paramFns.push_back(std::move(tsFunction)); +} + +VarVal TeqTextTtextPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto ref = paramFns[0].execute(record, arena).cast(); + auto value = paramFns[1].execute(record, arena).cast(); + auto ts = paramFns[2].execute(record, arena).cast>(); + + const auto result = nautilus::invoke( + +[](const char* r, uint32_t rsz, const char* v, uint32_t vsz, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ref_str(r, rsz); + std::string val_str(v, vsz); + while (!ref_str.empty() && (ref_str.front() == '\'' || ref_str.front() == '"')) ref_str = ref_str.substr(1); + while (!ref_str.empty() && (ref_str.back() == '\'' || ref_str.back() == '"')) ref_str = ref_str.substr(0, ref_str.size()-1); + while (!val_str.empty() && (val_str.front() == '\'' || val_str.front() == '"')) val_str = val_str.substr(1); + while (!val_str.empty() && (val_str.back() == '\'' || val_str.back() == '"')) val_str = val_str.substr(0, val_str.size()-1); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = "'" + val_str + "'@" + ts_str; + Temporal* temp = ttext_in(wkt.c_str()); + if (!temp) return 0.0; + text* txt = cstring_to_text(ref_str.c_str()); + if (!txt) { free(temp); return 0.0; } + Temporal* res = teq_text_ttext(txt, temp); + free(temp); + free(txt); + if (!res) return 0.0; + bool v2 = tbool_start_value(res); + free(res); + return v2 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + ref, value, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTeqTextTtextPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "TeqTextTtextPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + return TeqTextTtextPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TeqTtextTextPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TeqTtextTextPhysicalFunction.cpp new file mode 100644 index 0000000000..4f280736cb --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TeqTtextTextPhysicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +} + +namespace NES { + +TeqTtextTextPhysicalFunction::TeqTtextTextPhysicalFunction( + PhysicalFunction valueFunction, PhysicalFunction refFunction, PhysicalFunction tsFunction) +{ + paramFns.reserve(3); + paramFns.push_back(std::move(valueFunction)); + paramFns.push_back(std::move(refFunction)); + paramFns.push_back(std::move(tsFunction)); +} + +VarVal TeqTtextTextPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto value = paramFns[0].execute(record, arena).cast(); + auto ref = paramFns[1].execute(record, arena).cast(); + auto ts = paramFns[2].execute(record, arena).cast>(); + + const auto result = nautilus::invoke( + +[](const char* v, uint32_t vsz, const char* r, uint32_t rsz, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string val_str(v, vsz); + std::string ref_str(r, rsz); + while (!val_str.empty() && (val_str.front() == '\'' || val_str.front() == '"')) val_str = val_str.substr(1); + while (!val_str.empty() && (val_str.back() == '\'' || val_str.back() == '"')) val_str = val_str.substr(0, val_str.size()-1); + while (!ref_str.empty() && (ref_str.front() == '\'' || ref_str.front() == '"')) ref_str = ref_str.substr(1); + while (!ref_str.empty() && (ref_str.back() == '\'' || ref_str.back() == '"')) ref_str = ref_str.substr(0, ref_str.size()-1); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = "'" + val_str + "'@" + ts_str; + Temporal* temp = ttext_in(wkt.c_str()); + if (!temp) return 0.0; + text* txt = cstring_to_text(ref_str.c_str()); + if (!txt) { free(temp); return 0.0; } + Temporal* res = teq_ttext_text(temp, txt); + free(temp); + free(txt); + if (!res) return 0.0; + bool v2 = tbool_start_value(res); + free(res); + return v2 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + value, ref, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTeqTtextTextPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "TeqTtextTextPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + return TeqTtextTextPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TneTextTtextPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TneTextTtextPhysicalFunction.cpp new file mode 100644 index 0000000000..06f16c4156 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TneTextTtextPhysicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +} + +namespace NES { + +TneTextTtextPhysicalFunction::TneTextTtextPhysicalFunction( + PhysicalFunction valueFunction, PhysicalFunction refFunction, PhysicalFunction tsFunction) +{ + paramFns.reserve(3); + paramFns.push_back(std::move(valueFunction)); + paramFns.push_back(std::move(refFunction)); + paramFns.push_back(std::move(tsFunction)); +} + +VarVal TneTextTtextPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto ref = paramFns[0].execute(record, arena).cast(); + auto value = paramFns[1].execute(record, arena).cast(); + auto ts = paramFns[2].execute(record, arena).cast>(); + + const auto result = nautilus::invoke( + +[](const char* r, uint32_t rsz, const char* v, uint32_t vsz, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ref_str(r, rsz); + std::string val_str(v, vsz); + while (!ref_str.empty() && (ref_str.front() == '\'' || ref_str.front() == '"')) ref_str = ref_str.substr(1); + while (!ref_str.empty() && (ref_str.back() == '\'' || ref_str.back() == '"')) ref_str = ref_str.substr(0, ref_str.size()-1); + while (!val_str.empty() && (val_str.front() == '\'' || val_str.front() == '"')) val_str = val_str.substr(1); + while (!val_str.empty() && (val_str.back() == '\'' || val_str.back() == '"')) val_str = val_str.substr(0, val_str.size()-1); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = "'" + val_str + "'@" + ts_str; + Temporal* temp = ttext_in(wkt.c_str()); + if (!temp) return 0.0; + text* txt = cstring_to_text(ref_str.c_str()); + if (!txt) { free(temp); return 0.0; } + Temporal* res = tne_text_ttext(txt, temp); + free(temp); + free(txt); + if (!res) return 0.0; + bool v2 = tbool_start_value(res); + free(res); + return v2 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + ref, value, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTneTextTtextPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "TneTextTtextPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + return TneTextTtextPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TneTtextTextPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TneTtextTextPhysicalFunction.cpp new file mode 100644 index 0000000000..7fdb6e675d --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TneTtextTextPhysicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +} + +namespace NES { + +TneTtextTextPhysicalFunction::TneTtextTextPhysicalFunction( + PhysicalFunction valueFunction, PhysicalFunction refFunction, PhysicalFunction tsFunction) +{ + paramFns.reserve(3); + paramFns.push_back(std::move(valueFunction)); + paramFns.push_back(std::move(refFunction)); + paramFns.push_back(std::move(tsFunction)); +} + +VarVal TneTtextTextPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto value = paramFns[0].execute(record, arena).cast(); + auto ref = paramFns[1].execute(record, arena).cast(); + auto ts = paramFns[2].execute(record, arena).cast>(); + + const auto result = nautilus::invoke( + +[](const char* v, uint32_t vsz, const char* r, uint32_t rsz, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string val_str(v, vsz); + std::string ref_str(r, rsz); + while (!val_str.empty() && (val_str.front() == '\'' || val_str.front() == '"')) val_str = val_str.substr(1); + while (!val_str.empty() && (val_str.back() == '\'' || val_str.back() == '"')) val_str = val_str.substr(0, val_str.size()-1); + while (!ref_str.empty() && (ref_str.front() == '\'' || ref_str.front() == '"')) ref_str = ref_str.substr(1); + while (!ref_str.empty() && (ref_str.back() == '\'' || ref_str.back() == '"')) ref_str = ref_str.substr(0, ref_str.size()-1); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = "'" + val_str + "'@" + ts_str; + Temporal* temp = ttext_in(wkt.c_str()); + if (!temp) return 0.0; + text* txt = cstring_to_text(ref_str.c_str()); + if (!txt) { free(temp); return 0.0; } + Temporal* res = tne_ttext_text(temp, txt); + free(temp); + free(txt); + if (!res) return 0.0; + bool v2 = tbool_start_value(res); + free(res); + return v2 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + value, ref, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTneTtextTextPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "TneTtextTextPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + return TneTtextTextPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2])); +} + +} // namespace NES diff --git a/nes-sql-parser/AntlrSQL.g4 b/nes-sql-parser/AntlrSQL.g4 index ce613ef640..72d4d77edb 100644 --- a/nes-sql-parser/AntlrSQL.g4 +++ b/nes-sql-parser/AntlrSQL.g4 @@ -295,7 +295,7 @@ timeUnit: MS timestampParameter: name=identifier; -functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT; +functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT; sinkClause: INTO sink (',' sink)*; @@ -716,6 +716,34 @@ TLT_TINT_INT: 'TLT_TINT_INT' | 'tlt_tint_int'; TLT_INT_TINT: 'TLT_INT_TINT' | 'tlt_int_tint'; TLT_TEMPORAL_TEMPORAL: 'TLT_TEMPORAL_TEMPORAL' | 'tlt_temporal_temporal'; TBOOL_TO_TINT: 'TBOOL_TO_TINT' | 'tbool_to_tint'; +EVER_EQ_TTEXT_TEXT: 'EVER_EQ_TTEXT_TEXT' | 'ever_eq_ttext_text'; +EVER_NE_TTEXT_TEXT: 'EVER_NE_TTEXT_TEXT' | 'ever_ne_ttext_text'; +EVER_GE_TTEXT_TEXT: 'EVER_GE_TTEXT_TEXT' | 'ever_ge_ttext_text'; +EVER_GT_TTEXT_TEXT: 'EVER_GT_TTEXT_TEXT' | 'ever_gt_ttext_text'; +EVER_LE_TTEXT_TEXT: 'EVER_LE_TTEXT_TEXT' | 'ever_le_ttext_text'; +EVER_LT_TTEXT_TEXT: 'EVER_LT_TTEXT_TEXT' | 'ever_lt_ttext_text'; +EVER_EQ_TEXT_TTEXT: 'EVER_EQ_TEXT_TTEXT' | 'ever_eq_text_ttext'; +EVER_NE_TEXT_TTEXT: 'EVER_NE_TEXT_TTEXT' | 'ever_ne_text_ttext'; +EVER_GE_TEXT_TTEXT: 'EVER_GE_TEXT_TTEXT' | 'ever_ge_text_ttext'; +EVER_GT_TEXT_TTEXT: 'EVER_GT_TEXT_TTEXT' | 'ever_gt_text_ttext'; +EVER_LE_TEXT_TTEXT: 'EVER_LE_TEXT_TTEXT' | 'ever_le_text_ttext'; +EVER_LT_TEXT_TTEXT: 'EVER_LT_TEXT_TTEXT' | 'ever_lt_text_ttext'; +ALWAYS_EQ_TTEXT_TEXT: 'ALWAYS_EQ_TTEXT_TEXT' | 'always_eq_ttext_text'; +ALWAYS_NE_TTEXT_TEXT: 'ALWAYS_NE_TTEXT_TEXT' | 'always_ne_ttext_text'; +ALWAYS_GE_TTEXT_TEXT: 'ALWAYS_GE_TTEXT_TEXT' | 'always_ge_ttext_text'; +ALWAYS_GT_TTEXT_TEXT: 'ALWAYS_GT_TTEXT_TEXT' | 'always_gt_ttext_text'; +ALWAYS_LE_TTEXT_TEXT: 'ALWAYS_LE_TTEXT_TEXT' | 'always_le_ttext_text'; +ALWAYS_LT_TTEXT_TEXT: 'ALWAYS_LT_TTEXT_TEXT' | 'always_lt_ttext_text'; +ALWAYS_EQ_TEXT_TTEXT: 'ALWAYS_EQ_TEXT_TTEXT' | 'always_eq_text_ttext'; +ALWAYS_NE_TEXT_TTEXT: 'ALWAYS_NE_TEXT_TTEXT' | 'always_ne_text_ttext'; +ALWAYS_GE_TEXT_TTEXT: 'ALWAYS_GE_TEXT_TTEXT' | 'always_ge_text_ttext'; +ALWAYS_GT_TEXT_TTEXT: 'ALWAYS_GT_TEXT_TTEXT' | 'always_gt_text_ttext'; +ALWAYS_LE_TEXT_TTEXT: 'ALWAYS_LE_TEXT_TTEXT' | 'always_le_text_ttext'; +ALWAYS_LT_TEXT_TTEXT: 'ALWAYS_LT_TEXT_TTEXT' | 'always_lt_text_ttext'; +TEQ_TTEXT_TEXT: 'TEQ_TTEXT_TEXT' | 'teq_ttext_text'; +TNE_TTEXT_TEXT: 'TNE_TTEXT_TEXT' | 'tne_ttext_text'; +TEQ_TEXT_TTEXT: 'TEQ_TEXT_TTEXT' | 'teq_text_ttext'; +TNE_TEXT_TTEXT: 'TNE_TEXT_TTEXT' | 'tne_text_ttext'; WATERMARK: 'WATERMARK' | 'watermark'; OFFSET: 'OFFSET' | 'offset'; LOCALHOST: 'LOCALHOST' | 'localhost'; diff --git a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp index fc61ea38d2..7a0a6c461b 100644 --- a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp +++ b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp @@ -297,6 +297,34 @@ #include #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include @@ -7602,6 +7630,818 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont } break; /* END CODEGEN PARSER GLUE: TBOOL_TO_TINT */ + /* BEGIN CODEGEN PARSER GLUE: EVER_EQ_TTEXT_TEXT */ + case AntlrSQLLexer::EVER_EQ_TTEXT_TEXT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("EVER_EQ_TTEXT_TEXT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverEqTtextTextLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: EVER_EQ_TTEXT_TEXT */ + /* BEGIN CODEGEN PARSER GLUE: EVER_NE_TTEXT_TEXT */ + case AntlrSQLLexer::EVER_NE_TTEXT_TEXT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("EVER_NE_TTEXT_TEXT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverNeTtextTextLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: EVER_NE_TTEXT_TEXT */ + /* BEGIN CODEGEN PARSER GLUE: EVER_GE_TTEXT_TEXT */ + case AntlrSQLLexer::EVER_GE_TTEXT_TEXT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("EVER_GE_TTEXT_TEXT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverGeTtextTextLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: EVER_GE_TTEXT_TEXT */ + /* BEGIN CODEGEN PARSER GLUE: EVER_GT_TTEXT_TEXT */ + case AntlrSQLLexer::EVER_GT_TTEXT_TEXT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("EVER_GT_TTEXT_TEXT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverGtTtextTextLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: EVER_GT_TTEXT_TEXT */ + /* BEGIN CODEGEN PARSER GLUE: EVER_LE_TTEXT_TEXT */ + case AntlrSQLLexer::EVER_LE_TTEXT_TEXT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("EVER_LE_TTEXT_TEXT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverLeTtextTextLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: EVER_LE_TTEXT_TEXT */ + /* BEGIN CODEGEN PARSER GLUE: EVER_LT_TTEXT_TEXT */ + case AntlrSQLLexer::EVER_LT_TTEXT_TEXT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("EVER_LT_TTEXT_TEXT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverLtTtextTextLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: EVER_LT_TTEXT_TEXT */ + /* BEGIN CODEGEN PARSER GLUE: EVER_EQ_TEXT_TTEXT */ + case AntlrSQLLexer::EVER_EQ_TEXT_TTEXT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("EVER_EQ_TEXT_TTEXT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverEqTextTtextLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: EVER_EQ_TEXT_TTEXT */ + /* BEGIN CODEGEN PARSER GLUE: EVER_NE_TEXT_TTEXT */ + case AntlrSQLLexer::EVER_NE_TEXT_TTEXT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("EVER_NE_TEXT_TTEXT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverNeTextTtextLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: EVER_NE_TEXT_TTEXT */ + /* BEGIN CODEGEN PARSER GLUE: EVER_GE_TEXT_TTEXT */ + case AntlrSQLLexer::EVER_GE_TEXT_TTEXT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("EVER_GE_TEXT_TTEXT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverGeTextTtextLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: EVER_GE_TEXT_TTEXT */ + /* BEGIN CODEGEN PARSER GLUE: EVER_GT_TEXT_TTEXT */ + case AntlrSQLLexer::EVER_GT_TEXT_TTEXT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("EVER_GT_TEXT_TTEXT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverGtTextTtextLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: EVER_GT_TEXT_TTEXT */ + /* BEGIN CODEGEN PARSER GLUE: EVER_LE_TEXT_TTEXT */ + case AntlrSQLLexer::EVER_LE_TEXT_TTEXT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("EVER_LE_TEXT_TTEXT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverLeTextTtextLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: EVER_LE_TEXT_TTEXT */ + /* BEGIN CODEGEN PARSER GLUE: EVER_LT_TEXT_TTEXT */ + case AntlrSQLLexer::EVER_LT_TEXT_TTEXT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("EVER_LT_TEXT_TTEXT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverLtTextTtextLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: EVER_LT_TEXT_TTEXT */ + /* BEGIN CODEGEN PARSER GLUE: ALWAYS_EQ_TTEXT_TEXT */ + case AntlrSQLLexer::ALWAYS_EQ_TTEXT_TEXT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("ALWAYS_EQ_TTEXT_TEXT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AlwaysEqTtextTextLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: ALWAYS_EQ_TTEXT_TEXT */ + /* BEGIN CODEGEN PARSER GLUE: ALWAYS_NE_TTEXT_TEXT */ + case AntlrSQLLexer::ALWAYS_NE_TTEXT_TEXT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("ALWAYS_NE_TTEXT_TEXT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AlwaysNeTtextTextLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: ALWAYS_NE_TTEXT_TEXT */ + /* BEGIN CODEGEN PARSER GLUE: ALWAYS_GE_TTEXT_TEXT */ + case AntlrSQLLexer::ALWAYS_GE_TTEXT_TEXT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("ALWAYS_GE_TTEXT_TEXT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AlwaysGeTtextTextLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: ALWAYS_GE_TTEXT_TEXT */ + /* BEGIN CODEGEN PARSER GLUE: ALWAYS_GT_TTEXT_TEXT */ + case AntlrSQLLexer::ALWAYS_GT_TTEXT_TEXT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("ALWAYS_GT_TTEXT_TEXT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AlwaysGtTtextTextLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: ALWAYS_GT_TTEXT_TEXT */ + /* BEGIN CODEGEN PARSER GLUE: ALWAYS_LE_TTEXT_TEXT */ + case AntlrSQLLexer::ALWAYS_LE_TTEXT_TEXT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("ALWAYS_LE_TTEXT_TEXT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AlwaysLeTtextTextLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: ALWAYS_LE_TTEXT_TEXT */ + /* BEGIN CODEGEN PARSER GLUE: ALWAYS_LT_TTEXT_TEXT */ + case AntlrSQLLexer::ALWAYS_LT_TTEXT_TEXT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("ALWAYS_LT_TTEXT_TEXT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AlwaysLtTtextTextLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: ALWAYS_LT_TTEXT_TEXT */ + /* BEGIN CODEGEN PARSER GLUE: ALWAYS_EQ_TEXT_TTEXT */ + case AntlrSQLLexer::ALWAYS_EQ_TEXT_TTEXT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("ALWAYS_EQ_TEXT_TTEXT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AlwaysEqTextTtextLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: ALWAYS_EQ_TEXT_TTEXT */ + /* BEGIN CODEGEN PARSER GLUE: ALWAYS_NE_TEXT_TTEXT */ + case AntlrSQLLexer::ALWAYS_NE_TEXT_TTEXT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("ALWAYS_NE_TEXT_TTEXT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AlwaysNeTextTtextLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: ALWAYS_NE_TEXT_TTEXT */ + /* BEGIN CODEGEN PARSER GLUE: ALWAYS_GE_TEXT_TTEXT */ + case AntlrSQLLexer::ALWAYS_GE_TEXT_TTEXT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("ALWAYS_GE_TEXT_TTEXT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AlwaysGeTextTtextLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: ALWAYS_GE_TEXT_TTEXT */ + /* BEGIN CODEGEN PARSER GLUE: ALWAYS_GT_TEXT_TTEXT */ + case AntlrSQLLexer::ALWAYS_GT_TEXT_TTEXT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("ALWAYS_GT_TEXT_TTEXT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AlwaysGtTextTtextLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: ALWAYS_GT_TEXT_TTEXT */ + /* BEGIN CODEGEN PARSER GLUE: ALWAYS_LE_TEXT_TTEXT */ + case AntlrSQLLexer::ALWAYS_LE_TEXT_TTEXT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("ALWAYS_LE_TEXT_TTEXT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AlwaysLeTextTtextLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: ALWAYS_LE_TEXT_TTEXT */ + /* BEGIN CODEGEN PARSER GLUE: ALWAYS_LT_TEXT_TTEXT */ + case AntlrSQLLexer::ALWAYS_LT_TEXT_TTEXT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("ALWAYS_LT_TEXT_TTEXT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AlwaysLtTextTtextLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: ALWAYS_LT_TEXT_TTEXT */ + /* BEGIN CODEGEN PARSER GLUE: TEQ_TTEXT_TEXT */ + case AntlrSQLLexer::TEQ_TTEXT_TEXT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("TEQ_TTEXT_TEXT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(TeqTtextTextLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: TEQ_TTEXT_TEXT */ + /* BEGIN CODEGEN PARSER GLUE: TNE_TTEXT_TEXT */ + case AntlrSQLLexer::TNE_TTEXT_TEXT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("TNE_TTEXT_TEXT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(TneTtextTextLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: TNE_TTEXT_TEXT */ + /* BEGIN CODEGEN PARSER GLUE: TEQ_TEXT_TTEXT */ + case AntlrSQLLexer::TEQ_TEXT_TTEXT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("TEQ_TEXT_TTEXT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(TeqTextTtextLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: TEQ_TEXT_TTEXT */ + /* BEGIN CODEGEN PARSER GLUE: TNE_TEXT_TTEXT */ + case AntlrSQLLexer::TNE_TEXT_TTEXT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("TNE_TEXT_TTEXT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(TneTextTtextLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: TNE_TEXT_TTEXT */ /* BEGIN CODEGEN PARSER GLUE: ALWAYS_EQ_TFLOAT_FLOAT */ case AntlrSQLLexer::ALWAYS_EQ_TFLOAT_FLOAT: { From 519b26f2b6a46a2a30c0a2607e36eef425e1664c Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Sun, 14 Jun 2026 06:51:36 +0200 Subject: [PATCH 43/96] feat(meos): add TGE/TGT/TLE/TLT_{TTEXT_TEXT,TEXT_TTEXT} NES operators (W94) Adds 8 per-event NES scalar operators for ordered comparison between a single-instant ttext and a text literal, in both argument orders: TGE_TTEXT_TEXT, TGE_TEXT_TTEXT, TGT_TTEXT_TEXT, TGT_TEXT_TTEXT, TLE_TTEXT_TEXT, TLE_TEXT_TTEXT, TLT_TTEXT_TEXT, TLT_TEXT_TTEXT. Each operator takes (textValue:VARCHAR, textRef:VARCHAR, ts:UINT64), builds a single-instant ttext via ttext_in, converts the reference string via cstring_to_text, delegates to the corresponding MEOS tge_*/tgt_*/tle_*/tlt_* kernel (returning a single-instant tbool), extracts the boolean result via tbool_start_value, and returns FLOAT64 1.0/0.0. Wired across logical/physical CMakeLists, AntlrSQL.g4 functionName rule and lexer section, and AntlrSQLQueryPlanCreator.cpp. --- .../Meos/TgeTextTtextLogicalFunction.hpp | 43 ++++ .../Meos/TgeTtextTextLogicalFunction.hpp | 43 ++++ .../Meos/TgtTextTtextLogicalFunction.hpp | 43 ++++ .../Meos/TgtTtextTextLogicalFunction.hpp | 43 ++++ .../Meos/TleTextTtextLogicalFunction.hpp | 43 ++++ .../Meos/TleTtextTextLogicalFunction.hpp | 43 ++++ .../Meos/TltTextTtextLogicalFunction.hpp | 43 ++++ .../Meos/TltTtextTextLogicalFunction.hpp | 43 ++++ .../src/Functions/Meos/CMakeLists.txt | 8 + .../Meos/TgeTextTtextLogicalFunction.cpp | 93 +++++++ .../Meos/TgeTtextTextLogicalFunction.cpp | 93 +++++++ .../Meos/TgtTextTtextLogicalFunction.cpp | 93 +++++++ .../Meos/TgtTtextTextLogicalFunction.cpp | 93 +++++++ .../Meos/TleTextTtextLogicalFunction.cpp | 93 +++++++ .../Meos/TleTtextTextLogicalFunction.cpp | 93 +++++++ .../Meos/TltTextTtextLogicalFunction.cpp | 93 +++++++ .../Meos/TltTtextTextLogicalFunction.cpp | 93 +++++++ .../Meos/TgeTextTtextPhysicalFunction.hpp | 36 +++ .../Meos/TgeTtextTextPhysicalFunction.hpp | 36 +++ .../Meos/TgtTextTtextPhysicalFunction.hpp | 36 +++ .../Meos/TgtTtextTextPhysicalFunction.hpp | 36 +++ .../Meos/TleTextTtextPhysicalFunction.hpp | 36 +++ .../Meos/TleTtextTextPhysicalFunction.hpp | 36 +++ .../Meos/TltTextTtextPhysicalFunction.hpp | 36 +++ .../Meos/TltTtextTextPhysicalFunction.hpp | 36 +++ .../src/Functions/Meos/CMakeLists.txt | 8 + .../Meos/TgeTextTtextPhysicalFunction.cpp | 93 +++++++ .../Meos/TgeTtextTextPhysicalFunction.cpp | 93 +++++++ .../Meos/TgtTextTtextPhysicalFunction.cpp | 93 +++++++ .../Meos/TgtTtextTextPhysicalFunction.cpp | 93 +++++++ .../Meos/TleTextTtextPhysicalFunction.cpp | 93 +++++++ .../Meos/TleTtextTextPhysicalFunction.cpp | 93 +++++++ .../Meos/TltTextTtextPhysicalFunction.cpp | 93 +++++++ .../Meos/TltTtextTextPhysicalFunction.cpp | 93 +++++++ nes-sql-parser/AntlrSQL.g4 | 10 +- .../src/AntlrSQLQueryPlanCreator.cpp | 240 ++++++++++++++++++ 36 files changed, 2385 insertions(+), 1 deletion(-) create mode 100644 nes-logical-operators/include/Functions/Meos/TgeTextTtextLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TgeTtextTextLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TgtTextTtextLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TgtTtextTextLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TleTextTtextLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TleTtextTextLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TltTextTtextLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TltTtextTextLogicalFunction.hpp create mode 100644 nes-logical-operators/src/Functions/Meos/TgeTextTtextLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TgeTtextTextLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TgtTextTtextLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TgtTtextTextLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TleTextTtextLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TleTtextTextLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TltTextTtextLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TltTtextTextLogicalFunction.cpp create mode 100644 nes-physical-operators/include/Functions/Meos/TgeTextTtextPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TgeTtextTextPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TgtTextTtextPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TgtTtextTextPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TleTextTtextPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TleTtextTextPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TltTextTtextPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TltTtextTextPhysicalFunction.hpp create mode 100644 nes-physical-operators/src/Functions/Meos/TgeTextTtextPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TgeTtextTextPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TgtTextTtextPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TgtTtextTextPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TleTextTtextPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TleTtextTextPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TltTextTtextPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TltTtextTextPhysicalFunction.cpp diff --git a/nes-logical-operators/include/Functions/Meos/TgeTextTtextLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TgeTextTtextLogicalFunction.hpp new file mode 100644 index 0000000000..8bb1537430 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TgeTextTtextLogicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once +#include +#include +#include + +namespace NES { + +class TgeTextTtextLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TgeTextTtext"; + + TgeTextTtextLogicalFunction(LogicalFunction value, LogicalFunction ref, LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType&) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector&) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept&) const override; + std::string explain(ExplainVerbosity) const override; + LogicalFunction withInferredDataType(const Schema&) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TgeTtextTextLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TgeTtextTextLogicalFunction.hpp new file mode 100644 index 0000000000..7a7930e4ae --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TgeTtextTextLogicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once +#include +#include +#include + +namespace NES { + +class TgeTtextTextLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TgeTtextText"; + + TgeTtextTextLogicalFunction(LogicalFunction value, LogicalFunction ref, LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType&) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector&) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept&) const override; + std::string explain(ExplainVerbosity) const override; + LogicalFunction withInferredDataType(const Schema&) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TgtTextTtextLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TgtTextTtextLogicalFunction.hpp new file mode 100644 index 0000000000..27076a6c84 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TgtTextTtextLogicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once +#include +#include +#include + +namespace NES { + +class TgtTextTtextLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TgtTextTtext"; + + TgtTextTtextLogicalFunction(LogicalFunction value, LogicalFunction ref, LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType&) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector&) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept&) const override; + std::string explain(ExplainVerbosity) const override; + LogicalFunction withInferredDataType(const Schema&) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TgtTtextTextLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TgtTtextTextLogicalFunction.hpp new file mode 100644 index 0000000000..c060c8b492 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TgtTtextTextLogicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once +#include +#include +#include + +namespace NES { + +class TgtTtextTextLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TgtTtextText"; + + TgtTtextTextLogicalFunction(LogicalFunction value, LogicalFunction ref, LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType&) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector&) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept&) const override; + std::string explain(ExplainVerbosity) const override; + LogicalFunction withInferredDataType(const Schema&) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TleTextTtextLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TleTextTtextLogicalFunction.hpp new file mode 100644 index 0000000000..fcff9befd6 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TleTextTtextLogicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once +#include +#include +#include + +namespace NES { + +class TleTextTtextLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TleTextTtext"; + + TleTextTtextLogicalFunction(LogicalFunction value, LogicalFunction ref, LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType&) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector&) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept&) const override; + std::string explain(ExplainVerbosity) const override; + LogicalFunction withInferredDataType(const Schema&) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TleTtextTextLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TleTtextTextLogicalFunction.hpp new file mode 100644 index 0000000000..e2440ecbb8 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TleTtextTextLogicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once +#include +#include +#include + +namespace NES { + +class TleTtextTextLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TleTtextText"; + + TleTtextTextLogicalFunction(LogicalFunction value, LogicalFunction ref, LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType&) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector&) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept&) const override; + std::string explain(ExplainVerbosity) const override; + LogicalFunction withInferredDataType(const Schema&) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TltTextTtextLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TltTextTtextLogicalFunction.hpp new file mode 100644 index 0000000000..ec8e33ee68 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TltTextTtextLogicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once +#include +#include +#include + +namespace NES { + +class TltTextTtextLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TltTextTtext"; + + TltTextTtextLogicalFunction(LogicalFunction value, LogicalFunction ref, LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType&) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector&) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept&) const override; + std::string explain(ExplainVerbosity) const override; + LogicalFunction withInferredDataType(const Schema&) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TltTtextTextLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TltTtextTextLogicalFunction.hpp new file mode 100644 index 0000000000..bd51064f6a --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TltTtextTextLogicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once +#include +#include +#include + +namespace NES { + +class TltTtextTextLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TltTtextText"; + + TltTtextTextLogicalFunction(LogicalFunction value, LogicalFunction ref, LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType&) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector&) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept&) const override; + std::string explain(ExplainVerbosity) const override; + LogicalFunction withInferredDataType(const Schema&) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt index 1791eb41ff..367216d983 100644 --- a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt @@ -274,3 +274,11 @@ add_plugin(TeqTtextText LogicalFunction nes-logical-operators TeqTtextTextLogica add_plugin(TneTtextText LogicalFunction nes-logical-operators TneTtextTextLogicalFunction.cpp) add_plugin(TeqTextTtext LogicalFunction nes-logical-operators TeqTextTtextLogicalFunction.cpp) add_plugin(TneTextTtext LogicalFunction nes-logical-operators TneTextTtextLogicalFunction.cpp) +add_plugin(TgeTtextText LogicalFunction nes-logical-operators TgeTtextTextLogicalFunction.cpp) +add_plugin(TgeTextTtext LogicalFunction nes-logical-operators TgeTextTtextLogicalFunction.cpp) +add_plugin(TgtTtextText LogicalFunction nes-logical-operators TgtTtextTextLogicalFunction.cpp) +add_plugin(TgtTextTtext LogicalFunction nes-logical-operators TgtTextTtextLogicalFunction.cpp) +add_plugin(TleTtextText LogicalFunction nes-logical-operators TleTtextTextLogicalFunction.cpp) +add_plugin(TleTextTtext LogicalFunction nes-logical-operators TleTextTtextLogicalFunction.cpp) +add_plugin(TltTtextText LogicalFunction nes-logical-operators TltTtextTextLogicalFunction.cpp) +add_plugin(TltTextTtext LogicalFunction nes-logical-operators TltTextTtextLogicalFunction.cpp) diff --git a/nes-logical-operators/src/Functions/Meos/TgeTextTtextLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TgeTextTtextLogicalFunction.cpp new file mode 100644 index 0000000000..429fa56ba6 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TgeTextTtextLogicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES { + +TgeTextTtextLogicalFunction::TgeTextTtextLogicalFunction( + LogicalFunction value, LogicalFunction ref, LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { + parameters = {std::move(value), std::move(ref), std::move(ts)}; +} + +DataType TgeTextTtextLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction TgeTextTtextLogicalFunction::withDataType(const DataType& dt) const { + auto c = *this; c.dataType = dt; return c; +} + +std::vector TgeTextTtextLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction TgeTextTtextLogicalFunction::withChildren(const std::vector& ch) const { + PRECONDITION(ch.size() == 3, "TgeTextTtext expects 3 params, got {}", ch.size()); + auto c = *this; c.parameters = ch; return c; +} + +std::string_view TgeTextTtextLogicalFunction::getType() const { return NAME; } + +bool TgeTextTtextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + const auto* o = dynamic_cast(&rhs); + return o && parameters == o->parameters; +} + +std::string TgeTextTtextLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("TgeTextTtext({}, {}, {})", + parameters[0].explain(v), parameters[1].explain(v), parameters[2].explain(v)); +} + +LogicalFunction TgeTextTtextLogicalFunction::withInferredDataType(const Schema& s) const { + std::vector ch; + ch.reserve(3); + for (auto& p : parameters) ch.push_back(p.withInferredDataType(s)); + auto isStr = [](const DataType& dt) { return dt.isType(DataType::Type::VARSIZED); }; + auto isTime = [](const DataType& dt) { return dt.isType(DataType::Type::UINT64); }; + INVARIANT(isStr(ch[0].getDataType()) && isStr(ch[1].getDataType()) && isTime(ch[2].getDataType()), + "TgeTextTtext: expects (VARCHAR, VARCHAR, UINT64)"); + return withChildren(ch); +} + +SerializableFunction TgeTextTtextLogicalFunction::serialize() const { + SerializableFunction sf; + sf.set_function_type(std::string(NAME)); + for (auto& p : parameters) *sf.add_children() = p.serialize(); + DataTypeSerializationUtil::serializeDataType(dataType, sf.mutable_data_type()); + return sf; +} + +LogicalFunctionRegistryReturnType +LogicalFunctionGeneratedRegistrar::RegisterTgeTextTtextLogicalFunction( + LogicalFunctionRegistryArguments arguments) { + PRECONDITION(arguments.children.size() == 3, + "TgeTextTtext expects 3 params, got {}", arguments.children.size()); + return TgeTextTtextLogicalFunction( + arguments.children[0], arguments.children[1], arguments.children[2]); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TgeTtextTextLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TgeTtextTextLogicalFunction.cpp new file mode 100644 index 0000000000..f5b37484ef --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TgeTtextTextLogicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES { + +TgeTtextTextLogicalFunction::TgeTtextTextLogicalFunction( + LogicalFunction value, LogicalFunction ref, LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { + parameters = {std::move(value), std::move(ref), std::move(ts)}; +} + +DataType TgeTtextTextLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction TgeTtextTextLogicalFunction::withDataType(const DataType& dt) const { + auto c = *this; c.dataType = dt; return c; +} + +std::vector TgeTtextTextLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction TgeTtextTextLogicalFunction::withChildren(const std::vector& ch) const { + PRECONDITION(ch.size() == 3, "TgeTtextText expects 3 params, got {}", ch.size()); + auto c = *this; c.parameters = ch; return c; +} + +std::string_view TgeTtextTextLogicalFunction::getType() const { return NAME; } + +bool TgeTtextTextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + const auto* o = dynamic_cast(&rhs); + return o && parameters == o->parameters; +} + +std::string TgeTtextTextLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("TgeTtextText({}, {}, {})", + parameters[0].explain(v), parameters[1].explain(v), parameters[2].explain(v)); +} + +LogicalFunction TgeTtextTextLogicalFunction::withInferredDataType(const Schema& s) const { + std::vector ch; + ch.reserve(3); + for (auto& p : parameters) ch.push_back(p.withInferredDataType(s)); + auto isStr = [](const DataType& dt) { return dt.isType(DataType::Type::VARSIZED); }; + auto isTime = [](const DataType& dt) { return dt.isType(DataType::Type::UINT64); }; + INVARIANT(isStr(ch[0].getDataType()) && isStr(ch[1].getDataType()) && isTime(ch[2].getDataType()), + "TgeTtextText: expects (VARCHAR, VARCHAR, UINT64)"); + return withChildren(ch); +} + +SerializableFunction TgeTtextTextLogicalFunction::serialize() const { + SerializableFunction sf; + sf.set_function_type(std::string(NAME)); + for (auto& p : parameters) *sf.add_children() = p.serialize(); + DataTypeSerializationUtil::serializeDataType(dataType, sf.mutable_data_type()); + return sf; +} + +LogicalFunctionRegistryReturnType +LogicalFunctionGeneratedRegistrar::RegisterTgeTtextTextLogicalFunction( + LogicalFunctionRegistryArguments arguments) { + PRECONDITION(arguments.children.size() == 3, + "TgeTtextText expects 3 params, got {}", arguments.children.size()); + return TgeTtextTextLogicalFunction( + arguments.children[0], arguments.children[1], arguments.children[2]); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TgtTextTtextLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TgtTextTtextLogicalFunction.cpp new file mode 100644 index 0000000000..1abb3ac98f --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TgtTextTtextLogicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES { + +TgtTextTtextLogicalFunction::TgtTextTtextLogicalFunction( + LogicalFunction value, LogicalFunction ref, LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { + parameters = {std::move(value), std::move(ref), std::move(ts)}; +} + +DataType TgtTextTtextLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction TgtTextTtextLogicalFunction::withDataType(const DataType& dt) const { + auto c = *this; c.dataType = dt; return c; +} + +std::vector TgtTextTtextLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction TgtTextTtextLogicalFunction::withChildren(const std::vector& ch) const { + PRECONDITION(ch.size() == 3, "TgtTextTtext expects 3 params, got {}", ch.size()); + auto c = *this; c.parameters = ch; return c; +} + +std::string_view TgtTextTtextLogicalFunction::getType() const { return NAME; } + +bool TgtTextTtextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + const auto* o = dynamic_cast(&rhs); + return o && parameters == o->parameters; +} + +std::string TgtTextTtextLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("TgtTextTtext({}, {}, {})", + parameters[0].explain(v), parameters[1].explain(v), parameters[2].explain(v)); +} + +LogicalFunction TgtTextTtextLogicalFunction::withInferredDataType(const Schema& s) const { + std::vector ch; + ch.reserve(3); + for (auto& p : parameters) ch.push_back(p.withInferredDataType(s)); + auto isStr = [](const DataType& dt) { return dt.isType(DataType::Type::VARSIZED); }; + auto isTime = [](const DataType& dt) { return dt.isType(DataType::Type::UINT64); }; + INVARIANT(isStr(ch[0].getDataType()) && isStr(ch[1].getDataType()) && isTime(ch[2].getDataType()), + "TgtTextTtext: expects (VARCHAR, VARCHAR, UINT64)"); + return withChildren(ch); +} + +SerializableFunction TgtTextTtextLogicalFunction::serialize() const { + SerializableFunction sf; + sf.set_function_type(std::string(NAME)); + for (auto& p : parameters) *sf.add_children() = p.serialize(); + DataTypeSerializationUtil::serializeDataType(dataType, sf.mutable_data_type()); + return sf; +} + +LogicalFunctionRegistryReturnType +LogicalFunctionGeneratedRegistrar::RegisterTgtTextTtextLogicalFunction( + LogicalFunctionRegistryArguments arguments) { + PRECONDITION(arguments.children.size() == 3, + "TgtTextTtext expects 3 params, got {}", arguments.children.size()); + return TgtTextTtextLogicalFunction( + arguments.children[0], arguments.children[1], arguments.children[2]); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TgtTtextTextLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TgtTtextTextLogicalFunction.cpp new file mode 100644 index 0000000000..63d0082c52 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TgtTtextTextLogicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES { + +TgtTtextTextLogicalFunction::TgtTtextTextLogicalFunction( + LogicalFunction value, LogicalFunction ref, LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { + parameters = {std::move(value), std::move(ref), std::move(ts)}; +} + +DataType TgtTtextTextLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction TgtTtextTextLogicalFunction::withDataType(const DataType& dt) const { + auto c = *this; c.dataType = dt; return c; +} + +std::vector TgtTtextTextLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction TgtTtextTextLogicalFunction::withChildren(const std::vector& ch) const { + PRECONDITION(ch.size() == 3, "TgtTtextText expects 3 params, got {}", ch.size()); + auto c = *this; c.parameters = ch; return c; +} + +std::string_view TgtTtextTextLogicalFunction::getType() const { return NAME; } + +bool TgtTtextTextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + const auto* o = dynamic_cast(&rhs); + return o && parameters == o->parameters; +} + +std::string TgtTtextTextLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("TgtTtextText({}, {}, {})", + parameters[0].explain(v), parameters[1].explain(v), parameters[2].explain(v)); +} + +LogicalFunction TgtTtextTextLogicalFunction::withInferredDataType(const Schema& s) const { + std::vector ch; + ch.reserve(3); + for (auto& p : parameters) ch.push_back(p.withInferredDataType(s)); + auto isStr = [](const DataType& dt) { return dt.isType(DataType::Type::VARSIZED); }; + auto isTime = [](const DataType& dt) { return dt.isType(DataType::Type::UINT64); }; + INVARIANT(isStr(ch[0].getDataType()) && isStr(ch[1].getDataType()) && isTime(ch[2].getDataType()), + "TgtTtextText: expects (VARCHAR, VARCHAR, UINT64)"); + return withChildren(ch); +} + +SerializableFunction TgtTtextTextLogicalFunction::serialize() const { + SerializableFunction sf; + sf.set_function_type(std::string(NAME)); + for (auto& p : parameters) *sf.add_children() = p.serialize(); + DataTypeSerializationUtil::serializeDataType(dataType, sf.mutable_data_type()); + return sf; +} + +LogicalFunctionRegistryReturnType +LogicalFunctionGeneratedRegistrar::RegisterTgtTtextTextLogicalFunction( + LogicalFunctionRegistryArguments arguments) { + PRECONDITION(arguments.children.size() == 3, + "TgtTtextText expects 3 params, got {}", arguments.children.size()); + return TgtTtextTextLogicalFunction( + arguments.children[0], arguments.children[1], arguments.children[2]); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TleTextTtextLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TleTextTtextLogicalFunction.cpp new file mode 100644 index 0000000000..5151df6e5c --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TleTextTtextLogicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES { + +TleTextTtextLogicalFunction::TleTextTtextLogicalFunction( + LogicalFunction value, LogicalFunction ref, LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { + parameters = {std::move(value), std::move(ref), std::move(ts)}; +} + +DataType TleTextTtextLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction TleTextTtextLogicalFunction::withDataType(const DataType& dt) const { + auto c = *this; c.dataType = dt; return c; +} + +std::vector TleTextTtextLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction TleTextTtextLogicalFunction::withChildren(const std::vector& ch) const { + PRECONDITION(ch.size() == 3, "TleTextTtext expects 3 params, got {}", ch.size()); + auto c = *this; c.parameters = ch; return c; +} + +std::string_view TleTextTtextLogicalFunction::getType() const { return NAME; } + +bool TleTextTtextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + const auto* o = dynamic_cast(&rhs); + return o && parameters == o->parameters; +} + +std::string TleTextTtextLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("TleTextTtext({}, {}, {})", + parameters[0].explain(v), parameters[1].explain(v), parameters[2].explain(v)); +} + +LogicalFunction TleTextTtextLogicalFunction::withInferredDataType(const Schema& s) const { + std::vector ch; + ch.reserve(3); + for (auto& p : parameters) ch.push_back(p.withInferredDataType(s)); + auto isStr = [](const DataType& dt) { return dt.isType(DataType::Type::VARSIZED); }; + auto isTime = [](const DataType& dt) { return dt.isType(DataType::Type::UINT64); }; + INVARIANT(isStr(ch[0].getDataType()) && isStr(ch[1].getDataType()) && isTime(ch[2].getDataType()), + "TleTextTtext: expects (VARCHAR, VARCHAR, UINT64)"); + return withChildren(ch); +} + +SerializableFunction TleTextTtextLogicalFunction::serialize() const { + SerializableFunction sf; + sf.set_function_type(std::string(NAME)); + for (auto& p : parameters) *sf.add_children() = p.serialize(); + DataTypeSerializationUtil::serializeDataType(dataType, sf.mutable_data_type()); + return sf; +} + +LogicalFunctionRegistryReturnType +LogicalFunctionGeneratedRegistrar::RegisterTleTextTtextLogicalFunction( + LogicalFunctionRegistryArguments arguments) { + PRECONDITION(arguments.children.size() == 3, + "TleTextTtext expects 3 params, got {}", arguments.children.size()); + return TleTextTtextLogicalFunction( + arguments.children[0], arguments.children[1], arguments.children[2]); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TleTtextTextLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TleTtextTextLogicalFunction.cpp new file mode 100644 index 0000000000..cf4febc98e --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TleTtextTextLogicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES { + +TleTtextTextLogicalFunction::TleTtextTextLogicalFunction( + LogicalFunction value, LogicalFunction ref, LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { + parameters = {std::move(value), std::move(ref), std::move(ts)}; +} + +DataType TleTtextTextLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction TleTtextTextLogicalFunction::withDataType(const DataType& dt) const { + auto c = *this; c.dataType = dt; return c; +} + +std::vector TleTtextTextLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction TleTtextTextLogicalFunction::withChildren(const std::vector& ch) const { + PRECONDITION(ch.size() == 3, "TleTtextText expects 3 params, got {}", ch.size()); + auto c = *this; c.parameters = ch; return c; +} + +std::string_view TleTtextTextLogicalFunction::getType() const { return NAME; } + +bool TleTtextTextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + const auto* o = dynamic_cast(&rhs); + return o && parameters == o->parameters; +} + +std::string TleTtextTextLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("TleTtextText({}, {}, {})", + parameters[0].explain(v), parameters[1].explain(v), parameters[2].explain(v)); +} + +LogicalFunction TleTtextTextLogicalFunction::withInferredDataType(const Schema& s) const { + std::vector ch; + ch.reserve(3); + for (auto& p : parameters) ch.push_back(p.withInferredDataType(s)); + auto isStr = [](const DataType& dt) { return dt.isType(DataType::Type::VARSIZED); }; + auto isTime = [](const DataType& dt) { return dt.isType(DataType::Type::UINT64); }; + INVARIANT(isStr(ch[0].getDataType()) && isStr(ch[1].getDataType()) && isTime(ch[2].getDataType()), + "TleTtextText: expects (VARCHAR, VARCHAR, UINT64)"); + return withChildren(ch); +} + +SerializableFunction TleTtextTextLogicalFunction::serialize() const { + SerializableFunction sf; + sf.set_function_type(std::string(NAME)); + for (auto& p : parameters) *sf.add_children() = p.serialize(); + DataTypeSerializationUtil::serializeDataType(dataType, sf.mutable_data_type()); + return sf; +} + +LogicalFunctionRegistryReturnType +LogicalFunctionGeneratedRegistrar::RegisterTleTtextTextLogicalFunction( + LogicalFunctionRegistryArguments arguments) { + PRECONDITION(arguments.children.size() == 3, + "TleTtextText expects 3 params, got {}", arguments.children.size()); + return TleTtextTextLogicalFunction( + arguments.children[0], arguments.children[1], arguments.children[2]); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TltTextTtextLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TltTextTtextLogicalFunction.cpp new file mode 100644 index 0000000000..2ae91d552a --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TltTextTtextLogicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES { + +TltTextTtextLogicalFunction::TltTextTtextLogicalFunction( + LogicalFunction value, LogicalFunction ref, LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { + parameters = {std::move(value), std::move(ref), std::move(ts)}; +} + +DataType TltTextTtextLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction TltTextTtextLogicalFunction::withDataType(const DataType& dt) const { + auto c = *this; c.dataType = dt; return c; +} + +std::vector TltTextTtextLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction TltTextTtextLogicalFunction::withChildren(const std::vector& ch) const { + PRECONDITION(ch.size() == 3, "TltTextTtext expects 3 params, got {}", ch.size()); + auto c = *this; c.parameters = ch; return c; +} + +std::string_view TltTextTtextLogicalFunction::getType() const { return NAME; } + +bool TltTextTtextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + const auto* o = dynamic_cast(&rhs); + return o && parameters == o->parameters; +} + +std::string TltTextTtextLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("TltTextTtext({}, {}, {})", + parameters[0].explain(v), parameters[1].explain(v), parameters[2].explain(v)); +} + +LogicalFunction TltTextTtextLogicalFunction::withInferredDataType(const Schema& s) const { + std::vector ch; + ch.reserve(3); + for (auto& p : parameters) ch.push_back(p.withInferredDataType(s)); + auto isStr = [](const DataType& dt) { return dt.isType(DataType::Type::VARSIZED); }; + auto isTime = [](const DataType& dt) { return dt.isType(DataType::Type::UINT64); }; + INVARIANT(isStr(ch[0].getDataType()) && isStr(ch[1].getDataType()) && isTime(ch[2].getDataType()), + "TltTextTtext: expects (VARCHAR, VARCHAR, UINT64)"); + return withChildren(ch); +} + +SerializableFunction TltTextTtextLogicalFunction::serialize() const { + SerializableFunction sf; + sf.set_function_type(std::string(NAME)); + for (auto& p : parameters) *sf.add_children() = p.serialize(); + DataTypeSerializationUtil::serializeDataType(dataType, sf.mutable_data_type()); + return sf; +} + +LogicalFunctionRegistryReturnType +LogicalFunctionGeneratedRegistrar::RegisterTltTextTtextLogicalFunction( + LogicalFunctionRegistryArguments arguments) { + PRECONDITION(arguments.children.size() == 3, + "TltTextTtext expects 3 params, got {}", arguments.children.size()); + return TltTextTtextLogicalFunction( + arguments.children[0], arguments.children[1], arguments.children[2]); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TltTtextTextLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TltTtextTextLogicalFunction.cpp new file mode 100644 index 0000000000..24978b502e --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TltTtextTextLogicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES { + +TltTtextTextLogicalFunction::TltTtextTextLogicalFunction( + LogicalFunction value, LogicalFunction ref, LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { + parameters = {std::move(value), std::move(ref), std::move(ts)}; +} + +DataType TltTtextTextLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction TltTtextTextLogicalFunction::withDataType(const DataType& dt) const { + auto c = *this; c.dataType = dt; return c; +} + +std::vector TltTtextTextLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction TltTtextTextLogicalFunction::withChildren(const std::vector& ch) const { + PRECONDITION(ch.size() == 3, "TltTtextText expects 3 params, got {}", ch.size()); + auto c = *this; c.parameters = ch; return c; +} + +std::string_view TltTtextTextLogicalFunction::getType() const { return NAME; } + +bool TltTtextTextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + const auto* o = dynamic_cast(&rhs); + return o && parameters == o->parameters; +} + +std::string TltTtextTextLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("TltTtextText({}, {}, {})", + parameters[0].explain(v), parameters[1].explain(v), parameters[2].explain(v)); +} + +LogicalFunction TltTtextTextLogicalFunction::withInferredDataType(const Schema& s) const { + std::vector ch; + ch.reserve(3); + for (auto& p : parameters) ch.push_back(p.withInferredDataType(s)); + auto isStr = [](const DataType& dt) { return dt.isType(DataType::Type::VARSIZED); }; + auto isTime = [](const DataType& dt) { return dt.isType(DataType::Type::UINT64); }; + INVARIANT(isStr(ch[0].getDataType()) && isStr(ch[1].getDataType()) && isTime(ch[2].getDataType()), + "TltTtextText: expects (VARCHAR, VARCHAR, UINT64)"); + return withChildren(ch); +} + +SerializableFunction TltTtextTextLogicalFunction::serialize() const { + SerializableFunction sf; + sf.set_function_type(std::string(NAME)); + for (auto& p : parameters) *sf.add_children() = p.serialize(); + DataTypeSerializationUtil::serializeDataType(dataType, sf.mutable_data_type()); + return sf; +} + +LogicalFunctionRegistryReturnType +LogicalFunctionGeneratedRegistrar::RegisterTltTtextTextLogicalFunction( + LogicalFunctionRegistryArguments arguments) { + PRECONDITION(arguments.children.size() == 3, + "TltTtextText expects 3 params, got {}", arguments.children.size()); + return TltTtextTextLogicalFunction( + arguments.children[0], arguments.children[1], arguments.children[2]); +} + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TgeTextTtextPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TgeTextTtextPhysicalFunction.hpp new file mode 100644 index 0000000000..a309a82757 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TgeTextTtextPhysicalFunction.hpp @@ -0,0 +1,36 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class TgeTextTtextPhysicalFunction : public PhysicalFunctionConcept { +public: + TgeTextTtextPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction refFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TgeTtextTextPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TgeTtextTextPhysicalFunction.hpp new file mode 100644 index 0000000000..baa8635e82 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TgeTtextTextPhysicalFunction.hpp @@ -0,0 +1,36 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class TgeTtextTextPhysicalFunction : public PhysicalFunctionConcept { +public: + TgeTtextTextPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction refFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TgtTextTtextPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TgtTextTtextPhysicalFunction.hpp new file mode 100644 index 0000000000..f0f7528b53 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TgtTextTtextPhysicalFunction.hpp @@ -0,0 +1,36 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class TgtTextTtextPhysicalFunction : public PhysicalFunctionConcept { +public: + TgtTextTtextPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction refFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TgtTtextTextPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TgtTtextTextPhysicalFunction.hpp new file mode 100644 index 0000000000..5b7308bdd9 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TgtTtextTextPhysicalFunction.hpp @@ -0,0 +1,36 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class TgtTtextTextPhysicalFunction : public PhysicalFunctionConcept { +public: + TgtTtextTextPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction refFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TleTextTtextPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TleTextTtextPhysicalFunction.hpp new file mode 100644 index 0000000000..c79541223f --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TleTextTtextPhysicalFunction.hpp @@ -0,0 +1,36 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class TleTextTtextPhysicalFunction : public PhysicalFunctionConcept { +public: + TleTextTtextPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction refFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TleTtextTextPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TleTtextTextPhysicalFunction.hpp new file mode 100644 index 0000000000..fc2b5f13d4 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TleTtextTextPhysicalFunction.hpp @@ -0,0 +1,36 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class TleTtextTextPhysicalFunction : public PhysicalFunctionConcept { +public: + TleTtextTextPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction refFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TltTextTtextPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TltTextTtextPhysicalFunction.hpp new file mode 100644 index 0000000000..9b69c258ef --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TltTextTtextPhysicalFunction.hpp @@ -0,0 +1,36 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class TltTextTtextPhysicalFunction : public PhysicalFunctionConcept { +public: + TltTextTtextPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction refFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TltTtextTextPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TltTtextTextPhysicalFunction.hpp new file mode 100644 index 0000000000..eed9e7c902 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TltTtextTextPhysicalFunction.hpp @@ -0,0 +1,36 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class TltTtextTextPhysicalFunction : public PhysicalFunctionConcept { +public: + TltTtextTextPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction refFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt index 7a1ba07400..4dd15337c1 100644 --- a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt @@ -273,4 +273,12 @@ add_plugin(TeqTtextText PhysicalFunction nes-physical-operators TeqTtextTextPhys add_plugin(TneTtextText PhysicalFunction nes-physical-operators TneTtextTextPhysicalFunction.cpp) add_plugin(TeqTextTtext PhysicalFunction nes-physical-operators TeqTextTtextPhysicalFunction.cpp) add_plugin(TneTextTtext PhysicalFunction nes-physical-operators TneTextTtextPhysicalFunction.cpp) +add_plugin(TgeTtextText PhysicalFunction nes-physical-operators TgeTtextTextPhysicalFunction.cpp) +add_plugin(TgeTextTtext PhysicalFunction nes-physical-operators TgeTextTtextPhysicalFunction.cpp) +add_plugin(TgtTtextText PhysicalFunction nes-physical-operators TgtTtextTextPhysicalFunction.cpp) +add_plugin(TgtTextTtext PhysicalFunction nes-physical-operators TgtTextTtextPhysicalFunction.cpp) +add_plugin(TleTtextText PhysicalFunction nes-physical-operators TleTtextTextPhysicalFunction.cpp) +add_plugin(TleTextTtext PhysicalFunction nes-physical-operators TleTextTtextPhysicalFunction.cpp) +add_plugin(TltTtextText PhysicalFunction nes-physical-operators TltTtextTextPhysicalFunction.cpp) +add_plugin(TltTextTtext PhysicalFunction nes-physical-operators TltTextTtextPhysicalFunction.cpp) endif() diff --git a/nes-physical-operators/src/Functions/Meos/TgeTextTtextPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TgeTextTtextPhysicalFunction.cpp new file mode 100644 index 0000000000..e66a0fa702 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TgeTextTtextPhysicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +} + +namespace NES { + +TgeTextTtextPhysicalFunction::TgeTextTtextPhysicalFunction( + PhysicalFunction valueFunction, PhysicalFunction refFunction, PhysicalFunction tsFunction) +{ + paramFns.reserve(3); + paramFns.push_back(std::move(valueFunction)); + paramFns.push_back(std::move(refFunction)); + paramFns.push_back(std::move(tsFunction)); +} + +VarVal TgeTextTtextPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto ref = paramFns[0].execute(record, arena).cast(); + auto value = paramFns[1].execute(record, arena).cast(); + auto ts = paramFns[2].execute(record, arena).cast>(); + + const auto result = nautilus::invoke( + +[](const char* r, uint32_t rsz, const char* v, uint32_t vsz, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ref_str(r, rsz); + std::string val_str(v, vsz); + while (!ref_str.empty() && (ref_str.front() == '\'' || ref_str.front() == '"')) ref_str = ref_str.substr(1); + while (!ref_str.empty() && (ref_str.back() == '\'' || ref_str.back() == '"')) ref_str = ref_str.substr(0, ref_str.size()-1); + while (!val_str.empty() && (val_str.front() == '\'' || val_str.front() == '"')) val_str = val_str.substr(1); + while (!val_str.empty() && (val_str.back() == '\'' || val_str.back() == '"')) val_str = val_str.substr(0, val_str.size()-1); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = "'" + val_str + "'@" + ts_str; + Temporal* temp = ttext_in(wkt.c_str()); + if (!temp) return 0.0; + text* txt = cstring_to_text(ref_str.c_str()); + if (!txt) { free(temp); return 0.0; } + Temporal* res = tge_text_ttext(txt, temp); + free(temp); + free(txt); + if (!res) return 0.0; + bool v2 = tbool_start_value(res); + free(res); + return v2 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + ref, value, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTgeTextTtextPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "TgeTextTtextPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + return TgeTextTtextPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TgeTtextTextPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TgeTtextTextPhysicalFunction.cpp new file mode 100644 index 0000000000..070d5b7d48 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TgeTtextTextPhysicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +} + +namespace NES { + +TgeTtextTextPhysicalFunction::TgeTtextTextPhysicalFunction( + PhysicalFunction valueFunction, PhysicalFunction refFunction, PhysicalFunction tsFunction) +{ + paramFns.reserve(3); + paramFns.push_back(std::move(valueFunction)); + paramFns.push_back(std::move(refFunction)); + paramFns.push_back(std::move(tsFunction)); +} + +VarVal TgeTtextTextPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto value = paramFns[0].execute(record, arena).cast(); + auto ref = paramFns[1].execute(record, arena).cast(); + auto ts = paramFns[2].execute(record, arena).cast>(); + + const auto result = nautilus::invoke( + +[](const char* v, uint32_t vsz, const char* r, uint32_t rsz, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string val_str(v, vsz); + std::string ref_str(r, rsz); + while (!val_str.empty() && (val_str.front() == '\'' || val_str.front() == '"')) val_str = val_str.substr(1); + while (!val_str.empty() && (val_str.back() == '\'' || val_str.back() == '"')) val_str = val_str.substr(0, val_str.size()-1); + while (!ref_str.empty() && (ref_str.front() == '\'' || ref_str.front() == '"')) ref_str = ref_str.substr(1); + while (!ref_str.empty() && (ref_str.back() == '\'' || ref_str.back() == '"')) ref_str = ref_str.substr(0, ref_str.size()-1); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = "'" + val_str + "'@" + ts_str; + Temporal* temp = ttext_in(wkt.c_str()); + if (!temp) return 0.0; + text* txt = cstring_to_text(ref_str.c_str()); + if (!txt) { free(temp); return 0.0; } + Temporal* res = tge_ttext_text(temp, txt); + free(temp); + free(txt); + if (!res) return 0.0; + bool v2 = tbool_start_value(res); + free(res); + return v2 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + value, ref, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTgeTtextTextPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "TgeTtextTextPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + return TgeTtextTextPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TgtTextTtextPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TgtTextTtextPhysicalFunction.cpp new file mode 100644 index 0000000000..e54dec18b2 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TgtTextTtextPhysicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +} + +namespace NES { + +TgtTextTtextPhysicalFunction::TgtTextTtextPhysicalFunction( + PhysicalFunction valueFunction, PhysicalFunction refFunction, PhysicalFunction tsFunction) +{ + paramFns.reserve(3); + paramFns.push_back(std::move(valueFunction)); + paramFns.push_back(std::move(refFunction)); + paramFns.push_back(std::move(tsFunction)); +} + +VarVal TgtTextTtextPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto ref = paramFns[0].execute(record, arena).cast(); + auto value = paramFns[1].execute(record, arena).cast(); + auto ts = paramFns[2].execute(record, arena).cast>(); + + const auto result = nautilus::invoke( + +[](const char* r, uint32_t rsz, const char* v, uint32_t vsz, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ref_str(r, rsz); + std::string val_str(v, vsz); + while (!ref_str.empty() && (ref_str.front() == '\'' || ref_str.front() == '"')) ref_str = ref_str.substr(1); + while (!ref_str.empty() && (ref_str.back() == '\'' || ref_str.back() == '"')) ref_str = ref_str.substr(0, ref_str.size()-1); + while (!val_str.empty() && (val_str.front() == '\'' || val_str.front() == '"')) val_str = val_str.substr(1); + while (!val_str.empty() && (val_str.back() == '\'' || val_str.back() == '"')) val_str = val_str.substr(0, val_str.size()-1); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = "'" + val_str + "'@" + ts_str; + Temporal* temp = ttext_in(wkt.c_str()); + if (!temp) return 0.0; + text* txt = cstring_to_text(ref_str.c_str()); + if (!txt) { free(temp); return 0.0; } + Temporal* res = tgt_text_ttext(txt, temp); + free(temp); + free(txt); + if (!res) return 0.0; + bool v2 = tbool_start_value(res); + free(res); + return v2 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + ref, value, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTgtTextTtextPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "TgtTextTtextPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + return TgtTextTtextPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TgtTtextTextPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TgtTtextTextPhysicalFunction.cpp new file mode 100644 index 0000000000..2e42136d79 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TgtTtextTextPhysicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +} + +namespace NES { + +TgtTtextTextPhysicalFunction::TgtTtextTextPhysicalFunction( + PhysicalFunction valueFunction, PhysicalFunction refFunction, PhysicalFunction tsFunction) +{ + paramFns.reserve(3); + paramFns.push_back(std::move(valueFunction)); + paramFns.push_back(std::move(refFunction)); + paramFns.push_back(std::move(tsFunction)); +} + +VarVal TgtTtextTextPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto value = paramFns[0].execute(record, arena).cast(); + auto ref = paramFns[1].execute(record, arena).cast(); + auto ts = paramFns[2].execute(record, arena).cast>(); + + const auto result = nautilus::invoke( + +[](const char* v, uint32_t vsz, const char* r, uint32_t rsz, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string val_str(v, vsz); + std::string ref_str(r, rsz); + while (!val_str.empty() && (val_str.front() == '\'' || val_str.front() == '"')) val_str = val_str.substr(1); + while (!val_str.empty() && (val_str.back() == '\'' || val_str.back() == '"')) val_str = val_str.substr(0, val_str.size()-1); + while (!ref_str.empty() && (ref_str.front() == '\'' || ref_str.front() == '"')) ref_str = ref_str.substr(1); + while (!ref_str.empty() && (ref_str.back() == '\'' || ref_str.back() == '"')) ref_str = ref_str.substr(0, ref_str.size()-1); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = "'" + val_str + "'@" + ts_str; + Temporal* temp = ttext_in(wkt.c_str()); + if (!temp) return 0.0; + text* txt = cstring_to_text(ref_str.c_str()); + if (!txt) { free(temp); return 0.0; } + Temporal* res = tgt_ttext_text(temp, txt); + free(temp); + free(txt); + if (!res) return 0.0; + bool v2 = tbool_start_value(res); + free(res); + return v2 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + value, ref, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTgtTtextTextPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "TgtTtextTextPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + return TgtTtextTextPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TleTextTtextPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TleTextTtextPhysicalFunction.cpp new file mode 100644 index 0000000000..cf2daccafb --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TleTextTtextPhysicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +} + +namespace NES { + +TleTextTtextPhysicalFunction::TleTextTtextPhysicalFunction( + PhysicalFunction valueFunction, PhysicalFunction refFunction, PhysicalFunction tsFunction) +{ + paramFns.reserve(3); + paramFns.push_back(std::move(valueFunction)); + paramFns.push_back(std::move(refFunction)); + paramFns.push_back(std::move(tsFunction)); +} + +VarVal TleTextTtextPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto ref = paramFns[0].execute(record, arena).cast(); + auto value = paramFns[1].execute(record, arena).cast(); + auto ts = paramFns[2].execute(record, arena).cast>(); + + const auto result = nautilus::invoke( + +[](const char* r, uint32_t rsz, const char* v, uint32_t vsz, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ref_str(r, rsz); + std::string val_str(v, vsz); + while (!ref_str.empty() && (ref_str.front() == '\'' || ref_str.front() == '"')) ref_str = ref_str.substr(1); + while (!ref_str.empty() && (ref_str.back() == '\'' || ref_str.back() == '"')) ref_str = ref_str.substr(0, ref_str.size()-1); + while (!val_str.empty() && (val_str.front() == '\'' || val_str.front() == '"')) val_str = val_str.substr(1); + while (!val_str.empty() && (val_str.back() == '\'' || val_str.back() == '"')) val_str = val_str.substr(0, val_str.size()-1); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = "'" + val_str + "'@" + ts_str; + Temporal* temp = ttext_in(wkt.c_str()); + if (!temp) return 0.0; + text* txt = cstring_to_text(ref_str.c_str()); + if (!txt) { free(temp); return 0.0; } + Temporal* res = tle_text_ttext(txt, temp); + free(temp); + free(txt); + if (!res) return 0.0; + bool v2 = tbool_start_value(res); + free(res); + return v2 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + ref, value, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTleTextTtextPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "TleTextTtextPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + return TleTextTtextPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TleTtextTextPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TleTtextTextPhysicalFunction.cpp new file mode 100644 index 0000000000..6e043d7b69 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TleTtextTextPhysicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +} + +namespace NES { + +TleTtextTextPhysicalFunction::TleTtextTextPhysicalFunction( + PhysicalFunction valueFunction, PhysicalFunction refFunction, PhysicalFunction tsFunction) +{ + paramFns.reserve(3); + paramFns.push_back(std::move(valueFunction)); + paramFns.push_back(std::move(refFunction)); + paramFns.push_back(std::move(tsFunction)); +} + +VarVal TleTtextTextPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto value = paramFns[0].execute(record, arena).cast(); + auto ref = paramFns[1].execute(record, arena).cast(); + auto ts = paramFns[2].execute(record, arena).cast>(); + + const auto result = nautilus::invoke( + +[](const char* v, uint32_t vsz, const char* r, uint32_t rsz, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string val_str(v, vsz); + std::string ref_str(r, rsz); + while (!val_str.empty() && (val_str.front() == '\'' || val_str.front() == '"')) val_str = val_str.substr(1); + while (!val_str.empty() && (val_str.back() == '\'' || val_str.back() == '"')) val_str = val_str.substr(0, val_str.size()-1); + while (!ref_str.empty() && (ref_str.front() == '\'' || ref_str.front() == '"')) ref_str = ref_str.substr(1); + while (!ref_str.empty() && (ref_str.back() == '\'' || ref_str.back() == '"')) ref_str = ref_str.substr(0, ref_str.size()-1); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = "'" + val_str + "'@" + ts_str; + Temporal* temp = ttext_in(wkt.c_str()); + if (!temp) return 0.0; + text* txt = cstring_to_text(ref_str.c_str()); + if (!txt) { free(temp); return 0.0; } + Temporal* res = tle_ttext_text(temp, txt); + free(temp); + free(txt); + if (!res) return 0.0; + bool v2 = tbool_start_value(res); + free(res); + return v2 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + value, ref, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTleTtextTextPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "TleTtextTextPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + return TleTtextTextPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TltTextTtextPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TltTextTtextPhysicalFunction.cpp new file mode 100644 index 0000000000..d304e1ea0d --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TltTextTtextPhysicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +} + +namespace NES { + +TltTextTtextPhysicalFunction::TltTextTtextPhysicalFunction( + PhysicalFunction valueFunction, PhysicalFunction refFunction, PhysicalFunction tsFunction) +{ + paramFns.reserve(3); + paramFns.push_back(std::move(valueFunction)); + paramFns.push_back(std::move(refFunction)); + paramFns.push_back(std::move(tsFunction)); +} + +VarVal TltTextTtextPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto ref = paramFns[0].execute(record, arena).cast(); + auto value = paramFns[1].execute(record, arena).cast(); + auto ts = paramFns[2].execute(record, arena).cast>(); + + const auto result = nautilus::invoke( + +[](const char* r, uint32_t rsz, const char* v, uint32_t vsz, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string ref_str(r, rsz); + std::string val_str(v, vsz); + while (!ref_str.empty() && (ref_str.front() == '\'' || ref_str.front() == '"')) ref_str = ref_str.substr(1); + while (!ref_str.empty() && (ref_str.back() == '\'' || ref_str.back() == '"')) ref_str = ref_str.substr(0, ref_str.size()-1); + while (!val_str.empty() && (val_str.front() == '\'' || val_str.front() == '"')) val_str = val_str.substr(1); + while (!val_str.empty() && (val_str.back() == '\'' || val_str.back() == '"')) val_str = val_str.substr(0, val_str.size()-1); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = "'" + val_str + "'@" + ts_str; + Temporal* temp = ttext_in(wkt.c_str()); + if (!temp) return 0.0; + text* txt = cstring_to_text(ref_str.c_str()); + if (!txt) { free(temp); return 0.0; } + Temporal* res = tlt_text_ttext(txt, temp); + free(temp); + free(txt); + if (!res) return 0.0; + bool v2 = tbool_start_value(res); + free(res); + return v2 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + ref, value, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTltTextTtextPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "TltTextTtextPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + return TltTextTtextPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TltTtextTextPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TltTtextTextPhysicalFunction.cpp new file mode 100644 index 0000000000..4d5c15e40a --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TltTtextTextPhysicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +} + +namespace NES { + +TltTtextTextPhysicalFunction::TltTtextTextPhysicalFunction( + PhysicalFunction valueFunction, PhysicalFunction refFunction, PhysicalFunction tsFunction) +{ + paramFns.reserve(3); + paramFns.push_back(std::move(valueFunction)); + paramFns.push_back(std::move(refFunction)); + paramFns.push_back(std::move(tsFunction)); +} + +VarVal TltTtextTextPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto value = paramFns[0].execute(record, arena).cast(); + auto ref = paramFns[1].execute(record, arena).cast(); + auto ts = paramFns[2].execute(record, arena).cast>(); + + const auto result = nautilus::invoke( + +[](const char* v, uint32_t vsz, const char* r, uint32_t rsz, uint64_t t) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string val_str(v, vsz); + std::string ref_str(r, rsz); + while (!val_str.empty() && (val_str.front() == '\'' || val_str.front() == '"')) val_str = val_str.substr(1); + while (!val_str.empty() && (val_str.back() == '\'' || val_str.back() == '"')) val_str = val_str.substr(0, val_str.size()-1); + while (!ref_str.empty() && (ref_str.front() == '\'' || ref_str.front() == '"')) ref_str = ref_str.substr(1); + while (!ref_str.empty() && (ref_str.back() == '\'' || ref_str.back() == '"')) ref_str = ref_str.substr(0, ref_str.size()-1); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = "'" + val_str + "'@" + ts_str; + Temporal* temp = ttext_in(wkt.c_str()); + if (!temp) return 0.0; + text* txt = cstring_to_text(ref_str.c_str()); + if (!txt) { free(temp); return 0.0; } + Temporal* res = tlt_ttext_text(temp, txt); + free(temp); + free(txt); + if (!res) return 0.0; + bool v2 = tbool_start_value(res); + free(res); + return v2 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + value, ref, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTltTtextTextPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "TltTtextTextPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + return TltTtextTextPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2])); +} + +} // namespace NES diff --git a/nes-sql-parser/AntlrSQL.g4 b/nes-sql-parser/AntlrSQL.g4 index 72d4d77edb..edd14b8127 100644 --- a/nes-sql-parser/AntlrSQL.g4 +++ b/nes-sql-parser/AntlrSQL.g4 @@ -295,7 +295,7 @@ timeUnit: MS timestampParameter: name=identifier; -functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT; +functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT | TGE_TTEXT_TEXT | TGE_TEXT_TTEXT | TGT_TTEXT_TEXT | TGT_TEXT_TTEXT | TLE_TTEXT_TEXT | TLE_TEXT_TTEXT | TLT_TTEXT_TEXT | TLT_TEXT_TTEXT; sinkClause: INTO sink (',' sink)*; @@ -744,6 +744,14 @@ TEQ_TTEXT_TEXT: 'TEQ_TTEXT_TEXT' | 'teq_ttext_text'; TNE_TTEXT_TEXT: 'TNE_TTEXT_TEXT' | 'tne_ttext_text'; TEQ_TEXT_TTEXT: 'TEQ_TEXT_TTEXT' | 'teq_text_ttext'; TNE_TEXT_TTEXT: 'TNE_TEXT_TTEXT' | 'tne_text_ttext'; +TGE_TTEXT_TEXT: 'TGE_TTEXT_TEXT' | 'tge_ttext_text'; +TGE_TEXT_TTEXT: 'TGE_TEXT_TTEXT' | 'tge_text_ttext'; +TGT_TTEXT_TEXT: 'TGT_TTEXT_TEXT' | 'tgt_ttext_text'; +TGT_TEXT_TTEXT: 'TGT_TEXT_TTEXT' | 'tgt_text_ttext'; +TLE_TTEXT_TEXT: 'TLE_TTEXT_TEXT' | 'tle_ttext_text'; +TLE_TEXT_TTEXT: 'TLE_TEXT_TTEXT' | 'tle_text_ttext'; +TLT_TTEXT_TEXT: 'TLT_TTEXT_TEXT' | 'tlt_ttext_text'; +TLT_TEXT_TTEXT: 'TLT_TEXT_TTEXT' | 'tlt_text_ttext'; WATERMARK: 'WATERMARK' | 'watermark'; OFFSET: 'OFFSET' | 'offset'; LOCALHOST: 'LOCALHOST' | 'localhost'; diff --git a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp index 7a0a6c461b..3c75ac3ba3 100644 --- a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp +++ b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp @@ -325,6 +325,14 @@ #include #include #include +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include @@ -8442,6 +8450,238 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont } break; /* END CODEGEN PARSER GLUE: TNE_TEXT_TTEXT */ + /* BEGIN CODEGEN PARSER GLUE: TGE_TTEXT_TEXT */ + case AntlrSQLLexer::TGE_TTEXT_TEXT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("TGE_TTEXT_TEXT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(TgeTtextTextLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: TGE_TTEXT_TEXT */ + /* BEGIN CODEGEN PARSER GLUE: TGE_TEXT_TTEXT */ + case AntlrSQLLexer::TGE_TEXT_TTEXT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("TGE_TEXT_TTEXT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(TgeTextTtextLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: TGE_TEXT_TTEXT */ + /* BEGIN CODEGEN PARSER GLUE: TGT_TTEXT_TEXT */ + case AntlrSQLLexer::TGT_TTEXT_TEXT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("TGT_TTEXT_TEXT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(TgtTtextTextLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: TGT_TTEXT_TEXT */ + /* BEGIN CODEGEN PARSER GLUE: TGT_TEXT_TTEXT */ + case AntlrSQLLexer::TGT_TEXT_TTEXT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("TGT_TEXT_TTEXT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(TgtTextTtextLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: TGT_TEXT_TTEXT */ + /* BEGIN CODEGEN PARSER GLUE: TLE_TTEXT_TEXT */ + case AntlrSQLLexer::TLE_TTEXT_TEXT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("TLE_TTEXT_TEXT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(TleTtextTextLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: TLE_TTEXT_TEXT */ + /* BEGIN CODEGEN PARSER GLUE: TLE_TEXT_TTEXT */ + case AntlrSQLLexer::TLE_TEXT_TTEXT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("TLE_TEXT_TTEXT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(TleTextTtextLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: TLE_TEXT_TTEXT */ + /* BEGIN CODEGEN PARSER GLUE: TLT_TTEXT_TEXT */ + case AntlrSQLLexer::TLT_TTEXT_TEXT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("TLT_TTEXT_TEXT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(TltTtextTextLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: TLT_TTEXT_TEXT */ + /* BEGIN CODEGEN PARSER GLUE: TLT_TEXT_TTEXT */ + case AntlrSQLLexer::TLT_TEXT_TTEXT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("TLT_TEXT_TTEXT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(TltTextTtextLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: TLT_TEXT_TTEXT */ /* BEGIN CODEGEN PARSER GLUE: ALWAYS_EQ_TFLOAT_FLOAT */ case AntlrSQLLexer::ALWAYS_EQ_TFLOAT_FLOAT: { From 3152178d9f42df89ed6485755a2476f5df474f40 Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Sun, 14 Jun 2026 09:10:17 +0200 Subject: [PATCH 44/96] feat(meos): add TTEXT_UPPER/LOWER/INITCAP NES operators (W95) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Wire ttext_upper, ttext_lower, and ttext_initcap as per-event scalar NES operators. Each takes (value:VARCHAR, ts:UINT64) and returns VARCHAR. The physical functions pre-allocate a 4096-byte arena buffer, call the MEOS function inside nautilus::invoke writing into the buffer, and write the actual byte length back via VarVal::writeToMemory — the first VARCHAR-return scalar pattern in this harness. --- .../Meos/TtextInitcapLogicalFunction.hpp | 52 +++++++++ .../Meos/TtextLowerLogicalFunction.hpp | 52 +++++++++ .../Meos/TtextUpperLogicalFunction.hpp | 52 +++++++++ .../src/Functions/Meos/CMakeLists.txt | 3 + .../Meos/TtextInitcapLogicalFunction.cpp | 102 ++++++++++++++++++ .../Meos/TtextLowerLogicalFunction.cpp | 102 ++++++++++++++++++ .../Meos/TtextUpperLogicalFunction.cpp | 102 ++++++++++++++++++ .../Meos/TtextInitcapPhysicalFunction.hpp | 35 ++++++ .../Meos/TtextLowerPhysicalFunction.hpp | 35 ++++++ .../Meos/TtextUpperPhysicalFunction.hpp | 35 ++++++ .../src/Functions/Meos/CMakeLists.txt | 3 + .../Meos/TtextInitcapPhysicalFunction.cpp | 98 +++++++++++++++++ .../Meos/TtextLowerPhysicalFunction.cpp | 98 +++++++++++++++++ .../Meos/TtextUpperPhysicalFunction.cpp | 98 +++++++++++++++++ nes-sql-parser/AntlrSQL.g4 | 5 +- .../src/AntlrSQLQueryPlanCreator.cpp | 30 ++++++ 16 files changed, 901 insertions(+), 1 deletion(-) create mode 100644 nes-logical-operators/include/Functions/Meos/TtextInitcapLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TtextLowerLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TtextUpperLogicalFunction.hpp create mode 100644 nes-logical-operators/src/Functions/Meos/TtextInitcapLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TtextLowerLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TtextUpperLogicalFunction.cpp create mode 100644 nes-physical-operators/include/Functions/Meos/TtextInitcapPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TtextLowerPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TtextUpperPhysicalFunction.hpp create mode 100644 nes-physical-operators/src/Functions/Meos/TtextInitcapPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TtextLowerPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TtextUpperPhysicalFunction.cpp diff --git a/nes-logical-operators/include/Functions/Meos/TtextInitcapLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TtextInitcapLogicalFunction.hpp new file mode 100644 index 0000000000..3e85db4bba --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TtextInitcapLogicalFunction.hpp @@ -0,0 +1,52 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event ttext_initcap: single-instant ttext transform -> varchar. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ttext_initcap`. Per-event scalar operator; returns the transformed text value. + */ +class TtextInitcapLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TtextInitcap"; + + TtextInitcapLogicalFunction(LogicalFunction value, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TtextLowerLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TtextLowerLogicalFunction.hpp new file mode 100644 index 0000000000..45e44997d6 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TtextLowerLogicalFunction.hpp @@ -0,0 +1,52 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event ttext_lower: single-instant ttext transform -> varchar. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ttext_lower`. Per-event scalar operator; returns the transformed text value. + */ +class TtextLowerLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TtextLower"; + + TtextLowerLogicalFunction(LogicalFunction value, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TtextUpperLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TtextUpperLogicalFunction.hpp new file mode 100644 index 0000000000..99766bbe6b --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TtextUpperLogicalFunction.hpp @@ -0,0 +1,52 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event ttext_upper: single-instant ttext transform -> varchar. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ttext_upper`. Per-event scalar operator; returns the transformed text value. + */ +class TtextUpperLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TtextUpper"; + + TtextUpperLogicalFunction(LogicalFunction value, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt index 367216d983..7201206e54 100644 --- a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt @@ -282,3 +282,6 @@ add_plugin(TleTtextText LogicalFunction nes-logical-operators TleTtextTextLogica add_plugin(TleTextTtext LogicalFunction nes-logical-operators TleTextTtextLogicalFunction.cpp) add_plugin(TltTtextText LogicalFunction nes-logical-operators TltTtextTextLogicalFunction.cpp) add_plugin(TltTextTtext LogicalFunction nes-logical-operators TltTextTtextLogicalFunction.cpp) +add_plugin(TtextUpper LogicalFunction nes-logical-operators TtextUpperLogicalFunction.cpp) +add_plugin(TtextLower LogicalFunction nes-logical-operators TtextLowerLogicalFunction.cpp) +add_plugin(TtextInitcap LogicalFunction nes-logical-operators TtextInitcapLogicalFunction.cpp) diff --git a/nes-logical-operators/src/Functions/Meos/TtextInitcapLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TtextInitcapLogicalFunction.cpp new file mode 100644 index 0000000000..9e3fc38f7c --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TtextInitcapLogicalFunction.cpp @@ -0,0 +1,102 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TtextInitcapLogicalFunction::TtextInitcapLogicalFunction(LogicalFunction value, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::VARSIZED)) +{ + parameters.reserve(2); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(ts)); +} + +DataType TtextInitcapLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction TtextInitcapLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector TtextInitcapLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction TtextInitcapLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 2, "TtextInitcapLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view TtextInitcapLogicalFunction::getType() const { return NAME; } + +bool TtextInitcapLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string TtextInitcapLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TtextInitcapLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction TtextInitcapLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTtextInitcapLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 2, + "TtextInitcapLogicalFunction requires 2 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + return TtextInitcapLogicalFunction(std::move(arg0), std::move(arg1)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TtextLowerLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TtextLowerLogicalFunction.cpp new file mode 100644 index 0000000000..f171eb7600 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TtextLowerLogicalFunction.cpp @@ -0,0 +1,102 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TtextLowerLogicalFunction::TtextLowerLogicalFunction(LogicalFunction value, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::VARSIZED)) +{ + parameters.reserve(2); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(ts)); +} + +DataType TtextLowerLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction TtextLowerLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector TtextLowerLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction TtextLowerLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 2, "TtextLowerLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view TtextLowerLogicalFunction::getType() const { return NAME; } + +bool TtextLowerLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string TtextLowerLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TtextLowerLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction TtextLowerLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTtextLowerLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 2, + "TtextLowerLogicalFunction requires 2 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + return TtextLowerLogicalFunction(std::move(arg0), std::move(arg1)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TtextUpperLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TtextUpperLogicalFunction.cpp new file mode 100644 index 0000000000..8e68f39a99 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TtextUpperLogicalFunction.cpp @@ -0,0 +1,102 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TtextUpperLogicalFunction::TtextUpperLogicalFunction(LogicalFunction value, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::VARSIZED)) +{ + parameters.reserve(2); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(ts)); +} + +DataType TtextUpperLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction TtextUpperLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector TtextUpperLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction TtextUpperLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 2, "TtextUpperLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view TtextUpperLogicalFunction::getType() const { return NAME; } + +bool TtextUpperLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string TtextUpperLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TtextUpperLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction TtextUpperLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTtextUpperLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 2, + "TtextUpperLogicalFunction requires 2 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + return TtextUpperLogicalFunction(std::move(arg0), std::move(arg1)); +} + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TtextInitcapPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TtextInitcapPhysicalFunction.hpp new file mode 100644 index 0000000000..3d04a89181 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TtextInitcapPhysicalFunction.hpp @@ -0,0 +1,35 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class TtextInitcapPhysicalFunction : public PhysicalFunctionConcept { +public: + TtextInitcapPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TtextLowerPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TtextLowerPhysicalFunction.hpp new file mode 100644 index 0000000000..8605f87d65 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TtextLowerPhysicalFunction.hpp @@ -0,0 +1,35 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class TtextLowerPhysicalFunction : public PhysicalFunctionConcept { +public: + TtextLowerPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TtextUpperPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TtextUpperPhysicalFunction.hpp new file mode 100644 index 0000000000..aa98369b8d --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TtextUpperPhysicalFunction.hpp @@ -0,0 +1,35 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class TtextUpperPhysicalFunction : public PhysicalFunctionConcept { +public: + TtextUpperPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt index 4dd15337c1..2711a002fb 100644 --- a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt @@ -281,4 +281,7 @@ add_plugin(TleTtextText PhysicalFunction nes-physical-operators TleTtextTextPhys add_plugin(TleTextTtext PhysicalFunction nes-physical-operators TleTextTtextPhysicalFunction.cpp) add_plugin(TltTtextText PhysicalFunction nes-physical-operators TltTtextTextPhysicalFunction.cpp) add_plugin(TltTextTtext PhysicalFunction nes-physical-operators TltTextTtextPhysicalFunction.cpp) +add_plugin(TtextUpper PhysicalFunction nes-physical-operators TtextUpperPhysicalFunction.cpp) +add_plugin(TtextLower PhysicalFunction nes-physical-operators TtextLowerPhysicalFunction.cpp) +add_plugin(TtextInitcap PhysicalFunction nes-physical-operators TtextInitcapPhysicalFunction.cpp) endif() diff --git a/nes-physical-operators/src/Functions/Meos/TtextInitcapPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TtextInitcapPhysicalFunction.cpp new file mode 100644 index 0000000000..54f48e699e --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TtextInitcapPhysicalFunction.cpp @@ -0,0 +1,98 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +} + +namespace NES { + +TtextInitcapPhysicalFunction::TtextInitcapPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction) +{ + paramFns.reserve(2); + paramFns.push_back(std::move(valueFunction)); + paramFns.push_back(std::move(tsFunction)); +} + +VarVal TtextInitcapPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto value = paramFns[0].execute(record, arena).cast(); + auto ts = paramFns[1].execute(record, arena).cast>(); + + constexpr uint32_t MAX_LEN = 4096; + auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); + + const auto actualLen = nautilus::invoke( + +[](const char* v, uint32_t vsz, uint64_t t, char* buf, uint32_t bufMax) -> uint32_t { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string val_str(v, vsz); + while (!val_str.empty() && (val_str.front() == '\'' || val_str.front() == '"')) + val_str = val_str.substr(1); + while (!val_str.empty() && (val_str.back() == '\'' || val_str.back() == '"')) + val_str = val_str.substr(0, val_str.size() - 1); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = "'" + val_str + "'@" + ts_str; + Temporal* temp = ttext_in(wkt.c_str()); + if (!temp) return 0u; + Temporal* res = ttext_initcap(temp); + free(temp); + if (!res) return 0u; + text* txt = ttext_start_value(res); + free(res); + if (!txt) return 0u; + char* cstr = text_to_cstring(txt); + free(txt); + if (!cstr) return 0u; + uint32_t len = static_cast(std::strlen(cstr)); + if (len > bufMax) len = bufMax; + std::memcpy(buf, cstr, len); + free(cstr); + return len; + } catch (const std::exception&) { return 0u; } + }, + value, ts, outBuf.getContent(), nautilus::val(MAX_LEN)); + + VarVal(actualLen).writeToMemory(outBuf.getReference()); + return outBuf; +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTtextInitcapPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 2, + "TtextInitcapPhysicalFunction requires 2 children but got {}", + arguments.childFunctions.size()); + return TtextInitcapPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TtextLowerPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TtextLowerPhysicalFunction.cpp new file mode 100644 index 0000000000..16ef19011a --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TtextLowerPhysicalFunction.cpp @@ -0,0 +1,98 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +} + +namespace NES { + +TtextLowerPhysicalFunction::TtextLowerPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction) +{ + paramFns.reserve(2); + paramFns.push_back(std::move(valueFunction)); + paramFns.push_back(std::move(tsFunction)); +} + +VarVal TtextLowerPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto value = paramFns[0].execute(record, arena).cast(); + auto ts = paramFns[1].execute(record, arena).cast>(); + + constexpr uint32_t MAX_LEN = 4096; + auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); + + const auto actualLen = nautilus::invoke( + +[](const char* v, uint32_t vsz, uint64_t t, char* buf, uint32_t bufMax) -> uint32_t { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string val_str(v, vsz); + while (!val_str.empty() && (val_str.front() == '\'' || val_str.front() == '"')) + val_str = val_str.substr(1); + while (!val_str.empty() && (val_str.back() == '\'' || val_str.back() == '"')) + val_str = val_str.substr(0, val_str.size() - 1); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = "'" + val_str + "'@" + ts_str; + Temporal* temp = ttext_in(wkt.c_str()); + if (!temp) return 0u; + Temporal* res = ttext_lower(temp); + free(temp); + if (!res) return 0u; + text* txt = ttext_start_value(res); + free(res); + if (!txt) return 0u; + char* cstr = text_to_cstring(txt); + free(txt); + if (!cstr) return 0u; + uint32_t len = static_cast(std::strlen(cstr)); + if (len > bufMax) len = bufMax; + std::memcpy(buf, cstr, len); + free(cstr); + return len; + } catch (const std::exception&) { return 0u; } + }, + value, ts, outBuf.getContent(), nautilus::val(MAX_LEN)); + + VarVal(actualLen).writeToMemory(outBuf.getReference()); + return outBuf; +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTtextLowerPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 2, + "TtextLowerPhysicalFunction requires 2 children but got {}", + arguments.childFunctions.size()); + return TtextLowerPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TtextUpperPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TtextUpperPhysicalFunction.cpp new file mode 100644 index 0000000000..9c4e91e507 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TtextUpperPhysicalFunction.cpp @@ -0,0 +1,98 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +} + +namespace NES { + +TtextUpperPhysicalFunction::TtextUpperPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction) +{ + paramFns.reserve(2); + paramFns.push_back(std::move(valueFunction)); + paramFns.push_back(std::move(tsFunction)); +} + +VarVal TtextUpperPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto value = paramFns[0].execute(record, arena).cast(); + auto ts = paramFns[1].execute(record, arena).cast>(); + + constexpr uint32_t MAX_LEN = 4096; + auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); + + const auto actualLen = nautilus::invoke( + +[](const char* v, uint32_t vsz, uint64_t t, char* buf, uint32_t bufMax) -> uint32_t { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string val_str(v, vsz); + while (!val_str.empty() && (val_str.front() == '\'' || val_str.front() == '"')) + val_str = val_str.substr(1); + while (!val_str.empty() && (val_str.back() == '\'' || val_str.back() == '"')) + val_str = val_str.substr(0, val_str.size() - 1); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = "'" + val_str + "'@" + ts_str; + Temporal* temp = ttext_in(wkt.c_str()); + if (!temp) return 0u; + Temporal* res = ttext_upper(temp); + free(temp); + if (!res) return 0u; + text* txt = ttext_start_value(res); + free(res); + if (!txt) return 0u; + char* cstr = text_to_cstring(txt); + free(txt); + if (!cstr) return 0u; + uint32_t len = static_cast(std::strlen(cstr)); + if (len > bufMax) len = bufMax; + std::memcpy(buf, cstr, len); + free(cstr); + return len; + } catch (const std::exception&) { return 0u; } + }, + value, ts, outBuf.getContent(), nautilus::val(MAX_LEN)); + + VarVal(actualLen).writeToMemory(outBuf.getReference()); + return outBuf; +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTtextUpperPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 2, + "TtextUpperPhysicalFunction requires 2 children but got {}", + arguments.childFunctions.size()); + return TtextUpperPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1])); +} + +} // namespace NES diff --git a/nes-sql-parser/AntlrSQL.g4 b/nes-sql-parser/AntlrSQL.g4 index edd14b8127..060d99ae34 100644 --- a/nes-sql-parser/AntlrSQL.g4 +++ b/nes-sql-parser/AntlrSQL.g4 @@ -295,7 +295,7 @@ timeUnit: MS timestampParameter: name=identifier; -functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT | TGE_TTEXT_TEXT | TGE_TEXT_TTEXT | TGT_TTEXT_TEXT | TGT_TEXT_TTEXT | TLE_TTEXT_TEXT | TLE_TEXT_TTEXT | TLT_TTEXT_TEXT | TLT_TEXT_TTEXT; +functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT | TGE_TTEXT_TEXT | TGE_TEXT_TTEXT | TGT_TTEXT_TEXT | TGT_TEXT_TTEXT | TLE_TTEXT_TEXT | TLE_TEXT_TTEXT | TLT_TTEXT_TEXT | TLT_TEXT_TTEXT | TTEXT_UPPER | TTEXT_LOWER | TTEXT_INITCAP; sinkClause: INTO sink (',' sink)*; @@ -752,6 +752,9 @@ TLE_TTEXT_TEXT: 'TLE_TTEXT_TEXT' | 'tle_ttext_text'; TLE_TEXT_TTEXT: 'TLE_TEXT_TTEXT' | 'tle_text_ttext'; TLT_TTEXT_TEXT: 'TLT_TTEXT_TEXT' | 'tlt_ttext_text'; TLT_TEXT_TTEXT: 'TLT_TEXT_TTEXT' | 'tlt_text_ttext'; +TTEXT_UPPER: 'TTEXT_UPPER' | 'ttext_upper'; +TTEXT_LOWER: 'TTEXT_LOWER' | 'ttext_lower'; +TTEXT_INITCAP: 'TTEXT_INITCAP' | 'ttext_initcap'; WATERMARK: 'WATERMARK' | 'watermark'; OFFSET: 'OFFSET' | 'offset'; LOCALHOST: 'LOCALHOST' | 'localhost'; diff --git a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp index 3c75ac3ba3..890352ac53 100644 --- a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp +++ b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp @@ -333,6 +333,9 @@ #include #include #include +#include +#include +#include #include #include #include @@ -8682,6 +8685,33 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont } break; /* END CODEGEN PARSER GLUE: TLT_TEXT_TTEXT */ + case AntlrSQLParser::TTEXT_UPPER: { + PRECONDITION(ctx->functionParam().size() == 2, + "TtextUpper requires 2 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + return LogicalFunction(TtextUpperLogicalFunction(std::move(arg0), std::move(arg1))); + } + /* END CODEGEN PARSER GLUE: TTEXT_UPPER */ + case AntlrSQLParser::TTEXT_LOWER: { + PRECONDITION(ctx->functionParam().size() == 2, + "TtextLower requires 2 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + return LogicalFunction(TtextLowerLogicalFunction(std::move(arg0), std::move(arg1))); + } + /* END CODEGEN PARSER GLUE: TTEXT_LOWER */ + case AntlrSQLParser::TTEXT_INITCAP: { + PRECONDITION(ctx->functionParam().size() == 2, + "TtextInitcap requires 2 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + return LogicalFunction(TtextInitcapLogicalFunction(std::move(arg0), std::move(arg1))); + } + /* END CODEGEN PARSER GLUE: TTEXT_INITCAP */ /* BEGIN CODEGEN PARSER GLUE: ALWAYS_EQ_TFLOAT_FLOAT */ case AntlrSQLLexer::ALWAYS_EQ_TFLOAT_FLOAT: { From 6727052904985742f3e858bc63788505bfcb838c Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Sun, 14 Jun 2026 12:00:22 +0200 Subject: [PATCH 45/96] feat(meos): add TEXTCAT_{TTEXT_TEXT,TEXT_TTEXT,TTEXT_TTEXT} NES operators (W96) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Wire textcat_ttext_text (3-arg: value,ts,ref → varchar), textcat_text_ttext (3-arg: value,ts,ref → varchar; text operand first in MEOS call), and textcat_ttext_ttext (4-arg: value1,ts1,value2,ts2 → varchar; first 4-arg operator in this harness) as per-event scalar NES operators. All three return VARCHAR via the arena allocateVariableSizedData buffer-fill pattern established in W95. --- .../Meos/TextcatTextTtextLogicalFunction.hpp | 51 ++++++++ .../Meos/TextcatTtextTextLogicalFunction.hpp | 51 ++++++++ .../Meos/TextcatTtextTtextLogicalFunction.hpp | 51 ++++++++ .../src/Functions/Meos/CMakeLists.txt | 3 + .../Meos/TextcatTextTtextLogicalFunction.cpp | 103 ++++++++++++++++ .../Meos/TextcatTtextTextLogicalFunction.cpp | 103 ++++++++++++++++ .../Meos/TextcatTtextTtextLogicalFunction.cpp | 105 ++++++++++++++++ .../Meos/TextcatTextTtextPhysicalFunction.hpp | 34 ++++++ .../Meos/TextcatTtextTextPhysicalFunction.hpp | 34 ++++++ .../TextcatTtextTtextPhysicalFunction.hpp | 34 ++++++ .../src/Functions/Meos/CMakeLists.txt | 3 + .../Meos/TextcatTextTtextPhysicalFunction.cpp | 105 ++++++++++++++++ .../Meos/TextcatTtextTextPhysicalFunction.cpp | 105 ++++++++++++++++ .../TextcatTtextTtextPhysicalFunction.cpp | 112 ++++++++++++++++++ nes-sql-parser/AntlrSQL.g4 | 5 +- .../src/AntlrSQLQueryPlanCreator.cpp | 34 ++++++ 16 files changed, 932 insertions(+), 1 deletion(-) create mode 100644 nes-logical-operators/include/Functions/Meos/TextcatTextTtextLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TextcatTtextTextLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TextcatTtextTtextLogicalFunction.hpp create mode 100644 nes-logical-operators/src/Functions/Meos/TextcatTextTtextLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TextcatTtextTextLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TextcatTtextTtextLogicalFunction.cpp create mode 100644 nes-physical-operators/include/Functions/Meos/TextcatTextTtextPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TextcatTtextTextPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TextcatTtextTtextPhysicalFunction.hpp create mode 100644 nes-physical-operators/src/Functions/Meos/TextcatTextTtextPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TextcatTtextTextPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TextcatTtextTtextPhysicalFunction.cpp diff --git a/nes-logical-operators/include/Functions/Meos/TextcatTextTtextLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TextcatTextTtextLogicalFunction.hpp new file mode 100644 index 0000000000..3981a46b60 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TextcatTextTtextLogicalFunction.hpp @@ -0,0 +1,51 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event textcat_text_ttext: (value:VARCHAR, ts:UINT64, ref:VARCHAR) -> varchar. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `textcat_text_ttext`. Per-event scalar operator returning VARCHAR. + */ +class TextcatTextTtextLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TextcatTextTtext"; + + TextcatTextTtextLogicalFunction(LogicalFunction value, LogicalFunction ts, LogicalFunction ref); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TextcatTtextTextLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TextcatTtextTextLogicalFunction.hpp new file mode 100644 index 0000000000..319280c933 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TextcatTtextTextLogicalFunction.hpp @@ -0,0 +1,51 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event textcat_ttext_text: (value:VARCHAR, ts:UINT64, ref:VARCHAR) -> varchar. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `textcat_ttext_text`. Per-event scalar operator returning VARCHAR. + */ +class TextcatTtextTextLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TextcatTtextText"; + + TextcatTtextTextLogicalFunction(LogicalFunction value, LogicalFunction ts, LogicalFunction ref); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TextcatTtextTtextLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TextcatTtextTtextLogicalFunction.hpp new file mode 100644 index 0000000000..1e6b12cd06 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TextcatTtextTtextLogicalFunction.hpp @@ -0,0 +1,51 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event textcat_ttext_ttext: (value1:VARCHAR, ts1:UINT64, value2:VARCHAR, ts2:UINT64) -> varchar. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `textcat_ttext_ttext`. Per-event scalar operator returning VARCHAR. + */ +class TextcatTtextTtextLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TextcatTtextTtext"; + + TextcatTtextTtextLogicalFunction(LogicalFunction value1, LogicalFunction ts1, LogicalFunction value2, LogicalFunction ts2); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt index 7201206e54..6d7f4b27fd 100644 --- a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt @@ -285,3 +285,6 @@ add_plugin(TltTextTtext LogicalFunction nes-logical-operators TltTextTtextLogica add_plugin(TtextUpper LogicalFunction nes-logical-operators TtextUpperLogicalFunction.cpp) add_plugin(TtextLower LogicalFunction nes-logical-operators TtextLowerLogicalFunction.cpp) add_plugin(TtextInitcap LogicalFunction nes-logical-operators TtextInitcapLogicalFunction.cpp) +add_plugin(TextcatTtextText LogicalFunction nes-logical-operators TextcatTtextTextLogicalFunction.cpp) +add_plugin(TextcatTextTtext LogicalFunction nes-logical-operators TextcatTextTtextLogicalFunction.cpp) +add_plugin(TextcatTtextTtext LogicalFunction nes-logical-operators TextcatTtextTtextLogicalFunction.cpp) diff --git a/nes-logical-operators/src/Functions/Meos/TextcatTextTtextLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TextcatTextTtextLogicalFunction.cpp new file mode 100644 index 0000000000..9b7be445b6 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TextcatTextTtextLogicalFunction.cpp @@ -0,0 +1,103 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TextcatTextTtextLogicalFunction::TextcatTextTtextLogicalFunction(LogicalFunction value, LogicalFunction ts, LogicalFunction ref) + : dataType(DataTypeProvider::provideDataType(DataType::Type::VARSIZED)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(ref)); +} + +DataType TextcatTextTtextLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction TextcatTextTtextLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector TextcatTextTtextLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction TextcatTextTtextLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "TextcatTextTtextLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view TextcatTextTtextLogicalFunction::getType() const { return NAME; } + +bool TextcatTextTtextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string TextcatTextTtextLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TextcatTextTtextLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction TextcatTextTtextLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTextcatTextTtextLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "TextcatTextTtextLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return TextcatTextTtextLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TextcatTtextTextLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TextcatTtextTextLogicalFunction.cpp new file mode 100644 index 0000000000..db6687cd5a --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TextcatTtextTextLogicalFunction.cpp @@ -0,0 +1,103 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TextcatTtextTextLogicalFunction::TextcatTtextTextLogicalFunction(LogicalFunction value, LogicalFunction ts, LogicalFunction ref) + : dataType(DataTypeProvider::provideDataType(DataType::Type::VARSIZED)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(ref)); +} + +DataType TextcatTtextTextLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction TextcatTtextTextLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector TextcatTtextTextLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction TextcatTtextTextLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "TextcatTtextTextLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view TextcatTtextTextLogicalFunction::getType() const { return NAME; } + +bool TextcatTtextTextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string TextcatTtextTextLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TextcatTtextTextLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction TextcatTtextTextLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTextcatTtextTextLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "TextcatTtextTextLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return TextcatTtextTextLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TextcatTtextTtextLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TextcatTtextTtextLogicalFunction.cpp new file mode 100644 index 0000000000..f806a02d5f --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TextcatTtextTtextLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TextcatTtextTtextLogicalFunction::TextcatTtextTtextLogicalFunction(LogicalFunction value1, LogicalFunction ts1, LogicalFunction value2, LogicalFunction ts2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::VARSIZED)) +{ + parameters.reserve(4); + parameters.push_back(std::move(value1)); + parameters.push_back(std::move(ts1)); + parameters.push_back(std::move(value2)); + parameters.push_back(std::move(ts2)); +} + +DataType TextcatTtextTtextLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction TextcatTtextTtextLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector TextcatTtextTtextLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction TextcatTtextTtextLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 4, "TextcatTtextTtextLogicalFunction requires 4 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view TextcatTtextTtextLogicalFunction::getType() const { return NAME; } + +bool TextcatTtextTtextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string TextcatTtextTtextLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TextcatTtextTtextLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction TextcatTtextTtextLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTextcatTtextTtextLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 4, + "TextcatTtextTtextLogicalFunction requires 4 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + return TextcatTtextTtextLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3)); +} + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TextcatTextTtextPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TextcatTextTtextPhysicalFunction.hpp new file mode 100644 index 0000000000..ea60fa0eb5 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TextcatTextTtextPhysicalFunction.hpp @@ -0,0 +1,34 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class TextcatTextTtextPhysicalFunction : public PhysicalFunctionConcept { +public: + TextcatTextTtextPhysicalFunction(PhysicalFunction valueFunction, PhysicalFunction tsFunction, PhysicalFunction refFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TextcatTtextTextPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TextcatTtextTextPhysicalFunction.hpp new file mode 100644 index 0000000000..48fc8bad05 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TextcatTtextTextPhysicalFunction.hpp @@ -0,0 +1,34 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class TextcatTtextTextPhysicalFunction : public PhysicalFunctionConcept { +public: + TextcatTtextTextPhysicalFunction(PhysicalFunction valueFunction, PhysicalFunction tsFunction, PhysicalFunction refFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TextcatTtextTtextPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TextcatTtextTtextPhysicalFunction.hpp new file mode 100644 index 0000000000..f5ebc98ff6 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TextcatTtextTtextPhysicalFunction.hpp @@ -0,0 +1,34 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class TextcatTtextTtextPhysicalFunction : public PhysicalFunctionConcept { +public: + TextcatTtextTtextPhysicalFunction(PhysicalFunction value1Function, PhysicalFunction ts1Function, PhysicalFunction value2Function, PhysicalFunction ts2Function); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt index 2711a002fb..b98134091c 100644 --- a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt @@ -284,4 +284,7 @@ add_plugin(TltTextTtext PhysicalFunction nes-physical-operators TltTextTtextPhys add_plugin(TtextUpper PhysicalFunction nes-physical-operators TtextUpperPhysicalFunction.cpp) add_plugin(TtextLower PhysicalFunction nes-physical-operators TtextLowerPhysicalFunction.cpp) add_plugin(TtextInitcap PhysicalFunction nes-physical-operators TtextInitcapPhysicalFunction.cpp) +add_plugin(TextcatTtextText PhysicalFunction nes-physical-operators TextcatTtextTextPhysicalFunction.cpp) +add_plugin(TextcatTextTtext PhysicalFunction nes-physical-operators TextcatTextTtextPhysicalFunction.cpp) +add_plugin(TextcatTtextTtext PhysicalFunction nes-physical-operators TextcatTtextTtextPhysicalFunction.cpp) endif() diff --git a/nes-physical-operators/src/Functions/Meos/TextcatTextTtextPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TextcatTextTtextPhysicalFunction.cpp new file mode 100644 index 0000000000..7c65dcbbd4 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TextcatTextTtextPhysicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +} + +namespace NES { + +TextcatTextTtextPhysicalFunction::TextcatTextTtextPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction, + PhysicalFunction refFunction) +{ + paramFns.reserve(3); + paramFns.push_back(std::move(valueFunction)); + paramFns.push_back(std::move(tsFunction)); + paramFns.push_back(std::move(refFunction)); +} + +VarVal TextcatTextTtextPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto value = paramFns[0].execute(record, arena).cast(); + auto ts = paramFns[1].execute(record, arena).cast>(); + auto ref = paramFns[2].execute(record, arena).cast(); + + constexpr uint32_t MAX_LEN = 8192; + auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); + + const auto actualLen = nautilus::invoke( + +[](const char* v, uint32_t vsz, uint64_t t, const char* r, uint32_t rsz, char* buf, uint32_t bufMax) -> uint32_t { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string val_str(v, vsz); + while (!val_str.empty() && (val_str.front() == '\'' || val_str.front() == '"')) val_str = val_str.substr(1); + while (!val_str.empty() && (val_str.back() == '\'' || val_str.back() == '"')) val_str = val_str.substr(0, val_str.size() - 1); + std::string ref_str(r, rsz); + while (!ref_str.empty() && (ref_str.front() == '\'' || ref_str.front() == '"')) ref_str = ref_str.substr(1); + while (!ref_str.empty() && (ref_str.back() == '\'' || ref_str.back() == '"')) ref_str = ref_str.substr(0, ref_str.size() - 1); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = "'" + val_str + "'@" + ts_str; + Temporal* temp = ttext_in(wkt.c_str()); + if (!temp) return 0u; + text* txt = cstring_to_text(ref_str.c_str()); + if (!txt) { free(temp); return 0u; } + Temporal* res = textcat_text_ttext(txt, temp); + free(temp); free(txt); + if (!res) return 0u; + text* out_txt = ttext_start_value(res); + free(res); + if (!out_txt) return 0u; + char* cstr = text_to_cstring(out_txt); + free(out_txt); + if (!cstr) return 0u; + uint32_t len = static_cast(std::strlen(cstr)); + if (len > bufMax) len = bufMax; + std::memcpy(buf, cstr, len); + free(cstr); + return len; + } catch (const std::exception&) { return 0u; } + }, + value, ts, ref, outBuf.getContent(), nautilus::val(MAX_LEN)); + + VarVal(actualLen).writeToMemory(outBuf.getReference()); + return outBuf; +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTextcatTextTtextPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "TextcatTextTtextPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + return TextcatTextTtextPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TextcatTtextTextPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TextcatTtextTextPhysicalFunction.cpp new file mode 100644 index 0000000000..3b4d396a5b --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TextcatTtextTextPhysicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +} + +namespace NES { + +TextcatTtextTextPhysicalFunction::TextcatTtextTextPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction, + PhysicalFunction refFunction) +{ + paramFns.reserve(3); + paramFns.push_back(std::move(valueFunction)); + paramFns.push_back(std::move(tsFunction)); + paramFns.push_back(std::move(refFunction)); +} + +VarVal TextcatTtextTextPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto value = paramFns[0].execute(record, arena).cast(); + auto ts = paramFns[1].execute(record, arena).cast>(); + auto ref = paramFns[2].execute(record, arena).cast(); + + constexpr uint32_t MAX_LEN = 8192; + auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); + + const auto actualLen = nautilus::invoke( + +[](const char* v, uint32_t vsz, uint64_t t, const char* r, uint32_t rsz, char* buf, uint32_t bufMax) -> uint32_t { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string val_str(v, vsz); + while (!val_str.empty() && (val_str.front() == '\'' || val_str.front() == '"')) val_str = val_str.substr(1); + while (!val_str.empty() && (val_str.back() == '\'' || val_str.back() == '"')) val_str = val_str.substr(0, val_str.size() - 1); + std::string ref_str(r, rsz); + while (!ref_str.empty() && (ref_str.front() == '\'' || ref_str.front() == '"')) ref_str = ref_str.substr(1); + while (!ref_str.empty() && (ref_str.back() == '\'' || ref_str.back() == '"')) ref_str = ref_str.substr(0, ref_str.size() - 1); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = "'" + val_str + "'@" + ts_str; + Temporal* temp = ttext_in(wkt.c_str()); + if (!temp) return 0u; + text* txt = cstring_to_text(ref_str.c_str()); + if (!txt) { free(temp); return 0u; } + Temporal* res = textcat_ttext_text(temp, txt); + free(temp); free(txt); + if (!res) return 0u; + text* out_txt = ttext_start_value(res); + free(res); + if (!out_txt) return 0u; + char* cstr = text_to_cstring(out_txt); + free(out_txt); + if (!cstr) return 0u; + uint32_t len = static_cast(std::strlen(cstr)); + if (len > bufMax) len = bufMax; + std::memcpy(buf, cstr, len); + free(cstr); + return len; + } catch (const std::exception&) { return 0u; } + }, + value, ts, ref, outBuf.getContent(), nautilus::val(MAX_LEN)); + + VarVal(actualLen).writeToMemory(outBuf.getReference()); + return outBuf; +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTextcatTtextTextPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "TextcatTtextTextPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + return TextcatTtextTextPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TextcatTtextTtextPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TextcatTtextTtextPhysicalFunction.cpp new file mode 100644 index 0000000000..ed92d1e6e4 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TextcatTtextTtextPhysicalFunction.cpp @@ -0,0 +1,112 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +} + +namespace NES { + +TextcatTtextTtextPhysicalFunction::TextcatTtextTtextPhysicalFunction(PhysicalFunction value1Function, + PhysicalFunction ts1Function, + PhysicalFunction value2Function, + PhysicalFunction ts2Function) +{ + paramFns.reserve(4); + paramFns.push_back(std::move(value1Function)); + paramFns.push_back(std::move(ts1Function)); + paramFns.push_back(std::move(value2Function)); + paramFns.push_back(std::move(ts2Function)); +} + +VarVal TextcatTtextTtextPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto value1 = paramFns[0].execute(record, arena).cast(); + auto ts1 = paramFns[1].execute(record, arena).cast>(); + auto value2 = paramFns[2].execute(record, arena).cast(); + auto ts2 = paramFns[3].execute(record, arena).cast>(); + + constexpr uint32_t MAX_LEN = 8192; + auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); + + const auto actualLen = nautilus::invoke( + +[](const char* v1, uint32_t v1sz, uint64_t t1, + const char* v2, uint32_t v2sz, uint64_t t2, + char* buf, uint32_t bufMax) -> uint32_t { + try { + MEOS::Meos::ensureMeosInitialized(); + auto strip = [](std::string s) { + while (!s.empty() && (s.front() == '\'' || s.front() == '"')) s = s.substr(1); + while (!s.empty() && (s.back() == '\'' || s.back() == '"')) s = s.substr(0, s.size() - 1); + return s; + }; + std::string s1 = strip(std::string(v1, v1sz)); + std::string s2 = strip(std::string(v2, v2sz)); + std::string ts1_str = MEOS::Meos::convertEpochToTimestamp(t1); + std::string ts2_str = MEOS::Meos::convertEpochToTimestamp(t2); + Temporal* temp1 = ttext_in(("'" + s1 + "'@" + ts1_str).c_str()); + if (!temp1) return 0u; + Temporal* temp2 = ttext_in(("'" + s2 + "'@" + ts2_str).c_str()); + if (!temp2) { free(temp1); return 0u; } + Temporal* res = textcat_ttext_ttext(temp1, temp2); + free(temp1); free(temp2); + if (!res) return 0u; + text* out_txt = ttext_start_value(res); + free(res); + if (!out_txt) return 0u; + char* cstr = text_to_cstring(out_txt); + free(out_txt); + if (!cstr) return 0u; + uint32_t len = static_cast(std::strlen(cstr)); + if (len > bufMax) len = bufMax; + std::memcpy(buf, cstr, len); + free(cstr); + return len; + } catch (const std::exception&) { return 0u; } + }, + value1, ts1, value2, ts2, outBuf.getContent(), nautilus::val(MAX_LEN)); + + VarVal(actualLen).writeToMemory(outBuf.getReference()); + return outBuf; +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTextcatTtextTtextPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 4, + "TextcatTtextTtextPhysicalFunction requires 4 children but got {}", + arguments.childFunctions.size()); + return TextcatTtextTtextPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3])); +} + +} // namespace NES diff --git a/nes-sql-parser/AntlrSQL.g4 b/nes-sql-parser/AntlrSQL.g4 index 060d99ae34..4ea0dfc476 100644 --- a/nes-sql-parser/AntlrSQL.g4 +++ b/nes-sql-parser/AntlrSQL.g4 @@ -295,7 +295,7 @@ timeUnit: MS timestampParameter: name=identifier; -functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT | TGE_TTEXT_TEXT | TGE_TEXT_TTEXT | TGT_TTEXT_TEXT | TGT_TEXT_TTEXT | TLE_TTEXT_TEXT | TLE_TEXT_TTEXT | TLT_TTEXT_TEXT | TLT_TEXT_TTEXT | TTEXT_UPPER | TTEXT_LOWER | TTEXT_INITCAP; +functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT | TGE_TTEXT_TEXT | TGE_TEXT_TTEXT | TGT_TTEXT_TEXT | TGT_TEXT_TTEXT | TLE_TTEXT_TEXT | TLE_TEXT_TTEXT | TLT_TTEXT_TEXT | TLT_TEXT_TTEXT | TTEXT_UPPER | TTEXT_LOWER | TTEXT_INITCAP | TEXTCAT_TTEXT_TEXT | TEXTCAT_TEXT_TTEXT | TEXTCAT_TTEXT_TTEXT; sinkClause: INTO sink (',' sink)*; @@ -755,6 +755,9 @@ TLT_TEXT_TTEXT: 'TLT_TEXT_TTEXT' | 'tlt_text_ttext'; TTEXT_UPPER: 'TTEXT_UPPER' | 'ttext_upper'; TTEXT_LOWER: 'TTEXT_LOWER' | 'ttext_lower'; TTEXT_INITCAP: 'TTEXT_INITCAP' | 'ttext_initcap'; +TEXTCAT_TTEXT_TEXT: 'TEXTCAT_TTEXT_TEXT' | 'textcat_ttext_text'; +TEXTCAT_TEXT_TTEXT: 'TEXTCAT_TEXT_TTEXT' | 'textcat_text_ttext'; +TEXTCAT_TTEXT_TTEXT: 'TEXTCAT_TTEXT_TTEXT' | 'textcat_ttext_ttext'; WATERMARK: 'WATERMARK' | 'watermark'; OFFSET: 'OFFSET' | 'offset'; LOCALHOST: 'LOCALHOST' | 'localhost'; diff --git a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp index 890352ac53..3f9dfbfced 100644 --- a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp +++ b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp @@ -336,6 +336,9 @@ #include #include #include +#include +#include +#include #include #include #include @@ -8712,6 +8715,37 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont return LogicalFunction(TtextInitcapLogicalFunction(std::move(arg0), std::move(arg1))); } /* END CODEGEN PARSER GLUE: TTEXT_INITCAP */ + case AntlrSQLParser::TEXTCAT_TTEXT_TEXT: { + PRECONDITION(ctx->functionParam().size() == 3, + "TextcatTtextText requires 3 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + return LogicalFunction(TextcatTtextTextLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2))); + } + /* END CODEGEN PARSER GLUE: TEXTCAT_TTEXT_TEXT */ + case AntlrSQLParser::TEXTCAT_TEXT_TTEXT: { + PRECONDITION(ctx->functionParam().size() == 3, + "TextcatTextTtext requires 3 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + return LogicalFunction(TextcatTextTtextLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2))); + } + /* END CODEGEN PARSER GLUE: TEXTCAT_TEXT_TTEXT */ + case AntlrSQLParser::TEXTCAT_TTEXT_TTEXT: { + PRECONDITION(ctx->functionParam().size() == 4, + "TextcatTtextTtext requires 4 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + return LogicalFunction(TextcatTtextTtextLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3))); + } + /* END CODEGEN PARSER GLUE: TEXTCAT_TTEXT_TTEXT */ /* BEGIN CODEGEN PARSER GLUE: ALWAYS_EQ_TFLOAT_FLOAT */ case AntlrSQLLexer::ALWAYS_EQ_TFLOAT_FLOAT: { From 031f3451d6045ef079dca1db65e1a1282a6dda28 Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Sun, 14 Jun 2026 12:03:44 +0200 Subject: [PATCH 46/96] feat(meos): add GEOM_{INTERSECTS2D,DWITHIN2D,CONTAINS,DISJOINT2D} NES operators (W97) Wire geom_intersects2d, geom_dwithin2d, geom_contains, and geom_disjoint2d as per-event scalar NES operators on plain WKT geometry strings (no temporal dimension). The 2-arg predicates take (wkt1:VARCHAR, wkt2:VARCHAR) and the 3-arg geom_dwithin2d adds dist:FLOAT64. All return FLOAT64 0/1 via geom_in to GSERIALIZED* conversion inside nautilus::invoke. --- .../Meos/GeomContainsLogicalFunction.hpp | 51 +++++++++ .../Meos/GeomDisjoint2dLogicalFunction.hpp | 51 +++++++++ .../Meos/GeomDwithin2dLogicalFunction.hpp | 51 +++++++++ .../Meos/GeomIntersects2dLogicalFunction.hpp | 51 +++++++++ .../src/Functions/Meos/CMakeLists.txt | 4 + .../Meos/GeomContainsLogicalFunction.cpp | 101 +++++++++++++++++ .../Meos/GeomDisjoint2dLogicalFunction.cpp | 101 +++++++++++++++++ .../Meos/GeomDwithin2dLogicalFunction.cpp | 103 ++++++++++++++++++ .../Meos/GeomIntersects2dLogicalFunction.cpp | 101 +++++++++++++++++ .../Meos/GeomContainsPhysicalFunction.hpp | 34 ++++++ .../Meos/GeomDisjoint2dPhysicalFunction.hpp | 34 ++++++ .../Meos/GeomDwithin2dPhysicalFunction.hpp | 34 ++++++ .../Meos/GeomIntersects2dPhysicalFunction.hpp | 34 ++++++ .../src/Functions/Meos/CMakeLists.txt | 4 + .../Meos/GeomContainsPhysicalFunction.cpp | 80 ++++++++++++++ .../Meos/GeomDisjoint2dPhysicalFunction.cpp | 80 ++++++++++++++ .../Meos/GeomDwithin2dPhysicalFunction.cpp | 84 ++++++++++++++ .../Meos/GeomIntersects2dPhysicalFunction.cpp | 80 ++++++++++++++ nes-sql-parser/AntlrSQL.g4 | 6 +- .../src/AntlrSQLQueryPlanCreator.cpp | 41 +++++++ 20 files changed, 1124 insertions(+), 1 deletion(-) create mode 100644 nes-logical-operators/include/Functions/Meos/GeomContainsLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/GeomDisjoint2dLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/GeomDwithin2dLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/GeomIntersects2dLogicalFunction.hpp create mode 100644 nes-logical-operators/src/Functions/Meos/GeomContainsLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/GeomDisjoint2dLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/GeomDwithin2dLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/GeomIntersects2dLogicalFunction.cpp create mode 100644 nes-physical-operators/include/Functions/Meos/GeomContainsPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/GeomDisjoint2dPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/GeomDwithin2dPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/GeomIntersects2dPhysicalFunction.hpp create mode 100644 nes-physical-operators/src/Functions/Meos/GeomContainsPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/GeomDisjoint2dPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/GeomDwithin2dPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/GeomIntersects2dPhysicalFunction.cpp diff --git a/nes-logical-operators/include/Functions/Meos/GeomContainsLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeomContainsLogicalFunction.hpp new file mode 100644 index 0000000000..01a4f5f17b --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/GeomContainsLogicalFunction.hpp @@ -0,0 +1,51 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Static geometry predicate geom_contains: (wkt1:VARCHAR, wkt2:VARCHAR) -> float64 (0/1). + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `geom_contains`. Operates on plain WKT strings without a temporal dimension. + */ +class GeomContainsLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "GeomContains"; + + GeomContainsLogicalFunction(LogicalFunction wkt1, LogicalFunction wkt2); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/GeomDisjoint2dLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeomDisjoint2dLogicalFunction.hpp new file mode 100644 index 0000000000..972e387900 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/GeomDisjoint2dLogicalFunction.hpp @@ -0,0 +1,51 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Static geometry predicate geom_disjoint2d: (wkt1:VARCHAR, wkt2:VARCHAR) -> float64 (0/1). + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `geom_disjoint2d`. Operates on plain WKT strings without a temporal dimension. + */ +class GeomDisjoint2dLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "GeomDisjoint2d"; + + GeomDisjoint2dLogicalFunction(LogicalFunction wkt1, LogicalFunction wkt2); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/GeomDwithin2dLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeomDwithin2dLogicalFunction.hpp new file mode 100644 index 0000000000..c0f16054c4 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/GeomDwithin2dLogicalFunction.hpp @@ -0,0 +1,51 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Static geometry predicate geom_dwithin2d: (wkt1:VARCHAR, wkt2:VARCHAR, dist:FLOAT64) -> float64 (0/1). + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `geom_dwithin2d`. Operates on plain WKT strings without a temporal dimension. + */ +class GeomDwithin2dLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "GeomDwithin2d"; + + GeomDwithin2dLogicalFunction(LogicalFunction wkt1, LogicalFunction wkt2, LogicalFunction dist); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/GeomIntersects2dLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeomIntersects2dLogicalFunction.hpp new file mode 100644 index 0000000000..30df4ef297 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/GeomIntersects2dLogicalFunction.hpp @@ -0,0 +1,51 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Static geometry predicate geom_intersects2d: (wkt1:VARCHAR, wkt2:VARCHAR) -> float64 (0/1). + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `geom_intersects2d`. Operates on plain WKT strings without a temporal dimension. + */ +class GeomIntersects2dLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "GeomIntersects2d"; + + GeomIntersects2dLogicalFunction(LogicalFunction wkt1, LogicalFunction wkt2); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt index 6d7f4b27fd..2c99730b1c 100644 --- a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt @@ -288,3 +288,7 @@ add_plugin(TtextInitcap LogicalFunction nes-logical-operators TtextInitcapLogica add_plugin(TextcatTtextText LogicalFunction nes-logical-operators TextcatTtextTextLogicalFunction.cpp) add_plugin(TextcatTextTtext LogicalFunction nes-logical-operators TextcatTextTtextLogicalFunction.cpp) add_plugin(TextcatTtextTtext LogicalFunction nes-logical-operators TextcatTtextTtextLogicalFunction.cpp) +add_plugin(GeomIntersects2d LogicalFunction nes-logical-operators GeomIntersects2dLogicalFunction.cpp) +add_plugin(GeomDwithin2d LogicalFunction nes-logical-operators GeomDwithin2dLogicalFunction.cpp) +add_plugin(GeomContains LogicalFunction nes-logical-operators GeomContainsLogicalFunction.cpp) +add_plugin(GeomDisjoint2d LogicalFunction nes-logical-operators GeomDisjoint2dLogicalFunction.cpp) diff --git a/nes-logical-operators/src/Functions/Meos/GeomContainsLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeomContainsLogicalFunction.cpp new file mode 100644 index 0000000000..e4bac6c415 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/GeomContainsLogicalFunction.cpp @@ -0,0 +1,101 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +GeomContainsLogicalFunction::GeomContainsLogicalFunction(LogicalFunction wkt1, LogicalFunction wkt2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(2); + parameters.push_back(std::move(wkt1)); + parameters.push_back(std::move(wkt2)); +} + +DataType GeomContainsLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction GeomContainsLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector GeomContainsLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction GeomContainsLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 2, "GeomContainsLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view GeomContainsLogicalFunction::getType() const { return NAME; } + +bool GeomContainsLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string GeomContainsLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction GeomContainsLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction GeomContainsLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeomContainsLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 2, + "GeomContainsLogicalFunction requires 2 children but got {}", + arguments.children.size()); + return GeomContainsLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/GeomDisjoint2dLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeomDisjoint2dLogicalFunction.cpp new file mode 100644 index 0000000000..9354460dd0 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/GeomDisjoint2dLogicalFunction.cpp @@ -0,0 +1,101 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +GeomDisjoint2dLogicalFunction::GeomDisjoint2dLogicalFunction(LogicalFunction wkt1, LogicalFunction wkt2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(2); + parameters.push_back(std::move(wkt1)); + parameters.push_back(std::move(wkt2)); +} + +DataType GeomDisjoint2dLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction GeomDisjoint2dLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector GeomDisjoint2dLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction GeomDisjoint2dLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 2, "GeomDisjoint2dLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view GeomDisjoint2dLogicalFunction::getType() const { return NAME; } + +bool GeomDisjoint2dLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string GeomDisjoint2dLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction GeomDisjoint2dLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction GeomDisjoint2dLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeomDisjoint2dLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 2, + "GeomDisjoint2dLogicalFunction requires 2 children but got {}", + arguments.children.size()); + return GeomDisjoint2dLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/GeomDwithin2dLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeomDwithin2dLogicalFunction.cpp new file mode 100644 index 0000000000..e91b1f61bb --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/GeomDwithin2dLogicalFunction.cpp @@ -0,0 +1,103 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +GeomDwithin2dLogicalFunction::GeomDwithin2dLogicalFunction(LogicalFunction wkt1, LogicalFunction wkt2, LogicalFunction dist) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(wkt1)); + parameters.push_back(std::move(wkt2)); + parameters.push_back(std::move(dist)); +} + +DataType GeomDwithin2dLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction GeomDwithin2dLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector GeomDwithin2dLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction GeomDwithin2dLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "GeomDwithin2dLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view GeomDwithin2dLogicalFunction::getType() const { return NAME; } + +bool GeomDwithin2dLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string GeomDwithin2dLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction GeomDwithin2dLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction GeomDwithin2dLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeomDwithin2dLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "GeomDwithin2dLogicalFunction requires 3 children but got {}", + arguments.children.size()); + return GeomDwithin2dLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/GeomIntersects2dLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeomIntersects2dLogicalFunction.cpp new file mode 100644 index 0000000000..ddef3d58ed --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/GeomIntersects2dLogicalFunction.cpp @@ -0,0 +1,101 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +GeomIntersects2dLogicalFunction::GeomIntersects2dLogicalFunction(LogicalFunction wkt1, LogicalFunction wkt2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(2); + parameters.push_back(std::move(wkt1)); + parameters.push_back(std::move(wkt2)); +} + +DataType GeomIntersects2dLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction GeomIntersects2dLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector GeomIntersects2dLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction GeomIntersects2dLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 2, "GeomIntersects2dLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view GeomIntersects2dLogicalFunction::getType() const { return NAME; } + +bool GeomIntersects2dLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string GeomIntersects2dLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction GeomIntersects2dLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction GeomIntersects2dLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeomIntersects2dLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 2, + "GeomIntersects2dLogicalFunction requires 2 children but got {}", + arguments.children.size()); + return GeomIntersects2dLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1])); +} + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeomContainsPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeomContainsPhysicalFunction.hpp new file mode 100644 index 0000000000..4ddd7fdc80 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/GeomContainsPhysicalFunction.hpp @@ -0,0 +1,34 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class GeomContainsPhysicalFunction : public PhysicalFunctionConcept { +public: + GeomContainsPhysicalFunction(PhysicalFunction wkt1Function, PhysicalFunction wkt2Function); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeomDisjoint2dPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeomDisjoint2dPhysicalFunction.hpp new file mode 100644 index 0000000000..b503ce25b0 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/GeomDisjoint2dPhysicalFunction.hpp @@ -0,0 +1,34 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class GeomDisjoint2dPhysicalFunction : public PhysicalFunctionConcept { +public: + GeomDisjoint2dPhysicalFunction(PhysicalFunction wkt1Function, PhysicalFunction wkt2Function); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeomDwithin2dPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeomDwithin2dPhysicalFunction.hpp new file mode 100644 index 0000000000..d2410721bc --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/GeomDwithin2dPhysicalFunction.hpp @@ -0,0 +1,34 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class GeomDwithin2dPhysicalFunction : public PhysicalFunctionConcept { +public: + GeomDwithin2dPhysicalFunction(PhysicalFunction wkt1Function, PhysicalFunction wkt2Function, PhysicalFunction distFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeomIntersects2dPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeomIntersects2dPhysicalFunction.hpp new file mode 100644 index 0000000000..2aba593ea7 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/GeomIntersects2dPhysicalFunction.hpp @@ -0,0 +1,34 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class GeomIntersects2dPhysicalFunction : public PhysicalFunctionConcept { +public: + GeomIntersects2dPhysicalFunction(PhysicalFunction wkt1Function, PhysicalFunction wkt2Function); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt index b98134091c..4701e0568c 100644 --- a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt @@ -287,4 +287,8 @@ add_plugin(TtextInitcap PhysicalFunction nes-physical-operators TtextInitcapPhys add_plugin(TextcatTtextText PhysicalFunction nes-physical-operators TextcatTtextTextPhysicalFunction.cpp) add_plugin(TextcatTextTtext PhysicalFunction nes-physical-operators TextcatTextTtextPhysicalFunction.cpp) add_plugin(TextcatTtextTtext PhysicalFunction nes-physical-operators TextcatTtextTtextPhysicalFunction.cpp) +add_plugin(GeomIntersects2d PhysicalFunction nes-physical-operators GeomIntersects2dPhysicalFunction.cpp) +add_plugin(GeomDwithin2d PhysicalFunction nes-physical-operators GeomDwithin2dPhysicalFunction.cpp) +add_plugin(GeomContains PhysicalFunction nes-physical-operators GeomContainsPhysicalFunction.cpp) +add_plugin(GeomDisjoint2d PhysicalFunction nes-physical-operators GeomDisjoint2dPhysicalFunction.cpp) endif() diff --git a/nes-physical-operators/src/Functions/Meos/GeomContainsPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeomContainsPhysicalFunction.cpp new file mode 100644 index 0000000000..f72e9879d9 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/GeomContainsPhysicalFunction.cpp @@ -0,0 +1,80 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +GeomContainsPhysicalFunction::GeomContainsPhysicalFunction(PhysicalFunction wkt1Function, + PhysicalFunction wkt2Function) +{ + paramFns.reserve(2); + paramFns.push_back(std::move(wkt1Function)); + paramFns.push_back(std::move(wkt2Function)); +} + +VarVal GeomContainsPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto wkt1 = paramFns[0].execute(record, arena).cast(); + auto wkt2 = paramFns[1].execute(record, arena).cast(); + + const auto result = nautilus::invoke( + +[](const char* w1, uint32_t w1sz, const char* w2, uint32_t w2sz) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string s1(w1, w1sz), s2(w2, w2sz); + GSERIALIZED* gs1 = geom_in(s1.c_str(), -1); + if (!gs1) return 0.0; + GSERIALIZED* gs2 = geom_in(s2.c_str(), -1); + if (!gs2) { free(gs1); return 0.0; } + bool r = geom_contains(gs1, gs2); + free(gs1); free(gs2); + return r ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + wkt1, wkt2); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterGeomContainsPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 2, + "GeomContainsPhysicalFunction requires 2 children but got {}", + arguments.childFunctions.size()); + return GeomContainsPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/GeomDisjoint2dPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeomDisjoint2dPhysicalFunction.cpp new file mode 100644 index 0000000000..83741db21b --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/GeomDisjoint2dPhysicalFunction.cpp @@ -0,0 +1,80 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +GeomDisjoint2dPhysicalFunction::GeomDisjoint2dPhysicalFunction(PhysicalFunction wkt1Function, + PhysicalFunction wkt2Function) +{ + paramFns.reserve(2); + paramFns.push_back(std::move(wkt1Function)); + paramFns.push_back(std::move(wkt2Function)); +} + +VarVal GeomDisjoint2dPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto wkt1 = paramFns[0].execute(record, arena).cast(); + auto wkt2 = paramFns[1].execute(record, arena).cast(); + + const auto result = nautilus::invoke( + +[](const char* w1, uint32_t w1sz, const char* w2, uint32_t w2sz) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string s1(w1, w1sz), s2(w2, w2sz); + GSERIALIZED* gs1 = geom_in(s1.c_str(), -1); + if (!gs1) return 0.0; + GSERIALIZED* gs2 = geom_in(s2.c_str(), -1); + if (!gs2) { free(gs1); return 0.0; } + bool r = geom_disjoint2d(gs1, gs2); + free(gs1); free(gs2); + return r ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + wkt1, wkt2); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterGeomDisjoint2dPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 2, + "GeomDisjoint2dPhysicalFunction requires 2 children but got {}", + arguments.childFunctions.size()); + return GeomDisjoint2dPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/GeomDwithin2dPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeomDwithin2dPhysicalFunction.cpp new file mode 100644 index 0000000000..47c5446716 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/GeomDwithin2dPhysicalFunction.cpp @@ -0,0 +1,84 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +GeomDwithin2dPhysicalFunction::GeomDwithin2dPhysicalFunction(PhysicalFunction wkt1Function, + PhysicalFunction wkt2Function, + PhysicalFunction distFunction) +{ + paramFns.reserve(3); + paramFns.push_back(std::move(wkt1Function)); + paramFns.push_back(std::move(wkt2Function)); + paramFns.push_back(std::move(distFunction)); +} + +VarVal GeomDwithin2dPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto wkt1 = paramFns[0].execute(record, arena).cast(); + auto wkt2 = paramFns[1].execute(record, arena).cast(); + auto dist = paramFns[2].execute(record, arena).cast>(); + + const auto result = nautilus::invoke( + +[](const char* w1, uint32_t w1sz, const char* w2, uint32_t w2sz, double d) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string s1(w1, w1sz), s2(w2, w2sz); + GSERIALIZED* gs1 = geom_in(s1.c_str(), -1); + if (!gs1) return 0.0; + GSERIALIZED* gs2 = geom_in(s2.c_str(), -1); + if (!gs2) { free(gs1); return 0.0; } + bool r = geom_dwithin2d(gs1, gs2, d); + free(gs1); free(gs2); + return r ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + wkt1, wkt2, dist); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterGeomDwithin2dPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "GeomDwithin2dPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + return GeomDwithin2dPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/GeomIntersects2dPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeomIntersects2dPhysicalFunction.cpp new file mode 100644 index 0000000000..9fc552d4f2 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/GeomIntersects2dPhysicalFunction.cpp @@ -0,0 +1,80 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +GeomIntersects2dPhysicalFunction::GeomIntersects2dPhysicalFunction(PhysicalFunction wkt1Function, + PhysicalFunction wkt2Function) +{ + paramFns.reserve(2); + paramFns.push_back(std::move(wkt1Function)); + paramFns.push_back(std::move(wkt2Function)); +} + +VarVal GeomIntersects2dPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto wkt1 = paramFns[0].execute(record, arena).cast(); + auto wkt2 = paramFns[1].execute(record, arena).cast(); + + const auto result = nautilus::invoke( + +[](const char* w1, uint32_t w1sz, const char* w2, uint32_t w2sz) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string s1(w1, w1sz), s2(w2, w2sz); + GSERIALIZED* gs1 = geom_in(s1.c_str(), -1); + if (!gs1) return 0.0; + GSERIALIZED* gs2 = geom_in(s2.c_str(), -1); + if (!gs2) { free(gs1); return 0.0; } + bool r = geom_intersects2d(gs1, gs2); + free(gs1); free(gs2); + return r ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + wkt1, wkt2); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterGeomIntersects2dPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 2, + "GeomIntersects2dPhysicalFunction requires 2 children but got {}", + arguments.childFunctions.size()); + return GeomIntersects2dPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1])); +} + +} // namespace NES diff --git a/nes-sql-parser/AntlrSQL.g4 b/nes-sql-parser/AntlrSQL.g4 index 4ea0dfc476..8fe2bf37b1 100644 --- a/nes-sql-parser/AntlrSQL.g4 +++ b/nes-sql-parser/AntlrSQL.g4 @@ -295,7 +295,7 @@ timeUnit: MS timestampParameter: name=identifier; -functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT | TGE_TTEXT_TEXT | TGE_TEXT_TTEXT | TGT_TTEXT_TEXT | TGT_TEXT_TTEXT | TLE_TTEXT_TEXT | TLE_TEXT_TTEXT | TLT_TTEXT_TEXT | TLT_TEXT_TTEXT | TTEXT_UPPER | TTEXT_LOWER | TTEXT_INITCAP | TEXTCAT_TTEXT_TEXT | TEXTCAT_TEXT_TTEXT | TEXTCAT_TTEXT_TTEXT; +functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT | TGE_TTEXT_TEXT | TGE_TEXT_TTEXT | TGT_TTEXT_TEXT | TGT_TEXT_TTEXT | TLE_TTEXT_TEXT | TLE_TEXT_TTEXT | TLT_TTEXT_TEXT | TLT_TEXT_TTEXT | TTEXT_UPPER | TTEXT_LOWER | TTEXT_INITCAP | TEXTCAT_TTEXT_TEXT | TEXTCAT_TEXT_TTEXT | TEXTCAT_TTEXT_TTEXT | GEOM_INTERSECTS2D | GEOM_DWITHIN2D | GEOM_CONTAINS | GEOM_DISJOINT2D; sinkClause: INTO sink (',' sink)*; @@ -758,6 +758,10 @@ TTEXT_INITCAP: 'TTEXT_INITCAP' | 'ttext_initcap'; TEXTCAT_TTEXT_TEXT: 'TEXTCAT_TTEXT_TEXT' | 'textcat_ttext_text'; TEXTCAT_TEXT_TTEXT: 'TEXTCAT_TEXT_TTEXT' | 'textcat_text_ttext'; TEXTCAT_TTEXT_TTEXT: 'TEXTCAT_TTEXT_TTEXT' | 'textcat_ttext_ttext'; +GEOM_INTERSECTS2D: 'GEOM_INTERSECTS2D' | 'geom_intersects2d'; +GEOM_DWITHIN2D: 'GEOM_DWITHIN2D' | 'geom_dwithin2d'; +GEOM_CONTAINS: 'GEOM_CONTAINS' | 'geom_contains'; +GEOM_DISJOINT2D: 'GEOM_DISJOINT2D' | 'geom_disjoint2d'; WATERMARK: 'WATERMARK' | 'watermark'; OFFSET: 'OFFSET' | 'offset'; LOCALHOST: 'LOCALHOST' | 'localhost'; diff --git a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp index 3f9dfbfced..0f842ca30f 100644 --- a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp +++ b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp @@ -339,6 +339,10 @@ #include #include #include +#include +#include +#include +#include #include #include #include @@ -8746,6 +8750,43 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont return LogicalFunction(TextcatTtextTtextLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3))); } /* END CODEGEN PARSER GLUE: TEXTCAT_TTEXT_TTEXT */ + case AntlrSQLParser::GEOM_INTERSECTS2D: { + PRECONDITION(ctx->functionParam().size() == 2, + "GeomIntersects2d requires 2 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + return LogicalFunction(GeomIntersects2dLogicalFunction(std::move(arg0), std::move(arg1))); + } + /* END CODEGEN PARSER GLUE: GEOM_INTERSECTS2D */ + case AntlrSQLParser::GEOM_DWITHIN2D: { + PRECONDITION(ctx->functionParam().size() == 3, + "GeomDwithin2d requires 3 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + return LogicalFunction(GeomDwithin2dLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2))); + } + /* END CODEGEN PARSER GLUE: GEOM_DWITHIN2D */ + case AntlrSQLParser::GEOM_CONTAINS: { + PRECONDITION(ctx->functionParam().size() == 2, + "GeomContains requires 2 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + return LogicalFunction(GeomContainsLogicalFunction(std::move(arg0), std::move(arg1))); + } + /* END CODEGEN PARSER GLUE: GEOM_CONTAINS */ + case AntlrSQLParser::GEOM_DISJOINT2D: { + PRECONDITION(ctx->functionParam().size() == 2, + "GeomDisjoint2d requires 2 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + return LogicalFunction(GeomDisjoint2dLogicalFunction(std::move(arg0), std::move(arg1))); + } + /* END CODEGEN PARSER GLUE: GEOM_DISJOINT2D */ /* BEGIN CODEGEN PARSER GLUE: ALWAYS_EQ_TFLOAT_FLOAT */ case AntlrSQLLexer::ALWAYS_EQ_TFLOAT_FLOAT: { From 761b7a7c4cb5b1365c0c0d31c9b136a676fec9ff Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Sun, 14 Jun 2026 12:05:57 +0200 Subject: [PATCH 47/96] feat(meos): add GEOM_{COVERS,TOUCHES,INTERSECTS3D,DWITHIN3D,DISTANCE2D,DISTANCE3D} NES operators (W98) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Wire geom_covers, geom_touches, geom_intersects3d (2-arg: wkt1,wkt2 → float64 0/1), geom_dwithin3d (3-arg: adds dist:float64), geom_distance2d, and geom_distance3d (2-arg: wkt1,wkt2 → float64 actual distance) as per-event scalar NES operators on plain WKT geometry strings. --- .../Meos/GeomCoversLogicalFunction.hpp | 50 +++++++++ .../Meos/GeomDistance2dLogicalFunction.hpp | 50 +++++++++ .../Meos/GeomDistance3dLogicalFunction.hpp | 50 +++++++++ .../Meos/GeomDwithin3dLogicalFunction.hpp | 50 +++++++++ .../Meos/GeomIntersects3dLogicalFunction.hpp | 50 +++++++++ .../Meos/GeomTouchesLogicalFunction.hpp | 50 +++++++++ .../src/Functions/Meos/CMakeLists.txt | 6 + .../Meos/GeomCoversLogicalFunction.cpp | 101 +++++++++++++++++ .../Meos/GeomDistance2dLogicalFunction.cpp | 101 +++++++++++++++++ .../Meos/GeomDistance3dLogicalFunction.cpp | 101 +++++++++++++++++ .../Meos/GeomDwithin3dLogicalFunction.cpp | 103 ++++++++++++++++++ .../Meos/GeomIntersects3dLogicalFunction.cpp | 101 +++++++++++++++++ .../Meos/GeomTouchesLogicalFunction.cpp | 101 +++++++++++++++++ .../Meos/GeomCoversPhysicalFunction.hpp | 34 ++++++ .../Meos/GeomDistance2dPhysicalFunction.hpp | 34 ++++++ .../Meos/GeomDistance3dPhysicalFunction.hpp | 34 ++++++ .../Meos/GeomDwithin3dPhysicalFunction.hpp | 34 ++++++ .../Meos/GeomIntersects3dPhysicalFunction.hpp | 34 ++++++ .../Meos/GeomTouchesPhysicalFunction.hpp | 34 ++++++ .../src/Functions/Meos/CMakeLists.txt | 6 + .../Meos/GeomCoversPhysicalFunction.cpp | 80 ++++++++++++++ .../Meos/GeomDistance2dPhysicalFunction.cpp | 80 ++++++++++++++ .../Meos/GeomDistance3dPhysicalFunction.cpp | 80 ++++++++++++++ .../Meos/GeomDwithin3dPhysicalFunction.cpp | 84 ++++++++++++++ .../Meos/GeomIntersects3dPhysicalFunction.cpp | 80 ++++++++++++++ .../Meos/GeomTouchesPhysicalFunction.cpp | 80 ++++++++++++++ nes-sql-parser/AntlrSQL.g4 | 8 +- .../src/AntlrSQLQueryPlanCreator.cpp | 61 +++++++++++ 28 files changed, 1676 insertions(+), 1 deletion(-) create mode 100644 nes-logical-operators/include/Functions/Meos/GeomCoversLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/GeomDistance2dLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/GeomDistance3dLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/GeomDwithin3dLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/GeomIntersects3dLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/GeomTouchesLogicalFunction.hpp create mode 100644 nes-logical-operators/src/Functions/Meos/GeomCoversLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/GeomDistance2dLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/GeomDistance3dLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/GeomDwithin3dLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/GeomIntersects3dLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/GeomTouchesLogicalFunction.cpp create mode 100644 nes-physical-operators/include/Functions/Meos/GeomCoversPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/GeomDistance2dPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/GeomDistance3dPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/GeomDwithin3dPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/GeomIntersects3dPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/GeomTouchesPhysicalFunction.hpp create mode 100644 nes-physical-operators/src/Functions/Meos/GeomCoversPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/GeomDistance2dPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/GeomDistance3dPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/GeomDwithin3dPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/GeomIntersects3dPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/GeomTouchesPhysicalFunction.cpp diff --git a/nes-logical-operators/include/Functions/Meos/GeomCoversLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeomCoversLogicalFunction.hpp new file mode 100644 index 0000000000..5b41e8b2ce --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/GeomCoversLogicalFunction.hpp @@ -0,0 +1,50 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Static geometry function geom_covers: (wkt1:VARCHAR, wkt2:VARCHAR) -> float64 (0/1). + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function `geom_covers`. + */ +class GeomCoversLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "GeomCovers"; + + GeomCoversLogicalFunction(LogicalFunction wkt1, LogicalFunction wkt2); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/GeomDistance2dLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeomDistance2dLogicalFunction.hpp new file mode 100644 index 0000000000..ff67003139 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/GeomDistance2dLogicalFunction.hpp @@ -0,0 +1,50 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Static geometry function geom_distance2d: (wkt1:VARCHAR, wkt2:VARCHAR) -> float64 distance. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function `geom_distance2d`. + */ +class GeomDistance2dLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "GeomDistance2d"; + + GeomDistance2dLogicalFunction(LogicalFunction wkt1, LogicalFunction wkt2); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/GeomDistance3dLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeomDistance3dLogicalFunction.hpp new file mode 100644 index 0000000000..b752f82131 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/GeomDistance3dLogicalFunction.hpp @@ -0,0 +1,50 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Static geometry function geom_distance3d: (wkt1:VARCHAR, wkt2:VARCHAR) -> float64 distance. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function `geom_distance3d`. + */ +class GeomDistance3dLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "GeomDistance3d"; + + GeomDistance3dLogicalFunction(LogicalFunction wkt1, LogicalFunction wkt2); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/GeomDwithin3dLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeomDwithin3dLogicalFunction.hpp new file mode 100644 index 0000000000..f135afa6e6 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/GeomDwithin3dLogicalFunction.hpp @@ -0,0 +1,50 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Static geometry function geom_dwithin3d: (wkt1:VARCHAR, wkt2:VARCHAR, dist:FLOAT64) -> float64 (0/1). + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function `geom_dwithin3d`. + */ +class GeomDwithin3dLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "GeomDwithin3d"; + + GeomDwithin3dLogicalFunction(LogicalFunction wkt1, LogicalFunction wkt2, LogicalFunction dist); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/GeomIntersects3dLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeomIntersects3dLogicalFunction.hpp new file mode 100644 index 0000000000..9d80a0c50a --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/GeomIntersects3dLogicalFunction.hpp @@ -0,0 +1,50 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Static geometry function geom_intersects3d: (wkt1:VARCHAR, wkt2:VARCHAR) -> float64 (0/1). + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function `geom_intersects3d`. + */ +class GeomIntersects3dLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "GeomIntersects3d"; + + GeomIntersects3dLogicalFunction(LogicalFunction wkt1, LogicalFunction wkt2); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/GeomTouchesLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeomTouchesLogicalFunction.hpp new file mode 100644 index 0000000000..a146d450c5 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/GeomTouchesLogicalFunction.hpp @@ -0,0 +1,50 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Static geometry function geom_touches: (wkt1:VARCHAR, wkt2:VARCHAR) -> float64 (0/1). + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function `geom_touches`. + */ +class GeomTouchesLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "GeomTouches"; + + GeomTouchesLogicalFunction(LogicalFunction wkt1, LogicalFunction wkt2); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt index 2c99730b1c..ed743c292a 100644 --- a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt @@ -292,3 +292,9 @@ add_plugin(GeomIntersects2d LogicalFunction nes-logical-operators GeomIntersects add_plugin(GeomDwithin2d LogicalFunction nes-logical-operators GeomDwithin2dLogicalFunction.cpp) add_plugin(GeomContains LogicalFunction nes-logical-operators GeomContainsLogicalFunction.cpp) add_plugin(GeomDisjoint2d LogicalFunction nes-logical-operators GeomDisjoint2dLogicalFunction.cpp) +add_plugin(GeomCovers LogicalFunction nes-logical-operators GeomCoversLogicalFunction.cpp) +add_plugin(GeomTouches LogicalFunction nes-logical-operators GeomTouchesLogicalFunction.cpp) +add_plugin(GeomIntersects3d LogicalFunction nes-logical-operators GeomIntersects3dLogicalFunction.cpp) +add_plugin(GeomDwithin3d LogicalFunction nes-logical-operators GeomDwithin3dLogicalFunction.cpp) +add_plugin(GeomDistance2d LogicalFunction nes-logical-operators GeomDistance2dLogicalFunction.cpp) +add_plugin(GeomDistance3d LogicalFunction nes-logical-operators GeomDistance3dLogicalFunction.cpp) diff --git a/nes-logical-operators/src/Functions/Meos/GeomCoversLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeomCoversLogicalFunction.cpp new file mode 100644 index 0000000000..f1f9b565b7 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/GeomCoversLogicalFunction.cpp @@ -0,0 +1,101 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +GeomCoversLogicalFunction::GeomCoversLogicalFunction(LogicalFunction wkt1, LogicalFunction wkt2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(2); + parameters.push_back(std::move(wkt1)); + parameters.push_back(std::move(wkt2)); +} + +DataType GeomCoversLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction GeomCoversLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector GeomCoversLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction GeomCoversLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 2, "GeomCoversLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view GeomCoversLogicalFunction::getType() const { return NAME; } + +bool GeomCoversLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string GeomCoversLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction GeomCoversLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction GeomCoversLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeomCoversLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 2, + "GeomCoversLogicalFunction requires 2 children but got {}", + arguments.children.size()); + return GeomCoversLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/GeomDistance2dLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeomDistance2dLogicalFunction.cpp new file mode 100644 index 0000000000..fc109801a4 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/GeomDistance2dLogicalFunction.cpp @@ -0,0 +1,101 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +GeomDistance2dLogicalFunction::GeomDistance2dLogicalFunction(LogicalFunction wkt1, LogicalFunction wkt2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(2); + parameters.push_back(std::move(wkt1)); + parameters.push_back(std::move(wkt2)); +} + +DataType GeomDistance2dLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction GeomDistance2dLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector GeomDistance2dLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction GeomDistance2dLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 2, "GeomDistance2dLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view GeomDistance2dLogicalFunction::getType() const { return NAME; } + +bool GeomDistance2dLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string GeomDistance2dLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction GeomDistance2dLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction GeomDistance2dLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeomDistance2dLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 2, + "GeomDistance2dLogicalFunction requires 2 children but got {}", + arguments.children.size()); + return GeomDistance2dLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/GeomDistance3dLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeomDistance3dLogicalFunction.cpp new file mode 100644 index 0000000000..4aef02ec00 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/GeomDistance3dLogicalFunction.cpp @@ -0,0 +1,101 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +GeomDistance3dLogicalFunction::GeomDistance3dLogicalFunction(LogicalFunction wkt1, LogicalFunction wkt2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(2); + parameters.push_back(std::move(wkt1)); + parameters.push_back(std::move(wkt2)); +} + +DataType GeomDistance3dLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction GeomDistance3dLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector GeomDistance3dLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction GeomDistance3dLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 2, "GeomDistance3dLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view GeomDistance3dLogicalFunction::getType() const { return NAME; } + +bool GeomDistance3dLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string GeomDistance3dLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction GeomDistance3dLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction GeomDistance3dLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeomDistance3dLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 2, + "GeomDistance3dLogicalFunction requires 2 children but got {}", + arguments.children.size()); + return GeomDistance3dLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/GeomDwithin3dLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeomDwithin3dLogicalFunction.cpp new file mode 100644 index 0000000000..8907cea610 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/GeomDwithin3dLogicalFunction.cpp @@ -0,0 +1,103 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +GeomDwithin3dLogicalFunction::GeomDwithin3dLogicalFunction(LogicalFunction wkt1, LogicalFunction wkt2, LogicalFunction dist) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(wkt1)); + parameters.push_back(std::move(wkt2)); + parameters.push_back(std::move(dist)); +} + +DataType GeomDwithin3dLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction GeomDwithin3dLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector GeomDwithin3dLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction GeomDwithin3dLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "GeomDwithin3dLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view GeomDwithin3dLogicalFunction::getType() const { return NAME; } + +bool GeomDwithin3dLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string GeomDwithin3dLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction GeomDwithin3dLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction GeomDwithin3dLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeomDwithin3dLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "GeomDwithin3dLogicalFunction requires 3 children but got {}", + arguments.children.size()); + return GeomDwithin3dLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/GeomIntersects3dLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeomIntersects3dLogicalFunction.cpp new file mode 100644 index 0000000000..bc0ae39b53 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/GeomIntersects3dLogicalFunction.cpp @@ -0,0 +1,101 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +GeomIntersects3dLogicalFunction::GeomIntersects3dLogicalFunction(LogicalFunction wkt1, LogicalFunction wkt2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(2); + parameters.push_back(std::move(wkt1)); + parameters.push_back(std::move(wkt2)); +} + +DataType GeomIntersects3dLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction GeomIntersects3dLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector GeomIntersects3dLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction GeomIntersects3dLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 2, "GeomIntersects3dLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view GeomIntersects3dLogicalFunction::getType() const { return NAME; } + +bool GeomIntersects3dLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string GeomIntersects3dLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction GeomIntersects3dLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction GeomIntersects3dLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeomIntersects3dLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 2, + "GeomIntersects3dLogicalFunction requires 2 children but got {}", + arguments.children.size()); + return GeomIntersects3dLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/GeomTouchesLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeomTouchesLogicalFunction.cpp new file mode 100644 index 0000000000..e8e776a850 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/GeomTouchesLogicalFunction.cpp @@ -0,0 +1,101 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +GeomTouchesLogicalFunction::GeomTouchesLogicalFunction(LogicalFunction wkt1, LogicalFunction wkt2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(2); + parameters.push_back(std::move(wkt1)); + parameters.push_back(std::move(wkt2)); +} + +DataType GeomTouchesLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction GeomTouchesLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector GeomTouchesLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction GeomTouchesLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 2, "GeomTouchesLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view GeomTouchesLogicalFunction::getType() const { return NAME; } + +bool GeomTouchesLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string GeomTouchesLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) { + if (index > 0) args += ", "; + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction GeomTouchesLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + return withChildren(newChildren); +} + +SerializableFunction GeomTouchesLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeomTouchesLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 2, + "GeomTouchesLogicalFunction requires 2 children but got {}", + arguments.children.size()); + return GeomTouchesLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1])); +} + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeomCoversPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeomCoversPhysicalFunction.hpp new file mode 100644 index 0000000000..fc4766e34e --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/GeomCoversPhysicalFunction.hpp @@ -0,0 +1,34 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class GeomCoversPhysicalFunction : public PhysicalFunctionConcept { +public: + GeomCoversPhysicalFunction(PhysicalFunction wkt1Function, PhysicalFunction wkt2Function); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeomDistance2dPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeomDistance2dPhysicalFunction.hpp new file mode 100644 index 0000000000..139d856a64 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/GeomDistance2dPhysicalFunction.hpp @@ -0,0 +1,34 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class GeomDistance2dPhysicalFunction : public PhysicalFunctionConcept { +public: + GeomDistance2dPhysicalFunction(PhysicalFunction wkt1Function, PhysicalFunction wkt2Function); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeomDistance3dPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeomDistance3dPhysicalFunction.hpp new file mode 100644 index 0000000000..1e609d2cf7 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/GeomDistance3dPhysicalFunction.hpp @@ -0,0 +1,34 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class GeomDistance3dPhysicalFunction : public PhysicalFunctionConcept { +public: + GeomDistance3dPhysicalFunction(PhysicalFunction wkt1Function, PhysicalFunction wkt2Function); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeomDwithin3dPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeomDwithin3dPhysicalFunction.hpp new file mode 100644 index 0000000000..4e895d8a95 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/GeomDwithin3dPhysicalFunction.hpp @@ -0,0 +1,34 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class GeomDwithin3dPhysicalFunction : public PhysicalFunctionConcept { +public: + GeomDwithin3dPhysicalFunction(PhysicalFunction wkt1Function, PhysicalFunction wkt2Function, PhysicalFunction distFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeomIntersects3dPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeomIntersects3dPhysicalFunction.hpp new file mode 100644 index 0000000000..fc27c5635e --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/GeomIntersects3dPhysicalFunction.hpp @@ -0,0 +1,34 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class GeomIntersects3dPhysicalFunction : public PhysicalFunctionConcept { +public: + GeomIntersects3dPhysicalFunction(PhysicalFunction wkt1Function, PhysicalFunction wkt2Function); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeomTouchesPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeomTouchesPhysicalFunction.hpp new file mode 100644 index 0000000000..9fac03a277 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/GeomTouchesPhysicalFunction.hpp @@ -0,0 +1,34 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class GeomTouchesPhysicalFunction : public PhysicalFunctionConcept { +public: + GeomTouchesPhysicalFunction(PhysicalFunction wkt1Function, PhysicalFunction wkt2Function); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt index 4701e0568c..a9ac96980e 100644 --- a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt @@ -291,4 +291,10 @@ add_plugin(GeomIntersects2d PhysicalFunction nes-physical-operators GeomIntersec add_plugin(GeomDwithin2d PhysicalFunction nes-physical-operators GeomDwithin2dPhysicalFunction.cpp) add_plugin(GeomContains PhysicalFunction nes-physical-operators GeomContainsPhysicalFunction.cpp) add_plugin(GeomDisjoint2d PhysicalFunction nes-physical-operators GeomDisjoint2dPhysicalFunction.cpp) +add_plugin(GeomCovers PhysicalFunction nes-physical-operators GeomCoversPhysicalFunction.cpp) +add_plugin(GeomTouches PhysicalFunction nes-physical-operators GeomTouchesPhysicalFunction.cpp) +add_plugin(GeomIntersects3d PhysicalFunction nes-physical-operators GeomIntersects3dPhysicalFunction.cpp) +add_plugin(GeomDwithin3d PhysicalFunction nes-physical-operators GeomDwithin3dPhysicalFunction.cpp) +add_plugin(GeomDistance2d PhysicalFunction nes-physical-operators GeomDistance2dPhysicalFunction.cpp) +add_plugin(GeomDistance3d PhysicalFunction nes-physical-operators GeomDistance3dPhysicalFunction.cpp) endif() diff --git a/nes-physical-operators/src/Functions/Meos/GeomCoversPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeomCoversPhysicalFunction.cpp new file mode 100644 index 0000000000..c757aa9fb8 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/GeomCoversPhysicalFunction.cpp @@ -0,0 +1,80 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +GeomCoversPhysicalFunction::GeomCoversPhysicalFunction(PhysicalFunction wkt1Function, + PhysicalFunction wkt2Function) +{ + paramFns.reserve(2); + paramFns.push_back(std::move(wkt1Function)); + paramFns.push_back(std::move(wkt2Function)); +} + +VarVal GeomCoversPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto wkt1 = paramFns[0].execute(record, arena).cast(); + auto wkt2 = paramFns[1].execute(record, arena).cast(); + + const auto result = nautilus::invoke( + +[](const char* w1, uint32_t w1sz, const char* w2, uint32_t w2sz) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string s1(w1, w1sz), s2(w2, w2sz); + GSERIALIZED* gs1 = geom_in(s1.c_str(), -1); + if (!gs1) return 0.0; + GSERIALIZED* gs2 = geom_in(s2.c_str(), -1); + if (!gs2) { free(gs1); return 0.0; } + bool r = geom_covers(gs1, gs2); + free(gs1); free(gs2); + return r ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + wkt1, wkt2); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterGeomCoversPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 2, + "GeomCoversPhysicalFunction requires 2 children but got {}", + arguments.childFunctions.size()); + return GeomCoversPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/GeomDistance2dPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeomDistance2dPhysicalFunction.cpp new file mode 100644 index 0000000000..9a29adab1c --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/GeomDistance2dPhysicalFunction.cpp @@ -0,0 +1,80 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +GeomDistance2dPhysicalFunction::GeomDistance2dPhysicalFunction(PhysicalFunction wkt1Function, + PhysicalFunction wkt2Function) +{ + paramFns.reserve(2); + paramFns.push_back(std::move(wkt1Function)); + paramFns.push_back(std::move(wkt2Function)); +} + +VarVal GeomDistance2dPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto wkt1 = paramFns[0].execute(record, arena).cast(); + auto wkt2 = paramFns[1].execute(record, arena).cast(); + + const auto result = nautilus::invoke( + +[](const char* w1, uint32_t w1sz, const char* w2, uint32_t w2sz) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string s1(w1, w1sz), s2(w2, w2sz); + GSERIALIZED* gs1 = geom_in(s1.c_str(), -1); + if (!gs1) return 0.0; + GSERIALIZED* gs2 = geom_in(s2.c_str(), -1); + if (!gs2) { free(gs1); return 0.0; } + double r = geom_distance2d(gs1, gs2); + free(gs1); free(gs2); + return r; + } catch (const std::exception&) { return 0.0; } + }, + wkt1, wkt2); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterGeomDistance2dPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 2, + "GeomDistance2dPhysicalFunction requires 2 children but got {}", + arguments.childFunctions.size()); + return GeomDistance2dPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/GeomDistance3dPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeomDistance3dPhysicalFunction.cpp new file mode 100644 index 0000000000..05c7667dce --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/GeomDistance3dPhysicalFunction.cpp @@ -0,0 +1,80 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +GeomDistance3dPhysicalFunction::GeomDistance3dPhysicalFunction(PhysicalFunction wkt1Function, + PhysicalFunction wkt2Function) +{ + paramFns.reserve(2); + paramFns.push_back(std::move(wkt1Function)); + paramFns.push_back(std::move(wkt2Function)); +} + +VarVal GeomDistance3dPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto wkt1 = paramFns[0].execute(record, arena).cast(); + auto wkt2 = paramFns[1].execute(record, arena).cast(); + + const auto result = nautilus::invoke( + +[](const char* w1, uint32_t w1sz, const char* w2, uint32_t w2sz) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string s1(w1, w1sz), s2(w2, w2sz); + GSERIALIZED* gs1 = geom_in(s1.c_str(), -1); + if (!gs1) return 0.0; + GSERIALIZED* gs2 = geom_in(s2.c_str(), -1); + if (!gs2) { free(gs1); return 0.0; } + double r = geom_distance3d(gs1, gs2); + free(gs1); free(gs2); + return r; + } catch (const std::exception&) { return 0.0; } + }, + wkt1, wkt2); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterGeomDistance3dPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 2, + "GeomDistance3dPhysicalFunction requires 2 children but got {}", + arguments.childFunctions.size()); + return GeomDistance3dPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/GeomDwithin3dPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeomDwithin3dPhysicalFunction.cpp new file mode 100644 index 0000000000..429b558521 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/GeomDwithin3dPhysicalFunction.cpp @@ -0,0 +1,84 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +GeomDwithin3dPhysicalFunction::GeomDwithin3dPhysicalFunction(PhysicalFunction wkt1Function, + PhysicalFunction wkt2Function, + PhysicalFunction distFunction) +{ + paramFns.reserve(3); + paramFns.push_back(std::move(wkt1Function)); + paramFns.push_back(std::move(wkt2Function)); + paramFns.push_back(std::move(distFunction)); +} + +VarVal GeomDwithin3dPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto wkt1 = paramFns[0].execute(record, arena).cast(); + auto wkt2 = paramFns[1].execute(record, arena).cast(); + auto dist = paramFns[2].execute(record, arena).cast>(); + + const auto result = nautilus::invoke( + +[](const char* w1, uint32_t w1sz, const char* w2, uint32_t w2sz, double d) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string s1(w1, w1sz), s2(w2, w2sz); + GSERIALIZED* gs1 = geom_in(s1.c_str(), -1); + if (!gs1) return 0.0; + GSERIALIZED* gs2 = geom_in(s2.c_str(), -1); + if (!gs2) { free(gs1); return 0.0; } + bool r = geom_dwithin3d(gs1, gs2, d); + free(gs1); free(gs2); + return r ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + wkt1, wkt2, dist); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterGeomDwithin3dPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "GeomDwithin3dPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + return GeomDwithin3dPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/GeomIntersects3dPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeomIntersects3dPhysicalFunction.cpp new file mode 100644 index 0000000000..cbd4e019c2 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/GeomIntersects3dPhysicalFunction.cpp @@ -0,0 +1,80 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +GeomIntersects3dPhysicalFunction::GeomIntersects3dPhysicalFunction(PhysicalFunction wkt1Function, + PhysicalFunction wkt2Function) +{ + paramFns.reserve(2); + paramFns.push_back(std::move(wkt1Function)); + paramFns.push_back(std::move(wkt2Function)); +} + +VarVal GeomIntersects3dPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto wkt1 = paramFns[0].execute(record, arena).cast(); + auto wkt2 = paramFns[1].execute(record, arena).cast(); + + const auto result = nautilus::invoke( + +[](const char* w1, uint32_t w1sz, const char* w2, uint32_t w2sz) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string s1(w1, w1sz), s2(w2, w2sz); + GSERIALIZED* gs1 = geom_in(s1.c_str(), -1); + if (!gs1) return 0.0; + GSERIALIZED* gs2 = geom_in(s2.c_str(), -1); + if (!gs2) { free(gs1); return 0.0; } + bool r = geom_intersects3d(gs1, gs2); + free(gs1); free(gs2); + return r ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + wkt1, wkt2); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterGeomIntersects3dPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 2, + "GeomIntersects3dPhysicalFunction requires 2 children but got {}", + arguments.childFunctions.size()); + return GeomIntersects3dPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/GeomTouchesPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeomTouchesPhysicalFunction.cpp new file mode 100644 index 0000000000..8df0beaafe --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/GeomTouchesPhysicalFunction.cpp @@ -0,0 +1,80 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +GeomTouchesPhysicalFunction::GeomTouchesPhysicalFunction(PhysicalFunction wkt1Function, + PhysicalFunction wkt2Function) +{ + paramFns.reserve(2); + paramFns.push_back(std::move(wkt1Function)); + paramFns.push_back(std::move(wkt2Function)); +} + +VarVal GeomTouchesPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto wkt1 = paramFns[0].execute(record, arena).cast(); + auto wkt2 = paramFns[1].execute(record, arena).cast(); + + const auto result = nautilus::invoke( + +[](const char* w1, uint32_t w1sz, const char* w2, uint32_t w2sz) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string s1(w1, w1sz), s2(w2, w2sz); + GSERIALIZED* gs1 = geom_in(s1.c_str(), -1); + if (!gs1) return 0.0; + GSERIALIZED* gs2 = geom_in(s2.c_str(), -1); + if (!gs2) { free(gs1); return 0.0; } + bool r = geom_touches(gs1, gs2); + free(gs1); free(gs2); + return r ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + wkt1, wkt2); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterGeomTouchesPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 2, + "GeomTouchesPhysicalFunction requires 2 children but got {}", + arguments.childFunctions.size()); + return GeomTouchesPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1])); +} + +} // namespace NES diff --git a/nes-sql-parser/AntlrSQL.g4 b/nes-sql-parser/AntlrSQL.g4 index 8fe2bf37b1..102f28fdbb 100644 --- a/nes-sql-parser/AntlrSQL.g4 +++ b/nes-sql-parser/AntlrSQL.g4 @@ -295,7 +295,7 @@ timeUnit: MS timestampParameter: name=identifier; -functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT | TGE_TTEXT_TEXT | TGE_TEXT_TTEXT | TGT_TTEXT_TEXT | TGT_TEXT_TTEXT | TLE_TTEXT_TEXT | TLE_TEXT_TTEXT | TLT_TTEXT_TEXT | TLT_TEXT_TTEXT | TTEXT_UPPER | TTEXT_LOWER | TTEXT_INITCAP | TEXTCAT_TTEXT_TEXT | TEXTCAT_TEXT_TTEXT | TEXTCAT_TTEXT_TTEXT | GEOM_INTERSECTS2D | GEOM_DWITHIN2D | GEOM_CONTAINS | GEOM_DISJOINT2D; +functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT | TGE_TTEXT_TEXT | TGE_TEXT_TTEXT | TGT_TTEXT_TEXT | TGT_TEXT_TTEXT | TLE_TTEXT_TEXT | TLE_TEXT_TTEXT | TLT_TTEXT_TEXT | TLT_TEXT_TTEXT | TTEXT_UPPER | TTEXT_LOWER | TTEXT_INITCAP | TEXTCAT_TTEXT_TEXT | TEXTCAT_TEXT_TTEXT | TEXTCAT_TTEXT_TTEXT | GEOM_INTERSECTS2D | GEOM_DWITHIN2D | GEOM_CONTAINS | GEOM_DISJOINT2D | GEOM_COVERS | GEOM_TOUCHES | GEOM_INTERSECTS3D | GEOM_DWITHIN3D | GEOM_DISTANCE2D | GEOM_DISTANCE3D; sinkClause: INTO sink (',' sink)*; @@ -762,6 +762,12 @@ GEOM_INTERSECTS2D: 'GEOM_INTERSECTS2D' | 'geom_intersects2d'; GEOM_DWITHIN2D: 'GEOM_DWITHIN2D' | 'geom_dwithin2d'; GEOM_CONTAINS: 'GEOM_CONTAINS' | 'geom_contains'; GEOM_DISJOINT2D: 'GEOM_DISJOINT2D' | 'geom_disjoint2d'; +GEOM_COVERS: 'GEOM_COVERS' | 'geom_covers'; +GEOM_TOUCHES: 'GEOM_TOUCHES' | 'geom_touches'; +GEOM_INTERSECTS3D: 'GEOM_INTERSECTS3D' | 'geom_intersects3d'; +GEOM_DWITHIN3D: 'GEOM_DWITHIN3D' | 'geom_dwithin3d'; +GEOM_DISTANCE2D: 'GEOM_DISTANCE2D' | 'geom_distance2d'; +GEOM_DISTANCE3D: 'GEOM_DISTANCE3D' | 'geom_distance3d'; WATERMARK: 'WATERMARK' | 'watermark'; OFFSET: 'OFFSET' | 'offset'; LOCALHOST: 'LOCALHOST' | 'localhost'; diff --git a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp index 0f842ca30f..70f8755af2 100644 --- a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp +++ b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp @@ -343,6 +343,12 @@ #include #include #include +#include +#include +#include +#include +#include +#include #include #include #include @@ -8787,6 +8793,61 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont return LogicalFunction(GeomDisjoint2dLogicalFunction(std::move(arg0), std::move(arg1))); } /* END CODEGEN PARSER GLUE: GEOM_DISJOINT2D */ + case AntlrSQLParser::GEOM_COVERS: { + PRECONDITION(ctx->functionParam().size() == 2, + "GeomCovers requires 2 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + return LogicalFunction(GeomCoversLogicalFunction(std::move(arg0), std::move(arg1))); + } + /* END CODEGEN PARSER GLUE: GEOM_COVERS */ + case AntlrSQLParser::GEOM_TOUCHES: { + PRECONDITION(ctx->functionParam().size() == 2, + "GeomTouches requires 2 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + return LogicalFunction(GeomTouchesLogicalFunction(std::move(arg0), std::move(arg1))); + } + /* END CODEGEN PARSER GLUE: GEOM_TOUCHES */ + case AntlrSQLParser::GEOM_INTERSECTS3D: { + PRECONDITION(ctx->functionParam().size() == 2, + "GeomIntersects3d requires 2 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + return LogicalFunction(GeomIntersects3dLogicalFunction(std::move(arg0), std::move(arg1))); + } + /* END CODEGEN PARSER GLUE: GEOM_INTERSECTS3D */ + case AntlrSQLParser::GEOM_DWITHIN3D: { + PRECONDITION(ctx->functionParam().size() == 3, + "GeomDwithin3d requires 3 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + return LogicalFunction(GeomDwithin3dLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2))); + } + /* END CODEGEN PARSER GLUE: GEOM_DWITHIN3D */ + case AntlrSQLParser::GEOM_DISTANCE2D: { + PRECONDITION(ctx->functionParam().size() == 2, + "GeomDistance2d requires 2 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + return LogicalFunction(GeomDistance2dLogicalFunction(std::move(arg0), std::move(arg1))); + } + /* END CODEGEN PARSER GLUE: GEOM_DISTANCE2D */ + case AntlrSQLParser::GEOM_DISTANCE3D: { + PRECONDITION(ctx->functionParam().size() == 2, + "GeomDistance3d requires 2 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + return LogicalFunction(GeomDistance3dLogicalFunction(std::move(arg0), std::move(arg1))); + } + /* END CODEGEN PARSER GLUE: GEOM_DISTANCE3D */ /* BEGIN CODEGEN PARSER GLUE: ALWAYS_EQ_TFLOAT_FLOAT */ case AntlrSQLLexer::ALWAYS_EQ_TFLOAT_FLOAT: { From 5d2fdc9d61cd69b456b2f6dd40d11c330c79f781 Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Sun, 14 Jun 2026 12:16:37 +0200 Subject: [PATCH 48/96] feat(meos): add GEOM_{LENGTH,PERIMETER} NES operators (W99) --- .../Meos/GeomLengthLogicalFunction.hpp | 51 ++++++++++ .../Meos/GeomPerimeterLogicalFunction.hpp | 51 ++++++++++ .../src/Functions/Meos/CMakeLists.txt | 2 + .../Meos/GeomLengthLogicalFunction.cpp | 94 +++++++++++++++++++ .../Meos/GeomPerimeterLogicalFunction.cpp | 94 +++++++++++++++++++ .../Meos/GeomLengthPhysicalFunction.hpp | 34 +++++++ .../Meos/GeomPerimeterPhysicalFunction.hpp | 34 +++++++ .../src/Functions/Meos/CMakeLists.txt | 2 + .../Meos/GeomLengthPhysicalFunction.cpp | 73 ++++++++++++++ .../Meos/GeomPerimeterPhysicalFunction.cpp | 73 ++++++++++++++ nes-sql-parser/AntlrSQL.g4 | 4 +- .../src/AntlrSQLQueryPlanCreator.cpp | 18 ++++ 12 files changed, 529 insertions(+), 1 deletion(-) create mode 100644 nes-logical-operators/include/Functions/Meos/GeomLengthLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/GeomPerimeterLogicalFunction.hpp create mode 100644 nes-logical-operators/src/Functions/Meos/GeomLengthLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/GeomPerimeterLogicalFunction.cpp create mode 100644 nes-physical-operators/include/Functions/Meos/GeomLengthPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/GeomPerimeterPhysicalFunction.hpp create mode 100644 nes-physical-operators/src/Functions/Meos/GeomLengthPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/GeomPerimeterPhysicalFunction.cpp diff --git a/nes-logical-operators/include/Functions/Meos/GeomLengthLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeomLengthLogicalFunction.hpp new file mode 100644 index 0000000000..5de9ddc37b --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/GeomLengthLogicalFunction.hpp @@ -0,0 +1,51 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Static geometry scalar geom_length: (wkt1:VARCHAR) -> float64. + * + * Generated from the MEOS function `geom_length`. + * Operates on plain WKT strings without a temporal dimension. + */ +class GeomLengthLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "GeomLength"; + + explicit GeomLengthLogicalFunction(LogicalFunction wkt1); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/GeomPerimeterLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeomPerimeterLogicalFunction.hpp new file mode 100644 index 0000000000..a9b82a52a0 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/GeomPerimeterLogicalFunction.hpp @@ -0,0 +1,51 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Static geometry scalar geom_perimeter: (wkt1:VARCHAR) -> float64. + * + * Generated from the MEOS function `geom_perimeter`. + * Operates on plain WKT strings without a temporal dimension. + */ +class GeomPerimeterLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "GeomPerimeter"; + + explicit GeomPerimeterLogicalFunction(LogicalFunction wkt1); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt index ed743c292a..6797e5790c 100644 --- a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt @@ -288,6 +288,8 @@ add_plugin(TtextInitcap LogicalFunction nes-logical-operators TtextInitcapLogica add_plugin(TextcatTtextText LogicalFunction nes-logical-operators TextcatTtextTextLogicalFunction.cpp) add_plugin(TextcatTextTtext LogicalFunction nes-logical-operators TextcatTextTtextLogicalFunction.cpp) add_plugin(TextcatTtextTtext LogicalFunction nes-logical-operators TextcatTtextTtextLogicalFunction.cpp) +add_plugin(GeomLength LogicalFunction nes-logical-operators GeomLengthLogicalFunction.cpp) +add_plugin(GeomPerimeter LogicalFunction nes-logical-operators GeomPerimeterLogicalFunction.cpp) add_plugin(GeomIntersects2d LogicalFunction nes-logical-operators GeomIntersects2dLogicalFunction.cpp) add_plugin(GeomDwithin2d LogicalFunction nes-logical-operators GeomDwithin2dLogicalFunction.cpp) add_plugin(GeomContains LogicalFunction nes-logical-operators GeomContainsLogicalFunction.cpp) diff --git a/nes-logical-operators/src/Functions/Meos/GeomLengthLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeomLengthLogicalFunction.cpp new file mode 100644 index 0000000000..c86f9b001b --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/GeomLengthLogicalFunction.cpp @@ -0,0 +1,94 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +GeomLengthLogicalFunction::GeomLengthLogicalFunction(LogicalFunction wkt1) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(1); + parameters.push_back(std::move(wkt1)); +} + +DataType GeomLengthLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction GeomLengthLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector GeomLengthLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction GeomLengthLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 1, "GeomLengthLogicalFunction requires 1 child, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view GeomLengthLogicalFunction::getType() const { return NAME; } + +bool GeomLengthLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string GeomLengthLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction GeomLengthLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(1); + newChildren.emplace_back(parameters[0].withInferredDataType(schema)); + INVARIANT(newChildren[0].getDataType().isType(DataType::Type::VARSIZED), + "wkt1 must be VARSIZED, but was: {}", newChildren[0].getDataType()); + return withChildren(newChildren); +} + +SerializableFunction GeomLengthLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeomLengthLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 1, + "GeomLengthLogicalFunction requires 1 child but got {}", + arguments.children.size()); + return GeomLengthLogicalFunction(std::move(arguments.children[0])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/GeomPerimeterLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeomPerimeterLogicalFunction.cpp new file mode 100644 index 0000000000..1b5b36c4cc --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/GeomPerimeterLogicalFunction.cpp @@ -0,0 +1,94 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +GeomPerimeterLogicalFunction::GeomPerimeterLogicalFunction(LogicalFunction wkt1) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(1); + parameters.push_back(std::move(wkt1)); +} + +DataType GeomPerimeterLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction GeomPerimeterLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector GeomPerimeterLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction GeomPerimeterLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 1, "GeomPerimeterLogicalFunction requires 1 child, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view GeomPerimeterLogicalFunction::getType() const { return NAME; } + +bool GeomPerimeterLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string GeomPerimeterLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction GeomPerimeterLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(1); + newChildren.emplace_back(parameters[0].withInferredDataType(schema)); + INVARIANT(newChildren[0].getDataType().isType(DataType::Type::VARSIZED), + "wkt1 must be VARSIZED, but was: {}", newChildren[0].getDataType()); + return withChildren(newChildren); +} + +SerializableFunction GeomPerimeterLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeomPerimeterLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 1, + "GeomPerimeterLogicalFunction requires 1 child but got {}", + arguments.children.size()); + return GeomPerimeterLogicalFunction(std::move(arguments.children[0])); +} + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeomLengthPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeomLengthPhysicalFunction.hpp new file mode 100644 index 0000000000..d7aced0440 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/GeomLengthPhysicalFunction.hpp @@ -0,0 +1,34 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class GeomLengthPhysicalFunction : public PhysicalFunctionConcept { +public: + explicit GeomLengthPhysicalFunction(PhysicalFunction wkt1Function); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeomPerimeterPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeomPerimeterPhysicalFunction.hpp new file mode 100644 index 0000000000..281310c367 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/GeomPerimeterPhysicalFunction.hpp @@ -0,0 +1,34 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class GeomPerimeterPhysicalFunction : public PhysicalFunctionConcept { +public: + explicit GeomPerimeterPhysicalFunction(PhysicalFunction wkt1Function); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt index a9ac96980e..3c6c8d2539 100644 --- a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt @@ -287,6 +287,8 @@ add_plugin(TtextInitcap PhysicalFunction nes-physical-operators TtextInitcapPhys add_plugin(TextcatTtextText PhysicalFunction nes-physical-operators TextcatTtextTextPhysicalFunction.cpp) add_plugin(TextcatTextTtext PhysicalFunction nes-physical-operators TextcatTextTtextPhysicalFunction.cpp) add_plugin(TextcatTtextTtext PhysicalFunction nes-physical-operators TextcatTtextTtextPhysicalFunction.cpp) +add_plugin(GeomLength PhysicalFunction nes-physical-operators GeomLengthPhysicalFunction.cpp) +add_plugin(GeomPerimeter PhysicalFunction nes-physical-operators GeomPerimeterPhysicalFunction.cpp) add_plugin(GeomIntersects2d PhysicalFunction nes-physical-operators GeomIntersects2dPhysicalFunction.cpp) add_plugin(GeomDwithin2d PhysicalFunction nes-physical-operators GeomDwithin2dPhysicalFunction.cpp) add_plugin(GeomContains PhysicalFunction nes-physical-operators GeomContainsPhysicalFunction.cpp) diff --git a/nes-physical-operators/src/Functions/Meos/GeomLengthPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeomLengthPhysicalFunction.cpp new file mode 100644 index 0000000000..79ac73c676 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/GeomLengthPhysicalFunction.cpp @@ -0,0 +1,73 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +GeomLengthPhysicalFunction::GeomLengthPhysicalFunction(PhysicalFunction wkt1Function) +{ + paramFns.reserve(1); + paramFns.push_back(std::move(wkt1Function)); +} + +VarVal GeomLengthPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto wkt1 = paramFns[0].execute(record, arena).cast(); + + const auto result = nautilus::invoke( + +[](const char* w1, uint32_t w1sz) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string s1(w1, w1sz); + GSERIALIZED* gs1 = geom_in(s1.c_str(), -1); + if (!gs1) return 0.0; + double r = geom_length(gs1); + free(gs1); + return r; + } catch (const std::exception&) { return 0.0; } + }, + wkt1); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterGeomLengthPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 1, + "GeomLengthPhysicalFunction requires 1 child but got {}", + arguments.childFunctions.size()); + return GeomLengthPhysicalFunction(std::move(arguments.childFunctions[0])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/GeomPerimeterPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeomPerimeterPhysicalFunction.cpp new file mode 100644 index 0000000000..7e56e10181 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/GeomPerimeterPhysicalFunction.cpp @@ -0,0 +1,73 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +GeomPerimeterPhysicalFunction::GeomPerimeterPhysicalFunction(PhysicalFunction wkt1Function) +{ + paramFns.reserve(1); + paramFns.push_back(std::move(wkt1Function)); +} + +VarVal GeomPerimeterPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto wkt1 = paramFns[0].execute(record, arena).cast(); + + const auto result = nautilus::invoke( + +[](const char* w1, uint32_t w1sz) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string s1(w1, w1sz); + GSERIALIZED* gs1 = geom_in(s1.c_str(), -1); + if (!gs1) return 0.0; + double r = geom_perimeter(gs1); + free(gs1); + return r; + } catch (const std::exception&) { return 0.0; } + }, + wkt1); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterGeomPerimeterPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 1, + "GeomPerimeterPhysicalFunction requires 1 child but got {}", + arguments.childFunctions.size()); + return GeomPerimeterPhysicalFunction(std::move(arguments.childFunctions[0])); +} + +} // namespace NES diff --git a/nes-sql-parser/AntlrSQL.g4 b/nes-sql-parser/AntlrSQL.g4 index 102f28fdbb..2671e33d6f 100644 --- a/nes-sql-parser/AntlrSQL.g4 +++ b/nes-sql-parser/AntlrSQL.g4 @@ -295,7 +295,7 @@ timeUnit: MS timestampParameter: name=identifier; -functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT | TGE_TTEXT_TEXT | TGE_TEXT_TTEXT | TGT_TTEXT_TEXT | TGT_TEXT_TTEXT | TLE_TTEXT_TEXT | TLE_TEXT_TTEXT | TLT_TTEXT_TEXT | TLT_TEXT_TTEXT | TTEXT_UPPER | TTEXT_LOWER | TTEXT_INITCAP | TEXTCAT_TTEXT_TEXT | TEXTCAT_TEXT_TTEXT | TEXTCAT_TTEXT_TTEXT | GEOM_INTERSECTS2D | GEOM_DWITHIN2D | GEOM_CONTAINS | GEOM_DISJOINT2D | GEOM_COVERS | GEOM_TOUCHES | GEOM_INTERSECTS3D | GEOM_DWITHIN3D | GEOM_DISTANCE2D | GEOM_DISTANCE3D; +functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT | TGE_TTEXT_TEXT | TGE_TEXT_TTEXT | TGT_TTEXT_TEXT | TGT_TEXT_TTEXT | TLE_TTEXT_TEXT | TLE_TEXT_TTEXT | TLT_TTEXT_TEXT | TLT_TEXT_TTEXT | TTEXT_UPPER | TTEXT_LOWER | TTEXT_INITCAP | TEXTCAT_TTEXT_TEXT | TEXTCAT_TEXT_TTEXT | TEXTCAT_TTEXT_TTEXT | GEOM_LENGTH | GEOM_PERIMETER | GEOM_INTERSECTS2D | GEOM_DWITHIN2D | GEOM_CONTAINS | GEOM_DISJOINT2D | GEOM_COVERS | GEOM_TOUCHES | GEOM_INTERSECTS3D | GEOM_DWITHIN3D | GEOM_DISTANCE2D | GEOM_DISTANCE3D; sinkClause: INTO sink (',' sink)*; @@ -758,6 +758,8 @@ TTEXT_INITCAP: 'TTEXT_INITCAP' | 'ttext_initcap'; TEXTCAT_TTEXT_TEXT: 'TEXTCAT_TTEXT_TEXT' | 'textcat_ttext_text'; TEXTCAT_TEXT_TTEXT: 'TEXTCAT_TEXT_TTEXT' | 'textcat_text_ttext'; TEXTCAT_TTEXT_TTEXT: 'TEXTCAT_TTEXT_TTEXT' | 'textcat_ttext_ttext'; +GEOM_LENGTH: 'GEOM_LENGTH' | 'geom_length'; +GEOM_PERIMETER: 'GEOM_PERIMETER' | 'geom_perimeter'; GEOM_INTERSECTS2D: 'GEOM_INTERSECTS2D' | 'geom_intersects2d'; GEOM_DWITHIN2D: 'GEOM_DWITHIN2D' | 'geom_dwithin2d'; GEOM_CONTAINS: 'GEOM_CONTAINS' | 'geom_contains'; diff --git a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp index 70f8755af2..7cbcfdabe7 100644 --- a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp +++ b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp @@ -339,6 +339,8 @@ #include #include #include +#include +#include #include #include #include @@ -8764,6 +8766,22 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont auto arg1 = visit(ctx->functionParam(1)).as(); return LogicalFunction(GeomIntersects2dLogicalFunction(std::move(arg0), std::move(arg1))); } + case AntlrSQLParser::GEOM_LENGTH: { + PRECONDITION(ctx->functionParam().size() == 1, + "GeomLength requires 1 arg but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + return LogicalFunction(GeomLengthLogicalFunction(std::move(arg0))); + } + /* END CODEGEN PARSER GLUE: GEOM_LENGTH */ + case AntlrSQLParser::GEOM_PERIMETER: { + PRECONDITION(ctx->functionParam().size() == 1, + "GeomPerimeter requires 1 arg but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + return LogicalFunction(GeomPerimeterLogicalFunction(std::move(arg0))); + } + /* END CODEGEN PARSER GLUE: GEOM_PERIMETER */ /* END CODEGEN PARSER GLUE: GEOM_INTERSECTS2D */ case AntlrSQLParser::GEOM_DWITHIN2D: { PRECONDITION(ctx->functionParam().size() == 3, From 8dd0e1d72cf32ba0791b331ecb9dad9f3665ea64 Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Sun, 14 Jun 2026 12:24:38 +0200 Subject: [PATCH 49/96] feat(meos): add GEOM_AZIMUTH NES operator (W101) --- .../Meos/GeomAzimuthLogicalFunction.hpp | 52 +++++++++ .../src/Functions/Meos/CMakeLists.txt | 1 + .../Meos/GeomAzimuthLogicalFunction.cpp | 101 ++++++++++++++++++ .../Meos/GeomAzimuthPhysicalFunction.hpp | 34 ++++++ .../src/Functions/Meos/CMakeLists.txt | 1 + .../Meos/GeomAzimuthPhysicalFunction.cpp | 80 ++++++++++++++ nes-sql-parser/AntlrSQL.g4 | 3 +- .../src/AntlrSQLQueryPlanCreator.cpp | 10 ++ 8 files changed, 281 insertions(+), 1 deletion(-) create mode 100644 nes-logical-operators/include/Functions/Meos/GeomAzimuthLogicalFunction.hpp create mode 100644 nes-logical-operators/src/Functions/Meos/GeomAzimuthLogicalFunction.cpp create mode 100644 nes-physical-operators/include/Functions/Meos/GeomAzimuthPhysicalFunction.hpp create mode 100644 nes-physical-operators/src/Functions/Meos/GeomAzimuthPhysicalFunction.cpp diff --git a/nes-logical-operators/include/Functions/Meos/GeomAzimuthLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeomAzimuthLogicalFunction.hpp new file mode 100644 index 0000000000..bf5f526490 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/GeomAzimuthLogicalFunction.hpp @@ -0,0 +1,52 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Static geometry azimuth geom_azimuth: (wkt1:VARCHAR, wkt2:VARCHAR) -> float64 (radians). + * + * Generated from the MEOS function `geom_azimuth`. + * Returns the azimuth angle from the first point to the second, in radians; + * returns 0.0 when the azimuth is undefined (identical points). + */ +class GeomAzimuthLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "GeomAzimuth"; + + GeomAzimuthLogicalFunction(LogicalFunction wkt1, LogicalFunction wkt2); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt index 6797e5790c..2f05cb64c8 100644 --- a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt @@ -290,6 +290,7 @@ add_plugin(TextcatTextTtext LogicalFunction nes-logical-operators TextcatTextTte add_plugin(TextcatTtextTtext LogicalFunction nes-logical-operators TextcatTtextTtextLogicalFunction.cpp) add_plugin(GeomLength LogicalFunction nes-logical-operators GeomLengthLogicalFunction.cpp) add_plugin(GeomPerimeter LogicalFunction nes-logical-operators GeomPerimeterLogicalFunction.cpp) +add_plugin(GeomAzimuth LogicalFunction nes-logical-operators GeomAzimuthLogicalFunction.cpp) add_plugin(GeomIntersects2d LogicalFunction nes-logical-operators GeomIntersects2dLogicalFunction.cpp) add_plugin(GeomDwithin2d LogicalFunction nes-logical-operators GeomDwithin2dLogicalFunction.cpp) add_plugin(GeomContains LogicalFunction nes-logical-operators GeomContainsLogicalFunction.cpp) diff --git a/nes-logical-operators/src/Functions/Meos/GeomAzimuthLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeomAzimuthLogicalFunction.cpp new file mode 100644 index 0000000000..b3d52556c5 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/GeomAzimuthLogicalFunction.cpp @@ -0,0 +1,101 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +GeomAzimuthLogicalFunction::GeomAzimuthLogicalFunction(LogicalFunction wkt1, LogicalFunction wkt2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(2); + parameters.push_back(std::move(wkt1)); + parameters.push_back(std::move(wkt2)); +} + +DataType GeomAzimuthLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction GeomAzimuthLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector GeomAzimuthLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction GeomAzimuthLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 2, "GeomAzimuthLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view GeomAzimuthLogicalFunction::getType() const { return NAME; } + +bool GeomAzimuthLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string GeomAzimuthLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({}, {})", NAME, + parameters[0].explain(verbosity), + parameters[1].explain(verbosity)); +} + +LogicalFunction GeomAzimuthLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(2); + for (const auto& child : parameters) + newChildren.emplace_back(child.withInferredDataType(schema)); + INVARIANT(newChildren[0].getDataType().isType(DataType::Type::VARSIZED), + "wkt1 must be VARSIZED, but was: {}", newChildren[0].getDataType()); + INVARIANT(newChildren[1].getDataType().isType(DataType::Type::VARSIZED), + "wkt2 must be VARSIZED, but was: {}", newChildren[1].getDataType()); + return withChildren(newChildren); +} + +SerializableFunction GeomAzimuthLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeomAzimuthLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 2, + "GeomAzimuthLogicalFunction requires 2 children but got {}", + arguments.children.size()); + return GeomAzimuthLogicalFunction(std::move(arguments.children[0]), + std::move(arguments.children[1])); +} + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeomAzimuthPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeomAzimuthPhysicalFunction.hpp new file mode 100644 index 0000000000..fc38a19987 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/GeomAzimuthPhysicalFunction.hpp @@ -0,0 +1,34 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class GeomAzimuthPhysicalFunction : public PhysicalFunctionConcept { +public: + GeomAzimuthPhysicalFunction(PhysicalFunction wkt1Function, PhysicalFunction wkt2Function); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt index 3c6c8d2539..2d048b3207 100644 --- a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt @@ -289,6 +289,7 @@ add_plugin(TextcatTextTtext PhysicalFunction nes-physical-operators TextcatTextT add_plugin(TextcatTtextTtext PhysicalFunction nes-physical-operators TextcatTtextTtextPhysicalFunction.cpp) add_plugin(GeomLength PhysicalFunction nes-physical-operators GeomLengthPhysicalFunction.cpp) add_plugin(GeomPerimeter PhysicalFunction nes-physical-operators GeomPerimeterPhysicalFunction.cpp) +add_plugin(GeomAzimuth PhysicalFunction nes-physical-operators GeomAzimuthPhysicalFunction.cpp) add_plugin(GeomIntersects2d PhysicalFunction nes-physical-operators GeomIntersects2dPhysicalFunction.cpp) add_plugin(GeomDwithin2d PhysicalFunction nes-physical-operators GeomDwithin2dPhysicalFunction.cpp) add_plugin(GeomContains PhysicalFunction nes-physical-operators GeomContainsPhysicalFunction.cpp) diff --git a/nes-physical-operators/src/Functions/Meos/GeomAzimuthPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeomAzimuthPhysicalFunction.cpp new file mode 100644 index 0000000000..bb301910ba --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/GeomAzimuthPhysicalFunction.cpp @@ -0,0 +1,80 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +GeomAzimuthPhysicalFunction::GeomAzimuthPhysicalFunction(PhysicalFunction wkt1Function, + PhysicalFunction wkt2Function) +{ + paramFns.reserve(2); + paramFns.push_back(std::move(wkt1Function)); + paramFns.push_back(std::move(wkt2Function)); +} + +VarVal GeomAzimuthPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto wkt1 = paramFns[0].execute(record, arena).cast(); + auto wkt2 = paramFns[1].execute(record, arena).cast(); + + const auto result = nautilus::invoke( + +[](const char* w1, uint32_t w1sz, const char* w2, uint32_t w2sz) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string s1(w1, w1sz), s2(w2, w2sz); + GSERIALIZED* gs1 = geom_in(s1.c_str(), -1); + if (!gs1) return 0.0; + GSERIALIZED* gs2 = geom_in(s2.c_str(), -1); + if (!gs2) { free(gs1); return 0.0; } + double azimuth = 0.0; + geom_azimuth(gs1, gs2, &azimuth); + free(gs1); free(gs2); + return azimuth; + } catch (const std::exception&) { return 0.0; } + }, + wkt1, wkt2); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterGeomAzimuthPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 2, + "GeomAzimuthPhysicalFunction requires 2 children but got {}", + arguments.childFunctions.size()); + return GeomAzimuthPhysicalFunction(std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1])); +} + +} // namespace NES diff --git a/nes-sql-parser/AntlrSQL.g4 b/nes-sql-parser/AntlrSQL.g4 index 2671e33d6f..19fc5b0913 100644 --- a/nes-sql-parser/AntlrSQL.g4 +++ b/nes-sql-parser/AntlrSQL.g4 @@ -295,7 +295,7 @@ timeUnit: MS timestampParameter: name=identifier; -functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT | TGE_TTEXT_TEXT | TGE_TEXT_TTEXT | TGT_TTEXT_TEXT | TGT_TEXT_TTEXT | TLE_TTEXT_TEXT | TLE_TEXT_TTEXT | TLT_TTEXT_TEXT | TLT_TEXT_TTEXT | TTEXT_UPPER | TTEXT_LOWER | TTEXT_INITCAP | TEXTCAT_TTEXT_TEXT | TEXTCAT_TEXT_TTEXT | TEXTCAT_TTEXT_TTEXT | GEOM_LENGTH | GEOM_PERIMETER | GEOM_INTERSECTS2D | GEOM_DWITHIN2D | GEOM_CONTAINS | GEOM_DISJOINT2D | GEOM_COVERS | GEOM_TOUCHES | GEOM_INTERSECTS3D | GEOM_DWITHIN3D | GEOM_DISTANCE2D | GEOM_DISTANCE3D; +functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT | TGE_TTEXT_TEXT | TGE_TEXT_TTEXT | TGT_TTEXT_TEXT | TGT_TEXT_TTEXT | TLE_TTEXT_TEXT | TLE_TEXT_TTEXT | TLT_TTEXT_TEXT | TLT_TEXT_TTEXT | TTEXT_UPPER | TTEXT_LOWER | TTEXT_INITCAP | TEXTCAT_TTEXT_TEXT | TEXTCAT_TEXT_TTEXT | TEXTCAT_TTEXT_TTEXT | GEOM_LENGTH | GEOM_PERIMETER | GEOM_AZIMUTH | GEOM_INTERSECTS2D | GEOM_DWITHIN2D | GEOM_CONTAINS | GEOM_DISJOINT2D | GEOM_COVERS | GEOM_TOUCHES | GEOM_INTERSECTS3D | GEOM_DWITHIN3D | GEOM_DISTANCE2D | GEOM_DISTANCE3D; sinkClause: INTO sink (',' sink)*; @@ -760,6 +760,7 @@ TEXTCAT_TEXT_TTEXT: 'TEXTCAT_TEXT_TTEXT' | 'textcat_text_ttext'; TEXTCAT_TTEXT_TTEXT: 'TEXTCAT_TTEXT_TTEXT' | 'textcat_ttext_ttext'; GEOM_LENGTH: 'GEOM_LENGTH' | 'geom_length'; GEOM_PERIMETER: 'GEOM_PERIMETER' | 'geom_perimeter'; +GEOM_AZIMUTH: 'GEOM_AZIMUTH' | 'geom_azimuth'; GEOM_INTERSECTS2D: 'GEOM_INTERSECTS2D' | 'geom_intersects2d'; GEOM_DWITHIN2D: 'GEOM_DWITHIN2D' | 'geom_dwithin2d'; GEOM_CONTAINS: 'GEOM_CONTAINS' | 'geom_contains'; diff --git a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp index 7cbcfdabe7..09ae3962b7 100644 --- a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp +++ b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp @@ -341,6 +341,7 @@ #include #include #include +#include #include #include #include @@ -8782,6 +8783,15 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont return LogicalFunction(GeomPerimeterLogicalFunction(std::move(arg0))); } /* END CODEGEN PARSER GLUE: GEOM_PERIMETER */ + case AntlrSQLParser::GEOM_AZIMUTH: { + PRECONDITION(ctx->functionParam().size() == 2, + "GeomAzimuth requires 2 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + return LogicalFunction(GeomAzimuthLogicalFunction(std::move(arg0), std::move(arg1))); + } + /* END CODEGEN PARSER GLUE: GEOM_AZIMUTH */ /* END CODEGEN PARSER GLUE: GEOM_INTERSECTS2D */ case AntlrSQLParser::GEOM_DWITHIN2D: { PRECONDITION(ctx->functionParam().size() == 3, From 613f0077937235439fb9d41e2649ae993a0f7edb Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Sun, 14 Jun 2026 15:41:07 +0200 Subject: [PATCH 50/96] feat(meos): add GEOG_{AREA,LENGTH,PERIMETER} and GEOM_IS_EMPTY NES operators (W102) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Wire four geographic/geometry scalar operators via the MEOS API: GEOG_AREA, GEOG_LENGTH, GEOG_PERIMETER (geog_area/geog_length/geog_perimeter, use_spheroid=true) and GEOM_IS_EMPTY (geo_is_empty → 0.0/1.0). All take one VARCHAR (WKT) input and return FLOAT64. --- .../Meos/GeogAreaLogicalFunction.hpp | 48 ++++++++++ .../Meos/GeogLengthLogicalFunction.hpp | 48 ++++++++++ .../Meos/GeogPerimeterLogicalFunction.hpp | 48 ++++++++++ .../Meos/GeomIsEmptyLogicalFunction.hpp | 48 ++++++++++ .../src/Functions/Meos/CMakeLists.txt | 4 + .../Meos/GeogAreaLogicalFunction.cpp | 94 +++++++++++++++++++ .../Meos/GeogLengthLogicalFunction.cpp | 94 +++++++++++++++++++ .../Meos/GeogPerimeterLogicalFunction.cpp | 94 +++++++++++++++++++ .../Meos/GeomIsEmptyLogicalFunction.cpp | 94 +++++++++++++++++++ .../Meos/GeogAreaPhysicalFunction.hpp | 34 +++++++ .../Meos/GeogLengthPhysicalFunction.hpp | 34 +++++++ .../Meos/GeogPerimeterPhysicalFunction.hpp | 34 +++++++ .../Meos/GeomIsEmptyPhysicalFunction.hpp | 34 +++++++ .../src/Functions/Meos/CMakeLists.txt | 4 + .../Meos/GeogAreaPhysicalFunction.cpp | 73 ++++++++++++++ .../Meos/GeogLengthPhysicalFunction.cpp | 73 ++++++++++++++ .../Meos/GeogPerimeterPhysicalFunction.cpp | 73 ++++++++++++++ .../Meos/GeomIsEmptyPhysicalFunction.cpp | 73 ++++++++++++++ nes-sql-parser/AntlrSQL.g4 | 6 +- .../src/AntlrSQLQueryPlanCreator.cpp | 36 +++++++ 20 files changed, 1045 insertions(+), 1 deletion(-) create mode 100644 nes-logical-operators/include/Functions/Meos/GeogAreaLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/GeogLengthLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/GeogPerimeterLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/GeomIsEmptyLogicalFunction.hpp create mode 100644 nes-logical-operators/src/Functions/Meos/GeogAreaLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/GeogLengthLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/GeogPerimeterLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/GeomIsEmptyLogicalFunction.cpp create mode 100644 nes-physical-operators/include/Functions/Meos/GeogAreaPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/GeogLengthPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/GeogPerimeterPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/GeomIsEmptyPhysicalFunction.hpp create mode 100644 nes-physical-operators/src/Functions/Meos/GeogAreaPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/GeogLengthPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/GeogPerimeterPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/GeomIsEmptyPhysicalFunction.cpp diff --git a/nes-logical-operators/include/Functions/Meos/GeogAreaLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeogAreaLogicalFunction.hpp new file mode 100644 index 0000000000..86ec6bfcca --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/GeogAreaLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Geographic area (spheroid=true) of the geometry: (wkt:VARCHAR) -> float64. + */ +class GeogAreaLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "GeogArea"; + + explicit GeogAreaLogicalFunction(LogicalFunction wkt1); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/GeogLengthLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeogLengthLogicalFunction.hpp new file mode 100644 index 0000000000..fc6b2daee4 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/GeogLengthLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Geographic length (spheroid=true) of the geometry: (wkt:VARCHAR) -> float64. + */ +class GeogLengthLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "GeogLength"; + + explicit GeogLengthLogicalFunction(LogicalFunction wkt1); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/GeogPerimeterLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeogPerimeterLogicalFunction.hpp new file mode 100644 index 0000000000..d4a77d61cd --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/GeogPerimeterLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Geographic perimeter (spheroid=true) of the geometry: (wkt:VARCHAR) -> float64. + */ +class GeogPerimeterLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "GeogPerimeter"; + + explicit GeogPerimeterLogicalFunction(LogicalFunction wkt1); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/GeomIsEmptyLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeomIsEmptyLogicalFunction.hpp new file mode 100644 index 0000000000..04bd90a2b3 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/GeomIsEmptyLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if the geometry is empty, 0.0 otherwise: (wkt:VARCHAR) -> float64. + */ +class GeomIsEmptyLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "GeomIsEmpty"; + + explicit GeomIsEmptyLogicalFunction(LogicalFunction wkt1); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt index 2f05cb64c8..47c5aa5c9c 100644 --- a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt @@ -291,6 +291,10 @@ add_plugin(TextcatTtextTtext LogicalFunction nes-logical-operators TextcatTtextT add_plugin(GeomLength LogicalFunction nes-logical-operators GeomLengthLogicalFunction.cpp) add_plugin(GeomPerimeter LogicalFunction nes-logical-operators GeomPerimeterLogicalFunction.cpp) add_plugin(GeomAzimuth LogicalFunction nes-logical-operators GeomAzimuthLogicalFunction.cpp) +add_plugin(GeogArea LogicalFunction nes-logical-operators GeogAreaLogicalFunction.cpp) +add_plugin(GeogLength LogicalFunction nes-logical-operators GeogLengthLogicalFunction.cpp) +add_plugin(GeogPerimeter LogicalFunction nes-logical-operators GeogPerimeterLogicalFunction.cpp) +add_plugin(GeomIsEmpty LogicalFunction nes-logical-operators GeomIsEmptyLogicalFunction.cpp) add_plugin(GeomIntersects2d LogicalFunction nes-logical-operators GeomIntersects2dLogicalFunction.cpp) add_plugin(GeomDwithin2d LogicalFunction nes-logical-operators GeomDwithin2dLogicalFunction.cpp) add_plugin(GeomContains LogicalFunction nes-logical-operators GeomContainsLogicalFunction.cpp) diff --git a/nes-logical-operators/src/Functions/Meos/GeogAreaLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeogAreaLogicalFunction.cpp new file mode 100644 index 0000000000..3e0ff84ffb --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/GeogAreaLogicalFunction.cpp @@ -0,0 +1,94 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +GeogAreaLogicalFunction::GeogAreaLogicalFunction(LogicalFunction wkt1) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(1); + parameters.push_back(std::move(wkt1)); +} + +DataType GeogAreaLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction GeogAreaLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector GeogAreaLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction GeogAreaLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 1, "GeogAreaLogicalFunction requires 1 child, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view GeogAreaLogicalFunction::getType() const { return NAME; } + +bool GeogAreaLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string GeogAreaLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction GeogAreaLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(1); + newChildren.emplace_back(parameters[0].withInferredDataType(schema)); + INVARIANT(newChildren[0].getDataType().isType(DataType::Type::VARSIZED), + "wkt1 must be VARSIZED, but was: {}", newChildren[0].getDataType()); + return withChildren(newChildren); +} + +SerializableFunction GeogAreaLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeogAreaLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 1, + "GeogAreaLogicalFunction requires 1 child but got {}", + arguments.children.size()); + return GeogAreaLogicalFunction(std::move(arguments.children[0])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/GeogLengthLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeogLengthLogicalFunction.cpp new file mode 100644 index 0000000000..cda79e46a3 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/GeogLengthLogicalFunction.cpp @@ -0,0 +1,94 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +GeogLengthLogicalFunction::GeogLengthLogicalFunction(LogicalFunction wkt1) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(1); + parameters.push_back(std::move(wkt1)); +} + +DataType GeogLengthLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction GeogLengthLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector GeogLengthLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction GeogLengthLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 1, "GeogLengthLogicalFunction requires 1 child, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view GeogLengthLogicalFunction::getType() const { return NAME; } + +bool GeogLengthLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string GeogLengthLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction GeogLengthLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(1); + newChildren.emplace_back(parameters[0].withInferredDataType(schema)); + INVARIANT(newChildren[0].getDataType().isType(DataType::Type::VARSIZED), + "wkt1 must be VARSIZED, but was: {}", newChildren[0].getDataType()); + return withChildren(newChildren); +} + +SerializableFunction GeogLengthLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeogLengthLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 1, + "GeogLengthLogicalFunction requires 1 child but got {}", + arguments.children.size()); + return GeogLengthLogicalFunction(std::move(arguments.children[0])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/GeogPerimeterLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeogPerimeterLogicalFunction.cpp new file mode 100644 index 0000000000..b31424e807 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/GeogPerimeterLogicalFunction.cpp @@ -0,0 +1,94 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +GeogPerimeterLogicalFunction::GeogPerimeterLogicalFunction(LogicalFunction wkt1) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(1); + parameters.push_back(std::move(wkt1)); +} + +DataType GeogPerimeterLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction GeogPerimeterLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector GeogPerimeterLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction GeogPerimeterLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 1, "GeogPerimeterLogicalFunction requires 1 child, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view GeogPerimeterLogicalFunction::getType() const { return NAME; } + +bool GeogPerimeterLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string GeogPerimeterLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction GeogPerimeterLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(1); + newChildren.emplace_back(parameters[0].withInferredDataType(schema)); + INVARIANT(newChildren[0].getDataType().isType(DataType::Type::VARSIZED), + "wkt1 must be VARSIZED, but was: {}", newChildren[0].getDataType()); + return withChildren(newChildren); +} + +SerializableFunction GeogPerimeterLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeogPerimeterLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 1, + "GeogPerimeterLogicalFunction requires 1 child but got {}", + arguments.children.size()); + return GeogPerimeterLogicalFunction(std::move(arguments.children[0])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/GeomIsEmptyLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeomIsEmptyLogicalFunction.cpp new file mode 100644 index 0000000000..bb4232bbc5 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/GeomIsEmptyLogicalFunction.cpp @@ -0,0 +1,94 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +GeomIsEmptyLogicalFunction::GeomIsEmptyLogicalFunction(LogicalFunction wkt1) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(1); + parameters.push_back(std::move(wkt1)); +} + +DataType GeomIsEmptyLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction GeomIsEmptyLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector GeomIsEmptyLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction GeomIsEmptyLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 1, "GeomIsEmptyLogicalFunction requires 1 child, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view GeomIsEmptyLogicalFunction::getType() const { return NAME; } + +bool GeomIsEmptyLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string GeomIsEmptyLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction GeomIsEmptyLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(1); + newChildren.emplace_back(parameters[0].withInferredDataType(schema)); + INVARIANT(newChildren[0].getDataType().isType(DataType::Type::VARSIZED), + "wkt1 must be VARSIZED, but was: {}", newChildren[0].getDataType()); + return withChildren(newChildren); +} + +SerializableFunction GeomIsEmptyLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeomIsEmptyLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 1, + "GeomIsEmptyLogicalFunction requires 1 child but got {}", + arguments.children.size()); + return GeomIsEmptyLogicalFunction(std::move(arguments.children[0])); +} + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeogAreaPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeogAreaPhysicalFunction.hpp new file mode 100644 index 0000000000..65ffccf01d --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/GeogAreaPhysicalFunction.hpp @@ -0,0 +1,34 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class GeogAreaPhysicalFunction : public PhysicalFunctionConcept { +public: + explicit GeogAreaPhysicalFunction(PhysicalFunction wkt1Function); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeogLengthPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeogLengthPhysicalFunction.hpp new file mode 100644 index 0000000000..281637b5da --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/GeogLengthPhysicalFunction.hpp @@ -0,0 +1,34 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class GeogLengthPhysicalFunction : public PhysicalFunctionConcept { +public: + explicit GeogLengthPhysicalFunction(PhysicalFunction wkt1Function); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeogPerimeterPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeogPerimeterPhysicalFunction.hpp new file mode 100644 index 0000000000..589296f949 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/GeogPerimeterPhysicalFunction.hpp @@ -0,0 +1,34 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class GeogPerimeterPhysicalFunction : public PhysicalFunctionConcept { +public: + explicit GeogPerimeterPhysicalFunction(PhysicalFunction wkt1Function); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeomIsEmptyPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeomIsEmptyPhysicalFunction.hpp new file mode 100644 index 0000000000..c007fb1000 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/GeomIsEmptyPhysicalFunction.hpp @@ -0,0 +1,34 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class GeomIsEmptyPhysicalFunction : public PhysicalFunctionConcept { +public: + explicit GeomIsEmptyPhysicalFunction(PhysicalFunction wkt1Function); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt index 2d048b3207..ee1cd1b7c4 100644 --- a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt @@ -290,6 +290,10 @@ add_plugin(TextcatTtextTtext PhysicalFunction nes-physical-operators TextcatTtex add_plugin(GeomLength PhysicalFunction nes-physical-operators GeomLengthPhysicalFunction.cpp) add_plugin(GeomPerimeter PhysicalFunction nes-physical-operators GeomPerimeterPhysicalFunction.cpp) add_plugin(GeomAzimuth PhysicalFunction nes-physical-operators GeomAzimuthPhysicalFunction.cpp) +add_plugin(GeogArea PhysicalFunction nes-physical-operators GeogAreaPhysicalFunction.cpp) +add_plugin(GeogLength PhysicalFunction nes-physical-operators GeogLengthPhysicalFunction.cpp) +add_plugin(GeogPerimeter PhysicalFunction nes-physical-operators GeogPerimeterPhysicalFunction.cpp) +add_plugin(GeomIsEmpty PhysicalFunction nes-physical-operators GeomIsEmptyPhysicalFunction.cpp) add_plugin(GeomIntersects2d PhysicalFunction nes-physical-operators GeomIntersects2dPhysicalFunction.cpp) add_plugin(GeomDwithin2d PhysicalFunction nes-physical-operators GeomDwithin2dPhysicalFunction.cpp) add_plugin(GeomContains PhysicalFunction nes-physical-operators GeomContainsPhysicalFunction.cpp) diff --git a/nes-physical-operators/src/Functions/Meos/GeogAreaPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeogAreaPhysicalFunction.cpp new file mode 100644 index 0000000000..1d0da3f9a4 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/GeogAreaPhysicalFunction.cpp @@ -0,0 +1,73 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +GeogAreaPhysicalFunction::GeogAreaPhysicalFunction(PhysicalFunction wkt1Function) +{ + paramFns.reserve(1); + paramFns.push_back(std::move(wkt1Function)); +} + +VarVal GeogAreaPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto wkt1 = paramFns[0].execute(record, arena).cast(); + + const auto result = nautilus::invoke( + +[](const char* w1, uint32_t w1sz) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string s1(w1, w1sz); + GSERIALIZED* gs1 = geom_in(s1.c_str(), -1); + if (!gs1) return 0.0; + double r = geog_area(gs1, true); + free(gs1); + return r; + } catch (const std::exception&) { return 0.0; } + }, + wkt1); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterGeogAreaPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 1, + "GeogAreaPhysicalFunction requires 1 child but got {}", + arguments.childFunctions.size()); + return GeogAreaPhysicalFunction(std::move(arguments.childFunctions[0])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/GeogLengthPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeogLengthPhysicalFunction.cpp new file mode 100644 index 0000000000..0e6c8e3e2a --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/GeogLengthPhysicalFunction.cpp @@ -0,0 +1,73 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +GeogLengthPhysicalFunction::GeogLengthPhysicalFunction(PhysicalFunction wkt1Function) +{ + paramFns.reserve(1); + paramFns.push_back(std::move(wkt1Function)); +} + +VarVal GeogLengthPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto wkt1 = paramFns[0].execute(record, arena).cast(); + + const auto result = nautilus::invoke( + +[](const char* w1, uint32_t w1sz) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string s1(w1, w1sz); + GSERIALIZED* gs1 = geom_in(s1.c_str(), -1); + if (!gs1) return 0.0; + double r = geog_length(gs1, true); + free(gs1); + return r; + } catch (const std::exception&) { return 0.0; } + }, + wkt1); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterGeogLengthPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 1, + "GeogLengthPhysicalFunction requires 1 child but got {}", + arguments.childFunctions.size()); + return GeogLengthPhysicalFunction(std::move(arguments.childFunctions[0])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/GeogPerimeterPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeogPerimeterPhysicalFunction.cpp new file mode 100644 index 0000000000..dca1cd8972 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/GeogPerimeterPhysicalFunction.cpp @@ -0,0 +1,73 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +GeogPerimeterPhysicalFunction::GeogPerimeterPhysicalFunction(PhysicalFunction wkt1Function) +{ + paramFns.reserve(1); + paramFns.push_back(std::move(wkt1Function)); +} + +VarVal GeogPerimeterPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto wkt1 = paramFns[0].execute(record, arena).cast(); + + const auto result = nautilus::invoke( + +[](const char* w1, uint32_t w1sz) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string s1(w1, w1sz); + GSERIALIZED* gs1 = geom_in(s1.c_str(), -1); + if (!gs1) return 0.0; + double r = geog_perimeter(gs1, true); + free(gs1); + return r; + } catch (const std::exception&) { return 0.0; } + }, + wkt1); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterGeogPerimeterPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 1, + "GeogPerimeterPhysicalFunction requires 1 child but got {}", + arguments.childFunctions.size()); + return GeogPerimeterPhysicalFunction(std::move(arguments.childFunctions[0])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/GeomIsEmptyPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeomIsEmptyPhysicalFunction.cpp new file mode 100644 index 0000000000..cfca0f65e0 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/GeomIsEmptyPhysicalFunction.cpp @@ -0,0 +1,73 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +GeomIsEmptyPhysicalFunction::GeomIsEmptyPhysicalFunction(PhysicalFunction wkt1Function) +{ + paramFns.reserve(1); + paramFns.push_back(std::move(wkt1Function)); +} + +VarVal GeomIsEmptyPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto wkt1 = paramFns[0].execute(record, arena).cast(); + + const auto result = nautilus::invoke( + +[](const char* w1, uint32_t w1sz) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string s1(w1, w1sz); + GSERIALIZED* gs1 = geom_in(s1.c_str(), -1); + if (!gs1) return 0.0; + double r = geo_is_empty(gs1) ? 1.0 : 0.0; + free(gs1); + return r; + } catch (const std::exception&) { return 0.0; } + }, + wkt1); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterGeomIsEmptyPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 1, + "GeomIsEmptyPhysicalFunction requires 1 child but got {}", + arguments.childFunctions.size()); + return GeomIsEmptyPhysicalFunction(std::move(arguments.childFunctions[0])); +} + +} // namespace NES diff --git a/nes-sql-parser/AntlrSQL.g4 b/nes-sql-parser/AntlrSQL.g4 index 19fc5b0913..ded03b8e29 100644 --- a/nes-sql-parser/AntlrSQL.g4 +++ b/nes-sql-parser/AntlrSQL.g4 @@ -295,7 +295,7 @@ timeUnit: MS timestampParameter: name=identifier; -functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT | TGE_TTEXT_TEXT | TGE_TEXT_TTEXT | TGT_TTEXT_TEXT | TGT_TEXT_TTEXT | TLE_TTEXT_TEXT | TLE_TEXT_TTEXT | TLT_TTEXT_TEXT | TLT_TEXT_TTEXT | TTEXT_UPPER | TTEXT_LOWER | TTEXT_INITCAP | TEXTCAT_TTEXT_TEXT | TEXTCAT_TEXT_TTEXT | TEXTCAT_TTEXT_TTEXT | GEOM_LENGTH | GEOM_PERIMETER | GEOM_AZIMUTH | GEOM_INTERSECTS2D | GEOM_DWITHIN2D | GEOM_CONTAINS | GEOM_DISJOINT2D | GEOM_COVERS | GEOM_TOUCHES | GEOM_INTERSECTS3D | GEOM_DWITHIN3D | GEOM_DISTANCE2D | GEOM_DISTANCE3D; +functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT | TGE_TTEXT_TEXT | TGE_TEXT_TTEXT | TGT_TTEXT_TEXT | TGT_TEXT_TTEXT | TLE_TTEXT_TEXT | TLE_TEXT_TTEXT | TLT_TTEXT_TEXT | TLT_TEXT_TTEXT | TTEXT_UPPER | TTEXT_LOWER | TTEXT_INITCAP | TEXTCAT_TTEXT_TEXT | TEXTCAT_TEXT_TTEXT | TEXTCAT_TTEXT_TTEXT | GEOM_LENGTH | GEOM_PERIMETER | GEOM_AZIMUTH | GEOG_AREA | GEOG_LENGTH | GEOG_PERIMETER | GEOM_IS_EMPTY | GEOM_INTERSECTS2D | GEOM_DWITHIN2D | GEOM_CONTAINS | GEOM_DISJOINT2D | GEOM_COVERS | GEOM_TOUCHES | GEOM_INTERSECTS3D | GEOM_DWITHIN3D | GEOM_DISTANCE2D | GEOM_DISTANCE3D; sinkClause: INTO sink (',' sink)*; @@ -761,6 +761,10 @@ TEXTCAT_TTEXT_TTEXT: 'TEXTCAT_TTEXT_TTEXT' | 'textcat_ttext_ttext'; GEOM_LENGTH: 'GEOM_LENGTH' | 'geom_length'; GEOM_PERIMETER: 'GEOM_PERIMETER' | 'geom_perimeter'; GEOM_AZIMUTH: 'GEOM_AZIMUTH' | 'geom_azimuth'; +GEOG_AREA: 'GEOG_AREA' | 'geog_area'; +GEOG_LENGTH: 'GEOG_LENGTH' | 'geog_length'; +GEOG_PERIMETER: 'GEOG_PERIMETER' | 'geog_perimeter'; +GEOM_IS_EMPTY: 'GEOM_IS_EMPTY' | 'geo_is_empty'; GEOM_INTERSECTS2D: 'GEOM_INTERSECTS2D' | 'geom_intersects2d'; GEOM_DWITHIN2D: 'GEOM_DWITHIN2D' | 'geom_dwithin2d'; GEOM_CONTAINS: 'GEOM_CONTAINS' | 'geom_contains'; diff --git a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp index 09ae3962b7..2a9534df5b 100644 --- a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp +++ b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp @@ -342,6 +342,10 @@ #include #include #include +#include +#include +#include +#include #include #include #include @@ -8792,6 +8796,38 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont return LogicalFunction(GeomAzimuthLogicalFunction(std::move(arg0), std::move(arg1))); } /* END CODEGEN PARSER GLUE: GEOM_AZIMUTH */ + case AntlrSQLParser::GEOG_AREA: { + PRECONDITION(ctx->functionParam().size() == 1, + "GeogArea requires 1 arg but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + return LogicalFunction(GeogAreaLogicalFunction(std::move(arg0))); + } + /* END CODEGEN PARSER GLUE: GEOG_AREA */ + case AntlrSQLParser::GEOG_LENGTH: { + PRECONDITION(ctx->functionParam().size() == 1, + "GeogLength requires 1 arg but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + return LogicalFunction(GeogLengthLogicalFunction(std::move(arg0))); + } + /* END CODEGEN PARSER GLUE: GEOG_LENGTH */ + case AntlrSQLParser::GEOG_PERIMETER: { + PRECONDITION(ctx->functionParam().size() == 1, + "GeogPerimeter requires 1 arg but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + return LogicalFunction(GeogPerimeterLogicalFunction(std::move(arg0))); + } + /* END CODEGEN PARSER GLUE: GEOG_PERIMETER */ + case AntlrSQLParser::GEOM_IS_EMPTY: { + PRECONDITION(ctx->functionParam().size() == 1, + "GeomIsEmpty requires 1 arg but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + return LogicalFunction(GeomIsEmptyLogicalFunction(std::move(arg0))); + } + /* END CODEGEN PARSER GLUE: GEOM_IS_EMPTY */ /* END CODEGEN PARSER GLUE: GEOM_INTERSECTS2D */ case AntlrSQLParser::GEOM_DWITHIN2D: { PRECONDITION(ctx->functionParam().size() == 3, From 4ae391f8a84e1aa1be59f0cb0cd5e80c3d51f643 Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Sun, 14 Jun 2026 15:42:49 +0200 Subject: [PATCH 51/96] feat(meos): add AINTERSECTS/ACOVERS/ADISJOINT/ADWITHIN_TGEO_GEO NES operators (W103) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Wire the always-* temporal tgeo predicate family: AINTERSECTS_TGEO_GEO, ACOVERS_TGEO_GEO, ADISJOINT_TGEO_GEO (4-arg: lon, lat, ts, wkt → FLOAT64) and ADWITHIN_TGEO_GEO (5-arg: lon, lat, ts, wkt, dist → FLOAT64). Complements the ever-* family (EDWITHIN_TGEO_GEO, ECOVERS_TGEO_GEO, EDISJOINT_TGEO_GEO). --- .../Meos/AcoversTgeoGeoLogicalFunction.hpp | 51 ++++++++ .../Meos/AdisjointTgeoGeoLogicalFunction.hpp | 51 ++++++++ .../Meos/AdwithinTgeoGeoLogicalFunction.hpp | 52 ++++++++ .../AintersectsTgeoGeoLogicalFunction.hpp | 51 ++++++++ .../Meos/AcoversTgeoGeoLogicalFunction.cpp | 107 +++++++++++++++++ .../Meos/AdisjointTgeoGeoLogicalFunction.cpp | 107 +++++++++++++++++ .../Meos/AdwithinTgeoGeoLogicalFunction.cpp | 112 ++++++++++++++++++ .../AintersectsTgeoGeoLogicalFunction.cpp | 107 +++++++++++++++++ .../src/Functions/Meos/CMakeLists.txt | 4 + .../Meos/AcoversTgeoGeoPhysicalFunction.hpp | 35 ++++++ .../Meos/AdisjointTgeoGeoPhysicalFunction.hpp | 35 ++++++ .../Meos/AdwithinTgeoGeoPhysicalFunction.hpp | 36 ++++++ .../AintersectsTgeoGeoPhysicalFunction.hpp | 35 ++++++ .../Meos/AcoversTgeoGeoPhysicalFunction.cpp | 87 ++++++++++++++ .../Meos/AdisjointTgeoGeoPhysicalFunction.cpp | 87 ++++++++++++++ .../Meos/AdwithinTgeoGeoPhysicalFunction.cpp | 91 ++++++++++++++ .../AintersectsTgeoGeoPhysicalFunction.cpp | 87 ++++++++++++++ .../src/Functions/Meos/CMakeLists.txt | 4 + nes-sql-parser/AntlrSQL.g4 | 6 +- .../src/AntlrSQLQueryPlanCreator.cpp | 49 ++++++++ 20 files changed, 1193 insertions(+), 1 deletion(-) create mode 100644 nes-logical-operators/include/Functions/Meos/AcoversTgeoGeoLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AdisjointTgeoGeoLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AdwithinTgeoGeoLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AintersectsTgeoGeoLogicalFunction.hpp create mode 100644 nes-logical-operators/src/Functions/Meos/AcoversTgeoGeoLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AdisjointTgeoGeoLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AdwithinTgeoGeoLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AintersectsTgeoGeoLogicalFunction.cpp create mode 100644 nes-physical-operators/include/Functions/Meos/AcoversTgeoGeoPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AdisjointTgeoGeoPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AdwithinTgeoGeoPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AintersectsTgeoGeoPhysicalFunction.hpp create mode 100644 nes-physical-operators/src/Functions/Meos/AcoversTgeoGeoPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AdisjointTgeoGeoPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AdwithinTgeoGeoPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AintersectsTgeoGeoPhysicalFunction.cpp diff --git a/nes-logical-operators/include/Functions/Meos/AcoversTgeoGeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AcoversTgeoGeoLogicalFunction.hpp new file mode 100644 index 0000000000..c5c7e6823a --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AcoversTgeoGeoLogicalFunction.hpp @@ -0,0 +1,51 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if temporal geometry always covers the static geometry. + * + * Args: (lon:FLOAT64, lat:FLOAT64, ts:UINT64, wkt:VARCHAR) -> FLOAT64. + */ +class AcoversTgeoGeoLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AcoversTgeoGeo"; + + AcoversTgeoGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, + LogicalFunction ts, LogicalFunction wkt); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AdisjointTgeoGeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AdisjointTgeoGeoLogicalFunction.hpp new file mode 100644 index 0000000000..31d5c93624 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AdisjointTgeoGeoLogicalFunction.hpp @@ -0,0 +1,51 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if temporal geometry is always disjoint from the static geometry. + * + * Args: (lon:FLOAT64, lat:FLOAT64, ts:UINT64, wkt:VARCHAR) -> FLOAT64. + */ +class AdisjointTgeoGeoLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AdisjointTgeoGeo"; + + AdisjointTgeoGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, + LogicalFunction ts, LogicalFunction wkt); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AdwithinTgeoGeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AdwithinTgeoGeoLogicalFunction.hpp new file mode 100644 index 0000000000..6c8088920f --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AdwithinTgeoGeoLogicalFunction.hpp @@ -0,0 +1,52 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if temporal geometry is always within dist of the static geometry. + * + * Args: (lon:FLOAT64, lat:FLOAT64, ts:UINT64, wkt:VARCHAR, dist:FLOAT64) -> FLOAT64. + */ +class AdwithinTgeoGeoLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AdwithinTgeoGeo"; + + AdwithinTgeoGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, + LogicalFunction ts, LogicalFunction wkt, + LogicalFunction dist); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AintersectsTgeoGeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AintersectsTgeoGeoLogicalFunction.hpp new file mode 100644 index 0000000000..8223b2e12d --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AintersectsTgeoGeoLogicalFunction.hpp @@ -0,0 +1,51 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if temporal geometry always intersects the static geometry. + * + * Args: (lon:FLOAT64, lat:FLOAT64, ts:UINT64, wkt:VARCHAR) -> FLOAT64. + */ +class AintersectsTgeoGeoLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AintersectsTgeoGeo"; + + AintersectsTgeoGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, + LogicalFunction ts, LogicalFunction wkt); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AcoversTgeoGeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AcoversTgeoGeoLogicalFunction.cpp new file mode 100644 index 0000000000..38f41209dc --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AcoversTgeoGeoLogicalFunction.cpp @@ -0,0 +1,107 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AcoversTgeoGeoLogicalFunction::AcoversTgeoGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, + LogicalFunction ts, LogicalFunction wkt) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(4); + parameters.push_back(std::move(lon)); + parameters.push_back(std::move(lat)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(wkt)); +} + +DataType AcoversTgeoGeoLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AcoversTgeoGeoLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AcoversTgeoGeoLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AcoversTgeoGeoLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 4, + "AcoversTgeoGeoLogicalFunction requires 4 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AcoversTgeoGeoLogicalFunction::getType() const { return NAME; } + +bool AcoversTgeoGeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AcoversTgeoGeoLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction AcoversTgeoGeoLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(4); + c.emplace_back(parameters[0].withInferredDataType(schema)); + c.emplace_back(parameters[1].withInferredDataType(schema)); + c.emplace_back(parameters[2].withInferredDataType(schema)); + c.emplace_back(parameters[3].withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon must be FLOAT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::VARSIZED),"wkt must be VARSIZED"); + return withChildren(c); +} + +SerializableFunction AcoversTgeoGeoLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAcoversTgeoGeoLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 4, + "AcoversTgeoGeoLogicalFunction requires 4 children but got {}", + arguments.children.size()); + return AcoversTgeoGeoLogicalFunction(std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AdisjointTgeoGeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AdisjointTgeoGeoLogicalFunction.cpp new file mode 100644 index 0000000000..d3f1b190ea --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AdisjointTgeoGeoLogicalFunction.cpp @@ -0,0 +1,107 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AdisjointTgeoGeoLogicalFunction::AdisjointTgeoGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, + LogicalFunction ts, LogicalFunction wkt) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(4); + parameters.push_back(std::move(lon)); + parameters.push_back(std::move(lat)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(wkt)); +} + +DataType AdisjointTgeoGeoLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AdisjointTgeoGeoLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AdisjointTgeoGeoLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AdisjointTgeoGeoLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 4, + "AdisjointTgeoGeoLogicalFunction requires 4 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AdisjointTgeoGeoLogicalFunction::getType() const { return NAME; } + +bool AdisjointTgeoGeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AdisjointTgeoGeoLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction AdisjointTgeoGeoLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(4); + c.emplace_back(parameters[0].withInferredDataType(schema)); + c.emplace_back(parameters[1].withInferredDataType(schema)); + c.emplace_back(parameters[2].withInferredDataType(schema)); + c.emplace_back(parameters[3].withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon must be FLOAT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::VARSIZED),"wkt must be VARSIZED"); + return withChildren(c); +} + +SerializableFunction AdisjointTgeoGeoLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAdisjointTgeoGeoLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 4, + "AdisjointTgeoGeoLogicalFunction requires 4 children but got {}", + arguments.children.size()); + return AdisjointTgeoGeoLogicalFunction(std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AdwithinTgeoGeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AdwithinTgeoGeoLogicalFunction.cpp new file mode 100644 index 0000000000..2dfe964aa3 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AdwithinTgeoGeoLogicalFunction.cpp @@ -0,0 +1,112 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AdwithinTgeoGeoLogicalFunction::AdwithinTgeoGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, + LogicalFunction ts, LogicalFunction wkt, + LogicalFunction dist) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(5); + parameters.push_back(std::move(lon)); + parameters.push_back(std::move(lat)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(wkt)); + parameters.push_back(std::move(dist)); +} + +DataType AdwithinTgeoGeoLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AdwithinTgeoGeoLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AdwithinTgeoGeoLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AdwithinTgeoGeoLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 5, + "AdwithinTgeoGeoLogicalFunction requires 5 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AdwithinTgeoGeoLogicalFunction::getType() const { return NAME; } + +bool AdwithinTgeoGeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AdwithinTgeoGeoLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction AdwithinTgeoGeoLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(5); + c.emplace_back(parameters[0].withInferredDataType(schema)); + c.emplace_back(parameters[1].withInferredDataType(schema)); + c.emplace_back(parameters[2].withInferredDataType(schema)); + c.emplace_back(parameters[3].withInferredDataType(schema)); + c.emplace_back(parameters[4].withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon must be FLOAT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::VARSIZED),"wkt must be VARSIZED"); + INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "dist must be FLOAT64"); + return withChildren(c); +} + +SerializableFunction AdwithinTgeoGeoLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAdwithinTgeoGeoLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 5, + "AdwithinTgeoGeoLogicalFunction requires 5 children but got {}", + arguments.children.size()); + return AdwithinTgeoGeoLogicalFunction(std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AintersectsTgeoGeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AintersectsTgeoGeoLogicalFunction.cpp new file mode 100644 index 0000000000..7e1c1f035e --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AintersectsTgeoGeoLogicalFunction.cpp @@ -0,0 +1,107 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AintersectsTgeoGeoLogicalFunction::AintersectsTgeoGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, + LogicalFunction ts, LogicalFunction wkt) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(4); + parameters.push_back(std::move(lon)); + parameters.push_back(std::move(lat)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(wkt)); +} + +DataType AintersectsTgeoGeoLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AintersectsTgeoGeoLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AintersectsTgeoGeoLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AintersectsTgeoGeoLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 4, + "AintersectsTgeoGeoLogicalFunction requires 4 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AintersectsTgeoGeoLogicalFunction::getType() const { return NAME; } + +bool AintersectsTgeoGeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AintersectsTgeoGeoLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction AintersectsTgeoGeoLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(4); + c.emplace_back(parameters[0].withInferredDataType(schema)); + c.emplace_back(parameters[1].withInferredDataType(schema)); + c.emplace_back(parameters[2].withInferredDataType(schema)); + c.emplace_back(parameters[3].withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon must be FLOAT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::VARSIZED),"wkt must be VARSIZED"); + return withChildren(c); +} + +SerializableFunction AintersectsTgeoGeoLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAintersectsTgeoGeoLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 4, + "AintersectsTgeoGeoLogicalFunction requires 4 children but got {}", + arguments.children.size()); + return AintersectsTgeoGeoLogicalFunction(std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt index 47c5aa5c9c..3cffeec43f 100644 --- a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt @@ -295,6 +295,10 @@ add_plugin(GeogArea LogicalFunction nes-logical-operators GeogAreaLogicalFunctio add_plugin(GeogLength LogicalFunction nes-logical-operators GeogLengthLogicalFunction.cpp) add_plugin(GeogPerimeter LogicalFunction nes-logical-operators GeogPerimeterLogicalFunction.cpp) add_plugin(GeomIsEmpty LogicalFunction nes-logical-operators GeomIsEmptyLogicalFunction.cpp) +add_plugin(AintersectsTgeoGeo LogicalFunction nes-logical-operators AintersectsTgeoGeoLogicalFunction.cpp) +add_plugin(AcoversTgeoGeo LogicalFunction nes-logical-operators AcoversTgeoGeoLogicalFunction.cpp) +add_plugin(AdisjointTgeoGeo LogicalFunction nes-logical-operators AdisjointTgeoGeoLogicalFunction.cpp) +add_plugin(AdwithinTgeoGeo LogicalFunction nes-logical-operators AdwithinTgeoGeoLogicalFunction.cpp) add_plugin(GeomIntersects2d LogicalFunction nes-logical-operators GeomIntersects2dLogicalFunction.cpp) add_plugin(GeomDwithin2d LogicalFunction nes-logical-operators GeomDwithin2dLogicalFunction.cpp) add_plugin(GeomContains LogicalFunction nes-logical-operators GeomContainsLogicalFunction.cpp) diff --git a/nes-physical-operators/include/Functions/Meos/AcoversTgeoGeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AcoversTgeoGeoPhysicalFunction.hpp new file mode 100644 index 0000000000..b98adc08e9 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AcoversTgeoGeoPhysicalFunction.hpp @@ -0,0 +1,35 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class AcoversTgeoGeoPhysicalFunction : public PhysicalFunctionConcept { +public: + AcoversTgeoGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, + PhysicalFunction ts, PhysicalFunction wkt); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AdisjointTgeoGeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AdisjointTgeoGeoPhysicalFunction.hpp new file mode 100644 index 0000000000..645e98dc41 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AdisjointTgeoGeoPhysicalFunction.hpp @@ -0,0 +1,35 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class AdisjointTgeoGeoPhysicalFunction : public PhysicalFunctionConcept { +public: + AdisjointTgeoGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, + PhysicalFunction ts, PhysicalFunction wkt); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AdwithinTgeoGeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AdwithinTgeoGeoPhysicalFunction.hpp new file mode 100644 index 0000000000..141a31d9ab --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AdwithinTgeoGeoPhysicalFunction.hpp @@ -0,0 +1,36 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class AdwithinTgeoGeoPhysicalFunction : public PhysicalFunctionConcept { +public: + AdwithinTgeoGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, + PhysicalFunction ts, PhysicalFunction wkt, + PhysicalFunction dist); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AintersectsTgeoGeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AintersectsTgeoGeoPhysicalFunction.hpp new file mode 100644 index 0000000000..4ececd4f99 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AintersectsTgeoGeoPhysicalFunction.hpp @@ -0,0 +1,35 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class AintersectsTgeoGeoPhysicalFunction : public PhysicalFunctionConcept { +public: + AintersectsTgeoGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, + PhysicalFunction ts, PhysicalFunction wkt); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AcoversTgeoGeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AcoversTgeoGeoPhysicalFunction.cpp new file mode 100644 index 0000000000..2ed4f96b36 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AcoversTgeoGeoPhysicalFunction.cpp @@ -0,0 +1,87 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +AcoversTgeoGeoPhysicalFunction::AcoversTgeoGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, + PhysicalFunction ts, PhysicalFunction wkt) +{ + paramFns.reserve(4); + paramFns.push_back(std::move(lon)); + paramFns.push_back(std::move(lat)); + paramFns.push_back(std::move(ts)); + paramFns.push_back(std::move(wkt)); +} + +VarVal AcoversTgeoGeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto lon = paramFns[0].execute(record, arena).cast(); + auto lat = paramFns[1].execute(record, arena).cast(); + auto ts = paramFns[2].execute(record, arena).cast(); + auto wkt = paramFns[3].execute(record, arena).cast(); + + const auto result = nautilus::invoke( + +[](double lon, double lat, uint64_t ts, + const char* w, uint32_t wsz) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string wktStr(w, wsz); + std::string tgeoWkt = fmt::format("SRID=4326;POINT({},{})@{}", lon, lat, ts); + Temporal* tgeo = tgeompoint_in(tgeoWkt.c_str()); + if (!tgeo) return 0.0; + GSERIALIZED* gs = geom_in(wktStr.c_str(), -1); + if (!gs) { free(tgeo); return 0.0; } + int r = acovers_tgeo_geo(tgeo, gs); + free(tgeo); free(gs); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + lon, lat, ts, wkt); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAcoversTgeoGeoPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 4, + "AcoversTgeoGeoPhysicalFunction requires 4 children but got {}", + arguments.childFunctions.size()); + return AcoversTgeoGeoPhysicalFunction(std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AdisjointTgeoGeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AdisjointTgeoGeoPhysicalFunction.cpp new file mode 100644 index 0000000000..0f63cbf5d2 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AdisjointTgeoGeoPhysicalFunction.cpp @@ -0,0 +1,87 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +AdisjointTgeoGeoPhysicalFunction::AdisjointTgeoGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, + PhysicalFunction ts, PhysicalFunction wkt) +{ + paramFns.reserve(4); + paramFns.push_back(std::move(lon)); + paramFns.push_back(std::move(lat)); + paramFns.push_back(std::move(ts)); + paramFns.push_back(std::move(wkt)); +} + +VarVal AdisjointTgeoGeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto lon = paramFns[0].execute(record, arena).cast(); + auto lat = paramFns[1].execute(record, arena).cast(); + auto ts = paramFns[2].execute(record, arena).cast(); + auto wkt = paramFns[3].execute(record, arena).cast(); + + const auto result = nautilus::invoke( + +[](double lon, double lat, uint64_t ts, + const char* w, uint32_t wsz) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string wktStr(w, wsz); + std::string tgeoWkt = fmt::format("SRID=4326;POINT({},{})@{}", lon, lat, ts); + Temporal* tgeo = tgeompoint_in(tgeoWkt.c_str()); + if (!tgeo) return 0.0; + GSERIALIZED* gs = geom_in(wktStr.c_str(), -1); + if (!gs) { free(tgeo); return 0.0; } + int r = adisjoint_tgeo_geo(tgeo, gs); + free(tgeo); free(gs); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + lon, lat, ts, wkt); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAdisjointTgeoGeoPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 4, + "AdisjointTgeoGeoPhysicalFunction requires 4 children but got {}", + arguments.childFunctions.size()); + return AdisjointTgeoGeoPhysicalFunction(std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AdwithinTgeoGeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AdwithinTgeoGeoPhysicalFunction.cpp new file mode 100644 index 0000000000..f46ab72996 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AdwithinTgeoGeoPhysicalFunction.cpp @@ -0,0 +1,91 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +AdwithinTgeoGeoPhysicalFunction::AdwithinTgeoGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, + PhysicalFunction ts, PhysicalFunction wkt, + PhysicalFunction dist) +{ + paramFns.reserve(5); + paramFns.push_back(std::move(lon)); + paramFns.push_back(std::move(lat)); + paramFns.push_back(std::move(ts)); + paramFns.push_back(std::move(wkt)); + paramFns.push_back(std::move(dist)); +} + +VarVal AdwithinTgeoGeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto lon = paramFns[0].execute(record, arena).cast(); + auto lat = paramFns[1].execute(record, arena).cast(); + auto ts = paramFns[2].execute(record, arena).cast(); + auto wkt = paramFns[3].execute(record, arena).cast(); + auto dist = paramFns[4].execute(record, arena).cast(); + + const auto result = nautilus::invoke( + +[](double lon, double lat, uint64_t ts, + const char* w, uint32_t wsz, double dist) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string wktStr(w, wsz); + std::string tgeoWkt = fmt::format("SRID=4326;POINT({},{})@{}", lon, lat, ts); + Temporal* tgeo = tgeompoint_in(tgeoWkt.c_str()); + if (!tgeo) return 0.0; + GSERIALIZED* gs = geom_in(wktStr.c_str(), -1); + if (!gs) { free(tgeo); return 0.0; } + int r = adwithin_tgeo_geo(tgeo, gs, dist); + free(tgeo); free(gs); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + lon, lat, ts, wkt, dist); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAdwithinTgeoGeoPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 5, + "AdwithinTgeoGeoPhysicalFunction requires 5 children but got {}", + arguments.childFunctions.size()); + return AdwithinTgeoGeoPhysicalFunction(std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AintersectsTgeoGeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AintersectsTgeoGeoPhysicalFunction.cpp new file mode 100644 index 0000000000..df6f10ca10 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AintersectsTgeoGeoPhysicalFunction.cpp @@ -0,0 +1,87 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +AintersectsTgeoGeoPhysicalFunction::AintersectsTgeoGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, + PhysicalFunction ts, PhysicalFunction wkt) +{ + paramFns.reserve(4); + paramFns.push_back(std::move(lon)); + paramFns.push_back(std::move(lat)); + paramFns.push_back(std::move(ts)); + paramFns.push_back(std::move(wkt)); +} + +VarVal AintersectsTgeoGeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto lon = paramFns[0].execute(record, arena).cast(); + auto lat = paramFns[1].execute(record, arena).cast(); + auto ts = paramFns[2].execute(record, arena).cast(); + auto wkt = paramFns[3].execute(record, arena).cast(); + + const auto result = nautilus::invoke( + +[](double lon, double lat, uint64_t ts, + const char* w, uint32_t wsz) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string wktStr(w, wsz); + std::string tgeoWkt = fmt::format("SRID=4326;POINT({},{})@{}", lon, lat, ts); + Temporal* tgeo = tgeompoint_in(tgeoWkt.c_str()); + if (!tgeo) return 0.0; + GSERIALIZED* gs = geom_in(wktStr.c_str(), -1); + if (!gs) { free(tgeo); return 0.0; } + int r = aintersects_tgeo_geo(tgeo, gs); + free(tgeo); free(gs); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + lon, lat, ts, wkt); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAintersectsTgeoGeoPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 4, + "AintersectsTgeoGeoPhysicalFunction requires 4 children but got {}", + arguments.childFunctions.size()); + return AintersectsTgeoGeoPhysicalFunction(std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt index ee1cd1b7c4..c64f1e8f7e 100644 --- a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt @@ -294,6 +294,10 @@ add_plugin(GeogArea PhysicalFunction nes-physical-operators GeogAreaPhysicalFunc add_plugin(GeogLength PhysicalFunction nes-physical-operators GeogLengthPhysicalFunction.cpp) add_plugin(GeogPerimeter PhysicalFunction nes-physical-operators GeogPerimeterPhysicalFunction.cpp) add_plugin(GeomIsEmpty PhysicalFunction nes-physical-operators GeomIsEmptyPhysicalFunction.cpp) +add_plugin(AintersectsTgeoGeo PhysicalFunction nes-physical-operators AintersectsTgeoGeoPhysicalFunction.cpp) +add_plugin(AcoversTgeoGeo PhysicalFunction nes-physical-operators AcoversTgeoGeoPhysicalFunction.cpp) +add_plugin(AdisjointTgeoGeo PhysicalFunction nes-physical-operators AdisjointTgeoGeoPhysicalFunction.cpp) +add_plugin(AdwithinTgeoGeo PhysicalFunction nes-physical-operators AdwithinTgeoGeoPhysicalFunction.cpp) add_plugin(GeomIntersects2d PhysicalFunction nes-physical-operators GeomIntersects2dPhysicalFunction.cpp) add_plugin(GeomDwithin2d PhysicalFunction nes-physical-operators GeomDwithin2dPhysicalFunction.cpp) add_plugin(GeomContains PhysicalFunction nes-physical-operators GeomContainsPhysicalFunction.cpp) diff --git a/nes-sql-parser/AntlrSQL.g4 b/nes-sql-parser/AntlrSQL.g4 index ded03b8e29..ef432428da 100644 --- a/nes-sql-parser/AntlrSQL.g4 +++ b/nes-sql-parser/AntlrSQL.g4 @@ -295,7 +295,7 @@ timeUnit: MS timestampParameter: name=identifier; -functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT | TGE_TTEXT_TEXT | TGE_TEXT_TTEXT | TGT_TTEXT_TEXT | TGT_TEXT_TTEXT | TLE_TTEXT_TEXT | TLE_TEXT_TTEXT | TLT_TTEXT_TEXT | TLT_TEXT_TTEXT | TTEXT_UPPER | TTEXT_LOWER | TTEXT_INITCAP | TEXTCAT_TTEXT_TEXT | TEXTCAT_TEXT_TTEXT | TEXTCAT_TTEXT_TTEXT | GEOM_LENGTH | GEOM_PERIMETER | GEOM_AZIMUTH | GEOG_AREA | GEOG_LENGTH | GEOG_PERIMETER | GEOM_IS_EMPTY | GEOM_INTERSECTS2D | GEOM_DWITHIN2D | GEOM_CONTAINS | GEOM_DISJOINT2D | GEOM_COVERS | GEOM_TOUCHES | GEOM_INTERSECTS3D | GEOM_DWITHIN3D | GEOM_DISTANCE2D | GEOM_DISTANCE3D; +functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT | TGE_TTEXT_TEXT | TGE_TEXT_TTEXT | TGT_TTEXT_TEXT | TGT_TEXT_TTEXT | TLE_TTEXT_TEXT | TLE_TEXT_TTEXT | TLT_TTEXT_TEXT | TLT_TEXT_TTEXT | TTEXT_UPPER | TTEXT_LOWER | TTEXT_INITCAP | TEXTCAT_TTEXT_TEXT | TEXTCAT_TEXT_TTEXT | TEXTCAT_TTEXT_TTEXT | GEOM_LENGTH | GEOM_PERIMETER | GEOM_AZIMUTH | GEOG_AREA | GEOG_LENGTH | GEOG_PERIMETER | GEOM_IS_EMPTY | AINTERSECTS_TGEO_GEO | ACOVERS_TGEO_GEO | ADISJOINT_TGEO_GEO | ADWITHIN_TGEO_GEO | GEOM_INTERSECTS2D | GEOM_DWITHIN2D | GEOM_CONTAINS | GEOM_DISJOINT2D | GEOM_COVERS | GEOM_TOUCHES | GEOM_INTERSECTS3D | GEOM_DWITHIN3D | GEOM_DISTANCE2D | GEOM_DISTANCE3D; sinkClause: INTO sink (',' sink)*; @@ -765,6 +765,10 @@ GEOG_AREA: 'GEOG_AREA' | 'geog_area'; GEOG_LENGTH: 'GEOG_LENGTH' | 'geog_length'; GEOG_PERIMETER: 'GEOG_PERIMETER' | 'geog_perimeter'; GEOM_IS_EMPTY: 'GEOM_IS_EMPTY' | 'geo_is_empty'; +AINTERSECTS_TGEO_GEO: 'AINTERSECTS_TGEO_GEO' | 'aintersects_tgeo_geo'; +ACOVERS_TGEO_GEO: 'ACOVERS_TGEO_GEO' | 'acovers_tgeo_geo'; +ADISJOINT_TGEO_GEO: 'ADISJOINT_TGEO_GEO' | 'adisjoint_tgeo_geo'; +ADWITHIN_TGEO_GEO: 'ADWITHIN_TGEO_GEO' | 'adwithin_tgeo_geo'; GEOM_INTERSECTS2D: 'GEOM_INTERSECTS2D' | 'geom_intersects2d'; GEOM_DWITHIN2D: 'GEOM_DWITHIN2D' | 'geom_dwithin2d'; GEOM_CONTAINS: 'GEOM_CONTAINS' | 'geom_contains'; diff --git a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp index 2a9534df5b..3960df030f 100644 --- a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp +++ b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp @@ -346,6 +346,10 @@ #include #include #include +#include +#include +#include +#include #include #include #include @@ -8828,6 +8832,51 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont return LogicalFunction(GeomIsEmptyLogicalFunction(std::move(arg0))); } /* END CODEGEN PARSER GLUE: GEOM_IS_EMPTY */ + case AntlrSQLParser::AINTERSECTS_TGEO_GEO: { + PRECONDITION(ctx->functionParam().size() == 4, + "AintersectsTgeoGeo requires 4 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + return LogicalFunction(AintersectsTgeoGeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3))); + } + /* END CODEGEN PARSER GLUE: AINTERSECTS_TGEO_GEO */ + case AntlrSQLParser::ACOVERS_TGEO_GEO: { + PRECONDITION(ctx->functionParam().size() == 4, + "AcoversTgeoGeo requires 4 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + return LogicalFunction(AcoversTgeoGeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3))); + } + /* END CODEGEN PARSER GLUE: ACOVERS_TGEO_GEO */ + case AntlrSQLParser::ADISJOINT_TGEO_GEO: { + PRECONDITION(ctx->functionParam().size() == 4, + "AdisjointTgeoGeo requires 4 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + return LogicalFunction(AdisjointTgeoGeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3))); + } + /* END CODEGEN PARSER GLUE: ADISJOINT_TGEO_GEO */ + case AntlrSQLParser::ADWITHIN_TGEO_GEO: { + PRECONDITION(ctx->functionParam().size() == 5, + "AdwithinTgeoGeo requires 5 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + return LogicalFunction(AdwithinTgeoGeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4))); + } + /* END CODEGEN PARSER GLUE: ADWITHIN_TGEO_GEO */ /* END CODEGEN PARSER GLUE: GEOM_INTERSECTS2D */ case AntlrSQLParser::GEOM_DWITHIN2D: { PRECONDITION(ctx->functionParam().size() == 3, From bc022a781a99216df0ac30d1a942d9ecdb88013a Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Sun, 14 Jun 2026 15:47:42 +0200 Subject: [PATCH 52/96] feat(meos): add EINTERSECTS/ETOUCHES/ECONTAINS/ACONTAINS/ATOUCHES_TGEO_GEO NES operators (W104) Wire five remaining tgeo predicate operators: EINTERSECTS_TGEO_GEO, ETOUCHES_TGEO_GEO, ECONTAINS_TGEO_GEO (ever-*) and ACONTAINS_TGEO_GEO, ATOUCHES_TGEO_GEO (always-*). All use the 4-arg pattern (lon:FLOAT64, lat:FLOAT64, ts:UINT64, wkt:VARCHAR) -> FLOAT64. --- .../Meos/AcontainsTgeoGeoLogicalFunction.hpp | 51 +++++++++ .../Meos/AtouchesTgeoGeoLogicalFunction.hpp | 51 +++++++++ .../Meos/EcontainsTgeoGeoLogicalFunction.hpp | 51 +++++++++ .../EintersectsTgeoGeoLogicalFunction.hpp | 51 +++++++++ .../Meos/EtouchesTgeoGeoLogicalFunction.hpp | 51 +++++++++ .../Meos/AcontainsTgeoGeoLogicalFunction.cpp | 107 ++++++++++++++++++ .../Meos/AtouchesTgeoGeoLogicalFunction.cpp | 107 ++++++++++++++++++ .../src/Functions/Meos/CMakeLists.txt | 5 + .../Meos/EcontainsTgeoGeoLogicalFunction.cpp | 107 ++++++++++++++++++ .../EintersectsTgeoGeoLogicalFunction.cpp | 107 ++++++++++++++++++ .../Meos/EtouchesTgeoGeoLogicalFunction.cpp | 107 ++++++++++++++++++ .../Meos/AcontainsTgeoGeoPhysicalFunction.hpp | 35 ++++++ .../Meos/AtouchesTgeoGeoPhysicalFunction.hpp | 35 ++++++ .../Meos/EcontainsTgeoGeoPhysicalFunction.hpp | 35 ++++++ .../EintersectsTgeoGeoPhysicalFunction.hpp | 35 ++++++ .../Meos/EtouchesTgeoGeoPhysicalFunction.hpp | 35 ++++++ .../Meos/AcontainsTgeoGeoPhysicalFunction.cpp | 87 ++++++++++++++ .../Meos/AtouchesTgeoGeoPhysicalFunction.cpp | 87 ++++++++++++++ .../src/Functions/Meos/CMakeLists.txt | 5 + .../Meos/EcontainsTgeoGeoPhysicalFunction.cpp | 87 ++++++++++++++ .../EintersectsTgeoGeoPhysicalFunction.cpp | 87 ++++++++++++++ .../Meos/EtouchesTgeoGeoPhysicalFunction.cpp | 87 ++++++++++++++ nes-sql-parser/AntlrSQL.g4 | 7 +- .../src/AntlrSQLQueryPlanCreator.cpp | 65 +++++++++++ 24 files changed, 1481 insertions(+), 1 deletion(-) create mode 100644 nes-logical-operators/include/Functions/Meos/AcontainsTgeoGeoLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AtouchesTgeoGeoLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EcontainsTgeoGeoLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EintersectsTgeoGeoLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EtouchesTgeoGeoLogicalFunction.hpp create mode 100644 nes-logical-operators/src/Functions/Meos/AcontainsTgeoGeoLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AtouchesTgeoGeoLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EcontainsTgeoGeoLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EintersectsTgeoGeoLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EtouchesTgeoGeoLogicalFunction.cpp create mode 100644 nes-physical-operators/include/Functions/Meos/AcontainsTgeoGeoPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AtouchesTgeoGeoPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EcontainsTgeoGeoPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EintersectsTgeoGeoPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EtouchesTgeoGeoPhysicalFunction.hpp create mode 100644 nes-physical-operators/src/Functions/Meos/AcontainsTgeoGeoPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AtouchesTgeoGeoPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EcontainsTgeoGeoPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EintersectsTgeoGeoPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EtouchesTgeoGeoPhysicalFunction.cpp diff --git a/nes-logical-operators/include/Functions/Meos/AcontainsTgeoGeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AcontainsTgeoGeoLogicalFunction.hpp new file mode 100644 index 0000000000..d713a4c754 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AcontainsTgeoGeoLogicalFunction.hpp @@ -0,0 +1,51 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if temporal geometry always contains the static geometry. + * + * Args: (lon:FLOAT64, lat:FLOAT64, ts:UINT64, wkt:VARCHAR) -> FLOAT64. + */ +class AcontainsTgeoGeoLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AcontainsTgeoGeo"; + + AcontainsTgeoGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, + LogicalFunction ts, LogicalFunction wkt); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AtouchesTgeoGeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AtouchesTgeoGeoLogicalFunction.hpp new file mode 100644 index 0000000000..5c0fe22dab --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AtouchesTgeoGeoLogicalFunction.hpp @@ -0,0 +1,51 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if temporal geometry always touches the static geometry. + * + * Args: (lon:FLOAT64, lat:FLOAT64, ts:UINT64, wkt:VARCHAR) -> FLOAT64. + */ +class AtouchesTgeoGeoLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AtouchesTgeoGeo"; + + AtouchesTgeoGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, + LogicalFunction ts, LogicalFunction wkt); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EcontainsTgeoGeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EcontainsTgeoGeoLogicalFunction.hpp new file mode 100644 index 0000000000..c016ba2edf --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EcontainsTgeoGeoLogicalFunction.hpp @@ -0,0 +1,51 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if temporal geometry ever contains the static geometry. + * + * Args: (lon:FLOAT64, lat:FLOAT64, ts:UINT64, wkt:VARCHAR) -> FLOAT64. + */ +class EcontainsTgeoGeoLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EcontainsTgeoGeo"; + + EcontainsTgeoGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, + LogicalFunction ts, LogicalFunction wkt); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EintersectsTgeoGeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EintersectsTgeoGeoLogicalFunction.hpp new file mode 100644 index 0000000000..e98c349738 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EintersectsTgeoGeoLogicalFunction.hpp @@ -0,0 +1,51 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if temporal geometry ever intersects the static geometry. + * + * Args: (lon:FLOAT64, lat:FLOAT64, ts:UINT64, wkt:VARCHAR) -> FLOAT64. + */ +class EintersectsTgeoGeoLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EintersectsTgeoGeo"; + + EintersectsTgeoGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, + LogicalFunction ts, LogicalFunction wkt); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EtouchesTgeoGeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EtouchesTgeoGeoLogicalFunction.hpp new file mode 100644 index 0000000000..b1db05cb86 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EtouchesTgeoGeoLogicalFunction.hpp @@ -0,0 +1,51 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if temporal geometry ever touches the static geometry. + * + * Args: (lon:FLOAT64, lat:FLOAT64, ts:UINT64, wkt:VARCHAR) -> FLOAT64. + */ +class EtouchesTgeoGeoLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EtouchesTgeoGeo"; + + EtouchesTgeoGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, + LogicalFunction ts, LogicalFunction wkt); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AcontainsTgeoGeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AcontainsTgeoGeoLogicalFunction.cpp new file mode 100644 index 0000000000..b4ded1a783 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AcontainsTgeoGeoLogicalFunction.cpp @@ -0,0 +1,107 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AcontainsTgeoGeoLogicalFunction::AcontainsTgeoGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, + LogicalFunction ts, LogicalFunction wkt) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(4); + parameters.push_back(std::move(lon)); + parameters.push_back(std::move(lat)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(wkt)); +} + +DataType AcontainsTgeoGeoLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AcontainsTgeoGeoLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AcontainsTgeoGeoLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AcontainsTgeoGeoLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 4, + "AcontainsTgeoGeoLogicalFunction requires 4 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AcontainsTgeoGeoLogicalFunction::getType() const { return NAME; } + +bool AcontainsTgeoGeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AcontainsTgeoGeoLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction AcontainsTgeoGeoLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(4); + c.emplace_back(parameters[0].withInferredDataType(schema)); + c.emplace_back(parameters[1].withInferredDataType(schema)); + c.emplace_back(parameters[2].withInferredDataType(schema)); + c.emplace_back(parameters[3].withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon must be FLOAT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::VARSIZED),"wkt must be VARSIZED"); + return withChildren(c); +} + +SerializableFunction AcontainsTgeoGeoLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAcontainsTgeoGeoLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 4, + "AcontainsTgeoGeoLogicalFunction requires 4 children but got {}", + arguments.children.size()); + return AcontainsTgeoGeoLogicalFunction(std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AtouchesTgeoGeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AtouchesTgeoGeoLogicalFunction.cpp new file mode 100644 index 0000000000..a92566dc79 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AtouchesTgeoGeoLogicalFunction.cpp @@ -0,0 +1,107 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AtouchesTgeoGeoLogicalFunction::AtouchesTgeoGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, + LogicalFunction ts, LogicalFunction wkt) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(4); + parameters.push_back(std::move(lon)); + parameters.push_back(std::move(lat)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(wkt)); +} + +DataType AtouchesTgeoGeoLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AtouchesTgeoGeoLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AtouchesTgeoGeoLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AtouchesTgeoGeoLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 4, + "AtouchesTgeoGeoLogicalFunction requires 4 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AtouchesTgeoGeoLogicalFunction::getType() const { return NAME; } + +bool AtouchesTgeoGeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AtouchesTgeoGeoLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction AtouchesTgeoGeoLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(4); + c.emplace_back(parameters[0].withInferredDataType(schema)); + c.emplace_back(parameters[1].withInferredDataType(schema)); + c.emplace_back(parameters[2].withInferredDataType(schema)); + c.emplace_back(parameters[3].withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon must be FLOAT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::VARSIZED),"wkt must be VARSIZED"); + return withChildren(c); +} + +SerializableFunction AtouchesTgeoGeoLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAtouchesTgeoGeoLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 4, + "AtouchesTgeoGeoLogicalFunction requires 4 children but got {}", + arguments.children.size()); + return AtouchesTgeoGeoLogicalFunction(std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt index 3cffeec43f..6f3276bfae 100644 --- a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt @@ -299,6 +299,11 @@ add_plugin(AintersectsTgeoGeo LogicalFunction nes-logical-operators AintersectsT add_plugin(AcoversTgeoGeo LogicalFunction nes-logical-operators AcoversTgeoGeoLogicalFunction.cpp) add_plugin(AdisjointTgeoGeo LogicalFunction nes-logical-operators AdisjointTgeoGeoLogicalFunction.cpp) add_plugin(AdwithinTgeoGeo LogicalFunction nes-logical-operators AdwithinTgeoGeoLogicalFunction.cpp) +add_plugin(EintersectsTgeoGeo LogicalFunction nes-logical-operators EintersectsTgeoGeoLogicalFunction.cpp) +add_plugin(EtouchesTgeoGeo LogicalFunction nes-logical-operators EtouchesTgeoGeoLogicalFunction.cpp) +add_plugin(EcontainsTgeoGeo LogicalFunction nes-logical-operators EcontainsTgeoGeoLogicalFunction.cpp) +add_plugin(AcontainsTgeoGeo LogicalFunction nes-logical-operators AcontainsTgeoGeoLogicalFunction.cpp) +add_plugin(AtouchesTgeoGeo LogicalFunction nes-logical-operators AtouchesTgeoGeoLogicalFunction.cpp) add_plugin(GeomIntersects2d LogicalFunction nes-logical-operators GeomIntersects2dLogicalFunction.cpp) add_plugin(GeomDwithin2d LogicalFunction nes-logical-operators GeomDwithin2dLogicalFunction.cpp) add_plugin(GeomContains LogicalFunction nes-logical-operators GeomContainsLogicalFunction.cpp) diff --git a/nes-logical-operators/src/Functions/Meos/EcontainsTgeoGeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EcontainsTgeoGeoLogicalFunction.cpp new file mode 100644 index 0000000000..a0634dd701 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EcontainsTgeoGeoLogicalFunction.cpp @@ -0,0 +1,107 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EcontainsTgeoGeoLogicalFunction::EcontainsTgeoGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, + LogicalFunction ts, LogicalFunction wkt) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(4); + parameters.push_back(std::move(lon)); + parameters.push_back(std::move(lat)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(wkt)); +} + +DataType EcontainsTgeoGeoLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EcontainsTgeoGeoLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EcontainsTgeoGeoLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EcontainsTgeoGeoLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 4, + "EcontainsTgeoGeoLogicalFunction requires 4 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EcontainsTgeoGeoLogicalFunction::getType() const { return NAME; } + +bool EcontainsTgeoGeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EcontainsTgeoGeoLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction EcontainsTgeoGeoLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(4); + c.emplace_back(parameters[0].withInferredDataType(schema)); + c.emplace_back(parameters[1].withInferredDataType(schema)); + c.emplace_back(parameters[2].withInferredDataType(schema)); + c.emplace_back(parameters[3].withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon must be FLOAT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::VARSIZED),"wkt must be VARSIZED"); + return withChildren(c); +} + +SerializableFunction EcontainsTgeoGeoLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEcontainsTgeoGeoLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 4, + "EcontainsTgeoGeoLogicalFunction requires 4 children but got {}", + arguments.children.size()); + return EcontainsTgeoGeoLogicalFunction(std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EintersectsTgeoGeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EintersectsTgeoGeoLogicalFunction.cpp new file mode 100644 index 0000000000..69673fe97c --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EintersectsTgeoGeoLogicalFunction.cpp @@ -0,0 +1,107 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EintersectsTgeoGeoLogicalFunction::EintersectsTgeoGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, + LogicalFunction ts, LogicalFunction wkt) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(4); + parameters.push_back(std::move(lon)); + parameters.push_back(std::move(lat)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(wkt)); +} + +DataType EintersectsTgeoGeoLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EintersectsTgeoGeoLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EintersectsTgeoGeoLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EintersectsTgeoGeoLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 4, + "EintersectsTgeoGeoLogicalFunction requires 4 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EintersectsTgeoGeoLogicalFunction::getType() const { return NAME; } + +bool EintersectsTgeoGeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EintersectsTgeoGeoLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction EintersectsTgeoGeoLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(4); + c.emplace_back(parameters[0].withInferredDataType(schema)); + c.emplace_back(parameters[1].withInferredDataType(schema)); + c.emplace_back(parameters[2].withInferredDataType(schema)); + c.emplace_back(parameters[3].withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon must be FLOAT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::VARSIZED),"wkt must be VARSIZED"); + return withChildren(c); +} + +SerializableFunction EintersectsTgeoGeoLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEintersectsTgeoGeoLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 4, + "EintersectsTgeoGeoLogicalFunction requires 4 children but got {}", + arguments.children.size()); + return EintersectsTgeoGeoLogicalFunction(std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EtouchesTgeoGeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EtouchesTgeoGeoLogicalFunction.cpp new file mode 100644 index 0000000000..8232949891 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EtouchesTgeoGeoLogicalFunction.cpp @@ -0,0 +1,107 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EtouchesTgeoGeoLogicalFunction::EtouchesTgeoGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, + LogicalFunction ts, LogicalFunction wkt) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(4); + parameters.push_back(std::move(lon)); + parameters.push_back(std::move(lat)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(wkt)); +} + +DataType EtouchesTgeoGeoLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EtouchesTgeoGeoLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EtouchesTgeoGeoLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EtouchesTgeoGeoLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 4, + "EtouchesTgeoGeoLogicalFunction requires 4 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EtouchesTgeoGeoLogicalFunction::getType() const { return NAME; } + +bool EtouchesTgeoGeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EtouchesTgeoGeoLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction EtouchesTgeoGeoLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(4); + c.emplace_back(parameters[0].withInferredDataType(schema)); + c.emplace_back(parameters[1].withInferredDataType(schema)); + c.emplace_back(parameters[2].withInferredDataType(schema)); + c.emplace_back(parameters[3].withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon must be FLOAT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::VARSIZED),"wkt must be VARSIZED"); + return withChildren(c); +} + +SerializableFunction EtouchesTgeoGeoLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEtouchesTgeoGeoLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 4, + "EtouchesTgeoGeoLogicalFunction requires 4 children but got {}", + arguments.children.size()); + return EtouchesTgeoGeoLogicalFunction(std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3])); +} + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AcontainsTgeoGeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AcontainsTgeoGeoPhysicalFunction.hpp new file mode 100644 index 0000000000..37739af8b7 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AcontainsTgeoGeoPhysicalFunction.hpp @@ -0,0 +1,35 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class AcontainsTgeoGeoPhysicalFunction : public PhysicalFunctionConcept { +public: + AcontainsTgeoGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, + PhysicalFunction ts, PhysicalFunction wkt); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AtouchesTgeoGeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AtouchesTgeoGeoPhysicalFunction.hpp new file mode 100644 index 0000000000..7cf0d71d4c --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AtouchesTgeoGeoPhysicalFunction.hpp @@ -0,0 +1,35 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class AtouchesTgeoGeoPhysicalFunction : public PhysicalFunctionConcept { +public: + AtouchesTgeoGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, + PhysicalFunction ts, PhysicalFunction wkt); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EcontainsTgeoGeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EcontainsTgeoGeoPhysicalFunction.hpp new file mode 100644 index 0000000000..72918a88c2 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EcontainsTgeoGeoPhysicalFunction.hpp @@ -0,0 +1,35 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class EcontainsTgeoGeoPhysicalFunction : public PhysicalFunctionConcept { +public: + EcontainsTgeoGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, + PhysicalFunction ts, PhysicalFunction wkt); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EintersectsTgeoGeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EintersectsTgeoGeoPhysicalFunction.hpp new file mode 100644 index 0000000000..0835b534c0 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EintersectsTgeoGeoPhysicalFunction.hpp @@ -0,0 +1,35 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class EintersectsTgeoGeoPhysicalFunction : public PhysicalFunctionConcept { +public: + EintersectsTgeoGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, + PhysicalFunction ts, PhysicalFunction wkt); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EtouchesTgeoGeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EtouchesTgeoGeoPhysicalFunction.hpp new file mode 100644 index 0000000000..d89e05afd9 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EtouchesTgeoGeoPhysicalFunction.hpp @@ -0,0 +1,35 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class EtouchesTgeoGeoPhysicalFunction : public PhysicalFunctionConcept { +public: + EtouchesTgeoGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, + PhysicalFunction ts, PhysicalFunction wkt); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AcontainsTgeoGeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AcontainsTgeoGeoPhysicalFunction.cpp new file mode 100644 index 0000000000..6695a335d9 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AcontainsTgeoGeoPhysicalFunction.cpp @@ -0,0 +1,87 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +AcontainsTgeoGeoPhysicalFunction::AcontainsTgeoGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, + PhysicalFunction ts, PhysicalFunction wkt) +{ + paramFns.reserve(4); + paramFns.push_back(std::move(lon)); + paramFns.push_back(std::move(lat)); + paramFns.push_back(std::move(ts)); + paramFns.push_back(std::move(wkt)); +} + +VarVal AcontainsTgeoGeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto lon = paramFns[0].execute(record, arena).cast(); + auto lat = paramFns[1].execute(record, arena).cast(); + auto ts = paramFns[2].execute(record, arena).cast(); + auto wkt = paramFns[3].execute(record, arena).cast(); + + const auto result = nautilus::invoke( + +[](double lon, double lat, uint64_t ts, + const char* w, uint32_t wsz) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string wktStr(w, wsz); + std::string tgeoWkt = fmt::format("SRID=4326;POINT({},{})@{}", lon, lat, ts); + Temporal* tgeo = tgeompoint_in(tgeoWkt.c_str()); + if (!tgeo) return 0.0; + GSERIALIZED* gs = geom_in(wktStr.c_str(), -1); + if (!gs) { free(tgeo); return 0.0; } + int r = acontains_tgeo_geo(tgeo, gs); + free(tgeo); free(gs); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + lon, lat, ts, wkt); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAcontainsTgeoGeoPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 4, + "AcontainsTgeoGeoPhysicalFunction requires 4 children but got {}", + arguments.childFunctions.size()); + return AcontainsTgeoGeoPhysicalFunction(std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AtouchesTgeoGeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AtouchesTgeoGeoPhysicalFunction.cpp new file mode 100644 index 0000000000..a7c1d6dac1 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AtouchesTgeoGeoPhysicalFunction.cpp @@ -0,0 +1,87 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +AtouchesTgeoGeoPhysicalFunction::AtouchesTgeoGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, + PhysicalFunction ts, PhysicalFunction wkt) +{ + paramFns.reserve(4); + paramFns.push_back(std::move(lon)); + paramFns.push_back(std::move(lat)); + paramFns.push_back(std::move(ts)); + paramFns.push_back(std::move(wkt)); +} + +VarVal AtouchesTgeoGeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto lon = paramFns[0].execute(record, arena).cast(); + auto lat = paramFns[1].execute(record, arena).cast(); + auto ts = paramFns[2].execute(record, arena).cast(); + auto wkt = paramFns[3].execute(record, arena).cast(); + + const auto result = nautilus::invoke( + +[](double lon, double lat, uint64_t ts, + const char* w, uint32_t wsz) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string wktStr(w, wsz); + std::string tgeoWkt = fmt::format("SRID=4326;POINT({},{})@{}", lon, lat, ts); + Temporal* tgeo = tgeompoint_in(tgeoWkt.c_str()); + if (!tgeo) return 0.0; + GSERIALIZED* gs = geom_in(wktStr.c_str(), -1); + if (!gs) { free(tgeo); return 0.0; } + int r = atouches_tgeo_geo(tgeo, gs); + free(tgeo); free(gs); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + lon, lat, ts, wkt); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAtouchesTgeoGeoPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 4, + "AtouchesTgeoGeoPhysicalFunction requires 4 children but got {}", + arguments.childFunctions.size()); + return AtouchesTgeoGeoPhysicalFunction(std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt index c64f1e8f7e..655e504a7c 100644 --- a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt @@ -298,6 +298,11 @@ add_plugin(AintersectsTgeoGeo PhysicalFunction nes-physical-operators Aintersect add_plugin(AcoversTgeoGeo PhysicalFunction nes-physical-operators AcoversTgeoGeoPhysicalFunction.cpp) add_plugin(AdisjointTgeoGeo PhysicalFunction nes-physical-operators AdisjointTgeoGeoPhysicalFunction.cpp) add_plugin(AdwithinTgeoGeo PhysicalFunction nes-physical-operators AdwithinTgeoGeoPhysicalFunction.cpp) +add_plugin(EintersectsTgeoGeo PhysicalFunction nes-physical-operators EintersectsTgeoGeoPhysicalFunction.cpp) +add_plugin(EtouchesTgeoGeo PhysicalFunction nes-physical-operators EtouchesTgeoGeoPhysicalFunction.cpp) +add_plugin(EcontainsTgeoGeo PhysicalFunction nes-physical-operators EcontainsTgeoGeoPhysicalFunction.cpp) +add_plugin(AcontainsTgeoGeo PhysicalFunction nes-physical-operators AcontainsTgeoGeoPhysicalFunction.cpp) +add_plugin(AtouchesTgeoGeo PhysicalFunction nes-physical-operators AtouchesTgeoGeoPhysicalFunction.cpp) add_plugin(GeomIntersects2d PhysicalFunction nes-physical-operators GeomIntersects2dPhysicalFunction.cpp) add_plugin(GeomDwithin2d PhysicalFunction nes-physical-operators GeomDwithin2dPhysicalFunction.cpp) add_plugin(GeomContains PhysicalFunction nes-physical-operators GeomContainsPhysicalFunction.cpp) diff --git a/nes-physical-operators/src/Functions/Meos/EcontainsTgeoGeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EcontainsTgeoGeoPhysicalFunction.cpp new file mode 100644 index 0000000000..129536b774 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EcontainsTgeoGeoPhysicalFunction.cpp @@ -0,0 +1,87 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +EcontainsTgeoGeoPhysicalFunction::EcontainsTgeoGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, + PhysicalFunction ts, PhysicalFunction wkt) +{ + paramFns.reserve(4); + paramFns.push_back(std::move(lon)); + paramFns.push_back(std::move(lat)); + paramFns.push_back(std::move(ts)); + paramFns.push_back(std::move(wkt)); +} + +VarVal EcontainsTgeoGeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto lon = paramFns[0].execute(record, arena).cast(); + auto lat = paramFns[1].execute(record, arena).cast(); + auto ts = paramFns[2].execute(record, arena).cast(); + auto wkt = paramFns[3].execute(record, arena).cast(); + + const auto result = nautilus::invoke( + +[](double lon, double lat, uint64_t ts, + const char* w, uint32_t wsz) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string wktStr(w, wsz); + std::string tgeoWkt = fmt::format("SRID=4326;POINT({},{})@{}", lon, lat, ts); + Temporal* tgeo = tgeompoint_in(tgeoWkt.c_str()); + if (!tgeo) return 0.0; + GSERIALIZED* gs = geom_in(wktStr.c_str(), -1); + if (!gs) { free(tgeo); return 0.0; } + int r = econtains_tgeo_geo(tgeo, gs); + free(tgeo); free(gs); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + lon, lat, ts, wkt); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEcontainsTgeoGeoPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 4, + "EcontainsTgeoGeoPhysicalFunction requires 4 children but got {}", + arguments.childFunctions.size()); + return EcontainsTgeoGeoPhysicalFunction(std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EintersectsTgeoGeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EintersectsTgeoGeoPhysicalFunction.cpp new file mode 100644 index 0000000000..fa8a810099 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EintersectsTgeoGeoPhysicalFunction.cpp @@ -0,0 +1,87 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +EintersectsTgeoGeoPhysicalFunction::EintersectsTgeoGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, + PhysicalFunction ts, PhysicalFunction wkt) +{ + paramFns.reserve(4); + paramFns.push_back(std::move(lon)); + paramFns.push_back(std::move(lat)); + paramFns.push_back(std::move(ts)); + paramFns.push_back(std::move(wkt)); +} + +VarVal EintersectsTgeoGeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto lon = paramFns[0].execute(record, arena).cast(); + auto lat = paramFns[1].execute(record, arena).cast(); + auto ts = paramFns[2].execute(record, arena).cast(); + auto wkt = paramFns[3].execute(record, arena).cast(); + + const auto result = nautilus::invoke( + +[](double lon, double lat, uint64_t ts, + const char* w, uint32_t wsz) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string wktStr(w, wsz); + std::string tgeoWkt = fmt::format("SRID=4326;POINT({},{})@{}", lon, lat, ts); + Temporal* tgeo = tgeompoint_in(tgeoWkt.c_str()); + if (!tgeo) return 0.0; + GSERIALIZED* gs = geom_in(wktStr.c_str(), -1); + if (!gs) { free(tgeo); return 0.0; } + int r = eintersects_tgeo_geo(tgeo, gs); + free(tgeo); free(gs); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + lon, lat, ts, wkt); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEintersectsTgeoGeoPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 4, + "EintersectsTgeoGeoPhysicalFunction requires 4 children but got {}", + arguments.childFunctions.size()); + return EintersectsTgeoGeoPhysicalFunction(std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EtouchesTgeoGeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EtouchesTgeoGeoPhysicalFunction.cpp new file mode 100644 index 0000000000..f3be297dc5 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EtouchesTgeoGeoPhysicalFunction.cpp @@ -0,0 +1,87 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +EtouchesTgeoGeoPhysicalFunction::EtouchesTgeoGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, + PhysicalFunction ts, PhysicalFunction wkt) +{ + paramFns.reserve(4); + paramFns.push_back(std::move(lon)); + paramFns.push_back(std::move(lat)); + paramFns.push_back(std::move(ts)); + paramFns.push_back(std::move(wkt)); +} + +VarVal EtouchesTgeoGeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto lon = paramFns[0].execute(record, arena).cast(); + auto lat = paramFns[1].execute(record, arena).cast(); + auto ts = paramFns[2].execute(record, arena).cast(); + auto wkt = paramFns[3].execute(record, arena).cast(); + + const auto result = nautilus::invoke( + +[](double lon, double lat, uint64_t ts, + const char* w, uint32_t wsz) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string wktStr(w, wsz); + std::string tgeoWkt = fmt::format("SRID=4326;POINT({},{})@{}", lon, lat, ts); + Temporal* tgeo = tgeompoint_in(tgeoWkt.c_str()); + if (!tgeo) return 0.0; + GSERIALIZED* gs = geom_in(wktStr.c_str(), -1); + if (!gs) { free(tgeo); return 0.0; } + int r = etouches_tgeo_geo(tgeo, gs); + free(tgeo); free(gs); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + lon, lat, ts, wkt); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEtouchesTgeoGeoPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 4, + "EtouchesTgeoGeoPhysicalFunction requires 4 children but got {}", + arguments.childFunctions.size()); + return EtouchesTgeoGeoPhysicalFunction(std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3])); +} + +} // namespace NES diff --git a/nes-sql-parser/AntlrSQL.g4 b/nes-sql-parser/AntlrSQL.g4 index ef432428da..3601f338f6 100644 --- a/nes-sql-parser/AntlrSQL.g4 +++ b/nes-sql-parser/AntlrSQL.g4 @@ -295,7 +295,7 @@ timeUnit: MS timestampParameter: name=identifier; -functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT | TGE_TTEXT_TEXT | TGE_TEXT_TTEXT | TGT_TTEXT_TEXT | TGT_TEXT_TTEXT | TLE_TTEXT_TEXT | TLE_TEXT_TTEXT | TLT_TTEXT_TEXT | TLT_TEXT_TTEXT | TTEXT_UPPER | TTEXT_LOWER | TTEXT_INITCAP | TEXTCAT_TTEXT_TEXT | TEXTCAT_TEXT_TTEXT | TEXTCAT_TTEXT_TTEXT | GEOM_LENGTH | GEOM_PERIMETER | GEOM_AZIMUTH | GEOG_AREA | GEOG_LENGTH | GEOG_PERIMETER | GEOM_IS_EMPTY | AINTERSECTS_TGEO_GEO | ACOVERS_TGEO_GEO | ADISJOINT_TGEO_GEO | ADWITHIN_TGEO_GEO | GEOM_INTERSECTS2D | GEOM_DWITHIN2D | GEOM_CONTAINS | GEOM_DISJOINT2D | GEOM_COVERS | GEOM_TOUCHES | GEOM_INTERSECTS3D | GEOM_DWITHIN3D | GEOM_DISTANCE2D | GEOM_DISTANCE3D; +functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT | TGE_TTEXT_TEXT | TGE_TEXT_TTEXT | TGT_TTEXT_TEXT | TGT_TEXT_TTEXT | TLE_TTEXT_TEXT | TLE_TEXT_TTEXT | TLT_TTEXT_TEXT | TLT_TEXT_TTEXT | TTEXT_UPPER | TTEXT_LOWER | TTEXT_INITCAP | TEXTCAT_TTEXT_TEXT | TEXTCAT_TEXT_TTEXT | TEXTCAT_TTEXT_TTEXT | GEOM_LENGTH | GEOM_PERIMETER | GEOM_AZIMUTH | GEOG_AREA | GEOG_LENGTH | GEOG_PERIMETER | GEOM_IS_EMPTY | AINTERSECTS_TGEO_GEO | ACOVERS_TGEO_GEO | ADISJOINT_TGEO_GEO | ADWITHIN_TGEO_GEO | EINTERSECTS_TGEO_GEO | ETOUCHES_TGEO_GEO | ECONTAINS_TGEO_GEO | ACONTAINS_TGEO_GEO | ATOUCHES_TGEO_GEO | GEOM_INTERSECTS2D | GEOM_DWITHIN2D | GEOM_CONTAINS | GEOM_DISJOINT2D | GEOM_COVERS | GEOM_TOUCHES | GEOM_INTERSECTS3D | GEOM_DWITHIN3D | GEOM_DISTANCE2D | GEOM_DISTANCE3D; sinkClause: INTO sink (',' sink)*; @@ -769,6 +769,11 @@ AINTERSECTS_TGEO_GEO: 'AINTERSECTS_TGEO_GEO' | 'aintersects_tgeo_geo'; ACOVERS_TGEO_GEO: 'ACOVERS_TGEO_GEO' | 'acovers_tgeo_geo'; ADISJOINT_TGEO_GEO: 'ADISJOINT_TGEO_GEO' | 'adisjoint_tgeo_geo'; ADWITHIN_TGEO_GEO: 'ADWITHIN_TGEO_GEO' | 'adwithin_tgeo_geo'; +EINTERSECTS_TGEO_GEO: 'EINTERSECTS_TGEO_GEO' | 'eintersects_tgeo_geo'; +ETOUCHES_TGEO_GEO: 'ETOUCHES_TGEO_GEO' | 'etouches_tgeo_geo'; +ECONTAINS_TGEO_GEO: 'ECONTAINS_TGEO_GEO' | 'econtains_tgeo_geo'; +ACONTAINS_TGEO_GEO: 'ACONTAINS_TGEO_GEO' | 'acontains_tgeo_geo'; +ATOUCHES_TGEO_GEO: 'ATOUCHES_TGEO_GEO' | 'atouches_tgeo_geo'; GEOM_INTERSECTS2D: 'GEOM_INTERSECTS2D' | 'geom_intersects2d'; GEOM_DWITHIN2D: 'GEOM_DWITHIN2D' | 'geom_dwithin2d'; GEOM_CONTAINS: 'GEOM_CONTAINS' | 'geom_contains'; diff --git a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp index 3960df030f..aa48a4cd48 100644 --- a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp +++ b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp @@ -350,6 +350,11 @@ #include #include #include +#include +#include +#include +#include +#include #include #include #include @@ -8877,6 +8882,66 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont return LogicalFunction(AdwithinTgeoGeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4))); } /* END CODEGEN PARSER GLUE: ADWITHIN_TGEO_GEO */ + case AntlrSQLParser::EINTERSECTS_TGEO_GEO: { + PRECONDITION(ctx->functionParam().size() == 4, + "EintersectsTgeoGeo requires 4 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + return LogicalFunction(EintersectsTgeoGeoLogicalFunction(std::move(arg0), std::move(arg1), + std::move(arg2), std::move(arg3))); + } + /* END CODEGEN PARSER GLUE: EINTERSECTS_TGEO_GEO */ + case AntlrSQLParser::ETOUCHES_TGEO_GEO: { + PRECONDITION(ctx->functionParam().size() == 4, + "EtouchesTgeoGeo requires 4 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + return LogicalFunction(EtouchesTgeoGeoLogicalFunction(std::move(arg0), std::move(arg1), + std::move(arg2), std::move(arg3))); + } + /* END CODEGEN PARSER GLUE: ETOUCHES_TGEO_GEO */ + case AntlrSQLParser::ECONTAINS_TGEO_GEO: { + PRECONDITION(ctx->functionParam().size() == 4, + "EcontainsTgeoGeo requires 4 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + return LogicalFunction(EcontainsTgeoGeoLogicalFunction(std::move(arg0), std::move(arg1), + std::move(arg2), std::move(arg3))); + } + /* END CODEGEN PARSER GLUE: ECONTAINS_TGEO_GEO */ + case AntlrSQLParser::ACONTAINS_TGEO_GEO: { + PRECONDITION(ctx->functionParam().size() == 4, + "AcontainsTgeoGeo requires 4 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + return LogicalFunction(AcontainsTgeoGeoLogicalFunction(std::move(arg0), std::move(arg1), + std::move(arg2), std::move(arg3))); + } + /* END CODEGEN PARSER GLUE: ACONTAINS_TGEO_GEO */ + case AntlrSQLParser::ATOUCHES_TGEO_GEO: { + PRECONDITION(ctx->functionParam().size() == 4, + "AtouchesTgeoGeo requires 4 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + return LogicalFunction(AtouchesTgeoGeoLogicalFunction(std::move(arg0), std::move(arg1), + std::move(arg2), std::move(arg3))); + } + /* END CODEGEN PARSER GLUE: ATOUCHES_TGEO_GEO */ /* END CODEGEN PARSER GLUE: GEOM_INTERSECTS2D */ case AntlrSQLParser::GEOM_DWITHIN2D: { PRECONDITION(ctx->functionParam().size() == 3, From 8a74d0fd7846bccdae82c073526dd7aa998d112c Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Mon, 15 Jun 2026 00:13:39 +0200 Subject: [PATCH 53/96] feat(meos): add GEO_NUM_POINTS/GEOS/SRID/IS_UNITARY, GEO_EQUALS/SAME, GEOG_DISTANCE NES operators (W105) Wire seven static geometry scalar operators: GEO_NUM_POINTS, GEO_NUM_GEOS, GEO_SRID, GEO_IS_UNITARY (1-arg VARCHAR->FLOAT64) and GEO_EQUALS, GEO_SAME, GEOG_DISTANCE (2-arg VARCHAR*VARCHAR->FLOAT64). --- .../Meos/GeoEqualsLogicalFunction.hpp | 50 ++++++++++ .../Meos/GeoIsUnitaryLogicalFunction.hpp | 50 ++++++++++ .../Meos/GeoNumGeosLogicalFunction.hpp | 50 ++++++++++ .../Meos/GeoNumPointsLogicalFunction.hpp | 50 ++++++++++ .../Functions/Meos/GeoSameLogicalFunction.hpp | 50 ++++++++++ .../Functions/Meos/GeoSridLogicalFunction.hpp | 50 ++++++++++ .../Meos/GeogDistanceLogicalFunction.hpp | 50 ++++++++++ .../src/Functions/Meos/CMakeLists.txt | 7 ++ .../Meos/GeoEqualsLogicalFunction.cpp | 98 +++++++++++++++++++ .../Meos/GeoIsUnitaryLogicalFunction.cpp | 94 ++++++++++++++++++ .../Meos/GeoNumGeosLogicalFunction.cpp | 94 ++++++++++++++++++ .../Meos/GeoNumPointsLogicalFunction.cpp | 94 ++++++++++++++++++ .../Functions/Meos/GeoSameLogicalFunction.cpp | 98 +++++++++++++++++++ .../Functions/Meos/GeoSridLogicalFunction.cpp | 94 ++++++++++++++++++ .../Meos/GeogDistanceLogicalFunction.cpp | 98 +++++++++++++++++++ .../Meos/GeoEqualsPhysicalFunction.hpp | 34 +++++++ .../Meos/GeoIsUnitaryPhysicalFunction.hpp | 34 +++++++ .../Meos/GeoNumGeosPhysicalFunction.hpp | 34 +++++++ .../Meos/GeoNumPointsPhysicalFunction.hpp | 34 +++++++ .../Meos/GeoSamePhysicalFunction.hpp | 34 +++++++ .../Meos/GeoSridPhysicalFunction.hpp | 34 +++++++ .../Meos/GeogDistancePhysicalFunction.hpp | 34 +++++++ .../src/Functions/Meos/CMakeLists.txt | 7 ++ .../Meos/GeoEqualsPhysicalFunction.cpp | 78 +++++++++++++++ .../Meos/GeoIsUnitaryPhysicalFunction.cpp | 72 ++++++++++++++ .../Meos/GeoNumGeosPhysicalFunction.cpp | 72 ++++++++++++++ .../Meos/GeoNumPointsPhysicalFunction.cpp | 72 ++++++++++++++ .../Meos/GeoSamePhysicalFunction.cpp | 78 +++++++++++++++ .../Meos/GeoSridPhysicalFunction.cpp | 72 ++++++++++++++ .../Meos/GeogDistancePhysicalFunction.cpp | 78 +++++++++++++++ nes-sql-parser/AntlrSQL.g4 | 9 +- .../src/AntlrSQLQueryPlanCreator.cpp | 66 +++++++++++++ 32 files changed, 1868 insertions(+), 1 deletion(-) create mode 100644 nes-logical-operators/include/Functions/Meos/GeoEqualsLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/GeoIsUnitaryLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/GeoNumGeosLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/GeoNumPointsLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/GeoSameLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/GeoSridLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/GeogDistanceLogicalFunction.hpp create mode 100644 nes-logical-operators/src/Functions/Meos/GeoEqualsLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/GeoIsUnitaryLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/GeoNumGeosLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/GeoNumPointsLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/GeoSameLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/GeoSridLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/GeogDistanceLogicalFunction.cpp create mode 100644 nes-physical-operators/include/Functions/Meos/GeoEqualsPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/GeoIsUnitaryPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/GeoNumGeosPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/GeoNumPointsPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/GeoSamePhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/GeoSridPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/GeogDistancePhysicalFunction.hpp create mode 100644 nes-physical-operators/src/Functions/Meos/GeoEqualsPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/GeoIsUnitaryPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/GeoNumGeosPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/GeoNumPointsPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/GeoSamePhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/GeoSridPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/GeogDistancePhysicalFunction.cpp diff --git a/nes-logical-operators/include/Functions/Meos/GeoEqualsLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeoEqualsLogicalFunction.hpp new file mode 100644 index 0000000000..abe64d136c --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/GeoEqualsLogicalFunction.hpp @@ -0,0 +1,50 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if two planar geometries are spatially equal. + * + * Args: (wkt1:VARCHAR, wkt2:VARCHAR) -> FLOAT64. + */ +class GeoEqualsLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "GeoEquals"; + + GeoEqualsLogicalFunction(LogicalFunction wkt1, LogicalFunction wkt2); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/GeoIsUnitaryLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeoIsUnitaryLogicalFunction.hpp new file mode 100644 index 0000000000..f59d45cc61 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/GeoIsUnitaryLogicalFunction.hpp @@ -0,0 +1,50 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if the geometry is a single geometry (not a collection). + * + * Args: (wkt:VARCHAR) -> FLOAT64. + */ +class GeoIsUnitaryLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "GeoIsUnitary"; + + explicit GeoIsUnitaryLogicalFunction(LogicalFunction wkt); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/GeoNumGeosLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeoNumGeosLogicalFunction.hpp new file mode 100644 index 0000000000..d6845bc10b --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/GeoNumGeosLogicalFunction.hpp @@ -0,0 +1,50 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns the number of sub-geometries in a geometry collection. + * + * Args: (wkt:VARCHAR) -> FLOAT64. + */ +class GeoNumGeosLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "GeoNumGeos"; + + explicit GeoNumGeosLogicalFunction(LogicalFunction wkt); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/GeoNumPointsLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeoNumPointsLogicalFunction.hpp new file mode 100644 index 0000000000..198b5f3dae --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/GeoNumPointsLogicalFunction.hpp @@ -0,0 +1,50 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns the number of points in a geometry. + * + * Args: (wkt:VARCHAR) -> FLOAT64. + */ +class GeoNumPointsLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "GeoNumPoints"; + + explicit GeoNumPointsLogicalFunction(LogicalFunction wkt); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/GeoSameLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeoSameLogicalFunction.hpp new file mode 100644 index 0000000000..277b6790a1 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/GeoSameLogicalFunction.hpp @@ -0,0 +1,50 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if two planar geometries are the same (identical coordinates). + * + * Args: (wkt1:VARCHAR, wkt2:VARCHAR) -> FLOAT64. + */ +class GeoSameLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "GeoSame"; + + GeoSameLogicalFunction(LogicalFunction wkt1, LogicalFunction wkt2); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/GeoSridLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeoSridLogicalFunction.hpp new file mode 100644 index 0000000000..7d539b2d64 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/GeoSridLogicalFunction.hpp @@ -0,0 +1,50 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns the SRID of a geometry. + * + * Args: (wkt:VARCHAR) -> FLOAT64. + */ +class GeoSridLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "GeoSrid"; + + explicit GeoSridLogicalFunction(LogicalFunction wkt); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/GeogDistanceLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeogDistanceLogicalFunction.hpp new file mode 100644 index 0000000000..f9868257b3 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/GeogDistanceLogicalFunction.hpp @@ -0,0 +1,50 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns the spheroidal distance between two geographic geometries in metres. + * + * Args: (wkt1:VARCHAR, wkt2:VARCHAR) -> FLOAT64. + */ +class GeogDistanceLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "GeogDistance"; + + GeogDistanceLogicalFunction(LogicalFunction wkt1, LogicalFunction wkt2); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt index 6f3276bfae..0314be0a6d 100644 --- a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt @@ -304,6 +304,13 @@ add_plugin(EtouchesTgeoGeo LogicalFunction nes-logical-operators EtouchesTgeoGeo add_plugin(EcontainsTgeoGeo LogicalFunction nes-logical-operators EcontainsTgeoGeoLogicalFunction.cpp) add_plugin(AcontainsTgeoGeo LogicalFunction nes-logical-operators AcontainsTgeoGeoLogicalFunction.cpp) add_plugin(AtouchesTgeoGeo LogicalFunction nes-logical-operators AtouchesTgeoGeoLogicalFunction.cpp) +add_plugin(GeoNumPoints LogicalFunction nes-logical-operators GeoNumPointsLogicalFunction.cpp) +add_plugin(GeoNumGeos LogicalFunction nes-logical-operators GeoNumGeosLogicalFunction.cpp) +add_plugin(GeoSrid LogicalFunction nes-logical-operators GeoSridLogicalFunction.cpp) +add_plugin(GeoIsUnitary LogicalFunction nes-logical-operators GeoIsUnitaryLogicalFunction.cpp) +add_plugin(GeoEquals LogicalFunction nes-logical-operators GeoEqualsLogicalFunction.cpp) +add_plugin(GeoSame LogicalFunction nes-logical-operators GeoSameLogicalFunction.cpp) +add_plugin(GeogDistance LogicalFunction nes-logical-operators GeogDistanceLogicalFunction.cpp) add_plugin(GeomIntersects2d LogicalFunction nes-logical-operators GeomIntersects2dLogicalFunction.cpp) add_plugin(GeomDwithin2d LogicalFunction nes-logical-operators GeomDwithin2dLogicalFunction.cpp) add_plugin(GeomContains LogicalFunction nes-logical-operators GeomContainsLogicalFunction.cpp) diff --git a/nes-logical-operators/src/Functions/Meos/GeoEqualsLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeoEqualsLogicalFunction.cpp new file mode 100644 index 0000000000..48b4b40aa1 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/GeoEqualsLogicalFunction.cpp @@ -0,0 +1,98 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +GeoEqualsLogicalFunction::GeoEqualsLogicalFunction(LogicalFunction wkt1, LogicalFunction wkt2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(2); + parameters.push_back(std::move(wkt1)); + parameters.push_back(std::move(wkt2)); +} + +DataType GeoEqualsLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction GeoEqualsLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector GeoEqualsLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction GeoEqualsLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 2, + "GeoEqualsLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view GeoEqualsLogicalFunction::getType() const { return NAME; } + +bool GeoEqualsLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string GeoEqualsLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction GeoEqualsLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(2); + c.emplace_back(parameters[0].withInferredDataType(schema)); + c.emplace_back(parameters[1].withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "wkt1 must be VARSIZED"); + INVARIANT(c[1].getDataType().isType(DataType::Type::VARSIZED), "wkt2 must be VARSIZED"); + return withChildren(c); +} + +SerializableFunction GeoEqualsLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeoEqualsLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 2, + "GeoEqualsLogicalFunction requires 2 children but got {}", + arguments.children.size()); + return GeoEqualsLogicalFunction(std::move(arguments.children[0]), + std::move(arguments.children[1])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/GeoIsUnitaryLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeoIsUnitaryLogicalFunction.cpp new file mode 100644 index 0000000000..b3f1f32798 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/GeoIsUnitaryLogicalFunction.cpp @@ -0,0 +1,94 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +GeoIsUnitaryLogicalFunction::GeoIsUnitaryLogicalFunction(LogicalFunction wkt) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(1); + parameters.push_back(std::move(wkt)); +} + +DataType GeoIsUnitaryLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction GeoIsUnitaryLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector GeoIsUnitaryLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction GeoIsUnitaryLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 1, + "GeoIsUnitaryLogicalFunction requires 1 child, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view GeoIsUnitaryLogicalFunction::getType() const { return NAME; } + +bool GeoIsUnitaryLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string GeoIsUnitaryLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction GeoIsUnitaryLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(1); + c.emplace_back(parameters[0].withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "wkt must be VARSIZED"); + return withChildren(c); +} + +SerializableFunction GeoIsUnitaryLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeoIsUnitaryLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 1, + "GeoIsUnitaryLogicalFunction requires 1 child but got {}", + arguments.children.size()); + return GeoIsUnitaryLogicalFunction(std::move(arguments.children[0])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/GeoNumGeosLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeoNumGeosLogicalFunction.cpp new file mode 100644 index 0000000000..f12ce09ac8 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/GeoNumGeosLogicalFunction.cpp @@ -0,0 +1,94 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +GeoNumGeosLogicalFunction::GeoNumGeosLogicalFunction(LogicalFunction wkt) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(1); + parameters.push_back(std::move(wkt)); +} + +DataType GeoNumGeosLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction GeoNumGeosLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector GeoNumGeosLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction GeoNumGeosLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 1, + "GeoNumGeosLogicalFunction requires 1 child, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view GeoNumGeosLogicalFunction::getType() const { return NAME; } + +bool GeoNumGeosLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string GeoNumGeosLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction GeoNumGeosLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(1); + c.emplace_back(parameters[0].withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "wkt must be VARSIZED"); + return withChildren(c); +} + +SerializableFunction GeoNumGeosLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeoNumGeosLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 1, + "GeoNumGeosLogicalFunction requires 1 child but got {}", + arguments.children.size()); + return GeoNumGeosLogicalFunction(std::move(arguments.children[0])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/GeoNumPointsLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeoNumPointsLogicalFunction.cpp new file mode 100644 index 0000000000..740184d839 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/GeoNumPointsLogicalFunction.cpp @@ -0,0 +1,94 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +GeoNumPointsLogicalFunction::GeoNumPointsLogicalFunction(LogicalFunction wkt) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(1); + parameters.push_back(std::move(wkt)); +} + +DataType GeoNumPointsLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction GeoNumPointsLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector GeoNumPointsLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction GeoNumPointsLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 1, + "GeoNumPointsLogicalFunction requires 1 child, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view GeoNumPointsLogicalFunction::getType() const { return NAME; } + +bool GeoNumPointsLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string GeoNumPointsLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction GeoNumPointsLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(1); + c.emplace_back(parameters[0].withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "wkt must be VARSIZED"); + return withChildren(c); +} + +SerializableFunction GeoNumPointsLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeoNumPointsLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 1, + "GeoNumPointsLogicalFunction requires 1 child but got {}", + arguments.children.size()); + return GeoNumPointsLogicalFunction(std::move(arguments.children[0])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/GeoSameLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeoSameLogicalFunction.cpp new file mode 100644 index 0000000000..658068a60c --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/GeoSameLogicalFunction.cpp @@ -0,0 +1,98 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +GeoSameLogicalFunction::GeoSameLogicalFunction(LogicalFunction wkt1, LogicalFunction wkt2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(2); + parameters.push_back(std::move(wkt1)); + parameters.push_back(std::move(wkt2)); +} + +DataType GeoSameLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction GeoSameLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector GeoSameLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction GeoSameLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 2, + "GeoSameLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view GeoSameLogicalFunction::getType() const { return NAME; } + +bool GeoSameLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string GeoSameLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction GeoSameLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(2); + c.emplace_back(parameters[0].withInferredDataType(schema)); + c.emplace_back(parameters[1].withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "wkt1 must be VARSIZED"); + INVARIANT(c[1].getDataType().isType(DataType::Type::VARSIZED), "wkt2 must be VARSIZED"); + return withChildren(c); +} + +SerializableFunction GeoSameLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeoSameLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 2, + "GeoSameLogicalFunction requires 2 children but got {}", + arguments.children.size()); + return GeoSameLogicalFunction(std::move(arguments.children[0]), + std::move(arguments.children[1])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/GeoSridLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeoSridLogicalFunction.cpp new file mode 100644 index 0000000000..a98433ec51 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/GeoSridLogicalFunction.cpp @@ -0,0 +1,94 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +GeoSridLogicalFunction::GeoSridLogicalFunction(LogicalFunction wkt) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(1); + parameters.push_back(std::move(wkt)); +} + +DataType GeoSridLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction GeoSridLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector GeoSridLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction GeoSridLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 1, + "GeoSridLogicalFunction requires 1 child, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view GeoSridLogicalFunction::getType() const { return NAME; } + +bool GeoSridLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string GeoSridLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction GeoSridLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(1); + c.emplace_back(parameters[0].withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "wkt must be VARSIZED"); + return withChildren(c); +} + +SerializableFunction GeoSridLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeoSridLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 1, + "GeoSridLogicalFunction requires 1 child but got {}", + arguments.children.size()); + return GeoSridLogicalFunction(std::move(arguments.children[0])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/GeogDistanceLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeogDistanceLogicalFunction.cpp new file mode 100644 index 0000000000..ac2b16b3f0 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/GeogDistanceLogicalFunction.cpp @@ -0,0 +1,98 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +GeogDistanceLogicalFunction::GeogDistanceLogicalFunction(LogicalFunction wkt1, LogicalFunction wkt2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(2); + parameters.push_back(std::move(wkt1)); + parameters.push_back(std::move(wkt2)); +} + +DataType GeogDistanceLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction GeogDistanceLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector GeogDistanceLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction GeogDistanceLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 2, + "GeogDistanceLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view GeogDistanceLogicalFunction::getType() const { return NAME; } + +bool GeogDistanceLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string GeogDistanceLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction GeogDistanceLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(2); + c.emplace_back(parameters[0].withInferredDataType(schema)); + c.emplace_back(parameters[1].withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "wkt1 must be VARSIZED"); + INVARIANT(c[1].getDataType().isType(DataType::Type::VARSIZED), "wkt2 must be VARSIZED"); + return withChildren(c); +} + +SerializableFunction GeogDistanceLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeogDistanceLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 2, + "GeogDistanceLogicalFunction requires 2 children but got {}", + arguments.children.size()); + return GeogDistanceLogicalFunction(std::move(arguments.children[0]), + std::move(arguments.children[1])); +} + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeoEqualsPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeoEqualsPhysicalFunction.hpp new file mode 100644 index 0000000000..c3f9b3222a --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/GeoEqualsPhysicalFunction.hpp @@ -0,0 +1,34 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class GeoEqualsPhysicalFunction : public PhysicalFunctionConcept { +public: + GeoEqualsPhysicalFunction(PhysicalFunction wkt1, PhysicalFunction wkt2); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeoIsUnitaryPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeoIsUnitaryPhysicalFunction.hpp new file mode 100644 index 0000000000..ed45b95057 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/GeoIsUnitaryPhysicalFunction.hpp @@ -0,0 +1,34 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class GeoIsUnitaryPhysicalFunction : public PhysicalFunctionConcept { +public: + explicit GeoIsUnitaryPhysicalFunction(PhysicalFunction wkt); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeoNumGeosPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeoNumGeosPhysicalFunction.hpp new file mode 100644 index 0000000000..98f5925b9b --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/GeoNumGeosPhysicalFunction.hpp @@ -0,0 +1,34 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class GeoNumGeosPhysicalFunction : public PhysicalFunctionConcept { +public: + explicit GeoNumGeosPhysicalFunction(PhysicalFunction wkt); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeoNumPointsPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeoNumPointsPhysicalFunction.hpp new file mode 100644 index 0000000000..d3f0c444a2 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/GeoNumPointsPhysicalFunction.hpp @@ -0,0 +1,34 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class GeoNumPointsPhysicalFunction : public PhysicalFunctionConcept { +public: + explicit GeoNumPointsPhysicalFunction(PhysicalFunction wkt); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeoSamePhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeoSamePhysicalFunction.hpp new file mode 100644 index 0000000000..a2053e8731 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/GeoSamePhysicalFunction.hpp @@ -0,0 +1,34 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class GeoSamePhysicalFunction : public PhysicalFunctionConcept { +public: + GeoSamePhysicalFunction(PhysicalFunction wkt1, PhysicalFunction wkt2); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeoSridPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeoSridPhysicalFunction.hpp new file mode 100644 index 0000000000..3e452c1ec7 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/GeoSridPhysicalFunction.hpp @@ -0,0 +1,34 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class GeoSridPhysicalFunction : public PhysicalFunctionConcept { +public: + explicit GeoSridPhysicalFunction(PhysicalFunction wkt); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeogDistancePhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeogDistancePhysicalFunction.hpp new file mode 100644 index 0000000000..de46d9e42d --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/GeogDistancePhysicalFunction.hpp @@ -0,0 +1,34 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class GeogDistancePhysicalFunction : public PhysicalFunctionConcept { +public: + GeogDistancePhysicalFunction(PhysicalFunction wkt1, PhysicalFunction wkt2); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt index 655e504a7c..b7dc042dee 100644 --- a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt @@ -303,6 +303,13 @@ add_plugin(EtouchesTgeoGeo PhysicalFunction nes-physical-operators EtouchesTgeoG add_plugin(EcontainsTgeoGeo PhysicalFunction nes-physical-operators EcontainsTgeoGeoPhysicalFunction.cpp) add_plugin(AcontainsTgeoGeo PhysicalFunction nes-physical-operators AcontainsTgeoGeoPhysicalFunction.cpp) add_plugin(AtouchesTgeoGeo PhysicalFunction nes-physical-operators AtouchesTgeoGeoPhysicalFunction.cpp) +add_plugin(GeoNumPoints PhysicalFunction nes-physical-operators GeoNumPointsPhysicalFunction.cpp) +add_plugin(GeoNumGeos PhysicalFunction nes-physical-operators GeoNumGeosPhysicalFunction.cpp) +add_plugin(GeoSrid PhysicalFunction nes-physical-operators GeoSridPhysicalFunction.cpp) +add_plugin(GeoIsUnitary PhysicalFunction nes-physical-operators GeoIsUnitaryPhysicalFunction.cpp) +add_plugin(GeoEquals PhysicalFunction nes-physical-operators GeoEqualsPhysicalFunction.cpp) +add_plugin(GeoSame PhysicalFunction nes-physical-operators GeoSamePhysicalFunction.cpp) +add_plugin(GeogDistance PhysicalFunction nes-physical-operators GeogDistancePhysicalFunction.cpp) add_plugin(GeomIntersects2d PhysicalFunction nes-physical-operators GeomIntersects2dPhysicalFunction.cpp) add_plugin(GeomDwithin2d PhysicalFunction nes-physical-operators GeomDwithin2dPhysicalFunction.cpp) add_plugin(GeomContains PhysicalFunction nes-physical-operators GeomContainsPhysicalFunction.cpp) diff --git a/nes-physical-operators/src/Functions/Meos/GeoEqualsPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeoEqualsPhysicalFunction.cpp new file mode 100644 index 0000000000..6738dce23f --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/GeoEqualsPhysicalFunction.cpp @@ -0,0 +1,78 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +GeoEqualsPhysicalFunction::GeoEqualsPhysicalFunction(PhysicalFunction wkt1, PhysicalFunction wkt2) +{ + paramFns.reserve(2); + paramFns.push_back(std::move(wkt1)); + paramFns.push_back(std::move(wkt2)); +} + +VarVal GeoEqualsPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto s1 = paramFns[0].execute(record, arena).cast(); + auto s2 = paramFns[1].execute(record, arena).cast(); + + const auto result = nautilus::invoke( + +[](const char* w1, uint32_t w1sz, const char* w2, uint32_t w2sz) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string s1(w1, w1sz); + std::string s2(w2, w2sz); + GSERIALIZED* gs1 = geom_in(s1.c_str(), -1); + if (!gs1) return 0.0; + GSERIALIZED* gs2 = geom_in(s2.c_str(), -1); + if (!gs2) { free(gs1); return 0.0; } + double r = (double)geo_equals(gs1, gs2); + free(gs1); free(gs2); + return r; + } catch (const std::exception&) { return 0.0; } + }, + s1, s2); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterGeoEqualsPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 2, + "GeoEqualsPhysicalFunction requires 2 children but got {}", + arguments.childFunctions.size()); + return GeoEqualsPhysicalFunction(std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/GeoIsUnitaryPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeoIsUnitaryPhysicalFunction.cpp new file mode 100644 index 0000000000..703403de4d --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/GeoIsUnitaryPhysicalFunction.cpp @@ -0,0 +1,72 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +GeoIsUnitaryPhysicalFunction::GeoIsUnitaryPhysicalFunction(PhysicalFunction wkt) +{ + paramFns.reserve(1); + paramFns.push_back(std::move(wkt)); +} + +VarVal GeoIsUnitaryPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto s1 = paramFns[0].execute(record, arena).cast(); + + const auto result = nautilus::invoke( + +[](const char* w1, uint32_t w1sz) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string s1(w1, w1sz); + GSERIALIZED* gs1 = geom_in(s1.c_str(), -1); + if (!gs1) return 0.0; + double r = geo_is_unitary(gs1) ? 1.0 : 0.0; + free(gs1); + return r; + } catch (const std::exception&) { return 0.0; } + }, + s1); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterGeoIsUnitaryPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 1, + "GeoIsUnitaryPhysicalFunction requires 1 child but got {}", + arguments.childFunctions.size()); + return GeoIsUnitaryPhysicalFunction(std::move(arguments.childFunctions[0])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/GeoNumGeosPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeoNumGeosPhysicalFunction.cpp new file mode 100644 index 0000000000..fe4373d05e --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/GeoNumGeosPhysicalFunction.cpp @@ -0,0 +1,72 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +GeoNumGeosPhysicalFunction::GeoNumGeosPhysicalFunction(PhysicalFunction wkt) +{ + paramFns.reserve(1); + paramFns.push_back(std::move(wkt)); +} + +VarVal GeoNumGeosPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto s1 = paramFns[0].execute(record, arena).cast(); + + const auto result = nautilus::invoke( + +[](const char* w1, uint32_t w1sz) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string s1(w1, w1sz); + GSERIALIZED* gs1 = geom_in(s1.c_str(), -1); + if (!gs1) return 0.0; + double r = (double)geo_num_geos(gs1); + free(gs1); + return r; + } catch (const std::exception&) { return 0.0; } + }, + s1); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterGeoNumGeosPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 1, + "GeoNumGeosPhysicalFunction requires 1 child but got {}", + arguments.childFunctions.size()); + return GeoNumGeosPhysicalFunction(std::move(arguments.childFunctions[0])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/GeoNumPointsPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeoNumPointsPhysicalFunction.cpp new file mode 100644 index 0000000000..bee045998f --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/GeoNumPointsPhysicalFunction.cpp @@ -0,0 +1,72 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +GeoNumPointsPhysicalFunction::GeoNumPointsPhysicalFunction(PhysicalFunction wkt) +{ + paramFns.reserve(1); + paramFns.push_back(std::move(wkt)); +} + +VarVal GeoNumPointsPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto s1 = paramFns[0].execute(record, arena).cast(); + + const auto result = nautilus::invoke( + +[](const char* w1, uint32_t w1sz) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string s1(w1, w1sz); + GSERIALIZED* gs1 = geom_in(s1.c_str(), -1); + if (!gs1) return 0.0; + double r = (double)geo_num_points(gs1); + free(gs1); + return r; + } catch (const std::exception&) { return 0.0; } + }, + s1); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterGeoNumPointsPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 1, + "GeoNumPointsPhysicalFunction requires 1 child but got {}", + arguments.childFunctions.size()); + return GeoNumPointsPhysicalFunction(std::move(arguments.childFunctions[0])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/GeoSamePhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeoSamePhysicalFunction.cpp new file mode 100644 index 0000000000..3bf6a98d77 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/GeoSamePhysicalFunction.cpp @@ -0,0 +1,78 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +GeoSamePhysicalFunction::GeoSamePhysicalFunction(PhysicalFunction wkt1, PhysicalFunction wkt2) +{ + paramFns.reserve(2); + paramFns.push_back(std::move(wkt1)); + paramFns.push_back(std::move(wkt2)); +} + +VarVal GeoSamePhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto s1 = paramFns[0].execute(record, arena).cast(); + auto s2 = paramFns[1].execute(record, arena).cast(); + + const auto result = nautilus::invoke( + +[](const char* w1, uint32_t w1sz, const char* w2, uint32_t w2sz) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string s1(w1, w1sz); + std::string s2(w2, w2sz); + GSERIALIZED* gs1 = geom_in(s1.c_str(), -1); + if (!gs1) return 0.0; + GSERIALIZED* gs2 = geom_in(s2.c_str(), -1); + if (!gs2) { free(gs1); return 0.0; } + double r = geo_same(gs1, gs2) ? 1.0 : 0.0; + free(gs1); free(gs2); + return r; + } catch (const std::exception&) { return 0.0; } + }, + s1, s2); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterGeoSamePhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 2, + "GeoSamePhysicalFunction requires 2 children but got {}", + arguments.childFunctions.size()); + return GeoSamePhysicalFunction(std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/GeoSridPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeoSridPhysicalFunction.cpp new file mode 100644 index 0000000000..4da9726a29 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/GeoSridPhysicalFunction.cpp @@ -0,0 +1,72 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +GeoSridPhysicalFunction::GeoSridPhysicalFunction(PhysicalFunction wkt) +{ + paramFns.reserve(1); + paramFns.push_back(std::move(wkt)); +} + +VarVal GeoSridPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto s1 = paramFns[0].execute(record, arena).cast(); + + const auto result = nautilus::invoke( + +[](const char* w1, uint32_t w1sz) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string s1(w1, w1sz); + GSERIALIZED* gs1 = geom_in(s1.c_str(), -1); + if (!gs1) return 0.0; + double r = (double)geo_srid(gs1); + free(gs1); + return r; + } catch (const std::exception&) { return 0.0; } + }, + s1); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterGeoSridPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 1, + "GeoSridPhysicalFunction requires 1 child but got {}", + arguments.childFunctions.size()); + return GeoSridPhysicalFunction(std::move(arguments.childFunctions[0])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/GeogDistancePhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeogDistancePhysicalFunction.cpp new file mode 100644 index 0000000000..552fff69e4 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/GeogDistancePhysicalFunction.cpp @@ -0,0 +1,78 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +GeogDistancePhysicalFunction::GeogDistancePhysicalFunction(PhysicalFunction wkt1, PhysicalFunction wkt2) +{ + paramFns.reserve(2); + paramFns.push_back(std::move(wkt1)); + paramFns.push_back(std::move(wkt2)); +} + +VarVal GeogDistancePhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto s1 = paramFns[0].execute(record, arena).cast(); + auto s2 = paramFns[1].execute(record, arena).cast(); + + const auto result = nautilus::invoke( + +[](const char* w1, uint32_t w1sz, const char* w2, uint32_t w2sz) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string s1(w1, w1sz); + std::string s2(w2, w2sz); + GSERIALIZED* gs1 = geom_in(s1.c_str(), -1); + if (!gs1) return 0.0; + GSERIALIZED* gs2 = geom_in(s2.c_str(), -1); + if (!gs2) { free(gs1); return 0.0; } + double r = geog_distance(gs1, gs2); + free(gs1); free(gs2); + return r; + } catch (const std::exception&) { return 0.0; } + }, + s1, s2); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterGeogDistancePhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 2, + "GeogDistancePhysicalFunction requires 2 children but got {}", + arguments.childFunctions.size()); + return GeogDistancePhysicalFunction(std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1])); +} + +} // namespace NES diff --git a/nes-sql-parser/AntlrSQL.g4 b/nes-sql-parser/AntlrSQL.g4 index 3601f338f6..5904cdc389 100644 --- a/nes-sql-parser/AntlrSQL.g4 +++ b/nes-sql-parser/AntlrSQL.g4 @@ -295,7 +295,7 @@ timeUnit: MS timestampParameter: name=identifier; -functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT | TGE_TTEXT_TEXT | TGE_TEXT_TTEXT | TGT_TTEXT_TEXT | TGT_TEXT_TTEXT | TLE_TTEXT_TEXT | TLE_TEXT_TTEXT | TLT_TTEXT_TEXT | TLT_TEXT_TTEXT | TTEXT_UPPER | TTEXT_LOWER | TTEXT_INITCAP | TEXTCAT_TTEXT_TEXT | TEXTCAT_TEXT_TTEXT | TEXTCAT_TTEXT_TTEXT | GEOM_LENGTH | GEOM_PERIMETER | GEOM_AZIMUTH | GEOG_AREA | GEOG_LENGTH | GEOG_PERIMETER | GEOM_IS_EMPTY | AINTERSECTS_TGEO_GEO | ACOVERS_TGEO_GEO | ADISJOINT_TGEO_GEO | ADWITHIN_TGEO_GEO | EINTERSECTS_TGEO_GEO | ETOUCHES_TGEO_GEO | ECONTAINS_TGEO_GEO | ACONTAINS_TGEO_GEO | ATOUCHES_TGEO_GEO | GEOM_INTERSECTS2D | GEOM_DWITHIN2D | GEOM_CONTAINS | GEOM_DISJOINT2D | GEOM_COVERS | GEOM_TOUCHES | GEOM_INTERSECTS3D | GEOM_DWITHIN3D | GEOM_DISTANCE2D | GEOM_DISTANCE3D; +functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT | TGE_TTEXT_TEXT | TGE_TEXT_TTEXT | TGT_TTEXT_TEXT | TGT_TEXT_TTEXT | TLE_TTEXT_TEXT | TLE_TEXT_TTEXT | TLT_TTEXT_TEXT | TLT_TEXT_TTEXT | TTEXT_UPPER | TTEXT_LOWER | TTEXT_INITCAP | TEXTCAT_TTEXT_TEXT | TEXTCAT_TEXT_TTEXT | TEXTCAT_TTEXT_TTEXT | GEOM_LENGTH | GEOM_PERIMETER | GEOM_AZIMUTH | GEOG_AREA | GEOG_LENGTH | GEOG_PERIMETER | GEOM_IS_EMPTY | AINTERSECTS_TGEO_GEO | ACOVERS_TGEO_GEO | ADISJOINT_TGEO_GEO | ADWITHIN_TGEO_GEO | EINTERSECTS_TGEO_GEO | ETOUCHES_TGEO_GEO | ECONTAINS_TGEO_GEO | ACONTAINS_TGEO_GEO | ATOUCHES_TGEO_GEO | GEO_NUM_POINTS | GEO_NUM_GEOS | GEO_SRID | GEO_IS_UNITARY | GEO_EQUALS | GEO_SAME | GEOG_DISTANCE | GEOM_INTERSECTS2D | GEOM_DWITHIN2D | GEOM_CONTAINS | GEOM_DISJOINT2D | GEOM_COVERS | GEOM_TOUCHES | GEOM_INTERSECTS3D | GEOM_DWITHIN3D | GEOM_DISTANCE2D | GEOM_DISTANCE3D; sinkClause: INTO sink (',' sink)*; @@ -774,6 +774,13 @@ ETOUCHES_TGEO_GEO: 'ETOUCHES_TGEO_GEO' | 'etouches_tgeo_geo'; ECONTAINS_TGEO_GEO: 'ECONTAINS_TGEO_GEO' | 'econtains_tgeo_geo'; ACONTAINS_TGEO_GEO: 'ACONTAINS_TGEO_GEO' | 'acontains_tgeo_geo'; ATOUCHES_TGEO_GEO: 'ATOUCHES_TGEO_GEO' | 'atouches_tgeo_geo'; +GEO_NUM_POINTS: 'GEO_NUM_POINTS' | 'geo_num_points'; +GEO_NUM_GEOS: 'GEO_NUM_GEOS' | 'geo_num_geos'; +GEO_SRID: 'GEO_SRID' | 'geo_srid'; +GEO_IS_UNITARY: 'GEO_IS_UNITARY' | 'geo_is_unitary'; +GEO_EQUALS: 'GEO_EQUALS' | 'geo_equals'; +GEO_SAME: 'GEO_SAME' | 'geo_same'; +GEOG_DISTANCE: 'GEOG_DISTANCE' | 'geog_distance'; GEOM_INTERSECTS2D: 'GEOM_INTERSECTS2D' | 'geom_intersects2d'; GEOM_DWITHIN2D: 'GEOM_DWITHIN2D' | 'geom_dwithin2d'; GEOM_CONTAINS: 'GEOM_CONTAINS' | 'geom_contains'; diff --git a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp index aa48a4cd48..a1f0cd3e6b 100644 --- a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp +++ b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp @@ -355,6 +355,13 @@ #include #include #include +#include +#include +#include +#include +#include +#include +#include #include #include #include @@ -8942,6 +8949,65 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont std::move(arg2), std::move(arg3))); } /* END CODEGEN PARSER GLUE: ATOUCHES_TGEO_GEO */ + case AntlrSQLParser::GEO_NUM_POINTS: { + PRECONDITION(ctx->functionParam().size() == 1, + "GeoNumPoints requires 1 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + return LogicalFunction(GeoNumPointsLogicalFunction(std::move(arg0))); + } + /* END CODEGEN PARSER GLUE: GEO_NUM_POINTS */ + case AntlrSQLParser::GEO_NUM_GEOS: { + PRECONDITION(ctx->functionParam().size() == 1, + "GeoNumGeos requires 1 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + return LogicalFunction(GeoNumGeosLogicalFunction(std::move(arg0))); + } + /* END CODEGEN PARSER GLUE: GEO_NUM_GEOS */ + case AntlrSQLParser::GEO_SRID: { + PRECONDITION(ctx->functionParam().size() == 1, + "GeoSrid requires 1 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + return LogicalFunction(GeoSridLogicalFunction(std::move(arg0))); + } + /* END CODEGEN PARSER GLUE: GEO_SRID */ + case AntlrSQLParser::GEO_IS_UNITARY: { + PRECONDITION(ctx->functionParam().size() == 1, + "GeoIsUnitary requires 1 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + return LogicalFunction(GeoIsUnitaryLogicalFunction(std::move(arg0))); + } + /* END CODEGEN PARSER GLUE: GEO_IS_UNITARY */ + case AntlrSQLParser::GEO_EQUALS: { + PRECONDITION(ctx->functionParam().size() == 2, + "GeoEquals requires 2 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + return LogicalFunction(GeoEqualsLogicalFunction(std::move(arg0), std::move(arg1))); + } + /* END CODEGEN PARSER GLUE: GEO_EQUALS */ + case AntlrSQLParser::GEO_SAME: { + PRECONDITION(ctx->functionParam().size() == 2, + "GeoSame requires 2 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + return LogicalFunction(GeoSameLogicalFunction(std::move(arg0), std::move(arg1))); + } + /* END CODEGEN PARSER GLUE: GEO_SAME */ + case AntlrSQLParser::GEOG_DISTANCE: { + PRECONDITION(ctx->functionParam().size() == 2, + "GeogDistance requires 2 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + return LogicalFunction(GeogDistanceLogicalFunction(std::move(arg0), std::move(arg1))); + } + /* END CODEGEN PARSER GLUE: GEOG_DISTANCE */ /* END CODEGEN PARSER GLUE: GEOM_INTERSECTS2D */ case AntlrSQLParser::GEOM_DWITHIN2D: { PRECONDITION(ctx->functionParam().size() == 3, From 843e61c8b4abd025542cc4c171dd084e5e286957 Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Mon, 15 Jun 2026 00:13:39 +0200 Subject: [PATCH 54/96] feat(meos): add NAD_TGEO_GEO nearest-approach distance NES operator (W106) Wires nad_tgeo_geo as a 4-arg (lon:FLOAT64, lat:FLOAT64, ts:UINT64, wkt:VARCHAR) -> FLOAT64 NES operator backed by the MEOS kernel. --- .../Meos/NadTgeoGeoLogicalFunction.hpp | 51 +++++++++ .../src/Functions/Meos/CMakeLists.txt | 1 + .../Meos/NadTgeoGeoLogicalFunction.cpp | 107 ++++++++++++++++++ .../Meos/NadTgeoGeoPhysicalFunction.hpp | 35 ++++++ .../src/Functions/Meos/CMakeLists.txt | 1 + .../Meos/NadTgeoGeoPhysicalFunction.cpp | 87 ++++++++++++++ nes-sql-parser/AntlrSQL.g4 | 3 +- .../src/AntlrSQLQueryPlanCreator.cpp | 12 ++ 8 files changed, 296 insertions(+), 1 deletion(-) create mode 100644 nes-logical-operators/include/Functions/Meos/NadTgeoGeoLogicalFunction.hpp create mode 100644 nes-logical-operators/src/Functions/Meos/NadTgeoGeoLogicalFunction.cpp create mode 100644 nes-physical-operators/include/Functions/Meos/NadTgeoGeoPhysicalFunction.hpp create mode 100644 nes-physical-operators/src/Functions/Meos/NadTgeoGeoPhysicalFunction.cpp diff --git a/nes-logical-operators/include/Functions/Meos/NadTgeoGeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/NadTgeoGeoLogicalFunction.hpp new file mode 100644 index 0000000000..7df28e013d --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/NadTgeoGeoLogicalFunction.hpp @@ -0,0 +1,51 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns the nearest approach distance between a temporal geometry and a static geometry. + * + * Args: (lon:FLOAT64, lat:FLOAT64, ts:UINT64, wkt:VARCHAR) -> FLOAT64. + */ +class NadTgeoGeoLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "NadTgeoGeo"; + + NadTgeoGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, + LogicalFunction ts, LogicalFunction wkt); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt index 0314be0a6d..84463aa354 100644 --- a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt @@ -311,6 +311,7 @@ add_plugin(GeoIsUnitary LogicalFunction nes-logical-operators GeoIsUnitaryLogica add_plugin(GeoEquals LogicalFunction nes-logical-operators GeoEqualsLogicalFunction.cpp) add_plugin(GeoSame LogicalFunction nes-logical-operators GeoSameLogicalFunction.cpp) add_plugin(GeogDistance LogicalFunction nes-logical-operators GeogDistanceLogicalFunction.cpp) +add_plugin(NadTgeoGeo LogicalFunction nes-logical-operators NadTgeoGeoLogicalFunction.cpp) add_plugin(GeomIntersects2d LogicalFunction nes-logical-operators GeomIntersects2dLogicalFunction.cpp) add_plugin(GeomDwithin2d LogicalFunction nes-logical-operators GeomDwithin2dLogicalFunction.cpp) add_plugin(GeomContains LogicalFunction nes-logical-operators GeomContainsLogicalFunction.cpp) diff --git a/nes-logical-operators/src/Functions/Meos/NadTgeoGeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/NadTgeoGeoLogicalFunction.cpp new file mode 100644 index 0000000000..406db3c77f --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/NadTgeoGeoLogicalFunction.cpp @@ -0,0 +1,107 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +NadTgeoGeoLogicalFunction::NadTgeoGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, + LogicalFunction ts, LogicalFunction wkt) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(4); + parameters.push_back(std::move(lon)); + parameters.push_back(std::move(lat)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(wkt)); +} + +DataType NadTgeoGeoLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction NadTgeoGeoLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector NadTgeoGeoLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction NadTgeoGeoLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 4, + "NadTgeoGeoLogicalFunction requires 4 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view NadTgeoGeoLogicalFunction::getType() const { return NAME; } + +bool NadTgeoGeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string NadTgeoGeoLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction NadTgeoGeoLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(4); + c.emplace_back(parameters[0].withInferredDataType(schema)); + c.emplace_back(parameters[1].withInferredDataType(schema)); + c.emplace_back(parameters[2].withInferredDataType(schema)); + c.emplace_back(parameters[3].withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon must be FLOAT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::VARSIZED),"wkt must be VARSIZED"); + return withChildren(c); +} + +SerializableFunction NadTgeoGeoLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterNadTgeoGeoLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 4, + "NadTgeoGeoLogicalFunction requires 4 children but got {}", + arguments.children.size()); + return NadTgeoGeoLogicalFunction(std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3])); +} + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/NadTgeoGeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/NadTgeoGeoPhysicalFunction.hpp new file mode 100644 index 0000000000..529a874595 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/NadTgeoGeoPhysicalFunction.hpp @@ -0,0 +1,35 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class NadTgeoGeoPhysicalFunction : public PhysicalFunctionConcept { +public: + NadTgeoGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, + PhysicalFunction ts, PhysicalFunction wkt); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt index b7dc042dee..20c731a336 100644 --- a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt @@ -310,6 +310,7 @@ add_plugin(GeoIsUnitary PhysicalFunction nes-physical-operators GeoIsUnitaryPhys add_plugin(GeoEquals PhysicalFunction nes-physical-operators GeoEqualsPhysicalFunction.cpp) add_plugin(GeoSame PhysicalFunction nes-physical-operators GeoSamePhysicalFunction.cpp) add_plugin(GeogDistance PhysicalFunction nes-physical-operators GeogDistancePhysicalFunction.cpp) +add_plugin(NadTgeoGeo PhysicalFunction nes-physical-operators NadTgeoGeoPhysicalFunction.cpp) add_plugin(GeomIntersects2d PhysicalFunction nes-physical-operators GeomIntersects2dPhysicalFunction.cpp) add_plugin(GeomDwithin2d PhysicalFunction nes-physical-operators GeomDwithin2dPhysicalFunction.cpp) add_plugin(GeomContains PhysicalFunction nes-physical-operators GeomContainsPhysicalFunction.cpp) diff --git a/nes-physical-operators/src/Functions/Meos/NadTgeoGeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/NadTgeoGeoPhysicalFunction.cpp new file mode 100644 index 0000000000..1990fd476c --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/NadTgeoGeoPhysicalFunction.cpp @@ -0,0 +1,87 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +NadTgeoGeoPhysicalFunction::NadTgeoGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, + PhysicalFunction ts, PhysicalFunction wkt) +{ + paramFns.reserve(4); + paramFns.push_back(std::move(lon)); + paramFns.push_back(std::move(lat)); + paramFns.push_back(std::move(ts)); + paramFns.push_back(std::move(wkt)); +} + +VarVal NadTgeoGeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto lon = paramFns[0].execute(record, arena).cast(); + auto lat = paramFns[1].execute(record, arena).cast(); + auto ts = paramFns[2].execute(record, arena).cast(); + auto wkt = paramFns[3].execute(record, arena).cast(); + + const auto result = nautilus::invoke( + +[](double lon, double lat, uint64_t ts, + const char* w, uint32_t wsz) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string wktStr(w, wsz); + std::string tgeoWkt = fmt::format("SRID=4326;POINT({},{})@{}", lon, lat, ts); + Temporal* tgeo = tgeompoint_in(tgeoWkt.c_str()); + if (!tgeo) return 0.0; + GSERIALIZED* gs = geom_in(wktStr.c_str(), -1); + if (!gs) { free(tgeo); return 0.0; } + double r = nad_tgeo_geo(tgeo, gs); + free(tgeo); free(gs); + return r; + } catch (const std::exception&) { return 0.0; } + }, + lon, lat, ts, wkt); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterNadTgeoGeoPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 4, + "NadTgeoGeoPhysicalFunction requires 4 children but got {}", + arguments.childFunctions.size()); + return NadTgeoGeoPhysicalFunction(std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3])); +} + +} // namespace NES diff --git a/nes-sql-parser/AntlrSQL.g4 b/nes-sql-parser/AntlrSQL.g4 index 5904cdc389..4e5851f026 100644 --- a/nes-sql-parser/AntlrSQL.g4 +++ b/nes-sql-parser/AntlrSQL.g4 @@ -295,7 +295,7 @@ timeUnit: MS timestampParameter: name=identifier; -functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT | TGE_TTEXT_TEXT | TGE_TEXT_TTEXT | TGT_TTEXT_TEXT | TGT_TEXT_TTEXT | TLE_TTEXT_TEXT | TLE_TEXT_TTEXT | TLT_TTEXT_TEXT | TLT_TEXT_TTEXT | TTEXT_UPPER | TTEXT_LOWER | TTEXT_INITCAP | TEXTCAT_TTEXT_TEXT | TEXTCAT_TEXT_TTEXT | TEXTCAT_TTEXT_TTEXT | GEOM_LENGTH | GEOM_PERIMETER | GEOM_AZIMUTH | GEOG_AREA | GEOG_LENGTH | GEOG_PERIMETER | GEOM_IS_EMPTY | AINTERSECTS_TGEO_GEO | ACOVERS_TGEO_GEO | ADISJOINT_TGEO_GEO | ADWITHIN_TGEO_GEO | EINTERSECTS_TGEO_GEO | ETOUCHES_TGEO_GEO | ECONTAINS_TGEO_GEO | ACONTAINS_TGEO_GEO | ATOUCHES_TGEO_GEO | GEO_NUM_POINTS | GEO_NUM_GEOS | GEO_SRID | GEO_IS_UNITARY | GEO_EQUALS | GEO_SAME | GEOG_DISTANCE | GEOM_INTERSECTS2D | GEOM_DWITHIN2D | GEOM_CONTAINS | GEOM_DISJOINT2D | GEOM_COVERS | GEOM_TOUCHES | GEOM_INTERSECTS3D | GEOM_DWITHIN3D | GEOM_DISTANCE2D | GEOM_DISTANCE3D; +functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT | TGE_TTEXT_TEXT | TGE_TEXT_TTEXT | TGT_TTEXT_TEXT | TGT_TEXT_TTEXT | TLE_TTEXT_TEXT | TLE_TEXT_TTEXT | TLT_TTEXT_TEXT | TLT_TEXT_TTEXT | TTEXT_UPPER | TTEXT_LOWER | TTEXT_INITCAP | TEXTCAT_TTEXT_TEXT | TEXTCAT_TEXT_TTEXT | TEXTCAT_TTEXT_TTEXT | GEOM_LENGTH | GEOM_PERIMETER | GEOM_AZIMUTH | GEOG_AREA | GEOG_LENGTH | GEOG_PERIMETER | GEOM_IS_EMPTY | AINTERSECTS_TGEO_GEO | ACOVERS_TGEO_GEO | ADISJOINT_TGEO_GEO | ADWITHIN_TGEO_GEO | EINTERSECTS_TGEO_GEO | ETOUCHES_TGEO_GEO | ECONTAINS_TGEO_GEO | ACONTAINS_TGEO_GEO | ATOUCHES_TGEO_GEO | GEO_NUM_POINTS | GEO_NUM_GEOS | GEO_SRID | GEO_IS_UNITARY | GEO_EQUALS | GEO_SAME | GEOG_DISTANCE | NAD_TGEO_GEO | GEOM_INTERSECTS2D | GEOM_DWITHIN2D | GEOM_CONTAINS | GEOM_DISJOINT2D | GEOM_COVERS | GEOM_TOUCHES | GEOM_INTERSECTS3D | GEOM_DWITHIN3D | GEOM_DISTANCE2D | GEOM_DISTANCE3D; sinkClause: INTO sink (',' sink)*; @@ -781,6 +781,7 @@ GEO_IS_UNITARY: 'GEO_IS_UNITARY' | 'geo_is_unitary'; GEO_EQUALS: 'GEO_EQUALS' | 'geo_equals'; GEO_SAME: 'GEO_SAME' | 'geo_same'; GEOG_DISTANCE: 'GEOG_DISTANCE' | 'geog_distance'; +NAD_TGEO_GEO: 'NAD_TGEO_GEO' | 'nad_tgeo_geo'; GEOM_INTERSECTS2D: 'GEOM_INTERSECTS2D' | 'geom_intersects2d'; GEOM_DWITHIN2D: 'GEOM_DWITHIN2D' | 'geom_dwithin2d'; GEOM_CONTAINS: 'GEOM_CONTAINS' | 'geom_contains'; diff --git a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp index a1f0cd3e6b..9cab82372f 100644 --- a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp +++ b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp @@ -362,6 +362,7 @@ #include #include #include +#include #include #include #include @@ -9008,6 +9009,17 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont return LogicalFunction(GeogDistanceLogicalFunction(std::move(arg0), std::move(arg1))); } /* END CODEGEN PARSER GLUE: GEOG_DISTANCE */ + case AntlrSQLParser::NAD_TGEO_GEO: { + PRECONDITION(ctx->functionParam().size() == 4, + "NadTgeoGeo requires 4 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + return LogicalFunction(NadTgeoGeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3))); + } + /* END CODEGEN PARSER GLUE: NAD_TGEO_GEO */ /* END CODEGEN PARSER GLUE: GEOM_INTERSECTS2D */ case AntlrSQLParser::GEOM_DWITHIN2D: { PRECONDITION(ctx->functionParam().size() == 3, From 4ba2b7486a5d026d4cd6bb6aecd94b0c2210b1f7 Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Mon, 15 Jun 2026 00:13:39 +0200 Subject: [PATCH 55/96] feat(meos): add EVER/ALWAYS_EQ/NE_TGEO_GEO NES operators (W107) Wires ever_eq_tgeo_geo, ever_ne_tgeo_geo, always_eq_tgeo_geo, and always_ne_tgeo_geo as 4-arg (lon:FLOAT64, lat:FLOAT64, ts:UINT64, wkt:VARCHAR) -> FLOAT64 NES operators backed by the MEOS kernel. --- .../Meos/AlwaysEqTgeoGeoLogicalFunction.hpp | 51 +++++++++ .../Meos/AlwaysNeTgeoGeoLogicalFunction.hpp | 51 +++++++++ .../Meos/EverEqTgeoGeoLogicalFunction.hpp | 51 +++++++++ .../Meos/EverNeTgeoGeoLogicalFunction.hpp | 51 +++++++++ .../Meos/AlwaysEqTgeoGeoLogicalFunction.cpp | 107 ++++++++++++++++++ .../Meos/AlwaysNeTgeoGeoLogicalFunction.cpp | 107 ++++++++++++++++++ .../src/Functions/Meos/CMakeLists.txt | 4 + .../Meos/EverEqTgeoGeoLogicalFunction.cpp | 107 ++++++++++++++++++ .../Meos/EverNeTgeoGeoLogicalFunction.cpp | 107 ++++++++++++++++++ .../Meos/AlwaysEqTgeoGeoPhysicalFunction.hpp | 35 ++++++ .../Meos/AlwaysNeTgeoGeoPhysicalFunction.hpp | 35 ++++++ .../Meos/EverEqTgeoGeoPhysicalFunction.hpp | 35 ++++++ .../Meos/EverNeTgeoGeoPhysicalFunction.hpp | 35 ++++++ .../Meos/AlwaysEqTgeoGeoPhysicalFunction.cpp | 87 ++++++++++++++ .../Meos/AlwaysNeTgeoGeoPhysicalFunction.cpp | 87 ++++++++++++++ .../src/Functions/Meos/CMakeLists.txt | 4 + .../Meos/EverEqTgeoGeoPhysicalFunction.cpp | 87 ++++++++++++++ .../Meos/EverNeTgeoGeoPhysicalFunction.cpp | 87 ++++++++++++++ nes-sql-parser/AntlrSQL.g4 | 6 +- .../src/AntlrSQLQueryPlanCreator.cpp | 48 ++++++++ 20 files changed, 1181 insertions(+), 1 deletion(-) create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysEqTgeoGeoLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysNeTgeoGeoLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverEqTgeoGeoLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverNeTgeoGeoLogicalFunction.hpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysEqTgeoGeoLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysNeTgeoGeoLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverEqTgeoGeoLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverNeTgeoGeoLogicalFunction.cpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysEqTgeoGeoPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysNeTgeoGeoPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverEqTgeoGeoPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverNeTgeoGeoPhysicalFunction.hpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysEqTgeoGeoPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysNeTgeoGeoPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverEqTgeoGeoPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverNeTgeoGeoPhysicalFunction.cpp diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysEqTgeoGeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysEqTgeoGeoLogicalFunction.hpp new file mode 100644 index 0000000000..82746232f1 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysEqTgeoGeoLogicalFunction.hpp @@ -0,0 +1,51 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if the temporal geometry is always equal to the static geometry. + * + * Args: (lon:FLOAT64, lat:FLOAT64, ts:UINT64, wkt:VARCHAR) -> FLOAT64. + */ +class AlwaysEqTgeoGeoLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysEqTgeoGeo"; + + AlwaysEqTgeoGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, + LogicalFunction ts, LogicalFunction wkt); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysNeTgeoGeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysNeTgeoGeoLogicalFunction.hpp new file mode 100644 index 0000000000..4e69287867 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysNeTgeoGeoLogicalFunction.hpp @@ -0,0 +1,51 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if the temporal geometry is always not equal to the static geometry. + * + * Args: (lon:FLOAT64, lat:FLOAT64, ts:UINT64, wkt:VARCHAR) -> FLOAT64. + */ +class AlwaysNeTgeoGeoLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysNeTgeoGeo"; + + AlwaysNeTgeoGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, + LogicalFunction ts, LogicalFunction wkt); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverEqTgeoGeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverEqTgeoGeoLogicalFunction.hpp new file mode 100644 index 0000000000..e1909cb418 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverEqTgeoGeoLogicalFunction.hpp @@ -0,0 +1,51 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if the temporal geometry is ever equal to the static geometry. + * + * Args: (lon:FLOAT64, lat:FLOAT64, ts:UINT64, wkt:VARCHAR) -> FLOAT64. + */ +class EverEqTgeoGeoLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverEqTgeoGeo"; + + EverEqTgeoGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, + LogicalFunction ts, LogicalFunction wkt); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverNeTgeoGeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverNeTgeoGeoLogicalFunction.hpp new file mode 100644 index 0000000000..1279c025bd --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverNeTgeoGeoLogicalFunction.hpp @@ -0,0 +1,51 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if the temporal geometry is ever not equal to the static geometry. + * + * Args: (lon:FLOAT64, lat:FLOAT64, ts:UINT64, wkt:VARCHAR) -> FLOAT64. + */ +class EverNeTgeoGeoLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverNeTgeoGeo"; + + EverNeTgeoGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, + LogicalFunction ts, LogicalFunction wkt); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysEqTgeoGeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysEqTgeoGeoLogicalFunction.cpp new file mode 100644 index 0000000000..34422460b8 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysEqTgeoGeoLogicalFunction.cpp @@ -0,0 +1,107 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AlwaysEqTgeoGeoLogicalFunction::AlwaysEqTgeoGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, + LogicalFunction ts, LogicalFunction wkt) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(4); + parameters.push_back(std::move(lon)); + parameters.push_back(std::move(lat)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(wkt)); +} + +DataType AlwaysEqTgeoGeoLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysEqTgeoGeoLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AlwaysEqTgeoGeoLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysEqTgeoGeoLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 4, + "AlwaysEqTgeoGeoLogicalFunction requires 4 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AlwaysEqTgeoGeoLogicalFunction::getType() const { return NAME; } + +bool AlwaysEqTgeoGeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AlwaysEqTgeoGeoLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction AlwaysEqTgeoGeoLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(4); + c.emplace_back(parameters[0].withInferredDataType(schema)); + c.emplace_back(parameters[1].withInferredDataType(schema)); + c.emplace_back(parameters[2].withInferredDataType(schema)); + c.emplace_back(parameters[3].withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon must be FLOAT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::VARSIZED),"wkt must be VARSIZED"); + return withChildren(c); +} + +SerializableFunction AlwaysEqTgeoGeoLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysEqTgeoGeoLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 4, + "AlwaysEqTgeoGeoLogicalFunction requires 4 children but got {}", + arguments.children.size()); + return AlwaysEqTgeoGeoLogicalFunction(std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysNeTgeoGeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysNeTgeoGeoLogicalFunction.cpp new file mode 100644 index 0000000000..e31d26ac03 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysNeTgeoGeoLogicalFunction.cpp @@ -0,0 +1,107 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AlwaysNeTgeoGeoLogicalFunction::AlwaysNeTgeoGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, + LogicalFunction ts, LogicalFunction wkt) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(4); + parameters.push_back(std::move(lon)); + parameters.push_back(std::move(lat)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(wkt)); +} + +DataType AlwaysNeTgeoGeoLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysNeTgeoGeoLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AlwaysNeTgeoGeoLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysNeTgeoGeoLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 4, + "AlwaysNeTgeoGeoLogicalFunction requires 4 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AlwaysNeTgeoGeoLogicalFunction::getType() const { return NAME; } + +bool AlwaysNeTgeoGeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AlwaysNeTgeoGeoLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction AlwaysNeTgeoGeoLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(4); + c.emplace_back(parameters[0].withInferredDataType(schema)); + c.emplace_back(parameters[1].withInferredDataType(schema)); + c.emplace_back(parameters[2].withInferredDataType(schema)); + c.emplace_back(parameters[3].withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon must be FLOAT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::VARSIZED),"wkt must be VARSIZED"); + return withChildren(c); +} + +SerializableFunction AlwaysNeTgeoGeoLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysNeTgeoGeoLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 4, + "AlwaysNeTgeoGeoLogicalFunction requires 4 children but got {}", + arguments.children.size()); + return AlwaysNeTgeoGeoLogicalFunction(std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt index 84463aa354..d4c84c083e 100644 --- a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt @@ -312,6 +312,10 @@ add_plugin(GeoEquals LogicalFunction nes-logical-operators GeoEqualsLogicalFunct add_plugin(GeoSame LogicalFunction nes-logical-operators GeoSameLogicalFunction.cpp) add_plugin(GeogDistance LogicalFunction nes-logical-operators GeogDistanceLogicalFunction.cpp) add_plugin(NadTgeoGeo LogicalFunction nes-logical-operators NadTgeoGeoLogicalFunction.cpp) +add_plugin(EverEqTgeoGeo LogicalFunction nes-logical-operators EverEqTgeoGeoLogicalFunction.cpp) +add_plugin(EverNeTgeoGeo LogicalFunction nes-logical-operators EverNeTgeoGeoLogicalFunction.cpp) +add_plugin(AlwaysEqTgeoGeo LogicalFunction nes-logical-operators AlwaysEqTgeoGeoLogicalFunction.cpp) +add_plugin(AlwaysNeTgeoGeo LogicalFunction nes-logical-operators AlwaysNeTgeoGeoLogicalFunction.cpp) add_plugin(GeomIntersects2d LogicalFunction nes-logical-operators GeomIntersects2dLogicalFunction.cpp) add_plugin(GeomDwithin2d LogicalFunction nes-logical-operators GeomDwithin2dLogicalFunction.cpp) add_plugin(GeomContains LogicalFunction nes-logical-operators GeomContainsLogicalFunction.cpp) diff --git a/nes-logical-operators/src/Functions/Meos/EverEqTgeoGeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverEqTgeoGeoLogicalFunction.cpp new file mode 100644 index 0000000000..a3be680597 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverEqTgeoGeoLogicalFunction.cpp @@ -0,0 +1,107 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EverEqTgeoGeoLogicalFunction::EverEqTgeoGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, + LogicalFunction ts, LogicalFunction wkt) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(4); + parameters.push_back(std::move(lon)); + parameters.push_back(std::move(lat)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(wkt)); +} + +DataType EverEqTgeoGeoLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverEqTgeoGeoLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EverEqTgeoGeoLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverEqTgeoGeoLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 4, + "EverEqTgeoGeoLogicalFunction requires 4 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EverEqTgeoGeoLogicalFunction::getType() const { return NAME; } + +bool EverEqTgeoGeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EverEqTgeoGeoLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction EverEqTgeoGeoLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(4); + c.emplace_back(parameters[0].withInferredDataType(schema)); + c.emplace_back(parameters[1].withInferredDataType(schema)); + c.emplace_back(parameters[2].withInferredDataType(schema)); + c.emplace_back(parameters[3].withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon must be FLOAT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::VARSIZED),"wkt must be VARSIZED"); + return withChildren(c); +} + +SerializableFunction EverEqTgeoGeoLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverEqTgeoGeoLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 4, + "EverEqTgeoGeoLogicalFunction requires 4 children but got {}", + arguments.children.size()); + return EverEqTgeoGeoLogicalFunction(std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverNeTgeoGeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverNeTgeoGeoLogicalFunction.cpp new file mode 100644 index 0000000000..07ba953aef --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverNeTgeoGeoLogicalFunction.cpp @@ -0,0 +1,107 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EverNeTgeoGeoLogicalFunction::EverNeTgeoGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, + LogicalFunction ts, LogicalFunction wkt) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(4); + parameters.push_back(std::move(lon)); + parameters.push_back(std::move(lat)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(wkt)); +} + +DataType EverNeTgeoGeoLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverNeTgeoGeoLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EverNeTgeoGeoLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverNeTgeoGeoLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 4, + "EverNeTgeoGeoLogicalFunction requires 4 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EverNeTgeoGeoLogicalFunction::getType() const { return NAME; } + +bool EverNeTgeoGeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EverNeTgeoGeoLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction EverNeTgeoGeoLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(4); + c.emplace_back(parameters[0].withInferredDataType(schema)); + c.emplace_back(parameters[1].withInferredDataType(schema)); + c.emplace_back(parameters[2].withInferredDataType(schema)); + c.emplace_back(parameters[3].withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon must be FLOAT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::VARSIZED),"wkt must be VARSIZED"); + return withChildren(c); +} + +SerializableFunction EverNeTgeoGeoLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverNeTgeoGeoLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 4, + "EverNeTgeoGeoLogicalFunction requires 4 children but got {}", + arguments.children.size()); + return EverNeTgeoGeoLogicalFunction(std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3])); +} + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysEqTgeoGeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysEqTgeoGeoPhysicalFunction.hpp new file mode 100644 index 0000000000..374b10708d --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysEqTgeoGeoPhysicalFunction.hpp @@ -0,0 +1,35 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class AlwaysEqTgeoGeoPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysEqTgeoGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, + PhysicalFunction ts, PhysicalFunction wkt); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysNeTgeoGeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysNeTgeoGeoPhysicalFunction.hpp new file mode 100644 index 0000000000..e32cdf4c59 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysNeTgeoGeoPhysicalFunction.hpp @@ -0,0 +1,35 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class AlwaysNeTgeoGeoPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysNeTgeoGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, + PhysicalFunction ts, PhysicalFunction wkt); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverEqTgeoGeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverEqTgeoGeoPhysicalFunction.hpp new file mode 100644 index 0000000000..ae43d9ba2f --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverEqTgeoGeoPhysicalFunction.hpp @@ -0,0 +1,35 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class EverEqTgeoGeoPhysicalFunction : public PhysicalFunctionConcept { +public: + EverEqTgeoGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, + PhysicalFunction ts, PhysicalFunction wkt); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverNeTgeoGeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverNeTgeoGeoPhysicalFunction.hpp new file mode 100644 index 0000000000..28bad836ba --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverNeTgeoGeoPhysicalFunction.hpp @@ -0,0 +1,35 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class EverNeTgeoGeoPhysicalFunction : public PhysicalFunctionConcept { +public: + EverNeTgeoGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, + PhysicalFunction ts, PhysicalFunction wkt); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysEqTgeoGeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysEqTgeoGeoPhysicalFunction.cpp new file mode 100644 index 0000000000..d834e46c81 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysEqTgeoGeoPhysicalFunction.cpp @@ -0,0 +1,87 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +AlwaysEqTgeoGeoPhysicalFunction::AlwaysEqTgeoGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, + PhysicalFunction ts, PhysicalFunction wkt) +{ + paramFns.reserve(4); + paramFns.push_back(std::move(lon)); + paramFns.push_back(std::move(lat)); + paramFns.push_back(std::move(ts)); + paramFns.push_back(std::move(wkt)); +} + +VarVal AlwaysEqTgeoGeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto lon = paramFns[0].execute(record, arena).cast(); + auto lat = paramFns[1].execute(record, arena).cast(); + auto ts = paramFns[2].execute(record, arena).cast(); + auto wkt = paramFns[3].execute(record, arena).cast(); + + const auto result = nautilus::invoke( + +[](double lon, double lat, uint64_t ts, + const char* w, uint32_t wsz) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string wktStr(w, wsz); + std::string tgeoWkt = fmt::format("SRID=4326;POINT({},{})@{}", lon, lat, ts); + Temporal* tgeo = tgeompoint_in(tgeoWkt.c_str()); + if (!tgeo) return 0.0; + GSERIALIZED* gs = geom_in(wktStr.c_str(), -1); + if (!gs) { free(tgeo); return 0.0; } + double r = always_eq_tgeo_geo(tgeo, gs) > 0 ? 1.0 : 0.0; + free(tgeo); free(gs); + return r; + } catch (const std::exception&) { return 0.0; } + }, + lon, lat, ts, wkt); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysEqTgeoGeoPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 4, + "AlwaysEqTgeoGeoPhysicalFunction requires 4 children but got {}", + arguments.childFunctions.size()); + return AlwaysEqTgeoGeoPhysicalFunction(std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysNeTgeoGeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysNeTgeoGeoPhysicalFunction.cpp new file mode 100644 index 0000000000..6591e10cb6 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysNeTgeoGeoPhysicalFunction.cpp @@ -0,0 +1,87 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +AlwaysNeTgeoGeoPhysicalFunction::AlwaysNeTgeoGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, + PhysicalFunction ts, PhysicalFunction wkt) +{ + paramFns.reserve(4); + paramFns.push_back(std::move(lon)); + paramFns.push_back(std::move(lat)); + paramFns.push_back(std::move(ts)); + paramFns.push_back(std::move(wkt)); +} + +VarVal AlwaysNeTgeoGeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto lon = paramFns[0].execute(record, arena).cast(); + auto lat = paramFns[1].execute(record, arena).cast(); + auto ts = paramFns[2].execute(record, arena).cast(); + auto wkt = paramFns[3].execute(record, arena).cast(); + + const auto result = nautilus::invoke( + +[](double lon, double lat, uint64_t ts, + const char* w, uint32_t wsz) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string wktStr(w, wsz); + std::string tgeoWkt = fmt::format("SRID=4326;POINT({},{})@{}", lon, lat, ts); + Temporal* tgeo = tgeompoint_in(tgeoWkt.c_str()); + if (!tgeo) return 0.0; + GSERIALIZED* gs = geom_in(wktStr.c_str(), -1); + if (!gs) { free(tgeo); return 0.0; } + double r = always_ne_tgeo_geo(tgeo, gs) > 0 ? 1.0 : 0.0; + free(tgeo); free(gs); + return r; + } catch (const std::exception&) { return 0.0; } + }, + lon, lat, ts, wkt); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysNeTgeoGeoPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 4, + "AlwaysNeTgeoGeoPhysicalFunction requires 4 children but got {}", + arguments.childFunctions.size()); + return AlwaysNeTgeoGeoPhysicalFunction(std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt index 20c731a336..f955b87a94 100644 --- a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt @@ -311,6 +311,10 @@ add_plugin(GeoEquals PhysicalFunction nes-physical-operators GeoEqualsPhysicalFu add_plugin(GeoSame PhysicalFunction nes-physical-operators GeoSamePhysicalFunction.cpp) add_plugin(GeogDistance PhysicalFunction nes-physical-operators GeogDistancePhysicalFunction.cpp) add_plugin(NadTgeoGeo PhysicalFunction nes-physical-operators NadTgeoGeoPhysicalFunction.cpp) +add_plugin(EverEqTgeoGeo PhysicalFunction nes-physical-operators EverEqTgeoGeoPhysicalFunction.cpp) +add_plugin(EverNeTgeoGeo PhysicalFunction nes-physical-operators EverNeTgeoGeoPhysicalFunction.cpp) +add_plugin(AlwaysEqTgeoGeo PhysicalFunction nes-physical-operators AlwaysEqTgeoGeoPhysicalFunction.cpp) +add_plugin(AlwaysNeTgeoGeo PhysicalFunction nes-physical-operators AlwaysNeTgeoGeoPhysicalFunction.cpp) add_plugin(GeomIntersects2d PhysicalFunction nes-physical-operators GeomIntersects2dPhysicalFunction.cpp) add_plugin(GeomDwithin2d PhysicalFunction nes-physical-operators GeomDwithin2dPhysicalFunction.cpp) add_plugin(GeomContains PhysicalFunction nes-physical-operators GeomContainsPhysicalFunction.cpp) diff --git a/nes-physical-operators/src/Functions/Meos/EverEqTgeoGeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverEqTgeoGeoPhysicalFunction.cpp new file mode 100644 index 0000000000..55f9b0af02 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverEqTgeoGeoPhysicalFunction.cpp @@ -0,0 +1,87 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +EverEqTgeoGeoPhysicalFunction::EverEqTgeoGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, + PhysicalFunction ts, PhysicalFunction wkt) +{ + paramFns.reserve(4); + paramFns.push_back(std::move(lon)); + paramFns.push_back(std::move(lat)); + paramFns.push_back(std::move(ts)); + paramFns.push_back(std::move(wkt)); +} + +VarVal EverEqTgeoGeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto lon = paramFns[0].execute(record, arena).cast(); + auto lat = paramFns[1].execute(record, arena).cast(); + auto ts = paramFns[2].execute(record, arena).cast(); + auto wkt = paramFns[3].execute(record, arena).cast(); + + const auto result = nautilus::invoke( + +[](double lon, double lat, uint64_t ts, + const char* w, uint32_t wsz) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string wktStr(w, wsz); + std::string tgeoWkt = fmt::format("SRID=4326;POINT({},{})@{}", lon, lat, ts); + Temporal* tgeo = tgeompoint_in(tgeoWkt.c_str()); + if (!tgeo) return 0.0; + GSERIALIZED* gs = geom_in(wktStr.c_str(), -1); + if (!gs) { free(tgeo); return 0.0; } + double r = ever_eq_tgeo_geo(tgeo, gs) > 0 ? 1.0 : 0.0; + free(tgeo); free(gs); + return r; + } catch (const std::exception&) { return 0.0; } + }, + lon, lat, ts, wkt); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverEqTgeoGeoPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 4, + "EverEqTgeoGeoPhysicalFunction requires 4 children but got {}", + arguments.childFunctions.size()); + return EverEqTgeoGeoPhysicalFunction(std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverNeTgeoGeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverNeTgeoGeoPhysicalFunction.cpp new file mode 100644 index 0000000000..fd0a57634d --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverNeTgeoGeoPhysicalFunction.cpp @@ -0,0 +1,87 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +EverNeTgeoGeoPhysicalFunction::EverNeTgeoGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, + PhysicalFunction ts, PhysicalFunction wkt) +{ + paramFns.reserve(4); + paramFns.push_back(std::move(lon)); + paramFns.push_back(std::move(lat)); + paramFns.push_back(std::move(ts)); + paramFns.push_back(std::move(wkt)); +} + +VarVal EverNeTgeoGeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto lon = paramFns[0].execute(record, arena).cast(); + auto lat = paramFns[1].execute(record, arena).cast(); + auto ts = paramFns[2].execute(record, arena).cast(); + auto wkt = paramFns[3].execute(record, arena).cast(); + + const auto result = nautilus::invoke( + +[](double lon, double lat, uint64_t ts, + const char* w, uint32_t wsz) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string wktStr(w, wsz); + std::string tgeoWkt = fmt::format("SRID=4326;POINT({},{})@{}", lon, lat, ts); + Temporal* tgeo = tgeompoint_in(tgeoWkt.c_str()); + if (!tgeo) return 0.0; + GSERIALIZED* gs = geom_in(wktStr.c_str(), -1); + if (!gs) { free(tgeo); return 0.0; } + double r = ever_ne_tgeo_geo(tgeo, gs) > 0 ? 1.0 : 0.0; + free(tgeo); free(gs); + return r; + } catch (const std::exception&) { return 0.0; } + }, + lon, lat, ts, wkt); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverNeTgeoGeoPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 4, + "EverNeTgeoGeoPhysicalFunction requires 4 children but got {}", + arguments.childFunctions.size()); + return EverNeTgeoGeoPhysicalFunction(std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3])); +} + +} // namespace NES diff --git a/nes-sql-parser/AntlrSQL.g4 b/nes-sql-parser/AntlrSQL.g4 index 4e5851f026..4b5e7d3a75 100644 --- a/nes-sql-parser/AntlrSQL.g4 +++ b/nes-sql-parser/AntlrSQL.g4 @@ -295,7 +295,7 @@ timeUnit: MS timestampParameter: name=identifier; -functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT | TGE_TTEXT_TEXT | TGE_TEXT_TTEXT | TGT_TTEXT_TEXT | TGT_TEXT_TTEXT | TLE_TTEXT_TEXT | TLE_TEXT_TTEXT | TLT_TTEXT_TEXT | TLT_TEXT_TTEXT | TTEXT_UPPER | TTEXT_LOWER | TTEXT_INITCAP | TEXTCAT_TTEXT_TEXT | TEXTCAT_TEXT_TTEXT | TEXTCAT_TTEXT_TTEXT | GEOM_LENGTH | GEOM_PERIMETER | GEOM_AZIMUTH | GEOG_AREA | GEOG_LENGTH | GEOG_PERIMETER | GEOM_IS_EMPTY | AINTERSECTS_TGEO_GEO | ACOVERS_TGEO_GEO | ADISJOINT_TGEO_GEO | ADWITHIN_TGEO_GEO | EINTERSECTS_TGEO_GEO | ETOUCHES_TGEO_GEO | ECONTAINS_TGEO_GEO | ACONTAINS_TGEO_GEO | ATOUCHES_TGEO_GEO | GEO_NUM_POINTS | GEO_NUM_GEOS | GEO_SRID | GEO_IS_UNITARY | GEO_EQUALS | GEO_SAME | GEOG_DISTANCE | NAD_TGEO_GEO | GEOM_INTERSECTS2D | GEOM_DWITHIN2D | GEOM_CONTAINS | GEOM_DISJOINT2D | GEOM_COVERS | GEOM_TOUCHES | GEOM_INTERSECTS3D | GEOM_DWITHIN3D | GEOM_DISTANCE2D | GEOM_DISTANCE3D; +functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT | TGE_TTEXT_TEXT | TGE_TEXT_TTEXT | TGT_TTEXT_TEXT | TGT_TEXT_TTEXT | TLE_TTEXT_TEXT | TLE_TEXT_TTEXT | TLT_TTEXT_TEXT | TLT_TEXT_TTEXT | TTEXT_UPPER | TTEXT_LOWER | TTEXT_INITCAP | TEXTCAT_TTEXT_TEXT | TEXTCAT_TEXT_TTEXT | TEXTCAT_TTEXT_TTEXT | GEOM_LENGTH | GEOM_PERIMETER | GEOM_AZIMUTH | GEOG_AREA | GEOG_LENGTH | GEOG_PERIMETER | GEOM_IS_EMPTY | AINTERSECTS_TGEO_GEO | ACOVERS_TGEO_GEO | ADISJOINT_TGEO_GEO | ADWITHIN_TGEO_GEO | EINTERSECTS_TGEO_GEO | ETOUCHES_TGEO_GEO | ECONTAINS_TGEO_GEO | ACONTAINS_TGEO_GEO | ATOUCHES_TGEO_GEO | GEO_NUM_POINTS | GEO_NUM_GEOS | GEO_SRID | GEO_IS_UNITARY | GEO_EQUALS | GEO_SAME | GEOG_DISTANCE | NAD_TGEO_GEO | EVER_EQ_TGEO_GEO | EVER_NE_TGEO_GEO | ALWAYS_EQ_TGEO_GEO | ALWAYS_NE_TGEO_GEO | GEOM_INTERSECTS2D | GEOM_DWITHIN2D | GEOM_CONTAINS | GEOM_DISJOINT2D | GEOM_COVERS | GEOM_TOUCHES | GEOM_INTERSECTS3D | GEOM_DWITHIN3D | GEOM_DISTANCE2D | GEOM_DISTANCE3D; sinkClause: INTO sink (',' sink)*; @@ -782,6 +782,10 @@ GEO_EQUALS: 'GEO_EQUALS' | 'geo_equals'; GEO_SAME: 'GEO_SAME' | 'geo_same'; GEOG_DISTANCE: 'GEOG_DISTANCE' | 'geog_distance'; NAD_TGEO_GEO: 'NAD_TGEO_GEO' | 'nad_tgeo_geo'; +EVER_EQ_TGEO_GEO: 'EVER_EQ_TGEO_GEO' | 'ever_eq_tgeo_geo'; +EVER_NE_TGEO_GEO: 'EVER_NE_TGEO_GEO' | 'ever_ne_tgeo_geo'; +ALWAYS_EQ_TGEO_GEO: 'ALWAYS_EQ_TGEO_GEO' | 'always_eq_tgeo_geo'; +ALWAYS_NE_TGEO_GEO: 'ALWAYS_NE_TGEO_GEO' | 'always_ne_tgeo_geo'; GEOM_INTERSECTS2D: 'GEOM_INTERSECTS2D' | 'geom_intersects2d'; GEOM_DWITHIN2D: 'GEOM_DWITHIN2D' | 'geom_dwithin2d'; GEOM_CONTAINS: 'GEOM_CONTAINS' | 'geom_contains'; diff --git a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp index 9cab82372f..d8266caae0 100644 --- a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp +++ b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp @@ -363,6 +363,10 @@ #include #include #include +#include +#include +#include +#include #include #include #include @@ -9020,6 +9024,50 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont return LogicalFunction(NadTgeoGeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3))); } /* END CODEGEN PARSER GLUE: NAD_TGEO_GEO */ + case AntlrSQLParser::EVER_EQ_TGEO_GEO: { + PRECONDITION(ctx->functionParam().size() == 4, + "EverEqTgeoGeo requires 4 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + return LogicalFunction(EverEqTgeoGeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3))); + } + /* END CODEGEN PARSER GLUE: EVER_EQ_TGEO_GEO */ + case AntlrSQLParser::EVER_NE_TGEO_GEO: { + PRECONDITION(ctx->functionParam().size() == 4, + "EverNeTgeoGeo requires 4 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + return LogicalFunction(EverNeTgeoGeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3))); + } + /* END CODEGEN PARSER GLUE: EVER_NE_TGEO_GEO */ + case AntlrSQLParser::ALWAYS_EQ_TGEO_GEO: { + PRECONDITION(ctx->functionParam().size() == 4, + "AlwaysEqTgeoGeo requires 4 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + return LogicalFunction(AlwaysEqTgeoGeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3))); + } + /* END CODEGEN PARSER GLUE: ALWAYS_EQ_TGEO_GEO */ + case AntlrSQLParser::ALWAYS_NE_TGEO_GEO: { + PRECONDITION(ctx->functionParam().size() == 4, + "AlwaysNeTgeoGeo requires 4 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + return LogicalFunction(AlwaysNeTgeoGeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3))); + } + /* END CODEGEN PARSER GLUE: ALWAYS_NE_TGEO_GEO */ /* END CODEGEN PARSER GLUE: GEOM_INTERSECTS2D */ case AntlrSQLParser::GEOM_DWITHIN2D: { PRECONDITION(ctx->functionParam().size() == 3, From b8582e2828858843d37c7506f4e94fb858db3e24 Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Mon, 15 Jun 2026 00:13:39 +0200 Subject: [PATCH 56/96] feat(meos): add GEOG_INTERSECTS and GEOG_DWITHIN NES operators (W108) Wires geog_intersects(wkt1, wkt2) as a 2-arg VARCHAR*VARCHAR -> FLOAT64 operator and geog_dwithin(wkt1, wkt2, tolerance) as a 3-arg operator, both using spheroidal (use_spheroid=true) computation via the MEOS kernel. --- .../Meos/GeogDwithinLogicalFunction.hpp | 50 +++++++++ .../Meos/GeogIntersectsLogicalFunction.hpp | 50 +++++++++ .../src/Functions/Meos/CMakeLists.txt | 2 + .../Meos/GeogDwithinLogicalFunction.cpp | 103 ++++++++++++++++++ .../Meos/GeogIntersectsLogicalFunction.cpp | 98 +++++++++++++++++ .../Meos/GeogDwithinPhysicalFunction.hpp | 34 ++++++ .../Meos/GeogIntersectsPhysicalFunction.hpp | 34 ++++++ .../src/Functions/Meos/CMakeLists.txt | 2 + .../Meos/GeogDwithinPhysicalFunction.cpp | 84 ++++++++++++++ .../Meos/GeogIntersectsPhysicalFunction.cpp | 78 +++++++++++++ nes-sql-parser/AntlrSQL.g4 | 4 +- .../src/AntlrSQLQueryPlanCreator.cpp | 21 ++++ 12 files changed, 559 insertions(+), 1 deletion(-) create mode 100644 nes-logical-operators/include/Functions/Meos/GeogDwithinLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/GeogIntersectsLogicalFunction.hpp create mode 100644 nes-logical-operators/src/Functions/Meos/GeogDwithinLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/GeogIntersectsLogicalFunction.cpp create mode 100644 nes-physical-operators/include/Functions/Meos/GeogDwithinPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/GeogIntersectsPhysicalFunction.hpp create mode 100644 nes-physical-operators/src/Functions/Meos/GeogDwithinPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/GeogIntersectsPhysicalFunction.cpp diff --git a/nes-logical-operators/include/Functions/Meos/GeogDwithinLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeogDwithinLogicalFunction.hpp new file mode 100644 index 0000000000..bffb16c5f6 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/GeogDwithinLogicalFunction.hpp @@ -0,0 +1,50 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if two geographic geometries are within tolerance distance (spheroidal). + * + * Args: (wkt1:VARCHAR, wkt2:VARCHAR, tolerance:FLOAT64) -> FLOAT64. + */ +class GeogDwithinLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "GeogDwithin"; + + GeogDwithinLogicalFunction(LogicalFunction wkt1, LogicalFunction wkt2, LogicalFunction tolerance); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/GeogIntersectsLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeogIntersectsLogicalFunction.hpp new file mode 100644 index 0000000000..6be3f835fd --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/GeogIntersectsLogicalFunction.hpp @@ -0,0 +1,50 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if two geographic geometries intersect (spheroidal). + * + * Args: (wkt1:VARCHAR, wkt2:VARCHAR) -> FLOAT64. + */ +class GeogIntersectsLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "GeogIntersects"; + + GeogIntersectsLogicalFunction(LogicalFunction wkt1, LogicalFunction wkt2); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt index d4c84c083e..5df38df64e 100644 --- a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt @@ -316,6 +316,8 @@ add_plugin(EverEqTgeoGeo LogicalFunction nes-logical-operators EverEqTgeoGeoLogi add_plugin(EverNeTgeoGeo LogicalFunction nes-logical-operators EverNeTgeoGeoLogicalFunction.cpp) add_plugin(AlwaysEqTgeoGeo LogicalFunction nes-logical-operators AlwaysEqTgeoGeoLogicalFunction.cpp) add_plugin(AlwaysNeTgeoGeo LogicalFunction nes-logical-operators AlwaysNeTgeoGeoLogicalFunction.cpp) +add_plugin(GeogIntersects LogicalFunction nes-logical-operators GeogIntersectsLogicalFunction.cpp) +add_plugin(GeogDwithin LogicalFunction nes-logical-operators GeogDwithinLogicalFunction.cpp) add_plugin(GeomIntersects2d LogicalFunction nes-logical-operators GeomIntersects2dLogicalFunction.cpp) add_plugin(GeomDwithin2d LogicalFunction nes-logical-operators GeomDwithin2dLogicalFunction.cpp) add_plugin(GeomContains LogicalFunction nes-logical-operators GeomContainsLogicalFunction.cpp) diff --git a/nes-logical-operators/src/Functions/Meos/GeogDwithinLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeogDwithinLogicalFunction.cpp new file mode 100644 index 0000000000..2ddd5b07ae --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/GeogDwithinLogicalFunction.cpp @@ -0,0 +1,103 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +GeogDwithinLogicalFunction::GeogDwithinLogicalFunction(LogicalFunction wkt1, LogicalFunction wkt2, + LogicalFunction tolerance) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(wkt1)); + parameters.push_back(std::move(wkt2)); + parameters.push_back(std::move(tolerance)); +} + +DataType GeogDwithinLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction GeogDwithinLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector GeogDwithinLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction GeogDwithinLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, + "GeogDwithinLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view GeogDwithinLogicalFunction::getType() const { return NAME; } + +bool GeogDwithinLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string GeogDwithinLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction GeogDwithinLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(3); + c.emplace_back(parameters[0].withInferredDataType(schema)); + c.emplace_back(parameters[1].withInferredDataType(schema)); + c.emplace_back(parameters[2].withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "wkt1 must be VARSIZED"); + INVARIANT(c[1].getDataType().isType(DataType::Type::VARSIZED), "wkt2 must be VARSIZED"); + INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "tolerance must be FLOAT64"); + return withChildren(c); +} + +SerializableFunction GeogDwithinLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeogDwithinLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "GeogDwithinLogicalFunction requires 3 children but got {}", + arguments.children.size()); + return GeogDwithinLogicalFunction(std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/GeogIntersectsLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeogIntersectsLogicalFunction.cpp new file mode 100644 index 0000000000..b51a3450c6 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/GeogIntersectsLogicalFunction.cpp @@ -0,0 +1,98 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +GeogIntersectsLogicalFunction::GeogIntersectsLogicalFunction(LogicalFunction wkt1, LogicalFunction wkt2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(2); + parameters.push_back(std::move(wkt1)); + parameters.push_back(std::move(wkt2)); +} + +DataType GeogIntersectsLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction GeogIntersectsLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector GeogIntersectsLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction GeogIntersectsLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 2, + "GeogIntersectsLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view GeogIntersectsLogicalFunction::getType() const { return NAME; } + +bool GeogIntersectsLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string GeogIntersectsLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction GeogIntersectsLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(2); + c.emplace_back(parameters[0].withInferredDataType(schema)); + c.emplace_back(parameters[1].withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "wkt1 must be VARSIZED"); + INVARIANT(c[1].getDataType().isType(DataType::Type::VARSIZED), "wkt2 must be VARSIZED"); + return withChildren(c); +} + +SerializableFunction GeogIntersectsLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeogIntersectsLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 2, + "GeogIntersectsLogicalFunction requires 2 children but got {}", + arguments.children.size()); + return GeogIntersectsLogicalFunction(std::move(arguments.children[0]), + std::move(arguments.children[1])); +} + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeogDwithinPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeogDwithinPhysicalFunction.hpp new file mode 100644 index 0000000000..20e604f0e3 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/GeogDwithinPhysicalFunction.hpp @@ -0,0 +1,34 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class GeogDwithinPhysicalFunction : public PhysicalFunctionConcept { +public: + GeogDwithinPhysicalFunction(PhysicalFunction wkt1, PhysicalFunction wkt2, PhysicalFunction tolerance); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeogIntersectsPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeogIntersectsPhysicalFunction.hpp new file mode 100644 index 0000000000..5e81e97871 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/GeogIntersectsPhysicalFunction.hpp @@ -0,0 +1,34 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class GeogIntersectsPhysicalFunction : public PhysicalFunctionConcept { +public: + GeogIntersectsPhysicalFunction(PhysicalFunction wkt1, PhysicalFunction wkt2); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt index f955b87a94..3ff0225659 100644 --- a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt @@ -315,6 +315,8 @@ add_plugin(EverEqTgeoGeo PhysicalFunction nes-physical-operators EverEqTgeoGeoPh add_plugin(EverNeTgeoGeo PhysicalFunction nes-physical-operators EverNeTgeoGeoPhysicalFunction.cpp) add_plugin(AlwaysEqTgeoGeo PhysicalFunction nes-physical-operators AlwaysEqTgeoGeoPhysicalFunction.cpp) add_plugin(AlwaysNeTgeoGeo PhysicalFunction nes-physical-operators AlwaysNeTgeoGeoPhysicalFunction.cpp) +add_plugin(GeogIntersects PhysicalFunction nes-physical-operators GeogIntersectsPhysicalFunction.cpp) +add_plugin(GeogDwithin PhysicalFunction nes-physical-operators GeogDwithinPhysicalFunction.cpp) add_plugin(GeomIntersects2d PhysicalFunction nes-physical-operators GeomIntersects2dPhysicalFunction.cpp) add_plugin(GeomDwithin2d PhysicalFunction nes-physical-operators GeomDwithin2dPhysicalFunction.cpp) add_plugin(GeomContains PhysicalFunction nes-physical-operators GeomContainsPhysicalFunction.cpp) diff --git a/nes-physical-operators/src/Functions/Meos/GeogDwithinPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeogDwithinPhysicalFunction.cpp new file mode 100644 index 0000000000..733ed8129d --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/GeogDwithinPhysicalFunction.cpp @@ -0,0 +1,84 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +GeogDwithinPhysicalFunction::GeogDwithinPhysicalFunction(PhysicalFunction wkt1, PhysicalFunction wkt2, + PhysicalFunction tolerance) +{ + paramFns.reserve(3); + paramFns.push_back(std::move(wkt1)); + paramFns.push_back(std::move(wkt2)); + paramFns.push_back(std::move(tolerance)); +} + +VarVal GeogDwithinPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto s1 = paramFns[0].execute(record, arena).cast(); + auto s2 = paramFns[1].execute(record, arena).cast(); + auto tol = paramFns[2].execute(record, arena).cast(); + + const auto result = nautilus::invoke( + +[](const char* w1, uint32_t w1sz, + const char* w2, uint32_t w2sz, + double tol) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string s1(w1, w1sz); + std::string s2(w2, w2sz); + GSERIALIZED* gs1 = geom_in(s1.c_str(), -1); + if (!gs1) return 0.0; + GSERIALIZED* gs2 = geom_in(s2.c_str(), -1); + if (!gs2) { free(gs1); return 0.0; } + double r = geog_dwithin(gs1, gs2, tol, true) ? 1.0 : 0.0; + free(gs1); free(gs2); + return r; + } catch (const std::exception&) { return 0.0; } + }, + s1, s2, tol); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterGeogDwithinPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "GeogDwithinPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + return GeogDwithinPhysicalFunction(std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/GeogIntersectsPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeogIntersectsPhysicalFunction.cpp new file mode 100644 index 0000000000..868260650b --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/GeogIntersectsPhysicalFunction.cpp @@ -0,0 +1,78 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +GeogIntersectsPhysicalFunction::GeogIntersectsPhysicalFunction(PhysicalFunction wkt1, PhysicalFunction wkt2) +{ + paramFns.reserve(2); + paramFns.push_back(std::move(wkt1)); + paramFns.push_back(std::move(wkt2)); +} + +VarVal GeogIntersectsPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto s1 = paramFns[0].execute(record, arena).cast(); + auto s2 = paramFns[1].execute(record, arena).cast(); + + const auto result = nautilus::invoke( + +[](const char* w1, uint32_t w1sz, const char* w2, uint32_t w2sz) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string s1(w1, w1sz); + std::string s2(w2, w2sz); + GSERIALIZED* gs1 = geom_in(s1.c_str(), -1); + if (!gs1) return 0.0; + GSERIALIZED* gs2 = geom_in(s2.c_str(), -1); + if (!gs2) { free(gs1); return 0.0; } + double r = geog_intersects(gs1, gs2, true) ? 1.0 : 0.0; + free(gs1); free(gs2); + return r; + } catch (const std::exception&) { return 0.0; } + }, + s1, s2); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterGeogIntersectsPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 2, + "GeogIntersectsPhysicalFunction requires 2 children but got {}", + arguments.childFunctions.size()); + return GeogIntersectsPhysicalFunction(std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1])); +} + +} // namespace NES diff --git a/nes-sql-parser/AntlrSQL.g4 b/nes-sql-parser/AntlrSQL.g4 index 4b5e7d3a75..a93e0c81c1 100644 --- a/nes-sql-parser/AntlrSQL.g4 +++ b/nes-sql-parser/AntlrSQL.g4 @@ -295,7 +295,7 @@ timeUnit: MS timestampParameter: name=identifier; -functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT | TGE_TTEXT_TEXT | TGE_TEXT_TTEXT | TGT_TTEXT_TEXT | TGT_TEXT_TTEXT | TLE_TTEXT_TEXT | TLE_TEXT_TTEXT | TLT_TTEXT_TEXT | TLT_TEXT_TTEXT | TTEXT_UPPER | TTEXT_LOWER | TTEXT_INITCAP | TEXTCAT_TTEXT_TEXT | TEXTCAT_TEXT_TTEXT | TEXTCAT_TTEXT_TTEXT | GEOM_LENGTH | GEOM_PERIMETER | GEOM_AZIMUTH | GEOG_AREA | GEOG_LENGTH | GEOG_PERIMETER | GEOM_IS_EMPTY | AINTERSECTS_TGEO_GEO | ACOVERS_TGEO_GEO | ADISJOINT_TGEO_GEO | ADWITHIN_TGEO_GEO | EINTERSECTS_TGEO_GEO | ETOUCHES_TGEO_GEO | ECONTAINS_TGEO_GEO | ACONTAINS_TGEO_GEO | ATOUCHES_TGEO_GEO | GEO_NUM_POINTS | GEO_NUM_GEOS | GEO_SRID | GEO_IS_UNITARY | GEO_EQUALS | GEO_SAME | GEOG_DISTANCE | NAD_TGEO_GEO | EVER_EQ_TGEO_GEO | EVER_NE_TGEO_GEO | ALWAYS_EQ_TGEO_GEO | ALWAYS_NE_TGEO_GEO | GEOM_INTERSECTS2D | GEOM_DWITHIN2D | GEOM_CONTAINS | GEOM_DISJOINT2D | GEOM_COVERS | GEOM_TOUCHES | GEOM_INTERSECTS3D | GEOM_DWITHIN3D | GEOM_DISTANCE2D | GEOM_DISTANCE3D; +functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT | TGE_TTEXT_TEXT | TGE_TEXT_TTEXT | TGT_TTEXT_TEXT | TGT_TEXT_TTEXT | TLE_TTEXT_TEXT | TLE_TEXT_TTEXT | TLT_TTEXT_TEXT | TLT_TEXT_TTEXT | TTEXT_UPPER | TTEXT_LOWER | TTEXT_INITCAP | TEXTCAT_TTEXT_TEXT | TEXTCAT_TEXT_TTEXT | TEXTCAT_TTEXT_TTEXT | GEOM_LENGTH | GEOM_PERIMETER | GEOM_AZIMUTH | GEOG_AREA | GEOG_LENGTH | GEOG_PERIMETER | GEOM_IS_EMPTY | AINTERSECTS_TGEO_GEO | ACOVERS_TGEO_GEO | ADISJOINT_TGEO_GEO | ADWITHIN_TGEO_GEO | EINTERSECTS_TGEO_GEO | ETOUCHES_TGEO_GEO | ECONTAINS_TGEO_GEO | ACONTAINS_TGEO_GEO | ATOUCHES_TGEO_GEO | GEO_NUM_POINTS | GEO_NUM_GEOS | GEO_SRID | GEO_IS_UNITARY | GEO_EQUALS | GEO_SAME | GEOG_DISTANCE | NAD_TGEO_GEO | EVER_EQ_TGEO_GEO | EVER_NE_TGEO_GEO | ALWAYS_EQ_TGEO_GEO | ALWAYS_NE_TGEO_GEO | GEOG_INTERSECTS | GEOG_DWITHIN | GEOM_INTERSECTS2D | GEOM_DWITHIN2D | GEOM_CONTAINS | GEOM_DISJOINT2D | GEOM_COVERS | GEOM_TOUCHES | GEOM_INTERSECTS3D | GEOM_DWITHIN3D | GEOM_DISTANCE2D | GEOM_DISTANCE3D; sinkClause: INTO sink (',' sink)*; @@ -786,6 +786,8 @@ EVER_EQ_TGEO_GEO: 'EVER_EQ_TGEO_GEO' | 'ever_eq_tgeo_geo'; EVER_NE_TGEO_GEO: 'EVER_NE_TGEO_GEO' | 'ever_ne_tgeo_geo'; ALWAYS_EQ_TGEO_GEO: 'ALWAYS_EQ_TGEO_GEO' | 'always_eq_tgeo_geo'; ALWAYS_NE_TGEO_GEO: 'ALWAYS_NE_TGEO_GEO' | 'always_ne_tgeo_geo'; +GEOG_INTERSECTS: 'GEOG_INTERSECTS' | 'geog_intersects'; +GEOG_DWITHIN: 'GEOG_DWITHIN' | 'geog_dwithin'; GEOM_INTERSECTS2D: 'GEOM_INTERSECTS2D' | 'geom_intersects2d'; GEOM_DWITHIN2D: 'GEOM_DWITHIN2D' | 'geom_dwithin2d'; GEOM_CONTAINS: 'GEOM_CONTAINS' | 'geom_contains'; diff --git a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp index d8266caae0..a1546aaf35 100644 --- a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp +++ b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp @@ -367,6 +367,8 @@ #include #include #include +#include +#include #include #include #include @@ -9068,6 +9070,25 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont return LogicalFunction(AlwaysNeTgeoGeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3))); } /* END CODEGEN PARSER GLUE: ALWAYS_NE_TGEO_GEO */ + case AntlrSQLParser::GEOG_INTERSECTS: { + PRECONDITION(ctx->functionParam().size() == 2, + "GeogIntersects requires 2 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + return LogicalFunction(GeogIntersectsLogicalFunction(std::move(arg0), std::move(arg1))); + } + /* END CODEGEN PARSER GLUE: GEOG_INTERSECTS */ + case AntlrSQLParser::GEOG_DWITHIN: { + PRECONDITION(ctx->functionParam().size() == 3, + "GeogDwithin requires 3 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + return LogicalFunction(GeogDwithinLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2))); + } + /* END CODEGEN PARSER GLUE: GEOG_DWITHIN */ /* END CODEGEN PARSER GLUE: GEOM_INTERSECTS2D */ case AntlrSQLParser::GEOM_DWITHIN2D: { PRECONDITION(ctx->functionParam().size() == 3, From 88d1f1976632fc7190455f87774731934cb480e5 Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Mon, 15 Jun 2026 00:13:39 +0200 Subject: [PATCH 57/96] feat(meos): add GEOM_INTERSECTS, GEOM_DWITHIN, ACOVERS_GEO_TGEO NES operators (W109) Wires geom_intersects(wkt1,wkt2) as a 2-arg planar predicate, geom_dwithin(wkt1,wkt2,tol) as a 3-arg planar within-distance predicate, and acovers_geo_tgeo(wkt,lon,lat,ts) as a 4-arg reversed-arg always-covers predicate (static geometry first in C call: gs, tgeo). --- .../Meos/AcoversGeoTgeoLogicalFunction.hpp | 51 +++++++++ .../Meos/GeomDwithinLogicalFunction.hpp | 50 ++++++++ .../Meos/GeomIntersectsLogicalFunction.hpp | 50 ++++++++ .../Meos/AcoversGeoTgeoLogicalFunction.cpp | 107 ++++++++++++++++++ .../src/Functions/Meos/CMakeLists.txt | 3 + .../Meos/GeomDwithinLogicalFunction.cpp | 103 +++++++++++++++++ .../Meos/GeomIntersectsLogicalFunction.cpp | 98 ++++++++++++++++ .../Meos/AcoversGeoTgeoPhysicalFunction.hpp | 35 ++++++ .../Meos/GeomDwithinPhysicalFunction.hpp | 34 ++++++ .../Meos/GeomIntersectsPhysicalFunction.hpp | 34 ++++++ .../Meos/AcoversGeoTgeoPhysicalFunction.cpp | 87 ++++++++++++++ .../src/Functions/Meos/CMakeLists.txt | 3 + .../Meos/GeomDwithinPhysicalFunction.cpp | 84 ++++++++++++++ .../Meos/GeomIntersectsPhysicalFunction.cpp | 78 +++++++++++++ nes-sql-parser/AntlrSQL.g4 | 5 +- .../src/AntlrSQLQueryPlanCreator.cpp | 33 ++++++ 16 files changed, 854 insertions(+), 1 deletion(-) create mode 100644 nes-logical-operators/include/Functions/Meos/AcoversGeoTgeoLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/GeomDwithinLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/GeomIntersectsLogicalFunction.hpp create mode 100644 nes-logical-operators/src/Functions/Meos/AcoversGeoTgeoLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/GeomDwithinLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/GeomIntersectsLogicalFunction.cpp create mode 100644 nes-physical-operators/include/Functions/Meos/AcoversGeoTgeoPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/GeomDwithinPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/GeomIntersectsPhysicalFunction.hpp create mode 100644 nes-physical-operators/src/Functions/Meos/AcoversGeoTgeoPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/GeomDwithinPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/GeomIntersectsPhysicalFunction.cpp diff --git a/nes-logical-operators/include/Functions/Meos/AcoversGeoTgeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AcoversGeoTgeoLogicalFunction.hpp new file mode 100644 index 0000000000..f2d450898f --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AcoversGeoTgeoLogicalFunction.hpp @@ -0,0 +1,51 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if the static geometry always covers the temporal geometry instant. + * + * Args: (wkt:VARCHAR, lon:FLOAT64, lat:FLOAT64, ts:UINT64) -> FLOAT64. + */ +class AcoversGeoTgeoLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AcoversGeoTgeo"; + + AcoversGeoTgeoLogicalFunction(LogicalFunction wkt, LogicalFunction lon, + LogicalFunction lat, LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/GeomDwithinLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeomDwithinLogicalFunction.hpp new file mode 100644 index 0000000000..b80ca3ebfe --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/GeomDwithinLogicalFunction.hpp @@ -0,0 +1,50 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if two planar geometries are within tolerance distance (default planar). + * + * Args: (wkt1:VARCHAR, wkt2:VARCHAR, tolerance:FLOAT64) -> FLOAT64. + */ +class GeomDwithinLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "GeomDwithin"; + + GeomDwithinLogicalFunction(LogicalFunction wkt1, LogicalFunction wkt2, LogicalFunction tolerance); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/GeomIntersectsLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeomIntersectsLogicalFunction.hpp new file mode 100644 index 0000000000..807ff15884 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/GeomIntersectsLogicalFunction.hpp @@ -0,0 +1,50 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if two planar geometries intersect (default planar, no dimension suffix). + * + * Args: (wkt1:VARCHAR, wkt2:VARCHAR) -> FLOAT64. + */ +class GeomIntersectsLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "GeomIntersects"; + + GeomIntersectsLogicalFunction(LogicalFunction wkt1, LogicalFunction wkt2); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AcoversGeoTgeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AcoversGeoTgeoLogicalFunction.cpp new file mode 100644 index 0000000000..593968654e --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AcoversGeoTgeoLogicalFunction.cpp @@ -0,0 +1,107 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AcoversGeoTgeoLogicalFunction::AcoversGeoTgeoLogicalFunction(LogicalFunction wkt, LogicalFunction lon, + LogicalFunction lat, LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(4); + parameters.push_back(std::move(wkt)); + parameters.push_back(std::move(lon)); + parameters.push_back(std::move(lat)); + parameters.push_back(std::move(ts)); +} + +DataType AcoversGeoTgeoLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AcoversGeoTgeoLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AcoversGeoTgeoLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AcoversGeoTgeoLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 4, + "AcoversGeoTgeoLogicalFunction requires 4 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AcoversGeoTgeoLogicalFunction::getType() const { return NAME; } + +bool AcoversGeoTgeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AcoversGeoTgeoLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction AcoversGeoTgeoLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(4); + c.emplace_back(parameters[0].withInferredDataType(schema)); + c.emplace_back(parameters[1].withInferredDataType(schema)); + c.emplace_back(parameters[2].withInferredDataType(schema)); + c.emplace_back(parameters[3].withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "wkt must be VARSIZED"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lon must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "lat must be FLOAT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); + return withChildren(c); +} + +SerializableFunction AcoversGeoTgeoLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAcoversGeoTgeoLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 4, + "AcoversGeoTgeoLogicalFunction requires 4 children but got {}", + arguments.children.size()); + return AcoversGeoTgeoLogicalFunction(std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt index 5df38df64e..7ab0bef4db 100644 --- a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt @@ -318,6 +318,9 @@ add_plugin(AlwaysEqTgeoGeo LogicalFunction nes-logical-operators AlwaysEqTgeoGeo add_plugin(AlwaysNeTgeoGeo LogicalFunction nes-logical-operators AlwaysNeTgeoGeoLogicalFunction.cpp) add_plugin(GeogIntersects LogicalFunction nes-logical-operators GeogIntersectsLogicalFunction.cpp) add_plugin(GeogDwithin LogicalFunction nes-logical-operators GeogDwithinLogicalFunction.cpp) +add_plugin(GeomIntersects LogicalFunction nes-logical-operators GeomIntersectsLogicalFunction.cpp) +add_plugin(GeomDwithin LogicalFunction nes-logical-operators GeomDwithinLogicalFunction.cpp) +add_plugin(AcoversGeoTgeo LogicalFunction nes-logical-operators AcoversGeoTgeoLogicalFunction.cpp) add_plugin(GeomIntersects2d LogicalFunction nes-logical-operators GeomIntersects2dLogicalFunction.cpp) add_plugin(GeomDwithin2d LogicalFunction nes-logical-operators GeomDwithin2dLogicalFunction.cpp) add_plugin(GeomContains LogicalFunction nes-logical-operators GeomContainsLogicalFunction.cpp) diff --git a/nes-logical-operators/src/Functions/Meos/GeomDwithinLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeomDwithinLogicalFunction.cpp new file mode 100644 index 0000000000..f803655d83 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/GeomDwithinLogicalFunction.cpp @@ -0,0 +1,103 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +GeomDwithinLogicalFunction::GeomDwithinLogicalFunction(LogicalFunction wkt1, LogicalFunction wkt2, + LogicalFunction tolerance) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(wkt1)); + parameters.push_back(std::move(wkt2)); + parameters.push_back(std::move(tolerance)); +} + +DataType GeomDwithinLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction GeomDwithinLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector GeomDwithinLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction GeomDwithinLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, + "GeomDwithinLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view GeomDwithinLogicalFunction::getType() const { return NAME; } + +bool GeomDwithinLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string GeomDwithinLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction GeomDwithinLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(3); + c.emplace_back(parameters[0].withInferredDataType(schema)); + c.emplace_back(parameters[1].withInferredDataType(schema)); + c.emplace_back(parameters[2].withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "wkt1 must be VARSIZED"); + INVARIANT(c[1].getDataType().isType(DataType::Type::VARSIZED), "wkt2 must be VARSIZED"); + INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "tolerance must be FLOAT64"); + return withChildren(c); +} + +SerializableFunction GeomDwithinLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeomDwithinLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "GeomDwithinLogicalFunction requires 3 children but got {}", + arguments.children.size()); + return GeomDwithinLogicalFunction(std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/GeomIntersectsLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeomIntersectsLogicalFunction.cpp new file mode 100644 index 0000000000..52412f137a --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/GeomIntersectsLogicalFunction.cpp @@ -0,0 +1,98 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +GeomIntersectsLogicalFunction::GeomIntersectsLogicalFunction(LogicalFunction wkt1, LogicalFunction wkt2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(2); + parameters.push_back(std::move(wkt1)); + parameters.push_back(std::move(wkt2)); +} + +DataType GeomIntersectsLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction GeomIntersectsLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector GeomIntersectsLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction GeomIntersectsLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 2, + "GeomIntersectsLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view GeomIntersectsLogicalFunction::getType() const { return NAME; } + +bool GeomIntersectsLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string GeomIntersectsLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction GeomIntersectsLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(2); + c.emplace_back(parameters[0].withInferredDataType(schema)); + c.emplace_back(parameters[1].withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "wkt1 must be VARSIZED"); + INVARIANT(c[1].getDataType().isType(DataType::Type::VARSIZED), "wkt2 must be VARSIZED"); + return withChildren(c); +} + +SerializableFunction GeomIntersectsLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeomIntersectsLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 2, + "GeomIntersectsLogicalFunction requires 2 children but got {}", + arguments.children.size()); + return GeomIntersectsLogicalFunction(std::move(arguments.children[0]), + std::move(arguments.children[1])); +} + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AcoversGeoTgeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AcoversGeoTgeoPhysicalFunction.hpp new file mode 100644 index 0000000000..ca766b04b8 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AcoversGeoTgeoPhysicalFunction.hpp @@ -0,0 +1,35 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class AcoversGeoTgeoPhysicalFunction : public PhysicalFunctionConcept { +public: + AcoversGeoTgeoPhysicalFunction(PhysicalFunction wkt, PhysicalFunction lon, + PhysicalFunction lat, PhysicalFunction ts); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeomDwithinPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeomDwithinPhysicalFunction.hpp new file mode 100644 index 0000000000..75375972e6 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/GeomDwithinPhysicalFunction.hpp @@ -0,0 +1,34 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class GeomDwithinPhysicalFunction : public PhysicalFunctionConcept { +public: + GeomDwithinPhysicalFunction(PhysicalFunction wkt1, PhysicalFunction wkt2, PhysicalFunction tolerance); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeomIntersectsPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeomIntersectsPhysicalFunction.hpp new file mode 100644 index 0000000000..9db923782d --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/GeomIntersectsPhysicalFunction.hpp @@ -0,0 +1,34 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class GeomIntersectsPhysicalFunction : public PhysicalFunctionConcept { +public: + GeomIntersectsPhysicalFunction(PhysicalFunction wkt1, PhysicalFunction wkt2); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AcoversGeoTgeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AcoversGeoTgeoPhysicalFunction.cpp new file mode 100644 index 0000000000..aa7789b812 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AcoversGeoTgeoPhysicalFunction.cpp @@ -0,0 +1,87 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +AcoversGeoTgeoPhysicalFunction::AcoversGeoTgeoPhysicalFunction(PhysicalFunction wkt, PhysicalFunction lon, + PhysicalFunction lat, PhysicalFunction ts) +{ + paramFns.reserve(4); + paramFns.push_back(std::move(wkt)); + paramFns.push_back(std::move(lon)); + paramFns.push_back(std::move(lat)); + paramFns.push_back(std::move(ts)); +} + +VarVal AcoversGeoTgeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto wkt = paramFns[0].execute(record, arena).cast(); + auto lon = paramFns[1].execute(record, arena).cast(); + auto lat = paramFns[2].execute(record, arena).cast(); + auto ts = paramFns[3].execute(record, arena).cast(); + + const auto result = nautilus::invoke( + +[](const char* w, uint32_t wsz, + double lon, double lat, uint64_t ts) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string wktStr(w, wsz); + GSERIALIZED* gs = geom_in(wktStr.c_str(), -1); + if (!gs) return 0.0; + std::string tgeoWkt = fmt::format("SRID=4326;POINT({},{})@{}", lon, lat, ts); + Temporal* tgeo = tgeompoint_in(tgeoWkt.c_str()); + if (!tgeo) { free(gs); return 0.0; } + int r = acovers_geo_tgeo(gs, tgeo); + free(gs); free(tgeo); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + wkt, lon, lat, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAcoversGeoTgeoPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 4, + "AcoversGeoTgeoPhysicalFunction requires 4 children but got {}", + arguments.childFunctions.size()); + return AcoversGeoTgeoPhysicalFunction(std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt index 3ff0225659..d14175121c 100644 --- a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt @@ -317,6 +317,9 @@ add_plugin(AlwaysEqTgeoGeo PhysicalFunction nes-physical-operators AlwaysEqTgeoG add_plugin(AlwaysNeTgeoGeo PhysicalFunction nes-physical-operators AlwaysNeTgeoGeoPhysicalFunction.cpp) add_plugin(GeogIntersects PhysicalFunction nes-physical-operators GeogIntersectsPhysicalFunction.cpp) add_plugin(GeogDwithin PhysicalFunction nes-physical-operators GeogDwithinPhysicalFunction.cpp) +add_plugin(GeomIntersects PhysicalFunction nes-physical-operators GeomIntersectsPhysicalFunction.cpp) +add_plugin(GeomDwithin PhysicalFunction nes-physical-operators GeomDwithinPhysicalFunction.cpp) +add_plugin(AcoversGeoTgeo PhysicalFunction nes-physical-operators AcoversGeoTgeoPhysicalFunction.cpp) add_plugin(GeomIntersects2d PhysicalFunction nes-physical-operators GeomIntersects2dPhysicalFunction.cpp) add_plugin(GeomDwithin2d PhysicalFunction nes-physical-operators GeomDwithin2dPhysicalFunction.cpp) add_plugin(GeomContains PhysicalFunction nes-physical-operators GeomContainsPhysicalFunction.cpp) diff --git a/nes-physical-operators/src/Functions/Meos/GeomDwithinPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeomDwithinPhysicalFunction.cpp new file mode 100644 index 0000000000..c66c4affd1 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/GeomDwithinPhysicalFunction.cpp @@ -0,0 +1,84 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +GeomDwithinPhysicalFunction::GeomDwithinPhysicalFunction(PhysicalFunction wkt1, PhysicalFunction wkt2, + PhysicalFunction tolerance) +{ + paramFns.reserve(3); + paramFns.push_back(std::move(wkt1)); + paramFns.push_back(std::move(wkt2)); + paramFns.push_back(std::move(tolerance)); +} + +VarVal GeomDwithinPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto s1 = paramFns[0].execute(record, arena).cast(); + auto s2 = paramFns[1].execute(record, arena).cast(); + auto tol = paramFns[2].execute(record, arena).cast(); + + const auto result = nautilus::invoke( + +[](const char* w1, uint32_t w1sz, + const char* w2, uint32_t w2sz, + double tol) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string s1(w1, w1sz); + std::string s2(w2, w2sz); + GSERIALIZED* gs1 = geom_in(s1.c_str(), -1); + if (!gs1) return 0.0; + GSERIALIZED* gs2 = geom_in(s2.c_str(), -1); + if (!gs2) { free(gs1); return 0.0; } + double r = geom_dwithin(gs1, gs2, tol) ? 1.0 : 0.0; + free(gs1); free(gs2); + return r; + } catch (const std::exception&) { return 0.0; } + }, + s1, s2, tol); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterGeomDwithinPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "GeomDwithinPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + return GeomDwithinPhysicalFunction(std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/GeomIntersectsPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeomIntersectsPhysicalFunction.cpp new file mode 100644 index 0000000000..7b4878ec95 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/GeomIntersectsPhysicalFunction.cpp @@ -0,0 +1,78 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +GeomIntersectsPhysicalFunction::GeomIntersectsPhysicalFunction(PhysicalFunction wkt1, PhysicalFunction wkt2) +{ + paramFns.reserve(2); + paramFns.push_back(std::move(wkt1)); + paramFns.push_back(std::move(wkt2)); +} + +VarVal GeomIntersectsPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto s1 = paramFns[0].execute(record, arena).cast(); + auto s2 = paramFns[1].execute(record, arena).cast(); + + const auto result = nautilus::invoke( + +[](const char* w1, uint32_t w1sz, const char* w2, uint32_t w2sz) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string s1(w1, w1sz); + std::string s2(w2, w2sz); + GSERIALIZED* gs1 = geom_in(s1.c_str(), -1); + if (!gs1) return 0.0; + GSERIALIZED* gs2 = geom_in(s2.c_str(), -1); + if (!gs2) { free(gs1); return 0.0; } + double r = geom_intersects(gs1, gs2) ? 1.0 : 0.0; + free(gs1); free(gs2); + return r; + } catch (const std::exception&) { return 0.0; } + }, + s1, s2); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterGeomIntersectsPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 2, + "GeomIntersectsPhysicalFunction requires 2 children but got {}", + arguments.childFunctions.size()); + return GeomIntersectsPhysicalFunction(std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1])); +} + +} // namespace NES diff --git a/nes-sql-parser/AntlrSQL.g4 b/nes-sql-parser/AntlrSQL.g4 index a93e0c81c1..1ca2663af6 100644 --- a/nes-sql-parser/AntlrSQL.g4 +++ b/nes-sql-parser/AntlrSQL.g4 @@ -295,7 +295,7 @@ timeUnit: MS timestampParameter: name=identifier; -functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT | TGE_TTEXT_TEXT | TGE_TEXT_TTEXT | TGT_TTEXT_TEXT | TGT_TEXT_TTEXT | TLE_TTEXT_TEXT | TLE_TEXT_TTEXT | TLT_TTEXT_TEXT | TLT_TEXT_TTEXT | TTEXT_UPPER | TTEXT_LOWER | TTEXT_INITCAP | TEXTCAT_TTEXT_TEXT | TEXTCAT_TEXT_TTEXT | TEXTCAT_TTEXT_TTEXT | GEOM_LENGTH | GEOM_PERIMETER | GEOM_AZIMUTH | GEOG_AREA | GEOG_LENGTH | GEOG_PERIMETER | GEOM_IS_EMPTY | AINTERSECTS_TGEO_GEO | ACOVERS_TGEO_GEO | ADISJOINT_TGEO_GEO | ADWITHIN_TGEO_GEO | EINTERSECTS_TGEO_GEO | ETOUCHES_TGEO_GEO | ECONTAINS_TGEO_GEO | ACONTAINS_TGEO_GEO | ATOUCHES_TGEO_GEO | GEO_NUM_POINTS | GEO_NUM_GEOS | GEO_SRID | GEO_IS_UNITARY | GEO_EQUALS | GEO_SAME | GEOG_DISTANCE | NAD_TGEO_GEO | EVER_EQ_TGEO_GEO | EVER_NE_TGEO_GEO | ALWAYS_EQ_TGEO_GEO | ALWAYS_NE_TGEO_GEO | GEOG_INTERSECTS | GEOG_DWITHIN | GEOM_INTERSECTS2D | GEOM_DWITHIN2D | GEOM_CONTAINS | GEOM_DISJOINT2D | GEOM_COVERS | GEOM_TOUCHES | GEOM_INTERSECTS3D | GEOM_DWITHIN3D | GEOM_DISTANCE2D | GEOM_DISTANCE3D; +functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT | TGE_TTEXT_TEXT | TGE_TEXT_TTEXT | TGT_TTEXT_TEXT | TGT_TEXT_TTEXT | TLE_TTEXT_TEXT | TLE_TEXT_TTEXT | TLT_TTEXT_TEXT | TLT_TEXT_TTEXT | TTEXT_UPPER | TTEXT_LOWER | TTEXT_INITCAP | TEXTCAT_TTEXT_TEXT | TEXTCAT_TEXT_TTEXT | TEXTCAT_TTEXT_TTEXT | GEOM_LENGTH | GEOM_PERIMETER | GEOM_AZIMUTH | GEOG_AREA | GEOG_LENGTH | GEOG_PERIMETER | GEOM_IS_EMPTY | AINTERSECTS_TGEO_GEO | ACOVERS_TGEO_GEO | ADISJOINT_TGEO_GEO | ADWITHIN_TGEO_GEO | EINTERSECTS_TGEO_GEO | ETOUCHES_TGEO_GEO | ECONTAINS_TGEO_GEO | ACONTAINS_TGEO_GEO | ATOUCHES_TGEO_GEO | GEO_NUM_POINTS | GEO_NUM_GEOS | GEO_SRID | GEO_IS_UNITARY | GEO_EQUALS | GEO_SAME | GEOG_DISTANCE | NAD_TGEO_GEO | EVER_EQ_TGEO_GEO | EVER_NE_TGEO_GEO | ALWAYS_EQ_TGEO_GEO | ALWAYS_NE_TGEO_GEO | GEOG_INTERSECTS | GEOG_DWITHIN | ACOVERS_GEO_TGEO | GEOM_INTERSECTS | GEOM_DWITHIN | GEOM_INTERSECTS2D | GEOM_DWITHIN2D | GEOM_CONTAINS | GEOM_DISJOINT2D | GEOM_COVERS | GEOM_TOUCHES | GEOM_INTERSECTS3D | GEOM_DWITHIN3D | GEOM_DISTANCE2D | GEOM_DISTANCE3D; sinkClause: INTO sink (',' sink)*; @@ -788,6 +788,9 @@ ALWAYS_EQ_TGEO_GEO: 'ALWAYS_EQ_TGEO_GEO' | 'always_eq_tgeo_geo'; ALWAYS_NE_TGEO_GEO: 'ALWAYS_NE_TGEO_GEO' | 'always_ne_tgeo_geo'; GEOG_INTERSECTS: 'GEOG_INTERSECTS' | 'geog_intersects'; GEOG_DWITHIN: 'GEOG_DWITHIN' | 'geog_dwithin'; +ACOVERS_GEO_TGEO: 'ACOVERS_GEO_TGEO' | 'acovers_geo_tgeo'; +GEOM_INTERSECTS: 'GEOM_INTERSECTS' | 'geom_intersects'; +GEOM_DWITHIN: 'GEOM_DWITHIN' | 'geom_dwithin'; GEOM_INTERSECTS2D: 'GEOM_INTERSECTS2D' | 'geom_intersects2d'; GEOM_DWITHIN2D: 'GEOM_DWITHIN2D' | 'geom_dwithin2d'; GEOM_CONTAINS: 'GEOM_CONTAINS' | 'geom_contains'; diff --git a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp index a1546aaf35..5058b60865 100644 --- a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp +++ b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp @@ -369,6 +369,9 @@ #include #include #include +#include +#include +#include #include #include #include @@ -9089,6 +9092,36 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont return LogicalFunction(GeogDwithinLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2))); } /* END CODEGEN PARSER GLUE: GEOG_DWITHIN */ + case AntlrSQLParser::GEOM_INTERSECTS: { + PRECONDITION(ctx->functionParam().size() == 2, + "GeomIntersects requires 2 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + return LogicalFunction(GeomIntersectsLogicalFunction(std::move(arg0), std::move(arg1))); + } + /* END CODEGEN PARSER GLUE: GEOM_INTERSECTS */ + case AntlrSQLParser::GEOM_DWITHIN: { + PRECONDITION(ctx->functionParam().size() == 3, + "GeomDwithin requires 3 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + return LogicalFunction(GeomDwithinLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2))); + } + /* END CODEGEN PARSER GLUE: GEOM_DWITHIN */ + case AntlrSQLParser::ACOVERS_GEO_TGEO: { + PRECONDITION(ctx->functionParam().size() == 4, + "AcoversGeoTgeo requires 4 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + return LogicalFunction(AcoversGeoTgeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3))); + } + /* END CODEGEN PARSER GLUE: ACOVERS_GEO_TGEO */ /* END CODEGEN PARSER GLUE: GEOM_INTERSECTS2D */ case AntlrSQLParser::GEOM_DWITHIN2D: { PRECONDITION(ctx->functionParam().size() == 3, From 370779344b34c952cc2901fe56d670c3bf2df2a8 Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Mon, 15 Jun 2026 00:33:33 +0200 Subject: [PATCH 58/96] feat(meos): add H3_GS_POINT_TO_CELL and EVER/ALWAYS_EQ/NE_TH3INDEX_H3INDEX 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. --- ...AlwaysEqTh3indexH3indexLogicalFunction.hpp | 50 +++++++++ ...AlwaysNeTh3indexH3indexLogicalFunction.hpp | 50 +++++++++ .../EverEqTh3indexH3indexLogicalFunction.hpp | 50 +++++++++ .../EverNeTh3indexH3indexLogicalFunction.hpp | 50 +++++++++ .../Meos/H3GsPointToCellLogicalFunction.hpp | 50 +++++++++ ...AlwaysEqTh3indexH3indexLogicalFunction.cpp | 103 ++++++++++++++++++ ...AlwaysNeTh3indexH3indexLogicalFunction.cpp | 103 ++++++++++++++++++ .../src/Functions/Meos/CMakeLists.txt | 5 + .../EverEqTh3indexH3indexLogicalFunction.cpp | 103 ++++++++++++++++++ .../EverNeTh3indexH3indexLogicalFunction.cpp | 103 ++++++++++++++++++ .../Meos/H3GsPointToCellLogicalFunction.cpp | 103 ++++++++++++++++++ ...lwaysEqTh3indexH3indexPhysicalFunction.hpp | 34 ++++++ ...lwaysNeTh3indexH3indexPhysicalFunction.hpp | 34 ++++++ .../EverEqTh3indexH3indexPhysicalFunction.hpp | 34 ++++++ .../EverNeTh3indexH3indexPhysicalFunction.hpp | 34 ++++++ .../Meos/H3GsPointToCellPhysicalFunction.hpp | 34 ++++++ ...lwaysEqTh3indexH3indexPhysicalFunction.cpp | 76 +++++++++++++ ...lwaysNeTh3indexH3indexPhysicalFunction.cpp | 76 +++++++++++++ .../src/Functions/Meos/CMakeLists.txt | 5 + .../EverEqTh3indexH3indexPhysicalFunction.cpp | 76 +++++++++++++ .../EverNeTh3indexH3indexPhysicalFunction.cpp | 76 +++++++++++++ .../Meos/H3GsPointToCellPhysicalFunction.cpp | 91 ++++++++++++++++ nes-sql-parser/AntlrSQL.g4 | 7 +- .../src/AntlrSQLQueryPlanCreator.cpp | 55 ++++++++++ 24 files changed, 1401 insertions(+), 1 deletion(-) create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysEqTh3indexH3indexLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysNeTh3indexH3indexLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverEqTh3indexH3indexLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverNeTh3indexH3indexLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/H3GsPointToCellLogicalFunction.hpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysEqTh3indexH3indexLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysNeTh3indexH3indexLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverEqTh3indexH3indexLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverNeTh3indexH3indexLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/H3GsPointToCellLogicalFunction.cpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysEqTh3indexH3indexPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysNeTh3indexH3indexPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverEqTh3indexH3indexPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverNeTh3indexH3indexPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/H3GsPointToCellPhysicalFunction.hpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysEqTh3indexH3indexPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysNeTh3indexH3indexPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverEqTh3indexH3indexPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverNeTh3indexH3indexPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/H3GsPointToCellPhysicalFunction.cpp diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysEqTh3indexH3indexLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysEqTh3indexH3indexLogicalFunction.hpp new file mode 100644 index 0000000000..d2c43b7f9f --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysEqTh3indexH3indexLogicalFunction.hpp @@ -0,0 +1,50 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if the th3index instant is always equal to the target H3 cell. + * + * Args: (cell:UINT64, ts:UINT64, target:UINT64) -> FLOAT64. + */ +class AlwaysEqTh3indexH3indexLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysEqTh3indexH3index"; + + AlwaysEqTh3indexH3indexLogicalFunction(LogicalFunction cell, LogicalFunction ts, LogicalFunction target); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysNeTh3indexH3indexLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysNeTh3indexH3indexLogicalFunction.hpp new file mode 100644 index 0000000000..ed7fdd1e51 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysNeTh3indexH3indexLogicalFunction.hpp @@ -0,0 +1,50 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if the th3index instant is always not equal to the target H3 cell. + * + * Args: (cell:UINT64, ts:UINT64, target:UINT64) -> FLOAT64. + */ +class AlwaysNeTh3indexH3indexLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysNeTh3indexH3index"; + + AlwaysNeTh3indexH3indexLogicalFunction(LogicalFunction cell, LogicalFunction ts, LogicalFunction target); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverEqTh3indexH3indexLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverEqTh3indexH3indexLogicalFunction.hpp new file mode 100644 index 0000000000..8014b55647 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverEqTh3indexH3indexLogicalFunction.hpp @@ -0,0 +1,50 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if the th3index instant is ever equal to the target H3 cell. + * + * Args: (cell:UINT64, ts:UINT64, target:UINT64) -> FLOAT64. + */ +class EverEqTh3indexH3indexLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverEqTh3indexH3index"; + + EverEqTh3indexH3indexLogicalFunction(LogicalFunction cell, LogicalFunction ts, LogicalFunction target); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverNeTh3indexH3indexLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverNeTh3indexH3indexLogicalFunction.hpp new file mode 100644 index 0000000000..7bc68238bd --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverNeTh3indexH3indexLogicalFunction.hpp @@ -0,0 +1,50 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if the th3index instant is ever not equal to the target H3 cell. + * + * Args: (cell:UINT64, ts:UINT64, target:UINT64) -> FLOAT64. + */ +class EverNeTh3indexH3indexLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverNeTh3indexH3index"; + + EverNeTh3indexH3indexLogicalFunction(LogicalFunction cell, LogicalFunction ts, LogicalFunction target); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/H3GsPointToCellLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/H3GsPointToCellLogicalFunction.hpp new file mode 100644 index 0000000000..ae077870fd --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/H3GsPointToCellLogicalFunction.hpp @@ -0,0 +1,50 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns the H3 cell index (hex string) for a point at the given resolution. + * + * Args: (lon:FLOAT64, lat:FLOAT64, resolution:UINT64) -> VARCHAR. + */ +class H3GsPointToCellLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "H3GsPointToCell"; + + H3GsPointToCellLogicalFunction(LogicalFunction lon, LogicalFunction lat, LogicalFunction resolution); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysEqTh3indexH3indexLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysEqTh3indexH3indexLogicalFunction.cpp new file mode 100644 index 0000000000..e8fb5a8b8c --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysEqTh3indexH3indexLogicalFunction.cpp @@ -0,0 +1,103 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AlwaysEqTh3indexH3indexLogicalFunction::AlwaysEqTh3indexH3indexLogicalFunction(LogicalFunction cell, LogicalFunction ts, + LogicalFunction target) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(cell)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(target)); +} + +DataType AlwaysEqTh3indexH3indexLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysEqTh3indexH3indexLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AlwaysEqTh3indexH3indexLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysEqTh3indexH3indexLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, + "AlwaysEqTh3indexH3indexLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AlwaysEqTh3indexH3indexLogicalFunction::getType() const { return NAME; } + +bool AlwaysEqTh3indexH3indexLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AlwaysEqTh3indexH3indexLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction AlwaysEqTh3indexH3indexLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(3); + c.emplace_back(parameters[0].withInferredDataType(schema)); + c.emplace_back(parameters[1].withInferredDataType(schema)); + c.emplace_back(parameters[2].withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "cell must be UINT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "target must be UINT64"); + return withChildren(c); +} + +SerializableFunction AlwaysEqTh3indexH3indexLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysEqTh3indexH3indexLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "AlwaysEqTh3indexH3indexLogicalFunction requires 3 children but got {}", + arguments.children.size()); + return AlwaysEqTh3indexH3indexLogicalFunction(std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysNeTh3indexH3indexLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysNeTh3indexH3indexLogicalFunction.cpp new file mode 100644 index 0000000000..0ad2ea86d5 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysNeTh3indexH3indexLogicalFunction.cpp @@ -0,0 +1,103 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AlwaysNeTh3indexH3indexLogicalFunction::AlwaysNeTh3indexH3indexLogicalFunction(LogicalFunction cell, LogicalFunction ts, + LogicalFunction target) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(cell)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(target)); +} + +DataType AlwaysNeTh3indexH3indexLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysNeTh3indexH3indexLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AlwaysNeTh3indexH3indexLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysNeTh3indexH3indexLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, + "AlwaysNeTh3indexH3indexLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AlwaysNeTh3indexH3indexLogicalFunction::getType() const { return NAME; } + +bool AlwaysNeTh3indexH3indexLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AlwaysNeTh3indexH3indexLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction AlwaysNeTh3indexH3indexLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(3); + c.emplace_back(parameters[0].withInferredDataType(schema)); + c.emplace_back(parameters[1].withInferredDataType(schema)); + c.emplace_back(parameters[2].withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "cell must be UINT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "target must be UINT64"); + return withChildren(c); +} + +SerializableFunction AlwaysNeTh3indexH3indexLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysNeTh3indexH3indexLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "AlwaysNeTh3indexH3indexLogicalFunction requires 3 children but got {}", + arguments.children.size()); + return AlwaysNeTh3indexH3indexLogicalFunction(std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt index 7ab0bef4db..88413fc1bc 100644 --- a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt @@ -321,6 +321,11 @@ add_plugin(GeogDwithin LogicalFunction nes-logical-operators GeogDwithinLogicalF add_plugin(GeomIntersects LogicalFunction nes-logical-operators GeomIntersectsLogicalFunction.cpp) add_plugin(GeomDwithin LogicalFunction nes-logical-operators GeomDwithinLogicalFunction.cpp) add_plugin(AcoversGeoTgeo LogicalFunction nes-logical-operators AcoversGeoTgeoLogicalFunction.cpp) +add_plugin(H3GsPointToCell LogicalFunction nes-logical-operators H3GsPointToCellLogicalFunction.cpp) +add_plugin(EverEqTh3indexH3index LogicalFunction nes-logical-operators EverEqTh3indexH3indexLogicalFunction.cpp) +add_plugin(EverNeTh3indexH3index LogicalFunction nes-logical-operators EverNeTh3indexH3indexLogicalFunction.cpp) +add_plugin(AlwaysEqTh3indexH3index LogicalFunction nes-logical-operators AlwaysEqTh3indexH3indexLogicalFunction.cpp) +add_plugin(AlwaysNeTh3indexH3index LogicalFunction nes-logical-operators AlwaysNeTh3indexH3indexLogicalFunction.cpp) add_plugin(GeomIntersects2d LogicalFunction nes-logical-operators GeomIntersects2dLogicalFunction.cpp) add_plugin(GeomDwithin2d LogicalFunction nes-logical-operators GeomDwithin2dLogicalFunction.cpp) add_plugin(GeomContains LogicalFunction nes-logical-operators GeomContainsLogicalFunction.cpp) diff --git a/nes-logical-operators/src/Functions/Meos/EverEqTh3indexH3indexLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverEqTh3indexH3indexLogicalFunction.cpp new file mode 100644 index 0000000000..7c6aabf12e --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverEqTh3indexH3indexLogicalFunction.cpp @@ -0,0 +1,103 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EverEqTh3indexH3indexLogicalFunction::EverEqTh3indexH3indexLogicalFunction(LogicalFunction cell, LogicalFunction ts, + LogicalFunction target) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(cell)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(target)); +} + +DataType EverEqTh3indexH3indexLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverEqTh3indexH3indexLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EverEqTh3indexH3indexLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverEqTh3indexH3indexLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, + "EverEqTh3indexH3indexLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EverEqTh3indexH3indexLogicalFunction::getType() const { return NAME; } + +bool EverEqTh3indexH3indexLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EverEqTh3indexH3indexLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction EverEqTh3indexH3indexLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(3); + c.emplace_back(parameters[0].withInferredDataType(schema)); + c.emplace_back(parameters[1].withInferredDataType(schema)); + c.emplace_back(parameters[2].withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "cell must be UINT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "target must be UINT64"); + return withChildren(c); +} + +SerializableFunction EverEqTh3indexH3indexLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverEqTh3indexH3indexLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "EverEqTh3indexH3indexLogicalFunction requires 3 children but got {}", + arguments.children.size()); + return EverEqTh3indexH3indexLogicalFunction(std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverNeTh3indexH3indexLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverNeTh3indexH3indexLogicalFunction.cpp new file mode 100644 index 0000000000..cec911112c --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverNeTh3indexH3indexLogicalFunction.cpp @@ -0,0 +1,103 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EverNeTh3indexH3indexLogicalFunction::EverNeTh3indexH3indexLogicalFunction(LogicalFunction cell, LogicalFunction ts, + LogicalFunction target) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(cell)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(target)); +} + +DataType EverNeTh3indexH3indexLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverNeTh3indexH3indexLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EverNeTh3indexH3indexLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverNeTh3indexH3indexLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, + "EverNeTh3indexH3indexLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EverNeTh3indexH3indexLogicalFunction::getType() const { return NAME; } + +bool EverNeTh3indexH3indexLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EverNeTh3indexH3indexLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction EverNeTh3indexH3indexLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(3); + c.emplace_back(parameters[0].withInferredDataType(schema)); + c.emplace_back(parameters[1].withInferredDataType(schema)); + c.emplace_back(parameters[2].withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "cell must be UINT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "target must be UINT64"); + return withChildren(c); +} + +SerializableFunction EverNeTh3indexH3indexLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverNeTh3indexH3indexLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "EverNeTh3indexH3indexLogicalFunction requires 3 children but got {}", + arguments.children.size()); + return EverNeTh3indexH3indexLogicalFunction(std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/H3GsPointToCellLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/H3GsPointToCellLogicalFunction.cpp new file mode 100644 index 0000000000..054c766444 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/H3GsPointToCellLogicalFunction.cpp @@ -0,0 +1,103 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +H3GsPointToCellLogicalFunction::H3GsPointToCellLogicalFunction(LogicalFunction lon, LogicalFunction lat, + LogicalFunction resolution) + : dataType(DataTypeProvider::provideDataType(DataType::Type::VARSIZED)) +{ + parameters.reserve(3); + parameters.push_back(std::move(lon)); + parameters.push_back(std::move(lat)); + parameters.push_back(std::move(resolution)); +} + +DataType H3GsPointToCellLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction H3GsPointToCellLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector H3GsPointToCellLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction H3GsPointToCellLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, + "H3GsPointToCellLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view H3GsPointToCellLogicalFunction::getType() const { return NAME; } + +bool H3GsPointToCellLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string H3GsPointToCellLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction H3GsPointToCellLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(3); + c.emplace_back(parameters[0].withInferredDataType(schema)); + c.emplace_back(parameters[1].withInferredDataType(schema)); + c.emplace_back(parameters[2].withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon must be FLOAT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "resolution must be UINT64"); + return withChildren(c); +} + +SerializableFunction H3GsPointToCellLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterH3GsPointToCellLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "H3GsPointToCellLogicalFunction requires 3 children but got {}", + arguments.children.size()); + return H3GsPointToCellLogicalFunction(std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2])); +} + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysEqTh3indexH3indexPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysEqTh3indexH3indexPhysicalFunction.hpp new file mode 100644 index 0000000000..09e76ee3fe --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysEqTh3indexH3indexPhysicalFunction.hpp @@ -0,0 +1,34 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class AlwaysEqTh3indexH3indexPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysEqTh3indexH3indexPhysicalFunction(PhysicalFunction cell, PhysicalFunction ts, PhysicalFunction target); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysNeTh3indexH3indexPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysNeTh3indexH3indexPhysicalFunction.hpp new file mode 100644 index 0000000000..1c46209d5f --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysNeTh3indexH3indexPhysicalFunction.hpp @@ -0,0 +1,34 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class AlwaysNeTh3indexH3indexPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysNeTh3indexH3indexPhysicalFunction(PhysicalFunction cell, PhysicalFunction ts, PhysicalFunction target); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverEqTh3indexH3indexPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverEqTh3indexH3indexPhysicalFunction.hpp new file mode 100644 index 0000000000..7d62fb93ff --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverEqTh3indexH3indexPhysicalFunction.hpp @@ -0,0 +1,34 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class EverEqTh3indexH3indexPhysicalFunction : public PhysicalFunctionConcept { +public: + EverEqTh3indexH3indexPhysicalFunction(PhysicalFunction cell, PhysicalFunction ts, PhysicalFunction target); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverNeTh3indexH3indexPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverNeTh3indexH3indexPhysicalFunction.hpp new file mode 100644 index 0000000000..413bbf83b7 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverNeTh3indexH3indexPhysicalFunction.hpp @@ -0,0 +1,34 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class EverNeTh3indexH3indexPhysicalFunction : public PhysicalFunctionConcept { +public: + EverNeTh3indexH3indexPhysicalFunction(PhysicalFunction cell, PhysicalFunction ts, PhysicalFunction target); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/H3GsPointToCellPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/H3GsPointToCellPhysicalFunction.hpp new file mode 100644 index 0000000000..3410feb5e7 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/H3GsPointToCellPhysicalFunction.hpp @@ -0,0 +1,34 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class H3GsPointToCellPhysicalFunction : public PhysicalFunctionConcept { +public: + H3GsPointToCellPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, PhysicalFunction resolution); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysEqTh3indexH3indexPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysEqTh3indexH3indexPhysicalFunction.cpp new file mode 100644 index 0000000000..567249216c --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysEqTh3indexH3indexPhysicalFunction.cpp @@ -0,0 +1,76 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +AlwaysEqTh3indexH3indexPhysicalFunction::AlwaysEqTh3indexH3indexPhysicalFunction(PhysicalFunction cell, PhysicalFunction ts, + PhysicalFunction target) +{ + paramFns.reserve(3); + paramFns.push_back(std::move(cell)); + paramFns.push_back(std::move(ts)); + paramFns.push_back(std::move(target)); +} + +VarVal AlwaysEqTh3indexH3indexPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto cell = paramFns[0].execute(record, arena).cast(); + auto ts = paramFns[1].execute(record, arena).cast(); + auto target = paramFns[2].execute(record, arena).cast(); + + const auto result = nautilus::invoke( + +[](uint64_t cell, uint64_t ts, uint64_t target) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + Temporal* inst = th3indexinst_make((H3Index)cell, (TimestampTz)ts); + if (!inst) return 0.0; + int r = always_eq_th3index_h3index(inst, (H3Index)target); + free(inst); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + cell, ts, target); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysEqTh3indexH3indexPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "AlwaysEqTh3indexH3indexPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + return AlwaysEqTh3indexH3indexPhysicalFunction(std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysNeTh3indexH3indexPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysNeTh3indexH3indexPhysicalFunction.cpp new file mode 100644 index 0000000000..ac819a26dd --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysNeTh3indexH3indexPhysicalFunction.cpp @@ -0,0 +1,76 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +AlwaysNeTh3indexH3indexPhysicalFunction::AlwaysNeTh3indexH3indexPhysicalFunction(PhysicalFunction cell, PhysicalFunction ts, + PhysicalFunction target) +{ + paramFns.reserve(3); + paramFns.push_back(std::move(cell)); + paramFns.push_back(std::move(ts)); + paramFns.push_back(std::move(target)); +} + +VarVal AlwaysNeTh3indexH3indexPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto cell = paramFns[0].execute(record, arena).cast(); + auto ts = paramFns[1].execute(record, arena).cast(); + auto target = paramFns[2].execute(record, arena).cast(); + + const auto result = nautilus::invoke( + +[](uint64_t cell, uint64_t ts, uint64_t target) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + Temporal* inst = th3indexinst_make((H3Index)cell, (TimestampTz)ts); + if (!inst) return 0.0; + int r = always_ne_th3index_h3index(inst, (H3Index)target); + free(inst); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + cell, ts, target); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysNeTh3indexH3indexPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "AlwaysNeTh3indexH3indexPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + return AlwaysNeTh3indexH3indexPhysicalFunction(std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt index d14175121c..50e4d63d19 100644 --- a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt @@ -320,6 +320,11 @@ add_plugin(GeogDwithin PhysicalFunction nes-physical-operators GeogDwithinPhysic add_plugin(GeomIntersects PhysicalFunction nes-physical-operators GeomIntersectsPhysicalFunction.cpp) add_plugin(GeomDwithin PhysicalFunction nes-physical-operators GeomDwithinPhysicalFunction.cpp) add_plugin(AcoversGeoTgeo PhysicalFunction nes-physical-operators AcoversGeoTgeoPhysicalFunction.cpp) +add_plugin(H3GsPointToCell PhysicalFunction nes-physical-operators H3GsPointToCellPhysicalFunction.cpp) +add_plugin(EverEqTh3indexH3index PhysicalFunction nes-physical-operators EverEqTh3indexH3indexPhysicalFunction.cpp) +add_plugin(EverNeTh3indexH3index PhysicalFunction nes-physical-operators EverNeTh3indexH3indexPhysicalFunction.cpp) +add_plugin(AlwaysEqTh3indexH3index PhysicalFunction nes-physical-operators AlwaysEqTh3indexH3indexPhysicalFunction.cpp) +add_plugin(AlwaysNeTh3indexH3index PhysicalFunction nes-physical-operators AlwaysNeTh3indexH3indexPhysicalFunction.cpp) add_plugin(GeomIntersects2d PhysicalFunction nes-physical-operators GeomIntersects2dPhysicalFunction.cpp) add_plugin(GeomDwithin2d PhysicalFunction nes-physical-operators GeomDwithin2dPhysicalFunction.cpp) add_plugin(GeomContains PhysicalFunction nes-physical-operators GeomContainsPhysicalFunction.cpp) diff --git a/nes-physical-operators/src/Functions/Meos/EverEqTh3indexH3indexPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverEqTh3indexH3indexPhysicalFunction.cpp new file mode 100644 index 0000000000..a488198ce1 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverEqTh3indexH3indexPhysicalFunction.cpp @@ -0,0 +1,76 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +EverEqTh3indexH3indexPhysicalFunction::EverEqTh3indexH3indexPhysicalFunction(PhysicalFunction cell, PhysicalFunction ts, + PhysicalFunction target) +{ + paramFns.reserve(3); + paramFns.push_back(std::move(cell)); + paramFns.push_back(std::move(ts)); + paramFns.push_back(std::move(target)); +} + +VarVal EverEqTh3indexH3indexPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto cell = paramFns[0].execute(record, arena).cast(); + auto ts = paramFns[1].execute(record, arena).cast(); + auto target = paramFns[2].execute(record, arena).cast(); + + const auto result = nautilus::invoke( + +[](uint64_t cell, uint64_t ts, uint64_t target) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + Temporal* inst = th3indexinst_make((H3Index)cell, (TimestampTz)ts); + if (!inst) return 0.0; + int r = ever_eq_th3index_h3index(inst, (H3Index)target); + free(inst); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + cell, ts, target); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverEqTh3indexH3indexPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "EverEqTh3indexH3indexPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + return EverEqTh3indexH3indexPhysicalFunction(std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverNeTh3indexH3indexPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverNeTh3indexH3indexPhysicalFunction.cpp new file mode 100644 index 0000000000..42ebd4deb8 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverNeTh3indexH3indexPhysicalFunction.cpp @@ -0,0 +1,76 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +EverNeTh3indexH3indexPhysicalFunction::EverNeTh3indexH3indexPhysicalFunction(PhysicalFunction cell, PhysicalFunction ts, + PhysicalFunction target) +{ + paramFns.reserve(3); + paramFns.push_back(std::move(cell)); + paramFns.push_back(std::move(ts)); + paramFns.push_back(std::move(target)); +} + +VarVal EverNeTh3indexH3indexPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto cell = paramFns[0].execute(record, arena).cast(); + auto ts = paramFns[1].execute(record, arena).cast(); + auto target = paramFns[2].execute(record, arena).cast(); + + const auto result = nautilus::invoke( + +[](uint64_t cell, uint64_t ts, uint64_t target) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + Temporal* inst = th3indexinst_make((H3Index)cell, (TimestampTz)ts); + if (!inst) return 0.0; + int r = ever_ne_th3index_h3index(inst, (H3Index)target); + free(inst); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + cell, ts, target); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverNeTh3indexH3indexPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "EverNeTh3indexH3indexPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + return EverNeTh3indexH3indexPhysicalFunction(std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/H3GsPointToCellPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/H3GsPointToCellPhysicalFunction.cpp new file mode 100644 index 0000000000..bebd4f0aa9 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/H3GsPointToCellPhysicalFunction.cpp @@ -0,0 +1,91 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +H3GsPointToCellPhysicalFunction::H3GsPointToCellPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, + PhysicalFunction resolution) +{ + paramFns.reserve(3); + paramFns.push_back(std::move(lon)); + paramFns.push_back(std::move(lat)); + paramFns.push_back(std::move(resolution)); +} + +VarVal H3GsPointToCellPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto lon = paramFns[0].execute(record, arena).cast(); + auto lat = paramFns[1].execute(record, arena).cast(); + auto res = paramFns[2].execute(record, arena).cast(); + + constexpr uint32_t MAX_LEN = 32; + auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); + + const auto actualLen = nautilus::invoke( + +[](double lon, double lat, uint64_t res, char* buf, uint32_t bufMax) -> uint32_t { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string wkt = fmt::format("SRID=4326;POINT({} {})", lon, lat); + GSERIALIZED* gs = geom_in(wkt.c_str(), -1); + if (!gs) return 0u; + H3Index cell = h3_gs_point_to_cell(gs, (int32_t)res); + free(gs); + if (cell == 0) return 0u; + char* hex = h3index_out(cell); + if (!hex) return 0u; + uint32_t len = static_cast(strlen(hex)); + if (len > bufMax) len = bufMax; + memcpy(buf, hex, len); + free(hex); + return len; + } catch (const std::exception&) { return 0u; } + }, + lon, lat, res, outBuf.getContent(), nautilus::val(MAX_LEN)); + + VarVal(actualLen).writeToMemory(outBuf.getReference()); + return outBuf; +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterH3GsPointToCellPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "H3GsPointToCellPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + return H3GsPointToCellPhysicalFunction(std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2])); +} + +} // namespace NES diff --git a/nes-sql-parser/AntlrSQL.g4 b/nes-sql-parser/AntlrSQL.g4 index 1ca2663af6..e0a41cfd0b 100644 --- a/nes-sql-parser/AntlrSQL.g4 +++ b/nes-sql-parser/AntlrSQL.g4 @@ -295,7 +295,7 @@ timeUnit: MS timestampParameter: name=identifier; -functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT | TGE_TTEXT_TEXT | TGE_TEXT_TTEXT | TGT_TTEXT_TEXT | TGT_TEXT_TTEXT | TLE_TTEXT_TEXT | TLE_TEXT_TTEXT | TLT_TTEXT_TEXT | TLT_TEXT_TTEXT | TTEXT_UPPER | TTEXT_LOWER | TTEXT_INITCAP | TEXTCAT_TTEXT_TEXT | TEXTCAT_TEXT_TTEXT | TEXTCAT_TTEXT_TTEXT | GEOM_LENGTH | GEOM_PERIMETER | GEOM_AZIMUTH | GEOG_AREA | GEOG_LENGTH | GEOG_PERIMETER | GEOM_IS_EMPTY | AINTERSECTS_TGEO_GEO | ACOVERS_TGEO_GEO | ADISJOINT_TGEO_GEO | ADWITHIN_TGEO_GEO | EINTERSECTS_TGEO_GEO | ETOUCHES_TGEO_GEO | ECONTAINS_TGEO_GEO | ACONTAINS_TGEO_GEO | ATOUCHES_TGEO_GEO | GEO_NUM_POINTS | GEO_NUM_GEOS | GEO_SRID | GEO_IS_UNITARY | GEO_EQUALS | GEO_SAME | GEOG_DISTANCE | NAD_TGEO_GEO | EVER_EQ_TGEO_GEO | EVER_NE_TGEO_GEO | ALWAYS_EQ_TGEO_GEO | ALWAYS_NE_TGEO_GEO | GEOG_INTERSECTS | GEOG_DWITHIN | ACOVERS_GEO_TGEO | GEOM_INTERSECTS | GEOM_DWITHIN | GEOM_INTERSECTS2D | GEOM_DWITHIN2D | GEOM_CONTAINS | GEOM_DISJOINT2D | GEOM_COVERS | GEOM_TOUCHES | GEOM_INTERSECTS3D | GEOM_DWITHIN3D | GEOM_DISTANCE2D | GEOM_DISTANCE3D; +functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT | TGE_TTEXT_TEXT | TGE_TEXT_TTEXT | TGT_TTEXT_TEXT | TGT_TEXT_TTEXT | TLE_TTEXT_TEXT | TLE_TEXT_TTEXT | TLT_TTEXT_TEXT | TLT_TEXT_TTEXT | TTEXT_UPPER | TTEXT_LOWER | TTEXT_INITCAP | TEXTCAT_TTEXT_TEXT | TEXTCAT_TEXT_TTEXT | TEXTCAT_TTEXT_TTEXT | GEOM_LENGTH | GEOM_PERIMETER | GEOM_AZIMUTH | GEOG_AREA | GEOG_LENGTH | GEOG_PERIMETER | GEOM_IS_EMPTY | AINTERSECTS_TGEO_GEO | ACOVERS_TGEO_GEO | ADISJOINT_TGEO_GEO | ADWITHIN_TGEO_GEO | EINTERSECTS_TGEO_GEO | ETOUCHES_TGEO_GEO | ECONTAINS_TGEO_GEO | ACONTAINS_TGEO_GEO | ATOUCHES_TGEO_GEO | GEO_NUM_POINTS | GEO_NUM_GEOS | GEO_SRID | GEO_IS_UNITARY | GEO_EQUALS | GEO_SAME | GEOG_DISTANCE | NAD_TGEO_GEO | EVER_EQ_TGEO_GEO | EVER_NE_TGEO_GEO | ALWAYS_EQ_TGEO_GEO | ALWAYS_NE_TGEO_GEO | GEOG_INTERSECTS | GEOG_DWITHIN | ACOVERS_GEO_TGEO | GEOM_INTERSECTS | GEOM_DWITHIN | H3_GS_POINT_TO_CELL | EVER_EQ_TH3INDEX_H3INDEX | EVER_NE_TH3INDEX_H3INDEX | ALWAYS_EQ_TH3INDEX_H3INDEX | ALWAYS_NE_TH3INDEX_H3INDEX | GEOM_INTERSECTS2D | GEOM_DWITHIN2D | GEOM_CONTAINS | GEOM_DISJOINT2D | GEOM_COVERS | GEOM_TOUCHES | GEOM_INTERSECTS3D | GEOM_DWITHIN3D | GEOM_DISTANCE2D | GEOM_DISTANCE3D; sinkClause: INTO sink (',' sink)*; @@ -791,6 +791,11 @@ GEOG_DWITHIN: 'GEOG_DWITHIN' | 'geog_dwithin'; ACOVERS_GEO_TGEO: 'ACOVERS_GEO_TGEO' | 'acovers_geo_tgeo'; GEOM_INTERSECTS: 'GEOM_INTERSECTS' | 'geom_intersects'; GEOM_DWITHIN: 'GEOM_DWITHIN' | 'geom_dwithin'; +H3_GS_POINT_TO_CELL: 'H3_GS_POINT_TO_CELL' | 'h3_gs_point_to_cell'; +EVER_EQ_TH3INDEX_H3INDEX: 'EVER_EQ_TH3INDEX_H3INDEX' | 'ever_eq_th3index_h3index'; +EVER_NE_TH3INDEX_H3INDEX: 'EVER_NE_TH3INDEX_H3INDEX' | 'ever_ne_th3index_h3index'; +ALWAYS_EQ_TH3INDEX_H3INDEX: 'ALWAYS_EQ_TH3INDEX_H3INDEX' | 'always_eq_th3index_h3index'; +ALWAYS_NE_TH3INDEX_H3INDEX: 'ALWAYS_NE_TH3INDEX_H3INDEX' | 'always_ne_th3index_h3index'; GEOM_INTERSECTS2D: 'GEOM_INTERSECTS2D' | 'geom_intersects2d'; GEOM_DWITHIN2D: 'GEOM_DWITHIN2D' | 'geom_dwithin2d'; GEOM_CONTAINS: 'GEOM_CONTAINS' | 'geom_contains'; diff --git a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp index 5058b60865..cc7f1e0fde 100644 --- a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp +++ b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp @@ -372,6 +372,11 @@ #include #include #include +#include +#include +#include +#include +#include #include #include #include @@ -9122,6 +9127,56 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont return LogicalFunction(AcoversGeoTgeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3))); } /* END CODEGEN PARSER GLUE: ACOVERS_GEO_TGEO */ + case AntlrSQLParser::H3_GS_POINT_TO_CELL: { + PRECONDITION(ctx->functionParam().size() == 3, + "H3GsPointToCell requires 3 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + return LogicalFunction(H3GsPointToCellLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2))); + } + /* END CODEGEN PARSER GLUE: H3_GS_POINT_TO_CELL */ + case AntlrSQLParser::EVER_EQ_TH3INDEX_H3INDEX: { + PRECONDITION(ctx->functionParam().size() == 3, + "EverEqTh3indexH3index requires 3 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + return LogicalFunction(EverEqTh3indexH3indexLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2))); + } + /* END CODEGEN PARSER GLUE: EVER_EQ_TH3INDEX_H3INDEX */ + case AntlrSQLParser::EVER_NE_TH3INDEX_H3INDEX: { + PRECONDITION(ctx->functionParam().size() == 3, + "EverNeTh3indexH3index requires 3 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + return LogicalFunction(EverNeTh3indexH3indexLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2))); + } + /* END CODEGEN PARSER GLUE: EVER_NE_TH3INDEX_H3INDEX */ + case AntlrSQLParser::ALWAYS_EQ_TH3INDEX_H3INDEX: { + PRECONDITION(ctx->functionParam().size() == 3, + "AlwaysEqTh3indexH3index requires 3 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + return LogicalFunction(AlwaysEqTh3indexH3indexLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2))); + } + /* END CODEGEN PARSER GLUE: ALWAYS_EQ_TH3INDEX_H3INDEX */ + case AntlrSQLParser::ALWAYS_NE_TH3INDEX_H3INDEX: { + PRECONDITION(ctx->functionParam().size() == 3, + "AlwaysNeTh3indexH3index requires 3 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + return LogicalFunction(AlwaysNeTh3indexH3indexLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2))); + } + /* END CODEGEN PARSER GLUE: ALWAYS_NE_TH3INDEX_H3INDEX */ /* END CODEGEN PARSER GLUE: GEOM_INTERSECTS2D */ case AntlrSQLParser::GEOM_DWITHIN2D: { PRECONDITION(ctx->functionParam().size() == 3, From 3ac79b67ab260028950b8299d2a5df810d1f86c6 Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Mon, 15 Jun 2026 01:42:04 +0200 Subject: [PATCH 59/96] feat(meos): add TH3INDEX hierarchy and property NES operators (W111) 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. --- ...3indexCellToCenterChildLogicalFunction.hpp | 50 +++++++++ ...exCellToCenterChildNextLogicalFunction.hpp | 50 +++++++++ .../Th3indexCellToChildPosLogicalFunction.hpp | 50 +++++++++ .../Th3indexCellToParentLogicalFunction.hpp | 50 +++++++++ ...h3indexCellToParentNextLogicalFunction.hpp | 50 +++++++++ ...3indexGetBaseCellNumberLogicalFunction.hpp | 50 +++++++++ .../Th3indexGetResolutionLogicalFunction.hpp | 50 +++++++++ .../Th3indexIsPentagonLogicalFunction.hpp | 50 +++++++++ .../Th3indexIsValidCellLogicalFunction.hpp | 50 +++++++++ .../src/Functions/Meos/CMakeLists.txt | 9 ++ ...3indexCellToCenterChildLogicalFunction.cpp | 103 ++++++++++++++++++ ...exCellToCenterChildNextLogicalFunction.cpp | 98 +++++++++++++++++ .../Th3indexCellToChildPosLogicalFunction.cpp | 103 ++++++++++++++++++ .../Th3indexCellToParentLogicalFunction.cpp | 103 ++++++++++++++++++ ...h3indexCellToParentNextLogicalFunction.cpp | 98 +++++++++++++++++ ...3indexGetBaseCellNumberLogicalFunction.cpp | 98 +++++++++++++++++ .../Th3indexGetResolutionLogicalFunction.cpp | 98 +++++++++++++++++ .../Th3indexIsPentagonLogicalFunction.cpp | 98 +++++++++++++++++ .../Th3indexIsValidCellLogicalFunction.cpp | 98 +++++++++++++++++ ...xCellToCenterChildNextPhysicalFunction.hpp | 34 ++++++ ...indexCellToCenterChildPhysicalFunction.hpp | 34 ++++++ ...Th3indexCellToChildPosPhysicalFunction.hpp | 34 ++++++ ...3indexCellToParentNextPhysicalFunction.hpp | 34 ++++++ .../Th3indexCellToParentPhysicalFunction.hpp | 34 ++++++ ...indexGetBaseCellNumberPhysicalFunction.hpp | 34 ++++++ .../Th3indexGetResolutionPhysicalFunction.hpp | 34 ++++++ .../Th3indexIsPentagonPhysicalFunction.hpp | 34 ++++++ .../Th3indexIsValidCellPhysicalFunction.hpp | 34 ++++++ .../src/Functions/Meos/CMakeLists.txt | 9 ++ ...xCellToCenterChildNextPhysicalFunction.cpp | 87 +++++++++++++++ ...indexCellToCenterChildPhysicalFunction.cpp | 91 ++++++++++++++++ ...Th3indexCellToChildPosPhysicalFunction.cpp | 79 ++++++++++++++ ...3indexCellToParentNextPhysicalFunction.cpp | 87 +++++++++++++++ .../Th3indexCellToParentPhysicalFunction.cpp | 91 ++++++++++++++++ ...indexGetBaseCellNumberPhysicalFunction.cpp | 75 +++++++++++++ .../Th3indexGetResolutionPhysicalFunction.cpp | 75 +++++++++++++ .../Th3indexIsPentagonPhysicalFunction.cpp | 75 +++++++++++++ .../Th3indexIsValidCellPhysicalFunction.cpp | 75 +++++++++++++ nes-sql-parser/AntlrSQL.g4 | 11 +- .../src/AntlrSQLQueryPlanCreator.cpp | 93 ++++++++++++++++ 40 files changed, 2509 insertions(+), 1 deletion(-) create mode 100644 nes-logical-operators/include/Functions/Meos/Th3indexCellToCenterChildLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/Th3indexCellToCenterChildNextLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/Th3indexCellToChildPosLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/Th3indexCellToParentLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/Th3indexCellToParentNextLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/Th3indexGetBaseCellNumberLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/Th3indexGetResolutionLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/Th3indexIsPentagonLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/Th3indexIsValidCellLogicalFunction.hpp create mode 100644 nes-logical-operators/src/Functions/Meos/Th3indexCellToCenterChildLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/Th3indexCellToCenterChildNextLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/Th3indexCellToChildPosLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/Th3indexCellToParentLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/Th3indexCellToParentNextLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/Th3indexGetBaseCellNumberLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/Th3indexGetResolutionLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/Th3indexIsPentagonLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/Th3indexIsValidCellLogicalFunction.cpp create mode 100644 nes-physical-operators/include/Functions/Meos/Th3indexCellToCenterChildNextPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/Th3indexCellToCenterChildPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/Th3indexCellToChildPosPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/Th3indexCellToParentNextPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/Th3indexCellToParentPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/Th3indexGetBaseCellNumberPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/Th3indexGetResolutionPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/Th3indexIsPentagonPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/Th3indexIsValidCellPhysicalFunction.hpp create mode 100644 nes-physical-operators/src/Functions/Meos/Th3indexCellToCenterChildNextPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/Th3indexCellToCenterChildPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/Th3indexCellToChildPosPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/Th3indexCellToParentNextPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/Th3indexCellToParentPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/Th3indexGetBaseCellNumberPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/Th3indexGetResolutionPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/Th3indexIsPentagonPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/Th3indexIsValidCellPhysicalFunction.cpp diff --git a/nes-logical-operators/include/Functions/Meos/Th3indexCellToCenterChildLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/Th3indexCellToCenterChildLogicalFunction.hpp new file mode 100644 index 0000000000..7f91065322 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/Th3indexCellToCenterChildLogicalFunction.hpp @@ -0,0 +1,50 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns the H3 center child cell at the given resolution as a hex string. + * + * Args: (cell:UINT64, ts:UINT64, resolution:UINT64) -> VARCHAR. + */ +class Th3indexCellToCenterChildLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "Th3indexCellToCenterChild"; + + Th3indexCellToCenterChildLogicalFunction(LogicalFunction cell, LogicalFunction ts, LogicalFunction resolution); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/Th3indexCellToCenterChildNextLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/Th3indexCellToCenterChildNextLogicalFunction.hpp new file mode 100644 index 0000000000..5edb86a69b --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/Th3indexCellToCenterChildNextLogicalFunction.hpp @@ -0,0 +1,50 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns the H3 center child cell at resolution+1 as a hex string. + * + * Args: (cell:UINT64, ts:UINT64) -> VARCHAR. + */ +class Th3indexCellToCenterChildNextLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "Th3indexCellToCenterChildNext"; + + Th3indexCellToCenterChildNextLogicalFunction(LogicalFunction cell, LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/Th3indexCellToChildPosLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/Th3indexCellToChildPosLogicalFunction.hpp new file mode 100644 index 0000000000..1ef6e8e7b4 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/Th3indexCellToChildPosLogicalFunction.hpp @@ -0,0 +1,50 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns the position of the H3 cell within its parent at parent_res as FLOAT64. + * + * Args: (cell:UINT64, ts:UINT64, parent_res:UINT64) -> FLOAT64. + */ +class Th3indexCellToChildPosLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "Th3indexCellToChildPos"; + + Th3indexCellToChildPosLogicalFunction(LogicalFunction cell, LogicalFunction ts, LogicalFunction parent_res); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/Th3indexCellToParentLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/Th3indexCellToParentLogicalFunction.hpp new file mode 100644 index 0000000000..e8f775f544 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/Th3indexCellToParentLogicalFunction.hpp @@ -0,0 +1,50 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns the H3 parent cell at the given resolution as a hex string. + * + * Args: (cell:UINT64, ts:UINT64, resolution:UINT64) -> VARCHAR. + */ +class Th3indexCellToParentLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "Th3indexCellToParent"; + + Th3indexCellToParentLogicalFunction(LogicalFunction cell, LogicalFunction ts, LogicalFunction resolution); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/Th3indexCellToParentNextLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/Th3indexCellToParentNextLogicalFunction.hpp new file mode 100644 index 0000000000..54df43c800 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/Th3indexCellToParentNextLogicalFunction.hpp @@ -0,0 +1,50 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns the H3 parent cell at resolution-1 as a hex string. + * + * Args: (cell:UINT64, ts:UINT64) -> VARCHAR. + */ +class Th3indexCellToParentNextLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "Th3indexCellToParentNext"; + + Th3indexCellToParentNextLogicalFunction(LogicalFunction cell, LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/Th3indexGetBaseCellNumberLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/Th3indexGetBaseCellNumberLogicalFunction.hpp new file mode 100644 index 0000000000..8187544475 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/Th3indexGetBaseCellNumberLogicalFunction.hpp @@ -0,0 +1,50 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns the H3 base cell number (0-121) of the cell as FLOAT64. + * + * Args: (cell:UINT64, ts:UINT64) -> FLOAT64. + */ +class Th3indexGetBaseCellNumberLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "Th3indexGetBaseCellNumber"; + + Th3indexGetBaseCellNumberLogicalFunction(LogicalFunction cell, LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/Th3indexGetResolutionLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/Th3indexGetResolutionLogicalFunction.hpp new file mode 100644 index 0000000000..d034651307 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/Th3indexGetResolutionLogicalFunction.hpp @@ -0,0 +1,50 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns the H3 resolution (0-15) of the cell as FLOAT64. + * + * Args: (cell:UINT64, ts:UINT64) -> FLOAT64. + */ +class Th3indexGetResolutionLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "Th3indexGetResolution"; + + Th3indexGetResolutionLogicalFunction(LogicalFunction cell, LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/Th3indexIsPentagonLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/Th3indexIsPentagonLogicalFunction.hpp new file mode 100644 index 0000000000..60d583d8f2 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/Th3indexIsPentagonLogicalFunction.hpp @@ -0,0 +1,50 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if the H3 cell is a pentagon cell, 0.0 otherwise. + * + * Args: (cell:UINT64, ts:UINT64) -> FLOAT64. + */ +class Th3indexIsPentagonLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "Th3indexIsPentagon"; + + Th3indexIsPentagonLogicalFunction(LogicalFunction cell, LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/Th3indexIsValidCellLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/Th3indexIsValidCellLogicalFunction.hpp new file mode 100644 index 0000000000..8a8d12f282 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/Th3indexIsValidCellLogicalFunction.hpp @@ -0,0 +1,50 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if the H3 cell index is valid, 0.0 otherwise. + * + * Args: (cell:UINT64, ts:UINT64) -> FLOAT64. + */ +class Th3indexIsValidCellLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "Th3indexIsValidCell"; + + Th3indexIsValidCellLogicalFunction(LogicalFunction cell, LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt index 88413fc1bc..3695594581 100644 --- a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt @@ -326,6 +326,15 @@ add_plugin(EverEqTh3indexH3index LogicalFunction nes-logical-operators EverEqTh3 add_plugin(EverNeTh3indexH3index LogicalFunction nes-logical-operators EverNeTh3indexH3indexLogicalFunction.cpp) add_plugin(AlwaysEqTh3indexH3index LogicalFunction nes-logical-operators AlwaysEqTh3indexH3indexLogicalFunction.cpp) add_plugin(AlwaysNeTh3indexH3index LogicalFunction nes-logical-operators AlwaysNeTh3indexH3indexLogicalFunction.cpp) +add_plugin(Th3indexGetResolution LogicalFunction nes-logical-operators Th3indexGetResolutionLogicalFunction.cpp) +add_plugin(Th3indexGetBaseCellNumber LogicalFunction nes-logical-operators Th3indexGetBaseCellNumberLogicalFunction.cpp) +add_plugin(Th3indexIsValidCell LogicalFunction nes-logical-operators Th3indexIsValidCellLogicalFunction.cpp) +add_plugin(Th3indexIsPentagon LogicalFunction nes-logical-operators Th3indexIsPentagonLogicalFunction.cpp) +add_plugin(Th3indexCellToParentNext LogicalFunction nes-logical-operators Th3indexCellToParentNextLogicalFunction.cpp) +add_plugin(Th3indexCellToCenterChildNext LogicalFunction nes-logical-operators Th3indexCellToCenterChildNextLogicalFunction.cpp) +add_plugin(Th3indexCellToParent LogicalFunction nes-logical-operators Th3indexCellToParentLogicalFunction.cpp) +add_plugin(Th3indexCellToCenterChild LogicalFunction nes-logical-operators Th3indexCellToCenterChildLogicalFunction.cpp) +add_plugin(Th3indexCellToChildPos LogicalFunction nes-logical-operators Th3indexCellToChildPosLogicalFunction.cpp) add_plugin(GeomIntersects2d LogicalFunction nes-logical-operators GeomIntersects2dLogicalFunction.cpp) add_plugin(GeomDwithin2d LogicalFunction nes-logical-operators GeomDwithin2dLogicalFunction.cpp) add_plugin(GeomContains LogicalFunction nes-logical-operators GeomContainsLogicalFunction.cpp) diff --git a/nes-logical-operators/src/Functions/Meos/Th3indexCellToCenterChildLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/Th3indexCellToCenterChildLogicalFunction.cpp new file mode 100644 index 0000000000..1b23759a61 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/Th3indexCellToCenterChildLogicalFunction.cpp @@ -0,0 +1,103 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +Th3indexCellToCenterChildLogicalFunction::Th3indexCellToCenterChildLogicalFunction(LogicalFunction cell, LogicalFunction ts, + LogicalFunction resolution) + : dataType(DataTypeProvider::provideDataType(DataType::Type::VARSIZED)) +{ + parameters.reserve(3); + parameters.push_back(std::move(cell)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(resolution)); +} + +DataType Th3indexCellToCenterChildLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction Th3indexCellToCenterChildLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector Th3indexCellToCenterChildLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction Th3indexCellToCenterChildLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, + "Th3indexCellToCenterChildLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view Th3indexCellToCenterChildLogicalFunction::getType() const { return NAME; } + +bool Th3indexCellToCenterChildLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string Th3indexCellToCenterChildLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction Th3indexCellToCenterChildLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(3); + c.emplace_back(parameters[0].withInferredDataType(schema)); + c.emplace_back(parameters[1].withInferredDataType(schema)); + c.emplace_back(parameters[2].withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "cell must be UINT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "resolution must be UINT64"); + return withChildren(c); +} + +SerializableFunction Th3indexCellToCenterChildLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTh3indexCellToCenterChildLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "Th3indexCellToCenterChildLogicalFunction requires 3 children but got {}", + arguments.children.size()); + return Th3indexCellToCenterChildLogicalFunction(std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/Th3indexCellToCenterChildNextLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/Th3indexCellToCenterChildNextLogicalFunction.cpp new file mode 100644 index 0000000000..8bb6a4bfcf --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/Th3indexCellToCenterChildNextLogicalFunction.cpp @@ -0,0 +1,98 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +Th3indexCellToCenterChildNextLogicalFunction::Th3indexCellToCenterChildNextLogicalFunction(LogicalFunction cell, LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::VARSIZED)) +{ + parameters.reserve(2); + parameters.push_back(std::move(cell)); + parameters.push_back(std::move(ts)); +} + +DataType Th3indexCellToCenterChildNextLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction Th3indexCellToCenterChildNextLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector Th3indexCellToCenterChildNextLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction Th3indexCellToCenterChildNextLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 2, + "Th3indexCellToCenterChildNextLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view Th3indexCellToCenterChildNextLogicalFunction::getType() const { return NAME; } + +bool Th3indexCellToCenterChildNextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string Th3indexCellToCenterChildNextLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction Th3indexCellToCenterChildNextLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(2); + c.emplace_back(parameters[0].withInferredDataType(schema)); + c.emplace_back(parameters[1].withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "cell must be UINT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); + return withChildren(c); +} + +SerializableFunction Th3indexCellToCenterChildNextLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTh3indexCellToCenterChildNextLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 2, + "Th3indexCellToCenterChildNextLogicalFunction requires 2 children but got {}", + arguments.children.size()); + return Th3indexCellToCenterChildNextLogicalFunction(std::move(arguments.children[0]), + std::move(arguments.children[1])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/Th3indexCellToChildPosLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/Th3indexCellToChildPosLogicalFunction.cpp new file mode 100644 index 0000000000..0c673ff91e --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/Th3indexCellToChildPosLogicalFunction.cpp @@ -0,0 +1,103 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +Th3indexCellToChildPosLogicalFunction::Th3indexCellToChildPosLogicalFunction(LogicalFunction cell, LogicalFunction ts, + LogicalFunction parent_res) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(cell)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(parent_res)); +} + +DataType Th3indexCellToChildPosLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction Th3indexCellToChildPosLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector Th3indexCellToChildPosLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction Th3indexCellToChildPosLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, + "Th3indexCellToChildPosLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view Th3indexCellToChildPosLogicalFunction::getType() const { return NAME; } + +bool Th3indexCellToChildPosLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string Th3indexCellToChildPosLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction Th3indexCellToChildPosLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(3); + c.emplace_back(parameters[0].withInferredDataType(schema)); + c.emplace_back(parameters[1].withInferredDataType(schema)); + c.emplace_back(parameters[2].withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "cell must be UINT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "parent_res must be UINT64"); + return withChildren(c); +} + +SerializableFunction Th3indexCellToChildPosLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTh3indexCellToChildPosLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "Th3indexCellToChildPosLogicalFunction requires 3 children but got {}", + arguments.children.size()); + return Th3indexCellToChildPosLogicalFunction(std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/Th3indexCellToParentLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/Th3indexCellToParentLogicalFunction.cpp new file mode 100644 index 0000000000..0ae233f25a --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/Th3indexCellToParentLogicalFunction.cpp @@ -0,0 +1,103 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +Th3indexCellToParentLogicalFunction::Th3indexCellToParentLogicalFunction(LogicalFunction cell, LogicalFunction ts, + LogicalFunction resolution) + : dataType(DataTypeProvider::provideDataType(DataType::Type::VARSIZED)) +{ + parameters.reserve(3); + parameters.push_back(std::move(cell)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(resolution)); +} + +DataType Th3indexCellToParentLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction Th3indexCellToParentLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector Th3indexCellToParentLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction Th3indexCellToParentLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, + "Th3indexCellToParentLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view Th3indexCellToParentLogicalFunction::getType() const { return NAME; } + +bool Th3indexCellToParentLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string Th3indexCellToParentLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction Th3indexCellToParentLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(3); + c.emplace_back(parameters[0].withInferredDataType(schema)); + c.emplace_back(parameters[1].withInferredDataType(schema)); + c.emplace_back(parameters[2].withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "cell must be UINT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "resolution must be UINT64"); + return withChildren(c); +} + +SerializableFunction Th3indexCellToParentLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTh3indexCellToParentLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "Th3indexCellToParentLogicalFunction requires 3 children but got {}", + arguments.children.size()); + return Th3indexCellToParentLogicalFunction(std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/Th3indexCellToParentNextLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/Th3indexCellToParentNextLogicalFunction.cpp new file mode 100644 index 0000000000..4e975cb109 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/Th3indexCellToParentNextLogicalFunction.cpp @@ -0,0 +1,98 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +Th3indexCellToParentNextLogicalFunction::Th3indexCellToParentNextLogicalFunction(LogicalFunction cell, LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::VARSIZED)) +{ + parameters.reserve(2); + parameters.push_back(std::move(cell)); + parameters.push_back(std::move(ts)); +} + +DataType Th3indexCellToParentNextLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction Th3indexCellToParentNextLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector Th3indexCellToParentNextLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction Th3indexCellToParentNextLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 2, + "Th3indexCellToParentNextLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view Th3indexCellToParentNextLogicalFunction::getType() const { return NAME; } + +bool Th3indexCellToParentNextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string Th3indexCellToParentNextLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction Th3indexCellToParentNextLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(2); + c.emplace_back(parameters[0].withInferredDataType(schema)); + c.emplace_back(parameters[1].withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "cell must be UINT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); + return withChildren(c); +} + +SerializableFunction Th3indexCellToParentNextLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTh3indexCellToParentNextLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 2, + "Th3indexCellToParentNextLogicalFunction requires 2 children but got {}", + arguments.children.size()); + return Th3indexCellToParentNextLogicalFunction(std::move(arguments.children[0]), + std::move(arguments.children[1])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/Th3indexGetBaseCellNumberLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/Th3indexGetBaseCellNumberLogicalFunction.cpp new file mode 100644 index 0000000000..5dee128ea8 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/Th3indexGetBaseCellNumberLogicalFunction.cpp @@ -0,0 +1,98 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +Th3indexGetBaseCellNumberLogicalFunction::Th3indexGetBaseCellNumberLogicalFunction(LogicalFunction cell, LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(2); + parameters.push_back(std::move(cell)); + parameters.push_back(std::move(ts)); +} + +DataType Th3indexGetBaseCellNumberLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction Th3indexGetBaseCellNumberLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector Th3indexGetBaseCellNumberLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction Th3indexGetBaseCellNumberLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 2, + "Th3indexGetBaseCellNumberLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view Th3indexGetBaseCellNumberLogicalFunction::getType() const { return NAME; } + +bool Th3indexGetBaseCellNumberLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string Th3indexGetBaseCellNumberLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction Th3indexGetBaseCellNumberLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(2); + c.emplace_back(parameters[0].withInferredDataType(schema)); + c.emplace_back(parameters[1].withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "cell must be UINT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); + return withChildren(c); +} + +SerializableFunction Th3indexGetBaseCellNumberLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTh3indexGetBaseCellNumberLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 2, + "Th3indexGetBaseCellNumberLogicalFunction requires 2 children but got {}", + arguments.children.size()); + return Th3indexGetBaseCellNumberLogicalFunction(std::move(arguments.children[0]), + std::move(arguments.children[1])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/Th3indexGetResolutionLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/Th3indexGetResolutionLogicalFunction.cpp new file mode 100644 index 0000000000..300491aee2 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/Th3indexGetResolutionLogicalFunction.cpp @@ -0,0 +1,98 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +Th3indexGetResolutionLogicalFunction::Th3indexGetResolutionLogicalFunction(LogicalFunction cell, LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(2); + parameters.push_back(std::move(cell)); + parameters.push_back(std::move(ts)); +} + +DataType Th3indexGetResolutionLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction Th3indexGetResolutionLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector Th3indexGetResolutionLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction Th3indexGetResolutionLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 2, + "Th3indexGetResolutionLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view Th3indexGetResolutionLogicalFunction::getType() const { return NAME; } + +bool Th3indexGetResolutionLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string Th3indexGetResolutionLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction Th3indexGetResolutionLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(2); + c.emplace_back(parameters[0].withInferredDataType(schema)); + c.emplace_back(parameters[1].withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "cell must be UINT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); + return withChildren(c); +} + +SerializableFunction Th3indexGetResolutionLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTh3indexGetResolutionLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 2, + "Th3indexGetResolutionLogicalFunction requires 2 children but got {}", + arguments.children.size()); + return Th3indexGetResolutionLogicalFunction(std::move(arguments.children[0]), + std::move(arguments.children[1])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/Th3indexIsPentagonLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/Th3indexIsPentagonLogicalFunction.cpp new file mode 100644 index 0000000000..ad627972b4 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/Th3indexIsPentagonLogicalFunction.cpp @@ -0,0 +1,98 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +Th3indexIsPentagonLogicalFunction::Th3indexIsPentagonLogicalFunction(LogicalFunction cell, LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(2); + parameters.push_back(std::move(cell)); + parameters.push_back(std::move(ts)); +} + +DataType Th3indexIsPentagonLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction Th3indexIsPentagonLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector Th3indexIsPentagonLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction Th3indexIsPentagonLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 2, + "Th3indexIsPentagonLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view Th3indexIsPentagonLogicalFunction::getType() const { return NAME; } + +bool Th3indexIsPentagonLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string Th3indexIsPentagonLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction Th3indexIsPentagonLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(2); + c.emplace_back(parameters[0].withInferredDataType(schema)); + c.emplace_back(parameters[1].withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "cell must be UINT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); + return withChildren(c); +} + +SerializableFunction Th3indexIsPentagonLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTh3indexIsPentagonLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 2, + "Th3indexIsPentagonLogicalFunction requires 2 children but got {}", + arguments.children.size()); + return Th3indexIsPentagonLogicalFunction(std::move(arguments.children[0]), + std::move(arguments.children[1])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/Th3indexIsValidCellLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/Th3indexIsValidCellLogicalFunction.cpp new file mode 100644 index 0000000000..9dc00f3032 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/Th3indexIsValidCellLogicalFunction.cpp @@ -0,0 +1,98 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +Th3indexIsValidCellLogicalFunction::Th3indexIsValidCellLogicalFunction(LogicalFunction cell, LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(2); + parameters.push_back(std::move(cell)); + parameters.push_back(std::move(ts)); +} + +DataType Th3indexIsValidCellLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction Th3indexIsValidCellLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector Th3indexIsValidCellLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction Th3indexIsValidCellLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 2, + "Th3indexIsValidCellLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view Th3indexIsValidCellLogicalFunction::getType() const { return NAME; } + +bool Th3indexIsValidCellLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string Th3indexIsValidCellLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction Th3indexIsValidCellLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(2); + c.emplace_back(parameters[0].withInferredDataType(schema)); + c.emplace_back(parameters[1].withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "cell must be UINT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); + return withChildren(c); +} + +SerializableFunction Th3indexIsValidCellLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTh3indexIsValidCellLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 2, + "Th3indexIsValidCellLogicalFunction requires 2 children but got {}", + arguments.children.size()); + return Th3indexIsValidCellLogicalFunction(std::move(arguments.children[0]), + std::move(arguments.children[1])); +} + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/Th3indexCellToCenterChildNextPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/Th3indexCellToCenterChildNextPhysicalFunction.hpp new file mode 100644 index 0000000000..bdaa24c2b9 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/Th3indexCellToCenterChildNextPhysicalFunction.hpp @@ -0,0 +1,34 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class Th3indexCellToCenterChildNextPhysicalFunction : public PhysicalFunctionConcept { +public: + Th3indexCellToCenterChildNextPhysicalFunction(PhysicalFunction cell, PhysicalFunction ts); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/Th3indexCellToCenterChildPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/Th3indexCellToCenterChildPhysicalFunction.hpp new file mode 100644 index 0000000000..6dd997905c --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/Th3indexCellToCenterChildPhysicalFunction.hpp @@ -0,0 +1,34 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class Th3indexCellToCenterChildPhysicalFunction : public PhysicalFunctionConcept { +public: + Th3indexCellToCenterChildPhysicalFunction(PhysicalFunction cell, PhysicalFunction ts, PhysicalFunction resolution); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/Th3indexCellToChildPosPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/Th3indexCellToChildPosPhysicalFunction.hpp new file mode 100644 index 0000000000..ef0d4277c6 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/Th3indexCellToChildPosPhysicalFunction.hpp @@ -0,0 +1,34 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class Th3indexCellToChildPosPhysicalFunction : public PhysicalFunctionConcept { +public: + Th3indexCellToChildPosPhysicalFunction(PhysicalFunction cell, PhysicalFunction ts, PhysicalFunction parent_res); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/Th3indexCellToParentNextPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/Th3indexCellToParentNextPhysicalFunction.hpp new file mode 100644 index 0000000000..89f54a3bd9 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/Th3indexCellToParentNextPhysicalFunction.hpp @@ -0,0 +1,34 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class Th3indexCellToParentNextPhysicalFunction : public PhysicalFunctionConcept { +public: + Th3indexCellToParentNextPhysicalFunction(PhysicalFunction cell, PhysicalFunction ts); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/Th3indexCellToParentPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/Th3indexCellToParentPhysicalFunction.hpp new file mode 100644 index 0000000000..91630d0c57 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/Th3indexCellToParentPhysicalFunction.hpp @@ -0,0 +1,34 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class Th3indexCellToParentPhysicalFunction : public PhysicalFunctionConcept { +public: + Th3indexCellToParentPhysicalFunction(PhysicalFunction cell, PhysicalFunction ts, PhysicalFunction resolution); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/Th3indexGetBaseCellNumberPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/Th3indexGetBaseCellNumberPhysicalFunction.hpp new file mode 100644 index 0000000000..644d2b5e78 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/Th3indexGetBaseCellNumberPhysicalFunction.hpp @@ -0,0 +1,34 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class Th3indexGetBaseCellNumberPhysicalFunction : public PhysicalFunctionConcept { +public: + Th3indexGetBaseCellNumberPhysicalFunction(PhysicalFunction cell, PhysicalFunction ts); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/Th3indexGetResolutionPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/Th3indexGetResolutionPhysicalFunction.hpp new file mode 100644 index 0000000000..9595512c09 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/Th3indexGetResolutionPhysicalFunction.hpp @@ -0,0 +1,34 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class Th3indexGetResolutionPhysicalFunction : public PhysicalFunctionConcept { +public: + Th3indexGetResolutionPhysicalFunction(PhysicalFunction cell, PhysicalFunction ts); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/Th3indexIsPentagonPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/Th3indexIsPentagonPhysicalFunction.hpp new file mode 100644 index 0000000000..b174fd09fa --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/Th3indexIsPentagonPhysicalFunction.hpp @@ -0,0 +1,34 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class Th3indexIsPentagonPhysicalFunction : public PhysicalFunctionConcept { +public: + Th3indexIsPentagonPhysicalFunction(PhysicalFunction cell, PhysicalFunction ts); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/Th3indexIsValidCellPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/Th3indexIsValidCellPhysicalFunction.hpp new file mode 100644 index 0000000000..68f711e6b6 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/Th3indexIsValidCellPhysicalFunction.hpp @@ -0,0 +1,34 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class Th3indexIsValidCellPhysicalFunction : public PhysicalFunctionConcept { +public: + Th3indexIsValidCellPhysicalFunction(PhysicalFunction cell, PhysicalFunction ts); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt index 50e4d63d19..9ea2261217 100644 --- a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt @@ -325,6 +325,15 @@ add_plugin(EverEqTh3indexH3index PhysicalFunction nes-physical-operators EverEqT add_plugin(EverNeTh3indexH3index PhysicalFunction nes-physical-operators EverNeTh3indexH3indexPhysicalFunction.cpp) add_plugin(AlwaysEqTh3indexH3index PhysicalFunction nes-physical-operators AlwaysEqTh3indexH3indexPhysicalFunction.cpp) add_plugin(AlwaysNeTh3indexH3index PhysicalFunction nes-physical-operators AlwaysNeTh3indexH3indexPhysicalFunction.cpp) +add_plugin(Th3indexGetResolution PhysicalFunction nes-physical-operators Th3indexGetResolutionPhysicalFunction.cpp) +add_plugin(Th3indexGetBaseCellNumber PhysicalFunction nes-physical-operators Th3indexGetBaseCellNumberPhysicalFunction.cpp) +add_plugin(Th3indexIsValidCell PhysicalFunction nes-physical-operators Th3indexIsValidCellPhysicalFunction.cpp) +add_plugin(Th3indexIsPentagon PhysicalFunction nes-physical-operators Th3indexIsPentagonPhysicalFunction.cpp) +add_plugin(Th3indexCellToParentNext PhysicalFunction nes-physical-operators Th3indexCellToParentNextPhysicalFunction.cpp) +add_plugin(Th3indexCellToCenterChildNext PhysicalFunction nes-physical-operators Th3indexCellToCenterChildNextPhysicalFunction.cpp) +add_plugin(Th3indexCellToParent PhysicalFunction nes-physical-operators Th3indexCellToParentPhysicalFunction.cpp) +add_plugin(Th3indexCellToCenterChild PhysicalFunction nes-physical-operators Th3indexCellToCenterChildPhysicalFunction.cpp) +add_plugin(Th3indexCellToChildPos PhysicalFunction nes-physical-operators Th3indexCellToChildPosPhysicalFunction.cpp) add_plugin(GeomIntersects2d PhysicalFunction nes-physical-operators GeomIntersects2dPhysicalFunction.cpp) add_plugin(GeomDwithin2d PhysicalFunction nes-physical-operators GeomDwithin2dPhysicalFunction.cpp) add_plugin(GeomContains PhysicalFunction nes-physical-operators GeomContainsPhysicalFunction.cpp) diff --git a/nes-physical-operators/src/Functions/Meos/Th3indexCellToCenterChildNextPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/Th3indexCellToCenterChildNextPhysicalFunction.cpp new file mode 100644 index 0000000000..716401e4b0 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/Th3indexCellToCenterChildNextPhysicalFunction.cpp @@ -0,0 +1,87 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} +#include +#include + +namespace NES { + +Th3indexCellToCenterChildNextPhysicalFunction::Th3indexCellToCenterChildNextPhysicalFunction(PhysicalFunction cell, PhysicalFunction ts) +{ + paramFns.reserve(2); + paramFns.push_back(std::move(cell)); + paramFns.push_back(std::move(ts)); +} + +VarVal Th3indexCellToCenterChildNextPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto cell = paramFns[0].execute(record, arena).cast(); + auto ts = paramFns[1].execute(record, arena).cast(); + + constexpr uint32_t MAX_LEN = 32; + auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); + + const auto actualLen = nautilus::invoke( + +[](uint64_t cell, uint64_t ts, char* buf, uint32_t bufMax) -> uint32_t { + try { + MEOS::Meos::ensureMeosInitialized(); + Temporal* inst = th3indexinst_make((H3Index)cell, (TimestampTz)ts); + if (!inst) return 0u; + Temporal* res = th3index_cell_to_center_child_next(inst); + free(inst); + if (!res) return 0u; + H3Index result_cell = th3index_start_value(res); + free(res); + char* hex = h3index_out(result_cell); + if (!hex) return 0u; + uint32_t len = static_cast(strlen(hex)); + if (len > bufMax) len = bufMax; + memcpy(buf, hex, len); + free(hex); + return len; + } catch (const std::exception&) { return 0u; } + }, + cell, ts, outBuf.getContent(), nautilus::val(MAX_LEN)); + + VarVal(actualLen).writeToMemory(outBuf.getReference()); + return outBuf; +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTh3indexCellToCenterChildNextPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 2, + "Th3indexCellToCenterChildNextPhysicalFunction requires 2 children but got {}", + arguments.childFunctions.size()); + return Th3indexCellToCenterChildNextPhysicalFunction(std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/Th3indexCellToCenterChildPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/Th3indexCellToCenterChildPhysicalFunction.cpp new file mode 100644 index 0000000000..b0d88b84c3 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/Th3indexCellToCenterChildPhysicalFunction.cpp @@ -0,0 +1,91 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} +#include +#include + +namespace NES { + +Th3indexCellToCenterChildPhysicalFunction::Th3indexCellToCenterChildPhysicalFunction(PhysicalFunction cell, PhysicalFunction ts, + PhysicalFunction resolution) +{ + paramFns.reserve(3); + paramFns.push_back(std::move(cell)); + paramFns.push_back(std::move(ts)); + paramFns.push_back(std::move(resolution)); +} + +VarVal Th3indexCellToCenterChildPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto cell = paramFns[0].execute(record, arena).cast(); + auto ts = paramFns[1].execute(record, arena).cast(); + auto resolution = paramFns[2].execute(record, arena).cast(); + + constexpr uint32_t MAX_LEN = 32; + auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); + + const auto actualLen = nautilus::invoke( + +[](uint64_t cell, uint64_t ts, uint64_t resolution, char* buf, uint32_t bufMax) -> uint32_t { + try { + MEOS::Meos::ensureMeosInitialized(); + Temporal* inst = th3indexinst_make((H3Index)cell, (TimestampTz)ts); + if (!inst) return 0u; + Temporal* res = th3index_cell_to_center_child(inst, (int32_t)resolution); + free(inst); + if (!res) return 0u; + H3Index result_cell = th3index_start_value(res); + free(res); + char* hex = h3index_out(result_cell); + if (!hex) return 0u; + uint32_t len = static_cast(strlen(hex)); + if (len > bufMax) len = bufMax; + memcpy(buf, hex, len); + free(hex); + return len; + } catch (const std::exception&) { return 0u; } + }, + cell, ts, resolution, outBuf.getContent(), nautilus::val(MAX_LEN)); + + VarVal(actualLen).writeToMemory(outBuf.getReference()); + return outBuf; +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTh3indexCellToCenterChildPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "Th3indexCellToCenterChildPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + return Th3indexCellToCenterChildPhysicalFunction(std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/Th3indexCellToChildPosPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/Th3indexCellToChildPosPhysicalFunction.cpp new file mode 100644 index 0000000000..ab53a9fb18 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/Th3indexCellToChildPosPhysicalFunction.cpp @@ -0,0 +1,79 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +Th3indexCellToChildPosPhysicalFunction::Th3indexCellToChildPosPhysicalFunction(PhysicalFunction cell, PhysicalFunction ts, + PhysicalFunction parent_res) +{ + paramFns.reserve(3); + paramFns.push_back(std::move(cell)); + paramFns.push_back(std::move(ts)); + paramFns.push_back(std::move(parent_res)); +} + +VarVal Th3indexCellToChildPosPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto cell = paramFns[0].execute(record, arena).cast(); + auto ts = paramFns[1].execute(record, arena).cast(); + auto parent_res = paramFns[2].execute(record, arena).cast(); + + const auto result = nautilus::invoke( + +[](uint64_t cell, uint64_t ts, uint64_t parent_res) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + Temporal* inst = th3indexinst_make((H3Index)cell, (TimestampTz)ts); + if (!inst) return 0.0; + Temporal* res = th3index_cell_to_child_pos(inst, (int32_t)parent_res); + free(inst); + if (!res) return 0.0; + double r = (double)tint_start_value(res); + free(res); + return r; + } catch (const std::exception&) { return 0.0; } + }, + cell, ts, parent_res); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTh3indexCellToChildPosPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "Th3indexCellToChildPosPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + return Th3indexCellToChildPosPhysicalFunction(std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/Th3indexCellToParentNextPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/Th3indexCellToParentNextPhysicalFunction.cpp new file mode 100644 index 0000000000..53a04ef550 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/Th3indexCellToParentNextPhysicalFunction.cpp @@ -0,0 +1,87 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} +#include +#include + +namespace NES { + +Th3indexCellToParentNextPhysicalFunction::Th3indexCellToParentNextPhysicalFunction(PhysicalFunction cell, PhysicalFunction ts) +{ + paramFns.reserve(2); + paramFns.push_back(std::move(cell)); + paramFns.push_back(std::move(ts)); +} + +VarVal Th3indexCellToParentNextPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto cell = paramFns[0].execute(record, arena).cast(); + auto ts = paramFns[1].execute(record, arena).cast(); + + constexpr uint32_t MAX_LEN = 32; + auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); + + const auto actualLen = nautilus::invoke( + +[](uint64_t cell, uint64_t ts, char* buf, uint32_t bufMax) -> uint32_t { + try { + MEOS::Meos::ensureMeosInitialized(); + Temporal* inst = th3indexinst_make((H3Index)cell, (TimestampTz)ts); + if (!inst) return 0u; + Temporal* res = th3index_cell_to_parent_next(inst); + free(inst); + if (!res) return 0u; + H3Index result_cell = th3index_start_value(res); + free(res); + char* hex = h3index_out(result_cell); + if (!hex) return 0u; + uint32_t len = static_cast(strlen(hex)); + if (len > bufMax) len = bufMax; + memcpy(buf, hex, len); + free(hex); + return len; + } catch (const std::exception&) { return 0u; } + }, + cell, ts, outBuf.getContent(), nautilus::val(MAX_LEN)); + + VarVal(actualLen).writeToMemory(outBuf.getReference()); + return outBuf; +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTh3indexCellToParentNextPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 2, + "Th3indexCellToParentNextPhysicalFunction requires 2 children but got {}", + arguments.childFunctions.size()); + return Th3indexCellToParentNextPhysicalFunction(std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/Th3indexCellToParentPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/Th3indexCellToParentPhysicalFunction.cpp new file mode 100644 index 0000000000..f991d67e81 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/Th3indexCellToParentPhysicalFunction.cpp @@ -0,0 +1,91 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} +#include +#include + +namespace NES { + +Th3indexCellToParentPhysicalFunction::Th3indexCellToParentPhysicalFunction(PhysicalFunction cell, PhysicalFunction ts, + PhysicalFunction resolution) +{ + paramFns.reserve(3); + paramFns.push_back(std::move(cell)); + paramFns.push_back(std::move(ts)); + paramFns.push_back(std::move(resolution)); +} + +VarVal Th3indexCellToParentPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto cell = paramFns[0].execute(record, arena).cast(); + auto ts = paramFns[1].execute(record, arena).cast(); + auto resolution = paramFns[2].execute(record, arena).cast(); + + constexpr uint32_t MAX_LEN = 32; + auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); + + const auto actualLen = nautilus::invoke( + +[](uint64_t cell, uint64_t ts, uint64_t resolution, char* buf, uint32_t bufMax) -> uint32_t { + try { + MEOS::Meos::ensureMeosInitialized(); + Temporal* inst = th3indexinst_make((H3Index)cell, (TimestampTz)ts); + if (!inst) return 0u; + Temporal* res = th3index_cell_to_parent(inst, (int32_t)resolution); + free(inst); + if (!res) return 0u; + H3Index result_cell = th3index_start_value(res); + free(res); + char* hex = h3index_out(result_cell); + if (!hex) return 0u; + uint32_t len = static_cast(strlen(hex)); + if (len > bufMax) len = bufMax; + memcpy(buf, hex, len); + free(hex); + return len; + } catch (const std::exception&) { return 0u; } + }, + cell, ts, resolution, outBuf.getContent(), nautilus::val(MAX_LEN)); + + VarVal(actualLen).writeToMemory(outBuf.getReference()); + return outBuf; +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTh3indexCellToParentPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "Th3indexCellToParentPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + return Th3indexCellToParentPhysicalFunction(std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/Th3indexGetBaseCellNumberPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/Th3indexGetBaseCellNumberPhysicalFunction.cpp new file mode 100644 index 0000000000..2de1f4f7c2 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/Th3indexGetBaseCellNumberPhysicalFunction.cpp @@ -0,0 +1,75 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +Th3indexGetBaseCellNumberPhysicalFunction::Th3indexGetBaseCellNumberPhysicalFunction(PhysicalFunction cell, PhysicalFunction ts) +{ + paramFns.reserve(2); + paramFns.push_back(std::move(cell)); + paramFns.push_back(std::move(ts)); +} + +VarVal Th3indexGetBaseCellNumberPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto cell = paramFns[0].execute(record, arena).cast(); + auto ts = paramFns[1].execute(record, arena).cast(); + + const auto result = nautilus::invoke( + +[](uint64_t cell, uint64_t ts) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + Temporal* inst = th3indexinst_make((H3Index)cell, (TimestampTz)ts); + if (!inst) return 0.0; + Temporal* res = th3index_get_base_cell_number(inst); + free(inst); + if (!res) return 0.0; + double r = (double)tint_start_value(res); + free(res); + return r; + } catch (const std::exception&) { return 0.0; } + }, + cell, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTh3indexGetBaseCellNumberPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 2, + "Th3indexGetBaseCellNumberPhysicalFunction requires 2 children but got {}", + arguments.childFunctions.size()); + return Th3indexGetBaseCellNumberPhysicalFunction(std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/Th3indexGetResolutionPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/Th3indexGetResolutionPhysicalFunction.cpp new file mode 100644 index 0000000000..87eb8b9a37 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/Th3indexGetResolutionPhysicalFunction.cpp @@ -0,0 +1,75 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +Th3indexGetResolutionPhysicalFunction::Th3indexGetResolutionPhysicalFunction(PhysicalFunction cell, PhysicalFunction ts) +{ + paramFns.reserve(2); + paramFns.push_back(std::move(cell)); + paramFns.push_back(std::move(ts)); +} + +VarVal Th3indexGetResolutionPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto cell = paramFns[0].execute(record, arena).cast(); + auto ts = paramFns[1].execute(record, arena).cast(); + + const auto result = nautilus::invoke( + +[](uint64_t cell, uint64_t ts) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + Temporal* inst = th3indexinst_make((H3Index)cell, (TimestampTz)ts); + if (!inst) return 0.0; + Temporal* res = th3index_get_resolution(inst); + free(inst); + if (!res) return 0.0; + double r = (double)tint_start_value(res); + free(res); + return r; + } catch (const std::exception&) { return 0.0; } + }, + cell, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTh3indexGetResolutionPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 2, + "Th3indexGetResolutionPhysicalFunction requires 2 children but got {}", + arguments.childFunctions.size()); + return Th3indexGetResolutionPhysicalFunction(std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/Th3indexIsPentagonPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/Th3indexIsPentagonPhysicalFunction.cpp new file mode 100644 index 0000000000..0b318b0b0f --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/Th3indexIsPentagonPhysicalFunction.cpp @@ -0,0 +1,75 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +Th3indexIsPentagonPhysicalFunction::Th3indexIsPentagonPhysicalFunction(PhysicalFunction cell, PhysicalFunction ts) +{ + paramFns.reserve(2); + paramFns.push_back(std::move(cell)); + paramFns.push_back(std::move(ts)); +} + +VarVal Th3indexIsPentagonPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto cell = paramFns[0].execute(record, arena).cast(); + auto ts = paramFns[1].execute(record, arena).cast(); + + const auto result = nautilus::invoke( + +[](uint64_t cell, uint64_t ts) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + Temporal* inst = th3indexinst_make((H3Index)cell, (TimestampTz)ts); + if (!inst) return 0.0; + Temporal* res = th3index_is_pentagon(inst); + free(inst); + if (!res) return 0.0; + double r = tbool_start_value(res) ? 1.0 : 0.0; + free(res); + return r; + } catch (const std::exception&) { return 0.0; } + }, + cell, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTh3indexIsPentagonPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 2, + "Th3indexIsPentagonPhysicalFunction requires 2 children but got {}", + arguments.childFunctions.size()); + return Th3indexIsPentagonPhysicalFunction(std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/Th3indexIsValidCellPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/Th3indexIsValidCellPhysicalFunction.cpp new file mode 100644 index 0000000000..5a435832c3 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/Th3indexIsValidCellPhysicalFunction.cpp @@ -0,0 +1,75 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +Th3indexIsValidCellPhysicalFunction::Th3indexIsValidCellPhysicalFunction(PhysicalFunction cell, PhysicalFunction ts) +{ + paramFns.reserve(2); + paramFns.push_back(std::move(cell)); + paramFns.push_back(std::move(ts)); +} + +VarVal Th3indexIsValidCellPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto cell = paramFns[0].execute(record, arena).cast(); + auto ts = paramFns[1].execute(record, arena).cast(); + + const auto result = nautilus::invoke( + +[](uint64_t cell, uint64_t ts) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + Temporal* inst = th3indexinst_make((H3Index)cell, (TimestampTz)ts); + if (!inst) return 0.0; + Temporal* res = th3index_is_valid_cell(inst); + free(inst); + if (!res) return 0.0; + double r = tbool_start_value(res) ? 1.0 : 0.0; + free(res); + return r; + } catch (const std::exception&) { return 0.0; } + }, + cell, ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTh3indexIsValidCellPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 2, + "Th3indexIsValidCellPhysicalFunction requires 2 children but got {}", + arguments.childFunctions.size()); + return Th3indexIsValidCellPhysicalFunction(std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1])); +} + +} // namespace NES diff --git a/nes-sql-parser/AntlrSQL.g4 b/nes-sql-parser/AntlrSQL.g4 index e0a41cfd0b..9dfea8ea03 100644 --- a/nes-sql-parser/AntlrSQL.g4 +++ b/nes-sql-parser/AntlrSQL.g4 @@ -295,7 +295,7 @@ timeUnit: MS timestampParameter: name=identifier; -functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT | TGE_TTEXT_TEXT | TGE_TEXT_TTEXT | TGT_TTEXT_TEXT | TGT_TEXT_TTEXT | TLE_TTEXT_TEXT | TLE_TEXT_TTEXT | TLT_TTEXT_TEXT | TLT_TEXT_TTEXT | TTEXT_UPPER | TTEXT_LOWER | TTEXT_INITCAP | TEXTCAT_TTEXT_TEXT | TEXTCAT_TEXT_TTEXT | TEXTCAT_TTEXT_TTEXT | GEOM_LENGTH | GEOM_PERIMETER | GEOM_AZIMUTH | GEOG_AREA | GEOG_LENGTH | GEOG_PERIMETER | GEOM_IS_EMPTY | AINTERSECTS_TGEO_GEO | ACOVERS_TGEO_GEO | ADISJOINT_TGEO_GEO | ADWITHIN_TGEO_GEO | EINTERSECTS_TGEO_GEO | ETOUCHES_TGEO_GEO | ECONTAINS_TGEO_GEO | ACONTAINS_TGEO_GEO | ATOUCHES_TGEO_GEO | GEO_NUM_POINTS | GEO_NUM_GEOS | GEO_SRID | GEO_IS_UNITARY | GEO_EQUALS | GEO_SAME | GEOG_DISTANCE | NAD_TGEO_GEO | EVER_EQ_TGEO_GEO | EVER_NE_TGEO_GEO | ALWAYS_EQ_TGEO_GEO | ALWAYS_NE_TGEO_GEO | GEOG_INTERSECTS | GEOG_DWITHIN | ACOVERS_GEO_TGEO | GEOM_INTERSECTS | GEOM_DWITHIN | H3_GS_POINT_TO_CELL | EVER_EQ_TH3INDEX_H3INDEX | EVER_NE_TH3INDEX_H3INDEX | ALWAYS_EQ_TH3INDEX_H3INDEX | ALWAYS_NE_TH3INDEX_H3INDEX | GEOM_INTERSECTS2D | GEOM_DWITHIN2D | GEOM_CONTAINS | GEOM_DISJOINT2D | GEOM_COVERS | GEOM_TOUCHES | GEOM_INTERSECTS3D | GEOM_DWITHIN3D | GEOM_DISTANCE2D | GEOM_DISTANCE3D; +functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT | TGE_TTEXT_TEXT | TGE_TEXT_TTEXT | TGT_TTEXT_TEXT | TGT_TEXT_TTEXT | TLE_TTEXT_TEXT | TLE_TEXT_TTEXT | TLT_TTEXT_TEXT | TLT_TEXT_TTEXT | TTEXT_UPPER | TTEXT_LOWER | TTEXT_INITCAP | TEXTCAT_TTEXT_TEXT | TEXTCAT_TEXT_TTEXT | TEXTCAT_TTEXT_TTEXT | GEOM_LENGTH | GEOM_PERIMETER | GEOM_AZIMUTH | GEOG_AREA | GEOG_LENGTH | GEOG_PERIMETER | GEOM_IS_EMPTY | AINTERSECTS_TGEO_GEO | ACOVERS_TGEO_GEO | ADISJOINT_TGEO_GEO | ADWITHIN_TGEO_GEO | EINTERSECTS_TGEO_GEO | ETOUCHES_TGEO_GEO | ECONTAINS_TGEO_GEO | ACONTAINS_TGEO_GEO | ATOUCHES_TGEO_GEO | GEO_NUM_POINTS | GEO_NUM_GEOS | GEO_SRID | GEO_IS_UNITARY | GEO_EQUALS | GEO_SAME | GEOG_DISTANCE | NAD_TGEO_GEO | EVER_EQ_TGEO_GEO | EVER_NE_TGEO_GEO | ALWAYS_EQ_TGEO_GEO | ALWAYS_NE_TGEO_GEO | GEOG_INTERSECTS | GEOG_DWITHIN | ACOVERS_GEO_TGEO | GEOM_INTERSECTS | GEOM_DWITHIN | H3_GS_POINT_TO_CELL | EVER_EQ_TH3INDEX_H3INDEX | EVER_NE_TH3INDEX_H3INDEX | ALWAYS_EQ_TH3INDEX_H3INDEX | ALWAYS_NE_TH3INDEX_H3INDEX | TH3INDEX_GET_RESOLUTION | TH3INDEX_GET_BASE_CELL_NUMBER | TH3INDEX_IS_VALID_CELL | TH3INDEX_IS_PENTAGON | TH3INDEX_CELL_TO_PARENT_NEXT | TH3INDEX_CELL_TO_CENTER_CHILD_NEXT | TH3INDEX_CELL_TO_PARENT | TH3INDEX_CELL_TO_CENTER_CHILD | TH3INDEX_CELL_TO_CHILD_POS | GEOM_INTERSECTS2D | GEOM_DWITHIN2D | GEOM_CONTAINS | GEOM_DISJOINT2D | GEOM_COVERS | GEOM_TOUCHES | GEOM_INTERSECTS3D | GEOM_DWITHIN3D | GEOM_DISTANCE2D | GEOM_DISTANCE3D; sinkClause: INTO sink (',' sink)*; @@ -796,6 +796,15 @@ EVER_EQ_TH3INDEX_H3INDEX: 'EVER_EQ_TH3INDEX_H3INDEX' | 'ever_eq_th3index_h3index EVER_NE_TH3INDEX_H3INDEX: 'EVER_NE_TH3INDEX_H3INDEX' | 'ever_ne_th3index_h3index'; ALWAYS_EQ_TH3INDEX_H3INDEX: 'ALWAYS_EQ_TH3INDEX_H3INDEX' | 'always_eq_th3index_h3index'; ALWAYS_NE_TH3INDEX_H3INDEX: 'ALWAYS_NE_TH3INDEX_H3INDEX' | 'always_ne_th3index_h3index'; +TH3INDEX_GET_RESOLUTION: 'TH3INDEX_GET_RESOLUTION' | 'th3index_get_resolution'; +TH3INDEX_GET_BASE_CELL_NUMBER: 'TH3INDEX_GET_BASE_CELL_NUMBER' | 'th3index_get_base_cell_number'; +TH3INDEX_IS_VALID_CELL: 'TH3INDEX_IS_VALID_CELL' | 'th3index_is_valid_cell'; +TH3INDEX_IS_PENTAGON: 'TH3INDEX_IS_PENTAGON' | 'th3index_is_pentagon'; +TH3INDEX_CELL_TO_PARENT_NEXT: 'TH3INDEX_CELL_TO_PARENT_NEXT' | 'th3index_cell_to_parent_next'; +TH3INDEX_CELL_TO_CENTER_CHILD_NEXT: 'TH3INDEX_CELL_TO_CENTER_CHILD_NEXT' | 'th3index_cell_to_center_child_next'; +TH3INDEX_CELL_TO_PARENT: 'TH3INDEX_CELL_TO_PARENT' | 'th3index_cell_to_parent'; +TH3INDEX_CELL_TO_CENTER_CHILD: 'TH3INDEX_CELL_TO_CENTER_CHILD' | 'th3index_cell_to_center_child'; +TH3INDEX_CELL_TO_CHILD_POS: 'TH3INDEX_CELL_TO_CHILD_POS' | 'th3index_cell_to_child_pos'; GEOM_INTERSECTS2D: 'GEOM_INTERSECTS2D' | 'geom_intersects2d'; GEOM_DWITHIN2D: 'GEOM_DWITHIN2D' | 'geom_dwithin2d'; GEOM_CONTAINS: 'GEOM_CONTAINS' | 'geom_contains'; diff --git a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp index cc7f1e0fde..dc1c68f616 100644 --- a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp +++ b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp @@ -377,6 +377,15 @@ #include #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include @@ -9177,6 +9186,90 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont return LogicalFunction(AlwaysNeTh3indexH3indexLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2))); } /* END CODEGEN PARSER GLUE: ALWAYS_NE_TH3INDEX_H3INDEX */ + case AntlrSQLParser::TH3INDEX_GET_RESOLUTION: { + PRECONDITION(ctx->functionParam().size() == 2, + "Th3indexGetResolution requires 2 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + return LogicalFunction(Th3indexGetResolutionLogicalFunction(std::move(arg0), std::move(arg1))); + } + /* END CODEGEN PARSER GLUE: TH3INDEX_GET_RESOLUTION */ + case AntlrSQLParser::TH3INDEX_GET_BASE_CELL_NUMBER: { + PRECONDITION(ctx->functionParam().size() == 2, + "Th3indexGetBaseCellNumber requires 2 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + return LogicalFunction(Th3indexGetBaseCellNumberLogicalFunction(std::move(arg0), std::move(arg1))); + } + /* END CODEGEN PARSER GLUE: TH3INDEX_GET_BASE_CELL_NUMBER */ + case AntlrSQLParser::TH3INDEX_IS_VALID_CELL: { + PRECONDITION(ctx->functionParam().size() == 2, + "Th3indexIsValidCell requires 2 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + return LogicalFunction(Th3indexIsValidCellLogicalFunction(std::move(arg0), std::move(arg1))); + } + /* END CODEGEN PARSER GLUE: TH3INDEX_IS_VALID_CELL */ + case AntlrSQLParser::TH3INDEX_IS_PENTAGON: { + PRECONDITION(ctx->functionParam().size() == 2, + "Th3indexIsPentagon requires 2 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + return LogicalFunction(Th3indexIsPentagonLogicalFunction(std::move(arg0), std::move(arg1))); + } + /* END CODEGEN PARSER GLUE: TH3INDEX_IS_PENTAGON */ + case AntlrSQLParser::TH3INDEX_CELL_TO_PARENT_NEXT: { + PRECONDITION(ctx->functionParam().size() == 2, + "Th3indexCellToParentNext requires 2 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + return LogicalFunction(Th3indexCellToParentNextLogicalFunction(std::move(arg0), std::move(arg1))); + } + /* END CODEGEN PARSER GLUE: TH3INDEX_CELL_TO_PARENT_NEXT */ + case AntlrSQLParser::TH3INDEX_CELL_TO_CENTER_CHILD_NEXT: { + PRECONDITION(ctx->functionParam().size() == 2, + "Th3indexCellToCenterChildNext requires 2 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + return LogicalFunction(Th3indexCellToCenterChildNextLogicalFunction(std::move(arg0), std::move(arg1))); + } + /* END CODEGEN PARSER GLUE: TH3INDEX_CELL_TO_CENTER_CHILD_NEXT */ + case AntlrSQLParser::TH3INDEX_CELL_TO_PARENT: { + PRECONDITION(ctx->functionParam().size() == 3, + "Th3indexCellToParent requires 3 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + return LogicalFunction(Th3indexCellToParentLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2))); + } + /* END CODEGEN PARSER GLUE: TH3INDEX_CELL_TO_PARENT */ + case AntlrSQLParser::TH3INDEX_CELL_TO_CENTER_CHILD: { + PRECONDITION(ctx->functionParam().size() == 3, + "Th3indexCellToCenterChild requires 3 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + return LogicalFunction(Th3indexCellToCenterChildLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2))); + } + /* END CODEGEN PARSER GLUE: TH3INDEX_CELL_TO_CENTER_CHILD */ + case AntlrSQLParser::TH3INDEX_CELL_TO_CHILD_POS: { + PRECONDITION(ctx->functionParam().size() == 3, + "Th3indexCellToChildPos requires 3 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + return LogicalFunction(Th3indexCellToChildPosLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2))); + } + /* END CODEGEN PARSER GLUE: TH3INDEX_CELL_TO_CHILD_POS */ /* END CODEGEN PARSER GLUE: GEOM_INTERSECTS2D */ case AntlrSQLParser::GEOM_DWITHIN2D: { PRECONDITION(ctx->functionParam().size() == 3, From f4d5bf74aa67a502d0e69808d9dcb2eb323a68d7 Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Mon, 15 Jun 2026 02:37:13 +0200 Subject: [PATCH 60/96] feat(meos): add TH3INDEX_ARE_NEIGHBOR_CELLS and TH3INDEX_GRID_DISTANCE 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. --- ...h3indexAreNeighborCellsLogicalFunction.hpp | 51 +++++++++ .../Th3indexGridDistanceLogicalFunction.hpp | 51 +++++++++ .../src/Functions/Meos/CMakeLists.txt | 2 + ...h3indexAreNeighborCellsLogicalFunction.cpp | 107 ++++++++++++++++++ .../Th3indexGridDistanceLogicalFunction.cpp | 107 ++++++++++++++++++ ...3indexAreNeighborCellsPhysicalFunction.hpp | 35 ++++++ .../Th3indexGridDistancePhysicalFunction.hpp | 35 ++++++ .../src/Functions/Meos/CMakeLists.txt | 2 + ...3indexAreNeighborCellsPhysicalFunction.cpp | 85 ++++++++++++++ .../Th3indexGridDistancePhysicalFunction.cpp | 85 ++++++++++++++ nes-sql-parser/AntlrSQL.g4 | 4 +- .../src/AntlrSQLQueryPlanCreator.cpp | 24 ++++ 12 files changed, 587 insertions(+), 1 deletion(-) create mode 100644 nes-logical-operators/include/Functions/Meos/Th3indexAreNeighborCellsLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/Th3indexGridDistanceLogicalFunction.hpp create mode 100644 nes-logical-operators/src/Functions/Meos/Th3indexAreNeighborCellsLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/Th3indexGridDistanceLogicalFunction.cpp create mode 100644 nes-physical-operators/include/Functions/Meos/Th3indexAreNeighborCellsPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/Th3indexGridDistancePhysicalFunction.hpp create mode 100644 nes-physical-operators/src/Functions/Meos/Th3indexAreNeighborCellsPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/Th3indexGridDistancePhysicalFunction.cpp diff --git a/nes-logical-operators/include/Functions/Meos/Th3indexAreNeighborCellsLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/Th3indexAreNeighborCellsLogicalFunction.hpp new file mode 100644 index 0000000000..532fce8853 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/Th3indexAreNeighborCellsLogicalFunction.hpp @@ -0,0 +1,51 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if the two H3 cells are neighbors (share an edge), 0.0 otherwise. + * + * Args: (cell1:UINT64, ts1:UINT64, cell2:UINT64, ts2:UINT64) -> FLOAT64. + */ +class Th3indexAreNeighborCellsLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "Th3indexAreNeighborCells"; + + Th3indexAreNeighborCellsLogicalFunction(LogicalFunction cell1, LogicalFunction ts1, + LogicalFunction cell2, LogicalFunction ts2); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/Th3indexGridDistanceLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/Th3indexGridDistanceLogicalFunction.hpp new file mode 100644 index 0000000000..9e5a377e6e --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/Th3indexGridDistanceLogicalFunction.hpp @@ -0,0 +1,51 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns the H3 grid distance (number of cells) between two H3 cells as FLOAT64. + * + * Args: (cell1:UINT64, ts1:UINT64, cell2:UINT64, ts2:UINT64) -> FLOAT64. + */ +class Th3indexGridDistanceLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "Th3indexGridDistance"; + + Th3indexGridDistanceLogicalFunction(LogicalFunction cell1, LogicalFunction ts1, + LogicalFunction cell2, LogicalFunction ts2); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt index 3695594581..567fdce526 100644 --- a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt @@ -335,6 +335,8 @@ add_plugin(Th3indexCellToCenterChildNext LogicalFunction nes-logical-operators T add_plugin(Th3indexCellToParent LogicalFunction nes-logical-operators Th3indexCellToParentLogicalFunction.cpp) add_plugin(Th3indexCellToCenterChild LogicalFunction nes-logical-operators Th3indexCellToCenterChildLogicalFunction.cpp) add_plugin(Th3indexCellToChildPos LogicalFunction nes-logical-operators Th3indexCellToChildPosLogicalFunction.cpp) +add_plugin(Th3indexAreNeighborCells LogicalFunction nes-logical-operators Th3indexAreNeighborCellsLogicalFunction.cpp) +add_plugin(Th3indexGridDistance LogicalFunction nes-logical-operators Th3indexGridDistanceLogicalFunction.cpp) add_plugin(GeomIntersects2d LogicalFunction nes-logical-operators GeomIntersects2dLogicalFunction.cpp) add_plugin(GeomDwithin2d LogicalFunction nes-logical-operators GeomDwithin2dLogicalFunction.cpp) add_plugin(GeomContains LogicalFunction nes-logical-operators GeomContainsLogicalFunction.cpp) diff --git a/nes-logical-operators/src/Functions/Meos/Th3indexAreNeighborCellsLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/Th3indexAreNeighborCellsLogicalFunction.cpp new file mode 100644 index 0000000000..420cdbd9c6 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/Th3indexAreNeighborCellsLogicalFunction.cpp @@ -0,0 +1,107 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +Th3indexAreNeighborCellsLogicalFunction::Th3indexAreNeighborCellsLogicalFunction(LogicalFunction cell1, LogicalFunction ts1, + LogicalFunction cell2, LogicalFunction ts2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(4); + parameters.push_back(std::move(cell1)); + parameters.push_back(std::move(ts1)); + parameters.push_back(std::move(cell2)); + parameters.push_back(std::move(ts2)); +} + +DataType Th3indexAreNeighborCellsLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction Th3indexAreNeighborCellsLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector Th3indexAreNeighborCellsLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction Th3indexAreNeighborCellsLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 4, + "Th3indexAreNeighborCellsLogicalFunction requires 4 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view Th3indexAreNeighborCellsLogicalFunction::getType() const { return NAME; } + +bool Th3indexAreNeighborCellsLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string Th3indexAreNeighborCellsLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction Th3indexAreNeighborCellsLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(4); + c.emplace_back(parameters[0].withInferredDataType(schema)); + c.emplace_back(parameters[1].withInferredDataType(schema)); + c.emplace_back(parameters[2].withInferredDataType(schema)); + c.emplace_back(parameters[3].withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "cell1 must be UINT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "cell2 must be UINT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); + return withChildren(c); +} + +SerializableFunction Th3indexAreNeighborCellsLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTh3indexAreNeighborCellsLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 4, + "Th3indexAreNeighborCellsLogicalFunction requires 4 children but got {}", + arguments.children.size()); + return Th3indexAreNeighborCellsLogicalFunction(std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/Th3indexGridDistanceLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/Th3indexGridDistanceLogicalFunction.cpp new file mode 100644 index 0000000000..fbe6ca4117 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/Th3indexGridDistanceLogicalFunction.cpp @@ -0,0 +1,107 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +Th3indexGridDistanceLogicalFunction::Th3indexGridDistanceLogicalFunction(LogicalFunction cell1, LogicalFunction ts1, + LogicalFunction cell2, LogicalFunction ts2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(4); + parameters.push_back(std::move(cell1)); + parameters.push_back(std::move(ts1)); + parameters.push_back(std::move(cell2)); + parameters.push_back(std::move(ts2)); +} + +DataType Th3indexGridDistanceLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction Th3indexGridDistanceLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector Th3indexGridDistanceLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction Th3indexGridDistanceLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 4, + "Th3indexGridDistanceLogicalFunction requires 4 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view Th3indexGridDistanceLogicalFunction::getType() const { return NAME; } + +bool Th3indexGridDistanceLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string Th3indexGridDistanceLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction Th3indexGridDistanceLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(4); + c.emplace_back(parameters[0].withInferredDataType(schema)); + c.emplace_back(parameters[1].withInferredDataType(schema)); + c.emplace_back(parameters[2].withInferredDataType(schema)); + c.emplace_back(parameters[3].withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "cell1 must be UINT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "cell2 must be UINT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); + return withChildren(c); +} + +SerializableFunction Th3indexGridDistanceLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTh3indexGridDistanceLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 4, + "Th3indexGridDistanceLogicalFunction requires 4 children but got {}", + arguments.children.size()); + return Th3indexGridDistanceLogicalFunction(std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3])); +} + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/Th3indexAreNeighborCellsPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/Th3indexAreNeighborCellsPhysicalFunction.hpp new file mode 100644 index 0000000000..ef1ef99ec4 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/Th3indexAreNeighborCellsPhysicalFunction.hpp @@ -0,0 +1,35 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class Th3indexAreNeighborCellsPhysicalFunction : public PhysicalFunctionConcept { +public: + Th3indexAreNeighborCellsPhysicalFunction(PhysicalFunction cell1, PhysicalFunction ts1, + PhysicalFunction cell2, PhysicalFunction ts2); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/Th3indexGridDistancePhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/Th3indexGridDistancePhysicalFunction.hpp new file mode 100644 index 0000000000..a6064c1cdd --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/Th3indexGridDistancePhysicalFunction.hpp @@ -0,0 +1,35 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class Th3indexGridDistancePhysicalFunction : public PhysicalFunctionConcept { +public: + Th3indexGridDistancePhysicalFunction(PhysicalFunction cell1, PhysicalFunction ts1, + PhysicalFunction cell2, PhysicalFunction ts2); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt index 9ea2261217..1b3ab90e67 100644 --- a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt @@ -334,6 +334,8 @@ add_plugin(Th3indexCellToCenterChildNext PhysicalFunction nes-physical-operators add_plugin(Th3indexCellToParent PhysicalFunction nes-physical-operators Th3indexCellToParentPhysicalFunction.cpp) add_plugin(Th3indexCellToCenterChild PhysicalFunction nes-physical-operators Th3indexCellToCenterChildPhysicalFunction.cpp) add_plugin(Th3indexCellToChildPos PhysicalFunction nes-physical-operators Th3indexCellToChildPosPhysicalFunction.cpp) +add_plugin(Th3indexAreNeighborCells PhysicalFunction nes-physical-operators Th3indexAreNeighborCellsPhysicalFunction.cpp) +add_plugin(Th3indexGridDistance PhysicalFunction nes-physical-operators Th3indexGridDistancePhysicalFunction.cpp) add_plugin(GeomIntersects2d PhysicalFunction nes-physical-operators GeomIntersects2dPhysicalFunction.cpp) add_plugin(GeomDwithin2d PhysicalFunction nes-physical-operators GeomDwithin2dPhysicalFunction.cpp) add_plugin(GeomContains PhysicalFunction nes-physical-operators GeomContainsPhysicalFunction.cpp) diff --git a/nes-physical-operators/src/Functions/Meos/Th3indexAreNeighborCellsPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/Th3indexAreNeighborCellsPhysicalFunction.cpp new file mode 100644 index 0000000000..82d4b04de1 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/Th3indexAreNeighborCellsPhysicalFunction.cpp @@ -0,0 +1,85 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +Th3indexAreNeighborCellsPhysicalFunction::Th3indexAreNeighborCellsPhysicalFunction(PhysicalFunction cell1, PhysicalFunction ts1, + PhysicalFunction cell2, PhysicalFunction ts2) +{ + paramFns.reserve(4); + paramFns.push_back(std::move(cell1)); + paramFns.push_back(std::move(ts1)); + paramFns.push_back(std::move(cell2)); + paramFns.push_back(std::move(ts2)); +} + +VarVal Th3indexAreNeighborCellsPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto cell1 = paramFns[0].execute(record, arena).cast(); + auto ts1 = paramFns[1].execute(record, arena).cast(); + auto cell2 = paramFns[2].execute(record, arena).cast(); + auto ts2 = paramFns[3].execute(record, arena).cast(); + + const auto result = nautilus::invoke( + +[](uint64_t cell1, uint64_t ts1, uint64_t cell2, uint64_t ts2) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + Temporal* inst1 = th3indexinst_make((H3Index)cell1, (TimestampTz)ts1); + if (!inst1) return 0.0; + Temporal* inst2 = th3indexinst_make((H3Index)cell2, (TimestampTz)ts2); + if (!inst2) { free(inst1); return 0.0; } + Temporal* res = th3index_are_neighbor_cells(inst1, inst2); + free(inst1); + free(inst2); + if (!res) return 0.0; + double r = tbool_start_value(res) ? 1.0 : 0.0; + free(res); + return r; + } catch (const std::exception&) { return 0.0; } + }, + cell1, ts1, cell2, ts2); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTh3indexAreNeighborCellsPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 4, + "Th3indexAreNeighborCellsPhysicalFunction requires 4 children but got {}", + arguments.childFunctions.size()); + return Th3indexAreNeighborCellsPhysicalFunction(std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/Th3indexGridDistancePhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/Th3indexGridDistancePhysicalFunction.cpp new file mode 100644 index 0000000000..daec755b58 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/Th3indexGridDistancePhysicalFunction.cpp @@ -0,0 +1,85 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +Th3indexGridDistancePhysicalFunction::Th3indexGridDistancePhysicalFunction(PhysicalFunction cell1, PhysicalFunction ts1, + PhysicalFunction cell2, PhysicalFunction ts2) +{ + paramFns.reserve(4); + paramFns.push_back(std::move(cell1)); + paramFns.push_back(std::move(ts1)); + paramFns.push_back(std::move(cell2)); + paramFns.push_back(std::move(ts2)); +} + +VarVal Th3indexGridDistancePhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto cell1 = paramFns[0].execute(record, arena).cast(); + auto ts1 = paramFns[1].execute(record, arena).cast(); + auto cell2 = paramFns[2].execute(record, arena).cast(); + auto ts2 = paramFns[3].execute(record, arena).cast(); + + const auto result = nautilus::invoke( + +[](uint64_t cell1, uint64_t ts1, uint64_t cell2, uint64_t ts2) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + Temporal* inst1 = th3indexinst_make((H3Index)cell1, (TimestampTz)ts1); + if (!inst1) return 0.0; + Temporal* inst2 = th3indexinst_make((H3Index)cell2, (TimestampTz)ts2); + if (!inst2) { free(inst1); return 0.0; } + Temporal* res = th3index_grid_distance(inst1, inst2); + free(inst1); + free(inst2); + if (!res) return 0.0; + double r = (double)tint_start_value(res); + free(res); + return r; + } catch (const std::exception&) { return 0.0; } + }, + cell1, ts1, cell2, ts2); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTh3indexGridDistancePhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 4, + "Th3indexGridDistancePhysicalFunction requires 4 children but got {}", + arguments.childFunctions.size()); + return Th3indexGridDistancePhysicalFunction(std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3])); +} + +} // namespace NES diff --git a/nes-sql-parser/AntlrSQL.g4 b/nes-sql-parser/AntlrSQL.g4 index 9dfea8ea03..5a6e7111ec 100644 --- a/nes-sql-parser/AntlrSQL.g4 +++ b/nes-sql-parser/AntlrSQL.g4 @@ -295,7 +295,7 @@ timeUnit: MS timestampParameter: name=identifier; -functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT | TGE_TTEXT_TEXT | TGE_TEXT_TTEXT | TGT_TTEXT_TEXT | TGT_TEXT_TTEXT | TLE_TTEXT_TEXT | TLE_TEXT_TTEXT | TLT_TTEXT_TEXT | TLT_TEXT_TTEXT | TTEXT_UPPER | TTEXT_LOWER | TTEXT_INITCAP | TEXTCAT_TTEXT_TEXT | TEXTCAT_TEXT_TTEXT | TEXTCAT_TTEXT_TTEXT | GEOM_LENGTH | GEOM_PERIMETER | GEOM_AZIMUTH | GEOG_AREA | GEOG_LENGTH | GEOG_PERIMETER | GEOM_IS_EMPTY | AINTERSECTS_TGEO_GEO | ACOVERS_TGEO_GEO | ADISJOINT_TGEO_GEO | ADWITHIN_TGEO_GEO | EINTERSECTS_TGEO_GEO | ETOUCHES_TGEO_GEO | ECONTAINS_TGEO_GEO | ACONTAINS_TGEO_GEO | ATOUCHES_TGEO_GEO | GEO_NUM_POINTS | GEO_NUM_GEOS | GEO_SRID | GEO_IS_UNITARY | GEO_EQUALS | GEO_SAME | GEOG_DISTANCE | NAD_TGEO_GEO | EVER_EQ_TGEO_GEO | EVER_NE_TGEO_GEO | ALWAYS_EQ_TGEO_GEO | ALWAYS_NE_TGEO_GEO | GEOG_INTERSECTS | GEOG_DWITHIN | ACOVERS_GEO_TGEO | GEOM_INTERSECTS | GEOM_DWITHIN | H3_GS_POINT_TO_CELL | EVER_EQ_TH3INDEX_H3INDEX | EVER_NE_TH3INDEX_H3INDEX | ALWAYS_EQ_TH3INDEX_H3INDEX | ALWAYS_NE_TH3INDEX_H3INDEX | TH3INDEX_GET_RESOLUTION | TH3INDEX_GET_BASE_CELL_NUMBER | TH3INDEX_IS_VALID_CELL | TH3INDEX_IS_PENTAGON | TH3INDEX_CELL_TO_PARENT_NEXT | TH3INDEX_CELL_TO_CENTER_CHILD_NEXT | TH3INDEX_CELL_TO_PARENT | TH3INDEX_CELL_TO_CENTER_CHILD | TH3INDEX_CELL_TO_CHILD_POS | GEOM_INTERSECTS2D | GEOM_DWITHIN2D | GEOM_CONTAINS | GEOM_DISJOINT2D | GEOM_COVERS | GEOM_TOUCHES | GEOM_INTERSECTS3D | GEOM_DWITHIN3D | GEOM_DISTANCE2D | GEOM_DISTANCE3D; +functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT | TGE_TTEXT_TEXT | TGE_TEXT_TTEXT | TGT_TTEXT_TEXT | TGT_TEXT_TTEXT | TLE_TTEXT_TEXT | TLE_TEXT_TTEXT | TLT_TTEXT_TEXT | TLT_TEXT_TTEXT | TTEXT_UPPER | TTEXT_LOWER | TTEXT_INITCAP | TEXTCAT_TTEXT_TEXT | TEXTCAT_TEXT_TTEXT | TEXTCAT_TTEXT_TTEXT | GEOM_LENGTH | GEOM_PERIMETER | GEOM_AZIMUTH | GEOG_AREA | GEOG_LENGTH | GEOG_PERIMETER | GEOM_IS_EMPTY | AINTERSECTS_TGEO_GEO | ACOVERS_TGEO_GEO | ADISJOINT_TGEO_GEO | ADWITHIN_TGEO_GEO | EINTERSECTS_TGEO_GEO | ETOUCHES_TGEO_GEO | ECONTAINS_TGEO_GEO | ACONTAINS_TGEO_GEO | ATOUCHES_TGEO_GEO | GEO_NUM_POINTS | GEO_NUM_GEOS | GEO_SRID | GEO_IS_UNITARY | GEO_EQUALS | GEO_SAME | GEOG_DISTANCE | NAD_TGEO_GEO | EVER_EQ_TGEO_GEO | EVER_NE_TGEO_GEO | ALWAYS_EQ_TGEO_GEO | ALWAYS_NE_TGEO_GEO | GEOG_INTERSECTS | GEOG_DWITHIN | ACOVERS_GEO_TGEO | GEOM_INTERSECTS | GEOM_DWITHIN | H3_GS_POINT_TO_CELL | EVER_EQ_TH3INDEX_H3INDEX | EVER_NE_TH3INDEX_H3INDEX | ALWAYS_EQ_TH3INDEX_H3INDEX | ALWAYS_NE_TH3INDEX_H3INDEX | TH3INDEX_GET_RESOLUTION | TH3INDEX_GET_BASE_CELL_NUMBER | TH3INDEX_IS_VALID_CELL | TH3INDEX_IS_PENTAGON | TH3INDEX_CELL_TO_PARENT_NEXT | TH3INDEX_CELL_TO_CENTER_CHILD_NEXT | TH3INDEX_CELL_TO_PARENT | TH3INDEX_CELL_TO_CENTER_CHILD | TH3INDEX_CELL_TO_CHILD_POS | TH3INDEX_ARE_NEIGHBOR_CELLS | TH3INDEX_GRID_DISTANCE | GEOM_INTERSECTS2D | GEOM_DWITHIN2D | GEOM_CONTAINS | GEOM_DISJOINT2D | GEOM_COVERS | GEOM_TOUCHES | GEOM_INTERSECTS3D | GEOM_DWITHIN3D | GEOM_DISTANCE2D | GEOM_DISTANCE3D; sinkClause: INTO sink (',' sink)*; @@ -805,6 +805,8 @@ TH3INDEX_CELL_TO_CENTER_CHILD_NEXT: 'TH3INDEX_CELL_TO_CENTER_CHILD_NEXT' | 'th3i TH3INDEX_CELL_TO_PARENT: 'TH3INDEX_CELL_TO_PARENT' | 'th3index_cell_to_parent'; TH3INDEX_CELL_TO_CENTER_CHILD: 'TH3INDEX_CELL_TO_CENTER_CHILD' | 'th3index_cell_to_center_child'; TH3INDEX_CELL_TO_CHILD_POS: 'TH3INDEX_CELL_TO_CHILD_POS' | 'th3index_cell_to_child_pos'; +TH3INDEX_ARE_NEIGHBOR_CELLS: 'TH3INDEX_ARE_NEIGHBOR_CELLS' | 'th3index_are_neighbor_cells'; +TH3INDEX_GRID_DISTANCE: 'TH3INDEX_GRID_DISTANCE' | 'th3index_grid_distance'; GEOM_INTERSECTS2D: 'GEOM_INTERSECTS2D' | 'geom_intersects2d'; GEOM_DWITHIN2D: 'GEOM_DWITHIN2D' | 'geom_dwithin2d'; GEOM_CONTAINS: 'GEOM_CONTAINS' | 'geom_contains'; diff --git a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp index dc1c68f616..364ad25082 100644 --- a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp +++ b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp @@ -386,6 +386,8 @@ #include #include #include +#include +#include #include #include #include @@ -9270,6 +9272,28 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont return LogicalFunction(Th3indexCellToChildPosLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2))); } /* END CODEGEN PARSER GLUE: TH3INDEX_CELL_TO_CHILD_POS */ + case AntlrSQLParser::TH3INDEX_ARE_NEIGHBOR_CELLS: { + PRECONDITION(ctx->functionParam().size() == 4, + "Th3indexAreNeighborCells requires 4 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + return LogicalFunction(Th3indexAreNeighborCellsLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3))); + } + /* END CODEGEN PARSER GLUE: TH3INDEX_ARE_NEIGHBOR_CELLS */ + case AntlrSQLParser::TH3INDEX_GRID_DISTANCE: { + PRECONDITION(ctx->functionParam().size() == 4, + "Th3indexGridDistance requires 4 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + return LogicalFunction(Th3indexGridDistanceLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3))); + } + /* END CODEGEN PARSER GLUE: TH3INDEX_GRID_DISTANCE */ /* END CODEGEN PARSER GLUE: GEOM_INTERSECTS2D */ case AntlrSQLParser::GEOM_DWITHIN2D: { PRECONDITION(ctx->functionParam().size() == 3, From 7615a93ec95fd937068a13f5ed3cbe642543a8a3 Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Mon, 15 Jun 2026 03:39:11 +0200 Subject: [PATCH 61/96] feat(meos): add tcbuffer_geo spatial predicate NES operators (W113) 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). --- .../AcontainsTcbufferGeoLogicalFunction.hpp | 52 +++++++ .../AcoversTcbufferGeoLogicalFunction.hpp | 52 +++++++ .../AdisjointTcbufferGeoLogicalFunction.hpp | 52 +++++++ .../AintersectsTcbufferGeoLogicalFunction.hpp | 52 +++++++ .../AtouchesTcbufferGeoLogicalFunction.hpp | 52 +++++++ .../EcontainsTcbufferGeoLogicalFunction.hpp | 52 +++++++ .../EcoversTcbufferGeoLogicalFunction.hpp | 52 +++++++ .../EdisjointTcbufferGeoLogicalFunction.hpp | 52 +++++++ .../EintersectsTcbufferGeoLogicalFunction.hpp | 52 +++++++ .../EtouchesTcbufferGeoLogicalFunction.hpp | 52 +++++++ .../Meos/NadTcbufferGeoLogicalFunction.hpp | 52 +++++++ .../AcontainsTcbufferGeoLogicalFunction.cpp | 112 ++++++++++++++ .../AcoversTcbufferGeoLogicalFunction.cpp | 112 ++++++++++++++ .../AdisjointTcbufferGeoLogicalFunction.cpp | 112 ++++++++++++++ .../AintersectsTcbufferGeoLogicalFunction.cpp | 112 ++++++++++++++ .../AtouchesTcbufferGeoLogicalFunction.cpp | 112 ++++++++++++++ .../src/Functions/Meos/CMakeLists.txt | 11 ++ .../EcontainsTcbufferGeoLogicalFunction.cpp | 112 ++++++++++++++ .../EcoversTcbufferGeoLogicalFunction.cpp | 112 ++++++++++++++ .../EdisjointTcbufferGeoLogicalFunction.cpp | 112 ++++++++++++++ .../EintersectsTcbufferGeoLogicalFunction.cpp | 112 ++++++++++++++ .../EtouchesTcbufferGeoLogicalFunction.cpp | 112 ++++++++++++++ .../Meos/NadTcbufferGeoLogicalFunction.cpp | 112 ++++++++++++++ .../AcontainsTcbufferGeoPhysicalFunction.hpp | 36 +++++ .../AcoversTcbufferGeoPhysicalFunction.hpp | 36 +++++ .../AdisjointTcbufferGeoPhysicalFunction.hpp | 36 +++++ ...AintersectsTcbufferGeoPhysicalFunction.hpp | 36 +++++ .../AtouchesTcbufferGeoPhysicalFunction.hpp | 36 +++++ .../EcontainsTcbufferGeoPhysicalFunction.hpp | 36 +++++ .../EcoversTcbufferGeoPhysicalFunction.hpp | 36 +++++ .../EdisjointTcbufferGeoPhysicalFunction.hpp | 36 +++++ ...EintersectsTcbufferGeoPhysicalFunction.hpp | 36 +++++ .../EtouchesTcbufferGeoPhysicalFunction.hpp | 36 +++++ .../Meos/NadTcbufferGeoPhysicalFunction.hpp | 36 +++++ .../AcontainsTcbufferGeoPhysicalFunction.cpp | 104 +++++++++++++ .../AcoversTcbufferGeoPhysicalFunction.cpp | 104 +++++++++++++ .../AdisjointTcbufferGeoPhysicalFunction.cpp | 104 +++++++++++++ ...AintersectsTcbufferGeoPhysicalFunction.cpp | 104 +++++++++++++ .../AtouchesTcbufferGeoPhysicalFunction.cpp | 104 +++++++++++++ .../src/Functions/Meos/CMakeLists.txt | 11 ++ .../EcontainsTcbufferGeoPhysicalFunction.cpp | 104 +++++++++++++ .../EcoversTcbufferGeoPhysicalFunction.cpp | 104 +++++++++++++ .../EdisjointTcbufferGeoPhysicalFunction.cpp | 104 +++++++++++++ ...EintersectsTcbufferGeoPhysicalFunction.cpp | 104 +++++++++++++ .../EtouchesTcbufferGeoPhysicalFunction.cpp | 104 +++++++++++++ .../Meos/NadTcbufferGeoPhysicalFunction.cpp | 104 +++++++++++++ nes-sql-parser/AntlrSQL.g4 | 13 +- .../src/AntlrSQLQueryPlanCreator.cpp | 143 ++++++++++++++++++ 48 files changed, 3521 insertions(+), 1 deletion(-) create mode 100644 nes-logical-operators/include/Functions/Meos/AcontainsTcbufferGeoLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AcoversTcbufferGeoLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AdisjointTcbufferGeoLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AintersectsTcbufferGeoLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AtouchesTcbufferGeoLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EcontainsTcbufferGeoLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EcoversTcbufferGeoLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EdisjointTcbufferGeoLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EintersectsTcbufferGeoLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EtouchesTcbufferGeoLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/NadTcbufferGeoLogicalFunction.hpp create mode 100644 nes-logical-operators/src/Functions/Meos/AcontainsTcbufferGeoLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AcoversTcbufferGeoLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AdisjointTcbufferGeoLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AintersectsTcbufferGeoLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AtouchesTcbufferGeoLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EcontainsTcbufferGeoLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EcoversTcbufferGeoLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EdisjointTcbufferGeoLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EintersectsTcbufferGeoLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EtouchesTcbufferGeoLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/NadTcbufferGeoLogicalFunction.cpp create mode 100644 nes-physical-operators/include/Functions/Meos/AcontainsTcbufferGeoPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AcoversTcbufferGeoPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AdisjointTcbufferGeoPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AintersectsTcbufferGeoPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AtouchesTcbufferGeoPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EcontainsTcbufferGeoPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EcoversTcbufferGeoPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EdisjointTcbufferGeoPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EintersectsTcbufferGeoPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EtouchesTcbufferGeoPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/NadTcbufferGeoPhysicalFunction.hpp create mode 100644 nes-physical-operators/src/Functions/Meos/AcontainsTcbufferGeoPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AcoversTcbufferGeoPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AdisjointTcbufferGeoPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AintersectsTcbufferGeoPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AtouchesTcbufferGeoPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EcontainsTcbufferGeoPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EcoversTcbufferGeoPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EdisjointTcbufferGeoPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EintersectsTcbufferGeoPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EtouchesTcbufferGeoPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/NadTcbufferGeoPhysicalFunction.cpp diff --git a/nes-logical-operators/include/Functions/Meos/AcontainsTcbufferGeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AcontainsTcbufferGeoLogicalFunction.hpp new file mode 100644 index 0000000000..2ee87d957e --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AcontainsTcbufferGeoLogicalFunction.hpp @@ -0,0 +1,52 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if the tcbuffer always contains the static geometry, 0.0 otherwise. + * + * Args: (lon:FLOAT64, lat:FLOAT64, radius:FLOAT64, ts:UINT64, wkt:VARCHAR) -> FLOAT64. + */ +class AcontainsTcbufferGeoLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AcontainsTcbufferGeo"; + + AcontainsTcbufferGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, + LogicalFunction radius, LogicalFunction ts, + LogicalFunction wkt); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AcoversTcbufferGeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AcoversTcbufferGeoLogicalFunction.hpp new file mode 100644 index 0000000000..e1f853661e --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AcoversTcbufferGeoLogicalFunction.hpp @@ -0,0 +1,52 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if the tcbuffer always covers the static geometry, 0.0 otherwise. + * + * Args: (lon:FLOAT64, lat:FLOAT64, radius:FLOAT64, ts:UINT64, wkt:VARCHAR) -> FLOAT64. + */ +class AcoversTcbufferGeoLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AcoversTcbufferGeo"; + + AcoversTcbufferGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, + LogicalFunction radius, LogicalFunction ts, + LogicalFunction wkt); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AdisjointTcbufferGeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AdisjointTcbufferGeoLogicalFunction.hpp new file mode 100644 index 0000000000..6785185c3d --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AdisjointTcbufferGeoLogicalFunction.hpp @@ -0,0 +1,52 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if the tcbuffer is always disjoint from the static geometry, 0.0 otherwise. + * + * Args: (lon:FLOAT64, lat:FLOAT64, radius:FLOAT64, ts:UINT64, wkt:VARCHAR) -> FLOAT64. + */ +class AdisjointTcbufferGeoLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AdisjointTcbufferGeo"; + + AdisjointTcbufferGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, + LogicalFunction radius, LogicalFunction ts, + LogicalFunction wkt); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AintersectsTcbufferGeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AintersectsTcbufferGeoLogicalFunction.hpp new file mode 100644 index 0000000000..7d8acc618a --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AintersectsTcbufferGeoLogicalFunction.hpp @@ -0,0 +1,52 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if the tcbuffer always intersects the static geometry, 0.0 otherwise. + * + * Args: (lon:FLOAT64, lat:FLOAT64, radius:FLOAT64, ts:UINT64, wkt:VARCHAR) -> FLOAT64. + */ +class AintersectsTcbufferGeoLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AintersectsTcbufferGeo"; + + AintersectsTcbufferGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, + LogicalFunction radius, LogicalFunction ts, + LogicalFunction wkt); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AtouchesTcbufferGeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AtouchesTcbufferGeoLogicalFunction.hpp new file mode 100644 index 0000000000..6e543f8eb5 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AtouchesTcbufferGeoLogicalFunction.hpp @@ -0,0 +1,52 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if the tcbuffer always touches the static geometry, 0.0 otherwise. + * + * Args: (lon:FLOAT64, lat:FLOAT64, radius:FLOAT64, ts:UINT64, wkt:VARCHAR) -> FLOAT64. + */ +class AtouchesTcbufferGeoLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AtouchesTcbufferGeo"; + + AtouchesTcbufferGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, + LogicalFunction radius, LogicalFunction ts, + LogicalFunction wkt); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EcontainsTcbufferGeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EcontainsTcbufferGeoLogicalFunction.hpp new file mode 100644 index 0000000000..638f59e1e7 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EcontainsTcbufferGeoLogicalFunction.hpp @@ -0,0 +1,52 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if the tcbuffer ever contains the static geometry, 0.0 otherwise. + * + * Args: (lon:FLOAT64, lat:FLOAT64, radius:FLOAT64, ts:UINT64, wkt:VARCHAR) -> FLOAT64. + */ +class EcontainsTcbufferGeoLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EcontainsTcbufferGeo"; + + EcontainsTcbufferGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, + LogicalFunction radius, LogicalFunction ts, + LogicalFunction wkt); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EcoversTcbufferGeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EcoversTcbufferGeoLogicalFunction.hpp new file mode 100644 index 0000000000..d13d5b4607 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EcoversTcbufferGeoLogicalFunction.hpp @@ -0,0 +1,52 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if the tcbuffer ever covers the static geometry, 0.0 otherwise. + * + * Args: (lon:FLOAT64, lat:FLOAT64, radius:FLOAT64, ts:UINT64, wkt:VARCHAR) -> FLOAT64. + */ +class EcoversTcbufferGeoLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EcoversTcbufferGeo"; + + EcoversTcbufferGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, + LogicalFunction radius, LogicalFunction ts, + LogicalFunction wkt); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EdisjointTcbufferGeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EdisjointTcbufferGeoLogicalFunction.hpp new file mode 100644 index 0000000000..682f6bfaf5 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EdisjointTcbufferGeoLogicalFunction.hpp @@ -0,0 +1,52 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if the tcbuffer is ever disjoint from the static geometry, 0.0 otherwise. + * + * Args: (lon:FLOAT64, lat:FLOAT64, radius:FLOAT64, ts:UINT64, wkt:VARCHAR) -> FLOAT64. + */ +class EdisjointTcbufferGeoLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EdisjointTcbufferGeo"; + + EdisjointTcbufferGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, + LogicalFunction radius, LogicalFunction ts, + LogicalFunction wkt); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EintersectsTcbufferGeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EintersectsTcbufferGeoLogicalFunction.hpp new file mode 100644 index 0000000000..7375b0d981 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EintersectsTcbufferGeoLogicalFunction.hpp @@ -0,0 +1,52 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if the tcbuffer ever intersects the static geometry, 0.0 otherwise. + * + * Args: (lon:FLOAT64, lat:FLOAT64, radius:FLOAT64, ts:UINT64, wkt:VARCHAR) -> FLOAT64. + */ +class EintersectsTcbufferGeoLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EintersectsTcbufferGeo"; + + EintersectsTcbufferGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, + LogicalFunction radius, LogicalFunction ts, + LogicalFunction wkt); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EtouchesTcbufferGeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EtouchesTcbufferGeoLogicalFunction.hpp new file mode 100644 index 0000000000..01e22b284b --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EtouchesTcbufferGeoLogicalFunction.hpp @@ -0,0 +1,52 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if the tcbuffer ever touches the static geometry, 0.0 otherwise. + * + * Args: (lon:FLOAT64, lat:FLOAT64, radius:FLOAT64, ts:UINT64, wkt:VARCHAR) -> FLOAT64. + */ +class EtouchesTcbufferGeoLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EtouchesTcbufferGeo"; + + EtouchesTcbufferGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, + LogicalFunction radius, LogicalFunction ts, + LogicalFunction wkt); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/NadTcbufferGeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/NadTcbufferGeoLogicalFunction.hpp new file mode 100644 index 0000000000..8d5967deec --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/NadTcbufferGeoLogicalFunction.hpp @@ -0,0 +1,52 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns the nearest approach distance between the tcbuffer and a static geometry. + * + * Args: (lon:FLOAT64, lat:FLOAT64, radius:FLOAT64, ts:UINT64, wkt:VARCHAR) -> FLOAT64. + */ +class NadTcbufferGeoLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "NadTcbufferGeo"; + + NadTcbufferGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, + LogicalFunction radius, LogicalFunction ts, + LogicalFunction wkt); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AcontainsTcbufferGeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AcontainsTcbufferGeoLogicalFunction.cpp new file mode 100644 index 0000000000..9dac9b65de --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AcontainsTcbufferGeoLogicalFunction.cpp @@ -0,0 +1,112 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AcontainsTcbufferGeoLogicalFunction::AcontainsTcbufferGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, + LogicalFunction radius, LogicalFunction ts, + LogicalFunction wkt) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(5); + parameters.push_back(std::move(lon)); + parameters.push_back(std::move(lat)); + parameters.push_back(std::move(radius)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(wkt)); +} + +DataType AcontainsTcbufferGeoLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AcontainsTcbufferGeoLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AcontainsTcbufferGeoLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AcontainsTcbufferGeoLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 5, + "AcontainsTcbufferGeoLogicalFunction requires 5 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AcontainsTcbufferGeoLogicalFunction::getType() const { return NAME; } + +bool AcontainsTcbufferGeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AcontainsTcbufferGeoLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction AcontainsTcbufferGeoLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(5); + c.emplace_back(parameters[0].withInferredDataType(schema)); + c.emplace_back(parameters[1].withInferredDataType(schema)); + c.emplace_back(parameters[2].withInferredDataType(schema)); + c.emplace_back(parameters[3].withInferredDataType(schema)); + c.emplace_back(parameters[4].withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon must be FLOAT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "radius must be FLOAT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::VARSIZED), "wkt must be VARCHAR"); + return withChildren(c); +} + +SerializableFunction AcontainsTcbufferGeoLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAcontainsTcbufferGeoLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 5, + "AcontainsTcbufferGeoLogicalFunction requires 5 children but got {}", + arguments.children.size()); + return AcontainsTcbufferGeoLogicalFunction(std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AcoversTcbufferGeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AcoversTcbufferGeoLogicalFunction.cpp new file mode 100644 index 0000000000..1d26b552ca --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AcoversTcbufferGeoLogicalFunction.cpp @@ -0,0 +1,112 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AcoversTcbufferGeoLogicalFunction::AcoversTcbufferGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, + LogicalFunction radius, LogicalFunction ts, + LogicalFunction wkt) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(5); + parameters.push_back(std::move(lon)); + parameters.push_back(std::move(lat)); + parameters.push_back(std::move(radius)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(wkt)); +} + +DataType AcoversTcbufferGeoLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AcoversTcbufferGeoLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AcoversTcbufferGeoLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AcoversTcbufferGeoLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 5, + "AcoversTcbufferGeoLogicalFunction requires 5 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AcoversTcbufferGeoLogicalFunction::getType() const { return NAME; } + +bool AcoversTcbufferGeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AcoversTcbufferGeoLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction AcoversTcbufferGeoLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(5); + c.emplace_back(parameters[0].withInferredDataType(schema)); + c.emplace_back(parameters[1].withInferredDataType(schema)); + c.emplace_back(parameters[2].withInferredDataType(schema)); + c.emplace_back(parameters[3].withInferredDataType(schema)); + c.emplace_back(parameters[4].withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon must be FLOAT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "radius must be FLOAT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::VARSIZED), "wkt must be VARCHAR"); + return withChildren(c); +} + +SerializableFunction AcoversTcbufferGeoLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAcoversTcbufferGeoLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 5, + "AcoversTcbufferGeoLogicalFunction requires 5 children but got {}", + arguments.children.size()); + return AcoversTcbufferGeoLogicalFunction(std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AdisjointTcbufferGeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AdisjointTcbufferGeoLogicalFunction.cpp new file mode 100644 index 0000000000..713a493a0c --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AdisjointTcbufferGeoLogicalFunction.cpp @@ -0,0 +1,112 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AdisjointTcbufferGeoLogicalFunction::AdisjointTcbufferGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, + LogicalFunction radius, LogicalFunction ts, + LogicalFunction wkt) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(5); + parameters.push_back(std::move(lon)); + parameters.push_back(std::move(lat)); + parameters.push_back(std::move(radius)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(wkt)); +} + +DataType AdisjointTcbufferGeoLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AdisjointTcbufferGeoLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AdisjointTcbufferGeoLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AdisjointTcbufferGeoLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 5, + "AdisjointTcbufferGeoLogicalFunction requires 5 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AdisjointTcbufferGeoLogicalFunction::getType() const { return NAME; } + +bool AdisjointTcbufferGeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AdisjointTcbufferGeoLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction AdisjointTcbufferGeoLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(5); + c.emplace_back(parameters[0].withInferredDataType(schema)); + c.emplace_back(parameters[1].withInferredDataType(schema)); + c.emplace_back(parameters[2].withInferredDataType(schema)); + c.emplace_back(parameters[3].withInferredDataType(schema)); + c.emplace_back(parameters[4].withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon must be FLOAT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "radius must be FLOAT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::VARSIZED), "wkt must be VARCHAR"); + return withChildren(c); +} + +SerializableFunction AdisjointTcbufferGeoLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAdisjointTcbufferGeoLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 5, + "AdisjointTcbufferGeoLogicalFunction requires 5 children but got {}", + arguments.children.size()); + return AdisjointTcbufferGeoLogicalFunction(std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AintersectsTcbufferGeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AintersectsTcbufferGeoLogicalFunction.cpp new file mode 100644 index 0000000000..1b400ef7f9 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AintersectsTcbufferGeoLogicalFunction.cpp @@ -0,0 +1,112 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AintersectsTcbufferGeoLogicalFunction::AintersectsTcbufferGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, + LogicalFunction radius, LogicalFunction ts, + LogicalFunction wkt) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(5); + parameters.push_back(std::move(lon)); + parameters.push_back(std::move(lat)); + parameters.push_back(std::move(radius)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(wkt)); +} + +DataType AintersectsTcbufferGeoLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AintersectsTcbufferGeoLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AintersectsTcbufferGeoLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AintersectsTcbufferGeoLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 5, + "AintersectsTcbufferGeoLogicalFunction requires 5 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AintersectsTcbufferGeoLogicalFunction::getType() const { return NAME; } + +bool AintersectsTcbufferGeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AintersectsTcbufferGeoLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction AintersectsTcbufferGeoLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(5); + c.emplace_back(parameters[0].withInferredDataType(schema)); + c.emplace_back(parameters[1].withInferredDataType(schema)); + c.emplace_back(parameters[2].withInferredDataType(schema)); + c.emplace_back(parameters[3].withInferredDataType(schema)); + c.emplace_back(parameters[4].withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon must be FLOAT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "radius must be FLOAT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::VARSIZED), "wkt must be VARCHAR"); + return withChildren(c); +} + +SerializableFunction AintersectsTcbufferGeoLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAintersectsTcbufferGeoLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 5, + "AintersectsTcbufferGeoLogicalFunction requires 5 children but got {}", + arguments.children.size()); + return AintersectsTcbufferGeoLogicalFunction(std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AtouchesTcbufferGeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AtouchesTcbufferGeoLogicalFunction.cpp new file mode 100644 index 0000000000..c1560798e5 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AtouchesTcbufferGeoLogicalFunction.cpp @@ -0,0 +1,112 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AtouchesTcbufferGeoLogicalFunction::AtouchesTcbufferGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, + LogicalFunction radius, LogicalFunction ts, + LogicalFunction wkt) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(5); + parameters.push_back(std::move(lon)); + parameters.push_back(std::move(lat)); + parameters.push_back(std::move(radius)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(wkt)); +} + +DataType AtouchesTcbufferGeoLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AtouchesTcbufferGeoLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AtouchesTcbufferGeoLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AtouchesTcbufferGeoLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 5, + "AtouchesTcbufferGeoLogicalFunction requires 5 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AtouchesTcbufferGeoLogicalFunction::getType() const { return NAME; } + +bool AtouchesTcbufferGeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AtouchesTcbufferGeoLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction AtouchesTcbufferGeoLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(5); + c.emplace_back(parameters[0].withInferredDataType(schema)); + c.emplace_back(parameters[1].withInferredDataType(schema)); + c.emplace_back(parameters[2].withInferredDataType(schema)); + c.emplace_back(parameters[3].withInferredDataType(schema)); + c.emplace_back(parameters[4].withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon must be FLOAT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "radius must be FLOAT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::VARSIZED), "wkt must be VARCHAR"); + return withChildren(c); +} + +SerializableFunction AtouchesTcbufferGeoLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAtouchesTcbufferGeoLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 5, + "AtouchesTcbufferGeoLogicalFunction requires 5 children but got {}", + arguments.children.size()); + return AtouchesTcbufferGeoLogicalFunction(std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt index 567fdce526..ea572c1fcd 100644 --- a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt @@ -337,6 +337,17 @@ add_plugin(Th3indexCellToCenterChild LogicalFunction nes-logical-operators Th3in add_plugin(Th3indexCellToChildPos LogicalFunction nes-logical-operators Th3indexCellToChildPosLogicalFunction.cpp) add_plugin(Th3indexAreNeighborCells LogicalFunction nes-logical-operators Th3indexAreNeighborCellsLogicalFunction.cpp) add_plugin(Th3indexGridDistance LogicalFunction nes-logical-operators Th3indexGridDistanceLogicalFunction.cpp) +add_plugin(EintersectsTcbufferGeo LogicalFunction nes-logical-operators EintersectsTcbufferGeoLogicalFunction.cpp) +add_plugin(AintersectsTcbufferGeo LogicalFunction nes-logical-operators AintersectsTcbufferGeoLogicalFunction.cpp) +add_plugin(EcoversTcbufferGeo LogicalFunction nes-logical-operators EcoversTcbufferGeoLogicalFunction.cpp) +add_plugin(AcoversTcbufferGeo LogicalFunction nes-logical-operators AcoversTcbufferGeoLogicalFunction.cpp) +add_plugin(EdisjointTcbufferGeo LogicalFunction nes-logical-operators EdisjointTcbufferGeoLogicalFunction.cpp) +add_plugin(AdisjointTcbufferGeo LogicalFunction nes-logical-operators AdisjointTcbufferGeoLogicalFunction.cpp) +add_plugin(EtouchesTcbufferGeo LogicalFunction nes-logical-operators EtouchesTcbufferGeoLogicalFunction.cpp) +add_plugin(AtouchesTcbufferGeo LogicalFunction nes-logical-operators AtouchesTcbufferGeoLogicalFunction.cpp) +add_plugin(EcontainsTcbufferGeo LogicalFunction nes-logical-operators EcontainsTcbufferGeoLogicalFunction.cpp) +add_plugin(AcontainsTcbufferGeo LogicalFunction nes-logical-operators AcontainsTcbufferGeoLogicalFunction.cpp) +add_plugin(NadTcbufferGeo LogicalFunction nes-logical-operators NadTcbufferGeoLogicalFunction.cpp) add_plugin(GeomIntersects2d LogicalFunction nes-logical-operators GeomIntersects2dLogicalFunction.cpp) add_plugin(GeomDwithin2d LogicalFunction nes-logical-operators GeomDwithin2dLogicalFunction.cpp) add_plugin(GeomContains LogicalFunction nes-logical-operators GeomContainsLogicalFunction.cpp) diff --git a/nes-logical-operators/src/Functions/Meos/EcontainsTcbufferGeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EcontainsTcbufferGeoLogicalFunction.cpp new file mode 100644 index 0000000000..a983252b2d --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EcontainsTcbufferGeoLogicalFunction.cpp @@ -0,0 +1,112 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EcontainsTcbufferGeoLogicalFunction::EcontainsTcbufferGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, + LogicalFunction radius, LogicalFunction ts, + LogicalFunction wkt) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(5); + parameters.push_back(std::move(lon)); + parameters.push_back(std::move(lat)); + parameters.push_back(std::move(radius)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(wkt)); +} + +DataType EcontainsTcbufferGeoLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EcontainsTcbufferGeoLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EcontainsTcbufferGeoLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EcontainsTcbufferGeoLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 5, + "EcontainsTcbufferGeoLogicalFunction requires 5 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EcontainsTcbufferGeoLogicalFunction::getType() const { return NAME; } + +bool EcontainsTcbufferGeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EcontainsTcbufferGeoLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction EcontainsTcbufferGeoLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(5); + c.emplace_back(parameters[0].withInferredDataType(schema)); + c.emplace_back(parameters[1].withInferredDataType(schema)); + c.emplace_back(parameters[2].withInferredDataType(schema)); + c.emplace_back(parameters[3].withInferredDataType(schema)); + c.emplace_back(parameters[4].withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon must be FLOAT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "radius must be FLOAT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::VARSIZED), "wkt must be VARCHAR"); + return withChildren(c); +} + +SerializableFunction EcontainsTcbufferGeoLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEcontainsTcbufferGeoLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 5, + "EcontainsTcbufferGeoLogicalFunction requires 5 children but got {}", + arguments.children.size()); + return EcontainsTcbufferGeoLogicalFunction(std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EcoversTcbufferGeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EcoversTcbufferGeoLogicalFunction.cpp new file mode 100644 index 0000000000..cb46626800 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EcoversTcbufferGeoLogicalFunction.cpp @@ -0,0 +1,112 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EcoversTcbufferGeoLogicalFunction::EcoversTcbufferGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, + LogicalFunction radius, LogicalFunction ts, + LogicalFunction wkt) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(5); + parameters.push_back(std::move(lon)); + parameters.push_back(std::move(lat)); + parameters.push_back(std::move(radius)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(wkt)); +} + +DataType EcoversTcbufferGeoLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EcoversTcbufferGeoLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EcoversTcbufferGeoLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EcoversTcbufferGeoLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 5, + "EcoversTcbufferGeoLogicalFunction requires 5 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EcoversTcbufferGeoLogicalFunction::getType() const { return NAME; } + +bool EcoversTcbufferGeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EcoversTcbufferGeoLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction EcoversTcbufferGeoLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(5); + c.emplace_back(parameters[0].withInferredDataType(schema)); + c.emplace_back(parameters[1].withInferredDataType(schema)); + c.emplace_back(parameters[2].withInferredDataType(schema)); + c.emplace_back(parameters[3].withInferredDataType(schema)); + c.emplace_back(parameters[4].withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon must be FLOAT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "radius must be FLOAT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::VARSIZED), "wkt must be VARCHAR"); + return withChildren(c); +} + +SerializableFunction EcoversTcbufferGeoLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEcoversTcbufferGeoLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 5, + "EcoversTcbufferGeoLogicalFunction requires 5 children but got {}", + arguments.children.size()); + return EcoversTcbufferGeoLogicalFunction(std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EdisjointTcbufferGeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EdisjointTcbufferGeoLogicalFunction.cpp new file mode 100644 index 0000000000..ea79c9acda --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EdisjointTcbufferGeoLogicalFunction.cpp @@ -0,0 +1,112 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EdisjointTcbufferGeoLogicalFunction::EdisjointTcbufferGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, + LogicalFunction radius, LogicalFunction ts, + LogicalFunction wkt) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(5); + parameters.push_back(std::move(lon)); + parameters.push_back(std::move(lat)); + parameters.push_back(std::move(radius)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(wkt)); +} + +DataType EdisjointTcbufferGeoLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EdisjointTcbufferGeoLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EdisjointTcbufferGeoLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EdisjointTcbufferGeoLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 5, + "EdisjointTcbufferGeoLogicalFunction requires 5 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EdisjointTcbufferGeoLogicalFunction::getType() const { return NAME; } + +bool EdisjointTcbufferGeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EdisjointTcbufferGeoLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction EdisjointTcbufferGeoLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(5); + c.emplace_back(parameters[0].withInferredDataType(schema)); + c.emplace_back(parameters[1].withInferredDataType(schema)); + c.emplace_back(parameters[2].withInferredDataType(schema)); + c.emplace_back(parameters[3].withInferredDataType(schema)); + c.emplace_back(parameters[4].withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon must be FLOAT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "radius must be FLOAT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::VARSIZED), "wkt must be VARCHAR"); + return withChildren(c); +} + +SerializableFunction EdisjointTcbufferGeoLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEdisjointTcbufferGeoLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 5, + "EdisjointTcbufferGeoLogicalFunction requires 5 children but got {}", + arguments.children.size()); + return EdisjointTcbufferGeoLogicalFunction(std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EintersectsTcbufferGeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EintersectsTcbufferGeoLogicalFunction.cpp new file mode 100644 index 0000000000..acb21c03d5 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EintersectsTcbufferGeoLogicalFunction.cpp @@ -0,0 +1,112 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EintersectsTcbufferGeoLogicalFunction::EintersectsTcbufferGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, + LogicalFunction radius, LogicalFunction ts, + LogicalFunction wkt) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(5); + parameters.push_back(std::move(lon)); + parameters.push_back(std::move(lat)); + parameters.push_back(std::move(radius)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(wkt)); +} + +DataType EintersectsTcbufferGeoLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EintersectsTcbufferGeoLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EintersectsTcbufferGeoLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EintersectsTcbufferGeoLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 5, + "EintersectsTcbufferGeoLogicalFunction requires 5 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EintersectsTcbufferGeoLogicalFunction::getType() const { return NAME; } + +bool EintersectsTcbufferGeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EintersectsTcbufferGeoLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction EintersectsTcbufferGeoLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(5); + c.emplace_back(parameters[0].withInferredDataType(schema)); + c.emplace_back(parameters[1].withInferredDataType(schema)); + c.emplace_back(parameters[2].withInferredDataType(schema)); + c.emplace_back(parameters[3].withInferredDataType(schema)); + c.emplace_back(parameters[4].withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon must be FLOAT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "radius must be FLOAT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::VARSIZED), "wkt must be VARCHAR"); + return withChildren(c); +} + +SerializableFunction EintersectsTcbufferGeoLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEintersectsTcbufferGeoLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 5, + "EintersectsTcbufferGeoLogicalFunction requires 5 children but got {}", + arguments.children.size()); + return EintersectsTcbufferGeoLogicalFunction(std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EtouchesTcbufferGeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EtouchesTcbufferGeoLogicalFunction.cpp new file mode 100644 index 0000000000..9342dd741c --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EtouchesTcbufferGeoLogicalFunction.cpp @@ -0,0 +1,112 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EtouchesTcbufferGeoLogicalFunction::EtouchesTcbufferGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, + LogicalFunction radius, LogicalFunction ts, + LogicalFunction wkt) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(5); + parameters.push_back(std::move(lon)); + parameters.push_back(std::move(lat)); + parameters.push_back(std::move(radius)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(wkt)); +} + +DataType EtouchesTcbufferGeoLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EtouchesTcbufferGeoLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EtouchesTcbufferGeoLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EtouchesTcbufferGeoLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 5, + "EtouchesTcbufferGeoLogicalFunction requires 5 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EtouchesTcbufferGeoLogicalFunction::getType() const { return NAME; } + +bool EtouchesTcbufferGeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EtouchesTcbufferGeoLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction EtouchesTcbufferGeoLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(5); + c.emplace_back(parameters[0].withInferredDataType(schema)); + c.emplace_back(parameters[1].withInferredDataType(schema)); + c.emplace_back(parameters[2].withInferredDataType(schema)); + c.emplace_back(parameters[3].withInferredDataType(schema)); + c.emplace_back(parameters[4].withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon must be FLOAT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "radius must be FLOAT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::VARSIZED), "wkt must be VARCHAR"); + return withChildren(c); +} + +SerializableFunction EtouchesTcbufferGeoLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEtouchesTcbufferGeoLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 5, + "EtouchesTcbufferGeoLogicalFunction requires 5 children but got {}", + arguments.children.size()); + return EtouchesTcbufferGeoLogicalFunction(std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/NadTcbufferGeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/NadTcbufferGeoLogicalFunction.cpp new file mode 100644 index 0000000000..678ff7cebb --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/NadTcbufferGeoLogicalFunction.cpp @@ -0,0 +1,112 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +NadTcbufferGeoLogicalFunction::NadTcbufferGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, + LogicalFunction radius, LogicalFunction ts, + LogicalFunction wkt) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(5); + parameters.push_back(std::move(lon)); + parameters.push_back(std::move(lat)); + parameters.push_back(std::move(radius)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(wkt)); +} + +DataType NadTcbufferGeoLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction NadTcbufferGeoLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector NadTcbufferGeoLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction NadTcbufferGeoLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 5, + "NadTcbufferGeoLogicalFunction requires 5 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view NadTcbufferGeoLogicalFunction::getType() const { return NAME; } + +bool NadTcbufferGeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string NadTcbufferGeoLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction NadTcbufferGeoLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(5); + c.emplace_back(parameters[0].withInferredDataType(schema)); + c.emplace_back(parameters[1].withInferredDataType(schema)); + c.emplace_back(parameters[2].withInferredDataType(schema)); + c.emplace_back(parameters[3].withInferredDataType(schema)); + c.emplace_back(parameters[4].withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon must be FLOAT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "radius must be FLOAT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::VARSIZED), "wkt must be VARCHAR"); + return withChildren(c); +} + +SerializableFunction NadTcbufferGeoLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterNadTcbufferGeoLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 5, + "NadTcbufferGeoLogicalFunction requires 5 children but got {}", + arguments.children.size()); + return NadTcbufferGeoLogicalFunction(std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4])); +} + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AcontainsTcbufferGeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AcontainsTcbufferGeoPhysicalFunction.hpp new file mode 100644 index 0000000000..5f13a86276 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AcontainsTcbufferGeoPhysicalFunction.hpp @@ -0,0 +1,36 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class AcontainsTcbufferGeoPhysicalFunction : public PhysicalFunctionConcept { +public: + AcontainsTcbufferGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, + PhysicalFunction radius, PhysicalFunction ts, + PhysicalFunction wkt); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AcoversTcbufferGeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AcoversTcbufferGeoPhysicalFunction.hpp new file mode 100644 index 0000000000..e4d4381bbe --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AcoversTcbufferGeoPhysicalFunction.hpp @@ -0,0 +1,36 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class AcoversTcbufferGeoPhysicalFunction : public PhysicalFunctionConcept { +public: + AcoversTcbufferGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, + PhysicalFunction radius, PhysicalFunction ts, + PhysicalFunction wkt); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AdisjointTcbufferGeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AdisjointTcbufferGeoPhysicalFunction.hpp new file mode 100644 index 0000000000..dd573a50a1 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AdisjointTcbufferGeoPhysicalFunction.hpp @@ -0,0 +1,36 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class AdisjointTcbufferGeoPhysicalFunction : public PhysicalFunctionConcept { +public: + AdisjointTcbufferGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, + PhysicalFunction radius, PhysicalFunction ts, + PhysicalFunction wkt); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AintersectsTcbufferGeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AintersectsTcbufferGeoPhysicalFunction.hpp new file mode 100644 index 0000000000..d6114f4a3c --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AintersectsTcbufferGeoPhysicalFunction.hpp @@ -0,0 +1,36 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class AintersectsTcbufferGeoPhysicalFunction : public PhysicalFunctionConcept { +public: + AintersectsTcbufferGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, + PhysicalFunction radius, PhysicalFunction ts, + PhysicalFunction wkt); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AtouchesTcbufferGeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AtouchesTcbufferGeoPhysicalFunction.hpp new file mode 100644 index 0000000000..174402845a --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AtouchesTcbufferGeoPhysicalFunction.hpp @@ -0,0 +1,36 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class AtouchesTcbufferGeoPhysicalFunction : public PhysicalFunctionConcept { +public: + AtouchesTcbufferGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, + PhysicalFunction radius, PhysicalFunction ts, + PhysicalFunction wkt); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EcontainsTcbufferGeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EcontainsTcbufferGeoPhysicalFunction.hpp new file mode 100644 index 0000000000..8eaa930500 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EcontainsTcbufferGeoPhysicalFunction.hpp @@ -0,0 +1,36 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class EcontainsTcbufferGeoPhysicalFunction : public PhysicalFunctionConcept { +public: + EcontainsTcbufferGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, + PhysicalFunction radius, PhysicalFunction ts, + PhysicalFunction wkt); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EcoversTcbufferGeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EcoversTcbufferGeoPhysicalFunction.hpp new file mode 100644 index 0000000000..2c5c6953a3 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EcoversTcbufferGeoPhysicalFunction.hpp @@ -0,0 +1,36 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class EcoversTcbufferGeoPhysicalFunction : public PhysicalFunctionConcept { +public: + EcoversTcbufferGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, + PhysicalFunction radius, PhysicalFunction ts, + PhysicalFunction wkt); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EdisjointTcbufferGeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EdisjointTcbufferGeoPhysicalFunction.hpp new file mode 100644 index 0000000000..140e6a0e98 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EdisjointTcbufferGeoPhysicalFunction.hpp @@ -0,0 +1,36 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class EdisjointTcbufferGeoPhysicalFunction : public PhysicalFunctionConcept { +public: + EdisjointTcbufferGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, + PhysicalFunction radius, PhysicalFunction ts, + PhysicalFunction wkt); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EintersectsTcbufferGeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EintersectsTcbufferGeoPhysicalFunction.hpp new file mode 100644 index 0000000000..47bdf4ea97 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EintersectsTcbufferGeoPhysicalFunction.hpp @@ -0,0 +1,36 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class EintersectsTcbufferGeoPhysicalFunction : public PhysicalFunctionConcept { +public: + EintersectsTcbufferGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, + PhysicalFunction radius, PhysicalFunction ts, + PhysicalFunction wkt); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EtouchesTcbufferGeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EtouchesTcbufferGeoPhysicalFunction.hpp new file mode 100644 index 0000000000..a3dede45c9 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EtouchesTcbufferGeoPhysicalFunction.hpp @@ -0,0 +1,36 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class EtouchesTcbufferGeoPhysicalFunction : public PhysicalFunctionConcept { +public: + EtouchesTcbufferGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, + PhysicalFunction radius, PhysicalFunction ts, + PhysicalFunction wkt); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/NadTcbufferGeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/NadTcbufferGeoPhysicalFunction.hpp new file mode 100644 index 0000000000..acb4d8ab50 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/NadTcbufferGeoPhysicalFunction.hpp @@ -0,0 +1,36 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class NadTcbufferGeoPhysicalFunction : public PhysicalFunctionConcept { +public: + NadTcbufferGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, + PhysicalFunction radius, PhysicalFunction ts, + PhysicalFunction wkt); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AcontainsTcbufferGeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AcontainsTcbufferGeoPhysicalFunction.cpp new file mode 100644 index 0000000000..1df12b657a --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AcontainsTcbufferGeoPhysicalFunction.cpp @@ -0,0 +1,104 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +AcontainsTcbufferGeoPhysicalFunction::AcontainsTcbufferGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, + PhysicalFunction radius, PhysicalFunction ts, + PhysicalFunction wkt) +{ + paramFns.reserve(5); + paramFns.push_back(std::move(lon)); + paramFns.push_back(std::move(lat)); + paramFns.push_back(std::move(radius)); + paramFns.push_back(std::move(ts)); + paramFns.push_back(std::move(wkt)); +} + +VarVal AcontainsTcbufferGeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto lon = paramFns[0].execute(record, arena).cast(); + auto lat = paramFns[1].execute(record, arena).cast(); + auto radius = paramFns[2].execute(record, arena).cast(); + auto ts = paramFns[3].execute(record, arena).cast(); + auto wkt = paramFns[4].execute(record, arena); + + const auto result = nautilus::invoke( + +[](double lon, double lat, double radius, uint64_t ts, + const char* wkt, uint32_t wkt_len) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + // Build tcbuffer instant: point + radius → cbuffer → instant + std::string pt_str = fmt::format("POINT({} {})", lon, lat); + GSERIALIZED* pt_gs = geom_in(pt_str.c_str(), -1); + if (!pt_gs) return 0.0; + Cbuffer* cb = cbuffer_make(pt_gs, radius); + free(pt_gs); + if (!cb) return 0.0; + Temporal* tcb_inst = (Temporal*)tcbufferinst_make(cb, (TimestampTz)ts); + free(cb); + if (!tcb_inst) return 0.0; + // Build target geometry from null-terminated WKT copy + char* wkt_str = (char*)malloc(wkt_len + 1); + memcpy(wkt_str, wkt, wkt_len); + wkt_str[wkt_len] = '\0'; + GSERIALIZED* target_gs = geom_in(wkt_str, -1); + free(wkt_str); + if (!target_gs) { free(tcb_inst); return 0.0; } + int r = acontains_tcbuffer_geo(tcb_inst, target_gs); + free(tcb_inst); + free(target_gs); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + lon, lat, radius, ts, wkt); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAcontainsTcbufferGeoPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 5, + "AcontainsTcbufferGeoPhysicalFunction requires 5 children but got {}", + arguments.childFunctions.size()); + return AcontainsTcbufferGeoPhysicalFunction(std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AcoversTcbufferGeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AcoversTcbufferGeoPhysicalFunction.cpp new file mode 100644 index 0000000000..5296b89f95 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AcoversTcbufferGeoPhysicalFunction.cpp @@ -0,0 +1,104 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +AcoversTcbufferGeoPhysicalFunction::AcoversTcbufferGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, + PhysicalFunction radius, PhysicalFunction ts, + PhysicalFunction wkt) +{ + paramFns.reserve(5); + paramFns.push_back(std::move(lon)); + paramFns.push_back(std::move(lat)); + paramFns.push_back(std::move(radius)); + paramFns.push_back(std::move(ts)); + paramFns.push_back(std::move(wkt)); +} + +VarVal AcoversTcbufferGeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto lon = paramFns[0].execute(record, arena).cast(); + auto lat = paramFns[1].execute(record, arena).cast(); + auto radius = paramFns[2].execute(record, arena).cast(); + auto ts = paramFns[3].execute(record, arena).cast(); + auto wkt = paramFns[4].execute(record, arena); + + const auto result = nautilus::invoke( + +[](double lon, double lat, double radius, uint64_t ts, + const char* wkt, uint32_t wkt_len) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + // Build tcbuffer instant: point + radius → cbuffer → instant + std::string pt_str = fmt::format("POINT({} {})", lon, lat); + GSERIALIZED* pt_gs = geom_in(pt_str.c_str(), -1); + if (!pt_gs) return 0.0; + Cbuffer* cb = cbuffer_make(pt_gs, radius); + free(pt_gs); + if (!cb) return 0.0; + Temporal* tcb_inst = (Temporal*)tcbufferinst_make(cb, (TimestampTz)ts); + free(cb); + if (!tcb_inst) return 0.0; + // Build target geometry from null-terminated WKT copy + char* wkt_str = (char*)malloc(wkt_len + 1); + memcpy(wkt_str, wkt, wkt_len); + wkt_str[wkt_len] = '\0'; + GSERIALIZED* target_gs = geom_in(wkt_str, -1); + free(wkt_str); + if (!target_gs) { free(tcb_inst); return 0.0; } + int r = acovers_tcbuffer_geo(tcb_inst, target_gs); + free(tcb_inst); + free(target_gs); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + lon, lat, radius, ts, wkt); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAcoversTcbufferGeoPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 5, + "AcoversTcbufferGeoPhysicalFunction requires 5 children but got {}", + arguments.childFunctions.size()); + return AcoversTcbufferGeoPhysicalFunction(std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AdisjointTcbufferGeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AdisjointTcbufferGeoPhysicalFunction.cpp new file mode 100644 index 0000000000..4657c698eb --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AdisjointTcbufferGeoPhysicalFunction.cpp @@ -0,0 +1,104 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +AdisjointTcbufferGeoPhysicalFunction::AdisjointTcbufferGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, + PhysicalFunction radius, PhysicalFunction ts, + PhysicalFunction wkt) +{ + paramFns.reserve(5); + paramFns.push_back(std::move(lon)); + paramFns.push_back(std::move(lat)); + paramFns.push_back(std::move(radius)); + paramFns.push_back(std::move(ts)); + paramFns.push_back(std::move(wkt)); +} + +VarVal AdisjointTcbufferGeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto lon = paramFns[0].execute(record, arena).cast(); + auto lat = paramFns[1].execute(record, arena).cast(); + auto radius = paramFns[2].execute(record, arena).cast(); + auto ts = paramFns[3].execute(record, arena).cast(); + auto wkt = paramFns[4].execute(record, arena); + + const auto result = nautilus::invoke( + +[](double lon, double lat, double radius, uint64_t ts, + const char* wkt, uint32_t wkt_len) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + // Build tcbuffer instant: point + radius → cbuffer → instant + std::string pt_str = fmt::format("POINT({} {})", lon, lat); + GSERIALIZED* pt_gs = geom_in(pt_str.c_str(), -1); + if (!pt_gs) return 0.0; + Cbuffer* cb = cbuffer_make(pt_gs, radius); + free(pt_gs); + if (!cb) return 0.0; + Temporal* tcb_inst = (Temporal*)tcbufferinst_make(cb, (TimestampTz)ts); + free(cb); + if (!tcb_inst) return 0.0; + // Build target geometry from null-terminated WKT copy + char* wkt_str = (char*)malloc(wkt_len + 1); + memcpy(wkt_str, wkt, wkt_len); + wkt_str[wkt_len] = '\0'; + GSERIALIZED* target_gs = geom_in(wkt_str, -1); + free(wkt_str); + if (!target_gs) { free(tcb_inst); return 0.0; } + int r = adisjoint_tcbuffer_geo(tcb_inst, target_gs); + free(tcb_inst); + free(target_gs); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + lon, lat, radius, ts, wkt); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAdisjointTcbufferGeoPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 5, + "AdisjointTcbufferGeoPhysicalFunction requires 5 children but got {}", + arguments.childFunctions.size()); + return AdisjointTcbufferGeoPhysicalFunction(std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AintersectsTcbufferGeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AintersectsTcbufferGeoPhysicalFunction.cpp new file mode 100644 index 0000000000..29ddcc1a02 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AintersectsTcbufferGeoPhysicalFunction.cpp @@ -0,0 +1,104 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +AintersectsTcbufferGeoPhysicalFunction::AintersectsTcbufferGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, + PhysicalFunction radius, PhysicalFunction ts, + PhysicalFunction wkt) +{ + paramFns.reserve(5); + paramFns.push_back(std::move(lon)); + paramFns.push_back(std::move(lat)); + paramFns.push_back(std::move(radius)); + paramFns.push_back(std::move(ts)); + paramFns.push_back(std::move(wkt)); +} + +VarVal AintersectsTcbufferGeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto lon = paramFns[0].execute(record, arena).cast(); + auto lat = paramFns[1].execute(record, arena).cast(); + auto radius = paramFns[2].execute(record, arena).cast(); + auto ts = paramFns[3].execute(record, arena).cast(); + auto wkt = paramFns[4].execute(record, arena); + + const auto result = nautilus::invoke( + +[](double lon, double lat, double radius, uint64_t ts, + const char* wkt, uint32_t wkt_len) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + // Build tcbuffer instant: point + radius → cbuffer → instant + std::string pt_str = fmt::format("POINT({} {})", lon, lat); + GSERIALIZED* pt_gs = geom_in(pt_str.c_str(), -1); + if (!pt_gs) return 0.0; + Cbuffer* cb = cbuffer_make(pt_gs, radius); + free(pt_gs); + if (!cb) return 0.0; + Temporal* tcb_inst = (Temporal*)tcbufferinst_make(cb, (TimestampTz)ts); + free(cb); + if (!tcb_inst) return 0.0; + // Build target geometry from null-terminated WKT copy + char* wkt_str = (char*)malloc(wkt_len + 1); + memcpy(wkt_str, wkt, wkt_len); + wkt_str[wkt_len] = '\0'; + GSERIALIZED* target_gs = geom_in(wkt_str, -1); + free(wkt_str); + if (!target_gs) { free(tcb_inst); return 0.0; } + int r = aintersects_tcbuffer_geo(tcb_inst, target_gs); + free(tcb_inst); + free(target_gs); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + lon, lat, radius, ts, wkt); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAintersectsTcbufferGeoPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 5, + "AintersectsTcbufferGeoPhysicalFunction requires 5 children but got {}", + arguments.childFunctions.size()); + return AintersectsTcbufferGeoPhysicalFunction(std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AtouchesTcbufferGeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AtouchesTcbufferGeoPhysicalFunction.cpp new file mode 100644 index 0000000000..cc651d7b83 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AtouchesTcbufferGeoPhysicalFunction.cpp @@ -0,0 +1,104 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +AtouchesTcbufferGeoPhysicalFunction::AtouchesTcbufferGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, + PhysicalFunction radius, PhysicalFunction ts, + PhysicalFunction wkt) +{ + paramFns.reserve(5); + paramFns.push_back(std::move(lon)); + paramFns.push_back(std::move(lat)); + paramFns.push_back(std::move(radius)); + paramFns.push_back(std::move(ts)); + paramFns.push_back(std::move(wkt)); +} + +VarVal AtouchesTcbufferGeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto lon = paramFns[0].execute(record, arena).cast(); + auto lat = paramFns[1].execute(record, arena).cast(); + auto radius = paramFns[2].execute(record, arena).cast(); + auto ts = paramFns[3].execute(record, arena).cast(); + auto wkt = paramFns[4].execute(record, arena); + + const auto result = nautilus::invoke( + +[](double lon, double lat, double radius, uint64_t ts, + const char* wkt, uint32_t wkt_len) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + // Build tcbuffer instant: point + radius → cbuffer → instant + std::string pt_str = fmt::format("POINT({} {})", lon, lat); + GSERIALIZED* pt_gs = geom_in(pt_str.c_str(), -1); + if (!pt_gs) return 0.0; + Cbuffer* cb = cbuffer_make(pt_gs, radius); + free(pt_gs); + if (!cb) return 0.0; + Temporal* tcb_inst = (Temporal*)tcbufferinst_make(cb, (TimestampTz)ts); + free(cb); + if (!tcb_inst) return 0.0; + // Build target geometry from null-terminated WKT copy + char* wkt_str = (char*)malloc(wkt_len + 1); + memcpy(wkt_str, wkt, wkt_len); + wkt_str[wkt_len] = '\0'; + GSERIALIZED* target_gs = geom_in(wkt_str, -1); + free(wkt_str); + if (!target_gs) { free(tcb_inst); return 0.0; } + int r = atouches_tcbuffer_geo(tcb_inst, target_gs); + free(tcb_inst); + free(target_gs); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + lon, lat, radius, ts, wkt); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAtouchesTcbufferGeoPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 5, + "AtouchesTcbufferGeoPhysicalFunction requires 5 children but got {}", + arguments.childFunctions.size()); + return AtouchesTcbufferGeoPhysicalFunction(std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt index 1b3ab90e67..c5292978c0 100644 --- a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt @@ -336,6 +336,17 @@ add_plugin(Th3indexCellToCenterChild PhysicalFunction nes-physical-operators Th3 add_plugin(Th3indexCellToChildPos PhysicalFunction nes-physical-operators Th3indexCellToChildPosPhysicalFunction.cpp) add_plugin(Th3indexAreNeighborCells PhysicalFunction nes-physical-operators Th3indexAreNeighborCellsPhysicalFunction.cpp) add_plugin(Th3indexGridDistance PhysicalFunction nes-physical-operators Th3indexGridDistancePhysicalFunction.cpp) +add_plugin(EintersectsTcbufferGeo PhysicalFunction nes-physical-operators EintersectsTcbufferGeoPhysicalFunction.cpp) +add_plugin(AintersectsTcbufferGeo PhysicalFunction nes-physical-operators AintersectsTcbufferGeoPhysicalFunction.cpp) +add_plugin(EcoversTcbufferGeo PhysicalFunction nes-physical-operators EcoversTcbufferGeoPhysicalFunction.cpp) +add_plugin(AcoversTcbufferGeo PhysicalFunction nes-physical-operators AcoversTcbufferGeoPhysicalFunction.cpp) +add_plugin(EdisjointTcbufferGeo PhysicalFunction nes-physical-operators EdisjointTcbufferGeoPhysicalFunction.cpp) +add_plugin(AdisjointTcbufferGeo PhysicalFunction nes-physical-operators AdisjointTcbufferGeoPhysicalFunction.cpp) +add_plugin(EtouchesTcbufferGeo PhysicalFunction nes-physical-operators EtouchesTcbufferGeoPhysicalFunction.cpp) +add_plugin(AtouchesTcbufferGeo PhysicalFunction nes-physical-operators AtouchesTcbufferGeoPhysicalFunction.cpp) +add_plugin(EcontainsTcbufferGeo PhysicalFunction nes-physical-operators EcontainsTcbufferGeoPhysicalFunction.cpp) +add_plugin(AcontainsTcbufferGeo PhysicalFunction nes-physical-operators AcontainsTcbufferGeoPhysicalFunction.cpp) +add_plugin(NadTcbufferGeo PhysicalFunction nes-physical-operators NadTcbufferGeoPhysicalFunction.cpp) add_plugin(GeomIntersects2d PhysicalFunction nes-physical-operators GeomIntersects2dPhysicalFunction.cpp) add_plugin(GeomDwithin2d PhysicalFunction nes-physical-operators GeomDwithin2dPhysicalFunction.cpp) add_plugin(GeomContains PhysicalFunction nes-physical-operators GeomContainsPhysicalFunction.cpp) diff --git a/nes-physical-operators/src/Functions/Meos/EcontainsTcbufferGeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EcontainsTcbufferGeoPhysicalFunction.cpp new file mode 100644 index 0000000000..18addc2839 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EcontainsTcbufferGeoPhysicalFunction.cpp @@ -0,0 +1,104 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +EcontainsTcbufferGeoPhysicalFunction::EcontainsTcbufferGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, + PhysicalFunction radius, PhysicalFunction ts, + PhysicalFunction wkt) +{ + paramFns.reserve(5); + paramFns.push_back(std::move(lon)); + paramFns.push_back(std::move(lat)); + paramFns.push_back(std::move(radius)); + paramFns.push_back(std::move(ts)); + paramFns.push_back(std::move(wkt)); +} + +VarVal EcontainsTcbufferGeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto lon = paramFns[0].execute(record, arena).cast(); + auto lat = paramFns[1].execute(record, arena).cast(); + auto radius = paramFns[2].execute(record, arena).cast(); + auto ts = paramFns[3].execute(record, arena).cast(); + auto wkt = paramFns[4].execute(record, arena); + + const auto result = nautilus::invoke( + +[](double lon, double lat, double radius, uint64_t ts, + const char* wkt, uint32_t wkt_len) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + // Build tcbuffer instant: point + radius → cbuffer → instant + std::string pt_str = fmt::format("POINT({} {})", lon, lat); + GSERIALIZED* pt_gs = geom_in(pt_str.c_str(), -1); + if (!pt_gs) return 0.0; + Cbuffer* cb = cbuffer_make(pt_gs, radius); + free(pt_gs); + if (!cb) return 0.0; + Temporal* tcb_inst = (Temporal*)tcbufferinst_make(cb, (TimestampTz)ts); + free(cb); + if (!tcb_inst) return 0.0; + // Build target geometry from null-terminated WKT copy + char* wkt_str = (char*)malloc(wkt_len + 1); + memcpy(wkt_str, wkt, wkt_len); + wkt_str[wkt_len] = '\0'; + GSERIALIZED* target_gs = geom_in(wkt_str, -1); + free(wkt_str); + if (!target_gs) { free(tcb_inst); return 0.0; } + int r = econtains_tcbuffer_geo(tcb_inst, target_gs); + free(tcb_inst); + free(target_gs); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + lon, lat, radius, ts, wkt); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEcontainsTcbufferGeoPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 5, + "EcontainsTcbufferGeoPhysicalFunction requires 5 children but got {}", + arguments.childFunctions.size()); + return EcontainsTcbufferGeoPhysicalFunction(std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EcoversTcbufferGeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EcoversTcbufferGeoPhysicalFunction.cpp new file mode 100644 index 0000000000..ddea00a297 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EcoversTcbufferGeoPhysicalFunction.cpp @@ -0,0 +1,104 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +EcoversTcbufferGeoPhysicalFunction::EcoversTcbufferGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, + PhysicalFunction radius, PhysicalFunction ts, + PhysicalFunction wkt) +{ + paramFns.reserve(5); + paramFns.push_back(std::move(lon)); + paramFns.push_back(std::move(lat)); + paramFns.push_back(std::move(radius)); + paramFns.push_back(std::move(ts)); + paramFns.push_back(std::move(wkt)); +} + +VarVal EcoversTcbufferGeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto lon = paramFns[0].execute(record, arena).cast(); + auto lat = paramFns[1].execute(record, arena).cast(); + auto radius = paramFns[2].execute(record, arena).cast(); + auto ts = paramFns[3].execute(record, arena).cast(); + auto wkt = paramFns[4].execute(record, arena); + + const auto result = nautilus::invoke( + +[](double lon, double lat, double radius, uint64_t ts, + const char* wkt, uint32_t wkt_len) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + // Build tcbuffer instant: point + radius → cbuffer → instant + std::string pt_str = fmt::format("POINT({} {})", lon, lat); + GSERIALIZED* pt_gs = geom_in(pt_str.c_str(), -1); + if (!pt_gs) return 0.0; + Cbuffer* cb = cbuffer_make(pt_gs, radius); + free(pt_gs); + if (!cb) return 0.0; + Temporal* tcb_inst = (Temporal*)tcbufferinst_make(cb, (TimestampTz)ts); + free(cb); + if (!tcb_inst) return 0.0; + // Build target geometry from null-terminated WKT copy + char* wkt_str = (char*)malloc(wkt_len + 1); + memcpy(wkt_str, wkt, wkt_len); + wkt_str[wkt_len] = '\0'; + GSERIALIZED* target_gs = geom_in(wkt_str, -1); + free(wkt_str); + if (!target_gs) { free(tcb_inst); return 0.0; } + int r = ecovers_tcbuffer_geo(tcb_inst, target_gs); + free(tcb_inst); + free(target_gs); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + lon, lat, radius, ts, wkt); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEcoversTcbufferGeoPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 5, + "EcoversTcbufferGeoPhysicalFunction requires 5 children but got {}", + arguments.childFunctions.size()); + return EcoversTcbufferGeoPhysicalFunction(std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EdisjointTcbufferGeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EdisjointTcbufferGeoPhysicalFunction.cpp new file mode 100644 index 0000000000..ef4bf0993c --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EdisjointTcbufferGeoPhysicalFunction.cpp @@ -0,0 +1,104 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +EdisjointTcbufferGeoPhysicalFunction::EdisjointTcbufferGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, + PhysicalFunction radius, PhysicalFunction ts, + PhysicalFunction wkt) +{ + paramFns.reserve(5); + paramFns.push_back(std::move(lon)); + paramFns.push_back(std::move(lat)); + paramFns.push_back(std::move(radius)); + paramFns.push_back(std::move(ts)); + paramFns.push_back(std::move(wkt)); +} + +VarVal EdisjointTcbufferGeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto lon = paramFns[0].execute(record, arena).cast(); + auto lat = paramFns[1].execute(record, arena).cast(); + auto radius = paramFns[2].execute(record, arena).cast(); + auto ts = paramFns[3].execute(record, arena).cast(); + auto wkt = paramFns[4].execute(record, arena); + + const auto result = nautilus::invoke( + +[](double lon, double lat, double radius, uint64_t ts, + const char* wkt, uint32_t wkt_len) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + // Build tcbuffer instant: point + radius → cbuffer → instant + std::string pt_str = fmt::format("POINT({} {})", lon, lat); + GSERIALIZED* pt_gs = geom_in(pt_str.c_str(), -1); + if (!pt_gs) return 0.0; + Cbuffer* cb = cbuffer_make(pt_gs, radius); + free(pt_gs); + if (!cb) return 0.0; + Temporal* tcb_inst = (Temporal*)tcbufferinst_make(cb, (TimestampTz)ts); + free(cb); + if (!tcb_inst) return 0.0; + // Build target geometry from null-terminated WKT copy + char* wkt_str = (char*)malloc(wkt_len + 1); + memcpy(wkt_str, wkt, wkt_len); + wkt_str[wkt_len] = '\0'; + GSERIALIZED* target_gs = geom_in(wkt_str, -1); + free(wkt_str); + if (!target_gs) { free(tcb_inst); return 0.0; } + int r = edisjoint_tcbuffer_geo(tcb_inst, target_gs); + free(tcb_inst); + free(target_gs); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + lon, lat, radius, ts, wkt); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEdisjointTcbufferGeoPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 5, + "EdisjointTcbufferGeoPhysicalFunction requires 5 children but got {}", + arguments.childFunctions.size()); + return EdisjointTcbufferGeoPhysicalFunction(std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EintersectsTcbufferGeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EintersectsTcbufferGeoPhysicalFunction.cpp new file mode 100644 index 0000000000..b2ffefe945 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EintersectsTcbufferGeoPhysicalFunction.cpp @@ -0,0 +1,104 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +EintersectsTcbufferGeoPhysicalFunction::EintersectsTcbufferGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, + PhysicalFunction radius, PhysicalFunction ts, + PhysicalFunction wkt) +{ + paramFns.reserve(5); + paramFns.push_back(std::move(lon)); + paramFns.push_back(std::move(lat)); + paramFns.push_back(std::move(radius)); + paramFns.push_back(std::move(ts)); + paramFns.push_back(std::move(wkt)); +} + +VarVal EintersectsTcbufferGeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto lon = paramFns[0].execute(record, arena).cast(); + auto lat = paramFns[1].execute(record, arena).cast(); + auto radius = paramFns[2].execute(record, arena).cast(); + auto ts = paramFns[3].execute(record, arena).cast(); + auto wkt = paramFns[4].execute(record, arena); + + const auto result = nautilus::invoke( + +[](double lon, double lat, double radius, uint64_t ts, + const char* wkt, uint32_t wkt_len) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + // Build tcbuffer instant: point + radius → cbuffer → instant + std::string pt_str = fmt::format("POINT({} {})", lon, lat); + GSERIALIZED* pt_gs = geom_in(pt_str.c_str(), -1); + if (!pt_gs) return 0.0; + Cbuffer* cb = cbuffer_make(pt_gs, radius); + free(pt_gs); + if (!cb) return 0.0; + Temporal* tcb_inst = (Temporal*)tcbufferinst_make(cb, (TimestampTz)ts); + free(cb); + if (!tcb_inst) return 0.0; + // Build target geometry from null-terminated WKT copy + char* wkt_str = (char*)malloc(wkt_len + 1); + memcpy(wkt_str, wkt, wkt_len); + wkt_str[wkt_len] = '\0'; + GSERIALIZED* target_gs = geom_in(wkt_str, -1); + free(wkt_str); + if (!target_gs) { free(tcb_inst); return 0.0; } + int r = eintersects_tcbuffer_geo(tcb_inst, target_gs); + free(tcb_inst); + free(target_gs); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + lon, lat, radius, ts, wkt); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEintersectsTcbufferGeoPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 5, + "EintersectsTcbufferGeoPhysicalFunction requires 5 children but got {}", + arguments.childFunctions.size()); + return EintersectsTcbufferGeoPhysicalFunction(std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EtouchesTcbufferGeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EtouchesTcbufferGeoPhysicalFunction.cpp new file mode 100644 index 0000000000..cb9ab44e8e --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EtouchesTcbufferGeoPhysicalFunction.cpp @@ -0,0 +1,104 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +EtouchesTcbufferGeoPhysicalFunction::EtouchesTcbufferGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, + PhysicalFunction radius, PhysicalFunction ts, + PhysicalFunction wkt) +{ + paramFns.reserve(5); + paramFns.push_back(std::move(lon)); + paramFns.push_back(std::move(lat)); + paramFns.push_back(std::move(radius)); + paramFns.push_back(std::move(ts)); + paramFns.push_back(std::move(wkt)); +} + +VarVal EtouchesTcbufferGeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto lon = paramFns[0].execute(record, arena).cast(); + auto lat = paramFns[1].execute(record, arena).cast(); + auto radius = paramFns[2].execute(record, arena).cast(); + auto ts = paramFns[3].execute(record, arena).cast(); + auto wkt = paramFns[4].execute(record, arena); + + const auto result = nautilus::invoke( + +[](double lon, double lat, double radius, uint64_t ts, + const char* wkt, uint32_t wkt_len) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + // Build tcbuffer instant: point + radius → cbuffer → instant + std::string pt_str = fmt::format("POINT({} {})", lon, lat); + GSERIALIZED* pt_gs = geom_in(pt_str.c_str(), -1); + if (!pt_gs) return 0.0; + Cbuffer* cb = cbuffer_make(pt_gs, radius); + free(pt_gs); + if (!cb) return 0.0; + Temporal* tcb_inst = (Temporal*)tcbufferinst_make(cb, (TimestampTz)ts); + free(cb); + if (!tcb_inst) return 0.0; + // Build target geometry from null-terminated WKT copy + char* wkt_str = (char*)malloc(wkt_len + 1); + memcpy(wkt_str, wkt, wkt_len); + wkt_str[wkt_len] = '\0'; + GSERIALIZED* target_gs = geom_in(wkt_str, -1); + free(wkt_str); + if (!target_gs) { free(tcb_inst); return 0.0; } + int r = etouches_tcbuffer_geo(tcb_inst, target_gs); + free(tcb_inst); + free(target_gs); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + lon, lat, radius, ts, wkt); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEtouchesTcbufferGeoPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 5, + "EtouchesTcbufferGeoPhysicalFunction requires 5 children but got {}", + arguments.childFunctions.size()); + return EtouchesTcbufferGeoPhysicalFunction(std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/NadTcbufferGeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/NadTcbufferGeoPhysicalFunction.cpp new file mode 100644 index 0000000000..9c53b9dd6e --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/NadTcbufferGeoPhysicalFunction.cpp @@ -0,0 +1,104 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +NadTcbufferGeoPhysicalFunction::NadTcbufferGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, + PhysicalFunction radius, PhysicalFunction ts, + PhysicalFunction wkt) +{ + paramFns.reserve(5); + paramFns.push_back(std::move(lon)); + paramFns.push_back(std::move(lat)); + paramFns.push_back(std::move(radius)); + paramFns.push_back(std::move(ts)); + paramFns.push_back(std::move(wkt)); +} + +VarVal NadTcbufferGeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto lon = paramFns[0].execute(record, arena).cast(); + auto lat = paramFns[1].execute(record, arena).cast(); + auto radius = paramFns[2].execute(record, arena).cast(); + auto ts = paramFns[3].execute(record, arena).cast(); + auto wkt = paramFns[4].execute(record, arena); + + const auto result = nautilus::invoke( + +[](double lon, double lat, double radius, uint64_t ts, + const char* wkt, uint32_t wkt_len) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + // Build tcbuffer instant: point + radius → cbuffer → instant + std::string pt_str = fmt::format("POINT({} {})", lon, lat); + GSERIALIZED* pt_gs = geom_in(pt_str.c_str(), -1); + if (!pt_gs) return 0.0; + Cbuffer* cb = cbuffer_make(pt_gs, radius); + free(pt_gs); + if (!cb) return 0.0; + Temporal* tcb_inst = (Temporal*)tcbufferinst_make(cb, (TimestampTz)ts); + free(cb); + if (!tcb_inst) return 0.0; + // Build target geometry from null-terminated WKT copy + char* wkt_str = (char*)malloc(wkt_len + 1); + memcpy(wkt_str, wkt, wkt_len); + wkt_str[wkt_len] = '\0'; + GSERIALIZED* target_gs = geom_in(wkt_str, -1); + free(wkt_str); + if (!target_gs) { free(tcb_inst); return 0.0; } + double r = nad_tcbuffer_geo(tcb_inst, target_gs); + free(tcb_inst); + free(target_gs); + return r; + } catch (const std::exception&) { return -1.0; } + }, + lon, lat, radius, ts, wkt); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterNadTcbufferGeoPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 5, + "NadTcbufferGeoPhysicalFunction requires 5 children but got {}", + arguments.childFunctions.size()); + return NadTcbufferGeoPhysicalFunction(std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4])); +} + +} // namespace NES diff --git a/nes-sql-parser/AntlrSQL.g4 b/nes-sql-parser/AntlrSQL.g4 index 5a6e7111ec..d7c1b2c2c8 100644 --- a/nes-sql-parser/AntlrSQL.g4 +++ b/nes-sql-parser/AntlrSQL.g4 @@ -295,7 +295,7 @@ timeUnit: MS timestampParameter: name=identifier; -functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT | TGE_TTEXT_TEXT | TGE_TEXT_TTEXT | TGT_TTEXT_TEXT | TGT_TEXT_TTEXT | TLE_TTEXT_TEXT | TLE_TEXT_TTEXT | TLT_TTEXT_TEXT | TLT_TEXT_TTEXT | TTEXT_UPPER | TTEXT_LOWER | TTEXT_INITCAP | TEXTCAT_TTEXT_TEXT | TEXTCAT_TEXT_TTEXT | TEXTCAT_TTEXT_TTEXT | GEOM_LENGTH | GEOM_PERIMETER | GEOM_AZIMUTH | GEOG_AREA | GEOG_LENGTH | GEOG_PERIMETER | GEOM_IS_EMPTY | AINTERSECTS_TGEO_GEO | ACOVERS_TGEO_GEO | ADISJOINT_TGEO_GEO | ADWITHIN_TGEO_GEO | EINTERSECTS_TGEO_GEO | ETOUCHES_TGEO_GEO | ECONTAINS_TGEO_GEO | ACONTAINS_TGEO_GEO | ATOUCHES_TGEO_GEO | GEO_NUM_POINTS | GEO_NUM_GEOS | GEO_SRID | GEO_IS_UNITARY | GEO_EQUALS | GEO_SAME | GEOG_DISTANCE | NAD_TGEO_GEO | EVER_EQ_TGEO_GEO | EVER_NE_TGEO_GEO | ALWAYS_EQ_TGEO_GEO | ALWAYS_NE_TGEO_GEO | GEOG_INTERSECTS | GEOG_DWITHIN | ACOVERS_GEO_TGEO | GEOM_INTERSECTS | GEOM_DWITHIN | H3_GS_POINT_TO_CELL | EVER_EQ_TH3INDEX_H3INDEX | EVER_NE_TH3INDEX_H3INDEX | ALWAYS_EQ_TH3INDEX_H3INDEX | ALWAYS_NE_TH3INDEX_H3INDEX | TH3INDEX_GET_RESOLUTION | TH3INDEX_GET_BASE_CELL_NUMBER | TH3INDEX_IS_VALID_CELL | TH3INDEX_IS_PENTAGON | TH3INDEX_CELL_TO_PARENT_NEXT | TH3INDEX_CELL_TO_CENTER_CHILD_NEXT | TH3INDEX_CELL_TO_PARENT | TH3INDEX_CELL_TO_CENTER_CHILD | TH3INDEX_CELL_TO_CHILD_POS | TH3INDEX_ARE_NEIGHBOR_CELLS | TH3INDEX_GRID_DISTANCE | GEOM_INTERSECTS2D | GEOM_DWITHIN2D | GEOM_CONTAINS | GEOM_DISJOINT2D | GEOM_COVERS | GEOM_TOUCHES | GEOM_INTERSECTS3D | GEOM_DWITHIN3D | GEOM_DISTANCE2D | GEOM_DISTANCE3D; +functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT | TGE_TTEXT_TEXT | TGE_TEXT_TTEXT | TGT_TTEXT_TEXT | TGT_TEXT_TTEXT | TLE_TTEXT_TEXT | TLE_TEXT_TTEXT | TLT_TTEXT_TEXT | TLT_TEXT_TTEXT | TTEXT_UPPER | TTEXT_LOWER | TTEXT_INITCAP | TEXTCAT_TTEXT_TEXT | TEXTCAT_TEXT_TTEXT | TEXTCAT_TTEXT_TTEXT | GEOM_LENGTH | GEOM_PERIMETER | GEOM_AZIMUTH | GEOG_AREA | GEOG_LENGTH | GEOG_PERIMETER | GEOM_IS_EMPTY | AINTERSECTS_TGEO_GEO | ACOVERS_TGEO_GEO | ADISJOINT_TGEO_GEO | ADWITHIN_TGEO_GEO | EINTERSECTS_TGEO_GEO | ETOUCHES_TGEO_GEO | ECONTAINS_TGEO_GEO | ACONTAINS_TGEO_GEO | ATOUCHES_TGEO_GEO | GEO_NUM_POINTS | GEO_NUM_GEOS | GEO_SRID | GEO_IS_UNITARY | GEO_EQUALS | GEO_SAME | GEOG_DISTANCE | NAD_TGEO_GEO | EVER_EQ_TGEO_GEO | EVER_NE_TGEO_GEO | ALWAYS_EQ_TGEO_GEO | ALWAYS_NE_TGEO_GEO | GEOG_INTERSECTS | GEOG_DWITHIN | ACOVERS_GEO_TGEO | GEOM_INTERSECTS | GEOM_DWITHIN | H3_GS_POINT_TO_CELL | EVER_EQ_TH3INDEX_H3INDEX | EVER_NE_TH3INDEX_H3INDEX | ALWAYS_EQ_TH3INDEX_H3INDEX | ALWAYS_NE_TH3INDEX_H3INDEX | TH3INDEX_GET_RESOLUTION | TH3INDEX_GET_BASE_CELL_NUMBER | TH3INDEX_IS_VALID_CELL | TH3INDEX_IS_PENTAGON | TH3INDEX_CELL_TO_PARENT_NEXT | TH3INDEX_CELL_TO_CENTER_CHILD_NEXT | TH3INDEX_CELL_TO_PARENT | TH3INDEX_CELL_TO_CENTER_CHILD | TH3INDEX_CELL_TO_CHILD_POS | TH3INDEX_ARE_NEIGHBOR_CELLS | TH3INDEX_GRID_DISTANCE | EINTERSECTS_TCBUFFER_GEO | AINTERSECTS_TCBUFFER_GEO | ECOVERS_TCBUFFER_GEO | ACOVERS_TCBUFFER_GEO | EDISJOINT_TCBUFFER_GEO | ADISJOINT_TCBUFFER_GEO | ETOUCHES_TCBUFFER_GEO | ATOUCHES_TCBUFFER_GEO | ECONTAINS_TCBUFFER_GEO | ACONTAINS_TCBUFFER_GEO | NAD_TCBUFFER_GEO | GEOM_INTERSECTS2D | GEOM_DWITHIN2D | GEOM_CONTAINS | GEOM_DISJOINT2D | GEOM_COVERS | GEOM_TOUCHES | GEOM_INTERSECTS3D | GEOM_DWITHIN3D | GEOM_DISTANCE2D | GEOM_DISTANCE3D; sinkClause: INTO sink (',' sink)*; @@ -807,6 +807,17 @@ TH3INDEX_CELL_TO_CENTER_CHILD: 'TH3INDEX_CELL_TO_CENTER_CHILD' | 'th3index_cell_ TH3INDEX_CELL_TO_CHILD_POS: 'TH3INDEX_CELL_TO_CHILD_POS' | 'th3index_cell_to_child_pos'; TH3INDEX_ARE_NEIGHBOR_CELLS: 'TH3INDEX_ARE_NEIGHBOR_CELLS' | 'th3index_are_neighbor_cells'; TH3INDEX_GRID_DISTANCE: 'TH3INDEX_GRID_DISTANCE' | 'th3index_grid_distance'; +EINTERSECTS_TCBUFFER_GEO: 'EINTERSECTS_TCBUFFER_GEO' | 'eintersects_tcbuffer_geo'; +AINTERSECTS_TCBUFFER_GEO: 'AINTERSECTS_TCBUFFER_GEO' | 'aintersects_tcbuffer_geo'; +ECOVERS_TCBUFFER_GEO: 'ECOVERS_TCBUFFER_GEO' | 'ecovers_tcbuffer_geo'; +ACOVERS_TCBUFFER_GEO: 'ACOVERS_TCBUFFER_GEO' | 'acovers_tcbuffer_geo'; +EDISJOINT_TCBUFFER_GEO: 'EDISJOINT_TCBUFFER_GEO' | 'edisjoint_tcbuffer_geo'; +ADISJOINT_TCBUFFER_GEO: 'ADISJOINT_TCBUFFER_GEO' | 'adisjoint_tcbuffer_geo'; +ETOUCHES_TCBUFFER_GEO: 'ETOUCHES_TCBUFFER_GEO' | 'etouches_tcbuffer_geo'; +ATOUCHES_TCBUFFER_GEO: 'ATOUCHES_TCBUFFER_GEO' | 'atouches_tcbuffer_geo'; +ECONTAINS_TCBUFFER_GEO: 'ECONTAINS_TCBUFFER_GEO' | 'econtains_tcbuffer_geo'; +ACONTAINS_TCBUFFER_GEO: 'ACONTAINS_TCBUFFER_GEO' | 'acontains_tcbuffer_geo'; +NAD_TCBUFFER_GEO: 'NAD_TCBUFFER_GEO' | 'nad_tcbuffer_geo'; GEOM_INTERSECTS2D: 'GEOM_INTERSECTS2D' | 'geom_intersects2d'; GEOM_DWITHIN2D: 'GEOM_DWITHIN2D' | 'geom_dwithin2d'; GEOM_CONTAINS: 'GEOM_CONTAINS' | 'geom_contains'; diff --git a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp index 364ad25082..806bee662d 100644 --- a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp +++ b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp @@ -388,6 +388,17 @@ #include #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include @@ -9294,6 +9305,138 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont return LogicalFunction(Th3indexGridDistanceLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3))); } /* END CODEGEN PARSER GLUE: TH3INDEX_GRID_DISTANCE */ + case AntlrSQLParser::EINTERSECTS_TCBUFFER_GEO: { + PRECONDITION(ctx->functionParam().size() == 5, + "EintersectsTcbufferGeo requires 5 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + return LogicalFunction(EintersectsTcbufferGeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4))); + } + /* END CODEGEN PARSER GLUE: EINTERSECTS_TCBUFFER_GEO */ + case AntlrSQLParser::AINTERSECTS_TCBUFFER_GEO: { + PRECONDITION(ctx->functionParam().size() == 5, + "AintersectsTcbufferGeo requires 5 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + return LogicalFunction(AintersectsTcbufferGeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4))); + } + /* END CODEGEN PARSER GLUE: AINTERSECTS_TCBUFFER_GEO */ + case AntlrSQLParser::ECOVERS_TCBUFFER_GEO: { + PRECONDITION(ctx->functionParam().size() == 5, + "EcoversTcbufferGeo requires 5 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + return LogicalFunction(EcoversTcbufferGeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4))); + } + /* END CODEGEN PARSER GLUE: ECOVERS_TCBUFFER_GEO */ + case AntlrSQLParser::ACOVERS_TCBUFFER_GEO: { + PRECONDITION(ctx->functionParam().size() == 5, + "AcoversTcbufferGeo requires 5 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + return LogicalFunction(AcoversTcbufferGeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4))); + } + /* END CODEGEN PARSER GLUE: ACOVERS_TCBUFFER_GEO */ + case AntlrSQLParser::EDISJOINT_TCBUFFER_GEO: { + PRECONDITION(ctx->functionParam().size() == 5, + "EdisjointTcbufferGeo requires 5 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + return LogicalFunction(EdisjointTcbufferGeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4))); + } + /* END CODEGEN PARSER GLUE: EDISJOINT_TCBUFFER_GEO */ + case AntlrSQLParser::ADISJOINT_TCBUFFER_GEO: { + PRECONDITION(ctx->functionParam().size() == 5, + "AdisjointTcbufferGeo requires 5 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + return LogicalFunction(AdisjointTcbufferGeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4))); + } + /* END CODEGEN PARSER GLUE: ADISJOINT_TCBUFFER_GEO */ + case AntlrSQLParser::ETOUCHES_TCBUFFER_GEO: { + PRECONDITION(ctx->functionParam().size() == 5, + "EtouchesTcbufferGeo requires 5 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + return LogicalFunction(EtouchesTcbufferGeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4))); + } + /* END CODEGEN PARSER GLUE: ETOUCHES_TCBUFFER_GEO */ + case AntlrSQLParser::ATOUCHES_TCBUFFER_GEO: { + PRECONDITION(ctx->functionParam().size() == 5, + "AtouchesTcbufferGeo requires 5 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + return LogicalFunction(AtouchesTcbufferGeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4))); + } + /* END CODEGEN PARSER GLUE: ATOUCHES_TCBUFFER_GEO */ + case AntlrSQLParser::ECONTAINS_TCBUFFER_GEO: { + PRECONDITION(ctx->functionParam().size() == 5, + "EcontainsTcbufferGeo requires 5 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + return LogicalFunction(EcontainsTcbufferGeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4))); + } + /* END CODEGEN PARSER GLUE: ECONTAINS_TCBUFFER_GEO */ + case AntlrSQLParser::ACONTAINS_TCBUFFER_GEO: { + PRECONDITION(ctx->functionParam().size() == 5, + "AcontainsTcbufferGeo requires 5 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + return LogicalFunction(AcontainsTcbufferGeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4))); + } + /* END CODEGEN PARSER GLUE: ACONTAINS_TCBUFFER_GEO */ + case AntlrSQLParser::NAD_TCBUFFER_GEO: { + PRECONDITION(ctx->functionParam().size() == 5, + "NadTcbufferGeo requires 5 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + return LogicalFunction(NadTcbufferGeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4))); + } + /* END CODEGEN PARSER GLUE: NAD_TCBUFFER_GEO */ /* END CODEGEN PARSER GLUE: GEOM_INTERSECTS2D */ case AntlrSQLParser::GEOM_DWITHIN2D: { PRECONDITION(ctx->functionParam().size() == 3, From 1c25be21d69221d73980c41963d214fc48dd8dfd Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Mon, 15 Jun 2026 04:48:15 +0200 Subject: [PATCH 62/96] feat(meos): add EDWITHIN_TCBUFFER_GEO and ADWITHIN_TCBUFFER_GEO NES operators (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. --- .../AdwithinTcbufferGeoLogicalFunction.hpp | 52 ++++++++ .../EdwithinTcbufferGeoLogicalFunction.hpp | 52 ++++++++ .../AdwithinTcbufferGeoLogicalFunction.cpp | 116 ++++++++++++++++++ .../src/Functions/Meos/CMakeLists.txt | 2 + .../EdwithinTcbufferGeoLogicalFunction.cpp | 116 ++++++++++++++++++ .../AdwithinTcbufferGeoPhysicalFunction.hpp | 36 ++++++ .../EdwithinTcbufferGeoPhysicalFunction.hpp | 36 ++++++ .../AdwithinTcbufferGeoPhysicalFunction.cpp | 107 ++++++++++++++++ .../src/Functions/Meos/CMakeLists.txt | 2 + .../EdwithinTcbufferGeoPhysicalFunction.cpp | 107 ++++++++++++++++ nes-sql-parser/AntlrSQL.g4 | 4 +- .../src/AntlrSQLQueryPlanCreator.cpp | 28 +++++ 12 files changed, 657 insertions(+), 1 deletion(-) create mode 100644 nes-logical-operators/include/Functions/Meos/AdwithinTcbufferGeoLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EdwithinTcbufferGeoLogicalFunction.hpp create mode 100644 nes-logical-operators/src/Functions/Meos/AdwithinTcbufferGeoLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EdwithinTcbufferGeoLogicalFunction.cpp create mode 100644 nes-physical-operators/include/Functions/Meos/AdwithinTcbufferGeoPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EdwithinTcbufferGeoPhysicalFunction.hpp create mode 100644 nes-physical-operators/src/Functions/Meos/AdwithinTcbufferGeoPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EdwithinTcbufferGeoPhysicalFunction.cpp diff --git a/nes-logical-operators/include/Functions/Meos/AdwithinTcbufferGeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AdwithinTcbufferGeoLogicalFunction.hpp new file mode 100644 index 0000000000..f67ef27054 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AdwithinTcbufferGeoLogicalFunction.hpp @@ -0,0 +1,52 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if the tcbuffer is always within dist of the static geometry, 0.0 otherwise. + * + * Args: (lon:FLOAT64, lat:FLOAT64, radius:FLOAT64, ts:UINT64, wkt:VARCHAR, dist:FLOAT64) -> FLOAT64. + */ +class AdwithinTcbufferGeoLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AdwithinTcbufferGeo"; + + AdwithinTcbufferGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, + LogicalFunction radius, LogicalFunction ts, + LogicalFunction wkt, LogicalFunction dist); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EdwithinTcbufferGeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EdwithinTcbufferGeoLogicalFunction.hpp new file mode 100644 index 0000000000..d9dcc36c65 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EdwithinTcbufferGeoLogicalFunction.hpp @@ -0,0 +1,52 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if the tcbuffer ever comes within dist of the static geometry, 0.0 otherwise. + * + * Args: (lon:FLOAT64, lat:FLOAT64, radius:FLOAT64, ts:UINT64, wkt:VARCHAR, dist:FLOAT64) -> FLOAT64. + */ +class EdwithinTcbufferGeoLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EdwithinTcbufferGeo"; + + EdwithinTcbufferGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, + LogicalFunction radius, LogicalFunction ts, + LogicalFunction wkt, LogicalFunction dist); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AdwithinTcbufferGeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AdwithinTcbufferGeoLogicalFunction.cpp new file mode 100644 index 0000000000..66049ca77d --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AdwithinTcbufferGeoLogicalFunction.cpp @@ -0,0 +1,116 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AdwithinTcbufferGeoLogicalFunction::AdwithinTcbufferGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, + LogicalFunction radius, LogicalFunction ts, + LogicalFunction wkt, LogicalFunction dist) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(6); + parameters.push_back(std::move(lon)); + parameters.push_back(std::move(lat)); + parameters.push_back(std::move(radius)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(wkt)); + parameters.push_back(std::move(dist)); +} + +DataType AdwithinTcbufferGeoLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AdwithinTcbufferGeoLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AdwithinTcbufferGeoLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AdwithinTcbufferGeoLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 6, + "AdwithinTcbufferGeoLogicalFunction requires 6 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AdwithinTcbufferGeoLogicalFunction::getType() const { return NAME; } + +bool AdwithinTcbufferGeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AdwithinTcbufferGeoLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction AdwithinTcbufferGeoLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(6); + c.emplace_back(parameters[0].withInferredDataType(schema)); + c.emplace_back(parameters[1].withInferredDataType(schema)); + c.emplace_back(parameters[2].withInferredDataType(schema)); + c.emplace_back(parameters[3].withInferredDataType(schema)); + c.emplace_back(parameters[4].withInferredDataType(schema)); + c.emplace_back(parameters[5].withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon must be FLOAT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "radius must be FLOAT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::VARSIZED), "wkt must be VARCHAR"); + INVARIANT(c[5].getDataType().isType(DataType::Type::FLOAT64), "dist must be FLOAT64"); + return withChildren(c); +} + +SerializableFunction AdwithinTcbufferGeoLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAdwithinTcbufferGeoLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 6, + "AdwithinTcbufferGeoLogicalFunction requires 6 children but got {}", + arguments.children.size()); + return AdwithinTcbufferGeoLogicalFunction(std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4]), + std::move(arguments.children[5])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt index ea572c1fcd..1d83d1dc98 100644 --- a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt @@ -348,6 +348,8 @@ add_plugin(AtouchesTcbufferGeo LogicalFunction nes-logical-operators AtouchesTcb add_plugin(EcontainsTcbufferGeo LogicalFunction nes-logical-operators EcontainsTcbufferGeoLogicalFunction.cpp) add_plugin(AcontainsTcbufferGeo LogicalFunction nes-logical-operators AcontainsTcbufferGeoLogicalFunction.cpp) add_plugin(NadTcbufferGeo LogicalFunction nes-logical-operators NadTcbufferGeoLogicalFunction.cpp) +add_plugin(EdwithinTcbufferGeo LogicalFunction nes-logical-operators EdwithinTcbufferGeoLogicalFunction.cpp) +add_plugin(AdwithinTcbufferGeo LogicalFunction nes-logical-operators AdwithinTcbufferGeoLogicalFunction.cpp) add_plugin(GeomIntersects2d LogicalFunction nes-logical-operators GeomIntersects2dLogicalFunction.cpp) add_plugin(GeomDwithin2d LogicalFunction nes-logical-operators GeomDwithin2dLogicalFunction.cpp) add_plugin(GeomContains LogicalFunction nes-logical-operators GeomContainsLogicalFunction.cpp) diff --git a/nes-logical-operators/src/Functions/Meos/EdwithinTcbufferGeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EdwithinTcbufferGeoLogicalFunction.cpp new file mode 100644 index 0000000000..a918723e2f --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EdwithinTcbufferGeoLogicalFunction.cpp @@ -0,0 +1,116 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EdwithinTcbufferGeoLogicalFunction::EdwithinTcbufferGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, + LogicalFunction radius, LogicalFunction ts, + LogicalFunction wkt, LogicalFunction dist) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(6); + parameters.push_back(std::move(lon)); + parameters.push_back(std::move(lat)); + parameters.push_back(std::move(radius)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(wkt)); + parameters.push_back(std::move(dist)); +} + +DataType EdwithinTcbufferGeoLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EdwithinTcbufferGeoLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EdwithinTcbufferGeoLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EdwithinTcbufferGeoLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 6, + "EdwithinTcbufferGeoLogicalFunction requires 6 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EdwithinTcbufferGeoLogicalFunction::getType() const { return NAME; } + +bool EdwithinTcbufferGeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EdwithinTcbufferGeoLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction EdwithinTcbufferGeoLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(6); + c.emplace_back(parameters[0].withInferredDataType(schema)); + c.emplace_back(parameters[1].withInferredDataType(schema)); + c.emplace_back(parameters[2].withInferredDataType(schema)); + c.emplace_back(parameters[3].withInferredDataType(schema)); + c.emplace_back(parameters[4].withInferredDataType(schema)); + c.emplace_back(parameters[5].withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon must be FLOAT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "radius must be FLOAT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::VARSIZED), "wkt must be VARCHAR"); + INVARIANT(c[5].getDataType().isType(DataType::Type::FLOAT64), "dist must be FLOAT64"); + return withChildren(c); +} + +SerializableFunction EdwithinTcbufferGeoLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEdwithinTcbufferGeoLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 6, + "EdwithinTcbufferGeoLogicalFunction requires 6 children but got {}", + arguments.children.size()); + return EdwithinTcbufferGeoLogicalFunction(std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4]), + std::move(arguments.children[5])); +} + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AdwithinTcbufferGeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AdwithinTcbufferGeoPhysicalFunction.hpp new file mode 100644 index 0000000000..62bfbd22eb --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AdwithinTcbufferGeoPhysicalFunction.hpp @@ -0,0 +1,36 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class AdwithinTcbufferGeoPhysicalFunction : public PhysicalFunctionConcept { +public: + AdwithinTcbufferGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, + PhysicalFunction radius, PhysicalFunction ts, + PhysicalFunction wkt, PhysicalFunction dist); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EdwithinTcbufferGeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EdwithinTcbufferGeoPhysicalFunction.hpp new file mode 100644 index 0000000000..9dbb55e258 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EdwithinTcbufferGeoPhysicalFunction.hpp @@ -0,0 +1,36 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class EdwithinTcbufferGeoPhysicalFunction : public PhysicalFunctionConcept { +public: + EdwithinTcbufferGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, + PhysicalFunction radius, PhysicalFunction ts, + PhysicalFunction wkt, PhysicalFunction dist); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AdwithinTcbufferGeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AdwithinTcbufferGeoPhysicalFunction.cpp new file mode 100644 index 0000000000..f49454910a --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AdwithinTcbufferGeoPhysicalFunction.cpp @@ -0,0 +1,107 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +AdwithinTcbufferGeoPhysicalFunction::AdwithinTcbufferGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, + PhysicalFunction radius, PhysicalFunction ts, + PhysicalFunction wkt, PhysicalFunction dist) +{ + paramFns.reserve(6); + paramFns.push_back(std::move(lon)); + paramFns.push_back(std::move(lat)); + paramFns.push_back(std::move(radius)); + paramFns.push_back(std::move(ts)); + paramFns.push_back(std::move(wkt)); + paramFns.push_back(std::move(dist)); +} + +VarVal AdwithinTcbufferGeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto lon = paramFns[0].execute(record, arena).cast(); + auto lat = paramFns[1].execute(record, arena).cast(); + auto radius = paramFns[2].execute(record, arena).cast(); + auto ts = paramFns[3].execute(record, arena).cast(); + auto wkt = paramFns[4].execute(record, arena); + auto dist = paramFns[5].execute(record, arena).cast(); + + const auto result = nautilus::invoke( + +[](double lon, double lat, double radius, uint64_t ts, + const char* wkt, uint32_t wkt_len, double dist) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + // Build tcbuffer instant from lon/lat/radius/ts + std::string pt_str = fmt::format("POINT({} {})", lon, lat); + GSERIALIZED* pt_gs = geom_in(pt_str.c_str(), -1); + if (!pt_gs) return 0.0; + Cbuffer* cb = cbuffer_make(pt_gs, radius); + free(pt_gs); + if (!cb) return 0.0; + Temporal* tcb_inst = (Temporal*)tcbufferinst_make(cb, (TimestampTz)ts); + free(cb); + if (!tcb_inst) return 0.0; + // Build target geometry from null-terminated WKT copy + char* wkt_str = (char*)malloc(wkt_len + 1); + memcpy(wkt_str, wkt, wkt_len); + wkt_str[wkt_len] = '\0'; + GSERIALIZED* target_gs = geom_in(wkt_str, -1); + free(wkt_str); + if (!target_gs) { free(tcb_inst); return 0.0; } + int r = adwithin_tcbuffer_geo(tcb_inst, target_gs, dist); + free(tcb_inst); + free(target_gs); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + lon, lat, radius, ts, wkt, dist); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAdwithinTcbufferGeoPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 6, + "AdwithinTcbufferGeoPhysicalFunction requires 6 children but got {}", + arguments.childFunctions.size()); + return AdwithinTcbufferGeoPhysicalFunction(std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4]), + std::move(arguments.childFunctions[5])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt index c5292978c0..33e9b9a416 100644 --- a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt @@ -347,6 +347,8 @@ add_plugin(AtouchesTcbufferGeo PhysicalFunction nes-physical-operators AtouchesT add_plugin(EcontainsTcbufferGeo PhysicalFunction nes-physical-operators EcontainsTcbufferGeoPhysicalFunction.cpp) add_plugin(AcontainsTcbufferGeo PhysicalFunction nes-physical-operators AcontainsTcbufferGeoPhysicalFunction.cpp) add_plugin(NadTcbufferGeo PhysicalFunction nes-physical-operators NadTcbufferGeoPhysicalFunction.cpp) +add_plugin(EdwithinTcbufferGeo PhysicalFunction nes-physical-operators EdwithinTcbufferGeoPhysicalFunction.cpp) +add_plugin(AdwithinTcbufferGeo PhysicalFunction nes-physical-operators AdwithinTcbufferGeoPhysicalFunction.cpp) add_plugin(GeomIntersects2d PhysicalFunction nes-physical-operators GeomIntersects2dPhysicalFunction.cpp) add_plugin(GeomDwithin2d PhysicalFunction nes-physical-operators GeomDwithin2dPhysicalFunction.cpp) add_plugin(GeomContains PhysicalFunction nes-physical-operators GeomContainsPhysicalFunction.cpp) diff --git a/nes-physical-operators/src/Functions/Meos/EdwithinTcbufferGeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EdwithinTcbufferGeoPhysicalFunction.cpp new file mode 100644 index 0000000000..074a407bb2 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EdwithinTcbufferGeoPhysicalFunction.cpp @@ -0,0 +1,107 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +EdwithinTcbufferGeoPhysicalFunction::EdwithinTcbufferGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, + PhysicalFunction radius, PhysicalFunction ts, + PhysicalFunction wkt, PhysicalFunction dist) +{ + paramFns.reserve(6); + paramFns.push_back(std::move(lon)); + paramFns.push_back(std::move(lat)); + paramFns.push_back(std::move(radius)); + paramFns.push_back(std::move(ts)); + paramFns.push_back(std::move(wkt)); + paramFns.push_back(std::move(dist)); +} + +VarVal EdwithinTcbufferGeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto lon = paramFns[0].execute(record, arena).cast(); + auto lat = paramFns[1].execute(record, arena).cast(); + auto radius = paramFns[2].execute(record, arena).cast(); + auto ts = paramFns[3].execute(record, arena).cast(); + auto wkt = paramFns[4].execute(record, arena); + auto dist = paramFns[5].execute(record, arena).cast(); + + const auto result = nautilus::invoke( + +[](double lon, double lat, double radius, uint64_t ts, + const char* wkt, uint32_t wkt_len, double dist) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + // Build tcbuffer instant from lon/lat/radius/ts + std::string pt_str = fmt::format("POINT({} {})", lon, lat); + GSERIALIZED* pt_gs = geom_in(pt_str.c_str(), -1); + if (!pt_gs) return 0.0; + Cbuffer* cb = cbuffer_make(pt_gs, radius); + free(pt_gs); + if (!cb) return 0.0; + Temporal* tcb_inst = (Temporal*)tcbufferinst_make(cb, (TimestampTz)ts); + free(cb); + if (!tcb_inst) return 0.0; + // Build target geometry from null-terminated WKT copy + char* wkt_str = (char*)malloc(wkt_len + 1); + memcpy(wkt_str, wkt, wkt_len); + wkt_str[wkt_len] = '\0'; + GSERIALIZED* target_gs = geom_in(wkt_str, -1); + free(wkt_str); + if (!target_gs) { free(tcb_inst); return 0.0; } + int r = edwithin_tcbuffer_geo(tcb_inst, target_gs, dist); + free(tcb_inst); + free(target_gs); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + lon, lat, radius, ts, wkt, dist); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEdwithinTcbufferGeoPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 6, + "EdwithinTcbufferGeoPhysicalFunction requires 6 children but got {}", + arguments.childFunctions.size()); + return EdwithinTcbufferGeoPhysicalFunction(std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4]), + std::move(arguments.childFunctions[5])); +} + +} // namespace NES diff --git a/nes-sql-parser/AntlrSQL.g4 b/nes-sql-parser/AntlrSQL.g4 index d7c1b2c2c8..b054846852 100644 --- a/nes-sql-parser/AntlrSQL.g4 +++ b/nes-sql-parser/AntlrSQL.g4 @@ -295,7 +295,7 @@ timeUnit: MS timestampParameter: name=identifier; -functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT | TGE_TTEXT_TEXT | TGE_TEXT_TTEXT | TGT_TTEXT_TEXT | TGT_TEXT_TTEXT | TLE_TTEXT_TEXT | TLE_TEXT_TTEXT | TLT_TTEXT_TEXT | TLT_TEXT_TTEXT | TTEXT_UPPER | TTEXT_LOWER | TTEXT_INITCAP | TEXTCAT_TTEXT_TEXT | TEXTCAT_TEXT_TTEXT | TEXTCAT_TTEXT_TTEXT | GEOM_LENGTH | GEOM_PERIMETER | GEOM_AZIMUTH | GEOG_AREA | GEOG_LENGTH | GEOG_PERIMETER | GEOM_IS_EMPTY | AINTERSECTS_TGEO_GEO | ACOVERS_TGEO_GEO | ADISJOINT_TGEO_GEO | ADWITHIN_TGEO_GEO | EINTERSECTS_TGEO_GEO | ETOUCHES_TGEO_GEO | ECONTAINS_TGEO_GEO | ACONTAINS_TGEO_GEO | ATOUCHES_TGEO_GEO | GEO_NUM_POINTS | GEO_NUM_GEOS | GEO_SRID | GEO_IS_UNITARY | GEO_EQUALS | GEO_SAME | GEOG_DISTANCE | NAD_TGEO_GEO | EVER_EQ_TGEO_GEO | EVER_NE_TGEO_GEO | ALWAYS_EQ_TGEO_GEO | ALWAYS_NE_TGEO_GEO | GEOG_INTERSECTS | GEOG_DWITHIN | ACOVERS_GEO_TGEO | GEOM_INTERSECTS | GEOM_DWITHIN | H3_GS_POINT_TO_CELL | EVER_EQ_TH3INDEX_H3INDEX | EVER_NE_TH3INDEX_H3INDEX | ALWAYS_EQ_TH3INDEX_H3INDEX | ALWAYS_NE_TH3INDEX_H3INDEX | TH3INDEX_GET_RESOLUTION | TH3INDEX_GET_BASE_CELL_NUMBER | TH3INDEX_IS_VALID_CELL | TH3INDEX_IS_PENTAGON | TH3INDEX_CELL_TO_PARENT_NEXT | TH3INDEX_CELL_TO_CENTER_CHILD_NEXT | TH3INDEX_CELL_TO_PARENT | TH3INDEX_CELL_TO_CENTER_CHILD | TH3INDEX_CELL_TO_CHILD_POS | TH3INDEX_ARE_NEIGHBOR_CELLS | TH3INDEX_GRID_DISTANCE | EINTERSECTS_TCBUFFER_GEO | AINTERSECTS_TCBUFFER_GEO | ECOVERS_TCBUFFER_GEO | ACOVERS_TCBUFFER_GEO | EDISJOINT_TCBUFFER_GEO | ADISJOINT_TCBUFFER_GEO | ETOUCHES_TCBUFFER_GEO | ATOUCHES_TCBUFFER_GEO | ECONTAINS_TCBUFFER_GEO | ACONTAINS_TCBUFFER_GEO | NAD_TCBUFFER_GEO | GEOM_INTERSECTS2D | GEOM_DWITHIN2D | GEOM_CONTAINS | GEOM_DISJOINT2D | GEOM_COVERS | GEOM_TOUCHES | GEOM_INTERSECTS3D | GEOM_DWITHIN3D | GEOM_DISTANCE2D | GEOM_DISTANCE3D; +functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT | TGE_TTEXT_TEXT | TGE_TEXT_TTEXT | TGT_TTEXT_TEXT | TGT_TEXT_TTEXT | TLE_TTEXT_TEXT | TLE_TEXT_TTEXT | TLT_TTEXT_TEXT | TLT_TEXT_TTEXT | TTEXT_UPPER | TTEXT_LOWER | TTEXT_INITCAP | TEXTCAT_TTEXT_TEXT | TEXTCAT_TEXT_TTEXT | TEXTCAT_TTEXT_TTEXT | GEOM_LENGTH | GEOM_PERIMETER | GEOM_AZIMUTH | GEOG_AREA | GEOG_LENGTH | GEOG_PERIMETER | GEOM_IS_EMPTY | AINTERSECTS_TGEO_GEO | ACOVERS_TGEO_GEO | ADISJOINT_TGEO_GEO | ADWITHIN_TGEO_GEO | EINTERSECTS_TGEO_GEO | ETOUCHES_TGEO_GEO | ECONTAINS_TGEO_GEO | ACONTAINS_TGEO_GEO | ATOUCHES_TGEO_GEO | GEO_NUM_POINTS | GEO_NUM_GEOS | GEO_SRID | GEO_IS_UNITARY | GEO_EQUALS | GEO_SAME | GEOG_DISTANCE | NAD_TGEO_GEO | EVER_EQ_TGEO_GEO | EVER_NE_TGEO_GEO | ALWAYS_EQ_TGEO_GEO | ALWAYS_NE_TGEO_GEO | GEOG_INTERSECTS | GEOG_DWITHIN | ACOVERS_GEO_TGEO | GEOM_INTERSECTS | GEOM_DWITHIN | H3_GS_POINT_TO_CELL | EVER_EQ_TH3INDEX_H3INDEX | EVER_NE_TH3INDEX_H3INDEX | ALWAYS_EQ_TH3INDEX_H3INDEX | ALWAYS_NE_TH3INDEX_H3INDEX | TH3INDEX_GET_RESOLUTION | TH3INDEX_GET_BASE_CELL_NUMBER | TH3INDEX_IS_VALID_CELL | TH3INDEX_IS_PENTAGON | TH3INDEX_CELL_TO_PARENT_NEXT | TH3INDEX_CELL_TO_CENTER_CHILD_NEXT | TH3INDEX_CELL_TO_PARENT | TH3INDEX_CELL_TO_CENTER_CHILD | TH3INDEX_CELL_TO_CHILD_POS | TH3INDEX_ARE_NEIGHBOR_CELLS | TH3INDEX_GRID_DISTANCE | EINTERSECTS_TCBUFFER_GEO | AINTERSECTS_TCBUFFER_GEO | ECOVERS_TCBUFFER_GEO | ACOVERS_TCBUFFER_GEO | EDISJOINT_TCBUFFER_GEO | ADISJOINT_TCBUFFER_GEO | ETOUCHES_TCBUFFER_GEO | ATOUCHES_TCBUFFER_GEO | ECONTAINS_TCBUFFER_GEO | ACONTAINS_TCBUFFER_GEO | NAD_TCBUFFER_GEO | EDWITHIN_TCBUFFER_GEO | ADWITHIN_TCBUFFER_GEO | GEOM_INTERSECTS2D | GEOM_DWITHIN2D | GEOM_CONTAINS | GEOM_DISJOINT2D | GEOM_COVERS | GEOM_TOUCHES | GEOM_INTERSECTS3D | GEOM_DWITHIN3D | GEOM_DISTANCE2D | GEOM_DISTANCE3D; sinkClause: INTO sink (',' sink)*; @@ -818,6 +818,8 @@ ATOUCHES_TCBUFFER_GEO: 'ATOUCHES_TCBUFFER_GEO' | 'atouches_tcbuffer_geo'; ECONTAINS_TCBUFFER_GEO: 'ECONTAINS_TCBUFFER_GEO' | 'econtains_tcbuffer_geo'; ACONTAINS_TCBUFFER_GEO: 'ACONTAINS_TCBUFFER_GEO' | 'acontains_tcbuffer_geo'; NAD_TCBUFFER_GEO: 'NAD_TCBUFFER_GEO' | 'nad_tcbuffer_geo'; +EDWITHIN_TCBUFFER_GEO: 'EDWITHIN_TCBUFFER_GEO' | 'edwithin_tcbuffer_geo'; +ADWITHIN_TCBUFFER_GEO: 'ADWITHIN_TCBUFFER_GEO' | 'adwithin_tcbuffer_geo'; GEOM_INTERSECTS2D: 'GEOM_INTERSECTS2D' | 'geom_intersects2d'; GEOM_DWITHIN2D: 'GEOM_DWITHIN2D' | 'geom_dwithin2d'; GEOM_CONTAINS: 'GEOM_CONTAINS' | 'geom_contains'; diff --git a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp index 806bee662d..ae848f26ce 100644 --- a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp +++ b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp @@ -399,6 +399,8 @@ #include #include #include +#include +#include #include #include #include @@ -9437,6 +9439,32 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont return LogicalFunction(NadTcbufferGeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4))); } /* END CODEGEN PARSER GLUE: NAD_TCBUFFER_GEO */ + case AntlrSQLParser::EDWITHIN_TCBUFFER_GEO: { + PRECONDITION(ctx->functionParam().size() == 6, + "EdwithinTcbufferGeo requires 6 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + auto arg5 = visit(ctx->functionParam(5)).as(); + return LogicalFunction(EdwithinTcbufferGeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5))); + } + /* END CODEGEN PARSER GLUE: EDWITHIN_TCBUFFER_GEO */ + case AntlrSQLParser::ADWITHIN_TCBUFFER_GEO: { + PRECONDITION(ctx->functionParam().size() == 6, + "AdwithinTcbufferGeo requires 6 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + auto arg5 = visit(ctx->functionParam(5)).as(); + return LogicalFunction(AdwithinTcbufferGeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5))); + } + /* END CODEGEN PARSER GLUE: ADWITHIN_TCBUFFER_GEO */ /* END CODEGEN PARSER GLUE: GEOM_INTERSECTS2D */ case AntlrSQLParser::GEOM_DWITHIN2D: { PRECONDITION(ctx->functionParam().size() == 3, From 77d4171417a3431fe879efc1b7d810c5c1553475 Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Mon, 15 Jun 2026 05:45:10 +0200 Subject: [PATCH 63/96] feat(meos): add tcbuffer_cbuffer spatial predicate NES operators (W115) 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. --- ...containsTcbufferCbufferLogicalFunction.hpp | 53 +++++ .../AcoversTcbufferCbufferLogicalFunction.hpp | 53 +++++ ...disjointTcbufferCbufferLogicalFunction.hpp | 53 +++++ ...tersectsTcbufferCbufferLogicalFunction.hpp | 53 +++++ ...AlwaysEqTcbufferCbufferLogicalFunction.hpp | 53 +++++ ...AlwaysNeTcbufferCbufferLogicalFunction.hpp | 53 +++++ ...AtouchesTcbufferCbufferLogicalFunction.hpp | 53 +++++ ...containsTcbufferCbufferLogicalFunction.hpp | 53 +++++ .../EcoversTcbufferCbufferLogicalFunction.hpp | 53 +++++ ...disjointTcbufferCbufferLogicalFunction.hpp | 53 +++++ ...tersectsTcbufferCbufferLogicalFunction.hpp | 53 +++++ ...EtouchesTcbufferCbufferLogicalFunction.hpp | 53 +++++ .../EverEqTcbufferCbufferLogicalFunction.hpp | 53 +++++ .../EverNeTcbufferCbufferLogicalFunction.hpp | 53 +++++ .../NadTcbufferCbufferLogicalFunction.hpp | 53 +++++ ...containsTcbufferCbufferLogicalFunction.cpp | 116 +++++++++ .../AcoversTcbufferCbufferLogicalFunction.cpp | 116 +++++++++ ...disjointTcbufferCbufferLogicalFunction.cpp | 116 +++++++++ ...tersectsTcbufferCbufferLogicalFunction.cpp | 116 +++++++++ ...AlwaysEqTcbufferCbufferLogicalFunction.cpp | 116 +++++++++ ...AlwaysNeTcbufferCbufferLogicalFunction.cpp | 116 +++++++++ ...AtouchesTcbufferCbufferLogicalFunction.cpp | 116 +++++++++ .../src/Functions/Meos/CMakeLists.txt | 15 ++ ...containsTcbufferCbufferLogicalFunction.cpp | 116 +++++++++ .../EcoversTcbufferCbufferLogicalFunction.cpp | 116 +++++++++ ...disjointTcbufferCbufferLogicalFunction.cpp | 116 +++++++++ ...tersectsTcbufferCbufferLogicalFunction.cpp | 116 +++++++++ ...EtouchesTcbufferCbufferLogicalFunction.cpp | 116 +++++++++ .../EverEqTcbufferCbufferLogicalFunction.cpp | 116 +++++++++ .../EverNeTcbufferCbufferLogicalFunction.cpp | 116 +++++++++ .../NadTcbufferCbufferLogicalFunction.cpp | 116 +++++++++ ...ontainsTcbufferCbufferPhysicalFunction.hpp | 36 +++ ...AcoversTcbufferCbufferPhysicalFunction.hpp | 36 +++ ...isjointTcbufferCbufferPhysicalFunction.hpp | 36 +++ ...ersectsTcbufferCbufferPhysicalFunction.hpp | 36 +++ ...lwaysEqTcbufferCbufferPhysicalFunction.hpp | 36 +++ ...lwaysNeTcbufferCbufferPhysicalFunction.hpp | 36 +++ ...touchesTcbufferCbufferPhysicalFunction.hpp | 36 +++ ...ontainsTcbufferCbufferPhysicalFunction.hpp | 36 +++ ...EcoversTcbufferCbufferPhysicalFunction.hpp | 36 +++ ...isjointTcbufferCbufferPhysicalFunction.hpp | 36 +++ ...ersectsTcbufferCbufferPhysicalFunction.hpp | 36 +++ ...touchesTcbufferCbufferPhysicalFunction.hpp | 36 +++ .../EverEqTcbufferCbufferPhysicalFunction.hpp | 36 +++ .../EverNeTcbufferCbufferPhysicalFunction.hpp | 36 +++ .../NadTcbufferCbufferPhysicalFunction.hpp | 36 +++ ...ontainsTcbufferCbufferPhysicalFunction.cpp | 110 +++++++++ ...AcoversTcbufferCbufferPhysicalFunction.cpp | 110 +++++++++ ...isjointTcbufferCbufferPhysicalFunction.cpp | 110 +++++++++ ...ersectsTcbufferCbufferPhysicalFunction.cpp | 110 +++++++++ ...lwaysEqTcbufferCbufferPhysicalFunction.cpp | 110 +++++++++ ...lwaysNeTcbufferCbufferPhysicalFunction.cpp | 110 +++++++++ ...touchesTcbufferCbufferPhysicalFunction.cpp | 110 +++++++++ .../src/Functions/Meos/CMakeLists.txt | 15 ++ ...ontainsTcbufferCbufferPhysicalFunction.cpp | 110 +++++++++ ...EcoversTcbufferCbufferPhysicalFunction.cpp | 110 +++++++++ ...isjointTcbufferCbufferPhysicalFunction.cpp | 110 +++++++++ ...ersectsTcbufferCbufferPhysicalFunction.cpp | 110 +++++++++ ...touchesTcbufferCbufferPhysicalFunction.cpp | 110 +++++++++ .../EverEqTcbufferCbufferPhysicalFunction.cpp | 110 +++++++++ .../EverNeTcbufferCbufferPhysicalFunction.cpp | 110 +++++++++ .../NadTcbufferCbufferPhysicalFunction.cpp | 110 +++++++++ nes-sql-parser/AntlrSQL.g4 | 17 +- .../src/AntlrSQLQueryPlanCreator.cpp | 225 ++++++++++++++++++ 64 files changed, 4996 insertions(+), 1 deletion(-) create mode 100644 nes-logical-operators/include/Functions/Meos/AcontainsTcbufferCbufferLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AcoversTcbufferCbufferLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AdisjointTcbufferCbufferLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AintersectsTcbufferCbufferLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysEqTcbufferCbufferLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysNeTcbufferCbufferLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AtouchesTcbufferCbufferLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EcontainsTcbufferCbufferLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EcoversTcbufferCbufferLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EdisjointTcbufferCbufferLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EintersectsTcbufferCbufferLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EtouchesTcbufferCbufferLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverEqTcbufferCbufferLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverNeTcbufferCbufferLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/NadTcbufferCbufferLogicalFunction.hpp create mode 100644 nes-logical-operators/src/Functions/Meos/AcontainsTcbufferCbufferLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AcoversTcbufferCbufferLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AdisjointTcbufferCbufferLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AintersectsTcbufferCbufferLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysEqTcbufferCbufferLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysNeTcbufferCbufferLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AtouchesTcbufferCbufferLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EcontainsTcbufferCbufferLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EcoversTcbufferCbufferLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EdisjointTcbufferCbufferLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EintersectsTcbufferCbufferLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EtouchesTcbufferCbufferLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverEqTcbufferCbufferLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverNeTcbufferCbufferLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/NadTcbufferCbufferLogicalFunction.cpp create mode 100644 nes-physical-operators/include/Functions/Meos/AcontainsTcbufferCbufferPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AcoversTcbufferCbufferPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AdisjointTcbufferCbufferPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AintersectsTcbufferCbufferPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysEqTcbufferCbufferPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysNeTcbufferCbufferPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AtouchesTcbufferCbufferPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EcontainsTcbufferCbufferPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EcoversTcbufferCbufferPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EdisjointTcbufferCbufferPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EintersectsTcbufferCbufferPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EtouchesTcbufferCbufferPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverEqTcbufferCbufferPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverNeTcbufferCbufferPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/NadTcbufferCbufferPhysicalFunction.hpp create mode 100644 nes-physical-operators/src/Functions/Meos/AcontainsTcbufferCbufferPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AcoversTcbufferCbufferPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AdisjointTcbufferCbufferPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AintersectsTcbufferCbufferPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysEqTcbufferCbufferPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysNeTcbufferCbufferPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AtouchesTcbufferCbufferPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EcontainsTcbufferCbufferPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EcoversTcbufferCbufferPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EdisjointTcbufferCbufferPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EintersectsTcbufferCbufferPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EtouchesTcbufferCbufferPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverEqTcbufferCbufferPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverNeTcbufferCbufferPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/NadTcbufferCbufferPhysicalFunction.cpp diff --git a/nes-logical-operators/include/Functions/Meos/AcontainsTcbufferCbufferLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AcontainsTcbufferCbufferLogicalFunction.hpp new file mode 100644 index 0000000000..6d86d5a22c --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AcontainsTcbufferCbufferLogicalFunction.hpp @@ -0,0 +1,53 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if the tcbuffer always contains the static cbuffer, 0.0 otherwise. + * + * Args: (lon1:FLOAT64, lat1:FLOAT64, r1:FLOAT64, ts:UINT64, + * lon2:FLOAT64, lat2:FLOAT64, r2:FLOAT64) -> FLOAT64. + */ +class AcontainsTcbufferCbufferLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AcontainsTcbufferCbuffer"; + + AcontainsTcbufferCbufferLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction r1, + LogicalFunction ts, + LogicalFunction lon2, LogicalFunction lat2, LogicalFunction r2); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AcoversTcbufferCbufferLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AcoversTcbufferCbufferLogicalFunction.hpp new file mode 100644 index 0000000000..85b4976e6f --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AcoversTcbufferCbufferLogicalFunction.hpp @@ -0,0 +1,53 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if the tcbuffer always covers the static cbuffer, 0.0 otherwise. + * + * Args: (lon1:FLOAT64, lat1:FLOAT64, r1:FLOAT64, ts:UINT64, + * lon2:FLOAT64, lat2:FLOAT64, r2:FLOAT64) -> FLOAT64. + */ +class AcoversTcbufferCbufferLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AcoversTcbufferCbuffer"; + + AcoversTcbufferCbufferLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction r1, + LogicalFunction ts, + LogicalFunction lon2, LogicalFunction lat2, LogicalFunction r2); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AdisjointTcbufferCbufferLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AdisjointTcbufferCbufferLogicalFunction.hpp new file mode 100644 index 0000000000..f5fc8bca58 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AdisjointTcbufferCbufferLogicalFunction.hpp @@ -0,0 +1,53 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if the tcbuffer is always disjoint from the static cbuffer, 0.0 otherwise. + * + * Args: (lon1:FLOAT64, lat1:FLOAT64, r1:FLOAT64, ts:UINT64, + * lon2:FLOAT64, lat2:FLOAT64, r2:FLOAT64) -> FLOAT64. + */ +class AdisjointTcbufferCbufferLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AdisjointTcbufferCbuffer"; + + AdisjointTcbufferCbufferLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction r1, + LogicalFunction ts, + LogicalFunction lon2, LogicalFunction lat2, LogicalFunction r2); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AintersectsTcbufferCbufferLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AintersectsTcbufferCbufferLogicalFunction.hpp new file mode 100644 index 0000000000..21b170cef0 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AintersectsTcbufferCbufferLogicalFunction.hpp @@ -0,0 +1,53 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if the tcbuffer always intersects the static cbuffer, 0.0 otherwise. + * + * Args: (lon1:FLOAT64, lat1:FLOAT64, r1:FLOAT64, ts:UINT64, + * lon2:FLOAT64, lat2:FLOAT64, r2:FLOAT64) -> FLOAT64. + */ +class AintersectsTcbufferCbufferLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AintersectsTcbufferCbuffer"; + + AintersectsTcbufferCbufferLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction r1, + LogicalFunction ts, + LogicalFunction lon2, LogicalFunction lat2, LogicalFunction r2); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysEqTcbufferCbufferLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysEqTcbufferCbufferLogicalFunction.hpp new file mode 100644 index 0000000000..30f3679896 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysEqTcbufferCbufferLogicalFunction.hpp @@ -0,0 +1,53 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if the tcbuffer is always equal to the static cbuffer, 0.0 otherwise. + * + * Args: (lon1:FLOAT64, lat1:FLOAT64, r1:FLOAT64, ts:UINT64, + * lon2:FLOAT64, lat2:FLOAT64, r2:FLOAT64) -> FLOAT64. + */ +class AlwaysEqTcbufferCbufferLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysEqTcbufferCbuffer"; + + AlwaysEqTcbufferCbufferLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction r1, + LogicalFunction ts, + LogicalFunction lon2, LogicalFunction lat2, LogicalFunction r2); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysNeTcbufferCbufferLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysNeTcbufferCbufferLogicalFunction.hpp new file mode 100644 index 0000000000..ac3fc38be8 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysNeTcbufferCbufferLogicalFunction.hpp @@ -0,0 +1,53 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if the tcbuffer is always not equal to the static cbuffer, 0.0 otherwise. + * + * Args: (lon1:FLOAT64, lat1:FLOAT64, r1:FLOAT64, ts:UINT64, + * lon2:FLOAT64, lat2:FLOAT64, r2:FLOAT64) -> FLOAT64. + */ +class AlwaysNeTcbufferCbufferLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysNeTcbufferCbuffer"; + + AlwaysNeTcbufferCbufferLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction r1, + LogicalFunction ts, + LogicalFunction lon2, LogicalFunction lat2, LogicalFunction r2); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AtouchesTcbufferCbufferLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AtouchesTcbufferCbufferLogicalFunction.hpp new file mode 100644 index 0000000000..7743f36132 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AtouchesTcbufferCbufferLogicalFunction.hpp @@ -0,0 +1,53 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if the tcbuffer always touches the static cbuffer, 0.0 otherwise. + * + * Args: (lon1:FLOAT64, lat1:FLOAT64, r1:FLOAT64, ts:UINT64, + * lon2:FLOAT64, lat2:FLOAT64, r2:FLOAT64) -> FLOAT64. + */ +class AtouchesTcbufferCbufferLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AtouchesTcbufferCbuffer"; + + AtouchesTcbufferCbufferLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction r1, + LogicalFunction ts, + LogicalFunction lon2, LogicalFunction lat2, LogicalFunction r2); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EcontainsTcbufferCbufferLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EcontainsTcbufferCbufferLogicalFunction.hpp new file mode 100644 index 0000000000..c1dcb96dfc --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EcontainsTcbufferCbufferLogicalFunction.hpp @@ -0,0 +1,53 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if the tcbuffer ever contains the static cbuffer, 0.0 otherwise. + * + * Args: (lon1:FLOAT64, lat1:FLOAT64, r1:FLOAT64, ts:UINT64, + * lon2:FLOAT64, lat2:FLOAT64, r2:FLOAT64) -> FLOAT64. + */ +class EcontainsTcbufferCbufferLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EcontainsTcbufferCbuffer"; + + EcontainsTcbufferCbufferLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction r1, + LogicalFunction ts, + LogicalFunction lon2, LogicalFunction lat2, LogicalFunction r2); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EcoversTcbufferCbufferLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EcoversTcbufferCbufferLogicalFunction.hpp new file mode 100644 index 0000000000..979b070b74 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EcoversTcbufferCbufferLogicalFunction.hpp @@ -0,0 +1,53 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if the tcbuffer ever covers the static cbuffer, 0.0 otherwise. + * + * Args: (lon1:FLOAT64, lat1:FLOAT64, r1:FLOAT64, ts:UINT64, + * lon2:FLOAT64, lat2:FLOAT64, r2:FLOAT64) -> FLOAT64. + */ +class EcoversTcbufferCbufferLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EcoversTcbufferCbuffer"; + + EcoversTcbufferCbufferLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction r1, + LogicalFunction ts, + LogicalFunction lon2, LogicalFunction lat2, LogicalFunction r2); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EdisjointTcbufferCbufferLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EdisjointTcbufferCbufferLogicalFunction.hpp new file mode 100644 index 0000000000..26e2138d17 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EdisjointTcbufferCbufferLogicalFunction.hpp @@ -0,0 +1,53 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if the tcbuffer is ever disjoint from the static cbuffer, 0.0 otherwise. + * + * Args: (lon1:FLOAT64, lat1:FLOAT64, r1:FLOAT64, ts:UINT64, + * lon2:FLOAT64, lat2:FLOAT64, r2:FLOAT64) -> FLOAT64. + */ +class EdisjointTcbufferCbufferLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EdisjointTcbufferCbuffer"; + + EdisjointTcbufferCbufferLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction r1, + LogicalFunction ts, + LogicalFunction lon2, LogicalFunction lat2, LogicalFunction r2); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EintersectsTcbufferCbufferLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EintersectsTcbufferCbufferLogicalFunction.hpp new file mode 100644 index 0000000000..9caf9e2b38 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EintersectsTcbufferCbufferLogicalFunction.hpp @@ -0,0 +1,53 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if the tcbuffer ever intersects the static cbuffer, 0.0 otherwise. + * + * Args: (lon1:FLOAT64, lat1:FLOAT64, r1:FLOAT64, ts:UINT64, + * lon2:FLOAT64, lat2:FLOAT64, r2:FLOAT64) -> FLOAT64. + */ +class EintersectsTcbufferCbufferLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EintersectsTcbufferCbuffer"; + + EintersectsTcbufferCbufferLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction r1, + LogicalFunction ts, + LogicalFunction lon2, LogicalFunction lat2, LogicalFunction r2); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EtouchesTcbufferCbufferLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EtouchesTcbufferCbufferLogicalFunction.hpp new file mode 100644 index 0000000000..6bd09cb6cc --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EtouchesTcbufferCbufferLogicalFunction.hpp @@ -0,0 +1,53 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if the tcbuffer ever touches the static cbuffer, 0.0 otherwise. + * + * Args: (lon1:FLOAT64, lat1:FLOAT64, r1:FLOAT64, ts:UINT64, + * lon2:FLOAT64, lat2:FLOAT64, r2:FLOAT64) -> FLOAT64. + */ +class EtouchesTcbufferCbufferLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EtouchesTcbufferCbuffer"; + + EtouchesTcbufferCbufferLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction r1, + LogicalFunction ts, + LogicalFunction lon2, LogicalFunction lat2, LogicalFunction r2); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverEqTcbufferCbufferLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverEqTcbufferCbufferLogicalFunction.hpp new file mode 100644 index 0000000000..aef5e48e10 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverEqTcbufferCbufferLogicalFunction.hpp @@ -0,0 +1,53 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if the tcbuffer is ever equal to the static cbuffer, 0.0 otherwise. + * + * Args: (lon1:FLOAT64, lat1:FLOAT64, r1:FLOAT64, ts:UINT64, + * lon2:FLOAT64, lat2:FLOAT64, r2:FLOAT64) -> FLOAT64. + */ +class EverEqTcbufferCbufferLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverEqTcbufferCbuffer"; + + EverEqTcbufferCbufferLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction r1, + LogicalFunction ts, + LogicalFunction lon2, LogicalFunction lat2, LogicalFunction r2); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverNeTcbufferCbufferLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverNeTcbufferCbufferLogicalFunction.hpp new file mode 100644 index 0000000000..06fda3aed8 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverNeTcbufferCbufferLogicalFunction.hpp @@ -0,0 +1,53 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if the tcbuffer is ever not equal to the static cbuffer, 0.0 otherwise. + * + * Args: (lon1:FLOAT64, lat1:FLOAT64, r1:FLOAT64, ts:UINT64, + * lon2:FLOAT64, lat2:FLOAT64, r2:FLOAT64) -> FLOAT64. + */ +class EverNeTcbufferCbufferLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverNeTcbufferCbuffer"; + + EverNeTcbufferCbufferLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction r1, + LogicalFunction ts, + LogicalFunction lon2, LogicalFunction lat2, LogicalFunction r2); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/NadTcbufferCbufferLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/NadTcbufferCbufferLogicalFunction.hpp new file mode 100644 index 0000000000..d907348deb --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/NadTcbufferCbufferLogicalFunction.hpp @@ -0,0 +1,53 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns the nearest approach distance between the tcbuffer and a static cbuffer. + * + * Args: (lon1:FLOAT64, lat1:FLOAT64, r1:FLOAT64, ts:UINT64, + * lon2:FLOAT64, lat2:FLOAT64, r2:FLOAT64) -> FLOAT64. + */ +class NadTcbufferCbufferLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "NadTcbufferCbuffer"; + + NadTcbufferCbufferLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction r1, + LogicalFunction ts, + LogicalFunction lon2, LogicalFunction lat2, LogicalFunction r2); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AcontainsTcbufferCbufferLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AcontainsTcbufferCbufferLogicalFunction.cpp new file mode 100644 index 0000000000..7ff60a048d --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AcontainsTcbufferCbufferLogicalFunction.cpp @@ -0,0 +1,116 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AcontainsTcbufferCbufferLogicalFunction::AcontainsTcbufferCbufferLogicalFunction( + LogicalFunction lon1, LogicalFunction lat1, LogicalFunction r1, + LogicalFunction ts, + LogicalFunction lon2, LogicalFunction lat2, LogicalFunction r2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(7); + parameters.push_back(std::move(lon1)); + parameters.push_back(std::move(lat1)); + parameters.push_back(std::move(r1)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(lon2)); + parameters.push_back(std::move(lat2)); + parameters.push_back(std::move(r2)); +} + +DataType AcontainsTcbufferCbufferLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AcontainsTcbufferCbufferLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AcontainsTcbufferCbufferLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AcontainsTcbufferCbufferLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 7, + "AcontainsTcbufferCbufferLogicalFunction requires 7 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AcontainsTcbufferCbufferLogicalFunction::getType() const { return NAME; } + +bool AcontainsTcbufferCbufferLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AcontainsTcbufferCbufferLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction AcontainsTcbufferCbufferLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(7); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon1 must be FLOAT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat1 must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "r1 must be FLOAT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "lon2 must be FLOAT64"); + INVARIANT(c[5].getDataType().isType(DataType::Type::FLOAT64), "lat2 must be FLOAT64"); + INVARIANT(c[6].getDataType().isType(DataType::Type::FLOAT64), "r2 must be FLOAT64"); + return withChildren(c); +} + +SerializableFunction AcontainsTcbufferCbufferLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAcontainsTcbufferCbufferLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 7, + "AcontainsTcbufferCbufferLogicalFunction requires 7 children but got {}", + arguments.children.size()); + return AcontainsTcbufferCbufferLogicalFunction(std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4]), + std::move(arguments.children[5]), + std::move(arguments.children[6])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AcoversTcbufferCbufferLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AcoversTcbufferCbufferLogicalFunction.cpp new file mode 100644 index 0000000000..db8812d25d --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AcoversTcbufferCbufferLogicalFunction.cpp @@ -0,0 +1,116 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AcoversTcbufferCbufferLogicalFunction::AcoversTcbufferCbufferLogicalFunction( + LogicalFunction lon1, LogicalFunction lat1, LogicalFunction r1, + LogicalFunction ts, + LogicalFunction lon2, LogicalFunction lat2, LogicalFunction r2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(7); + parameters.push_back(std::move(lon1)); + parameters.push_back(std::move(lat1)); + parameters.push_back(std::move(r1)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(lon2)); + parameters.push_back(std::move(lat2)); + parameters.push_back(std::move(r2)); +} + +DataType AcoversTcbufferCbufferLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AcoversTcbufferCbufferLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AcoversTcbufferCbufferLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AcoversTcbufferCbufferLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 7, + "AcoversTcbufferCbufferLogicalFunction requires 7 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AcoversTcbufferCbufferLogicalFunction::getType() const { return NAME; } + +bool AcoversTcbufferCbufferLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AcoversTcbufferCbufferLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction AcoversTcbufferCbufferLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(7); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon1 must be FLOAT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat1 must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "r1 must be FLOAT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "lon2 must be FLOAT64"); + INVARIANT(c[5].getDataType().isType(DataType::Type::FLOAT64), "lat2 must be FLOAT64"); + INVARIANT(c[6].getDataType().isType(DataType::Type::FLOAT64), "r2 must be FLOAT64"); + return withChildren(c); +} + +SerializableFunction AcoversTcbufferCbufferLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAcoversTcbufferCbufferLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 7, + "AcoversTcbufferCbufferLogicalFunction requires 7 children but got {}", + arguments.children.size()); + return AcoversTcbufferCbufferLogicalFunction(std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4]), + std::move(arguments.children[5]), + std::move(arguments.children[6])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AdisjointTcbufferCbufferLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AdisjointTcbufferCbufferLogicalFunction.cpp new file mode 100644 index 0000000000..388c2a0b11 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AdisjointTcbufferCbufferLogicalFunction.cpp @@ -0,0 +1,116 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AdisjointTcbufferCbufferLogicalFunction::AdisjointTcbufferCbufferLogicalFunction( + LogicalFunction lon1, LogicalFunction lat1, LogicalFunction r1, + LogicalFunction ts, + LogicalFunction lon2, LogicalFunction lat2, LogicalFunction r2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(7); + parameters.push_back(std::move(lon1)); + parameters.push_back(std::move(lat1)); + parameters.push_back(std::move(r1)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(lon2)); + parameters.push_back(std::move(lat2)); + parameters.push_back(std::move(r2)); +} + +DataType AdisjointTcbufferCbufferLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AdisjointTcbufferCbufferLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AdisjointTcbufferCbufferLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AdisjointTcbufferCbufferLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 7, + "AdisjointTcbufferCbufferLogicalFunction requires 7 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AdisjointTcbufferCbufferLogicalFunction::getType() const { return NAME; } + +bool AdisjointTcbufferCbufferLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AdisjointTcbufferCbufferLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction AdisjointTcbufferCbufferLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(7); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon1 must be FLOAT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat1 must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "r1 must be FLOAT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "lon2 must be FLOAT64"); + INVARIANT(c[5].getDataType().isType(DataType::Type::FLOAT64), "lat2 must be FLOAT64"); + INVARIANT(c[6].getDataType().isType(DataType::Type::FLOAT64), "r2 must be FLOAT64"); + return withChildren(c); +} + +SerializableFunction AdisjointTcbufferCbufferLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAdisjointTcbufferCbufferLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 7, + "AdisjointTcbufferCbufferLogicalFunction requires 7 children but got {}", + arguments.children.size()); + return AdisjointTcbufferCbufferLogicalFunction(std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4]), + std::move(arguments.children[5]), + std::move(arguments.children[6])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AintersectsTcbufferCbufferLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AintersectsTcbufferCbufferLogicalFunction.cpp new file mode 100644 index 0000000000..bb82d18700 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AintersectsTcbufferCbufferLogicalFunction.cpp @@ -0,0 +1,116 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AintersectsTcbufferCbufferLogicalFunction::AintersectsTcbufferCbufferLogicalFunction( + LogicalFunction lon1, LogicalFunction lat1, LogicalFunction r1, + LogicalFunction ts, + LogicalFunction lon2, LogicalFunction lat2, LogicalFunction r2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(7); + parameters.push_back(std::move(lon1)); + parameters.push_back(std::move(lat1)); + parameters.push_back(std::move(r1)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(lon2)); + parameters.push_back(std::move(lat2)); + parameters.push_back(std::move(r2)); +} + +DataType AintersectsTcbufferCbufferLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AintersectsTcbufferCbufferLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AintersectsTcbufferCbufferLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AintersectsTcbufferCbufferLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 7, + "AintersectsTcbufferCbufferLogicalFunction requires 7 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AintersectsTcbufferCbufferLogicalFunction::getType() const { return NAME; } + +bool AintersectsTcbufferCbufferLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AintersectsTcbufferCbufferLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction AintersectsTcbufferCbufferLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(7); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon1 must be FLOAT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat1 must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "r1 must be FLOAT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "lon2 must be FLOAT64"); + INVARIANT(c[5].getDataType().isType(DataType::Type::FLOAT64), "lat2 must be FLOAT64"); + INVARIANT(c[6].getDataType().isType(DataType::Type::FLOAT64), "r2 must be FLOAT64"); + return withChildren(c); +} + +SerializableFunction AintersectsTcbufferCbufferLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAintersectsTcbufferCbufferLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 7, + "AintersectsTcbufferCbufferLogicalFunction requires 7 children but got {}", + arguments.children.size()); + return AintersectsTcbufferCbufferLogicalFunction(std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4]), + std::move(arguments.children[5]), + std::move(arguments.children[6])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysEqTcbufferCbufferLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysEqTcbufferCbufferLogicalFunction.cpp new file mode 100644 index 0000000000..96cde90966 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysEqTcbufferCbufferLogicalFunction.cpp @@ -0,0 +1,116 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AlwaysEqTcbufferCbufferLogicalFunction::AlwaysEqTcbufferCbufferLogicalFunction( + LogicalFunction lon1, LogicalFunction lat1, LogicalFunction r1, + LogicalFunction ts, + LogicalFunction lon2, LogicalFunction lat2, LogicalFunction r2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(7); + parameters.push_back(std::move(lon1)); + parameters.push_back(std::move(lat1)); + parameters.push_back(std::move(r1)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(lon2)); + parameters.push_back(std::move(lat2)); + parameters.push_back(std::move(r2)); +} + +DataType AlwaysEqTcbufferCbufferLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysEqTcbufferCbufferLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AlwaysEqTcbufferCbufferLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysEqTcbufferCbufferLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 7, + "AlwaysEqTcbufferCbufferLogicalFunction requires 7 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AlwaysEqTcbufferCbufferLogicalFunction::getType() const { return NAME; } + +bool AlwaysEqTcbufferCbufferLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AlwaysEqTcbufferCbufferLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction AlwaysEqTcbufferCbufferLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(7); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon1 must be FLOAT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat1 must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "r1 must be FLOAT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "lon2 must be FLOAT64"); + INVARIANT(c[5].getDataType().isType(DataType::Type::FLOAT64), "lat2 must be FLOAT64"); + INVARIANT(c[6].getDataType().isType(DataType::Type::FLOAT64), "r2 must be FLOAT64"); + return withChildren(c); +} + +SerializableFunction AlwaysEqTcbufferCbufferLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysEqTcbufferCbufferLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 7, + "AlwaysEqTcbufferCbufferLogicalFunction requires 7 children but got {}", + arguments.children.size()); + return AlwaysEqTcbufferCbufferLogicalFunction(std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4]), + std::move(arguments.children[5]), + std::move(arguments.children[6])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysNeTcbufferCbufferLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysNeTcbufferCbufferLogicalFunction.cpp new file mode 100644 index 0000000000..8c68690933 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysNeTcbufferCbufferLogicalFunction.cpp @@ -0,0 +1,116 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AlwaysNeTcbufferCbufferLogicalFunction::AlwaysNeTcbufferCbufferLogicalFunction( + LogicalFunction lon1, LogicalFunction lat1, LogicalFunction r1, + LogicalFunction ts, + LogicalFunction lon2, LogicalFunction lat2, LogicalFunction r2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(7); + parameters.push_back(std::move(lon1)); + parameters.push_back(std::move(lat1)); + parameters.push_back(std::move(r1)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(lon2)); + parameters.push_back(std::move(lat2)); + parameters.push_back(std::move(r2)); +} + +DataType AlwaysNeTcbufferCbufferLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysNeTcbufferCbufferLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AlwaysNeTcbufferCbufferLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysNeTcbufferCbufferLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 7, + "AlwaysNeTcbufferCbufferLogicalFunction requires 7 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AlwaysNeTcbufferCbufferLogicalFunction::getType() const { return NAME; } + +bool AlwaysNeTcbufferCbufferLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AlwaysNeTcbufferCbufferLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction AlwaysNeTcbufferCbufferLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(7); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon1 must be FLOAT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat1 must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "r1 must be FLOAT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "lon2 must be FLOAT64"); + INVARIANT(c[5].getDataType().isType(DataType::Type::FLOAT64), "lat2 must be FLOAT64"); + INVARIANT(c[6].getDataType().isType(DataType::Type::FLOAT64), "r2 must be FLOAT64"); + return withChildren(c); +} + +SerializableFunction AlwaysNeTcbufferCbufferLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysNeTcbufferCbufferLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 7, + "AlwaysNeTcbufferCbufferLogicalFunction requires 7 children but got {}", + arguments.children.size()); + return AlwaysNeTcbufferCbufferLogicalFunction(std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4]), + std::move(arguments.children[5]), + std::move(arguments.children[6])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AtouchesTcbufferCbufferLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AtouchesTcbufferCbufferLogicalFunction.cpp new file mode 100644 index 0000000000..00d3e3c794 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AtouchesTcbufferCbufferLogicalFunction.cpp @@ -0,0 +1,116 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AtouchesTcbufferCbufferLogicalFunction::AtouchesTcbufferCbufferLogicalFunction( + LogicalFunction lon1, LogicalFunction lat1, LogicalFunction r1, + LogicalFunction ts, + LogicalFunction lon2, LogicalFunction lat2, LogicalFunction r2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(7); + parameters.push_back(std::move(lon1)); + parameters.push_back(std::move(lat1)); + parameters.push_back(std::move(r1)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(lon2)); + parameters.push_back(std::move(lat2)); + parameters.push_back(std::move(r2)); +} + +DataType AtouchesTcbufferCbufferLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AtouchesTcbufferCbufferLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AtouchesTcbufferCbufferLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AtouchesTcbufferCbufferLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 7, + "AtouchesTcbufferCbufferLogicalFunction requires 7 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AtouchesTcbufferCbufferLogicalFunction::getType() const { return NAME; } + +bool AtouchesTcbufferCbufferLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AtouchesTcbufferCbufferLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction AtouchesTcbufferCbufferLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(7); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon1 must be FLOAT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat1 must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "r1 must be FLOAT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "lon2 must be FLOAT64"); + INVARIANT(c[5].getDataType().isType(DataType::Type::FLOAT64), "lat2 must be FLOAT64"); + INVARIANT(c[6].getDataType().isType(DataType::Type::FLOAT64), "r2 must be FLOAT64"); + return withChildren(c); +} + +SerializableFunction AtouchesTcbufferCbufferLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAtouchesTcbufferCbufferLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 7, + "AtouchesTcbufferCbufferLogicalFunction requires 7 children but got {}", + arguments.children.size()); + return AtouchesTcbufferCbufferLogicalFunction(std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4]), + std::move(arguments.children[5]), + std::move(arguments.children[6])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt index 1d83d1dc98..dd42371f6f 100644 --- a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt @@ -350,6 +350,21 @@ add_plugin(AcontainsTcbufferGeo LogicalFunction nes-logical-operators AcontainsT add_plugin(NadTcbufferGeo LogicalFunction nes-logical-operators NadTcbufferGeoLogicalFunction.cpp) add_plugin(EdwithinTcbufferGeo LogicalFunction nes-logical-operators EdwithinTcbufferGeoLogicalFunction.cpp) add_plugin(AdwithinTcbufferGeo LogicalFunction nes-logical-operators AdwithinTcbufferGeoLogicalFunction.cpp) +add_plugin(EintersectsTcbufferCbuffer LogicalFunction nes-logical-operators EintersectsTcbufferCbufferLogicalFunction.cpp) +add_plugin(AintersectsTcbufferCbuffer LogicalFunction nes-logical-operators AintersectsTcbufferCbufferLogicalFunction.cpp) +add_plugin(EcoversTcbufferCbuffer LogicalFunction nes-logical-operators EcoversTcbufferCbufferLogicalFunction.cpp) +add_plugin(AcoversTcbufferCbuffer LogicalFunction nes-logical-operators AcoversTcbufferCbufferLogicalFunction.cpp) +add_plugin(EdisjointTcbufferCbuffer LogicalFunction nes-logical-operators EdisjointTcbufferCbufferLogicalFunction.cpp) +add_plugin(AdisjointTcbufferCbuffer LogicalFunction nes-logical-operators AdisjointTcbufferCbufferLogicalFunction.cpp) +add_plugin(EtouchesTcbufferCbuffer LogicalFunction nes-logical-operators EtouchesTcbufferCbufferLogicalFunction.cpp) +add_plugin(AtouchesTcbufferCbuffer LogicalFunction nes-logical-operators AtouchesTcbufferCbufferLogicalFunction.cpp) +add_plugin(EcontainsTcbufferCbuffer LogicalFunction nes-logical-operators EcontainsTcbufferCbufferLogicalFunction.cpp) +add_plugin(AcontainsTcbufferCbuffer LogicalFunction nes-logical-operators AcontainsTcbufferCbufferLogicalFunction.cpp) +add_plugin(EverEqTcbufferCbuffer LogicalFunction nes-logical-operators EverEqTcbufferCbufferLogicalFunction.cpp) +add_plugin(AlwaysEqTcbufferCbuffer LogicalFunction nes-logical-operators AlwaysEqTcbufferCbufferLogicalFunction.cpp) +add_plugin(EverNeTcbufferCbuffer LogicalFunction nes-logical-operators EverNeTcbufferCbufferLogicalFunction.cpp) +add_plugin(AlwaysNeTcbufferCbuffer LogicalFunction nes-logical-operators AlwaysNeTcbufferCbufferLogicalFunction.cpp) +add_plugin(NadTcbufferCbuffer LogicalFunction nes-logical-operators NadTcbufferCbufferLogicalFunction.cpp) add_plugin(GeomIntersects2d LogicalFunction nes-logical-operators GeomIntersects2dLogicalFunction.cpp) add_plugin(GeomDwithin2d LogicalFunction nes-logical-operators GeomDwithin2dLogicalFunction.cpp) add_plugin(GeomContains LogicalFunction nes-logical-operators GeomContainsLogicalFunction.cpp) diff --git a/nes-logical-operators/src/Functions/Meos/EcontainsTcbufferCbufferLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EcontainsTcbufferCbufferLogicalFunction.cpp new file mode 100644 index 0000000000..13e792f6d3 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EcontainsTcbufferCbufferLogicalFunction.cpp @@ -0,0 +1,116 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EcontainsTcbufferCbufferLogicalFunction::EcontainsTcbufferCbufferLogicalFunction( + LogicalFunction lon1, LogicalFunction lat1, LogicalFunction r1, + LogicalFunction ts, + LogicalFunction lon2, LogicalFunction lat2, LogicalFunction r2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(7); + parameters.push_back(std::move(lon1)); + parameters.push_back(std::move(lat1)); + parameters.push_back(std::move(r1)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(lon2)); + parameters.push_back(std::move(lat2)); + parameters.push_back(std::move(r2)); +} + +DataType EcontainsTcbufferCbufferLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EcontainsTcbufferCbufferLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EcontainsTcbufferCbufferLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EcontainsTcbufferCbufferLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 7, + "EcontainsTcbufferCbufferLogicalFunction requires 7 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EcontainsTcbufferCbufferLogicalFunction::getType() const { return NAME; } + +bool EcontainsTcbufferCbufferLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EcontainsTcbufferCbufferLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction EcontainsTcbufferCbufferLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(7); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon1 must be FLOAT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat1 must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "r1 must be FLOAT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "lon2 must be FLOAT64"); + INVARIANT(c[5].getDataType().isType(DataType::Type::FLOAT64), "lat2 must be FLOAT64"); + INVARIANT(c[6].getDataType().isType(DataType::Type::FLOAT64), "r2 must be FLOAT64"); + return withChildren(c); +} + +SerializableFunction EcontainsTcbufferCbufferLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEcontainsTcbufferCbufferLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 7, + "EcontainsTcbufferCbufferLogicalFunction requires 7 children but got {}", + arguments.children.size()); + return EcontainsTcbufferCbufferLogicalFunction(std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4]), + std::move(arguments.children[5]), + std::move(arguments.children[6])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EcoversTcbufferCbufferLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EcoversTcbufferCbufferLogicalFunction.cpp new file mode 100644 index 0000000000..7fea846b75 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EcoversTcbufferCbufferLogicalFunction.cpp @@ -0,0 +1,116 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EcoversTcbufferCbufferLogicalFunction::EcoversTcbufferCbufferLogicalFunction( + LogicalFunction lon1, LogicalFunction lat1, LogicalFunction r1, + LogicalFunction ts, + LogicalFunction lon2, LogicalFunction lat2, LogicalFunction r2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(7); + parameters.push_back(std::move(lon1)); + parameters.push_back(std::move(lat1)); + parameters.push_back(std::move(r1)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(lon2)); + parameters.push_back(std::move(lat2)); + parameters.push_back(std::move(r2)); +} + +DataType EcoversTcbufferCbufferLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EcoversTcbufferCbufferLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EcoversTcbufferCbufferLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EcoversTcbufferCbufferLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 7, + "EcoversTcbufferCbufferLogicalFunction requires 7 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EcoversTcbufferCbufferLogicalFunction::getType() const { return NAME; } + +bool EcoversTcbufferCbufferLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EcoversTcbufferCbufferLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction EcoversTcbufferCbufferLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(7); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon1 must be FLOAT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat1 must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "r1 must be FLOAT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "lon2 must be FLOAT64"); + INVARIANT(c[5].getDataType().isType(DataType::Type::FLOAT64), "lat2 must be FLOAT64"); + INVARIANT(c[6].getDataType().isType(DataType::Type::FLOAT64), "r2 must be FLOAT64"); + return withChildren(c); +} + +SerializableFunction EcoversTcbufferCbufferLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEcoversTcbufferCbufferLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 7, + "EcoversTcbufferCbufferLogicalFunction requires 7 children but got {}", + arguments.children.size()); + return EcoversTcbufferCbufferLogicalFunction(std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4]), + std::move(arguments.children[5]), + std::move(arguments.children[6])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EdisjointTcbufferCbufferLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EdisjointTcbufferCbufferLogicalFunction.cpp new file mode 100644 index 0000000000..daa391816d --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EdisjointTcbufferCbufferLogicalFunction.cpp @@ -0,0 +1,116 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EdisjointTcbufferCbufferLogicalFunction::EdisjointTcbufferCbufferLogicalFunction( + LogicalFunction lon1, LogicalFunction lat1, LogicalFunction r1, + LogicalFunction ts, + LogicalFunction lon2, LogicalFunction lat2, LogicalFunction r2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(7); + parameters.push_back(std::move(lon1)); + parameters.push_back(std::move(lat1)); + parameters.push_back(std::move(r1)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(lon2)); + parameters.push_back(std::move(lat2)); + parameters.push_back(std::move(r2)); +} + +DataType EdisjointTcbufferCbufferLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EdisjointTcbufferCbufferLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EdisjointTcbufferCbufferLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EdisjointTcbufferCbufferLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 7, + "EdisjointTcbufferCbufferLogicalFunction requires 7 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EdisjointTcbufferCbufferLogicalFunction::getType() const { return NAME; } + +bool EdisjointTcbufferCbufferLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EdisjointTcbufferCbufferLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction EdisjointTcbufferCbufferLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(7); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon1 must be FLOAT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat1 must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "r1 must be FLOAT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "lon2 must be FLOAT64"); + INVARIANT(c[5].getDataType().isType(DataType::Type::FLOAT64), "lat2 must be FLOAT64"); + INVARIANT(c[6].getDataType().isType(DataType::Type::FLOAT64), "r2 must be FLOAT64"); + return withChildren(c); +} + +SerializableFunction EdisjointTcbufferCbufferLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEdisjointTcbufferCbufferLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 7, + "EdisjointTcbufferCbufferLogicalFunction requires 7 children but got {}", + arguments.children.size()); + return EdisjointTcbufferCbufferLogicalFunction(std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4]), + std::move(arguments.children[5]), + std::move(arguments.children[6])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EintersectsTcbufferCbufferLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EintersectsTcbufferCbufferLogicalFunction.cpp new file mode 100644 index 0000000000..a0e7cbe116 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EintersectsTcbufferCbufferLogicalFunction.cpp @@ -0,0 +1,116 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EintersectsTcbufferCbufferLogicalFunction::EintersectsTcbufferCbufferLogicalFunction( + LogicalFunction lon1, LogicalFunction lat1, LogicalFunction r1, + LogicalFunction ts, + LogicalFunction lon2, LogicalFunction lat2, LogicalFunction r2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(7); + parameters.push_back(std::move(lon1)); + parameters.push_back(std::move(lat1)); + parameters.push_back(std::move(r1)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(lon2)); + parameters.push_back(std::move(lat2)); + parameters.push_back(std::move(r2)); +} + +DataType EintersectsTcbufferCbufferLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EintersectsTcbufferCbufferLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EintersectsTcbufferCbufferLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EintersectsTcbufferCbufferLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 7, + "EintersectsTcbufferCbufferLogicalFunction requires 7 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EintersectsTcbufferCbufferLogicalFunction::getType() const { return NAME; } + +bool EintersectsTcbufferCbufferLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EintersectsTcbufferCbufferLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction EintersectsTcbufferCbufferLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(7); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon1 must be FLOAT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat1 must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "r1 must be FLOAT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "lon2 must be FLOAT64"); + INVARIANT(c[5].getDataType().isType(DataType::Type::FLOAT64), "lat2 must be FLOAT64"); + INVARIANT(c[6].getDataType().isType(DataType::Type::FLOAT64), "r2 must be FLOAT64"); + return withChildren(c); +} + +SerializableFunction EintersectsTcbufferCbufferLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEintersectsTcbufferCbufferLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 7, + "EintersectsTcbufferCbufferLogicalFunction requires 7 children but got {}", + arguments.children.size()); + return EintersectsTcbufferCbufferLogicalFunction(std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4]), + std::move(arguments.children[5]), + std::move(arguments.children[6])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EtouchesTcbufferCbufferLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EtouchesTcbufferCbufferLogicalFunction.cpp new file mode 100644 index 0000000000..5de03c5556 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EtouchesTcbufferCbufferLogicalFunction.cpp @@ -0,0 +1,116 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EtouchesTcbufferCbufferLogicalFunction::EtouchesTcbufferCbufferLogicalFunction( + LogicalFunction lon1, LogicalFunction lat1, LogicalFunction r1, + LogicalFunction ts, + LogicalFunction lon2, LogicalFunction lat2, LogicalFunction r2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(7); + parameters.push_back(std::move(lon1)); + parameters.push_back(std::move(lat1)); + parameters.push_back(std::move(r1)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(lon2)); + parameters.push_back(std::move(lat2)); + parameters.push_back(std::move(r2)); +} + +DataType EtouchesTcbufferCbufferLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EtouchesTcbufferCbufferLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EtouchesTcbufferCbufferLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EtouchesTcbufferCbufferLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 7, + "EtouchesTcbufferCbufferLogicalFunction requires 7 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EtouchesTcbufferCbufferLogicalFunction::getType() const { return NAME; } + +bool EtouchesTcbufferCbufferLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EtouchesTcbufferCbufferLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction EtouchesTcbufferCbufferLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(7); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon1 must be FLOAT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat1 must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "r1 must be FLOAT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "lon2 must be FLOAT64"); + INVARIANT(c[5].getDataType().isType(DataType::Type::FLOAT64), "lat2 must be FLOAT64"); + INVARIANT(c[6].getDataType().isType(DataType::Type::FLOAT64), "r2 must be FLOAT64"); + return withChildren(c); +} + +SerializableFunction EtouchesTcbufferCbufferLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEtouchesTcbufferCbufferLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 7, + "EtouchesTcbufferCbufferLogicalFunction requires 7 children but got {}", + arguments.children.size()); + return EtouchesTcbufferCbufferLogicalFunction(std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4]), + std::move(arguments.children[5]), + std::move(arguments.children[6])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverEqTcbufferCbufferLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverEqTcbufferCbufferLogicalFunction.cpp new file mode 100644 index 0000000000..b2ec476c85 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverEqTcbufferCbufferLogicalFunction.cpp @@ -0,0 +1,116 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EverEqTcbufferCbufferLogicalFunction::EverEqTcbufferCbufferLogicalFunction( + LogicalFunction lon1, LogicalFunction lat1, LogicalFunction r1, + LogicalFunction ts, + LogicalFunction lon2, LogicalFunction lat2, LogicalFunction r2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(7); + parameters.push_back(std::move(lon1)); + parameters.push_back(std::move(lat1)); + parameters.push_back(std::move(r1)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(lon2)); + parameters.push_back(std::move(lat2)); + parameters.push_back(std::move(r2)); +} + +DataType EverEqTcbufferCbufferLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverEqTcbufferCbufferLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EverEqTcbufferCbufferLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverEqTcbufferCbufferLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 7, + "EverEqTcbufferCbufferLogicalFunction requires 7 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EverEqTcbufferCbufferLogicalFunction::getType() const { return NAME; } + +bool EverEqTcbufferCbufferLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EverEqTcbufferCbufferLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction EverEqTcbufferCbufferLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(7); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon1 must be FLOAT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat1 must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "r1 must be FLOAT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "lon2 must be FLOAT64"); + INVARIANT(c[5].getDataType().isType(DataType::Type::FLOAT64), "lat2 must be FLOAT64"); + INVARIANT(c[6].getDataType().isType(DataType::Type::FLOAT64), "r2 must be FLOAT64"); + return withChildren(c); +} + +SerializableFunction EverEqTcbufferCbufferLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverEqTcbufferCbufferLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 7, + "EverEqTcbufferCbufferLogicalFunction requires 7 children but got {}", + arguments.children.size()); + return EverEqTcbufferCbufferLogicalFunction(std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4]), + std::move(arguments.children[5]), + std::move(arguments.children[6])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverNeTcbufferCbufferLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverNeTcbufferCbufferLogicalFunction.cpp new file mode 100644 index 0000000000..4a9fe1ec72 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverNeTcbufferCbufferLogicalFunction.cpp @@ -0,0 +1,116 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EverNeTcbufferCbufferLogicalFunction::EverNeTcbufferCbufferLogicalFunction( + LogicalFunction lon1, LogicalFunction lat1, LogicalFunction r1, + LogicalFunction ts, + LogicalFunction lon2, LogicalFunction lat2, LogicalFunction r2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(7); + parameters.push_back(std::move(lon1)); + parameters.push_back(std::move(lat1)); + parameters.push_back(std::move(r1)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(lon2)); + parameters.push_back(std::move(lat2)); + parameters.push_back(std::move(r2)); +} + +DataType EverNeTcbufferCbufferLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverNeTcbufferCbufferLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EverNeTcbufferCbufferLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverNeTcbufferCbufferLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 7, + "EverNeTcbufferCbufferLogicalFunction requires 7 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EverNeTcbufferCbufferLogicalFunction::getType() const { return NAME; } + +bool EverNeTcbufferCbufferLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EverNeTcbufferCbufferLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction EverNeTcbufferCbufferLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(7); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon1 must be FLOAT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat1 must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "r1 must be FLOAT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "lon2 must be FLOAT64"); + INVARIANT(c[5].getDataType().isType(DataType::Type::FLOAT64), "lat2 must be FLOAT64"); + INVARIANT(c[6].getDataType().isType(DataType::Type::FLOAT64), "r2 must be FLOAT64"); + return withChildren(c); +} + +SerializableFunction EverNeTcbufferCbufferLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverNeTcbufferCbufferLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 7, + "EverNeTcbufferCbufferLogicalFunction requires 7 children but got {}", + arguments.children.size()); + return EverNeTcbufferCbufferLogicalFunction(std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4]), + std::move(arguments.children[5]), + std::move(arguments.children[6])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/NadTcbufferCbufferLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/NadTcbufferCbufferLogicalFunction.cpp new file mode 100644 index 0000000000..3f5787223a --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/NadTcbufferCbufferLogicalFunction.cpp @@ -0,0 +1,116 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +NadTcbufferCbufferLogicalFunction::NadTcbufferCbufferLogicalFunction( + LogicalFunction lon1, LogicalFunction lat1, LogicalFunction r1, + LogicalFunction ts, + LogicalFunction lon2, LogicalFunction lat2, LogicalFunction r2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(7); + parameters.push_back(std::move(lon1)); + parameters.push_back(std::move(lat1)); + parameters.push_back(std::move(r1)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(lon2)); + parameters.push_back(std::move(lat2)); + parameters.push_back(std::move(r2)); +} + +DataType NadTcbufferCbufferLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction NadTcbufferCbufferLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector NadTcbufferCbufferLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction NadTcbufferCbufferLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 7, + "NadTcbufferCbufferLogicalFunction requires 7 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view NadTcbufferCbufferLogicalFunction::getType() const { return NAME; } + +bool NadTcbufferCbufferLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string NadTcbufferCbufferLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction NadTcbufferCbufferLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(7); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon1 must be FLOAT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat1 must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "r1 must be FLOAT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "lon2 must be FLOAT64"); + INVARIANT(c[5].getDataType().isType(DataType::Type::FLOAT64), "lat2 must be FLOAT64"); + INVARIANT(c[6].getDataType().isType(DataType::Type::FLOAT64), "r2 must be FLOAT64"); + return withChildren(c); +} + +SerializableFunction NadTcbufferCbufferLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterNadTcbufferCbufferLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 7, + "NadTcbufferCbufferLogicalFunction requires 7 children but got {}", + arguments.children.size()); + return NadTcbufferCbufferLogicalFunction(std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4]), + std::move(arguments.children[5]), + std::move(arguments.children[6])); +} + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AcontainsTcbufferCbufferPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AcontainsTcbufferCbufferPhysicalFunction.hpp new file mode 100644 index 0000000000..a73bc82985 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AcontainsTcbufferCbufferPhysicalFunction.hpp @@ -0,0 +1,36 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class AcontainsTcbufferCbufferPhysicalFunction : public PhysicalFunctionConcept { +public: + AcontainsTcbufferCbufferPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction r1, + PhysicalFunction ts, + PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction r2); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AcoversTcbufferCbufferPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AcoversTcbufferCbufferPhysicalFunction.hpp new file mode 100644 index 0000000000..476f2bbfc1 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AcoversTcbufferCbufferPhysicalFunction.hpp @@ -0,0 +1,36 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class AcoversTcbufferCbufferPhysicalFunction : public PhysicalFunctionConcept { +public: + AcoversTcbufferCbufferPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction r1, + PhysicalFunction ts, + PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction r2); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AdisjointTcbufferCbufferPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AdisjointTcbufferCbufferPhysicalFunction.hpp new file mode 100644 index 0000000000..603c3e4ff0 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AdisjointTcbufferCbufferPhysicalFunction.hpp @@ -0,0 +1,36 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class AdisjointTcbufferCbufferPhysicalFunction : public PhysicalFunctionConcept { +public: + AdisjointTcbufferCbufferPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction r1, + PhysicalFunction ts, + PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction r2); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AintersectsTcbufferCbufferPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AintersectsTcbufferCbufferPhysicalFunction.hpp new file mode 100644 index 0000000000..5bc44e7246 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AintersectsTcbufferCbufferPhysicalFunction.hpp @@ -0,0 +1,36 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class AintersectsTcbufferCbufferPhysicalFunction : public PhysicalFunctionConcept { +public: + AintersectsTcbufferCbufferPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction r1, + PhysicalFunction ts, + PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction r2); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysEqTcbufferCbufferPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysEqTcbufferCbufferPhysicalFunction.hpp new file mode 100644 index 0000000000..a8f501c728 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysEqTcbufferCbufferPhysicalFunction.hpp @@ -0,0 +1,36 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class AlwaysEqTcbufferCbufferPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysEqTcbufferCbufferPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction r1, + PhysicalFunction ts, + PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction r2); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysNeTcbufferCbufferPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysNeTcbufferCbufferPhysicalFunction.hpp new file mode 100644 index 0000000000..0b3cd9d6e8 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysNeTcbufferCbufferPhysicalFunction.hpp @@ -0,0 +1,36 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class AlwaysNeTcbufferCbufferPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysNeTcbufferCbufferPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction r1, + PhysicalFunction ts, + PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction r2); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AtouchesTcbufferCbufferPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AtouchesTcbufferCbufferPhysicalFunction.hpp new file mode 100644 index 0000000000..b2a1798964 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AtouchesTcbufferCbufferPhysicalFunction.hpp @@ -0,0 +1,36 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class AtouchesTcbufferCbufferPhysicalFunction : public PhysicalFunctionConcept { +public: + AtouchesTcbufferCbufferPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction r1, + PhysicalFunction ts, + PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction r2); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EcontainsTcbufferCbufferPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EcontainsTcbufferCbufferPhysicalFunction.hpp new file mode 100644 index 0000000000..e6407b3c69 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EcontainsTcbufferCbufferPhysicalFunction.hpp @@ -0,0 +1,36 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class EcontainsTcbufferCbufferPhysicalFunction : public PhysicalFunctionConcept { +public: + EcontainsTcbufferCbufferPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction r1, + PhysicalFunction ts, + PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction r2); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EcoversTcbufferCbufferPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EcoversTcbufferCbufferPhysicalFunction.hpp new file mode 100644 index 0000000000..fd663a6119 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EcoversTcbufferCbufferPhysicalFunction.hpp @@ -0,0 +1,36 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class EcoversTcbufferCbufferPhysicalFunction : public PhysicalFunctionConcept { +public: + EcoversTcbufferCbufferPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction r1, + PhysicalFunction ts, + PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction r2); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EdisjointTcbufferCbufferPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EdisjointTcbufferCbufferPhysicalFunction.hpp new file mode 100644 index 0000000000..3ecde1f078 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EdisjointTcbufferCbufferPhysicalFunction.hpp @@ -0,0 +1,36 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class EdisjointTcbufferCbufferPhysicalFunction : public PhysicalFunctionConcept { +public: + EdisjointTcbufferCbufferPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction r1, + PhysicalFunction ts, + PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction r2); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EintersectsTcbufferCbufferPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EintersectsTcbufferCbufferPhysicalFunction.hpp new file mode 100644 index 0000000000..d6cca443dc --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EintersectsTcbufferCbufferPhysicalFunction.hpp @@ -0,0 +1,36 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class EintersectsTcbufferCbufferPhysicalFunction : public PhysicalFunctionConcept { +public: + EintersectsTcbufferCbufferPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction r1, + PhysicalFunction ts, + PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction r2); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EtouchesTcbufferCbufferPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EtouchesTcbufferCbufferPhysicalFunction.hpp new file mode 100644 index 0000000000..14f2eda15d --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EtouchesTcbufferCbufferPhysicalFunction.hpp @@ -0,0 +1,36 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class EtouchesTcbufferCbufferPhysicalFunction : public PhysicalFunctionConcept { +public: + EtouchesTcbufferCbufferPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction r1, + PhysicalFunction ts, + PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction r2); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverEqTcbufferCbufferPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverEqTcbufferCbufferPhysicalFunction.hpp new file mode 100644 index 0000000000..873f6dc7fe --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverEqTcbufferCbufferPhysicalFunction.hpp @@ -0,0 +1,36 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class EverEqTcbufferCbufferPhysicalFunction : public PhysicalFunctionConcept { +public: + EverEqTcbufferCbufferPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction r1, + PhysicalFunction ts, + PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction r2); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverNeTcbufferCbufferPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverNeTcbufferCbufferPhysicalFunction.hpp new file mode 100644 index 0000000000..3a56d904c1 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverNeTcbufferCbufferPhysicalFunction.hpp @@ -0,0 +1,36 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class EverNeTcbufferCbufferPhysicalFunction : public PhysicalFunctionConcept { +public: + EverNeTcbufferCbufferPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction r1, + PhysicalFunction ts, + PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction r2); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/NadTcbufferCbufferPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/NadTcbufferCbufferPhysicalFunction.hpp new file mode 100644 index 0000000000..29dc60eac4 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/NadTcbufferCbufferPhysicalFunction.hpp @@ -0,0 +1,36 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class NadTcbufferCbufferPhysicalFunction : public PhysicalFunctionConcept { +public: + NadTcbufferCbufferPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction r1, + PhysicalFunction ts, + PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction r2); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AcontainsTcbufferCbufferPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AcontainsTcbufferCbufferPhysicalFunction.cpp new file mode 100644 index 0000000000..662bc2acc9 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AcontainsTcbufferCbufferPhysicalFunction.cpp @@ -0,0 +1,110 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +AcontainsTcbufferCbufferPhysicalFunction::AcontainsTcbufferCbufferPhysicalFunction( + PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction r1, + PhysicalFunction ts, + PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction r2) +{ + paramFns.reserve(7); + paramFns.push_back(std::move(lon1)); + paramFns.push_back(std::move(lat1)); + paramFns.push_back(std::move(r1)); + paramFns.push_back(std::move(ts)); + paramFns.push_back(std::move(lon2)); + paramFns.push_back(std::move(lat2)); + paramFns.push_back(std::move(r2)); +} + +VarVal AcontainsTcbufferCbufferPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto lon1 = paramFns[0].execute(record, arena).cast(); + auto lat1 = paramFns[1].execute(record, arena).cast(); + auto r1 = paramFns[2].execute(record, arena).cast(); + auto ts = paramFns[3].execute(record, arena).cast(); + auto lon2 = paramFns[4].execute(record, arena).cast(); + auto lat2 = paramFns[5].execute(record, arena).cast(); + auto r2 = paramFns[6].execute(record, arena).cast(); + + const auto result = nautilus::invoke( + +[](double lon1, double lat1, double r1, uint64_t ts, + double lon2, double lat2, double r2) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + // Build tcbuffer instant from (lon1,lat1,r1,ts) + std::string pt1 = fmt::format("POINT({} {})", lon1, lat1); + GSERIALIZED* pt1_gs = geom_in(pt1.c_str(), -1); + if (!pt1_gs) return 0.0; + Cbuffer* cb1 = cbuffer_make(pt1_gs, r1); + free(pt1_gs); + if (!cb1) return 0.0; + Temporal* tcb_inst = (Temporal*)tcbufferinst_make(cb1, (TimestampTz)ts); + free(cb1); + if (!tcb_inst) return 0.0; + // Build static cbuffer from (lon2,lat2,r2) + std::string pt2 = fmt::format("POINT({} {})", lon2, lat2); + GSERIALIZED* pt2_gs = geom_in(pt2.c_str(), -1); + if (!pt2_gs) { free(tcb_inst); return 0.0; } + Cbuffer* cb2 = cbuffer_make(pt2_gs, r2); + free(pt2_gs); + if (!cb2) { free(tcb_inst); return 0.0; } + int r = acontains_tcbuffer_cbuffer(tcb_inst, cb2); + free(tcb_inst); + free(cb2); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + lon1, lat1, r1, ts, lon2, lat2, r2); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAcontainsTcbufferCbufferPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 7, + "AcontainsTcbufferCbufferPhysicalFunction requires 7 children but got {}", + arguments.childFunctions.size()); + return AcontainsTcbufferCbufferPhysicalFunction(std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4]), + std::move(arguments.childFunctions[5]), + std::move(arguments.childFunctions[6])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AcoversTcbufferCbufferPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AcoversTcbufferCbufferPhysicalFunction.cpp new file mode 100644 index 0000000000..0eaba43de5 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AcoversTcbufferCbufferPhysicalFunction.cpp @@ -0,0 +1,110 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +AcoversTcbufferCbufferPhysicalFunction::AcoversTcbufferCbufferPhysicalFunction( + PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction r1, + PhysicalFunction ts, + PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction r2) +{ + paramFns.reserve(7); + paramFns.push_back(std::move(lon1)); + paramFns.push_back(std::move(lat1)); + paramFns.push_back(std::move(r1)); + paramFns.push_back(std::move(ts)); + paramFns.push_back(std::move(lon2)); + paramFns.push_back(std::move(lat2)); + paramFns.push_back(std::move(r2)); +} + +VarVal AcoversTcbufferCbufferPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto lon1 = paramFns[0].execute(record, arena).cast(); + auto lat1 = paramFns[1].execute(record, arena).cast(); + auto r1 = paramFns[2].execute(record, arena).cast(); + auto ts = paramFns[3].execute(record, arena).cast(); + auto lon2 = paramFns[4].execute(record, arena).cast(); + auto lat2 = paramFns[5].execute(record, arena).cast(); + auto r2 = paramFns[6].execute(record, arena).cast(); + + const auto result = nautilus::invoke( + +[](double lon1, double lat1, double r1, uint64_t ts, + double lon2, double lat2, double r2) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + // Build tcbuffer instant from (lon1,lat1,r1,ts) + std::string pt1 = fmt::format("POINT({} {})", lon1, lat1); + GSERIALIZED* pt1_gs = geom_in(pt1.c_str(), -1); + if (!pt1_gs) return 0.0; + Cbuffer* cb1 = cbuffer_make(pt1_gs, r1); + free(pt1_gs); + if (!cb1) return 0.0; + Temporal* tcb_inst = (Temporal*)tcbufferinst_make(cb1, (TimestampTz)ts); + free(cb1); + if (!tcb_inst) return 0.0; + // Build static cbuffer from (lon2,lat2,r2) + std::string pt2 = fmt::format("POINT({} {})", lon2, lat2); + GSERIALIZED* pt2_gs = geom_in(pt2.c_str(), -1); + if (!pt2_gs) { free(tcb_inst); return 0.0; } + Cbuffer* cb2 = cbuffer_make(pt2_gs, r2); + free(pt2_gs); + if (!cb2) { free(tcb_inst); return 0.0; } + int r = acovers_tcbuffer_cbuffer(tcb_inst, cb2); + free(tcb_inst); + free(cb2); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + lon1, lat1, r1, ts, lon2, lat2, r2); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAcoversTcbufferCbufferPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 7, + "AcoversTcbufferCbufferPhysicalFunction requires 7 children but got {}", + arguments.childFunctions.size()); + return AcoversTcbufferCbufferPhysicalFunction(std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4]), + std::move(arguments.childFunctions[5]), + std::move(arguments.childFunctions[6])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AdisjointTcbufferCbufferPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AdisjointTcbufferCbufferPhysicalFunction.cpp new file mode 100644 index 0000000000..16ca2ac2e4 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AdisjointTcbufferCbufferPhysicalFunction.cpp @@ -0,0 +1,110 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +AdisjointTcbufferCbufferPhysicalFunction::AdisjointTcbufferCbufferPhysicalFunction( + PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction r1, + PhysicalFunction ts, + PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction r2) +{ + paramFns.reserve(7); + paramFns.push_back(std::move(lon1)); + paramFns.push_back(std::move(lat1)); + paramFns.push_back(std::move(r1)); + paramFns.push_back(std::move(ts)); + paramFns.push_back(std::move(lon2)); + paramFns.push_back(std::move(lat2)); + paramFns.push_back(std::move(r2)); +} + +VarVal AdisjointTcbufferCbufferPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto lon1 = paramFns[0].execute(record, arena).cast(); + auto lat1 = paramFns[1].execute(record, arena).cast(); + auto r1 = paramFns[2].execute(record, arena).cast(); + auto ts = paramFns[3].execute(record, arena).cast(); + auto lon2 = paramFns[4].execute(record, arena).cast(); + auto lat2 = paramFns[5].execute(record, arena).cast(); + auto r2 = paramFns[6].execute(record, arena).cast(); + + const auto result = nautilus::invoke( + +[](double lon1, double lat1, double r1, uint64_t ts, + double lon2, double lat2, double r2) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + // Build tcbuffer instant from (lon1,lat1,r1,ts) + std::string pt1 = fmt::format("POINT({} {})", lon1, lat1); + GSERIALIZED* pt1_gs = geom_in(pt1.c_str(), -1); + if (!pt1_gs) return 0.0; + Cbuffer* cb1 = cbuffer_make(pt1_gs, r1); + free(pt1_gs); + if (!cb1) return 0.0; + Temporal* tcb_inst = (Temporal*)tcbufferinst_make(cb1, (TimestampTz)ts); + free(cb1); + if (!tcb_inst) return 0.0; + // Build static cbuffer from (lon2,lat2,r2) + std::string pt2 = fmt::format("POINT({} {})", lon2, lat2); + GSERIALIZED* pt2_gs = geom_in(pt2.c_str(), -1); + if (!pt2_gs) { free(tcb_inst); return 0.0; } + Cbuffer* cb2 = cbuffer_make(pt2_gs, r2); + free(pt2_gs); + if (!cb2) { free(tcb_inst); return 0.0; } + int r = adisjoint_tcbuffer_cbuffer(tcb_inst, cb2); + free(tcb_inst); + free(cb2); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + lon1, lat1, r1, ts, lon2, lat2, r2); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAdisjointTcbufferCbufferPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 7, + "AdisjointTcbufferCbufferPhysicalFunction requires 7 children but got {}", + arguments.childFunctions.size()); + return AdisjointTcbufferCbufferPhysicalFunction(std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4]), + std::move(arguments.childFunctions[5]), + std::move(arguments.childFunctions[6])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AintersectsTcbufferCbufferPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AintersectsTcbufferCbufferPhysicalFunction.cpp new file mode 100644 index 0000000000..5b7158e668 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AintersectsTcbufferCbufferPhysicalFunction.cpp @@ -0,0 +1,110 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +AintersectsTcbufferCbufferPhysicalFunction::AintersectsTcbufferCbufferPhysicalFunction( + PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction r1, + PhysicalFunction ts, + PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction r2) +{ + paramFns.reserve(7); + paramFns.push_back(std::move(lon1)); + paramFns.push_back(std::move(lat1)); + paramFns.push_back(std::move(r1)); + paramFns.push_back(std::move(ts)); + paramFns.push_back(std::move(lon2)); + paramFns.push_back(std::move(lat2)); + paramFns.push_back(std::move(r2)); +} + +VarVal AintersectsTcbufferCbufferPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto lon1 = paramFns[0].execute(record, arena).cast(); + auto lat1 = paramFns[1].execute(record, arena).cast(); + auto r1 = paramFns[2].execute(record, arena).cast(); + auto ts = paramFns[3].execute(record, arena).cast(); + auto lon2 = paramFns[4].execute(record, arena).cast(); + auto lat2 = paramFns[5].execute(record, arena).cast(); + auto r2 = paramFns[6].execute(record, arena).cast(); + + const auto result = nautilus::invoke( + +[](double lon1, double lat1, double r1, uint64_t ts, + double lon2, double lat2, double r2) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + // Build tcbuffer instant from (lon1,lat1,r1,ts) + std::string pt1 = fmt::format("POINT({} {})", lon1, lat1); + GSERIALIZED* pt1_gs = geom_in(pt1.c_str(), -1); + if (!pt1_gs) return 0.0; + Cbuffer* cb1 = cbuffer_make(pt1_gs, r1); + free(pt1_gs); + if (!cb1) return 0.0; + Temporal* tcb_inst = (Temporal*)tcbufferinst_make(cb1, (TimestampTz)ts); + free(cb1); + if (!tcb_inst) return 0.0; + // Build static cbuffer from (lon2,lat2,r2) + std::string pt2 = fmt::format("POINT({} {})", lon2, lat2); + GSERIALIZED* pt2_gs = geom_in(pt2.c_str(), -1); + if (!pt2_gs) { free(tcb_inst); return 0.0; } + Cbuffer* cb2 = cbuffer_make(pt2_gs, r2); + free(pt2_gs); + if (!cb2) { free(tcb_inst); return 0.0; } + int r = aintersects_tcbuffer_cbuffer(tcb_inst, cb2); + free(tcb_inst); + free(cb2); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + lon1, lat1, r1, ts, lon2, lat2, r2); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAintersectsTcbufferCbufferPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 7, + "AintersectsTcbufferCbufferPhysicalFunction requires 7 children but got {}", + arguments.childFunctions.size()); + return AintersectsTcbufferCbufferPhysicalFunction(std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4]), + std::move(arguments.childFunctions[5]), + std::move(arguments.childFunctions[6])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysEqTcbufferCbufferPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysEqTcbufferCbufferPhysicalFunction.cpp new file mode 100644 index 0000000000..886379bb2c --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysEqTcbufferCbufferPhysicalFunction.cpp @@ -0,0 +1,110 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +AlwaysEqTcbufferCbufferPhysicalFunction::AlwaysEqTcbufferCbufferPhysicalFunction( + PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction r1, + PhysicalFunction ts, + PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction r2) +{ + paramFns.reserve(7); + paramFns.push_back(std::move(lon1)); + paramFns.push_back(std::move(lat1)); + paramFns.push_back(std::move(r1)); + paramFns.push_back(std::move(ts)); + paramFns.push_back(std::move(lon2)); + paramFns.push_back(std::move(lat2)); + paramFns.push_back(std::move(r2)); +} + +VarVal AlwaysEqTcbufferCbufferPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto lon1 = paramFns[0].execute(record, arena).cast(); + auto lat1 = paramFns[1].execute(record, arena).cast(); + auto r1 = paramFns[2].execute(record, arena).cast(); + auto ts = paramFns[3].execute(record, arena).cast(); + auto lon2 = paramFns[4].execute(record, arena).cast(); + auto lat2 = paramFns[5].execute(record, arena).cast(); + auto r2 = paramFns[6].execute(record, arena).cast(); + + const auto result = nautilus::invoke( + +[](double lon1, double lat1, double r1, uint64_t ts, + double lon2, double lat2, double r2) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + // Build tcbuffer instant from (lon1,lat1,r1,ts) + std::string pt1 = fmt::format("POINT({} {})", lon1, lat1); + GSERIALIZED* pt1_gs = geom_in(pt1.c_str(), -1); + if (!pt1_gs) return 0.0; + Cbuffer* cb1 = cbuffer_make(pt1_gs, r1); + free(pt1_gs); + if (!cb1) return 0.0; + Temporal* tcb_inst = (Temporal*)tcbufferinst_make(cb1, (TimestampTz)ts); + free(cb1); + if (!tcb_inst) return 0.0; + // Build static cbuffer from (lon2,lat2,r2) + std::string pt2 = fmt::format("POINT({} {})", lon2, lat2); + GSERIALIZED* pt2_gs = geom_in(pt2.c_str(), -1); + if (!pt2_gs) { free(tcb_inst); return 0.0; } + Cbuffer* cb2 = cbuffer_make(pt2_gs, r2); + free(pt2_gs); + if (!cb2) { free(tcb_inst); return 0.0; } + int r = always_eq_tcbuffer_cbuffer(tcb_inst, cb2); + free(tcb_inst); + free(cb2); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + lon1, lat1, r1, ts, lon2, lat2, r2); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysEqTcbufferCbufferPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 7, + "AlwaysEqTcbufferCbufferPhysicalFunction requires 7 children but got {}", + arguments.childFunctions.size()); + return AlwaysEqTcbufferCbufferPhysicalFunction(std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4]), + std::move(arguments.childFunctions[5]), + std::move(arguments.childFunctions[6])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysNeTcbufferCbufferPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysNeTcbufferCbufferPhysicalFunction.cpp new file mode 100644 index 0000000000..acf39e8966 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysNeTcbufferCbufferPhysicalFunction.cpp @@ -0,0 +1,110 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +AlwaysNeTcbufferCbufferPhysicalFunction::AlwaysNeTcbufferCbufferPhysicalFunction( + PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction r1, + PhysicalFunction ts, + PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction r2) +{ + paramFns.reserve(7); + paramFns.push_back(std::move(lon1)); + paramFns.push_back(std::move(lat1)); + paramFns.push_back(std::move(r1)); + paramFns.push_back(std::move(ts)); + paramFns.push_back(std::move(lon2)); + paramFns.push_back(std::move(lat2)); + paramFns.push_back(std::move(r2)); +} + +VarVal AlwaysNeTcbufferCbufferPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto lon1 = paramFns[0].execute(record, arena).cast(); + auto lat1 = paramFns[1].execute(record, arena).cast(); + auto r1 = paramFns[2].execute(record, arena).cast(); + auto ts = paramFns[3].execute(record, arena).cast(); + auto lon2 = paramFns[4].execute(record, arena).cast(); + auto lat2 = paramFns[5].execute(record, arena).cast(); + auto r2 = paramFns[6].execute(record, arena).cast(); + + const auto result = nautilus::invoke( + +[](double lon1, double lat1, double r1, uint64_t ts, + double lon2, double lat2, double r2) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + // Build tcbuffer instant from (lon1,lat1,r1,ts) + std::string pt1 = fmt::format("POINT({} {})", lon1, lat1); + GSERIALIZED* pt1_gs = geom_in(pt1.c_str(), -1); + if (!pt1_gs) return 0.0; + Cbuffer* cb1 = cbuffer_make(pt1_gs, r1); + free(pt1_gs); + if (!cb1) return 0.0; + Temporal* tcb_inst = (Temporal*)tcbufferinst_make(cb1, (TimestampTz)ts); + free(cb1); + if (!tcb_inst) return 0.0; + // Build static cbuffer from (lon2,lat2,r2) + std::string pt2 = fmt::format("POINT({} {})", lon2, lat2); + GSERIALIZED* pt2_gs = geom_in(pt2.c_str(), -1); + if (!pt2_gs) { free(tcb_inst); return 0.0; } + Cbuffer* cb2 = cbuffer_make(pt2_gs, r2); + free(pt2_gs); + if (!cb2) { free(tcb_inst); return 0.0; } + int r = always_ne_tcbuffer_cbuffer(tcb_inst, cb2); + free(tcb_inst); + free(cb2); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + lon1, lat1, r1, ts, lon2, lat2, r2); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysNeTcbufferCbufferPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 7, + "AlwaysNeTcbufferCbufferPhysicalFunction requires 7 children but got {}", + arguments.childFunctions.size()); + return AlwaysNeTcbufferCbufferPhysicalFunction(std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4]), + std::move(arguments.childFunctions[5]), + std::move(arguments.childFunctions[6])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AtouchesTcbufferCbufferPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AtouchesTcbufferCbufferPhysicalFunction.cpp new file mode 100644 index 0000000000..196327aa50 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AtouchesTcbufferCbufferPhysicalFunction.cpp @@ -0,0 +1,110 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +AtouchesTcbufferCbufferPhysicalFunction::AtouchesTcbufferCbufferPhysicalFunction( + PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction r1, + PhysicalFunction ts, + PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction r2) +{ + paramFns.reserve(7); + paramFns.push_back(std::move(lon1)); + paramFns.push_back(std::move(lat1)); + paramFns.push_back(std::move(r1)); + paramFns.push_back(std::move(ts)); + paramFns.push_back(std::move(lon2)); + paramFns.push_back(std::move(lat2)); + paramFns.push_back(std::move(r2)); +} + +VarVal AtouchesTcbufferCbufferPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto lon1 = paramFns[0].execute(record, arena).cast(); + auto lat1 = paramFns[1].execute(record, arena).cast(); + auto r1 = paramFns[2].execute(record, arena).cast(); + auto ts = paramFns[3].execute(record, arena).cast(); + auto lon2 = paramFns[4].execute(record, arena).cast(); + auto lat2 = paramFns[5].execute(record, arena).cast(); + auto r2 = paramFns[6].execute(record, arena).cast(); + + const auto result = nautilus::invoke( + +[](double lon1, double lat1, double r1, uint64_t ts, + double lon2, double lat2, double r2) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + // Build tcbuffer instant from (lon1,lat1,r1,ts) + std::string pt1 = fmt::format("POINT({} {})", lon1, lat1); + GSERIALIZED* pt1_gs = geom_in(pt1.c_str(), -1); + if (!pt1_gs) return 0.0; + Cbuffer* cb1 = cbuffer_make(pt1_gs, r1); + free(pt1_gs); + if (!cb1) return 0.0; + Temporal* tcb_inst = (Temporal*)tcbufferinst_make(cb1, (TimestampTz)ts); + free(cb1); + if (!tcb_inst) return 0.0; + // Build static cbuffer from (lon2,lat2,r2) + std::string pt2 = fmt::format("POINT({} {})", lon2, lat2); + GSERIALIZED* pt2_gs = geom_in(pt2.c_str(), -1); + if (!pt2_gs) { free(tcb_inst); return 0.0; } + Cbuffer* cb2 = cbuffer_make(pt2_gs, r2); + free(pt2_gs); + if (!cb2) { free(tcb_inst); return 0.0; } + int r = atouches_tcbuffer_cbuffer(tcb_inst, cb2); + free(tcb_inst); + free(cb2); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + lon1, lat1, r1, ts, lon2, lat2, r2); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAtouchesTcbufferCbufferPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 7, + "AtouchesTcbufferCbufferPhysicalFunction requires 7 children but got {}", + arguments.childFunctions.size()); + return AtouchesTcbufferCbufferPhysicalFunction(std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4]), + std::move(arguments.childFunctions[5]), + std::move(arguments.childFunctions[6])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt index 33e9b9a416..8a7351169f 100644 --- a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt @@ -349,6 +349,21 @@ add_plugin(AcontainsTcbufferGeo PhysicalFunction nes-physical-operators Acontain add_plugin(NadTcbufferGeo PhysicalFunction nes-physical-operators NadTcbufferGeoPhysicalFunction.cpp) add_plugin(EdwithinTcbufferGeo PhysicalFunction nes-physical-operators EdwithinTcbufferGeoPhysicalFunction.cpp) add_plugin(AdwithinTcbufferGeo PhysicalFunction nes-physical-operators AdwithinTcbufferGeoPhysicalFunction.cpp) +add_plugin(EintersectsTcbufferCbuffer PhysicalFunction nes-physical-operators EintersectsTcbufferCbufferPhysicalFunction.cpp) +add_plugin(AintersectsTcbufferCbuffer PhysicalFunction nes-physical-operators AintersectsTcbufferCbufferPhysicalFunction.cpp) +add_plugin(EcoversTcbufferCbuffer PhysicalFunction nes-physical-operators EcoversTcbufferCbufferPhysicalFunction.cpp) +add_plugin(AcoversTcbufferCbuffer PhysicalFunction nes-physical-operators AcoversTcbufferCbufferPhysicalFunction.cpp) +add_plugin(EdisjointTcbufferCbuffer PhysicalFunction nes-physical-operators EdisjointTcbufferCbufferPhysicalFunction.cpp) +add_plugin(AdisjointTcbufferCbuffer PhysicalFunction nes-physical-operators AdisjointTcbufferCbufferPhysicalFunction.cpp) +add_plugin(EtouchesTcbufferCbuffer PhysicalFunction nes-physical-operators EtouchesTcbufferCbufferPhysicalFunction.cpp) +add_plugin(AtouchesTcbufferCbuffer PhysicalFunction nes-physical-operators AtouchesTcbufferCbufferPhysicalFunction.cpp) +add_plugin(EcontainsTcbufferCbuffer PhysicalFunction nes-physical-operators EcontainsTcbufferCbufferPhysicalFunction.cpp) +add_plugin(AcontainsTcbufferCbuffer PhysicalFunction nes-physical-operators AcontainsTcbufferCbufferPhysicalFunction.cpp) +add_plugin(EverEqTcbufferCbuffer PhysicalFunction nes-physical-operators EverEqTcbufferCbufferPhysicalFunction.cpp) +add_plugin(AlwaysEqTcbufferCbuffer PhysicalFunction nes-physical-operators AlwaysEqTcbufferCbufferPhysicalFunction.cpp) +add_plugin(EverNeTcbufferCbuffer PhysicalFunction nes-physical-operators EverNeTcbufferCbufferPhysicalFunction.cpp) +add_plugin(AlwaysNeTcbufferCbuffer PhysicalFunction nes-physical-operators AlwaysNeTcbufferCbufferPhysicalFunction.cpp) +add_plugin(NadTcbufferCbuffer PhysicalFunction nes-physical-operators NadTcbufferCbufferPhysicalFunction.cpp) add_plugin(GeomIntersects2d PhysicalFunction nes-physical-operators GeomIntersects2dPhysicalFunction.cpp) add_plugin(GeomDwithin2d PhysicalFunction nes-physical-operators GeomDwithin2dPhysicalFunction.cpp) add_plugin(GeomContains PhysicalFunction nes-physical-operators GeomContainsPhysicalFunction.cpp) diff --git a/nes-physical-operators/src/Functions/Meos/EcontainsTcbufferCbufferPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EcontainsTcbufferCbufferPhysicalFunction.cpp new file mode 100644 index 0000000000..dc7704cda5 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EcontainsTcbufferCbufferPhysicalFunction.cpp @@ -0,0 +1,110 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +EcontainsTcbufferCbufferPhysicalFunction::EcontainsTcbufferCbufferPhysicalFunction( + PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction r1, + PhysicalFunction ts, + PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction r2) +{ + paramFns.reserve(7); + paramFns.push_back(std::move(lon1)); + paramFns.push_back(std::move(lat1)); + paramFns.push_back(std::move(r1)); + paramFns.push_back(std::move(ts)); + paramFns.push_back(std::move(lon2)); + paramFns.push_back(std::move(lat2)); + paramFns.push_back(std::move(r2)); +} + +VarVal EcontainsTcbufferCbufferPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto lon1 = paramFns[0].execute(record, arena).cast(); + auto lat1 = paramFns[1].execute(record, arena).cast(); + auto r1 = paramFns[2].execute(record, arena).cast(); + auto ts = paramFns[3].execute(record, arena).cast(); + auto lon2 = paramFns[4].execute(record, arena).cast(); + auto lat2 = paramFns[5].execute(record, arena).cast(); + auto r2 = paramFns[6].execute(record, arena).cast(); + + const auto result = nautilus::invoke( + +[](double lon1, double lat1, double r1, uint64_t ts, + double lon2, double lat2, double r2) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + // Build tcbuffer instant from (lon1,lat1,r1,ts) + std::string pt1 = fmt::format("POINT({} {})", lon1, lat1); + GSERIALIZED* pt1_gs = geom_in(pt1.c_str(), -1); + if (!pt1_gs) return 0.0; + Cbuffer* cb1 = cbuffer_make(pt1_gs, r1); + free(pt1_gs); + if (!cb1) return 0.0; + Temporal* tcb_inst = (Temporal*)tcbufferinst_make(cb1, (TimestampTz)ts); + free(cb1); + if (!tcb_inst) return 0.0; + // Build static cbuffer from (lon2,lat2,r2) + std::string pt2 = fmt::format("POINT({} {})", lon2, lat2); + GSERIALIZED* pt2_gs = geom_in(pt2.c_str(), -1); + if (!pt2_gs) { free(tcb_inst); return 0.0; } + Cbuffer* cb2 = cbuffer_make(pt2_gs, r2); + free(pt2_gs); + if (!cb2) { free(tcb_inst); return 0.0; } + int r = econtains_tcbuffer_cbuffer(tcb_inst, cb2); + free(tcb_inst); + free(cb2); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + lon1, lat1, r1, ts, lon2, lat2, r2); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEcontainsTcbufferCbufferPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 7, + "EcontainsTcbufferCbufferPhysicalFunction requires 7 children but got {}", + arguments.childFunctions.size()); + return EcontainsTcbufferCbufferPhysicalFunction(std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4]), + std::move(arguments.childFunctions[5]), + std::move(arguments.childFunctions[6])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EcoversTcbufferCbufferPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EcoversTcbufferCbufferPhysicalFunction.cpp new file mode 100644 index 0000000000..81e1957626 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EcoversTcbufferCbufferPhysicalFunction.cpp @@ -0,0 +1,110 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +EcoversTcbufferCbufferPhysicalFunction::EcoversTcbufferCbufferPhysicalFunction( + PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction r1, + PhysicalFunction ts, + PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction r2) +{ + paramFns.reserve(7); + paramFns.push_back(std::move(lon1)); + paramFns.push_back(std::move(lat1)); + paramFns.push_back(std::move(r1)); + paramFns.push_back(std::move(ts)); + paramFns.push_back(std::move(lon2)); + paramFns.push_back(std::move(lat2)); + paramFns.push_back(std::move(r2)); +} + +VarVal EcoversTcbufferCbufferPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto lon1 = paramFns[0].execute(record, arena).cast(); + auto lat1 = paramFns[1].execute(record, arena).cast(); + auto r1 = paramFns[2].execute(record, arena).cast(); + auto ts = paramFns[3].execute(record, arena).cast(); + auto lon2 = paramFns[4].execute(record, arena).cast(); + auto lat2 = paramFns[5].execute(record, arena).cast(); + auto r2 = paramFns[6].execute(record, arena).cast(); + + const auto result = nautilus::invoke( + +[](double lon1, double lat1, double r1, uint64_t ts, + double lon2, double lat2, double r2) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + // Build tcbuffer instant from (lon1,lat1,r1,ts) + std::string pt1 = fmt::format("POINT({} {})", lon1, lat1); + GSERIALIZED* pt1_gs = geom_in(pt1.c_str(), -1); + if (!pt1_gs) return 0.0; + Cbuffer* cb1 = cbuffer_make(pt1_gs, r1); + free(pt1_gs); + if (!cb1) return 0.0; + Temporal* tcb_inst = (Temporal*)tcbufferinst_make(cb1, (TimestampTz)ts); + free(cb1); + if (!tcb_inst) return 0.0; + // Build static cbuffer from (lon2,lat2,r2) + std::string pt2 = fmt::format("POINT({} {})", lon2, lat2); + GSERIALIZED* pt2_gs = geom_in(pt2.c_str(), -1); + if (!pt2_gs) { free(tcb_inst); return 0.0; } + Cbuffer* cb2 = cbuffer_make(pt2_gs, r2); + free(pt2_gs); + if (!cb2) { free(tcb_inst); return 0.0; } + int r = ecovers_tcbuffer_cbuffer(tcb_inst, cb2); + free(tcb_inst); + free(cb2); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + lon1, lat1, r1, ts, lon2, lat2, r2); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEcoversTcbufferCbufferPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 7, + "EcoversTcbufferCbufferPhysicalFunction requires 7 children but got {}", + arguments.childFunctions.size()); + return EcoversTcbufferCbufferPhysicalFunction(std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4]), + std::move(arguments.childFunctions[5]), + std::move(arguments.childFunctions[6])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EdisjointTcbufferCbufferPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EdisjointTcbufferCbufferPhysicalFunction.cpp new file mode 100644 index 0000000000..4b0f9b46a3 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EdisjointTcbufferCbufferPhysicalFunction.cpp @@ -0,0 +1,110 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +EdisjointTcbufferCbufferPhysicalFunction::EdisjointTcbufferCbufferPhysicalFunction( + PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction r1, + PhysicalFunction ts, + PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction r2) +{ + paramFns.reserve(7); + paramFns.push_back(std::move(lon1)); + paramFns.push_back(std::move(lat1)); + paramFns.push_back(std::move(r1)); + paramFns.push_back(std::move(ts)); + paramFns.push_back(std::move(lon2)); + paramFns.push_back(std::move(lat2)); + paramFns.push_back(std::move(r2)); +} + +VarVal EdisjointTcbufferCbufferPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto lon1 = paramFns[0].execute(record, arena).cast(); + auto lat1 = paramFns[1].execute(record, arena).cast(); + auto r1 = paramFns[2].execute(record, arena).cast(); + auto ts = paramFns[3].execute(record, arena).cast(); + auto lon2 = paramFns[4].execute(record, arena).cast(); + auto lat2 = paramFns[5].execute(record, arena).cast(); + auto r2 = paramFns[6].execute(record, arena).cast(); + + const auto result = nautilus::invoke( + +[](double lon1, double lat1, double r1, uint64_t ts, + double lon2, double lat2, double r2) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + // Build tcbuffer instant from (lon1,lat1,r1,ts) + std::string pt1 = fmt::format("POINT({} {})", lon1, lat1); + GSERIALIZED* pt1_gs = geom_in(pt1.c_str(), -1); + if (!pt1_gs) return 0.0; + Cbuffer* cb1 = cbuffer_make(pt1_gs, r1); + free(pt1_gs); + if (!cb1) return 0.0; + Temporal* tcb_inst = (Temporal*)tcbufferinst_make(cb1, (TimestampTz)ts); + free(cb1); + if (!tcb_inst) return 0.0; + // Build static cbuffer from (lon2,lat2,r2) + std::string pt2 = fmt::format("POINT({} {})", lon2, lat2); + GSERIALIZED* pt2_gs = geom_in(pt2.c_str(), -1); + if (!pt2_gs) { free(tcb_inst); return 0.0; } + Cbuffer* cb2 = cbuffer_make(pt2_gs, r2); + free(pt2_gs); + if (!cb2) { free(tcb_inst); return 0.0; } + int r = edisjoint_tcbuffer_cbuffer(tcb_inst, cb2); + free(tcb_inst); + free(cb2); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + lon1, lat1, r1, ts, lon2, lat2, r2); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEdisjointTcbufferCbufferPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 7, + "EdisjointTcbufferCbufferPhysicalFunction requires 7 children but got {}", + arguments.childFunctions.size()); + return EdisjointTcbufferCbufferPhysicalFunction(std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4]), + std::move(arguments.childFunctions[5]), + std::move(arguments.childFunctions[6])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EintersectsTcbufferCbufferPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EintersectsTcbufferCbufferPhysicalFunction.cpp new file mode 100644 index 0000000000..7036b9fc2d --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EintersectsTcbufferCbufferPhysicalFunction.cpp @@ -0,0 +1,110 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +EintersectsTcbufferCbufferPhysicalFunction::EintersectsTcbufferCbufferPhysicalFunction( + PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction r1, + PhysicalFunction ts, + PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction r2) +{ + paramFns.reserve(7); + paramFns.push_back(std::move(lon1)); + paramFns.push_back(std::move(lat1)); + paramFns.push_back(std::move(r1)); + paramFns.push_back(std::move(ts)); + paramFns.push_back(std::move(lon2)); + paramFns.push_back(std::move(lat2)); + paramFns.push_back(std::move(r2)); +} + +VarVal EintersectsTcbufferCbufferPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto lon1 = paramFns[0].execute(record, arena).cast(); + auto lat1 = paramFns[1].execute(record, arena).cast(); + auto r1 = paramFns[2].execute(record, arena).cast(); + auto ts = paramFns[3].execute(record, arena).cast(); + auto lon2 = paramFns[4].execute(record, arena).cast(); + auto lat2 = paramFns[5].execute(record, arena).cast(); + auto r2 = paramFns[6].execute(record, arena).cast(); + + const auto result = nautilus::invoke( + +[](double lon1, double lat1, double r1, uint64_t ts, + double lon2, double lat2, double r2) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + // Build tcbuffer instant from (lon1,lat1,r1,ts) + std::string pt1 = fmt::format("POINT({} {})", lon1, lat1); + GSERIALIZED* pt1_gs = geom_in(pt1.c_str(), -1); + if (!pt1_gs) return 0.0; + Cbuffer* cb1 = cbuffer_make(pt1_gs, r1); + free(pt1_gs); + if (!cb1) return 0.0; + Temporal* tcb_inst = (Temporal*)tcbufferinst_make(cb1, (TimestampTz)ts); + free(cb1); + if (!tcb_inst) return 0.0; + // Build static cbuffer from (lon2,lat2,r2) + std::string pt2 = fmt::format("POINT({} {})", lon2, lat2); + GSERIALIZED* pt2_gs = geom_in(pt2.c_str(), -1); + if (!pt2_gs) { free(tcb_inst); return 0.0; } + Cbuffer* cb2 = cbuffer_make(pt2_gs, r2); + free(pt2_gs); + if (!cb2) { free(tcb_inst); return 0.0; } + int r = eintersects_tcbuffer_cbuffer(tcb_inst, cb2); + free(tcb_inst); + free(cb2); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + lon1, lat1, r1, ts, lon2, lat2, r2); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEintersectsTcbufferCbufferPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 7, + "EintersectsTcbufferCbufferPhysicalFunction requires 7 children but got {}", + arguments.childFunctions.size()); + return EintersectsTcbufferCbufferPhysicalFunction(std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4]), + std::move(arguments.childFunctions[5]), + std::move(arguments.childFunctions[6])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EtouchesTcbufferCbufferPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EtouchesTcbufferCbufferPhysicalFunction.cpp new file mode 100644 index 0000000000..b90b4de1ae --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EtouchesTcbufferCbufferPhysicalFunction.cpp @@ -0,0 +1,110 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +EtouchesTcbufferCbufferPhysicalFunction::EtouchesTcbufferCbufferPhysicalFunction( + PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction r1, + PhysicalFunction ts, + PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction r2) +{ + paramFns.reserve(7); + paramFns.push_back(std::move(lon1)); + paramFns.push_back(std::move(lat1)); + paramFns.push_back(std::move(r1)); + paramFns.push_back(std::move(ts)); + paramFns.push_back(std::move(lon2)); + paramFns.push_back(std::move(lat2)); + paramFns.push_back(std::move(r2)); +} + +VarVal EtouchesTcbufferCbufferPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto lon1 = paramFns[0].execute(record, arena).cast(); + auto lat1 = paramFns[1].execute(record, arena).cast(); + auto r1 = paramFns[2].execute(record, arena).cast(); + auto ts = paramFns[3].execute(record, arena).cast(); + auto lon2 = paramFns[4].execute(record, arena).cast(); + auto lat2 = paramFns[5].execute(record, arena).cast(); + auto r2 = paramFns[6].execute(record, arena).cast(); + + const auto result = nautilus::invoke( + +[](double lon1, double lat1, double r1, uint64_t ts, + double lon2, double lat2, double r2) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + // Build tcbuffer instant from (lon1,lat1,r1,ts) + std::string pt1 = fmt::format("POINT({} {})", lon1, lat1); + GSERIALIZED* pt1_gs = geom_in(pt1.c_str(), -1); + if (!pt1_gs) return 0.0; + Cbuffer* cb1 = cbuffer_make(pt1_gs, r1); + free(pt1_gs); + if (!cb1) return 0.0; + Temporal* tcb_inst = (Temporal*)tcbufferinst_make(cb1, (TimestampTz)ts); + free(cb1); + if (!tcb_inst) return 0.0; + // Build static cbuffer from (lon2,lat2,r2) + std::string pt2 = fmt::format("POINT({} {})", lon2, lat2); + GSERIALIZED* pt2_gs = geom_in(pt2.c_str(), -1); + if (!pt2_gs) { free(tcb_inst); return 0.0; } + Cbuffer* cb2 = cbuffer_make(pt2_gs, r2); + free(pt2_gs); + if (!cb2) { free(tcb_inst); return 0.0; } + int r = etouches_tcbuffer_cbuffer(tcb_inst, cb2); + free(tcb_inst); + free(cb2); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + lon1, lat1, r1, ts, lon2, lat2, r2); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEtouchesTcbufferCbufferPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 7, + "EtouchesTcbufferCbufferPhysicalFunction requires 7 children but got {}", + arguments.childFunctions.size()); + return EtouchesTcbufferCbufferPhysicalFunction(std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4]), + std::move(arguments.childFunctions[5]), + std::move(arguments.childFunctions[6])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverEqTcbufferCbufferPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverEqTcbufferCbufferPhysicalFunction.cpp new file mode 100644 index 0000000000..d51279857e --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverEqTcbufferCbufferPhysicalFunction.cpp @@ -0,0 +1,110 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +EverEqTcbufferCbufferPhysicalFunction::EverEqTcbufferCbufferPhysicalFunction( + PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction r1, + PhysicalFunction ts, + PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction r2) +{ + paramFns.reserve(7); + paramFns.push_back(std::move(lon1)); + paramFns.push_back(std::move(lat1)); + paramFns.push_back(std::move(r1)); + paramFns.push_back(std::move(ts)); + paramFns.push_back(std::move(lon2)); + paramFns.push_back(std::move(lat2)); + paramFns.push_back(std::move(r2)); +} + +VarVal EverEqTcbufferCbufferPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto lon1 = paramFns[0].execute(record, arena).cast(); + auto lat1 = paramFns[1].execute(record, arena).cast(); + auto r1 = paramFns[2].execute(record, arena).cast(); + auto ts = paramFns[3].execute(record, arena).cast(); + auto lon2 = paramFns[4].execute(record, arena).cast(); + auto lat2 = paramFns[5].execute(record, arena).cast(); + auto r2 = paramFns[6].execute(record, arena).cast(); + + const auto result = nautilus::invoke( + +[](double lon1, double lat1, double r1, uint64_t ts, + double lon2, double lat2, double r2) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + // Build tcbuffer instant from (lon1,lat1,r1,ts) + std::string pt1 = fmt::format("POINT({} {})", lon1, lat1); + GSERIALIZED* pt1_gs = geom_in(pt1.c_str(), -1); + if (!pt1_gs) return 0.0; + Cbuffer* cb1 = cbuffer_make(pt1_gs, r1); + free(pt1_gs); + if (!cb1) return 0.0; + Temporal* tcb_inst = (Temporal*)tcbufferinst_make(cb1, (TimestampTz)ts); + free(cb1); + if (!tcb_inst) return 0.0; + // Build static cbuffer from (lon2,lat2,r2) + std::string pt2 = fmt::format("POINT({} {})", lon2, lat2); + GSERIALIZED* pt2_gs = geom_in(pt2.c_str(), -1); + if (!pt2_gs) { free(tcb_inst); return 0.0; } + Cbuffer* cb2 = cbuffer_make(pt2_gs, r2); + free(pt2_gs); + if (!cb2) { free(tcb_inst); return 0.0; } + int r = ever_eq_tcbuffer_cbuffer(tcb_inst, cb2); + free(tcb_inst); + free(cb2); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + lon1, lat1, r1, ts, lon2, lat2, r2); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverEqTcbufferCbufferPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 7, + "EverEqTcbufferCbufferPhysicalFunction requires 7 children but got {}", + arguments.childFunctions.size()); + return EverEqTcbufferCbufferPhysicalFunction(std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4]), + std::move(arguments.childFunctions[5]), + std::move(arguments.childFunctions[6])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverNeTcbufferCbufferPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverNeTcbufferCbufferPhysicalFunction.cpp new file mode 100644 index 0000000000..fe2abeb2da --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverNeTcbufferCbufferPhysicalFunction.cpp @@ -0,0 +1,110 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +EverNeTcbufferCbufferPhysicalFunction::EverNeTcbufferCbufferPhysicalFunction( + PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction r1, + PhysicalFunction ts, + PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction r2) +{ + paramFns.reserve(7); + paramFns.push_back(std::move(lon1)); + paramFns.push_back(std::move(lat1)); + paramFns.push_back(std::move(r1)); + paramFns.push_back(std::move(ts)); + paramFns.push_back(std::move(lon2)); + paramFns.push_back(std::move(lat2)); + paramFns.push_back(std::move(r2)); +} + +VarVal EverNeTcbufferCbufferPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto lon1 = paramFns[0].execute(record, arena).cast(); + auto lat1 = paramFns[1].execute(record, arena).cast(); + auto r1 = paramFns[2].execute(record, arena).cast(); + auto ts = paramFns[3].execute(record, arena).cast(); + auto lon2 = paramFns[4].execute(record, arena).cast(); + auto lat2 = paramFns[5].execute(record, arena).cast(); + auto r2 = paramFns[6].execute(record, arena).cast(); + + const auto result = nautilus::invoke( + +[](double lon1, double lat1, double r1, uint64_t ts, + double lon2, double lat2, double r2) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + // Build tcbuffer instant from (lon1,lat1,r1,ts) + std::string pt1 = fmt::format("POINT({} {})", lon1, lat1); + GSERIALIZED* pt1_gs = geom_in(pt1.c_str(), -1); + if (!pt1_gs) return 0.0; + Cbuffer* cb1 = cbuffer_make(pt1_gs, r1); + free(pt1_gs); + if (!cb1) return 0.0; + Temporal* tcb_inst = (Temporal*)tcbufferinst_make(cb1, (TimestampTz)ts); + free(cb1); + if (!tcb_inst) return 0.0; + // Build static cbuffer from (lon2,lat2,r2) + std::string pt2 = fmt::format("POINT({} {})", lon2, lat2); + GSERIALIZED* pt2_gs = geom_in(pt2.c_str(), -1); + if (!pt2_gs) { free(tcb_inst); return 0.0; } + Cbuffer* cb2 = cbuffer_make(pt2_gs, r2); + free(pt2_gs); + if (!cb2) { free(tcb_inst); return 0.0; } + int r = ever_ne_tcbuffer_cbuffer(tcb_inst, cb2); + free(tcb_inst); + free(cb2); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + lon1, lat1, r1, ts, lon2, lat2, r2); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverNeTcbufferCbufferPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 7, + "EverNeTcbufferCbufferPhysicalFunction requires 7 children but got {}", + arguments.childFunctions.size()); + return EverNeTcbufferCbufferPhysicalFunction(std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4]), + std::move(arguments.childFunctions[5]), + std::move(arguments.childFunctions[6])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/NadTcbufferCbufferPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/NadTcbufferCbufferPhysicalFunction.cpp new file mode 100644 index 0000000000..011a4cf277 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/NadTcbufferCbufferPhysicalFunction.cpp @@ -0,0 +1,110 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +NadTcbufferCbufferPhysicalFunction::NadTcbufferCbufferPhysicalFunction( + PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction r1, + PhysicalFunction ts, + PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction r2) +{ + paramFns.reserve(7); + paramFns.push_back(std::move(lon1)); + paramFns.push_back(std::move(lat1)); + paramFns.push_back(std::move(r1)); + paramFns.push_back(std::move(ts)); + paramFns.push_back(std::move(lon2)); + paramFns.push_back(std::move(lat2)); + paramFns.push_back(std::move(r2)); +} + +VarVal NadTcbufferCbufferPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto lon1 = paramFns[0].execute(record, arena).cast(); + auto lat1 = paramFns[1].execute(record, arena).cast(); + auto r1 = paramFns[2].execute(record, arena).cast(); + auto ts = paramFns[3].execute(record, arena).cast(); + auto lon2 = paramFns[4].execute(record, arena).cast(); + auto lat2 = paramFns[5].execute(record, arena).cast(); + auto r2 = paramFns[6].execute(record, arena).cast(); + + const auto result = nautilus::invoke( + +[](double lon1, double lat1, double r1, uint64_t ts, + double lon2, double lat2, double r2) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + // Build tcbuffer instant from (lon1,lat1,r1,ts) + std::string pt1 = fmt::format("POINT({} {})", lon1, lat1); + GSERIALIZED* pt1_gs = geom_in(pt1.c_str(), -1); + if (!pt1_gs) return 0.0; + Cbuffer* cb1 = cbuffer_make(pt1_gs, r1); + free(pt1_gs); + if (!cb1) return 0.0; + Temporal* tcb_inst = (Temporal*)tcbufferinst_make(cb1, (TimestampTz)ts); + free(cb1); + if (!tcb_inst) return 0.0; + // Build static cbuffer from (lon2,lat2,r2) + std::string pt2 = fmt::format("POINT({} {})", lon2, lat2); + GSERIALIZED* pt2_gs = geom_in(pt2.c_str(), -1); + if (!pt2_gs) { free(tcb_inst); return 0.0; } + Cbuffer* cb2 = cbuffer_make(pt2_gs, r2); + free(pt2_gs); + if (!cb2) { free(tcb_inst); return 0.0; } + double r = nad_tcbuffer_cbuffer(tcb_inst, cb2); + free(tcb_inst); + free(cb2); + return r; + } catch (const std::exception&) { return -1.0; } + }, + lon1, lat1, r1, ts, lon2, lat2, r2); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterNadTcbufferCbufferPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 7, + "NadTcbufferCbufferPhysicalFunction requires 7 children but got {}", + arguments.childFunctions.size()); + return NadTcbufferCbufferPhysicalFunction(std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4]), + std::move(arguments.childFunctions[5]), + std::move(arguments.childFunctions[6])); +} + +} // namespace NES diff --git a/nes-sql-parser/AntlrSQL.g4 b/nes-sql-parser/AntlrSQL.g4 index b054846852..a6c94ca2a0 100644 --- a/nes-sql-parser/AntlrSQL.g4 +++ b/nes-sql-parser/AntlrSQL.g4 @@ -295,7 +295,7 @@ timeUnit: MS timestampParameter: name=identifier; -functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT | TGE_TTEXT_TEXT | TGE_TEXT_TTEXT | TGT_TTEXT_TEXT | TGT_TEXT_TTEXT | TLE_TTEXT_TEXT | TLE_TEXT_TTEXT | TLT_TTEXT_TEXT | TLT_TEXT_TTEXT | TTEXT_UPPER | TTEXT_LOWER | TTEXT_INITCAP | TEXTCAT_TTEXT_TEXT | TEXTCAT_TEXT_TTEXT | TEXTCAT_TTEXT_TTEXT | GEOM_LENGTH | GEOM_PERIMETER | GEOM_AZIMUTH | GEOG_AREA | GEOG_LENGTH | GEOG_PERIMETER | GEOM_IS_EMPTY | AINTERSECTS_TGEO_GEO | ACOVERS_TGEO_GEO | ADISJOINT_TGEO_GEO | ADWITHIN_TGEO_GEO | EINTERSECTS_TGEO_GEO | ETOUCHES_TGEO_GEO | ECONTAINS_TGEO_GEO | ACONTAINS_TGEO_GEO | ATOUCHES_TGEO_GEO | GEO_NUM_POINTS | GEO_NUM_GEOS | GEO_SRID | GEO_IS_UNITARY | GEO_EQUALS | GEO_SAME | GEOG_DISTANCE | NAD_TGEO_GEO | EVER_EQ_TGEO_GEO | EVER_NE_TGEO_GEO | ALWAYS_EQ_TGEO_GEO | ALWAYS_NE_TGEO_GEO | GEOG_INTERSECTS | GEOG_DWITHIN | ACOVERS_GEO_TGEO | GEOM_INTERSECTS | GEOM_DWITHIN | H3_GS_POINT_TO_CELL | EVER_EQ_TH3INDEX_H3INDEX | EVER_NE_TH3INDEX_H3INDEX | ALWAYS_EQ_TH3INDEX_H3INDEX | ALWAYS_NE_TH3INDEX_H3INDEX | TH3INDEX_GET_RESOLUTION | TH3INDEX_GET_BASE_CELL_NUMBER | TH3INDEX_IS_VALID_CELL | TH3INDEX_IS_PENTAGON | TH3INDEX_CELL_TO_PARENT_NEXT | TH3INDEX_CELL_TO_CENTER_CHILD_NEXT | TH3INDEX_CELL_TO_PARENT | TH3INDEX_CELL_TO_CENTER_CHILD | TH3INDEX_CELL_TO_CHILD_POS | TH3INDEX_ARE_NEIGHBOR_CELLS | TH3INDEX_GRID_DISTANCE | EINTERSECTS_TCBUFFER_GEO | AINTERSECTS_TCBUFFER_GEO | ECOVERS_TCBUFFER_GEO | ACOVERS_TCBUFFER_GEO | EDISJOINT_TCBUFFER_GEO | ADISJOINT_TCBUFFER_GEO | ETOUCHES_TCBUFFER_GEO | ATOUCHES_TCBUFFER_GEO | ECONTAINS_TCBUFFER_GEO | ACONTAINS_TCBUFFER_GEO | NAD_TCBUFFER_GEO | EDWITHIN_TCBUFFER_GEO | ADWITHIN_TCBUFFER_GEO | GEOM_INTERSECTS2D | GEOM_DWITHIN2D | GEOM_CONTAINS | GEOM_DISJOINT2D | GEOM_COVERS | GEOM_TOUCHES | GEOM_INTERSECTS3D | GEOM_DWITHIN3D | GEOM_DISTANCE2D | GEOM_DISTANCE3D; +functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT | TGE_TTEXT_TEXT | TGE_TEXT_TTEXT | TGT_TTEXT_TEXT | TGT_TEXT_TTEXT | TLE_TTEXT_TEXT | TLE_TEXT_TTEXT | TLT_TTEXT_TEXT | TLT_TEXT_TTEXT | TTEXT_UPPER | TTEXT_LOWER | TTEXT_INITCAP | TEXTCAT_TTEXT_TEXT | TEXTCAT_TEXT_TTEXT | TEXTCAT_TTEXT_TTEXT | GEOM_LENGTH | GEOM_PERIMETER | GEOM_AZIMUTH | GEOG_AREA | GEOG_LENGTH | GEOG_PERIMETER | GEOM_IS_EMPTY | AINTERSECTS_TGEO_GEO | ACOVERS_TGEO_GEO | ADISJOINT_TGEO_GEO | ADWITHIN_TGEO_GEO | EINTERSECTS_TGEO_GEO | ETOUCHES_TGEO_GEO | ECONTAINS_TGEO_GEO | ACONTAINS_TGEO_GEO | ATOUCHES_TGEO_GEO | GEO_NUM_POINTS | GEO_NUM_GEOS | GEO_SRID | GEO_IS_UNITARY | GEO_EQUALS | GEO_SAME | GEOG_DISTANCE | NAD_TGEO_GEO | EVER_EQ_TGEO_GEO | EVER_NE_TGEO_GEO | ALWAYS_EQ_TGEO_GEO | ALWAYS_NE_TGEO_GEO | GEOG_INTERSECTS | GEOG_DWITHIN | ACOVERS_GEO_TGEO | GEOM_INTERSECTS | GEOM_DWITHIN | H3_GS_POINT_TO_CELL | EVER_EQ_TH3INDEX_H3INDEX | EVER_NE_TH3INDEX_H3INDEX | ALWAYS_EQ_TH3INDEX_H3INDEX | ALWAYS_NE_TH3INDEX_H3INDEX | TH3INDEX_GET_RESOLUTION | TH3INDEX_GET_BASE_CELL_NUMBER | TH3INDEX_IS_VALID_CELL | TH3INDEX_IS_PENTAGON | TH3INDEX_CELL_TO_PARENT_NEXT | TH3INDEX_CELL_TO_CENTER_CHILD_NEXT | TH3INDEX_CELL_TO_PARENT | TH3INDEX_CELL_TO_CENTER_CHILD | TH3INDEX_CELL_TO_CHILD_POS | TH3INDEX_ARE_NEIGHBOR_CELLS | TH3INDEX_GRID_DISTANCE | EINTERSECTS_TCBUFFER_GEO | AINTERSECTS_TCBUFFER_GEO | ECOVERS_TCBUFFER_GEO | ACOVERS_TCBUFFER_GEO | EDISJOINT_TCBUFFER_GEO | ADISJOINT_TCBUFFER_GEO | ETOUCHES_TCBUFFER_GEO | ATOUCHES_TCBUFFER_GEO | ECONTAINS_TCBUFFER_GEO | ACONTAINS_TCBUFFER_GEO | NAD_TCBUFFER_GEO | EDWITHIN_TCBUFFER_GEO | ADWITHIN_TCBUFFER_GEO | EINTERSECTS_TCBUFFER_CBUFFER | AINTERSECTS_TCBUFFER_CBUFFER | ECOVERS_TCBUFFER_CBUFFER | ACOVERS_TCBUFFER_CBUFFER | EDISJOINT_TCBUFFER_CBUFFER | ADISJOINT_TCBUFFER_CBUFFER | ETOUCHES_TCBUFFER_CBUFFER | ATOUCHES_TCBUFFER_CBUFFER | ECONTAINS_TCBUFFER_CBUFFER | ACONTAINS_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_CBUFFER | ALWAYS_EQ_TCBUFFER_CBUFFER | EVER_NE_TCBUFFER_CBUFFER | ALWAYS_NE_TCBUFFER_CBUFFER | NAD_TCBUFFER_CBUFFER | GEOM_INTERSECTS2D | GEOM_DWITHIN2D | GEOM_CONTAINS | GEOM_DISJOINT2D | GEOM_COVERS | GEOM_TOUCHES | GEOM_INTERSECTS3D | GEOM_DWITHIN3D | GEOM_DISTANCE2D | GEOM_DISTANCE3D; sinkClause: INTO sink (',' sink)*; @@ -820,6 +820,21 @@ ACONTAINS_TCBUFFER_GEO: 'ACONTAINS_TCBUFFER_GEO' | 'acontains_tcbuffer_geo'; NAD_TCBUFFER_GEO: 'NAD_TCBUFFER_GEO' | 'nad_tcbuffer_geo'; EDWITHIN_TCBUFFER_GEO: 'EDWITHIN_TCBUFFER_GEO' | 'edwithin_tcbuffer_geo'; ADWITHIN_TCBUFFER_GEO: 'ADWITHIN_TCBUFFER_GEO' | 'adwithin_tcbuffer_geo'; +EINTERSECTS_TCBUFFER_CBUFFER: 'EINTERSECTS_TCBUFFER_CBUFFER' | 'eintersects_tcbuffer_cbuffer'; +AINTERSECTS_TCBUFFER_CBUFFER: 'AINTERSECTS_TCBUFFER_CBUFFER' | 'aintersects_tcbuffer_cbuffer'; +ECOVERS_TCBUFFER_CBUFFER: 'ECOVERS_TCBUFFER_CBUFFER' | 'ecovers_tcbuffer_cbuffer'; +ACOVERS_TCBUFFER_CBUFFER: 'ACOVERS_TCBUFFER_CBUFFER' | 'acovers_tcbuffer_cbuffer'; +EDISJOINT_TCBUFFER_CBUFFER: 'EDISJOINT_TCBUFFER_CBUFFER' | 'edisjoint_tcbuffer_cbuffer'; +ADISJOINT_TCBUFFER_CBUFFER: 'ADISJOINT_TCBUFFER_CBUFFER' | 'adisjoint_tcbuffer_cbuffer'; +ETOUCHES_TCBUFFER_CBUFFER: 'ETOUCHES_TCBUFFER_CBUFFER' | 'etouches_tcbuffer_cbuffer'; +ATOUCHES_TCBUFFER_CBUFFER: 'ATOUCHES_TCBUFFER_CBUFFER' | 'atouches_tcbuffer_cbuffer'; +ECONTAINS_TCBUFFER_CBUFFER: 'ECONTAINS_TCBUFFER_CBUFFER' | 'econtains_tcbuffer_cbuffer'; +ACONTAINS_TCBUFFER_CBUFFER: 'ACONTAINS_TCBUFFER_CBUFFER' | 'acontains_tcbuffer_cbuffer'; +EVER_EQ_TCBUFFER_CBUFFER: 'EVER_EQ_TCBUFFER_CBUFFER' | 'ever_eq_tcbuffer_cbuffer'; +ALWAYS_EQ_TCBUFFER_CBUFFER: 'ALWAYS_EQ_TCBUFFER_CBUFFER' | 'always_eq_tcbuffer_cbuffer'; +EVER_NE_TCBUFFER_CBUFFER: 'EVER_NE_TCBUFFER_CBUFFER' | 'ever_ne_tcbuffer_cbuffer'; +ALWAYS_NE_TCBUFFER_CBUFFER: 'ALWAYS_NE_TCBUFFER_CBUFFER' | 'always_ne_tcbuffer_cbuffer'; +NAD_TCBUFFER_CBUFFER: 'NAD_TCBUFFER_CBUFFER' | 'nad_tcbuffer_cbuffer'; GEOM_INTERSECTS2D: 'GEOM_INTERSECTS2D' | 'geom_intersects2d'; GEOM_DWITHIN2D: 'GEOM_DWITHIN2D' | 'geom_dwithin2d'; GEOM_CONTAINS: 'GEOM_CONTAINS' | 'geom_contains'; diff --git a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp index ae848f26ce..45b6756be6 100644 --- a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp +++ b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp @@ -401,6 +401,21 @@ #include #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include @@ -9465,6 +9480,216 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont return LogicalFunction(AdwithinTcbufferGeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5))); } /* END CODEGEN PARSER GLUE: ADWITHIN_TCBUFFER_GEO */ + case AntlrSQLParser::EINTERSECTS_TCBUFFER_CBUFFER: { + PRECONDITION(ctx->functionParam().size() == 7, + "EintersectsTcbufferCbuffer requires 7 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + auto arg5 = visit(ctx->functionParam(5)).as(); + auto arg6 = visit(ctx->functionParam(6)).as(); + return LogicalFunction(EintersectsTcbufferCbufferLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6))); + } + /* END CODEGEN PARSER GLUE: EINTERSECTS_TCBUFFER_CBUFFER */ + case AntlrSQLParser::AINTERSECTS_TCBUFFER_CBUFFER: { + PRECONDITION(ctx->functionParam().size() == 7, + "AintersectsTcbufferCbuffer requires 7 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + auto arg5 = visit(ctx->functionParam(5)).as(); + auto arg6 = visit(ctx->functionParam(6)).as(); + return LogicalFunction(AintersectsTcbufferCbufferLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6))); + } + /* END CODEGEN PARSER GLUE: AINTERSECTS_TCBUFFER_CBUFFER */ + case AntlrSQLParser::ECOVERS_TCBUFFER_CBUFFER: { + PRECONDITION(ctx->functionParam().size() == 7, + "EcoversTcbufferCbuffer requires 7 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + auto arg5 = visit(ctx->functionParam(5)).as(); + auto arg6 = visit(ctx->functionParam(6)).as(); + return LogicalFunction(EcoversTcbufferCbufferLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6))); + } + /* END CODEGEN PARSER GLUE: ECOVERS_TCBUFFER_CBUFFER */ + case AntlrSQLParser::ACOVERS_TCBUFFER_CBUFFER: { + PRECONDITION(ctx->functionParam().size() == 7, + "AcoversTcbufferCbuffer requires 7 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + auto arg5 = visit(ctx->functionParam(5)).as(); + auto arg6 = visit(ctx->functionParam(6)).as(); + return LogicalFunction(AcoversTcbufferCbufferLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6))); + } + /* END CODEGEN PARSER GLUE: ACOVERS_TCBUFFER_CBUFFER */ + case AntlrSQLParser::EDISJOINT_TCBUFFER_CBUFFER: { + PRECONDITION(ctx->functionParam().size() == 7, + "EdisjointTcbufferCbuffer requires 7 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + auto arg5 = visit(ctx->functionParam(5)).as(); + auto arg6 = visit(ctx->functionParam(6)).as(); + return LogicalFunction(EdisjointTcbufferCbufferLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6))); + } + /* END CODEGEN PARSER GLUE: EDISJOINT_TCBUFFER_CBUFFER */ + case AntlrSQLParser::ADISJOINT_TCBUFFER_CBUFFER: { + PRECONDITION(ctx->functionParam().size() == 7, + "AdisjointTcbufferCbuffer requires 7 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + auto arg5 = visit(ctx->functionParam(5)).as(); + auto arg6 = visit(ctx->functionParam(6)).as(); + return LogicalFunction(AdisjointTcbufferCbufferLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6))); + } + /* END CODEGEN PARSER GLUE: ADISJOINT_TCBUFFER_CBUFFER */ + case AntlrSQLParser::ETOUCHES_TCBUFFER_CBUFFER: { + PRECONDITION(ctx->functionParam().size() == 7, + "EtouchesTcbufferCbuffer requires 7 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + auto arg5 = visit(ctx->functionParam(5)).as(); + auto arg6 = visit(ctx->functionParam(6)).as(); + return LogicalFunction(EtouchesTcbufferCbufferLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6))); + } + /* END CODEGEN PARSER GLUE: ETOUCHES_TCBUFFER_CBUFFER */ + case AntlrSQLParser::ATOUCHES_TCBUFFER_CBUFFER: { + PRECONDITION(ctx->functionParam().size() == 7, + "AtouchesTcbufferCbuffer requires 7 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + auto arg5 = visit(ctx->functionParam(5)).as(); + auto arg6 = visit(ctx->functionParam(6)).as(); + return LogicalFunction(AtouchesTcbufferCbufferLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6))); + } + /* END CODEGEN PARSER GLUE: ATOUCHES_TCBUFFER_CBUFFER */ + case AntlrSQLParser::ECONTAINS_TCBUFFER_CBUFFER: { + PRECONDITION(ctx->functionParam().size() == 7, + "EcontainsTcbufferCbuffer requires 7 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + auto arg5 = visit(ctx->functionParam(5)).as(); + auto arg6 = visit(ctx->functionParam(6)).as(); + return LogicalFunction(EcontainsTcbufferCbufferLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6))); + } + /* END CODEGEN PARSER GLUE: ECONTAINS_TCBUFFER_CBUFFER */ + case AntlrSQLParser::ACONTAINS_TCBUFFER_CBUFFER: { + PRECONDITION(ctx->functionParam().size() == 7, + "AcontainsTcbufferCbuffer requires 7 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + auto arg5 = visit(ctx->functionParam(5)).as(); + auto arg6 = visit(ctx->functionParam(6)).as(); + return LogicalFunction(AcontainsTcbufferCbufferLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6))); + } + /* END CODEGEN PARSER GLUE: ACONTAINS_TCBUFFER_CBUFFER */ + case AntlrSQLParser::EVER_EQ_TCBUFFER_CBUFFER: { + PRECONDITION(ctx->functionParam().size() == 7, + "EverEqTcbufferCbuffer requires 7 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + auto arg5 = visit(ctx->functionParam(5)).as(); + auto arg6 = visit(ctx->functionParam(6)).as(); + return LogicalFunction(EverEqTcbufferCbufferLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6))); + } + /* END CODEGEN PARSER GLUE: EVER_EQ_TCBUFFER_CBUFFER */ + case AntlrSQLParser::ALWAYS_EQ_TCBUFFER_CBUFFER: { + PRECONDITION(ctx->functionParam().size() == 7, + "AlwaysEqTcbufferCbuffer requires 7 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + auto arg5 = visit(ctx->functionParam(5)).as(); + auto arg6 = visit(ctx->functionParam(6)).as(); + return LogicalFunction(AlwaysEqTcbufferCbufferLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6))); + } + /* END CODEGEN PARSER GLUE: ALWAYS_EQ_TCBUFFER_CBUFFER */ + case AntlrSQLParser::EVER_NE_TCBUFFER_CBUFFER: { + PRECONDITION(ctx->functionParam().size() == 7, + "EverNeTcbufferCbuffer requires 7 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + auto arg5 = visit(ctx->functionParam(5)).as(); + auto arg6 = visit(ctx->functionParam(6)).as(); + return LogicalFunction(EverNeTcbufferCbufferLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6))); + } + /* END CODEGEN PARSER GLUE: EVER_NE_TCBUFFER_CBUFFER */ + case AntlrSQLParser::ALWAYS_NE_TCBUFFER_CBUFFER: { + PRECONDITION(ctx->functionParam().size() == 7, + "AlwaysNeTcbufferCbuffer requires 7 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + auto arg5 = visit(ctx->functionParam(5)).as(); + auto arg6 = visit(ctx->functionParam(6)).as(); + return LogicalFunction(AlwaysNeTcbufferCbufferLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6))); + } + /* END CODEGEN PARSER GLUE: ALWAYS_NE_TCBUFFER_CBUFFER */ + case AntlrSQLParser::NAD_TCBUFFER_CBUFFER: { + PRECONDITION(ctx->functionParam().size() == 7, + "NadTcbufferCbuffer requires 7 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + auto arg5 = visit(ctx->functionParam(5)).as(); + auto arg6 = visit(ctx->functionParam(6)).as(); + return LogicalFunction(NadTcbufferCbufferLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6))); + } + /* END CODEGEN PARSER GLUE: NAD_TCBUFFER_CBUFFER */ /* END CODEGEN PARSER GLUE: GEOM_INTERSECTS2D */ case AntlrSQLParser::GEOM_DWITHIN2D: { PRECONDITION(ctx->functionParam().size() == 3, From 1af6641cdc4e6e655f470125a158e45f164798af Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Mon, 15 Jun 2026 06:36:12 +0200 Subject: [PATCH 64/96] feat(meos): add tcbuffer_tcbuffer per-event scalar operators (W116) 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. --- ...AcoversTcbufferTcbufferLogicalFunction.hpp | 54 +++++ ...isjointTcbufferTcbufferLogicalFunction.hpp | 54 +++++ ...ersectsTcbufferTcbufferLogicalFunction.hpp | 54 +++++ ...lwaysEqTcbufferTcbufferLogicalFunction.hpp | 54 +++++ ...lwaysNeTcbufferTcbufferLogicalFunction.hpp | 54 +++++ ...touchesTcbufferTcbufferLogicalFunction.hpp | 54 +++++ ...EcoversTcbufferTcbufferLogicalFunction.hpp | 54 +++++ ...ersectsTcbufferTcbufferLogicalFunction.hpp | 54 +++++ ...touchesTcbufferTcbufferLogicalFunction.hpp | 54 +++++ .../EverEqTcbufferTcbufferLogicalFunction.hpp | 54 +++++ .../EverNeTcbufferTcbufferLogicalFunction.hpp | 54 +++++ .../NadTcbufferTcbufferLogicalFunction.hpp | 54 +++++ ...AcoversTcbufferTcbufferLogicalFunction.cpp | 118 +++++++++++ ...isjointTcbufferTcbufferLogicalFunction.cpp | 118 +++++++++++ ...ersectsTcbufferTcbufferLogicalFunction.cpp | 118 +++++++++++ ...lwaysEqTcbufferTcbufferLogicalFunction.cpp | 118 +++++++++++ ...lwaysNeTcbufferTcbufferLogicalFunction.cpp | 118 +++++++++++ ...touchesTcbufferTcbufferLogicalFunction.cpp | 118 +++++++++++ .../src/Functions/Meos/CMakeLists.txt | 12 ++ ...EcoversTcbufferTcbufferLogicalFunction.cpp | 118 +++++++++++ ...ersectsTcbufferTcbufferLogicalFunction.cpp | 118 +++++++++++ ...touchesTcbufferTcbufferLogicalFunction.cpp | 118 +++++++++++ .../EverEqTcbufferTcbufferLogicalFunction.cpp | 118 +++++++++++ .../EverNeTcbufferTcbufferLogicalFunction.cpp | 118 +++++++++++ .../NadTcbufferTcbufferLogicalFunction.cpp | 118 +++++++++++ ...coversTcbufferTcbufferPhysicalFunction.hpp | 37 ++++ ...sjointTcbufferTcbufferPhysicalFunction.hpp | 37 ++++ ...rsectsTcbufferTcbufferPhysicalFunction.hpp | 37 ++++ ...waysEqTcbufferTcbufferPhysicalFunction.hpp | 37 ++++ ...waysNeTcbufferTcbufferPhysicalFunction.hpp | 37 ++++ ...ouchesTcbufferTcbufferPhysicalFunction.hpp | 37 ++++ ...coversTcbufferTcbufferPhysicalFunction.hpp | 37 ++++ ...rsectsTcbufferTcbufferPhysicalFunction.hpp | 37 ++++ ...ouchesTcbufferTcbufferPhysicalFunction.hpp | 37 ++++ ...EverEqTcbufferTcbufferPhysicalFunction.hpp | 37 ++++ ...EverNeTcbufferTcbufferPhysicalFunction.hpp | 37 ++++ .../NadTcbufferTcbufferPhysicalFunction.hpp | 37 ++++ ...coversTcbufferTcbufferPhysicalFunction.cpp | 112 ++++++++++ ...sjointTcbufferTcbufferPhysicalFunction.cpp | 112 ++++++++++ ...rsectsTcbufferTcbufferPhysicalFunction.cpp | 112 ++++++++++ ...waysEqTcbufferTcbufferPhysicalFunction.cpp | 112 ++++++++++ ...waysNeTcbufferTcbufferPhysicalFunction.cpp | 112 ++++++++++ ...ouchesTcbufferTcbufferPhysicalFunction.cpp | 112 ++++++++++ .../src/Functions/Meos/CMakeLists.txt | 12 ++ ...coversTcbufferTcbufferPhysicalFunction.cpp | 112 ++++++++++ ...rsectsTcbufferTcbufferPhysicalFunction.cpp | 112 ++++++++++ ...ouchesTcbufferTcbufferPhysicalFunction.cpp | 112 ++++++++++ ...EverEqTcbufferTcbufferPhysicalFunction.cpp | 112 ++++++++++ ...EverNeTcbufferTcbufferPhysicalFunction.cpp | 112 ++++++++++ .../NadTcbufferTcbufferPhysicalFunction.cpp | 112 ++++++++++ nes-sql-parser/AntlrSQL.g4 | 14 +- .../src/AntlrSQLQueryPlanCreator.cpp | 192 ++++++++++++++++++ 52 files changed, 4081 insertions(+), 1 deletion(-) create mode 100644 nes-logical-operators/include/Functions/Meos/AcoversTcbufferTcbufferLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AdisjointTcbufferTcbufferLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AintersectsTcbufferTcbufferLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysEqTcbufferTcbufferLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysNeTcbufferTcbufferLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AtouchesTcbufferTcbufferLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EcoversTcbufferTcbufferLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EintersectsTcbufferTcbufferLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EtouchesTcbufferTcbufferLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverEqTcbufferTcbufferLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverNeTcbufferTcbufferLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/NadTcbufferTcbufferLogicalFunction.hpp create mode 100644 nes-logical-operators/src/Functions/Meos/AcoversTcbufferTcbufferLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AdisjointTcbufferTcbufferLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AintersectsTcbufferTcbufferLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysEqTcbufferTcbufferLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysNeTcbufferTcbufferLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AtouchesTcbufferTcbufferLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EcoversTcbufferTcbufferLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EintersectsTcbufferTcbufferLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EtouchesTcbufferTcbufferLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverEqTcbufferTcbufferLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverNeTcbufferTcbufferLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/NadTcbufferTcbufferLogicalFunction.cpp create mode 100644 nes-physical-operators/include/Functions/Meos/AcoversTcbufferTcbufferPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AdisjointTcbufferTcbufferPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AintersectsTcbufferTcbufferPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysEqTcbufferTcbufferPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysNeTcbufferTcbufferPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AtouchesTcbufferTcbufferPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EcoversTcbufferTcbufferPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EintersectsTcbufferTcbufferPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EtouchesTcbufferTcbufferPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverEqTcbufferTcbufferPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverNeTcbufferTcbufferPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/NadTcbufferTcbufferPhysicalFunction.hpp create mode 100644 nes-physical-operators/src/Functions/Meos/AcoversTcbufferTcbufferPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AdisjointTcbufferTcbufferPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AintersectsTcbufferTcbufferPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysEqTcbufferTcbufferPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysNeTcbufferTcbufferPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AtouchesTcbufferTcbufferPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EcoversTcbufferTcbufferPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EintersectsTcbufferTcbufferPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EtouchesTcbufferTcbufferPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverEqTcbufferTcbufferPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverNeTcbufferTcbufferPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/NadTcbufferTcbufferPhysicalFunction.cpp diff --git a/nes-logical-operators/include/Functions/Meos/AcoversTcbufferTcbufferLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AcoversTcbufferTcbufferLogicalFunction.hpp new file mode 100644 index 0000000000..460443d9ee --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AcoversTcbufferTcbufferLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if the first tcbuffer instant always covers the second, 0.0 otherwise. + * + * Args: (lon1:FLOAT64, lat1:FLOAT64, r1:FLOAT64, ts1:UINT64, + * lon2:FLOAT64, lat2:FLOAT64, r2:FLOAT64, ts2:UINT64) -> FLOAT64. + */ +class AcoversTcbufferTcbufferLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AcoversTcbufferTcbuffer"; + + AcoversTcbufferTcbufferLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction r1, + LogicalFunction ts1, + LogicalFunction lon2, LogicalFunction lat2, LogicalFunction r2, + LogicalFunction ts2); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AdisjointTcbufferTcbufferLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AdisjointTcbufferTcbufferLogicalFunction.hpp new file mode 100644 index 0000000000..8555ac5974 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AdisjointTcbufferTcbufferLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if the two tcbuffer instants are always disjoint, 0.0 otherwise. + * + * Args: (lon1:FLOAT64, lat1:FLOAT64, r1:FLOAT64, ts1:UINT64, + * lon2:FLOAT64, lat2:FLOAT64, r2:FLOAT64, ts2:UINT64) -> FLOAT64. + */ +class AdisjointTcbufferTcbufferLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AdisjointTcbufferTcbuffer"; + + AdisjointTcbufferTcbufferLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction r1, + LogicalFunction ts1, + LogicalFunction lon2, LogicalFunction lat2, LogicalFunction r2, + LogicalFunction ts2); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AintersectsTcbufferTcbufferLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AintersectsTcbufferTcbufferLogicalFunction.hpp new file mode 100644 index 0000000000..826b06ed8f --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AintersectsTcbufferTcbufferLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if the two tcbuffer instants always intersect, 0.0 otherwise. + * + * Args: (lon1:FLOAT64, lat1:FLOAT64, r1:FLOAT64, ts1:UINT64, + * lon2:FLOAT64, lat2:FLOAT64, r2:FLOAT64, ts2:UINT64) -> FLOAT64. + */ +class AintersectsTcbufferTcbufferLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AintersectsTcbufferTcbuffer"; + + AintersectsTcbufferTcbufferLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction r1, + LogicalFunction ts1, + LogicalFunction lon2, LogicalFunction lat2, LogicalFunction r2, + LogicalFunction ts2); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysEqTcbufferTcbufferLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysEqTcbufferTcbufferLogicalFunction.hpp new file mode 100644 index 0000000000..dfd2fa0236 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysEqTcbufferTcbufferLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if the two tcbuffer instants are always equal, 0.0 otherwise. + * + * Args: (lon1:FLOAT64, lat1:FLOAT64, r1:FLOAT64, ts1:UINT64, + * lon2:FLOAT64, lat2:FLOAT64, r2:FLOAT64, ts2:UINT64) -> FLOAT64. + */ +class AlwaysEqTcbufferTcbufferLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysEqTcbufferTcbuffer"; + + AlwaysEqTcbufferTcbufferLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction r1, + LogicalFunction ts1, + LogicalFunction lon2, LogicalFunction lat2, LogicalFunction r2, + LogicalFunction ts2); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysNeTcbufferTcbufferLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysNeTcbufferTcbufferLogicalFunction.hpp new file mode 100644 index 0000000000..7e30c5d3b6 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysNeTcbufferTcbufferLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if the two tcbuffer instants are always not equal, 0.0 otherwise. + * + * Args: (lon1:FLOAT64, lat1:FLOAT64, r1:FLOAT64, ts1:UINT64, + * lon2:FLOAT64, lat2:FLOAT64, r2:FLOAT64, ts2:UINT64) -> FLOAT64. + */ +class AlwaysNeTcbufferTcbufferLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysNeTcbufferTcbuffer"; + + AlwaysNeTcbufferTcbufferLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction r1, + LogicalFunction ts1, + LogicalFunction lon2, LogicalFunction lat2, LogicalFunction r2, + LogicalFunction ts2); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AtouchesTcbufferTcbufferLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AtouchesTcbufferTcbufferLogicalFunction.hpp new file mode 100644 index 0000000000..09466cc342 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AtouchesTcbufferTcbufferLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if the two tcbuffer instants always touch, 0.0 otherwise. + * + * Args: (lon1:FLOAT64, lat1:FLOAT64, r1:FLOAT64, ts1:UINT64, + * lon2:FLOAT64, lat2:FLOAT64, r2:FLOAT64, ts2:UINT64) -> FLOAT64. + */ +class AtouchesTcbufferTcbufferLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AtouchesTcbufferTcbuffer"; + + AtouchesTcbufferTcbufferLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction r1, + LogicalFunction ts1, + LogicalFunction lon2, LogicalFunction lat2, LogicalFunction r2, + LogicalFunction ts2); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EcoversTcbufferTcbufferLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EcoversTcbufferTcbufferLogicalFunction.hpp new file mode 100644 index 0000000000..dfd6c46d73 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EcoversTcbufferTcbufferLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if the first tcbuffer instant ever covers the second, 0.0 otherwise. + * + * Args: (lon1:FLOAT64, lat1:FLOAT64, r1:FLOAT64, ts1:UINT64, + * lon2:FLOAT64, lat2:FLOAT64, r2:FLOAT64, ts2:UINT64) -> FLOAT64. + */ +class EcoversTcbufferTcbufferLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EcoversTcbufferTcbuffer"; + + EcoversTcbufferTcbufferLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction r1, + LogicalFunction ts1, + LogicalFunction lon2, LogicalFunction lat2, LogicalFunction r2, + LogicalFunction ts2); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EintersectsTcbufferTcbufferLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EintersectsTcbufferTcbufferLogicalFunction.hpp new file mode 100644 index 0000000000..9728a93196 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EintersectsTcbufferTcbufferLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if the two tcbuffer instants ever intersect, 0.0 otherwise. + * + * Args: (lon1:FLOAT64, lat1:FLOAT64, r1:FLOAT64, ts1:UINT64, + * lon2:FLOAT64, lat2:FLOAT64, r2:FLOAT64, ts2:UINT64) -> FLOAT64. + */ +class EintersectsTcbufferTcbufferLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EintersectsTcbufferTcbuffer"; + + EintersectsTcbufferTcbufferLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction r1, + LogicalFunction ts1, + LogicalFunction lon2, LogicalFunction lat2, LogicalFunction r2, + LogicalFunction ts2); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EtouchesTcbufferTcbufferLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EtouchesTcbufferTcbufferLogicalFunction.hpp new file mode 100644 index 0000000000..de01556eae --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EtouchesTcbufferTcbufferLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if the two tcbuffer instants ever touch, 0.0 otherwise. + * + * Args: (lon1:FLOAT64, lat1:FLOAT64, r1:FLOAT64, ts1:UINT64, + * lon2:FLOAT64, lat2:FLOAT64, r2:FLOAT64, ts2:UINT64) -> FLOAT64. + */ +class EtouchesTcbufferTcbufferLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EtouchesTcbufferTcbuffer"; + + EtouchesTcbufferTcbufferLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction r1, + LogicalFunction ts1, + LogicalFunction lon2, LogicalFunction lat2, LogicalFunction r2, + LogicalFunction ts2); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverEqTcbufferTcbufferLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverEqTcbufferTcbufferLogicalFunction.hpp new file mode 100644 index 0000000000..24197ef994 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverEqTcbufferTcbufferLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if the two tcbuffer instants are ever equal, 0.0 otherwise. + * + * Args: (lon1:FLOAT64, lat1:FLOAT64, r1:FLOAT64, ts1:UINT64, + * lon2:FLOAT64, lat2:FLOAT64, r2:FLOAT64, ts2:UINT64) -> FLOAT64. + */ +class EverEqTcbufferTcbufferLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverEqTcbufferTcbuffer"; + + EverEqTcbufferTcbufferLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction r1, + LogicalFunction ts1, + LogicalFunction lon2, LogicalFunction lat2, LogicalFunction r2, + LogicalFunction ts2); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverNeTcbufferTcbufferLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverNeTcbufferTcbufferLogicalFunction.hpp new file mode 100644 index 0000000000..ae466f1ed0 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverNeTcbufferTcbufferLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if the two tcbuffer instants are ever not equal, 0.0 otherwise. + * + * Args: (lon1:FLOAT64, lat1:FLOAT64, r1:FLOAT64, ts1:UINT64, + * lon2:FLOAT64, lat2:FLOAT64, r2:FLOAT64, ts2:UINT64) -> FLOAT64. + */ +class EverNeTcbufferTcbufferLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverNeTcbufferTcbuffer"; + + EverNeTcbufferTcbufferLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction r1, + LogicalFunction ts1, + LogicalFunction lon2, LogicalFunction lat2, LogicalFunction r2, + LogicalFunction ts2); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/NadTcbufferTcbufferLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/NadTcbufferTcbufferLogicalFunction.hpp new file mode 100644 index 0000000000..37b1182ebd --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/NadTcbufferTcbufferLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns the nearest approach distance between two tcbuffer instants. + * + * Args: (lon1:FLOAT64, lat1:FLOAT64, r1:FLOAT64, ts1:UINT64, + * lon2:FLOAT64, lat2:FLOAT64, r2:FLOAT64, ts2:UINT64) -> FLOAT64. + */ +class NadTcbufferTcbufferLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "NadTcbufferTcbuffer"; + + NadTcbufferTcbufferLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction r1, + LogicalFunction ts1, + LogicalFunction lon2, LogicalFunction lat2, LogicalFunction r2, + LogicalFunction ts2); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AcoversTcbufferTcbufferLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AcoversTcbufferTcbufferLogicalFunction.cpp new file mode 100644 index 0000000000..afced174f2 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AcoversTcbufferTcbufferLogicalFunction.cpp @@ -0,0 +1,118 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AcoversTcbufferTcbufferLogicalFunction::AcoversTcbufferTcbufferLogicalFunction( + LogicalFunction lon1, LogicalFunction lat1, LogicalFunction r1, LogicalFunction ts1, + LogicalFunction lon2, LogicalFunction lat2, LogicalFunction r2, LogicalFunction ts2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(8); + parameters.push_back(std::move(lon1)); + parameters.push_back(std::move(lat1)); + parameters.push_back(std::move(r1)); + parameters.push_back(std::move(ts1)); + parameters.push_back(std::move(lon2)); + parameters.push_back(std::move(lat2)); + parameters.push_back(std::move(r2)); + parameters.push_back(std::move(ts2)); +} + +DataType AcoversTcbufferTcbufferLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AcoversTcbufferTcbufferLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AcoversTcbufferTcbufferLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AcoversTcbufferTcbufferLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 8, + "AcoversTcbufferTcbufferLogicalFunction requires 8 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AcoversTcbufferTcbufferLogicalFunction::getType() const { return NAME; } + +bool AcoversTcbufferTcbufferLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AcoversTcbufferTcbufferLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction AcoversTcbufferTcbufferLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(8); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon1 must be FLOAT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat1 must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "r1 must be FLOAT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "lon2 must be FLOAT64"); + INVARIANT(c[5].getDataType().isType(DataType::Type::FLOAT64), "lat2 must be FLOAT64"); + INVARIANT(c[6].getDataType().isType(DataType::Type::FLOAT64), "r2 must be FLOAT64"); + INVARIANT(c[7].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); + return withChildren(c); +} + +SerializableFunction AcoversTcbufferTcbufferLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAcoversTcbufferTcbufferLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 8, + "AcoversTcbufferTcbufferLogicalFunction requires 8 children but got {}", + arguments.children.size()); + return AcoversTcbufferTcbufferLogicalFunction(std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4]), + std::move(arguments.children[5]), + std::move(arguments.children[6]), + std::move(arguments.children[7])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AdisjointTcbufferTcbufferLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AdisjointTcbufferTcbufferLogicalFunction.cpp new file mode 100644 index 0000000000..7667e268f2 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AdisjointTcbufferTcbufferLogicalFunction.cpp @@ -0,0 +1,118 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AdisjointTcbufferTcbufferLogicalFunction::AdisjointTcbufferTcbufferLogicalFunction( + LogicalFunction lon1, LogicalFunction lat1, LogicalFunction r1, LogicalFunction ts1, + LogicalFunction lon2, LogicalFunction lat2, LogicalFunction r2, LogicalFunction ts2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(8); + parameters.push_back(std::move(lon1)); + parameters.push_back(std::move(lat1)); + parameters.push_back(std::move(r1)); + parameters.push_back(std::move(ts1)); + parameters.push_back(std::move(lon2)); + parameters.push_back(std::move(lat2)); + parameters.push_back(std::move(r2)); + parameters.push_back(std::move(ts2)); +} + +DataType AdisjointTcbufferTcbufferLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AdisjointTcbufferTcbufferLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AdisjointTcbufferTcbufferLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AdisjointTcbufferTcbufferLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 8, + "AdisjointTcbufferTcbufferLogicalFunction requires 8 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AdisjointTcbufferTcbufferLogicalFunction::getType() const { return NAME; } + +bool AdisjointTcbufferTcbufferLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AdisjointTcbufferTcbufferLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction AdisjointTcbufferTcbufferLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(8); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon1 must be FLOAT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat1 must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "r1 must be FLOAT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "lon2 must be FLOAT64"); + INVARIANT(c[5].getDataType().isType(DataType::Type::FLOAT64), "lat2 must be FLOAT64"); + INVARIANT(c[6].getDataType().isType(DataType::Type::FLOAT64), "r2 must be FLOAT64"); + INVARIANT(c[7].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); + return withChildren(c); +} + +SerializableFunction AdisjointTcbufferTcbufferLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAdisjointTcbufferTcbufferLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 8, + "AdisjointTcbufferTcbufferLogicalFunction requires 8 children but got {}", + arguments.children.size()); + return AdisjointTcbufferTcbufferLogicalFunction(std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4]), + std::move(arguments.children[5]), + std::move(arguments.children[6]), + std::move(arguments.children[7])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AintersectsTcbufferTcbufferLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AintersectsTcbufferTcbufferLogicalFunction.cpp new file mode 100644 index 0000000000..333ce45585 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AintersectsTcbufferTcbufferLogicalFunction.cpp @@ -0,0 +1,118 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AintersectsTcbufferTcbufferLogicalFunction::AintersectsTcbufferTcbufferLogicalFunction( + LogicalFunction lon1, LogicalFunction lat1, LogicalFunction r1, LogicalFunction ts1, + LogicalFunction lon2, LogicalFunction lat2, LogicalFunction r2, LogicalFunction ts2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(8); + parameters.push_back(std::move(lon1)); + parameters.push_back(std::move(lat1)); + parameters.push_back(std::move(r1)); + parameters.push_back(std::move(ts1)); + parameters.push_back(std::move(lon2)); + parameters.push_back(std::move(lat2)); + parameters.push_back(std::move(r2)); + parameters.push_back(std::move(ts2)); +} + +DataType AintersectsTcbufferTcbufferLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AintersectsTcbufferTcbufferLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AintersectsTcbufferTcbufferLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AintersectsTcbufferTcbufferLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 8, + "AintersectsTcbufferTcbufferLogicalFunction requires 8 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AintersectsTcbufferTcbufferLogicalFunction::getType() const { return NAME; } + +bool AintersectsTcbufferTcbufferLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AintersectsTcbufferTcbufferLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction AintersectsTcbufferTcbufferLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(8); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon1 must be FLOAT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat1 must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "r1 must be FLOAT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "lon2 must be FLOAT64"); + INVARIANT(c[5].getDataType().isType(DataType::Type::FLOAT64), "lat2 must be FLOAT64"); + INVARIANT(c[6].getDataType().isType(DataType::Type::FLOAT64), "r2 must be FLOAT64"); + INVARIANT(c[7].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); + return withChildren(c); +} + +SerializableFunction AintersectsTcbufferTcbufferLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAintersectsTcbufferTcbufferLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 8, + "AintersectsTcbufferTcbufferLogicalFunction requires 8 children but got {}", + arguments.children.size()); + return AintersectsTcbufferTcbufferLogicalFunction(std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4]), + std::move(arguments.children[5]), + std::move(arguments.children[6]), + std::move(arguments.children[7])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysEqTcbufferTcbufferLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysEqTcbufferTcbufferLogicalFunction.cpp new file mode 100644 index 0000000000..69b0c8aa95 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysEqTcbufferTcbufferLogicalFunction.cpp @@ -0,0 +1,118 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AlwaysEqTcbufferTcbufferLogicalFunction::AlwaysEqTcbufferTcbufferLogicalFunction( + LogicalFunction lon1, LogicalFunction lat1, LogicalFunction r1, LogicalFunction ts1, + LogicalFunction lon2, LogicalFunction lat2, LogicalFunction r2, LogicalFunction ts2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(8); + parameters.push_back(std::move(lon1)); + parameters.push_back(std::move(lat1)); + parameters.push_back(std::move(r1)); + parameters.push_back(std::move(ts1)); + parameters.push_back(std::move(lon2)); + parameters.push_back(std::move(lat2)); + parameters.push_back(std::move(r2)); + parameters.push_back(std::move(ts2)); +} + +DataType AlwaysEqTcbufferTcbufferLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysEqTcbufferTcbufferLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AlwaysEqTcbufferTcbufferLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysEqTcbufferTcbufferLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 8, + "AlwaysEqTcbufferTcbufferLogicalFunction requires 8 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AlwaysEqTcbufferTcbufferLogicalFunction::getType() const { return NAME; } + +bool AlwaysEqTcbufferTcbufferLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AlwaysEqTcbufferTcbufferLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction AlwaysEqTcbufferTcbufferLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(8); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon1 must be FLOAT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat1 must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "r1 must be FLOAT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "lon2 must be FLOAT64"); + INVARIANT(c[5].getDataType().isType(DataType::Type::FLOAT64), "lat2 must be FLOAT64"); + INVARIANT(c[6].getDataType().isType(DataType::Type::FLOAT64), "r2 must be FLOAT64"); + INVARIANT(c[7].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); + return withChildren(c); +} + +SerializableFunction AlwaysEqTcbufferTcbufferLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysEqTcbufferTcbufferLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 8, + "AlwaysEqTcbufferTcbufferLogicalFunction requires 8 children but got {}", + arguments.children.size()); + return AlwaysEqTcbufferTcbufferLogicalFunction(std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4]), + std::move(arguments.children[5]), + std::move(arguments.children[6]), + std::move(arguments.children[7])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysNeTcbufferTcbufferLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysNeTcbufferTcbufferLogicalFunction.cpp new file mode 100644 index 0000000000..08b859b984 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysNeTcbufferTcbufferLogicalFunction.cpp @@ -0,0 +1,118 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AlwaysNeTcbufferTcbufferLogicalFunction::AlwaysNeTcbufferTcbufferLogicalFunction( + LogicalFunction lon1, LogicalFunction lat1, LogicalFunction r1, LogicalFunction ts1, + LogicalFunction lon2, LogicalFunction lat2, LogicalFunction r2, LogicalFunction ts2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(8); + parameters.push_back(std::move(lon1)); + parameters.push_back(std::move(lat1)); + parameters.push_back(std::move(r1)); + parameters.push_back(std::move(ts1)); + parameters.push_back(std::move(lon2)); + parameters.push_back(std::move(lat2)); + parameters.push_back(std::move(r2)); + parameters.push_back(std::move(ts2)); +} + +DataType AlwaysNeTcbufferTcbufferLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysNeTcbufferTcbufferLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AlwaysNeTcbufferTcbufferLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysNeTcbufferTcbufferLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 8, + "AlwaysNeTcbufferTcbufferLogicalFunction requires 8 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AlwaysNeTcbufferTcbufferLogicalFunction::getType() const { return NAME; } + +bool AlwaysNeTcbufferTcbufferLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AlwaysNeTcbufferTcbufferLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction AlwaysNeTcbufferTcbufferLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(8); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon1 must be FLOAT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat1 must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "r1 must be FLOAT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "lon2 must be FLOAT64"); + INVARIANT(c[5].getDataType().isType(DataType::Type::FLOAT64), "lat2 must be FLOAT64"); + INVARIANT(c[6].getDataType().isType(DataType::Type::FLOAT64), "r2 must be FLOAT64"); + INVARIANT(c[7].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); + return withChildren(c); +} + +SerializableFunction AlwaysNeTcbufferTcbufferLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysNeTcbufferTcbufferLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 8, + "AlwaysNeTcbufferTcbufferLogicalFunction requires 8 children but got {}", + arguments.children.size()); + return AlwaysNeTcbufferTcbufferLogicalFunction(std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4]), + std::move(arguments.children[5]), + std::move(arguments.children[6]), + std::move(arguments.children[7])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AtouchesTcbufferTcbufferLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AtouchesTcbufferTcbufferLogicalFunction.cpp new file mode 100644 index 0000000000..93e8cd9f52 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AtouchesTcbufferTcbufferLogicalFunction.cpp @@ -0,0 +1,118 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AtouchesTcbufferTcbufferLogicalFunction::AtouchesTcbufferTcbufferLogicalFunction( + LogicalFunction lon1, LogicalFunction lat1, LogicalFunction r1, LogicalFunction ts1, + LogicalFunction lon2, LogicalFunction lat2, LogicalFunction r2, LogicalFunction ts2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(8); + parameters.push_back(std::move(lon1)); + parameters.push_back(std::move(lat1)); + parameters.push_back(std::move(r1)); + parameters.push_back(std::move(ts1)); + parameters.push_back(std::move(lon2)); + parameters.push_back(std::move(lat2)); + parameters.push_back(std::move(r2)); + parameters.push_back(std::move(ts2)); +} + +DataType AtouchesTcbufferTcbufferLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AtouchesTcbufferTcbufferLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AtouchesTcbufferTcbufferLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AtouchesTcbufferTcbufferLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 8, + "AtouchesTcbufferTcbufferLogicalFunction requires 8 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AtouchesTcbufferTcbufferLogicalFunction::getType() const { return NAME; } + +bool AtouchesTcbufferTcbufferLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AtouchesTcbufferTcbufferLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction AtouchesTcbufferTcbufferLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(8); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon1 must be FLOAT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat1 must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "r1 must be FLOAT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "lon2 must be FLOAT64"); + INVARIANT(c[5].getDataType().isType(DataType::Type::FLOAT64), "lat2 must be FLOAT64"); + INVARIANT(c[6].getDataType().isType(DataType::Type::FLOAT64), "r2 must be FLOAT64"); + INVARIANT(c[7].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); + return withChildren(c); +} + +SerializableFunction AtouchesTcbufferTcbufferLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAtouchesTcbufferTcbufferLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 8, + "AtouchesTcbufferTcbufferLogicalFunction requires 8 children but got {}", + arguments.children.size()); + return AtouchesTcbufferTcbufferLogicalFunction(std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4]), + std::move(arguments.children[5]), + std::move(arguments.children[6]), + std::move(arguments.children[7])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt index dd42371f6f..6ec03bb757 100644 --- a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt @@ -365,6 +365,18 @@ add_plugin(AlwaysEqTcbufferCbuffer LogicalFunction nes-logical-operators AlwaysE add_plugin(EverNeTcbufferCbuffer LogicalFunction nes-logical-operators EverNeTcbufferCbufferLogicalFunction.cpp) add_plugin(AlwaysNeTcbufferCbuffer LogicalFunction nes-logical-operators AlwaysNeTcbufferCbufferLogicalFunction.cpp) add_plugin(NadTcbufferCbuffer LogicalFunction nes-logical-operators NadTcbufferCbufferLogicalFunction.cpp) +add_plugin(EverEqTcbufferTcbuffer LogicalFunction nes-logical-operators EverEqTcbufferTcbufferLogicalFunction.cpp) +add_plugin(AlwaysEqTcbufferTcbuffer LogicalFunction nes-logical-operators AlwaysEqTcbufferTcbufferLogicalFunction.cpp) +add_plugin(EverNeTcbufferTcbuffer LogicalFunction nes-logical-operators EverNeTcbufferTcbufferLogicalFunction.cpp) +add_plugin(AlwaysNeTcbufferTcbuffer LogicalFunction nes-logical-operators AlwaysNeTcbufferTcbufferLogicalFunction.cpp) +add_plugin(EintersectsTcbufferTcbuffer LogicalFunction nes-logical-operators EintersectsTcbufferTcbufferLogicalFunction.cpp) +add_plugin(AintersectsTcbufferTcbuffer LogicalFunction nes-logical-operators AintersectsTcbufferTcbufferLogicalFunction.cpp) +add_plugin(EcoversTcbufferTcbuffer LogicalFunction nes-logical-operators EcoversTcbufferTcbufferLogicalFunction.cpp) +add_plugin(AcoversTcbufferTcbuffer LogicalFunction nes-logical-operators AcoversTcbufferTcbufferLogicalFunction.cpp) +add_plugin(AdisjointTcbufferTcbuffer LogicalFunction nes-logical-operators AdisjointTcbufferTcbufferLogicalFunction.cpp) +add_plugin(EtouchesTcbufferTcbuffer LogicalFunction nes-logical-operators EtouchesTcbufferTcbufferLogicalFunction.cpp) +add_plugin(AtouchesTcbufferTcbuffer LogicalFunction nes-logical-operators AtouchesTcbufferTcbufferLogicalFunction.cpp) +add_plugin(NadTcbufferTcbuffer LogicalFunction nes-logical-operators NadTcbufferTcbufferLogicalFunction.cpp) add_plugin(GeomIntersects2d LogicalFunction nes-logical-operators GeomIntersects2dLogicalFunction.cpp) add_plugin(GeomDwithin2d LogicalFunction nes-logical-operators GeomDwithin2dLogicalFunction.cpp) add_plugin(GeomContains LogicalFunction nes-logical-operators GeomContainsLogicalFunction.cpp) diff --git a/nes-logical-operators/src/Functions/Meos/EcoversTcbufferTcbufferLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EcoversTcbufferTcbufferLogicalFunction.cpp new file mode 100644 index 0000000000..8318ad7d09 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EcoversTcbufferTcbufferLogicalFunction.cpp @@ -0,0 +1,118 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EcoversTcbufferTcbufferLogicalFunction::EcoversTcbufferTcbufferLogicalFunction( + LogicalFunction lon1, LogicalFunction lat1, LogicalFunction r1, LogicalFunction ts1, + LogicalFunction lon2, LogicalFunction lat2, LogicalFunction r2, LogicalFunction ts2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(8); + parameters.push_back(std::move(lon1)); + parameters.push_back(std::move(lat1)); + parameters.push_back(std::move(r1)); + parameters.push_back(std::move(ts1)); + parameters.push_back(std::move(lon2)); + parameters.push_back(std::move(lat2)); + parameters.push_back(std::move(r2)); + parameters.push_back(std::move(ts2)); +} + +DataType EcoversTcbufferTcbufferLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EcoversTcbufferTcbufferLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EcoversTcbufferTcbufferLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EcoversTcbufferTcbufferLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 8, + "EcoversTcbufferTcbufferLogicalFunction requires 8 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EcoversTcbufferTcbufferLogicalFunction::getType() const { return NAME; } + +bool EcoversTcbufferTcbufferLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EcoversTcbufferTcbufferLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction EcoversTcbufferTcbufferLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(8); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon1 must be FLOAT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat1 must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "r1 must be FLOAT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "lon2 must be FLOAT64"); + INVARIANT(c[5].getDataType().isType(DataType::Type::FLOAT64), "lat2 must be FLOAT64"); + INVARIANT(c[6].getDataType().isType(DataType::Type::FLOAT64), "r2 must be FLOAT64"); + INVARIANT(c[7].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); + return withChildren(c); +} + +SerializableFunction EcoversTcbufferTcbufferLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEcoversTcbufferTcbufferLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 8, + "EcoversTcbufferTcbufferLogicalFunction requires 8 children but got {}", + arguments.children.size()); + return EcoversTcbufferTcbufferLogicalFunction(std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4]), + std::move(arguments.children[5]), + std::move(arguments.children[6]), + std::move(arguments.children[7])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EintersectsTcbufferTcbufferLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EintersectsTcbufferTcbufferLogicalFunction.cpp new file mode 100644 index 0000000000..f28607d1a3 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EintersectsTcbufferTcbufferLogicalFunction.cpp @@ -0,0 +1,118 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EintersectsTcbufferTcbufferLogicalFunction::EintersectsTcbufferTcbufferLogicalFunction( + LogicalFunction lon1, LogicalFunction lat1, LogicalFunction r1, LogicalFunction ts1, + LogicalFunction lon2, LogicalFunction lat2, LogicalFunction r2, LogicalFunction ts2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(8); + parameters.push_back(std::move(lon1)); + parameters.push_back(std::move(lat1)); + parameters.push_back(std::move(r1)); + parameters.push_back(std::move(ts1)); + parameters.push_back(std::move(lon2)); + parameters.push_back(std::move(lat2)); + parameters.push_back(std::move(r2)); + parameters.push_back(std::move(ts2)); +} + +DataType EintersectsTcbufferTcbufferLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EintersectsTcbufferTcbufferLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EintersectsTcbufferTcbufferLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EintersectsTcbufferTcbufferLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 8, + "EintersectsTcbufferTcbufferLogicalFunction requires 8 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EintersectsTcbufferTcbufferLogicalFunction::getType() const { return NAME; } + +bool EintersectsTcbufferTcbufferLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EintersectsTcbufferTcbufferLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction EintersectsTcbufferTcbufferLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(8); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon1 must be FLOAT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat1 must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "r1 must be FLOAT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "lon2 must be FLOAT64"); + INVARIANT(c[5].getDataType().isType(DataType::Type::FLOAT64), "lat2 must be FLOAT64"); + INVARIANT(c[6].getDataType().isType(DataType::Type::FLOAT64), "r2 must be FLOAT64"); + INVARIANT(c[7].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); + return withChildren(c); +} + +SerializableFunction EintersectsTcbufferTcbufferLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEintersectsTcbufferTcbufferLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 8, + "EintersectsTcbufferTcbufferLogicalFunction requires 8 children but got {}", + arguments.children.size()); + return EintersectsTcbufferTcbufferLogicalFunction(std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4]), + std::move(arguments.children[5]), + std::move(arguments.children[6]), + std::move(arguments.children[7])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EtouchesTcbufferTcbufferLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EtouchesTcbufferTcbufferLogicalFunction.cpp new file mode 100644 index 0000000000..7c8087753d --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EtouchesTcbufferTcbufferLogicalFunction.cpp @@ -0,0 +1,118 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EtouchesTcbufferTcbufferLogicalFunction::EtouchesTcbufferTcbufferLogicalFunction( + LogicalFunction lon1, LogicalFunction lat1, LogicalFunction r1, LogicalFunction ts1, + LogicalFunction lon2, LogicalFunction lat2, LogicalFunction r2, LogicalFunction ts2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(8); + parameters.push_back(std::move(lon1)); + parameters.push_back(std::move(lat1)); + parameters.push_back(std::move(r1)); + parameters.push_back(std::move(ts1)); + parameters.push_back(std::move(lon2)); + parameters.push_back(std::move(lat2)); + parameters.push_back(std::move(r2)); + parameters.push_back(std::move(ts2)); +} + +DataType EtouchesTcbufferTcbufferLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EtouchesTcbufferTcbufferLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EtouchesTcbufferTcbufferLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EtouchesTcbufferTcbufferLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 8, + "EtouchesTcbufferTcbufferLogicalFunction requires 8 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EtouchesTcbufferTcbufferLogicalFunction::getType() const { return NAME; } + +bool EtouchesTcbufferTcbufferLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EtouchesTcbufferTcbufferLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction EtouchesTcbufferTcbufferLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(8); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon1 must be FLOAT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat1 must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "r1 must be FLOAT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "lon2 must be FLOAT64"); + INVARIANT(c[5].getDataType().isType(DataType::Type::FLOAT64), "lat2 must be FLOAT64"); + INVARIANT(c[6].getDataType().isType(DataType::Type::FLOAT64), "r2 must be FLOAT64"); + INVARIANT(c[7].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); + return withChildren(c); +} + +SerializableFunction EtouchesTcbufferTcbufferLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEtouchesTcbufferTcbufferLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 8, + "EtouchesTcbufferTcbufferLogicalFunction requires 8 children but got {}", + arguments.children.size()); + return EtouchesTcbufferTcbufferLogicalFunction(std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4]), + std::move(arguments.children[5]), + std::move(arguments.children[6]), + std::move(arguments.children[7])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverEqTcbufferTcbufferLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverEqTcbufferTcbufferLogicalFunction.cpp new file mode 100644 index 0000000000..5de429ba45 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverEqTcbufferTcbufferLogicalFunction.cpp @@ -0,0 +1,118 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EverEqTcbufferTcbufferLogicalFunction::EverEqTcbufferTcbufferLogicalFunction( + LogicalFunction lon1, LogicalFunction lat1, LogicalFunction r1, LogicalFunction ts1, + LogicalFunction lon2, LogicalFunction lat2, LogicalFunction r2, LogicalFunction ts2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(8); + parameters.push_back(std::move(lon1)); + parameters.push_back(std::move(lat1)); + parameters.push_back(std::move(r1)); + parameters.push_back(std::move(ts1)); + parameters.push_back(std::move(lon2)); + parameters.push_back(std::move(lat2)); + parameters.push_back(std::move(r2)); + parameters.push_back(std::move(ts2)); +} + +DataType EverEqTcbufferTcbufferLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverEqTcbufferTcbufferLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EverEqTcbufferTcbufferLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverEqTcbufferTcbufferLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 8, + "EverEqTcbufferTcbufferLogicalFunction requires 8 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EverEqTcbufferTcbufferLogicalFunction::getType() const { return NAME; } + +bool EverEqTcbufferTcbufferLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EverEqTcbufferTcbufferLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction EverEqTcbufferTcbufferLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(8); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon1 must be FLOAT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat1 must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "r1 must be FLOAT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "lon2 must be FLOAT64"); + INVARIANT(c[5].getDataType().isType(DataType::Type::FLOAT64), "lat2 must be FLOAT64"); + INVARIANT(c[6].getDataType().isType(DataType::Type::FLOAT64), "r2 must be FLOAT64"); + INVARIANT(c[7].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); + return withChildren(c); +} + +SerializableFunction EverEqTcbufferTcbufferLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverEqTcbufferTcbufferLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 8, + "EverEqTcbufferTcbufferLogicalFunction requires 8 children but got {}", + arguments.children.size()); + return EverEqTcbufferTcbufferLogicalFunction(std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4]), + std::move(arguments.children[5]), + std::move(arguments.children[6]), + std::move(arguments.children[7])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverNeTcbufferTcbufferLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverNeTcbufferTcbufferLogicalFunction.cpp new file mode 100644 index 0000000000..0ed031bbe2 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverNeTcbufferTcbufferLogicalFunction.cpp @@ -0,0 +1,118 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EverNeTcbufferTcbufferLogicalFunction::EverNeTcbufferTcbufferLogicalFunction( + LogicalFunction lon1, LogicalFunction lat1, LogicalFunction r1, LogicalFunction ts1, + LogicalFunction lon2, LogicalFunction lat2, LogicalFunction r2, LogicalFunction ts2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(8); + parameters.push_back(std::move(lon1)); + parameters.push_back(std::move(lat1)); + parameters.push_back(std::move(r1)); + parameters.push_back(std::move(ts1)); + parameters.push_back(std::move(lon2)); + parameters.push_back(std::move(lat2)); + parameters.push_back(std::move(r2)); + parameters.push_back(std::move(ts2)); +} + +DataType EverNeTcbufferTcbufferLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverNeTcbufferTcbufferLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EverNeTcbufferTcbufferLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverNeTcbufferTcbufferLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 8, + "EverNeTcbufferTcbufferLogicalFunction requires 8 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EverNeTcbufferTcbufferLogicalFunction::getType() const { return NAME; } + +bool EverNeTcbufferTcbufferLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EverNeTcbufferTcbufferLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction EverNeTcbufferTcbufferLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(8); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon1 must be FLOAT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat1 must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "r1 must be FLOAT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "lon2 must be FLOAT64"); + INVARIANT(c[5].getDataType().isType(DataType::Type::FLOAT64), "lat2 must be FLOAT64"); + INVARIANT(c[6].getDataType().isType(DataType::Type::FLOAT64), "r2 must be FLOAT64"); + INVARIANT(c[7].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); + return withChildren(c); +} + +SerializableFunction EverNeTcbufferTcbufferLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverNeTcbufferTcbufferLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 8, + "EverNeTcbufferTcbufferLogicalFunction requires 8 children but got {}", + arguments.children.size()); + return EverNeTcbufferTcbufferLogicalFunction(std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4]), + std::move(arguments.children[5]), + std::move(arguments.children[6]), + std::move(arguments.children[7])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/NadTcbufferTcbufferLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/NadTcbufferTcbufferLogicalFunction.cpp new file mode 100644 index 0000000000..abf97eb658 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/NadTcbufferTcbufferLogicalFunction.cpp @@ -0,0 +1,118 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +NadTcbufferTcbufferLogicalFunction::NadTcbufferTcbufferLogicalFunction( + LogicalFunction lon1, LogicalFunction lat1, LogicalFunction r1, LogicalFunction ts1, + LogicalFunction lon2, LogicalFunction lat2, LogicalFunction r2, LogicalFunction ts2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(8); + parameters.push_back(std::move(lon1)); + parameters.push_back(std::move(lat1)); + parameters.push_back(std::move(r1)); + parameters.push_back(std::move(ts1)); + parameters.push_back(std::move(lon2)); + parameters.push_back(std::move(lat2)); + parameters.push_back(std::move(r2)); + parameters.push_back(std::move(ts2)); +} + +DataType NadTcbufferTcbufferLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction NadTcbufferTcbufferLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector NadTcbufferTcbufferLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction NadTcbufferTcbufferLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 8, + "NadTcbufferTcbufferLogicalFunction requires 8 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view NadTcbufferTcbufferLogicalFunction::getType() const { return NAME; } + +bool NadTcbufferTcbufferLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string NadTcbufferTcbufferLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction NadTcbufferTcbufferLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(8); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon1 must be FLOAT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat1 must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "r1 must be FLOAT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "lon2 must be FLOAT64"); + INVARIANT(c[5].getDataType().isType(DataType::Type::FLOAT64), "lat2 must be FLOAT64"); + INVARIANT(c[6].getDataType().isType(DataType::Type::FLOAT64), "r2 must be FLOAT64"); + INVARIANT(c[7].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); + return withChildren(c); +} + +SerializableFunction NadTcbufferTcbufferLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterNadTcbufferTcbufferLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 8, + "NadTcbufferTcbufferLogicalFunction requires 8 children but got {}", + arguments.children.size()); + return NadTcbufferTcbufferLogicalFunction(std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4]), + std::move(arguments.children[5]), + std::move(arguments.children[6]), + std::move(arguments.children[7])); +} + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AcoversTcbufferTcbufferPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AcoversTcbufferTcbufferPhysicalFunction.hpp new file mode 100644 index 0000000000..cac2f7aaa0 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AcoversTcbufferTcbufferPhysicalFunction.hpp @@ -0,0 +1,37 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class AcoversTcbufferTcbufferPhysicalFunction : public PhysicalFunctionConcept { +public: + AcoversTcbufferTcbufferPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction r1, + PhysicalFunction ts1, + PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction r2, + PhysicalFunction ts2); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AdisjointTcbufferTcbufferPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AdisjointTcbufferTcbufferPhysicalFunction.hpp new file mode 100644 index 0000000000..3b0c4c1d0f --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AdisjointTcbufferTcbufferPhysicalFunction.hpp @@ -0,0 +1,37 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class AdisjointTcbufferTcbufferPhysicalFunction : public PhysicalFunctionConcept { +public: + AdisjointTcbufferTcbufferPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction r1, + PhysicalFunction ts1, + PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction r2, + PhysicalFunction ts2); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AintersectsTcbufferTcbufferPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AintersectsTcbufferTcbufferPhysicalFunction.hpp new file mode 100644 index 0000000000..1bea980358 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AintersectsTcbufferTcbufferPhysicalFunction.hpp @@ -0,0 +1,37 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class AintersectsTcbufferTcbufferPhysicalFunction : public PhysicalFunctionConcept { +public: + AintersectsTcbufferTcbufferPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction r1, + PhysicalFunction ts1, + PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction r2, + PhysicalFunction ts2); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysEqTcbufferTcbufferPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysEqTcbufferTcbufferPhysicalFunction.hpp new file mode 100644 index 0000000000..0729d3718d --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysEqTcbufferTcbufferPhysicalFunction.hpp @@ -0,0 +1,37 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class AlwaysEqTcbufferTcbufferPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysEqTcbufferTcbufferPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction r1, + PhysicalFunction ts1, + PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction r2, + PhysicalFunction ts2); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysNeTcbufferTcbufferPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysNeTcbufferTcbufferPhysicalFunction.hpp new file mode 100644 index 0000000000..19395bb0f1 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysNeTcbufferTcbufferPhysicalFunction.hpp @@ -0,0 +1,37 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class AlwaysNeTcbufferTcbufferPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysNeTcbufferTcbufferPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction r1, + PhysicalFunction ts1, + PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction r2, + PhysicalFunction ts2); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AtouchesTcbufferTcbufferPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AtouchesTcbufferTcbufferPhysicalFunction.hpp new file mode 100644 index 0000000000..f1d60816f4 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AtouchesTcbufferTcbufferPhysicalFunction.hpp @@ -0,0 +1,37 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class AtouchesTcbufferTcbufferPhysicalFunction : public PhysicalFunctionConcept { +public: + AtouchesTcbufferTcbufferPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction r1, + PhysicalFunction ts1, + PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction r2, + PhysicalFunction ts2); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EcoversTcbufferTcbufferPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EcoversTcbufferTcbufferPhysicalFunction.hpp new file mode 100644 index 0000000000..ebd234cb88 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EcoversTcbufferTcbufferPhysicalFunction.hpp @@ -0,0 +1,37 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class EcoversTcbufferTcbufferPhysicalFunction : public PhysicalFunctionConcept { +public: + EcoversTcbufferTcbufferPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction r1, + PhysicalFunction ts1, + PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction r2, + PhysicalFunction ts2); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EintersectsTcbufferTcbufferPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EintersectsTcbufferTcbufferPhysicalFunction.hpp new file mode 100644 index 0000000000..d2b3e01556 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EintersectsTcbufferTcbufferPhysicalFunction.hpp @@ -0,0 +1,37 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class EintersectsTcbufferTcbufferPhysicalFunction : public PhysicalFunctionConcept { +public: + EintersectsTcbufferTcbufferPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction r1, + PhysicalFunction ts1, + PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction r2, + PhysicalFunction ts2); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EtouchesTcbufferTcbufferPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EtouchesTcbufferTcbufferPhysicalFunction.hpp new file mode 100644 index 0000000000..791dd19e8c --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EtouchesTcbufferTcbufferPhysicalFunction.hpp @@ -0,0 +1,37 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class EtouchesTcbufferTcbufferPhysicalFunction : public PhysicalFunctionConcept { +public: + EtouchesTcbufferTcbufferPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction r1, + PhysicalFunction ts1, + PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction r2, + PhysicalFunction ts2); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverEqTcbufferTcbufferPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverEqTcbufferTcbufferPhysicalFunction.hpp new file mode 100644 index 0000000000..8fef36a992 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverEqTcbufferTcbufferPhysicalFunction.hpp @@ -0,0 +1,37 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class EverEqTcbufferTcbufferPhysicalFunction : public PhysicalFunctionConcept { +public: + EverEqTcbufferTcbufferPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction r1, + PhysicalFunction ts1, + PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction r2, + PhysicalFunction ts2); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverNeTcbufferTcbufferPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverNeTcbufferTcbufferPhysicalFunction.hpp new file mode 100644 index 0000000000..28318c6b8b --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverNeTcbufferTcbufferPhysicalFunction.hpp @@ -0,0 +1,37 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class EverNeTcbufferTcbufferPhysicalFunction : public PhysicalFunctionConcept { +public: + EverNeTcbufferTcbufferPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction r1, + PhysicalFunction ts1, + PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction r2, + PhysicalFunction ts2); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/NadTcbufferTcbufferPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/NadTcbufferTcbufferPhysicalFunction.hpp new file mode 100644 index 0000000000..9de7220367 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/NadTcbufferTcbufferPhysicalFunction.hpp @@ -0,0 +1,37 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class NadTcbufferTcbufferPhysicalFunction : public PhysicalFunctionConcept { +public: + NadTcbufferTcbufferPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction r1, + PhysicalFunction ts1, + PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction r2, + PhysicalFunction ts2); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AcoversTcbufferTcbufferPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AcoversTcbufferTcbufferPhysicalFunction.cpp new file mode 100644 index 0000000000..b3b62e4503 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AcoversTcbufferTcbufferPhysicalFunction.cpp @@ -0,0 +1,112 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +AcoversTcbufferTcbufferPhysicalFunction::AcoversTcbufferTcbufferPhysicalFunction( + PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction r1, PhysicalFunction ts1, + PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction r2, PhysicalFunction ts2) +{ + paramFns.reserve(8); + paramFns.push_back(std::move(lon1)); + paramFns.push_back(std::move(lat1)); + paramFns.push_back(std::move(r1)); + paramFns.push_back(std::move(ts1)); + paramFns.push_back(std::move(lon2)); + paramFns.push_back(std::move(lat2)); + paramFns.push_back(std::move(r2)); + paramFns.push_back(std::move(ts2)); +} + +VarVal AcoversTcbufferTcbufferPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto lon1 = paramFns[0].execute(record, arena).cast(); + auto lat1 = paramFns[1].execute(record, arena).cast(); + auto r1 = paramFns[2].execute(record, arena).cast(); + auto ts1 = paramFns[3].execute(record, arena).cast(); + auto lon2 = paramFns[4].execute(record, arena).cast(); + auto lat2 = paramFns[5].execute(record, arena).cast(); + auto r2 = paramFns[6].execute(record, arena).cast(); + auto ts2 = paramFns[7].execute(record, arena).cast(); + + const auto result = nautilus::invoke( + +[](double lon1, double lat1, double r1, uint64_t ts1, + double lon2, double lat2, double r2, uint64_t ts2) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string pt1 = fmt::format("POINT({} {})", lon1, lat1); + GSERIALIZED* gs1 = geom_in(pt1.c_str(), -1); + if (!gs1) return 0.0; + Cbuffer* cb1 = cbuffer_make(gs1, r1); + free(gs1); + if (!cb1) return 0.0; + Temporal* tcb1 = (Temporal*)tcbufferinst_make(cb1, (TimestampTz)ts1); + free(cb1); + if (!tcb1) return 0.0; + std::string pt2 = fmt::format("POINT({} {})", lon2, lat2); + GSERIALIZED* gs2 = geom_in(pt2.c_str(), -1); + if (!gs2) { free(tcb1); return 0.0; } + Cbuffer* cb2 = cbuffer_make(gs2, r2); + free(gs2); + if (!cb2) { free(tcb1); return 0.0; } + Temporal* tcb2 = (Temporal*)tcbufferinst_make(cb2, (TimestampTz)ts2); + free(cb2); + if (!tcb2) { free(tcb1); return 0.0; } + int r = acovers_tcbuffer_tcbuffer(tcb1, tcb2); + free(tcb1); free(tcb2); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + lon1, lat1, r1, ts1, lon2, lat2, r2, ts2); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAcoversTcbufferTcbufferPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 8, + "AcoversTcbufferTcbufferPhysicalFunction requires 8 children but got {}", + arguments.childFunctions.size()); + return AcoversTcbufferTcbufferPhysicalFunction(std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4]), + std::move(arguments.childFunctions[5]), + std::move(arguments.childFunctions[6]), + std::move(arguments.childFunctions[7])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AdisjointTcbufferTcbufferPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AdisjointTcbufferTcbufferPhysicalFunction.cpp new file mode 100644 index 0000000000..99b5187524 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AdisjointTcbufferTcbufferPhysicalFunction.cpp @@ -0,0 +1,112 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +AdisjointTcbufferTcbufferPhysicalFunction::AdisjointTcbufferTcbufferPhysicalFunction( + PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction r1, PhysicalFunction ts1, + PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction r2, PhysicalFunction ts2) +{ + paramFns.reserve(8); + paramFns.push_back(std::move(lon1)); + paramFns.push_back(std::move(lat1)); + paramFns.push_back(std::move(r1)); + paramFns.push_back(std::move(ts1)); + paramFns.push_back(std::move(lon2)); + paramFns.push_back(std::move(lat2)); + paramFns.push_back(std::move(r2)); + paramFns.push_back(std::move(ts2)); +} + +VarVal AdisjointTcbufferTcbufferPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto lon1 = paramFns[0].execute(record, arena).cast(); + auto lat1 = paramFns[1].execute(record, arena).cast(); + auto r1 = paramFns[2].execute(record, arena).cast(); + auto ts1 = paramFns[3].execute(record, arena).cast(); + auto lon2 = paramFns[4].execute(record, arena).cast(); + auto lat2 = paramFns[5].execute(record, arena).cast(); + auto r2 = paramFns[6].execute(record, arena).cast(); + auto ts2 = paramFns[7].execute(record, arena).cast(); + + const auto result = nautilus::invoke( + +[](double lon1, double lat1, double r1, uint64_t ts1, + double lon2, double lat2, double r2, uint64_t ts2) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string pt1 = fmt::format("POINT({} {})", lon1, lat1); + GSERIALIZED* gs1 = geom_in(pt1.c_str(), -1); + if (!gs1) return 0.0; + Cbuffer* cb1 = cbuffer_make(gs1, r1); + free(gs1); + if (!cb1) return 0.0; + Temporal* tcb1 = (Temporal*)tcbufferinst_make(cb1, (TimestampTz)ts1); + free(cb1); + if (!tcb1) return 0.0; + std::string pt2 = fmt::format("POINT({} {})", lon2, lat2); + GSERIALIZED* gs2 = geom_in(pt2.c_str(), -1); + if (!gs2) { free(tcb1); return 0.0; } + Cbuffer* cb2 = cbuffer_make(gs2, r2); + free(gs2); + if (!cb2) { free(tcb1); return 0.0; } + Temporal* tcb2 = (Temporal*)tcbufferinst_make(cb2, (TimestampTz)ts2); + free(cb2); + if (!tcb2) { free(tcb1); return 0.0; } + int r = adisjoint_tcbuffer_tcbuffer(tcb1, tcb2); + free(tcb1); free(tcb2); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + lon1, lat1, r1, ts1, lon2, lat2, r2, ts2); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAdisjointTcbufferTcbufferPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 8, + "AdisjointTcbufferTcbufferPhysicalFunction requires 8 children but got {}", + arguments.childFunctions.size()); + return AdisjointTcbufferTcbufferPhysicalFunction(std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4]), + std::move(arguments.childFunctions[5]), + std::move(arguments.childFunctions[6]), + std::move(arguments.childFunctions[7])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AintersectsTcbufferTcbufferPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AintersectsTcbufferTcbufferPhysicalFunction.cpp new file mode 100644 index 0000000000..ffec1430f4 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AintersectsTcbufferTcbufferPhysicalFunction.cpp @@ -0,0 +1,112 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +AintersectsTcbufferTcbufferPhysicalFunction::AintersectsTcbufferTcbufferPhysicalFunction( + PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction r1, PhysicalFunction ts1, + PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction r2, PhysicalFunction ts2) +{ + paramFns.reserve(8); + paramFns.push_back(std::move(lon1)); + paramFns.push_back(std::move(lat1)); + paramFns.push_back(std::move(r1)); + paramFns.push_back(std::move(ts1)); + paramFns.push_back(std::move(lon2)); + paramFns.push_back(std::move(lat2)); + paramFns.push_back(std::move(r2)); + paramFns.push_back(std::move(ts2)); +} + +VarVal AintersectsTcbufferTcbufferPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto lon1 = paramFns[0].execute(record, arena).cast(); + auto lat1 = paramFns[1].execute(record, arena).cast(); + auto r1 = paramFns[2].execute(record, arena).cast(); + auto ts1 = paramFns[3].execute(record, arena).cast(); + auto lon2 = paramFns[4].execute(record, arena).cast(); + auto lat2 = paramFns[5].execute(record, arena).cast(); + auto r2 = paramFns[6].execute(record, arena).cast(); + auto ts2 = paramFns[7].execute(record, arena).cast(); + + const auto result = nautilus::invoke( + +[](double lon1, double lat1, double r1, uint64_t ts1, + double lon2, double lat2, double r2, uint64_t ts2) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string pt1 = fmt::format("POINT({} {})", lon1, lat1); + GSERIALIZED* gs1 = geom_in(pt1.c_str(), -1); + if (!gs1) return 0.0; + Cbuffer* cb1 = cbuffer_make(gs1, r1); + free(gs1); + if (!cb1) return 0.0; + Temporal* tcb1 = (Temporal*)tcbufferinst_make(cb1, (TimestampTz)ts1); + free(cb1); + if (!tcb1) return 0.0; + std::string pt2 = fmt::format("POINT({} {})", lon2, lat2); + GSERIALIZED* gs2 = geom_in(pt2.c_str(), -1); + if (!gs2) { free(tcb1); return 0.0; } + Cbuffer* cb2 = cbuffer_make(gs2, r2); + free(gs2); + if (!cb2) { free(tcb1); return 0.0; } + Temporal* tcb2 = (Temporal*)tcbufferinst_make(cb2, (TimestampTz)ts2); + free(cb2); + if (!tcb2) { free(tcb1); return 0.0; } + int r = aintersects_tcbuffer_tcbuffer(tcb1, tcb2); + free(tcb1); free(tcb2); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + lon1, lat1, r1, ts1, lon2, lat2, r2, ts2); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAintersectsTcbufferTcbufferPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 8, + "AintersectsTcbufferTcbufferPhysicalFunction requires 8 children but got {}", + arguments.childFunctions.size()); + return AintersectsTcbufferTcbufferPhysicalFunction(std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4]), + std::move(arguments.childFunctions[5]), + std::move(arguments.childFunctions[6]), + std::move(arguments.childFunctions[7])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysEqTcbufferTcbufferPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysEqTcbufferTcbufferPhysicalFunction.cpp new file mode 100644 index 0000000000..acd2036781 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysEqTcbufferTcbufferPhysicalFunction.cpp @@ -0,0 +1,112 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +AlwaysEqTcbufferTcbufferPhysicalFunction::AlwaysEqTcbufferTcbufferPhysicalFunction( + PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction r1, PhysicalFunction ts1, + PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction r2, PhysicalFunction ts2) +{ + paramFns.reserve(8); + paramFns.push_back(std::move(lon1)); + paramFns.push_back(std::move(lat1)); + paramFns.push_back(std::move(r1)); + paramFns.push_back(std::move(ts1)); + paramFns.push_back(std::move(lon2)); + paramFns.push_back(std::move(lat2)); + paramFns.push_back(std::move(r2)); + paramFns.push_back(std::move(ts2)); +} + +VarVal AlwaysEqTcbufferTcbufferPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto lon1 = paramFns[0].execute(record, arena).cast(); + auto lat1 = paramFns[1].execute(record, arena).cast(); + auto r1 = paramFns[2].execute(record, arena).cast(); + auto ts1 = paramFns[3].execute(record, arena).cast(); + auto lon2 = paramFns[4].execute(record, arena).cast(); + auto lat2 = paramFns[5].execute(record, arena).cast(); + auto r2 = paramFns[6].execute(record, arena).cast(); + auto ts2 = paramFns[7].execute(record, arena).cast(); + + const auto result = nautilus::invoke( + +[](double lon1, double lat1, double r1, uint64_t ts1, + double lon2, double lat2, double r2, uint64_t ts2) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string pt1 = fmt::format("POINT({} {})", lon1, lat1); + GSERIALIZED* gs1 = geom_in(pt1.c_str(), -1); + if (!gs1) return 0.0; + Cbuffer* cb1 = cbuffer_make(gs1, r1); + free(gs1); + if (!cb1) return 0.0; + Temporal* tcb1 = (Temporal*)tcbufferinst_make(cb1, (TimestampTz)ts1); + free(cb1); + if (!tcb1) return 0.0; + std::string pt2 = fmt::format("POINT({} {})", lon2, lat2); + GSERIALIZED* gs2 = geom_in(pt2.c_str(), -1); + if (!gs2) { free(tcb1); return 0.0; } + Cbuffer* cb2 = cbuffer_make(gs2, r2); + free(gs2); + if (!cb2) { free(tcb1); return 0.0; } + Temporal* tcb2 = (Temporal*)tcbufferinst_make(cb2, (TimestampTz)ts2); + free(cb2); + if (!tcb2) { free(tcb1); return 0.0; } + int r = always_eq_tcbuffer_tcbuffer(tcb1, tcb2); + free(tcb1); free(tcb2); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + lon1, lat1, r1, ts1, lon2, lat2, r2, ts2); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysEqTcbufferTcbufferPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 8, + "AlwaysEqTcbufferTcbufferPhysicalFunction requires 8 children but got {}", + arguments.childFunctions.size()); + return AlwaysEqTcbufferTcbufferPhysicalFunction(std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4]), + std::move(arguments.childFunctions[5]), + std::move(arguments.childFunctions[6]), + std::move(arguments.childFunctions[7])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysNeTcbufferTcbufferPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysNeTcbufferTcbufferPhysicalFunction.cpp new file mode 100644 index 0000000000..e142ca34b0 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysNeTcbufferTcbufferPhysicalFunction.cpp @@ -0,0 +1,112 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +AlwaysNeTcbufferTcbufferPhysicalFunction::AlwaysNeTcbufferTcbufferPhysicalFunction( + PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction r1, PhysicalFunction ts1, + PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction r2, PhysicalFunction ts2) +{ + paramFns.reserve(8); + paramFns.push_back(std::move(lon1)); + paramFns.push_back(std::move(lat1)); + paramFns.push_back(std::move(r1)); + paramFns.push_back(std::move(ts1)); + paramFns.push_back(std::move(lon2)); + paramFns.push_back(std::move(lat2)); + paramFns.push_back(std::move(r2)); + paramFns.push_back(std::move(ts2)); +} + +VarVal AlwaysNeTcbufferTcbufferPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto lon1 = paramFns[0].execute(record, arena).cast(); + auto lat1 = paramFns[1].execute(record, arena).cast(); + auto r1 = paramFns[2].execute(record, arena).cast(); + auto ts1 = paramFns[3].execute(record, arena).cast(); + auto lon2 = paramFns[4].execute(record, arena).cast(); + auto lat2 = paramFns[5].execute(record, arena).cast(); + auto r2 = paramFns[6].execute(record, arena).cast(); + auto ts2 = paramFns[7].execute(record, arena).cast(); + + const auto result = nautilus::invoke( + +[](double lon1, double lat1, double r1, uint64_t ts1, + double lon2, double lat2, double r2, uint64_t ts2) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string pt1 = fmt::format("POINT({} {})", lon1, lat1); + GSERIALIZED* gs1 = geom_in(pt1.c_str(), -1); + if (!gs1) return 0.0; + Cbuffer* cb1 = cbuffer_make(gs1, r1); + free(gs1); + if (!cb1) return 0.0; + Temporal* tcb1 = (Temporal*)tcbufferinst_make(cb1, (TimestampTz)ts1); + free(cb1); + if (!tcb1) return 0.0; + std::string pt2 = fmt::format("POINT({} {})", lon2, lat2); + GSERIALIZED* gs2 = geom_in(pt2.c_str(), -1); + if (!gs2) { free(tcb1); return 0.0; } + Cbuffer* cb2 = cbuffer_make(gs2, r2); + free(gs2); + if (!cb2) { free(tcb1); return 0.0; } + Temporal* tcb2 = (Temporal*)tcbufferinst_make(cb2, (TimestampTz)ts2); + free(cb2); + if (!tcb2) { free(tcb1); return 0.0; } + int r = always_ne_tcbuffer_tcbuffer(tcb1, tcb2); + free(tcb1); free(tcb2); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + lon1, lat1, r1, ts1, lon2, lat2, r2, ts2); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysNeTcbufferTcbufferPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 8, + "AlwaysNeTcbufferTcbufferPhysicalFunction requires 8 children but got {}", + arguments.childFunctions.size()); + return AlwaysNeTcbufferTcbufferPhysicalFunction(std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4]), + std::move(arguments.childFunctions[5]), + std::move(arguments.childFunctions[6]), + std::move(arguments.childFunctions[7])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AtouchesTcbufferTcbufferPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AtouchesTcbufferTcbufferPhysicalFunction.cpp new file mode 100644 index 0000000000..9c77f7d23a --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AtouchesTcbufferTcbufferPhysicalFunction.cpp @@ -0,0 +1,112 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +AtouchesTcbufferTcbufferPhysicalFunction::AtouchesTcbufferTcbufferPhysicalFunction( + PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction r1, PhysicalFunction ts1, + PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction r2, PhysicalFunction ts2) +{ + paramFns.reserve(8); + paramFns.push_back(std::move(lon1)); + paramFns.push_back(std::move(lat1)); + paramFns.push_back(std::move(r1)); + paramFns.push_back(std::move(ts1)); + paramFns.push_back(std::move(lon2)); + paramFns.push_back(std::move(lat2)); + paramFns.push_back(std::move(r2)); + paramFns.push_back(std::move(ts2)); +} + +VarVal AtouchesTcbufferTcbufferPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto lon1 = paramFns[0].execute(record, arena).cast(); + auto lat1 = paramFns[1].execute(record, arena).cast(); + auto r1 = paramFns[2].execute(record, arena).cast(); + auto ts1 = paramFns[3].execute(record, arena).cast(); + auto lon2 = paramFns[4].execute(record, arena).cast(); + auto lat2 = paramFns[5].execute(record, arena).cast(); + auto r2 = paramFns[6].execute(record, arena).cast(); + auto ts2 = paramFns[7].execute(record, arena).cast(); + + const auto result = nautilus::invoke( + +[](double lon1, double lat1, double r1, uint64_t ts1, + double lon2, double lat2, double r2, uint64_t ts2) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string pt1 = fmt::format("POINT({} {})", lon1, lat1); + GSERIALIZED* gs1 = geom_in(pt1.c_str(), -1); + if (!gs1) return 0.0; + Cbuffer* cb1 = cbuffer_make(gs1, r1); + free(gs1); + if (!cb1) return 0.0; + Temporal* tcb1 = (Temporal*)tcbufferinst_make(cb1, (TimestampTz)ts1); + free(cb1); + if (!tcb1) return 0.0; + std::string pt2 = fmt::format("POINT({} {})", lon2, lat2); + GSERIALIZED* gs2 = geom_in(pt2.c_str(), -1); + if (!gs2) { free(tcb1); return 0.0; } + Cbuffer* cb2 = cbuffer_make(gs2, r2); + free(gs2); + if (!cb2) { free(tcb1); return 0.0; } + Temporal* tcb2 = (Temporal*)tcbufferinst_make(cb2, (TimestampTz)ts2); + free(cb2); + if (!tcb2) { free(tcb1); return 0.0; } + int r = atouches_tcbuffer_tcbuffer(tcb1, tcb2); + free(tcb1); free(tcb2); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + lon1, lat1, r1, ts1, lon2, lat2, r2, ts2); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAtouchesTcbufferTcbufferPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 8, + "AtouchesTcbufferTcbufferPhysicalFunction requires 8 children but got {}", + arguments.childFunctions.size()); + return AtouchesTcbufferTcbufferPhysicalFunction(std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4]), + std::move(arguments.childFunctions[5]), + std::move(arguments.childFunctions[6]), + std::move(arguments.childFunctions[7])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt index 8a7351169f..9873b4aa00 100644 --- a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt @@ -364,6 +364,18 @@ add_plugin(AlwaysEqTcbufferCbuffer PhysicalFunction nes-physical-operators Alway add_plugin(EverNeTcbufferCbuffer PhysicalFunction nes-physical-operators EverNeTcbufferCbufferPhysicalFunction.cpp) add_plugin(AlwaysNeTcbufferCbuffer PhysicalFunction nes-physical-operators AlwaysNeTcbufferCbufferPhysicalFunction.cpp) add_plugin(NadTcbufferCbuffer PhysicalFunction nes-physical-operators NadTcbufferCbufferPhysicalFunction.cpp) +add_plugin(EverEqTcbufferTcbuffer PhysicalFunction nes-physical-operators EverEqTcbufferTcbufferPhysicalFunction.cpp) +add_plugin(AlwaysEqTcbufferTcbuffer PhysicalFunction nes-physical-operators AlwaysEqTcbufferTcbufferPhysicalFunction.cpp) +add_plugin(EverNeTcbufferTcbuffer PhysicalFunction nes-physical-operators EverNeTcbufferTcbufferPhysicalFunction.cpp) +add_plugin(AlwaysNeTcbufferTcbuffer PhysicalFunction nes-physical-operators AlwaysNeTcbufferTcbufferPhysicalFunction.cpp) +add_plugin(EintersectsTcbufferTcbuffer PhysicalFunction nes-physical-operators EintersectsTcbufferTcbufferPhysicalFunction.cpp) +add_plugin(AintersectsTcbufferTcbuffer PhysicalFunction nes-physical-operators AintersectsTcbufferTcbufferPhysicalFunction.cpp) +add_plugin(EcoversTcbufferTcbuffer PhysicalFunction nes-physical-operators EcoversTcbufferTcbufferPhysicalFunction.cpp) +add_plugin(AcoversTcbufferTcbuffer PhysicalFunction nes-physical-operators AcoversTcbufferTcbufferPhysicalFunction.cpp) +add_plugin(AdisjointTcbufferTcbuffer PhysicalFunction nes-physical-operators AdisjointTcbufferTcbufferPhysicalFunction.cpp) +add_plugin(EtouchesTcbufferTcbuffer PhysicalFunction nes-physical-operators EtouchesTcbufferTcbufferPhysicalFunction.cpp) +add_plugin(AtouchesTcbufferTcbuffer PhysicalFunction nes-physical-operators AtouchesTcbufferTcbufferPhysicalFunction.cpp) +add_plugin(NadTcbufferTcbuffer PhysicalFunction nes-physical-operators NadTcbufferTcbufferPhysicalFunction.cpp) add_plugin(GeomIntersects2d PhysicalFunction nes-physical-operators GeomIntersects2dPhysicalFunction.cpp) add_plugin(GeomDwithin2d PhysicalFunction nes-physical-operators GeomDwithin2dPhysicalFunction.cpp) add_plugin(GeomContains PhysicalFunction nes-physical-operators GeomContainsPhysicalFunction.cpp) diff --git a/nes-physical-operators/src/Functions/Meos/EcoversTcbufferTcbufferPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EcoversTcbufferTcbufferPhysicalFunction.cpp new file mode 100644 index 0000000000..7aac08ea8c --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EcoversTcbufferTcbufferPhysicalFunction.cpp @@ -0,0 +1,112 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +EcoversTcbufferTcbufferPhysicalFunction::EcoversTcbufferTcbufferPhysicalFunction( + PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction r1, PhysicalFunction ts1, + PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction r2, PhysicalFunction ts2) +{ + paramFns.reserve(8); + paramFns.push_back(std::move(lon1)); + paramFns.push_back(std::move(lat1)); + paramFns.push_back(std::move(r1)); + paramFns.push_back(std::move(ts1)); + paramFns.push_back(std::move(lon2)); + paramFns.push_back(std::move(lat2)); + paramFns.push_back(std::move(r2)); + paramFns.push_back(std::move(ts2)); +} + +VarVal EcoversTcbufferTcbufferPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto lon1 = paramFns[0].execute(record, arena).cast(); + auto lat1 = paramFns[1].execute(record, arena).cast(); + auto r1 = paramFns[2].execute(record, arena).cast(); + auto ts1 = paramFns[3].execute(record, arena).cast(); + auto lon2 = paramFns[4].execute(record, arena).cast(); + auto lat2 = paramFns[5].execute(record, arena).cast(); + auto r2 = paramFns[6].execute(record, arena).cast(); + auto ts2 = paramFns[7].execute(record, arena).cast(); + + const auto result = nautilus::invoke( + +[](double lon1, double lat1, double r1, uint64_t ts1, + double lon2, double lat2, double r2, uint64_t ts2) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string pt1 = fmt::format("POINT({} {})", lon1, lat1); + GSERIALIZED* gs1 = geom_in(pt1.c_str(), -1); + if (!gs1) return 0.0; + Cbuffer* cb1 = cbuffer_make(gs1, r1); + free(gs1); + if (!cb1) return 0.0; + Temporal* tcb1 = (Temporal*)tcbufferinst_make(cb1, (TimestampTz)ts1); + free(cb1); + if (!tcb1) return 0.0; + std::string pt2 = fmt::format("POINT({} {})", lon2, lat2); + GSERIALIZED* gs2 = geom_in(pt2.c_str(), -1); + if (!gs2) { free(tcb1); return 0.0; } + Cbuffer* cb2 = cbuffer_make(gs2, r2); + free(gs2); + if (!cb2) { free(tcb1); return 0.0; } + Temporal* tcb2 = (Temporal*)tcbufferinst_make(cb2, (TimestampTz)ts2); + free(cb2); + if (!tcb2) { free(tcb1); return 0.0; } + int r = ecovers_tcbuffer_tcbuffer(tcb1, tcb2); + free(tcb1); free(tcb2); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + lon1, lat1, r1, ts1, lon2, lat2, r2, ts2); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEcoversTcbufferTcbufferPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 8, + "EcoversTcbufferTcbufferPhysicalFunction requires 8 children but got {}", + arguments.childFunctions.size()); + return EcoversTcbufferTcbufferPhysicalFunction(std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4]), + std::move(arguments.childFunctions[5]), + std::move(arguments.childFunctions[6]), + std::move(arguments.childFunctions[7])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EintersectsTcbufferTcbufferPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EintersectsTcbufferTcbufferPhysicalFunction.cpp new file mode 100644 index 0000000000..b0adf16a3f --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EintersectsTcbufferTcbufferPhysicalFunction.cpp @@ -0,0 +1,112 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +EintersectsTcbufferTcbufferPhysicalFunction::EintersectsTcbufferTcbufferPhysicalFunction( + PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction r1, PhysicalFunction ts1, + PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction r2, PhysicalFunction ts2) +{ + paramFns.reserve(8); + paramFns.push_back(std::move(lon1)); + paramFns.push_back(std::move(lat1)); + paramFns.push_back(std::move(r1)); + paramFns.push_back(std::move(ts1)); + paramFns.push_back(std::move(lon2)); + paramFns.push_back(std::move(lat2)); + paramFns.push_back(std::move(r2)); + paramFns.push_back(std::move(ts2)); +} + +VarVal EintersectsTcbufferTcbufferPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto lon1 = paramFns[0].execute(record, arena).cast(); + auto lat1 = paramFns[1].execute(record, arena).cast(); + auto r1 = paramFns[2].execute(record, arena).cast(); + auto ts1 = paramFns[3].execute(record, arena).cast(); + auto lon2 = paramFns[4].execute(record, arena).cast(); + auto lat2 = paramFns[5].execute(record, arena).cast(); + auto r2 = paramFns[6].execute(record, arena).cast(); + auto ts2 = paramFns[7].execute(record, arena).cast(); + + const auto result = nautilus::invoke( + +[](double lon1, double lat1, double r1, uint64_t ts1, + double lon2, double lat2, double r2, uint64_t ts2) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string pt1 = fmt::format("POINT({} {})", lon1, lat1); + GSERIALIZED* gs1 = geom_in(pt1.c_str(), -1); + if (!gs1) return 0.0; + Cbuffer* cb1 = cbuffer_make(gs1, r1); + free(gs1); + if (!cb1) return 0.0; + Temporal* tcb1 = (Temporal*)tcbufferinst_make(cb1, (TimestampTz)ts1); + free(cb1); + if (!tcb1) return 0.0; + std::string pt2 = fmt::format("POINT({} {})", lon2, lat2); + GSERIALIZED* gs2 = geom_in(pt2.c_str(), -1); + if (!gs2) { free(tcb1); return 0.0; } + Cbuffer* cb2 = cbuffer_make(gs2, r2); + free(gs2); + if (!cb2) { free(tcb1); return 0.0; } + Temporal* tcb2 = (Temporal*)tcbufferinst_make(cb2, (TimestampTz)ts2); + free(cb2); + if (!tcb2) { free(tcb1); return 0.0; } + int r = eintersects_tcbuffer_tcbuffer(tcb1, tcb2); + free(tcb1); free(tcb2); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + lon1, lat1, r1, ts1, lon2, lat2, r2, ts2); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEintersectsTcbufferTcbufferPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 8, + "EintersectsTcbufferTcbufferPhysicalFunction requires 8 children but got {}", + arguments.childFunctions.size()); + return EintersectsTcbufferTcbufferPhysicalFunction(std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4]), + std::move(arguments.childFunctions[5]), + std::move(arguments.childFunctions[6]), + std::move(arguments.childFunctions[7])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EtouchesTcbufferTcbufferPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EtouchesTcbufferTcbufferPhysicalFunction.cpp new file mode 100644 index 0000000000..987ae7c18c --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EtouchesTcbufferTcbufferPhysicalFunction.cpp @@ -0,0 +1,112 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +EtouchesTcbufferTcbufferPhysicalFunction::EtouchesTcbufferTcbufferPhysicalFunction( + PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction r1, PhysicalFunction ts1, + PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction r2, PhysicalFunction ts2) +{ + paramFns.reserve(8); + paramFns.push_back(std::move(lon1)); + paramFns.push_back(std::move(lat1)); + paramFns.push_back(std::move(r1)); + paramFns.push_back(std::move(ts1)); + paramFns.push_back(std::move(lon2)); + paramFns.push_back(std::move(lat2)); + paramFns.push_back(std::move(r2)); + paramFns.push_back(std::move(ts2)); +} + +VarVal EtouchesTcbufferTcbufferPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto lon1 = paramFns[0].execute(record, arena).cast(); + auto lat1 = paramFns[1].execute(record, arena).cast(); + auto r1 = paramFns[2].execute(record, arena).cast(); + auto ts1 = paramFns[3].execute(record, arena).cast(); + auto lon2 = paramFns[4].execute(record, arena).cast(); + auto lat2 = paramFns[5].execute(record, arena).cast(); + auto r2 = paramFns[6].execute(record, arena).cast(); + auto ts2 = paramFns[7].execute(record, arena).cast(); + + const auto result = nautilus::invoke( + +[](double lon1, double lat1, double r1, uint64_t ts1, + double lon2, double lat2, double r2, uint64_t ts2) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string pt1 = fmt::format("POINT({} {})", lon1, lat1); + GSERIALIZED* gs1 = geom_in(pt1.c_str(), -1); + if (!gs1) return 0.0; + Cbuffer* cb1 = cbuffer_make(gs1, r1); + free(gs1); + if (!cb1) return 0.0; + Temporal* tcb1 = (Temporal*)tcbufferinst_make(cb1, (TimestampTz)ts1); + free(cb1); + if (!tcb1) return 0.0; + std::string pt2 = fmt::format("POINT({} {})", lon2, lat2); + GSERIALIZED* gs2 = geom_in(pt2.c_str(), -1); + if (!gs2) { free(tcb1); return 0.0; } + Cbuffer* cb2 = cbuffer_make(gs2, r2); + free(gs2); + if (!cb2) { free(tcb1); return 0.0; } + Temporal* tcb2 = (Temporal*)tcbufferinst_make(cb2, (TimestampTz)ts2); + free(cb2); + if (!tcb2) { free(tcb1); return 0.0; } + int r = etouches_tcbuffer_tcbuffer(tcb1, tcb2); + free(tcb1); free(tcb2); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + lon1, lat1, r1, ts1, lon2, lat2, r2, ts2); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEtouchesTcbufferTcbufferPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 8, + "EtouchesTcbufferTcbufferPhysicalFunction requires 8 children but got {}", + arguments.childFunctions.size()); + return EtouchesTcbufferTcbufferPhysicalFunction(std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4]), + std::move(arguments.childFunctions[5]), + std::move(arguments.childFunctions[6]), + std::move(arguments.childFunctions[7])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverEqTcbufferTcbufferPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverEqTcbufferTcbufferPhysicalFunction.cpp new file mode 100644 index 0000000000..7f3fc0d69d --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverEqTcbufferTcbufferPhysicalFunction.cpp @@ -0,0 +1,112 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +EverEqTcbufferTcbufferPhysicalFunction::EverEqTcbufferTcbufferPhysicalFunction( + PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction r1, PhysicalFunction ts1, + PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction r2, PhysicalFunction ts2) +{ + paramFns.reserve(8); + paramFns.push_back(std::move(lon1)); + paramFns.push_back(std::move(lat1)); + paramFns.push_back(std::move(r1)); + paramFns.push_back(std::move(ts1)); + paramFns.push_back(std::move(lon2)); + paramFns.push_back(std::move(lat2)); + paramFns.push_back(std::move(r2)); + paramFns.push_back(std::move(ts2)); +} + +VarVal EverEqTcbufferTcbufferPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto lon1 = paramFns[0].execute(record, arena).cast(); + auto lat1 = paramFns[1].execute(record, arena).cast(); + auto r1 = paramFns[2].execute(record, arena).cast(); + auto ts1 = paramFns[3].execute(record, arena).cast(); + auto lon2 = paramFns[4].execute(record, arena).cast(); + auto lat2 = paramFns[5].execute(record, arena).cast(); + auto r2 = paramFns[6].execute(record, arena).cast(); + auto ts2 = paramFns[7].execute(record, arena).cast(); + + const auto result = nautilus::invoke( + +[](double lon1, double lat1, double r1, uint64_t ts1, + double lon2, double lat2, double r2, uint64_t ts2) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string pt1 = fmt::format("POINT({} {})", lon1, lat1); + GSERIALIZED* gs1 = geom_in(pt1.c_str(), -1); + if (!gs1) return 0.0; + Cbuffer* cb1 = cbuffer_make(gs1, r1); + free(gs1); + if (!cb1) return 0.0; + Temporal* tcb1 = (Temporal*)tcbufferinst_make(cb1, (TimestampTz)ts1); + free(cb1); + if (!tcb1) return 0.0; + std::string pt2 = fmt::format("POINT({} {})", lon2, lat2); + GSERIALIZED* gs2 = geom_in(pt2.c_str(), -1); + if (!gs2) { free(tcb1); return 0.0; } + Cbuffer* cb2 = cbuffer_make(gs2, r2); + free(gs2); + if (!cb2) { free(tcb1); return 0.0; } + Temporal* tcb2 = (Temporal*)tcbufferinst_make(cb2, (TimestampTz)ts2); + free(cb2); + if (!tcb2) { free(tcb1); return 0.0; } + int r = ever_eq_tcbuffer_tcbuffer(tcb1, tcb2); + free(tcb1); free(tcb2); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + lon1, lat1, r1, ts1, lon2, lat2, r2, ts2); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverEqTcbufferTcbufferPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 8, + "EverEqTcbufferTcbufferPhysicalFunction requires 8 children but got {}", + arguments.childFunctions.size()); + return EverEqTcbufferTcbufferPhysicalFunction(std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4]), + std::move(arguments.childFunctions[5]), + std::move(arguments.childFunctions[6]), + std::move(arguments.childFunctions[7])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverNeTcbufferTcbufferPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverNeTcbufferTcbufferPhysicalFunction.cpp new file mode 100644 index 0000000000..10f7ece074 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverNeTcbufferTcbufferPhysicalFunction.cpp @@ -0,0 +1,112 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +EverNeTcbufferTcbufferPhysicalFunction::EverNeTcbufferTcbufferPhysicalFunction( + PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction r1, PhysicalFunction ts1, + PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction r2, PhysicalFunction ts2) +{ + paramFns.reserve(8); + paramFns.push_back(std::move(lon1)); + paramFns.push_back(std::move(lat1)); + paramFns.push_back(std::move(r1)); + paramFns.push_back(std::move(ts1)); + paramFns.push_back(std::move(lon2)); + paramFns.push_back(std::move(lat2)); + paramFns.push_back(std::move(r2)); + paramFns.push_back(std::move(ts2)); +} + +VarVal EverNeTcbufferTcbufferPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto lon1 = paramFns[0].execute(record, arena).cast(); + auto lat1 = paramFns[1].execute(record, arena).cast(); + auto r1 = paramFns[2].execute(record, arena).cast(); + auto ts1 = paramFns[3].execute(record, arena).cast(); + auto lon2 = paramFns[4].execute(record, arena).cast(); + auto lat2 = paramFns[5].execute(record, arena).cast(); + auto r2 = paramFns[6].execute(record, arena).cast(); + auto ts2 = paramFns[7].execute(record, arena).cast(); + + const auto result = nautilus::invoke( + +[](double lon1, double lat1, double r1, uint64_t ts1, + double lon2, double lat2, double r2, uint64_t ts2) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string pt1 = fmt::format("POINT({} {})", lon1, lat1); + GSERIALIZED* gs1 = geom_in(pt1.c_str(), -1); + if (!gs1) return 0.0; + Cbuffer* cb1 = cbuffer_make(gs1, r1); + free(gs1); + if (!cb1) return 0.0; + Temporal* tcb1 = (Temporal*)tcbufferinst_make(cb1, (TimestampTz)ts1); + free(cb1); + if (!tcb1) return 0.0; + std::string pt2 = fmt::format("POINT({} {})", lon2, lat2); + GSERIALIZED* gs2 = geom_in(pt2.c_str(), -1); + if (!gs2) { free(tcb1); return 0.0; } + Cbuffer* cb2 = cbuffer_make(gs2, r2); + free(gs2); + if (!cb2) { free(tcb1); return 0.0; } + Temporal* tcb2 = (Temporal*)tcbufferinst_make(cb2, (TimestampTz)ts2); + free(cb2); + if (!tcb2) { free(tcb1); return 0.0; } + int r = ever_ne_tcbuffer_tcbuffer(tcb1, tcb2); + free(tcb1); free(tcb2); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + lon1, lat1, r1, ts1, lon2, lat2, r2, ts2); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverNeTcbufferTcbufferPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 8, + "EverNeTcbufferTcbufferPhysicalFunction requires 8 children but got {}", + arguments.childFunctions.size()); + return EverNeTcbufferTcbufferPhysicalFunction(std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4]), + std::move(arguments.childFunctions[5]), + std::move(arguments.childFunctions[6]), + std::move(arguments.childFunctions[7])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/NadTcbufferTcbufferPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/NadTcbufferTcbufferPhysicalFunction.cpp new file mode 100644 index 0000000000..d55646d9de --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/NadTcbufferTcbufferPhysicalFunction.cpp @@ -0,0 +1,112 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +NadTcbufferTcbufferPhysicalFunction::NadTcbufferTcbufferPhysicalFunction( + PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction r1, PhysicalFunction ts1, + PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction r2, PhysicalFunction ts2) +{ + paramFns.reserve(8); + paramFns.push_back(std::move(lon1)); + paramFns.push_back(std::move(lat1)); + paramFns.push_back(std::move(r1)); + paramFns.push_back(std::move(ts1)); + paramFns.push_back(std::move(lon2)); + paramFns.push_back(std::move(lat2)); + paramFns.push_back(std::move(r2)); + paramFns.push_back(std::move(ts2)); +} + +VarVal NadTcbufferTcbufferPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto lon1 = paramFns[0].execute(record, arena).cast(); + auto lat1 = paramFns[1].execute(record, arena).cast(); + auto r1 = paramFns[2].execute(record, arena).cast(); + auto ts1 = paramFns[3].execute(record, arena).cast(); + auto lon2 = paramFns[4].execute(record, arena).cast(); + auto lat2 = paramFns[5].execute(record, arena).cast(); + auto r2 = paramFns[6].execute(record, arena).cast(); + auto ts2 = paramFns[7].execute(record, arena).cast(); + + const auto result = nautilus::invoke( + +[](double lon1, double lat1, double r1, uint64_t ts1, + double lon2, double lat2, double r2, uint64_t ts2) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string pt1 = fmt::format("POINT({} {})", lon1, lat1); + GSERIALIZED* gs1 = geom_in(pt1.c_str(), -1); + if (!gs1) return 0.0; + Cbuffer* cb1 = cbuffer_make(gs1, r1); + free(gs1); + if (!cb1) return 0.0; + Temporal* tcb1 = (Temporal*)tcbufferinst_make(cb1, (TimestampTz)ts1); + free(cb1); + if (!tcb1) return 0.0; + std::string pt2 = fmt::format("POINT({} {})", lon2, lat2); + GSERIALIZED* gs2 = geom_in(pt2.c_str(), -1); + if (!gs2) { free(tcb1); return 0.0; } + Cbuffer* cb2 = cbuffer_make(gs2, r2); + free(gs2); + if (!cb2) { free(tcb1); return 0.0; } + Temporal* tcb2 = (Temporal*)tcbufferinst_make(cb2, (TimestampTz)ts2); + free(cb2); + if (!tcb2) { free(tcb1); return 0.0; } + double r = nad_tcbuffer_tcbuffer(tcb1, tcb2); + free(tcb1); free(tcb2); + return r; + } catch (const std::exception&) { return -1.0; } + }, + lon1, lat1, r1, ts1, lon2, lat2, r2, ts2); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterNadTcbufferTcbufferPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 8, + "NadTcbufferTcbufferPhysicalFunction requires 8 children but got {}", + arguments.childFunctions.size()); + return NadTcbufferTcbufferPhysicalFunction(std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4]), + std::move(arguments.childFunctions[5]), + std::move(arguments.childFunctions[6]), + std::move(arguments.childFunctions[7])); +} + +} // namespace NES diff --git a/nes-sql-parser/AntlrSQL.g4 b/nes-sql-parser/AntlrSQL.g4 index a6c94ca2a0..57092f5857 100644 --- a/nes-sql-parser/AntlrSQL.g4 +++ b/nes-sql-parser/AntlrSQL.g4 @@ -295,7 +295,7 @@ timeUnit: MS timestampParameter: name=identifier; -functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT | TGE_TTEXT_TEXT | TGE_TEXT_TTEXT | TGT_TTEXT_TEXT | TGT_TEXT_TTEXT | TLE_TTEXT_TEXT | TLE_TEXT_TTEXT | TLT_TTEXT_TEXT | TLT_TEXT_TTEXT | TTEXT_UPPER | TTEXT_LOWER | TTEXT_INITCAP | TEXTCAT_TTEXT_TEXT | TEXTCAT_TEXT_TTEXT | TEXTCAT_TTEXT_TTEXT | GEOM_LENGTH | GEOM_PERIMETER | GEOM_AZIMUTH | GEOG_AREA | GEOG_LENGTH | GEOG_PERIMETER | GEOM_IS_EMPTY | AINTERSECTS_TGEO_GEO | ACOVERS_TGEO_GEO | ADISJOINT_TGEO_GEO | ADWITHIN_TGEO_GEO | EINTERSECTS_TGEO_GEO | ETOUCHES_TGEO_GEO | ECONTAINS_TGEO_GEO | ACONTAINS_TGEO_GEO | ATOUCHES_TGEO_GEO | GEO_NUM_POINTS | GEO_NUM_GEOS | GEO_SRID | GEO_IS_UNITARY | GEO_EQUALS | GEO_SAME | GEOG_DISTANCE | NAD_TGEO_GEO | EVER_EQ_TGEO_GEO | EVER_NE_TGEO_GEO | ALWAYS_EQ_TGEO_GEO | ALWAYS_NE_TGEO_GEO | GEOG_INTERSECTS | GEOG_DWITHIN | ACOVERS_GEO_TGEO | GEOM_INTERSECTS | GEOM_DWITHIN | H3_GS_POINT_TO_CELL | EVER_EQ_TH3INDEX_H3INDEX | EVER_NE_TH3INDEX_H3INDEX | ALWAYS_EQ_TH3INDEX_H3INDEX | ALWAYS_NE_TH3INDEX_H3INDEX | TH3INDEX_GET_RESOLUTION | TH3INDEX_GET_BASE_CELL_NUMBER | TH3INDEX_IS_VALID_CELL | TH3INDEX_IS_PENTAGON | TH3INDEX_CELL_TO_PARENT_NEXT | TH3INDEX_CELL_TO_CENTER_CHILD_NEXT | TH3INDEX_CELL_TO_PARENT | TH3INDEX_CELL_TO_CENTER_CHILD | TH3INDEX_CELL_TO_CHILD_POS | TH3INDEX_ARE_NEIGHBOR_CELLS | TH3INDEX_GRID_DISTANCE | EINTERSECTS_TCBUFFER_GEO | AINTERSECTS_TCBUFFER_GEO | ECOVERS_TCBUFFER_GEO | ACOVERS_TCBUFFER_GEO | EDISJOINT_TCBUFFER_GEO | ADISJOINT_TCBUFFER_GEO | ETOUCHES_TCBUFFER_GEO | ATOUCHES_TCBUFFER_GEO | ECONTAINS_TCBUFFER_GEO | ACONTAINS_TCBUFFER_GEO | NAD_TCBUFFER_GEO | EDWITHIN_TCBUFFER_GEO | ADWITHIN_TCBUFFER_GEO | EINTERSECTS_TCBUFFER_CBUFFER | AINTERSECTS_TCBUFFER_CBUFFER | ECOVERS_TCBUFFER_CBUFFER | ACOVERS_TCBUFFER_CBUFFER | EDISJOINT_TCBUFFER_CBUFFER | ADISJOINT_TCBUFFER_CBUFFER | ETOUCHES_TCBUFFER_CBUFFER | ATOUCHES_TCBUFFER_CBUFFER | ECONTAINS_TCBUFFER_CBUFFER | ACONTAINS_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_CBUFFER | ALWAYS_EQ_TCBUFFER_CBUFFER | EVER_NE_TCBUFFER_CBUFFER | ALWAYS_NE_TCBUFFER_CBUFFER | NAD_TCBUFFER_CBUFFER | GEOM_INTERSECTS2D | GEOM_DWITHIN2D | GEOM_CONTAINS | GEOM_DISJOINT2D | GEOM_COVERS | GEOM_TOUCHES | GEOM_INTERSECTS3D | GEOM_DWITHIN3D | GEOM_DISTANCE2D | GEOM_DISTANCE3D; +functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT | TGE_TTEXT_TEXT | TGE_TEXT_TTEXT | TGT_TTEXT_TEXT | TGT_TEXT_TTEXT | TLE_TTEXT_TEXT | TLE_TEXT_TTEXT | TLT_TTEXT_TEXT | TLT_TEXT_TTEXT | TTEXT_UPPER | TTEXT_LOWER | TTEXT_INITCAP | TEXTCAT_TTEXT_TEXT | TEXTCAT_TEXT_TTEXT | TEXTCAT_TTEXT_TTEXT | GEOM_LENGTH | GEOM_PERIMETER | GEOM_AZIMUTH | GEOG_AREA | GEOG_LENGTH | GEOG_PERIMETER | GEOM_IS_EMPTY | AINTERSECTS_TGEO_GEO | ACOVERS_TGEO_GEO | ADISJOINT_TGEO_GEO | ADWITHIN_TGEO_GEO | EINTERSECTS_TGEO_GEO | ETOUCHES_TGEO_GEO | ECONTAINS_TGEO_GEO | ACONTAINS_TGEO_GEO | ATOUCHES_TGEO_GEO | GEO_NUM_POINTS | GEO_NUM_GEOS | GEO_SRID | GEO_IS_UNITARY | GEO_EQUALS | GEO_SAME | GEOG_DISTANCE | NAD_TGEO_GEO | EVER_EQ_TGEO_GEO | EVER_NE_TGEO_GEO | ALWAYS_EQ_TGEO_GEO | ALWAYS_NE_TGEO_GEO | GEOG_INTERSECTS | GEOG_DWITHIN | ACOVERS_GEO_TGEO | GEOM_INTERSECTS | GEOM_DWITHIN | H3_GS_POINT_TO_CELL | EVER_EQ_TH3INDEX_H3INDEX | EVER_NE_TH3INDEX_H3INDEX | ALWAYS_EQ_TH3INDEX_H3INDEX | ALWAYS_NE_TH3INDEX_H3INDEX | TH3INDEX_GET_RESOLUTION | TH3INDEX_GET_BASE_CELL_NUMBER | TH3INDEX_IS_VALID_CELL | TH3INDEX_IS_PENTAGON | TH3INDEX_CELL_TO_PARENT_NEXT | TH3INDEX_CELL_TO_CENTER_CHILD_NEXT | TH3INDEX_CELL_TO_PARENT | TH3INDEX_CELL_TO_CENTER_CHILD | TH3INDEX_CELL_TO_CHILD_POS | TH3INDEX_ARE_NEIGHBOR_CELLS | TH3INDEX_GRID_DISTANCE | EINTERSECTS_TCBUFFER_GEO | AINTERSECTS_TCBUFFER_GEO | ECOVERS_TCBUFFER_GEO | ACOVERS_TCBUFFER_GEO | EDISJOINT_TCBUFFER_GEO | ADISJOINT_TCBUFFER_GEO | ETOUCHES_TCBUFFER_GEO | ATOUCHES_TCBUFFER_GEO | ECONTAINS_TCBUFFER_GEO | ACONTAINS_TCBUFFER_GEO | NAD_TCBUFFER_GEO | EDWITHIN_TCBUFFER_GEO | ADWITHIN_TCBUFFER_GEO | EINTERSECTS_TCBUFFER_CBUFFER | AINTERSECTS_TCBUFFER_CBUFFER | ECOVERS_TCBUFFER_CBUFFER | ACOVERS_TCBUFFER_CBUFFER | EDISJOINT_TCBUFFER_CBUFFER | ADISJOINT_TCBUFFER_CBUFFER | ETOUCHES_TCBUFFER_CBUFFER | ATOUCHES_TCBUFFER_CBUFFER | ECONTAINS_TCBUFFER_CBUFFER | ACONTAINS_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_CBUFFER | ALWAYS_EQ_TCBUFFER_CBUFFER | EVER_NE_TCBUFFER_CBUFFER | ALWAYS_NE_TCBUFFER_CBUFFER | NAD_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_TCBUFFER | ALWAYS_EQ_TCBUFFER_TCBUFFER | EVER_NE_TCBUFFER_TCBUFFER | ALWAYS_NE_TCBUFFER_TCBUFFER | EINTERSECTS_TCBUFFER_TCBUFFER | AINTERSECTS_TCBUFFER_TCBUFFER | ECOVERS_TCBUFFER_TCBUFFER | ACOVERS_TCBUFFER_TCBUFFER | ADISJOINT_TCBUFFER_TCBUFFER | ETOUCHES_TCBUFFER_TCBUFFER | ATOUCHES_TCBUFFER_TCBUFFER | NAD_TCBUFFER_TCBUFFER | GEOM_INTERSECTS2D | GEOM_DWITHIN2D | GEOM_CONTAINS | GEOM_DISJOINT2D | GEOM_COVERS | GEOM_TOUCHES | GEOM_INTERSECTS3D | GEOM_DWITHIN3D | GEOM_DISTANCE2D | GEOM_DISTANCE3D; sinkClause: INTO sink (',' sink)*; @@ -835,6 +835,18 @@ ALWAYS_EQ_TCBUFFER_CBUFFER: 'ALWAYS_EQ_TCBUFFER_CBUFFER' | 'always_eq_tcbuffer_c EVER_NE_TCBUFFER_CBUFFER: 'EVER_NE_TCBUFFER_CBUFFER' | 'ever_ne_tcbuffer_cbuffer'; ALWAYS_NE_TCBUFFER_CBUFFER: 'ALWAYS_NE_TCBUFFER_CBUFFER' | 'always_ne_tcbuffer_cbuffer'; NAD_TCBUFFER_CBUFFER: 'NAD_TCBUFFER_CBUFFER' | 'nad_tcbuffer_cbuffer'; +EVER_EQ_TCBUFFER_TCBUFFER: 'EVER_EQ_TCBUFFER_TCBUFFER' | 'ever_eq_tcbuffer_tcbuffer'; +ALWAYS_EQ_TCBUFFER_TCBUFFER: 'ALWAYS_EQ_TCBUFFER_TCBUFFER' | 'always_eq_tcbuffer_tcbuffer'; +EVER_NE_TCBUFFER_TCBUFFER: 'EVER_NE_TCBUFFER_TCBUFFER' | 'ever_ne_tcbuffer_tcbuffer'; +ALWAYS_NE_TCBUFFER_TCBUFFER: 'ALWAYS_NE_TCBUFFER_TCBUFFER' | 'always_ne_tcbuffer_tcbuffer'; +EINTERSECTS_TCBUFFER_TCBUFFER: 'EINTERSECTS_TCBUFFER_TCBUFFER' | 'eintersects_tcbuffer_tcbuffer'; +AINTERSECTS_TCBUFFER_TCBUFFER: 'AINTERSECTS_TCBUFFER_TCBUFFER' | 'aintersects_tcbuffer_tcbuffer'; +ECOVERS_TCBUFFER_TCBUFFER: 'ECOVERS_TCBUFFER_TCBUFFER' | 'ecovers_tcbuffer_tcbuffer'; +ACOVERS_TCBUFFER_TCBUFFER: 'ACOVERS_TCBUFFER_TCBUFFER' | 'acovers_tcbuffer_tcbuffer'; +ADISJOINT_TCBUFFER_TCBUFFER: 'ADISJOINT_TCBUFFER_TCBUFFER' | 'adisjoint_tcbuffer_tcbuffer'; +ETOUCHES_TCBUFFER_TCBUFFER: 'ETOUCHES_TCBUFFER_TCBUFFER' | 'etouches_tcbuffer_tcbuffer'; +ATOUCHES_TCBUFFER_TCBUFFER: 'ATOUCHES_TCBUFFER_TCBUFFER' | 'atouches_tcbuffer_tcbuffer'; +NAD_TCBUFFER_TCBUFFER: 'NAD_TCBUFFER_TCBUFFER' | 'nad_tcbuffer_tcbuffer'; GEOM_INTERSECTS2D: 'GEOM_INTERSECTS2D' | 'geom_intersects2d'; GEOM_DWITHIN2D: 'GEOM_DWITHIN2D' | 'geom_dwithin2d'; GEOM_CONTAINS: 'GEOM_CONTAINS' | 'geom_contains'; diff --git a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp index 45b6756be6..754015f335 100644 --- a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp +++ b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp @@ -416,6 +416,18 @@ #include #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include @@ -9690,6 +9702,186 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont return LogicalFunction(NadTcbufferCbufferLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6))); } /* END CODEGEN PARSER GLUE: NAD_TCBUFFER_CBUFFER */ + case AntlrSQLParser::EVER_EQ_TCBUFFER_TCBUFFER: { + PRECONDITION(ctx->functionParam().size() == 8, + "EverEqTcbufferTcbuffer requires 8 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + auto arg5 = visit(ctx->functionParam(5)).as(); + auto arg6 = visit(ctx->functionParam(6)).as(); + auto arg7 = visit(ctx->functionParam(7)).as(); + return LogicalFunction(EverEqTcbufferTcbufferLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6), std::move(arg7))); + } + /* END CODEGEN PARSER GLUE: EVER_EQ_TCBUFFER_TCBUFFER */ + case AntlrSQLParser::ALWAYS_EQ_TCBUFFER_TCBUFFER: { + PRECONDITION(ctx->functionParam().size() == 8, + "AlwaysEqTcbufferTcbuffer requires 8 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + auto arg5 = visit(ctx->functionParam(5)).as(); + auto arg6 = visit(ctx->functionParam(6)).as(); + auto arg7 = visit(ctx->functionParam(7)).as(); + return LogicalFunction(AlwaysEqTcbufferTcbufferLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6), std::move(arg7))); + } + /* END CODEGEN PARSER GLUE: ALWAYS_EQ_TCBUFFER_TCBUFFER */ + case AntlrSQLParser::EVER_NE_TCBUFFER_TCBUFFER: { + PRECONDITION(ctx->functionParam().size() == 8, + "EverNeTcbufferTcbuffer requires 8 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + auto arg5 = visit(ctx->functionParam(5)).as(); + auto arg6 = visit(ctx->functionParam(6)).as(); + auto arg7 = visit(ctx->functionParam(7)).as(); + return LogicalFunction(EverNeTcbufferTcbufferLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6), std::move(arg7))); + } + /* END CODEGEN PARSER GLUE: EVER_NE_TCBUFFER_TCBUFFER */ + case AntlrSQLParser::ALWAYS_NE_TCBUFFER_TCBUFFER: { + PRECONDITION(ctx->functionParam().size() == 8, + "AlwaysNeTcbufferTcbuffer requires 8 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + auto arg5 = visit(ctx->functionParam(5)).as(); + auto arg6 = visit(ctx->functionParam(6)).as(); + auto arg7 = visit(ctx->functionParam(7)).as(); + return LogicalFunction(AlwaysNeTcbufferTcbufferLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6), std::move(arg7))); + } + /* END CODEGEN PARSER GLUE: ALWAYS_NE_TCBUFFER_TCBUFFER */ + case AntlrSQLParser::EINTERSECTS_TCBUFFER_TCBUFFER: { + PRECONDITION(ctx->functionParam().size() == 8, + "EintersectsTcbufferTcbuffer requires 8 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + auto arg5 = visit(ctx->functionParam(5)).as(); + auto arg6 = visit(ctx->functionParam(6)).as(); + auto arg7 = visit(ctx->functionParam(7)).as(); + return LogicalFunction(EintersectsTcbufferTcbufferLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6), std::move(arg7))); + } + /* END CODEGEN PARSER GLUE: EINTERSECTS_TCBUFFER_TCBUFFER */ + case AntlrSQLParser::AINTERSECTS_TCBUFFER_TCBUFFER: { + PRECONDITION(ctx->functionParam().size() == 8, + "AintersectsTcbufferTcbuffer requires 8 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + auto arg5 = visit(ctx->functionParam(5)).as(); + auto arg6 = visit(ctx->functionParam(6)).as(); + auto arg7 = visit(ctx->functionParam(7)).as(); + return LogicalFunction(AintersectsTcbufferTcbufferLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6), std::move(arg7))); + } + /* END CODEGEN PARSER GLUE: AINTERSECTS_TCBUFFER_TCBUFFER */ + case AntlrSQLParser::ECOVERS_TCBUFFER_TCBUFFER: { + PRECONDITION(ctx->functionParam().size() == 8, + "EcoversTcbufferTcbuffer requires 8 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + auto arg5 = visit(ctx->functionParam(5)).as(); + auto arg6 = visit(ctx->functionParam(6)).as(); + auto arg7 = visit(ctx->functionParam(7)).as(); + return LogicalFunction(EcoversTcbufferTcbufferLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6), std::move(arg7))); + } + /* END CODEGEN PARSER GLUE: ECOVERS_TCBUFFER_TCBUFFER */ + case AntlrSQLParser::ACOVERS_TCBUFFER_TCBUFFER: { + PRECONDITION(ctx->functionParam().size() == 8, + "AcoversTcbufferTcbuffer requires 8 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + auto arg5 = visit(ctx->functionParam(5)).as(); + auto arg6 = visit(ctx->functionParam(6)).as(); + auto arg7 = visit(ctx->functionParam(7)).as(); + return LogicalFunction(AcoversTcbufferTcbufferLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6), std::move(arg7))); + } + /* END CODEGEN PARSER GLUE: ACOVERS_TCBUFFER_TCBUFFER */ + case AntlrSQLParser::ADISJOINT_TCBUFFER_TCBUFFER: { + PRECONDITION(ctx->functionParam().size() == 8, + "AdisjointTcbufferTcbuffer requires 8 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + auto arg5 = visit(ctx->functionParam(5)).as(); + auto arg6 = visit(ctx->functionParam(6)).as(); + auto arg7 = visit(ctx->functionParam(7)).as(); + return LogicalFunction(AdisjointTcbufferTcbufferLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6), std::move(arg7))); + } + /* END CODEGEN PARSER GLUE: ADISJOINT_TCBUFFER_TCBUFFER */ + case AntlrSQLParser::ETOUCHES_TCBUFFER_TCBUFFER: { + PRECONDITION(ctx->functionParam().size() == 8, + "EtouchesTcbufferTcbuffer requires 8 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + auto arg5 = visit(ctx->functionParam(5)).as(); + auto arg6 = visit(ctx->functionParam(6)).as(); + auto arg7 = visit(ctx->functionParam(7)).as(); + return LogicalFunction(EtouchesTcbufferTcbufferLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6), std::move(arg7))); + } + /* END CODEGEN PARSER GLUE: ETOUCHES_TCBUFFER_TCBUFFER */ + case AntlrSQLParser::ATOUCHES_TCBUFFER_TCBUFFER: { + PRECONDITION(ctx->functionParam().size() == 8, + "AtouchesTcbufferTcbuffer requires 8 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + auto arg5 = visit(ctx->functionParam(5)).as(); + auto arg6 = visit(ctx->functionParam(6)).as(); + auto arg7 = visit(ctx->functionParam(7)).as(); + return LogicalFunction(AtouchesTcbufferTcbufferLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6), std::move(arg7))); + } + /* END CODEGEN PARSER GLUE: ATOUCHES_TCBUFFER_TCBUFFER */ + case AntlrSQLParser::NAD_TCBUFFER_TCBUFFER: { + PRECONDITION(ctx->functionParam().size() == 8, + "NadTcbufferTcbuffer requires 8 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + auto arg5 = visit(ctx->functionParam(5)).as(); + auto arg6 = visit(ctx->functionParam(6)).as(); + auto arg7 = visit(ctx->functionParam(7)).as(); + return LogicalFunction(NadTcbufferTcbufferLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6), std::move(arg7))); + } + /* END CODEGEN PARSER GLUE: NAD_TCBUFFER_TCBUFFER */ /* END CODEGEN PARSER GLUE: GEOM_INTERSECTS2D */ case AntlrSQLParser::GEOM_DWITHIN2D: { PRECONDITION(ctx->functionParam().size() == 3, From 943ca7eaa1c5dc881901c4207a4408ba600d57f0 Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Mon, 15 Jun 2026 07:15:32 +0200 Subject: [PATCH 65/96] feat(meos): add tcbuffer_tcbuffer dwithin and mindistance NES operators (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). --- ...dwithinTcbufferTcbufferLogicalFunction.hpp | 55 ++++++++ ...dwithinTcbufferTcbufferLogicalFunction.hpp | 55 ++++++++ ...istanceTcbufferTcbufferLogicalFunction.hpp | 55 ++++++++ ...dwithinTcbufferTcbufferLogicalFunction.cpp | 122 ++++++++++++++++++ .../src/Functions/Meos/CMakeLists.txt | 3 + ...dwithinTcbufferTcbufferLogicalFunction.cpp | 122 ++++++++++++++++++ ...istanceTcbufferTcbufferLogicalFunction.cpp | 122 ++++++++++++++++++ ...withinTcbufferTcbufferPhysicalFunction.hpp | 37 ++++++ ...withinTcbufferTcbufferPhysicalFunction.hpp | 37 ++++++ ...stanceTcbufferTcbufferPhysicalFunction.hpp | 37 ++++++ ...withinTcbufferTcbufferPhysicalFunction.cpp | 117 +++++++++++++++++ .../src/Functions/Meos/CMakeLists.txt | 3 + ...withinTcbufferTcbufferPhysicalFunction.cpp | 117 +++++++++++++++++ ...stanceTcbufferTcbufferPhysicalFunction.cpp | 117 +++++++++++++++++ nes-sql-parser/AntlrSQL.g4 | 5 +- .../src/AntlrSQLQueryPlanCreator.cpp | 51 ++++++++ 16 files changed, 1054 insertions(+), 1 deletion(-) create mode 100644 nes-logical-operators/include/Functions/Meos/AdwithinTcbufferTcbufferLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EdwithinTcbufferTcbufferLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/MindistanceTcbufferTcbufferLogicalFunction.hpp create mode 100644 nes-logical-operators/src/Functions/Meos/AdwithinTcbufferTcbufferLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EdwithinTcbufferTcbufferLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/MindistanceTcbufferTcbufferLogicalFunction.cpp create mode 100644 nes-physical-operators/include/Functions/Meos/AdwithinTcbufferTcbufferPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EdwithinTcbufferTcbufferPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/MindistanceTcbufferTcbufferPhysicalFunction.hpp create mode 100644 nes-physical-operators/src/Functions/Meos/AdwithinTcbufferTcbufferPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EdwithinTcbufferTcbufferPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/MindistanceTcbufferTcbufferPhysicalFunction.cpp diff --git a/nes-logical-operators/include/Functions/Meos/AdwithinTcbufferTcbufferLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AdwithinTcbufferTcbufferLogicalFunction.hpp new file mode 100644 index 0000000000..b67ce5cfad --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AdwithinTcbufferTcbufferLogicalFunction.hpp @@ -0,0 +1,55 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if the two tcbuffer instants are always within the given distance, 0.0 otherwise. + * + * Args: (lon1:FLOAT64, lat1:FLOAT64, r1:FLOAT64, ts1:UINT64, + * lon2:FLOAT64, lat2:FLOAT64, r2:FLOAT64, ts2:UINT64, + * dist:FLOAT64) -> FLOAT64. + */ +class AdwithinTcbufferTcbufferLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AdwithinTcbufferTcbuffer"; + + AdwithinTcbufferTcbufferLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction r1, + LogicalFunction ts1, + LogicalFunction lon2, LogicalFunction lat2, LogicalFunction r2, + LogicalFunction ts2, LogicalFunction dist); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EdwithinTcbufferTcbufferLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EdwithinTcbufferTcbufferLogicalFunction.hpp new file mode 100644 index 0000000000..a67c2c1b1b --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EdwithinTcbufferTcbufferLogicalFunction.hpp @@ -0,0 +1,55 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if the two tcbuffer instants are ever within the given distance, 0.0 otherwise. + * + * Args: (lon1:FLOAT64, lat1:FLOAT64, r1:FLOAT64, ts1:UINT64, + * lon2:FLOAT64, lat2:FLOAT64, r2:FLOAT64, ts2:UINT64, + * dist:FLOAT64) -> FLOAT64. + */ +class EdwithinTcbufferTcbufferLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EdwithinTcbufferTcbuffer"; + + EdwithinTcbufferTcbufferLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction r1, + LogicalFunction ts1, + LogicalFunction lon2, LogicalFunction lat2, LogicalFunction r2, + LogicalFunction ts2, LogicalFunction dist); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/MindistanceTcbufferTcbufferLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/MindistanceTcbufferTcbufferLogicalFunction.hpp new file mode 100644 index 0000000000..b473b8a36c --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/MindistanceTcbufferTcbufferLogicalFunction.hpp @@ -0,0 +1,55 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns the minimum distance between two tcbuffer instants within the given threshold. + * + * Args: (lon1:FLOAT64, lat1:FLOAT64, r1:FLOAT64, ts1:UINT64, + * lon2:FLOAT64, lat2:FLOAT64, r2:FLOAT64, ts2:UINT64, + * dist:FLOAT64) -> FLOAT64. + */ +class MindistanceTcbufferTcbufferLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "MindistanceTcbufferTcbuffer"; + + MindistanceTcbufferTcbufferLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction r1, + LogicalFunction ts1, + LogicalFunction lon2, LogicalFunction lat2, LogicalFunction r2, + LogicalFunction ts2, LogicalFunction dist); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AdwithinTcbufferTcbufferLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AdwithinTcbufferTcbufferLogicalFunction.cpp new file mode 100644 index 0000000000..e32b576ff6 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AdwithinTcbufferTcbufferLogicalFunction.cpp @@ -0,0 +1,122 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AdwithinTcbufferTcbufferLogicalFunction::AdwithinTcbufferTcbufferLogicalFunction( + LogicalFunction lon1, LogicalFunction lat1, LogicalFunction r1, LogicalFunction ts1, + LogicalFunction lon2, LogicalFunction lat2, LogicalFunction r2, LogicalFunction ts2, + LogicalFunction dist) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(9); + parameters.push_back(std::move(lon1)); + parameters.push_back(std::move(lat1)); + parameters.push_back(std::move(r1)); + parameters.push_back(std::move(ts1)); + parameters.push_back(std::move(lon2)); + parameters.push_back(std::move(lat2)); + parameters.push_back(std::move(r2)); + parameters.push_back(std::move(ts2)); + parameters.push_back(std::move(dist)); +} + +DataType AdwithinTcbufferTcbufferLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AdwithinTcbufferTcbufferLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AdwithinTcbufferTcbufferLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AdwithinTcbufferTcbufferLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 9, + "AdwithinTcbufferTcbufferLogicalFunction requires 9 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AdwithinTcbufferTcbufferLogicalFunction::getType() const { return NAME; } + +bool AdwithinTcbufferTcbufferLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AdwithinTcbufferTcbufferLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction AdwithinTcbufferTcbufferLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(9); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon1 must be FLOAT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat1 must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "r1 must be FLOAT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "lon2 must be FLOAT64"); + INVARIANT(c[5].getDataType().isType(DataType::Type::FLOAT64), "lat2 must be FLOAT64"); + INVARIANT(c[6].getDataType().isType(DataType::Type::FLOAT64), "r2 must be FLOAT64"); + INVARIANT(c[7].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); + INVARIANT(c[8].getDataType().isType(DataType::Type::FLOAT64), "dist must be FLOAT64"); + return withChildren(c); +} + +SerializableFunction AdwithinTcbufferTcbufferLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAdwithinTcbufferTcbufferLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 9, + "AdwithinTcbufferTcbufferLogicalFunction requires 9 children but got {}", + arguments.children.size()); + return AdwithinTcbufferTcbufferLogicalFunction(std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4]), + std::move(arguments.children[5]), + std::move(arguments.children[6]), + std::move(arguments.children[7]), + std::move(arguments.children[8])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt index 6ec03bb757..d0859d5ddd 100644 --- a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt @@ -377,6 +377,9 @@ add_plugin(AdisjointTcbufferTcbuffer LogicalFunction nes-logical-operators Adisj add_plugin(EtouchesTcbufferTcbuffer LogicalFunction nes-logical-operators EtouchesTcbufferTcbufferLogicalFunction.cpp) add_plugin(AtouchesTcbufferTcbuffer LogicalFunction nes-logical-operators AtouchesTcbufferTcbufferLogicalFunction.cpp) add_plugin(NadTcbufferTcbuffer LogicalFunction nes-logical-operators NadTcbufferTcbufferLogicalFunction.cpp) +add_plugin(EdwithinTcbufferTcbuffer LogicalFunction nes-logical-operators EdwithinTcbufferTcbufferLogicalFunction.cpp) +add_plugin(AdwithinTcbufferTcbuffer LogicalFunction nes-logical-operators AdwithinTcbufferTcbufferLogicalFunction.cpp) +add_plugin(MindistanceTcbufferTcbuffer LogicalFunction nes-logical-operators MindistanceTcbufferTcbufferLogicalFunction.cpp) add_plugin(GeomIntersects2d LogicalFunction nes-logical-operators GeomIntersects2dLogicalFunction.cpp) add_plugin(GeomDwithin2d LogicalFunction nes-logical-operators GeomDwithin2dLogicalFunction.cpp) add_plugin(GeomContains LogicalFunction nes-logical-operators GeomContainsLogicalFunction.cpp) diff --git a/nes-logical-operators/src/Functions/Meos/EdwithinTcbufferTcbufferLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EdwithinTcbufferTcbufferLogicalFunction.cpp new file mode 100644 index 0000000000..ec7a29673a --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EdwithinTcbufferTcbufferLogicalFunction.cpp @@ -0,0 +1,122 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EdwithinTcbufferTcbufferLogicalFunction::EdwithinTcbufferTcbufferLogicalFunction( + LogicalFunction lon1, LogicalFunction lat1, LogicalFunction r1, LogicalFunction ts1, + LogicalFunction lon2, LogicalFunction lat2, LogicalFunction r2, LogicalFunction ts2, + LogicalFunction dist) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(9); + parameters.push_back(std::move(lon1)); + parameters.push_back(std::move(lat1)); + parameters.push_back(std::move(r1)); + parameters.push_back(std::move(ts1)); + parameters.push_back(std::move(lon2)); + parameters.push_back(std::move(lat2)); + parameters.push_back(std::move(r2)); + parameters.push_back(std::move(ts2)); + parameters.push_back(std::move(dist)); +} + +DataType EdwithinTcbufferTcbufferLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EdwithinTcbufferTcbufferLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EdwithinTcbufferTcbufferLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EdwithinTcbufferTcbufferLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 9, + "EdwithinTcbufferTcbufferLogicalFunction requires 9 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EdwithinTcbufferTcbufferLogicalFunction::getType() const { return NAME; } + +bool EdwithinTcbufferTcbufferLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EdwithinTcbufferTcbufferLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction EdwithinTcbufferTcbufferLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(9); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon1 must be FLOAT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat1 must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "r1 must be FLOAT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "lon2 must be FLOAT64"); + INVARIANT(c[5].getDataType().isType(DataType::Type::FLOAT64), "lat2 must be FLOAT64"); + INVARIANT(c[6].getDataType().isType(DataType::Type::FLOAT64), "r2 must be FLOAT64"); + INVARIANT(c[7].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); + INVARIANT(c[8].getDataType().isType(DataType::Type::FLOAT64), "dist must be FLOAT64"); + return withChildren(c); +} + +SerializableFunction EdwithinTcbufferTcbufferLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEdwithinTcbufferTcbufferLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 9, + "EdwithinTcbufferTcbufferLogicalFunction requires 9 children but got {}", + arguments.children.size()); + return EdwithinTcbufferTcbufferLogicalFunction(std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4]), + std::move(arguments.children[5]), + std::move(arguments.children[6]), + std::move(arguments.children[7]), + std::move(arguments.children[8])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/MindistanceTcbufferTcbufferLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/MindistanceTcbufferTcbufferLogicalFunction.cpp new file mode 100644 index 0000000000..280265eb0f --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/MindistanceTcbufferTcbufferLogicalFunction.cpp @@ -0,0 +1,122 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +MindistanceTcbufferTcbufferLogicalFunction::MindistanceTcbufferTcbufferLogicalFunction( + LogicalFunction lon1, LogicalFunction lat1, LogicalFunction r1, LogicalFunction ts1, + LogicalFunction lon2, LogicalFunction lat2, LogicalFunction r2, LogicalFunction ts2, + LogicalFunction dist) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(9); + parameters.push_back(std::move(lon1)); + parameters.push_back(std::move(lat1)); + parameters.push_back(std::move(r1)); + parameters.push_back(std::move(ts1)); + parameters.push_back(std::move(lon2)); + parameters.push_back(std::move(lat2)); + parameters.push_back(std::move(r2)); + parameters.push_back(std::move(ts2)); + parameters.push_back(std::move(dist)); +} + +DataType MindistanceTcbufferTcbufferLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction MindistanceTcbufferTcbufferLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector MindistanceTcbufferTcbufferLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction MindistanceTcbufferTcbufferLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 9, + "MindistanceTcbufferTcbufferLogicalFunction requires 9 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view MindistanceTcbufferTcbufferLogicalFunction::getType() const { return NAME; } + +bool MindistanceTcbufferTcbufferLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string MindistanceTcbufferTcbufferLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction MindistanceTcbufferTcbufferLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(9); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon1 must be FLOAT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat1 must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "r1 must be FLOAT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "lon2 must be FLOAT64"); + INVARIANT(c[5].getDataType().isType(DataType::Type::FLOAT64), "lat2 must be FLOAT64"); + INVARIANT(c[6].getDataType().isType(DataType::Type::FLOAT64), "r2 must be FLOAT64"); + INVARIANT(c[7].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); + INVARIANT(c[8].getDataType().isType(DataType::Type::FLOAT64), "dist must be FLOAT64"); + return withChildren(c); +} + +SerializableFunction MindistanceTcbufferTcbufferLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterMindistanceTcbufferTcbufferLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 9, + "MindistanceTcbufferTcbufferLogicalFunction requires 9 children but got {}", + arguments.children.size()); + return MindistanceTcbufferTcbufferLogicalFunction(std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4]), + std::move(arguments.children[5]), + std::move(arguments.children[6]), + std::move(arguments.children[7]), + std::move(arguments.children[8])); +} + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AdwithinTcbufferTcbufferPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AdwithinTcbufferTcbufferPhysicalFunction.hpp new file mode 100644 index 0000000000..1c4700ae3f --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AdwithinTcbufferTcbufferPhysicalFunction.hpp @@ -0,0 +1,37 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class AdwithinTcbufferTcbufferPhysicalFunction : public PhysicalFunctionConcept { +public: + AdwithinTcbufferTcbufferPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction r1, + PhysicalFunction ts1, + PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction r2, + PhysicalFunction ts2, PhysicalFunction dist); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EdwithinTcbufferTcbufferPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EdwithinTcbufferTcbufferPhysicalFunction.hpp new file mode 100644 index 0000000000..4ff9cac817 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EdwithinTcbufferTcbufferPhysicalFunction.hpp @@ -0,0 +1,37 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class EdwithinTcbufferTcbufferPhysicalFunction : public PhysicalFunctionConcept { +public: + EdwithinTcbufferTcbufferPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction r1, + PhysicalFunction ts1, + PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction r2, + PhysicalFunction ts2, PhysicalFunction dist); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/MindistanceTcbufferTcbufferPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/MindistanceTcbufferTcbufferPhysicalFunction.hpp new file mode 100644 index 0000000000..1bbffb3bb6 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/MindistanceTcbufferTcbufferPhysicalFunction.hpp @@ -0,0 +1,37 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class MindistanceTcbufferTcbufferPhysicalFunction : public PhysicalFunctionConcept { +public: + MindistanceTcbufferTcbufferPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction r1, + PhysicalFunction ts1, + PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction r2, + PhysicalFunction ts2, PhysicalFunction dist); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AdwithinTcbufferTcbufferPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AdwithinTcbufferTcbufferPhysicalFunction.cpp new file mode 100644 index 0000000000..36a331f03f --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AdwithinTcbufferTcbufferPhysicalFunction.cpp @@ -0,0 +1,117 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +AdwithinTcbufferTcbufferPhysicalFunction::AdwithinTcbufferTcbufferPhysicalFunction( + PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction r1, PhysicalFunction ts1, + PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction r2, PhysicalFunction ts2, + PhysicalFunction dist) +{ + paramFns.reserve(9); + paramFns.push_back(std::move(lon1)); + paramFns.push_back(std::move(lat1)); + paramFns.push_back(std::move(r1)); + paramFns.push_back(std::move(ts1)); + paramFns.push_back(std::move(lon2)); + paramFns.push_back(std::move(lat2)); + paramFns.push_back(std::move(r2)); + paramFns.push_back(std::move(ts2)); + paramFns.push_back(std::move(dist)); +} + +VarVal AdwithinTcbufferTcbufferPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto lon1 = paramFns[0].execute(record, arena).cast(); + auto lat1 = paramFns[1].execute(record, arena).cast(); + auto r1 = paramFns[2].execute(record, arena).cast(); + auto ts1 = paramFns[3].execute(record, arena).cast(); + auto lon2 = paramFns[4].execute(record, arena).cast(); + auto lat2 = paramFns[5].execute(record, arena).cast(); + auto r2 = paramFns[6].execute(record, arena).cast(); + auto ts2 = paramFns[7].execute(record, arena).cast(); + auto dist = paramFns[8].execute(record, arena).cast(); + + const auto result = nautilus::invoke( + +[](double lon1, double lat1, double r1, uint64_t ts1, + double lon2, double lat2, double r2, uint64_t ts2, + double dist) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string pt1 = fmt::format("POINT({} {})", lon1, lat1); + GSERIALIZED* gs1 = geom_in(pt1.c_str(), -1); + if (!gs1) return 0.0; + Cbuffer* cb1 = cbuffer_make(gs1, r1); + free(gs1); + if (!cb1) return 0.0; + Temporal* tcb1 = (Temporal*)tcbufferinst_make(cb1, (TimestampTz)ts1); + free(cb1); + if (!tcb1) return 0.0; + std::string pt2 = fmt::format("POINT({} {})", lon2, lat2); + GSERIALIZED* gs2 = geom_in(pt2.c_str(), -1); + if (!gs2) { free(tcb1); return 0.0; } + Cbuffer* cb2 = cbuffer_make(gs2, r2); + free(gs2); + if (!cb2) { free(tcb1); return 0.0; } + Temporal* tcb2 = (Temporal*)tcbufferinst_make(cb2, (TimestampTz)ts2); + free(cb2); + if (!tcb2) { free(tcb1); return 0.0; } + int r = adwithin_tcbuffer_tcbuffer(tcb1, tcb2, dist); + free(tcb1); free(tcb2); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + lon1, lat1, r1, ts1, lon2, lat2, r2, ts2, dist); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAdwithinTcbufferTcbufferPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 9, + "AdwithinTcbufferTcbufferPhysicalFunction requires 9 children but got {}", + arguments.childFunctions.size()); + return AdwithinTcbufferTcbufferPhysicalFunction(std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4]), + std::move(arguments.childFunctions[5]), + std::move(arguments.childFunctions[6]), + std::move(arguments.childFunctions[7]), + std::move(arguments.childFunctions[8])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt index 9873b4aa00..7476871093 100644 --- a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt @@ -376,6 +376,9 @@ add_plugin(AdisjointTcbufferTcbuffer PhysicalFunction nes-physical-operators Adi add_plugin(EtouchesTcbufferTcbuffer PhysicalFunction nes-physical-operators EtouchesTcbufferTcbufferPhysicalFunction.cpp) add_plugin(AtouchesTcbufferTcbuffer PhysicalFunction nes-physical-operators AtouchesTcbufferTcbufferPhysicalFunction.cpp) add_plugin(NadTcbufferTcbuffer PhysicalFunction nes-physical-operators NadTcbufferTcbufferPhysicalFunction.cpp) +add_plugin(EdwithinTcbufferTcbuffer PhysicalFunction nes-physical-operators EdwithinTcbufferTcbufferPhysicalFunction.cpp) +add_plugin(AdwithinTcbufferTcbuffer PhysicalFunction nes-physical-operators AdwithinTcbufferTcbufferPhysicalFunction.cpp) +add_plugin(MindistanceTcbufferTcbuffer PhysicalFunction nes-physical-operators MindistanceTcbufferTcbufferPhysicalFunction.cpp) add_plugin(GeomIntersects2d PhysicalFunction nes-physical-operators GeomIntersects2dPhysicalFunction.cpp) add_plugin(GeomDwithin2d PhysicalFunction nes-physical-operators GeomDwithin2dPhysicalFunction.cpp) add_plugin(GeomContains PhysicalFunction nes-physical-operators GeomContainsPhysicalFunction.cpp) diff --git a/nes-physical-operators/src/Functions/Meos/EdwithinTcbufferTcbufferPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EdwithinTcbufferTcbufferPhysicalFunction.cpp new file mode 100644 index 0000000000..0516c6be91 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EdwithinTcbufferTcbufferPhysicalFunction.cpp @@ -0,0 +1,117 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +EdwithinTcbufferTcbufferPhysicalFunction::EdwithinTcbufferTcbufferPhysicalFunction( + PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction r1, PhysicalFunction ts1, + PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction r2, PhysicalFunction ts2, + PhysicalFunction dist) +{ + paramFns.reserve(9); + paramFns.push_back(std::move(lon1)); + paramFns.push_back(std::move(lat1)); + paramFns.push_back(std::move(r1)); + paramFns.push_back(std::move(ts1)); + paramFns.push_back(std::move(lon2)); + paramFns.push_back(std::move(lat2)); + paramFns.push_back(std::move(r2)); + paramFns.push_back(std::move(ts2)); + paramFns.push_back(std::move(dist)); +} + +VarVal EdwithinTcbufferTcbufferPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto lon1 = paramFns[0].execute(record, arena).cast(); + auto lat1 = paramFns[1].execute(record, arena).cast(); + auto r1 = paramFns[2].execute(record, arena).cast(); + auto ts1 = paramFns[3].execute(record, arena).cast(); + auto lon2 = paramFns[4].execute(record, arena).cast(); + auto lat2 = paramFns[5].execute(record, arena).cast(); + auto r2 = paramFns[6].execute(record, arena).cast(); + auto ts2 = paramFns[7].execute(record, arena).cast(); + auto dist = paramFns[8].execute(record, arena).cast(); + + const auto result = nautilus::invoke( + +[](double lon1, double lat1, double r1, uint64_t ts1, + double lon2, double lat2, double r2, uint64_t ts2, + double dist) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string pt1 = fmt::format("POINT({} {})", lon1, lat1); + GSERIALIZED* gs1 = geom_in(pt1.c_str(), -1); + if (!gs1) return 0.0; + Cbuffer* cb1 = cbuffer_make(gs1, r1); + free(gs1); + if (!cb1) return 0.0; + Temporal* tcb1 = (Temporal*)tcbufferinst_make(cb1, (TimestampTz)ts1); + free(cb1); + if (!tcb1) return 0.0; + std::string pt2 = fmt::format("POINT({} {})", lon2, lat2); + GSERIALIZED* gs2 = geom_in(pt2.c_str(), -1); + if (!gs2) { free(tcb1); return 0.0; } + Cbuffer* cb2 = cbuffer_make(gs2, r2); + free(gs2); + if (!cb2) { free(tcb1); return 0.0; } + Temporal* tcb2 = (Temporal*)tcbufferinst_make(cb2, (TimestampTz)ts2); + free(cb2); + if (!tcb2) { free(tcb1); return 0.0; } + int r = edwithin_tcbuffer_tcbuffer(tcb1, tcb2, dist); + free(tcb1); free(tcb2); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + lon1, lat1, r1, ts1, lon2, lat2, r2, ts2, dist); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEdwithinTcbufferTcbufferPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 9, + "EdwithinTcbufferTcbufferPhysicalFunction requires 9 children but got {}", + arguments.childFunctions.size()); + return EdwithinTcbufferTcbufferPhysicalFunction(std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4]), + std::move(arguments.childFunctions[5]), + std::move(arguments.childFunctions[6]), + std::move(arguments.childFunctions[7]), + std::move(arguments.childFunctions[8])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/MindistanceTcbufferTcbufferPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/MindistanceTcbufferTcbufferPhysicalFunction.cpp new file mode 100644 index 0000000000..07e5591857 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/MindistanceTcbufferTcbufferPhysicalFunction.cpp @@ -0,0 +1,117 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +MindistanceTcbufferTcbufferPhysicalFunction::MindistanceTcbufferTcbufferPhysicalFunction( + PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction r1, PhysicalFunction ts1, + PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction r2, PhysicalFunction ts2, + PhysicalFunction dist) +{ + paramFns.reserve(9); + paramFns.push_back(std::move(lon1)); + paramFns.push_back(std::move(lat1)); + paramFns.push_back(std::move(r1)); + paramFns.push_back(std::move(ts1)); + paramFns.push_back(std::move(lon2)); + paramFns.push_back(std::move(lat2)); + paramFns.push_back(std::move(r2)); + paramFns.push_back(std::move(ts2)); + paramFns.push_back(std::move(dist)); +} + +VarVal MindistanceTcbufferTcbufferPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto lon1 = paramFns[0].execute(record, arena).cast(); + auto lat1 = paramFns[1].execute(record, arena).cast(); + auto r1 = paramFns[2].execute(record, arena).cast(); + auto ts1 = paramFns[3].execute(record, arena).cast(); + auto lon2 = paramFns[4].execute(record, arena).cast(); + auto lat2 = paramFns[5].execute(record, arena).cast(); + auto r2 = paramFns[6].execute(record, arena).cast(); + auto ts2 = paramFns[7].execute(record, arena).cast(); + auto dist = paramFns[8].execute(record, arena).cast(); + + const auto result = nautilus::invoke( + +[](double lon1, double lat1, double r1, uint64_t ts1, + double lon2, double lat2, double r2, uint64_t ts2, + double dist) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string pt1 = fmt::format("POINT({} {})", lon1, lat1); + GSERIALIZED* gs1 = geom_in(pt1.c_str(), -1); + if (!gs1) return 0.0; + Cbuffer* cb1 = cbuffer_make(gs1, r1); + free(gs1); + if (!cb1) return 0.0; + Temporal* tcb1 = (Temporal*)tcbufferinst_make(cb1, (TimestampTz)ts1); + free(cb1); + if (!tcb1) return 0.0; + std::string pt2 = fmt::format("POINT({} {})", lon2, lat2); + GSERIALIZED* gs2 = geom_in(pt2.c_str(), -1); + if (!gs2) { free(tcb1); return 0.0; } + Cbuffer* cb2 = cbuffer_make(gs2, r2); + free(gs2); + if (!cb2) { free(tcb1); return 0.0; } + Temporal* tcb2 = (Temporal*)tcbufferinst_make(cb2, (TimestampTz)ts2); + free(cb2); + if (!tcb2) { free(tcb1); return 0.0; } + double r = mindistance_tcbuffer_tcbuffer(tcb1, tcb2, dist); + free(tcb1); free(tcb2); + return r; + } catch (const std::exception&) { return -1.0; } + }, + lon1, lat1, r1, ts1, lon2, lat2, r2, ts2, dist); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterMindistanceTcbufferTcbufferPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 9, + "MindistanceTcbufferTcbufferPhysicalFunction requires 9 children but got {}", + arguments.childFunctions.size()); + return MindistanceTcbufferTcbufferPhysicalFunction(std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4]), + std::move(arguments.childFunctions[5]), + std::move(arguments.childFunctions[6]), + std::move(arguments.childFunctions[7]), + std::move(arguments.childFunctions[8])); +} + +} // namespace NES diff --git a/nes-sql-parser/AntlrSQL.g4 b/nes-sql-parser/AntlrSQL.g4 index 57092f5857..5bbf4a6792 100644 --- a/nes-sql-parser/AntlrSQL.g4 +++ b/nes-sql-parser/AntlrSQL.g4 @@ -295,7 +295,7 @@ timeUnit: MS timestampParameter: name=identifier; -functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT | TGE_TTEXT_TEXT | TGE_TEXT_TTEXT | TGT_TTEXT_TEXT | TGT_TEXT_TTEXT | TLE_TTEXT_TEXT | TLE_TEXT_TTEXT | TLT_TTEXT_TEXT | TLT_TEXT_TTEXT | TTEXT_UPPER | TTEXT_LOWER | TTEXT_INITCAP | TEXTCAT_TTEXT_TEXT | TEXTCAT_TEXT_TTEXT | TEXTCAT_TTEXT_TTEXT | GEOM_LENGTH | GEOM_PERIMETER | GEOM_AZIMUTH | GEOG_AREA | GEOG_LENGTH | GEOG_PERIMETER | GEOM_IS_EMPTY | AINTERSECTS_TGEO_GEO | ACOVERS_TGEO_GEO | ADISJOINT_TGEO_GEO | ADWITHIN_TGEO_GEO | EINTERSECTS_TGEO_GEO | ETOUCHES_TGEO_GEO | ECONTAINS_TGEO_GEO | ACONTAINS_TGEO_GEO | ATOUCHES_TGEO_GEO | GEO_NUM_POINTS | GEO_NUM_GEOS | GEO_SRID | GEO_IS_UNITARY | GEO_EQUALS | GEO_SAME | GEOG_DISTANCE | NAD_TGEO_GEO | EVER_EQ_TGEO_GEO | EVER_NE_TGEO_GEO | ALWAYS_EQ_TGEO_GEO | ALWAYS_NE_TGEO_GEO | GEOG_INTERSECTS | GEOG_DWITHIN | ACOVERS_GEO_TGEO | GEOM_INTERSECTS | GEOM_DWITHIN | H3_GS_POINT_TO_CELL | EVER_EQ_TH3INDEX_H3INDEX | EVER_NE_TH3INDEX_H3INDEX | ALWAYS_EQ_TH3INDEX_H3INDEX | ALWAYS_NE_TH3INDEX_H3INDEX | TH3INDEX_GET_RESOLUTION | TH3INDEX_GET_BASE_CELL_NUMBER | TH3INDEX_IS_VALID_CELL | TH3INDEX_IS_PENTAGON | TH3INDEX_CELL_TO_PARENT_NEXT | TH3INDEX_CELL_TO_CENTER_CHILD_NEXT | TH3INDEX_CELL_TO_PARENT | TH3INDEX_CELL_TO_CENTER_CHILD | TH3INDEX_CELL_TO_CHILD_POS | TH3INDEX_ARE_NEIGHBOR_CELLS | TH3INDEX_GRID_DISTANCE | EINTERSECTS_TCBUFFER_GEO | AINTERSECTS_TCBUFFER_GEO | ECOVERS_TCBUFFER_GEO | ACOVERS_TCBUFFER_GEO | EDISJOINT_TCBUFFER_GEO | ADISJOINT_TCBUFFER_GEO | ETOUCHES_TCBUFFER_GEO | ATOUCHES_TCBUFFER_GEO | ECONTAINS_TCBUFFER_GEO | ACONTAINS_TCBUFFER_GEO | NAD_TCBUFFER_GEO | EDWITHIN_TCBUFFER_GEO | ADWITHIN_TCBUFFER_GEO | EINTERSECTS_TCBUFFER_CBUFFER | AINTERSECTS_TCBUFFER_CBUFFER | ECOVERS_TCBUFFER_CBUFFER | ACOVERS_TCBUFFER_CBUFFER | EDISJOINT_TCBUFFER_CBUFFER | ADISJOINT_TCBUFFER_CBUFFER | ETOUCHES_TCBUFFER_CBUFFER | ATOUCHES_TCBUFFER_CBUFFER | ECONTAINS_TCBUFFER_CBUFFER | ACONTAINS_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_CBUFFER | ALWAYS_EQ_TCBUFFER_CBUFFER | EVER_NE_TCBUFFER_CBUFFER | ALWAYS_NE_TCBUFFER_CBUFFER | NAD_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_TCBUFFER | ALWAYS_EQ_TCBUFFER_TCBUFFER | EVER_NE_TCBUFFER_TCBUFFER | ALWAYS_NE_TCBUFFER_TCBUFFER | EINTERSECTS_TCBUFFER_TCBUFFER | AINTERSECTS_TCBUFFER_TCBUFFER | ECOVERS_TCBUFFER_TCBUFFER | ACOVERS_TCBUFFER_TCBUFFER | ADISJOINT_TCBUFFER_TCBUFFER | ETOUCHES_TCBUFFER_TCBUFFER | ATOUCHES_TCBUFFER_TCBUFFER | NAD_TCBUFFER_TCBUFFER | GEOM_INTERSECTS2D | GEOM_DWITHIN2D | GEOM_CONTAINS | GEOM_DISJOINT2D | GEOM_COVERS | GEOM_TOUCHES | GEOM_INTERSECTS3D | GEOM_DWITHIN3D | GEOM_DISTANCE2D | GEOM_DISTANCE3D; +functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT | TGE_TTEXT_TEXT | TGE_TEXT_TTEXT | TGT_TTEXT_TEXT | TGT_TEXT_TTEXT | TLE_TTEXT_TEXT | TLE_TEXT_TTEXT | TLT_TTEXT_TEXT | TLT_TEXT_TTEXT | TTEXT_UPPER | TTEXT_LOWER | TTEXT_INITCAP | TEXTCAT_TTEXT_TEXT | TEXTCAT_TEXT_TTEXT | TEXTCAT_TTEXT_TTEXT | GEOM_LENGTH | GEOM_PERIMETER | GEOM_AZIMUTH | GEOG_AREA | GEOG_LENGTH | GEOG_PERIMETER | GEOM_IS_EMPTY | AINTERSECTS_TGEO_GEO | ACOVERS_TGEO_GEO | ADISJOINT_TGEO_GEO | ADWITHIN_TGEO_GEO | EINTERSECTS_TGEO_GEO | ETOUCHES_TGEO_GEO | ECONTAINS_TGEO_GEO | ACONTAINS_TGEO_GEO | ATOUCHES_TGEO_GEO | GEO_NUM_POINTS | GEO_NUM_GEOS | GEO_SRID | GEO_IS_UNITARY | GEO_EQUALS | GEO_SAME | GEOG_DISTANCE | NAD_TGEO_GEO | EVER_EQ_TGEO_GEO | EVER_NE_TGEO_GEO | ALWAYS_EQ_TGEO_GEO | ALWAYS_NE_TGEO_GEO | GEOG_INTERSECTS | GEOG_DWITHIN | ACOVERS_GEO_TGEO | GEOM_INTERSECTS | GEOM_DWITHIN | H3_GS_POINT_TO_CELL | EVER_EQ_TH3INDEX_H3INDEX | EVER_NE_TH3INDEX_H3INDEX | ALWAYS_EQ_TH3INDEX_H3INDEX | ALWAYS_NE_TH3INDEX_H3INDEX | TH3INDEX_GET_RESOLUTION | TH3INDEX_GET_BASE_CELL_NUMBER | TH3INDEX_IS_VALID_CELL | TH3INDEX_IS_PENTAGON | TH3INDEX_CELL_TO_PARENT_NEXT | TH3INDEX_CELL_TO_CENTER_CHILD_NEXT | TH3INDEX_CELL_TO_PARENT | TH3INDEX_CELL_TO_CENTER_CHILD | TH3INDEX_CELL_TO_CHILD_POS | TH3INDEX_ARE_NEIGHBOR_CELLS | TH3INDEX_GRID_DISTANCE | EINTERSECTS_TCBUFFER_GEO | AINTERSECTS_TCBUFFER_GEO | ECOVERS_TCBUFFER_GEO | ACOVERS_TCBUFFER_GEO | EDISJOINT_TCBUFFER_GEO | ADISJOINT_TCBUFFER_GEO | ETOUCHES_TCBUFFER_GEO | ATOUCHES_TCBUFFER_GEO | ECONTAINS_TCBUFFER_GEO | ACONTAINS_TCBUFFER_GEO | NAD_TCBUFFER_GEO | EDWITHIN_TCBUFFER_GEO | ADWITHIN_TCBUFFER_GEO | EINTERSECTS_TCBUFFER_CBUFFER | AINTERSECTS_TCBUFFER_CBUFFER | ECOVERS_TCBUFFER_CBUFFER | ACOVERS_TCBUFFER_CBUFFER | EDISJOINT_TCBUFFER_CBUFFER | ADISJOINT_TCBUFFER_CBUFFER | ETOUCHES_TCBUFFER_CBUFFER | ATOUCHES_TCBUFFER_CBUFFER | ECONTAINS_TCBUFFER_CBUFFER | ACONTAINS_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_CBUFFER | ALWAYS_EQ_TCBUFFER_CBUFFER | EVER_NE_TCBUFFER_CBUFFER | ALWAYS_NE_TCBUFFER_CBUFFER | NAD_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_TCBUFFER | ALWAYS_EQ_TCBUFFER_TCBUFFER | EVER_NE_TCBUFFER_TCBUFFER | ALWAYS_NE_TCBUFFER_TCBUFFER | EINTERSECTS_TCBUFFER_TCBUFFER | AINTERSECTS_TCBUFFER_TCBUFFER | ECOVERS_TCBUFFER_TCBUFFER | ACOVERS_TCBUFFER_TCBUFFER | ADISJOINT_TCBUFFER_TCBUFFER | ETOUCHES_TCBUFFER_TCBUFFER | ATOUCHES_TCBUFFER_TCBUFFER | NAD_TCBUFFER_TCBUFFER | EDWITHIN_TCBUFFER_TCBUFFER | ADWITHIN_TCBUFFER_TCBUFFER | MINDISTANCE_TCBUFFER_TCBUFFER | GEOM_INTERSECTS2D | GEOM_DWITHIN2D | GEOM_CONTAINS | GEOM_DISJOINT2D | GEOM_COVERS | GEOM_TOUCHES | GEOM_INTERSECTS3D | GEOM_DWITHIN3D | GEOM_DISTANCE2D | GEOM_DISTANCE3D; sinkClause: INTO sink (',' sink)*; @@ -847,6 +847,9 @@ ADISJOINT_TCBUFFER_TCBUFFER: 'ADISJOINT_TCBUFFER_TCBUFFER' | 'adisjoint_tcbuffer ETOUCHES_TCBUFFER_TCBUFFER: 'ETOUCHES_TCBUFFER_TCBUFFER' | 'etouches_tcbuffer_tcbuffer'; ATOUCHES_TCBUFFER_TCBUFFER: 'ATOUCHES_TCBUFFER_TCBUFFER' | 'atouches_tcbuffer_tcbuffer'; NAD_TCBUFFER_TCBUFFER: 'NAD_TCBUFFER_TCBUFFER' | 'nad_tcbuffer_tcbuffer'; +EDWITHIN_TCBUFFER_TCBUFFER: 'EDWITHIN_TCBUFFER_TCBUFFER' | 'edwithin_tcbuffer_tcbuffer'; +ADWITHIN_TCBUFFER_TCBUFFER: 'ADWITHIN_TCBUFFER_TCBUFFER' | 'adwithin_tcbuffer_tcbuffer'; +MINDISTANCE_TCBUFFER_TCBUFFER: 'MINDISTANCE_TCBUFFER_TCBUFFER' | 'mindistance_tcbuffer_tcbuffer'; GEOM_INTERSECTS2D: 'GEOM_INTERSECTS2D' | 'geom_intersects2d'; GEOM_DWITHIN2D: 'GEOM_DWITHIN2D' | 'geom_dwithin2d'; GEOM_CONTAINS: 'GEOM_CONTAINS' | 'geom_contains'; diff --git a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp index 754015f335..99130e443e 100644 --- a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp +++ b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp @@ -428,6 +428,9 @@ #include #include #include +#include +#include +#include #include #include #include @@ -9882,6 +9885,54 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont return LogicalFunction(NadTcbufferTcbufferLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6), std::move(arg7))); } /* END CODEGEN PARSER GLUE: NAD_TCBUFFER_TCBUFFER */ + case AntlrSQLParser::EDWITHIN_TCBUFFER_TCBUFFER: { + PRECONDITION(ctx->functionParam().size() == 9, + "EdwithinTcbufferTcbuffer requires 9 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + auto arg5 = visit(ctx->functionParam(5)).as(); + auto arg6 = visit(ctx->functionParam(6)).as(); + auto arg7 = visit(ctx->functionParam(7)).as(); + auto arg8 = visit(ctx->functionParam(8)).as(); + return LogicalFunction(EdwithinTcbufferTcbufferLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6), std::move(arg7), std::move(arg8))); + } + /* END CODEGEN PARSER GLUE: EDWITHIN_TCBUFFER_TCBUFFER */ + case AntlrSQLParser::ADWITHIN_TCBUFFER_TCBUFFER: { + PRECONDITION(ctx->functionParam().size() == 9, + "AdwithinTcbufferTcbuffer requires 9 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + auto arg5 = visit(ctx->functionParam(5)).as(); + auto arg6 = visit(ctx->functionParam(6)).as(); + auto arg7 = visit(ctx->functionParam(7)).as(); + auto arg8 = visit(ctx->functionParam(8)).as(); + return LogicalFunction(AdwithinTcbufferTcbufferLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6), std::move(arg7), std::move(arg8))); + } + /* END CODEGEN PARSER GLUE: ADWITHIN_TCBUFFER_TCBUFFER */ + case AntlrSQLParser::MINDISTANCE_TCBUFFER_TCBUFFER: { + PRECONDITION(ctx->functionParam().size() == 9, + "MindistanceTcbufferTcbuffer requires 9 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + auto arg5 = visit(ctx->functionParam(5)).as(); + auto arg6 = visit(ctx->functionParam(6)).as(); + auto arg7 = visit(ctx->functionParam(7)).as(); + auto arg8 = visit(ctx->functionParam(8)).as(); + return LogicalFunction(MindistanceTcbufferTcbufferLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6), std::move(arg7), std::move(arg8))); + } + /* END CODEGEN PARSER GLUE: MINDISTANCE_TCBUFFER_TCBUFFER */ /* END CODEGEN PARSER GLUE: GEOM_INTERSECTS2D */ case AntlrSQLParser::GEOM_DWITHIN2D: { PRECONDITION(ctx->functionParam().size() == 3, From 4e4d4a99c903c7d8e916f968985b57bc2a17a2c7 Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Mon, 15 Jun 2026 08:08:13 +0200 Subject: [PATCH 66/96] feat(meos): add tnpoint per-event scalar operators for geo and npoint (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. --- .../AlwaysEqNpointTnpointLogicalFunction.hpp | 48 +++++++ .../AlwaysEqTnpointNpointLogicalFunction.hpp | 48 +++++++ .../AlwaysNeNpointTnpointLogicalFunction.hpp | 48 +++++++ .../AlwaysNeTnpointNpointLogicalFunction.hpp | 48 +++++++ .../EverEqNpointTnpointLogicalFunction.hpp | 48 +++++++ .../EverEqTnpointNpointLogicalFunction.hpp | 48 +++++++ .../EverNeNpointTnpointLogicalFunction.hpp | 48 +++++++ .../EverNeTnpointNpointLogicalFunction.hpp | 48 +++++++ .../Meos/NadTnpointGeoLogicalFunction.hpp | 48 +++++++ .../Meos/NadTnpointNpointLogicalFunction.hpp | 48 +++++++ .../AlwaysEqNpointTnpointLogicalFunction.cpp | 108 +++++++++++++++ .../AlwaysEqTnpointNpointLogicalFunction.cpp | 108 +++++++++++++++ .../AlwaysNeNpointTnpointLogicalFunction.cpp | 108 +++++++++++++++ .../AlwaysNeTnpointNpointLogicalFunction.cpp | 108 +++++++++++++++ .../src/Functions/Meos/CMakeLists.txt | 10 ++ .../EverEqNpointTnpointLogicalFunction.cpp | 108 +++++++++++++++ .../EverEqTnpointNpointLogicalFunction.cpp | 108 +++++++++++++++ .../EverNeNpointTnpointLogicalFunction.cpp | 108 +++++++++++++++ .../EverNeTnpointNpointLogicalFunction.cpp | 108 +++++++++++++++ .../Meos/NadTnpointGeoLogicalFunction.cpp | 105 ++++++++++++++ .../Meos/NadTnpointNpointLogicalFunction.cpp | 108 +++++++++++++++ .../AlwaysEqNpointTnpointPhysicalFunction.hpp | 32 +++++ .../AlwaysEqTnpointNpointPhysicalFunction.hpp | 32 +++++ .../AlwaysNeNpointTnpointPhysicalFunction.hpp | 32 +++++ .../AlwaysNeTnpointNpointPhysicalFunction.hpp | 32 +++++ .../EverEqNpointTnpointPhysicalFunction.hpp | 32 +++++ .../EverEqTnpointNpointPhysicalFunction.hpp | 32 +++++ .../EverNeNpointTnpointPhysicalFunction.hpp | 32 +++++ .../EverNeTnpointNpointPhysicalFunction.hpp | 32 +++++ .../Meos/NadTnpointGeoPhysicalFunction.hpp | 32 +++++ .../Meos/NadTnpointNpointPhysicalFunction.hpp | 32 +++++ .../AlwaysEqNpointTnpointPhysicalFunction.cpp | 88 ++++++++++++ .../AlwaysEqTnpointNpointPhysicalFunction.cpp | 88 ++++++++++++ .../AlwaysNeNpointTnpointPhysicalFunction.cpp | 88 ++++++++++++ .../AlwaysNeTnpointNpointPhysicalFunction.cpp | 88 ++++++++++++ .../src/Functions/Meos/CMakeLists.txt | 10 ++ .../EverEqNpointTnpointPhysicalFunction.cpp | 88 ++++++++++++ .../EverEqTnpointNpointPhysicalFunction.cpp | 88 ++++++++++++ .../EverNeNpointTnpointPhysicalFunction.cpp | 88 ++++++++++++ .../EverNeTnpointNpointPhysicalFunction.cpp | 88 ++++++++++++ .../Meos/NadTnpointGeoPhysicalFunction.cpp | 89 ++++++++++++ .../Meos/NadTnpointNpointPhysicalFunction.cpp | 88 ++++++++++++ nes-sql-parser/AntlrSQL.g4 | 12 +- .../src/AntlrSQLQueryPlanCreator.cpp | 129 ++++++++++++++++++ 44 files changed, 2918 insertions(+), 1 deletion(-) create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysEqNpointTnpointLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysEqTnpointNpointLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysNeNpointTnpointLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysNeTnpointNpointLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverEqNpointTnpointLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverEqTnpointNpointLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverNeNpointTnpointLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverNeTnpointNpointLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/NadTnpointGeoLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/NadTnpointNpointLogicalFunction.hpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysEqNpointTnpointLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysEqTnpointNpointLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysNeNpointTnpointLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysNeTnpointNpointLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverEqNpointTnpointLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverEqTnpointNpointLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverNeNpointTnpointLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverNeTnpointNpointLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/NadTnpointGeoLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/NadTnpointNpointLogicalFunction.cpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysEqNpointTnpointPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysEqTnpointNpointPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysNeNpointTnpointPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysNeTnpointNpointPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverEqNpointTnpointPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverEqTnpointNpointPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverNeNpointTnpointPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverNeTnpointNpointPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/NadTnpointGeoPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/NadTnpointNpointPhysicalFunction.hpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysEqNpointTnpointPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysEqTnpointNpointPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysNeNpointTnpointPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysNeTnpointNpointPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverEqNpointTnpointPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverEqTnpointNpointPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverNeNpointTnpointPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverNeTnpointNpointPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/NadTnpointGeoPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/NadTnpointNpointPhysicalFunction.cpp diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysEqNpointTnpointLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysEqNpointTnpointLogicalFunction.hpp new file mode 100644 index 0000000000..0cf7786548 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysEqNpointTnpointLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if the static npoint is always equal to the tnpoint instant, 0.0 otherwise. + */ +class AlwaysEqNpointTnpointLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysEqNpointTnpoint"; + + AlwaysEqNpointTnpointLogicalFunction(LogicalFunction rid_np, LogicalFunction pos_np, LogicalFunction rid_tp, LogicalFunction pos_tp, LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysEqTnpointNpointLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysEqTnpointNpointLogicalFunction.hpp new file mode 100644 index 0000000000..72f359cb5c --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysEqTnpointNpointLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if the tnpoint instant is always equal to the static npoint, 0.0 otherwise. + */ +class AlwaysEqTnpointNpointLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysEqTnpointNpoint"; + + AlwaysEqTnpointNpointLogicalFunction(LogicalFunction rid1, LogicalFunction pos1, LogicalFunction ts, LogicalFunction rid2, LogicalFunction pos2); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysNeNpointTnpointLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysNeNpointTnpointLogicalFunction.hpp new file mode 100644 index 0000000000..adabbaa11e --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysNeNpointTnpointLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if the static npoint is always not equal to the tnpoint instant, 0.0 otherwise. + */ +class AlwaysNeNpointTnpointLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysNeNpointTnpoint"; + + AlwaysNeNpointTnpointLogicalFunction(LogicalFunction rid_np, LogicalFunction pos_np, LogicalFunction rid_tp, LogicalFunction pos_tp, LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysNeTnpointNpointLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysNeTnpointNpointLogicalFunction.hpp new file mode 100644 index 0000000000..4ba4d57134 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysNeTnpointNpointLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if the tnpoint instant is always not equal to the static npoint, 0.0 otherwise. + */ +class AlwaysNeTnpointNpointLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysNeTnpointNpoint"; + + AlwaysNeTnpointNpointLogicalFunction(LogicalFunction rid1, LogicalFunction pos1, LogicalFunction ts, LogicalFunction rid2, LogicalFunction pos2); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverEqNpointTnpointLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverEqNpointTnpointLogicalFunction.hpp new file mode 100644 index 0000000000..29ec840797 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverEqNpointTnpointLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if the static npoint is ever equal to the tnpoint instant, 0.0 otherwise. + */ +class EverEqNpointTnpointLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverEqNpointTnpoint"; + + EverEqNpointTnpointLogicalFunction(LogicalFunction rid_np, LogicalFunction pos_np, LogicalFunction rid_tp, LogicalFunction pos_tp, LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverEqTnpointNpointLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverEqTnpointNpointLogicalFunction.hpp new file mode 100644 index 0000000000..527e8a0d49 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverEqTnpointNpointLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if the tnpoint instant is ever equal to the static npoint, 0.0 otherwise. + */ +class EverEqTnpointNpointLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverEqTnpointNpoint"; + + EverEqTnpointNpointLogicalFunction(LogicalFunction rid1, LogicalFunction pos1, LogicalFunction ts, LogicalFunction rid2, LogicalFunction pos2); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverNeNpointTnpointLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverNeNpointTnpointLogicalFunction.hpp new file mode 100644 index 0000000000..c03338e09b --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverNeNpointTnpointLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if the static npoint is ever not equal to the tnpoint instant, 0.0 otherwise. + */ +class EverNeNpointTnpointLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverNeNpointTnpoint"; + + EverNeNpointTnpointLogicalFunction(LogicalFunction rid_np, LogicalFunction pos_np, LogicalFunction rid_tp, LogicalFunction pos_tp, LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverNeTnpointNpointLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverNeTnpointNpointLogicalFunction.hpp new file mode 100644 index 0000000000..83ab3b2a26 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverNeTnpointNpointLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if the tnpoint instant is ever not equal to the static npoint, 0.0 otherwise. + */ +class EverNeTnpointNpointLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverNeTnpointNpoint"; + + EverNeTnpointNpointLogicalFunction(LogicalFunction rid1, LogicalFunction pos1, LogicalFunction ts, LogicalFunction rid2, LogicalFunction pos2); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/NadTnpointGeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/NadTnpointGeoLogicalFunction.hpp new file mode 100644 index 0000000000..2860d4f91a --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/NadTnpointGeoLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns the nearest approach distance between a tnpoint instant and a static geometry. + */ +class NadTnpointGeoLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "NadTnpointGeo"; + + NadTnpointGeoLogicalFunction(LogicalFunction rid, LogicalFunction pos, LogicalFunction ts, LogicalFunction wkt); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/NadTnpointNpointLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/NadTnpointNpointLogicalFunction.hpp new file mode 100644 index 0000000000..90f67e08f6 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/NadTnpointNpointLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns the nearest approach distance between a tnpoint instant and a static npoint. + */ +class NadTnpointNpointLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "NadTnpointNpoint"; + + NadTnpointNpointLogicalFunction(LogicalFunction rid1, LogicalFunction pos1, LogicalFunction ts, LogicalFunction rid2, LogicalFunction pos2); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysEqNpointTnpointLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysEqNpointTnpointLogicalFunction.cpp new file mode 100644 index 0000000000..0627232d65 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysEqNpointTnpointLogicalFunction.cpp @@ -0,0 +1,108 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AlwaysEqNpointTnpointLogicalFunction::AlwaysEqNpointTnpointLogicalFunction(LogicalFunction rid_np, LogicalFunction pos_np, LogicalFunction rid_tp, LogicalFunction pos_tp, LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(5); + parameters.push_back(std::move(rid_np)); + parameters.push_back(std::move(pos_np)); + parameters.push_back(std::move(rid_tp)); + parameters.push_back(std::move(pos_tp)); + parameters.push_back(std::move(ts)); +} + +DataType AlwaysEqNpointTnpointLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysEqNpointTnpointLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AlwaysEqNpointTnpointLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysEqNpointTnpointLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 5, + "AlwaysEqNpointTnpointLogicalFunction requires 5 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AlwaysEqNpointTnpointLogicalFunction::getType() const { return NAME; } + +bool AlwaysEqNpointTnpointLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AlwaysEqNpointTnpointLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction AlwaysEqNpointTnpointLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(5); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "rid_np must be UINT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "pos_np must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "rid_tp must be UINT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::FLOAT64), "pos_tp must be FLOAT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); + return withChildren(c); +} + +SerializableFunction AlwaysEqNpointTnpointLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysEqNpointTnpointLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 5, + "AlwaysEqNpointTnpointLogicalFunction requires 5 children but got {}", + arguments.children.size()); + return AlwaysEqNpointTnpointLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysEqTnpointNpointLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysEqTnpointNpointLogicalFunction.cpp new file mode 100644 index 0000000000..1c1e2071b7 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysEqTnpointNpointLogicalFunction.cpp @@ -0,0 +1,108 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AlwaysEqTnpointNpointLogicalFunction::AlwaysEqTnpointNpointLogicalFunction(LogicalFunction rid1, LogicalFunction pos1, LogicalFunction ts, LogicalFunction rid2, LogicalFunction pos2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(5); + parameters.push_back(std::move(rid1)); + parameters.push_back(std::move(pos1)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(rid2)); + parameters.push_back(std::move(pos2)); +} + +DataType AlwaysEqTnpointNpointLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysEqTnpointNpointLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AlwaysEqTnpointNpointLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysEqTnpointNpointLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 5, + "AlwaysEqTnpointNpointLogicalFunction requires 5 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AlwaysEqTnpointNpointLogicalFunction::getType() const { return NAME; } + +bool AlwaysEqTnpointNpointLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AlwaysEqTnpointNpointLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction AlwaysEqTnpointNpointLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(5); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "rid1 must be UINT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "pos1 must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "rid2 must be UINT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "pos2 must be FLOAT64"); + return withChildren(c); +} + +SerializableFunction AlwaysEqTnpointNpointLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysEqTnpointNpointLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 5, + "AlwaysEqTnpointNpointLogicalFunction requires 5 children but got {}", + arguments.children.size()); + return AlwaysEqTnpointNpointLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysNeNpointTnpointLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysNeNpointTnpointLogicalFunction.cpp new file mode 100644 index 0000000000..bc216bc4b0 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysNeNpointTnpointLogicalFunction.cpp @@ -0,0 +1,108 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AlwaysNeNpointTnpointLogicalFunction::AlwaysNeNpointTnpointLogicalFunction(LogicalFunction rid_np, LogicalFunction pos_np, LogicalFunction rid_tp, LogicalFunction pos_tp, LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(5); + parameters.push_back(std::move(rid_np)); + parameters.push_back(std::move(pos_np)); + parameters.push_back(std::move(rid_tp)); + parameters.push_back(std::move(pos_tp)); + parameters.push_back(std::move(ts)); +} + +DataType AlwaysNeNpointTnpointLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysNeNpointTnpointLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AlwaysNeNpointTnpointLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysNeNpointTnpointLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 5, + "AlwaysNeNpointTnpointLogicalFunction requires 5 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AlwaysNeNpointTnpointLogicalFunction::getType() const { return NAME; } + +bool AlwaysNeNpointTnpointLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AlwaysNeNpointTnpointLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction AlwaysNeNpointTnpointLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(5); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "rid_np must be UINT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "pos_np must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "rid_tp must be UINT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::FLOAT64), "pos_tp must be FLOAT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); + return withChildren(c); +} + +SerializableFunction AlwaysNeNpointTnpointLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysNeNpointTnpointLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 5, + "AlwaysNeNpointTnpointLogicalFunction requires 5 children but got {}", + arguments.children.size()); + return AlwaysNeNpointTnpointLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysNeTnpointNpointLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysNeTnpointNpointLogicalFunction.cpp new file mode 100644 index 0000000000..e6271da03e --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysNeTnpointNpointLogicalFunction.cpp @@ -0,0 +1,108 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AlwaysNeTnpointNpointLogicalFunction::AlwaysNeTnpointNpointLogicalFunction(LogicalFunction rid1, LogicalFunction pos1, LogicalFunction ts, LogicalFunction rid2, LogicalFunction pos2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(5); + parameters.push_back(std::move(rid1)); + parameters.push_back(std::move(pos1)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(rid2)); + parameters.push_back(std::move(pos2)); +} + +DataType AlwaysNeTnpointNpointLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysNeTnpointNpointLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AlwaysNeTnpointNpointLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysNeTnpointNpointLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 5, + "AlwaysNeTnpointNpointLogicalFunction requires 5 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AlwaysNeTnpointNpointLogicalFunction::getType() const { return NAME; } + +bool AlwaysNeTnpointNpointLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AlwaysNeTnpointNpointLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction AlwaysNeTnpointNpointLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(5); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "rid1 must be UINT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "pos1 must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "rid2 must be UINT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "pos2 must be FLOAT64"); + return withChildren(c); +} + +SerializableFunction AlwaysNeTnpointNpointLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysNeTnpointNpointLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 5, + "AlwaysNeTnpointNpointLogicalFunction requires 5 children but got {}", + arguments.children.size()); + return AlwaysNeTnpointNpointLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt index d0859d5ddd..76816ac322 100644 --- a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt @@ -380,6 +380,16 @@ add_plugin(NadTcbufferTcbuffer LogicalFunction nes-logical-operators NadTcbuffer add_plugin(EdwithinTcbufferTcbuffer LogicalFunction nes-logical-operators EdwithinTcbufferTcbufferLogicalFunction.cpp) add_plugin(AdwithinTcbufferTcbuffer LogicalFunction nes-logical-operators AdwithinTcbufferTcbufferLogicalFunction.cpp) add_plugin(MindistanceTcbufferTcbuffer LogicalFunction nes-logical-operators MindistanceTcbufferTcbufferLogicalFunction.cpp) +add_plugin(NadTnpointGeo LogicalFunction nes-logical-operators NadTnpointGeoLogicalFunction.cpp) +add_plugin(EverEqTnpointNpoint LogicalFunction nes-logical-operators EverEqTnpointNpointLogicalFunction.cpp) +add_plugin(AlwaysEqTnpointNpoint LogicalFunction nes-logical-operators AlwaysEqTnpointNpointLogicalFunction.cpp) +add_plugin(EverNeTnpointNpoint LogicalFunction nes-logical-operators EverNeTnpointNpointLogicalFunction.cpp) +add_plugin(AlwaysNeTnpointNpoint LogicalFunction nes-logical-operators AlwaysNeTnpointNpointLogicalFunction.cpp) +add_plugin(NadTnpointNpoint LogicalFunction nes-logical-operators NadTnpointNpointLogicalFunction.cpp) +add_plugin(EverEqNpointTnpoint LogicalFunction nes-logical-operators EverEqNpointTnpointLogicalFunction.cpp) +add_plugin(AlwaysEqNpointTnpoint LogicalFunction nes-logical-operators AlwaysEqNpointTnpointLogicalFunction.cpp) +add_plugin(EverNeNpointTnpoint LogicalFunction nes-logical-operators EverNeNpointTnpointLogicalFunction.cpp) +add_plugin(AlwaysNeNpointTnpoint LogicalFunction nes-logical-operators AlwaysNeNpointTnpointLogicalFunction.cpp) add_plugin(GeomIntersects2d LogicalFunction nes-logical-operators GeomIntersects2dLogicalFunction.cpp) add_plugin(GeomDwithin2d LogicalFunction nes-logical-operators GeomDwithin2dLogicalFunction.cpp) add_plugin(GeomContains LogicalFunction nes-logical-operators GeomContainsLogicalFunction.cpp) diff --git a/nes-logical-operators/src/Functions/Meos/EverEqNpointTnpointLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverEqNpointTnpointLogicalFunction.cpp new file mode 100644 index 0000000000..c7e8673ad2 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverEqNpointTnpointLogicalFunction.cpp @@ -0,0 +1,108 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EverEqNpointTnpointLogicalFunction::EverEqNpointTnpointLogicalFunction(LogicalFunction rid_np, LogicalFunction pos_np, LogicalFunction rid_tp, LogicalFunction pos_tp, LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(5); + parameters.push_back(std::move(rid_np)); + parameters.push_back(std::move(pos_np)); + parameters.push_back(std::move(rid_tp)); + parameters.push_back(std::move(pos_tp)); + parameters.push_back(std::move(ts)); +} + +DataType EverEqNpointTnpointLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverEqNpointTnpointLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EverEqNpointTnpointLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverEqNpointTnpointLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 5, + "EverEqNpointTnpointLogicalFunction requires 5 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EverEqNpointTnpointLogicalFunction::getType() const { return NAME; } + +bool EverEqNpointTnpointLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EverEqNpointTnpointLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction EverEqNpointTnpointLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(5); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "rid_np must be UINT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "pos_np must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "rid_tp must be UINT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::FLOAT64), "pos_tp must be FLOAT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); + return withChildren(c); +} + +SerializableFunction EverEqNpointTnpointLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverEqNpointTnpointLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 5, + "EverEqNpointTnpointLogicalFunction requires 5 children but got {}", + arguments.children.size()); + return EverEqNpointTnpointLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverEqTnpointNpointLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverEqTnpointNpointLogicalFunction.cpp new file mode 100644 index 0000000000..f1a267f874 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverEqTnpointNpointLogicalFunction.cpp @@ -0,0 +1,108 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EverEqTnpointNpointLogicalFunction::EverEqTnpointNpointLogicalFunction(LogicalFunction rid1, LogicalFunction pos1, LogicalFunction ts, LogicalFunction rid2, LogicalFunction pos2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(5); + parameters.push_back(std::move(rid1)); + parameters.push_back(std::move(pos1)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(rid2)); + parameters.push_back(std::move(pos2)); +} + +DataType EverEqTnpointNpointLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverEqTnpointNpointLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EverEqTnpointNpointLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverEqTnpointNpointLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 5, + "EverEqTnpointNpointLogicalFunction requires 5 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EverEqTnpointNpointLogicalFunction::getType() const { return NAME; } + +bool EverEqTnpointNpointLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EverEqTnpointNpointLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction EverEqTnpointNpointLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(5); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "rid1 must be UINT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "pos1 must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "rid2 must be UINT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "pos2 must be FLOAT64"); + return withChildren(c); +} + +SerializableFunction EverEqTnpointNpointLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverEqTnpointNpointLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 5, + "EverEqTnpointNpointLogicalFunction requires 5 children but got {}", + arguments.children.size()); + return EverEqTnpointNpointLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverNeNpointTnpointLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverNeNpointTnpointLogicalFunction.cpp new file mode 100644 index 0000000000..0a95391835 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverNeNpointTnpointLogicalFunction.cpp @@ -0,0 +1,108 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EverNeNpointTnpointLogicalFunction::EverNeNpointTnpointLogicalFunction(LogicalFunction rid_np, LogicalFunction pos_np, LogicalFunction rid_tp, LogicalFunction pos_tp, LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(5); + parameters.push_back(std::move(rid_np)); + parameters.push_back(std::move(pos_np)); + parameters.push_back(std::move(rid_tp)); + parameters.push_back(std::move(pos_tp)); + parameters.push_back(std::move(ts)); +} + +DataType EverNeNpointTnpointLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverNeNpointTnpointLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EverNeNpointTnpointLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverNeNpointTnpointLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 5, + "EverNeNpointTnpointLogicalFunction requires 5 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EverNeNpointTnpointLogicalFunction::getType() const { return NAME; } + +bool EverNeNpointTnpointLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EverNeNpointTnpointLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction EverNeNpointTnpointLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(5); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "rid_np must be UINT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "pos_np must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "rid_tp must be UINT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::FLOAT64), "pos_tp must be FLOAT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); + return withChildren(c); +} + +SerializableFunction EverNeNpointTnpointLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverNeNpointTnpointLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 5, + "EverNeNpointTnpointLogicalFunction requires 5 children but got {}", + arguments.children.size()); + return EverNeNpointTnpointLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverNeTnpointNpointLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverNeTnpointNpointLogicalFunction.cpp new file mode 100644 index 0000000000..9a47532426 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverNeTnpointNpointLogicalFunction.cpp @@ -0,0 +1,108 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EverNeTnpointNpointLogicalFunction::EverNeTnpointNpointLogicalFunction(LogicalFunction rid1, LogicalFunction pos1, LogicalFunction ts, LogicalFunction rid2, LogicalFunction pos2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(5); + parameters.push_back(std::move(rid1)); + parameters.push_back(std::move(pos1)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(rid2)); + parameters.push_back(std::move(pos2)); +} + +DataType EverNeTnpointNpointLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverNeTnpointNpointLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EverNeTnpointNpointLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverNeTnpointNpointLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 5, + "EverNeTnpointNpointLogicalFunction requires 5 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EverNeTnpointNpointLogicalFunction::getType() const { return NAME; } + +bool EverNeTnpointNpointLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EverNeTnpointNpointLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction EverNeTnpointNpointLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(5); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "rid1 must be UINT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "pos1 must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "rid2 must be UINT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "pos2 must be FLOAT64"); + return withChildren(c); +} + +SerializableFunction EverNeTnpointNpointLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverNeTnpointNpointLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 5, + "EverNeTnpointNpointLogicalFunction requires 5 children but got {}", + arguments.children.size()); + return EverNeTnpointNpointLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/NadTnpointGeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/NadTnpointGeoLogicalFunction.cpp new file mode 100644 index 0000000000..86e022e4a7 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/NadTnpointGeoLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +NadTnpointGeoLogicalFunction::NadTnpointGeoLogicalFunction(LogicalFunction rid, LogicalFunction pos, LogicalFunction ts, LogicalFunction wkt) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(4); + parameters.push_back(std::move(rid)); + parameters.push_back(std::move(pos)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(wkt)); +} + +DataType NadTnpointGeoLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction NadTnpointGeoLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector NadTnpointGeoLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction NadTnpointGeoLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 4, + "NadTnpointGeoLogicalFunction requires 4 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view NadTnpointGeoLogicalFunction::getType() const { return NAME; } + +bool NadTnpointGeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string NadTnpointGeoLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction NadTnpointGeoLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(4); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "rid must be UINT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "pos must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::VARSIZED), "wkt must be VARSIZED"); + return withChildren(c); +} + +SerializableFunction NadTnpointGeoLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterNadTnpointGeoLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 4, + "NadTnpointGeoLogicalFunction requires 4 children but got {}", + arguments.children.size()); + return NadTnpointGeoLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/NadTnpointNpointLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/NadTnpointNpointLogicalFunction.cpp new file mode 100644 index 0000000000..4b74567379 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/NadTnpointNpointLogicalFunction.cpp @@ -0,0 +1,108 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +NadTnpointNpointLogicalFunction::NadTnpointNpointLogicalFunction(LogicalFunction rid1, LogicalFunction pos1, LogicalFunction ts, LogicalFunction rid2, LogicalFunction pos2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(5); + parameters.push_back(std::move(rid1)); + parameters.push_back(std::move(pos1)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(rid2)); + parameters.push_back(std::move(pos2)); +} + +DataType NadTnpointNpointLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction NadTnpointNpointLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector NadTnpointNpointLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction NadTnpointNpointLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 5, + "NadTnpointNpointLogicalFunction requires 5 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view NadTnpointNpointLogicalFunction::getType() const { return NAME; } + +bool NadTnpointNpointLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string NadTnpointNpointLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction NadTnpointNpointLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(5); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "rid1 must be UINT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "pos1 must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "rid2 must be UINT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "pos2 must be FLOAT64"); + return withChildren(c); +} + +SerializableFunction NadTnpointNpointLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterNadTnpointNpointLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 5, + "NadTnpointNpointLogicalFunction requires 5 children but got {}", + arguments.children.size()); + return NadTnpointNpointLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4])); +} + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysEqNpointTnpointPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysEqNpointTnpointPhysicalFunction.hpp new file mode 100644 index 0000000000..cba9924d21 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysEqNpointTnpointPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class AlwaysEqNpointTnpointPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysEqNpointTnpointPhysicalFunction(PhysicalFunction rid_np, PhysicalFunction pos_np, PhysicalFunction rid_tp, PhysicalFunction pos_tp, PhysicalFunction ts); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysEqTnpointNpointPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysEqTnpointNpointPhysicalFunction.hpp new file mode 100644 index 0000000000..b430b92485 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysEqTnpointNpointPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class AlwaysEqTnpointNpointPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysEqTnpointNpointPhysicalFunction(PhysicalFunction rid1, PhysicalFunction pos1, PhysicalFunction ts, PhysicalFunction rid2, PhysicalFunction pos2); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysNeNpointTnpointPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysNeNpointTnpointPhysicalFunction.hpp new file mode 100644 index 0000000000..451ff1f286 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysNeNpointTnpointPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class AlwaysNeNpointTnpointPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysNeNpointTnpointPhysicalFunction(PhysicalFunction rid_np, PhysicalFunction pos_np, PhysicalFunction rid_tp, PhysicalFunction pos_tp, PhysicalFunction ts); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysNeTnpointNpointPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysNeTnpointNpointPhysicalFunction.hpp new file mode 100644 index 0000000000..e2e017c3af --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysNeTnpointNpointPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class AlwaysNeTnpointNpointPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysNeTnpointNpointPhysicalFunction(PhysicalFunction rid1, PhysicalFunction pos1, PhysicalFunction ts, PhysicalFunction rid2, PhysicalFunction pos2); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverEqNpointTnpointPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverEqNpointTnpointPhysicalFunction.hpp new file mode 100644 index 0000000000..0f2fcb08ac --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverEqNpointTnpointPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class EverEqNpointTnpointPhysicalFunction : public PhysicalFunctionConcept { +public: + EverEqNpointTnpointPhysicalFunction(PhysicalFunction rid_np, PhysicalFunction pos_np, PhysicalFunction rid_tp, PhysicalFunction pos_tp, PhysicalFunction ts); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverEqTnpointNpointPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverEqTnpointNpointPhysicalFunction.hpp new file mode 100644 index 0000000000..43751866cc --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverEqTnpointNpointPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class EverEqTnpointNpointPhysicalFunction : public PhysicalFunctionConcept { +public: + EverEqTnpointNpointPhysicalFunction(PhysicalFunction rid1, PhysicalFunction pos1, PhysicalFunction ts, PhysicalFunction rid2, PhysicalFunction pos2); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverNeNpointTnpointPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverNeNpointTnpointPhysicalFunction.hpp new file mode 100644 index 0000000000..98789d427d --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverNeNpointTnpointPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class EverNeNpointTnpointPhysicalFunction : public PhysicalFunctionConcept { +public: + EverNeNpointTnpointPhysicalFunction(PhysicalFunction rid_np, PhysicalFunction pos_np, PhysicalFunction rid_tp, PhysicalFunction pos_tp, PhysicalFunction ts); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverNeTnpointNpointPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverNeTnpointNpointPhysicalFunction.hpp new file mode 100644 index 0000000000..52802bbd8b --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverNeTnpointNpointPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class EverNeTnpointNpointPhysicalFunction : public PhysicalFunctionConcept { +public: + EverNeTnpointNpointPhysicalFunction(PhysicalFunction rid1, PhysicalFunction pos1, PhysicalFunction ts, PhysicalFunction rid2, PhysicalFunction pos2); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/NadTnpointGeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/NadTnpointGeoPhysicalFunction.hpp new file mode 100644 index 0000000000..1d927ba586 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/NadTnpointGeoPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class NadTnpointGeoPhysicalFunction : public PhysicalFunctionConcept { +public: + NadTnpointGeoPhysicalFunction(PhysicalFunction rid, PhysicalFunction pos, PhysicalFunction ts, PhysicalFunction wkt); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/NadTnpointNpointPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/NadTnpointNpointPhysicalFunction.hpp new file mode 100644 index 0000000000..989d1c2707 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/NadTnpointNpointPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class NadTnpointNpointPhysicalFunction : public PhysicalFunctionConcept { +public: + NadTnpointNpointPhysicalFunction(PhysicalFunction rid1, PhysicalFunction pos1, PhysicalFunction ts, PhysicalFunction rid2, PhysicalFunction pos2); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysEqNpointTnpointPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysEqNpointTnpointPhysicalFunction.cpp new file mode 100644 index 0000000000..fc8c94d546 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysEqNpointTnpointPhysicalFunction.cpp @@ -0,0 +1,88 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +AlwaysEqNpointTnpointPhysicalFunction::AlwaysEqNpointTnpointPhysicalFunction(PhysicalFunction rid_np, PhysicalFunction pos_np, PhysicalFunction rid_tp, PhysicalFunction pos_tp, PhysicalFunction ts) +{ + paramFns.reserve(5); + paramFns.push_back(std::move(rid_np)); + paramFns.push_back(std::move(pos_np)); + paramFns.push_back(std::move(rid_tp)); + paramFns.push_back(std::move(pos_tp)); + paramFns.push_back(std::move(ts)); +} + +VarVal AlwaysEqNpointTnpointPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto rid_np = paramFns[0].execute(record, arena).cast(); + auto pos_np = paramFns[1].execute(record, arena).cast(); + auto rid_tp = paramFns[2].execute(record, arena).cast(); + auto pos_tp = paramFns[3].execute(record, arena).cast(); + auto ts = paramFns[4].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](uint64_t rid_np, double pos_np, uint64_t rid_tp, double pos_tp, uint64_t ts) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + Npoint* np_s = npoint_make((int64_t)rid_np, pos_np); + if (!np_s) return 0.0; + Npoint* np_t = npoint_make((int64_t)rid_tp, pos_tp); + if (!np_t) { free(np_s); return 0.0; } + Temporal* inst = (Temporal*)tnpointinst_make(np_t, (TimestampTz)ts); + free(np_t); + if (!inst) { free(np_s); return 0.0; } + int r = always_eq_npoint_tnpoint(np_s, inst); + free(np_s); free(inst); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + rid_np, pos_np, rid_tp, pos_tp, ts); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysEqNpointTnpointPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 5, + "AlwaysEqNpointTnpointPhysicalFunction requires 5 children but got {}", + arguments.childFunctions.size()); + return AlwaysEqNpointTnpointPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysEqTnpointNpointPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysEqTnpointNpointPhysicalFunction.cpp new file mode 100644 index 0000000000..41a5538a86 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysEqTnpointNpointPhysicalFunction.cpp @@ -0,0 +1,88 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +AlwaysEqTnpointNpointPhysicalFunction::AlwaysEqTnpointNpointPhysicalFunction(PhysicalFunction rid1, PhysicalFunction pos1, PhysicalFunction ts, PhysicalFunction rid2, PhysicalFunction pos2) +{ + paramFns.reserve(5); + paramFns.push_back(std::move(rid1)); + paramFns.push_back(std::move(pos1)); + paramFns.push_back(std::move(ts)); + paramFns.push_back(std::move(rid2)); + paramFns.push_back(std::move(pos2)); +} + +VarVal AlwaysEqTnpointNpointPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto rid1 = paramFns[0].execute(record, arena).cast(); + auto pos1 = paramFns[1].execute(record, arena).cast(); + auto ts = paramFns[2].execute(record, arena).cast(); + auto rid2 = paramFns[3].execute(record, arena).cast(); + auto pos2 = paramFns[4].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](uint64_t rid1, double pos1, uint64_t ts, uint64_t rid2, double pos2) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + Npoint* np1 = npoint_make((int64_t)rid1, pos1); + if (!np1) return 0.0; + Temporal* inst = (Temporal*)tnpointinst_make(np1, (TimestampTz)ts); + free(np1); + if (!inst) return 0.0; + Npoint* np2 = npoint_make((int64_t)rid2, pos2); + if (!np2) { free(inst); return 0.0; } + int r = always_eq_tnpoint_npoint(inst, np2); + free(inst); free(np2); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + rid1, pos1, ts, rid2, pos2); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysEqTnpointNpointPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 5, + "AlwaysEqTnpointNpointPhysicalFunction requires 5 children but got {}", + arguments.childFunctions.size()); + return AlwaysEqTnpointNpointPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysNeNpointTnpointPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysNeNpointTnpointPhysicalFunction.cpp new file mode 100644 index 0000000000..1dac3ef61b --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysNeNpointTnpointPhysicalFunction.cpp @@ -0,0 +1,88 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +AlwaysNeNpointTnpointPhysicalFunction::AlwaysNeNpointTnpointPhysicalFunction(PhysicalFunction rid_np, PhysicalFunction pos_np, PhysicalFunction rid_tp, PhysicalFunction pos_tp, PhysicalFunction ts) +{ + paramFns.reserve(5); + paramFns.push_back(std::move(rid_np)); + paramFns.push_back(std::move(pos_np)); + paramFns.push_back(std::move(rid_tp)); + paramFns.push_back(std::move(pos_tp)); + paramFns.push_back(std::move(ts)); +} + +VarVal AlwaysNeNpointTnpointPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto rid_np = paramFns[0].execute(record, arena).cast(); + auto pos_np = paramFns[1].execute(record, arena).cast(); + auto rid_tp = paramFns[2].execute(record, arena).cast(); + auto pos_tp = paramFns[3].execute(record, arena).cast(); + auto ts = paramFns[4].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](uint64_t rid_np, double pos_np, uint64_t rid_tp, double pos_tp, uint64_t ts) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + Npoint* np_s = npoint_make((int64_t)rid_np, pos_np); + if (!np_s) return 0.0; + Npoint* np_t = npoint_make((int64_t)rid_tp, pos_tp); + if (!np_t) { free(np_s); return 0.0; } + Temporal* inst = (Temporal*)tnpointinst_make(np_t, (TimestampTz)ts); + free(np_t); + if (!inst) { free(np_s); return 0.0; } + int r = always_ne_npoint_tnpoint(np_s, inst); + free(np_s); free(inst); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + rid_np, pos_np, rid_tp, pos_tp, ts); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysNeNpointTnpointPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 5, + "AlwaysNeNpointTnpointPhysicalFunction requires 5 children but got {}", + arguments.childFunctions.size()); + return AlwaysNeNpointTnpointPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysNeTnpointNpointPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysNeTnpointNpointPhysicalFunction.cpp new file mode 100644 index 0000000000..fde3d1240e --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysNeTnpointNpointPhysicalFunction.cpp @@ -0,0 +1,88 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +AlwaysNeTnpointNpointPhysicalFunction::AlwaysNeTnpointNpointPhysicalFunction(PhysicalFunction rid1, PhysicalFunction pos1, PhysicalFunction ts, PhysicalFunction rid2, PhysicalFunction pos2) +{ + paramFns.reserve(5); + paramFns.push_back(std::move(rid1)); + paramFns.push_back(std::move(pos1)); + paramFns.push_back(std::move(ts)); + paramFns.push_back(std::move(rid2)); + paramFns.push_back(std::move(pos2)); +} + +VarVal AlwaysNeTnpointNpointPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto rid1 = paramFns[0].execute(record, arena).cast(); + auto pos1 = paramFns[1].execute(record, arena).cast(); + auto ts = paramFns[2].execute(record, arena).cast(); + auto rid2 = paramFns[3].execute(record, arena).cast(); + auto pos2 = paramFns[4].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](uint64_t rid1, double pos1, uint64_t ts, uint64_t rid2, double pos2) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + Npoint* np1 = npoint_make((int64_t)rid1, pos1); + if (!np1) return 0.0; + Temporal* inst = (Temporal*)tnpointinst_make(np1, (TimestampTz)ts); + free(np1); + if (!inst) return 0.0; + Npoint* np2 = npoint_make((int64_t)rid2, pos2); + if (!np2) { free(inst); return 0.0; } + int r = always_ne_tnpoint_npoint(inst, np2); + free(inst); free(np2); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + rid1, pos1, ts, rid2, pos2); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysNeTnpointNpointPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 5, + "AlwaysNeTnpointNpointPhysicalFunction requires 5 children but got {}", + arguments.childFunctions.size()); + return AlwaysNeTnpointNpointPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt index 7476871093..9f072bfa7b 100644 --- a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt @@ -379,6 +379,16 @@ add_plugin(NadTcbufferTcbuffer PhysicalFunction nes-physical-operators NadTcbuff add_plugin(EdwithinTcbufferTcbuffer PhysicalFunction nes-physical-operators EdwithinTcbufferTcbufferPhysicalFunction.cpp) add_plugin(AdwithinTcbufferTcbuffer PhysicalFunction nes-physical-operators AdwithinTcbufferTcbufferPhysicalFunction.cpp) add_plugin(MindistanceTcbufferTcbuffer PhysicalFunction nes-physical-operators MindistanceTcbufferTcbufferPhysicalFunction.cpp) +add_plugin(NadTnpointGeo PhysicalFunction nes-physical-operators NadTnpointGeoPhysicalFunction.cpp) +add_plugin(EverEqTnpointNpoint PhysicalFunction nes-physical-operators EverEqTnpointNpointPhysicalFunction.cpp) +add_plugin(AlwaysEqTnpointNpoint PhysicalFunction nes-physical-operators AlwaysEqTnpointNpointPhysicalFunction.cpp) +add_plugin(EverNeTnpointNpoint PhysicalFunction nes-physical-operators EverNeTnpointNpointPhysicalFunction.cpp) +add_plugin(AlwaysNeTnpointNpoint PhysicalFunction nes-physical-operators AlwaysNeTnpointNpointPhysicalFunction.cpp) +add_plugin(NadTnpointNpoint PhysicalFunction nes-physical-operators NadTnpointNpointPhysicalFunction.cpp) +add_plugin(EverEqNpointTnpoint PhysicalFunction nes-physical-operators EverEqNpointTnpointPhysicalFunction.cpp) +add_plugin(AlwaysEqNpointTnpoint PhysicalFunction nes-physical-operators AlwaysEqNpointTnpointPhysicalFunction.cpp) +add_plugin(EverNeNpointTnpoint PhysicalFunction nes-physical-operators EverNeNpointTnpointPhysicalFunction.cpp) +add_plugin(AlwaysNeNpointTnpoint PhysicalFunction nes-physical-operators AlwaysNeNpointTnpointPhysicalFunction.cpp) add_plugin(GeomIntersects2d PhysicalFunction nes-physical-operators GeomIntersects2dPhysicalFunction.cpp) add_plugin(GeomDwithin2d PhysicalFunction nes-physical-operators GeomDwithin2dPhysicalFunction.cpp) add_plugin(GeomContains PhysicalFunction nes-physical-operators GeomContainsPhysicalFunction.cpp) diff --git a/nes-physical-operators/src/Functions/Meos/EverEqNpointTnpointPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverEqNpointTnpointPhysicalFunction.cpp new file mode 100644 index 0000000000..172d4caa24 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverEqNpointTnpointPhysicalFunction.cpp @@ -0,0 +1,88 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +EverEqNpointTnpointPhysicalFunction::EverEqNpointTnpointPhysicalFunction(PhysicalFunction rid_np, PhysicalFunction pos_np, PhysicalFunction rid_tp, PhysicalFunction pos_tp, PhysicalFunction ts) +{ + paramFns.reserve(5); + paramFns.push_back(std::move(rid_np)); + paramFns.push_back(std::move(pos_np)); + paramFns.push_back(std::move(rid_tp)); + paramFns.push_back(std::move(pos_tp)); + paramFns.push_back(std::move(ts)); +} + +VarVal EverEqNpointTnpointPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto rid_np = paramFns[0].execute(record, arena).cast(); + auto pos_np = paramFns[1].execute(record, arena).cast(); + auto rid_tp = paramFns[2].execute(record, arena).cast(); + auto pos_tp = paramFns[3].execute(record, arena).cast(); + auto ts = paramFns[4].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](uint64_t rid_np, double pos_np, uint64_t rid_tp, double pos_tp, uint64_t ts) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + Npoint* np_s = npoint_make((int64_t)rid_np, pos_np); + if (!np_s) return 0.0; + Npoint* np_t = npoint_make((int64_t)rid_tp, pos_tp); + if (!np_t) { free(np_s); return 0.0; } + Temporal* inst = (Temporal*)tnpointinst_make(np_t, (TimestampTz)ts); + free(np_t); + if (!inst) { free(np_s); return 0.0; } + int r = ever_eq_npoint_tnpoint(np_s, inst); + free(np_s); free(inst); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + rid_np, pos_np, rid_tp, pos_tp, ts); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverEqNpointTnpointPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 5, + "EverEqNpointTnpointPhysicalFunction requires 5 children but got {}", + arguments.childFunctions.size()); + return EverEqNpointTnpointPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverEqTnpointNpointPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverEqTnpointNpointPhysicalFunction.cpp new file mode 100644 index 0000000000..3e5ec5e1d5 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverEqTnpointNpointPhysicalFunction.cpp @@ -0,0 +1,88 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +EverEqTnpointNpointPhysicalFunction::EverEqTnpointNpointPhysicalFunction(PhysicalFunction rid1, PhysicalFunction pos1, PhysicalFunction ts, PhysicalFunction rid2, PhysicalFunction pos2) +{ + paramFns.reserve(5); + paramFns.push_back(std::move(rid1)); + paramFns.push_back(std::move(pos1)); + paramFns.push_back(std::move(ts)); + paramFns.push_back(std::move(rid2)); + paramFns.push_back(std::move(pos2)); +} + +VarVal EverEqTnpointNpointPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto rid1 = paramFns[0].execute(record, arena).cast(); + auto pos1 = paramFns[1].execute(record, arena).cast(); + auto ts = paramFns[2].execute(record, arena).cast(); + auto rid2 = paramFns[3].execute(record, arena).cast(); + auto pos2 = paramFns[4].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](uint64_t rid1, double pos1, uint64_t ts, uint64_t rid2, double pos2) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + Npoint* np1 = npoint_make((int64_t)rid1, pos1); + if (!np1) return 0.0; + Temporal* inst = (Temporal*)tnpointinst_make(np1, (TimestampTz)ts); + free(np1); + if (!inst) return 0.0; + Npoint* np2 = npoint_make((int64_t)rid2, pos2); + if (!np2) { free(inst); return 0.0; } + int r = ever_eq_tnpoint_npoint(inst, np2); + free(inst); free(np2); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + rid1, pos1, ts, rid2, pos2); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverEqTnpointNpointPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 5, + "EverEqTnpointNpointPhysicalFunction requires 5 children but got {}", + arguments.childFunctions.size()); + return EverEqTnpointNpointPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverNeNpointTnpointPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverNeNpointTnpointPhysicalFunction.cpp new file mode 100644 index 0000000000..35f9bd221c --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverNeNpointTnpointPhysicalFunction.cpp @@ -0,0 +1,88 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +EverNeNpointTnpointPhysicalFunction::EverNeNpointTnpointPhysicalFunction(PhysicalFunction rid_np, PhysicalFunction pos_np, PhysicalFunction rid_tp, PhysicalFunction pos_tp, PhysicalFunction ts) +{ + paramFns.reserve(5); + paramFns.push_back(std::move(rid_np)); + paramFns.push_back(std::move(pos_np)); + paramFns.push_back(std::move(rid_tp)); + paramFns.push_back(std::move(pos_tp)); + paramFns.push_back(std::move(ts)); +} + +VarVal EverNeNpointTnpointPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto rid_np = paramFns[0].execute(record, arena).cast(); + auto pos_np = paramFns[1].execute(record, arena).cast(); + auto rid_tp = paramFns[2].execute(record, arena).cast(); + auto pos_tp = paramFns[3].execute(record, arena).cast(); + auto ts = paramFns[4].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](uint64_t rid_np, double pos_np, uint64_t rid_tp, double pos_tp, uint64_t ts) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + Npoint* np_s = npoint_make((int64_t)rid_np, pos_np); + if (!np_s) return 0.0; + Npoint* np_t = npoint_make((int64_t)rid_tp, pos_tp); + if (!np_t) { free(np_s); return 0.0; } + Temporal* inst = (Temporal*)tnpointinst_make(np_t, (TimestampTz)ts); + free(np_t); + if (!inst) { free(np_s); return 0.0; } + int r = ever_ne_npoint_tnpoint(np_s, inst); + free(np_s); free(inst); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + rid_np, pos_np, rid_tp, pos_tp, ts); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverNeNpointTnpointPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 5, + "EverNeNpointTnpointPhysicalFunction requires 5 children but got {}", + arguments.childFunctions.size()); + return EverNeNpointTnpointPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverNeTnpointNpointPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverNeTnpointNpointPhysicalFunction.cpp new file mode 100644 index 0000000000..fcdd0cdab9 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverNeTnpointNpointPhysicalFunction.cpp @@ -0,0 +1,88 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +EverNeTnpointNpointPhysicalFunction::EverNeTnpointNpointPhysicalFunction(PhysicalFunction rid1, PhysicalFunction pos1, PhysicalFunction ts, PhysicalFunction rid2, PhysicalFunction pos2) +{ + paramFns.reserve(5); + paramFns.push_back(std::move(rid1)); + paramFns.push_back(std::move(pos1)); + paramFns.push_back(std::move(ts)); + paramFns.push_back(std::move(rid2)); + paramFns.push_back(std::move(pos2)); +} + +VarVal EverNeTnpointNpointPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto rid1 = paramFns[0].execute(record, arena).cast(); + auto pos1 = paramFns[1].execute(record, arena).cast(); + auto ts = paramFns[2].execute(record, arena).cast(); + auto rid2 = paramFns[3].execute(record, arena).cast(); + auto pos2 = paramFns[4].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](uint64_t rid1, double pos1, uint64_t ts, uint64_t rid2, double pos2) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + Npoint* np1 = npoint_make((int64_t)rid1, pos1); + if (!np1) return 0.0; + Temporal* inst = (Temporal*)tnpointinst_make(np1, (TimestampTz)ts); + free(np1); + if (!inst) return 0.0; + Npoint* np2 = npoint_make((int64_t)rid2, pos2); + if (!np2) { free(inst); return 0.0; } + int r = ever_ne_tnpoint_npoint(inst, np2); + free(inst); free(np2); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + rid1, pos1, ts, rid2, pos2); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverNeTnpointNpointPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 5, + "EverNeTnpointNpointPhysicalFunction requires 5 children but got {}", + arguments.childFunctions.size()); + return EverNeTnpointNpointPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/NadTnpointGeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/NadTnpointGeoPhysicalFunction.cpp new file mode 100644 index 0000000000..f56b5303df --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/NadTnpointGeoPhysicalFunction.cpp @@ -0,0 +1,89 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +NadTnpointGeoPhysicalFunction::NadTnpointGeoPhysicalFunction(PhysicalFunction rid, PhysicalFunction pos, PhysicalFunction ts, PhysicalFunction wkt) +{ + paramFns.reserve(4); + paramFns.push_back(std::move(rid)); + paramFns.push_back(std::move(pos)); + paramFns.push_back(std::move(ts)); + paramFns.push_back(std::move(wkt)); +} + +VarVal NadTnpointGeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto rid = paramFns[0].execute(record, arena).cast(); + auto pos = paramFns[1].execute(record, arena).cast(); + auto ts = paramFns[2].execute(record, arena).cast(); + auto wkt = paramFns[3].execute(record, arena); + const auto result = nautilus::invoke( + +[](uint64_t rid, double pos, uint64_t ts, const char* wkt, uint32_t wkt_len) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + Npoint* np = npoint_make((int64_t)rid, pos); + if (!np) return 0.0; + Temporal* inst = (Temporal*)tnpointinst_make(np, (TimestampTz)ts); + free(np); + if (!inst) return 0.0; + char* wkt_str = (char*)malloc(wkt_len + 1); + memcpy(wkt_str, wkt, wkt_len); + wkt_str[wkt_len] = '\0'; + GSERIALIZED* gs = geom_in(wkt_str, -1); + free(wkt_str); + if (!gs) { free(inst); return 0.0; } + double r = nad_tnpoint_geo(inst, gs); + free(inst); free(gs); + return r; + } catch (const std::exception&) { return 0.0; } + }, + rid, pos, ts, wkt); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterNadTnpointGeoPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 4, + "NadTnpointGeoPhysicalFunction requires 4 children but got {}", + arguments.childFunctions.size()); + return NadTnpointGeoPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/NadTnpointNpointPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/NadTnpointNpointPhysicalFunction.cpp new file mode 100644 index 0000000000..52016d483a --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/NadTnpointNpointPhysicalFunction.cpp @@ -0,0 +1,88 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +NadTnpointNpointPhysicalFunction::NadTnpointNpointPhysicalFunction(PhysicalFunction rid1, PhysicalFunction pos1, PhysicalFunction ts, PhysicalFunction rid2, PhysicalFunction pos2) +{ + paramFns.reserve(5); + paramFns.push_back(std::move(rid1)); + paramFns.push_back(std::move(pos1)); + paramFns.push_back(std::move(ts)); + paramFns.push_back(std::move(rid2)); + paramFns.push_back(std::move(pos2)); +} + +VarVal NadTnpointNpointPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto rid1 = paramFns[0].execute(record, arena).cast(); + auto pos1 = paramFns[1].execute(record, arena).cast(); + auto ts = paramFns[2].execute(record, arena).cast(); + auto rid2 = paramFns[3].execute(record, arena).cast(); + auto pos2 = paramFns[4].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](uint64_t rid1, double pos1, uint64_t ts, uint64_t rid2, double pos2) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + Npoint* np1 = npoint_make((int64_t)rid1, pos1); + if (!np1) return 0.0; + Temporal* inst = (Temporal*)tnpointinst_make(np1, (TimestampTz)ts); + free(np1); + if (!inst) return 0.0; + Npoint* np2 = npoint_make((int64_t)rid2, pos2); + if (!np2) { free(inst); return 0.0; } + double r = nad_tnpoint_npoint(inst, np2); + free(inst); free(np2); + return r; + } catch (const std::exception&) { return 0.0; } + }, + rid1, pos1, ts, rid2, pos2); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterNadTnpointNpointPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 5, + "NadTnpointNpointPhysicalFunction requires 5 children but got {}", + arguments.childFunctions.size()); + return NadTnpointNpointPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4])); +} + +} // namespace NES diff --git a/nes-sql-parser/AntlrSQL.g4 b/nes-sql-parser/AntlrSQL.g4 index 5bbf4a6792..368afd38f5 100644 --- a/nes-sql-parser/AntlrSQL.g4 +++ b/nes-sql-parser/AntlrSQL.g4 @@ -295,7 +295,7 @@ timeUnit: MS timestampParameter: name=identifier; -functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT | TGE_TTEXT_TEXT | TGE_TEXT_TTEXT | TGT_TTEXT_TEXT | TGT_TEXT_TTEXT | TLE_TTEXT_TEXT | TLE_TEXT_TTEXT | TLT_TTEXT_TEXT | TLT_TEXT_TTEXT | TTEXT_UPPER | TTEXT_LOWER | TTEXT_INITCAP | TEXTCAT_TTEXT_TEXT | TEXTCAT_TEXT_TTEXT | TEXTCAT_TTEXT_TTEXT | GEOM_LENGTH | GEOM_PERIMETER | GEOM_AZIMUTH | GEOG_AREA | GEOG_LENGTH | GEOG_PERIMETER | GEOM_IS_EMPTY | AINTERSECTS_TGEO_GEO | ACOVERS_TGEO_GEO | ADISJOINT_TGEO_GEO | ADWITHIN_TGEO_GEO | EINTERSECTS_TGEO_GEO | ETOUCHES_TGEO_GEO | ECONTAINS_TGEO_GEO | ACONTAINS_TGEO_GEO | ATOUCHES_TGEO_GEO | GEO_NUM_POINTS | GEO_NUM_GEOS | GEO_SRID | GEO_IS_UNITARY | GEO_EQUALS | GEO_SAME | GEOG_DISTANCE | NAD_TGEO_GEO | EVER_EQ_TGEO_GEO | EVER_NE_TGEO_GEO | ALWAYS_EQ_TGEO_GEO | ALWAYS_NE_TGEO_GEO | GEOG_INTERSECTS | GEOG_DWITHIN | ACOVERS_GEO_TGEO | GEOM_INTERSECTS | GEOM_DWITHIN | H3_GS_POINT_TO_CELL | EVER_EQ_TH3INDEX_H3INDEX | EVER_NE_TH3INDEX_H3INDEX | ALWAYS_EQ_TH3INDEX_H3INDEX | ALWAYS_NE_TH3INDEX_H3INDEX | TH3INDEX_GET_RESOLUTION | TH3INDEX_GET_BASE_CELL_NUMBER | TH3INDEX_IS_VALID_CELL | TH3INDEX_IS_PENTAGON | TH3INDEX_CELL_TO_PARENT_NEXT | TH3INDEX_CELL_TO_CENTER_CHILD_NEXT | TH3INDEX_CELL_TO_PARENT | TH3INDEX_CELL_TO_CENTER_CHILD | TH3INDEX_CELL_TO_CHILD_POS | TH3INDEX_ARE_NEIGHBOR_CELLS | TH3INDEX_GRID_DISTANCE | EINTERSECTS_TCBUFFER_GEO | AINTERSECTS_TCBUFFER_GEO | ECOVERS_TCBUFFER_GEO | ACOVERS_TCBUFFER_GEO | EDISJOINT_TCBUFFER_GEO | ADISJOINT_TCBUFFER_GEO | ETOUCHES_TCBUFFER_GEO | ATOUCHES_TCBUFFER_GEO | ECONTAINS_TCBUFFER_GEO | ACONTAINS_TCBUFFER_GEO | NAD_TCBUFFER_GEO | EDWITHIN_TCBUFFER_GEO | ADWITHIN_TCBUFFER_GEO | EINTERSECTS_TCBUFFER_CBUFFER | AINTERSECTS_TCBUFFER_CBUFFER | ECOVERS_TCBUFFER_CBUFFER | ACOVERS_TCBUFFER_CBUFFER | EDISJOINT_TCBUFFER_CBUFFER | ADISJOINT_TCBUFFER_CBUFFER | ETOUCHES_TCBUFFER_CBUFFER | ATOUCHES_TCBUFFER_CBUFFER | ECONTAINS_TCBUFFER_CBUFFER | ACONTAINS_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_CBUFFER | ALWAYS_EQ_TCBUFFER_CBUFFER | EVER_NE_TCBUFFER_CBUFFER | ALWAYS_NE_TCBUFFER_CBUFFER | NAD_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_TCBUFFER | ALWAYS_EQ_TCBUFFER_TCBUFFER | EVER_NE_TCBUFFER_TCBUFFER | ALWAYS_NE_TCBUFFER_TCBUFFER | EINTERSECTS_TCBUFFER_TCBUFFER | AINTERSECTS_TCBUFFER_TCBUFFER | ECOVERS_TCBUFFER_TCBUFFER | ACOVERS_TCBUFFER_TCBUFFER | ADISJOINT_TCBUFFER_TCBUFFER | ETOUCHES_TCBUFFER_TCBUFFER | ATOUCHES_TCBUFFER_TCBUFFER | NAD_TCBUFFER_TCBUFFER | EDWITHIN_TCBUFFER_TCBUFFER | ADWITHIN_TCBUFFER_TCBUFFER | MINDISTANCE_TCBUFFER_TCBUFFER | GEOM_INTERSECTS2D | GEOM_DWITHIN2D | GEOM_CONTAINS | GEOM_DISJOINT2D | GEOM_COVERS | GEOM_TOUCHES | GEOM_INTERSECTS3D | GEOM_DWITHIN3D | GEOM_DISTANCE2D | GEOM_DISTANCE3D; +functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT | TGE_TTEXT_TEXT | TGE_TEXT_TTEXT | TGT_TTEXT_TEXT | TGT_TEXT_TTEXT | TLE_TTEXT_TEXT | TLE_TEXT_TTEXT | TLT_TTEXT_TEXT | TLT_TEXT_TTEXT | TTEXT_UPPER | TTEXT_LOWER | TTEXT_INITCAP | TEXTCAT_TTEXT_TEXT | TEXTCAT_TEXT_TTEXT | TEXTCAT_TTEXT_TTEXT | GEOM_LENGTH | GEOM_PERIMETER | GEOM_AZIMUTH | GEOG_AREA | GEOG_LENGTH | GEOG_PERIMETER | GEOM_IS_EMPTY | AINTERSECTS_TGEO_GEO | ACOVERS_TGEO_GEO | ADISJOINT_TGEO_GEO | ADWITHIN_TGEO_GEO | EINTERSECTS_TGEO_GEO | ETOUCHES_TGEO_GEO | ECONTAINS_TGEO_GEO | ACONTAINS_TGEO_GEO | ATOUCHES_TGEO_GEO | GEO_NUM_POINTS | GEO_NUM_GEOS | GEO_SRID | GEO_IS_UNITARY | GEO_EQUALS | GEO_SAME | GEOG_DISTANCE | NAD_TGEO_GEO | EVER_EQ_TGEO_GEO | EVER_NE_TGEO_GEO | ALWAYS_EQ_TGEO_GEO | ALWAYS_NE_TGEO_GEO | GEOG_INTERSECTS | GEOG_DWITHIN | ACOVERS_GEO_TGEO | GEOM_INTERSECTS | GEOM_DWITHIN | H3_GS_POINT_TO_CELL | EVER_EQ_TH3INDEX_H3INDEX | EVER_NE_TH3INDEX_H3INDEX | ALWAYS_EQ_TH3INDEX_H3INDEX | ALWAYS_NE_TH3INDEX_H3INDEX | TH3INDEX_GET_RESOLUTION | TH3INDEX_GET_BASE_CELL_NUMBER | TH3INDEX_IS_VALID_CELL | TH3INDEX_IS_PENTAGON | TH3INDEX_CELL_TO_PARENT_NEXT | TH3INDEX_CELL_TO_CENTER_CHILD_NEXT | TH3INDEX_CELL_TO_PARENT | TH3INDEX_CELL_TO_CENTER_CHILD | TH3INDEX_CELL_TO_CHILD_POS | TH3INDEX_ARE_NEIGHBOR_CELLS | TH3INDEX_GRID_DISTANCE | EINTERSECTS_TCBUFFER_GEO | AINTERSECTS_TCBUFFER_GEO | ECOVERS_TCBUFFER_GEO | ACOVERS_TCBUFFER_GEO | EDISJOINT_TCBUFFER_GEO | ADISJOINT_TCBUFFER_GEO | ETOUCHES_TCBUFFER_GEO | ATOUCHES_TCBUFFER_GEO | ECONTAINS_TCBUFFER_GEO | ACONTAINS_TCBUFFER_GEO | NAD_TCBUFFER_GEO | EDWITHIN_TCBUFFER_GEO | ADWITHIN_TCBUFFER_GEO | EINTERSECTS_TCBUFFER_CBUFFER | AINTERSECTS_TCBUFFER_CBUFFER | ECOVERS_TCBUFFER_CBUFFER | ACOVERS_TCBUFFER_CBUFFER | EDISJOINT_TCBUFFER_CBUFFER | ADISJOINT_TCBUFFER_CBUFFER | ETOUCHES_TCBUFFER_CBUFFER | ATOUCHES_TCBUFFER_CBUFFER | ECONTAINS_TCBUFFER_CBUFFER | ACONTAINS_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_CBUFFER | ALWAYS_EQ_TCBUFFER_CBUFFER | EVER_NE_TCBUFFER_CBUFFER | ALWAYS_NE_TCBUFFER_CBUFFER | NAD_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_TCBUFFER | ALWAYS_EQ_TCBUFFER_TCBUFFER | EVER_NE_TCBUFFER_TCBUFFER | ALWAYS_NE_TCBUFFER_TCBUFFER | EINTERSECTS_TCBUFFER_TCBUFFER | AINTERSECTS_TCBUFFER_TCBUFFER | ECOVERS_TCBUFFER_TCBUFFER | ACOVERS_TCBUFFER_TCBUFFER | ADISJOINT_TCBUFFER_TCBUFFER | ETOUCHES_TCBUFFER_TCBUFFER | ATOUCHES_TCBUFFER_TCBUFFER | NAD_TCBUFFER_TCBUFFER | EDWITHIN_TCBUFFER_TCBUFFER | ADWITHIN_TCBUFFER_TCBUFFER | MINDISTANCE_TCBUFFER_TCBUFFER | NAD_TNPOINT_GEO | EVER_EQ_TNPOINT_NPOINT | ALWAYS_EQ_TNPOINT_NPOINT | EVER_NE_TNPOINT_NPOINT | ALWAYS_NE_TNPOINT_NPOINT | NAD_TNPOINT_NPOINT | EVER_EQ_NPOINT_TNPOINT | ALWAYS_EQ_NPOINT_TNPOINT | EVER_NE_NPOINT_TNPOINT | ALWAYS_NE_NPOINT_TNPOINT | GEOM_INTERSECTS2D | GEOM_DWITHIN2D | GEOM_CONTAINS | GEOM_DISJOINT2D | GEOM_COVERS | GEOM_TOUCHES | GEOM_INTERSECTS3D | GEOM_DWITHIN3D | GEOM_DISTANCE2D | GEOM_DISTANCE3D; sinkClause: INTO sink (',' sink)*; @@ -850,6 +850,16 @@ NAD_TCBUFFER_TCBUFFER: 'NAD_TCBUFFER_TCBUFFER' | 'nad_tcbuffer_tcbuffer'; EDWITHIN_TCBUFFER_TCBUFFER: 'EDWITHIN_TCBUFFER_TCBUFFER' | 'edwithin_tcbuffer_tcbuffer'; ADWITHIN_TCBUFFER_TCBUFFER: 'ADWITHIN_TCBUFFER_TCBUFFER' | 'adwithin_tcbuffer_tcbuffer'; MINDISTANCE_TCBUFFER_TCBUFFER: 'MINDISTANCE_TCBUFFER_TCBUFFER' | 'mindistance_tcbuffer_tcbuffer'; +NAD_TNPOINT_GEO: 'NAD_TNPOINT_GEO' | 'nad_tnpoint_geo'; +EVER_EQ_TNPOINT_NPOINT: 'EVER_EQ_TNPOINT_NPOINT' | 'ever_eq_tnpoint_npoint'; +ALWAYS_EQ_TNPOINT_NPOINT: 'ALWAYS_EQ_TNPOINT_NPOINT' | 'always_eq_tnpoint_npoint'; +EVER_NE_TNPOINT_NPOINT: 'EVER_NE_TNPOINT_NPOINT' | 'ever_ne_tnpoint_npoint'; +ALWAYS_NE_TNPOINT_NPOINT: 'ALWAYS_NE_TNPOINT_NPOINT' | 'always_ne_tnpoint_npoint'; +NAD_TNPOINT_NPOINT: 'NAD_TNPOINT_NPOINT' | 'nad_tnpoint_npoint'; +EVER_EQ_NPOINT_TNPOINT: 'EVER_EQ_NPOINT_TNPOINT' | 'ever_eq_npoint_tnpoint'; +ALWAYS_EQ_NPOINT_TNPOINT: 'ALWAYS_EQ_NPOINT_TNPOINT' | 'always_eq_npoint_tnpoint'; +EVER_NE_NPOINT_TNPOINT: 'EVER_NE_NPOINT_TNPOINT' | 'ever_ne_npoint_tnpoint'; +ALWAYS_NE_NPOINT_TNPOINT: 'ALWAYS_NE_NPOINT_TNPOINT' | 'always_ne_npoint_tnpoint'; GEOM_INTERSECTS2D: 'GEOM_INTERSECTS2D' | 'geom_intersects2d'; GEOM_DWITHIN2D: 'GEOM_DWITHIN2D' | 'geom_dwithin2d'; GEOM_CONTAINS: 'GEOM_CONTAINS' | 'geom_contains'; diff --git a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp index 99130e443e..fbe706f10c 100644 --- a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp +++ b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp @@ -431,6 +431,16 @@ #include #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include @@ -9933,6 +9943,125 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont return LogicalFunction(MindistanceTcbufferTcbufferLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6), std::move(arg7), std::move(arg8))); } /* END CODEGEN PARSER GLUE: MINDISTANCE_TCBUFFER_TCBUFFER */ + case AntlrSQLParser::NAD_TNPOINT_GEO: { + PRECONDITION(ctx->functionParam().size() == 4, + "NadTnpointGeo requires 4 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + return LogicalFunction(NadTnpointGeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3))); + } + /* END CODEGEN PARSER GLUE: NAD_TNPOINT_GEO */ + case AntlrSQLParser::EVER_EQ_TNPOINT_NPOINT: { + PRECONDITION(ctx->functionParam().size() == 5, + "EverEqTnpointNpoint requires 5 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + return LogicalFunction(EverEqTnpointNpointLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4))); + } + /* END CODEGEN PARSER GLUE: EVER_EQ_TNPOINT_NPOINT */ + case AntlrSQLParser::ALWAYS_EQ_TNPOINT_NPOINT: { + PRECONDITION(ctx->functionParam().size() == 5, + "AlwaysEqTnpointNpoint requires 5 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + return LogicalFunction(AlwaysEqTnpointNpointLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4))); + } + /* END CODEGEN PARSER GLUE: ALWAYS_EQ_TNPOINT_NPOINT */ + case AntlrSQLParser::EVER_NE_TNPOINT_NPOINT: { + PRECONDITION(ctx->functionParam().size() == 5, + "EverNeTnpointNpoint requires 5 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + return LogicalFunction(EverNeTnpointNpointLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4))); + } + /* END CODEGEN PARSER GLUE: EVER_NE_TNPOINT_NPOINT */ + case AntlrSQLParser::ALWAYS_NE_TNPOINT_NPOINT: { + PRECONDITION(ctx->functionParam().size() == 5, + "AlwaysNeTnpointNpoint requires 5 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + return LogicalFunction(AlwaysNeTnpointNpointLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4))); + } + /* END CODEGEN PARSER GLUE: ALWAYS_NE_TNPOINT_NPOINT */ + case AntlrSQLParser::NAD_TNPOINT_NPOINT: { + PRECONDITION(ctx->functionParam().size() == 5, + "NadTnpointNpoint requires 5 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + return LogicalFunction(NadTnpointNpointLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4))); + } + /* END CODEGEN PARSER GLUE: NAD_TNPOINT_NPOINT */ + case AntlrSQLParser::EVER_EQ_NPOINT_TNPOINT: { + PRECONDITION(ctx->functionParam().size() == 5, + "EverEqNpointTnpoint requires 5 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + return LogicalFunction(EverEqNpointTnpointLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4))); + } + /* END CODEGEN PARSER GLUE: EVER_EQ_NPOINT_TNPOINT */ + case AntlrSQLParser::ALWAYS_EQ_NPOINT_TNPOINT: { + PRECONDITION(ctx->functionParam().size() == 5, + "AlwaysEqNpointTnpoint requires 5 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + return LogicalFunction(AlwaysEqNpointTnpointLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4))); + } + /* END CODEGEN PARSER GLUE: ALWAYS_EQ_NPOINT_TNPOINT */ + case AntlrSQLParser::EVER_NE_NPOINT_TNPOINT: { + PRECONDITION(ctx->functionParam().size() == 5, + "EverNeNpointTnpoint requires 5 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + return LogicalFunction(EverNeNpointTnpointLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4))); + } + /* END CODEGEN PARSER GLUE: EVER_NE_NPOINT_TNPOINT */ + case AntlrSQLParser::ALWAYS_NE_NPOINT_TNPOINT: { + PRECONDITION(ctx->functionParam().size() == 5, + "AlwaysNeNpointTnpoint requires 5 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + return LogicalFunction(AlwaysNeNpointTnpointLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4))); + } + /* END CODEGEN PARSER GLUE: ALWAYS_NE_NPOINT_TNPOINT */ /* END CODEGEN PARSER GLUE: GEOM_INTERSECTS2D */ case AntlrSQLParser::GEOM_DWITHIN2D: { PRECONDITION(ctx->functionParam().size() == 3, From 9059116fdad6e27f88b5be485e9183b4dffb6daf Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Mon, 15 Jun 2026 08:08:37 +0200 Subject: [PATCH 67/96] feat(meos): add tnpoint_tnpoint per-event scalar operators (W119) 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). --- .../AlwaysEqTnpointTnpointLogicalFunction.hpp | 52 ++++++++ .../AlwaysNeTnpointTnpointLogicalFunction.hpp | 52 ++++++++ .../EverEqTnpointTnpointLogicalFunction.hpp | 52 ++++++++ .../EverNeTnpointTnpointLogicalFunction.hpp | 52 ++++++++ .../Meos/NadTnpointTnpointLogicalFunction.hpp | 52 ++++++++ .../AlwaysEqTnpointTnpointLogicalFunction.cpp | 112 ++++++++++++++++++ .../AlwaysNeTnpointTnpointLogicalFunction.cpp | 112 ++++++++++++++++++ .../src/Functions/Meos/CMakeLists.txt | 5 + .../EverEqTnpointTnpointLogicalFunction.cpp | 112 ++++++++++++++++++ .../EverNeTnpointTnpointLogicalFunction.cpp | 112 ++++++++++++++++++ .../Meos/NadTnpointTnpointLogicalFunction.cpp | 112 ++++++++++++++++++ ...AlwaysEqTnpointTnpointPhysicalFunction.hpp | 33 ++++++ ...AlwaysNeTnpointTnpointPhysicalFunction.hpp | 33 ++++++ .../EverEqTnpointTnpointPhysicalFunction.hpp | 33 ++++++ .../EverNeTnpointTnpointPhysicalFunction.hpp | 33 ++++++ .../NadTnpointTnpointPhysicalFunction.hpp | 33 ++++++ ...AlwaysEqTnpointTnpointPhysicalFunction.cpp | 96 +++++++++++++++ ...AlwaysNeTnpointTnpointPhysicalFunction.cpp | 96 +++++++++++++++ .../src/Functions/Meos/CMakeLists.txt | 5 + .../EverEqTnpointTnpointPhysicalFunction.cpp | 96 +++++++++++++++ .../EverNeTnpointTnpointPhysicalFunction.cpp | 96 +++++++++++++++ .../NadTnpointTnpointPhysicalFunction.cpp | 96 +++++++++++++++ nes-sql-parser/AntlrSQL.g4 | 7 +- .../src/AntlrSQLQueryPlanCreator.cpp | 70 +++++++++++ 24 files changed, 1551 insertions(+), 1 deletion(-) create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysEqTnpointTnpointLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysNeTnpointTnpointLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverEqTnpointTnpointLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverNeTnpointTnpointLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/NadTnpointTnpointLogicalFunction.hpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysEqTnpointTnpointLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysNeTnpointTnpointLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverEqTnpointTnpointLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverNeTnpointTnpointLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/NadTnpointTnpointLogicalFunction.cpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysEqTnpointTnpointPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysNeTnpointTnpointPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverEqTnpointTnpointPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverNeTnpointTnpointPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/NadTnpointTnpointPhysicalFunction.hpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysEqTnpointTnpointPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysNeTnpointTnpointPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverEqTnpointTnpointPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverNeTnpointTnpointPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/NadTnpointTnpointPhysicalFunction.cpp diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysEqTnpointTnpointLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysEqTnpointTnpointLogicalFunction.hpp new file mode 100644 index 0000000000..550d19e5ef --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysEqTnpointTnpointLogicalFunction.hpp @@ -0,0 +1,52 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if the two tnpoint instants are always equal, 0.0 otherwise. + * + * Args: (rid1:UINT64, pos1:FLOAT64, ts1:UINT64, + * rid2:UINT64, pos2:FLOAT64, ts2:UINT64) -> FLOAT64. + */ +class AlwaysEqTnpointTnpointLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysEqTnpointTnpoint"; + + AlwaysEqTnpointTnpointLogicalFunction(LogicalFunction rid1, LogicalFunction pos1, LogicalFunction ts1, + LogicalFunction rid2, LogicalFunction pos2, LogicalFunction ts2); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysNeTnpointTnpointLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysNeTnpointTnpointLogicalFunction.hpp new file mode 100644 index 0000000000..01aa7bc348 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysNeTnpointTnpointLogicalFunction.hpp @@ -0,0 +1,52 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if the two tnpoint instants are always not equal, 0.0 otherwise. + * + * Args: (rid1:UINT64, pos1:FLOAT64, ts1:UINT64, + * rid2:UINT64, pos2:FLOAT64, ts2:UINT64) -> FLOAT64. + */ +class AlwaysNeTnpointTnpointLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysNeTnpointTnpoint"; + + AlwaysNeTnpointTnpointLogicalFunction(LogicalFunction rid1, LogicalFunction pos1, LogicalFunction ts1, + LogicalFunction rid2, LogicalFunction pos2, LogicalFunction ts2); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverEqTnpointTnpointLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverEqTnpointTnpointLogicalFunction.hpp new file mode 100644 index 0000000000..83955bbd65 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverEqTnpointTnpointLogicalFunction.hpp @@ -0,0 +1,52 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if the two tnpoint instants are ever equal, 0.0 otherwise. + * + * Args: (rid1:UINT64, pos1:FLOAT64, ts1:UINT64, + * rid2:UINT64, pos2:FLOAT64, ts2:UINT64) -> FLOAT64. + */ +class EverEqTnpointTnpointLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverEqTnpointTnpoint"; + + EverEqTnpointTnpointLogicalFunction(LogicalFunction rid1, LogicalFunction pos1, LogicalFunction ts1, + LogicalFunction rid2, LogicalFunction pos2, LogicalFunction ts2); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverNeTnpointTnpointLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverNeTnpointTnpointLogicalFunction.hpp new file mode 100644 index 0000000000..70b4eb871e --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverNeTnpointTnpointLogicalFunction.hpp @@ -0,0 +1,52 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if the two tnpoint instants are ever not equal, 0.0 otherwise. + * + * Args: (rid1:UINT64, pos1:FLOAT64, ts1:UINT64, + * rid2:UINT64, pos2:FLOAT64, ts2:UINT64) -> FLOAT64. + */ +class EverNeTnpointTnpointLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverNeTnpointTnpoint"; + + EverNeTnpointTnpointLogicalFunction(LogicalFunction rid1, LogicalFunction pos1, LogicalFunction ts1, + LogicalFunction rid2, LogicalFunction pos2, LogicalFunction ts2); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/NadTnpointTnpointLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/NadTnpointTnpointLogicalFunction.hpp new file mode 100644 index 0000000000..df02072219 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/NadTnpointTnpointLogicalFunction.hpp @@ -0,0 +1,52 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns the nearest approach distance between two tnpoint instants. + * + * Args: (rid1:UINT64, pos1:FLOAT64, ts1:UINT64, + * rid2:UINT64, pos2:FLOAT64, ts2:UINT64) -> FLOAT64. + */ +class NadTnpointTnpointLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "NadTnpointTnpoint"; + + NadTnpointTnpointLogicalFunction(LogicalFunction rid1, LogicalFunction pos1, LogicalFunction ts1, + LogicalFunction rid2, LogicalFunction pos2, LogicalFunction ts2); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysEqTnpointTnpointLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysEqTnpointTnpointLogicalFunction.cpp new file mode 100644 index 0000000000..5d2ef221c8 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysEqTnpointTnpointLogicalFunction.cpp @@ -0,0 +1,112 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AlwaysEqTnpointTnpointLogicalFunction::AlwaysEqTnpointTnpointLogicalFunction( + LogicalFunction rid1, LogicalFunction pos1, LogicalFunction ts1, + LogicalFunction rid2, LogicalFunction pos2, LogicalFunction ts2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(6); + parameters.push_back(std::move(rid1)); + parameters.push_back(std::move(pos1)); + parameters.push_back(std::move(ts1)); + parameters.push_back(std::move(rid2)); + parameters.push_back(std::move(pos2)); + parameters.push_back(std::move(ts2)); +} + +DataType AlwaysEqTnpointTnpointLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysEqTnpointTnpointLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AlwaysEqTnpointTnpointLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysEqTnpointTnpointLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 6, + "AlwaysEqTnpointTnpointLogicalFunction requires 6 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AlwaysEqTnpointTnpointLogicalFunction::getType() const { return NAME; } + +bool AlwaysEqTnpointTnpointLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AlwaysEqTnpointTnpointLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction AlwaysEqTnpointTnpointLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(6); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "rid1 must be UINT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "pos1 must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "rid2 must be UINT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "pos2 must be FLOAT64"); + INVARIANT(c[5].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); + return withChildren(c); +} + +SerializableFunction AlwaysEqTnpointTnpointLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysEqTnpointTnpointLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 6, + "AlwaysEqTnpointTnpointLogicalFunction requires 6 children but got {}", + arguments.children.size()); + return AlwaysEqTnpointTnpointLogicalFunction(std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4]), + std::move(arguments.children[5])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysNeTnpointTnpointLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysNeTnpointTnpointLogicalFunction.cpp new file mode 100644 index 0000000000..0691b0129c --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysNeTnpointTnpointLogicalFunction.cpp @@ -0,0 +1,112 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AlwaysNeTnpointTnpointLogicalFunction::AlwaysNeTnpointTnpointLogicalFunction( + LogicalFunction rid1, LogicalFunction pos1, LogicalFunction ts1, + LogicalFunction rid2, LogicalFunction pos2, LogicalFunction ts2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(6); + parameters.push_back(std::move(rid1)); + parameters.push_back(std::move(pos1)); + parameters.push_back(std::move(ts1)); + parameters.push_back(std::move(rid2)); + parameters.push_back(std::move(pos2)); + parameters.push_back(std::move(ts2)); +} + +DataType AlwaysNeTnpointTnpointLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysNeTnpointTnpointLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AlwaysNeTnpointTnpointLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysNeTnpointTnpointLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 6, + "AlwaysNeTnpointTnpointLogicalFunction requires 6 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AlwaysNeTnpointTnpointLogicalFunction::getType() const { return NAME; } + +bool AlwaysNeTnpointTnpointLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AlwaysNeTnpointTnpointLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction AlwaysNeTnpointTnpointLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(6); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "rid1 must be UINT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "pos1 must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "rid2 must be UINT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "pos2 must be FLOAT64"); + INVARIANT(c[5].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); + return withChildren(c); +} + +SerializableFunction AlwaysNeTnpointTnpointLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysNeTnpointTnpointLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 6, + "AlwaysNeTnpointTnpointLogicalFunction requires 6 children but got {}", + arguments.children.size()); + return AlwaysNeTnpointTnpointLogicalFunction(std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4]), + std::move(arguments.children[5])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt index 76816ac322..a45f610e8d 100644 --- a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt @@ -390,6 +390,11 @@ add_plugin(EverEqNpointTnpoint LogicalFunction nes-logical-operators EverEqNpoin add_plugin(AlwaysEqNpointTnpoint LogicalFunction nes-logical-operators AlwaysEqNpointTnpointLogicalFunction.cpp) add_plugin(EverNeNpointTnpoint LogicalFunction nes-logical-operators EverNeNpointTnpointLogicalFunction.cpp) add_plugin(AlwaysNeNpointTnpoint LogicalFunction nes-logical-operators AlwaysNeNpointTnpointLogicalFunction.cpp) +add_plugin(EverEqTnpointTnpoint LogicalFunction nes-logical-operators EverEqTnpointTnpointLogicalFunction.cpp) +add_plugin(AlwaysEqTnpointTnpoint LogicalFunction nes-logical-operators AlwaysEqTnpointTnpointLogicalFunction.cpp) +add_plugin(EverNeTnpointTnpoint LogicalFunction nes-logical-operators EverNeTnpointTnpointLogicalFunction.cpp) +add_plugin(AlwaysNeTnpointTnpoint LogicalFunction nes-logical-operators AlwaysNeTnpointTnpointLogicalFunction.cpp) +add_plugin(NadTnpointTnpoint LogicalFunction nes-logical-operators NadTnpointTnpointLogicalFunction.cpp) add_plugin(GeomIntersects2d LogicalFunction nes-logical-operators GeomIntersects2dLogicalFunction.cpp) add_plugin(GeomDwithin2d LogicalFunction nes-logical-operators GeomDwithin2dLogicalFunction.cpp) add_plugin(GeomContains LogicalFunction nes-logical-operators GeomContainsLogicalFunction.cpp) diff --git a/nes-logical-operators/src/Functions/Meos/EverEqTnpointTnpointLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverEqTnpointTnpointLogicalFunction.cpp new file mode 100644 index 0000000000..78af507a03 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverEqTnpointTnpointLogicalFunction.cpp @@ -0,0 +1,112 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EverEqTnpointTnpointLogicalFunction::EverEqTnpointTnpointLogicalFunction( + LogicalFunction rid1, LogicalFunction pos1, LogicalFunction ts1, + LogicalFunction rid2, LogicalFunction pos2, LogicalFunction ts2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(6); + parameters.push_back(std::move(rid1)); + parameters.push_back(std::move(pos1)); + parameters.push_back(std::move(ts1)); + parameters.push_back(std::move(rid2)); + parameters.push_back(std::move(pos2)); + parameters.push_back(std::move(ts2)); +} + +DataType EverEqTnpointTnpointLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverEqTnpointTnpointLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EverEqTnpointTnpointLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverEqTnpointTnpointLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 6, + "EverEqTnpointTnpointLogicalFunction requires 6 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EverEqTnpointTnpointLogicalFunction::getType() const { return NAME; } + +bool EverEqTnpointTnpointLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EverEqTnpointTnpointLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction EverEqTnpointTnpointLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(6); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "rid1 must be UINT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "pos1 must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "rid2 must be UINT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "pos2 must be FLOAT64"); + INVARIANT(c[5].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); + return withChildren(c); +} + +SerializableFunction EverEqTnpointTnpointLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverEqTnpointTnpointLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 6, + "EverEqTnpointTnpointLogicalFunction requires 6 children but got {}", + arguments.children.size()); + return EverEqTnpointTnpointLogicalFunction(std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4]), + std::move(arguments.children[5])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverNeTnpointTnpointLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverNeTnpointTnpointLogicalFunction.cpp new file mode 100644 index 0000000000..74c753b89c --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverNeTnpointTnpointLogicalFunction.cpp @@ -0,0 +1,112 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EverNeTnpointTnpointLogicalFunction::EverNeTnpointTnpointLogicalFunction( + LogicalFunction rid1, LogicalFunction pos1, LogicalFunction ts1, + LogicalFunction rid2, LogicalFunction pos2, LogicalFunction ts2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(6); + parameters.push_back(std::move(rid1)); + parameters.push_back(std::move(pos1)); + parameters.push_back(std::move(ts1)); + parameters.push_back(std::move(rid2)); + parameters.push_back(std::move(pos2)); + parameters.push_back(std::move(ts2)); +} + +DataType EverNeTnpointTnpointLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverNeTnpointTnpointLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EverNeTnpointTnpointLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverNeTnpointTnpointLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 6, + "EverNeTnpointTnpointLogicalFunction requires 6 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EverNeTnpointTnpointLogicalFunction::getType() const { return NAME; } + +bool EverNeTnpointTnpointLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EverNeTnpointTnpointLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction EverNeTnpointTnpointLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(6); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "rid1 must be UINT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "pos1 must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "rid2 must be UINT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "pos2 must be FLOAT64"); + INVARIANT(c[5].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); + return withChildren(c); +} + +SerializableFunction EverNeTnpointTnpointLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverNeTnpointTnpointLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 6, + "EverNeTnpointTnpointLogicalFunction requires 6 children but got {}", + arguments.children.size()); + return EverNeTnpointTnpointLogicalFunction(std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4]), + std::move(arguments.children[5])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/NadTnpointTnpointLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/NadTnpointTnpointLogicalFunction.cpp new file mode 100644 index 0000000000..64a45be719 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/NadTnpointTnpointLogicalFunction.cpp @@ -0,0 +1,112 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +NadTnpointTnpointLogicalFunction::NadTnpointTnpointLogicalFunction( + LogicalFunction rid1, LogicalFunction pos1, LogicalFunction ts1, + LogicalFunction rid2, LogicalFunction pos2, LogicalFunction ts2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(6); + parameters.push_back(std::move(rid1)); + parameters.push_back(std::move(pos1)); + parameters.push_back(std::move(ts1)); + parameters.push_back(std::move(rid2)); + parameters.push_back(std::move(pos2)); + parameters.push_back(std::move(ts2)); +} + +DataType NadTnpointTnpointLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction NadTnpointTnpointLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector NadTnpointTnpointLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction NadTnpointTnpointLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 6, + "NadTnpointTnpointLogicalFunction requires 6 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view NadTnpointTnpointLogicalFunction::getType() const { return NAME; } + +bool NadTnpointTnpointLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string NadTnpointTnpointLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction NadTnpointTnpointLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(6); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "rid1 must be UINT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "pos1 must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "rid2 must be UINT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "pos2 must be FLOAT64"); + INVARIANT(c[5].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); + return withChildren(c); +} + +SerializableFunction NadTnpointTnpointLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterNadTnpointTnpointLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 6, + "NadTnpointTnpointLogicalFunction requires 6 children but got {}", + arguments.children.size()); + return NadTnpointTnpointLogicalFunction(std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4]), + std::move(arguments.children[5])); +} + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysEqTnpointTnpointPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysEqTnpointTnpointPhysicalFunction.hpp new file mode 100644 index 0000000000..550ab6cd9a --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysEqTnpointTnpointPhysicalFunction.hpp @@ -0,0 +1,33 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class AlwaysEqTnpointTnpointPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysEqTnpointTnpointPhysicalFunction(PhysicalFunction rid1, PhysicalFunction pos1, PhysicalFunction ts1, + PhysicalFunction rid2, PhysicalFunction pos2, PhysicalFunction ts2); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysNeTnpointTnpointPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysNeTnpointTnpointPhysicalFunction.hpp new file mode 100644 index 0000000000..f06db451c4 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysNeTnpointTnpointPhysicalFunction.hpp @@ -0,0 +1,33 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class AlwaysNeTnpointTnpointPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysNeTnpointTnpointPhysicalFunction(PhysicalFunction rid1, PhysicalFunction pos1, PhysicalFunction ts1, + PhysicalFunction rid2, PhysicalFunction pos2, PhysicalFunction ts2); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverEqTnpointTnpointPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverEqTnpointTnpointPhysicalFunction.hpp new file mode 100644 index 0000000000..d4bca5295e --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverEqTnpointTnpointPhysicalFunction.hpp @@ -0,0 +1,33 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class EverEqTnpointTnpointPhysicalFunction : public PhysicalFunctionConcept { +public: + EverEqTnpointTnpointPhysicalFunction(PhysicalFunction rid1, PhysicalFunction pos1, PhysicalFunction ts1, + PhysicalFunction rid2, PhysicalFunction pos2, PhysicalFunction ts2); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverNeTnpointTnpointPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverNeTnpointTnpointPhysicalFunction.hpp new file mode 100644 index 0000000000..3647332d45 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverNeTnpointTnpointPhysicalFunction.hpp @@ -0,0 +1,33 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class EverNeTnpointTnpointPhysicalFunction : public PhysicalFunctionConcept { +public: + EverNeTnpointTnpointPhysicalFunction(PhysicalFunction rid1, PhysicalFunction pos1, PhysicalFunction ts1, + PhysicalFunction rid2, PhysicalFunction pos2, PhysicalFunction ts2); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/NadTnpointTnpointPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/NadTnpointTnpointPhysicalFunction.hpp new file mode 100644 index 0000000000..d6819b22ef --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/NadTnpointTnpointPhysicalFunction.hpp @@ -0,0 +1,33 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class NadTnpointTnpointPhysicalFunction : public PhysicalFunctionConcept { +public: + NadTnpointTnpointPhysicalFunction(PhysicalFunction rid1, PhysicalFunction pos1, PhysicalFunction ts1, + PhysicalFunction rid2, PhysicalFunction pos2, PhysicalFunction ts2); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysEqTnpointTnpointPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysEqTnpointTnpointPhysicalFunction.cpp new file mode 100644 index 0000000000..3f5955d6b2 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysEqTnpointTnpointPhysicalFunction.cpp @@ -0,0 +1,96 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +AlwaysEqTnpointTnpointPhysicalFunction::AlwaysEqTnpointTnpointPhysicalFunction( + PhysicalFunction rid1, PhysicalFunction pos1, PhysicalFunction ts1, + PhysicalFunction rid2, PhysicalFunction pos2, PhysicalFunction ts2) +{ + paramFns.reserve(6); + paramFns.push_back(std::move(rid1)); + paramFns.push_back(std::move(pos1)); + paramFns.push_back(std::move(ts1)); + paramFns.push_back(std::move(rid2)); + paramFns.push_back(std::move(pos2)); + paramFns.push_back(std::move(ts2)); +} + +VarVal AlwaysEqTnpointTnpointPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto rid1 = paramFns[0].execute(record, arena).cast(); + auto pos1 = paramFns[1].execute(record, arena).cast(); + auto ts1 = paramFns[2].execute(record, arena).cast(); + auto rid2 = paramFns[3].execute(record, arena).cast(); + auto pos2 = paramFns[4].execute(record, arena).cast(); + auto ts2 = paramFns[5].execute(record, arena).cast(); + + const auto result = nautilus::invoke( + +[](uint64_t rid1, double pos1, uint64_t ts1, + uint64_t rid2, double pos2, uint64_t ts2) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + Npoint* np1 = npoint_make((int64_t)rid1, pos1); + if (!np1) return 0.0; + Temporal* inst1 = (Temporal*)tnpointinst_make(np1, (TimestampTz)ts1); + free(np1); + if (!inst1) return 0.0; + Npoint* np2 = npoint_make((int64_t)rid2, pos2); + if (!np2) { free(inst1); return 0.0; } + Temporal* inst2 = (Temporal*)tnpointinst_make(np2, (TimestampTz)ts2); + free(np2); + if (!inst2) { free(inst1); return 0.0; } + int r = always_eq_tnpoint_tnpoint(inst1, inst2); + free(inst1); free(inst2); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + rid1, pos1, ts1, rid2, pos2, ts2); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysEqTnpointTnpointPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 6, + "AlwaysEqTnpointTnpointPhysicalFunction requires 6 children but got {}", + arguments.childFunctions.size()); + return AlwaysEqTnpointTnpointPhysicalFunction(std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4]), + std::move(arguments.childFunctions[5])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysNeTnpointTnpointPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysNeTnpointTnpointPhysicalFunction.cpp new file mode 100644 index 0000000000..1ee5511def --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysNeTnpointTnpointPhysicalFunction.cpp @@ -0,0 +1,96 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +AlwaysNeTnpointTnpointPhysicalFunction::AlwaysNeTnpointTnpointPhysicalFunction( + PhysicalFunction rid1, PhysicalFunction pos1, PhysicalFunction ts1, + PhysicalFunction rid2, PhysicalFunction pos2, PhysicalFunction ts2) +{ + paramFns.reserve(6); + paramFns.push_back(std::move(rid1)); + paramFns.push_back(std::move(pos1)); + paramFns.push_back(std::move(ts1)); + paramFns.push_back(std::move(rid2)); + paramFns.push_back(std::move(pos2)); + paramFns.push_back(std::move(ts2)); +} + +VarVal AlwaysNeTnpointTnpointPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto rid1 = paramFns[0].execute(record, arena).cast(); + auto pos1 = paramFns[1].execute(record, arena).cast(); + auto ts1 = paramFns[2].execute(record, arena).cast(); + auto rid2 = paramFns[3].execute(record, arena).cast(); + auto pos2 = paramFns[4].execute(record, arena).cast(); + auto ts2 = paramFns[5].execute(record, arena).cast(); + + const auto result = nautilus::invoke( + +[](uint64_t rid1, double pos1, uint64_t ts1, + uint64_t rid2, double pos2, uint64_t ts2) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + Npoint* np1 = npoint_make((int64_t)rid1, pos1); + if (!np1) return 0.0; + Temporal* inst1 = (Temporal*)tnpointinst_make(np1, (TimestampTz)ts1); + free(np1); + if (!inst1) return 0.0; + Npoint* np2 = npoint_make((int64_t)rid2, pos2); + if (!np2) { free(inst1); return 0.0; } + Temporal* inst2 = (Temporal*)tnpointinst_make(np2, (TimestampTz)ts2); + free(np2); + if (!inst2) { free(inst1); return 0.0; } + int r = always_ne_tnpoint_tnpoint(inst1, inst2); + free(inst1); free(inst2); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + rid1, pos1, ts1, rid2, pos2, ts2); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysNeTnpointTnpointPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 6, + "AlwaysNeTnpointTnpointPhysicalFunction requires 6 children but got {}", + arguments.childFunctions.size()); + return AlwaysNeTnpointTnpointPhysicalFunction(std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4]), + std::move(arguments.childFunctions[5])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt index 9f072bfa7b..71b501da60 100644 --- a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt @@ -389,6 +389,11 @@ add_plugin(EverEqNpointTnpoint PhysicalFunction nes-physical-operators EverEqNpo add_plugin(AlwaysEqNpointTnpoint PhysicalFunction nes-physical-operators AlwaysEqNpointTnpointPhysicalFunction.cpp) add_plugin(EverNeNpointTnpoint PhysicalFunction nes-physical-operators EverNeNpointTnpointPhysicalFunction.cpp) add_plugin(AlwaysNeNpointTnpoint PhysicalFunction nes-physical-operators AlwaysNeNpointTnpointPhysicalFunction.cpp) +add_plugin(EverEqTnpointTnpoint PhysicalFunction nes-physical-operators EverEqTnpointTnpointPhysicalFunction.cpp) +add_plugin(AlwaysEqTnpointTnpoint PhysicalFunction nes-physical-operators AlwaysEqTnpointTnpointPhysicalFunction.cpp) +add_plugin(EverNeTnpointTnpoint PhysicalFunction nes-physical-operators EverNeTnpointTnpointPhysicalFunction.cpp) +add_plugin(AlwaysNeTnpointTnpoint PhysicalFunction nes-physical-operators AlwaysNeTnpointTnpointPhysicalFunction.cpp) +add_plugin(NadTnpointTnpoint PhysicalFunction nes-physical-operators NadTnpointTnpointPhysicalFunction.cpp) add_plugin(GeomIntersects2d PhysicalFunction nes-physical-operators GeomIntersects2dPhysicalFunction.cpp) add_plugin(GeomDwithin2d PhysicalFunction nes-physical-operators GeomDwithin2dPhysicalFunction.cpp) add_plugin(GeomContains PhysicalFunction nes-physical-operators GeomContainsPhysicalFunction.cpp) diff --git a/nes-physical-operators/src/Functions/Meos/EverEqTnpointTnpointPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverEqTnpointTnpointPhysicalFunction.cpp new file mode 100644 index 0000000000..438f74a8b6 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverEqTnpointTnpointPhysicalFunction.cpp @@ -0,0 +1,96 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +EverEqTnpointTnpointPhysicalFunction::EverEqTnpointTnpointPhysicalFunction( + PhysicalFunction rid1, PhysicalFunction pos1, PhysicalFunction ts1, + PhysicalFunction rid2, PhysicalFunction pos2, PhysicalFunction ts2) +{ + paramFns.reserve(6); + paramFns.push_back(std::move(rid1)); + paramFns.push_back(std::move(pos1)); + paramFns.push_back(std::move(ts1)); + paramFns.push_back(std::move(rid2)); + paramFns.push_back(std::move(pos2)); + paramFns.push_back(std::move(ts2)); +} + +VarVal EverEqTnpointTnpointPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto rid1 = paramFns[0].execute(record, arena).cast(); + auto pos1 = paramFns[1].execute(record, arena).cast(); + auto ts1 = paramFns[2].execute(record, arena).cast(); + auto rid2 = paramFns[3].execute(record, arena).cast(); + auto pos2 = paramFns[4].execute(record, arena).cast(); + auto ts2 = paramFns[5].execute(record, arena).cast(); + + const auto result = nautilus::invoke( + +[](uint64_t rid1, double pos1, uint64_t ts1, + uint64_t rid2, double pos2, uint64_t ts2) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + Npoint* np1 = npoint_make((int64_t)rid1, pos1); + if (!np1) return 0.0; + Temporal* inst1 = (Temporal*)tnpointinst_make(np1, (TimestampTz)ts1); + free(np1); + if (!inst1) return 0.0; + Npoint* np2 = npoint_make((int64_t)rid2, pos2); + if (!np2) { free(inst1); return 0.0; } + Temporal* inst2 = (Temporal*)tnpointinst_make(np2, (TimestampTz)ts2); + free(np2); + if (!inst2) { free(inst1); return 0.0; } + int r = ever_eq_tnpoint_tnpoint(inst1, inst2); + free(inst1); free(inst2); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + rid1, pos1, ts1, rid2, pos2, ts2); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverEqTnpointTnpointPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 6, + "EverEqTnpointTnpointPhysicalFunction requires 6 children but got {}", + arguments.childFunctions.size()); + return EverEqTnpointTnpointPhysicalFunction(std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4]), + std::move(arguments.childFunctions[5])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverNeTnpointTnpointPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverNeTnpointTnpointPhysicalFunction.cpp new file mode 100644 index 0000000000..96cde58e77 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverNeTnpointTnpointPhysicalFunction.cpp @@ -0,0 +1,96 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +EverNeTnpointTnpointPhysicalFunction::EverNeTnpointTnpointPhysicalFunction( + PhysicalFunction rid1, PhysicalFunction pos1, PhysicalFunction ts1, + PhysicalFunction rid2, PhysicalFunction pos2, PhysicalFunction ts2) +{ + paramFns.reserve(6); + paramFns.push_back(std::move(rid1)); + paramFns.push_back(std::move(pos1)); + paramFns.push_back(std::move(ts1)); + paramFns.push_back(std::move(rid2)); + paramFns.push_back(std::move(pos2)); + paramFns.push_back(std::move(ts2)); +} + +VarVal EverNeTnpointTnpointPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto rid1 = paramFns[0].execute(record, arena).cast(); + auto pos1 = paramFns[1].execute(record, arena).cast(); + auto ts1 = paramFns[2].execute(record, arena).cast(); + auto rid2 = paramFns[3].execute(record, arena).cast(); + auto pos2 = paramFns[4].execute(record, arena).cast(); + auto ts2 = paramFns[5].execute(record, arena).cast(); + + const auto result = nautilus::invoke( + +[](uint64_t rid1, double pos1, uint64_t ts1, + uint64_t rid2, double pos2, uint64_t ts2) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + Npoint* np1 = npoint_make((int64_t)rid1, pos1); + if (!np1) return 0.0; + Temporal* inst1 = (Temporal*)tnpointinst_make(np1, (TimestampTz)ts1); + free(np1); + if (!inst1) return 0.0; + Npoint* np2 = npoint_make((int64_t)rid2, pos2); + if (!np2) { free(inst1); return 0.0; } + Temporal* inst2 = (Temporal*)tnpointinst_make(np2, (TimestampTz)ts2); + free(np2); + if (!inst2) { free(inst1); return 0.0; } + int r = ever_ne_tnpoint_tnpoint(inst1, inst2); + free(inst1); free(inst2); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + rid1, pos1, ts1, rid2, pos2, ts2); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverNeTnpointTnpointPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 6, + "EverNeTnpointTnpointPhysicalFunction requires 6 children but got {}", + arguments.childFunctions.size()); + return EverNeTnpointTnpointPhysicalFunction(std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4]), + std::move(arguments.childFunctions[5])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/NadTnpointTnpointPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/NadTnpointTnpointPhysicalFunction.cpp new file mode 100644 index 0000000000..b126f6b1bf --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/NadTnpointTnpointPhysicalFunction.cpp @@ -0,0 +1,96 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +NadTnpointTnpointPhysicalFunction::NadTnpointTnpointPhysicalFunction( + PhysicalFunction rid1, PhysicalFunction pos1, PhysicalFunction ts1, + PhysicalFunction rid2, PhysicalFunction pos2, PhysicalFunction ts2) +{ + paramFns.reserve(6); + paramFns.push_back(std::move(rid1)); + paramFns.push_back(std::move(pos1)); + paramFns.push_back(std::move(ts1)); + paramFns.push_back(std::move(rid2)); + paramFns.push_back(std::move(pos2)); + paramFns.push_back(std::move(ts2)); +} + +VarVal NadTnpointTnpointPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto rid1 = paramFns[0].execute(record, arena).cast(); + auto pos1 = paramFns[1].execute(record, arena).cast(); + auto ts1 = paramFns[2].execute(record, arena).cast(); + auto rid2 = paramFns[3].execute(record, arena).cast(); + auto pos2 = paramFns[4].execute(record, arena).cast(); + auto ts2 = paramFns[5].execute(record, arena).cast(); + + const auto result = nautilus::invoke( + +[](uint64_t rid1, double pos1, uint64_t ts1, + uint64_t rid2, double pos2, uint64_t ts2) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + Npoint* np1 = npoint_make((int64_t)rid1, pos1); + if (!np1) return 0.0; + Temporal* inst1 = (Temporal*)tnpointinst_make(np1, (TimestampTz)ts1); + free(np1); + if (!inst1) return 0.0; + Npoint* np2 = npoint_make((int64_t)rid2, pos2); + if (!np2) { free(inst1); return 0.0; } + Temporal* inst2 = (Temporal*)tnpointinst_make(np2, (TimestampTz)ts2); + free(np2); + if (!inst2) { free(inst1); return 0.0; } + double r = nad_tnpoint_tnpoint(inst1, inst2); + free(inst1); free(inst2); + return r; + } catch (const std::exception&) { return -1.0; } + }, + rid1, pos1, ts1, rid2, pos2, ts2); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterNadTnpointTnpointPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 6, + "NadTnpointTnpointPhysicalFunction requires 6 children but got {}", + arguments.childFunctions.size()); + return NadTnpointTnpointPhysicalFunction(std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4]), + std::move(arguments.childFunctions[5])); +} + +} // namespace NES diff --git a/nes-sql-parser/AntlrSQL.g4 b/nes-sql-parser/AntlrSQL.g4 index 368afd38f5..e7d8aabfd5 100644 --- a/nes-sql-parser/AntlrSQL.g4 +++ b/nes-sql-parser/AntlrSQL.g4 @@ -295,7 +295,7 @@ timeUnit: MS timestampParameter: name=identifier; -functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT | TGE_TTEXT_TEXT | TGE_TEXT_TTEXT | TGT_TTEXT_TEXT | TGT_TEXT_TTEXT | TLE_TTEXT_TEXT | TLE_TEXT_TTEXT | TLT_TTEXT_TEXT | TLT_TEXT_TTEXT | TTEXT_UPPER | TTEXT_LOWER | TTEXT_INITCAP | TEXTCAT_TTEXT_TEXT | TEXTCAT_TEXT_TTEXT | TEXTCAT_TTEXT_TTEXT | GEOM_LENGTH | GEOM_PERIMETER | GEOM_AZIMUTH | GEOG_AREA | GEOG_LENGTH | GEOG_PERIMETER | GEOM_IS_EMPTY | AINTERSECTS_TGEO_GEO | ACOVERS_TGEO_GEO | ADISJOINT_TGEO_GEO | ADWITHIN_TGEO_GEO | EINTERSECTS_TGEO_GEO | ETOUCHES_TGEO_GEO | ECONTAINS_TGEO_GEO | ACONTAINS_TGEO_GEO | ATOUCHES_TGEO_GEO | GEO_NUM_POINTS | GEO_NUM_GEOS | GEO_SRID | GEO_IS_UNITARY | GEO_EQUALS | GEO_SAME | GEOG_DISTANCE | NAD_TGEO_GEO | EVER_EQ_TGEO_GEO | EVER_NE_TGEO_GEO | ALWAYS_EQ_TGEO_GEO | ALWAYS_NE_TGEO_GEO | GEOG_INTERSECTS | GEOG_DWITHIN | ACOVERS_GEO_TGEO | GEOM_INTERSECTS | GEOM_DWITHIN | H3_GS_POINT_TO_CELL | EVER_EQ_TH3INDEX_H3INDEX | EVER_NE_TH3INDEX_H3INDEX | ALWAYS_EQ_TH3INDEX_H3INDEX | ALWAYS_NE_TH3INDEX_H3INDEX | TH3INDEX_GET_RESOLUTION | TH3INDEX_GET_BASE_CELL_NUMBER | TH3INDEX_IS_VALID_CELL | TH3INDEX_IS_PENTAGON | TH3INDEX_CELL_TO_PARENT_NEXT | TH3INDEX_CELL_TO_CENTER_CHILD_NEXT | TH3INDEX_CELL_TO_PARENT | TH3INDEX_CELL_TO_CENTER_CHILD | TH3INDEX_CELL_TO_CHILD_POS | TH3INDEX_ARE_NEIGHBOR_CELLS | TH3INDEX_GRID_DISTANCE | EINTERSECTS_TCBUFFER_GEO | AINTERSECTS_TCBUFFER_GEO | ECOVERS_TCBUFFER_GEO | ACOVERS_TCBUFFER_GEO | EDISJOINT_TCBUFFER_GEO | ADISJOINT_TCBUFFER_GEO | ETOUCHES_TCBUFFER_GEO | ATOUCHES_TCBUFFER_GEO | ECONTAINS_TCBUFFER_GEO | ACONTAINS_TCBUFFER_GEO | NAD_TCBUFFER_GEO | EDWITHIN_TCBUFFER_GEO | ADWITHIN_TCBUFFER_GEO | EINTERSECTS_TCBUFFER_CBUFFER | AINTERSECTS_TCBUFFER_CBUFFER | ECOVERS_TCBUFFER_CBUFFER | ACOVERS_TCBUFFER_CBUFFER | EDISJOINT_TCBUFFER_CBUFFER | ADISJOINT_TCBUFFER_CBUFFER | ETOUCHES_TCBUFFER_CBUFFER | ATOUCHES_TCBUFFER_CBUFFER | ECONTAINS_TCBUFFER_CBUFFER | ACONTAINS_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_CBUFFER | ALWAYS_EQ_TCBUFFER_CBUFFER | EVER_NE_TCBUFFER_CBUFFER | ALWAYS_NE_TCBUFFER_CBUFFER | NAD_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_TCBUFFER | ALWAYS_EQ_TCBUFFER_TCBUFFER | EVER_NE_TCBUFFER_TCBUFFER | ALWAYS_NE_TCBUFFER_TCBUFFER | EINTERSECTS_TCBUFFER_TCBUFFER | AINTERSECTS_TCBUFFER_TCBUFFER | ECOVERS_TCBUFFER_TCBUFFER | ACOVERS_TCBUFFER_TCBUFFER | ADISJOINT_TCBUFFER_TCBUFFER | ETOUCHES_TCBUFFER_TCBUFFER | ATOUCHES_TCBUFFER_TCBUFFER | NAD_TCBUFFER_TCBUFFER | EDWITHIN_TCBUFFER_TCBUFFER | ADWITHIN_TCBUFFER_TCBUFFER | MINDISTANCE_TCBUFFER_TCBUFFER | NAD_TNPOINT_GEO | EVER_EQ_TNPOINT_NPOINT | ALWAYS_EQ_TNPOINT_NPOINT | EVER_NE_TNPOINT_NPOINT | ALWAYS_NE_TNPOINT_NPOINT | NAD_TNPOINT_NPOINT | EVER_EQ_NPOINT_TNPOINT | ALWAYS_EQ_NPOINT_TNPOINT | EVER_NE_NPOINT_TNPOINT | ALWAYS_NE_NPOINT_TNPOINT | GEOM_INTERSECTS2D | GEOM_DWITHIN2D | GEOM_CONTAINS | GEOM_DISJOINT2D | GEOM_COVERS | GEOM_TOUCHES | GEOM_INTERSECTS3D | GEOM_DWITHIN3D | GEOM_DISTANCE2D | GEOM_DISTANCE3D; +functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT | TGE_TTEXT_TEXT | TGE_TEXT_TTEXT | TGT_TTEXT_TEXT | TGT_TEXT_TTEXT | TLE_TTEXT_TEXT | TLE_TEXT_TTEXT | TLT_TTEXT_TEXT | TLT_TEXT_TTEXT | TTEXT_UPPER | TTEXT_LOWER | TTEXT_INITCAP | TEXTCAT_TTEXT_TEXT | TEXTCAT_TEXT_TTEXT | TEXTCAT_TTEXT_TTEXT | GEOM_LENGTH | GEOM_PERIMETER | GEOM_AZIMUTH | GEOG_AREA | GEOG_LENGTH | GEOG_PERIMETER | GEOM_IS_EMPTY | AINTERSECTS_TGEO_GEO | ACOVERS_TGEO_GEO | ADISJOINT_TGEO_GEO | ADWITHIN_TGEO_GEO | EINTERSECTS_TGEO_GEO | ETOUCHES_TGEO_GEO | ECONTAINS_TGEO_GEO | ACONTAINS_TGEO_GEO | ATOUCHES_TGEO_GEO | GEO_NUM_POINTS | GEO_NUM_GEOS | GEO_SRID | GEO_IS_UNITARY | GEO_EQUALS | GEO_SAME | GEOG_DISTANCE | NAD_TGEO_GEO | EVER_EQ_TGEO_GEO | EVER_NE_TGEO_GEO | ALWAYS_EQ_TGEO_GEO | ALWAYS_NE_TGEO_GEO | GEOG_INTERSECTS | GEOG_DWITHIN | ACOVERS_GEO_TGEO | GEOM_INTERSECTS | GEOM_DWITHIN | H3_GS_POINT_TO_CELL | EVER_EQ_TH3INDEX_H3INDEX | EVER_NE_TH3INDEX_H3INDEX | ALWAYS_EQ_TH3INDEX_H3INDEX | ALWAYS_NE_TH3INDEX_H3INDEX | TH3INDEX_GET_RESOLUTION | TH3INDEX_GET_BASE_CELL_NUMBER | TH3INDEX_IS_VALID_CELL | TH3INDEX_IS_PENTAGON | TH3INDEX_CELL_TO_PARENT_NEXT | TH3INDEX_CELL_TO_CENTER_CHILD_NEXT | TH3INDEX_CELL_TO_PARENT | TH3INDEX_CELL_TO_CENTER_CHILD | TH3INDEX_CELL_TO_CHILD_POS | TH3INDEX_ARE_NEIGHBOR_CELLS | TH3INDEX_GRID_DISTANCE | EINTERSECTS_TCBUFFER_GEO | AINTERSECTS_TCBUFFER_GEO | ECOVERS_TCBUFFER_GEO | ACOVERS_TCBUFFER_GEO | EDISJOINT_TCBUFFER_GEO | ADISJOINT_TCBUFFER_GEO | ETOUCHES_TCBUFFER_GEO | ATOUCHES_TCBUFFER_GEO | ECONTAINS_TCBUFFER_GEO | ACONTAINS_TCBUFFER_GEO | NAD_TCBUFFER_GEO | EDWITHIN_TCBUFFER_GEO | ADWITHIN_TCBUFFER_GEO | EINTERSECTS_TCBUFFER_CBUFFER | AINTERSECTS_TCBUFFER_CBUFFER | ECOVERS_TCBUFFER_CBUFFER | ACOVERS_TCBUFFER_CBUFFER | EDISJOINT_TCBUFFER_CBUFFER | ADISJOINT_TCBUFFER_CBUFFER | ETOUCHES_TCBUFFER_CBUFFER | ATOUCHES_TCBUFFER_CBUFFER | ECONTAINS_TCBUFFER_CBUFFER | ACONTAINS_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_CBUFFER | ALWAYS_EQ_TCBUFFER_CBUFFER | EVER_NE_TCBUFFER_CBUFFER | ALWAYS_NE_TCBUFFER_CBUFFER | NAD_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_TCBUFFER | ALWAYS_EQ_TCBUFFER_TCBUFFER | EVER_NE_TCBUFFER_TCBUFFER | ALWAYS_NE_TCBUFFER_TCBUFFER | EINTERSECTS_TCBUFFER_TCBUFFER | AINTERSECTS_TCBUFFER_TCBUFFER | ECOVERS_TCBUFFER_TCBUFFER | ACOVERS_TCBUFFER_TCBUFFER | ADISJOINT_TCBUFFER_TCBUFFER | ETOUCHES_TCBUFFER_TCBUFFER | ATOUCHES_TCBUFFER_TCBUFFER | NAD_TCBUFFER_TCBUFFER | EDWITHIN_TCBUFFER_TCBUFFER | ADWITHIN_TCBUFFER_TCBUFFER | MINDISTANCE_TCBUFFER_TCBUFFER | NAD_TNPOINT_GEO | EVER_EQ_TNPOINT_NPOINT | ALWAYS_EQ_TNPOINT_NPOINT | EVER_NE_TNPOINT_NPOINT | ALWAYS_NE_TNPOINT_NPOINT | NAD_TNPOINT_NPOINT | EVER_EQ_NPOINT_TNPOINT | ALWAYS_EQ_NPOINT_TNPOINT | EVER_NE_NPOINT_TNPOINT | ALWAYS_NE_NPOINT_TNPOINT | EVER_EQ_TNPOINT_TNPOINT | ALWAYS_EQ_TNPOINT_TNPOINT | EVER_NE_TNPOINT_TNPOINT | ALWAYS_NE_TNPOINT_TNPOINT | NAD_TNPOINT_TNPOINT | GEOM_INTERSECTS2D | GEOM_DWITHIN2D | GEOM_CONTAINS | GEOM_DISJOINT2D | GEOM_COVERS | GEOM_TOUCHES | GEOM_INTERSECTS3D | GEOM_DWITHIN3D | GEOM_DISTANCE2D | GEOM_DISTANCE3D; sinkClause: INTO sink (',' sink)*; @@ -860,6 +860,11 @@ EVER_EQ_NPOINT_TNPOINT: 'EVER_EQ_NPOINT_TNPOINT' | 'ever_eq_npoint_tnpoint'; ALWAYS_EQ_NPOINT_TNPOINT: 'ALWAYS_EQ_NPOINT_TNPOINT' | 'always_eq_npoint_tnpoint'; EVER_NE_NPOINT_TNPOINT: 'EVER_NE_NPOINT_TNPOINT' | 'ever_ne_npoint_tnpoint'; ALWAYS_NE_NPOINT_TNPOINT: 'ALWAYS_NE_NPOINT_TNPOINT' | 'always_ne_npoint_tnpoint'; +EVER_EQ_TNPOINT_TNPOINT: 'EVER_EQ_TNPOINT_TNPOINT' | 'ever_eq_tnpoint_tnpoint'; +ALWAYS_EQ_TNPOINT_TNPOINT: 'ALWAYS_EQ_TNPOINT_TNPOINT' | 'always_eq_tnpoint_tnpoint'; +EVER_NE_TNPOINT_TNPOINT: 'EVER_NE_TNPOINT_TNPOINT' | 'ever_ne_tnpoint_tnpoint'; +ALWAYS_NE_TNPOINT_TNPOINT: 'ALWAYS_NE_TNPOINT_TNPOINT' | 'always_ne_tnpoint_tnpoint'; +NAD_TNPOINT_TNPOINT: 'NAD_TNPOINT_TNPOINT' | 'nad_tnpoint_tnpoint'; GEOM_INTERSECTS2D: 'GEOM_INTERSECTS2D' | 'geom_intersects2d'; GEOM_DWITHIN2D: 'GEOM_DWITHIN2D' | 'geom_dwithin2d'; GEOM_CONTAINS: 'GEOM_CONTAINS' | 'geom_contains'; diff --git a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp index fbe706f10c..94f98122e2 100644 --- a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp +++ b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp @@ -441,6 +441,11 @@ #include #include #include +#include +#include +#include +#include +#include #include #include #include @@ -10062,6 +10067,71 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont return LogicalFunction(AlwaysNeNpointTnpointLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4))); } /* END CODEGEN PARSER GLUE: ALWAYS_NE_NPOINT_TNPOINT */ + case AntlrSQLParser::EVER_EQ_TNPOINT_TNPOINT: { + PRECONDITION(ctx->functionParam().size() == 6, + "EverEqTnpointTnpoint requires 6 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + auto arg5 = visit(ctx->functionParam(5)).as(); + return LogicalFunction(EverEqTnpointTnpointLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5))); + } + /* END CODEGEN PARSER GLUE: EVER_EQ_TNPOINT_TNPOINT */ + case AntlrSQLParser::ALWAYS_EQ_TNPOINT_TNPOINT: { + PRECONDITION(ctx->functionParam().size() == 6, + "AlwaysEqTnpointTnpoint requires 6 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + auto arg5 = visit(ctx->functionParam(5)).as(); + return LogicalFunction(AlwaysEqTnpointTnpointLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5))); + } + /* END CODEGEN PARSER GLUE: ALWAYS_EQ_TNPOINT_TNPOINT */ + case AntlrSQLParser::EVER_NE_TNPOINT_TNPOINT: { + PRECONDITION(ctx->functionParam().size() == 6, + "EverNeTnpointTnpoint requires 6 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + auto arg5 = visit(ctx->functionParam(5)).as(); + return LogicalFunction(EverNeTnpointTnpointLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5))); + } + /* END CODEGEN PARSER GLUE: EVER_NE_TNPOINT_TNPOINT */ + case AntlrSQLParser::ALWAYS_NE_TNPOINT_TNPOINT: { + PRECONDITION(ctx->functionParam().size() == 6, + "AlwaysNeTnpointTnpoint requires 6 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + auto arg5 = visit(ctx->functionParam(5)).as(); + return LogicalFunction(AlwaysNeTnpointTnpointLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5))); + } + /* END CODEGEN PARSER GLUE: ALWAYS_NE_TNPOINT_TNPOINT */ + case AntlrSQLParser::NAD_TNPOINT_TNPOINT: { + PRECONDITION(ctx->functionParam().size() == 6, + "NadTnpointTnpoint requires 6 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + auto arg5 = visit(ctx->functionParam(5)).as(); + return LogicalFunction(NadTnpointTnpointLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5))); + } + /* END CODEGEN PARSER GLUE: NAD_TNPOINT_TNPOINT */ /* END CODEGEN PARSER GLUE: GEOM_INTERSECTS2D */ case AntlrSQLParser::GEOM_DWITHIN2D: { PRECONDITION(ctx->functionParam().size() == 3, From 8805624cc0fd4693f9f05b0a3599f8adc79436d1 Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Mon, 15 Jun 2026 08:57:46 +0200 Subject: [PATCH 68/96] feat(meos): add tpose 2D per-event scalar operators for geo and pose (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. --- .../Meos/AlwaysEqPoseTposeLogicalFunction.hpp | 48 ++++++ .../Meos/AlwaysEqTposePoseLogicalFunction.hpp | 48 ++++++ .../Meos/AlwaysNePoseTposeLogicalFunction.hpp | 48 ++++++ .../Meos/AlwaysNeTposePoseLogicalFunction.hpp | 48 ++++++ .../Meos/EverEqPoseTposeLogicalFunction.hpp | 48 ++++++ .../Meos/EverEqTposePoseLogicalFunction.hpp | 48 ++++++ .../Meos/EverNePoseTposeLogicalFunction.hpp | 48 ++++++ .../Meos/EverNeTposePoseLogicalFunction.hpp | 48 ++++++ .../Meos/NadTposeGeoLogicalFunction.hpp | 48 ++++++ .../Meos/NadTposePoseLogicalFunction.hpp | 48 ++++++ .../Meos/AlwaysEqPoseTposeLogicalFunction.cpp | 114 ++++++++++++++ .../Meos/AlwaysEqTposePoseLogicalFunction.cpp | 114 ++++++++++++++ .../Meos/AlwaysNePoseTposeLogicalFunction.cpp | 114 ++++++++++++++ .../Meos/AlwaysNeTposePoseLogicalFunction.cpp | 114 ++++++++++++++ .../src/Functions/Meos/CMakeLists.txt | 10 ++ .../Meos/EverEqPoseTposeLogicalFunction.cpp | 114 ++++++++++++++ .../Meos/EverEqTposePoseLogicalFunction.cpp | 114 ++++++++++++++ .../Meos/EverNePoseTposeLogicalFunction.cpp | 114 ++++++++++++++ .../Meos/EverNeTposePoseLogicalFunction.cpp | 114 ++++++++++++++ .../Meos/NadTposeGeoLogicalFunction.cpp | 108 +++++++++++++ .../Meos/NadTposePoseLogicalFunction.cpp | 114 ++++++++++++++ .../AlwaysEqPoseTposePhysicalFunction.hpp | 32 ++++ .../AlwaysEqTposePosePhysicalFunction.hpp | 32 ++++ .../AlwaysNePoseTposePhysicalFunction.hpp | 32 ++++ .../AlwaysNeTposePosePhysicalFunction.hpp | 32 ++++ .../Meos/EverEqPoseTposePhysicalFunction.hpp | 32 ++++ .../Meos/EverEqTposePosePhysicalFunction.hpp | 32 ++++ .../Meos/EverNePoseTposePhysicalFunction.hpp | 32 ++++ .../Meos/EverNeTposePosePhysicalFunction.hpp | 32 ++++ .../Meos/NadTposeGeoPhysicalFunction.hpp | 32 ++++ .../Meos/NadTposePosePhysicalFunction.hpp | 32 ++++ .../AlwaysEqPoseTposePhysicalFunction.cpp | 94 +++++++++++ .../AlwaysEqTposePosePhysicalFunction.cpp | 94 +++++++++++ .../AlwaysNePoseTposePhysicalFunction.cpp | 94 +++++++++++ .../AlwaysNeTposePosePhysicalFunction.cpp | 94 +++++++++++ .../src/Functions/Meos/CMakeLists.txt | 10 ++ .../Meos/EverEqPoseTposePhysicalFunction.cpp | 94 +++++++++++ .../Meos/EverEqTposePosePhysicalFunction.cpp | 94 +++++++++++ .../Meos/EverNePoseTposePhysicalFunction.cpp | 94 +++++++++++ .../Meos/EverNeTposePosePhysicalFunction.cpp | 94 +++++++++++ .../Meos/NadTposeGeoPhysicalFunction.cpp | 92 +++++++++++ .../Meos/NadTposePosePhysicalFunction.cpp | 94 +++++++++++ nes-sql-parser/AntlrSQL.g4 | 12 +- .../src/AntlrSQLQueryPlanCreator.cpp | 148 ++++++++++++++++++ 44 files changed, 3051 insertions(+), 1 deletion(-) create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysEqPoseTposeLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysEqTposePoseLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysNePoseTposeLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysNeTposePoseLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverEqPoseTposeLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverEqTposePoseLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverNePoseTposeLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverNeTposePoseLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/NadTposeGeoLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/NadTposePoseLogicalFunction.hpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysEqPoseTposeLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysEqTposePoseLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysNePoseTposeLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysNeTposePoseLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverEqPoseTposeLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverEqTposePoseLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverNePoseTposeLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverNeTposePoseLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/NadTposeGeoLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/NadTposePoseLogicalFunction.cpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysEqPoseTposePhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysEqTposePosePhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysNePoseTposePhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysNeTposePosePhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverEqPoseTposePhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverEqTposePosePhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverNePoseTposePhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverNeTposePosePhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/NadTposeGeoPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/NadTposePosePhysicalFunction.hpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysEqPoseTposePhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysEqTposePosePhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysNePoseTposePhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysNeTposePosePhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverEqPoseTposePhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverEqTposePosePhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverNePoseTposePhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverNeTposePosePhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/NadTposeGeoPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/NadTposePosePhysicalFunction.cpp diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysEqPoseTposeLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysEqPoseTposeLogicalFunction.hpp new file mode 100644 index 0000000000..6e2ad749d8 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysEqPoseTposeLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if the static pose is always equal to the 2D tpose instant, 0.0 otherwise. + */ +class AlwaysEqPoseTposeLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysEqPoseTpose"; + + AlwaysEqPoseTposeLogicalFunction(LogicalFunction x2, LogicalFunction y2, LogicalFunction theta2, LogicalFunction x, LogicalFunction y, LogicalFunction theta, LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysEqTposePoseLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysEqTposePoseLogicalFunction.hpp new file mode 100644 index 0000000000..80eeee56b3 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysEqTposePoseLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if the 2D tpose instant is always equal to the static pose, 0.0 otherwise. + */ +class AlwaysEqTposePoseLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysEqTposePose"; + + AlwaysEqTposePoseLogicalFunction(LogicalFunction x, LogicalFunction y, LogicalFunction theta, LogicalFunction ts, LogicalFunction x2, LogicalFunction y2, LogicalFunction theta2); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysNePoseTposeLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysNePoseTposeLogicalFunction.hpp new file mode 100644 index 0000000000..d604ce1f74 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysNePoseTposeLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if the static pose is always not equal to the 2D tpose instant, 0.0 otherwise. + */ +class AlwaysNePoseTposeLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysNePoseTpose"; + + AlwaysNePoseTposeLogicalFunction(LogicalFunction x2, LogicalFunction y2, LogicalFunction theta2, LogicalFunction x, LogicalFunction y, LogicalFunction theta, LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysNeTposePoseLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysNeTposePoseLogicalFunction.hpp new file mode 100644 index 0000000000..b26b209ec1 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysNeTposePoseLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if the 2D tpose instant is always not equal to the static pose, 0.0 otherwise. + */ +class AlwaysNeTposePoseLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysNeTposePose"; + + AlwaysNeTposePoseLogicalFunction(LogicalFunction x, LogicalFunction y, LogicalFunction theta, LogicalFunction ts, LogicalFunction x2, LogicalFunction y2, LogicalFunction theta2); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverEqPoseTposeLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverEqPoseTposeLogicalFunction.hpp new file mode 100644 index 0000000000..da75e450e1 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverEqPoseTposeLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if the static pose is ever equal to the 2D tpose instant, 0.0 otherwise. + */ +class EverEqPoseTposeLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverEqPoseTpose"; + + EverEqPoseTposeLogicalFunction(LogicalFunction x2, LogicalFunction y2, LogicalFunction theta2, LogicalFunction x, LogicalFunction y, LogicalFunction theta, LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverEqTposePoseLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverEqTposePoseLogicalFunction.hpp new file mode 100644 index 0000000000..4b786a6452 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverEqTposePoseLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if the 2D tpose instant is ever equal to the static pose, 0.0 otherwise. + */ +class EverEqTposePoseLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverEqTposePose"; + + EverEqTposePoseLogicalFunction(LogicalFunction x, LogicalFunction y, LogicalFunction theta, LogicalFunction ts, LogicalFunction x2, LogicalFunction y2, LogicalFunction theta2); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverNePoseTposeLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverNePoseTposeLogicalFunction.hpp new file mode 100644 index 0000000000..94e76a2718 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverNePoseTposeLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if the static pose is ever not equal to the 2D tpose instant, 0.0 otherwise. + */ +class EverNePoseTposeLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverNePoseTpose"; + + EverNePoseTposeLogicalFunction(LogicalFunction x2, LogicalFunction y2, LogicalFunction theta2, LogicalFunction x, LogicalFunction y, LogicalFunction theta, LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverNeTposePoseLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverNeTposePoseLogicalFunction.hpp new file mode 100644 index 0000000000..e94c0bded7 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverNeTposePoseLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if the 2D tpose instant is ever not equal to the static pose, 0.0 otherwise. + */ +class EverNeTposePoseLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverNeTposePose"; + + EverNeTposePoseLogicalFunction(LogicalFunction x, LogicalFunction y, LogicalFunction theta, LogicalFunction ts, LogicalFunction x2, LogicalFunction y2, LogicalFunction theta2); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/NadTposeGeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/NadTposeGeoLogicalFunction.hpp new file mode 100644 index 0000000000..72614db99c --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/NadTposeGeoLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns the nearest approach distance between a 2D tpose instant and a static geometry. + */ +class NadTposeGeoLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "NadTposeGeo"; + + NadTposeGeoLogicalFunction(LogicalFunction x, LogicalFunction y, LogicalFunction theta, LogicalFunction ts, LogicalFunction wkt); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/NadTposePoseLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/NadTposePoseLogicalFunction.hpp new file mode 100644 index 0000000000..bccd5f063a --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/NadTposePoseLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns the nearest approach distance between a 2D tpose instant and a static pose. + */ +class NadTposePoseLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "NadTposePose"; + + NadTposePoseLogicalFunction(LogicalFunction x, LogicalFunction y, LogicalFunction theta, LogicalFunction ts, LogicalFunction x2, LogicalFunction y2, LogicalFunction theta2); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysEqPoseTposeLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysEqPoseTposeLogicalFunction.cpp new file mode 100644 index 0000000000..a6375f3a30 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysEqPoseTposeLogicalFunction.cpp @@ -0,0 +1,114 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AlwaysEqPoseTposeLogicalFunction::AlwaysEqPoseTposeLogicalFunction(LogicalFunction x2, LogicalFunction y2, LogicalFunction theta2, LogicalFunction x, LogicalFunction y, LogicalFunction theta, LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(7); + parameters.push_back(std::move(x2)); + parameters.push_back(std::move(y2)); + parameters.push_back(std::move(theta2)); + parameters.push_back(std::move(x)); + parameters.push_back(std::move(y)); + parameters.push_back(std::move(theta)); + parameters.push_back(std::move(ts)); +} + +DataType AlwaysEqPoseTposeLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysEqPoseTposeLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AlwaysEqPoseTposeLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysEqPoseTposeLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 7, + "AlwaysEqPoseTposeLogicalFunction requires 7 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AlwaysEqPoseTposeLogicalFunction::getType() const { return NAME; } + +bool AlwaysEqPoseTposeLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AlwaysEqPoseTposeLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction AlwaysEqPoseTposeLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(7); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "x2 must be FLOAT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "y2 must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "theta2 must be FLOAT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::FLOAT64), "x must be FLOAT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "y must be FLOAT64"); + INVARIANT(c[5].getDataType().isType(DataType::Type::FLOAT64), "theta must be FLOAT64"); + INVARIANT(c[6].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); + return withChildren(c); +} + +SerializableFunction AlwaysEqPoseTposeLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysEqPoseTposeLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 7, + "AlwaysEqPoseTposeLogicalFunction requires 7 children but got {}", + arguments.children.size()); + return AlwaysEqPoseTposeLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4]), + std::move(arguments.children[5]), + std::move(arguments.children[6])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysEqTposePoseLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysEqTposePoseLogicalFunction.cpp new file mode 100644 index 0000000000..8fa49b257f --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysEqTposePoseLogicalFunction.cpp @@ -0,0 +1,114 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AlwaysEqTposePoseLogicalFunction::AlwaysEqTposePoseLogicalFunction(LogicalFunction x, LogicalFunction y, LogicalFunction theta, LogicalFunction ts, LogicalFunction x2, LogicalFunction y2, LogicalFunction theta2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(7); + parameters.push_back(std::move(x)); + parameters.push_back(std::move(y)); + parameters.push_back(std::move(theta)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(x2)); + parameters.push_back(std::move(y2)); + parameters.push_back(std::move(theta2)); +} + +DataType AlwaysEqTposePoseLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysEqTposePoseLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AlwaysEqTposePoseLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysEqTposePoseLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 7, + "AlwaysEqTposePoseLogicalFunction requires 7 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AlwaysEqTposePoseLogicalFunction::getType() const { return NAME; } + +bool AlwaysEqTposePoseLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AlwaysEqTposePoseLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction AlwaysEqTposePoseLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(7); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "x must be FLOAT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "y must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "theta must be FLOAT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "x2 must be FLOAT64"); + INVARIANT(c[5].getDataType().isType(DataType::Type::FLOAT64), "y2 must be FLOAT64"); + INVARIANT(c[6].getDataType().isType(DataType::Type::FLOAT64), "theta2 must be FLOAT64"); + return withChildren(c); +} + +SerializableFunction AlwaysEqTposePoseLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysEqTposePoseLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 7, + "AlwaysEqTposePoseLogicalFunction requires 7 children but got {}", + arguments.children.size()); + return AlwaysEqTposePoseLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4]), + std::move(arguments.children[5]), + std::move(arguments.children[6])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysNePoseTposeLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysNePoseTposeLogicalFunction.cpp new file mode 100644 index 0000000000..60c8744bdd --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysNePoseTposeLogicalFunction.cpp @@ -0,0 +1,114 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AlwaysNePoseTposeLogicalFunction::AlwaysNePoseTposeLogicalFunction(LogicalFunction x2, LogicalFunction y2, LogicalFunction theta2, LogicalFunction x, LogicalFunction y, LogicalFunction theta, LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(7); + parameters.push_back(std::move(x2)); + parameters.push_back(std::move(y2)); + parameters.push_back(std::move(theta2)); + parameters.push_back(std::move(x)); + parameters.push_back(std::move(y)); + parameters.push_back(std::move(theta)); + parameters.push_back(std::move(ts)); +} + +DataType AlwaysNePoseTposeLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysNePoseTposeLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AlwaysNePoseTposeLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysNePoseTposeLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 7, + "AlwaysNePoseTposeLogicalFunction requires 7 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AlwaysNePoseTposeLogicalFunction::getType() const { return NAME; } + +bool AlwaysNePoseTposeLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AlwaysNePoseTposeLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction AlwaysNePoseTposeLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(7); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "x2 must be FLOAT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "y2 must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "theta2 must be FLOAT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::FLOAT64), "x must be FLOAT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "y must be FLOAT64"); + INVARIANT(c[5].getDataType().isType(DataType::Type::FLOAT64), "theta must be FLOAT64"); + INVARIANT(c[6].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); + return withChildren(c); +} + +SerializableFunction AlwaysNePoseTposeLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysNePoseTposeLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 7, + "AlwaysNePoseTposeLogicalFunction requires 7 children but got {}", + arguments.children.size()); + return AlwaysNePoseTposeLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4]), + std::move(arguments.children[5]), + std::move(arguments.children[6])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysNeTposePoseLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysNeTposePoseLogicalFunction.cpp new file mode 100644 index 0000000000..c4a6e0ed28 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysNeTposePoseLogicalFunction.cpp @@ -0,0 +1,114 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AlwaysNeTposePoseLogicalFunction::AlwaysNeTposePoseLogicalFunction(LogicalFunction x, LogicalFunction y, LogicalFunction theta, LogicalFunction ts, LogicalFunction x2, LogicalFunction y2, LogicalFunction theta2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(7); + parameters.push_back(std::move(x)); + parameters.push_back(std::move(y)); + parameters.push_back(std::move(theta)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(x2)); + parameters.push_back(std::move(y2)); + parameters.push_back(std::move(theta2)); +} + +DataType AlwaysNeTposePoseLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysNeTposePoseLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AlwaysNeTposePoseLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysNeTposePoseLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 7, + "AlwaysNeTposePoseLogicalFunction requires 7 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AlwaysNeTposePoseLogicalFunction::getType() const { return NAME; } + +bool AlwaysNeTposePoseLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AlwaysNeTposePoseLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction AlwaysNeTposePoseLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(7); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "x must be FLOAT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "y must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "theta must be FLOAT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "x2 must be FLOAT64"); + INVARIANT(c[5].getDataType().isType(DataType::Type::FLOAT64), "y2 must be FLOAT64"); + INVARIANT(c[6].getDataType().isType(DataType::Type::FLOAT64), "theta2 must be FLOAT64"); + return withChildren(c); +} + +SerializableFunction AlwaysNeTposePoseLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysNeTposePoseLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 7, + "AlwaysNeTposePoseLogicalFunction requires 7 children but got {}", + arguments.children.size()); + return AlwaysNeTposePoseLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4]), + std::move(arguments.children[5]), + std::move(arguments.children[6])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt index a45f610e8d..ac864b86b8 100644 --- a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt @@ -395,6 +395,16 @@ add_plugin(AlwaysEqTnpointTnpoint LogicalFunction nes-logical-operators AlwaysEq add_plugin(EverNeTnpointTnpoint LogicalFunction nes-logical-operators EverNeTnpointTnpointLogicalFunction.cpp) add_plugin(AlwaysNeTnpointTnpoint LogicalFunction nes-logical-operators AlwaysNeTnpointTnpointLogicalFunction.cpp) add_plugin(NadTnpointTnpoint LogicalFunction nes-logical-operators NadTnpointTnpointLogicalFunction.cpp) +add_plugin(NadTposeGeo LogicalFunction nes-logical-operators NadTposeGeoLogicalFunction.cpp) +add_plugin(EverEqTposePose LogicalFunction nes-logical-operators EverEqTposePoseLogicalFunction.cpp) +add_plugin(AlwaysEqTposePose LogicalFunction nes-logical-operators AlwaysEqTposePoseLogicalFunction.cpp) +add_plugin(EverNeTposePose LogicalFunction nes-logical-operators EverNeTposePoseLogicalFunction.cpp) +add_plugin(AlwaysNeTposePose LogicalFunction nes-logical-operators AlwaysNeTposePoseLogicalFunction.cpp) +add_plugin(NadTposePose LogicalFunction nes-logical-operators NadTposePoseLogicalFunction.cpp) +add_plugin(EverEqPoseTpose LogicalFunction nes-logical-operators EverEqPoseTposeLogicalFunction.cpp) +add_plugin(AlwaysEqPoseTpose LogicalFunction nes-logical-operators AlwaysEqPoseTposeLogicalFunction.cpp) +add_plugin(EverNePoseTpose LogicalFunction nes-logical-operators EverNePoseTposeLogicalFunction.cpp) +add_plugin(AlwaysNePoseTpose LogicalFunction nes-logical-operators AlwaysNePoseTposeLogicalFunction.cpp) add_plugin(GeomIntersects2d LogicalFunction nes-logical-operators GeomIntersects2dLogicalFunction.cpp) add_plugin(GeomDwithin2d LogicalFunction nes-logical-operators GeomDwithin2dLogicalFunction.cpp) add_plugin(GeomContains LogicalFunction nes-logical-operators GeomContainsLogicalFunction.cpp) diff --git a/nes-logical-operators/src/Functions/Meos/EverEqPoseTposeLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverEqPoseTposeLogicalFunction.cpp new file mode 100644 index 0000000000..32dcbb6be6 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverEqPoseTposeLogicalFunction.cpp @@ -0,0 +1,114 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EverEqPoseTposeLogicalFunction::EverEqPoseTposeLogicalFunction(LogicalFunction x2, LogicalFunction y2, LogicalFunction theta2, LogicalFunction x, LogicalFunction y, LogicalFunction theta, LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(7); + parameters.push_back(std::move(x2)); + parameters.push_back(std::move(y2)); + parameters.push_back(std::move(theta2)); + parameters.push_back(std::move(x)); + parameters.push_back(std::move(y)); + parameters.push_back(std::move(theta)); + parameters.push_back(std::move(ts)); +} + +DataType EverEqPoseTposeLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverEqPoseTposeLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EverEqPoseTposeLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverEqPoseTposeLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 7, + "EverEqPoseTposeLogicalFunction requires 7 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EverEqPoseTposeLogicalFunction::getType() const { return NAME; } + +bool EverEqPoseTposeLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EverEqPoseTposeLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction EverEqPoseTposeLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(7); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "x2 must be FLOAT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "y2 must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "theta2 must be FLOAT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::FLOAT64), "x must be FLOAT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "y must be FLOAT64"); + INVARIANT(c[5].getDataType().isType(DataType::Type::FLOAT64), "theta must be FLOAT64"); + INVARIANT(c[6].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); + return withChildren(c); +} + +SerializableFunction EverEqPoseTposeLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverEqPoseTposeLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 7, + "EverEqPoseTposeLogicalFunction requires 7 children but got {}", + arguments.children.size()); + return EverEqPoseTposeLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4]), + std::move(arguments.children[5]), + std::move(arguments.children[6])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverEqTposePoseLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverEqTposePoseLogicalFunction.cpp new file mode 100644 index 0000000000..a5b4200952 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverEqTposePoseLogicalFunction.cpp @@ -0,0 +1,114 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EverEqTposePoseLogicalFunction::EverEqTposePoseLogicalFunction(LogicalFunction x, LogicalFunction y, LogicalFunction theta, LogicalFunction ts, LogicalFunction x2, LogicalFunction y2, LogicalFunction theta2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(7); + parameters.push_back(std::move(x)); + parameters.push_back(std::move(y)); + parameters.push_back(std::move(theta)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(x2)); + parameters.push_back(std::move(y2)); + parameters.push_back(std::move(theta2)); +} + +DataType EverEqTposePoseLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverEqTposePoseLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EverEqTposePoseLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverEqTposePoseLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 7, + "EverEqTposePoseLogicalFunction requires 7 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EverEqTposePoseLogicalFunction::getType() const { return NAME; } + +bool EverEqTposePoseLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EverEqTposePoseLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction EverEqTposePoseLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(7); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "x must be FLOAT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "y must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "theta must be FLOAT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "x2 must be FLOAT64"); + INVARIANT(c[5].getDataType().isType(DataType::Type::FLOAT64), "y2 must be FLOAT64"); + INVARIANT(c[6].getDataType().isType(DataType::Type::FLOAT64), "theta2 must be FLOAT64"); + return withChildren(c); +} + +SerializableFunction EverEqTposePoseLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverEqTposePoseLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 7, + "EverEqTposePoseLogicalFunction requires 7 children but got {}", + arguments.children.size()); + return EverEqTposePoseLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4]), + std::move(arguments.children[5]), + std::move(arguments.children[6])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverNePoseTposeLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverNePoseTposeLogicalFunction.cpp new file mode 100644 index 0000000000..dcbaca23e5 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverNePoseTposeLogicalFunction.cpp @@ -0,0 +1,114 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EverNePoseTposeLogicalFunction::EverNePoseTposeLogicalFunction(LogicalFunction x2, LogicalFunction y2, LogicalFunction theta2, LogicalFunction x, LogicalFunction y, LogicalFunction theta, LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(7); + parameters.push_back(std::move(x2)); + parameters.push_back(std::move(y2)); + parameters.push_back(std::move(theta2)); + parameters.push_back(std::move(x)); + parameters.push_back(std::move(y)); + parameters.push_back(std::move(theta)); + parameters.push_back(std::move(ts)); +} + +DataType EverNePoseTposeLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverNePoseTposeLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EverNePoseTposeLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverNePoseTposeLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 7, + "EverNePoseTposeLogicalFunction requires 7 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EverNePoseTposeLogicalFunction::getType() const { return NAME; } + +bool EverNePoseTposeLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EverNePoseTposeLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction EverNePoseTposeLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(7); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "x2 must be FLOAT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "y2 must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "theta2 must be FLOAT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::FLOAT64), "x must be FLOAT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "y must be FLOAT64"); + INVARIANT(c[5].getDataType().isType(DataType::Type::FLOAT64), "theta must be FLOAT64"); + INVARIANT(c[6].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); + return withChildren(c); +} + +SerializableFunction EverNePoseTposeLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverNePoseTposeLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 7, + "EverNePoseTposeLogicalFunction requires 7 children but got {}", + arguments.children.size()); + return EverNePoseTposeLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4]), + std::move(arguments.children[5]), + std::move(arguments.children[6])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverNeTposePoseLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverNeTposePoseLogicalFunction.cpp new file mode 100644 index 0000000000..d55ec596d1 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverNeTposePoseLogicalFunction.cpp @@ -0,0 +1,114 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EverNeTposePoseLogicalFunction::EverNeTposePoseLogicalFunction(LogicalFunction x, LogicalFunction y, LogicalFunction theta, LogicalFunction ts, LogicalFunction x2, LogicalFunction y2, LogicalFunction theta2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(7); + parameters.push_back(std::move(x)); + parameters.push_back(std::move(y)); + parameters.push_back(std::move(theta)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(x2)); + parameters.push_back(std::move(y2)); + parameters.push_back(std::move(theta2)); +} + +DataType EverNeTposePoseLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverNeTposePoseLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EverNeTposePoseLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverNeTposePoseLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 7, + "EverNeTposePoseLogicalFunction requires 7 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EverNeTposePoseLogicalFunction::getType() const { return NAME; } + +bool EverNeTposePoseLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EverNeTposePoseLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction EverNeTposePoseLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(7); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "x must be FLOAT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "y must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "theta must be FLOAT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "x2 must be FLOAT64"); + INVARIANT(c[5].getDataType().isType(DataType::Type::FLOAT64), "y2 must be FLOAT64"); + INVARIANT(c[6].getDataType().isType(DataType::Type::FLOAT64), "theta2 must be FLOAT64"); + return withChildren(c); +} + +SerializableFunction EverNeTposePoseLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverNeTposePoseLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 7, + "EverNeTposePoseLogicalFunction requires 7 children but got {}", + arguments.children.size()); + return EverNeTposePoseLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4]), + std::move(arguments.children[5]), + std::move(arguments.children[6])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/NadTposeGeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/NadTposeGeoLogicalFunction.cpp new file mode 100644 index 0000000000..b32aea7cef --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/NadTposeGeoLogicalFunction.cpp @@ -0,0 +1,108 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +NadTposeGeoLogicalFunction::NadTposeGeoLogicalFunction(LogicalFunction x, LogicalFunction y, LogicalFunction theta, LogicalFunction ts, LogicalFunction wkt) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(5); + parameters.push_back(std::move(x)); + parameters.push_back(std::move(y)); + parameters.push_back(std::move(theta)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(wkt)); +} + +DataType NadTposeGeoLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction NadTposeGeoLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector NadTposeGeoLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction NadTposeGeoLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 5, + "NadTposeGeoLogicalFunction requires 5 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view NadTposeGeoLogicalFunction::getType() const { return NAME; } + +bool NadTposeGeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string NadTposeGeoLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction NadTposeGeoLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(5); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "x must be FLOAT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "y must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "theta must be FLOAT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::VARSIZED), "wkt must be VARSIZED"); + return withChildren(c); +} + +SerializableFunction NadTposeGeoLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterNadTposeGeoLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 5, + "NadTposeGeoLogicalFunction requires 5 children but got {}", + arguments.children.size()); + return NadTposeGeoLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/NadTposePoseLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/NadTposePoseLogicalFunction.cpp new file mode 100644 index 0000000000..d4647c9627 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/NadTposePoseLogicalFunction.cpp @@ -0,0 +1,114 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +NadTposePoseLogicalFunction::NadTposePoseLogicalFunction(LogicalFunction x, LogicalFunction y, LogicalFunction theta, LogicalFunction ts, LogicalFunction x2, LogicalFunction y2, LogicalFunction theta2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(7); + parameters.push_back(std::move(x)); + parameters.push_back(std::move(y)); + parameters.push_back(std::move(theta)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(x2)); + parameters.push_back(std::move(y2)); + parameters.push_back(std::move(theta2)); +} + +DataType NadTposePoseLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction NadTposePoseLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector NadTposePoseLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction NadTposePoseLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 7, + "NadTposePoseLogicalFunction requires 7 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view NadTposePoseLogicalFunction::getType() const { return NAME; } + +bool NadTposePoseLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string NadTposePoseLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction NadTposePoseLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(7); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "x must be FLOAT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "y must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "theta must be FLOAT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "x2 must be FLOAT64"); + INVARIANT(c[5].getDataType().isType(DataType::Type::FLOAT64), "y2 must be FLOAT64"); + INVARIANT(c[6].getDataType().isType(DataType::Type::FLOAT64), "theta2 must be FLOAT64"); + return withChildren(c); +} + +SerializableFunction NadTposePoseLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterNadTposePoseLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 7, + "NadTposePoseLogicalFunction requires 7 children but got {}", + arguments.children.size()); + return NadTposePoseLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4]), + std::move(arguments.children[5]), + std::move(arguments.children[6])); +} + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysEqPoseTposePhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysEqPoseTposePhysicalFunction.hpp new file mode 100644 index 0000000000..29adc32501 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysEqPoseTposePhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class AlwaysEqPoseTposePhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysEqPoseTposePhysicalFunction(PhysicalFunction x2, PhysicalFunction y2, PhysicalFunction theta2, PhysicalFunction x, PhysicalFunction y, PhysicalFunction theta, PhysicalFunction ts); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysEqTposePosePhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysEqTposePosePhysicalFunction.hpp new file mode 100644 index 0000000000..4b12612425 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysEqTposePosePhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class AlwaysEqTposePosePhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysEqTposePosePhysicalFunction(PhysicalFunction x, PhysicalFunction y, PhysicalFunction theta, PhysicalFunction ts, PhysicalFunction x2, PhysicalFunction y2, PhysicalFunction theta2); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysNePoseTposePhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysNePoseTposePhysicalFunction.hpp new file mode 100644 index 0000000000..771235ac8a --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysNePoseTposePhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class AlwaysNePoseTposePhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysNePoseTposePhysicalFunction(PhysicalFunction x2, PhysicalFunction y2, PhysicalFunction theta2, PhysicalFunction x, PhysicalFunction y, PhysicalFunction theta, PhysicalFunction ts); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysNeTposePosePhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysNeTposePosePhysicalFunction.hpp new file mode 100644 index 0000000000..d5b11fc7bd --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysNeTposePosePhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class AlwaysNeTposePosePhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysNeTposePosePhysicalFunction(PhysicalFunction x, PhysicalFunction y, PhysicalFunction theta, PhysicalFunction ts, PhysicalFunction x2, PhysicalFunction y2, PhysicalFunction theta2); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverEqPoseTposePhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverEqPoseTposePhysicalFunction.hpp new file mode 100644 index 0000000000..b8defb26a6 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverEqPoseTposePhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class EverEqPoseTposePhysicalFunction : public PhysicalFunctionConcept { +public: + EverEqPoseTposePhysicalFunction(PhysicalFunction x2, PhysicalFunction y2, PhysicalFunction theta2, PhysicalFunction x, PhysicalFunction y, PhysicalFunction theta, PhysicalFunction ts); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverEqTposePosePhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverEqTposePosePhysicalFunction.hpp new file mode 100644 index 0000000000..a304cc7b82 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverEqTposePosePhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class EverEqTposePosePhysicalFunction : public PhysicalFunctionConcept { +public: + EverEqTposePosePhysicalFunction(PhysicalFunction x, PhysicalFunction y, PhysicalFunction theta, PhysicalFunction ts, PhysicalFunction x2, PhysicalFunction y2, PhysicalFunction theta2); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverNePoseTposePhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverNePoseTposePhysicalFunction.hpp new file mode 100644 index 0000000000..227b02aa36 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverNePoseTposePhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class EverNePoseTposePhysicalFunction : public PhysicalFunctionConcept { +public: + EverNePoseTposePhysicalFunction(PhysicalFunction x2, PhysicalFunction y2, PhysicalFunction theta2, PhysicalFunction x, PhysicalFunction y, PhysicalFunction theta, PhysicalFunction ts); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverNeTposePosePhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverNeTposePosePhysicalFunction.hpp new file mode 100644 index 0000000000..2a1d144bdc --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverNeTposePosePhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class EverNeTposePosePhysicalFunction : public PhysicalFunctionConcept { +public: + EverNeTposePosePhysicalFunction(PhysicalFunction x, PhysicalFunction y, PhysicalFunction theta, PhysicalFunction ts, PhysicalFunction x2, PhysicalFunction y2, PhysicalFunction theta2); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/NadTposeGeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/NadTposeGeoPhysicalFunction.hpp new file mode 100644 index 0000000000..55ad411307 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/NadTposeGeoPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class NadTposeGeoPhysicalFunction : public PhysicalFunctionConcept { +public: + NadTposeGeoPhysicalFunction(PhysicalFunction x, PhysicalFunction y, PhysicalFunction theta, PhysicalFunction ts, PhysicalFunction wkt); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/NadTposePosePhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/NadTposePosePhysicalFunction.hpp new file mode 100644 index 0000000000..1f9ed513ba --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/NadTposePosePhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class NadTposePosePhysicalFunction : public PhysicalFunctionConcept { +public: + NadTposePosePhysicalFunction(PhysicalFunction x, PhysicalFunction y, PhysicalFunction theta, PhysicalFunction ts, PhysicalFunction x2, PhysicalFunction y2, PhysicalFunction theta2); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysEqPoseTposePhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysEqPoseTposePhysicalFunction.cpp new file mode 100644 index 0000000000..036c8801dd --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysEqPoseTposePhysicalFunction.cpp @@ -0,0 +1,94 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +AlwaysEqPoseTposePhysicalFunction::AlwaysEqPoseTposePhysicalFunction(PhysicalFunction x2, PhysicalFunction y2, PhysicalFunction theta2, PhysicalFunction x, PhysicalFunction y, PhysicalFunction theta, PhysicalFunction ts) +{ + paramFns.reserve(7); + paramFns.push_back(std::move(x2)); + paramFns.push_back(std::move(y2)); + paramFns.push_back(std::move(theta2)); + paramFns.push_back(std::move(x)); + paramFns.push_back(std::move(y)); + paramFns.push_back(std::move(theta)); + paramFns.push_back(std::move(ts)); +} + +VarVal AlwaysEqPoseTposePhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto x2 = paramFns[0].execute(record, arena).cast(); + auto y2 = paramFns[1].execute(record, arena).cast(); + auto theta2 = paramFns[2].execute(record, arena).cast(); + auto x = paramFns[3].execute(record, arena).cast(); + auto y = paramFns[4].execute(record, arena).cast(); + auto theta = paramFns[5].execute(record, arena).cast(); + auto ts = paramFns[6].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](double x2, double y2, double theta2, double x, double y, double theta, uint64_t ts) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + Pose* pose_s = pose_make_2d(x2, y2, theta2, false, 0); + if (!pose_s) return 0.0; + Pose* pose_t = pose_make_2d(x, y, theta, false, 0); + if (!pose_t) { free(pose_s); return 0.0; } + Temporal* inst = (Temporal*)tposeinst_make(pose_t, (TimestampTz)ts); + free(pose_t); + if (!inst) { free(pose_s); return 0.0; } + int r = always_eq_pose_tpose(pose_s, inst); + free(pose_s); free(inst); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + x2, y2, theta2, x, y, theta, ts); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysEqPoseTposePhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 7, + "AlwaysEqPoseTposePhysicalFunction requires 7 children but got {}", + arguments.childFunctions.size()); + return AlwaysEqPoseTposePhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4]), + std::move(arguments.childFunctions[5]), + std::move(arguments.childFunctions[6])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysEqTposePosePhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysEqTposePosePhysicalFunction.cpp new file mode 100644 index 0000000000..72132c2984 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysEqTposePosePhysicalFunction.cpp @@ -0,0 +1,94 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +AlwaysEqTposePosePhysicalFunction::AlwaysEqTposePosePhysicalFunction(PhysicalFunction x, PhysicalFunction y, PhysicalFunction theta, PhysicalFunction ts, PhysicalFunction x2, PhysicalFunction y2, PhysicalFunction theta2) +{ + paramFns.reserve(7); + paramFns.push_back(std::move(x)); + paramFns.push_back(std::move(y)); + paramFns.push_back(std::move(theta)); + paramFns.push_back(std::move(ts)); + paramFns.push_back(std::move(x2)); + paramFns.push_back(std::move(y2)); + paramFns.push_back(std::move(theta2)); +} + +VarVal AlwaysEqTposePosePhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto x = paramFns[0].execute(record, arena).cast(); + auto y = paramFns[1].execute(record, arena).cast(); + auto theta = paramFns[2].execute(record, arena).cast(); + auto ts = paramFns[3].execute(record, arena).cast(); + auto x2 = paramFns[4].execute(record, arena).cast(); + auto y2 = paramFns[5].execute(record, arena).cast(); + auto theta2 = paramFns[6].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](double x, double y, double theta, uint64_t ts, double x2, double y2, double theta2) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + Pose* pose1 = pose_make_2d(x, y, theta, false, 0); + if (!pose1) return 0.0; + Temporal* inst = (Temporal*)tposeinst_make(pose1, (TimestampTz)ts); + free(pose1); + if (!inst) return 0.0; + Pose* pose2 = pose_make_2d(x2, y2, theta2, false, 0); + if (!pose2) { free(inst); return 0.0; } + int r = always_eq_tpose_pose(inst, pose2); + free(inst); free(pose2); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + x, y, theta, ts, x2, y2, theta2); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysEqTposePosePhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 7, + "AlwaysEqTposePosePhysicalFunction requires 7 children but got {}", + arguments.childFunctions.size()); + return AlwaysEqTposePosePhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4]), + std::move(arguments.childFunctions[5]), + std::move(arguments.childFunctions[6])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysNePoseTposePhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysNePoseTposePhysicalFunction.cpp new file mode 100644 index 0000000000..c0e6643536 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysNePoseTposePhysicalFunction.cpp @@ -0,0 +1,94 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +AlwaysNePoseTposePhysicalFunction::AlwaysNePoseTposePhysicalFunction(PhysicalFunction x2, PhysicalFunction y2, PhysicalFunction theta2, PhysicalFunction x, PhysicalFunction y, PhysicalFunction theta, PhysicalFunction ts) +{ + paramFns.reserve(7); + paramFns.push_back(std::move(x2)); + paramFns.push_back(std::move(y2)); + paramFns.push_back(std::move(theta2)); + paramFns.push_back(std::move(x)); + paramFns.push_back(std::move(y)); + paramFns.push_back(std::move(theta)); + paramFns.push_back(std::move(ts)); +} + +VarVal AlwaysNePoseTposePhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto x2 = paramFns[0].execute(record, arena).cast(); + auto y2 = paramFns[1].execute(record, arena).cast(); + auto theta2 = paramFns[2].execute(record, arena).cast(); + auto x = paramFns[3].execute(record, arena).cast(); + auto y = paramFns[4].execute(record, arena).cast(); + auto theta = paramFns[5].execute(record, arena).cast(); + auto ts = paramFns[6].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](double x2, double y2, double theta2, double x, double y, double theta, uint64_t ts) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + Pose* pose_s = pose_make_2d(x2, y2, theta2, false, 0); + if (!pose_s) return 0.0; + Pose* pose_t = pose_make_2d(x, y, theta, false, 0); + if (!pose_t) { free(pose_s); return 0.0; } + Temporal* inst = (Temporal*)tposeinst_make(pose_t, (TimestampTz)ts); + free(pose_t); + if (!inst) { free(pose_s); return 0.0; } + int r = always_ne_pose_tpose(pose_s, inst); + free(pose_s); free(inst); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + x2, y2, theta2, x, y, theta, ts); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysNePoseTposePhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 7, + "AlwaysNePoseTposePhysicalFunction requires 7 children but got {}", + arguments.childFunctions.size()); + return AlwaysNePoseTposePhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4]), + std::move(arguments.childFunctions[5]), + std::move(arguments.childFunctions[6])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysNeTposePosePhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysNeTposePosePhysicalFunction.cpp new file mode 100644 index 0000000000..3d0472a51d --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysNeTposePosePhysicalFunction.cpp @@ -0,0 +1,94 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +AlwaysNeTposePosePhysicalFunction::AlwaysNeTposePosePhysicalFunction(PhysicalFunction x, PhysicalFunction y, PhysicalFunction theta, PhysicalFunction ts, PhysicalFunction x2, PhysicalFunction y2, PhysicalFunction theta2) +{ + paramFns.reserve(7); + paramFns.push_back(std::move(x)); + paramFns.push_back(std::move(y)); + paramFns.push_back(std::move(theta)); + paramFns.push_back(std::move(ts)); + paramFns.push_back(std::move(x2)); + paramFns.push_back(std::move(y2)); + paramFns.push_back(std::move(theta2)); +} + +VarVal AlwaysNeTposePosePhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto x = paramFns[0].execute(record, arena).cast(); + auto y = paramFns[1].execute(record, arena).cast(); + auto theta = paramFns[2].execute(record, arena).cast(); + auto ts = paramFns[3].execute(record, arena).cast(); + auto x2 = paramFns[4].execute(record, arena).cast(); + auto y2 = paramFns[5].execute(record, arena).cast(); + auto theta2 = paramFns[6].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](double x, double y, double theta, uint64_t ts, double x2, double y2, double theta2) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + Pose* pose1 = pose_make_2d(x, y, theta, false, 0); + if (!pose1) return 0.0; + Temporal* inst = (Temporal*)tposeinst_make(pose1, (TimestampTz)ts); + free(pose1); + if (!inst) return 0.0; + Pose* pose2 = pose_make_2d(x2, y2, theta2, false, 0); + if (!pose2) { free(inst); return 0.0; } + int r = always_ne_tpose_pose(inst, pose2); + free(inst); free(pose2); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + x, y, theta, ts, x2, y2, theta2); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysNeTposePosePhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 7, + "AlwaysNeTposePosePhysicalFunction requires 7 children but got {}", + arguments.childFunctions.size()); + return AlwaysNeTposePosePhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4]), + std::move(arguments.childFunctions[5]), + std::move(arguments.childFunctions[6])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt index 71b501da60..bf02960bf3 100644 --- a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt @@ -394,6 +394,16 @@ add_plugin(AlwaysEqTnpointTnpoint PhysicalFunction nes-physical-operators Always add_plugin(EverNeTnpointTnpoint PhysicalFunction nes-physical-operators EverNeTnpointTnpointPhysicalFunction.cpp) add_plugin(AlwaysNeTnpointTnpoint PhysicalFunction nes-physical-operators AlwaysNeTnpointTnpointPhysicalFunction.cpp) add_plugin(NadTnpointTnpoint PhysicalFunction nes-physical-operators NadTnpointTnpointPhysicalFunction.cpp) +add_plugin(NadTposeGeo PhysicalFunction nes-physical-operators NadTposeGeoPhysicalFunction.cpp) +add_plugin(EverEqTposePose PhysicalFunction nes-physical-operators EverEqTposePosePhysicalFunction.cpp) +add_plugin(AlwaysEqTposePose PhysicalFunction nes-physical-operators AlwaysEqTposePosePhysicalFunction.cpp) +add_plugin(EverNeTposePose PhysicalFunction nes-physical-operators EverNeTposePosePhysicalFunction.cpp) +add_plugin(AlwaysNeTposePose PhysicalFunction nes-physical-operators AlwaysNeTposePosePhysicalFunction.cpp) +add_plugin(NadTposePose PhysicalFunction nes-physical-operators NadTposePosePhysicalFunction.cpp) +add_plugin(EverEqPoseTpose PhysicalFunction nes-physical-operators EverEqPoseTposePhysicalFunction.cpp) +add_plugin(AlwaysEqPoseTpose PhysicalFunction nes-physical-operators AlwaysEqPoseTposePhysicalFunction.cpp) +add_plugin(EverNePoseTpose PhysicalFunction nes-physical-operators EverNePoseTposePhysicalFunction.cpp) +add_plugin(AlwaysNePoseTpose PhysicalFunction nes-physical-operators AlwaysNePoseTposePhysicalFunction.cpp) add_plugin(GeomIntersects2d PhysicalFunction nes-physical-operators GeomIntersects2dPhysicalFunction.cpp) add_plugin(GeomDwithin2d PhysicalFunction nes-physical-operators GeomDwithin2dPhysicalFunction.cpp) add_plugin(GeomContains PhysicalFunction nes-physical-operators GeomContainsPhysicalFunction.cpp) diff --git a/nes-physical-operators/src/Functions/Meos/EverEqPoseTposePhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverEqPoseTposePhysicalFunction.cpp new file mode 100644 index 0000000000..4d2c2464a6 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverEqPoseTposePhysicalFunction.cpp @@ -0,0 +1,94 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +EverEqPoseTposePhysicalFunction::EverEqPoseTposePhysicalFunction(PhysicalFunction x2, PhysicalFunction y2, PhysicalFunction theta2, PhysicalFunction x, PhysicalFunction y, PhysicalFunction theta, PhysicalFunction ts) +{ + paramFns.reserve(7); + paramFns.push_back(std::move(x2)); + paramFns.push_back(std::move(y2)); + paramFns.push_back(std::move(theta2)); + paramFns.push_back(std::move(x)); + paramFns.push_back(std::move(y)); + paramFns.push_back(std::move(theta)); + paramFns.push_back(std::move(ts)); +} + +VarVal EverEqPoseTposePhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto x2 = paramFns[0].execute(record, arena).cast(); + auto y2 = paramFns[1].execute(record, arena).cast(); + auto theta2 = paramFns[2].execute(record, arena).cast(); + auto x = paramFns[3].execute(record, arena).cast(); + auto y = paramFns[4].execute(record, arena).cast(); + auto theta = paramFns[5].execute(record, arena).cast(); + auto ts = paramFns[6].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](double x2, double y2, double theta2, double x, double y, double theta, uint64_t ts) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + Pose* pose_s = pose_make_2d(x2, y2, theta2, false, 0); + if (!pose_s) return 0.0; + Pose* pose_t = pose_make_2d(x, y, theta, false, 0); + if (!pose_t) { free(pose_s); return 0.0; } + Temporal* inst = (Temporal*)tposeinst_make(pose_t, (TimestampTz)ts); + free(pose_t); + if (!inst) { free(pose_s); return 0.0; } + int r = ever_eq_pose_tpose(pose_s, inst); + free(pose_s); free(inst); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + x2, y2, theta2, x, y, theta, ts); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverEqPoseTposePhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 7, + "EverEqPoseTposePhysicalFunction requires 7 children but got {}", + arguments.childFunctions.size()); + return EverEqPoseTposePhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4]), + std::move(arguments.childFunctions[5]), + std::move(arguments.childFunctions[6])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverEqTposePosePhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverEqTposePosePhysicalFunction.cpp new file mode 100644 index 0000000000..9fddd8a541 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverEqTposePosePhysicalFunction.cpp @@ -0,0 +1,94 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +EverEqTposePosePhysicalFunction::EverEqTposePosePhysicalFunction(PhysicalFunction x, PhysicalFunction y, PhysicalFunction theta, PhysicalFunction ts, PhysicalFunction x2, PhysicalFunction y2, PhysicalFunction theta2) +{ + paramFns.reserve(7); + paramFns.push_back(std::move(x)); + paramFns.push_back(std::move(y)); + paramFns.push_back(std::move(theta)); + paramFns.push_back(std::move(ts)); + paramFns.push_back(std::move(x2)); + paramFns.push_back(std::move(y2)); + paramFns.push_back(std::move(theta2)); +} + +VarVal EverEqTposePosePhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto x = paramFns[0].execute(record, arena).cast(); + auto y = paramFns[1].execute(record, arena).cast(); + auto theta = paramFns[2].execute(record, arena).cast(); + auto ts = paramFns[3].execute(record, arena).cast(); + auto x2 = paramFns[4].execute(record, arena).cast(); + auto y2 = paramFns[5].execute(record, arena).cast(); + auto theta2 = paramFns[6].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](double x, double y, double theta, uint64_t ts, double x2, double y2, double theta2) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + Pose* pose1 = pose_make_2d(x, y, theta, false, 0); + if (!pose1) return 0.0; + Temporal* inst = (Temporal*)tposeinst_make(pose1, (TimestampTz)ts); + free(pose1); + if (!inst) return 0.0; + Pose* pose2 = pose_make_2d(x2, y2, theta2, false, 0); + if (!pose2) { free(inst); return 0.0; } + int r = ever_eq_tpose_pose(inst, pose2); + free(inst); free(pose2); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + x, y, theta, ts, x2, y2, theta2); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverEqTposePosePhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 7, + "EverEqTposePosePhysicalFunction requires 7 children but got {}", + arguments.childFunctions.size()); + return EverEqTposePosePhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4]), + std::move(arguments.childFunctions[5]), + std::move(arguments.childFunctions[6])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverNePoseTposePhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverNePoseTposePhysicalFunction.cpp new file mode 100644 index 0000000000..8aad773b72 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverNePoseTposePhysicalFunction.cpp @@ -0,0 +1,94 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +EverNePoseTposePhysicalFunction::EverNePoseTposePhysicalFunction(PhysicalFunction x2, PhysicalFunction y2, PhysicalFunction theta2, PhysicalFunction x, PhysicalFunction y, PhysicalFunction theta, PhysicalFunction ts) +{ + paramFns.reserve(7); + paramFns.push_back(std::move(x2)); + paramFns.push_back(std::move(y2)); + paramFns.push_back(std::move(theta2)); + paramFns.push_back(std::move(x)); + paramFns.push_back(std::move(y)); + paramFns.push_back(std::move(theta)); + paramFns.push_back(std::move(ts)); +} + +VarVal EverNePoseTposePhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto x2 = paramFns[0].execute(record, arena).cast(); + auto y2 = paramFns[1].execute(record, arena).cast(); + auto theta2 = paramFns[2].execute(record, arena).cast(); + auto x = paramFns[3].execute(record, arena).cast(); + auto y = paramFns[4].execute(record, arena).cast(); + auto theta = paramFns[5].execute(record, arena).cast(); + auto ts = paramFns[6].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](double x2, double y2, double theta2, double x, double y, double theta, uint64_t ts) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + Pose* pose_s = pose_make_2d(x2, y2, theta2, false, 0); + if (!pose_s) return 0.0; + Pose* pose_t = pose_make_2d(x, y, theta, false, 0); + if (!pose_t) { free(pose_s); return 0.0; } + Temporal* inst = (Temporal*)tposeinst_make(pose_t, (TimestampTz)ts); + free(pose_t); + if (!inst) { free(pose_s); return 0.0; } + int r = ever_ne_pose_tpose(pose_s, inst); + free(pose_s); free(inst); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + x2, y2, theta2, x, y, theta, ts); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverNePoseTposePhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 7, + "EverNePoseTposePhysicalFunction requires 7 children but got {}", + arguments.childFunctions.size()); + return EverNePoseTposePhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4]), + std::move(arguments.childFunctions[5]), + std::move(arguments.childFunctions[6])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverNeTposePosePhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverNeTposePosePhysicalFunction.cpp new file mode 100644 index 0000000000..99f9def5be --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverNeTposePosePhysicalFunction.cpp @@ -0,0 +1,94 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +EverNeTposePosePhysicalFunction::EverNeTposePosePhysicalFunction(PhysicalFunction x, PhysicalFunction y, PhysicalFunction theta, PhysicalFunction ts, PhysicalFunction x2, PhysicalFunction y2, PhysicalFunction theta2) +{ + paramFns.reserve(7); + paramFns.push_back(std::move(x)); + paramFns.push_back(std::move(y)); + paramFns.push_back(std::move(theta)); + paramFns.push_back(std::move(ts)); + paramFns.push_back(std::move(x2)); + paramFns.push_back(std::move(y2)); + paramFns.push_back(std::move(theta2)); +} + +VarVal EverNeTposePosePhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto x = paramFns[0].execute(record, arena).cast(); + auto y = paramFns[1].execute(record, arena).cast(); + auto theta = paramFns[2].execute(record, arena).cast(); + auto ts = paramFns[3].execute(record, arena).cast(); + auto x2 = paramFns[4].execute(record, arena).cast(); + auto y2 = paramFns[5].execute(record, arena).cast(); + auto theta2 = paramFns[6].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](double x, double y, double theta, uint64_t ts, double x2, double y2, double theta2) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + Pose* pose1 = pose_make_2d(x, y, theta, false, 0); + if (!pose1) return 0.0; + Temporal* inst = (Temporal*)tposeinst_make(pose1, (TimestampTz)ts); + free(pose1); + if (!inst) return 0.0; + Pose* pose2 = pose_make_2d(x2, y2, theta2, false, 0); + if (!pose2) { free(inst); return 0.0; } + int r = ever_ne_tpose_pose(inst, pose2); + free(inst); free(pose2); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + x, y, theta, ts, x2, y2, theta2); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverNeTposePosePhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 7, + "EverNeTposePosePhysicalFunction requires 7 children but got {}", + arguments.childFunctions.size()); + return EverNeTposePosePhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4]), + std::move(arguments.childFunctions[5]), + std::move(arguments.childFunctions[6])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/NadTposeGeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/NadTposeGeoPhysicalFunction.cpp new file mode 100644 index 0000000000..30160666ae --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/NadTposeGeoPhysicalFunction.cpp @@ -0,0 +1,92 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +NadTposeGeoPhysicalFunction::NadTposeGeoPhysicalFunction(PhysicalFunction x, PhysicalFunction y, PhysicalFunction theta, PhysicalFunction ts, PhysicalFunction wkt) +{ + paramFns.reserve(5); + paramFns.push_back(std::move(x)); + paramFns.push_back(std::move(y)); + paramFns.push_back(std::move(theta)); + paramFns.push_back(std::move(ts)); + paramFns.push_back(std::move(wkt)); +} + +VarVal NadTposeGeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto x = paramFns[0].execute(record, arena).cast(); + auto y = paramFns[1].execute(record, arena).cast(); + auto theta = paramFns[2].execute(record, arena).cast(); + auto ts = paramFns[3].execute(record, arena).cast(); + auto wkt = paramFns[4].execute(record, arena); + const auto result = nautilus::invoke( + +[](double x, double y, double theta, uint64_t ts, const char* wkt, uint32_t wkt_len) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + Pose* pose = pose_make_2d(x, y, theta, false, 0); + if (!pose) return 0.0; + Temporal* inst = (Temporal*)tposeinst_make(pose, (TimestampTz)ts); + free(pose); + if (!inst) return 0.0; + char* wkt_str = (char*)malloc(wkt_len + 1); + memcpy(wkt_str, wkt, wkt_len); + wkt_str[wkt_len] = '\0'; + GSERIALIZED* gs = geom_in(wkt_str, -1); + free(wkt_str); + if (!gs) { free(inst); return 0.0; } + double r = nad_tpose_geo(inst, gs); + free(inst); free(gs); + return r; + } catch (const std::exception&) { return 0.0; } + }, + x, y, theta, ts, wkt); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterNadTposeGeoPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 5, + "NadTposeGeoPhysicalFunction requires 5 children but got {}", + arguments.childFunctions.size()); + return NadTposeGeoPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/NadTposePosePhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/NadTposePosePhysicalFunction.cpp new file mode 100644 index 0000000000..fe253d9ed5 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/NadTposePosePhysicalFunction.cpp @@ -0,0 +1,94 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +NadTposePosePhysicalFunction::NadTposePosePhysicalFunction(PhysicalFunction x, PhysicalFunction y, PhysicalFunction theta, PhysicalFunction ts, PhysicalFunction x2, PhysicalFunction y2, PhysicalFunction theta2) +{ + paramFns.reserve(7); + paramFns.push_back(std::move(x)); + paramFns.push_back(std::move(y)); + paramFns.push_back(std::move(theta)); + paramFns.push_back(std::move(ts)); + paramFns.push_back(std::move(x2)); + paramFns.push_back(std::move(y2)); + paramFns.push_back(std::move(theta2)); +} + +VarVal NadTposePosePhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto x = paramFns[0].execute(record, arena).cast(); + auto y = paramFns[1].execute(record, arena).cast(); + auto theta = paramFns[2].execute(record, arena).cast(); + auto ts = paramFns[3].execute(record, arena).cast(); + auto x2 = paramFns[4].execute(record, arena).cast(); + auto y2 = paramFns[5].execute(record, arena).cast(); + auto theta2 = paramFns[6].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](double x, double y, double theta, uint64_t ts, double x2, double y2, double theta2) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + Pose* pose1 = pose_make_2d(x, y, theta, false, 0); + if (!pose1) return 0.0; + Temporal* inst = (Temporal*)tposeinst_make(pose1, (TimestampTz)ts); + free(pose1); + if (!inst) return 0.0; + Pose* pose2 = pose_make_2d(x2, y2, theta2, false, 0); + if (!pose2) { free(inst); return 0.0; } + double r = nad_tpose_pose(inst, pose2); + free(inst); free(pose2); + return r; + } catch (const std::exception&) { return 0.0; } + }, + x, y, theta, ts, x2, y2, theta2); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterNadTposePosePhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 7, + "NadTposePosePhysicalFunction requires 7 children but got {}", + arguments.childFunctions.size()); + return NadTposePosePhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4]), + std::move(arguments.childFunctions[5]), + std::move(arguments.childFunctions[6])); +} + +} // namespace NES diff --git a/nes-sql-parser/AntlrSQL.g4 b/nes-sql-parser/AntlrSQL.g4 index e7d8aabfd5..a5106a3fc7 100644 --- a/nes-sql-parser/AntlrSQL.g4 +++ b/nes-sql-parser/AntlrSQL.g4 @@ -295,7 +295,7 @@ timeUnit: MS timestampParameter: name=identifier; -functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT | TGE_TTEXT_TEXT | TGE_TEXT_TTEXT | TGT_TTEXT_TEXT | TGT_TEXT_TTEXT | TLE_TTEXT_TEXT | TLE_TEXT_TTEXT | TLT_TTEXT_TEXT | TLT_TEXT_TTEXT | TTEXT_UPPER | TTEXT_LOWER | TTEXT_INITCAP | TEXTCAT_TTEXT_TEXT | TEXTCAT_TEXT_TTEXT | TEXTCAT_TTEXT_TTEXT | GEOM_LENGTH | GEOM_PERIMETER | GEOM_AZIMUTH | GEOG_AREA | GEOG_LENGTH | GEOG_PERIMETER | GEOM_IS_EMPTY | AINTERSECTS_TGEO_GEO | ACOVERS_TGEO_GEO | ADISJOINT_TGEO_GEO | ADWITHIN_TGEO_GEO | EINTERSECTS_TGEO_GEO | ETOUCHES_TGEO_GEO | ECONTAINS_TGEO_GEO | ACONTAINS_TGEO_GEO | ATOUCHES_TGEO_GEO | GEO_NUM_POINTS | GEO_NUM_GEOS | GEO_SRID | GEO_IS_UNITARY | GEO_EQUALS | GEO_SAME | GEOG_DISTANCE | NAD_TGEO_GEO | EVER_EQ_TGEO_GEO | EVER_NE_TGEO_GEO | ALWAYS_EQ_TGEO_GEO | ALWAYS_NE_TGEO_GEO | GEOG_INTERSECTS | GEOG_DWITHIN | ACOVERS_GEO_TGEO | GEOM_INTERSECTS | GEOM_DWITHIN | H3_GS_POINT_TO_CELL | EVER_EQ_TH3INDEX_H3INDEX | EVER_NE_TH3INDEX_H3INDEX | ALWAYS_EQ_TH3INDEX_H3INDEX | ALWAYS_NE_TH3INDEX_H3INDEX | TH3INDEX_GET_RESOLUTION | TH3INDEX_GET_BASE_CELL_NUMBER | TH3INDEX_IS_VALID_CELL | TH3INDEX_IS_PENTAGON | TH3INDEX_CELL_TO_PARENT_NEXT | TH3INDEX_CELL_TO_CENTER_CHILD_NEXT | TH3INDEX_CELL_TO_PARENT | TH3INDEX_CELL_TO_CENTER_CHILD | TH3INDEX_CELL_TO_CHILD_POS | TH3INDEX_ARE_NEIGHBOR_CELLS | TH3INDEX_GRID_DISTANCE | EINTERSECTS_TCBUFFER_GEO | AINTERSECTS_TCBUFFER_GEO | ECOVERS_TCBUFFER_GEO | ACOVERS_TCBUFFER_GEO | EDISJOINT_TCBUFFER_GEO | ADISJOINT_TCBUFFER_GEO | ETOUCHES_TCBUFFER_GEO | ATOUCHES_TCBUFFER_GEO | ECONTAINS_TCBUFFER_GEO | ACONTAINS_TCBUFFER_GEO | NAD_TCBUFFER_GEO | EDWITHIN_TCBUFFER_GEO | ADWITHIN_TCBUFFER_GEO | EINTERSECTS_TCBUFFER_CBUFFER | AINTERSECTS_TCBUFFER_CBUFFER | ECOVERS_TCBUFFER_CBUFFER | ACOVERS_TCBUFFER_CBUFFER | EDISJOINT_TCBUFFER_CBUFFER | ADISJOINT_TCBUFFER_CBUFFER | ETOUCHES_TCBUFFER_CBUFFER | ATOUCHES_TCBUFFER_CBUFFER | ECONTAINS_TCBUFFER_CBUFFER | ACONTAINS_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_CBUFFER | ALWAYS_EQ_TCBUFFER_CBUFFER | EVER_NE_TCBUFFER_CBUFFER | ALWAYS_NE_TCBUFFER_CBUFFER | NAD_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_TCBUFFER | ALWAYS_EQ_TCBUFFER_TCBUFFER | EVER_NE_TCBUFFER_TCBUFFER | ALWAYS_NE_TCBUFFER_TCBUFFER | EINTERSECTS_TCBUFFER_TCBUFFER | AINTERSECTS_TCBUFFER_TCBUFFER | ECOVERS_TCBUFFER_TCBUFFER | ACOVERS_TCBUFFER_TCBUFFER | ADISJOINT_TCBUFFER_TCBUFFER | ETOUCHES_TCBUFFER_TCBUFFER | ATOUCHES_TCBUFFER_TCBUFFER | NAD_TCBUFFER_TCBUFFER | EDWITHIN_TCBUFFER_TCBUFFER | ADWITHIN_TCBUFFER_TCBUFFER | MINDISTANCE_TCBUFFER_TCBUFFER | NAD_TNPOINT_GEO | EVER_EQ_TNPOINT_NPOINT | ALWAYS_EQ_TNPOINT_NPOINT | EVER_NE_TNPOINT_NPOINT | ALWAYS_NE_TNPOINT_NPOINT | NAD_TNPOINT_NPOINT | EVER_EQ_NPOINT_TNPOINT | ALWAYS_EQ_NPOINT_TNPOINT | EVER_NE_NPOINT_TNPOINT | ALWAYS_NE_NPOINT_TNPOINT | EVER_EQ_TNPOINT_TNPOINT | ALWAYS_EQ_TNPOINT_TNPOINT | EVER_NE_TNPOINT_TNPOINT | ALWAYS_NE_TNPOINT_TNPOINT | NAD_TNPOINT_TNPOINT | GEOM_INTERSECTS2D | GEOM_DWITHIN2D | GEOM_CONTAINS | GEOM_DISJOINT2D | GEOM_COVERS | GEOM_TOUCHES | GEOM_INTERSECTS3D | GEOM_DWITHIN3D | GEOM_DISTANCE2D | GEOM_DISTANCE3D; +functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT | TGE_TTEXT_TEXT | TGE_TEXT_TTEXT | TGT_TTEXT_TEXT | TGT_TEXT_TTEXT | TLE_TTEXT_TEXT | TLE_TEXT_TTEXT | TLT_TTEXT_TEXT | TLT_TEXT_TTEXT | TTEXT_UPPER | TTEXT_LOWER | TTEXT_INITCAP | TEXTCAT_TTEXT_TEXT | TEXTCAT_TEXT_TTEXT | TEXTCAT_TTEXT_TTEXT | GEOM_LENGTH | GEOM_PERIMETER | GEOM_AZIMUTH | GEOG_AREA | GEOG_LENGTH | GEOG_PERIMETER | GEOM_IS_EMPTY | AINTERSECTS_TGEO_GEO | ACOVERS_TGEO_GEO | ADISJOINT_TGEO_GEO | ADWITHIN_TGEO_GEO | EINTERSECTS_TGEO_GEO | ETOUCHES_TGEO_GEO | ECONTAINS_TGEO_GEO | ACONTAINS_TGEO_GEO | ATOUCHES_TGEO_GEO | GEO_NUM_POINTS | GEO_NUM_GEOS | GEO_SRID | GEO_IS_UNITARY | GEO_EQUALS | GEO_SAME | GEOG_DISTANCE | NAD_TGEO_GEO | EVER_EQ_TGEO_GEO | EVER_NE_TGEO_GEO | ALWAYS_EQ_TGEO_GEO | ALWAYS_NE_TGEO_GEO | GEOG_INTERSECTS | GEOG_DWITHIN | ACOVERS_GEO_TGEO | GEOM_INTERSECTS | GEOM_DWITHIN | H3_GS_POINT_TO_CELL | EVER_EQ_TH3INDEX_H3INDEX | EVER_NE_TH3INDEX_H3INDEX | ALWAYS_EQ_TH3INDEX_H3INDEX | ALWAYS_NE_TH3INDEX_H3INDEX | TH3INDEX_GET_RESOLUTION | TH3INDEX_GET_BASE_CELL_NUMBER | TH3INDEX_IS_VALID_CELL | TH3INDEX_IS_PENTAGON | TH3INDEX_CELL_TO_PARENT_NEXT | TH3INDEX_CELL_TO_CENTER_CHILD_NEXT | TH3INDEX_CELL_TO_PARENT | TH3INDEX_CELL_TO_CENTER_CHILD | TH3INDEX_CELL_TO_CHILD_POS | TH3INDEX_ARE_NEIGHBOR_CELLS | TH3INDEX_GRID_DISTANCE | EINTERSECTS_TCBUFFER_GEO | AINTERSECTS_TCBUFFER_GEO | ECOVERS_TCBUFFER_GEO | ACOVERS_TCBUFFER_GEO | EDISJOINT_TCBUFFER_GEO | ADISJOINT_TCBUFFER_GEO | ETOUCHES_TCBUFFER_GEO | ATOUCHES_TCBUFFER_GEO | ECONTAINS_TCBUFFER_GEO | ACONTAINS_TCBUFFER_GEO | NAD_TCBUFFER_GEO | EDWITHIN_TCBUFFER_GEO | ADWITHIN_TCBUFFER_GEO | EINTERSECTS_TCBUFFER_CBUFFER | AINTERSECTS_TCBUFFER_CBUFFER | ECOVERS_TCBUFFER_CBUFFER | ACOVERS_TCBUFFER_CBUFFER | EDISJOINT_TCBUFFER_CBUFFER | ADISJOINT_TCBUFFER_CBUFFER | ETOUCHES_TCBUFFER_CBUFFER | ATOUCHES_TCBUFFER_CBUFFER | ECONTAINS_TCBUFFER_CBUFFER | ACONTAINS_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_CBUFFER | ALWAYS_EQ_TCBUFFER_CBUFFER | EVER_NE_TCBUFFER_CBUFFER | ALWAYS_NE_TCBUFFER_CBUFFER | NAD_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_TCBUFFER | ALWAYS_EQ_TCBUFFER_TCBUFFER | EVER_NE_TCBUFFER_TCBUFFER | ALWAYS_NE_TCBUFFER_TCBUFFER | EINTERSECTS_TCBUFFER_TCBUFFER | AINTERSECTS_TCBUFFER_TCBUFFER | ECOVERS_TCBUFFER_TCBUFFER | ACOVERS_TCBUFFER_TCBUFFER | ADISJOINT_TCBUFFER_TCBUFFER | ETOUCHES_TCBUFFER_TCBUFFER | ATOUCHES_TCBUFFER_TCBUFFER | NAD_TCBUFFER_TCBUFFER | EDWITHIN_TCBUFFER_TCBUFFER | ADWITHIN_TCBUFFER_TCBUFFER | MINDISTANCE_TCBUFFER_TCBUFFER | NAD_TNPOINT_GEO | EVER_EQ_TNPOINT_NPOINT | ALWAYS_EQ_TNPOINT_NPOINT | EVER_NE_TNPOINT_NPOINT | ALWAYS_NE_TNPOINT_NPOINT | NAD_TNPOINT_NPOINT | EVER_EQ_NPOINT_TNPOINT | ALWAYS_EQ_NPOINT_TNPOINT | EVER_NE_NPOINT_TNPOINT | ALWAYS_NE_NPOINT_TNPOINT | EVER_EQ_TNPOINT_TNPOINT | ALWAYS_EQ_TNPOINT_TNPOINT | EVER_NE_TNPOINT_TNPOINT | ALWAYS_NE_TNPOINT_TNPOINT | NAD_TNPOINT_TNPOINT | NAD_TPOSE_GEO | EVER_EQ_TPOSE_POSE | ALWAYS_EQ_TPOSE_POSE | EVER_NE_TPOSE_POSE | ALWAYS_NE_TPOSE_POSE | NAD_TPOSE_POSE | EVER_EQ_POSE_TPOSE | ALWAYS_EQ_POSE_TPOSE | EVER_NE_POSE_TPOSE | ALWAYS_NE_POSE_TPOSE | GEOM_INTERSECTS2D | GEOM_DWITHIN2D | GEOM_CONTAINS | GEOM_DISJOINT2D | GEOM_COVERS | GEOM_TOUCHES | GEOM_INTERSECTS3D | GEOM_DWITHIN3D | GEOM_DISTANCE2D | GEOM_DISTANCE3D; sinkClause: INTO sink (',' sink)*; @@ -865,6 +865,16 @@ ALWAYS_EQ_TNPOINT_TNPOINT: 'ALWAYS_EQ_TNPOINT_TNPOINT' | 'always_eq_tnpoint_tnpo EVER_NE_TNPOINT_TNPOINT: 'EVER_NE_TNPOINT_TNPOINT' | 'ever_ne_tnpoint_tnpoint'; ALWAYS_NE_TNPOINT_TNPOINT: 'ALWAYS_NE_TNPOINT_TNPOINT' | 'always_ne_tnpoint_tnpoint'; NAD_TNPOINT_TNPOINT: 'NAD_TNPOINT_TNPOINT' | 'nad_tnpoint_tnpoint'; +NAD_TPOSE_GEO: 'NAD_TPOSE_GEO' | 'nad_tpose_geo'; +EVER_EQ_TPOSE_POSE: 'EVER_EQ_TPOSE_POSE' | 'ever_eq_tpose_pose'; +ALWAYS_EQ_TPOSE_POSE: 'ALWAYS_EQ_TPOSE_POSE' | 'always_eq_tpose_pose'; +EVER_NE_TPOSE_POSE: 'EVER_NE_TPOSE_POSE' | 'ever_ne_tpose_pose'; +ALWAYS_NE_TPOSE_POSE: 'ALWAYS_NE_TPOSE_POSE' | 'always_ne_tpose_pose'; +NAD_TPOSE_POSE: 'NAD_TPOSE_POSE' | 'nad_tpose_pose'; +EVER_EQ_POSE_TPOSE: 'EVER_EQ_POSE_TPOSE' | 'ever_eq_pose_tpose'; +ALWAYS_EQ_POSE_TPOSE: 'ALWAYS_EQ_POSE_TPOSE' | 'always_eq_pose_tpose'; +EVER_NE_POSE_TPOSE: 'EVER_NE_POSE_TPOSE' | 'ever_ne_pose_tpose'; +ALWAYS_NE_POSE_TPOSE: 'ALWAYS_NE_POSE_TPOSE' | 'always_ne_pose_tpose'; GEOM_INTERSECTS2D: 'GEOM_INTERSECTS2D' | 'geom_intersects2d'; GEOM_DWITHIN2D: 'GEOM_DWITHIN2D' | 'geom_dwithin2d'; GEOM_CONTAINS: 'GEOM_CONTAINS' | 'geom_contains'; diff --git a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp index 94f98122e2..3ef07fe59e 100644 --- a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp +++ b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp @@ -446,6 +446,16 @@ #include #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include @@ -10132,6 +10142,144 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont return LogicalFunction(NadTnpointTnpointLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5))); } /* END CODEGEN PARSER GLUE: NAD_TNPOINT_TNPOINT */ + case AntlrSQLParser::NAD_TPOSE_GEO: { + PRECONDITION(ctx->functionParam().size() == 5, + "NadTposeGeo requires 5 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + return LogicalFunction(NadTposeGeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4))); + } + /* END CODEGEN PARSER GLUE: NAD_TPOSE_GEO */ + case AntlrSQLParser::EVER_EQ_TPOSE_POSE: { + PRECONDITION(ctx->functionParam().size() == 7, + "EverEqTposePose requires 7 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + auto arg5 = visit(ctx->functionParam(5)).as(); + auto arg6 = visit(ctx->functionParam(6)).as(); + return LogicalFunction(EverEqTposePoseLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6))); + } + /* END CODEGEN PARSER GLUE: EVER_EQ_TPOSE_POSE */ + case AntlrSQLParser::ALWAYS_EQ_TPOSE_POSE: { + PRECONDITION(ctx->functionParam().size() == 7, + "AlwaysEqTposePose requires 7 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + auto arg5 = visit(ctx->functionParam(5)).as(); + auto arg6 = visit(ctx->functionParam(6)).as(); + return LogicalFunction(AlwaysEqTposePoseLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6))); + } + /* END CODEGEN PARSER GLUE: ALWAYS_EQ_TPOSE_POSE */ + case AntlrSQLParser::EVER_NE_TPOSE_POSE: { + PRECONDITION(ctx->functionParam().size() == 7, + "EverNeTposePose requires 7 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + auto arg5 = visit(ctx->functionParam(5)).as(); + auto arg6 = visit(ctx->functionParam(6)).as(); + return LogicalFunction(EverNeTposePoseLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6))); + } + /* END CODEGEN PARSER GLUE: EVER_NE_TPOSE_POSE */ + case AntlrSQLParser::ALWAYS_NE_TPOSE_POSE: { + PRECONDITION(ctx->functionParam().size() == 7, + "AlwaysNeTposePose requires 7 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + auto arg5 = visit(ctx->functionParam(5)).as(); + auto arg6 = visit(ctx->functionParam(6)).as(); + return LogicalFunction(AlwaysNeTposePoseLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6))); + } + /* END CODEGEN PARSER GLUE: ALWAYS_NE_TPOSE_POSE */ + case AntlrSQLParser::NAD_TPOSE_POSE: { + PRECONDITION(ctx->functionParam().size() == 7, + "NadTposePose requires 7 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + auto arg5 = visit(ctx->functionParam(5)).as(); + auto arg6 = visit(ctx->functionParam(6)).as(); + return LogicalFunction(NadTposePoseLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6))); + } + /* END CODEGEN PARSER GLUE: NAD_TPOSE_POSE */ + case AntlrSQLParser::EVER_EQ_POSE_TPOSE: { + PRECONDITION(ctx->functionParam().size() == 7, + "EverEqPoseTpose requires 7 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + auto arg5 = visit(ctx->functionParam(5)).as(); + auto arg6 = visit(ctx->functionParam(6)).as(); + return LogicalFunction(EverEqPoseTposeLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6))); + } + /* END CODEGEN PARSER GLUE: EVER_EQ_POSE_TPOSE */ + case AntlrSQLParser::ALWAYS_EQ_POSE_TPOSE: { + PRECONDITION(ctx->functionParam().size() == 7, + "AlwaysEqPoseTpose requires 7 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + auto arg5 = visit(ctx->functionParam(5)).as(); + auto arg6 = visit(ctx->functionParam(6)).as(); + return LogicalFunction(AlwaysEqPoseTposeLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6))); + } + /* END CODEGEN PARSER GLUE: ALWAYS_EQ_POSE_TPOSE */ + case AntlrSQLParser::EVER_NE_POSE_TPOSE: { + PRECONDITION(ctx->functionParam().size() == 7, + "EverNePoseTpose requires 7 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + auto arg5 = visit(ctx->functionParam(5)).as(); + auto arg6 = visit(ctx->functionParam(6)).as(); + return LogicalFunction(EverNePoseTposeLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6))); + } + /* END CODEGEN PARSER GLUE: EVER_NE_POSE_TPOSE */ + case AntlrSQLParser::ALWAYS_NE_POSE_TPOSE: { + PRECONDITION(ctx->functionParam().size() == 7, + "AlwaysNePoseTpose requires 7 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + auto arg5 = visit(ctx->functionParam(5)).as(); + auto arg6 = visit(ctx->functionParam(6)).as(); + return LogicalFunction(AlwaysNePoseTposeLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6))); + } + /* END CODEGEN PARSER GLUE: ALWAYS_NE_POSE_TPOSE */ /* END CODEGEN PARSER GLUE: GEOM_INTERSECTS2D */ case AntlrSQLParser::GEOM_DWITHIN2D: { PRECONDITION(ctx->functionParam().size() == 3, From f18c160345027669d2d4993da8d2a3882f86dcd3 Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Mon, 15 Jun 2026 08:57:58 +0200 Subject: [PATCH 69/96] feat(meos): add tpose_tpose 2D per-event scalar operators (W121) 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). --- .../AlwaysEqTposeTposeLogicalFunction.hpp | 54 ++++++++ .../AlwaysNeTposeTposeLogicalFunction.hpp | 54 ++++++++ .../Meos/EverEqTposeTposeLogicalFunction.hpp | 54 ++++++++ .../Meos/EverNeTposeTposeLogicalFunction.hpp | 54 ++++++++ .../Meos/NadTposeTposeLogicalFunction.hpp | 54 ++++++++ .../AlwaysEqTposeTposeLogicalFunction.cpp | 118 ++++++++++++++++++ .../AlwaysNeTposeTposeLogicalFunction.cpp | 118 ++++++++++++++++++ .../src/Functions/Meos/CMakeLists.txt | 5 + .../Meos/EverEqTposeTposeLogicalFunction.cpp | 118 ++++++++++++++++++ .../Meos/EverNeTposeTposeLogicalFunction.cpp | 118 ++++++++++++++++++ .../Meos/NadTposeTposeLogicalFunction.cpp | 118 ++++++++++++++++++ .../AlwaysEqTposeTposePhysicalFunction.hpp | 35 ++++++ .../AlwaysNeTposeTposePhysicalFunction.hpp | 35 ++++++ .../Meos/EverEqTposeTposePhysicalFunction.hpp | 35 ++++++ .../Meos/EverNeTposeTposePhysicalFunction.hpp | 35 ++++++ .../Meos/NadTposeTposePhysicalFunction.hpp | 35 ++++++ .../AlwaysEqTposeTposePhysicalFunction.cpp | 102 +++++++++++++++ .../AlwaysNeTposeTposePhysicalFunction.cpp | 102 +++++++++++++++ .../src/Functions/Meos/CMakeLists.txt | 5 + .../Meos/EverEqTposeTposePhysicalFunction.cpp | 102 +++++++++++++++ .../Meos/EverNeTposeTposePhysicalFunction.cpp | 102 +++++++++++++++ .../Meos/NadTposeTposePhysicalFunction.cpp | 102 +++++++++++++++ nes-sql-parser/AntlrSQL.g4 | 7 +- .../src/AntlrSQLQueryPlanCreator.cpp | 80 ++++++++++++ 24 files changed, 1641 insertions(+), 1 deletion(-) create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysEqTposeTposeLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysNeTposeTposeLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverEqTposeTposeLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverNeTposeTposeLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/NadTposeTposeLogicalFunction.hpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysEqTposeTposeLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysNeTposeTposeLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverEqTposeTposeLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverNeTposeTposeLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/NadTposeTposeLogicalFunction.cpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysEqTposeTposePhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysNeTposeTposePhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverEqTposeTposePhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverNeTposeTposePhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/NadTposeTposePhysicalFunction.hpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysEqTposeTposePhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysNeTposeTposePhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverEqTposeTposePhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverNeTposeTposePhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/NadTposeTposePhysicalFunction.cpp diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysEqTposeTposeLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysEqTposeTposeLogicalFunction.hpp new file mode 100644 index 0000000000..815e30386c --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysEqTposeTposeLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if the two 2D tpose instants are always equal, 0.0 otherwise. + * + * Args: (x1:FLOAT64, y1:FLOAT64, theta1:FLOAT64, ts1:UINT64, + * x2:FLOAT64, y2:FLOAT64, theta2:FLOAT64, ts2:UINT64) -> FLOAT64. + */ +class AlwaysEqTposeTposeLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysEqTposeTpose"; + + AlwaysEqTposeTposeLogicalFunction(LogicalFunction x1, LogicalFunction y1, LogicalFunction theta1, + LogicalFunction ts1, + LogicalFunction x2, LogicalFunction y2, LogicalFunction theta2, + LogicalFunction ts2); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysNeTposeTposeLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysNeTposeTposeLogicalFunction.hpp new file mode 100644 index 0000000000..17975a44dc --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysNeTposeTposeLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if the two 2D tpose instants are always not equal, 0.0 otherwise. + * + * Args: (x1:FLOAT64, y1:FLOAT64, theta1:FLOAT64, ts1:UINT64, + * x2:FLOAT64, y2:FLOAT64, theta2:FLOAT64, ts2:UINT64) -> FLOAT64. + */ +class AlwaysNeTposeTposeLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysNeTposeTpose"; + + AlwaysNeTposeTposeLogicalFunction(LogicalFunction x1, LogicalFunction y1, LogicalFunction theta1, + LogicalFunction ts1, + LogicalFunction x2, LogicalFunction y2, LogicalFunction theta2, + LogicalFunction ts2); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverEqTposeTposeLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverEqTposeTposeLogicalFunction.hpp new file mode 100644 index 0000000000..5942a053fe --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverEqTposeTposeLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if the two 2D tpose instants are ever equal, 0.0 otherwise. + * + * Args: (x1:FLOAT64, y1:FLOAT64, theta1:FLOAT64, ts1:UINT64, + * x2:FLOAT64, y2:FLOAT64, theta2:FLOAT64, ts2:UINT64) -> FLOAT64. + */ +class EverEqTposeTposeLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverEqTposeTpose"; + + EverEqTposeTposeLogicalFunction(LogicalFunction x1, LogicalFunction y1, LogicalFunction theta1, + LogicalFunction ts1, + LogicalFunction x2, LogicalFunction y2, LogicalFunction theta2, + LogicalFunction ts2); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverNeTposeTposeLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverNeTposeTposeLogicalFunction.hpp new file mode 100644 index 0000000000..3a7388923b --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverNeTposeTposeLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if the two 2D tpose instants are ever not equal, 0.0 otherwise. + * + * Args: (x1:FLOAT64, y1:FLOAT64, theta1:FLOAT64, ts1:UINT64, + * x2:FLOAT64, y2:FLOAT64, theta2:FLOAT64, ts2:UINT64) -> FLOAT64. + */ +class EverNeTposeTposeLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverNeTposeTpose"; + + EverNeTposeTposeLogicalFunction(LogicalFunction x1, LogicalFunction y1, LogicalFunction theta1, + LogicalFunction ts1, + LogicalFunction x2, LogicalFunction y2, LogicalFunction theta2, + LogicalFunction ts2); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/NadTposeTposeLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/NadTposeTposeLogicalFunction.hpp new file mode 100644 index 0000000000..3d09da1b7b --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/NadTposeTposeLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns the nearest approach distance between two 2D tpose instants. + * + * Args: (x1:FLOAT64, y1:FLOAT64, theta1:FLOAT64, ts1:UINT64, + * x2:FLOAT64, y2:FLOAT64, theta2:FLOAT64, ts2:UINT64) -> FLOAT64. + */ +class NadTposeTposeLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "NadTposeTpose"; + + NadTposeTposeLogicalFunction(LogicalFunction x1, LogicalFunction y1, LogicalFunction theta1, + LogicalFunction ts1, + LogicalFunction x2, LogicalFunction y2, LogicalFunction theta2, + LogicalFunction ts2); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysEqTposeTposeLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysEqTposeTposeLogicalFunction.cpp new file mode 100644 index 0000000000..f3276aa7c8 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysEqTposeTposeLogicalFunction.cpp @@ -0,0 +1,118 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AlwaysEqTposeTposeLogicalFunction::AlwaysEqTposeTposeLogicalFunction( + LogicalFunction x1, LogicalFunction y1, LogicalFunction theta1, LogicalFunction ts1, + LogicalFunction x2, LogicalFunction y2, LogicalFunction theta2, LogicalFunction ts2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(8); + parameters.push_back(std::move(x1)); + parameters.push_back(std::move(y1)); + parameters.push_back(std::move(theta1)); + parameters.push_back(std::move(ts1)); + parameters.push_back(std::move(x2)); + parameters.push_back(std::move(y2)); + parameters.push_back(std::move(theta2)); + parameters.push_back(std::move(ts2)); +} + +DataType AlwaysEqTposeTposeLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysEqTposeTposeLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AlwaysEqTposeTposeLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysEqTposeTposeLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 8, + "AlwaysEqTposeTposeLogicalFunction requires 8 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AlwaysEqTposeTposeLogicalFunction::getType() const { return NAME; } + +bool AlwaysEqTposeTposeLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AlwaysEqTposeTposeLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction AlwaysEqTposeTposeLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(8); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "x1 must be FLOAT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "y1 must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "theta1 must be FLOAT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "x2 must be FLOAT64"); + INVARIANT(c[5].getDataType().isType(DataType::Type::FLOAT64), "y2 must be FLOAT64"); + INVARIANT(c[6].getDataType().isType(DataType::Type::FLOAT64), "theta2 must be FLOAT64"); + INVARIANT(c[7].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); + return withChildren(c); +} + +SerializableFunction AlwaysEqTposeTposeLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysEqTposeTposeLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 8, + "AlwaysEqTposeTposeLogicalFunction requires 8 children but got {}", + arguments.children.size()); + return AlwaysEqTposeTposeLogicalFunction(std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4]), + std::move(arguments.children[5]), + std::move(arguments.children[6]), + std::move(arguments.children[7])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysNeTposeTposeLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysNeTposeTposeLogicalFunction.cpp new file mode 100644 index 0000000000..8990844640 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysNeTposeTposeLogicalFunction.cpp @@ -0,0 +1,118 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AlwaysNeTposeTposeLogicalFunction::AlwaysNeTposeTposeLogicalFunction( + LogicalFunction x1, LogicalFunction y1, LogicalFunction theta1, LogicalFunction ts1, + LogicalFunction x2, LogicalFunction y2, LogicalFunction theta2, LogicalFunction ts2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(8); + parameters.push_back(std::move(x1)); + parameters.push_back(std::move(y1)); + parameters.push_back(std::move(theta1)); + parameters.push_back(std::move(ts1)); + parameters.push_back(std::move(x2)); + parameters.push_back(std::move(y2)); + parameters.push_back(std::move(theta2)); + parameters.push_back(std::move(ts2)); +} + +DataType AlwaysNeTposeTposeLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysNeTposeTposeLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AlwaysNeTposeTposeLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysNeTposeTposeLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 8, + "AlwaysNeTposeTposeLogicalFunction requires 8 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AlwaysNeTposeTposeLogicalFunction::getType() const { return NAME; } + +bool AlwaysNeTposeTposeLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AlwaysNeTposeTposeLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction AlwaysNeTposeTposeLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(8); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "x1 must be FLOAT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "y1 must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "theta1 must be FLOAT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "x2 must be FLOAT64"); + INVARIANT(c[5].getDataType().isType(DataType::Type::FLOAT64), "y2 must be FLOAT64"); + INVARIANT(c[6].getDataType().isType(DataType::Type::FLOAT64), "theta2 must be FLOAT64"); + INVARIANT(c[7].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); + return withChildren(c); +} + +SerializableFunction AlwaysNeTposeTposeLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysNeTposeTposeLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 8, + "AlwaysNeTposeTposeLogicalFunction requires 8 children but got {}", + arguments.children.size()); + return AlwaysNeTposeTposeLogicalFunction(std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4]), + std::move(arguments.children[5]), + std::move(arguments.children[6]), + std::move(arguments.children[7])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt index ac864b86b8..e992c8d631 100644 --- a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt @@ -405,6 +405,11 @@ add_plugin(EverEqPoseTpose LogicalFunction nes-logical-operators EverEqPoseTpose add_plugin(AlwaysEqPoseTpose LogicalFunction nes-logical-operators AlwaysEqPoseTposeLogicalFunction.cpp) add_plugin(EverNePoseTpose LogicalFunction nes-logical-operators EverNePoseTposeLogicalFunction.cpp) add_plugin(AlwaysNePoseTpose LogicalFunction nes-logical-operators AlwaysNePoseTposeLogicalFunction.cpp) +add_plugin(EverEqTposeTpose LogicalFunction nes-logical-operators EverEqTposeTposeLogicalFunction.cpp) +add_plugin(AlwaysEqTposeTpose LogicalFunction nes-logical-operators AlwaysEqTposeTposeLogicalFunction.cpp) +add_plugin(EverNeTposeTpose LogicalFunction nes-logical-operators EverNeTposeTposeLogicalFunction.cpp) +add_plugin(AlwaysNeTposeTpose LogicalFunction nes-logical-operators AlwaysNeTposeTposeLogicalFunction.cpp) +add_plugin(NadTposeTpose LogicalFunction nes-logical-operators NadTposeTposeLogicalFunction.cpp) add_plugin(GeomIntersects2d LogicalFunction nes-logical-operators GeomIntersects2dLogicalFunction.cpp) add_plugin(GeomDwithin2d LogicalFunction nes-logical-operators GeomDwithin2dLogicalFunction.cpp) add_plugin(GeomContains LogicalFunction nes-logical-operators GeomContainsLogicalFunction.cpp) diff --git a/nes-logical-operators/src/Functions/Meos/EverEqTposeTposeLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverEqTposeTposeLogicalFunction.cpp new file mode 100644 index 0000000000..cb9c20bc8c --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverEqTposeTposeLogicalFunction.cpp @@ -0,0 +1,118 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EverEqTposeTposeLogicalFunction::EverEqTposeTposeLogicalFunction( + LogicalFunction x1, LogicalFunction y1, LogicalFunction theta1, LogicalFunction ts1, + LogicalFunction x2, LogicalFunction y2, LogicalFunction theta2, LogicalFunction ts2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(8); + parameters.push_back(std::move(x1)); + parameters.push_back(std::move(y1)); + parameters.push_back(std::move(theta1)); + parameters.push_back(std::move(ts1)); + parameters.push_back(std::move(x2)); + parameters.push_back(std::move(y2)); + parameters.push_back(std::move(theta2)); + parameters.push_back(std::move(ts2)); +} + +DataType EverEqTposeTposeLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverEqTposeTposeLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EverEqTposeTposeLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverEqTposeTposeLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 8, + "EverEqTposeTposeLogicalFunction requires 8 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EverEqTposeTposeLogicalFunction::getType() const { return NAME; } + +bool EverEqTposeTposeLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EverEqTposeTposeLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction EverEqTposeTposeLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(8); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "x1 must be FLOAT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "y1 must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "theta1 must be FLOAT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "x2 must be FLOAT64"); + INVARIANT(c[5].getDataType().isType(DataType::Type::FLOAT64), "y2 must be FLOAT64"); + INVARIANT(c[6].getDataType().isType(DataType::Type::FLOAT64), "theta2 must be FLOAT64"); + INVARIANT(c[7].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); + return withChildren(c); +} + +SerializableFunction EverEqTposeTposeLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverEqTposeTposeLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 8, + "EverEqTposeTposeLogicalFunction requires 8 children but got {}", + arguments.children.size()); + return EverEqTposeTposeLogicalFunction(std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4]), + std::move(arguments.children[5]), + std::move(arguments.children[6]), + std::move(arguments.children[7])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverNeTposeTposeLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverNeTposeTposeLogicalFunction.cpp new file mode 100644 index 0000000000..0dfd61bc1a --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverNeTposeTposeLogicalFunction.cpp @@ -0,0 +1,118 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EverNeTposeTposeLogicalFunction::EverNeTposeTposeLogicalFunction( + LogicalFunction x1, LogicalFunction y1, LogicalFunction theta1, LogicalFunction ts1, + LogicalFunction x2, LogicalFunction y2, LogicalFunction theta2, LogicalFunction ts2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(8); + parameters.push_back(std::move(x1)); + parameters.push_back(std::move(y1)); + parameters.push_back(std::move(theta1)); + parameters.push_back(std::move(ts1)); + parameters.push_back(std::move(x2)); + parameters.push_back(std::move(y2)); + parameters.push_back(std::move(theta2)); + parameters.push_back(std::move(ts2)); +} + +DataType EverNeTposeTposeLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverNeTposeTposeLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EverNeTposeTposeLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverNeTposeTposeLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 8, + "EverNeTposeTposeLogicalFunction requires 8 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EverNeTposeTposeLogicalFunction::getType() const { return NAME; } + +bool EverNeTposeTposeLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EverNeTposeTposeLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction EverNeTposeTposeLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(8); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "x1 must be FLOAT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "y1 must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "theta1 must be FLOAT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "x2 must be FLOAT64"); + INVARIANT(c[5].getDataType().isType(DataType::Type::FLOAT64), "y2 must be FLOAT64"); + INVARIANT(c[6].getDataType().isType(DataType::Type::FLOAT64), "theta2 must be FLOAT64"); + INVARIANT(c[7].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); + return withChildren(c); +} + +SerializableFunction EverNeTposeTposeLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverNeTposeTposeLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 8, + "EverNeTposeTposeLogicalFunction requires 8 children but got {}", + arguments.children.size()); + return EverNeTposeTposeLogicalFunction(std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4]), + std::move(arguments.children[5]), + std::move(arguments.children[6]), + std::move(arguments.children[7])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/NadTposeTposeLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/NadTposeTposeLogicalFunction.cpp new file mode 100644 index 0000000000..e311b3d71f --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/NadTposeTposeLogicalFunction.cpp @@ -0,0 +1,118 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +NadTposeTposeLogicalFunction::NadTposeTposeLogicalFunction( + LogicalFunction x1, LogicalFunction y1, LogicalFunction theta1, LogicalFunction ts1, + LogicalFunction x2, LogicalFunction y2, LogicalFunction theta2, LogicalFunction ts2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(8); + parameters.push_back(std::move(x1)); + parameters.push_back(std::move(y1)); + parameters.push_back(std::move(theta1)); + parameters.push_back(std::move(ts1)); + parameters.push_back(std::move(x2)); + parameters.push_back(std::move(y2)); + parameters.push_back(std::move(theta2)); + parameters.push_back(std::move(ts2)); +} + +DataType NadTposeTposeLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction NadTposeTposeLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector NadTposeTposeLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction NadTposeTposeLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 8, + "NadTposeTposeLogicalFunction requires 8 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view NadTposeTposeLogicalFunction::getType() const { return NAME; } + +bool NadTposeTposeLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string NadTposeTposeLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction NadTposeTposeLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(8); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "x1 must be FLOAT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "y1 must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "theta1 must be FLOAT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "x2 must be FLOAT64"); + INVARIANT(c[5].getDataType().isType(DataType::Type::FLOAT64), "y2 must be FLOAT64"); + INVARIANT(c[6].getDataType().isType(DataType::Type::FLOAT64), "theta2 must be FLOAT64"); + INVARIANT(c[7].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); + return withChildren(c); +} + +SerializableFunction NadTposeTposeLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterNadTposeTposeLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 8, + "NadTposeTposeLogicalFunction requires 8 children but got {}", + arguments.children.size()); + return NadTposeTposeLogicalFunction(std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4]), + std::move(arguments.children[5]), + std::move(arguments.children[6]), + std::move(arguments.children[7])); +} + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysEqTposeTposePhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysEqTposeTposePhysicalFunction.hpp new file mode 100644 index 0000000000..16cfd9d3d2 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysEqTposeTposePhysicalFunction.hpp @@ -0,0 +1,35 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class AlwaysEqTposeTposePhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysEqTposeTposePhysicalFunction(PhysicalFunction x1, PhysicalFunction y1, PhysicalFunction theta1, + PhysicalFunction ts1, + PhysicalFunction x2, PhysicalFunction y2, PhysicalFunction theta2, + PhysicalFunction ts2); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysNeTposeTposePhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysNeTposeTposePhysicalFunction.hpp new file mode 100644 index 0000000000..b31cf86f60 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysNeTposeTposePhysicalFunction.hpp @@ -0,0 +1,35 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class AlwaysNeTposeTposePhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysNeTposeTposePhysicalFunction(PhysicalFunction x1, PhysicalFunction y1, PhysicalFunction theta1, + PhysicalFunction ts1, + PhysicalFunction x2, PhysicalFunction y2, PhysicalFunction theta2, + PhysicalFunction ts2); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverEqTposeTposePhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverEqTposeTposePhysicalFunction.hpp new file mode 100644 index 0000000000..56abe9061c --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverEqTposeTposePhysicalFunction.hpp @@ -0,0 +1,35 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class EverEqTposeTposePhysicalFunction : public PhysicalFunctionConcept { +public: + EverEqTposeTposePhysicalFunction(PhysicalFunction x1, PhysicalFunction y1, PhysicalFunction theta1, + PhysicalFunction ts1, + PhysicalFunction x2, PhysicalFunction y2, PhysicalFunction theta2, + PhysicalFunction ts2); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverNeTposeTposePhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverNeTposeTposePhysicalFunction.hpp new file mode 100644 index 0000000000..06e0615b1b --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverNeTposeTposePhysicalFunction.hpp @@ -0,0 +1,35 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class EverNeTposeTposePhysicalFunction : public PhysicalFunctionConcept { +public: + EverNeTposeTposePhysicalFunction(PhysicalFunction x1, PhysicalFunction y1, PhysicalFunction theta1, + PhysicalFunction ts1, + PhysicalFunction x2, PhysicalFunction y2, PhysicalFunction theta2, + PhysicalFunction ts2); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/NadTposeTposePhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/NadTposeTposePhysicalFunction.hpp new file mode 100644 index 0000000000..b5f2e25824 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/NadTposeTposePhysicalFunction.hpp @@ -0,0 +1,35 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class NadTposeTposePhysicalFunction : public PhysicalFunctionConcept { +public: + NadTposeTposePhysicalFunction(PhysicalFunction x1, PhysicalFunction y1, PhysicalFunction theta1, + PhysicalFunction ts1, + PhysicalFunction x2, PhysicalFunction y2, PhysicalFunction theta2, + PhysicalFunction ts2); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysEqTposeTposePhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysEqTposeTposePhysicalFunction.cpp new file mode 100644 index 0000000000..18dd6ab81e --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysEqTposeTposePhysicalFunction.cpp @@ -0,0 +1,102 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +AlwaysEqTposeTposePhysicalFunction::AlwaysEqTposeTposePhysicalFunction( + PhysicalFunction x1, PhysicalFunction y1, PhysicalFunction theta1, PhysicalFunction ts1, + PhysicalFunction x2, PhysicalFunction y2, PhysicalFunction theta2, PhysicalFunction ts2) +{ + paramFns.reserve(8); + paramFns.push_back(std::move(x1)); + paramFns.push_back(std::move(y1)); + paramFns.push_back(std::move(theta1)); + paramFns.push_back(std::move(ts1)); + paramFns.push_back(std::move(x2)); + paramFns.push_back(std::move(y2)); + paramFns.push_back(std::move(theta2)); + paramFns.push_back(std::move(ts2)); +} + +VarVal AlwaysEqTposeTposePhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto x1 = paramFns[0].execute(record, arena).cast(); + auto y1 = paramFns[1].execute(record, arena).cast(); + auto theta1 = paramFns[2].execute(record, arena).cast(); + auto ts1 = paramFns[3].execute(record, arena).cast(); + auto x2 = paramFns[4].execute(record, arena).cast(); + auto y2 = paramFns[5].execute(record, arena).cast(); + auto theta2 = paramFns[6].execute(record, arena).cast(); + auto ts2 = paramFns[7].execute(record, arena).cast(); + + const auto result = nautilus::invoke( + +[](double x1, double y1, double theta1, uint64_t ts1, + double x2, double y2, double theta2, uint64_t ts2) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + Pose* p1 = pose_make_2d(x1, y1, theta1, false, 0); + if (!p1) return 0.0; + Temporal* inst1 = (Temporal*)tposeinst_make(p1, (TimestampTz)ts1); + free(p1); + if (!inst1) return 0.0; + Pose* p2 = pose_make_2d(x2, y2, theta2, false, 0); + if (!p2) { free(inst1); return 0.0; } + Temporal* inst2 = (Temporal*)tposeinst_make(p2, (TimestampTz)ts2); + free(p2); + if (!inst2) { free(inst1); return 0.0; } + int r = always_eq_tpose_tpose(inst1, inst2); + free(inst1); free(inst2); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + x1, y1, theta1, ts1, x2, y2, theta2, ts2); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysEqTposeTposePhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 8, + "AlwaysEqTposeTposePhysicalFunction requires 8 children but got {}", + arguments.childFunctions.size()); + return AlwaysEqTposeTposePhysicalFunction(std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4]), + std::move(arguments.childFunctions[5]), + std::move(arguments.childFunctions[6]), + std::move(arguments.childFunctions[7])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysNeTposeTposePhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysNeTposeTposePhysicalFunction.cpp new file mode 100644 index 0000000000..5f716ed3ed --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysNeTposeTposePhysicalFunction.cpp @@ -0,0 +1,102 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +AlwaysNeTposeTposePhysicalFunction::AlwaysNeTposeTposePhysicalFunction( + PhysicalFunction x1, PhysicalFunction y1, PhysicalFunction theta1, PhysicalFunction ts1, + PhysicalFunction x2, PhysicalFunction y2, PhysicalFunction theta2, PhysicalFunction ts2) +{ + paramFns.reserve(8); + paramFns.push_back(std::move(x1)); + paramFns.push_back(std::move(y1)); + paramFns.push_back(std::move(theta1)); + paramFns.push_back(std::move(ts1)); + paramFns.push_back(std::move(x2)); + paramFns.push_back(std::move(y2)); + paramFns.push_back(std::move(theta2)); + paramFns.push_back(std::move(ts2)); +} + +VarVal AlwaysNeTposeTposePhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto x1 = paramFns[0].execute(record, arena).cast(); + auto y1 = paramFns[1].execute(record, arena).cast(); + auto theta1 = paramFns[2].execute(record, arena).cast(); + auto ts1 = paramFns[3].execute(record, arena).cast(); + auto x2 = paramFns[4].execute(record, arena).cast(); + auto y2 = paramFns[5].execute(record, arena).cast(); + auto theta2 = paramFns[6].execute(record, arena).cast(); + auto ts2 = paramFns[7].execute(record, arena).cast(); + + const auto result = nautilus::invoke( + +[](double x1, double y1, double theta1, uint64_t ts1, + double x2, double y2, double theta2, uint64_t ts2) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + Pose* p1 = pose_make_2d(x1, y1, theta1, false, 0); + if (!p1) return 0.0; + Temporal* inst1 = (Temporal*)tposeinst_make(p1, (TimestampTz)ts1); + free(p1); + if (!inst1) return 0.0; + Pose* p2 = pose_make_2d(x2, y2, theta2, false, 0); + if (!p2) { free(inst1); return 0.0; } + Temporal* inst2 = (Temporal*)tposeinst_make(p2, (TimestampTz)ts2); + free(p2); + if (!inst2) { free(inst1); return 0.0; } + int r = always_ne_tpose_tpose(inst1, inst2); + free(inst1); free(inst2); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + x1, y1, theta1, ts1, x2, y2, theta2, ts2); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysNeTposeTposePhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 8, + "AlwaysNeTposeTposePhysicalFunction requires 8 children but got {}", + arguments.childFunctions.size()); + return AlwaysNeTposeTposePhysicalFunction(std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4]), + std::move(arguments.childFunctions[5]), + std::move(arguments.childFunctions[6]), + std::move(arguments.childFunctions[7])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt index bf02960bf3..cd5a4e12d5 100644 --- a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt @@ -404,6 +404,11 @@ add_plugin(EverEqPoseTpose PhysicalFunction nes-physical-operators EverEqPoseTpo add_plugin(AlwaysEqPoseTpose PhysicalFunction nes-physical-operators AlwaysEqPoseTposePhysicalFunction.cpp) add_plugin(EverNePoseTpose PhysicalFunction nes-physical-operators EverNePoseTposePhysicalFunction.cpp) add_plugin(AlwaysNePoseTpose PhysicalFunction nes-physical-operators AlwaysNePoseTposePhysicalFunction.cpp) +add_plugin(EverEqTposeTpose PhysicalFunction nes-physical-operators EverEqTposeTposePhysicalFunction.cpp) +add_plugin(AlwaysEqTposeTpose PhysicalFunction nes-physical-operators AlwaysEqTposeTposePhysicalFunction.cpp) +add_plugin(EverNeTposeTpose PhysicalFunction nes-physical-operators EverNeTposeTposePhysicalFunction.cpp) +add_plugin(AlwaysNeTposeTpose PhysicalFunction nes-physical-operators AlwaysNeTposeTposePhysicalFunction.cpp) +add_plugin(NadTposeTpose PhysicalFunction nes-physical-operators NadTposeTposePhysicalFunction.cpp) add_plugin(GeomIntersects2d PhysicalFunction nes-physical-operators GeomIntersects2dPhysicalFunction.cpp) add_plugin(GeomDwithin2d PhysicalFunction nes-physical-operators GeomDwithin2dPhysicalFunction.cpp) add_plugin(GeomContains PhysicalFunction nes-physical-operators GeomContainsPhysicalFunction.cpp) diff --git a/nes-physical-operators/src/Functions/Meos/EverEqTposeTposePhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverEqTposeTposePhysicalFunction.cpp new file mode 100644 index 0000000000..cb888a09a3 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverEqTposeTposePhysicalFunction.cpp @@ -0,0 +1,102 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +EverEqTposeTposePhysicalFunction::EverEqTposeTposePhysicalFunction( + PhysicalFunction x1, PhysicalFunction y1, PhysicalFunction theta1, PhysicalFunction ts1, + PhysicalFunction x2, PhysicalFunction y2, PhysicalFunction theta2, PhysicalFunction ts2) +{ + paramFns.reserve(8); + paramFns.push_back(std::move(x1)); + paramFns.push_back(std::move(y1)); + paramFns.push_back(std::move(theta1)); + paramFns.push_back(std::move(ts1)); + paramFns.push_back(std::move(x2)); + paramFns.push_back(std::move(y2)); + paramFns.push_back(std::move(theta2)); + paramFns.push_back(std::move(ts2)); +} + +VarVal EverEqTposeTposePhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto x1 = paramFns[0].execute(record, arena).cast(); + auto y1 = paramFns[1].execute(record, arena).cast(); + auto theta1 = paramFns[2].execute(record, arena).cast(); + auto ts1 = paramFns[3].execute(record, arena).cast(); + auto x2 = paramFns[4].execute(record, arena).cast(); + auto y2 = paramFns[5].execute(record, arena).cast(); + auto theta2 = paramFns[6].execute(record, arena).cast(); + auto ts2 = paramFns[7].execute(record, arena).cast(); + + const auto result = nautilus::invoke( + +[](double x1, double y1, double theta1, uint64_t ts1, + double x2, double y2, double theta2, uint64_t ts2) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + Pose* p1 = pose_make_2d(x1, y1, theta1, false, 0); + if (!p1) return 0.0; + Temporal* inst1 = (Temporal*)tposeinst_make(p1, (TimestampTz)ts1); + free(p1); + if (!inst1) return 0.0; + Pose* p2 = pose_make_2d(x2, y2, theta2, false, 0); + if (!p2) { free(inst1); return 0.0; } + Temporal* inst2 = (Temporal*)tposeinst_make(p2, (TimestampTz)ts2); + free(p2); + if (!inst2) { free(inst1); return 0.0; } + int r = ever_eq_tpose_tpose(inst1, inst2); + free(inst1); free(inst2); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + x1, y1, theta1, ts1, x2, y2, theta2, ts2); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverEqTposeTposePhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 8, + "EverEqTposeTposePhysicalFunction requires 8 children but got {}", + arguments.childFunctions.size()); + return EverEqTposeTposePhysicalFunction(std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4]), + std::move(arguments.childFunctions[5]), + std::move(arguments.childFunctions[6]), + std::move(arguments.childFunctions[7])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverNeTposeTposePhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverNeTposeTposePhysicalFunction.cpp new file mode 100644 index 0000000000..2433995d0e --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverNeTposeTposePhysicalFunction.cpp @@ -0,0 +1,102 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +EverNeTposeTposePhysicalFunction::EverNeTposeTposePhysicalFunction( + PhysicalFunction x1, PhysicalFunction y1, PhysicalFunction theta1, PhysicalFunction ts1, + PhysicalFunction x2, PhysicalFunction y2, PhysicalFunction theta2, PhysicalFunction ts2) +{ + paramFns.reserve(8); + paramFns.push_back(std::move(x1)); + paramFns.push_back(std::move(y1)); + paramFns.push_back(std::move(theta1)); + paramFns.push_back(std::move(ts1)); + paramFns.push_back(std::move(x2)); + paramFns.push_back(std::move(y2)); + paramFns.push_back(std::move(theta2)); + paramFns.push_back(std::move(ts2)); +} + +VarVal EverNeTposeTposePhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto x1 = paramFns[0].execute(record, arena).cast(); + auto y1 = paramFns[1].execute(record, arena).cast(); + auto theta1 = paramFns[2].execute(record, arena).cast(); + auto ts1 = paramFns[3].execute(record, arena).cast(); + auto x2 = paramFns[4].execute(record, arena).cast(); + auto y2 = paramFns[5].execute(record, arena).cast(); + auto theta2 = paramFns[6].execute(record, arena).cast(); + auto ts2 = paramFns[7].execute(record, arena).cast(); + + const auto result = nautilus::invoke( + +[](double x1, double y1, double theta1, uint64_t ts1, + double x2, double y2, double theta2, uint64_t ts2) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + Pose* p1 = pose_make_2d(x1, y1, theta1, false, 0); + if (!p1) return 0.0; + Temporal* inst1 = (Temporal*)tposeinst_make(p1, (TimestampTz)ts1); + free(p1); + if (!inst1) return 0.0; + Pose* p2 = pose_make_2d(x2, y2, theta2, false, 0); + if (!p2) { free(inst1); return 0.0; } + Temporal* inst2 = (Temporal*)tposeinst_make(p2, (TimestampTz)ts2); + free(p2); + if (!inst2) { free(inst1); return 0.0; } + int r = ever_ne_tpose_tpose(inst1, inst2); + free(inst1); free(inst2); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + x1, y1, theta1, ts1, x2, y2, theta2, ts2); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverNeTposeTposePhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 8, + "EverNeTposeTposePhysicalFunction requires 8 children but got {}", + arguments.childFunctions.size()); + return EverNeTposeTposePhysicalFunction(std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4]), + std::move(arguments.childFunctions[5]), + std::move(arguments.childFunctions[6]), + std::move(arguments.childFunctions[7])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/NadTposeTposePhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/NadTposeTposePhysicalFunction.cpp new file mode 100644 index 0000000000..57f3232df9 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/NadTposeTposePhysicalFunction.cpp @@ -0,0 +1,102 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +NadTposeTposePhysicalFunction::NadTposeTposePhysicalFunction( + PhysicalFunction x1, PhysicalFunction y1, PhysicalFunction theta1, PhysicalFunction ts1, + PhysicalFunction x2, PhysicalFunction y2, PhysicalFunction theta2, PhysicalFunction ts2) +{ + paramFns.reserve(8); + paramFns.push_back(std::move(x1)); + paramFns.push_back(std::move(y1)); + paramFns.push_back(std::move(theta1)); + paramFns.push_back(std::move(ts1)); + paramFns.push_back(std::move(x2)); + paramFns.push_back(std::move(y2)); + paramFns.push_back(std::move(theta2)); + paramFns.push_back(std::move(ts2)); +} + +VarVal NadTposeTposePhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto x1 = paramFns[0].execute(record, arena).cast(); + auto y1 = paramFns[1].execute(record, arena).cast(); + auto theta1 = paramFns[2].execute(record, arena).cast(); + auto ts1 = paramFns[3].execute(record, arena).cast(); + auto x2 = paramFns[4].execute(record, arena).cast(); + auto y2 = paramFns[5].execute(record, arena).cast(); + auto theta2 = paramFns[6].execute(record, arena).cast(); + auto ts2 = paramFns[7].execute(record, arena).cast(); + + const auto result = nautilus::invoke( + +[](double x1, double y1, double theta1, uint64_t ts1, + double x2, double y2, double theta2, uint64_t ts2) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + Pose* p1 = pose_make_2d(x1, y1, theta1, false, 0); + if (!p1) return 0.0; + Temporal* inst1 = (Temporal*)tposeinst_make(p1, (TimestampTz)ts1); + free(p1); + if (!inst1) return 0.0; + Pose* p2 = pose_make_2d(x2, y2, theta2, false, 0); + if (!p2) { free(inst1); return 0.0; } + Temporal* inst2 = (Temporal*)tposeinst_make(p2, (TimestampTz)ts2); + free(p2); + if (!inst2) { free(inst1); return 0.0; } + double r = nad_tpose_tpose(inst1, inst2); + free(inst1); free(inst2); + return r; + } catch (const std::exception&) { return -1.0; } + }, + x1, y1, theta1, ts1, x2, y2, theta2, ts2); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterNadTposeTposePhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 8, + "NadTposeTposePhysicalFunction requires 8 children but got {}", + arguments.childFunctions.size()); + return NadTposeTposePhysicalFunction(std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4]), + std::move(arguments.childFunctions[5]), + std::move(arguments.childFunctions[6]), + std::move(arguments.childFunctions[7])); +} + +} // namespace NES diff --git a/nes-sql-parser/AntlrSQL.g4 b/nes-sql-parser/AntlrSQL.g4 index a5106a3fc7..921fdee9c3 100644 --- a/nes-sql-parser/AntlrSQL.g4 +++ b/nes-sql-parser/AntlrSQL.g4 @@ -295,7 +295,7 @@ timeUnit: MS timestampParameter: name=identifier; -functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT | TGE_TTEXT_TEXT | TGE_TEXT_TTEXT | TGT_TTEXT_TEXT | TGT_TEXT_TTEXT | TLE_TTEXT_TEXT | TLE_TEXT_TTEXT | TLT_TTEXT_TEXT | TLT_TEXT_TTEXT | TTEXT_UPPER | TTEXT_LOWER | TTEXT_INITCAP | TEXTCAT_TTEXT_TEXT | TEXTCAT_TEXT_TTEXT | TEXTCAT_TTEXT_TTEXT | GEOM_LENGTH | GEOM_PERIMETER | GEOM_AZIMUTH | GEOG_AREA | GEOG_LENGTH | GEOG_PERIMETER | GEOM_IS_EMPTY | AINTERSECTS_TGEO_GEO | ACOVERS_TGEO_GEO | ADISJOINT_TGEO_GEO | ADWITHIN_TGEO_GEO | EINTERSECTS_TGEO_GEO | ETOUCHES_TGEO_GEO | ECONTAINS_TGEO_GEO | ACONTAINS_TGEO_GEO | ATOUCHES_TGEO_GEO | GEO_NUM_POINTS | GEO_NUM_GEOS | GEO_SRID | GEO_IS_UNITARY | GEO_EQUALS | GEO_SAME | GEOG_DISTANCE | NAD_TGEO_GEO | EVER_EQ_TGEO_GEO | EVER_NE_TGEO_GEO | ALWAYS_EQ_TGEO_GEO | ALWAYS_NE_TGEO_GEO | GEOG_INTERSECTS | GEOG_DWITHIN | ACOVERS_GEO_TGEO | GEOM_INTERSECTS | GEOM_DWITHIN | H3_GS_POINT_TO_CELL | EVER_EQ_TH3INDEX_H3INDEX | EVER_NE_TH3INDEX_H3INDEX | ALWAYS_EQ_TH3INDEX_H3INDEX | ALWAYS_NE_TH3INDEX_H3INDEX | TH3INDEX_GET_RESOLUTION | TH3INDEX_GET_BASE_CELL_NUMBER | TH3INDEX_IS_VALID_CELL | TH3INDEX_IS_PENTAGON | TH3INDEX_CELL_TO_PARENT_NEXT | TH3INDEX_CELL_TO_CENTER_CHILD_NEXT | TH3INDEX_CELL_TO_PARENT | TH3INDEX_CELL_TO_CENTER_CHILD | TH3INDEX_CELL_TO_CHILD_POS | TH3INDEX_ARE_NEIGHBOR_CELLS | TH3INDEX_GRID_DISTANCE | EINTERSECTS_TCBUFFER_GEO | AINTERSECTS_TCBUFFER_GEO | ECOVERS_TCBUFFER_GEO | ACOVERS_TCBUFFER_GEO | EDISJOINT_TCBUFFER_GEO | ADISJOINT_TCBUFFER_GEO | ETOUCHES_TCBUFFER_GEO | ATOUCHES_TCBUFFER_GEO | ECONTAINS_TCBUFFER_GEO | ACONTAINS_TCBUFFER_GEO | NAD_TCBUFFER_GEO | EDWITHIN_TCBUFFER_GEO | ADWITHIN_TCBUFFER_GEO | EINTERSECTS_TCBUFFER_CBUFFER | AINTERSECTS_TCBUFFER_CBUFFER | ECOVERS_TCBUFFER_CBUFFER | ACOVERS_TCBUFFER_CBUFFER | EDISJOINT_TCBUFFER_CBUFFER | ADISJOINT_TCBUFFER_CBUFFER | ETOUCHES_TCBUFFER_CBUFFER | ATOUCHES_TCBUFFER_CBUFFER | ECONTAINS_TCBUFFER_CBUFFER | ACONTAINS_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_CBUFFER | ALWAYS_EQ_TCBUFFER_CBUFFER | EVER_NE_TCBUFFER_CBUFFER | ALWAYS_NE_TCBUFFER_CBUFFER | NAD_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_TCBUFFER | ALWAYS_EQ_TCBUFFER_TCBUFFER | EVER_NE_TCBUFFER_TCBUFFER | ALWAYS_NE_TCBUFFER_TCBUFFER | EINTERSECTS_TCBUFFER_TCBUFFER | AINTERSECTS_TCBUFFER_TCBUFFER | ECOVERS_TCBUFFER_TCBUFFER | ACOVERS_TCBUFFER_TCBUFFER | ADISJOINT_TCBUFFER_TCBUFFER | ETOUCHES_TCBUFFER_TCBUFFER | ATOUCHES_TCBUFFER_TCBUFFER | NAD_TCBUFFER_TCBUFFER | EDWITHIN_TCBUFFER_TCBUFFER | ADWITHIN_TCBUFFER_TCBUFFER | MINDISTANCE_TCBUFFER_TCBUFFER | NAD_TNPOINT_GEO | EVER_EQ_TNPOINT_NPOINT | ALWAYS_EQ_TNPOINT_NPOINT | EVER_NE_TNPOINT_NPOINT | ALWAYS_NE_TNPOINT_NPOINT | NAD_TNPOINT_NPOINT | EVER_EQ_NPOINT_TNPOINT | ALWAYS_EQ_NPOINT_TNPOINT | EVER_NE_NPOINT_TNPOINT | ALWAYS_NE_NPOINT_TNPOINT | EVER_EQ_TNPOINT_TNPOINT | ALWAYS_EQ_TNPOINT_TNPOINT | EVER_NE_TNPOINT_TNPOINT | ALWAYS_NE_TNPOINT_TNPOINT | NAD_TNPOINT_TNPOINT | NAD_TPOSE_GEO | EVER_EQ_TPOSE_POSE | ALWAYS_EQ_TPOSE_POSE | EVER_NE_TPOSE_POSE | ALWAYS_NE_TPOSE_POSE | NAD_TPOSE_POSE | EVER_EQ_POSE_TPOSE | ALWAYS_EQ_POSE_TPOSE | EVER_NE_POSE_TPOSE | ALWAYS_NE_POSE_TPOSE | GEOM_INTERSECTS2D | GEOM_DWITHIN2D | GEOM_CONTAINS | GEOM_DISJOINT2D | GEOM_COVERS | GEOM_TOUCHES | GEOM_INTERSECTS3D | GEOM_DWITHIN3D | GEOM_DISTANCE2D | GEOM_DISTANCE3D; +functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT | TGE_TTEXT_TEXT | TGE_TEXT_TTEXT | TGT_TTEXT_TEXT | TGT_TEXT_TTEXT | TLE_TTEXT_TEXT | TLE_TEXT_TTEXT | TLT_TTEXT_TEXT | TLT_TEXT_TTEXT | TTEXT_UPPER | TTEXT_LOWER | TTEXT_INITCAP | TEXTCAT_TTEXT_TEXT | TEXTCAT_TEXT_TTEXT | TEXTCAT_TTEXT_TTEXT | GEOM_LENGTH | GEOM_PERIMETER | GEOM_AZIMUTH | GEOG_AREA | GEOG_LENGTH | GEOG_PERIMETER | GEOM_IS_EMPTY | AINTERSECTS_TGEO_GEO | ACOVERS_TGEO_GEO | ADISJOINT_TGEO_GEO | ADWITHIN_TGEO_GEO | EINTERSECTS_TGEO_GEO | ETOUCHES_TGEO_GEO | ECONTAINS_TGEO_GEO | ACONTAINS_TGEO_GEO | ATOUCHES_TGEO_GEO | GEO_NUM_POINTS | GEO_NUM_GEOS | GEO_SRID | GEO_IS_UNITARY | GEO_EQUALS | GEO_SAME | GEOG_DISTANCE | NAD_TGEO_GEO | EVER_EQ_TGEO_GEO | EVER_NE_TGEO_GEO | ALWAYS_EQ_TGEO_GEO | ALWAYS_NE_TGEO_GEO | GEOG_INTERSECTS | GEOG_DWITHIN | ACOVERS_GEO_TGEO | GEOM_INTERSECTS | GEOM_DWITHIN | H3_GS_POINT_TO_CELL | EVER_EQ_TH3INDEX_H3INDEX | EVER_NE_TH3INDEX_H3INDEX | ALWAYS_EQ_TH3INDEX_H3INDEX | ALWAYS_NE_TH3INDEX_H3INDEX | TH3INDEX_GET_RESOLUTION | TH3INDEX_GET_BASE_CELL_NUMBER | TH3INDEX_IS_VALID_CELL | TH3INDEX_IS_PENTAGON | TH3INDEX_CELL_TO_PARENT_NEXT | TH3INDEX_CELL_TO_CENTER_CHILD_NEXT | TH3INDEX_CELL_TO_PARENT | TH3INDEX_CELL_TO_CENTER_CHILD | TH3INDEX_CELL_TO_CHILD_POS | TH3INDEX_ARE_NEIGHBOR_CELLS | TH3INDEX_GRID_DISTANCE | EINTERSECTS_TCBUFFER_GEO | AINTERSECTS_TCBUFFER_GEO | ECOVERS_TCBUFFER_GEO | ACOVERS_TCBUFFER_GEO | EDISJOINT_TCBUFFER_GEO | ADISJOINT_TCBUFFER_GEO | ETOUCHES_TCBUFFER_GEO | ATOUCHES_TCBUFFER_GEO | ECONTAINS_TCBUFFER_GEO | ACONTAINS_TCBUFFER_GEO | NAD_TCBUFFER_GEO | EDWITHIN_TCBUFFER_GEO | ADWITHIN_TCBUFFER_GEO | EINTERSECTS_TCBUFFER_CBUFFER | AINTERSECTS_TCBUFFER_CBUFFER | ECOVERS_TCBUFFER_CBUFFER | ACOVERS_TCBUFFER_CBUFFER | EDISJOINT_TCBUFFER_CBUFFER | ADISJOINT_TCBUFFER_CBUFFER | ETOUCHES_TCBUFFER_CBUFFER | ATOUCHES_TCBUFFER_CBUFFER | ECONTAINS_TCBUFFER_CBUFFER | ACONTAINS_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_CBUFFER | ALWAYS_EQ_TCBUFFER_CBUFFER | EVER_NE_TCBUFFER_CBUFFER | ALWAYS_NE_TCBUFFER_CBUFFER | NAD_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_TCBUFFER | ALWAYS_EQ_TCBUFFER_TCBUFFER | EVER_NE_TCBUFFER_TCBUFFER | ALWAYS_NE_TCBUFFER_TCBUFFER | EINTERSECTS_TCBUFFER_TCBUFFER | AINTERSECTS_TCBUFFER_TCBUFFER | ECOVERS_TCBUFFER_TCBUFFER | ACOVERS_TCBUFFER_TCBUFFER | ADISJOINT_TCBUFFER_TCBUFFER | ETOUCHES_TCBUFFER_TCBUFFER | ATOUCHES_TCBUFFER_TCBUFFER | NAD_TCBUFFER_TCBUFFER | EDWITHIN_TCBUFFER_TCBUFFER | ADWITHIN_TCBUFFER_TCBUFFER | MINDISTANCE_TCBUFFER_TCBUFFER | NAD_TNPOINT_GEO | EVER_EQ_TNPOINT_NPOINT | ALWAYS_EQ_TNPOINT_NPOINT | EVER_NE_TNPOINT_NPOINT | ALWAYS_NE_TNPOINT_NPOINT | NAD_TNPOINT_NPOINT | EVER_EQ_NPOINT_TNPOINT | ALWAYS_EQ_NPOINT_TNPOINT | EVER_NE_NPOINT_TNPOINT | ALWAYS_NE_NPOINT_TNPOINT | EVER_EQ_TNPOINT_TNPOINT | ALWAYS_EQ_TNPOINT_TNPOINT | EVER_NE_TNPOINT_TNPOINT | ALWAYS_NE_TNPOINT_TNPOINT | NAD_TNPOINT_TNPOINT | NAD_TPOSE_GEO | EVER_EQ_TPOSE_POSE | ALWAYS_EQ_TPOSE_POSE | EVER_NE_TPOSE_POSE | ALWAYS_NE_TPOSE_POSE | NAD_TPOSE_POSE | EVER_EQ_POSE_TPOSE | ALWAYS_EQ_POSE_TPOSE | EVER_NE_POSE_TPOSE | ALWAYS_NE_POSE_TPOSE | EVER_EQ_TPOSE_TPOSE | ALWAYS_EQ_TPOSE_TPOSE | EVER_NE_TPOSE_TPOSE | ALWAYS_NE_TPOSE_TPOSE | NAD_TPOSE_TPOSE | GEOM_INTERSECTS2D | GEOM_DWITHIN2D | GEOM_CONTAINS | GEOM_DISJOINT2D | GEOM_COVERS | GEOM_TOUCHES | GEOM_INTERSECTS3D | GEOM_DWITHIN3D | GEOM_DISTANCE2D | GEOM_DISTANCE3D; sinkClause: INTO sink (',' sink)*; @@ -875,6 +875,11 @@ EVER_EQ_POSE_TPOSE: 'EVER_EQ_POSE_TPOSE' | 'ever_eq_pose_tpose'; ALWAYS_EQ_POSE_TPOSE: 'ALWAYS_EQ_POSE_TPOSE' | 'always_eq_pose_tpose'; EVER_NE_POSE_TPOSE: 'EVER_NE_POSE_TPOSE' | 'ever_ne_pose_tpose'; ALWAYS_NE_POSE_TPOSE: 'ALWAYS_NE_POSE_TPOSE' | 'always_ne_pose_tpose'; +EVER_EQ_TPOSE_TPOSE: 'EVER_EQ_TPOSE_TPOSE' | 'ever_eq_tpose_tpose'; +ALWAYS_EQ_TPOSE_TPOSE: 'ALWAYS_EQ_TPOSE_TPOSE' | 'always_eq_tpose_tpose'; +EVER_NE_TPOSE_TPOSE: 'EVER_NE_TPOSE_TPOSE' | 'ever_ne_tpose_tpose'; +ALWAYS_NE_TPOSE_TPOSE: 'ALWAYS_NE_TPOSE_TPOSE' | 'always_ne_tpose_tpose'; +NAD_TPOSE_TPOSE: 'NAD_TPOSE_TPOSE' | 'nad_tpose_tpose'; GEOM_INTERSECTS2D: 'GEOM_INTERSECTS2D' | 'geom_intersects2d'; GEOM_DWITHIN2D: 'GEOM_DWITHIN2D' | 'geom_dwithin2d'; GEOM_CONTAINS: 'GEOM_CONTAINS' | 'geom_contains'; diff --git a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp index 3ef07fe59e..c00cd35b42 100644 --- a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp +++ b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp @@ -456,6 +456,11 @@ #include #include #include +#include +#include +#include +#include +#include #include #include #include @@ -10280,6 +10285,81 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont return LogicalFunction(AlwaysNePoseTposeLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6))); } /* END CODEGEN PARSER GLUE: ALWAYS_NE_POSE_TPOSE */ + case AntlrSQLParser::EVER_EQ_TPOSE_TPOSE: { + PRECONDITION(ctx->functionParam().size() == 8, + "EverEqTposeTpose requires 8 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + auto arg5 = visit(ctx->functionParam(5)).as(); + auto arg6 = visit(ctx->functionParam(6)).as(); + auto arg7 = visit(ctx->functionParam(7)).as(); + return LogicalFunction(EverEqTposeTposeLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6), std::move(arg7))); + } + /* END CODEGEN PARSER GLUE: EVER_EQ_TPOSE_TPOSE */ + case AntlrSQLParser::ALWAYS_EQ_TPOSE_TPOSE: { + PRECONDITION(ctx->functionParam().size() == 8, + "AlwaysEqTposeTpose requires 8 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + auto arg5 = visit(ctx->functionParam(5)).as(); + auto arg6 = visit(ctx->functionParam(6)).as(); + auto arg7 = visit(ctx->functionParam(7)).as(); + return LogicalFunction(AlwaysEqTposeTposeLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6), std::move(arg7))); + } + /* END CODEGEN PARSER GLUE: ALWAYS_EQ_TPOSE_TPOSE */ + case AntlrSQLParser::EVER_NE_TPOSE_TPOSE: { + PRECONDITION(ctx->functionParam().size() == 8, + "EverNeTposeTpose requires 8 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + auto arg5 = visit(ctx->functionParam(5)).as(); + auto arg6 = visit(ctx->functionParam(6)).as(); + auto arg7 = visit(ctx->functionParam(7)).as(); + return LogicalFunction(EverNeTposeTposeLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6), std::move(arg7))); + } + /* END CODEGEN PARSER GLUE: EVER_NE_TPOSE_TPOSE */ + case AntlrSQLParser::ALWAYS_NE_TPOSE_TPOSE: { + PRECONDITION(ctx->functionParam().size() == 8, + "AlwaysNeTposeTpose requires 8 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + auto arg5 = visit(ctx->functionParam(5)).as(); + auto arg6 = visit(ctx->functionParam(6)).as(); + auto arg7 = visit(ctx->functionParam(7)).as(); + return LogicalFunction(AlwaysNeTposeTposeLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6), std::move(arg7))); + } + /* END CODEGEN PARSER GLUE: ALWAYS_NE_TPOSE_TPOSE */ + case AntlrSQLParser::NAD_TPOSE_TPOSE: { + PRECONDITION(ctx->functionParam().size() == 8, + "NadTposeTpose requires 8 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + auto arg5 = visit(ctx->functionParam(5)).as(); + auto arg6 = visit(ctx->functionParam(6)).as(); + auto arg7 = visit(ctx->functionParam(7)).as(); + return LogicalFunction(NadTposeTposeLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6), std::move(arg7))); + } + /* END CODEGEN PARSER GLUE: NAD_TPOSE_TPOSE */ /* END CODEGEN PARSER GLUE: GEOM_INTERSECTS2D */ case AntlrSQLParser::GEOM_DWITHIN2D: { PRECONDITION(ctx->functionParam().size() == 3, From 4a8075cd515963a233839b9e1ac3a76d6a46cb2c Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Mon, 15 Jun 2026 10:19:30 +0200 Subject: [PATCH 70/96] feat(meos): add trgeometry 2D per-event scalar operators for geo (W122) 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. --- .../AlwaysEqGeoTrgeometryLogicalFunction.hpp | 48 +++++++ .../AlwaysEqTrgeometryGeoLogicalFunction.hpp | 48 +++++++ .../AlwaysNeGeoTrgeometryLogicalFunction.hpp | 48 +++++++ .../AlwaysNeTrgeometryGeoLogicalFunction.hpp | 48 +++++++ .../EverEqGeoTrgeometryLogicalFunction.hpp | 48 +++++++ .../EverEqTrgeometryGeoLogicalFunction.hpp | 48 +++++++ .../EverNeGeoTrgeometryLogicalFunction.hpp | 48 +++++++ .../EverNeTrgeometryGeoLogicalFunction.hpp | 48 +++++++ .../Meos/NadTrgeometryGeoLogicalFunction.hpp | 48 +++++++ .../AlwaysEqGeoTrgeometryLogicalFunction.cpp | 111 +++++++++++++++ .../AlwaysEqTrgeometryGeoLogicalFunction.cpp | 111 +++++++++++++++ .../AlwaysNeGeoTrgeometryLogicalFunction.cpp | 111 +++++++++++++++ .../AlwaysNeTrgeometryGeoLogicalFunction.cpp | 111 +++++++++++++++ .../src/Functions/Meos/CMakeLists.txt | 9 ++ .../EverEqGeoTrgeometryLogicalFunction.cpp | 111 +++++++++++++++ .../EverEqTrgeometryGeoLogicalFunction.cpp | 111 +++++++++++++++ .../EverNeGeoTrgeometryLogicalFunction.cpp | 111 +++++++++++++++ .../EverNeTrgeometryGeoLogicalFunction.cpp | 111 +++++++++++++++ .../Meos/NadTrgeometryGeoLogicalFunction.cpp | 111 +++++++++++++++ .../AlwaysEqGeoTrgeometryPhysicalFunction.hpp | 32 +++++ .../AlwaysEqTrgeometryGeoPhysicalFunction.hpp | 32 +++++ .../AlwaysNeGeoTrgeometryPhysicalFunction.hpp | 32 +++++ .../AlwaysNeTrgeometryGeoPhysicalFunction.hpp | 32 +++++ .../EverEqGeoTrgeometryPhysicalFunction.hpp | 32 +++++ .../EverEqTrgeometryGeoPhysicalFunction.hpp | 32 +++++ .../EverNeGeoTrgeometryPhysicalFunction.hpp | 32 +++++ .../EverNeTrgeometryGeoPhysicalFunction.hpp | 32 +++++ .../Meos/NadTrgeometryGeoPhysicalFunction.hpp | 32 +++++ .../AlwaysEqGeoTrgeometryPhysicalFunction.cpp | 98 ++++++++++++++ .../AlwaysEqTrgeometryGeoPhysicalFunction.cpp | 98 ++++++++++++++ .../AlwaysNeGeoTrgeometryPhysicalFunction.cpp | 98 ++++++++++++++ .../AlwaysNeTrgeometryGeoPhysicalFunction.cpp | 98 ++++++++++++++ .../src/Functions/Meos/CMakeLists.txt | 9 ++ .../EverEqGeoTrgeometryPhysicalFunction.cpp | 98 ++++++++++++++ .../EverEqTrgeometryGeoPhysicalFunction.cpp | 98 ++++++++++++++ .../EverNeGeoTrgeometryPhysicalFunction.cpp | 98 ++++++++++++++ .../EverNeTrgeometryGeoPhysicalFunction.cpp | 98 ++++++++++++++ .../Meos/NadTrgeometryGeoPhysicalFunction.cpp | 98 ++++++++++++++ nes-sql-parser/AntlrSQL.g4 | 11 +- .../src/AntlrSQLQueryPlanCreator.cpp | 126 ++++++++++++++++++ 40 files changed, 2755 insertions(+), 1 deletion(-) create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysEqGeoTrgeometryLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysEqTrgeometryGeoLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysNeGeoTrgeometryLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysNeTrgeometryGeoLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverEqGeoTrgeometryLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverEqTrgeometryGeoLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverNeGeoTrgeometryLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverNeTrgeometryGeoLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/NadTrgeometryGeoLogicalFunction.hpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysEqGeoTrgeometryLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysEqTrgeometryGeoLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysNeGeoTrgeometryLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysNeTrgeometryGeoLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverEqGeoTrgeometryLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverEqTrgeometryGeoLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverNeGeoTrgeometryLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverNeTrgeometryGeoLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/NadTrgeometryGeoLogicalFunction.cpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysEqGeoTrgeometryPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysEqTrgeometryGeoPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysNeGeoTrgeometryPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysNeTrgeometryGeoPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverEqGeoTrgeometryPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverEqTrgeometryGeoPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverNeGeoTrgeometryPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverNeTrgeometryGeoPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/NadTrgeometryGeoPhysicalFunction.hpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysEqGeoTrgeometryPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysEqTrgeometryGeoPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysNeGeoTrgeometryPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysNeTrgeometryGeoPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverEqGeoTrgeometryPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverEqTrgeometryGeoPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverNeGeoTrgeometryPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverNeTrgeometryGeoPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/NadTrgeometryGeoPhysicalFunction.cpp diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysEqGeoTrgeometryLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysEqGeoTrgeometryLogicalFunction.hpp new file mode 100644 index 0000000000..6ba9cb98d1 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysEqGeoTrgeometryLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if the static geometry is always equal to the 2D trgeometry instant. + */ +class AlwaysEqGeoTrgeometryLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysEqGeoTrgeometry"; + + AlwaysEqGeoTrgeometryLogicalFunction(LogicalFunction tgt_wkt, LogicalFunction ref_wkt, LogicalFunction x, LogicalFunction y, LogicalFunction theta, LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysEqTrgeometryGeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysEqTrgeometryGeoLogicalFunction.hpp new file mode 100644 index 0000000000..54cf4ac351 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysEqTrgeometryGeoLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if the 2D trgeometry instant is always equal to the static geometry. + */ +class AlwaysEqTrgeometryGeoLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysEqTrgeometryGeo"; + + AlwaysEqTrgeometryGeoLogicalFunction(LogicalFunction ref_wkt, LogicalFunction x, LogicalFunction y, LogicalFunction theta, LogicalFunction ts, LogicalFunction tgt_wkt); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysNeGeoTrgeometryLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysNeGeoTrgeometryLogicalFunction.hpp new file mode 100644 index 0000000000..a2e6f94997 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysNeGeoTrgeometryLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if the static geometry is always not equal to the 2D trgeometry instant. + */ +class AlwaysNeGeoTrgeometryLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysNeGeoTrgeometry"; + + AlwaysNeGeoTrgeometryLogicalFunction(LogicalFunction tgt_wkt, LogicalFunction ref_wkt, LogicalFunction x, LogicalFunction y, LogicalFunction theta, LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysNeTrgeometryGeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysNeTrgeometryGeoLogicalFunction.hpp new file mode 100644 index 0000000000..ede9a4ef9f --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysNeTrgeometryGeoLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if the 2D trgeometry instant is always not equal to the static geometry. + */ +class AlwaysNeTrgeometryGeoLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysNeTrgeometryGeo"; + + AlwaysNeTrgeometryGeoLogicalFunction(LogicalFunction ref_wkt, LogicalFunction x, LogicalFunction y, LogicalFunction theta, LogicalFunction ts, LogicalFunction tgt_wkt); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverEqGeoTrgeometryLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverEqGeoTrgeometryLogicalFunction.hpp new file mode 100644 index 0000000000..5a49a6f0f8 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverEqGeoTrgeometryLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if the static geometry is ever equal to the 2D trgeometry instant. + */ +class EverEqGeoTrgeometryLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverEqGeoTrgeometry"; + + EverEqGeoTrgeometryLogicalFunction(LogicalFunction tgt_wkt, LogicalFunction ref_wkt, LogicalFunction x, LogicalFunction y, LogicalFunction theta, LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverEqTrgeometryGeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverEqTrgeometryGeoLogicalFunction.hpp new file mode 100644 index 0000000000..6aa7993550 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverEqTrgeometryGeoLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if the 2D trgeometry instant is ever equal to the static geometry. + */ +class EverEqTrgeometryGeoLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverEqTrgeometryGeo"; + + EverEqTrgeometryGeoLogicalFunction(LogicalFunction ref_wkt, LogicalFunction x, LogicalFunction y, LogicalFunction theta, LogicalFunction ts, LogicalFunction tgt_wkt); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverNeGeoTrgeometryLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverNeGeoTrgeometryLogicalFunction.hpp new file mode 100644 index 0000000000..b398288d1a --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverNeGeoTrgeometryLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if the static geometry is ever not equal to the 2D trgeometry instant. + */ +class EverNeGeoTrgeometryLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverNeGeoTrgeometry"; + + EverNeGeoTrgeometryLogicalFunction(LogicalFunction tgt_wkt, LogicalFunction ref_wkt, LogicalFunction x, LogicalFunction y, LogicalFunction theta, LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverNeTrgeometryGeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverNeTrgeometryGeoLogicalFunction.hpp new file mode 100644 index 0000000000..1cd767f548 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverNeTrgeometryGeoLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if the 2D trgeometry instant is ever not equal to the static geometry. + */ +class EverNeTrgeometryGeoLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverNeTrgeometryGeo"; + + EverNeTrgeometryGeoLogicalFunction(LogicalFunction ref_wkt, LogicalFunction x, LogicalFunction y, LogicalFunction theta, LogicalFunction ts, LogicalFunction tgt_wkt); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/NadTrgeometryGeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/NadTrgeometryGeoLogicalFunction.hpp new file mode 100644 index 0000000000..f64aba7e86 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/NadTrgeometryGeoLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns the nearest approach distance between a 2D trgeometry instant and a static geometry. + */ +class NadTrgeometryGeoLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "NadTrgeometryGeo"; + + NadTrgeometryGeoLogicalFunction(LogicalFunction ref_wkt, LogicalFunction x, LogicalFunction y, LogicalFunction theta, LogicalFunction ts, LogicalFunction tgt_wkt); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysEqGeoTrgeometryLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysEqGeoTrgeometryLogicalFunction.cpp new file mode 100644 index 0000000000..6e8416413f --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysEqGeoTrgeometryLogicalFunction.cpp @@ -0,0 +1,111 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AlwaysEqGeoTrgeometryLogicalFunction::AlwaysEqGeoTrgeometryLogicalFunction(LogicalFunction tgt_wkt, LogicalFunction ref_wkt, LogicalFunction x, LogicalFunction y, LogicalFunction theta, LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(6); + parameters.push_back(std::move(tgt_wkt)); + parameters.push_back(std::move(ref_wkt)); + parameters.push_back(std::move(x)); + parameters.push_back(std::move(y)); + parameters.push_back(std::move(theta)); + parameters.push_back(std::move(ts)); +} + +DataType AlwaysEqGeoTrgeometryLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysEqGeoTrgeometryLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AlwaysEqGeoTrgeometryLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysEqGeoTrgeometryLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 6, + "AlwaysEqGeoTrgeometryLogicalFunction requires 6 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AlwaysEqGeoTrgeometryLogicalFunction::getType() const { return NAME; } + +bool AlwaysEqGeoTrgeometryLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AlwaysEqGeoTrgeometryLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction AlwaysEqGeoTrgeometryLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(6); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "tgt_wkt must be VARSIZED"); + INVARIANT(c[1].getDataType().isType(DataType::Type::VARSIZED), "ref_wkt must be VARSIZED"); + INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "x must be FLOAT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::FLOAT64), "y must be FLOAT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "theta must be FLOAT64"); + INVARIANT(c[5].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); + return withChildren(c); +} + +SerializableFunction AlwaysEqGeoTrgeometryLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysEqGeoTrgeometryLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 6, + "AlwaysEqGeoTrgeometryLogicalFunction requires 6 children but got {}", + arguments.children.size()); + return AlwaysEqGeoTrgeometryLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4]), + std::move(arguments.children[5])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysEqTrgeometryGeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysEqTrgeometryGeoLogicalFunction.cpp new file mode 100644 index 0000000000..7fe52206ad --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysEqTrgeometryGeoLogicalFunction.cpp @@ -0,0 +1,111 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AlwaysEqTrgeometryGeoLogicalFunction::AlwaysEqTrgeometryGeoLogicalFunction(LogicalFunction ref_wkt, LogicalFunction x, LogicalFunction y, LogicalFunction theta, LogicalFunction ts, LogicalFunction tgt_wkt) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(6); + parameters.push_back(std::move(ref_wkt)); + parameters.push_back(std::move(x)); + parameters.push_back(std::move(y)); + parameters.push_back(std::move(theta)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(tgt_wkt)); +} + +DataType AlwaysEqTrgeometryGeoLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysEqTrgeometryGeoLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AlwaysEqTrgeometryGeoLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysEqTrgeometryGeoLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 6, + "AlwaysEqTrgeometryGeoLogicalFunction requires 6 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AlwaysEqTrgeometryGeoLogicalFunction::getType() const { return NAME; } + +bool AlwaysEqTrgeometryGeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AlwaysEqTrgeometryGeoLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction AlwaysEqTrgeometryGeoLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(6); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "ref_wkt must be VARSIZED"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "x must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "y must be FLOAT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::FLOAT64), "theta must be FLOAT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); + INVARIANT(c[5].getDataType().isType(DataType::Type::VARSIZED), "tgt_wkt must be VARSIZED"); + return withChildren(c); +} + +SerializableFunction AlwaysEqTrgeometryGeoLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysEqTrgeometryGeoLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 6, + "AlwaysEqTrgeometryGeoLogicalFunction requires 6 children but got {}", + arguments.children.size()); + return AlwaysEqTrgeometryGeoLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4]), + std::move(arguments.children[5])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysNeGeoTrgeometryLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysNeGeoTrgeometryLogicalFunction.cpp new file mode 100644 index 0000000000..2595e70e93 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysNeGeoTrgeometryLogicalFunction.cpp @@ -0,0 +1,111 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AlwaysNeGeoTrgeometryLogicalFunction::AlwaysNeGeoTrgeometryLogicalFunction(LogicalFunction tgt_wkt, LogicalFunction ref_wkt, LogicalFunction x, LogicalFunction y, LogicalFunction theta, LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(6); + parameters.push_back(std::move(tgt_wkt)); + parameters.push_back(std::move(ref_wkt)); + parameters.push_back(std::move(x)); + parameters.push_back(std::move(y)); + parameters.push_back(std::move(theta)); + parameters.push_back(std::move(ts)); +} + +DataType AlwaysNeGeoTrgeometryLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysNeGeoTrgeometryLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AlwaysNeGeoTrgeometryLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysNeGeoTrgeometryLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 6, + "AlwaysNeGeoTrgeometryLogicalFunction requires 6 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AlwaysNeGeoTrgeometryLogicalFunction::getType() const { return NAME; } + +bool AlwaysNeGeoTrgeometryLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AlwaysNeGeoTrgeometryLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction AlwaysNeGeoTrgeometryLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(6); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "tgt_wkt must be VARSIZED"); + INVARIANT(c[1].getDataType().isType(DataType::Type::VARSIZED), "ref_wkt must be VARSIZED"); + INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "x must be FLOAT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::FLOAT64), "y must be FLOAT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "theta must be FLOAT64"); + INVARIANT(c[5].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); + return withChildren(c); +} + +SerializableFunction AlwaysNeGeoTrgeometryLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysNeGeoTrgeometryLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 6, + "AlwaysNeGeoTrgeometryLogicalFunction requires 6 children but got {}", + arguments.children.size()); + return AlwaysNeGeoTrgeometryLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4]), + std::move(arguments.children[5])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysNeTrgeometryGeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysNeTrgeometryGeoLogicalFunction.cpp new file mode 100644 index 0000000000..e0440066d2 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysNeTrgeometryGeoLogicalFunction.cpp @@ -0,0 +1,111 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AlwaysNeTrgeometryGeoLogicalFunction::AlwaysNeTrgeometryGeoLogicalFunction(LogicalFunction ref_wkt, LogicalFunction x, LogicalFunction y, LogicalFunction theta, LogicalFunction ts, LogicalFunction tgt_wkt) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(6); + parameters.push_back(std::move(ref_wkt)); + parameters.push_back(std::move(x)); + parameters.push_back(std::move(y)); + parameters.push_back(std::move(theta)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(tgt_wkt)); +} + +DataType AlwaysNeTrgeometryGeoLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysNeTrgeometryGeoLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AlwaysNeTrgeometryGeoLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysNeTrgeometryGeoLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 6, + "AlwaysNeTrgeometryGeoLogicalFunction requires 6 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AlwaysNeTrgeometryGeoLogicalFunction::getType() const { return NAME; } + +bool AlwaysNeTrgeometryGeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AlwaysNeTrgeometryGeoLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction AlwaysNeTrgeometryGeoLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(6); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "ref_wkt must be VARSIZED"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "x must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "y must be FLOAT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::FLOAT64), "theta must be FLOAT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); + INVARIANT(c[5].getDataType().isType(DataType::Type::VARSIZED), "tgt_wkt must be VARSIZED"); + return withChildren(c); +} + +SerializableFunction AlwaysNeTrgeometryGeoLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysNeTrgeometryGeoLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 6, + "AlwaysNeTrgeometryGeoLogicalFunction requires 6 children but got {}", + arguments.children.size()); + return AlwaysNeTrgeometryGeoLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4]), + std::move(arguments.children[5])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt index e992c8d631..251628c2fb 100644 --- a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt @@ -410,6 +410,15 @@ add_plugin(AlwaysEqTposeTpose LogicalFunction nes-logical-operators AlwaysEqTpos add_plugin(EverNeTposeTpose LogicalFunction nes-logical-operators EverNeTposeTposeLogicalFunction.cpp) add_plugin(AlwaysNeTposeTpose LogicalFunction nes-logical-operators AlwaysNeTposeTposeLogicalFunction.cpp) add_plugin(NadTposeTpose LogicalFunction nes-logical-operators NadTposeTposeLogicalFunction.cpp) +add_plugin(EverEqTrgeometryGeo LogicalFunction nes-logical-operators EverEqTrgeometryGeoLogicalFunction.cpp) +add_plugin(AlwaysEqTrgeometryGeo LogicalFunction nes-logical-operators AlwaysEqTrgeometryGeoLogicalFunction.cpp) +add_plugin(EverNeTrgeometryGeo LogicalFunction nes-logical-operators EverNeTrgeometryGeoLogicalFunction.cpp) +add_plugin(AlwaysNeTrgeometryGeo LogicalFunction nes-logical-operators AlwaysNeTrgeometryGeoLogicalFunction.cpp) +add_plugin(NadTrgeometryGeo LogicalFunction nes-logical-operators NadTrgeometryGeoLogicalFunction.cpp) +add_plugin(EverEqGeoTrgeometry LogicalFunction nes-logical-operators EverEqGeoTrgeometryLogicalFunction.cpp) +add_plugin(AlwaysEqGeoTrgeometry LogicalFunction nes-logical-operators AlwaysEqGeoTrgeometryLogicalFunction.cpp) +add_plugin(EverNeGeoTrgeometry LogicalFunction nes-logical-operators EverNeGeoTrgeometryLogicalFunction.cpp) +add_plugin(AlwaysNeGeoTrgeometry LogicalFunction nes-logical-operators AlwaysNeGeoTrgeometryLogicalFunction.cpp) add_plugin(GeomIntersects2d LogicalFunction nes-logical-operators GeomIntersects2dLogicalFunction.cpp) add_plugin(GeomDwithin2d LogicalFunction nes-logical-operators GeomDwithin2dLogicalFunction.cpp) add_plugin(GeomContains LogicalFunction nes-logical-operators GeomContainsLogicalFunction.cpp) diff --git a/nes-logical-operators/src/Functions/Meos/EverEqGeoTrgeometryLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverEqGeoTrgeometryLogicalFunction.cpp new file mode 100644 index 0000000000..ebb66482a8 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverEqGeoTrgeometryLogicalFunction.cpp @@ -0,0 +1,111 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EverEqGeoTrgeometryLogicalFunction::EverEqGeoTrgeometryLogicalFunction(LogicalFunction tgt_wkt, LogicalFunction ref_wkt, LogicalFunction x, LogicalFunction y, LogicalFunction theta, LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(6); + parameters.push_back(std::move(tgt_wkt)); + parameters.push_back(std::move(ref_wkt)); + parameters.push_back(std::move(x)); + parameters.push_back(std::move(y)); + parameters.push_back(std::move(theta)); + parameters.push_back(std::move(ts)); +} + +DataType EverEqGeoTrgeometryLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverEqGeoTrgeometryLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EverEqGeoTrgeometryLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverEqGeoTrgeometryLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 6, + "EverEqGeoTrgeometryLogicalFunction requires 6 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EverEqGeoTrgeometryLogicalFunction::getType() const { return NAME; } + +bool EverEqGeoTrgeometryLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EverEqGeoTrgeometryLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction EverEqGeoTrgeometryLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(6); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "tgt_wkt must be VARSIZED"); + INVARIANT(c[1].getDataType().isType(DataType::Type::VARSIZED), "ref_wkt must be VARSIZED"); + INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "x must be FLOAT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::FLOAT64), "y must be FLOAT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "theta must be FLOAT64"); + INVARIANT(c[5].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); + return withChildren(c); +} + +SerializableFunction EverEqGeoTrgeometryLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverEqGeoTrgeometryLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 6, + "EverEqGeoTrgeometryLogicalFunction requires 6 children but got {}", + arguments.children.size()); + return EverEqGeoTrgeometryLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4]), + std::move(arguments.children[5])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverEqTrgeometryGeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverEqTrgeometryGeoLogicalFunction.cpp new file mode 100644 index 0000000000..7cafe5215e --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverEqTrgeometryGeoLogicalFunction.cpp @@ -0,0 +1,111 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EverEqTrgeometryGeoLogicalFunction::EverEqTrgeometryGeoLogicalFunction(LogicalFunction ref_wkt, LogicalFunction x, LogicalFunction y, LogicalFunction theta, LogicalFunction ts, LogicalFunction tgt_wkt) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(6); + parameters.push_back(std::move(ref_wkt)); + parameters.push_back(std::move(x)); + parameters.push_back(std::move(y)); + parameters.push_back(std::move(theta)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(tgt_wkt)); +} + +DataType EverEqTrgeometryGeoLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverEqTrgeometryGeoLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EverEqTrgeometryGeoLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverEqTrgeometryGeoLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 6, + "EverEqTrgeometryGeoLogicalFunction requires 6 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EverEqTrgeometryGeoLogicalFunction::getType() const { return NAME; } + +bool EverEqTrgeometryGeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EverEqTrgeometryGeoLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction EverEqTrgeometryGeoLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(6); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "ref_wkt must be VARSIZED"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "x must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "y must be FLOAT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::FLOAT64), "theta must be FLOAT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); + INVARIANT(c[5].getDataType().isType(DataType::Type::VARSIZED), "tgt_wkt must be VARSIZED"); + return withChildren(c); +} + +SerializableFunction EverEqTrgeometryGeoLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverEqTrgeometryGeoLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 6, + "EverEqTrgeometryGeoLogicalFunction requires 6 children but got {}", + arguments.children.size()); + return EverEqTrgeometryGeoLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4]), + std::move(arguments.children[5])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverNeGeoTrgeometryLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverNeGeoTrgeometryLogicalFunction.cpp new file mode 100644 index 0000000000..713fd63c7a --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverNeGeoTrgeometryLogicalFunction.cpp @@ -0,0 +1,111 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EverNeGeoTrgeometryLogicalFunction::EverNeGeoTrgeometryLogicalFunction(LogicalFunction tgt_wkt, LogicalFunction ref_wkt, LogicalFunction x, LogicalFunction y, LogicalFunction theta, LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(6); + parameters.push_back(std::move(tgt_wkt)); + parameters.push_back(std::move(ref_wkt)); + parameters.push_back(std::move(x)); + parameters.push_back(std::move(y)); + parameters.push_back(std::move(theta)); + parameters.push_back(std::move(ts)); +} + +DataType EverNeGeoTrgeometryLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverNeGeoTrgeometryLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EverNeGeoTrgeometryLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverNeGeoTrgeometryLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 6, + "EverNeGeoTrgeometryLogicalFunction requires 6 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EverNeGeoTrgeometryLogicalFunction::getType() const { return NAME; } + +bool EverNeGeoTrgeometryLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EverNeGeoTrgeometryLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction EverNeGeoTrgeometryLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(6); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "tgt_wkt must be VARSIZED"); + INVARIANT(c[1].getDataType().isType(DataType::Type::VARSIZED), "ref_wkt must be VARSIZED"); + INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "x must be FLOAT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::FLOAT64), "y must be FLOAT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "theta must be FLOAT64"); + INVARIANT(c[5].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); + return withChildren(c); +} + +SerializableFunction EverNeGeoTrgeometryLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverNeGeoTrgeometryLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 6, + "EverNeGeoTrgeometryLogicalFunction requires 6 children but got {}", + arguments.children.size()); + return EverNeGeoTrgeometryLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4]), + std::move(arguments.children[5])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverNeTrgeometryGeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverNeTrgeometryGeoLogicalFunction.cpp new file mode 100644 index 0000000000..7b26b63505 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverNeTrgeometryGeoLogicalFunction.cpp @@ -0,0 +1,111 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EverNeTrgeometryGeoLogicalFunction::EverNeTrgeometryGeoLogicalFunction(LogicalFunction ref_wkt, LogicalFunction x, LogicalFunction y, LogicalFunction theta, LogicalFunction ts, LogicalFunction tgt_wkt) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(6); + parameters.push_back(std::move(ref_wkt)); + parameters.push_back(std::move(x)); + parameters.push_back(std::move(y)); + parameters.push_back(std::move(theta)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(tgt_wkt)); +} + +DataType EverNeTrgeometryGeoLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverNeTrgeometryGeoLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EverNeTrgeometryGeoLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverNeTrgeometryGeoLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 6, + "EverNeTrgeometryGeoLogicalFunction requires 6 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EverNeTrgeometryGeoLogicalFunction::getType() const { return NAME; } + +bool EverNeTrgeometryGeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EverNeTrgeometryGeoLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction EverNeTrgeometryGeoLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(6); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "ref_wkt must be VARSIZED"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "x must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "y must be FLOAT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::FLOAT64), "theta must be FLOAT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); + INVARIANT(c[5].getDataType().isType(DataType::Type::VARSIZED), "tgt_wkt must be VARSIZED"); + return withChildren(c); +} + +SerializableFunction EverNeTrgeometryGeoLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverNeTrgeometryGeoLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 6, + "EverNeTrgeometryGeoLogicalFunction requires 6 children but got {}", + arguments.children.size()); + return EverNeTrgeometryGeoLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4]), + std::move(arguments.children[5])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/NadTrgeometryGeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/NadTrgeometryGeoLogicalFunction.cpp new file mode 100644 index 0000000000..222a503a8f --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/NadTrgeometryGeoLogicalFunction.cpp @@ -0,0 +1,111 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +NadTrgeometryGeoLogicalFunction::NadTrgeometryGeoLogicalFunction(LogicalFunction ref_wkt, LogicalFunction x, LogicalFunction y, LogicalFunction theta, LogicalFunction ts, LogicalFunction tgt_wkt) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(6); + parameters.push_back(std::move(ref_wkt)); + parameters.push_back(std::move(x)); + parameters.push_back(std::move(y)); + parameters.push_back(std::move(theta)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(tgt_wkt)); +} + +DataType NadTrgeometryGeoLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction NadTrgeometryGeoLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector NadTrgeometryGeoLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction NadTrgeometryGeoLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 6, + "NadTrgeometryGeoLogicalFunction requires 6 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view NadTrgeometryGeoLogicalFunction::getType() const { return NAME; } + +bool NadTrgeometryGeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string NadTrgeometryGeoLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction NadTrgeometryGeoLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(6); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "ref_wkt must be VARSIZED"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "x must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "y must be FLOAT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::FLOAT64), "theta must be FLOAT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); + INVARIANT(c[5].getDataType().isType(DataType::Type::VARSIZED), "tgt_wkt must be VARSIZED"); + return withChildren(c); +} + +SerializableFunction NadTrgeometryGeoLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterNadTrgeometryGeoLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 6, + "NadTrgeometryGeoLogicalFunction requires 6 children but got {}", + arguments.children.size()); + return NadTrgeometryGeoLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4]), + std::move(arguments.children[5])); +} + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysEqGeoTrgeometryPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysEqGeoTrgeometryPhysicalFunction.hpp new file mode 100644 index 0000000000..9909f96822 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysEqGeoTrgeometryPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class AlwaysEqGeoTrgeometryPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysEqGeoTrgeometryPhysicalFunction(PhysicalFunction tgt_wkt, PhysicalFunction ref_wkt, PhysicalFunction x, PhysicalFunction y, PhysicalFunction theta, PhysicalFunction ts); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysEqTrgeometryGeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysEqTrgeometryGeoPhysicalFunction.hpp new file mode 100644 index 0000000000..338a24810d --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysEqTrgeometryGeoPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class AlwaysEqTrgeometryGeoPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysEqTrgeometryGeoPhysicalFunction(PhysicalFunction ref_wkt, PhysicalFunction x, PhysicalFunction y, PhysicalFunction theta, PhysicalFunction ts, PhysicalFunction tgt_wkt); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysNeGeoTrgeometryPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysNeGeoTrgeometryPhysicalFunction.hpp new file mode 100644 index 0000000000..19ec8bffc2 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysNeGeoTrgeometryPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class AlwaysNeGeoTrgeometryPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysNeGeoTrgeometryPhysicalFunction(PhysicalFunction tgt_wkt, PhysicalFunction ref_wkt, PhysicalFunction x, PhysicalFunction y, PhysicalFunction theta, PhysicalFunction ts); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysNeTrgeometryGeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysNeTrgeometryGeoPhysicalFunction.hpp new file mode 100644 index 0000000000..d6c20db78a --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysNeTrgeometryGeoPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class AlwaysNeTrgeometryGeoPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysNeTrgeometryGeoPhysicalFunction(PhysicalFunction ref_wkt, PhysicalFunction x, PhysicalFunction y, PhysicalFunction theta, PhysicalFunction ts, PhysicalFunction tgt_wkt); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverEqGeoTrgeometryPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverEqGeoTrgeometryPhysicalFunction.hpp new file mode 100644 index 0000000000..46bb6338b3 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverEqGeoTrgeometryPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class EverEqGeoTrgeometryPhysicalFunction : public PhysicalFunctionConcept { +public: + EverEqGeoTrgeometryPhysicalFunction(PhysicalFunction tgt_wkt, PhysicalFunction ref_wkt, PhysicalFunction x, PhysicalFunction y, PhysicalFunction theta, PhysicalFunction ts); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverEqTrgeometryGeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverEqTrgeometryGeoPhysicalFunction.hpp new file mode 100644 index 0000000000..2aef973091 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverEqTrgeometryGeoPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class EverEqTrgeometryGeoPhysicalFunction : public PhysicalFunctionConcept { +public: + EverEqTrgeometryGeoPhysicalFunction(PhysicalFunction ref_wkt, PhysicalFunction x, PhysicalFunction y, PhysicalFunction theta, PhysicalFunction ts, PhysicalFunction tgt_wkt); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverNeGeoTrgeometryPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverNeGeoTrgeometryPhysicalFunction.hpp new file mode 100644 index 0000000000..309aa7e04c --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverNeGeoTrgeometryPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class EverNeGeoTrgeometryPhysicalFunction : public PhysicalFunctionConcept { +public: + EverNeGeoTrgeometryPhysicalFunction(PhysicalFunction tgt_wkt, PhysicalFunction ref_wkt, PhysicalFunction x, PhysicalFunction y, PhysicalFunction theta, PhysicalFunction ts); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverNeTrgeometryGeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverNeTrgeometryGeoPhysicalFunction.hpp new file mode 100644 index 0000000000..b966003db8 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverNeTrgeometryGeoPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class EverNeTrgeometryGeoPhysicalFunction : public PhysicalFunctionConcept { +public: + EverNeTrgeometryGeoPhysicalFunction(PhysicalFunction ref_wkt, PhysicalFunction x, PhysicalFunction y, PhysicalFunction theta, PhysicalFunction ts, PhysicalFunction tgt_wkt); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/NadTrgeometryGeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/NadTrgeometryGeoPhysicalFunction.hpp new file mode 100644 index 0000000000..7ed02a4613 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/NadTrgeometryGeoPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class NadTrgeometryGeoPhysicalFunction : public PhysicalFunctionConcept { +public: + NadTrgeometryGeoPhysicalFunction(PhysicalFunction ref_wkt, PhysicalFunction x, PhysicalFunction y, PhysicalFunction theta, PhysicalFunction ts, PhysicalFunction tgt_wkt); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysEqGeoTrgeometryPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysEqGeoTrgeometryPhysicalFunction.cpp new file mode 100644 index 0000000000..71c5372974 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysEqGeoTrgeometryPhysicalFunction.cpp @@ -0,0 +1,98 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +#include +} + +namespace NES { + +AlwaysEqGeoTrgeometryPhysicalFunction::AlwaysEqGeoTrgeometryPhysicalFunction(PhysicalFunction tgt_wkt, PhysicalFunction ref_wkt, PhysicalFunction x, PhysicalFunction y, PhysicalFunction theta, PhysicalFunction ts) +{ + paramFns.reserve(6); + paramFns.push_back(std::move(tgt_wkt)); + paramFns.push_back(std::move(ref_wkt)); + paramFns.push_back(std::move(x)); + paramFns.push_back(std::move(y)); + paramFns.push_back(std::move(theta)); + paramFns.push_back(std::move(ts)); +} + +VarVal AlwaysEqGeoTrgeometryPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto tgt_wkt = paramFns[0].execute(record, arena); + auto ref_wkt = paramFns[1].execute(record, arena); + auto x = paramFns[2].execute(record, arena).cast(); + auto y = paramFns[3].execute(record, arena).cast(); + auto theta = paramFns[4].execute(record, arena).cast(); + auto ts = paramFns[5].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](const char* tgt_wkt, uint32_t tgt_len, const char* ref_wkt, uint32_t ref_len, double x, double y, double theta, uint64_t ts) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + char* tgt_str = (char*)malloc(tgt_len + 1); + memcpy(tgt_str, tgt_wkt, tgt_len); tgt_str[tgt_len] = '\0'; + GSERIALIZED* gs_tgt = geom_in(tgt_str, -1); free(tgt_str); + if (!gs_tgt) return 0.0; + char* ref_str = (char*)malloc(ref_len + 1); + memcpy(ref_str, ref_wkt, ref_len); ref_str[ref_len] = '\0'; + GSERIALIZED* gs_ref = geom_in(ref_str, -1); free(ref_str); + if (!gs_ref) { free(gs_tgt); return 0.0; } + Pose* pose = pose_make_2d(x, y, theta, false, 0); + if (!pose) { free(gs_tgt); free(gs_ref); return 0.0; } + TInstant* inst = trgeoinst_make(gs_ref, pose, (TimestampTz)ts); + free(gs_ref); free(pose); + if (!inst) { free(gs_tgt); return 0.0; } + int r = always_eq_geo_trgeometry(gs_tgt, (Temporal*)inst); + free(gs_tgt); free(inst); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + tgt_wkt, ref_wkt, x, y, theta, ts); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysEqGeoTrgeometryPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 6, + "AlwaysEqGeoTrgeometryPhysicalFunction requires 6 children but got {}", + arguments.childFunctions.size()); + return AlwaysEqGeoTrgeometryPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4]), + std::move(arguments.childFunctions[5])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysEqTrgeometryGeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysEqTrgeometryGeoPhysicalFunction.cpp new file mode 100644 index 0000000000..661afb57be --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysEqTrgeometryGeoPhysicalFunction.cpp @@ -0,0 +1,98 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +#include +} + +namespace NES { + +AlwaysEqTrgeometryGeoPhysicalFunction::AlwaysEqTrgeometryGeoPhysicalFunction(PhysicalFunction ref_wkt, PhysicalFunction x, PhysicalFunction y, PhysicalFunction theta, PhysicalFunction ts, PhysicalFunction tgt_wkt) +{ + paramFns.reserve(6); + paramFns.push_back(std::move(ref_wkt)); + paramFns.push_back(std::move(x)); + paramFns.push_back(std::move(y)); + paramFns.push_back(std::move(theta)); + paramFns.push_back(std::move(ts)); + paramFns.push_back(std::move(tgt_wkt)); +} + +VarVal AlwaysEqTrgeometryGeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto ref_wkt = paramFns[0].execute(record, arena); + auto x = paramFns[1].execute(record, arena).cast(); + auto y = paramFns[2].execute(record, arena).cast(); + auto theta = paramFns[3].execute(record, arena).cast(); + auto ts = paramFns[4].execute(record, arena).cast(); + auto tgt_wkt = paramFns[5].execute(record, arena); + const auto result = nautilus::invoke( + +[](const char* ref_wkt, uint32_t ref_len, double x, double y, double theta, uint64_t ts, const char* tgt_wkt, uint32_t tgt_len) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + char* ref_str = (char*)malloc(ref_len + 1); + memcpy(ref_str, ref_wkt, ref_len); ref_str[ref_len] = '\0'; + GSERIALIZED* gs_ref = geom_in(ref_str, -1); free(ref_str); + if (!gs_ref) return 0.0; + Pose* pose = pose_make_2d(x, y, theta, false, 0); + if (!pose) { free(gs_ref); return 0.0; } + TInstant* inst = trgeoinst_make(gs_ref, pose, (TimestampTz)ts); + free(gs_ref); free(pose); + if (!inst) return 0.0; + char* tgt_str = (char*)malloc(tgt_len + 1); + memcpy(tgt_str, tgt_wkt, tgt_len); tgt_str[tgt_len] = '\0'; + GSERIALIZED* gs_tgt = geom_in(tgt_str, -1); free(tgt_str); + if (!gs_tgt) { free(inst); return 0.0; } + int r = always_eq_trgeometry_geo((Temporal*)inst, gs_tgt); + free(inst); free(gs_tgt); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + ref_wkt, x, y, theta, ts, tgt_wkt); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysEqTrgeometryGeoPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 6, + "AlwaysEqTrgeometryGeoPhysicalFunction requires 6 children but got {}", + arguments.childFunctions.size()); + return AlwaysEqTrgeometryGeoPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4]), + std::move(arguments.childFunctions[5])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysNeGeoTrgeometryPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysNeGeoTrgeometryPhysicalFunction.cpp new file mode 100644 index 0000000000..635fe64a38 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysNeGeoTrgeometryPhysicalFunction.cpp @@ -0,0 +1,98 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +#include +} + +namespace NES { + +AlwaysNeGeoTrgeometryPhysicalFunction::AlwaysNeGeoTrgeometryPhysicalFunction(PhysicalFunction tgt_wkt, PhysicalFunction ref_wkt, PhysicalFunction x, PhysicalFunction y, PhysicalFunction theta, PhysicalFunction ts) +{ + paramFns.reserve(6); + paramFns.push_back(std::move(tgt_wkt)); + paramFns.push_back(std::move(ref_wkt)); + paramFns.push_back(std::move(x)); + paramFns.push_back(std::move(y)); + paramFns.push_back(std::move(theta)); + paramFns.push_back(std::move(ts)); +} + +VarVal AlwaysNeGeoTrgeometryPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto tgt_wkt = paramFns[0].execute(record, arena); + auto ref_wkt = paramFns[1].execute(record, arena); + auto x = paramFns[2].execute(record, arena).cast(); + auto y = paramFns[3].execute(record, arena).cast(); + auto theta = paramFns[4].execute(record, arena).cast(); + auto ts = paramFns[5].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](const char* tgt_wkt, uint32_t tgt_len, const char* ref_wkt, uint32_t ref_len, double x, double y, double theta, uint64_t ts) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + char* tgt_str = (char*)malloc(tgt_len + 1); + memcpy(tgt_str, tgt_wkt, tgt_len); tgt_str[tgt_len] = '\0'; + GSERIALIZED* gs_tgt = geom_in(tgt_str, -1); free(tgt_str); + if (!gs_tgt) return 0.0; + char* ref_str = (char*)malloc(ref_len + 1); + memcpy(ref_str, ref_wkt, ref_len); ref_str[ref_len] = '\0'; + GSERIALIZED* gs_ref = geom_in(ref_str, -1); free(ref_str); + if (!gs_ref) { free(gs_tgt); return 0.0; } + Pose* pose = pose_make_2d(x, y, theta, false, 0); + if (!pose) { free(gs_tgt); free(gs_ref); return 0.0; } + TInstant* inst = trgeoinst_make(gs_ref, pose, (TimestampTz)ts); + free(gs_ref); free(pose); + if (!inst) { free(gs_tgt); return 0.0; } + int r = always_ne_geo_trgeometry(gs_tgt, (Temporal*)inst); + free(gs_tgt); free(inst); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + tgt_wkt, ref_wkt, x, y, theta, ts); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysNeGeoTrgeometryPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 6, + "AlwaysNeGeoTrgeometryPhysicalFunction requires 6 children but got {}", + arguments.childFunctions.size()); + return AlwaysNeGeoTrgeometryPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4]), + std::move(arguments.childFunctions[5])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysNeTrgeometryGeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysNeTrgeometryGeoPhysicalFunction.cpp new file mode 100644 index 0000000000..95049e29ea --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysNeTrgeometryGeoPhysicalFunction.cpp @@ -0,0 +1,98 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +#include +} + +namespace NES { + +AlwaysNeTrgeometryGeoPhysicalFunction::AlwaysNeTrgeometryGeoPhysicalFunction(PhysicalFunction ref_wkt, PhysicalFunction x, PhysicalFunction y, PhysicalFunction theta, PhysicalFunction ts, PhysicalFunction tgt_wkt) +{ + paramFns.reserve(6); + paramFns.push_back(std::move(ref_wkt)); + paramFns.push_back(std::move(x)); + paramFns.push_back(std::move(y)); + paramFns.push_back(std::move(theta)); + paramFns.push_back(std::move(ts)); + paramFns.push_back(std::move(tgt_wkt)); +} + +VarVal AlwaysNeTrgeometryGeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto ref_wkt = paramFns[0].execute(record, arena); + auto x = paramFns[1].execute(record, arena).cast(); + auto y = paramFns[2].execute(record, arena).cast(); + auto theta = paramFns[3].execute(record, arena).cast(); + auto ts = paramFns[4].execute(record, arena).cast(); + auto tgt_wkt = paramFns[5].execute(record, arena); + const auto result = nautilus::invoke( + +[](const char* ref_wkt, uint32_t ref_len, double x, double y, double theta, uint64_t ts, const char* tgt_wkt, uint32_t tgt_len) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + char* ref_str = (char*)malloc(ref_len + 1); + memcpy(ref_str, ref_wkt, ref_len); ref_str[ref_len] = '\0'; + GSERIALIZED* gs_ref = geom_in(ref_str, -1); free(ref_str); + if (!gs_ref) return 0.0; + Pose* pose = pose_make_2d(x, y, theta, false, 0); + if (!pose) { free(gs_ref); return 0.0; } + TInstant* inst = trgeoinst_make(gs_ref, pose, (TimestampTz)ts); + free(gs_ref); free(pose); + if (!inst) return 0.0; + char* tgt_str = (char*)malloc(tgt_len + 1); + memcpy(tgt_str, tgt_wkt, tgt_len); tgt_str[tgt_len] = '\0'; + GSERIALIZED* gs_tgt = geom_in(tgt_str, -1); free(tgt_str); + if (!gs_tgt) { free(inst); return 0.0; } + int r = always_ne_trgeometry_geo((Temporal*)inst, gs_tgt); + free(inst); free(gs_tgt); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + ref_wkt, x, y, theta, ts, tgt_wkt); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysNeTrgeometryGeoPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 6, + "AlwaysNeTrgeometryGeoPhysicalFunction requires 6 children but got {}", + arguments.childFunctions.size()); + return AlwaysNeTrgeometryGeoPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4]), + std::move(arguments.childFunctions[5])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt index cd5a4e12d5..663ffe65b3 100644 --- a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt @@ -409,6 +409,15 @@ add_plugin(AlwaysEqTposeTpose PhysicalFunction nes-physical-operators AlwaysEqTp add_plugin(EverNeTposeTpose PhysicalFunction nes-physical-operators EverNeTposeTposePhysicalFunction.cpp) add_plugin(AlwaysNeTposeTpose PhysicalFunction nes-physical-operators AlwaysNeTposeTposePhysicalFunction.cpp) add_plugin(NadTposeTpose PhysicalFunction nes-physical-operators NadTposeTposePhysicalFunction.cpp) +add_plugin(EverEqTrgeometryGeo PhysicalFunction nes-physical-operators EverEqTrgeometryGeoPhysicalFunction.cpp) +add_plugin(AlwaysEqTrgeometryGeo PhysicalFunction nes-physical-operators AlwaysEqTrgeometryGeoPhysicalFunction.cpp) +add_plugin(EverNeTrgeometryGeo PhysicalFunction nes-physical-operators EverNeTrgeometryGeoPhysicalFunction.cpp) +add_plugin(AlwaysNeTrgeometryGeo PhysicalFunction nes-physical-operators AlwaysNeTrgeometryGeoPhysicalFunction.cpp) +add_plugin(NadTrgeometryGeo PhysicalFunction nes-physical-operators NadTrgeometryGeoPhysicalFunction.cpp) +add_plugin(EverEqGeoTrgeometry PhysicalFunction nes-physical-operators EverEqGeoTrgeometryPhysicalFunction.cpp) +add_plugin(AlwaysEqGeoTrgeometry PhysicalFunction nes-physical-operators AlwaysEqGeoTrgeometryPhysicalFunction.cpp) +add_plugin(EverNeGeoTrgeometry PhysicalFunction nes-physical-operators EverNeGeoTrgeometryPhysicalFunction.cpp) +add_plugin(AlwaysNeGeoTrgeometry PhysicalFunction nes-physical-operators AlwaysNeGeoTrgeometryPhysicalFunction.cpp) add_plugin(GeomIntersects2d PhysicalFunction nes-physical-operators GeomIntersects2dPhysicalFunction.cpp) add_plugin(GeomDwithin2d PhysicalFunction nes-physical-operators GeomDwithin2dPhysicalFunction.cpp) add_plugin(GeomContains PhysicalFunction nes-physical-operators GeomContainsPhysicalFunction.cpp) diff --git a/nes-physical-operators/src/Functions/Meos/EverEqGeoTrgeometryPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverEqGeoTrgeometryPhysicalFunction.cpp new file mode 100644 index 0000000000..bfc538e63e --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverEqGeoTrgeometryPhysicalFunction.cpp @@ -0,0 +1,98 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +#include +} + +namespace NES { + +EverEqGeoTrgeometryPhysicalFunction::EverEqGeoTrgeometryPhysicalFunction(PhysicalFunction tgt_wkt, PhysicalFunction ref_wkt, PhysicalFunction x, PhysicalFunction y, PhysicalFunction theta, PhysicalFunction ts) +{ + paramFns.reserve(6); + paramFns.push_back(std::move(tgt_wkt)); + paramFns.push_back(std::move(ref_wkt)); + paramFns.push_back(std::move(x)); + paramFns.push_back(std::move(y)); + paramFns.push_back(std::move(theta)); + paramFns.push_back(std::move(ts)); +} + +VarVal EverEqGeoTrgeometryPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto tgt_wkt = paramFns[0].execute(record, arena); + auto ref_wkt = paramFns[1].execute(record, arena); + auto x = paramFns[2].execute(record, arena).cast(); + auto y = paramFns[3].execute(record, arena).cast(); + auto theta = paramFns[4].execute(record, arena).cast(); + auto ts = paramFns[5].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](const char* tgt_wkt, uint32_t tgt_len, const char* ref_wkt, uint32_t ref_len, double x, double y, double theta, uint64_t ts) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + char* tgt_str = (char*)malloc(tgt_len + 1); + memcpy(tgt_str, tgt_wkt, tgt_len); tgt_str[tgt_len] = '\0'; + GSERIALIZED* gs_tgt = geom_in(tgt_str, -1); free(tgt_str); + if (!gs_tgt) return 0.0; + char* ref_str = (char*)malloc(ref_len + 1); + memcpy(ref_str, ref_wkt, ref_len); ref_str[ref_len] = '\0'; + GSERIALIZED* gs_ref = geom_in(ref_str, -1); free(ref_str); + if (!gs_ref) { free(gs_tgt); return 0.0; } + Pose* pose = pose_make_2d(x, y, theta, false, 0); + if (!pose) { free(gs_tgt); free(gs_ref); return 0.0; } + TInstant* inst = trgeoinst_make(gs_ref, pose, (TimestampTz)ts); + free(gs_ref); free(pose); + if (!inst) { free(gs_tgt); return 0.0; } + int r = ever_eq_geo_trgeometry(gs_tgt, (Temporal*)inst); + free(gs_tgt); free(inst); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + tgt_wkt, ref_wkt, x, y, theta, ts); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverEqGeoTrgeometryPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 6, + "EverEqGeoTrgeometryPhysicalFunction requires 6 children but got {}", + arguments.childFunctions.size()); + return EverEqGeoTrgeometryPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4]), + std::move(arguments.childFunctions[5])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverEqTrgeometryGeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverEqTrgeometryGeoPhysicalFunction.cpp new file mode 100644 index 0000000000..75a87fa847 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverEqTrgeometryGeoPhysicalFunction.cpp @@ -0,0 +1,98 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +#include +} + +namespace NES { + +EverEqTrgeometryGeoPhysicalFunction::EverEqTrgeometryGeoPhysicalFunction(PhysicalFunction ref_wkt, PhysicalFunction x, PhysicalFunction y, PhysicalFunction theta, PhysicalFunction ts, PhysicalFunction tgt_wkt) +{ + paramFns.reserve(6); + paramFns.push_back(std::move(ref_wkt)); + paramFns.push_back(std::move(x)); + paramFns.push_back(std::move(y)); + paramFns.push_back(std::move(theta)); + paramFns.push_back(std::move(ts)); + paramFns.push_back(std::move(tgt_wkt)); +} + +VarVal EverEqTrgeometryGeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto ref_wkt = paramFns[0].execute(record, arena); + auto x = paramFns[1].execute(record, arena).cast(); + auto y = paramFns[2].execute(record, arena).cast(); + auto theta = paramFns[3].execute(record, arena).cast(); + auto ts = paramFns[4].execute(record, arena).cast(); + auto tgt_wkt = paramFns[5].execute(record, arena); + const auto result = nautilus::invoke( + +[](const char* ref_wkt, uint32_t ref_len, double x, double y, double theta, uint64_t ts, const char* tgt_wkt, uint32_t tgt_len) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + char* ref_str = (char*)malloc(ref_len + 1); + memcpy(ref_str, ref_wkt, ref_len); ref_str[ref_len] = '\0'; + GSERIALIZED* gs_ref = geom_in(ref_str, -1); free(ref_str); + if (!gs_ref) return 0.0; + Pose* pose = pose_make_2d(x, y, theta, false, 0); + if (!pose) { free(gs_ref); return 0.0; } + TInstant* inst = trgeoinst_make(gs_ref, pose, (TimestampTz)ts); + free(gs_ref); free(pose); + if (!inst) return 0.0; + char* tgt_str = (char*)malloc(tgt_len + 1); + memcpy(tgt_str, tgt_wkt, tgt_len); tgt_str[tgt_len] = '\0'; + GSERIALIZED* gs_tgt = geom_in(tgt_str, -1); free(tgt_str); + if (!gs_tgt) { free(inst); return 0.0; } + int r = ever_eq_trgeometry_geo((Temporal*)inst, gs_tgt); + free(inst); free(gs_tgt); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + ref_wkt, x, y, theta, ts, tgt_wkt); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverEqTrgeometryGeoPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 6, + "EverEqTrgeometryGeoPhysicalFunction requires 6 children but got {}", + arguments.childFunctions.size()); + return EverEqTrgeometryGeoPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4]), + std::move(arguments.childFunctions[5])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverNeGeoTrgeometryPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverNeGeoTrgeometryPhysicalFunction.cpp new file mode 100644 index 0000000000..efe0c7ca48 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverNeGeoTrgeometryPhysicalFunction.cpp @@ -0,0 +1,98 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +#include +} + +namespace NES { + +EverNeGeoTrgeometryPhysicalFunction::EverNeGeoTrgeometryPhysicalFunction(PhysicalFunction tgt_wkt, PhysicalFunction ref_wkt, PhysicalFunction x, PhysicalFunction y, PhysicalFunction theta, PhysicalFunction ts) +{ + paramFns.reserve(6); + paramFns.push_back(std::move(tgt_wkt)); + paramFns.push_back(std::move(ref_wkt)); + paramFns.push_back(std::move(x)); + paramFns.push_back(std::move(y)); + paramFns.push_back(std::move(theta)); + paramFns.push_back(std::move(ts)); +} + +VarVal EverNeGeoTrgeometryPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto tgt_wkt = paramFns[0].execute(record, arena); + auto ref_wkt = paramFns[1].execute(record, arena); + auto x = paramFns[2].execute(record, arena).cast(); + auto y = paramFns[3].execute(record, arena).cast(); + auto theta = paramFns[4].execute(record, arena).cast(); + auto ts = paramFns[5].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](const char* tgt_wkt, uint32_t tgt_len, const char* ref_wkt, uint32_t ref_len, double x, double y, double theta, uint64_t ts) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + char* tgt_str = (char*)malloc(tgt_len + 1); + memcpy(tgt_str, tgt_wkt, tgt_len); tgt_str[tgt_len] = '\0'; + GSERIALIZED* gs_tgt = geom_in(tgt_str, -1); free(tgt_str); + if (!gs_tgt) return 0.0; + char* ref_str = (char*)malloc(ref_len + 1); + memcpy(ref_str, ref_wkt, ref_len); ref_str[ref_len] = '\0'; + GSERIALIZED* gs_ref = geom_in(ref_str, -1); free(ref_str); + if (!gs_ref) { free(gs_tgt); return 0.0; } + Pose* pose = pose_make_2d(x, y, theta, false, 0); + if (!pose) { free(gs_tgt); free(gs_ref); return 0.0; } + TInstant* inst = trgeoinst_make(gs_ref, pose, (TimestampTz)ts); + free(gs_ref); free(pose); + if (!inst) { free(gs_tgt); return 0.0; } + int r = ever_ne_geo_trgeometry(gs_tgt, (Temporal*)inst); + free(gs_tgt); free(inst); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + tgt_wkt, ref_wkt, x, y, theta, ts); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverNeGeoTrgeometryPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 6, + "EverNeGeoTrgeometryPhysicalFunction requires 6 children but got {}", + arguments.childFunctions.size()); + return EverNeGeoTrgeometryPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4]), + std::move(arguments.childFunctions[5])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverNeTrgeometryGeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverNeTrgeometryGeoPhysicalFunction.cpp new file mode 100644 index 0000000000..f0a6d1da5a --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverNeTrgeometryGeoPhysicalFunction.cpp @@ -0,0 +1,98 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +#include +} + +namespace NES { + +EverNeTrgeometryGeoPhysicalFunction::EverNeTrgeometryGeoPhysicalFunction(PhysicalFunction ref_wkt, PhysicalFunction x, PhysicalFunction y, PhysicalFunction theta, PhysicalFunction ts, PhysicalFunction tgt_wkt) +{ + paramFns.reserve(6); + paramFns.push_back(std::move(ref_wkt)); + paramFns.push_back(std::move(x)); + paramFns.push_back(std::move(y)); + paramFns.push_back(std::move(theta)); + paramFns.push_back(std::move(ts)); + paramFns.push_back(std::move(tgt_wkt)); +} + +VarVal EverNeTrgeometryGeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto ref_wkt = paramFns[0].execute(record, arena); + auto x = paramFns[1].execute(record, arena).cast(); + auto y = paramFns[2].execute(record, arena).cast(); + auto theta = paramFns[3].execute(record, arena).cast(); + auto ts = paramFns[4].execute(record, arena).cast(); + auto tgt_wkt = paramFns[5].execute(record, arena); + const auto result = nautilus::invoke( + +[](const char* ref_wkt, uint32_t ref_len, double x, double y, double theta, uint64_t ts, const char* tgt_wkt, uint32_t tgt_len) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + char* ref_str = (char*)malloc(ref_len + 1); + memcpy(ref_str, ref_wkt, ref_len); ref_str[ref_len] = '\0'; + GSERIALIZED* gs_ref = geom_in(ref_str, -1); free(ref_str); + if (!gs_ref) return 0.0; + Pose* pose = pose_make_2d(x, y, theta, false, 0); + if (!pose) { free(gs_ref); return 0.0; } + TInstant* inst = trgeoinst_make(gs_ref, pose, (TimestampTz)ts); + free(gs_ref); free(pose); + if (!inst) return 0.0; + char* tgt_str = (char*)malloc(tgt_len + 1); + memcpy(tgt_str, tgt_wkt, tgt_len); tgt_str[tgt_len] = '\0'; + GSERIALIZED* gs_tgt = geom_in(tgt_str, -1); free(tgt_str); + if (!gs_tgt) { free(inst); return 0.0; } + int r = ever_ne_trgeometry_geo((Temporal*)inst, gs_tgt); + free(inst); free(gs_tgt); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + ref_wkt, x, y, theta, ts, tgt_wkt); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverNeTrgeometryGeoPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 6, + "EverNeTrgeometryGeoPhysicalFunction requires 6 children but got {}", + arguments.childFunctions.size()); + return EverNeTrgeometryGeoPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4]), + std::move(arguments.childFunctions[5])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/NadTrgeometryGeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/NadTrgeometryGeoPhysicalFunction.cpp new file mode 100644 index 0000000000..850aa84dd8 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/NadTrgeometryGeoPhysicalFunction.cpp @@ -0,0 +1,98 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +#include +} + +namespace NES { + +NadTrgeometryGeoPhysicalFunction::NadTrgeometryGeoPhysicalFunction(PhysicalFunction ref_wkt, PhysicalFunction x, PhysicalFunction y, PhysicalFunction theta, PhysicalFunction ts, PhysicalFunction tgt_wkt) +{ + paramFns.reserve(6); + paramFns.push_back(std::move(ref_wkt)); + paramFns.push_back(std::move(x)); + paramFns.push_back(std::move(y)); + paramFns.push_back(std::move(theta)); + paramFns.push_back(std::move(ts)); + paramFns.push_back(std::move(tgt_wkt)); +} + +VarVal NadTrgeometryGeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto ref_wkt = paramFns[0].execute(record, arena); + auto x = paramFns[1].execute(record, arena).cast(); + auto y = paramFns[2].execute(record, arena).cast(); + auto theta = paramFns[3].execute(record, arena).cast(); + auto ts = paramFns[4].execute(record, arena).cast(); + auto tgt_wkt = paramFns[5].execute(record, arena); + const auto result = nautilus::invoke( + +[](const char* ref_wkt, uint32_t ref_len, double x, double y, double theta, uint64_t ts, const char* tgt_wkt, uint32_t tgt_len) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + char* ref_str = (char*)malloc(ref_len + 1); + memcpy(ref_str, ref_wkt, ref_len); ref_str[ref_len] = '\0'; + GSERIALIZED* gs_ref = geom_in(ref_str, -1); free(ref_str); + if (!gs_ref) return 0.0; + Pose* pose = pose_make_2d(x, y, theta, false, 0); + if (!pose) { free(gs_ref); return 0.0; } + TInstant* inst = trgeoinst_make(gs_ref, pose, (TimestampTz)ts); + free(gs_ref); free(pose); + if (!inst) return 0.0; + char* tgt_str = (char*)malloc(tgt_len + 1); + memcpy(tgt_str, tgt_wkt, tgt_len); tgt_str[tgt_len] = '\0'; + GSERIALIZED* gs_tgt = geom_in(tgt_str, -1); free(tgt_str); + if (!gs_tgt) { free(inst); return 0.0; } + double r = nad_trgeometry_geo((Temporal*)inst, gs_tgt); + free(inst); free(gs_tgt); + return r; + } catch (const std::exception&) { return 0.0; } + }, + ref_wkt, x, y, theta, ts, tgt_wkt); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterNadTrgeometryGeoPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 6, + "NadTrgeometryGeoPhysicalFunction requires 6 children but got {}", + arguments.childFunctions.size()); + return NadTrgeometryGeoPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4]), + std::move(arguments.childFunctions[5])); +} + +} // namespace NES diff --git a/nes-sql-parser/AntlrSQL.g4 b/nes-sql-parser/AntlrSQL.g4 index 921fdee9c3..2898b8cc13 100644 --- a/nes-sql-parser/AntlrSQL.g4 +++ b/nes-sql-parser/AntlrSQL.g4 @@ -295,7 +295,7 @@ timeUnit: MS timestampParameter: name=identifier; -functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT | TGE_TTEXT_TEXT | TGE_TEXT_TTEXT | TGT_TTEXT_TEXT | TGT_TEXT_TTEXT | TLE_TTEXT_TEXT | TLE_TEXT_TTEXT | TLT_TTEXT_TEXT | TLT_TEXT_TTEXT | TTEXT_UPPER | TTEXT_LOWER | TTEXT_INITCAP | TEXTCAT_TTEXT_TEXT | TEXTCAT_TEXT_TTEXT | TEXTCAT_TTEXT_TTEXT | GEOM_LENGTH | GEOM_PERIMETER | GEOM_AZIMUTH | GEOG_AREA | GEOG_LENGTH | GEOG_PERIMETER | GEOM_IS_EMPTY | AINTERSECTS_TGEO_GEO | ACOVERS_TGEO_GEO | ADISJOINT_TGEO_GEO | ADWITHIN_TGEO_GEO | EINTERSECTS_TGEO_GEO | ETOUCHES_TGEO_GEO | ECONTAINS_TGEO_GEO | ACONTAINS_TGEO_GEO | ATOUCHES_TGEO_GEO | GEO_NUM_POINTS | GEO_NUM_GEOS | GEO_SRID | GEO_IS_UNITARY | GEO_EQUALS | GEO_SAME | GEOG_DISTANCE | NAD_TGEO_GEO | EVER_EQ_TGEO_GEO | EVER_NE_TGEO_GEO | ALWAYS_EQ_TGEO_GEO | ALWAYS_NE_TGEO_GEO | GEOG_INTERSECTS | GEOG_DWITHIN | ACOVERS_GEO_TGEO | GEOM_INTERSECTS | GEOM_DWITHIN | H3_GS_POINT_TO_CELL | EVER_EQ_TH3INDEX_H3INDEX | EVER_NE_TH3INDEX_H3INDEX | ALWAYS_EQ_TH3INDEX_H3INDEX | ALWAYS_NE_TH3INDEX_H3INDEX | TH3INDEX_GET_RESOLUTION | TH3INDEX_GET_BASE_CELL_NUMBER | TH3INDEX_IS_VALID_CELL | TH3INDEX_IS_PENTAGON | TH3INDEX_CELL_TO_PARENT_NEXT | TH3INDEX_CELL_TO_CENTER_CHILD_NEXT | TH3INDEX_CELL_TO_PARENT | TH3INDEX_CELL_TO_CENTER_CHILD | TH3INDEX_CELL_TO_CHILD_POS | TH3INDEX_ARE_NEIGHBOR_CELLS | TH3INDEX_GRID_DISTANCE | EINTERSECTS_TCBUFFER_GEO | AINTERSECTS_TCBUFFER_GEO | ECOVERS_TCBUFFER_GEO | ACOVERS_TCBUFFER_GEO | EDISJOINT_TCBUFFER_GEO | ADISJOINT_TCBUFFER_GEO | ETOUCHES_TCBUFFER_GEO | ATOUCHES_TCBUFFER_GEO | ECONTAINS_TCBUFFER_GEO | ACONTAINS_TCBUFFER_GEO | NAD_TCBUFFER_GEO | EDWITHIN_TCBUFFER_GEO | ADWITHIN_TCBUFFER_GEO | EINTERSECTS_TCBUFFER_CBUFFER | AINTERSECTS_TCBUFFER_CBUFFER | ECOVERS_TCBUFFER_CBUFFER | ACOVERS_TCBUFFER_CBUFFER | EDISJOINT_TCBUFFER_CBUFFER | ADISJOINT_TCBUFFER_CBUFFER | ETOUCHES_TCBUFFER_CBUFFER | ATOUCHES_TCBUFFER_CBUFFER | ECONTAINS_TCBUFFER_CBUFFER | ACONTAINS_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_CBUFFER | ALWAYS_EQ_TCBUFFER_CBUFFER | EVER_NE_TCBUFFER_CBUFFER | ALWAYS_NE_TCBUFFER_CBUFFER | NAD_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_TCBUFFER | ALWAYS_EQ_TCBUFFER_TCBUFFER | EVER_NE_TCBUFFER_TCBUFFER | ALWAYS_NE_TCBUFFER_TCBUFFER | EINTERSECTS_TCBUFFER_TCBUFFER | AINTERSECTS_TCBUFFER_TCBUFFER | ECOVERS_TCBUFFER_TCBUFFER | ACOVERS_TCBUFFER_TCBUFFER | ADISJOINT_TCBUFFER_TCBUFFER | ETOUCHES_TCBUFFER_TCBUFFER | ATOUCHES_TCBUFFER_TCBUFFER | NAD_TCBUFFER_TCBUFFER | EDWITHIN_TCBUFFER_TCBUFFER | ADWITHIN_TCBUFFER_TCBUFFER | MINDISTANCE_TCBUFFER_TCBUFFER | NAD_TNPOINT_GEO | EVER_EQ_TNPOINT_NPOINT | ALWAYS_EQ_TNPOINT_NPOINT | EVER_NE_TNPOINT_NPOINT | ALWAYS_NE_TNPOINT_NPOINT | NAD_TNPOINT_NPOINT | EVER_EQ_NPOINT_TNPOINT | ALWAYS_EQ_NPOINT_TNPOINT | EVER_NE_NPOINT_TNPOINT | ALWAYS_NE_NPOINT_TNPOINT | EVER_EQ_TNPOINT_TNPOINT | ALWAYS_EQ_TNPOINT_TNPOINT | EVER_NE_TNPOINT_TNPOINT | ALWAYS_NE_TNPOINT_TNPOINT | NAD_TNPOINT_TNPOINT | NAD_TPOSE_GEO | EVER_EQ_TPOSE_POSE | ALWAYS_EQ_TPOSE_POSE | EVER_NE_TPOSE_POSE | ALWAYS_NE_TPOSE_POSE | NAD_TPOSE_POSE | EVER_EQ_POSE_TPOSE | ALWAYS_EQ_POSE_TPOSE | EVER_NE_POSE_TPOSE | ALWAYS_NE_POSE_TPOSE | EVER_EQ_TPOSE_TPOSE | ALWAYS_EQ_TPOSE_TPOSE | EVER_NE_TPOSE_TPOSE | ALWAYS_NE_TPOSE_TPOSE | NAD_TPOSE_TPOSE | GEOM_INTERSECTS2D | GEOM_DWITHIN2D | GEOM_CONTAINS | GEOM_DISJOINT2D | GEOM_COVERS | GEOM_TOUCHES | GEOM_INTERSECTS3D | GEOM_DWITHIN3D | GEOM_DISTANCE2D | GEOM_DISTANCE3D; +functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT | TGE_TTEXT_TEXT | TGE_TEXT_TTEXT | TGT_TTEXT_TEXT | TGT_TEXT_TTEXT | TLE_TTEXT_TEXT | TLE_TEXT_TTEXT | TLT_TTEXT_TEXT | TLT_TEXT_TTEXT | TTEXT_UPPER | TTEXT_LOWER | TTEXT_INITCAP | TEXTCAT_TTEXT_TEXT | TEXTCAT_TEXT_TTEXT | TEXTCAT_TTEXT_TTEXT | GEOM_LENGTH | GEOM_PERIMETER | GEOM_AZIMUTH | GEOG_AREA | GEOG_LENGTH | GEOG_PERIMETER | GEOM_IS_EMPTY | AINTERSECTS_TGEO_GEO | ACOVERS_TGEO_GEO | ADISJOINT_TGEO_GEO | ADWITHIN_TGEO_GEO | EINTERSECTS_TGEO_GEO | ETOUCHES_TGEO_GEO | ECONTAINS_TGEO_GEO | ACONTAINS_TGEO_GEO | ATOUCHES_TGEO_GEO | GEO_NUM_POINTS | GEO_NUM_GEOS | GEO_SRID | GEO_IS_UNITARY | GEO_EQUALS | GEO_SAME | GEOG_DISTANCE | NAD_TGEO_GEO | EVER_EQ_TGEO_GEO | EVER_NE_TGEO_GEO | ALWAYS_EQ_TGEO_GEO | ALWAYS_NE_TGEO_GEO | GEOG_INTERSECTS | GEOG_DWITHIN | ACOVERS_GEO_TGEO | GEOM_INTERSECTS | GEOM_DWITHIN | H3_GS_POINT_TO_CELL | EVER_EQ_TH3INDEX_H3INDEX | EVER_NE_TH3INDEX_H3INDEX | ALWAYS_EQ_TH3INDEX_H3INDEX | ALWAYS_NE_TH3INDEX_H3INDEX | TH3INDEX_GET_RESOLUTION | TH3INDEX_GET_BASE_CELL_NUMBER | TH3INDEX_IS_VALID_CELL | TH3INDEX_IS_PENTAGON | TH3INDEX_CELL_TO_PARENT_NEXT | TH3INDEX_CELL_TO_CENTER_CHILD_NEXT | TH3INDEX_CELL_TO_PARENT | TH3INDEX_CELL_TO_CENTER_CHILD | TH3INDEX_CELL_TO_CHILD_POS | TH3INDEX_ARE_NEIGHBOR_CELLS | TH3INDEX_GRID_DISTANCE | EINTERSECTS_TCBUFFER_GEO | AINTERSECTS_TCBUFFER_GEO | ECOVERS_TCBUFFER_GEO | ACOVERS_TCBUFFER_GEO | EDISJOINT_TCBUFFER_GEO | ADISJOINT_TCBUFFER_GEO | ETOUCHES_TCBUFFER_GEO | ATOUCHES_TCBUFFER_GEO | ECONTAINS_TCBUFFER_GEO | ACONTAINS_TCBUFFER_GEO | NAD_TCBUFFER_GEO | EDWITHIN_TCBUFFER_GEO | ADWITHIN_TCBUFFER_GEO | EINTERSECTS_TCBUFFER_CBUFFER | AINTERSECTS_TCBUFFER_CBUFFER | ECOVERS_TCBUFFER_CBUFFER | ACOVERS_TCBUFFER_CBUFFER | EDISJOINT_TCBUFFER_CBUFFER | ADISJOINT_TCBUFFER_CBUFFER | ETOUCHES_TCBUFFER_CBUFFER | ATOUCHES_TCBUFFER_CBUFFER | ECONTAINS_TCBUFFER_CBUFFER | ACONTAINS_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_CBUFFER | ALWAYS_EQ_TCBUFFER_CBUFFER | EVER_NE_TCBUFFER_CBUFFER | ALWAYS_NE_TCBUFFER_CBUFFER | NAD_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_TCBUFFER | ALWAYS_EQ_TCBUFFER_TCBUFFER | EVER_NE_TCBUFFER_TCBUFFER | ALWAYS_NE_TCBUFFER_TCBUFFER | EINTERSECTS_TCBUFFER_TCBUFFER | AINTERSECTS_TCBUFFER_TCBUFFER | ECOVERS_TCBUFFER_TCBUFFER | ACOVERS_TCBUFFER_TCBUFFER | ADISJOINT_TCBUFFER_TCBUFFER | ETOUCHES_TCBUFFER_TCBUFFER | ATOUCHES_TCBUFFER_TCBUFFER | NAD_TCBUFFER_TCBUFFER | EDWITHIN_TCBUFFER_TCBUFFER | ADWITHIN_TCBUFFER_TCBUFFER | MINDISTANCE_TCBUFFER_TCBUFFER | NAD_TNPOINT_GEO | EVER_EQ_TNPOINT_NPOINT | ALWAYS_EQ_TNPOINT_NPOINT | EVER_NE_TNPOINT_NPOINT | ALWAYS_NE_TNPOINT_NPOINT | NAD_TNPOINT_NPOINT | EVER_EQ_NPOINT_TNPOINT | ALWAYS_EQ_NPOINT_TNPOINT | EVER_NE_NPOINT_TNPOINT | ALWAYS_NE_NPOINT_TNPOINT | EVER_EQ_TNPOINT_TNPOINT | ALWAYS_EQ_TNPOINT_TNPOINT | EVER_NE_TNPOINT_TNPOINT | ALWAYS_NE_TNPOINT_TNPOINT | NAD_TNPOINT_TNPOINT | NAD_TPOSE_GEO | EVER_EQ_TPOSE_POSE | ALWAYS_EQ_TPOSE_POSE | EVER_NE_TPOSE_POSE | ALWAYS_NE_TPOSE_POSE | NAD_TPOSE_POSE | EVER_EQ_POSE_TPOSE | ALWAYS_EQ_POSE_TPOSE | EVER_NE_POSE_TPOSE | ALWAYS_NE_POSE_TPOSE | EVER_EQ_TPOSE_TPOSE | ALWAYS_EQ_TPOSE_TPOSE | EVER_NE_TPOSE_TPOSE | ALWAYS_NE_TPOSE_TPOSE | NAD_TPOSE_TPOSE | EVER_EQ_TRGEOMETRY_GEO | ALWAYS_EQ_TRGEOMETRY_GEO | EVER_NE_TRGEOMETRY_GEO | ALWAYS_NE_TRGEOMETRY_GEO | NAD_TRGEOMETRY_GEO | EVER_EQ_GEO_TRGEOMETRY | ALWAYS_EQ_GEO_TRGEOMETRY | EVER_NE_GEO_TRGEOMETRY | ALWAYS_NE_GEO_TRGEOMETRY | GEOM_INTERSECTS2D | GEOM_DWITHIN2D | GEOM_CONTAINS | GEOM_DISJOINT2D | GEOM_COVERS | GEOM_TOUCHES | GEOM_INTERSECTS3D | GEOM_DWITHIN3D | GEOM_DISTANCE2D | GEOM_DISTANCE3D; sinkClause: INTO sink (',' sink)*; @@ -880,6 +880,15 @@ ALWAYS_EQ_TPOSE_TPOSE: 'ALWAYS_EQ_TPOSE_TPOSE' | 'always_eq_tpose_tpose'; EVER_NE_TPOSE_TPOSE: 'EVER_NE_TPOSE_TPOSE' | 'ever_ne_tpose_tpose'; ALWAYS_NE_TPOSE_TPOSE: 'ALWAYS_NE_TPOSE_TPOSE' | 'always_ne_tpose_tpose'; NAD_TPOSE_TPOSE: 'NAD_TPOSE_TPOSE' | 'nad_tpose_tpose'; +EVER_EQ_TRGEOMETRY_GEO: 'EVER_EQ_TRGEOMETRY_GEO' | 'ever_eq_trgeometry_geo'; +ALWAYS_EQ_TRGEOMETRY_GEO: 'ALWAYS_EQ_TRGEOMETRY_GEO' | 'always_eq_trgeometry_geo'; +EVER_NE_TRGEOMETRY_GEO: 'EVER_NE_TRGEOMETRY_GEO' | 'ever_ne_trgeometry_geo'; +ALWAYS_NE_TRGEOMETRY_GEO: 'ALWAYS_NE_TRGEOMETRY_GEO' | 'always_ne_trgeometry_geo'; +NAD_TRGEOMETRY_GEO: 'NAD_TRGEOMETRY_GEO' | 'nad_trgeometry_geo'; +EVER_EQ_GEO_TRGEOMETRY: 'EVER_EQ_GEO_TRGEOMETRY' | 'ever_eq_geo_trgeometry'; +ALWAYS_EQ_GEO_TRGEOMETRY: 'ALWAYS_EQ_GEO_TRGEOMETRY' | 'always_eq_geo_trgeometry'; +EVER_NE_GEO_TRGEOMETRY: 'EVER_NE_GEO_TRGEOMETRY' | 'ever_ne_geo_trgeometry'; +ALWAYS_NE_GEO_TRGEOMETRY: 'ALWAYS_NE_GEO_TRGEOMETRY' | 'always_ne_geo_trgeometry'; GEOM_INTERSECTS2D: 'GEOM_INTERSECTS2D' | 'geom_intersects2d'; GEOM_DWITHIN2D: 'GEOM_DWITHIN2D' | 'geom_dwithin2d'; GEOM_CONTAINS: 'GEOM_CONTAINS' | 'geom_contains'; diff --git a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp index c00cd35b42..2eeeb29e3f 100644 --- a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp +++ b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp @@ -461,6 +461,15 @@ #include #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include @@ -10360,6 +10369,123 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont return LogicalFunction(NadTposeTposeLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6), std::move(arg7))); } /* END CODEGEN PARSER GLUE: NAD_TPOSE_TPOSE */ + case AntlrSQLParser::EVER_EQ_TRGEOMETRY_GEO: { + PRECONDITION(ctx->functionParam().size() == 6, + "EverEqTrgeometryGeo requires 6 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + auto arg5 = visit(ctx->functionParam(5)).as(); + return LogicalFunction(EverEqTrgeometryGeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5))); + } + /* END CODEGEN PARSER GLUE: EVER_EQ_TRGEOMETRY_GEO */ + case AntlrSQLParser::ALWAYS_EQ_TRGEOMETRY_GEO: { + PRECONDITION(ctx->functionParam().size() == 6, + "AlwaysEqTrgeometryGeo requires 6 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + auto arg5 = visit(ctx->functionParam(5)).as(); + return LogicalFunction(AlwaysEqTrgeometryGeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5))); + } + /* END CODEGEN PARSER GLUE: ALWAYS_EQ_TRGEOMETRY_GEO */ + case AntlrSQLParser::EVER_NE_TRGEOMETRY_GEO: { + PRECONDITION(ctx->functionParam().size() == 6, + "EverNeTrgeometryGeo requires 6 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + auto arg5 = visit(ctx->functionParam(5)).as(); + return LogicalFunction(EverNeTrgeometryGeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5))); + } + /* END CODEGEN PARSER GLUE: EVER_NE_TRGEOMETRY_GEO */ + case AntlrSQLParser::ALWAYS_NE_TRGEOMETRY_GEO: { + PRECONDITION(ctx->functionParam().size() == 6, + "AlwaysNeTrgeometryGeo requires 6 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + auto arg5 = visit(ctx->functionParam(5)).as(); + return LogicalFunction(AlwaysNeTrgeometryGeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5))); + } + /* END CODEGEN PARSER GLUE: ALWAYS_NE_TRGEOMETRY_GEO */ + case AntlrSQLParser::NAD_TRGEOMETRY_GEO: { + PRECONDITION(ctx->functionParam().size() == 6, + "NadTrgeometryGeo requires 6 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + auto arg5 = visit(ctx->functionParam(5)).as(); + return LogicalFunction(NadTrgeometryGeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5))); + } + /* END CODEGEN PARSER GLUE: NAD_TRGEOMETRY_GEO */ + case AntlrSQLParser::EVER_EQ_GEO_TRGEOMETRY: { + PRECONDITION(ctx->functionParam().size() == 6, + "EverEqGeoTrgeometry requires 6 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + auto arg5 = visit(ctx->functionParam(5)).as(); + return LogicalFunction(EverEqGeoTrgeometryLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5))); + } + /* END CODEGEN PARSER GLUE: EVER_EQ_GEO_TRGEOMETRY */ + case AntlrSQLParser::ALWAYS_EQ_GEO_TRGEOMETRY: { + PRECONDITION(ctx->functionParam().size() == 6, + "AlwaysEqGeoTrgeometry requires 6 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + auto arg5 = visit(ctx->functionParam(5)).as(); + return LogicalFunction(AlwaysEqGeoTrgeometryLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5))); + } + /* END CODEGEN PARSER GLUE: ALWAYS_EQ_GEO_TRGEOMETRY */ + case AntlrSQLParser::EVER_NE_GEO_TRGEOMETRY: { + PRECONDITION(ctx->functionParam().size() == 6, + "EverNeGeoTrgeometry requires 6 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + auto arg5 = visit(ctx->functionParam(5)).as(); + return LogicalFunction(EverNeGeoTrgeometryLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5))); + } + /* END CODEGEN PARSER GLUE: EVER_NE_GEO_TRGEOMETRY */ + case AntlrSQLParser::ALWAYS_NE_GEO_TRGEOMETRY: { + PRECONDITION(ctx->functionParam().size() == 6, + "AlwaysNeGeoTrgeometry requires 6 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + auto arg5 = visit(ctx->functionParam(5)).as(); + return LogicalFunction(AlwaysNeGeoTrgeometryLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5))); + } + /* END CODEGEN PARSER GLUE: ALWAYS_NE_GEO_TRGEOMETRY */ /* END CODEGEN PARSER GLUE: GEOM_INTERSECTS2D */ case AntlrSQLParser::GEOM_DWITHIN2D: { PRECONDITION(ctx->functionParam().size() == 3, From 90728184b198986a64b42a61657949c10e85aac9 Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Mon, 15 Jun 2026 10:19:35 +0200 Subject: [PATCH 71/96] feat(meos): add trgeometry_trgeometry 2D per-event scalar operators (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). --- ...sEqTrgeometryTrgeometryLogicalFunction.hpp | 48 +++++++ ...sNeTrgeometryTrgeometryLogicalFunction.hpp | 48 +++++++ ...rEqTrgeometryTrgeometryLogicalFunction.hpp | 48 +++++++ ...rNeTrgeometryTrgeometryLogicalFunction.hpp | 48 +++++++ ...NadTrgeometryTrgeometryLogicalFunction.hpp | 48 +++++++ ...sEqTrgeometryTrgeometryLogicalFunction.cpp | 123 ++++++++++++++++++ ...sNeTrgeometryTrgeometryLogicalFunction.cpp | 123 ++++++++++++++++++ .../src/Functions/Meos/CMakeLists.txt | 5 + ...rEqTrgeometryTrgeometryLogicalFunction.cpp | 123 ++++++++++++++++++ ...rNeTrgeometryTrgeometryLogicalFunction.cpp | 123 ++++++++++++++++++ ...NadTrgeometryTrgeometryLogicalFunction.cpp | 123 ++++++++++++++++++ ...EqTrgeometryTrgeometryPhysicalFunction.hpp | 32 +++++ ...NeTrgeometryTrgeometryPhysicalFunction.hpp | 32 +++++ ...EqTrgeometryTrgeometryPhysicalFunction.hpp | 32 +++++ ...NeTrgeometryTrgeometryPhysicalFunction.hpp | 32 +++++ ...adTrgeometryTrgeometryPhysicalFunction.hpp | 32 +++++ ...EqTrgeometryTrgeometryPhysicalFunction.cpp | 115 ++++++++++++++++ ...NeTrgeometryTrgeometryPhysicalFunction.cpp | 115 ++++++++++++++++ .../src/Functions/Meos/CMakeLists.txt | 5 + ...EqTrgeometryTrgeometryPhysicalFunction.cpp | 115 ++++++++++++++++ ...NeTrgeometryTrgeometryPhysicalFunction.cpp | 115 ++++++++++++++++ ...adTrgeometryTrgeometryPhysicalFunction.cpp | 115 ++++++++++++++++ nes-sql-parser/AntlrSQL.g4 | 7 +- .../src/AntlrSQLQueryPlanCreator.cpp | 90 +++++++++++++ 24 files changed, 1696 insertions(+), 1 deletion(-) create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysEqTrgeometryTrgeometryLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysNeTrgeometryTrgeometryLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverEqTrgeometryTrgeometryLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverNeTrgeometryTrgeometryLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/NadTrgeometryTrgeometryLogicalFunction.hpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysEqTrgeometryTrgeometryLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysNeTrgeometryTrgeometryLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverEqTrgeometryTrgeometryLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverNeTrgeometryTrgeometryLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/NadTrgeometryTrgeometryLogicalFunction.cpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysEqTrgeometryTrgeometryPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysNeTrgeometryTrgeometryPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverEqTrgeometryTrgeometryPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverNeTrgeometryTrgeometryPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/NadTrgeometryTrgeometryPhysicalFunction.hpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysEqTrgeometryTrgeometryPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysNeTrgeometryTrgeometryPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverEqTrgeometryTrgeometryPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverNeTrgeometryTrgeometryPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/NadTrgeometryTrgeometryPhysicalFunction.cpp diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysEqTrgeometryTrgeometryLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysEqTrgeometryTrgeometryLogicalFunction.hpp new file mode 100644 index 0000000000..d4c94d1d96 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysEqTrgeometryTrgeometryLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if the two 2D trgeometry instants are always equal. + */ +class AlwaysEqTrgeometryTrgeometryLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysEqTrgeometryTrgeometry"; + + AlwaysEqTrgeometryTrgeometryLogicalFunction(LogicalFunction ref1_wkt, LogicalFunction x1, LogicalFunction y1, LogicalFunction theta1, LogicalFunction ts1, LogicalFunction ref2_wkt, LogicalFunction x2, LogicalFunction y2, LogicalFunction theta2, LogicalFunction ts2); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysNeTrgeometryTrgeometryLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysNeTrgeometryTrgeometryLogicalFunction.hpp new file mode 100644 index 0000000000..7a8ff6f177 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysNeTrgeometryTrgeometryLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if the two 2D trgeometry instants are always not equal. + */ +class AlwaysNeTrgeometryTrgeometryLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysNeTrgeometryTrgeometry"; + + AlwaysNeTrgeometryTrgeometryLogicalFunction(LogicalFunction ref1_wkt, LogicalFunction x1, LogicalFunction y1, LogicalFunction theta1, LogicalFunction ts1, LogicalFunction ref2_wkt, LogicalFunction x2, LogicalFunction y2, LogicalFunction theta2, LogicalFunction ts2); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverEqTrgeometryTrgeometryLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverEqTrgeometryTrgeometryLogicalFunction.hpp new file mode 100644 index 0000000000..14e66d2256 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverEqTrgeometryTrgeometryLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if the two 2D trgeometry instants are ever equal. + */ +class EverEqTrgeometryTrgeometryLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverEqTrgeometryTrgeometry"; + + EverEqTrgeometryTrgeometryLogicalFunction(LogicalFunction ref1_wkt, LogicalFunction x1, LogicalFunction y1, LogicalFunction theta1, LogicalFunction ts1, LogicalFunction ref2_wkt, LogicalFunction x2, LogicalFunction y2, LogicalFunction theta2, LogicalFunction ts2); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverNeTrgeometryTrgeometryLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverNeTrgeometryTrgeometryLogicalFunction.hpp new file mode 100644 index 0000000000..100e057f87 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverNeTrgeometryTrgeometryLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if the two 2D trgeometry instants are ever not equal. + */ +class EverNeTrgeometryTrgeometryLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverNeTrgeometryTrgeometry"; + + EverNeTrgeometryTrgeometryLogicalFunction(LogicalFunction ref1_wkt, LogicalFunction x1, LogicalFunction y1, LogicalFunction theta1, LogicalFunction ts1, LogicalFunction ref2_wkt, LogicalFunction x2, LogicalFunction y2, LogicalFunction theta2, LogicalFunction ts2); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/NadTrgeometryTrgeometryLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/NadTrgeometryTrgeometryLogicalFunction.hpp new file mode 100644 index 0000000000..59906eb1d9 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/NadTrgeometryTrgeometryLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns the nearest approach distance between two 2D trgeometry instants. + */ +class NadTrgeometryTrgeometryLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "NadTrgeometryTrgeometry"; + + NadTrgeometryTrgeometryLogicalFunction(LogicalFunction ref1_wkt, LogicalFunction x1, LogicalFunction y1, LogicalFunction theta1, LogicalFunction ts1, LogicalFunction ref2_wkt, LogicalFunction x2, LogicalFunction y2, LogicalFunction theta2, LogicalFunction ts2); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysEqTrgeometryTrgeometryLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysEqTrgeometryTrgeometryLogicalFunction.cpp new file mode 100644 index 0000000000..e24340ca8e --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysEqTrgeometryTrgeometryLogicalFunction.cpp @@ -0,0 +1,123 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AlwaysEqTrgeometryTrgeometryLogicalFunction::AlwaysEqTrgeometryTrgeometryLogicalFunction(LogicalFunction ref1_wkt, LogicalFunction x1, LogicalFunction y1, LogicalFunction theta1, LogicalFunction ts1, LogicalFunction ref2_wkt, LogicalFunction x2, LogicalFunction y2, LogicalFunction theta2, LogicalFunction ts2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(10); + parameters.push_back(std::move(ref1_wkt)); + parameters.push_back(std::move(x1)); + parameters.push_back(std::move(y1)); + parameters.push_back(std::move(theta1)); + parameters.push_back(std::move(ts1)); + parameters.push_back(std::move(ref2_wkt)); + parameters.push_back(std::move(x2)); + parameters.push_back(std::move(y2)); + parameters.push_back(std::move(theta2)); + parameters.push_back(std::move(ts2)); +} + +DataType AlwaysEqTrgeometryTrgeometryLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysEqTrgeometryTrgeometryLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AlwaysEqTrgeometryTrgeometryLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysEqTrgeometryTrgeometryLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 10, + "AlwaysEqTrgeometryTrgeometryLogicalFunction requires 10 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AlwaysEqTrgeometryTrgeometryLogicalFunction::getType() const { return NAME; } + +bool AlwaysEqTrgeometryTrgeometryLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AlwaysEqTrgeometryTrgeometryLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction AlwaysEqTrgeometryTrgeometryLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(10); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "ref1_wkt must be VARSIZED"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "x1 must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "y1 must be FLOAT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::FLOAT64), "theta1 must be FLOAT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); + INVARIANT(c[5].getDataType().isType(DataType::Type::VARSIZED), "ref2_wkt must be VARSIZED"); + INVARIANT(c[6].getDataType().isType(DataType::Type::FLOAT64), "x2 must be FLOAT64"); + INVARIANT(c[7].getDataType().isType(DataType::Type::FLOAT64), "y2 must be FLOAT64"); + INVARIANT(c[8].getDataType().isType(DataType::Type::FLOAT64), "theta2 must be FLOAT64"); + INVARIANT(c[9].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); + return withChildren(c); +} + +SerializableFunction AlwaysEqTrgeometryTrgeometryLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysEqTrgeometryTrgeometryLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 10, + "AlwaysEqTrgeometryTrgeometryLogicalFunction requires 10 children but got {}", + arguments.children.size()); + return AlwaysEqTrgeometryTrgeometryLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4]), + std::move(arguments.children[5]), + std::move(arguments.children[6]), + std::move(arguments.children[7]), + std::move(arguments.children[8]), + std::move(arguments.children[9])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysNeTrgeometryTrgeometryLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysNeTrgeometryTrgeometryLogicalFunction.cpp new file mode 100644 index 0000000000..be1f419995 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysNeTrgeometryTrgeometryLogicalFunction.cpp @@ -0,0 +1,123 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AlwaysNeTrgeometryTrgeometryLogicalFunction::AlwaysNeTrgeometryTrgeometryLogicalFunction(LogicalFunction ref1_wkt, LogicalFunction x1, LogicalFunction y1, LogicalFunction theta1, LogicalFunction ts1, LogicalFunction ref2_wkt, LogicalFunction x2, LogicalFunction y2, LogicalFunction theta2, LogicalFunction ts2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(10); + parameters.push_back(std::move(ref1_wkt)); + parameters.push_back(std::move(x1)); + parameters.push_back(std::move(y1)); + parameters.push_back(std::move(theta1)); + parameters.push_back(std::move(ts1)); + parameters.push_back(std::move(ref2_wkt)); + parameters.push_back(std::move(x2)); + parameters.push_back(std::move(y2)); + parameters.push_back(std::move(theta2)); + parameters.push_back(std::move(ts2)); +} + +DataType AlwaysNeTrgeometryTrgeometryLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysNeTrgeometryTrgeometryLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AlwaysNeTrgeometryTrgeometryLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysNeTrgeometryTrgeometryLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 10, + "AlwaysNeTrgeometryTrgeometryLogicalFunction requires 10 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AlwaysNeTrgeometryTrgeometryLogicalFunction::getType() const { return NAME; } + +bool AlwaysNeTrgeometryTrgeometryLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AlwaysNeTrgeometryTrgeometryLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction AlwaysNeTrgeometryTrgeometryLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(10); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "ref1_wkt must be VARSIZED"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "x1 must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "y1 must be FLOAT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::FLOAT64), "theta1 must be FLOAT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); + INVARIANT(c[5].getDataType().isType(DataType::Type::VARSIZED), "ref2_wkt must be VARSIZED"); + INVARIANT(c[6].getDataType().isType(DataType::Type::FLOAT64), "x2 must be FLOAT64"); + INVARIANT(c[7].getDataType().isType(DataType::Type::FLOAT64), "y2 must be FLOAT64"); + INVARIANT(c[8].getDataType().isType(DataType::Type::FLOAT64), "theta2 must be FLOAT64"); + INVARIANT(c[9].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); + return withChildren(c); +} + +SerializableFunction AlwaysNeTrgeometryTrgeometryLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysNeTrgeometryTrgeometryLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 10, + "AlwaysNeTrgeometryTrgeometryLogicalFunction requires 10 children but got {}", + arguments.children.size()); + return AlwaysNeTrgeometryTrgeometryLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4]), + std::move(arguments.children[5]), + std::move(arguments.children[6]), + std::move(arguments.children[7]), + std::move(arguments.children[8]), + std::move(arguments.children[9])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt index 251628c2fb..d4ada48eac 100644 --- a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt @@ -419,6 +419,11 @@ add_plugin(EverEqGeoTrgeometry LogicalFunction nes-logical-operators EverEqGeoTr add_plugin(AlwaysEqGeoTrgeometry LogicalFunction nes-logical-operators AlwaysEqGeoTrgeometryLogicalFunction.cpp) add_plugin(EverNeGeoTrgeometry LogicalFunction nes-logical-operators EverNeGeoTrgeometryLogicalFunction.cpp) add_plugin(AlwaysNeGeoTrgeometry LogicalFunction nes-logical-operators AlwaysNeGeoTrgeometryLogicalFunction.cpp) +add_plugin(EverEqTrgeometryTrgeometry LogicalFunction nes-logical-operators EverEqTrgeometryTrgeometryLogicalFunction.cpp) +add_plugin(AlwaysEqTrgeometryTrgeometry LogicalFunction nes-logical-operators AlwaysEqTrgeometryTrgeometryLogicalFunction.cpp) +add_plugin(EverNeTrgeometryTrgeometry LogicalFunction nes-logical-operators EverNeTrgeometryTrgeometryLogicalFunction.cpp) +add_plugin(AlwaysNeTrgeometryTrgeometry LogicalFunction nes-logical-operators AlwaysNeTrgeometryTrgeometryLogicalFunction.cpp) +add_plugin(NadTrgeometryTrgeometry LogicalFunction nes-logical-operators NadTrgeometryTrgeometryLogicalFunction.cpp) add_plugin(GeomIntersects2d LogicalFunction nes-logical-operators GeomIntersects2dLogicalFunction.cpp) add_plugin(GeomDwithin2d LogicalFunction nes-logical-operators GeomDwithin2dLogicalFunction.cpp) add_plugin(GeomContains LogicalFunction nes-logical-operators GeomContainsLogicalFunction.cpp) diff --git a/nes-logical-operators/src/Functions/Meos/EverEqTrgeometryTrgeometryLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverEqTrgeometryTrgeometryLogicalFunction.cpp new file mode 100644 index 0000000000..c515021fdb --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverEqTrgeometryTrgeometryLogicalFunction.cpp @@ -0,0 +1,123 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EverEqTrgeometryTrgeometryLogicalFunction::EverEqTrgeometryTrgeometryLogicalFunction(LogicalFunction ref1_wkt, LogicalFunction x1, LogicalFunction y1, LogicalFunction theta1, LogicalFunction ts1, LogicalFunction ref2_wkt, LogicalFunction x2, LogicalFunction y2, LogicalFunction theta2, LogicalFunction ts2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(10); + parameters.push_back(std::move(ref1_wkt)); + parameters.push_back(std::move(x1)); + parameters.push_back(std::move(y1)); + parameters.push_back(std::move(theta1)); + parameters.push_back(std::move(ts1)); + parameters.push_back(std::move(ref2_wkt)); + parameters.push_back(std::move(x2)); + parameters.push_back(std::move(y2)); + parameters.push_back(std::move(theta2)); + parameters.push_back(std::move(ts2)); +} + +DataType EverEqTrgeometryTrgeometryLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverEqTrgeometryTrgeometryLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EverEqTrgeometryTrgeometryLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverEqTrgeometryTrgeometryLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 10, + "EverEqTrgeometryTrgeometryLogicalFunction requires 10 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EverEqTrgeometryTrgeometryLogicalFunction::getType() const { return NAME; } + +bool EverEqTrgeometryTrgeometryLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EverEqTrgeometryTrgeometryLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction EverEqTrgeometryTrgeometryLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(10); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "ref1_wkt must be VARSIZED"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "x1 must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "y1 must be FLOAT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::FLOAT64), "theta1 must be FLOAT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); + INVARIANT(c[5].getDataType().isType(DataType::Type::VARSIZED), "ref2_wkt must be VARSIZED"); + INVARIANT(c[6].getDataType().isType(DataType::Type::FLOAT64), "x2 must be FLOAT64"); + INVARIANT(c[7].getDataType().isType(DataType::Type::FLOAT64), "y2 must be FLOAT64"); + INVARIANT(c[8].getDataType().isType(DataType::Type::FLOAT64), "theta2 must be FLOAT64"); + INVARIANT(c[9].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); + return withChildren(c); +} + +SerializableFunction EverEqTrgeometryTrgeometryLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverEqTrgeometryTrgeometryLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 10, + "EverEqTrgeometryTrgeometryLogicalFunction requires 10 children but got {}", + arguments.children.size()); + return EverEqTrgeometryTrgeometryLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4]), + std::move(arguments.children[5]), + std::move(arguments.children[6]), + std::move(arguments.children[7]), + std::move(arguments.children[8]), + std::move(arguments.children[9])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverNeTrgeometryTrgeometryLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverNeTrgeometryTrgeometryLogicalFunction.cpp new file mode 100644 index 0000000000..c9d2a7406c --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverNeTrgeometryTrgeometryLogicalFunction.cpp @@ -0,0 +1,123 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EverNeTrgeometryTrgeometryLogicalFunction::EverNeTrgeometryTrgeometryLogicalFunction(LogicalFunction ref1_wkt, LogicalFunction x1, LogicalFunction y1, LogicalFunction theta1, LogicalFunction ts1, LogicalFunction ref2_wkt, LogicalFunction x2, LogicalFunction y2, LogicalFunction theta2, LogicalFunction ts2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(10); + parameters.push_back(std::move(ref1_wkt)); + parameters.push_back(std::move(x1)); + parameters.push_back(std::move(y1)); + parameters.push_back(std::move(theta1)); + parameters.push_back(std::move(ts1)); + parameters.push_back(std::move(ref2_wkt)); + parameters.push_back(std::move(x2)); + parameters.push_back(std::move(y2)); + parameters.push_back(std::move(theta2)); + parameters.push_back(std::move(ts2)); +} + +DataType EverNeTrgeometryTrgeometryLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverNeTrgeometryTrgeometryLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EverNeTrgeometryTrgeometryLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverNeTrgeometryTrgeometryLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 10, + "EverNeTrgeometryTrgeometryLogicalFunction requires 10 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EverNeTrgeometryTrgeometryLogicalFunction::getType() const { return NAME; } + +bool EverNeTrgeometryTrgeometryLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EverNeTrgeometryTrgeometryLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction EverNeTrgeometryTrgeometryLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(10); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "ref1_wkt must be VARSIZED"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "x1 must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "y1 must be FLOAT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::FLOAT64), "theta1 must be FLOAT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); + INVARIANT(c[5].getDataType().isType(DataType::Type::VARSIZED), "ref2_wkt must be VARSIZED"); + INVARIANT(c[6].getDataType().isType(DataType::Type::FLOAT64), "x2 must be FLOAT64"); + INVARIANT(c[7].getDataType().isType(DataType::Type::FLOAT64), "y2 must be FLOAT64"); + INVARIANT(c[8].getDataType().isType(DataType::Type::FLOAT64), "theta2 must be FLOAT64"); + INVARIANT(c[9].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); + return withChildren(c); +} + +SerializableFunction EverNeTrgeometryTrgeometryLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverNeTrgeometryTrgeometryLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 10, + "EverNeTrgeometryTrgeometryLogicalFunction requires 10 children but got {}", + arguments.children.size()); + return EverNeTrgeometryTrgeometryLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4]), + std::move(arguments.children[5]), + std::move(arguments.children[6]), + std::move(arguments.children[7]), + std::move(arguments.children[8]), + std::move(arguments.children[9])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/NadTrgeometryTrgeometryLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/NadTrgeometryTrgeometryLogicalFunction.cpp new file mode 100644 index 0000000000..1785fef017 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/NadTrgeometryTrgeometryLogicalFunction.cpp @@ -0,0 +1,123 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +NadTrgeometryTrgeometryLogicalFunction::NadTrgeometryTrgeometryLogicalFunction(LogicalFunction ref1_wkt, LogicalFunction x1, LogicalFunction y1, LogicalFunction theta1, LogicalFunction ts1, LogicalFunction ref2_wkt, LogicalFunction x2, LogicalFunction y2, LogicalFunction theta2, LogicalFunction ts2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(10); + parameters.push_back(std::move(ref1_wkt)); + parameters.push_back(std::move(x1)); + parameters.push_back(std::move(y1)); + parameters.push_back(std::move(theta1)); + parameters.push_back(std::move(ts1)); + parameters.push_back(std::move(ref2_wkt)); + parameters.push_back(std::move(x2)); + parameters.push_back(std::move(y2)); + parameters.push_back(std::move(theta2)); + parameters.push_back(std::move(ts2)); +} + +DataType NadTrgeometryTrgeometryLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction NadTrgeometryTrgeometryLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector NadTrgeometryTrgeometryLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction NadTrgeometryTrgeometryLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 10, + "NadTrgeometryTrgeometryLogicalFunction requires 10 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view NadTrgeometryTrgeometryLogicalFunction::getType() const { return NAME; } + +bool NadTrgeometryTrgeometryLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string NadTrgeometryTrgeometryLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction NadTrgeometryTrgeometryLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(10); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "ref1_wkt must be VARSIZED"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "x1 must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "y1 must be FLOAT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::FLOAT64), "theta1 must be FLOAT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); + INVARIANT(c[5].getDataType().isType(DataType::Type::VARSIZED), "ref2_wkt must be VARSIZED"); + INVARIANT(c[6].getDataType().isType(DataType::Type::FLOAT64), "x2 must be FLOAT64"); + INVARIANT(c[7].getDataType().isType(DataType::Type::FLOAT64), "y2 must be FLOAT64"); + INVARIANT(c[8].getDataType().isType(DataType::Type::FLOAT64), "theta2 must be FLOAT64"); + INVARIANT(c[9].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); + return withChildren(c); +} + +SerializableFunction NadTrgeometryTrgeometryLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterNadTrgeometryTrgeometryLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 10, + "NadTrgeometryTrgeometryLogicalFunction requires 10 children but got {}", + arguments.children.size()); + return NadTrgeometryTrgeometryLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4]), + std::move(arguments.children[5]), + std::move(arguments.children[6]), + std::move(arguments.children[7]), + std::move(arguments.children[8]), + std::move(arguments.children[9])); +} + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysEqTrgeometryTrgeometryPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysEqTrgeometryTrgeometryPhysicalFunction.hpp new file mode 100644 index 0000000000..00f5c0d7b4 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysEqTrgeometryTrgeometryPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class AlwaysEqTrgeometryTrgeometryPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysEqTrgeometryTrgeometryPhysicalFunction(PhysicalFunction ref1_wkt, PhysicalFunction x1, PhysicalFunction y1, PhysicalFunction theta1, PhysicalFunction ts1, PhysicalFunction ref2_wkt, PhysicalFunction x2, PhysicalFunction y2, PhysicalFunction theta2, PhysicalFunction ts2); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysNeTrgeometryTrgeometryPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysNeTrgeometryTrgeometryPhysicalFunction.hpp new file mode 100644 index 0000000000..c830b1b5f1 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysNeTrgeometryTrgeometryPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class AlwaysNeTrgeometryTrgeometryPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysNeTrgeometryTrgeometryPhysicalFunction(PhysicalFunction ref1_wkt, PhysicalFunction x1, PhysicalFunction y1, PhysicalFunction theta1, PhysicalFunction ts1, PhysicalFunction ref2_wkt, PhysicalFunction x2, PhysicalFunction y2, PhysicalFunction theta2, PhysicalFunction ts2); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverEqTrgeometryTrgeometryPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverEqTrgeometryTrgeometryPhysicalFunction.hpp new file mode 100644 index 0000000000..53c9a1f285 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverEqTrgeometryTrgeometryPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class EverEqTrgeometryTrgeometryPhysicalFunction : public PhysicalFunctionConcept { +public: + EverEqTrgeometryTrgeometryPhysicalFunction(PhysicalFunction ref1_wkt, PhysicalFunction x1, PhysicalFunction y1, PhysicalFunction theta1, PhysicalFunction ts1, PhysicalFunction ref2_wkt, PhysicalFunction x2, PhysicalFunction y2, PhysicalFunction theta2, PhysicalFunction ts2); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverNeTrgeometryTrgeometryPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverNeTrgeometryTrgeometryPhysicalFunction.hpp new file mode 100644 index 0000000000..98824f26d6 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverNeTrgeometryTrgeometryPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class EverNeTrgeometryTrgeometryPhysicalFunction : public PhysicalFunctionConcept { +public: + EverNeTrgeometryTrgeometryPhysicalFunction(PhysicalFunction ref1_wkt, PhysicalFunction x1, PhysicalFunction y1, PhysicalFunction theta1, PhysicalFunction ts1, PhysicalFunction ref2_wkt, PhysicalFunction x2, PhysicalFunction y2, PhysicalFunction theta2, PhysicalFunction ts2); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/NadTrgeometryTrgeometryPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/NadTrgeometryTrgeometryPhysicalFunction.hpp new file mode 100644 index 0000000000..b138dd9908 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/NadTrgeometryTrgeometryPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class NadTrgeometryTrgeometryPhysicalFunction : public PhysicalFunctionConcept { +public: + NadTrgeometryTrgeometryPhysicalFunction(PhysicalFunction ref1_wkt, PhysicalFunction x1, PhysicalFunction y1, PhysicalFunction theta1, PhysicalFunction ts1, PhysicalFunction ref2_wkt, PhysicalFunction x2, PhysicalFunction y2, PhysicalFunction theta2, PhysicalFunction ts2); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysEqTrgeometryTrgeometryPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysEqTrgeometryTrgeometryPhysicalFunction.cpp new file mode 100644 index 0000000000..8413d1785f --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysEqTrgeometryTrgeometryPhysicalFunction.cpp @@ -0,0 +1,115 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +#include +} + +namespace NES { + +AlwaysEqTrgeometryTrgeometryPhysicalFunction::AlwaysEqTrgeometryTrgeometryPhysicalFunction(PhysicalFunction ref1_wkt, PhysicalFunction x1, PhysicalFunction y1, PhysicalFunction theta1, PhysicalFunction ts1, PhysicalFunction ref2_wkt, PhysicalFunction x2, PhysicalFunction y2, PhysicalFunction theta2, PhysicalFunction ts2) +{ + paramFns.reserve(10); + paramFns.push_back(std::move(ref1_wkt)); + paramFns.push_back(std::move(x1)); + paramFns.push_back(std::move(y1)); + paramFns.push_back(std::move(theta1)); + paramFns.push_back(std::move(ts1)); + paramFns.push_back(std::move(ref2_wkt)); + paramFns.push_back(std::move(x2)); + paramFns.push_back(std::move(y2)); + paramFns.push_back(std::move(theta2)); + paramFns.push_back(std::move(ts2)); +} + +VarVal AlwaysEqTrgeometryTrgeometryPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto ref1_wkt = paramFns[0].execute(record, arena); + auto x1 = paramFns[1].execute(record, arena).cast(); + auto y1 = paramFns[2].execute(record, arena).cast(); + auto theta1 = paramFns[3].execute(record, arena).cast(); + auto ts1 = paramFns[4].execute(record, arena).cast(); + auto ref2_wkt = paramFns[5].execute(record, arena); + auto x2 = paramFns[6].execute(record, arena).cast(); + auto y2 = paramFns[7].execute(record, arena).cast(); + auto theta2 = paramFns[8].execute(record, arena).cast(); + auto ts2 = paramFns[9].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](const char* ref1_wkt, uint32_t ref1_len, double x1, double y1, double theta1, uint64_t ts1, const char* ref2_wkt, uint32_t ref2_len, double x2, double y2, double theta2, uint64_t ts2) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + char* s1 = (char*)malloc(ref1_len + 1); + memcpy(s1, ref1_wkt, ref1_len); s1[ref1_len] = '\0'; + GSERIALIZED* gs1 = geom_in(s1, -1); free(s1); + if (!gs1) return 0.0; + Pose* p1 = pose_make_2d(x1, y1, theta1, false, 0); + if (!p1) { free(gs1); return 0.0; } + TInstant* inst1 = trgeoinst_make(gs1, p1, (TimestampTz)ts1); + free(gs1); free(p1); + if (!inst1) return 0.0; + char* s2 = (char*)malloc(ref2_len + 1); + memcpy(s2, ref2_wkt, ref2_len); s2[ref2_len] = '\0'; + GSERIALIZED* gs2 = geom_in(s2, -1); free(s2); + if (!gs2) { free(inst1); return 0.0; } + Pose* p2 = pose_make_2d(x2, y2, theta2, false, 0); + if (!p2) { free(inst1); free(gs2); return 0.0; } + TInstant* inst2 = trgeoinst_make(gs2, p2, (TimestampTz)ts2); + free(gs2); free(p2); + if (!inst2) { free(inst1); return 0.0; } + int r = always_eq_trgeometry_trgeometry((Temporal*)inst1, (Temporal*)inst2); + free(inst1); free(inst2); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + ref1_wkt, x1, y1, theta1, ts1, ref2_wkt, x2, y2, theta2, ts2); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysEqTrgeometryTrgeometryPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 10, + "AlwaysEqTrgeometryTrgeometryPhysicalFunction requires 10 children but got {}", + arguments.childFunctions.size()); + return AlwaysEqTrgeometryTrgeometryPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4]), + std::move(arguments.childFunctions[5]), + std::move(arguments.childFunctions[6]), + std::move(arguments.childFunctions[7]), + std::move(arguments.childFunctions[8]), + std::move(arguments.childFunctions[9])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysNeTrgeometryTrgeometryPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysNeTrgeometryTrgeometryPhysicalFunction.cpp new file mode 100644 index 0000000000..5c4e5acda6 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysNeTrgeometryTrgeometryPhysicalFunction.cpp @@ -0,0 +1,115 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +#include +} + +namespace NES { + +AlwaysNeTrgeometryTrgeometryPhysicalFunction::AlwaysNeTrgeometryTrgeometryPhysicalFunction(PhysicalFunction ref1_wkt, PhysicalFunction x1, PhysicalFunction y1, PhysicalFunction theta1, PhysicalFunction ts1, PhysicalFunction ref2_wkt, PhysicalFunction x2, PhysicalFunction y2, PhysicalFunction theta2, PhysicalFunction ts2) +{ + paramFns.reserve(10); + paramFns.push_back(std::move(ref1_wkt)); + paramFns.push_back(std::move(x1)); + paramFns.push_back(std::move(y1)); + paramFns.push_back(std::move(theta1)); + paramFns.push_back(std::move(ts1)); + paramFns.push_back(std::move(ref2_wkt)); + paramFns.push_back(std::move(x2)); + paramFns.push_back(std::move(y2)); + paramFns.push_back(std::move(theta2)); + paramFns.push_back(std::move(ts2)); +} + +VarVal AlwaysNeTrgeometryTrgeometryPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto ref1_wkt = paramFns[0].execute(record, arena); + auto x1 = paramFns[1].execute(record, arena).cast(); + auto y1 = paramFns[2].execute(record, arena).cast(); + auto theta1 = paramFns[3].execute(record, arena).cast(); + auto ts1 = paramFns[4].execute(record, arena).cast(); + auto ref2_wkt = paramFns[5].execute(record, arena); + auto x2 = paramFns[6].execute(record, arena).cast(); + auto y2 = paramFns[7].execute(record, arena).cast(); + auto theta2 = paramFns[8].execute(record, arena).cast(); + auto ts2 = paramFns[9].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](const char* ref1_wkt, uint32_t ref1_len, double x1, double y1, double theta1, uint64_t ts1, const char* ref2_wkt, uint32_t ref2_len, double x2, double y2, double theta2, uint64_t ts2) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + char* s1 = (char*)malloc(ref1_len + 1); + memcpy(s1, ref1_wkt, ref1_len); s1[ref1_len] = '\0'; + GSERIALIZED* gs1 = geom_in(s1, -1); free(s1); + if (!gs1) return 0.0; + Pose* p1 = pose_make_2d(x1, y1, theta1, false, 0); + if (!p1) { free(gs1); return 0.0; } + TInstant* inst1 = trgeoinst_make(gs1, p1, (TimestampTz)ts1); + free(gs1); free(p1); + if (!inst1) return 0.0; + char* s2 = (char*)malloc(ref2_len + 1); + memcpy(s2, ref2_wkt, ref2_len); s2[ref2_len] = '\0'; + GSERIALIZED* gs2 = geom_in(s2, -1); free(s2); + if (!gs2) { free(inst1); return 0.0; } + Pose* p2 = pose_make_2d(x2, y2, theta2, false, 0); + if (!p2) { free(inst1); free(gs2); return 0.0; } + TInstant* inst2 = trgeoinst_make(gs2, p2, (TimestampTz)ts2); + free(gs2); free(p2); + if (!inst2) { free(inst1); return 0.0; } + int r = always_ne_trgeometry_trgeometry((Temporal*)inst1, (Temporal*)inst2); + free(inst1); free(inst2); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + ref1_wkt, x1, y1, theta1, ts1, ref2_wkt, x2, y2, theta2, ts2); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysNeTrgeometryTrgeometryPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 10, + "AlwaysNeTrgeometryTrgeometryPhysicalFunction requires 10 children but got {}", + arguments.childFunctions.size()); + return AlwaysNeTrgeometryTrgeometryPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4]), + std::move(arguments.childFunctions[5]), + std::move(arguments.childFunctions[6]), + std::move(arguments.childFunctions[7]), + std::move(arguments.childFunctions[8]), + std::move(arguments.childFunctions[9])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt index 663ffe65b3..74c4b79187 100644 --- a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt @@ -418,6 +418,11 @@ add_plugin(EverEqGeoTrgeometry PhysicalFunction nes-physical-operators EverEqGeo add_plugin(AlwaysEqGeoTrgeometry PhysicalFunction nes-physical-operators AlwaysEqGeoTrgeometryPhysicalFunction.cpp) add_plugin(EverNeGeoTrgeometry PhysicalFunction nes-physical-operators EverNeGeoTrgeometryPhysicalFunction.cpp) add_plugin(AlwaysNeGeoTrgeometry PhysicalFunction nes-physical-operators AlwaysNeGeoTrgeometryPhysicalFunction.cpp) +add_plugin(EverEqTrgeometryTrgeometry PhysicalFunction nes-physical-operators EverEqTrgeometryTrgeometryPhysicalFunction.cpp) +add_plugin(AlwaysEqTrgeometryTrgeometry PhysicalFunction nes-physical-operators AlwaysEqTrgeometryTrgeometryPhysicalFunction.cpp) +add_plugin(EverNeTrgeometryTrgeometry PhysicalFunction nes-physical-operators EverNeTrgeometryTrgeometryPhysicalFunction.cpp) +add_plugin(AlwaysNeTrgeometryTrgeometry PhysicalFunction nes-physical-operators AlwaysNeTrgeometryTrgeometryPhysicalFunction.cpp) +add_plugin(NadTrgeometryTrgeometry PhysicalFunction nes-physical-operators NadTrgeometryTrgeometryPhysicalFunction.cpp) add_plugin(GeomIntersects2d PhysicalFunction nes-physical-operators GeomIntersects2dPhysicalFunction.cpp) add_plugin(GeomDwithin2d PhysicalFunction nes-physical-operators GeomDwithin2dPhysicalFunction.cpp) add_plugin(GeomContains PhysicalFunction nes-physical-operators GeomContainsPhysicalFunction.cpp) diff --git a/nes-physical-operators/src/Functions/Meos/EverEqTrgeometryTrgeometryPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverEqTrgeometryTrgeometryPhysicalFunction.cpp new file mode 100644 index 0000000000..aeec1c43fd --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverEqTrgeometryTrgeometryPhysicalFunction.cpp @@ -0,0 +1,115 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +#include +} + +namespace NES { + +EverEqTrgeometryTrgeometryPhysicalFunction::EverEqTrgeometryTrgeometryPhysicalFunction(PhysicalFunction ref1_wkt, PhysicalFunction x1, PhysicalFunction y1, PhysicalFunction theta1, PhysicalFunction ts1, PhysicalFunction ref2_wkt, PhysicalFunction x2, PhysicalFunction y2, PhysicalFunction theta2, PhysicalFunction ts2) +{ + paramFns.reserve(10); + paramFns.push_back(std::move(ref1_wkt)); + paramFns.push_back(std::move(x1)); + paramFns.push_back(std::move(y1)); + paramFns.push_back(std::move(theta1)); + paramFns.push_back(std::move(ts1)); + paramFns.push_back(std::move(ref2_wkt)); + paramFns.push_back(std::move(x2)); + paramFns.push_back(std::move(y2)); + paramFns.push_back(std::move(theta2)); + paramFns.push_back(std::move(ts2)); +} + +VarVal EverEqTrgeometryTrgeometryPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto ref1_wkt = paramFns[0].execute(record, arena); + auto x1 = paramFns[1].execute(record, arena).cast(); + auto y1 = paramFns[2].execute(record, arena).cast(); + auto theta1 = paramFns[3].execute(record, arena).cast(); + auto ts1 = paramFns[4].execute(record, arena).cast(); + auto ref2_wkt = paramFns[5].execute(record, arena); + auto x2 = paramFns[6].execute(record, arena).cast(); + auto y2 = paramFns[7].execute(record, arena).cast(); + auto theta2 = paramFns[8].execute(record, arena).cast(); + auto ts2 = paramFns[9].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](const char* ref1_wkt, uint32_t ref1_len, double x1, double y1, double theta1, uint64_t ts1, const char* ref2_wkt, uint32_t ref2_len, double x2, double y2, double theta2, uint64_t ts2) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + char* s1 = (char*)malloc(ref1_len + 1); + memcpy(s1, ref1_wkt, ref1_len); s1[ref1_len] = '\0'; + GSERIALIZED* gs1 = geom_in(s1, -1); free(s1); + if (!gs1) return 0.0; + Pose* p1 = pose_make_2d(x1, y1, theta1, false, 0); + if (!p1) { free(gs1); return 0.0; } + TInstant* inst1 = trgeoinst_make(gs1, p1, (TimestampTz)ts1); + free(gs1); free(p1); + if (!inst1) return 0.0; + char* s2 = (char*)malloc(ref2_len + 1); + memcpy(s2, ref2_wkt, ref2_len); s2[ref2_len] = '\0'; + GSERIALIZED* gs2 = geom_in(s2, -1); free(s2); + if (!gs2) { free(inst1); return 0.0; } + Pose* p2 = pose_make_2d(x2, y2, theta2, false, 0); + if (!p2) { free(inst1); free(gs2); return 0.0; } + TInstant* inst2 = trgeoinst_make(gs2, p2, (TimestampTz)ts2); + free(gs2); free(p2); + if (!inst2) { free(inst1); return 0.0; } + int r = ever_eq_trgeometry_trgeometry((Temporal*)inst1, (Temporal*)inst2); + free(inst1); free(inst2); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + ref1_wkt, x1, y1, theta1, ts1, ref2_wkt, x2, y2, theta2, ts2); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverEqTrgeometryTrgeometryPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 10, + "EverEqTrgeometryTrgeometryPhysicalFunction requires 10 children but got {}", + arguments.childFunctions.size()); + return EverEqTrgeometryTrgeometryPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4]), + std::move(arguments.childFunctions[5]), + std::move(arguments.childFunctions[6]), + std::move(arguments.childFunctions[7]), + std::move(arguments.childFunctions[8]), + std::move(arguments.childFunctions[9])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverNeTrgeometryTrgeometryPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverNeTrgeometryTrgeometryPhysicalFunction.cpp new file mode 100644 index 0000000000..347c00a985 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverNeTrgeometryTrgeometryPhysicalFunction.cpp @@ -0,0 +1,115 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +#include +} + +namespace NES { + +EverNeTrgeometryTrgeometryPhysicalFunction::EverNeTrgeometryTrgeometryPhysicalFunction(PhysicalFunction ref1_wkt, PhysicalFunction x1, PhysicalFunction y1, PhysicalFunction theta1, PhysicalFunction ts1, PhysicalFunction ref2_wkt, PhysicalFunction x2, PhysicalFunction y2, PhysicalFunction theta2, PhysicalFunction ts2) +{ + paramFns.reserve(10); + paramFns.push_back(std::move(ref1_wkt)); + paramFns.push_back(std::move(x1)); + paramFns.push_back(std::move(y1)); + paramFns.push_back(std::move(theta1)); + paramFns.push_back(std::move(ts1)); + paramFns.push_back(std::move(ref2_wkt)); + paramFns.push_back(std::move(x2)); + paramFns.push_back(std::move(y2)); + paramFns.push_back(std::move(theta2)); + paramFns.push_back(std::move(ts2)); +} + +VarVal EverNeTrgeometryTrgeometryPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto ref1_wkt = paramFns[0].execute(record, arena); + auto x1 = paramFns[1].execute(record, arena).cast(); + auto y1 = paramFns[2].execute(record, arena).cast(); + auto theta1 = paramFns[3].execute(record, arena).cast(); + auto ts1 = paramFns[4].execute(record, arena).cast(); + auto ref2_wkt = paramFns[5].execute(record, arena); + auto x2 = paramFns[6].execute(record, arena).cast(); + auto y2 = paramFns[7].execute(record, arena).cast(); + auto theta2 = paramFns[8].execute(record, arena).cast(); + auto ts2 = paramFns[9].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](const char* ref1_wkt, uint32_t ref1_len, double x1, double y1, double theta1, uint64_t ts1, const char* ref2_wkt, uint32_t ref2_len, double x2, double y2, double theta2, uint64_t ts2) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + char* s1 = (char*)malloc(ref1_len + 1); + memcpy(s1, ref1_wkt, ref1_len); s1[ref1_len] = '\0'; + GSERIALIZED* gs1 = geom_in(s1, -1); free(s1); + if (!gs1) return 0.0; + Pose* p1 = pose_make_2d(x1, y1, theta1, false, 0); + if (!p1) { free(gs1); return 0.0; } + TInstant* inst1 = trgeoinst_make(gs1, p1, (TimestampTz)ts1); + free(gs1); free(p1); + if (!inst1) return 0.0; + char* s2 = (char*)malloc(ref2_len + 1); + memcpy(s2, ref2_wkt, ref2_len); s2[ref2_len] = '\0'; + GSERIALIZED* gs2 = geom_in(s2, -1); free(s2); + if (!gs2) { free(inst1); return 0.0; } + Pose* p2 = pose_make_2d(x2, y2, theta2, false, 0); + if (!p2) { free(inst1); free(gs2); return 0.0; } + TInstant* inst2 = trgeoinst_make(gs2, p2, (TimestampTz)ts2); + free(gs2); free(p2); + if (!inst2) { free(inst1); return 0.0; } + int r = ever_ne_trgeometry_trgeometry((Temporal*)inst1, (Temporal*)inst2); + free(inst1); free(inst2); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + ref1_wkt, x1, y1, theta1, ts1, ref2_wkt, x2, y2, theta2, ts2); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverNeTrgeometryTrgeometryPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 10, + "EverNeTrgeometryTrgeometryPhysicalFunction requires 10 children but got {}", + arguments.childFunctions.size()); + return EverNeTrgeometryTrgeometryPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4]), + std::move(arguments.childFunctions[5]), + std::move(arguments.childFunctions[6]), + std::move(arguments.childFunctions[7]), + std::move(arguments.childFunctions[8]), + std::move(arguments.childFunctions[9])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/NadTrgeometryTrgeometryPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/NadTrgeometryTrgeometryPhysicalFunction.cpp new file mode 100644 index 0000000000..8c0647504c --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/NadTrgeometryTrgeometryPhysicalFunction.cpp @@ -0,0 +1,115 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +#include +} + +namespace NES { + +NadTrgeometryTrgeometryPhysicalFunction::NadTrgeometryTrgeometryPhysicalFunction(PhysicalFunction ref1_wkt, PhysicalFunction x1, PhysicalFunction y1, PhysicalFunction theta1, PhysicalFunction ts1, PhysicalFunction ref2_wkt, PhysicalFunction x2, PhysicalFunction y2, PhysicalFunction theta2, PhysicalFunction ts2) +{ + paramFns.reserve(10); + paramFns.push_back(std::move(ref1_wkt)); + paramFns.push_back(std::move(x1)); + paramFns.push_back(std::move(y1)); + paramFns.push_back(std::move(theta1)); + paramFns.push_back(std::move(ts1)); + paramFns.push_back(std::move(ref2_wkt)); + paramFns.push_back(std::move(x2)); + paramFns.push_back(std::move(y2)); + paramFns.push_back(std::move(theta2)); + paramFns.push_back(std::move(ts2)); +} + +VarVal NadTrgeometryTrgeometryPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto ref1_wkt = paramFns[0].execute(record, arena); + auto x1 = paramFns[1].execute(record, arena).cast(); + auto y1 = paramFns[2].execute(record, arena).cast(); + auto theta1 = paramFns[3].execute(record, arena).cast(); + auto ts1 = paramFns[4].execute(record, arena).cast(); + auto ref2_wkt = paramFns[5].execute(record, arena); + auto x2 = paramFns[6].execute(record, arena).cast(); + auto y2 = paramFns[7].execute(record, arena).cast(); + auto theta2 = paramFns[8].execute(record, arena).cast(); + auto ts2 = paramFns[9].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](const char* ref1_wkt, uint32_t ref1_len, double x1, double y1, double theta1, uint64_t ts1, const char* ref2_wkt, uint32_t ref2_len, double x2, double y2, double theta2, uint64_t ts2) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + char* s1 = (char*)malloc(ref1_len + 1); + memcpy(s1, ref1_wkt, ref1_len); s1[ref1_len] = '\0'; + GSERIALIZED* gs1 = geom_in(s1, -1); free(s1); + if (!gs1) return 0.0; + Pose* p1 = pose_make_2d(x1, y1, theta1, false, 0); + if (!p1) { free(gs1); return 0.0; } + TInstant* inst1 = trgeoinst_make(gs1, p1, (TimestampTz)ts1); + free(gs1); free(p1); + if (!inst1) return 0.0; + char* s2 = (char*)malloc(ref2_len + 1); + memcpy(s2, ref2_wkt, ref2_len); s2[ref2_len] = '\0'; + GSERIALIZED* gs2 = geom_in(s2, -1); free(s2); + if (!gs2) { free(inst1); return 0.0; } + Pose* p2 = pose_make_2d(x2, y2, theta2, false, 0); + if (!p2) { free(inst1); free(gs2); return 0.0; } + TInstant* inst2 = trgeoinst_make(gs2, p2, (TimestampTz)ts2); + free(gs2); free(p2); + if (!inst2) { free(inst1); return 0.0; } + double r = nad_trgeometry_trgeometry((Temporal*)inst1, (Temporal*)inst2); + free(inst1); free(inst2); + return r; + } catch (const std::exception&) { return 0.0; } + }, + ref1_wkt, x1, y1, theta1, ts1, ref2_wkt, x2, y2, theta2, ts2); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterNadTrgeometryTrgeometryPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 10, + "NadTrgeometryTrgeometryPhysicalFunction requires 10 children but got {}", + arguments.childFunctions.size()); + return NadTrgeometryTrgeometryPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4]), + std::move(arguments.childFunctions[5]), + std::move(arguments.childFunctions[6]), + std::move(arguments.childFunctions[7]), + std::move(arguments.childFunctions[8]), + std::move(arguments.childFunctions[9])); +} + +} // namespace NES diff --git a/nes-sql-parser/AntlrSQL.g4 b/nes-sql-parser/AntlrSQL.g4 index 2898b8cc13..0941f3efb3 100644 --- a/nes-sql-parser/AntlrSQL.g4 +++ b/nes-sql-parser/AntlrSQL.g4 @@ -295,7 +295,7 @@ timeUnit: MS timestampParameter: name=identifier; -functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT | TGE_TTEXT_TEXT | TGE_TEXT_TTEXT | TGT_TTEXT_TEXT | TGT_TEXT_TTEXT | TLE_TTEXT_TEXT | TLE_TEXT_TTEXT | TLT_TTEXT_TEXT | TLT_TEXT_TTEXT | TTEXT_UPPER | TTEXT_LOWER | TTEXT_INITCAP | TEXTCAT_TTEXT_TEXT | TEXTCAT_TEXT_TTEXT | TEXTCAT_TTEXT_TTEXT | GEOM_LENGTH | GEOM_PERIMETER | GEOM_AZIMUTH | GEOG_AREA | GEOG_LENGTH | GEOG_PERIMETER | GEOM_IS_EMPTY | AINTERSECTS_TGEO_GEO | ACOVERS_TGEO_GEO | ADISJOINT_TGEO_GEO | ADWITHIN_TGEO_GEO | EINTERSECTS_TGEO_GEO | ETOUCHES_TGEO_GEO | ECONTAINS_TGEO_GEO | ACONTAINS_TGEO_GEO | ATOUCHES_TGEO_GEO | GEO_NUM_POINTS | GEO_NUM_GEOS | GEO_SRID | GEO_IS_UNITARY | GEO_EQUALS | GEO_SAME | GEOG_DISTANCE | NAD_TGEO_GEO | EVER_EQ_TGEO_GEO | EVER_NE_TGEO_GEO | ALWAYS_EQ_TGEO_GEO | ALWAYS_NE_TGEO_GEO | GEOG_INTERSECTS | GEOG_DWITHIN | ACOVERS_GEO_TGEO | GEOM_INTERSECTS | GEOM_DWITHIN | H3_GS_POINT_TO_CELL | EVER_EQ_TH3INDEX_H3INDEX | EVER_NE_TH3INDEX_H3INDEX | ALWAYS_EQ_TH3INDEX_H3INDEX | ALWAYS_NE_TH3INDEX_H3INDEX | TH3INDEX_GET_RESOLUTION | TH3INDEX_GET_BASE_CELL_NUMBER | TH3INDEX_IS_VALID_CELL | TH3INDEX_IS_PENTAGON | TH3INDEX_CELL_TO_PARENT_NEXT | TH3INDEX_CELL_TO_CENTER_CHILD_NEXT | TH3INDEX_CELL_TO_PARENT | TH3INDEX_CELL_TO_CENTER_CHILD | TH3INDEX_CELL_TO_CHILD_POS | TH3INDEX_ARE_NEIGHBOR_CELLS | TH3INDEX_GRID_DISTANCE | EINTERSECTS_TCBUFFER_GEO | AINTERSECTS_TCBUFFER_GEO | ECOVERS_TCBUFFER_GEO | ACOVERS_TCBUFFER_GEO | EDISJOINT_TCBUFFER_GEO | ADISJOINT_TCBUFFER_GEO | ETOUCHES_TCBUFFER_GEO | ATOUCHES_TCBUFFER_GEO | ECONTAINS_TCBUFFER_GEO | ACONTAINS_TCBUFFER_GEO | NAD_TCBUFFER_GEO | EDWITHIN_TCBUFFER_GEO | ADWITHIN_TCBUFFER_GEO | EINTERSECTS_TCBUFFER_CBUFFER | AINTERSECTS_TCBUFFER_CBUFFER | ECOVERS_TCBUFFER_CBUFFER | ACOVERS_TCBUFFER_CBUFFER | EDISJOINT_TCBUFFER_CBUFFER | ADISJOINT_TCBUFFER_CBUFFER | ETOUCHES_TCBUFFER_CBUFFER | ATOUCHES_TCBUFFER_CBUFFER | ECONTAINS_TCBUFFER_CBUFFER | ACONTAINS_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_CBUFFER | ALWAYS_EQ_TCBUFFER_CBUFFER | EVER_NE_TCBUFFER_CBUFFER | ALWAYS_NE_TCBUFFER_CBUFFER | NAD_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_TCBUFFER | ALWAYS_EQ_TCBUFFER_TCBUFFER | EVER_NE_TCBUFFER_TCBUFFER | ALWAYS_NE_TCBUFFER_TCBUFFER | EINTERSECTS_TCBUFFER_TCBUFFER | AINTERSECTS_TCBUFFER_TCBUFFER | ECOVERS_TCBUFFER_TCBUFFER | ACOVERS_TCBUFFER_TCBUFFER | ADISJOINT_TCBUFFER_TCBUFFER | ETOUCHES_TCBUFFER_TCBUFFER | ATOUCHES_TCBUFFER_TCBUFFER | NAD_TCBUFFER_TCBUFFER | EDWITHIN_TCBUFFER_TCBUFFER | ADWITHIN_TCBUFFER_TCBUFFER | MINDISTANCE_TCBUFFER_TCBUFFER | NAD_TNPOINT_GEO | EVER_EQ_TNPOINT_NPOINT | ALWAYS_EQ_TNPOINT_NPOINT | EVER_NE_TNPOINT_NPOINT | ALWAYS_NE_TNPOINT_NPOINT | NAD_TNPOINT_NPOINT | EVER_EQ_NPOINT_TNPOINT | ALWAYS_EQ_NPOINT_TNPOINT | EVER_NE_NPOINT_TNPOINT | ALWAYS_NE_NPOINT_TNPOINT | EVER_EQ_TNPOINT_TNPOINT | ALWAYS_EQ_TNPOINT_TNPOINT | EVER_NE_TNPOINT_TNPOINT | ALWAYS_NE_TNPOINT_TNPOINT | NAD_TNPOINT_TNPOINT | NAD_TPOSE_GEO | EVER_EQ_TPOSE_POSE | ALWAYS_EQ_TPOSE_POSE | EVER_NE_TPOSE_POSE | ALWAYS_NE_TPOSE_POSE | NAD_TPOSE_POSE | EVER_EQ_POSE_TPOSE | ALWAYS_EQ_POSE_TPOSE | EVER_NE_POSE_TPOSE | ALWAYS_NE_POSE_TPOSE | EVER_EQ_TPOSE_TPOSE | ALWAYS_EQ_TPOSE_TPOSE | EVER_NE_TPOSE_TPOSE | ALWAYS_NE_TPOSE_TPOSE | NAD_TPOSE_TPOSE | EVER_EQ_TRGEOMETRY_GEO | ALWAYS_EQ_TRGEOMETRY_GEO | EVER_NE_TRGEOMETRY_GEO | ALWAYS_NE_TRGEOMETRY_GEO | NAD_TRGEOMETRY_GEO | EVER_EQ_GEO_TRGEOMETRY | ALWAYS_EQ_GEO_TRGEOMETRY | EVER_NE_GEO_TRGEOMETRY | ALWAYS_NE_GEO_TRGEOMETRY | GEOM_INTERSECTS2D | GEOM_DWITHIN2D | GEOM_CONTAINS | GEOM_DISJOINT2D | GEOM_COVERS | GEOM_TOUCHES | GEOM_INTERSECTS3D | GEOM_DWITHIN3D | GEOM_DISTANCE2D | GEOM_DISTANCE3D; +functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT | TGE_TTEXT_TEXT | TGE_TEXT_TTEXT | TGT_TTEXT_TEXT | TGT_TEXT_TTEXT | TLE_TTEXT_TEXT | TLE_TEXT_TTEXT | TLT_TTEXT_TEXT | TLT_TEXT_TTEXT | TTEXT_UPPER | TTEXT_LOWER | TTEXT_INITCAP | TEXTCAT_TTEXT_TEXT | TEXTCAT_TEXT_TTEXT | TEXTCAT_TTEXT_TTEXT | GEOM_LENGTH | GEOM_PERIMETER | GEOM_AZIMUTH | GEOG_AREA | GEOG_LENGTH | GEOG_PERIMETER | GEOM_IS_EMPTY | AINTERSECTS_TGEO_GEO | ACOVERS_TGEO_GEO | ADISJOINT_TGEO_GEO | ADWITHIN_TGEO_GEO | EINTERSECTS_TGEO_GEO | ETOUCHES_TGEO_GEO | ECONTAINS_TGEO_GEO | ACONTAINS_TGEO_GEO | ATOUCHES_TGEO_GEO | GEO_NUM_POINTS | GEO_NUM_GEOS | GEO_SRID | GEO_IS_UNITARY | GEO_EQUALS | GEO_SAME | GEOG_DISTANCE | NAD_TGEO_GEO | EVER_EQ_TGEO_GEO | EVER_NE_TGEO_GEO | ALWAYS_EQ_TGEO_GEO | ALWAYS_NE_TGEO_GEO | GEOG_INTERSECTS | GEOG_DWITHIN | ACOVERS_GEO_TGEO | GEOM_INTERSECTS | GEOM_DWITHIN | H3_GS_POINT_TO_CELL | EVER_EQ_TH3INDEX_H3INDEX | EVER_NE_TH3INDEX_H3INDEX | ALWAYS_EQ_TH3INDEX_H3INDEX | ALWAYS_NE_TH3INDEX_H3INDEX | TH3INDEX_GET_RESOLUTION | TH3INDEX_GET_BASE_CELL_NUMBER | TH3INDEX_IS_VALID_CELL | TH3INDEX_IS_PENTAGON | TH3INDEX_CELL_TO_PARENT_NEXT | TH3INDEX_CELL_TO_CENTER_CHILD_NEXT | TH3INDEX_CELL_TO_PARENT | TH3INDEX_CELL_TO_CENTER_CHILD | TH3INDEX_CELL_TO_CHILD_POS | TH3INDEX_ARE_NEIGHBOR_CELLS | TH3INDEX_GRID_DISTANCE | EINTERSECTS_TCBUFFER_GEO | AINTERSECTS_TCBUFFER_GEO | ECOVERS_TCBUFFER_GEO | ACOVERS_TCBUFFER_GEO | EDISJOINT_TCBUFFER_GEO | ADISJOINT_TCBUFFER_GEO | ETOUCHES_TCBUFFER_GEO | ATOUCHES_TCBUFFER_GEO | ECONTAINS_TCBUFFER_GEO | ACONTAINS_TCBUFFER_GEO | NAD_TCBUFFER_GEO | EDWITHIN_TCBUFFER_GEO | ADWITHIN_TCBUFFER_GEO | EINTERSECTS_TCBUFFER_CBUFFER | AINTERSECTS_TCBUFFER_CBUFFER | ECOVERS_TCBUFFER_CBUFFER | ACOVERS_TCBUFFER_CBUFFER | EDISJOINT_TCBUFFER_CBUFFER | ADISJOINT_TCBUFFER_CBUFFER | ETOUCHES_TCBUFFER_CBUFFER | ATOUCHES_TCBUFFER_CBUFFER | ECONTAINS_TCBUFFER_CBUFFER | ACONTAINS_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_CBUFFER | ALWAYS_EQ_TCBUFFER_CBUFFER | EVER_NE_TCBUFFER_CBUFFER | ALWAYS_NE_TCBUFFER_CBUFFER | NAD_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_TCBUFFER | ALWAYS_EQ_TCBUFFER_TCBUFFER | EVER_NE_TCBUFFER_TCBUFFER | ALWAYS_NE_TCBUFFER_TCBUFFER | EINTERSECTS_TCBUFFER_TCBUFFER | AINTERSECTS_TCBUFFER_TCBUFFER | ECOVERS_TCBUFFER_TCBUFFER | ACOVERS_TCBUFFER_TCBUFFER | ADISJOINT_TCBUFFER_TCBUFFER | ETOUCHES_TCBUFFER_TCBUFFER | ATOUCHES_TCBUFFER_TCBUFFER | NAD_TCBUFFER_TCBUFFER | EDWITHIN_TCBUFFER_TCBUFFER | ADWITHIN_TCBUFFER_TCBUFFER | MINDISTANCE_TCBUFFER_TCBUFFER | NAD_TNPOINT_GEO | EVER_EQ_TNPOINT_NPOINT | ALWAYS_EQ_TNPOINT_NPOINT | EVER_NE_TNPOINT_NPOINT | ALWAYS_NE_TNPOINT_NPOINT | NAD_TNPOINT_NPOINT | EVER_EQ_NPOINT_TNPOINT | ALWAYS_EQ_NPOINT_TNPOINT | EVER_NE_NPOINT_TNPOINT | ALWAYS_NE_NPOINT_TNPOINT | EVER_EQ_TNPOINT_TNPOINT | ALWAYS_EQ_TNPOINT_TNPOINT | EVER_NE_TNPOINT_TNPOINT | ALWAYS_NE_TNPOINT_TNPOINT | NAD_TNPOINT_TNPOINT | NAD_TPOSE_GEO | EVER_EQ_TPOSE_POSE | ALWAYS_EQ_TPOSE_POSE | EVER_NE_TPOSE_POSE | ALWAYS_NE_TPOSE_POSE | NAD_TPOSE_POSE | EVER_EQ_POSE_TPOSE | ALWAYS_EQ_POSE_TPOSE | EVER_NE_POSE_TPOSE | ALWAYS_NE_POSE_TPOSE | EVER_EQ_TPOSE_TPOSE | ALWAYS_EQ_TPOSE_TPOSE | EVER_NE_TPOSE_TPOSE | ALWAYS_NE_TPOSE_TPOSE | NAD_TPOSE_TPOSE | EVER_EQ_TRGEOMETRY_GEO | ALWAYS_EQ_TRGEOMETRY_GEO | EVER_NE_TRGEOMETRY_GEO | ALWAYS_NE_TRGEOMETRY_GEO | NAD_TRGEOMETRY_GEO | EVER_EQ_GEO_TRGEOMETRY | ALWAYS_EQ_GEO_TRGEOMETRY | EVER_NE_GEO_TRGEOMETRY | ALWAYS_NE_GEO_TRGEOMETRY | EVER_EQ_TRGEOMETRY_TRGEOMETRY | ALWAYS_EQ_TRGEOMETRY_TRGEOMETRY | EVER_NE_TRGEOMETRY_TRGEOMETRY | ALWAYS_NE_TRGEOMETRY_TRGEOMETRY | NAD_TRGEOMETRY_TRGEOMETRY | GEOM_INTERSECTS2D | GEOM_DWITHIN2D | GEOM_CONTAINS | GEOM_DISJOINT2D | GEOM_COVERS | GEOM_TOUCHES | GEOM_INTERSECTS3D | GEOM_DWITHIN3D | GEOM_DISTANCE2D | GEOM_DISTANCE3D; sinkClause: INTO sink (',' sink)*; @@ -889,6 +889,11 @@ EVER_EQ_GEO_TRGEOMETRY: 'EVER_EQ_GEO_TRGEOMETRY' | 'ever_eq_geo_trgeometry'; ALWAYS_EQ_GEO_TRGEOMETRY: 'ALWAYS_EQ_GEO_TRGEOMETRY' | 'always_eq_geo_trgeometry'; EVER_NE_GEO_TRGEOMETRY: 'EVER_NE_GEO_TRGEOMETRY' | 'ever_ne_geo_trgeometry'; ALWAYS_NE_GEO_TRGEOMETRY: 'ALWAYS_NE_GEO_TRGEOMETRY' | 'always_ne_geo_trgeometry'; +EVER_EQ_TRGEOMETRY_TRGEOMETRY: 'EVER_EQ_TRGEOMETRY_TRGEOMETRY' | 'ever_eq_trgeometry_trgeometry'; +ALWAYS_EQ_TRGEOMETRY_TRGEOMETRY: 'ALWAYS_EQ_TRGEOMETRY_TRGEOMETRY' | 'always_eq_trgeometry_trgeometry'; +EVER_NE_TRGEOMETRY_TRGEOMETRY: 'EVER_NE_TRGEOMETRY_TRGEOMETRY' | 'ever_ne_trgeometry_trgeometry'; +ALWAYS_NE_TRGEOMETRY_TRGEOMETRY: 'ALWAYS_NE_TRGEOMETRY_TRGEOMETRY' | 'always_ne_trgeometry_trgeometry'; +NAD_TRGEOMETRY_TRGEOMETRY: 'NAD_TRGEOMETRY_TRGEOMETRY' | 'nad_trgeometry_trgeometry'; GEOM_INTERSECTS2D: 'GEOM_INTERSECTS2D' | 'geom_intersects2d'; GEOM_DWITHIN2D: 'GEOM_DWITHIN2D' | 'geom_dwithin2d'; GEOM_CONTAINS: 'GEOM_CONTAINS' | 'geom_contains'; diff --git a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp index 2eeeb29e3f..0f01c34eab 100644 --- a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp +++ b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp @@ -470,6 +470,11 @@ #include #include #include +#include +#include +#include +#include +#include #include #include #include @@ -10486,6 +10491,91 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont return LogicalFunction(AlwaysNeGeoTrgeometryLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5))); } /* END CODEGEN PARSER GLUE: ALWAYS_NE_GEO_TRGEOMETRY */ + case AntlrSQLParser::EVER_EQ_TRGEOMETRY_TRGEOMETRY: { + PRECONDITION(ctx->functionParam().size() == 10, + "EverEqTrgeometryTrgeometry requires 10 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + auto arg5 = visit(ctx->functionParam(5)).as(); + auto arg6 = visit(ctx->functionParam(6)).as(); + auto arg7 = visit(ctx->functionParam(7)).as(); + auto arg8 = visit(ctx->functionParam(8)).as(); + auto arg9 = visit(ctx->functionParam(9)).as(); + return LogicalFunction(EverEqTrgeometryTrgeometryLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6), std::move(arg7), std::move(arg8), std::move(arg9))); + } + /* END CODEGEN PARSER GLUE: EVER_EQ_TRGEOMETRY_TRGEOMETRY */ + case AntlrSQLParser::ALWAYS_EQ_TRGEOMETRY_TRGEOMETRY: { + PRECONDITION(ctx->functionParam().size() == 10, + "AlwaysEqTrgeometryTrgeometry requires 10 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + auto arg5 = visit(ctx->functionParam(5)).as(); + auto arg6 = visit(ctx->functionParam(6)).as(); + auto arg7 = visit(ctx->functionParam(7)).as(); + auto arg8 = visit(ctx->functionParam(8)).as(); + auto arg9 = visit(ctx->functionParam(9)).as(); + return LogicalFunction(AlwaysEqTrgeometryTrgeometryLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6), std::move(arg7), std::move(arg8), std::move(arg9))); + } + /* END CODEGEN PARSER GLUE: ALWAYS_EQ_TRGEOMETRY_TRGEOMETRY */ + case AntlrSQLParser::EVER_NE_TRGEOMETRY_TRGEOMETRY: { + PRECONDITION(ctx->functionParam().size() == 10, + "EverNeTrgeometryTrgeometry requires 10 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + auto arg5 = visit(ctx->functionParam(5)).as(); + auto arg6 = visit(ctx->functionParam(6)).as(); + auto arg7 = visit(ctx->functionParam(7)).as(); + auto arg8 = visit(ctx->functionParam(8)).as(); + auto arg9 = visit(ctx->functionParam(9)).as(); + return LogicalFunction(EverNeTrgeometryTrgeometryLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6), std::move(arg7), std::move(arg8), std::move(arg9))); + } + /* END CODEGEN PARSER GLUE: EVER_NE_TRGEOMETRY_TRGEOMETRY */ + case AntlrSQLParser::ALWAYS_NE_TRGEOMETRY_TRGEOMETRY: { + PRECONDITION(ctx->functionParam().size() == 10, + "AlwaysNeTrgeometryTrgeometry requires 10 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + auto arg5 = visit(ctx->functionParam(5)).as(); + auto arg6 = visit(ctx->functionParam(6)).as(); + auto arg7 = visit(ctx->functionParam(7)).as(); + auto arg8 = visit(ctx->functionParam(8)).as(); + auto arg9 = visit(ctx->functionParam(9)).as(); + return LogicalFunction(AlwaysNeTrgeometryTrgeometryLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6), std::move(arg7), std::move(arg8), std::move(arg9))); + } + /* END CODEGEN PARSER GLUE: ALWAYS_NE_TRGEOMETRY_TRGEOMETRY */ + case AntlrSQLParser::NAD_TRGEOMETRY_TRGEOMETRY: { + PRECONDITION(ctx->functionParam().size() == 10, + "NadTrgeometryTrgeometry requires 10 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + auto arg5 = visit(ctx->functionParam(5)).as(); + auto arg6 = visit(ctx->functionParam(6)).as(); + auto arg7 = visit(ctx->functionParam(7)).as(); + auto arg8 = visit(ctx->functionParam(8)).as(); + auto arg9 = visit(ctx->functionParam(9)).as(); + return LogicalFunction(NadTrgeometryTrgeometryLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6), std::move(arg7), std::move(arg8), std::move(arg9))); + } + /* END CODEGEN PARSER GLUE: NAD_TRGEOMETRY_TRGEOMETRY */ /* END CODEGEN PARSER GLUE: GEOM_INTERSECTS2D */ case AntlrSQLParser::GEOM_DWITHIN2D: { PRECONDITION(ctx->functionParam().size() == 3, From ba910538b7b5d5365d2ba035e406984915959224 Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Mon, 15 Jun 2026 16:52:11 +0200 Subject: [PATCH 72/96] feat(meos): add TPCPOINT per-event spatial predicate NES operators (W124) 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). --- .../EintersectsTpcpointGeoLogicalFunction.hpp | 48 +++++++++ .../Meos/NadTpcpointGeoLogicalFunction.hpp | 48 +++++++++ .../src/Functions/Meos/CMakeLists.txt | 2 + .../EintersectsTpcpointGeoLogicalFunction.cpp | 102 ++++++++++++++++++ .../Meos/NadTpcpointGeoLogicalFunction.cpp | 102 ++++++++++++++++++ ...EintersectsTpcpointGeoPhysicalFunction.hpp | 32 ++++++ .../Meos/NadTpcpointGeoPhysicalFunction.hpp | 32 ++++++ .../src/Functions/Meos/CMakeLists.txt | 2 + ...EintersectsTpcpointGeoPhysicalFunction.cpp | 86 +++++++++++++++ .../Meos/NadTpcpointGeoPhysicalFunction.cpp | 86 +++++++++++++++ nes-sql-parser/AntlrSQL.g4 | 4 +- .../src/AntlrSQLQueryPlanCreator.cpp | 22 ++++ 12 files changed, 565 insertions(+), 1 deletion(-) create mode 100644 nes-logical-operators/include/Functions/Meos/EintersectsTpcpointGeoLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/NadTpcpointGeoLogicalFunction.hpp create mode 100644 nes-logical-operators/src/Functions/Meos/EintersectsTpcpointGeoLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/NadTpcpointGeoLogicalFunction.cpp create mode 100644 nes-physical-operators/include/Functions/Meos/EintersectsTpcpointGeoPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/NadTpcpointGeoPhysicalFunction.hpp create mode 100644 nes-physical-operators/src/Functions/Meos/EintersectsTpcpointGeoPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/NadTpcpointGeoPhysicalFunction.cpp diff --git a/nes-logical-operators/include/Functions/Meos/EintersectsTpcpointGeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EintersectsTpcpointGeoLogicalFunction.hpp new file mode 100644 index 0000000000..cc774ce64f --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EintersectsTpcpointGeoLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if the tpcpoint instant position intersects the geometry. + */ +class EintersectsTpcpointGeoLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EintersectsTpcpointGeo"; + + EintersectsTpcpointGeoLogicalFunction(LogicalFunction pt_hexwkb, LogicalFunction ts, LogicalFunction tgt_wkt); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/NadTpcpointGeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/NadTpcpointGeoLogicalFunction.hpp new file mode 100644 index 0000000000..d02a95fac3 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/NadTpcpointGeoLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns the nearest-approach distance between a tpcpoint instant and a geometry. + */ +class NadTpcpointGeoLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "NadTpcpointGeo"; + + NadTpcpointGeoLogicalFunction(LogicalFunction pt_hexwkb, LogicalFunction ts, LogicalFunction tgt_wkt); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt index d4ada48eac..684831de40 100644 --- a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt @@ -424,6 +424,8 @@ add_plugin(AlwaysEqTrgeometryTrgeometry LogicalFunction nes-logical-operators Al add_plugin(EverNeTrgeometryTrgeometry LogicalFunction nes-logical-operators EverNeTrgeometryTrgeometryLogicalFunction.cpp) add_plugin(AlwaysNeTrgeometryTrgeometry LogicalFunction nes-logical-operators AlwaysNeTrgeometryTrgeometryLogicalFunction.cpp) add_plugin(NadTrgeometryTrgeometry LogicalFunction nes-logical-operators NadTrgeometryTrgeometryLogicalFunction.cpp) +add_plugin(EintersectsTpcpointGeo LogicalFunction nes-logical-operators EintersectsTpcpointGeoLogicalFunction.cpp) +add_plugin(NadTpcpointGeo LogicalFunction nes-logical-operators NadTpcpointGeoLogicalFunction.cpp) add_plugin(GeomIntersects2d LogicalFunction nes-logical-operators GeomIntersects2dLogicalFunction.cpp) add_plugin(GeomDwithin2d LogicalFunction nes-logical-operators GeomDwithin2dLogicalFunction.cpp) add_plugin(GeomContains LogicalFunction nes-logical-operators GeomContainsLogicalFunction.cpp) diff --git a/nes-logical-operators/src/Functions/Meos/EintersectsTpcpointGeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EintersectsTpcpointGeoLogicalFunction.cpp new file mode 100644 index 0000000000..638fde37ec --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EintersectsTpcpointGeoLogicalFunction.cpp @@ -0,0 +1,102 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EintersectsTpcpointGeoLogicalFunction::EintersectsTpcpointGeoLogicalFunction(LogicalFunction pt_hexwkb, LogicalFunction ts, LogicalFunction tgt_wkt) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(pt_hexwkb)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(tgt_wkt)); +} + +DataType EintersectsTpcpointGeoLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EintersectsTpcpointGeoLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EintersectsTpcpointGeoLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EintersectsTpcpointGeoLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, + "EintersectsTpcpointGeoLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EintersectsTpcpointGeoLogicalFunction::getType() const { return NAME; } + +bool EintersectsTpcpointGeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EintersectsTpcpointGeoLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction EintersectsTpcpointGeoLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(3); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "pt_hexwkb must be VARSIZED"); + INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::VARSIZED), "tgt_wkt must be VARSIZED"); + return withChildren(c); +} + +SerializableFunction EintersectsTpcpointGeoLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEintersectsTpcpointGeoLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "EintersectsTpcpointGeoLogicalFunction requires 3 children but got {}", + arguments.children.size()); + return EintersectsTpcpointGeoLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/NadTpcpointGeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/NadTpcpointGeoLogicalFunction.cpp new file mode 100644 index 0000000000..b43ef28fda --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/NadTpcpointGeoLogicalFunction.cpp @@ -0,0 +1,102 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +NadTpcpointGeoLogicalFunction::NadTpcpointGeoLogicalFunction(LogicalFunction pt_hexwkb, LogicalFunction ts, LogicalFunction tgt_wkt) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(pt_hexwkb)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(tgt_wkt)); +} + +DataType NadTpcpointGeoLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction NadTpcpointGeoLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector NadTpcpointGeoLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction NadTpcpointGeoLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, + "NadTpcpointGeoLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view NadTpcpointGeoLogicalFunction::getType() const { return NAME; } + +bool NadTpcpointGeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string NadTpcpointGeoLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction NadTpcpointGeoLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(3); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "pt_hexwkb must be VARSIZED"); + INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::VARSIZED), "tgt_wkt must be VARSIZED"); + return withChildren(c); +} + +SerializableFunction NadTpcpointGeoLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterNadTpcpointGeoLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "NadTpcpointGeoLogicalFunction requires 3 children but got {}", + arguments.children.size()); + return NadTpcpointGeoLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2])); +} + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EintersectsTpcpointGeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EintersectsTpcpointGeoPhysicalFunction.hpp new file mode 100644 index 0000000000..c13b745146 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EintersectsTpcpointGeoPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class EintersectsTpcpointGeoPhysicalFunction : public PhysicalFunctionConcept { +public: + EintersectsTpcpointGeoPhysicalFunction(PhysicalFunction pt_hexwkb, PhysicalFunction ts, PhysicalFunction tgt_wkt); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/NadTpcpointGeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/NadTpcpointGeoPhysicalFunction.hpp new file mode 100644 index 0000000000..77b3a1f03d --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/NadTpcpointGeoPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class NadTpcpointGeoPhysicalFunction : public PhysicalFunctionConcept { +public: + NadTpcpointGeoPhysicalFunction(PhysicalFunction pt_hexwkb, PhysicalFunction ts, PhysicalFunction tgt_wkt); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt index 74c4b79187..51c2891c4e 100644 --- a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt @@ -423,6 +423,8 @@ add_plugin(AlwaysEqTrgeometryTrgeometry PhysicalFunction nes-physical-operators add_plugin(EverNeTrgeometryTrgeometry PhysicalFunction nes-physical-operators EverNeTrgeometryTrgeometryPhysicalFunction.cpp) add_plugin(AlwaysNeTrgeometryTrgeometry PhysicalFunction nes-physical-operators AlwaysNeTrgeometryTrgeometryPhysicalFunction.cpp) add_plugin(NadTrgeometryTrgeometry PhysicalFunction nes-physical-operators NadTrgeometryTrgeometryPhysicalFunction.cpp) +add_plugin(EintersectsTpcpointGeo PhysicalFunction nes-physical-operators EintersectsTpcpointGeoPhysicalFunction.cpp) +add_plugin(NadTpcpointGeo PhysicalFunction nes-physical-operators NadTpcpointGeoPhysicalFunction.cpp) add_plugin(GeomIntersects2d PhysicalFunction nes-physical-operators GeomIntersects2dPhysicalFunction.cpp) add_plugin(GeomDwithin2d PhysicalFunction nes-physical-operators GeomDwithin2dPhysicalFunction.cpp) add_plugin(GeomContains PhysicalFunction nes-physical-operators GeomContainsPhysicalFunction.cpp) diff --git a/nes-physical-operators/src/Functions/Meos/EintersectsTpcpointGeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EintersectsTpcpointGeoPhysicalFunction.cpp new file mode 100644 index 0000000000..bd67ef95d6 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EintersectsTpcpointGeoPhysicalFunction.cpp @@ -0,0 +1,86 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +EintersectsTpcpointGeoPhysicalFunction::EintersectsTpcpointGeoPhysicalFunction(PhysicalFunction pt_hexwkb, PhysicalFunction ts, PhysicalFunction tgt_wkt) +{ + paramFns.reserve(3); + paramFns.push_back(std::move(pt_hexwkb)); + paramFns.push_back(std::move(ts)); + paramFns.push_back(std::move(tgt_wkt)); +} + +VarVal EintersectsTpcpointGeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto pt_hexwkb = paramFns[0].execute(record, arena); + auto ts = paramFns[1].execute(record, arena).cast(); + auto tgt_wkt = paramFns[2].execute(record, arena); + const auto result = nautilus::invoke( + +[](const char* pt_hexwkb, uint32_t pt_len, uint64_t ts, const char* tgt_wkt, uint32_t tgt_len) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + char* hs = (char*)malloc(pt_len + 1); + memcpy(hs, pt_hexwkb, pt_len); hs[pt_len] = '\0'; + Pcpoint* pt = pcpoint_from_hexwkb(hs); free(hs); + if (!pt) return 0.0; + TInstant* inst = tpointcloudinst_make(pt, (TimestampTz)ts); + free(pt); + if (!inst) return 0.0; + char* gs_str = (char*)malloc(tgt_len + 1); + memcpy(gs_str, tgt_wkt, tgt_len); gs_str[tgt_len] = '\0'; + GSERIALIZED* gs = geom_in(gs_str, -1); free(gs_str); + if (!gs) { free(inst); return 0.0; } + bool r = eintersects_tpcpoint_geo((Temporal*)inst, gs); + free(inst); free(gs); + return r ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + pt_hexwkb, ts, tgt_wkt); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEintersectsTpcpointGeoPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "EintersectsTpcpointGeoPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + return EintersectsTpcpointGeoPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/NadTpcpointGeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/NadTpcpointGeoPhysicalFunction.cpp new file mode 100644 index 0000000000..af66f8258d --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/NadTpcpointGeoPhysicalFunction.cpp @@ -0,0 +1,86 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +NadTpcpointGeoPhysicalFunction::NadTpcpointGeoPhysicalFunction(PhysicalFunction pt_hexwkb, PhysicalFunction ts, PhysicalFunction tgt_wkt) +{ + paramFns.reserve(3); + paramFns.push_back(std::move(pt_hexwkb)); + paramFns.push_back(std::move(ts)); + paramFns.push_back(std::move(tgt_wkt)); +} + +VarVal NadTpcpointGeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto pt_hexwkb = paramFns[0].execute(record, arena); + auto ts = paramFns[1].execute(record, arena).cast(); + auto tgt_wkt = paramFns[2].execute(record, arena); + const auto result = nautilus::invoke( + +[](const char* pt_hexwkb, uint32_t pt_len, uint64_t ts, const char* tgt_wkt, uint32_t tgt_len) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + char* hs = (char*)malloc(pt_len + 1); + memcpy(hs, pt_hexwkb, pt_len); hs[pt_len] = '\0'; + Pcpoint* pt = pcpoint_from_hexwkb(hs); free(hs); + if (!pt) return 0.0; + TInstant* inst = tpointcloudinst_make(pt, (TimestampTz)ts); + free(pt); + if (!inst) return 0.0; + char* gs_str = (char*)malloc(tgt_len + 1); + memcpy(gs_str, tgt_wkt, tgt_len); gs_str[tgt_len] = '\0'; + GSERIALIZED* gs = geom_in(gs_str, -1); free(gs_str); + if (!gs) { free(inst); return 0.0; } + double r = nad_tpcpoint_geo((Temporal*)inst, gs); + free(inst); free(gs); + return r; + } catch (const std::exception&) { return 0.0; } + }, + pt_hexwkb, ts, tgt_wkt); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterNadTpcpointGeoPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "NadTpcpointGeoPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + return NadTpcpointGeoPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2])); +} + +} // namespace NES diff --git a/nes-sql-parser/AntlrSQL.g4 b/nes-sql-parser/AntlrSQL.g4 index 0941f3efb3..a6a2b4b706 100644 --- a/nes-sql-parser/AntlrSQL.g4 +++ b/nes-sql-parser/AntlrSQL.g4 @@ -295,7 +295,7 @@ timeUnit: MS timestampParameter: name=identifier; -functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT | TGE_TTEXT_TEXT | TGE_TEXT_TTEXT | TGT_TTEXT_TEXT | TGT_TEXT_TTEXT | TLE_TTEXT_TEXT | TLE_TEXT_TTEXT | TLT_TTEXT_TEXT | TLT_TEXT_TTEXT | TTEXT_UPPER | TTEXT_LOWER | TTEXT_INITCAP | TEXTCAT_TTEXT_TEXT | TEXTCAT_TEXT_TTEXT | TEXTCAT_TTEXT_TTEXT | GEOM_LENGTH | GEOM_PERIMETER | GEOM_AZIMUTH | GEOG_AREA | GEOG_LENGTH | GEOG_PERIMETER | GEOM_IS_EMPTY | AINTERSECTS_TGEO_GEO | ACOVERS_TGEO_GEO | ADISJOINT_TGEO_GEO | ADWITHIN_TGEO_GEO | EINTERSECTS_TGEO_GEO | ETOUCHES_TGEO_GEO | ECONTAINS_TGEO_GEO | ACONTAINS_TGEO_GEO | ATOUCHES_TGEO_GEO | GEO_NUM_POINTS | GEO_NUM_GEOS | GEO_SRID | GEO_IS_UNITARY | GEO_EQUALS | GEO_SAME | GEOG_DISTANCE | NAD_TGEO_GEO | EVER_EQ_TGEO_GEO | EVER_NE_TGEO_GEO | ALWAYS_EQ_TGEO_GEO | ALWAYS_NE_TGEO_GEO | GEOG_INTERSECTS | GEOG_DWITHIN | ACOVERS_GEO_TGEO | GEOM_INTERSECTS | GEOM_DWITHIN | H3_GS_POINT_TO_CELL | EVER_EQ_TH3INDEX_H3INDEX | EVER_NE_TH3INDEX_H3INDEX | ALWAYS_EQ_TH3INDEX_H3INDEX | ALWAYS_NE_TH3INDEX_H3INDEX | TH3INDEX_GET_RESOLUTION | TH3INDEX_GET_BASE_CELL_NUMBER | TH3INDEX_IS_VALID_CELL | TH3INDEX_IS_PENTAGON | TH3INDEX_CELL_TO_PARENT_NEXT | TH3INDEX_CELL_TO_CENTER_CHILD_NEXT | TH3INDEX_CELL_TO_PARENT | TH3INDEX_CELL_TO_CENTER_CHILD | TH3INDEX_CELL_TO_CHILD_POS | TH3INDEX_ARE_NEIGHBOR_CELLS | TH3INDEX_GRID_DISTANCE | EINTERSECTS_TCBUFFER_GEO | AINTERSECTS_TCBUFFER_GEO | ECOVERS_TCBUFFER_GEO | ACOVERS_TCBUFFER_GEO | EDISJOINT_TCBUFFER_GEO | ADISJOINT_TCBUFFER_GEO | ETOUCHES_TCBUFFER_GEO | ATOUCHES_TCBUFFER_GEO | ECONTAINS_TCBUFFER_GEO | ACONTAINS_TCBUFFER_GEO | NAD_TCBUFFER_GEO | EDWITHIN_TCBUFFER_GEO | ADWITHIN_TCBUFFER_GEO | EINTERSECTS_TCBUFFER_CBUFFER | AINTERSECTS_TCBUFFER_CBUFFER | ECOVERS_TCBUFFER_CBUFFER | ACOVERS_TCBUFFER_CBUFFER | EDISJOINT_TCBUFFER_CBUFFER | ADISJOINT_TCBUFFER_CBUFFER | ETOUCHES_TCBUFFER_CBUFFER | ATOUCHES_TCBUFFER_CBUFFER | ECONTAINS_TCBUFFER_CBUFFER | ACONTAINS_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_CBUFFER | ALWAYS_EQ_TCBUFFER_CBUFFER | EVER_NE_TCBUFFER_CBUFFER | ALWAYS_NE_TCBUFFER_CBUFFER | NAD_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_TCBUFFER | ALWAYS_EQ_TCBUFFER_TCBUFFER | EVER_NE_TCBUFFER_TCBUFFER | ALWAYS_NE_TCBUFFER_TCBUFFER | EINTERSECTS_TCBUFFER_TCBUFFER | AINTERSECTS_TCBUFFER_TCBUFFER | ECOVERS_TCBUFFER_TCBUFFER | ACOVERS_TCBUFFER_TCBUFFER | ADISJOINT_TCBUFFER_TCBUFFER | ETOUCHES_TCBUFFER_TCBUFFER | ATOUCHES_TCBUFFER_TCBUFFER | NAD_TCBUFFER_TCBUFFER | EDWITHIN_TCBUFFER_TCBUFFER | ADWITHIN_TCBUFFER_TCBUFFER | MINDISTANCE_TCBUFFER_TCBUFFER | NAD_TNPOINT_GEO | EVER_EQ_TNPOINT_NPOINT | ALWAYS_EQ_TNPOINT_NPOINT | EVER_NE_TNPOINT_NPOINT | ALWAYS_NE_TNPOINT_NPOINT | NAD_TNPOINT_NPOINT | EVER_EQ_NPOINT_TNPOINT | ALWAYS_EQ_NPOINT_TNPOINT | EVER_NE_NPOINT_TNPOINT | ALWAYS_NE_NPOINT_TNPOINT | EVER_EQ_TNPOINT_TNPOINT | ALWAYS_EQ_TNPOINT_TNPOINT | EVER_NE_TNPOINT_TNPOINT | ALWAYS_NE_TNPOINT_TNPOINT | NAD_TNPOINT_TNPOINT | NAD_TPOSE_GEO | EVER_EQ_TPOSE_POSE | ALWAYS_EQ_TPOSE_POSE | EVER_NE_TPOSE_POSE | ALWAYS_NE_TPOSE_POSE | NAD_TPOSE_POSE | EVER_EQ_POSE_TPOSE | ALWAYS_EQ_POSE_TPOSE | EVER_NE_POSE_TPOSE | ALWAYS_NE_POSE_TPOSE | EVER_EQ_TPOSE_TPOSE | ALWAYS_EQ_TPOSE_TPOSE | EVER_NE_TPOSE_TPOSE | ALWAYS_NE_TPOSE_TPOSE | NAD_TPOSE_TPOSE | EVER_EQ_TRGEOMETRY_GEO | ALWAYS_EQ_TRGEOMETRY_GEO | EVER_NE_TRGEOMETRY_GEO | ALWAYS_NE_TRGEOMETRY_GEO | NAD_TRGEOMETRY_GEO | EVER_EQ_GEO_TRGEOMETRY | ALWAYS_EQ_GEO_TRGEOMETRY | EVER_NE_GEO_TRGEOMETRY | ALWAYS_NE_GEO_TRGEOMETRY | EVER_EQ_TRGEOMETRY_TRGEOMETRY | ALWAYS_EQ_TRGEOMETRY_TRGEOMETRY | EVER_NE_TRGEOMETRY_TRGEOMETRY | ALWAYS_NE_TRGEOMETRY_TRGEOMETRY | NAD_TRGEOMETRY_TRGEOMETRY | GEOM_INTERSECTS2D | GEOM_DWITHIN2D | GEOM_CONTAINS | GEOM_DISJOINT2D | GEOM_COVERS | GEOM_TOUCHES | GEOM_INTERSECTS3D | GEOM_DWITHIN3D | GEOM_DISTANCE2D | GEOM_DISTANCE3D; +functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT | TGE_TTEXT_TEXT | TGE_TEXT_TTEXT | TGT_TTEXT_TEXT | TGT_TEXT_TTEXT | TLE_TTEXT_TEXT | TLE_TEXT_TTEXT | TLT_TTEXT_TEXT | TLT_TEXT_TTEXT | TTEXT_UPPER | TTEXT_LOWER | TTEXT_INITCAP | TEXTCAT_TTEXT_TEXT | TEXTCAT_TEXT_TTEXT | TEXTCAT_TTEXT_TTEXT | GEOM_LENGTH | GEOM_PERIMETER | GEOM_AZIMUTH | GEOG_AREA | GEOG_LENGTH | GEOG_PERIMETER | GEOM_IS_EMPTY | AINTERSECTS_TGEO_GEO | ACOVERS_TGEO_GEO | ADISJOINT_TGEO_GEO | ADWITHIN_TGEO_GEO | EINTERSECTS_TGEO_GEO | ETOUCHES_TGEO_GEO | ECONTAINS_TGEO_GEO | ACONTAINS_TGEO_GEO | ATOUCHES_TGEO_GEO | GEO_NUM_POINTS | GEO_NUM_GEOS | GEO_SRID | GEO_IS_UNITARY | GEO_EQUALS | GEO_SAME | GEOG_DISTANCE | NAD_TGEO_GEO | EVER_EQ_TGEO_GEO | EVER_NE_TGEO_GEO | ALWAYS_EQ_TGEO_GEO | ALWAYS_NE_TGEO_GEO | GEOG_INTERSECTS | GEOG_DWITHIN | ACOVERS_GEO_TGEO | GEOM_INTERSECTS | GEOM_DWITHIN | H3_GS_POINT_TO_CELL | EVER_EQ_TH3INDEX_H3INDEX | EVER_NE_TH3INDEX_H3INDEX | ALWAYS_EQ_TH3INDEX_H3INDEX | ALWAYS_NE_TH3INDEX_H3INDEX | TH3INDEX_GET_RESOLUTION | TH3INDEX_GET_BASE_CELL_NUMBER | TH3INDEX_IS_VALID_CELL | TH3INDEX_IS_PENTAGON | TH3INDEX_CELL_TO_PARENT_NEXT | TH3INDEX_CELL_TO_CENTER_CHILD_NEXT | TH3INDEX_CELL_TO_PARENT | TH3INDEX_CELL_TO_CENTER_CHILD | TH3INDEX_CELL_TO_CHILD_POS | TH3INDEX_ARE_NEIGHBOR_CELLS | TH3INDEX_GRID_DISTANCE | EINTERSECTS_TCBUFFER_GEO | AINTERSECTS_TCBUFFER_GEO | ECOVERS_TCBUFFER_GEO | ACOVERS_TCBUFFER_GEO | EDISJOINT_TCBUFFER_GEO | ADISJOINT_TCBUFFER_GEO | ETOUCHES_TCBUFFER_GEO | ATOUCHES_TCBUFFER_GEO | ECONTAINS_TCBUFFER_GEO | ACONTAINS_TCBUFFER_GEO | NAD_TCBUFFER_GEO | EDWITHIN_TCBUFFER_GEO | ADWITHIN_TCBUFFER_GEO | EINTERSECTS_TCBUFFER_CBUFFER | AINTERSECTS_TCBUFFER_CBUFFER | ECOVERS_TCBUFFER_CBUFFER | ACOVERS_TCBUFFER_CBUFFER | EDISJOINT_TCBUFFER_CBUFFER | ADISJOINT_TCBUFFER_CBUFFER | ETOUCHES_TCBUFFER_CBUFFER | ATOUCHES_TCBUFFER_CBUFFER | ECONTAINS_TCBUFFER_CBUFFER | ACONTAINS_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_CBUFFER | ALWAYS_EQ_TCBUFFER_CBUFFER | EVER_NE_TCBUFFER_CBUFFER | ALWAYS_NE_TCBUFFER_CBUFFER | NAD_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_TCBUFFER | ALWAYS_EQ_TCBUFFER_TCBUFFER | EVER_NE_TCBUFFER_TCBUFFER | ALWAYS_NE_TCBUFFER_TCBUFFER | EINTERSECTS_TCBUFFER_TCBUFFER | AINTERSECTS_TCBUFFER_TCBUFFER | ECOVERS_TCBUFFER_TCBUFFER | ACOVERS_TCBUFFER_TCBUFFER | ADISJOINT_TCBUFFER_TCBUFFER | ETOUCHES_TCBUFFER_TCBUFFER | ATOUCHES_TCBUFFER_TCBUFFER | NAD_TCBUFFER_TCBUFFER | EDWITHIN_TCBUFFER_TCBUFFER | ADWITHIN_TCBUFFER_TCBUFFER | MINDISTANCE_TCBUFFER_TCBUFFER | NAD_TNPOINT_GEO | EVER_EQ_TNPOINT_NPOINT | ALWAYS_EQ_TNPOINT_NPOINT | EVER_NE_TNPOINT_NPOINT | ALWAYS_NE_TNPOINT_NPOINT | NAD_TNPOINT_NPOINT | EVER_EQ_NPOINT_TNPOINT | ALWAYS_EQ_NPOINT_TNPOINT | EVER_NE_NPOINT_TNPOINT | ALWAYS_NE_NPOINT_TNPOINT | EVER_EQ_TNPOINT_TNPOINT | ALWAYS_EQ_TNPOINT_TNPOINT | EVER_NE_TNPOINT_TNPOINT | ALWAYS_NE_TNPOINT_TNPOINT | NAD_TNPOINT_TNPOINT | NAD_TPOSE_GEO | EVER_EQ_TPOSE_POSE | ALWAYS_EQ_TPOSE_POSE | EVER_NE_TPOSE_POSE | ALWAYS_NE_TPOSE_POSE | NAD_TPOSE_POSE | EVER_EQ_POSE_TPOSE | ALWAYS_EQ_POSE_TPOSE | EVER_NE_POSE_TPOSE | ALWAYS_NE_POSE_TPOSE | EVER_EQ_TPOSE_TPOSE | ALWAYS_EQ_TPOSE_TPOSE | EVER_NE_TPOSE_TPOSE | ALWAYS_NE_TPOSE_TPOSE | NAD_TPOSE_TPOSE | EVER_EQ_TRGEOMETRY_GEO | ALWAYS_EQ_TRGEOMETRY_GEO | EVER_NE_TRGEOMETRY_GEO | ALWAYS_NE_TRGEOMETRY_GEO | NAD_TRGEOMETRY_GEO | EVER_EQ_GEO_TRGEOMETRY | ALWAYS_EQ_GEO_TRGEOMETRY | EVER_NE_GEO_TRGEOMETRY | ALWAYS_NE_GEO_TRGEOMETRY | EVER_EQ_TRGEOMETRY_TRGEOMETRY | ALWAYS_EQ_TRGEOMETRY_TRGEOMETRY | EVER_NE_TRGEOMETRY_TRGEOMETRY | ALWAYS_NE_TRGEOMETRY_TRGEOMETRY | NAD_TRGEOMETRY_TRGEOMETRY | EINTERSECTS_TPCPOINT_GEO | NAD_TPCPOINT_GEO | GEOM_INTERSECTS2D | GEOM_DWITHIN2D | GEOM_CONTAINS | GEOM_DISJOINT2D | GEOM_COVERS | GEOM_TOUCHES | GEOM_INTERSECTS3D | GEOM_DWITHIN3D | GEOM_DISTANCE2D | GEOM_DISTANCE3D; sinkClause: INTO sink (',' sink)*; @@ -894,6 +894,8 @@ ALWAYS_EQ_TRGEOMETRY_TRGEOMETRY: 'ALWAYS_EQ_TRGEOMETRY_TRGEOMETRY' | 'always_eq_ EVER_NE_TRGEOMETRY_TRGEOMETRY: 'EVER_NE_TRGEOMETRY_TRGEOMETRY' | 'ever_ne_trgeometry_trgeometry'; ALWAYS_NE_TRGEOMETRY_TRGEOMETRY: 'ALWAYS_NE_TRGEOMETRY_TRGEOMETRY' | 'always_ne_trgeometry_trgeometry'; NAD_TRGEOMETRY_TRGEOMETRY: 'NAD_TRGEOMETRY_TRGEOMETRY' | 'nad_trgeometry_trgeometry'; +EINTERSECTS_TPCPOINT_GEO: 'EINTERSECTS_TPCPOINT_GEO' | 'eintersects_tpcpoint_geo'; +NAD_TPCPOINT_GEO: 'NAD_TPCPOINT_GEO' | 'nad_tpcpoint_geo'; GEOM_INTERSECTS2D: 'GEOM_INTERSECTS2D' | 'geom_intersects2d'; GEOM_DWITHIN2D: 'GEOM_DWITHIN2D' | 'geom_dwithin2d'; GEOM_CONTAINS: 'GEOM_CONTAINS' | 'geom_contains'; diff --git a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp index 0f01c34eab..a4ff2c77c5 100644 --- a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp +++ b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp @@ -475,6 +475,8 @@ #include #include #include +#include +#include #include #include #include @@ -10576,6 +10578,26 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont return LogicalFunction(NadTrgeometryTrgeometryLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6), std::move(arg7), std::move(arg8), std::move(arg9))); } /* END CODEGEN PARSER GLUE: NAD_TRGEOMETRY_TRGEOMETRY */ + case AntlrSQLParser::EINTERSECTS_TPCPOINT_GEO: { + PRECONDITION(ctx->functionParam().size() == 3, + "EintersectsTpcpointGeo requires 3 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + return LogicalFunction(EintersectsTpcpointGeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2))); + } + /* END CODEGEN PARSER GLUE: EINTERSECTS_TPCPOINT_GEO */ + case AntlrSQLParser::NAD_TPCPOINT_GEO: { + PRECONDITION(ctx->functionParam().size() == 3, + "NadTpcpointGeo requires 3 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + return LogicalFunction(NadTpcpointGeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2))); + } + /* END CODEGEN PARSER GLUE: NAD_TPCPOINT_GEO */ /* END CODEGEN PARSER GLUE: GEOM_INTERSECTS2D */ case AntlrSQLParser::GEOM_DWITHIN2D: { PRECONDITION(ctx->functionParam().size() == 3, From 9cf97fdfa3386f1d7ec805b97b5c53abdcbd9497 Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Mon, 15 Jun 2026 17:43:13 +0200 Subject: [PATCH 73/96] feat(meos): add QUADBIN static cell NES operators (W125) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- .../Meos/QuadbinCellAreaLogicalFunction.hpp | 48 ++++++++ .../QuadbinCellToParentLogicalFunction.hpp | 48 ++++++++ .../QuadbinCellToQuadkeyLogicalFunction.hpp | 48 ++++++++ .../QuadbinGetResolutionLogicalFunction.hpp | 48 ++++++++ .../QuadbinIsValidCellLogicalFunction.hpp | 48 ++++++++ .../QuadbinPointToCellLogicalFunction.hpp | 48 ++++++++ .../Meos/QuadbinTileToCellLogicalFunction.hpp | 48 ++++++++ .../src/Functions/Meos/CMakeLists.txt | 7 ++ .../Meos/QuadbinCellAreaLogicalFunction.cpp | 95 ++++++++++++++++ .../QuadbinCellToParentLogicalFunction.cpp | 99 +++++++++++++++++ .../QuadbinCellToQuadkeyLogicalFunction.cpp | 95 ++++++++++++++++ .../QuadbinGetResolutionLogicalFunction.cpp | 95 ++++++++++++++++ .../QuadbinIsValidCellLogicalFunction.cpp | 95 ++++++++++++++++ .../QuadbinPointToCellLogicalFunction.cpp | 103 ++++++++++++++++++ .../Meos/QuadbinTileToCellLogicalFunction.cpp | 103 ++++++++++++++++++ .../Meos/QuadbinCellAreaPhysicalFunction.hpp | 32 ++++++ .../QuadbinCellToParentPhysicalFunction.hpp | 32 ++++++ .../QuadbinCellToQuadkeyPhysicalFunction.hpp | 32 ++++++ .../QuadbinGetResolutionPhysicalFunction.hpp | 32 ++++++ .../QuadbinIsValidCellPhysicalFunction.hpp | 32 ++++++ .../QuadbinPointToCellPhysicalFunction.hpp | 32 ++++++ .../QuadbinTileToCellPhysicalFunction.hpp | 32 ++++++ .../src/Functions/Meos/CMakeLists.txt | 7 ++ .../Meos/QuadbinCellAreaPhysicalFunction.cpp | 66 +++++++++++ .../QuadbinCellToParentPhysicalFunction.cpp | 82 ++++++++++++++ .../QuadbinCellToQuadkeyPhysicalFunction.cpp | 77 +++++++++++++ .../QuadbinGetResolutionPhysicalFunction.cpp | 66 +++++++++++ .../QuadbinIsValidCellPhysicalFunction.cpp | 66 +++++++++++ .../QuadbinPointToCellPhysicalFunction.cpp | 85 +++++++++++++++ .../QuadbinTileToCellPhysicalFunction.cpp | 85 +++++++++++++++ nes-sql-parser/AntlrSQL.g4 | 9 +- .../src/AntlrSQLQueryPlanCreator.cpp | 68 ++++++++++++ 32 files changed, 1862 insertions(+), 1 deletion(-) create mode 100644 nes-logical-operators/include/Functions/Meos/QuadbinCellAreaLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/QuadbinCellToParentLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/QuadbinCellToQuadkeyLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/QuadbinGetResolutionLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/QuadbinIsValidCellLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/QuadbinPointToCellLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/QuadbinTileToCellLogicalFunction.hpp create mode 100644 nes-logical-operators/src/Functions/Meos/QuadbinCellAreaLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/QuadbinCellToParentLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/QuadbinCellToQuadkeyLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/QuadbinGetResolutionLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/QuadbinIsValidCellLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/QuadbinPointToCellLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/QuadbinTileToCellLogicalFunction.cpp create mode 100644 nes-physical-operators/include/Functions/Meos/QuadbinCellAreaPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/QuadbinCellToParentPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/QuadbinCellToQuadkeyPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/QuadbinGetResolutionPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/QuadbinIsValidCellPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/QuadbinPointToCellPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/QuadbinTileToCellPhysicalFunction.hpp create mode 100644 nes-physical-operators/src/Functions/Meos/QuadbinCellAreaPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/QuadbinCellToParentPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/QuadbinCellToQuadkeyPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/QuadbinGetResolutionPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/QuadbinIsValidCellPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/QuadbinPointToCellPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/QuadbinTileToCellPhysicalFunction.cpp diff --git a/nes-logical-operators/include/Functions/Meos/QuadbinCellAreaLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/QuadbinCellAreaLogicalFunction.hpp new file mode 100644 index 0000000000..56d79731ff --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/QuadbinCellAreaLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns a FLOAT64 scalar for a quadbin cell. NES token: QUADBIN_CELL_AREA. + */ +class QuadbinCellAreaLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "QuadbinCellArea"; + + QuadbinCellAreaLogicalFunction(LogicalFunction cell); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/QuadbinCellToParentLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/QuadbinCellToParentLogicalFunction.hpp new file mode 100644 index 0000000000..57abe70a7b --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/QuadbinCellToParentLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns a VARCHAR for a quadbin cell. NES token: QUADBIN_CELL_TO_PARENT. + */ +class QuadbinCellToParentLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "QuadbinCellToParent"; + + QuadbinCellToParentLogicalFunction(LogicalFunction cell, LogicalFunction res); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/QuadbinCellToQuadkeyLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/QuadbinCellToQuadkeyLogicalFunction.hpp new file mode 100644 index 0000000000..9e5a12bcb7 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/QuadbinCellToQuadkeyLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns a VARCHAR for a quadbin cell. NES token: QUADBIN_CELL_TO_QUADKEY. + */ +class QuadbinCellToQuadkeyLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "QuadbinCellToQuadkey"; + + QuadbinCellToQuadkeyLogicalFunction(LogicalFunction cell); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/QuadbinGetResolutionLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/QuadbinGetResolutionLogicalFunction.hpp new file mode 100644 index 0000000000..b332f289fe --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/QuadbinGetResolutionLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns a FLOAT64 scalar for a quadbin cell. NES token: QUADBIN_GET_RESOLUTION. + */ +class QuadbinGetResolutionLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "QuadbinGetResolution"; + + QuadbinGetResolutionLogicalFunction(LogicalFunction cell); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/QuadbinIsValidCellLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/QuadbinIsValidCellLogicalFunction.hpp new file mode 100644 index 0000000000..be48e755b9 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/QuadbinIsValidCellLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns a FLOAT64 scalar for a quadbin cell. NES token: QUADBIN_IS_VALID_CELL. + */ +class QuadbinIsValidCellLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "QuadbinIsValidCell"; + + QuadbinIsValidCellLogicalFunction(LogicalFunction cell); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/QuadbinPointToCellLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/QuadbinPointToCellLogicalFunction.hpp new file mode 100644 index 0000000000..6af0e0da1d --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/QuadbinPointToCellLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns a VARCHAR for a quadbin cell. NES token: QUADBIN_POINT_TO_CELL. + */ +class QuadbinPointToCellLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "QuadbinPointToCell"; + + QuadbinPointToCellLogicalFunction(LogicalFunction lon, LogicalFunction lat, LogicalFunction res); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/QuadbinTileToCellLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/QuadbinTileToCellLogicalFunction.hpp new file mode 100644 index 0000000000..d655955c70 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/QuadbinTileToCellLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns a VARCHAR for a quadbin cell. NES token: QUADBIN_TILE_TO_CELL. + */ +class QuadbinTileToCellLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "QuadbinTileToCell"; + + QuadbinTileToCellLogicalFunction(LogicalFunction x, LogicalFunction y, LogicalFunction z); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt index 684831de40..8b81ca36ca 100644 --- a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt @@ -426,6 +426,13 @@ add_plugin(AlwaysNeTrgeometryTrgeometry LogicalFunction nes-logical-operators Al add_plugin(NadTrgeometryTrgeometry LogicalFunction nes-logical-operators NadTrgeometryTrgeometryLogicalFunction.cpp) add_plugin(EintersectsTpcpointGeo LogicalFunction nes-logical-operators EintersectsTpcpointGeoLogicalFunction.cpp) add_plugin(NadTpcpointGeo LogicalFunction nes-logical-operators NadTpcpointGeoLogicalFunction.cpp) +add_plugin(QuadbinPointToCell LogicalFunction nes-logical-operators QuadbinPointToCellLogicalFunction.cpp) +add_plugin(QuadbinIsValidCell LogicalFunction nes-logical-operators QuadbinIsValidCellLogicalFunction.cpp) +add_plugin(QuadbinGetResolution LogicalFunction nes-logical-operators QuadbinGetResolutionLogicalFunction.cpp) +add_plugin(QuadbinCellArea LogicalFunction nes-logical-operators QuadbinCellAreaLogicalFunction.cpp) +add_plugin(QuadbinCellToQuadkey LogicalFunction nes-logical-operators QuadbinCellToQuadkeyLogicalFunction.cpp) +add_plugin(QuadbinCellToParent LogicalFunction nes-logical-operators QuadbinCellToParentLogicalFunction.cpp) +add_plugin(QuadbinTileToCell LogicalFunction nes-logical-operators QuadbinTileToCellLogicalFunction.cpp) add_plugin(GeomIntersects2d LogicalFunction nes-logical-operators GeomIntersects2dLogicalFunction.cpp) add_plugin(GeomDwithin2d LogicalFunction nes-logical-operators GeomDwithin2dLogicalFunction.cpp) add_plugin(GeomContains LogicalFunction nes-logical-operators GeomContainsLogicalFunction.cpp) diff --git a/nes-logical-operators/src/Functions/Meos/QuadbinCellAreaLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/QuadbinCellAreaLogicalFunction.cpp new file mode 100644 index 0000000000..4e1828ac1b --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/QuadbinCellAreaLogicalFunction.cpp @@ -0,0 +1,95 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +QuadbinCellAreaLogicalFunction::QuadbinCellAreaLogicalFunction(LogicalFunction cell) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(1); + parameters.push_back(std::move(cell)); +} + +DataType QuadbinCellAreaLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction QuadbinCellAreaLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector QuadbinCellAreaLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction QuadbinCellAreaLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 1, + "QuadbinCellAreaLogicalFunction requires 1 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view QuadbinCellAreaLogicalFunction::getType() const { return NAME; } + +bool QuadbinCellAreaLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string QuadbinCellAreaLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction QuadbinCellAreaLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(1); + c.emplace_back(parameters[0].withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "cell must be UINT64"); + return withChildren(c); +} + +SerializableFunction QuadbinCellAreaLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterQuadbinCellAreaLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 1, + "QuadbinCellAreaLogicalFunction requires 1 children but got {}", + arguments.children.size()); + return QuadbinCellAreaLogicalFunction( + std::move(arguments.children[0])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/QuadbinCellToParentLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/QuadbinCellToParentLogicalFunction.cpp new file mode 100644 index 0000000000..d2b9d2f050 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/QuadbinCellToParentLogicalFunction.cpp @@ -0,0 +1,99 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +QuadbinCellToParentLogicalFunction::QuadbinCellToParentLogicalFunction(LogicalFunction cell, LogicalFunction res) + : dataType(DataTypeProvider::provideDataType(DataType::Type::VARSIZED)) +{ + parameters.reserve(2); + parameters.push_back(std::move(cell)); + parameters.push_back(std::move(res)); +} + +DataType QuadbinCellToParentLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction QuadbinCellToParentLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector QuadbinCellToParentLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction QuadbinCellToParentLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 2, + "QuadbinCellToParentLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view QuadbinCellToParentLogicalFunction::getType() const { return NAME; } + +bool QuadbinCellToParentLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string QuadbinCellToParentLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction QuadbinCellToParentLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(2); + c.emplace_back(parameters[0].withInferredDataType(schema)); + c.emplace_back(parameters[1].withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "cell must be UINT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "res must be UINT64"); + return withChildren(c); +} + +SerializableFunction QuadbinCellToParentLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterQuadbinCellToParentLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 2, + "QuadbinCellToParentLogicalFunction requires 2 children but got {}", + arguments.children.size()); + return QuadbinCellToParentLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/QuadbinCellToQuadkeyLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/QuadbinCellToQuadkeyLogicalFunction.cpp new file mode 100644 index 0000000000..547d5861cc --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/QuadbinCellToQuadkeyLogicalFunction.cpp @@ -0,0 +1,95 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +QuadbinCellToQuadkeyLogicalFunction::QuadbinCellToQuadkeyLogicalFunction(LogicalFunction cell) + : dataType(DataTypeProvider::provideDataType(DataType::Type::VARSIZED)) +{ + parameters.reserve(1); + parameters.push_back(std::move(cell)); +} + +DataType QuadbinCellToQuadkeyLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction QuadbinCellToQuadkeyLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector QuadbinCellToQuadkeyLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction QuadbinCellToQuadkeyLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 1, + "QuadbinCellToQuadkeyLogicalFunction requires 1 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view QuadbinCellToQuadkeyLogicalFunction::getType() const { return NAME; } + +bool QuadbinCellToQuadkeyLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string QuadbinCellToQuadkeyLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction QuadbinCellToQuadkeyLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(1); + c.emplace_back(parameters[0].withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "cell must be UINT64"); + return withChildren(c); +} + +SerializableFunction QuadbinCellToQuadkeyLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterQuadbinCellToQuadkeyLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 1, + "QuadbinCellToQuadkeyLogicalFunction requires 1 children but got {}", + arguments.children.size()); + return QuadbinCellToQuadkeyLogicalFunction( + std::move(arguments.children[0])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/QuadbinGetResolutionLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/QuadbinGetResolutionLogicalFunction.cpp new file mode 100644 index 0000000000..c8bc6be072 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/QuadbinGetResolutionLogicalFunction.cpp @@ -0,0 +1,95 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +QuadbinGetResolutionLogicalFunction::QuadbinGetResolutionLogicalFunction(LogicalFunction cell) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(1); + parameters.push_back(std::move(cell)); +} + +DataType QuadbinGetResolutionLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction QuadbinGetResolutionLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector QuadbinGetResolutionLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction QuadbinGetResolutionLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 1, + "QuadbinGetResolutionLogicalFunction requires 1 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view QuadbinGetResolutionLogicalFunction::getType() const { return NAME; } + +bool QuadbinGetResolutionLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string QuadbinGetResolutionLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction QuadbinGetResolutionLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(1); + c.emplace_back(parameters[0].withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "cell must be UINT64"); + return withChildren(c); +} + +SerializableFunction QuadbinGetResolutionLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterQuadbinGetResolutionLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 1, + "QuadbinGetResolutionLogicalFunction requires 1 children but got {}", + arguments.children.size()); + return QuadbinGetResolutionLogicalFunction( + std::move(arguments.children[0])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/QuadbinIsValidCellLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/QuadbinIsValidCellLogicalFunction.cpp new file mode 100644 index 0000000000..fee9e32794 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/QuadbinIsValidCellLogicalFunction.cpp @@ -0,0 +1,95 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +QuadbinIsValidCellLogicalFunction::QuadbinIsValidCellLogicalFunction(LogicalFunction cell) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(1); + parameters.push_back(std::move(cell)); +} + +DataType QuadbinIsValidCellLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction QuadbinIsValidCellLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector QuadbinIsValidCellLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction QuadbinIsValidCellLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 1, + "QuadbinIsValidCellLogicalFunction requires 1 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view QuadbinIsValidCellLogicalFunction::getType() const { return NAME; } + +bool QuadbinIsValidCellLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string QuadbinIsValidCellLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction QuadbinIsValidCellLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(1); + c.emplace_back(parameters[0].withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "cell must be UINT64"); + return withChildren(c); +} + +SerializableFunction QuadbinIsValidCellLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterQuadbinIsValidCellLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 1, + "QuadbinIsValidCellLogicalFunction requires 1 children but got {}", + arguments.children.size()); + return QuadbinIsValidCellLogicalFunction( + std::move(arguments.children[0])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/QuadbinPointToCellLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/QuadbinPointToCellLogicalFunction.cpp new file mode 100644 index 0000000000..33311bcde9 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/QuadbinPointToCellLogicalFunction.cpp @@ -0,0 +1,103 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +QuadbinPointToCellLogicalFunction::QuadbinPointToCellLogicalFunction(LogicalFunction lon, LogicalFunction lat, LogicalFunction res) + : dataType(DataTypeProvider::provideDataType(DataType::Type::VARSIZED)) +{ + parameters.reserve(3); + parameters.push_back(std::move(lon)); + parameters.push_back(std::move(lat)); + parameters.push_back(std::move(res)); +} + +DataType QuadbinPointToCellLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction QuadbinPointToCellLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector QuadbinPointToCellLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction QuadbinPointToCellLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, + "QuadbinPointToCellLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view QuadbinPointToCellLogicalFunction::getType() const { return NAME; } + +bool QuadbinPointToCellLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string QuadbinPointToCellLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction QuadbinPointToCellLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(3); + c.emplace_back(parameters[0].withInferredDataType(schema)); + c.emplace_back(parameters[1].withInferredDataType(schema)); + c.emplace_back(parameters[2].withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon must be FLOAT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "res must be UINT64"); + return withChildren(c); +} + +SerializableFunction QuadbinPointToCellLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterQuadbinPointToCellLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "QuadbinPointToCellLogicalFunction requires 3 children but got {}", + arguments.children.size()); + return QuadbinPointToCellLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/QuadbinTileToCellLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/QuadbinTileToCellLogicalFunction.cpp new file mode 100644 index 0000000000..334bd4a162 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/QuadbinTileToCellLogicalFunction.cpp @@ -0,0 +1,103 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +QuadbinTileToCellLogicalFunction::QuadbinTileToCellLogicalFunction(LogicalFunction x, LogicalFunction y, LogicalFunction z) + : dataType(DataTypeProvider::provideDataType(DataType::Type::VARSIZED)) +{ + parameters.reserve(3); + parameters.push_back(std::move(x)); + parameters.push_back(std::move(y)); + parameters.push_back(std::move(z)); +} + +DataType QuadbinTileToCellLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction QuadbinTileToCellLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector QuadbinTileToCellLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction QuadbinTileToCellLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, + "QuadbinTileToCellLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view QuadbinTileToCellLogicalFunction::getType() const { return NAME; } + +bool QuadbinTileToCellLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string QuadbinTileToCellLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction QuadbinTileToCellLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(3); + c.emplace_back(parameters[0].withInferredDataType(schema)); + c.emplace_back(parameters[1].withInferredDataType(schema)); + c.emplace_back(parameters[2].withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "x must be UINT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "y must be UINT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "z must be UINT64"); + return withChildren(c); +} + +SerializableFunction QuadbinTileToCellLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterQuadbinTileToCellLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "QuadbinTileToCellLogicalFunction requires 3 children but got {}", + arguments.children.size()); + return QuadbinTileToCellLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2])); +} + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/QuadbinCellAreaPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/QuadbinCellAreaPhysicalFunction.hpp new file mode 100644 index 0000000000..796b3fea82 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/QuadbinCellAreaPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class QuadbinCellAreaPhysicalFunction : public PhysicalFunctionConcept { +public: + QuadbinCellAreaPhysicalFunction(PhysicalFunction cell); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/QuadbinCellToParentPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/QuadbinCellToParentPhysicalFunction.hpp new file mode 100644 index 0000000000..1f8f5d9545 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/QuadbinCellToParentPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class QuadbinCellToParentPhysicalFunction : public PhysicalFunctionConcept { +public: + QuadbinCellToParentPhysicalFunction(PhysicalFunction cell, PhysicalFunction res); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/QuadbinCellToQuadkeyPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/QuadbinCellToQuadkeyPhysicalFunction.hpp new file mode 100644 index 0000000000..69b7da24f4 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/QuadbinCellToQuadkeyPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class QuadbinCellToQuadkeyPhysicalFunction : public PhysicalFunctionConcept { +public: + QuadbinCellToQuadkeyPhysicalFunction(PhysicalFunction cell); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/QuadbinGetResolutionPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/QuadbinGetResolutionPhysicalFunction.hpp new file mode 100644 index 0000000000..c456176fae --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/QuadbinGetResolutionPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class QuadbinGetResolutionPhysicalFunction : public PhysicalFunctionConcept { +public: + QuadbinGetResolutionPhysicalFunction(PhysicalFunction cell); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/QuadbinIsValidCellPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/QuadbinIsValidCellPhysicalFunction.hpp new file mode 100644 index 0000000000..b33082239a --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/QuadbinIsValidCellPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class QuadbinIsValidCellPhysicalFunction : public PhysicalFunctionConcept { +public: + QuadbinIsValidCellPhysicalFunction(PhysicalFunction cell); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/QuadbinPointToCellPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/QuadbinPointToCellPhysicalFunction.hpp new file mode 100644 index 0000000000..8b20f0ef23 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/QuadbinPointToCellPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class QuadbinPointToCellPhysicalFunction : public PhysicalFunctionConcept { +public: + QuadbinPointToCellPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, PhysicalFunction res); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/QuadbinTileToCellPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/QuadbinTileToCellPhysicalFunction.hpp new file mode 100644 index 0000000000..02ac96c13f --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/QuadbinTileToCellPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class QuadbinTileToCellPhysicalFunction : public PhysicalFunctionConcept { +public: + QuadbinTileToCellPhysicalFunction(PhysicalFunction x, PhysicalFunction y, PhysicalFunction z); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt index 51c2891c4e..53f465f9d5 100644 --- a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt @@ -425,6 +425,13 @@ add_plugin(AlwaysNeTrgeometryTrgeometry PhysicalFunction nes-physical-operators add_plugin(NadTrgeometryTrgeometry PhysicalFunction nes-physical-operators NadTrgeometryTrgeometryPhysicalFunction.cpp) add_plugin(EintersectsTpcpointGeo PhysicalFunction nes-physical-operators EintersectsTpcpointGeoPhysicalFunction.cpp) add_plugin(NadTpcpointGeo PhysicalFunction nes-physical-operators NadTpcpointGeoPhysicalFunction.cpp) +add_plugin(QuadbinPointToCell PhysicalFunction nes-physical-operators QuadbinPointToCellPhysicalFunction.cpp) +add_plugin(QuadbinIsValidCell PhysicalFunction nes-physical-operators QuadbinIsValidCellPhysicalFunction.cpp) +add_plugin(QuadbinGetResolution PhysicalFunction nes-physical-operators QuadbinGetResolutionPhysicalFunction.cpp) +add_plugin(QuadbinCellArea PhysicalFunction nes-physical-operators QuadbinCellAreaPhysicalFunction.cpp) +add_plugin(QuadbinCellToQuadkey PhysicalFunction nes-physical-operators QuadbinCellToQuadkeyPhysicalFunction.cpp) +add_plugin(QuadbinCellToParent PhysicalFunction nes-physical-operators QuadbinCellToParentPhysicalFunction.cpp) +add_plugin(QuadbinTileToCell PhysicalFunction nes-physical-operators QuadbinTileToCellPhysicalFunction.cpp) add_plugin(GeomIntersects2d PhysicalFunction nes-physical-operators GeomIntersects2dPhysicalFunction.cpp) add_plugin(GeomDwithin2d PhysicalFunction nes-physical-operators GeomDwithin2dPhysicalFunction.cpp) add_plugin(GeomContains PhysicalFunction nes-physical-operators GeomContainsPhysicalFunction.cpp) diff --git a/nes-physical-operators/src/Functions/Meos/QuadbinCellAreaPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/QuadbinCellAreaPhysicalFunction.cpp new file mode 100644 index 0000000000..3289b28210 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/QuadbinCellAreaPhysicalFunction.cpp @@ -0,0 +1,66 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} +#include +#include + +namespace NES { + +QuadbinCellAreaPhysicalFunction::QuadbinCellAreaPhysicalFunction(PhysicalFunction cell) +{ + paramFns.reserve(1); + paramFns.push_back(std::move(cell)); +} + +VarVal QuadbinCellAreaPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto cell = paramFns[0].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](uint64_t cell) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + return quadbin_cell_area((Quadbin)cell); + } catch (const std::exception&) { return 0.0; } + }, + cell); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterQuadbinCellAreaPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 1, + "QuadbinCellAreaPhysicalFunction requires 1 children but got {}", + arguments.childFunctions.size()); + return QuadbinCellAreaPhysicalFunction( + std::move(arguments.childFunctions[0])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/QuadbinCellToParentPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/QuadbinCellToParentPhysicalFunction.cpp new file mode 100644 index 0000000000..047bd77f29 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/QuadbinCellToParentPhysicalFunction.cpp @@ -0,0 +1,82 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} +#include +#include + +namespace NES { + +QuadbinCellToParentPhysicalFunction::QuadbinCellToParentPhysicalFunction(PhysicalFunction cell, PhysicalFunction res) +{ + paramFns.reserve(2); + paramFns.push_back(std::move(cell)); + paramFns.push_back(std::move(res)); +} + +VarVal QuadbinCellToParentPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto cell = paramFns[0].execute(record, arena).cast(); + auto res = paramFns[1].execute(record, arena).cast(); + constexpr uint32_t MAX_LEN = 32; + auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); + + const auto actualLen = nautilus::invoke( + +[](uint64_t cell, uint64_t res, char* buf, uint32_t bufMax) -> uint32_t { + try { + MEOS::Meos::ensureMeosInitialized(); + Quadbin parent = quadbin_cell_to_parent((Quadbin)cell, (uint32_t)res); + if (parent == 0) return 0u; + char* s = quadbin_index_to_string(parent); + if (!s) return 0u; + uint32_t len = (uint32_t)strlen(s); + if (len > bufMax) len = bufMax; + memcpy(buf, s, len); + free(s); + return len; + } catch (const std::exception&) { return 0u; } + }, + cell, res, outBuf.getContent(), nautilus::val(MAX_LEN)); + + VarVal(actualLen).writeToMemory(outBuf.getReference()); + return outBuf; +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterQuadbinCellToParentPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 2, + "QuadbinCellToParentPhysicalFunction requires 2 children but got {}", + arguments.childFunctions.size()); + return QuadbinCellToParentPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/QuadbinCellToQuadkeyPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/QuadbinCellToQuadkeyPhysicalFunction.cpp new file mode 100644 index 0000000000..a45874a29f --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/QuadbinCellToQuadkeyPhysicalFunction.cpp @@ -0,0 +1,77 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} +#include +#include + +namespace NES { + +QuadbinCellToQuadkeyPhysicalFunction::QuadbinCellToQuadkeyPhysicalFunction(PhysicalFunction cell) +{ + paramFns.reserve(1); + paramFns.push_back(std::move(cell)); +} + +VarVal QuadbinCellToQuadkeyPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto cell = paramFns[0].execute(record, arena).cast(); + constexpr uint32_t MAX_LEN = 64; + auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); + + const auto actualLen = nautilus::invoke( + +[](uint64_t cell, char* buf, uint32_t bufMax) -> uint32_t { + try { + MEOS::Meos::ensureMeosInitialized(); + char* s = quadbin_cell_to_quadkey((Quadbin)cell); + if (!s) return 0u; + uint32_t len = (uint32_t)strlen(s); + if (len > bufMax) len = bufMax; + memcpy(buf, s, len); + free(s); + return len; + } catch (const std::exception&) { return 0u; } + }, + cell, outBuf.getContent(), nautilus::val(MAX_LEN)); + + VarVal(actualLen).writeToMemory(outBuf.getReference()); + return outBuf; +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterQuadbinCellToQuadkeyPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 1, + "QuadbinCellToQuadkeyPhysicalFunction requires 1 children but got {}", + arguments.childFunctions.size()); + return QuadbinCellToQuadkeyPhysicalFunction( + std::move(arguments.childFunctions[0])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/QuadbinGetResolutionPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/QuadbinGetResolutionPhysicalFunction.cpp new file mode 100644 index 0000000000..0a725eeef1 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/QuadbinGetResolutionPhysicalFunction.cpp @@ -0,0 +1,66 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} +#include +#include + +namespace NES { + +QuadbinGetResolutionPhysicalFunction::QuadbinGetResolutionPhysicalFunction(PhysicalFunction cell) +{ + paramFns.reserve(1); + paramFns.push_back(std::move(cell)); +} + +VarVal QuadbinGetResolutionPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto cell = paramFns[0].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](uint64_t cell) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + return (double)quadbin_get_resolution((Quadbin)cell); + } catch (const std::exception&) { return 0.0; } + }, + cell); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterQuadbinGetResolutionPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 1, + "QuadbinGetResolutionPhysicalFunction requires 1 children but got {}", + arguments.childFunctions.size()); + return QuadbinGetResolutionPhysicalFunction( + std::move(arguments.childFunctions[0])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/QuadbinIsValidCellPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/QuadbinIsValidCellPhysicalFunction.cpp new file mode 100644 index 0000000000..60360c76c4 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/QuadbinIsValidCellPhysicalFunction.cpp @@ -0,0 +1,66 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} +#include +#include + +namespace NES { + +QuadbinIsValidCellPhysicalFunction::QuadbinIsValidCellPhysicalFunction(PhysicalFunction cell) +{ + paramFns.reserve(1); + paramFns.push_back(std::move(cell)); +} + +VarVal QuadbinIsValidCellPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto cell = paramFns[0].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](uint64_t cell) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + return quadbin_is_valid_cell((Quadbin)cell) ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + cell); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterQuadbinIsValidCellPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 1, + "QuadbinIsValidCellPhysicalFunction requires 1 children but got {}", + arguments.childFunctions.size()); + return QuadbinIsValidCellPhysicalFunction( + std::move(arguments.childFunctions[0])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/QuadbinPointToCellPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/QuadbinPointToCellPhysicalFunction.cpp new file mode 100644 index 0000000000..eb526d8409 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/QuadbinPointToCellPhysicalFunction.cpp @@ -0,0 +1,85 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} +#include +#include + +namespace NES { + +QuadbinPointToCellPhysicalFunction::QuadbinPointToCellPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, PhysicalFunction res) +{ + paramFns.reserve(3); + paramFns.push_back(std::move(lon)); + paramFns.push_back(std::move(lat)); + paramFns.push_back(std::move(res)); +} + +VarVal QuadbinPointToCellPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto lon = paramFns[0].execute(record, arena).cast(); + auto lat = paramFns[1].execute(record, arena).cast(); + auto res = paramFns[2].execute(record, arena).cast(); + constexpr uint32_t MAX_LEN = 32; + auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); + + const auto actualLen = nautilus::invoke( + +[](double lon, double lat, uint64_t res, char* buf, uint32_t bufMax) -> uint32_t { + try { + MEOS::Meos::ensureMeosInitialized(); + Quadbin cell = quadbin_point_to_cell(lon, lat, (uint32_t)res); + if (cell == 0) return 0u; + char* s = quadbin_index_to_string(cell); + if (!s) return 0u; + uint32_t len = (uint32_t)strlen(s); + if (len > bufMax) len = bufMax; + memcpy(buf, s, len); + free(s); + return len; + } catch (const std::exception&) { return 0u; } + }, + lon, lat, res, outBuf.getContent(), nautilus::val(MAX_LEN)); + + VarVal(actualLen).writeToMemory(outBuf.getReference()); + return outBuf; +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterQuadbinPointToCellPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "QuadbinPointToCellPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + return QuadbinPointToCellPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/QuadbinTileToCellPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/QuadbinTileToCellPhysicalFunction.cpp new file mode 100644 index 0000000000..517bef3c93 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/QuadbinTileToCellPhysicalFunction.cpp @@ -0,0 +1,85 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} +#include +#include + +namespace NES { + +QuadbinTileToCellPhysicalFunction::QuadbinTileToCellPhysicalFunction(PhysicalFunction x, PhysicalFunction y, PhysicalFunction z) +{ + paramFns.reserve(3); + paramFns.push_back(std::move(x)); + paramFns.push_back(std::move(y)); + paramFns.push_back(std::move(z)); +} + +VarVal QuadbinTileToCellPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto x = paramFns[0].execute(record, arena).cast(); + auto y = paramFns[1].execute(record, arena).cast(); + auto z = paramFns[2].execute(record, arena).cast(); + constexpr uint32_t MAX_LEN = 32; + auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); + + const auto actualLen = nautilus::invoke( + +[](uint64_t x, uint64_t y, uint64_t z, char* buf, uint32_t bufMax) -> uint32_t { + try { + MEOS::Meos::ensureMeosInitialized(); + Quadbin cell = quadbin_tile_to_cell((uint32_t)x, (uint32_t)y, (uint32_t)z); + if (cell == 0) return 0u; + char* s = quadbin_index_to_string(cell); + if (!s) return 0u; + uint32_t len = (uint32_t)strlen(s); + if (len > bufMax) len = bufMax; + memcpy(buf, s, len); + free(s); + return len; + } catch (const std::exception&) { return 0u; } + }, + x, y, z, outBuf.getContent(), nautilus::val(MAX_LEN)); + + VarVal(actualLen).writeToMemory(outBuf.getReference()); + return outBuf; +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterQuadbinTileToCellPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "QuadbinTileToCellPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + return QuadbinTileToCellPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2])); +} + +} // namespace NES diff --git a/nes-sql-parser/AntlrSQL.g4 b/nes-sql-parser/AntlrSQL.g4 index a6a2b4b706..425bef310c 100644 --- a/nes-sql-parser/AntlrSQL.g4 +++ b/nes-sql-parser/AntlrSQL.g4 @@ -295,7 +295,7 @@ timeUnit: MS timestampParameter: name=identifier; -functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT | TGE_TTEXT_TEXT | TGE_TEXT_TTEXT | TGT_TTEXT_TEXT | TGT_TEXT_TTEXT | TLE_TTEXT_TEXT | TLE_TEXT_TTEXT | TLT_TTEXT_TEXT | TLT_TEXT_TTEXT | TTEXT_UPPER | TTEXT_LOWER | TTEXT_INITCAP | TEXTCAT_TTEXT_TEXT | TEXTCAT_TEXT_TTEXT | TEXTCAT_TTEXT_TTEXT | GEOM_LENGTH | GEOM_PERIMETER | GEOM_AZIMUTH | GEOG_AREA | GEOG_LENGTH | GEOG_PERIMETER | GEOM_IS_EMPTY | AINTERSECTS_TGEO_GEO | ACOVERS_TGEO_GEO | ADISJOINT_TGEO_GEO | ADWITHIN_TGEO_GEO | EINTERSECTS_TGEO_GEO | ETOUCHES_TGEO_GEO | ECONTAINS_TGEO_GEO | ACONTAINS_TGEO_GEO | ATOUCHES_TGEO_GEO | GEO_NUM_POINTS | GEO_NUM_GEOS | GEO_SRID | GEO_IS_UNITARY | GEO_EQUALS | GEO_SAME | GEOG_DISTANCE | NAD_TGEO_GEO | EVER_EQ_TGEO_GEO | EVER_NE_TGEO_GEO | ALWAYS_EQ_TGEO_GEO | ALWAYS_NE_TGEO_GEO | GEOG_INTERSECTS | GEOG_DWITHIN | ACOVERS_GEO_TGEO | GEOM_INTERSECTS | GEOM_DWITHIN | H3_GS_POINT_TO_CELL | EVER_EQ_TH3INDEX_H3INDEX | EVER_NE_TH3INDEX_H3INDEX | ALWAYS_EQ_TH3INDEX_H3INDEX | ALWAYS_NE_TH3INDEX_H3INDEX | TH3INDEX_GET_RESOLUTION | TH3INDEX_GET_BASE_CELL_NUMBER | TH3INDEX_IS_VALID_CELL | TH3INDEX_IS_PENTAGON | TH3INDEX_CELL_TO_PARENT_NEXT | TH3INDEX_CELL_TO_CENTER_CHILD_NEXT | TH3INDEX_CELL_TO_PARENT | TH3INDEX_CELL_TO_CENTER_CHILD | TH3INDEX_CELL_TO_CHILD_POS | TH3INDEX_ARE_NEIGHBOR_CELLS | TH3INDEX_GRID_DISTANCE | EINTERSECTS_TCBUFFER_GEO | AINTERSECTS_TCBUFFER_GEO | ECOVERS_TCBUFFER_GEO | ACOVERS_TCBUFFER_GEO | EDISJOINT_TCBUFFER_GEO | ADISJOINT_TCBUFFER_GEO | ETOUCHES_TCBUFFER_GEO | ATOUCHES_TCBUFFER_GEO | ECONTAINS_TCBUFFER_GEO | ACONTAINS_TCBUFFER_GEO | NAD_TCBUFFER_GEO | EDWITHIN_TCBUFFER_GEO | ADWITHIN_TCBUFFER_GEO | EINTERSECTS_TCBUFFER_CBUFFER | AINTERSECTS_TCBUFFER_CBUFFER | ECOVERS_TCBUFFER_CBUFFER | ACOVERS_TCBUFFER_CBUFFER | EDISJOINT_TCBUFFER_CBUFFER | ADISJOINT_TCBUFFER_CBUFFER | ETOUCHES_TCBUFFER_CBUFFER | ATOUCHES_TCBUFFER_CBUFFER | ECONTAINS_TCBUFFER_CBUFFER | ACONTAINS_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_CBUFFER | ALWAYS_EQ_TCBUFFER_CBUFFER | EVER_NE_TCBUFFER_CBUFFER | ALWAYS_NE_TCBUFFER_CBUFFER | NAD_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_TCBUFFER | ALWAYS_EQ_TCBUFFER_TCBUFFER | EVER_NE_TCBUFFER_TCBUFFER | ALWAYS_NE_TCBUFFER_TCBUFFER | EINTERSECTS_TCBUFFER_TCBUFFER | AINTERSECTS_TCBUFFER_TCBUFFER | ECOVERS_TCBUFFER_TCBUFFER | ACOVERS_TCBUFFER_TCBUFFER | ADISJOINT_TCBUFFER_TCBUFFER | ETOUCHES_TCBUFFER_TCBUFFER | ATOUCHES_TCBUFFER_TCBUFFER | NAD_TCBUFFER_TCBUFFER | EDWITHIN_TCBUFFER_TCBUFFER | ADWITHIN_TCBUFFER_TCBUFFER | MINDISTANCE_TCBUFFER_TCBUFFER | NAD_TNPOINT_GEO | EVER_EQ_TNPOINT_NPOINT | ALWAYS_EQ_TNPOINT_NPOINT | EVER_NE_TNPOINT_NPOINT | ALWAYS_NE_TNPOINT_NPOINT | NAD_TNPOINT_NPOINT | EVER_EQ_NPOINT_TNPOINT | ALWAYS_EQ_NPOINT_TNPOINT | EVER_NE_NPOINT_TNPOINT | ALWAYS_NE_NPOINT_TNPOINT | EVER_EQ_TNPOINT_TNPOINT | ALWAYS_EQ_TNPOINT_TNPOINT | EVER_NE_TNPOINT_TNPOINT | ALWAYS_NE_TNPOINT_TNPOINT | NAD_TNPOINT_TNPOINT | NAD_TPOSE_GEO | EVER_EQ_TPOSE_POSE | ALWAYS_EQ_TPOSE_POSE | EVER_NE_TPOSE_POSE | ALWAYS_NE_TPOSE_POSE | NAD_TPOSE_POSE | EVER_EQ_POSE_TPOSE | ALWAYS_EQ_POSE_TPOSE | EVER_NE_POSE_TPOSE | ALWAYS_NE_POSE_TPOSE | EVER_EQ_TPOSE_TPOSE | ALWAYS_EQ_TPOSE_TPOSE | EVER_NE_TPOSE_TPOSE | ALWAYS_NE_TPOSE_TPOSE | NAD_TPOSE_TPOSE | EVER_EQ_TRGEOMETRY_GEO | ALWAYS_EQ_TRGEOMETRY_GEO | EVER_NE_TRGEOMETRY_GEO | ALWAYS_NE_TRGEOMETRY_GEO | NAD_TRGEOMETRY_GEO | EVER_EQ_GEO_TRGEOMETRY | ALWAYS_EQ_GEO_TRGEOMETRY | EVER_NE_GEO_TRGEOMETRY | ALWAYS_NE_GEO_TRGEOMETRY | EVER_EQ_TRGEOMETRY_TRGEOMETRY | ALWAYS_EQ_TRGEOMETRY_TRGEOMETRY | EVER_NE_TRGEOMETRY_TRGEOMETRY | ALWAYS_NE_TRGEOMETRY_TRGEOMETRY | NAD_TRGEOMETRY_TRGEOMETRY | EINTERSECTS_TPCPOINT_GEO | NAD_TPCPOINT_GEO | GEOM_INTERSECTS2D | GEOM_DWITHIN2D | GEOM_CONTAINS | GEOM_DISJOINT2D | GEOM_COVERS | GEOM_TOUCHES | GEOM_INTERSECTS3D | GEOM_DWITHIN3D | GEOM_DISTANCE2D | GEOM_DISTANCE3D; +functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT | TGE_TTEXT_TEXT | TGE_TEXT_TTEXT | TGT_TTEXT_TEXT | TGT_TEXT_TTEXT | TLE_TTEXT_TEXT | TLE_TEXT_TTEXT | TLT_TTEXT_TEXT | TLT_TEXT_TTEXT | TTEXT_UPPER | TTEXT_LOWER | TTEXT_INITCAP | TEXTCAT_TTEXT_TEXT | TEXTCAT_TEXT_TTEXT | TEXTCAT_TTEXT_TTEXT | GEOM_LENGTH | GEOM_PERIMETER | GEOM_AZIMUTH | GEOG_AREA | GEOG_LENGTH | GEOG_PERIMETER | GEOM_IS_EMPTY | AINTERSECTS_TGEO_GEO | ACOVERS_TGEO_GEO | ADISJOINT_TGEO_GEO | ADWITHIN_TGEO_GEO | EINTERSECTS_TGEO_GEO | ETOUCHES_TGEO_GEO | ECONTAINS_TGEO_GEO | ACONTAINS_TGEO_GEO | ATOUCHES_TGEO_GEO | GEO_NUM_POINTS | GEO_NUM_GEOS | GEO_SRID | GEO_IS_UNITARY | GEO_EQUALS | GEO_SAME | GEOG_DISTANCE | NAD_TGEO_GEO | EVER_EQ_TGEO_GEO | EVER_NE_TGEO_GEO | ALWAYS_EQ_TGEO_GEO | ALWAYS_NE_TGEO_GEO | GEOG_INTERSECTS | GEOG_DWITHIN | ACOVERS_GEO_TGEO | GEOM_INTERSECTS | GEOM_DWITHIN | H3_GS_POINT_TO_CELL | EVER_EQ_TH3INDEX_H3INDEX | EVER_NE_TH3INDEX_H3INDEX | ALWAYS_EQ_TH3INDEX_H3INDEX | ALWAYS_NE_TH3INDEX_H3INDEX | TH3INDEX_GET_RESOLUTION | TH3INDEX_GET_BASE_CELL_NUMBER | TH3INDEX_IS_VALID_CELL | TH3INDEX_IS_PENTAGON | TH3INDEX_CELL_TO_PARENT_NEXT | TH3INDEX_CELL_TO_CENTER_CHILD_NEXT | TH3INDEX_CELL_TO_PARENT | TH3INDEX_CELL_TO_CENTER_CHILD | TH3INDEX_CELL_TO_CHILD_POS | TH3INDEX_ARE_NEIGHBOR_CELLS | TH3INDEX_GRID_DISTANCE | EINTERSECTS_TCBUFFER_GEO | AINTERSECTS_TCBUFFER_GEO | ECOVERS_TCBUFFER_GEO | ACOVERS_TCBUFFER_GEO | EDISJOINT_TCBUFFER_GEO | ADISJOINT_TCBUFFER_GEO | ETOUCHES_TCBUFFER_GEO | ATOUCHES_TCBUFFER_GEO | ECONTAINS_TCBUFFER_GEO | ACONTAINS_TCBUFFER_GEO | NAD_TCBUFFER_GEO | EDWITHIN_TCBUFFER_GEO | ADWITHIN_TCBUFFER_GEO | EINTERSECTS_TCBUFFER_CBUFFER | AINTERSECTS_TCBUFFER_CBUFFER | ECOVERS_TCBUFFER_CBUFFER | ACOVERS_TCBUFFER_CBUFFER | EDISJOINT_TCBUFFER_CBUFFER | ADISJOINT_TCBUFFER_CBUFFER | ETOUCHES_TCBUFFER_CBUFFER | ATOUCHES_TCBUFFER_CBUFFER | ECONTAINS_TCBUFFER_CBUFFER | ACONTAINS_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_CBUFFER | ALWAYS_EQ_TCBUFFER_CBUFFER | EVER_NE_TCBUFFER_CBUFFER | ALWAYS_NE_TCBUFFER_CBUFFER | NAD_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_TCBUFFER | ALWAYS_EQ_TCBUFFER_TCBUFFER | EVER_NE_TCBUFFER_TCBUFFER | ALWAYS_NE_TCBUFFER_TCBUFFER | EINTERSECTS_TCBUFFER_TCBUFFER | AINTERSECTS_TCBUFFER_TCBUFFER | ECOVERS_TCBUFFER_TCBUFFER | ACOVERS_TCBUFFER_TCBUFFER | ADISJOINT_TCBUFFER_TCBUFFER | ETOUCHES_TCBUFFER_TCBUFFER | ATOUCHES_TCBUFFER_TCBUFFER | NAD_TCBUFFER_TCBUFFER | EDWITHIN_TCBUFFER_TCBUFFER | ADWITHIN_TCBUFFER_TCBUFFER | MINDISTANCE_TCBUFFER_TCBUFFER | NAD_TNPOINT_GEO | EVER_EQ_TNPOINT_NPOINT | ALWAYS_EQ_TNPOINT_NPOINT | EVER_NE_TNPOINT_NPOINT | ALWAYS_NE_TNPOINT_NPOINT | NAD_TNPOINT_NPOINT | EVER_EQ_NPOINT_TNPOINT | ALWAYS_EQ_NPOINT_TNPOINT | EVER_NE_NPOINT_TNPOINT | ALWAYS_NE_NPOINT_TNPOINT | EVER_EQ_TNPOINT_TNPOINT | ALWAYS_EQ_TNPOINT_TNPOINT | EVER_NE_TNPOINT_TNPOINT | ALWAYS_NE_TNPOINT_TNPOINT | NAD_TNPOINT_TNPOINT | NAD_TPOSE_GEO | EVER_EQ_TPOSE_POSE | ALWAYS_EQ_TPOSE_POSE | EVER_NE_TPOSE_POSE | ALWAYS_NE_TPOSE_POSE | NAD_TPOSE_POSE | EVER_EQ_POSE_TPOSE | ALWAYS_EQ_POSE_TPOSE | EVER_NE_POSE_TPOSE | ALWAYS_NE_POSE_TPOSE | EVER_EQ_TPOSE_TPOSE | ALWAYS_EQ_TPOSE_TPOSE | EVER_NE_TPOSE_TPOSE | ALWAYS_NE_TPOSE_TPOSE | NAD_TPOSE_TPOSE | EVER_EQ_TRGEOMETRY_GEO | ALWAYS_EQ_TRGEOMETRY_GEO | EVER_NE_TRGEOMETRY_GEO | ALWAYS_NE_TRGEOMETRY_GEO | NAD_TRGEOMETRY_GEO | EVER_EQ_GEO_TRGEOMETRY | ALWAYS_EQ_GEO_TRGEOMETRY | EVER_NE_GEO_TRGEOMETRY | ALWAYS_NE_GEO_TRGEOMETRY | EVER_EQ_TRGEOMETRY_TRGEOMETRY | ALWAYS_EQ_TRGEOMETRY_TRGEOMETRY | EVER_NE_TRGEOMETRY_TRGEOMETRY | ALWAYS_NE_TRGEOMETRY_TRGEOMETRY | NAD_TRGEOMETRY_TRGEOMETRY | EINTERSECTS_TPCPOINT_GEO | NAD_TPCPOINT_GEO | QUADBIN_POINT_TO_CELL | QUADBIN_IS_VALID_CELL | QUADBIN_GET_RESOLUTION | QUADBIN_CELL_AREA | QUADBIN_CELL_TO_QUADKEY | QUADBIN_CELL_TO_PARENT | QUADBIN_TILE_TO_CELL | GEOM_INTERSECTS2D | GEOM_DWITHIN2D | GEOM_CONTAINS | GEOM_DISJOINT2D | GEOM_COVERS | GEOM_TOUCHES | GEOM_INTERSECTS3D | GEOM_DWITHIN3D | GEOM_DISTANCE2D | GEOM_DISTANCE3D; sinkClause: INTO sink (',' sink)*; @@ -896,6 +896,13 @@ ALWAYS_NE_TRGEOMETRY_TRGEOMETRY: 'ALWAYS_NE_TRGEOMETRY_TRGEOMETRY' | 'always_ne_ NAD_TRGEOMETRY_TRGEOMETRY: 'NAD_TRGEOMETRY_TRGEOMETRY' | 'nad_trgeometry_trgeometry'; EINTERSECTS_TPCPOINT_GEO: 'EINTERSECTS_TPCPOINT_GEO' | 'eintersects_tpcpoint_geo'; NAD_TPCPOINT_GEO: 'NAD_TPCPOINT_GEO' | 'nad_tpcpoint_geo'; +QUADBIN_POINT_TO_CELL: 'QUADBIN_POINT_TO_CELL' | 'quadbin_point_to_cell'; +QUADBIN_IS_VALID_CELL: 'QUADBIN_IS_VALID_CELL' | 'quadbin_is_valid_cell'; +QUADBIN_GET_RESOLUTION: 'QUADBIN_GET_RESOLUTION' | 'quadbin_get_resolution'; +QUADBIN_CELL_AREA: 'QUADBIN_CELL_AREA' | 'quadbin_cell_area'; +QUADBIN_CELL_TO_QUADKEY: 'QUADBIN_CELL_TO_QUADKEY' | 'quadbin_cell_to_quadkey'; +QUADBIN_CELL_TO_PARENT: 'QUADBIN_CELL_TO_PARENT' | 'quadbin_cell_to_parent'; +QUADBIN_TILE_TO_CELL: 'QUADBIN_TILE_TO_CELL' | 'quadbin_tile_to_cell'; GEOM_INTERSECTS2D: 'GEOM_INTERSECTS2D' | 'geom_intersects2d'; GEOM_DWITHIN2D: 'GEOM_DWITHIN2D' | 'geom_dwithin2d'; GEOM_CONTAINS: 'GEOM_CONTAINS' | 'geom_contains'; diff --git a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp index a4ff2c77c5..e3a420f69d 100644 --- a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp +++ b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp @@ -477,6 +477,13 @@ #include #include #include +#include +#include +#include +#include +#include +#include +#include #include #include #include @@ -10598,6 +10605,67 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont return LogicalFunction(NadTpcpointGeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2))); } /* END CODEGEN PARSER GLUE: NAD_TPCPOINT_GEO */ + case AntlrSQLParser::QUADBIN_POINT_TO_CELL: { + PRECONDITION(ctx->functionParam().size() == 3, + "QuadbinPointToCell requires 3 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + return LogicalFunction(QuadbinPointToCellLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2))); + } + /* END CODEGEN PARSER GLUE: QUADBIN_POINT_TO_CELL */ + case AntlrSQLParser::QUADBIN_IS_VALID_CELL: { + PRECONDITION(ctx->functionParam().size() == 1, + "QuadbinIsValidCell requires 1 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + return LogicalFunction(QuadbinIsValidCellLogicalFunction(std::move(arg0))); + } + /* END CODEGEN PARSER GLUE: QUADBIN_IS_VALID_CELL */ + case AntlrSQLParser::QUADBIN_GET_RESOLUTION: { + PRECONDITION(ctx->functionParam().size() == 1, + "QuadbinGetResolution requires 1 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + return LogicalFunction(QuadbinGetResolutionLogicalFunction(std::move(arg0))); + } + /* END CODEGEN PARSER GLUE: QUADBIN_GET_RESOLUTION */ + case AntlrSQLParser::QUADBIN_CELL_AREA: { + PRECONDITION(ctx->functionParam().size() == 1, + "QuadbinCellArea requires 1 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + return LogicalFunction(QuadbinCellAreaLogicalFunction(std::move(arg0))); + } + /* END CODEGEN PARSER GLUE: QUADBIN_CELL_AREA */ + case AntlrSQLParser::QUADBIN_CELL_TO_QUADKEY: { + PRECONDITION(ctx->functionParam().size() == 1, + "QuadbinCellToQuadkey requires 1 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + return LogicalFunction(QuadbinCellToQuadkeyLogicalFunction(std::move(arg0))); + } + /* END CODEGEN PARSER GLUE: QUADBIN_CELL_TO_QUADKEY */ + case AntlrSQLParser::QUADBIN_CELL_TO_PARENT: { + PRECONDITION(ctx->functionParam().size() == 2, + "QuadbinCellToParent requires 2 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + return LogicalFunction(QuadbinCellToParentLogicalFunction(std::move(arg0), std::move(arg1))); + } + /* END CODEGEN PARSER GLUE: QUADBIN_CELL_TO_PARENT */ + case AntlrSQLParser::QUADBIN_TILE_TO_CELL: { + PRECONDITION(ctx->functionParam().size() == 3, + "QuadbinTileToCell requires 3 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + return LogicalFunction(QuadbinTileToCellLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2))); + } + /* END CODEGEN PARSER GLUE: QUADBIN_TILE_TO_CELL */ /* END CODEGEN PARSER GLUE: GEOM_INTERSECTS2D */ case AntlrSQLParser::GEOM_DWITHIN2D: { PRECONDITION(ctx->functionParam().size() == 3, From 29a32f994c63992a0d96367f73fdf07762cc4f3b Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Mon, 15 Jun 2026 17:44:07 +0200 Subject: [PATCH 74/96] feat(meos): add TJSONB_JSONB per-event comparison NES operators (W126) 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). --- .../AlwaysEqTjsonbJsonbLogicalFunction.hpp | 48 +++++++++ .../AlwaysNeTjsonbJsonbLogicalFunction.hpp | 48 +++++++++ .../Meos/EverEqTjsonbJsonbLogicalFunction.hpp | 48 +++++++++ .../Meos/EverNeTjsonbJsonbLogicalFunction.hpp | 48 +++++++++ .../AlwaysEqTjsonbJsonbLogicalFunction.cpp | 102 ++++++++++++++++++ .../AlwaysNeTjsonbJsonbLogicalFunction.cpp | 102 ++++++++++++++++++ .../src/Functions/Meos/CMakeLists.txt | 4 + .../Meos/EverEqTjsonbJsonbLogicalFunction.cpp | 102 ++++++++++++++++++ .../Meos/EverNeTjsonbJsonbLogicalFunction.cpp | 102 ++++++++++++++++++ .../AlwaysEqTjsonbJsonbPhysicalFunction.hpp | 32 ++++++ .../AlwaysNeTjsonbJsonbPhysicalFunction.hpp | 32 ++++++ .../EverEqTjsonbJsonbPhysicalFunction.hpp | 32 ++++++ .../EverNeTjsonbJsonbPhysicalFunction.hpp | 32 ++++++ .../AlwaysEqTjsonbJsonbPhysicalFunction.cpp | 85 +++++++++++++++ .../AlwaysNeTjsonbJsonbPhysicalFunction.cpp | 85 +++++++++++++++ .../src/Functions/Meos/CMakeLists.txt | 4 + .../EverEqTjsonbJsonbPhysicalFunction.cpp | 85 +++++++++++++++ .../EverNeTjsonbJsonbPhysicalFunction.cpp | 85 +++++++++++++++ nes-sql-parser/AntlrSQL.g4 | 6 +- .../src/AntlrSQLQueryPlanCreator.cpp | 44 ++++++++ 20 files changed, 1125 insertions(+), 1 deletion(-) create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysEqTjsonbJsonbLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysNeTjsonbJsonbLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverEqTjsonbJsonbLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverNeTjsonbJsonbLogicalFunction.hpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysEqTjsonbJsonbLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysNeTjsonbJsonbLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverEqTjsonbJsonbLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverNeTjsonbJsonbLogicalFunction.cpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysEqTjsonbJsonbPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysNeTjsonbJsonbPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverEqTjsonbJsonbPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverNeTjsonbJsonbPhysicalFunction.hpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysEqTjsonbJsonbPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysNeTjsonbJsonbPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverEqTjsonbJsonbPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverNeTjsonbJsonbPhysicalFunction.cpp diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysEqTjsonbJsonbLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysEqTjsonbJsonbLogicalFunction.hpp new file mode 100644 index 0000000000..e0427b9aba --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysEqTjsonbJsonbLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if the tjsonb instant value always equals the target Jsonb. + */ +class AlwaysEqTjsonbJsonbLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysEqTjsonbJsonb"; + + AlwaysEqTjsonbJsonbLogicalFunction(LogicalFunction json_str, LogicalFunction ts, LogicalFunction target_json); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysNeTjsonbJsonbLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysNeTjsonbJsonbLogicalFunction.hpp new file mode 100644 index 0000000000..05e7c81966 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysNeTjsonbJsonbLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if the tjsonb instant value always differs from the target Jsonb. + */ +class AlwaysNeTjsonbJsonbLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysNeTjsonbJsonb"; + + AlwaysNeTjsonbJsonbLogicalFunction(LogicalFunction json_str, LogicalFunction ts, LogicalFunction target_json); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverEqTjsonbJsonbLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverEqTjsonbJsonbLogicalFunction.hpp new file mode 100644 index 0000000000..aa53d1b34d --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverEqTjsonbJsonbLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if the tjsonb instant value ever equals the target Jsonb. + */ +class EverEqTjsonbJsonbLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverEqTjsonbJsonb"; + + EverEqTjsonbJsonbLogicalFunction(LogicalFunction json_str, LogicalFunction ts, LogicalFunction target_json); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverNeTjsonbJsonbLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverNeTjsonbJsonbLogicalFunction.hpp new file mode 100644 index 0000000000..ed1cfd83af --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverNeTjsonbJsonbLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if the tjsonb instant value ever differs from the target Jsonb. + */ +class EverNeTjsonbJsonbLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverNeTjsonbJsonb"; + + EverNeTjsonbJsonbLogicalFunction(LogicalFunction json_str, LogicalFunction ts, LogicalFunction target_json); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysEqTjsonbJsonbLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysEqTjsonbJsonbLogicalFunction.cpp new file mode 100644 index 0000000000..e842930882 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysEqTjsonbJsonbLogicalFunction.cpp @@ -0,0 +1,102 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AlwaysEqTjsonbJsonbLogicalFunction::AlwaysEqTjsonbJsonbLogicalFunction(LogicalFunction json_str, LogicalFunction ts, LogicalFunction target_json) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(json_str)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(target_json)); +} + +DataType AlwaysEqTjsonbJsonbLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysEqTjsonbJsonbLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AlwaysEqTjsonbJsonbLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysEqTjsonbJsonbLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, + "AlwaysEqTjsonbJsonbLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AlwaysEqTjsonbJsonbLogicalFunction::getType() const { return NAME; } + +bool AlwaysEqTjsonbJsonbLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AlwaysEqTjsonbJsonbLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction AlwaysEqTjsonbJsonbLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(3); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "json_str must be VARSIZED"); + INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::VARSIZED), "target_json must be VARSIZED"); + return withChildren(c); +} + +SerializableFunction AlwaysEqTjsonbJsonbLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysEqTjsonbJsonbLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "AlwaysEqTjsonbJsonbLogicalFunction requires 3 children but got {}", + arguments.children.size()); + return AlwaysEqTjsonbJsonbLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysNeTjsonbJsonbLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysNeTjsonbJsonbLogicalFunction.cpp new file mode 100644 index 0000000000..7d06e82ecc --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysNeTjsonbJsonbLogicalFunction.cpp @@ -0,0 +1,102 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AlwaysNeTjsonbJsonbLogicalFunction::AlwaysNeTjsonbJsonbLogicalFunction(LogicalFunction json_str, LogicalFunction ts, LogicalFunction target_json) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(json_str)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(target_json)); +} + +DataType AlwaysNeTjsonbJsonbLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysNeTjsonbJsonbLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AlwaysNeTjsonbJsonbLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysNeTjsonbJsonbLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, + "AlwaysNeTjsonbJsonbLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AlwaysNeTjsonbJsonbLogicalFunction::getType() const { return NAME; } + +bool AlwaysNeTjsonbJsonbLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AlwaysNeTjsonbJsonbLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction AlwaysNeTjsonbJsonbLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(3); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "json_str must be VARSIZED"); + INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::VARSIZED), "target_json must be VARSIZED"); + return withChildren(c); +} + +SerializableFunction AlwaysNeTjsonbJsonbLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysNeTjsonbJsonbLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "AlwaysNeTjsonbJsonbLogicalFunction requires 3 children but got {}", + arguments.children.size()); + return AlwaysNeTjsonbJsonbLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt index 8b81ca36ca..77b24cdd84 100644 --- a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt @@ -433,6 +433,10 @@ add_plugin(QuadbinCellArea LogicalFunction nes-logical-operators QuadbinCellArea add_plugin(QuadbinCellToQuadkey LogicalFunction nes-logical-operators QuadbinCellToQuadkeyLogicalFunction.cpp) add_plugin(QuadbinCellToParent LogicalFunction nes-logical-operators QuadbinCellToParentLogicalFunction.cpp) add_plugin(QuadbinTileToCell LogicalFunction nes-logical-operators QuadbinTileToCellLogicalFunction.cpp) +add_plugin(EverEqTjsonbJsonb LogicalFunction nes-logical-operators EverEqTjsonbJsonbLogicalFunction.cpp) +add_plugin(AlwaysEqTjsonbJsonb LogicalFunction nes-logical-operators AlwaysEqTjsonbJsonbLogicalFunction.cpp) +add_plugin(EverNeTjsonbJsonb LogicalFunction nes-logical-operators EverNeTjsonbJsonbLogicalFunction.cpp) +add_plugin(AlwaysNeTjsonbJsonb LogicalFunction nes-logical-operators AlwaysNeTjsonbJsonbLogicalFunction.cpp) add_plugin(GeomIntersects2d LogicalFunction nes-logical-operators GeomIntersects2dLogicalFunction.cpp) add_plugin(GeomDwithin2d LogicalFunction nes-logical-operators GeomDwithin2dLogicalFunction.cpp) add_plugin(GeomContains LogicalFunction nes-logical-operators GeomContainsLogicalFunction.cpp) diff --git a/nes-logical-operators/src/Functions/Meos/EverEqTjsonbJsonbLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverEqTjsonbJsonbLogicalFunction.cpp new file mode 100644 index 0000000000..9afc80111a --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverEqTjsonbJsonbLogicalFunction.cpp @@ -0,0 +1,102 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EverEqTjsonbJsonbLogicalFunction::EverEqTjsonbJsonbLogicalFunction(LogicalFunction json_str, LogicalFunction ts, LogicalFunction target_json) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(json_str)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(target_json)); +} + +DataType EverEqTjsonbJsonbLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverEqTjsonbJsonbLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EverEqTjsonbJsonbLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverEqTjsonbJsonbLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, + "EverEqTjsonbJsonbLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EverEqTjsonbJsonbLogicalFunction::getType() const { return NAME; } + +bool EverEqTjsonbJsonbLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EverEqTjsonbJsonbLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction EverEqTjsonbJsonbLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(3); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "json_str must be VARSIZED"); + INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::VARSIZED), "target_json must be VARSIZED"); + return withChildren(c); +} + +SerializableFunction EverEqTjsonbJsonbLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverEqTjsonbJsonbLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "EverEqTjsonbJsonbLogicalFunction requires 3 children but got {}", + arguments.children.size()); + return EverEqTjsonbJsonbLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverNeTjsonbJsonbLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverNeTjsonbJsonbLogicalFunction.cpp new file mode 100644 index 0000000000..fc161c6f65 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverNeTjsonbJsonbLogicalFunction.cpp @@ -0,0 +1,102 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EverNeTjsonbJsonbLogicalFunction::EverNeTjsonbJsonbLogicalFunction(LogicalFunction json_str, LogicalFunction ts, LogicalFunction target_json) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(json_str)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(target_json)); +} + +DataType EverNeTjsonbJsonbLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverNeTjsonbJsonbLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EverNeTjsonbJsonbLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverNeTjsonbJsonbLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, + "EverNeTjsonbJsonbLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EverNeTjsonbJsonbLogicalFunction::getType() const { return NAME; } + +bool EverNeTjsonbJsonbLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EverNeTjsonbJsonbLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction EverNeTjsonbJsonbLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(3); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "json_str must be VARSIZED"); + INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::VARSIZED), "target_json must be VARSIZED"); + return withChildren(c); +} + +SerializableFunction EverNeTjsonbJsonbLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverNeTjsonbJsonbLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "EverNeTjsonbJsonbLogicalFunction requires 3 children but got {}", + arguments.children.size()); + return EverNeTjsonbJsonbLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2])); +} + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysEqTjsonbJsonbPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysEqTjsonbJsonbPhysicalFunction.hpp new file mode 100644 index 0000000000..873bdd2b06 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysEqTjsonbJsonbPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class AlwaysEqTjsonbJsonbPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysEqTjsonbJsonbPhysicalFunction(PhysicalFunction json_str, PhysicalFunction ts, PhysicalFunction target_json); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysNeTjsonbJsonbPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysNeTjsonbJsonbPhysicalFunction.hpp new file mode 100644 index 0000000000..87c19495c7 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysNeTjsonbJsonbPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class AlwaysNeTjsonbJsonbPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysNeTjsonbJsonbPhysicalFunction(PhysicalFunction json_str, PhysicalFunction ts, PhysicalFunction target_json); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverEqTjsonbJsonbPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverEqTjsonbJsonbPhysicalFunction.hpp new file mode 100644 index 0000000000..bc2a532a7e --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverEqTjsonbJsonbPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class EverEqTjsonbJsonbPhysicalFunction : public PhysicalFunctionConcept { +public: + EverEqTjsonbJsonbPhysicalFunction(PhysicalFunction json_str, PhysicalFunction ts, PhysicalFunction target_json); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverNeTjsonbJsonbPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverNeTjsonbJsonbPhysicalFunction.hpp new file mode 100644 index 0000000000..5dbb1e78b5 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverNeTjsonbJsonbPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class EverNeTjsonbJsonbPhysicalFunction : public PhysicalFunctionConcept { +public: + EverNeTjsonbJsonbPhysicalFunction(PhysicalFunction json_str, PhysicalFunction ts, PhysicalFunction target_json); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysEqTjsonbJsonbPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysEqTjsonbJsonbPhysicalFunction.cpp new file mode 100644 index 0000000000..df011191c4 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysEqTjsonbJsonbPhysicalFunction.cpp @@ -0,0 +1,85 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +AlwaysEqTjsonbJsonbPhysicalFunction::AlwaysEqTjsonbJsonbPhysicalFunction(PhysicalFunction json_str, PhysicalFunction ts, PhysicalFunction target_json) +{ + paramFns.reserve(3); + paramFns.push_back(std::move(json_str)); + paramFns.push_back(std::move(ts)); + paramFns.push_back(std::move(target_json)); +} + +VarVal AlwaysEqTjsonbJsonbPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto json_str = paramFns[0].execute(record, arena); + auto ts = paramFns[1].execute(record, arena).cast(); + auto target_json = paramFns[2].execute(record, arena); + const auto result = nautilus::invoke( + +[](const char* json_str, uint32_t json_len, uint64_t ts, const char* target_json, uint32_t target_len) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + char* s1 = (char*)malloc(json_len + 1); + memcpy(s1, json_str, json_len); s1[json_len] = '\0'; + Jsonb* jb = jsonb_in(s1); free(s1); + if (!jb) return 0.0; + TInstant* inst = tjsonbinst_make(jb, (TimestampTz)ts); + free(jb); + if (!inst) return 0.0; + char* s2 = (char*)malloc(target_len + 1); + memcpy(s2, target_json, target_len); s2[target_len] = '\0'; + Jsonb* target = jsonb_in(s2); free(s2); + if (!target) { free(inst); return 0.0; } + bool r = always_eq_tjsonb_jsonb((Temporal*)inst, target) > 0; + free(inst); free(target); + return r ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + json_str, ts, target_json); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysEqTjsonbJsonbPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "AlwaysEqTjsonbJsonbPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + return AlwaysEqTjsonbJsonbPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysNeTjsonbJsonbPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysNeTjsonbJsonbPhysicalFunction.cpp new file mode 100644 index 0000000000..c5cd9a5537 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysNeTjsonbJsonbPhysicalFunction.cpp @@ -0,0 +1,85 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +AlwaysNeTjsonbJsonbPhysicalFunction::AlwaysNeTjsonbJsonbPhysicalFunction(PhysicalFunction json_str, PhysicalFunction ts, PhysicalFunction target_json) +{ + paramFns.reserve(3); + paramFns.push_back(std::move(json_str)); + paramFns.push_back(std::move(ts)); + paramFns.push_back(std::move(target_json)); +} + +VarVal AlwaysNeTjsonbJsonbPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto json_str = paramFns[0].execute(record, arena); + auto ts = paramFns[1].execute(record, arena).cast(); + auto target_json = paramFns[2].execute(record, arena); + const auto result = nautilus::invoke( + +[](const char* json_str, uint32_t json_len, uint64_t ts, const char* target_json, uint32_t target_len) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + char* s1 = (char*)malloc(json_len + 1); + memcpy(s1, json_str, json_len); s1[json_len] = '\0'; + Jsonb* jb = jsonb_in(s1); free(s1); + if (!jb) return 0.0; + TInstant* inst = tjsonbinst_make(jb, (TimestampTz)ts); + free(jb); + if (!inst) return 0.0; + char* s2 = (char*)malloc(target_len + 1); + memcpy(s2, target_json, target_len); s2[target_len] = '\0'; + Jsonb* target = jsonb_in(s2); free(s2); + if (!target) { free(inst); return 0.0; } + bool r = always_ne_tjsonb_jsonb((Temporal*)inst, target) > 0; + free(inst); free(target); + return r ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + json_str, ts, target_json); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysNeTjsonbJsonbPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "AlwaysNeTjsonbJsonbPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + return AlwaysNeTjsonbJsonbPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt index 53f465f9d5..c7e8fbba38 100644 --- a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt @@ -432,6 +432,10 @@ add_plugin(QuadbinCellArea PhysicalFunction nes-physical-operators QuadbinCellAr add_plugin(QuadbinCellToQuadkey PhysicalFunction nes-physical-operators QuadbinCellToQuadkeyPhysicalFunction.cpp) add_plugin(QuadbinCellToParent PhysicalFunction nes-physical-operators QuadbinCellToParentPhysicalFunction.cpp) add_plugin(QuadbinTileToCell PhysicalFunction nes-physical-operators QuadbinTileToCellPhysicalFunction.cpp) +add_plugin(EverEqTjsonbJsonb PhysicalFunction nes-physical-operators EverEqTjsonbJsonbPhysicalFunction.cpp) +add_plugin(AlwaysEqTjsonbJsonb PhysicalFunction nes-physical-operators AlwaysEqTjsonbJsonbPhysicalFunction.cpp) +add_plugin(EverNeTjsonbJsonb PhysicalFunction nes-physical-operators EverNeTjsonbJsonbPhysicalFunction.cpp) +add_plugin(AlwaysNeTjsonbJsonb PhysicalFunction nes-physical-operators AlwaysNeTjsonbJsonbPhysicalFunction.cpp) add_plugin(GeomIntersects2d PhysicalFunction nes-physical-operators GeomIntersects2dPhysicalFunction.cpp) add_plugin(GeomDwithin2d PhysicalFunction nes-physical-operators GeomDwithin2dPhysicalFunction.cpp) add_plugin(GeomContains PhysicalFunction nes-physical-operators GeomContainsPhysicalFunction.cpp) diff --git a/nes-physical-operators/src/Functions/Meos/EverEqTjsonbJsonbPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverEqTjsonbJsonbPhysicalFunction.cpp new file mode 100644 index 0000000000..92dea4c786 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverEqTjsonbJsonbPhysicalFunction.cpp @@ -0,0 +1,85 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +EverEqTjsonbJsonbPhysicalFunction::EverEqTjsonbJsonbPhysicalFunction(PhysicalFunction json_str, PhysicalFunction ts, PhysicalFunction target_json) +{ + paramFns.reserve(3); + paramFns.push_back(std::move(json_str)); + paramFns.push_back(std::move(ts)); + paramFns.push_back(std::move(target_json)); +} + +VarVal EverEqTjsonbJsonbPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto json_str = paramFns[0].execute(record, arena); + auto ts = paramFns[1].execute(record, arena).cast(); + auto target_json = paramFns[2].execute(record, arena); + const auto result = nautilus::invoke( + +[](const char* json_str, uint32_t json_len, uint64_t ts, const char* target_json, uint32_t target_len) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + char* s1 = (char*)malloc(json_len + 1); + memcpy(s1, json_str, json_len); s1[json_len] = '\0'; + Jsonb* jb = jsonb_in(s1); free(s1); + if (!jb) return 0.0; + TInstant* inst = tjsonbinst_make(jb, (TimestampTz)ts); + free(jb); + if (!inst) return 0.0; + char* s2 = (char*)malloc(target_len + 1); + memcpy(s2, target_json, target_len); s2[target_len] = '\0'; + Jsonb* target = jsonb_in(s2); free(s2); + if (!target) { free(inst); return 0.0; } + bool r = ever_eq_tjsonb_jsonb((Temporal*)inst, target) > 0; + free(inst); free(target); + return r ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + json_str, ts, target_json); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverEqTjsonbJsonbPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "EverEqTjsonbJsonbPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + return EverEqTjsonbJsonbPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverNeTjsonbJsonbPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverNeTjsonbJsonbPhysicalFunction.cpp new file mode 100644 index 0000000000..05e67e0377 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverNeTjsonbJsonbPhysicalFunction.cpp @@ -0,0 +1,85 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +EverNeTjsonbJsonbPhysicalFunction::EverNeTjsonbJsonbPhysicalFunction(PhysicalFunction json_str, PhysicalFunction ts, PhysicalFunction target_json) +{ + paramFns.reserve(3); + paramFns.push_back(std::move(json_str)); + paramFns.push_back(std::move(ts)); + paramFns.push_back(std::move(target_json)); +} + +VarVal EverNeTjsonbJsonbPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto json_str = paramFns[0].execute(record, arena); + auto ts = paramFns[1].execute(record, arena).cast(); + auto target_json = paramFns[2].execute(record, arena); + const auto result = nautilus::invoke( + +[](const char* json_str, uint32_t json_len, uint64_t ts, const char* target_json, uint32_t target_len) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + char* s1 = (char*)malloc(json_len + 1); + memcpy(s1, json_str, json_len); s1[json_len] = '\0'; + Jsonb* jb = jsonb_in(s1); free(s1); + if (!jb) return 0.0; + TInstant* inst = tjsonbinst_make(jb, (TimestampTz)ts); + free(jb); + if (!inst) return 0.0; + char* s2 = (char*)malloc(target_len + 1); + memcpy(s2, target_json, target_len); s2[target_len] = '\0'; + Jsonb* target = jsonb_in(s2); free(s2); + if (!target) { free(inst); return 0.0; } + bool r = ever_ne_tjsonb_jsonb((Temporal*)inst, target) > 0; + free(inst); free(target); + return r ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + json_str, ts, target_json); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverNeTjsonbJsonbPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "EverNeTjsonbJsonbPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + return EverNeTjsonbJsonbPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2])); +} + +} // namespace NES diff --git a/nes-sql-parser/AntlrSQL.g4 b/nes-sql-parser/AntlrSQL.g4 index 425bef310c..7ef694235c 100644 --- a/nes-sql-parser/AntlrSQL.g4 +++ b/nes-sql-parser/AntlrSQL.g4 @@ -295,7 +295,7 @@ timeUnit: MS timestampParameter: name=identifier; -functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT | TGE_TTEXT_TEXT | TGE_TEXT_TTEXT | TGT_TTEXT_TEXT | TGT_TEXT_TTEXT | TLE_TTEXT_TEXT | TLE_TEXT_TTEXT | TLT_TTEXT_TEXT | TLT_TEXT_TTEXT | TTEXT_UPPER | TTEXT_LOWER | TTEXT_INITCAP | TEXTCAT_TTEXT_TEXT | TEXTCAT_TEXT_TTEXT | TEXTCAT_TTEXT_TTEXT | GEOM_LENGTH | GEOM_PERIMETER | GEOM_AZIMUTH | GEOG_AREA | GEOG_LENGTH | GEOG_PERIMETER | GEOM_IS_EMPTY | AINTERSECTS_TGEO_GEO | ACOVERS_TGEO_GEO | ADISJOINT_TGEO_GEO | ADWITHIN_TGEO_GEO | EINTERSECTS_TGEO_GEO | ETOUCHES_TGEO_GEO | ECONTAINS_TGEO_GEO | ACONTAINS_TGEO_GEO | ATOUCHES_TGEO_GEO | GEO_NUM_POINTS | GEO_NUM_GEOS | GEO_SRID | GEO_IS_UNITARY | GEO_EQUALS | GEO_SAME | GEOG_DISTANCE | NAD_TGEO_GEO | EVER_EQ_TGEO_GEO | EVER_NE_TGEO_GEO | ALWAYS_EQ_TGEO_GEO | ALWAYS_NE_TGEO_GEO | GEOG_INTERSECTS | GEOG_DWITHIN | ACOVERS_GEO_TGEO | GEOM_INTERSECTS | GEOM_DWITHIN | H3_GS_POINT_TO_CELL | EVER_EQ_TH3INDEX_H3INDEX | EVER_NE_TH3INDEX_H3INDEX | ALWAYS_EQ_TH3INDEX_H3INDEX | ALWAYS_NE_TH3INDEX_H3INDEX | TH3INDEX_GET_RESOLUTION | TH3INDEX_GET_BASE_CELL_NUMBER | TH3INDEX_IS_VALID_CELL | TH3INDEX_IS_PENTAGON | TH3INDEX_CELL_TO_PARENT_NEXT | TH3INDEX_CELL_TO_CENTER_CHILD_NEXT | TH3INDEX_CELL_TO_PARENT | TH3INDEX_CELL_TO_CENTER_CHILD | TH3INDEX_CELL_TO_CHILD_POS | TH3INDEX_ARE_NEIGHBOR_CELLS | TH3INDEX_GRID_DISTANCE | EINTERSECTS_TCBUFFER_GEO | AINTERSECTS_TCBUFFER_GEO | ECOVERS_TCBUFFER_GEO | ACOVERS_TCBUFFER_GEO | EDISJOINT_TCBUFFER_GEO | ADISJOINT_TCBUFFER_GEO | ETOUCHES_TCBUFFER_GEO | ATOUCHES_TCBUFFER_GEO | ECONTAINS_TCBUFFER_GEO | ACONTAINS_TCBUFFER_GEO | NAD_TCBUFFER_GEO | EDWITHIN_TCBUFFER_GEO | ADWITHIN_TCBUFFER_GEO | EINTERSECTS_TCBUFFER_CBUFFER | AINTERSECTS_TCBUFFER_CBUFFER | ECOVERS_TCBUFFER_CBUFFER | ACOVERS_TCBUFFER_CBUFFER | EDISJOINT_TCBUFFER_CBUFFER | ADISJOINT_TCBUFFER_CBUFFER | ETOUCHES_TCBUFFER_CBUFFER | ATOUCHES_TCBUFFER_CBUFFER | ECONTAINS_TCBUFFER_CBUFFER | ACONTAINS_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_CBUFFER | ALWAYS_EQ_TCBUFFER_CBUFFER | EVER_NE_TCBUFFER_CBUFFER | ALWAYS_NE_TCBUFFER_CBUFFER | NAD_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_TCBUFFER | ALWAYS_EQ_TCBUFFER_TCBUFFER | EVER_NE_TCBUFFER_TCBUFFER | ALWAYS_NE_TCBUFFER_TCBUFFER | EINTERSECTS_TCBUFFER_TCBUFFER | AINTERSECTS_TCBUFFER_TCBUFFER | ECOVERS_TCBUFFER_TCBUFFER | ACOVERS_TCBUFFER_TCBUFFER | ADISJOINT_TCBUFFER_TCBUFFER | ETOUCHES_TCBUFFER_TCBUFFER | ATOUCHES_TCBUFFER_TCBUFFER | NAD_TCBUFFER_TCBUFFER | EDWITHIN_TCBUFFER_TCBUFFER | ADWITHIN_TCBUFFER_TCBUFFER | MINDISTANCE_TCBUFFER_TCBUFFER | NAD_TNPOINT_GEO | EVER_EQ_TNPOINT_NPOINT | ALWAYS_EQ_TNPOINT_NPOINT | EVER_NE_TNPOINT_NPOINT | ALWAYS_NE_TNPOINT_NPOINT | NAD_TNPOINT_NPOINT | EVER_EQ_NPOINT_TNPOINT | ALWAYS_EQ_NPOINT_TNPOINT | EVER_NE_NPOINT_TNPOINT | ALWAYS_NE_NPOINT_TNPOINT | EVER_EQ_TNPOINT_TNPOINT | ALWAYS_EQ_TNPOINT_TNPOINT | EVER_NE_TNPOINT_TNPOINT | ALWAYS_NE_TNPOINT_TNPOINT | NAD_TNPOINT_TNPOINT | NAD_TPOSE_GEO | EVER_EQ_TPOSE_POSE | ALWAYS_EQ_TPOSE_POSE | EVER_NE_TPOSE_POSE | ALWAYS_NE_TPOSE_POSE | NAD_TPOSE_POSE | EVER_EQ_POSE_TPOSE | ALWAYS_EQ_POSE_TPOSE | EVER_NE_POSE_TPOSE | ALWAYS_NE_POSE_TPOSE | EVER_EQ_TPOSE_TPOSE | ALWAYS_EQ_TPOSE_TPOSE | EVER_NE_TPOSE_TPOSE | ALWAYS_NE_TPOSE_TPOSE | NAD_TPOSE_TPOSE | EVER_EQ_TRGEOMETRY_GEO | ALWAYS_EQ_TRGEOMETRY_GEO | EVER_NE_TRGEOMETRY_GEO | ALWAYS_NE_TRGEOMETRY_GEO | NAD_TRGEOMETRY_GEO | EVER_EQ_GEO_TRGEOMETRY | ALWAYS_EQ_GEO_TRGEOMETRY | EVER_NE_GEO_TRGEOMETRY | ALWAYS_NE_GEO_TRGEOMETRY | EVER_EQ_TRGEOMETRY_TRGEOMETRY | ALWAYS_EQ_TRGEOMETRY_TRGEOMETRY | EVER_NE_TRGEOMETRY_TRGEOMETRY | ALWAYS_NE_TRGEOMETRY_TRGEOMETRY | NAD_TRGEOMETRY_TRGEOMETRY | EINTERSECTS_TPCPOINT_GEO | NAD_TPCPOINT_GEO | QUADBIN_POINT_TO_CELL | QUADBIN_IS_VALID_CELL | QUADBIN_GET_RESOLUTION | QUADBIN_CELL_AREA | QUADBIN_CELL_TO_QUADKEY | QUADBIN_CELL_TO_PARENT | QUADBIN_TILE_TO_CELL | GEOM_INTERSECTS2D | GEOM_DWITHIN2D | GEOM_CONTAINS | GEOM_DISJOINT2D | GEOM_COVERS | GEOM_TOUCHES | GEOM_INTERSECTS3D | GEOM_DWITHIN3D | GEOM_DISTANCE2D | GEOM_DISTANCE3D; +functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT | TGE_TTEXT_TEXT | TGE_TEXT_TTEXT | TGT_TTEXT_TEXT | TGT_TEXT_TTEXT | TLE_TTEXT_TEXT | TLE_TEXT_TTEXT | TLT_TTEXT_TEXT | TLT_TEXT_TTEXT | TTEXT_UPPER | TTEXT_LOWER | TTEXT_INITCAP | TEXTCAT_TTEXT_TEXT | TEXTCAT_TEXT_TTEXT | TEXTCAT_TTEXT_TTEXT | GEOM_LENGTH | GEOM_PERIMETER | GEOM_AZIMUTH | GEOG_AREA | GEOG_LENGTH | GEOG_PERIMETER | GEOM_IS_EMPTY | AINTERSECTS_TGEO_GEO | ACOVERS_TGEO_GEO | ADISJOINT_TGEO_GEO | ADWITHIN_TGEO_GEO | EINTERSECTS_TGEO_GEO | ETOUCHES_TGEO_GEO | ECONTAINS_TGEO_GEO | ACONTAINS_TGEO_GEO | ATOUCHES_TGEO_GEO | GEO_NUM_POINTS | GEO_NUM_GEOS | GEO_SRID | GEO_IS_UNITARY | GEO_EQUALS | GEO_SAME | GEOG_DISTANCE | NAD_TGEO_GEO | EVER_EQ_TGEO_GEO | EVER_NE_TGEO_GEO | ALWAYS_EQ_TGEO_GEO | ALWAYS_NE_TGEO_GEO | GEOG_INTERSECTS | GEOG_DWITHIN | ACOVERS_GEO_TGEO | GEOM_INTERSECTS | GEOM_DWITHIN | H3_GS_POINT_TO_CELL | EVER_EQ_TH3INDEX_H3INDEX | EVER_NE_TH3INDEX_H3INDEX | ALWAYS_EQ_TH3INDEX_H3INDEX | ALWAYS_NE_TH3INDEX_H3INDEX | TH3INDEX_GET_RESOLUTION | TH3INDEX_GET_BASE_CELL_NUMBER | TH3INDEX_IS_VALID_CELL | TH3INDEX_IS_PENTAGON | TH3INDEX_CELL_TO_PARENT_NEXT | TH3INDEX_CELL_TO_CENTER_CHILD_NEXT | TH3INDEX_CELL_TO_PARENT | TH3INDEX_CELL_TO_CENTER_CHILD | TH3INDEX_CELL_TO_CHILD_POS | TH3INDEX_ARE_NEIGHBOR_CELLS | TH3INDEX_GRID_DISTANCE | EINTERSECTS_TCBUFFER_GEO | AINTERSECTS_TCBUFFER_GEO | ECOVERS_TCBUFFER_GEO | ACOVERS_TCBUFFER_GEO | EDISJOINT_TCBUFFER_GEO | ADISJOINT_TCBUFFER_GEO | ETOUCHES_TCBUFFER_GEO | ATOUCHES_TCBUFFER_GEO | ECONTAINS_TCBUFFER_GEO | ACONTAINS_TCBUFFER_GEO | NAD_TCBUFFER_GEO | EDWITHIN_TCBUFFER_GEO | ADWITHIN_TCBUFFER_GEO | EINTERSECTS_TCBUFFER_CBUFFER | AINTERSECTS_TCBUFFER_CBUFFER | ECOVERS_TCBUFFER_CBUFFER | ACOVERS_TCBUFFER_CBUFFER | EDISJOINT_TCBUFFER_CBUFFER | ADISJOINT_TCBUFFER_CBUFFER | ETOUCHES_TCBUFFER_CBUFFER | ATOUCHES_TCBUFFER_CBUFFER | ECONTAINS_TCBUFFER_CBUFFER | ACONTAINS_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_CBUFFER | ALWAYS_EQ_TCBUFFER_CBUFFER | EVER_NE_TCBUFFER_CBUFFER | ALWAYS_NE_TCBUFFER_CBUFFER | NAD_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_TCBUFFER | ALWAYS_EQ_TCBUFFER_TCBUFFER | EVER_NE_TCBUFFER_TCBUFFER | ALWAYS_NE_TCBUFFER_TCBUFFER | EINTERSECTS_TCBUFFER_TCBUFFER | AINTERSECTS_TCBUFFER_TCBUFFER | ECOVERS_TCBUFFER_TCBUFFER | ACOVERS_TCBUFFER_TCBUFFER | ADISJOINT_TCBUFFER_TCBUFFER | ETOUCHES_TCBUFFER_TCBUFFER | ATOUCHES_TCBUFFER_TCBUFFER | NAD_TCBUFFER_TCBUFFER | EDWITHIN_TCBUFFER_TCBUFFER | ADWITHIN_TCBUFFER_TCBUFFER | MINDISTANCE_TCBUFFER_TCBUFFER | NAD_TNPOINT_GEO | EVER_EQ_TNPOINT_NPOINT | ALWAYS_EQ_TNPOINT_NPOINT | EVER_NE_TNPOINT_NPOINT | ALWAYS_NE_TNPOINT_NPOINT | NAD_TNPOINT_NPOINT | EVER_EQ_NPOINT_TNPOINT | ALWAYS_EQ_NPOINT_TNPOINT | EVER_NE_NPOINT_TNPOINT | ALWAYS_NE_NPOINT_TNPOINT | EVER_EQ_TNPOINT_TNPOINT | ALWAYS_EQ_TNPOINT_TNPOINT | EVER_NE_TNPOINT_TNPOINT | ALWAYS_NE_TNPOINT_TNPOINT | NAD_TNPOINT_TNPOINT | NAD_TPOSE_GEO | EVER_EQ_TPOSE_POSE | ALWAYS_EQ_TPOSE_POSE | EVER_NE_TPOSE_POSE | ALWAYS_NE_TPOSE_POSE | NAD_TPOSE_POSE | EVER_EQ_POSE_TPOSE | ALWAYS_EQ_POSE_TPOSE | EVER_NE_POSE_TPOSE | ALWAYS_NE_POSE_TPOSE | EVER_EQ_TPOSE_TPOSE | ALWAYS_EQ_TPOSE_TPOSE | EVER_NE_TPOSE_TPOSE | ALWAYS_NE_TPOSE_TPOSE | NAD_TPOSE_TPOSE | EVER_EQ_TRGEOMETRY_GEO | ALWAYS_EQ_TRGEOMETRY_GEO | EVER_NE_TRGEOMETRY_GEO | ALWAYS_NE_TRGEOMETRY_GEO | NAD_TRGEOMETRY_GEO | EVER_EQ_GEO_TRGEOMETRY | ALWAYS_EQ_GEO_TRGEOMETRY | EVER_NE_GEO_TRGEOMETRY | ALWAYS_NE_GEO_TRGEOMETRY | EVER_EQ_TRGEOMETRY_TRGEOMETRY | ALWAYS_EQ_TRGEOMETRY_TRGEOMETRY | EVER_NE_TRGEOMETRY_TRGEOMETRY | ALWAYS_NE_TRGEOMETRY_TRGEOMETRY | NAD_TRGEOMETRY_TRGEOMETRY | EINTERSECTS_TPCPOINT_GEO | NAD_TPCPOINT_GEO | QUADBIN_POINT_TO_CELL | QUADBIN_IS_VALID_CELL | QUADBIN_GET_RESOLUTION | QUADBIN_CELL_AREA | QUADBIN_CELL_TO_QUADKEY | QUADBIN_CELL_TO_PARENT | QUADBIN_TILE_TO_CELL | EVER_EQ_TJSONB_JSONB | ALWAYS_EQ_TJSONB_JSONB | EVER_NE_TJSONB_JSONB | ALWAYS_NE_TJSONB_JSONB | GEOM_INTERSECTS2D | GEOM_DWITHIN2D | GEOM_CONTAINS | GEOM_DISJOINT2D | GEOM_COVERS | GEOM_TOUCHES | GEOM_INTERSECTS3D | GEOM_DWITHIN3D | GEOM_DISTANCE2D | GEOM_DISTANCE3D; sinkClause: INTO sink (',' sink)*; @@ -903,6 +903,10 @@ QUADBIN_CELL_AREA: 'QUADBIN_CELL_AREA' | 'quadbin_cell_area'; QUADBIN_CELL_TO_QUADKEY: 'QUADBIN_CELL_TO_QUADKEY' | 'quadbin_cell_to_quadkey'; QUADBIN_CELL_TO_PARENT: 'QUADBIN_CELL_TO_PARENT' | 'quadbin_cell_to_parent'; QUADBIN_TILE_TO_CELL: 'QUADBIN_TILE_TO_CELL' | 'quadbin_tile_to_cell'; +EVER_EQ_TJSONB_JSONB: 'EVER_EQ_TJSONB_JSONB' | 'ever_eq_tjsonb_jsonb'; +ALWAYS_EQ_TJSONB_JSONB: 'ALWAYS_EQ_TJSONB_JSONB' | 'always_eq_tjsonb_jsonb'; +EVER_NE_TJSONB_JSONB: 'EVER_NE_TJSONB_JSONB' | 'ever_ne_tjsonb_jsonb'; +ALWAYS_NE_TJSONB_JSONB: 'ALWAYS_NE_TJSONB_JSONB' | 'always_ne_tjsonb_jsonb'; GEOM_INTERSECTS2D: 'GEOM_INTERSECTS2D' | 'geom_intersects2d'; GEOM_DWITHIN2D: 'GEOM_DWITHIN2D' | 'geom_dwithin2d'; GEOM_CONTAINS: 'GEOM_CONTAINS' | 'geom_contains'; diff --git a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp index e3a420f69d..c22b02a299 100644 --- a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp +++ b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp @@ -484,6 +484,10 @@ #include #include #include +#include +#include +#include +#include #include #include #include @@ -10666,6 +10670,46 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont return LogicalFunction(QuadbinTileToCellLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2))); } /* END CODEGEN PARSER GLUE: QUADBIN_TILE_TO_CELL */ + case AntlrSQLParser::EVER_EQ_TJSONB_JSONB: { + PRECONDITION(ctx->functionParam().size() == 3, + "EverEqTjsonbJsonb requires 3 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + return LogicalFunction(EverEqTjsonbJsonbLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2))); + } + /* END CODEGEN PARSER GLUE: EVER_EQ_TJSONB_JSONB */ + case AntlrSQLParser::ALWAYS_EQ_TJSONB_JSONB: { + PRECONDITION(ctx->functionParam().size() == 3, + "AlwaysEqTjsonbJsonb requires 3 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + return LogicalFunction(AlwaysEqTjsonbJsonbLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2))); + } + /* END CODEGEN PARSER GLUE: ALWAYS_EQ_TJSONB_JSONB */ + case AntlrSQLParser::EVER_NE_TJSONB_JSONB: { + PRECONDITION(ctx->functionParam().size() == 3, + "EverNeTjsonbJsonb requires 3 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + return LogicalFunction(EverNeTjsonbJsonbLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2))); + } + /* END CODEGEN PARSER GLUE: EVER_NE_TJSONB_JSONB */ + case AntlrSQLParser::ALWAYS_NE_TJSONB_JSONB: { + PRECONDITION(ctx->functionParam().size() == 3, + "AlwaysNeTjsonbJsonb requires 3 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + return LogicalFunction(AlwaysNeTjsonbJsonbLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2))); + } + /* END CODEGEN PARSER GLUE: ALWAYS_NE_TJSONB_JSONB */ /* END CODEGEN PARSER GLUE: GEOM_INTERSECTS2D */ case AntlrSQLParser::GEOM_DWITHIN2D: { PRECONDITION(ctx->functionParam().size() == 3, From 75d20ee72d4cfab07ca58c0f413ad2f3c1f95f97 Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Mon, 15 Jun 2026 17:44:28 +0200 Subject: [PATCH 75/96] feat(meos): add TJSONB_TJSONB per-event comparison NES operators (W127) 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). --- .../AlwaysEqTjsonbTjsonbLogicalFunction.hpp | 48 ++++++++ .../AlwaysNeTjsonbTjsonbLogicalFunction.hpp | 48 ++++++++ .../EverEqTjsonbTjsonbLogicalFunction.hpp | 48 ++++++++ .../EverNeTjsonbTjsonbLogicalFunction.hpp | 48 ++++++++ .../AlwaysEqTjsonbTjsonbLogicalFunction.cpp | 105 ++++++++++++++++++ .../AlwaysNeTjsonbTjsonbLogicalFunction.cpp | 105 ++++++++++++++++++ .../src/Functions/Meos/CMakeLists.txt | 4 + .../EverEqTjsonbTjsonbLogicalFunction.cpp | 105 ++++++++++++++++++ .../EverNeTjsonbTjsonbLogicalFunction.cpp | 105 ++++++++++++++++++ .../AlwaysEqTjsonbTjsonbPhysicalFunction.hpp | 32 ++++++ .../AlwaysNeTjsonbTjsonbPhysicalFunction.hpp | 32 ++++++ .../EverEqTjsonbTjsonbPhysicalFunction.hpp | 32 ++++++ .../EverNeTjsonbTjsonbPhysicalFunction.hpp | 32 ++++++ .../AlwaysEqTjsonbTjsonbPhysicalFunction.cpp | 91 +++++++++++++++ .../AlwaysNeTjsonbTjsonbPhysicalFunction.cpp | 91 +++++++++++++++ .../src/Functions/Meos/CMakeLists.txt | 4 + .../EverEqTjsonbTjsonbPhysicalFunction.cpp | 91 +++++++++++++++ .../EverNeTjsonbTjsonbPhysicalFunction.cpp | 91 +++++++++++++++ nes-sql-parser/AntlrSQL.g4 | 6 +- .../src/AntlrSQLQueryPlanCreator.cpp | 48 ++++++++ 20 files changed, 1165 insertions(+), 1 deletion(-) create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysEqTjsonbTjsonbLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysNeTjsonbTjsonbLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverEqTjsonbTjsonbLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverNeTjsonbTjsonbLogicalFunction.hpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysEqTjsonbTjsonbLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysNeTjsonbTjsonbLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverEqTjsonbTjsonbLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverNeTjsonbTjsonbLogicalFunction.cpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysEqTjsonbTjsonbPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysNeTjsonbTjsonbPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverEqTjsonbTjsonbPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverNeTjsonbTjsonbPhysicalFunction.hpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysEqTjsonbTjsonbPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysNeTjsonbTjsonbPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverEqTjsonbTjsonbPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverNeTjsonbTjsonbPhysicalFunction.cpp diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysEqTjsonbTjsonbLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysEqTjsonbTjsonbLogicalFunction.hpp new file mode 100644 index 0000000000..d73da9b4af --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysEqTjsonbTjsonbLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if the two tjsonb instants are always equal. + */ +class AlwaysEqTjsonbTjsonbLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysEqTjsonbTjsonb"; + + AlwaysEqTjsonbTjsonbLogicalFunction(LogicalFunction json1, LogicalFunction ts1, LogicalFunction json2, LogicalFunction ts2); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysNeTjsonbTjsonbLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysNeTjsonbTjsonbLogicalFunction.hpp new file mode 100644 index 0000000000..eac1927655 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysNeTjsonbTjsonbLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if the two tjsonb instants are always not equal. + */ +class AlwaysNeTjsonbTjsonbLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysNeTjsonbTjsonb"; + + AlwaysNeTjsonbTjsonbLogicalFunction(LogicalFunction json1, LogicalFunction ts1, LogicalFunction json2, LogicalFunction ts2); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverEqTjsonbTjsonbLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverEqTjsonbTjsonbLogicalFunction.hpp new file mode 100644 index 0000000000..70be614386 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverEqTjsonbTjsonbLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if the two tjsonb instants are ever equal. + */ +class EverEqTjsonbTjsonbLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverEqTjsonbTjsonb"; + + EverEqTjsonbTjsonbLogicalFunction(LogicalFunction json1, LogicalFunction ts1, LogicalFunction json2, LogicalFunction ts2); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverNeTjsonbTjsonbLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverNeTjsonbTjsonbLogicalFunction.hpp new file mode 100644 index 0000000000..0b8af0041d --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverNeTjsonbTjsonbLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1.0 if the two tjsonb instants are ever not equal. + */ +class EverNeTjsonbTjsonbLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverNeTjsonbTjsonb"; + + EverNeTjsonbTjsonbLogicalFunction(LogicalFunction json1, LogicalFunction ts1, LogicalFunction json2, LogicalFunction ts2); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysEqTjsonbTjsonbLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysEqTjsonbTjsonbLogicalFunction.cpp new file mode 100644 index 0000000000..5f2d9a1f6e --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysEqTjsonbTjsonbLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AlwaysEqTjsonbTjsonbLogicalFunction::AlwaysEqTjsonbTjsonbLogicalFunction(LogicalFunction json1, LogicalFunction ts1, LogicalFunction json2, LogicalFunction ts2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(4); + parameters.push_back(std::move(json1)); + parameters.push_back(std::move(ts1)); + parameters.push_back(std::move(json2)); + parameters.push_back(std::move(ts2)); +} + +DataType AlwaysEqTjsonbTjsonbLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysEqTjsonbTjsonbLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AlwaysEqTjsonbTjsonbLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysEqTjsonbTjsonbLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 4, + "AlwaysEqTjsonbTjsonbLogicalFunction requires 4 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AlwaysEqTjsonbTjsonbLogicalFunction::getType() const { return NAME; } + +bool AlwaysEqTjsonbTjsonbLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AlwaysEqTjsonbTjsonbLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction AlwaysEqTjsonbTjsonbLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(4); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "json1 must be VARSIZED"); + INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::VARSIZED), "json2 must be VARSIZED"); + INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); + return withChildren(c); +} + +SerializableFunction AlwaysEqTjsonbTjsonbLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysEqTjsonbTjsonbLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 4, + "AlwaysEqTjsonbTjsonbLogicalFunction requires 4 children but got {}", + arguments.children.size()); + return AlwaysEqTjsonbTjsonbLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysNeTjsonbTjsonbLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysNeTjsonbTjsonbLogicalFunction.cpp new file mode 100644 index 0000000000..337ad23193 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysNeTjsonbTjsonbLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AlwaysNeTjsonbTjsonbLogicalFunction::AlwaysNeTjsonbTjsonbLogicalFunction(LogicalFunction json1, LogicalFunction ts1, LogicalFunction json2, LogicalFunction ts2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(4); + parameters.push_back(std::move(json1)); + parameters.push_back(std::move(ts1)); + parameters.push_back(std::move(json2)); + parameters.push_back(std::move(ts2)); +} + +DataType AlwaysNeTjsonbTjsonbLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysNeTjsonbTjsonbLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AlwaysNeTjsonbTjsonbLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysNeTjsonbTjsonbLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 4, + "AlwaysNeTjsonbTjsonbLogicalFunction requires 4 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AlwaysNeTjsonbTjsonbLogicalFunction::getType() const { return NAME; } + +bool AlwaysNeTjsonbTjsonbLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AlwaysNeTjsonbTjsonbLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction AlwaysNeTjsonbTjsonbLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(4); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "json1 must be VARSIZED"); + INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::VARSIZED), "json2 must be VARSIZED"); + INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); + return withChildren(c); +} + +SerializableFunction AlwaysNeTjsonbTjsonbLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysNeTjsonbTjsonbLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 4, + "AlwaysNeTjsonbTjsonbLogicalFunction requires 4 children but got {}", + arguments.children.size()); + return AlwaysNeTjsonbTjsonbLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt index 77b24cdd84..be94614fba 100644 --- a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt @@ -437,6 +437,10 @@ add_plugin(EverEqTjsonbJsonb LogicalFunction nes-logical-operators EverEqTjsonbJ add_plugin(AlwaysEqTjsonbJsonb LogicalFunction nes-logical-operators AlwaysEqTjsonbJsonbLogicalFunction.cpp) add_plugin(EverNeTjsonbJsonb LogicalFunction nes-logical-operators EverNeTjsonbJsonbLogicalFunction.cpp) add_plugin(AlwaysNeTjsonbJsonb LogicalFunction nes-logical-operators AlwaysNeTjsonbJsonbLogicalFunction.cpp) +add_plugin(EverEqTjsonbTjsonb LogicalFunction nes-logical-operators EverEqTjsonbTjsonbLogicalFunction.cpp) +add_plugin(AlwaysEqTjsonbTjsonb LogicalFunction nes-logical-operators AlwaysEqTjsonbTjsonbLogicalFunction.cpp) +add_plugin(EverNeTjsonbTjsonb LogicalFunction nes-logical-operators EverNeTjsonbTjsonbLogicalFunction.cpp) +add_plugin(AlwaysNeTjsonbTjsonb LogicalFunction nes-logical-operators AlwaysNeTjsonbTjsonbLogicalFunction.cpp) add_plugin(GeomIntersects2d LogicalFunction nes-logical-operators GeomIntersects2dLogicalFunction.cpp) add_plugin(GeomDwithin2d LogicalFunction nes-logical-operators GeomDwithin2dLogicalFunction.cpp) add_plugin(GeomContains LogicalFunction nes-logical-operators GeomContainsLogicalFunction.cpp) diff --git a/nes-logical-operators/src/Functions/Meos/EverEqTjsonbTjsonbLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverEqTjsonbTjsonbLogicalFunction.cpp new file mode 100644 index 0000000000..0e675053a7 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverEqTjsonbTjsonbLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EverEqTjsonbTjsonbLogicalFunction::EverEqTjsonbTjsonbLogicalFunction(LogicalFunction json1, LogicalFunction ts1, LogicalFunction json2, LogicalFunction ts2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(4); + parameters.push_back(std::move(json1)); + parameters.push_back(std::move(ts1)); + parameters.push_back(std::move(json2)); + parameters.push_back(std::move(ts2)); +} + +DataType EverEqTjsonbTjsonbLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverEqTjsonbTjsonbLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EverEqTjsonbTjsonbLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverEqTjsonbTjsonbLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 4, + "EverEqTjsonbTjsonbLogicalFunction requires 4 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EverEqTjsonbTjsonbLogicalFunction::getType() const { return NAME; } + +bool EverEqTjsonbTjsonbLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EverEqTjsonbTjsonbLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction EverEqTjsonbTjsonbLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(4); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "json1 must be VARSIZED"); + INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::VARSIZED), "json2 must be VARSIZED"); + INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); + return withChildren(c); +} + +SerializableFunction EverEqTjsonbTjsonbLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverEqTjsonbTjsonbLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 4, + "EverEqTjsonbTjsonbLogicalFunction requires 4 children but got {}", + arguments.children.size()); + return EverEqTjsonbTjsonbLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverNeTjsonbTjsonbLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverNeTjsonbTjsonbLogicalFunction.cpp new file mode 100644 index 0000000000..658fed2696 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverNeTjsonbTjsonbLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EverNeTjsonbTjsonbLogicalFunction::EverNeTjsonbTjsonbLogicalFunction(LogicalFunction json1, LogicalFunction ts1, LogicalFunction json2, LogicalFunction ts2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(4); + parameters.push_back(std::move(json1)); + parameters.push_back(std::move(ts1)); + parameters.push_back(std::move(json2)); + parameters.push_back(std::move(ts2)); +} + +DataType EverNeTjsonbTjsonbLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverNeTjsonbTjsonbLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EverNeTjsonbTjsonbLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverNeTjsonbTjsonbLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 4, + "EverNeTjsonbTjsonbLogicalFunction requires 4 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EverNeTjsonbTjsonbLogicalFunction::getType() const { return NAME; } + +bool EverNeTjsonbTjsonbLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EverNeTjsonbTjsonbLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction EverNeTjsonbTjsonbLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(4); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "json1 must be VARSIZED"); + INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::VARSIZED), "json2 must be VARSIZED"); + INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); + return withChildren(c); +} + +SerializableFunction EverNeTjsonbTjsonbLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverNeTjsonbTjsonbLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 4, + "EverNeTjsonbTjsonbLogicalFunction requires 4 children but got {}", + arguments.children.size()); + return EverNeTjsonbTjsonbLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3])); +} + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysEqTjsonbTjsonbPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysEqTjsonbTjsonbPhysicalFunction.hpp new file mode 100644 index 0000000000..1e5ffc433c --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysEqTjsonbTjsonbPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class AlwaysEqTjsonbTjsonbPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysEqTjsonbTjsonbPhysicalFunction(PhysicalFunction json1, PhysicalFunction ts1, PhysicalFunction json2, PhysicalFunction ts2); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysNeTjsonbTjsonbPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysNeTjsonbTjsonbPhysicalFunction.hpp new file mode 100644 index 0000000000..fb24860d65 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysNeTjsonbTjsonbPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class AlwaysNeTjsonbTjsonbPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysNeTjsonbTjsonbPhysicalFunction(PhysicalFunction json1, PhysicalFunction ts1, PhysicalFunction json2, PhysicalFunction ts2); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverEqTjsonbTjsonbPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverEqTjsonbTjsonbPhysicalFunction.hpp new file mode 100644 index 0000000000..8d77ff0b11 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverEqTjsonbTjsonbPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class EverEqTjsonbTjsonbPhysicalFunction : public PhysicalFunctionConcept { +public: + EverEqTjsonbTjsonbPhysicalFunction(PhysicalFunction json1, PhysicalFunction ts1, PhysicalFunction json2, PhysicalFunction ts2); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverNeTjsonbTjsonbPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverNeTjsonbTjsonbPhysicalFunction.hpp new file mode 100644 index 0000000000..4672a1af38 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverNeTjsonbTjsonbPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class EverNeTjsonbTjsonbPhysicalFunction : public PhysicalFunctionConcept { +public: + EverNeTjsonbTjsonbPhysicalFunction(PhysicalFunction json1, PhysicalFunction ts1, PhysicalFunction json2, PhysicalFunction ts2); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysEqTjsonbTjsonbPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysEqTjsonbTjsonbPhysicalFunction.cpp new file mode 100644 index 0000000000..ec8932d190 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysEqTjsonbTjsonbPhysicalFunction.cpp @@ -0,0 +1,91 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +AlwaysEqTjsonbTjsonbPhysicalFunction::AlwaysEqTjsonbTjsonbPhysicalFunction(PhysicalFunction json1, PhysicalFunction ts1, PhysicalFunction json2, PhysicalFunction ts2) +{ + paramFns.reserve(4); + paramFns.push_back(std::move(json1)); + paramFns.push_back(std::move(ts1)); + paramFns.push_back(std::move(json2)); + paramFns.push_back(std::move(ts2)); +} + +VarVal AlwaysEqTjsonbTjsonbPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto json1 = paramFns[0].execute(record, arena); + auto ts1 = paramFns[1].execute(record, arena).cast(); + auto json2 = paramFns[2].execute(record, arena); + auto ts2 = paramFns[3].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](const char* json1, uint32_t json1_len, uint64_t ts1, const char* json2, uint32_t json2_len, uint64_t ts2) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + char* s1 = (char*)malloc(json1_len + 1); + memcpy(s1, json1, json1_len); s1[json1_len] = '\0'; + Jsonb* jb1 = jsonb_in(s1); free(s1); + if (!jb1) return 0.0; + TInstant* inst1 = tjsonbinst_make(jb1, (TimestampTz)ts1); + free(jb1); + if (!inst1) return 0.0; + char* s2 = (char*)malloc(json2_len + 1); + memcpy(s2, json2, json2_len); s2[json2_len] = '\0'; + Jsonb* jb2 = jsonb_in(s2); free(s2); + if (!jb2) { free(inst1); return 0.0; } + TInstant* inst2 = tjsonbinst_make(jb2, (TimestampTz)ts2); + free(jb2); + if (!inst2) { free(inst1); return 0.0; } + int r = always_eq_tjsonb_tjsonb((Temporal*)inst1, (Temporal*)inst2); + free(inst1); free(inst2); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + json1, ts1, json2, ts2); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysEqTjsonbTjsonbPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 4, + "AlwaysEqTjsonbTjsonbPhysicalFunction requires 4 children but got {}", + arguments.childFunctions.size()); + return AlwaysEqTjsonbTjsonbPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysNeTjsonbTjsonbPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysNeTjsonbTjsonbPhysicalFunction.cpp new file mode 100644 index 0000000000..8bf4b65a00 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysNeTjsonbTjsonbPhysicalFunction.cpp @@ -0,0 +1,91 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +AlwaysNeTjsonbTjsonbPhysicalFunction::AlwaysNeTjsonbTjsonbPhysicalFunction(PhysicalFunction json1, PhysicalFunction ts1, PhysicalFunction json2, PhysicalFunction ts2) +{ + paramFns.reserve(4); + paramFns.push_back(std::move(json1)); + paramFns.push_back(std::move(ts1)); + paramFns.push_back(std::move(json2)); + paramFns.push_back(std::move(ts2)); +} + +VarVal AlwaysNeTjsonbTjsonbPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto json1 = paramFns[0].execute(record, arena); + auto ts1 = paramFns[1].execute(record, arena).cast(); + auto json2 = paramFns[2].execute(record, arena); + auto ts2 = paramFns[3].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](const char* json1, uint32_t json1_len, uint64_t ts1, const char* json2, uint32_t json2_len, uint64_t ts2) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + char* s1 = (char*)malloc(json1_len + 1); + memcpy(s1, json1, json1_len); s1[json1_len] = '\0'; + Jsonb* jb1 = jsonb_in(s1); free(s1); + if (!jb1) return 0.0; + TInstant* inst1 = tjsonbinst_make(jb1, (TimestampTz)ts1); + free(jb1); + if (!inst1) return 0.0; + char* s2 = (char*)malloc(json2_len + 1); + memcpy(s2, json2, json2_len); s2[json2_len] = '\0'; + Jsonb* jb2 = jsonb_in(s2); free(s2); + if (!jb2) { free(inst1); return 0.0; } + TInstant* inst2 = tjsonbinst_make(jb2, (TimestampTz)ts2); + free(jb2); + if (!inst2) { free(inst1); return 0.0; } + int r = always_ne_tjsonb_tjsonb((Temporal*)inst1, (Temporal*)inst2); + free(inst1); free(inst2); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + json1, ts1, json2, ts2); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysNeTjsonbTjsonbPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 4, + "AlwaysNeTjsonbTjsonbPhysicalFunction requires 4 children but got {}", + arguments.childFunctions.size()); + return AlwaysNeTjsonbTjsonbPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt index c7e8fbba38..b9131ca967 100644 --- a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt @@ -436,6 +436,10 @@ add_plugin(EverEqTjsonbJsonb PhysicalFunction nes-physical-operators EverEqTjson add_plugin(AlwaysEqTjsonbJsonb PhysicalFunction nes-physical-operators AlwaysEqTjsonbJsonbPhysicalFunction.cpp) add_plugin(EverNeTjsonbJsonb PhysicalFunction nes-physical-operators EverNeTjsonbJsonbPhysicalFunction.cpp) add_plugin(AlwaysNeTjsonbJsonb PhysicalFunction nes-physical-operators AlwaysNeTjsonbJsonbPhysicalFunction.cpp) +add_plugin(EverEqTjsonbTjsonb PhysicalFunction nes-physical-operators EverEqTjsonbTjsonbPhysicalFunction.cpp) +add_plugin(AlwaysEqTjsonbTjsonb PhysicalFunction nes-physical-operators AlwaysEqTjsonbTjsonbPhysicalFunction.cpp) +add_plugin(EverNeTjsonbTjsonb PhysicalFunction nes-physical-operators EverNeTjsonbTjsonbPhysicalFunction.cpp) +add_plugin(AlwaysNeTjsonbTjsonb PhysicalFunction nes-physical-operators AlwaysNeTjsonbTjsonbPhysicalFunction.cpp) add_plugin(GeomIntersects2d PhysicalFunction nes-physical-operators GeomIntersects2dPhysicalFunction.cpp) add_plugin(GeomDwithin2d PhysicalFunction nes-physical-operators GeomDwithin2dPhysicalFunction.cpp) add_plugin(GeomContains PhysicalFunction nes-physical-operators GeomContainsPhysicalFunction.cpp) diff --git a/nes-physical-operators/src/Functions/Meos/EverEqTjsonbTjsonbPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverEqTjsonbTjsonbPhysicalFunction.cpp new file mode 100644 index 0000000000..bbfb0752bb --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverEqTjsonbTjsonbPhysicalFunction.cpp @@ -0,0 +1,91 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +EverEqTjsonbTjsonbPhysicalFunction::EverEqTjsonbTjsonbPhysicalFunction(PhysicalFunction json1, PhysicalFunction ts1, PhysicalFunction json2, PhysicalFunction ts2) +{ + paramFns.reserve(4); + paramFns.push_back(std::move(json1)); + paramFns.push_back(std::move(ts1)); + paramFns.push_back(std::move(json2)); + paramFns.push_back(std::move(ts2)); +} + +VarVal EverEqTjsonbTjsonbPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto json1 = paramFns[0].execute(record, arena); + auto ts1 = paramFns[1].execute(record, arena).cast(); + auto json2 = paramFns[2].execute(record, arena); + auto ts2 = paramFns[3].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](const char* json1, uint32_t json1_len, uint64_t ts1, const char* json2, uint32_t json2_len, uint64_t ts2) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + char* s1 = (char*)malloc(json1_len + 1); + memcpy(s1, json1, json1_len); s1[json1_len] = '\0'; + Jsonb* jb1 = jsonb_in(s1); free(s1); + if (!jb1) return 0.0; + TInstant* inst1 = tjsonbinst_make(jb1, (TimestampTz)ts1); + free(jb1); + if (!inst1) return 0.0; + char* s2 = (char*)malloc(json2_len + 1); + memcpy(s2, json2, json2_len); s2[json2_len] = '\0'; + Jsonb* jb2 = jsonb_in(s2); free(s2); + if (!jb2) { free(inst1); return 0.0; } + TInstant* inst2 = tjsonbinst_make(jb2, (TimestampTz)ts2); + free(jb2); + if (!inst2) { free(inst1); return 0.0; } + int r = ever_eq_tjsonb_tjsonb((Temporal*)inst1, (Temporal*)inst2); + free(inst1); free(inst2); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + json1, ts1, json2, ts2); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverEqTjsonbTjsonbPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 4, + "EverEqTjsonbTjsonbPhysicalFunction requires 4 children but got {}", + arguments.childFunctions.size()); + return EverEqTjsonbTjsonbPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverNeTjsonbTjsonbPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverNeTjsonbTjsonbPhysicalFunction.cpp new file mode 100644 index 0000000000..f060309a62 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverNeTjsonbTjsonbPhysicalFunction.cpp @@ -0,0 +1,91 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +EverNeTjsonbTjsonbPhysicalFunction::EverNeTjsonbTjsonbPhysicalFunction(PhysicalFunction json1, PhysicalFunction ts1, PhysicalFunction json2, PhysicalFunction ts2) +{ + paramFns.reserve(4); + paramFns.push_back(std::move(json1)); + paramFns.push_back(std::move(ts1)); + paramFns.push_back(std::move(json2)); + paramFns.push_back(std::move(ts2)); +} + +VarVal EverNeTjsonbTjsonbPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto json1 = paramFns[0].execute(record, arena); + auto ts1 = paramFns[1].execute(record, arena).cast(); + auto json2 = paramFns[2].execute(record, arena); + auto ts2 = paramFns[3].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](const char* json1, uint32_t json1_len, uint64_t ts1, const char* json2, uint32_t json2_len, uint64_t ts2) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + char* s1 = (char*)malloc(json1_len + 1); + memcpy(s1, json1, json1_len); s1[json1_len] = '\0'; + Jsonb* jb1 = jsonb_in(s1); free(s1); + if (!jb1) return 0.0; + TInstant* inst1 = tjsonbinst_make(jb1, (TimestampTz)ts1); + free(jb1); + if (!inst1) return 0.0; + char* s2 = (char*)malloc(json2_len + 1); + memcpy(s2, json2, json2_len); s2[json2_len] = '\0'; + Jsonb* jb2 = jsonb_in(s2); free(s2); + if (!jb2) { free(inst1); return 0.0; } + TInstant* inst2 = tjsonbinst_make(jb2, (TimestampTz)ts2); + free(jb2); + if (!inst2) { free(inst1); return 0.0; } + int r = ever_ne_tjsonb_tjsonb((Temporal*)inst1, (Temporal*)inst2); + free(inst1); free(inst2); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + json1, ts1, json2, ts2); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverNeTjsonbTjsonbPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 4, + "EverNeTjsonbTjsonbPhysicalFunction requires 4 children but got {}", + arguments.childFunctions.size()); + return EverNeTjsonbTjsonbPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3])); +} + +} // namespace NES diff --git a/nes-sql-parser/AntlrSQL.g4 b/nes-sql-parser/AntlrSQL.g4 index 7ef694235c..00a5e0ed76 100644 --- a/nes-sql-parser/AntlrSQL.g4 +++ b/nes-sql-parser/AntlrSQL.g4 @@ -295,7 +295,7 @@ timeUnit: MS timestampParameter: name=identifier; -functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT | TGE_TTEXT_TEXT | TGE_TEXT_TTEXT | TGT_TTEXT_TEXT | TGT_TEXT_TTEXT | TLE_TTEXT_TEXT | TLE_TEXT_TTEXT | TLT_TTEXT_TEXT | TLT_TEXT_TTEXT | TTEXT_UPPER | TTEXT_LOWER | TTEXT_INITCAP | TEXTCAT_TTEXT_TEXT | TEXTCAT_TEXT_TTEXT | TEXTCAT_TTEXT_TTEXT | GEOM_LENGTH | GEOM_PERIMETER | GEOM_AZIMUTH | GEOG_AREA | GEOG_LENGTH | GEOG_PERIMETER | GEOM_IS_EMPTY | AINTERSECTS_TGEO_GEO | ACOVERS_TGEO_GEO | ADISJOINT_TGEO_GEO | ADWITHIN_TGEO_GEO | EINTERSECTS_TGEO_GEO | ETOUCHES_TGEO_GEO | ECONTAINS_TGEO_GEO | ACONTAINS_TGEO_GEO | ATOUCHES_TGEO_GEO | GEO_NUM_POINTS | GEO_NUM_GEOS | GEO_SRID | GEO_IS_UNITARY | GEO_EQUALS | GEO_SAME | GEOG_DISTANCE | NAD_TGEO_GEO | EVER_EQ_TGEO_GEO | EVER_NE_TGEO_GEO | ALWAYS_EQ_TGEO_GEO | ALWAYS_NE_TGEO_GEO | GEOG_INTERSECTS | GEOG_DWITHIN | ACOVERS_GEO_TGEO | GEOM_INTERSECTS | GEOM_DWITHIN | H3_GS_POINT_TO_CELL | EVER_EQ_TH3INDEX_H3INDEX | EVER_NE_TH3INDEX_H3INDEX | ALWAYS_EQ_TH3INDEX_H3INDEX | ALWAYS_NE_TH3INDEX_H3INDEX | TH3INDEX_GET_RESOLUTION | TH3INDEX_GET_BASE_CELL_NUMBER | TH3INDEX_IS_VALID_CELL | TH3INDEX_IS_PENTAGON | TH3INDEX_CELL_TO_PARENT_NEXT | TH3INDEX_CELL_TO_CENTER_CHILD_NEXT | TH3INDEX_CELL_TO_PARENT | TH3INDEX_CELL_TO_CENTER_CHILD | TH3INDEX_CELL_TO_CHILD_POS | TH3INDEX_ARE_NEIGHBOR_CELLS | TH3INDEX_GRID_DISTANCE | EINTERSECTS_TCBUFFER_GEO | AINTERSECTS_TCBUFFER_GEO | ECOVERS_TCBUFFER_GEO | ACOVERS_TCBUFFER_GEO | EDISJOINT_TCBUFFER_GEO | ADISJOINT_TCBUFFER_GEO | ETOUCHES_TCBUFFER_GEO | ATOUCHES_TCBUFFER_GEO | ECONTAINS_TCBUFFER_GEO | ACONTAINS_TCBUFFER_GEO | NAD_TCBUFFER_GEO | EDWITHIN_TCBUFFER_GEO | ADWITHIN_TCBUFFER_GEO | EINTERSECTS_TCBUFFER_CBUFFER | AINTERSECTS_TCBUFFER_CBUFFER | ECOVERS_TCBUFFER_CBUFFER | ACOVERS_TCBUFFER_CBUFFER | EDISJOINT_TCBUFFER_CBUFFER | ADISJOINT_TCBUFFER_CBUFFER | ETOUCHES_TCBUFFER_CBUFFER | ATOUCHES_TCBUFFER_CBUFFER | ECONTAINS_TCBUFFER_CBUFFER | ACONTAINS_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_CBUFFER | ALWAYS_EQ_TCBUFFER_CBUFFER | EVER_NE_TCBUFFER_CBUFFER | ALWAYS_NE_TCBUFFER_CBUFFER | NAD_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_TCBUFFER | ALWAYS_EQ_TCBUFFER_TCBUFFER | EVER_NE_TCBUFFER_TCBUFFER | ALWAYS_NE_TCBUFFER_TCBUFFER | EINTERSECTS_TCBUFFER_TCBUFFER | AINTERSECTS_TCBUFFER_TCBUFFER | ECOVERS_TCBUFFER_TCBUFFER | ACOVERS_TCBUFFER_TCBUFFER | ADISJOINT_TCBUFFER_TCBUFFER | ETOUCHES_TCBUFFER_TCBUFFER | ATOUCHES_TCBUFFER_TCBUFFER | NAD_TCBUFFER_TCBUFFER | EDWITHIN_TCBUFFER_TCBUFFER | ADWITHIN_TCBUFFER_TCBUFFER | MINDISTANCE_TCBUFFER_TCBUFFER | NAD_TNPOINT_GEO | EVER_EQ_TNPOINT_NPOINT | ALWAYS_EQ_TNPOINT_NPOINT | EVER_NE_TNPOINT_NPOINT | ALWAYS_NE_TNPOINT_NPOINT | NAD_TNPOINT_NPOINT | EVER_EQ_NPOINT_TNPOINT | ALWAYS_EQ_NPOINT_TNPOINT | EVER_NE_NPOINT_TNPOINT | ALWAYS_NE_NPOINT_TNPOINT | EVER_EQ_TNPOINT_TNPOINT | ALWAYS_EQ_TNPOINT_TNPOINT | EVER_NE_TNPOINT_TNPOINT | ALWAYS_NE_TNPOINT_TNPOINT | NAD_TNPOINT_TNPOINT | NAD_TPOSE_GEO | EVER_EQ_TPOSE_POSE | ALWAYS_EQ_TPOSE_POSE | EVER_NE_TPOSE_POSE | ALWAYS_NE_TPOSE_POSE | NAD_TPOSE_POSE | EVER_EQ_POSE_TPOSE | ALWAYS_EQ_POSE_TPOSE | EVER_NE_POSE_TPOSE | ALWAYS_NE_POSE_TPOSE | EVER_EQ_TPOSE_TPOSE | ALWAYS_EQ_TPOSE_TPOSE | EVER_NE_TPOSE_TPOSE | ALWAYS_NE_TPOSE_TPOSE | NAD_TPOSE_TPOSE | EVER_EQ_TRGEOMETRY_GEO | ALWAYS_EQ_TRGEOMETRY_GEO | EVER_NE_TRGEOMETRY_GEO | ALWAYS_NE_TRGEOMETRY_GEO | NAD_TRGEOMETRY_GEO | EVER_EQ_GEO_TRGEOMETRY | ALWAYS_EQ_GEO_TRGEOMETRY | EVER_NE_GEO_TRGEOMETRY | ALWAYS_NE_GEO_TRGEOMETRY | EVER_EQ_TRGEOMETRY_TRGEOMETRY | ALWAYS_EQ_TRGEOMETRY_TRGEOMETRY | EVER_NE_TRGEOMETRY_TRGEOMETRY | ALWAYS_NE_TRGEOMETRY_TRGEOMETRY | NAD_TRGEOMETRY_TRGEOMETRY | EINTERSECTS_TPCPOINT_GEO | NAD_TPCPOINT_GEO | QUADBIN_POINT_TO_CELL | QUADBIN_IS_VALID_CELL | QUADBIN_GET_RESOLUTION | QUADBIN_CELL_AREA | QUADBIN_CELL_TO_QUADKEY | QUADBIN_CELL_TO_PARENT | QUADBIN_TILE_TO_CELL | EVER_EQ_TJSONB_JSONB | ALWAYS_EQ_TJSONB_JSONB | EVER_NE_TJSONB_JSONB | ALWAYS_NE_TJSONB_JSONB | GEOM_INTERSECTS2D | GEOM_DWITHIN2D | GEOM_CONTAINS | GEOM_DISJOINT2D | GEOM_COVERS | GEOM_TOUCHES | GEOM_INTERSECTS3D | GEOM_DWITHIN3D | GEOM_DISTANCE2D | GEOM_DISTANCE3D; +functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT | TGE_TTEXT_TEXT | TGE_TEXT_TTEXT | TGT_TTEXT_TEXT | TGT_TEXT_TTEXT | TLE_TTEXT_TEXT | TLE_TEXT_TTEXT | TLT_TTEXT_TEXT | TLT_TEXT_TTEXT | TTEXT_UPPER | TTEXT_LOWER | TTEXT_INITCAP | TEXTCAT_TTEXT_TEXT | TEXTCAT_TEXT_TTEXT | TEXTCAT_TTEXT_TTEXT | GEOM_LENGTH | GEOM_PERIMETER | GEOM_AZIMUTH | GEOG_AREA | GEOG_LENGTH | GEOG_PERIMETER | GEOM_IS_EMPTY | AINTERSECTS_TGEO_GEO | ACOVERS_TGEO_GEO | ADISJOINT_TGEO_GEO | ADWITHIN_TGEO_GEO | EINTERSECTS_TGEO_GEO | ETOUCHES_TGEO_GEO | ECONTAINS_TGEO_GEO | ACONTAINS_TGEO_GEO | ATOUCHES_TGEO_GEO | GEO_NUM_POINTS | GEO_NUM_GEOS | GEO_SRID | GEO_IS_UNITARY | GEO_EQUALS | GEO_SAME | GEOG_DISTANCE | NAD_TGEO_GEO | EVER_EQ_TGEO_GEO | EVER_NE_TGEO_GEO | ALWAYS_EQ_TGEO_GEO | ALWAYS_NE_TGEO_GEO | GEOG_INTERSECTS | GEOG_DWITHIN | ACOVERS_GEO_TGEO | GEOM_INTERSECTS | GEOM_DWITHIN | H3_GS_POINT_TO_CELL | EVER_EQ_TH3INDEX_H3INDEX | EVER_NE_TH3INDEX_H3INDEX | ALWAYS_EQ_TH3INDEX_H3INDEX | ALWAYS_NE_TH3INDEX_H3INDEX | TH3INDEX_GET_RESOLUTION | TH3INDEX_GET_BASE_CELL_NUMBER | TH3INDEX_IS_VALID_CELL | TH3INDEX_IS_PENTAGON | TH3INDEX_CELL_TO_PARENT_NEXT | TH3INDEX_CELL_TO_CENTER_CHILD_NEXT | TH3INDEX_CELL_TO_PARENT | TH3INDEX_CELL_TO_CENTER_CHILD | TH3INDEX_CELL_TO_CHILD_POS | TH3INDEX_ARE_NEIGHBOR_CELLS | TH3INDEX_GRID_DISTANCE | EINTERSECTS_TCBUFFER_GEO | AINTERSECTS_TCBUFFER_GEO | ECOVERS_TCBUFFER_GEO | ACOVERS_TCBUFFER_GEO | EDISJOINT_TCBUFFER_GEO | ADISJOINT_TCBUFFER_GEO | ETOUCHES_TCBUFFER_GEO | ATOUCHES_TCBUFFER_GEO | ECONTAINS_TCBUFFER_GEO | ACONTAINS_TCBUFFER_GEO | NAD_TCBUFFER_GEO | EDWITHIN_TCBUFFER_GEO | ADWITHIN_TCBUFFER_GEO | EINTERSECTS_TCBUFFER_CBUFFER | AINTERSECTS_TCBUFFER_CBUFFER | ECOVERS_TCBUFFER_CBUFFER | ACOVERS_TCBUFFER_CBUFFER | EDISJOINT_TCBUFFER_CBUFFER | ADISJOINT_TCBUFFER_CBUFFER | ETOUCHES_TCBUFFER_CBUFFER | ATOUCHES_TCBUFFER_CBUFFER | ECONTAINS_TCBUFFER_CBUFFER | ACONTAINS_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_CBUFFER | ALWAYS_EQ_TCBUFFER_CBUFFER | EVER_NE_TCBUFFER_CBUFFER | ALWAYS_NE_TCBUFFER_CBUFFER | NAD_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_TCBUFFER | ALWAYS_EQ_TCBUFFER_TCBUFFER | EVER_NE_TCBUFFER_TCBUFFER | ALWAYS_NE_TCBUFFER_TCBUFFER | EINTERSECTS_TCBUFFER_TCBUFFER | AINTERSECTS_TCBUFFER_TCBUFFER | ECOVERS_TCBUFFER_TCBUFFER | ACOVERS_TCBUFFER_TCBUFFER | ADISJOINT_TCBUFFER_TCBUFFER | ETOUCHES_TCBUFFER_TCBUFFER | ATOUCHES_TCBUFFER_TCBUFFER | NAD_TCBUFFER_TCBUFFER | EDWITHIN_TCBUFFER_TCBUFFER | ADWITHIN_TCBUFFER_TCBUFFER | MINDISTANCE_TCBUFFER_TCBUFFER | NAD_TNPOINT_GEO | EVER_EQ_TNPOINT_NPOINT | ALWAYS_EQ_TNPOINT_NPOINT | EVER_NE_TNPOINT_NPOINT | ALWAYS_NE_TNPOINT_NPOINT | NAD_TNPOINT_NPOINT | EVER_EQ_NPOINT_TNPOINT | ALWAYS_EQ_NPOINT_TNPOINT | EVER_NE_NPOINT_TNPOINT | ALWAYS_NE_NPOINT_TNPOINT | EVER_EQ_TNPOINT_TNPOINT | ALWAYS_EQ_TNPOINT_TNPOINT | EVER_NE_TNPOINT_TNPOINT | ALWAYS_NE_TNPOINT_TNPOINT | NAD_TNPOINT_TNPOINT | NAD_TPOSE_GEO | EVER_EQ_TPOSE_POSE | ALWAYS_EQ_TPOSE_POSE | EVER_NE_TPOSE_POSE | ALWAYS_NE_TPOSE_POSE | NAD_TPOSE_POSE | EVER_EQ_POSE_TPOSE | ALWAYS_EQ_POSE_TPOSE | EVER_NE_POSE_TPOSE | ALWAYS_NE_POSE_TPOSE | EVER_EQ_TPOSE_TPOSE | ALWAYS_EQ_TPOSE_TPOSE | EVER_NE_TPOSE_TPOSE | ALWAYS_NE_TPOSE_TPOSE | NAD_TPOSE_TPOSE | EVER_EQ_TRGEOMETRY_GEO | ALWAYS_EQ_TRGEOMETRY_GEO | EVER_NE_TRGEOMETRY_GEO | ALWAYS_NE_TRGEOMETRY_GEO | NAD_TRGEOMETRY_GEO | EVER_EQ_GEO_TRGEOMETRY | ALWAYS_EQ_GEO_TRGEOMETRY | EVER_NE_GEO_TRGEOMETRY | ALWAYS_NE_GEO_TRGEOMETRY | EVER_EQ_TRGEOMETRY_TRGEOMETRY | ALWAYS_EQ_TRGEOMETRY_TRGEOMETRY | EVER_NE_TRGEOMETRY_TRGEOMETRY | ALWAYS_NE_TRGEOMETRY_TRGEOMETRY | NAD_TRGEOMETRY_TRGEOMETRY | EINTERSECTS_TPCPOINT_GEO | NAD_TPCPOINT_GEO | QUADBIN_POINT_TO_CELL | QUADBIN_IS_VALID_CELL | QUADBIN_GET_RESOLUTION | QUADBIN_CELL_AREA | QUADBIN_CELL_TO_QUADKEY | QUADBIN_CELL_TO_PARENT | QUADBIN_TILE_TO_CELL | EVER_EQ_TJSONB_JSONB | ALWAYS_EQ_TJSONB_JSONB | EVER_NE_TJSONB_JSONB | ALWAYS_NE_TJSONB_JSONB | EVER_EQ_TJSONB_TJSONB | ALWAYS_EQ_TJSONB_TJSONB | EVER_NE_TJSONB_TJSONB | ALWAYS_NE_TJSONB_TJSONB | GEOM_INTERSECTS2D | GEOM_DWITHIN2D | GEOM_CONTAINS | GEOM_DISJOINT2D | GEOM_COVERS | GEOM_TOUCHES | GEOM_INTERSECTS3D | GEOM_DWITHIN3D | GEOM_DISTANCE2D | GEOM_DISTANCE3D; sinkClause: INTO sink (',' sink)*; @@ -907,6 +907,10 @@ EVER_EQ_TJSONB_JSONB: 'EVER_EQ_TJSONB_JSONB' | 'ever_eq_tjsonb_jsonb'; ALWAYS_EQ_TJSONB_JSONB: 'ALWAYS_EQ_TJSONB_JSONB' | 'always_eq_tjsonb_jsonb'; EVER_NE_TJSONB_JSONB: 'EVER_NE_TJSONB_JSONB' | 'ever_ne_tjsonb_jsonb'; ALWAYS_NE_TJSONB_JSONB: 'ALWAYS_NE_TJSONB_JSONB' | 'always_ne_tjsonb_jsonb'; +EVER_EQ_TJSONB_TJSONB: 'EVER_EQ_TJSONB_TJSONB' | 'ever_eq_tjsonb_tjsonb'; +ALWAYS_EQ_TJSONB_TJSONB: 'ALWAYS_EQ_TJSONB_TJSONB' | 'always_eq_tjsonb_tjsonb'; +EVER_NE_TJSONB_TJSONB: 'EVER_NE_TJSONB_TJSONB' | 'ever_ne_tjsonb_tjsonb'; +ALWAYS_NE_TJSONB_TJSONB: 'ALWAYS_NE_TJSONB_TJSONB' | 'always_ne_tjsonb_tjsonb'; GEOM_INTERSECTS2D: 'GEOM_INTERSECTS2D' | 'geom_intersects2d'; GEOM_DWITHIN2D: 'GEOM_DWITHIN2D' | 'geom_dwithin2d'; GEOM_CONTAINS: 'GEOM_CONTAINS' | 'geom_contains'; diff --git a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp index c22b02a299..dd8d05c0f6 100644 --- a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp +++ b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp @@ -488,6 +488,10 @@ #include #include #include +#include +#include +#include +#include #include #include #include @@ -10710,6 +10714,50 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont return LogicalFunction(AlwaysNeTjsonbJsonbLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2))); } /* END CODEGEN PARSER GLUE: ALWAYS_NE_TJSONB_JSONB */ + case AntlrSQLParser::EVER_EQ_TJSONB_TJSONB: { + PRECONDITION(ctx->functionParam().size() == 4, + "EverEqTjsonbTjsonb requires 4 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + return LogicalFunction(EverEqTjsonbTjsonbLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3))); + } + /* END CODEGEN PARSER GLUE: EVER_EQ_TJSONB_TJSONB */ + case AntlrSQLParser::ALWAYS_EQ_TJSONB_TJSONB: { + PRECONDITION(ctx->functionParam().size() == 4, + "AlwaysEqTjsonbTjsonb requires 4 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + return LogicalFunction(AlwaysEqTjsonbTjsonbLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3))); + } + /* END CODEGEN PARSER GLUE: ALWAYS_EQ_TJSONB_TJSONB */ + case AntlrSQLParser::EVER_NE_TJSONB_TJSONB: { + PRECONDITION(ctx->functionParam().size() == 4, + "EverNeTjsonbTjsonb requires 4 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + return LogicalFunction(EverNeTjsonbTjsonbLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3))); + } + /* END CODEGEN PARSER GLUE: EVER_NE_TJSONB_TJSONB */ + case AntlrSQLParser::ALWAYS_NE_TJSONB_TJSONB: { + PRECONDITION(ctx->functionParam().size() == 4, + "AlwaysNeTjsonbTjsonb requires 4 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + return LogicalFunction(AlwaysNeTjsonbTjsonbLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3))); + } + /* END CODEGEN PARSER GLUE: ALWAYS_NE_TJSONB_TJSONB */ /* END CODEGEN PARSER GLUE: GEOM_INTERSECTS2D */ case AntlrSQLParser::GEOM_DWITHIN2D: { PRECONDITION(ctx->functionParam().size() == 3, From 62b5c8e685007105acadf5c23822dd88c9bd91c3 Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Mon, 15 Jun 2026 20:14:36 +0200 Subject: [PATCH 76/96] feat(meos): add unary geometry transform NES operators returning WKT (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. --- .../Meos/GeoPointsLogicalFunction.hpp | 48 ++++++++++ .../Meos/GeoReverseLogicalFunction.hpp | 48 ++++++++++ .../Meos/GeomBoundaryLogicalFunction.hpp | 48 ++++++++++ .../Meos/GeomCentroidLogicalFunction.hpp | 48 ++++++++++ .../Meos/GeomConvexHullLogicalFunction.hpp | 48 ++++++++++ .../Meos/GeomUnaryUnionLogicalFunction.hpp | 48 ++++++++++ .../src/Functions/Meos/CMakeLists.txt | 6 ++ .../Meos/GeoPointsLogicalFunction.cpp | 96 +++++++++++++++++++ .../Meos/GeoReverseLogicalFunction.cpp | 96 +++++++++++++++++++ .../Meos/GeomBoundaryLogicalFunction.cpp | 96 +++++++++++++++++++ .../Meos/GeomCentroidLogicalFunction.cpp | 96 +++++++++++++++++++ .../Meos/GeomConvexHullLogicalFunction.cpp | 96 +++++++++++++++++++ .../Meos/GeomUnaryUnionLogicalFunction.cpp | 96 +++++++++++++++++++ .../Meos/GeoPointsPhysicalFunction.hpp | 32 +++++++ .../Meos/GeoReversePhysicalFunction.hpp | 32 +++++++ .../Meos/GeomBoundaryPhysicalFunction.hpp | 32 +++++++ .../Meos/GeomCentroidPhysicalFunction.hpp | 32 +++++++ .../Meos/GeomConvexHullPhysicalFunction.hpp | 32 +++++++ .../Meos/GeomUnaryUnionPhysicalFunction.hpp | 32 +++++++ .../src/Functions/Meos/CMakeLists.txt | 6 ++ .../Meos/GeoPointsPhysicalFunction.cpp | 84 ++++++++++++++++ .../Meos/GeoReversePhysicalFunction.cpp | 84 ++++++++++++++++ .../Meos/GeomBoundaryPhysicalFunction.cpp | 84 ++++++++++++++++ .../Meos/GeomCentroidPhysicalFunction.cpp | 84 ++++++++++++++++ .../Meos/GeomConvexHullPhysicalFunction.cpp | 84 ++++++++++++++++ .../Meos/GeomUnaryUnionPhysicalFunction.cpp | 84 ++++++++++++++++ nes-sql-parser/AntlrSQL.g4 | 8 +- .../src/AntlrSQLQueryPlanCreator.cpp | 54 +++++++++++ 28 files changed, 1633 insertions(+), 1 deletion(-) create mode 100644 nes-logical-operators/include/Functions/Meos/GeoPointsLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/GeoReverseLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/GeomBoundaryLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/GeomCentroidLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/GeomConvexHullLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/GeomUnaryUnionLogicalFunction.hpp create mode 100644 nes-logical-operators/src/Functions/Meos/GeoPointsLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/GeoReverseLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/GeomBoundaryLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/GeomCentroidLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/GeomConvexHullLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/GeomUnaryUnionLogicalFunction.cpp create mode 100644 nes-physical-operators/include/Functions/Meos/GeoPointsPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/GeoReversePhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/GeomBoundaryPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/GeomCentroidPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/GeomConvexHullPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/GeomUnaryUnionPhysicalFunction.hpp create mode 100644 nes-physical-operators/src/Functions/Meos/GeoPointsPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/GeoReversePhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/GeomBoundaryPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/GeomCentroidPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/GeomConvexHullPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/GeomUnaryUnionPhysicalFunction.cpp diff --git a/nes-logical-operators/include/Functions/Meos/GeoPointsLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeoPointsLogicalFunction.hpp new file mode 100644 index 0000000000..445a9384d8 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/GeoPointsLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns a multi-point geometry of all vertices as WKT. + */ +class GeoPointsLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "GeoPoints"; + + GeoPointsLogicalFunction(LogicalFunction wkt); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/GeoReverseLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeoReverseLogicalFunction.hpp new file mode 100644 index 0000000000..637e401c3d --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/GeoReverseLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns the geometry with vertex order reversed as WKT. + */ +class GeoReverseLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "GeoReverse"; + + GeoReverseLogicalFunction(LogicalFunction wkt); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/GeomBoundaryLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeomBoundaryLogicalFunction.hpp new file mode 100644 index 0000000000..bc7a730b1a --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/GeomBoundaryLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns the boundary of a geometry as WKT. + */ +class GeomBoundaryLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "GeomBoundary"; + + GeomBoundaryLogicalFunction(LogicalFunction wkt); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/GeomCentroidLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeomCentroidLogicalFunction.hpp new file mode 100644 index 0000000000..d79f0a2beb --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/GeomCentroidLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns the centroid of a geometry as WKT. + */ +class GeomCentroidLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "GeomCentroid"; + + GeomCentroidLogicalFunction(LogicalFunction wkt); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/GeomConvexHullLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeomConvexHullLogicalFunction.hpp new file mode 100644 index 0000000000..cf854b2267 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/GeomConvexHullLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns the convex hull of a geometry as WKT. + */ +class GeomConvexHullLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "GeomConvexHull"; + + GeomConvexHullLogicalFunction(LogicalFunction wkt); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/GeomUnaryUnionLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeomUnaryUnionLogicalFunction.hpp new file mode 100644 index 0000000000..3b8dfed730 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/GeomUnaryUnionLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns the topological union of a geometry's components as WKT. + */ +class GeomUnaryUnionLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "GeomUnaryUnion"; + + GeomUnaryUnionLogicalFunction(LogicalFunction wkt); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt index be94614fba..4640cb63ed 100644 --- a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt @@ -441,6 +441,12 @@ add_plugin(EverEqTjsonbTjsonb LogicalFunction nes-logical-operators EverEqTjsonb add_plugin(AlwaysEqTjsonbTjsonb LogicalFunction nes-logical-operators AlwaysEqTjsonbTjsonbLogicalFunction.cpp) add_plugin(EverNeTjsonbTjsonb LogicalFunction nes-logical-operators EverNeTjsonbTjsonbLogicalFunction.cpp) add_plugin(AlwaysNeTjsonbTjsonb LogicalFunction nes-logical-operators AlwaysNeTjsonbTjsonbLogicalFunction.cpp) +add_plugin(GeomBoundary LogicalFunction nes-logical-operators GeomBoundaryLogicalFunction.cpp) +add_plugin(GeomCentroid LogicalFunction nes-logical-operators GeomCentroidLogicalFunction.cpp) +add_plugin(GeomConvexHull LogicalFunction nes-logical-operators GeomConvexHullLogicalFunction.cpp) +add_plugin(GeoReverse LogicalFunction nes-logical-operators GeoReverseLogicalFunction.cpp) +add_plugin(GeoPoints LogicalFunction nes-logical-operators GeoPointsLogicalFunction.cpp) +add_plugin(GeomUnaryUnion LogicalFunction nes-logical-operators GeomUnaryUnionLogicalFunction.cpp) add_plugin(GeomIntersects2d LogicalFunction nes-logical-operators GeomIntersects2dLogicalFunction.cpp) add_plugin(GeomDwithin2d LogicalFunction nes-logical-operators GeomDwithin2dLogicalFunction.cpp) add_plugin(GeomContains LogicalFunction nes-logical-operators GeomContainsLogicalFunction.cpp) diff --git a/nes-logical-operators/src/Functions/Meos/GeoPointsLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeoPointsLogicalFunction.cpp new file mode 100644 index 0000000000..59507b39c0 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/GeoPointsLogicalFunction.cpp @@ -0,0 +1,96 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +GeoPointsLogicalFunction::GeoPointsLogicalFunction(LogicalFunction wkt) + : dataType(DataTypeProvider::provideDataType(DataType::Type::VARSIZED)) +{ + parameters.reserve(1); + parameters.push_back(std::move(wkt)); +} + +DataType GeoPointsLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction GeoPointsLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector GeoPointsLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction GeoPointsLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 1, + "GeoPointsLogicalFunction requires 1 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view GeoPointsLogicalFunction::getType() const { return NAME; } + +bool GeoPointsLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string GeoPointsLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction GeoPointsLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(1); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "wkt must be VARSIZED"); + return withChildren(c); +} + +SerializableFunction GeoPointsLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeoPointsLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 1, + "GeoPointsLogicalFunction requires 1 children but got {}", + arguments.children.size()); + return GeoPointsLogicalFunction( + std::move(arguments.children[0])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/GeoReverseLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeoReverseLogicalFunction.cpp new file mode 100644 index 0000000000..e70629d6e0 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/GeoReverseLogicalFunction.cpp @@ -0,0 +1,96 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +GeoReverseLogicalFunction::GeoReverseLogicalFunction(LogicalFunction wkt) + : dataType(DataTypeProvider::provideDataType(DataType::Type::VARSIZED)) +{ + parameters.reserve(1); + parameters.push_back(std::move(wkt)); +} + +DataType GeoReverseLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction GeoReverseLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector GeoReverseLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction GeoReverseLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 1, + "GeoReverseLogicalFunction requires 1 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view GeoReverseLogicalFunction::getType() const { return NAME; } + +bool GeoReverseLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string GeoReverseLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction GeoReverseLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(1); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "wkt must be VARSIZED"); + return withChildren(c); +} + +SerializableFunction GeoReverseLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeoReverseLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 1, + "GeoReverseLogicalFunction requires 1 children but got {}", + arguments.children.size()); + return GeoReverseLogicalFunction( + std::move(arguments.children[0])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/GeomBoundaryLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeomBoundaryLogicalFunction.cpp new file mode 100644 index 0000000000..2f901cfdfb --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/GeomBoundaryLogicalFunction.cpp @@ -0,0 +1,96 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +GeomBoundaryLogicalFunction::GeomBoundaryLogicalFunction(LogicalFunction wkt) + : dataType(DataTypeProvider::provideDataType(DataType::Type::VARSIZED)) +{ + parameters.reserve(1); + parameters.push_back(std::move(wkt)); +} + +DataType GeomBoundaryLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction GeomBoundaryLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector GeomBoundaryLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction GeomBoundaryLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 1, + "GeomBoundaryLogicalFunction requires 1 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view GeomBoundaryLogicalFunction::getType() const { return NAME; } + +bool GeomBoundaryLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string GeomBoundaryLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction GeomBoundaryLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(1); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "wkt must be VARSIZED"); + return withChildren(c); +} + +SerializableFunction GeomBoundaryLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeomBoundaryLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 1, + "GeomBoundaryLogicalFunction requires 1 children but got {}", + arguments.children.size()); + return GeomBoundaryLogicalFunction( + std::move(arguments.children[0])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/GeomCentroidLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeomCentroidLogicalFunction.cpp new file mode 100644 index 0000000000..1627911bc7 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/GeomCentroidLogicalFunction.cpp @@ -0,0 +1,96 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +GeomCentroidLogicalFunction::GeomCentroidLogicalFunction(LogicalFunction wkt) + : dataType(DataTypeProvider::provideDataType(DataType::Type::VARSIZED)) +{ + parameters.reserve(1); + parameters.push_back(std::move(wkt)); +} + +DataType GeomCentroidLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction GeomCentroidLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector GeomCentroidLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction GeomCentroidLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 1, + "GeomCentroidLogicalFunction requires 1 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view GeomCentroidLogicalFunction::getType() const { return NAME; } + +bool GeomCentroidLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string GeomCentroidLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction GeomCentroidLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(1); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "wkt must be VARSIZED"); + return withChildren(c); +} + +SerializableFunction GeomCentroidLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeomCentroidLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 1, + "GeomCentroidLogicalFunction requires 1 children but got {}", + arguments.children.size()); + return GeomCentroidLogicalFunction( + std::move(arguments.children[0])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/GeomConvexHullLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeomConvexHullLogicalFunction.cpp new file mode 100644 index 0000000000..6a011ddf3a --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/GeomConvexHullLogicalFunction.cpp @@ -0,0 +1,96 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +GeomConvexHullLogicalFunction::GeomConvexHullLogicalFunction(LogicalFunction wkt) + : dataType(DataTypeProvider::provideDataType(DataType::Type::VARSIZED)) +{ + parameters.reserve(1); + parameters.push_back(std::move(wkt)); +} + +DataType GeomConvexHullLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction GeomConvexHullLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector GeomConvexHullLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction GeomConvexHullLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 1, + "GeomConvexHullLogicalFunction requires 1 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view GeomConvexHullLogicalFunction::getType() const { return NAME; } + +bool GeomConvexHullLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string GeomConvexHullLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction GeomConvexHullLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(1); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "wkt must be VARSIZED"); + return withChildren(c); +} + +SerializableFunction GeomConvexHullLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeomConvexHullLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 1, + "GeomConvexHullLogicalFunction requires 1 children but got {}", + arguments.children.size()); + return GeomConvexHullLogicalFunction( + std::move(arguments.children[0])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/GeomUnaryUnionLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeomUnaryUnionLogicalFunction.cpp new file mode 100644 index 0000000000..9155f6d913 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/GeomUnaryUnionLogicalFunction.cpp @@ -0,0 +1,96 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +GeomUnaryUnionLogicalFunction::GeomUnaryUnionLogicalFunction(LogicalFunction wkt) + : dataType(DataTypeProvider::provideDataType(DataType::Type::VARSIZED)) +{ + parameters.reserve(1); + parameters.push_back(std::move(wkt)); +} + +DataType GeomUnaryUnionLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction GeomUnaryUnionLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector GeomUnaryUnionLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction GeomUnaryUnionLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 1, + "GeomUnaryUnionLogicalFunction requires 1 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view GeomUnaryUnionLogicalFunction::getType() const { return NAME; } + +bool GeomUnaryUnionLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string GeomUnaryUnionLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction GeomUnaryUnionLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(1); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "wkt must be VARSIZED"); + return withChildren(c); +} + +SerializableFunction GeomUnaryUnionLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeomUnaryUnionLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 1, + "GeomUnaryUnionLogicalFunction requires 1 children but got {}", + arguments.children.size()); + return GeomUnaryUnionLogicalFunction( + std::move(arguments.children[0])); +} + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeoPointsPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeoPointsPhysicalFunction.hpp new file mode 100644 index 0000000000..84a1a22979 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/GeoPointsPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class GeoPointsPhysicalFunction : public PhysicalFunctionConcept { +public: + GeoPointsPhysicalFunction(PhysicalFunction wkt); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeoReversePhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeoReversePhysicalFunction.hpp new file mode 100644 index 0000000000..47707c49b1 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/GeoReversePhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class GeoReversePhysicalFunction : public PhysicalFunctionConcept { +public: + GeoReversePhysicalFunction(PhysicalFunction wkt); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeomBoundaryPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeomBoundaryPhysicalFunction.hpp new file mode 100644 index 0000000000..af559402d7 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/GeomBoundaryPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class GeomBoundaryPhysicalFunction : public PhysicalFunctionConcept { +public: + GeomBoundaryPhysicalFunction(PhysicalFunction wkt); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeomCentroidPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeomCentroidPhysicalFunction.hpp new file mode 100644 index 0000000000..4701a611bb --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/GeomCentroidPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class GeomCentroidPhysicalFunction : public PhysicalFunctionConcept { +public: + GeomCentroidPhysicalFunction(PhysicalFunction wkt); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeomConvexHullPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeomConvexHullPhysicalFunction.hpp new file mode 100644 index 0000000000..70f3cbe643 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/GeomConvexHullPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class GeomConvexHullPhysicalFunction : public PhysicalFunctionConcept { +public: + GeomConvexHullPhysicalFunction(PhysicalFunction wkt); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeomUnaryUnionPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeomUnaryUnionPhysicalFunction.hpp new file mode 100644 index 0000000000..e09db70ba5 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/GeomUnaryUnionPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class GeomUnaryUnionPhysicalFunction : public PhysicalFunctionConcept { +public: + GeomUnaryUnionPhysicalFunction(PhysicalFunction wkt); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt index b9131ca967..2379ee5bc1 100644 --- a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt @@ -440,6 +440,12 @@ add_plugin(EverEqTjsonbTjsonb PhysicalFunction nes-physical-operators EverEqTjso add_plugin(AlwaysEqTjsonbTjsonb PhysicalFunction nes-physical-operators AlwaysEqTjsonbTjsonbPhysicalFunction.cpp) add_plugin(EverNeTjsonbTjsonb PhysicalFunction nes-physical-operators EverNeTjsonbTjsonbPhysicalFunction.cpp) add_plugin(AlwaysNeTjsonbTjsonb PhysicalFunction nes-physical-operators AlwaysNeTjsonbTjsonbPhysicalFunction.cpp) +add_plugin(GeomBoundary PhysicalFunction nes-physical-operators GeomBoundaryPhysicalFunction.cpp) +add_plugin(GeomCentroid PhysicalFunction nes-physical-operators GeomCentroidPhysicalFunction.cpp) +add_plugin(GeomConvexHull PhysicalFunction nes-physical-operators GeomConvexHullPhysicalFunction.cpp) +add_plugin(GeoReverse PhysicalFunction nes-physical-operators GeoReversePhysicalFunction.cpp) +add_plugin(GeoPoints PhysicalFunction nes-physical-operators GeoPointsPhysicalFunction.cpp) +add_plugin(GeomUnaryUnion PhysicalFunction nes-physical-operators GeomUnaryUnionPhysicalFunction.cpp) add_plugin(GeomIntersects2d PhysicalFunction nes-physical-operators GeomIntersects2dPhysicalFunction.cpp) add_plugin(GeomDwithin2d PhysicalFunction nes-physical-operators GeomDwithin2dPhysicalFunction.cpp) add_plugin(GeomContains PhysicalFunction nes-physical-operators GeomContainsPhysicalFunction.cpp) diff --git a/nes-physical-operators/src/Functions/Meos/GeoPointsPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeoPointsPhysicalFunction.cpp new file mode 100644 index 0000000000..663752a656 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/GeoPointsPhysicalFunction.cpp @@ -0,0 +1,84 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +GeoPointsPhysicalFunction::GeoPointsPhysicalFunction(PhysicalFunction wkt) +{ + paramFns.reserve(1); + paramFns.push_back(std::move(wkt)); +} + +VarVal GeoPointsPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto wkt = paramFns[0].execute(record, arena).cast(); + constexpr uint32_t MAX_LEN = 8192; + auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); + + const auto actualLen = nautilus::invoke( + +[](const char* wkt, uint32_t wsz, char* buf, uint32_t bufMax) -> uint32_t { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string s(wkt, wsz); + GSERIALIZED* gs = geom_in(s.c_str(), -1); + if (!gs) return 0u; + GSERIALIZED* result = geo_points(gs); + free(gs); + if (!result) return 0u; + char* out = geo_as_text(result, -1); + free(result); + if (!out) return 0u; + uint32_t len = static_cast(strlen(out)); + if (len > bufMax) len = bufMax; + memcpy(buf, out, len); + free(out); + return len; + } catch (const std::exception&) { return 0u; } + }, + wkt, outBuf.getContent(), nautilus::val(8192)); + + VarVal(actualLen).writeToMemory(outBuf.getReference()); + return outBuf; +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterGeoPointsPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 1, + "GeoPointsPhysicalFunction requires 1 children but got {}", + arguments.childFunctions.size()); + return GeoPointsPhysicalFunction( + std::move(arguments.childFunctions[0])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/GeoReversePhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeoReversePhysicalFunction.cpp new file mode 100644 index 0000000000..43b6d87faf --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/GeoReversePhysicalFunction.cpp @@ -0,0 +1,84 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +GeoReversePhysicalFunction::GeoReversePhysicalFunction(PhysicalFunction wkt) +{ + paramFns.reserve(1); + paramFns.push_back(std::move(wkt)); +} + +VarVal GeoReversePhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto wkt = paramFns[0].execute(record, arena).cast(); + constexpr uint32_t MAX_LEN = 8192; + auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); + + const auto actualLen = nautilus::invoke( + +[](const char* wkt, uint32_t wsz, char* buf, uint32_t bufMax) -> uint32_t { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string s(wkt, wsz); + GSERIALIZED* gs = geom_in(s.c_str(), -1); + if (!gs) return 0u; + GSERIALIZED* result = geo_reverse(gs); + free(gs); + if (!result) return 0u; + char* out = geo_as_text(result, -1); + free(result); + if (!out) return 0u; + uint32_t len = static_cast(strlen(out)); + if (len > bufMax) len = bufMax; + memcpy(buf, out, len); + free(out); + return len; + } catch (const std::exception&) { return 0u; } + }, + wkt, outBuf.getContent(), nautilus::val(8192)); + + VarVal(actualLen).writeToMemory(outBuf.getReference()); + return outBuf; +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterGeoReversePhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 1, + "GeoReversePhysicalFunction requires 1 children but got {}", + arguments.childFunctions.size()); + return GeoReversePhysicalFunction( + std::move(arguments.childFunctions[0])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/GeomBoundaryPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeomBoundaryPhysicalFunction.cpp new file mode 100644 index 0000000000..c2dc54d45d --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/GeomBoundaryPhysicalFunction.cpp @@ -0,0 +1,84 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +GeomBoundaryPhysicalFunction::GeomBoundaryPhysicalFunction(PhysicalFunction wkt) +{ + paramFns.reserve(1); + paramFns.push_back(std::move(wkt)); +} + +VarVal GeomBoundaryPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto wkt = paramFns[0].execute(record, arena).cast(); + constexpr uint32_t MAX_LEN = 8192; + auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); + + const auto actualLen = nautilus::invoke( + +[](const char* wkt, uint32_t wsz, char* buf, uint32_t bufMax) -> uint32_t { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string s(wkt, wsz); + GSERIALIZED* gs = geom_in(s.c_str(), -1); + if (!gs) return 0u; + GSERIALIZED* result = geom_boundary(gs); + free(gs); + if (!result) return 0u; + char* out = geo_as_text(result, -1); + free(result); + if (!out) return 0u; + uint32_t len = static_cast(strlen(out)); + if (len > bufMax) len = bufMax; + memcpy(buf, out, len); + free(out); + return len; + } catch (const std::exception&) { return 0u; } + }, + wkt, outBuf.getContent(), nautilus::val(8192)); + + VarVal(actualLen).writeToMemory(outBuf.getReference()); + return outBuf; +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterGeomBoundaryPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 1, + "GeomBoundaryPhysicalFunction requires 1 children but got {}", + arguments.childFunctions.size()); + return GeomBoundaryPhysicalFunction( + std::move(arguments.childFunctions[0])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/GeomCentroidPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeomCentroidPhysicalFunction.cpp new file mode 100644 index 0000000000..380553bc1c --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/GeomCentroidPhysicalFunction.cpp @@ -0,0 +1,84 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +GeomCentroidPhysicalFunction::GeomCentroidPhysicalFunction(PhysicalFunction wkt) +{ + paramFns.reserve(1); + paramFns.push_back(std::move(wkt)); +} + +VarVal GeomCentroidPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto wkt = paramFns[0].execute(record, arena).cast(); + constexpr uint32_t MAX_LEN = 8192; + auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); + + const auto actualLen = nautilus::invoke( + +[](const char* wkt, uint32_t wsz, char* buf, uint32_t bufMax) -> uint32_t { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string s(wkt, wsz); + GSERIALIZED* gs = geom_in(s.c_str(), -1); + if (!gs) return 0u; + GSERIALIZED* result = geom_centroid(gs); + free(gs); + if (!result) return 0u; + char* out = geo_as_text(result, -1); + free(result); + if (!out) return 0u; + uint32_t len = static_cast(strlen(out)); + if (len > bufMax) len = bufMax; + memcpy(buf, out, len); + free(out); + return len; + } catch (const std::exception&) { return 0u; } + }, + wkt, outBuf.getContent(), nautilus::val(8192)); + + VarVal(actualLen).writeToMemory(outBuf.getReference()); + return outBuf; +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterGeomCentroidPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 1, + "GeomCentroidPhysicalFunction requires 1 children but got {}", + arguments.childFunctions.size()); + return GeomCentroidPhysicalFunction( + std::move(arguments.childFunctions[0])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/GeomConvexHullPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeomConvexHullPhysicalFunction.cpp new file mode 100644 index 0000000000..139552c7f9 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/GeomConvexHullPhysicalFunction.cpp @@ -0,0 +1,84 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +GeomConvexHullPhysicalFunction::GeomConvexHullPhysicalFunction(PhysicalFunction wkt) +{ + paramFns.reserve(1); + paramFns.push_back(std::move(wkt)); +} + +VarVal GeomConvexHullPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto wkt = paramFns[0].execute(record, arena).cast(); + constexpr uint32_t MAX_LEN = 8192; + auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); + + const auto actualLen = nautilus::invoke( + +[](const char* wkt, uint32_t wsz, char* buf, uint32_t bufMax) -> uint32_t { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string s(wkt, wsz); + GSERIALIZED* gs = geom_in(s.c_str(), -1); + if (!gs) return 0u; + GSERIALIZED* result = geom_convex_hull(gs); + free(gs); + if (!result) return 0u; + char* out = geo_as_text(result, -1); + free(result); + if (!out) return 0u; + uint32_t len = static_cast(strlen(out)); + if (len > bufMax) len = bufMax; + memcpy(buf, out, len); + free(out); + return len; + } catch (const std::exception&) { return 0u; } + }, + wkt, outBuf.getContent(), nautilus::val(8192)); + + VarVal(actualLen).writeToMemory(outBuf.getReference()); + return outBuf; +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterGeomConvexHullPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 1, + "GeomConvexHullPhysicalFunction requires 1 children but got {}", + arguments.childFunctions.size()); + return GeomConvexHullPhysicalFunction( + std::move(arguments.childFunctions[0])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/GeomUnaryUnionPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeomUnaryUnionPhysicalFunction.cpp new file mode 100644 index 0000000000..bfc68105ce --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/GeomUnaryUnionPhysicalFunction.cpp @@ -0,0 +1,84 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +GeomUnaryUnionPhysicalFunction::GeomUnaryUnionPhysicalFunction(PhysicalFunction wkt) +{ + paramFns.reserve(1); + paramFns.push_back(std::move(wkt)); +} + +VarVal GeomUnaryUnionPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto wkt = paramFns[0].execute(record, arena).cast(); + constexpr uint32_t MAX_LEN = 8192; + auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); + + const auto actualLen = nautilus::invoke( + +[](const char* wkt, uint32_t wsz, char* buf, uint32_t bufMax) -> uint32_t { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string s(wkt, wsz); + GSERIALIZED* gs = geom_in(s.c_str(), -1); + if (!gs) return 0u; + GSERIALIZED* result = geom_unary_union(gs, 0.0); + free(gs); + if (!result) return 0u; + char* out = geo_as_text(result, -1); + free(result); + if (!out) return 0u; + uint32_t len = static_cast(strlen(out)); + if (len > bufMax) len = bufMax; + memcpy(buf, out, len); + free(out); + return len; + } catch (const std::exception&) { return 0u; } + }, + wkt, outBuf.getContent(), nautilus::val(8192)); + + VarVal(actualLen).writeToMemory(outBuf.getReference()); + return outBuf; +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterGeomUnaryUnionPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 1, + "GeomUnaryUnionPhysicalFunction requires 1 children but got {}", + arguments.childFunctions.size()); + return GeomUnaryUnionPhysicalFunction( + std::move(arguments.childFunctions[0])); +} + +} // namespace NES diff --git a/nes-sql-parser/AntlrSQL.g4 b/nes-sql-parser/AntlrSQL.g4 index 00a5e0ed76..2015773c7d 100644 --- a/nes-sql-parser/AntlrSQL.g4 +++ b/nes-sql-parser/AntlrSQL.g4 @@ -295,7 +295,7 @@ timeUnit: MS timestampParameter: name=identifier; -functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT | TGE_TTEXT_TEXT | TGE_TEXT_TTEXT | TGT_TTEXT_TEXT | TGT_TEXT_TTEXT | TLE_TTEXT_TEXT | TLE_TEXT_TTEXT | TLT_TTEXT_TEXT | TLT_TEXT_TTEXT | TTEXT_UPPER | TTEXT_LOWER | TTEXT_INITCAP | TEXTCAT_TTEXT_TEXT | TEXTCAT_TEXT_TTEXT | TEXTCAT_TTEXT_TTEXT | GEOM_LENGTH | GEOM_PERIMETER | GEOM_AZIMUTH | GEOG_AREA | GEOG_LENGTH | GEOG_PERIMETER | GEOM_IS_EMPTY | AINTERSECTS_TGEO_GEO | ACOVERS_TGEO_GEO | ADISJOINT_TGEO_GEO | ADWITHIN_TGEO_GEO | EINTERSECTS_TGEO_GEO | ETOUCHES_TGEO_GEO | ECONTAINS_TGEO_GEO | ACONTAINS_TGEO_GEO | ATOUCHES_TGEO_GEO | GEO_NUM_POINTS | GEO_NUM_GEOS | GEO_SRID | GEO_IS_UNITARY | GEO_EQUALS | GEO_SAME | GEOG_DISTANCE | NAD_TGEO_GEO | EVER_EQ_TGEO_GEO | EVER_NE_TGEO_GEO | ALWAYS_EQ_TGEO_GEO | ALWAYS_NE_TGEO_GEO | GEOG_INTERSECTS | GEOG_DWITHIN | ACOVERS_GEO_TGEO | GEOM_INTERSECTS | GEOM_DWITHIN | H3_GS_POINT_TO_CELL | EVER_EQ_TH3INDEX_H3INDEX | EVER_NE_TH3INDEX_H3INDEX | ALWAYS_EQ_TH3INDEX_H3INDEX | ALWAYS_NE_TH3INDEX_H3INDEX | TH3INDEX_GET_RESOLUTION | TH3INDEX_GET_BASE_CELL_NUMBER | TH3INDEX_IS_VALID_CELL | TH3INDEX_IS_PENTAGON | TH3INDEX_CELL_TO_PARENT_NEXT | TH3INDEX_CELL_TO_CENTER_CHILD_NEXT | TH3INDEX_CELL_TO_PARENT | TH3INDEX_CELL_TO_CENTER_CHILD | TH3INDEX_CELL_TO_CHILD_POS | TH3INDEX_ARE_NEIGHBOR_CELLS | TH3INDEX_GRID_DISTANCE | EINTERSECTS_TCBUFFER_GEO | AINTERSECTS_TCBUFFER_GEO | ECOVERS_TCBUFFER_GEO | ACOVERS_TCBUFFER_GEO | EDISJOINT_TCBUFFER_GEO | ADISJOINT_TCBUFFER_GEO | ETOUCHES_TCBUFFER_GEO | ATOUCHES_TCBUFFER_GEO | ECONTAINS_TCBUFFER_GEO | ACONTAINS_TCBUFFER_GEO | NAD_TCBUFFER_GEO | EDWITHIN_TCBUFFER_GEO | ADWITHIN_TCBUFFER_GEO | EINTERSECTS_TCBUFFER_CBUFFER | AINTERSECTS_TCBUFFER_CBUFFER | ECOVERS_TCBUFFER_CBUFFER | ACOVERS_TCBUFFER_CBUFFER | EDISJOINT_TCBUFFER_CBUFFER | ADISJOINT_TCBUFFER_CBUFFER | ETOUCHES_TCBUFFER_CBUFFER | ATOUCHES_TCBUFFER_CBUFFER | ECONTAINS_TCBUFFER_CBUFFER | ACONTAINS_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_CBUFFER | ALWAYS_EQ_TCBUFFER_CBUFFER | EVER_NE_TCBUFFER_CBUFFER | ALWAYS_NE_TCBUFFER_CBUFFER | NAD_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_TCBUFFER | ALWAYS_EQ_TCBUFFER_TCBUFFER | EVER_NE_TCBUFFER_TCBUFFER | ALWAYS_NE_TCBUFFER_TCBUFFER | EINTERSECTS_TCBUFFER_TCBUFFER | AINTERSECTS_TCBUFFER_TCBUFFER | ECOVERS_TCBUFFER_TCBUFFER | ACOVERS_TCBUFFER_TCBUFFER | ADISJOINT_TCBUFFER_TCBUFFER | ETOUCHES_TCBUFFER_TCBUFFER | ATOUCHES_TCBUFFER_TCBUFFER | NAD_TCBUFFER_TCBUFFER | EDWITHIN_TCBUFFER_TCBUFFER | ADWITHIN_TCBUFFER_TCBUFFER | MINDISTANCE_TCBUFFER_TCBUFFER | NAD_TNPOINT_GEO | EVER_EQ_TNPOINT_NPOINT | ALWAYS_EQ_TNPOINT_NPOINT | EVER_NE_TNPOINT_NPOINT | ALWAYS_NE_TNPOINT_NPOINT | NAD_TNPOINT_NPOINT | EVER_EQ_NPOINT_TNPOINT | ALWAYS_EQ_NPOINT_TNPOINT | EVER_NE_NPOINT_TNPOINT | ALWAYS_NE_NPOINT_TNPOINT | EVER_EQ_TNPOINT_TNPOINT | ALWAYS_EQ_TNPOINT_TNPOINT | EVER_NE_TNPOINT_TNPOINT | ALWAYS_NE_TNPOINT_TNPOINT | NAD_TNPOINT_TNPOINT | NAD_TPOSE_GEO | EVER_EQ_TPOSE_POSE | ALWAYS_EQ_TPOSE_POSE | EVER_NE_TPOSE_POSE | ALWAYS_NE_TPOSE_POSE | NAD_TPOSE_POSE | EVER_EQ_POSE_TPOSE | ALWAYS_EQ_POSE_TPOSE | EVER_NE_POSE_TPOSE | ALWAYS_NE_POSE_TPOSE | EVER_EQ_TPOSE_TPOSE | ALWAYS_EQ_TPOSE_TPOSE | EVER_NE_TPOSE_TPOSE | ALWAYS_NE_TPOSE_TPOSE | NAD_TPOSE_TPOSE | EVER_EQ_TRGEOMETRY_GEO | ALWAYS_EQ_TRGEOMETRY_GEO | EVER_NE_TRGEOMETRY_GEO | ALWAYS_NE_TRGEOMETRY_GEO | NAD_TRGEOMETRY_GEO | EVER_EQ_GEO_TRGEOMETRY | ALWAYS_EQ_GEO_TRGEOMETRY | EVER_NE_GEO_TRGEOMETRY | ALWAYS_NE_GEO_TRGEOMETRY | EVER_EQ_TRGEOMETRY_TRGEOMETRY | ALWAYS_EQ_TRGEOMETRY_TRGEOMETRY | EVER_NE_TRGEOMETRY_TRGEOMETRY | ALWAYS_NE_TRGEOMETRY_TRGEOMETRY | NAD_TRGEOMETRY_TRGEOMETRY | EINTERSECTS_TPCPOINT_GEO | NAD_TPCPOINT_GEO | QUADBIN_POINT_TO_CELL | QUADBIN_IS_VALID_CELL | QUADBIN_GET_RESOLUTION | QUADBIN_CELL_AREA | QUADBIN_CELL_TO_QUADKEY | QUADBIN_CELL_TO_PARENT | QUADBIN_TILE_TO_CELL | EVER_EQ_TJSONB_JSONB | ALWAYS_EQ_TJSONB_JSONB | EVER_NE_TJSONB_JSONB | ALWAYS_NE_TJSONB_JSONB | EVER_EQ_TJSONB_TJSONB | ALWAYS_EQ_TJSONB_TJSONB | EVER_NE_TJSONB_TJSONB | ALWAYS_NE_TJSONB_TJSONB | GEOM_INTERSECTS2D | GEOM_DWITHIN2D | GEOM_CONTAINS | GEOM_DISJOINT2D | GEOM_COVERS | GEOM_TOUCHES | GEOM_INTERSECTS3D | GEOM_DWITHIN3D | GEOM_DISTANCE2D | GEOM_DISTANCE3D; +functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT | TGE_TTEXT_TEXT | TGE_TEXT_TTEXT | TGT_TTEXT_TEXT | TGT_TEXT_TTEXT | TLE_TTEXT_TEXT | TLE_TEXT_TTEXT | TLT_TTEXT_TEXT | TLT_TEXT_TTEXT | TTEXT_UPPER | TTEXT_LOWER | TTEXT_INITCAP | TEXTCAT_TTEXT_TEXT | TEXTCAT_TEXT_TTEXT | TEXTCAT_TTEXT_TTEXT | GEOM_LENGTH | GEOM_PERIMETER | GEOM_AZIMUTH | GEOG_AREA | GEOG_LENGTH | GEOG_PERIMETER | GEOM_IS_EMPTY | AINTERSECTS_TGEO_GEO | ACOVERS_TGEO_GEO | ADISJOINT_TGEO_GEO | ADWITHIN_TGEO_GEO | EINTERSECTS_TGEO_GEO | ETOUCHES_TGEO_GEO | ECONTAINS_TGEO_GEO | ACONTAINS_TGEO_GEO | ATOUCHES_TGEO_GEO | GEO_NUM_POINTS | GEO_NUM_GEOS | GEO_SRID | GEO_IS_UNITARY | GEO_EQUALS | GEO_SAME | GEOG_DISTANCE | NAD_TGEO_GEO | EVER_EQ_TGEO_GEO | EVER_NE_TGEO_GEO | ALWAYS_EQ_TGEO_GEO | ALWAYS_NE_TGEO_GEO | GEOG_INTERSECTS | GEOG_DWITHIN | ACOVERS_GEO_TGEO | GEOM_INTERSECTS | GEOM_DWITHIN | H3_GS_POINT_TO_CELL | EVER_EQ_TH3INDEX_H3INDEX | EVER_NE_TH3INDEX_H3INDEX | ALWAYS_EQ_TH3INDEX_H3INDEX | ALWAYS_NE_TH3INDEX_H3INDEX | TH3INDEX_GET_RESOLUTION | TH3INDEX_GET_BASE_CELL_NUMBER | TH3INDEX_IS_VALID_CELL | TH3INDEX_IS_PENTAGON | TH3INDEX_CELL_TO_PARENT_NEXT | TH3INDEX_CELL_TO_CENTER_CHILD_NEXT | TH3INDEX_CELL_TO_PARENT | TH3INDEX_CELL_TO_CENTER_CHILD | TH3INDEX_CELL_TO_CHILD_POS | TH3INDEX_ARE_NEIGHBOR_CELLS | TH3INDEX_GRID_DISTANCE | EINTERSECTS_TCBUFFER_GEO | AINTERSECTS_TCBUFFER_GEO | ECOVERS_TCBUFFER_GEO | ACOVERS_TCBUFFER_GEO | EDISJOINT_TCBUFFER_GEO | ADISJOINT_TCBUFFER_GEO | ETOUCHES_TCBUFFER_GEO | ATOUCHES_TCBUFFER_GEO | ECONTAINS_TCBUFFER_GEO | ACONTAINS_TCBUFFER_GEO | NAD_TCBUFFER_GEO | EDWITHIN_TCBUFFER_GEO | ADWITHIN_TCBUFFER_GEO | EINTERSECTS_TCBUFFER_CBUFFER | AINTERSECTS_TCBUFFER_CBUFFER | ECOVERS_TCBUFFER_CBUFFER | ACOVERS_TCBUFFER_CBUFFER | EDISJOINT_TCBUFFER_CBUFFER | ADISJOINT_TCBUFFER_CBUFFER | ETOUCHES_TCBUFFER_CBUFFER | ATOUCHES_TCBUFFER_CBUFFER | ECONTAINS_TCBUFFER_CBUFFER | ACONTAINS_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_CBUFFER | ALWAYS_EQ_TCBUFFER_CBUFFER | EVER_NE_TCBUFFER_CBUFFER | ALWAYS_NE_TCBUFFER_CBUFFER | NAD_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_TCBUFFER | ALWAYS_EQ_TCBUFFER_TCBUFFER | EVER_NE_TCBUFFER_TCBUFFER | ALWAYS_NE_TCBUFFER_TCBUFFER | EINTERSECTS_TCBUFFER_TCBUFFER | AINTERSECTS_TCBUFFER_TCBUFFER | ECOVERS_TCBUFFER_TCBUFFER | ACOVERS_TCBUFFER_TCBUFFER | ADISJOINT_TCBUFFER_TCBUFFER | ETOUCHES_TCBUFFER_TCBUFFER | ATOUCHES_TCBUFFER_TCBUFFER | NAD_TCBUFFER_TCBUFFER | EDWITHIN_TCBUFFER_TCBUFFER | ADWITHIN_TCBUFFER_TCBUFFER | MINDISTANCE_TCBUFFER_TCBUFFER | NAD_TNPOINT_GEO | EVER_EQ_TNPOINT_NPOINT | ALWAYS_EQ_TNPOINT_NPOINT | EVER_NE_TNPOINT_NPOINT | ALWAYS_NE_TNPOINT_NPOINT | NAD_TNPOINT_NPOINT | EVER_EQ_NPOINT_TNPOINT | ALWAYS_EQ_NPOINT_TNPOINT | EVER_NE_NPOINT_TNPOINT | ALWAYS_NE_NPOINT_TNPOINT | EVER_EQ_TNPOINT_TNPOINT | ALWAYS_EQ_TNPOINT_TNPOINT | EVER_NE_TNPOINT_TNPOINT | ALWAYS_NE_TNPOINT_TNPOINT | NAD_TNPOINT_TNPOINT | NAD_TPOSE_GEO | EVER_EQ_TPOSE_POSE | ALWAYS_EQ_TPOSE_POSE | EVER_NE_TPOSE_POSE | ALWAYS_NE_TPOSE_POSE | NAD_TPOSE_POSE | EVER_EQ_POSE_TPOSE | ALWAYS_EQ_POSE_TPOSE | EVER_NE_POSE_TPOSE | ALWAYS_NE_POSE_TPOSE | EVER_EQ_TPOSE_TPOSE | ALWAYS_EQ_TPOSE_TPOSE | EVER_NE_TPOSE_TPOSE | ALWAYS_NE_TPOSE_TPOSE | NAD_TPOSE_TPOSE | EVER_EQ_TRGEOMETRY_GEO | ALWAYS_EQ_TRGEOMETRY_GEO | EVER_NE_TRGEOMETRY_GEO | ALWAYS_NE_TRGEOMETRY_GEO | NAD_TRGEOMETRY_GEO | EVER_EQ_GEO_TRGEOMETRY | ALWAYS_EQ_GEO_TRGEOMETRY | EVER_NE_GEO_TRGEOMETRY | ALWAYS_NE_GEO_TRGEOMETRY | EVER_EQ_TRGEOMETRY_TRGEOMETRY | ALWAYS_EQ_TRGEOMETRY_TRGEOMETRY | EVER_NE_TRGEOMETRY_TRGEOMETRY | ALWAYS_NE_TRGEOMETRY_TRGEOMETRY | NAD_TRGEOMETRY_TRGEOMETRY | EINTERSECTS_TPCPOINT_GEO | NAD_TPCPOINT_GEO | QUADBIN_POINT_TO_CELL | QUADBIN_IS_VALID_CELL | QUADBIN_GET_RESOLUTION | QUADBIN_CELL_AREA | QUADBIN_CELL_TO_QUADKEY | QUADBIN_CELL_TO_PARENT | QUADBIN_TILE_TO_CELL | EVER_EQ_TJSONB_JSONB | ALWAYS_EQ_TJSONB_JSONB | EVER_NE_TJSONB_JSONB | ALWAYS_NE_TJSONB_JSONB | EVER_EQ_TJSONB_TJSONB | ALWAYS_EQ_TJSONB_TJSONB | EVER_NE_TJSONB_TJSONB | ALWAYS_NE_TJSONB_TJSONB | GEOM_BOUNDARY | GEOM_CENTROID | GEOM_CONVEX_HULL | GEO_REVERSE | GEO_POINTS | GEOM_UNARY_UNION | GEOM_INTERSECTS2D | GEOM_DWITHIN2D | GEOM_CONTAINS | GEOM_DISJOINT2D | GEOM_COVERS | GEOM_TOUCHES | GEOM_INTERSECTS3D | GEOM_DWITHIN3D | GEOM_DISTANCE2D | GEOM_DISTANCE3D; sinkClause: INTO sink (',' sink)*; @@ -911,6 +911,12 @@ EVER_EQ_TJSONB_TJSONB: 'EVER_EQ_TJSONB_TJSONB' | 'ever_eq_tjsonb_tjsonb'; ALWAYS_EQ_TJSONB_TJSONB: 'ALWAYS_EQ_TJSONB_TJSONB' | 'always_eq_tjsonb_tjsonb'; EVER_NE_TJSONB_TJSONB: 'EVER_NE_TJSONB_TJSONB' | 'ever_ne_tjsonb_tjsonb'; ALWAYS_NE_TJSONB_TJSONB: 'ALWAYS_NE_TJSONB_TJSONB' | 'always_ne_tjsonb_tjsonb'; +GEOM_BOUNDARY: 'GEOM_BOUNDARY' | 'geom_boundary'; +GEOM_CENTROID: 'GEOM_CENTROID' | 'geom_centroid'; +GEOM_CONVEX_HULL: 'GEOM_CONVEX_HULL' | 'geom_convex_hull'; +GEO_REVERSE: 'GEO_REVERSE' | 'geo_reverse'; +GEO_POINTS: 'GEO_POINTS' | 'geo_points'; +GEOM_UNARY_UNION: 'GEOM_UNARY_UNION' | 'geom_unary_union'; GEOM_INTERSECTS2D: 'GEOM_INTERSECTS2D' | 'geom_intersects2d'; GEOM_DWITHIN2D: 'GEOM_DWITHIN2D' | 'geom_dwithin2d'; GEOM_CONTAINS: 'GEOM_CONTAINS' | 'geom_contains'; diff --git a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp index dd8d05c0f6..26a8e82191 100644 --- a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp +++ b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp @@ -492,6 +492,12 @@ #include #include #include +#include +#include +#include +#include +#include +#include #include #include #include @@ -10758,6 +10764,54 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont return LogicalFunction(AlwaysNeTjsonbTjsonbLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3))); } /* END CODEGEN PARSER GLUE: ALWAYS_NE_TJSONB_TJSONB */ + case AntlrSQLParser::GEOM_BOUNDARY: { + PRECONDITION(ctx->functionParam().size() == 1, + "GeomBoundary requires 1 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + return LogicalFunction(GeomBoundaryLogicalFunction(std::move(arg0))); + } + /* END CODEGEN PARSER GLUE: GEOM_BOUNDARY */ + case AntlrSQLParser::GEOM_CENTROID: { + PRECONDITION(ctx->functionParam().size() == 1, + "GeomCentroid requires 1 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + return LogicalFunction(GeomCentroidLogicalFunction(std::move(arg0))); + } + /* END CODEGEN PARSER GLUE: GEOM_CENTROID */ + case AntlrSQLParser::GEOM_CONVEX_HULL: { + PRECONDITION(ctx->functionParam().size() == 1, + "GeomConvexHull requires 1 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + return LogicalFunction(GeomConvexHullLogicalFunction(std::move(arg0))); + } + /* END CODEGEN PARSER GLUE: GEOM_CONVEX_HULL */ + case AntlrSQLParser::GEO_REVERSE: { + PRECONDITION(ctx->functionParam().size() == 1, + "GeoReverse requires 1 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + return LogicalFunction(GeoReverseLogicalFunction(std::move(arg0))); + } + /* END CODEGEN PARSER GLUE: GEO_REVERSE */ + case AntlrSQLParser::GEO_POINTS: { + PRECONDITION(ctx->functionParam().size() == 1, + "GeoPoints requires 1 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + return LogicalFunction(GeoPointsLogicalFunction(std::move(arg0))); + } + /* END CODEGEN PARSER GLUE: GEO_POINTS */ + case AntlrSQLParser::GEOM_UNARY_UNION: { + PRECONDITION(ctx->functionParam().size() == 1, + "GeomUnaryUnion requires 1 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + return LogicalFunction(GeomUnaryUnionLogicalFunction(std::move(arg0))); + } + /* END CODEGEN PARSER GLUE: GEOM_UNARY_UNION */ /* END CODEGEN PARSER GLUE: GEOM_INTERSECTS2D */ case AntlrSQLParser::GEOM_DWITHIN2D: { PRECONDITION(ctx->functionParam().size() == 3, From 4ff9701f0318e86d240b698d0b9d43582d4d5892 Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Mon, 15 Jun 2026 20:17:34 +0200 Subject: [PATCH 77/96] feat(meos): add binary geometry set operation NES operators returning 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. --- .../Meos/GeomDifference2dLogicalFunction.hpp | 48 +++++++++ .../GeomIntersection2dLogicalFunction.hpp | 48 +++++++++ .../GeomShortestline2dLogicalFunction.hpp | 48 +++++++++ .../GeomShortestline3dLogicalFunction.hpp | 48 +++++++++ .../src/Functions/Meos/CMakeLists.txt | 4 + .../Meos/GeomDifference2dLogicalFunction.cpp | 99 +++++++++++++++++++ .../GeomIntersection2dLogicalFunction.cpp | 99 +++++++++++++++++++ .../GeomShortestline2dLogicalFunction.cpp | 99 +++++++++++++++++++ .../GeomShortestline3dLogicalFunction.cpp | 99 +++++++++++++++++++ .../Meos/GeomDifference2dPhysicalFunction.hpp | 32 ++++++ .../GeomIntersection2dPhysicalFunction.hpp | 32 ++++++ .../GeomShortestline2dPhysicalFunction.hpp | 32 ++++++ .../GeomShortestline3dPhysicalFunction.hpp | 32 ++++++ .../src/Functions/Meos/CMakeLists.txt | 4 + .../Meos/GeomDifference2dPhysicalFunction.cpp | 90 +++++++++++++++++ .../GeomIntersection2dPhysicalFunction.cpp | 90 +++++++++++++++++ .../GeomShortestline2dPhysicalFunction.cpp | 90 +++++++++++++++++ .../GeomShortestline3dPhysicalFunction.cpp | 90 +++++++++++++++++ nes-sql-parser/AntlrSQL.g4 | 6 +- .../src/AntlrSQLQueryPlanCreator.cpp | 40 ++++++++ 20 files changed, 1129 insertions(+), 1 deletion(-) create mode 100644 nes-logical-operators/include/Functions/Meos/GeomDifference2dLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/GeomIntersection2dLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/GeomShortestline2dLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/GeomShortestline3dLogicalFunction.hpp create mode 100644 nes-logical-operators/src/Functions/Meos/GeomDifference2dLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/GeomIntersection2dLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/GeomShortestline2dLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/GeomShortestline3dLogicalFunction.cpp create mode 100644 nes-physical-operators/include/Functions/Meos/GeomDifference2dPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/GeomIntersection2dPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/GeomShortestline2dPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/GeomShortestline3dPhysicalFunction.hpp create mode 100644 nes-physical-operators/src/Functions/Meos/GeomDifference2dPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/GeomIntersection2dPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/GeomShortestline2dPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/GeomShortestline3dPhysicalFunction.cpp diff --git a/nes-logical-operators/include/Functions/Meos/GeomDifference2dLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeomDifference2dLogicalFunction.hpp new file mode 100644 index 0000000000..49f8582d56 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/GeomDifference2dLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns the geometric difference of two geometries as WKT. + */ +class GeomDifference2dLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "GeomDifference2d"; + + GeomDifference2dLogicalFunction(LogicalFunction wkt1, LogicalFunction wkt2); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/GeomIntersection2dLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeomIntersection2dLogicalFunction.hpp new file mode 100644 index 0000000000..90e577a923 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/GeomIntersection2dLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns the geometric intersection of two geometries as WKT. + */ +class GeomIntersection2dLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "GeomIntersection2d"; + + GeomIntersection2dLogicalFunction(LogicalFunction wkt1, LogicalFunction wkt2); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/GeomShortestline2dLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeomShortestline2dLogicalFunction.hpp new file mode 100644 index 0000000000..8c8e93a69b --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/GeomShortestline2dLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns the shortest 2D line between two geometries as WKT. + */ +class GeomShortestline2dLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "GeomShortestline2d"; + + GeomShortestline2dLogicalFunction(LogicalFunction wkt1, LogicalFunction wkt2); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/GeomShortestline3dLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeomShortestline3dLogicalFunction.hpp new file mode 100644 index 0000000000..8501c2783f --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/GeomShortestline3dLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns the shortest 3D line between two geometries as WKT. + */ +class GeomShortestline3dLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "GeomShortestline3d"; + + GeomShortestline3dLogicalFunction(LogicalFunction wkt1, LogicalFunction wkt2); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt index 4640cb63ed..fa52006a97 100644 --- a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt @@ -447,6 +447,10 @@ add_plugin(GeomConvexHull LogicalFunction nes-logical-operators GeomConvexHullLo add_plugin(GeoReverse LogicalFunction nes-logical-operators GeoReverseLogicalFunction.cpp) add_plugin(GeoPoints LogicalFunction nes-logical-operators GeoPointsLogicalFunction.cpp) add_plugin(GeomUnaryUnion LogicalFunction nes-logical-operators GeomUnaryUnionLogicalFunction.cpp) +add_plugin(GeomDifference2d LogicalFunction nes-logical-operators GeomDifference2dLogicalFunction.cpp) +add_plugin(GeomIntersection2d LogicalFunction nes-logical-operators GeomIntersection2dLogicalFunction.cpp) +add_plugin(GeomShortestline2d LogicalFunction nes-logical-operators GeomShortestline2dLogicalFunction.cpp) +add_plugin(GeomShortestline3d LogicalFunction nes-logical-operators GeomShortestline3dLogicalFunction.cpp) add_plugin(GeomIntersects2d LogicalFunction nes-logical-operators GeomIntersects2dLogicalFunction.cpp) add_plugin(GeomDwithin2d LogicalFunction nes-logical-operators GeomDwithin2dLogicalFunction.cpp) add_plugin(GeomContains LogicalFunction nes-logical-operators GeomContainsLogicalFunction.cpp) diff --git a/nes-logical-operators/src/Functions/Meos/GeomDifference2dLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeomDifference2dLogicalFunction.cpp new file mode 100644 index 0000000000..8637060821 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/GeomDifference2dLogicalFunction.cpp @@ -0,0 +1,99 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +GeomDifference2dLogicalFunction::GeomDifference2dLogicalFunction(LogicalFunction wkt1, LogicalFunction wkt2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::VARSIZED)) +{ + parameters.reserve(2); + parameters.push_back(std::move(wkt1)); + parameters.push_back(std::move(wkt2)); +} + +DataType GeomDifference2dLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction GeomDifference2dLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector GeomDifference2dLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction GeomDifference2dLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 2, + "GeomDifference2dLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view GeomDifference2dLogicalFunction::getType() const { return NAME; } + +bool GeomDifference2dLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string GeomDifference2dLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction GeomDifference2dLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(2); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "wkt1 must be VARSIZED"); + INVARIANT(c[1].getDataType().isType(DataType::Type::VARSIZED), "wkt2 must be VARSIZED"); + return withChildren(c); +} + +SerializableFunction GeomDifference2dLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeomDifference2dLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 2, + "GeomDifference2dLogicalFunction requires 2 children but got {}", + arguments.children.size()); + return GeomDifference2dLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/GeomIntersection2dLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeomIntersection2dLogicalFunction.cpp new file mode 100644 index 0000000000..905e630f09 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/GeomIntersection2dLogicalFunction.cpp @@ -0,0 +1,99 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +GeomIntersection2dLogicalFunction::GeomIntersection2dLogicalFunction(LogicalFunction wkt1, LogicalFunction wkt2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::VARSIZED)) +{ + parameters.reserve(2); + parameters.push_back(std::move(wkt1)); + parameters.push_back(std::move(wkt2)); +} + +DataType GeomIntersection2dLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction GeomIntersection2dLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector GeomIntersection2dLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction GeomIntersection2dLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 2, + "GeomIntersection2dLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view GeomIntersection2dLogicalFunction::getType() const { return NAME; } + +bool GeomIntersection2dLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string GeomIntersection2dLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction GeomIntersection2dLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(2); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "wkt1 must be VARSIZED"); + INVARIANT(c[1].getDataType().isType(DataType::Type::VARSIZED), "wkt2 must be VARSIZED"); + return withChildren(c); +} + +SerializableFunction GeomIntersection2dLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeomIntersection2dLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 2, + "GeomIntersection2dLogicalFunction requires 2 children but got {}", + arguments.children.size()); + return GeomIntersection2dLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/GeomShortestline2dLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeomShortestline2dLogicalFunction.cpp new file mode 100644 index 0000000000..4bbbba645f --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/GeomShortestline2dLogicalFunction.cpp @@ -0,0 +1,99 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +GeomShortestline2dLogicalFunction::GeomShortestline2dLogicalFunction(LogicalFunction wkt1, LogicalFunction wkt2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::VARSIZED)) +{ + parameters.reserve(2); + parameters.push_back(std::move(wkt1)); + parameters.push_back(std::move(wkt2)); +} + +DataType GeomShortestline2dLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction GeomShortestline2dLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector GeomShortestline2dLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction GeomShortestline2dLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 2, + "GeomShortestline2dLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view GeomShortestline2dLogicalFunction::getType() const { return NAME; } + +bool GeomShortestline2dLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string GeomShortestline2dLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction GeomShortestline2dLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(2); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "wkt1 must be VARSIZED"); + INVARIANT(c[1].getDataType().isType(DataType::Type::VARSIZED), "wkt2 must be VARSIZED"); + return withChildren(c); +} + +SerializableFunction GeomShortestline2dLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeomShortestline2dLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 2, + "GeomShortestline2dLogicalFunction requires 2 children but got {}", + arguments.children.size()); + return GeomShortestline2dLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/GeomShortestline3dLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeomShortestline3dLogicalFunction.cpp new file mode 100644 index 0000000000..83d24813e8 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/GeomShortestline3dLogicalFunction.cpp @@ -0,0 +1,99 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +GeomShortestline3dLogicalFunction::GeomShortestline3dLogicalFunction(LogicalFunction wkt1, LogicalFunction wkt2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::VARSIZED)) +{ + parameters.reserve(2); + parameters.push_back(std::move(wkt1)); + parameters.push_back(std::move(wkt2)); +} + +DataType GeomShortestline3dLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction GeomShortestline3dLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector GeomShortestline3dLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction GeomShortestline3dLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 2, + "GeomShortestline3dLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view GeomShortestline3dLogicalFunction::getType() const { return NAME; } + +bool GeomShortestline3dLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string GeomShortestline3dLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction GeomShortestline3dLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(2); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "wkt1 must be VARSIZED"); + INVARIANT(c[1].getDataType().isType(DataType::Type::VARSIZED), "wkt2 must be VARSIZED"); + return withChildren(c); +} + +SerializableFunction GeomShortestline3dLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeomShortestline3dLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 2, + "GeomShortestline3dLogicalFunction requires 2 children but got {}", + arguments.children.size()); + return GeomShortestline3dLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1])); +} + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeomDifference2dPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeomDifference2dPhysicalFunction.hpp new file mode 100644 index 0000000000..4e5ebac981 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/GeomDifference2dPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class GeomDifference2dPhysicalFunction : public PhysicalFunctionConcept { +public: + GeomDifference2dPhysicalFunction(PhysicalFunction wkt1, PhysicalFunction wkt2); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeomIntersection2dPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeomIntersection2dPhysicalFunction.hpp new file mode 100644 index 0000000000..80cee17fa6 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/GeomIntersection2dPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class GeomIntersection2dPhysicalFunction : public PhysicalFunctionConcept { +public: + GeomIntersection2dPhysicalFunction(PhysicalFunction wkt1, PhysicalFunction wkt2); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeomShortestline2dPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeomShortestline2dPhysicalFunction.hpp new file mode 100644 index 0000000000..a7bf75d20f --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/GeomShortestline2dPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class GeomShortestline2dPhysicalFunction : public PhysicalFunctionConcept { +public: + GeomShortestline2dPhysicalFunction(PhysicalFunction wkt1, PhysicalFunction wkt2); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeomShortestline3dPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeomShortestline3dPhysicalFunction.hpp new file mode 100644 index 0000000000..ffc731f5d2 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/GeomShortestline3dPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class GeomShortestline3dPhysicalFunction : public PhysicalFunctionConcept { +public: + GeomShortestline3dPhysicalFunction(PhysicalFunction wkt1, PhysicalFunction wkt2); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt index 2379ee5bc1..c6aede88f6 100644 --- a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt @@ -446,6 +446,10 @@ add_plugin(GeomConvexHull PhysicalFunction nes-physical-operators GeomConvexHull add_plugin(GeoReverse PhysicalFunction nes-physical-operators GeoReversePhysicalFunction.cpp) add_plugin(GeoPoints PhysicalFunction nes-physical-operators GeoPointsPhysicalFunction.cpp) add_plugin(GeomUnaryUnion PhysicalFunction nes-physical-operators GeomUnaryUnionPhysicalFunction.cpp) +add_plugin(GeomDifference2d PhysicalFunction nes-physical-operators GeomDifference2dPhysicalFunction.cpp) +add_plugin(GeomIntersection2d PhysicalFunction nes-physical-operators GeomIntersection2dPhysicalFunction.cpp) +add_plugin(GeomShortestline2d PhysicalFunction nes-physical-operators GeomShortestline2dPhysicalFunction.cpp) +add_plugin(GeomShortestline3d PhysicalFunction nes-physical-operators GeomShortestline3dPhysicalFunction.cpp) add_plugin(GeomIntersects2d PhysicalFunction nes-physical-operators GeomIntersects2dPhysicalFunction.cpp) add_plugin(GeomDwithin2d PhysicalFunction nes-physical-operators GeomDwithin2dPhysicalFunction.cpp) add_plugin(GeomContains PhysicalFunction nes-physical-operators GeomContainsPhysicalFunction.cpp) diff --git a/nes-physical-operators/src/Functions/Meos/GeomDifference2dPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeomDifference2dPhysicalFunction.cpp new file mode 100644 index 0000000000..dbc64686f2 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/GeomDifference2dPhysicalFunction.cpp @@ -0,0 +1,90 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +GeomDifference2dPhysicalFunction::GeomDifference2dPhysicalFunction(PhysicalFunction wkt1, PhysicalFunction wkt2) +{ + paramFns.reserve(2); + paramFns.push_back(std::move(wkt1)); + paramFns.push_back(std::move(wkt2)); +} + +VarVal GeomDifference2dPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto wkt1 = paramFns[0].execute(record, arena).cast(); + auto wkt2 = paramFns[1].execute(record, arena).cast(); + + constexpr uint32_t MAX_LEN = 8192; + auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); + + const auto actualLen = nautilus::invoke( + +[](const char* w1, uint32_t w1sz, const char* w2, uint32_t w2sz, char* buf, uint32_t bufMax) -> uint32_t { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string s1(w1, w1sz), s2(w2, w2sz); + GSERIALIZED* gs1 = geom_in(s1.c_str(), -1); + if (!gs1) return 0u; + GSERIALIZED* gs2 = geom_in(s2.c_str(), -1); + if (!gs2) { free(gs1); return 0u; } + GSERIALIZED* result = geom_difference2d(gs1, gs2); + free(gs1); free(gs2); + if (!result) return 0u; + char* out = geo_as_text(result, -1); + free(result); + if (!out) return 0u; + uint32_t len = static_cast(strlen(out)); + if (len > bufMax) len = bufMax; + memcpy(buf, out, len); + free(out); + return len; + } catch (const std::exception&) { return 0u; } + }, + wkt1, wkt2, outBuf.getContent(), nautilus::val(MAX_LEN)); + + VarVal(actualLen).writeToMemory(outBuf.getReference()); + return outBuf; +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterGeomDifference2dPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 2, + "GeomDifference2dPhysicalFunction requires 2 children but got {}", + arguments.childFunctions.size()); + return GeomDifference2dPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/GeomIntersection2dPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeomIntersection2dPhysicalFunction.cpp new file mode 100644 index 0000000000..574fad5631 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/GeomIntersection2dPhysicalFunction.cpp @@ -0,0 +1,90 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +GeomIntersection2dPhysicalFunction::GeomIntersection2dPhysicalFunction(PhysicalFunction wkt1, PhysicalFunction wkt2) +{ + paramFns.reserve(2); + paramFns.push_back(std::move(wkt1)); + paramFns.push_back(std::move(wkt2)); +} + +VarVal GeomIntersection2dPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto wkt1 = paramFns[0].execute(record, arena).cast(); + auto wkt2 = paramFns[1].execute(record, arena).cast(); + + constexpr uint32_t MAX_LEN = 8192; + auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); + + const auto actualLen = nautilus::invoke( + +[](const char* w1, uint32_t w1sz, const char* w2, uint32_t w2sz, char* buf, uint32_t bufMax) -> uint32_t { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string s1(w1, w1sz), s2(w2, w2sz); + GSERIALIZED* gs1 = geom_in(s1.c_str(), -1); + if (!gs1) return 0u; + GSERIALIZED* gs2 = geom_in(s2.c_str(), -1); + if (!gs2) { free(gs1); return 0u; } + GSERIALIZED* result = geom_intersection2d(gs1, gs2); + free(gs1); free(gs2); + if (!result) return 0u; + char* out = geo_as_text(result, -1); + free(result); + if (!out) return 0u; + uint32_t len = static_cast(strlen(out)); + if (len > bufMax) len = bufMax; + memcpy(buf, out, len); + free(out); + return len; + } catch (const std::exception&) { return 0u; } + }, + wkt1, wkt2, outBuf.getContent(), nautilus::val(MAX_LEN)); + + VarVal(actualLen).writeToMemory(outBuf.getReference()); + return outBuf; +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterGeomIntersection2dPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 2, + "GeomIntersection2dPhysicalFunction requires 2 children but got {}", + arguments.childFunctions.size()); + return GeomIntersection2dPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/GeomShortestline2dPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeomShortestline2dPhysicalFunction.cpp new file mode 100644 index 0000000000..7a1ad18e0c --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/GeomShortestline2dPhysicalFunction.cpp @@ -0,0 +1,90 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +GeomShortestline2dPhysicalFunction::GeomShortestline2dPhysicalFunction(PhysicalFunction wkt1, PhysicalFunction wkt2) +{ + paramFns.reserve(2); + paramFns.push_back(std::move(wkt1)); + paramFns.push_back(std::move(wkt2)); +} + +VarVal GeomShortestline2dPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto wkt1 = paramFns[0].execute(record, arena).cast(); + auto wkt2 = paramFns[1].execute(record, arena).cast(); + + constexpr uint32_t MAX_LEN = 8192; + auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); + + const auto actualLen = nautilus::invoke( + +[](const char* w1, uint32_t w1sz, const char* w2, uint32_t w2sz, char* buf, uint32_t bufMax) -> uint32_t { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string s1(w1, w1sz), s2(w2, w2sz); + GSERIALIZED* gs1 = geom_in(s1.c_str(), -1); + if (!gs1) return 0u; + GSERIALIZED* gs2 = geom_in(s2.c_str(), -1); + if (!gs2) { free(gs1); return 0u; } + GSERIALIZED* result = geom_shortestline2d(gs1, gs2); + free(gs1); free(gs2); + if (!result) return 0u; + char* out = geo_as_text(result, -1); + free(result); + if (!out) return 0u; + uint32_t len = static_cast(strlen(out)); + if (len > bufMax) len = bufMax; + memcpy(buf, out, len); + free(out); + return len; + } catch (const std::exception&) { return 0u; } + }, + wkt1, wkt2, outBuf.getContent(), nautilus::val(MAX_LEN)); + + VarVal(actualLen).writeToMemory(outBuf.getReference()); + return outBuf; +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterGeomShortestline2dPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 2, + "GeomShortestline2dPhysicalFunction requires 2 children but got {}", + arguments.childFunctions.size()); + return GeomShortestline2dPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/GeomShortestline3dPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeomShortestline3dPhysicalFunction.cpp new file mode 100644 index 0000000000..d95bb20070 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/GeomShortestline3dPhysicalFunction.cpp @@ -0,0 +1,90 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +GeomShortestline3dPhysicalFunction::GeomShortestline3dPhysicalFunction(PhysicalFunction wkt1, PhysicalFunction wkt2) +{ + paramFns.reserve(2); + paramFns.push_back(std::move(wkt1)); + paramFns.push_back(std::move(wkt2)); +} + +VarVal GeomShortestline3dPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto wkt1 = paramFns[0].execute(record, arena).cast(); + auto wkt2 = paramFns[1].execute(record, arena).cast(); + + constexpr uint32_t MAX_LEN = 8192; + auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); + + const auto actualLen = nautilus::invoke( + +[](const char* w1, uint32_t w1sz, const char* w2, uint32_t w2sz, char* buf, uint32_t bufMax) -> uint32_t { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string s1(w1, w1sz), s2(w2, w2sz); + GSERIALIZED* gs1 = geom_in(s1.c_str(), -1); + if (!gs1) return 0u; + GSERIALIZED* gs2 = geom_in(s2.c_str(), -1); + if (!gs2) { free(gs1); return 0u; } + GSERIALIZED* result = geom_shortestline3d(gs1, gs2); + free(gs1); free(gs2); + if (!result) return 0u; + char* out = geo_as_text(result, -1); + free(result); + if (!out) return 0u; + uint32_t len = static_cast(strlen(out)); + if (len > bufMax) len = bufMax; + memcpy(buf, out, len); + free(out); + return len; + } catch (const std::exception&) { return 0u; } + }, + wkt1, wkt2, outBuf.getContent(), nautilus::val(MAX_LEN)); + + VarVal(actualLen).writeToMemory(outBuf.getReference()); + return outBuf; +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterGeomShortestline3dPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 2, + "GeomShortestline3dPhysicalFunction requires 2 children but got {}", + arguments.childFunctions.size()); + return GeomShortestline3dPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1])); +} + +} // namespace NES diff --git a/nes-sql-parser/AntlrSQL.g4 b/nes-sql-parser/AntlrSQL.g4 index 2015773c7d..f6accd04b1 100644 --- a/nes-sql-parser/AntlrSQL.g4 +++ b/nes-sql-parser/AntlrSQL.g4 @@ -295,7 +295,7 @@ timeUnit: MS timestampParameter: name=identifier; -functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT | TGE_TTEXT_TEXT | TGE_TEXT_TTEXT | TGT_TTEXT_TEXT | TGT_TEXT_TTEXT | TLE_TTEXT_TEXT | TLE_TEXT_TTEXT | TLT_TTEXT_TEXT | TLT_TEXT_TTEXT | TTEXT_UPPER | TTEXT_LOWER | TTEXT_INITCAP | TEXTCAT_TTEXT_TEXT | TEXTCAT_TEXT_TTEXT | TEXTCAT_TTEXT_TTEXT | GEOM_LENGTH | GEOM_PERIMETER | GEOM_AZIMUTH | GEOG_AREA | GEOG_LENGTH | GEOG_PERIMETER | GEOM_IS_EMPTY | AINTERSECTS_TGEO_GEO | ACOVERS_TGEO_GEO | ADISJOINT_TGEO_GEO | ADWITHIN_TGEO_GEO | EINTERSECTS_TGEO_GEO | ETOUCHES_TGEO_GEO | ECONTAINS_TGEO_GEO | ACONTAINS_TGEO_GEO | ATOUCHES_TGEO_GEO | GEO_NUM_POINTS | GEO_NUM_GEOS | GEO_SRID | GEO_IS_UNITARY | GEO_EQUALS | GEO_SAME | GEOG_DISTANCE | NAD_TGEO_GEO | EVER_EQ_TGEO_GEO | EVER_NE_TGEO_GEO | ALWAYS_EQ_TGEO_GEO | ALWAYS_NE_TGEO_GEO | GEOG_INTERSECTS | GEOG_DWITHIN | ACOVERS_GEO_TGEO | GEOM_INTERSECTS | GEOM_DWITHIN | H3_GS_POINT_TO_CELL | EVER_EQ_TH3INDEX_H3INDEX | EVER_NE_TH3INDEX_H3INDEX | ALWAYS_EQ_TH3INDEX_H3INDEX | ALWAYS_NE_TH3INDEX_H3INDEX | TH3INDEX_GET_RESOLUTION | TH3INDEX_GET_BASE_CELL_NUMBER | TH3INDEX_IS_VALID_CELL | TH3INDEX_IS_PENTAGON | TH3INDEX_CELL_TO_PARENT_NEXT | TH3INDEX_CELL_TO_CENTER_CHILD_NEXT | TH3INDEX_CELL_TO_PARENT | TH3INDEX_CELL_TO_CENTER_CHILD | TH3INDEX_CELL_TO_CHILD_POS | TH3INDEX_ARE_NEIGHBOR_CELLS | TH3INDEX_GRID_DISTANCE | EINTERSECTS_TCBUFFER_GEO | AINTERSECTS_TCBUFFER_GEO | ECOVERS_TCBUFFER_GEO | ACOVERS_TCBUFFER_GEO | EDISJOINT_TCBUFFER_GEO | ADISJOINT_TCBUFFER_GEO | ETOUCHES_TCBUFFER_GEO | ATOUCHES_TCBUFFER_GEO | ECONTAINS_TCBUFFER_GEO | ACONTAINS_TCBUFFER_GEO | NAD_TCBUFFER_GEO | EDWITHIN_TCBUFFER_GEO | ADWITHIN_TCBUFFER_GEO | EINTERSECTS_TCBUFFER_CBUFFER | AINTERSECTS_TCBUFFER_CBUFFER | ECOVERS_TCBUFFER_CBUFFER | ACOVERS_TCBUFFER_CBUFFER | EDISJOINT_TCBUFFER_CBUFFER | ADISJOINT_TCBUFFER_CBUFFER | ETOUCHES_TCBUFFER_CBUFFER | ATOUCHES_TCBUFFER_CBUFFER | ECONTAINS_TCBUFFER_CBUFFER | ACONTAINS_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_CBUFFER | ALWAYS_EQ_TCBUFFER_CBUFFER | EVER_NE_TCBUFFER_CBUFFER | ALWAYS_NE_TCBUFFER_CBUFFER | NAD_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_TCBUFFER | ALWAYS_EQ_TCBUFFER_TCBUFFER | EVER_NE_TCBUFFER_TCBUFFER | ALWAYS_NE_TCBUFFER_TCBUFFER | EINTERSECTS_TCBUFFER_TCBUFFER | AINTERSECTS_TCBUFFER_TCBUFFER | ECOVERS_TCBUFFER_TCBUFFER | ACOVERS_TCBUFFER_TCBUFFER | ADISJOINT_TCBUFFER_TCBUFFER | ETOUCHES_TCBUFFER_TCBUFFER | ATOUCHES_TCBUFFER_TCBUFFER | NAD_TCBUFFER_TCBUFFER | EDWITHIN_TCBUFFER_TCBUFFER | ADWITHIN_TCBUFFER_TCBUFFER | MINDISTANCE_TCBUFFER_TCBUFFER | NAD_TNPOINT_GEO | EVER_EQ_TNPOINT_NPOINT | ALWAYS_EQ_TNPOINT_NPOINT | EVER_NE_TNPOINT_NPOINT | ALWAYS_NE_TNPOINT_NPOINT | NAD_TNPOINT_NPOINT | EVER_EQ_NPOINT_TNPOINT | ALWAYS_EQ_NPOINT_TNPOINT | EVER_NE_NPOINT_TNPOINT | ALWAYS_NE_NPOINT_TNPOINT | EVER_EQ_TNPOINT_TNPOINT | ALWAYS_EQ_TNPOINT_TNPOINT | EVER_NE_TNPOINT_TNPOINT | ALWAYS_NE_TNPOINT_TNPOINT | NAD_TNPOINT_TNPOINT | NAD_TPOSE_GEO | EVER_EQ_TPOSE_POSE | ALWAYS_EQ_TPOSE_POSE | EVER_NE_TPOSE_POSE | ALWAYS_NE_TPOSE_POSE | NAD_TPOSE_POSE | EVER_EQ_POSE_TPOSE | ALWAYS_EQ_POSE_TPOSE | EVER_NE_POSE_TPOSE | ALWAYS_NE_POSE_TPOSE | EVER_EQ_TPOSE_TPOSE | ALWAYS_EQ_TPOSE_TPOSE | EVER_NE_TPOSE_TPOSE | ALWAYS_NE_TPOSE_TPOSE | NAD_TPOSE_TPOSE | EVER_EQ_TRGEOMETRY_GEO | ALWAYS_EQ_TRGEOMETRY_GEO | EVER_NE_TRGEOMETRY_GEO | ALWAYS_NE_TRGEOMETRY_GEO | NAD_TRGEOMETRY_GEO | EVER_EQ_GEO_TRGEOMETRY | ALWAYS_EQ_GEO_TRGEOMETRY | EVER_NE_GEO_TRGEOMETRY | ALWAYS_NE_GEO_TRGEOMETRY | EVER_EQ_TRGEOMETRY_TRGEOMETRY | ALWAYS_EQ_TRGEOMETRY_TRGEOMETRY | EVER_NE_TRGEOMETRY_TRGEOMETRY | ALWAYS_NE_TRGEOMETRY_TRGEOMETRY | NAD_TRGEOMETRY_TRGEOMETRY | EINTERSECTS_TPCPOINT_GEO | NAD_TPCPOINT_GEO | QUADBIN_POINT_TO_CELL | QUADBIN_IS_VALID_CELL | QUADBIN_GET_RESOLUTION | QUADBIN_CELL_AREA | QUADBIN_CELL_TO_QUADKEY | QUADBIN_CELL_TO_PARENT | QUADBIN_TILE_TO_CELL | EVER_EQ_TJSONB_JSONB | ALWAYS_EQ_TJSONB_JSONB | EVER_NE_TJSONB_JSONB | ALWAYS_NE_TJSONB_JSONB | EVER_EQ_TJSONB_TJSONB | ALWAYS_EQ_TJSONB_TJSONB | EVER_NE_TJSONB_TJSONB | ALWAYS_NE_TJSONB_TJSONB | GEOM_BOUNDARY | GEOM_CENTROID | GEOM_CONVEX_HULL | GEO_REVERSE | GEO_POINTS | GEOM_UNARY_UNION | GEOM_INTERSECTS2D | GEOM_DWITHIN2D | GEOM_CONTAINS | GEOM_DISJOINT2D | GEOM_COVERS | GEOM_TOUCHES | GEOM_INTERSECTS3D | GEOM_DWITHIN3D | GEOM_DISTANCE2D | GEOM_DISTANCE3D; +functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT | TGE_TTEXT_TEXT | TGE_TEXT_TTEXT | TGT_TTEXT_TEXT | TGT_TEXT_TTEXT | TLE_TTEXT_TEXT | TLE_TEXT_TTEXT | TLT_TTEXT_TEXT | TLT_TEXT_TTEXT | TTEXT_UPPER | TTEXT_LOWER | TTEXT_INITCAP | TEXTCAT_TTEXT_TEXT | TEXTCAT_TEXT_TTEXT | TEXTCAT_TTEXT_TTEXT | GEOM_LENGTH | GEOM_PERIMETER | GEOM_AZIMUTH | GEOG_AREA | GEOG_LENGTH | GEOG_PERIMETER | GEOM_IS_EMPTY | AINTERSECTS_TGEO_GEO | ACOVERS_TGEO_GEO | ADISJOINT_TGEO_GEO | ADWITHIN_TGEO_GEO | EINTERSECTS_TGEO_GEO | ETOUCHES_TGEO_GEO | ECONTAINS_TGEO_GEO | ACONTAINS_TGEO_GEO | ATOUCHES_TGEO_GEO | GEO_NUM_POINTS | GEO_NUM_GEOS | GEO_SRID | GEO_IS_UNITARY | GEO_EQUALS | GEO_SAME | GEOG_DISTANCE | NAD_TGEO_GEO | EVER_EQ_TGEO_GEO | EVER_NE_TGEO_GEO | ALWAYS_EQ_TGEO_GEO | ALWAYS_NE_TGEO_GEO | GEOG_INTERSECTS | GEOG_DWITHIN | ACOVERS_GEO_TGEO | GEOM_INTERSECTS | GEOM_DWITHIN | H3_GS_POINT_TO_CELL | EVER_EQ_TH3INDEX_H3INDEX | EVER_NE_TH3INDEX_H3INDEX | ALWAYS_EQ_TH3INDEX_H3INDEX | ALWAYS_NE_TH3INDEX_H3INDEX | TH3INDEX_GET_RESOLUTION | TH3INDEX_GET_BASE_CELL_NUMBER | TH3INDEX_IS_VALID_CELL | TH3INDEX_IS_PENTAGON | TH3INDEX_CELL_TO_PARENT_NEXT | TH3INDEX_CELL_TO_CENTER_CHILD_NEXT | TH3INDEX_CELL_TO_PARENT | TH3INDEX_CELL_TO_CENTER_CHILD | TH3INDEX_CELL_TO_CHILD_POS | TH3INDEX_ARE_NEIGHBOR_CELLS | TH3INDEX_GRID_DISTANCE | EINTERSECTS_TCBUFFER_GEO | AINTERSECTS_TCBUFFER_GEO | ECOVERS_TCBUFFER_GEO | ACOVERS_TCBUFFER_GEO | EDISJOINT_TCBUFFER_GEO | ADISJOINT_TCBUFFER_GEO | ETOUCHES_TCBUFFER_GEO | ATOUCHES_TCBUFFER_GEO | ECONTAINS_TCBUFFER_GEO | ACONTAINS_TCBUFFER_GEO | NAD_TCBUFFER_GEO | EDWITHIN_TCBUFFER_GEO | ADWITHIN_TCBUFFER_GEO | EINTERSECTS_TCBUFFER_CBUFFER | AINTERSECTS_TCBUFFER_CBUFFER | ECOVERS_TCBUFFER_CBUFFER | ACOVERS_TCBUFFER_CBUFFER | EDISJOINT_TCBUFFER_CBUFFER | ADISJOINT_TCBUFFER_CBUFFER | ETOUCHES_TCBUFFER_CBUFFER | ATOUCHES_TCBUFFER_CBUFFER | ECONTAINS_TCBUFFER_CBUFFER | ACONTAINS_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_CBUFFER | ALWAYS_EQ_TCBUFFER_CBUFFER | EVER_NE_TCBUFFER_CBUFFER | ALWAYS_NE_TCBUFFER_CBUFFER | NAD_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_TCBUFFER | ALWAYS_EQ_TCBUFFER_TCBUFFER | EVER_NE_TCBUFFER_TCBUFFER | ALWAYS_NE_TCBUFFER_TCBUFFER | EINTERSECTS_TCBUFFER_TCBUFFER | AINTERSECTS_TCBUFFER_TCBUFFER | ECOVERS_TCBUFFER_TCBUFFER | ACOVERS_TCBUFFER_TCBUFFER | ADISJOINT_TCBUFFER_TCBUFFER | ETOUCHES_TCBUFFER_TCBUFFER | ATOUCHES_TCBUFFER_TCBUFFER | NAD_TCBUFFER_TCBUFFER | EDWITHIN_TCBUFFER_TCBUFFER | ADWITHIN_TCBUFFER_TCBUFFER | MINDISTANCE_TCBUFFER_TCBUFFER | NAD_TNPOINT_GEO | EVER_EQ_TNPOINT_NPOINT | ALWAYS_EQ_TNPOINT_NPOINT | EVER_NE_TNPOINT_NPOINT | ALWAYS_NE_TNPOINT_NPOINT | NAD_TNPOINT_NPOINT | EVER_EQ_NPOINT_TNPOINT | ALWAYS_EQ_NPOINT_TNPOINT | EVER_NE_NPOINT_TNPOINT | ALWAYS_NE_NPOINT_TNPOINT | EVER_EQ_TNPOINT_TNPOINT | ALWAYS_EQ_TNPOINT_TNPOINT | EVER_NE_TNPOINT_TNPOINT | ALWAYS_NE_TNPOINT_TNPOINT | NAD_TNPOINT_TNPOINT | NAD_TPOSE_GEO | EVER_EQ_TPOSE_POSE | ALWAYS_EQ_TPOSE_POSE | EVER_NE_TPOSE_POSE | ALWAYS_NE_TPOSE_POSE | NAD_TPOSE_POSE | EVER_EQ_POSE_TPOSE | ALWAYS_EQ_POSE_TPOSE | EVER_NE_POSE_TPOSE | ALWAYS_NE_POSE_TPOSE | EVER_EQ_TPOSE_TPOSE | ALWAYS_EQ_TPOSE_TPOSE | EVER_NE_TPOSE_TPOSE | ALWAYS_NE_TPOSE_TPOSE | NAD_TPOSE_TPOSE | EVER_EQ_TRGEOMETRY_GEO | ALWAYS_EQ_TRGEOMETRY_GEO | EVER_NE_TRGEOMETRY_GEO | ALWAYS_NE_TRGEOMETRY_GEO | NAD_TRGEOMETRY_GEO | EVER_EQ_GEO_TRGEOMETRY | ALWAYS_EQ_GEO_TRGEOMETRY | EVER_NE_GEO_TRGEOMETRY | ALWAYS_NE_GEO_TRGEOMETRY | EVER_EQ_TRGEOMETRY_TRGEOMETRY | ALWAYS_EQ_TRGEOMETRY_TRGEOMETRY | EVER_NE_TRGEOMETRY_TRGEOMETRY | ALWAYS_NE_TRGEOMETRY_TRGEOMETRY | NAD_TRGEOMETRY_TRGEOMETRY | EINTERSECTS_TPCPOINT_GEO | NAD_TPCPOINT_GEO | QUADBIN_POINT_TO_CELL | QUADBIN_IS_VALID_CELL | QUADBIN_GET_RESOLUTION | QUADBIN_CELL_AREA | QUADBIN_CELL_TO_QUADKEY | QUADBIN_CELL_TO_PARENT | QUADBIN_TILE_TO_CELL | EVER_EQ_TJSONB_JSONB | ALWAYS_EQ_TJSONB_JSONB | EVER_NE_TJSONB_JSONB | ALWAYS_NE_TJSONB_JSONB | EVER_EQ_TJSONB_TJSONB | ALWAYS_EQ_TJSONB_TJSONB | EVER_NE_TJSONB_TJSONB | ALWAYS_NE_TJSONB_TJSONB | GEOM_BOUNDARY | GEOM_CENTROID | GEOM_CONVEX_HULL | GEO_REVERSE | GEO_POINTS | GEOM_UNARY_UNION | GEOM_DIFFERENCE2D | GEOM_INTERSECTION2D | GEOM_SHORTESTLINE2D | GEOM_SHORTESTLINE3D | GEOM_INTERSECTS2D | GEOM_DWITHIN2D | GEOM_CONTAINS | GEOM_DISJOINT2D | GEOM_COVERS | GEOM_TOUCHES | GEOM_INTERSECTS3D | GEOM_DWITHIN3D | GEOM_DISTANCE2D | GEOM_DISTANCE3D; sinkClause: INTO sink (',' sink)*; @@ -917,6 +917,10 @@ GEOM_CONVEX_HULL: 'GEOM_CONVEX_HULL' | 'geom_convex_hull'; GEO_REVERSE: 'GEO_REVERSE' | 'geo_reverse'; GEO_POINTS: 'GEO_POINTS' | 'geo_points'; GEOM_UNARY_UNION: 'GEOM_UNARY_UNION' | 'geom_unary_union'; +GEOM_DIFFERENCE2D: 'GEOM_DIFFERENCE2D' | 'geom_difference2d'; +GEOM_INTERSECTION2D: 'GEOM_INTERSECTION2D' | 'geom_intersection2d'; +GEOM_SHORTESTLINE2D: 'GEOM_SHORTESTLINE2D' | 'geom_shortestline2d'; +GEOM_SHORTESTLINE3D: 'GEOM_SHORTESTLINE3D' | 'geom_shortestline3d'; GEOM_INTERSECTS2D: 'GEOM_INTERSECTS2D' | 'geom_intersects2d'; GEOM_DWITHIN2D: 'GEOM_DWITHIN2D' | 'geom_dwithin2d'; GEOM_CONTAINS: 'GEOM_CONTAINS' | 'geom_contains'; diff --git a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp index 26a8e82191..163d318b04 100644 --- a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp +++ b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp @@ -498,6 +498,10 @@ #include #include #include +#include +#include +#include +#include #include #include #include @@ -10812,6 +10816,42 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont return LogicalFunction(GeomUnaryUnionLogicalFunction(std::move(arg0))); } /* END CODEGEN PARSER GLUE: GEOM_UNARY_UNION */ + case AntlrSQLParser::GEOM_DIFFERENCE2D: { + PRECONDITION(ctx->functionParam().size() == 2, + "GeomDifference2d requires 2 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + return LogicalFunction(GeomDifference2dLogicalFunction(std::move(arg0), std::move(arg1))); + } + /* END CODEGEN PARSER GLUE: GEOM_DIFFERENCE2D */ + case AntlrSQLParser::GEOM_INTERSECTION2D: { + PRECONDITION(ctx->functionParam().size() == 2, + "GeomIntersection2d requires 2 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + return LogicalFunction(GeomIntersection2dLogicalFunction(std::move(arg0), std::move(arg1))); + } + /* END CODEGEN PARSER GLUE: GEOM_INTERSECTION2D */ + case AntlrSQLParser::GEOM_SHORTESTLINE2D: { + PRECONDITION(ctx->functionParam().size() == 2, + "GeomShortestline2d requires 2 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + return LogicalFunction(GeomShortestline2dLogicalFunction(std::move(arg0), std::move(arg1))); + } + /* END CODEGEN PARSER GLUE: GEOM_SHORTESTLINE2D */ + case AntlrSQLParser::GEOM_SHORTESTLINE3D: { + PRECONDITION(ctx->functionParam().size() == 2, + "GeomShortestline3d requires 2 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + return LogicalFunction(GeomShortestline3dLogicalFunction(std::move(arg0), std::move(arg1))); + } + /* END CODEGEN PARSER GLUE: GEOM_SHORTESTLINE3D */ /* END CODEGEN PARSER GLUE: GEOM_INTERSECTS2D */ case AntlrSQLParser::GEOM_DWITHIN2D: { PRECONDITION(ctx->functionParam().size() == 3, From 9143176dc45dfbb776e9b3985826fd136e676929 Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Mon, 15 Jun 2026 20:17:50 +0200 Subject: [PATCH 78/96] feat(meos): add parameterized geometry transform NES operators returning 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. --- .../Meos/GeoRoundLogicalFunction.hpp | 48 +++++++++ .../Meos/GeoSetSridLogicalFunction.hpp | 48 +++++++++ .../Meos/GeoTransformLogicalFunction.hpp | 48 +++++++++ .../Meos/GeomBufferLogicalFunction.hpp | 48 +++++++++ .../src/Functions/Meos/CMakeLists.txt | 4 + .../Meos/GeoRoundLogicalFunction.cpp | 99 +++++++++++++++++ .../Meos/GeoSetSridLogicalFunction.cpp | 99 +++++++++++++++++ .../Meos/GeoTransformLogicalFunction.cpp | 99 +++++++++++++++++ .../Meos/GeomBufferLogicalFunction.cpp | 102 ++++++++++++++++++ .../Meos/GeoRoundPhysicalFunction.hpp | 32 ++++++ .../Meos/GeoSetSridPhysicalFunction.hpp | 32 ++++++ .../Meos/GeoTransformPhysicalFunction.hpp | 32 ++++++ .../Meos/GeomBufferPhysicalFunction.hpp | 32 ++++++ .../src/Functions/Meos/CMakeLists.txt | 4 + .../Meos/GeoRoundPhysicalFunction.cpp | 87 +++++++++++++++ .../Meos/GeoSetSridPhysicalFunction.cpp | 87 +++++++++++++++ .../Meos/GeoTransformPhysicalFunction.cpp | 87 +++++++++++++++ .../Meos/GeomBufferPhysicalFunction.cpp | 90 ++++++++++++++++ nes-sql-parser/AntlrSQL.g4 | 6 +- .../src/AntlrSQLQueryPlanCreator.cpp | 41 +++++++ 20 files changed, 1124 insertions(+), 1 deletion(-) create mode 100644 nes-logical-operators/include/Functions/Meos/GeoRoundLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/GeoSetSridLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/GeoTransformLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/GeomBufferLogicalFunction.hpp create mode 100644 nes-logical-operators/src/Functions/Meos/GeoRoundLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/GeoSetSridLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/GeoTransformLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/GeomBufferLogicalFunction.cpp create mode 100644 nes-physical-operators/include/Functions/Meos/GeoRoundPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/GeoSetSridPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/GeoTransformPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/GeomBufferPhysicalFunction.hpp create mode 100644 nes-physical-operators/src/Functions/Meos/GeoRoundPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/GeoSetSridPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/GeoTransformPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/GeomBufferPhysicalFunction.cpp diff --git a/nes-logical-operators/include/Functions/Meos/GeoRoundLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeoRoundLogicalFunction.hpp new file mode 100644 index 0000000000..978675183c --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/GeoRoundLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns a geometry with coordinates rounded to maxdd decimal digits, as WKT. + */ +class GeoRoundLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "GeoRound"; + + GeoRoundLogicalFunction(LogicalFunction wkt, LogicalFunction maxdd); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/GeoSetSridLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeoSetSridLogicalFunction.hpp new file mode 100644 index 0000000000..cc8f75fd1d --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/GeoSetSridLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns a geometry with a new SRID assigned, as WKT. + */ +class GeoSetSridLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "GeoSetSrid"; + + GeoSetSridLogicalFunction(LogicalFunction wkt, LogicalFunction srid); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/GeoTransformLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeoTransformLogicalFunction.hpp new file mode 100644 index 0000000000..11fc951f89 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/GeoTransformLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns a geometry reprojected to the target SRID, as WKT. + */ +class GeoTransformLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "GeoTransform"; + + GeoTransformLogicalFunction(LogicalFunction wkt, LogicalFunction srid_to); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/GeomBufferLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeomBufferLogicalFunction.hpp new file mode 100644 index 0000000000..bb97748597 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/GeomBufferLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns a geometry buffered by the given size with optional style parameters, as WKT. + */ +class GeomBufferLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "GeomBuffer"; + + GeomBufferLogicalFunction(LogicalFunction wkt, LogicalFunction size, LogicalFunction params); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt index fa52006a97..b3467f3f00 100644 --- a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt @@ -451,6 +451,10 @@ add_plugin(GeomDifference2d LogicalFunction nes-logical-operators GeomDifference add_plugin(GeomIntersection2d LogicalFunction nes-logical-operators GeomIntersection2dLogicalFunction.cpp) add_plugin(GeomShortestline2d LogicalFunction nes-logical-operators GeomShortestline2dLogicalFunction.cpp) add_plugin(GeomShortestline3d LogicalFunction nes-logical-operators GeomShortestline3dLogicalFunction.cpp) +add_plugin(GeoSetSrid LogicalFunction nes-logical-operators GeoSetSridLogicalFunction.cpp) +add_plugin(GeoTransform LogicalFunction nes-logical-operators GeoTransformLogicalFunction.cpp) +add_plugin(GeoRound LogicalFunction nes-logical-operators GeoRoundLogicalFunction.cpp) +add_plugin(GeomBuffer LogicalFunction nes-logical-operators GeomBufferLogicalFunction.cpp) add_plugin(GeomIntersects2d LogicalFunction nes-logical-operators GeomIntersects2dLogicalFunction.cpp) add_plugin(GeomDwithin2d LogicalFunction nes-logical-operators GeomDwithin2dLogicalFunction.cpp) add_plugin(GeomContains LogicalFunction nes-logical-operators GeomContainsLogicalFunction.cpp) diff --git a/nes-logical-operators/src/Functions/Meos/GeoRoundLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeoRoundLogicalFunction.cpp new file mode 100644 index 0000000000..799e4a137a --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/GeoRoundLogicalFunction.cpp @@ -0,0 +1,99 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +GeoRoundLogicalFunction::GeoRoundLogicalFunction(LogicalFunction wkt, LogicalFunction maxdd) + : dataType(DataTypeProvider::provideDataType(DataType::Type::VARSIZED)) +{ + parameters.reserve(2); + parameters.push_back(std::move(wkt)); + parameters.push_back(std::move(maxdd)); +} + +DataType GeoRoundLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction GeoRoundLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector GeoRoundLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction GeoRoundLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 2, + "GeoRoundLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view GeoRoundLogicalFunction::getType() const { return NAME; } + +bool GeoRoundLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string GeoRoundLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction GeoRoundLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(2); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "wkt must be VARSIZED"); + INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "maxdd must be UINT64"); + return withChildren(c); +} + +SerializableFunction GeoRoundLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeoRoundLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 2, + "GeoRoundLogicalFunction requires 2 children but got {}", + arguments.children.size()); + return GeoRoundLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/GeoSetSridLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeoSetSridLogicalFunction.cpp new file mode 100644 index 0000000000..23eb26e5c9 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/GeoSetSridLogicalFunction.cpp @@ -0,0 +1,99 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +GeoSetSridLogicalFunction::GeoSetSridLogicalFunction(LogicalFunction wkt, LogicalFunction srid) + : dataType(DataTypeProvider::provideDataType(DataType::Type::VARSIZED)) +{ + parameters.reserve(2); + parameters.push_back(std::move(wkt)); + parameters.push_back(std::move(srid)); +} + +DataType GeoSetSridLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction GeoSetSridLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector GeoSetSridLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction GeoSetSridLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 2, + "GeoSetSridLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view GeoSetSridLogicalFunction::getType() const { return NAME; } + +bool GeoSetSridLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string GeoSetSridLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction GeoSetSridLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(2); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "wkt must be VARSIZED"); + INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "srid must be UINT64"); + return withChildren(c); +} + +SerializableFunction GeoSetSridLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeoSetSridLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 2, + "GeoSetSridLogicalFunction requires 2 children but got {}", + arguments.children.size()); + return GeoSetSridLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/GeoTransformLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeoTransformLogicalFunction.cpp new file mode 100644 index 0000000000..38a442097f --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/GeoTransformLogicalFunction.cpp @@ -0,0 +1,99 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +GeoTransformLogicalFunction::GeoTransformLogicalFunction(LogicalFunction wkt, LogicalFunction srid_to) + : dataType(DataTypeProvider::provideDataType(DataType::Type::VARSIZED)) +{ + parameters.reserve(2); + parameters.push_back(std::move(wkt)); + parameters.push_back(std::move(srid_to)); +} + +DataType GeoTransformLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction GeoTransformLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector GeoTransformLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction GeoTransformLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 2, + "GeoTransformLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view GeoTransformLogicalFunction::getType() const { return NAME; } + +bool GeoTransformLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string GeoTransformLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction GeoTransformLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(2); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "wkt must be VARSIZED"); + INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "srid_to must be UINT64"); + return withChildren(c); +} + +SerializableFunction GeoTransformLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeoTransformLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 2, + "GeoTransformLogicalFunction requires 2 children but got {}", + arguments.children.size()); + return GeoTransformLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/GeomBufferLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeomBufferLogicalFunction.cpp new file mode 100644 index 0000000000..dd14b1a88a --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/GeomBufferLogicalFunction.cpp @@ -0,0 +1,102 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +GeomBufferLogicalFunction::GeomBufferLogicalFunction(LogicalFunction wkt, LogicalFunction size, LogicalFunction params) + : dataType(DataTypeProvider::provideDataType(DataType::Type::VARSIZED)) +{ + parameters.reserve(3); + parameters.push_back(std::move(wkt)); + parameters.push_back(std::move(size)); + parameters.push_back(std::move(params)); +} + +DataType GeomBufferLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction GeomBufferLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector GeomBufferLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction GeomBufferLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, + "GeomBufferLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view GeomBufferLogicalFunction::getType() const { return NAME; } + +bool GeomBufferLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string GeomBufferLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction GeomBufferLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(3); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "wkt must be VARSIZED"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "size must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::VARSIZED), "params must be VARSIZED"); + return withChildren(c); +} + +SerializableFunction GeomBufferLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeomBufferLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "GeomBufferLogicalFunction requires 3 children but got {}", + arguments.children.size()); + return GeomBufferLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2])); +} + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeoRoundPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeoRoundPhysicalFunction.hpp new file mode 100644 index 0000000000..a71935cf2c --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/GeoRoundPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class GeoRoundPhysicalFunction : public PhysicalFunctionConcept { +public: + GeoRoundPhysicalFunction(PhysicalFunction wkt, PhysicalFunction maxdd); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeoSetSridPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeoSetSridPhysicalFunction.hpp new file mode 100644 index 0000000000..76be53ae86 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/GeoSetSridPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class GeoSetSridPhysicalFunction : public PhysicalFunctionConcept { +public: + GeoSetSridPhysicalFunction(PhysicalFunction wkt, PhysicalFunction srid); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeoTransformPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeoTransformPhysicalFunction.hpp new file mode 100644 index 0000000000..6498c79b57 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/GeoTransformPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class GeoTransformPhysicalFunction : public PhysicalFunctionConcept { +public: + GeoTransformPhysicalFunction(PhysicalFunction wkt, PhysicalFunction srid_to); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeomBufferPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeomBufferPhysicalFunction.hpp new file mode 100644 index 0000000000..896b0c38a3 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/GeomBufferPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class GeomBufferPhysicalFunction : public PhysicalFunctionConcept { +public: + GeomBufferPhysicalFunction(PhysicalFunction wkt, PhysicalFunction size, PhysicalFunction params); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt index c6aede88f6..75b7c5a802 100644 --- a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt @@ -450,6 +450,10 @@ add_plugin(GeomDifference2d PhysicalFunction nes-physical-operators GeomDifferen add_plugin(GeomIntersection2d PhysicalFunction nes-physical-operators GeomIntersection2dPhysicalFunction.cpp) add_plugin(GeomShortestline2d PhysicalFunction nes-physical-operators GeomShortestline2dPhysicalFunction.cpp) add_plugin(GeomShortestline3d PhysicalFunction nes-physical-operators GeomShortestline3dPhysicalFunction.cpp) +add_plugin(GeoSetSrid PhysicalFunction nes-physical-operators GeoSetSridPhysicalFunction.cpp) +add_plugin(GeoTransform PhysicalFunction nes-physical-operators GeoTransformPhysicalFunction.cpp) +add_plugin(GeoRound PhysicalFunction nes-physical-operators GeoRoundPhysicalFunction.cpp) +add_plugin(GeomBuffer PhysicalFunction nes-physical-operators GeomBufferPhysicalFunction.cpp) add_plugin(GeomIntersects2d PhysicalFunction nes-physical-operators GeomIntersects2dPhysicalFunction.cpp) add_plugin(GeomDwithin2d PhysicalFunction nes-physical-operators GeomDwithin2dPhysicalFunction.cpp) add_plugin(GeomContains PhysicalFunction nes-physical-operators GeomContainsPhysicalFunction.cpp) diff --git a/nes-physical-operators/src/Functions/Meos/GeoRoundPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeoRoundPhysicalFunction.cpp new file mode 100644 index 0000000000..4b8cf3e557 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/GeoRoundPhysicalFunction.cpp @@ -0,0 +1,87 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +GeoRoundPhysicalFunction::GeoRoundPhysicalFunction(PhysicalFunction wkt, PhysicalFunction maxdd) +{ + paramFns.reserve(2); + paramFns.push_back(std::move(wkt)); + paramFns.push_back(std::move(maxdd)); +} + +VarVal GeoRoundPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto wkt = paramFns[0].execute(record, arena).cast(); + auto maxdd = paramFns[1].execute(record, arena).cast>(); + constexpr uint32_t MAX_LEN = 8192; + auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); + + const auto actualLen = nautilus::invoke( + +[](const char* w, uint32_t wsz, uint64_t maxdd, char* buf, uint32_t bufMax) -> uint32_t { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string s(w, wsz); + GSERIALIZED* gs = geom_in(s.c_str(), -1); + if (!gs) return 0u; + GSERIALIZED* result = geo_round(gs, (int)maxdd); + free(gs); + if (!result) return 0u; + char* out = geo_as_text(result, -1); + free(result); + if (!out) return 0u; + uint32_t len = static_cast(strlen(out)); + if (len > bufMax) len = bufMax; + memcpy(buf, out, len); + free(out); + return len; + } catch (const std::exception&) { return 0u; } + }, + wkt, maxdd, outBuf.getContent(), nautilus::val(MAX_LEN)); + + VarVal(actualLen).writeToMemory(outBuf.getReference()); + return outBuf; +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterGeoRoundPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 2, + "GeoRoundPhysicalFunction requires 2 children but got {}", + arguments.childFunctions.size()); + return GeoRoundPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/GeoSetSridPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeoSetSridPhysicalFunction.cpp new file mode 100644 index 0000000000..b8ff54f049 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/GeoSetSridPhysicalFunction.cpp @@ -0,0 +1,87 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +GeoSetSridPhysicalFunction::GeoSetSridPhysicalFunction(PhysicalFunction wkt, PhysicalFunction srid) +{ + paramFns.reserve(2); + paramFns.push_back(std::move(wkt)); + paramFns.push_back(std::move(srid)); +} + +VarVal GeoSetSridPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto wkt = paramFns[0].execute(record, arena).cast(); + auto srid = paramFns[1].execute(record, arena).cast>(); + constexpr uint32_t MAX_LEN = 8192; + auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); + + const auto actualLen = nautilus::invoke( + +[](const char* w, uint32_t wsz, uint64_t srid, char* buf, uint32_t bufMax) -> uint32_t { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string s(w, wsz); + GSERIALIZED* gs = geom_in(s.c_str(), -1); + if (!gs) return 0u; + GSERIALIZED* result = geo_set_srid(gs, (int32_t)srid); + free(gs); + if (!result) return 0u; + char* out = geo_as_text(result, -1); + free(result); + if (!out) return 0u; + uint32_t len = static_cast(strlen(out)); + if (len > bufMax) len = bufMax; + memcpy(buf, out, len); + free(out); + return len; + } catch (const std::exception&) { return 0u; } + }, + wkt, srid, outBuf.getContent(), nautilus::val(MAX_LEN)); + + VarVal(actualLen).writeToMemory(outBuf.getReference()); + return outBuf; +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterGeoSetSridPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 2, + "GeoSetSridPhysicalFunction requires 2 children but got {}", + arguments.childFunctions.size()); + return GeoSetSridPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/GeoTransformPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeoTransformPhysicalFunction.cpp new file mode 100644 index 0000000000..704b8afc6a --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/GeoTransformPhysicalFunction.cpp @@ -0,0 +1,87 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +GeoTransformPhysicalFunction::GeoTransformPhysicalFunction(PhysicalFunction wkt, PhysicalFunction srid_to) +{ + paramFns.reserve(2); + paramFns.push_back(std::move(wkt)); + paramFns.push_back(std::move(srid_to)); +} + +VarVal GeoTransformPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto wkt = paramFns[0].execute(record, arena).cast(); + auto srid_to = paramFns[1].execute(record, arena).cast>(); + constexpr uint32_t MAX_LEN = 8192; + auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); + + const auto actualLen = nautilus::invoke( + +[](const char* w, uint32_t wsz, uint64_t srid_to, char* buf, uint32_t bufMax) -> uint32_t { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string s(w, wsz); + GSERIALIZED* gs = geom_in(s.c_str(), -1); + if (!gs) return 0u; + GSERIALIZED* result = geo_transform(gs, (int32_t)srid_to); + free(gs); + if (!result) return 0u; + char* out = geo_as_text(result, -1); + free(result); + if (!out) return 0u; + uint32_t len = static_cast(strlen(out)); + if (len > bufMax) len = bufMax; + memcpy(buf, out, len); + free(out); + return len; + } catch (const std::exception&) { return 0u; } + }, + wkt, srid_to, outBuf.getContent(), nautilus::val(MAX_LEN)); + + VarVal(actualLen).writeToMemory(outBuf.getReference()); + return outBuf; +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterGeoTransformPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 2, + "GeoTransformPhysicalFunction requires 2 children but got {}", + arguments.childFunctions.size()); + return GeoTransformPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/GeomBufferPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeomBufferPhysicalFunction.cpp new file mode 100644 index 0000000000..97942c4995 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/GeomBufferPhysicalFunction.cpp @@ -0,0 +1,90 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +GeomBufferPhysicalFunction::GeomBufferPhysicalFunction(PhysicalFunction wkt, PhysicalFunction size, PhysicalFunction params) +{ + paramFns.reserve(3); + paramFns.push_back(std::move(wkt)); + paramFns.push_back(std::move(size)); + paramFns.push_back(std::move(params)); +} + +VarVal GeomBufferPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto wkt = paramFns[0].execute(record, arena).cast(); + auto size = paramFns[1].execute(record, arena).cast(); + auto params = paramFns[2].execute(record, arena).cast(); + constexpr uint32_t MAX_LEN = 8192; + auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); + + const auto actualLen = nautilus::invoke( + +[](const char* w, uint32_t wsz, double size, const char* p, uint32_t psz, char* buf, uint32_t bufMax) -> uint32_t { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string s(w, wsz), ps(p, psz); + GSERIALIZED* gs = geom_in(s.c_str(), -1); + if (!gs) return 0u; + GSERIALIZED* result = geom_buffer(gs, size, ps.c_str()); + free(gs); + if (!result) return 0u; + char* out = geo_as_text(result, -1); + free(result); + if (!out) return 0u; + uint32_t len = static_cast(strlen(out)); + if (len > bufMax) len = bufMax; + memcpy(buf, out, len); + free(out); + return len; + } catch (const std::exception&) { return 0u; } + }, + wkt, size, params, outBuf.getContent(), nautilus::val(MAX_LEN)); + + VarVal(actualLen).writeToMemory(outBuf.getReference()); + return outBuf; +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterGeomBufferPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "GeomBufferPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + return GeomBufferPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2])); +} + +} // namespace NES diff --git a/nes-sql-parser/AntlrSQL.g4 b/nes-sql-parser/AntlrSQL.g4 index f6accd04b1..eb009ac65c 100644 --- a/nes-sql-parser/AntlrSQL.g4 +++ b/nes-sql-parser/AntlrSQL.g4 @@ -295,7 +295,7 @@ timeUnit: MS timestampParameter: name=identifier; -functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT | TGE_TTEXT_TEXT | TGE_TEXT_TTEXT | TGT_TTEXT_TEXT | TGT_TEXT_TTEXT | TLE_TTEXT_TEXT | TLE_TEXT_TTEXT | TLT_TTEXT_TEXT | TLT_TEXT_TTEXT | TTEXT_UPPER | TTEXT_LOWER | TTEXT_INITCAP | TEXTCAT_TTEXT_TEXT | TEXTCAT_TEXT_TTEXT | TEXTCAT_TTEXT_TTEXT | GEOM_LENGTH | GEOM_PERIMETER | GEOM_AZIMUTH | GEOG_AREA | GEOG_LENGTH | GEOG_PERIMETER | GEOM_IS_EMPTY | AINTERSECTS_TGEO_GEO | ACOVERS_TGEO_GEO | ADISJOINT_TGEO_GEO | ADWITHIN_TGEO_GEO | EINTERSECTS_TGEO_GEO | ETOUCHES_TGEO_GEO | ECONTAINS_TGEO_GEO | ACONTAINS_TGEO_GEO | ATOUCHES_TGEO_GEO | GEO_NUM_POINTS | GEO_NUM_GEOS | GEO_SRID | GEO_IS_UNITARY | GEO_EQUALS | GEO_SAME | GEOG_DISTANCE | NAD_TGEO_GEO | EVER_EQ_TGEO_GEO | EVER_NE_TGEO_GEO | ALWAYS_EQ_TGEO_GEO | ALWAYS_NE_TGEO_GEO | GEOG_INTERSECTS | GEOG_DWITHIN | ACOVERS_GEO_TGEO | GEOM_INTERSECTS | GEOM_DWITHIN | H3_GS_POINT_TO_CELL | EVER_EQ_TH3INDEX_H3INDEX | EVER_NE_TH3INDEX_H3INDEX | ALWAYS_EQ_TH3INDEX_H3INDEX | ALWAYS_NE_TH3INDEX_H3INDEX | TH3INDEX_GET_RESOLUTION | TH3INDEX_GET_BASE_CELL_NUMBER | TH3INDEX_IS_VALID_CELL | TH3INDEX_IS_PENTAGON | TH3INDEX_CELL_TO_PARENT_NEXT | TH3INDEX_CELL_TO_CENTER_CHILD_NEXT | TH3INDEX_CELL_TO_PARENT | TH3INDEX_CELL_TO_CENTER_CHILD | TH3INDEX_CELL_TO_CHILD_POS | TH3INDEX_ARE_NEIGHBOR_CELLS | TH3INDEX_GRID_DISTANCE | EINTERSECTS_TCBUFFER_GEO | AINTERSECTS_TCBUFFER_GEO | ECOVERS_TCBUFFER_GEO | ACOVERS_TCBUFFER_GEO | EDISJOINT_TCBUFFER_GEO | ADISJOINT_TCBUFFER_GEO | ETOUCHES_TCBUFFER_GEO | ATOUCHES_TCBUFFER_GEO | ECONTAINS_TCBUFFER_GEO | ACONTAINS_TCBUFFER_GEO | NAD_TCBUFFER_GEO | EDWITHIN_TCBUFFER_GEO | ADWITHIN_TCBUFFER_GEO | EINTERSECTS_TCBUFFER_CBUFFER | AINTERSECTS_TCBUFFER_CBUFFER | ECOVERS_TCBUFFER_CBUFFER | ACOVERS_TCBUFFER_CBUFFER | EDISJOINT_TCBUFFER_CBUFFER | ADISJOINT_TCBUFFER_CBUFFER | ETOUCHES_TCBUFFER_CBUFFER | ATOUCHES_TCBUFFER_CBUFFER | ECONTAINS_TCBUFFER_CBUFFER | ACONTAINS_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_CBUFFER | ALWAYS_EQ_TCBUFFER_CBUFFER | EVER_NE_TCBUFFER_CBUFFER | ALWAYS_NE_TCBUFFER_CBUFFER | NAD_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_TCBUFFER | ALWAYS_EQ_TCBUFFER_TCBUFFER | EVER_NE_TCBUFFER_TCBUFFER | ALWAYS_NE_TCBUFFER_TCBUFFER | EINTERSECTS_TCBUFFER_TCBUFFER | AINTERSECTS_TCBUFFER_TCBUFFER | ECOVERS_TCBUFFER_TCBUFFER | ACOVERS_TCBUFFER_TCBUFFER | ADISJOINT_TCBUFFER_TCBUFFER | ETOUCHES_TCBUFFER_TCBUFFER | ATOUCHES_TCBUFFER_TCBUFFER | NAD_TCBUFFER_TCBUFFER | EDWITHIN_TCBUFFER_TCBUFFER | ADWITHIN_TCBUFFER_TCBUFFER | MINDISTANCE_TCBUFFER_TCBUFFER | NAD_TNPOINT_GEO | EVER_EQ_TNPOINT_NPOINT | ALWAYS_EQ_TNPOINT_NPOINT | EVER_NE_TNPOINT_NPOINT | ALWAYS_NE_TNPOINT_NPOINT | NAD_TNPOINT_NPOINT | EVER_EQ_NPOINT_TNPOINT | ALWAYS_EQ_NPOINT_TNPOINT | EVER_NE_NPOINT_TNPOINT | ALWAYS_NE_NPOINT_TNPOINT | EVER_EQ_TNPOINT_TNPOINT | ALWAYS_EQ_TNPOINT_TNPOINT | EVER_NE_TNPOINT_TNPOINT | ALWAYS_NE_TNPOINT_TNPOINT | NAD_TNPOINT_TNPOINT | NAD_TPOSE_GEO | EVER_EQ_TPOSE_POSE | ALWAYS_EQ_TPOSE_POSE | EVER_NE_TPOSE_POSE | ALWAYS_NE_TPOSE_POSE | NAD_TPOSE_POSE | EVER_EQ_POSE_TPOSE | ALWAYS_EQ_POSE_TPOSE | EVER_NE_POSE_TPOSE | ALWAYS_NE_POSE_TPOSE | EVER_EQ_TPOSE_TPOSE | ALWAYS_EQ_TPOSE_TPOSE | EVER_NE_TPOSE_TPOSE | ALWAYS_NE_TPOSE_TPOSE | NAD_TPOSE_TPOSE | EVER_EQ_TRGEOMETRY_GEO | ALWAYS_EQ_TRGEOMETRY_GEO | EVER_NE_TRGEOMETRY_GEO | ALWAYS_NE_TRGEOMETRY_GEO | NAD_TRGEOMETRY_GEO | EVER_EQ_GEO_TRGEOMETRY | ALWAYS_EQ_GEO_TRGEOMETRY | EVER_NE_GEO_TRGEOMETRY | ALWAYS_NE_GEO_TRGEOMETRY | EVER_EQ_TRGEOMETRY_TRGEOMETRY | ALWAYS_EQ_TRGEOMETRY_TRGEOMETRY | EVER_NE_TRGEOMETRY_TRGEOMETRY | ALWAYS_NE_TRGEOMETRY_TRGEOMETRY | NAD_TRGEOMETRY_TRGEOMETRY | EINTERSECTS_TPCPOINT_GEO | NAD_TPCPOINT_GEO | QUADBIN_POINT_TO_CELL | QUADBIN_IS_VALID_CELL | QUADBIN_GET_RESOLUTION | QUADBIN_CELL_AREA | QUADBIN_CELL_TO_QUADKEY | QUADBIN_CELL_TO_PARENT | QUADBIN_TILE_TO_CELL | EVER_EQ_TJSONB_JSONB | ALWAYS_EQ_TJSONB_JSONB | EVER_NE_TJSONB_JSONB | ALWAYS_NE_TJSONB_JSONB | EVER_EQ_TJSONB_TJSONB | ALWAYS_EQ_TJSONB_TJSONB | EVER_NE_TJSONB_TJSONB | ALWAYS_NE_TJSONB_TJSONB | GEOM_BOUNDARY | GEOM_CENTROID | GEOM_CONVEX_HULL | GEO_REVERSE | GEO_POINTS | GEOM_UNARY_UNION | GEOM_DIFFERENCE2D | GEOM_INTERSECTION2D | GEOM_SHORTESTLINE2D | GEOM_SHORTESTLINE3D | GEOM_INTERSECTS2D | GEOM_DWITHIN2D | GEOM_CONTAINS | GEOM_DISJOINT2D | GEOM_COVERS | GEOM_TOUCHES | GEOM_INTERSECTS3D | GEOM_DWITHIN3D | GEOM_DISTANCE2D | GEOM_DISTANCE3D; +functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT | TGE_TTEXT_TEXT | TGE_TEXT_TTEXT | TGT_TTEXT_TEXT | TGT_TEXT_TTEXT | TLE_TTEXT_TEXT | TLE_TEXT_TTEXT | TLT_TTEXT_TEXT | TLT_TEXT_TTEXT | TTEXT_UPPER | TTEXT_LOWER | TTEXT_INITCAP | TEXTCAT_TTEXT_TEXT | TEXTCAT_TEXT_TTEXT | TEXTCAT_TTEXT_TTEXT | GEOM_LENGTH | GEOM_PERIMETER | GEOM_AZIMUTH | GEOG_AREA | GEOG_LENGTH | GEOG_PERIMETER | GEOM_IS_EMPTY | AINTERSECTS_TGEO_GEO | ACOVERS_TGEO_GEO | ADISJOINT_TGEO_GEO | ADWITHIN_TGEO_GEO | EINTERSECTS_TGEO_GEO | ETOUCHES_TGEO_GEO | ECONTAINS_TGEO_GEO | ACONTAINS_TGEO_GEO | ATOUCHES_TGEO_GEO | GEO_NUM_POINTS | GEO_NUM_GEOS | GEO_SRID | GEO_IS_UNITARY | GEO_EQUALS | GEO_SAME | GEOG_DISTANCE | NAD_TGEO_GEO | EVER_EQ_TGEO_GEO | EVER_NE_TGEO_GEO | ALWAYS_EQ_TGEO_GEO | ALWAYS_NE_TGEO_GEO | GEOG_INTERSECTS | GEOG_DWITHIN | ACOVERS_GEO_TGEO | GEOM_INTERSECTS | GEOM_DWITHIN | H3_GS_POINT_TO_CELL | EVER_EQ_TH3INDEX_H3INDEX | EVER_NE_TH3INDEX_H3INDEX | ALWAYS_EQ_TH3INDEX_H3INDEX | ALWAYS_NE_TH3INDEX_H3INDEX | TH3INDEX_GET_RESOLUTION | TH3INDEX_GET_BASE_CELL_NUMBER | TH3INDEX_IS_VALID_CELL | TH3INDEX_IS_PENTAGON | TH3INDEX_CELL_TO_PARENT_NEXT | TH3INDEX_CELL_TO_CENTER_CHILD_NEXT | TH3INDEX_CELL_TO_PARENT | TH3INDEX_CELL_TO_CENTER_CHILD | TH3INDEX_CELL_TO_CHILD_POS | TH3INDEX_ARE_NEIGHBOR_CELLS | TH3INDEX_GRID_DISTANCE | EINTERSECTS_TCBUFFER_GEO | AINTERSECTS_TCBUFFER_GEO | ECOVERS_TCBUFFER_GEO | ACOVERS_TCBUFFER_GEO | EDISJOINT_TCBUFFER_GEO | ADISJOINT_TCBUFFER_GEO | ETOUCHES_TCBUFFER_GEO | ATOUCHES_TCBUFFER_GEO | ECONTAINS_TCBUFFER_GEO | ACONTAINS_TCBUFFER_GEO | NAD_TCBUFFER_GEO | EDWITHIN_TCBUFFER_GEO | ADWITHIN_TCBUFFER_GEO | EINTERSECTS_TCBUFFER_CBUFFER | AINTERSECTS_TCBUFFER_CBUFFER | ECOVERS_TCBUFFER_CBUFFER | ACOVERS_TCBUFFER_CBUFFER | EDISJOINT_TCBUFFER_CBUFFER | ADISJOINT_TCBUFFER_CBUFFER | ETOUCHES_TCBUFFER_CBUFFER | ATOUCHES_TCBUFFER_CBUFFER | ECONTAINS_TCBUFFER_CBUFFER | ACONTAINS_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_CBUFFER | ALWAYS_EQ_TCBUFFER_CBUFFER | EVER_NE_TCBUFFER_CBUFFER | ALWAYS_NE_TCBUFFER_CBUFFER | NAD_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_TCBUFFER | ALWAYS_EQ_TCBUFFER_TCBUFFER | EVER_NE_TCBUFFER_TCBUFFER | ALWAYS_NE_TCBUFFER_TCBUFFER | EINTERSECTS_TCBUFFER_TCBUFFER | AINTERSECTS_TCBUFFER_TCBUFFER | ECOVERS_TCBUFFER_TCBUFFER | ACOVERS_TCBUFFER_TCBUFFER | ADISJOINT_TCBUFFER_TCBUFFER | ETOUCHES_TCBUFFER_TCBUFFER | ATOUCHES_TCBUFFER_TCBUFFER | NAD_TCBUFFER_TCBUFFER | EDWITHIN_TCBUFFER_TCBUFFER | ADWITHIN_TCBUFFER_TCBUFFER | MINDISTANCE_TCBUFFER_TCBUFFER | NAD_TNPOINT_GEO | EVER_EQ_TNPOINT_NPOINT | ALWAYS_EQ_TNPOINT_NPOINT | EVER_NE_TNPOINT_NPOINT | ALWAYS_NE_TNPOINT_NPOINT | NAD_TNPOINT_NPOINT | EVER_EQ_NPOINT_TNPOINT | ALWAYS_EQ_NPOINT_TNPOINT | EVER_NE_NPOINT_TNPOINT | ALWAYS_NE_NPOINT_TNPOINT | EVER_EQ_TNPOINT_TNPOINT | ALWAYS_EQ_TNPOINT_TNPOINT | EVER_NE_TNPOINT_TNPOINT | ALWAYS_NE_TNPOINT_TNPOINT | NAD_TNPOINT_TNPOINT | NAD_TPOSE_GEO | EVER_EQ_TPOSE_POSE | ALWAYS_EQ_TPOSE_POSE | EVER_NE_TPOSE_POSE | ALWAYS_NE_TPOSE_POSE | NAD_TPOSE_POSE | EVER_EQ_POSE_TPOSE | ALWAYS_EQ_POSE_TPOSE | EVER_NE_POSE_TPOSE | ALWAYS_NE_POSE_TPOSE | EVER_EQ_TPOSE_TPOSE | ALWAYS_EQ_TPOSE_TPOSE | EVER_NE_TPOSE_TPOSE | ALWAYS_NE_TPOSE_TPOSE | NAD_TPOSE_TPOSE | EVER_EQ_TRGEOMETRY_GEO | ALWAYS_EQ_TRGEOMETRY_GEO | EVER_NE_TRGEOMETRY_GEO | ALWAYS_NE_TRGEOMETRY_GEO | NAD_TRGEOMETRY_GEO | EVER_EQ_GEO_TRGEOMETRY | ALWAYS_EQ_GEO_TRGEOMETRY | EVER_NE_GEO_TRGEOMETRY | ALWAYS_NE_GEO_TRGEOMETRY | EVER_EQ_TRGEOMETRY_TRGEOMETRY | ALWAYS_EQ_TRGEOMETRY_TRGEOMETRY | EVER_NE_TRGEOMETRY_TRGEOMETRY | ALWAYS_NE_TRGEOMETRY_TRGEOMETRY | NAD_TRGEOMETRY_TRGEOMETRY | EINTERSECTS_TPCPOINT_GEO | NAD_TPCPOINT_GEO | QUADBIN_POINT_TO_CELL | QUADBIN_IS_VALID_CELL | QUADBIN_GET_RESOLUTION | QUADBIN_CELL_AREA | QUADBIN_CELL_TO_QUADKEY | QUADBIN_CELL_TO_PARENT | QUADBIN_TILE_TO_CELL | EVER_EQ_TJSONB_JSONB | ALWAYS_EQ_TJSONB_JSONB | EVER_NE_TJSONB_JSONB | ALWAYS_NE_TJSONB_JSONB | EVER_EQ_TJSONB_TJSONB | ALWAYS_EQ_TJSONB_TJSONB | EVER_NE_TJSONB_TJSONB | ALWAYS_NE_TJSONB_TJSONB | GEOM_BOUNDARY | GEOM_CENTROID | GEOM_CONVEX_HULL | GEO_REVERSE | GEO_POINTS | GEOM_UNARY_UNION | GEOM_DIFFERENCE2D | GEOM_INTERSECTION2D | GEOM_SHORTESTLINE2D | GEOM_SHORTESTLINE3D | GEO_SET_SRID | GEO_TRANSFORM | GEO_ROUND | GEOM_BUFFER | GEOM_INTERSECTS2D | GEOM_DWITHIN2D | GEOM_CONTAINS | GEOM_DISJOINT2D | GEOM_COVERS | GEOM_TOUCHES | GEOM_INTERSECTS3D | GEOM_DWITHIN3D | GEOM_DISTANCE2D | GEOM_DISTANCE3D; sinkClause: INTO sink (',' sink)*; @@ -921,6 +921,10 @@ GEOM_DIFFERENCE2D: 'GEOM_DIFFERENCE2D' | 'geom_difference2d'; GEOM_INTERSECTION2D: 'GEOM_INTERSECTION2D' | 'geom_intersection2d'; GEOM_SHORTESTLINE2D: 'GEOM_SHORTESTLINE2D' | 'geom_shortestline2d'; GEOM_SHORTESTLINE3D: 'GEOM_SHORTESTLINE3D' | 'geom_shortestline3d'; +GEO_SET_SRID: 'GEO_SET_SRID' | 'geo_set_srid'; +GEO_TRANSFORM: 'GEO_TRANSFORM' | 'geo_transform'; +GEO_ROUND: 'GEO_ROUND' | 'geo_round'; +GEOM_BUFFER: 'GEOM_BUFFER' | 'geom_buffer'; GEOM_INTERSECTS2D: 'GEOM_INTERSECTS2D' | 'geom_intersects2d'; GEOM_DWITHIN2D: 'GEOM_DWITHIN2D' | 'geom_dwithin2d'; GEOM_CONTAINS: 'GEOM_CONTAINS' | 'geom_contains'; diff --git a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp index 163d318b04..206273efdc 100644 --- a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp +++ b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp @@ -502,6 +502,10 @@ #include #include #include +#include +#include +#include +#include #include #include #include @@ -10852,6 +10856,43 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont return LogicalFunction(GeomShortestline3dLogicalFunction(std::move(arg0), std::move(arg1))); } /* END CODEGEN PARSER GLUE: GEOM_SHORTESTLINE3D */ + case AntlrSQLParser::GEO_SET_SRID: { + PRECONDITION(ctx->functionParam().size() == 2, + "GeoSetSrid requires 2 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + return LogicalFunction(GeoSetSridLogicalFunction(std::move(arg0), std::move(arg1))); + } + /* END CODEGEN PARSER GLUE: GEO_SET_SRID */ + case AntlrSQLParser::GEO_TRANSFORM: { + PRECONDITION(ctx->functionParam().size() == 2, + "GeoTransform requires 2 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + return LogicalFunction(GeoTransformLogicalFunction(std::move(arg0), std::move(arg1))); + } + /* END CODEGEN PARSER GLUE: GEO_TRANSFORM */ + case AntlrSQLParser::GEO_ROUND: { + PRECONDITION(ctx->functionParam().size() == 2, + "GeoRound requires 2 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + return LogicalFunction(GeoRoundLogicalFunction(std::move(arg0), std::move(arg1))); + } + /* END CODEGEN PARSER GLUE: GEO_ROUND */ + case AntlrSQLParser::GEOM_BUFFER: { + PRECONDITION(ctx->functionParam().size() == 3, + "GeomBuffer requires 3 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + return LogicalFunction(GeomBufferLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2))); + } + /* END CODEGEN PARSER GLUE: GEOM_BUFFER */ /* END CODEGEN PARSER GLUE: GEOM_INTERSECTS2D */ case AntlrSQLParser::GEOM_DWITHIN2D: { PRECONDITION(ctx->functionParam().size() == 3, From d6e4daee0ee3ad419d9aae069b73c11621814b93 Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Mon, 15 Jun 2026 20:21:57 +0200 Subject: [PATCH 79/96] feat(meos): add line geometry NES operators (W131) 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. --- .../LineInterpolatePointLogicalFunction.hpp | 48 +++++++++ .../Meos/LineLocatePointLogicalFunction.hpp | 48 +++++++++ .../Meos/LineNumpointsLogicalFunction.hpp | 48 +++++++++ .../Meos/LineSubstringLogicalFunction.hpp | 48 +++++++++ .../src/Functions/Meos/CMakeLists.txt | 4 + .../LineInterpolatePointLogicalFunction.cpp | 102 ++++++++++++++++++ .../Meos/LineLocatePointLogicalFunction.cpp | 99 +++++++++++++++++ .../Meos/LineNumpointsLogicalFunction.cpp | 96 +++++++++++++++++ .../Meos/LineSubstringLogicalFunction.cpp | 102 ++++++++++++++++++ .../LineInterpolatePointPhysicalFunction.hpp | 32 ++++++ .../Meos/LineLocatePointPhysicalFunction.hpp | 32 ++++++ .../Meos/LineNumpointsPhysicalFunction.hpp | 32 ++++++ .../Meos/LineSubstringPhysicalFunction.hpp | 32 ++++++ .../src/Functions/Meos/CMakeLists.txt | 4 + .../LineInterpolatePointPhysicalFunction.cpp | 90 ++++++++++++++++ .../Meos/LineLocatePointPhysicalFunction.cpp | 76 +++++++++++++ .../Meos/LineNumpointsPhysicalFunction.cpp | 71 ++++++++++++ .../Meos/LineSubstringPhysicalFunction.cpp | 90 ++++++++++++++++ nes-sql-parser/AntlrSQL.g4 | 6 +- .../src/AntlrSQLQueryPlanCreator.cpp | 41 +++++++ 20 files changed, 1100 insertions(+), 1 deletion(-) create mode 100644 nes-logical-operators/include/Functions/Meos/LineInterpolatePointLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/LineLocatePointLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/LineNumpointsLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/LineSubstringLogicalFunction.hpp create mode 100644 nes-logical-operators/src/Functions/Meos/LineInterpolatePointLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/LineLocatePointLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/LineNumpointsLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/LineSubstringLogicalFunction.cpp create mode 100644 nes-physical-operators/include/Functions/Meos/LineInterpolatePointPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/LineLocatePointPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/LineNumpointsPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/LineSubstringPhysicalFunction.hpp create mode 100644 nes-physical-operators/src/Functions/Meos/LineInterpolatePointPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/LineLocatePointPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/LineNumpointsPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/LineSubstringPhysicalFunction.cpp diff --git a/nes-logical-operators/include/Functions/Meos/LineInterpolatePointLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/LineInterpolatePointLogicalFunction.hpp new file mode 100644 index 0000000000..51ef5888cd --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/LineInterpolatePointLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns the point (or multi-point if repeat=1) interpolated at the given fraction along a line. + */ +class LineInterpolatePointLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "LineInterpolatePoint"; + + LineInterpolatePointLogicalFunction(LogicalFunction wkt, LogicalFunction frac, LogicalFunction repeat); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/LineLocatePointLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/LineLocatePointLogicalFunction.hpp new file mode 100644 index 0000000000..9a09b8181d --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/LineLocatePointLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns the fractional location (0–1) of the closest point on the line to a point. + */ +class LineLocatePointLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "LineLocatePoint"; + + LineLocatePointLogicalFunction(LogicalFunction wkt1, LogicalFunction wkt2); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/LineNumpointsLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/LineNumpointsLogicalFunction.hpp new file mode 100644 index 0000000000..f3aa1e814f --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/LineNumpointsLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns the number of points in a linestring. + */ +class LineNumpointsLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "LineNumpoints"; + + LineNumpointsLogicalFunction(LogicalFunction wkt); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/LineSubstringLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/LineSubstringLogicalFunction.hpp new file mode 100644 index 0000000000..938bc97d69 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/LineSubstringLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns the portion of a linestring between fractional positions from and to. + */ +class LineSubstringLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "LineSubstring"; + + LineSubstringLogicalFunction(LogicalFunction wkt, LogicalFunction from_f, LogicalFunction to_f); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt index b3467f3f00..749b869b99 100644 --- a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt @@ -455,6 +455,10 @@ add_plugin(GeoSetSrid LogicalFunction nes-logical-operators GeoSetSridLogicalFun add_plugin(GeoTransform LogicalFunction nes-logical-operators GeoTransformLogicalFunction.cpp) add_plugin(GeoRound LogicalFunction nes-logical-operators GeoRoundLogicalFunction.cpp) add_plugin(GeomBuffer LogicalFunction nes-logical-operators GeomBufferLogicalFunction.cpp) +add_plugin(LineNumpoints LogicalFunction nes-logical-operators LineNumpointsLogicalFunction.cpp) +add_plugin(LineLocatePoint LogicalFunction nes-logical-operators LineLocatePointLogicalFunction.cpp) +add_plugin(LineInterpolatePoint LogicalFunction nes-logical-operators LineInterpolatePointLogicalFunction.cpp) +add_plugin(LineSubstring LogicalFunction nes-logical-operators LineSubstringLogicalFunction.cpp) add_plugin(GeomIntersects2d LogicalFunction nes-logical-operators GeomIntersects2dLogicalFunction.cpp) add_plugin(GeomDwithin2d LogicalFunction nes-logical-operators GeomDwithin2dLogicalFunction.cpp) add_plugin(GeomContains LogicalFunction nes-logical-operators GeomContainsLogicalFunction.cpp) diff --git a/nes-logical-operators/src/Functions/Meos/LineInterpolatePointLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/LineInterpolatePointLogicalFunction.cpp new file mode 100644 index 0000000000..92f79d391a --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/LineInterpolatePointLogicalFunction.cpp @@ -0,0 +1,102 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +LineInterpolatePointLogicalFunction::LineInterpolatePointLogicalFunction(LogicalFunction wkt, LogicalFunction frac, LogicalFunction repeat) + : dataType(DataTypeProvider::provideDataType(DataType::Type::VARSIZED)) +{ + parameters.reserve(3); + parameters.push_back(std::move(wkt)); + parameters.push_back(std::move(frac)); + parameters.push_back(std::move(repeat)); +} + +DataType LineInterpolatePointLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction LineInterpolatePointLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector LineInterpolatePointLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction LineInterpolatePointLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, + "LineInterpolatePointLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view LineInterpolatePointLogicalFunction::getType() const { return NAME; } + +bool LineInterpolatePointLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string LineInterpolatePointLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction LineInterpolatePointLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(3); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "wkt must be VARSIZED"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "frac must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "repeat must be UINT64"); + return withChildren(c); +} + +SerializableFunction LineInterpolatePointLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterLineInterpolatePointLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "LineInterpolatePointLogicalFunction requires 3 children but got {}", + arguments.children.size()); + return LineInterpolatePointLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/LineLocatePointLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/LineLocatePointLogicalFunction.cpp new file mode 100644 index 0000000000..3140e7b1c5 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/LineLocatePointLogicalFunction.cpp @@ -0,0 +1,99 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +LineLocatePointLogicalFunction::LineLocatePointLogicalFunction(LogicalFunction wkt1, LogicalFunction wkt2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(2); + parameters.push_back(std::move(wkt1)); + parameters.push_back(std::move(wkt2)); +} + +DataType LineLocatePointLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction LineLocatePointLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector LineLocatePointLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction LineLocatePointLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 2, + "LineLocatePointLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view LineLocatePointLogicalFunction::getType() const { return NAME; } + +bool LineLocatePointLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string LineLocatePointLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction LineLocatePointLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(2); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "wkt1 must be VARSIZED"); + INVARIANT(c[1].getDataType().isType(DataType::Type::VARSIZED), "wkt2 must be VARSIZED"); + return withChildren(c); +} + +SerializableFunction LineLocatePointLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterLineLocatePointLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 2, + "LineLocatePointLogicalFunction requires 2 children but got {}", + arguments.children.size()); + return LineLocatePointLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/LineNumpointsLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/LineNumpointsLogicalFunction.cpp new file mode 100644 index 0000000000..66ff6308ca --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/LineNumpointsLogicalFunction.cpp @@ -0,0 +1,96 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +LineNumpointsLogicalFunction::LineNumpointsLogicalFunction(LogicalFunction wkt) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(1); + parameters.push_back(std::move(wkt)); +} + +DataType LineNumpointsLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction LineNumpointsLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector LineNumpointsLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction LineNumpointsLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 1, + "LineNumpointsLogicalFunction requires 1 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view LineNumpointsLogicalFunction::getType() const { return NAME; } + +bool LineNumpointsLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string LineNumpointsLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction LineNumpointsLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(1); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "wkt must be VARSIZED"); + return withChildren(c); +} + +SerializableFunction LineNumpointsLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterLineNumpointsLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 1, + "LineNumpointsLogicalFunction requires 1 children but got {}", + arguments.children.size()); + return LineNumpointsLogicalFunction( + std::move(arguments.children[0])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/LineSubstringLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/LineSubstringLogicalFunction.cpp new file mode 100644 index 0000000000..a3fe7ed33d --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/LineSubstringLogicalFunction.cpp @@ -0,0 +1,102 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +LineSubstringLogicalFunction::LineSubstringLogicalFunction(LogicalFunction wkt, LogicalFunction from_f, LogicalFunction to_f) + : dataType(DataTypeProvider::provideDataType(DataType::Type::VARSIZED)) +{ + parameters.reserve(3); + parameters.push_back(std::move(wkt)); + parameters.push_back(std::move(from_f)); + parameters.push_back(std::move(to_f)); +} + +DataType LineSubstringLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction LineSubstringLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector LineSubstringLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction LineSubstringLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, + "LineSubstringLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view LineSubstringLogicalFunction::getType() const { return NAME; } + +bool LineSubstringLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string LineSubstringLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction LineSubstringLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(3); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "wkt must be VARSIZED"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "from_f must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "to_f must be FLOAT64"); + return withChildren(c); +} + +SerializableFunction LineSubstringLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterLineSubstringLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "LineSubstringLogicalFunction requires 3 children but got {}", + arguments.children.size()); + return LineSubstringLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2])); +} + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/LineInterpolatePointPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/LineInterpolatePointPhysicalFunction.hpp new file mode 100644 index 0000000000..b619a62647 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/LineInterpolatePointPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class LineInterpolatePointPhysicalFunction : public PhysicalFunctionConcept { +public: + LineInterpolatePointPhysicalFunction(PhysicalFunction wkt, PhysicalFunction frac, PhysicalFunction repeat); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/LineLocatePointPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/LineLocatePointPhysicalFunction.hpp new file mode 100644 index 0000000000..93adb2a189 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/LineLocatePointPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class LineLocatePointPhysicalFunction : public PhysicalFunctionConcept { +public: + LineLocatePointPhysicalFunction(PhysicalFunction wkt1, PhysicalFunction wkt2); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/LineNumpointsPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/LineNumpointsPhysicalFunction.hpp new file mode 100644 index 0000000000..1a03421945 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/LineNumpointsPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class LineNumpointsPhysicalFunction : public PhysicalFunctionConcept { +public: + LineNumpointsPhysicalFunction(PhysicalFunction wkt); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/LineSubstringPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/LineSubstringPhysicalFunction.hpp new file mode 100644 index 0000000000..23994e81d2 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/LineSubstringPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class LineSubstringPhysicalFunction : public PhysicalFunctionConcept { +public: + LineSubstringPhysicalFunction(PhysicalFunction wkt, PhysicalFunction from_f, PhysicalFunction to_f); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt index 75b7c5a802..2becd02bb2 100644 --- a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt @@ -454,6 +454,10 @@ add_plugin(GeoSetSrid PhysicalFunction nes-physical-operators GeoSetSridPhysical add_plugin(GeoTransform PhysicalFunction nes-physical-operators GeoTransformPhysicalFunction.cpp) add_plugin(GeoRound PhysicalFunction nes-physical-operators GeoRoundPhysicalFunction.cpp) add_plugin(GeomBuffer PhysicalFunction nes-physical-operators GeomBufferPhysicalFunction.cpp) +add_plugin(LineNumpoints PhysicalFunction nes-physical-operators LineNumpointsPhysicalFunction.cpp) +add_plugin(LineLocatePoint PhysicalFunction nes-physical-operators LineLocatePointPhysicalFunction.cpp) +add_plugin(LineInterpolatePoint PhysicalFunction nes-physical-operators LineInterpolatePointPhysicalFunction.cpp) +add_plugin(LineSubstring PhysicalFunction nes-physical-operators LineSubstringPhysicalFunction.cpp) add_plugin(GeomIntersects2d PhysicalFunction nes-physical-operators GeomIntersects2dPhysicalFunction.cpp) add_plugin(GeomDwithin2d PhysicalFunction nes-physical-operators GeomDwithin2dPhysicalFunction.cpp) add_plugin(GeomContains PhysicalFunction nes-physical-operators GeomContainsPhysicalFunction.cpp) diff --git a/nes-physical-operators/src/Functions/Meos/LineInterpolatePointPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/LineInterpolatePointPhysicalFunction.cpp new file mode 100644 index 0000000000..e1bd9be8a5 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/LineInterpolatePointPhysicalFunction.cpp @@ -0,0 +1,90 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +LineInterpolatePointPhysicalFunction::LineInterpolatePointPhysicalFunction(PhysicalFunction wkt, PhysicalFunction frac, PhysicalFunction repeat) +{ + paramFns.reserve(3); + paramFns.push_back(std::move(wkt)); + paramFns.push_back(std::move(frac)); + paramFns.push_back(std::move(repeat)); +} + +VarVal LineInterpolatePointPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto wkt = paramFns[0].execute(record, arena).cast(); + auto frac = paramFns[1].execute(record, arena).cast(); + auto repeat = paramFns[2].execute(record, arena).cast>(); + constexpr uint32_t MAX_LEN = 8192; + auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); + + const auto actualLen = nautilus::invoke( + +[](const char* w, uint32_t wsz, double frac, uint64_t repeat, char* buf, uint32_t bufMax) -> uint32_t { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string s(w, wsz); + GSERIALIZED* gs = geom_in(s.c_str(), -1); + if (!gs) return 0u; + GSERIALIZED* result = line_interpolate_point(gs, frac, (bool)repeat); + free(gs); + if (!result) return 0u; + char* out = geo_as_text(result, -1); + free(result); + if (!out) return 0u; + uint32_t len = static_cast(strlen(out)); + if (len > bufMax) len = bufMax; + memcpy(buf, out, len); + free(out); + return len; + } catch (const std::exception&) { return 0u; } + }, + wkt, frac, repeat, outBuf.getContent(), nautilus::val(MAX_LEN)); + + VarVal(actualLen).writeToMemory(outBuf.getReference()); + return outBuf; +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterLineInterpolatePointPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "LineInterpolatePointPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + return LineInterpolatePointPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/LineLocatePointPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/LineLocatePointPhysicalFunction.cpp new file mode 100644 index 0000000000..22cb999698 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/LineLocatePointPhysicalFunction.cpp @@ -0,0 +1,76 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +LineLocatePointPhysicalFunction::LineLocatePointPhysicalFunction(PhysicalFunction wkt1, PhysicalFunction wkt2) +{ + paramFns.reserve(2); + paramFns.push_back(std::move(wkt1)); + paramFns.push_back(std::move(wkt2)); +} + +VarVal LineLocatePointPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto wkt1 = paramFns[0].execute(record, arena).cast(); + auto wkt2 = paramFns[1].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](const char* w1, uint32_t w1sz, const char* w2, uint32_t w2sz) -> double -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string s1(w1, w1sz), s2(w2, w2sz); + GSERIALIZED* gs1 = geom_in(s1.c_str(), -1); + if (!gs1) return 0.0; + GSERIALIZED* gs2 = geom_in(s2.c_str(), -1); + if (!gs2) { free(gs1); return 0.0; } + double r = line_locate_point(gs1, gs2); + free(gs1); free(gs2); + return r; + } catch (const std::exception&) { return 0.0; } + }, + wkt1, wkt2); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterLineLocatePointPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 2, + "LineLocatePointPhysicalFunction requires 2 children but got {}", + arguments.childFunctions.size()); + return LineLocatePointPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/LineNumpointsPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/LineNumpointsPhysicalFunction.cpp new file mode 100644 index 0000000000..60c8c90294 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/LineNumpointsPhysicalFunction.cpp @@ -0,0 +1,71 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +LineNumpointsPhysicalFunction::LineNumpointsPhysicalFunction(PhysicalFunction wkt) +{ + paramFns.reserve(1); + paramFns.push_back(std::move(wkt)); +} + +VarVal LineNumpointsPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto wkt = paramFns[0].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](const char* w, uint32_t wsz) -> double -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string s(w, wsz); + GSERIALIZED* gs = geom_in(s.c_str(), -1); + if (!gs) return 0.0; + int n = line_numpoints(gs); + free(gs); + return (double)n; + } catch (const std::exception&) { return 0.0; } + }, + wkt); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterLineNumpointsPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 1, + "LineNumpointsPhysicalFunction requires 1 children but got {}", + arguments.childFunctions.size()); + return LineNumpointsPhysicalFunction( + std::move(arguments.childFunctions[0])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/LineSubstringPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/LineSubstringPhysicalFunction.cpp new file mode 100644 index 0000000000..94674a3bc2 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/LineSubstringPhysicalFunction.cpp @@ -0,0 +1,90 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +LineSubstringPhysicalFunction::LineSubstringPhysicalFunction(PhysicalFunction wkt, PhysicalFunction from_f, PhysicalFunction to_f) +{ + paramFns.reserve(3); + paramFns.push_back(std::move(wkt)); + paramFns.push_back(std::move(from_f)); + paramFns.push_back(std::move(to_f)); +} + +VarVal LineSubstringPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto wkt = paramFns[0].execute(record, arena).cast(); + auto from_f = paramFns[1].execute(record, arena).cast(); + auto to_f = paramFns[2].execute(record, arena).cast(); + constexpr uint32_t MAX_LEN = 8192; + auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); + + const auto actualLen = nautilus::invoke( + +[](const char* w, uint32_t wsz, double from_f, double to_f, char* buf, uint32_t bufMax) -> uint32_t { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string s(w, wsz); + GSERIALIZED* gs = geom_in(s.c_str(), -1); + if (!gs) return 0u; + GSERIALIZED* result = line_substring(gs, from_f, to_f); + free(gs); + if (!result) return 0u; + char* out = geo_as_text(result, -1); + free(result); + if (!out) return 0u; + uint32_t len = static_cast(strlen(out)); + if (len > bufMax) len = bufMax; + memcpy(buf, out, len); + free(out); + return len; + } catch (const std::exception&) { return 0u; } + }, + wkt, from_f, to_f, outBuf.getContent(), nautilus::val(MAX_LEN)); + + VarVal(actualLen).writeToMemory(outBuf.getReference()); + return outBuf; +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterLineSubstringPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "LineSubstringPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + return LineSubstringPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2])); +} + +} // namespace NES diff --git a/nes-sql-parser/AntlrSQL.g4 b/nes-sql-parser/AntlrSQL.g4 index eb009ac65c..d26bb195ca 100644 --- a/nes-sql-parser/AntlrSQL.g4 +++ b/nes-sql-parser/AntlrSQL.g4 @@ -295,7 +295,7 @@ timeUnit: MS timestampParameter: name=identifier; -functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT | TGE_TTEXT_TEXT | TGE_TEXT_TTEXT | TGT_TTEXT_TEXT | TGT_TEXT_TTEXT | TLE_TTEXT_TEXT | TLE_TEXT_TTEXT | TLT_TTEXT_TEXT | TLT_TEXT_TTEXT | TTEXT_UPPER | TTEXT_LOWER | TTEXT_INITCAP | TEXTCAT_TTEXT_TEXT | TEXTCAT_TEXT_TTEXT | TEXTCAT_TTEXT_TTEXT | GEOM_LENGTH | GEOM_PERIMETER | GEOM_AZIMUTH | GEOG_AREA | GEOG_LENGTH | GEOG_PERIMETER | GEOM_IS_EMPTY | AINTERSECTS_TGEO_GEO | ACOVERS_TGEO_GEO | ADISJOINT_TGEO_GEO | ADWITHIN_TGEO_GEO | EINTERSECTS_TGEO_GEO | ETOUCHES_TGEO_GEO | ECONTAINS_TGEO_GEO | ACONTAINS_TGEO_GEO | ATOUCHES_TGEO_GEO | GEO_NUM_POINTS | GEO_NUM_GEOS | GEO_SRID | GEO_IS_UNITARY | GEO_EQUALS | GEO_SAME | GEOG_DISTANCE | NAD_TGEO_GEO | EVER_EQ_TGEO_GEO | EVER_NE_TGEO_GEO | ALWAYS_EQ_TGEO_GEO | ALWAYS_NE_TGEO_GEO | GEOG_INTERSECTS | GEOG_DWITHIN | ACOVERS_GEO_TGEO | GEOM_INTERSECTS | GEOM_DWITHIN | H3_GS_POINT_TO_CELL | EVER_EQ_TH3INDEX_H3INDEX | EVER_NE_TH3INDEX_H3INDEX | ALWAYS_EQ_TH3INDEX_H3INDEX | ALWAYS_NE_TH3INDEX_H3INDEX | TH3INDEX_GET_RESOLUTION | TH3INDEX_GET_BASE_CELL_NUMBER | TH3INDEX_IS_VALID_CELL | TH3INDEX_IS_PENTAGON | TH3INDEX_CELL_TO_PARENT_NEXT | TH3INDEX_CELL_TO_CENTER_CHILD_NEXT | TH3INDEX_CELL_TO_PARENT | TH3INDEX_CELL_TO_CENTER_CHILD | TH3INDEX_CELL_TO_CHILD_POS | TH3INDEX_ARE_NEIGHBOR_CELLS | TH3INDEX_GRID_DISTANCE | EINTERSECTS_TCBUFFER_GEO | AINTERSECTS_TCBUFFER_GEO | ECOVERS_TCBUFFER_GEO | ACOVERS_TCBUFFER_GEO | EDISJOINT_TCBUFFER_GEO | ADISJOINT_TCBUFFER_GEO | ETOUCHES_TCBUFFER_GEO | ATOUCHES_TCBUFFER_GEO | ECONTAINS_TCBUFFER_GEO | ACONTAINS_TCBUFFER_GEO | NAD_TCBUFFER_GEO | EDWITHIN_TCBUFFER_GEO | ADWITHIN_TCBUFFER_GEO | EINTERSECTS_TCBUFFER_CBUFFER | AINTERSECTS_TCBUFFER_CBUFFER | ECOVERS_TCBUFFER_CBUFFER | ACOVERS_TCBUFFER_CBUFFER | EDISJOINT_TCBUFFER_CBUFFER | ADISJOINT_TCBUFFER_CBUFFER | ETOUCHES_TCBUFFER_CBUFFER | ATOUCHES_TCBUFFER_CBUFFER | ECONTAINS_TCBUFFER_CBUFFER | ACONTAINS_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_CBUFFER | ALWAYS_EQ_TCBUFFER_CBUFFER | EVER_NE_TCBUFFER_CBUFFER | ALWAYS_NE_TCBUFFER_CBUFFER | NAD_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_TCBUFFER | ALWAYS_EQ_TCBUFFER_TCBUFFER | EVER_NE_TCBUFFER_TCBUFFER | ALWAYS_NE_TCBUFFER_TCBUFFER | EINTERSECTS_TCBUFFER_TCBUFFER | AINTERSECTS_TCBUFFER_TCBUFFER | ECOVERS_TCBUFFER_TCBUFFER | ACOVERS_TCBUFFER_TCBUFFER | ADISJOINT_TCBUFFER_TCBUFFER | ETOUCHES_TCBUFFER_TCBUFFER | ATOUCHES_TCBUFFER_TCBUFFER | NAD_TCBUFFER_TCBUFFER | EDWITHIN_TCBUFFER_TCBUFFER | ADWITHIN_TCBUFFER_TCBUFFER | MINDISTANCE_TCBUFFER_TCBUFFER | NAD_TNPOINT_GEO | EVER_EQ_TNPOINT_NPOINT | ALWAYS_EQ_TNPOINT_NPOINT | EVER_NE_TNPOINT_NPOINT | ALWAYS_NE_TNPOINT_NPOINT | NAD_TNPOINT_NPOINT | EVER_EQ_NPOINT_TNPOINT | ALWAYS_EQ_NPOINT_TNPOINT | EVER_NE_NPOINT_TNPOINT | ALWAYS_NE_NPOINT_TNPOINT | EVER_EQ_TNPOINT_TNPOINT | ALWAYS_EQ_TNPOINT_TNPOINT | EVER_NE_TNPOINT_TNPOINT | ALWAYS_NE_TNPOINT_TNPOINT | NAD_TNPOINT_TNPOINT | NAD_TPOSE_GEO | EVER_EQ_TPOSE_POSE | ALWAYS_EQ_TPOSE_POSE | EVER_NE_TPOSE_POSE | ALWAYS_NE_TPOSE_POSE | NAD_TPOSE_POSE | EVER_EQ_POSE_TPOSE | ALWAYS_EQ_POSE_TPOSE | EVER_NE_POSE_TPOSE | ALWAYS_NE_POSE_TPOSE | EVER_EQ_TPOSE_TPOSE | ALWAYS_EQ_TPOSE_TPOSE | EVER_NE_TPOSE_TPOSE | ALWAYS_NE_TPOSE_TPOSE | NAD_TPOSE_TPOSE | EVER_EQ_TRGEOMETRY_GEO | ALWAYS_EQ_TRGEOMETRY_GEO | EVER_NE_TRGEOMETRY_GEO | ALWAYS_NE_TRGEOMETRY_GEO | NAD_TRGEOMETRY_GEO | EVER_EQ_GEO_TRGEOMETRY | ALWAYS_EQ_GEO_TRGEOMETRY | EVER_NE_GEO_TRGEOMETRY | ALWAYS_NE_GEO_TRGEOMETRY | EVER_EQ_TRGEOMETRY_TRGEOMETRY | ALWAYS_EQ_TRGEOMETRY_TRGEOMETRY | EVER_NE_TRGEOMETRY_TRGEOMETRY | ALWAYS_NE_TRGEOMETRY_TRGEOMETRY | NAD_TRGEOMETRY_TRGEOMETRY | EINTERSECTS_TPCPOINT_GEO | NAD_TPCPOINT_GEO | QUADBIN_POINT_TO_CELL | QUADBIN_IS_VALID_CELL | QUADBIN_GET_RESOLUTION | QUADBIN_CELL_AREA | QUADBIN_CELL_TO_QUADKEY | QUADBIN_CELL_TO_PARENT | QUADBIN_TILE_TO_CELL | EVER_EQ_TJSONB_JSONB | ALWAYS_EQ_TJSONB_JSONB | EVER_NE_TJSONB_JSONB | ALWAYS_NE_TJSONB_JSONB | EVER_EQ_TJSONB_TJSONB | ALWAYS_EQ_TJSONB_TJSONB | EVER_NE_TJSONB_TJSONB | ALWAYS_NE_TJSONB_TJSONB | GEOM_BOUNDARY | GEOM_CENTROID | GEOM_CONVEX_HULL | GEO_REVERSE | GEO_POINTS | GEOM_UNARY_UNION | GEOM_DIFFERENCE2D | GEOM_INTERSECTION2D | GEOM_SHORTESTLINE2D | GEOM_SHORTESTLINE3D | GEO_SET_SRID | GEO_TRANSFORM | GEO_ROUND | GEOM_BUFFER | GEOM_INTERSECTS2D | GEOM_DWITHIN2D | GEOM_CONTAINS | GEOM_DISJOINT2D | GEOM_COVERS | GEOM_TOUCHES | GEOM_INTERSECTS3D | GEOM_DWITHIN3D | GEOM_DISTANCE2D | GEOM_DISTANCE3D; +functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT | TGE_TTEXT_TEXT | TGE_TEXT_TTEXT | TGT_TTEXT_TEXT | TGT_TEXT_TTEXT | TLE_TTEXT_TEXT | TLE_TEXT_TTEXT | TLT_TTEXT_TEXT | TLT_TEXT_TTEXT | TTEXT_UPPER | TTEXT_LOWER | TTEXT_INITCAP | TEXTCAT_TTEXT_TEXT | TEXTCAT_TEXT_TTEXT | TEXTCAT_TTEXT_TTEXT | GEOM_LENGTH | GEOM_PERIMETER | GEOM_AZIMUTH | GEOG_AREA | GEOG_LENGTH | GEOG_PERIMETER | GEOM_IS_EMPTY | AINTERSECTS_TGEO_GEO | ACOVERS_TGEO_GEO | ADISJOINT_TGEO_GEO | ADWITHIN_TGEO_GEO | EINTERSECTS_TGEO_GEO | ETOUCHES_TGEO_GEO | ECONTAINS_TGEO_GEO | ACONTAINS_TGEO_GEO | ATOUCHES_TGEO_GEO | GEO_NUM_POINTS | GEO_NUM_GEOS | GEO_SRID | GEO_IS_UNITARY | GEO_EQUALS | GEO_SAME | GEOG_DISTANCE | NAD_TGEO_GEO | EVER_EQ_TGEO_GEO | EVER_NE_TGEO_GEO | ALWAYS_EQ_TGEO_GEO | ALWAYS_NE_TGEO_GEO | GEOG_INTERSECTS | GEOG_DWITHIN | ACOVERS_GEO_TGEO | GEOM_INTERSECTS | GEOM_DWITHIN | H3_GS_POINT_TO_CELL | EVER_EQ_TH3INDEX_H3INDEX | EVER_NE_TH3INDEX_H3INDEX | ALWAYS_EQ_TH3INDEX_H3INDEX | ALWAYS_NE_TH3INDEX_H3INDEX | TH3INDEX_GET_RESOLUTION | TH3INDEX_GET_BASE_CELL_NUMBER | TH3INDEX_IS_VALID_CELL | TH3INDEX_IS_PENTAGON | TH3INDEX_CELL_TO_PARENT_NEXT | TH3INDEX_CELL_TO_CENTER_CHILD_NEXT | TH3INDEX_CELL_TO_PARENT | TH3INDEX_CELL_TO_CENTER_CHILD | TH3INDEX_CELL_TO_CHILD_POS | TH3INDEX_ARE_NEIGHBOR_CELLS | TH3INDEX_GRID_DISTANCE | EINTERSECTS_TCBUFFER_GEO | AINTERSECTS_TCBUFFER_GEO | ECOVERS_TCBUFFER_GEO | ACOVERS_TCBUFFER_GEO | EDISJOINT_TCBUFFER_GEO | ADISJOINT_TCBUFFER_GEO | ETOUCHES_TCBUFFER_GEO | ATOUCHES_TCBUFFER_GEO | ECONTAINS_TCBUFFER_GEO | ACONTAINS_TCBUFFER_GEO | NAD_TCBUFFER_GEO | EDWITHIN_TCBUFFER_GEO | ADWITHIN_TCBUFFER_GEO | EINTERSECTS_TCBUFFER_CBUFFER | AINTERSECTS_TCBUFFER_CBUFFER | ECOVERS_TCBUFFER_CBUFFER | ACOVERS_TCBUFFER_CBUFFER | EDISJOINT_TCBUFFER_CBUFFER | ADISJOINT_TCBUFFER_CBUFFER | ETOUCHES_TCBUFFER_CBUFFER | ATOUCHES_TCBUFFER_CBUFFER | ECONTAINS_TCBUFFER_CBUFFER | ACONTAINS_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_CBUFFER | ALWAYS_EQ_TCBUFFER_CBUFFER | EVER_NE_TCBUFFER_CBUFFER | ALWAYS_NE_TCBUFFER_CBUFFER | NAD_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_TCBUFFER | ALWAYS_EQ_TCBUFFER_TCBUFFER | EVER_NE_TCBUFFER_TCBUFFER | ALWAYS_NE_TCBUFFER_TCBUFFER | EINTERSECTS_TCBUFFER_TCBUFFER | AINTERSECTS_TCBUFFER_TCBUFFER | ECOVERS_TCBUFFER_TCBUFFER | ACOVERS_TCBUFFER_TCBUFFER | ADISJOINT_TCBUFFER_TCBUFFER | ETOUCHES_TCBUFFER_TCBUFFER | ATOUCHES_TCBUFFER_TCBUFFER | NAD_TCBUFFER_TCBUFFER | EDWITHIN_TCBUFFER_TCBUFFER | ADWITHIN_TCBUFFER_TCBUFFER | MINDISTANCE_TCBUFFER_TCBUFFER | NAD_TNPOINT_GEO | EVER_EQ_TNPOINT_NPOINT | ALWAYS_EQ_TNPOINT_NPOINT | EVER_NE_TNPOINT_NPOINT | ALWAYS_NE_TNPOINT_NPOINT | NAD_TNPOINT_NPOINT | EVER_EQ_NPOINT_TNPOINT | ALWAYS_EQ_NPOINT_TNPOINT | EVER_NE_NPOINT_TNPOINT | ALWAYS_NE_NPOINT_TNPOINT | EVER_EQ_TNPOINT_TNPOINT | ALWAYS_EQ_TNPOINT_TNPOINT | EVER_NE_TNPOINT_TNPOINT | ALWAYS_NE_TNPOINT_TNPOINT | NAD_TNPOINT_TNPOINT | NAD_TPOSE_GEO | EVER_EQ_TPOSE_POSE | ALWAYS_EQ_TPOSE_POSE | EVER_NE_TPOSE_POSE | ALWAYS_NE_TPOSE_POSE | NAD_TPOSE_POSE | EVER_EQ_POSE_TPOSE | ALWAYS_EQ_POSE_TPOSE | EVER_NE_POSE_TPOSE | ALWAYS_NE_POSE_TPOSE | EVER_EQ_TPOSE_TPOSE | ALWAYS_EQ_TPOSE_TPOSE | EVER_NE_TPOSE_TPOSE | ALWAYS_NE_TPOSE_TPOSE | NAD_TPOSE_TPOSE | EVER_EQ_TRGEOMETRY_GEO | ALWAYS_EQ_TRGEOMETRY_GEO | EVER_NE_TRGEOMETRY_GEO | ALWAYS_NE_TRGEOMETRY_GEO | NAD_TRGEOMETRY_GEO | EVER_EQ_GEO_TRGEOMETRY | ALWAYS_EQ_GEO_TRGEOMETRY | EVER_NE_GEO_TRGEOMETRY | ALWAYS_NE_GEO_TRGEOMETRY | EVER_EQ_TRGEOMETRY_TRGEOMETRY | ALWAYS_EQ_TRGEOMETRY_TRGEOMETRY | EVER_NE_TRGEOMETRY_TRGEOMETRY | ALWAYS_NE_TRGEOMETRY_TRGEOMETRY | NAD_TRGEOMETRY_TRGEOMETRY | EINTERSECTS_TPCPOINT_GEO | NAD_TPCPOINT_GEO | QUADBIN_POINT_TO_CELL | QUADBIN_IS_VALID_CELL | QUADBIN_GET_RESOLUTION | QUADBIN_CELL_AREA | QUADBIN_CELL_TO_QUADKEY | QUADBIN_CELL_TO_PARENT | QUADBIN_TILE_TO_CELL | EVER_EQ_TJSONB_JSONB | ALWAYS_EQ_TJSONB_JSONB | EVER_NE_TJSONB_JSONB | ALWAYS_NE_TJSONB_JSONB | EVER_EQ_TJSONB_TJSONB | ALWAYS_EQ_TJSONB_TJSONB | EVER_NE_TJSONB_TJSONB | ALWAYS_NE_TJSONB_TJSONB | GEOM_BOUNDARY | GEOM_CENTROID | GEOM_CONVEX_HULL | GEO_REVERSE | GEO_POINTS | GEOM_UNARY_UNION | GEOM_DIFFERENCE2D | GEOM_INTERSECTION2D | GEOM_SHORTESTLINE2D | GEOM_SHORTESTLINE3D | GEO_SET_SRID | GEO_TRANSFORM | GEO_ROUND | GEOM_BUFFER | LINE_NUMPOINTS | LINE_LOCATE_POINT | LINE_INTERPOLATE_POINT | LINE_SUBSTRING | GEOM_INTERSECTS2D | GEOM_DWITHIN2D | GEOM_CONTAINS | GEOM_DISJOINT2D | GEOM_COVERS | GEOM_TOUCHES | GEOM_INTERSECTS3D | GEOM_DWITHIN3D | GEOM_DISTANCE2D | GEOM_DISTANCE3D; sinkClause: INTO sink (',' sink)*; @@ -925,6 +925,10 @@ GEO_SET_SRID: 'GEO_SET_SRID' | 'geo_set_srid'; GEO_TRANSFORM: 'GEO_TRANSFORM' | 'geo_transform'; GEO_ROUND: 'GEO_ROUND' | 'geo_round'; GEOM_BUFFER: 'GEOM_BUFFER' | 'geom_buffer'; +LINE_NUMPOINTS: 'LINE_NUMPOINTS' | 'line_numpoints'; +LINE_LOCATE_POINT: 'LINE_LOCATE_POINT' | 'line_locate_point'; +LINE_INTERPOLATE_POINT: 'LINE_INTERPOLATE_POINT' | 'line_interpolate_point'; +LINE_SUBSTRING: 'LINE_SUBSTRING' | 'line_substring'; GEOM_INTERSECTS2D: 'GEOM_INTERSECTS2D' | 'geom_intersects2d'; GEOM_DWITHIN2D: 'GEOM_DWITHIN2D' | 'geom_dwithin2d'; GEOM_CONTAINS: 'GEOM_CONTAINS' | 'geom_contains'; diff --git a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp index 206273efdc..12db65ad9e 100644 --- a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp +++ b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp @@ -506,6 +506,10 @@ #include #include #include +#include +#include +#include +#include #include #include #include @@ -10893,6 +10897,43 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont return LogicalFunction(GeomBufferLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2))); } /* END CODEGEN PARSER GLUE: GEOM_BUFFER */ + case AntlrSQLParser::LINE_NUMPOINTS: { + PRECONDITION(ctx->functionParam().size() == 1, + "LineNumpoints requires 1 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + return LogicalFunction(LineNumpointsLogicalFunction(std::move(arg0))); + } + /* END CODEGEN PARSER GLUE: LINE_NUMPOINTS */ + case AntlrSQLParser::LINE_LOCATE_POINT: { + PRECONDITION(ctx->functionParam().size() == 2, + "LineLocatePoint requires 2 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + return LogicalFunction(LineLocatePointLogicalFunction(std::move(arg0), std::move(arg1))); + } + /* END CODEGEN PARSER GLUE: LINE_LOCATE_POINT */ + case AntlrSQLParser::LINE_INTERPOLATE_POINT: { + PRECONDITION(ctx->functionParam().size() == 3, + "LineInterpolatePoint requires 3 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + return LogicalFunction(LineInterpolatePointLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2))); + } + /* END CODEGEN PARSER GLUE: LINE_INTERPOLATE_POINT */ + case AntlrSQLParser::LINE_SUBSTRING: { + PRECONDITION(ctx->functionParam().size() == 3, + "LineSubstring requires 3 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + return LogicalFunction(LineSubstringLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2))); + } + /* END CODEGEN PARSER GLUE: LINE_SUBSTRING */ /* END CODEGEN PARSER GLUE: GEOM_INTERSECTS2D */ case AntlrSQLParser::GEOM_DWITHIN2D: { PRECONDITION(ctx->functionParam().size() == 3, From 189fb6c2b80325b01bd26b5b0ff783b53087de1e Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Mon, 15 Jun 2026 20:22:08 +0200 Subject: [PATCH 80/96] feat(meos): add geometry constructor and conversion NES operators (W132) 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. --- .../Meos/GeogCentroidLogicalFunction.hpp | 48 ++++++++ .../Meos/GeogPointMake2dLogicalFunction.hpp | 48 ++++++++ .../Meos/GeogPointMake3dzLogicalFunction.hpp | 48 ++++++++ .../Meos/GeogToGeomLogicalFunction.hpp | 48 ++++++++ .../Meos/GeomPointMake2dLogicalFunction.hpp | 48 ++++++++ .../Meos/GeomPointMake3dzLogicalFunction.hpp | 48 ++++++++ .../Meos/GeomToGeogLogicalFunction.hpp | 48 ++++++++ .../src/Functions/Meos/CMakeLists.txt | 7 ++ .../Meos/GeogCentroidLogicalFunction.cpp | 99 +++++++++++++++++ .../Meos/GeogPointMake2dLogicalFunction.cpp | 102 +++++++++++++++++ .../Meos/GeogPointMake3dzLogicalFunction.cpp | 105 ++++++++++++++++++ .../Meos/GeogToGeomLogicalFunction.cpp | 96 ++++++++++++++++ .../Meos/GeomPointMake2dLogicalFunction.cpp | 102 +++++++++++++++++ .../Meos/GeomPointMake3dzLogicalFunction.cpp | 105 ++++++++++++++++++ .../Meos/GeomToGeogLogicalFunction.cpp | 96 ++++++++++++++++ .../Meos/GeogCentroidPhysicalFunction.hpp | 32 ++++++ .../Meos/GeogPointMake2dPhysicalFunction.hpp | 32 ++++++ .../Meos/GeogPointMake3dzPhysicalFunction.hpp | 32 ++++++ .../Meos/GeogToGeomPhysicalFunction.hpp | 32 ++++++ .../Meos/GeomPointMake2dPhysicalFunction.hpp | 32 ++++++ .../Meos/GeomPointMake3dzPhysicalFunction.hpp | 32 ++++++ .../Meos/GeomToGeogPhysicalFunction.hpp | 32 ++++++ .../src/Functions/Meos/CMakeLists.txt | 7 ++ .../Meos/GeogCentroidPhysicalFunction.cpp | 87 +++++++++++++++ .../Meos/GeogPointMake2dPhysicalFunction.cpp | 86 ++++++++++++++ .../Meos/GeogPointMake3dzPhysicalFunction.cpp | 89 +++++++++++++++ .../Meos/GeogToGeomPhysicalFunction.cpp | 84 ++++++++++++++ .../Meos/GeomPointMake2dPhysicalFunction.cpp | 86 ++++++++++++++ .../Meos/GeomPointMake3dzPhysicalFunction.cpp | 89 +++++++++++++++ .../Meos/GeomToGeogPhysicalFunction.cpp | 84 ++++++++++++++ nes-sql-parser/AntlrSQL.g4 | 9 +- .../src/AntlrSQLQueryPlanCreator.cpp | 74 ++++++++++++ 32 files changed, 1966 insertions(+), 1 deletion(-) create mode 100644 nes-logical-operators/include/Functions/Meos/GeogCentroidLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/GeogPointMake2dLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/GeogPointMake3dzLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/GeogToGeomLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/GeomPointMake2dLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/GeomPointMake3dzLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/GeomToGeogLogicalFunction.hpp create mode 100644 nes-logical-operators/src/Functions/Meos/GeogCentroidLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/GeogPointMake2dLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/GeogPointMake3dzLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/GeogToGeomLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/GeomPointMake2dLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/GeomPointMake3dzLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/GeomToGeogLogicalFunction.cpp create mode 100644 nes-physical-operators/include/Functions/Meos/GeogCentroidPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/GeogPointMake2dPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/GeogPointMake3dzPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/GeogToGeomPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/GeomPointMake2dPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/GeomPointMake3dzPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/GeomToGeogPhysicalFunction.hpp create mode 100644 nes-physical-operators/src/Functions/Meos/GeogCentroidPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/GeogPointMake2dPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/GeogPointMake3dzPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/GeogToGeomPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/GeomPointMake2dPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/GeomPointMake3dzPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/GeomToGeogPhysicalFunction.cpp diff --git a/nes-logical-operators/include/Functions/Meos/GeogCentroidLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeogCentroidLogicalFunction.hpp new file mode 100644 index 0000000000..535f5feebf --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/GeogCentroidLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns the centroid of a geography (use_spheroid=1 for spheroid, 0 for sphere) as WKT. + */ +class GeogCentroidLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "GeogCentroid"; + + GeogCentroidLogicalFunction(LogicalFunction wkt, LogicalFunction use_spheroid); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/GeogPointMake2dLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeogPointMake2dLogicalFunction.hpp new file mode 100644 index 0000000000..d5a5932c88 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/GeogPointMake2dLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Constructs a 2D geography point from SRID, x, and y as WKT. + */ +class GeogPointMake2dLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "GeogPointMake2d"; + + GeogPointMake2dLogicalFunction(LogicalFunction srid, LogicalFunction x, LogicalFunction y); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/GeogPointMake3dzLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeogPointMake3dzLogicalFunction.hpp new file mode 100644 index 0000000000..b3f4f1e9bb --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/GeogPointMake3dzLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Constructs a 3DZ geography point from SRID, x, y, and z as WKT. + */ +class GeogPointMake3dzLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "GeogPointMake3dz"; + + GeogPointMake3dzLogicalFunction(LogicalFunction srid, LogicalFunction x, LogicalFunction y, LogicalFunction z); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/GeogToGeomLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeogToGeomLogicalFunction.hpp new file mode 100644 index 0000000000..7b476ff5a1 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/GeogToGeomLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Converts a geography to a geometry as WKT. + */ +class GeogToGeomLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "GeogToGeom"; + + GeogToGeomLogicalFunction(LogicalFunction wkt); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/GeomPointMake2dLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeomPointMake2dLogicalFunction.hpp new file mode 100644 index 0000000000..cea1afe7e1 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/GeomPointMake2dLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Constructs a 2D geometry point from SRID, x, and y as WKT. + */ +class GeomPointMake2dLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "GeomPointMake2d"; + + GeomPointMake2dLogicalFunction(LogicalFunction srid, LogicalFunction x, LogicalFunction y); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/GeomPointMake3dzLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeomPointMake3dzLogicalFunction.hpp new file mode 100644 index 0000000000..1415b13d98 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/GeomPointMake3dzLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Constructs a 3DZ geometry point from SRID, x, y, and z as WKT. + */ +class GeomPointMake3dzLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "GeomPointMake3dz"; + + GeomPointMake3dzLogicalFunction(LogicalFunction srid, LogicalFunction x, LogicalFunction y, LogicalFunction z); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/GeomToGeogLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeomToGeogLogicalFunction.hpp new file mode 100644 index 0000000000..f9cef59303 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/GeomToGeogLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Converts a geometry to a geography as WKT. + */ +class GeomToGeogLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "GeomToGeog"; + + GeomToGeogLogicalFunction(LogicalFunction wkt); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt index 749b869b99..505a3df92b 100644 --- a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt @@ -459,6 +459,13 @@ add_plugin(LineNumpoints LogicalFunction nes-logical-operators LineNumpointsLogi add_plugin(LineLocatePoint LogicalFunction nes-logical-operators LineLocatePointLogicalFunction.cpp) add_plugin(LineInterpolatePoint LogicalFunction nes-logical-operators LineInterpolatePointLogicalFunction.cpp) add_plugin(LineSubstring LogicalFunction nes-logical-operators LineSubstringLogicalFunction.cpp) +add_plugin(GeomPointMake2d LogicalFunction nes-logical-operators GeomPointMake2dLogicalFunction.cpp) +add_plugin(GeomPointMake3dz LogicalFunction nes-logical-operators GeomPointMake3dzLogicalFunction.cpp) +add_plugin(GeogPointMake2d LogicalFunction nes-logical-operators GeogPointMake2dLogicalFunction.cpp) +add_plugin(GeogPointMake3dz LogicalFunction nes-logical-operators GeogPointMake3dzLogicalFunction.cpp) +add_plugin(GeomToGeog LogicalFunction nes-logical-operators GeomToGeogLogicalFunction.cpp) +add_plugin(GeogToGeom LogicalFunction nes-logical-operators GeogToGeomLogicalFunction.cpp) +add_plugin(GeogCentroid LogicalFunction nes-logical-operators GeogCentroidLogicalFunction.cpp) add_plugin(GeomIntersects2d LogicalFunction nes-logical-operators GeomIntersects2dLogicalFunction.cpp) add_plugin(GeomDwithin2d LogicalFunction nes-logical-operators GeomDwithin2dLogicalFunction.cpp) add_plugin(GeomContains LogicalFunction nes-logical-operators GeomContainsLogicalFunction.cpp) diff --git a/nes-logical-operators/src/Functions/Meos/GeogCentroidLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeogCentroidLogicalFunction.cpp new file mode 100644 index 0000000000..6d434f8684 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/GeogCentroidLogicalFunction.cpp @@ -0,0 +1,99 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +GeogCentroidLogicalFunction::GeogCentroidLogicalFunction(LogicalFunction wkt, LogicalFunction use_spheroid) + : dataType(DataTypeProvider::provideDataType(DataType::Type::VARSIZED)) +{ + parameters.reserve(2); + parameters.push_back(std::move(wkt)); + parameters.push_back(std::move(use_spheroid)); +} + +DataType GeogCentroidLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction GeogCentroidLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector GeogCentroidLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction GeogCentroidLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 2, + "GeogCentroidLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view GeogCentroidLogicalFunction::getType() const { return NAME; } + +bool GeogCentroidLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string GeogCentroidLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction GeogCentroidLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(2); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "wkt must be VARSIZED"); + INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "use_spheroid must be UINT64"); + return withChildren(c); +} + +SerializableFunction GeogCentroidLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeogCentroidLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 2, + "GeogCentroidLogicalFunction requires 2 children but got {}", + arguments.children.size()); + return GeogCentroidLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/GeogPointMake2dLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeogPointMake2dLogicalFunction.cpp new file mode 100644 index 0000000000..b0f2357278 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/GeogPointMake2dLogicalFunction.cpp @@ -0,0 +1,102 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +GeogPointMake2dLogicalFunction::GeogPointMake2dLogicalFunction(LogicalFunction srid, LogicalFunction x, LogicalFunction y) + : dataType(DataTypeProvider::provideDataType(DataType::Type::VARSIZED)) +{ + parameters.reserve(3); + parameters.push_back(std::move(srid)); + parameters.push_back(std::move(x)); + parameters.push_back(std::move(y)); +} + +DataType GeogPointMake2dLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction GeogPointMake2dLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector GeogPointMake2dLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction GeogPointMake2dLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, + "GeogPointMake2dLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view GeogPointMake2dLogicalFunction::getType() const { return NAME; } + +bool GeogPointMake2dLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string GeogPointMake2dLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction GeogPointMake2dLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(3); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "srid must be UINT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "x must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "y must be FLOAT64"); + return withChildren(c); +} + +SerializableFunction GeogPointMake2dLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeogPointMake2dLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "GeogPointMake2dLogicalFunction requires 3 children but got {}", + arguments.children.size()); + return GeogPointMake2dLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/GeogPointMake3dzLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeogPointMake3dzLogicalFunction.cpp new file mode 100644 index 0000000000..23c43682f8 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/GeogPointMake3dzLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +GeogPointMake3dzLogicalFunction::GeogPointMake3dzLogicalFunction(LogicalFunction srid, LogicalFunction x, LogicalFunction y, LogicalFunction z) + : dataType(DataTypeProvider::provideDataType(DataType::Type::VARSIZED)) +{ + parameters.reserve(4); + parameters.push_back(std::move(srid)); + parameters.push_back(std::move(x)); + parameters.push_back(std::move(y)); + parameters.push_back(std::move(z)); +} + +DataType GeogPointMake3dzLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction GeogPointMake3dzLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector GeogPointMake3dzLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction GeogPointMake3dzLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 4, + "GeogPointMake3dzLogicalFunction requires 4 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view GeogPointMake3dzLogicalFunction::getType() const { return NAME; } + +bool GeogPointMake3dzLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string GeogPointMake3dzLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction GeogPointMake3dzLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(4); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "srid must be UINT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "x must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "y must be FLOAT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::FLOAT64), "z must be FLOAT64"); + return withChildren(c); +} + +SerializableFunction GeogPointMake3dzLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeogPointMake3dzLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 4, + "GeogPointMake3dzLogicalFunction requires 4 children but got {}", + arguments.children.size()); + return GeogPointMake3dzLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/GeogToGeomLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeogToGeomLogicalFunction.cpp new file mode 100644 index 0000000000..a028f92f75 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/GeogToGeomLogicalFunction.cpp @@ -0,0 +1,96 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +GeogToGeomLogicalFunction::GeogToGeomLogicalFunction(LogicalFunction wkt) + : dataType(DataTypeProvider::provideDataType(DataType::Type::VARSIZED)) +{ + parameters.reserve(1); + parameters.push_back(std::move(wkt)); +} + +DataType GeogToGeomLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction GeogToGeomLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector GeogToGeomLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction GeogToGeomLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 1, + "GeogToGeomLogicalFunction requires 1 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view GeogToGeomLogicalFunction::getType() const { return NAME; } + +bool GeogToGeomLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string GeogToGeomLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction GeogToGeomLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(1); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "wkt must be VARSIZED"); + return withChildren(c); +} + +SerializableFunction GeogToGeomLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeogToGeomLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 1, + "GeogToGeomLogicalFunction requires 1 children but got {}", + arguments.children.size()); + return GeogToGeomLogicalFunction( + std::move(arguments.children[0])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/GeomPointMake2dLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeomPointMake2dLogicalFunction.cpp new file mode 100644 index 0000000000..57b066a14f --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/GeomPointMake2dLogicalFunction.cpp @@ -0,0 +1,102 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +GeomPointMake2dLogicalFunction::GeomPointMake2dLogicalFunction(LogicalFunction srid, LogicalFunction x, LogicalFunction y) + : dataType(DataTypeProvider::provideDataType(DataType::Type::VARSIZED)) +{ + parameters.reserve(3); + parameters.push_back(std::move(srid)); + parameters.push_back(std::move(x)); + parameters.push_back(std::move(y)); +} + +DataType GeomPointMake2dLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction GeomPointMake2dLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector GeomPointMake2dLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction GeomPointMake2dLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, + "GeomPointMake2dLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view GeomPointMake2dLogicalFunction::getType() const { return NAME; } + +bool GeomPointMake2dLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string GeomPointMake2dLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction GeomPointMake2dLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(3); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "srid must be UINT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "x must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "y must be FLOAT64"); + return withChildren(c); +} + +SerializableFunction GeomPointMake2dLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeomPointMake2dLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "GeomPointMake2dLogicalFunction requires 3 children but got {}", + arguments.children.size()); + return GeomPointMake2dLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/GeomPointMake3dzLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeomPointMake3dzLogicalFunction.cpp new file mode 100644 index 0000000000..065192b0a7 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/GeomPointMake3dzLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +GeomPointMake3dzLogicalFunction::GeomPointMake3dzLogicalFunction(LogicalFunction srid, LogicalFunction x, LogicalFunction y, LogicalFunction z) + : dataType(DataTypeProvider::provideDataType(DataType::Type::VARSIZED)) +{ + parameters.reserve(4); + parameters.push_back(std::move(srid)); + parameters.push_back(std::move(x)); + parameters.push_back(std::move(y)); + parameters.push_back(std::move(z)); +} + +DataType GeomPointMake3dzLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction GeomPointMake3dzLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector GeomPointMake3dzLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction GeomPointMake3dzLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 4, + "GeomPointMake3dzLogicalFunction requires 4 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view GeomPointMake3dzLogicalFunction::getType() const { return NAME; } + +bool GeomPointMake3dzLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string GeomPointMake3dzLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction GeomPointMake3dzLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(4); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "srid must be UINT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "x must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "y must be FLOAT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::FLOAT64), "z must be FLOAT64"); + return withChildren(c); +} + +SerializableFunction GeomPointMake3dzLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeomPointMake3dzLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 4, + "GeomPointMake3dzLogicalFunction requires 4 children but got {}", + arguments.children.size()); + return GeomPointMake3dzLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/GeomToGeogLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeomToGeogLogicalFunction.cpp new file mode 100644 index 0000000000..c00d34698b --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/GeomToGeogLogicalFunction.cpp @@ -0,0 +1,96 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +GeomToGeogLogicalFunction::GeomToGeogLogicalFunction(LogicalFunction wkt) + : dataType(DataTypeProvider::provideDataType(DataType::Type::VARSIZED)) +{ + parameters.reserve(1); + parameters.push_back(std::move(wkt)); +} + +DataType GeomToGeogLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction GeomToGeogLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector GeomToGeogLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction GeomToGeogLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 1, + "GeomToGeogLogicalFunction requires 1 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view GeomToGeogLogicalFunction::getType() const { return NAME; } + +bool GeomToGeogLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string GeomToGeogLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction GeomToGeogLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(1); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "wkt must be VARSIZED"); + return withChildren(c); +} + +SerializableFunction GeomToGeogLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeomToGeogLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 1, + "GeomToGeogLogicalFunction requires 1 children but got {}", + arguments.children.size()); + return GeomToGeogLogicalFunction( + std::move(arguments.children[0])); +} + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeogCentroidPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeogCentroidPhysicalFunction.hpp new file mode 100644 index 0000000000..a92650b0b0 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/GeogCentroidPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class GeogCentroidPhysicalFunction : public PhysicalFunctionConcept { +public: + GeogCentroidPhysicalFunction(PhysicalFunction wkt, PhysicalFunction use_spheroid); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeogPointMake2dPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeogPointMake2dPhysicalFunction.hpp new file mode 100644 index 0000000000..6b47a161b3 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/GeogPointMake2dPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class GeogPointMake2dPhysicalFunction : public PhysicalFunctionConcept { +public: + GeogPointMake2dPhysicalFunction(PhysicalFunction srid, PhysicalFunction x, PhysicalFunction y); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeogPointMake3dzPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeogPointMake3dzPhysicalFunction.hpp new file mode 100644 index 0000000000..274fac0b04 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/GeogPointMake3dzPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class GeogPointMake3dzPhysicalFunction : public PhysicalFunctionConcept { +public: + GeogPointMake3dzPhysicalFunction(PhysicalFunction srid, PhysicalFunction x, PhysicalFunction y, PhysicalFunction z); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeogToGeomPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeogToGeomPhysicalFunction.hpp new file mode 100644 index 0000000000..cb732983de --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/GeogToGeomPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class GeogToGeomPhysicalFunction : public PhysicalFunctionConcept { +public: + GeogToGeomPhysicalFunction(PhysicalFunction wkt); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeomPointMake2dPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeomPointMake2dPhysicalFunction.hpp new file mode 100644 index 0000000000..2bfe851c1f --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/GeomPointMake2dPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class GeomPointMake2dPhysicalFunction : public PhysicalFunctionConcept { +public: + GeomPointMake2dPhysicalFunction(PhysicalFunction srid, PhysicalFunction x, PhysicalFunction y); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeomPointMake3dzPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeomPointMake3dzPhysicalFunction.hpp new file mode 100644 index 0000000000..24deab91b2 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/GeomPointMake3dzPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class GeomPointMake3dzPhysicalFunction : public PhysicalFunctionConcept { +public: + GeomPointMake3dzPhysicalFunction(PhysicalFunction srid, PhysicalFunction x, PhysicalFunction y, PhysicalFunction z); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeomToGeogPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeomToGeogPhysicalFunction.hpp new file mode 100644 index 0000000000..6fa9c50df7 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/GeomToGeogPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class GeomToGeogPhysicalFunction : public PhysicalFunctionConcept { +public: + GeomToGeogPhysicalFunction(PhysicalFunction wkt); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt index 2becd02bb2..254b925187 100644 --- a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt @@ -458,6 +458,13 @@ add_plugin(LineNumpoints PhysicalFunction nes-physical-operators LineNumpointsPh add_plugin(LineLocatePoint PhysicalFunction nes-physical-operators LineLocatePointPhysicalFunction.cpp) add_plugin(LineInterpolatePoint PhysicalFunction nes-physical-operators LineInterpolatePointPhysicalFunction.cpp) add_plugin(LineSubstring PhysicalFunction nes-physical-operators LineSubstringPhysicalFunction.cpp) +add_plugin(GeomPointMake2d PhysicalFunction nes-physical-operators GeomPointMake2dPhysicalFunction.cpp) +add_plugin(GeomPointMake3dz PhysicalFunction nes-physical-operators GeomPointMake3dzPhysicalFunction.cpp) +add_plugin(GeogPointMake2d PhysicalFunction nes-physical-operators GeogPointMake2dPhysicalFunction.cpp) +add_plugin(GeogPointMake3dz PhysicalFunction nes-physical-operators GeogPointMake3dzPhysicalFunction.cpp) +add_plugin(GeomToGeog PhysicalFunction nes-physical-operators GeomToGeogPhysicalFunction.cpp) +add_plugin(GeogToGeom PhysicalFunction nes-physical-operators GeogToGeomPhysicalFunction.cpp) +add_plugin(GeogCentroid PhysicalFunction nes-physical-operators GeogCentroidPhysicalFunction.cpp) add_plugin(GeomIntersects2d PhysicalFunction nes-physical-operators GeomIntersects2dPhysicalFunction.cpp) add_plugin(GeomDwithin2d PhysicalFunction nes-physical-operators GeomDwithin2dPhysicalFunction.cpp) add_plugin(GeomContains PhysicalFunction nes-physical-operators GeomContainsPhysicalFunction.cpp) diff --git a/nes-physical-operators/src/Functions/Meos/GeogCentroidPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeogCentroidPhysicalFunction.cpp new file mode 100644 index 0000000000..5c15715054 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/GeogCentroidPhysicalFunction.cpp @@ -0,0 +1,87 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +GeogCentroidPhysicalFunction::GeogCentroidPhysicalFunction(PhysicalFunction wkt, PhysicalFunction use_spheroid) +{ + paramFns.reserve(2); + paramFns.push_back(std::move(wkt)); + paramFns.push_back(std::move(use_spheroid)); +} + +VarVal GeogCentroidPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto wkt = paramFns[0].execute(record, arena).cast(); + auto use_spheroid = paramFns[1].execute(record, arena).cast>(); + constexpr uint32_t MAX_LEN = 8192; + auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); + + const auto actualLen = nautilus::invoke( + +[](const char* w, uint32_t wsz, uint64_t use_spheroid, char* buf, uint32_t bufMax) -> uint32_t { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string s(w, wsz); + GSERIALIZED* gs = geog_in(s.c_str(), -1); + if (!gs) return 0u; + GSERIALIZED* result = geog_centroid(gs, (bool)use_spheroid); + free(gs); + if (!result) return 0u; + char* out = geo_as_text(result, -1); + free(result); + if (!out) return 0u; + uint32_t len = static_cast(strlen(out)); + if (len > bufMax) len = bufMax; + memcpy(buf, out, len); + free(out); + return len; + } catch (const std::exception&) { return 0u; } + }, + wkt, use_spheroid, outBuf.getContent(), nautilus::val(MAX_LEN)); + + VarVal(actualLen).writeToMemory(outBuf.getReference()); + return outBuf; +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterGeogCentroidPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 2, + "GeogCentroidPhysicalFunction requires 2 children but got {}", + arguments.childFunctions.size()); + return GeogCentroidPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/GeogPointMake2dPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeogPointMake2dPhysicalFunction.cpp new file mode 100644 index 0000000000..36dc8999ae --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/GeogPointMake2dPhysicalFunction.cpp @@ -0,0 +1,86 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +GeogPointMake2dPhysicalFunction::GeogPointMake2dPhysicalFunction(PhysicalFunction srid, PhysicalFunction x, PhysicalFunction y) +{ + paramFns.reserve(3); + paramFns.push_back(std::move(srid)); + paramFns.push_back(std::move(x)); + paramFns.push_back(std::move(y)); +} + +VarVal GeogPointMake2dPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto srid = paramFns[0].execute(record, arena).cast>(); + auto x = paramFns[1].execute(record, arena).cast(); + auto y = paramFns[2].execute(record, arena).cast(); + constexpr uint32_t MAX_LEN = 8192; + auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); + + const auto actualLen = nautilus::invoke( + +[](uint64_t srid, double x, double y, char* buf, uint32_t bufMax) -> uint32_t { + try { + MEOS::Meos::ensureMeosInitialized(); + GSERIALIZED* result = geogpoint_make2d((int32_t)srid, x, y); + if (!result) return 0u; + char* out = geo_as_text(result, -1); + free(result); + if (!out) return 0u; + uint32_t len = static_cast(strlen(out)); + if (len > bufMax) len = bufMax; + memcpy(buf, out, len); + free(out); + return len; + } catch (const std::exception&) { return 0u; } + }, + srid, x, y, outBuf.getContent(), nautilus::val(MAX_LEN)); + + VarVal(actualLen).writeToMemory(outBuf.getReference()); + return outBuf; +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterGeogPointMake2dPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "GeogPointMake2dPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + return GeogPointMake2dPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/GeogPointMake3dzPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeogPointMake3dzPhysicalFunction.cpp new file mode 100644 index 0000000000..4011670d90 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/GeogPointMake3dzPhysicalFunction.cpp @@ -0,0 +1,89 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +GeogPointMake3dzPhysicalFunction::GeogPointMake3dzPhysicalFunction(PhysicalFunction srid, PhysicalFunction x, PhysicalFunction y, PhysicalFunction z) +{ + paramFns.reserve(4); + paramFns.push_back(std::move(srid)); + paramFns.push_back(std::move(x)); + paramFns.push_back(std::move(y)); + paramFns.push_back(std::move(z)); +} + +VarVal GeogPointMake3dzPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto srid = paramFns[0].execute(record, arena).cast>(); + auto x = paramFns[1].execute(record, arena).cast(); + auto y = paramFns[2].execute(record, arena).cast(); + auto z = paramFns[3].execute(record, arena).cast(); + constexpr uint32_t MAX_LEN = 8192; + auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); + + const auto actualLen = nautilus::invoke( + +[](uint64_t srid, double x, double y, double z, char* buf, uint32_t bufMax) -> uint32_t { + try { + MEOS::Meos::ensureMeosInitialized(); + GSERIALIZED* result = geogpoint_make3dz((int32_t)srid, x, y, z); + if (!result) return 0u; + char* out = geo_as_text(result, -1); + free(result); + if (!out) return 0u; + uint32_t len = static_cast(strlen(out)); + if (len > bufMax) len = bufMax; + memcpy(buf, out, len); + free(out); + return len; + } catch (const std::exception&) { return 0u; } + }, + srid, x, y, z, outBuf.getContent(), nautilus::val(MAX_LEN)); + + VarVal(actualLen).writeToMemory(outBuf.getReference()); + return outBuf; +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterGeogPointMake3dzPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 4, + "GeogPointMake3dzPhysicalFunction requires 4 children but got {}", + arguments.childFunctions.size()); + return GeogPointMake3dzPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/GeogToGeomPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeogToGeomPhysicalFunction.cpp new file mode 100644 index 0000000000..9f20aaa671 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/GeogToGeomPhysicalFunction.cpp @@ -0,0 +1,84 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +GeogToGeomPhysicalFunction::GeogToGeomPhysicalFunction(PhysicalFunction wkt) +{ + paramFns.reserve(1); + paramFns.push_back(std::move(wkt)); +} + +VarVal GeogToGeomPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto wkt = paramFns[0].execute(record, arena).cast(); + constexpr uint32_t MAX_LEN = 8192; + auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); + + const auto actualLen = nautilus::invoke( + +[](const char* w, uint32_t wsz, char* buf, uint32_t bufMax) -> uint32_t { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string s(w, wsz); + GSERIALIZED* gs = geog_in(s.c_str(), -1); + if (!gs) return 0u; + GSERIALIZED* result = geog_to_geom(gs); + free(gs); + if (!result) return 0u; + char* out = geo_as_text(result, -1); + free(result); + if (!out) return 0u; + uint32_t len = static_cast(strlen(out)); + if (len > bufMax) len = bufMax; + memcpy(buf, out, len); + free(out); + return len; + } catch (const std::exception&) { return 0u; } + }, + wkt, outBuf.getContent(), nautilus::val(MAX_LEN)); + + VarVal(actualLen).writeToMemory(outBuf.getReference()); + return outBuf; +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterGeogToGeomPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 1, + "GeogToGeomPhysicalFunction requires 1 children but got {}", + arguments.childFunctions.size()); + return GeogToGeomPhysicalFunction( + std::move(arguments.childFunctions[0])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/GeomPointMake2dPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeomPointMake2dPhysicalFunction.cpp new file mode 100644 index 0000000000..edbcad0082 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/GeomPointMake2dPhysicalFunction.cpp @@ -0,0 +1,86 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +GeomPointMake2dPhysicalFunction::GeomPointMake2dPhysicalFunction(PhysicalFunction srid, PhysicalFunction x, PhysicalFunction y) +{ + paramFns.reserve(3); + paramFns.push_back(std::move(srid)); + paramFns.push_back(std::move(x)); + paramFns.push_back(std::move(y)); +} + +VarVal GeomPointMake2dPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto srid = paramFns[0].execute(record, arena).cast>(); + auto x = paramFns[1].execute(record, arena).cast(); + auto y = paramFns[2].execute(record, arena).cast(); + constexpr uint32_t MAX_LEN = 8192; + auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); + + const auto actualLen = nautilus::invoke( + +[](uint64_t srid, double x, double y, char* buf, uint32_t bufMax) -> uint32_t { + try { + MEOS::Meos::ensureMeosInitialized(); + GSERIALIZED* result = geompoint_make2d((int32_t)srid, x, y); + if (!result) return 0u; + char* out = geo_as_text(result, -1); + free(result); + if (!out) return 0u; + uint32_t len = static_cast(strlen(out)); + if (len > bufMax) len = bufMax; + memcpy(buf, out, len); + free(out); + return len; + } catch (const std::exception&) { return 0u; } + }, + srid, x, y, outBuf.getContent(), nautilus::val(MAX_LEN)); + + VarVal(actualLen).writeToMemory(outBuf.getReference()); + return outBuf; +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterGeomPointMake2dPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "GeomPointMake2dPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + return GeomPointMake2dPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/GeomPointMake3dzPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeomPointMake3dzPhysicalFunction.cpp new file mode 100644 index 0000000000..4b233579da --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/GeomPointMake3dzPhysicalFunction.cpp @@ -0,0 +1,89 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +GeomPointMake3dzPhysicalFunction::GeomPointMake3dzPhysicalFunction(PhysicalFunction srid, PhysicalFunction x, PhysicalFunction y, PhysicalFunction z) +{ + paramFns.reserve(4); + paramFns.push_back(std::move(srid)); + paramFns.push_back(std::move(x)); + paramFns.push_back(std::move(y)); + paramFns.push_back(std::move(z)); +} + +VarVal GeomPointMake3dzPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto srid = paramFns[0].execute(record, arena).cast>(); + auto x = paramFns[1].execute(record, arena).cast(); + auto y = paramFns[2].execute(record, arena).cast(); + auto z = paramFns[3].execute(record, arena).cast(); + constexpr uint32_t MAX_LEN = 8192; + auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); + + const auto actualLen = nautilus::invoke( + +[](uint64_t srid, double x, double y, double z, char* buf, uint32_t bufMax) -> uint32_t { + try { + MEOS::Meos::ensureMeosInitialized(); + GSERIALIZED* result = geompoint_make3dz((int32_t)srid, x, y, z); + if (!result) return 0u; + char* out = geo_as_text(result, -1); + free(result); + if (!out) return 0u; + uint32_t len = static_cast(strlen(out)); + if (len > bufMax) len = bufMax; + memcpy(buf, out, len); + free(out); + return len; + } catch (const std::exception&) { return 0u; } + }, + srid, x, y, z, outBuf.getContent(), nautilus::val(MAX_LEN)); + + VarVal(actualLen).writeToMemory(outBuf.getReference()); + return outBuf; +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterGeomPointMake3dzPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 4, + "GeomPointMake3dzPhysicalFunction requires 4 children but got {}", + arguments.childFunctions.size()); + return GeomPointMake3dzPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/GeomToGeogPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeomToGeogPhysicalFunction.cpp new file mode 100644 index 0000000000..1e1731b9b5 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/GeomToGeogPhysicalFunction.cpp @@ -0,0 +1,84 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +GeomToGeogPhysicalFunction::GeomToGeogPhysicalFunction(PhysicalFunction wkt) +{ + paramFns.reserve(1); + paramFns.push_back(std::move(wkt)); +} + +VarVal GeomToGeogPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto wkt = paramFns[0].execute(record, arena).cast(); + constexpr uint32_t MAX_LEN = 8192; + auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); + + const auto actualLen = nautilus::invoke( + +[](const char* w, uint32_t wsz, char* buf, uint32_t bufMax) -> uint32_t { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string s(w, wsz); + GSERIALIZED* gs = geom_in(s.c_str(), -1); + if (!gs) return 0u; + GSERIALIZED* result = geom_to_geog(gs); + free(gs); + if (!result) return 0u; + char* out = geo_as_text(result, -1); + free(result); + if (!out) return 0u; + uint32_t len = static_cast(strlen(out)); + if (len > bufMax) len = bufMax; + memcpy(buf, out, len); + free(out); + return len; + } catch (const std::exception&) { return 0u; } + }, + wkt, outBuf.getContent(), nautilus::val(MAX_LEN)); + + VarVal(actualLen).writeToMemory(outBuf.getReference()); + return outBuf; +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterGeomToGeogPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 1, + "GeomToGeogPhysicalFunction requires 1 children but got {}", + arguments.childFunctions.size()); + return GeomToGeogPhysicalFunction( + std::move(arguments.childFunctions[0])); +} + +} // namespace NES diff --git a/nes-sql-parser/AntlrSQL.g4 b/nes-sql-parser/AntlrSQL.g4 index d26bb195ca..72fdf8a158 100644 --- a/nes-sql-parser/AntlrSQL.g4 +++ b/nes-sql-parser/AntlrSQL.g4 @@ -295,7 +295,7 @@ timeUnit: MS timestampParameter: name=identifier; -functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT | TGE_TTEXT_TEXT | TGE_TEXT_TTEXT | TGT_TTEXT_TEXT | TGT_TEXT_TTEXT | TLE_TTEXT_TEXT | TLE_TEXT_TTEXT | TLT_TTEXT_TEXT | TLT_TEXT_TTEXT | TTEXT_UPPER | TTEXT_LOWER | TTEXT_INITCAP | TEXTCAT_TTEXT_TEXT | TEXTCAT_TEXT_TTEXT | TEXTCAT_TTEXT_TTEXT | GEOM_LENGTH | GEOM_PERIMETER | GEOM_AZIMUTH | GEOG_AREA | GEOG_LENGTH | GEOG_PERIMETER | GEOM_IS_EMPTY | AINTERSECTS_TGEO_GEO | ACOVERS_TGEO_GEO | ADISJOINT_TGEO_GEO | ADWITHIN_TGEO_GEO | EINTERSECTS_TGEO_GEO | ETOUCHES_TGEO_GEO | ECONTAINS_TGEO_GEO | ACONTAINS_TGEO_GEO | ATOUCHES_TGEO_GEO | GEO_NUM_POINTS | GEO_NUM_GEOS | GEO_SRID | GEO_IS_UNITARY | GEO_EQUALS | GEO_SAME | GEOG_DISTANCE | NAD_TGEO_GEO | EVER_EQ_TGEO_GEO | EVER_NE_TGEO_GEO | ALWAYS_EQ_TGEO_GEO | ALWAYS_NE_TGEO_GEO | GEOG_INTERSECTS | GEOG_DWITHIN | ACOVERS_GEO_TGEO | GEOM_INTERSECTS | GEOM_DWITHIN | H3_GS_POINT_TO_CELL | EVER_EQ_TH3INDEX_H3INDEX | EVER_NE_TH3INDEX_H3INDEX | ALWAYS_EQ_TH3INDEX_H3INDEX | ALWAYS_NE_TH3INDEX_H3INDEX | TH3INDEX_GET_RESOLUTION | TH3INDEX_GET_BASE_CELL_NUMBER | TH3INDEX_IS_VALID_CELL | TH3INDEX_IS_PENTAGON | TH3INDEX_CELL_TO_PARENT_NEXT | TH3INDEX_CELL_TO_CENTER_CHILD_NEXT | TH3INDEX_CELL_TO_PARENT | TH3INDEX_CELL_TO_CENTER_CHILD | TH3INDEX_CELL_TO_CHILD_POS | TH3INDEX_ARE_NEIGHBOR_CELLS | TH3INDEX_GRID_DISTANCE | EINTERSECTS_TCBUFFER_GEO | AINTERSECTS_TCBUFFER_GEO | ECOVERS_TCBUFFER_GEO | ACOVERS_TCBUFFER_GEO | EDISJOINT_TCBUFFER_GEO | ADISJOINT_TCBUFFER_GEO | ETOUCHES_TCBUFFER_GEO | ATOUCHES_TCBUFFER_GEO | ECONTAINS_TCBUFFER_GEO | ACONTAINS_TCBUFFER_GEO | NAD_TCBUFFER_GEO | EDWITHIN_TCBUFFER_GEO | ADWITHIN_TCBUFFER_GEO | EINTERSECTS_TCBUFFER_CBUFFER | AINTERSECTS_TCBUFFER_CBUFFER | ECOVERS_TCBUFFER_CBUFFER | ACOVERS_TCBUFFER_CBUFFER | EDISJOINT_TCBUFFER_CBUFFER | ADISJOINT_TCBUFFER_CBUFFER | ETOUCHES_TCBUFFER_CBUFFER | ATOUCHES_TCBUFFER_CBUFFER | ECONTAINS_TCBUFFER_CBUFFER | ACONTAINS_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_CBUFFER | ALWAYS_EQ_TCBUFFER_CBUFFER | EVER_NE_TCBUFFER_CBUFFER | ALWAYS_NE_TCBUFFER_CBUFFER | NAD_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_TCBUFFER | ALWAYS_EQ_TCBUFFER_TCBUFFER | EVER_NE_TCBUFFER_TCBUFFER | ALWAYS_NE_TCBUFFER_TCBUFFER | EINTERSECTS_TCBUFFER_TCBUFFER | AINTERSECTS_TCBUFFER_TCBUFFER | ECOVERS_TCBUFFER_TCBUFFER | ACOVERS_TCBUFFER_TCBUFFER | ADISJOINT_TCBUFFER_TCBUFFER | ETOUCHES_TCBUFFER_TCBUFFER | ATOUCHES_TCBUFFER_TCBUFFER | NAD_TCBUFFER_TCBUFFER | EDWITHIN_TCBUFFER_TCBUFFER | ADWITHIN_TCBUFFER_TCBUFFER | MINDISTANCE_TCBUFFER_TCBUFFER | NAD_TNPOINT_GEO | EVER_EQ_TNPOINT_NPOINT | ALWAYS_EQ_TNPOINT_NPOINT | EVER_NE_TNPOINT_NPOINT | ALWAYS_NE_TNPOINT_NPOINT | NAD_TNPOINT_NPOINT | EVER_EQ_NPOINT_TNPOINT | ALWAYS_EQ_NPOINT_TNPOINT | EVER_NE_NPOINT_TNPOINT | ALWAYS_NE_NPOINT_TNPOINT | EVER_EQ_TNPOINT_TNPOINT | ALWAYS_EQ_TNPOINT_TNPOINT | EVER_NE_TNPOINT_TNPOINT | ALWAYS_NE_TNPOINT_TNPOINT | NAD_TNPOINT_TNPOINT | NAD_TPOSE_GEO | EVER_EQ_TPOSE_POSE | ALWAYS_EQ_TPOSE_POSE | EVER_NE_TPOSE_POSE | ALWAYS_NE_TPOSE_POSE | NAD_TPOSE_POSE | EVER_EQ_POSE_TPOSE | ALWAYS_EQ_POSE_TPOSE | EVER_NE_POSE_TPOSE | ALWAYS_NE_POSE_TPOSE | EVER_EQ_TPOSE_TPOSE | ALWAYS_EQ_TPOSE_TPOSE | EVER_NE_TPOSE_TPOSE | ALWAYS_NE_TPOSE_TPOSE | NAD_TPOSE_TPOSE | EVER_EQ_TRGEOMETRY_GEO | ALWAYS_EQ_TRGEOMETRY_GEO | EVER_NE_TRGEOMETRY_GEO | ALWAYS_NE_TRGEOMETRY_GEO | NAD_TRGEOMETRY_GEO | EVER_EQ_GEO_TRGEOMETRY | ALWAYS_EQ_GEO_TRGEOMETRY | EVER_NE_GEO_TRGEOMETRY | ALWAYS_NE_GEO_TRGEOMETRY | EVER_EQ_TRGEOMETRY_TRGEOMETRY | ALWAYS_EQ_TRGEOMETRY_TRGEOMETRY | EVER_NE_TRGEOMETRY_TRGEOMETRY | ALWAYS_NE_TRGEOMETRY_TRGEOMETRY | NAD_TRGEOMETRY_TRGEOMETRY | EINTERSECTS_TPCPOINT_GEO | NAD_TPCPOINT_GEO | QUADBIN_POINT_TO_CELL | QUADBIN_IS_VALID_CELL | QUADBIN_GET_RESOLUTION | QUADBIN_CELL_AREA | QUADBIN_CELL_TO_QUADKEY | QUADBIN_CELL_TO_PARENT | QUADBIN_TILE_TO_CELL | EVER_EQ_TJSONB_JSONB | ALWAYS_EQ_TJSONB_JSONB | EVER_NE_TJSONB_JSONB | ALWAYS_NE_TJSONB_JSONB | EVER_EQ_TJSONB_TJSONB | ALWAYS_EQ_TJSONB_TJSONB | EVER_NE_TJSONB_TJSONB | ALWAYS_NE_TJSONB_TJSONB | GEOM_BOUNDARY | GEOM_CENTROID | GEOM_CONVEX_HULL | GEO_REVERSE | GEO_POINTS | GEOM_UNARY_UNION | GEOM_DIFFERENCE2D | GEOM_INTERSECTION2D | GEOM_SHORTESTLINE2D | GEOM_SHORTESTLINE3D | GEO_SET_SRID | GEO_TRANSFORM | GEO_ROUND | GEOM_BUFFER | LINE_NUMPOINTS | LINE_LOCATE_POINT | LINE_INTERPOLATE_POINT | LINE_SUBSTRING | GEOM_INTERSECTS2D | GEOM_DWITHIN2D | GEOM_CONTAINS | GEOM_DISJOINT2D | GEOM_COVERS | GEOM_TOUCHES | GEOM_INTERSECTS3D | GEOM_DWITHIN3D | GEOM_DISTANCE2D | GEOM_DISTANCE3D; +functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT | TGE_TTEXT_TEXT | TGE_TEXT_TTEXT | TGT_TTEXT_TEXT | TGT_TEXT_TTEXT | TLE_TTEXT_TEXT | TLE_TEXT_TTEXT | TLT_TTEXT_TEXT | TLT_TEXT_TTEXT | TTEXT_UPPER | TTEXT_LOWER | TTEXT_INITCAP | TEXTCAT_TTEXT_TEXT | TEXTCAT_TEXT_TTEXT | TEXTCAT_TTEXT_TTEXT | GEOM_LENGTH | GEOM_PERIMETER | GEOM_AZIMUTH | GEOG_AREA | GEOG_LENGTH | GEOG_PERIMETER | GEOM_IS_EMPTY | AINTERSECTS_TGEO_GEO | ACOVERS_TGEO_GEO | ADISJOINT_TGEO_GEO | ADWITHIN_TGEO_GEO | EINTERSECTS_TGEO_GEO | ETOUCHES_TGEO_GEO | ECONTAINS_TGEO_GEO | ACONTAINS_TGEO_GEO | ATOUCHES_TGEO_GEO | GEO_NUM_POINTS | GEO_NUM_GEOS | GEO_SRID | GEO_IS_UNITARY | GEO_EQUALS | GEO_SAME | GEOG_DISTANCE | NAD_TGEO_GEO | EVER_EQ_TGEO_GEO | EVER_NE_TGEO_GEO | ALWAYS_EQ_TGEO_GEO | ALWAYS_NE_TGEO_GEO | GEOG_INTERSECTS | GEOG_DWITHIN | ACOVERS_GEO_TGEO | GEOM_INTERSECTS | GEOM_DWITHIN | H3_GS_POINT_TO_CELL | EVER_EQ_TH3INDEX_H3INDEX | EVER_NE_TH3INDEX_H3INDEX | ALWAYS_EQ_TH3INDEX_H3INDEX | ALWAYS_NE_TH3INDEX_H3INDEX | TH3INDEX_GET_RESOLUTION | TH3INDEX_GET_BASE_CELL_NUMBER | TH3INDEX_IS_VALID_CELL | TH3INDEX_IS_PENTAGON | TH3INDEX_CELL_TO_PARENT_NEXT | TH3INDEX_CELL_TO_CENTER_CHILD_NEXT | TH3INDEX_CELL_TO_PARENT | TH3INDEX_CELL_TO_CENTER_CHILD | TH3INDEX_CELL_TO_CHILD_POS | TH3INDEX_ARE_NEIGHBOR_CELLS | TH3INDEX_GRID_DISTANCE | EINTERSECTS_TCBUFFER_GEO | AINTERSECTS_TCBUFFER_GEO | ECOVERS_TCBUFFER_GEO | ACOVERS_TCBUFFER_GEO | EDISJOINT_TCBUFFER_GEO | ADISJOINT_TCBUFFER_GEO | ETOUCHES_TCBUFFER_GEO | ATOUCHES_TCBUFFER_GEO | ECONTAINS_TCBUFFER_GEO | ACONTAINS_TCBUFFER_GEO | NAD_TCBUFFER_GEO | EDWITHIN_TCBUFFER_GEO | ADWITHIN_TCBUFFER_GEO | EINTERSECTS_TCBUFFER_CBUFFER | AINTERSECTS_TCBUFFER_CBUFFER | ECOVERS_TCBUFFER_CBUFFER | ACOVERS_TCBUFFER_CBUFFER | EDISJOINT_TCBUFFER_CBUFFER | ADISJOINT_TCBUFFER_CBUFFER | ETOUCHES_TCBUFFER_CBUFFER | ATOUCHES_TCBUFFER_CBUFFER | ECONTAINS_TCBUFFER_CBUFFER | ACONTAINS_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_CBUFFER | ALWAYS_EQ_TCBUFFER_CBUFFER | EVER_NE_TCBUFFER_CBUFFER | ALWAYS_NE_TCBUFFER_CBUFFER | NAD_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_TCBUFFER | ALWAYS_EQ_TCBUFFER_TCBUFFER | EVER_NE_TCBUFFER_TCBUFFER | ALWAYS_NE_TCBUFFER_TCBUFFER | EINTERSECTS_TCBUFFER_TCBUFFER | AINTERSECTS_TCBUFFER_TCBUFFER | ECOVERS_TCBUFFER_TCBUFFER | ACOVERS_TCBUFFER_TCBUFFER | ADISJOINT_TCBUFFER_TCBUFFER | ETOUCHES_TCBUFFER_TCBUFFER | ATOUCHES_TCBUFFER_TCBUFFER | NAD_TCBUFFER_TCBUFFER | EDWITHIN_TCBUFFER_TCBUFFER | ADWITHIN_TCBUFFER_TCBUFFER | MINDISTANCE_TCBUFFER_TCBUFFER | NAD_TNPOINT_GEO | EVER_EQ_TNPOINT_NPOINT | ALWAYS_EQ_TNPOINT_NPOINT | EVER_NE_TNPOINT_NPOINT | ALWAYS_NE_TNPOINT_NPOINT | NAD_TNPOINT_NPOINT | EVER_EQ_NPOINT_TNPOINT | ALWAYS_EQ_NPOINT_TNPOINT | EVER_NE_NPOINT_TNPOINT | ALWAYS_NE_NPOINT_TNPOINT | EVER_EQ_TNPOINT_TNPOINT | ALWAYS_EQ_TNPOINT_TNPOINT | EVER_NE_TNPOINT_TNPOINT | ALWAYS_NE_TNPOINT_TNPOINT | NAD_TNPOINT_TNPOINT | NAD_TPOSE_GEO | EVER_EQ_TPOSE_POSE | ALWAYS_EQ_TPOSE_POSE | EVER_NE_TPOSE_POSE | ALWAYS_NE_TPOSE_POSE | NAD_TPOSE_POSE | EVER_EQ_POSE_TPOSE | ALWAYS_EQ_POSE_TPOSE | EVER_NE_POSE_TPOSE | ALWAYS_NE_POSE_TPOSE | EVER_EQ_TPOSE_TPOSE | ALWAYS_EQ_TPOSE_TPOSE | EVER_NE_TPOSE_TPOSE | ALWAYS_NE_TPOSE_TPOSE | NAD_TPOSE_TPOSE | EVER_EQ_TRGEOMETRY_GEO | ALWAYS_EQ_TRGEOMETRY_GEO | EVER_NE_TRGEOMETRY_GEO | ALWAYS_NE_TRGEOMETRY_GEO | NAD_TRGEOMETRY_GEO | EVER_EQ_GEO_TRGEOMETRY | ALWAYS_EQ_GEO_TRGEOMETRY | EVER_NE_GEO_TRGEOMETRY | ALWAYS_NE_GEO_TRGEOMETRY | EVER_EQ_TRGEOMETRY_TRGEOMETRY | ALWAYS_EQ_TRGEOMETRY_TRGEOMETRY | EVER_NE_TRGEOMETRY_TRGEOMETRY | ALWAYS_NE_TRGEOMETRY_TRGEOMETRY | NAD_TRGEOMETRY_TRGEOMETRY | EINTERSECTS_TPCPOINT_GEO | NAD_TPCPOINT_GEO | QUADBIN_POINT_TO_CELL | QUADBIN_IS_VALID_CELL | QUADBIN_GET_RESOLUTION | QUADBIN_CELL_AREA | QUADBIN_CELL_TO_QUADKEY | QUADBIN_CELL_TO_PARENT | QUADBIN_TILE_TO_CELL | EVER_EQ_TJSONB_JSONB | ALWAYS_EQ_TJSONB_JSONB | EVER_NE_TJSONB_JSONB | ALWAYS_NE_TJSONB_JSONB | EVER_EQ_TJSONB_TJSONB | ALWAYS_EQ_TJSONB_TJSONB | EVER_NE_TJSONB_TJSONB | ALWAYS_NE_TJSONB_TJSONB | GEOM_BOUNDARY | GEOM_CENTROID | GEOM_CONVEX_HULL | GEO_REVERSE | GEO_POINTS | GEOM_UNARY_UNION | GEOM_DIFFERENCE2D | GEOM_INTERSECTION2D | GEOM_SHORTESTLINE2D | GEOM_SHORTESTLINE3D | GEO_SET_SRID | GEO_TRANSFORM | GEO_ROUND | GEOM_BUFFER | LINE_NUMPOINTS | LINE_LOCATE_POINT | LINE_INTERPOLATE_POINT | LINE_SUBSTRING | GEOM_POINT_MAKE2D | GEOM_POINT_MAKE3DZ | GEOG_POINT_MAKE2D | GEOG_POINT_MAKE3DZ | GEOM_TO_GEOG | GEOG_TO_GEOM | GEOG_CENTROID | GEOM_INTERSECTS2D | GEOM_DWITHIN2D | GEOM_CONTAINS | GEOM_DISJOINT2D | GEOM_COVERS | GEOM_TOUCHES | GEOM_INTERSECTS3D | GEOM_DWITHIN3D | GEOM_DISTANCE2D | GEOM_DISTANCE3D; sinkClause: INTO sink (',' sink)*; @@ -929,6 +929,13 @@ LINE_NUMPOINTS: 'LINE_NUMPOINTS' | 'line_numpoints'; LINE_LOCATE_POINT: 'LINE_LOCATE_POINT' | 'line_locate_point'; LINE_INTERPOLATE_POINT: 'LINE_INTERPOLATE_POINT' | 'line_interpolate_point'; LINE_SUBSTRING: 'LINE_SUBSTRING' | 'line_substring'; +GEOM_POINT_MAKE2D: 'GEOM_POINT_MAKE2D' | 'geompoint_make2d'; +GEOM_POINT_MAKE3DZ: 'GEOM_POINT_MAKE3DZ' | 'geompoint_make3dz'; +GEOG_POINT_MAKE2D: 'GEOG_POINT_MAKE2D' | 'geogpoint_make2d'; +GEOG_POINT_MAKE3DZ: 'GEOG_POINT_MAKE3DZ' | 'geogpoint_make3dz'; +GEOM_TO_GEOG: 'GEOM_TO_GEOG' | 'geom_to_geog'; +GEOG_TO_GEOM: 'GEOG_TO_GEOM' | 'geog_to_geom'; +GEOG_CENTROID: 'GEOG_CENTROID' | 'geog_centroid'; GEOM_INTERSECTS2D: 'GEOM_INTERSECTS2D' | 'geom_intersects2d'; GEOM_DWITHIN2D: 'GEOM_DWITHIN2D' | 'geom_dwithin2d'; GEOM_CONTAINS: 'GEOM_CONTAINS' | 'geom_contains'; diff --git a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp index 12db65ad9e..bde0966bf6 100644 --- a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp +++ b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp @@ -510,6 +510,13 @@ #include #include #include +#include +#include +#include +#include +#include +#include +#include #include #include #include @@ -10934,6 +10941,73 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont return LogicalFunction(LineSubstringLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2))); } /* END CODEGEN PARSER GLUE: LINE_SUBSTRING */ + case AntlrSQLParser::GEOM_POINT_MAKE2D: { + PRECONDITION(ctx->functionParam().size() == 3, + "GeomPointMake2d requires 3 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + return LogicalFunction(GeomPointMake2dLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2))); + } + /* END CODEGEN PARSER GLUE: GEOM_POINT_MAKE2D */ + case AntlrSQLParser::GEOM_POINT_MAKE3DZ: { + PRECONDITION(ctx->functionParam().size() == 4, + "GeomPointMake3dz requires 4 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + return LogicalFunction(GeomPointMake3dzLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3))); + } + /* END CODEGEN PARSER GLUE: GEOM_POINT_MAKE3DZ */ + case AntlrSQLParser::GEOG_POINT_MAKE2D: { + PRECONDITION(ctx->functionParam().size() == 3, + "GeogPointMake2d requires 3 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + return LogicalFunction(GeogPointMake2dLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2))); + } + /* END CODEGEN PARSER GLUE: GEOG_POINT_MAKE2D */ + case AntlrSQLParser::GEOG_POINT_MAKE3DZ: { + PRECONDITION(ctx->functionParam().size() == 4, + "GeogPointMake3dz requires 4 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + return LogicalFunction(GeogPointMake3dzLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3))); + } + /* END CODEGEN PARSER GLUE: GEOG_POINT_MAKE3DZ */ + case AntlrSQLParser::GEOM_TO_GEOG: { + PRECONDITION(ctx->functionParam().size() == 1, + "GeomToGeog requires 1 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + return LogicalFunction(GeomToGeogLogicalFunction(std::move(arg0))); + } + /* END CODEGEN PARSER GLUE: GEOM_TO_GEOG */ + case AntlrSQLParser::GEOG_TO_GEOM: { + PRECONDITION(ctx->functionParam().size() == 1, + "GeogToGeom requires 1 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + return LogicalFunction(GeogToGeomLogicalFunction(std::move(arg0))); + } + /* END CODEGEN PARSER GLUE: GEOG_TO_GEOM */ + case AntlrSQLParser::GEOG_CENTROID: { + PRECONDITION(ctx->functionParam().size() == 2, + "GeogCentroid requires 2 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + return LogicalFunction(GeogCentroidLogicalFunction(std::move(arg0), std::move(arg1))); + } + /* END CODEGEN PARSER GLUE: GEOG_CENTROID */ /* END CODEGEN PARSER GLUE: GEOM_INTERSECTS2D */ case AntlrSQLParser::GEOM_DWITHIN2D: { PRECONDITION(ctx->functionParam().size() == 3, From f92569d95a494151cf4edb4832f7fca7f21f41ba Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Mon, 15 Jun 2026 23:55:45 +0200 Subject: [PATCH 81/96] feat(meos): add index-based geometry extraction and collection intersection 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. --- .../Functions/Meos/GeoGeoNLogicalFunction.hpp | 48 +++++++++ .../GeomIntersection2dCollLogicalFunction.hpp | 48 +++++++++ .../Meos/LinePointNLogicalFunction.hpp | 48 +++++++++ .../src/Functions/Meos/CMakeLists.txt | 3 + .../Functions/Meos/GeoGeoNLogicalFunction.cpp | 99 +++++++++++++++++++ .../GeomIntersection2dCollLogicalFunction.cpp | 99 +++++++++++++++++++ .../Meos/LinePointNLogicalFunction.cpp | 99 +++++++++++++++++++ .../Meos/GeoGeoNPhysicalFunction.hpp | 32 ++++++ ...GeomIntersection2dCollPhysicalFunction.hpp | 32 ++++++ .../Meos/LinePointNPhysicalFunction.hpp | 32 ++++++ .../src/Functions/Meos/CMakeLists.txt | 3 + .../Meos/GeoGeoNPhysicalFunction.cpp | 87 ++++++++++++++++ ...GeomIntersection2dCollPhysicalFunction.cpp | 89 +++++++++++++++++ .../Meos/LinePointNPhysicalFunction.cpp | 87 ++++++++++++++++ nes-sql-parser/AntlrSQL.g4 | 5 +- .../src/AntlrSQLQueryPlanCreator.cpp | 30 ++++++ 16 files changed, 840 insertions(+), 1 deletion(-) create mode 100644 nes-logical-operators/include/Functions/Meos/GeoGeoNLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/GeomIntersection2dCollLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/LinePointNLogicalFunction.hpp create mode 100644 nes-logical-operators/src/Functions/Meos/GeoGeoNLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/GeomIntersection2dCollLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/LinePointNLogicalFunction.cpp create mode 100644 nes-physical-operators/include/Functions/Meos/GeoGeoNPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/GeomIntersection2dCollPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/LinePointNPhysicalFunction.hpp create mode 100644 nes-physical-operators/src/Functions/Meos/GeoGeoNPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/GeomIntersection2dCollPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/LinePointNPhysicalFunction.cpp diff --git a/nes-logical-operators/include/Functions/Meos/GeoGeoNLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeoGeoNLogicalFunction.hpp new file mode 100644 index 0000000000..aba38ae724 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/GeoGeoNLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns the nth component geometry from a geometry collection as WKT. + */ +class GeoGeoNLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "GeoGeoN"; + + GeoGeoNLogicalFunction(LogicalFunction wkt, LogicalFunction n); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/GeomIntersection2dCollLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeomIntersection2dCollLogicalFunction.hpp new file mode 100644 index 0000000000..e7dfc55e8a --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/GeomIntersection2dCollLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns the collection-typed 2D intersection of two geometries as WKT. + */ +class GeomIntersection2dCollLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "GeomIntersection2dColl"; + + GeomIntersection2dCollLogicalFunction(LogicalFunction wkt1, LogicalFunction wkt2); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/LinePointNLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/LinePointNLogicalFunction.hpp new file mode 100644 index 0000000000..0213b796b2 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/LinePointNLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns the nth point of a linestring as WKT (1-based index). + */ +class LinePointNLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "LinePointN"; + + LinePointNLogicalFunction(LogicalFunction wkt, LogicalFunction n); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt index 505a3df92b..c3fd3c8c04 100644 --- a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt @@ -466,6 +466,9 @@ add_plugin(GeogPointMake3dz LogicalFunction nes-logical-operators GeogPointMake3 add_plugin(GeomToGeog LogicalFunction nes-logical-operators GeomToGeogLogicalFunction.cpp) add_plugin(GeogToGeom LogicalFunction nes-logical-operators GeogToGeomLogicalFunction.cpp) add_plugin(GeogCentroid LogicalFunction nes-logical-operators GeogCentroidLogicalFunction.cpp) +add_plugin(GeoGeoN LogicalFunction nes-logical-operators GeoGeoNLogicalFunction.cpp) +add_plugin(LinePointN LogicalFunction nes-logical-operators LinePointNLogicalFunction.cpp) +add_plugin(GeomIntersection2dColl LogicalFunction nes-logical-operators GeomIntersection2dCollLogicalFunction.cpp) add_plugin(GeomIntersects2d LogicalFunction nes-logical-operators GeomIntersects2dLogicalFunction.cpp) add_plugin(GeomDwithin2d LogicalFunction nes-logical-operators GeomDwithin2dLogicalFunction.cpp) add_plugin(GeomContains LogicalFunction nes-logical-operators GeomContainsLogicalFunction.cpp) diff --git a/nes-logical-operators/src/Functions/Meos/GeoGeoNLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeoGeoNLogicalFunction.cpp new file mode 100644 index 0000000000..e897eab065 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/GeoGeoNLogicalFunction.cpp @@ -0,0 +1,99 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +GeoGeoNLogicalFunction::GeoGeoNLogicalFunction(LogicalFunction wkt, LogicalFunction n) + : dataType(DataTypeProvider::provideDataType(DataType::Type::VARSIZED)) +{ + parameters.reserve(2); + parameters.push_back(std::move(wkt)); + parameters.push_back(std::move(n)); +} + +DataType GeoGeoNLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction GeoGeoNLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector GeoGeoNLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction GeoGeoNLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 2, + "GeoGeoNLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view GeoGeoNLogicalFunction::getType() const { return NAME; } + +bool GeoGeoNLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string GeoGeoNLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction GeoGeoNLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(2); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "wkt must be VARSIZED"); + INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "n must be UINT64"); + return withChildren(c); +} + +SerializableFunction GeoGeoNLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeoGeoNLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 2, + "GeoGeoNLogicalFunction requires 2 children but got {}", + arguments.children.size()); + return GeoGeoNLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/GeomIntersection2dCollLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeomIntersection2dCollLogicalFunction.cpp new file mode 100644 index 0000000000..89ec07c54c --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/GeomIntersection2dCollLogicalFunction.cpp @@ -0,0 +1,99 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +GeomIntersection2dCollLogicalFunction::GeomIntersection2dCollLogicalFunction(LogicalFunction wkt1, LogicalFunction wkt2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::VARSIZED)) +{ + parameters.reserve(2); + parameters.push_back(std::move(wkt1)); + parameters.push_back(std::move(wkt2)); +} + +DataType GeomIntersection2dCollLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction GeomIntersection2dCollLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector GeomIntersection2dCollLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction GeomIntersection2dCollLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 2, + "GeomIntersection2dCollLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view GeomIntersection2dCollLogicalFunction::getType() const { return NAME; } + +bool GeomIntersection2dCollLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string GeomIntersection2dCollLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction GeomIntersection2dCollLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(2); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "wkt1 must be VARSIZED"); + INVARIANT(c[1].getDataType().isType(DataType::Type::VARSIZED), "wkt2 must be VARSIZED"); + return withChildren(c); +} + +SerializableFunction GeomIntersection2dCollLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeomIntersection2dCollLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 2, + "GeomIntersection2dCollLogicalFunction requires 2 children but got {}", + arguments.children.size()); + return GeomIntersection2dCollLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/LinePointNLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/LinePointNLogicalFunction.cpp new file mode 100644 index 0000000000..b91adbe8e7 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/LinePointNLogicalFunction.cpp @@ -0,0 +1,99 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +LinePointNLogicalFunction::LinePointNLogicalFunction(LogicalFunction wkt, LogicalFunction n) + : dataType(DataTypeProvider::provideDataType(DataType::Type::VARSIZED)) +{ + parameters.reserve(2); + parameters.push_back(std::move(wkt)); + parameters.push_back(std::move(n)); +} + +DataType LinePointNLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction LinePointNLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector LinePointNLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction LinePointNLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 2, + "LinePointNLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view LinePointNLogicalFunction::getType() const { return NAME; } + +bool LinePointNLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string LinePointNLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction LinePointNLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(2); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "wkt must be VARSIZED"); + INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "n must be UINT64"); + return withChildren(c); +} + +SerializableFunction LinePointNLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterLinePointNLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 2, + "LinePointNLogicalFunction requires 2 children but got {}", + arguments.children.size()); + return LinePointNLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1])); +} + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeoGeoNPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeoGeoNPhysicalFunction.hpp new file mode 100644 index 0000000000..8e6b2244d6 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/GeoGeoNPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class GeoGeoNPhysicalFunction : public PhysicalFunctionConcept { +public: + GeoGeoNPhysicalFunction(PhysicalFunction wkt, PhysicalFunction n); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeomIntersection2dCollPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeomIntersection2dCollPhysicalFunction.hpp new file mode 100644 index 0000000000..f9377c5aa3 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/GeomIntersection2dCollPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class GeomIntersection2dCollPhysicalFunction : public PhysicalFunctionConcept { +public: + GeomIntersection2dCollPhysicalFunction(PhysicalFunction wkt1, PhysicalFunction wkt2); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/LinePointNPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/LinePointNPhysicalFunction.hpp new file mode 100644 index 0000000000..71d4238170 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/LinePointNPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class LinePointNPhysicalFunction : public PhysicalFunctionConcept { +public: + LinePointNPhysicalFunction(PhysicalFunction wkt, PhysicalFunction n); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt index 254b925187..630fabdc71 100644 --- a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt @@ -465,6 +465,9 @@ add_plugin(GeogPointMake3dz PhysicalFunction nes-physical-operators GeogPointMak add_plugin(GeomToGeog PhysicalFunction nes-physical-operators GeomToGeogPhysicalFunction.cpp) add_plugin(GeogToGeom PhysicalFunction nes-physical-operators GeogToGeomPhysicalFunction.cpp) add_plugin(GeogCentroid PhysicalFunction nes-physical-operators GeogCentroidPhysicalFunction.cpp) +add_plugin(GeoGeoN PhysicalFunction nes-physical-operators GeoGeoNPhysicalFunction.cpp) +add_plugin(LinePointN PhysicalFunction nes-physical-operators LinePointNPhysicalFunction.cpp) +add_plugin(GeomIntersection2dColl PhysicalFunction nes-physical-operators GeomIntersection2dCollPhysicalFunction.cpp) add_plugin(GeomIntersects2d PhysicalFunction nes-physical-operators GeomIntersects2dPhysicalFunction.cpp) add_plugin(GeomDwithin2d PhysicalFunction nes-physical-operators GeomDwithin2dPhysicalFunction.cpp) add_plugin(GeomContains PhysicalFunction nes-physical-operators GeomContainsPhysicalFunction.cpp) diff --git a/nes-physical-operators/src/Functions/Meos/GeoGeoNPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeoGeoNPhysicalFunction.cpp new file mode 100644 index 0000000000..eb66754dd6 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/GeoGeoNPhysicalFunction.cpp @@ -0,0 +1,87 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +GeoGeoNPhysicalFunction::GeoGeoNPhysicalFunction(PhysicalFunction wkt, PhysicalFunction n) +{ + paramFns.reserve(2); + paramFns.push_back(std::move(wkt)); + paramFns.push_back(std::move(n)); +} + +VarVal GeoGeoNPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto wkt = paramFns[0].execute(record, arena).cast(); + auto n = paramFns[1].execute(record, arena).cast>(); + constexpr uint32_t MAX_LEN = 8192; + auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); + + const auto actualLen = nautilus::invoke( + +[](const char* w, uint32_t wsz, uint64_t n, char* buf, uint32_t bufMax) -> uint32_t { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string s(w, wsz); + GSERIALIZED* gs = geom_in(s.c_str(), -1); + if (!gs) return 0u; + GSERIALIZED* result = geo_geo_n(gs, (int)n); + free(gs); + if (!result) return 0u; + char* out = geo_as_text(result, -1); + free(result); + if (!out) return 0u; + uint32_t len = static_cast(strlen(out)); + if (len > bufMax) len = bufMax; + memcpy(buf, out, len); + free(out); + return len; + } catch (const std::exception&) { return 0u; } + }, + wkt, n, outBuf.getContent(), nautilus::val(MAX_LEN)); + + VarVal(actualLen).writeToMemory(outBuf.getReference()); + return outBuf; +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterGeoGeoNPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 2, + "GeoGeoNPhysicalFunction requires 2 children but got {}", + arguments.childFunctions.size()); + return GeoGeoNPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/GeomIntersection2dCollPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeomIntersection2dCollPhysicalFunction.cpp new file mode 100644 index 0000000000..29f1e7d7f2 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/GeomIntersection2dCollPhysicalFunction.cpp @@ -0,0 +1,89 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +GeomIntersection2dCollPhysicalFunction::GeomIntersection2dCollPhysicalFunction(PhysicalFunction wkt1, PhysicalFunction wkt2) +{ + paramFns.reserve(2); + paramFns.push_back(std::move(wkt1)); + paramFns.push_back(std::move(wkt2)); +} + +VarVal GeomIntersection2dCollPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto wkt1 = paramFns[0].execute(record, arena).cast(); + auto wkt2 = paramFns[1].execute(record, arena).cast(); + constexpr uint32_t MAX_LEN = 8192; + auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); + + const auto actualLen = nautilus::invoke( + +[](const char* w1, uint32_t w1sz, const char* w2, uint32_t w2sz, char* buf, uint32_t bufMax) -> uint32_t { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string s1(w1, w1sz), s2(w2, w2sz); + GSERIALIZED* gs1 = geom_in(s1.c_str(), -1); + if (!gs1) return 0u; + GSERIALIZED* gs2 = geom_in(s2.c_str(), -1); + if (!gs2) { free(gs1); return 0u; } + GSERIALIZED* result = geom_intersection2d_coll(gs1, gs2); + free(gs1); free(gs2); + if (!result) return 0u; + char* out = geo_as_text(result, -1); + free(result); + if (!out) return 0u; + uint32_t len = static_cast(strlen(out)); + if (len > bufMax) len = bufMax; + memcpy(buf, out, len); + free(out); + return len; + } catch (const std::exception&) { return 0u; } + }, + wkt1, wkt2, outBuf.getContent(), nautilus::val(MAX_LEN)); + + VarVal(actualLen).writeToMemory(outBuf.getReference()); + return outBuf; +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterGeomIntersection2dCollPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 2, + "GeomIntersection2dCollPhysicalFunction requires 2 children but got {}", + arguments.childFunctions.size()); + return GeomIntersection2dCollPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/LinePointNPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/LinePointNPhysicalFunction.cpp new file mode 100644 index 0000000000..4edece9170 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/LinePointNPhysicalFunction.cpp @@ -0,0 +1,87 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +LinePointNPhysicalFunction::LinePointNPhysicalFunction(PhysicalFunction wkt, PhysicalFunction n) +{ + paramFns.reserve(2); + paramFns.push_back(std::move(wkt)); + paramFns.push_back(std::move(n)); +} + +VarVal LinePointNPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto wkt = paramFns[0].execute(record, arena).cast(); + auto n = paramFns[1].execute(record, arena).cast>(); + constexpr uint32_t MAX_LEN = 8192; + auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); + + const auto actualLen = nautilus::invoke( + +[](const char* w, uint32_t wsz, uint64_t n, char* buf, uint32_t bufMax) -> uint32_t { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string s(w, wsz); + GSERIALIZED* gs = geom_in(s.c_str(), -1); + if (!gs) return 0u; + GSERIALIZED* result = line_point_n(gs, (int)n); + free(gs); + if (!result) return 0u; + char* out = geo_as_text(result, -1); + free(result); + if (!out) return 0u; + uint32_t len = static_cast(strlen(out)); + if (len > bufMax) len = bufMax; + memcpy(buf, out, len); + free(out); + return len; + } catch (const std::exception&) { return 0u; } + }, + wkt, n, outBuf.getContent(), nautilus::val(MAX_LEN)); + + VarVal(actualLen).writeToMemory(outBuf.getReference()); + return outBuf; +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterLinePointNPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 2, + "LinePointNPhysicalFunction requires 2 children but got {}", + arguments.childFunctions.size()); + return LinePointNPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1])); +} + +} // namespace NES diff --git a/nes-sql-parser/AntlrSQL.g4 b/nes-sql-parser/AntlrSQL.g4 index 72fdf8a158..d795d54ab9 100644 --- a/nes-sql-parser/AntlrSQL.g4 +++ b/nes-sql-parser/AntlrSQL.g4 @@ -295,7 +295,7 @@ timeUnit: MS timestampParameter: name=identifier; -functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT | TGE_TTEXT_TEXT | TGE_TEXT_TTEXT | TGT_TTEXT_TEXT | TGT_TEXT_TTEXT | TLE_TTEXT_TEXT | TLE_TEXT_TTEXT | TLT_TTEXT_TEXT | TLT_TEXT_TTEXT | TTEXT_UPPER | TTEXT_LOWER | TTEXT_INITCAP | TEXTCAT_TTEXT_TEXT | TEXTCAT_TEXT_TTEXT | TEXTCAT_TTEXT_TTEXT | GEOM_LENGTH | GEOM_PERIMETER | GEOM_AZIMUTH | GEOG_AREA | GEOG_LENGTH | GEOG_PERIMETER | GEOM_IS_EMPTY | AINTERSECTS_TGEO_GEO | ACOVERS_TGEO_GEO | ADISJOINT_TGEO_GEO | ADWITHIN_TGEO_GEO | EINTERSECTS_TGEO_GEO | ETOUCHES_TGEO_GEO | ECONTAINS_TGEO_GEO | ACONTAINS_TGEO_GEO | ATOUCHES_TGEO_GEO | GEO_NUM_POINTS | GEO_NUM_GEOS | GEO_SRID | GEO_IS_UNITARY | GEO_EQUALS | GEO_SAME | GEOG_DISTANCE | NAD_TGEO_GEO | EVER_EQ_TGEO_GEO | EVER_NE_TGEO_GEO | ALWAYS_EQ_TGEO_GEO | ALWAYS_NE_TGEO_GEO | GEOG_INTERSECTS | GEOG_DWITHIN | ACOVERS_GEO_TGEO | GEOM_INTERSECTS | GEOM_DWITHIN | H3_GS_POINT_TO_CELL | EVER_EQ_TH3INDEX_H3INDEX | EVER_NE_TH3INDEX_H3INDEX | ALWAYS_EQ_TH3INDEX_H3INDEX | ALWAYS_NE_TH3INDEX_H3INDEX | TH3INDEX_GET_RESOLUTION | TH3INDEX_GET_BASE_CELL_NUMBER | TH3INDEX_IS_VALID_CELL | TH3INDEX_IS_PENTAGON | TH3INDEX_CELL_TO_PARENT_NEXT | TH3INDEX_CELL_TO_CENTER_CHILD_NEXT | TH3INDEX_CELL_TO_PARENT | TH3INDEX_CELL_TO_CENTER_CHILD | TH3INDEX_CELL_TO_CHILD_POS | TH3INDEX_ARE_NEIGHBOR_CELLS | TH3INDEX_GRID_DISTANCE | EINTERSECTS_TCBUFFER_GEO | AINTERSECTS_TCBUFFER_GEO | ECOVERS_TCBUFFER_GEO | ACOVERS_TCBUFFER_GEO | EDISJOINT_TCBUFFER_GEO | ADISJOINT_TCBUFFER_GEO | ETOUCHES_TCBUFFER_GEO | ATOUCHES_TCBUFFER_GEO | ECONTAINS_TCBUFFER_GEO | ACONTAINS_TCBUFFER_GEO | NAD_TCBUFFER_GEO | EDWITHIN_TCBUFFER_GEO | ADWITHIN_TCBUFFER_GEO | EINTERSECTS_TCBUFFER_CBUFFER | AINTERSECTS_TCBUFFER_CBUFFER | ECOVERS_TCBUFFER_CBUFFER | ACOVERS_TCBUFFER_CBUFFER | EDISJOINT_TCBUFFER_CBUFFER | ADISJOINT_TCBUFFER_CBUFFER | ETOUCHES_TCBUFFER_CBUFFER | ATOUCHES_TCBUFFER_CBUFFER | ECONTAINS_TCBUFFER_CBUFFER | ACONTAINS_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_CBUFFER | ALWAYS_EQ_TCBUFFER_CBUFFER | EVER_NE_TCBUFFER_CBUFFER | ALWAYS_NE_TCBUFFER_CBUFFER | NAD_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_TCBUFFER | ALWAYS_EQ_TCBUFFER_TCBUFFER | EVER_NE_TCBUFFER_TCBUFFER | ALWAYS_NE_TCBUFFER_TCBUFFER | EINTERSECTS_TCBUFFER_TCBUFFER | AINTERSECTS_TCBUFFER_TCBUFFER | ECOVERS_TCBUFFER_TCBUFFER | ACOVERS_TCBUFFER_TCBUFFER | ADISJOINT_TCBUFFER_TCBUFFER | ETOUCHES_TCBUFFER_TCBUFFER | ATOUCHES_TCBUFFER_TCBUFFER | NAD_TCBUFFER_TCBUFFER | EDWITHIN_TCBUFFER_TCBUFFER | ADWITHIN_TCBUFFER_TCBUFFER | MINDISTANCE_TCBUFFER_TCBUFFER | NAD_TNPOINT_GEO | EVER_EQ_TNPOINT_NPOINT | ALWAYS_EQ_TNPOINT_NPOINT | EVER_NE_TNPOINT_NPOINT | ALWAYS_NE_TNPOINT_NPOINT | NAD_TNPOINT_NPOINT | EVER_EQ_NPOINT_TNPOINT | ALWAYS_EQ_NPOINT_TNPOINT | EVER_NE_NPOINT_TNPOINT | ALWAYS_NE_NPOINT_TNPOINT | EVER_EQ_TNPOINT_TNPOINT | ALWAYS_EQ_TNPOINT_TNPOINT | EVER_NE_TNPOINT_TNPOINT | ALWAYS_NE_TNPOINT_TNPOINT | NAD_TNPOINT_TNPOINT | NAD_TPOSE_GEO | EVER_EQ_TPOSE_POSE | ALWAYS_EQ_TPOSE_POSE | EVER_NE_TPOSE_POSE | ALWAYS_NE_TPOSE_POSE | NAD_TPOSE_POSE | EVER_EQ_POSE_TPOSE | ALWAYS_EQ_POSE_TPOSE | EVER_NE_POSE_TPOSE | ALWAYS_NE_POSE_TPOSE | EVER_EQ_TPOSE_TPOSE | ALWAYS_EQ_TPOSE_TPOSE | EVER_NE_TPOSE_TPOSE | ALWAYS_NE_TPOSE_TPOSE | NAD_TPOSE_TPOSE | EVER_EQ_TRGEOMETRY_GEO | ALWAYS_EQ_TRGEOMETRY_GEO | EVER_NE_TRGEOMETRY_GEO | ALWAYS_NE_TRGEOMETRY_GEO | NAD_TRGEOMETRY_GEO | EVER_EQ_GEO_TRGEOMETRY | ALWAYS_EQ_GEO_TRGEOMETRY | EVER_NE_GEO_TRGEOMETRY | ALWAYS_NE_GEO_TRGEOMETRY | EVER_EQ_TRGEOMETRY_TRGEOMETRY | ALWAYS_EQ_TRGEOMETRY_TRGEOMETRY | EVER_NE_TRGEOMETRY_TRGEOMETRY | ALWAYS_NE_TRGEOMETRY_TRGEOMETRY | NAD_TRGEOMETRY_TRGEOMETRY | EINTERSECTS_TPCPOINT_GEO | NAD_TPCPOINT_GEO | QUADBIN_POINT_TO_CELL | QUADBIN_IS_VALID_CELL | QUADBIN_GET_RESOLUTION | QUADBIN_CELL_AREA | QUADBIN_CELL_TO_QUADKEY | QUADBIN_CELL_TO_PARENT | QUADBIN_TILE_TO_CELL | EVER_EQ_TJSONB_JSONB | ALWAYS_EQ_TJSONB_JSONB | EVER_NE_TJSONB_JSONB | ALWAYS_NE_TJSONB_JSONB | EVER_EQ_TJSONB_TJSONB | ALWAYS_EQ_TJSONB_TJSONB | EVER_NE_TJSONB_TJSONB | ALWAYS_NE_TJSONB_TJSONB | GEOM_BOUNDARY | GEOM_CENTROID | GEOM_CONVEX_HULL | GEO_REVERSE | GEO_POINTS | GEOM_UNARY_UNION | GEOM_DIFFERENCE2D | GEOM_INTERSECTION2D | GEOM_SHORTESTLINE2D | GEOM_SHORTESTLINE3D | GEO_SET_SRID | GEO_TRANSFORM | GEO_ROUND | GEOM_BUFFER | LINE_NUMPOINTS | LINE_LOCATE_POINT | LINE_INTERPOLATE_POINT | LINE_SUBSTRING | GEOM_POINT_MAKE2D | GEOM_POINT_MAKE3DZ | GEOG_POINT_MAKE2D | GEOG_POINT_MAKE3DZ | GEOM_TO_GEOG | GEOG_TO_GEOM | GEOG_CENTROID | GEOM_INTERSECTS2D | GEOM_DWITHIN2D | GEOM_CONTAINS | GEOM_DISJOINT2D | GEOM_COVERS | GEOM_TOUCHES | GEOM_INTERSECTS3D | GEOM_DWITHIN3D | GEOM_DISTANCE2D | GEOM_DISTANCE3D; +functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT | TGE_TTEXT_TEXT | TGE_TEXT_TTEXT | TGT_TTEXT_TEXT | TGT_TEXT_TTEXT | TLE_TTEXT_TEXT | TLE_TEXT_TTEXT | TLT_TTEXT_TEXT | TLT_TEXT_TTEXT | TTEXT_UPPER | TTEXT_LOWER | TTEXT_INITCAP | TEXTCAT_TTEXT_TEXT | TEXTCAT_TEXT_TTEXT | TEXTCAT_TTEXT_TTEXT | GEOM_LENGTH | GEOM_PERIMETER | GEOM_AZIMUTH | GEOG_AREA | GEOG_LENGTH | GEOG_PERIMETER | GEOM_IS_EMPTY | AINTERSECTS_TGEO_GEO | ACOVERS_TGEO_GEO | ADISJOINT_TGEO_GEO | ADWITHIN_TGEO_GEO | EINTERSECTS_TGEO_GEO | ETOUCHES_TGEO_GEO | ECONTAINS_TGEO_GEO | ACONTAINS_TGEO_GEO | ATOUCHES_TGEO_GEO | GEO_NUM_POINTS | GEO_NUM_GEOS | GEO_SRID | GEO_IS_UNITARY | GEO_EQUALS | GEO_SAME | GEOG_DISTANCE | NAD_TGEO_GEO | EVER_EQ_TGEO_GEO | EVER_NE_TGEO_GEO | ALWAYS_EQ_TGEO_GEO | ALWAYS_NE_TGEO_GEO | GEOG_INTERSECTS | GEOG_DWITHIN | ACOVERS_GEO_TGEO | GEOM_INTERSECTS | GEOM_DWITHIN | H3_GS_POINT_TO_CELL | EVER_EQ_TH3INDEX_H3INDEX | EVER_NE_TH3INDEX_H3INDEX | ALWAYS_EQ_TH3INDEX_H3INDEX | ALWAYS_NE_TH3INDEX_H3INDEX | TH3INDEX_GET_RESOLUTION | TH3INDEX_GET_BASE_CELL_NUMBER | TH3INDEX_IS_VALID_CELL | TH3INDEX_IS_PENTAGON | TH3INDEX_CELL_TO_PARENT_NEXT | TH3INDEX_CELL_TO_CENTER_CHILD_NEXT | TH3INDEX_CELL_TO_PARENT | TH3INDEX_CELL_TO_CENTER_CHILD | TH3INDEX_CELL_TO_CHILD_POS | TH3INDEX_ARE_NEIGHBOR_CELLS | TH3INDEX_GRID_DISTANCE | EINTERSECTS_TCBUFFER_GEO | AINTERSECTS_TCBUFFER_GEO | ECOVERS_TCBUFFER_GEO | ACOVERS_TCBUFFER_GEO | EDISJOINT_TCBUFFER_GEO | ADISJOINT_TCBUFFER_GEO | ETOUCHES_TCBUFFER_GEO | ATOUCHES_TCBUFFER_GEO | ECONTAINS_TCBUFFER_GEO | ACONTAINS_TCBUFFER_GEO | NAD_TCBUFFER_GEO | EDWITHIN_TCBUFFER_GEO | ADWITHIN_TCBUFFER_GEO | EINTERSECTS_TCBUFFER_CBUFFER | AINTERSECTS_TCBUFFER_CBUFFER | ECOVERS_TCBUFFER_CBUFFER | ACOVERS_TCBUFFER_CBUFFER | EDISJOINT_TCBUFFER_CBUFFER | ADISJOINT_TCBUFFER_CBUFFER | ETOUCHES_TCBUFFER_CBUFFER | ATOUCHES_TCBUFFER_CBUFFER | ECONTAINS_TCBUFFER_CBUFFER | ACONTAINS_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_CBUFFER | ALWAYS_EQ_TCBUFFER_CBUFFER | EVER_NE_TCBUFFER_CBUFFER | ALWAYS_NE_TCBUFFER_CBUFFER | NAD_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_TCBUFFER | ALWAYS_EQ_TCBUFFER_TCBUFFER | EVER_NE_TCBUFFER_TCBUFFER | ALWAYS_NE_TCBUFFER_TCBUFFER | EINTERSECTS_TCBUFFER_TCBUFFER | AINTERSECTS_TCBUFFER_TCBUFFER | ECOVERS_TCBUFFER_TCBUFFER | ACOVERS_TCBUFFER_TCBUFFER | ADISJOINT_TCBUFFER_TCBUFFER | ETOUCHES_TCBUFFER_TCBUFFER | ATOUCHES_TCBUFFER_TCBUFFER | NAD_TCBUFFER_TCBUFFER | EDWITHIN_TCBUFFER_TCBUFFER | ADWITHIN_TCBUFFER_TCBUFFER | MINDISTANCE_TCBUFFER_TCBUFFER | NAD_TNPOINT_GEO | EVER_EQ_TNPOINT_NPOINT | ALWAYS_EQ_TNPOINT_NPOINT | EVER_NE_TNPOINT_NPOINT | ALWAYS_NE_TNPOINT_NPOINT | NAD_TNPOINT_NPOINT | EVER_EQ_NPOINT_TNPOINT | ALWAYS_EQ_NPOINT_TNPOINT | EVER_NE_NPOINT_TNPOINT | ALWAYS_NE_NPOINT_TNPOINT | EVER_EQ_TNPOINT_TNPOINT | ALWAYS_EQ_TNPOINT_TNPOINT | EVER_NE_TNPOINT_TNPOINT | ALWAYS_NE_TNPOINT_TNPOINT | NAD_TNPOINT_TNPOINT | NAD_TPOSE_GEO | EVER_EQ_TPOSE_POSE | ALWAYS_EQ_TPOSE_POSE | EVER_NE_TPOSE_POSE | ALWAYS_NE_TPOSE_POSE | NAD_TPOSE_POSE | EVER_EQ_POSE_TPOSE | ALWAYS_EQ_POSE_TPOSE | EVER_NE_POSE_TPOSE | ALWAYS_NE_POSE_TPOSE | EVER_EQ_TPOSE_TPOSE | ALWAYS_EQ_TPOSE_TPOSE | EVER_NE_TPOSE_TPOSE | ALWAYS_NE_TPOSE_TPOSE | NAD_TPOSE_TPOSE | EVER_EQ_TRGEOMETRY_GEO | ALWAYS_EQ_TRGEOMETRY_GEO | EVER_NE_TRGEOMETRY_GEO | ALWAYS_NE_TRGEOMETRY_GEO | NAD_TRGEOMETRY_GEO | EVER_EQ_GEO_TRGEOMETRY | ALWAYS_EQ_GEO_TRGEOMETRY | EVER_NE_GEO_TRGEOMETRY | ALWAYS_NE_GEO_TRGEOMETRY | EVER_EQ_TRGEOMETRY_TRGEOMETRY | ALWAYS_EQ_TRGEOMETRY_TRGEOMETRY | EVER_NE_TRGEOMETRY_TRGEOMETRY | ALWAYS_NE_TRGEOMETRY_TRGEOMETRY | NAD_TRGEOMETRY_TRGEOMETRY | EINTERSECTS_TPCPOINT_GEO | NAD_TPCPOINT_GEO | QUADBIN_POINT_TO_CELL | QUADBIN_IS_VALID_CELL | QUADBIN_GET_RESOLUTION | QUADBIN_CELL_AREA | QUADBIN_CELL_TO_QUADKEY | QUADBIN_CELL_TO_PARENT | QUADBIN_TILE_TO_CELL | EVER_EQ_TJSONB_JSONB | ALWAYS_EQ_TJSONB_JSONB | EVER_NE_TJSONB_JSONB | ALWAYS_NE_TJSONB_JSONB | EVER_EQ_TJSONB_TJSONB | ALWAYS_EQ_TJSONB_TJSONB | EVER_NE_TJSONB_TJSONB | ALWAYS_NE_TJSONB_TJSONB | GEOM_BOUNDARY | GEOM_CENTROID | GEOM_CONVEX_HULL | GEO_REVERSE | GEO_POINTS | GEOM_UNARY_UNION | GEOM_DIFFERENCE2D | GEOM_INTERSECTION2D | GEOM_SHORTESTLINE2D | GEOM_SHORTESTLINE3D | GEO_SET_SRID | GEO_TRANSFORM | GEO_ROUND | GEOM_BUFFER | LINE_NUMPOINTS | LINE_LOCATE_POINT | LINE_INTERPOLATE_POINT | LINE_SUBSTRING | GEOM_POINT_MAKE2D | GEOM_POINT_MAKE3DZ | GEOG_POINT_MAKE2D | GEOG_POINT_MAKE3DZ | GEOM_TO_GEOG | GEOG_TO_GEOM | GEOG_CENTROID | GEO_GEO_N | LINE_POINT_N | GEOM_INTERSECTION2D_COLL | GEOM_INTERSECTS2D | GEOM_DWITHIN2D | GEOM_CONTAINS | GEOM_DISJOINT2D | GEOM_COVERS | GEOM_TOUCHES | GEOM_INTERSECTS3D | GEOM_DWITHIN3D | GEOM_DISTANCE2D | GEOM_DISTANCE3D; sinkClause: INTO sink (',' sink)*; @@ -936,6 +936,9 @@ GEOG_POINT_MAKE3DZ: 'GEOG_POINT_MAKE3DZ' | 'geogpoint_make3dz'; GEOM_TO_GEOG: 'GEOM_TO_GEOG' | 'geom_to_geog'; GEOG_TO_GEOM: 'GEOG_TO_GEOM' | 'geog_to_geom'; GEOG_CENTROID: 'GEOG_CENTROID' | 'geog_centroid'; +GEO_GEO_N: 'GEO_GEO_N' | 'geo_geo_n'; +LINE_POINT_N: 'LINE_POINT_N' | 'line_point_n'; +GEOM_INTERSECTION2D_COLL: 'GEOM_INTERSECTION2D_COLL' | 'geom_intersection2d_coll'; GEOM_INTERSECTS2D: 'GEOM_INTERSECTS2D' | 'geom_intersects2d'; GEOM_DWITHIN2D: 'GEOM_DWITHIN2D' | 'geom_dwithin2d'; GEOM_CONTAINS: 'GEOM_CONTAINS' | 'geom_contains'; diff --git a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp index bde0966bf6..9ffd21c82b 100644 --- a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp +++ b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp @@ -517,6 +517,9 @@ #include #include #include +#include +#include +#include #include #include #include @@ -11008,6 +11011,33 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont return LogicalFunction(GeogCentroidLogicalFunction(std::move(arg0), std::move(arg1))); } /* END CODEGEN PARSER GLUE: GEOG_CENTROID */ + case AntlrSQLParser::GEO_GEO_N: { + PRECONDITION(ctx->functionParam().size() == 2, + "GeoGeoN requires 2 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + return LogicalFunction(GeoGeoNLogicalFunction(std::move(arg0), std::move(arg1))); + } + /* END CODEGEN PARSER GLUE: GEO_GEO_N */ + case AntlrSQLParser::LINE_POINT_N: { + PRECONDITION(ctx->functionParam().size() == 2, + "LinePointN requires 2 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + return LogicalFunction(LinePointNLogicalFunction(std::move(arg0), std::move(arg1))); + } + /* END CODEGEN PARSER GLUE: LINE_POINT_N */ + case AntlrSQLParser::GEOM_INTERSECTION2D_COLL: { + PRECONDITION(ctx->functionParam().size() == 2, + "GeomIntersection2dColl requires 2 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + return LogicalFunction(GeomIntersection2dCollLogicalFunction(std::move(arg0), std::move(arg1))); + } + /* END CODEGEN PARSER GLUE: GEOM_INTERSECTION2D_COLL */ /* END CODEGEN PARSER GLUE: GEOM_INTERSECTS2D */ case AntlrSQLParser::GEOM_DWITHIN2D: { PRECONDITION(ctx->functionParam().size() == 3, From 9990e7d57838f3272d734f1e0abdba15e4f233db Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Mon, 15 Jun 2026 23:55:55 +0200 Subject: [PATCH 82/96] feat(meos): add geometry format, pipeline, and bounding-radius NES operators (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. --- .../Meos/GeoAsEwktLogicalFunction.hpp | 48 ++++++++ .../Meos/GeoAsGeojsonLogicalFunction.hpp | 48 ++++++++ .../Meos/GeoAsHexewkbLogicalFunction.hpp | 48 ++++++++ .../Meos/GeoFromGeojsonLogicalFunction.hpp | 48 ++++++++ .../GeoTransformPipelineLogicalFunction.hpp | 48 ++++++++ .../Meos/GeomFromHexewkbLogicalFunction.hpp | 48 ++++++++ .../GeomMinBoundingCenterLogicalFunction.hpp | 48 ++++++++ .../GeomMinBoundingRadiusLogicalFunction.hpp | 48 ++++++++ .../src/Functions/Meos/CMakeLists.txt | 8 ++ .../Meos/GeoAsEwktLogicalFunction.cpp | 99 +++++++++++++++++ .../Meos/GeoAsGeojsonLogicalFunction.cpp | 102 +++++++++++++++++ .../Meos/GeoAsHexewkbLogicalFunction.cpp | 99 +++++++++++++++++ .../Meos/GeoFromGeojsonLogicalFunction.cpp | 96 ++++++++++++++++ .../GeoTransformPipelineLogicalFunction.cpp | 105 ++++++++++++++++++ .../Meos/GeomFromHexewkbLogicalFunction.cpp | 96 ++++++++++++++++ .../GeomMinBoundingCenterLogicalFunction.cpp | 96 ++++++++++++++++ .../GeomMinBoundingRadiusLogicalFunction.cpp | 96 ++++++++++++++++ .../Meos/GeoAsEwktPhysicalFunction.hpp | 32 ++++++ .../Meos/GeoAsGeojsonPhysicalFunction.hpp | 32 ++++++ .../Meos/GeoAsHexewkbPhysicalFunction.hpp | 32 ++++++ .../Meos/GeoFromGeojsonPhysicalFunction.hpp | 32 ++++++ .../GeoTransformPipelinePhysicalFunction.hpp | 32 ++++++ .../Meos/GeomFromHexewkbPhysicalFunction.hpp | 32 ++++++ .../GeomMinBoundingCenterPhysicalFunction.hpp | 32 ++++++ .../GeomMinBoundingRadiusPhysicalFunction.hpp | 32 ++++++ .../src/Functions/Meos/CMakeLists.txt | 8 ++ .../Meos/GeoAsEwktPhysicalFunction.cpp | 84 ++++++++++++++ .../Meos/GeoAsGeojsonPhysicalFunction.cpp | 87 +++++++++++++++ .../Meos/GeoAsHexewkbPhysicalFunction.cpp | 84 ++++++++++++++ .../Meos/GeoFromGeojsonPhysicalFunction.cpp | 81 ++++++++++++++ .../GeoTransformPipelinePhysicalFunction.cpp | 93 ++++++++++++++++ .../Meos/GeomFromHexewkbPhysicalFunction.cpp | 81 ++++++++++++++ .../GeomMinBoundingCenterPhysicalFunction.cpp | 85 ++++++++++++++ .../GeomMinBoundingRadiusPhysicalFunction.cpp | 72 ++++++++++++ .../Meos/LineLocatePointPhysicalFunction.cpp | 2 +- .../Meos/LineNumpointsPhysicalFunction.cpp | 2 +- nes-sql-parser/AntlrSQL.g4 | 10 +- .../src/AntlrSQLQueryPlanCreator.cpp | 79 +++++++++++++ 38 files changed, 2202 insertions(+), 3 deletions(-) create mode 100644 nes-logical-operators/include/Functions/Meos/GeoAsEwktLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/GeoAsGeojsonLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/GeoAsHexewkbLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/GeoFromGeojsonLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/GeoTransformPipelineLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/GeomFromHexewkbLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/GeomMinBoundingCenterLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/GeomMinBoundingRadiusLogicalFunction.hpp create mode 100644 nes-logical-operators/src/Functions/Meos/GeoAsEwktLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/GeoAsGeojsonLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/GeoAsHexewkbLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/GeoFromGeojsonLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/GeoTransformPipelineLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/GeomFromHexewkbLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/GeomMinBoundingCenterLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/GeomMinBoundingRadiusLogicalFunction.cpp create mode 100644 nes-physical-operators/include/Functions/Meos/GeoAsEwktPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/GeoAsGeojsonPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/GeoAsHexewkbPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/GeoFromGeojsonPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/GeoTransformPipelinePhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/GeomFromHexewkbPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/GeomMinBoundingCenterPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/GeomMinBoundingRadiusPhysicalFunction.hpp create mode 100644 nes-physical-operators/src/Functions/Meos/GeoAsEwktPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/GeoAsGeojsonPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/GeoAsHexewkbPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/GeoFromGeojsonPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/GeoTransformPipelinePhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/GeomFromHexewkbPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/GeomMinBoundingCenterPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/GeomMinBoundingRadiusPhysicalFunction.cpp diff --git a/nes-logical-operators/include/Functions/Meos/GeoAsEwktLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeoAsEwktLogicalFunction.hpp new file mode 100644 index 0000000000..c0eeca384e --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/GeoAsEwktLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Serializes a geometry to EWKT with the given coordinate precision. + */ +class GeoAsEwktLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "GeoAsEwkt"; + + GeoAsEwktLogicalFunction(LogicalFunction wkt, LogicalFunction precision); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/GeoAsGeojsonLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeoAsGeojsonLogicalFunction.hpp new file mode 100644 index 0000000000..c0bd991cf0 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/GeoAsGeojsonLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Serializes a geometry to a GeoJSON string with given option and precision. + */ +class GeoAsGeojsonLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "GeoAsGeojson"; + + GeoAsGeojsonLogicalFunction(LogicalFunction wkt, LogicalFunction option, LogicalFunction precision); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/GeoAsHexewkbLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeoAsHexewkbLogicalFunction.hpp new file mode 100644 index 0000000000..471470c0dd --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/GeoAsHexewkbLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Serializes a geometry to hex EWKB with the given endian ('NDR' or 'XDR'). + */ +class GeoAsHexewkbLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "GeoAsHexewkb"; + + GeoAsHexewkbLogicalFunction(LogicalFunction wkt, LogicalFunction endian); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/GeoFromGeojsonLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeoFromGeojsonLogicalFunction.hpp new file mode 100644 index 0000000000..2654c72b5a --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/GeoFromGeojsonLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Parses a GeoJSON string and returns the geometry as WKT. + */ +class GeoFromGeojsonLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "GeoFromGeojson"; + + GeoFromGeojsonLogicalFunction(LogicalFunction json); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/GeoTransformPipelineLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeoTransformPipelineLogicalFunction.hpp new file mode 100644 index 0000000000..1f52566b0e --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/GeoTransformPipelineLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Reprojects a geometry using a PROJ pipeline string and target SRID, as WKT. + */ +class GeoTransformPipelineLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "GeoTransformPipeline"; + + GeoTransformPipelineLogicalFunction(LogicalFunction wkt, LogicalFunction pipeline, LogicalFunction srid_to, LogicalFunction is_forward); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/GeomFromHexewkbLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeomFromHexewkbLogicalFunction.hpp new file mode 100644 index 0000000000..b0e273e80d --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/GeomFromHexewkbLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Parses a hex EWKB string and returns the geometry as WKT. + */ +class GeomFromHexewkbLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "GeomFromHexewkb"; + + GeomFromHexewkbLogicalFunction(LogicalFunction hex); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/GeomMinBoundingCenterLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeomMinBoundingCenterLogicalFunction.hpp new file mode 100644 index 0000000000..049d7b7795 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/GeomMinBoundingCenterLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns the center point of the minimum bounding circle of a geometry as WKT. + */ +class GeomMinBoundingCenterLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "GeomMinBoundingCenter"; + + GeomMinBoundingCenterLogicalFunction(LogicalFunction wkt); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/GeomMinBoundingRadiusLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeomMinBoundingRadiusLogicalFunction.hpp new file mode 100644 index 0000000000..9e4b182013 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/GeomMinBoundingRadiusLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns the radius of the minimum bounding circle of a geometry. + */ +class GeomMinBoundingRadiusLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "GeomMinBoundingRadius"; + + GeomMinBoundingRadiusLogicalFunction(LogicalFunction wkt); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt index c3fd3c8c04..0c6e53dade 100644 --- a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt @@ -469,6 +469,14 @@ add_plugin(GeogCentroid LogicalFunction nes-logical-operators GeogCentroidLogica add_plugin(GeoGeoN LogicalFunction nes-logical-operators GeoGeoNLogicalFunction.cpp) add_plugin(LinePointN LogicalFunction nes-logical-operators LinePointNLogicalFunction.cpp) add_plugin(GeomIntersection2dColl LogicalFunction nes-logical-operators GeomIntersection2dCollLogicalFunction.cpp) +add_plugin(GeoAsGeojson LogicalFunction nes-logical-operators GeoAsGeojsonLogicalFunction.cpp) +add_plugin(GeoAsHexewkb LogicalFunction nes-logical-operators GeoAsHexewkbLogicalFunction.cpp) +add_plugin(GeoAsEwkt LogicalFunction nes-logical-operators GeoAsEwktLogicalFunction.cpp) +add_plugin(GeoFromGeojson LogicalFunction nes-logical-operators GeoFromGeojsonLogicalFunction.cpp) +add_plugin(GeomFromHexewkb LogicalFunction nes-logical-operators GeomFromHexewkbLogicalFunction.cpp) +add_plugin(GeoTransformPipeline LogicalFunction nes-logical-operators GeoTransformPipelineLogicalFunction.cpp) +add_plugin(GeomMinBoundingCenter LogicalFunction nes-logical-operators GeomMinBoundingCenterLogicalFunction.cpp) +add_plugin(GeomMinBoundingRadius LogicalFunction nes-logical-operators GeomMinBoundingRadiusLogicalFunction.cpp) add_plugin(GeomIntersects2d LogicalFunction nes-logical-operators GeomIntersects2dLogicalFunction.cpp) add_plugin(GeomDwithin2d LogicalFunction nes-logical-operators GeomDwithin2dLogicalFunction.cpp) add_plugin(GeomContains LogicalFunction nes-logical-operators GeomContainsLogicalFunction.cpp) diff --git a/nes-logical-operators/src/Functions/Meos/GeoAsEwktLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeoAsEwktLogicalFunction.cpp new file mode 100644 index 0000000000..7b45560683 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/GeoAsEwktLogicalFunction.cpp @@ -0,0 +1,99 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +GeoAsEwktLogicalFunction::GeoAsEwktLogicalFunction(LogicalFunction wkt, LogicalFunction precision) + : dataType(DataTypeProvider::provideDataType(DataType::Type::VARSIZED)) +{ + parameters.reserve(2); + parameters.push_back(std::move(wkt)); + parameters.push_back(std::move(precision)); +} + +DataType GeoAsEwktLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction GeoAsEwktLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector GeoAsEwktLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction GeoAsEwktLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 2, + "GeoAsEwktLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view GeoAsEwktLogicalFunction::getType() const { return NAME; } + +bool GeoAsEwktLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string GeoAsEwktLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction GeoAsEwktLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(2); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "wkt must be VARSIZED"); + INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "precision must be UINT64"); + return withChildren(c); +} + +SerializableFunction GeoAsEwktLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeoAsEwktLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 2, + "GeoAsEwktLogicalFunction requires 2 children but got {}", + arguments.children.size()); + return GeoAsEwktLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/GeoAsGeojsonLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeoAsGeojsonLogicalFunction.cpp new file mode 100644 index 0000000000..b0f1ed3ba6 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/GeoAsGeojsonLogicalFunction.cpp @@ -0,0 +1,102 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +GeoAsGeojsonLogicalFunction::GeoAsGeojsonLogicalFunction(LogicalFunction wkt, LogicalFunction option, LogicalFunction precision) + : dataType(DataTypeProvider::provideDataType(DataType::Type::VARSIZED)) +{ + parameters.reserve(3); + parameters.push_back(std::move(wkt)); + parameters.push_back(std::move(option)); + parameters.push_back(std::move(precision)); +} + +DataType GeoAsGeojsonLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction GeoAsGeojsonLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector GeoAsGeojsonLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction GeoAsGeojsonLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, + "GeoAsGeojsonLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view GeoAsGeojsonLogicalFunction::getType() const { return NAME; } + +bool GeoAsGeojsonLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string GeoAsGeojsonLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction GeoAsGeojsonLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(3); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "wkt must be VARSIZED"); + INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "option must be UINT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "precision must be UINT64"); + return withChildren(c); +} + +SerializableFunction GeoAsGeojsonLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeoAsGeojsonLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "GeoAsGeojsonLogicalFunction requires 3 children but got {}", + arguments.children.size()); + return GeoAsGeojsonLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/GeoAsHexewkbLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeoAsHexewkbLogicalFunction.cpp new file mode 100644 index 0000000000..596880efcd --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/GeoAsHexewkbLogicalFunction.cpp @@ -0,0 +1,99 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +GeoAsHexewkbLogicalFunction::GeoAsHexewkbLogicalFunction(LogicalFunction wkt, LogicalFunction endian) + : dataType(DataTypeProvider::provideDataType(DataType::Type::VARSIZED)) +{ + parameters.reserve(2); + parameters.push_back(std::move(wkt)); + parameters.push_back(std::move(endian)); +} + +DataType GeoAsHexewkbLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction GeoAsHexewkbLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector GeoAsHexewkbLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction GeoAsHexewkbLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 2, + "GeoAsHexewkbLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view GeoAsHexewkbLogicalFunction::getType() const { return NAME; } + +bool GeoAsHexewkbLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string GeoAsHexewkbLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction GeoAsHexewkbLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(2); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "wkt must be VARSIZED"); + INVARIANT(c[1].getDataType().isType(DataType::Type::VARSIZED), "endian must be VARSIZED"); + return withChildren(c); +} + +SerializableFunction GeoAsHexewkbLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeoAsHexewkbLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 2, + "GeoAsHexewkbLogicalFunction requires 2 children but got {}", + arguments.children.size()); + return GeoAsHexewkbLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/GeoFromGeojsonLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeoFromGeojsonLogicalFunction.cpp new file mode 100644 index 0000000000..28076fcd7a --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/GeoFromGeojsonLogicalFunction.cpp @@ -0,0 +1,96 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +GeoFromGeojsonLogicalFunction::GeoFromGeojsonLogicalFunction(LogicalFunction json) + : dataType(DataTypeProvider::provideDataType(DataType::Type::VARSIZED)) +{ + parameters.reserve(1); + parameters.push_back(std::move(json)); +} + +DataType GeoFromGeojsonLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction GeoFromGeojsonLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector GeoFromGeojsonLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction GeoFromGeojsonLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 1, + "GeoFromGeojsonLogicalFunction requires 1 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view GeoFromGeojsonLogicalFunction::getType() const { return NAME; } + +bool GeoFromGeojsonLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string GeoFromGeojsonLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction GeoFromGeojsonLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(1); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "json must be VARSIZED"); + return withChildren(c); +} + +SerializableFunction GeoFromGeojsonLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeoFromGeojsonLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 1, + "GeoFromGeojsonLogicalFunction requires 1 children but got {}", + arguments.children.size()); + return GeoFromGeojsonLogicalFunction( + std::move(arguments.children[0])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/GeoTransformPipelineLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeoTransformPipelineLogicalFunction.cpp new file mode 100644 index 0000000000..0c67a248f1 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/GeoTransformPipelineLogicalFunction.cpp @@ -0,0 +1,105 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +GeoTransformPipelineLogicalFunction::GeoTransformPipelineLogicalFunction(LogicalFunction wkt, LogicalFunction pipeline, LogicalFunction srid_to, LogicalFunction is_forward) + : dataType(DataTypeProvider::provideDataType(DataType::Type::VARSIZED)) +{ + parameters.reserve(4); + parameters.push_back(std::move(wkt)); + parameters.push_back(std::move(pipeline)); + parameters.push_back(std::move(srid_to)); + parameters.push_back(std::move(is_forward)); +} + +DataType GeoTransformPipelineLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction GeoTransformPipelineLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector GeoTransformPipelineLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction GeoTransformPipelineLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 4, + "GeoTransformPipelineLogicalFunction requires 4 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view GeoTransformPipelineLogicalFunction::getType() const { return NAME; } + +bool GeoTransformPipelineLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string GeoTransformPipelineLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction GeoTransformPipelineLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(4); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "wkt must be VARSIZED"); + INVARIANT(c[1].getDataType().isType(DataType::Type::VARSIZED), "pipeline must be VARSIZED"); + INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "srid_to must be UINT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "is_forward must be UINT64"); + return withChildren(c); +} + +SerializableFunction GeoTransformPipelineLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeoTransformPipelineLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 4, + "GeoTransformPipelineLogicalFunction requires 4 children but got {}", + arguments.children.size()); + return GeoTransformPipelineLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/GeomFromHexewkbLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeomFromHexewkbLogicalFunction.cpp new file mode 100644 index 0000000000..3bb0638e11 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/GeomFromHexewkbLogicalFunction.cpp @@ -0,0 +1,96 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +GeomFromHexewkbLogicalFunction::GeomFromHexewkbLogicalFunction(LogicalFunction hex) + : dataType(DataTypeProvider::provideDataType(DataType::Type::VARSIZED)) +{ + parameters.reserve(1); + parameters.push_back(std::move(hex)); +} + +DataType GeomFromHexewkbLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction GeomFromHexewkbLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector GeomFromHexewkbLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction GeomFromHexewkbLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 1, + "GeomFromHexewkbLogicalFunction requires 1 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view GeomFromHexewkbLogicalFunction::getType() const { return NAME; } + +bool GeomFromHexewkbLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string GeomFromHexewkbLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction GeomFromHexewkbLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(1); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "hex must be VARSIZED"); + return withChildren(c); +} + +SerializableFunction GeomFromHexewkbLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeomFromHexewkbLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 1, + "GeomFromHexewkbLogicalFunction requires 1 children but got {}", + arguments.children.size()); + return GeomFromHexewkbLogicalFunction( + std::move(arguments.children[0])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/GeomMinBoundingCenterLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeomMinBoundingCenterLogicalFunction.cpp new file mode 100644 index 0000000000..3fda8dff38 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/GeomMinBoundingCenterLogicalFunction.cpp @@ -0,0 +1,96 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +GeomMinBoundingCenterLogicalFunction::GeomMinBoundingCenterLogicalFunction(LogicalFunction wkt) + : dataType(DataTypeProvider::provideDataType(DataType::Type::VARSIZED)) +{ + parameters.reserve(1); + parameters.push_back(std::move(wkt)); +} + +DataType GeomMinBoundingCenterLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction GeomMinBoundingCenterLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector GeomMinBoundingCenterLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction GeomMinBoundingCenterLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 1, + "GeomMinBoundingCenterLogicalFunction requires 1 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view GeomMinBoundingCenterLogicalFunction::getType() const { return NAME; } + +bool GeomMinBoundingCenterLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string GeomMinBoundingCenterLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction GeomMinBoundingCenterLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(1); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "wkt must be VARSIZED"); + return withChildren(c); +} + +SerializableFunction GeomMinBoundingCenterLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeomMinBoundingCenterLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 1, + "GeomMinBoundingCenterLogicalFunction requires 1 children but got {}", + arguments.children.size()); + return GeomMinBoundingCenterLogicalFunction( + std::move(arguments.children[0])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/GeomMinBoundingRadiusLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeomMinBoundingRadiusLogicalFunction.cpp new file mode 100644 index 0000000000..e7603f2c0c --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/GeomMinBoundingRadiusLogicalFunction.cpp @@ -0,0 +1,96 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +GeomMinBoundingRadiusLogicalFunction::GeomMinBoundingRadiusLogicalFunction(LogicalFunction wkt) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(1); + parameters.push_back(std::move(wkt)); +} + +DataType GeomMinBoundingRadiusLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction GeomMinBoundingRadiusLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector GeomMinBoundingRadiusLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction GeomMinBoundingRadiusLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 1, + "GeomMinBoundingRadiusLogicalFunction requires 1 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view GeomMinBoundingRadiusLogicalFunction::getType() const { return NAME; } + +bool GeomMinBoundingRadiusLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string GeomMinBoundingRadiusLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction GeomMinBoundingRadiusLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(1); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "wkt must be VARSIZED"); + return withChildren(c); +} + +SerializableFunction GeomMinBoundingRadiusLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeomMinBoundingRadiusLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 1, + "GeomMinBoundingRadiusLogicalFunction requires 1 children but got {}", + arguments.children.size()); + return GeomMinBoundingRadiusLogicalFunction( + std::move(arguments.children[0])); +} + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeoAsEwktPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeoAsEwktPhysicalFunction.hpp new file mode 100644 index 0000000000..b400321472 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/GeoAsEwktPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class GeoAsEwktPhysicalFunction : public PhysicalFunctionConcept { +public: + GeoAsEwktPhysicalFunction(PhysicalFunction wkt, PhysicalFunction precision); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeoAsGeojsonPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeoAsGeojsonPhysicalFunction.hpp new file mode 100644 index 0000000000..e8ad9401a5 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/GeoAsGeojsonPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class GeoAsGeojsonPhysicalFunction : public PhysicalFunctionConcept { +public: + GeoAsGeojsonPhysicalFunction(PhysicalFunction wkt, PhysicalFunction option, PhysicalFunction precision); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeoAsHexewkbPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeoAsHexewkbPhysicalFunction.hpp new file mode 100644 index 0000000000..fedc44feeb --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/GeoAsHexewkbPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class GeoAsHexewkbPhysicalFunction : public PhysicalFunctionConcept { +public: + GeoAsHexewkbPhysicalFunction(PhysicalFunction wkt, PhysicalFunction endian); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeoFromGeojsonPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeoFromGeojsonPhysicalFunction.hpp new file mode 100644 index 0000000000..3097db9f89 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/GeoFromGeojsonPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class GeoFromGeojsonPhysicalFunction : public PhysicalFunctionConcept { +public: + GeoFromGeojsonPhysicalFunction(PhysicalFunction json); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeoTransformPipelinePhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeoTransformPipelinePhysicalFunction.hpp new file mode 100644 index 0000000000..969e3b3533 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/GeoTransformPipelinePhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class GeoTransformPipelinePhysicalFunction : public PhysicalFunctionConcept { +public: + GeoTransformPipelinePhysicalFunction(PhysicalFunction wkt, PhysicalFunction pipeline, PhysicalFunction srid_to, PhysicalFunction is_forward); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeomFromHexewkbPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeomFromHexewkbPhysicalFunction.hpp new file mode 100644 index 0000000000..323d35e263 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/GeomFromHexewkbPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class GeomFromHexewkbPhysicalFunction : public PhysicalFunctionConcept { +public: + GeomFromHexewkbPhysicalFunction(PhysicalFunction hex); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeomMinBoundingCenterPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeomMinBoundingCenterPhysicalFunction.hpp new file mode 100644 index 0000000000..c0440f0a7e --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/GeomMinBoundingCenterPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class GeomMinBoundingCenterPhysicalFunction : public PhysicalFunctionConcept { +public: + GeomMinBoundingCenterPhysicalFunction(PhysicalFunction wkt); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeomMinBoundingRadiusPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeomMinBoundingRadiusPhysicalFunction.hpp new file mode 100644 index 0000000000..79e140cd92 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/GeomMinBoundingRadiusPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class GeomMinBoundingRadiusPhysicalFunction : public PhysicalFunctionConcept { +public: + GeomMinBoundingRadiusPhysicalFunction(PhysicalFunction wkt); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt index 630fabdc71..efab7778ab 100644 --- a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt @@ -468,6 +468,14 @@ add_plugin(GeogCentroid PhysicalFunction nes-physical-operators GeogCentroidPhys add_plugin(GeoGeoN PhysicalFunction nes-physical-operators GeoGeoNPhysicalFunction.cpp) add_plugin(LinePointN PhysicalFunction nes-physical-operators LinePointNPhysicalFunction.cpp) add_plugin(GeomIntersection2dColl PhysicalFunction nes-physical-operators GeomIntersection2dCollPhysicalFunction.cpp) +add_plugin(GeoAsGeojson PhysicalFunction nes-physical-operators GeoAsGeojsonPhysicalFunction.cpp) +add_plugin(GeoAsHexewkb PhysicalFunction nes-physical-operators GeoAsHexewkbPhysicalFunction.cpp) +add_plugin(GeoAsEwkt PhysicalFunction nes-physical-operators GeoAsEwktPhysicalFunction.cpp) +add_plugin(GeoFromGeojson PhysicalFunction nes-physical-operators GeoFromGeojsonPhysicalFunction.cpp) +add_plugin(GeomFromHexewkb PhysicalFunction nes-physical-operators GeomFromHexewkbPhysicalFunction.cpp) +add_plugin(GeoTransformPipeline PhysicalFunction nes-physical-operators GeoTransformPipelinePhysicalFunction.cpp) +add_plugin(GeomMinBoundingCenter PhysicalFunction nes-physical-operators GeomMinBoundingCenterPhysicalFunction.cpp) +add_plugin(GeomMinBoundingRadius PhysicalFunction nes-physical-operators GeomMinBoundingRadiusPhysicalFunction.cpp) add_plugin(GeomIntersects2d PhysicalFunction nes-physical-operators GeomIntersects2dPhysicalFunction.cpp) add_plugin(GeomDwithin2d PhysicalFunction nes-physical-operators GeomDwithin2dPhysicalFunction.cpp) add_plugin(GeomContains PhysicalFunction nes-physical-operators GeomContainsPhysicalFunction.cpp) diff --git a/nes-physical-operators/src/Functions/Meos/GeoAsEwktPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeoAsEwktPhysicalFunction.cpp new file mode 100644 index 0000000000..723f76d418 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/GeoAsEwktPhysicalFunction.cpp @@ -0,0 +1,84 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +GeoAsEwktPhysicalFunction::GeoAsEwktPhysicalFunction(PhysicalFunction wkt, PhysicalFunction precision) +{ + paramFns.reserve(2); + paramFns.push_back(std::move(wkt)); + paramFns.push_back(std::move(precision)); +} + +VarVal GeoAsEwktPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto wkt = paramFns[0].execute(record, arena).cast(); + auto precision = paramFns[1].execute(record, arena).cast>(); + constexpr uint32_t MAX_LEN = 16384; + auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); + + const auto actualLen = nautilus::invoke( + +[](const char* w, uint32_t wsz, uint64_t precision, char* buf, uint32_t bufMax) -> uint32_t { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string s(w, wsz); + GSERIALIZED* gs = geom_in(s.c_str(), -1); + if (!gs) return 0u; + char* out = geo_as_ewkt(gs, (int)precision); + free(gs); + if (!out) return 0u; + uint32_t len = static_cast(strlen(out)); + if (len > bufMax) len = bufMax; + memcpy(buf, out, len); + free(out); + return len; + } catch (const std::exception&) { return 0u; } + }, + wkt, precision, outBuf.getContent(), nautilus::val(MAX_LEN)); + + VarVal(actualLen).writeToMemory(outBuf.getReference()); + return outBuf; +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterGeoAsEwktPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 2, + "GeoAsEwktPhysicalFunction requires 2 children but got {}", + arguments.childFunctions.size()); + return GeoAsEwktPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/GeoAsGeojsonPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeoAsGeojsonPhysicalFunction.cpp new file mode 100644 index 0000000000..4cc0e6ed08 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/GeoAsGeojsonPhysicalFunction.cpp @@ -0,0 +1,87 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +GeoAsGeojsonPhysicalFunction::GeoAsGeojsonPhysicalFunction(PhysicalFunction wkt, PhysicalFunction option, PhysicalFunction precision) +{ + paramFns.reserve(3); + paramFns.push_back(std::move(wkt)); + paramFns.push_back(std::move(option)); + paramFns.push_back(std::move(precision)); +} + +VarVal GeoAsGeojsonPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto wkt = paramFns[0].execute(record, arena).cast(); + auto option = paramFns[1].execute(record, arena).cast>(); + auto precision = paramFns[2].execute(record, arena).cast>(); + constexpr uint32_t MAX_LEN = 16384; + auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); + + const auto actualLen = nautilus::invoke( + +[](const char* w, uint32_t wsz, uint64_t option, uint64_t precision, char* buf, uint32_t bufMax) -> uint32_t { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string s(w, wsz); + GSERIALIZED* gs = geom_in(s.c_str(), -1); + if (!gs) return 0u; + char* out = geo_as_geojson(gs, (int)option, (int)precision, nullptr); + free(gs); + if (!out) return 0u; + uint32_t len = static_cast(strlen(out)); + if (len > bufMax) len = bufMax; + memcpy(buf, out, len); + free(out); + return len; + } catch (const std::exception&) { return 0u; } + }, + wkt, option, precision, outBuf.getContent(), nautilus::val(MAX_LEN)); + + VarVal(actualLen).writeToMemory(outBuf.getReference()); + return outBuf; +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterGeoAsGeojsonPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "GeoAsGeojsonPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + return GeoAsGeojsonPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/GeoAsHexewkbPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeoAsHexewkbPhysicalFunction.cpp new file mode 100644 index 0000000000..75ea7c67ad --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/GeoAsHexewkbPhysicalFunction.cpp @@ -0,0 +1,84 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +GeoAsHexewkbPhysicalFunction::GeoAsHexewkbPhysicalFunction(PhysicalFunction wkt, PhysicalFunction endian) +{ + paramFns.reserve(2); + paramFns.push_back(std::move(wkt)); + paramFns.push_back(std::move(endian)); +} + +VarVal GeoAsHexewkbPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto wkt = paramFns[0].execute(record, arena).cast(); + auto endian = paramFns[1].execute(record, arena).cast(); + constexpr uint32_t MAX_LEN = 16384; + auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); + + const auto actualLen = nautilus::invoke( + +[](const char* w, uint32_t wsz, const char* e, uint32_t esz, char* buf, uint32_t bufMax) -> uint32_t { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string s(w, wsz), es(e, esz); + GSERIALIZED* gs = geom_in(s.c_str(), -1); + if (!gs) return 0u; + char* out = geo_as_hexewkb(gs, es.c_str()); + free(gs); + if (!out) return 0u; + uint32_t len = static_cast(strlen(out)); + if (len > bufMax) len = bufMax; + memcpy(buf, out, len); + free(out); + return len; + } catch (const std::exception&) { return 0u; } + }, + wkt, endian, outBuf.getContent(), nautilus::val(MAX_LEN)); + + VarVal(actualLen).writeToMemory(outBuf.getReference()); + return outBuf; +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterGeoAsHexewkbPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 2, + "GeoAsHexewkbPhysicalFunction requires 2 children but got {}", + arguments.childFunctions.size()); + return GeoAsHexewkbPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/GeoFromGeojsonPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeoFromGeojsonPhysicalFunction.cpp new file mode 100644 index 0000000000..ba739eda83 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/GeoFromGeojsonPhysicalFunction.cpp @@ -0,0 +1,81 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +GeoFromGeojsonPhysicalFunction::GeoFromGeojsonPhysicalFunction(PhysicalFunction json) +{ + paramFns.reserve(1); + paramFns.push_back(std::move(json)); +} + +VarVal GeoFromGeojsonPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto json = paramFns[0].execute(record, arena).cast(); + constexpr uint32_t MAX_LEN = 16384; + auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); + + const auto actualLen = nautilus::invoke( + +[](const char* j, uint32_t jsz, char* buf, uint32_t bufMax) -> uint32_t { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string js(j, jsz); + GSERIALIZED* result = geo_from_geojson(js.c_str()); + if (!result) return 0u; + char* out = geo_as_text(result, -1); + free(result); + if (!out) return 0u; + uint32_t len = static_cast(strlen(out)); + if (len > bufMax) len = bufMax; + memcpy(buf, out, len); + free(out); + return len; + } catch (const std::exception&) { return 0u; } + }, + json, outBuf.getContent(), nautilus::val(MAX_LEN)); + + VarVal(actualLen).writeToMemory(outBuf.getReference()); + return outBuf; +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterGeoFromGeojsonPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 1, + "GeoFromGeojsonPhysicalFunction requires 1 children but got {}", + arguments.childFunctions.size()); + return GeoFromGeojsonPhysicalFunction( + std::move(arguments.childFunctions[0])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/GeoTransformPipelinePhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeoTransformPipelinePhysicalFunction.cpp new file mode 100644 index 0000000000..a79ad8b00e --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/GeoTransformPipelinePhysicalFunction.cpp @@ -0,0 +1,93 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +GeoTransformPipelinePhysicalFunction::GeoTransformPipelinePhysicalFunction(PhysicalFunction wkt, PhysicalFunction pipeline, PhysicalFunction srid_to, PhysicalFunction is_forward) +{ + paramFns.reserve(4); + paramFns.push_back(std::move(wkt)); + paramFns.push_back(std::move(pipeline)); + paramFns.push_back(std::move(srid_to)); + paramFns.push_back(std::move(is_forward)); +} + +VarVal GeoTransformPipelinePhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto wkt = paramFns[0].execute(record, arena).cast(); + auto pipeline = paramFns[1].execute(record, arena).cast(); + auto srid_to = paramFns[2].execute(record, arena).cast>(); + auto is_forward = paramFns[3].execute(record, arena).cast>(); + constexpr uint32_t MAX_LEN = 16384; + auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); + + const auto actualLen = nautilus::invoke( + +[](const char* w, uint32_t wsz, const char* p, uint32_t psz, uint64_t srid_to, uint64_t is_forward, char* buf, uint32_t bufMax) -> uint32_t { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string s(w, wsz), ps(p, psz); + GSERIALIZED* gs = geom_in(s.c_str(), -1); + if (!gs) return 0u; + GSERIALIZED* result = geo_transform_pipeline(gs, const_cast(ps.c_str()), (int32_t)srid_to, (bool)is_forward); + free(gs); + if (!result) return 0u; + char* out = geo_as_text(result, -1); + free(result); + if (!out) return 0u; + uint32_t len = static_cast(strlen(out)); + if (len > bufMax) len = bufMax; + memcpy(buf, out, len); + free(out); + return len; + } catch (const std::exception&) { return 0u; } + }, + wkt, pipeline, srid_to, is_forward, outBuf.getContent(), nautilus::val(MAX_LEN)); + + VarVal(actualLen).writeToMemory(outBuf.getReference()); + return outBuf; +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterGeoTransformPipelinePhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 4, + "GeoTransformPipelinePhysicalFunction requires 4 children but got {}", + arguments.childFunctions.size()); + return GeoTransformPipelinePhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/GeomFromHexewkbPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeomFromHexewkbPhysicalFunction.cpp new file mode 100644 index 0000000000..64de342519 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/GeomFromHexewkbPhysicalFunction.cpp @@ -0,0 +1,81 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +GeomFromHexewkbPhysicalFunction::GeomFromHexewkbPhysicalFunction(PhysicalFunction hex) +{ + paramFns.reserve(1); + paramFns.push_back(std::move(hex)); +} + +VarVal GeomFromHexewkbPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto hex = paramFns[0].execute(record, arena).cast(); + constexpr uint32_t MAX_LEN = 16384; + auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); + + const auto actualLen = nautilus::invoke( + +[](const char* h, uint32_t hsz, char* buf, uint32_t bufMax) -> uint32_t { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string hs(h, hsz); + GSERIALIZED* result = geom_from_hexewkb(hs.c_str()); + if (!result) return 0u; + char* out = geo_as_text(result, -1); + free(result); + if (!out) return 0u; + uint32_t len = static_cast(strlen(out)); + if (len > bufMax) len = bufMax; + memcpy(buf, out, len); + free(out); + return len; + } catch (const std::exception&) { return 0u; } + }, + hex, outBuf.getContent(), nautilus::val(MAX_LEN)); + + VarVal(actualLen).writeToMemory(outBuf.getReference()); + return outBuf; +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterGeomFromHexewkbPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 1, + "GeomFromHexewkbPhysicalFunction requires 1 children but got {}", + arguments.childFunctions.size()); + return GeomFromHexewkbPhysicalFunction( + std::move(arguments.childFunctions[0])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/GeomMinBoundingCenterPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeomMinBoundingCenterPhysicalFunction.cpp new file mode 100644 index 0000000000..45f05a0313 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/GeomMinBoundingCenterPhysicalFunction.cpp @@ -0,0 +1,85 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +GeomMinBoundingCenterPhysicalFunction::GeomMinBoundingCenterPhysicalFunction(PhysicalFunction wkt) +{ + paramFns.reserve(1); + paramFns.push_back(std::move(wkt)); +} + +VarVal GeomMinBoundingCenterPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto wkt = paramFns[0].execute(record, arena).cast(); + constexpr uint32_t MAX_LEN = 16384; + auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); + + const auto actualLen = nautilus::invoke( + +[](const char* w, uint32_t wsz, char* buf, uint32_t bufMax) -> uint32_t { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string s(w, wsz); + GSERIALIZED* gs = geom_in(s.c_str(), -1); + if (!gs) return 0u; + MinBoundingCircle mbc = geom_min_bounding_radius(gs); + free(gs); + GSERIALIZED* result = mbc.center; + if (!result) return 0u; + char* out = geo_as_text(result, -1); + free(result); + if (!out) return 0u; + uint32_t len = static_cast(strlen(out)); + if (len > bufMax) len = bufMax; + memcpy(buf, out, len); + free(out); + return len; + } catch (const std::exception&) { return 0u; } + }, + wkt, outBuf.getContent(), nautilus::val(MAX_LEN)); + + VarVal(actualLen).writeToMemory(outBuf.getReference()); + return outBuf; +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterGeomMinBoundingCenterPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 1, + "GeomMinBoundingCenterPhysicalFunction requires 1 children but got {}", + arguments.childFunctions.size()); + return GeomMinBoundingCenterPhysicalFunction( + std::move(arguments.childFunctions[0])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/GeomMinBoundingRadiusPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeomMinBoundingRadiusPhysicalFunction.cpp new file mode 100644 index 0000000000..48e87d1fbb --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/GeomMinBoundingRadiusPhysicalFunction.cpp @@ -0,0 +1,72 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +GeomMinBoundingRadiusPhysicalFunction::GeomMinBoundingRadiusPhysicalFunction(PhysicalFunction wkt) +{ + paramFns.reserve(1); + paramFns.push_back(std::move(wkt)); +} + +VarVal GeomMinBoundingRadiusPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto wkt = paramFns[0].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](const char* w, uint32_t wsz) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string s(w, wsz); + GSERIALIZED* gs = geom_in(s.c_str(), -1); + if (!gs) return 0.0; + MinBoundingCircle mbc = geom_min_bounding_radius(gs); + free(gs); + if (mbc.center) free(mbc.center); + return mbc.radius; + } catch (const std::exception&) { return 0.0; } + }, + wkt); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterGeomMinBoundingRadiusPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 1, + "GeomMinBoundingRadiusPhysicalFunction requires 1 children but got {}", + arguments.childFunctions.size()); + return GeomMinBoundingRadiusPhysicalFunction( + std::move(arguments.childFunctions[0])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/LineLocatePointPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/LineLocatePointPhysicalFunction.cpp index 22cb999698..0f0e12b8bb 100644 --- a/nes-physical-operators/src/Functions/Meos/LineLocatePointPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/LineLocatePointPhysicalFunction.cpp @@ -45,7 +45,7 @@ VarVal LineLocatePointPhysicalFunction::execute(const Record& record, ArenaRef& auto wkt1 = paramFns[0].execute(record, arena).cast(); auto wkt2 = paramFns[1].execute(record, arena).cast(); const auto result = nautilus::invoke( - +[](const char* w1, uint32_t w1sz, const char* w2, uint32_t w2sz) -> double -> double { + +[](const char* w1, uint32_t w1sz, const char* w2, uint32_t w2sz) -> double { try { MEOS::Meos::ensureMeosInitialized(); std::string s1(w1, w1sz), s2(w2, w2sz); diff --git a/nes-physical-operators/src/Functions/Meos/LineNumpointsPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/LineNumpointsPhysicalFunction.cpp index 60c8c90294..97ca449b29 100644 --- a/nes-physical-operators/src/Functions/Meos/LineNumpointsPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/LineNumpointsPhysicalFunction.cpp @@ -43,7 +43,7 @@ VarVal LineNumpointsPhysicalFunction::execute(const Record& record, ArenaRef& ar { auto wkt = paramFns[0].execute(record, arena).cast(); const auto result = nautilus::invoke( - +[](const char* w, uint32_t wsz) -> double -> double { + +[](const char* w, uint32_t wsz) -> double { try { MEOS::Meos::ensureMeosInitialized(); std::string s(w, wsz); diff --git a/nes-sql-parser/AntlrSQL.g4 b/nes-sql-parser/AntlrSQL.g4 index d795d54ab9..fea595b6ba 100644 --- a/nes-sql-parser/AntlrSQL.g4 +++ b/nes-sql-parser/AntlrSQL.g4 @@ -295,7 +295,7 @@ timeUnit: MS timestampParameter: name=identifier; -functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT | TGE_TTEXT_TEXT | TGE_TEXT_TTEXT | TGT_TTEXT_TEXT | TGT_TEXT_TTEXT | TLE_TTEXT_TEXT | TLE_TEXT_TTEXT | TLT_TTEXT_TEXT | TLT_TEXT_TTEXT | TTEXT_UPPER | TTEXT_LOWER | TTEXT_INITCAP | TEXTCAT_TTEXT_TEXT | TEXTCAT_TEXT_TTEXT | TEXTCAT_TTEXT_TTEXT | GEOM_LENGTH | GEOM_PERIMETER | GEOM_AZIMUTH | GEOG_AREA | GEOG_LENGTH | GEOG_PERIMETER | GEOM_IS_EMPTY | AINTERSECTS_TGEO_GEO | ACOVERS_TGEO_GEO | ADISJOINT_TGEO_GEO | ADWITHIN_TGEO_GEO | EINTERSECTS_TGEO_GEO | ETOUCHES_TGEO_GEO | ECONTAINS_TGEO_GEO | ACONTAINS_TGEO_GEO | ATOUCHES_TGEO_GEO | GEO_NUM_POINTS | GEO_NUM_GEOS | GEO_SRID | GEO_IS_UNITARY | GEO_EQUALS | GEO_SAME | GEOG_DISTANCE | NAD_TGEO_GEO | EVER_EQ_TGEO_GEO | EVER_NE_TGEO_GEO | ALWAYS_EQ_TGEO_GEO | ALWAYS_NE_TGEO_GEO | GEOG_INTERSECTS | GEOG_DWITHIN | ACOVERS_GEO_TGEO | GEOM_INTERSECTS | GEOM_DWITHIN | H3_GS_POINT_TO_CELL | EVER_EQ_TH3INDEX_H3INDEX | EVER_NE_TH3INDEX_H3INDEX | ALWAYS_EQ_TH3INDEX_H3INDEX | ALWAYS_NE_TH3INDEX_H3INDEX | TH3INDEX_GET_RESOLUTION | TH3INDEX_GET_BASE_CELL_NUMBER | TH3INDEX_IS_VALID_CELL | TH3INDEX_IS_PENTAGON | TH3INDEX_CELL_TO_PARENT_NEXT | TH3INDEX_CELL_TO_CENTER_CHILD_NEXT | TH3INDEX_CELL_TO_PARENT | TH3INDEX_CELL_TO_CENTER_CHILD | TH3INDEX_CELL_TO_CHILD_POS | TH3INDEX_ARE_NEIGHBOR_CELLS | TH3INDEX_GRID_DISTANCE | EINTERSECTS_TCBUFFER_GEO | AINTERSECTS_TCBUFFER_GEO | ECOVERS_TCBUFFER_GEO | ACOVERS_TCBUFFER_GEO | EDISJOINT_TCBUFFER_GEO | ADISJOINT_TCBUFFER_GEO | ETOUCHES_TCBUFFER_GEO | ATOUCHES_TCBUFFER_GEO | ECONTAINS_TCBUFFER_GEO | ACONTAINS_TCBUFFER_GEO | NAD_TCBUFFER_GEO | EDWITHIN_TCBUFFER_GEO | ADWITHIN_TCBUFFER_GEO | EINTERSECTS_TCBUFFER_CBUFFER | AINTERSECTS_TCBUFFER_CBUFFER | ECOVERS_TCBUFFER_CBUFFER | ACOVERS_TCBUFFER_CBUFFER | EDISJOINT_TCBUFFER_CBUFFER | ADISJOINT_TCBUFFER_CBUFFER | ETOUCHES_TCBUFFER_CBUFFER | ATOUCHES_TCBUFFER_CBUFFER | ECONTAINS_TCBUFFER_CBUFFER | ACONTAINS_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_CBUFFER | ALWAYS_EQ_TCBUFFER_CBUFFER | EVER_NE_TCBUFFER_CBUFFER | ALWAYS_NE_TCBUFFER_CBUFFER | NAD_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_TCBUFFER | ALWAYS_EQ_TCBUFFER_TCBUFFER | EVER_NE_TCBUFFER_TCBUFFER | ALWAYS_NE_TCBUFFER_TCBUFFER | EINTERSECTS_TCBUFFER_TCBUFFER | AINTERSECTS_TCBUFFER_TCBUFFER | ECOVERS_TCBUFFER_TCBUFFER | ACOVERS_TCBUFFER_TCBUFFER | ADISJOINT_TCBUFFER_TCBUFFER | ETOUCHES_TCBUFFER_TCBUFFER | ATOUCHES_TCBUFFER_TCBUFFER | NAD_TCBUFFER_TCBUFFER | EDWITHIN_TCBUFFER_TCBUFFER | ADWITHIN_TCBUFFER_TCBUFFER | MINDISTANCE_TCBUFFER_TCBUFFER | NAD_TNPOINT_GEO | EVER_EQ_TNPOINT_NPOINT | ALWAYS_EQ_TNPOINT_NPOINT | EVER_NE_TNPOINT_NPOINT | ALWAYS_NE_TNPOINT_NPOINT | NAD_TNPOINT_NPOINT | EVER_EQ_NPOINT_TNPOINT | ALWAYS_EQ_NPOINT_TNPOINT | EVER_NE_NPOINT_TNPOINT | ALWAYS_NE_NPOINT_TNPOINT | EVER_EQ_TNPOINT_TNPOINT | ALWAYS_EQ_TNPOINT_TNPOINT | EVER_NE_TNPOINT_TNPOINT | ALWAYS_NE_TNPOINT_TNPOINT | NAD_TNPOINT_TNPOINT | NAD_TPOSE_GEO | EVER_EQ_TPOSE_POSE | ALWAYS_EQ_TPOSE_POSE | EVER_NE_TPOSE_POSE | ALWAYS_NE_TPOSE_POSE | NAD_TPOSE_POSE | EVER_EQ_POSE_TPOSE | ALWAYS_EQ_POSE_TPOSE | EVER_NE_POSE_TPOSE | ALWAYS_NE_POSE_TPOSE | EVER_EQ_TPOSE_TPOSE | ALWAYS_EQ_TPOSE_TPOSE | EVER_NE_TPOSE_TPOSE | ALWAYS_NE_TPOSE_TPOSE | NAD_TPOSE_TPOSE | EVER_EQ_TRGEOMETRY_GEO | ALWAYS_EQ_TRGEOMETRY_GEO | EVER_NE_TRGEOMETRY_GEO | ALWAYS_NE_TRGEOMETRY_GEO | NAD_TRGEOMETRY_GEO | EVER_EQ_GEO_TRGEOMETRY | ALWAYS_EQ_GEO_TRGEOMETRY | EVER_NE_GEO_TRGEOMETRY | ALWAYS_NE_GEO_TRGEOMETRY | EVER_EQ_TRGEOMETRY_TRGEOMETRY | ALWAYS_EQ_TRGEOMETRY_TRGEOMETRY | EVER_NE_TRGEOMETRY_TRGEOMETRY | ALWAYS_NE_TRGEOMETRY_TRGEOMETRY | NAD_TRGEOMETRY_TRGEOMETRY | EINTERSECTS_TPCPOINT_GEO | NAD_TPCPOINT_GEO | QUADBIN_POINT_TO_CELL | QUADBIN_IS_VALID_CELL | QUADBIN_GET_RESOLUTION | QUADBIN_CELL_AREA | QUADBIN_CELL_TO_QUADKEY | QUADBIN_CELL_TO_PARENT | QUADBIN_TILE_TO_CELL | EVER_EQ_TJSONB_JSONB | ALWAYS_EQ_TJSONB_JSONB | EVER_NE_TJSONB_JSONB | ALWAYS_NE_TJSONB_JSONB | EVER_EQ_TJSONB_TJSONB | ALWAYS_EQ_TJSONB_TJSONB | EVER_NE_TJSONB_TJSONB | ALWAYS_NE_TJSONB_TJSONB | GEOM_BOUNDARY | GEOM_CENTROID | GEOM_CONVEX_HULL | GEO_REVERSE | GEO_POINTS | GEOM_UNARY_UNION | GEOM_DIFFERENCE2D | GEOM_INTERSECTION2D | GEOM_SHORTESTLINE2D | GEOM_SHORTESTLINE3D | GEO_SET_SRID | GEO_TRANSFORM | GEO_ROUND | GEOM_BUFFER | LINE_NUMPOINTS | LINE_LOCATE_POINT | LINE_INTERPOLATE_POINT | LINE_SUBSTRING | GEOM_POINT_MAKE2D | GEOM_POINT_MAKE3DZ | GEOG_POINT_MAKE2D | GEOG_POINT_MAKE3DZ | GEOM_TO_GEOG | GEOG_TO_GEOM | GEOG_CENTROID | GEO_GEO_N | LINE_POINT_N | GEOM_INTERSECTION2D_COLL | GEOM_INTERSECTS2D | GEOM_DWITHIN2D | GEOM_CONTAINS | GEOM_DISJOINT2D | GEOM_COVERS | GEOM_TOUCHES | GEOM_INTERSECTS3D | GEOM_DWITHIN3D | GEOM_DISTANCE2D | GEOM_DISTANCE3D; +functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT | TGE_TTEXT_TEXT | TGE_TEXT_TTEXT | TGT_TTEXT_TEXT | TGT_TEXT_TTEXT | TLE_TTEXT_TEXT | TLE_TEXT_TTEXT | TLT_TTEXT_TEXT | TLT_TEXT_TTEXT | TTEXT_UPPER | TTEXT_LOWER | TTEXT_INITCAP | TEXTCAT_TTEXT_TEXT | TEXTCAT_TEXT_TTEXT | TEXTCAT_TTEXT_TTEXT | GEOM_LENGTH | GEOM_PERIMETER | GEOM_AZIMUTH | GEOG_AREA | GEOG_LENGTH | GEOG_PERIMETER | GEOM_IS_EMPTY | AINTERSECTS_TGEO_GEO | ACOVERS_TGEO_GEO | ADISJOINT_TGEO_GEO | ADWITHIN_TGEO_GEO | EINTERSECTS_TGEO_GEO | ETOUCHES_TGEO_GEO | ECONTAINS_TGEO_GEO | ACONTAINS_TGEO_GEO | ATOUCHES_TGEO_GEO | GEO_NUM_POINTS | GEO_NUM_GEOS | GEO_SRID | GEO_IS_UNITARY | GEO_EQUALS | GEO_SAME | GEOG_DISTANCE | NAD_TGEO_GEO | EVER_EQ_TGEO_GEO | EVER_NE_TGEO_GEO | ALWAYS_EQ_TGEO_GEO | ALWAYS_NE_TGEO_GEO | GEOG_INTERSECTS | GEOG_DWITHIN | ACOVERS_GEO_TGEO | GEOM_INTERSECTS | GEOM_DWITHIN | H3_GS_POINT_TO_CELL | EVER_EQ_TH3INDEX_H3INDEX | EVER_NE_TH3INDEX_H3INDEX | ALWAYS_EQ_TH3INDEX_H3INDEX | ALWAYS_NE_TH3INDEX_H3INDEX | TH3INDEX_GET_RESOLUTION | TH3INDEX_GET_BASE_CELL_NUMBER | TH3INDEX_IS_VALID_CELL | TH3INDEX_IS_PENTAGON | TH3INDEX_CELL_TO_PARENT_NEXT | TH3INDEX_CELL_TO_CENTER_CHILD_NEXT | TH3INDEX_CELL_TO_PARENT | TH3INDEX_CELL_TO_CENTER_CHILD | TH3INDEX_CELL_TO_CHILD_POS | TH3INDEX_ARE_NEIGHBOR_CELLS | TH3INDEX_GRID_DISTANCE | EINTERSECTS_TCBUFFER_GEO | AINTERSECTS_TCBUFFER_GEO | ECOVERS_TCBUFFER_GEO | ACOVERS_TCBUFFER_GEO | EDISJOINT_TCBUFFER_GEO | ADISJOINT_TCBUFFER_GEO | ETOUCHES_TCBUFFER_GEO | ATOUCHES_TCBUFFER_GEO | ECONTAINS_TCBUFFER_GEO | ACONTAINS_TCBUFFER_GEO | NAD_TCBUFFER_GEO | EDWITHIN_TCBUFFER_GEO | ADWITHIN_TCBUFFER_GEO | EINTERSECTS_TCBUFFER_CBUFFER | AINTERSECTS_TCBUFFER_CBUFFER | ECOVERS_TCBUFFER_CBUFFER | ACOVERS_TCBUFFER_CBUFFER | EDISJOINT_TCBUFFER_CBUFFER | ADISJOINT_TCBUFFER_CBUFFER | ETOUCHES_TCBUFFER_CBUFFER | ATOUCHES_TCBUFFER_CBUFFER | ECONTAINS_TCBUFFER_CBUFFER | ACONTAINS_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_CBUFFER | ALWAYS_EQ_TCBUFFER_CBUFFER | EVER_NE_TCBUFFER_CBUFFER | ALWAYS_NE_TCBUFFER_CBUFFER | NAD_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_TCBUFFER | ALWAYS_EQ_TCBUFFER_TCBUFFER | EVER_NE_TCBUFFER_TCBUFFER | ALWAYS_NE_TCBUFFER_TCBUFFER | EINTERSECTS_TCBUFFER_TCBUFFER | AINTERSECTS_TCBUFFER_TCBUFFER | ECOVERS_TCBUFFER_TCBUFFER | ACOVERS_TCBUFFER_TCBUFFER | ADISJOINT_TCBUFFER_TCBUFFER | ETOUCHES_TCBUFFER_TCBUFFER | ATOUCHES_TCBUFFER_TCBUFFER | NAD_TCBUFFER_TCBUFFER | EDWITHIN_TCBUFFER_TCBUFFER | ADWITHIN_TCBUFFER_TCBUFFER | MINDISTANCE_TCBUFFER_TCBUFFER | NAD_TNPOINT_GEO | EVER_EQ_TNPOINT_NPOINT | ALWAYS_EQ_TNPOINT_NPOINT | EVER_NE_TNPOINT_NPOINT | ALWAYS_NE_TNPOINT_NPOINT | NAD_TNPOINT_NPOINT | EVER_EQ_NPOINT_TNPOINT | ALWAYS_EQ_NPOINT_TNPOINT | EVER_NE_NPOINT_TNPOINT | ALWAYS_NE_NPOINT_TNPOINT | EVER_EQ_TNPOINT_TNPOINT | ALWAYS_EQ_TNPOINT_TNPOINT | EVER_NE_TNPOINT_TNPOINT | ALWAYS_NE_TNPOINT_TNPOINT | NAD_TNPOINT_TNPOINT | NAD_TPOSE_GEO | EVER_EQ_TPOSE_POSE | ALWAYS_EQ_TPOSE_POSE | EVER_NE_TPOSE_POSE | ALWAYS_NE_TPOSE_POSE | NAD_TPOSE_POSE | EVER_EQ_POSE_TPOSE | ALWAYS_EQ_POSE_TPOSE | EVER_NE_POSE_TPOSE | ALWAYS_NE_POSE_TPOSE | EVER_EQ_TPOSE_TPOSE | ALWAYS_EQ_TPOSE_TPOSE | EVER_NE_TPOSE_TPOSE | ALWAYS_NE_TPOSE_TPOSE | NAD_TPOSE_TPOSE | EVER_EQ_TRGEOMETRY_GEO | ALWAYS_EQ_TRGEOMETRY_GEO | EVER_NE_TRGEOMETRY_GEO | ALWAYS_NE_TRGEOMETRY_GEO | NAD_TRGEOMETRY_GEO | EVER_EQ_GEO_TRGEOMETRY | ALWAYS_EQ_GEO_TRGEOMETRY | EVER_NE_GEO_TRGEOMETRY | ALWAYS_NE_GEO_TRGEOMETRY | EVER_EQ_TRGEOMETRY_TRGEOMETRY | ALWAYS_EQ_TRGEOMETRY_TRGEOMETRY | EVER_NE_TRGEOMETRY_TRGEOMETRY | ALWAYS_NE_TRGEOMETRY_TRGEOMETRY | NAD_TRGEOMETRY_TRGEOMETRY | EINTERSECTS_TPCPOINT_GEO | NAD_TPCPOINT_GEO | QUADBIN_POINT_TO_CELL | QUADBIN_IS_VALID_CELL | QUADBIN_GET_RESOLUTION | QUADBIN_CELL_AREA | QUADBIN_CELL_TO_QUADKEY | QUADBIN_CELL_TO_PARENT | QUADBIN_TILE_TO_CELL | EVER_EQ_TJSONB_JSONB | ALWAYS_EQ_TJSONB_JSONB | EVER_NE_TJSONB_JSONB | ALWAYS_NE_TJSONB_JSONB | EVER_EQ_TJSONB_TJSONB | ALWAYS_EQ_TJSONB_TJSONB | EVER_NE_TJSONB_TJSONB | ALWAYS_NE_TJSONB_TJSONB | GEOM_BOUNDARY | GEOM_CENTROID | GEOM_CONVEX_HULL | GEO_REVERSE | GEO_POINTS | GEOM_UNARY_UNION | GEOM_DIFFERENCE2D | GEOM_INTERSECTION2D | GEOM_SHORTESTLINE2D | GEOM_SHORTESTLINE3D | GEO_SET_SRID | GEO_TRANSFORM | GEO_ROUND | GEOM_BUFFER | LINE_NUMPOINTS | LINE_LOCATE_POINT | LINE_INTERPOLATE_POINT | LINE_SUBSTRING | GEOM_POINT_MAKE2D | GEOM_POINT_MAKE3DZ | GEOG_POINT_MAKE2D | GEOG_POINT_MAKE3DZ | GEOM_TO_GEOG | GEOG_TO_GEOM | GEOG_CENTROID | GEO_GEO_N | LINE_POINT_N | GEOM_INTERSECTION2D_COLL | GEO_AS_GEOJSON | GEO_AS_HEXEWKB | GEO_AS_EWKT | GEO_FROM_GEOJSON | GEOM_FROM_HEXEWKB | GEO_TRANSFORM_PIPELINE | GEOM_MIN_BOUNDING_CENTER | GEOM_MIN_BOUNDING_RADIUS | GEOM_INTERSECTS2D | GEOM_DWITHIN2D | GEOM_CONTAINS | GEOM_DISJOINT2D | GEOM_COVERS | GEOM_TOUCHES | GEOM_INTERSECTS3D | GEOM_DWITHIN3D | GEOM_DISTANCE2D | GEOM_DISTANCE3D; sinkClause: INTO sink (',' sink)*; @@ -939,6 +939,14 @@ GEOG_CENTROID: 'GEOG_CENTROID' | 'geog_centroid'; GEO_GEO_N: 'GEO_GEO_N' | 'geo_geo_n'; LINE_POINT_N: 'LINE_POINT_N' | 'line_point_n'; GEOM_INTERSECTION2D_COLL: 'GEOM_INTERSECTION2D_COLL' | 'geom_intersection2d_coll'; +GEO_AS_GEOJSON: 'GEO_AS_GEOJSON' | 'geo_as_geojson'; +GEO_AS_HEXEWKB: 'GEO_AS_HEXEWKB' | 'geo_as_hexewkb'; +GEO_AS_EWKT: 'GEO_AS_EWKT' | 'geo_as_ewkt'; +GEO_FROM_GEOJSON: 'GEO_FROM_GEOJSON' | 'geo_from_geojson'; +GEOM_FROM_HEXEWKB: 'GEOM_FROM_HEXEWKB' | 'geom_from_hexewkb'; +GEO_TRANSFORM_PIPELINE: 'GEO_TRANSFORM_PIPELINE' | 'geo_transform_pipeline'; +GEOM_MIN_BOUNDING_CENTER: 'GEOM_MIN_BOUNDING_CENTER' | 'geom_min_bounding_radius'; +GEOM_MIN_BOUNDING_RADIUS: 'GEOM_MIN_BOUNDING_RADIUS' | 'geom_min_bounding_radius'; GEOM_INTERSECTS2D: 'GEOM_INTERSECTS2D' | 'geom_intersects2d'; GEOM_DWITHIN2D: 'GEOM_DWITHIN2D' | 'geom_dwithin2d'; GEOM_CONTAINS: 'GEOM_CONTAINS' | 'geom_contains'; diff --git a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp index 9ffd21c82b..62505d9aa6 100644 --- a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp +++ b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp @@ -520,6 +520,14 @@ #include #include #include +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include @@ -11038,6 +11046,77 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont return LogicalFunction(GeomIntersection2dCollLogicalFunction(std::move(arg0), std::move(arg1))); } /* END CODEGEN PARSER GLUE: GEOM_INTERSECTION2D_COLL */ + case AntlrSQLParser::GEO_AS_GEOJSON: { + PRECONDITION(ctx->functionParam().size() == 3, + "GeoAsGeojson requires 3 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + return LogicalFunction(GeoAsGeojsonLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2))); + } + /* END CODEGEN PARSER GLUE: GEO_AS_GEOJSON */ + case AntlrSQLParser::GEO_AS_HEXEWKB: { + PRECONDITION(ctx->functionParam().size() == 2, + "GeoAsHexewkb requires 2 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + return LogicalFunction(GeoAsHexewkbLogicalFunction(std::move(arg0), std::move(arg1))); + } + /* END CODEGEN PARSER GLUE: GEO_AS_HEXEWKB */ + case AntlrSQLParser::GEO_AS_EWKT: { + PRECONDITION(ctx->functionParam().size() == 2, + "GeoAsEwkt requires 2 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + return LogicalFunction(GeoAsEwktLogicalFunction(std::move(arg0), std::move(arg1))); + } + /* END CODEGEN PARSER GLUE: GEO_AS_EWKT */ + case AntlrSQLParser::GEO_FROM_GEOJSON: { + PRECONDITION(ctx->functionParam().size() == 1, + "GeoFromGeojson requires 1 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + return LogicalFunction(GeoFromGeojsonLogicalFunction(std::move(arg0))); + } + /* END CODEGEN PARSER GLUE: GEO_FROM_GEOJSON */ + case AntlrSQLParser::GEOM_FROM_HEXEWKB: { + PRECONDITION(ctx->functionParam().size() == 1, + "GeomFromHexewkb requires 1 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + return LogicalFunction(GeomFromHexewkbLogicalFunction(std::move(arg0))); + } + /* END CODEGEN PARSER GLUE: GEOM_FROM_HEXEWKB */ + case AntlrSQLParser::GEO_TRANSFORM_PIPELINE: { + PRECONDITION(ctx->functionParam().size() == 4, + "GeoTransformPipeline requires 4 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + return LogicalFunction(GeoTransformPipelineLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3))); + } + /* END CODEGEN PARSER GLUE: GEO_TRANSFORM_PIPELINE */ + case AntlrSQLParser::GEOM_MIN_BOUNDING_CENTER: { + PRECONDITION(ctx->functionParam().size() == 1, + "GeomMinBoundingCenter requires 1 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + return LogicalFunction(GeomMinBoundingCenterLogicalFunction(std::move(arg0))); + } + /* END CODEGEN PARSER GLUE: GEOM_MIN_BOUNDING_CENTER */ + case AntlrSQLParser::GEOM_MIN_BOUNDING_RADIUS: { + PRECONDITION(ctx->functionParam().size() == 1, + "GeomMinBoundingRadius requires 1 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + return LogicalFunction(GeomMinBoundingRadiusLogicalFunction(std::move(arg0))); + } + /* END CODEGEN PARSER GLUE: GEOM_MIN_BOUNDING_RADIUS */ /* END CODEGEN PARSER GLUE: GEOM_INTERSECTS2D */ case AntlrSQLParser::GEOM_DWITHIN2D: { PRECONDITION(ctx->functionParam().size() == 3, From e10e592722aac475f40248700ff9ae941e5ff37e Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Tue, 16 Jun 2026 06:14:49 +0200 Subject: [PATCH 83/96] feat(meos): add GEOM_RELATE_PATTERN DE-9IM relation NES operator (W135) 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. --- .../Meos/GeomRelatePatternLogicalFunction.hpp | 48 +++++++++ .../src/Functions/Meos/CMakeLists.txt | 1 + .../Meos/GeomRelatePatternLogicalFunction.cpp | 102 ++++++++++++++++++ .../GeomRelatePatternPhysicalFunction.hpp | 32 ++++++ .../src/Functions/Meos/CMakeLists.txt | 1 + .../GeomRelatePatternPhysicalFunction.cpp | 79 ++++++++++++++ nes-sql-parser/AntlrSQL.g4 | 3 +- .../src/AntlrSQLQueryPlanCreator.cpp | 11 ++ 8 files changed, 276 insertions(+), 1 deletion(-) create mode 100644 nes-logical-operators/include/Functions/Meos/GeomRelatePatternLogicalFunction.hpp create mode 100644 nes-logical-operators/src/Functions/Meos/GeomRelatePatternLogicalFunction.cpp create mode 100644 nes-physical-operators/include/Functions/Meos/GeomRelatePatternPhysicalFunction.hpp create mode 100644 nes-physical-operators/src/Functions/Meos/GeomRelatePatternPhysicalFunction.cpp diff --git a/nes-logical-operators/include/Functions/Meos/GeomRelatePatternLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeomRelatePatternLogicalFunction.hpp new file mode 100644 index 0000000000..3afcb1dfba --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/GeomRelatePatternLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Tests whether two geometries satisfy a DE-9IM relation pattern, returning 1.0 if true. + */ +class GeomRelatePatternLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "GeomRelatePattern"; + + GeomRelatePatternLogicalFunction(LogicalFunction wkt1, LogicalFunction wkt2, LogicalFunction pattern); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt index 0c6e53dade..588f0630dd 100644 --- a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt @@ -477,6 +477,7 @@ add_plugin(GeomFromHexewkb LogicalFunction nes-logical-operators GeomFromHexewkb add_plugin(GeoTransformPipeline LogicalFunction nes-logical-operators GeoTransformPipelineLogicalFunction.cpp) add_plugin(GeomMinBoundingCenter LogicalFunction nes-logical-operators GeomMinBoundingCenterLogicalFunction.cpp) add_plugin(GeomMinBoundingRadius LogicalFunction nes-logical-operators GeomMinBoundingRadiusLogicalFunction.cpp) +add_plugin(GeomRelatePattern LogicalFunction nes-logical-operators GeomRelatePatternLogicalFunction.cpp) add_plugin(GeomIntersects2d LogicalFunction nes-logical-operators GeomIntersects2dLogicalFunction.cpp) add_plugin(GeomDwithin2d LogicalFunction nes-logical-operators GeomDwithin2dLogicalFunction.cpp) add_plugin(GeomContains LogicalFunction nes-logical-operators GeomContainsLogicalFunction.cpp) diff --git a/nes-logical-operators/src/Functions/Meos/GeomRelatePatternLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeomRelatePatternLogicalFunction.cpp new file mode 100644 index 0000000000..dc3a27a7e8 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/GeomRelatePatternLogicalFunction.cpp @@ -0,0 +1,102 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +GeomRelatePatternLogicalFunction::GeomRelatePatternLogicalFunction(LogicalFunction wkt1, LogicalFunction wkt2, LogicalFunction pattern) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(wkt1)); + parameters.push_back(std::move(wkt2)); + parameters.push_back(std::move(pattern)); +} + +DataType GeomRelatePatternLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction GeomRelatePatternLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector GeomRelatePatternLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction GeomRelatePatternLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, + "GeomRelatePatternLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view GeomRelatePatternLogicalFunction::getType() const { return NAME; } + +bool GeomRelatePatternLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string GeomRelatePatternLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction GeomRelatePatternLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(3); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "wkt1 must be VARSIZED"); + INVARIANT(c[1].getDataType().isType(DataType::Type::VARSIZED), "wkt2 must be VARSIZED"); + INVARIANT(c[2].getDataType().isType(DataType::Type::VARSIZED), "pattern must be VARSIZED"); + return withChildren(c); +} + +SerializableFunction GeomRelatePatternLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeomRelatePatternLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "GeomRelatePatternLogicalFunction requires 3 children but got {}", + arguments.children.size()); + return GeomRelatePatternLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2])); +} + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeomRelatePatternPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeomRelatePatternPhysicalFunction.hpp new file mode 100644 index 0000000000..30b22f25a2 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/GeomRelatePatternPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class GeomRelatePatternPhysicalFunction : public PhysicalFunctionConcept { +public: + GeomRelatePatternPhysicalFunction(PhysicalFunction wkt1, PhysicalFunction wkt2, PhysicalFunction pattern); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt index efab7778ab..9b98275811 100644 --- a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt @@ -476,6 +476,7 @@ add_plugin(GeomFromHexewkb PhysicalFunction nes-physical-operators GeomFromHexew add_plugin(GeoTransformPipeline PhysicalFunction nes-physical-operators GeoTransformPipelinePhysicalFunction.cpp) add_plugin(GeomMinBoundingCenter PhysicalFunction nes-physical-operators GeomMinBoundingCenterPhysicalFunction.cpp) add_plugin(GeomMinBoundingRadius PhysicalFunction nes-physical-operators GeomMinBoundingRadiusPhysicalFunction.cpp) +add_plugin(GeomRelatePattern PhysicalFunction nes-physical-operators GeomRelatePatternPhysicalFunction.cpp) add_plugin(GeomIntersects2d PhysicalFunction nes-physical-operators GeomIntersects2dPhysicalFunction.cpp) add_plugin(GeomDwithin2d PhysicalFunction nes-physical-operators GeomDwithin2dPhysicalFunction.cpp) add_plugin(GeomContains PhysicalFunction nes-physical-operators GeomContainsPhysicalFunction.cpp) diff --git a/nes-physical-operators/src/Functions/Meos/GeomRelatePatternPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeomRelatePatternPhysicalFunction.cpp new file mode 100644 index 0000000000..0a78fe9028 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/GeomRelatePatternPhysicalFunction.cpp @@ -0,0 +1,79 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +GeomRelatePatternPhysicalFunction::GeomRelatePatternPhysicalFunction(PhysicalFunction wkt1, PhysicalFunction wkt2, PhysicalFunction pattern) +{ + paramFns.reserve(3); + paramFns.push_back(std::move(wkt1)); + paramFns.push_back(std::move(wkt2)); + paramFns.push_back(std::move(pattern)); +} + +VarVal GeomRelatePatternPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto wkt1 = paramFns[0].execute(record, arena).cast(); + auto wkt2 = paramFns[1].execute(record, arena).cast(); + auto pattern = paramFns[2].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](const char* w1, uint32_t w1sz, const char* w2, uint32_t w2sz, const char* p, uint32_t psz) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string s1(w1, w1sz), s2(w2, w2sz), sp(p, psz); + GSERIALIZED* gs1 = geom_in(s1.c_str(), -1); + if (!gs1) return 0.0; + GSERIALIZED* gs2 = geom_in(s2.c_str(), -1); + if (!gs2) { free(gs1); return 0.0; } + bool r = geom_relate_pattern(gs1, gs2, const_cast(sp.c_str())); + free(gs1); free(gs2); + return r ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + wkt1, wkt2, pattern); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterGeomRelatePatternPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "GeomRelatePatternPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + return GeomRelatePatternPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2])); +} + +} // namespace NES diff --git a/nes-sql-parser/AntlrSQL.g4 b/nes-sql-parser/AntlrSQL.g4 index fea595b6ba..a85c3c142b 100644 --- a/nes-sql-parser/AntlrSQL.g4 +++ b/nes-sql-parser/AntlrSQL.g4 @@ -295,7 +295,7 @@ timeUnit: MS timestampParameter: name=identifier; -functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT | TGE_TTEXT_TEXT | TGE_TEXT_TTEXT | TGT_TTEXT_TEXT | TGT_TEXT_TTEXT | TLE_TTEXT_TEXT | TLE_TEXT_TTEXT | TLT_TTEXT_TEXT | TLT_TEXT_TTEXT | TTEXT_UPPER | TTEXT_LOWER | TTEXT_INITCAP | TEXTCAT_TTEXT_TEXT | TEXTCAT_TEXT_TTEXT | TEXTCAT_TTEXT_TTEXT | GEOM_LENGTH | GEOM_PERIMETER | GEOM_AZIMUTH | GEOG_AREA | GEOG_LENGTH | GEOG_PERIMETER | GEOM_IS_EMPTY | AINTERSECTS_TGEO_GEO | ACOVERS_TGEO_GEO | ADISJOINT_TGEO_GEO | ADWITHIN_TGEO_GEO | EINTERSECTS_TGEO_GEO | ETOUCHES_TGEO_GEO | ECONTAINS_TGEO_GEO | ACONTAINS_TGEO_GEO | ATOUCHES_TGEO_GEO | GEO_NUM_POINTS | GEO_NUM_GEOS | GEO_SRID | GEO_IS_UNITARY | GEO_EQUALS | GEO_SAME | GEOG_DISTANCE | NAD_TGEO_GEO | EVER_EQ_TGEO_GEO | EVER_NE_TGEO_GEO | ALWAYS_EQ_TGEO_GEO | ALWAYS_NE_TGEO_GEO | GEOG_INTERSECTS | GEOG_DWITHIN | ACOVERS_GEO_TGEO | GEOM_INTERSECTS | GEOM_DWITHIN | H3_GS_POINT_TO_CELL | EVER_EQ_TH3INDEX_H3INDEX | EVER_NE_TH3INDEX_H3INDEX | ALWAYS_EQ_TH3INDEX_H3INDEX | ALWAYS_NE_TH3INDEX_H3INDEX | TH3INDEX_GET_RESOLUTION | TH3INDEX_GET_BASE_CELL_NUMBER | TH3INDEX_IS_VALID_CELL | TH3INDEX_IS_PENTAGON | TH3INDEX_CELL_TO_PARENT_NEXT | TH3INDEX_CELL_TO_CENTER_CHILD_NEXT | TH3INDEX_CELL_TO_PARENT | TH3INDEX_CELL_TO_CENTER_CHILD | TH3INDEX_CELL_TO_CHILD_POS | TH3INDEX_ARE_NEIGHBOR_CELLS | TH3INDEX_GRID_DISTANCE | EINTERSECTS_TCBUFFER_GEO | AINTERSECTS_TCBUFFER_GEO | ECOVERS_TCBUFFER_GEO | ACOVERS_TCBUFFER_GEO | EDISJOINT_TCBUFFER_GEO | ADISJOINT_TCBUFFER_GEO | ETOUCHES_TCBUFFER_GEO | ATOUCHES_TCBUFFER_GEO | ECONTAINS_TCBUFFER_GEO | ACONTAINS_TCBUFFER_GEO | NAD_TCBUFFER_GEO | EDWITHIN_TCBUFFER_GEO | ADWITHIN_TCBUFFER_GEO | EINTERSECTS_TCBUFFER_CBUFFER | AINTERSECTS_TCBUFFER_CBUFFER | ECOVERS_TCBUFFER_CBUFFER | ACOVERS_TCBUFFER_CBUFFER | EDISJOINT_TCBUFFER_CBUFFER | ADISJOINT_TCBUFFER_CBUFFER | ETOUCHES_TCBUFFER_CBUFFER | ATOUCHES_TCBUFFER_CBUFFER | ECONTAINS_TCBUFFER_CBUFFER | ACONTAINS_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_CBUFFER | ALWAYS_EQ_TCBUFFER_CBUFFER | EVER_NE_TCBUFFER_CBUFFER | ALWAYS_NE_TCBUFFER_CBUFFER | NAD_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_TCBUFFER | ALWAYS_EQ_TCBUFFER_TCBUFFER | EVER_NE_TCBUFFER_TCBUFFER | ALWAYS_NE_TCBUFFER_TCBUFFER | EINTERSECTS_TCBUFFER_TCBUFFER | AINTERSECTS_TCBUFFER_TCBUFFER | ECOVERS_TCBUFFER_TCBUFFER | ACOVERS_TCBUFFER_TCBUFFER | ADISJOINT_TCBUFFER_TCBUFFER | ETOUCHES_TCBUFFER_TCBUFFER | ATOUCHES_TCBUFFER_TCBUFFER | NAD_TCBUFFER_TCBUFFER | EDWITHIN_TCBUFFER_TCBUFFER | ADWITHIN_TCBUFFER_TCBUFFER | MINDISTANCE_TCBUFFER_TCBUFFER | NAD_TNPOINT_GEO | EVER_EQ_TNPOINT_NPOINT | ALWAYS_EQ_TNPOINT_NPOINT | EVER_NE_TNPOINT_NPOINT | ALWAYS_NE_TNPOINT_NPOINT | NAD_TNPOINT_NPOINT | EVER_EQ_NPOINT_TNPOINT | ALWAYS_EQ_NPOINT_TNPOINT | EVER_NE_NPOINT_TNPOINT | ALWAYS_NE_NPOINT_TNPOINT | EVER_EQ_TNPOINT_TNPOINT | ALWAYS_EQ_TNPOINT_TNPOINT | EVER_NE_TNPOINT_TNPOINT | ALWAYS_NE_TNPOINT_TNPOINT | NAD_TNPOINT_TNPOINT | NAD_TPOSE_GEO | EVER_EQ_TPOSE_POSE | ALWAYS_EQ_TPOSE_POSE | EVER_NE_TPOSE_POSE | ALWAYS_NE_TPOSE_POSE | NAD_TPOSE_POSE | EVER_EQ_POSE_TPOSE | ALWAYS_EQ_POSE_TPOSE | EVER_NE_POSE_TPOSE | ALWAYS_NE_POSE_TPOSE | EVER_EQ_TPOSE_TPOSE | ALWAYS_EQ_TPOSE_TPOSE | EVER_NE_TPOSE_TPOSE | ALWAYS_NE_TPOSE_TPOSE | NAD_TPOSE_TPOSE | EVER_EQ_TRGEOMETRY_GEO | ALWAYS_EQ_TRGEOMETRY_GEO | EVER_NE_TRGEOMETRY_GEO | ALWAYS_NE_TRGEOMETRY_GEO | NAD_TRGEOMETRY_GEO | EVER_EQ_GEO_TRGEOMETRY | ALWAYS_EQ_GEO_TRGEOMETRY | EVER_NE_GEO_TRGEOMETRY | ALWAYS_NE_GEO_TRGEOMETRY | EVER_EQ_TRGEOMETRY_TRGEOMETRY | ALWAYS_EQ_TRGEOMETRY_TRGEOMETRY | EVER_NE_TRGEOMETRY_TRGEOMETRY | ALWAYS_NE_TRGEOMETRY_TRGEOMETRY | NAD_TRGEOMETRY_TRGEOMETRY | EINTERSECTS_TPCPOINT_GEO | NAD_TPCPOINT_GEO | QUADBIN_POINT_TO_CELL | QUADBIN_IS_VALID_CELL | QUADBIN_GET_RESOLUTION | QUADBIN_CELL_AREA | QUADBIN_CELL_TO_QUADKEY | QUADBIN_CELL_TO_PARENT | QUADBIN_TILE_TO_CELL | EVER_EQ_TJSONB_JSONB | ALWAYS_EQ_TJSONB_JSONB | EVER_NE_TJSONB_JSONB | ALWAYS_NE_TJSONB_JSONB | EVER_EQ_TJSONB_TJSONB | ALWAYS_EQ_TJSONB_TJSONB | EVER_NE_TJSONB_TJSONB | ALWAYS_NE_TJSONB_TJSONB | GEOM_BOUNDARY | GEOM_CENTROID | GEOM_CONVEX_HULL | GEO_REVERSE | GEO_POINTS | GEOM_UNARY_UNION | GEOM_DIFFERENCE2D | GEOM_INTERSECTION2D | GEOM_SHORTESTLINE2D | GEOM_SHORTESTLINE3D | GEO_SET_SRID | GEO_TRANSFORM | GEO_ROUND | GEOM_BUFFER | LINE_NUMPOINTS | LINE_LOCATE_POINT | LINE_INTERPOLATE_POINT | LINE_SUBSTRING | GEOM_POINT_MAKE2D | GEOM_POINT_MAKE3DZ | GEOG_POINT_MAKE2D | GEOG_POINT_MAKE3DZ | GEOM_TO_GEOG | GEOG_TO_GEOM | GEOG_CENTROID | GEO_GEO_N | LINE_POINT_N | GEOM_INTERSECTION2D_COLL | GEO_AS_GEOJSON | GEO_AS_HEXEWKB | GEO_AS_EWKT | GEO_FROM_GEOJSON | GEOM_FROM_HEXEWKB | GEO_TRANSFORM_PIPELINE | GEOM_MIN_BOUNDING_CENTER | GEOM_MIN_BOUNDING_RADIUS | GEOM_INTERSECTS2D | GEOM_DWITHIN2D | GEOM_CONTAINS | GEOM_DISJOINT2D | GEOM_COVERS | GEOM_TOUCHES | GEOM_INTERSECTS3D | GEOM_DWITHIN3D | GEOM_DISTANCE2D | GEOM_DISTANCE3D; +functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT | TGE_TTEXT_TEXT | TGE_TEXT_TTEXT | TGT_TTEXT_TEXT | TGT_TEXT_TTEXT | TLE_TTEXT_TEXT | TLE_TEXT_TTEXT | TLT_TTEXT_TEXT | TLT_TEXT_TTEXT | TTEXT_UPPER | TTEXT_LOWER | TTEXT_INITCAP | TEXTCAT_TTEXT_TEXT | TEXTCAT_TEXT_TTEXT | TEXTCAT_TTEXT_TTEXT | GEOM_LENGTH | GEOM_PERIMETER | GEOM_AZIMUTH | GEOG_AREA | GEOG_LENGTH | GEOG_PERIMETER | GEOM_IS_EMPTY | AINTERSECTS_TGEO_GEO | ACOVERS_TGEO_GEO | ADISJOINT_TGEO_GEO | ADWITHIN_TGEO_GEO | EINTERSECTS_TGEO_GEO | ETOUCHES_TGEO_GEO | ECONTAINS_TGEO_GEO | ACONTAINS_TGEO_GEO | ATOUCHES_TGEO_GEO | GEO_NUM_POINTS | GEO_NUM_GEOS | GEO_SRID | GEO_IS_UNITARY | GEO_EQUALS | GEO_SAME | GEOG_DISTANCE | NAD_TGEO_GEO | EVER_EQ_TGEO_GEO | EVER_NE_TGEO_GEO | ALWAYS_EQ_TGEO_GEO | ALWAYS_NE_TGEO_GEO | GEOG_INTERSECTS | GEOG_DWITHIN | ACOVERS_GEO_TGEO | GEOM_INTERSECTS | GEOM_DWITHIN | H3_GS_POINT_TO_CELL | EVER_EQ_TH3INDEX_H3INDEX | EVER_NE_TH3INDEX_H3INDEX | ALWAYS_EQ_TH3INDEX_H3INDEX | ALWAYS_NE_TH3INDEX_H3INDEX | TH3INDEX_GET_RESOLUTION | TH3INDEX_GET_BASE_CELL_NUMBER | TH3INDEX_IS_VALID_CELL | TH3INDEX_IS_PENTAGON | TH3INDEX_CELL_TO_PARENT_NEXT | TH3INDEX_CELL_TO_CENTER_CHILD_NEXT | TH3INDEX_CELL_TO_PARENT | TH3INDEX_CELL_TO_CENTER_CHILD | TH3INDEX_CELL_TO_CHILD_POS | TH3INDEX_ARE_NEIGHBOR_CELLS | TH3INDEX_GRID_DISTANCE | EINTERSECTS_TCBUFFER_GEO | AINTERSECTS_TCBUFFER_GEO | ECOVERS_TCBUFFER_GEO | ACOVERS_TCBUFFER_GEO | EDISJOINT_TCBUFFER_GEO | ADISJOINT_TCBUFFER_GEO | ETOUCHES_TCBUFFER_GEO | ATOUCHES_TCBUFFER_GEO | ECONTAINS_TCBUFFER_GEO | ACONTAINS_TCBUFFER_GEO | NAD_TCBUFFER_GEO | EDWITHIN_TCBUFFER_GEO | ADWITHIN_TCBUFFER_GEO | EINTERSECTS_TCBUFFER_CBUFFER | AINTERSECTS_TCBUFFER_CBUFFER | ECOVERS_TCBUFFER_CBUFFER | ACOVERS_TCBUFFER_CBUFFER | EDISJOINT_TCBUFFER_CBUFFER | ADISJOINT_TCBUFFER_CBUFFER | ETOUCHES_TCBUFFER_CBUFFER | ATOUCHES_TCBUFFER_CBUFFER | ECONTAINS_TCBUFFER_CBUFFER | ACONTAINS_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_CBUFFER | ALWAYS_EQ_TCBUFFER_CBUFFER | EVER_NE_TCBUFFER_CBUFFER | ALWAYS_NE_TCBUFFER_CBUFFER | NAD_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_TCBUFFER | ALWAYS_EQ_TCBUFFER_TCBUFFER | EVER_NE_TCBUFFER_TCBUFFER | ALWAYS_NE_TCBUFFER_TCBUFFER | EINTERSECTS_TCBUFFER_TCBUFFER | AINTERSECTS_TCBUFFER_TCBUFFER | ECOVERS_TCBUFFER_TCBUFFER | ACOVERS_TCBUFFER_TCBUFFER | ADISJOINT_TCBUFFER_TCBUFFER | ETOUCHES_TCBUFFER_TCBUFFER | ATOUCHES_TCBUFFER_TCBUFFER | NAD_TCBUFFER_TCBUFFER | EDWITHIN_TCBUFFER_TCBUFFER | ADWITHIN_TCBUFFER_TCBUFFER | MINDISTANCE_TCBUFFER_TCBUFFER | NAD_TNPOINT_GEO | EVER_EQ_TNPOINT_NPOINT | ALWAYS_EQ_TNPOINT_NPOINT | EVER_NE_TNPOINT_NPOINT | ALWAYS_NE_TNPOINT_NPOINT | NAD_TNPOINT_NPOINT | EVER_EQ_NPOINT_TNPOINT | ALWAYS_EQ_NPOINT_TNPOINT | EVER_NE_NPOINT_TNPOINT | ALWAYS_NE_NPOINT_TNPOINT | EVER_EQ_TNPOINT_TNPOINT | ALWAYS_EQ_TNPOINT_TNPOINT | EVER_NE_TNPOINT_TNPOINT | ALWAYS_NE_TNPOINT_TNPOINT | NAD_TNPOINT_TNPOINT | NAD_TPOSE_GEO | EVER_EQ_TPOSE_POSE | ALWAYS_EQ_TPOSE_POSE | EVER_NE_TPOSE_POSE | ALWAYS_NE_TPOSE_POSE | NAD_TPOSE_POSE | EVER_EQ_POSE_TPOSE | ALWAYS_EQ_POSE_TPOSE | EVER_NE_POSE_TPOSE | ALWAYS_NE_POSE_TPOSE | EVER_EQ_TPOSE_TPOSE | ALWAYS_EQ_TPOSE_TPOSE | EVER_NE_TPOSE_TPOSE | ALWAYS_NE_TPOSE_TPOSE | NAD_TPOSE_TPOSE | EVER_EQ_TRGEOMETRY_GEO | ALWAYS_EQ_TRGEOMETRY_GEO | EVER_NE_TRGEOMETRY_GEO | ALWAYS_NE_TRGEOMETRY_GEO | NAD_TRGEOMETRY_GEO | EVER_EQ_GEO_TRGEOMETRY | ALWAYS_EQ_GEO_TRGEOMETRY | EVER_NE_GEO_TRGEOMETRY | ALWAYS_NE_GEO_TRGEOMETRY | EVER_EQ_TRGEOMETRY_TRGEOMETRY | ALWAYS_EQ_TRGEOMETRY_TRGEOMETRY | EVER_NE_TRGEOMETRY_TRGEOMETRY | ALWAYS_NE_TRGEOMETRY_TRGEOMETRY | NAD_TRGEOMETRY_TRGEOMETRY | EINTERSECTS_TPCPOINT_GEO | NAD_TPCPOINT_GEO | QUADBIN_POINT_TO_CELL | QUADBIN_IS_VALID_CELL | QUADBIN_GET_RESOLUTION | QUADBIN_CELL_AREA | QUADBIN_CELL_TO_QUADKEY | QUADBIN_CELL_TO_PARENT | QUADBIN_TILE_TO_CELL | EVER_EQ_TJSONB_JSONB | ALWAYS_EQ_TJSONB_JSONB | EVER_NE_TJSONB_JSONB | ALWAYS_NE_TJSONB_JSONB | EVER_EQ_TJSONB_TJSONB | ALWAYS_EQ_TJSONB_TJSONB | EVER_NE_TJSONB_TJSONB | ALWAYS_NE_TJSONB_TJSONB | GEOM_BOUNDARY | GEOM_CENTROID | GEOM_CONVEX_HULL | GEO_REVERSE | GEO_POINTS | GEOM_UNARY_UNION | GEOM_DIFFERENCE2D | GEOM_INTERSECTION2D | GEOM_SHORTESTLINE2D | GEOM_SHORTESTLINE3D | GEO_SET_SRID | GEO_TRANSFORM | GEO_ROUND | GEOM_BUFFER | LINE_NUMPOINTS | LINE_LOCATE_POINT | LINE_INTERPOLATE_POINT | LINE_SUBSTRING | GEOM_POINT_MAKE2D | GEOM_POINT_MAKE3DZ | GEOG_POINT_MAKE2D | GEOG_POINT_MAKE3DZ | GEOM_TO_GEOG | GEOG_TO_GEOM | GEOG_CENTROID | GEO_GEO_N | LINE_POINT_N | GEOM_INTERSECTION2D_COLL | GEO_AS_GEOJSON | GEO_AS_HEXEWKB | GEO_AS_EWKT | GEO_FROM_GEOJSON | GEOM_FROM_HEXEWKB | GEO_TRANSFORM_PIPELINE | GEOM_MIN_BOUNDING_CENTER | GEOM_MIN_BOUNDING_RADIUS | GEOM_RELATE_PATTERN | GEOM_INTERSECTS2D | GEOM_DWITHIN2D | GEOM_CONTAINS | GEOM_DISJOINT2D | GEOM_COVERS | GEOM_TOUCHES | GEOM_INTERSECTS3D | GEOM_DWITHIN3D | GEOM_DISTANCE2D | GEOM_DISTANCE3D; sinkClause: INTO sink (',' sink)*; @@ -947,6 +947,7 @@ GEOM_FROM_HEXEWKB: 'GEOM_FROM_HEXEWKB' | 'geom_from_hexewkb'; GEO_TRANSFORM_PIPELINE: 'GEO_TRANSFORM_PIPELINE' | 'geo_transform_pipeline'; GEOM_MIN_BOUNDING_CENTER: 'GEOM_MIN_BOUNDING_CENTER' | 'geom_min_bounding_radius'; GEOM_MIN_BOUNDING_RADIUS: 'GEOM_MIN_BOUNDING_RADIUS' | 'geom_min_bounding_radius'; +GEOM_RELATE_PATTERN: 'GEOM_RELATE_PATTERN' | 'geom_relate_pattern'; GEOM_INTERSECTS2D: 'GEOM_INTERSECTS2D' | 'geom_intersects2d'; GEOM_DWITHIN2D: 'GEOM_DWITHIN2D' | 'geom_dwithin2d'; GEOM_CONTAINS: 'GEOM_CONTAINS' | 'geom_contains'; diff --git a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp index 62505d9aa6..119100de50 100644 --- a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp +++ b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp @@ -528,6 +528,7 @@ #include #include #include +#include #include #include #include @@ -11117,6 +11118,16 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont return LogicalFunction(GeomMinBoundingRadiusLogicalFunction(std::move(arg0))); } /* END CODEGEN PARSER GLUE: GEOM_MIN_BOUNDING_RADIUS */ + case AntlrSQLParser::GEOM_RELATE_PATTERN: { + PRECONDITION(ctx->functionParam().size() == 3, + "GeomRelatePattern requires 3 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + return LogicalFunction(GeomRelatePatternLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2))); + } + /* END CODEGEN PARSER GLUE: GEOM_RELATE_PATTERN */ /* END CODEGEN PARSER GLUE: GEOM_INTERSECTS2D */ case AntlrSQLParser::GEOM_DWITHIN2D: { PRECONDITION(ctx->functionParam().size() == 3, From 11aafaba844576e5cc5ff967acee3ce57e92b0e3 Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Tue, 16 Jun 2026 06:21:46 +0200 Subject: [PATCH 84/96] feat(meos): add tgeo_tgeo 6-arg spatial predicate NES operators (W136) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- .../Meos/AcontainsTgeoTgeoLogicalFunction.hpp | 48 +++++ .../Meos/AcoversTgeoTgeoLogicalFunction.hpp | 48 +++++ .../Meos/AdisjointTgeoTgeoLogicalFunction.hpp | 48 +++++ .../AintersectsTgeoTgeoLogicalFunction.hpp | 48 +++++ .../Meos/AlwaysEqTgeoTgeoLogicalFunction.hpp | 48 +++++ .../Meos/AlwaysNeTgeoTgeoLogicalFunction.hpp | 48 +++++ .../Meos/AtouchesTgeoTgeoLogicalFunction.hpp | 48 +++++ .../Meos/EcontainsTgeoTgeoLogicalFunction.hpp | 48 +++++ .../Meos/EcoversTgeoTgeoLogicalFunction.hpp | 48 +++++ .../Meos/EdisjointTgeoTgeoLogicalFunction.hpp | 48 +++++ .../EintersectsTgeoTgeoLogicalFunction.hpp | 48 +++++ .../Meos/EtouchesTgeoTgeoLogicalFunction.hpp | 48 +++++ .../Meos/EverEqTgeoTgeoLogicalFunction.hpp | 48 +++++ .../Meos/EverNeTgeoTgeoLogicalFunction.hpp | 48 +++++ .../Meos/AcontainsTgeoTgeoLogicalFunction.cpp | 111 ++++++++++ .../Meos/AcoversTgeoTgeoLogicalFunction.cpp | 111 ++++++++++ .../Meos/AdisjointTgeoTgeoLogicalFunction.cpp | 111 ++++++++++ .../AintersectsTgeoTgeoLogicalFunction.cpp | 111 ++++++++++ .../Meos/AlwaysEqTgeoTgeoLogicalFunction.cpp | 111 ++++++++++ .../Meos/AlwaysNeTgeoTgeoLogicalFunction.cpp | 111 ++++++++++ .../Meos/AtouchesTgeoTgeoLogicalFunction.cpp | 111 ++++++++++ .../src/Functions/Meos/CMakeLists.txt | 14 ++ .../Meos/EcontainsTgeoTgeoLogicalFunction.cpp | 111 ++++++++++ .../Meos/EcoversTgeoTgeoLogicalFunction.cpp | 111 ++++++++++ .../Meos/EdisjointTgeoTgeoLogicalFunction.cpp | 111 ++++++++++ .../EintersectsTgeoTgeoLogicalFunction.cpp | 111 ++++++++++ .../Meos/EtouchesTgeoTgeoLogicalFunction.cpp | 111 ++++++++++ .../Meos/EverEqTgeoTgeoLogicalFunction.cpp | 111 ++++++++++ .../Meos/EverNeTgeoTgeoLogicalFunction.cpp | 111 ++++++++++ .../AcontainsTgeoTgeoPhysicalFunction.hpp | 32 +++ .../Meos/AcoversTgeoTgeoPhysicalFunction.hpp | 32 +++ .../AdisjointTgeoTgeoPhysicalFunction.hpp | 32 +++ .../AintersectsTgeoTgeoPhysicalFunction.hpp | 32 +++ .../Meos/AlwaysEqTgeoTgeoPhysicalFunction.hpp | 32 +++ .../Meos/AlwaysNeTgeoTgeoPhysicalFunction.hpp | 32 +++ .../Meos/AtouchesTgeoTgeoPhysicalFunction.hpp | 32 +++ .../EcontainsTgeoTgeoPhysicalFunction.hpp | 32 +++ .../Meos/EcoversTgeoTgeoPhysicalFunction.hpp | 32 +++ .../EdisjointTgeoTgeoPhysicalFunction.hpp | 32 +++ .../EintersectsTgeoTgeoPhysicalFunction.hpp | 32 +++ .../Meos/EtouchesTgeoTgeoPhysicalFunction.hpp | 32 +++ .../Meos/EverEqTgeoTgeoPhysicalFunction.hpp | 32 +++ .../Meos/EverNeTgeoTgeoPhysicalFunction.hpp | 32 +++ .../AcontainsTgeoTgeoPhysicalFunction.cpp | 91 ++++++++ .../Meos/AcoversTgeoTgeoPhysicalFunction.cpp | 91 ++++++++ .../AdisjointTgeoTgeoPhysicalFunction.cpp | 91 ++++++++ .../AintersectsTgeoTgeoPhysicalFunction.cpp | 91 ++++++++ .../Meos/AlwaysEqTgeoTgeoPhysicalFunction.cpp | 91 ++++++++ .../Meos/AlwaysNeTgeoTgeoPhysicalFunction.cpp | 91 ++++++++ .../Meos/AtouchesTgeoTgeoPhysicalFunction.cpp | 91 ++++++++ .../src/Functions/Meos/CMakeLists.txt | 14 ++ .../EcontainsTgeoTgeoPhysicalFunction.cpp | 91 ++++++++ .../Meos/EcoversTgeoTgeoPhysicalFunction.cpp | 91 ++++++++ .../EdisjointTgeoTgeoPhysicalFunction.cpp | 91 ++++++++ .../EintersectsTgeoTgeoPhysicalFunction.cpp | 91 ++++++++ .../Meos/EtouchesTgeoTgeoPhysicalFunction.cpp | 91 ++++++++ .../Meos/EverEqTgeoTgeoPhysicalFunction.cpp | 91 ++++++++ .../Meos/EverNeTgeoTgeoPhysicalFunction.cpp | 91 ++++++++ nes-sql-parser/AntlrSQL.g4 | 16 +- .../src/AntlrSQLQueryPlanCreator.cpp | 196 ++++++++++++++++++ 60 files changed, 4187 insertions(+), 1 deletion(-) create mode 100644 nes-logical-operators/include/Functions/Meos/AcontainsTgeoTgeoLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AcoversTgeoTgeoLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AdisjointTgeoTgeoLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AintersectsTgeoTgeoLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysEqTgeoTgeoLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysNeTgeoTgeoLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AtouchesTgeoTgeoLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EcontainsTgeoTgeoLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EcoversTgeoTgeoLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EdisjointTgeoTgeoLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EintersectsTgeoTgeoLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EtouchesTgeoTgeoLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverEqTgeoTgeoLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverNeTgeoTgeoLogicalFunction.hpp create mode 100644 nes-logical-operators/src/Functions/Meos/AcontainsTgeoTgeoLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AcoversTgeoTgeoLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AdisjointTgeoTgeoLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AintersectsTgeoTgeoLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysEqTgeoTgeoLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysNeTgeoTgeoLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AtouchesTgeoTgeoLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EcontainsTgeoTgeoLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EcoversTgeoTgeoLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EdisjointTgeoTgeoLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EintersectsTgeoTgeoLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EtouchesTgeoTgeoLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverEqTgeoTgeoLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverNeTgeoTgeoLogicalFunction.cpp create mode 100644 nes-physical-operators/include/Functions/Meos/AcontainsTgeoTgeoPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AcoversTgeoTgeoPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AdisjointTgeoTgeoPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AintersectsTgeoTgeoPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysEqTgeoTgeoPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysNeTgeoTgeoPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AtouchesTgeoTgeoPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EcontainsTgeoTgeoPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EcoversTgeoTgeoPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EdisjointTgeoTgeoPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EintersectsTgeoTgeoPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EtouchesTgeoTgeoPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverEqTgeoTgeoPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverNeTgeoTgeoPhysicalFunction.hpp create mode 100644 nes-physical-operators/src/Functions/Meos/AcontainsTgeoTgeoPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AcoversTgeoTgeoPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AdisjointTgeoTgeoPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AintersectsTgeoTgeoPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysEqTgeoTgeoPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysNeTgeoTgeoPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AtouchesTgeoTgeoPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EcontainsTgeoTgeoPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EcoversTgeoTgeoPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EdisjointTgeoTgeoPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EintersectsTgeoTgeoPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EtouchesTgeoTgeoPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverEqTgeoTgeoPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverNeTgeoTgeoPhysicalFunction.cpp diff --git a/nes-logical-operators/include/Functions/Meos/AcontainsTgeoTgeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AcontainsTgeoTgeoLogicalFunction.hpp new file mode 100644 index 0000000000..1a37399f4c --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AcontainsTgeoTgeoLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Tests whether a temporal geometry always contains another. + */ +class AcontainsTgeoTgeoLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AcontainsTgeoTgeo"; + + AcontainsTgeoTgeoLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction ts1, LogicalFunction lon2, LogicalFunction lat2, LogicalFunction ts2); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AcoversTgeoTgeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AcoversTgeoTgeoLogicalFunction.hpp new file mode 100644 index 0000000000..52c370d0a6 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AcoversTgeoTgeoLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Tests whether a temporal geometry always covers another. + */ +class AcoversTgeoTgeoLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AcoversTgeoTgeo"; + + AcoversTgeoTgeoLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction ts1, LogicalFunction lon2, LogicalFunction lat2, LogicalFunction ts2); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AdisjointTgeoTgeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AdisjointTgeoTgeoLogicalFunction.hpp new file mode 100644 index 0000000000..80d2046dad --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AdisjointTgeoTgeoLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Tests whether two temporal geometries are always disjoint. + */ +class AdisjointTgeoTgeoLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AdisjointTgeoTgeo"; + + AdisjointTgeoTgeoLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction ts1, LogicalFunction lon2, LogicalFunction lat2, LogicalFunction ts2); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AintersectsTgeoTgeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AintersectsTgeoTgeoLogicalFunction.hpp new file mode 100644 index 0000000000..9958512ca8 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AintersectsTgeoTgeoLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Tests whether two temporal geometries always intersect. + */ +class AintersectsTgeoTgeoLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AintersectsTgeoTgeo"; + + AintersectsTgeoTgeoLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction ts1, LogicalFunction lon2, LogicalFunction lat2, LogicalFunction ts2); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysEqTgeoTgeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysEqTgeoTgeoLogicalFunction.hpp new file mode 100644 index 0000000000..49eb7868b3 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysEqTgeoTgeoLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Tests whether two temporal geometries are always spatially equal. + */ +class AlwaysEqTgeoTgeoLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysEqTgeoTgeo"; + + AlwaysEqTgeoTgeoLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction ts1, LogicalFunction lon2, LogicalFunction lat2, LogicalFunction ts2); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysNeTgeoTgeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysNeTgeoTgeoLogicalFunction.hpp new file mode 100644 index 0000000000..b2fa1d110b --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysNeTgeoTgeoLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Tests whether two temporal geometries are always spatially not equal. + */ +class AlwaysNeTgeoTgeoLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysNeTgeoTgeo"; + + AlwaysNeTgeoTgeoLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction ts1, LogicalFunction lon2, LogicalFunction lat2, LogicalFunction ts2); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AtouchesTgeoTgeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AtouchesTgeoTgeoLogicalFunction.hpp new file mode 100644 index 0000000000..864f6c70c4 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AtouchesTgeoTgeoLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Tests whether two temporal geometries always touch. + */ +class AtouchesTgeoTgeoLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AtouchesTgeoTgeo"; + + AtouchesTgeoTgeoLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction ts1, LogicalFunction lon2, LogicalFunction lat2, LogicalFunction ts2); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EcontainsTgeoTgeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EcontainsTgeoTgeoLogicalFunction.hpp new file mode 100644 index 0000000000..41ea789905 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EcontainsTgeoTgeoLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Tests whether a temporal geometry ever contains another. + */ +class EcontainsTgeoTgeoLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EcontainsTgeoTgeo"; + + EcontainsTgeoTgeoLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction ts1, LogicalFunction lon2, LogicalFunction lat2, LogicalFunction ts2); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EcoversTgeoTgeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EcoversTgeoTgeoLogicalFunction.hpp new file mode 100644 index 0000000000..5bb9d7c90e --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EcoversTgeoTgeoLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Tests whether a temporal geometry ever covers another. + */ +class EcoversTgeoTgeoLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EcoversTgeoTgeo"; + + EcoversTgeoTgeoLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction ts1, LogicalFunction lon2, LogicalFunction lat2, LogicalFunction ts2); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EdisjointTgeoTgeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EdisjointTgeoTgeoLogicalFunction.hpp new file mode 100644 index 0000000000..2c72e3220d --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EdisjointTgeoTgeoLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Tests whether two temporal geometries are ever disjoint. + */ +class EdisjointTgeoTgeoLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EdisjointTgeoTgeo"; + + EdisjointTgeoTgeoLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction ts1, LogicalFunction lon2, LogicalFunction lat2, LogicalFunction ts2); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EintersectsTgeoTgeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EintersectsTgeoTgeoLogicalFunction.hpp new file mode 100644 index 0000000000..465e65ffa4 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EintersectsTgeoTgeoLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Tests whether two temporal geometries ever intersect. + */ +class EintersectsTgeoTgeoLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EintersectsTgeoTgeo"; + + EintersectsTgeoTgeoLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction ts1, LogicalFunction lon2, LogicalFunction lat2, LogicalFunction ts2); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EtouchesTgeoTgeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EtouchesTgeoTgeoLogicalFunction.hpp new file mode 100644 index 0000000000..39cdf9d376 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EtouchesTgeoTgeoLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Tests whether two temporal geometries ever touch. + */ +class EtouchesTgeoTgeoLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EtouchesTgeoTgeo"; + + EtouchesTgeoTgeoLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction ts1, LogicalFunction lon2, LogicalFunction lat2, LogicalFunction ts2); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverEqTgeoTgeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverEqTgeoTgeoLogicalFunction.hpp new file mode 100644 index 0000000000..e4fb3ca95d --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverEqTgeoTgeoLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Tests whether two temporal geometries are ever spatially equal. + */ +class EverEqTgeoTgeoLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverEqTgeoTgeo"; + + EverEqTgeoTgeoLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction ts1, LogicalFunction lon2, LogicalFunction lat2, LogicalFunction ts2); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverNeTgeoTgeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverNeTgeoTgeoLogicalFunction.hpp new file mode 100644 index 0000000000..5a46ad9201 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverNeTgeoTgeoLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Tests whether two temporal geometries are ever spatially not equal. + */ +class EverNeTgeoTgeoLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverNeTgeoTgeo"; + + EverNeTgeoTgeoLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction ts1, LogicalFunction lon2, LogicalFunction lat2, LogicalFunction ts2); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AcontainsTgeoTgeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AcontainsTgeoTgeoLogicalFunction.cpp new file mode 100644 index 0000000000..bf5ed84ba0 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AcontainsTgeoTgeoLogicalFunction.cpp @@ -0,0 +1,111 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AcontainsTgeoTgeoLogicalFunction::AcontainsTgeoTgeoLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction ts1, LogicalFunction lon2, LogicalFunction lat2, LogicalFunction ts2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(6); + parameters.push_back(std::move(lon1)); + parameters.push_back(std::move(lat1)); + parameters.push_back(std::move(ts1)); + parameters.push_back(std::move(lon2)); + parameters.push_back(std::move(lat2)); + parameters.push_back(std::move(ts2)); +} + +DataType AcontainsTgeoTgeoLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AcontainsTgeoTgeoLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AcontainsTgeoTgeoLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AcontainsTgeoTgeoLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 6, + "AcontainsTgeoTgeoLogicalFunction requires 6 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AcontainsTgeoTgeoLogicalFunction::getType() const { return NAME; } + +bool AcontainsTgeoTgeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AcontainsTgeoTgeoLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction AcontainsTgeoTgeoLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(6); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon1 must be FLOAT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat1 must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::FLOAT64), "lon2 must be FLOAT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "lat2 must be FLOAT64"); + INVARIANT(c[5].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); + return withChildren(c); +} + +SerializableFunction AcontainsTgeoTgeoLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAcontainsTgeoTgeoLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 6, + "AcontainsTgeoTgeoLogicalFunction requires 6 children but got {}", + arguments.children.size()); + return AcontainsTgeoTgeoLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4]), + std::move(arguments.children[5])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AcoversTgeoTgeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AcoversTgeoTgeoLogicalFunction.cpp new file mode 100644 index 0000000000..fd3a00853d --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AcoversTgeoTgeoLogicalFunction.cpp @@ -0,0 +1,111 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AcoversTgeoTgeoLogicalFunction::AcoversTgeoTgeoLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction ts1, LogicalFunction lon2, LogicalFunction lat2, LogicalFunction ts2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(6); + parameters.push_back(std::move(lon1)); + parameters.push_back(std::move(lat1)); + parameters.push_back(std::move(ts1)); + parameters.push_back(std::move(lon2)); + parameters.push_back(std::move(lat2)); + parameters.push_back(std::move(ts2)); +} + +DataType AcoversTgeoTgeoLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AcoversTgeoTgeoLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AcoversTgeoTgeoLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AcoversTgeoTgeoLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 6, + "AcoversTgeoTgeoLogicalFunction requires 6 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AcoversTgeoTgeoLogicalFunction::getType() const { return NAME; } + +bool AcoversTgeoTgeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AcoversTgeoTgeoLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction AcoversTgeoTgeoLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(6); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon1 must be FLOAT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat1 must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::FLOAT64), "lon2 must be FLOAT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "lat2 must be FLOAT64"); + INVARIANT(c[5].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); + return withChildren(c); +} + +SerializableFunction AcoversTgeoTgeoLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAcoversTgeoTgeoLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 6, + "AcoversTgeoTgeoLogicalFunction requires 6 children but got {}", + arguments.children.size()); + return AcoversTgeoTgeoLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4]), + std::move(arguments.children[5])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AdisjointTgeoTgeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AdisjointTgeoTgeoLogicalFunction.cpp new file mode 100644 index 0000000000..688f46c35c --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AdisjointTgeoTgeoLogicalFunction.cpp @@ -0,0 +1,111 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AdisjointTgeoTgeoLogicalFunction::AdisjointTgeoTgeoLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction ts1, LogicalFunction lon2, LogicalFunction lat2, LogicalFunction ts2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(6); + parameters.push_back(std::move(lon1)); + parameters.push_back(std::move(lat1)); + parameters.push_back(std::move(ts1)); + parameters.push_back(std::move(lon2)); + parameters.push_back(std::move(lat2)); + parameters.push_back(std::move(ts2)); +} + +DataType AdisjointTgeoTgeoLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AdisjointTgeoTgeoLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AdisjointTgeoTgeoLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AdisjointTgeoTgeoLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 6, + "AdisjointTgeoTgeoLogicalFunction requires 6 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AdisjointTgeoTgeoLogicalFunction::getType() const { return NAME; } + +bool AdisjointTgeoTgeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AdisjointTgeoTgeoLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction AdisjointTgeoTgeoLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(6); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon1 must be FLOAT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat1 must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::FLOAT64), "lon2 must be FLOAT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "lat2 must be FLOAT64"); + INVARIANT(c[5].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); + return withChildren(c); +} + +SerializableFunction AdisjointTgeoTgeoLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAdisjointTgeoTgeoLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 6, + "AdisjointTgeoTgeoLogicalFunction requires 6 children but got {}", + arguments.children.size()); + return AdisjointTgeoTgeoLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4]), + std::move(arguments.children[5])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AintersectsTgeoTgeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AintersectsTgeoTgeoLogicalFunction.cpp new file mode 100644 index 0000000000..e8475bd108 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AintersectsTgeoTgeoLogicalFunction.cpp @@ -0,0 +1,111 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AintersectsTgeoTgeoLogicalFunction::AintersectsTgeoTgeoLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction ts1, LogicalFunction lon2, LogicalFunction lat2, LogicalFunction ts2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(6); + parameters.push_back(std::move(lon1)); + parameters.push_back(std::move(lat1)); + parameters.push_back(std::move(ts1)); + parameters.push_back(std::move(lon2)); + parameters.push_back(std::move(lat2)); + parameters.push_back(std::move(ts2)); +} + +DataType AintersectsTgeoTgeoLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AintersectsTgeoTgeoLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AintersectsTgeoTgeoLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AintersectsTgeoTgeoLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 6, + "AintersectsTgeoTgeoLogicalFunction requires 6 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AintersectsTgeoTgeoLogicalFunction::getType() const { return NAME; } + +bool AintersectsTgeoTgeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AintersectsTgeoTgeoLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction AintersectsTgeoTgeoLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(6); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon1 must be FLOAT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat1 must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::FLOAT64), "lon2 must be FLOAT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "lat2 must be FLOAT64"); + INVARIANT(c[5].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); + return withChildren(c); +} + +SerializableFunction AintersectsTgeoTgeoLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAintersectsTgeoTgeoLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 6, + "AintersectsTgeoTgeoLogicalFunction requires 6 children but got {}", + arguments.children.size()); + return AintersectsTgeoTgeoLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4]), + std::move(arguments.children[5])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysEqTgeoTgeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysEqTgeoTgeoLogicalFunction.cpp new file mode 100644 index 0000000000..51aef4b50b --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysEqTgeoTgeoLogicalFunction.cpp @@ -0,0 +1,111 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AlwaysEqTgeoTgeoLogicalFunction::AlwaysEqTgeoTgeoLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction ts1, LogicalFunction lon2, LogicalFunction lat2, LogicalFunction ts2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(6); + parameters.push_back(std::move(lon1)); + parameters.push_back(std::move(lat1)); + parameters.push_back(std::move(ts1)); + parameters.push_back(std::move(lon2)); + parameters.push_back(std::move(lat2)); + parameters.push_back(std::move(ts2)); +} + +DataType AlwaysEqTgeoTgeoLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysEqTgeoTgeoLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AlwaysEqTgeoTgeoLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysEqTgeoTgeoLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 6, + "AlwaysEqTgeoTgeoLogicalFunction requires 6 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AlwaysEqTgeoTgeoLogicalFunction::getType() const { return NAME; } + +bool AlwaysEqTgeoTgeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AlwaysEqTgeoTgeoLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction AlwaysEqTgeoTgeoLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(6); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon1 must be FLOAT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat1 must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::FLOAT64), "lon2 must be FLOAT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "lat2 must be FLOAT64"); + INVARIANT(c[5].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); + return withChildren(c); +} + +SerializableFunction AlwaysEqTgeoTgeoLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysEqTgeoTgeoLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 6, + "AlwaysEqTgeoTgeoLogicalFunction requires 6 children but got {}", + arguments.children.size()); + return AlwaysEqTgeoTgeoLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4]), + std::move(arguments.children[5])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysNeTgeoTgeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysNeTgeoTgeoLogicalFunction.cpp new file mode 100644 index 0000000000..4f4f13589e --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysNeTgeoTgeoLogicalFunction.cpp @@ -0,0 +1,111 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AlwaysNeTgeoTgeoLogicalFunction::AlwaysNeTgeoTgeoLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction ts1, LogicalFunction lon2, LogicalFunction lat2, LogicalFunction ts2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(6); + parameters.push_back(std::move(lon1)); + parameters.push_back(std::move(lat1)); + parameters.push_back(std::move(ts1)); + parameters.push_back(std::move(lon2)); + parameters.push_back(std::move(lat2)); + parameters.push_back(std::move(ts2)); +} + +DataType AlwaysNeTgeoTgeoLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AlwaysNeTgeoTgeoLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AlwaysNeTgeoTgeoLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AlwaysNeTgeoTgeoLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 6, + "AlwaysNeTgeoTgeoLogicalFunction requires 6 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AlwaysNeTgeoTgeoLogicalFunction::getType() const { return NAME; } + +bool AlwaysNeTgeoTgeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AlwaysNeTgeoTgeoLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction AlwaysNeTgeoTgeoLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(6); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon1 must be FLOAT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat1 must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::FLOAT64), "lon2 must be FLOAT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "lat2 must be FLOAT64"); + INVARIANT(c[5].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); + return withChildren(c); +} + +SerializableFunction AlwaysNeTgeoTgeoLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysNeTgeoTgeoLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 6, + "AlwaysNeTgeoTgeoLogicalFunction requires 6 children but got {}", + arguments.children.size()); + return AlwaysNeTgeoTgeoLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4]), + std::move(arguments.children[5])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AtouchesTgeoTgeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AtouchesTgeoTgeoLogicalFunction.cpp new file mode 100644 index 0000000000..2d3781a759 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AtouchesTgeoTgeoLogicalFunction.cpp @@ -0,0 +1,111 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AtouchesTgeoTgeoLogicalFunction::AtouchesTgeoTgeoLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction ts1, LogicalFunction lon2, LogicalFunction lat2, LogicalFunction ts2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(6); + parameters.push_back(std::move(lon1)); + parameters.push_back(std::move(lat1)); + parameters.push_back(std::move(ts1)); + parameters.push_back(std::move(lon2)); + parameters.push_back(std::move(lat2)); + parameters.push_back(std::move(ts2)); +} + +DataType AtouchesTgeoTgeoLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AtouchesTgeoTgeoLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AtouchesTgeoTgeoLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AtouchesTgeoTgeoLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 6, + "AtouchesTgeoTgeoLogicalFunction requires 6 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AtouchesTgeoTgeoLogicalFunction::getType() const { return NAME; } + +bool AtouchesTgeoTgeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AtouchesTgeoTgeoLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction AtouchesTgeoTgeoLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(6); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon1 must be FLOAT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat1 must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::FLOAT64), "lon2 must be FLOAT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "lat2 must be FLOAT64"); + INVARIANT(c[5].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); + return withChildren(c); +} + +SerializableFunction AtouchesTgeoTgeoLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAtouchesTgeoTgeoLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 6, + "AtouchesTgeoTgeoLogicalFunction requires 6 children but got {}", + arguments.children.size()); + return AtouchesTgeoTgeoLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4]), + std::move(arguments.children[5])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt index 588f0630dd..5c1eb265f0 100644 --- a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt @@ -477,6 +477,20 @@ add_plugin(GeomFromHexewkb LogicalFunction nes-logical-operators GeomFromHexewkb add_plugin(GeoTransformPipeline LogicalFunction nes-logical-operators GeoTransformPipelineLogicalFunction.cpp) add_plugin(GeomMinBoundingCenter LogicalFunction nes-logical-operators GeomMinBoundingCenterLogicalFunction.cpp) add_plugin(GeomMinBoundingRadius LogicalFunction nes-logical-operators GeomMinBoundingRadiusLogicalFunction.cpp) +add_plugin(EverEqTgeoTgeo LogicalFunction nes-logical-operators EverEqTgeoTgeoLogicalFunction.cpp) +add_plugin(EverNeTgeoTgeo LogicalFunction nes-logical-operators EverNeTgeoTgeoLogicalFunction.cpp) +add_plugin(AlwaysEqTgeoTgeo LogicalFunction nes-logical-operators AlwaysEqTgeoTgeoLogicalFunction.cpp) +add_plugin(AlwaysNeTgeoTgeo LogicalFunction nes-logical-operators AlwaysNeTgeoTgeoLogicalFunction.cpp) +add_plugin(EintersectsTgeoTgeo LogicalFunction nes-logical-operators EintersectsTgeoTgeoLogicalFunction.cpp) +add_plugin(EcoversTgeoTgeo LogicalFunction nes-logical-operators EcoversTgeoTgeoLogicalFunction.cpp) +add_plugin(EdisjointTgeoTgeo LogicalFunction nes-logical-operators EdisjointTgeoTgeoLogicalFunction.cpp) +add_plugin(EcontainsTgeoTgeo LogicalFunction nes-logical-operators EcontainsTgeoTgeoLogicalFunction.cpp) +add_plugin(EtouchesTgeoTgeo LogicalFunction nes-logical-operators EtouchesTgeoTgeoLogicalFunction.cpp) +add_plugin(AintersectsTgeoTgeo LogicalFunction nes-logical-operators AintersectsTgeoTgeoLogicalFunction.cpp) +add_plugin(AcoversTgeoTgeo LogicalFunction nes-logical-operators AcoversTgeoTgeoLogicalFunction.cpp) +add_plugin(AdisjointTgeoTgeo LogicalFunction nes-logical-operators AdisjointTgeoTgeoLogicalFunction.cpp) +add_plugin(AcontainsTgeoTgeo LogicalFunction nes-logical-operators AcontainsTgeoTgeoLogicalFunction.cpp) +add_plugin(AtouchesTgeoTgeo LogicalFunction nes-logical-operators AtouchesTgeoTgeoLogicalFunction.cpp) add_plugin(GeomRelatePattern LogicalFunction nes-logical-operators GeomRelatePatternLogicalFunction.cpp) add_plugin(GeomIntersects2d LogicalFunction nes-logical-operators GeomIntersects2dLogicalFunction.cpp) add_plugin(GeomDwithin2d LogicalFunction nes-logical-operators GeomDwithin2dLogicalFunction.cpp) diff --git a/nes-logical-operators/src/Functions/Meos/EcontainsTgeoTgeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EcontainsTgeoTgeoLogicalFunction.cpp new file mode 100644 index 0000000000..955ec62f67 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EcontainsTgeoTgeoLogicalFunction.cpp @@ -0,0 +1,111 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EcontainsTgeoTgeoLogicalFunction::EcontainsTgeoTgeoLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction ts1, LogicalFunction lon2, LogicalFunction lat2, LogicalFunction ts2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(6); + parameters.push_back(std::move(lon1)); + parameters.push_back(std::move(lat1)); + parameters.push_back(std::move(ts1)); + parameters.push_back(std::move(lon2)); + parameters.push_back(std::move(lat2)); + parameters.push_back(std::move(ts2)); +} + +DataType EcontainsTgeoTgeoLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EcontainsTgeoTgeoLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EcontainsTgeoTgeoLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EcontainsTgeoTgeoLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 6, + "EcontainsTgeoTgeoLogicalFunction requires 6 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EcontainsTgeoTgeoLogicalFunction::getType() const { return NAME; } + +bool EcontainsTgeoTgeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EcontainsTgeoTgeoLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction EcontainsTgeoTgeoLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(6); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon1 must be FLOAT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat1 must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::FLOAT64), "lon2 must be FLOAT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "lat2 must be FLOAT64"); + INVARIANT(c[5].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); + return withChildren(c); +} + +SerializableFunction EcontainsTgeoTgeoLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEcontainsTgeoTgeoLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 6, + "EcontainsTgeoTgeoLogicalFunction requires 6 children but got {}", + arguments.children.size()); + return EcontainsTgeoTgeoLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4]), + std::move(arguments.children[5])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EcoversTgeoTgeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EcoversTgeoTgeoLogicalFunction.cpp new file mode 100644 index 0000000000..f060447b1a --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EcoversTgeoTgeoLogicalFunction.cpp @@ -0,0 +1,111 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EcoversTgeoTgeoLogicalFunction::EcoversTgeoTgeoLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction ts1, LogicalFunction lon2, LogicalFunction lat2, LogicalFunction ts2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(6); + parameters.push_back(std::move(lon1)); + parameters.push_back(std::move(lat1)); + parameters.push_back(std::move(ts1)); + parameters.push_back(std::move(lon2)); + parameters.push_back(std::move(lat2)); + parameters.push_back(std::move(ts2)); +} + +DataType EcoversTgeoTgeoLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EcoversTgeoTgeoLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EcoversTgeoTgeoLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EcoversTgeoTgeoLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 6, + "EcoversTgeoTgeoLogicalFunction requires 6 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EcoversTgeoTgeoLogicalFunction::getType() const { return NAME; } + +bool EcoversTgeoTgeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EcoversTgeoTgeoLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction EcoversTgeoTgeoLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(6); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon1 must be FLOAT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat1 must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::FLOAT64), "lon2 must be FLOAT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "lat2 must be FLOAT64"); + INVARIANT(c[5].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); + return withChildren(c); +} + +SerializableFunction EcoversTgeoTgeoLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEcoversTgeoTgeoLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 6, + "EcoversTgeoTgeoLogicalFunction requires 6 children but got {}", + arguments.children.size()); + return EcoversTgeoTgeoLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4]), + std::move(arguments.children[5])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EdisjointTgeoTgeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EdisjointTgeoTgeoLogicalFunction.cpp new file mode 100644 index 0000000000..157a6a264a --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EdisjointTgeoTgeoLogicalFunction.cpp @@ -0,0 +1,111 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EdisjointTgeoTgeoLogicalFunction::EdisjointTgeoTgeoLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction ts1, LogicalFunction lon2, LogicalFunction lat2, LogicalFunction ts2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(6); + parameters.push_back(std::move(lon1)); + parameters.push_back(std::move(lat1)); + parameters.push_back(std::move(ts1)); + parameters.push_back(std::move(lon2)); + parameters.push_back(std::move(lat2)); + parameters.push_back(std::move(ts2)); +} + +DataType EdisjointTgeoTgeoLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EdisjointTgeoTgeoLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EdisjointTgeoTgeoLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EdisjointTgeoTgeoLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 6, + "EdisjointTgeoTgeoLogicalFunction requires 6 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EdisjointTgeoTgeoLogicalFunction::getType() const { return NAME; } + +bool EdisjointTgeoTgeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EdisjointTgeoTgeoLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction EdisjointTgeoTgeoLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(6); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon1 must be FLOAT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat1 must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::FLOAT64), "lon2 must be FLOAT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "lat2 must be FLOAT64"); + INVARIANT(c[5].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); + return withChildren(c); +} + +SerializableFunction EdisjointTgeoTgeoLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEdisjointTgeoTgeoLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 6, + "EdisjointTgeoTgeoLogicalFunction requires 6 children but got {}", + arguments.children.size()); + return EdisjointTgeoTgeoLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4]), + std::move(arguments.children[5])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EintersectsTgeoTgeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EintersectsTgeoTgeoLogicalFunction.cpp new file mode 100644 index 0000000000..2a597066f8 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EintersectsTgeoTgeoLogicalFunction.cpp @@ -0,0 +1,111 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EintersectsTgeoTgeoLogicalFunction::EintersectsTgeoTgeoLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction ts1, LogicalFunction lon2, LogicalFunction lat2, LogicalFunction ts2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(6); + parameters.push_back(std::move(lon1)); + parameters.push_back(std::move(lat1)); + parameters.push_back(std::move(ts1)); + parameters.push_back(std::move(lon2)); + parameters.push_back(std::move(lat2)); + parameters.push_back(std::move(ts2)); +} + +DataType EintersectsTgeoTgeoLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EintersectsTgeoTgeoLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EintersectsTgeoTgeoLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EintersectsTgeoTgeoLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 6, + "EintersectsTgeoTgeoLogicalFunction requires 6 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EintersectsTgeoTgeoLogicalFunction::getType() const { return NAME; } + +bool EintersectsTgeoTgeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EintersectsTgeoTgeoLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction EintersectsTgeoTgeoLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(6); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon1 must be FLOAT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat1 must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::FLOAT64), "lon2 must be FLOAT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "lat2 must be FLOAT64"); + INVARIANT(c[5].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); + return withChildren(c); +} + +SerializableFunction EintersectsTgeoTgeoLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEintersectsTgeoTgeoLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 6, + "EintersectsTgeoTgeoLogicalFunction requires 6 children but got {}", + arguments.children.size()); + return EintersectsTgeoTgeoLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4]), + std::move(arguments.children[5])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EtouchesTgeoTgeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EtouchesTgeoTgeoLogicalFunction.cpp new file mode 100644 index 0000000000..0aac78792c --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EtouchesTgeoTgeoLogicalFunction.cpp @@ -0,0 +1,111 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EtouchesTgeoTgeoLogicalFunction::EtouchesTgeoTgeoLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction ts1, LogicalFunction lon2, LogicalFunction lat2, LogicalFunction ts2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(6); + parameters.push_back(std::move(lon1)); + parameters.push_back(std::move(lat1)); + parameters.push_back(std::move(ts1)); + parameters.push_back(std::move(lon2)); + parameters.push_back(std::move(lat2)); + parameters.push_back(std::move(ts2)); +} + +DataType EtouchesTgeoTgeoLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EtouchesTgeoTgeoLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EtouchesTgeoTgeoLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EtouchesTgeoTgeoLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 6, + "EtouchesTgeoTgeoLogicalFunction requires 6 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EtouchesTgeoTgeoLogicalFunction::getType() const { return NAME; } + +bool EtouchesTgeoTgeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EtouchesTgeoTgeoLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction EtouchesTgeoTgeoLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(6); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon1 must be FLOAT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat1 must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::FLOAT64), "lon2 must be FLOAT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "lat2 must be FLOAT64"); + INVARIANT(c[5].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); + return withChildren(c); +} + +SerializableFunction EtouchesTgeoTgeoLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEtouchesTgeoTgeoLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 6, + "EtouchesTgeoTgeoLogicalFunction requires 6 children but got {}", + arguments.children.size()); + return EtouchesTgeoTgeoLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4]), + std::move(arguments.children[5])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverEqTgeoTgeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverEqTgeoTgeoLogicalFunction.cpp new file mode 100644 index 0000000000..d5c28eae46 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverEqTgeoTgeoLogicalFunction.cpp @@ -0,0 +1,111 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EverEqTgeoTgeoLogicalFunction::EverEqTgeoTgeoLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction ts1, LogicalFunction lon2, LogicalFunction lat2, LogicalFunction ts2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(6); + parameters.push_back(std::move(lon1)); + parameters.push_back(std::move(lat1)); + parameters.push_back(std::move(ts1)); + parameters.push_back(std::move(lon2)); + parameters.push_back(std::move(lat2)); + parameters.push_back(std::move(ts2)); +} + +DataType EverEqTgeoTgeoLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverEqTgeoTgeoLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EverEqTgeoTgeoLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverEqTgeoTgeoLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 6, + "EverEqTgeoTgeoLogicalFunction requires 6 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EverEqTgeoTgeoLogicalFunction::getType() const { return NAME; } + +bool EverEqTgeoTgeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EverEqTgeoTgeoLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction EverEqTgeoTgeoLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(6); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon1 must be FLOAT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat1 must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::FLOAT64), "lon2 must be FLOAT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "lat2 must be FLOAT64"); + INVARIANT(c[5].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); + return withChildren(c); +} + +SerializableFunction EverEqTgeoTgeoLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverEqTgeoTgeoLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 6, + "EverEqTgeoTgeoLogicalFunction requires 6 children but got {}", + arguments.children.size()); + return EverEqTgeoTgeoLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4]), + std::move(arguments.children[5])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverNeTgeoTgeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverNeTgeoTgeoLogicalFunction.cpp new file mode 100644 index 0000000000..d30c830b71 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverNeTgeoTgeoLogicalFunction.cpp @@ -0,0 +1,111 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EverNeTgeoTgeoLogicalFunction::EverNeTgeoTgeoLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction ts1, LogicalFunction lon2, LogicalFunction lat2, LogicalFunction ts2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(6); + parameters.push_back(std::move(lon1)); + parameters.push_back(std::move(lat1)); + parameters.push_back(std::move(ts1)); + parameters.push_back(std::move(lon2)); + parameters.push_back(std::move(lat2)); + parameters.push_back(std::move(ts2)); +} + +DataType EverNeTgeoTgeoLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EverNeTgeoTgeoLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EverNeTgeoTgeoLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EverNeTgeoTgeoLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 6, + "EverNeTgeoTgeoLogicalFunction requires 6 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EverNeTgeoTgeoLogicalFunction::getType() const { return NAME; } + +bool EverNeTgeoTgeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EverNeTgeoTgeoLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction EverNeTgeoTgeoLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(6); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon1 must be FLOAT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat1 must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::FLOAT64), "lon2 must be FLOAT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "lat2 must be FLOAT64"); + INVARIANT(c[5].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); + return withChildren(c); +} + +SerializableFunction EverNeTgeoTgeoLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverNeTgeoTgeoLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 6, + "EverNeTgeoTgeoLogicalFunction requires 6 children but got {}", + arguments.children.size()); + return EverNeTgeoTgeoLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4]), + std::move(arguments.children[5])); +} + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AcontainsTgeoTgeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AcontainsTgeoTgeoPhysicalFunction.hpp new file mode 100644 index 0000000000..5c3bf5237f --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AcontainsTgeoTgeoPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class AcontainsTgeoTgeoPhysicalFunction : public PhysicalFunctionConcept { +public: + AcontainsTgeoTgeoPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction ts1, PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction ts2); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AcoversTgeoTgeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AcoversTgeoTgeoPhysicalFunction.hpp new file mode 100644 index 0000000000..298e0f13b1 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AcoversTgeoTgeoPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class AcoversTgeoTgeoPhysicalFunction : public PhysicalFunctionConcept { +public: + AcoversTgeoTgeoPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction ts1, PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction ts2); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AdisjointTgeoTgeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AdisjointTgeoTgeoPhysicalFunction.hpp new file mode 100644 index 0000000000..c5fea46730 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AdisjointTgeoTgeoPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class AdisjointTgeoTgeoPhysicalFunction : public PhysicalFunctionConcept { +public: + AdisjointTgeoTgeoPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction ts1, PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction ts2); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AintersectsTgeoTgeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AintersectsTgeoTgeoPhysicalFunction.hpp new file mode 100644 index 0000000000..5359651e51 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AintersectsTgeoTgeoPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class AintersectsTgeoTgeoPhysicalFunction : public PhysicalFunctionConcept { +public: + AintersectsTgeoTgeoPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction ts1, PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction ts2); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysEqTgeoTgeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysEqTgeoTgeoPhysicalFunction.hpp new file mode 100644 index 0000000000..8a48929cf6 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysEqTgeoTgeoPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class AlwaysEqTgeoTgeoPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysEqTgeoTgeoPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction ts1, PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction ts2); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysNeTgeoTgeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysNeTgeoTgeoPhysicalFunction.hpp new file mode 100644 index 0000000000..888863999f --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysNeTgeoTgeoPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class AlwaysNeTgeoTgeoPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysNeTgeoTgeoPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction ts1, PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction ts2); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AtouchesTgeoTgeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AtouchesTgeoTgeoPhysicalFunction.hpp new file mode 100644 index 0000000000..f4f472222d --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AtouchesTgeoTgeoPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class AtouchesTgeoTgeoPhysicalFunction : public PhysicalFunctionConcept { +public: + AtouchesTgeoTgeoPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction ts1, PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction ts2); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EcontainsTgeoTgeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EcontainsTgeoTgeoPhysicalFunction.hpp new file mode 100644 index 0000000000..56f7b49cc8 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EcontainsTgeoTgeoPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class EcontainsTgeoTgeoPhysicalFunction : public PhysicalFunctionConcept { +public: + EcontainsTgeoTgeoPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction ts1, PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction ts2); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EcoversTgeoTgeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EcoversTgeoTgeoPhysicalFunction.hpp new file mode 100644 index 0000000000..28b70fad9b --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EcoversTgeoTgeoPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class EcoversTgeoTgeoPhysicalFunction : public PhysicalFunctionConcept { +public: + EcoversTgeoTgeoPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction ts1, PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction ts2); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EdisjointTgeoTgeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EdisjointTgeoTgeoPhysicalFunction.hpp new file mode 100644 index 0000000000..80c52445ec --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EdisjointTgeoTgeoPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class EdisjointTgeoTgeoPhysicalFunction : public PhysicalFunctionConcept { +public: + EdisjointTgeoTgeoPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction ts1, PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction ts2); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EintersectsTgeoTgeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EintersectsTgeoTgeoPhysicalFunction.hpp new file mode 100644 index 0000000000..5059b28ad4 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EintersectsTgeoTgeoPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class EintersectsTgeoTgeoPhysicalFunction : public PhysicalFunctionConcept { +public: + EintersectsTgeoTgeoPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction ts1, PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction ts2); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EtouchesTgeoTgeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EtouchesTgeoTgeoPhysicalFunction.hpp new file mode 100644 index 0000000000..464922ce60 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EtouchesTgeoTgeoPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class EtouchesTgeoTgeoPhysicalFunction : public PhysicalFunctionConcept { +public: + EtouchesTgeoTgeoPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction ts1, PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction ts2); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverEqTgeoTgeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverEqTgeoTgeoPhysicalFunction.hpp new file mode 100644 index 0000000000..5571b9a7fe --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverEqTgeoTgeoPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class EverEqTgeoTgeoPhysicalFunction : public PhysicalFunctionConcept { +public: + EverEqTgeoTgeoPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction ts1, PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction ts2); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverNeTgeoTgeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverNeTgeoTgeoPhysicalFunction.hpp new file mode 100644 index 0000000000..7d7e4b4280 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverNeTgeoTgeoPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class EverNeTgeoTgeoPhysicalFunction : public PhysicalFunctionConcept { +public: + EverNeTgeoTgeoPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction ts1, PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction ts2); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AcontainsTgeoTgeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AcontainsTgeoTgeoPhysicalFunction.cpp new file mode 100644 index 0000000000..5bacc09a11 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AcontainsTgeoTgeoPhysicalFunction.cpp @@ -0,0 +1,91 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +AcontainsTgeoTgeoPhysicalFunction::AcontainsTgeoTgeoPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction ts1, PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction ts2) +{ + paramFns.reserve(6); + paramFns.push_back(std::move(lon1)); + paramFns.push_back(std::move(lat1)); + paramFns.push_back(std::move(ts1)); + paramFns.push_back(std::move(lon2)); + paramFns.push_back(std::move(lat2)); + paramFns.push_back(std::move(ts2)); +} + +VarVal AcontainsTgeoTgeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto lon1 = paramFns[0].execute(record, arena).cast(); + auto lat1 = paramFns[1].execute(record, arena).cast(); + auto ts1 = paramFns[2].execute(record, arena).cast(); + auto lon2 = paramFns[3].execute(record, arena).cast(); + auto lat2 = paramFns[4].execute(record, arena).cast(); + auto ts2 = paramFns[5].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](double lon1, double lat1, uint64_t ts1, + double lon2, double lat2, uint64_t ts2) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string wkt1 = fmt::format("SRID=4326;POINT({},{})@{}", lon1, lat1, ts1); + Temporal* t1 = tgeompoint_in(wkt1.c_str()); + if (!t1) return 0.0; + std::string wkt2 = fmt::format("SRID=4326;POINT({},{})@{}", lon2, lat2, ts2); + Temporal* t2 = tgeompoint_in(wkt2.c_str()); + if (!t2) { free(t1); return 0.0; } + int r = acontains_tgeo_tgeo(t1, t2); + free(t1); free(t2); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + lon1, lat1, ts1, lon2, lat2, ts2); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAcontainsTgeoTgeoPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 6, + "AcontainsTgeoTgeoPhysicalFunction requires 6 children but got {}", + arguments.childFunctions.size()); + return AcontainsTgeoTgeoPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4]), + std::move(arguments.childFunctions[5])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AcoversTgeoTgeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AcoversTgeoTgeoPhysicalFunction.cpp new file mode 100644 index 0000000000..8898176bd1 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AcoversTgeoTgeoPhysicalFunction.cpp @@ -0,0 +1,91 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +AcoversTgeoTgeoPhysicalFunction::AcoversTgeoTgeoPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction ts1, PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction ts2) +{ + paramFns.reserve(6); + paramFns.push_back(std::move(lon1)); + paramFns.push_back(std::move(lat1)); + paramFns.push_back(std::move(ts1)); + paramFns.push_back(std::move(lon2)); + paramFns.push_back(std::move(lat2)); + paramFns.push_back(std::move(ts2)); +} + +VarVal AcoversTgeoTgeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto lon1 = paramFns[0].execute(record, arena).cast(); + auto lat1 = paramFns[1].execute(record, arena).cast(); + auto ts1 = paramFns[2].execute(record, arena).cast(); + auto lon2 = paramFns[3].execute(record, arena).cast(); + auto lat2 = paramFns[4].execute(record, arena).cast(); + auto ts2 = paramFns[5].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](double lon1, double lat1, uint64_t ts1, + double lon2, double lat2, uint64_t ts2) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string wkt1 = fmt::format("SRID=4326;POINT({},{})@{}", lon1, lat1, ts1); + Temporal* t1 = tgeompoint_in(wkt1.c_str()); + if (!t1) return 0.0; + std::string wkt2 = fmt::format("SRID=4326;POINT({},{})@{}", lon2, lat2, ts2); + Temporal* t2 = tgeompoint_in(wkt2.c_str()); + if (!t2) { free(t1); return 0.0; } + int r = acovers_tgeo_tgeo(t1, t2); + free(t1); free(t2); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + lon1, lat1, ts1, lon2, lat2, ts2); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAcoversTgeoTgeoPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 6, + "AcoversTgeoTgeoPhysicalFunction requires 6 children but got {}", + arguments.childFunctions.size()); + return AcoversTgeoTgeoPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4]), + std::move(arguments.childFunctions[5])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AdisjointTgeoTgeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AdisjointTgeoTgeoPhysicalFunction.cpp new file mode 100644 index 0000000000..aeba15bf79 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AdisjointTgeoTgeoPhysicalFunction.cpp @@ -0,0 +1,91 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +AdisjointTgeoTgeoPhysicalFunction::AdisjointTgeoTgeoPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction ts1, PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction ts2) +{ + paramFns.reserve(6); + paramFns.push_back(std::move(lon1)); + paramFns.push_back(std::move(lat1)); + paramFns.push_back(std::move(ts1)); + paramFns.push_back(std::move(lon2)); + paramFns.push_back(std::move(lat2)); + paramFns.push_back(std::move(ts2)); +} + +VarVal AdisjointTgeoTgeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto lon1 = paramFns[0].execute(record, arena).cast(); + auto lat1 = paramFns[1].execute(record, arena).cast(); + auto ts1 = paramFns[2].execute(record, arena).cast(); + auto lon2 = paramFns[3].execute(record, arena).cast(); + auto lat2 = paramFns[4].execute(record, arena).cast(); + auto ts2 = paramFns[5].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](double lon1, double lat1, uint64_t ts1, + double lon2, double lat2, uint64_t ts2) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string wkt1 = fmt::format("SRID=4326;POINT({},{})@{}", lon1, lat1, ts1); + Temporal* t1 = tgeompoint_in(wkt1.c_str()); + if (!t1) return 0.0; + std::string wkt2 = fmt::format("SRID=4326;POINT({},{})@{}", lon2, lat2, ts2); + Temporal* t2 = tgeompoint_in(wkt2.c_str()); + if (!t2) { free(t1); return 0.0; } + int r = adisjoint_tgeo_tgeo(t1, t2); + free(t1); free(t2); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + lon1, lat1, ts1, lon2, lat2, ts2); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAdisjointTgeoTgeoPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 6, + "AdisjointTgeoTgeoPhysicalFunction requires 6 children but got {}", + arguments.childFunctions.size()); + return AdisjointTgeoTgeoPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4]), + std::move(arguments.childFunctions[5])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AintersectsTgeoTgeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AintersectsTgeoTgeoPhysicalFunction.cpp new file mode 100644 index 0000000000..8ddff7ddee --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AintersectsTgeoTgeoPhysicalFunction.cpp @@ -0,0 +1,91 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +AintersectsTgeoTgeoPhysicalFunction::AintersectsTgeoTgeoPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction ts1, PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction ts2) +{ + paramFns.reserve(6); + paramFns.push_back(std::move(lon1)); + paramFns.push_back(std::move(lat1)); + paramFns.push_back(std::move(ts1)); + paramFns.push_back(std::move(lon2)); + paramFns.push_back(std::move(lat2)); + paramFns.push_back(std::move(ts2)); +} + +VarVal AintersectsTgeoTgeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto lon1 = paramFns[0].execute(record, arena).cast(); + auto lat1 = paramFns[1].execute(record, arena).cast(); + auto ts1 = paramFns[2].execute(record, arena).cast(); + auto lon2 = paramFns[3].execute(record, arena).cast(); + auto lat2 = paramFns[4].execute(record, arena).cast(); + auto ts2 = paramFns[5].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](double lon1, double lat1, uint64_t ts1, + double lon2, double lat2, uint64_t ts2) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string wkt1 = fmt::format("SRID=4326;POINT({},{})@{}", lon1, lat1, ts1); + Temporal* t1 = tgeompoint_in(wkt1.c_str()); + if (!t1) return 0.0; + std::string wkt2 = fmt::format("SRID=4326;POINT({},{})@{}", lon2, lat2, ts2); + Temporal* t2 = tgeompoint_in(wkt2.c_str()); + if (!t2) { free(t1); return 0.0; } + int r = aintersects_tgeo_tgeo(t1, t2); + free(t1); free(t2); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + lon1, lat1, ts1, lon2, lat2, ts2); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAintersectsTgeoTgeoPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 6, + "AintersectsTgeoTgeoPhysicalFunction requires 6 children but got {}", + arguments.childFunctions.size()); + return AintersectsTgeoTgeoPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4]), + std::move(arguments.childFunctions[5])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysEqTgeoTgeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysEqTgeoTgeoPhysicalFunction.cpp new file mode 100644 index 0000000000..5a019e301f --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysEqTgeoTgeoPhysicalFunction.cpp @@ -0,0 +1,91 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +AlwaysEqTgeoTgeoPhysicalFunction::AlwaysEqTgeoTgeoPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction ts1, PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction ts2) +{ + paramFns.reserve(6); + paramFns.push_back(std::move(lon1)); + paramFns.push_back(std::move(lat1)); + paramFns.push_back(std::move(ts1)); + paramFns.push_back(std::move(lon2)); + paramFns.push_back(std::move(lat2)); + paramFns.push_back(std::move(ts2)); +} + +VarVal AlwaysEqTgeoTgeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto lon1 = paramFns[0].execute(record, arena).cast(); + auto lat1 = paramFns[1].execute(record, arena).cast(); + auto ts1 = paramFns[2].execute(record, arena).cast(); + auto lon2 = paramFns[3].execute(record, arena).cast(); + auto lat2 = paramFns[4].execute(record, arena).cast(); + auto ts2 = paramFns[5].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](double lon1, double lat1, uint64_t ts1, + double lon2, double lat2, uint64_t ts2) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string wkt1 = fmt::format("SRID=4326;POINT({},{})@{}", lon1, lat1, ts1); + Temporal* t1 = tgeompoint_in(wkt1.c_str()); + if (!t1) return 0.0; + std::string wkt2 = fmt::format("SRID=4326;POINT({},{})@{}", lon2, lat2, ts2); + Temporal* t2 = tgeompoint_in(wkt2.c_str()); + if (!t2) { free(t1); return 0.0; } + int r = always_eq_tgeo_tgeo(t1, t2); + free(t1); free(t2); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + lon1, lat1, ts1, lon2, lat2, ts2); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysEqTgeoTgeoPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 6, + "AlwaysEqTgeoTgeoPhysicalFunction requires 6 children but got {}", + arguments.childFunctions.size()); + return AlwaysEqTgeoTgeoPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4]), + std::move(arguments.childFunctions[5])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysNeTgeoTgeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysNeTgeoTgeoPhysicalFunction.cpp new file mode 100644 index 0000000000..bd05ab175c --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysNeTgeoTgeoPhysicalFunction.cpp @@ -0,0 +1,91 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +AlwaysNeTgeoTgeoPhysicalFunction::AlwaysNeTgeoTgeoPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction ts1, PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction ts2) +{ + paramFns.reserve(6); + paramFns.push_back(std::move(lon1)); + paramFns.push_back(std::move(lat1)); + paramFns.push_back(std::move(ts1)); + paramFns.push_back(std::move(lon2)); + paramFns.push_back(std::move(lat2)); + paramFns.push_back(std::move(ts2)); +} + +VarVal AlwaysNeTgeoTgeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto lon1 = paramFns[0].execute(record, arena).cast(); + auto lat1 = paramFns[1].execute(record, arena).cast(); + auto ts1 = paramFns[2].execute(record, arena).cast(); + auto lon2 = paramFns[3].execute(record, arena).cast(); + auto lat2 = paramFns[4].execute(record, arena).cast(); + auto ts2 = paramFns[5].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](double lon1, double lat1, uint64_t ts1, + double lon2, double lat2, uint64_t ts2) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string wkt1 = fmt::format("SRID=4326;POINT({},{})@{}", lon1, lat1, ts1); + Temporal* t1 = tgeompoint_in(wkt1.c_str()); + if (!t1) return 0.0; + std::string wkt2 = fmt::format("SRID=4326;POINT({},{})@{}", lon2, lat2, ts2); + Temporal* t2 = tgeompoint_in(wkt2.c_str()); + if (!t2) { free(t1); return 0.0; } + int r = always_ne_tgeo_tgeo(t1, t2); + free(t1); free(t2); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + lon1, lat1, ts1, lon2, lat2, ts2); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysNeTgeoTgeoPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 6, + "AlwaysNeTgeoTgeoPhysicalFunction requires 6 children but got {}", + arguments.childFunctions.size()); + return AlwaysNeTgeoTgeoPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4]), + std::move(arguments.childFunctions[5])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AtouchesTgeoTgeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AtouchesTgeoTgeoPhysicalFunction.cpp new file mode 100644 index 0000000000..30434656d5 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AtouchesTgeoTgeoPhysicalFunction.cpp @@ -0,0 +1,91 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +AtouchesTgeoTgeoPhysicalFunction::AtouchesTgeoTgeoPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction ts1, PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction ts2) +{ + paramFns.reserve(6); + paramFns.push_back(std::move(lon1)); + paramFns.push_back(std::move(lat1)); + paramFns.push_back(std::move(ts1)); + paramFns.push_back(std::move(lon2)); + paramFns.push_back(std::move(lat2)); + paramFns.push_back(std::move(ts2)); +} + +VarVal AtouchesTgeoTgeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto lon1 = paramFns[0].execute(record, arena).cast(); + auto lat1 = paramFns[1].execute(record, arena).cast(); + auto ts1 = paramFns[2].execute(record, arena).cast(); + auto lon2 = paramFns[3].execute(record, arena).cast(); + auto lat2 = paramFns[4].execute(record, arena).cast(); + auto ts2 = paramFns[5].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](double lon1, double lat1, uint64_t ts1, + double lon2, double lat2, uint64_t ts2) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string wkt1 = fmt::format("SRID=4326;POINT({},{})@{}", lon1, lat1, ts1); + Temporal* t1 = tgeompoint_in(wkt1.c_str()); + if (!t1) return 0.0; + std::string wkt2 = fmt::format("SRID=4326;POINT({},{})@{}", lon2, lat2, ts2); + Temporal* t2 = tgeompoint_in(wkt2.c_str()); + if (!t2) { free(t1); return 0.0; } + int r = atouches_tgeo_tgeo(t1, t2); + free(t1); free(t2); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + lon1, lat1, ts1, lon2, lat2, ts2); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAtouchesTgeoTgeoPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 6, + "AtouchesTgeoTgeoPhysicalFunction requires 6 children but got {}", + arguments.childFunctions.size()); + return AtouchesTgeoTgeoPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4]), + std::move(arguments.childFunctions[5])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt index 9b98275811..a928b78345 100644 --- a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt @@ -476,6 +476,20 @@ add_plugin(GeomFromHexewkb PhysicalFunction nes-physical-operators GeomFromHexew add_plugin(GeoTransformPipeline PhysicalFunction nes-physical-operators GeoTransformPipelinePhysicalFunction.cpp) add_plugin(GeomMinBoundingCenter PhysicalFunction nes-physical-operators GeomMinBoundingCenterPhysicalFunction.cpp) add_plugin(GeomMinBoundingRadius PhysicalFunction nes-physical-operators GeomMinBoundingRadiusPhysicalFunction.cpp) +add_plugin(EverEqTgeoTgeo PhysicalFunction nes-physical-operators EverEqTgeoTgeoPhysicalFunction.cpp) +add_plugin(EverNeTgeoTgeo PhysicalFunction nes-physical-operators EverNeTgeoTgeoPhysicalFunction.cpp) +add_plugin(AlwaysEqTgeoTgeo PhysicalFunction nes-physical-operators AlwaysEqTgeoTgeoPhysicalFunction.cpp) +add_plugin(AlwaysNeTgeoTgeo PhysicalFunction nes-physical-operators AlwaysNeTgeoTgeoPhysicalFunction.cpp) +add_plugin(EintersectsTgeoTgeo PhysicalFunction nes-physical-operators EintersectsTgeoTgeoPhysicalFunction.cpp) +add_plugin(EcoversTgeoTgeo PhysicalFunction nes-physical-operators EcoversTgeoTgeoPhysicalFunction.cpp) +add_plugin(EdisjointTgeoTgeo PhysicalFunction nes-physical-operators EdisjointTgeoTgeoPhysicalFunction.cpp) +add_plugin(EcontainsTgeoTgeo PhysicalFunction nes-physical-operators EcontainsTgeoTgeoPhysicalFunction.cpp) +add_plugin(EtouchesTgeoTgeo PhysicalFunction nes-physical-operators EtouchesTgeoTgeoPhysicalFunction.cpp) +add_plugin(AintersectsTgeoTgeo PhysicalFunction nes-physical-operators AintersectsTgeoTgeoPhysicalFunction.cpp) +add_plugin(AcoversTgeoTgeo PhysicalFunction nes-physical-operators AcoversTgeoTgeoPhysicalFunction.cpp) +add_plugin(AdisjointTgeoTgeo PhysicalFunction nes-physical-operators AdisjointTgeoTgeoPhysicalFunction.cpp) +add_plugin(AcontainsTgeoTgeo PhysicalFunction nes-physical-operators AcontainsTgeoTgeoPhysicalFunction.cpp) +add_plugin(AtouchesTgeoTgeo PhysicalFunction nes-physical-operators AtouchesTgeoTgeoPhysicalFunction.cpp) add_plugin(GeomRelatePattern PhysicalFunction nes-physical-operators GeomRelatePatternPhysicalFunction.cpp) add_plugin(GeomIntersects2d PhysicalFunction nes-physical-operators GeomIntersects2dPhysicalFunction.cpp) add_plugin(GeomDwithin2d PhysicalFunction nes-physical-operators GeomDwithin2dPhysicalFunction.cpp) diff --git a/nes-physical-operators/src/Functions/Meos/EcontainsTgeoTgeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EcontainsTgeoTgeoPhysicalFunction.cpp new file mode 100644 index 0000000000..5ca82ffa6d --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EcontainsTgeoTgeoPhysicalFunction.cpp @@ -0,0 +1,91 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +EcontainsTgeoTgeoPhysicalFunction::EcontainsTgeoTgeoPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction ts1, PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction ts2) +{ + paramFns.reserve(6); + paramFns.push_back(std::move(lon1)); + paramFns.push_back(std::move(lat1)); + paramFns.push_back(std::move(ts1)); + paramFns.push_back(std::move(lon2)); + paramFns.push_back(std::move(lat2)); + paramFns.push_back(std::move(ts2)); +} + +VarVal EcontainsTgeoTgeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto lon1 = paramFns[0].execute(record, arena).cast(); + auto lat1 = paramFns[1].execute(record, arena).cast(); + auto ts1 = paramFns[2].execute(record, arena).cast(); + auto lon2 = paramFns[3].execute(record, arena).cast(); + auto lat2 = paramFns[4].execute(record, arena).cast(); + auto ts2 = paramFns[5].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](double lon1, double lat1, uint64_t ts1, + double lon2, double lat2, uint64_t ts2) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string wkt1 = fmt::format("SRID=4326;POINT({},{})@{}", lon1, lat1, ts1); + Temporal* t1 = tgeompoint_in(wkt1.c_str()); + if (!t1) return 0.0; + std::string wkt2 = fmt::format("SRID=4326;POINT({},{})@{}", lon2, lat2, ts2); + Temporal* t2 = tgeompoint_in(wkt2.c_str()); + if (!t2) { free(t1); return 0.0; } + int r = econtains_tgeo_tgeo(t1, t2); + free(t1); free(t2); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + lon1, lat1, ts1, lon2, lat2, ts2); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEcontainsTgeoTgeoPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 6, + "EcontainsTgeoTgeoPhysicalFunction requires 6 children but got {}", + arguments.childFunctions.size()); + return EcontainsTgeoTgeoPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4]), + std::move(arguments.childFunctions[5])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EcoversTgeoTgeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EcoversTgeoTgeoPhysicalFunction.cpp new file mode 100644 index 0000000000..dd35059bc7 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EcoversTgeoTgeoPhysicalFunction.cpp @@ -0,0 +1,91 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +EcoversTgeoTgeoPhysicalFunction::EcoversTgeoTgeoPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction ts1, PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction ts2) +{ + paramFns.reserve(6); + paramFns.push_back(std::move(lon1)); + paramFns.push_back(std::move(lat1)); + paramFns.push_back(std::move(ts1)); + paramFns.push_back(std::move(lon2)); + paramFns.push_back(std::move(lat2)); + paramFns.push_back(std::move(ts2)); +} + +VarVal EcoversTgeoTgeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto lon1 = paramFns[0].execute(record, arena).cast(); + auto lat1 = paramFns[1].execute(record, arena).cast(); + auto ts1 = paramFns[2].execute(record, arena).cast(); + auto lon2 = paramFns[3].execute(record, arena).cast(); + auto lat2 = paramFns[4].execute(record, arena).cast(); + auto ts2 = paramFns[5].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](double lon1, double lat1, uint64_t ts1, + double lon2, double lat2, uint64_t ts2) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string wkt1 = fmt::format("SRID=4326;POINT({},{})@{}", lon1, lat1, ts1); + Temporal* t1 = tgeompoint_in(wkt1.c_str()); + if (!t1) return 0.0; + std::string wkt2 = fmt::format("SRID=4326;POINT({},{})@{}", lon2, lat2, ts2); + Temporal* t2 = tgeompoint_in(wkt2.c_str()); + if (!t2) { free(t1); return 0.0; } + int r = ecovers_tgeo_tgeo(t1, t2); + free(t1); free(t2); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + lon1, lat1, ts1, lon2, lat2, ts2); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEcoversTgeoTgeoPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 6, + "EcoversTgeoTgeoPhysicalFunction requires 6 children but got {}", + arguments.childFunctions.size()); + return EcoversTgeoTgeoPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4]), + std::move(arguments.childFunctions[5])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EdisjointTgeoTgeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EdisjointTgeoTgeoPhysicalFunction.cpp new file mode 100644 index 0000000000..1708e377b0 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EdisjointTgeoTgeoPhysicalFunction.cpp @@ -0,0 +1,91 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +EdisjointTgeoTgeoPhysicalFunction::EdisjointTgeoTgeoPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction ts1, PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction ts2) +{ + paramFns.reserve(6); + paramFns.push_back(std::move(lon1)); + paramFns.push_back(std::move(lat1)); + paramFns.push_back(std::move(ts1)); + paramFns.push_back(std::move(lon2)); + paramFns.push_back(std::move(lat2)); + paramFns.push_back(std::move(ts2)); +} + +VarVal EdisjointTgeoTgeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto lon1 = paramFns[0].execute(record, arena).cast(); + auto lat1 = paramFns[1].execute(record, arena).cast(); + auto ts1 = paramFns[2].execute(record, arena).cast(); + auto lon2 = paramFns[3].execute(record, arena).cast(); + auto lat2 = paramFns[4].execute(record, arena).cast(); + auto ts2 = paramFns[5].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](double lon1, double lat1, uint64_t ts1, + double lon2, double lat2, uint64_t ts2) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string wkt1 = fmt::format("SRID=4326;POINT({},{})@{}", lon1, lat1, ts1); + Temporal* t1 = tgeompoint_in(wkt1.c_str()); + if (!t1) return 0.0; + std::string wkt2 = fmt::format("SRID=4326;POINT({},{})@{}", lon2, lat2, ts2); + Temporal* t2 = tgeompoint_in(wkt2.c_str()); + if (!t2) { free(t1); return 0.0; } + int r = edisjoint_tgeo_tgeo(t1, t2); + free(t1); free(t2); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + lon1, lat1, ts1, lon2, lat2, ts2); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEdisjointTgeoTgeoPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 6, + "EdisjointTgeoTgeoPhysicalFunction requires 6 children but got {}", + arguments.childFunctions.size()); + return EdisjointTgeoTgeoPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4]), + std::move(arguments.childFunctions[5])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EintersectsTgeoTgeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EintersectsTgeoTgeoPhysicalFunction.cpp new file mode 100644 index 0000000000..f1b9a19f49 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EintersectsTgeoTgeoPhysicalFunction.cpp @@ -0,0 +1,91 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +EintersectsTgeoTgeoPhysicalFunction::EintersectsTgeoTgeoPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction ts1, PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction ts2) +{ + paramFns.reserve(6); + paramFns.push_back(std::move(lon1)); + paramFns.push_back(std::move(lat1)); + paramFns.push_back(std::move(ts1)); + paramFns.push_back(std::move(lon2)); + paramFns.push_back(std::move(lat2)); + paramFns.push_back(std::move(ts2)); +} + +VarVal EintersectsTgeoTgeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto lon1 = paramFns[0].execute(record, arena).cast(); + auto lat1 = paramFns[1].execute(record, arena).cast(); + auto ts1 = paramFns[2].execute(record, arena).cast(); + auto lon2 = paramFns[3].execute(record, arena).cast(); + auto lat2 = paramFns[4].execute(record, arena).cast(); + auto ts2 = paramFns[5].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](double lon1, double lat1, uint64_t ts1, + double lon2, double lat2, uint64_t ts2) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string wkt1 = fmt::format("SRID=4326;POINT({},{})@{}", lon1, lat1, ts1); + Temporal* t1 = tgeompoint_in(wkt1.c_str()); + if (!t1) return 0.0; + std::string wkt2 = fmt::format("SRID=4326;POINT({},{})@{}", lon2, lat2, ts2); + Temporal* t2 = tgeompoint_in(wkt2.c_str()); + if (!t2) { free(t1); return 0.0; } + int r = eintersects_tgeo_tgeo(t1, t2); + free(t1); free(t2); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + lon1, lat1, ts1, lon2, lat2, ts2); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEintersectsTgeoTgeoPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 6, + "EintersectsTgeoTgeoPhysicalFunction requires 6 children but got {}", + arguments.childFunctions.size()); + return EintersectsTgeoTgeoPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4]), + std::move(arguments.childFunctions[5])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EtouchesTgeoTgeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EtouchesTgeoTgeoPhysicalFunction.cpp new file mode 100644 index 0000000000..502df9fc65 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EtouchesTgeoTgeoPhysicalFunction.cpp @@ -0,0 +1,91 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +EtouchesTgeoTgeoPhysicalFunction::EtouchesTgeoTgeoPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction ts1, PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction ts2) +{ + paramFns.reserve(6); + paramFns.push_back(std::move(lon1)); + paramFns.push_back(std::move(lat1)); + paramFns.push_back(std::move(ts1)); + paramFns.push_back(std::move(lon2)); + paramFns.push_back(std::move(lat2)); + paramFns.push_back(std::move(ts2)); +} + +VarVal EtouchesTgeoTgeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto lon1 = paramFns[0].execute(record, arena).cast(); + auto lat1 = paramFns[1].execute(record, arena).cast(); + auto ts1 = paramFns[2].execute(record, arena).cast(); + auto lon2 = paramFns[3].execute(record, arena).cast(); + auto lat2 = paramFns[4].execute(record, arena).cast(); + auto ts2 = paramFns[5].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](double lon1, double lat1, uint64_t ts1, + double lon2, double lat2, uint64_t ts2) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string wkt1 = fmt::format("SRID=4326;POINT({},{})@{}", lon1, lat1, ts1); + Temporal* t1 = tgeompoint_in(wkt1.c_str()); + if (!t1) return 0.0; + std::string wkt2 = fmt::format("SRID=4326;POINT({},{})@{}", lon2, lat2, ts2); + Temporal* t2 = tgeompoint_in(wkt2.c_str()); + if (!t2) { free(t1); return 0.0; } + int r = etouches_tgeo_tgeo(t1, t2); + free(t1); free(t2); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + lon1, lat1, ts1, lon2, lat2, ts2); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEtouchesTgeoTgeoPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 6, + "EtouchesTgeoTgeoPhysicalFunction requires 6 children but got {}", + arguments.childFunctions.size()); + return EtouchesTgeoTgeoPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4]), + std::move(arguments.childFunctions[5])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverEqTgeoTgeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverEqTgeoTgeoPhysicalFunction.cpp new file mode 100644 index 0000000000..101c1833ed --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverEqTgeoTgeoPhysicalFunction.cpp @@ -0,0 +1,91 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +EverEqTgeoTgeoPhysicalFunction::EverEqTgeoTgeoPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction ts1, PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction ts2) +{ + paramFns.reserve(6); + paramFns.push_back(std::move(lon1)); + paramFns.push_back(std::move(lat1)); + paramFns.push_back(std::move(ts1)); + paramFns.push_back(std::move(lon2)); + paramFns.push_back(std::move(lat2)); + paramFns.push_back(std::move(ts2)); +} + +VarVal EverEqTgeoTgeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto lon1 = paramFns[0].execute(record, arena).cast(); + auto lat1 = paramFns[1].execute(record, arena).cast(); + auto ts1 = paramFns[2].execute(record, arena).cast(); + auto lon2 = paramFns[3].execute(record, arena).cast(); + auto lat2 = paramFns[4].execute(record, arena).cast(); + auto ts2 = paramFns[5].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](double lon1, double lat1, uint64_t ts1, + double lon2, double lat2, uint64_t ts2) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string wkt1 = fmt::format("SRID=4326;POINT({},{})@{}", lon1, lat1, ts1); + Temporal* t1 = tgeompoint_in(wkt1.c_str()); + if (!t1) return 0.0; + std::string wkt2 = fmt::format("SRID=4326;POINT({},{})@{}", lon2, lat2, ts2); + Temporal* t2 = tgeompoint_in(wkt2.c_str()); + if (!t2) { free(t1); return 0.0; } + int r = ever_eq_tgeo_tgeo(t1, t2); + free(t1); free(t2); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + lon1, lat1, ts1, lon2, lat2, ts2); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverEqTgeoTgeoPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 6, + "EverEqTgeoTgeoPhysicalFunction requires 6 children but got {}", + arguments.childFunctions.size()); + return EverEqTgeoTgeoPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4]), + std::move(arguments.childFunctions[5])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverNeTgeoTgeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverNeTgeoTgeoPhysicalFunction.cpp new file mode 100644 index 0000000000..07e36fb39e --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverNeTgeoTgeoPhysicalFunction.cpp @@ -0,0 +1,91 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +EverNeTgeoTgeoPhysicalFunction::EverNeTgeoTgeoPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction ts1, PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction ts2) +{ + paramFns.reserve(6); + paramFns.push_back(std::move(lon1)); + paramFns.push_back(std::move(lat1)); + paramFns.push_back(std::move(ts1)); + paramFns.push_back(std::move(lon2)); + paramFns.push_back(std::move(lat2)); + paramFns.push_back(std::move(ts2)); +} + +VarVal EverNeTgeoTgeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto lon1 = paramFns[0].execute(record, arena).cast(); + auto lat1 = paramFns[1].execute(record, arena).cast(); + auto ts1 = paramFns[2].execute(record, arena).cast(); + auto lon2 = paramFns[3].execute(record, arena).cast(); + auto lat2 = paramFns[4].execute(record, arena).cast(); + auto ts2 = paramFns[5].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](double lon1, double lat1, uint64_t ts1, + double lon2, double lat2, uint64_t ts2) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string wkt1 = fmt::format("SRID=4326;POINT({},{})@{}", lon1, lat1, ts1); + Temporal* t1 = tgeompoint_in(wkt1.c_str()); + if (!t1) return 0.0; + std::string wkt2 = fmt::format("SRID=4326;POINT({},{})@{}", lon2, lat2, ts2); + Temporal* t2 = tgeompoint_in(wkt2.c_str()); + if (!t2) { free(t1); return 0.0; } + int r = ever_ne_tgeo_tgeo(t1, t2); + free(t1); free(t2); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + lon1, lat1, ts1, lon2, lat2, ts2); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverNeTgeoTgeoPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 6, + "EverNeTgeoTgeoPhysicalFunction requires 6 children but got {}", + arguments.childFunctions.size()); + return EverNeTgeoTgeoPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4]), + std::move(arguments.childFunctions[5])); +} + +} // namespace NES diff --git a/nes-sql-parser/AntlrSQL.g4 b/nes-sql-parser/AntlrSQL.g4 index a85c3c142b..a9615339df 100644 --- a/nes-sql-parser/AntlrSQL.g4 +++ b/nes-sql-parser/AntlrSQL.g4 @@ -295,7 +295,7 @@ timeUnit: MS timestampParameter: name=identifier; -functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT | TGE_TTEXT_TEXT | TGE_TEXT_TTEXT | TGT_TTEXT_TEXT | TGT_TEXT_TTEXT | TLE_TTEXT_TEXT | TLE_TEXT_TTEXT | TLT_TTEXT_TEXT | TLT_TEXT_TTEXT | TTEXT_UPPER | TTEXT_LOWER | TTEXT_INITCAP | TEXTCAT_TTEXT_TEXT | TEXTCAT_TEXT_TTEXT | TEXTCAT_TTEXT_TTEXT | GEOM_LENGTH | GEOM_PERIMETER | GEOM_AZIMUTH | GEOG_AREA | GEOG_LENGTH | GEOG_PERIMETER | GEOM_IS_EMPTY | AINTERSECTS_TGEO_GEO | ACOVERS_TGEO_GEO | ADISJOINT_TGEO_GEO | ADWITHIN_TGEO_GEO | EINTERSECTS_TGEO_GEO | ETOUCHES_TGEO_GEO | ECONTAINS_TGEO_GEO | ACONTAINS_TGEO_GEO | ATOUCHES_TGEO_GEO | GEO_NUM_POINTS | GEO_NUM_GEOS | GEO_SRID | GEO_IS_UNITARY | GEO_EQUALS | GEO_SAME | GEOG_DISTANCE | NAD_TGEO_GEO | EVER_EQ_TGEO_GEO | EVER_NE_TGEO_GEO | ALWAYS_EQ_TGEO_GEO | ALWAYS_NE_TGEO_GEO | GEOG_INTERSECTS | GEOG_DWITHIN | ACOVERS_GEO_TGEO | GEOM_INTERSECTS | GEOM_DWITHIN | H3_GS_POINT_TO_CELL | EVER_EQ_TH3INDEX_H3INDEX | EVER_NE_TH3INDEX_H3INDEX | ALWAYS_EQ_TH3INDEX_H3INDEX | ALWAYS_NE_TH3INDEX_H3INDEX | TH3INDEX_GET_RESOLUTION | TH3INDEX_GET_BASE_CELL_NUMBER | TH3INDEX_IS_VALID_CELL | TH3INDEX_IS_PENTAGON | TH3INDEX_CELL_TO_PARENT_NEXT | TH3INDEX_CELL_TO_CENTER_CHILD_NEXT | TH3INDEX_CELL_TO_PARENT | TH3INDEX_CELL_TO_CENTER_CHILD | TH3INDEX_CELL_TO_CHILD_POS | TH3INDEX_ARE_NEIGHBOR_CELLS | TH3INDEX_GRID_DISTANCE | EINTERSECTS_TCBUFFER_GEO | AINTERSECTS_TCBUFFER_GEO | ECOVERS_TCBUFFER_GEO | ACOVERS_TCBUFFER_GEO | EDISJOINT_TCBUFFER_GEO | ADISJOINT_TCBUFFER_GEO | ETOUCHES_TCBUFFER_GEO | ATOUCHES_TCBUFFER_GEO | ECONTAINS_TCBUFFER_GEO | ACONTAINS_TCBUFFER_GEO | NAD_TCBUFFER_GEO | EDWITHIN_TCBUFFER_GEO | ADWITHIN_TCBUFFER_GEO | EINTERSECTS_TCBUFFER_CBUFFER | AINTERSECTS_TCBUFFER_CBUFFER | ECOVERS_TCBUFFER_CBUFFER | ACOVERS_TCBUFFER_CBUFFER | EDISJOINT_TCBUFFER_CBUFFER | ADISJOINT_TCBUFFER_CBUFFER | ETOUCHES_TCBUFFER_CBUFFER | ATOUCHES_TCBUFFER_CBUFFER | ECONTAINS_TCBUFFER_CBUFFER | ACONTAINS_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_CBUFFER | ALWAYS_EQ_TCBUFFER_CBUFFER | EVER_NE_TCBUFFER_CBUFFER | ALWAYS_NE_TCBUFFER_CBUFFER | NAD_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_TCBUFFER | ALWAYS_EQ_TCBUFFER_TCBUFFER | EVER_NE_TCBUFFER_TCBUFFER | ALWAYS_NE_TCBUFFER_TCBUFFER | EINTERSECTS_TCBUFFER_TCBUFFER | AINTERSECTS_TCBUFFER_TCBUFFER | ECOVERS_TCBUFFER_TCBUFFER | ACOVERS_TCBUFFER_TCBUFFER | ADISJOINT_TCBUFFER_TCBUFFER | ETOUCHES_TCBUFFER_TCBUFFER | ATOUCHES_TCBUFFER_TCBUFFER | NAD_TCBUFFER_TCBUFFER | EDWITHIN_TCBUFFER_TCBUFFER | ADWITHIN_TCBUFFER_TCBUFFER | MINDISTANCE_TCBUFFER_TCBUFFER | NAD_TNPOINT_GEO | EVER_EQ_TNPOINT_NPOINT | ALWAYS_EQ_TNPOINT_NPOINT | EVER_NE_TNPOINT_NPOINT | ALWAYS_NE_TNPOINT_NPOINT | NAD_TNPOINT_NPOINT | EVER_EQ_NPOINT_TNPOINT | ALWAYS_EQ_NPOINT_TNPOINT | EVER_NE_NPOINT_TNPOINT | ALWAYS_NE_NPOINT_TNPOINT | EVER_EQ_TNPOINT_TNPOINT | ALWAYS_EQ_TNPOINT_TNPOINT | EVER_NE_TNPOINT_TNPOINT | ALWAYS_NE_TNPOINT_TNPOINT | NAD_TNPOINT_TNPOINT | NAD_TPOSE_GEO | EVER_EQ_TPOSE_POSE | ALWAYS_EQ_TPOSE_POSE | EVER_NE_TPOSE_POSE | ALWAYS_NE_TPOSE_POSE | NAD_TPOSE_POSE | EVER_EQ_POSE_TPOSE | ALWAYS_EQ_POSE_TPOSE | EVER_NE_POSE_TPOSE | ALWAYS_NE_POSE_TPOSE | EVER_EQ_TPOSE_TPOSE | ALWAYS_EQ_TPOSE_TPOSE | EVER_NE_TPOSE_TPOSE | ALWAYS_NE_TPOSE_TPOSE | NAD_TPOSE_TPOSE | EVER_EQ_TRGEOMETRY_GEO | ALWAYS_EQ_TRGEOMETRY_GEO | EVER_NE_TRGEOMETRY_GEO | ALWAYS_NE_TRGEOMETRY_GEO | NAD_TRGEOMETRY_GEO | EVER_EQ_GEO_TRGEOMETRY | ALWAYS_EQ_GEO_TRGEOMETRY | EVER_NE_GEO_TRGEOMETRY | ALWAYS_NE_GEO_TRGEOMETRY | EVER_EQ_TRGEOMETRY_TRGEOMETRY | ALWAYS_EQ_TRGEOMETRY_TRGEOMETRY | EVER_NE_TRGEOMETRY_TRGEOMETRY | ALWAYS_NE_TRGEOMETRY_TRGEOMETRY | NAD_TRGEOMETRY_TRGEOMETRY | EINTERSECTS_TPCPOINT_GEO | NAD_TPCPOINT_GEO | QUADBIN_POINT_TO_CELL | QUADBIN_IS_VALID_CELL | QUADBIN_GET_RESOLUTION | QUADBIN_CELL_AREA | QUADBIN_CELL_TO_QUADKEY | QUADBIN_CELL_TO_PARENT | QUADBIN_TILE_TO_CELL | EVER_EQ_TJSONB_JSONB | ALWAYS_EQ_TJSONB_JSONB | EVER_NE_TJSONB_JSONB | ALWAYS_NE_TJSONB_JSONB | EVER_EQ_TJSONB_TJSONB | ALWAYS_EQ_TJSONB_TJSONB | EVER_NE_TJSONB_TJSONB | ALWAYS_NE_TJSONB_TJSONB | GEOM_BOUNDARY | GEOM_CENTROID | GEOM_CONVEX_HULL | GEO_REVERSE | GEO_POINTS | GEOM_UNARY_UNION | GEOM_DIFFERENCE2D | GEOM_INTERSECTION2D | GEOM_SHORTESTLINE2D | GEOM_SHORTESTLINE3D | GEO_SET_SRID | GEO_TRANSFORM | GEO_ROUND | GEOM_BUFFER | LINE_NUMPOINTS | LINE_LOCATE_POINT | LINE_INTERPOLATE_POINT | LINE_SUBSTRING | GEOM_POINT_MAKE2D | GEOM_POINT_MAKE3DZ | GEOG_POINT_MAKE2D | GEOG_POINT_MAKE3DZ | GEOM_TO_GEOG | GEOG_TO_GEOM | GEOG_CENTROID | GEO_GEO_N | LINE_POINT_N | GEOM_INTERSECTION2D_COLL | GEO_AS_GEOJSON | GEO_AS_HEXEWKB | GEO_AS_EWKT | GEO_FROM_GEOJSON | GEOM_FROM_HEXEWKB | GEO_TRANSFORM_PIPELINE | GEOM_MIN_BOUNDING_CENTER | GEOM_MIN_BOUNDING_RADIUS | GEOM_RELATE_PATTERN | GEOM_INTERSECTS2D | GEOM_DWITHIN2D | GEOM_CONTAINS | GEOM_DISJOINT2D | GEOM_COVERS | GEOM_TOUCHES | GEOM_INTERSECTS3D | GEOM_DWITHIN3D | GEOM_DISTANCE2D | GEOM_DISTANCE3D; +functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT | TGE_TTEXT_TEXT | TGE_TEXT_TTEXT | TGT_TTEXT_TEXT | TGT_TEXT_TTEXT | TLE_TTEXT_TEXT | TLE_TEXT_TTEXT | TLT_TTEXT_TEXT | TLT_TEXT_TTEXT | TTEXT_UPPER | TTEXT_LOWER | TTEXT_INITCAP | TEXTCAT_TTEXT_TEXT | TEXTCAT_TEXT_TTEXT | TEXTCAT_TTEXT_TTEXT | GEOM_LENGTH | GEOM_PERIMETER | GEOM_AZIMUTH | GEOG_AREA | GEOG_LENGTH | GEOG_PERIMETER | GEOM_IS_EMPTY | AINTERSECTS_TGEO_GEO | ACOVERS_TGEO_GEO | ADISJOINT_TGEO_GEO | ADWITHIN_TGEO_GEO | EINTERSECTS_TGEO_GEO | ETOUCHES_TGEO_GEO | ECONTAINS_TGEO_GEO | ACONTAINS_TGEO_GEO | ATOUCHES_TGEO_GEO | GEO_NUM_POINTS | GEO_NUM_GEOS | GEO_SRID | GEO_IS_UNITARY | GEO_EQUALS | GEO_SAME | GEOG_DISTANCE | NAD_TGEO_GEO | EVER_EQ_TGEO_GEO | EVER_NE_TGEO_GEO | ALWAYS_EQ_TGEO_GEO | ALWAYS_NE_TGEO_GEO | GEOG_INTERSECTS | GEOG_DWITHIN | ACOVERS_GEO_TGEO | GEOM_INTERSECTS | GEOM_DWITHIN | H3_GS_POINT_TO_CELL | EVER_EQ_TH3INDEX_H3INDEX | EVER_NE_TH3INDEX_H3INDEX | ALWAYS_EQ_TH3INDEX_H3INDEX | ALWAYS_NE_TH3INDEX_H3INDEX | TH3INDEX_GET_RESOLUTION | TH3INDEX_GET_BASE_CELL_NUMBER | TH3INDEX_IS_VALID_CELL | TH3INDEX_IS_PENTAGON | TH3INDEX_CELL_TO_PARENT_NEXT | TH3INDEX_CELL_TO_CENTER_CHILD_NEXT | TH3INDEX_CELL_TO_PARENT | TH3INDEX_CELL_TO_CENTER_CHILD | TH3INDEX_CELL_TO_CHILD_POS | TH3INDEX_ARE_NEIGHBOR_CELLS | TH3INDEX_GRID_DISTANCE | EINTERSECTS_TCBUFFER_GEO | AINTERSECTS_TCBUFFER_GEO | ECOVERS_TCBUFFER_GEO | ACOVERS_TCBUFFER_GEO | EDISJOINT_TCBUFFER_GEO | ADISJOINT_TCBUFFER_GEO | ETOUCHES_TCBUFFER_GEO | ATOUCHES_TCBUFFER_GEO | ECONTAINS_TCBUFFER_GEO | ACONTAINS_TCBUFFER_GEO | NAD_TCBUFFER_GEO | EDWITHIN_TCBUFFER_GEO | ADWITHIN_TCBUFFER_GEO | EINTERSECTS_TCBUFFER_CBUFFER | AINTERSECTS_TCBUFFER_CBUFFER | ECOVERS_TCBUFFER_CBUFFER | ACOVERS_TCBUFFER_CBUFFER | EDISJOINT_TCBUFFER_CBUFFER | ADISJOINT_TCBUFFER_CBUFFER | ETOUCHES_TCBUFFER_CBUFFER | ATOUCHES_TCBUFFER_CBUFFER | ECONTAINS_TCBUFFER_CBUFFER | ACONTAINS_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_CBUFFER | ALWAYS_EQ_TCBUFFER_CBUFFER | EVER_NE_TCBUFFER_CBUFFER | ALWAYS_NE_TCBUFFER_CBUFFER | NAD_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_TCBUFFER | ALWAYS_EQ_TCBUFFER_TCBUFFER | EVER_NE_TCBUFFER_TCBUFFER | ALWAYS_NE_TCBUFFER_TCBUFFER | EINTERSECTS_TCBUFFER_TCBUFFER | AINTERSECTS_TCBUFFER_TCBUFFER | ECOVERS_TCBUFFER_TCBUFFER | ACOVERS_TCBUFFER_TCBUFFER | ADISJOINT_TCBUFFER_TCBUFFER | ETOUCHES_TCBUFFER_TCBUFFER | ATOUCHES_TCBUFFER_TCBUFFER | NAD_TCBUFFER_TCBUFFER | EDWITHIN_TCBUFFER_TCBUFFER | ADWITHIN_TCBUFFER_TCBUFFER | MINDISTANCE_TCBUFFER_TCBUFFER | NAD_TNPOINT_GEO | EVER_EQ_TNPOINT_NPOINT | ALWAYS_EQ_TNPOINT_NPOINT | EVER_NE_TNPOINT_NPOINT | ALWAYS_NE_TNPOINT_NPOINT | NAD_TNPOINT_NPOINT | EVER_EQ_NPOINT_TNPOINT | ALWAYS_EQ_NPOINT_TNPOINT | EVER_NE_NPOINT_TNPOINT | ALWAYS_NE_NPOINT_TNPOINT | EVER_EQ_TNPOINT_TNPOINT | ALWAYS_EQ_TNPOINT_TNPOINT | EVER_NE_TNPOINT_TNPOINT | ALWAYS_NE_TNPOINT_TNPOINT | NAD_TNPOINT_TNPOINT | NAD_TPOSE_GEO | EVER_EQ_TPOSE_POSE | ALWAYS_EQ_TPOSE_POSE | EVER_NE_TPOSE_POSE | ALWAYS_NE_TPOSE_POSE | NAD_TPOSE_POSE | EVER_EQ_POSE_TPOSE | ALWAYS_EQ_POSE_TPOSE | EVER_NE_POSE_TPOSE | ALWAYS_NE_POSE_TPOSE | EVER_EQ_TPOSE_TPOSE | ALWAYS_EQ_TPOSE_TPOSE | EVER_NE_TPOSE_TPOSE | ALWAYS_NE_TPOSE_TPOSE | NAD_TPOSE_TPOSE | EVER_EQ_TRGEOMETRY_GEO | ALWAYS_EQ_TRGEOMETRY_GEO | EVER_NE_TRGEOMETRY_GEO | ALWAYS_NE_TRGEOMETRY_GEO | NAD_TRGEOMETRY_GEO | EVER_EQ_GEO_TRGEOMETRY | ALWAYS_EQ_GEO_TRGEOMETRY | EVER_NE_GEO_TRGEOMETRY | ALWAYS_NE_GEO_TRGEOMETRY | EVER_EQ_TRGEOMETRY_TRGEOMETRY | ALWAYS_EQ_TRGEOMETRY_TRGEOMETRY | EVER_NE_TRGEOMETRY_TRGEOMETRY | ALWAYS_NE_TRGEOMETRY_TRGEOMETRY | NAD_TRGEOMETRY_TRGEOMETRY | EINTERSECTS_TPCPOINT_GEO | NAD_TPCPOINT_GEO | QUADBIN_POINT_TO_CELL | QUADBIN_IS_VALID_CELL | QUADBIN_GET_RESOLUTION | QUADBIN_CELL_AREA | QUADBIN_CELL_TO_QUADKEY | QUADBIN_CELL_TO_PARENT | QUADBIN_TILE_TO_CELL | EVER_EQ_TJSONB_JSONB | ALWAYS_EQ_TJSONB_JSONB | EVER_NE_TJSONB_JSONB | ALWAYS_NE_TJSONB_JSONB | EVER_EQ_TJSONB_TJSONB | ALWAYS_EQ_TJSONB_TJSONB | EVER_NE_TJSONB_TJSONB | ALWAYS_NE_TJSONB_TJSONB | GEOM_BOUNDARY | GEOM_CENTROID | GEOM_CONVEX_HULL | GEO_REVERSE | GEO_POINTS | GEOM_UNARY_UNION | GEOM_DIFFERENCE2D | GEOM_INTERSECTION2D | GEOM_SHORTESTLINE2D | GEOM_SHORTESTLINE3D | GEO_SET_SRID | GEO_TRANSFORM | GEO_ROUND | GEOM_BUFFER | LINE_NUMPOINTS | LINE_LOCATE_POINT | LINE_INTERPOLATE_POINT | LINE_SUBSTRING | GEOM_POINT_MAKE2D | GEOM_POINT_MAKE3DZ | GEOG_POINT_MAKE2D | GEOG_POINT_MAKE3DZ | GEOM_TO_GEOG | GEOG_TO_GEOM | GEOG_CENTROID | GEO_GEO_N | LINE_POINT_N | GEOM_INTERSECTION2D_COLL | GEO_AS_GEOJSON | GEO_AS_HEXEWKB | GEO_AS_EWKT | GEO_FROM_GEOJSON | GEOM_FROM_HEXEWKB | GEO_TRANSFORM_PIPELINE | GEOM_MIN_BOUNDING_CENTER | GEOM_MIN_BOUNDING_RADIUS | EVER_EQ_TGEO_TGEO | EVER_NE_TGEO_TGEO | ALWAYS_EQ_TGEO_TGEO | ALWAYS_NE_TGEO_TGEO | EINTERSECTS_TGEO_TGEO | ECOVERS_TGEO_TGEO | EDISJOINT_TGEO_TGEO | ECONTAINS_TGEO_TGEO | ETOUCHES_TGEO_TGEO | AINTERSECTS_TGEO_TGEO | ACOVERS_TGEO_TGEO | ADISJOINT_TGEO_TGEO | ACONTAINS_TGEO_TGEO | ATOUCHES_TGEO_TGEO | GEOM_RELATE_PATTERN | GEOM_INTERSECTS2D | GEOM_DWITHIN2D | GEOM_CONTAINS | GEOM_DISJOINT2D | GEOM_COVERS | GEOM_TOUCHES | GEOM_INTERSECTS3D | GEOM_DWITHIN3D | GEOM_DISTANCE2D | GEOM_DISTANCE3D; sinkClause: INTO sink (',' sink)*; @@ -947,6 +947,20 @@ GEOM_FROM_HEXEWKB: 'GEOM_FROM_HEXEWKB' | 'geom_from_hexewkb'; GEO_TRANSFORM_PIPELINE: 'GEO_TRANSFORM_PIPELINE' | 'geo_transform_pipeline'; GEOM_MIN_BOUNDING_CENTER: 'GEOM_MIN_BOUNDING_CENTER' | 'geom_min_bounding_radius'; GEOM_MIN_BOUNDING_RADIUS: 'GEOM_MIN_BOUNDING_RADIUS' | 'geom_min_bounding_radius'; +EVER_EQ_TGEO_TGEO: 'EVER_EQ_TGEO_TGEO' | 'ever_eq_tgeo_tgeo'; +EVER_NE_TGEO_TGEO: 'EVER_NE_TGEO_TGEO' | 'ever_ne_tgeo_tgeo'; +ALWAYS_EQ_TGEO_TGEO: 'ALWAYS_EQ_TGEO_TGEO' | 'always_eq_tgeo_tgeo'; +ALWAYS_NE_TGEO_TGEO: 'ALWAYS_NE_TGEO_TGEO' | 'always_ne_tgeo_tgeo'; +EINTERSECTS_TGEO_TGEO: 'EINTERSECTS_TGEO_TGEO' | 'eintersects_tgeo_tgeo'; +ECOVERS_TGEO_TGEO: 'ECOVERS_TGEO_TGEO' | 'ecovers_tgeo_tgeo'; +EDISJOINT_TGEO_TGEO: 'EDISJOINT_TGEO_TGEO' | 'edisjoint_tgeo_tgeo'; +ECONTAINS_TGEO_TGEO: 'ECONTAINS_TGEO_TGEO' | 'econtains_tgeo_tgeo'; +ETOUCHES_TGEO_TGEO: 'ETOUCHES_TGEO_TGEO' | 'etouches_tgeo_tgeo'; +AINTERSECTS_TGEO_TGEO: 'AINTERSECTS_TGEO_TGEO' | 'aintersects_tgeo_tgeo'; +ACOVERS_TGEO_TGEO: 'ACOVERS_TGEO_TGEO' | 'acovers_tgeo_tgeo'; +ADISJOINT_TGEO_TGEO: 'ADISJOINT_TGEO_TGEO' | 'adisjoint_tgeo_tgeo'; +ACONTAINS_TGEO_TGEO: 'ACONTAINS_TGEO_TGEO' | 'acontains_tgeo_tgeo'; +ATOUCHES_TGEO_TGEO: 'ATOUCHES_TGEO_TGEO' | 'atouches_tgeo_tgeo'; GEOM_RELATE_PATTERN: 'GEOM_RELATE_PATTERN' | 'geom_relate_pattern'; GEOM_INTERSECTS2D: 'GEOM_INTERSECTS2D' | 'geom_intersects2d'; GEOM_DWITHIN2D: 'GEOM_DWITHIN2D' | 'geom_dwithin2d'; diff --git a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp index 119100de50..9297faa125 100644 --- a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp +++ b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp @@ -528,6 +528,20 @@ #include #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include @@ -11127,6 +11141,188 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont auto arg2 = visit(ctx->functionParam(2)).as(); return LogicalFunction(GeomRelatePatternLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2))); } + case AntlrSQLParser::EVER_EQ_TGEO_TGEO: { + PRECONDITION(ctx->functionParam().size() == 6, + "EverEqTgeoTgeo requires 6 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + auto arg5 = visit(ctx->functionParam(5)).as(); + return LogicalFunction(EverEqTgeoTgeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5))); + } + /* END CODEGEN PARSER GLUE: EVER_EQ_TGEO_TGEO */ + case AntlrSQLParser::EVER_NE_TGEO_TGEO: { + PRECONDITION(ctx->functionParam().size() == 6, + "EverNeTgeoTgeo requires 6 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + auto arg5 = visit(ctx->functionParam(5)).as(); + return LogicalFunction(EverNeTgeoTgeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5))); + } + /* END CODEGEN PARSER GLUE: EVER_NE_TGEO_TGEO */ + case AntlrSQLParser::ALWAYS_EQ_TGEO_TGEO: { + PRECONDITION(ctx->functionParam().size() == 6, + "AlwaysEqTgeoTgeo requires 6 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + auto arg5 = visit(ctx->functionParam(5)).as(); + return LogicalFunction(AlwaysEqTgeoTgeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5))); + } + /* END CODEGEN PARSER GLUE: ALWAYS_EQ_TGEO_TGEO */ + case AntlrSQLParser::ALWAYS_NE_TGEO_TGEO: { + PRECONDITION(ctx->functionParam().size() == 6, + "AlwaysNeTgeoTgeo requires 6 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + auto arg5 = visit(ctx->functionParam(5)).as(); + return LogicalFunction(AlwaysNeTgeoTgeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5))); + } + /* END CODEGEN PARSER GLUE: ALWAYS_NE_TGEO_TGEO */ + case AntlrSQLParser::EINTERSECTS_TGEO_TGEO: { + PRECONDITION(ctx->functionParam().size() == 6, + "EintersectsTgeoTgeo requires 6 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + auto arg5 = visit(ctx->functionParam(5)).as(); + return LogicalFunction(EintersectsTgeoTgeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5))); + } + /* END CODEGEN PARSER GLUE: EINTERSECTS_TGEO_TGEO */ + case AntlrSQLParser::ECOVERS_TGEO_TGEO: { + PRECONDITION(ctx->functionParam().size() == 6, + "EcoversTgeoTgeo requires 6 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + auto arg5 = visit(ctx->functionParam(5)).as(); + return LogicalFunction(EcoversTgeoTgeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5))); + } + /* END CODEGEN PARSER GLUE: ECOVERS_TGEO_TGEO */ + case AntlrSQLParser::EDISJOINT_TGEO_TGEO: { + PRECONDITION(ctx->functionParam().size() == 6, + "EdisjointTgeoTgeo requires 6 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + auto arg5 = visit(ctx->functionParam(5)).as(); + return LogicalFunction(EdisjointTgeoTgeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5))); + } + /* END CODEGEN PARSER GLUE: EDISJOINT_TGEO_TGEO */ + case AntlrSQLParser::ECONTAINS_TGEO_TGEO: { + PRECONDITION(ctx->functionParam().size() == 6, + "EcontainsTgeoTgeo requires 6 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + auto arg5 = visit(ctx->functionParam(5)).as(); + return LogicalFunction(EcontainsTgeoTgeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5))); + } + /* END CODEGEN PARSER GLUE: ECONTAINS_TGEO_TGEO */ + case AntlrSQLParser::ETOUCHES_TGEO_TGEO: { + PRECONDITION(ctx->functionParam().size() == 6, + "EtouchesTgeoTgeo requires 6 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + auto arg5 = visit(ctx->functionParam(5)).as(); + return LogicalFunction(EtouchesTgeoTgeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5))); + } + /* END CODEGEN PARSER GLUE: ETOUCHES_TGEO_TGEO */ + case AntlrSQLParser::AINTERSECTS_TGEO_TGEO: { + PRECONDITION(ctx->functionParam().size() == 6, + "AintersectsTgeoTgeo requires 6 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + auto arg5 = visit(ctx->functionParam(5)).as(); + return LogicalFunction(AintersectsTgeoTgeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5))); + } + /* END CODEGEN PARSER GLUE: AINTERSECTS_TGEO_TGEO */ + case AntlrSQLParser::ACOVERS_TGEO_TGEO: { + PRECONDITION(ctx->functionParam().size() == 6, + "AcoversTgeoTgeo requires 6 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + auto arg5 = visit(ctx->functionParam(5)).as(); + return LogicalFunction(AcoversTgeoTgeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5))); + } + /* END CODEGEN PARSER GLUE: ACOVERS_TGEO_TGEO */ + case AntlrSQLParser::ADISJOINT_TGEO_TGEO: { + PRECONDITION(ctx->functionParam().size() == 6, + "AdisjointTgeoTgeo requires 6 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + auto arg5 = visit(ctx->functionParam(5)).as(); + return LogicalFunction(AdisjointTgeoTgeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5))); + } + /* END CODEGEN PARSER GLUE: ADISJOINT_TGEO_TGEO */ + case AntlrSQLParser::ACONTAINS_TGEO_TGEO: { + PRECONDITION(ctx->functionParam().size() == 6, + "AcontainsTgeoTgeo requires 6 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + auto arg5 = visit(ctx->functionParam(5)).as(); + return LogicalFunction(AcontainsTgeoTgeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5))); + } + /* END CODEGEN PARSER GLUE: ACONTAINS_TGEO_TGEO */ + case AntlrSQLParser::ATOUCHES_TGEO_TGEO: { + PRECONDITION(ctx->functionParam().size() == 6, + "AtouchesTgeoTgeo requires 6 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + auto arg5 = visit(ctx->functionParam(5)).as(); + return LogicalFunction(AtouchesTgeoTgeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5))); + } + /* END CODEGEN PARSER GLUE: ATOUCHES_TGEO_TGEO */ /* END CODEGEN PARSER GLUE: GEOM_RELATE_PATTERN */ /* END CODEGEN PARSER GLUE: GEOM_INTERSECTS2D */ case AntlrSQLParser::GEOM_DWITHIN2D: { From 86ec24527983179ced66c67482e9df142b895370 Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Tue, 16 Jun 2026 06:23:14 +0200 Subject: [PATCH 85/96] feat(meos): add tgeo_tgeo 7-arg dwithin NES operators (W137) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- .../Meos/AdwithinTgeoTgeoLogicalFunction.hpp | 48 ++++++++ .../Meos/EdwithinTgeoTgeoLogicalFunction.hpp | 48 ++++++++ .../Meos/AdwithinTgeoTgeoLogicalFunction.cpp | 114 ++++++++++++++++++ .../src/Functions/Meos/CMakeLists.txt | 2 + .../Meos/EdwithinTgeoTgeoLogicalFunction.cpp | 114 ++++++++++++++++++ .../Meos/AdwithinTgeoTgeoPhysicalFunction.hpp | 32 +++++ .../Meos/EdwithinTgeoTgeoPhysicalFunction.hpp | 32 +++++ .../Meos/AdwithinTgeoTgeoPhysicalFunction.cpp | 95 +++++++++++++++ .../src/Functions/Meos/CMakeLists.txt | 2 + .../Meos/EdwithinTgeoTgeoPhysicalFunction.cpp | 95 +++++++++++++++ nes-sql-parser/AntlrSQL.g4 | 4 +- .../src/AntlrSQLQueryPlanCreator.cpp | 30 +++++ 12 files changed, 615 insertions(+), 1 deletion(-) create mode 100644 nes-logical-operators/include/Functions/Meos/AdwithinTgeoTgeoLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EdwithinTgeoTgeoLogicalFunction.hpp create mode 100644 nes-logical-operators/src/Functions/Meos/AdwithinTgeoTgeoLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EdwithinTgeoTgeoLogicalFunction.cpp create mode 100644 nes-physical-operators/include/Functions/Meos/AdwithinTgeoTgeoPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EdwithinTgeoTgeoPhysicalFunction.hpp create mode 100644 nes-physical-operators/src/Functions/Meos/AdwithinTgeoTgeoPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EdwithinTgeoTgeoPhysicalFunction.cpp diff --git a/nes-logical-operators/include/Functions/Meos/AdwithinTgeoTgeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AdwithinTgeoTgeoLogicalFunction.hpp new file mode 100644 index 0000000000..689bdfbfda --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AdwithinTgeoTgeoLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Tests whether two temporal geometries are always within a distance. + */ +class AdwithinTgeoTgeoLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AdwithinTgeoTgeo"; + + AdwithinTgeoTgeoLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction ts1, LogicalFunction lon2, LogicalFunction lat2, LogicalFunction ts2, LogicalFunction dist); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EdwithinTgeoTgeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EdwithinTgeoTgeoLogicalFunction.hpp new file mode 100644 index 0000000000..d6467a606e --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EdwithinTgeoTgeoLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Tests whether two temporal geometries are ever within a distance. + */ +class EdwithinTgeoTgeoLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EdwithinTgeoTgeo"; + + EdwithinTgeoTgeoLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction ts1, LogicalFunction lon2, LogicalFunction lat2, LogicalFunction ts2, LogicalFunction dist); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AdwithinTgeoTgeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AdwithinTgeoTgeoLogicalFunction.cpp new file mode 100644 index 0000000000..56de5e2ca4 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AdwithinTgeoTgeoLogicalFunction.cpp @@ -0,0 +1,114 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AdwithinTgeoTgeoLogicalFunction::AdwithinTgeoTgeoLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction ts1, LogicalFunction lon2, LogicalFunction lat2, LogicalFunction ts2, LogicalFunction dist) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(7); + parameters.push_back(std::move(lon1)); + parameters.push_back(std::move(lat1)); + parameters.push_back(std::move(ts1)); + parameters.push_back(std::move(lon2)); + parameters.push_back(std::move(lat2)); + parameters.push_back(std::move(ts2)); + parameters.push_back(std::move(dist)); +} + +DataType AdwithinTgeoTgeoLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction AdwithinTgeoTgeoLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector AdwithinTgeoTgeoLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction AdwithinTgeoTgeoLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 7, + "AdwithinTgeoTgeoLogicalFunction requires 7 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view AdwithinTgeoTgeoLogicalFunction::getType() const { return NAME; } + +bool AdwithinTgeoTgeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string AdwithinTgeoTgeoLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction AdwithinTgeoTgeoLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(7); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon1 must be FLOAT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat1 must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::FLOAT64), "lon2 must be FLOAT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "lat2 must be FLOAT64"); + INVARIANT(c[5].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); + INVARIANT(c[6].getDataType().isType(DataType::Type::FLOAT64), "dist must be FLOAT64"); + return withChildren(c); +} + +SerializableFunction AdwithinTgeoTgeoLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAdwithinTgeoTgeoLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 7, + "AdwithinTgeoTgeoLogicalFunction requires 7 children but got {}", + arguments.children.size()); + return AdwithinTgeoTgeoLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4]), + std::move(arguments.children[5]), + std::move(arguments.children[6])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt index 5c1eb265f0..8f922b7599 100644 --- a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt @@ -491,6 +491,8 @@ add_plugin(AcoversTgeoTgeo LogicalFunction nes-logical-operators AcoversTgeoTgeo add_plugin(AdisjointTgeoTgeo LogicalFunction nes-logical-operators AdisjointTgeoTgeoLogicalFunction.cpp) add_plugin(AcontainsTgeoTgeo LogicalFunction nes-logical-operators AcontainsTgeoTgeoLogicalFunction.cpp) add_plugin(AtouchesTgeoTgeo LogicalFunction nes-logical-operators AtouchesTgeoTgeoLogicalFunction.cpp) +add_plugin(EdwithinTgeoTgeo LogicalFunction nes-logical-operators EdwithinTgeoTgeoLogicalFunction.cpp) +add_plugin(AdwithinTgeoTgeo LogicalFunction nes-logical-operators AdwithinTgeoTgeoLogicalFunction.cpp) add_plugin(GeomRelatePattern LogicalFunction nes-logical-operators GeomRelatePatternLogicalFunction.cpp) add_plugin(GeomIntersects2d LogicalFunction nes-logical-operators GeomIntersects2dLogicalFunction.cpp) add_plugin(GeomDwithin2d LogicalFunction nes-logical-operators GeomDwithin2dLogicalFunction.cpp) diff --git a/nes-logical-operators/src/Functions/Meos/EdwithinTgeoTgeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EdwithinTgeoTgeoLogicalFunction.cpp new file mode 100644 index 0000000000..1a116ae236 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EdwithinTgeoTgeoLogicalFunction.cpp @@ -0,0 +1,114 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EdwithinTgeoTgeoLogicalFunction::EdwithinTgeoTgeoLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction ts1, LogicalFunction lon2, LogicalFunction lat2, LogicalFunction ts2, LogicalFunction dist) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(7); + parameters.push_back(std::move(lon1)); + parameters.push_back(std::move(lat1)); + parameters.push_back(std::move(ts1)); + parameters.push_back(std::move(lon2)); + parameters.push_back(std::move(lat2)); + parameters.push_back(std::move(ts2)); + parameters.push_back(std::move(dist)); +} + +DataType EdwithinTgeoTgeoLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction EdwithinTgeoTgeoLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector EdwithinTgeoTgeoLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction EdwithinTgeoTgeoLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 7, + "EdwithinTgeoTgeoLogicalFunction requires 7 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view EdwithinTgeoTgeoLogicalFunction::getType() const { return NAME; } + +bool EdwithinTgeoTgeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string EdwithinTgeoTgeoLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction EdwithinTgeoTgeoLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(7); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon1 must be FLOAT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat1 must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::FLOAT64), "lon2 must be FLOAT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "lat2 must be FLOAT64"); + INVARIANT(c[5].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); + INVARIANT(c[6].getDataType().isType(DataType::Type::FLOAT64), "dist must be FLOAT64"); + return withChildren(c); +} + +SerializableFunction EdwithinTgeoTgeoLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEdwithinTgeoTgeoLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 7, + "EdwithinTgeoTgeoLogicalFunction requires 7 children but got {}", + arguments.children.size()); + return EdwithinTgeoTgeoLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4]), + std::move(arguments.children[5]), + std::move(arguments.children[6])); +} + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AdwithinTgeoTgeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AdwithinTgeoTgeoPhysicalFunction.hpp new file mode 100644 index 0000000000..4f171e71ad --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AdwithinTgeoTgeoPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class AdwithinTgeoTgeoPhysicalFunction : public PhysicalFunctionConcept { +public: + AdwithinTgeoTgeoPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction ts1, PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction ts2, PhysicalFunction dist); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EdwithinTgeoTgeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EdwithinTgeoTgeoPhysicalFunction.hpp new file mode 100644 index 0000000000..41509fbd7d --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EdwithinTgeoTgeoPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class EdwithinTgeoTgeoPhysicalFunction : public PhysicalFunctionConcept { +public: + EdwithinTgeoTgeoPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction ts1, PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction ts2, PhysicalFunction dist); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AdwithinTgeoTgeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AdwithinTgeoTgeoPhysicalFunction.cpp new file mode 100644 index 0000000000..fdcebcbde5 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AdwithinTgeoTgeoPhysicalFunction.cpp @@ -0,0 +1,95 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +AdwithinTgeoTgeoPhysicalFunction::AdwithinTgeoTgeoPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction ts1, PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction ts2, PhysicalFunction dist) +{ + paramFns.reserve(7); + paramFns.push_back(std::move(lon1)); + paramFns.push_back(std::move(lat1)); + paramFns.push_back(std::move(ts1)); + paramFns.push_back(std::move(lon2)); + paramFns.push_back(std::move(lat2)); + paramFns.push_back(std::move(ts2)); + paramFns.push_back(std::move(dist)); +} + +VarVal AdwithinTgeoTgeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto lon1 = paramFns[0].execute(record, arena).cast(); + auto lat1 = paramFns[1].execute(record, arena).cast(); + auto ts1 = paramFns[2].execute(record, arena).cast(); + auto lon2 = paramFns[3].execute(record, arena).cast(); + auto lat2 = paramFns[4].execute(record, arena).cast(); + auto ts2 = paramFns[5].execute(record, arena).cast(); + auto dist = paramFns[6].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](double lon1, double lat1, uint64_t ts1, + double lon2, double lat2, uint64_t ts2, + double dist) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string wkt1 = fmt::format("SRID=4326;POINT({},{})@{}", lon1, lat1, ts1); + Temporal* t1 = tgeompoint_in(wkt1.c_str()); + if (!t1) return 0.0; + std::string wkt2 = fmt::format("SRID=4326;POINT({},{})@{}", lon2, lat2, ts2); + Temporal* t2 = tgeompoint_in(wkt2.c_str()); + if (!t2) { free(t1); return 0.0; } + int r = adwithin_tgeo_tgeo(t1, t2, dist); + free(t1); free(t2); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + lon1, lat1, ts1, lon2, lat2, ts2, dist); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAdwithinTgeoTgeoPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 7, + "AdwithinTgeoTgeoPhysicalFunction requires 7 children but got {}", + arguments.childFunctions.size()); + return AdwithinTgeoTgeoPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4]), + std::move(arguments.childFunctions[5]), + std::move(arguments.childFunctions[6])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt index a928b78345..49ed24d7dd 100644 --- a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt @@ -490,6 +490,8 @@ add_plugin(AcoversTgeoTgeo PhysicalFunction nes-physical-operators AcoversTgeoTg add_plugin(AdisjointTgeoTgeo PhysicalFunction nes-physical-operators AdisjointTgeoTgeoPhysicalFunction.cpp) add_plugin(AcontainsTgeoTgeo PhysicalFunction nes-physical-operators AcontainsTgeoTgeoPhysicalFunction.cpp) add_plugin(AtouchesTgeoTgeo PhysicalFunction nes-physical-operators AtouchesTgeoTgeoPhysicalFunction.cpp) +add_plugin(EdwithinTgeoTgeo PhysicalFunction nes-physical-operators EdwithinTgeoTgeoPhysicalFunction.cpp) +add_plugin(AdwithinTgeoTgeo PhysicalFunction nes-physical-operators AdwithinTgeoTgeoPhysicalFunction.cpp) add_plugin(GeomRelatePattern PhysicalFunction nes-physical-operators GeomRelatePatternPhysicalFunction.cpp) add_plugin(GeomIntersects2d PhysicalFunction nes-physical-operators GeomIntersects2dPhysicalFunction.cpp) add_plugin(GeomDwithin2d PhysicalFunction nes-physical-operators GeomDwithin2dPhysicalFunction.cpp) diff --git a/nes-physical-operators/src/Functions/Meos/EdwithinTgeoTgeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EdwithinTgeoTgeoPhysicalFunction.cpp new file mode 100644 index 0000000000..96a13325fc --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EdwithinTgeoTgeoPhysicalFunction.cpp @@ -0,0 +1,95 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +EdwithinTgeoTgeoPhysicalFunction::EdwithinTgeoTgeoPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction ts1, PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction ts2, PhysicalFunction dist) +{ + paramFns.reserve(7); + paramFns.push_back(std::move(lon1)); + paramFns.push_back(std::move(lat1)); + paramFns.push_back(std::move(ts1)); + paramFns.push_back(std::move(lon2)); + paramFns.push_back(std::move(lat2)); + paramFns.push_back(std::move(ts2)); + paramFns.push_back(std::move(dist)); +} + +VarVal EdwithinTgeoTgeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto lon1 = paramFns[0].execute(record, arena).cast(); + auto lat1 = paramFns[1].execute(record, arena).cast(); + auto ts1 = paramFns[2].execute(record, arena).cast(); + auto lon2 = paramFns[3].execute(record, arena).cast(); + auto lat2 = paramFns[4].execute(record, arena).cast(); + auto ts2 = paramFns[5].execute(record, arena).cast(); + auto dist = paramFns[6].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](double lon1, double lat1, uint64_t ts1, + double lon2, double lat2, uint64_t ts2, + double dist) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string wkt1 = fmt::format("SRID=4326;POINT({},{})@{}", lon1, lat1, ts1); + Temporal* t1 = tgeompoint_in(wkt1.c_str()); + if (!t1) return 0.0; + std::string wkt2 = fmt::format("SRID=4326;POINT({},{})@{}", lon2, lat2, ts2); + Temporal* t2 = tgeompoint_in(wkt2.c_str()); + if (!t2) { free(t1); return 0.0; } + int r = edwithin_tgeo_tgeo(t1, t2, dist); + free(t1); free(t2); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + lon1, lat1, ts1, lon2, lat2, ts2, dist); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEdwithinTgeoTgeoPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 7, + "EdwithinTgeoTgeoPhysicalFunction requires 7 children but got {}", + arguments.childFunctions.size()); + return EdwithinTgeoTgeoPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4]), + std::move(arguments.childFunctions[5]), + std::move(arguments.childFunctions[6])); +} + +} // namespace NES diff --git a/nes-sql-parser/AntlrSQL.g4 b/nes-sql-parser/AntlrSQL.g4 index a9615339df..0e6b471cba 100644 --- a/nes-sql-parser/AntlrSQL.g4 +++ b/nes-sql-parser/AntlrSQL.g4 @@ -295,7 +295,7 @@ timeUnit: MS timestampParameter: name=identifier; -functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT | TGE_TTEXT_TEXT | TGE_TEXT_TTEXT | TGT_TTEXT_TEXT | TGT_TEXT_TTEXT | TLE_TTEXT_TEXT | TLE_TEXT_TTEXT | TLT_TTEXT_TEXT | TLT_TEXT_TTEXT | TTEXT_UPPER | TTEXT_LOWER | TTEXT_INITCAP | TEXTCAT_TTEXT_TEXT | TEXTCAT_TEXT_TTEXT | TEXTCAT_TTEXT_TTEXT | GEOM_LENGTH | GEOM_PERIMETER | GEOM_AZIMUTH | GEOG_AREA | GEOG_LENGTH | GEOG_PERIMETER | GEOM_IS_EMPTY | AINTERSECTS_TGEO_GEO | ACOVERS_TGEO_GEO | ADISJOINT_TGEO_GEO | ADWITHIN_TGEO_GEO | EINTERSECTS_TGEO_GEO | ETOUCHES_TGEO_GEO | ECONTAINS_TGEO_GEO | ACONTAINS_TGEO_GEO | ATOUCHES_TGEO_GEO | GEO_NUM_POINTS | GEO_NUM_GEOS | GEO_SRID | GEO_IS_UNITARY | GEO_EQUALS | GEO_SAME | GEOG_DISTANCE | NAD_TGEO_GEO | EVER_EQ_TGEO_GEO | EVER_NE_TGEO_GEO | ALWAYS_EQ_TGEO_GEO | ALWAYS_NE_TGEO_GEO | GEOG_INTERSECTS | GEOG_DWITHIN | ACOVERS_GEO_TGEO | GEOM_INTERSECTS | GEOM_DWITHIN | H3_GS_POINT_TO_CELL | EVER_EQ_TH3INDEX_H3INDEX | EVER_NE_TH3INDEX_H3INDEX | ALWAYS_EQ_TH3INDEX_H3INDEX | ALWAYS_NE_TH3INDEX_H3INDEX | TH3INDEX_GET_RESOLUTION | TH3INDEX_GET_BASE_CELL_NUMBER | TH3INDEX_IS_VALID_CELL | TH3INDEX_IS_PENTAGON | TH3INDEX_CELL_TO_PARENT_NEXT | TH3INDEX_CELL_TO_CENTER_CHILD_NEXT | TH3INDEX_CELL_TO_PARENT | TH3INDEX_CELL_TO_CENTER_CHILD | TH3INDEX_CELL_TO_CHILD_POS | TH3INDEX_ARE_NEIGHBOR_CELLS | TH3INDEX_GRID_DISTANCE | EINTERSECTS_TCBUFFER_GEO | AINTERSECTS_TCBUFFER_GEO | ECOVERS_TCBUFFER_GEO | ACOVERS_TCBUFFER_GEO | EDISJOINT_TCBUFFER_GEO | ADISJOINT_TCBUFFER_GEO | ETOUCHES_TCBUFFER_GEO | ATOUCHES_TCBUFFER_GEO | ECONTAINS_TCBUFFER_GEO | ACONTAINS_TCBUFFER_GEO | NAD_TCBUFFER_GEO | EDWITHIN_TCBUFFER_GEO | ADWITHIN_TCBUFFER_GEO | EINTERSECTS_TCBUFFER_CBUFFER | AINTERSECTS_TCBUFFER_CBUFFER | ECOVERS_TCBUFFER_CBUFFER | ACOVERS_TCBUFFER_CBUFFER | EDISJOINT_TCBUFFER_CBUFFER | ADISJOINT_TCBUFFER_CBUFFER | ETOUCHES_TCBUFFER_CBUFFER | ATOUCHES_TCBUFFER_CBUFFER | ECONTAINS_TCBUFFER_CBUFFER | ACONTAINS_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_CBUFFER | ALWAYS_EQ_TCBUFFER_CBUFFER | EVER_NE_TCBUFFER_CBUFFER | ALWAYS_NE_TCBUFFER_CBUFFER | NAD_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_TCBUFFER | ALWAYS_EQ_TCBUFFER_TCBUFFER | EVER_NE_TCBUFFER_TCBUFFER | ALWAYS_NE_TCBUFFER_TCBUFFER | EINTERSECTS_TCBUFFER_TCBUFFER | AINTERSECTS_TCBUFFER_TCBUFFER | ECOVERS_TCBUFFER_TCBUFFER | ACOVERS_TCBUFFER_TCBUFFER | ADISJOINT_TCBUFFER_TCBUFFER | ETOUCHES_TCBUFFER_TCBUFFER | ATOUCHES_TCBUFFER_TCBUFFER | NAD_TCBUFFER_TCBUFFER | EDWITHIN_TCBUFFER_TCBUFFER | ADWITHIN_TCBUFFER_TCBUFFER | MINDISTANCE_TCBUFFER_TCBUFFER | NAD_TNPOINT_GEO | EVER_EQ_TNPOINT_NPOINT | ALWAYS_EQ_TNPOINT_NPOINT | EVER_NE_TNPOINT_NPOINT | ALWAYS_NE_TNPOINT_NPOINT | NAD_TNPOINT_NPOINT | EVER_EQ_NPOINT_TNPOINT | ALWAYS_EQ_NPOINT_TNPOINT | EVER_NE_NPOINT_TNPOINT | ALWAYS_NE_NPOINT_TNPOINT | EVER_EQ_TNPOINT_TNPOINT | ALWAYS_EQ_TNPOINT_TNPOINT | EVER_NE_TNPOINT_TNPOINT | ALWAYS_NE_TNPOINT_TNPOINT | NAD_TNPOINT_TNPOINT | NAD_TPOSE_GEO | EVER_EQ_TPOSE_POSE | ALWAYS_EQ_TPOSE_POSE | EVER_NE_TPOSE_POSE | ALWAYS_NE_TPOSE_POSE | NAD_TPOSE_POSE | EVER_EQ_POSE_TPOSE | ALWAYS_EQ_POSE_TPOSE | EVER_NE_POSE_TPOSE | ALWAYS_NE_POSE_TPOSE | EVER_EQ_TPOSE_TPOSE | ALWAYS_EQ_TPOSE_TPOSE | EVER_NE_TPOSE_TPOSE | ALWAYS_NE_TPOSE_TPOSE | NAD_TPOSE_TPOSE | EVER_EQ_TRGEOMETRY_GEO | ALWAYS_EQ_TRGEOMETRY_GEO | EVER_NE_TRGEOMETRY_GEO | ALWAYS_NE_TRGEOMETRY_GEO | NAD_TRGEOMETRY_GEO | EVER_EQ_GEO_TRGEOMETRY | ALWAYS_EQ_GEO_TRGEOMETRY | EVER_NE_GEO_TRGEOMETRY | ALWAYS_NE_GEO_TRGEOMETRY | EVER_EQ_TRGEOMETRY_TRGEOMETRY | ALWAYS_EQ_TRGEOMETRY_TRGEOMETRY | EVER_NE_TRGEOMETRY_TRGEOMETRY | ALWAYS_NE_TRGEOMETRY_TRGEOMETRY | NAD_TRGEOMETRY_TRGEOMETRY | EINTERSECTS_TPCPOINT_GEO | NAD_TPCPOINT_GEO | QUADBIN_POINT_TO_CELL | QUADBIN_IS_VALID_CELL | QUADBIN_GET_RESOLUTION | QUADBIN_CELL_AREA | QUADBIN_CELL_TO_QUADKEY | QUADBIN_CELL_TO_PARENT | QUADBIN_TILE_TO_CELL | EVER_EQ_TJSONB_JSONB | ALWAYS_EQ_TJSONB_JSONB | EVER_NE_TJSONB_JSONB | ALWAYS_NE_TJSONB_JSONB | EVER_EQ_TJSONB_TJSONB | ALWAYS_EQ_TJSONB_TJSONB | EVER_NE_TJSONB_TJSONB | ALWAYS_NE_TJSONB_TJSONB | GEOM_BOUNDARY | GEOM_CENTROID | GEOM_CONVEX_HULL | GEO_REVERSE | GEO_POINTS | GEOM_UNARY_UNION | GEOM_DIFFERENCE2D | GEOM_INTERSECTION2D | GEOM_SHORTESTLINE2D | GEOM_SHORTESTLINE3D | GEO_SET_SRID | GEO_TRANSFORM | GEO_ROUND | GEOM_BUFFER | LINE_NUMPOINTS | LINE_LOCATE_POINT | LINE_INTERPOLATE_POINT | LINE_SUBSTRING | GEOM_POINT_MAKE2D | GEOM_POINT_MAKE3DZ | GEOG_POINT_MAKE2D | GEOG_POINT_MAKE3DZ | GEOM_TO_GEOG | GEOG_TO_GEOM | GEOG_CENTROID | GEO_GEO_N | LINE_POINT_N | GEOM_INTERSECTION2D_COLL | GEO_AS_GEOJSON | GEO_AS_HEXEWKB | GEO_AS_EWKT | GEO_FROM_GEOJSON | GEOM_FROM_HEXEWKB | GEO_TRANSFORM_PIPELINE | GEOM_MIN_BOUNDING_CENTER | GEOM_MIN_BOUNDING_RADIUS | EVER_EQ_TGEO_TGEO | EVER_NE_TGEO_TGEO | ALWAYS_EQ_TGEO_TGEO | ALWAYS_NE_TGEO_TGEO | EINTERSECTS_TGEO_TGEO | ECOVERS_TGEO_TGEO | EDISJOINT_TGEO_TGEO | ECONTAINS_TGEO_TGEO | ETOUCHES_TGEO_TGEO | AINTERSECTS_TGEO_TGEO | ACOVERS_TGEO_TGEO | ADISJOINT_TGEO_TGEO | ACONTAINS_TGEO_TGEO | ATOUCHES_TGEO_TGEO | GEOM_RELATE_PATTERN | GEOM_INTERSECTS2D | GEOM_DWITHIN2D | GEOM_CONTAINS | GEOM_DISJOINT2D | GEOM_COVERS | GEOM_TOUCHES | GEOM_INTERSECTS3D | GEOM_DWITHIN3D | GEOM_DISTANCE2D | GEOM_DISTANCE3D; +functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT | TGE_TTEXT_TEXT | TGE_TEXT_TTEXT | TGT_TTEXT_TEXT | TGT_TEXT_TTEXT | TLE_TTEXT_TEXT | TLE_TEXT_TTEXT | TLT_TTEXT_TEXT | TLT_TEXT_TTEXT | TTEXT_UPPER | TTEXT_LOWER | TTEXT_INITCAP | TEXTCAT_TTEXT_TEXT | TEXTCAT_TEXT_TTEXT | TEXTCAT_TTEXT_TTEXT | GEOM_LENGTH | GEOM_PERIMETER | GEOM_AZIMUTH | GEOG_AREA | GEOG_LENGTH | GEOG_PERIMETER | GEOM_IS_EMPTY | AINTERSECTS_TGEO_GEO | ACOVERS_TGEO_GEO | ADISJOINT_TGEO_GEO | ADWITHIN_TGEO_GEO | EINTERSECTS_TGEO_GEO | ETOUCHES_TGEO_GEO | ECONTAINS_TGEO_GEO | ACONTAINS_TGEO_GEO | ATOUCHES_TGEO_GEO | GEO_NUM_POINTS | GEO_NUM_GEOS | GEO_SRID | GEO_IS_UNITARY | GEO_EQUALS | GEO_SAME | GEOG_DISTANCE | NAD_TGEO_GEO | EVER_EQ_TGEO_GEO | EVER_NE_TGEO_GEO | ALWAYS_EQ_TGEO_GEO | ALWAYS_NE_TGEO_GEO | GEOG_INTERSECTS | GEOG_DWITHIN | ACOVERS_GEO_TGEO | GEOM_INTERSECTS | GEOM_DWITHIN | H3_GS_POINT_TO_CELL | EVER_EQ_TH3INDEX_H3INDEX | EVER_NE_TH3INDEX_H3INDEX | ALWAYS_EQ_TH3INDEX_H3INDEX | ALWAYS_NE_TH3INDEX_H3INDEX | TH3INDEX_GET_RESOLUTION | TH3INDEX_GET_BASE_CELL_NUMBER | TH3INDEX_IS_VALID_CELL | TH3INDEX_IS_PENTAGON | TH3INDEX_CELL_TO_PARENT_NEXT | TH3INDEX_CELL_TO_CENTER_CHILD_NEXT | TH3INDEX_CELL_TO_PARENT | TH3INDEX_CELL_TO_CENTER_CHILD | TH3INDEX_CELL_TO_CHILD_POS | TH3INDEX_ARE_NEIGHBOR_CELLS | TH3INDEX_GRID_DISTANCE | EINTERSECTS_TCBUFFER_GEO | AINTERSECTS_TCBUFFER_GEO | ECOVERS_TCBUFFER_GEO | ACOVERS_TCBUFFER_GEO | EDISJOINT_TCBUFFER_GEO | ADISJOINT_TCBUFFER_GEO | ETOUCHES_TCBUFFER_GEO | ATOUCHES_TCBUFFER_GEO | ECONTAINS_TCBUFFER_GEO | ACONTAINS_TCBUFFER_GEO | NAD_TCBUFFER_GEO | EDWITHIN_TCBUFFER_GEO | ADWITHIN_TCBUFFER_GEO | EINTERSECTS_TCBUFFER_CBUFFER | AINTERSECTS_TCBUFFER_CBUFFER | ECOVERS_TCBUFFER_CBUFFER | ACOVERS_TCBUFFER_CBUFFER | EDISJOINT_TCBUFFER_CBUFFER | ADISJOINT_TCBUFFER_CBUFFER | ETOUCHES_TCBUFFER_CBUFFER | ATOUCHES_TCBUFFER_CBUFFER | ECONTAINS_TCBUFFER_CBUFFER | ACONTAINS_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_CBUFFER | ALWAYS_EQ_TCBUFFER_CBUFFER | EVER_NE_TCBUFFER_CBUFFER | ALWAYS_NE_TCBUFFER_CBUFFER | NAD_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_TCBUFFER | ALWAYS_EQ_TCBUFFER_TCBUFFER | EVER_NE_TCBUFFER_TCBUFFER | ALWAYS_NE_TCBUFFER_TCBUFFER | EINTERSECTS_TCBUFFER_TCBUFFER | AINTERSECTS_TCBUFFER_TCBUFFER | ECOVERS_TCBUFFER_TCBUFFER | ACOVERS_TCBUFFER_TCBUFFER | ADISJOINT_TCBUFFER_TCBUFFER | ETOUCHES_TCBUFFER_TCBUFFER | ATOUCHES_TCBUFFER_TCBUFFER | NAD_TCBUFFER_TCBUFFER | EDWITHIN_TCBUFFER_TCBUFFER | ADWITHIN_TCBUFFER_TCBUFFER | MINDISTANCE_TCBUFFER_TCBUFFER | NAD_TNPOINT_GEO | EVER_EQ_TNPOINT_NPOINT | ALWAYS_EQ_TNPOINT_NPOINT | EVER_NE_TNPOINT_NPOINT | ALWAYS_NE_TNPOINT_NPOINT | NAD_TNPOINT_NPOINT | EVER_EQ_NPOINT_TNPOINT | ALWAYS_EQ_NPOINT_TNPOINT | EVER_NE_NPOINT_TNPOINT | ALWAYS_NE_NPOINT_TNPOINT | EVER_EQ_TNPOINT_TNPOINT | ALWAYS_EQ_TNPOINT_TNPOINT | EVER_NE_TNPOINT_TNPOINT | ALWAYS_NE_TNPOINT_TNPOINT | NAD_TNPOINT_TNPOINT | NAD_TPOSE_GEO | EVER_EQ_TPOSE_POSE | ALWAYS_EQ_TPOSE_POSE | EVER_NE_TPOSE_POSE | ALWAYS_NE_TPOSE_POSE | NAD_TPOSE_POSE | EVER_EQ_POSE_TPOSE | ALWAYS_EQ_POSE_TPOSE | EVER_NE_POSE_TPOSE | ALWAYS_NE_POSE_TPOSE | EVER_EQ_TPOSE_TPOSE | ALWAYS_EQ_TPOSE_TPOSE | EVER_NE_TPOSE_TPOSE | ALWAYS_NE_TPOSE_TPOSE | NAD_TPOSE_TPOSE | EVER_EQ_TRGEOMETRY_GEO | ALWAYS_EQ_TRGEOMETRY_GEO | EVER_NE_TRGEOMETRY_GEO | ALWAYS_NE_TRGEOMETRY_GEO | NAD_TRGEOMETRY_GEO | EVER_EQ_GEO_TRGEOMETRY | ALWAYS_EQ_GEO_TRGEOMETRY | EVER_NE_GEO_TRGEOMETRY | ALWAYS_NE_GEO_TRGEOMETRY | EVER_EQ_TRGEOMETRY_TRGEOMETRY | ALWAYS_EQ_TRGEOMETRY_TRGEOMETRY | EVER_NE_TRGEOMETRY_TRGEOMETRY | ALWAYS_NE_TRGEOMETRY_TRGEOMETRY | NAD_TRGEOMETRY_TRGEOMETRY | EINTERSECTS_TPCPOINT_GEO | NAD_TPCPOINT_GEO | QUADBIN_POINT_TO_CELL | QUADBIN_IS_VALID_CELL | QUADBIN_GET_RESOLUTION | QUADBIN_CELL_AREA | QUADBIN_CELL_TO_QUADKEY | QUADBIN_CELL_TO_PARENT | QUADBIN_TILE_TO_CELL | EVER_EQ_TJSONB_JSONB | ALWAYS_EQ_TJSONB_JSONB | EVER_NE_TJSONB_JSONB | ALWAYS_NE_TJSONB_JSONB | EVER_EQ_TJSONB_TJSONB | ALWAYS_EQ_TJSONB_TJSONB | EVER_NE_TJSONB_TJSONB | ALWAYS_NE_TJSONB_TJSONB | GEOM_BOUNDARY | GEOM_CENTROID | GEOM_CONVEX_HULL | GEO_REVERSE | GEO_POINTS | GEOM_UNARY_UNION | GEOM_DIFFERENCE2D | GEOM_INTERSECTION2D | GEOM_SHORTESTLINE2D | GEOM_SHORTESTLINE3D | GEO_SET_SRID | GEO_TRANSFORM | GEO_ROUND | GEOM_BUFFER | LINE_NUMPOINTS | LINE_LOCATE_POINT | LINE_INTERPOLATE_POINT | LINE_SUBSTRING | GEOM_POINT_MAKE2D | GEOM_POINT_MAKE3DZ | GEOG_POINT_MAKE2D | GEOG_POINT_MAKE3DZ | GEOM_TO_GEOG | GEOG_TO_GEOM | GEOG_CENTROID | GEO_GEO_N | LINE_POINT_N | GEOM_INTERSECTION2D_COLL | GEO_AS_GEOJSON | GEO_AS_HEXEWKB | GEO_AS_EWKT | GEO_FROM_GEOJSON | GEOM_FROM_HEXEWKB | GEO_TRANSFORM_PIPELINE | GEOM_MIN_BOUNDING_CENTER | GEOM_MIN_BOUNDING_RADIUS | EVER_EQ_TGEO_TGEO | EVER_NE_TGEO_TGEO | ALWAYS_EQ_TGEO_TGEO | ALWAYS_NE_TGEO_TGEO | EINTERSECTS_TGEO_TGEO | ECOVERS_TGEO_TGEO | EDISJOINT_TGEO_TGEO | ECONTAINS_TGEO_TGEO | ETOUCHES_TGEO_TGEO | AINTERSECTS_TGEO_TGEO | ACOVERS_TGEO_TGEO | ADISJOINT_TGEO_TGEO | ACONTAINS_TGEO_TGEO | ATOUCHES_TGEO_TGEO | EDWITHIN_TGEO_TGEO | ADWITHIN_TGEO_TGEO | GEOM_RELATE_PATTERN | GEOM_INTERSECTS2D | GEOM_DWITHIN2D | GEOM_CONTAINS | GEOM_DISJOINT2D | GEOM_COVERS | GEOM_TOUCHES | GEOM_INTERSECTS3D | GEOM_DWITHIN3D | GEOM_DISTANCE2D | GEOM_DISTANCE3D; sinkClause: INTO sink (',' sink)*; @@ -961,6 +961,8 @@ ACOVERS_TGEO_TGEO: 'ACOVERS_TGEO_TGEO' | 'acovers_tgeo_tgeo'; ADISJOINT_TGEO_TGEO: 'ADISJOINT_TGEO_TGEO' | 'adisjoint_tgeo_tgeo'; ACONTAINS_TGEO_TGEO: 'ACONTAINS_TGEO_TGEO' | 'acontains_tgeo_tgeo'; ATOUCHES_TGEO_TGEO: 'ATOUCHES_TGEO_TGEO' | 'atouches_tgeo_tgeo'; +EDWITHIN_TGEO_TGEO: 'EDWITHIN_TGEO_TGEO' | 'edwithin_tgeo_tgeo'; +ADWITHIN_TGEO_TGEO: 'ADWITHIN_TGEO_TGEO' | 'adwithin_tgeo_tgeo'; GEOM_RELATE_PATTERN: 'GEOM_RELATE_PATTERN' | 'geom_relate_pattern'; GEOM_INTERSECTS2D: 'GEOM_INTERSECTS2D' | 'geom_intersects2d'; GEOM_DWITHIN2D: 'GEOM_DWITHIN2D' | 'geom_dwithin2d'; diff --git a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp index 9297faa125..9ae515ab44 100644 --- a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp +++ b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp @@ -542,6 +542,8 @@ #include #include #include +#include +#include #include #include #include @@ -11323,6 +11325,34 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont return LogicalFunction(AtouchesTgeoTgeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5))); } /* END CODEGEN PARSER GLUE: ATOUCHES_TGEO_TGEO */ + case AntlrSQLParser::EDWITHIN_TGEO_TGEO: { + PRECONDITION(ctx->functionParam().size() == 7, + "EdwithinTgeoTgeo requires 7 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + auto arg5 = visit(ctx->functionParam(5)).as(); + auto arg6 = visit(ctx->functionParam(6)).as(); + return LogicalFunction(EdwithinTgeoTgeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6))); + } + /* END CODEGEN PARSER GLUE: EDWITHIN_TGEO_TGEO */ + case AntlrSQLParser::ADWITHIN_TGEO_TGEO: { + PRECONDITION(ctx->functionParam().size() == 7, + "AdwithinTgeoTgeo requires 7 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + auto arg5 = visit(ctx->functionParam(5)).as(); + auto arg6 = visit(ctx->functionParam(6)).as(); + return LogicalFunction(AdwithinTgeoTgeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6))); + } + /* END CODEGEN PARSER GLUE: ADWITHIN_TGEO_TGEO */ /* END CODEGEN PARSER GLUE: GEOM_RELATE_PATTERN */ /* END CODEGEN PARSER GLUE: GEOM_INTERSECTS2D */ case AntlrSQLParser::GEOM_DWITHIN2D: { From a21fdb1c24d15db393f10d41fddf4ece73e1fd43 Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Thu, 18 Jun 2026 13:02:36 +0200 Subject: [PATCH 86/96] feat(meos): add H3Index static comparator NES operators (W138) 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. --- .../Meos/H3indexCmpLogicalFunction.hpp | 48 +++++++++ .../Meos/H3indexEqLogicalFunction.hpp | 48 +++++++++ .../Meos/H3indexGeLogicalFunction.hpp | 48 +++++++++ .../Meos/H3indexGtLogicalFunction.hpp | 48 +++++++++ .../Meos/H3indexLeLogicalFunction.hpp | 48 +++++++++ .../Meos/H3indexLtLogicalFunction.hpp | 48 +++++++++ .../Meos/H3indexNeLogicalFunction.hpp | 48 +++++++++ .../src/Functions/Meos/CMakeLists.txt | 7 ++ .../Meos/H3indexCmpLogicalFunction.cpp | 99 +++++++++++++++++++ .../Meos/H3indexEqLogicalFunction.cpp | 99 +++++++++++++++++++ .../Meos/H3indexGeLogicalFunction.cpp | 99 +++++++++++++++++++ .../Meos/H3indexGtLogicalFunction.cpp | 99 +++++++++++++++++++ .../Meos/H3indexLeLogicalFunction.cpp | 99 +++++++++++++++++++ .../Meos/H3indexLtLogicalFunction.cpp | 99 +++++++++++++++++++ .../Meos/H3indexNeLogicalFunction.cpp | 99 +++++++++++++++++++ .../Meos/H3indexCmpPhysicalFunction.hpp | 32 ++++++ .../Meos/H3indexEqPhysicalFunction.hpp | 32 ++++++ .../Meos/H3indexGePhysicalFunction.hpp | 32 ++++++ .../Meos/H3indexGtPhysicalFunction.hpp | 32 ++++++ .../Meos/H3indexLePhysicalFunction.hpp | 32 ++++++ .../Meos/H3indexLtPhysicalFunction.hpp | 32 ++++++ .../Meos/H3indexNePhysicalFunction.hpp | 32 ++++++ .../src/Functions/Meos/CMakeLists.txt | 7 ++ .../Meos/H3indexCmpPhysicalFunction.cpp | 67 +++++++++++++ .../Meos/H3indexEqPhysicalFunction.cpp | 68 +++++++++++++ .../Meos/H3indexGePhysicalFunction.cpp | 68 +++++++++++++ .../Meos/H3indexGtPhysicalFunction.cpp | 68 +++++++++++++ .../Meos/H3indexLePhysicalFunction.cpp | 68 +++++++++++++ .../Meos/H3indexLtPhysicalFunction.cpp | 68 +++++++++++++ .../Meos/H3indexNePhysicalFunction.cpp | 68 +++++++++++++ nes-sql-parser/AntlrSQL.g4 | 9 +- .../src/AntlrSQLQueryPlanCreator.cpp | 70 +++++++++++++ 32 files changed, 1820 insertions(+), 1 deletion(-) create mode 100644 nes-logical-operators/include/Functions/Meos/H3indexCmpLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/H3indexEqLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/H3indexGeLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/H3indexGtLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/H3indexLeLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/H3indexLtLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/H3indexNeLogicalFunction.hpp create mode 100644 nes-logical-operators/src/Functions/Meos/H3indexCmpLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/H3indexEqLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/H3indexGeLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/H3indexGtLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/H3indexLeLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/H3indexLtLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/H3indexNeLogicalFunction.cpp create mode 100644 nes-physical-operators/include/Functions/Meos/H3indexCmpPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/H3indexEqPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/H3indexGePhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/H3indexGtPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/H3indexLePhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/H3indexLtPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/H3indexNePhysicalFunction.hpp create mode 100644 nes-physical-operators/src/Functions/Meos/H3indexCmpPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/H3indexEqPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/H3indexGePhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/H3indexGtPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/H3indexLePhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/H3indexLtPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/H3indexNePhysicalFunction.cpp diff --git a/nes-logical-operators/include/Functions/Meos/H3indexCmpLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/H3indexCmpLogicalFunction.hpp new file mode 100644 index 0000000000..2e9785647c --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/H3indexCmpLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns -1, 0, or 1 comparison result for two H3 cell indices. + */ +class H3indexCmpLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "H3indexCmp"; + + H3indexCmpLogicalFunction(LogicalFunction a, LogicalFunction b); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/H3indexEqLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/H3indexEqLogicalFunction.hpp new file mode 100644 index 0000000000..9366a95735 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/H3indexEqLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Tests equality of two H3 cell indices. + */ +class H3indexEqLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "H3indexEq"; + + H3indexEqLogicalFunction(LogicalFunction a, LogicalFunction b); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/H3indexGeLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/H3indexGeLogicalFunction.hpp new file mode 100644 index 0000000000..70ed53efbd --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/H3indexGeLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Tests if H3 cell index a is greater than or equal to b. + */ +class H3indexGeLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "H3indexGe"; + + H3indexGeLogicalFunction(LogicalFunction a, LogicalFunction b); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/H3indexGtLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/H3indexGtLogicalFunction.hpp new file mode 100644 index 0000000000..cf4caadf39 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/H3indexGtLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Tests if H3 cell index a is greater than b. + */ +class H3indexGtLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "H3indexGt"; + + H3indexGtLogicalFunction(LogicalFunction a, LogicalFunction b); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/H3indexLeLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/H3indexLeLogicalFunction.hpp new file mode 100644 index 0000000000..e39658ad3e --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/H3indexLeLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Tests if H3 cell index a is less than or equal to b. + */ +class H3indexLeLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "H3indexLe"; + + H3indexLeLogicalFunction(LogicalFunction a, LogicalFunction b); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/H3indexLtLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/H3indexLtLogicalFunction.hpp new file mode 100644 index 0000000000..11faa7c622 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/H3indexLtLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Tests if H3 cell index a is less than b. + */ +class H3indexLtLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "H3indexLt"; + + H3indexLtLogicalFunction(LogicalFunction a, LogicalFunction b); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/H3indexNeLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/H3indexNeLogicalFunction.hpp new file mode 100644 index 0000000000..3c60d6b995 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/H3indexNeLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Tests inequality of two H3 cell indices. + */ +class H3indexNeLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "H3indexNe"; + + H3indexNeLogicalFunction(LogicalFunction a, LogicalFunction b); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt index 8f922b7599..9e4b98d2e3 100644 --- a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt @@ -493,6 +493,13 @@ add_plugin(AcontainsTgeoTgeo LogicalFunction nes-logical-operators AcontainsTgeo add_plugin(AtouchesTgeoTgeo LogicalFunction nes-logical-operators AtouchesTgeoTgeoLogicalFunction.cpp) add_plugin(EdwithinTgeoTgeo LogicalFunction nes-logical-operators EdwithinTgeoTgeoLogicalFunction.cpp) add_plugin(AdwithinTgeoTgeo LogicalFunction nes-logical-operators AdwithinTgeoTgeoLogicalFunction.cpp) +add_plugin(H3indexEq LogicalFunction nes-logical-operators H3indexEqLogicalFunction.cpp) +add_plugin(H3indexNe LogicalFunction nes-logical-operators H3indexNeLogicalFunction.cpp) +add_plugin(H3indexLt LogicalFunction nes-logical-operators H3indexLtLogicalFunction.cpp) +add_plugin(H3indexLe LogicalFunction nes-logical-operators H3indexLeLogicalFunction.cpp) +add_plugin(H3indexGt LogicalFunction nes-logical-operators H3indexGtLogicalFunction.cpp) +add_plugin(H3indexGe LogicalFunction nes-logical-operators H3indexGeLogicalFunction.cpp) +add_plugin(H3indexCmp LogicalFunction nes-logical-operators H3indexCmpLogicalFunction.cpp) add_plugin(GeomRelatePattern LogicalFunction nes-logical-operators GeomRelatePatternLogicalFunction.cpp) add_plugin(GeomIntersects2d LogicalFunction nes-logical-operators GeomIntersects2dLogicalFunction.cpp) add_plugin(GeomDwithin2d LogicalFunction nes-logical-operators GeomDwithin2dLogicalFunction.cpp) diff --git a/nes-logical-operators/src/Functions/Meos/H3indexCmpLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/H3indexCmpLogicalFunction.cpp new file mode 100644 index 0000000000..4a977150f7 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/H3indexCmpLogicalFunction.cpp @@ -0,0 +1,99 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +H3indexCmpLogicalFunction::H3indexCmpLogicalFunction(LogicalFunction a, LogicalFunction b) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(2); + parameters.push_back(std::move(a)); + parameters.push_back(std::move(b)); +} + +DataType H3indexCmpLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction H3indexCmpLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector H3indexCmpLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction H3indexCmpLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 2, + "H3indexCmpLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view H3indexCmpLogicalFunction::getType() const { return NAME; } + +bool H3indexCmpLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string H3indexCmpLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction H3indexCmpLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(2); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "a must be UINT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "b must be UINT64"); + return withChildren(c); +} + +SerializableFunction H3indexCmpLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterH3indexCmpLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 2, + "H3indexCmpLogicalFunction requires 2 children but got {}", + arguments.children.size()); + return H3indexCmpLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/H3indexEqLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/H3indexEqLogicalFunction.cpp new file mode 100644 index 0000000000..95f6683a2c --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/H3indexEqLogicalFunction.cpp @@ -0,0 +1,99 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +H3indexEqLogicalFunction::H3indexEqLogicalFunction(LogicalFunction a, LogicalFunction b) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(2); + parameters.push_back(std::move(a)); + parameters.push_back(std::move(b)); +} + +DataType H3indexEqLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction H3indexEqLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector H3indexEqLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction H3indexEqLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 2, + "H3indexEqLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view H3indexEqLogicalFunction::getType() const { return NAME; } + +bool H3indexEqLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string H3indexEqLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction H3indexEqLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(2); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "a must be UINT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "b must be UINT64"); + return withChildren(c); +} + +SerializableFunction H3indexEqLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterH3indexEqLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 2, + "H3indexEqLogicalFunction requires 2 children but got {}", + arguments.children.size()); + return H3indexEqLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/H3indexGeLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/H3indexGeLogicalFunction.cpp new file mode 100644 index 0000000000..66b18248f0 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/H3indexGeLogicalFunction.cpp @@ -0,0 +1,99 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +H3indexGeLogicalFunction::H3indexGeLogicalFunction(LogicalFunction a, LogicalFunction b) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(2); + parameters.push_back(std::move(a)); + parameters.push_back(std::move(b)); +} + +DataType H3indexGeLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction H3indexGeLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector H3indexGeLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction H3indexGeLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 2, + "H3indexGeLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view H3indexGeLogicalFunction::getType() const { return NAME; } + +bool H3indexGeLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string H3indexGeLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction H3indexGeLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(2); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "a must be UINT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "b must be UINT64"); + return withChildren(c); +} + +SerializableFunction H3indexGeLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterH3indexGeLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 2, + "H3indexGeLogicalFunction requires 2 children but got {}", + arguments.children.size()); + return H3indexGeLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/H3indexGtLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/H3indexGtLogicalFunction.cpp new file mode 100644 index 0000000000..02774e62c0 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/H3indexGtLogicalFunction.cpp @@ -0,0 +1,99 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +H3indexGtLogicalFunction::H3indexGtLogicalFunction(LogicalFunction a, LogicalFunction b) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(2); + parameters.push_back(std::move(a)); + parameters.push_back(std::move(b)); +} + +DataType H3indexGtLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction H3indexGtLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector H3indexGtLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction H3indexGtLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 2, + "H3indexGtLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view H3indexGtLogicalFunction::getType() const { return NAME; } + +bool H3indexGtLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string H3indexGtLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction H3indexGtLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(2); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "a must be UINT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "b must be UINT64"); + return withChildren(c); +} + +SerializableFunction H3indexGtLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterH3indexGtLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 2, + "H3indexGtLogicalFunction requires 2 children but got {}", + arguments.children.size()); + return H3indexGtLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/H3indexLeLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/H3indexLeLogicalFunction.cpp new file mode 100644 index 0000000000..2116c829a9 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/H3indexLeLogicalFunction.cpp @@ -0,0 +1,99 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +H3indexLeLogicalFunction::H3indexLeLogicalFunction(LogicalFunction a, LogicalFunction b) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(2); + parameters.push_back(std::move(a)); + parameters.push_back(std::move(b)); +} + +DataType H3indexLeLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction H3indexLeLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector H3indexLeLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction H3indexLeLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 2, + "H3indexLeLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view H3indexLeLogicalFunction::getType() const { return NAME; } + +bool H3indexLeLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string H3indexLeLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction H3indexLeLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(2); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "a must be UINT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "b must be UINT64"); + return withChildren(c); +} + +SerializableFunction H3indexLeLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterH3indexLeLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 2, + "H3indexLeLogicalFunction requires 2 children but got {}", + arguments.children.size()); + return H3indexLeLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/H3indexLtLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/H3indexLtLogicalFunction.cpp new file mode 100644 index 0000000000..330cad365b --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/H3indexLtLogicalFunction.cpp @@ -0,0 +1,99 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +H3indexLtLogicalFunction::H3indexLtLogicalFunction(LogicalFunction a, LogicalFunction b) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(2); + parameters.push_back(std::move(a)); + parameters.push_back(std::move(b)); +} + +DataType H3indexLtLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction H3indexLtLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector H3indexLtLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction H3indexLtLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 2, + "H3indexLtLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view H3indexLtLogicalFunction::getType() const { return NAME; } + +bool H3indexLtLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string H3indexLtLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction H3indexLtLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(2); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "a must be UINT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "b must be UINT64"); + return withChildren(c); +} + +SerializableFunction H3indexLtLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterH3indexLtLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 2, + "H3indexLtLogicalFunction requires 2 children but got {}", + arguments.children.size()); + return H3indexLtLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/H3indexNeLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/H3indexNeLogicalFunction.cpp new file mode 100644 index 0000000000..c22c3d2263 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/H3indexNeLogicalFunction.cpp @@ -0,0 +1,99 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +H3indexNeLogicalFunction::H3indexNeLogicalFunction(LogicalFunction a, LogicalFunction b) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(2); + parameters.push_back(std::move(a)); + parameters.push_back(std::move(b)); +} + +DataType H3indexNeLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction H3indexNeLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector H3indexNeLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction H3indexNeLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 2, + "H3indexNeLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view H3indexNeLogicalFunction::getType() const { return NAME; } + +bool H3indexNeLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string H3indexNeLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction H3indexNeLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(2); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "a must be UINT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "b must be UINT64"); + return withChildren(c); +} + +SerializableFunction H3indexNeLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterH3indexNeLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 2, + "H3indexNeLogicalFunction requires 2 children but got {}", + arguments.children.size()); + return H3indexNeLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1])); +} + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/H3indexCmpPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/H3indexCmpPhysicalFunction.hpp new file mode 100644 index 0000000000..5c8febc7a3 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/H3indexCmpPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class H3indexCmpPhysicalFunction : public PhysicalFunctionConcept { +public: + H3indexCmpPhysicalFunction(PhysicalFunction a, PhysicalFunction b); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/H3indexEqPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/H3indexEqPhysicalFunction.hpp new file mode 100644 index 0000000000..7dc9cacf8a --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/H3indexEqPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class H3indexEqPhysicalFunction : public PhysicalFunctionConcept { +public: + H3indexEqPhysicalFunction(PhysicalFunction a, PhysicalFunction b); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/H3indexGePhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/H3indexGePhysicalFunction.hpp new file mode 100644 index 0000000000..ebcaf7dcac --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/H3indexGePhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class H3indexGePhysicalFunction : public PhysicalFunctionConcept { +public: + H3indexGePhysicalFunction(PhysicalFunction a, PhysicalFunction b); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/H3indexGtPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/H3indexGtPhysicalFunction.hpp new file mode 100644 index 0000000000..50bf965ca3 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/H3indexGtPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class H3indexGtPhysicalFunction : public PhysicalFunctionConcept { +public: + H3indexGtPhysicalFunction(PhysicalFunction a, PhysicalFunction b); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/H3indexLePhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/H3indexLePhysicalFunction.hpp new file mode 100644 index 0000000000..d08a506963 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/H3indexLePhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class H3indexLePhysicalFunction : public PhysicalFunctionConcept { +public: + H3indexLePhysicalFunction(PhysicalFunction a, PhysicalFunction b); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/H3indexLtPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/H3indexLtPhysicalFunction.hpp new file mode 100644 index 0000000000..6e58dce8f0 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/H3indexLtPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class H3indexLtPhysicalFunction : public PhysicalFunctionConcept { +public: + H3indexLtPhysicalFunction(PhysicalFunction a, PhysicalFunction b); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/H3indexNePhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/H3indexNePhysicalFunction.hpp new file mode 100644 index 0000000000..3065e3e410 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/H3indexNePhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class H3indexNePhysicalFunction : public PhysicalFunctionConcept { +public: + H3indexNePhysicalFunction(PhysicalFunction a, PhysicalFunction b); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt index 49ed24d7dd..76515d0644 100644 --- a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt @@ -492,6 +492,13 @@ add_plugin(AcontainsTgeoTgeo PhysicalFunction nes-physical-operators AcontainsTg add_plugin(AtouchesTgeoTgeo PhysicalFunction nes-physical-operators AtouchesTgeoTgeoPhysicalFunction.cpp) add_plugin(EdwithinTgeoTgeo PhysicalFunction nes-physical-operators EdwithinTgeoTgeoPhysicalFunction.cpp) add_plugin(AdwithinTgeoTgeo PhysicalFunction nes-physical-operators AdwithinTgeoTgeoPhysicalFunction.cpp) +add_plugin(H3indexEq PhysicalFunction nes-physical-operators H3indexEqPhysicalFunction.cpp) +add_plugin(H3indexNe PhysicalFunction nes-physical-operators H3indexNePhysicalFunction.cpp) +add_plugin(H3indexLt PhysicalFunction nes-physical-operators H3indexLtPhysicalFunction.cpp) +add_plugin(H3indexLe PhysicalFunction nes-physical-operators H3indexLePhysicalFunction.cpp) +add_plugin(H3indexGt PhysicalFunction nes-physical-operators H3indexGtPhysicalFunction.cpp) +add_plugin(H3indexGe PhysicalFunction nes-physical-operators H3indexGePhysicalFunction.cpp) +add_plugin(H3indexCmp PhysicalFunction nes-physical-operators H3indexCmpPhysicalFunction.cpp) add_plugin(GeomRelatePattern PhysicalFunction nes-physical-operators GeomRelatePatternPhysicalFunction.cpp) add_plugin(GeomIntersects2d PhysicalFunction nes-physical-operators GeomIntersects2dPhysicalFunction.cpp) add_plugin(GeomDwithin2d PhysicalFunction nes-physical-operators GeomDwithin2dPhysicalFunction.cpp) diff --git a/nes-physical-operators/src/Functions/Meos/H3indexCmpPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/H3indexCmpPhysicalFunction.cpp new file mode 100644 index 0000000000..13a6b9d241 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/H3indexCmpPhysicalFunction.cpp @@ -0,0 +1,67 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +H3indexCmpPhysicalFunction::H3indexCmpPhysicalFunction(PhysicalFunction a, PhysicalFunction b) +{ + paramFns.reserve(2); + paramFns.push_back(std::move(a)); + paramFns.push_back(std::move(b)); +} + +VarVal H3indexCmpPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto a = paramFns[0].execute(record, arena).cast(); + auto b = paramFns[1].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](uint64_t a, uint64_t b) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + return (double)h3index_cmp((H3Index)a, (H3Index)b); + } catch (const std::exception&) { return 0.0; } + }, + a, b); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterH3indexCmpPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 2, + "H3indexCmpPhysicalFunction requires 2 children but got {}", + arguments.childFunctions.size()); + return H3indexCmpPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/H3indexEqPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/H3indexEqPhysicalFunction.cpp new file mode 100644 index 0000000000..ad35230f13 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/H3indexEqPhysicalFunction.cpp @@ -0,0 +1,68 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +H3indexEqPhysicalFunction::H3indexEqPhysicalFunction(PhysicalFunction a, PhysicalFunction b) +{ + paramFns.reserve(2); + paramFns.push_back(std::move(a)); + paramFns.push_back(std::move(b)); +} + +VarVal H3indexEqPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto a = paramFns[0].execute(record, arena).cast(); + auto b = paramFns[1].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](uint64_t a, uint64_t b) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + bool r = h3index_eq((H3Index)a, (H3Index)b); + return r ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + a, b); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterH3indexEqPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 2, + "H3indexEqPhysicalFunction requires 2 children but got {}", + arguments.childFunctions.size()); + return H3indexEqPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/H3indexGePhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/H3indexGePhysicalFunction.cpp new file mode 100644 index 0000000000..2a3e75abac --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/H3indexGePhysicalFunction.cpp @@ -0,0 +1,68 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +H3indexGePhysicalFunction::H3indexGePhysicalFunction(PhysicalFunction a, PhysicalFunction b) +{ + paramFns.reserve(2); + paramFns.push_back(std::move(a)); + paramFns.push_back(std::move(b)); +} + +VarVal H3indexGePhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto a = paramFns[0].execute(record, arena).cast(); + auto b = paramFns[1].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](uint64_t a, uint64_t b) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + bool r = h3index_ge((H3Index)a, (H3Index)b); + return r ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + a, b); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterH3indexGePhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 2, + "H3indexGePhysicalFunction requires 2 children but got {}", + arguments.childFunctions.size()); + return H3indexGePhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/H3indexGtPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/H3indexGtPhysicalFunction.cpp new file mode 100644 index 0000000000..c7125d6c48 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/H3indexGtPhysicalFunction.cpp @@ -0,0 +1,68 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +H3indexGtPhysicalFunction::H3indexGtPhysicalFunction(PhysicalFunction a, PhysicalFunction b) +{ + paramFns.reserve(2); + paramFns.push_back(std::move(a)); + paramFns.push_back(std::move(b)); +} + +VarVal H3indexGtPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto a = paramFns[0].execute(record, arena).cast(); + auto b = paramFns[1].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](uint64_t a, uint64_t b) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + bool r = h3index_gt((H3Index)a, (H3Index)b); + return r ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + a, b); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterH3indexGtPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 2, + "H3indexGtPhysicalFunction requires 2 children but got {}", + arguments.childFunctions.size()); + return H3indexGtPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/H3indexLePhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/H3indexLePhysicalFunction.cpp new file mode 100644 index 0000000000..36cc8f4658 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/H3indexLePhysicalFunction.cpp @@ -0,0 +1,68 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +H3indexLePhysicalFunction::H3indexLePhysicalFunction(PhysicalFunction a, PhysicalFunction b) +{ + paramFns.reserve(2); + paramFns.push_back(std::move(a)); + paramFns.push_back(std::move(b)); +} + +VarVal H3indexLePhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto a = paramFns[0].execute(record, arena).cast(); + auto b = paramFns[1].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](uint64_t a, uint64_t b) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + bool r = h3index_le((H3Index)a, (H3Index)b); + return r ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + a, b); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterH3indexLePhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 2, + "H3indexLePhysicalFunction requires 2 children but got {}", + arguments.childFunctions.size()); + return H3indexLePhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/H3indexLtPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/H3indexLtPhysicalFunction.cpp new file mode 100644 index 0000000000..b7d302be73 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/H3indexLtPhysicalFunction.cpp @@ -0,0 +1,68 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +H3indexLtPhysicalFunction::H3indexLtPhysicalFunction(PhysicalFunction a, PhysicalFunction b) +{ + paramFns.reserve(2); + paramFns.push_back(std::move(a)); + paramFns.push_back(std::move(b)); +} + +VarVal H3indexLtPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto a = paramFns[0].execute(record, arena).cast(); + auto b = paramFns[1].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](uint64_t a, uint64_t b) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + bool r = h3index_lt((H3Index)a, (H3Index)b); + return r ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + a, b); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterH3indexLtPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 2, + "H3indexLtPhysicalFunction requires 2 children but got {}", + arguments.childFunctions.size()); + return H3indexLtPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/H3indexNePhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/H3indexNePhysicalFunction.cpp new file mode 100644 index 0000000000..10b3891b6e --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/H3indexNePhysicalFunction.cpp @@ -0,0 +1,68 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +H3indexNePhysicalFunction::H3indexNePhysicalFunction(PhysicalFunction a, PhysicalFunction b) +{ + paramFns.reserve(2); + paramFns.push_back(std::move(a)); + paramFns.push_back(std::move(b)); +} + +VarVal H3indexNePhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto a = paramFns[0].execute(record, arena).cast(); + auto b = paramFns[1].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](uint64_t a, uint64_t b) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + bool r = h3index_ne((H3Index)a, (H3Index)b); + return r ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + a, b); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterH3indexNePhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 2, + "H3indexNePhysicalFunction requires 2 children but got {}", + arguments.childFunctions.size()); + return H3indexNePhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1])); +} + +} // namespace NES diff --git a/nes-sql-parser/AntlrSQL.g4 b/nes-sql-parser/AntlrSQL.g4 index 0e6b471cba..06fcd39779 100644 --- a/nes-sql-parser/AntlrSQL.g4 +++ b/nes-sql-parser/AntlrSQL.g4 @@ -295,7 +295,7 @@ timeUnit: MS timestampParameter: name=identifier; -functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT | TGE_TTEXT_TEXT | TGE_TEXT_TTEXT | TGT_TTEXT_TEXT | TGT_TEXT_TTEXT | TLE_TTEXT_TEXT | TLE_TEXT_TTEXT | TLT_TTEXT_TEXT | TLT_TEXT_TTEXT | TTEXT_UPPER | TTEXT_LOWER | TTEXT_INITCAP | TEXTCAT_TTEXT_TEXT | TEXTCAT_TEXT_TTEXT | TEXTCAT_TTEXT_TTEXT | GEOM_LENGTH | GEOM_PERIMETER | GEOM_AZIMUTH | GEOG_AREA | GEOG_LENGTH | GEOG_PERIMETER | GEOM_IS_EMPTY | AINTERSECTS_TGEO_GEO | ACOVERS_TGEO_GEO | ADISJOINT_TGEO_GEO | ADWITHIN_TGEO_GEO | EINTERSECTS_TGEO_GEO | ETOUCHES_TGEO_GEO | ECONTAINS_TGEO_GEO | ACONTAINS_TGEO_GEO | ATOUCHES_TGEO_GEO | GEO_NUM_POINTS | GEO_NUM_GEOS | GEO_SRID | GEO_IS_UNITARY | GEO_EQUALS | GEO_SAME | GEOG_DISTANCE | NAD_TGEO_GEO | EVER_EQ_TGEO_GEO | EVER_NE_TGEO_GEO | ALWAYS_EQ_TGEO_GEO | ALWAYS_NE_TGEO_GEO | GEOG_INTERSECTS | GEOG_DWITHIN | ACOVERS_GEO_TGEO | GEOM_INTERSECTS | GEOM_DWITHIN | H3_GS_POINT_TO_CELL | EVER_EQ_TH3INDEX_H3INDEX | EVER_NE_TH3INDEX_H3INDEX | ALWAYS_EQ_TH3INDEX_H3INDEX | ALWAYS_NE_TH3INDEX_H3INDEX | TH3INDEX_GET_RESOLUTION | TH3INDEX_GET_BASE_CELL_NUMBER | TH3INDEX_IS_VALID_CELL | TH3INDEX_IS_PENTAGON | TH3INDEX_CELL_TO_PARENT_NEXT | TH3INDEX_CELL_TO_CENTER_CHILD_NEXT | TH3INDEX_CELL_TO_PARENT | TH3INDEX_CELL_TO_CENTER_CHILD | TH3INDEX_CELL_TO_CHILD_POS | TH3INDEX_ARE_NEIGHBOR_CELLS | TH3INDEX_GRID_DISTANCE | EINTERSECTS_TCBUFFER_GEO | AINTERSECTS_TCBUFFER_GEO | ECOVERS_TCBUFFER_GEO | ACOVERS_TCBUFFER_GEO | EDISJOINT_TCBUFFER_GEO | ADISJOINT_TCBUFFER_GEO | ETOUCHES_TCBUFFER_GEO | ATOUCHES_TCBUFFER_GEO | ECONTAINS_TCBUFFER_GEO | ACONTAINS_TCBUFFER_GEO | NAD_TCBUFFER_GEO | EDWITHIN_TCBUFFER_GEO | ADWITHIN_TCBUFFER_GEO | EINTERSECTS_TCBUFFER_CBUFFER | AINTERSECTS_TCBUFFER_CBUFFER | ECOVERS_TCBUFFER_CBUFFER | ACOVERS_TCBUFFER_CBUFFER | EDISJOINT_TCBUFFER_CBUFFER | ADISJOINT_TCBUFFER_CBUFFER | ETOUCHES_TCBUFFER_CBUFFER | ATOUCHES_TCBUFFER_CBUFFER | ECONTAINS_TCBUFFER_CBUFFER | ACONTAINS_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_CBUFFER | ALWAYS_EQ_TCBUFFER_CBUFFER | EVER_NE_TCBUFFER_CBUFFER | ALWAYS_NE_TCBUFFER_CBUFFER | NAD_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_TCBUFFER | ALWAYS_EQ_TCBUFFER_TCBUFFER | EVER_NE_TCBUFFER_TCBUFFER | ALWAYS_NE_TCBUFFER_TCBUFFER | EINTERSECTS_TCBUFFER_TCBUFFER | AINTERSECTS_TCBUFFER_TCBUFFER | ECOVERS_TCBUFFER_TCBUFFER | ACOVERS_TCBUFFER_TCBUFFER | ADISJOINT_TCBUFFER_TCBUFFER | ETOUCHES_TCBUFFER_TCBUFFER | ATOUCHES_TCBUFFER_TCBUFFER | NAD_TCBUFFER_TCBUFFER | EDWITHIN_TCBUFFER_TCBUFFER | ADWITHIN_TCBUFFER_TCBUFFER | MINDISTANCE_TCBUFFER_TCBUFFER | NAD_TNPOINT_GEO | EVER_EQ_TNPOINT_NPOINT | ALWAYS_EQ_TNPOINT_NPOINT | EVER_NE_TNPOINT_NPOINT | ALWAYS_NE_TNPOINT_NPOINT | NAD_TNPOINT_NPOINT | EVER_EQ_NPOINT_TNPOINT | ALWAYS_EQ_NPOINT_TNPOINT | EVER_NE_NPOINT_TNPOINT | ALWAYS_NE_NPOINT_TNPOINT | EVER_EQ_TNPOINT_TNPOINT | ALWAYS_EQ_TNPOINT_TNPOINT | EVER_NE_TNPOINT_TNPOINT | ALWAYS_NE_TNPOINT_TNPOINT | NAD_TNPOINT_TNPOINT | NAD_TPOSE_GEO | EVER_EQ_TPOSE_POSE | ALWAYS_EQ_TPOSE_POSE | EVER_NE_TPOSE_POSE | ALWAYS_NE_TPOSE_POSE | NAD_TPOSE_POSE | EVER_EQ_POSE_TPOSE | ALWAYS_EQ_POSE_TPOSE | EVER_NE_POSE_TPOSE | ALWAYS_NE_POSE_TPOSE | EVER_EQ_TPOSE_TPOSE | ALWAYS_EQ_TPOSE_TPOSE | EVER_NE_TPOSE_TPOSE | ALWAYS_NE_TPOSE_TPOSE | NAD_TPOSE_TPOSE | EVER_EQ_TRGEOMETRY_GEO | ALWAYS_EQ_TRGEOMETRY_GEO | EVER_NE_TRGEOMETRY_GEO | ALWAYS_NE_TRGEOMETRY_GEO | NAD_TRGEOMETRY_GEO | EVER_EQ_GEO_TRGEOMETRY | ALWAYS_EQ_GEO_TRGEOMETRY | EVER_NE_GEO_TRGEOMETRY | ALWAYS_NE_GEO_TRGEOMETRY | EVER_EQ_TRGEOMETRY_TRGEOMETRY | ALWAYS_EQ_TRGEOMETRY_TRGEOMETRY | EVER_NE_TRGEOMETRY_TRGEOMETRY | ALWAYS_NE_TRGEOMETRY_TRGEOMETRY | NAD_TRGEOMETRY_TRGEOMETRY | EINTERSECTS_TPCPOINT_GEO | NAD_TPCPOINT_GEO | QUADBIN_POINT_TO_CELL | QUADBIN_IS_VALID_CELL | QUADBIN_GET_RESOLUTION | QUADBIN_CELL_AREA | QUADBIN_CELL_TO_QUADKEY | QUADBIN_CELL_TO_PARENT | QUADBIN_TILE_TO_CELL | EVER_EQ_TJSONB_JSONB | ALWAYS_EQ_TJSONB_JSONB | EVER_NE_TJSONB_JSONB | ALWAYS_NE_TJSONB_JSONB | EVER_EQ_TJSONB_TJSONB | ALWAYS_EQ_TJSONB_TJSONB | EVER_NE_TJSONB_TJSONB | ALWAYS_NE_TJSONB_TJSONB | GEOM_BOUNDARY | GEOM_CENTROID | GEOM_CONVEX_HULL | GEO_REVERSE | GEO_POINTS | GEOM_UNARY_UNION | GEOM_DIFFERENCE2D | GEOM_INTERSECTION2D | GEOM_SHORTESTLINE2D | GEOM_SHORTESTLINE3D | GEO_SET_SRID | GEO_TRANSFORM | GEO_ROUND | GEOM_BUFFER | LINE_NUMPOINTS | LINE_LOCATE_POINT | LINE_INTERPOLATE_POINT | LINE_SUBSTRING | GEOM_POINT_MAKE2D | GEOM_POINT_MAKE3DZ | GEOG_POINT_MAKE2D | GEOG_POINT_MAKE3DZ | GEOM_TO_GEOG | GEOG_TO_GEOM | GEOG_CENTROID | GEO_GEO_N | LINE_POINT_N | GEOM_INTERSECTION2D_COLL | GEO_AS_GEOJSON | GEO_AS_HEXEWKB | GEO_AS_EWKT | GEO_FROM_GEOJSON | GEOM_FROM_HEXEWKB | GEO_TRANSFORM_PIPELINE | GEOM_MIN_BOUNDING_CENTER | GEOM_MIN_BOUNDING_RADIUS | EVER_EQ_TGEO_TGEO | EVER_NE_TGEO_TGEO | ALWAYS_EQ_TGEO_TGEO | ALWAYS_NE_TGEO_TGEO | EINTERSECTS_TGEO_TGEO | ECOVERS_TGEO_TGEO | EDISJOINT_TGEO_TGEO | ECONTAINS_TGEO_TGEO | ETOUCHES_TGEO_TGEO | AINTERSECTS_TGEO_TGEO | ACOVERS_TGEO_TGEO | ADISJOINT_TGEO_TGEO | ACONTAINS_TGEO_TGEO | ATOUCHES_TGEO_TGEO | EDWITHIN_TGEO_TGEO | ADWITHIN_TGEO_TGEO | GEOM_RELATE_PATTERN | GEOM_INTERSECTS2D | GEOM_DWITHIN2D | GEOM_CONTAINS | GEOM_DISJOINT2D | GEOM_COVERS | GEOM_TOUCHES | GEOM_INTERSECTS3D | GEOM_DWITHIN3D | GEOM_DISTANCE2D | GEOM_DISTANCE3D; +functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT | TGE_TTEXT_TEXT | TGE_TEXT_TTEXT | TGT_TTEXT_TEXT | TGT_TEXT_TTEXT | TLE_TTEXT_TEXT | TLE_TEXT_TTEXT | TLT_TTEXT_TEXT | TLT_TEXT_TTEXT | TTEXT_UPPER | TTEXT_LOWER | TTEXT_INITCAP | TEXTCAT_TTEXT_TEXT | TEXTCAT_TEXT_TTEXT | TEXTCAT_TTEXT_TTEXT | GEOM_LENGTH | GEOM_PERIMETER | GEOM_AZIMUTH | GEOG_AREA | GEOG_LENGTH | GEOG_PERIMETER | GEOM_IS_EMPTY | AINTERSECTS_TGEO_GEO | ACOVERS_TGEO_GEO | ADISJOINT_TGEO_GEO | ADWITHIN_TGEO_GEO | EINTERSECTS_TGEO_GEO | ETOUCHES_TGEO_GEO | ECONTAINS_TGEO_GEO | ACONTAINS_TGEO_GEO | ATOUCHES_TGEO_GEO | GEO_NUM_POINTS | GEO_NUM_GEOS | GEO_SRID | GEO_IS_UNITARY | GEO_EQUALS | GEO_SAME | GEOG_DISTANCE | NAD_TGEO_GEO | EVER_EQ_TGEO_GEO | EVER_NE_TGEO_GEO | ALWAYS_EQ_TGEO_GEO | ALWAYS_NE_TGEO_GEO | GEOG_INTERSECTS | GEOG_DWITHIN | ACOVERS_GEO_TGEO | GEOM_INTERSECTS | GEOM_DWITHIN | H3_GS_POINT_TO_CELL | EVER_EQ_TH3INDEX_H3INDEX | EVER_NE_TH3INDEX_H3INDEX | ALWAYS_EQ_TH3INDEX_H3INDEX | ALWAYS_NE_TH3INDEX_H3INDEX | TH3INDEX_GET_RESOLUTION | TH3INDEX_GET_BASE_CELL_NUMBER | TH3INDEX_IS_VALID_CELL | TH3INDEX_IS_PENTAGON | TH3INDEX_CELL_TO_PARENT_NEXT | TH3INDEX_CELL_TO_CENTER_CHILD_NEXT | TH3INDEX_CELL_TO_PARENT | TH3INDEX_CELL_TO_CENTER_CHILD | TH3INDEX_CELL_TO_CHILD_POS | TH3INDEX_ARE_NEIGHBOR_CELLS | TH3INDEX_GRID_DISTANCE | EINTERSECTS_TCBUFFER_GEO | AINTERSECTS_TCBUFFER_GEO | ECOVERS_TCBUFFER_GEO | ACOVERS_TCBUFFER_GEO | EDISJOINT_TCBUFFER_GEO | ADISJOINT_TCBUFFER_GEO | ETOUCHES_TCBUFFER_GEO | ATOUCHES_TCBUFFER_GEO | ECONTAINS_TCBUFFER_GEO | ACONTAINS_TCBUFFER_GEO | NAD_TCBUFFER_GEO | EDWITHIN_TCBUFFER_GEO | ADWITHIN_TCBUFFER_GEO | EINTERSECTS_TCBUFFER_CBUFFER | AINTERSECTS_TCBUFFER_CBUFFER | ECOVERS_TCBUFFER_CBUFFER | ACOVERS_TCBUFFER_CBUFFER | EDISJOINT_TCBUFFER_CBUFFER | ADISJOINT_TCBUFFER_CBUFFER | ETOUCHES_TCBUFFER_CBUFFER | ATOUCHES_TCBUFFER_CBUFFER | ECONTAINS_TCBUFFER_CBUFFER | ACONTAINS_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_CBUFFER | ALWAYS_EQ_TCBUFFER_CBUFFER | EVER_NE_TCBUFFER_CBUFFER | ALWAYS_NE_TCBUFFER_CBUFFER | NAD_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_TCBUFFER | ALWAYS_EQ_TCBUFFER_TCBUFFER | EVER_NE_TCBUFFER_TCBUFFER | ALWAYS_NE_TCBUFFER_TCBUFFER | EINTERSECTS_TCBUFFER_TCBUFFER | AINTERSECTS_TCBUFFER_TCBUFFER | ECOVERS_TCBUFFER_TCBUFFER | ACOVERS_TCBUFFER_TCBUFFER | ADISJOINT_TCBUFFER_TCBUFFER | ETOUCHES_TCBUFFER_TCBUFFER | ATOUCHES_TCBUFFER_TCBUFFER | NAD_TCBUFFER_TCBUFFER | EDWITHIN_TCBUFFER_TCBUFFER | ADWITHIN_TCBUFFER_TCBUFFER | MINDISTANCE_TCBUFFER_TCBUFFER | NAD_TNPOINT_GEO | EVER_EQ_TNPOINT_NPOINT | ALWAYS_EQ_TNPOINT_NPOINT | EVER_NE_TNPOINT_NPOINT | ALWAYS_NE_TNPOINT_NPOINT | NAD_TNPOINT_NPOINT | EVER_EQ_NPOINT_TNPOINT | ALWAYS_EQ_NPOINT_TNPOINT | EVER_NE_NPOINT_TNPOINT | ALWAYS_NE_NPOINT_TNPOINT | EVER_EQ_TNPOINT_TNPOINT | ALWAYS_EQ_TNPOINT_TNPOINT | EVER_NE_TNPOINT_TNPOINT | ALWAYS_NE_TNPOINT_TNPOINT | NAD_TNPOINT_TNPOINT | NAD_TPOSE_GEO | EVER_EQ_TPOSE_POSE | ALWAYS_EQ_TPOSE_POSE | EVER_NE_TPOSE_POSE | ALWAYS_NE_TPOSE_POSE | NAD_TPOSE_POSE | EVER_EQ_POSE_TPOSE | ALWAYS_EQ_POSE_TPOSE | EVER_NE_POSE_TPOSE | ALWAYS_NE_POSE_TPOSE | EVER_EQ_TPOSE_TPOSE | ALWAYS_EQ_TPOSE_TPOSE | EVER_NE_TPOSE_TPOSE | ALWAYS_NE_TPOSE_TPOSE | NAD_TPOSE_TPOSE | EVER_EQ_TRGEOMETRY_GEO | ALWAYS_EQ_TRGEOMETRY_GEO | EVER_NE_TRGEOMETRY_GEO | ALWAYS_NE_TRGEOMETRY_GEO | NAD_TRGEOMETRY_GEO | EVER_EQ_GEO_TRGEOMETRY | ALWAYS_EQ_GEO_TRGEOMETRY | EVER_NE_GEO_TRGEOMETRY | ALWAYS_NE_GEO_TRGEOMETRY | EVER_EQ_TRGEOMETRY_TRGEOMETRY | ALWAYS_EQ_TRGEOMETRY_TRGEOMETRY | EVER_NE_TRGEOMETRY_TRGEOMETRY | ALWAYS_NE_TRGEOMETRY_TRGEOMETRY | NAD_TRGEOMETRY_TRGEOMETRY | EINTERSECTS_TPCPOINT_GEO | NAD_TPCPOINT_GEO | QUADBIN_POINT_TO_CELL | QUADBIN_IS_VALID_CELL | QUADBIN_GET_RESOLUTION | QUADBIN_CELL_AREA | QUADBIN_CELL_TO_QUADKEY | QUADBIN_CELL_TO_PARENT | QUADBIN_TILE_TO_CELL | EVER_EQ_TJSONB_JSONB | ALWAYS_EQ_TJSONB_JSONB | EVER_NE_TJSONB_JSONB | ALWAYS_NE_TJSONB_JSONB | EVER_EQ_TJSONB_TJSONB | ALWAYS_EQ_TJSONB_TJSONB | EVER_NE_TJSONB_TJSONB | ALWAYS_NE_TJSONB_TJSONB | GEOM_BOUNDARY | GEOM_CENTROID | GEOM_CONVEX_HULL | GEO_REVERSE | GEO_POINTS | GEOM_UNARY_UNION | GEOM_DIFFERENCE2D | GEOM_INTERSECTION2D | GEOM_SHORTESTLINE2D | GEOM_SHORTESTLINE3D | GEO_SET_SRID | GEO_TRANSFORM | GEO_ROUND | GEOM_BUFFER | LINE_NUMPOINTS | LINE_LOCATE_POINT | LINE_INTERPOLATE_POINT | LINE_SUBSTRING | GEOM_POINT_MAKE2D | GEOM_POINT_MAKE3DZ | GEOG_POINT_MAKE2D | GEOG_POINT_MAKE3DZ | GEOM_TO_GEOG | GEOG_TO_GEOM | GEOG_CENTROID | GEO_GEO_N | LINE_POINT_N | GEOM_INTERSECTION2D_COLL | GEO_AS_GEOJSON | GEO_AS_HEXEWKB | GEO_AS_EWKT | GEO_FROM_GEOJSON | GEOM_FROM_HEXEWKB | GEO_TRANSFORM_PIPELINE | GEOM_MIN_BOUNDING_CENTER | GEOM_MIN_BOUNDING_RADIUS | EVER_EQ_TGEO_TGEO | EVER_NE_TGEO_TGEO | ALWAYS_EQ_TGEO_TGEO | ALWAYS_NE_TGEO_TGEO | EINTERSECTS_TGEO_TGEO | ECOVERS_TGEO_TGEO | EDISJOINT_TGEO_TGEO | ECONTAINS_TGEO_TGEO | ETOUCHES_TGEO_TGEO | AINTERSECTS_TGEO_TGEO | ACOVERS_TGEO_TGEO | ADISJOINT_TGEO_TGEO | ACONTAINS_TGEO_TGEO | ATOUCHES_TGEO_TGEO | EDWITHIN_TGEO_TGEO | ADWITHIN_TGEO_TGEO | H3INDEX_EQ | H3INDEX_NE | H3INDEX_LT | H3INDEX_LE | H3INDEX_GT | H3INDEX_GE | H3INDEX_CMP | GEOM_RELATE_PATTERN | GEOM_INTERSECTS2D | GEOM_DWITHIN2D | GEOM_CONTAINS | GEOM_DISJOINT2D | GEOM_COVERS | GEOM_TOUCHES | GEOM_INTERSECTS3D | GEOM_DWITHIN3D | GEOM_DISTANCE2D | GEOM_DISTANCE3D; sinkClause: INTO sink (',' sink)*; @@ -963,6 +963,13 @@ ACONTAINS_TGEO_TGEO: 'ACONTAINS_TGEO_TGEO' | 'acontains_tgeo_tgeo'; ATOUCHES_TGEO_TGEO: 'ATOUCHES_TGEO_TGEO' | 'atouches_tgeo_tgeo'; EDWITHIN_TGEO_TGEO: 'EDWITHIN_TGEO_TGEO' | 'edwithin_tgeo_tgeo'; ADWITHIN_TGEO_TGEO: 'ADWITHIN_TGEO_TGEO' | 'adwithin_tgeo_tgeo'; +H3INDEX_EQ: 'H3INDEX_EQ' | 'h3index_eq'; +H3INDEX_NE: 'H3INDEX_NE' | 'h3index_ne'; +H3INDEX_LT: 'H3INDEX_LT' | 'h3index_lt'; +H3INDEX_LE: 'H3INDEX_LE' | 'h3index_le'; +H3INDEX_GT: 'H3INDEX_GT' | 'h3index_gt'; +H3INDEX_GE: 'H3INDEX_GE' | 'h3index_ge'; +H3INDEX_CMP: 'H3INDEX_CMP' | 'h3index_cmp'; GEOM_RELATE_PATTERN: 'GEOM_RELATE_PATTERN' | 'geom_relate_pattern'; GEOM_INTERSECTS2D: 'GEOM_INTERSECTS2D' | 'geom_intersects2d'; GEOM_DWITHIN2D: 'GEOM_DWITHIN2D' | 'geom_dwithin2d'; diff --git a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp index 9ae515ab44..7275e9ccae 100644 --- a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp +++ b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp @@ -544,6 +544,13 @@ #include #include #include +#include +#include +#include +#include +#include +#include +#include #include #include #include @@ -11353,6 +11360,69 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont return LogicalFunction(AdwithinTgeoTgeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6))); } /* END CODEGEN PARSER GLUE: ADWITHIN_TGEO_TGEO */ + case AntlrSQLParser::H3INDEX_EQ: { + PRECONDITION(ctx->functionParam().size() == 2, + "H3indexEq requires 2 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + return LogicalFunction(H3indexEqLogicalFunction(std::move(arg0), std::move(arg1))); + } + /* END CODEGEN PARSER GLUE: H3INDEX_EQ */ + case AntlrSQLParser::H3INDEX_NE: { + PRECONDITION(ctx->functionParam().size() == 2, + "H3indexNe requires 2 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + return LogicalFunction(H3indexNeLogicalFunction(std::move(arg0), std::move(arg1))); + } + /* END CODEGEN PARSER GLUE: H3INDEX_NE */ + case AntlrSQLParser::H3INDEX_LT: { + PRECONDITION(ctx->functionParam().size() == 2, + "H3indexLt requires 2 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + return LogicalFunction(H3indexLtLogicalFunction(std::move(arg0), std::move(arg1))); + } + /* END CODEGEN PARSER GLUE: H3INDEX_LT */ + case AntlrSQLParser::H3INDEX_LE: { + PRECONDITION(ctx->functionParam().size() == 2, + "H3indexLe requires 2 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + return LogicalFunction(H3indexLeLogicalFunction(std::move(arg0), std::move(arg1))); + } + /* END CODEGEN PARSER GLUE: H3INDEX_LE */ + case AntlrSQLParser::H3INDEX_GT: { + PRECONDITION(ctx->functionParam().size() == 2, + "H3indexGt requires 2 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + return LogicalFunction(H3indexGtLogicalFunction(std::move(arg0), std::move(arg1))); + } + /* END CODEGEN PARSER GLUE: H3INDEX_GT */ + case AntlrSQLParser::H3INDEX_GE: { + PRECONDITION(ctx->functionParam().size() == 2, + "H3indexGe requires 2 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + return LogicalFunction(H3indexGeLogicalFunction(std::move(arg0), std::move(arg1))); + } + /* END CODEGEN PARSER GLUE: H3INDEX_GE */ + case AntlrSQLParser::H3INDEX_CMP: { + PRECONDITION(ctx->functionParam().size() == 2, + "H3indexCmp requires 2 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + return LogicalFunction(H3indexCmpLogicalFunction(std::move(arg0), std::move(arg1))); + } + /* END CODEGEN PARSER GLUE: H3INDEX_CMP */ /* END CODEGEN PARSER GLUE: GEOM_RELATE_PATTERN */ /* END CODEGEN PARSER GLUE: GEOM_INTERSECTS2D */ case AntlrSQLParser::GEOM_DWITHIN2D: { From 982319d2fb519d6442625c6f31bd0fedccc75b62 Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Thu, 18 Jun 2026 16:23:43 +0200 Subject: [PATCH 87/96] feat(meos): add H3INDEX_OUT NES operator (W139) Wires H3INDEX_OUT(cell:UINT64) -> VARCHAR, backed by h3index_out, converting an H3Index cell identifier to its 15-character hex string representation (e.g. '8928308280fffff'). New in ecosystem-pin-2026-06-18b. --- .../Meos/H3indexOutLogicalFunction.hpp | 48 ++++++++++ .../src/Functions/Meos/CMakeLists.txt | 1 + .../Meos/H3indexOutLogicalFunction.cpp | 94 +++++++++++++++++++ .../Meos/H3indexOutPhysicalFunction.hpp | 32 +++++++ .../src/Functions/Meos/CMakeLists.txt | 1 + .../Meos/H3indexOutPhysicalFunction.cpp | 77 +++++++++++++++ nes-sql-parser/AntlrSQL.g4 | 3 +- .../src/AntlrSQLQueryPlanCreator.cpp | 9 ++ 8 files changed, 264 insertions(+), 1 deletion(-) create mode 100644 nes-logical-operators/include/Functions/Meos/H3indexOutLogicalFunction.hpp create mode 100644 nes-logical-operators/src/Functions/Meos/H3indexOutLogicalFunction.cpp create mode 100644 nes-physical-operators/include/Functions/Meos/H3indexOutPhysicalFunction.hpp create mode 100644 nes-physical-operators/src/Functions/Meos/H3indexOutPhysicalFunction.cpp diff --git a/nes-logical-operators/include/Functions/Meos/H3indexOutLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/H3indexOutLogicalFunction.hpp new file mode 100644 index 0000000000..e568b69e10 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/H3indexOutLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Converts an H3Index cell ID (UINT64) to its hex string representation. + */ +class H3indexOutLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "H3indexOut"; + + H3indexOutLogicalFunction(LogicalFunction cell); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt index 9e4b98d2e3..f2dec2bd28 100644 --- a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt @@ -500,6 +500,7 @@ add_plugin(H3indexLe LogicalFunction nes-logical-operators H3indexLeLogicalFunct add_plugin(H3indexGt LogicalFunction nes-logical-operators H3indexGtLogicalFunction.cpp) add_plugin(H3indexGe LogicalFunction nes-logical-operators H3indexGeLogicalFunction.cpp) add_plugin(H3indexCmp LogicalFunction nes-logical-operators H3indexCmpLogicalFunction.cpp) +add_plugin(H3indexOut LogicalFunction nes-logical-operators H3indexOutLogicalFunction.cpp) add_plugin(GeomRelatePattern LogicalFunction nes-logical-operators GeomRelatePatternLogicalFunction.cpp) add_plugin(GeomIntersects2d LogicalFunction nes-logical-operators GeomIntersects2dLogicalFunction.cpp) add_plugin(GeomDwithin2d LogicalFunction nes-logical-operators GeomDwithin2dLogicalFunction.cpp) diff --git a/nes-logical-operators/src/Functions/Meos/H3indexOutLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/H3indexOutLogicalFunction.cpp new file mode 100644 index 0000000000..227f25c0bf --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/H3indexOutLogicalFunction.cpp @@ -0,0 +1,94 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +H3indexOutLogicalFunction::H3indexOutLogicalFunction(LogicalFunction cell) + : dataType(DataTypeProvider::provideDataType(DataType::Type::VARSIZED)) +{ + parameters.reserve(1); + parameters.push_back(std::move(cell)); +} + +DataType H3indexOutLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction H3indexOutLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector H3indexOutLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction H3indexOutLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 1, + "H3indexOutLogicalFunction requires 1 child, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view H3indexOutLogicalFunction::getType() const { return NAME; } + +bool H3indexOutLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string H3indexOutLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction H3indexOutLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(1); + c.emplace_back(parameters[0].withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "cell must be UINT64"); + return withChildren(c); +} + +SerializableFunction H3indexOutLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterH3indexOutLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 1, + "H3indexOutLogicalFunction requires 1 child but got {}", + arguments.children.size()); + return H3indexOutLogicalFunction(std::move(arguments.children[0])); +} + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/H3indexOutPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/H3indexOutPhysicalFunction.hpp new file mode 100644 index 0000000000..4a4e18cb8e --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/H3indexOutPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class H3indexOutPhysicalFunction : public PhysicalFunctionConcept { +public: + H3indexOutPhysicalFunction(PhysicalFunction cell); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt index 76515d0644..c415ee433d 100644 --- a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt @@ -499,6 +499,7 @@ add_plugin(H3indexLe PhysicalFunction nes-physical-operators H3indexLePhysicalFu add_plugin(H3indexGt PhysicalFunction nes-physical-operators H3indexGtPhysicalFunction.cpp) add_plugin(H3indexGe PhysicalFunction nes-physical-operators H3indexGePhysicalFunction.cpp) add_plugin(H3indexCmp PhysicalFunction nes-physical-operators H3indexCmpPhysicalFunction.cpp) +add_plugin(H3indexOut PhysicalFunction nes-physical-operators H3indexOutPhysicalFunction.cpp) add_plugin(GeomRelatePattern PhysicalFunction nes-physical-operators GeomRelatePatternPhysicalFunction.cpp) add_plugin(GeomIntersects2d PhysicalFunction nes-physical-operators GeomIntersects2dPhysicalFunction.cpp) add_plugin(GeomDwithin2d PhysicalFunction nes-physical-operators GeomDwithin2dPhysicalFunction.cpp) diff --git a/nes-physical-operators/src/Functions/Meos/H3indexOutPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/H3indexOutPhysicalFunction.cpp new file mode 100644 index 0000000000..d32838c3f2 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/H3indexOutPhysicalFunction.cpp @@ -0,0 +1,77 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} +#include + +namespace NES { + +H3indexOutPhysicalFunction::H3indexOutPhysicalFunction(PhysicalFunction cell) +{ + paramFns.reserve(1); + paramFns.push_back(std::move(cell)); +} + +VarVal H3indexOutPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto cell = paramFns[0].execute(record, arena).cast(); + + constexpr uint32_t MAX_LEN = 32; + auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); + + const auto actualLen = nautilus::invoke( + +[](uint64_t cell, char* buf, uint32_t bufMax) -> uint32_t { + try { + MEOS::Meos::ensureMeosInitialized(); + char* hex = h3index_out((H3Index)cell); + if (!hex) return 0u; + uint32_t len = static_cast(strlen(hex)); + if (len > bufMax) len = bufMax; + memcpy(buf, hex, len); + free(hex); + return len; + } catch (const std::exception&) { return 0u; } + }, + cell, outBuf.getContent(), nautilus::val(MAX_LEN)); + + VarVal(actualLen).writeToMemory(outBuf.getReference()); + return outBuf; +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterH3indexOutPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 1, + "H3indexOutPhysicalFunction requires 1 child but got {}", + arguments.childFunctions.size()); + return H3indexOutPhysicalFunction(std::move(arguments.childFunctions[0])); +} + +} // namespace NES diff --git a/nes-sql-parser/AntlrSQL.g4 b/nes-sql-parser/AntlrSQL.g4 index 06fcd39779..6ac3d5f7b3 100644 --- a/nes-sql-parser/AntlrSQL.g4 +++ b/nes-sql-parser/AntlrSQL.g4 @@ -295,7 +295,7 @@ timeUnit: MS timestampParameter: name=identifier; -functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT | TGE_TTEXT_TEXT | TGE_TEXT_TTEXT | TGT_TTEXT_TEXT | TGT_TEXT_TTEXT | TLE_TTEXT_TEXT | TLE_TEXT_TTEXT | TLT_TTEXT_TEXT | TLT_TEXT_TTEXT | TTEXT_UPPER | TTEXT_LOWER | TTEXT_INITCAP | TEXTCAT_TTEXT_TEXT | TEXTCAT_TEXT_TTEXT | TEXTCAT_TTEXT_TTEXT | GEOM_LENGTH | GEOM_PERIMETER | GEOM_AZIMUTH | GEOG_AREA | GEOG_LENGTH | GEOG_PERIMETER | GEOM_IS_EMPTY | AINTERSECTS_TGEO_GEO | ACOVERS_TGEO_GEO | ADISJOINT_TGEO_GEO | ADWITHIN_TGEO_GEO | EINTERSECTS_TGEO_GEO | ETOUCHES_TGEO_GEO | ECONTAINS_TGEO_GEO | ACONTAINS_TGEO_GEO | ATOUCHES_TGEO_GEO | GEO_NUM_POINTS | GEO_NUM_GEOS | GEO_SRID | GEO_IS_UNITARY | GEO_EQUALS | GEO_SAME | GEOG_DISTANCE | NAD_TGEO_GEO | EVER_EQ_TGEO_GEO | EVER_NE_TGEO_GEO | ALWAYS_EQ_TGEO_GEO | ALWAYS_NE_TGEO_GEO | GEOG_INTERSECTS | GEOG_DWITHIN | ACOVERS_GEO_TGEO | GEOM_INTERSECTS | GEOM_DWITHIN | H3_GS_POINT_TO_CELL | EVER_EQ_TH3INDEX_H3INDEX | EVER_NE_TH3INDEX_H3INDEX | ALWAYS_EQ_TH3INDEX_H3INDEX | ALWAYS_NE_TH3INDEX_H3INDEX | TH3INDEX_GET_RESOLUTION | TH3INDEX_GET_BASE_CELL_NUMBER | TH3INDEX_IS_VALID_CELL | TH3INDEX_IS_PENTAGON | TH3INDEX_CELL_TO_PARENT_NEXT | TH3INDEX_CELL_TO_CENTER_CHILD_NEXT | TH3INDEX_CELL_TO_PARENT | TH3INDEX_CELL_TO_CENTER_CHILD | TH3INDEX_CELL_TO_CHILD_POS | TH3INDEX_ARE_NEIGHBOR_CELLS | TH3INDEX_GRID_DISTANCE | EINTERSECTS_TCBUFFER_GEO | AINTERSECTS_TCBUFFER_GEO | ECOVERS_TCBUFFER_GEO | ACOVERS_TCBUFFER_GEO | EDISJOINT_TCBUFFER_GEO | ADISJOINT_TCBUFFER_GEO | ETOUCHES_TCBUFFER_GEO | ATOUCHES_TCBUFFER_GEO | ECONTAINS_TCBUFFER_GEO | ACONTAINS_TCBUFFER_GEO | NAD_TCBUFFER_GEO | EDWITHIN_TCBUFFER_GEO | ADWITHIN_TCBUFFER_GEO | EINTERSECTS_TCBUFFER_CBUFFER | AINTERSECTS_TCBUFFER_CBUFFER | ECOVERS_TCBUFFER_CBUFFER | ACOVERS_TCBUFFER_CBUFFER | EDISJOINT_TCBUFFER_CBUFFER | ADISJOINT_TCBUFFER_CBUFFER | ETOUCHES_TCBUFFER_CBUFFER | ATOUCHES_TCBUFFER_CBUFFER | ECONTAINS_TCBUFFER_CBUFFER | ACONTAINS_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_CBUFFER | ALWAYS_EQ_TCBUFFER_CBUFFER | EVER_NE_TCBUFFER_CBUFFER | ALWAYS_NE_TCBUFFER_CBUFFER | NAD_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_TCBUFFER | ALWAYS_EQ_TCBUFFER_TCBUFFER | EVER_NE_TCBUFFER_TCBUFFER | ALWAYS_NE_TCBUFFER_TCBUFFER | EINTERSECTS_TCBUFFER_TCBUFFER | AINTERSECTS_TCBUFFER_TCBUFFER | ECOVERS_TCBUFFER_TCBUFFER | ACOVERS_TCBUFFER_TCBUFFER | ADISJOINT_TCBUFFER_TCBUFFER | ETOUCHES_TCBUFFER_TCBUFFER | ATOUCHES_TCBUFFER_TCBUFFER | NAD_TCBUFFER_TCBUFFER | EDWITHIN_TCBUFFER_TCBUFFER | ADWITHIN_TCBUFFER_TCBUFFER | MINDISTANCE_TCBUFFER_TCBUFFER | NAD_TNPOINT_GEO | EVER_EQ_TNPOINT_NPOINT | ALWAYS_EQ_TNPOINT_NPOINT | EVER_NE_TNPOINT_NPOINT | ALWAYS_NE_TNPOINT_NPOINT | NAD_TNPOINT_NPOINT | EVER_EQ_NPOINT_TNPOINT | ALWAYS_EQ_NPOINT_TNPOINT | EVER_NE_NPOINT_TNPOINT | ALWAYS_NE_NPOINT_TNPOINT | EVER_EQ_TNPOINT_TNPOINT | ALWAYS_EQ_TNPOINT_TNPOINT | EVER_NE_TNPOINT_TNPOINT | ALWAYS_NE_TNPOINT_TNPOINT | NAD_TNPOINT_TNPOINT | NAD_TPOSE_GEO | EVER_EQ_TPOSE_POSE | ALWAYS_EQ_TPOSE_POSE | EVER_NE_TPOSE_POSE | ALWAYS_NE_TPOSE_POSE | NAD_TPOSE_POSE | EVER_EQ_POSE_TPOSE | ALWAYS_EQ_POSE_TPOSE | EVER_NE_POSE_TPOSE | ALWAYS_NE_POSE_TPOSE | EVER_EQ_TPOSE_TPOSE | ALWAYS_EQ_TPOSE_TPOSE | EVER_NE_TPOSE_TPOSE | ALWAYS_NE_TPOSE_TPOSE | NAD_TPOSE_TPOSE | EVER_EQ_TRGEOMETRY_GEO | ALWAYS_EQ_TRGEOMETRY_GEO | EVER_NE_TRGEOMETRY_GEO | ALWAYS_NE_TRGEOMETRY_GEO | NAD_TRGEOMETRY_GEO | EVER_EQ_GEO_TRGEOMETRY | ALWAYS_EQ_GEO_TRGEOMETRY | EVER_NE_GEO_TRGEOMETRY | ALWAYS_NE_GEO_TRGEOMETRY | EVER_EQ_TRGEOMETRY_TRGEOMETRY | ALWAYS_EQ_TRGEOMETRY_TRGEOMETRY | EVER_NE_TRGEOMETRY_TRGEOMETRY | ALWAYS_NE_TRGEOMETRY_TRGEOMETRY | NAD_TRGEOMETRY_TRGEOMETRY | EINTERSECTS_TPCPOINT_GEO | NAD_TPCPOINT_GEO | QUADBIN_POINT_TO_CELL | QUADBIN_IS_VALID_CELL | QUADBIN_GET_RESOLUTION | QUADBIN_CELL_AREA | QUADBIN_CELL_TO_QUADKEY | QUADBIN_CELL_TO_PARENT | QUADBIN_TILE_TO_CELL | EVER_EQ_TJSONB_JSONB | ALWAYS_EQ_TJSONB_JSONB | EVER_NE_TJSONB_JSONB | ALWAYS_NE_TJSONB_JSONB | EVER_EQ_TJSONB_TJSONB | ALWAYS_EQ_TJSONB_TJSONB | EVER_NE_TJSONB_TJSONB | ALWAYS_NE_TJSONB_TJSONB | GEOM_BOUNDARY | GEOM_CENTROID | GEOM_CONVEX_HULL | GEO_REVERSE | GEO_POINTS | GEOM_UNARY_UNION | GEOM_DIFFERENCE2D | GEOM_INTERSECTION2D | GEOM_SHORTESTLINE2D | GEOM_SHORTESTLINE3D | GEO_SET_SRID | GEO_TRANSFORM | GEO_ROUND | GEOM_BUFFER | LINE_NUMPOINTS | LINE_LOCATE_POINT | LINE_INTERPOLATE_POINT | LINE_SUBSTRING | GEOM_POINT_MAKE2D | GEOM_POINT_MAKE3DZ | GEOG_POINT_MAKE2D | GEOG_POINT_MAKE3DZ | GEOM_TO_GEOG | GEOG_TO_GEOM | GEOG_CENTROID | GEO_GEO_N | LINE_POINT_N | GEOM_INTERSECTION2D_COLL | GEO_AS_GEOJSON | GEO_AS_HEXEWKB | GEO_AS_EWKT | GEO_FROM_GEOJSON | GEOM_FROM_HEXEWKB | GEO_TRANSFORM_PIPELINE | GEOM_MIN_BOUNDING_CENTER | GEOM_MIN_BOUNDING_RADIUS | EVER_EQ_TGEO_TGEO | EVER_NE_TGEO_TGEO | ALWAYS_EQ_TGEO_TGEO | ALWAYS_NE_TGEO_TGEO | EINTERSECTS_TGEO_TGEO | ECOVERS_TGEO_TGEO | EDISJOINT_TGEO_TGEO | ECONTAINS_TGEO_TGEO | ETOUCHES_TGEO_TGEO | AINTERSECTS_TGEO_TGEO | ACOVERS_TGEO_TGEO | ADISJOINT_TGEO_TGEO | ACONTAINS_TGEO_TGEO | ATOUCHES_TGEO_TGEO | EDWITHIN_TGEO_TGEO | ADWITHIN_TGEO_TGEO | H3INDEX_EQ | H3INDEX_NE | H3INDEX_LT | H3INDEX_LE | H3INDEX_GT | H3INDEX_GE | H3INDEX_CMP | GEOM_RELATE_PATTERN | GEOM_INTERSECTS2D | GEOM_DWITHIN2D | GEOM_CONTAINS | GEOM_DISJOINT2D | GEOM_COVERS | GEOM_TOUCHES | GEOM_INTERSECTS3D | GEOM_DWITHIN3D | GEOM_DISTANCE2D | GEOM_DISTANCE3D; +functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT | TGE_TTEXT_TEXT | TGE_TEXT_TTEXT | TGT_TTEXT_TEXT | TGT_TEXT_TTEXT | TLE_TTEXT_TEXT | TLE_TEXT_TTEXT | TLT_TTEXT_TEXT | TLT_TEXT_TTEXT | TTEXT_UPPER | TTEXT_LOWER | TTEXT_INITCAP | TEXTCAT_TTEXT_TEXT | TEXTCAT_TEXT_TTEXT | TEXTCAT_TTEXT_TTEXT | GEOM_LENGTH | GEOM_PERIMETER | GEOM_AZIMUTH | GEOG_AREA | GEOG_LENGTH | GEOG_PERIMETER | GEOM_IS_EMPTY | AINTERSECTS_TGEO_GEO | ACOVERS_TGEO_GEO | ADISJOINT_TGEO_GEO | ADWITHIN_TGEO_GEO | EINTERSECTS_TGEO_GEO | ETOUCHES_TGEO_GEO | ECONTAINS_TGEO_GEO | ACONTAINS_TGEO_GEO | ATOUCHES_TGEO_GEO | GEO_NUM_POINTS | GEO_NUM_GEOS | GEO_SRID | GEO_IS_UNITARY | GEO_EQUALS | GEO_SAME | GEOG_DISTANCE | NAD_TGEO_GEO | EVER_EQ_TGEO_GEO | EVER_NE_TGEO_GEO | ALWAYS_EQ_TGEO_GEO | ALWAYS_NE_TGEO_GEO | GEOG_INTERSECTS | GEOG_DWITHIN | ACOVERS_GEO_TGEO | GEOM_INTERSECTS | GEOM_DWITHIN | H3_GS_POINT_TO_CELL | EVER_EQ_TH3INDEX_H3INDEX | EVER_NE_TH3INDEX_H3INDEX | ALWAYS_EQ_TH3INDEX_H3INDEX | ALWAYS_NE_TH3INDEX_H3INDEX | TH3INDEX_GET_RESOLUTION | TH3INDEX_GET_BASE_CELL_NUMBER | TH3INDEX_IS_VALID_CELL | TH3INDEX_IS_PENTAGON | TH3INDEX_CELL_TO_PARENT_NEXT | TH3INDEX_CELL_TO_CENTER_CHILD_NEXT | TH3INDEX_CELL_TO_PARENT | TH3INDEX_CELL_TO_CENTER_CHILD | TH3INDEX_CELL_TO_CHILD_POS | TH3INDEX_ARE_NEIGHBOR_CELLS | TH3INDEX_GRID_DISTANCE | EINTERSECTS_TCBUFFER_GEO | AINTERSECTS_TCBUFFER_GEO | ECOVERS_TCBUFFER_GEO | ACOVERS_TCBUFFER_GEO | EDISJOINT_TCBUFFER_GEO | ADISJOINT_TCBUFFER_GEO | ETOUCHES_TCBUFFER_GEO | ATOUCHES_TCBUFFER_GEO | ECONTAINS_TCBUFFER_GEO | ACONTAINS_TCBUFFER_GEO | NAD_TCBUFFER_GEO | EDWITHIN_TCBUFFER_GEO | ADWITHIN_TCBUFFER_GEO | EINTERSECTS_TCBUFFER_CBUFFER | AINTERSECTS_TCBUFFER_CBUFFER | ECOVERS_TCBUFFER_CBUFFER | ACOVERS_TCBUFFER_CBUFFER | EDISJOINT_TCBUFFER_CBUFFER | ADISJOINT_TCBUFFER_CBUFFER | ETOUCHES_TCBUFFER_CBUFFER | ATOUCHES_TCBUFFER_CBUFFER | ECONTAINS_TCBUFFER_CBUFFER | ACONTAINS_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_CBUFFER | ALWAYS_EQ_TCBUFFER_CBUFFER | EVER_NE_TCBUFFER_CBUFFER | ALWAYS_NE_TCBUFFER_CBUFFER | NAD_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_TCBUFFER | ALWAYS_EQ_TCBUFFER_TCBUFFER | EVER_NE_TCBUFFER_TCBUFFER | ALWAYS_NE_TCBUFFER_TCBUFFER | EINTERSECTS_TCBUFFER_TCBUFFER | AINTERSECTS_TCBUFFER_TCBUFFER | ECOVERS_TCBUFFER_TCBUFFER | ACOVERS_TCBUFFER_TCBUFFER | ADISJOINT_TCBUFFER_TCBUFFER | ETOUCHES_TCBUFFER_TCBUFFER | ATOUCHES_TCBUFFER_TCBUFFER | NAD_TCBUFFER_TCBUFFER | EDWITHIN_TCBUFFER_TCBUFFER | ADWITHIN_TCBUFFER_TCBUFFER | MINDISTANCE_TCBUFFER_TCBUFFER | NAD_TNPOINT_GEO | EVER_EQ_TNPOINT_NPOINT | ALWAYS_EQ_TNPOINT_NPOINT | EVER_NE_TNPOINT_NPOINT | ALWAYS_NE_TNPOINT_NPOINT | NAD_TNPOINT_NPOINT | EVER_EQ_NPOINT_TNPOINT | ALWAYS_EQ_NPOINT_TNPOINT | EVER_NE_NPOINT_TNPOINT | ALWAYS_NE_NPOINT_TNPOINT | EVER_EQ_TNPOINT_TNPOINT | ALWAYS_EQ_TNPOINT_TNPOINT | EVER_NE_TNPOINT_TNPOINT | ALWAYS_NE_TNPOINT_TNPOINT | NAD_TNPOINT_TNPOINT | NAD_TPOSE_GEO | EVER_EQ_TPOSE_POSE | ALWAYS_EQ_TPOSE_POSE | EVER_NE_TPOSE_POSE | ALWAYS_NE_TPOSE_POSE | NAD_TPOSE_POSE | EVER_EQ_POSE_TPOSE | ALWAYS_EQ_POSE_TPOSE | EVER_NE_POSE_TPOSE | ALWAYS_NE_POSE_TPOSE | EVER_EQ_TPOSE_TPOSE | ALWAYS_EQ_TPOSE_TPOSE | EVER_NE_TPOSE_TPOSE | ALWAYS_NE_TPOSE_TPOSE | NAD_TPOSE_TPOSE | EVER_EQ_TRGEOMETRY_GEO | ALWAYS_EQ_TRGEOMETRY_GEO | EVER_NE_TRGEOMETRY_GEO | ALWAYS_NE_TRGEOMETRY_GEO | NAD_TRGEOMETRY_GEO | EVER_EQ_GEO_TRGEOMETRY | ALWAYS_EQ_GEO_TRGEOMETRY | EVER_NE_GEO_TRGEOMETRY | ALWAYS_NE_GEO_TRGEOMETRY | EVER_EQ_TRGEOMETRY_TRGEOMETRY | ALWAYS_EQ_TRGEOMETRY_TRGEOMETRY | EVER_NE_TRGEOMETRY_TRGEOMETRY | ALWAYS_NE_TRGEOMETRY_TRGEOMETRY | NAD_TRGEOMETRY_TRGEOMETRY | EINTERSECTS_TPCPOINT_GEO | NAD_TPCPOINT_GEO | QUADBIN_POINT_TO_CELL | QUADBIN_IS_VALID_CELL | QUADBIN_GET_RESOLUTION | QUADBIN_CELL_AREA | QUADBIN_CELL_TO_QUADKEY | QUADBIN_CELL_TO_PARENT | QUADBIN_TILE_TO_CELL | EVER_EQ_TJSONB_JSONB | ALWAYS_EQ_TJSONB_JSONB | EVER_NE_TJSONB_JSONB | ALWAYS_NE_TJSONB_JSONB | EVER_EQ_TJSONB_TJSONB | ALWAYS_EQ_TJSONB_TJSONB | EVER_NE_TJSONB_TJSONB | ALWAYS_NE_TJSONB_TJSONB | GEOM_BOUNDARY | GEOM_CENTROID | GEOM_CONVEX_HULL | GEO_REVERSE | GEO_POINTS | GEOM_UNARY_UNION | GEOM_DIFFERENCE2D | GEOM_INTERSECTION2D | GEOM_SHORTESTLINE2D | GEOM_SHORTESTLINE3D | GEO_SET_SRID | GEO_TRANSFORM | GEO_ROUND | GEOM_BUFFER | LINE_NUMPOINTS | LINE_LOCATE_POINT | LINE_INTERPOLATE_POINT | LINE_SUBSTRING | GEOM_POINT_MAKE2D | GEOM_POINT_MAKE3DZ | GEOG_POINT_MAKE2D | GEOG_POINT_MAKE3DZ | GEOM_TO_GEOG | GEOG_TO_GEOM | GEOG_CENTROID | GEO_GEO_N | LINE_POINT_N | GEOM_INTERSECTION2D_COLL | GEO_AS_GEOJSON | GEO_AS_HEXEWKB | GEO_AS_EWKT | GEO_FROM_GEOJSON | GEOM_FROM_HEXEWKB | GEO_TRANSFORM_PIPELINE | GEOM_MIN_BOUNDING_CENTER | GEOM_MIN_BOUNDING_RADIUS | EVER_EQ_TGEO_TGEO | EVER_NE_TGEO_TGEO | ALWAYS_EQ_TGEO_TGEO | ALWAYS_NE_TGEO_TGEO | EINTERSECTS_TGEO_TGEO | ECOVERS_TGEO_TGEO | EDISJOINT_TGEO_TGEO | ECONTAINS_TGEO_TGEO | ETOUCHES_TGEO_TGEO | AINTERSECTS_TGEO_TGEO | ACOVERS_TGEO_TGEO | ADISJOINT_TGEO_TGEO | ACONTAINS_TGEO_TGEO | ATOUCHES_TGEO_TGEO | EDWITHIN_TGEO_TGEO | ADWITHIN_TGEO_TGEO | H3INDEX_EQ | H3INDEX_NE | H3INDEX_LT | H3INDEX_LE | H3INDEX_GT | H3INDEX_GE | H3INDEX_CMP | H3INDEX_OUT | GEOM_RELATE_PATTERN | GEOM_INTERSECTS2D | GEOM_DWITHIN2D | GEOM_CONTAINS | GEOM_DISJOINT2D | GEOM_COVERS | GEOM_TOUCHES | GEOM_INTERSECTS3D | GEOM_DWITHIN3D | GEOM_DISTANCE2D | GEOM_DISTANCE3D; sinkClause: INTO sink (',' sink)*; @@ -970,6 +970,7 @@ H3INDEX_LE: 'H3INDEX_LE' | 'h3index_le'; H3INDEX_GT: 'H3INDEX_GT' | 'h3index_gt'; H3INDEX_GE: 'H3INDEX_GE' | 'h3index_ge'; H3INDEX_CMP: 'H3INDEX_CMP' | 'h3index_cmp'; +H3INDEX_OUT: 'H3INDEX_OUT' | 'h3index_out'; GEOM_RELATE_PATTERN: 'GEOM_RELATE_PATTERN' | 'geom_relate_pattern'; GEOM_INTERSECTS2D: 'GEOM_INTERSECTS2D' | 'geom_intersects2d'; GEOM_DWITHIN2D: 'GEOM_DWITHIN2D' | 'geom_dwithin2d'; diff --git a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp index 7275e9ccae..6dc2268d00 100644 --- a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp +++ b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp @@ -551,6 +551,7 @@ #include #include #include +#include #include #include #include @@ -11423,6 +11424,14 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont return LogicalFunction(H3indexCmpLogicalFunction(std::move(arg0), std::move(arg1))); } /* END CODEGEN PARSER GLUE: H3INDEX_CMP */ + case AntlrSQLParser::H3INDEX_OUT: { + PRECONDITION(ctx->functionParam().size() == 1, + "H3indexOut requires 1 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + return LogicalFunction(H3indexOutLogicalFunction(std::move(arg0))); + } + /* END CODEGEN PARSER GLUE: H3INDEX_OUT */ /* END CODEGEN PARSER GLUE: GEOM_RELATE_PATTERN */ /* END CODEGEN PARSER GLUE: GEOM_INTERSECTS2D */ case AntlrSQLParser::GEOM_DWITHIN2D: { From 750827a7d5c70da9a8c1dd27b3e4c89cecbd6957 Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Thu, 18 Jun 2026 19:12:33 +0200 Subject: [PATCH 88/96] feat(meos): add H3INDEX_IN NES operator (W140) Wires H3INDEX_IN(hex:VARSIZED) -> UINT64, backed by h3index_in, parsing a 15-character H3Index hex string (e.g. '8928308280fffff') to its UINT64 cell identifier. New in ecosystem-pin-2026-06-18b. --- .../Meos/H3indexInLogicalFunction.hpp | 48 ++++++++++ .../src/Functions/Meos/CMakeLists.txt | 1 + .../Meos/H3indexInLogicalFunction.cpp | 94 +++++++++++++++++++ .../Meos/H3indexInPhysicalFunction.hpp | 32 +++++++ .../src/Functions/Meos/CMakeLists.txt | 1 + .../Meos/H3indexInPhysicalFunction.cpp | 67 +++++++++++++ nes-sql-parser/AntlrSQL.g4 | 3 +- .../src/AntlrSQLQueryPlanCreator.cpp | 9 ++ 8 files changed, 254 insertions(+), 1 deletion(-) create mode 100644 nes-logical-operators/include/Functions/Meos/H3indexInLogicalFunction.hpp create mode 100644 nes-logical-operators/src/Functions/Meos/H3indexInLogicalFunction.cpp create mode 100644 nes-physical-operators/include/Functions/Meos/H3indexInPhysicalFunction.hpp create mode 100644 nes-physical-operators/src/Functions/Meos/H3indexInPhysicalFunction.cpp diff --git a/nes-logical-operators/include/Functions/Meos/H3indexInLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/H3indexInLogicalFunction.hpp new file mode 100644 index 0000000000..a55a3e0659 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/H3indexInLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Parses an H3Index hex string (VARSIZED) to a cell identifier (UINT64). + */ +class H3indexInLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "H3indexIn"; + + H3indexInLogicalFunction(LogicalFunction hex); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt index f2dec2bd28..0ee8218344 100644 --- a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt @@ -501,6 +501,7 @@ add_plugin(H3indexGt LogicalFunction nes-logical-operators H3indexGtLogicalFunct add_plugin(H3indexGe LogicalFunction nes-logical-operators H3indexGeLogicalFunction.cpp) add_plugin(H3indexCmp LogicalFunction nes-logical-operators H3indexCmpLogicalFunction.cpp) add_plugin(H3indexOut LogicalFunction nes-logical-operators H3indexOutLogicalFunction.cpp) +add_plugin(H3indexIn LogicalFunction nes-logical-operators H3indexInLogicalFunction.cpp) add_plugin(GeomRelatePattern LogicalFunction nes-logical-operators GeomRelatePatternLogicalFunction.cpp) add_plugin(GeomIntersects2d LogicalFunction nes-logical-operators GeomIntersects2dLogicalFunction.cpp) add_plugin(GeomDwithin2d LogicalFunction nes-logical-operators GeomDwithin2dLogicalFunction.cpp) diff --git a/nes-logical-operators/src/Functions/Meos/H3indexInLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/H3indexInLogicalFunction.cpp new file mode 100644 index 0000000000..24539b2423 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/H3indexInLogicalFunction.cpp @@ -0,0 +1,94 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +H3indexInLogicalFunction::H3indexInLogicalFunction(LogicalFunction hex) + : dataType(DataTypeProvider::provideDataType(DataType::Type::UINT64)) +{ + parameters.reserve(1); + parameters.push_back(std::move(hex)); +} + +DataType H3indexInLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction H3indexInLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector H3indexInLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction H3indexInLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 1, + "H3indexInLogicalFunction requires 1 child, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view H3indexInLogicalFunction::getType() const { return NAME; } + +bool H3indexInLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string H3indexInLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction H3indexInLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(1); + c.emplace_back(parameters[0].withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "hex must be VARSIZED"); + return withChildren(c); +} + +SerializableFunction H3indexInLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterH3indexInLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 1, + "H3indexInLogicalFunction requires 1 child but got {}", + arguments.children.size()); + return H3indexInLogicalFunction(std::move(arguments.children[0])); +} + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/H3indexInPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/H3indexInPhysicalFunction.hpp new file mode 100644 index 0000000000..7408f4d4d5 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/H3indexInPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class H3indexInPhysicalFunction : public PhysicalFunctionConcept { +public: + H3indexInPhysicalFunction(PhysicalFunction hex); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt index c415ee433d..74931e771a 100644 --- a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt @@ -500,6 +500,7 @@ add_plugin(H3indexGt PhysicalFunction nes-physical-operators H3indexGtPhysicalFu add_plugin(H3indexGe PhysicalFunction nes-physical-operators H3indexGePhysicalFunction.cpp) add_plugin(H3indexCmp PhysicalFunction nes-physical-operators H3indexCmpPhysicalFunction.cpp) add_plugin(H3indexOut PhysicalFunction nes-physical-operators H3indexOutPhysicalFunction.cpp) +add_plugin(H3indexIn PhysicalFunction nes-physical-operators H3indexInPhysicalFunction.cpp) add_plugin(GeomRelatePattern PhysicalFunction nes-physical-operators GeomRelatePatternPhysicalFunction.cpp) add_plugin(GeomIntersects2d PhysicalFunction nes-physical-operators GeomIntersects2dPhysicalFunction.cpp) add_plugin(GeomDwithin2d PhysicalFunction nes-physical-operators GeomDwithin2dPhysicalFunction.cpp) diff --git a/nes-physical-operators/src/Functions/Meos/H3indexInPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/H3indexInPhysicalFunction.cpp new file mode 100644 index 0000000000..62b24b1db0 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/H3indexInPhysicalFunction.cpp @@ -0,0 +1,67 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} +#include + +namespace NES { + +H3indexInPhysicalFunction::H3indexInPhysicalFunction(PhysicalFunction hex) +{ + paramFns.reserve(1); + paramFns.push_back(std::move(hex)); +} + +VarVal H3indexInPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto hex = paramFns[0].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](const char* w, uint32_t wsz) -> uint64_t { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string s(w, wsz); + H3Index cell = h3index_in(s.c_str()); + return (uint64_t)cell; + } catch (const std::exception&) { return 0ULL; } + }, + hex); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterH3indexInPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 1, + "H3indexInPhysicalFunction requires 1 child but got {}", + arguments.childFunctions.size()); + return H3indexInPhysicalFunction(std::move(arguments.childFunctions[0])); +} + +} // namespace NES diff --git a/nes-sql-parser/AntlrSQL.g4 b/nes-sql-parser/AntlrSQL.g4 index 6ac3d5f7b3..9abcec7b44 100644 --- a/nes-sql-parser/AntlrSQL.g4 +++ b/nes-sql-parser/AntlrSQL.g4 @@ -295,7 +295,7 @@ timeUnit: MS timestampParameter: name=identifier; -functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT | TGE_TTEXT_TEXT | TGE_TEXT_TTEXT | TGT_TTEXT_TEXT | TGT_TEXT_TTEXT | TLE_TTEXT_TEXT | TLE_TEXT_TTEXT | TLT_TTEXT_TEXT | TLT_TEXT_TTEXT | TTEXT_UPPER | TTEXT_LOWER | TTEXT_INITCAP | TEXTCAT_TTEXT_TEXT | TEXTCAT_TEXT_TTEXT | TEXTCAT_TTEXT_TTEXT | GEOM_LENGTH | GEOM_PERIMETER | GEOM_AZIMUTH | GEOG_AREA | GEOG_LENGTH | GEOG_PERIMETER | GEOM_IS_EMPTY | AINTERSECTS_TGEO_GEO | ACOVERS_TGEO_GEO | ADISJOINT_TGEO_GEO | ADWITHIN_TGEO_GEO | EINTERSECTS_TGEO_GEO | ETOUCHES_TGEO_GEO | ECONTAINS_TGEO_GEO | ACONTAINS_TGEO_GEO | ATOUCHES_TGEO_GEO | GEO_NUM_POINTS | GEO_NUM_GEOS | GEO_SRID | GEO_IS_UNITARY | GEO_EQUALS | GEO_SAME | GEOG_DISTANCE | NAD_TGEO_GEO | EVER_EQ_TGEO_GEO | EVER_NE_TGEO_GEO | ALWAYS_EQ_TGEO_GEO | ALWAYS_NE_TGEO_GEO | GEOG_INTERSECTS | GEOG_DWITHIN | ACOVERS_GEO_TGEO | GEOM_INTERSECTS | GEOM_DWITHIN | H3_GS_POINT_TO_CELL | EVER_EQ_TH3INDEX_H3INDEX | EVER_NE_TH3INDEX_H3INDEX | ALWAYS_EQ_TH3INDEX_H3INDEX | ALWAYS_NE_TH3INDEX_H3INDEX | TH3INDEX_GET_RESOLUTION | TH3INDEX_GET_BASE_CELL_NUMBER | TH3INDEX_IS_VALID_CELL | TH3INDEX_IS_PENTAGON | TH3INDEX_CELL_TO_PARENT_NEXT | TH3INDEX_CELL_TO_CENTER_CHILD_NEXT | TH3INDEX_CELL_TO_PARENT | TH3INDEX_CELL_TO_CENTER_CHILD | TH3INDEX_CELL_TO_CHILD_POS | TH3INDEX_ARE_NEIGHBOR_CELLS | TH3INDEX_GRID_DISTANCE | EINTERSECTS_TCBUFFER_GEO | AINTERSECTS_TCBUFFER_GEO | ECOVERS_TCBUFFER_GEO | ACOVERS_TCBUFFER_GEO | EDISJOINT_TCBUFFER_GEO | ADISJOINT_TCBUFFER_GEO | ETOUCHES_TCBUFFER_GEO | ATOUCHES_TCBUFFER_GEO | ECONTAINS_TCBUFFER_GEO | ACONTAINS_TCBUFFER_GEO | NAD_TCBUFFER_GEO | EDWITHIN_TCBUFFER_GEO | ADWITHIN_TCBUFFER_GEO | EINTERSECTS_TCBUFFER_CBUFFER | AINTERSECTS_TCBUFFER_CBUFFER | ECOVERS_TCBUFFER_CBUFFER | ACOVERS_TCBUFFER_CBUFFER | EDISJOINT_TCBUFFER_CBUFFER | ADISJOINT_TCBUFFER_CBUFFER | ETOUCHES_TCBUFFER_CBUFFER | ATOUCHES_TCBUFFER_CBUFFER | ECONTAINS_TCBUFFER_CBUFFER | ACONTAINS_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_CBUFFER | ALWAYS_EQ_TCBUFFER_CBUFFER | EVER_NE_TCBUFFER_CBUFFER | ALWAYS_NE_TCBUFFER_CBUFFER | NAD_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_TCBUFFER | ALWAYS_EQ_TCBUFFER_TCBUFFER | EVER_NE_TCBUFFER_TCBUFFER | ALWAYS_NE_TCBUFFER_TCBUFFER | EINTERSECTS_TCBUFFER_TCBUFFER | AINTERSECTS_TCBUFFER_TCBUFFER | ECOVERS_TCBUFFER_TCBUFFER | ACOVERS_TCBUFFER_TCBUFFER | ADISJOINT_TCBUFFER_TCBUFFER | ETOUCHES_TCBUFFER_TCBUFFER | ATOUCHES_TCBUFFER_TCBUFFER | NAD_TCBUFFER_TCBUFFER | EDWITHIN_TCBUFFER_TCBUFFER | ADWITHIN_TCBUFFER_TCBUFFER | MINDISTANCE_TCBUFFER_TCBUFFER | NAD_TNPOINT_GEO | EVER_EQ_TNPOINT_NPOINT | ALWAYS_EQ_TNPOINT_NPOINT | EVER_NE_TNPOINT_NPOINT | ALWAYS_NE_TNPOINT_NPOINT | NAD_TNPOINT_NPOINT | EVER_EQ_NPOINT_TNPOINT | ALWAYS_EQ_NPOINT_TNPOINT | EVER_NE_NPOINT_TNPOINT | ALWAYS_NE_NPOINT_TNPOINT | EVER_EQ_TNPOINT_TNPOINT | ALWAYS_EQ_TNPOINT_TNPOINT | EVER_NE_TNPOINT_TNPOINT | ALWAYS_NE_TNPOINT_TNPOINT | NAD_TNPOINT_TNPOINT | NAD_TPOSE_GEO | EVER_EQ_TPOSE_POSE | ALWAYS_EQ_TPOSE_POSE | EVER_NE_TPOSE_POSE | ALWAYS_NE_TPOSE_POSE | NAD_TPOSE_POSE | EVER_EQ_POSE_TPOSE | ALWAYS_EQ_POSE_TPOSE | EVER_NE_POSE_TPOSE | ALWAYS_NE_POSE_TPOSE | EVER_EQ_TPOSE_TPOSE | ALWAYS_EQ_TPOSE_TPOSE | EVER_NE_TPOSE_TPOSE | ALWAYS_NE_TPOSE_TPOSE | NAD_TPOSE_TPOSE | EVER_EQ_TRGEOMETRY_GEO | ALWAYS_EQ_TRGEOMETRY_GEO | EVER_NE_TRGEOMETRY_GEO | ALWAYS_NE_TRGEOMETRY_GEO | NAD_TRGEOMETRY_GEO | EVER_EQ_GEO_TRGEOMETRY | ALWAYS_EQ_GEO_TRGEOMETRY | EVER_NE_GEO_TRGEOMETRY | ALWAYS_NE_GEO_TRGEOMETRY | EVER_EQ_TRGEOMETRY_TRGEOMETRY | ALWAYS_EQ_TRGEOMETRY_TRGEOMETRY | EVER_NE_TRGEOMETRY_TRGEOMETRY | ALWAYS_NE_TRGEOMETRY_TRGEOMETRY | NAD_TRGEOMETRY_TRGEOMETRY | EINTERSECTS_TPCPOINT_GEO | NAD_TPCPOINT_GEO | QUADBIN_POINT_TO_CELL | QUADBIN_IS_VALID_CELL | QUADBIN_GET_RESOLUTION | QUADBIN_CELL_AREA | QUADBIN_CELL_TO_QUADKEY | QUADBIN_CELL_TO_PARENT | QUADBIN_TILE_TO_CELL | EVER_EQ_TJSONB_JSONB | ALWAYS_EQ_TJSONB_JSONB | EVER_NE_TJSONB_JSONB | ALWAYS_NE_TJSONB_JSONB | EVER_EQ_TJSONB_TJSONB | ALWAYS_EQ_TJSONB_TJSONB | EVER_NE_TJSONB_TJSONB | ALWAYS_NE_TJSONB_TJSONB | GEOM_BOUNDARY | GEOM_CENTROID | GEOM_CONVEX_HULL | GEO_REVERSE | GEO_POINTS | GEOM_UNARY_UNION | GEOM_DIFFERENCE2D | GEOM_INTERSECTION2D | GEOM_SHORTESTLINE2D | GEOM_SHORTESTLINE3D | GEO_SET_SRID | GEO_TRANSFORM | GEO_ROUND | GEOM_BUFFER | LINE_NUMPOINTS | LINE_LOCATE_POINT | LINE_INTERPOLATE_POINT | LINE_SUBSTRING | GEOM_POINT_MAKE2D | GEOM_POINT_MAKE3DZ | GEOG_POINT_MAKE2D | GEOG_POINT_MAKE3DZ | GEOM_TO_GEOG | GEOG_TO_GEOM | GEOG_CENTROID | GEO_GEO_N | LINE_POINT_N | GEOM_INTERSECTION2D_COLL | GEO_AS_GEOJSON | GEO_AS_HEXEWKB | GEO_AS_EWKT | GEO_FROM_GEOJSON | GEOM_FROM_HEXEWKB | GEO_TRANSFORM_PIPELINE | GEOM_MIN_BOUNDING_CENTER | GEOM_MIN_BOUNDING_RADIUS | EVER_EQ_TGEO_TGEO | EVER_NE_TGEO_TGEO | ALWAYS_EQ_TGEO_TGEO | ALWAYS_NE_TGEO_TGEO | EINTERSECTS_TGEO_TGEO | ECOVERS_TGEO_TGEO | EDISJOINT_TGEO_TGEO | ECONTAINS_TGEO_TGEO | ETOUCHES_TGEO_TGEO | AINTERSECTS_TGEO_TGEO | ACOVERS_TGEO_TGEO | ADISJOINT_TGEO_TGEO | ACONTAINS_TGEO_TGEO | ATOUCHES_TGEO_TGEO | EDWITHIN_TGEO_TGEO | ADWITHIN_TGEO_TGEO | H3INDEX_EQ | H3INDEX_NE | H3INDEX_LT | H3INDEX_LE | H3INDEX_GT | H3INDEX_GE | H3INDEX_CMP | H3INDEX_OUT | GEOM_RELATE_PATTERN | GEOM_INTERSECTS2D | GEOM_DWITHIN2D | GEOM_CONTAINS | GEOM_DISJOINT2D | GEOM_COVERS | GEOM_TOUCHES | GEOM_INTERSECTS3D | GEOM_DWITHIN3D | GEOM_DISTANCE2D | GEOM_DISTANCE3D; +functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT | TGE_TTEXT_TEXT | TGE_TEXT_TTEXT | TGT_TTEXT_TEXT | TGT_TEXT_TTEXT | TLE_TTEXT_TEXT | TLE_TEXT_TTEXT | TLT_TTEXT_TEXT | TLT_TEXT_TTEXT | TTEXT_UPPER | TTEXT_LOWER | TTEXT_INITCAP | TEXTCAT_TTEXT_TEXT | TEXTCAT_TEXT_TTEXT | TEXTCAT_TTEXT_TTEXT | GEOM_LENGTH | GEOM_PERIMETER | GEOM_AZIMUTH | GEOG_AREA | GEOG_LENGTH | GEOG_PERIMETER | GEOM_IS_EMPTY | AINTERSECTS_TGEO_GEO | ACOVERS_TGEO_GEO | ADISJOINT_TGEO_GEO | ADWITHIN_TGEO_GEO | EINTERSECTS_TGEO_GEO | ETOUCHES_TGEO_GEO | ECONTAINS_TGEO_GEO | ACONTAINS_TGEO_GEO | ATOUCHES_TGEO_GEO | GEO_NUM_POINTS | GEO_NUM_GEOS | GEO_SRID | GEO_IS_UNITARY | GEO_EQUALS | GEO_SAME | GEOG_DISTANCE | NAD_TGEO_GEO | EVER_EQ_TGEO_GEO | EVER_NE_TGEO_GEO | ALWAYS_EQ_TGEO_GEO | ALWAYS_NE_TGEO_GEO | GEOG_INTERSECTS | GEOG_DWITHIN | ACOVERS_GEO_TGEO | GEOM_INTERSECTS | GEOM_DWITHIN | H3_GS_POINT_TO_CELL | EVER_EQ_TH3INDEX_H3INDEX | EVER_NE_TH3INDEX_H3INDEX | ALWAYS_EQ_TH3INDEX_H3INDEX | ALWAYS_NE_TH3INDEX_H3INDEX | TH3INDEX_GET_RESOLUTION | TH3INDEX_GET_BASE_CELL_NUMBER | TH3INDEX_IS_VALID_CELL | TH3INDEX_IS_PENTAGON | TH3INDEX_CELL_TO_PARENT_NEXT | TH3INDEX_CELL_TO_CENTER_CHILD_NEXT | TH3INDEX_CELL_TO_PARENT | TH3INDEX_CELL_TO_CENTER_CHILD | TH3INDEX_CELL_TO_CHILD_POS | TH3INDEX_ARE_NEIGHBOR_CELLS | TH3INDEX_GRID_DISTANCE | EINTERSECTS_TCBUFFER_GEO | AINTERSECTS_TCBUFFER_GEO | ECOVERS_TCBUFFER_GEO | ACOVERS_TCBUFFER_GEO | EDISJOINT_TCBUFFER_GEO | ADISJOINT_TCBUFFER_GEO | ETOUCHES_TCBUFFER_GEO | ATOUCHES_TCBUFFER_GEO | ECONTAINS_TCBUFFER_GEO | ACONTAINS_TCBUFFER_GEO | NAD_TCBUFFER_GEO | EDWITHIN_TCBUFFER_GEO | ADWITHIN_TCBUFFER_GEO | EINTERSECTS_TCBUFFER_CBUFFER | AINTERSECTS_TCBUFFER_CBUFFER | ECOVERS_TCBUFFER_CBUFFER | ACOVERS_TCBUFFER_CBUFFER | EDISJOINT_TCBUFFER_CBUFFER | ADISJOINT_TCBUFFER_CBUFFER | ETOUCHES_TCBUFFER_CBUFFER | ATOUCHES_TCBUFFER_CBUFFER | ECONTAINS_TCBUFFER_CBUFFER | ACONTAINS_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_CBUFFER | ALWAYS_EQ_TCBUFFER_CBUFFER | EVER_NE_TCBUFFER_CBUFFER | ALWAYS_NE_TCBUFFER_CBUFFER | NAD_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_TCBUFFER | ALWAYS_EQ_TCBUFFER_TCBUFFER | EVER_NE_TCBUFFER_TCBUFFER | ALWAYS_NE_TCBUFFER_TCBUFFER | EINTERSECTS_TCBUFFER_TCBUFFER | AINTERSECTS_TCBUFFER_TCBUFFER | ECOVERS_TCBUFFER_TCBUFFER | ACOVERS_TCBUFFER_TCBUFFER | ADISJOINT_TCBUFFER_TCBUFFER | ETOUCHES_TCBUFFER_TCBUFFER | ATOUCHES_TCBUFFER_TCBUFFER | NAD_TCBUFFER_TCBUFFER | EDWITHIN_TCBUFFER_TCBUFFER | ADWITHIN_TCBUFFER_TCBUFFER | MINDISTANCE_TCBUFFER_TCBUFFER | NAD_TNPOINT_GEO | EVER_EQ_TNPOINT_NPOINT | ALWAYS_EQ_TNPOINT_NPOINT | EVER_NE_TNPOINT_NPOINT | ALWAYS_NE_TNPOINT_NPOINT | NAD_TNPOINT_NPOINT | EVER_EQ_NPOINT_TNPOINT | ALWAYS_EQ_NPOINT_TNPOINT | EVER_NE_NPOINT_TNPOINT | ALWAYS_NE_NPOINT_TNPOINT | EVER_EQ_TNPOINT_TNPOINT | ALWAYS_EQ_TNPOINT_TNPOINT | EVER_NE_TNPOINT_TNPOINT | ALWAYS_NE_TNPOINT_TNPOINT | NAD_TNPOINT_TNPOINT | NAD_TPOSE_GEO | EVER_EQ_TPOSE_POSE | ALWAYS_EQ_TPOSE_POSE | EVER_NE_TPOSE_POSE | ALWAYS_NE_TPOSE_POSE | NAD_TPOSE_POSE | EVER_EQ_POSE_TPOSE | ALWAYS_EQ_POSE_TPOSE | EVER_NE_POSE_TPOSE | ALWAYS_NE_POSE_TPOSE | EVER_EQ_TPOSE_TPOSE | ALWAYS_EQ_TPOSE_TPOSE | EVER_NE_TPOSE_TPOSE | ALWAYS_NE_TPOSE_TPOSE | NAD_TPOSE_TPOSE | EVER_EQ_TRGEOMETRY_GEO | ALWAYS_EQ_TRGEOMETRY_GEO | EVER_NE_TRGEOMETRY_GEO | ALWAYS_NE_TRGEOMETRY_GEO | NAD_TRGEOMETRY_GEO | EVER_EQ_GEO_TRGEOMETRY | ALWAYS_EQ_GEO_TRGEOMETRY | EVER_NE_GEO_TRGEOMETRY | ALWAYS_NE_GEO_TRGEOMETRY | EVER_EQ_TRGEOMETRY_TRGEOMETRY | ALWAYS_EQ_TRGEOMETRY_TRGEOMETRY | EVER_NE_TRGEOMETRY_TRGEOMETRY | ALWAYS_NE_TRGEOMETRY_TRGEOMETRY | NAD_TRGEOMETRY_TRGEOMETRY | EINTERSECTS_TPCPOINT_GEO | NAD_TPCPOINT_GEO | QUADBIN_POINT_TO_CELL | QUADBIN_IS_VALID_CELL | QUADBIN_GET_RESOLUTION | QUADBIN_CELL_AREA | QUADBIN_CELL_TO_QUADKEY | QUADBIN_CELL_TO_PARENT | QUADBIN_TILE_TO_CELL | EVER_EQ_TJSONB_JSONB | ALWAYS_EQ_TJSONB_JSONB | EVER_NE_TJSONB_JSONB | ALWAYS_NE_TJSONB_JSONB | EVER_EQ_TJSONB_TJSONB | ALWAYS_EQ_TJSONB_TJSONB | EVER_NE_TJSONB_TJSONB | ALWAYS_NE_TJSONB_TJSONB | GEOM_BOUNDARY | GEOM_CENTROID | GEOM_CONVEX_HULL | GEO_REVERSE | GEO_POINTS | GEOM_UNARY_UNION | GEOM_DIFFERENCE2D | GEOM_INTERSECTION2D | GEOM_SHORTESTLINE2D | GEOM_SHORTESTLINE3D | GEO_SET_SRID | GEO_TRANSFORM | GEO_ROUND | GEOM_BUFFER | LINE_NUMPOINTS | LINE_LOCATE_POINT | LINE_INTERPOLATE_POINT | LINE_SUBSTRING | GEOM_POINT_MAKE2D | GEOM_POINT_MAKE3DZ | GEOG_POINT_MAKE2D | GEOG_POINT_MAKE3DZ | GEOM_TO_GEOG | GEOG_TO_GEOM | GEOG_CENTROID | GEO_GEO_N | LINE_POINT_N | GEOM_INTERSECTION2D_COLL | GEO_AS_GEOJSON | GEO_AS_HEXEWKB | GEO_AS_EWKT | GEO_FROM_GEOJSON | GEOM_FROM_HEXEWKB | GEO_TRANSFORM_PIPELINE | GEOM_MIN_BOUNDING_CENTER | GEOM_MIN_BOUNDING_RADIUS | EVER_EQ_TGEO_TGEO | EVER_NE_TGEO_TGEO | ALWAYS_EQ_TGEO_TGEO | ALWAYS_NE_TGEO_TGEO | EINTERSECTS_TGEO_TGEO | ECOVERS_TGEO_TGEO | EDISJOINT_TGEO_TGEO | ECONTAINS_TGEO_TGEO | ETOUCHES_TGEO_TGEO | AINTERSECTS_TGEO_TGEO | ACOVERS_TGEO_TGEO | ADISJOINT_TGEO_TGEO | ACONTAINS_TGEO_TGEO | ATOUCHES_TGEO_TGEO | EDWITHIN_TGEO_TGEO | ADWITHIN_TGEO_TGEO | H3INDEX_EQ | H3INDEX_NE | H3INDEX_LT | H3INDEX_LE | H3INDEX_GT | H3INDEX_GE | H3INDEX_CMP | H3INDEX_OUT | H3INDEX_IN | GEOM_RELATE_PATTERN | GEOM_INTERSECTS2D | GEOM_DWITHIN2D | GEOM_CONTAINS | GEOM_DISJOINT2D | GEOM_COVERS | GEOM_TOUCHES | GEOM_INTERSECTS3D | GEOM_DWITHIN3D | GEOM_DISTANCE2D | GEOM_DISTANCE3D; sinkClause: INTO sink (',' sink)*; @@ -971,6 +971,7 @@ H3INDEX_GT: 'H3INDEX_GT' | 'h3index_gt'; H3INDEX_GE: 'H3INDEX_GE' | 'h3index_ge'; H3INDEX_CMP: 'H3INDEX_CMP' | 'h3index_cmp'; H3INDEX_OUT: 'H3INDEX_OUT' | 'h3index_out'; +H3INDEX_IN: 'H3INDEX_IN' | 'h3index_in'; GEOM_RELATE_PATTERN: 'GEOM_RELATE_PATTERN' | 'geom_relate_pattern'; GEOM_INTERSECTS2D: 'GEOM_INTERSECTS2D' | 'geom_intersects2d'; GEOM_DWITHIN2D: 'GEOM_DWITHIN2D' | 'geom_dwithin2d'; diff --git a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp index 6dc2268d00..aa345a5f33 100644 --- a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp +++ b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp @@ -552,6 +552,7 @@ #include #include #include +#include #include #include #include @@ -11432,6 +11433,14 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont return LogicalFunction(H3indexOutLogicalFunction(std::move(arg0))); } /* END CODEGEN PARSER GLUE: H3INDEX_OUT */ + case AntlrSQLParser::H3INDEX_IN: { + PRECONDITION(ctx->functionParam().size() == 1, + "H3indexIn requires 1 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + return LogicalFunction(H3indexInLogicalFunction(std::move(arg0))); + } + /* END CODEGEN PARSER GLUE: H3INDEX_IN */ /* END CODEGEN PARSER GLUE: GEOM_RELATE_PATTERN */ /* END CODEGEN PARSER GLUE: GEOM_INTERSECTS2D */ case AntlrSQLParser::GEOM_DWITHIN2D: { From 66de4a84cf5a411c055d0e355f2b2e1ca6001a6c Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Thu, 18 Jun 2026 22:26:46 +0200 Subject: [PATCH 89/96] feat(meos): add JSON scalar per-event NES operators (W141) Wires JSON_ARRAY_LENGTH(js:VARSIZED)->FLOAT64, and JSON_TYPEOF/OBJECT_FIELD_TEXT/ARRAY_ELEMENT_TEXT(...)-> VARCHAR, backed by json_in/json_out + json_array_length, json_typeof, json_object_field_text, json_array_element_text. key args use cstring_to_text. New in ecosystem-pin-2026-06-18b. --- .../JsonArrayElementTextLogicalFunction.hpp | 48 +++++++++ .../Meos/JsonArrayLengthLogicalFunction.hpp | 48 +++++++++ .../JsonObjectFieldTextLogicalFunction.hpp | 48 +++++++++ .../Meos/JsonTypeofLogicalFunction.hpp | 48 +++++++++ .../src/Functions/Meos/CMakeLists.txt | 4 + .../JsonArrayElementTextLogicalFunction.cpp | 99 +++++++++++++++++++ .../Meos/JsonArrayLengthLogicalFunction.cpp | 96 ++++++++++++++++++ .../JsonObjectFieldTextLogicalFunction.cpp | 99 +++++++++++++++++++ .../Meos/JsonTypeofLogicalFunction.cpp | 96 ++++++++++++++++++ .../JsonArrayElementTextPhysicalFunction.hpp | 32 ++++++ .../Meos/JsonArrayLengthPhysicalFunction.hpp | 32 ++++++ .../JsonObjectFieldTextPhysicalFunction.hpp | 32 ++++++ .../Meos/JsonTypeofPhysicalFunction.hpp | 32 ++++++ .../src/Functions/Meos/CMakeLists.txt | 4 + .../JsonArrayElementTextPhysicalFunction.cpp | 89 +++++++++++++++++ .../Meos/JsonArrayLengthPhysicalFunction.cpp | 71 +++++++++++++ .../JsonObjectFieldTextPhysicalFunction.cpp | 91 +++++++++++++++++ .../Meos/JsonTypeofPhysicalFunction.cpp | 85 ++++++++++++++++ nes-sql-parser/AntlrSQL.g4 | 6 +- .../src/AntlrSQLQueryPlanCreator.cpp | 38 +++++++ 20 files changed, 1097 insertions(+), 1 deletion(-) create mode 100644 nes-logical-operators/include/Functions/Meos/JsonArrayElementTextLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/JsonArrayLengthLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/JsonObjectFieldTextLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/JsonTypeofLogicalFunction.hpp create mode 100644 nes-logical-operators/src/Functions/Meos/JsonArrayElementTextLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/JsonArrayLengthLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/JsonObjectFieldTextLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/JsonTypeofLogicalFunction.cpp create mode 100644 nes-physical-operators/include/Functions/Meos/JsonArrayElementTextPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/JsonArrayLengthPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/JsonObjectFieldTextPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/JsonTypeofPhysicalFunction.hpp create mode 100644 nes-physical-operators/src/Functions/Meos/JsonArrayElementTextPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/JsonArrayLengthPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/JsonObjectFieldTextPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/JsonTypeofPhysicalFunction.cpp diff --git a/nes-logical-operators/include/Functions/Meos/JsonArrayElementTextLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/JsonArrayElementTextLogicalFunction.hpp new file mode 100644 index 0000000000..de2d3ff9d2 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/JsonArrayElementTextLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns the n-th element of a JSON array as plain text. + */ +class JsonArrayElementTextLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "JsonArrayElementText"; + + JsonArrayElementTextLogicalFunction(LogicalFunction js, LogicalFunction idx); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/JsonArrayLengthLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/JsonArrayLengthLogicalFunction.hpp new file mode 100644 index 0000000000..3dca1586ad --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/JsonArrayLengthLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns the number of elements in the outermost JSON array. + */ +class JsonArrayLengthLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "JsonArrayLength"; + + JsonArrayLengthLogicalFunction(LogicalFunction js); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/JsonObjectFieldTextLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/JsonObjectFieldTextLogicalFunction.hpp new file mode 100644 index 0000000000..95ac45c88c --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/JsonObjectFieldTextLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns the value of a JSON object field as plain text. + */ +class JsonObjectFieldTextLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "JsonObjectFieldText"; + + JsonObjectFieldTextLogicalFunction(LogicalFunction js, LogicalFunction key); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/JsonTypeofLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/JsonTypeofLogicalFunction.hpp new file mode 100644 index 0000000000..517a8f967f --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/JsonTypeofLogicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns the type of the outermost JSON value as a text string. + */ +class JsonTypeofLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "JsonTypeof"; + + JsonTypeofLogicalFunction(LogicalFunction js); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt index 0ee8218344..6e677d4f14 100644 --- a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt @@ -502,6 +502,10 @@ add_plugin(H3indexGe LogicalFunction nes-logical-operators H3indexGeLogicalFunct add_plugin(H3indexCmp LogicalFunction nes-logical-operators H3indexCmpLogicalFunction.cpp) add_plugin(H3indexOut LogicalFunction nes-logical-operators H3indexOutLogicalFunction.cpp) add_plugin(H3indexIn LogicalFunction nes-logical-operators H3indexInLogicalFunction.cpp) +add_plugin(JsonArrayLength LogicalFunction nes-logical-operators JsonArrayLengthLogicalFunction.cpp) +add_plugin(JsonTypeof LogicalFunction nes-logical-operators JsonTypeofLogicalFunction.cpp) +add_plugin(JsonObjectFieldText LogicalFunction nes-logical-operators JsonObjectFieldTextLogicalFunction.cpp) +add_plugin(JsonArrayElementText LogicalFunction nes-logical-operators JsonArrayElementTextLogicalFunction.cpp) add_plugin(GeomRelatePattern LogicalFunction nes-logical-operators GeomRelatePatternLogicalFunction.cpp) add_plugin(GeomIntersects2d LogicalFunction nes-logical-operators GeomIntersects2dLogicalFunction.cpp) add_plugin(GeomDwithin2d LogicalFunction nes-logical-operators GeomDwithin2dLogicalFunction.cpp) diff --git a/nes-logical-operators/src/Functions/Meos/JsonArrayElementTextLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/JsonArrayElementTextLogicalFunction.cpp new file mode 100644 index 0000000000..39a9fba63e --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/JsonArrayElementTextLogicalFunction.cpp @@ -0,0 +1,99 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +JsonArrayElementTextLogicalFunction::JsonArrayElementTextLogicalFunction(LogicalFunction js, LogicalFunction idx) + : dataType(DataTypeProvider::provideDataType(DataType::Type::VARSIZED)) +{ + parameters.reserve(2); + parameters.push_back(std::move(js)); + parameters.push_back(std::move(idx)); +} + +DataType JsonArrayElementTextLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction JsonArrayElementTextLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector JsonArrayElementTextLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction JsonArrayElementTextLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 2, + "JsonArrayElementTextLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view JsonArrayElementTextLogicalFunction::getType() const { return NAME; } + +bool JsonArrayElementTextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string JsonArrayElementTextLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction JsonArrayElementTextLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(2); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "js must be VARSIZED"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "idx must be FLOAT64"); + return withChildren(c); +} + +SerializableFunction JsonArrayElementTextLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterJsonArrayElementTextLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 2, + "JsonArrayElementTextLogicalFunction requires 2 children but got {}", + arguments.children.size()); + return JsonArrayElementTextLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/JsonArrayLengthLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/JsonArrayLengthLogicalFunction.cpp new file mode 100644 index 0000000000..732180000c --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/JsonArrayLengthLogicalFunction.cpp @@ -0,0 +1,96 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +JsonArrayLengthLogicalFunction::JsonArrayLengthLogicalFunction(LogicalFunction js) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(1); + parameters.push_back(std::move(js)); +} + +DataType JsonArrayLengthLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction JsonArrayLengthLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector JsonArrayLengthLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction JsonArrayLengthLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 1, + "JsonArrayLengthLogicalFunction requires 1 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view JsonArrayLengthLogicalFunction::getType() const { return NAME; } + +bool JsonArrayLengthLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string JsonArrayLengthLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction JsonArrayLengthLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(1); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "js must be VARSIZED"); + return withChildren(c); +} + +SerializableFunction JsonArrayLengthLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterJsonArrayLengthLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 1, + "JsonArrayLengthLogicalFunction requires 1 children but got {}", + arguments.children.size()); + return JsonArrayLengthLogicalFunction( + std::move(arguments.children[0])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/JsonObjectFieldTextLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/JsonObjectFieldTextLogicalFunction.cpp new file mode 100644 index 0000000000..23081c0eb8 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/JsonObjectFieldTextLogicalFunction.cpp @@ -0,0 +1,99 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +JsonObjectFieldTextLogicalFunction::JsonObjectFieldTextLogicalFunction(LogicalFunction js, LogicalFunction key) + : dataType(DataTypeProvider::provideDataType(DataType::Type::VARSIZED)) +{ + parameters.reserve(2); + parameters.push_back(std::move(js)); + parameters.push_back(std::move(key)); +} + +DataType JsonObjectFieldTextLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction JsonObjectFieldTextLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector JsonObjectFieldTextLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction JsonObjectFieldTextLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 2, + "JsonObjectFieldTextLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view JsonObjectFieldTextLogicalFunction::getType() const { return NAME; } + +bool JsonObjectFieldTextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string JsonObjectFieldTextLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction JsonObjectFieldTextLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(2); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "js must be VARSIZED"); + INVARIANT(c[1].getDataType().isType(DataType::Type::VARSIZED), "key must be VARSIZED"); + return withChildren(c); +} + +SerializableFunction JsonObjectFieldTextLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterJsonObjectFieldTextLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 2, + "JsonObjectFieldTextLogicalFunction requires 2 children but got {}", + arguments.children.size()); + return JsonObjectFieldTextLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/JsonTypeofLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/JsonTypeofLogicalFunction.cpp new file mode 100644 index 0000000000..34fa058356 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/JsonTypeofLogicalFunction.cpp @@ -0,0 +1,96 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +JsonTypeofLogicalFunction::JsonTypeofLogicalFunction(LogicalFunction js) + : dataType(DataTypeProvider::provideDataType(DataType::Type::VARSIZED)) +{ + parameters.reserve(1); + parameters.push_back(std::move(js)); +} + +DataType JsonTypeofLogicalFunction::getDataType() const { return dataType; } + +LogicalFunction JsonTypeofLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; copy.dataType = newDataType; return copy; +} + +std::vector JsonTypeofLogicalFunction::getChildren() const { return parameters; } + +LogicalFunction JsonTypeofLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 1, + "JsonTypeofLogicalFunction requires 1 children, but got {}", children.size()); + auto copy = *this; copy.parameters = children; return copy; +} + +std::string_view JsonTypeofLogicalFunction::getType() const { return NAME; } + +bool JsonTypeofLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + return parameters == other->parameters; + return false; +} + +std::string JsonTypeofLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); +} + +LogicalFunction JsonTypeofLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector c; + c.reserve(1); + for (const auto& p : parameters) + c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "js must be VARSIZED"); + return withChildren(c); +} + +SerializableFunction JsonTypeofLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + proto.add_children()->CopyFrom(child.serialize()); + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterJsonTypeofLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 1, + "JsonTypeofLogicalFunction requires 1 children but got {}", + arguments.children.size()); + return JsonTypeofLogicalFunction( + std::move(arguments.children[0])); +} + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/JsonArrayElementTextPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/JsonArrayElementTextPhysicalFunction.hpp new file mode 100644 index 0000000000..5cf945cadf --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/JsonArrayElementTextPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class JsonArrayElementTextPhysicalFunction : public PhysicalFunctionConcept { +public: + JsonArrayElementTextPhysicalFunction(PhysicalFunction js, PhysicalFunction idx); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/JsonArrayLengthPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/JsonArrayLengthPhysicalFunction.hpp new file mode 100644 index 0000000000..c65cc13bf8 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/JsonArrayLengthPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class JsonArrayLengthPhysicalFunction : public PhysicalFunctionConcept { +public: + JsonArrayLengthPhysicalFunction(PhysicalFunction js); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/JsonObjectFieldTextPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/JsonObjectFieldTextPhysicalFunction.hpp new file mode 100644 index 0000000000..e1f92cacef --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/JsonObjectFieldTextPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class JsonObjectFieldTextPhysicalFunction : public PhysicalFunctionConcept { +public: + JsonObjectFieldTextPhysicalFunction(PhysicalFunction js, PhysicalFunction key); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/JsonTypeofPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/JsonTypeofPhysicalFunction.hpp new file mode 100644 index 0000000000..86cc7ba5d7 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/JsonTypeofPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class JsonTypeofPhysicalFunction : public PhysicalFunctionConcept { +public: + JsonTypeofPhysicalFunction(PhysicalFunction js); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt index 74931e771a..a1fecf217f 100644 --- a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt @@ -501,6 +501,10 @@ add_plugin(H3indexGe PhysicalFunction nes-physical-operators H3indexGePhysicalFu add_plugin(H3indexCmp PhysicalFunction nes-physical-operators H3indexCmpPhysicalFunction.cpp) add_plugin(H3indexOut PhysicalFunction nes-physical-operators H3indexOutPhysicalFunction.cpp) add_plugin(H3indexIn PhysicalFunction nes-physical-operators H3indexInPhysicalFunction.cpp) +add_plugin(JsonArrayLength PhysicalFunction nes-physical-operators JsonArrayLengthPhysicalFunction.cpp) +add_plugin(JsonTypeof PhysicalFunction nes-physical-operators JsonTypeofPhysicalFunction.cpp) +add_plugin(JsonObjectFieldText PhysicalFunction nes-physical-operators JsonObjectFieldTextPhysicalFunction.cpp) +add_plugin(JsonArrayElementText PhysicalFunction nes-physical-operators JsonArrayElementTextPhysicalFunction.cpp) add_plugin(GeomRelatePattern PhysicalFunction nes-physical-operators GeomRelatePatternPhysicalFunction.cpp) add_plugin(GeomIntersects2d PhysicalFunction nes-physical-operators GeomIntersects2dPhysicalFunction.cpp) add_plugin(GeomDwithin2d PhysicalFunction nes-physical-operators GeomDwithin2dPhysicalFunction.cpp) diff --git a/nes-physical-operators/src/Functions/Meos/JsonArrayElementTextPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/JsonArrayElementTextPhysicalFunction.cpp new file mode 100644 index 0000000000..d3bcf23c5a --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/JsonArrayElementTextPhysicalFunction.cpp @@ -0,0 +1,89 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} +#include +#include + +namespace NES { + +JsonArrayElementTextPhysicalFunction::JsonArrayElementTextPhysicalFunction(PhysicalFunction js, PhysicalFunction idx) +{ + paramFns.reserve(2); + paramFns.push_back(std::move(js)); + paramFns.push_back(std::move(idx)); +} + +VarVal JsonArrayElementTextPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto js = paramFns[0].execute(record, arena).cast(); + auto idx = paramFns[1].execute(record, arena).cast(); + constexpr uint32_t MAX_LEN = 4096; + auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); + + const auto actualLen = nautilus::invoke( + +[](const char* w, uint32_t wsz, double idx_d, + char* buf, uint32_t bufMax) -> uint32_t { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string s(w, wsz); + text* js = json_in(s.c_str()); + if (!js) return 0u; + text* res = json_array_element_text(js, (int)idx_d); + free(js); + if (!res) return 0u; + char* out = json_out(res); + free(res); + if (!out) return 0u; + uint32_t len = static_cast(strlen(out)); + if (len > bufMax) len = bufMax; + memcpy(buf, out, len); + free(out); + return len; + } catch (const std::exception&) { return 0u; } + }, + js, idx, outBuf.getContent(), nautilus::val(MAX_LEN)); + + VarVal(actualLen).writeToMemory(outBuf.getReference()); + return outBuf; +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterJsonArrayElementTextPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 2, + "JsonArrayElementTextPhysicalFunction requires 2 children but got {}", + arguments.childFunctions.size()); + return JsonArrayElementTextPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/JsonArrayLengthPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/JsonArrayLengthPhysicalFunction.cpp new file mode 100644 index 0000000000..634d79654f --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/JsonArrayLengthPhysicalFunction.cpp @@ -0,0 +1,71 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} +#include + +namespace NES { + +JsonArrayLengthPhysicalFunction::JsonArrayLengthPhysicalFunction(PhysicalFunction js) +{ + paramFns.reserve(1); + paramFns.push_back(std::move(js)); +} + +VarVal JsonArrayLengthPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto js = paramFns[0].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](const char* w, uint32_t wsz) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string s(w, wsz); + text* js = json_in(s.c_str()); + if (!js) return 0.0; + int n = json_array_length(js); + free(js); + return (double)n; + } catch (const std::exception&) { return 0.0; } + }, + js); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterJsonArrayLengthPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 1, + "JsonArrayLengthPhysicalFunction requires 1 children but got {}", + arguments.childFunctions.size()); + return JsonArrayLengthPhysicalFunction( + std::move(arguments.childFunctions[0])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/JsonObjectFieldTextPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/JsonObjectFieldTextPhysicalFunction.cpp new file mode 100644 index 0000000000..4c7dac7d91 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/JsonObjectFieldTextPhysicalFunction.cpp @@ -0,0 +1,91 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} +#include +#include + +namespace NES { + +JsonObjectFieldTextPhysicalFunction::JsonObjectFieldTextPhysicalFunction(PhysicalFunction js, PhysicalFunction key) +{ + paramFns.reserve(2); + paramFns.push_back(std::move(js)); + paramFns.push_back(std::move(key)); +} + +VarVal JsonObjectFieldTextPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto js = paramFns[0].execute(record, arena).cast(); + auto key = paramFns[1].execute(record, arena).cast(); + constexpr uint32_t MAX_LEN = 4096; + auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); + + const auto actualLen = nautilus::invoke( + +[](const char* wj, uint32_t wjsz, + const char* wk, uint32_t wksz, + char* buf, uint32_t bufMax) -> uint32_t { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string sj(wj, wjsz), sk(wk, wksz); + text* js = json_in(sj.c_str()); + if (!js) return 0u; + text* key = cstring_to_text(sk.c_str()); + text* res = json_object_field_text(js, key); + free(js); free(key); + if (!res) return 0u; + char* out = json_out(res); + free(res); + if (!out) return 0u; + uint32_t len = static_cast(strlen(out)); + if (len > bufMax) len = bufMax; + memcpy(buf, out, len); + free(out); + return len; + } catch (const std::exception&) { return 0u; } + }, + js, key, outBuf.getContent(), nautilus::val(MAX_LEN)); + + VarVal(actualLen).writeToMemory(outBuf.getReference()); + return outBuf; +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterJsonObjectFieldTextPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 2, + "JsonObjectFieldTextPhysicalFunction requires 2 children but got {}", + arguments.childFunctions.size()); + return JsonObjectFieldTextPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/JsonTypeofPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/JsonTypeofPhysicalFunction.cpp new file mode 100644 index 0000000000..46dcc4d134 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/JsonTypeofPhysicalFunction.cpp @@ -0,0 +1,85 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} +#include +#include + +namespace NES { + +JsonTypeofPhysicalFunction::JsonTypeofPhysicalFunction(PhysicalFunction js) +{ + paramFns.reserve(1); + paramFns.push_back(std::move(js)); +} + +VarVal JsonTypeofPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + auto js = paramFns[0].execute(record, arena).cast(); + constexpr uint32_t MAX_LEN = 4096; + auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); + + const auto actualLen = nautilus::invoke( + +[](const char* w, uint32_t wsz, char* buf, uint32_t bufMax) -> uint32_t { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string s(w, wsz); + text* js = json_in(s.c_str()); + if (!js) return 0u; + text* res = json_typeof(js); + free(js); + if (!res) return 0u; + char* out = json_out(res); + free(res); + if (!out) return 0u; + uint32_t len = static_cast(strlen(out)); + if (len > bufMax) len = bufMax; + memcpy(buf, out, len); + free(out); + return len; + } catch (const std::exception&) { return 0u; } + }, + js, outBuf.getContent(), nautilus::val(MAX_LEN)); + + VarVal(actualLen).writeToMemory(outBuf.getReference()); + return outBuf; +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterJsonTypeofPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 1, + "JsonTypeofPhysicalFunction requires 1 children but got {}", + arguments.childFunctions.size()); + return JsonTypeofPhysicalFunction( + std::move(arguments.childFunctions[0])); +} + +} // namespace NES diff --git a/nes-sql-parser/AntlrSQL.g4 b/nes-sql-parser/AntlrSQL.g4 index 9abcec7b44..6e8d1713e3 100644 --- a/nes-sql-parser/AntlrSQL.g4 +++ b/nes-sql-parser/AntlrSQL.g4 @@ -295,7 +295,7 @@ timeUnit: MS timestampParameter: name=identifier; -functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT | TGE_TTEXT_TEXT | TGE_TEXT_TTEXT | TGT_TTEXT_TEXT | TGT_TEXT_TTEXT | TLE_TTEXT_TEXT | TLE_TEXT_TTEXT | TLT_TTEXT_TEXT | TLT_TEXT_TTEXT | TTEXT_UPPER | TTEXT_LOWER | TTEXT_INITCAP | TEXTCAT_TTEXT_TEXT | TEXTCAT_TEXT_TTEXT | TEXTCAT_TTEXT_TTEXT | GEOM_LENGTH | GEOM_PERIMETER | GEOM_AZIMUTH | GEOG_AREA | GEOG_LENGTH | GEOG_PERIMETER | GEOM_IS_EMPTY | AINTERSECTS_TGEO_GEO | ACOVERS_TGEO_GEO | ADISJOINT_TGEO_GEO | ADWITHIN_TGEO_GEO | EINTERSECTS_TGEO_GEO | ETOUCHES_TGEO_GEO | ECONTAINS_TGEO_GEO | ACONTAINS_TGEO_GEO | ATOUCHES_TGEO_GEO | GEO_NUM_POINTS | GEO_NUM_GEOS | GEO_SRID | GEO_IS_UNITARY | GEO_EQUALS | GEO_SAME | GEOG_DISTANCE | NAD_TGEO_GEO | EVER_EQ_TGEO_GEO | EVER_NE_TGEO_GEO | ALWAYS_EQ_TGEO_GEO | ALWAYS_NE_TGEO_GEO | GEOG_INTERSECTS | GEOG_DWITHIN | ACOVERS_GEO_TGEO | GEOM_INTERSECTS | GEOM_DWITHIN | H3_GS_POINT_TO_CELL | EVER_EQ_TH3INDEX_H3INDEX | EVER_NE_TH3INDEX_H3INDEX | ALWAYS_EQ_TH3INDEX_H3INDEX | ALWAYS_NE_TH3INDEX_H3INDEX | TH3INDEX_GET_RESOLUTION | TH3INDEX_GET_BASE_CELL_NUMBER | TH3INDEX_IS_VALID_CELL | TH3INDEX_IS_PENTAGON | TH3INDEX_CELL_TO_PARENT_NEXT | TH3INDEX_CELL_TO_CENTER_CHILD_NEXT | TH3INDEX_CELL_TO_PARENT | TH3INDEX_CELL_TO_CENTER_CHILD | TH3INDEX_CELL_TO_CHILD_POS | TH3INDEX_ARE_NEIGHBOR_CELLS | TH3INDEX_GRID_DISTANCE | EINTERSECTS_TCBUFFER_GEO | AINTERSECTS_TCBUFFER_GEO | ECOVERS_TCBUFFER_GEO | ACOVERS_TCBUFFER_GEO | EDISJOINT_TCBUFFER_GEO | ADISJOINT_TCBUFFER_GEO | ETOUCHES_TCBUFFER_GEO | ATOUCHES_TCBUFFER_GEO | ECONTAINS_TCBUFFER_GEO | ACONTAINS_TCBUFFER_GEO | NAD_TCBUFFER_GEO | EDWITHIN_TCBUFFER_GEO | ADWITHIN_TCBUFFER_GEO | EINTERSECTS_TCBUFFER_CBUFFER | AINTERSECTS_TCBUFFER_CBUFFER | ECOVERS_TCBUFFER_CBUFFER | ACOVERS_TCBUFFER_CBUFFER | EDISJOINT_TCBUFFER_CBUFFER | ADISJOINT_TCBUFFER_CBUFFER | ETOUCHES_TCBUFFER_CBUFFER | ATOUCHES_TCBUFFER_CBUFFER | ECONTAINS_TCBUFFER_CBUFFER | ACONTAINS_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_CBUFFER | ALWAYS_EQ_TCBUFFER_CBUFFER | EVER_NE_TCBUFFER_CBUFFER | ALWAYS_NE_TCBUFFER_CBUFFER | NAD_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_TCBUFFER | ALWAYS_EQ_TCBUFFER_TCBUFFER | EVER_NE_TCBUFFER_TCBUFFER | ALWAYS_NE_TCBUFFER_TCBUFFER | EINTERSECTS_TCBUFFER_TCBUFFER | AINTERSECTS_TCBUFFER_TCBUFFER | ECOVERS_TCBUFFER_TCBUFFER | ACOVERS_TCBUFFER_TCBUFFER | ADISJOINT_TCBUFFER_TCBUFFER | ETOUCHES_TCBUFFER_TCBUFFER | ATOUCHES_TCBUFFER_TCBUFFER | NAD_TCBUFFER_TCBUFFER | EDWITHIN_TCBUFFER_TCBUFFER | ADWITHIN_TCBUFFER_TCBUFFER | MINDISTANCE_TCBUFFER_TCBUFFER | NAD_TNPOINT_GEO | EVER_EQ_TNPOINT_NPOINT | ALWAYS_EQ_TNPOINT_NPOINT | EVER_NE_TNPOINT_NPOINT | ALWAYS_NE_TNPOINT_NPOINT | NAD_TNPOINT_NPOINT | EVER_EQ_NPOINT_TNPOINT | ALWAYS_EQ_NPOINT_TNPOINT | EVER_NE_NPOINT_TNPOINT | ALWAYS_NE_NPOINT_TNPOINT | EVER_EQ_TNPOINT_TNPOINT | ALWAYS_EQ_TNPOINT_TNPOINT | EVER_NE_TNPOINT_TNPOINT | ALWAYS_NE_TNPOINT_TNPOINT | NAD_TNPOINT_TNPOINT | NAD_TPOSE_GEO | EVER_EQ_TPOSE_POSE | ALWAYS_EQ_TPOSE_POSE | EVER_NE_TPOSE_POSE | ALWAYS_NE_TPOSE_POSE | NAD_TPOSE_POSE | EVER_EQ_POSE_TPOSE | ALWAYS_EQ_POSE_TPOSE | EVER_NE_POSE_TPOSE | ALWAYS_NE_POSE_TPOSE | EVER_EQ_TPOSE_TPOSE | ALWAYS_EQ_TPOSE_TPOSE | EVER_NE_TPOSE_TPOSE | ALWAYS_NE_TPOSE_TPOSE | NAD_TPOSE_TPOSE | EVER_EQ_TRGEOMETRY_GEO | ALWAYS_EQ_TRGEOMETRY_GEO | EVER_NE_TRGEOMETRY_GEO | ALWAYS_NE_TRGEOMETRY_GEO | NAD_TRGEOMETRY_GEO | EVER_EQ_GEO_TRGEOMETRY | ALWAYS_EQ_GEO_TRGEOMETRY | EVER_NE_GEO_TRGEOMETRY | ALWAYS_NE_GEO_TRGEOMETRY | EVER_EQ_TRGEOMETRY_TRGEOMETRY | ALWAYS_EQ_TRGEOMETRY_TRGEOMETRY | EVER_NE_TRGEOMETRY_TRGEOMETRY | ALWAYS_NE_TRGEOMETRY_TRGEOMETRY | NAD_TRGEOMETRY_TRGEOMETRY | EINTERSECTS_TPCPOINT_GEO | NAD_TPCPOINT_GEO | QUADBIN_POINT_TO_CELL | QUADBIN_IS_VALID_CELL | QUADBIN_GET_RESOLUTION | QUADBIN_CELL_AREA | QUADBIN_CELL_TO_QUADKEY | QUADBIN_CELL_TO_PARENT | QUADBIN_TILE_TO_CELL | EVER_EQ_TJSONB_JSONB | ALWAYS_EQ_TJSONB_JSONB | EVER_NE_TJSONB_JSONB | ALWAYS_NE_TJSONB_JSONB | EVER_EQ_TJSONB_TJSONB | ALWAYS_EQ_TJSONB_TJSONB | EVER_NE_TJSONB_TJSONB | ALWAYS_NE_TJSONB_TJSONB | GEOM_BOUNDARY | GEOM_CENTROID | GEOM_CONVEX_HULL | GEO_REVERSE | GEO_POINTS | GEOM_UNARY_UNION | GEOM_DIFFERENCE2D | GEOM_INTERSECTION2D | GEOM_SHORTESTLINE2D | GEOM_SHORTESTLINE3D | GEO_SET_SRID | GEO_TRANSFORM | GEO_ROUND | GEOM_BUFFER | LINE_NUMPOINTS | LINE_LOCATE_POINT | LINE_INTERPOLATE_POINT | LINE_SUBSTRING | GEOM_POINT_MAKE2D | GEOM_POINT_MAKE3DZ | GEOG_POINT_MAKE2D | GEOG_POINT_MAKE3DZ | GEOM_TO_GEOG | GEOG_TO_GEOM | GEOG_CENTROID | GEO_GEO_N | LINE_POINT_N | GEOM_INTERSECTION2D_COLL | GEO_AS_GEOJSON | GEO_AS_HEXEWKB | GEO_AS_EWKT | GEO_FROM_GEOJSON | GEOM_FROM_HEXEWKB | GEO_TRANSFORM_PIPELINE | GEOM_MIN_BOUNDING_CENTER | GEOM_MIN_BOUNDING_RADIUS | EVER_EQ_TGEO_TGEO | EVER_NE_TGEO_TGEO | ALWAYS_EQ_TGEO_TGEO | ALWAYS_NE_TGEO_TGEO | EINTERSECTS_TGEO_TGEO | ECOVERS_TGEO_TGEO | EDISJOINT_TGEO_TGEO | ECONTAINS_TGEO_TGEO | ETOUCHES_TGEO_TGEO | AINTERSECTS_TGEO_TGEO | ACOVERS_TGEO_TGEO | ADISJOINT_TGEO_TGEO | ACONTAINS_TGEO_TGEO | ATOUCHES_TGEO_TGEO | EDWITHIN_TGEO_TGEO | ADWITHIN_TGEO_TGEO | H3INDEX_EQ | H3INDEX_NE | H3INDEX_LT | H3INDEX_LE | H3INDEX_GT | H3INDEX_GE | H3INDEX_CMP | H3INDEX_OUT | H3INDEX_IN | GEOM_RELATE_PATTERN | GEOM_INTERSECTS2D | GEOM_DWITHIN2D | GEOM_CONTAINS | GEOM_DISJOINT2D | GEOM_COVERS | GEOM_TOUCHES | GEOM_INTERSECTS3D | GEOM_DWITHIN3D | GEOM_DISTANCE2D | GEOM_DISTANCE3D; +functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT | TGE_TTEXT_TEXT | TGE_TEXT_TTEXT | TGT_TTEXT_TEXT | TGT_TEXT_TTEXT | TLE_TTEXT_TEXT | TLE_TEXT_TTEXT | TLT_TTEXT_TEXT | TLT_TEXT_TTEXT | TTEXT_UPPER | TTEXT_LOWER | TTEXT_INITCAP | TEXTCAT_TTEXT_TEXT | TEXTCAT_TEXT_TTEXT | TEXTCAT_TTEXT_TTEXT | GEOM_LENGTH | GEOM_PERIMETER | GEOM_AZIMUTH | GEOG_AREA | GEOG_LENGTH | GEOG_PERIMETER | GEOM_IS_EMPTY | AINTERSECTS_TGEO_GEO | ACOVERS_TGEO_GEO | ADISJOINT_TGEO_GEO | ADWITHIN_TGEO_GEO | EINTERSECTS_TGEO_GEO | ETOUCHES_TGEO_GEO | ECONTAINS_TGEO_GEO | ACONTAINS_TGEO_GEO | ATOUCHES_TGEO_GEO | GEO_NUM_POINTS | GEO_NUM_GEOS | GEO_SRID | GEO_IS_UNITARY | GEO_EQUALS | GEO_SAME | GEOG_DISTANCE | NAD_TGEO_GEO | EVER_EQ_TGEO_GEO | EVER_NE_TGEO_GEO | ALWAYS_EQ_TGEO_GEO | ALWAYS_NE_TGEO_GEO | GEOG_INTERSECTS | GEOG_DWITHIN | ACOVERS_GEO_TGEO | GEOM_INTERSECTS | GEOM_DWITHIN | H3_GS_POINT_TO_CELL | EVER_EQ_TH3INDEX_H3INDEX | EVER_NE_TH3INDEX_H3INDEX | ALWAYS_EQ_TH3INDEX_H3INDEX | ALWAYS_NE_TH3INDEX_H3INDEX | TH3INDEX_GET_RESOLUTION | TH3INDEX_GET_BASE_CELL_NUMBER | TH3INDEX_IS_VALID_CELL | TH3INDEX_IS_PENTAGON | TH3INDEX_CELL_TO_PARENT_NEXT | TH3INDEX_CELL_TO_CENTER_CHILD_NEXT | TH3INDEX_CELL_TO_PARENT | TH3INDEX_CELL_TO_CENTER_CHILD | TH3INDEX_CELL_TO_CHILD_POS | TH3INDEX_ARE_NEIGHBOR_CELLS | TH3INDEX_GRID_DISTANCE | EINTERSECTS_TCBUFFER_GEO | AINTERSECTS_TCBUFFER_GEO | ECOVERS_TCBUFFER_GEO | ACOVERS_TCBUFFER_GEO | EDISJOINT_TCBUFFER_GEO | ADISJOINT_TCBUFFER_GEO | ETOUCHES_TCBUFFER_GEO | ATOUCHES_TCBUFFER_GEO | ECONTAINS_TCBUFFER_GEO | ACONTAINS_TCBUFFER_GEO | NAD_TCBUFFER_GEO | EDWITHIN_TCBUFFER_GEO | ADWITHIN_TCBUFFER_GEO | EINTERSECTS_TCBUFFER_CBUFFER | AINTERSECTS_TCBUFFER_CBUFFER | ECOVERS_TCBUFFER_CBUFFER | ACOVERS_TCBUFFER_CBUFFER | EDISJOINT_TCBUFFER_CBUFFER | ADISJOINT_TCBUFFER_CBUFFER | ETOUCHES_TCBUFFER_CBUFFER | ATOUCHES_TCBUFFER_CBUFFER | ECONTAINS_TCBUFFER_CBUFFER | ACONTAINS_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_CBUFFER | ALWAYS_EQ_TCBUFFER_CBUFFER | EVER_NE_TCBUFFER_CBUFFER | ALWAYS_NE_TCBUFFER_CBUFFER | NAD_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_TCBUFFER | ALWAYS_EQ_TCBUFFER_TCBUFFER | EVER_NE_TCBUFFER_TCBUFFER | ALWAYS_NE_TCBUFFER_TCBUFFER | EINTERSECTS_TCBUFFER_TCBUFFER | AINTERSECTS_TCBUFFER_TCBUFFER | ECOVERS_TCBUFFER_TCBUFFER | ACOVERS_TCBUFFER_TCBUFFER | ADISJOINT_TCBUFFER_TCBUFFER | ETOUCHES_TCBUFFER_TCBUFFER | ATOUCHES_TCBUFFER_TCBUFFER | NAD_TCBUFFER_TCBUFFER | EDWITHIN_TCBUFFER_TCBUFFER | ADWITHIN_TCBUFFER_TCBUFFER | MINDISTANCE_TCBUFFER_TCBUFFER | NAD_TNPOINT_GEO | EVER_EQ_TNPOINT_NPOINT | ALWAYS_EQ_TNPOINT_NPOINT | EVER_NE_TNPOINT_NPOINT | ALWAYS_NE_TNPOINT_NPOINT | NAD_TNPOINT_NPOINT | EVER_EQ_NPOINT_TNPOINT | ALWAYS_EQ_NPOINT_TNPOINT | EVER_NE_NPOINT_TNPOINT | ALWAYS_NE_NPOINT_TNPOINT | EVER_EQ_TNPOINT_TNPOINT | ALWAYS_EQ_TNPOINT_TNPOINT | EVER_NE_TNPOINT_TNPOINT | ALWAYS_NE_TNPOINT_TNPOINT | NAD_TNPOINT_TNPOINT | NAD_TPOSE_GEO | EVER_EQ_TPOSE_POSE | ALWAYS_EQ_TPOSE_POSE | EVER_NE_TPOSE_POSE | ALWAYS_NE_TPOSE_POSE | NAD_TPOSE_POSE | EVER_EQ_POSE_TPOSE | ALWAYS_EQ_POSE_TPOSE | EVER_NE_POSE_TPOSE | ALWAYS_NE_POSE_TPOSE | EVER_EQ_TPOSE_TPOSE | ALWAYS_EQ_TPOSE_TPOSE | EVER_NE_TPOSE_TPOSE | ALWAYS_NE_TPOSE_TPOSE | NAD_TPOSE_TPOSE | EVER_EQ_TRGEOMETRY_GEO | ALWAYS_EQ_TRGEOMETRY_GEO | EVER_NE_TRGEOMETRY_GEO | ALWAYS_NE_TRGEOMETRY_GEO | NAD_TRGEOMETRY_GEO | EVER_EQ_GEO_TRGEOMETRY | ALWAYS_EQ_GEO_TRGEOMETRY | EVER_NE_GEO_TRGEOMETRY | ALWAYS_NE_GEO_TRGEOMETRY | EVER_EQ_TRGEOMETRY_TRGEOMETRY | ALWAYS_EQ_TRGEOMETRY_TRGEOMETRY | EVER_NE_TRGEOMETRY_TRGEOMETRY | ALWAYS_NE_TRGEOMETRY_TRGEOMETRY | NAD_TRGEOMETRY_TRGEOMETRY | EINTERSECTS_TPCPOINT_GEO | NAD_TPCPOINT_GEO | QUADBIN_POINT_TO_CELL | QUADBIN_IS_VALID_CELL | QUADBIN_GET_RESOLUTION | QUADBIN_CELL_AREA | QUADBIN_CELL_TO_QUADKEY | QUADBIN_CELL_TO_PARENT | QUADBIN_TILE_TO_CELL | EVER_EQ_TJSONB_JSONB | ALWAYS_EQ_TJSONB_JSONB | EVER_NE_TJSONB_JSONB | ALWAYS_NE_TJSONB_JSONB | EVER_EQ_TJSONB_TJSONB | ALWAYS_EQ_TJSONB_TJSONB | EVER_NE_TJSONB_TJSONB | ALWAYS_NE_TJSONB_TJSONB | GEOM_BOUNDARY | GEOM_CENTROID | GEOM_CONVEX_HULL | GEO_REVERSE | GEO_POINTS | GEOM_UNARY_UNION | GEOM_DIFFERENCE2D | GEOM_INTERSECTION2D | GEOM_SHORTESTLINE2D | GEOM_SHORTESTLINE3D | GEO_SET_SRID | GEO_TRANSFORM | GEO_ROUND | GEOM_BUFFER | LINE_NUMPOINTS | LINE_LOCATE_POINT | LINE_INTERPOLATE_POINT | LINE_SUBSTRING | GEOM_POINT_MAKE2D | GEOM_POINT_MAKE3DZ | GEOG_POINT_MAKE2D | GEOG_POINT_MAKE3DZ | GEOM_TO_GEOG | GEOG_TO_GEOM | GEOG_CENTROID | GEO_GEO_N | LINE_POINT_N | GEOM_INTERSECTION2D_COLL | GEO_AS_GEOJSON | GEO_AS_HEXEWKB | GEO_AS_EWKT | GEO_FROM_GEOJSON | GEOM_FROM_HEXEWKB | GEO_TRANSFORM_PIPELINE | GEOM_MIN_BOUNDING_CENTER | GEOM_MIN_BOUNDING_RADIUS | EVER_EQ_TGEO_TGEO | EVER_NE_TGEO_TGEO | ALWAYS_EQ_TGEO_TGEO | ALWAYS_NE_TGEO_TGEO | EINTERSECTS_TGEO_TGEO | ECOVERS_TGEO_TGEO | EDISJOINT_TGEO_TGEO | ECONTAINS_TGEO_TGEO | ETOUCHES_TGEO_TGEO | AINTERSECTS_TGEO_TGEO | ACOVERS_TGEO_TGEO | ADISJOINT_TGEO_TGEO | ACONTAINS_TGEO_TGEO | ATOUCHES_TGEO_TGEO | EDWITHIN_TGEO_TGEO | ADWITHIN_TGEO_TGEO | H3INDEX_EQ | H3INDEX_NE | H3INDEX_LT | H3INDEX_LE | H3INDEX_GT | H3INDEX_GE | H3INDEX_CMP | H3INDEX_OUT | H3INDEX_IN | JSON_ARRAY_LENGTH | JSON_TYPEOF | JSON_OBJECT_FIELD_TEXT | JSON_ARRAY_ELEMENT_TEXT | GEOM_RELATE_PATTERN | GEOM_INTERSECTS2D | GEOM_DWITHIN2D | GEOM_CONTAINS | GEOM_DISJOINT2D | GEOM_COVERS | GEOM_TOUCHES | GEOM_INTERSECTS3D | GEOM_DWITHIN3D | GEOM_DISTANCE2D | GEOM_DISTANCE3D; sinkClause: INTO sink (',' sink)*; @@ -972,6 +972,10 @@ H3INDEX_GE: 'H3INDEX_GE' | 'h3index_ge'; H3INDEX_CMP: 'H3INDEX_CMP' | 'h3index_cmp'; H3INDEX_OUT: 'H3INDEX_OUT' | 'h3index_out'; H3INDEX_IN: 'H3INDEX_IN' | 'h3index_in'; +JSON_ARRAY_LENGTH: 'JSON_ARRAY_LENGTH' | 'json_array_length'; +JSON_TYPEOF: 'JSON_TYPEOF' | 'json_typeof'; +JSON_OBJECT_FIELD_TEXT: 'JSON_OBJECT_FIELD_TEXT' | 'json_object_field_text'; +JSON_ARRAY_ELEMENT_TEXT: 'JSON_ARRAY_ELEMENT_TEXT' | 'json_array_element_text'; GEOM_RELATE_PATTERN: 'GEOM_RELATE_PATTERN' | 'geom_relate_pattern'; GEOM_INTERSECTS2D: 'GEOM_INTERSECTS2D' | 'geom_intersects2d'; GEOM_DWITHIN2D: 'GEOM_DWITHIN2D' | 'geom_dwithin2d'; diff --git a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp index aa345a5f33..ece7ebc48c 100644 --- a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp +++ b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp @@ -553,6 +553,10 @@ #include #include #include +#include +#include +#include +#include #include #include #include @@ -11441,6 +11445,40 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont return LogicalFunction(H3indexInLogicalFunction(std::move(arg0))); } /* END CODEGEN PARSER GLUE: H3INDEX_IN */ + case AntlrSQLParser::JSON_ARRAY_LENGTH: { + PRECONDITION(ctx->functionParam().size() == 1, + "JsonArrayLength requires 1 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + return LogicalFunction(JsonArrayLengthLogicalFunction(std::move(arg0))); + } + /* END CODEGEN PARSER GLUE: JSON_ARRAY_LENGTH */ + case AntlrSQLParser::JSON_TYPEOF: { + PRECONDITION(ctx->functionParam().size() == 1, + "JsonTypeof requires 1 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + return LogicalFunction(JsonTypeofLogicalFunction(std::move(arg0))); + } + /* END CODEGEN PARSER GLUE: JSON_TYPEOF */ + case AntlrSQLParser::JSON_OBJECT_FIELD_TEXT: { + PRECONDITION(ctx->functionParam().size() == 2, + "JsonObjectFieldText requires 2 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + return LogicalFunction(JsonObjectFieldTextLogicalFunction(std::move(arg0), std::move(arg1))); + } + /* END CODEGEN PARSER GLUE: JSON_OBJECT_FIELD_TEXT */ + case AntlrSQLParser::JSON_ARRAY_ELEMENT_TEXT: { + PRECONDITION(ctx->functionParam().size() == 2, + "JsonArrayElementText requires 2 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + return LogicalFunction(JsonArrayElementTextLogicalFunction(std::move(arg0), std::move(arg1))); + } + /* END CODEGEN PARSER GLUE: JSON_ARRAY_ELEMENT_TEXT */ /* END CODEGEN PARSER GLUE: GEOM_RELATE_PATTERN */ /* END CODEGEN PARSER GLUE: GEOM_INTERSECTS2D */ case AntlrSQLParser::GEOM_DWITHIN2D: { From 938fc5669b87a8c07cafc15f769973c1711fa874 Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Thu, 18 Jun 2026 23:10:52 +0200 Subject: [PATCH 90/96] feat(meos): add JSONB scalar per-event NES operators (W142) Wires 15 JSONB per-event operators: JSONB_ARRAY_LENGTH (->F64), JSONB_EQ/NE/LT/LE/GT/GE/CMP/CONTAINS/CONTAINED/EXISTS (->F64), and JSONB_TO_CSTRING/PRETTY/OBJECT_FIELD_TEXT/ARRAY_ELEMENT_TEXT (->VARCHAR). Backed by jsonb_in/jsonb_out + the corresponding jsonb_* functions. Key and text args use cstring_to_text/text_to_cstring. New in ecosystem-pin-2026-06-18b. --- .../JsonbArrayElementTextLogicalFunction.hpp | 45 ++++++ .../Meos/JsonbArrayLengthLogicalFunction.hpp | 45 ++++++ .../Meos/JsonbCmpLogicalFunction.hpp | 45 ++++++ .../Meos/JsonbContainedLogicalFunction.hpp | 45 ++++++ .../Meos/JsonbContainsLogicalFunction.hpp | 45 ++++++ .../Functions/Meos/JsonbEqLogicalFunction.hpp | 45 ++++++ .../Meos/JsonbExistsLogicalFunction.hpp | 45 ++++++ .../Functions/Meos/JsonbGeLogicalFunction.hpp | 45 ++++++ .../Functions/Meos/JsonbGtLogicalFunction.hpp | 45 ++++++ .../Functions/Meos/JsonbLeLogicalFunction.hpp | 45 ++++++ .../Functions/Meos/JsonbLtLogicalFunction.hpp | 45 ++++++ .../Functions/Meos/JsonbNeLogicalFunction.hpp | 45 ++++++ .../JsonbObjectFieldTextLogicalFunction.hpp | 45 ++++++ .../Meos/JsonbPrettyLogicalFunction.hpp | 45 ++++++ .../Meos/JsonbToCstringLogicalFunction.hpp | 45 ++++++ .../src/Functions/Meos/CMakeLists.txt | 15 ++ .../JsonbArrayElementTextLogicalFunction.cpp | 75 +++++++++ .../Meos/JsonbArrayLengthLogicalFunction.cpp | 72 +++++++++ .../Meos/JsonbCmpLogicalFunction.cpp | 75 +++++++++ .../Meos/JsonbContainedLogicalFunction.cpp | 75 +++++++++ .../Meos/JsonbContainsLogicalFunction.cpp | 75 +++++++++ .../Functions/Meos/JsonbEqLogicalFunction.cpp | 75 +++++++++ .../Meos/JsonbExistsLogicalFunction.cpp | 75 +++++++++ .../Functions/Meos/JsonbGeLogicalFunction.cpp | 75 +++++++++ .../Functions/Meos/JsonbGtLogicalFunction.cpp | 75 +++++++++ .../Functions/Meos/JsonbLeLogicalFunction.cpp | 75 +++++++++ .../Functions/Meos/JsonbLtLogicalFunction.cpp | 75 +++++++++ .../Functions/Meos/JsonbNeLogicalFunction.cpp | 75 +++++++++ .../JsonbObjectFieldTextLogicalFunction.cpp | 75 +++++++++ .../Meos/JsonbPrettyLogicalFunction.cpp | 72 +++++++++ .../Meos/JsonbToCstringLogicalFunction.cpp | 72 +++++++++ .../JsonbArrayElementTextPhysicalFunction.hpp | 32 ++++ .../Meos/JsonbArrayLengthPhysicalFunction.hpp | 32 ++++ .../Meos/JsonbCmpPhysicalFunction.hpp | 32 ++++ .../Meos/JsonbContainedPhysicalFunction.hpp | 32 ++++ .../Meos/JsonbContainsPhysicalFunction.hpp | 32 ++++ .../Meos/JsonbEqPhysicalFunction.hpp | 32 ++++ .../Meos/JsonbExistsPhysicalFunction.hpp | 32 ++++ .../Meos/JsonbGePhysicalFunction.hpp | 32 ++++ .../Meos/JsonbGtPhysicalFunction.hpp | 32 ++++ .../Meos/JsonbLePhysicalFunction.hpp | 32 ++++ .../Meos/JsonbLtPhysicalFunction.hpp | 32 ++++ .../Meos/JsonbNePhysicalFunction.hpp | 32 ++++ .../JsonbObjectFieldTextPhysicalFunction.hpp | 32 ++++ .../Meos/JsonbPrettyPhysicalFunction.hpp | 32 ++++ .../Meos/JsonbToCstringPhysicalFunction.hpp | 32 ++++ .../src/Functions/Meos/CMakeLists.txt | 15 ++ .../JsonbArrayElementTextPhysicalFunction.cpp | 85 ++++++++++ .../Meos/JsonbArrayLengthPhysicalFunction.cpp | 70 +++++++++ .../Meos/JsonbCmpPhysicalFunction.cpp | 75 +++++++++ .../Meos/JsonbContainedPhysicalFunction.cpp | 75 +++++++++ .../Meos/JsonbContainsPhysicalFunction.cpp | 75 +++++++++ .../Meos/JsonbEqPhysicalFunction.cpp | 75 +++++++++ .../Meos/JsonbExistsPhysicalFunction.cpp | 74 +++++++++ .../Meos/JsonbGePhysicalFunction.cpp | 75 +++++++++ .../Meos/JsonbGtPhysicalFunction.cpp | 75 +++++++++ .../Meos/JsonbLePhysicalFunction.cpp | 75 +++++++++ .../Meos/JsonbLtPhysicalFunction.cpp | 75 +++++++++ .../Meos/JsonbNePhysicalFunction.cpp | 75 +++++++++ .../JsonbObjectFieldTextPhysicalFunction.cpp | 86 ++++++++++ .../Meos/JsonbPrettyPhysicalFunction.cpp | 81 ++++++++++ .../Meos/JsonbToCstringPhysicalFunction.cpp | 78 ++++++++++ nes-sql-parser/AntlrSQL.g4 | 17 +- .../src/AntlrSQLQueryPlanCreator.cpp | 147 ++++++++++++++++++ 64 files changed, 3613 insertions(+), 1 deletion(-) create mode 100644 nes-logical-operators/include/Functions/Meos/JsonbArrayElementTextLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/JsonbArrayLengthLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/JsonbCmpLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/JsonbContainedLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/JsonbContainsLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/JsonbEqLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/JsonbExistsLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/JsonbGeLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/JsonbGtLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/JsonbLeLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/JsonbLtLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/JsonbNeLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/JsonbObjectFieldTextLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/JsonbPrettyLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/JsonbToCstringLogicalFunction.hpp create mode 100644 nes-logical-operators/src/Functions/Meos/JsonbArrayElementTextLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/JsonbArrayLengthLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/JsonbCmpLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/JsonbContainedLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/JsonbContainsLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/JsonbEqLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/JsonbExistsLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/JsonbGeLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/JsonbGtLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/JsonbLeLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/JsonbLtLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/JsonbNeLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/JsonbObjectFieldTextLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/JsonbPrettyLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/JsonbToCstringLogicalFunction.cpp create mode 100644 nes-physical-operators/include/Functions/Meos/JsonbArrayElementTextPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/JsonbArrayLengthPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/JsonbCmpPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/JsonbContainedPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/JsonbContainsPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/JsonbEqPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/JsonbExistsPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/JsonbGePhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/JsonbGtPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/JsonbLePhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/JsonbLtPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/JsonbNePhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/JsonbObjectFieldTextPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/JsonbPrettyPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/JsonbToCstringPhysicalFunction.hpp create mode 100644 nes-physical-operators/src/Functions/Meos/JsonbArrayElementTextPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/JsonbArrayLengthPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/JsonbCmpPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/JsonbContainedPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/JsonbContainsPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/JsonbEqPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/JsonbExistsPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/JsonbGePhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/JsonbGtPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/JsonbLePhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/JsonbLtPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/JsonbNePhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/JsonbObjectFieldTextPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/JsonbPrettyPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/JsonbToCstringPhysicalFunction.cpp diff --git a/nes-logical-operators/include/Functions/Meos/JsonbArrayElementTextLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/JsonbArrayElementTextLogicalFunction.hpp new file mode 100644 index 0000000000..698a1c749b --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/JsonbArrayElementTextLogicalFunction.hpp @@ -0,0 +1,45 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns the n-th element of a JSONB array as plain text. + */ +class JsonbArrayElementTextLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "JsonbArrayElementText"; + JsonbArrayElementTextLogicalFunction(LogicalFunction jb, LogicalFunction idx); + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/JsonbArrayLengthLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/JsonbArrayLengthLogicalFunction.hpp new file mode 100644 index 0000000000..1bd8a6ecdf --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/JsonbArrayLengthLogicalFunction.hpp @@ -0,0 +1,45 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns the number of elements in the outermost JSONB array. + */ +class JsonbArrayLengthLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "JsonbArrayLength"; + JsonbArrayLengthLogicalFunction(LogicalFunction jb); + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/JsonbCmpLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/JsonbCmpLogicalFunction.hpp new file mode 100644 index 0000000000..a0d29b5285 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/JsonbCmpLogicalFunction.hpp @@ -0,0 +1,45 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns -1, 0, or 1 comparison result for two JSONB values. + */ +class JsonbCmpLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "JsonbCmp"; + JsonbCmpLogicalFunction(LogicalFunction jb1, LogicalFunction jb2); + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/JsonbContainedLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/JsonbContainedLogicalFunction.hpp new file mode 100644 index 0000000000..c21a486a1f --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/JsonbContainedLogicalFunction.hpp @@ -0,0 +1,45 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Tests if JSONB jb1 is contained by jb2. + */ +class JsonbContainedLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "JsonbContained"; + JsonbContainedLogicalFunction(LogicalFunction jb1, LogicalFunction jb2); + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/JsonbContainsLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/JsonbContainsLogicalFunction.hpp new file mode 100644 index 0000000000..6b768f3452 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/JsonbContainsLogicalFunction.hpp @@ -0,0 +1,45 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Tests if JSONB jb1 contains jb2. + */ +class JsonbContainsLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "JsonbContains"; + JsonbContainsLogicalFunction(LogicalFunction jb1, LogicalFunction jb2); + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/JsonbEqLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/JsonbEqLogicalFunction.hpp new file mode 100644 index 0000000000..26d46dc090 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/JsonbEqLogicalFunction.hpp @@ -0,0 +1,45 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Tests equality of two JSONB values. + */ +class JsonbEqLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "JsonbEq"; + JsonbEqLogicalFunction(LogicalFunction jb1, LogicalFunction jb2); + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/JsonbExistsLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/JsonbExistsLogicalFunction.hpp new file mode 100644 index 0000000000..d52da9521e --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/JsonbExistsLogicalFunction.hpp @@ -0,0 +1,45 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Tests if a key exists in a JSONB object. + */ +class JsonbExistsLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "JsonbExists"; + JsonbExistsLogicalFunction(LogicalFunction jb, LogicalFunction key); + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/JsonbGeLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/JsonbGeLogicalFunction.hpp new file mode 100644 index 0000000000..0b8858226c --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/JsonbGeLogicalFunction.hpp @@ -0,0 +1,45 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Tests if JSONB value jb1 is greater than or equal to jb2. + */ +class JsonbGeLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "JsonbGe"; + JsonbGeLogicalFunction(LogicalFunction jb1, LogicalFunction jb2); + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/JsonbGtLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/JsonbGtLogicalFunction.hpp new file mode 100644 index 0000000000..fc8b2b0e50 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/JsonbGtLogicalFunction.hpp @@ -0,0 +1,45 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Tests if JSONB value jb1 is greater than jb2. + */ +class JsonbGtLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "JsonbGt"; + JsonbGtLogicalFunction(LogicalFunction jb1, LogicalFunction jb2); + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/JsonbLeLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/JsonbLeLogicalFunction.hpp new file mode 100644 index 0000000000..403df06bd5 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/JsonbLeLogicalFunction.hpp @@ -0,0 +1,45 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Tests if JSONB value jb1 is less than or equal to jb2. + */ +class JsonbLeLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "JsonbLe"; + JsonbLeLogicalFunction(LogicalFunction jb1, LogicalFunction jb2); + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/JsonbLtLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/JsonbLtLogicalFunction.hpp new file mode 100644 index 0000000000..0ef0a9247a --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/JsonbLtLogicalFunction.hpp @@ -0,0 +1,45 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Tests if JSONB value jb1 is less than jb2. + */ +class JsonbLtLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "JsonbLt"; + JsonbLtLogicalFunction(LogicalFunction jb1, LogicalFunction jb2); + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/JsonbNeLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/JsonbNeLogicalFunction.hpp new file mode 100644 index 0000000000..b11874651e --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/JsonbNeLogicalFunction.hpp @@ -0,0 +1,45 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Tests inequality of two JSONB values. + */ +class JsonbNeLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "JsonbNe"; + JsonbNeLogicalFunction(LogicalFunction jb1, LogicalFunction jb2); + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/JsonbObjectFieldTextLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/JsonbObjectFieldTextLogicalFunction.hpp new file mode 100644 index 0000000000..8522e5e813 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/JsonbObjectFieldTextLogicalFunction.hpp @@ -0,0 +1,45 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns the value of a JSONB object field as plain text. + */ +class JsonbObjectFieldTextLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "JsonbObjectFieldText"; + JsonbObjectFieldTextLogicalFunction(LogicalFunction jb, LogicalFunction key); + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/JsonbPrettyLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/JsonbPrettyLogicalFunction.hpp new file mode 100644 index 0000000000..d7b05e5f41 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/JsonbPrettyLogicalFunction.hpp @@ -0,0 +1,45 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns a JSONB value formatted with indentation. + */ +class JsonbPrettyLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "JsonbPretty"; + JsonbPrettyLogicalFunction(LogicalFunction jb); + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/JsonbToCstringLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/JsonbToCstringLogicalFunction.hpp new file mode 100644 index 0000000000..b27c8c836b --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/JsonbToCstringLogicalFunction.hpp @@ -0,0 +1,45 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Converts a JSONB value to its text representation. + */ +class JsonbToCstringLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "JsonbToCstring"; + JsonbToCstringLogicalFunction(LogicalFunction jb); + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt index 6e677d4f14..6df4d7dcfe 100644 --- a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt @@ -506,6 +506,21 @@ add_plugin(JsonArrayLength LogicalFunction nes-logical-operators JsonArrayLength add_plugin(JsonTypeof LogicalFunction nes-logical-operators JsonTypeofLogicalFunction.cpp) add_plugin(JsonObjectFieldText LogicalFunction nes-logical-operators JsonObjectFieldTextLogicalFunction.cpp) add_plugin(JsonArrayElementText LogicalFunction nes-logical-operators JsonArrayElementTextLogicalFunction.cpp) +add_plugin(JsonbArrayLength LogicalFunction nes-logical-operators JsonbArrayLengthLogicalFunction.cpp) +add_plugin(JsonbEq LogicalFunction nes-logical-operators JsonbEqLogicalFunction.cpp) +add_plugin(JsonbNe LogicalFunction nes-logical-operators JsonbNeLogicalFunction.cpp) +add_plugin(JsonbLt LogicalFunction nes-logical-operators JsonbLtLogicalFunction.cpp) +add_plugin(JsonbLe LogicalFunction nes-logical-operators JsonbLeLogicalFunction.cpp) +add_plugin(JsonbGt LogicalFunction nes-logical-operators JsonbGtLogicalFunction.cpp) +add_plugin(JsonbGe LogicalFunction nes-logical-operators JsonbGeLogicalFunction.cpp) +add_plugin(JsonbCmp LogicalFunction nes-logical-operators JsonbCmpLogicalFunction.cpp) +add_plugin(JsonbContains LogicalFunction nes-logical-operators JsonbContainsLogicalFunction.cpp) +add_plugin(JsonbContained LogicalFunction nes-logical-operators JsonbContainedLogicalFunction.cpp) +add_plugin(JsonbExists LogicalFunction nes-logical-operators JsonbExistsLogicalFunction.cpp) +add_plugin(JsonbToCstring LogicalFunction nes-logical-operators JsonbToCstringLogicalFunction.cpp) +add_plugin(JsonbPretty LogicalFunction nes-logical-operators JsonbPrettyLogicalFunction.cpp) +add_plugin(JsonbObjectFieldText LogicalFunction nes-logical-operators JsonbObjectFieldTextLogicalFunction.cpp) +add_plugin(JsonbArrayElementText LogicalFunction nes-logical-operators JsonbArrayElementTextLogicalFunction.cpp) add_plugin(GeomRelatePattern LogicalFunction nes-logical-operators GeomRelatePatternLogicalFunction.cpp) add_plugin(GeomIntersects2d LogicalFunction nes-logical-operators GeomIntersects2dLogicalFunction.cpp) add_plugin(GeomDwithin2d LogicalFunction nes-logical-operators GeomDwithin2dLogicalFunction.cpp) diff --git a/nes-logical-operators/src/Functions/Meos/JsonbArrayElementTextLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/JsonbArrayElementTextLogicalFunction.cpp new file mode 100644 index 0000000000..eeeb98206a --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/JsonbArrayElementTextLogicalFunction.cpp @@ -0,0 +1,75 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +JsonbArrayElementTextLogicalFunction::JsonbArrayElementTextLogicalFunction(LogicalFunction jb, LogicalFunction idx) + : dataType(DataTypeProvider::provideDataType(DataType::Type::VARSIZED)) +{ + parameters.reserve(2); + parameters.push_back(std::move(jb)); + parameters.push_back(std::move(idx)); +} +DataType JsonbArrayElementTextLogicalFunction::getDataType() const { return dataType; } +LogicalFunction JsonbArrayElementTextLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } +std::vector JsonbArrayElementTextLogicalFunction::getChildren() const { return parameters; } +LogicalFunction JsonbArrayElementTextLogicalFunction::withChildren(const std::vector& children) const { + PRECONDITION(children.size()==2,"JsonbArrayElementTextLogicalFunction requires 2 children, but got {}",children.size()); + auto c=*this; c.parameters=children; return c; +} +std::string_view JsonbArrayElementTextLogicalFunction::getType() const { return NAME; } +bool JsonbArrayElementTextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + return false; +} +std::string JsonbArrayElementTextLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("{}({})",NAME,parameters[0].explain(v)); +} +LogicalFunction JsonbArrayElementTextLogicalFunction::withInferredDataType(const Schema& schema) const { + std::vector c; c.reserve(2); + for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "jb must be VARSIZED"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "idx must be FLOAT64"); + return withChildren(c); +} +SerializableFunction JsonbArrayElementTextLogicalFunction::serialize() const { + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + return proto; +} +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterJsonbArrayElementTextLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size()==2, + "JsonbArrayElementTextLogicalFunction requires 2 children but got {}", + arguments.children.size()); + return JsonbArrayElementTextLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/JsonbArrayLengthLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/JsonbArrayLengthLogicalFunction.cpp new file mode 100644 index 0000000000..27818e1a0c --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/JsonbArrayLengthLogicalFunction.cpp @@ -0,0 +1,72 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +JsonbArrayLengthLogicalFunction::JsonbArrayLengthLogicalFunction(LogicalFunction jb) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(1); + parameters.push_back(std::move(jb)); +} +DataType JsonbArrayLengthLogicalFunction::getDataType() const { return dataType; } +LogicalFunction JsonbArrayLengthLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } +std::vector JsonbArrayLengthLogicalFunction::getChildren() const { return parameters; } +LogicalFunction JsonbArrayLengthLogicalFunction::withChildren(const std::vector& children) const { + PRECONDITION(children.size()==1,"JsonbArrayLengthLogicalFunction requires 1 children, but got {}",children.size()); + auto c=*this; c.parameters=children; return c; +} +std::string_view JsonbArrayLengthLogicalFunction::getType() const { return NAME; } +bool JsonbArrayLengthLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + return false; +} +std::string JsonbArrayLengthLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("{}({})",NAME,parameters[0].explain(v)); +} +LogicalFunction JsonbArrayLengthLogicalFunction::withInferredDataType(const Schema& schema) const { + std::vector c; c.reserve(1); + for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "jb must be VARSIZED"); + return withChildren(c); +} +SerializableFunction JsonbArrayLengthLogicalFunction::serialize() const { + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + return proto; +} +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterJsonbArrayLengthLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size()==1, + "JsonbArrayLengthLogicalFunction requires 1 children but got {}", + arguments.children.size()); + return JsonbArrayLengthLogicalFunction( + std::move(arguments.children[0])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/JsonbCmpLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/JsonbCmpLogicalFunction.cpp new file mode 100644 index 0000000000..5d9bb95672 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/JsonbCmpLogicalFunction.cpp @@ -0,0 +1,75 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +JsonbCmpLogicalFunction::JsonbCmpLogicalFunction(LogicalFunction jb1, LogicalFunction jb2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(2); + parameters.push_back(std::move(jb1)); + parameters.push_back(std::move(jb2)); +} +DataType JsonbCmpLogicalFunction::getDataType() const { return dataType; } +LogicalFunction JsonbCmpLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } +std::vector JsonbCmpLogicalFunction::getChildren() const { return parameters; } +LogicalFunction JsonbCmpLogicalFunction::withChildren(const std::vector& children) const { + PRECONDITION(children.size()==2,"JsonbCmpLogicalFunction requires 2 children, but got {}",children.size()); + auto c=*this; c.parameters=children; return c; +} +std::string_view JsonbCmpLogicalFunction::getType() const { return NAME; } +bool JsonbCmpLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + return false; +} +std::string JsonbCmpLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("{}({})",NAME,parameters[0].explain(v)); +} +LogicalFunction JsonbCmpLogicalFunction::withInferredDataType(const Schema& schema) const { + std::vector c; c.reserve(2); + for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "jb1 must be VARSIZED"); + INVARIANT(c[1].getDataType().isType(DataType::Type::VARSIZED), "jb2 must be VARSIZED"); + return withChildren(c); +} +SerializableFunction JsonbCmpLogicalFunction::serialize() const { + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + return proto; +} +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterJsonbCmpLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size()==2, + "JsonbCmpLogicalFunction requires 2 children but got {}", + arguments.children.size()); + return JsonbCmpLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/JsonbContainedLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/JsonbContainedLogicalFunction.cpp new file mode 100644 index 0000000000..98e208008c --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/JsonbContainedLogicalFunction.cpp @@ -0,0 +1,75 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +JsonbContainedLogicalFunction::JsonbContainedLogicalFunction(LogicalFunction jb1, LogicalFunction jb2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(2); + parameters.push_back(std::move(jb1)); + parameters.push_back(std::move(jb2)); +} +DataType JsonbContainedLogicalFunction::getDataType() const { return dataType; } +LogicalFunction JsonbContainedLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } +std::vector JsonbContainedLogicalFunction::getChildren() const { return parameters; } +LogicalFunction JsonbContainedLogicalFunction::withChildren(const std::vector& children) const { + PRECONDITION(children.size()==2,"JsonbContainedLogicalFunction requires 2 children, but got {}",children.size()); + auto c=*this; c.parameters=children; return c; +} +std::string_view JsonbContainedLogicalFunction::getType() const { return NAME; } +bool JsonbContainedLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + return false; +} +std::string JsonbContainedLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("{}({})",NAME,parameters[0].explain(v)); +} +LogicalFunction JsonbContainedLogicalFunction::withInferredDataType(const Schema& schema) const { + std::vector c; c.reserve(2); + for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "jb1 must be VARSIZED"); + INVARIANT(c[1].getDataType().isType(DataType::Type::VARSIZED), "jb2 must be VARSIZED"); + return withChildren(c); +} +SerializableFunction JsonbContainedLogicalFunction::serialize() const { + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + return proto; +} +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterJsonbContainedLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size()==2, + "JsonbContainedLogicalFunction requires 2 children but got {}", + arguments.children.size()); + return JsonbContainedLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/JsonbContainsLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/JsonbContainsLogicalFunction.cpp new file mode 100644 index 0000000000..2a265fdf7a --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/JsonbContainsLogicalFunction.cpp @@ -0,0 +1,75 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +JsonbContainsLogicalFunction::JsonbContainsLogicalFunction(LogicalFunction jb1, LogicalFunction jb2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(2); + parameters.push_back(std::move(jb1)); + parameters.push_back(std::move(jb2)); +} +DataType JsonbContainsLogicalFunction::getDataType() const { return dataType; } +LogicalFunction JsonbContainsLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } +std::vector JsonbContainsLogicalFunction::getChildren() const { return parameters; } +LogicalFunction JsonbContainsLogicalFunction::withChildren(const std::vector& children) const { + PRECONDITION(children.size()==2,"JsonbContainsLogicalFunction requires 2 children, but got {}",children.size()); + auto c=*this; c.parameters=children; return c; +} +std::string_view JsonbContainsLogicalFunction::getType() const { return NAME; } +bool JsonbContainsLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + return false; +} +std::string JsonbContainsLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("{}({})",NAME,parameters[0].explain(v)); +} +LogicalFunction JsonbContainsLogicalFunction::withInferredDataType(const Schema& schema) const { + std::vector c; c.reserve(2); + for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "jb1 must be VARSIZED"); + INVARIANT(c[1].getDataType().isType(DataType::Type::VARSIZED), "jb2 must be VARSIZED"); + return withChildren(c); +} +SerializableFunction JsonbContainsLogicalFunction::serialize() const { + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + return proto; +} +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterJsonbContainsLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size()==2, + "JsonbContainsLogicalFunction requires 2 children but got {}", + arguments.children.size()); + return JsonbContainsLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/JsonbEqLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/JsonbEqLogicalFunction.cpp new file mode 100644 index 0000000000..78c704a6c3 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/JsonbEqLogicalFunction.cpp @@ -0,0 +1,75 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +JsonbEqLogicalFunction::JsonbEqLogicalFunction(LogicalFunction jb1, LogicalFunction jb2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(2); + parameters.push_back(std::move(jb1)); + parameters.push_back(std::move(jb2)); +} +DataType JsonbEqLogicalFunction::getDataType() const { return dataType; } +LogicalFunction JsonbEqLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } +std::vector JsonbEqLogicalFunction::getChildren() const { return parameters; } +LogicalFunction JsonbEqLogicalFunction::withChildren(const std::vector& children) const { + PRECONDITION(children.size()==2,"JsonbEqLogicalFunction requires 2 children, but got {}",children.size()); + auto c=*this; c.parameters=children; return c; +} +std::string_view JsonbEqLogicalFunction::getType() const { return NAME; } +bool JsonbEqLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + return false; +} +std::string JsonbEqLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("{}({})",NAME,parameters[0].explain(v)); +} +LogicalFunction JsonbEqLogicalFunction::withInferredDataType(const Schema& schema) const { + std::vector c; c.reserve(2); + for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "jb1 must be VARSIZED"); + INVARIANT(c[1].getDataType().isType(DataType::Type::VARSIZED), "jb2 must be VARSIZED"); + return withChildren(c); +} +SerializableFunction JsonbEqLogicalFunction::serialize() const { + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + return proto; +} +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterJsonbEqLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size()==2, + "JsonbEqLogicalFunction requires 2 children but got {}", + arguments.children.size()); + return JsonbEqLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/JsonbExistsLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/JsonbExistsLogicalFunction.cpp new file mode 100644 index 0000000000..bd9e490b85 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/JsonbExistsLogicalFunction.cpp @@ -0,0 +1,75 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +JsonbExistsLogicalFunction::JsonbExistsLogicalFunction(LogicalFunction jb, LogicalFunction key) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(2); + parameters.push_back(std::move(jb)); + parameters.push_back(std::move(key)); +} +DataType JsonbExistsLogicalFunction::getDataType() const { return dataType; } +LogicalFunction JsonbExistsLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } +std::vector JsonbExistsLogicalFunction::getChildren() const { return parameters; } +LogicalFunction JsonbExistsLogicalFunction::withChildren(const std::vector& children) const { + PRECONDITION(children.size()==2,"JsonbExistsLogicalFunction requires 2 children, but got {}",children.size()); + auto c=*this; c.parameters=children; return c; +} +std::string_view JsonbExistsLogicalFunction::getType() const { return NAME; } +bool JsonbExistsLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + return false; +} +std::string JsonbExistsLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("{}({})",NAME,parameters[0].explain(v)); +} +LogicalFunction JsonbExistsLogicalFunction::withInferredDataType(const Schema& schema) const { + std::vector c; c.reserve(2); + for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "jb must be VARSIZED"); + INVARIANT(c[1].getDataType().isType(DataType::Type::VARSIZED), "key must be VARSIZED"); + return withChildren(c); +} +SerializableFunction JsonbExistsLogicalFunction::serialize() const { + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + return proto; +} +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterJsonbExistsLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size()==2, + "JsonbExistsLogicalFunction requires 2 children but got {}", + arguments.children.size()); + return JsonbExistsLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/JsonbGeLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/JsonbGeLogicalFunction.cpp new file mode 100644 index 0000000000..b2c1034589 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/JsonbGeLogicalFunction.cpp @@ -0,0 +1,75 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +JsonbGeLogicalFunction::JsonbGeLogicalFunction(LogicalFunction jb1, LogicalFunction jb2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(2); + parameters.push_back(std::move(jb1)); + parameters.push_back(std::move(jb2)); +} +DataType JsonbGeLogicalFunction::getDataType() const { return dataType; } +LogicalFunction JsonbGeLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } +std::vector JsonbGeLogicalFunction::getChildren() const { return parameters; } +LogicalFunction JsonbGeLogicalFunction::withChildren(const std::vector& children) const { + PRECONDITION(children.size()==2,"JsonbGeLogicalFunction requires 2 children, but got {}",children.size()); + auto c=*this; c.parameters=children; return c; +} +std::string_view JsonbGeLogicalFunction::getType() const { return NAME; } +bool JsonbGeLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + return false; +} +std::string JsonbGeLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("{}({})",NAME,parameters[0].explain(v)); +} +LogicalFunction JsonbGeLogicalFunction::withInferredDataType(const Schema& schema) const { + std::vector c; c.reserve(2); + for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "jb1 must be VARSIZED"); + INVARIANT(c[1].getDataType().isType(DataType::Type::VARSIZED), "jb2 must be VARSIZED"); + return withChildren(c); +} +SerializableFunction JsonbGeLogicalFunction::serialize() const { + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + return proto; +} +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterJsonbGeLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size()==2, + "JsonbGeLogicalFunction requires 2 children but got {}", + arguments.children.size()); + return JsonbGeLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/JsonbGtLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/JsonbGtLogicalFunction.cpp new file mode 100644 index 0000000000..62fe716b3e --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/JsonbGtLogicalFunction.cpp @@ -0,0 +1,75 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +JsonbGtLogicalFunction::JsonbGtLogicalFunction(LogicalFunction jb1, LogicalFunction jb2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(2); + parameters.push_back(std::move(jb1)); + parameters.push_back(std::move(jb2)); +} +DataType JsonbGtLogicalFunction::getDataType() const { return dataType; } +LogicalFunction JsonbGtLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } +std::vector JsonbGtLogicalFunction::getChildren() const { return parameters; } +LogicalFunction JsonbGtLogicalFunction::withChildren(const std::vector& children) const { + PRECONDITION(children.size()==2,"JsonbGtLogicalFunction requires 2 children, but got {}",children.size()); + auto c=*this; c.parameters=children; return c; +} +std::string_view JsonbGtLogicalFunction::getType() const { return NAME; } +bool JsonbGtLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + return false; +} +std::string JsonbGtLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("{}({})",NAME,parameters[0].explain(v)); +} +LogicalFunction JsonbGtLogicalFunction::withInferredDataType(const Schema& schema) const { + std::vector c; c.reserve(2); + for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "jb1 must be VARSIZED"); + INVARIANT(c[1].getDataType().isType(DataType::Type::VARSIZED), "jb2 must be VARSIZED"); + return withChildren(c); +} +SerializableFunction JsonbGtLogicalFunction::serialize() const { + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + return proto; +} +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterJsonbGtLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size()==2, + "JsonbGtLogicalFunction requires 2 children but got {}", + arguments.children.size()); + return JsonbGtLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/JsonbLeLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/JsonbLeLogicalFunction.cpp new file mode 100644 index 0000000000..0eade1d471 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/JsonbLeLogicalFunction.cpp @@ -0,0 +1,75 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +JsonbLeLogicalFunction::JsonbLeLogicalFunction(LogicalFunction jb1, LogicalFunction jb2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(2); + parameters.push_back(std::move(jb1)); + parameters.push_back(std::move(jb2)); +} +DataType JsonbLeLogicalFunction::getDataType() const { return dataType; } +LogicalFunction JsonbLeLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } +std::vector JsonbLeLogicalFunction::getChildren() const { return parameters; } +LogicalFunction JsonbLeLogicalFunction::withChildren(const std::vector& children) const { + PRECONDITION(children.size()==2,"JsonbLeLogicalFunction requires 2 children, but got {}",children.size()); + auto c=*this; c.parameters=children; return c; +} +std::string_view JsonbLeLogicalFunction::getType() const { return NAME; } +bool JsonbLeLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + return false; +} +std::string JsonbLeLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("{}({})",NAME,parameters[0].explain(v)); +} +LogicalFunction JsonbLeLogicalFunction::withInferredDataType(const Schema& schema) const { + std::vector c; c.reserve(2); + for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "jb1 must be VARSIZED"); + INVARIANT(c[1].getDataType().isType(DataType::Type::VARSIZED), "jb2 must be VARSIZED"); + return withChildren(c); +} +SerializableFunction JsonbLeLogicalFunction::serialize() const { + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + return proto; +} +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterJsonbLeLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size()==2, + "JsonbLeLogicalFunction requires 2 children but got {}", + arguments.children.size()); + return JsonbLeLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/JsonbLtLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/JsonbLtLogicalFunction.cpp new file mode 100644 index 0000000000..6d3d008e2f --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/JsonbLtLogicalFunction.cpp @@ -0,0 +1,75 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +JsonbLtLogicalFunction::JsonbLtLogicalFunction(LogicalFunction jb1, LogicalFunction jb2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(2); + parameters.push_back(std::move(jb1)); + parameters.push_back(std::move(jb2)); +} +DataType JsonbLtLogicalFunction::getDataType() const { return dataType; } +LogicalFunction JsonbLtLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } +std::vector JsonbLtLogicalFunction::getChildren() const { return parameters; } +LogicalFunction JsonbLtLogicalFunction::withChildren(const std::vector& children) const { + PRECONDITION(children.size()==2,"JsonbLtLogicalFunction requires 2 children, but got {}",children.size()); + auto c=*this; c.parameters=children; return c; +} +std::string_view JsonbLtLogicalFunction::getType() const { return NAME; } +bool JsonbLtLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + return false; +} +std::string JsonbLtLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("{}({})",NAME,parameters[0].explain(v)); +} +LogicalFunction JsonbLtLogicalFunction::withInferredDataType(const Schema& schema) const { + std::vector c; c.reserve(2); + for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "jb1 must be VARSIZED"); + INVARIANT(c[1].getDataType().isType(DataType::Type::VARSIZED), "jb2 must be VARSIZED"); + return withChildren(c); +} +SerializableFunction JsonbLtLogicalFunction::serialize() const { + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + return proto; +} +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterJsonbLtLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size()==2, + "JsonbLtLogicalFunction requires 2 children but got {}", + arguments.children.size()); + return JsonbLtLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/JsonbNeLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/JsonbNeLogicalFunction.cpp new file mode 100644 index 0000000000..3cf57efd86 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/JsonbNeLogicalFunction.cpp @@ -0,0 +1,75 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +JsonbNeLogicalFunction::JsonbNeLogicalFunction(LogicalFunction jb1, LogicalFunction jb2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(2); + parameters.push_back(std::move(jb1)); + parameters.push_back(std::move(jb2)); +} +DataType JsonbNeLogicalFunction::getDataType() const { return dataType; } +LogicalFunction JsonbNeLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } +std::vector JsonbNeLogicalFunction::getChildren() const { return parameters; } +LogicalFunction JsonbNeLogicalFunction::withChildren(const std::vector& children) const { + PRECONDITION(children.size()==2,"JsonbNeLogicalFunction requires 2 children, but got {}",children.size()); + auto c=*this; c.parameters=children; return c; +} +std::string_view JsonbNeLogicalFunction::getType() const { return NAME; } +bool JsonbNeLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + return false; +} +std::string JsonbNeLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("{}({})",NAME,parameters[0].explain(v)); +} +LogicalFunction JsonbNeLogicalFunction::withInferredDataType(const Schema& schema) const { + std::vector c; c.reserve(2); + for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "jb1 must be VARSIZED"); + INVARIANT(c[1].getDataType().isType(DataType::Type::VARSIZED), "jb2 must be VARSIZED"); + return withChildren(c); +} +SerializableFunction JsonbNeLogicalFunction::serialize() const { + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + return proto; +} +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterJsonbNeLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size()==2, + "JsonbNeLogicalFunction requires 2 children but got {}", + arguments.children.size()); + return JsonbNeLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/JsonbObjectFieldTextLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/JsonbObjectFieldTextLogicalFunction.cpp new file mode 100644 index 0000000000..bf42574906 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/JsonbObjectFieldTextLogicalFunction.cpp @@ -0,0 +1,75 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +JsonbObjectFieldTextLogicalFunction::JsonbObjectFieldTextLogicalFunction(LogicalFunction jb, LogicalFunction key) + : dataType(DataTypeProvider::provideDataType(DataType::Type::VARSIZED)) +{ + parameters.reserve(2); + parameters.push_back(std::move(jb)); + parameters.push_back(std::move(key)); +} +DataType JsonbObjectFieldTextLogicalFunction::getDataType() const { return dataType; } +LogicalFunction JsonbObjectFieldTextLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } +std::vector JsonbObjectFieldTextLogicalFunction::getChildren() const { return parameters; } +LogicalFunction JsonbObjectFieldTextLogicalFunction::withChildren(const std::vector& children) const { + PRECONDITION(children.size()==2,"JsonbObjectFieldTextLogicalFunction requires 2 children, but got {}",children.size()); + auto c=*this; c.parameters=children; return c; +} +std::string_view JsonbObjectFieldTextLogicalFunction::getType() const { return NAME; } +bool JsonbObjectFieldTextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + return false; +} +std::string JsonbObjectFieldTextLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("{}({})",NAME,parameters[0].explain(v)); +} +LogicalFunction JsonbObjectFieldTextLogicalFunction::withInferredDataType(const Schema& schema) const { + std::vector c; c.reserve(2); + for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "jb must be VARSIZED"); + INVARIANT(c[1].getDataType().isType(DataType::Type::VARSIZED), "key must be VARSIZED"); + return withChildren(c); +} +SerializableFunction JsonbObjectFieldTextLogicalFunction::serialize() const { + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + return proto; +} +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterJsonbObjectFieldTextLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size()==2, + "JsonbObjectFieldTextLogicalFunction requires 2 children but got {}", + arguments.children.size()); + return JsonbObjectFieldTextLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/JsonbPrettyLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/JsonbPrettyLogicalFunction.cpp new file mode 100644 index 0000000000..2c975d3cf3 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/JsonbPrettyLogicalFunction.cpp @@ -0,0 +1,72 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +JsonbPrettyLogicalFunction::JsonbPrettyLogicalFunction(LogicalFunction jb) + : dataType(DataTypeProvider::provideDataType(DataType::Type::VARSIZED)) +{ + parameters.reserve(1); + parameters.push_back(std::move(jb)); +} +DataType JsonbPrettyLogicalFunction::getDataType() const { return dataType; } +LogicalFunction JsonbPrettyLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } +std::vector JsonbPrettyLogicalFunction::getChildren() const { return parameters; } +LogicalFunction JsonbPrettyLogicalFunction::withChildren(const std::vector& children) const { + PRECONDITION(children.size()==1,"JsonbPrettyLogicalFunction requires 1 children, but got {}",children.size()); + auto c=*this; c.parameters=children; return c; +} +std::string_view JsonbPrettyLogicalFunction::getType() const { return NAME; } +bool JsonbPrettyLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + return false; +} +std::string JsonbPrettyLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("{}({})",NAME,parameters[0].explain(v)); +} +LogicalFunction JsonbPrettyLogicalFunction::withInferredDataType(const Schema& schema) const { + std::vector c; c.reserve(1); + for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "jb must be VARSIZED"); + return withChildren(c); +} +SerializableFunction JsonbPrettyLogicalFunction::serialize() const { + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + return proto; +} +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterJsonbPrettyLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size()==1, + "JsonbPrettyLogicalFunction requires 1 children but got {}", + arguments.children.size()); + return JsonbPrettyLogicalFunction( + std::move(arguments.children[0])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/JsonbToCstringLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/JsonbToCstringLogicalFunction.cpp new file mode 100644 index 0000000000..0e4d672bc4 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/JsonbToCstringLogicalFunction.cpp @@ -0,0 +1,72 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +JsonbToCstringLogicalFunction::JsonbToCstringLogicalFunction(LogicalFunction jb) + : dataType(DataTypeProvider::provideDataType(DataType::Type::VARSIZED)) +{ + parameters.reserve(1); + parameters.push_back(std::move(jb)); +} +DataType JsonbToCstringLogicalFunction::getDataType() const { return dataType; } +LogicalFunction JsonbToCstringLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } +std::vector JsonbToCstringLogicalFunction::getChildren() const { return parameters; } +LogicalFunction JsonbToCstringLogicalFunction::withChildren(const std::vector& children) const { + PRECONDITION(children.size()==1,"JsonbToCstringLogicalFunction requires 1 children, but got {}",children.size()); + auto c=*this; c.parameters=children; return c; +} +std::string_view JsonbToCstringLogicalFunction::getType() const { return NAME; } +bool JsonbToCstringLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + return false; +} +std::string JsonbToCstringLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("{}({})",NAME,parameters[0].explain(v)); +} +LogicalFunction JsonbToCstringLogicalFunction::withInferredDataType(const Schema& schema) const { + std::vector c; c.reserve(1); + for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "jb must be VARSIZED"); + return withChildren(c); +} +SerializableFunction JsonbToCstringLogicalFunction::serialize() const { + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + return proto; +} +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterJsonbToCstringLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size()==1, + "JsonbToCstringLogicalFunction requires 1 children but got {}", + arguments.children.size()); + return JsonbToCstringLogicalFunction( + std::move(arguments.children[0])); +} + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/JsonbArrayElementTextPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/JsonbArrayElementTextPhysicalFunction.hpp new file mode 100644 index 0000000000..e52d066842 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/JsonbArrayElementTextPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class JsonbArrayElementTextPhysicalFunction : public PhysicalFunctionConcept { +public: + JsonbArrayElementTextPhysicalFunction(PhysicalFunction jb, PhysicalFunction idx); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/JsonbArrayLengthPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/JsonbArrayLengthPhysicalFunction.hpp new file mode 100644 index 0000000000..ba933c81dc --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/JsonbArrayLengthPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class JsonbArrayLengthPhysicalFunction : public PhysicalFunctionConcept { +public: + JsonbArrayLengthPhysicalFunction(PhysicalFunction jb); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/JsonbCmpPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/JsonbCmpPhysicalFunction.hpp new file mode 100644 index 0000000000..e6731320ad --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/JsonbCmpPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class JsonbCmpPhysicalFunction : public PhysicalFunctionConcept { +public: + JsonbCmpPhysicalFunction(PhysicalFunction jb1, PhysicalFunction jb2); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/JsonbContainedPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/JsonbContainedPhysicalFunction.hpp new file mode 100644 index 0000000000..dd8f0762ce --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/JsonbContainedPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class JsonbContainedPhysicalFunction : public PhysicalFunctionConcept { +public: + JsonbContainedPhysicalFunction(PhysicalFunction jb1, PhysicalFunction jb2); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/JsonbContainsPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/JsonbContainsPhysicalFunction.hpp new file mode 100644 index 0000000000..720ee36c32 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/JsonbContainsPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class JsonbContainsPhysicalFunction : public PhysicalFunctionConcept { +public: + JsonbContainsPhysicalFunction(PhysicalFunction jb1, PhysicalFunction jb2); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/JsonbEqPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/JsonbEqPhysicalFunction.hpp new file mode 100644 index 0000000000..1dd185496c --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/JsonbEqPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class JsonbEqPhysicalFunction : public PhysicalFunctionConcept { +public: + JsonbEqPhysicalFunction(PhysicalFunction jb1, PhysicalFunction jb2); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/JsonbExistsPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/JsonbExistsPhysicalFunction.hpp new file mode 100644 index 0000000000..51f35b38c2 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/JsonbExistsPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class JsonbExistsPhysicalFunction : public PhysicalFunctionConcept { +public: + JsonbExistsPhysicalFunction(PhysicalFunction jb, PhysicalFunction key); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/JsonbGePhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/JsonbGePhysicalFunction.hpp new file mode 100644 index 0000000000..d9176132ab --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/JsonbGePhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class JsonbGePhysicalFunction : public PhysicalFunctionConcept { +public: + JsonbGePhysicalFunction(PhysicalFunction jb1, PhysicalFunction jb2); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/JsonbGtPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/JsonbGtPhysicalFunction.hpp new file mode 100644 index 0000000000..4767a426be --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/JsonbGtPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class JsonbGtPhysicalFunction : public PhysicalFunctionConcept { +public: + JsonbGtPhysicalFunction(PhysicalFunction jb1, PhysicalFunction jb2); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/JsonbLePhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/JsonbLePhysicalFunction.hpp new file mode 100644 index 0000000000..6626c9e9af --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/JsonbLePhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class JsonbLePhysicalFunction : public PhysicalFunctionConcept { +public: + JsonbLePhysicalFunction(PhysicalFunction jb1, PhysicalFunction jb2); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/JsonbLtPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/JsonbLtPhysicalFunction.hpp new file mode 100644 index 0000000000..2afc6a3929 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/JsonbLtPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class JsonbLtPhysicalFunction : public PhysicalFunctionConcept { +public: + JsonbLtPhysicalFunction(PhysicalFunction jb1, PhysicalFunction jb2); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/JsonbNePhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/JsonbNePhysicalFunction.hpp new file mode 100644 index 0000000000..fc3447db4f --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/JsonbNePhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class JsonbNePhysicalFunction : public PhysicalFunctionConcept { +public: + JsonbNePhysicalFunction(PhysicalFunction jb1, PhysicalFunction jb2); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/JsonbObjectFieldTextPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/JsonbObjectFieldTextPhysicalFunction.hpp new file mode 100644 index 0000000000..d8102c91dc --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/JsonbObjectFieldTextPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class JsonbObjectFieldTextPhysicalFunction : public PhysicalFunctionConcept { +public: + JsonbObjectFieldTextPhysicalFunction(PhysicalFunction jb, PhysicalFunction key); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/JsonbPrettyPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/JsonbPrettyPhysicalFunction.hpp new file mode 100644 index 0000000000..5a2ff0e542 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/JsonbPrettyPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class JsonbPrettyPhysicalFunction : public PhysicalFunctionConcept { +public: + JsonbPrettyPhysicalFunction(PhysicalFunction jb); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/JsonbToCstringPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/JsonbToCstringPhysicalFunction.hpp new file mode 100644 index 0000000000..f05366a0d1 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/JsonbToCstringPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class JsonbToCstringPhysicalFunction : public PhysicalFunctionConcept { +public: + JsonbToCstringPhysicalFunction(PhysicalFunction jb); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt index a1fecf217f..4adaa30ffb 100644 --- a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt @@ -505,6 +505,21 @@ add_plugin(JsonArrayLength PhysicalFunction nes-physical-operators JsonArrayLeng add_plugin(JsonTypeof PhysicalFunction nes-physical-operators JsonTypeofPhysicalFunction.cpp) add_plugin(JsonObjectFieldText PhysicalFunction nes-physical-operators JsonObjectFieldTextPhysicalFunction.cpp) add_plugin(JsonArrayElementText PhysicalFunction nes-physical-operators JsonArrayElementTextPhysicalFunction.cpp) +add_plugin(JsonbArrayLength PhysicalFunction nes-physical-operators JsonbArrayLengthPhysicalFunction.cpp) +add_plugin(JsonbEq PhysicalFunction nes-physical-operators JsonbEqPhysicalFunction.cpp) +add_plugin(JsonbNe PhysicalFunction nes-physical-operators JsonbNePhysicalFunction.cpp) +add_plugin(JsonbLt PhysicalFunction nes-physical-operators JsonbLtPhysicalFunction.cpp) +add_plugin(JsonbLe PhysicalFunction nes-physical-operators JsonbLePhysicalFunction.cpp) +add_plugin(JsonbGt PhysicalFunction nes-physical-operators JsonbGtPhysicalFunction.cpp) +add_plugin(JsonbGe PhysicalFunction nes-physical-operators JsonbGePhysicalFunction.cpp) +add_plugin(JsonbCmp PhysicalFunction nes-physical-operators JsonbCmpPhysicalFunction.cpp) +add_plugin(JsonbContains PhysicalFunction nes-physical-operators JsonbContainsPhysicalFunction.cpp) +add_plugin(JsonbContained PhysicalFunction nes-physical-operators JsonbContainedPhysicalFunction.cpp) +add_plugin(JsonbExists PhysicalFunction nes-physical-operators JsonbExistsPhysicalFunction.cpp) +add_plugin(JsonbToCstring PhysicalFunction nes-physical-operators JsonbToCstringPhysicalFunction.cpp) +add_plugin(JsonbPretty PhysicalFunction nes-physical-operators JsonbPrettyPhysicalFunction.cpp) +add_plugin(JsonbObjectFieldText PhysicalFunction nes-physical-operators JsonbObjectFieldTextPhysicalFunction.cpp) +add_plugin(JsonbArrayElementText PhysicalFunction nes-physical-operators JsonbArrayElementTextPhysicalFunction.cpp) add_plugin(GeomRelatePattern PhysicalFunction nes-physical-operators GeomRelatePatternPhysicalFunction.cpp) add_plugin(GeomIntersects2d PhysicalFunction nes-physical-operators GeomIntersects2dPhysicalFunction.cpp) add_plugin(GeomDwithin2d PhysicalFunction nes-physical-operators GeomDwithin2dPhysicalFunction.cpp) diff --git a/nes-physical-operators/src/Functions/Meos/JsonbArrayElementTextPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/JsonbArrayElementTextPhysicalFunction.cpp new file mode 100644 index 0000000000..d8d985a96c --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/JsonbArrayElementTextPhysicalFunction.cpp @@ -0,0 +1,85 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} +#include +#include + +namespace NES { + +JsonbArrayElementTextPhysicalFunction::JsonbArrayElementTextPhysicalFunction(PhysicalFunction jb, PhysicalFunction idx) { + paramFns.reserve(2); + paramFns.push_back(std::move(jb)); + paramFns.push_back(std::move(idx)); +} + +VarVal JsonbArrayElementTextPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { + auto jb = paramFns[0].execute(record, arena).cast(); + auto idx = paramFns[1].execute(record, arena).cast(); + constexpr uint32_t MAX_LEN = 4096; + auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); + const auto actualLen = nautilus::invoke( + +[](const char* w, uint32_t wsz, double idx_d, + char* buf, uint32_t bufMax) -> uint32_t { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string s(w, wsz); + Jsonb* jb = jsonb_in(s.c_str()); + if (!jb) return 0u; + text* res = jsonb_array_element_text(jb, (int)idx_d); + free(jb); + if (!res) return 0u; + char* out = text_to_cstring(res); + free(res); + if (!out) return 0u; + uint32_t len = static_cast(strlen(out)); + if (len > bufMax) len = bufMax; + memcpy(buf, out, len); + free(out); + return len; + } catch (const std::exception&) { return 0u; } + }, + jb, idx, outBuf.getContent(), nautilus::val(MAX_LEN)); + VarVal(actualLen).writeToMemory(outBuf.getReference()); + return outBuf; +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterJsonbArrayElementTextPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size()==2, + "JsonbArrayElementTextPhysicalFunction requires 2 children but got {}", + arguments.childFunctions.size()); + return JsonbArrayElementTextPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/JsonbArrayLengthPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/JsonbArrayLengthPhysicalFunction.cpp new file mode 100644 index 0000000000..96316e05a9 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/JsonbArrayLengthPhysicalFunction.cpp @@ -0,0 +1,70 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} +#include +#include + +namespace NES { + +JsonbArrayLengthPhysicalFunction::JsonbArrayLengthPhysicalFunction(PhysicalFunction jb) { + paramFns.reserve(1); + paramFns.push_back(std::move(jb)); +} + +VarVal JsonbArrayLengthPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { + auto jb = paramFns[0].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](const char* w, uint32_t wsz) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string s(w, wsz); + Jsonb* jb = jsonb_in(s.c_str()); + if (!jb) return 0.0; + int r = jsonb_array_length(jb); + free(jb); + return (double)r; + } catch (const std::exception&) { return 0.0; } + }, + jb); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterJsonbArrayLengthPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size()==1, + "JsonbArrayLengthPhysicalFunction requires 1 children but got {}", + arguments.childFunctions.size()); + return JsonbArrayLengthPhysicalFunction( + std::move(arguments.childFunctions[0])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/JsonbCmpPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/JsonbCmpPhysicalFunction.cpp new file mode 100644 index 0000000000..4c4a40666b --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/JsonbCmpPhysicalFunction.cpp @@ -0,0 +1,75 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} +#include +#include + +namespace NES { + +JsonbCmpPhysicalFunction::JsonbCmpPhysicalFunction(PhysicalFunction jb1, PhysicalFunction jb2) { + paramFns.reserve(2); + paramFns.push_back(std::move(jb1)); + paramFns.push_back(std::move(jb2)); +} + +VarVal JsonbCmpPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { + auto jb1 = paramFns[0].execute(record, arena).cast(); + auto jb2 = paramFns[1].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](const char* w1, uint32_t w1sz, const char* w2, uint32_t w2sz) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string s1(w1,w1sz), s2(w2,w2sz); + Jsonb* jb1 = jsonb_in(s1.c_str()); + if (!jb1) return 0.0; + Jsonb* jb2 = jsonb_in(s2.c_str()); + if (!jb2) { free(jb1); return 0.0; } + double r = (double)jsonb_cmp(jb1, jb2); + free(jb1); free(jb2); + return r; + } catch (const std::exception&) { return 0.0; } + }, + jb1, jb2); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterJsonbCmpPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size()==2, + "JsonbCmpPhysicalFunction requires 2 children but got {}", + arguments.childFunctions.size()); + return JsonbCmpPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/JsonbContainedPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/JsonbContainedPhysicalFunction.cpp new file mode 100644 index 0000000000..c2e4453730 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/JsonbContainedPhysicalFunction.cpp @@ -0,0 +1,75 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} +#include +#include + +namespace NES { + +JsonbContainedPhysicalFunction::JsonbContainedPhysicalFunction(PhysicalFunction jb1, PhysicalFunction jb2) { + paramFns.reserve(2); + paramFns.push_back(std::move(jb1)); + paramFns.push_back(std::move(jb2)); +} + +VarVal JsonbContainedPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { + auto jb1 = paramFns[0].execute(record, arena).cast(); + auto jb2 = paramFns[1].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](const char* w1, uint32_t w1sz, const char* w2, uint32_t w2sz) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string s1(w1,w1sz), s2(w2,w2sz); + Jsonb* jb1 = jsonb_in(s1.c_str()); + if (!jb1) return 0.0; + Jsonb* jb2 = jsonb_in(s2.c_str()); + if (!jb2) { free(jb1); return 0.0; } + bool r = jsonb_contained(jb1, jb2); + free(jb1); free(jb2); + return r ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + jb1, jb2); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterJsonbContainedPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size()==2, + "JsonbContainedPhysicalFunction requires 2 children but got {}", + arguments.childFunctions.size()); + return JsonbContainedPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/JsonbContainsPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/JsonbContainsPhysicalFunction.cpp new file mode 100644 index 0000000000..fde9b098c8 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/JsonbContainsPhysicalFunction.cpp @@ -0,0 +1,75 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} +#include +#include + +namespace NES { + +JsonbContainsPhysicalFunction::JsonbContainsPhysicalFunction(PhysicalFunction jb1, PhysicalFunction jb2) { + paramFns.reserve(2); + paramFns.push_back(std::move(jb1)); + paramFns.push_back(std::move(jb2)); +} + +VarVal JsonbContainsPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { + auto jb1 = paramFns[0].execute(record, arena).cast(); + auto jb2 = paramFns[1].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](const char* w1, uint32_t w1sz, const char* w2, uint32_t w2sz) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string s1(w1,w1sz), s2(w2,w2sz); + Jsonb* jb1 = jsonb_in(s1.c_str()); + if (!jb1) return 0.0; + Jsonb* jb2 = jsonb_in(s2.c_str()); + if (!jb2) { free(jb1); return 0.0; } + bool r = jsonb_contains(jb1, jb2); + free(jb1); free(jb2); + return r ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + jb1, jb2); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterJsonbContainsPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size()==2, + "JsonbContainsPhysicalFunction requires 2 children but got {}", + arguments.childFunctions.size()); + return JsonbContainsPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/JsonbEqPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/JsonbEqPhysicalFunction.cpp new file mode 100644 index 0000000000..9deb0b0086 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/JsonbEqPhysicalFunction.cpp @@ -0,0 +1,75 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} +#include +#include + +namespace NES { + +JsonbEqPhysicalFunction::JsonbEqPhysicalFunction(PhysicalFunction jb1, PhysicalFunction jb2) { + paramFns.reserve(2); + paramFns.push_back(std::move(jb1)); + paramFns.push_back(std::move(jb2)); +} + +VarVal JsonbEqPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { + auto jb1 = paramFns[0].execute(record, arena).cast(); + auto jb2 = paramFns[1].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](const char* w1, uint32_t w1sz, const char* w2, uint32_t w2sz) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string s1(w1,w1sz), s2(w2,w2sz); + Jsonb* jb1 = jsonb_in(s1.c_str()); + if (!jb1) return 0.0; + Jsonb* jb2 = jsonb_in(s2.c_str()); + if (!jb2) { free(jb1); return 0.0; } + bool r = jsonb_eq(jb1, jb2); + free(jb1); free(jb2); + return r ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + jb1, jb2); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterJsonbEqPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size()==2, + "JsonbEqPhysicalFunction requires 2 children but got {}", + arguments.childFunctions.size()); + return JsonbEqPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/JsonbExistsPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/JsonbExistsPhysicalFunction.cpp new file mode 100644 index 0000000000..94e38788b1 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/JsonbExistsPhysicalFunction.cpp @@ -0,0 +1,74 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} +#include +#include + +namespace NES { + +JsonbExistsPhysicalFunction::JsonbExistsPhysicalFunction(PhysicalFunction jb, PhysicalFunction key) { + paramFns.reserve(2); + paramFns.push_back(std::move(jb)); + paramFns.push_back(std::move(key)); +} + +VarVal JsonbExistsPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { + auto jb = paramFns[0].execute(record, arena).cast(); + auto key = paramFns[1].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](const char* wj, uint32_t wjsz, const char* wk, uint32_t wksz) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string sj(wj,wjsz), sk(wk,wksz); + Jsonb* jb = jsonb_in(sj.c_str()); + if (!jb) return 0.0; + text* key = cstring_to_text(sk.c_str()); + bool r = jsonb_exists(jb, key); + free(jb); free(key); + return r ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + jb, key); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterJsonbExistsPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size()==2, + "JsonbExistsPhysicalFunction requires 2 children but got {}", + arguments.childFunctions.size()); + return JsonbExistsPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/JsonbGePhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/JsonbGePhysicalFunction.cpp new file mode 100644 index 0000000000..1c6f252e94 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/JsonbGePhysicalFunction.cpp @@ -0,0 +1,75 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} +#include +#include + +namespace NES { + +JsonbGePhysicalFunction::JsonbGePhysicalFunction(PhysicalFunction jb1, PhysicalFunction jb2) { + paramFns.reserve(2); + paramFns.push_back(std::move(jb1)); + paramFns.push_back(std::move(jb2)); +} + +VarVal JsonbGePhysicalFunction::execute(const Record& record, ArenaRef& arena) const { + auto jb1 = paramFns[0].execute(record, arena).cast(); + auto jb2 = paramFns[1].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](const char* w1, uint32_t w1sz, const char* w2, uint32_t w2sz) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string s1(w1,w1sz), s2(w2,w2sz); + Jsonb* jb1 = jsonb_in(s1.c_str()); + if (!jb1) return 0.0; + Jsonb* jb2 = jsonb_in(s2.c_str()); + if (!jb2) { free(jb1); return 0.0; } + bool r = jsonb_ge(jb1, jb2); + free(jb1); free(jb2); + return r ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + jb1, jb2); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterJsonbGePhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size()==2, + "JsonbGePhysicalFunction requires 2 children but got {}", + arguments.childFunctions.size()); + return JsonbGePhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/JsonbGtPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/JsonbGtPhysicalFunction.cpp new file mode 100644 index 0000000000..2268a7962c --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/JsonbGtPhysicalFunction.cpp @@ -0,0 +1,75 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} +#include +#include + +namespace NES { + +JsonbGtPhysicalFunction::JsonbGtPhysicalFunction(PhysicalFunction jb1, PhysicalFunction jb2) { + paramFns.reserve(2); + paramFns.push_back(std::move(jb1)); + paramFns.push_back(std::move(jb2)); +} + +VarVal JsonbGtPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { + auto jb1 = paramFns[0].execute(record, arena).cast(); + auto jb2 = paramFns[1].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](const char* w1, uint32_t w1sz, const char* w2, uint32_t w2sz) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string s1(w1,w1sz), s2(w2,w2sz); + Jsonb* jb1 = jsonb_in(s1.c_str()); + if (!jb1) return 0.0; + Jsonb* jb2 = jsonb_in(s2.c_str()); + if (!jb2) { free(jb1); return 0.0; } + bool r = jsonb_gt(jb1, jb2); + free(jb1); free(jb2); + return r ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + jb1, jb2); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterJsonbGtPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size()==2, + "JsonbGtPhysicalFunction requires 2 children but got {}", + arguments.childFunctions.size()); + return JsonbGtPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/JsonbLePhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/JsonbLePhysicalFunction.cpp new file mode 100644 index 0000000000..cf91c9a3fa --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/JsonbLePhysicalFunction.cpp @@ -0,0 +1,75 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} +#include +#include + +namespace NES { + +JsonbLePhysicalFunction::JsonbLePhysicalFunction(PhysicalFunction jb1, PhysicalFunction jb2) { + paramFns.reserve(2); + paramFns.push_back(std::move(jb1)); + paramFns.push_back(std::move(jb2)); +} + +VarVal JsonbLePhysicalFunction::execute(const Record& record, ArenaRef& arena) const { + auto jb1 = paramFns[0].execute(record, arena).cast(); + auto jb2 = paramFns[1].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](const char* w1, uint32_t w1sz, const char* w2, uint32_t w2sz) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string s1(w1,w1sz), s2(w2,w2sz); + Jsonb* jb1 = jsonb_in(s1.c_str()); + if (!jb1) return 0.0; + Jsonb* jb2 = jsonb_in(s2.c_str()); + if (!jb2) { free(jb1); return 0.0; } + bool r = jsonb_le(jb1, jb2); + free(jb1); free(jb2); + return r ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + jb1, jb2); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterJsonbLePhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size()==2, + "JsonbLePhysicalFunction requires 2 children but got {}", + arguments.childFunctions.size()); + return JsonbLePhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/JsonbLtPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/JsonbLtPhysicalFunction.cpp new file mode 100644 index 0000000000..6e16640bc2 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/JsonbLtPhysicalFunction.cpp @@ -0,0 +1,75 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} +#include +#include + +namespace NES { + +JsonbLtPhysicalFunction::JsonbLtPhysicalFunction(PhysicalFunction jb1, PhysicalFunction jb2) { + paramFns.reserve(2); + paramFns.push_back(std::move(jb1)); + paramFns.push_back(std::move(jb2)); +} + +VarVal JsonbLtPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { + auto jb1 = paramFns[0].execute(record, arena).cast(); + auto jb2 = paramFns[1].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](const char* w1, uint32_t w1sz, const char* w2, uint32_t w2sz) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string s1(w1,w1sz), s2(w2,w2sz); + Jsonb* jb1 = jsonb_in(s1.c_str()); + if (!jb1) return 0.0; + Jsonb* jb2 = jsonb_in(s2.c_str()); + if (!jb2) { free(jb1); return 0.0; } + bool r = jsonb_lt(jb1, jb2); + free(jb1); free(jb2); + return r ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + jb1, jb2); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterJsonbLtPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size()==2, + "JsonbLtPhysicalFunction requires 2 children but got {}", + arguments.childFunctions.size()); + return JsonbLtPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/JsonbNePhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/JsonbNePhysicalFunction.cpp new file mode 100644 index 0000000000..2dafe77f76 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/JsonbNePhysicalFunction.cpp @@ -0,0 +1,75 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} +#include +#include + +namespace NES { + +JsonbNePhysicalFunction::JsonbNePhysicalFunction(PhysicalFunction jb1, PhysicalFunction jb2) { + paramFns.reserve(2); + paramFns.push_back(std::move(jb1)); + paramFns.push_back(std::move(jb2)); +} + +VarVal JsonbNePhysicalFunction::execute(const Record& record, ArenaRef& arena) const { + auto jb1 = paramFns[0].execute(record, arena).cast(); + auto jb2 = paramFns[1].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](const char* w1, uint32_t w1sz, const char* w2, uint32_t w2sz) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string s1(w1,w1sz), s2(w2,w2sz); + Jsonb* jb1 = jsonb_in(s1.c_str()); + if (!jb1) return 0.0; + Jsonb* jb2 = jsonb_in(s2.c_str()); + if (!jb2) { free(jb1); return 0.0; } + bool r = jsonb_ne(jb1, jb2); + free(jb1); free(jb2); + return r ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + jb1, jb2); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterJsonbNePhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size()==2, + "JsonbNePhysicalFunction requires 2 children but got {}", + arguments.childFunctions.size()); + return JsonbNePhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/JsonbObjectFieldTextPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/JsonbObjectFieldTextPhysicalFunction.cpp new file mode 100644 index 0000000000..1dd63f6647 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/JsonbObjectFieldTextPhysicalFunction.cpp @@ -0,0 +1,86 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} +#include +#include + +namespace NES { + +JsonbObjectFieldTextPhysicalFunction::JsonbObjectFieldTextPhysicalFunction(PhysicalFunction jb, PhysicalFunction key) { + paramFns.reserve(2); + paramFns.push_back(std::move(jb)); + paramFns.push_back(std::move(key)); +} + +VarVal JsonbObjectFieldTextPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { + auto jb = paramFns[0].execute(record, arena).cast(); + auto key = paramFns[1].execute(record, arena).cast(); + constexpr uint32_t MAX_LEN = 4096; + auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); + const auto actualLen = nautilus::invoke( + +[](const char* wj, uint32_t wjsz, const char* wk, uint32_t wksz, + char* buf, uint32_t bufMax) -> uint32_t { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string sj(wj,wjsz), sk(wk,wksz); + Jsonb* jb = jsonb_in(sj.c_str()); + if (!jb) return 0u; + text* key = cstring_to_text(sk.c_str()); + text* res = jsonb_object_field_text(jb, key); + free(jb); free(key); + if (!res) return 0u; + char* out = text_to_cstring(res); + free(res); + if (!out) return 0u; + uint32_t len = static_cast(strlen(out)); + if (len > bufMax) len = bufMax; + memcpy(buf, out, len); + free(out); + return len; + } catch (const std::exception&) { return 0u; } + }, + jb, key, outBuf.getContent(), nautilus::val(MAX_LEN)); + VarVal(actualLen).writeToMemory(outBuf.getReference()); + return outBuf; +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterJsonbObjectFieldTextPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size()==2, + "JsonbObjectFieldTextPhysicalFunction requires 2 children but got {}", + arguments.childFunctions.size()); + return JsonbObjectFieldTextPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/JsonbPrettyPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/JsonbPrettyPhysicalFunction.cpp new file mode 100644 index 0000000000..eec46372d1 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/JsonbPrettyPhysicalFunction.cpp @@ -0,0 +1,81 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} +#include +#include + +namespace NES { + +JsonbPrettyPhysicalFunction::JsonbPrettyPhysicalFunction(PhysicalFunction jb) { + paramFns.reserve(1); + paramFns.push_back(std::move(jb)); +} + +VarVal JsonbPrettyPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { + auto jb = paramFns[0].execute(record, arena).cast(); + constexpr uint32_t MAX_LEN = 4096; + auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); + const auto actualLen = nautilus::invoke( + +[](const char* w, uint32_t wsz, char* buf, uint32_t bufMax) -> uint32_t { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string s(w, wsz); + Jsonb* jb = jsonb_in(s.c_str()); + if (!jb) return 0u; + text* res = jsonb_pretty(jb); + free(jb); + if (!res) return 0u; + char* out = text_to_cstring(res); + free(res); + if (!out) return 0u; + uint32_t len = static_cast(strlen(out)); + if (len > bufMax) len = bufMax; + memcpy(buf, out, len); + free(out); + return len; + } catch (const std::exception&) { return 0u; } + }, + jb, outBuf.getContent(), nautilus::val(MAX_LEN)); + VarVal(actualLen).writeToMemory(outBuf.getReference()); + return outBuf; +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterJsonbPrettyPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size()==1, + "JsonbPrettyPhysicalFunction requires 1 children but got {}", + arguments.childFunctions.size()); + return JsonbPrettyPhysicalFunction( + std::move(arguments.childFunctions[0])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/JsonbToCstringPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/JsonbToCstringPhysicalFunction.cpp new file mode 100644 index 0000000000..c919b965ce --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/JsonbToCstringPhysicalFunction.cpp @@ -0,0 +1,78 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} +#include +#include + +namespace NES { + +JsonbToCstringPhysicalFunction::JsonbToCstringPhysicalFunction(PhysicalFunction jb) { + paramFns.reserve(1); + paramFns.push_back(std::move(jb)); +} + +VarVal JsonbToCstringPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { + auto jb = paramFns[0].execute(record, arena).cast(); + constexpr uint32_t MAX_LEN = 4096; + auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); + const auto actualLen = nautilus::invoke( + +[](const char* w, uint32_t wsz, char* buf, uint32_t bufMax) -> uint32_t { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string s(w, wsz); + Jsonb* jb = jsonb_in(s.c_str()); + if (!jb) return 0u; + char* out = jsonb_to_cstring(jb); + free(jb); + if (!out) return 0u; + uint32_t len = static_cast(strlen(out)); + if (len > bufMax) len = bufMax; + memcpy(buf, out, len); + free(out); + return len; + } catch (const std::exception&) { return 0u; } + }, + jb, outBuf.getContent(), nautilus::val(MAX_LEN)); + VarVal(actualLen).writeToMemory(outBuf.getReference()); + return outBuf; +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterJsonbToCstringPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size()==1, + "JsonbToCstringPhysicalFunction requires 1 children but got {}", + arguments.childFunctions.size()); + return JsonbToCstringPhysicalFunction( + std::move(arguments.childFunctions[0])); +} + +} // namespace NES diff --git a/nes-sql-parser/AntlrSQL.g4 b/nes-sql-parser/AntlrSQL.g4 index 6e8d1713e3..4d24658974 100644 --- a/nes-sql-parser/AntlrSQL.g4 +++ b/nes-sql-parser/AntlrSQL.g4 @@ -295,7 +295,7 @@ timeUnit: MS timestampParameter: name=identifier; -functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT | TGE_TTEXT_TEXT | TGE_TEXT_TTEXT | TGT_TTEXT_TEXT | TGT_TEXT_TTEXT | TLE_TTEXT_TEXT | TLE_TEXT_TTEXT | TLT_TTEXT_TEXT | TLT_TEXT_TTEXT | TTEXT_UPPER | TTEXT_LOWER | TTEXT_INITCAP | TEXTCAT_TTEXT_TEXT | TEXTCAT_TEXT_TTEXT | TEXTCAT_TTEXT_TTEXT | GEOM_LENGTH | GEOM_PERIMETER | GEOM_AZIMUTH | GEOG_AREA | GEOG_LENGTH | GEOG_PERIMETER | GEOM_IS_EMPTY | AINTERSECTS_TGEO_GEO | ACOVERS_TGEO_GEO | ADISJOINT_TGEO_GEO | ADWITHIN_TGEO_GEO | EINTERSECTS_TGEO_GEO | ETOUCHES_TGEO_GEO | ECONTAINS_TGEO_GEO | ACONTAINS_TGEO_GEO | ATOUCHES_TGEO_GEO | GEO_NUM_POINTS | GEO_NUM_GEOS | GEO_SRID | GEO_IS_UNITARY | GEO_EQUALS | GEO_SAME | GEOG_DISTANCE | NAD_TGEO_GEO | EVER_EQ_TGEO_GEO | EVER_NE_TGEO_GEO | ALWAYS_EQ_TGEO_GEO | ALWAYS_NE_TGEO_GEO | GEOG_INTERSECTS | GEOG_DWITHIN | ACOVERS_GEO_TGEO | GEOM_INTERSECTS | GEOM_DWITHIN | H3_GS_POINT_TO_CELL | EVER_EQ_TH3INDEX_H3INDEX | EVER_NE_TH3INDEX_H3INDEX | ALWAYS_EQ_TH3INDEX_H3INDEX | ALWAYS_NE_TH3INDEX_H3INDEX | TH3INDEX_GET_RESOLUTION | TH3INDEX_GET_BASE_CELL_NUMBER | TH3INDEX_IS_VALID_CELL | TH3INDEX_IS_PENTAGON | TH3INDEX_CELL_TO_PARENT_NEXT | TH3INDEX_CELL_TO_CENTER_CHILD_NEXT | TH3INDEX_CELL_TO_PARENT | TH3INDEX_CELL_TO_CENTER_CHILD | TH3INDEX_CELL_TO_CHILD_POS | TH3INDEX_ARE_NEIGHBOR_CELLS | TH3INDEX_GRID_DISTANCE | EINTERSECTS_TCBUFFER_GEO | AINTERSECTS_TCBUFFER_GEO | ECOVERS_TCBUFFER_GEO | ACOVERS_TCBUFFER_GEO | EDISJOINT_TCBUFFER_GEO | ADISJOINT_TCBUFFER_GEO | ETOUCHES_TCBUFFER_GEO | ATOUCHES_TCBUFFER_GEO | ECONTAINS_TCBUFFER_GEO | ACONTAINS_TCBUFFER_GEO | NAD_TCBUFFER_GEO | EDWITHIN_TCBUFFER_GEO | ADWITHIN_TCBUFFER_GEO | EINTERSECTS_TCBUFFER_CBUFFER | AINTERSECTS_TCBUFFER_CBUFFER | ECOVERS_TCBUFFER_CBUFFER | ACOVERS_TCBUFFER_CBUFFER | EDISJOINT_TCBUFFER_CBUFFER | ADISJOINT_TCBUFFER_CBUFFER | ETOUCHES_TCBUFFER_CBUFFER | ATOUCHES_TCBUFFER_CBUFFER | ECONTAINS_TCBUFFER_CBUFFER | ACONTAINS_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_CBUFFER | ALWAYS_EQ_TCBUFFER_CBUFFER | EVER_NE_TCBUFFER_CBUFFER | ALWAYS_NE_TCBUFFER_CBUFFER | NAD_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_TCBUFFER | ALWAYS_EQ_TCBUFFER_TCBUFFER | EVER_NE_TCBUFFER_TCBUFFER | ALWAYS_NE_TCBUFFER_TCBUFFER | EINTERSECTS_TCBUFFER_TCBUFFER | AINTERSECTS_TCBUFFER_TCBUFFER | ECOVERS_TCBUFFER_TCBUFFER | ACOVERS_TCBUFFER_TCBUFFER | ADISJOINT_TCBUFFER_TCBUFFER | ETOUCHES_TCBUFFER_TCBUFFER | ATOUCHES_TCBUFFER_TCBUFFER | NAD_TCBUFFER_TCBUFFER | EDWITHIN_TCBUFFER_TCBUFFER | ADWITHIN_TCBUFFER_TCBUFFER | MINDISTANCE_TCBUFFER_TCBUFFER | NAD_TNPOINT_GEO | EVER_EQ_TNPOINT_NPOINT | ALWAYS_EQ_TNPOINT_NPOINT | EVER_NE_TNPOINT_NPOINT | ALWAYS_NE_TNPOINT_NPOINT | NAD_TNPOINT_NPOINT | EVER_EQ_NPOINT_TNPOINT | ALWAYS_EQ_NPOINT_TNPOINT | EVER_NE_NPOINT_TNPOINT | ALWAYS_NE_NPOINT_TNPOINT | EVER_EQ_TNPOINT_TNPOINT | ALWAYS_EQ_TNPOINT_TNPOINT | EVER_NE_TNPOINT_TNPOINT | ALWAYS_NE_TNPOINT_TNPOINT | NAD_TNPOINT_TNPOINT | NAD_TPOSE_GEO | EVER_EQ_TPOSE_POSE | ALWAYS_EQ_TPOSE_POSE | EVER_NE_TPOSE_POSE | ALWAYS_NE_TPOSE_POSE | NAD_TPOSE_POSE | EVER_EQ_POSE_TPOSE | ALWAYS_EQ_POSE_TPOSE | EVER_NE_POSE_TPOSE | ALWAYS_NE_POSE_TPOSE | EVER_EQ_TPOSE_TPOSE | ALWAYS_EQ_TPOSE_TPOSE | EVER_NE_TPOSE_TPOSE | ALWAYS_NE_TPOSE_TPOSE | NAD_TPOSE_TPOSE | EVER_EQ_TRGEOMETRY_GEO | ALWAYS_EQ_TRGEOMETRY_GEO | EVER_NE_TRGEOMETRY_GEO | ALWAYS_NE_TRGEOMETRY_GEO | NAD_TRGEOMETRY_GEO | EVER_EQ_GEO_TRGEOMETRY | ALWAYS_EQ_GEO_TRGEOMETRY | EVER_NE_GEO_TRGEOMETRY | ALWAYS_NE_GEO_TRGEOMETRY | EVER_EQ_TRGEOMETRY_TRGEOMETRY | ALWAYS_EQ_TRGEOMETRY_TRGEOMETRY | EVER_NE_TRGEOMETRY_TRGEOMETRY | ALWAYS_NE_TRGEOMETRY_TRGEOMETRY | NAD_TRGEOMETRY_TRGEOMETRY | EINTERSECTS_TPCPOINT_GEO | NAD_TPCPOINT_GEO | QUADBIN_POINT_TO_CELL | QUADBIN_IS_VALID_CELL | QUADBIN_GET_RESOLUTION | QUADBIN_CELL_AREA | QUADBIN_CELL_TO_QUADKEY | QUADBIN_CELL_TO_PARENT | QUADBIN_TILE_TO_CELL | EVER_EQ_TJSONB_JSONB | ALWAYS_EQ_TJSONB_JSONB | EVER_NE_TJSONB_JSONB | ALWAYS_NE_TJSONB_JSONB | EVER_EQ_TJSONB_TJSONB | ALWAYS_EQ_TJSONB_TJSONB | EVER_NE_TJSONB_TJSONB | ALWAYS_NE_TJSONB_TJSONB | GEOM_BOUNDARY | GEOM_CENTROID | GEOM_CONVEX_HULL | GEO_REVERSE | GEO_POINTS | GEOM_UNARY_UNION | GEOM_DIFFERENCE2D | GEOM_INTERSECTION2D | GEOM_SHORTESTLINE2D | GEOM_SHORTESTLINE3D | GEO_SET_SRID | GEO_TRANSFORM | GEO_ROUND | GEOM_BUFFER | LINE_NUMPOINTS | LINE_LOCATE_POINT | LINE_INTERPOLATE_POINT | LINE_SUBSTRING | GEOM_POINT_MAKE2D | GEOM_POINT_MAKE3DZ | GEOG_POINT_MAKE2D | GEOG_POINT_MAKE3DZ | GEOM_TO_GEOG | GEOG_TO_GEOM | GEOG_CENTROID | GEO_GEO_N | LINE_POINT_N | GEOM_INTERSECTION2D_COLL | GEO_AS_GEOJSON | GEO_AS_HEXEWKB | GEO_AS_EWKT | GEO_FROM_GEOJSON | GEOM_FROM_HEXEWKB | GEO_TRANSFORM_PIPELINE | GEOM_MIN_BOUNDING_CENTER | GEOM_MIN_BOUNDING_RADIUS | EVER_EQ_TGEO_TGEO | EVER_NE_TGEO_TGEO | ALWAYS_EQ_TGEO_TGEO | ALWAYS_NE_TGEO_TGEO | EINTERSECTS_TGEO_TGEO | ECOVERS_TGEO_TGEO | EDISJOINT_TGEO_TGEO | ECONTAINS_TGEO_TGEO | ETOUCHES_TGEO_TGEO | AINTERSECTS_TGEO_TGEO | ACOVERS_TGEO_TGEO | ADISJOINT_TGEO_TGEO | ACONTAINS_TGEO_TGEO | ATOUCHES_TGEO_TGEO | EDWITHIN_TGEO_TGEO | ADWITHIN_TGEO_TGEO | H3INDEX_EQ | H3INDEX_NE | H3INDEX_LT | H3INDEX_LE | H3INDEX_GT | H3INDEX_GE | H3INDEX_CMP | H3INDEX_OUT | H3INDEX_IN | JSON_ARRAY_LENGTH | JSON_TYPEOF | JSON_OBJECT_FIELD_TEXT | JSON_ARRAY_ELEMENT_TEXT | GEOM_RELATE_PATTERN | GEOM_INTERSECTS2D | GEOM_DWITHIN2D | GEOM_CONTAINS | GEOM_DISJOINT2D | GEOM_COVERS | GEOM_TOUCHES | GEOM_INTERSECTS3D | GEOM_DWITHIN3D | GEOM_DISTANCE2D | GEOM_DISTANCE3D; +functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT | TGE_TTEXT_TEXT | TGE_TEXT_TTEXT | TGT_TTEXT_TEXT | TGT_TEXT_TTEXT | TLE_TTEXT_TEXT | TLE_TEXT_TTEXT | TLT_TTEXT_TEXT | TLT_TEXT_TTEXT | TTEXT_UPPER | TTEXT_LOWER | TTEXT_INITCAP | TEXTCAT_TTEXT_TEXT | TEXTCAT_TEXT_TTEXT | TEXTCAT_TTEXT_TTEXT | GEOM_LENGTH | GEOM_PERIMETER | GEOM_AZIMUTH | GEOG_AREA | GEOG_LENGTH | GEOG_PERIMETER | GEOM_IS_EMPTY | AINTERSECTS_TGEO_GEO | ACOVERS_TGEO_GEO | ADISJOINT_TGEO_GEO | ADWITHIN_TGEO_GEO | EINTERSECTS_TGEO_GEO | ETOUCHES_TGEO_GEO | ECONTAINS_TGEO_GEO | ACONTAINS_TGEO_GEO | ATOUCHES_TGEO_GEO | GEO_NUM_POINTS | GEO_NUM_GEOS | GEO_SRID | GEO_IS_UNITARY | GEO_EQUALS | GEO_SAME | GEOG_DISTANCE | NAD_TGEO_GEO | EVER_EQ_TGEO_GEO | EVER_NE_TGEO_GEO | ALWAYS_EQ_TGEO_GEO | ALWAYS_NE_TGEO_GEO | GEOG_INTERSECTS | GEOG_DWITHIN | ACOVERS_GEO_TGEO | GEOM_INTERSECTS | GEOM_DWITHIN | H3_GS_POINT_TO_CELL | EVER_EQ_TH3INDEX_H3INDEX | EVER_NE_TH3INDEX_H3INDEX | ALWAYS_EQ_TH3INDEX_H3INDEX | ALWAYS_NE_TH3INDEX_H3INDEX | TH3INDEX_GET_RESOLUTION | TH3INDEX_GET_BASE_CELL_NUMBER | TH3INDEX_IS_VALID_CELL | TH3INDEX_IS_PENTAGON | TH3INDEX_CELL_TO_PARENT_NEXT | TH3INDEX_CELL_TO_CENTER_CHILD_NEXT | TH3INDEX_CELL_TO_PARENT | TH3INDEX_CELL_TO_CENTER_CHILD | TH3INDEX_CELL_TO_CHILD_POS | TH3INDEX_ARE_NEIGHBOR_CELLS | TH3INDEX_GRID_DISTANCE | EINTERSECTS_TCBUFFER_GEO | AINTERSECTS_TCBUFFER_GEO | ECOVERS_TCBUFFER_GEO | ACOVERS_TCBUFFER_GEO | EDISJOINT_TCBUFFER_GEO | ADISJOINT_TCBUFFER_GEO | ETOUCHES_TCBUFFER_GEO | ATOUCHES_TCBUFFER_GEO | ECONTAINS_TCBUFFER_GEO | ACONTAINS_TCBUFFER_GEO | NAD_TCBUFFER_GEO | EDWITHIN_TCBUFFER_GEO | ADWITHIN_TCBUFFER_GEO | EINTERSECTS_TCBUFFER_CBUFFER | AINTERSECTS_TCBUFFER_CBUFFER | ECOVERS_TCBUFFER_CBUFFER | ACOVERS_TCBUFFER_CBUFFER | EDISJOINT_TCBUFFER_CBUFFER | ADISJOINT_TCBUFFER_CBUFFER | ETOUCHES_TCBUFFER_CBUFFER | ATOUCHES_TCBUFFER_CBUFFER | ECONTAINS_TCBUFFER_CBUFFER | ACONTAINS_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_CBUFFER | ALWAYS_EQ_TCBUFFER_CBUFFER | EVER_NE_TCBUFFER_CBUFFER | ALWAYS_NE_TCBUFFER_CBUFFER | NAD_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_TCBUFFER | ALWAYS_EQ_TCBUFFER_TCBUFFER | EVER_NE_TCBUFFER_TCBUFFER | ALWAYS_NE_TCBUFFER_TCBUFFER | EINTERSECTS_TCBUFFER_TCBUFFER | AINTERSECTS_TCBUFFER_TCBUFFER | ECOVERS_TCBUFFER_TCBUFFER | ACOVERS_TCBUFFER_TCBUFFER | ADISJOINT_TCBUFFER_TCBUFFER | ETOUCHES_TCBUFFER_TCBUFFER | ATOUCHES_TCBUFFER_TCBUFFER | NAD_TCBUFFER_TCBUFFER | EDWITHIN_TCBUFFER_TCBUFFER | ADWITHIN_TCBUFFER_TCBUFFER | MINDISTANCE_TCBUFFER_TCBUFFER | NAD_TNPOINT_GEO | EVER_EQ_TNPOINT_NPOINT | ALWAYS_EQ_TNPOINT_NPOINT | EVER_NE_TNPOINT_NPOINT | ALWAYS_NE_TNPOINT_NPOINT | NAD_TNPOINT_NPOINT | EVER_EQ_NPOINT_TNPOINT | ALWAYS_EQ_NPOINT_TNPOINT | EVER_NE_NPOINT_TNPOINT | ALWAYS_NE_NPOINT_TNPOINT | EVER_EQ_TNPOINT_TNPOINT | ALWAYS_EQ_TNPOINT_TNPOINT | EVER_NE_TNPOINT_TNPOINT | ALWAYS_NE_TNPOINT_TNPOINT | NAD_TNPOINT_TNPOINT | NAD_TPOSE_GEO | EVER_EQ_TPOSE_POSE | ALWAYS_EQ_TPOSE_POSE | EVER_NE_TPOSE_POSE | ALWAYS_NE_TPOSE_POSE | NAD_TPOSE_POSE | EVER_EQ_POSE_TPOSE | ALWAYS_EQ_POSE_TPOSE | EVER_NE_POSE_TPOSE | ALWAYS_NE_POSE_TPOSE | EVER_EQ_TPOSE_TPOSE | ALWAYS_EQ_TPOSE_TPOSE | EVER_NE_TPOSE_TPOSE | ALWAYS_NE_TPOSE_TPOSE | NAD_TPOSE_TPOSE | EVER_EQ_TRGEOMETRY_GEO | ALWAYS_EQ_TRGEOMETRY_GEO | EVER_NE_TRGEOMETRY_GEO | ALWAYS_NE_TRGEOMETRY_GEO | NAD_TRGEOMETRY_GEO | EVER_EQ_GEO_TRGEOMETRY | ALWAYS_EQ_GEO_TRGEOMETRY | EVER_NE_GEO_TRGEOMETRY | ALWAYS_NE_GEO_TRGEOMETRY | EVER_EQ_TRGEOMETRY_TRGEOMETRY | ALWAYS_EQ_TRGEOMETRY_TRGEOMETRY | EVER_NE_TRGEOMETRY_TRGEOMETRY | ALWAYS_NE_TRGEOMETRY_TRGEOMETRY | NAD_TRGEOMETRY_TRGEOMETRY | EINTERSECTS_TPCPOINT_GEO | NAD_TPCPOINT_GEO | QUADBIN_POINT_TO_CELL | QUADBIN_IS_VALID_CELL | QUADBIN_GET_RESOLUTION | QUADBIN_CELL_AREA | QUADBIN_CELL_TO_QUADKEY | QUADBIN_CELL_TO_PARENT | QUADBIN_TILE_TO_CELL | EVER_EQ_TJSONB_JSONB | ALWAYS_EQ_TJSONB_JSONB | EVER_NE_TJSONB_JSONB | ALWAYS_NE_TJSONB_JSONB | EVER_EQ_TJSONB_TJSONB | ALWAYS_EQ_TJSONB_TJSONB | EVER_NE_TJSONB_TJSONB | ALWAYS_NE_TJSONB_TJSONB | GEOM_BOUNDARY | GEOM_CENTROID | GEOM_CONVEX_HULL | GEO_REVERSE | GEO_POINTS | GEOM_UNARY_UNION | GEOM_DIFFERENCE2D | GEOM_INTERSECTION2D | GEOM_SHORTESTLINE2D | GEOM_SHORTESTLINE3D | GEO_SET_SRID | GEO_TRANSFORM | GEO_ROUND | GEOM_BUFFER | LINE_NUMPOINTS | LINE_LOCATE_POINT | LINE_INTERPOLATE_POINT | LINE_SUBSTRING | GEOM_POINT_MAKE2D | GEOM_POINT_MAKE3DZ | GEOG_POINT_MAKE2D | GEOG_POINT_MAKE3DZ | GEOM_TO_GEOG | GEOG_TO_GEOM | GEOG_CENTROID | GEO_GEO_N | LINE_POINT_N | GEOM_INTERSECTION2D_COLL | GEO_AS_GEOJSON | GEO_AS_HEXEWKB | GEO_AS_EWKT | GEO_FROM_GEOJSON | GEOM_FROM_HEXEWKB | GEO_TRANSFORM_PIPELINE | GEOM_MIN_BOUNDING_CENTER | GEOM_MIN_BOUNDING_RADIUS | EVER_EQ_TGEO_TGEO | EVER_NE_TGEO_TGEO | ALWAYS_EQ_TGEO_TGEO | ALWAYS_NE_TGEO_TGEO | EINTERSECTS_TGEO_TGEO | ECOVERS_TGEO_TGEO | EDISJOINT_TGEO_TGEO | ECONTAINS_TGEO_TGEO | ETOUCHES_TGEO_TGEO | AINTERSECTS_TGEO_TGEO | ACOVERS_TGEO_TGEO | ADISJOINT_TGEO_TGEO | ACONTAINS_TGEO_TGEO | ATOUCHES_TGEO_TGEO | EDWITHIN_TGEO_TGEO | ADWITHIN_TGEO_TGEO | H3INDEX_EQ | H3INDEX_NE | H3INDEX_LT | H3INDEX_LE | H3INDEX_GT | H3INDEX_GE | H3INDEX_CMP | H3INDEX_OUT | H3INDEX_IN | JSON_ARRAY_LENGTH | JSON_TYPEOF | JSON_OBJECT_FIELD_TEXT | JSON_ARRAY_ELEMENT_TEXT | JSONB_ARRAY_LENGTH | JSONB_EQ | JSONB_NE | JSONB_LT | JSONB_LE | JSONB_GT | JSONB_GE | JSONB_CMP | JSONB_CONTAINS | JSONB_CONTAINED | JSONB_EXISTS | JSONB_TO_CSTRING | JSONB_PRETTY | JSONB_OBJECT_FIELD_TEXT | JSONB_ARRAY_ELEMENT_TEXT | GEOM_RELATE_PATTERN | GEOM_INTERSECTS2D | GEOM_DWITHIN2D | GEOM_CONTAINS | GEOM_DISJOINT2D | GEOM_COVERS | GEOM_TOUCHES | GEOM_INTERSECTS3D | GEOM_DWITHIN3D | GEOM_DISTANCE2D | GEOM_DISTANCE3D; sinkClause: INTO sink (',' sink)*; @@ -976,6 +976,21 @@ JSON_ARRAY_LENGTH: 'JSON_ARRAY_LENGTH' | 'json_array_length'; JSON_TYPEOF: 'JSON_TYPEOF' | 'json_typeof'; JSON_OBJECT_FIELD_TEXT: 'JSON_OBJECT_FIELD_TEXT' | 'json_object_field_text'; JSON_ARRAY_ELEMENT_TEXT: 'JSON_ARRAY_ELEMENT_TEXT' | 'json_array_element_text'; +JSONB_ARRAY_LENGTH: 'JSONB_ARRAY_LENGTH' | 'jsonb_array_length'; +JSONB_EQ: 'JSONB_EQ' | 'jsonb_eq'; +JSONB_NE: 'JSONB_NE' | 'jsonb_ne'; +JSONB_LT: 'JSONB_LT' | 'jsonb_lt'; +JSONB_LE: 'JSONB_LE' | 'jsonb_le'; +JSONB_GT: 'JSONB_GT' | 'jsonb_gt'; +JSONB_GE: 'JSONB_GE' | 'jsonb_ge'; +JSONB_CMP: 'JSONB_CMP' | 'jsonb_cmp'; +JSONB_CONTAINS: 'JSONB_CONTAINS' | 'jsonb_contains'; +JSONB_CONTAINED: 'JSONB_CONTAINED' | 'jsonb_contained'; +JSONB_EXISTS: 'JSONB_EXISTS' | 'jsonb_exists'; +JSONB_TO_CSTRING: 'JSONB_TO_CSTRING' | 'jsonb_to_cstring'; +JSONB_PRETTY: 'JSONB_PRETTY' | 'jsonb_pretty'; +JSONB_OBJECT_FIELD_TEXT: 'JSONB_OBJECT_FIELD_TEXT' | 'jsonb_object_field_text'; +JSONB_ARRAY_ELEMENT_TEXT: 'JSONB_ARRAY_ELEMENT_TEXT' | 'jsonb_array_element_text'; GEOM_RELATE_PATTERN: 'GEOM_RELATE_PATTERN' | 'geom_relate_pattern'; GEOM_INTERSECTS2D: 'GEOM_INTERSECTS2D' | 'geom_intersects2d'; GEOM_DWITHIN2D: 'GEOM_DWITHIN2D' | 'geom_dwithin2d'; diff --git a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp index ece7ebc48c..6e894aefd2 100644 --- a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp +++ b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp @@ -557,6 +557,21 @@ #include #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include @@ -11479,6 +11494,138 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont return LogicalFunction(JsonArrayElementTextLogicalFunction(std::move(arg0), std::move(arg1))); } /* END CODEGEN PARSER GLUE: JSON_ARRAY_ELEMENT_TEXT */ + case AntlrSQLParser::JSONB_ARRAY_LENGTH: { + PRECONDITION(ctx->functionParam().size() == 1, + "JsonbArrayLength requires 1 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + return LogicalFunction(JsonbArrayLengthLogicalFunction(std::move(arg0))); + } + /* END CODEGEN PARSER GLUE: JSONB_ARRAY_LENGTH */ + case AntlrSQLParser::JSONB_EQ: { + PRECONDITION(ctx->functionParam().size() == 2, + "JsonbEq requires 2 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + return LogicalFunction(JsonbEqLogicalFunction(std::move(arg0), std::move(arg1))); + } + /* END CODEGEN PARSER GLUE: JSONB_EQ */ + case AntlrSQLParser::JSONB_NE: { + PRECONDITION(ctx->functionParam().size() == 2, + "JsonbNe requires 2 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + return LogicalFunction(JsonbNeLogicalFunction(std::move(arg0), std::move(arg1))); + } + /* END CODEGEN PARSER GLUE: JSONB_NE */ + case AntlrSQLParser::JSONB_LT: { + PRECONDITION(ctx->functionParam().size() == 2, + "JsonbLt requires 2 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + return LogicalFunction(JsonbLtLogicalFunction(std::move(arg0), std::move(arg1))); + } + /* END CODEGEN PARSER GLUE: JSONB_LT */ + case AntlrSQLParser::JSONB_LE: { + PRECONDITION(ctx->functionParam().size() == 2, + "JsonbLe requires 2 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + return LogicalFunction(JsonbLeLogicalFunction(std::move(arg0), std::move(arg1))); + } + /* END CODEGEN PARSER GLUE: JSONB_LE */ + case AntlrSQLParser::JSONB_GT: { + PRECONDITION(ctx->functionParam().size() == 2, + "JsonbGt requires 2 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + return LogicalFunction(JsonbGtLogicalFunction(std::move(arg0), std::move(arg1))); + } + /* END CODEGEN PARSER GLUE: JSONB_GT */ + case AntlrSQLParser::JSONB_GE: { + PRECONDITION(ctx->functionParam().size() == 2, + "JsonbGe requires 2 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + return LogicalFunction(JsonbGeLogicalFunction(std::move(arg0), std::move(arg1))); + } + /* END CODEGEN PARSER GLUE: JSONB_GE */ + case AntlrSQLParser::JSONB_CMP: { + PRECONDITION(ctx->functionParam().size() == 2, + "JsonbCmp requires 2 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + return LogicalFunction(JsonbCmpLogicalFunction(std::move(arg0), std::move(arg1))); + } + /* END CODEGEN PARSER GLUE: JSONB_CMP */ + case AntlrSQLParser::JSONB_CONTAINS: { + PRECONDITION(ctx->functionParam().size() == 2, + "JsonbContains requires 2 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + return LogicalFunction(JsonbContainsLogicalFunction(std::move(arg0), std::move(arg1))); + } + /* END CODEGEN PARSER GLUE: JSONB_CONTAINS */ + case AntlrSQLParser::JSONB_CONTAINED: { + PRECONDITION(ctx->functionParam().size() == 2, + "JsonbContained requires 2 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + return LogicalFunction(JsonbContainedLogicalFunction(std::move(arg0), std::move(arg1))); + } + /* END CODEGEN PARSER GLUE: JSONB_CONTAINED */ + case AntlrSQLParser::JSONB_EXISTS: { + PRECONDITION(ctx->functionParam().size() == 2, + "JsonbExists requires 2 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + return LogicalFunction(JsonbExistsLogicalFunction(std::move(arg0), std::move(arg1))); + } + /* END CODEGEN PARSER GLUE: JSONB_EXISTS */ + case AntlrSQLParser::JSONB_TO_CSTRING: { + PRECONDITION(ctx->functionParam().size() == 1, + "JsonbToCstring requires 1 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + return LogicalFunction(JsonbToCstringLogicalFunction(std::move(arg0))); + } + /* END CODEGEN PARSER GLUE: JSONB_TO_CSTRING */ + case AntlrSQLParser::JSONB_PRETTY: { + PRECONDITION(ctx->functionParam().size() == 1, + "JsonbPretty requires 1 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + return LogicalFunction(JsonbPrettyLogicalFunction(std::move(arg0))); + } + /* END CODEGEN PARSER GLUE: JSONB_PRETTY */ + case AntlrSQLParser::JSONB_OBJECT_FIELD_TEXT: { + PRECONDITION(ctx->functionParam().size() == 2, + "JsonbObjectFieldText requires 2 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + return LogicalFunction(JsonbObjectFieldTextLogicalFunction(std::move(arg0), std::move(arg1))); + } + /* END CODEGEN PARSER GLUE: JSONB_OBJECT_FIELD_TEXT */ + case AntlrSQLParser::JSONB_ARRAY_ELEMENT_TEXT: { + PRECONDITION(ctx->functionParam().size() == 2, + "JsonbArrayElementText requires 2 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + return LogicalFunction(JsonbArrayElementTextLogicalFunction(std::move(arg0), std::move(arg1))); + } + /* END CODEGEN PARSER GLUE: JSONB_ARRAY_ELEMENT_TEXT */ /* END CODEGEN PARSER GLUE: GEOM_RELATE_PATTERN */ /* END CODEGEN PARSER GLUE: GEOM_INTERSECTS2D */ case AntlrSQLParser::GEOM_DWITHIN2D: { From a237ef460c2c6743568340bb77b5958a6aaf6163 Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Thu, 18 Jun 2026 23:11:33 +0200 Subject: [PATCH 91/96] feat(meos): add Span constructor and accessor NES operators (W143) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Wires 12 Span operators: INTSPAN_MAKE and FLOATSPAN_MAKE (4×FLOAT64 → VARCHAR serialized span), plus INTSPAN/FLOATSPAN LOWER/UPPER/WIDTH (→ FLOAT64 bounds/width) and LOWER_INC/UPPER_INC (→ FLOAT64 0/1 flags). Spans are passed as VARCHAR strings across NES operator boundaries using intspan_in/intspan_out and floatspan_in/floatspan_out. New in ecosystem-pin-2026-06-18b. --- .../Meos/FloatspanLowerIncLogicalFunction.hpp | 45 +++++++ .../Meos/FloatspanLowerLogicalFunction.hpp | 45 +++++++ .../Meos/FloatspanMakeLogicalFunction.hpp | 45 +++++++ .../Meos/FloatspanUpperIncLogicalFunction.hpp | 45 +++++++ .../Meos/FloatspanUpperLogicalFunction.hpp | 45 +++++++ .../Meos/FloatspanWidthLogicalFunction.hpp | 45 +++++++ .../Meos/IntspanLowerIncLogicalFunction.hpp | 45 +++++++ .../Meos/IntspanLowerLogicalFunction.hpp | 45 +++++++ .../Meos/IntspanMakeLogicalFunction.hpp | 45 +++++++ .../Meos/IntspanUpperIncLogicalFunction.hpp | 45 +++++++ .../Meos/IntspanUpperLogicalFunction.hpp | 45 +++++++ .../Meos/IntspanWidthLogicalFunction.hpp | 45 +++++++ .../src/Functions/Meos/CMakeLists.txt | 12 ++ .../Meos/FloatspanLowerIncLogicalFunction.cpp | 72 +++++++++++ .../Meos/FloatspanLowerLogicalFunction.cpp | 72 +++++++++++ .../Meos/FloatspanMakeLogicalFunction.cpp | 81 +++++++++++++ .../Meos/FloatspanUpperIncLogicalFunction.cpp | 72 +++++++++++ .../Meos/FloatspanUpperLogicalFunction.cpp | 72 +++++++++++ .../Meos/FloatspanWidthLogicalFunction.cpp | 72 +++++++++++ .../Meos/IntspanLowerIncLogicalFunction.cpp | 72 +++++++++++ .../Meos/IntspanLowerLogicalFunction.cpp | 72 +++++++++++ .../Meos/IntspanMakeLogicalFunction.cpp | 81 +++++++++++++ .../Meos/IntspanUpperIncLogicalFunction.cpp | 72 +++++++++++ .../Meos/IntspanUpperLogicalFunction.cpp | 72 +++++++++++ .../Meos/IntspanWidthLogicalFunction.cpp | 72 +++++++++++ .../FloatspanLowerIncPhysicalFunction.hpp | 32 +++++ .../Meos/FloatspanLowerPhysicalFunction.hpp | 32 +++++ .../Meos/FloatspanMakePhysicalFunction.hpp | 32 +++++ .../FloatspanUpperIncPhysicalFunction.hpp | 32 +++++ .../Meos/FloatspanUpperPhysicalFunction.hpp | 32 +++++ .../Meos/FloatspanWidthPhysicalFunction.hpp | 32 +++++ .../Meos/IntspanLowerIncPhysicalFunction.hpp | 32 +++++ .../Meos/IntspanLowerPhysicalFunction.hpp | 32 +++++ .../Meos/IntspanMakePhysicalFunction.hpp | 32 +++++ .../Meos/IntspanUpperIncPhysicalFunction.hpp | 32 +++++ .../Meos/IntspanUpperPhysicalFunction.hpp | 32 +++++ .../Meos/IntspanWidthPhysicalFunction.hpp | 32 +++++ .../src/Functions/Meos/CMakeLists.txt | 12 ++ .../FloatspanLowerIncPhysicalFunction.cpp | 69 +++++++++++ .../Meos/FloatspanLowerPhysicalFunction.cpp | 69 +++++++++++ .../Meos/FloatspanMakePhysicalFunction.cpp | 88 ++++++++++++++ .../FloatspanUpperIncPhysicalFunction.cpp | 69 +++++++++++ .../Meos/FloatspanUpperPhysicalFunction.cpp | 69 +++++++++++ .../Meos/FloatspanWidthPhysicalFunction.cpp | 69 +++++++++++ .../Meos/IntspanLowerIncPhysicalFunction.cpp | 69 +++++++++++ .../Meos/IntspanLowerPhysicalFunction.cpp | 69 +++++++++++ .../Meos/IntspanMakePhysicalFunction.cpp | 88 ++++++++++++++ .../Meos/IntspanUpperIncPhysicalFunction.cpp | 69 +++++++++++ .../Meos/IntspanUpperPhysicalFunction.cpp | 69 +++++++++++ .../Meos/IntspanWidthPhysicalFunction.cpp | 69 +++++++++++ nes-sql-parser/AntlrSQL.g4 | 14 ++- .../src/AntlrSQLQueryPlanCreator.cpp | 114 ++++++++++++++++++ 52 files changed, 2823 insertions(+), 1 deletion(-) create mode 100644 nes-logical-operators/include/Functions/Meos/FloatspanLowerIncLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/FloatspanLowerLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/FloatspanMakeLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/FloatspanUpperIncLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/FloatspanUpperLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/FloatspanWidthLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/IntspanLowerIncLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/IntspanLowerLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/IntspanMakeLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/IntspanUpperIncLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/IntspanUpperLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/IntspanWidthLogicalFunction.hpp create mode 100644 nes-logical-operators/src/Functions/Meos/FloatspanLowerIncLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/FloatspanLowerLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/FloatspanMakeLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/FloatspanUpperIncLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/FloatspanUpperLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/FloatspanWidthLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/IntspanLowerIncLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/IntspanLowerLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/IntspanMakeLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/IntspanUpperIncLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/IntspanUpperLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/IntspanWidthLogicalFunction.cpp create mode 100644 nes-physical-operators/include/Functions/Meos/FloatspanLowerIncPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/FloatspanLowerPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/FloatspanMakePhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/FloatspanUpperIncPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/FloatspanUpperPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/FloatspanWidthPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/IntspanLowerIncPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/IntspanLowerPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/IntspanMakePhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/IntspanUpperIncPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/IntspanUpperPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/IntspanWidthPhysicalFunction.hpp create mode 100644 nes-physical-operators/src/Functions/Meos/FloatspanLowerIncPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/FloatspanLowerPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/FloatspanMakePhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/FloatspanUpperIncPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/FloatspanUpperPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/FloatspanWidthPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/IntspanLowerIncPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/IntspanLowerPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/IntspanMakePhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/IntspanUpperIncPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/IntspanUpperPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/IntspanWidthPhysicalFunction.cpp diff --git a/nes-logical-operators/include/Functions/Meos/FloatspanLowerIncLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/FloatspanLowerIncLogicalFunction.hpp new file mode 100644 index 0000000000..19fcbb21ef --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/FloatspanLowerIncLogicalFunction.hpp @@ -0,0 +1,45 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1 if the lower bound of a float span is inclusive, 0 otherwise. + */ +class FloatspanLowerIncLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "FloatspanLowerInc"; + FloatspanLowerIncLogicalFunction(LogicalFunction sp); + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/FloatspanLowerLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/FloatspanLowerLogicalFunction.hpp new file mode 100644 index 0000000000..14edef4f90 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/FloatspanLowerLogicalFunction.hpp @@ -0,0 +1,45 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns the lower bound of a float span. + */ +class FloatspanLowerLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "FloatspanLower"; + FloatspanLowerLogicalFunction(LogicalFunction sp); + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/FloatspanMakeLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/FloatspanMakeLogicalFunction.hpp new file mode 100644 index 0000000000..ba165b1de4 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/FloatspanMakeLogicalFunction.hpp @@ -0,0 +1,45 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Creates a float span from bounds and inclusivity flags. + */ +class FloatspanMakeLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "FloatspanMake"; + FloatspanMakeLogicalFunction(LogicalFunction lower, LogicalFunction upper, LogicalFunction lower_inc, LogicalFunction upper_inc); + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/FloatspanUpperIncLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/FloatspanUpperIncLogicalFunction.hpp new file mode 100644 index 0000000000..67656438f3 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/FloatspanUpperIncLogicalFunction.hpp @@ -0,0 +1,45 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1 if the upper bound of a float span is inclusive, 0 otherwise. + */ +class FloatspanUpperIncLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "FloatspanUpperInc"; + FloatspanUpperIncLogicalFunction(LogicalFunction sp); + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/FloatspanUpperLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/FloatspanUpperLogicalFunction.hpp new file mode 100644 index 0000000000..bc0db186db --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/FloatspanUpperLogicalFunction.hpp @@ -0,0 +1,45 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns the upper bound of a float span. + */ +class FloatspanUpperLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "FloatspanUpper"; + FloatspanUpperLogicalFunction(LogicalFunction sp); + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/FloatspanWidthLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/FloatspanWidthLogicalFunction.hpp new file mode 100644 index 0000000000..556a46d45a --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/FloatspanWidthLogicalFunction.hpp @@ -0,0 +1,45 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns the width of a float span. + */ +class FloatspanWidthLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "FloatspanWidth"; + FloatspanWidthLogicalFunction(LogicalFunction sp); + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/IntspanLowerIncLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/IntspanLowerIncLogicalFunction.hpp new file mode 100644 index 0000000000..bc41350f67 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/IntspanLowerIncLogicalFunction.hpp @@ -0,0 +1,45 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1 if the lower bound of an integer span is inclusive, 0 otherwise. + */ +class IntspanLowerIncLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "IntspanLowerInc"; + IntspanLowerIncLogicalFunction(LogicalFunction sp); + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/IntspanLowerLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/IntspanLowerLogicalFunction.hpp new file mode 100644 index 0000000000..def87ac64c --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/IntspanLowerLogicalFunction.hpp @@ -0,0 +1,45 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns the lower bound of an integer span. + */ +class IntspanLowerLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "IntspanLower"; + IntspanLowerLogicalFunction(LogicalFunction sp); + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/IntspanMakeLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/IntspanMakeLogicalFunction.hpp new file mode 100644 index 0000000000..f01028c511 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/IntspanMakeLogicalFunction.hpp @@ -0,0 +1,45 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Creates an integer span from bounds and inclusivity flags. + */ +class IntspanMakeLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "IntspanMake"; + IntspanMakeLogicalFunction(LogicalFunction lower, LogicalFunction upper, LogicalFunction lower_inc, LogicalFunction upper_inc); + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/IntspanUpperIncLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/IntspanUpperIncLogicalFunction.hpp new file mode 100644 index 0000000000..ef0ebfe0e3 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/IntspanUpperIncLogicalFunction.hpp @@ -0,0 +1,45 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1 if the upper bound of an integer span is inclusive, 0 otherwise. + */ +class IntspanUpperIncLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "IntspanUpperInc"; + IntspanUpperIncLogicalFunction(LogicalFunction sp); + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/IntspanUpperLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/IntspanUpperLogicalFunction.hpp new file mode 100644 index 0000000000..a790b2af87 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/IntspanUpperLogicalFunction.hpp @@ -0,0 +1,45 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns the upper bound of an integer span. + */ +class IntspanUpperLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "IntspanUpper"; + IntspanUpperLogicalFunction(LogicalFunction sp); + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/IntspanWidthLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/IntspanWidthLogicalFunction.hpp new file mode 100644 index 0000000000..bcfcf07049 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/IntspanWidthLogicalFunction.hpp @@ -0,0 +1,45 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns the width of an integer span. + */ +class IntspanWidthLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "IntspanWidth"; + IntspanWidthLogicalFunction(LogicalFunction sp); + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt index 6df4d7dcfe..14d0973723 100644 --- a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt @@ -521,6 +521,18 @@ add_plugin(JsonbToCstring LogicalFunction nes-logical-operators JsonbToCstringLo add_plugin(JsonbPretty LogicalFunction nes-logical-operators JsonbPrettyLogicalFunction.cpp) add_plugin(JsonbObjectFieldText LogicalFunction nes-logical-operators JsonbObjectFieldTextLogicalFunction.cpp) add_plugin(JsonbArrayElementText LogicalFunction nes-logical-operators JsonbArrayElementTextLogicalFunction.cpp) +add_plugin(IntspanMake LogicalFunction nes-logical-operators IntspanMakeLogicalFunction.cpp) +add_plugin(FloatspanMake LogicalFunction nes-logical-operators FloatspanMakeLogicalFunction.cpp) +add_plugin(IntspanLower LogicalFunction nes-logical-operators IntspanLowerLogicalFunction.cpp) +add_plugin(IntspanUpper LogicalFunction nes-logical-operators IntspanUpperLogicalFunction.cpp) +add_plugin(IntspanWidth LogicalFunction nes-logical-operators IntspanWidthLogicalFunction.cpp) +add_plugin(IntspanLowerInc LogicalFunction nes-logical-operators IntspanLowerIncLogicalFunction.cpp) +add_plugin(IntspanUpperInc LogicalFunction nes-logical-operators IntspanUpperIncLogicalFunction.cpp) +add_plugin(FloatspanLower LogicalFunction nes-logical-operators FloatspanLowerLogicalFunction.cpp) +add_plugin(FloatspanUpper LogicalFunction nes-logical-operators FloatspanUpperLogicalFunction.cpp) +add_plugin(FloatspanWidth LogicalFunction nes-logical-operators FloatspanWidthLogicalFunction.cpp) +add_plugin(FloatspanLowerInc LogicalFunction nes-logical-operators FloatspanLowerIncLogicalFunction.cpp) +add_plugin(FloatspanUpperInc LogicalFunction nes-logical-operators FloatspanUpperIncLogicalFunction.cpp) add_plugin(GeomRelatePattern LogicalFunction nes-logical-operators GeomRelatePatternLogicalFunction.cpp) add_plugin(GeomIntersects2d LogicalFunction nes-logical-operators GeomIntersects2dLogicalFunction.cpp) add_plugin(GeomDwithin2d LogicalFunction nes-logical-operators GeomDwithin2dLogicalFunction.cpp) diff --git a/nes-logical-operators/src/Functions/Meos/FloatspanLowerIncLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/FloatspanLowerIncLogicalFunction.cpp new file mode 100644 index 0000000000..c0900d9acf --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/FloatspanLowerIncLogicalFunction.cpp @@ -0,0 +1,72 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +FloatspanLowerIncLogicalFunction::FloatspanLowerIncLogicalFunction(LogicalFunction sp) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(1); + parameters.push_back(std::move(sp)); +} +DataType FloatspanLowerIncLogicalFunction::getDataType() const { return dataType; } +LogicalFunction FloatspanLowerIncLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } +std::vector FloatspanLowerIncLogicalFunction::getChildren() const { return parameters; } +LogicalFunction FloatspanLowerIncLogicalFunction::withChildren(const std::vector& children) const { + PRECONDITION(children.size()==1,"FloatspanLowerIncLogicalFunction requires 1 children, but got {}",children.size()); + auto c=*this; c.parameters=children; return c; +} +std::string_view FloatspanLowerIncLogicalFunction::getType() const { return NAME; } +bool FloatspanLowerIncLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + return false; +} +std::string FloatspanLowerIncLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("{}({})",NAME,parameters[0].explain(v)); +} +LogicalFunction FloatspanLowerIncLogicalFunction::withInferredDataType(const Schema& schema) const { + std::vector c; c.reserve(1); + for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "sp must be VARSIZED"); + return withChildren(c); +} +SerializableFunction FloatspanLowerIncLogicalFunction::serialize() const { + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + return proto; +} +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterFloatspanLowerIncLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size()==1, + "FloatspanLowerIncLogicalFunction requires 1 children but got {}", + arguments.children.size()); + return FloatspanLowerIncLogicalFunction( + std::move(arguments.children[0])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/FloatspanLowerLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/FloatspanLowerLogicalFunction.cpp new file mode 100644 index 0000000000..179e1e5d04 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/FloatspanLowerLogicalFunction.cpp @@ -0,0 +1,72 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +FloatspanLowerLogicalFunction::FloatspanLowerLogicalFunction(LogicalFunction sp) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(1); + parameters.push_back(std::move(sp)); +} +DataType FloatspanLowerLogicalFunction::getDataType() const { return dataType; } +LogicalFunction FloatspanLowerLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } +std::vector FloatspanLowerLogicalFunction::getChildren() const { return parameters; } +LogicalFunction FloatspanLowerLogicalFunction::withChildren(const std::vector& children) const { + PRECONDITION(children.size()==1,"FloatspanLowerLogicalFunction requires 1 children, but got {}",children.size()); + auto c=*this; c.parameters=children; return c; +} +std::string_view FloatspanLowerLogicalFunction::getType() const { return NAME; } +bool FloatspanLowerLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + return false; +} +std::string FloatspanLowerLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("{}({})",NAME,parameters[0].explain(v)); +} +LogicalFunction FloatspanLowerLogicalFunction::withInferredDataType(const Schema& schema) const { + std::vector c; c.reserve(1); + for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "sp must be VARSIZED"); + return withChildren(c); +} +SerializableFunction FloatspanLowerLogicalFunction::serialize() const { + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + return proto; +} +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterFloatspanLowerLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size()==1, + "FloatspanLowerLogicalFunction requires 1 children but got {}", + arguments.children.size()); + return FloatspanLowerLogicalFunction( + std::move(arguments.children[0])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/FloatspanMakeLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/FloatspanMakeLogicalFunction.cpp new file mode 100644 index 0000000000..d4303b114a --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/FloatspanMakeLogicalFunction.cpp @@ -0,0 +1,81 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +FloatspanMakeLogicalFunction::FloatspanMakeLogicalFunction(LogicalFunction lower, LogicalFunction upper, LogicalFunction lower_inc, LogicalFunction upper_inc) + : dataType(DataTypeProvider::provideDataType(DataType::Type::VARSIZED)) +{ + parameters.reserve(4); + parameters.push_back(std::move(lower)); + parameters.push_back(std::move(upper)); + parameters.push_back(std::move(lower_inc)); + parameters.push_back(std::move(upper_inc)); +} +DataType FloatspanMakeLogicalFunction::getDataType() const { return dataType; } +LogicalFunction FloatspanMakeLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } +std::vector FloatspanMakeLogicalFunction::getChildren() const { return parameters; } +LogicalFunction FloatspanMakeLogicalFunction::withChildren(const std::vector& children) const { + PRECONDITION(children.size()==4,"FloatspanMakeLogicalFunction requires 4 children, but got {}",children.size()); + auto c=*this; c.parameters=children; return c; +} +std::string_view FloatspanMakeLogicalFunction::getType() const { return NAME; } +bool FloatspanMakeLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + return false; +} +std::string FloatspanMakeLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("{}({})",NAME,parameters[0].explain(v)); +} +LogicalFunction FloatspanMakeLogicalFunction::withInferredDataType(const Schema& schema) const { + std::vector c; c.reserve(4); + for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lower must be FLOAT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "upper must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "lower_inc must be FLOAT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::FLOAT64), "upper_inc must be FLOAT64"); + return withChildren(c); +} +SerializableFunction FloatspanMakeLogicalFunction::serialize() const { + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + return proto; +} +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterFloatspanMakeLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size()==4, + "FloatspanMakeLogicalFunction requires 4 children but got {}", + arguments.children.size()); + return FloatspanMakeLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/FloatspanUpperIncLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/FloatspanUpperIncLogicalFunction.cpp new file mode 100644 index 0000000000..b0a0e58c63 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/FloatspanUpperIncLogicalFunction.cpp @@ -0,0 +1,72 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +FloatspanUpperIncLogicalFunction::FloatspanUpperIncLogicalFunction(LogicalFunction sp) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(1); + parameters.push_back(std::move(sp)); +} +DataType FloatspanUpperIncLogicalFunction::getDataType() const { return dataType; } +LogicalFunction FloatspanUpperIncLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } +std::vector FloatspanUpperIncLogicalFunction::getChildren() const { return parameters; } +LogicalFunction FloatspanUpperIncLogicalFunction::withChildren(const std::vector& children) const { + PRECONDITION(children.size()==1,"FloatspanUpperIncLogicalFunction requires 1 children, but got {}",children.size()); + auto c=*this; c.parameters=children; return c; +} +std::string_view FloatspanUpperIncLogicalFunction::getType() const { return NAME; } +bool FloatspanUpperIncLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + return false; +} +std::string FloatspanUpperIncLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("{}({})",NAME,parameters[0].explain(v)); +} +LogicalFunction FloatspanUpperIncLogicalFunction::withInferredDataType(const Schema& schema) const { + std::vector c; c.reserve(1); + for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "sp must be VARSIZED"); + return withChildren(c); +} +SerializableFunction FloatspanUpperIncLogicalFunction::serialize() const { + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + return proto; +} +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterFloatspanUpperIncLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size()==1, + "FloatspanUpperIncLogicalFunction requires 1 children but got {}", + arguments.children.size()); + return FloatspanUpperIncLogicalFunction( + std::move(arguments.children[0])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/FloatspanUpperLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/FloatspanUpperLogicalFunction.cpp new file mode 100644 index 0000000000..289ea6db7f --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/FloatspanUpperLogicalFunction.cpp @@ -0,0 +1,72 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +FloatspanUpperLogicalFunction::FloatspanUpperLogicalFunction(LogicalFunction sp) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(1); + parameters.push_back(std::move(sp)); +} +DataType FloatspanUpperLogicalFunction::getDataType() const { return dataType; } +LogicalFunction FloatspanUpperLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } +std::vector FloatspanUpperLogicalFunction::getChildren() const { return parameters; } +LogicalFunction FloatspanUpperLogicalFunction::withChildren(const std::vector& children) const { + PRECONDITION(children.size()==1,"FloatspanUpperLogicalFunction requires 1 children, but got {}",children.size()); + auto c=*this; c.parameters=children; return c; +} +std::string_view FloatspanUpperLogicalFunction::getType() const { return NAME; } +bool FloatspanUpperLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + return false; +} +std::string FloatspanUpperLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("{}({})",NAME,parameters[0].explain(v)); +} +LogicalFunction FloatspanUpperLogicalFunction::withInferredDataType(const Schema& schema) const { + std::vector c; c.reserve(1); + for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "sp must be VARSIZED"); + return withChildren(c); +} +SerializableFunction FloatspanUpperLogicalFunction::serialize() const { + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + return proto; +} +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterFloatspanUpperLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size()==1, + "FloatspanUpperLogicalFunction requires 1 children but got {}", + arguments.children.size()); + return FloatspanUpperLogicalFunction( + std::move(arguments.children[0])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/FloatspanWidthLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/FloatspanWidthLogicalFunction.cpp new file mode 100644 index 0000000000..808bad3746 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/FloatspanWidthLogicalFunction.cpp @@ -0,0 +1,72 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +FloatspanWidthLogicalFunction::FloatspanWidthLogicalFunction(LogicalFunction sp) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(1); + parameters.push_back(std::move(sp)); +} +DataType FloatspanWidthLogicalFunction::getDataType() const { return dataType; } +LogicalFunction FloatspanWidthLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } +std::vector FloatspanWidthLogicalFunction::getChildren() const { return parameters; } +LogicalFunction FloatspanWidthLogicalFunction::withChildren(const std::vector& children) const { + PRECONDITION(children.size()==1,"FloatspanWidthLogicalFunction requires 1 children, but got {}",children.size()); + auto c=*this; c.parameters=children; return c; +} +std::string_view FloatspanWidthLogicalFunction::getType() const { return NAME; } +bool FloatspanWidthLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + return false; +} +std::string FloatspanWidthLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("{}({})",NAME,parameters[0].explain(v)); +} +LogicalFunction FloatspanWidthLogicalFunction::withInferredDataType(const Schema& schema) const { + std::vector c; c.reserve(1); + for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "sp must be VARSIZED"); + return withChildren(c); +} +SerializableFunction FloatspanWidthLogicalFunction::serialize() const { + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + return proto; +} +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterFloatspanWidthLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size()==1, + "FloatspanWidthLogicalFunction requires 1 children but got {}", + arguments.children.size()); + return FloatspanWidthLogicalFunction( + std::move(arguments.children[0])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/IntspanLowerIncLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/IntspanLowerIncLogicalFunction.cpp new file mode 100644 index 0000000000..9294880386 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/IntspanLowerIncLogicalFunction.cpp @@ -0,0 +1,72 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +IntspanLowerIncLogicalFunction::IntspanLowerIncLogicalFunction(LogicalFunction sp) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(1); + parameters.push_back(std::move(sp)); +} +DataType IntspanLowerIncLogicalFunction::getDataType() const { return dataType; } +LogicalFunction IntspanLowerIncLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } +std::vector IntspanLowerIncLogicalFunction::getChildren() const { return parameters; } +LogicalFunction IntspanLowerIncLogicalFunction::withChildren(const std::vector& children) const { + PRECONDITION(children.size()==1,"IntspanLowerIncLogicalFunction requires 1 children, but got {}",children.size()); + auto c=*this; c.parameters=children; return c; +} +std::string_view IntspanLowerIncLogicalFunction::getType() const { return NAME; } +bool IntspanLowerIncLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + return false; +} +std::string IntspanLowerIncLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("{}({})",NAME,parameters[0].explain(v)); +} +LogicalFunction IntspanLowerIncLogicalFunction::withInferredDataType(const Schema& schema) const { + std::vector c; c.reserve(1); + for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "sp must be VARSIZED"); + return withChildren(c); +} +SerializableFunction IntspanLowerIncLogicalFunction::serialize() const { + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + return proto; +} +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterIntspanLowerIncLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size()==1, + "IntspanLowerIncLogicalFunction requires 1 children but got {}", + arguments.children.size()); + return IntspanLowerIncLogicalFunction( + std::move(arguments.children[0])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/IntspanLowerLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/IntspanLowerLogicalFunction.cpp new file mode 100644 index 0000000000..3257071541 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/IntspanLowerLogicalFunction.cpp @@ -0,0 +1,72 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +IntspanLowerLogicalFunction::IntspanLowerLogicalFunction(LogicalFunction sp) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(1); + parameters.push_back(std::move(sp)); +} +DataType IntspanLowerLogicalFunction::getDataType() const { return dataType; } +LogicalFunction IntspanLowerLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } +std::vector IntspanLowerLogicalFunction::getChildren() const { return parameters; } +LogicalFunction IntspanLowerLogicalFunction::withChildren(const std::vector& children) const { + PRECONDITION(children.size()==1,"IntspanLowerLogicalFunction requires 1 children, but got {}",children.size()); + auto c=*this; c.parameters=children; return c; +} +std::string_view IntspanLowerLogicalFunction::getType() const { return NAME; } +bool IntspanLowerLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + return false; +} +std::string IntspanLowerLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("{}({})",NAME,parameters[0].explain(v)); +} +LogicalFunction IntspanLowerLogicalFunction::withInferredDataType(const Schema& schema) const { + std::vector c; c.reserve(1); + for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "sp must be VARSIZED"); + return withChildren(c); +} +SerializableFunction IntspanLowerLogicalFunction::serialize() const { + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + return proto; +} +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterIntspanLowerLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size()==1, + "IntspanLowerLogicalFunction requires 1 children but got {}", + arguments.children.size()); + return IntspanLowerLogicalFunction( + std::move(arguments.children[0])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/IntspanMakeLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/IntspanMakeLogicalFunction.cpp new file mode 100644 index 0000000000..11edd03296 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/IntspanMakeLogicalFunction.cpp @@ -0,0 +1,81 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +IntspanMakeLogicalFunction::IntspanMakeLogicalFunction(LogicalFunction lower, LogicalFunction upper, LogicalFunction lower_inc, LogicalFunction upper_inc) + : dataType(DataTypeProvider::provideDataType(DataType::Type::VARSIZED)) +{ + parameters.reserve(4); + parameters.push_back(std::move(lower)); + parameters.push_back(std::move(upper)); + parameters.push_back(std::move(lower_inc)); + parameters.push_back(std::move(upper_inc)); +} +DataType IntspanMakeLogicalFunction::getDataType() const { return dataType; } +LogicalFunction IntspanMakeLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } +std::vector IntspanMakeLogicalFunction::getChildren() const { return parameters; } +LogicalFunction IntspanMakeLogicalFunction::withChildren(const std::vector& children) const { + PRECONDITION(children.size()==4,"IntspanMakeLogicalFunction requires 4 children, but got {}",children.size()); + auto c=*this; c.parameters=children; return c; +} +std::string_view IntspanMakeLogicalFunction::getType() const { return NAME; } +bool IntspanMakeLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + return false; +} +std::string IntspanMakeLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("{}({})",NAME,parameters[0].explain(v)); +} +LogicalFunction IntspanMakeLogicalFunction::withInferredDataType(const Schema& schema) const { + std::vector c; c.reserve(4); + for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lower must be FLOAT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "upper must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "lower_inc must be FLOAT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::FLOAT64), "upper_inc must be FLOAT64"); + return withChildren(c); +} +SerializableFunction IntspanMakeLogicalFunction::serialize() const { + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + return proto; +} +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterIntspanMakeLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size()==4, + "IntspanMakeLogicalFunction requires 4 children but got {}", + arguments.children.size()); + return IntspanMakeLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/IntspanUpperIncLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/IntspanUpperIncLogicalFunction.cpp new file mode 100644 index 0000000000..f3ac4aca30 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/IntspanUpperIncLogicalFunction.cpp @@ -0,0 +1,72 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +IntspanUpperIncLogicalFunction::IntspanUpperIncLogicalFunction(LogicalFunction sp) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(1); + parameters.push_back(std::move(sp)); +} +DataType IntspanUpperIncLogicalFunction::getDataType() const { return dataType; } +LogicalFunction IntspanUpperIncLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } +std::vector IntspanUpperIncLogicalFunction::getChildren() const { return parameters; } +LogicalFunction IntspanUpperIncLogicalFunction::withChildren(const std::vector& children) const { + PRECONDITION(children.size()==1,"IntspanUpperIncLogicalFunction requires 1 children, but got {}",children.size()); + auto c=*this; c.parameters=children; return c; +} +std::string_view IntspanUpperIncLogicalFunction::getType() const { return NAME; } +bool IntspanUpperIncLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + return false; +} +std::string IntspanUpperIncLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("{}({})",NAME,parameters[0].explain(v)); +} +LogicalFunction IntspanUpperIncLogicalFunction::withInferredDataType(const Schema& schema) const { + std::vector c; c.reserve(1); + for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "sp must be VARSIZED"); + return withChildren(c); +} +SerializableFunction IntspanUpperIncLogicalFunction::serialize() const { + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + return proto; +} +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterIntspanUpperIncLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size()==1, + "IntspanUpperIncLogicalFunction requires 1 children but got {}", + arguments.children.size()); + return IntspanUpperIncLogicalFunction( + std::move(arguments.children[0])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/IntspanUpperLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/IntspanUpperLogicalFunction.cpp new file mode 100644 index 0000000000..e3d25cef69 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/IntspanUpperLogicalFunction.cpp @@ -0,0 +1,72 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +IntspanUpperLogicalFunction::IntspanUpperLogicalFunction(LogicalFunction sp) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(1); + parameters.push_back(std::move(sp)); +} +DataType IntspanUpperLogicalFunction::getDataType() const { return dataType; } +LogicalFunction IntspanUpperLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } +std::vector IntspanUpperLogicalFunction::getChildren() const { return parameters; } +LogicalFunction IntspanUpperLogicalFunction::withChildren(const std::vector& children) const { + PRECONDITION(children.size()==1,"IntspanUpperLogicalFunction requires 1 children, but got {}",children.size()); + auto c=*this; c.parameters=children; return c; +} +std::string_view IntspanUpperLogicalFunction::getType() const { return NAME; } +bool IntspanUpperLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + return false; +} +std::string IntspanUpperLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("{}({})",NAME,parameters[0].explain(v)); +} +LogicalFunction IntspanUpperLogicalFunction::withInferredDataType(const Schema& schema) const { + std::vector c; c.reserve(1); + for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "sp must be VARSIZED"); + return withChildren(c); +} +SerializableFunction IntspanUpperLogicalFunction::serialize() const { + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + return proto; +} +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterIntspanUpperLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size()==1, + "IntspanUpperLogicalFunction requires 1 children but got {}", + arguments.children.size()); + return IntspanUpperLogicalFunction( + std::move(arguments.children[0])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/IntspanWidthLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/IntspanWidthLogicalFunction.cpp new file mode 100644 index 0000000000..1e505303e7 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/IntspanWidthLogicalFunction.cpp @@ -0,0 +1,72 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +IntspanWidthLogicalFunction::IntspanWidthLogicalFunction(LogicalFunction sp) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(1); + parameters.push_back(std::move(sp)); +} +DataType IntspanWidthLogicalFunction::getDataType() const { return dataType; } +LogicalFunction IntspanWidthLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } +std::vector IntspanWidthLogicalFunction::getChildren() const { return parameters; } +LogicalFunction IntspanWidthLogicalFunction::withChildren(const std::vector& children) const { + PRECONDITION(children.size()==1,"IntspanWidthLogicalFunction requires 1 children, but got {}",children.size()); + auto c=*this; c.parameters=children; return c; +} +std::string_view IntspanWidthLogicalFunction::getType() const { return NAME; } +bool IntspanWidthLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + return false; +} +std::string IntspanWidthLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("{}({})",NAME,parameters[0].explain(v)); +} +LogicalFunction IntspanWidthLogicalFunction::withInferredDataType(const Schema& schema) const { + std::vector c; c.reserve(1); + for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "sp must be VARSIZED"); + return withChildren(c); +} +SerializableFunction IntspanWidthLogicalFunction::serialize() const { + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + return proto; +} +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterIntspanWidthLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size()==1, + "IntspanWidthLogicalFunction requires 1 children but got {}", + arguments.children.size()); + return IntspanWidthLogicalFunction( + std::move(arguments.children[0])); +} + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/FloatspanLowerIncPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/FloatspanLowerIncPhysicalFunction.hpp new file mode 100644 index 0000000000..854ad3cd5d --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/FloatspanLowerIncPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class FloatspanLowerIncPhysicalFunction : public PhysicalFunctionConcept { +public: + FloatspanLowerIncPhysicalFunction(PhysicalFunction sp); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/FloatspanLowerPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/FloatspanLowerPhysicalFunction.hpp new file mode 100644 index 0000000000..b8716cd5a8 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/FloatspanLowerPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class FloatspanLowerPhysicalFunction : public PhysicalFunctionConcept { +public: + FloatspanLowerPhysicalFunction(PhysicalFunction sp); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/FloatspanMakePhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/FloatspanMakePhysicalFunction.hpp new file mode 100644 index 0000000000..bbe359842d --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/FloatspanMakePhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class FloatspanMakePhysicalFunction : public PhysicalFunctionConcept { +public: + FloatspanMakePhysicalFunction(PhysicalFunction lower, PhysicalFunction upper, PhysicalFunction lower_inc, PhysicalFunction upper_inc); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/FloatspanUpperIncPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/FloatspanUpperIncPhysicalFunction.hpp new file mode 100644 index 0000000000..9607979672 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/FloatspanUpperIncPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class FloatspanUpperIncPhysicalFunction : public PhysicalFunctionConcept { +public: + FloatspanUpperIncPhysicalFunction(PhysicalFunction sp); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/FloatspanUpperPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/FloatspanUpperPhysicalFunction.hpp new file mode 100644 index 0000000000..b7702106f4 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/FloatspanUpperPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class FloatspanUpperPhysicalFunction : public PhysicalFunctionConcept { +public: + FloatspanUpperPhysicalFunction(PhysicalFunction sp); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/FloatspanWidthPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/FloatspanWidthPhysicalFunction.hpp new file mode 100644 index 0000000000..d1a3aae9f1 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/FloatspanWidthPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class FloatspanWidthPhysicalFunction : public PhysicalFunctionConcept { +public: + FloatspanWidthPhysicalFunction(PhysicalFunction sp); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/IntspanLowerIncPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/IntspanLowerIncPhysicalFunction.hpp new file mode 100644 index 0000000000..b0ef7fa840 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/IntspanLowerIncPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class IntspanLowerIncPhysicalFunction : public PhysicalFunctionConcept { +public: + IntspanLowerIncPhysicalFunction(PhysicalFunction sp); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/IntspanLowerPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/IntspanLowerPhysicalFunction.hpp new file mode 100644 index 0000000000..f4b4d69463 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/IntspanLowerPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class IntspanLowerPhysicalFunction : public PhysicalFunctionConcept { +public: + IntspanLowerPhysicalFunction(PhysicalFunction sp); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/IntspanMakePhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/IntspanMakePhysicalFunction.hpp new file mode 100644 index 0000000000..21e7023cf7 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/IntspanMakePhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class IntspanMakePhysicalFunction : public PhysicalFunctionConcept { +public: + IntspanMakePhysicalFunction(PhysicalFunction lower, PhysicalFunction upper, PhysicalFunction lower_inc, PhysicalFunction upper_inc); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/IntspanUpperIncPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/IntspanUpperIncPhysicalFunction.hpp new file mode 100644 index 0000000000..fc458932e0 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/IntspanUpperIncPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class IntspanUpperIncPhysicalFunction : public PhysicalFunctionConcept { +public: + IntspanUpperIncPhysicalFunction(PhysicalFunction sp); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/IntspanUpperPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/IntspanUpperPhysicalFunction.hpp new file mode 100644 index 0000000000..70c6dc1b7e --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/IntspanUpperPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class IntspanUpperPhysicalFunction : public PhysicalFunctionConcept { +public: + IntspanUpperPhysicalFunction(PhysicalFunction sp); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/IntspanWidthPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/IntspanWidthPhysicalFunction.hpp new file mode 100644 index 0000000000..c94fb8d7a2 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/IntspanWidthPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class IntspanWidthPhysicalFunction : public PhysicalFunctionConcept { +public: + IntspanWidthPhysicalFunction(PhysicalFunction sp); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt index 4adaa30ffb..f6dc713274 100644 --- a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt @@ -520,6 +520,18 @@ add_plugin(JsonbToCstring PhysicalFunction nes-physical-operators JsonbToCstring add_plugin(JsonbPretty PhysicalFunction nes-physical-operators JsonbPrettyPhysicalFunction.cpp) add_plugin(JsonbObjectFieldText PhysicalFunction nes-physical-operators JsonbObjectFieldTextPhysicalFunction.cpp) add_plugin(JsonbArrayElementText PhysicalFunction nes-physical-operators JsonbArrayElementTextPhysicalFunction.cpp) +add_plugin(IntspanMake PhysicalFunction nes-physical-operators IntspanMakePhysicalFunction.cpp) +add_plugin(FloatspanMake PhysicalFunction nes-physical-operators FloatspanMakePhysicalFunction.cpp) +add_plugin(IntspanLower PhysicalFunction nes-physical-operators IntspanLowerPhysicalFunction.cpp) +add_plugin(IntspanUpper PhysicalFunction nes-physical-operators IntspanUpperPhysicalFunction.cpp) +add_plugin(IntspanWidth PhysicalFunction nes-physical-operators IntspanWidthPhysicalFunction.cpp) +add_plugin(IntspanLowerInc PhysicalFunction nes-physical-operators IntspanLowerIncPhysicalFunction.cpp) +add_plugin(IntspanUpperInc PhysicalFunction nes-physical-operators IntspanUpperIncPhysicalFunction.cpp) +add_plugin(FloatspanLower PhysicalFunction nes-physical-operators FloatspanLowerPhysicalFunction.cpp) +add_plugin(FloatspanUpper PhysicalFunction nes-physical-operators FloatspanUpperPhysicalFunction.cpp) +add_plugin(FloatspanWidth PhysicalFunction nes-physical-operators FloatspanWidthPhysicalFunction.cpp) +add_plugin(FloatspanLowerInc PhysicalFunction nes-physical-operators FloatspanLowerIncPhysicalFunction.cpp) +add_plugin(FloatspanUpperInc PhysicalFunction nes-physical-operators FloatspanUpperIncPhysicalFunction.cpp) add_plugin(GeomRelatePattern PhysicalFunction nes-physical-operators GeomRelatePatternPhysicalFunction.cpp) add_plugin(GeomIntersects2d PhysicalFunction nes-physical-operators GeomIntersects2dPhysicalFunction.cpp) add_plugin(GeomDwithin2d PhysicalFunction nes-physical-operators GeomDwithin2dPhysicalFunction.cpp) diff --git a/nes-physical-operators/src/Functions/Meos/FloatspanLowerIncPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/FloatspanLowerIncPhysicalFunction.cpp new file mode 100644 index 0000000000..b2f34231dd --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/FloatspanLowerIncPhysicalFunction.cpp @@ -0,0 +1,69 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +} +#include +#include + +namespace NES { + +FloatspanLowerIncPhysicalFunction::FloatspanLowerIncPhysicalFunction(PhysicalFunction sp) { + paramFns.reserve(1); + paramFns.push_back(std::move(sp)); +} + +VarVal FloatspanLowerIncPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { + auto sp = paramFns[0].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](const char* w, uint32_t wsz) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string s(w, wsz); + Span* sp = floatspan_in(s.c_str()); + if (!sp) return 0.0; + bool r = span_lower_inc(sp); + free(sp); + return r ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + sp); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterFloatspanLowerIncPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size()==1, + "FloatspanLowerIncPhysicalFunction requires 1 children but got {}", + arguments.childFunctions.size()); + return FloatspanLowerIncPhysicalFunction( + std::move(arguments.childFunctions[0])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/FloatspanLowerPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/FloatspanLowerPhysicalFunction.cpp new file mode 100644 index 0000000000..83aadcd6b4 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/FloatspanLowerPhysicalFunction.cpp @@ -0,0 +1,69 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +} +#include +#include + +namespace NES { + +FloatspanLowerPhysicalFunction::FloatspanLowerPhysicalFunction(PhysicalFunction sp) { + paramFns.reserve(1); + paramFns.push_back(std::move(sp)); +} + +VarVal FloatspanLowerPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { + auto sp = paramFns[0].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](const char* w, uint32_t wsz) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string s(w, wsz); + Span* sp = floatspan_in(s.c_str()); + if (!sp) return 0.0; + double r = (double)floatspan_lower(sp); + free(sp); + return r; + } catch (const std::exception&) { return 0.0; } + }, + sp); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterFloatspanLowerPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size()==1, + "FloatspanLowerPhysicalFunction requires 1 children but got {}", + arguments.childFunctions.size()); + return FloatspanLowerPhysicalFunction( + std::move(arguments.childFunctions[0])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/FloatspanMakePhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/FloatspanMakePhysicalFunction.cpp new file mode 100644 index 0000000000..d95affa030 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/FloatspanMakePhysicalFunction.cpp @@ -0,0 +1,88 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +} +#include +#include + +namespace NES { + +FloatspanMakePhysicalFunction::FloatspanMakePhysicalFunction(PhysicalFunction lower, PhysicalFunction upper, PhysicalFunction lower_inc, PhysicalFunction upper_inc) { + paramFns.reserve(4); + paramFns.push_back(std::move(lower)); + paramFns.push_back(std::move(upper)); + paramFns.push_back(std::move(lower_inc)); + paramFns.push_back(std::move(upper_inc)); +} + +VarVal FloatspanMakePhysicalFunction::execute(const Record& record, ArenaRef& arena) const { + auto lower = paramFns[0].execute(record, arena).cast(); + auto upper = paramFns[1].execute(record, arena).cast(); + auto lower_inc = paramFns[2].execute(record, arena).cast(); + auto upper_inc = paramFns[3].execute(record, arena).cast(); + constexpr uint32_t MAX_LEN = 64; + auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); + const auto actualLen = nautilus::invoke( + +[](double lo, double hi, double lo_inc, double hi_inc, + char* buf, uint32_t bufMax) -> uint32_t { + try { + MEOS::Meos::ensureMeosInitialized(); + Span* sp = floatspan_make(lo, hi, + lo_inc != 0.0, hi_inc != 0.0); + if (!sp) return 0u; + char* out = floatspan_out(sp, -1); + free(sp); + if (!out) return 0u; + uint32_t len = static_cast(strlen(out)); + if (len > bufMax) len = bufMax; + memcpy(buf, out, len); + free(out); + return len; + } catch (const std::exception&) { return 0u; } + }, + lower, upper, lower_inc, upper_inc, + outBuf.getContent(), nautilus::val(MAX_LEN)); + VarVal(actualLen).writeToMemory(outBuf.getReference()); + return outBuf; +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterFloatspanMakePhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size()==4, + "FloatspanMakePhysicalFunction requires 4 children but got {}", + arguments.childFunctions.size()); + return FloatspanMakePhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/FloatspanUpperIncPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/FloatspanUpperIncPhysicalFunction.cpp new file mode 100644 index 0000000000..7934b149f3 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/FloatspanUpperIncPhysicalFunction.cpp @@ -0,0 +1,69 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +} +#include +#include + +namespace NES { + +FloatspanUpperIncPhysicalFunction::FloatspanUpperIncPhysicalFunction(PhysicalFunction sp) { + paramFns.reserve(1); + paramFns.push_back(std::move(sp)); +} + +VarVal FloatspanUpperIncPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { + auto sp = paramFns[0].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](const char* w, uint32_t wsz) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string s(w, wsz); + Span* sp = floatspan_in(s.c_str()); + if (!sp) return 0.0; + bool r = span_upper_inc(sp); + free(sp); + return r ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + sp); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterFloatspanUpperIncPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size()==1, + "FloatspanUpperIncPhysicalFunction requires 1 children but got {}", + arguments.childFunctions.size()); + return FloatspanUpperIncPhysicalFunction( + std::move(arguments.childFunctions[0])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/FloatspanUpperPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/FloatspanUpperPhysicalFunction.cpp new file mode 100644 index 0000000000..6bd7454ea6 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/FloatspanUpperPhysicalFunction.cpp @@ -0,0 +1,69 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +} +#include +#include + +namespace NES { + +FloatspanUpperPhysicalFunction::FloatspanUpperPhysicalFunction(PhysicalFunction sp) { + paramFns.reserve(1); + paramFns.push_back(std::move(sp)); +} + +VarVal FloatspanUpperPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { + auto sp = paramFns[0].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](const char* w, uint32_t wsz) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string s(w, wsz); + Span* sp = floatspan_in(s.c_str()); + if (!sp) return 0.0; + double r = (double)floatspan_upper(sp); + free(sp); + return r; + } catch (const std::exception&) { return 0.0; } + }, + sp); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterFloatspanUpperPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size()==1, + "FloatspanUpperPhysicalFunction requires 1 children but got {}", + arguments.childFunctions.size()); + return FloatspanUpperPhysicalFunction( + std::move(arguments.childFunctions[0])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/FloatspanWidthPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/FloatspanWidthPhysicalFunction.cpp new file mode 100644 index 0000000000..fb3ce36657 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/FloatspanWidthPhysicalFunction.cpp @@ -0,0 +1,69 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +} +#include +#include + +namespace NES { + +FloatspanWidthPhysicalFunction::FloatspanWidthPhysicalFunction(PhysicalFunction sp) { + paramFns.reserve(1); + paramFns.push_back(std::move(sp)); +} + +VarVal FloatspanWidthPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { + auto sp = paramFns[0].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](const char* w, uint32_t wsz) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string s(w, wsz); + Span* sp = floatspan_in(s.c_str()); + if (!sp) return 0.0; + double r = (double)floatspan_width(sp); + free(sp); + return r; + } catch (const std::exception&) { return 0.0; } + }, + sp); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterFloatspanWidthPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size()==1, + "FloatspanWidthPhysicalFunction requires 1 children but got {}", + arguments.childFunctions.size()); + return FloatspanWidthPhysicalFunction( + std::move(arguments.childFunctions[0])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/IntspanLowerIncPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/IntspanLowerIncPhysicalFunction.cpp new file mode 100644 index 0000000000..f8292f7447 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/IntspanLowerIncPhysicalFunction.cpp @@ -0,0 +1,69 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +} +#include +#include + +namespace NES { + +IntspanLowerIncPhysicalFunction::IntspanLowerIncPhysicalFunction(PhysicalFunction sp) { + paramFns.reserve(1); + paramFns.push_back(std::move(sp)); +} + +VarVal IntspanLowerIncPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { + auto sp = paramFns[0].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](const char* w, uint32_t wsz) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string s(w, wsz); + Span* sp = intspan_in(s.c_str()); + if (!sp) return 0.0; + bool r = span_lower_inc(sp); + free(sp); + return r ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + sp); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterIntspanLowerIncPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size()==1, + "IntspanLowerIncPhysicalFunction requires 1 children but got {}", + arguments.childFunctions.size()); + return IntspanLowerIncPhysicalFunction( + std::move(arguments.childFunctions[0])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/IntspanLowerPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/IntspanLowerPhysicalFunction.cpp new file mode 100644 index 0000000000..8d30564a7f --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/IntspanLowerPhysicalFunction.cpp @@ -0,0 +1,69 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +} +#include +#include + +namespace NES { + +IntspanLowerPhysicalFunction::IntspanLowerPhysicalFunction(PhysicalFunction sp) { + paramFns.reserve(1); + paramFns.push_back(std::move(sp)); +} + +VarVal IntspanLowerPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { + auto sp = paramFns[0].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](const char* w, uint32_t wsz) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string s(w, wsz); + Span* sp = intspan_in(s.c_str()); + if (!sp) return 0.0; + double r = (double)intspan_lower(sp); + free(sp); + return r; + } catch (const std::exception&) { return 0.0; } + }, + sp); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterIntspanLowerPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size()==1, + "IntspanLowerPhysicalFunction requires 1 children but got {}", + arguments.childFunctions.size()); + return IntspanLowerPhysicalFunction( + std::move(arguments.childFunctions[0])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/IntspanMakePhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/IntspanMakePhysicalFunction.cpp new file mode 100644 index 0000000000..5e3639c235 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/IntspanMakePhysicalFunction.cpp @@ -0,0 +1,88 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +} +#include +#include + +namespace NES { + +IntspanMakePhysicalFunction::IntspanMakePhysicalFunction(PhysicalFunction lower, PhysicalFunction upper, PhysicalFunction lower_inc, PhysicalFunction upper_inc) { + paramFns.reserve(4); + paramFns.push_back(std::move(lower)); + paramFns.push_back(std::move(upper)); + paramFns.push_back(std::move(lower_inc)); + paramFns.push_back(std::move(upper_inc)); +} + +VarVal IntspanMakePhysicalFunction::execute(const Record& record, ArenaRef& arena) const { + auto lower = paramFns[0].execute(record, arena).cast(); + auto upper = paramFns[1].execute(record, arena).cast(); + auto lower_inc = paramFns[2].execute(record, arena).cast(); + auto upper_inc = paramFns[3].execute(record, arena).cast(); + constexpr uint32_t MAX_LEN = 64; + auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); + const auto actualLen = nautilus::invoke( + +[](double lo, double hi, double lo_inc, double hi_inc, + char* buf, uint32_t bufMax) -> uint32_t { + try { + MEOS::Meos::ensureMeosInitialized(); + Span* sp = intspan_make((int)lo, (int)hi, + lo_inc != 0.0, hi_inc != 0.0); + if (!sp) return 0u; + char* out = intspan_out(sp); + free(sp); + if (!out) return 0u; + uint32_t len = static_cast(strlen(out)); + if (len > bufMax) len = bufMax; + memcpy(buf, out, len); + free(out); + return len; + } catch (const std::exception&) { return 0u; } + }, + lower, upper, lower_inc, upper_inc, + outBuf.getContent(), nautilus::val(MAX_LEN)); + VarVal(actualLen).writeToMemory(outBuf.getReference()); + return outBuf; +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterIntspanMakePhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size()==4, + "IntspanMakePhysicalFunction requires 4 children but got {}", + arguments.childFunctions.size()); + return IntspanMakePhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/IntspanUpperIncPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/IntspanUpperIncPhysicalFunction.cpp new file mode 100644 index 0000000000..db8019ddd3 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/IntspanUpperIncPhysicalFunction.cpp @@ -0,0 +1,69 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +} +#include +#include + +namespace NES { + +IntspanUpperIncPhysicalFunction::IntspanUpperIncPhysicalFunction(PhysicalFunction sp) { + paramFns.reserve(1); + paramFns.push_back(std::move(sp)); +} + +VarVal IntspanUpperIncPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { + auto sp = paramFns[0].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](const char* w, uint32_t wsz) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string s(w, wsz); + Span* sp = intspan_in(s.c_str()); + if (!sp) return 0.0; + bool r = span_upper_inc(sp); + free(sp); + return r ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + sp); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterIntspanUpperIncPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size()==1, + "IntspanUpperIncPhysicalFunction requires 1 children but got {}", + arguments.childFunctions.size()); + return IntspanUpperIncPhysicalFunction( + std::move(arguments.childFunctions[0])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/IntspanUpperPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/IntspanUpperPhysicalFunction.cpp new file mode 100644 index 0000000000..525d717bb5 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/IntspanUpperPhysicalFunction.cpp @@ -0,0 +1,69 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +} +#include +#include + +namespace NES { + +IntspanUpperPhysicalFunction::IntspanUpperPhysicalFunction(PhysicalFunction sp) { + paramFns.reserve(1); + paramFns.push_back(std::move(sp)); +} + +VarVal IntspanUpperPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { + auto sp = paramFns[0].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](const char* w, uint32_t wsz) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string s(w, wsz); + Span* sp = intspan_in(s.c_str()); + if (!sp) return 0.0; + double r = (double)intspan_upper(sp); + free(sp); + return r; + } catch (const std::exception&) { return 0.0; } + }, + sp); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterIntspanUpperPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size()==1, + "IntspanUpperPhysicalFunction requires 1 children but got {}", + arguments.childFunctions.size()); + return IntspanUpperPhysicalFunction( + std::move(arguments.childFunctions[0])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/IntspanWidthPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/IntspanWidthPhysicalFunction.cpp new file mode 100644 index 0000000000..f869f833f1 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/IntspanWidthPhysicalFunction.cpp @@ -0,0 +1,69 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +} +#include +#include + +namespace NES { + +IntspanWidthPhysicalFunction::IntspanWidthPhysicalFunction(PhysicalFunction sp) { + paramFns.reserve(1); + paramFns.push_back(std::move(sp)); +} + +VarVal IntspanWidthPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { + auto sp = paramFns[0].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](const char* w, uint32_t wsz) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string s(w, wsz); + Span* sp = intspan_in(s.c_str()); + if (!sp) return 0.0; + double r = (double)intspan_width(sp); + free(sp); + return r; + } catch (const std::exception&) { return 0.0; } + }, + sp); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterIntspanWidthPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size()==1, + "IntspanWidthPhysicalFunction requires 1 children but got {}", + arguments.childFunctions.size()); + return IntspanWidthPhysicalFunction( + std::move(arguments.childFunctions[0])); +} + +} // namespace NES diff --git a/nes-sql-parser/AntlrSQL.g4 b/nes-sql-parser/AntlrSQL.g4 index 4d24658974..e1fb415e06 100644 --- a/nes-sql-parser/AntlrSQL.g4 +++ b/nes-sql-parser/AntlrSQL.g4 @@ -295,7 +295,7 @@ timeUnit: MS timestampParameter: name=identifier; -functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT | TGE_TTEXT_TEXT | TGE_TEXT_TTEXT | TGT_TTEXT_TEXT | TGT_TEXT_TTEXT | TLE_TTEXT_TEXT | TLE_TEXT_TTEXT | TLT_TTEXT_TEXT | TLT_TEXT_TTEXT | TTEXT_UPPER | TTEXT_LOWER | TTEXT_INITCAP | TEXTCAT_TTEXT_TEXT | TEXTCAT_TEXT_TTEXT | TEXTCAT_TTEXT_TTEXT | GEOM_LENGTH | GEOM_PERIMETER | GEOM_AZIMUTH | GEOG_AREA | GEOG_LENGTH | GEOG_PERIMETER | GEOM_IS_EMPTY | AINTERSECTS_TGEO_GEO | ACOVERS_TGEO_GEO | ADISJOINT_TGEO_GEO | ADWITHIN_TGEO_GEO | EINTERSECTS_TGEO_GEO | ETOUCHES_TGEO_GEO | ECONTAINS_TGEO_GEO | ACONTAINS_TGEO_GEO | ATOUCHES_TGEO_GEO | GEO_NUM_POINTS | GEO_NUM_GEOS | GEO_SRID | GEO_IS_UNITARY | GEO_EQUALS | GEO_SAME | GEOG_DISTANCE | NAD_TGEO_GEO | EVER_EQ_TGEO_GEO | EVER_NE_TGEO_GEO | ALWAYS_EQ_TGEO_GEO | ALWAYS_NE_TGEO_GEO | GEOG_INTERSECTS | GEOG_DWITHIN | ACOVERS_GEO_TGEO | GEOM_INTERSECTS | GEOM_DWITHIN | H3_GS_POINT_TO_CELL | EVER_EQ_TH3INDEX_H3INDEX | EVER_NE_TH3INDEX_H3INDEX | ALWAYS_EQ_TH3INDEX_H3INDEX | ALWAYS_NE_TH3INDEX_H3INDEX | TH3INDEX_GET_RESOLUTION | TH3INDEX_GET_BASE_CELL_NUMBER | TH3INDEX_IS_VALID_CELL | TH3INDEX_IS_PENTAGON | TH3INDEX_CELL_TO_PARENT_NEXT | TH3INDEX_CELL_TO_CENTER_CHILD_NEXT | TH3INDEX_CELL_TO_PARENT | TH3INDEX_CELL_TO_CENTER_CHILD | TH3INDEX_CELL_TO_CHILD_POS | TH3INDEX_ARE_NEIGHBOR_CELLS | TH3INDEX_GRID_DISTANCE | EINTERSECTS_TCBUFFER_GEO | AINTERSECTS_TCBUFFER_GEO | ECOVERS_TCBUFFER_GEO | ACOVERS_TCBUFFER_GEO | EDISJOINT_TCBUFFER_GEO | ADISJOINT_TCBUFFER_GEO | ETOUCHES_TCBUFFER_GEO | ATOUCHES_TCBUFFER_GEO | ECONTAINS_TCBUFFER_GEO | ACONTAINS_TCBUFFER_GEO | NAD_TCBUFFER_GEO | EDWITHIN_TCBUFFER_GEO | ADWITHIN_TCBUFFER_GEO | EINTERSECTS_TCBUFFER_CBUFFER | AINTERSECTS_TCBUFFER_CBUFFER | ECOVERS_TCBUFFER_CBUFFER | ACOVERS_TCBUFFER_CBUFFER | EDISJOINT_TCBUFFER_CBUFFER | ADISJOINT_TCBUFFER_CBUFFER | ETOUCHES_TCBUFFER_CBUFFER | ATOUCHES_TCBUFFER_CBUFFER | ECONTAINS_TCBUFFER_CBUFFER | ACONTAINS_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_CBUFFER | ALWAYS_EQ_TCBUFFER_CBUFFER | EVER_NE_TCBUFFER_CBUFFER | ALWAYS_NE_TCBUFFER_CBUFFER | NAD_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_TCBUFFER | ALWAYS_EQ_TCBUFFER_TCBUFFER | EVER_NE_TCBUFFER_TCBUFFER | ALWAYS_NE_TCBUFFER_TCBUFFER | EINTERSECTS_TCBUFFER_TCBUFFER | AINTERSECTS_TCBUFFER_TCBUFFER | ECOVERS_TCBUFFER_TCBUFFER | ACOVERS_TCBUFFER_TCBUFFER | ADISJOINT_TCBUFFER_TCBUFFER | ETOUCHES_TCBUFFER_TCBUFFER | ATOUCHES_TCBUFFER_TCBUFFER | NAD_TCBUFFER_TCBUFFER | EDWITHIN_TCBUFFER_TCBUFFER | ADWITHIN_TCBUFFER_TCBUFFER | MINDISTANCE_TCBUFFER_TCBUFFER | NAD_TNPOINT_GEO | EVER_EQ_TNPOINT_NPOINT | ALWAYS_EQ_TNPOINT_NPOINT | EVER_NE_TNPOINT_NPOINT | ALWAYS_NE_TNPOINT_NPOINT | NAD_TNPOINT_NPOINT | EVER_EQ_NPOINT_TNPOINT | ALWAYS_EQ_NPOINT_TNPOINT | EVER_NE_NPOINT_TNPOINT | ALWAYS_NE_NPOINT_TNPOINT | EVER_EQ_TNPOINT_TNPOINT | ALWAYS_EQ_TNPOINT_TNPOINT | EVER_NE_TNPOINT_TNPOINT | ALWAYS_NE_TNPOINT_TNPOINT | NAD_TNPOINT_TNPOINT | NAD_TPOSE_GEO | EVER_EQ_TPOSE_POSE | ALWAYS_EQ_TPOSE_POSE | EVER_NE_TPOSE_POSE | ALWAYS_NE_TPOSE_POSE | NAD_TPOSE_POSE | EVER_EQ_POSE_TPOSE | ALWAYS_EQ_POSE_TPOSE | EVER_NE_POSE_TPOSE | ALWAYS_NE_POSE_TPOSE | EVER_EQ_TPOSE_TPOSE | ALWAYS_EQ_TPOSE_TPOSE | EVER_NE_TPOSE_TPOSE | ALWAYS_NE_TPOSE_TPOSE | NAD_TPOSE_TPOSE | EVER_EQ_TRGEOMETRY_GEO | ALWAYS_EQ_TRGEOMETRY_GEO | EVER_NE_TRGEOMETRY_GEO | ALWAYS_NE_TRGEOMETRY_GEO | NAD_TRGEOMETRY_GEO | EVER_EQ_GEO_TRGEOMETRY | ALWAYS_EQ_GEO_TRGEOMETRY | EVER_NE_GEO_TRGEOMETRY | ALWAYS_NE_GEO_TRGEOMETRY | EVER_EQ_TRGEOMETRY_TRGEOMETRY | ALWAYS_EQ_TRGEOMETRY_TRGEOMETRY | EVER_NE_TRGEOMETRY_TRGEOMETRY | ALWAYS_NE_TRGEOMETRY_TRGEOMETRY | NAD_TRGEOMETRY_TRGEOMETRY | EINTERSECTS_TPCPOINT_GEO | NAD_TPCPOINT_GEO | QUADBIN_POINT_TO_CELL | QUADBIN_IS_VALID_CELL | QUADBIN_GET_RESOLUTION | QUADBIN_CELL_AREA | QUADBIN_CELL_TO_QUADKEY | QUADBIN_CELL_TO_PARENT | QUADBIN_TILE_TO_CELL | EVER_EQ_TJSONB_JSONB | ALWAYS_EQ_TJSONB_JSONB | EVER_NE_TJSONB_JSONB | ALWAYS_NE_TJSONB_JSONB | EVER_EQ_TJSONB_TJSONB | ALWAYS_EQ_TJSONB_TJSONB | EVER_NE_TJSONB_TJSONB | ALWAYS_NE_TJSONB_TJSONB | GEOM_BOUNDARY | GEOM_CENTROID | GEOM_CONVEX_HULL | GEO_REVERSE | GEO_POINTS | GEOM_UNARY_UNION | GEOM_DIFFERENCE2D | GEOM_INTERSECTION2D | GEOM_SHORTESTLINE2D | GEOM_SHORTESTLINE3D | GEO_SET_SRID | GEO_TRANSFORM | GEO_ROUND | GEOM_BUFFER | LINE_NUMPOINTS | LINE_LOCATE_POINT | LINE_INTERPOLATE_POINT | LINE_SUBSTRING | GEOM_POINT_MAKE2D | GEOM_POINT_MAKE3DZ | GEOG_POINT_MAKE2D | GEOG_POINT_MAKE3DZ | GEOM_TO_GEOG | GEOG_TO_GEOM | GEOG_CENTROID | GEO_GEO_N | LINE_POINT_N | GEOM_INTERSECTION2D_COLL | GEO_AS_GEOJSON | GEO_AS_HEXEWKB | GEO_AS_EWKT | GEO_FROM_GEOJSON | GEOM_FROM_HEXEWKB | GEO_TRANSFORM_PIPELINE | GEOM_MIN_BOUNDING_CENTER | GEOM_MIN_BOUNDING_RADIUS | EVER_EQ_TGEO_TGEO | EVER_NE_TGEO_TGEO | ALWAYS_EQ_TGEO_TGEO | ALWAYS_NE_TGEO_TGEO | EINTERSECTS_TGEO_TGEO | ECOVERS_TGEO_TGEO | EDISJOINT_TGEO_TGEO | ECONTAINS_TGEO_TGEO | ETOUCHES_TGEO_TGEO | AINTERSECTS_TGEO_TGEO | ACOVERS_TGEO_TGEO | ADISJOINT_TGEO_TGEO | ACONTAINS_TGEO_TGEO | ATOUCHES_TGEO_TGEO | EDWITHIN_TGEO_TGEO | ADWITHIN_TGEO_TGEO | H3INDEX_EQ | H3INDEX_NE | H3INDEX_LT | H3INDEX_LE | H3INDEX_GT | H3INDEX_GE | H3INDEX_CMP | H3INDEX_OUT | H3INDEX_IN | JSON_ARRAY_LENGTH | JSON_TYPEOF | JSON_OBJECT_FIELD_TEXT | JSON_ARRAY_ELEMENT_TEXT | JSONB_ARRAY_LENGTH | JSONB_EQ | JSONB_NE | JSONB_LT | JSONB_LE | JSONB_GT | JSONB_GE | JSONB_CMP | JSONB_CONTAINS | JSONB_CONTAINED | JSONB_EXISTS | JSONB_TO_CSTRING | JSONB_PRETTY | JSONB_OBJECT_FIELD_TEXT | JSONB_ARRAY_ELEMENT_TEXT | GEOM_RELATE_PATTERN | GEOM_INTERSECTS2D | GEOM_DWITHIN2D | GEOM_CONTAINS | GEOM_DISJOINT2D | GEOM_COVERS | GEOM_TOUCHES | GEOM_INTERSECTS3D | GEOM_DWITHIN3D | GEOM_DISTANCE2D | GEOM_DISTANCE3D; +functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT | TGE_TTEXT_TEXT | TGE_TEXT_TTEXT | TGT_TTEXT_TEXT | TGT_TEXT_TTEXT | TLE_TTEXT_TEXT | TLE_TEXT_TTEXT | TLT_TTEXT_TEXT | TLT_TEXT_TTEXT | TTEXT_UPPER | TTEXT_LOWER | TTEXT_INITCAP | TEXTCAT_TTEXT_TEXT | TEXTCAT_TEXT_TTEXT | TEXTCAT_TTEXT_TTEXT | GEOM_LENGTH | GEOM_PERIMETER | GEOM_AZIMUTH | GEOG_AREA | GEOG_LENGTH | GEOG_PERIMETER | GEOM_IS_EMPTY | AINTERSECTS_TGEO_GEO | ACOVERS_TGEO_GEO | ADISJOINT_TGEO_GEO | ADWITHIN_TGEO_GEO | EINTERSECTS_TGEO_GEO | ETOUCHES_TGEO_GEO | ECONTAINS_TGEO_GEO | ACONTAINS_TGEO_GEO | ATOUCHES_TGEO_GEO | GEO_NUM_POINTS | GEO_NUM_GEOS | GEO_SRID | GEO_IS_UNITARY | GEO_EQUALS | GEO_SAME | GEOG_DISTANCE | NAD_TGEO_GEO | EVER_EQ_TGEO_GEO | EVER_NE_TGEO_GEO | ALWAYS_EQ_TGEO_GEO | ALWAYS_NE_TGEO_GEO | GEOG_INTERSECTS | GEOG_DWITHIN | ACOVERS_GEO_TGEO | GEOM_INTERSECTS | GEOM_DWITHIN | H3_GS_POINT_TO_CELL | EVER_EQ_TH3INDEX_H3INDEX | EVER_NE_TH3INDEX_H3INDEX | ALWAYS_EQ_TH3INDEX_H3INDEX | ALWAYS_NE_TH3INDEX_H3INDEX | TH3INDEX_GET_RESOLUTION | TH3INDEX_GET_BASE_CELL_NUMBER | TH3INDEX_IS_VALID_CELL | TH3INDEX_IS_PENTAGON | TH3INDEX_CELL_TO_PARENT_NEXT | TH3INDEX_CELL_TO_CENTER_CHILD_NEXT | TH3INDEX_CELL_TO_PARENT | TH3INDEX_CELL_TO_CENTER_CHILD | TH3INDEX_CELL_TO_CHILD_POS | TH3INDEX_ARE_NEIGHBOR_CELLS | TH3INDEX_GRID_DISTANCE | EINTERSECTS_TCBUFFER_GEO | AINTERSECTS_TCBUFFER_GEO | ECOVERS_TCBUFFER_GEO | ACOVERS_TCBUFFER_GEO | EDISJOINT_TCBUFFER_GEO | ADISJOINT_TCBUFFER_GEO | ETOUCHES_TCBUFFER_GEO | ATOUCHES_TCBUFFER_GEO | ECONTAINS_TCBUFFER_GEO | ACONTAINS_TCBUFFER_GEO | NAD_TCBUFFER_GEO | EDWITHIN_TCBUFFER_GEO | ADWITHIN_TCBUFFER_GEO | EINTERSECTS_TCBUFFER_CBUFFER | AINTERSECTS_TCBUFFER_CBUFFER | ECOVERS_TCBUFFER_CBUFFER | ACOVERS_TCBUFFER_CBUFFER | EDISJOINT_TCBUFFER_CBUFFER | ADISJOINT_TCBUFFER_CBUFFER | ETOUCHES_TCBUFFER_CBUFFER | ATOUCHES_TCBUFFER_CBUFFER | ECONTAINS_TCBUFFER_CBUFFER | ACONTAINS_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_CBUFFER | ALWAYS_EQ_TCBUFFER_CBUFFER | EVER_NE_TCBUFFER_CBUFFER | ALWAYS_NE_TCBUFFER_CBUFFER | NAD_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_TCBUFFER | ALWAYS_EQ_TCBUFFER_TCBUFFER | EVER_NE_TCBUFFER_TCBUFFER | ALWAYS_NE_TCBUFFER_TCBUFFER | EINTERSECTS_TCBUFFER_TCBUFFER | AINTERSECTS_TCBUFFER_TCBUFFER | ECOVERS_TCBUFFER_TCBUFFER | ACOVERS_TCBUFFER_TCBUFFER | ADISJOINT_TCBUFFER_TCBUFFER | ETOUCHES_TCBUFFER_TCBUFFER | ATOUCHES_TCBUFFER_TCBUFFER | NAD_TCBUFFER_TCBUFFER | EDWITHIN_TCBUFFER_TCBUFFER | ADWITHIN_TCBUFFER_TCBUFFER | MINDISTANCE_TCBUFFER_TCBUFFER | NAD_TNPOINT_GEO | EVER_EQ_TNPOINT_NPOINT | ALWAYS_EQ_TNPOINT_NPOINT | EVER_NE_TNPOINT_NPOINT | ALWAYS_NE_TNPOINT_NPOINT | NAD_TNPOINT_NPOINT | EVER_EQ_NPOINT_TNPOINT | ALWAYS_EQ_NPOINT_TNPOINT | EVER_NE_NPOINT_TNPOINT | ALWAYS_NE_NPOINT_TNPOINT | EVER_EQ_TNPOINT_TNPOINT | ALWAYS_EQ_TNPOINT_TNPOINT | EVER_NE_TNPOINT_TNPOINT | ALWAYS_NE_TNPOINT_TNPOINT | NAD_TNPOINT_TNPOINT | NAD_TPOSE_GEO | EVER_EQ_TPOSE_POSE | ALWAYS_EQ_TPOSE_POSE | EVER_NE_TPOSE_POSE | ALWAYS_NE_TPOSE_POSE | NAD_TPOSE_POSE | EVER_EQ_POSE_TPOSE | ALWAYS_EQ_POSE_TPOSE | EVER_NE_POSE_TPOSE | ALWAYS_NE_POSE_TPOSE | EVER_EQ_TPOSE_TPOSE | ALWAYS_EQ_TPOSE_TPOSE | EVER_NE_TPOSE_TPOSE | ALWAYS_NE_TPOSE_TPOSE | NAD_TPOSE_TPOSE | EVER_EQ_TRGEOMETRY_GEO | ALWAYS_EQ_TRGEOMETRY_GEO | EVER_NE_TRGEOMETRY_GEO | ALWAYS_NE_TRGEOMETRY_GEO | NAD_TRGEOMETRY_GEO | EVER_EQ_GEO_TRGEOMETRY | ALWAYS_EQ_GEO_TRGEOMETRY | EVER_NE_GEO_TRGEOMETRY | ALWAYS_NE_GEO_TRGEOMETRY | EVER_EQ_TRGEOMETRY_TRGEOMETRY | ALWAYS_EQ_TRGEOMETRY_TRGEOMETRY | EVER_NE_TRGEOMETRY_TRGEOMETRY | ALWAYS_NE_TRGEOMETRY_TRGEOMETRY | NAD_TRGEOMETRY_TRGEOMETRY | EINTERSECTS_TPCPOINT_GEO | NAD_TPCPOINT_GEO | QUADBIN_POINT_TO_CELL | QUADBIN_IS_VALID_CELL | QUADBIN_GET_RESOLUTION | QUADBIN_CELL_AREA | QUADBIN_CELL_TO_QUADKEY | QUADBIN_CELL_TO_PARENT | QUADBIN_TILE_TO_CELL | EVER_EQ_TJSONB_JSONB | ALWAYS_EQ_TJSONB_JSONB | EVER_NE_TJSONB_JSONB | ALWAYS_NE_TJSONB_JSONB | EVER_EQ_TJSONB_TJSONB | ALWAYS_EQ_TJSONB_TJSONB | EVER_NE_TJSONB_TJSONB | ALWAYS_NE_TJSONB_TJSONB | GEOM_BOUNDARY | GEOM_CENTROID | GEOM_CONVEX_HULL | GEO_REVERSE | GEO_POINTS | GEOM_UNARY_UNION | GEOM_DIFFERENCE2D | GEOM_INTERSECTION2D | GEOM_SHORTESTLINE2D | GEOM_SHORTESTLINE3D | GEO_SET_SRID | GEO_TRANSFORM | GEO_ROUND | GEOM_BUFFER | LINE_NUMPOINTS | LINE_LOCATE_POINT | LINE_INTERPOLATE_POINT | LINE_SUBSTRING | GEOM_POINT_MAKE2D | GEOM_POINT_MAKE3DZ | GEOG_POINT_MAKE2D | GEOG_POINT_MAKE3DZ | GEOM_TO_GEOG | GEOG_TO_GEOM | GEOG_CENTROID | GEO_GEO_N | LINE_POINT_N | GEOM_INTERSECTION2D_COLL | GEO_AS_GEOJSON | GEO_AS_HEXEWKB | GEO_AS_EWKT | GEO_FROM_GEOJSON | GEOM_FROM_HEXEWKB | GEO_TRANSFORM_PIPELINE | GEOM_MIN_BOUNDING_CENTER | GEOM_MIN_BOUNDING_RADIUS | EVER_EQ_TGEO_TGEO | EVER_NE_TGEO_TGEO | ALWAYS_EQ_TGEO_TGEO | ALWAYS_NE_TGEO_TGEO | EINTERSECTS_TGEO_TGEO | ECOVERS_TGEO_TGEO | EDISJOINT_TGEO_TGEO | ECONTAINS_TGEO_TGEO | ETOUCHES_TGEO_TGEO | AINTERSECTS_TGEO_TGEO | ACOVERS_TGEO_TGEO | ADISJOINT_TGEO_TGEO | ACONTAINS_TGEO_TGEO | ATOUCHES_TGEO_TGEO | EDWITHIN_TGEO_TGEO | ADWITHIN_TGEO_TGEO | H3INDEX_EQ | H3INDEX_NE | H3INDEX_LT | H3INDEX_LE | H3INDEX_GT | H3INDEX_GE | H3INDEX_CMP | H3INDEX_OUT | H3INDEX_IN | JSON_ARRAY_LENGTH | JSON_TYPEOF | JSON_OBJECT_FIELD_TEXT | JSON_ARRAY_ELEMENT_TEXT | JSONB_ARRAY_LENGTH | JSONB_EQ | JSONB_NE | JSONB_LT | JSONB_LE | JSONB_GT | JSONB_GE | JSONB_CMP | JSONB_CONTAINS | JSONB_CONTAINED | JSONB_EXISTS | JSONB_TO_CSTRING | JSONB_PRETTY | JSONB_OBJECT_FIELD_TEXT | JSONB_ARRAY_ELEMENT_TEXT | INTSPAN_MAKE | FLOATSPAN_MAKE | INTSPAN_LOWER | INTSPAN_UPPER | INTSPAN_WIDTH | INTSPAN_LOWER_INC | INTSPAN_UPPER_INC | FLOATSPAN_LOWER | FLOATSPAN_UPPER | FLOATSPAN_WIDTH | FLOATSPAN_LOWER_INC | FLOATSPAN_UPPER_INC | GEOM_RELATE_PATTERN | GEOM_INTERSECTS2D | GEOM_DWITHIN2D | GEOM_CONTAINS | GEOM_DISJOINT2D | GEOM_COVERS | GEOM_TOUCHES | GEOM_INTERSECTS3D | GEOM_DWITHIN3D | GEOM_DISTANCE2D | GEOM_DISTANCE3D; sinkClause: INTO sink (',' sink)*; @@ -991,6 +991,18 @@ JSONB_TO_CSTRING: 'JSONB_TO_CSTRING' | 'jsonb_to_cstring'; JSONB_PRETTY: 'JSONB_PRETTY' | 'jsonb_pretty'; JSONB_OBJECT_FIELD_TEXT: 'JSONB_OBJECT_FIELD_TEXT' | 'jsonb_object_field_text'; JSONB_ARRAY_ELEMENT_TEXT: 'JSONB_ARRAY_ELEMENT_TEXT' | 'jsonb_array_element_text'; +INTSPAN_MAKE: 'INTSPAN_MAKE' | 'intspan_make'; +FLOATSPAN_MAKE: 'FLOATSPAN_MAKE' | 'floatspan_make'; +INTSPAN_LOWER: 'INTSPAN_LOWER' | 'intspan_lower'; +INTSPAN_UPPER: 'INTSPAN_UPPER' | 'intspan_upper'; +INTSPAN_WIDTH: 'INTSPAN_WIDTH' | 'intspan_width'; +INTSPAN_LOWER_INC: 'INTSPAN_LOWER_INC' | 'intspan_lower_inc'; +INTSPAN_UPPER_INC: 'INTSPAN_UPPER_INC' | 'intspan_upper_inc'; +FLOATSPAN_LOWER: 'FLOATSPAN_LOWER' | 'floatspan_lower'; +FLOATSPAN_UPPER: 'FLOATSPAN_UPPER' | 'floatspan_upper'; +FLOATSPAN_WIDTH: 'FLOATSPAN_WIDTH' | 'floatspan_width'; +FLOATSPAN_LOWER_INC: 'FLOATSPAN_LOWER_INC' | 'floatspan_lower_inc'; +FLOATSPAN_UPPER_INC: 'FLOATSPAN_UPPER_INC' | 'floatspan_upper_inc'; GEOM_RELATE_PATTERN: 'GEOM_RELATE_PATTERN' | 'geom_relate_pattern'; GEOM_INTERSECTS2D: 'GEOM_INTERSECTS2D' | 'geom_intersects2d'; GEOM_DWITHIN2D: 'GEOM_DWITHIN2D' | 'geom_dwithin2d'; diff --git a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp index 6e894aefd2..dabc2a9ce9 100644 --- a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp +++ b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp @@ -572,6 +572,18 @@ #include #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include @@ -11626,6 +11638,108 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont return LogicalFunction(JsonbArrayElementTextLogicalFunction(std::move(arg0), std::move(arg1))); } /* END CODEGEN PARSER GLUE: JSONB_ARRAY_ELEMENT_TEXT */ + case AntlrSQLParser::INTSPAN_MAKE: { + PRECONDITION(ctx->functionParam().size() == 4, + "IntspanMake requires 4 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + return LogicalFunction(IntspanMakeLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3))); + } + /* END CODEGEN PARSER GLUE: INTSPAN_MAKE */ + case AntlrSQLParser::FLOATSPAN_MAKE: { + PRECONDITION(ctx->functionParam().size() == 4, + "FloatspanMake requires 4 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + return LogicalFunction(FloatspanMakeLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3))); + } + /* END CODEGEN PARSER GLUE: FLOATSPAN_MAKE */ + case AntlrSQLParser::INTSPAN_LOWER: { + PRECONDITION(ctx->functionParam().size() == 1, + "IntspanLower requires 1 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + return LogicalFunction(IntspanLowerLogicalFunction(std::move(arg0))); + } + /* END CODEGEN PARSER GLUE: INTSPAN_LOWER */ + case AntlrSQLParser::INTSPAN_UPPER: { + PRECONDITION(ctx->functionParam().size() == 1, + "IntspanUpper requires 1 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + return LogicalFunction(IntspanUpperLogicalFunction(std::move(arg0))); + } + /* END CODEGEN PARSER GLUE: INTSPAN_UPPER */ + case AntlrSQLParser::INTSPAN_WIDTH: { + PRECONDITION(ctx->functionParam().size() == 1, + "IntspanWidth requires 1 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + return LogicalFunction(IntspanWidthLogicalFunction(std::move(arg0))); + } + /* END CODEGEN PARSER GLUE: INTSPAN_WIDTH */ + case AntlrSQLParser::INTSPAN_LOWER_INC: { + PRECONDITION(ctx->functionParam().size() == 1, + "IntspanLowerInc requires 1 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + return LogicalFunction(IntspanLowerIncLogicalFunction(std::move(arg0))); + } + /* END CODEGEN PARSER GLUE: INTSPAN_LOWER_INC */ + case AntlrSQLParser::INTSPAN_UPPER_INC: { + PRECONDITION(ctx->functionParam().size() == 1, + "IntspanUpperInc requires 1 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + return LogicalFunction(IntspanUpperIncLogicalFunction(std::move(arg0))); + } + /* END CODEGEN PARSER GLUE: INTSPAN_UPPER_INC */ + case AntlrSQLParser::FLOATSPAN_LOWER: { + PRECONDITION(ctx->functionParam().size() == 1, + "FloatspanLower requires 1 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + return LogicalFunction(FloatspanLowerLogicalFunction(std::move(arg0))); + } + /* END CODEGEN PARSER GLUE: FLOATSPAN_LOWER */ + case AntlrSQLParser::FLOATSPAN_UPPER: { + PRECONDITION(ctx->functionParam().size() == 1, + "FloatspanUpper requires 1 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + return LogicalFunction(FloatspanUpperLogicalFunction(std::move(arg0))); + } + /* END CODEGEN PARSER GLUE: FLOATSPAN_UPPER */ + case AntlrSQLParser::FLOATSPAN_WIDTH: { + PRECONDITION(ctx->functionParam().size() == 1, + "FloatspanWidth requires 1 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + return LogicalFunction(FloatspanWidthLogicalFunction(std::move(arg0))); + } + /* END CODEGEN PARSER GLUE: FLOATSPAN_WIDTH */ + case AntlrSQLParser::FLOATSPAN_LOWER_INC: { + PRECONDITION(ctx->functionParam().size() == 1, + "FloatspanLowerInc requires 1 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + return LogicalFunction(FloatspanLowerIncLogicalFunction(std::move(arg0))); + } + /* END CODEGEN PARSER GLUE: FLOATSPAN_LOWER_INC */ + case AntlrSQLParser::FLOATSPAN_UPPER_INC: { + PRECONDITION(ctx->functionParam().size() == 1, + "FloatspanUpperInc requires 1 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + return LogicalFunction(FloatspanUpperIncLogicalFunction(std::move(arg0))); + } + /* END CODEGEN PARSER GLUE: FLOATSPAN_UPPER_INC */ /* END CODEGEN PARSER GLUE: GEOM_RELATE_PATTERN */ /* END CODEGEN PARSER GLUE: GEOM_INTERSECTS2D */ case AntlrSQLParser::GEOM_DWITHIN2D: { From 0f1d4b52d2972b4c639140613aefeeb7a0b0b3b5 Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Thu, 18 Jun 2026 23:11:53 +0200 Subject: [PATCH 92/96] feat(meos): add Span predicate NES operators (W144) Wires 8 Span predicate operators: CONTAINED_INT/FLOAT_SPAN (scalar in span), CONTAINS_SPAN_INT/FLOAT (span contains scalar), and CONTAINED/CONTAINS_SPAN_SPAN for both intspan and floatspan variants. All predicates return FLOAT64 (1.0/0.0). Spans are passed as VARCHAR strings serialized by the W143 MAKE operators. New in ecosystem-pin-2026-06-18b. --- .../ContainedFloatSpanLogicalFunction.hpp | 45 +++++++++++ .../ContainedFloatspanSpanLogicalFunction.hpp | 45 +++++++++++ .../Meos/ContainedIntSpanLogicalFunction.hpp | 45 +++++++++++ .../Meos/ContainedSpanSpanLogicalFunction.hpp | 45 +++++++++++ .../ContainsFloatspanSpanLogicalFunction.hpp | 45 +++++++++++ .../Meos/ContainsSpanFloatLogicalFunction.hpp | 45 +++++++++++ .../Meos/ContainsSpanIntLogicalFunction.hpp | 45 +++++++++++ .../Meos/ContainsSpanSpanLogicalFunction.hpp | 45 +++++++++++ .../src/Functions/Meos/CMakeLists.txt | 8 ++ .../ContainedFloatSpanLogicalFunction.cpp | 75 +++++++++++++++++ .../ContainedFloatspanSpanLogicalFunction.cpp | 75 +++++++++++++++++ .../Meos/ContainedIntSpanLogicalFunction.cpp | 75 +++++++++++++++++ .../Meos/ContainedSpanSpanLogicalFunction.cpp | 75 +++++++++++++++++ .../ContainsFloatspanSpanLogicalFunction.cpp | 75 +++++++++++++++++ .../Meos/ContainsSpanFloatLogicalFunction.cpp | 75 +++++++++++++++++ .../Meos/ContainsSpanIntLogicalFunction.cpp | 75 +++++++++++++++++ .../Meos/ContainsSpanSpanLogicalFunction.cpp | 75 +++++++++++++++++ .../ContainedFloatSpanPhysicalFunction.hpp | 32 ++++++++ ...ContainedFloatspanSpanPhysicalFunction.hpp | 32 ++++++++ .../Meos/ContainedIntSpanPhysicalFunction.hpp | 32 ++++++++ .../ContainedSpanSpanPhysicalFunction.hpp | 32 ++++++++ .../ContainsFloatspanSpanPhysicalFunction.hpp | 32 ++++++++ .../ContainsSpanFloatPhysicalFunction.hpp | 32 ++++++++ .../Meos/ContainsSpanIntPhysicalFunction.hpp | 32 ++++++++ .../Meos/ContainsSpanSpanPhysicalFunction.hpp | 32 ++++++++ .../src/Functions/Meos/CMakeLists.txt | 8 ++ .../ContainedFloatSpanPhysicalFunction.cpp | 71 ++++++++++++++++ ...ContainedFloatspanSpanPhysicalFunction.cpp | 73 +++++++++++++++++ .../Meos/ContainedIntSpanPhysicalFunction.cpp | 71 ++++++++++++++++ .../ContainedSpanSpanPhysicalFunction.cpp | 73 +++++++++++++++++ .../ContainsFloatspanSpanPhysicalFunction.cpp | 73 +++++++++++++++++ .../ContainsSpanFloatPhysicalFunction.cpp | 71 ++++++++++++++++ .../Meos/ContainsSpanIntPhysicalFunction.cpp | 71 ++++++++++++++++ .../Meos/ContainsSpanSpanPhysicalFunction.cpp | 73 +++++++++++++++++ nes-sql-parser/AntlrSQL.g4 | 10 ++- .../src/AntlrSQLQueryPlanCreator.cpp | 80 +++++++++++++++++++ 36 files changed, 1897 insertions(+), 1 deletion(-) create mode 100644 nes-logical-operators/include/Functions/Meos/ContainedFloatSpanLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/ContainedFloatspanSpanLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/ContainedIntSpanLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/ContainedSpanSpanLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/ContainsFloatspanSpanLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/ContainsSpanFloatLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/ContainsSpanIntLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/ContainsSpanSpanLogicalFunction.hpp create mode 100644 nes-logical-operators/src/Functions/Meos/ContainedFloatSpanLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/ContainedFloatspanSpanLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/ContainedIntSpanLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/ContainedSpanSpanLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/ContainsFloatspanSpanLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/ContainsSpanFloatLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/ContainsSpanIntLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/ContainsSpanSpanLogicalFunction.cpp create mode 100644 nes-physical-operators/include/Functions/Meos/ContainedFloatSpanPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/ContainedFloatspanSpanPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/ContainedIntSpanPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/ContainedSpanSpanPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/ContainsFloatspanSpanPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/ContainsSpanFloatPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/ContainsSpanIntPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/ContainsSpanSpanPhysicalFunction.hpp create mode 100644 nes-physical-operators/src/Functions/Meos/ContainedFloatSpanPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/ContainedFloatspanSpanPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/ContainedIntSpanPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/ContainedSpanSpanPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/ContainsFloatspanSpanPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/ContainsSpanFloatPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/ContainsSpanIntPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/ContainsSpanSpanPhysicalFunction.cpp diff --git a/nes-logical-operators/include/Functions/Meos/ContainedFloatSpanLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/ContainedFloatSpanLogicalFunction.hpp new file mode 100644 index 0000000000..6e47083d35 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/ContainedFloatSpanLogicalFunction.hpp @@ -0,0 +1,45 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1 if the float value is contained by the float span. + */ +class ContainedFloatSpanLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "ContainedFloatSpan"; + ContainedFloatSpanLogicalFunction(LogicalFunction val, LogicalFunction sp); + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/ContainedFloatspanSpanLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/ContainedFloatspanSpanLogicalFunction.hpp new file mode 100644 index 0000000000..e1959ca467 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/ContainedFloatspanSpanLogicalFunction.hpp @@ -0,0 +1,45 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1 if float span sp1 is contained by float span sp2. + */ +class ContainedFloatspanSpanLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "ContainedFloatspanSpan"; + ContainedFloatspanSpanLogicalFunction(LogicalFunction sp1, LogicalFunction sp2); + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/ContainedIntSpanLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/ContainedIntSpanLogicalFunction.hpp new file mode 100644 index 0000000000..7b51e07600 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/ContainedIntSpanLogicalFunction.hpp @@ -0,0 +1,45 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1 if the integer value is contained by the integer span. + */ +class ContainedIntSpanLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "ContainedIntSpan"; + ContainedIntSpanLogicalFunction(LogicalFunction val, LogicalFunction sp); + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/ContainedSpanSpanLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/ContainedSpanSpanLogicalFunction.hpp new file mode 100644 index 0000000000..1a8edc8bfa --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/ContainedSpanSpanLogicalFunction.hpp @@ -0,0 +1,45 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1 if integer span sp1 is contained by integer span sp2. + */ +class ContainedSpanSpanLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "ContainedSpanSpan"; + ContainedSpanSpanLogicalFunction(LogicalFunction sp1, LogicalFunction sp2); + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/ContainsFloatspanSpanLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/ContainsFloatspanSpanLogicalFunction.hpp new file mode 100644 index 0000000000..5ae65373c0 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/ContainsFloatspanSpanLogicalFunction.hpp @@ -0,0 +1,45 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1 if float span sp1 contains float span sp2. + */ +class ContainsFloatspanSpanLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "ContainsFloatspanSpan"; + ContainsFloatspanSpanLogicalFunction(LogicalFunction sp1, LogicalFunction sp2); + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/ContainsSpanFloatLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/ContainsSpanFloatLogicalFunction.hpp new file mode 100644 index 0000000000..de8cdc2a2c --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/ContainsSpanFloatLogicalFunction.hpp @@ -0,0 +1,45 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1 if the float span contains the float value. + */ +class ContainsSpanFloatLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "ContainsSpanFloat"; + ContainsSpanFloatLogicalFunction(LogicalFunction sp, LogicalFunction val); + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/ContainsSpanIntLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/ContainsSpanIntLogicalFunction.hpp new file mode 100644 index 0000000000..aa940b84c4 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/ContainsSpanIntLogicalFunction.hpp @@ -0,0 +1,45 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1 if the integer span contains the integer value. + */ +class ContainsSpanIntLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "ContainsSpanInt"; + ContainsSpanIntLogicalFunction(LogicalFunction sp, LogicalFunction val); + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/ContainsSpanSpanLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/ContainsSpanSpanLogicalFunction.hpp new file mode 100644 index 0000000000..02187a7449 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/ContainsSpanSpanLogicalFunction.hpp @@ -0,0 +1,45 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1 if integer span sp1 contains integer span sp2. + */ +class ContainsSpanSpanLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "ContainsSpanSpan"; + ContainsSpanSpanLogicalFunction(LogicalFunction sp1, LogicalFunction sp2); + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt index 14d0973723..638bc6fbab 100644 --- a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt @@ -533,6 +533,14 @@ add_plugin(FloatspanUpper LogicalFunction nes-logical-operators FloatspanUpperLo add_plugin(FloatspanWidth LogicalFunction nes-logical-operators FloatspanWidthLogicalFunction.cpp) add_plugin(FloatspanLowerInc LogicalFunction nes-logical-operators FloatspanLowerIncLogicalFunction.cpp) add_plugin(FloatspanUpperInc LogicalFunction nes-logical-operators FloatspanUpperIncLogicalFunction.cpp) +add_plugin(ContainedIntSpan LogicalFunction nes-logical-operators ContainedIntSpanLogicalFunction.cpp) +add_plugin(ContainedFloatSpan LogicalFunction nes-logical-operators ContainedFloatSpanLogicalFunction.cpp) +add_plugin(ContainsSpanInt LogicalFunction nes-logical-operators ContainsSpanIntLogicalFunction.cpp) +add_plugin(ContainsSpanFloat LogicalFunction nes-logical-operators ContainsSpanFloatLogicalFunction.cpp) +add_plugin(ContainedSpanSpan LogicalFunction nes-logical-operators ContainedSpanSpanLogicalFunction.cpp) +add_plugin(ContainsSpanSpan LogicalFunction nes-logical-operators ContainsSpanSpanLogicalFunction.cpp) +add_plugin(ContainedFloatspanSpan LogicalFunction nes-logical-operators ContainedFloatspanSpanLogicalFunction.cpp) +add_plugin(ContainsFloatspanSpan LogicalFunction nes-logical-operators ContainsFloatspanSpanLogicalFunction.cpp) add_plugin(GeomRelatePattern LogicalFunction nes-logical-operators GeomRelatePatternLogicalFunction.cpp) add_plugin(GeomIntersects2d LogicalFunction nes-logical-operators GeomIntersects2dLogicalFunction.cpp) add_plugin(GeomDwithin2d LogicalFunction nes-logical-operators GeomDwithin2dLogicalFunction.cpp) diff --git a/nes-logical-operators/src/Functions/Meos/ContainedFloatSpanLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/ContainedFloatSpanLogicalFunction.cpp new file mode 100644 index 0000000000..5abbd7e658 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/ContainedFloatSpanLogicalFunction.cpp @@ -0,0 +1,75 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +ContainedFloatSpanLogicalFunction::ContainedFloatSpanLogicalFunction(LogicalFunction val, LogicalFunction sp) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(2); + parameters.push_back(std::move(val)); + parameters.push_back(std::move(sp)); +} +DataType ContainedFloatSpanLogicalFunction::getDataType() const { return dataType; } +LogicalFunction ContainedFloatSpanLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } +std::vector ContainedFloatSpanLogicalFunction::getChildren() const { return parameters; } +LogicalFunction ContainedFloatSpanLogicalFunction::withChildren(const std::vector& children) const { + PRECONDITION(children.size()==2,"ContainedFloatSpanLogicalFunction requires 2 children, but got {}",children.size()); + auto c=*this; c.parameters=children; return c; +} +std::string_view ContainedFloatSpanLogicalFunction::getType() const { return NAME; } +bool ContainedFloatSpanLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + return false; +} +std::string ContainedFloatSpanLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("{}({})",NAME,parameters[0].explain(v)); +} +LogicalFunction ContainedFloatSpanLogicalFunction::withInferredDataType(const Schema& schema) const { + std::vector c; c.reserve(2); + for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "val must be FLOAT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::VARSIZED), "sp must be VARSIZED"); + return withChildren(c); +} +SerializableFunction ContainedFloatSpanLogicalFunction::serialize() const { + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + return proto; +} +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterContainedFloatSpanLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size()==2, + "ContainedFloatSpanLogicalFunction requires 2 children but got {}", + arguments.children.size()); + return ContainedFloatSpanLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/ContainedFloatspanSpanLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/ContainedFloatspanSpanLogicalFunction.cpp new file mode 100644 index 0000000000..f428c1ac2b --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/ContainedFloatspanSpanLogicalFunction.cpp @@ -0,0 +1,75 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +ContainedFloatspanSpanLogicalFunction::ContainedFloatspanSpanLogicalFunction(LogicalFunction sp1, LogicalFunction sp2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(2); + parameters.push_back(std::move(sp1)); + parameters.push_back(std::move(sp2)); +} +DataType ContainedFloatspanSpanLogicalFunction::getDataType() const { return dataType; } +LogicalFunction ContainedFloatspanSpanLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } +std::vector ContainedFloatspanSpanLogicalFunction::getChildren() const { return parameters; } +LogicalFunction ContainedFloatspanSpanLogicalFunction::withChildren(const std::vector& children) const { + PRECONDITION(children.size()==2,"ContainedFloatspanSpanLogicalFunction requires 2 children, but got {}",children.size()); + auto c=*this; c.parameters=children; return c; +} +std::string_view ContainedFloatspanSpanLogicalFunction::getType() const { return NAME; } +bool ContainedFloatspanSpanLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + return false; +} +std::string ContainedFloatspanSpanLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("{}({})",NAME,parameters[0].explain(v)); +} +LogicalFunction ContainedFloatspanSpanLogicalFunction::withInferredDataType(const Schema& schema) const { + std::vector c; c.reserve(2); + for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "sp1 must be VARSIZED"); + INVARIANT(c[1].getDataType().isType(DataType::Type::VARSIZED), "sp2 must be VARSIZED"); + return withChildren(c); +} +SerializableFunction ContainedFloatspanSpanLogicalFunction::serialize() const { + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + return proto; +} +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterContainedFloatspanSpanLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size()==2, + "ContainedFloatspanSpanLogicalFunction requires 2 children but got {}", + arguments.children.size()); + return ContainedFloatspanSpanLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/ContainedIntSpanLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/ContainedIntSpanLogicalFunction.cpp new file mode 100644 index 0000000000..82f43f97a7 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/ContainedIntSpanLogicalFunction.cpp @@ -0,0 +1,75 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +ContainedIntSpanLogicalFunction::ContainedIntSpanLogicalFunction(LogicalFunction val, LogicalFunction sp) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(2); + parameters.push_back(std::move(val)); + parameters.push_back(std::move(sp)); +} +DataType ContainedIntSpanLogicalFunction::getDataType() const { return dataType; } +LogicalFunction ContainedIntSpanLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } +std::vector ContainedIntSpanLogicalFunction::getChildren() const { return parameters; } +LogicalFunction ContainedIntSpanLogicalFunction::withChildren(const std::vector& children) const { + PRECONDITION(children.size()==2,"ContainedIntSpanLogicalFunction requires 2 children, but got {}",children.size()); + auto c=*this; c.parameters=children; return c; +} +std::string_view ContainedIntSpanLogicalFunction::getType() const { return NAME; } +bool ContainedIntSpanLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + return false; +} +std::string ContainedIntSpanLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("{}({})",NAME,parameters[0].explain(v)); +} +LogicalFunction ContainedIntSpanLogicalFunction::withInferredDataType(const Schema& schema) const { + std::vector c; c.reserve(2); + for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "val must be FLOAT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::VARSIZED), "sp must be VARSIZED"); + return withChildren(c); +} +SerializableFunction ContainedIntSpanLogicalFunction::serialize() const { + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + return proto; +} +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterContainedIntSpanLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size()==2, + "ContainedIntSpanLogicalFunction requires 2 children but got {}", + arguments.children.size()); + return ContainedIntSpanLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/ContainedSpanSpanLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/ContainedSpanSpanLogicalFunction.cpp new file mode 100644 index 0000000000..9f1d65a291 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/ContainedSpanSpanLogicalFunction.cpp @@ -0,0 +1,75 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +ContainedSpanSpanLogicalFunction::ContainedSpanSpanLogicalFunction(LogicalFunction sp1, LogicalFunction sp2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(2); + parameters.push_back(std::move(sp1)); + parameters.push_back(std::move(sp2)); +} +DataType ContainedSpanSpanLogicalFunction::getDataType() const { return dataType; } +LogicalFunction ContainedSpanSpanLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } +std::vector ContainedSpanSpanLogicalFunction::getChildren() const { return parameters; } +LogicalFunction ContainedSpanSpanLogicalFunction::withChildren(const std::vector& children) const { + PRECONDITION(children.size()==2,"ContainedSpanSpanLogicalFunction requires 2 children, but got {}",children.size()); + auto c=*this; c.parameters=children; return c; +} +std::string_view ContainedSpanSpanLogicalFunction::getType() const { return NAME; } +bool ContainedSpanSpanLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + return false; +} +std::string ContainedSpanSpanLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("{}({})",NAME,parameters[0].explain(v)); +} +LogicalFunction ContainedSpanSpanLogicalFunction::withInferredDataType(const Schema& schema) const { + std::vector c; c.reserve(2); + for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "sp1 must be VARSIZED"); + INVARIANT(c[1].getDataType().isType(DataType::Type::VARSIZED), "sp2 must be VARSIZED"); + return withChildren(c); +} +SerializableFunction ContainedSpanSpanLogicalFunction::serialize() const { + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + return proto; +} +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterContainedSpanSpanLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size()==2, + "ContainedSpanSpanLogicalFunction requires 2 children but got {}", + arguments.children.size()); + return ContainedSpanSpanLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/ContainsFloatspanSpanLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/ContainsFloatspanSpanLogicalFunction.cpp new file mode 100644 index 0000000000..1fc199ac33 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/ContainsFloatspanSpanLogicalFunction.cpp @@ -0,0 +1,75 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +ContainsFloatspanSpanLogicalFunction::ContainsFloatspanSpanLogicalFunction(LogicalFunction sp1, LogicalFunction sp2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(2); + parameters.push_back(std::move(sp1)); + parameters.push_back(std::move(sp2)); +} +DataType ContainsFloatspanSpanLogicalFunction::getDataType() const { return dataType; } +LogicalFunction ContainsFloatspanSpanLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } +std::vector ContainsFloatspanSpanLogicalFunction::getChildren() const { return parameters; } +LogicalFunction ContainsFloatspanSpanLogicalFunction::withChildren(const std::vector& children) const { + PRECONDITION(children.size()==2,"ContainsFloatspanSpanLogicalFunction requires 2 children, but got {}",children.size()); + auto c=*this; c.parameters=children; return c; +} +std::string_view ContainsFloatspanSpanLogicalFunction::getType() const { return NAME; } +bool ContainsFloatspanSpanLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + return false; +} +std::string ContainsFloatspanSpanLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("{}({})",NAME,parameters[0].explain(v)); +} +LogicalFunction ContainsFloatspanSpanLogicalFunction::withInferredDataType(const Schema& schema) const { + std::vector c; c.reserve(2); + for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "sp1 must be VARSIZED"); + INVARIANT(c[1].getDataType().isType(DataType::Type::VARSIZED), "sp2 must be VARSIZED"); + return withChildren(c); +} +SerializableFunction ContainsFloatspanSpanLogicalFunction::serialize() const { + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + return proto; +} +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterContainsFloatspanSpanLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size()==2, + "ContainsFloatspanSpanLogicalFunction requires 2 children but got {}", + arguments.children.size()); + return ContainsFloatspanSpanLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/ContainsSpanFloatLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/ContainsSpanFloatLogicalFunction.cpp new file mode 100644 index 0000000000..aa27038af4 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/ContainsSpanFloatLogicalFunction.cpp @@ -0,0 +1,75 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +ContainsSpanFloatLogicalFunction::ContainsSpanFloatLogicalFunction(LogicalFunction sp, LogicalFunction val) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(2); + parameters.push_back(std::move(sp)); + parameters.push_back(std::move(val)); +} +DataType ContainsSpanFloatLogicalFunction::getDataType() const { return dataType; } +LogicalFunction ContainsSpanFloatLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } +std::vector ContainsSpanFloatLogicalFunction::getChildren() const { return parameters; } +LogicalFunction ContainsSpanFloatLogicalFunction::withChildren(const std::vector& children) const { + PRECONDITION(children.size()==2,"ContainsSpanFloatLogicalFunction requires 2 children, but got {}",children.size()); + auto c=*this; c.parameters=children; return c; +} +std::string_view ContainsSpanFloatLogicalFunction::getType() const { return NAME; } +bool ContainsSpanFloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + return false; +} +std::string ContainsSpanFloatLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("{}({})",NAME,parameters[0].explain(v)); +} +LogicalFunction ContainsSpanFloatLogicalFunction::withInferredDataType(const Schema& schema) const { + std::vector c; c.reserve(2); + for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "sp must be VARSIZED"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "val must be FLOAT64"); + return withChildren(c); +} +SerializableFunction ContainsSpanFloatLogicalFunction::serialize() const { + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + return proto; +} +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterContainsSpanFloatLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size()==2, + "ContainsSpanFloatLogicalFunction requires 2 children but got {}", + arguments.children.size()); + return ContainsSpanFloatLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/ContainsSpanIntLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/ContainsSpanIntLogicalFunction.cpp new file mode 100644 index 0000000000..9000b5c553 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/ContainsSpanIntLogicalFunction.cpp @@ -0,0 +1,75 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +ContainsSpanIntLogicalFunction::ContainsSpanIntLogicalFunction(LogicalFunction sp, LogicalFunction val) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(2); + parameters.push_back(std::move(sp)); + parameters.push_back(std::move(val)); +} +DataType ContainsSpanIntLogicalFunction::getDataType() const { return dataType; } +LogicalFunction ContainsSpanIntLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } +std::vector ContainsSpanIntLogicalFunction::getChildren() const { return parameters; } +LogicalFunction ContainsSpanIntLogicalFunction::withChildren(const std::vector& children) const { + PRECONDITION(children.size()==2,"ContainsSpanIntLogicalFunction requires 2 children, but got {}",children.size()); + auto c=*this; c.parameters=children; return c; +} +std::string_view ContainsSpanIntLogicalFunction::getType() const { return NAME; } +bool ContainsSpanIntLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + return false; +} +std::string ContainsSpanIntLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("{}({})",NAME,parameters[0].explain(v)); +} +LogicalFunction ContainsSpanIntLogicalFunction::withInferredDataType(const Schema& schema) const { + std::vector c; c.reserve(2); + for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "sp must be VARSIZED"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "val must be FLOAT64"); + return withChildren(c); +} +SerializableFunction ContainsSpanIntLogicalFunction::serialize() const { + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + return proto; +} +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterContainsSpanIntLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size()==2, + "ContainsSpanIntLogicalFunction requires 2 children but got {}", + arguments.children.size()); + return ContainsSpanIntLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/ContainsSpanSpanLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/ContainsSpanSpanLogicalFunction.cpp new file mode 100644 index 0000000000..d0b3e1c052 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/ContainsSpanSpanLogicalFunction.cpp @@ -0,0 +1,75 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +ContainsSpanSpanLogicalFunction::ContainsSpanSpanLogicalFunction(LogicalFunction sp1, LogicalFunction sp2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(2); + parameters.push_back(std::move(sp1)); + parameters.push_back(std::move(sp2)); +} +DataType ContainsSpanSpanLogicalFunction::getDataType() const { return dataType; } +LogicalFunction ContainsSpanSpanLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } +std::vector ContainsSpanSpanLogicalFunction::getChildren() const { return parameters; } +LogicalFunction ContainsSpanSpanLogicalFunction::withChildren(const std::vector& children) const { + PRECONDITION(children.size()==2,"ContainsSpanSpanLogicalFunction requires 2 children, but got {}",children.size()); + auto c=*this; c.parameters=children; return c; +} +std::string_view ContainsSpanSpanLogicalFunction::getType() const { return NAME; } +bool ContainsSpanSpanLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + return false; +} +std::string ContainsSpanSpanLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("{}({})",NAME,parameters[0].explain(v)); +} +LogicalFunction ContainsSpanSpanLogicalFunction::withInferredDataType(const Schema& schema) const { + std::vector c; c.reserve(2); + for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "sp1 must be VARSIZED"); + INVARIANT(c[1].getDataType().isType(DataType::Type::VARSIZED), "sp2 must be VARSIZED"); + return withChildren(c); +} +SerializableFunction ContainsSpanSpanLogicalFunction::serialize() const { + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + return proto; +} +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterContainsSpanSpanLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size()==2, + "ContainsSpanSpanLogicalFunction requires 2 children but got {}", + arguments.children.size()); + return ContainsSpanSpanLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1])); +} + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/ContainedFloatSpanPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/ContainedFloatSpanPhysicalFunction.hpp new file mode 100644 index 0000000000..aa96e932db --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/ContainedFloatSpanPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class ContainedFloatSpanPhysicalFunction : public PhysicalFunctionConcept { +public: + ContainedFloatSpanPhysicalFunction(PhysicalFunction val, PhysicalFunction sp); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/ContainedFloatspanSpanPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/ContainedFloatspanSpanPhysicalFunction.hpp new file mode 100644 index 0000000000..497932d8e5 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/ContainedFloatspanSpanPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class ContainedFloatspanSpanPhysicalFunction : public PhysicalFunctionConcept { +public: + ContainedFloatspanSpanPhysicalFunction(PhysicalFunction sp1, PhysicalFunction sp2); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/ContainedIntSpanPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/ContainedIntSpanPhysicalFunction.hpp new file mode 100644 index 0000000000..a552bc08f5 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/ContainedIntSpanPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class ContainedIntSpanPhysicalFunction : public PhysicalFunctionConcept { +public: + ContainedIntSpanPhysicalFunction(PhysicalFunction val, PhysicalFunction sp); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/ContainedSpanSpanPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/ContainedSpanSpanPhysicalFunction.hpp new file mode 100644 index 0000000000..c330b5ce9f --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/ContainedSpanSpanPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class ContainedSpanSpanPhysicalFunction : public PhysicalFunctionConcept { +public: + ContainedSpanSpanPhysicalFunction(PhysicalFunction sp1, PhysicalFunction sp2); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/ContainsFloatspanSpanPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/ContainsFloatspanSpanPhysicalFunction.hpp new file mode 100644 index 0000000000..ea6a55abd1 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/ContainsFloatspanSpanPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class ContainsFloatspanSpanPhysicalFunction : public PhysicalFunctionConcept { +public: + ContainsFloatspanSpanPhysicalFunction(PhysicalFunction sp1, PhysicalFunction sp2); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/ContainsSpanFloatPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/ContainsSpanFloatPhysicalFunction.hpp new file mode 100644 index 0000000000..721f0426a2 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/ContainsSpanFloatPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class ContainsSpanFloatPhysicalFunction : public PhysicalFunctionConcept { +public: + ContainsSpanFloatPhysicalFunction(PhysicalFunction sp, PhysicalFunction val); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/ContainsSpanIntPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/ContainsSpanIntPhysicalFunction.hpp new file mode 100644 index 0000000000..b14d09beb7 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/ContainsSpanIntPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class ContainsSpanIntPhysicalFunction : public PhysicalFunctionConcept { +public: + ContainsSpanIntPhysicalFunction(PhysicalFunction sp, PhysicalFunction val); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/ContainsSpanSpanPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/ContainsSpanSpanPhysicalFunction.hpp new file mode 100644 index 0000000000..48988e61a4 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/ContainsSpanSpanPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class ContainsSpanSpanPhysicalFunction : public PhysicalFunctionConcept { +public: + ContainsSpanSpanPhysicalFunction(PhysicalFunction sp1, PhysicalFunction sp2); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt index f6dc713274..51e7a233e4 100644 --- a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt @@ -532,6 +532,14 @@ add_plugin(FloatspanUpper PhysicalFunction nes-physical-operators FloatspanUpper add_plugin(FloatspanWidth PhysicalFunction nes-physical-operators FloatspanWidthPhysicalFunction.cpp) add_plugin(FloatspanLowerInc PhysicalFunction nes-physical-operators FloatspanLowerIncPhysicalFunction.cpp) add_plugin(FloatspanUpperInc PhysicalFunction nes-physical-operators FloatspanUpperIncPhysicalFunction.cpp) +add_plugin(ContainedIntSpan PhysicalFunction nes-physical-operators ContainedIntSpanPhysicalFunction.cpp) +add_plugin(ContainedFloatSpan PhysicalFunction nes-physical-operators ContainedFloatSpanPhysicalFunction.cpp) +add_plugin(ContainsSpanInt PhysicalFunction nes-physical-operators ContainsSpanIntPhysicalFunction.cpp) +add_plugin(ContainsSpanFloat PhysicalFunction nes-physical-operators ContainsSpanFloatPhysicalFunction.cpp) +add_plugin(ContainedSpanSpan PhysicalFunction nes-physical-operators ContainedSpanSpanPhysicalFunction.cpp) +add_plugin(ContainsSpanSpan PhysicalFunction nes-physical-operators ContainsSpanSpanPhysicalFunction.cpp) +add_plugin(ContainedFloatspanSpan PhysicalFunction nes-physical-operators ContainedFloatspanSpanPhysicalFunction.cpp) +add_plugin(ContainsFloatspanSpan PhysicalFunction nes-physical-operators ContainsFloatspanSpanPhysicalFunction.cpp) add_plugin(GeomRelatePattern PhysicalFunction nes-physical-operators GeomRelatePatternPhysicalFunction.cpp) add_plugin(GeomIntersects2d PhysicalFunction nes-physical-operators GeomIntersects2dPhysicalFunction.cpp) add_plugin(GeomDwithin2d PhysicalFunction nes-physical-operators GeomDwithin2dPhysicalFunction.cpp) diff --git a/nes-physical-operators/src/Functions/Meos/ContainedFloatSpanPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/ContainedFloatSpanPhysicalFunction.cpp new file mode 100644 index 0000000000..66db627cfc --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/ContainedFloatSpanPhysicalFunction.cpp @@ -0,0 +1,71 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +} +#include + +namespace NES { + +ContainedFloatSpanPhysicalFunction::ContainedFloatSpanPhysicalFunction(PhysicalFunction val, PhysicalFunction sp) { + paramFns.reserve(2); + paramFns.push_back(std::move(val)); + paramFns.push_back(std::move(sp)); +} + +VarVal ContainedFloatSpanPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { + auto val = paramFns[0].execute(record, arena).cast(); + auto sp = paramFns[1].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](double val_d, const char* w, uint32_t wsz) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string s(w, wsz); + Span* sp = floatspan_in(s.c_str()); + if (!sp) return 0.0; + bool r = contained_float_span(val_d, sp); + free(sp); + return r ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + val, sp); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterContainedFloatSpanPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size()==2, + "ContainedFloatSpanPhysicalFunction requires 2 children but got {}", + arguments.childFunctions.size()); + return ContainedFloatSpanPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/ContainedFloatspanSpanPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/ContainedFloatspanSpanPhysicalFunction.cpp new file mode 100644 index 0000000000..d2a2fa66cf --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/ContainedFloatspanSpanPhysicalFunction.cpp @@ -0,0 +1,73 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +} +#include + +namespace NES { + +ContainedFloatspanSpanPhysicalFunction::ContainedFloatspanSpanPhysicalFunction(PhysicalFunction sp1, PhysicalFunction sp2) { + paramFns.reserve(2); + paramFns.push_back(std::move(sp1)); + paramFns.push_back(std::move(sp2)); +} + +VarVal ContainedFloatspanSpanPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { + auto sp1 = paramFns[0].execute(record, arena).cast(); + auto sp2 = paramFns[1].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](const char* w1, uint32_t w1sz, const char* w2, uint32_t w2sz) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string s1(w1,w1sz), s2(w2,w2sz); + Span* sp1 = floatspan_in(s1.c_str()); + if (!sp1) return 0.0; + Span* sp2 = floatspan_in(s2.c_str()); + if (!sp2) { free(sp1); return 0.0; } + bool r = contained_span_span(sp1, sp2); + free(sp1); free(sp2); + return r ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + sp1, sp2); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterContainedFloatspanSpanPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size()==2, + "ContainedFloatspanSpanPhysicalFunction requires 2 children but got {}", + arguments.childFunctions.size()); + return ContainedFloatspanSpanPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/ContainedIntSpanPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/ContainedIntSpanPhysicalFunction.cpp new file mode 100644 index 0000000000..49251292e7 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/ContainedIntSpanPhysicalFunction.cpp @@ -0,0 +1,71 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +} +#include + +namespace NES { + +ContainedIntSpanPhysicalFunction::ContainedIntSpanPhysicalFunction(PhysicalFunction val, PhysicalFunction sp) { + paramFns.reserve(2); + paramFns.push_back(std::move(val)); + paramFns.push_back(std::move(sp)); +} + +VarVal ContainedIntSpanPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { + auto val = paramFns[0].execute(record, arena).cast(); + auto sp = paramFns[1].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](double val_d, const char* w, uint32_t wsz) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string s(w, wsz); + Span* sp = intspan_in(s.c_str()); + if (!sp) return 0.0; + bool r = contained_int_span((int)val_d, sp); + free(sp); + return r ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + val, sp); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterContainedIntSpanPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size()==2, + "ContainedIntSpanPhysicalFunction requires 2 children but got {}", + arguments.childFunctions.size()); + return ContainedIntSpanPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/ContainedSpanSpanPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/ContainedSpanSpanPhysicalFunction.cpp new file mode 100644 index 0000000000..f77aa41c49 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/ContainedSpanSpanPhysicalFunction.cpp @@ -0,0 +1,73 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +} +#include + +namespace NES { + +ContainedSpanSpanPhysicalFunction::ContainedSpanSpanPhysicalFunction(PhysicalFunction sp1, PhysicalFunction sp2) { + paramFns.reserve(2); + paramFns.push_back(std::move(sp1)); + paramFns.push_back(std::move(sp2)); +} + +VarVal ContainedSpanSpanPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { + auto sp1 = paramFns[0].execute(record, arena).cast(); + auto sp2 = paramFns[1].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](const char* w1, uint32_t w1sz, const char* w2, uint32_t w2sz) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string s1(w1,w1sz), s2(w2,w2sz); + Span* sp1 = intspan_in(s1.c_str()); + if (!sp1) return 0.0; + Span* sp2 = intspan_in(s2.c_str()); + if (!sp2) { free(sp1); return 0.0; } + bool r = contained_span_span(sp1, sp2); + free(sp1); free(sp2); + return r ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + sp1, sp2); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterContainedSpanSpanPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size()==2, + "ContainedSpanSpanPhysicalFunction requires 2 children but got {}", + arguments.childFunctions.size()); + return ContainedSpanSpanPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/ContainsFloatspanSpanPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/ContainsFloatspanSpanPhysicalFunction.cpp new file mode 100644 index 0000000000..61db808900 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/ContainsFloatspanSpanPhysicalFunction.cpp @@ -0,0 +1,73 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +} +#include + +namespace NES { + +ContainsFloatspanSpanPhysicalFunction::ContainsFloatspanSpanPhysicalFunction(PhysicalFunction sp1, PhysicalFunction sp2) { + paramFns.reserve(2); + paramFns.push_back(std::move(sp1)); + paramFns.push_back(std::move(sp2)); +} + +VarVal ContainsFloatspanSpanPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { + auto sp1 = paramFns[0].execute(record, arena).cast(); + auto sp2 = paramFns[1].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](const char* w1, uint32_t w1sz, const char* w2, uint32_t w2sz) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string s1(w1,w1sz), s2(w2,w2sz); + Span* sp1 = floatspan_in(s1.c_str()); + if (!sp1) return 0.0; + Span* sp2 = floatspan_in(s2.c_str()); + if (!sp2) { free(sp1); return 0.0; } + bool r = contains_span_span(sp1, sp2); + free(sp1); free(sp2); + return r ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + sp1, sp2); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterContainsFloatspanSpanPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size()==2, + "ContainsFloatspanSpanPhysicalFunction requires 2 children but got {}", + arguments.childFunctions.size()); + return ContainsFloatspanSpanPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/ContainsSpanFloatPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/ContainsSpanFloatPhysicalFunction.cpp new file mode 100644 index 0000000000..a6d9d95eb9 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/ContainsSpanFloatPhysicalFunction.cpp @@ -0,0 +1,71 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +} +#include + +namespace NES { + +ContainsSpanFloatPhysicalFunction::ContainsSpanFloatPhysicalFunction(PhysicalFunction sp, PhysicalFunction val) { + paramFns.reserve(2); + paramFns.push_back(std::move(sp)); + paramFns.push_back(std::move(val)); +} + +VarVal ContainsSpanFloatPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { + auto sp = paramFns[0].execute(record, arena).cast(); + auto val = paramFns[1].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](const char* w, uint32_t wsz, double val_d) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string s(w, wsz); + Span* sp = floatspan_in(s.c_str()); + if (!sp) return 0.0; + bool r = contains_span_float(sp, val_d); + free(sp); + return r ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + sp, val); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterContainsSpanFloatPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size()==2, + "ContainsSpanFloatPhysicalFunction requires 2 children but got {}", + arguments.childFunctions.size()); + return ContainsSpanFloatPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/ContainsSpanIntPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/ContainsSpanIntPhysicalFunction.cpp new file mode 100644 index 0000000000..8f42a14a5b --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/ContainsSpanIntPhysicalFunction.cpp @@ -0,0 +1,71 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +} +#include + +namespace NES { + +ContainsSpanIntPhysicalFunction::ContainsSpanIntPhysicalFunction(PhysicalFunction sp, PhysicalFunction val) { + paramFns.reserve(2); + paramFns.push_back(std::move(sp)); + paramFns.push_back(std::move(val)); +} + +VarVal ContainsSpanIntPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { + auto sp = paramFns[0].execute(record, arena).cast(); + auto val = paramFns[1].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](const char* w, uint32_t wsz, double val_d) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string s(w, wsz); + Span* sp = intspan_in(s.c_str()); + if (!sp) return 0.0; + bool r = contains_span_int(sp, (int)val_d); + free(sp); + return r ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + sp, val); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterContainsSpanIntPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size()==2, + "ContainsSpanIntPhysicalFunction requires 2 children but got {}", + arguments.childFunctions.size()); + return ContainsSpanIntPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/ContainsSpanSpanPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/ContainsSpanSpanPhysicalFunction.cpp new file mode 100644 index 0000000000..081d76faf7 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/ContainsSpanSpanPhysicalFunction.cpp @@ -0,0 +1,73 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +} +#include + +namespace NES { + +ContainsSpanSpanPhysicalFunction::ContainsSpanSpanPhysicalFunction(PhysicalFunction sp1, PhysicalFunction sp2) { + paramFns.reserve(2); + paramFns.push_back(std::move(sp1)); + paramFns.push_back(std::move(sp2)); +} + +VarVal ContainsSpanSpanPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { + auto sp1 = paramFns[0].execute(record, arena).cast(); + auto sp2 = paramFns[1].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](const char* w1, uint32_t w1sz, const char* w2, uint32_t w2sz) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string s1(w1,w1sz), s2(w2,w2sz); + Span* sp1 = intspan_in(s1.c_str()); + if (!sp1) return 0.0; + Span* sp2 = intspan_in(s2.c_str()); + if (!sp2) { free(sp1); return 0.0; } + bool r = contains_span_span(sp1, sp2); + free(sp1); free(sp2); + return r ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + sp1, sp2); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterContainsSpanSpanPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size()==2, + "ContainsSpanSpanPhysicalFunction requires 2 children but got {}", + arguments.childFunctions.size()); + return ContainsSpanSpanPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1])); +} + +} // namespace NES diff --git a/nes-sql-parser/AntlrSQL.g4 b/nes-sql-parser/AntlrSQL.g4 index e1fb415e06..5c15475dbf 100644 --- a/nes-sql-parser/AntlrSQL.g4 +++ b/nes-sql-parser/AntlrSQL.g4 @@ -295,7 +295,7 @@ timeUnit: MS timestampParameter: name=identifier; -functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT | TGE_TTEXT_TEXT | TGE_TEXT_TTEXT | TGT_TTEXT_TEXT | TGT_TEXT_TTEXT | TLE_TTEXT_TEXT | TLE_TEXT_TTEXT | TLT_TTEXT_TEXT | TLT_TEXT_TTEXT | TTEXT_UPPER | TTEXT_LOWER | TTEXT_INITCAP | TEXTCAT_TTEXT_TEXT | TEXTCAT_TEXT_TTEXT | TEXTCAT_TTEXT_TTEXT | GEOM_LENGTH | GEOM_PERIMETER | GEOM_AZIMUTH | GEOG_AREA | GEOG_LENGTH | GEOG_PERIMETER | GEOM_IS_EMPTY | AINTERSECTS_TGEO_GEO | ACOVERS_TGEO_GEO | ADISJOINT_TGEO_GEO | ADWITHIN_TGEO_GEO | EINTERSECTS_TGEO_GEO | ETOUCHES_TGEO_GEO | ECONTAINS_TGEO_GEO | ACONTAINS_TGEO_GEO | ATOUCHES_TGEO_GEO | GEO_NUM_POINTS | GEO_NUM_GEOS | GEO_SRID | GEO_IS_UNITARY | GEO_EQUALS | GEO_SAME | GEOG_DISTANCE | NAD_TGEO_GEO | EVER_EQ_TGEO_GEO | EVER_NE_TGEO_GEO | ALWAYS_EQ_TGEO_GEO | ALWAYS_NE_TGEO_GEO | GEOG_INTERSECTS | GEOG_DWITHIN | ACOVERS_GEO_TGEO | GEOM_INTERSECTS | GEOM_DWITHIN | H3_GS_POINT_TO_CELL | EVER_EQ_TH3INDEX_H3INDEX | EVER_NE_TH3INDEX_H3INDEX | ALWAYS_EQ_TH3INDEX_H3INDEX | ALWAYS_NE_TH3INDEX_H3INDEX | TH3INDEX_GET_RESOLUTION | TH3INDEX_GET_BASE_CELL_NUMBER | TH3INDEX_IS_VALID_CELL | TH3INDEX_IS_PENTAGON | TH3INDEX_CELL_TO_PARENT_NEXT | TH3INDEX_CELL_TO_CENTER_CHILD_NEXT | TH3INDEX_CELL_TO_PARENT | TH3INDEX_CELL_TO_CENTER_CHILD | TH3INDEX_CELL_TO_CHILD_POS | TH3INDEX_ARE_NEIGHBOR_CELLS | TH3INDEX_GRID_DISTANCE | EINTERSECTS_TCBUFFER_GEO | AINTERSECTS_TCBUFFER_GEO | ECOVERS_TCBUFFER_GEO | ACOVERS_TCBUFFER_GEO | EDISJOINT_TCBUFFER_GEO | ADISJOINT_TCBUFFER_GEO | ETOUCHES_TCBUFFER_GEO | ATOUCHES_TCBUFFER_GEO | ECONTAINS_TCBUFFER_GEO | ACONTAINS_TCBUFFER_GEO | NAD_TCBUFFER_GEO | EDWITHIN_TCBUFFER_GEO | ADWITHIN_TCBUFFER_GEO | EINTERSECTS_TCBUFFER_CBUFFER | AINTERSECTS_TCBUFFER_CBUFFER | ECOVERS_TCBUFFER_CBUFFER | ACOVERS_TCBUFFER_CBUFFER | EDISJOINT_TCBUFFER_CBUFFER | ADISJOINT_TCBUFFER_CBUFFER | ETOUCHES_TCBUFFER_CBUFFER | ATOUCHES_TCBUFFER_CBUFFER | ECONTAINS_TCBUFFER_CBUFFER | ACONTAINS_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_CBUFFER | ALWAYS_EQ_TCBUFFER_CBUFFER | EVER_NE_TCBUFFER_CBUFFER | ALWAYS_NE_TCBUFFER_CBUFFER | NAD_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_TCBUFFER | ALWAYS_EQ_TCBUFFER_TCBUFFER | EVER_NE_TCBUFFER_TCBUFFER | ALWAYS_NE_TCBUFFER_TCBUFFER | EINTERSECTS_TCBUFFER_TCBUFFER | AINTERSECTS_TCBUFFER_TCBUFFER | ECOVERS_TCBUFFER_TCBUFFER | ACOVERS_TCBUFFER_TCBUFFER | ADISJOINT_TCBUFFER_TCBUFFER | ETOUCHES_TCBUFFER_TCBUFFER | ATOUCHES_TCBUFFER_TCBUFFER | NAD_TCBUFFER_TCBUFFER | EDWITHIN_TCBUFFER_TCBUFFER | ADWITHIN_TCBUFFER_TCBUFFER | MINDISTANCE_TCBUFFER_TCBUFFER | NAD_TNPOINT_GEO | EVER_EQ_TNPOINT_NPOINT | ALWAYS_EQ_TNPOINT_NPOINT | EVER_NE_TNPOINT_NPOINT | ALWAYS_NE_TNPOINT_NPOINT | NAD_TNPOINT_NPOINT | EVER_EQ_NPOINT_TNPOINT | ALWAYS_EQ_NPOINT_TNPOINT | EVER_NE_NPOINT_TNPOINT | ALWAYS_NE_NPOINT_TNPOINT | EVER_EQ_TNPOINT_TNPOINT | ALWAYS_EQ_TNPOINT_TNPOINT | EVER_NE_TNPOINT_TNPOINT | ALWAYS_NE_TNPOINT_TNPOINT | NAD_TNPOINT_TNPOINT | NAD_TPOSE_GEO | EVER_EQ_TPOSE_POSE | ALWAYS_EQ_TPOSE_POSE | EVER_NE_TPOSE_POSE | ALWAYS_NE_TPOSE_POSE | NAD_TPOSE_POSE | EVER_EQ_POSE_TPOSE | ALWAYS_EQ_POSE_TPOSE | EVER_NE_POSE_TPOSE | ALWAYS_NE_POSE_TPOSE | EVER_EQ_TPOSE_TPOSE | ALWAYS_EQ_TPOSE_TPOSE | EVER_NE_TPOSE_TPOSE | ALWAYS_NE_TPOSE_TPOSE | NAD_TPOSE_TPOSE | EVER_EQ_TRGEOMETRY_GEO | ALWAYS_EQ_TRGEOMETRY_GEO | EVER_NE_TRGEOMETRY_GEO | ALWAYS_NE_TRGEOMETRY_GEO | NAD_TRGEOMETRY_GEO | EVER_EQ_GEO_TRGEOMETRY | ALWAYS_EQ_GEO_TRGEOMETRY | EVER_NE_GEO_TRGEOMETRY | ALWAYS_NE_GEO_TRGEOMETRY | EVER_EQ_TRGEOMETRY_TRGEOMETRY | ALWAYS_EQ_TRGEOMETRY_TRGEOMETRY | EVER_NE_TRGEOMETRY_TRGEOMETRY | ALWAYS_NE_TRGEOMETRY_TRGEOMETRY | NAD_TRGEOMETRY_TRGEOMETRY | EINTERSECTS_TPCPOINT_GEO | NAD_TPCPOINT_GEO | QUADBIN_POINT_TO_CELL | QUADBIN_IS_VALID_CELL | QUADBIN_GET_RESOLUTION | QUADBIN_CELL_AREA | QUADBIN_CELL_TO_QUADKEY | QUADBIN_CELL_TO_PARENT | QUADBIN_TILE_TO_CELL | EVER_EQ_TJSONB_JSONB | ALWAYS_EQ_TJSONB_JSONB | EVER_NE_TJSONB_JSONB | ALWAYS_NE_TJSONB_JSONB | EVER_EQ_TJSONB_TJSONB | ALWAYS_EQ_TJSONB_TJSONB | EVER_NE_TJSONB_TJSONB | ALWAYS_NE_TJSONB_TJSONB | GEOM_BOUNDARY | GEOM_CENTROID | GEOM_CONVEX_HULL | GEO_REVERSE | GEO_POINTS | GEOM_UNARY_UNION | GEOM_DIFFERENCE2D | GEOM_INTERSECTION2D | GEOM_SHORTESTLINE2D | GEOM_SHORTESTLINE3D | GEO_SET_SRID | GEO_TRANSFORM | GEO_ROUND | GEOM_BUFFER | LINE_NUMPOINTS | LINE_LOCATE_POINT | LINE_INTERPOLATE_POINT | LINE_SUBSTRING | GEOM_POINT_MAKE2D | GEOM_POINT_MAKE3DZ | GEOG_POINT_MAKE2D | GEOG_POINT_MAKE3DZ | GEOM_TO_GEOG | GEOG_TO_GEOM | GEOG_CENTROID | GEO_GEO_N | LINE_POINT_N | GEOM_INTERSECTION2D_COLL | GEO_AS_GEOJSON | GEO_AS_HEXEWKB | GEO_AS_EWKT | GEO_FROM_GEOJSON | GEOM_FROM_HEXEWKB | GEO_TRANSFORM_PIPELINE | GEOM_MIN_BOUNDING_CENTER | GEOM_MIN_BOUNDING_RADIUS | EVER_EQ_TGEO_TGEO | EVER_NE_TGEO_TGEO | ALWAYS_EQ_TGEO_TGEO | ALWAYS_NE_TGEO_TGEO | EINTERSECTS_TGEO_TGEO | ECOVERS_TGEO_TGEO | EDISJOINT_TGEO_TGEO | ECONTAINS_TGEO_TGEO | ETOUCHES_TGEO_TGEO | AINTERSECTS_TGEO_TGEO | ACOVERS_TGEO_TGEO | ADISJOINT_TGEO_TGEO | ACONTAINS_TGEO_TGEO | ATOUCHES_TGEO_TGEO | EDWITHIN_TGEO_TGEO | ADWITHIN_TGEO_TGEO | H3INDEX_EQ | H3INDEX_NE | H3INDEX_LT | H3INDEX_LE | H3INDEX_GT | H3INDEX_GE | H3INDEX_CMP | H3INDEX_OUT | H3INDEX_IN | JSON_ARRAY_LENGTH | JSON_TYPEOF | JSON_OBJECT_FIELD_TEXT | JSON_ARRAY_ELEMENT_TEXT | JSONB_ARRAY_LENGTH | JSONB_EQ | JSONB_NE | JSONB_LT | JSONB_LE | JSONB_GT | JSONB_GE | JSONB_CMP | JSONB_CONTAINS | JSONB_CONTAINED | JSONB_EXISTS | JSONB_TO_CSTRING | JSONB_PRETTY | JSONB_OBJECT_FIELD_TEXT | JSONB_ARRAY_ELEMENT_TEXT | INTSPAN_MAKE | FLOATSPAN_MAKE | INTSPAN_LOWER | INTSPAN_UPPER | INTSPAN_WIDTH | INTSPAN_LOWER_INC | INTSPAN_UPPER_INC | FLOATSPAN_LOWER | FLOATSPAN_UPPER | FLOATSPAN_WIDTH | FLOATSPAN_LOWER_INC | FLOATSPAN_UPPER_INC | GEOM_RELATE_PATTERN | GEOM_INTERSECTS2D | GEOM_DWITHIN2D | GEOM_CONTAINS | GEOM_DISJOINT2D | GEOM_COVERS | GEOM_TOUCHES | GEOM_INTERSECTS3D | GEOM_DWITHIN3D | GEOM_DISTANCE2D | GEOM_DISTANCE3D; +functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT | TGE_TTEXT_TEXT | TGE_TEXT_TTEXT | TGT_TTEXT_TEXT | TGT_TEXT_TTEXT | TLE_TTEXT_TEXT | TLE_TEXT_TTEXT | TLT_TTEXT_TEXT | TLT_TEXT_TTEXT | TTEXT_UPPER | TTEXT_LOWER | TTEXT_INITCAP | TEXTCAT_TTEXT_TEXT | TEXTCAT_TEXT_TTEXT | TEXTCAT_TTEXT_TTEXT | GEOM_LENGTH | GEOM_PERIMETER | GEOM_AZIMUTH | GEOG_AREA | GEOG_LENGTH | GEOG_PERIMETER | GEOM_IS_EMPTY | AINTERSECTS_TGEO_GEO | ACOVERS_TGEO_GEO | ADISJOINT_TGEO_GEO | ADWITHIN_TGEO_GEO | EINTERSECTS_TGEO_GEO | ETOUCHES_TGEO_GEO | ECONTAINS_TGEO_GEO | ACONTAINS_TGEO_GEO | ATOUCHES_TGEO_GEO | GEO_NUM_POINTS | GEO_NUM_GEOS | GEO_SRID | GEO_IS_UNITARY | GEO_EQUALS | GEO_SAME | GEOG_DISTANCE | NAD_TGEO_GEO | EVER_EQ_TGEO_GEO | EVER_NE_TGEO_GEO | ALWAYS_EQ_TGEO_GEO | ALWAYS_NE_TGEO_GEO | GEOG_INTERSECTS | GEOG_DWITHIN | ACOVERS_GEO_TGEO | GEOM_INTERSECTS | GEOM_DWITHIN | H3_GS_POINT_TO_CELL | EVER_EQ_TH3INDEX_H3INDEX | EVER_NE_TH3INDEX_H3INDEX | ALWAYS_EQ_TH3INDEX_H3INDEX | ALWAYS_NE_TH3INDEX_H3INDEX | TH3INDEX_GET_RESOLUTION | TH3INDEX_GET_BASE_CELL_NUMBER | TH3INDEX_IS_VALID_CELL | TH3INDEX_IS_PENTAGON | TH3INDEX_CELL_TO_PARENT_NEXT | TH3INDEX_CELL_TO_CENTER_CHILD_NEXT | TH3INDEX_CELL_TO_PARENT | TH3INDEX_CELL_TO_CENTER_CHILD | TH3INDEX_CELL_TO_CHILD_POS | TH3INDEX_ARE_NEIGHBOR_CELLS | TH3INDEX_GRID_DISTANCE | EINTERSECTS_TCBUFFER_GEO | AINTERSECTS_TCBUFFER_GEO | ECOVERS_TCBUFFER_GEO | ACOVERS_TCBUFFER_GEO | EDISJOINT_TCBUFFER_GEO | ADISJOINT_TCBUFFER_GEO | ETOUCHES_TCBUFFER_GEO | ATOUCHES_TCBUFFER_GEO | ECONTAINS_TCBUFFER_GEO | ACONTAINS_TCBUFFER_GEO | NAD_TCBUFFER_GEO | EDWITHIN_TCBUFFER_GEO | ADWITHIN_TCBUFFER_GEO | EINTERSECTS_TCBUFFER_CBUFFER | AINTERSECTS_TCBUFFER_CBUFFER | ECOVERS_TCBUFFER_CBUFFER | ACOVERS_TCBUFFER_CBUFFER | EDISJOINT_TCBUFFER_CBUFFER | ADISJOINT_TCBUFFER_CBUFFER | ETOUCHES_TCBUFFER_CBUFFER | ATOUCHES_TCBUFFER_CBUFFER | ECONTAINS_TCBUFFER_CBUFFER | ACONTAINS_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_CBUFFER | ALWAYS_EQ_TCBUFFER_CBUFFER | EVER_NE_TCBUFFER_CBUFFER | ALWAYS_NE_TCBUFFER_CBUFFER | NAD_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_TCBUFFER | ALWAYS_EQ_TCBUFFER_TCBUFFER | EVER_NE_TCBUFFER_TCBUFFER | ALWAYS_NE_TCBUFFER_TCBUFFER | EINTERSECTS_TCBUFFER_TCBUFFER | AINTERSECTS_TCBUFFER_TCBUFFER | ECOVERS_TCBUFFER_TCBUFFER | ACOVERS_TCBUFFER_TCBUFFER | ADISJOINT_TCBUFFER_TCBUFFER | ETOUCHES_TCBUFFER_TCBUFFER | ATOUCHES_TCBUFFER_TCBUFFER | NAD_TCBUFFER_TCBUFFER | EDWITHIN_TCBUFFER_TCBUFFER | ADWITHIN_TCBUFFER_TCBUFFER | MINDISTANCE_TCBUFFER_TCBUFFER | NAD_TNPOINT_GEO | EVER_EQ_TNPOINT_NPOINT | ALWAYS_EQ_TNPOINT_NPOINT | EVER_NE_TNPOINT_NPOINT | ALWAYS_NE_TNPOINT_NPOINT | NAD_TNPOINT_NPOINT | EVER_EQ_NPOINT_TNPOINT | ALWAYS_EQ_NPOINT_TNPOINT | EVER_NE_NPOINT_TNPOINT | ALWAYS_NE_NPOINT_TNPOINT | EVER_EQ_TNPOINT_TNPOINT | ALWAYS_EQ_TNPOINT_TNPOINT | EVER_NE_TNPOINT_TNPOINT | ALWAYS_NE_TNPOINT_TNPOINT | NAD_TNPOINT_TNPOINT | NAD_TPOSE_GEO | EVER_EQ_TPOSE_POSE | ALWAYS_EQ_TPOSE_POSE | EVER_NE_TPOSE_POSE | ALWAYS_NE_TPOSE_POSE | NAD_TPOSE_POSE | EVER_EQ_POSE_TPOSE | ALWAYS_EQ_POSE_TPOSE | EVER_NE_POSE_TPOSE | ALWAYS_NE_POSE_TPOSE | EVER_EQ_TPOSE_TPOSE | ALWAYS_EQ_TPOSE_TPOSE | EVER_NE_TPOSE_TPOSE | ALWAYS_NE_TPOSE_TPOSE | NAD_TPOSE_TPOSE | EVER_EQ_TRGEOMETRY_GEO | ALWAYS_EQ_TRGEOMETRY_GEO | EVER_NE_TRGEOMETRY_GEO | ALWAYS_NE_TRGEOMETRY_GEO | NAD_TRGEOMETRY_GEO | EVER_EQ_GEO_TRGEOMETRY | ALWAYS_EQ_GEO_TRGEOMETRY | EVER_NE_GEO_TRGEOMETRY | ALWAYS_NE_GEO_TRGEOMETRY | EVER_EQ_TRGEOMETRY_TRGEOMETRY | ALWAYS_EQ_TRGEOMETRY_TRGEOMETRY | EVER_NE_TRGEOMETRY_TRGEOMETRY | ALWAYS_NE_TRGEOMETRY_TRGEOMETRY | NAD_TRGEOMETRY_TRGEOMETRY | EINTERSECTS_TPCPOINT_GEO | NAD_TPCPOINT_GEO | QUADBIN_POINT_TO_CELL | QUADBIN_IS_VALID_CELL | QUADBIN_GET_RESOLUTION | QUADBIN_CELL_AREA | QUADBIN_CELL_TO_QUADKEY | QUADBIN_CELL_TO_PARENT | QUADBIN_TILE_TO_CELL | EVER_EQ_TJSONB_JSONB | ALWAYS_EQ_TJSONB_JSONB | EVER_NE_TJSONB_JSONB | ALWAYS_NE_TJSONB_JSONB | EVER_EQ_TJSONB_TJSONB | ALWAYS_EQ_TJSONB_TJSONB | EVER_NE_TJSONB_TJSONB | ALWAYS_NE_TJSONB_TJSONB | GEOM_BOUNDARY | GEOM_CENTROID | GEOM_CONVEX_HULL | GEO_REVERSE | GEO_POINTS | GEOM_UNARY_UNION | GEOM_DIFFERENCE2D | GEOM_INTERSECTION2D | GEOM_SHORTESTLINE2D | GEOM_SHORTESTLINE3D | GEO_SET_SRID | GEO_TRANSFORM | GEO_ROUND | GEOM_BUFFER | LINE_NUMPOINTS | LINE_LOCATE_POINT | LINE_INTERPOLATE_POINT | LINE_SUBSTRING | GEOM_POINT_MAKE2D | GEOM_POINT_MAKE3DZ | GEOG_POINT_MAKE2D | GEOG_POINT_MAKE3DZ | GEOM_TO_GEOG | GEOG_TO_GEOM | GEOG_CENTROID | GEO_GEO_N | LINE_POINT_N | GEOM_INTERSECTION2D_COLL | GEO_AS_GEOJSON | GEO_AS_HEXEWKB | GEO_AS_EWKT | GEO_FROM_GEOJSON | GEOM_FROM_HEXEWKB | GEO_TRANSFORM_PIPELINE | GEOM_MIN_BOUNDING_CENTER | GEOM_MIN_BOUNDING_RADIUS | EVER_EQ_TGEO_TGEO | EVER_NE_TGEO_TGEO | ALWAYS_EQ_TGEO_TGEO | ALWAYS_NE_TGEO_TGEO | EINTERSECTS_TGEO_TGEO | ECOVERS_TGEO_TGEO | EDISJOINT_TGEO_TGEO | ECONTAINS_TGEO_TGEO | ETOUCHES_TGEO_TGEO | AINTERSECTS_TGEO_TGEO | ACOVERS_TGEO_TGEO | ADISJOINT_TGEO_TGEO | ACONTAINS_TGEO_TGEO | ATOUCHES_TGEO_TGEO | EDWITHIN_TGEO_TGEO | ADWITHIN_TGEO_TGEO | H3INDEX_EQ | H3INDEX_NE | H3INDEX_LT | H3INDEX_LE | H3INDEX_GT | H3INDEX_GE | H3INDEX_CMP | H3INDEX_OUT | H3INDEX_IN | JSON_ARRAY_LENGTH | JSON_TYPEOF | JSON_OBJECT_FIELD_TEXT | JSON_ARRAY_ELEMENT_TEXT | JSONB_ARRAY_LENGTH | JSONB_EQ | JSONB_NE | JSONB_LT | JSONB_LE | JSONB_GT | JSONB_GE | JSONB_CMP | JSONB_CONTAINS | JSONB_CONTAINED | JSONB_EXISTS | JSONB_TO_CSTRING | JSONB_PRETTY | JSONB_OBJECT_FIELD_TEXT | JSONB_ARRAY_ELEMENT_TEXT | INTSPAN_MAKE | FLOATSPAN_MAKE | INTSPAN_LOWER | INTSPAN_UPPER | INTSPAN_WIDTH | INTSPAN_LOWER_INC | INTSPAN_UPPER_INC | FLOATSPAN_LOWER | FLOATSPAN_UPPER | FLOATSPAN_WIDTH | FLOATSPAN_LOWER_INC | FLOATSPAN_UPPER_INC | CONTAINED_INT_SPAN | CONTAINED_FLOAT_SPAN | CONTAINS_SPAN_INT | CONTAINS_SPAN_FLOAT | CONTAINED_SPAN_SPAN | CONTAINS_SPAN_SPAN | CONTAINED_FLOATSPAN_SPAN | CONTAINS_FLOATSPAN_SPAN | GEOM_RELATE_PATTERN | GEOM_INTERSECTS2D | GEOM_DWITHIN2D | GEOM_CONTAINS | GEOM_DISJOINT2D | GEOM_COVERS | GEOM_TOUCHES | GEOM_INTERSECTS3D | GEOM_DWITHIN3D | GEOM_DISTANCE2D | GEOM_DISTANCE3D; sinkClause: INTO sink (',' sink)*; @@ -1003,6 +1003,14 @@ FLOATSPAN_UPPER: 'FLOATSPAN_UPPER' | 'floatspan_upper'; FLOATSPAN_WIDTH: 'FLOATSPAN_WIDTH' | 'floatspan_width'; FLOATSPAN_LOWER_INC: 'FLOATSPAN_LOWER_INC' | 'floatspan_lower_inc'; FLOATSPAN_UPPER_INC: 'FLOATSPAN_UPPER_INC' | 'floatspan_upper_inc'; +CONTAINED_INT_SPAN: 'CONTAINED_INT_SPAN' | 'contained_int_span'; +CONTAINED_FLOAT_SPAN: 'CONTAINED_FLOAT_SPAN' | 'contained_float_span'; +CONTAINS_SPAN_INT: 'CONTAINS_SPAN_INT' | 'contains_span_int'; +CONTAINS_SPAN_FLOAT: 'CONTAINS_SPAN_FLOAT' | 'contains_span_float'; +CONTAINED_SPAN_SPAN: 'CONTAINED_SPAN_SPAN' | 'contained_intspan_intspan'; +CONTAINS_SPAN_SPAN: 'CONTAINS_SPAN_SPAN' | 'contains_intspan_intspan'; +CONTAINED_FLOATSPAN_SPAN: 'CONTAINED_FLOATSPAN_SPAN' | 'contained_floatspan_floatspan'; +CONTAINS_FLOATSPAN_SPAN: 'CONTAINS_FLOATSPAN_SPAN' | 'contains_floatspan_floatspan'; GEOM_RELATE_PATTERN: 'GEOM_RELATE_PATTERN' | 'geom_relate_pattern'; GEOM_INTERSECTS2D: 'GEOM_INTERSECTS2D' | 'geom_intersects2d'; GEOM_DWITHIN2D: 'GEOM_DWITHIN2D' | 'geom_dwithin2d'; diff --git a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp index dabc2a9ce9..4d286de9ee 100644 --- a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp +++ b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp @@ -584,6 +584,14 @@ #include #include #include +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include @@ -11740,6 +11748,78 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont return LogicalFunction(FloatspanUpperIncLogicalFunction(std::move(arg0))); } /* END CODEGEN PARSER GLUE: FLOATSPAN_UPPER_INC */ + case AntlrSQLParser::CONTAINED_INT_SPAN: { + PRECONDITION(ctx->functionParam().size() == 2, + "ContainedIntSpan requires 2 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + return LogicalFunction(ContainedIntSpanLogicalFunction(std::move(arg0), std::move(arg1))); + } + /* END CODEGEN PARSER GLUE: CONTAINED_INT_SPAN */ + case AntlrSQLParser::CONTAINED_FLOAT_SPAN: { + PRECONDITION(ctx->functionParam().size() == 2, + "ContainedFloatSpan requires 2 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + return LogicalFunction(ContainedFloatSpanLogicalFunction(std::move(arg0), std::move(arg1))); + } + /* END CODEGEN PARSER GLUE: CONTAINED_FLOAT_SPAN */ + case AntlrSQLParser::CONTAINS_SPAN_INT: { + PRECONDITION(ctx->functionParam().size() == 2, + "ContainsSpanInt requires 2 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + return LogicalFunction(ContainsSpanIntLogicalFunction(std::move(arg0), std::move(arg1))); + } + /* END CODEGEN PARSER GLUE: CONTAINS_SPAN_INT */ + case AntlrSQLParser::CONTAINS_SPAN_FLOAT: { + PRECONDITION(ctx->functionParam().size() == 2, + "ContainsSpanFloat requires 2 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + return LogicalFunction(ContainsSpanFloatLogicalFunction(std::move(arg0), std::move(arg1))); + } + /* END CODEGEN PARSER GLUE: CONTAINS_SPAN_FLOAT */ + case AntlrSQLParser::CONTAINED_SPAN_SPAN: { + PRECONDITION(ctx->functionParam().size() == 2, + "ContainedSpanSpan requires 2 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + return LogicalFunction(ContainedSpanSpanLogicalFunction(std::move(arg0), std::move(arg1))); + } + /* END CODEGEN PARSER GLUE: CONTAINED_SPAN_SPAN */ + case AntlrSQLParser::CONTAINS_SPAN_SPAN: { + PRECONDITION(ctx->functionParam().size() == 2, + "ContainsSpanSpan requires 2 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + return LogicalFunction(ContainsSpanSpanLogicalFunction(std::move(arg0), std::move(arg1))); + } + /* END CODEGEN PARSER GLUE: CONTAINS_SPAN_SPAN */ + case AntlrSQLParser::CONTAINED_FLOATSPAN_SPAN: { + PRECONDITION(ctx->functionParam().size() == 2, + "ContainedFloatspanSpan requires 2 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + return LogicalFunction(ContainedFloatspanSpanLogicalFunction(std::move(arg0), std::move(arg1))); + } + /* END CODEGEN PARSER GLUE: CONTAINED_FLOATSPAN_SPAN */ + case AntlrSQLParser::CONTAINS_FLOATSPAN_SPAN: { + PRECONDITION(ctx->functionParam().size() == 2, + "ContainsFloatspanSpan requires 2 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + return LogicalFunction(ContainsFloatspanSpanLogicalFunction(std::move(arg0), std::move(arg1))); + } + /* END CODEGEN PARSER GLUE: CONTAINS_FLOATSPAN_SPAN */ /* END CODEGEN PARSER GLUE: GEOM_RELATE_PATTERN */ /* END CODEGEN PARSER GLUE: GEOM_INTERSECTS2D */ case AntlrSQLParser::GEOM_DWITHIN2D: { From 9cded5167affc6159f9ac092e63fb1173a55b179 Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Thu, 18 Jun 2026 23:12:11 +0200 Subject: [PATCH 93/96] feat(meos): add TEXT_UPPER/LOWER/INITCAP NES operators (W145) Wires TEXT_UPPER, TEXT_LOWER, and TEXT_INITCAP (VARSIZED -> VARCHAR), backed by text_upper, text_lower, and text_initcap. Input is converted with cstring_to_text; output is extracted with text_to_cstring. New in ecosystem-pin-2026-06-18b. --- .../Meos/TextInitcapLogicalFunction.hpp | 45 +++++++++++ .../Meos/TextLowerLogicalFunction.hpp | 45 +++++++++++ .../Meos/TextUpperLogicalFunction.hpp | 45 +++++++++++ .../src/Functions/Meos/CMakeLists.txt | 3 + .../Meos/TextInitcapLogicalFunction.cpp | 71 ++++++++++++++++ .../Meos/TextLowerLogicalFunction.cpp | 71 ++++++++++++++++ .../Meos/TextUpperLogicalFunction.cpp | 71 ++++++++++++++++ .../Meos/TextInitcapPhysicalFunction.hpp | 32 ++++++++ .../Meos/TextLowerPhysicalFunction.hpp | 32 ++++++++ .../Meos/TextUpperPhysicalFunction.hpp | 32 ++++++++ .../src/Functions/Meos/CMakeLists.txt | 3 + .../Meos/TextInitcapPhysicalFunction.cpp | 80 +++++++++++++++++++ .../Meos/TextLowerPhysicalFunction.cpp | 80 +++++++++++++++++++ .../Meos/TextUpperPhysicalFunction.cpp | 80 +++++++++++++++++++ nes-sql-parser/AntlrSQL.g4 | 5 +- .../src/AntlrSQLQueryPlanCreator.cpp | 27 +++++++ 16 files changed, 721 insertions(+), 1 deletion(-) create mode 100644 nes-logical-operators/include/Functions/Meos/TextInitcapLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TextLowerLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TextUpperLogicalFunction.hpp create mode 100644 nes-logical-operators/src/Functions/Meos/TextInitcapLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TextLowerLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TextUpperLogicalFunction.cpp create mode 100644 nes-physical-operators/include/Functions/Meos/TextInitcapPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TextLowerPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TextUpperPhysicalFunction.hpp create mode 100644 nes-physical-operators/src/Functions/Meos/TextInitcapPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TextLowerPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TextUpperPhysicalFunction.cpp diff --git a/nes-logical-operators/include/Functions/Meos/TextInitcapLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TextInitcapLogicalFunction.hpp new file mode 100644 index 0000000000..81e076e3c6 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TextInitcapLogicalFunction.hpp @@ -0,0 +1,45 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Converts the first letter of each word in a text string to upper case. + */ +class TextInitcapLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TextInitcap"; + TextInitcapLogicalFunction(LogicalFunction str); + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TextLowerLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TextLowerLogicalFunction.hpp new file mode 100644 index 0000000000..6e492d12d2 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TextLowerLogicalFunction.hpp @@ -0,0 +1,45 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Converts a text string to lower case. + */ +class TextLowerLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TextLower"; + TextLowerLogicalFunction(LogicalFunction str); + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TextUpperLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TextUpperLogicalFunction.hpp new file mode 100644 index 0000000000..e754805c5a --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TextUpperLogicalFunction.hpp @@ -0,0 +1,45 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Converts a text string to upper case. + */ +class TextUpperLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TextUpper"; + TextUpperLogicalFunction(LogicalFunction str); + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt index 638bc6fbab..c4aaa7a196 100644 --- a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt @@ -541,6 +541,9 @@ add_plugin(ContainedSpanSpan LogicalFunction nes-logical-operators ContainedSpan add_plugin(ContainsSpanSpan LogicalFunction nes-logical-operators ContainsSpanSpanLogicalFunction.cpp) add_plugin(ContainedFloatspanSpan LogicalFunction nes-logical-operators ContainedFloatspanSpanLogicalFunction.cpp) add_plugin(ContainsFloatspanSpan LogicalFunction nes-logical-operators ContainsFloatspanSpanLogicalFunction.cpp) +add_plugin(TextUpper LogicalFunction nes-logical-operators TextUpperLogicalFunction.cpp) +add_plugin(TextLower LogicalFunction nes-logical-operators TextLowerLogicalFunction.cpp) +add_plugin(TextInitcap LogicalFunction nes-logical-operators TextInitcapLogicalFunction.cpp) add_plugin(GeomRelatePattern LogicalFunction nes-logical-operators GeomRelatePatternLogicalFunction.cpp) add_plugin(GeomIntersects2d LogicalFunction nes-logical-operators GeomIntersects2dLogicalFunction.cpp) add_plugin(GeomDwithin2d LogicalFunction nes-logical-operators GeomDwithin2dLogicalFunction.cpp) diff --git a/nes-logical-operators/src/Functions/Meos/TextInitcapLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TextInitcapLogicalFunction.cpp new file mode 100644 index 0000000000..f562bf5407 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TextInitcapLogicalFunction.cpp @@ -0,0 +1,71 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TextInitcapLogicalFunction::TextInitcapLogicalFunction(LogicalFunction str) + : dataType(DataTypeProvider::provideDataType(DataType::Type::VARSIZED)) +{ + parameters.reserve(1); + parameters.push_back(std::move(str)); +} +DataType TextInitcapLogicalFunction::getDataType() const { return dataType; } +LogicalFunction TextInitcapLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } +std::vector TextInitcapLogicalFunction::getChildren() const { return parameters; } +LogicalFunction TextInitcapLogicalFunction::withChildren(const std::vector& children) const { + PRECONDITION(children.size()==1,"TextInitcapLogicalFunction requires 1 child, but got {}",children.size()); + auto c=*this; c.parameters=children; return c; +} +std::string_view TextInitcapLogicalFunction::getType() const { return NAME; } +bool TextInitcapLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + return false; +} +std::string TextInitcapLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("{}({})",NAME,parameters[0].explain(v)); +} +LogicalFunction TextInitcapLogicalFunction::withInferredDataType(const Schema& schema) const { + std::vector c; c.reserve(1); + c.emplace_back(parameters[0].withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "str must be VARSIZED"); + return withChildren(c); +} +SerializableFunction TextInitcapLogicalFunction::serialize() const { + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + return proto; +} +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTextInitcapLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size()==1, + "TextInitcapLogicalFunction requires 1 child but got {}", + arguments.children.size()); + return TextInitcapLogicalFunction(std::move(arguments.children[0])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TextLowerLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TextLowerLogicalFunction.cpp new file mode 100644 index 0000000000..6513d1e0f7 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TextLowerLogicalFunction.cpp @@ -0,0 +1,71 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TextLowerLogicalFunction::TextLowerLogicalFunction(LogicalFunction str) + : dataType(DataTypeProvider::provideDataType(DataType::Type::VARSIZED)) +{ + parameters.reserve(1); + parameters.push_back(std::move(str)); +} +DataType TextLowerLogicalFunction::getDataType() const { return dataType; } +LogicalFunction TextLowerLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } +std::vector TextLowerLogicalFunction::getChildren() const { return parameters; } +LogicalFunction TextLowerLogicalFunction::withChildren(const std::vector& children) const { + PRECONDITION(children.size()==1,"TextLowerLogicalFunction requires 1 child, but got {}",children.size()); + auto c=*this; c.parameters=children; return c; +} +std::string_view TextLowerLogicalFunction::getType() const { return NAME; } +bool TextLowerLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + return false; +} +std::string TextLowerLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("{}({})",NAME,parameters[0].explain(v)); +} +LogicalFunction TextLowerLogicalFunction::withInferredDataType(const Schema& schema) const { + std::vector c; c.reserve(1); + c.emplace_back(parameters[0].withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "str must be VARSIZED"); + return withChildren(c); +} +SerializableFunction TextLowerLogicalFunction::serialize() const { + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + return proto; +} +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTextLowerLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size()==1, + "TextLowerLogicalFunction requires 1 child but got {}", + arguments.children.size()); + return TextLowerLogicalFunction(std::move(arguments.children[0])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TextUpperLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TextUpperLogicalFunction.cpp new file mode 100644 index 0000000000..35db545b9e --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TextUpperLogicalFunction.cpp @@ -0,0 +1,71 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TextUpperLogicalFunction::TextUpperLogicalFunction(LogicalFunction str) + : dataType(DataTypeProvider::provideDataType(DataType::Type::VARSIZED)) +{ + parameters.reserve(1); + parameters.push_back(std::move(str)); +} +DataType TextUpperLogicalFunction::getDataType() const { return dataType; } +LogicalFunction TextUpperLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } +std::vector TextUpperLogicalFunction::getChildren() const { return parameters; } +LogicalFunction TextUpperLogicalFunction::withChildren(const std::vector& children) const { + PRECONDITION(children.size()==1,"TextUpperLogicalFunction requires 1 child, but got {}",children.size()); + auto c=*this; c.parameters=children; return c; +} +std::string_view TextUpperLogicalFunction::getType() const { return NAME; } +bool TextUpperLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + return false; +} +std::string TextUpperLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("{}({})",NAME,parameters[0].explain(v)); +} +LogicalFunction TextUpperLogicalFunction::withInferredDataType(const Schema& schema) const { + std::vector c; c.reserve(1); + c.emplace_back(parameters[0].withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "str must be VARSIZED"); + return withChildren(c); +} +SerializableFunction TextUpperLogicalFunction::serialize() const { + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + return proto; +} +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTextUpperLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size()==1, + "TextUpperLogicalFunction requires 1 child but got {}", + arguments.children.size()); + return TextUpperLogicalFunction(std::move(arguments.children[0])); +} + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TextInitcapPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TextInitcapPhysicalFunction.hpp new file mode 100644 index 0000000000..588c90bc6d --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TextInitcapPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class TextInitcapPhysicalFunction : public PhysicalFunctionConcept { +public: + TextInitcapPhysicalFunction(PhysicalFunction str); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TextLowerPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TextLowerPhysicalFunction.hpp new file mode 100644 index 0000000000..1f93c01a7a --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TextLowerPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class TextLowerPhysicalFunction : public PhysicalFunctionConcept { +public: + TextLowerPhysicalFunction(PhysicalFunction str); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TextUpperPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TextUpperPhysicalFunction.hpp new file mode 100644 index 0000000000..276e77130a --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TextUpperPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class TextUpperPhysicalFunction : public PhysicalFunctionConcept { +public: + TextUpperPhysicalFunction(PhysicalFunction str); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt index 51e7a233e4..6a07f7f6d9 100644 --- a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt @@ -540,6 +540,9 @@ add_plugin(ContainedSpanSpan PhysicalFunction nes-physical-operators ContainedSp add_plugin(ContainsSpanSpan PhysicalFunction nes-physical-operators ContainsSpanSpanPhysicalFunction.cpp) add_plugin(ContainedFloatspanSpan PhysicalFunction nes-physical-operators ContainedFloatspanSpanPhysicalFunction.cpp) add_plugin(ContainsFloatspanSpan PhysicalFunction nes-physical-operators ContainsFloatspanSpanPhysicalFunction.cpp) +add_plugin(TextUpper PhysicalFunction nes-physical-operators TextUpperPhysicalFunction.cpp) +add_plugin(TextLower PhysicalFunction nes-physical-operators TextLowerPhysicalFunction.cpp) +add_plugin(TextInitcap PhysicalFunction nes-physical-operators TextInitcapPhysicalFunction.cpp) add_plugin(GeomRelatePattern PhysicalFunction nes-physical-operators GeomRelatePatternPhysicalFunction.cpp) add_plugin(GeomIntersects2d PhysicalFunction nes-physical-operators GeomIntersects2dPhysicalFunction.cpp) add_plugin(GeomDwithin2d PhysicalFunction nes-physical-operators GeomDwithin2dPhysicalFunction.cpp) diff --git a/nes-physical-operators/src/Functions/Meos/TextInitcapPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TextInitcapPhysicalFunction.cpp new file mode 100644 index 0000000000..92efe41695 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TextInitcapPhysicalFunction.cpp @@ -0,0 +1,80 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +} +#include +#include + +namespace NES { + +TextInitcapPhysicalFunction::TextInitcapPhysicalFunction(PhysicalFunction str) +{ + paramFns.reserve(1); + paramFns.push_back(std::move(str)); +} + +VarVal TextInitcapPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { + auto str = paramFns[0].execute(record, arena).cast(); + constexpr uint32_t MAX_LEN = 4096; + auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); + const auto actualLen = nautilus::invoke( + +[](const char* w, uint32_t wsz, char* buf, uint32_t bufMax) -> uint32_t { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string s(w, wsz); + text* t = cstring_to_text(s.c_str()); + if (!t) return 0u; + text* res = text_initcap(t); + free(t); + if (!res) return 0u; + char* out = text_to_cstring(res); + free(res); + if (!out) return 0u; + uint32_t len = static_cast(strlen(out)); + if (len > bufMax) len = bufMax; + memcpy(buf, out, len); + free(out); + return len; + } catch (const std::exception&) { return 0u; } + }, + str, outBuf.getContent(), nautilus::val(MAX_LEN)); + VarVal(actualLen).writeToMemory(outBuf.getReference()); + return outBuf; +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTextInitcapPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size()==1, + "TextInitcapPhysicalFunction requires 1 child but got {}", + arguments.childFunctions.size()); + return TextInitcapPhysicalFunction(std::move(arguments.childFunctions[0])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TextLowerPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TextLowerPhysicalFunction.cpp new file mode 100644 index 0000000000..d59a527b8a --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TextLowerPhysicalFunction.cpp @@ -0,0 +1,80 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +} +#include +#include + +namespace NES { + +TextLowerPhysicalFunction::TextLowerPhysicalFunction(PhysicalFunction str) +{ + paramFns.reserve(1); + paramFns.push_back(std::move(str)); +} + +VarVal TextLowerPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { + auto str = paramFns[0].execute(record, arena).cast(); + constexpr uint32_t MAX_LEN = 4096; + auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); + const auto actualLen = nautilus::invoke( + +[](const char* w, uint32_t wsz, char* buf, uint32_t bufMax) -> uint32_t { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string s(w, wsz); + text* t = cstring_to_text(s.c_str()); + if (!t) return 0u; + text* res = text_lower(t); + free(t); + if (!res) return 0u; + char* out = text_to_cstring(res); + free(res); + if (!out) return 0u; + uint32_t len = static_cast(strlen(out)); + if (len > bufMax) len = bufMax; + memcpy(buf, out, len); + free(out); + return len; + } catch (const std::exception&) { return 0u; } + }, + str, outBuf.getContent(), nautilus::val(MAX_LEN)); + VarVal(actualLen).writeToMemory(outBuf.getReference()); + return outBuf; +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTextLowerPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size()==1, + "TextLowerPhysicalFunction requires 1 child but got {}", + arguments.childFunctions.size()); + return TextLowerPhysicalFunction(std::move(arguments.childFunctions[0])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TextUpperPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TextUpperPhysicalFunction.cpp new file mode 100644 index 0000000000..e8fdcb3b4e --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TextUpperPhysicalFunction.cpp @@ -0,0 +1,80 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +} +#include +#include + +namespace NES { + +TextUpperPhysicalFunction::TextUpperPhysicalFunction(PhysicalFunction str) +{ + paramFns.reserve(1); + paramFns.push_back(std::move(str)); +} + +VarVal TextUpperPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { + auto str = paramFns[0].execute(record, arena).cast(); + constexpr uint32_t MAX_LEN = 4096; + auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); + const auto actualLen = nautilus::invoke( + +[](const char* w, uint32_t wsz, char* buf, uint32_t bufMax) -> uint32_t { + try { + MEOS::Meos::ensureMeosInitialized(); + std::string s(w, wsz); + text* t = cstring_to_text(s.c_str()); + if (!t) return 0u; + text* res = text_upper(t); + free(t); + if (!res) return 0u; + char* out = text_to_cstring(res); + free(res); + if (!out) return 0u; + uint32_t len = static_cast(strlen(out)); + if (len > bufMax) len = bufMax; + memcpy(buf, out, len); + free(out); + return len; + } catch (const std::exception&) { return 0u; } + }, + str, outBuf.getContent(), nautilus::val(MAX_LEN)); + VarVal(actualLen).writeToMemory(outBuf.getReference()); + return outBuf; +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTextUpperPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size()==1, + "TextUpperPhysicalFunction requires 1 child but got {}", + arguments.childFunctions.size()); + return TextUpperPhysicalFunction(std::move(arguments.childFunctions[0])); +} + +} // namespace NES diff --git a/nes-sql-parser/AntlrSQL.g4 b/nes-sql-parser/AntlrSQL.g4 index 5c15475dbf..cb15b8e9cf 100644 --- a/nes-sql-parser/AntlrSQL.g4 +++ b/nes-sql-parser/AntlrSQL.g4 @@ -295,7 +295,7 @@ timeUnit: MS timestampParameter: name=identifier; -functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT | TGE_TTEXT_TEXT | TGE_TEXT_TTEXT | TGT_TTEXT_TEXT | TGT_TEXT_TTEXT | TLE_TTEXT_TEXT | TLE_TEXT_TTEXT | TLT_TTEXT_TEXT | TLT_TEXT_TTEXT | TTEXT_UPPER | TTEXT_LOWER | TTEXT_INITCAP | TEXTCAT_TTEXT_TEXT | TEXTCAT_TEXT_TTEXT | TEXTCAT_TTEXT_TTEXT | GEOM_LENGTH | GEOM_PERIMETER | GEOM_AZIMUTH | GEOG_AREA | GEOG_LENGTH | GEOG_PERIMETER | GEOM_IS_EMPTY | AINTERSECTS_TGEO_GEO | ACOVERS_TGEO_GEO | ADISJOINT_TGEO_GEO | ADWITHIN_TGEO_GEO | EINTERSECTS_TGEO_GEO | ETOUCHES_TGEO_GEO | ECONTAINS_TGEO_GEO | ACONTAINS_TGEO_GEO | ATOUCHES_TGEO_GEO | GEO_NUM_POINTS | GEO_NUM_GEOS | GEO_SRID | GEO_IS_UNITARY | GEO_EQUALS | GEO_SAME | GEOG_DISTANCE | NAD_TGEO_GEO | EVER_EQ_TGEO_GEO | EVER_NE_TGEO_GEO | ALWAYS_EQ_TGEO_GEO | ALWAYS_NE_TGEO_GEO | GEOG_INTERSECTS | GEOG_DWITHIN | ACOVERS_GEO_TGEO | GEOM_INTERSECTS | GEOM_DWITHIN | H3_GS_POINT_TO_CELL | EVER_EQ_TH3INDEX_H3INDEX | EVER_NE_TH3INDEX_H3INDEX | ALWAYS_EQ_TH3INDEX_H3INDEX | ALWAYS_NE_TH3INDEX_H3INDEX | TH3INDEX_GET_RESOLUTION | TH3INDEX_GET_BASE_CELL_NUMBER | TH3INDEX_IS_VALID_CELL | TH3INDEX_IS_PENTAGON | TH3INDEX_CELL_TO_PARENT_NEXT | TH3INDEX_CELL_TO_CENTER_CHILD_NEXT | TH3INDEX_CELL_TO_PARENT | TH3INDEX_CELL_TO_CENTER_CHILD | TH3INDEX_CELL_TO_CHILD_POS | TH3INDEX_ARE_NEIGHBOR_CELLS | TH3INDEX_GRID_DISTANCE | EINTERSECTS_TCBUFFER_GEO | AINTERSECTS_TCBUFFER_GEO | ECOVERS_TCBUFFER_GEO | ACOVERS_TCBUFFER_GEO | EDISJOINT_TCBUFFER_GEO | ADISJOINT_TCBUFFER_GEO | ETOUCHES_TCBUFFER_GEO | ATOUCHES_TCBUFFER_GEO | ECONTAINS_TCBUFFER_GEO | ACONTAINS_TCBUFFER_GEO | NAD_TCBUFFER_GEO | EDWITHIN_TCBUFFER_GEO | ADWITHIN_TCBUFFER_GEO | EINTERSECTS_TCBUFFER_CBUFFER | AINTERSECTS_TCBUFFER_CBUFFER | ECOVERS_TCBUFFER_CBUFFER | ACOVERS_TCBUFFER_CBUFFER | EDISJOINT_TCBUFFER_CBUFFER | ADISJOINT_TCBUFFER_CBUFFER | ETOUCHES_TCBUFFER_CBUFFER | ATOUCHES_TCBUFFER_CBUFFER | ECONTAINS_TCBUFFER_CBUFFER | ACONTAINS_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_CBUFFER | ALWAYS_EQ_TCBUFFER_CBUFFER | EVER_NE_TCBUFFER_CBUFFER | ALWAYS_NE_TCBUFFER_CBUFFER | NAD_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_TCBUFFER | ALWAYS_EQ_TCBUFFER_TCBUFFER | EVER_NE_TCBUFFER_TCBUFFER | ALWAYS_NE_TCBUFFER_TCBUFFER | EINTERSECTS_TCBUFFER_TCBUFFER | AINTERSECTS_TCBUFFER_TCBUFFER | ECOVERS_TCBUFFER_TCBUFFER | ACOVERS_TCBUFFER_TCBUFFER | ADISJOINT_TCBUFFER_TCBUFFER | ETOUCHES_TCBUFFER_TCBUFFER | ATOUCHES_TCBUFFER_TCBUFFER | NAD_TCBUFFER_TCBUFFER | EDWITHIN_TCBUFFER_TCBUFFER | ADWITHIN_TCBUFFER_TCBUFFER | MINDISTANCE_TCBUFFER_TCBUFFER | NAD_TNPOINT_GEO | EVER_EQ_TNPOINT_NPOINT | ALWAYS_EQ_TNPOINT_NPOINT | EVER_NE_TNPOINT_NPOINT | ALWAYS_NE_TNPOINT_NPOINT | NAD_TNPOINT_NPOINT | EVER_EQ_NPOINT_TNPOINT | ALWAYS_EQ_NPOINT_TNPOINT | EVER_NE_NPOINT_TNPOINT | ALWAYS_NE_NPOINT_TNPOINT | EVER_EQ_TNPOINT_TNPOINT | ALWAYS_EQ_TNPOINT_TNPOINT | EVER_NE_TNPOINT_TNPOINT | ALWAYS_NE_TNPOINT_TNPOINT | NAD_TNPOINT_TNPOINT | NAD_TPOSE_GEO | EVER_EQ_TPOSE_POSE | ALWAYS_EQ_TPOSE_POSE | EVER_NE_TPOSE_POSE | ALWAYS_NE_TPOSE_POSE | NAD_TPOSE_POSE | EVER_EQ_POSE_TPOSE | ALWAYS_EQ_POSE_TPOSE | EVER_NE_POSE_TPOSE | ALWAYS_NE_POSE_TPOSE | EVER_EQ_TPOSE_TPOSE | ALWAYS_EQ_TPOSE_TPOSE | EVER_NE_TPOSE_TPOSE | ALWAYS_NE_TPOSE_TPOSE | NAD_TPOSE_TPOSE | EVER_EQ_TRGEOMETRY_GEO | ALWAYS_EQ_TRGEOMETRY_GEO | EVER_NE_TRGEOMETRY_GEO | ALWAYS_NE_TRGEOMETRY_GEO | NAD_TRGEOMETRY_GEO | EVER_EQ_GEO_TRGEOMETRY | ALWAYS_EQ_GEO_TRGEOMETRY | EVER_NE_GEO_TRGEOMETRY | ALWAYS_NE_GEO_TRGEOMETRY | EVER_EQ_TRGEOMETRY_TRGEOMETRY | ALWAYS_EQ_TRGEOMETRY_TRGEOMETRY | EVER_NE_TRGEOMETRY_TRGEOMETRY | ALWAYS_NE_TRGEOMETRY_TRGEOMETRY | NAD_TRGEOMETRY_TRGEOMETRY | EINTERSECTS_TPCPOINT_GEO | NAD_TPCPOINT_GEO | QUADBIN_POINT_TO_CELL | QUADBIN_IS_VALID_CELL | QUADBIN_GET_RESOLUTION | QUADBIN_CELL_AREA | QUADBIN_CELL_TO_QUADKEY | QUADBIN_CELL_TO_PARENT | QUADBIN_TILE_TO_CELL | EVER_EQ_TJSONB_JSONB | ALWAYS_EQ_TJSONB_JSONB | EVER_NE_TJSONB_JSONB | ALWAYS_NE_TJSONB_JSONB | EVER_EQ_TJSONB_TJSONB | ALWAYS_EQ_TJSONB_TJSONB | EVER_NE_TJSONB_TJSONB | ALWAYS_NE_TJSONB_TJSONB | GEOM_BOUNDARY | GEOM_CENTROID | GEOM_CONVEX_HULL | GEO_REVERSE | GEO_POINTS | GEOM_UNARY_UNION | GEOM_DIFFERENCE2D | GEOM_INTERSECTION2D | GEOM_SHORTESTLINE2D | GEOM_SHORTESTLINE3D | GEO_SET_SRID | GEO_TRANSFORM | GEO_ROUND | GEOM_BUFFER | LINE_NUMPOINTS | LINE_LOCATE_POINT | LINE_INTERPOLATE_POINT | LINE_SUBSTRING | GEOM_POINT_MAKE2D | GEOM_POINT_MAKE3DZ | GEOG_POINT_MAKE2D | GEOG_POINT_MAKE3DZ | GEOM_TO_GEOG | GEOG_TO_GEOM | GEOG_CENTROID | GEO_GEO_N | LINE_POINT_N | GEOM_INTERSECTION2D_COLL | GEO_AS_GEOJSON | GEO_AS_HEXEWKB | GEO_AS_EWKT | GEO_FROM_GEOJSON | GEOM_FROM_HEXEWKB | GEO_TRANSFORM_PIPELINE | GEOM_MIN_BOUNDING_CENTER | GEOM_MIN_BOUNDING_RADIUS | EVER_EQ_TGEO_TGEO | EVER_NE_TGEO_TGEO | ALWAYS_EQ_TGEO_TGEO | ALWAYS_NE_TGEO_TGEO | EINTERSECTS_TGEO_TGEO | ECOVERS_TGEO_TGEO | EDISJOINT_TGEO_TGEO | ECONTAINS_TGEO_TGEO | ETOUCHES_TGEO_TGEO | AINTERSECTS_TGEO_TGEO | ACOVERS_TGEO_TGEO | ADISJOINT_TGEO_TGEO | ACONTAINS_TGEO_TGEO | ATOUCHES_TGEO_TGEO | EDWITHIN_TGEO_TGEO | ADWITHIN_TGEO_TGEO | H3INDEX_EQ | H3INDEX_NE | H3INDEX_LT | H3INDEX_LE | H3INDEX_GT | H3INDEX_GE | H3INDEX_CMP | H3INDEX_OUT | H3INDEX_IN | JSON_ARRAY_LENGTH | JSON_TYPEOF | JSON_OBJECT_FIELD_TEXT | JSON_ARRAY_ELEMENT_TEXT | JSONB_ARRAY_LENGTH | JSONB_EQ | JSONB_NE | JSONB_LT | JSONB_LE | JSONB_GT | JSONB_GE | JSONB_CMP | JSONB_CONTAINS | JSONB_CONTAINED | JSONB_EXISTS | JSONB_TO_CSTRING | JSONB_PRETTY | JSONB_OBJECT_FIELD_TEXT | JSONB_ARRAY_ELEMENT_TEXT | INTSPAN_MAKE | FLOATSPAN_MAKE | INTSPAN_LOWER | INTSPAN_UPPER | INTSPAN_WIDTH | INTSPAN_LOWER_INC | INTSPAN_UPPER_INC | FLOATSPAN_LOWER | FLOATSPAN_UPPER | FLOATSPAN_WIDTH | FLOATSPAN_LOWER_INC | FLOATSPAN_UPPER_INC | CONTAINED_INT_SPAN | CONTAINED_FLOAT_SPAN | CONTAINS_SPAN_INT | CONTAINS_SPAN_FLOAT | CONTAINED_SPAN_SPAN | CONTAINS_SPAN_SPAN | CONTAINED_FLOATSPAN_SPAN | CONTAINS_FLOATSPAN_SPAN | GEOM_RELATE_PATTERN | GEOM_INTERSECTS2D | GEOM_DWITHIN2D | GEOM_CONTAINS | GEOM_DISJOINT2D | GEOM_COVERS | GEOM_TOUCHES | GEOM_INTERSECTS3D | GEOM_DWITHIN3D | GEOM_DISTANCE2D | GEOM_DISTANCE3D; +functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT | TGE_TTEXT_TEXT | TGE_TEXT_TTEXT | TGT_TTEXT_TEXT | TGT_TEXT_TTEXT | TLE_TTEXT_TEXT | TLE_TEXT_TTEXT | TLT_TTEXT_TEXT | TLT_TEXT_TTEXT | TTEXT_UPPER | TTEXT_LOWER | TTEXT_INITCAP | TEXTCAT_TTEXT_TEXT | TEXTCAT_TEXT_TTEXT | TEXTCAT_TTEXT_TTEXT | GEOM_LENGTH | GEOM_PERIMETER | GEOM_AZIMUTH | GEOG_AREA | GEOG_LENGTH | GEOG_PERIMETER | GEOM_IS_EMPTY | AINTERSECTS_TGEO_GEO | ACOVERS_TGEO_GEO | ADISJOINT_TGEO_GEO | ADWITHIN_TGEO_GEO | EINTERSECTS_TGEO_GEO | ETOUCHES_TGEO_GEO | ECONTAINS_TGEO_GEO | ACONTAINS_TGEO_GEO | ATOUCHES_TGEO_GEO | GEO_NUM_POINTS | GEO_NUM_GEOS | GEO_SRID | GEO_IS_UNITARY | GEO_EQUALS | GEO_SAME | GEOG_DISTANCE | NAD_TGEO_GEO | EVER_EQ_TGEO_GEO | EVER_NE_TGEO_GEO | ALWAYS_EQ_TGEO_GEO | ALWAYS_NE_TGEO_GEO | GEOG_INTERSECTS | GEOG_DWITHIN | ACOVERS_GEO_TGEO | GEOM_INTERSECTS | GEOM_DWITHIN | H3_GS_POINT_TO_CELL | EVER_EQ_TH3INDEX_H3INDEX | EVER_NE_TH3INDEX_H3INDEX | ALWAYS_EQ_TH3INDEX_H3INDEX | ALWAYS_NE_TH3INDEX_H3INDEX | TH3INDEX_GET_RESOLUTION | TH3INDEX_GET_BASE_CELL_NUMBER | TH3INDEX_IS_VALID_CELL | TH3INDEX_IS_PENTAGON | TH3INDEX_CELL_TO_PARENT_NEXT | TH3INDEX_CELL_TO_CENTER_CHILD_NEXT | TH3INDEX_CELL_TO_PARENT | TH3INDEX_CELL_TO_CENTER_CHILD | TH3INDEX_CELL_TO_CHILD_POS | TH3INDEX_ARE_NEIGHBOR_CELLS | TH3INDEX_GRID_DISTANCE | EINTERSECTS_TCBUFFER_GEO | AINTERSECTS_TCBUFFER_GEO | ECOVERS_TCBUFFER_GEO | ACOVERS_TCBUFFER_GEO | EDISJOINT_TCBUFFER_GEO | ADISJOINT_TCBUFFER_GEO | ETOUCHES_TCBUFFER_GEO | ATOUCHES_TCBUFFER_GEO | ECONTAINS_TCBUFFER_GEO | ACONTAINS_TCBUFFER_GEO | NAD_TCBUFFER_GEO | EDWITHIN_TCBUFFER_GEO | ADWITHIN_TCBUFFER_GEO | EINTERSECTS_TCBUFFER_CBUFFER | AINTERSECTS_TCBUFFER_CBUFFER | ECOVERS_TCBUFFER_CBUFFER | ACOVERS_TCBUFFER_CBUFFER | EDISJOINT_TCBUFFER_CBUFFER | ADISJOINT_TCBUFFER_CBUFFER | ETOUCHES_TCBUFFER_CBUFFER | ATOUCHES_TCBUFFER_CBUFFER | ECONTAINS_TCBUFFER_CBUFFER | ACONTAINS_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_CBUFFER | ALWAYS_EQ_TCBUFFER_CBUFFER | EVER_NE_TCBUFFER_CBUFFER | ALWAYS_NE_TCBUFFER_CBUFFER | NAD_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_TCBUFFER | ALWAYS_EQ_TCBUFFER_TCBUFFER | EVER_NE_TCBUFFER_TCBUFFER | ALWAYS_NE_TCBUFFER_TCBUFFER | EINTERSECTS_TCBUFFER_TCBUFFER | AINTERSECTS_TCBUFFER_TCBUFFER | ECOVERS_TCBUFFER_TCBUFFER | ACOVERS_TCBUFFER_TCBUFFER | ADISJOINT_TCBUFFER_TCBUFFER | ETOUCHES_TCBUFFER_TCBUFFER | ATOUCHES_TCBUFFER_TCBUFFER | NAD_TCBUFFER_TCBUFFER | EDWITHIN_TCBUFFER_TCBUFFER | ADWITHIN_TCBUFFER_TCBUFFER | MINDISTANCE_TCBUFFER_TCBUFFER | NAD_TNPOINT_GEO | EVER_EQ_TNPOINT_NPOINT | ALWAYS_EQ_TNPOINT_NPOINT | EVER_NE_TNPOINT_NPOINT | ALWAYS_NE_TNPOINT_NPOINT | NAD_TNPOINT_NPOINT | EVER_EQ_NPOINT_TNPOINT | ALWAYS_EQ_NPOINT_TNPOINT | EVER_NE_NPOINT_TNPOINT | ALWAYS_NE_NPOINT_TNPOINT | EVER_EQ_TNPOINT_TNPOINT | ALWAYS_EQ_TNPOINT_TNPOINT | EVER_NE_TNPOINT_TNPOINT | ALWAYS_NE_TNPOINT_TNPOINT | NAD_TNPOINT_TNPOINT | NAD_TPOSE_GEO | EVER_EQ_TPOSE_POSE | ALWAYS_EQ_TPOSE_POSE | EVER_NE_TPOSE_POSE | ALWAYS_NE_TPOSE_POSE | NAD_TPOSE_POSE | EVER_EQ_POSE_TPOSE | ALWAYS_EQ_POSE_TPOSE | EVER_NE_POSE_TPOSE | ALWAYS_NE_POSE_TPOSE | EVER_EQ_TPOSE_TPOSE | ALWAYS_EQ_TPOSE_TPOSE | EVER_NE_TPOSE_TPOSE | ALWAYS_NE_TPOSE_TPOSE | NAD_TPOSE_TPOSE | EVER_EQ_TRGEOMETRY_GEO | ALWAYS_EQ_TRGEOMETRY_GEO | EVER_NE_TRGEOMETRY_GEO | ALWAYS_NE_TRGEOMETRY_GEO | NAD_TRGEOMETRY_GEO | EVER_EQ_GEO_TRGEOMETRY | ALWAYS_EQ_GEO_TRGEOMETRY | EVER_NE_GEO_TRGEOMETRY | ALWAYS_NE_GEO_TRGEOMETRY | EVER_EQ_TRGEOMETRY_TRGEOMETRY | ALWAYS_EQ_TRGEOMETRY_TRGEOMETRY | EVER_NE_TRGEOMETRY_TRGEOMETRY | ALWAYS_NE_TRGEOMETRY_TRGEOMETRY | NAD_TRGEOMETRY_TRGEOMETRY | EINTERSECTS_TPCPOINT_GEO | NAD_TPCPOINT_GEO | QUADBIN_POINT_TO_CELL | QUADBIN_IS_VALID_CELL | QUADBIN_GET_RESOLUTION | QUADBIN_CELL_AREA | QUADBIN_CELL_TO_QUADKEY | QUADBIN_CELL_TO_PARENT | QUADBIN_TILE_TO_CELL | EVER_EQ_TJSONB_JSONB | ALWAYS_EQ_TJSONB_JSONB | EVER_NE_TJSONB_JSONB | ALWAYS_NE_TJSONB_JSONB | EVER_EQ_TJSONB_TJSONB | ALWAYS_EQ_TJSONB_TJSONB | EVER_NE_TJSONB_TJSONB | ALWAYS_NE_TJSONB_TJSONB | GEOM_BOUNDARY | GEOM_CENTROID | GEOM_CONVEX_HULL | GEO_REVERSE | GEO_POINTS | GEOM_UNARY_UNION | GEOM_DIFFERENCE2D | GEOM_INTERSECTION2D | GEOM_SHORTESTLINE2D | GEOM_SHORTESTLINE3D | GEO_SET_SRID | GEO_TRANSFORM | GEO_ROUND | GEOM_BUFFER | LINE_NUMPOINTS | LINE_LOCATE_POINT | LINE_INTERPOLATE_POINT | LINE_SUBSTRING | GEOM_POINT_MAKE2D | GEOM_POINT_MAKE3DZ | GEOG_POINT_MAKE2D | GEOG_POINT_MAKE3DZ | GEOM_TO_GEOG | GEOG_TO_GEOM | GEOG_CENTROID | GEO_GEO_N | LINE_POINT_N | GEOM_INTERSECTION2D_COLL | GEO_AS_GEOJSON | GEO_AS_HEXEWKB | GEO_AS_EWKT | GEO_FROM_GEOJSON | GEOM_FROM_HEXEWKB | GEO_TRANSFORM_PIPELINE | GEOM_MIN_BOUNDING_CENTER | GEOM_MIN_BOUNDING_RADIUS | EVER_EQ_TGEO_TGEO | EVER_NE_TGEO_TGEO | ALWAYS_EQ_TGEO_TGEO | ALWAYS_NE_TGEO_TGEO | EINTERSECTS_TGEO_TGEO | ECOVERS_TGEO_TGEO | EDISJOINT_TGEO_TGEO | ECONTAINS_TGEO_TGEO | ETOUCHES_TGEO_TGEO | AINTERSECTS_TGEO_TGEO | ACOVERS_TGEO_TGEO | ADISJOINT_TGEO_TGEO | ACONTAINS_TGEO_TGEO | ATOUCHES_TGEO_TGEO | EDWITHIN_TGEO_TGEO | ADWITHIN_TGEO_TGEO | H3INDEX_EQ | H3INDEX_NE | H3INDEX_LT | H3INDEX_LE | H3INDEX_GT | H3INDEX_GE | H3INDEX_CMP | H3INDEX_OUT | H3INDEX_IN | JSON_ARRAY_LENGTH | JSON_TYPEOF | JSON_OBJECT_FIELD_TEXT | JSON_ARRAY_ELEMENT_TEXT | JSONB_ARRAY_LENGTH | JSONB_EQ | JSONB_NE | JSONB_LT | JSONB_LE | JSONB_GT | JSONB_GE | JSONB_CMP | JSONB_CONTAINS | JSONB_CONTAINED | JSONB_EXISTS | JSONB_TO_CSTRING | JSONB_PRETTY | JSONB_OBJECT_FIELD_TEXT | JSONB_ARRAY_ELEMENT_TEXT | INTSPAN_MAKE | FLOATSPAN_MAKE | INTSPAN_LOWER | INTSPAN_UPPER | INTSPAN_WIDTH | INTSPAN_LOWER_INC | INTSPAN_UPPER_INC | FLOATSPAN_LOWER | FLOATSPAN_UPPER | FLOATSPAN_WIDTH | FLOATSPAN_LOWER_INC | FLOATSPAN_UPPER_INC | CONTAINED_INT_SPAN | CONTAINED_FLOAT_SPAN | CONTAINS_SPAN_INT | CONTAINS_SPAN_FLOAT | CONTAINED_SPAN_SPAN | CONTAINS_SPAN_SPAN | CONTAINED_FLOATSPAN_SPAN | CONTAINS_FLOATSPAN_SPAN | TEXT_UPPER | TEXT_LOWER | TEXT_INITCAP | GEOM_RELATE_PATTERN | GEOM_INTERSECTS2D | GEOM_DWITHIN2D | GEOM_CONTAINS | GEOM_DISJOINT2D | GEOM_COVERS | GEOM_TOUCHES | GEOM_INTERSECTS3D | GEOM_DWITHIN3D | GEOM_DISTANCE2D | GEOM_DISTANCE3D; sinkClause: INTO sink (',' sink)*; @@ -1011,6 +1011,9 @@ CONTAINED_SPAN_SPAN: 'CONTAINED_SPAN_SPAN' | 'contained_intspan_intspan'; CONTAINS_SPAN_SPAN: 'CONTAINS_SPAN_SPAN' | 'contains_intspan_intspan'; CONTAINED_FLOATSPAN_SPAN: 'CONTAINED_FLOATSPAN_SPAN' | 'contained_floatspan_floatspan'; CONTAINS_FLOATSPAN_SPAN: 'CONTAINS_FLOATSPAN_SPAN' | 'contains_floatspan_floatspan'; +TEXT_UPPER: 'TEXT_UPPER' | 'text_upper'; +TEXT_LOWER: 'TEXT_LOWER' | 'text_lower'; +TEXT_INITCAP: 'TEXT_INITCAP' | 'text_initcap'; GEOM_RELATE_PATTERN: 'GEOM_RELATE_PATTERN' | 'geom_relate_pattern'; GEOM_INTERSECTS2D: 'GEOM_INTERSECTS2D' | 'geom_intersects2d'; GEOM_DWITHIN2D: 'GEOM_DWITHIN2D' | 'geom_dwithin2d'; diff --git a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp index 4d286de9ee..567f0d9840 100644 --- a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp +++ b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp @@ -592,6 +592,9 @@ #include #include #include +#include +#include +#include #include #include #include @@ -11820,6 +11823,30 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont return LogicalFunction(ContainsFloatspanSpanLogicalFunction(std::move(arg0), std::move(arg1))); } /* END CODEGEN PARSER GLUE: CONTAINS_FLOATSPAN_SPAN */ + case AntlrSQLParser::TEXT_UPPER: { + PRECONDITION(ctx->functionParam().size() == 1, + "TextUpper requires 1 arg but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + return LogicalFunction(TextUpperLogicalFunction(std::move(arg0))); + } + /* END CODEGEN PARSER GLUE: TEXT_UPPER */ + case AntlrSQLParser::TEXT_LOWER: { + PRECONDITION(ctx->functionParam().size() == 1, + "TextLower requires 1 arg but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + return LogicalFunction(TextLowerLogicalFunction(std::move(arg0))); + } + /* END CODEGEN PARSER GLUE: TEXT_LOWER */ + case AntlrSQLParser::TEXT_INITCAP: { + PRECONDITION(ctx->functionParam().size() == 1, + "TextInitcap requires 1 arg but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + return LogicalFunction(TextInitcapLogicalFunction(std::move(arg0))); + } + /* END CODEGEN PARSER GLUE: TEXT_INITCAP */ /* END CODEGEN PARSER GLUE: GEOM_RELATE_PATTERN */ /* END CODEGEN PARSER GLUE: GEOM_INTERSECTS2D */ case AntlrSQLParser::GEOM_DWITHIN2D: { From 39e1854a4e692dc7406203dcaa6993410025d305 Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Fri, 19 Jun 2026 21:54:42 +0200 Subject: [PATCH 94/96] feat(meos): add Quadbin static comparator NES operators (W146) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Wires QUADBIN_EQ/NE/LT/LE/GT/GE (UINT64×UINT64 → FLOAT64, 0/1) and QUADBIN_CMP (UINT64×UINT64 → FLOAT64, -1/0/1), backed by quadbin_eq, quadbin_ne, quadbin_lt, quadbin_le, quadbin_gt, quadbin_ge, and quadbin_cmp. Mirrors the H3INDEX_EQ/CMP pattern from W138. --- .../Meos/QuadbinCmpLogicalFunction.hpp | 45 +++++++++++ .../Meos/QuadbinEqLogicalFunction.hpp | 45 +++++++++++ .../Meos/QuadbinGeLogicalFunction.hpp | 45 +++++++++++ .../Meos/QuadbinGtLogicalFunction.hpp | 45 +++++++++++ .../Meos/QuadbinLeLogicalFunction.hpp | 45 +++++++++++ .../Meos/QuadbinLtLogicalFunction.hpp | 45 +++++++++++ .../Meos/QuadbinNeLogicalFunction.hpp | 45 +++++++++++ .../src/Functions/Meos/CMakeLists.txt | 7 ++ .../Meos/QuadbinCmpLogicalFunction.cpp | 74 +++++++++++++++++++ .../Meos/QuadbinEqLogicalFunction.cpp | 74 +++++++++++++++++++ .../Meos/QuadbinGeLogicalFunction.cpp | 74 +++++++++++++++++++ .../Meos/QuadbinGtLogicalFunction.cpp | 74 +++++++++++++++++++ .../Meos/QuadbinLeLogicalFunction.cpp | 74 +++++++++++++++++++ .../Meos/QuadbinLtLogicalFunction.cpp | 74 +++++++++++++++++++ .../Meos/QuadbinNeLogicalFunction.cpp | 74 +++++++++++++++++++ .../Meos/QuadbinCmpPhysicalFunction.hpp | 32 ++++++++ .../Meos/QuadbinEqPhysicalFunction.hpp | 32 ++++++++ .../Meos/QuadbinGePhysicalFunction.hpp | 32 ++++++++ .../Meos/QuadbinGtPhysicalFunction.hpp | 32 ++++++++ .../Meos/QuadbinLePhysicalFunction.hpp | 32 ++++++++ .../Meos/QuadbinLtPhysicalFunction.hpp | 32 ++++++++ .../Meos/QuadbinNePhysicalFunction.hpp | 32 ++++++++ .../src/Functions/Meos/CMakeLists.txt | 7 ++ .../Meos/QuadbinCmpPhysicalFunction.cpp | 64 ++++++++++++++++ .../Meos/QuadbinEqPhysicalFunction.cpp | 65 ++++++++++++++++ .../Meos/QuadbinGePhysicalFunction.cpp | 65 ++++++++++++++++ .../Meos/QuadbinGtPhysicalFunction.cpp | 65 ++++++++++++++++ .../Meos/QuadbinLePhysicalFunction.cpp | 65 ++++++++++++++++ .../Meos/QuadbinLtPhysicalFunction.cpp | 65 ++++++++++++++++ .../Meos/QuadbinNePhysicalFunction.cpp | 65 ++++++++++++++++ nes-sql-parser/AntlrSQL.g4 | 9 ++- .../src/AntlrSQLQueryPlanCreator.cpp | 70 ++++++++++++++++++ 32 files changed, 1603 insertions(+), 1 deletion(-) create mode 100644 nes-logical-operators/include/Functions/Meos/QuadbinCmpLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/QuadbinEqLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/QuadbinGeLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/QuadbinGtLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/QuadbinLeLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/QuadbinLtLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/QuadbinNeLogicalFunction.hpp create mode 100644 nes-logical-operators/src/Functions/Meos/QuadbinCmpLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/QuadbinEqLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/QuadbinGeLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/QuadbinGtLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/QuadbinLeLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/QuadbinLtLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/QuadbinNeLogicalFunction.cpp create mode 100644 nes-physical-operators/include/Functions/Meos/QuadbinCmpPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/QuadbinEqPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/QuadbinGePhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/QuadbinGtPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/QuadbinLePhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/QuadbinLtPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/QuadbinNePhysicalFunction.hpp create mode 100644 nes-physical-operators/src/Functions/Meos/QuadbinCmpPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/QuadbinEqPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/QuadbinGePhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/QuadbinGtPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/QuadbinLePhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/QuadbinLtPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/QuadbinNePhysicalFunction.cpp diff --git a/nes-logical-operators/include/Functions/Meos/QuadbinCmpLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/QuadbinCmpLogicalFunction.hpp new file mode 100644 index 0000000000..c9c89404df --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/QuadbinCmpLogicalFunction.hpp @@ -0,0 +1,45 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns -1, 0, or 1 comparison result for two Quadbin cells. + */ +class QuadbinCmpLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "QuadbinCmp"; + QuadbinCmpLogicalFunction(LogicalFunction a, LogicalFunction b); + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/QuadbinEqLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/QuadbinEqLogicalFunction.hpp new file mode 100644 index 0000000000..f60c70bca3 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/QuadbinEqLogicalFunction.hpp @@ -0,0 +1,45 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Tests equality of two Quadbin cell identifiers. + */ +class QuadbinEqLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "QuadbinEq"; + QuadbinEqLogicalFunction(LogicalFunction a, LogicalFunction b); + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/QuadbinGeLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/QuadbinGeLogicalFunction.hpp new file mode 100644 index 0000000000..15d962f538 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/QuadbinGeLogicalFunction.hpp @@ -0,0 +1,45 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Tests if Quadbin cell a is greater than or equal to b. + */ +class QuadbinGeLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "QuadbinGe"; + QuadbinGeLogicalFunction(LogicalFunction a, LogicalFunction b); + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/QuadbinGtLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/QuadbinGtLogicalFunction.hpp new file mode 100644 index 0000000000..cb95702033 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/QuadbinGtLogicalFunction.hpp @@ -0,0 +1,45 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Tests if Quadbin cell a is greater than b. + */ +class QuadbinGtLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "QuadbinGt"; + QuadbinGtLogicalFunction(LogicalFunction a, LogicalFunction b); + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/QuadbinLeLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/QuadbinLeLogicalFunction.hpp new file mode 100644 index 0000000000..9028a34a25 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/QuadbinLeLogicalFunction.hpp @@ -0,0 +1,45 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Tests if Quadbin cell a is less than or equal to b. + */ +class QuadbinLeLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "QuadbinLe"; + QuadbinLeLogicalFunction(LogicalFunction a, LogicalFunction b); + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/QuadbinLtLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/QuadbinLtLogicalFunction.hpp new file mode 100644 index 0000000000..ac8110aaf9 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/QuadbinLtLogicalFunction.hpp @@ -0,0 +1,45 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Tests if Quadbin cell a is less than b. + */ +class QuadbinLtLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "QuadbinLt"; + QuadbinLtLogicalFunction(LogicalFunction a, LogicalFunction b); + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/QuadbinNeLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/QuadbinNeLogicalFunction.hpp new file mode 100644 index 0000000000..ecf57cf315 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/QuadbinNeLogicalFunction.hpp @@ -0,0 +1,45 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Tests inequality of two Quadbin cell identifiers. + */ +class QuadbinNeLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "QuadbinNe"; + QuadbinNeLogicalFunction(LogicalFunction a, LogicalFunction b); + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt index c4aaa7a196..6f7716eaf8 100644 --- a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt @@ -544,6 +544,13 @@ add_plugin(ContainsFloatspanSpan LogicalFunction nes-logical-operators ContainsF add_plugin(TextUpper LogicalFunction nes-logical-operators TextUpperLogicalFunction.cpp) add_plugin(TextLower LogicalFunction nes-logical-operators TextLowerLogicalFunction.cpp) add_plugin(TextInitcap LogicalFunction nes-logical-operators TextInitcapLogicalFunction.cpp) +add_plugin(QuadbinEq LogicalFunction nes-logical-operators QuadbinEqLogicalFunction.cpp) +add_plugin(QuadbinNe LogicalFunction nes-logical-operators QuadbinNeLogicalFunction.cpp) +add_plugin(QuadbinLt LogicalFunction nes-logical-operators QuadbinLtLogicalFunction.cpp) +add_plugin(QuadbinLe LogicalFunction nes-logical-operators QuadbinLeLogicalFunction.cpp) +add_plugin(QuadbinGt LogicalFunction nes-logical-operators QuadbinGtLogicalFunction.cpp) +add_plugin(QuadbinGe LogicalFunction nes-logical-operators QuadbinGeLogicalFunction.cpp) +add_plugin(QuadbinCmp LogicalFunction nes-logical-operators QuadbinCmpLogicalFunction.cpp) add_plugin(GeomRelatePattern LogicalFunction nes-logical-operators GeomRelatePatternLogicalFunction.cpp) add_plugin(GeomIntersects2d LogicalFunction nes-logical-operators GeomIntersects2dLogicalFunction.cpp) add_plugin(GeomDwithin2d LogicalFunction nes-logical-operators GeomDwithin2dLogicalFunction.cpp) diff --git a/nes-logical-operators/src/Functions/Meos/QuadbinCmpLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/QuadbinCmpLogicalFunction.cpp new file mode 100644 index 0000000000..15c0fe2c39 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/QuadbinCmpLogicalFunction.cpp @@ -0,0 +1,74 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +QuadbinCmpLogicalFunction::QuadbinCmpLogicalFunction(LogicalFunction a, LogicalFunction b) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(2); + parameters.push_back(std::move(a)); + parameters.push_back(std::move(b)); +} +DataType QuadbinCmpLogicalFunction::getDataType() const { return dataType; } +LogicalFunction QuadbinCmpLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } +std::vector QuadbinCmpLogicalFunction::getChildren() const { return parameters; } +LogicalFunction QuadbinCmpLogicalFunction::withChildren(const std::vector& children) const { + PRECONDITION(children.size()==2,"QuadbinCmpLogicalFunction requires 2 children, but got {}",children.size()); + auto c=*this; c.parameters=children; return c; +} +std::string_view QuadbinCmpLogicalFunction::getType() const { return NAME; } +bool QuadbinCmpLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + return false; +} +std::string QuadbinCmpLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("{}({})",NAME,parameters[0].explain(v)); +} +LogicalFunction QuadbinCmpLogicalFunction::withInferredDataType(const Schema& schema) const { + std::vector c; c.reserve(2); + for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "a must be UINT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "b must be UINT64"); + return withChildren(c); +} +SerializableFunction QuadbinCmpLogicalFunction::serialize() const { + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + return proto; +} +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterQuadbinCmpLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size()==2, + "QuadbinCmpLogicalFunction requires 2 children but got {}", + arguments.children.size()); + return QuadbinCmpLogicalFunction(std::move(arguments.children[0]), + std::move(arguments.children[1])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/QuadbinEqLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/QuadbinEqLogicalFunction.cpp new file mode 100644 index 0000000000..7a3277ea9c --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/QuadbinEqLogicalFunction.cpp @@ -0,0 +1,74 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +QuadbinEqLogicalFunction::QuadbinEqLogicalFunction(LogicalFunction a, LogicalFunction b) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(2); + parameters.push_back(std::move(a)); + parameters.push_back(std::move(b)); +} +DataType QuadbinEqLogicalFunction::getDataType() const { return dataType; } +LogicalFunction QuadbinEqLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } +std::vector QuadbinEqLogicalFunction::getChildren() const { return parameters; } +LogicalFunction QuadbinEqLogicalFunction::withChildren(const std::vector& children) const { + PRECONDITION(children.size()==2,"QuadbinEqLogicalFunction requires 2 children, but got {}",children.size()); + auto c=*this; c.parameters=children; return c; +} +std::string_view QuadbinEqLogicalFunction::getType() const { return NAME; } +bool QuadbinEqLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + return false; +} +std::string QuadbinEqLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("{}({})",NAME,parameters[0].explain(v)); +} +LogicalFunction QuadbinEqLogicalFunction::withInferredDataType(const Schema& schema) const { + std::vector c; c.reserve(2); + for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "a must be UINT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "b must be UINT64"); + return withChildren(c); +} +SerializableFunction QuadbinEqLogicalFunction::serialize() const { + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + return proto; +} +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterQuadbinEqLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size()==2, + "QuadbinEqLogicalFunction requires 2 children but got {}", + arguments.children.size()); + return QuadbinEqLogicalFunction(std::move(arguments.children[0]), + std::move(arguments.children[1])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/QuadbinGeLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/QuadbinGeLogicalFunction.cpp new file mode 100644 index 0000000000..fd5ebf6317 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/QuadbinGeLogicalFunction.cpp @@ -0,0 +1,74 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +QuadbinGeLogicalFunction::QuadbinGeLogicalFunction(LogicalFunction a, LogicalFunction b) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(2); + parameters.push_back(std::move(a)); + parameters.push_back(std::move(b)); +} +DataType QuadbinGeLogicalFunction::getDataType() const { return dataType; } +LogicalFunction QuadbinGeLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } +std::vector QuadbinGeLogicalFunction::getChildren() const { return parameters; } +LogicalFunction QuadbinGeLogicalFunction::withChildren(const std::vector& children) const { + PRECONDITION(children.size()==2,"QuadbinGeLogicalFunction requires 2 children, but got {}",children.size()); + auto c=*this; c.parameters=children; return c; +} +std::string_view QuadbinGeLogicalFunction::getType() const { return NAME; } +bool QuadbinGeLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + return false; +} +std::string QuadbinGeLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("{}({})",NAME,parameters[0].explain(v)); +} +LogicalFunction QuadbinGeLogicalFunction::withInferredDataType(const Schema& schema) const { + std::vector c; c.reserve(2); + for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "a must be UINT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "b must be UINT64"); + return withChildren(c); +} +SerializableFunction QuadbinGeLogicalFunction::serialize() const { + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + return proto; +} +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterQuadbinGeLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size()==2, + "QuadbinGeLogicalFunction requires 2 children but got {}", + arguments.children.size()); + return QuadbinGeLogicalFunction(std::move(arguments.children[0]), + std::move(arguments.children[1])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/QuadbinGtLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/QuadbinGtLogicalFunction.cpp new file mode 100644 index 0000000000..276ade9d2a --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/QuadbinGtLogicalFunction.cpp @@ -0,0 +1,74 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +QuadbinGtLogicalFunction::QuadbinGtLogicalFunction(LogicalFunction a, LogicalFunction b) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(2); + parameters.push_back(std::move(a)); + parameters.push_back(std::move(b)); +} +DataType QuadbinGtLogicalFunction::getDataType() const { return dataType; } +LogicalFunction QuadbinGtLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } +std::vector QuadbinGtLogicalFunction::getChildren() const { return parameters; } +LogicalFunction QuadbinGtLogicalFunction::withChildren(const std::vector& children) const { + PRECONDITION(children.size()==2,"QuadbinGtLogicalFunction requires 2 children, but got {}",children.size()); + auto c=*this; c.parameters=children; return c; +} +std::string_view QuadbinGtLogicalFunction::getType() const { return NAME; } +bool QuadbinGtLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + return false; +} +std::string QuadbinGtLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("{}({})",NAME,parameters[0].explain(v)); +} +LogicalFunction QuadbinGtLogicalFunction::withInferredDataType(const Schema& schema) const { + std::vector c; c.reserve(2); + for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "a must be UINT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "b must be UINT64"); + return withChildren(c); +} +SerializableFunction QuadbinGtLogicalFunction::serialize() const { + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + return proto; +} +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterQuadbinGtLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size()==2, + "QuadbinGtLogicalFunction requires 2 children but got {}", + arguments.children.size()); + return QuadbinGtLogicalFunction(std::move(arguments.children[0]), + std::move(arguments.children[1])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/QuadbinLeLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/QuadbinLeLogicalFunction.cpp new file mode 100644 index 0000000000..2324d5bcde --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/QuadbinLeLogicalFunction.cpp @@ -0,0 +1,74 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +QuadbinLeLogicalFunction::QuadbinLeLogicalFunction(LogicalFunction a, LogicalFunction b) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(2); + parameters.push_back(std::move(a)); + parameters.push_back(std::move(b)); +} +DataType QuadbinLeLogicalFunction::getDataType() const { return dataType; } +LogicalFunction QuadbinLeLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } +std::vector QuadbinLeLogicalFunction::getChildren() const { return parameters; } +LogicalFunction QuadbinLeLogicalFunction::withChildren(const std::vector& children) const { + PRECONDITION(children.size()==2,"QuadbinLeLogicalFunction requires 2 children, but got {}",children.size()); + auto c=*this; c.parameters=children; return c; +} +std::string_view QuadbinLeLogicalFunction::getType() const { return NAME; } +bool QuadbinLeLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + return false; +} +std::string QuadbinLeLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("{}({})",NAME,parameters[0].explain(v)); +} +LogicalFunction QuadbinLeLogicalFunction::withInferredDataType(const Schema& schema) const { + std::vector c; c.reserve(2); + for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "a must be UINT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "b must be UINT64"); + return withChildren(c); +} +SerializableFunction QuadbinLeLogicalFunction::serialize() const { + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + return proto; +} +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterQuadbinLeLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size()==2, + "QuadbinLeLogicalFunction requires 2 children but got {}", + arguments.children.size()); + return QuadbinLeLogicalFunction(std::move(arguments.children[0]), + std::move(arguments.children[1])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/QuadbinLtLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/QuadbinLtLogicalFunction.cpp new file mode 100644 index 0000000000..498cd10e33 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/QuadbinLtLogicalFunction.cpp @@ -0,0 +1,74 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +QuadbinLtLogicalFunction::QuadbinLtLogicalFunction(LogicalFunction a, LogicalFunction b) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(2); + parameters.push_back(std::move(a)); + parameters.push_back(std::move(b)); +} +DataType QuadbinLtLogicalFunction::getDataType() const { return dataType; } +LogicalFunction QuadbinLtLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } +std::vector QuadbinLtLogicalFunction::getChildren() const { return parameters; } +LogicalFunction QuadbinLtLogicalFunction::withChildren(const std::vector& children) const { + PRECONDITION(children.size()==2,"QuadbinLtLogicalFunction requires 2 children, but got {}",children.size()); + auto c=*this; c.parameters=children; return c; +} +std::string_view QuadbinLtLogicalFunction::getType() const { return NAME; } +bool QuadbinLtLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + return false; +} +std::string QuadbinLtLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("{}({})",NAME,parameters[0].explain(v)); +} +LogicalFunction QuadbinLtLogicalFunction::withInferredDataType(const Schema& schema) const { + std::vector c; c.reserve(2); + for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "a must be UINT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "b must be UINT64"); + return withChildren(c); +} +SerializableFunction QuadbinLtLogicalFunction::serialize() const { + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + return proto; +} +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterQuadbinLtLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size()==2, + "QuadbinLtLogicalFunction requires 2 children but got {}", + arguments.children.size()); + return QuadbinLtLogicalFunction(std::move(arguments.children[0]), + std::move(arguments.children[1])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/QuadbinNeLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/QuadbinNeLogicalFunction.cpp new file mode 100644 index 0000000000..41b48c540d --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/QuadbinNeLogicalFunction.cpp @@ -0,0 +1,74 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +QuadbinNeLogicalFunction::QuadbinNeLogicalFunction(LogicalFunction a, LogicalFunction b) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(2); + parameters.push_back(std::move(a)); + parameters.push_back(std::move(b)); +} +DataType QuadbinNeLogicalFunction::getDataType() const { return dataType; } +LogicalFunction QuadbinNeLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } +std::vector QuadbinNeLogicalFunction::getChildren() const { return parameters; } +LogicalFunction QuadbinNeLogicalFunction::withChildren(const std::vector& children) const { + PRECONDITION(children.size()==2,"QuadbinNeLogicalFunction requires 2 children, but got {}",children.size()); + auto c=*this; c.parameters=children; return c; +} +std::string_view QuadbinNeLogicalFunction::getType() const { return NAME; } +bool QuadbinNeLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + return false; +} +std::string QuadbinNeLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("{}({})",NAME,parameters[0].explain(v)); +} +LogicalFunction QuadbinNeLogicalFunction::withInferredDataType(const Schema& schema) const { + std::vector c; c.reserve(2); + for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "a must be UINT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "b must be UINT64"); + return withChildren(c); +} +SerializableFunction QuadbinNeLogicalFunction::serialize() const { + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + return proto; +} +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterQuadbinNeLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size()==2, + "QuadbinNeLogicalFunction requires 2 children but got {}", + arguments.children.size()); + return QuadbinNeLogicalFunction(std::move(arguments.children[0]), + std::move(arguments.children[1])); +} + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/QuadbinCmpPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/QuadbinCmpPhysicalFunction.hpp new file mode 100644 index 0000000000..5baceef177 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/QuadbinCmpPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class QuadbinCmpPhysicalFunction : public PhysicalFunctionConcept { +public: + QuadbinCmpPhysicalFunction(PhysicalFunction a, PhysicalFunction b); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/QuadbinEqPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/QuadbinEqPhysicalFunction.hpp new file mode 100644 index 0000000000..37f8b6dafd --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/QuadbinEqPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class QuadbinEqPhysicalFunction : public PhysicalFunctionConcept { +public: + QuadbinEqPhysicalFunction(PhysicalFunction a, PhysicalFunction b); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/QuadbinGePhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/QuadbinGePhysicalFunction.hpp new file mode 100644 index 0000000000..31817dc002 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/QuadbinGePhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class QuadbinGePhysicalFunction : public PhysicalFunctionConcept { +public: + QuadbinGePhysicalFunction(PhysicalFunction a, PhysicalFunction b); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/QuadbinGtPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/QuadbinGtPhysicalFunction.hpp new file mode 100644 index 0000000000..1e6ce98100 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/QuadbinGtPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class QuadbinGtPhysicalFunction : public PhysicalFunctionConcept { +public: + QuadbinGtPhysicalFunction(PhysicalFunction a, PhysicalFunction b); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/QuadbinLePhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/QuadbinLePhysicalFunction.hpp new file mode 100644 index 0000000000..dedbfcaf69 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/QuadbinLePhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class QuadbinLePhysicalFunction : public PhysicalFunctionConcept { +public: + QuadbinLePhysicalFunction(PhysicalFunction a, PhysicalFunction b); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/QuadbinLtPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/QuadbinLtPhysicalFunction.hpp new file mode 100644 index 0000000000..db539794d8 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/QuadbinLtPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class QuadbinLtPhysicalFunction : public PhysicalFunctionConcept { +public: + QuadbinLtPhysicalFunction(PhysicalFunction a, PhysicalFunction b); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/QuadbinNePhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/QuadbinNePhysicalFunction.hpp new file mode 100644 index 0000000000..ccd3222667 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/QuadbinNePhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class QuadbinNePhysicalFunction : public PhysicalFunctionConcept { +public: + QuadbinNePhysicalFunction(PhysicalFunction a, PhysicalFunction b); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt index 6a07f7f6d9..e894b959bb 100644 --- a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt @@ -543,6 +543,13 @@ add_plugin(ContainsFloatspanSpan PhysicalFunction nes-physical-operators Contain add_plugin(TextUpper PhysicalFunction nes-physical-operators TextUpperPhysicalFunction.cpp) add_plugin(TextLower PhysicalFunction nes-physical-operators TextLowerPhysicalFunction.cpp) add_plugin(TextInitcap PhysicalFunction nes-physical-operators TextInitcapPhysicalFunction.cpp) +add_plugin(QuadbinEq PhysicalFunction nes-physical-operators QuadbinEqPhysicalFunction.cpp) +add_plugin(QuadbinNe PhysicalFunction nes-physical-operators QuadbinNePhysicalFunction.cpp) +add_plugin(QuadbinLt PhysicalFunction nes-physical-operators QuadbinLtPhysicalFunction.cpp) +add_plugin(QuadbinLe PhysicalFunction nes-physical-operators QuadbinLePhysicalFunction.cpp) +add_plugin(QuadbinGt PhysicalFunction nes-physical-operators QuadbinGtPhysicalFunction.cpp) +add_plugin(QuadbinGe PhysicalFunction nes-physical-operators QuadbinGePhysicalFunction.cpp) +add_plugin(QuadbinCmp PhysicalFunction nes-physical-operators QuadbinCmpPhysicalFunction.cpp) add_plugin(GeomRelatePattern PhysicalFunction nes-physical-operators GeomRelatePatternPhysicalFunction.cpp) add_plugin(GeomIntersects2d PhysicalFunction nes-physical-operators GeomIntersects2dPhysicalFunction.cpp) add_plugin(GeomDwithin2d PhysicalFunction nes-physical-operators GeomDwithin2dPhysicalFunction.cpp) diff --git a/nes-physical-operators/src/Functions/Meos/QuadbinCmpPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/QuadbinCmpPhysicalFunction.cpp new file mode 100644 index 0000000000..87b8c8e616 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/QuadbinCmpPhysicalFunction.cpp @@ -0,0 +1,64 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +QuadbinCmpPhysicalFunction::QuadbinCmpPhysicalFunction(PhysicalFunction a, PhysicalFunction b) +{ + paramFns.reserve(2); + paramFns.push_back(std::move(a)); + paramFns.push_back(std::move(b)); +} + +VarVal QuadbinCmpPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { + auto a = paramFns[0].execute(record, arena).cast(); + auto b = paramFns[1].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](uint64_t a, uint64_t b) -> double { + MEOS::Meos::ensureMeosInitialized(); + return (double)quadbin_cmp((Quadbin)a, (Quadbin)b); + }, + a, b); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterQuadbinCmpPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size()==2, + "QuadbinCmpPhysicalFunction requires 2 children but got {}", + arguments.childFunctions.size()); + return QuadbinCmpPhysicalFunction(std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/QuadbinEqPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/QuadbinEqPhysicalFunction.cpp new file mode 100644 index 0000000000..5c419aa581 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/QuadbinEqPhysicalFunction.cpp @@ -0,0 +1,65 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +QuadbinEqPhysicalFunction::QuadbinEqPhysicalFunction(PhysicalFunction a, PhysicalFunction b) +{ + paramFns.reserve(2); + paramFns.push_back(std::move(a)); + paramFns.push_back(std::move(b)); +} + +VarVal QuadbinEqPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { + auto a = paramFns[0].execute(record, arena).cast(); + auto b = paramFns[1].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](uint64_t a, uint64_t b) -> double { + MEOS::Meos::ensureMeosInitialized(); + bool r = quadbin_eq((Quadbin)a, (Quadbin)b); + return r ? 1.0 : 0.0; + }, + a, b); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterQuadbinEqPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size()==2, + "QuadbinEqPhysicalFunction requires 2 children but got {}", + arguments.childFunctions.size()); + return QuadbinEqPhysicalFunction(std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/QuadbinGePhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/QuadbinGePhysicalFunction.cpp new file mode 100644 index 0000000000..7162678576 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/QuadbinGePhysicalFunction.cpp @@ -0,0 +1,65 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +QuadbinGePhysicalFunction::QuadbinGePhysicalFunction(PhysicalFunction a, PhysicalFunction b) +{ + paramFns.reserve(2); + paramFns.push_back(std::move(a)); + paramFns.push_back(std::move(b)); +} + +VarVal QuadbinGePhysicalFunction::execute(const Record& record, ArenaRef& arena) const { + auto a = paramFns[0].execute(record, arena).cast(); + auto b = paramFns[1].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](uint64_t a, uint64_t b) -> double { + MEOS::Meos::ensureMeosInitialized(); + bool r = quadbin_ge((Quadbin)a, (Quadbin)b); + return r ? 1.0 : 0.0; + }, + a, b); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterQuadbinGePhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size()==2, + "QuadbinGePhysicalFunction requires 2 children but got {}", + arguments.childFunctions.size()); + return QuadbinGePhysicalFunction(std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/QuadbinGtPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/QuadbinGtPhysicalFunction.cpp new file mode 100644 index 0000000000..953e1e9076 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/QuadbinGtPhysicalFunction.cpp @@ -0,0 +1,65 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +QuadbinGtPhysicalFunction::QuadbinGtPhysicalFunction(PhysicalFunction a, PhysicalFunction b) +{ + paramFns.reserve(2); + paramFns.push_back(std::move(a)); + paramFns.push_back(std::move(b)); +} + +VarVal QuadbinGtPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { + auto a = paramFns[0].execute(record, arena).cast(); + auto b = paramFns[1].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](uint64_t a, uint64_t b) -> double { + MEOS::Meos::ensureMeosInitialized(); + bool r = quadbin_gt((Quadbin)a, (Quadbin)b); + return r ? 1.0 : 0.0; + }, + a, b); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterQuadbinGtPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size()==2, + "QuadbinGtPhysicalFunction requires 2 children but got {}", + arguments.childFunctions.size()); + return QuadbinGtPhysicalFunction(std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/QuadbinLePhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/QuadbinLePhysicalFunction.cpp new file mode 100644 index 0000000000..b3b898c384 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/QuadbinLePhysicalFunction.cpp @@ -0,0 +1,65 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +QuadbinLePhysicalFunction::QuadbinLePhysicalFunction(PhysicalFunction a, PhysicalFunction b) +{ + paramFns.reserve(2); + paramFns.push_back(std::move(a)); + paramFns.push_back(std::move(b)); +} + +VarVal QuadbinLePhysicalFunction::execute(const Record& record, ArenaRef& arena) const { + auto a = paramFns[0].execute(record, arena).cast(); + auto b = paramFns[1].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](uint64_t a, uint64_t b) -> double { + MEOS::Meos::ensureMeosInitialized(); + bool r = quadbin_le((Quadbin)a, (Quadbin)b); + return r ? 1.0 : 0.0; + }, + a, b); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterQuadbinLePhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size()==2, + "QuadbinLePhysicalFunction requires 2 children but got {}", + arguments.childFunctions.size()); + return QuadbinLePhysicalFunction(std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/QuadbinLtPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/QuadbinLtPhysicalFunction.cpp new file mode 100644 index 0000000000..57d6c86ed1 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/QuadbinLtPhysicalFunction.cpp @@ -0,0 +1,65 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +QuadbinLtPhysicalFunction::QuadbinLtPhysicalFunction(PhysicalFunction a, PhysicalFunction b) +{ + paramFns.reserve(2); + paramFns.push_back(std::move(a)); + paramFns.push_back(std::move(b)); +} + +VarVal QuadbinLtPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { + auto a = paramFns[0].execute(record, arena).cast(); + auto b = paramFns[1].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](uint64_t a, uint64_t b) -> double { + MEOS::Meos::ensureMeosInitialized(); + bool r = quadbin_lt((Quadbin)a, (Quadbin)b); + return r ? 1.0 : 0.0; + }, + a, b); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterQuadbinLtPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size()==2, + "QuadbinLtPhysicalFunction requires 2 children but got {}", + arguments.childFunctions.size()); + return QuadbinLtPhysicalFunction(std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/QuadbinNePhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/QuadbinNePhysicalFunction.cpp new file mode 100644 index 0000000000..a7c9bef66a --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/QuadbinNePhysicalFunction.cpp @@ -0,0 +1,65 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +QuadbinNePhysicalFunction::QuadbinNePhysicalFunction(PhysicalFunction a, PhysicalFunction b) +{ + paramFns.reserve(2); + paramFns.push_back(std::move(a)); + paramFns.push_back(std::move(b)); +} + +VarVal QuadbinNePhysicalFunction::execute(const Record& record, ArenaRef& arena) const { + auto a = paramFns[0].execute(record, arena).cast(); + auto b = paramFns[1].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](uint64_t a, uint64_t b) -> double { + MEOS::Meos::ensureMeosInitialized(); + bool r = quadbin_ne((Quadbin)a, (Quadbin)b); + return r ? 1.0 : 0.0; + }, + a, b); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterQuadbinNePhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size()==2, + "QuadbinNePhysicalFunction requires 2 children but got {}", + arguments.childFunctions.size()); + return QuadbinNePhysicalFunction(std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1])); +} + +} // namespace NES diff --git a/nes-sql-parser/AntlrSQL.g4 b/nes-sql-parser/AntlrSQL.g4 index cb15b8e9cf..e12ce08fd5 100644 --- a/nes-sql-parser/AntlrSQL.g4 +++ b/nes-sql-parser/AntlrSQL.g4 @@ -295,7 +295,7 @@ timeUnit: MS timestampParameter: name=identifier; -functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT | TGE_TTEXT_TEXT | TGE_TEXT_TTEXT | TGT_TTEXT_TEXT | TGT_TEXT_TTEXT | TLE_TTEXT_TEXT | TLE_TEXT_TTEXT | TLT_TTEXT_TEXT | TLT_TEXT_TTEXT | TTEXT_UPPER | TTEXT_LOWER | TTEXT_INITCAP | TEXTCAT_TTEXT_TEXT | TEXTCAT_TEXT_TTEXT | TEXTCAT_TTEXT_TTEXT | GEOM_LENGTH | GEOM_PERIMETER | GEOM_AZIMUTH | GEOG_AREA | GEOG_LENGTH | GEOG_PERIMETER | GEOM_IS_EMPTY | AINTERSECTS_TGEO_GEO | ACOVERS_TGEO_GEO | ADISJOINT_TGEO_GEO | ADWITHIN_TGEO_GEO | EINTERSECTS_TGEO_GEO | ETOUCHES_TGEO_GEO | ECONTAINS_TGEO_GEO | ACONTAINS_TGEO_GEO | ATOUCHES_TGEO_GEO | GEO_NUM_POINTS | GEO_NUM_GEOS | GEO_SRID | GEO_IS_UNITARY | GEO_EQUALS | GEO_SAME | GEOG_DISTANCE | NAD_TGEO_GEO | EVER_EQ_TGEO_GEO | EVER_NE_TGEO_GEO | ALWAYS_EQ_TGEO_GEO | ALWAYS_NE_TGEO_GEO | GEOG_INTERSECTS | GEOG_DWITHIN | ACOVERS_GEO_TGEO | GEOM_INTERSECTS | GEOM_DWITHIN | H3_GS_POINT_TO_CELL | EVER_EQ_TH3INDEX_H3INDEX | EVER_NE_TH3INDEX_H3INDEX | ALWAYS_EQ_TH3INDEX_H3INDEX | ALWAYS_NE_TH3INDEX_H3INDEX | TH3INDEX_GET_RESOLUTION | TH3INDEX_GET_BASE_CELL_NUMBER | TH3INDEX_IS_VALID_CELL | TH3INDEX_IS_PENTAGON | TH3INDEX_CELL_TO_PARENT_NEXT | TH3INDEX_CELL_TO_CENTER_CHILD_NEXT | TH3INDEX_CELL_TO_PARENT | TH3INDEX_CELL_TO_CENTER_CHILD | TH3INDEX_CELL_TO_CHILD_POS | TH3INDEX_ARE_NEIGHBOR_CELLS | TH3INDEX_GRID_DISTANCE | EINTERSECTS_TCBUFFER_GEO | AINTERSECTS_TCBUFFER_GEO | ECOVERS_TCBUFFER_GEO | ACOVERS_TCBUFFER_GEO | EDISJOINT_TCBUFFER_GEO | ADISJOINT_TCBUFFER_GEO | ETOUCHES_TCBUFFER_GEO | ATOUCHES_TCBUFFER_GEO | ECONTAINS_TCBUFFER_GEO | ACONTAINS_TCBUFFER_GEO | NAD_TCBUFFER_GEO | EDWITHIN_TCBUFFER_GEO | ADWITHIN_TCBUFFER_GEO | EINTERSECTS_TCBUFFER_CBUFFER | AINTERSECTS_TCBUFFER_CBUFFER | ECOVERS_TCBUFFER_CBUFFER | ACOVERS_TCBUFFER_CBUFFER | EDISJOINT_TCBUFFER_CBUFFER | ADISJOINT_TCBUFFER_CBUFFER | ETOUCHES_TCBUFFER_CBUFFER | ATOUCHES_TCBUFFER_CBUFFER | ECONTAINS_TCBUFFER_CBUFFER | ACONTAINS_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_CBUFFER | ALWAYS_EQ_TCBUFFER_CBUFFER | EVER_NE_TCBUFFER_CBUFFER | ALWAYS_NE_TCBUFFER_CBUFFER | NAD_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_TCBUFFER | ALWAYS_EQ_TCBUFFER_TCBUFFER | EVER_NE_TCBUFFER_TCBUFFER | ALWAYS_NE_TCBUFFER_TCBUFFER | EINTERSECTS_TCBUFFER_TCBUFFER | AINTERSECTS_TCBUFFER_TCBUFFER | ECOVERS_TCBUFFER_TCBUFFER | ACOVERS_TCBUFFER_TCBUFFER | ADISJOINT_TCBUFFER_TCBUFFER | ETOUCHES_TCBUFFER_TCBUFFER | ATOUCHES_TCBUFFER_TCBUFFER | NAD_TCBUFFER_TCBUFFER | EDWITHIN_TCBUFFER_TCBUFFER | ADWITHIN_TCBUFFER_TCBUFFER | MINDISTANCE_TCBUFFER_TCBUFFER | NAD_TNPOINT_GEO | EVER_EQ_TNPOINT_NPOINT | ALWAYS_EQ_TNPOINT_NPOINT | EVER_NE_TNPOINT_NPOINT | ALWAYS_NE_TNPOINT_NPOINT | NAD_TNPOINT_NPOINT | EVER_EQ_NPOINT_TNPOINT | ALWAYS_EQ_NPOINT_TNPOINT | EVER_NE_NPOINT_TNPOINT | ALWAYS_NE_NPOINT_TNPOINT | EVER_EQ_TNPOINT_TNPOINT | ALWAYS_EQ_TNPOINT_TNPOINT | EVER_NE_TNPOINT_TNPOINT | ALWAYS_NE_TNPOINT_TNPOINT | NAD_TNPOINT_TNPOINT | NAD_TPOSE_GEO | EVER_EQ_TPOSE_POSE | ALWAYS_EQ_TPOSE_POSE | EVER_NE_TPOSE_POSE | ALWAYS_NE_TPOSE_POSE | NAD_TPOSE_POSE | EVER_EQ_POSE_TPOSE | ALWAYS_EQ_POSE_TPOSE | EVER_NE_POSE_TPOSE | ALWAYS_NE_POSE_TPOSE | EVER_EQ_TPOSE_TPOSE | ALWAYS_EQ_TPOSE_TPOSE | EVER_NE_TPOSE_TPOSE | ALWAYS_NE_TPOSE_TPOSE | NAD_TPOSE_TPOSE | EVER_EQ_TRGEOMETRY_GEO | ALWAYS_EQ_TRGEOMETRY_GEO | EVER_NE_TRGEOMETRY_GEO | ALWAYS_NE_TRGEOMETRY_GEO | NAD_TRGEOMETRY_GEO | EVER_EQ_GEO_TRGEOMETRY | ALWAYS_EQ_GEO_TRGEOMETRY | EVER_NE_GEO_TRGEOMETRY | ALWAYS_NE_GEO_TRGEOMETRY | EVER_EQ_TRGEOMETRY_TRGEOMETRY | ALWAYS_EQ_TRGEOMETRY_TRGEOMETRY | EVER_NE_TRGEOMETRY_TRGEOMETRY | ALWAYS_NE_TRGEOMETRY_TRGEOMETRY | NAD_TRGEOMETRY_TRGEOMETRY | EINTERSECTS_TPCPOINT_GEO | NAD_TPCPOINT_GEO | QUADBIN_POINT_TO_CELL | QUADBIN_IS_VALID_CELL | QUADBIN_GET_RESOLUTION | QUADBIN_CELL_AREA | QUADBIN_CELL_TO_QUADKEY | QUADBIN_CELL_TO_PARENT | QUADBIN_TILE_TO_CELL | EVER_EQ_TJSONB_JSONB | ALWAYS_EQ_TJSONB_JSONB | EVER_NE_TJSONB_JSONB | ALWAYS_NE_TJSONB_JSONB | EVER_EQ_TJSONB_TJSONB | ALWAYS_EQ_TJSONB_TJSONB | EVER_NE_TJSONB_TJSONB | ALWAYS_NE_TJSONB_TJSONB | GEOM_BOUNDARY | GEOM_CENTROID | GEOM_CONVEX_HULL | GEO_REVERSE | GEO_POINTS | GEOM_UNARY_UNION | GEOM_DIFFERENCE2D | GEOM_INTERSECTION2D | GEOM_SHORTESTLINE2D | GEOM_SHORTESTLINE3D | GEO_SET_SRID | GEO_TRANSFORM | GEO_ROUND | GEOM_BUFFER | LINE_NUMPOINTS | LINE_LOCATE_POINT | LINE_INTERPOLATE_POINT | LINE_SUBSTRING | GEOM_POINT_MAKE2D | GEOM_POINT_MAKE3DZ | GEOG_POINT_MAKE2D | GEOG_POINT_MAKE3DZ | GEOM_TO_GEOG | GEOG_TO_GEOM | GEOG_CENTROID | GEO_GEO_N | LINE_POINT_N | GEOM_INTERSECTION2D_COLL | GEO_AS_GEOJSON | GEO_AS_HEXEWKB | GEO_AS_EWKT | GEO_FROM_GEOJSON | GEOM_FROM_HEXEWKB | GEO_TRANSFORM_PIPELINE | GEOM_MIN_BOUNDING_CENTER | GEOM_MIN_BOUNDING_RADIUS | EVER_EQ_TGEO_TGEO | EVER_NE_TGEO_TGEO | ALWAYS_EQ_TGEO_TGEO | ALWAYS_NE_TGEO_TGEO | EINTERSECTS_TGEO_TGEO | ECOVERS_TGEO_TGEO | EDISJOINT_TGEO_TGEO | ECONTAINS_TGEO_TGEO | ETOUCHES_TGEO_TGEO | AINTERSECTS_TGEO_TGEO | ACOVERS_TGEO_TGEO | ADISJOINT_TGEO_TGEO | ACONTAINS_TGEO_TGEO | ATOUCHES_TGEO_TGEO | EDWITHIN_TGEO_TGEO | ADWITHIN_TGEO_TGEO | H3INDEX_EQ | H3INDEX_NE | H3INDEX_LT | H3INDEX_LE | H3INDEX_GT | H3INDEX_GE | H3INDEX_CMP | H3INDEX_OUT | H3INDEX_IN | JSON_ARRAY_LENGTH | JSON_TYPEOF | JSON_OBJECT_FIELD_TEXT | JSON_ARRAY_ELEMENT_TEXT | JSONB_ARRAY_LENGTH | JSONB_EQ | JSONB_NE | JSONB_LT | JSONB_LE | JSONB_GT | JSONB_GE | JSONB_CMP | JSONB_CONTAINS | JSONB_CONTAINED | JSONB_EXISTS | JSONB_TO_CSTRING | JSONB_PRETTY | JSONB_OBJECT_FIELD_TEXT | JSONB_ARRAY_ELEMENT_TEXT | INTSPAN_MAKE | FLOATSPAN_MAKE | INTSPAN_LOWER | INTSPAN_UPPER | INTSPAN_WIDTH | INTSPAN_LOWER_INC | INTSPAN_UPPER_INC | FLOATSPAN_LOWER | FLOATSPAN_UPPER | FLOATSPAN_WIDTH | FLOATSPAN_LOWER_INC | FLOATSPAN_UPPER_INC | CONTAINED_INT_SPAN | CONTAINED_FLOAT_SPAN | CONTAINS_SPAN_INT | CONTAINS_SPAN_FLOAT | CONTAINED_SPAN_SPAN | CONTAINS_SPAN_SPAN | CONTAINED_FLOATSPAN_SPAN | CONTAINS_FLOATSPAN_SPAN | TEXT_UPPER | TEXT_LOWER | TEXT_INITCAP | GEOM_RELATE_PATTERN | GEOM_INTERSECTS2D | GEOM_DWITHIN2D | GEOM_CONTAINS | GEOM_DISJOINT2D | GEOM_COVERS | GEOM_TOUCHES | GEOM_INTERSECTS3D | GEOM_DWITHIN3D | GEOM_DISTANCE2D | GEOM_DISTANCE3D; +functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT | TGE_TTEXT_TEXT | TGE_TEXT_TTEXT | TGT_TTEXT_TEXT | TGT_TEXT_TTEXT | TLE_TTEXT_TEXT | TLE_TEXT_TTEXT | TLT_TTEXT_TEXT | TLT_TEXT_TTEXT | TTEXT_UPPER | TTEXT_LOWER | TTEXT_INITCAP | TEXTCAT_TTEXT_TEXT | TEXTCAT_TEXT_TTEXT | TEXTCAT_TTEXT_TTEXT | GEOM_LENGTH | GEOM_PERIMETER | GEOM_AZIMUTH | GEOG_AREA | GEOG_LENGTH | GEOG_PERIMETER | GEOM_IS_EMPTY | AINTERSECTS_TGEO_GEO | ACOVERS_TGEO_GEO | ADISJOINT_TGEO_GEO | ADWITHIN_TGEO_GEO | EINTERSECTS_TGEO_GEO | ETOUCHES_TGEO_GEO | ECONTAINS_TGEO_GEO | ACONTAINS_TGEO_GEO | ATOUCHES_TGEO_GEO | GEO_NUM_POINTS | GEO_NUM_GEOS | GEO_SRID | GEO_IS_UNITARY | GEO_EQUALS | GEO_SAME | GEOG_DISTANCE | NAD_TGEO_GEO | EVER_EQ_TGEO_GEO | EVER_NE_TGEO_GEO | ALWAYS_EQ_TGEO_GEO | ALWAYS_NE_TGEO_GEO | GEOG_INTERSECTS | GEOG_DWITHIN | ACOVERS_GEO_TGEO | GEOM_INTERSECTS | GEOM_DWITHIN | H3_GS_POINT_TO_CELL | EVER_EQ_TH3INDEX_H3INDEX | EVER_NE_TH3INDEX_H3INDEX | ALWAYS_EQ_TH3INDEX_H3INDEX | ALWAYS_NE_TH3INDEX_H3INDEX | TH3INDEX_GET_RESOLUTION | TH3INDEX_GET_BASE_CELL_NUMBER | TH3INDEX_IS_VALID_CELL | TH3INDEX_IS_PENTAGON | TH3INDEX_CELL_TO_PARENT_NEXT | TH3INDEX_CELL_TO_CENTER_CHILD_NEXT | TH3INDEX_CELL_TO_PARENT | TH3INDEX_CELL_TO_CENTER_CHILD | TH3INDEX_CELL_TO_CHILD_POS | TH3INDEX_ARE_NEIGHBOR_CELLS | TH3INDEX_GRID_DISTANCE | EINTERSECTS_TCBUFFER_GEO | AINTERSECTS_TCBUFFER_GEO | ECOVERS_TCBUFFER_GEO | ACOVERS_TCBUFFER_GEO | EDISJOINT_TCBUFFER_GEO | ADISJOINT_TCBUFFER_GEO | ETOUCHES_TCBUFFER_GEO | ATOUCHES_TCBUFFER_GEO | ECONTAINS_TCBUFFER_GEO | ACONTAINS_TCBUFFER_GEO | NAD_TCBUFFER_GEO | EDWITHIN_TCBUFFER_GEO | ADWITHIN_TCBUFFER_GEO | EINTERSECTS_TCBUFFER_CBUFFER | AINTERSECTS_TCBUFFER_CBUFFER | ECOVERS_TCBUFFER_CBUFFER | ACOVERS_TCBUFFER_CBUFFER | EDISJOINT_TCBUFFER_CBUFFER | ADISJOINT_TCBUFFER_CBUFFER | ETOUCHES_TCBUFFER_CBUFFER | ATOUCHES_TCBUFFER_CBUFFER | ECONTAINS_TCBUFFER_CBUFFER | ACONTAINS_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_CBUFFER | ALWAYS_EQ_TCBUFFER_CBUFFER | EVER_NE_TCBUFFER_CBUFFER | ALWAYS_NE_TCBUFFER_CBUFFER | NAD_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_TCBUFFER | ALWAYS_EQ_TCBUFFER_TCBUFFER | EVER_NE_TCBUFFER_TCBUFFER | ALWAYS_NE_TCBUFFER_TCBUFFER | EINTERSECTS_TCBUFFER_TCBUFFER | AINTERSECTS_TCBUFFER_TCBUFFER | ECOVERS_TCBUFFER_TCBUFFER | ACOVERS_TCBUFFER_TCBUFFER | ADISJOINT_TCBUFFER_TCBUFFER | ETOUCHES_TCBUFFER_TCBUFFER | ATOUCHES_TCBUFFER_TCBUFFER | NAD_TCBUFFER_TCBUFFER | EDWITHIN_TCBUFFER_TCBUFFER | ADWITHIN_TCBUFFER_TCBUFFER | MINDISTANCE_TCBUFFER_TCBUFFER | NAD_TNPOINT_GEO | EVER_EQ_TNPOINT_NPOINT | ALWAYS_EQ_TNPOINT_NPOINT | EVER_NE_TNPOINT_NPOINT | ALWAYS_NE_TNPOINT_NPOINT | NAD_TNPOINT_NPOINT | EVER_EQ_NPOINT_TNPOINT | ALWAYS_EQ_NPOINT_TNPOINT | EVER_NE_NPOINT_TNPOINT | ALWAYS_NE_NPOINT_TNPOINT | EVER_EQ_TNPOINT_TNPOINT | ALWAYS_EQ_TNPOINT_TNPOINT | EVER_NE_TNPOINT_TNPOINT | ALWAYS_NE_TNPOINT_TNPOINT | NAD_TNPOINT_TNPOINT | NAD_TPOSE_GEO | EVER_EQ_TPOSE_POSE | ALWAYS_EQ_TPOSE_POSE | EVER_NE_TPOSE_POSE | ALWAYS_NE_TPOSE_POSE | NAD_TPOSE_POSE | EVER_EQ_POSE_TPOSE | ALWAYS_EQ_POSE_TPOSE | EVER_NE_POSE_TPOSE | ALWAYS_NE_POSE_TPOSE | EVER_EQ_TPOSE_TPOSE | ALWAYS_EQ_TPOSE_TPOSE | EVER_NE_TPOSE_TPOSE | ALWAYS_NE_TPOSE_TPOSE | NAD_TPOSE_TPOSE | EVER_EQ_TRGEOMETRY_GEO | ALWAYS_EQ_TRGEOMETRY_GEO | EVER_NE_TRGEOMETRY_GEO | ALWAYS_NE_TRGEOMETRY_GEO | NAD_TRGEOMETRY_GEO | EVER_EQ_GEO_TRGEOMETRY | ALWAYS_EQ_GEO_TRGEOMETRY | EVER_NE_GEO_TRGEOMETRY | ALWAYS_NE_GEO_TRGEOMETRY | EVER_EQ_TRGEOMETRY_TRGEOMETRY | ALWAYS_EQ_TRGEOMETRY_TRGEOMETRY | EVER_NE_TRGEOMETRY_TRGEOMETRY | ALWAYS_NE_TRGEOMETRY_TRGEOMETRY | NAD_TRGEOMETRY_TRGEOMETRY | EINTERSECTS_TPCPOINT_GEO | NAD_TPCPOINT_GEO | QUADBIN_POINT_TO_CELL | QUADBIN_IS_VALID_CELL | QUADBIN_GET_RESOLUTION | QUADBIN_CELL_AREA | QUADBIN_CELL_TO_QUADKEY | QUADBIN_CELL_TO_PARENT | QUADBIN_TILE_TO_CELL | EVER_EQ_TJSONB_JSONB | ALWAYS_EQ_TJSONB_JSONB | EVER_NE_TJSONB_JSONB | ALWAYS_NE_TJSONB_JSONB | EVER_EQ_TJSONB_TJSONB | ALWAYS_EQ_TJSONB_TJSONB | EVER_NE_TJSONB_TJSONB | ALWAYS_NE_TJSONB_TJSONB | GEOM_BOUNDARY | GEOM_CENTROID | GEOM_CONVEX_HULL | GEO_REVERSE | GEO_POINTS | GEOM_UNARY_UNION | GEOM_DIFFERENCE2D | GEOM_INTERSECTION2D | GEOM_SHORTESTLINE2D | GEOM_SHORTESTLINE3D | GEO_SET_SRID | GEO_TRANSFORM | GEO_ROUND | GEOM_BUFFER | LINE_NUMPOINTS | LINE_LOCATE_POINT | LINE_INTERPOLATE_POINT | LINE_SUBSTRING | GEOM_POINT_MAKE2D | GEOM_POINT_MAKE3DZ | GEOG_POINT_MAKE2D | GEOG_POINT_MAKE3DZ | GEOM_TO_GEOG | GEOG_TO_GEOM | GEOG_CENTROID | GEO_GEO_N | LINE_POINT_N | GEOM_INTERSECTION2D_COLL | GEO_AS_GEOJSON | GEO_AS_HEXEWKB | GEO_AS_EWKT | GEO_FROM_GEOJSON | GEOM_FROM_HEXEWKB | GEO_TRANSFORM_PIPELINE | GEOM_MIN_BOUNDING_CENTER | GEOM_MIN_BOUNDING_RADIUS | EVER_EQ_TGEO_TGEO | EVER_NE_TGEO_TGEO | ALWAYS_EQ_TGEO_TGEO | ALWAYS_NE_TGEO_TGEO | EINTERSECTS_TGEO_TGEO | ECOVERS_TGEO_TGEO | EDISJOINT_TGEO_TGEO | ECONTAINS_TGEO_TGEO | ETOUCHES_TGEO_TGEO | AINTERSECTS_TGEO_TGEO | ACOVERS_TGEO_TGEO | ADISJOINT_TGEO_TGEO | ACONTAINS_TGEO_TGEO | ATOUCHES_TGEO_TGEO | EDWITHIN_TGEO_TGEO | ADWITHIN_TGEO_TGEO | H3INDEX_EQ | H3INDEX_NE | H3INDEX_LT | H3INDEX_LE | H3INDEX_GT | H3INDEX_GE | H3INDEX_CMP | H3INDEX_OUT | H3INDEX_IN | JSON_ARRAY_LENGTH | JSON_TYPEOF | JSON_OBJECT_FIELD_TEXT | JSON_ARRAY_ELEMENT_TEXT | JSONB_ARRAY_LENGTH | JSONB_EQ | JSONB_NE | JSONB_LT | JSONB_LE | JSONB_GT | JSONB_GE | JSONB_CMP | JSONB_CONTAINS | JSONB_CONTAINED | JSONB_EXISTS | JSONB_TO_CSTRING | JSONB_PRETTY | JSONB_OBJECT_FIELD_TEXT | JSONB_ARRAY_ELEMENT_TEXT | INTSPAN_MAKE | FLOATSPAN_MAKE | INTSPAN_LOWER | INTSPAN_UPPER | INTSPAN_WIDTH | INTSPAN_LOWER_INC | INTSPAN_UPPER_INC | FLOATSPAN_LOWER | FLOATSPAN_UPPER | FLOATSPAN_WIDTH | FLOATSPAN_LOWER_INC | FLOATSPAN_UPPER_INC | CONTAINED_INT_SPAN | CONTAINED_FLOAT_SPAN | CONTAINS_SPAN_INT | CONTAINS_SPAN_FLOAT | CONTAINED_SPAN_SPAN | CONTAINS_SPAN_SPAN | CONTAINED_FLOATSPAN_SPAN | CONTAINS_FLOATSPAN_SPAN | TEXT_UPPER | TEXT_LOWER | TEXT_INITCAP | QUADBIN_EQ | QUADBIN_NE | QUADBIN_LT | QUADBIN_LE | QUADBIN_GT | QUADBIN_GE | QUADBIN_CMP | GEOM_RELATE_PATTERN | GEOM_INTERSECTS2D | GEOM_DWITHIN2D | GEOM_CONTAINS | GEOM_DISJOINT2D | GEOM_COVERS | GEOM_TOUCHES | GEOM_INTERSECTS3D | GEOM_DWITHIN3D | GEOM_DISTANCE2D | GEOM_DISTANCE3D; sinkClause: INTO sink (',' sink)*; @@ -1014,6 +1014,13 @@ CONTAINS_FLOATSPAN_SPAN: 'CONTAINS_FLOATSPAN_SPAN' | 'contains_floatspan_floatsp TEXT_UPPER: 'TEXT_UPPER' | 'text_upper'; TEXT_LOWER: 'TEXT_LOWER' | 'text_lower'; TEXT_INITCAP: 'TEXT_INITCAP' | 'text_initcap'; +QUADBIN_EQ: 'QUADBIN_EQ' | 'quadbin_eq'; +QUADBIN_NE: 'QUADBIN_NE' | 'quadbin_ne'; +QUADBIN_LT: 'QUADBIN_LT' | 'quadbin_lt'; +QUADBIN_LE: 'QUADBIN_LE' | 'quadbin_le'; +QUADBIN_GT: 'QUADBIN_GT' | 'quadbin_gt'; +QUADBIN_GE: 'QUADBIN_GE' | 'quadbin_ge'; +QUADBIN_CMP: 'QUADBIN_CMP' | 'quadbin_cmp'; GEOM_RELATE_PATTERN: 'GEOM_RELATE_PATTERN' | 'geom_relate_pattern'; GEOM_INTERSECTS2D: 'GEOM_INTERSECTS2D' | 'geom_intersects2d'; GEOM_DWITHIN2D: 'GEOM_DWITHIN2D' | 'geom_dwithin2d'; diff --git a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp index 567f0d9840..cd313a5a47 100644 --- a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp +++ b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp @@ -595,6 +595,13 @@ #include #include #include +#include +#include +#include +#include +#include +#include +#include #include #include #include @@ -11847,6 +11854,69 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont return LogicalFunction(TextInitcapLogicalFunction(std::move(arg0))); } /* END CODEGEN PARSER GLUE: TEXT_INITCAP */ + case AntlrSQLParser::QUADBIN_EQ: { + PRECONDITION(ctx->functionParam().size() == 2, + "QuadbinEq requires 2 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + return LogicalFunction(QuadbinEqLogicalFunction(std::move(arg0), std::move(arg1))); + } + /* END CODEGEN PARSER GLUE: QUADBIN_EQ */ + case AntlrSQLParser::QUADBIN_NE: { + PRECONDITION(ctx->functionParam().size() == 2, + "QuadbinNe requires 2 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + return LogicalFunction(QuadbinNeLogicalFunction(std::move(arg0), std::move(arg1))); + } + /* END CODEGEN PARSER GLUE: QUADBIN_NE */ + case AntlrSQLParser::QUADBIN_LT: { + PRECONDITION(ctx->functionParam().size() == 2, + "QuadbinLt requires 2 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + return LogicalFunction(QuadbinLtLogicalFunction(std::move(arg0), std::move(arg1))); + } + /* END CODEGEN PARSER GLUE: QUADBIN_LT */ + case AntlrSQLParser::QUADBIN_LE: { + PRECONDITION(ctx->functionParam().size() == 2, + "QuadbinLe requires 2 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + return LogicalFunction(QuadbinLeLogicalFunction(std::move(arg0), std::move(arg1))); + } + /* END CODEGEN PARSER GLUE: QUADBIN_LE */ + case AntlrSQLParser::QUADBIN_GT: { + PRECONDITION(ctx->functionParam().size() == 2, + "QuadbinGt requires 2 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + return LogicalFunction(QuadbinGtLogicalFunction(std::move(arg0), std::move(arg1))); + } + /* END CODEGEN PARSER GLUE: QUADBIN_GT */ + case AntlrSQLParser::QUADBIN_GE: { + PRECONDITION(ctx->functionParam().size() == 2, + "QuadbinGe requires 2 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + return LogicalFunction(QuadbinGeLogicalFunction(std::move(arg0), std::move(arg1))); + } + /* END CODEGEN PARSER GLUE: QUADBIN_GE */ + case AntlrSQLParser::QUADBIN_CMP: { + PRECONDITION(ctx->functionParam().size() == 2, + "QuadbinCmp requires 2 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + return LogicalFunction(QuadbinCmpLogicalFunction(std::move(arg0), std::move(arg1))); + } + /* END CODEGEN PARSER GLUE: QUADBIN_CMP */ /* END CODEGEN PARSER GLUE: GEOM_RELATE_PATTERN */ /* END CODEGEN PARSER GLUE: GEOM_INTERSECTS2D */ case AntlrSQLParser::GEOM_DWITHIN2D: { From ac7e7d1469123cc535fd713c6572d5ae5b9464ec Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Fri, 19 Jun 2026 21:57:05 +0200 Subject: [PATCH 95/96] feat(meos): add tquadbin ever/always eq/ne NES operators (W147) Wires 12 tquadbin temporal predicate operators returning FLOAT64 (0/1): EVER/ALWAYS_EQ/NE_QUADBIN_TQUADBIN (3-arg: static cell first), EVER/ALWAYS_EQ/NE_TQUADBIN_QUADBIN (3-arg: instant first), and EVER/ALWAYS_EQ/NE_TQUADBIN_TQUADBIN (4-arg: two instants). tquadbin instants are built per-call via tquadbininst_make(Quadbin, TimestampTz). New in ecosystem-pin-2026-06-18e. --- ...AlwaysEqQuadbinTquadbinLogicalFunction.hpp | 45 ++++++ ...AlwaysEqTquadbinQuadbinLogicalFunction.hpp | 45 ++++++ ...lwaysEqTquadbinTquadbinLogicalFunction.hpp | 45 ++++++ ...AlwaysNeQuadbinTquadbinLogicalFunction.hpp | 45 ++++++ ...AlwaysNeTquadbinQuadbinLogicalFunction.hpp | 45 ++++++ ...lwaysNeTquadbinTquadbinLogicalFunction.hpp | 45 ++++++ .../EverEqQuadbinTquadbinLogicalFunction.hpp | 45 ++++++ .../EverEqTquadbinQuadbinLogicalFunction.hpp | 45 ++++++ .../EverEqTquadbinTquadbinLogicalFunction.hpp | 45 ++++++ .../EverNeQuadbinTquadbinLogicalFunction.hpp | 45 ++++++ .../EverNeTquadbinQuadbinLogicalFunction.hpp | 45 ++++++ .../EverNeTquadbinTquadbinLogicalFunction.hpp | 45 ++++++ ...AlwaysEqQuadbinTquadbinLogicalFunction.cpp | 78 ++++++++++ ...AlwaysEqTquadbinQuadbinLogicalFunction.cpp | 78 ++++++++++ ...lwaysEqTquadbinTquadbinLogicalFunction.cpp | 81 +++++++++++ ...AlwaysNeQuadbinTquadbinLogicalFunction.cpp | 78 ++++++++++ ...AlwaysNeTquadbinQuadbinLogicalFunction.cpp | 78 ++++++++++ ...lwaysNeTquadbinTquadbinLogicalFunction.cpp | 81 +++++++++++ .../src/Functions/Meos/CMakeLists.txt | 12 ++ .../EverEqQuadbinTquadbinLogicalFunction.cpp | 78 ++++++++++ .../EverEqTquadbinQuadbinLogicalFunction.cpp | 78 ++++++++++ .../EverEqTquadbinTquadbinLogicalFunction.cpp | 81 +++++++++++ .../EverNeQuadbinTquadbinLogicalFunction.cpp | 78 ++++++++++ .../EverNeTquadbinQuadbinLogicalFunction.cpp | 78 ++++++++++ .../EverNeTquadbinTquadbinLogicalFunction.cpp | 81 +++++++++++ ...lwaysEqQuadbinTquadbinPhysicalFunction.hpp | 32 +++++ ...lwaysEqTquadbinQuadbinPhysicalFunction.hpp | 32 +++++ ...waysEqTquadbinTquadbinPhysicalFunction.hpp | 32 +++++ ...lwaysNeQuadbinTquadbinPhysicalFunction.hpp | 32 +++++ ...lwaysNeTquadbinQuadbinPhysicalFunction.hpp | 32 +++++ ...waysNeTquadbinTquadbinPhysicalFunction.hpp | 32 +++++ .../EverEqQuadbinTquadbinPhysicalFunction.hpp | 32 +++++ .../EverEqTquadbinQuadbinPhysicalFunction.hpp | 32 +++++ ...EverEqTquadbinTquadbinPhysicalFunction.hpp | 32 +++++ .../EverNeQuadbinTquadbinPhysicalFunction.hpp | 32 +++++ .../EverNeTquadbinQuadbinPhysicalFunction.hpp | 32 +++++ ...EverNeTquadbinTquadbinPhysicalFunction.hpp | 32 +++++ ...lwaysEqQuadbinTquadbinPhysicalFunction.cpp | 71 +++++++++ ...lwaysEqTquadbinQuadbinPhysicalFunction.cpp | 71 +++++++++ ...waysEqTquadbinTquadbinPhysicalFunction.cpp | 76 ++++++++++ ...lwaysNeQuadbinTquadbinPhysicalFunction.cpp | 71 +++++++++ ...lwaysNeTquadbinQuadbinPhysicalFunction.cpp | 71 +++++++++ ...waysNeTquadbinTquadbinPhysicalFunction.cpp | 76 ++++++++++ .../src/Functions/Meos/CMakeLists.txt | 12 ++ .../EverEqQuadbinTquadbinPhysicalFunction.cpp | 71 +++++++++ .../EverEqTquadbinQuadbinPhysicalFunction.cpp | 71 +++++++++ ...EverEqTquadbinTquadbinPhysicalFunction.cpp | 76 ++++++++++ .../EverNeQuadbinTquadbinPhysicalFunction.cpp | 71 +++++++++ .../EverNeTquadbinQuadbinPhysicalFunction.cpp | 71 +++++++++ ...EverNeTquadbinTquadbinPhysicalFunction.cpp | 76 ++++++++++ nes-sql-parser/AntlrSQL.g4 | 14 +- .../src/AntlrSQLQueryPlanCreator.cpp | 136 ++++++++++++++++++ 52 files changed, 2917 insertions(+), 1 deletion(-) create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysEqQuadbinTquadbinLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysEqTquadbinQuadbinLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysEqTquadbinTquadbinLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysNeQuadbinTquadbinLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysNeTquadbinQuadbinLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AlwaysNeTquadbinTquadbinLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverEqQuadbinTquadbinLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverEqTquadbinQuadbinLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverEqTquadbinTquadbinLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverNeQuadbinTquadbinLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverNeTquadbinQuadbinLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EverNeTquadbinTquadbinLogicalFunction.hpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysEqQuadbinTquadbinLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysEqTquadbinQuadbinLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysEqTquadbinTquadbinLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysNeQuadbinTquadbinLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysNeTquadbinQuadbinLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AlwaysNeTquadbinTquadbinLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverEqQuadbinTquadbinLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverEqTquadbinQuadbinLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverEqTquadbinTquadbinLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverNeQuadbinTquadbinLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverNeTquadbinQuadbinLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EverNeTquadbinTquadbinLogicalFunction.cpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysEqQuadbinTquadbinPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysEqTquadbinQuadbinPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysEqTquadbinTquadbinPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysNeQuadbinTquadbinPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysNeTquadbinQuadbinPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AlwaysNeTquadbinTquadbinPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverEqQuadbinTquadbinPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverEqTquadbinQuadbinPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverEqTquadbinTquadbinPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverNeQuadbinTquadbinPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverNeTquadbinQuadbinPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EverNeTquadbinTquadbinPhysicalFunction.hpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysEqQuadbinTquadbinPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysEqTquadbinQuadbinPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysEqTquadbinTquadbinPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysNeQuadbinTquadbinPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysNeTquadbinQuadbinPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AlwaysNeTquadbinTquadbinPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverEqQuadbinTquadbinPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverEqTquadbinQuadbinPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverEqTquadbinTquadbinPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverNeQuadbinTquadbinPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverNeTquadbinQuadbinPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EverNeTquadbinTquadbinPhysicalFunction.cpp diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysEqQuadbinTquadbinLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysEqQuadbinTquadbinLogicalFunction.hpp new file mode 100644 index 0000000000..bfc5d86d6a --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysEqQuadbinTquadbinLogicalFunction.hpp @@ -0,0 +1,45 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1 if the tquadbin instant always equals the Quadbin cell. + */ +class AlwaysEqQuadbinTquadbinLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysEqQuadbinTquadbin"; + AlwaysEqQuadbinTquadbinLogicalFunction(LogicalFunction cell, LogicalFunction inst_cell, LogicalFunction ts); + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysEqTquadbinQuadbinLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysEqTquadbinQuadbinLogicalFunction.hpp new file mode 100644 index 0000000000..0d7f0ea372 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysEqTquadbinQuadbinLogicalFunction.hpp @@ -0,0 +1,45 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1 if the tquadbin instant always equals the Quadbin cell. + */ +class AlwaysEqTquadbinQuadbinLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysEqTquadbinQuadbin"; + AlwaysEqTquadbinQuadbinLogicalFunction(LogicalFunction inst_cell, LogicalFunction ts, LogicalFunction cell); + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysEqTquadbinTquadbinLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysEqTquadbinTquadbinLogicalFunction.hpp new file mode 100644 index 0000000000..5afabdf2f9 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysEqTquadbinTquadbinLogicalFunction.hpp @@ -0,0 +1,45 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1 if two tquadbin instants always have equal cells. + */ +class AlwaysEqTquadbinTquadbinLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysEqTquadbinTquadbin"; + AlwaysEqTquadbinTquadbinLogicalFunction(LogicalFunction cell1, LogicalFunction ts1, LogicalFunction cell2, LogicalFunction ts2); + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysNeQuadbinTquadbinLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysNeQuadbinTquadbinLogicalFunction.hpp new file mode 100644 index 0000000000..eeb62ad6a5 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysNeQuadbinTquadbinLogicalFunction.hpp @@ -0,0 +1,45 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1 if the tquadbin instant always differs from the Quadbin cell. + */ +class AlwaysNeQuadbinTquadbinLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysNeQuadbinTquadbin"; + AlwaysNeQuadbinTquadbinLogicalFunction(LogicalFunction cell, LogicalFunction inst_cell, LogicalFunction ts); + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysNeTquadbinQuadbinLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysNeTquadbinQuadbinLogicalFunction.hpp new file mode 100644 index 0000000000..eaf6506589 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysNeTquadbinQuadbinLogicalFunction.hpp @@ -0,0 +1,45 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1 if the tquadbin instant always differs from the Quadbin cell. + */ +class AlwaysNeTquadbinQuadbinLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysNeTquadbinQuadbin"; + AlwaysNeTquadbinQuadbinLogicalFunction(LogicalFunction inst_cell, LogicalFunction ts, LogicalFunction cell); + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysNeTquadbinTquadbinLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysNeTquadbinTquadbinLogicalFunction.hpp new file mode 100644 index 0000000000..71bcc3e1aa --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AlwaysNeTquadbinTquadbinLogicalFunction.hpp @@ -0,0 +1,45 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1 if two tquadbin instants always have different cells. + */ +class AlwaysNeTquadbinTquadbinLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AlwaysNeTquadbinTquadbin"; + AlwaysNeTquadbinTquadbinLogicalFunction(LogicalFunction cell1, LogicalFunction ts1, LogicalFunction cell2, LogicalFunction ts2); + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverEqQuadbinTquadbinLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverEqQuadbinTquadbinLogicalFunction.hpp new file mode 100644 index 0000000000..c63fe3c127 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverEqQuadbinTquadbinLogicalFunction.hpp @@ -0,0 +1,45 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1 if the tquadbin instant ever equals the Quadbin cell. + */ +class EverEqQuadbinTquadbinLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverEqQuadbinTquadbin"; + EverEqQuadbinTquadbinLogicalFunction(LogicalFunction cell, LogicalFunction inst_cell, LogicalFunction ts); + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverEqTquadbinQuadbinLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverEqTquadbinQuadbinLogicalFunction.hpp new file mode 100644 index 0000000000..c76cc261ed --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverEqTquadbinQuadbinLogicalFunction.hpp @@ -0,0 +1,45 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1 if the tquadbin instant ever equals the Quadbin cell. + */ +class EverEqTquadbinQuadbinLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverEqTquadbinQuadbin"; + EverEqTquadbinQuadbinLogicalFunction(LogicalFunction inst_cell, LogicalFunction ts, LogicalFunction cell); + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverEqTquadbinTquadbinLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverEqTquadbinTquadbinLogicalFunction.hpp new file mode 100644 index 0000000000..4f0fb878c4 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverEqTquadbinTquadbinLogicalFunction.hpp @@ -0,0 +1,45 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1 if two tquadbin instants ever have equal cells. + */ +class EverEqTquadbinTquadbinLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverEqTquadbinTquadbin"; + EverEqTquadbinTquadbinLogicalFunction(LogicalFunction cell1, LogicalFunction ts1, LogicalFunction cell2, LogicalFunction ts2); + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverNeQuadbinTquadbinLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverNeQuadbinTquadbinLogicalFunction.hpp new file mode 100644 index 0000000000..9cfdce2e2f --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverNeQuadbinTquadbinLogicalFunction.hpp @@ -0,0 +1,45 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1 if the tquadbin instant ever differs from the Quadbin cell. + */ +class EverNeQuadbinTquadbinLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverNeQuadbinTquadbin"; + EverNeQuadbinTquadbinLogicalFunction(LogicalFunction cell, LogicalFunction inst_cell, LogicalFunction ts); + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverNeTquadbinQuadbinLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverNeTquadbinQuadbinLogicalFunction.hpp new file mode 100644 index 0000000000..c8ed26cfa7 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverNeTquadbinQuadbinLogicalFunction.hpp @@ -0,0 +1,45 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1 if the tquadbin instant ever differs from the Quadbin cell. + */ +class EverNeTquadbinQuadbinLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverNeTquadbinQuadbin"; + EverNeTquadbinQuadbinLogicalFunction(LogicalFunction inst_cell, LogicalFunction ts, LogicalFunction cell); + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverNeTquadbinTquadbinLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverNeTquadbinTquadbinLogicalFunction.hpp new file mode 100644 index 0000000000..74286aeaf1 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EverNeTquadbinTquadbinLogicalFunction.hpp @@ -0,0 +1,45 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1 if two tquadbin instants ever have different cells. + */ +class EverNeTquadbinTquadbinLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EverNeTquadbinTquadbin"; + EverNeTquadbinTquadbinLogicalFunction(LogicalFunction cell1, LogicalFunction ts1, LogicalFunction cell2, LogicalFunction ts2); + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysEqQuadbinTquadbinLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysEqQuadbinTquadbinLogicalFunction.cpp new file mode 100644 index 0000000000..820720448c --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysEqQuadbinTquadbinLogicalFunction.cpp @@ -0,0 +1,78 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AlwaysEqQuadbinTquadbinLogicalFunction::AlwaysEqQuadbinTquadbinLogicalFunction(LogicalFunction cell, LogicalFunction inst_cell, LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(cell)); + parameters.push_back(std::move(inst_cell)); + parameters.push_back(std::move(ts)); +} +DataType AlwaysEqQuadbinTquadbinLogicalFunction::getDataType() const { return dataType; } +LogicalFunction AlwaysEqQuadbinTquadbinLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } +std::vector AlwaysEqQuadbinTquadbinLogicalFunction::getChildren() const { return parameters; } +LogicalFunction AlwaysEqQuadbinTquadbinLogicalFunction::withChildren(const std::vector& children) const { + PRECONDITION(children.size()==3,"AlwaysEqQuadbinTquadbinLogicalFunction requires 3 children, but got {}",children.size()); + auto c=*this; c.parameters=children; return c; +} +std::string_view AlwaysEqQuadbinTquadbinLogicalFunction::getType() const { return NAME; } +bool AlwaysEqQuadbinTquadbinLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + return false; +} +std::string AlwaysEqQuadbinTquadbinLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("{}({})",NAME,parameters[0].explain(v)); +} +LogicalFunction AlwaysEqQuadbinTquadbinLogicalFunction::withInferredDataType(const Schema& schema) const { + std::vector c; c.reserve(3); + for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "cell must be UINT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "inst_cell must be UINT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); + return withChildren(c); +} +SerializableFunction AlwaysEqQuadbinTquadbinLogicalFunction::serialize() const { + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + return proto; +} +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysEqQuadbinTquadbinLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size()==3, + "AlwaysEqQuadbinTquadbinLogicalFunction requires 3 children but got {}", + arguments.children.size()); + return AlwaysEqQuadbinTquadbinLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysEqTquadbinQuadbinLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysEqTquadbinQuadbinLogicalFunction.cpp new file mode 100644 index 0000000000..aaf9fee915 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysEqTquadbinQuadbinLogicalFunction.cpp @@ -0,0 +1,78 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AlwaysEqTquadbinQuadbinLogicalFunction::AlwaysEqTquadbinQuadbinLogicalFunction(LogicalFunction inst_cell, LogicalFunction ts, LogicalFunction cell) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(inst_cell)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(cell)); +} +DataType AlwaysEqTquadbinQuadbinLogicalFunction::getDataType() const { return dataType; } +LogicalFunction AlwaysEqTquadbinQuadbinLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } +std::vector AlwaysEqTquadbinQuadbinLogicalFunction::getChildren() const { return parameters; } +LogicalFunction AlwaysEqTquadbinQuadbinLogicalFunction::withChildren(const std::vector& children) const { + PRECONDITION(children.size()==3,"AlwaysEqTquadbinQuadbinLogicalFunction requires 3 children, but got {}",children.size()); + auto c=*this; c.parameters=children; return c; +} +std::string_view AlwaysEqTquadbinQuadbinLogicalFunction::getType() const { return NAME; } +bool AlwaysEqTquadbinQuadbinLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + return false; +} +std::string AlwaysEqTquadbinQuadbinLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("{}({})",NAME,parameters[0].explain(v)); +} +LogicalFunction AlwaysEqTquadbinQuadbinLogicalFunction::withInferredDataType(const Schema& schema) const { + std::vector c; c.reserve(3); + for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "inst_cell must be UINT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "cell must be UINT64"); + return withChildren(c); +} +SerializableFunction AlwaysEqTquadbinQuadbinLogicalFunction::serialize() const { + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + return proto; +} +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysEqTquadbinQuadbinLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size()==3, + "AlwaysEqTquadbinQuadbinLogicalFunction requires 3 children but got {}", + arguments.children.size()); + return AlwaysEqTquadbinQuadbinLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysEqTquadbinTquadbinLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysEqTquadbinTquadbinLogicalFunction.cpp new file mode 100644 index 0000000000..d9c9bac6f3 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysEqTquadbinTquadbinLogicalFunction.cpp @@ -0,0 +1,81 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AlwaysEqTquadbinTquadbinLogicalFunction::AlwaysEqTquadbinTquadbinLogicalFunction(LogicalFunction cell1, LogicalFunction ts1, LogicalFunction cell2, LogicalFunction ts2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(4); + parameters.push_back(std::move(cell1)); + parameters.push_back(std::move(ts1)); + parameters.push_back(std::move(cell2)); + parameters.push_back(std::move(ts2)); +} +DataType AlwaysEqTquadbinTquadbinLogicalFunction::getDataType() const { return dataType; } +LogicalFunction AlwaysEqTquadbinTquadbinLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } +std::vector AlwaysEqTquadbinTquadbinLogicalFunction::getChildren() const { return parameters; } +LogicalFunction AlwaysEqTquadbinTquadbinLogicalFunction::withChildren(const std::vector& children) const { + PRECONDITION(children.size()==4,"AlwaysEqTquadbinTquadbinLogicalFunction requires 4 children, but got {}",children.size()); + auto c=*this; c.parameters=children; return c; +} +std::string_view AlwaysEqTquadbinTquadbinLogicalFunction::getType() const { return NAME; } +bool AlwaysEqTquadbinTquadbinLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + return false; +} +std::string AlwaysEqTquadbinTquadbinLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("{}({})",NAME,parameters[0].explain(v)); +} +LogicalFunction AlwaysEqTquadbinTquadbinLogicalFunction::withInferredDataType(const Schema& schema) const { + std::vector c; c.reserve(4); + for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "cell1 must be UINT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "cell2 must be UINT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); + return withChildren(c); +} +SerializableFunction AlwaysEqTquadbinTquadbinLogicalFunction::serialize() const { + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + return proto; +} +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysEqTquadbinTquadbinLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size()==4, + "AlwaysEqTquadbinTquadbinLogicalFunction requires 4 children but got {}", + arguments.children.size()); + return AlwaysEqTquadbinTquadbinLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysNeQuadbinTquadbinLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysNeQuadbinTquadbinLogicalFunction.cpp new file mode 100644 index 0000000000..9760596e1d --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysNeQuadbinTquadbinLogicalFunction.cpp @@ -0,0 +1,78 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AlwaysNeQuadbinTquadbinLogicalFunction::AlwaysNeQuadbinTquadbinLogicalFunction(LogicalFunction cell, LogicalFunction inst_cell, LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(cell)); + parameters.push_back(std::move(inst_cell)); + parameters.push_back(std::move(ts)); +} +DataType AlwaysNeQuadbinTquadbinLogicalFunction::getDataType() const { return dataType; } +LogicalFunction AlwaysNeQuadbinTquadbinLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } +std::vector AlwaysNeQuadbinTquadbinLogicalFunction::getChildren() const { return parameters; } +LogicalFunction AlwaysNeQuadbinTquadbinLogicalFunction::withChildren(const std::vector& children) const { + PRECONDITION(children.size()==3,"AlwaysNeQuadbinTquadbinLogicalFunction requires 3 children, but got {}",children.size()); + auto c=*this; c.parameters=children; return c; +} +std::string_view AlwaysNeQuadbinTquadbinLogicalFunction::getType() const { return NAME; } +bool AlwaysNeQuadbinTquadbinLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + return false; +} +std::string AlwaysNeQuadbinTquadbinLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("{}({})",NAME,parameters[0].explain(v)); +} +LogicalFunction AlwaysNeQuadbinTquadbinLogicalFunction::withInferredDataType(const Schema& schema) const { + std::vector c; c.reserve(3); + for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "cell must be UINT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "inst_cell must be UINT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); + return withChildren(c); +} +SerializableFunction AlwaysNeQuadbinTquadbinLogicalFunction::serialize() const { + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + return proto; +} +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysNeQuadbinTquadbinLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size()==3, + "AlwaysNeQuadbinTquadbinLogicalFunction requires 3 children but got {}", + arguments.children.size()); + return AlwaysNeQuadbinTquadbinLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysNeTquadbinQuadbinLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysNeTquadbinQuadbinLogicalFunction.cpp new file mode 100644 index 0000000000..d21c18bd8e --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysNeTquadbinQuadbinLogicalFunction.cpp @@ -0,0 +1,78 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AlwaysNeTquadbinQuadbinLogicalFunction::AlwaysNeTquadbinQuadbinLogicalFunction(LogicalFunction inst_cell, LogicalFunction ts, LogicalFunction cell) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(inst_cell)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(cell)); +} +DataType AlwaysNeTquadbinQuadbinLogicalFunction::getDataType() const { return dataType; } +LogicalFunction AlwaysNeTquadbinQuadbinLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } +std::vector AlwaysNeTquadbinQuadbinLogicalFunction::getChildren() const { return parameters; } +LogicalFunction AlwaysNeTquadbinQuadbinLogicalFunction::withChildren(const std::vector& children) const { + PRECONDITION(children.size()==3,"AlwaysNeTquadbinQuadbinLogicalFunction requires 3 children, but got {}",children.size()); + auto c=*this; c.parameters=children; return c; +} +std::string_view AlwaysNeTquadbinQuadbinLogicalFunction::getType() const { return NAME; } +bool AlwaysNeTquadbinQuadbinLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + return false; +} +std::string AlwaysNeTquadbinQuadbinLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("{}({})",NAME,parameters[0].explain(v)); +} +LogicalFunction AlwaysNeTquadbinQuadbinLogicalFunction::withInferredDataType(const Schema& schema) const { + std::vector c; c.reserve(3); + for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "inst_cell must be UINT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "cell must be UINT64"); + return withChildren(c); +} +SerializableFunction AlwaysNeTquadbinQuadbinLogicalFunction::serialize() const { + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + return proto; +} +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysNeTquadbinQuadbinLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size()==3, + "AlwaysNeTquadbinQuadbinLogicalFunction requires 3 children but got {}", + arguments.children.size()); + return AlwaysNeTquadbinQuadbinLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysNeTquadbinTquadbinLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysNeTquadbinTquadbinLogicalFunction.cpp new file mode 100644 index 0000000000..552859d800 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AlwaysNeTquadbinTquadbinLogicalFunction.cpp @@ -0,0 +1,81 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AlwaysNeTquadbinTquadbinLogicalFunction::AlwaysNeTquadbinTquadbinLogicalFunction(LogicalFunction cell1, LogicalFunction ts1, LogicalFunction cell2, LogicalFunction ts2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(4); + parameters.push_back(std::move(cell1)); + parameters.push_back(std::move(ts1)); + parameters.push_back(std::move(cell2)); + parameters.push_back(std::move(ts2)); +} +DataType AlwaysNeTquadbinTquadbinLogicalFunction::getDataType() const { return dataType; } +LogicalFunction AlwaysNeTquadbinTquadbinLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } +std::vector AlwaysNeTquadbinTquadbinLogicalFunction::getChildren() const { return parameters; } +LogicalFunction AlwaysNeTquadbinTquadbinLogicalFunction::withChildren(const std::vector& children) const { + PRECONDITION(children.size()==4,"AlwaysNeTquadbinTquadbinLogicalFunction requires 4 children, but got {}",children.size()); + auto c=*this; c.parameters=children; return c; +} +std::string_view AlwaysNeTquadbinTquadbinLogicalFunction::getType() const { return NAME; } +bool AlwaysNeTquadbinTquadbinLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + return false; +} +std::string AlwaysNeTquadbinTquadbinLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("{}({})",NAME,parameters[0].explain(v)); +} +LogicalFunction AlwaysNeTquadbinTquadbinLogicalFunction::withInferredDataType(const Schema& schema) const { + std::vector c; c.reserve(4); + for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "cell1 must be UINT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "cell2 must be UINT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); + return withChildren(c); +} +SerializableFunction AlwaysNeTquadbinTquadbinLogicalFunction::serialize() const { + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + return proto; +} +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysNeTquadbinTquadbinLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size()==4, + "AlwaysNeTquadbinTquadbinLogicalFunction requires 4 children but got {}", + arguments.children.size()); + return AlwaysNeTquadbinTquadbinLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt index 6f7716eaf8..d2f3599cac 100644 --- a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt @@ -551,6 +551,18 @@ add_plugin(QuadbinLe LogicalFunction nes-logical-operators QuadbinLeLogicalFunct add_plugin(QuadbinGt LogicalFunction nes-logical-operators QuadbinGtLogicalFunction.cpp) add_plugin(QuadbinGe LogicalFunction nes-logical-operators QuadbinGeLogicalFunction.cpp) add_plugin(QuadbinCmp LogicalFunction nes-logical-operators QuadbinCmpLogicalFunction.cpp) +add_plugin(EverEqQuadbinTquadbin LogicalFunction nes-logical-operators EverEqQuadbinTquadbinLogicalFunction.cpp) +add_plugin(EverNeQuadbinTquadbin LogicalFunction nes-logical-operators EverNeQuadbinTquadbinLogicalFunction.cpp) +add_plugin(AlwaysEqQuadbinTquadbin LogicalFunction nes-logical-operators AlwaysEqQuadbinTquadbinLogicalFunction.cpp) +add_plugin(AlwaysNeQuadbinTquadbin LogicalFunction nes-logical-operators AlwaysNeQuadbinTquadbinLogicalFunction.cpp) +add_plugin(EverEqTquadbinQuadbin LogicalFunction nes-logical-operators EverEqTquadbinQuadbinLogicalFunction.cpp) +add_plugin(EverNeTquadbinQuadbin LogicalFunction nes-logical-operators EverNeTquadbinQuadbinLogicalFunction.cpp) +add_plugin(AlwaysEqTquadbinQuadbin LogicalFunction nes-logical-operators AlwaysEqTquadbinQuadbinLogicalFunction.cpp) +add_plugin(AlwaysNeTquadbinQuadbin LogicalFunction nes-logical-operators AlwaysNeTquadbinQuadbinLogicalFunction.cpp) +add_plugin(EverEqTquadbinTquadbin LogicalFunction nes-logical-operators EverEqTquadbinTquadbinLogicalFunction.cpp) +add_plugin(EverNeTquadbinTquadbin LogicalFunction nes-logical-operators EverNeTquadbinTquadbinLogicalFunction.cpp) +add_plugin(AlwaysEqTquadbinTquadbin LogicalFunction nes-logical-operators AlwaysEqTquadbinTquadbinLogicalFunction.cpp) +add_plugin(AlwaysNeTquadbinTquadbin LogicalFunction nes-logical-operators AlwaysNeTquadbinTquadbinLogicalFunction.cpp) add_plugin(GeomRelatePattern LogicalFunction nes-logical-operators GeomRelatePatternLogicalFunction.cpp) add_plugin(GeomIntersects2d LogicalFunction nes-logical-operators GeomIntersects2dLogicalFunction.cpp) add_plugin(GeomDwithin2d LogicalFunction nes-logical-operators GeomDwithin2dLogicalFunction.cpp) diff --git a/nes-logical-operators/src/Functions/Meos/EverEqQuadbinTquadbinLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverEqQuadbinTquadbinLogicalFunction.cpp new file mode 100644 index 0000000000..f47ea08411 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverEqQuadbinTquadbinLogicalFunction.cpp @@ -0,0 +1,78 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EverEqQuadbinTquadbinLogicalFunction::EverEqQuadbinTquadbinLogicalFunction(LogicalFunction cell, LogicalFunction inst_cell, LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(cell)); + parameters.push_back(std::move(inst_cell)); + parameters.push_back(std::move(ts)); +} +DataType EverEqQuadbinTquadbinLogicalFunction::getDataType() const { return dataType; } +LogicalFunction EverEqQuadbinTquadbinLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } +std::vector EverEqQuadbinTquadbinLogicalFunction::getChildren() const { return parameters; } +LogicalFunction EverEqQuadbinTquadbinLogicalFunction::withChildren(const std::vector& children) const { + PRECONDITION(children.size()==3,"EverEqQuadbinTquadbinLogicalFunction requires 3 children, but got {}",children.size()); + auto c=*this; c.parameters=children; return c; +} +std::string_view EverEqQuadbinTquadbinLogicalFunction::getType() const { return NAME; } +bool EverEqQuadbinTquadbinLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + return false; +} +std::string EverEqQuadbinTquadbinLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("{}({})",NAME,parameters[0].explain(v)); +} +LogicalFunction EverEqQuadbinTquadbinLogicalFunction::withInferredDataType(const Schema& schema) const { + std::vector c; c.reserve(3); + for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "cell must be UINT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "inst_cell must be UINT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); + return withChildren(c); +} +SerializableFunction EverEqQuadbinTquadbinLogicalFunction::serialize() const { + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + return proto; +} +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverEqQuadbinTquadbinLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size()==3, + "EverEqQuadbinTquadbinLogicalFunction requires 3 children but got {}", + arguments.children.size()); + return EverEqQuadbinTquadbinLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverEqTquadbinQuadbinLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverEqTquadbinQuadbinLogicalFunction.cpp new file mode 100644 index 0000000000..54494e6681 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverEqTquadbinQuadbinLogicalFunction.cpp @@ -0,0 +1,78 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EverEqTquadbinQuadbinLogicalFunction::EverEqTquadbinQuadbinLogicalFunction(LogicalFunction inst_cell, LogicalFunction ts, LogicalFunction cell) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(inst_cell)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(cell)); +} +DataType EverEqTquadbinQuadbinLogicalFunction::getDataType() const { return dataType; } +LogicalFunction EverEqTquadbinQuadbinLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } +std::vector EverEqTquadbinQuadbinLogicalFunction::getChildren() const { return parameters; } +LogicalFunction EverEqTquadbinQuadbinLogicalFunction::withChildren(const std::vector& children) const { + PRECONDITION(children.size()==3,"EverEqTquadbinQuadbinLogicalFunction requires 3 children, but got {}",children.size()); + auto c=*this; c.parameters=children; return c; +} +std::string_view EverEqTquadbinQuadbinLogicalFunction::getType() const { return NAME; } +bool EverEqTquadbinQuadbinLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + return false; +} +std::string EverEqTquadbinQuadbinLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("{}({})",NAME,parameters[0].explain(v)); +} +LogicalFunction EverEqTquadbinQuadbinLogicalFunction::withInferredDataType(const Schema& schema) const { + std::vector c; c.reserve(3); + for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "inst_cell must be UINT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "cell must be UINT64"); + return withChildren(c); +} +SerializableFunction EverEqTquadbinQuadbinLogicalFunction::serialize() const { + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + return proto; +} +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverEqTquadbinQuadbinLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size()==3, + "EverEqTquadbinQuadbinLogicalFunction requires 3 children but got {}", + arguments.children.size()); + return EverEqTquadbinQuadbinLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverEqTquadbinTquadbinLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverEqTquadbinTquadbinLogicalFunction.cpp new file mode 100644 index 0000000000..73f6d351b1 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverEqTquadbinTquadbinLogicalFunction.cpp @@ -0,0 +1,81 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EverEqTquadbinTquadbinLogicalFunction::EverEqTquadbinTquadbinLogicalFunction(LogicalFunction cell1, LogicalFunction ts1, LogicalFunction cell2, LogicalFunction ts2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(4); + parameters.push_back(std::move(cell1)); + parameters.push_back(std::move(ts1)); + parameters.push_back(std::move(cell2)); + parameters.push_back(std::move(ts2)); +} +DataType EverEqTquadbinTquadbinLogicalFunction::getDataType() const { return dataType; } +LogicalFunction EverEqTquadbinTquadbinLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } +std::vector EverEqTquadbinTquadbinLogicalFunction::getChildren() const { return parameters; } +LogicalFunction EverEqTquadbinTquadbinLogicalFunction::withChildren(const std::vector& children) const { + PRECONDITION(children.size()==4,"EverEqTquadbinTquadbinLogicalFunction requires 4 children, but got {}",children.size()); + auto c=*this; c.parameters=children; return c; +} +std::string_view EverEqTquadbinTquadbinLogicalFunction::getType() const { return NAME; } +bool EverEqTquadbinTquadbinLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + return false; +} +std::string EverEqTquadbinTquadbinLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("{}({})",NAME,parameters[0].explain(v)); +} +LogicalFunction EverEqTquadbinTquadbinLogicalFunction::withInferredDataType(const Schema& schema) const { + std::vector c; c.reserve(4); + for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "cell1 must be UINT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "cell2 must be UINT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); + return withChildren(c); +} +SerializableFunction EverEqTquadbinTquadbinLogicalFunction::serialize() const { + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + return proto; +} +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverEqTquadbinTquadbinLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size()==4, + "EverEqTquadbinTquadbinLogicalFunction requires 4 children but got {}", + arguments.children.size()); + return EverEqTquadbinTquadbinLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverNeQuadbinTquadbinLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverNeQuadbinTquadbinLogicalFunction.cpp new file mode 100644 index 0000000000..c20fc2e1fc --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverNeQuadbinTquadbinLogicalFunction.cpp @@ -0,0 +1,78 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EverNeQuadbinTquadbinLogicalFunction::EverNeQuadbinTquadbinLogicalFunction(LogicalFunction cell, LogicalFunction inst_cell, LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(cell)); + parameters.push_back(std::move(inst_cell)); + parameters.push_back(std::move(ts)); +} +DataType EverNeQuadbinTquadbinLogicalFunction::getDataType() const { return dataType; } +LogicalFunction EverNeQuadbinTquadbinLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } +std::vector EverNeQuadbinTquadbinLogicalFunction::getChildren() const { return parameters; } +LogicalFunction EverNeQuadbinTquadbinLogicalFunction::withChildren(const std::vector& children) const { + PRECONDITION(children.size()==3,"EverNeQuadbinTquadbinLogicalFunction requires 3 children, but got {}",children.size()); + auto c=*this; c.parameters=children; return c; +} +std::string_view EverNeQuadbinTquadbinLogicalFunction::getType() const { return NAME; } +bool EverNeQuadbinTquadbinLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + return false; +} +std::string EverNeQuadbinTquadbinLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("{}({})",NAME,parameters[0].explain(v)); +} +LogicalFunction EverNeQuadbinTquadbinLogicalFunction::withInferredDataType(const Schema& schema) const { + std::vector c; c.reserve(3); + for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "cell must be UINT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "inst_cell must be UINT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); + return withChildren(c); +} +SerializableFunction EverNeQuadbinTquadbinLogicalFunction::serialize() const { + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + return proto; +} +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverNeQuadbinTquadbinLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size()==3, + "EverNeQuadbinTquadbinLogicalFunction requires 3 children but got {}", + arguments.children.size()); + return EverNeQuadbinTquadbinLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverNeTquadbinQuadbinLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverNeTquadbinQuadbinLogicalFunction.cpp new file mode 100644 index 0000000000..5be17a77a9 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverNeTquadbinQuadbinLogicalFunction.cpp @@ -0,0 +1,78 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EverNeTquadbinQuadbinLogicalFunction::EverNeTquadbinQuadbinLogicalFunction(LogicalFunction inst_cell, LogicalFunction ts, LogicalFunction cell) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(inst_cell)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(cell)); +} +DataType EverNeTquadbinQuadbinLogicalFunction::getDataType() const { return dataType; } +LogicalFunction EverNeTquadbinQuadbinLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } +std::vector EverNeTquadbinQuadbinLogicalFunction::getChildren() const { return parameters; } +LogicalFunction EverNeTquadbinQuadbinLogicalFunction::withChildren(const std::vector& children) const { + PRECONDITION(children.size()==3,"EverNeTquadbinQuadbinLogicalFunction requires 3 children, but got {}",children.size()); + auto c=*this; c.parameters=children; return c; +} +std::string_view EverNeTquadbinQuadbinLogicalFunction::getType() const { return NAME; } +bool EverNeTquadbinQuadbinLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + return false; +} +std::string EverNeTquadbinQuadbinLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("{}({})",NAME,parameters[0].explain(v)); +} +LogicalFunction EverNeTquadbinQuadbinLogicalFunction::withInferredDataType(const Schema& schema) const { + std::vector c; c.reserve(3); + for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "inst_cell must be UINT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "cell must be UINT64"); + return withChildren(c); +} +SerializableFunction EverNeTquadbinQuadbinLogicalFunction::serialize() const { + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + return proto; +} +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverNeTquadbinQuadbinLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size()==3, + "EverNeTquadbinQuadbinLogicalFunction requires 3 children but got {}", + arguments.children.size()); + return EverNeTquadbinQuadbinLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverNeTquadbinTquadbinLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverNeTquadbinTquadbinLogicalFunction.cpp new file mode 100644 index 0000000000..09a4988920 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EverNeTquadbinTquadbinLogicalFunction.cpp @@ -0,0 +1,81 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EverNeTquadbinTquadbinLogicalFunction::EverNeTquadbinTquadbinLogicalFunction(LogicalFunction cell1, LogicalFunction ts1, LogicalFunction cell2, LogicalFunction ts2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(4); + parameters.push_back(std::move(cell1)); + parameters.push_back(std::move(ts1)); + parameters.push_back(std::move(cell2)); + parameters.push_back(std::move(ts2)); +} +DataType EverNeTquadbinTquadbinLogicalFunction::getDataType() const { return dataType; } +LogicalFunction EverNeTquadbinTquadbinLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } +std::vector EverNeTquadbinTquadbinLogicalFunction::getChildren() const { return parameters; } +LogicalFunction EverNeTquadbinTquadbinLogicalFunction::withChildren(const std::vector& children) const { + PRECONDITION(children.size()==4,"EverNeTquadbinTquadbinLogicalFunction requires 4 children, but got {}",children.size()); + auto c=*this; c.parameters=children; return c; +} +std::string_view EverNeTquadbinTquadbinLogicalFunction::getType() const { return NAME; } +bool EverNeTquadbinTquadbinLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + return false; +} +std::string EverNeTquadbinTquadbinLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("{}({})",NAME,parameters[0].explain(v)); +} +LogicalFunction EverNeTquadbinTquadbinLogicalFunction::withInferredDataType(const Schema& schema) const { + std::vector c; c.reserve(4); + for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "cell1 must be UINT64"); + INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "cell2 must be UINT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); + return withChildren(c); +} +SerializableFunction EverNeTquadbinTquadbinLogicalFunction::serialize() const { + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + return proto; +} +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverNeTquadbinTquadbinLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size()==4, + "EverNeTquadbinTquadbinLogicalFunction requires 4 children but got {}", + arguments.children.size()); + return EverNeTquadbinTquadbinLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3])); +} + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysEqQuadbinTquadbinPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysEqQuadbinTquadbinPhysicalFunction.hpp new file mode 100644 index 0000000000..e37be0e630 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysEqQuadbinTquadbinPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class AlwaysEqQuadbinTquadbinPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysEqQuadbinTquadbinPhysicalFunction(PhysicalFunction cell, PhysicalFunction inst_cell, PhysicalFunction ts); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysEqTquadbinQuadbinPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysEqTquadbinQuadbinPhysicalFunction.hpp new file mode 100644 index 0000000000..73755be1d8 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysEqTquadbinQuadbinPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class AlwaysEqTquadbinQuadbinPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysEqTquadbinQuadbinPhysicalFunction(PhysicalFunction inst_cell, PhysicalFunction ts, PhysicalFunction cell); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysEqTquadbinTquadbinPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysEqTquadbinTquadbinPhysicalFunction.hpp new file mode 100644 index 0000000000..9826f412ee --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysEqTquadbinTquadbinPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class AlwaysEqTquadbinTquadbinPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysEqTquadbinTquadbinPhysicalFunction(PhysicalFunction cell1, PhysicalFunction ts1, PhysicalFunction cell2, PhysicalFunction ts2); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysNeQuadbinTquadbinPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysNeQuadbinTquadbinPhysicalFunction.hpp new file mode 100644 index 0000000000..6de381589b --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysNeQuadbinTquadbinPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class AlwaysNeQuadbinTquadbinPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysNeQuadbinTquadbinPhysicalFunction(PhysicalFunction cell, PhysicalFunction inst_cell, PhysicalFunction ts); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysNeTquadbinQuadbinPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysNeTquadbinQuadbinPhysicalFunction.hpp new file mode 100644 index 0000000000..c2c47ae822 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysNeTquadbinQuadbinPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class AlwaysNeTquadbinQuadbinPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysNeTquadbinQuadbinPhysicalFunction(PhysicalFunction inst_cell, PhysicalFunction ts, PhysicalFunction cell); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysNeTquadbinTquadbinPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysNeTquadbinTquadbinPhysicalFunction.hpp new file mode 100644 index 0000000000..20bdace9e8 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AlwaysNeTquadbinTquadbinPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class AlwaysNeTquadbinTquadbinPhysicalFunction : public PhysicalFunctionConcept { +public: + AlwaysNeTquadbinTquadbinPhysicalFunction(PhysicalFunction cell1, PhysicalFunction ts1, PhysicalFunction cell2, PhysicalFunction ts2); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverEqQuadbinTquadbinPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverEqQuadbinTquadbinPhysicalFunction.hpp new file mode 100644 index 0000000000..2a6d5f6e0d --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverEqQuadbinTquadbinPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class EverEqQuadbinTquadbinPhysicalFunction : public PhysicalFunctionConcept { +public: + EverEqQuadbinTquadbinPhysicalFunction(PhysicalFunction cell, PhysicalFunction inst_cell, PhysicalFunction ts); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverEqTquadbinQuadbinPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverEqTquadbinQuadbinPhysicalFunction.hpp new file mode 100644 index 0000000000..72a8284b89 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverEqTquadbinQuadbinPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class EverEqTquadbinQuadbinPhysicalFunction : public PhysicalFunctionConcept { +public: + EverEqTquadbinQuadbinPhysicalFunction(PhysicalFunction inst_cell, PhysicalFunction ts, PhysicalFunction cell); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverEqTquadbinTquadbinPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverEqTquadbinTquadbinPhysicalFunction.hpp new file mode 100644 index 0000000000..b6a0e259a7 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverEqTquadbinTquadbinPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class EverEqTquadbinTquadbinPhysicalFunction : public PhysicalFunctionConcept { +public: + EverEqTquadbinTquadbinPhysicalFunction(PhysicalFunction cell1, PhysicalFunction ts1, PhysicalFunction cell2, PhysicalFunction ts2); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverNeQuadbinTquadbinPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverNeQuadbinTquadbinPhysicalFunction.hpp new file mode 100644 index 0000000000..c70689b26e --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverNeQuadbinTquadbinPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class EverNeQuadbinTquadbinPhysicalFunction : public PhysicalFunctionConcept { +public: + EverNeQuadbinTquadbinPhysicalFunction(PhysicalFunction cell, PhysicalFunction inst_cell, PhysicalFunction ts); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverNeTquadbinQuadbinPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverNeTquadbinQuadbinPhysicalFunction.hpp new file mode 100644 index 0000000000..4eb94e28ee --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverNeTquadbinQuadbinPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class EverNeTquadbinQuadbinPhysicalFunction : public PhysicalFunctionConcept { +public: + EverNeTquadbinQuadbinPhysicalFunction(PhysicalFunction inst_cell, PhysicalFunction ts, PhysicalFunction cell); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverNeTquadbinTquadbinPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverNeTquadbinTquadbinPhysicalFunction.hpp new file mode 100644 index 0000000000..f0c4554a03 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EverNeTquadbinTquadbinPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class EverNeTquadbinTquadbinPhysicalFunction : public PhysicalFunctionConcept { +public: + EverNeTquadbinTquadbinPhysicalFunction(PhysicalFunction cell1, PhysicalFunction ts1, PhysicalFunction cell2, PhysicalFunction ts2); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysEqQuadbinTquadbinPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysEqQuadbinTquadbinPhysicalFunction.cpp new file mode 100644 index 0000000000..7cd507466a --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysEqQuadbinTquadbinPhysicalFunction.cpp @@ -0,0 +1,71 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +AlwaysEqQuadbinTquadbinPhysicalFunction::AlwaysEqQuadbinTquadbinPhysicalFunction(PhysicalFunction cell, PhysicalFunction inst_cell, PhysicalFunction ts) { + paramFns.reserve(3); + paramFns.push_back(std::move(cell)); + paramFns.push_back(std::move(inst_cell)); + paramFns.push_back(std::move(ts)); +} + +VarVal AlwaysEqQuadbinTquadbinPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { + auto cell = paramFns[0].execute(record, arena).cast(); + auto inst_cell = paramFns[1].execute(record, arena).cast(); + auto ts = paramFns[2].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](uint64_t cell, uint64_t ic, uint64_t ts) -> double { + MEOS::Meos::ensureMeosInitialized(); + TInstant* inst = tquadbininst_make((Quadbin)ic, (TimestampTz)ts); + if (!inst) return 0.0; + int r = always_eq_quadbin_tquadbin((Quadbin)cell, (const Temporal*)inst); + free(inst); + return r > 0 ? 1.0 : 0.0; + }, + cell, inst_cell, ts); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysEqQuadbinTquadbinPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size()==3, + "AlwaysEqQuadbinTquadbinPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + return AlwaysEqQuadbinTquadbinPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysEqTquadbinQuadbinPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysEqTquadbinQuadbinPhysicalFunction.cpp new file mode 100644 index 0000000000..8add7b7f51 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysEqTquadbinQuadbinPhysicalFunction.cpp @@ -0,0 +1,71 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +AlwaysEqTquadbinQuadbinPhysicalFunction::AlwaysEqTquadbinQuadbinPhysicalFunction(PhysicalFunction inst_cell, PhysicalFunction ts, PhysicalFunction cell) { + paramFns.reserve(3); + paramFns.push_back(std::move(inst_cell)); + paramFns.push_back(std::move(ts)); + paramFns.push_back(std::move(cell)); +} + +VarVal AlwaysEqTquadbinQuadbinPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { + auto inst_cell = paramFns[0].execute(record, arena).cast(); + auto ts = paramFns[1].execute(record, arena).cast(); + auto cell = paramFns[2].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](uint64_t ic, uint64_t ts, uint64_t cell) -> double { + MEOS::Meos::ensureMeosInitialized(); + TInstant* inst = tquadbininst_make((Quadbin)ic, (TimestampTz)ts); + if (!inst) return 0.0; + int r = always_eq_tquadbin_quadbin((const Temporal*)inst, (Quadbin)cell); + free(inst); + return r > 0 ? 1.0 : 0.0; + }, + inst_cell, ts, cell); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysEqTquadbinQuadbinPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size()==3, + "AlwaysEqTquadbinQuadbinPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + return AlwaysEqTquadbinQuadbinPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysEqTquadbinTquadbinPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysEqTquadbinTquadbinPhysicalFunction.cpp new file mode 100644 index 0000000000..b1a7a997f2 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysEqTquadbinTquadbinPhysicalFunction.cpp @@ -0,0 +1,76 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +AlwaysEqTquadbinTquadbinPhysicalFunction::AlwaysEqTquadbinTquadbinPhysicalFunction(PhysicalFunction cell1, PhysicalFunction ts1, PhysicalFunction cell2, PhysicalFunction ts2) { + paramFns.reserve(4); + paramFns.push_back(std::move(cell1)); + paramFns.push_back(std::move(ts1)); + paramFns.push_back(std::move(cell2)); + paramFns.push_back(std::move(ts2)); +} + +VarVal AlwaysEqTquadbinTquadbinPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { + auto cell1 = paramFns[0].execute(record, arena).cast(); + auto ts1 = paramFns[1].execute(record, arena).cast(); + auto cell2 = paramFns[2].execute(record, arena).cast(); + auto ts2 = paramFns[3].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](uint64_t c1, uint64_t t1, uint64_t c2, uint64_t t2) -> double { + MEOS::Meos::ensureMeosInitialized(); + TInstant* i1 = tquadbininst_make((Quadbin)c1, (TimestampTz)t1); + if (!i1) return 0.0; + TInstant* i2 = tquadbininst_make((Quadbin)c2, (TimestampTz)t2); + if (!i2) { free(i1); return 0.0; } + int r = always_eq_tquadbin_tquadbin((const Temporal*)i1, (const Temporal*)i2); + free(i1); free(i2); + return r > 0 ? 1.0 : 0.0; + }, + cell1, ts1, cell2, ts2); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysEqTquadbinTquadbinPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size()==4, + "AlwaysEqTquadbinTquadbinPhysicalFunction requires 4 children but got {}", + arguments.childFunctions.size()); + return AlwaysEqTquadbinTquadbinPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysNeQuadbinTquadbinPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysNeQuadbinTquadbinPhysicalFunction.cpp new file mode 100644 index 0000000000..bff504adf9 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysNeQuadbinTquadbinPhysicalFunction.cpp @@ -0,0 +1,71 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +AlwaysNeQuadbinTquadbinPhysicalFunction::AlwaysNeQuadbinTquadbinPhysicalFunction(PhysicalFunction cell, PhysicalFunction inst_cell, PhysicalFunction ts) { + paramFns.reserve(3); + paramFns.push_back(std::move(cell)); + paramFns.push_back(std::move(inst_cell)); + paramFns.push_back(std::move(ts)); +} + +VarVal AlwaysNeQuadbinTquadbinPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { + auto cell = paramFns[0].execute(record, arena).cast(); + auto inst_cell = paramFns[1].execute(record, arena).cast(); + auto ts = paramFns[2].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](uint64_t cell, uint64_t ic, uint64_t ts) -> double { + MEOS::Meos::ensureMeosInitialized(); + TInstant* inst = tquadbininst_make((Quadbin)ic, (TimestampTz)ts); + if (!inst) return 0.0; + int r = always_ne_quadbin_tquadbin((Quadbin)cell, (const Temporal*)inst); + free(inst); + return r > 0 ? 1.0 : 0.0; + }, + cell, inst_cell, ts); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysNeQuadbinTquadbinPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size()==3, + "AlwaysNeQuadbinTquadbinPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + return AlwaysNeQuadbinTquadbinPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysNeTquadbinQuadbinPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysNeTquadbinQuadbinPhysicalFunction.cpp new file mode 100644 index 0000000000..97666e2782 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysNeTquadbinQuadbinPhysicalFunction.cpp @@ -0,0 +1,71 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +AlwaysNeTquadbinQuadbinPhysicalFunction::AlwaysNeTquadbinQuadbinPhysicalFunction(PhysicalFunction inst_cell, PhysicalFunction ts, PhysicalFunction cell) { + paramFns.reserve(3); + paramFns.push_back(std::move(inst_cell)); + paramFns.push_back(std::move(ts)); + paramFns.push_back(std::move(cell)); +} + +VarVal AlwaysNeTquadbinQuadbinPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { + auto inst_cell = paramFns[0].execute(record, arena).cast(); + auto ts = paramFns[1].execute(record, arena).cast(); + auto cell = paramFns[2].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](uint64_t ic, uint64_t ts, uint64_t cell) -> double { + MEOS::Meos::ensureMeosInitialized(); + TInstant* inst = tquadbininst_make((Quadbin)ic, (TimestampTz)ts); + if (!inst) return 0.0; + int r = always_ne_tquadbin_quadbin((const Temporal*)inst, (Quadbin)cell); + free(inst); + return r > 0 ? 1.0 : 0.0; + }, + inst_cell, ts, cell); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysNeTquadbinQuadbinPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size()==3, + "AlwaysNeTquadbinQuadbinPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + return AlwaysNeTquadbinQuadbinPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysNeTquadbinTquadbinPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysNeTquadbinTquadbinPhysicalFunction.cpp new file mode 100644 index 0000000000..1dafc48de6 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AlwaysNeTquadbinTquadbinPhysicalFunction.cpp @@ -0,0 +1,76 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +AlwaysNeTquadbinTquadbinPhysicalFunction::AlwaysNeTquadbinTquadbinPhysicalFunction(PhysicalFunction cell1, PhysicalFunction ts1, PhysicalFunction cell2, PhysicalFunction ts2) { + paramFns.reserve(4); + paramFns.push_back(std::move(cell1)); + paramFns.push_back(std::move(ts1)); + paramFns.push_back(std::move(cell2)); + paramFns.push_back(std::move(ts2)); +} + +VarVal AlwaysNeTquadbinTquadbinPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { + auto cell1 = paramFns[0].execute(record, arena).cast(); + auto ts1 = paramFns[1].execute(record, arena).cast(); + auto cell2 = paramFns[2].execute(record, arena).cast(); + auto ts2 = paramFns[3].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](uint64_t c1, uint64_t t1, uint64_t c2, uint64_t t2) -> double { + MEOS::Meos::ensureMeosInitialized(); + TInstant* i1 = tquadbininst_make((Quadbin)c1, (TimestampTz)t1); + if (!i1) return 0.0; + TInstant* i2 = tquadbininst_make((Quadbin)c2, (TimestampTz)t2); + if (!i2) { free(i1); return 0.0; } + int r = always_ne_tquadbin_tquadbin((const Temporal*)i1, (const Temporal*)i2); + free(i1); free(i2); + return r > 0 ? 1.0 : 0.0; + }, + cell1, ts1, cell2, ts2); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysNeTquadbinTquadbinPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size()==4, + "AlwaysNeTquadbinTquadbinPhysicalFunction requires 4 children but got {}", + arguments.childFunctions.size()); + return AlwaysNeTquadbinTquadbinPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt index e894b959bb..117075e83e 100644 --- a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt @@ -550,6 +550,18 @@ add_plugin(QuadbinLe PhysicalFunction nes-physical-operators QuadbinLePhysicalFu add_plugin(QuadbinGt PhysicalFunction nes-physical-operators QuadbinGtPhysicalFunction.cpp) add_plugin(QuadbinGe PhysicalFunction nes-physical-operators QuadbinGePhysicalFunction.cpp) add_plugin(QuadbinCmp PhysicalFunction nes-physical-operators QuadbinCmpPhysicalFunction.cpp) +add_plugin(EverEqQuadbinTquadbin PhysicalFunction nes-physical-operators EverEqQuadbinTquadbinPhysicalFunction.cpp) +add_plugin(EverNeQuadbinTquadbin PhysicalFunction nes-physical-operators EverNeQuadbinTquadbinPhysicalFunction.cpp) +add_plugin(AlwaysEqQuadbinTquadbin PhysicalFunction nes-physical-operators AlwaysEqQuadbinTquadbinPhysicalFunction.cpp) +add_plugin(AlwaysNeQuadbinTquadbin PhysicalFunction nes-physical-operators AlwaysNeQuadbinTquadbinPhysicalFunction.cpp) +add_plugin(EverEqTquadbinQuadbin PhysicalFunction nes-physical-operators EverEqTquadbinQuadbinPhysicalFunction.cpp) +add_plugin(EverNeTquadbinQuadbin PhysicalFunction nes-physical-operators EverNeTquadbinQuadbinPhysicalFunction.cpp) +add_plugin(AlwaysEqTquadbinQuadbin PhysicalFunction nes-physical-operators AlwaysEqTquadbinQuadbinPhysicalFunction.cpp) +add_plugin(AlwaysNeTquadbinQuadbin PhysicalFunction nes-physical-operators AlwaysNeTquadbinQuadbinPhysicalFunction.cpp) +add_plugin(EverEqTquadbinTquadbin PhysicalFunction nes-physical-operators EverEqTquadbinTquadbinPhysicalFunction.cpp) +add_plugin(EverNeTquadbinTquadbin PhysicalFunction nes-physical-operators EverNeTquadbinTquadbinPhysicalFunction.cpp) +add_plugin(AlwaysEqTquadbinTquadbin PhysicalFunction nes-physical-operators AlwaysEqTquadbinTquadbinPhysicalFunction.cpp) +add_plugin(AlwaysNeTquadbinTquadbin PhysicalFunction nes-physical-operators AlwaysNeTquadbinTquadbinPhysicalFunction.cpp) add_plugin(GeomRelatePattern PhysicalFunction nes-physical-operators GeomRelatePatternPhysicalFunction.cpp) add_plugin(GeomIntersects2d PhysicalFunction nes-physical-operators GeomIntersects2dPhysicalFunction.cpp) add_plugin(GeomDwithin2d PhysicalFunction nes-physical-operators GeomDwithin2dPhysicalFunction.cpp) diff --git a/nes-physical-operators/src/Functions/Meos/EverEqQuadbinTquadbinPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverEqQuadbinTquadbinPhysicalFunction.cpp new file mode 100644 index 0000000000..84554490da --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverEqQuadbinTquadbinPhysicalFunction.cpp @@ -0,0 +1,71 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +EverEqQuadbinTquadbinPhysicalFunction::EverEqQuadbinTquadbinPhysicalFunction(PhysicalFunction cell, PhysicalFunction inst_cell, PhysicalFunction ts) { + paramFns.reserve(3); + paramFns.push_back(std::move(cell)); + paramFns.push_back(std::move(inst_cell)); + paramFns.push_back(std::move(ts)); +} + +VarVal EverEqQuadbinTquadbinPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { + auto cell = paramFns[0].execute(record, arena).cast(); + auto inst_cell = paramFns[1].execute(record, arena).cast(); + auto ts = paramFns[2].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](uint64_t cell, uint64_t ic, uint64_t ts) -> double { + MEOS::Meos::ensureMeosInitialized(); + TInstant* inst = tquadbininst_make((Quadbin)ic, (TimestampTz)ts); + if (!inst) return 0.0; + int r = ever_eq_quadbin_tquadbin((Quadbin)cell, (const Temporal*)inst); + free(inst); + return r > 0 ? 1.0 : 0.0; + }, + cell, inst_cell, ts); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverEqQuadbinTquadbinPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size()==3, + "EverEqQuadbinTquadbinPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + return EverEqQuadbinTquadbinPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverEqTquadbinQuadbinPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverEqTquadbinQuadbinPhysicalFunction.cpp new file mode 100644 index 0000000000..0e07768481 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverEqTquadbinQuadbinPhysicalFunction.cpp @@ -0,0 +1,71 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +EverEqTquadbinQuadbinPhysicalFunction::EverEqTquadbinQuadbinPhysicalFunction(PhysicalFunction inst_cell, PhysicalFunction ts, PhysicalFunction cell) { + paramFns.reserve(3); + paramFns.push_back(std::move(inst_cell)); + paramFns.push_back(std::move(ts)); + paramFns.push_back(std::move(cell)); +} + +VarVal EverEqTquadbinQuadbinPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { + auto inst_cell = paramFns[0].execute(record, arena).cast(); + auto ts = paramFns[1].execute(record, arena).cast(); + auto cell = paramFns[2].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](uint64_t ic, uint64_t ts, uint64_t cell) -> double { + MEOS::Meos::ensureMeosInitialized(); + TInstant* inst = tquadbininst_make((Quadbin)ic, (TimestampTz)ts); + if (!inst) return 0.0; + int r = ever_eq_tquadbin_quadbin((const Temporal*)inst, (Quadbin)cell); + free(inst); + return r > 0 ? 1.0 : 0.0; + }, + inst_cell, ts, cell); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverEqTquadbinQuadbinPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size()==3, + "EverEqTquadbinQuadbinPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + return EverEqTquadbinQuadbinPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverEqTquadbinTquadbinPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverEqTquadbinTquadbinPhysicalFunction.cpp new file mode 100644 index 0000000000..bf136d07d4 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverEqTquadbinTquadbinPhysicalFunction.cpp @@ -0,0 +1,76 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +EverEqTquadbinTquadbinPhysicalFunction::EverEqTquadbinTquadbinPhysicalFunction(PhysicalFunction cell1, PhysicalFunction ts1, PhysicalFunction cell2, PhysicalFunction ts2) { + paramFns.reserve(4); + paramFns.push_back(std::move(cell1)); + paramFns.push_back(std::move(ts1)); + paramFns.push_back(std::move(cell2)); + paramFns.push_back(std::move(ts2)); +} + +VarVal EverEqTquadbinTquadbinPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { + auto cell1 = paramFns[0].execute(record, arena).cast(); + auto ts1 = paramFns[1].execute(record, arena).cast(); + auto cell2 = paramFns[2].execute(record, arena).cast(); + auto ts2 = paramFns[3].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](uint64_t c1, uint64_t t1, uint64_t c2, uint64_t t2) -> double { + MEOS::Meos::ensureMeosInitialized(); + TInstant* i1 = tquadbininst_make((Quadbin)c1, (TimestampTz)t1); + if (!i1) return 0.0; + TInstant* i2 = tquadbininst_make((Quadbin)c2, (TimestampTz)t2); + if (!i2) { free(i1); return 0.0; } + int r = ever_eq_tquadbin_tquadbin((const Temporal*)i1, (const Temporal*)i2); + free(i1); free(i2); + return r > 0 ? 1.0 : 0.0; + }, + cell1, ts1, cell2, ts2); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverEqTquadbinTquadbinPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size()==4, + "EverEqTquadbinTquadbinPhysicalFunction requires 4 children but got {}", + arguments.childFunctions.size()); + return EverEqTquadbinTquadbinPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverNeQuadbinTquadbinPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverNeQuadbinTquadbinPhysicalFunction.cpp new file mode 100644 index 0000000000..461f4d47c9 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverNeQuadbinTquadbinPhysicalFunction.cpp @@ -0,0 +1,71 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +EverNeQuadbinTquadbinPhysicalFunction::EverNeQuadbinTquadbinPhysicalFunction(PhysicalFunction cell, PhysicalFunction inst_cell, PhysicalFunction ts) { + paramFns.reserve(3); + paramFns.push_back(std::move(cell)); + paramFns.push_back(std::move(inst_cell)); + paramFns.push_back(std::move(ts)); +} + +VarVal EverNeQuadbinTquadbinPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { + auto cell = paramFns[0].execute(record, arena).cast(); + auto inst_cell = paramFns[1].execute(record, arena).cast(); + auto ts = paramFns[2].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](uint64_t cell, uint64_t ic, uint64_t ts) -> double { + MEOS::Meos::ensureMeosInitialized(); + TInstant* inst = tquadbininst_make((Quadbin)ic, (TimestampTz)ts); + if (!inst) return 0.0; + int r = ever_ne_quadbin_tquadbin((Quadbin)cell, (const Temporal*)inst); + free(inst); + return r > 0 ? 1.0 : 0.0; + }, + cell, inst_cell, ts); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverNeQuadbinTquadbinPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size()==3, + "EverNeQuadbinTquadbinPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + return EverNeQuadbinTquadbinPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverNeTquadbinQuadbinPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverNeTquadbinQuadbinPhysicalFunction.cpp new file mode 100644 index 0000000000..4c2955b1a3 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverNeTquadbinQuadbinPhysicalFunction.cpp @@ -0,0 +1,71 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +EverNeTquadbinQuadbinPhysicalFunction::EverNeTquadbinQuadbinPhysicalFunction(PhysicalFunction inst_cell, PhysicalFunction ts, PhysicalFunction cell) { + paramFns.reserve(3); + paramFns.push_back(std::move(inst_cell)); + paramFns.push_back(std::move(ts)); + paramFns.push_back(std::move(cell)); +} + +VarVal EverNeTquadbinQuadbinPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { + auto inst_cell = paramFns[0].execute(record, arena).cast(); + auto ts = paramFns[1].execute(record, arena).cast(); + auto cell = paramFns[2].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](uint64_t ic, uint64_t ts, uint64_t cell) -> double { + MEOS::Meos::ensureMeosInitialized(); + TInstant* inst = tquadbininst_make((Quadbin)ic, (TimestampTz)ts); + if (!inst) return 0.0; + int r = ever_ne_tquadbin_quadbin((const Temporal*)inst, (Quadbin)cell); + free(inst); + return r > 0 ? 1.0 : 0.0; + }, + inst_cell, ts, cell); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverNeTquadbinQuadbinPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size()==3, + "EverNeTquadbinQuadbinPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + return EverNeTquadbinQuadbinPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverNeTquadbinTquadbinPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverNeTquadbinTquadbinPhysicalFunction.cpp new file mode 100644 index 0000000000..085912b422 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EverNeTquadbinTquadbinPhysicalFunction.cpp @@ -0,0 +1,76 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +EverNeTquadbinTquadbinPhysicalFunction::EverNeTquadbinTquadbinPhysicalFunction(PhysicalFunction cell1, PhysicalFunction ts1, PhysicalFunction cell2, PhysicalFunction ts2) { + paramFns.reserve(4); + paramFns.push_back(std::move(cell1)); + paramFns.push_back(std::move(ts1)); + paramFns.push_back(std::move(cell2)); + paramFns.push_back(std::move(ts2)); +} + +VarVal EverNeTquadbinTquadbinPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { + auto cell1 = paramFns[0].execute(record, arena).cast(); + auto ts1 = paramFns[1].execute(record, arena).cast(); + auto cell2 = paramFns[2].execute(record, arena).cast(); + auto ts2 = paramFns[3].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](uint64_t c1, uint64_t t1, uint64_t c2, uint64_t t2) -> double { + MEOS::Meos::ensureMeosInitialized(); + TInstant* i1 = tquadbininst_make((Quadbin)c1, (TimestampTz)t1); + if (!i1) return 0.0; + TInstant* i2 = tquadbininst_make((Quadbin)c2, (TimestampTz)t2); + if (!i2) { free(i1); return 0.0; } + int r = ever_ne_tquadbin_tquadbin((const Temporal*)i1, (const Temporal*)i2); + free(i1); free(i2); + return r > 0 ? 1.0 : 0.0; + }, + cell1, ts1, cell2, ts2); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverNeTquadbinTquadbinPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size()==4, + "EverNeTquadbinTquadbinPhysicalFunction requires 4 children but got {}", + arguments.childFunctions.size()); + return EverNeTquadbinTquadbinPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3])); +} + +} // namespace NES diff --git a/nes-sql-parser/AntlrSQL.g4 b/nes-sql-parser/AntlrSQL.g4 index e12ce08fd5..bb55433a5c 100644 --- a/nes-sql-parser/AntlrSQL.g4 +++ b/nes-sql-parser/AntlrSQL.g4 @@ -295,7 +295,7 @@ timeUnit: MS timestampParameter: name=identifier; -functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT | TGE_TTEXT_TEXT | TGE_TEXT_TTEXT | TGT_TTEXT_TEXT | TGT_TEXT_TTEXT | TLE_TTEXT_TEXT | TLE_TEXT_TTEXT | TLT_TTEXT_TEXT | TLT_TEXT_TTEXT | TTEXT_UPPER | TTEXT_LOWER | TTEXT_INITCAP | TEXTCAT_TTEXT_TEXT | TEXTCAT_TEXT_TTEXT | TEXTCAT_TTEXT_TTEXT | GEOM_LENGTH | GEOM_PERIMETER | GEOM_AZIMUTH | GEOG_AREA | GEOG_LENGTH | GEOG_PERIMETER | GEOM_IS_EMPTY | AINTERSECTS_TGEO_GEO | ACOVERS_TGEO_GEO | ADISJOINT_TGEO_GEO | ADWITHIN_TGEO_GEO | EINTERSECTS_TGEO_GEO | ETOUCHES_TGEO_GEO | ECONTAINS_TGEO_GEO | ACONTAINS_TGEO_GEO | ATOUCHES_TGEO_GEO | GEO_NUM_POINTS | GEO_NUM_GEOS | GEO_SRID | GEO_IS_UNITARY | GEO_EQUALS | GEO_SAME | GEOG_DISTANCE | NAD_TGEO_GEO | EVER_EQ_TGEO_GEO | EVER_NE_TGEO_GEO | ALWAYS_EQ_TGEO_GEO | ALWAYS_NE_TGEO_GEO | GEOG_INTERSECTS | GEOG_DWITHIN | ACOVERS_GEO_TGEO | GEOM_INTERSECTS | GEOM_DWITHIN | H3_GS_POINT_TO_CELL | EVER_EQ_TH3INDEX_H3INDEX | EVER_NE_TH3INDEX_H3INDEX | ALWAYS_EQ_TH3INDEX_H3INDEX | ALWAYS_NE_TH3INDEX_H3INDEX | TH3INDEX_GET_RESOLUTION | TH3INDEX_GET_BASE_CELL_NUMBER | TH3INDEX_IS_VALID_CELL | TH3INDEX_IS_PENTAGON | TH3INDEX_CELL_TO_PARENT_NEXT | TH3INDEX_CELL_TO_CENTER_CHILD_NEXT | TH3INDEX_CELL_TO_PARENT | TH3INDEX_CELL_TO_CENTER_CHILD | TH3INDEX_CELL_TO_CHILD_POS | TH3INDEX_ARE_NEIGHBOR_CELLS | TH3INDEX_GRID_DISTANCE | EINTERSECTS_TCBUFFER_GEO | AINTERSECTS_TCBUFFER_GEO | ECOVERS_TCBUFFER_GEO | ACOVERS_TCBUFFER_GEO | EDISJOINT_TCBUFFER_GEO | ADISJOINT_TCBUFFER_GEO | ETOUCHES_TCBUFFER_GEO | ATOUCHES_TCBUFFER_GEO | ECONTAINS_TCBUFFER_GEO | ACONTAINS_TCBUFFER_GEO | NAD_TCBUFFER_GEO | EDWITHIN_TCBUFFER_GEO | ADWITHIN_TCBUFFER_GEO | EINTERSECTS_TCBUFFER_CBUFFER | AINTERSECTS_TCBUFFER_CBUFFER | ECOVERS_TCBUFFER_CBUFFER | ACOVERS_TCBUFFER_CBUFFER | EDISJOINT_TCBUFFER_CBUFFER | ADISJOINT_TCBUFFER_CBUFFER | ETOUCHES_TCBUFFER_CBUFFER | ATOUCHES_TCBUFFER_CBUFFER | ECONTAINS_TCBUFFER_CBUFFER | ACONTAINS_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_CBUFFER | ALWAYS_EQ_TCBUFFER_CBUFFER | EVER_NE_TCBUFFER_CBUFFER | ALWAYS_NE_TCBUFFER_CBUFFER | NAD_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_TCBUFFER | ALWAYS_EQ_TCBUFFER_TCBUFFER | EVER_NE_TCBUFFER_TCBUFFER | ALWAYS_NE_TCBUFFER_TCBUFFER | EINTERSECTS_TCBUFFER_TCBUFFER | AINTERSECTS_TCBUFFER_TCBUFFER | ECOVERS_TCBUFFER_TCBUFFER | ACOVERS_TCBUFFER_TCBUFFER | ADISJOINT_TCBUFFER_TCBUFFER | ETOUCHES_TCBUFFER_TCBUFFER | ATOUCHES_TCBUFFER_TCBUFFER | NAD_TCBUFFER_TCBUFFER | EDWITHIN_TCBUFFER_TCBUFFER | ADWITHIN_TCBUFFER_TCBUFFER | MINDISTANCE_TCBUFFER_TCBUFFER | NAD_TNPOINT_GEO | EVER_EQ_TNPOINT_NPOINT | ALWAYS_EQ_TNPOINT_NPOINT | EVER_NE_TNPOINT_NPOINT | ALWAYS_NE_TNPOINT_NPOINT | NAD_TNPOINT_NPOINT | EVER_EQ_NPOINT_TNPOINT | ALWAYS_EQ_NPOINT_TNPOINT | EVER_NE_NPOINT_TNPOINT | ALWAYS_NE_NPOINT_TNPOINT | EVER_EQ_TNPOINT_TNPOINT | ALWAYS_EQ_TNPOINT_TNPOINT | EVER_NE_TNPOINT_TNPOINT | ALWAYS_NE_TNPOINT_TNPOINT | NAD_TNPOINT_TNPOINT | NAD_TPOSE_GEO | EVER_EQ_TPOSE_POSE | ALWAYS_EQ_TPOSE_POSE | EVER_NE_TPOSE_POSE | ALWAYS_NE_TPOSE_POSE | NAD_TPOSE_POSE | EVER_EQ_POSE_TPOSE | ALWAYS_EQ_POSE_TPOSE | EVER_NE_POSE_TPOSE | ALWAYS_NE_POSE_TPOSE | EVER_EQ_TPOSE_TPOSE | ALWAYS_EQ_TPOSE_TPOSE | EVER_NE_TPOSE_TPOSE | ALWAYS_NE_TPOSE_TPOSE | NAD_TPOSE_TPOSE | EVER_EQ_TRGEOMETRY_GEO | ALWAYS_EQ_TRGEOMETRY_GEO | EVER_NE_TRGEOMETRY_GEO | ALWAYS_NE_TRGEOMETRY_GEO | NAD_TRGEOMETRY_GEO | EVER_EQ_GEO_TRGEOMETRY | ALWAYS_EQ_GEO_TRGEOMETRY | EVER_NE_GEO_TRGEOMETRY | ALWAYS_NE_GEO_TRGEOMETRY | EVER_EQ_TRGEOMETRY_TRGEOMETRY | ALWAYS_EQ_TRGEOMETRY_TRGEOMETRY | EVER_NE_TRGEOMETRY_TRGEOMETRY | ALWAYS_NE_TRGEOMETRY_TRGEOMETRY | NAD_TRGEOMETRY_TRGEOMETRY | EINTERSECTS_TPCPOINT_GEO | NAD_TPCPOINT_GEO | QUADBIN_POINT_TO_CELL | QUADBIN_IS_VALID_CELL | QUADBIN_GET_RESOLUTION | QUADBIN_CELL_AREA | QUADBIN_CELL_TO_QUADKEY | QUADBIN_CELL_TO_PARENT | QUADBIN_TILE_TO_CELL | EVER_EQ_TJSONB_JSONB | ALWAYS_EQ_TJSONB_JSONB | EVER_NE_TJSONB_JSONB | ALWAYS_NE_TJSONB_JSONB | EVER_EQ_TJSONB_TJSONB | ALWAYS_EQ_TJSONB_TJSONB | EVER_NE_TJSONB_TJSONB | ALWAYS_NE_TJSONB_TJSONB | GEOM_BOUNDARY | GEOM_CENTROID | GEOM_CONVEX_HULL | GEO_REVERSE | GEO_POINTS | GEOM_UNARY_UNION | GEOM_DIFFERENCE2D | GEOM_INTERSECTION2D | GEOM_SHORTESTLINE2D | GEOM_SHORTESTLINE3D | GEO_SET_SRID | GEO_TRANSFORM | GEO_ROUND | GEOM_BUFFER | LINE_NUMPOINTS | LINE_LOCATE_POINT | LINE_INTERPOLATE_POINT | LINE_SUBSTRING | GEOM_POINT_MAKE2D | GEOM_POINT_MAKE3DZ | GEOG_POINT_MAKE2D | GEOG_POINT_MAKE3DZ | GEOM_TO_GEOG | GEOG_TO_GEOM | GEOG_CENTROID | GEO_GEO_N | LINE_POINT_N | GEOM_INTERSECTION2D_COLL | GEO_AS_GEOJSON | GEO_AS_HEXEWKB | GEO_AS_EWKT | GEO_FROM_GEOJSON | GEOM_FROM_HEXEWKB | GEO_TRANSFORM_PIPELINE | GEOM_MIN_BOUNDING_CENTER | GEOM_MIN_BOUNDING_RADIUS | EVER_EQ_TGEO_TGEO | EVER_NE_TGEO_TGEO | ALWAYS_EQ_TGEO_TGEO | ALWAYS_NE_TGEO_TGEO | EINTERSECTS_TGEO_TGEO | ECOVERS_TGEO_TGEO | EDISJOINT_TGEO_TGEO | ECONTAINS_TGEO_TGEO | ETOUCHES_TGEO_TGEO | AINTERSECTS_TGEO_TGEO | ACOVERS_TGEO_TGEO | ADISJOINT_TGEO_TGEO | ACONTAINS_TGEO_TGEO | ATOUCHES_TGEO_TGEO | EDWITHIN_TGEO_TGEO | ADWITHIN_TGEO_TGEO | H3INDEX_EQ | H3INDEX_NE | H3INDEX_LT | H3INDEX_LE | H3INDEX_GT | H3INDEX_GE | H3INDEX_CMP | H3INDEX_OUT | H3INDEX_IN | JSON_ARRAY_LENGTH | JSON_TYPEOF | JSON_OBJECT_FIELD_TEXT | JSON_ARRAY_ELEMENT_TEXT | JSONB_ARRAY_LENGTH | JSONB_EQ | JSONB_NE | JSONB_LT | JSONB_LE | JSONB_GT | JSONB_GE | JSONB_CMP | JSONB_CONTAINS | JSONB_CONTAINED | JSONB_EXISTS | JSONB_TO_CSTRING | JSONB_PRETTY | JSONB_OBJECT_FIELD_TEXT | JSONB_ARRAY_ELEMENT_TEXT | INTSPAN_MAKE | FLOATSPAN_MAKE | INTSPAN_LOWER | INTSPAN_UPPER | INTSPAN_WIDTH | INTSPAN_LOWER_INC | INTSPAN_UPPER_INC | FLOATSPAN_LOWER | FLOATSPAN_UPPER | FLOATSPAN_WIDTH | FLOATSPAN_LOWER_INC | FLOATSPAN_UPPER_INC | CONTAINED_INT_SPAN | CONTAINED_FLOAT_SPAN | CONTAINS_SPAN_INT | CONTAINS_SPAN_FLOAT | CONTAINED_SPAN_SPAN | CONTAINS_SPAN_SPAN | CONTAINED_FLOATSPAN_SPAN | CONTAINS_FLOATSPAN_SPAN | TEXT_UPPER | TEXT_LOWER | TEXT_INITCAP | QUADBIN_EQ | QUADBIN_NE | QUADBIN_LT | QUADBIN_LE | QUADBIN_GT | QUADBIN_GE | QUADBIN_CMP | GEOM_RELATE_PATTERN | GEOM_INTERSECTS2D | GEOM_DWITHIN2D | GEOM_CONTAINS | GEOM_DISJOINT2D | GEOM_COVERS | GEOM_TOUCHES | GEOM_INTERSECTS3D | GEOM_DWITHIN3D | GEOM_DISTANCE2D | GEOM_DISTANCE3D; +functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT | TGE_TTEXT_TEXT | TGE_TEXT_TTEXT | TGT_TTEXT_TEXT | TGT_TEXT_TTEXT | TLE_TTEXT_TEXT | TLE_TEXT_TTEXT | TLT_TTEXT_TEXT | TLT_TEXT_TTEXT | TTEXT_UPPER | TTEXT_LOWER | TTEXT_INITCAP | TEXTCAT_TTEXT_TEXT | TEXTCAT_TEXT_TTEXT | TEXTCAT_TTEXT_TTEXT | GEOM_LENGTH | GEOM_PERIMETER | GEOM_AZIMUTH | GEOG_AREA | GEOG_LENGTH | GEOG_PERIMETER | GEOM_IS_EMPTY | AINTERSECTS_TGEO_GEO | ACOVERS_TGEO_GEO | ADISJOINT_TGEO_GEO | ADWITHIN_TGEO_GEO | EINTERSECTS_TGEO_GEO | ETOUCHES_TGEO_GEO | ECONTAINS_TGEO_GEO | ACONTAINS_TGEO_GEO | ATOUCHES_TGEO_GEO | GEO_NUM_POINTS | GEO_NUM_GEOS | GEO_SRID | GEO_IS_UNITARY | GEO_EQUALS | GEO_SAME | GEOG_DISTANCE | NAD_TGEO_GEO | EVER_EQ_TGEO_GEO | EVER_NE_TGEO_GEO | ALWAYS_EQ_TGEO_GEO | ALWAYS_NE_TGEO_GEO | GEOG_INTERSECTS | GEOG_DWITHIN | ACOVERS_GEO_TGEO | GEOM_INTERSECTS | GEOM_DWITHIN | H3_GS_POINT_TO_CELL | EVER_EQ_TH3INDEX_H3INDEX | EVER_NE_TH3INDEX_H3INDEX | ALWAYS_EQ_TH3INDEX_H3INDEX | ALWAYS_NE_TH3INDEX_H3INDEX | TH3INDEX_GET_RESOLUTION | TH3INDEX_GET_BASE_CELL_NUMBER | TH3INDEX_IS_VALID_CELL | TH3INDEX_IS_PENTAGON | TH3INDEX_CELL_TO_PARENT_NEXT | TH3INDEX_CELL_TO_CENTER_CHILD_NEXT | TH3INDEX_CELL_TO_PARENT | TH3INDEX_CELL_TO_CENTER_CHILD | TH3INDEX_CELL_TO_CHILD_POS | TH3INDEX_ARE_NEIGHBOR_CELLS | TH3INDEX_GRID_DISTANCE | EINTERSECTS_TCBUFFER_GEO | AINTERSECTS_TCBUFFER_GEO | ECOVERS_TCBUFFER_GEO | ACOVERS_TCBUFFER_GEO | EDISJOINT_TCBUFFER_GEO | ADISJOINT_TCBUFFER_GEO | ETOUCHES_TCBUFFER_GEO | ATOUCHES_TCBUFFER_GEO | ECONTAINS_TCBUFFER_GEO | ACONTAINS_TCBUFFER_GEO | NAD_TCBUFFER_GEO | EDWITHIN_TCBUFFER_GEO | ADWITHIN_TCBUFFER_GEO | EINTERSECTS_TCBUFFER_CBUFFER | AINTERSECTS_TCBUFFER_CBUFFER | ECOVERS_TCBUFFER_CBUFFER | ACOVERS_TCBUFFER_CBUFFER | EDISJOINT_TCBUFFER_CBUFFER | ADISJOINT_TCBUFFER_CBUFFER | ETOUCHES_TCBUFFER_CBUFFER | ATOUCHES_TCBUFFER_CBUFFER | ECONTAINS_TCBUFFER_CBUFFER | ACONTAINS_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_CBUFFER | ALWAYS_EQ_TCBUFFER_CBUFFER | EVER_NE_TCBUFFER_CBUFFER | ALWAYS_NE_TCBUFFER_CBUFFER | NAD_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_TCBUFFER | ALWAYS_EQ_TCBUFFER_TCBUFFER | EVER_NE_TCBUFFER_TCBUFFER | ALWAYS_NE_TCBUFFER_TCBUFFER | EINTERSECTS_TCBUFFER_TCBUFFER | AINTERSECTS_TCBUFFER_TCBUFFER | ECOVERS_TCBUFFER_TCBUFFER | ACOVERS_TCBUFFER_TCBUFFER | ADISJOINT_TCBUFFER_TCBUFFER | ETOUCHES_TCBUFFER_TCBUFFER | ATOUCHES_TCBUFFER_TCBUFFER | NAD_TCBUFFER_TCBUFFER | EDWITHIN_TCBUFFER_TCBUFFER | ADWITHIN_TCBUFFER_TCBUFFER | MINDISTANCE_TCBUFFER_TCBUFFER | NAD_TNPOINT_GEO | EVER_EQ_TNPOINT_NPOINT | ALWAYS_EQ_TNPOINT_NPOINT | EVER_NE_TNPOINT_NPOINT | ALWAYS_NE_TNPOINT_NPOINT | NAD_TNPOINT_NPOINT | EVER_EQ_NPOINT_TNPOINT | ALWAYS_EQ_NPOINT_TNPOINT | EVER_NE_NPOINT_TNPOINT | ALWAYS_NE_NPOINT_TNPOINT | EVER_EQ_TNPOINT_TNPOINT | ALWAYS_EQ_TNPOINT_TNPOINT | EVER_NE_TNPOINT_TNPOINT | ALWAYS_NE_TNPOINT_TNPOINT | NAD_TNPOINT_TNPOINT | NAD_TPOSE_GEO | EVER_EQ_TPOSE_POSE | ALWAYS_EQ_TPOSE_POSE | EVER_NE_TPOSE_POSE | ALWAYS_NE_TPOSE_POSE | NAD_TPOSE_POSE | EVER_EQ_POSE_TPOSE | ALWAYS_EQ_POSE_TPOSE | EVER_NE_POSE_TPOSE | ALWAYS_NE_POSE_TPOSE | EVER_EQ_TPOSE_TPOSE | ALWAYS_EQ_TPOSE_TPOSE | EVER_NE_TPOSE_TPOSE | ALWAYS_NE_TPOSE_TPOSE | NAD_TPOSE_TPOSE | EVER_EQ_TRGEOMETRY_GEO | ALWAYS_EQ_TRGEOMETRY_GEO | EVER_NE_TRGEOMETRY_GEO | ALWAYS_NE_TRGEOMETRY_GEO | NAD_TRGEOMETRY_GEO | EVER_EQ_GEO_TRGEOMETRY | ALWAYS_EQ_GEO_TRGEOMETRY | EVER_NE_GEO_TRGEOMETRY | ALWAYS_NE_GEO_TRGEOMETRY | EVER_EQ_TRGEOMETRY_TRGEOMETRY | ALWAYS_EQ_TRGEOMETRY_TRGEOMETRY | EVER_NE_TRGEOMETRY_TRGEOMETRY | ALWAYS_NE_TRGEOMETRY_TRGEOMETRY | NAD_TRGEOMETRY_TRGEOMETRY | EINTERSECTS_TPCPOINT_GEO | NAD_TPCPOINT_GEO | QUADBIN_POINT_TO_CELL | QUADBIN_IS_VALID_CELL | QUADBIN_GET_RESOLUTION | QUADBIN_CELL_AREA | QUADBIN_CELL_TO_QUADKEY | QUADBIN_CELL_TO_PARENT | QUADBIN_TILE_TO_CELL | EVER_EQ_TJSONB_JSONB | ALWAYS_EQ_TJSONB_JSONB | EVER_NE_TJSONB_JSONB | ALWAYS_NE_TJSONB_JSONB | EVER_EQ_TJSONB_TJSONB | ALWAYS_EQ_TJSONB_TJSONB | EVER_NE_TJSONB_TJSONB | ALWAYS_NE_TJSONB_TJSONB | GEOM_BOUNDARY | GEOM_CENTROID | GEOM_CONVEX_HULL | GEO_REVERSE | GEO_POINTS | GEOM_UNARY_UNION | GEOM_DIFFERENCE2D | GEOM_INTERSECTION2D | GEOM_SHORTESTLINE2D | GEOM_SHORTESTLINE3D | GEO_SET_SRID | GEO_TRANSFORM | GEO_ROUND | GEOM_BUFFER | LINE_NUMPOINTS | LINE_LOCATE_POINT | LINE_INTERPOLATE_POINT | LINE_SUBSTRING | GEOM_POINT_MAKE2D | GEOM_POINT_MAKE3DZ | GEOG_POINT_MAKE2D | GEOG_POINT_MAKE3DZ | GEOM_TO_GEOG | GEOG_TO_GEOM | GEOG_CENTROID | GEO_GEO_N | LINE_POINT_N | GEOM_INTERSECTION2D_COLL | GEO_AS_GEOJSON | GEO_AS_HEXEWKB | GEO_AS_EWKT | GEO_FROM_GEOJSON | GEOM_FROM_HEXEWKB | GEO_TRANSFORM_PIPELINE | GEOM_MIN_BOUNDING_CENTER | GEOM_MIN_BOUNDING_RADIUS | EVER_EQ_TGEO_TGEO | EVER_NE_TGEO_TGEO | ALWAYS_EQ_TGEO_TGEO | ALWAYS_NE_TGEO_TGEO | EINTERSECTS_TGEO_TGEO | ECOVERS_TGEO_TGEO | EDISJOINT_TGEO_TGEO | ECONTAINS_TGEO_TGEO | ETOUCHES_TGEO_TGEO | AINTERSECTS_TGEO_TGEO | ACOVERS_TGEO_TGEO | ADISJOINT_TGEO_TGEO | ACONTAINS_TGEO_TGEO | ATOUCHES_TGEO_TGEO | EDWITHIN_TGEO_TGEO | ADWITHIN_TGEO_TGEO | H3INDEX_EQ | H3INDEX_NE | H3INDEX_LT | H3INDEX_LE | H3INDEX_GT | H3INDEX_GE | H3INDEX_CMP | H3INDEX_OUT | H3INDEX_IN | JSON_ARRAY_LENGTH | JSON_TYPEOF | JSON_OBJECT_FIELD_TEXT | JSON_ARRAY_ELEMENT_TEXT | JSONB_ARRAY_LENGTH | JSONB_EQ | JSONB_NE | JSONB_LT | JSONB_LE | JSONB_GT | JSONB_GE | JSONB_CMP | JSONB_CONTAINS | JSONB_CONTAINED | JSONB_EXISTS | JSONB_TO_CSTRING | JSONB_PRETTY | JSONB_OBJECT_FIELD_TEXT | JSONB_ARRAY_ELEMENT_TEXT | INTSPAN_MAKE | FLOATSPAN_MAKE | INTSPAN_LOWER | INTSPAN_UPPER | INTSPAN_WIDTH | INTSPAN_LOWER_INC | INTSPAN_UPPER_INC | FLOATSPAN_LOWER | FLOATSPAN_UPPER | FLOATSPAN_WIDTH | FLOATSPAN_LOWER_INC | FLOATSPAN_UPPER_INC | CONTAINED_INT_SPAN | CONTAINED_FLOAT_SPAN | CONTAINS_SPAN_INT | CONTAINS_SPAN_FLOAT | CONTAINED_SPAN_SPAN | CONTAINS_SPAN_SPAN | CONTAINED_FLOATSPAN_SPAN | CONTAINS_FLOATSPAN_SPAN | TEXT_UPPER | TEXT_LOWER | TEXT_INITCAP | QUADBIN_EQ | QUADBIN_NE | QUADBIN_LT | QUADBIN_LE | QUADBIN_GT | QUADBIN_GE | QUADBIN_CMP | EVER_EQ_QUADBIN_TQUADBIN | EVER_NE_QUADBIN_TQUADBIN | ALWAYS_EQ_QUADBIN_TQUADBIN | ALWAYS_NE_QUADBIN_TQUADBIN | EVER_EQ_TQUADBIN_QUADBIN | EVER_NE_TQUADBIN_QUADBIN | ALWAYS_EQ_TQUADBIN_QUADBIN | ALWAYS_NE_TQUADBIN_QUADBIN | EVER_EQ_TQUADBIN_TQUADBIN | EVER_NE_TQUADBIN_TQUADBIN | ALWAYS_EQ_TQUADBIN_TQUADBIN | ALWAYS_NE_TQUADBIN_TQUADBIN | GEOM_RELATE_PATTERN | GEOM_INTERSECTS2D | GEOM_DWITHIN2D | GEOM_CONTAINS | GEOM_DISJOINT2D | GEOM_COVERS | GEOM_TOUCHES | GEOM_INTERSECTS3D | GEOM_DWITHIN3D | GEOM_DISTANCE2D | GEOM_DISTANCE3D; sinkClause: INTO sink (',' sink)*; @@ -1021,6 +1021,18 @@ QUADBIN_LE: 'QUADBIN_LE' | 'quadbin_le'; QUADBIN_GT: 'QUADBIN_GT' | 'quadbin_gt'; QUADBIN_GE: 'QUADBIN_GE' | 'quadbin_ge'; QUADBIN_CMP: 'QUADBIN_CMP' | 'quadbin_cmp'; +EVER_EQ_QUADBIN_TQUADBIN: 'EVER_EQ_QUADBIN_TQUADBIN' | 'ever_eq_quadbin_tquadbin'; +EVER_NE_QUADBIN_TQUADBIN: 'EVER_NE_QUADBIN_TQUADBIN' | 'ever_ne_quadbin_tquadbin'; +ALWAYS_EQ_QUADBIN_TQUADBIN: 'ALWAYS_EQ_QUADBIN_TQUADBIN' | 'always_eq_quadbin_tquadbin'; +ALWAYS_NE_QUADBIN_TQUADBIN: 'ALWAYS_NE_QUADBIN_TQUADBIN' | 'always_ne_quadbin_tquadbin'; +EVER_EQ_TQUADBIN_QUADBIN: 'EVER_EQ_TQUADBIN_QUADBIN' | 'ever_eq_tquadbin_quadbin'; +EVER_NE_TQUADBIN_QUADBIN: 'EVER_NE_TQUADBIN_QUADBIN' | 'ever_ne_tquadbin_quadbin'; +ALWAYS_EQ_TQUADBIN_QUADBIN: 'ALWAYS_EQ_TQUADBIN_QUADBIN' | 'always_eq_tquadbin_quadbin'; +ALWAYS_NE_TQUADBIN_QUADBIN: 'ALWAYS_NE_TQUADBIN_QUADBIN' | 'always_ne_tquadbin_quadbin'; +EVER_EQ_TQUADBIN_TQUADBIN: 'EVER_EQ_TQUADBIN_TQUADBIN' | 'ever_eq_tquadbin_tquadbin'; +EVER_NE_TQUADBIN_TQUADBIN: 'EVER_NE_TQUADBIN_TQUADBIN' | 'ever_ne_tquadbin_tquadbin'; +ALWAYS_EQ_TQUADBIN_TQUADBIN: 'ALWAYS_EQ_TQUADBIN_TQUADBIN' | 'always_eq_tquadbin_tquadbin'; +ALWAYS_NE_TQUADBIN_TQUADBIN: 'ALWAYS_NE_TQUADBIN_TQUADBIN' | 'always_ne_tquadbin_tquadbin'; GEOM_RELATE_PATTERN: 'GEOM_RELATE_PATTERN' | 'geom_relate_pattern'; GEOM_INTERSECTS2D: 'GEOM_INTERSECTS2D' | 'geom_intersects2d'; GEOM_DWITHIN2D: 'GEOM_DWITHIN2D' | 'geom_dwithin2d'; diff --git a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp index cd313a5a47..93f08c119f 100644 --- a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp +++ b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp @@ -602,6 +602,18 @@ #include #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include @@ -11917,6 +11929,130 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont return LogicalFunction(QuadbinCmpLogicalFunction(std::move(arg0), std::move(arg1))); } /* END CODEGEN PARSER GLUE: QUADBIN_CMP */ + case AntlrSQLParser::EVER_EQ_QUADBIN_TQUADBIN: { + PRECONDITION(ctx->functionParam().size() == 3, + "EverEqQuadbinTquadbin requires 3 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + return LogicalFunction(EverEqQuadbinTquadbinLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2))); + } + /* END CODEGEN PARSER GLUE: EVER_EQ_QUADBIN_TQUADBIN */ + case AntlrSQLParser::EVER_NE_QUADBIN_TQUADBIN: { + PRECONDITION(ctx->functionParam().size() == 3, + "EverNeQuadbinTquadbin requires 3 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + return LogicalFunction(EverNeQuadbinTquadbinLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2))); + } + /* END CODEGEN PARSER GLUE: EVER_NE_QUADBIN_TQUADBIN */ + case AntlrSQLParser::ALWAYS_EQ_QUADBIN_TQUADBIN: { + PRECONDITION(ctx->functionParam().size() == 3, + "AlwaysEqQuadbinTquadbin requires 3 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + return LogicalFunction(AlwaysEqQuadbinTquadbinLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2))); + } + /* END CODEGEN PARSER GLUE: ALWAYS_EQ_QUADBIN_TQUADBIN */ + case AntlrSQLParser::ALWAYS_NE_QUADBIN_TQUADBIN: { + PRECONDITION(ctx->functionParam().size() == 3, + "AlwaysNeQuadbinTquadbin requires 3 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + return LogicalFunction(AlwaysNeQuadbinTquadbinLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2))); + } + /* END CODEGEN PARSER GLUE: ALWAYS_NE_QUADBIN_TQUADBIN */ + case AntlrSQLParser::EVER_EQ_TQUADBIN_QUADBIN: { + PRECONDITION(ctx->functionParam().size() == 3, + "EverEqTquadbinQuadbin requires 3 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + return LogicalFunction(EverEqTquadbinQuadbinLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2))); + } + /* END CODEGEN PARSER GLUE: EVER_EQ_TQUADBIN_QUADBIN */ + case AntlrSQLParser::EVER_NE_TQUADBIN_QUADBIN: { + PRECONDITION(ctx->functionParam().size() == 3, + "EverNeTquadbinQuadbin requires 3 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + return LogicalFunction(EverNeTquadbinQuadbinLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2))); + } + /* END CODEGEN PARSER GLUE: EVER_NE_TQUADBIN_QUADBIN */ + case AntlrSQLParser::ALWAYS_EQ_TQUADBIN_QUADBIN: { + PRECONDITION(ctx->functionParam().size() == 3, + "AlwaysEqTquadbinQuadbin requires 3 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + return LogicalFunction(AlwaysEqTquadbinQuadbinLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2))); + } + /* END CODEGEN PARSER GLUE: ALWAYS_EQ_TQUADBIN_QUADBIN */ + case AntlrSQLParser::ALWAYS_NE_TQUADBIN_QUADBIN: { + PRECONDITION(ctx->functionParam().size() == 3, + "AlwaysNeTquadbinQuadbin requires 3 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + return LogicalFunction(AlwaysNeTquadbinQuadbinLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2))); + } + /* END CODEGEN PARSER GLUE: ALWAYS_NE_TQUADBIN_QUADBIN */ + case AntlrSQLParser::EVER_EQ_TQUADBIN_TQUADBIN: { + PRECONDITION(ctx->functionParam().size() == 4, + "EverEqTquadbinTquadbin requires 4 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + return LogicalFunction(EverEqTquadbinTquadbinLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3))); + } + /* END CODEGEN PARSER GLUE: EVER_EQ_TQUADBIN_TQUADBIN */ + case AntlrSQLParser::EVER_NE_TQUADBIN_TQUADBIN: { + PRECONDITION(ctx->functionParam().size() == 4, + "EverNeTquadbinTquadbin requires 4 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + return LogicalFunction(EverNeTquadbinTquadbinLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3))); + } + /* END CODEGEN PARSER GLUE: EVER_NE_TQUADBIN_TQUADBIN */ + case AntlrSQLParser::ALWAYS_EQ_TQUADBIN_TQUADBIN: { + PRECONDITION(ctx->functionParam().size() == 4, + "AlwaysEqTquadbinTquadbin requires 4 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + return LogicalFunction(AlwaysEqTquadbinTquadbinLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3))); + } + /* END CODEGEN PARSER GLUE: ALWAYS_EQ_TQUADBIN_TQUADBIN */ + case AntlrSQLParser::ALWAYS_NE_TQUADBIN_TQUADBIN: { + PRECONDITION(ctx->functionParam().size() == 4, + "AlwaysNeTquadbinTquadbin requires 4 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + return LogicalFunction(AlwaysNeTquadbinTquadbinLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3))); + } + /* END CODEGEN PARSER GLUE: ALWAYS_NE_TQUADBIN_TQUADBIN */ /* END CODEGEN PARSER GLUE: GEOM_RELATE_PATTERN */ /* END CODEGEN PARSER GLUE: GEOM_INTERSECTS2D */ case AntlrSQLParser::GEOM_DWITHIN2D: { From e7868d936b22de22ccc665dec1d0bec09aa8493e Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Thu, 2 Jul 2026 13:03:45 +0200 Subject: [PATCH 96/96] verify(codegen): one-command full regeneration of the per-event surface from the master IDL gen_all.py drives codegen_nebula.py across all 7 family descriptors (tfloat-transforms, numeric, spatial-predicates, spatial-phasec-full, phasec-rest, trgeo, phasec-composed) in a single invocation, regenerating 467 per-event scalar operators into the 4-file-per-op logical+physical C++ surface with idempotent CMake/grammar/QPC glue injection. All descriptors and the canonical codegen_nebula.py are committed under tools/codegen/ so the surface is fully reproducible from this repository. --- .../AcontainsGeoTrgeometryLogicalFunction.hpp | 45 + .../AcontainsTcbufferGeoLogicalFunction.hpp | 14 +- ...ontainsTcbufferTcbufferLogicalFunction.hpp | 59 + .../Meos/AcontainsTgeoGeoLogicalFunction.hpp | 12 +- .../Meos/AcontainsTgeoTgeoLogicalFunction.hpp | 13 +- .../AcoversGeoTrgeometryLogicalFunction.hpp | 45 + .../AcoversTcbufferGeoLogicalFunction.hpp | 14 +- ...AcoversTcbufferTcbufferLogicalFunction.hpp | 19 +- .../Meos/AcoversTgeoGeoLogicalFunction.hpp | 12 +- .../Meos/AcoversTgeoTgeoLogicalFunction.hpp | 13 +- .../AcoversTrgeometryGeoLogicalFunction.hpp | 45 + .../Meos/AddBigintTbigintLogicalFunction.hpp | 12 +- .../Meos/AddFloatTfloatLogicalFunction.hpp | 12 +- .../Meos/AddIntTintLogicalFunction.hpp | 12 +- .../Meos/AddTbigintBigintLogicalFunction.hpp | 10 +- .../Meos/AddTfloatFloatLogicalFunction.hpp | 10 +- .../Meos/AddTintIntLogicalFunction.hpp | 10 +- .../Meos/AddTnumberTnumberLogicalFunction.hpp | 11 +- .../AdisjointTcbufferGeoLogicalFunction.hpp | 14 +- ...isjointTcbufferTcbufferLogicalFunction.hpp | 19 +- .../Meos/AdisjointTgeoGeoLogicalFunction.hpp | 12 +- .../Meos/AdisjointTgeoTgeoLogicalFunction.hpp | 13 +- .../AdisjointTrgeometryGeoLogicalFunction.hpp | 45 + ...intTrgeometryTrgeometryLogicalFunction.hpp | 45 + ...AdwithinTcbufferCbufferLogicalFunction.hpp | 57 + .../AdwithinTcbufferGeoLogicalFunction.hpp | 15 +- ...dwithinTcbufferTcbufferLogicalFunction.hpp | 21 +- .../Meos/AdwithinTgeoGeoLogicalFunction.hpp | 14 +- .../Meos/AdwithinTgeoTgeoLogicalFunction.hpp | 14 +- .../AdwithinTrgeometryGeoLogicalFunction.hpp | 45 + ...hinTrgeometryTrgeometryLogicalFunction.hpp | 45 + .../AintersectsTcbufferGeoLogicalFunction.hpp | 14 +- ...ersectsTcbufferTcbufferLogicalFunction.hpp | 19 +- .../AintersectsTgeoGeoLogicalFunction.hpp | 12 +- .../AintersectsTgeoTgeoLogicalFunction.hpp | 13 +- ...intersectsTrgeometryGeoLogicalFunction.hpp | 45 + ...ctsTrgeometryTrgeometryLogicalFunction.hpp | 45 + .../AlwaysEqBigintTbigintLogicalFunction.hpp | 12 +- .../Meos/AlwaysEqBoolTboolLogicalFunction.hpp | 12 +- .../AlwaysEqNpointTnpointLogicalFunction.hpp | 12 +- .../Meos/AlwaysEqPoseTposeLogicalFunction.hpp | 14 +- .../AlwaysEqTbigintBigintLogicalFunction.hpp | 10 +- .../Meos/AlwaysEqTboolBoolLogicalFunction.hpp | 10 +- ...lwaysEqTcbufferTcbufferLogicalFunction.hpp | 19 +- .../Meos/AlwaysEqTextTtextLogicalFunction.hpp | 33 +- .../Meos/AlwaysEqTgeoGeoLogicalFunction.hpp | 12 +- .../Meos/AlwaysEqTgeoTgeoLogicalFunction.hpp | 13 +- ...AlwaysEqTh3indexH3indexLogicalFunction.hpp | 10 +- .../AlwaysEqTjsonbJsonbLogicalFunction.hpp | 10 +- .../AlwaysEqTjsonbTjsonbLogicalFunction.hpp | 11 +- .../AlwaysEqTnpointNpointLogicalFunction.hpp | 12 +- .../AlwaysEqTnpointTnpointLogicalFunction.hpp | 15 +- .../Meos/AlwaysEqTposePoseLogicalFunction.hpp | 14 +- .../AlwaysEqTposeTposeLogicalFunction.hpp | 19 +- ...AlwaysEqTquadbinQuadbinLogicalFunction.hpp | 13 +- .../Meos/AlwaysEqTtextTextLogicalFunction.hpp | 33 +- .../AlwaysGeBigintTbigintLogicalFunction.hpp | 12 +- .../AlwaysGeTbigintBigintLogicalFunction.hpp | 10 +- .../Meos/AlwaysGeTextTtextLogicalFunction.hpp | 33 +- .../Meos/AlwaysGeTtextTextLogicalFunction.hpp | 33 +- .../AlwaysGtBigintTbigintLogicalFunction.hpp | 12 +- .../AlwaysGtTbigintBigintLogicalFunction.hpp | 10 +- .../Meos/AlwaysGtTextTtextLogicalFunction.hpp | 33 +- .../Meos/AlwaysGtTtextTextLogicalFunction.hpp | 33 +- .../AlwaysLeBigintTbigintLogicalFunction.hpp | 12 +- .../AlwaysLeTbigintBigintLogicalFunction.hpp | 10 +- .../Meos/AlwaysLeTextTtextLogicalFunction.hpp | 33 +- .../Meos/AlwaysLeTtextTextLogicalFunction.hpp | 33 +- .../AlwaysLtBigintTbigintLogicalFunction.hpp | 12 +- .../AlwaysLtTbigintBigintLogicalFunction.hpp | 10 +- .../Meos/AlwaysLtTextTtextLogicalFunction.hpp | 33 +- .../Meos/AlwaysLtTtextTextLogicalFunction.hpp | 33 +- .../AlwaysNeBigintTbigintLogicalFunction.hpp | 12 +- .../Meos/AlwaysNeBoolTboolLogicalFunction.hpp | 12 +- .../AlwaysNeNpointTnpointLogicalFunction.hpp | 12 +- .../Meos/AlwaysNePoseTposeLogicalFunction.hpp | 14 +- .../AlwaysNeTbigintBigintLogicalFunction.hpp | 10 +- .../Meos/AlwaysNeTboolBoolLogicalFunction.hpp | 10 +- ...lwaysNeTcbufferTcbufferLogicalFunction.hpp | 19 +- .../Meos/AlwaysNeTextTtextLogicalFunction.hpp | 33 +- .../Meos/AlwaysNeTgeoGeoLogicalFunction.hpp | 12 +- .../Meos/AlwaysNeTgeoTgeoLogicalFunction.hpp | 13 +- ...AlwaysNeTh3indexH3indexLogicalFunction.hpp | 10 +- .../AlwaysNeTjsonbJsonbLogicalFunction.hpp | 10 +- .../AlwaysNeTjsonbTjsonbLogicalFunction.hpp | 11 +- .../AlwaysNeTnpointNpointLogicalFunction.hpp | 12 +- .../AlwaysNeTnpointTnpointLogicalFunction.hpp | 15 +- .../Meos/AlwaysNeTposePoseLogicalFunction.hpp | 14 +- .../AlwaysNeTposeTposeLogicalFunction.hpp | 19 +- ...AlwaysNeTquadbinQuadbinLogicalFunction.hpp | 13 +- .../Meos/AlwaysNeTtextTextLogicalFunction.hpp | 33 +- .../AtouchesTcbufferGeoLogicalFunction.hpp | 14 +- ...touchesTcbufferTcbufferLogicalFunction.hpp | 19 +- .../Meos/AtouchesTgeoGeoLogicalFunction.hpp | 12 +- .../Meos/AtouchesTgeoTgeoLogicalFunction.hpp | 13 +- .../AtouchesTrgeometryGeoLogicalFunction.hpp | 45 + .../ContainedFloatSpanLogicalFunction.hpp | 12 +- .../ContainedFloatspanSpanLogicalFunction.hpp | 12 +- .../Meos/ContainedIntSpanLogicalFunction.hpp | 12 +- .../Meos/ContainedSpanSpanLogicalFunction.hpp | 12 +- .../ContainsFloatspanSpanLogicalFunction.hpp | 12 +- .../Meos/ContainsSpanFloatLogicalFunction.hpp | 12 +- .../Meos/ContainsSpanIntLogicalFunction.hpp | 12 +- .../Meos/ContainsSpanSpanLogicalFunction.hpp | 12 +- .../Meos/DivBigintTbigintLogicalFunction.hpp | 12 +- .../Meos/DivFloatTfloatLogicalFunction.hpp | 12 +- .../Meos/DivIntTintLogicalFunction.hpp | 12 +- .../Meos/DivTbigintBigintLogicalFunction.hpp | 10 +- .../Meos/DivTfloatFloatLogicalFunction.hpp | 10 +- .../Meos/DivTintIntLogicalFunction.hpp | 10 +- .../Meos/DivTnumberTnumberLogicalFunction.hpp | 11 +- .../EcontainsGeoTrgeometryLogicalFunction.hpp | 45 + .../EcontainsTcbufferGeoLogicalFunction.hpp | 14 +- ...ontainsTcbufferTcbufferLogicalFunction.hpp | 59 + .../Meos/EcontainsTgeoGeoLogicalFunction.hpp | 12 +- .../Meos/EcontainsTgeoTgeoLogicalFunction.hpp | 13 +- .../EcoversGeoTrgeometryLogicalFunction.hpp | 45 + .../EcoversTcbufferGeoLogicalFunction.hpp | 14 +- ...EcoversTcbufferTcbufferLogicalFunction.hpp | 19 +- .../Meos/EcoversTgeoGeoLogicalFunction.hpp | 55 + .../Meos/EcoversTgeoTgeoLogicalFunction.hpp | 13 +- .../EcoversTrgeometryGeoLogicalFunction.hpp | 45 + .../EdisjointTcbufferGeoLogicalFunction.hpp | 14 +- ...isjointTcbufferTcbufferLogicalFunction.hpp | 59 + .../Meos/EdisjointTgeoGeoLogicalFunction.hpp | 55 + .../Meos/EdisjointTgeoTgeoLogicalFunction.hpp | 13 +- .../EdisjointTrgeometryGeoLogicalFunction.hpp | 45 + ...intTrgeometryTrgeometryLogicalFunction.hpp | 45 + ...EdwithinTcbufferCbufferLogicalFunction.hpp | 57 + .../EdwithinTcbufferGeoLogicalFunction.hpp | 15 +- ...dwithinTcbufferTcbufferLogicalFunction.hpp | 21 +- .../Meos/EdwithinTgeoGeoLogicalFunction.hpp | 56 + .../Meos/EdwithinTgeoTgeoLogicalFunction.hpp | 14 +- .../EdwithinTrgeometryGeoLogicalFunction.hpp | 45 + ...hinTrgeometryTrgeometryLogicalFunction.hpp | 45 + .../EintersectsTcbufferGeoLogicalFunction.hpp | 14 +- ...ersectsTcbufferTcbufferLogicalFunction.hpp | 19 +- .../EintersectsTgeoGeoLogicalFunction.hpp | 12 +- .../EintersectsTgeoTgeoLogicalFunction.hpp | 13 +- ...intersectsTrgeometryGeoLogicalFunction.hpp | 45 + ...ctsTrgeometryTrgeometryLogicalFunction.hpp | 45 + .../EtouchesTcbufferGeoLogicalFunction.hpp | 14 +- ...touchesTcbufferTcbufferLogicalFunction.hpp | 19 +- .../Meos/EtouchesTgeoGeoLogicalFunction.hpp | 12 +- .../Meos/EtouchesTgeoTgeoLogicalFunction.hpp | 13 +- .../EtouchesTrgeometryGeoLogicalFunction.hpp | 45 + .../EverEqBigintTbigintLogicalFunction.hpp | 12 +- .../Meos/EverEqBoolTboolLogicalFunction.hpp | 12 +- .../EverEqNpointTnpointLogicalFunction.hpp | 12 +- .../Meos/EverEqPoseTposeLogicalFunction.hpp | 14 +- .../EverEqTbigintBigintLogicalFunction.hpp | 10 +- .../Meos/EverEqTboolBoolLogicalFunction.hpp | 10 +- .../EverEqTcbufferTcbufferLogicalFunction.hpp | 19 +- .../Meos/EverEqTextTtextLogicalFunction.hpp | 33 +- .../Meos/EverEqTgeoGeoLogicalFunction.hpp | 12 +- .../Meos/EverEqTgeoTgeoLogicalFunction.hpp | 13 +- .../EverEqTh3indexH3indexLogicalFunction.hpp | 10 +- .../Meos/EverEqTjsonbJsonbLogicalFunction.hpp | 10 +- .../EverEqTjsonbTjsonbLogicalFunction.hpp | 11 +- .../EverEqTnpointNpointLogicalFunction.hpp | 12 +- .../EverEqTnpointTnpointLogicalFunction.hpp | 15 +- .../Meos/EverEqTposePoseLogicalFunction.hpp | 14 +- .../Meos/EverEqTposeTposeLogicalFunction.hpp | 19 +- .../EverEqTquadbinQuadbinLogicalFunction.hpp | 13 +- .../Meos/EverEqTtextTextLogicalFunction.hpp | 33 +- .../EverGeBigintTbigintLogicalFunction.hpp | 12 +- .../EverGeTbigintBigintLogicalFunction.hpp | 10 +- .../Meos/EverGeTextTtextLogicalFunction.hpp | 33 +- .../Meos/EverGeTtextTextLogicalFunction.hpp | 33 +- .../EverGtBigintTbigintLogicalFunction.hpp | 12 +- .../EverGtTbigintBigintLogicalFunction.hpp | 10 +- .../Meos/EverGtTextTtextLogicalFunction.hpp | 33 +- .../Meos/EverGtTtextTextLogicalFunction.hpp | 33 +- .../EverLeBigintTbigintLogicalFunction.hpp | 12 +- .../EverLeTbigintBigintLogicalFunction.hpp | 10 +- .../Meos/EverLeTextTtextLogicalFunction.hpp | 33 +- .../Meos/EverLeTtextTextLogicalFunction.hpp | 33 +- .../EverLtBigintTbigintLogicalFunction.hpp | 12 +- .../EverLtTbigintBigintLogicalFunction.hpp | 10 +- .../Meos/EverLtTextTtextLogicalFunction.hpp | 33 +- .../Meos/EverLtTtextTextLogicalFunction.hpp | 33 +- .../EverNeBigintTbigintLogicalFunction.hpp | 12 +- .../Meos/EverNeBoolTboolLogicalFunction.hpp | 12 +- .../EverNeNpointTnpointLogicalFunction.hpp | 12 +- .../Meos/EverNePoseTposeLogicalFunction.hpp | 14 +- .../EverNeTbigintBigintLogicalFunction.hpp | 10 +- .../Meos/EverNeTboolBoolLogicalFunction.hpp | 10 +- .../EverNeTcbufferTcbufferLogicalFunction.hpp | 19 +- .../Meos/EverNeTextTtextLogicalFunction.hpp | 33 +- .../Meos/EverNeTgeoGeoLogicalFunction.hpp | 12 +- .../Meos/EverNeTgeoTgeoLogicalFunction.hpp | 13 +- .../EverNeTh3indexH3indexLogicalFunction.hpp | 10 +- .../Meos/EverNeTjsonbJsonbLogicalFunction.hpp | 10 +- .../EverNeTjsonbTjsonbLogicalFunction.hpp | 11 +- .../EverNeTnpointNpointLogicalFunction.hpp | 12 +- .../EverNeTnpointTnpointLogicalFunction.hpp | 15 +- .../Meos/EverNeTposePoseLogicalFunction.hpp | 14 +- .../Meos/EverNeTposeTposeLogicalFunction.hpp | 19 +- .../EverNeTquadbinQuadbinLogicalFunction.hpp | 13 +- .../Meos/EverNeTtextTextLogicalFunction.hpp | 33 +- .../Meos/FloatspanLowerIncLogicalFunction.hpp | 9 +- .../Meos/FloatspanLowerLogicalFunction.hpp | 9 +- .../Meos/FloatspanUpperIncLogicalFunction.hpp | 9 +- .../Meos/FloatspanUpperLogicalFunction.hpp | 9 +- .../Meos/FloatspanWidthLogicalFunction.hpp | 9 +- .../Meos/GeoAsEwktLogicalFunction.hpp | 9 +- .../Meos/GeoAsGeojsonLogicalFunction.hpp | 10 +- .../Meos/GeoEqualsLogicalFunction.hpp | 9 +- .../Functions/Meos/GeoGeoNLogicalFunction.hpp | 9 +- .../Meos/GeoIsUnitaryLogicalFunction.hpp | 8 +- .../Meos/GeoNumGeosLogicalFunction.hpp | 8 +- .../Meos/GeoNumPointsLogicalFunction.hpp | 8 +- .../Meos/GeoPointsLogicalFunction.hpp | 6 +- .../Meos/GeoReverseLogicalFunction.hpp | 6 +- .../Meos/GeoRoundLogicalFunction.hpp | 9 +- .../Functions/Meos/GeoSameLogicalFunction.hpp | 9 +- .../Meos/GeoSetSridLogicalFunction.hpp | 9 +- .../Functions/Meos/GeoSridLogicalFunction.hpp | 8 +- .../Meos/GeoTransformLogicalFunction.hpp | 9 +- .../Meos/GeogAreaLogicalFunction.hpp | 8 +- .../Meos/GeogCentroidLogicalFunction.hpp | 9 +- .../Meos/GeogDistanceLogicalFunction.hpp | 9 +- .../Meos/GeogDwithinLogicalFunction.hpp | 10 +- .../Meos/GeogIntersectsLogicalFunction.hpp | 9 +- .../Meos/GeogLengthLogicalFunction.hpp | 8 +- .../Meos/GeogPerimeterLogicalFunction.hpp | 8 +- .../Meos/GeogPointMake2dLogicalFunction.hpp | 10 +- .../Meos/GeogPointMake3dzLogicalFunction.hpp | 11 +- .../Meos/GeogToGeomLogicalFunction.hpp | 6 +- .../Meos/GeomAzimuthLogicalFunction.hpp | 10 +- .../Meos/GeomBoundaryLogicalFunction.hpp | 6 +- .../Meos/GeomCentroidLogicalFunction.hpp | 6 +- .../Meos/GeomContainsLogicalFunction.hpp | 8 +- .../Meos/GeomConvexHullLogicalFunction.hpp | 6 +- .../Meos/GeomCoversLogicalFunction.hpp | 9 +- .../Meos/GeomDifference2dLogicalFunction.hpp | 9 +- .../Meos/GeomDisjoint2dLogicalFunction.hpp | 8 +- .../Meos/GeomDistance2dLogicalFunction.hpp | 9 +- .../Meos/GeomDistance3dLogicalFunction.hpp | 9 +- .../Meos/GeomDwithin2dLogicalFunction.hpp | 9 +- .../Meos/GeomDwithin3dLogicalFunction.hpp | 10 +- .../Meos/GeomDwithinLogicalFunction.hpp | 10 +- .../GeomIntersection2dCollLogicalFunction.hpp | 9 +- .../GeomIntersection2dLogicalFunction.hpp | 9 +- .../Meos/GeomIntersects2dLogicalFunction.hpp | 8 +- .../Meos/GeomIntersects3dLogicalFunction.hpp | 9 +- .../Meos/GeomIntersectsLogicalFunction.hpp | 9 +- .../Meos/GeomIsEmptyLogicalFunction.hpp | 8 +- .../Meos/GeomLengthLogicalFunction.hpp | 9 +- .../Meos/GeomPerimeterLogicalFunction.hpp | 9 +- .../Meos/GeomPointMake2dLogicalFunction.hpp | 10 +- .../Meos/GeomPointMake3dzLogicalFunction.hpp | 11 +- .../GeomShortestline2dLogicalFunction.hpp | 9 +- .../GeomShortestline3dLogicalFunction.hpp | 9 +- .../Meos/GeomToGeogLogicalFunction.hpp | 6 +- .../Meos/GeomTouchesLogicalFunction.hpp | 9 +- .../Meos/GeomUnaryUnionLogicalFunction.hpp | 6 +- .../Meos/H3indexCmpLogicalFunction.hpp | 9 +- .../Meos/H3indexEqLogicalFunction.hpp | 9 +- .../Meos/H3indexGeLogicalFunction.hpp | 9 +- .../Meos/H3indexGtLogicalFunction.hpp | 9 +- .../Meos/H3indexLeLogicalFunction.hpp | 9 +- .../Meos/H3indexLtLogicalFunction.hpp | 9 +- .../Meos/H3indexNeLogicalFunction.hpp | 9 +- .../Meos/H3indexOutLogicalFunction.hpp | 6 +- .../Meos/IntspanLowerIncLogicalFunction.hpp | 9 +- .../Meos/IntspanLowerLogicalFunction.hpp | 9 +- .../Meos/IntspanUpperIncLogicalFunction.hpp | 9 +- .../Meos/IntspanUpperLogicalFunction.hpp | 9 +- .../Meos/IntspanWidthLogicalFunction.hpp | 9 +- .../JsonbArrayElementTextLogicalFunction.hpp | 12 +- .../Meos/JsonbArrayLengthLogicalFunction.hpp | 9 +- .../Meos/JsonbCmpLogicalFunction.hpp | 12 +- .../Meos/JsonbContainedLogicalFunction.hpp | 12 +- .../Meos/JsonbContainsLogicalFunction.hpp | 12 +- .../Functions/Meos/JsonbEqLogicalFunction.hpp | 12 +- .../Meos/JsonbExistsLogicalFunction.hpp | 12 +- .../Functions/Meos/JsonbGeLogicalFunction.hpp | 12 +- .../Functions/Meos/JsonbGtLogicalFunction.hpp | 12 +- .../Functions/Meos/JsonbLeLogicalFunction.hpp | 12 +- .../Functions/Meos/JsonbLtLogicalFunction.hpp | 12 +- .../Functions/Meos/JsonbNeLogicalFunction.hpp | 12 +- .../JsonbObjectFieldTextLogicalFunction.hpp | 12 +- .../Meos/JsonbPrettyLogicalFunction.hpp | 9 +- .../Meos/JsonbToCstringLogicalFunction.hpp | 9 +- .../LineInterpolatePointLogicalFunction.hpp | 9 +- .../Meos/LineLocatePointLogicalFunction.hpp | 9 +- .../Meos/LineNumpointsLogicalFunction.hpp | 6 +- .../Meos/LinePointNLogicalFunction.hpp | 9 +- .../Meos/LineSubstringLogicalFunction.hpp | 10 +- ...istanceTcbufferTcbufferLogicalFunction.hpp | 21 +- .../Meos/MulBigintTbigintLogicalFunction.hpp | 12 +- .../Meos/MulFloatTfloatLogicalFunction.hpp | 12 +- .../Meos/MulIntTintLogicalFunction.hpp | 12 +- .../Meos/MulTbigintBigintLogicalFunction.hpp | 10 +- .../Meos/MulTfloatFloatLogicalFunction.hpp | 10 +- .../Meos/MulTintIntLogicalFunction.hpp | 10 +- .../Meos/MulTnumberTnumberLogicalFunction.hpp | 11 +- .../Meos/NadTcbufferGeoLogicalFunction.hpp | 14 +- .../NadTcbufferTcbufferLogicalFunction.hpp | 19 +- .../Meos/NadTgeoGeoLogicalFunction.hpp | 12 +- .../Meos/NadTgeoTgeoLogicalFunction.hpp | 57 + .../Meos/NadTnpointGeoLogicalFunction.hpp | 11 +- .../Meos/NadTnpointNpointLogicalFunction.hpp | 12 +- .../Meos/NadTnpointTnpointLogicalFunction.hpp | 15 +- .../Meos/NadTposeGeoLogicalFunction.hpp | 12 +- .../Meos/NadTposePoseLogicalFunction.hpp | 14 +- .../Meos/NadTposeTposeLogicalFunction.hpp | 19 +- .../Meos/QuadbinCellAreaLogicalFunction.hpp | 6 +- .../QuadbinCellToParentLogicalFunction.hpp | 9 +- .../QuadbinCellToQuadkeyLogicalFunction.hpp | 6 +- .../Meos/QuadbinCmpLogicalFunction.hpp | 12 +- .../Meos/QuadbinEqLogicalFunction.hpp | 12 +- .../Meos/QuadbinGeLogicalFunction.hpp | 12 +- .../QuadbinGetResolutionLogicalFunction.hpp | 6 +- .../Meos/QuadbinGtLogicalFunction.hpp | 12 +- .../QuadbinIsValidCellLogicalFunction.hpp | 6 +- .../Meos/QuadbinLeLogicalFunction.hpp | 12 +- .../Meos/QuadbinLtLogicalFunction.hpp | 12 +- .../Meos/QuadbinNeLogicalFunction.hpp | 12 +- .../QuadbinPointToCellLogicalFunction.hpp | 10 +- .../Meos/QuadbinTileToCellLogicalFunction.hpp | 10 +- .../Meos/SubBigintTbigintLogicalFunction.hpp | 12 +- .../Meos/SubFloatTfloatLogicalFunction.hpp | 12 +- .../Meos/SubIntTintLogicalFunction.hpp | 12 +- .../Meos/SubTbigintBigintLogicalFunction.hpp | 10 +- .../Meos/SubTfloatFloatLogicalFunction.hpp | 10 +- .../Meos/SubTintIntLogicalFunction.hpp | 10 +- .../Meos/SubTnumberTnumberLogicalFunction.hpp | 11 +- .../Meos/TEqTextTtextLogicalFunction.hpp | 54 + .../Meos/TEqTtextTextLogicalFunction.hpp | 54 + .../Meos/TGeTextTtextLogicalFunction.hpp | 54 + .../Meos/TGeTtextTextLogicalFunction.hpp | 54 + .../Meos/TGtTextTtextLogicalFunction.hpp | 54 + .../Meos/TGtTtextTextLogicalFunction.hpp | 54 + .../Meos/TLeTextTtextLogicalFunction.hpp | 54 + .../Meos/TLeTtextTextLogicalFunction.hpp | 54 + .../Meos/TLtTextTtextLogicalFunction.hpp | 54 + .../Meos/TLtTtextTextLogicalFunction.hpp | 54 + .../Meos/TNeTextTtextLogicalFunction.hpp | 54 + .../Meos/TNeTtextTextLogicalFunction.hpp | 54 + .../Meos/TandBoolTboolLogicalFunction.hpp | 12 +- .../Meos/TandTboolBoolLogicalFunction.hpp | 10 +- .../Meos/TandTboolTboolLogicalFunction.hpp | 11 +- .../Meos/TbigintScaleValueLogicalFunction.hpp | 10 +- .../TbigintShiftScaleValueLogicalFunction.hpp | 10 +- .../Meos/TbigintShiftValueLogicalFunction.hpp | 10 +- .../Meos/TbigintToTfloatLogicalFunction.hpp | 8 +- .../Meos/TbigintToTintLogicalFunction.hpp | 8 +- .../Meos/TboolToTintLogicalFunction.hpp | 4 +- .../TdistanceTfloatFloatLogicalFunction.hpp | 10 +- .../Meos/TdistanceTintIntLogicalFunction.hpp | 10 +- ...TdistanceTnumberTnumberLogicalFunction.hpp | 11 +- ...ContainsTNpointGeometryLogicalFunction.hpp | 55 + ...AContainsTNpointTNpointLogicalFunction.hpp | 57 + ...lAContainsTPoseGeometryLogicalFunction.hpp | 56 + ...oralAContainsTPoseTPoseLogicalFunction.hpp | 59 + ...ADWithinTNpointGeometryLogicalFunction.hpp | 56 + ...lADWithinTNpointTNpointLogicalFunction.hpp | 58 + ...alADWithinTPoseGeometryLogicalFunction.hpp | 57 + ...poralADWithinTPoseTPoseLogicalFunction.hpp | 60 + ...DisjointTNpointGeometryLogicalFunction.hpp | 55 + ...ADisjointTNpointTNpointLogicalFunction.hpp | 57 + ...lADisjointTPoseGeometryLogicalFunction.hpp | 56 + ...oralADisjointTPoseTPoseLogicalFunction.hpp | 59 + ...tersectsTNpointGeometryLogicalFunction.hpp | 55 + ...ntersectsTNpointTNpointLogicalFunction.hpp | 57 + ...IntersectsTPoseGeometryLogicalFunction.hpp | 56 + ...alAIntersectsTPoseTPoseLogicalFunction.hpp | 59 + ...ATouchesTNpointGeometryLogicalFunction.hpp | 55 + ...lATouchesTNpointTNpointLogicalFunction.hpp | 57 + ...alATouchesTPoseGeometryLogicalFunction.hpp | 56 + ...poralATouchesTPoseTPoseLogicalFunction.hpp | 59 + ...ContainsTNpointGeometryLogicalFunction.hpp | 55 + ...EContainsTNpointTNpointLogicalFunction.hpp | 57 + ...lEContainsTPoseGeometryLogicalFunction.hpp | 56 + ...oralEContainsTPoseTPoseLogicalFunction.hpp | 59 + ...lECoversTNpointGeometryLogicalFunction.hpp | 55 + ...alECoversTNpointTNpointLogicalFunction.hpp | 57 + ...ralECoversTPoseGeometryLogicalFunction.hpp | 56 + ...mporalECoversTPoseTPoseLogicalFunction.hpp | 59 + ...EDWithinTNpointGeometryLogicalFunction.hpp | 56 + ...lEDWithinTNpointTNpointLogicalFunction.hpp | 58 + ...alEDWithinTPoseGeometryLogicalFunction.hpp | 57 + ...poralEDWithinTPoseTPoseLogicalFunction.hpp | 60 + ...DisjointTNpointGeometryLogicalFunction.hpp | 55 + ...EDisjointTNpointTNpointLogicalFunction.hpp | 57 + ...lEDisjointTPoseGeometryLogicalFunction.hpp | 56 + ...oralEDisjointTPoseTPoseLogicalFunction.hpp | 59 + ...tersectsTNpointGeometryLogicalFunction.hpp | 55 + ...ntersectsTNpointTNpointLogicalFunction.hpp | 57 + ...IntersectsTPoseGeometryLogicalFunction.hpp | 56 + ...alEIntersectsTPoseTPoseLogicalFunction.hpp | 59 + ...ETouchesTNpointGeometryLogicalFunction.hpp | 55 + ...lETouchesTNpointTNpointLogicalFunction.hpp | 57 + ...alETouchesTPoseGeometryLogicalFunction.hpp | 56 + ...poralETouchesTPoseTPoseLogicalFunction.hpp | 59 + ...poralNADTNpointGeometryLogicalFunction.hpp | 55 + ...mporalNADTNpointTNpointLogicalFunction.hpp | 57 + ...emporalNADTPoseGeometryLogicalFunction.hpp | 56 + .../TemporalNADTPoseTPoseLogicalFunction.hpp | 59 + .../Meos/TemporalRoundLogicalFunction.hpp | 10 +- .../Meos/TeqBoolTboolLogicalFunction.hpp | 12 +- .../Meos/TeqTboolBoolLogicalFunction.hpp | 10 +- .../Meos/TextInitcapLogicalFunction.hpp | 9 +- .../Meos/TextLowerLogicalFunction.hpp | 9 +- .../Meos/TextUpperLogicalFunction.hpp | 9 +- .../Meos/TextcatTextTtextLogicalFunction.hpp | 9 +- .../Meos/TextcatTtextTextLogicalFunction.hpp | 9 +- .../Meos/TextcatTtextTtextLogicalFunction.hpp | 10 +- .../Meos/TfloatScaleValueLogicalFunction.hpp | 10 +- .../TfloatShiftScaleValueLogicalFunction.hpp | 12 +- .../Meos/TfloatShiftValueLogicalFunction.hpp | 10 +- .../Meos/TfloatToTbigintLogicalFunction.hpp | 8 +- .../Meos/TfloatToTintLogicalFunction.hpp | 8 +- ...h3indexAreNeighborCellsLogicalFunction.hpp | 12 +- ...3indexCellToCenterChildLogicalFunction.hpp | 10 +- ...exCellToCenterChildNextLogicalFunction.hpp | 10 +- .../Th3indexCellToChildPosLogicalFunction.hpp | 10 +- .../Th3indexCellToParentLogicalFunction.hpp | 10 +- ...h3indexCellToParentNextLogicalFunction.hpp | 10 +- ...3indexGetBaseCellNumberLogicalFunction.hpp | 9 +- .../Th3indexGetResolutionLogicalFunction.hpp | 9 +- .../Th3indexGridDistanceLogicalFunction.hpp | 12 +- .../Th3indexIsPentagonLogicalFunction.hpp | 9 +- .../Th3indexIsValidCellLogicalFunction.hpp | 9 +- .../Meos/TintScaleValueLogicalFunction.hpp | 10 +- .../TintShiftScaleValueLogicalFunction.hpp | 12 +- .../Meos/TintShiftValueLogicalFunction.hpp | 10 +- .../Meos/TintToTbigintLogicalFunction.hpp | 8 +- .../Meos/TintToTfloatLogicalFunction.hpp | 8 +- .../Meos/TneBoolTboolLogicalFunction.hpp | 12 +- .../Meos/TneTboolBoolLogicalFunction.hpp | 10 +- .../Meos/TnotTboolLogicalFunction.hpp | 2 +- .../Meos/TorBoolTboolLogicalFunction.hpp | 12 +- .../Meos/TorTboolBoolLogicalFunction.hpp | 10 +- .../Meos/TorTboolTboolLogicalFunction.hpp | 11 +- .../Meos/TtextInitcapLogicalFunction.hpp | 7 +- .../Meos/TtextLowerLogicalFunction.hpp | 7 +- .../Meos/TtextUpperLogicalFunction.hpp | 7 +- .../AcontainsGeoTrgeometryLogicalFunction.cpp | 87 + .../AcontainsTcbufferGeoLogicalFunction.cpp | 86 +- ...ontainsTcbufferTcbufferLogicalFunction.cpp | 143 + .../Meos/AcontainsTgeoGeoLogicalFunction.cpp | 80 +- .../Meos/AcontainsTgeoTgeoLogicalFunction.cpp | 94 +- .../AcoversGeoTrgeometryLogicalFunction.cpp | 87 + .../AcoversTcbufferGeoLogicalFunction.cpp | 86 +- ...AcoversTcbufferTcbufferLogicalFunction.cpp | 107 +- .../Meos/AcoversTgeoGeoLogicalFunction.cpp | 80 +- .../Meos/AcoversTgeoTgeoLogicalFunction.cpp | 94 +- .../AcoversTrgeometryGeoLogicalFunction.cpp | 87 + .../Meos/AddBigintTbigintLogicalFunction.cpp | 45 +- .../Meos/AddFloatTfloatLogicalFunction.cpp | 45 +- .../Meos/AddIntTintLogicalFunction.cpp | 47 +- .../Meos/AddTbigintBigintLogicalFunction.cpp | 43 +- .../Meos/AddTfloatFloatLogicalFunction.cpp | 43 +- .../Meos/AddTintIntLogicalFunction.cpp | 45 +- .../Meos/AddTnumberTnumberLogicalFunction.cpp | 60 +- .../AdisjointTcbufferGeoLogicalFunction.cpp | 86 +- ...isjointTcbufferTcbufferLogicalFunction.cpp | 107 +- .../Meos/AdisjointTgeoGeoLogicalFunction.cpp | 80 +- .../Meos/AdisjointTgeoTgeoLogicalFunction.cpp | 94 +- .../AdisjointTrgeometryGeoLogicalFunction.cpp | 87 + ...intTrgeometryTrgeometryLogicalFunction.cpp | 99 + ...AdwithinTcbufferCbufferLogicalFunction.cpp | 137 + .../AdwithinTcbufferGeoLogicalFunction.cpp | 91 +- ...dwithinTcbufferTcbufferLogicalFunction.cpp | 112 +- .../Meos/AdwithinTgeoGeoLogicalFunction.cpp | 86 +- .../Meos/AdwithinTgeoTgeoLogicalFunction.cpp | 98 +- .../AdwithinTrgeometryGeoLogicalFunction.cpp | 90 + ...hinTrgeometryTrgeometryLogicalFunction.cpp | 102 + .../AintersectsTcbufferGeoLogicalFunction.cpp | 86 +- ...ersectsTcbufferTcbufferLogicalFunction.cpp | 107 +- .../AintersectsTgeoGeoLogicalFunction.cpp | 80 +- .../AintersectsTgeoTgeoLogicalFunction.cpp | 94 +- ...intersectsTrgeometryGeoLogicalFunction.cpp | 87 + ...ctsTrgeometryTrgeometryLogicalFunction.cpp | 99 + .../AlwaysEqBigintTbigintLogicalFunction.cpp | 47 +- .../Meos/AlwaysEqBoolTboolLogicalFunction.cpp | 47 +- .../AlwaysEqNpointTnpointLogicalFunction.cpp | 84 +- .../Meos/AlwaysEqPoseTposeLogicalFunction.cpp | 90 +- .../AlwaysEqTbigintBigintLogicalFunction.cpp | 45 +- .../Meos/AlwaysEqTboolBoolLogicalFunction.cpp | 45 +- ...lwaysEqTcbufferTcbufferLogicalFunction.cpp | 107 +- .../Meos/AlwaysEqTextTtextLogicalFunction.cpp | 139 +- .../Meos/AlwaysEqTgeoGeoLogicalFunction.cpp | 80 +- .../Meos/AlwaysEqTgeoTgeoLogicalFunction.cpp | 94 +- ...AlwaysEqTh3indexH3indexLogicalFunction.cpp | 71 +- .../AlwaysEqTjsonbJsonbLogicalFunction.cpp | 70 +- .../AlwaysEqTjsonbTjsonbLogicalFunction.cpp | 80 +- .../AlwaysEqTnpointNpointLogicalFunction.cpp | 84 +- .../AlwaysEqTnpointTnpointLogicalFunction.cpp | 93 +- .../Meos/AlwaysEqTposePoseLogicalFunction.cpp | 90 +- .../AlwaysEqTposeTposeLogicalFunction.cpp | 105 +- ...AlwaysEqTquadbinQuadbinLogicalFunction.cpp | 106 +- .../Meos/AlwaysEqTtextTextLogicalFunction.cpp | 139 +- .../AlwaysGeBigintTbigintLogicalFunction.cpp | 47 +- .../AlwaysGeTbigintBigintLogicalFunction.cpp | 45 +- .../Meos/AlwaysGeTextTtextLogicalFunction.cpp | 139 +- .../Meos/AlwaysGeTtextTextLogicalFunction.cpp | 139 +- .../AlwaysGtBigintTbigintLogicalFunction.cpp | 47 +- .../AlwaysGtTbigintBigintLogicalFunction.cpp | 45 +- .../Meos/AlwaysGtTextTtextLogicalFunction.cpp | 139 +- .../Meos/AlwaysGtTtextTextLogicalFunction.cpp | 139 +- .../AlwaysLeBigintTbigintLogicalFunction.cpp | 47 +- .../AlwaysLeTbigintBigintLogicalFunction.cpp | 45 +- .../Meos/AlwaysLeTextTtextLogicalFunction.cpp | 139 +- .../Meos/AlwaysLeTtextTextLogicalFunction.cpp | 139 +- .../AlwaysLtBigintTbigintLogicalFunction.cpp | 47 +- .../AlwaysLtTbigintBigintLogicalFunction.cpp | 45 +- .../Meos/AlwaysLtTextTtextLogicalFunction.cpp | 139 +- .../Meos/AlwaysLtTtextTextLogicalFunction.cpp | 139 +- .../AlwaysNeBigintTbigintLogicalFunction.cpp | 47 +- .../Meos/AlwaysNeBoolTboolLogicalFunction.cpp | 47 +- .../AlwaysNeNpointTnpointLogicalFunction.cpp | 84 +- .../Meos/AlwaysNePoseTposeLogicalFunction.cpp | 90 +- .../AlwaysNeTbigintBigintLogicalFunction.cpp | 45 +- .../Meos/AlwaysNeTboolBoolLogicalFunction.cpp | 45 +- ...lwaysNeTcbufferTcbufferLogicalFunction.cpp | 107 +- .../Meos/AlwaysNeTextTtextLogicalFunction.cpp | 139 +- .../Meos/AlwaysNeTgeoGeoLogicalFunction.cpp | 80 +- .../Meos/AlwaysNeTgeoTgeoLogicalFunction.cpp | 94 +- ...AlwaysNeTh3indexH3indexLogicalFunction.cpp | 71 +- .../AlwaysNeTjsonbJsonbLogicalFunction.cpp | 70 +- .../AlwaysNeTjsonbTjsonbLogicalFunction.cpp | 80 +- .../AlwaysNeTnpointNpointLogicalFunction.cpp | 84 +- .../AlwaysNeTnpointTnpointLogicalFunction.cpp | 93 +- .../Meos/AlwaysNeTposePoseLogicalFunction.cpp | 90 +- .../AlwaysNeTposeTposeLogicalFunction.cpp | 105 +- ...AlwaysNeTquadbinQuadbinLogicalFunction.cpp | 106 +- .../Meos/AlwaysNeTtextTextLogicalFunction.cpp | 139 +- .../AtouchesTcbufferGeoLogicalFunction.cpp | 86 +- ...touchesTcbufferTcbufferLogicalFunction.cpp | 107 +- .../Meos/AtouchesTgeoGeoLogicalFunction.cpp | 80 +- .../Meos/AtouchesTgeoTgeoLogicalFunction.cpp | 94 +- .../AtouchesTrgeometryGeoLogicalFunction.cpp | 87 + .../src/Functions/Meos/CMakeLists.txt | 96 + .../ContainedFloatSpanLogicalFunction.cpp | 100 +- .../ContainedFloatspanSpanLogicalFunction.cpp | 102 +- .../Meos/ContainedIntSpanLogicalFunction.cpp | 100 +- .../Meos/ContainedSpanSpanLogicalFunction.cpp | 102 +- .../ContainsFloatspanSpanLogicalFunction.cpp | 102 +- .../Meos/ContainsSpanFloatLogicalFunction.cpp | 100 +- .../Meos/ContainsSpanIntLogicalFunction.cpp | 100 +- .../Meos/ContainsSpanSpanLogicalFunction.cpp | 102 +- .../Meos/DivBigintTbigintLogicalFunction.cpp | 45 +- .../Meos/DivFloatTfloatLogicalFunction.cpp | 45 +- .../Meos/DivIntTintLogicalFunction.cpp | 47 +- .../Meos/DivTbigintBigintLogicalFunction.cpp | 43 +- .../Meos/DivTfloatFloatLogicalFunction.cpp | 43 +- .../Meos/DivTintIntLogicalFunction.cpp | 45 +- .../Meos/DivTnumberTnumberLogicalFunction.cpp | 60 +- .../EcontainsGeoTrgeometryLogicalFunction.cpp | 87 + .../EcontainsTcbufferGeoLogicalFunction.cpp | 86 +- ...ontainsTcbufferTcbufferLogicalFunction.cpp | 143 + .../Meos/EcontainsTgeoGeoLogicalFunction.cpp | 80 +- .../Meos/EcontainsTgeoTgeoLogicalFunction.cpp | 94 +- .../EcoversGeoTrgeometryLogicalFunction.cpp | 87 + .../EcoversTcbufferGeoLogicalFunction.cpp | 86 +- ...EcoversTcbufferTcbufferLogicalFunction.cpp | 107 +- .../Meos/EcoversTgeoGeoLogicalFunction.cpp | 131 + .../Meos/EcoversTgeoTgeoLogicalFunction.cpp | 94 +- .../EcoversTrgeometryGeoLogicalFunction.cpp | 87 + .../EdisjointTcbufferGeoLogicalFunction.cpp | 86 +- ...isjointTcbufferTcbufferLogicalFunction.cpp | 143 + .../Meos/EdisjointTgeoGeoLogicalFunction.cpp | 131 + .../Meos/EdisjointTgeoTgeoLogicalFunction.cpp | 94 +- .../EdisjointTrgeometryGeoLogicalFunction.cpp | 87 + ...intTrgeometryTrgeometryLogicalFunction.cpp | 99 + ...EdwithinTcbufferCbufferLogicalFunction.cpp | 137 + .../EdwithinTcbufferGeoLogicalFunction.cpp | 91 +- ...dwithinTcbufferTcbufferLogicalFunction.cpp | 112 +- .../Meos/EdwithinTgeoGeoLogicalFunction.cpp | 134 + .../Meos/EdwithinTgeoTgeoLogicalFunction.cpp | 98 +- .../EdwithinTrgeometryGeoLogicalFunction.cpp | 90 + ...hinTrgeometryTrgeometryLogicalFunction.cpp | 102 + .../EintersectsTcbufferGeoLogicalFunction.cpp | 86 +- ...ersectsTcbufferTcbufferLogicalFunction.cpp | 107 +- .../EintersectsTgeoGeoLogicalFunction.cpp | 80 +- .../EintersectsTgeoTgeoLogicalFunction.cpp | 94 +- ...intersectsTrgeometryGeoLogicalFunction.cpp | 87 + ...ctsTrgeometryTrgeometryLogicalFunction.cpp | 99 + .../EtouchesTcbufferGeoLogicalFunction.cpp | 86 +- ...touchesTcbufferTcbufferLogicalFunction.cpp | 107 +- .../Meos/EtouchesTgeoGeoLogicalFunction.cpp | 80 +- .../Meos/EtouchesTgeoTgeoLogicalFunction.cpp | 94 +- .../EtouchesTrgeometryGeoLogicalFunction.cpp | 87 + .../EverEqBigintTbigintLogicalFunction.cpp | 47 +- .../Meos/EverEqBoolTboolLogicalFunction.cpp | 47 +- .../EverEqNpointTnpointLogicalFunction.cpp | 84 +- .../Meos/EverEqPoseTposeLogicalFunction.cpp | 90 +- .../EverEqTbigintBigintLogicalFunction.cpp | 45 +- .../Meos/EverEqTboolBoolLogicalFunction.cpp | 45 +- .../EverEqTcbufferTcbufferLogicalFunction.cpp | 107 +- .../Meos/EverEqTextTtextLogicalFunction.cpp | 139 +- .../Meos/EverEqTgeoGeoLogicalFunction.cpp | 80 +- .../Meos/EverEqTgeoTgeoLogicalFunction.cpp | 94 +- .../EverEqTh3indexH3indexLogicalFunction.cpp | 71 +- .../Meos/EverEqTjsonbJsonbLogicalFunction.cpp | 70 +- .../EverEqTjsonbTjsonbLogicalFunction.cpp | 80 +- .../EverEqTnpointNpointLogicalFunction.cpp | 84 +- .../EverEqTnpointTnpointLogicalFunction.cpp | 93 +- .../Meos/EverEqTposePoseLogicalFunction.cpp | 90 +- .../Meos/EverEqTposeTposeLogicalFunction.cpp | 105 +- .../EverEqTquadbinQuadbinLogicalFunction.cpp | 106 +- .../Meos/EverEqTtextTextLogicalFunction.cpp | 139 +- .../EverGeBigintTbigintLogicalFunction.cpp | 47 +- .../EverGeTbigintBigintLogicalFunction.cpp | 45 +- .../Meos/EverGeTextTtextLogicalFunction.cpp | 139 +- .../Meos/EverGeTtextTextLogicalFunction.cpp | 139 +- .../EverGtBigintTbigintLogicalFunction.cpp | 47 +- .../EverGtTbigintBigintLogicalFunction.cpp | 45 +- .../Meos/EverGtTextTtextLogicalFunction.cpp | 139 +- .../Meos/EverGtTtextTextLogicalFunction.cpp | 139 +- .../EverLeBigintTbigintLogicalFunction.cpp | 47 +- .../EverLeTbigintBigintLogicalFunction.cpp | 45 +- .../Meos/EverLeTextTtextLogicalFunction.cpp | 139 +- .../Meos/EverLeTtextTextLogicalFunction.cpp | 139 +- .../EverLtBigintTbigintLogicalFunction.cpp | 47 +- .../EverLtTbigintBigintLogicalFunction.cpp | 45 +- .../Meos/EverLtTextTtextLogicalFunction.cpp | 139 +- .../Meos/EverLtTtextTextLogicalFunction.cpp | 139 +- .../EverNeBigintTbigintLogicalFunction.cpp | 47 +- .../Meos/EverNeBoolTboolLogicalFunction.cpp | 47 +- .../EverNeNpointTnpointLogicalFunction.cpp | 84 +- .../Meos/EverNePoseTposeLogicalFunction.cpp | 90 +- .../EverNeTbigintBigintLogicalFunction.cpp | 45 +- .../Meos/EverNeTboolBoolLogicalFunction.cpp | 45 +- .../EverNeTcbufferTcbufferLogicalFunction.cpp | 107 +- .../Meos/EverNeTextTtextLogicalFunction.cpp | 139 +- .../Meos/EverNeTgeoGeoLogicalFunction.cpp | 80 +- .../Meos/EverNeTgeoTgeoLogicalFunction.cpp | 94 +- .../EverNeTh3indexH3indexLogicalFunction.cpp | 71 +- .../Meos/EverNeTjsonbJsonbLogicalFunction.cpp | 70 +- .../EverNeTjsonbTjsonbLogicalFunction.cpp | 80 +- .../EverNeTnpointNpointLogicalFunction.cpp | 84 +- .../EverNeTnpointTnpointLogicalFunction.cpp | 93 +- .../Meos/EverNeTposePoseLogicalFunction.cpp | 90 +- .../Meos/EverNeTposeTposeLogicalFunction.cpp | 105 +- .../EverNeTquadbinQuadbinLogicalFunction.cpp | 106 +- .../Meos/EverNeTtextTextLogicalFunction.cpp | 139 +- .../Meos/FloatspanLowerIncLogicalFunction.cpp | 92 +- .../Meos/FloatspanLowerLogicalFunction.cpp | 92 +- .../Meos/FloatspanUpperIncLogicalFunction.cpp | 92 +- .../Meos/FloatspanUpperLogicalFunction.cpp | 92 +- .../Meos/FloatspanWidthLogicalFunction.cpp | 92 +- .../Meos/GeoAsEwktLogicalFunction.cpp | 66 +- .../Meos/GeoAsGeojsonLogicalFunction.cpp | 72 +- .../Meos/GeoEqualsLogicalFunction.cpp | 67 +- .../Functions/Meos/GeoGeoNLogicalFunction.cpp | 66 +- .../Meos/GeoIsUnitaryLogicalFunction.cpp | 58 +- .../Meos/GeoNumGeosLogicalFunction.cpp | 58 +- .../Meos/GeoNumPointsLogicalFunction.cpp | 58 +- .../Meos/GeoPointsLogicalFunction.cpp | 58 +- .../Meos/GeoReverseLogicalFunction.cpp | 58 +- .../Meos/GeoRoundLogicalFunction.cpp | 66 +- .../Functions/Meos/GeoSameLogicalFunction.cpp | 67 +- .../Meos/GeoSetSridLogicalFunction.cpp | 66 +- .../Functions/Meos/GeoSridLogicalFunction.cpp | 58 +- .../Meos/GeoTransformLogicalFunction.cpp | 66 +- .../Meos/GeogAreaLogicalFunction.cpp | 58 +- .../Meos/GeogCentroidLogicalFunction.cpp | 66 +- .../Meos/GeogDistanceLogicalFunction.cpp | 67 +- .../Meos/GeogDwithinLogicalFunction.cpp | 75 +- .../Meos/GeogIntersectsLogicalFunction.cpp | 67 +- .../Meos/GeogLengthLogicalFunction.cpp | 58 +- .../Meos/GeogPerimeterLogicalFunction.cpp | 58 +- .../Meos/GeogPointMake2dLogicalFunction.cpp | 68 +- .../Meos/GeogPointMake3dzLogicalFunction.cpp | 72 +- .../Meos/GeogToGeomLogicalFunction.cpp | 58 +- .../Meos/GeomAzimuthLogicalFunction.cpp | 65 +- .../Meos/GeomBoundaryLogicalFunction.cpp | 58 +- .../Meos/GeomCentroidLogicalFunction.cpp | 58 +- .../Meos/GeomContainsLogicalFunction.cpp | 50 +- .../Meos/GeomConvexHullLogicalFunction.cpp | 58 +- .../Meos/GeomCoversLogicalFunction.cpp | 50 +- .../Meos/GeomDifference2dLogicalFunction.cpp | 68 +- .../Meos/GeomDisjoint2dLogicalFunction.cpp | 50 +- .../Meos/GeomDistance2dLogicalFunction.cpp | 50 +- .../Meos/GeomDistance3dLogicalFunction.cpp | 50 +- .../Meos/GeomDwithin2dLogicalFunction.cpp | 55 +- .../Meos/GeomDwithin3dLogicalFunction.cpp | 55 +- .../Meos/GeomDwithinLogicalFunction.cpp | 75 +- .../GeomIntersection2dCollLogicalFunction.cpp | 68 +- .../GeomIntersection2dLogicalFunction.cpp | 68 +- .../Meos/GeomIntersects2dLogicalFunction.cpp | 50 +- .../Meos/GeomIntersects3dLogicalFunction.cpp | 50 +- .../Meos/GeomIntersectsLogicalFunction.cpp | 67 +- .../Meos/GeomIsEmptyLogicalFunction.cpp | 58 +- .../Meos/GeomLengthLogicalFunction.cpp | 58 +- .../Meos/GeomPerimeterLogicalFunction.cpp | 58 +- .../Meos/GeomPointMake2dLogicalFunction.cpp | 68 +- .../Meos/GeomPointMake3dzLogicalFunction.cpp | 72 +- .../GeomShortestline2dLogicalFunction.cpp | 68 +- .../GeomShortestline3dLogicalFunction.cpp | 68 +- .../Meos/GeomToGeogLogicalFunction.cpp | 58 +- .../Meos/GeomTouchesLogicalFunction.cpp | 50 +- .../Meos/GeomUnaryUnionLogicalFunction.cpp | 58 +- .../Meos/H3indexCmpLogicalFunction.cpp | 64 +- .../Meos/H3indexEqLogicalFunction.cpp | 64 +- .../Meos/H3indexGeLogicalFunction.cpp | 64 +- .../Meos/H3indexGtLogicalFunction.cpp | 64 +- .../Meos/H3indexLeLogicalFunction.cpp | 64 +- .../Meos/H3indexLtLogicalFunction.cpp | 64 +- .../Meos/H3indexNeLogicalFunction.cpp | 64 +- .../Meos/H3indexOutLogicalFunction.cpp | 58 +- .../Meos/IntspanLowerIncLogicalFunction.cpp | 92 +- .../Meos/IntspanLowerLogicalFunction.cpp | 92 +- .../Meos/IntspanUpperIncLogicalFunction.cpp | 92 +- .../Meos/IntspanUpperLogicalFunction.cpp | 92 +- .../Meos/IntspanWidthLogicalFunction.cpp | 92 +- .../JsonbArrayElementTextLogicalFunction.cpp | 100 +- .../Meos/JsonbArrayLengthLogicalFunction.cpp | 92 +- .../Meos/JsonbCmpLogicalFunction.cpp | 102 +- .../Meos/JsonbContainedLogicalFunction.cpp | 102 +- .../Meos/JsonbContainsLogicalFunction.cpp | 102 +- .../Functions/Meos/JsonbEqLogicalFunction.cpp | 102 +- .../Meos/JsonbExistsLogicalFunction.cpp | 100 +- .../Functions/Meos/JsonbGeLogicalFunction.cpp | 102 +- .../Functions/Meos/JsonbGtLogicalFunction.cpp | 102 +- .../Functions/Meos/JsonbLeLogicalFunction.cpp | 102 +- .../Functions/Meos/JsonbLtLogicalFunction.cpp | 102 +- .../Functions/Meos/JsonbNeLogicalFunction.cpp | 102 +- .../JsonbObjectFieldTextLogicalFunction.cpp | 100 +- .../Meos/JsonbPrettyLogicalFunction.cpp | 92 +- .../Meos/JsonbToCstringLogicalFunction.cpp | 92 +- .../LineInterpolatePointLogicalFunction.cpp | 75 +- .../Meos/LineLocatePointLogicalFunction.cpp | 68 +- .../Meos/LineNumpointsLogicalFunction.cpp | 58 +- .../Meos/LinePointNLogicalFunction.cpp | 66 +- .../Meos/LineSubstringLogicalFunction.cpp | 72 +- ...istanceTcbufferTcbufferLogicalFunction.cpp | 110 +- .../Meos/MulBigintTbigintLogicalFunction.cpp | 45 +- .../Meos/MulFloatTfloatLogicalFunction.cpp | 45 +- .../Meos/MulIntTintLogicalFunction.cpp | 47 +- .../Meos/MulTbigintBigintLogicalFunction.cpp | 43 +- .../Meos/MulTfloatFloatLogicalFunction.cpp | 43 +- .../Meos/MulTintIntLogicalFunction.cpp | 45 +- .../Meos/MulTnumberTnumberLogicalFunction.cpp | 60 +- .../Meos/NadTcbufferGeoLogicalFunction.cpp | 84 +- .../NadTcbufferTcbufferLogicalFunction.cpp | 105 +- .../Meos/NadTgeoGeoLogicalFunction.cpp | 78 +- .../Meos/NadTgeoTgeoLogicalFunction.cpp | 137 + .../Meos/NadTnpointGeoLogicalFunction.cpp | 76 +- .../Meos/NadTnpointNpointLogicalFunction.cpp | 84 +- .../Meos/NadTnpointTnpointLogicalFunction.cpp | 93 +- .../Meos/NadTposeGeoLogicalFunction.cpp | 78 +- .../Meos/NadTposePoseLogicalFunction.cpp | 90 +- .../Meos/NadTposeTposeLogicalFunction.cpp | 105 +- .../Meos/QuadbinCellAreaLogicalFunction.cpp | 57 +- .../QuadbinCellToParentLogicalFunction.cpp | 64 +- .../QuadbinCellToQuadkeyLogicalFunction.cpp | 57 +- .../Meos/QuadbinCmpLogicalFunction.cpp | 97 +- .../Meos/QuadbinEqLogicalFunction.cpp | 97 +- .../Meos/QuadbinGeLogicalFunction.cpp | 97 +- .../QuadbinGetResolutionLogicalFunction.cpp | 57 +- .../Meos/QuadbinGtLogicalFunction.cpp | 97 +- .../QuadbinIsValidCellLogicalFunction.cpp | 57 +- .../Meos/QuadbinLeLogicalFunction.cpp | 97 +- .../Meos/QuadbinLtLogicalFunction.cpp | 97 +- .../Meos/QuadbinNeLogicalFunction.cpp | 97 +- .../QuadbinPointToCellLogicalFunction.cpp | 69 +- .../Meos/QuadbinTileToCellLogicalFunction.cpp | 69 +- .../Meos/SubBigintTbigintLogicalFunction.cpp | 45 +- .../Meos/SubFloatTfloatLogicalFunction.cpp | 45 +- .../Meos/SubIntTintLogicalFunction.cpp | 47 +- .../Meos/SubTbigintBigintLogicalFunction.cpp | 43 +- .../Meos/SubTfloatFloatLogicalFunction.cpp | 43 +- .../Meos/SubTintIntLogicalFunction.cpp | 45 +- .../Meos/SubTnumberTnumberLogicalFunction.cpp | 60 +- .../Meos/TEqTextTtextLogicalFunction.cpp | 128 + .../Meos/TEqTtextTextLogicalFunction.cpp | 128 + .../Meos/TGeTextTtextLogicalFunction.cpp | 128 + .../Meos/TGeTtextTextLogicalFunction.cpp | 128 + .../Meos/TGtTextTtextLogicalFunction.cpp | 128 + .../Meos/TGtTtextTextLogicalFunction.cpp | 128 + .../Meos/TLeTextTtextLogicalFunction.cpp | 128 + .../Meos/TLeTtextTextLogicalFunction.cpp | 128 + .../Meos/TLtTextTtextLogicalFunction.cpp | 128 + .../Meos/TLtTtextTextLogicalFunction.cpp | 128 + .../Meos/TNeTextTtextLogicalFunction.cpp | 128 + .../Meos/TNeTtextTextLogicalFunction.cpp | 128 + .../Meos/TandBoolTboolLogicalFunction.cpp | 47 +- .../Meos/TandTboolBoolLogicalFunction.cpp | 45 +- .../Meos/TandTboolTboolLogicalFunction.cpp | 60 +- .../Meos/TbigintScaleValueLogicalFunction.cpp | 43 +- .../TbigintShiftScaleValueLogicalFunction.cpp | 47 +- .../Meos/TbigintShiftValueLogicalFunction.cpp | 43 +- .../Meos/TbigintToTfloatLogicalFunction.cpp | 39 +- .../Meos/TbigintToTintLogicalFunction.cpp | 41 +- .../Meos/TboolToTintLogicalFunction.cpp | 41 +- .../TdistanceTfloatFloatLogicalFunction.cpp | 43 +- .../Meos/TdistanceTintIntLogicalFunction.cpp | 45 +- ...TdistanceTnumberTnumberLogicalFunction.cpp | 60 +- ...ContainsTNpointGeometryLogicalFunction.cpp | 131 + ...AContainsTNpointTNpointLogicalFunction.cpp | 137 + ...lAContainsTPoseGeometryLogicalFunction.cpp | 134 + ...oralAContainsTPoseTPoseLogicalFunction.cpp | 143 + ...ADWithinTNpointGeometryLogicalFunction.cpp | 134 + ...lADWithinTNpointTNpointLogicalFunction.cpp | 140 + ...alADWithinTPoseGeometryLogicalFunction.cpp | 137 + ...poralADWithinTPoseTPoseLogicalFunction.cpp | 146 + ...DisjointTNpointGeometryLogicalFunction.cpp | 131 + ...ADisjointTNpointTNpointLogicalFunction.cpp | 137 + ...lADisjointTPoseGeometryLogicalFunction.cpp | 134 + ...oralADisjointTPoseTPoseLogicalFunction.cpp | 143 + ...tersectsTNpointGeometryLogicalFunction.cpp | 131 + ...ntersectsTNpointTNpointLogicalFunction.cpp | 137 + ...IntersectsTPoseGeometryLogicalFunction.cpp | 134 + ...alAIntersectsTPoseTPoseLogicalFunction.cpp | 143 + ...ATouchesTNpointGeometryLogicalFunction.cpp | 131 + ...lATouchesTNpointTNpointLogicalFunction.cpp | 137 + ...alATouchesTPoseGeometryLogicalFunction.cpp | 134 + ...poralATouchesTPoseTPoseLogicalFunction.cpp | 143 + ...ContainsTNpointGeometryLogicalFunction.cpp | 131 + ...EContainsTNpointTNpointLogicalFunction.cpp | 137 + ...lEContainsTPoseGeometryLogicalFunction.cpp | 134 + ...oralEContainsTPoseTPoseLogicalFunction.cpp | 143 + ...lECoversTNpointGeometryLogicalFunction.cpp | 131 + ...alECoversTNpointTNpointLogicalFunction.cpp | 137 + ...ralECoversTPoseGeometryLogicalFunction.cpp | 134 + ...mporalECoversTPoseTPoseLogicalFunction.cpp | 143 + ...EDWithinTNpointGeometryLogicalFunction.cpp | 134 + ...lEDWithinTNpointTNpointLogicalFunction.cpp | 140 + ...alEDWithinTPoseGeometryLogicalFunction.cpp | 137 + ...poralEDWithinTPoseTPoseLogicalFunction.cpp | 146 + ...DisjointTNpointGeometryLogicalFunction.cpp | 131 + ...EDisjointTNpointTNpointLogicalFunction.cpp | 137 + ...lEDisjointTPoseGeometryLogicalFunction.cpp | 134 + ...oralEDisjointTPoseTPoseLogicalFunction.cpp | 143 + ...tersectsTNpointGeometryLogicalFunction.cpp | 131 + ...ntersectsTNpointTNpointLogicalFunction.cpp | 137 + ...IntersectsTPoseGeometryLogicalFunction.cpp | 134 + ...alEIntersectsTPoseTPoseLogicalFunction.cpp | 143 + ...ETouchesTNpointGeometryLogicalFunction.cpp | 131 + ...lETouchesTNpointTNpointLogicalFunction.cpp | 137 + ...alETouchesTPoseGeometryLogicalFunction.cpp | 134 + ...poralETouchesTPoseTPoseLogicalFunction.cpp | 143 + ...poralNADTNpointGeometryLogicalFunction.cpp | 131 + ...mporalNADTNpointTNpointLogicalFunction.cpp | 137 + ...emporalNADTPoseGeometryLogicalFunction.cpp | 134 + .../TemporalNADTPoseTPoseLogicalFunction.cpp | 143 + .../Meos/TemporalRoundLogicalFunction.cpp | 43 +- .../Meos/TeqBoolTboolLogicalFunction.cpp | 47 +- .../Meos/TeqTboolBoolLogicalFunction.cpp | 45 +- .../Meos/TextInitcapLogicalFunction.cpp | 93 +- .../Meos/TextLowerLogicalFunction.cpp | 93 +- .../Meos/TextUpperLogicalFunction.cpp | 93 +- .../Meos/TextcatTextTtextLogicalFunction.cpp | 43 +- .../Meos/TextcatTtextTextLogicalFunction.cpp | 43 +- .../Meos/TextcatTtextTtextLogicalFunction.cpp | 50 +- .../Meos/TfloatCeilLogicalFunction.cpp | 37 +- .../Meos/TfloatExpLogicalFunction.cpp | 37 +- .../Meos/TfloatFloorLogicalFunction.cpp | 37 +- .../Meos/TfloatLnLogicalFunction.cpp | 37 +- .../Meos/TfloatLog10LogicalFunction.cpp | 37 +- .../Meos/TfloatRadiansLogicalFunction.cpp | 37 +- .../Meos/TfloatScaleValueLogicalFunction.cpp | 43 +- .../TfloatShiftScaleValueLogicalFunction.cpp | 47 +- .../Meos/TfloatShiftValueLogicalFunction.cpp | 43 +- .../Meos/TfloatToTbigintLogicalFunction.cpp | 39 +- .../Meos/TfloatToTintLogicalFunction.cpp | 41 +- ...h3indexAreNeighborCellsLogicalFunction.cpp | 82 +- ...3indexCellToCenterChildLogicalFunction.cpp | 71 +- ...exCellToCenterChildNextLogicalFunction.cpp | 72 +- .../Th3indexCellToChildPosLogicalFunction.cpp | 71 +- .../Th3indexCellToParentLogicalFunction.cpp | 71 +- ...h3indexCellToParentNextLogicalFunction.cpp | 72 +- ...3indexGetBaseCellNumberLogicalFunction.cpp | 63 +- .../Th3indexGetResolutionLogicalFunction.cpp | 63 +- .../Th3indexGridDistanceLogicalFunction.cpp | 82 +- .../Th3indexIsPentagonLogicalFunction.cpp | 63 +- .../Th3indexIsValidCellLogicalFunction.cpp | 63 +- .../Meos/TintScaleValueLogicalFunction.cpp | 45 +- .../TintShiftScaleValueLogicalFunction.cpp | 49 +- .../Meos/TintShiftValueLogicalFunction.cpp | 45 +- .../Meos/TintToTbigintLogicalFunction.cpp | 39 +- .../Meos/TintToTfloatLogicalFunction.cpp | 39 +- .../Meos/TneBoolTboolLogicalFunction.cpp | 47 +- .../Meos/TneTboolBoolLogicalFunction.cpp | 45 +- .../Meos/TnotTboolLogicalFunction.cpp | 39 +- .../Meos/TorBoolTboolLogicalFunction.cpp | 47 +- .../Meos/TorTboolBoolLogicalFunction.cpp | 45 +- .../Meos/TorTboolTboolLogicalFunction.cpp | 60 +- .../Meos/TtextInitcapLogicalFunction.cpp | 39 +- .../Meos/TtextLowerLogicalFunction.cpp | 39 +- .../Meos/TtextUpperLogicalFunction.cpp | 39 +- ...AcontainsGeoTrgeometryPhysicalFunction.hpp | 32 + .../AcontainsTcbufferGeoPhysicalFunction.hpp | 17 +- ...ntainsTcbufferTcbufferPhysicalFunction.hpp | 48 + .../Meos/AcontainsTgeoGeoPhysicalFunction.hpp | 15 +- .../AcontainsTgeoTgeoPhysicalFunction.hpp | 18 +- .../AcoversGeoTrgeometryPhysicalFunction.hpp | 32 + .../AcoversTcbufferGeoPhysicalFunction.hpp | 17 +- ...coversTcbufferTcbufferPhysicalFunction.hpp | 21 +- .../Meos/AcoversTgeoGeoPhysicalFunction.hpp | 15 +- .../Meos/AcoversTgeoTgeoPhysicalFunction.hpp | 18 +- .../AcoversTrgeometryGeoPhysicalFunction.hpp | 32 + .../Meos/AddBigintTbigintPhysicalFunction.hpp | 8 +- .../Meos/AddFloatTfloatPhysicalFunction.hpp | 8 +- .../Meos/AddIntTintPhysicalFunction.hpp | 8 +- .../Meos/AddTbigintBigintPhysicalFunction.hpp | 6 +- .../Meos/AddTfloatFloatPhysicalFunction.hpp | 6 +- .../Meos/AddTintIntPhysicalFunction.hpp | 6 +- .../AddTnumberTnumberPhysicalFunction.hpp | 7 +- .../AdisjointTcbufferGeoPhysicalFunction.hpp | 17 +- ...sjointTcbufferTcbufferPhysicalFunction.hpp | 21 +- .../Meos/AdisjointTgeoGeoPhysicalFunction.hpp | 15 +- .../AdisjointTgeoTgeoPhysicalFunction.hpp | 18 +- ...AdisjointTrgeometryGeoPhysicalFunction.hpp | 32 + ...ntTrgeometryTrgeometryPhysicalFunction.hpp | 32 + ...dwithinTcbufferCbufferPhysicalFunction.hpp | 46 + .../AdwithinTcbufferGeoPhysicalFunction.hpp | 18 +- ...withinTcbufferTcbufferPhysicalFunction.hpp | 22 +- .../Meos/AdwithinTgeoGeoPhysicalFunction.hpp | 17 +- .../Meos/AdwithinTgeoTgeoPhysicalFunction.hpp | 19 +- .../AdwithinTrgeometryGeoPhysicalFunction.hpp | 32 + ...inTrgeometryTrgeometryPhysicalFunction.hpp | 32 + ...AintersectsTcbufferGeoPhysicalFunction.hpp | 17 +- ...rsectsTcbufferTcbufferPhysicalFunction.hpp | 21 +- .../AintersectsTgeoGeoPhysicalFunction.hpp | 15 +- .../AintersectsTgeoTgeoPhysicalFunction.hpp | 18 +- ...ntersectsTrgeometryGeoPhysicalFunction.hpp | 32 + ...tsTrgeometryTrgeometryPhysicalFunction.hpp | 32 + .../AlwaysEqBigintTbigintPhysicalFunction.hpp | 8 +- .../AlwaysEqBoolTboolPhysicalFunction.hpp | 8 +- .../AlwaysEqNpointTnpointPhysicalFunction.hpp | 17 +- .../AlwaysEqPoseTposePhysicalFunction.hpp | 19 +- .../AlwaysEqTbigintBigintPhysicalFunction.hpp | 6 +- .../AlwaysEqTboolBoolPhysicalFunction.hpp | 6 +- ...waysEqTcbufferTcbufferPhysicalFunction.hpp | 21 +- .../AlwaysEqTextTtextPhysicalFunction.hpp | 15 +- .../Meos/AlwaysEqTgeoGeoPhysicalFunction.hpp | 15 +- .../Meos/AlwaysEqTgeoTgeoPhysicalFunction.hpp | 18 +- ...lwaysEqTh3indexH3indexPhysicalFunction.hpp | 13 +- .../AlwaysEqTjsonbJsonbPhysicalFunction.hpp | 15 +- .../AlwaysEqTjsonbTjsonbPhysicalFunction.hpp | 16 +- .../AlwaysEqTnpointNpointPhysicalFunction.hpp | 17 +- ...AlwaysEqTnpointTnpointPhysicalFunction.hpp | 19 +- .../AlwaysEqTposePosePhysicalFunction.hpp | 19 +- .../AlwaysEqTposeTposePhysicalFunction.hpp | 23 +- ...lwaysEqTquadbinQuadbinPhysicalFunction.hpp | 15 +- .../AlwaysEqTtextTextPhysicalFunction.hpp | 13 +- .../AlwaysGeBigintTbigintPhysicalFunction.hpp | 8 +- .../AlwaysGeTbigintBigintPhysicalFunction.hpp | 6 +- .../AlwaysGeTextTtextPhysicalFunction.hpp | 15 +- .../AlwaysGeTtextTextPhysicalFunction.hpp | 13 +- .../AlwaysGtBigintTbigintPhysicalFunction.hpp | 8 +- .../AlwaysGtTbigintBigintPhysicalFunction.hpp | 6 +- .../AlwaysGtTextTtextPhysicalFunction.hpp | 15 +- .../AlwaysGtTtextTextPhysicalFunction.hpp | 13 +- .../AlwaysLeBigintTbigintPhysicalFunction.hpp | 8 +- .../AlwaysLeTbigintBigintPhysicalFunction.hpp | 6 +- .../AlwaysLeTextTtextPhysicalFunction.hpp | 15 +- .../AlwaysLeTtextTextPhysicalFunction.hpp | 13 +- .../AlwaysLtBigintTbigintPhysicalFunction.hpp | 8 +- .../AlwaysLtTbigintBigintPhysicalFunction.hpp | 6 +- .../AlwaysLtTextTtextPhysicalFunction.hpp | 15 +- .../AlwaysLtTtextTextPhysicalFunction.hpp | 13 +- .../AlwaysNeBigintTbigintPhysicalFunction.hpp | 8 +- .../AlwaysNeBoolTboolPhysicalFunction.hpp | 8 +- .../AlwaysNeNpointTnpointPhysicalFunction.hpp | 17 +- .../AlwaysNePoseTposePhysicalFunction.hpp | 19 +- .../AlwaysNeTbigintBigintPhysicalFunction.hpp | 6 +- .../AlwaysNeTboolBoolPhysicalFunction.hpp | 6 +- ...waysNeTcbufferTcbufferPhysicalFunction.hpp | 21 +- .../AlwaysNeTextTtextPhysicalFunction.hpp | 15 +- .../Meos/AlwaysNeTgeoGeoPhysicalFunction.hpp | 15 +- .../Meos/AlwaysNeTgeoTgeoPhysicalFunction.hpp | 18 +- ...lwaysNeTh3indexH3indexPhysicalFunction.hpp | 13 +- .../AlwaysNeTjsonbJsonbPhysicalFunction.hpp | 15 +- .../AlwaysNeTjsonbTjsonbPhysicalFunction.hpp | 16 +- .../AlwaysNeTnpointNpointPhysicalFunction.hpp | 17 +- ...AlwaysNeTnpointTnpointPhysicalFunction.hpp | 19 +- .../AlwaysNeTposePosePhysicalFunction.hpp | 19 +- .../AlwaysNeTposeTposePhysicalFunction.hpp | 23 +- ...lwaysNeTquadbinQuadbinPhysicalFunction.hpp | 15 +- .../AlwaysNeTtextTextPhysicalFunction.hpp | 13 +- .../AtouchesTcbufferGeoPhysicalFunction.hpp | 17 +- ...ouchesTcbufferTcbufferPhysicalFunction.hpp | 21 +- .../Meos/AtouchesTgeoGeoPhysicalFunction.hpp | 15 +- .../Meos/AtouchesTgeoTgeoPhysicalFunction.hpp | 18 +- .../AtouchesTrgeometryGeoPhysicalFunction.hpp | 32 + .../ContainedFloatSpanPhysicalFunction.hpp | 14 +- ...ContainedFloatspanSpanPhysicalFunction.hpp | 14 +- .../Meos/ContainedIntSpanPhysicalFunction.hpp | 14 +- .../ContainedSpanSpanPhysicalFunction.hpp | 14 +- .../ContainsFloatspanSpanPhysicalFunction.hpp | 14 +- .../ContainsSpanFloatPhysicalFunction.hpp | 14 +- .../Meos/ContainsSpanIntPhysicalFunction.hpp | 14 +- .../Meos/ContainsSpanSpanPhysicalFunction.hpp | 14 +- .../Meos/DivBigintTbigintPhysicalFunction.hpp | 8 +- .../Meos/DivFloatTfloatPhysicalFunction.hpp | 8 +- .../Meos/DivIntTintPhysicalFunction.hpp | 8 +- .../Meos/DivTbigintBigintPhysicalFunction.hpp | 6 +- .../Meos/DivTfloatFloatPhysicalFunction.hpp | 6 +- .../Meos/DivTintIntPhysicalFunction.hpp | 6 +- .../DivTnumberTnumberPhysicalFunction.hpp | 7 +- ...EcontainsGeoTrgeometryPhysicalFunction.hpp | 32 + .../EcontainsTcbufferGeoPhysicalFunction.hpp | 17 +- ...ntainsTcbufferTcbufferPhysicalFunction.hpp | 48 + .../Meos/EcontainsTgeoGeoPhysicalFunction.hpp | 15 +- .../EcontainsTgeoTgeoPhysicalFunction.hpp | 18 +- .../EcoversGeoTrgeometryPhysicalFunction.hpp | 32 + .../EcoversTcbufferGeoPhysicalFunction.hpp | 17 +- ...coversTcbufferTcbufferPhysicalFunction.hpp | 21 +- .../Meos/EcoversTgeoGeoPhysicalFunction.hpp | 44 + .../Meos/EcoversTgeoTgeoPhysicalFunction.hpp | 18 +- .../EcoversTrgeometryGeoPhysicalFunction.hpp | 32 + .../EdisjointTcbufferGeoPhysicalFunction.hpp | 17 +- ...sjointTcbufferTcbufferPhysicalFunction.hpp | 48 + .../Meos/EdisjointTgeoGeoPhysicalFunction.hpp | 44 + .../EdisjointTgeoTgeoPhysicalFunction.hpp | 18 +- ...EdisjointTrgeometryGeoPhysicalFunction.hpp | 32 + ...ntTrgeometryTrgeometryPhysicalFunction.hpp | 32 + ...dwithinTcbufferCbufferPhysicalFunction.hpp | 46 + .../EdwithinTcbufferGeoPhysicalFunction.hpp | 18 +- ...withinTcbufferTcbufferPhysicalFunction.hpp | 22 +- .../Meos/EdwithinTgeoGeoPhysicalFunction.hpp | 45 + .../Meos/EdwithinTgeoTgeoPhysicalFunction.hpp | 19 +- .../EdwithinTrgeometryGeoPhysicalFunction.hpp | 32 + ...inTrgeometryTrgeometryPhysicalFunction.hpp | 32 + ...EintersectsTcbufferGeoPhysicalFunction.hpp | 17 +- ...rsectsTcbufferTcbufferPhysicalFunction.hpp | 21 +- .../EintersectsTgeoGeoPhysicalFunction.hpp | 15 +- .../EintersectsTgeoTgeoPhysicalFunction.hpp | 18 +- ...ntersectsTrgeometryGeoPhysicalFunction.hpp | 32 + ...tsTrgeometryTrgeometryPhysicalFunction.hpp | 32 + .../EtouchesTcbufferGeoPhysicalFunction.hpp | 17 +- ...ouchesTcbufferTcbufferPhysicalFunction.hpp | 21 +- .../Meos/EtouchesTgeoGeoPhysicalFunction.hpp | 15 +- .../Meos/EtouchesTgeoTgeoPhysicalFunction.hpp | 18 +- .../EtouchesTrgeometryGeoPhysicalFunction.hpp | 32 + .../EverEqBigintTbigintPhysicalFunction.hpp | 8 +- .../Meos/EverEqBoolTboolPhysicalFunction.hpp | 8 +- .../EverEqNpointTnpointPhysicalFunction.hpp | 17 +- .../Meos/EverEqPoseTposePhysicalFunction.hpp | 19 +- .../EverEqTbigintBigintPhysicalFunction.hpp | 6 +- .../Meos/EverEqTboolBoolPhysicalFunction.hpp | 6 +- ...EverEqTcbufferTcbufferPhysicalFunction.hpp | 21 +- .../Meos/EverEqTextTtextPhysicalFunction.hpp | 15 +- .../Meos/EverEqTgeoGeoPhysicalFunction.hpp | 15 +- .../Meos/EverEqTgeoTgeoPhysicalFunction.hpp | 18 +- .../EverEqTh3indexH3indexPhysicalFunction.hpp | 13 +- .../EverEqTjsonbJsonbPhysicalFunction.hpp | 15 +- .../EverEqTjsonbTjsonbPhysicalFunction.hpp | 16 +- .../EverEqTnpointNpointPhysicalFunction.hpp | 17 +- .../EverEqTnpointTnpointPhysicalFunction.hpp | 19 +- .../Meos/EverEqTposePosePhysicalFunction.hpp | 19 +- .../Meos/EverEqTposeTposePhysicalFunction.hpp | 23 +- .../EverEqTquadbinQuadbinPhysicalFunction.hpp | 15 +- .../Meos/EverEqTtextTextPhysicalFunction.hpp | 13 +- .../EverGeBigintTbigintPhysicalFunction.hpp | 8 +- .../EverGeTbigintBigintPhysicalFunction.hpp | 6 +- .../Meos/EverGeTextTtextPhysicalFunction.hpp | 15 +- .../Meos/EverGeTtextTextPhysicalFunction.hpp | 13 +- .../EverGtBigintTbigintPhysicalFunction.hpp | 8 +- .../EverGtTbigintBigintPhysicalFunction.hpp | 6 +- .../Meos/EverGtTextTtextPhysicalFunction.hpp | 15 +- .../Meos/EverGtTtextTextPhysicalFunction.hpp | 13 +- .../EverLeBigintTbigintPhysicalFunction.hpp | 8 +- .../EverLeTbigintBigintPhysicalFunction.hpp | 6 +- .../Meos/EverLeTextTtextPhysicalFunction.hpp | 15 +- .../Meos/EverLeTtextTextPhysicalFunction.hpp | 13 +- .../EverLtBigintTbigintPhysicalFunction.hpp | 8 +- .../EverLtTbigintBigintPhysicalFunction.hpp | 6 +- .../Meos/EverLtTextTtextPhysicalFunction.hpp | 15 +- .../Meos/EverLtTtextTextPhysicalFunction.hpp | 13 +- .../EverNeBigintTbigintPhysicalFunction.hpp | 8 +- .../Meos/EverNeBoolTboolPhysicalFunction.hpp | 8 +- .../EverNeNpointTnpointPhysicalFunction.hpp | 17 +- .../Meos/EverNePoseTposePhysicalFunction.hpp | 19 +- .../EverNeTbigintBigintPhysicalFunction.hpp | 6 +- .../Meos/EverNeTboolBoolPhysicalFunction.hpp | 6 +- ...EverNeTcbufferTcbufferPhysicalFunction.hpp | 21 +- .../Meos/EverNeTextTtextPhysicalFunction.hpp | 15 +- .../Meos/EverNeTgeoGeoPhysicalFunction.hpp | 15 +- .../Meos/EverNeTgeoTgeoPhysicalFunction.hpp | 18 +- .../EverNeTh3indexH3indexPhysicalFunction.hpp | 13 +- .../EverNeTjsonbJsonbPhysicalFunction.hpp | 15 +- .../EverNeTjsonbTjsonbPhysicalFunction.hpp | 16 +- .../EverNeTnpointNpointPhysicalFunction.hpp | 17 +- .../EverNeTnpointTnpointPhysicalFunction.hpp | 19 +- .../Meos/EverNeTposePosePhysicalFunction.hpp | 19 +- .../Meos/EverNeTposeTposePhysicalFunction.hpp | 23 +- .../EverNeTquadbinQuadbinPhysicalFunction.hpp | 15 +- .../Meos/EverNeTtextTextPhysicalFunction.hpp | 13 +- .../FloatspanLowerIncPhysicalFunction.hpp | 13 +- .../Meos/FloatspanLowerPhysicalFunction.hpp | 13 +- .../FloatspanUpperIncPhysicalFunction.hpp | 13 +- .../Meos/FloatspanUpperPhysicalFunction.hpp | 13 +- .../Meos/FloatspanWidthPhysicalFunction.hpp | 13 +- .../Meos/GeoAsEwktPhysicalFunction.hpp | 14 +- .../Meos/GeoAsGeojsonPhysicalFunction.hpp | 15 +- .../Meos/GeoEqualsPhysicalFunction.hpp | 12 +- .../Meos/GeoGeoNPhysicalFunction.hpp | 14 +- .../Meos/GeoIsUnitaryPhysicalFunction.hpp | 11 +- .../Meos/GeoNumGeosPhysicalFunction.hpp | 11 +- .../Meos/GeoNumPointsPhysicalFunction.hpp | 11 +- .../Meos/GeoPointsPhysicalFunction.hpp | 13 +- .../Meos/GeoReversePhysicalFunction.hpp | 13 +- .../Meos/GeoRoundPhysicalFunction.hpp | 14 +- .../Meos/GeoSamePhysicalFunction.hpp | 12 +- .../Meos/GeoSetSridPhysicalFunction.hpp | 14 +- .../Meos/GeoSridPhysicalFunction.hpp | 11 +- .../Meos/GeoTransformPhysicalFunction.hpp | 14 +- .../Meos/GeogAreaPhysicalFunction.hpp | 11 +- .../Meos/GeogCentroidPhysicalFunction.hpp | 14 +- .../Meos/GeogDistancePhysicalFunction.hpp | 12 +- .../Meos/GeogDwithinPhysicalFunction.hpp | 13 +- .../Meos/GeogIntersectsPhysicalFunction.hpp | 12 +- .../Meos/GeogLengthPhysicalFunction.hpp | 11 +- .../Meos/GeogPerimeterPhysicalFunction.hpp | 11 +- .../Meos/GeogPointMake2dPhysicalFunction.hpp | 15 +- .../Meos/GeogPointMake3dzPhysicalFunction.hpp | 16 +- .../Meos/GeogToGeomPhysicalFunction.hpp | 13 +- .../Meos/GeomAzimuthPhysicalFunction.hpp | 11 +- .../Meos/GeomBoundaryPhysicalFunction.hpp | 13 +- .../Meos/GeomCentroidPhysicalFunction.hpp | 13 +- .../Meos/GeomContainsPhysicalFunction.hpp | 12 +- .../Meos/GeomConvexHullPhysicalFunction.hpp | 13 +- .../Meos/GeomCoversPhysicalFunction.hpp | 12 +- .../Meos/GeomDifference2dPhysicalFunction.hpp | 14 +- .../Meos/GeomDisjoint2dPhysicalFunction.hpp | 12 +- .../Meos/GeomDistance2dPhysicalFunction.hpp | 12 +- .../Meos/GeomDistance3dPhysicalFunction.hpp | 12 +- .../Meos/GeomDwithin2dPhysicalFunction.hpp | 13 +- .../Meos/GeomDwithin3dPhysicalFunction.hpp | 13 +- .../Meos/GeomDwithinPhysicalFunction.hpp | 13 +- ...GeomIntersection2dCollPhysicalFunction.hpp | 14 +- .../GeomIntersection2dPhysicalFunction.hpp | 14 +- .../Meos/GeomIntersects2dPhysicalFunction.hpp | 12 +- .../Meos/GeomIntersects3dPhysicalFunction.hpp | 12 +- .../Meos/GeomIntersectsPhysicalFunction.hpp | 12 +- .../Meos/GeomIsEmptyPhysicalFunction.hpp | 11 +- .../Meos/GeomLengthPhysicalFunction.hpp | 11 +- .../Meos/GeomPerimeterPhysicalFunction.hpp | 11 +- .../Meos/GeomPointMake2dPhysicalFunction.hpp | 15 +- .../Meos/GeomPointMake3dzPhysicalFunction.hpp | 16 +- .../GeomShortestline2dPhysicalFunction.hpp | 14 +- .../GeomShortestline3dPhysicalFunction.hpp | 14 +- .../Meos/GeomToGeogPhysicalFunction.hpp | 13 +- .../Meos/GeomTouchesPhysicalFunction.hpp | 12 +- .../Meos/GeomUnaryUnionPhysicalFunction.hpp | 13 +- .../Meos/H3indexCmpPhysicalFunction.hpp | 14 +- .../Meos/H3indexEqPhysicalFunction.hpp | 14 +- .../Meos/H3indexGePhysicalFunction.hpp | 14 +- .../Meos/H3indexGtPhysicalFunction.hpp | 14 +- .../Meos/H3indexLePhysicalFunction.hpp | 14 +- .../Meos/H3indexLtPhysicalFunction.hpp | 14 +- .../Meos/H3indexNePhysicalFunction.hpp | 14 +- .../Meos/H3indexOutPhysicalFunction.hpp | 13 +- .../Meos/IntspanLowerIncPhysicalFunction.hpp | 13 +- .../Meos/IntspanLowerPhysicalFunction.hpp | 13 +- .../Meos/IntspanUpperIncPhysicalFunction.hpp | 13 +- .../Meos/IntspanUpperPhysicalFunction.hpp | 13 +- .../Meos/IntspanWidthPhysicalFunction.hpp | 13 +- .../JsonbArrayElementTextPhysicalFunction.hpp | 14 +- .../Meos/JsonbArrayLengthPhysicalFunction.hpp | 13 +- .../Meos/JsonbCmpPhysicalFunction.hpp | 14 +- .../Meos/JsonbContainedPhysicalFunction.hpp | 14 +- .../Meos/JsonbContainsPhysicalFunction.hpp | 14 +- .../Meos/JsonbEqPhysicalFunction.hpp | 14 +- .../Meos/JsonbExistsPhysicalFunction.hpp | 14 +- .../Meos/JsonbGePhysicalFunction.hpp | 14 +- .../Meos/JsonbGtPhysicalFunction.hpp | 14 +- .../Meos/JsonbLePhysicalFunction.hpp | 14 +- .../Meos/JsonbLtPhysicalFunction.hpp | 14 +- .../Meos/JsonbNePhysicalFunction.hpp | 14 +- .../JsonbObjectFieldTextPhysicalFunction.hpp | 14 +- .../Meos/JsonbPrettyPhysicalFunction.hpp | 13 +- .../Meos/JsonbToCstringPhysicalFunction.hpp | 13 +- .../LineInterpolatePointPhysicalFunction.hpp | 14 +- .../Meos/LineLocatePointPhysicalFunction.hpp | 14 +- .../Meos/LineNumpointsPhysicalFunction.hpp | 13 +- .../Meos/LinePointNPhysicalFunction.hpp | 14 +- .../Meos/LineSubstringPhysicalFunction.hpp | 15 +- ...stanceTcbufferTcbufferPhysicalFunction.hpp | 22 +- .../Meos/MulBigintTbigintPhysicalFunction.hpp | 8 +- .../Meos/MulFloatTfloatPhysicalFunction.hpp | 8 +- .../Meos/MulIntTintPhysicalFunction.hpp | 8 +- .../Meos/MulTbigintBigintPhysicalFunction.hpp | 6 +- .../Meos/MulTfloatFloatPhysicalFunction.hpp | 6 +- .../Meos/MulTintIntPhysicalFunction.hpp | 6 +- .../MulTnumberTnumberPhysicalFunction.hpp | 7 +- .../Meos/NadTcbufferGeoPhysicalFunction.hpp | 17 +- .../NadTcbufferTcbufferPhysicalFunction.hpp | 21 +- .../Meos/NadTgeoGeoPhysicalFunction.hpp | 15 +- .../Meos/NadTgeoTgeoPhysicalFunction.hpp | 46 + .../Meos/NadTnpointGeoPhysicalFunction.hpp | 16 +- .../Meos/NadTnpointNpointPhysicalFunction.hpp | 17 +- .../NadTnpointTnpointPhysicalFunction.hpp | 19 +- .../Meos/NadTposeGeoPhysicalFunction.hpp | 17 +- .../Meos/NadTposePosePhysicalFunction.hpp | 19 +- .../Meos/NadTposeTposePhysicalFunction.hpp | 23 +- .../Meos/QuadbinCellAreaPhysicalFunction.hpp | 13 +- .../QuadbinCellToParentPhysicalFunction.hpp | 14 +- .../QuadbinCellToQuadkeyPhysicalFunction.hpp | 13 +- .../Meos/QuadbinCmpPhysicalFunction.hpp | 14 +- .../Meos/QuadbinEqPhysicalFunction.hpp | 14 +- .../Meos/QuadbinGePhysicalFunction.hpp | 14 +- .../QuadbinGetResolutionPhysicalFunction.hpp | 13 +- .../Meos/QuadbinGtPhysicalFunction.hpp | 14 +- .../QuadbinIsValidCellPhysicalFunction.hpp | 13 +- .../Meos/QuadbinLePhysicalFunction.hpp | 14 +- .../Meos/QuadbinLtPhysicalFunction.hpp | 14 +- .../Meos/QuadbinNePhysicalFunction.hpp | 14 +- .../QuadbinPointToCellPhysicalFunction.hpp | 15 +- .../QuadbinTileToCellPhysicalFunction.hpp | 15 +- .../Meos/SubBigintTbigintPhysicalFunction.hpp | 8 +- .../Meos/SubFloatTfloatPhysicalFunction.hpp | 8 +- .../Meos/SubIntTintPhysicalFunction.hpp | 8 +- .../Meos/SubTbigintBigintPhysicalFunction.hpp | 6 +- .../Meos/SubTfloatFloatPhysicalFunction.hpp | 6 +- .../Meos/SubTintIntPhysicalFunction.hpp | 6 +- .../SubTnumberTnumberPhysicalFunction.hpp | 7 +- .../Meos/TEqTextTtextPhysicalFunction.hpp | 43 + .../Meos/TEqTtextTextPhysicalFunction.hpp | 43 + .../Meos/TGeTextTtextPhysicalFunction.hpp | 43 + .../Meos/TGeTtextTextPhysicalFunction.hpp | 43 + .../Meos/TGtTextTtextPhysicalFunction.hpp | 43 + .../Meos/TGtTtextTextPhysicalFunction.hpp | 43 + .../Meos/TLeTextTtextPhysicalFunction.hpp | 43 + .../Meos/TLeTtextTextPhysicalFunction.hpp | 43 + .../Meos/TLtTextTtextPhysicalFunction.hpp | 43 + .../Meos/TLtTtextTextPhysicalFunction.hpp | 43 + .../Meos/TNeTextTtextPhysicalFunction.hpp | 43 + .../Meos/TNeTtextTextPhysicalFunction.hpp | 43 + .../Meos/TandBoolTboolPhysicalFunction.hpp | 8 +- .../Meos/TandTboolBoolPhysicalFunction.hpp | 6 +- .../Meos/TandTboolTboolPhysicalFunction.hpp | 7 +- .../TbigintScaleValuePhysicalFunction.hpp | 7 +- ...TbigintShiftScaleValuePhysicalFunction.hpp | 9 +- .../TbigintShiftValuePhysicalFunction.hpp | 7 +- .../Meos/TbigintToTfloatPhysicalFunction.hpp | 4 +- .../Meos/TbigintToTintPhysicalFunction.hpp | 4 +- .../Meos/TboolToTintPhysicalFunction.hpp | 4 +- .../TdistanceTfloatFloatPhysicalFunction.hpp | 6 +- .../Meos/TdistanceTintIntPhysicalFunction.hpp | 7 +- ...distanceTnumberTnumberPhysicalFunction.hpp | 7 +- ...ontainsTNpointGeometryPhysicalFunction.hpp | 44 + ...ContainsTNpointTNpointPhysicalFunction.hpp | 46 + ...AContainsTPoseGeometryPhysicalFunction.hpp | 45 + ...ralAContainsTPoseTPosePhysicalFunction.hpp | 48 + ...DWithinTNpointGeometryPhysicalFunction.hpp | 45 + ...ADWithinTNpointTNpointPhysicalFunction.hpp | 47 + ...lADWithinTPoseGeometryPhysicalFunction.hpp | 46 + ...oralADWithinTPoseTPosePhysicalFunction.hpp | 49 + ...isjointTNpointGeometryPhysicalFunction.hpp | 44 + ...DisjointTNpointTNpointPhysicalFunction.hpp | 46 + ...ADisjointTPoseGeometryPhysicalFunction.hpp | 45 + ...ralADisjointTPoseTPosePhysicalFunction.hpp | 48 + ...ersectsTNpointGeometryPhysicalFunction.hpp | 44 + ...tersectsTNpointTNpointPhysicalFunction.hpp | 46 + ...ntersectsTPoseGeometryPhysicalFunction.hpp | 45 + ...lAIntersectsTPoseTPosePhysicalFunction.hpp | 48 + ...TouchesTNpointGeometryPhysicalFunction.hpp | 44 + ...ATouchesTNpointTNpointPhysicalFunction.hpp | 46 + ...lATouchesTPoseGeometryPhysicalFunction.hpp | 45 + ...oralATouchesTPoseTPosePhysicalFunction.hpp | 48 + ...ontainsTNpointGeometryPhysicalFunction.hpp | 44 + ...ContainsTNpointTNpointPhysicalFunction.hpp | 46 + ...EContainsTPoseGeometryPhysicalFunction.hpp | 45 + ...ralEContainsTPoseTPosePhysicalFunction.hpp | 48 + ...ECoversTNpointGeometryPhysicalFunction.hpp | 44 + ...lECoversTNpointTNpointPhysicalFunction.hpp | 46 + ...alECoversTPoseGeometryPhysicalFunction.hpp | 45 + ...poralECoversTPoseTPosePhysicalFunction.hpp | 48 + ...DWithinTNpointGeometryPhysicalFunction.hpp | 45 + ...EDWithinTNpointTNpointPhysicalFunction.hpp | 47 + ...lEDWithinTPoseGeometryPhysicalFunction.hpp | 46 + ...oralEDWithinTPoseTPosePhysicalFunction.hpp | 49 + ...isjointTNpointGeometryPhysicalFunction.hpp | 44 + ...DisjointTNpointTNpointPhysicalFunction.hpp | 46 + ...EDisjointTPoseGeometryPhysicalFunction.hpp | 45 + ...ralEDisjointTPoseTPosePhysicalFunction.hpp | 48 + ...ersectsTNpointGeometryPhysicalFunction.hpp | 44 + ...tersectsTNpointTNpointPhysicalFunction.hpp | 46 + ...ntersectsTPoseGeometryPhysicalFunction.hpp | 45 + ...lEIntersectsTPoseTPosePhysicalFunction.hpp | 48 + ...TouchesTNpointGeometryPhysicalFunction.hpp | 44 + ...ETouchesTNpointTNpointPhysicalFunction.hpp | 46 + ...lETouchesTPoseGeometryPhysicalFunction.hpp | 45 + ...oralETouchesTPoseTPosePhysicalFunction.hpp | 48 + ...oralNADTNpointGeometryPhysicalFunction.hpp | 44 + ...poralNADTNpointTNpointPhysicalFunction.hpp | 46 + ...mporalNADTPoseGeometryPhysicalFunction.hpp | 45 + .../TemporalNADTPoseTPosePhysicalFunction.hpp | 48 + .../Meos/TemporalRoundPhysicalFunction.hpp | 6 +- .../Meos/TeqBoolTboolPhysicalFunction.hpp | 8 +- .../Meos/TeqTboolBoolPhysicalFunction.hpp | 6 +- .../Meos/TextInitcapPhysicalFunction.hpp | 13 +- .../Meos/TextLowerPhysicalFunction.hpp | 13 +- .../Meos/TextUpperPhysicalFunction.hpp | 13 +- .../Meos/TextcatTextTtextPhysicalFunction.hpp | 13 +- .../Meos/TextcatTtextTextPhysicalFunction.hpp | 13 +- .../TextcatTtextTtextPhysicalFunction.hpp | 14 +- .../Meos/TfloatScaleValuePhysicalFunction.hpp | 7 +- .../TfloatShiftScaleValuePhysicalFunction.hpp | 8 +- .../Meos/TfloatShiftValuePhysicalFunction.hpp | 7 +- .../Meos/TfloatToTbigintPhysicalFunction.hpp | 4 +- .../Meos/TfloatToTintPhysicalFunction.hpp | 4 +- ...3indexAreNeighborCellsPhysicalFunction.hpp | 15 +- ...xCellToCenterChildNextPhysicalFunction.hpp | 13 +- ...indexCellToCenterChildPhysicalFunction.hpp | 13 +- ...Th3indexCellToChildPosPhysicalFunction.hpp | 13 +- ...3indexCellToParentNextPhysicalFunction.hpp | 13 +- .../Th3indexCellToParentPhysicalFunction.hpp | 13 +- ...indexGetBaseCellNumberPhysicalFunction.hpp | 12 +- .../Th3indexGetResolutionPhysicalFunction.hpp | 12 +- .../Th3indexGridDistancePhysicalFunction.hpp | 15 +- .../Th3indexIsPentagonPhysicalFunction.hpp | 12 +- .../Th3indexIsValidCellPhysicalFunction.hpp | 12 +- .../Meos/TintScaleValuePhysicalFunction.hpp | 7 +- .../TintShiftScaleValuePhysicalFunction.hpp | 9 +- .../Meos/TintShiftValuePhysicalFunction.hpp | 7 +- .../Meos/TintToTbigintPhysicalFunction.hpp | 4 +- .../Meos/TintToTfloatPhysicalFunction.hpp | 4 +- .../Meos/TneBoolTboolPhysicalFunction.hpp | 8 +- .../Meos/TneTboolBoolPhysicalFunction.hpp | 6 +- .../Meos/TnotTboolPhysicalFunction.hpp | 2 +- .../Meos/TorBoolTboolPhysicalFunction.hpp | 8 +- .../Meos/TorTboolBoolPhysicalFunction.hpp | 6 +- .../Meos/TorTboolTboolPhysicalFunction.hpp | 7 +- .../Meos/TtextInitcapPhysicalFunction.hpp | 11 +- .../Meos/TtextLowerPhysicalFunction.hpp | 11 +- .../Meos/TtextUpperPhysicalFunction.hpp | 11 +- ...AcontainsGeoTrgeometryPhysicalFunction.cpp | 97 + .../AcontainsTcbufferGeoPhysicalFunction.cpp | 119 +- ...ntainsTcbufferTcbufferPhysicalFunction.cpp | 127 + .../Meos/AcontainsTgeoGeoPhysicalFunction.cpp | 95 +- .../AcontainsTgeoTgeoPhysicalFunction.cpp | 98 +- .../AcoversGeoTrgeometryPhysicalFunction.cpp | 97 + .../AcoversTcbufferGeoPhysicalFunction.cpp | 119 +- ...coversTcbufferTcbufferPhysicalFunction.cpp | 129 +- .../Meos/AcoversTgeoGeoPhysicalFunction.cpp | 95 +- .../Meos/AcoversTgeoTgeoPhysicalFunction.cpp | 98 +- .../AcoversTrgeometryGeoPhysicalFunction.cpp | 97 + .../Meos/AddBigintTbigintPhysicalFunction.cpp | 39 +- .../Meos/AddFloatTfloatPhysicalFunction.cpp | 34 +- .../Meos/AddIntTintPhysicalFunction.cpp | 42 +- .../Meos/AddTbigintBigintPhysicalFunction.cpp | 37 +- .../Meos/AddTfloatFloatPhysicalFunction.cpp | 32 +- .../Meos/AddTintIntPhysicalFunction.cpp | 40 +- .../AddTnumberTnumberPhysicalFunction.cpp | 92 +- .../AdisjointTcbufferGeoPhysicalFunction.cpp | 119 +- ...sjointTcbufferTcbufferPhysicalFunction.cpp | 129 +- .../Meos/AdisjointTgeoGeoPhysicalFunction.cpp | 95 +- .../AdisjointTgeoTgeoPhysicalFunction.cpp | 98 +- ...AdisjointTrgeometryGeoPhysicalFunction.cpp | 97 + ...ntTrgeometryTrgeometryPhysicalFunction.cpp | 114 + ...dwithinTcbufferCbufferPhysicalFunction.cpp | 126 + .../AdwithinTcbufferGeoPhysicalFunction.cpp | 122 +- ...withinTcbufferTcbufferPhysicalFunction.cpp | 139 +- .../Meos/AdwithinTgeoGeoPhysicalFunction.cpp | 100 +- .../Meos/AdwithinTgeoTgeoPhysicalFunction.cpp | 109 +- .../AdwithinTrgeometryGeoPhysicalFunction.cpp | 100 + ...inTrgeometryTrgeometryPhysicalFunction.cpp | 117 + ...AintersectsTcbufferGeoPhysicalFunction.cpp | 119 +- ...rsectsTcbufferTcbufferPhysicalFunction.cpp | 129 +- .../AintersectsTgeoGeoPhysicalFunction.cpp | 95 +- .../AintersectsTgeoTgeoPhysicalFunction.cpp | 98 +- ...ntersectsTrgeometryGeoPhysicalFunction.cpp | 97 + ...tsTrgeometryTrgeometryPhysicalFunction.cpp | 114 + .../AlwaysEqBigintTbigintPhysicalFunction.cpp | 43 +- .../AlwaysEqBoolTboolPhysicalFunction.cpp | 43 +- .../AlwaysEqNpointTnpointPhysicalFunction.cpp | 94 +- .../AlwaysEqPoseTposePhysicalFunction.cpp | 109 +- .../AlwaysEqTbigintBigintPhysicalFunction.cpp | 36 +- .../AlwaysEqTboolBoolPhysicalFunction.cpp | 41 +- ...waysEqTcbufferTcbufferPhysicalFunction.cpp | 129 +- .../AlwaysEqTextTtextPhysicalFunction.cpp | 78 +- .../Meos/AlwaysEqTgeoGeoPhysicalFunction.cpp | 95 +- .../Meos/AlwaysEqTgeoTgeoPhysicalFunction.cpp | 98 +- ...lwaysEqTh3indexH3indexPhysicalFunction.cpp | 63 +- .../AlwaysEqTjsonbJsonbPhysicalFunction.cpp | 84 +- .../AlwaysEqTjsonbTjsonbPhysicalFunction.cpp | 98 +- .../AlwaysEqTnpointNpointPhysicalFunction.cpp | 94 +- ...AlwaysEqTnpointTnpointPhysicalFunction.cpp | 106 +- .../AlwaysEqTposePosePhysicalFunction.cpp | 109 +- .../AlwaysEqTposeTposePhysicalFunction.cpp | 121 +- ...lwaysEqTquadbinQuadbinPhysicalFunction.cpp | 70 +- .../AlwaysEqTtextTextPhysicalFunction.cpp | 78 +- .../AlwaysGeBigintTbigintPhysicalFunction.cpp | 43 +- .../AlwaysGeTbigintBigintPhysicalFunction.cpp | 36 +- .../AlwaysGeTextTtextPhysicalFunction.cpp | 78 +- .../AlwaysGeTtextTextPhysicalFunction.cpp | 78 +- .../AlwaysGtBigintTbigintPhysicalFunction.cpp | 43 +- .../AlwaysGtTbigintBigintPhysicalFunction.cpp | 36 +- .../AlwaysGtTextTtextPhysicalFunction.cpp | 78 +- .../AlwaysGtTtextTextPhysicalFunction.cpp | 78 +- .../AlwaysLeBigintTbigintPhysicalFunction.cpp | 43 +- .../AlwaysLeTbigintBigintPhysicalFunction.cpp | 36 +- .../AlwaysLeTextTtextPhysicalFunction.cpp | 78 +- .../AlwaysLeTtextTextPhysicalFunction.cpp | 78 +- .../AlwaysLtBigintTbigintPhysicalFunction.cpp | 43 +- .../AlwaysLtTbigintBigintPhysicalFunction.cpp | 36 +- .../AlwaysLtTextTtextPhysicalFunction.cpp | 78 +- .../AlwaysLtTtextTextPhysicalFunction.cpp | 78 +- .../AlwaysNeBigintTbigintPhysicalFunction.cpp | 43 +- .../AlwaysNeBoolTboolPhysicalFunction.cpp | 43 +- .../AlwaysNeNpointTnpointPhysicalFunction.cpp | 94 +- .../AlwaysNePoseTposePhysicalFunction.cpp | 109 +- .../AlwaysNeTbigintBigintPhysicalFunction.cpp | 36 +- .../AlwaysNeTboolBoolPhysicalFunction.cpp | 41 +- ...waysNeTcbufferTcbufferPhysicalFunction.cpp | 129 +- .../AlwaysNeTextTtextPhysicalFunction.cpp | 78 +- .../Meos/AlwaysNeTgeoGeoPhysicalFunction.cpp | 95 +- .../Meos/AlwaysNeTgeoTgeoPhysicalFunction.cpp | 98 +- ...lwaysNeTh3indexH3indexPhysicalFunction.cpp | 63 +- .../AlwaysNeTjsonbJsonbPhysicalFunction.cpp | 84 +- .../AlwaysNeTjsonbTjsonbPhysicalFunction.cpp | 98 +- .../AlwaysNeTnpointNpointPhysicalFunction.cpp | 94 +- ...AlwaysNeTnpointTnpointPhysicalFunction.cpp | 106 +- .../AlwaysNeTposePosePhysicalFunction.cpp | 109 +- .../AlwaysNeTposeTposePhysicalFunction.cpp | 121 +- ...lwaysNeTquadbinQuadbinPhysicalFunction.cpp | 70 +- .../AlwaysNeTtextTextPhysicalFunction.cpp | 78 +- .../AtouchesTcbufferGeoPhysicalFunction.cpp | 119 +- ...ouchesTcbufferTcbufferPhysicalFunction.cpp | 129 +- .../Meos/AtouchesTgeoGeoPhysicalFunction.cpp | 95 +- .../Meos/AtouchesTgeoTgeoPhysicalFunction.cpp | 98 +- .../AtouchesTrgeometryGeoPhysicalFunction.cpp | 97 + .../src/Functions/Meos/CMakeLists.txt | 96 + .../ContainedFloatSpanPhysicalFunction.cpp | 65 +- ...ContainedFloatspanSpanPhysicalFunction.cpp | 73 +- .../Meos/ContainedIntSpanPhysicalFunction.cpp | 65 +- .../ContainedSpanSpanPhysicalFunction.cpp | 73 +- .../ContainsFloatspanSpanPhysicalFunction.cpp | 73 +- .../ContainsSpanFloatPhysicalFunction.cpp | 65 +- .../Meos/ContainsSpanIntPhysicalFunction.cpp | 65 +- .../Meos/ContainsSpanSpanPhysicalFunction.cpp | 73 +- .../Meos/DivBigintTbigintPhysicalFunction.cpp | 39 +- .../Meos/DivFloatTfloatPhysicalFunction.cpp | 34 +- .../Meos/DivIntTintPhysicalFunction.cpp | 42 +- .../Meos/DivTbigintBigintPhysicalFunction.cpp | 37 +- .../Meos/DivTfloatFloatPhysicalFunction.cpp | 32 +- .../Meos/DivTintIntPhysicalFunction.cpp | 40 +- .../DivTnumberTnumberPhysicalFunction.cpp | 92 +- ...EcontainsGeoTrgeometryPhysicalFunction.cpp | 97 + .../EcontainsTcbufferGeoPhysicalFunction.cpp | 119 +- ...ntainsTcbufferTcbufferPhysicalFunction.cpp | 127 + .../Meos/EcontainsTgeoGeoPhysicalFunction.cpp | 95 +- .../EcontainsTgeoTgeoPhysicalFunction.cpp | 98 +- .../EcoversGeoTrgeometryPhysicalFunction.cpp | 97 + .../EcoversTcbufferGeoPhysicalFunction.cpp | 119 +- ...coversTcbufferTcbufferPhysicalFunction.cpp | 129 +- .../Meos/EcoversTgeoGeoPhysicalFunction.cpp | 124 + .../Meos/EcoversTgeoTgeoPhysicalFunction.cpp | 98 +- .../EcoversTrgeometryGeoPhysicalFunction.cpp | 97 + .../EdisjointTcbufferGeoPhysicalFunction.cpp | 119 +- ...sjointTcbufferTcbufferPhysicalFunction.cpp | 127 + .../Meos/EdisjointTgeoGeoPhysicalFunction.cpp | 124 + .../EdisjointTgeoTgeoPhysicalFunction.cpp | 98 +- ...EdisjointTrgeometryGeoPhysicalFunction.cpp | 97 + ...ntTrgeometryTrgeometryPhysicalFunction.cpp | 114 + ...dwithinTcbufferCbufferPhysicalFunction.cpp | 126 + .../EdwithinTcbufferGeoPhysicalFunction.cpp | 122 +- ...withinTcbufferTcbufferPhysicalFunction.cpp | 139 +- .../Meos/EdwithinTgeoGeoPhysicalFunction.cpp | 125 + .../Meos/EdwithinTgeoTgeoPhysicalFunction.cpp | 109 +- .../EdwithinTrgeometryGeoPhysicalFunction.cpp | 100 + ...inTrgeometryTrgeometryPhysicalFunction.cpp | 117 + ...EintersectsTcbufferGeoPhysicalFunction.cpp | 119 +- ...rsectsTcbufferTcbufferPhysicalFunction.cpp | 129 +- .../EintersectsTgeoGeoPhysicalFunction.cpp | 95 +- .../EintersectsTgeoTgeoPhysicalFunction.cpp | 98 +- ...ntersectsTrgeometryGeoPhysicalFunction.cpp | 97 + ...tsTrgeometryTrgeometryPhysicalFunction.cpp | 114 + .../EtouchesTcbufferGeoPhysicalFunction.cpp | 119 +- ...ouchesTcbufferTcbufferPhysicalFunction.cpp | 129 +- .../Meos/EtouchesTgeoGeoPhysicalFunction.cpp | 95 +- .../Meos/EtouchesTgeoTgeoPhysicalFunction.cpp | 98 +- .../EtouchesTrgeometryGeoPhysicalFunction.cpp | 97 + .../EverEqBigintTbigintPhysicalFunction.cpp | 43 +- .../Meos/EverEqBoolTboolPhysicalFunction.cpp | 43 +- .../EverEqNpointTnpointPhysicalFunction.cpp | 94 +- .../Meos/EverEqPoseTposePhysicalFunction.cpp | 109 +- .../EverEqTbigintBigintPhysicalFunction.cpp | 36 +- .../Meos/EverEqTboolBoolPhysicalFunction.cpp | 41 +- ...EverEqTcbufferTcbufferPhysicalFunction.cpp | 129 +- .../Meos/EverEqTextTtextPhysicalFunction.cpp | 78 +- .../Meos/EverEqTgeoGeoPhysicalFunction.cpp | 95 +- .../Meos/EverEqTgeoTgeoPhysicalFunction.cpp | 98 +- .../EverEqTh3indexH3indexPhysicalFunction.cpp | 63 +- .../EverEqTjsonbJsonbPhysicalFunction.cpp | 84 +- .../EverEqTjsonbTjsonbPhysicalFunction.cpp | 98 +- .../EverEqTnpointNpointPhysicalFunction.cpp | 94 +- .../EverEqTnpointTnpointPhysicalFunction.cpp | 106 +- .../Meos/EverEqTposePosePhysicalFunction.cpp | 109 +- .../Meos/EverEqTposeTposePhysicalFunction.cpp | 121 +- .../EverEqTquadbinQuadbinPhysicalFunction.cpp | 70 +- .../Meos/EverEqTtextTextPhysicalFunction.cpp | 78 +- .../EverGeBigintTbigintPhysicalFunction.cpp | 43 +- .../EverGeTbigintBigintPhysicalFunction.cpp | 36 +- .../Meos/EverGeTextTtextPhysicalFunction.cpp | 78 +- .../Meos/EverGeTtextTextPhysicalFunction.cpp | 78 +- .../EverGtBigintTbigintPhysicalFunction.cpp | 43 +- .../EverGtTbigintBigintPhysicalFunction.cpp | 36 +- .../Meos/EverGtTextTtextPhysicalFunction.cpp | 78 +- .../Meos/EverGtTtextTextPhysicalFunction.cpp | 78 +- .../EverLeBigintTbigintPhysicalFunction.cpp | 43 +- .../EverLeTbigintBigintPhysicalFunction.cpp | 36 +- .../Meos/EverLeTextTtextPhysicalFunction.cpp | 78 +- .../Meos/EverLeTtextTextPhysicalFunction.cpp | 78 +- .../EverLtBigintTbigintPhysicalFunction.cpp | 43 +- .../EverLtTbigintBigintPhysicalFunction.cpp | 36 +- .../Meos/EverLtTextTtextPhysicalFunction.cpp | 78 +- .../Meos/EverLtTtextTextPhysicalFunction.cpp | 78 +- .../EverNeBigintTbigintPhysicalFunction.cpp | 43 +- .../Meos/EverNeBoolTboolPhysicalFunction.cpp | 43 +- .../EverNeNpointTnpointPhysicalFunction.cpp | 94 +- .../Meos/EverNePoseTposePhysicalFunction.cpp | 109 +- .../EverNeTbigintBigintPhysicalFunction.cpp | 36 +- .../Meos/EverNeTboolBoolPhysicalFunction.cpp | 41 +- ...EverNeTcbufferTcbufferPhysicalFunction.cpp | 129 +- .../Meos/EverNeTextTtextPhysicalFunction.cpp | 78 +- .../Meos/EverNeTgeoGeoPhysicalFunction.cpp | 95 +- .../Meos/EverNeTgeoTgeoPhysicalFunction.cpp | 98 +- .../EverNeTh3indexH3indexPhysicalFunction.cpp | 63 +- .../EverNeTjsonbJsonbPhysicalFunction.cpp | 84 +- .../EverNeTjsonbTjsonbPhysicalFunction.cpp | 98 +- .../EverNeTnpointNpointPhysicalFunction.cpp | 94 +- .../EverNeTnpointTnpointPhysicalFunction.cpp | 106 +- .../Meos/EverNeTposePosePhysicalFunction.cpp | 109 +- .../Meos/EverNeTposeTposePhysicalFunction.cpp | 121 +- .../EverNeTquadbinQuadbinPhysicalFunction.cpp | 70 +- .../Meos/EverNeTtextTextPhysicalFunction.cpp | 78 +- .../FloatspanLowerIncPhysicalFunction.cpp | 58 +- .../Meos/FloatspanLowerPhysicalFunction.cpp | 56 +- .../FloatspanUpperIncPhysicalFunction.cpp | 58 +- .../Meos/FloatspanUpperPhysicalFunction.cpp | 56 +- .../Meos/FloatspanWidthPhysicalFunction.cpp | 56 +- .../Meos/GeoAsEwktPhysicalFunction.cpp | 59 +- .../Meos/GeoAsGeojsonPhysicalFunction.cpp | 67 +- .../Meos/GeoEqualsPhysicalFunction.cpp | 59 +- .../Meos/GeoGeoNPhysicalFunction.cpp | 65 +- .../Meos/GeoIsUnitaryPhysicalFunction.cpp | 46 +- .../Meos/GeoNumGeosPhysicalFunction.cpp | 46 +- .../Meos/GeoNumPointsPhysicalFunction.cpp | 46 +- .../Meos/GeoPointsPhysicalFunction.cpp | 57 +- .../Meos/GeoReversePhysicalFunction.cpp | 57 +- .../Meos/GeoRoundPhysicalFunction.cpp | 65 +- .../Meos/GeoSamePhysicalFunction.cpp | 59 +- .../Meos/GeoSetSridPhysicalFunction.cpp | 65 +- .../Meos/GeoSridPhysicalFunction.cpp | 46 +- .../Meos/GeoTransformPhysicalFunction.cpp | 65 +- .../Meos/GeogAreaPhysicalFunction.cpp | 45 +- .../Meos/GeogCentroidPhysicalFunction.cpp | 65 +- .../Meos/GeogDistancePhysicalFunction.cpp | 59 +- .../Meos/GeogDwithinPhysicalFunction.cpp | 70 +- .../Meos/GeogIntersectsPhysicalFunction.cpp | 59 +- .../Meos/GeogLengthPhysicalFunction.cpp | 45 +- .../Meos/GeogPerimeterPhysicalFunction.cpp | 45 +- .../Meos/GeogPointMake2dPhysicalFunction.cpp | 63 +- .../Meos/GeogPointMake3dzPhysicalFunction.cpp | 71 +- .../Meos/GeogToGeomPhysicalFunction.cpp | 57 +- .../Meos/GeomAzimuthPhysicalFunction.cpp | 56 +- .../Meos/GeomBoundaryPhysicalFunction.cpp | 57 +- .../Meos/GeomCentroidPhysicalFunction.cpp | 57 +- .../Meos/GeomContainsPhysicalFunction.cpp | 61 +- .../Meos/GeomConvexHullPhysicalFunction.cpp | 57 +- .../Meos/GeomCoversPhysicalFunction.cpp | 61 +- .../Meos/GeomDifference2dPhysicalFunction.cpp | 70 +- .../Meos/GeomDisjoint2dPhysicalFunction.cpp | 61 +- .../Meos/GeomDistance2dPhysicalFunction.cpp | 59 +- .../Meos/GeomDistance3dPhysicalFunction.cpp | 59 +- .../Meos/GeomDwithin2dPhysicalFunction.cpp | 70 +- .../Meos/GeomDwithin3dPhysicalFunction.cpp | 70 +- .../Meos/GeomDwithinPhysicalFunction.cpp | 70 +- ...GeomIntersection2dCollPhysicalFunction.cpp | 71 +- .../GeomIntersection2dPhysicalFunction.cpp | 70 +- .../Meos/GeomIntersects2dPhysicalFunction.cpp | 61 +- .../Meos/GeomIntersects3dPhysicalFunction.cpp | 61 +- .../Meos/GeomIntersectsPhysicalFunction.cpp | 59 +- .../Meos/GeomIsEmptyPhysicalFunction.cpp | 45 +- .../Meos/GeomLengthPhysicalFunction.cpp | 45 +- .../Meos/GeomPerimeterPhysicalFunction.cpp | 45 +- .../Meos/GeomPointMake2dPhysicalFunction.cpp | 63 +- .../Meos/GeomPointMake3dzPhysicalFunction.cpp | 71 +- .../GeomShortestline2dPhysicalFunction.cpp | 70 +- .../GeomShortestline3dPhysicalFunction.cpp | 70 +- .../Meos/GeomToGeogPhysicalFunction.cpp | 57 +- .../Meos/GeomTouchesPhysicalFunction.cpp | 61 +- .../Meos/GeomUnaryUnionPhysicalFunction.cpp | 57 +- .../Meos/H3indexCmpPhysicalFunction.cpp | 48 +- .../Meos/H3indexEqPhysicalFunction.cpp | 49 +- .../Meos/H3indexGePhysicalFunction.cpp | 49 +- .../Meos/H3indexGtPhysicalFunction.cpp | 49 +- .../Meos/H3indexLePhysicalFunction.cpp | 49 +- .../Meos/H3indexLtPhysicalFunction.cpp | 49 +- .../Meos/H3indexNePhysicalFunction.cpp | 49 +- .../Meos/H3indexOutPhysicalFunction.cpp | 45 +- .../Meos/IntspanLowerIncPhysicalFunction.cpp | 58 +- .../Meos/IntspanLowerPhysicalFunction.cpp | 56 +- .../Meos/IntspanUpperIncPhysicalFunction.cpp | 58 +- .../Meos/IntspanUpperPhysicalFunction.cpp | 56 +- .../Meos/IntspanWidthPhysicalFunction.cpp | 56 +- .../JsonbArrayElementTextPhysicalFunction.cpp | 75 +- .../Meos/JsonbArrayLengthPhysicalFunction.cpp | 58 +- .../Meos/JsonbCmpPhysicalFunction.cpp | 70 +- .../Meos/JsonbContainedPhysicalFunction.cpp | 72 +- .../Meos/JsonbContainsPhysicalFunction.cpp | 72 +- .../Meos/JsonbEqPhysicalFunction.cpp | 72 +- .../Meos/JsonbExistsPhysicalFunction.cpp | 73 +- .../Meos/JsonbGePhysicalFunction.cpp | 72 +- .../Meos/JsonbGtPhysicalFunction.cpp | 72 +- .../Meos/JsonbLePhysicalFunction.cpp | 72 +- .../Meos/JsonbLtPhysicalFunction.cpp | 72 +- .../Meos/JsonbNePhysicalFunction.cpp | 72 +- .../JsonbObjectFieldTextPhysicalFunction.cpp | 82 +- .../Meos/JsonbPrettyPhysicalFunction.cpp | 63 +- .../Meos/JsonbToCstringPhysicalFunction.cpp | 60 +- .../LineInterpolatePointPhysicalFunction.cpp | 72 +- .../Meos/LineLocatePointPhysicalFunction.cpp | 61 +- .../Meos/LineNumpointsPhysicalFunction.cpp | 49 +- .../Meos/LinePointNPhysicalFunction.cpp | 65 +- .../Meos/LineSubstringPhysicalFunction.cpp | 73 +- ...stanceTcbufferTcbufferPhysicalFunction.cpp | 137 +- .../Meos/MulBigintTbigintPhysicalFunction.cpp | 39 +- .../Meos/MulFloatTfloatPhysicalFunction.cpp | 34 +- .../Meos/MulIntTintPhysicalFunction.cpp | 42 +- .../Meos/MulTbigintBigintPhysicalFunction.cpp | 37 +- .../Meos/MulTfloatFloatPhysicalFunction.cpp | 32 +- .../Meos/MulTintIntPhysicalFunction.cpp | 40 +- .../MulTnumberTnumberPhysicalFunction.cpp | 92 +- .../Meos/NadTcbufferGeoPhysicalFunction.cpp | 117 +- .../NadTcbufferTcbufferPhysicalFunction.cpp | 127 +- .../Meos/NadTgeoGeoPhysicalFunction.cpp | 95 +- .../Meos/NadTgeoTgeoPhysicalFunction.cpp | 117 + .../Meos/NadTnpointGeoPhysicalFunction.cpp | 88 +- .../Meos/NadTnpointNpointPhysicalFunction.cpp | 92 +- .../NadTnpointTnpointPhysicalFunction.cpp | 104 +- .../Meos/NadTposeGeoPhysicalFunction.cpp | 95 +- .../Meos/NadTposePosePhysicalFunction.cpp | 106 +- .../Meos/NadTposeTposePhysicalFunction.cpp | 119 +- .../Meos/QuadbinCellAreaPhysicalFunction.cpp | 40 +- .../QuadbinCellToParentPhysicalFunction.cpp | 64 +- .../QuadbinCellToQuadkeyPhysicalFunction.cpp | 53 +- .../Meos/QuadbinCmpPhysicalFunction.cpp | 51 +- .../Meos/QuadbinEqPhysicalFunction.cpp | 52 +- .../Meos/QuadbinGePhysicalFunction.cpp | 52 +- .../QuadbinGetResolutionPhysicalFunction.cpp | 40 +- .../Meos/QuadbinGtPhysicalFunction.cpp | 52 +- .../QuadbinIsValidCellPhysicalFunction.cpp | 40 +- .../Meos/QuadbinLePhysicalFunction.cpp | 52 +- .../Meos/QuadbinLtPhysicalFunction.cpp | 52 +- .../Meos/QuadbinNePhysicalFunction.cpp | 52 +- .../QuadbinPointToCellPhysicalFunction.cpp | 72 +- .../QuadbinTileToCellPhysicalFunction.cpp | 72 +- .../Meos/SubBigintTbigintPhysicalFunction.cpp | 39 +- .../Meos/SubFloatTfloatPhysicalFunction.cpp | 34 +- .../Meos/SubIntTintPhysicalFunction.cpp | 42 +- .../Meos/SubTbigintBigintPhysicalFunction.cpp | 37 +- .../Meos/SubTfloatFloatPhysicalFunction.cpp | 32 +- .../Meos/SubTintIntPhysicalFunction.cpp | 40 +- .../SubTnumberTnumberPhysicalFunction.cpp | 92 +- .../Meos/TEqTextTtextPhysicalFunction.cpp | 106 + .../Meos/TEqTtextTextPhysicalFunction.cpp | 106 + .../Meos/TGeTextTtextPhysicalFunction.cpp | 106 + .../Meos/TGeTtextTextPhysicalFunction.cpp | 106 + .../Meos/TGtTextTtextPhysicalFunction.cpp | 106 + .../Meos/TGtTtextTextPhysicalFunction.cpp | 106 + .../Meos/TLeTextTtextPhysicalFunction.cpp | 106 + .../Meos/TLeTtextTextPhysicalFunction.cpp | 106 + .../Meos/TLtTextTtextPhysicalFunction.cpp | 106 + .../Meos/TLtTtextTextPhysicalFunction.cpp | 106 + .../Meos/TNeTextTtextPhysicalFunction.cpp | 106 + .../Meos/TNeTtextTextPhysicalFunction.cpp | 106 + .../Meos/TandBoolTboolPhysicalFunction.cpp | 45 +- .../Meos/TandTboolBoolPhysicalFunction.cpp | 43 +- .../Meos/TandTboolTboolPhysicalFunction.cpp | 93 +- .../TbigintScaleValuePhysicalFunction.cpp | 32 +- ...TbigintShiftScaleValuePhysicalFunction.cpp | 39 +- .../TbigintShiftValuePhysicalFunction.cpp | 32 +- .../Meos/TbigintToTfloatPhysicalFunction.cpp | 19 +- .../Meos/TbigintToTintPhysicalFunction.cpp | 25 +- .../Meos/TboolToTintPhysicalFunction.cpp | 30 +- .../TdistanceTfloatFloatPhysicalFunction.cpp | 30 +- .../Meos/TdistanceTintIntPhysicalFunction.cpp | 40 +- ...distanceTnumberTnumberPhysicalFunction.cpp | 92 +- ...ontainsTNpointGeometryPhysicalFunction.cpp | 118 + ...ContainsTNpointTNpointPhysicalFunction.cpp | 126 + ...AContainsTPoseGeometryPhysicalFunction.cpp | 124 + ...ralAContainsTPoseTPosePhysicalFunction.cpp | 136 + ...DWithinTNpointGeometryPhysicalFunction.cpp | 122 + ...ADWithinTNpointTNpointPhysicalFunction.cpp | 131 + ...lADWithinTPoseGeometryPhysicalFunction.cpp | 128 + ...oralADWithinTPoseTPosePhysicalFunction.cpp | 141 + ...isjointTNpointGeometryPhysicalFunction.cpp | 118 + ...DisjointTNpointTNpointPhysicalFunction.cpp | 126 + ...ADisjointTPoseGeometryPhysicalFunction.cpp | 124 + ...ralADisjointTPoseTPosePhysicalFunction.cpp | 136 + ...ersectsTNpointGeometryPhysicalFunction.cpp | 118 + ...tersectsTNpointTNpointPhysicalFunction.cpp | 126 + ...ntersectsTPoseGeometryPhysicalFunction.cpp | 124 + ...lAIntersectsTPoseTPosePhysicalFunction.cpp | 136 + ...TouchesTNpointGeometryPhysicalFunction.cpp | 118 + ...ATouchesTNpointTNpointPhysicalFunction.cpp | 126 + ...lATouchesTPoseGeometryPhysicalFunction.cpp | 124 + ...oralATouchesTPoseTPosePhysicalFunction.cpp | 136 + ...ontainsTNpointGeometryPhysicalFunction.cpp | 118 + ...ContainsTNpointTNpointPhysicalFunction.cpp | 126 + ...EContainsTPoseGeometryPhysicalFunction.cpp | 124 + ...ralEContainsTPoseTPosePhysicalFunction.cpp | 136 + ...ECoversTNpointGeometryPhysicalFunction.cpp | 118 + ...lECoversTNpointTNpointPhysicalFunction.cpp | 126 + ...alECoversTPoseGeometryPhysicalFunction.cpp | 124 + ...poralECoversTPoseTPosePhysicalFunction.cpp | 136 + ...DWithinTNpointGeometryPhysicalFunction.cpp | 122 + ...EDWithinTNpointTNpointPhysicalFunction.cpp | 131 + ...lEDWithinTPoseGeometryPhysicalFunction.cpp | 128 + ...oralEDWithinTPoseTPosePhysicalFunction.cpp | 141 + ...isjointTNpointGeometryPhysicalFunction.cpp | 118 + ...DisjointTNpointTNpointPhysicalFunction.cpp | 126 + ...EDisjointTPoseGeometryPhysicalFunction.cpp | 124 + ...ralEDisjointTPoseTPosePhysicalFunction.cpp | 136 + ...ersectsTNpointGeometryPhysicalFunction.cpp | 118 + ...tersectsTNpointTNpointPhysicalFunction.cpp | 126 + ...ntersectsTPoseGeometryPhysicalFunction.cpp | 124 + ...lEIntersectsTPoseTPosePhysicalFunction.cpp | 136 + ...TouchesTNpointGeometryPhysicalFunction.cpp | 118 + ...ETouchesTNpointTNpointPhysicalFunction.cpp | 126 + ...lETouchesTPoseGeometryPhysicalFunction.cpp | 124 + ...oralETouchesTPoseTPosePhysicalFunction.cpp | 136 + ...oralNADTNpointGeometryPhysicalFunction.cpp | 118 + ...poralNADTNpointTNpointPhysicalFunction.cpp | 126 + ...mporalNADTPoseGeometryPhysicalFunction.cpp | 124 + .../TemporalNADTPoseTPosePhysicalFunction.cpp | 136 + .../Meos/TemporalRoundPhysicalFunction.cpp | 30 +- .../Meos/TeqBoolTboolPhysicalFunction.cpp | 46 +- .../Meos/TeqTboolBoolPhysicalFunction.cpp | 42 +- .../Meos/TextInitcapPhysicalFunction.cpp | 68 +- .../Meos/TextLowerPhysicalFunction.cpp | 68 +- .../Meos/TextUpperPhysicalFunction.cpp | 68 +- .../Meos/TextcatTextTtextPhysicalFunction.cpp | 101 +- .../Meos/TextcatTtextTextPhysicalFunction.cpp | 101 +- .../TextcatTtextTtextPhysicalFunction.cpp | 118 +- .../Meos/TfloatCeilPhysicalFunction.cpp | 15 +- .../Meos/TfloatExpPhysicalFunction.cpp | 15 +- .../Meos/TfloatFloorPhysicalFunction.cpp | 15 +- .../Meos/TfloatLnPhysicalFunction.cpp | 15 +- .../Meos/TfloatLog10PhysicalFunction.cpp | 15 +- .../Meos/TfloatRadiansPhysicalFunction.cpp | 15 +- .../Meos/TfloatScaleValuePhysicalFunction.cpp | 30 +- .../TfloatShiftScaleValuePhysicalFunction.cpp | 37 +- .../Meos/TfloatShiftValuePhysicalFunction.cpp | 30 +- .../Meos/TfloatToTbigintPhysicalFunction.cpp | 21 +- .../Meos/TfloatToTintPhysicalFunction.cpp | 25 +- ...3indexAreNeighborCellsPhysicalFunction.cpp | 78 +- ...xCellToCenterChildNextPhysicalFunction.cpp | 76 +- ...indexCellToCenterChildPhysicalFunction.cpp | 76 +- ...Th3indexCellToChildPosPhysicalFunction.cpp | 64 +- ...3indexCellToParentNextPhysicalFunction.cpp | 76 +- .../Th3indexCellToParentPhysicalFunction.cpp | 76 +- ...indexGetBaseCellNumberPhysicalFunction.cpp | 53 +- .../Th3indexGetResolutionPhysicalFunction.cpp | 53 +- .../Th3indexGridDistancePhysicalFunction.cpp | 78 +- .../Th3indexIsPentagonPhysicalFunction.cpp | 53 +- .../Th3indexIsValidCellPhysicalFunction.cpp | 53 +- .../Meos/TintScaleValuePhysicalFunction.cpp | 40 +- .../TintShiftScaleValuePhysicalFunction.cpp | 47 +- .../Meos/TintShiftValuePhysicalFunction.cpp | 40 +- .../Meos/TintToTbigintPhysicalFunction.cpp | 25 +- .../Meos/TintToTfloatPhysicalFunction.cpp | 24 +- .../Meos/TneBoolTboolPhysicalFunction.cpp | 46 +- .../Meos/TneTboolBoolPhysicalFunction.cpp | 42 +- .../Meos/TnotTboolPhysicalFunction.cpp | 30 +- .../Meos/TorBoolTboolPhysicalFunction.cpp | 45 +- .../Meos/TorTboolBoolPhysicalFunction.cpp | 43 +- .../Meos/TorTboolTboolPhysicalFunction.cpp | 93 +- .../Meos/TtextInitcapPhysicalFunction.cpp | 75 +- .../Meos/TtextLowerPhysicalFunction.cpp | 75 +- .../Meos/TtextUpperPhysicalFunction.cpp | 75 +- nes-sql-parser/AntlrSQL.g4 | 202 +- .../src/AntlrSQLQueryPlanCreator.cpp | 5499 + tools/codegen/README.md | 172 + .../codegen_nebula.cpython-312.pyc | Bin 0 -> 252238 bytes tools/codegen/build_descriptor.py | 492 + tools/codegen/build_local.sh | 31 + tools/codegen/codegen_aggregations.py | 2745 + tools/codegen/codegen_input.example.json | 160 + tools/codegen/codegen_nebula.py | 5761 + tools/codegen/gen_all.py | 63 + tools/codegen/meos-idl-22a.json | 97368 ++++++++++++++++ tools/codegen/meos-idl-master.json | 97078 +++++++++++++++ tools/codegen/numeric-descriptor.json | 927 + tools/codegen/phasec-composed-descriptor.json | 1953 + tools/codegen/phasec-rest-descriptor.json | 3583 + .../spatial-phasec-full-descriptor.json | 2660 + .../spatial-predicates-descriptor.json | 159 + .../codegen/tfloat-transforms-descriptor.json | 85 + tools/codegen/trgeo-descriptor.json | 311 + 1793 files changed, 290495 insertions(+), 19812 deletions(-) create mode 100644 nes-logical-operators/include/Functions/Meos/AcontainsGeoTrgeometryLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AcontainsTcbufferTcbufferLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AcoversGeoTrgeometryLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AcoversTrgeometryGeoLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AdisjointTrgeometryGeoLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AdisjointTrgeometryTrgeometryLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AdwithinTcbufferCbufferLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AdwithinTrgeometryGeoLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AdwithinTrgeometryTrgeometryLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AintersectsTrgeometryGeoLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AintersectsTrgeometryTrgeometryLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/AtouchesTrgeometryGeoLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EcontainsGeoTrgeometryLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EcontainsTcbufferTcbufferLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EcoversGeoTrgeometryLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EcoversTgeoGeoLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EcoversTrgeometryGeoLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EdisjointTcbufferTcbufferLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EdisjointTgeoGeoLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EdisjointTrgeometryGeoLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EdisjointTrgeometryTrgeometryLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EdwithinTcbufferCbufferLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EdwithinTgeoGeoLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EdwithinTrgeometryGeoLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EdwithinTrgeometryTrgeometryLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EintersectsTrgeometryGeoLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EintersectsTrgeometryTrgeometryLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/EtouchesTrgeometryGeoLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/NadTgeoTgeoLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TEqTextTtextLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TEqTtextTextLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TGeTextTtextLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TGeTtextTextLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TGtTextTtextLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TGtTtextTextLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TLeTextTtextLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TLeTtextTextLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TLtTextTtextLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TLtTtextTextLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TNeTextTtextLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TNeTtextTextLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TemporalAContainsTNpointGeometryLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TemporalAContainsTNpointTNpointLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TemporalAContainsTPoseGeometryLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TemporalAContainsTPoseTPoseLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TemporalADWithinTNpointGeometryLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TemporalADWithinTNpointTNpointLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TemporalADWithinTPoseGeometryLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TemporalADWithinTPoseTPoseLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TemporalADisjointTNpointGeometryLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TemporalADisjointTNpointTNpointLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TemporalADisjointTPoseGeometryLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TemporalADisjointTPoseTPoseLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TemporalAIntersectsTNpointGeometryLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TemporalAIntersectsTNpointTNpointLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TemporalAIntersectsTPoseGeometryLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TemporalAIntersectsTPoseTPoseLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TemporalATouchesTNpointGeometryLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TemporalATouchesTNpointTNpointLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TemporalATouchesTPoseGeometryLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TemporalATouchesTPoseTPoseLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TemporalEContainsTNpointGeometryLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TemporalEContainsTNpointTNpointLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TemporalEContainsTPoseGeometryLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TemporalEContainsTPoseTPoseLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TemporalECoversTNpointGeometryLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TemporalECoversTNpointTNpointLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TemporalECoversTPoseGeometryLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TemporalECoversTPoseTPoseLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TemporalEDWithinTNpointGeometryLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TemporalEDWithinTNpointTNpointLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TemporalEDWithinTPoseGeometryLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TemporalEDWithinTPoseTPoseLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TemporalEDisjointTNpointGeometryLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TemporalEDisjointTNpointTNpointLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TemporalEDisjointTPoseGeometryLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TemporalEDisjointTPoseTPoseLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TemporalEIntersectsTNpointGeometryLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TemporalEIntersectsTNpointTNpointLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TemporalEIntersectsTPoseGeometryLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TemporalEIntersectsTPoseTPoseLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TemporalETouchesTNpointGeometryLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TemporalETouchesTNpointTNpointLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TemporalETouchesTPoseGeometryLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TemporalETouchesTPoseTPoseLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TemporalNADTNpointGeometryLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TemporalNADTNpointTNpointLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TemporalNADTPoseGeometryLogicalFunction.hpp create mode 100644 nes-logical-operators/include/Functions/Meos/TemporalNADTPoseTPoseLogicalFunction.hpp create mode 100644 nes-logical-operators/src/Functions/Meos/AcontainsGeoTrgeometryLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AcontainsTcbufferTcbufferLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AcoversGeoTrgeometryLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AcoversTrgeometryGeoLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AdisjointTrgeometryGeoLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AdisjointTrgeometryTrgeometryLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AdwithinTcbufferCbufferLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AdwithinTrgeometryGeoLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AdwithinTrgeometryTrgeometryLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AintersectsTrgeometryGeoLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AintersectsTrgeometryTrgeometryLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/AtouchesTrgeometryGeoLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EcontainsGeoTrgeometryLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EcontainsTcbufferTcbufferLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EcoversGeoTrgeometryLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EcoversTgeoGeoLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EcoversTrgeometryGeoLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EdisjointTcbufferTcbufferLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EdisjointTgeoGeoLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EdisjointTrgeometryGeoLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EdisjointTrgeometryTrgeometryLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EdwithinTcbufferCbufferLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EdwithinTgeoGeoLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EdwithinTrgeometryGeoLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EdwithinTrgeometryTrgeometryLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EintersectsTrgeometryGeoLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EintersectsTrgeometryTrgeometryLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/EtouchesTrgeometryGeoLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/NadTgeoTgeoLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TEqTextTtextLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TEqTtextTextLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TGeTextTtextLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TGeTtextTextLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TGtTextTtextLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TGtTtextTextLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TLeTextTtextLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TLeTtextTextLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TLtTextTtextLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TLtTtextTextLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TNeTextTtextLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TNeTtextTextLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TemporalAContainsTNpointGeometryLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TemporalAContainsTNpointTNpointLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TemporalAContainsTPoseGeometryLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TemporalAContainsTPoseTPoseLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TemporalADWithinTNpointGeometryLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TemporalADWithinTNpointTNpointLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TemporalADWithinTPoseGeometryLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TemporalADWithinTPoseTPoseLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TemporalADisjointTNpointGeometryLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TemporalADisjointTNpointTNpointLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TemporalADisjointTPoseGeometryLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TemporalADisjointTPoseTPoseLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TemporalAIntersectsTNpointGeometryLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TemporalAIntersectsTNpointTNpointLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TemporalAIntersectsTPoseGeometryLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TemporalAIntersectsTPoseTPoseLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TemporalATouchesTNpointGeometryLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TemporalATouchesTNpointTNpointLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TemporalATouchesTPoseGeometryLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TemporalATouchesTPoseTPoseLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TemporalEContainsTNpointGeometryLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TemporalEContainsTNpointTNpointLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TemporalEContainsTPoseGeometryLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TemporalEContainsTPoseTPoseLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TemporalECoversTNpointGeometryLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TemporalECoversTNpointTNpointLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TemporalECoversTPoseGeometryLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TemporalECoversTPoseTPoseLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TemporalEDWithinTNpointGeometryLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TemporalEDWithinTNpointTNpointLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TemporalEDWithinTPoseGeometryLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TemporalEDWithinTPoseTPoseLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TemporalEDisjointTNpointGeometryLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TemporalEDisjointTNpointTNpointLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TemporalEDisjointTPoseGeometryLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TemporalEDisjointTPoseTPoseLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TemporalEIntersectsTNpointGeometryLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TemporalEIntersectsTNpointTNpointLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TemporalEIntersectsTPoseGeometryLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TemporalEIntersectsTPoseTPoseLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TemporalETouchesTNpointGeometryLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TemporalETouchesTNpointTNpointLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TemporalETouchesTPoseGeometryLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TemporalETouchesTPoseTPoseLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TemporalNADTNpointGeometryLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TemporalNADTNpointTNpointLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TemporalNADTPoseGeometryLogicalFunction.cpp create mode 100644 nes-logical-operators/src/Functions/Meos/TemporalNADTPoseTPoseLogicalFunction.cpp create mode 100644 nes-physical-operators/include/Functions/Meos/AcontainsGeoTrgeometryPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AcontainsTcbufferTcbufferPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AcoversGeoTrgeometryPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AcoversTrgeometryGeoPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AdisjointTrgeometryGeoPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AdisjointTrgeometryTrgeometryPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AdwithinTcbufferCbufferPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AdwithinTrgeometryGeoPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AdwithinTrgeometryTrgeometryPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AintersectsTrgeometryGeoPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AintersectsTrgeometryTrgeometryPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/AtouchesTrgeometryGeoPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EcontainsGeoTrgeometryPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EcontainsTcbufferTcbufferPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EcoversGeoTrgeometryPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EcoversTgeoGeoPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EcoversTrgeometryGeoPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EdisjointTcbufferTcbufferPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EdisjointTgeoGeoPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EdisjointTrgeometryGeoPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EdisjointTrgeometryTrgeometryPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EdwithinTcbufferCbufferPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EdwithinTgeoGeoPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EdwithinTrgeometryGeoPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EdwithinTrgeometryTrgeometryPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EintersectsTrgeometryGeoPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EintersectsTrgeometryTrgeometryPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/EtouchesTrgeometryGeoPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/NadTgeoTgeoPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TEqTextTtextPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TEqTtextTextPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TGeTextTtextPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TGeTtextTextPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TGtTextTtextPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TGtTtextTextPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TLeTextTtextPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TLeTtextTextPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TLtTextTtextPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TLtTtextTextPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TNeTextTtextPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TNeTtextTextPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TemporalAContainsTNpointGeometryPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TemporalAContainsTNpointTNpointPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TemporalAContainsTPoseGeometryPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TemporalAContainsTPoseTPosePhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TemporalADWithinTNpointGeometryPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TemporalADWithinTNpointTNpointPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TemporalADWithinTPoseGeometryPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TemporalADWithinTPoseTPosePhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TemporalADisjointTNpointGeometryPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TemporalADisjointTNpointTNpointPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TemporalADisjointTPoseGeometryPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TemporalADisjointTPoseTPosePhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TemporalAIntersectsTNpointGeometryPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TemporalAIntersectsTNpointTNpointPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TemporalAIntersectsTPoseGeometryPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TemporalAIntersectsTPoseTPosePhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TemporalATouchesTNpointGeometryPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TemporalATouchesTNpointTNpointPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TemporalATouchesTPoseGeometryPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TemporalATouchesTPoseTPosePhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TemporalEContainsTNpointGeometryPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TemporalEContainsTNpointTNpointPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TemporalEContainsTPoseGeometryPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TemporalEContainsTPoseTPosePhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TemporalECoversTNpointGeometryPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TemporalECoversTNpointTNpointPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TemporalECoversTPoseGeometryPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TemporalECoversTPoseTPosePhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TemporalEDWithinTNpointGeometryPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TemporalEDWithinTNpointTNpointPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TemporalEDWithinTPoseGeometryPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TemporalEDWithinTPoseTPosePhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TemporalEDisjointTNpointGeometryPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TemporalEDisjointTNpointTNpointPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TemporalEDisjointTPoseGeometryPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TemporalEDisjointTPoseTPosePhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TemporalEIntersectsTNpointGeometryPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TemporalEIntersectsTNpointTNpointPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TemporalEIntersectsTPoseGeometryPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TemporalEIntersectsTPoseTPosePhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TemporalETouchesTNpointGeometryPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TemporalETouchesTNpointTNpointPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TemporalETouchesTPoseGeometryPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TemporalETouchesTPoseTPosePhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TemporalNADTNpointGeometryPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TemporalNADTNpointTNpointPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TemporalNADTPoseGeometryPhysicalFunction.hpp create mode 100644 nes-physical-operators/include/Functions/Meos/TemporalNADTPoseTPosePhysicalFunction.hpp create mode 100644 nes-physical-operators/src/Functions/Meos/AcontainsGeoTrgeometryPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AcontainsTcbufferTcbufferPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AcoversGeoTrgeometryPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AcoversTrgeometryGeoPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AdisjointTrgeometryGeoPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AdisjointTrgeometryTrgeometryPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AdwithinTcbufferCbufferPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AdwithinTrgeometryGeoPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AdwithinTrgeometryTrgeometryPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AintersectsTrgeometryGeoPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AintersectsTrgeometryTrgeometryPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/AtouchesTrgeometryGeoPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EcontainsGeoTrgeometryPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EcontainsTcbufferTcbufferPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EcoversGeoTrgeometryPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EcoversTgeoGeoPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EcoversTrgeometryGeoPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EdisjointTcbufferTcbufferPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EdisjointTgeoGeoPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EdisjointTrgeometryGeoPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EdisjointTrgeometryTrgeometryPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EdwithinTcbufferCbufferPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EdwithinTgeoGeoPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EdwithinTrgeometryGeoPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EdwithinTrgeometryTrgeometryPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EintersectsTrgeometryGeoPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EintersectsTrgeometryTrgeometryPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/EtouchesTrgeometryGeoPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/NadTgeoTgeoPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TEqTextTtextPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TEqTtextTextPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TGeTextTtextPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TGeTtextTextPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TGtTextTtextPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TGtTtextTextPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TLeTextTtextPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TLeTtextTextPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TLtTextTtextPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TLtTtextTextPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TNeTextTtextPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TNeTtextTextPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TemporalAContainsTNpointGeometryPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TemporalAContainsTNpointTNpointPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TemporalAContainsTPoseGeometryPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TemporalAContainsTPoseTPosePhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TemporalADWithinTNpointGeometryPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TemporalADWithinTNpointTNpointPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TemporalADWithinTPoseGeometryPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TemporalADWithinTPoseTPosePhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TemporalADisjointTNpointGeometryPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TemporalADisjointTNpointTNpointPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TemporalADisjointTPoseGeometryPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TemporalADisjointTPoseTPosePhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TemporalAIntersectsTNpointGeometryPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TemporalAIntersectsTNpointTNpointPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TemporalAIntersectsTPoseGeometryPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TemporalAIntersectsTPoseTPosePhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TemporalATouchesTNpointGeometryPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TemporalATouchesTNpointTNpointPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TemporalATouchesTPoseGeometryPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TemporalATouchesTPoseTPosePhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TemporalEContainsTNpointGeometryPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TemporalEContainsTNpointTNpointPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TemporalEContainsTPoseGeometryPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TemporalEContainsTPoseTPosePhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TemporalECoversTNpointGeometryPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TemporalECoversTNpointTNpointPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TemporalECoversTPoseGeometryPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TemporalECoversTPoseTPosePhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TemporalEDWithinTNpointGeometryPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TemporalEDWithinTNpointTNpointPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TemporalEDWithinTPoseGeometryPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TemporalEDWithinTPoseTPosePhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TemporalEDisjointTNpointGeometryPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TemporalEDisjointTNpointTNpointPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TemporalEDisjointTPoseGeometryPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TemporalEDisjointTPoseTPosePhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TemporalEIntersectsTNpointGeometryPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TemporalEIntersectsTNpointTNpointPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TemporalEIntersectsTPoseGeometryPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TemporalEIntersectsTPoseTPosePhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TemporalETouchesTNpointGeometryPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TemporalETouchesTNpointTNpointPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TemporalETouchesTPoseGeometryPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TemporalETouchesTPoseTPosePhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TemporalNADTNpointGeometryPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TemporalNADTNpointTNpointPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TemporalNADTPoseGeometryPhysicalFunction.cpp create mode 100644 nes-physical-operators/src/Functions/Meos/TemporalNADTPoseTPosePhysicalFunction.cpp create mode 100644 tools/codegen/README.md create mode 100644 tools/codegen/__pycache__/codegen_nebula.cpython-312.pyc create mode 100644 tools/codegen/build_descriptor.py create mode 100755 tools/codegen/build_local.sh create mode 100644 tools/codegen/codegen_aggregations.py create mode 100644 tools/codegen/codegen_input.example.json create mode 100644 tools/codegen/codegen_nebula.py create mode 100644 tools/codegen/gen_all.py create mode 100644 tools/codegen/meos-idl-22a.json create mode 100644 tools/codegen/meos-idl-master.json create mode 100644 tools/codegen/numeric-descriptor.json create mode 100644 tools/codegen/phasec-composed-descriptor.json create mode 100644 tools/codegen/phasec-rest-descriptor.json create mode 100644 tools/codegen/spatial-phasec-full-descriptor.json create mode 100644 tools/codegen/spatial-predicates-descriptor.json create mode 100644 tools/codegen/tfloat-transforms-descriptor.json create mode 100644 tools/codegen/trgeo-descriptor.json diff --git a/nes-logical-operators/include/Functions/Meos/AcontainsGeoTrgeometryLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AcontainsGeoTrgeometryLogicalFunction.hpp new file mode 100644 index 0000000000..e1817f4a51 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AcontainsGeoTrgeometryLogicalFunction.hpp @@ -0,0 +1,45 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1 if the geometry acontains the trgeometry instant. + */ +class AcontainsGeoTrgeometryLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AcontainsGeoTrgeometry"; + AcontainsGeoTrgeometryLogicalFunction(LogicalFunction tgt_wkt, LogicalFunction ref_wkt, LogicalFunction x1, LogicalFunction y1, LogicalFunction theta1, LogicalFunction ts1); + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AcontainsTcbufferGeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AcontainsTcbufferGeoLogicalFunction.hpp index 2ee87d957e..6c7277c016 100644 --- a/nes-logical-operators/include/Functions/Meos/AcontainsTcbufferGeoLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/AcontainsTcbufferGeoLogicalFunction.hpp @@ -22,17 +22,21 @@ namespace NES { /** - * @brief Returns 1.0 if the tcbuffer always contains the static geometry, 0.0 otherwise. + * @brief Per-event acontains_tcbuffer_geo spatial predicate. * - * Args: (lon:FLOAT64, lat:FLOAT64, radius:FLOAT64, ts:UINT64, wkt:VARCHAR) -> FLOAT64. + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `acontains_tcbuffer_geo`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class AcontainsTcbufferGeoLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "AcontainsTcbufferGeo"; - AcontainsTcbufferGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, - LogicalFunction radius, LogicalFunction ts, - LogicalFunction wkt); + AcontainsTcbufferGeoLogicalFunction(LogicalFunction lon, + LogicalFunction lat, + LogicalFunction radius, + LogicalFunction timestamp, + LogicalFunction geometry); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/AcontainsTcbufferTcbufferLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AcontainsTcbufferTcbufferLogicalFunction.hpp new file mode 100644 index 0000000000..79b0750b8d --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AcontainsTcbufferTcbufferLogicalFunction.hpp @@ -0,0 +1,59 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event acontains_tcbuffer_tcbuffer spatial predicate. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `acontains_tcbuffer_tcbuffer`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. + */ +class AcontainsTcbufferTcbufferLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AcontainsTcbufferTcbuffer"; + + AcontainsTcbufferTcbufferLogicalFunction(LogicalFunction lonA, + LogicalFunction latA, + LogicalFunction radiusA, + LogicalFunction tsA, + LogicalFunction lonB, + LogicalFunction latB, + LogicalFunction radiusB, + LogicalFunction tsB); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AcontainsTgeoGeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AcontainsTgeoGeoLogicalFunction.hpp index d713a4c754..ee83e195bc 100644 --- a/nes-logical-operators/include/Functions/Meos/AcontainsTgeoGeoLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/AcontainsTgeoGeoLogicalFunction.hpp @@ -22,16 +22,20 @@ namespace NES { /** - * @brief Returns 1.0 if temporal geometry always contains the static geometry. + * @brief Per-event acontains_tgeo_geo spatial predicate. * - * Args: (lon:FLOAT64, lat:FLOAT64, ts:UINT64, wkt:VARCHAR) -> FLOAT64. + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `acontains_tgeo_geo`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class AcontainsTgeoGeoLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "AcontainsTgeoGeo"; - AcontainsTgeoGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, - LogicalFunction ts, LogicalFunction wkt); + AcontainsTgeoGeoLogicalFunction(LogicalFunction lon, + LogicalFunction lat, + LogicalFunction timestamp, + LogicalFunction geometry); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/AcontainsTgeoTgeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AcontainsTgeoTgeoLogicalFunction.hpp index 1a37399f4c..fa92a524a4 100644 --- a/nes-logical-operators/include/Functions/Meos/AcontainsTgeoTgeoLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/AcontainsTgeoTgeoLogicalFunction.hpp @@ -22,13 +22,22 @@ namespace NES { /** - * @brief Tests whether a temporal geometry always contains another. + * @brief Per-event acontains_tgeo_tgeo spatial predicate. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `acontains_tgeo_tgeo`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class AcontainsTgeoTgeoLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "AcontainsTgeoTgeo"; - AcontainsTgeoTgeoLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction ts1, LogicalFunction lon2, LogicalFunction lat2, LogicalFunction ts2); + AcontainsTgeoTgeoLogicalFunction(LogicalFunction lonA, + LogicalFunction latA, + LogicalFunction tsA, + LogicalFunction lonB, + LogicalFunction latB, + LogicalFunction tsB); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/AcoversGeoTrgeometryLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AcoversGeoTrgeometryLogicalFunction.hpp new file mode 100644 index 0000000000..91a7b1ef3f --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AcoversGeoTrgeometryLogicalFunction.hpp @@ -0,0 +1,45 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1 if the geometry acovers the trgeometry instant. + */ +class AcoversGeoTrgeometryLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AcoversGeoTrgeometry"; + AcoversGeoTrgeometryLogicalFunction(LogicalFunction tgt_wkt, LogicalFunction ref_wkt, LogicalFunction x1, LogicalFunction y1, LogicalFunction theta1, LogicalFunction ts1); + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AcoversTcbufferGeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AcoversTcbufferGeoLogicalFunction.hpp index e1f853661e..c640309ef7 100644 --- a/nes-logical-operators/include/Functions/Meos/AcoversTcbufferGeoLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/AcoversTcbufferGeoLogicalFunction.hpp @@ -22,17 +22,21 @@ namespace NES { /** - * @brief Returns 1.0 if the tcbuffer always covers the static geometry, 0.0 otherwise. + * @brief Per-event acovers_tcbuffer_geo spatial predicate. * - * Args: (lon:FLOAT64, lat:FLOAT64, radius:FLOAT64, ts:UINT64, wkt:VARCHAR) -> FLOAT64. + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `acovers_tcbuffer_geo`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class AcoversTcbufferGeoLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "AcoversTcbufferGeo"; - AcoversTcbufferGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, - LogicalFunction radius, LogicalFunction ts, - LogicalFunction wkt); + AcoversTcbufferGeoLogicalFunction(LogicalFunction lon, + LogicalFunction lat, + LogicalFunction radius, + LogicalFunction timestamp, + LogicalFunction geometry); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/AcoversTcbufferTcbufferLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AcoversTcbufferTcbufferLogicalFunction.hpp index 460443d9ee..dbb7cc85a4 100644 --- a/nes-logical-operators/include/Functions/Meos/AcoversTcbufferTcbufferLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/AcoversTcbufferTcbufferLogicalFunction.hpp @@ -22,19 +22,24 @@ namespace NES { /** - * @brief Returns 1.0 if the first tcbuffer instant always covers the second, 0.0 otherwise. + * @brief Per-event acovers_tcbuffer_tcbuffer spatial predicate. * - * Args: (lon1:FLOAT64, lat1:FLOAT64, r1:FLOAT64, ts1:UINT64, - * lon2:FLOAT64, lat2:FLOAT64, r2:FLOAT64, ts2:UINT64) -> FLOAT64. + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `acovers_tcbuffer_tcbuffer`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class AcoversTcbufferTcbufferLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "AcoversTcbufferTcbuffer"; - AcoversTcbufferTcbufferLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction r1, - LogicalFunction ts1, - LogicalFunction lon2, LogicalFunction lat2, LogicalFunction r2, - LogicalFunction ts2); + AcoversTcbufferTcbufferLogicalFunction(LogicalFunction lonA, + LogicalFunction latA, + LogicalFunction radiusA, + LogicalFunction tsA, + LogicalFunction lonB, + LogicalFunction latB, + LogicalFunction radiusB, + LogicalFunction tsB); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/AcoversTgeoGeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AcoversTgeoGeoLogicalFunction.hpp index c5c7e6823a..873549a883 100644 --- a/nes-logical-operators/include/Functions/Meos/AcoversTgeoGeoLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/AcoversTgeoGeoLogicalFunction.hpp @@ -22,16 +22,20 @@ namespace NES { /** - * @brief Returns 1.0 if temporal geometry always covers the static geometry. + * @brief Per-event acovers_tgeo_geo spatial predicate. * - * Args: (lon:FLOAT64, lat:FLOAT64, ts:UINT64, wkt:VARCHAR) -> FLOAT64. + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `acovers_tgeo_geo`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class AcoversTgeoGeoLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "AcoversTgeoGeo"; - AcoversTgeoGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, - LogicalFunction ts, LogicalFunction wkt); + AcoversTgeoGeoLogicalFunction(LogicalFunction lon, + LogicalFunction lat, + LogicalFunction timestamp, + LogicalFunction geometry); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/AcoversTgeoTgeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AcoversTgeoTgeoLogicalFunction.hpp index 52c370d0a6..72223b7810 100644 --- a/nes-logical-operators/include/Functions/Meos/AcoversTgeoTgeoLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/AcoversTgeoTgeoLogicalFunction.hpp @@ -22,13 +22,22 @@ namespace NES { /** - * @brief Tests whether a temporal geometry always covers another. + * @brief Per-event acovers_tgeo_tgeo spatial predicate. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `acovers_tgeo_tgeo`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class AcoversTgeoTgeoLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "AcoversTgeoTgeo"; - AcoversTgeoTgeoLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction ts1, LogicalFunction lon2, LogicalFunction lat2, LogicalFunction ts2); + AcoversTgeoTgeoLogicalFunction(LogicalFunction lonA, + LogicalFunction latA, + LogicalFunction tsA, + LogicalFunction lonB, + LogicalFunction latB, + LogicalFunction tsB); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/AcoversTrgeometryGeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AcoversTrgeometryGeoLogicalFunction.hpp new file mode 100644 index 0000000000..c7cea8a8de --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AcoversTrgeometryGeoLogicalFunction.hpp @@ -0,0 +1,45 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1 if the trgeometry instant acovers the geometry. + */ +class AcoversTrgeometryGeoLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AcoversTrgeometryGeo"; + AcoversTrgeometryGeoLogicalFunction(LogicalFunction ref_wkt, LogicalFunction x1, LogicalFunction y1, LogicalFunction theta1, LogicalFunction ts1, LogicalFunction tgt_wkt); + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AddBigintTbigintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AddBigintTbigintLogicalFunction.hpp index 99a8dcb629..eaf54c83f8 100644 --- a/nes-logical-operators/include/Functions/Meos/AddBigintTbigintLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/AddBigintTbigintLogicalFunction.hpp @@ -22,19 +22,19 @@ namespace NES { /** - * @brief Per-event add_bigint_tbigint: adds a constant int64 scalar to a single-instant tbigint value. + * @brief Per-event add_bigint_tbigint: scalar bigint plus single-instant tbigint. * * Generated by tools/codegen/codegen_nebula.py from the MEOS function - * `add_bigint_tbigint`. Takes (scalar:FLOAT64→int64, value:FLOAT64, ts:UINT64), - * constructs a single-instant temporal, applies the addition, and returns FLOAT64. + * `add_bigint_tbigint`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class AddBigintTbigintLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "AddBigintTbigint"; - AddBigintTbigintLogicalFunction(LogicalFunction scalar, - LogicalFunction value, - LogicalFunction ts); + AddBigintTbigintLogicalFunction(LogicalFunction arg0, + LogicalFunction value, + LogicalFunction ts); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/AddFloatTfloatLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AddFloatTfloatLogicalFunction.hpp index 1454a1dc3a..ea9d07f61d 100644 --- a/nes-logical-operators/include/Functions/Meos/AddFloatTfloatLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/AddFloatTfloatLogicalFunction.hpp @@ -22,19 +22,19 @@ namespace NES { /** - * @brief Per-event add_float_tfloat: adds a constant to a single-instant tfloat value. + * @brief Per-event add_float_tfloat: scalar float plus single-instant tfloat. * * Generated by tools/codegen/codegen_nebula.py from the MEOS function - * `add_float_tfloat`. Takes (scalar:FLOAT64, value:FLOAT64, ts:UINT64), - * constructs a single-instant temporal, applies the addition, and returns FLOAT64. + * `add_float_tfloat`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class AddFloatTfloatLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "AddFloatTfloat"; - AddFloatTfloatLogicalFunction(LogicalFunction scalar, - LogicalFunction value, - LogicalFunction ts); + AddFloatTfloatLogicalFunction(LogicalFunction arg0, + LogicalFunction value, + LogicalFunction ts); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/AddIntTintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AddIntTintLogicalFunction.hpp index db3ef60e22..2bec599667 100644 --- a/nes-logical-operators/include/Functions/Meos/AddIntTintLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/AddIntTintLogicalFunction.hpp @@ -22,19 +22,19 @@ namespace NES { /** - * @brief Per-event add_int_tint: adds a constant to a single-instant tint value. + * @brief Per-event add_int_tint: scalar int plus single-instant tint. * * Generated by tools/codegen/codegen_nebula.py from the MEOS function - * `add_int_tint`. Takes (scalar:FLOAT64, value:FLOAT64, ts:UINT64), - * constructs a single-instant temporal, applies the addition, and returns FLOAT64. + * `add_int_tint`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class AddIntTintLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "AddIntTint"; - AddIntTintLogicalFunction(LogicalFunction scalar, - LogicalFunction value, - LogicalFunction ts); + AddIntTintLogicalFunction(LogicalFunction arg0, + LogicalFunction value, + LogicalFunction ts); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/AddTbigintBigintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AddTbigintBigintLogicalFunction.hpp index c97f49cb16..7144dff619 100644 --- a/nes-logical-operators/include/Functions/Meos/AddTbigintBigintLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/AddTbigintBigintLogicalFunction.hpp @@ -22,19 +22,19 @@ namespace NES { /** - * @brief Per-event add_tbigint_bigint: adds a constant int64 to a single-instant tbigint value. + * @brief Per-event add_tbigint_bigint: single-instant tbigint plus scalar bigint. * * Generated by tools/codegen/codegen_nebula.py from the MEOS function - * `add_tbigint_bigint`. Takes (value:FLOAT64, ts:UINT64, addend:FLOAT64→int64), - * constructs a single-instant temporal, applies the addition, and returns FLOAT64. + * `add_tbigint_bigint`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class AddTbigintBigintLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "AddTbigintBigint"; AddTbigintBigintLogicalFunction(LogicalFunction value, - LogicalFunction ts, - LogicalFunction addend); + LogicalFunction ts, + LogicalFunction arg0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/AddTfloatFloatLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AddTfloatFloatLogicalFunction.hpp index 7fbbb663c8..e2151445af 100644 --- a/nes-logical-operators/include/Functions/Meos/AddTfloatFloatLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/AddTfloatFloatLogicalFunction.hpp @@ -22,19 +22,19 @@ namespace NES { /** - * @brief Per-event add_tfloat_float: adds a constant to a single-instant tfloat value. + * @brief Per-event add_tfloat_float: single-instant tfloat plus scalar float. * * Generated by tools/codegen/codegen_nebula.py from the MEOS function - * `add_tfloat_float`. Takes (value:FLOAT64, ts:UINT64, addend:FLOAT64), - * constructs a single-instant temporal, applies the addition, and returns FLOAT64. + * `add_tfloat_float`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class AddTfloatFloatLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "AddTfloatFloat"; AddTfloatFloatLogicalFunction(LogicalFunction value, - LogicalFunction ts, - LogicalFunction addend); + LogicalFunction ts, + LogicalFunction arg0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/AddTintIntLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AddTintIntLogicalFunction.hpp index c38de2cff9..2e7649dd0a 100644 --- a/nes-logical-operators/include/Functions/Meos/AddTintIntLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/AddTintIntLogicalFunction.hpp @@ -22,19 +22,19 @@ namespace NES { /** - * @brief Per-event add_tint_int: adds a constant integer to a single-instant tint value. + * @brief Per-event add_tint_int: single-instant tint plus scalar int. * * Generated by tools/codegen/codegen_nebula.py from the MEOS function - * `add_tint_int`. Takes (value:FLOAT64, ts:UINT64, addend:FLOAT64→int), - * constructs a single-instant temporal, applies the addition, and returns FLOAT64. + * `add_tint_int`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class AddTintIntLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "AddTintInt"; AddTintIntLogicalFunction(LogicalFunction value, - LogicalFunction ts, - LogicalFunction addend); + LogicalFunction ts, + LogicalFunction arg0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/AddTnumberTnumberLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AddTnumberTnumberLogicalFunction.hpp index eb6bf59984..b19369c45e 100644 --- a/nes-logical-operators/include/Functions/Meos/AddTnumberTnumberLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/AddTnumberTnumberLogicalFunction.hpp @@ -22,19 +22,18 @@ namespace NES { /** - * @brief Per-event add_tnumber_tnumber: element-wise addition of two single-instant tnumbers. + * @brief Per-event add_tnumber_tnumber: two temporal numbers added (WKB result). * * Generated by tools/codegen/codegen_nebula.py from the MEOS function - * `add_tnumber_tnumber`. Takes (value1:FLOAT64, value2:FLOAT64, ts:UINT64), - * constructs two co-instant temporals, applies the addition, and returns FLOAT64. + * `add_tnumber_tnumber`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class AddTnumberTnumberLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "AddTnumberTnumber"; - AddTnumberTnumberLogicalFunction(LogicalFunction value1, - LogicalFunction value2, - LogicalFunction ts); + AddTnumberTnumberLogicalFunction(LogicalFunction traj, + LogicalFunction arg0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/AdisjointTcbufferGeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AdisjointTcbufferGeoLogicalFunction.hpp index 6785185c3d..f391b6e4b1 100644 --- a/nes-logical-operators/include/Functions/Meos/AdisjointTcbufferGeoLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/AdisjointTcbufferGeoLogicalFunction.hpp @@ -22,17 +22,21 @@ namespace NES { /** - * @brief Returns 1.0 if the tcbuffer is always disjoint from the static geometry, 0.0 otherwise. + * @brief Per-event adisjoint_tcbuffer_geo spatial predicate. * - * Args: (lon:FLOAT64, lat:FLOAT64, radius:FLOAT64, ts:UINT64, wkt:VARCHAR) -> FLOAT64. + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `adisjoint_tcbuffer_geo`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class AdisjointTcbufferGeoLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "AdisjointTcbufferGeo"; - AdisjointTcbufferGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, - LogicalFunction radius, LogicalFunction ts, - LogicalFunction wkt); + AdisjointTcbufferGeoLogicalFunction(LogicalFunction lon, + LogicalFunction lat, + LogicalFunction radius, + LogicalFunction timestamp, + LogicalFunction geometry); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/AdisjointTcbufferTcbufferLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AdisjointTcbufferTcbufferLogicalFunction.hpp index 8555ac5974..8449c611ef 100644 --- a/nes-logical-operators/include/Functions/Meos/AdisjointTcbufferTcbufferLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/AdisjointTcbufferTcbufferLogicalFunction.hpp @@ -22,19 +22,24 @@ namespace NES { /** - * @brief Returns 1.0 if the two tcbuffer instants are always disjoint, 0.0 otherwise. + * @brief Per-event adisjoint_tcbuffer_tcbuffer spatial predicate. * - * Args: (lon1:FLOAT64, lat1:FLOAT64, r1:FLOAT64, ts1:UINT64, - * lon2:FLOAT64, lat2:FLOAT64, r2:FLOAT64, ts2:UINT64) -> FLOAT64. + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `adisjoint_tcbuffer_tcbuffer`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class AdisjointTcbufferTcbufferLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "AdisjointTcbufferTcbuffer"; - AdisjointTcbufferTcbufferLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction r1, - LogicalFunction ts1, - LogicalFunction lon2, LogicalFunction lat2, LogicalFunction r2, - LogicalFunction ts2); + AdisjointTcbufferTcbufferLogicalFunction(LogicalFunction lonA, + LogicalFunction latA, + LogicalFunction radiusA, + LogicalFunction tsA, + LogicalFunction lonB, + LogicalFunction latB, + LogicalFunction radiusB, + LogicalFunction tsB); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/AdisjointTgeoGeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AdisjointTgeoGeoLogicalFunction.hpp index 31d5c93624..76f63e24e9 100644 --- a/nes-logical-operators/include/Functions/Meos/AdisjointTgeoGeoLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/AdisjointTgeoGeoLogicalFunction.hpp @@ -22,16 +22,20 @@ namespace NES { /** - * @brief Returns 1.0 if temporal geometry is always disjoint from the static geometry. + * @brief Per-event adisjoint_tgeo_geo spatial predicate. * - * Args: (lon:FLOAT64, lat:FLOAT64, ts:UINT64, wkt:VARCHAR) -> FLOAT64. + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `adisjoint_tgeo_geo`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class AdisjointTgeoGeoLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "AdisjointTgeoGeo"; - AdisjointTgeoGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, - LogicalFunction ts, LogicalFunction wkt); + AdisjointTgeoGeoLogicalFunction(LogicalFunction lon, + LogicalFunction lat, + LogicalFunction timestamp, + LogicalFunction geometry); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/AdisjointTgeoTgeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AdisjointTgeoTgeoLogicalFunction.hpp index 80d2046dad..c94664222b 100644 --- a/nes-logical-operators/include/Functions/Meos/AdisjointTgeoTgeoLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/AdisjointTgeoTgeoLogicalFunction.hpp @@ -22,13 +22,22 @@ namespace NES { /** - * @brief Tests whether two temporal geometries are always disjoint. + * @brief Per-event adisjoint_tgeo_tgeo spatial predicate. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `adisjoint_tgeo_tgeo`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class AdisjointTgeoTgeoLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "AdisjointTgeoTgeo"; - AdisjointTgeoTgeoLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction ts1, LogicalFunction lon2, LogicalFunction lat2, LogicalFunction ts2); + AdisjointTgeoTgeoLogicalFunction(LogicalFunction lonA, + LogicalFunction latA, + LogicalFunction tsA, + LogicalFunction lonB, + LogicalFunction latB, + LogicalFunction tsB); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/AdisjointTrgeometryGeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AdisjointTrgeometryGeoLogicalFunction.hpp new file mode 100644 index 0000000000..3f3c6b12d3 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AdisjointTrgeometryGeoLogicalFunction.hpp @@ -0,0 +1,45 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1 if the trgeometry instant adisjoint the geometry. + */ +class AdisjointTrgeometryGeoLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AdisjointTrgeometryGeo"; + AdisjointTrgeometryGeoLogicalFunction(LogicalFunction ref_wkt, LogicalFunction x1, LogicalFunction y1, LogicalFunction theta1, LogicalFunction ts1, LogicalFunction tgt_wkt); + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AdisjointTrgeometryTrgeometryLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AdisjointTrgeometryTrgeometryLogicalFunction.hpp new file mode 100644 index 0000000000..462102cf06 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AdisjointTrgeometryTrgeometryLogicalFunction.hpp @@ -0,0 +1,45 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1 if the two trgeometry instants adisjoint. + */ +class AdisjointTrgeometryTrgeometryLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AdisjointTrgeometryTrgeometry"; + AdisjointTrgeometryTrgeometryLogicalFunction(LogicalFunction ref1_wkt, LogicalFunction x1, LogicalFunction y1, LogicalFunction theta1, LogicalFunction ts1, LogicalFunction ref2_wkt, LogicalFunction x2, LogicalFunction y2, LogicalFunction theta2, LogicalFunction ts2); + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AdwithinTcbufferCbufferLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AdwithinTcbufferCbufferLogicalFunction.hpp new file mode 100644 index 0000000000..e58d029e4c --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AdwithinTcbufferCbufferLogicalFunction.hpp @@ -0,0 +1,57 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event always-within-distance between a single-instant tcbuffer and a static cbuffer. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `adwithin_tcbuffer_cbuffer`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. + */ +class AdwithinTcbufferCbufferLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AdwithinTcbufferCbuffer"; + + AdwithinTcbufferCbufferLogicalFunction(LogicalFunction lon, + LogicalFunction lat, + LogicalFunction radius, + LogicalFunction timestamp, + LogicalFunction cbufLit, + LogicalFunction dist); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AdwithinTcbufferGeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AdwithinTcbufferGeoLogicalFunction.hpp index f67ef27054..505d0ab245 100644 --- a/nes-logical-operators/include/Functions/Meos/AdwithinTcbufferGeoLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/AdwithinTcbufferGeoLogicalFunction.hpp @@ -22,17 +22,22 @@ namespace NES { /** - * @brief Returns 1.0 if the tcbuffer is always within dist of the static geometry, 0.0 otherwise. + * @brief Per-event adwithin_tcbuffer_geo spatial predicate. * - * Args: (lon:FLOAT64, lat:FLOAT64, radius:FLOAT64, ts:UINT64, wkt:VARCHAR, dist:FLOAT64) -> FLOAT64. + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `adwithin_tcbuffer_geo`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class AdwithinTcbufferGeoLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "AdwithinTcbufferGeo"; - AdwithinTcbufferGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, - LogicalFunction radius, LogicalFunction ts, - LogicalFunction wkt, LogicalFunction dist); + AdwithinTcbufferGeoLogicalFunction(LogicalFunction lon, + LogicalFunction lat, + LogicalFunction radius, + LogicalFunction timestamp, + LogicalFunction geometry, + LogicalFunction dist); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/AdwithinTcbufferTcbufferLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AdwithinTcbufferTcbufferLogicalFunction.hpp index b67ce5cfad..ad824b3afa 100644 --- a/nes-logical-operators/include/Functions/Meos/AdwithinTcbufferTcbufferLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/AdwithinTcbufferTcbufferLogicalFunction.hpp @@ -22,20 +22,25 @@ namespace NES { /** - * @brief Returns 1.0 if the two tcbuffer instants are always within the given distance, 0.0 otherwise. + * @brief Per-event adwithin_tcbuffer_tcbuffer spatial predicate. * - * Args: (lon1:FLOAT64, lat1:FLOAT64, r1:FLOAT64, ts1:UINT64, - * lon2:FLOAT64, lat2:FLOAT64, r2:FLOAT64, ts2:UINT64, - * dist:FLOAT64) -> FLOAT64. + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `adwithin_tcbuffer_tcbuffer`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class AdwithinTcbufferTcbufferLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "AdwithinTcbufferTcbuffer"; - AdwithinTcbufferTcbufferLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction r1, - LogicalFunction ts1, - LogicalFunction lon2, LogicalFunction lat2, LogicalFunction r2, - LogicalFunction ts2, LogicalFunction dist); + AdwithinTcbufferTcbufferLogicalFunction(LogicalFunction lonA, + LogicalFunction latA, + LogicalFunction radiusA, + LogicalFunction tsA, + LogicalFunction lonB, + LogicalFunction latB, + LogicalFunction radiusB, + LogicalFunction tsB, + LogicalFunction dist); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/AdwithinTgeoGeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AdwithinTgeoGeoLogicalFunction.hpp index 6c8088920f..16c2737d22 100644 --- a/nes-logical-operators/include/Functions/Meos/AdwithinTgeoGeoLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/AdwithinTgeoGeoLogicalFunction.hpp @@ -22,17 +22,21 @@ namespace NES { /** - * @brief Returns 1.0 if temporal geometry is always within dist of the static geometry. + * @brief Per-event adwithin_tgeo_geo spatial predicate. * - * Args: (lon:FLOAT64, lat:FLOAT64, ts:UINT64, wkt:VARCHAR, dist:FLOAT64) -> FLOAT64. + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `adwithin_tgeo_geo`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class AdwithinTgeoGeoLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "AdwithinTgeoGeo"; - AdwithinTgeoGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, - LogicalFunction ts, LogicalFunction wkt, - LogicalFunction dist); + AdwithinTgeoGeoLogicalFunction(LogicalFunction lon, + LogicalFunction lat, + LogicalFunction timestamp, + LogicalFunction geometry, + LogicalFunction dist); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/AdwithinTgeoTgeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AdwithinTgeoTgeoLogicalFunction.hpp index 689bdfbfda..4ad94d8c49 100644 --- a/nes-logical-operators/include/Functions/Meos/AdwithinTgeoTgeoLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/AdwithinTgeoTgeoLogicalFunction.hpp @@ -22,13 +22,23 @@ namespace NES { /** - * @brief Tests whether two temporal geometries are always within a distance. + * @brief Per-event adwithin_tgeo_tgeo spatial predicate. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `adwithin_tgeo_tgeo`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class AdwithinTgeoTgeoLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "AdwithinTgeoTgeo"; - AdwithinTgeoTgeoLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction ts1, LogicalFunction lon2, LogicalFunction lat2, LogicalFunction ts2, LogicalFunction dist); + AdwithinTgeoTgeoLogicalFunction(LogicalFunction lonA, + LogicalFunction latA, + LogicalFunction tsA, + LogicalFunction lonB, + LogicalFunction latB, + LogicalFunction tsB, + LogicalFunction dist); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/AdwithinTrgeometryGeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AdwithinTrgeometryGeoLogicalFunction.hpp new file mode 100644 index 0000000000..287f9ef3ec --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AdwithinTrgeometryGeoLogicalFunction.hpp @@ -0,0 +1,45 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1 if the trgeometry instant is within dist of the geometry (adwithin). + */ +class AdwithinTrgeometryGeoLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AdwithinTrgeometryGeo"; + AdwithinTrgeometryGeoLogicalFunction(LogicalFunction ref_wkt, LogicalFunction x1, LogicalFunction y1, LogicalFunction theta1, LogicalFunction ts1, LogicalFunction tgt_wkt, LogicalFunction dist); + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AdwithinTrgeometryTrgeometryLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AdwithinTrgeometryTrgeometryLogicalFunction.hpp new file mode 100644 index 0000000000..55e2cb4be7 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AdwithinTrgeometryTrgeometryLogicalFunction.hpp @@ -0,0 +1,45 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1 if the two trgeometry instants are within dist (adwithin). + */ +class AdwithinTrgeometryTrgeometryLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AdwithinTrgeometryTrgeometry"; + AdwithinTrgeometryTrgeometryLogicalFunction(LogicalFunction ref1_wkt, LogicalFunction x1, LogicalFunction y1, LogicalFunction theta1, LogicalFunction ts1, LogicalFunction ref2_wkt, LogicalFunction x2, LogicalFunction y2, LogicalFunction theta2, LogicalFunction ts2, LogicalFunction dist); + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AintersectsTcbufferGeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AintersectsTcbufferGeoLogicalFunction.hpp index 7d8acc618a..da20f2ea06 100644 --- a/nes-logical-operators/include/Functions/Meos/AintersectsTcbufferGeoLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/AintersectsTcbufferGeoLogicalFunction.hpp @@ -22,17 +22,21 @@ namespace NES { /** - * @brief Returns 1.0 if the tcbuffer always intersects the static geometry, 0.0 otherwise. + * @brief Per-event aintersects_tcbuffer_geo spatial predicate. * - * Args: (lon:FLOAT64, lat:FLOAT64, radius:FLOAT64, ts:UINT64, wkt:VARCHAR) -> FLOAT64. + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `aintersects_tcbuffer_geo`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class AintersectsTcbufferGeoLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "AintersectsTcbufferGeo"; - AintersectsTcbufferGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, - LogicalFunction radius, LogicalFunction ts, - LogicalFunction wkt); + AintersectsTcbufferGeoLogicalFunction(LogicalFunction lon, + LogicalFunction lat, + LogicalFunction radius, + LogicalFunction timestamp, + LogicalFunction geometry); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/AintersectsTcbufferTcbufferLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AintersectsTcbufferTcbufferLogicalFunction.hpp index 826b06ed8f..417adb9ef7 100644 --- a/nes-logical-operators/include/Functions/Meos/AintersectsTcbufferTcbufferLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/AintersectsTcbufferTcbufferLogicalFunction.hpp @@ -22,19 +22,24 @@ namespace NES { /** - * @brief Returns 1.0 if the two tcbuffer instants always intersect, 0.0 otherwise. + * @brief Per-event aintersects_tcbuffer_tcbuffer spatial predicate. * - * Args: (lon1:FLOAT64, lat1:FLOAT64, r1:FLOAT64, ts1:UINT64, - * lon2:FLOAT64, lat2:FLOAT64, r2:FLOAT64, ts2:UINT64) -> FLOAT64. + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `aintersects_tcbuffer_tcbuffer`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class AintersectsTcbufferTcbufferLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "AintersectsTcbufferTcbuffer"; - AintersectsTcbufferTcbufferLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction r1, - LogicalFunction ts1, - LogicalFunction lon2, LogicalFunction lat2, LogicalFunction r2, - LogicalFunction ts2); + AintersectsTcbufferTcbufferLogicalFunction(LogicalFunction lonA, + LogicalFunction latA, + LogicalFunction radiusA, + LogicalFunction tsA, + LogicalFunction lonB, + LogicalFunction latB, + LogicalFunction radiusB, + LogicalFunction tsB); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/AintersectsTgeoGeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AintersectsTgeoGeoLogicalFunction.hpp index 8223b2e12d..98a8445be3 100644 --- a/nes-logical-operators/include/Functions/Meos/AintersectsTgeoGeoLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/AintersectsTgeoGeoLogicalFunction.hpp @@ -22,16 +22,20 @@ namespace NES { /** - * @brief Returns 1.0 if temporal geometry always intersects the static geometry. + * @brief Per-event aintersects_tgeo_geo spatial predicate. * - * Args: (lon:FLOAT64, lat:FLOAT64, ts:UINT64, wkt:VARCHAR) -> FLOAT64. + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `aintersects_tgeo_geo`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class AintersectsTgeoGeoLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "AintersectsTgeoGeo"; - AintersectsTgeoGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, - LogicalFunction ts, LogicalFunction wkt); + AintersectsTgeoGeoLogicalFunction(LogicalFunction lon, + LogicalFunction lat, + LogicalFunction timestamp, + LogicalFunction geometry); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/AintersectsTgeoTgeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AintersectsTgeoTgeoLogicalFunction.hpp index 9958512ca8..a6f23c20a5 100644 --- a/nes-logical-operators/include/Functions/Meos/AintersectsTgeoTgeoLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/AintersectsTgeoTgeoLogicalFunction.hpp @@ -22,13 +22,22 @@ namespace NES { /** - * @brief Tests whether two temporal geometries always intersect. + * @brief Per-event aintersects_tgeo_tgeo spatial predicate. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `aintersects_tgeo_tgeo`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class AintersectsTgeoTgeoLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "AintersectsTgeoTgeo"; - AintersectsTgeoTgeoLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction ts1, LogicalFunction lon2, LogicalFunction lat2, LogicalFunction ts2); + AintersectsTgeoTgeoLogicalFunction(LogicalFunction lonA, + LogicalFunction latA, + LogicalFunction tsA, + LogicalFunction lonB, + LogicalFunction latB, + LogicalFunction tsB); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/AintersectsTrgeometryGeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AintersectsTrgeometryGeoLogicalFunction.hpp new file mode 100644 index 0000000000..ee35c37b1c --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AintersectsTrgeometryGeoLogicalFunction.hpp @@ -0,0 +1,45 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1 if the trgeometry instant aintersects the geometry. + */ +class AintersectsTrgeometryGeoLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AintersectsTrgeometryGeo"; + AintersectsTrgeometryGeoLogicalFunction(LogicalFunction ref_wkt, LogicalFunction x1, LogicalFunction y1, LogicalFunction theta1, LogicalFunction ts1, LogicalFunction tgt_wkt); + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AintersectsTrgeometryTrgeometryLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AintersectsTrgeometryTrgeometryLogicalFunction.hpp new file mode 100644 index 0000000000..f8e7958ac8 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AintersectsTrgeometryTrgeometryLogicalFunction.hpp @@ -0,0 +1,45 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1 if the two trgeometry instants aintersects. + */ +class AintersectsTrgeometryTrgeometryLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AintersectsTrgeometryTrgeometry"; + AintersectsTrgeometryTrgeometryLogicalFunction(LogicalFunction ref1_wkt, LogicalFunction x1, LogicalFunction y1, LogicalFunction theta1, LogicalFunction ts1, LogicalFunction ref2_wkt, LogicalFunction x2, LogicalFunction y2, LogicalFunction theta2, LogicalFunction ts2); + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysEqBigintTbigintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysEqBigintTbigintLogicalFunction.hpp index c913c19a88..dbd3859593 100644 --- a/nes-logical-operators/include/Functions/Meos/AlwaysEqBigintTbigintLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/AlwaysEqBigintTbigintLogicalFunction.hpp @@ -22,19 +22,19 @@ namespace NES { /** - * @brief Per-event always_eq_bigint_tbigint: tests if a single-instant tfloat value ever equals a threshold. + * @brief Per-event always_eq_bigint_tbigint: always-equal scalar bigint vs tbigint. * * Generated by tools/codegen/codegen_nebula.py from the MEOS function - * `always_eq_bigint_tbigint`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), - * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + * `always_eq_bigint_tbigint`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class AlwaysEqBigintTbigintLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "AlwaysEqBigintTbigint"; - AlwaysEqBigintTbigintLogicalFunction(LogicalFunction value, - LogicalFunction threshold, - LogicalFunction ts); + AlwaysEqBigintTbigintLogicalFunction(LogicalFunction arg0, + LogicalFunction value, + LogicalFunction ts); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysEqBoolTboolLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysEqBoolTboolLogicalFunction.hpp index ef854f054f..6d3ab29f89 100644 --- a/nes-logical-operators/include/Functions/Meos/AlwaysEqBoolTboolLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/AlwaysEqBoolTboolLogicalFunction.hpp @@ -22,19 +22,19 @@ namespace NES { /** - * @brief Per-event always_eq_bool_tbool: tests if a single-instant tfloat value ever equals a threshold. + * @brief Per-event always_eq_bool_tbool: always-equal scalar bool vs tbool. * * Generated by tools/codegen/codegen_nebula.py from the MEOS function - * `always_eq_bool_tbool`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), - * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + * `always_eq_bool_tbool`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class AlwaysEqBoolTboolLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "AlwaysEqBoolTbool"; - AlwaysEqBoolTboolLogicalFunction(LogicalFunction value, - LogicalFunction threshold, - LogicalFunction ts); + AlwaysEqBoolTboolLogicalFunction(LogicalFunction arg0, + LogicalFunction value, + LogicalFunction ts); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysEqNpointTnpointLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysEqNpointTnpointLogicalFunction.hpp index 0cf7786548..6e5a289a36 100644 --- a/nes-logical-operators/include/Functions/Meos/AlwaysEqNpointTnpointLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/AlwaysEqNpointTnpointLogicalFunction.hpp @@ -22,13 +22,21 @@ namespace NES { /** - * @brief Returns 1.0 if the static npoint is always equal to the tnpoint instant, 0.0 otherwise. + * @brief Always eq npoint vs tnpoint + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `always_eq_npoint_tnpoint`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class AlwaysEqNpointTnpointLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "AlwaysEqNpointTnpoint"; - AlwaysEqNpointTnpointLogicalFunction(LogicalFunction rid_np, LogicalFunction pos_np, LogicalFunction rid_tp, LogicalFunction pos_tp, LogicalFunction ts); + AlwaysEqNpointTnpointLogicalFunction(LogicalFunction rid0, + LogicalFunction frac0, + LogicalFunction rid, + LogicalFunction frac, + LogicalFunction ts); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysEqPoseTposeLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysEqPoseTposeLogicalFunction.hpp index 6e2ad749d8..5c99ea8156 100644 --- a/nes-logical-operators/include/Functions/Meos/AlwaysEqPoseTposeLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/AlwaysEqPoseTposeLogicalFunction.hpp @@ -22,13 +22,23 @@ namespace NES { /** - * @brief Returns 1.0 if the static pose is always equal to the 2D tpose instant, 0.0 otherwise. + * @brief Always eq pose vs tpose + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `always_eq_pose_tpose`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class AlwaysEqPoseTposeLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "AlwaysEqPoseTpose"; - AlwaysEqPoseTposeLogicalFunction(LogicalFunction x2, LogicalFunction y2, LogicalFunction theta2, LogicalFunction x, LogicalFunction y, LogicalFunction theta, LogicalFunction ts); + AlwaysEqPoseTposeLogicalFunction(LogicalFunction px0, + LogicalFunction py0, + LogicalFunction ptheta0, + LogicalFunction x, + LogicalFunction y, + LogicalFunction theta, + LogicalFunction ts); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysEqTbigintBigintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysEqTbigintBigintLogicalFunction.hpp index 73cacef859..db9b551a91 100644 --- a/nes-logical-operators/include/Functions/Meos/AlwaysEqTbigintBigintLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/AlwaysEqTbigintBigintLogicalFunction.hpp @@ -22,19 +22,19 @@ namespace NES { /** - * @brief Per-event always_eq_tbigint_bigint: tests if a single-instant tbigint value always eqs a threshold. + * @brief Per-event always_eq_tbigint_bigint: always-equal tbigint vs scalar bigint. * * Generated by tools/codegen/codegen_nebula.py from the MEOS function - * `always_eq_tbigint_bigint`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), - * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + * `always_eq_tbigint_bigint`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class AlwaysEqTbigintBigintLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "AlwaysEqTbigintBigint"; AlwaysEqTbigintBigintLogicalFunction(LogicalFunction value, - LogicalFunction threshold, - LogicalFunction ts); + LogicalFunction ts, + LogicalFunction arg0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysEqTboolBoolLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysEqTboolBoolLogicalFunction.hpp index c3bab7ca57..0d75fe3be3 100644 --- a/nes-logical-operators/include/Functions/Meos/AlwaysEqTboolBoolLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/AlwaysEqTboolBoolLogicalFunction.hpp @@ -22,19 +22,19 @@ namespace NES { /** - * @brief Per-event always_eq_tbool_bool: tests if a single-instant tfloat value ever equals a threshold. + * @brief Per-event always_eq_tbool_bool: always-equal tbool vs scalar bool. * * Generated by tools/codegen/codegen_nebula.py from the MEOS function - * `always_eq_tbool_bool`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), - * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + * `always_eq_tbool_bool`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class AlwaysEqTboolBoolLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "AlwaysEqTboolBool"; AlwaysEqTboolBoolLogicalFunction(LogicalFunction value, - LogicalFunction threshold, - LogicalFunction ts); + LogicalFunction ts, + LogicalFunction arg0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysEqTcbufferTcbufferLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysEqTcbufferTcbufferLogicalFunction.hpp index dfd2fa0236..e7ea5b5092 100644 --- a/nes-logical-operators/include/Functions/Meos/AlwaysEqTcbufferTcbufferLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/AlwaysEqTcbufferTcbufferLogicalFunction.hpp @@ -22,19 +22,24 @@ namespace NES { /** - * @brief Returns 1.0 if the two tcbuffer instants are always equal, 0.0 otherwise. + * @brief Per-event always_eq_tcbuffer_tcbuffer spatial predicate. * - * Args: (lon1:FLOAT64, lat1:FLOAT64, r1:FLOAT64, ts1:UINT64, - * lon2:FLOAT64, lat2:FLOAT64, r2:FLOAT64, ts2:UINT64) -> FLOAT64. + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `always_eq_tcbuffer_tcbuffer`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class AlwaysEqTcbufferTcbufferLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "AlwaysEqTcbufferTcbuffer"; - AlwaysEqTcbufferTcbufferLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction r1, - LogicalFunction ts1, - LogicalFunction lon2, LogicalFunction lat2, LogicalFunction r2, - LogicalFunction ts2); + AlwaysEqTcbufferTcbufferLogicalFunction(LogicalFunction lonA, + LogicalFunction latA, + LogicalFunction radiusA, + LogicalFunction tsA, + LogicalFunction lonB, + LogicalFunction latB, + LogicalFunction radiusB, + LogicalFunction tsB); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysEqTextTtextLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysEqTextTtextLogicalFunction.hpp index 17ecec6cf6..f54c366edd 100644 --- a/nes-logical-operators/include/Functions/Meos/AlwaysEqTextTtextLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/AlwaysEqTextTtextLogicalFunction.hpp @@ -13,27 +13,38 @@ */ #pragma once + #include #include +#include #include namespace NES { +/** + * @brief Always eqqual text vs ttext + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `always_eq_text_ttext(txt0, temp)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. + */ class AlwaysEqTextTtextLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "AlwaysEqTextTtext"; - AlwaysEqTextTtextLogicalFunction(LogicalFunction value, LogicalFunction ref, LogicalFunction ts); - - DataType getDataType() const override; - LogicalFunction withDataType(const DataType&) const override; - std::vector getChildren() const override; - LogicalFunction withChildren(const std::vector&) const override; - std::string_view getType() const override; - bool operator==(const LogicalFunctionConcept&) const override; - std::string explain(ExplainVerbosity) const override; - LogicalFunction withInferredDataType(const Schema&) const override; - SerializableFunction serialize() const override; + AlwaysEqTextTtextLogicalFunction(LogicalFunction arg0, + LogicalFunction value, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; private: DataType dataType; diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysEqTgeoGeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysEqTgeoGeoLogicalFunction.hpp index 82746232f1..e7d31f06ad 100644 --- a/nes-logical-operators/include/Functions/Meos/AlwaysEqTgeoGeoLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/AlwaysEqTgeoGeoLogicalFunction.hpp @@ -22,16 +22,20 @@ namespace NES { /** - * @brief Returns 1.0 if the temporal geometry is always equal to the static geometry. + * @brief Per-event always_eq_tgeo_geo spatial predicate. * - * Args: (lon:FLOAT64, lat:FLOAT64, ts:UINT64, wkt:VARCHAR) -> FLOAT64. + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `always_eq_tgeo_geo`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class AlwaysEqTgeoGeoLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "AlwaysEqTgeoGeo"; - AlwaysEqTgeoGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, - LogicalFunction ts, LogicalFunction wkt); + AlwaysEqTgeoGeoLogicalFunction(LogicalFunction lon, + LogicalFunction lat, + LogicalFunction timestamp, + LogicalFunction geometry); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysEqTgeoTgeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysEqTgeoTgeoLogicalFunction.hpp index 49eb7868b3..ab2b7b4115 100644 --- a/nes-logical-operators/include/Functions/Meos/AlwaysEqTgeoTgeoLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/AlwaysEqTgeoTgeoLogicalFunction.hpp @@ -22,13 +22,22 @@ namespace NES { /** - * @brief Tests whether two temporal geometries are always spatially equal. + * @brief Per-event always_eq_tgeo_tgeo spatial predicate. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `always_eq_tgeo_tgeo`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class AlwaysEqTgeoTgeoLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "AlwaysEqTgeoTgeo"; - AlwaysEqTgeoTgeoLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction ts1, LogicalFunction lon2, LogicalFunction lat2, LogicalFunction ts2); + AlwaysEqTgeoTgeoLogicalFunction(LogicalFunction lonA, + LogicalFunction latA, + LogicalFunction tsA, + LogicalFunction lonB, + LogicalFunction latB, + LogicalFunction tsB); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysEqTh3indexH3indexLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysEqTh3indexH3indexLogicalFunction.hpp index d2c43b7f9f..090c3d06f3 100644 --- a/nes-logical-operators/include/Functions/Meos/AlwaysEqTh3indexH3indexLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/AlwaysEqTh3indexH3indexLogicalFunction.hpp @@ -22,15 +22,19 @@ namespace NES { /** - * @brief Returns 1.0 if the th3index instant is always equal to the target H3 cell. + * @brief Always equal th3index vs h3index * - * Args: (cell:UINT64, ts:UINT64, target:UINT64) -> FLOAT64. + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `always_eq_th3index_h3index(temp, (H3Index)arg0)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class AlwaysEqTh3indexH3indexLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "AlwaysEqTh3indexH3index"; - AlwaysEqTh3indexH3indexLogicalFunction(LogicalFunction cell, LogicalFunction ts, LogicalFunction target); + AlwaysEqTh3indexH3indexLogicalFunction(LogicalFunction cell, + LogicalFunction ts, + LogicalFunction arg0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysEqTjsonbJsonbLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysEqTjsonbJsonbLogicalFunction.hpp index e0427b9aba..42a8ec0c6d 100644 --- a/nes-logical-operators/include/Functions/Meos/AlwaysEqTjsonbJsonbLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/AlwaysEqTjsonbJsonbLogicalFunction.hpp @@ -22,13 +22,19 @@ namespace NES { /** - * @brief Returns 1.0 if the tjsonb instant value always equals the target Jsonb. + * @brief Always equal tjsonb vs jsonb + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `always_eq_tjsonb_jsonb`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class AlwaysEqTjsonbJsonbLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "AlwaysEqTjsonbJsonb"; - AlwaysEqTjsonbJsonbLogicalFunction(LogicalFunction json_str, LogicalFunction ts, LogicalFunction target_json); + AlwaysEqTjsonbJsonbLogicalFunction(LogicalFunction json_str, + LogicalFunction ts, + LogicalFunction arg0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysEqTjsonbTjsonbLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysEqTjsonbTjsonbLogicalFunction.hpp index d73da9b4af..906d23e14e 100644 --- a/nes-logical-operators/include/Functions/Meos/AlwaysEqTjsonbTjsonbLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/AlwaysEqTjsonbTjsonbLogicalFunction.hpp @@ -22,13 +22,20 @@ namespace NES { /** - * @brief Returns 1.0 if the two tjsonb instants are always equal. + * @brief Always equal tjsonb vs tjsonb + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `always_eq_tjsonb_tjsonb`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class AlwaysEqTjsonbTjsonbLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "AlwaysEqTjsonbTjsonb"; - AlwaysEqTjsonbTjsonbLogicalFunction(LogicalFunction json1, LogicalFunction ts1, LogicalFunction json2, LogicalFunction ts2); + AlwaysEqTjsonbTjsonbLogicalFunction(LogicalFunction json_str, + LogicalFunction ts, + LogicalFunction json0, + LogicalFunction ts0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysEqTnpointNpointLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysEqTnpointNpointLogicalFunction.hpp index 72f359cb5c..918dfd31bf 100644 --- a/nes-logical-operators/include/Functions/Meos/AlwaysEqTnpointNpointLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/AlwaysEqTnpointNpointLogicalFunction.hpp @@ -22,13 +22,21 @@ namespace NES { /** - * @brief Returns 1.0 if the tnpoint instant is always equal to the static npoint, 0.0 otherwise. + * @brief Always eq tnpoint vs npoint + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `always_eq_tnpoint_npoint`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class AlwaysEqTnpointNpointLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "AlwaysEqTnpointNpoint"; - AlwaysEqTnpointNpointLogicalFunction(LogicalFunction rid1, LogicalFunction pos1, LogicalFunction ts, LogicalFunction rid2, LogicalFunction pos2); + AlwaysEqTnpointNpointLogicalFunction(LogicalFunction rid, + LogicalFunction frac, + LogicalFunction ts, + LogicalFunction rid0, + LogicalFunction frac0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysEqTnpointTnpointLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysEqTnpointTnpointLogicalFunction.hpp index 550d19e5ef..30c4d9db23 100644 --- a/nes-logical-operators/include/Functions/Meos/AlwaysEqTnpointTnpointLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/AlwaysEqTnpointTnpointLogicalFunction.hpp @@ -22,17 +22,22 @@ namespace NES { /** - * @brief Returns 1.0 if the two tnpoint instants are always equal, 0.0 otherwise. + * @brief Always eq tnpoint vs tnpoint * - * Args: (rid1:UINT64, pos1:FLOAT64, ts1:UINT64, - * rid2:UINT64, pos2:FLOAT64, ts2:UINT64) -> FLOAT64. + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `always_eq_tnpoint_tnpoint`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class AlwaysEqTnpointTnpointLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "AlwaysEqTnpointTnpoint"; - AlwaysEqTnpointTnpointLogicalFunction(LogicalFunction rid1, LogicalFunction pos1, LogicalFunction ts1, - LogicalFunction rid2, LogicalFunction pos2, LogicalFunction ts2); + AlwaysEqTnpointTnpointLogicalFunction(LogicalFunction rid, + LogicalFunction frac, + LogicalFunction ts, + LogicalFunction rid0, + LogicalFunction frac0, + LogicalFunction ts0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysEqTposePoseLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysEqTposePoseLogicalFunction.hpp index 80eeee56b3..bfe7f5328e 100644 --- a/nes-logical-operators/include/Functions/Meos/AlwaysEqTposePoseLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/AlwaysEqTposePoseLogicalFunction.hpp @@ -22,13 +22,23 @@ namespace NES { /** - * @brief Returns 1.0 if the 2D tpose instant is always equal to the static pose, 0.0 otherwise. + * @brief Always eq tpose vs pose + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `always_eq_tpose_pose`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class AlwaysEqTposePoseLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "AlwaysEqTposePose"; - AlwaysEqTposePoseLogicalFunction(LogicalFunction x, LogicalFunction y, LogicalFunction theta, LogicalFunction ts, LogicalFunction x2, LogicalFunction y2, LogicalFunction theta2); + AlwaysEqTposePoseLogicalFunction(LogicalFunction x, + LogicalFunction y, + LogicalFunction theta, + LogicalFunction ts, + LogicalFunction px0, + LogicalFunction py0, + LogicalFunction ptheta0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysEqTposeTposeLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysEqTposeTposeLogicalFunction.hpp index 815e30386c..7765ebfd85 100644 --- a/nes-logical-operators/include/Functions/Meos/AlwaysEqTposeTposeLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/AlwaysEqTposeTposeLogicalFunction.hpp @@ -22,19 +22,24 @@ namespace NES { /** - * @brief Returns 1.0 if the two 2D tpose instants are always equal, 0.0 otherwise. + * @brief Always eq tpose vs tpose * - * Args: (x1:FLOAT64, y1:FLOAT64, theta1:FLOAT64, ts1:UINT64, - * x2:FLOAT64, y2:FLOAT64, theta2:FLOAT64, ts2:UINT64) -> FLOAT64. + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `always_eq_tpose_tpose`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class AlwaysEqTposeTposeLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "AlwaysEqTposeTpose"; - AlwaysEqTposeTposeLogicalFunction(LogicalFunction x1, LogicalFunction y1, LogicalFunction theta1, - LogicalFunction ts1, - LogicalFunction x2, LogicalFunction y2, LogicalFunction theta2, - LogicalFunction ts2); + AlwaysEqTposeTposeLogicalFunction(LogicalFunction x, + LogicalFunction y, + LogicalFunction theta, + LogicalFunction ts, + LogicalFunction px0, + LogicalFunction py0, + LogicalFunction ptheta0, + LogicalFunction ts0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysEqTquadbinQuadbinLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysEqTquadbinQuadbinLogicalFunction.hpp index 0d7f0ea372..5334d32e7d 100644 --- a/nes-logical-operators/include/Functions/Meos/AlwaysEqTquadbinQuadbinLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/AlwaysEqTquadbinQuadbinLogicalFunction.hpp @@ -22,12 +22,20 @@ namespace NES { /** - * @brief Returns 1 if the tquadbin instant always equals the Quadbin cell. + * @brief Always equal tquadbin vs quadbin + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `always_eq_tquadbin_quadbin(temp, (Quadbin)arg0)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class AlwaysEqTquadbinQuadbinLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "AlwaysEqTquadbinQuadbin"; - AlwaysEqTquadbinQuadbinLogicalFunction(LogicalFunction inst_cell, LogicalFunction ts, LogicalFunction cell); + + AlwaysEqTquadbinQuadbinLogicalFunction(LogicalFunction cell, + LogicalFunction ts, + LogicalFunction arg0); + DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; std::vector getChildren() const override; @@ -37,6 +45,7 @@ class AlwaysEqTquadbinQuadbinLogicalFunction : public LogicalFunctionConcept { std::string explain(ExplainVerbosity verbosity) const override; LogicalFunction withInferredDataType(const Schema& schema) const override; SerializableFunction serialize() const override; + private: DataType dataType; std::vector parameters; diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysEqTtextTextLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysEqTtextTextLogicalFunction.hpp index 819dc5fcba..3a7b5590a2 100644 --- a/nes-logical-operators/include/Functions/Meos/AlwaysEqTtextTextLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/AlwaysEqTtextTextLogicalFunction.hpp @@ -13,27 +13,38 @@ */ #pragma once + #include #include +#include #include namespace NES { +/** + * @brief Always eqqual ttext vs text + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `always_eq_ttext_text(temp, txt0)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. + */ class AlwaysEqTtextTextLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "AlwaysEqTtextText"; - AlwaysEqTtextTextLogicalFunction(LogicalFunction value, LogicalFunction ref, LogicalFunction ts); - - DataType getDataType() const override; - LogicalFunction withDataType(const DataType&) const override; - std::vector getChildren() const override; - LogicalFunction withChildren(const std::vector&) const override; - std::string_view getType() const override; - bool operator==(const LogicalFunctionConcept&) const override; - std::string explain(ExplainVerbosity) const override; - LogicalFunction withInferredDataType(const Schema&) const override; - SerializableFunction serialize() const override; + AlwaysEqTtextTextLogicalFunction(LogicalFunction value, + LogicalFunction ts, + LogicalFunction arg0); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; private: DataType dataType; diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysGeBigintTbigintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysGeBigintTbigintLogicalFunction.hpp index 50be02fa7d..04ae2bae4c 100644 --- a/nes-logical-operators/include/Functions/Meos/AlwaysGeBigintTbigintLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/AlwaysGeBigintTbigintLogicalFunction.hpp @@ -22,19 +22,19 @@ namespace NES { /** - * @brief Per-event always_ge_bigint_tbigint: tests if a single-instant tfloat value ever equals a threshold. + * @brief Per-event always_ge_bigint_tbigint: always-greater-or-equal scalar bigint vs tbigint. * * Generated by tools/codegen/codegen_nebula.py from the MEOS function - * `always_ge_bigint_tbigint`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), - * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + * `always_ge_bigint_tbigint`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class AlwaysGeBigintTbigintLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "AlwaysGeBigintTbigint"; - AlwaysGeBigintTbigintLogicalFunction(LogicalFunction value, - LogicalFunction threshold, - LogicalFunction ts); + AlwaysGeBigintTbigintLogicalFunction(LogicalFunction arg0, + LogicalFunction value, + LogicalFunction ts); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysGeTbigintBigintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysGeTbigintBigintLogicalFunction.hpp index a31094c055..a1440b0264 100644 --- a/nes-logical-operators/include/Functions/Meos/AlwaysGeTbigintBigintLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/AlwaysGeTbigintBigintLogicalFunction.hpp @@ -22,19 +22,19 @@ namespace NES { /** - * @brief Per-event always_ge_tbigint_bigint: tests if a single-instant tbigint value always ges a threshold. + * @brief Per-event always_ge_tbigint_bigint: always-greater-or-equal tbigint vs scalar bigint. * * Generated by tools/codegen/codegen_nebula.py from the MEOS function - * `always_ge_tbigint_bigint`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), - * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + * `always_ge_tbigint_bigint`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class AlwaysGeTbigintBigintLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "AlwaysGeTbigintBigint"; AlwaysGeTbigintBigintLogicalFunction(LogicalFunction value, - LogicalFunction threshold, - LogicalFunction ts); + LogicalFunction ts, + LogicalFunction arg0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysGeTextTtextLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysGeTextTtextLogicalFunction.hpp index 81b80ff5bb..d905179dab 100644 --- a/nes-logical-operators/include/Functions/Meos/AlwaysGeTextTtextLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/AlwaysGeTextTtextLogicalFunction.hpp @@ -13,27 +13,38 @@ */ #pragma once + #include #include +#include #include namespace NES { +/** + * @brief Always gequal text vs ttext + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `always_ge_text_ttext(txt0, temp)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. + */ class AlwaysGeTextTtextLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "AlwaysGeTextTtext"; - AlwaysGeTextTtextLogicalFunction(LogicalFunction value, LogicalFunction ref, LogicalFunction ts); - - DataType getDataType() const override; - LogicalFunction withDataType(const DataType&) const override; - std::vector getChildren() const override; - LogicalFunction withChildren(const std::vector&) const override; - std::string_view getType() const override; - bool operator==(const LogicalFunctionConcept&) const override; - std::string explain(ExplainVerbosity) const override; - LogicalFunction withInferredDataType(const Schema&) const override; - SerializableFunction serialize() const override; + AlwaysGeTextTtextLogicalFunction(LogicalFunction arg0, + LogicalFunction value, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; private: DataType dataType; diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysGeTtextTextLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysGeTtextTextLogicalFunction.hpp index 532d087309..00c95ae97b 100644 --- a/nes-logical-operators/include/Functions/Meos/AlwaysGeTtextTextLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/AlwaysGeTtextTextLogicalFunction.hpp @@ -13,27 +13,38 @@ */ #pragma once + #include #include +#include #include namespace NES { +/** + * @brief Always gequal ttext vs text + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `always_ge_ttext_text(temp, txt0)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. + */ class AlwaysGeTtextTextLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "AlwaysGeTtextText"; - AlwaysGeTtextTextLogicalFunction(LogicalFunction value, LogicalFunction ref, LogicalFunction ts); - - DataType getDataType() const override; - LogicalFunction withDataType(const DataType&) const override; - std::vector getChildren() const override; - LogicalFunction withChildren(const std::vector&) const override; - std::string_view getType() const override; - bool operator==(const LogicalFunctionConcept&) const override; - std::string explain(ExplainVerbosity) const override; - LogicalFunction withInferredDataType(const Schema&) const override; - SerializableFunction serialize() const override; + AlwaysGeTtextTextLogicalFunction(LogicalFunction value, + LogicalFunction ts, + LogicalFunction arg0); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; private: DataType dataType; diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysGtBigintTbigintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysGtBigintTbigintLogicalFunction.hpp index 8a13220e59..349c9fb44c 100644 --- a/nes-logical-operators/include/Functions/Meos/AlwaysGtBigintTbigintLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/AlwaysGtBigintTbigintLogicalFunction.hpp @@ -22,19 +22,19 @@ namespace NES { /** - * @brief Per-event always_gt_bigint_tbigint: tests if a single-instant tfloat value ever equals a threshold. + * @brief Per-event always_gt_bigint_tbigint: always-greater-than scalar bigint vs tbigint. * * Generated by tools/codegen/codegen_nebula.py from the MEOS function - * `always_gt_bigint_tbigint`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), - * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + * `always_gt_bigint_tbigint`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class AlwaysGtBigintTbigintLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "AlwaysGtBigintTbigint"; - AlwaysGtBigintTbigintLogicalFunction(LogicalFunction value, - LogicalFunction threshold, - LogicalFunction ts); + AlwaysGtBigintTbigintLogicalFunction(LogicalFunction arg0, + LogicalFunction value, + LogicalFunction ts); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysGtTbigintBigintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysGtTbigintBigintLogicalFunction.hpp index 545679adb1..307e268055 100644 --- a/nes-logical-operators/include/Functions/Meos/AlwaysGtTbigintBigintLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/AlwaysGtTbigintBigintLogicalFunction.hpp @@ -22,19 +22,19 @@ namespace NES { /** - * @brief Per-event always_gt_tbigint_bigint: tests if a single-instant tbigint value always gts a threshold. + * @brief Per-event always_gt_tbigint_bigint: always-greater-than tbigint vs scalar bigint. * * Generated by tools/codegen/codegen_nebula.py from the MEOS function - * `always_gt_tbigint_bigint`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), - * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + * `always_gt_tbigint_bigint`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class AlwaysGtTbigintBigintLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "AlwaysGtTbigintBigint"; AlwaysGtTbigintBigintLogicalFunction(LogicalFunction value, - LogicalFunction threshold, - LogicalFunction ts); + LogicalFunction ts, + LogicalFunction arg0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysGtTextTtextLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysGtTextTtextLogicalFunction.hpp index 223bf4e6e0..3043bd6c92 100644 --- a/nes-logical-operators/include/Functions/Meos/AlwaysGtTextTtextLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/AlwaysGtTextTtextLogicalFunction.hpp @@ -13,27 +13,38 @@ */ #pragma once + #include #include +#include #include namespace NES { +/** + * @brief Always gtqual text vs ttext + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `always_gt_text_ttext(txt0, temp)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. + */ class AlwaysGtTextTtextLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "AlwaysGtTextTtext"; - AlwaysGtTextTtextLogicalFunction(LogicalFunction value, LogicalFunction ref, LogicalFunction ts); - - DataType getDataType() const override; - LogicalFunction withDataType(const DataType&) const override; - std::vector getChildren() const override; - LogicalFunction withChildren(const std::vector&) const override; - std::string_view getType() const override; - bool operator==(const LogicalFunctionConcept&) const override; - std::string explain(ExplainVerbosity) const override; - LogicalFunction withInferredDataType(const Schema&) const override; - SerializableFunction serialize() const override; + AlwaysGtTextTtextLogicalFunction(LogicalFunction arg0, + LogicalFunction value, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; private: DataType dataType; diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysGtTtextTextLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysGtTtextTextLogicalFunction.hpp index e66c6ecbe4..bc481f2e42 100644 --- a/nes-logical-operators/include/Functions/Meos/AlwaysGtTtextTextLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/AlwaysGtTtextTextLogicalFunction.hpp @@ -13,27 +13,38 @@ */ #pragma once + #include #include +#include #include namespace NES { +/** + * @brief Always gtqual ttext vs text + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `always_gt_ttext_text(temp, txt0)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. + */ class AlwaysGtTtextTextLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "AlwaysGtTtextText"; - AlwaysGtTtextTextLogicalFunction(LogicalFunction value, LogicalFunction ref, LogicalFunction ts); - - DataType getDataType() const override; - LogicalFunction withDataType(const DataType&) const override; - std::vector getChildren() const override; - LogicalFunction withChildren(const std::vector&) const override; - std::string_view getType() const override; - bool operator==(const LogicalFunctionConcept&) const override; - std::string explain(ExplainVerbosity) const override; - LogicalFunction withInferredDataType(const Schema&) const override; - SerializableFunction serialize() const override; + AlwaysGtTtextTextLogicalFunction(LogicalFunction value, + LogicalFunction ts, + LogicalFunction arg0); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; private: DataType dataType; diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysLeBigintTbigintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysLeBigintTbigintLogicalFunction.hpp index de67cd5e6b..7375a28d46 100644 --- a/nes-logical-operators/include/Functions/Meos/AlwaysLeBigintTbigintLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/AlwaysLeBigintTbigintLogicalFunction.hpp @@ -22,19 +22,19 @@ namespace NES { /** - * @brief Per-event always_le_bigint_tbigint: tests if a single-instant tfloat value ever equals a threshold. + * @brief Per-event always_le_bigint_tbigint: always-less-or-equal scalar bigint vs tbigint. * * Generated by tools/codegen/codegen_nebula.py from the MEOS function - * `always_le_bigint_tbigint`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), - * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + * `always_le_bigint_tbigint`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class AlwaysLeBigintTbigintLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "AlwaysLeBigintTbigint"; - AlwaysLeBigintTbigintLogicalFunction(LogicalFunction value, - LogicalFunction threshold, - LogicalFunction ts); + AlwaysLeBigintTbigintLogicalFunction(LogicalFunction arg0, + LogicalFunction value, + LogicalFunction ts); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysLeTbigintBigintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysLeTbigintBigintLogicalFunction.hpp index 4a536e136f..fc3b11a60b 100644 --- a/nes-logical-operators/include/Functions/Meos/AlwaysLeTbigintBigintLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/AlwaysLeTbigintBigintLogicalFunction.hpp @@ -22,19 +22,19 @@ namespace NES { /** - * @brief Per-event always_le_tbigint_bigint: tests if a single-instant tbigint value always les a threshold. + * @brief Per-event always_le_tbigint_bigint: always-less-or-equal tbigint vs scalar bigint. * * Generated by tools/codegen/codegen_nebula.py from the MEOS function - * `always_le_tbigint_bigint`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), - * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + * `always_le_tbigint_bigint`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class AlwaysLeTbigintBigintLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "AlwaysLeTbigintBigint"; AlwaysLeTbigintBigintLogicalFunction(LogicalFunction value, - LogicalFunction threshold, - LogicalFunction ts); + LogicalFunction ts, + LogicalFunction arg0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysLeTextTtextLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysLeTextTtextLogicalFunction.hpp index df76e16f74..24af55e855 100644 --- a/nes-logical-operators/include/Functions/Meos/AlwaysLeTextTtextLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/AlwaysLeTextTtextLogicalFunction.hpp @@ -13,27 +13,38 @@ */ #pragma once + #include #include +#include #include namespace NES { +/** + * @brief Always lequal text vs ttext + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `always_le_text_ttext(txt0, temp)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. + */ class AlwaysLeTextTtextLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "AlwaysLeTextTtext"; - AlwaysLeTextTtextLogicalFunction(LogicalFunction value, LogicalFunction ref, LogicalFunction ts); - - DataType getDataType() const override; - LogicalFunction withDataType(const DataType&) const override; - std::vector getChildren() const override; - LogicalFunction withChildren(const std::vector&) const override; - std::string_view getType() const override; - bool operator==(const LogicalFunctionConcept&) const override; - std::string explain(ExplainVerbosity) const override; - LogicalFunction withInferredDataType(const Schema&) const override; - SerializableFunction serialize() const override; + AlwaysLeTextTtextLogicalFunction(LogicalFunction arg0, + LogicalFunction value, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; private: DataType dataType; diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysLeTtextTextLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysLeTtextTextLogicalFunction.hpp index 57dc16fb76..e98a7298c4 100644 --- a/nes-logical-operators/include/Functions/Meos/AlwaysLeTtextTextLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/AlwaysLeTtextTextLogicalFunction.hpp @@ -13,27 +13,38 @@ */ #pragma once + #include #include +#include #include namespace NES { +/** + * @brief Always lequal ttext vs text + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `always_le_ttext_text(temp, txt0)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. + */ class AlwaysLeTtextTextLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "AlwaysLeTtextText"; - AlwaysLeTtextTextLogicalFunction(LogicalFunction value, LogicalFunction ref, LogicalFunction ts); - - DataType getDataType() const override; - LogicalFunction withDataType(const DataType&) const override; - std::vector getChildren() const override; - LogicalFunction withChildren(const std::vector&) const override; - std::string_view getType() const override; - bool operator==(const LogicalFunctionConcept&) const override; - std::string explain(ExplainVerbosity) const override; - LogicalFunction withInferredDataType(const Schema&) const override; - SerializableFunction serialize() const override; + AlwaysLeTtextTextLogicalFunction(LogicalFunction value, + LogicalFunction ts, + LogicalFunction arg0); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; private: DataType dataType; diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysLtBigintTbigintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysLtBigintTbigintLogicalFunction.hpp index 890638fcd1..fca1374134 100644 --- a/nes-logical-operators/include/Functions/Meos/AlwaysLtBigintTbigintLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/AlwaysLtBigintTbigintLogicalFunction.hpp @@ -22,19 +22,19 @@ namespace NES { /** - * @brief Per-event always_lt_bigint_tbigint: tests if a single-instant tfloat value ever equals a threshold. + * @brief Per-event always_lt_bigint_tbigint: always-less-than scalar bigint vs tbigint. * * Generated by tools/codegen/codegen_nebula.py from the MEOS function - * `always_lt_bigint_tbigint`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), - * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + * `always_lt_bigint_tbigint`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class AlwaysLtBigintTbigintLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "AlwaysLtBigintTbigint"; - AlwaysLtBigintTbigintLogicalFunction(LogicalFunction value, - LogicalFunction threshold, - LogicalFunction ts); + AlwaysLtBigintTbigintLogicalFunction(LogicalFunction arg0, + LogicalFunction value, + LogicalFunction ts); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysLtTbigintBigintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysLtTbigintBigintLogicalFunction.hpp index 6f59e4f7d2..8651b9e588 100644 --- a/nes-logical-operators/include/Functions/Meos/AlwaysLtTbigintBigintLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/AlwaysLtTbigintBigintLogicalFunction.hpp @@ -22,19 +22,19 @@ namespace NES { /** - * @brief Per-event always_lt_tbigint_bigint: tests if a single-instant tbigint value always lts a threshold. + * @brief Per-event always_lt_tbigint_bigint: always-less-than tbigint vs scalar bigint. * * Generated by tools/codegen/codegen_nebula.py from the MEOS function - * `always_lt_tbigint_bigint`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), - * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + * `always_lt_tbigint_bigint`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class AlwaysLtTbigintBigintLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "AlwaysLtTbigintBigint"; AlwaysLtTbigintBigintLogicalFunction(LogicalFunction value, - LogicalFunction threshold, - LogicalFunction ts); + LogicalFunction ts, + LogicalFunction arg0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysLtTextTtextLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysLtTextTtextLogicalFunction.hpp index 2378a5f910..9a1f2044bd 100644 --- a/nes-logical-operators/include/Functions/Meos/AlwaysLtTextTtextLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/AlwaysLtTextTtextLogicalFunction.hpp @@ -13,27 +13,38 @@ */ #pragma once + #include #include +#include #include namespace NES { +/** + * @brief Always ltqual text vs ttext + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `always_lt_text_ttext(txt0, temp)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. + */ class AlwaysLtTextTtextLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "AlwaysLtTextTtext"; - AlwaysLtTextTtextLogicalFunction(LogicalFunction value, LogicalFunction ref, LogicalFunction ts); - - DataType getDataType() const override; - LogicalFunction withDataType(const DataType&) const override; - std::vector getChildren() const override; - LogicalFunction withChildren(const std::vector&) const override; - std::string_view getType() const override; - bool operator==(const LogicalFunctionConcept&) const override; - std::string explain(ExplainVerbosity) const override; - LogicalFunction withInferredDataType(const Schema&) const override; - SerializableFunction serialize() const override; + AlwaysLtTextTtextLogicalFunction(LogicalFunction arg0, + LogicalFunction value, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; private: DataType dataType; diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysLtTtextTextLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysLtTtextTextLogicalFunction.hpp index 7a7fb42d99..c071ba5eb2 100644 --- a/nes-logical-operators/include/Functions/Meos/AlwaysLtTtextTextLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/AlwaysLtTtextTextLogicalFunction.hpp @@ -13,27 +13,38 @@ */ #pragma once + #include #include +#include #include namespace NES { +/** + * @brief Always ltqual ttext vs text + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `always_lt_ttext_text(temp, txt0)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. + */ class AlwaysLtTtextTextLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "AlwaysLtTtextText"; - AlwaysLtTtextTextLogicalFunction(LogicalFunction value, LogicalFunction ref, LogicalFunction ts); - - DataType getDataType() const override; - LogicalFunction withDataType(const DataType&) const override; - std::vector getChildren() const override; - LogicalFunction withChildren(const std::vector&) const override; - std::string_view getType() const override; - bool operator==(const LogicalFunctionConcept&) const override; - std::string explain(ExplainVerbosity) const override; - LogicalFunction withInferredDataType(const Schema&) const override; - SerializableFunction serialize() const override; + AlwaysLtTtextTextLogicalFunction(LogicalFunction value, + LogicalFunction ts, + LogicalFunction arg0); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; private: DataType dataType; diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysNeBigintTbigintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysNeBigintTbigintLogicalFunction.hpp index d869e96888..410c1e4201 100644 --- a/nes-logical-operators/include/Functions/Meos/AlwaysNeBigintTbigintLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/AlwaysNeBigintTbigintLogicalFunction.hpp @@ -22,19 +22,19 @@ namespace NES { /** - * @brief Per-event always_ne_bigint_tbigint: tests if a single-instant tfloat value ever equals a threshold. + * @brief Per-event always_ne_bigint_tbigint: always-not-equal scalar bigint vs tbigint. * * Generated by tools/codegen/codegen_nebula.py from the MEOS function - * `always_ne_bigint_tbigint`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), - * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + * `always_ne_bigint_tbigint`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class AlwaysNeBigintTbigintLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "AlwaysNeBigintTbigint"; - AlwaysNeBigintTbigintLogicalFunction(LogicalFunction value, - LogicalFunction threshold, - LogicalFunction ts); + AlwaysNeBigintTbigintLogicalFunction(LogicalFunction arg0, + LogicalFunction value, + LogicalFunction ts); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysNeBoolTboolLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysNeBoolTboolLogicalFunction.hpp index 2be1fc26db..19c95e0dfb 100644 --- a/nes-logical-operators/include/Functions/Meos/AlwaysNeBoolTboolLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/AlwaysNeBoolTboolLogicalFunction.hpp @@ -22,19 +22,19 @@ namespace NES { /** - * @brief Per-event always_ne_bool_tbool: tests if a single-instant tfloat value ever equals a threshold. + * @brief Per-event always_ne_bool_tbool: always-not-equal scalar bool vs tbool. * * Generated by tools/codegen/codegen_nebula.py from the MEOS function - * `always_ne_bool_tbool`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), - * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + * `always_ne_bool_tbool`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class AlwaysNeBoolTboolLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "AlwaysNeBoolTbool"; - AlwaysNeBoolTboolLogicalFunction(LogicalFunction value, - LogicalFunction threshold, - LogicalFunction ts); + AlwaysNeBoolTboolLogicalFunction(LogicalFunction arg0, + LogicalFunction value, + LogicalFunction ts); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysNeNpointTnpointLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysNeNpointTnpointLogicalFunction.hpp index adabbaa11e..93d0c94205 100644 --- a/nes-logical-operators/include/Functions/Meos/AlwaysNeNpointTnpointLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/AlwaysNeNpointTnpointLogicalFunction.hpp @@ -22,13 +22,21 @@ namespace NES { /** - * @brief Returns 1.0 if the static npoint is always not equal to the tnpoint instant, 0.0 otherwise. + * @brief Always ne npoint vs tnpoint + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `always_ne_npoint_tnpoint`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class AlwaysNeNpointTnpointLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "AlwaysNeNpointTnpoint"; - AlwaysNeNpointTnpointLogicalFunction(LogicalFunction rid_np, LogicalFunction pos_np, LogicalFunction rid_tp, LogicalFunction pos_tp, LogicalFunction ts); + AlwaysNeNpointTnpointLogicalFunction(LogicalFunction rid0, + LogicalFunction frac0, + LogicalFunction rid, + LogicalFunction frac, + LogicalFunction ts); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysNePoseTposeLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysNePoseTposeLogicalFunction.hpp index d604ce1f74..1a2a384b04 100644 --- a/nes-logical-operators/include/Functions/Meos/AlwaysNePoseTposeLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/AlwaysNePoseTposeLogicalFunction.hpp @@ -22,13 +22,23 @@ namespace NES { /** - * @brief Returns 1.0 if the static pose is always not equal to the 2D tpose instant, 0.0 otherwise. + * @brief Always ne pose vs tpose + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `always_ne_pose_tpose`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class AlwaysNePoseTposeLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "AlwaysNePoseTpose"; - AlwaysNePoseTposeLogicalFunction(LogicalFunction x2, LogicalFunction y2, LogicalFunction theta2, LogicalFunction x, LogicalFunction y, LogicalFunction theta, LogicalFunction ts); + AlwaysNePoseTposeLogicalFunction(LogicalFunction px0, + LogicalFunction py0, + LogicalFunction ptheta0, + LogicalFunction x, + LogicalFunction y, + LogicalFunction theta, + LogicalFunction ts); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysNeTbigintBigintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysNeTbigintBigintLogicalFunction.hpp index 34d9e07bff..62af9cc317 100644 --- a/nes-logical-operators/include/Functions/Meos/AlwaysNeTbigintBigintLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/AlwaysNeTbigintBigintLogicalFunction.hpp @@ -22,19 +22,19 @@ namespace NES { /** - * @brief Per-event always_ne_tbigint_bigint: tests if a single-instant tbigint value always nes a threshold. + * @brief Per-event always_ne_tbigint_bigint: always-not-equal tbigint vs scalar bigint. * * Generated by tools/codegen/codegen_nebula.py from the MEOS function - * `always_ne_tbigint_bigint`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), - * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + * `always_ne_tbigint_bigint`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class AlwaysNeTbigintBigintLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "AlwaysNeTbigintBigint"; AlwaysNeTbigintBigintLogicalFunction(LogicalFunction value, - LogicalFunction threshold, - LogicalFunction ts); + LogicalFunction ts, + LogicalFunction arg0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysNeTboolBoolLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysNeTboolBoolLogicalFunction.hpp index f743a7c66b..596a37edd6 100644 --- a/nes-logical-operators/include/Functions/Meos/AlwaysNeTboolBoolLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/AlwaysNeTboolBoolLogicalFunction.hpp @@ -22,19 +22,19 @@ namespace NES { /** - * @brief Per-event always_ne_tbool_bool: tests if a single-instant tfloat value ever equals a threshold. + * @brief Per-event always_ne_tbool_bool: always-not-equal tbool vs scalar bool. * * Generated by tools/codegen/codegen_nebula.py from the MEOS function - * `always_ne_tbool_bool`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), - * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + * `always_ne_tbool_bool`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class AlwaysNeTboolBoolLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "AlwaysNeTboolBool"; AlwaysNeTboolBoolLogicalFunction(LogicalFunction value, - LogicalFunction threshold, - LogicalFunction ts); + LogicalFunction ts, + LogicalFunction arg0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysNeTcbufferTcbufferLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysNeTcbufferTcbufferLogicalFunction.hpp index 7e30c5d3b6..7b22671185 100644 --- a/nes-logical-operators/include/Functions/Meos/AlwaysNeTcbufferTcbufferLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/AlwaysNeTcbufferTcbufferLogicalFunction.hpp @@ -22,19 +22,24 @@ namespace NES { /** - * @brief Returns 1.0 if the two tcbuffer instants are always not equal, 0.0 otherwise. + * @brief Per-event always_ne_tcbuffer_tcbuffer spatial predicate. * - * Args: (lon1:FLOAT64, lat1:FLOAT64, r1:FLOAT64, ts1:UINT64, - * lon2:FLOAT64, lat2:FLOAT64, r2:FLOAT64, ts2:UINT64) -> FLOAT64. + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `always_ne_tcbuffer_tcbuffer`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class AlwaysNeTcbufferTcbufferLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "AlwaysNeTcbufferTcbuffer"; - AlwaysNeTcbufferTcbufferLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction r1, - LogicalFunction ts1, - LogicalFunction lon2, LogicalFunction lat2, LogicalFunction r2, - LogicalFunction ts2); + AlwaysNeTcbufferTcbufferLogicalFunction(LogicalFunction lonA, + LogicalFunction latA, + LogicalFunction radiusA, + LogicalFunction tsA, + LogicalFunction lonB, + LogicalFunction latB, + LogicalFunction radiusB, + LogicalFunction tsB); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysNeTextTtextLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysNeTextTtextLogicalFunction.hpp index 2369e43e97..3318c6034e 100644 --- a/nes-logical-operators/include/Functions/Meos/AlwaysNeTextTtextLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/AlwaysNeTextTtextLogicalFunction.hpp @@ -13,27 +13,38 @@ */ #pragma once + #include #include +#include #include namespace NES { +/** + * @brief Always nequal text vs ttext + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `always_ne_text_ttext(txt0, temp)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. + */ class AlwaysNeTextTtextLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "AlwaysNeTextTtext"; - AlwaysNeTextTtextLogicalFunction(LogicalFunction value, LogicalFunction ref, LogicalFunction ts); - - DataType getDataType() const override; - LogicalFunction withDataType(const DataType&) const override; - std::vector getChildren() const override; - LogicalFunction withChildren(const std::vector&) const override; - std::string_view getType() const override; - bool operator==(const LogicalFunctionConcept&) const override; - std::string explain(ExplainVerbosity) const override; - LogicalFunction withInferredDataType(const Schema&) const override; - SerializableFunction serialize() const override; + AlwaysNeTextTtextLogicalFunction(LogicalFunction arg0, + LogicalFunction value, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; private: DataType dataType; diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysNeTgeoGeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysNeTgeoGeoLogicalFunction.hpp index 4e69287867..df7efbc02e 100644 --- a/nes-logical-operators/include/Functions/Meos/AlwaysNeTgeoGeoLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/AlwaysNeTgeoGeoLogicalFunction.hpp @@ -22,16 +22,20 @@ namespace NES { /** - * @brief Returns 1.0 if the temporal geometry is always not equal to the static geometry. + * @brief Per-event always_ne_tgeo_geo spatial predicate. * - * Args: (lon:FLOAT64, lat:FLOAT64, ts:UINT64, wkt:VARCHAR) -> FLOAT64. + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `always_ne_tgeo_geo`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class AlwaysNeTgeoGeoLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "AlwaysNeTgeoGeo"; - AlwaysNeTgeoGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, - LogicalFunction ts, LogicalFunction wkt); + AlwaysNeTgeoGeoLogicalFunction(LogicalFunction lon, + LogicalFunction lat, + LogicalFunction timestamp, + LogicalFunction geometry); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysNeTgeoTgeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysNeTgeoTgeoLogicalFunction.hpp index b2fa1d110b..a6c8d709bf 100644 --- a/nes-logical-operators/include/Functions/Meos/AlwaysNeTgeoTgeoLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/AlwaysNeTgeoTgeoLogicalFunction.hpp @@ -22,13 +22,22 @@ namespace NES { /** - * @brief Tests whether two temporal geometries are always spatially not equal. + * @brief Per-event always_ne_tgeo_tgeo spatial predicate. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `always_ne_tgeo_tgeo`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class AlwaysNeTgeoTgeoLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "AlwaysNeTgeoTgeo"; - AlwaysNeTgeoTgeoLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction ts1, LogicalFunction lon2, LogicalFunction lat2, LogicalFunction ts2); + AlwaysNeTgeoTgeoLogicalFunction(LogicalFunction lonA, + LogicalFunction latA, + LogicalFunction tsA, + LogicalFunction lonB, + LogicalFunction latB, + LogicalFunction tsB); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysNeTh3indexH3indexLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysNeTh3indexH3indexLogicalFunction.hpp index ed7fdd1e51..b8cb963b73 100644 --- a/nes-logical-operators/include/Functions/Meos/AlwaysNeTh3indexH3indexLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/AlwaysNeTh3indexH3indexLogicalFunction.hpp @@ -22,15 +22,19 @@ namespace NES { /** - * @brief Returns 1.0 if the th3index instant is always not equal to the target H3 cell. + * @brief Always neual th3index vs h3index * - * Args: (cell:UINT64, ts:UINT64, target:UINT64) -> FLOAT64. + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `always_ne_th3index_h3index(temp, (H3Index)arg0)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class AlwaysNeTh3indexH3indexLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "AlwaysNeTh3indexH3index"; - AlwaysNeTh3indexH3indexLogicalFunction(LogicalFunction cell, LogicalFunction ts, LogicalFunction target); + AlwaysNeTh3indexH3indexLogicalFunction(LogicalFunction cell, + LogicalFunction ts, + LogicalFunction arg0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysNeTjsonbJsonbLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysNeTjsonbJsonbLogicalFunction.hpp index 05e7c81966..2767706e8a 100644 --- a/nes-logical-operators/include/Functions/Meos/AlwaysNeTjsonbJsonbLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/AlwaysNeTjsonbJsonbLogicalFunction.hpp @@ -22,13 +22,19 @@ namespace NES { /** - * @brief Returns 1.0 if the tjsonb instant value always differs from the target Jsonb. + * @brief Always neual tjsonb vs jsonb + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `always_ne_tjsonb_jsonb`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class AlwaysNeTjsonbJsonbLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "AlwaysNeTjsonbJsonb"; - AlwaysNeTjsonbJsonbLogicalFunction(LogicalFunction json_str, LogicalFunction ts, LogicalFunction target_json); + AlwaysNeTjsonbJsonbLogicalFunction(LogicalFunction json_str, + LogicalFunction ts, + LogicalFunction arg0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysNeTjsonbTjsonbLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysNeTjsonbTjsonbLogicalFunction.hpp index eac1927655..74d3562dad 100644 --- a/nes-logical-operators/include/Functions/Meos/AlwaysNeTjsonbTjsonbLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/AlwaysNeTjsonbTjsonbLogicalFunction.hpp @@ -22,13 +22,20 @@ namespace NES { /** - * @brief Returns 1.0 if the two tjsonb instants are always not equal. + * @brief Always neual tjsonb vs tjsonb + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `always_ne_tjsonb_tjsonb`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class AlwaysNeTjsonbTjsonbLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "AlwaysNeTjsonbTjsonb"; - AlwaysNeTjsonbTjsonbLogicalFunction(LogicalFunction json1, LogicalFunction ts1, LogicalFunction json2, LogicalFunction ts2); + AlwaysNeTjsonbTjsonbLogicalFunction(LogicalFunction json_str, + LogicalFunction ts, + LogicalFunction json0, + LogicalFunction ts0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysNeTnpointNpointLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysNeTnpointNpointLogicalFunction.hpp index 4ba4d57134..aa750014b0 100644 --- a/nes-logical-operators/include/Functions/Meos/AlwaysNeTnpointNpointLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/AlwaysNeTnpointNpointLogicalFunction.hpp @@ -22,13 +22,21 @@ namespace NES { /** - * @brief Returns 1.0 if the tnpoint instant is always not equal to the static npoint, 0.0 otherwise. + * @brief Always ne tnpoint vs npoint + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `always_ne_tnpoint_npoint`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class AlwaysNeTnpointNpointLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "AlwaysNeTnpointNpoint"; - AlwaysNeTnpointNpointLogicalFunction(LogicalFunction rid1, LogicalFunction pos1, LogicalFunction ts, LogicalFunction rid2, LogicalFunction pos2); + AlwaysNeTnpointNpointLogicalFunction(LogicalFunction rid, + LogicalFunction frac, + LogicalFunction ts, + LogicalFunction rid0, + LogicalFunction frac0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysNeTnpointTnpointLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysNeTnpointTnpointLogicalFunction.hpp index 01aa7bc348..2640d712a5 100644 --- a/nes-logical-operators/include/Functions/Meos/AlwaysNeTnpointTnpointLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/AlwaysNeTnpointTnpointLogicalFunction.hpp @@ -22,17 +22,22 @@ namespace NES { /** - * @brief Returns 1.0 if the two tnpoint instants are always not equal, 0.0 otherwise. + * @brief Always ne tnpoint vs tnpoint * - * Args: (rid1:UINT64, pos1:FLOAT64, ts1:UINT64, - * rid2:UINT64, pos2:FLOAT64, ts2:UINT64) -> FLOAT64. + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `always_ne_tnpoint_tnpoint`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class AlwaysNeTnpointTnpointLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "AlwaysNeTnpointTnpoint"; - AlwaysNeTnpointTnpointLogicalFunction(LogicalFunction rid1, LogicalFunction pos1, LogicalFunction ts1, - LogicalFunction rid2, LogicalFunction pos2, LogicalFunction ts2); + AlwaysNeTnpointTnpointLogicalFunction(LogicalFunction rid, + LogicalFunction frac, + LogicalFunction ts, + LogicalFunction rid0, + LogicalFunction frac0, + LogicalFunction ts0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysNeTposePoseLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysNeTposePoseLogicalFunction.hpp index b26b209ec1..32651c5bf7 100644 --- a/nes-logical-operators/include/Functions/Meos/AlwaysNeTposePoseLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/AlwaysNeTposePoseLogicalFunction.hpp @@ -22,13 +22,23 @@ namespace NES { /** - * @brief Returns 1.0 if the 2D tpose instant is always not equal to the static pose, 0.0 otherwise. + * @brief Always ne tpose vs pose + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `always_ne_tpose_pose`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class AlwaysNeTposePoseLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "AlwaysNeTposePose"; - AlwaysNeTposePoseLogicalFunction(LogicalFunction x, LogicalFunction y, LogicalFunction theta, LogicalFunction ts, LogicalFunction x2, LogicalFunction y2, LogicalFunction theta2); + AlwaysNeTposePoseLogicalFunction(LogicalFunction x, + LogicalFunction y, + LogicalFunction theta, + LogicalFunction ts, + LogicalFunction px0, + LogicalFunction py0, + LogicalFunction ptheta0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysNeTposeTposeLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysNeTposeTposeLogicalFunction.hpp index 17975a44dc..b1bde9b498 100644 --- a/nes-logical-operators/include/Functions/Meos/AlwaysNeTposeTposeLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/AlwaysNeTposeTposeLogicalFunction.hpp @@ -22,19 +22,24 @@ namespace NES { /** - * @brief Returns 1.0 if the two 2D tpose instants are always not equal, 0.0 otherwise. + * @brief Always ne tpose vs tpose * - * Args: (x1:FLOAT64, y1:FLOAT64, theta1:FLOAT64, ts1:UINT64, - * x2:FLOAT64, y2:FLOAT64, theta2:FLOAT64, ts2:UINT64) -> FLOAT64. + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `always_ne_tpose_tpose`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class AlwaysNeTposeTposeLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "AlwaysNeTposeTpose"; - AlwaysNeTposeTposeLogicalFunction(LogicalFunction x1, LogicalFunction y1, LogicalFunction theta1, - LogicalFunction ts1, - LogicalFunction x2, LogicalFunction y2, LogicalFunction theta2, - LogicalFunction ts2); + AlwaysNeTposeTposeLogicalFunction(LogicalFunction x, + LogicalFunction y, + LogicalFunction theta, + LogicalFunction ts, + LogicalFunction px0, + LogicalFunction py0, + LogicalFunction ptheta0, + LogicalFunction ts0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysNeTquadbinQuadbinLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysNeTquadbinQuadbinLogicalFunction.hpp index eaf6506589..5f9844c53c 100644 --- a/nes-logical-operators/include/Functions/Meos/AlwaysNeTquadbinQuadbinLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/AlwaysNeTquadbinQuadbinLogicalFunction.hpp @@ -22,12 +22,20 @@ namespace NES { /** - * @brief Returns 1 if the tquadbin instant always differs from the Quadbin cell. + * @brief Always neual tquadbin vs quadbin + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `always_ne_tquadbin_quadbin(temp, (Quadbin)arg0)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class AlwaysNeTquadbinQuadbinLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "AlwaysNeTquadbinQuadbin"; - AlwaysNeTquadbinQuadbinLogicalFunction(LogicalFunction inst_cell, LogicalFunction ts, LogicalFunction cell); + + AlwaysNeTquadbinQuadbinLogicalFunction(LogicalFunction cell, + LogicalFunction ts, + LogicalFunction arg0); + DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; std::vector getChildren() const override; @@ -37,6 +45,7 @@ class AlwaysNeTquadbinQuadbinLogicalFunction : public LogicalFunctionConcept { std::string explain(ExplainVerbosity verbosity) const override; LogicalFunction withInferredDataType(const Schema& schema) const override; SerializableFunction serialize() const override; + private: DataType dataType; std::vector parameters; diff --git a/nes-logical-operators/include/Functions/Meos/AlwaysNeTtextTextLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AlwaysNeTtextTextLogicalFunction.hpp index 8ed92a09ab..d769c64c63 100644 --- a/nes-logical-operators/include/Functions/Meos/AlwaysNeTtextTextLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/AlwaysNeTtextTextLogicalFunction.hpp @@ -13,27 +13,38 @@ */ #pragma once + #include #include +#include #include namespace NES { +/** + * @brief Always nequal ttext vs text + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `always_ne_ttext_text(temp, txt0)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. + */ class AlwaysNeTtextTextLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "AlwaysNeTtextText"; - AlwaysNeTtextTextLogicalFunction(LogicalFunction value, LogicalFunction ref, LogicalFunction ts); - - DataType getDataType() const override; - LogicalFunction withDataType(const DataType&) const override; - std::vector getChildren() const override; - LogicalFunction withChildren(const std::vector&) const override; - std::string_view getType() const override; - bool operator==(const LogicalFunctionConcept&) const override; - std::string explain(ExplainVerbosity) const override; - LogicalFunction withInferredDataType(const Schema&) const override; - SerializableFunction serialize() const override; + AlwaysNeTtextTextLogicalFunction(LogicalFunction value, + LogicalFunction ts, + LogicalFunction arg0); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; private: DataType dataType; diff --git a/nes-logical-operators/include/Functions/Meos/AtouchesTcbufferGeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AtouchesTcbufferGeoLogicalFunction.hpp index 6e543f8eb5..6035781953 100644 --- a/nes-logical-operators/include/Functions/Meos/AtouchesTcbufferGeoLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/AtouchesTcbufferGeoLogicalFunction.hpp @@ -22,17 +22,21 @@ namespace NES { /** - * @brief Returns 1.0 if the tcbuffer always touches the static geometry, 0.0 otherwise. + * @brief Per-event atouches_tcbuffer_geo spatial predicate. * - * Args: (lon:FLOAT64, lat:FLOAT64, radius:FLOAT64, ts:UINT64, wkt:VARCHAR) -> FLOAT64. + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `atouches_tcbuffer_geo`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class AtouchesTcbufferGeoLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "AtouchesTcbufferGeo"; - AtouchesTcbufferGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, - LogicalFunction radius, LogicalFunction ts, - LogicalFunction wkt); + AtouchesTcbufferGeoLogicalFunction(LogicalFunction lon, + LogicalFunction lat, + LogicalFunction radius, + LogicalFunction timestamp, + LogicalFunction geometry); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/AtouchesTcbufferTcbufferLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AtouchesTcbufferTcbufferLogicalFunction.hpp index 09466cc342..e03e2255c9 100644 --- a/nes-logical-operators/include/Functions/Meos/AtouchesTcbufferTcbufferLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/AtouchesTcbufferTcbufferLogicalFunction.hpp @@ -22,19 +22,24 @@ namespace NES { /** - * @brief Returns 1.0 if the two tcbuffer instants always touch, 0.0 otherwise. + * @brief Per-event atouches_tcbuffer_tcbuffer spatial predicate. * - * Args: (lon1:FLOAT64, lat1:FLOAT64, r1:FLOAT64, ts1:UINT64, - * lon2:FLOAT64, lat2:FLOAT64, r2:FLOAT64, ts2:UINT64) -> FLOAT64. + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `atouches_tcbuffer_tcbuffer`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class AtouchesTcbufferTcbufferLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "AtouchesTcbufferTcbuffer"; - AtouchesTcbufferTcbufferLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction r1, - LogicalFunction ts1, - LogicalFunction lon2, LogicalFunction lat2, LogicalFunction r2, - LogicalFunction ts2); + AtouchesTcbufferTcbufferLogicalFunction(LogicalFunction lonA, + LogicalFunction latA, + LogicalFunction radiusA, + LogicalFunction tsA, + LogicalFunction lonB, + LogicalFunction latB, + LogicalFunction radiusB, + LogicalFunction tsB); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/AtouchesTgeoGeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AtouchesTgeoGeoLogicalFunction.hpp index 5c0fe22dab..de85dd84ae 100644 --- a/nes-logical-operators/include/Functions/Meos/AtouchesTgeoGeoLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/AtouchesTgeoGeoLogicalFunction.hpp @@ -22,16 +22,20 @@ namespace NES { /** - * @brief Returns 1.0 if temporal geometry always touches the static geometry. + * @brief Per-event atouches_tgeo_geo spatial predicate. * - * Args: (lon:FLOAT64, lat:FLOAT64, ts:UINT64, wkt:VARCHAR) -> FLOAT64. + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `atouches_tgeo_geo`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class AtouchesTgeoGeoLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "AtouchesTgeoGeo"; - AtouchesTgeoGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, - LogicalFunction ts, LogicalFunction wkt); + AtouchesTgeoGeoLogicalFunction(LogicalFunction lon, + LogicalFunction lat, + LogicalFunction timestamp, + LogicalFunction geometry); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/AtouchesTgeoTgeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AtouchesTgeoTgeoLogicalFunction.hpp index 864f6c70c4..81cf445eea 100644 --- a/nes-logical-operators/include/Functions/Meos/AtouchesTgeoTgeoLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/AtouchesTgeoTgeoLogicalFunction.hpp @@ -22,13 +22,22 @@ namespace NES { /** - * @brief Tests whether two temporal geometries always touch. + * @brief Per-event atouches_tgeo_tgeo spatial predicate. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `atouches_tgeo_tgeo`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class AtouchesTgeoTgeoLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "AtouchesTgeoTgeo"; - AtouchesTgeoTgeoLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction ts1, LogicalFunction lon2, LogicalFunction lat2, LogicalFunction ts2); + AtouchesTgeoTgeoLogicalFunction(LogicalFunction lonA, + LogicalFunction latA, + LogicalFunction tsA, + LogicalFunction lonB, + LogicalFunction latB, + LogicalFunction tsB); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/AtouchesTrgeometryGeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/AtouchesTrgeometryGeoLogicalFunction.hpp new file mode 100644 index 0000000000..c680d3c810 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/AtouchesTrgeometryGeoLogicalFunction.hpp @@ -0,0 +1,45 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1 if the trgeometry instant atouches the geometry. + */ +class AtouchesTrgeometryGeoLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "AtouchesTrgeometryGeo"; + AtouchesTrgeometryGeoLogicalFunction(LogicalFunction ref_wkt, LogicalFunction x1, LogicalFunction y1, LogicalFunction theta1, LogicalFunction ts1, LogicalFunction tgt_wkt); + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/ContainedFloatSpanLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/ContainedFloatSpanLogicalFunction.hpp index 6e47083d35..cda1cd42db 100644 --- a/nes-logical-operators/include/Functions/Meos/ContainedFloatSpanLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/ContainedFloatSpanLogicalFunction.hpp @@ -22,12 +22,19 @@ namespace NES { /** - * @brief Returns 1 if the float value is contained by the float span. + * @brief Float contained in span + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `contained_float_span(arg0, temp)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class ContainedFloatSpanLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "ContainedFloatSpan"; - ContainedFloatSpanLogicalFunction(LogicalFunction val, LogicalFunction sp); + + ContainedFloatSpanLogicalFunction(LogicalFunction arg0, + LogicalFunction sp); + DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; std::vector getChildren() const override; @@ -37,6 +44,7 @@ class ContainedFloatSpanLogicalFunction : public LogicalFunctionConcept { std::string explain(ExplainVerbosity verbosity) const override; LogicalFunction withInferredDataType(const Schema& schema) const override; SerializableFunction serialize() const override; + private: DataType dataType; std::vector parameters; diff --git a/nes-logical-operators/include/Functions/Meos/ContainedFloatspanSpanLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/ContainedFloatspanSpanLogicalFunction.hpp index e1959ca467..9b8b3808e3 100644 --- a/nes-logical-operators/include/Functions/Meos/ContainedFloatspanSpanLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/ContainedFloatspanSpanLogicalFunction.hpp @@ -22,12 +22,19 @@ namespace NES { /** - * @brief Returns 1 if float span sp1 is contained by float span sp2. + * @brief Floatspan contained in floatspan + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `contained_span_span(temp, sp0)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class ContainedFloatspanSpanLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "ContainedFloatspanSpan"; - ContainedFloatspanSpanLogicalFunction(LogicalFunction sp1, LogicalFunction sp2); + + ContainedFloatspanSpanLogicalFunction(LogicalFunction sp, + LogicalFunction arg0); + DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; std::vector getChildren() const override; @@ -37,6 +44,7 @@ class ContainedFloatspanSpanLogicalFunction : public LogicalFunctionConcept { std::string explain(ExplainVerbosity verbosity) const override; LogicalFunction withInferredDataType(const Schema& schema) const override; SerializableFunction serialize() const override; + private: DataType dataType; std::vector parameters; diff --git a/nes-logical-operators/include/Functions/Meos/ContainedIntSpanLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/ContainedIntSpanLogicalFunction.hpp index 7b51e07600..b79bd794cf 100644 --- a/nes-logical-operators/include/Functions/Meos/ContainedIntSpanLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/ContainedIntSpanLogicalFunction.hpp @@ -22,12 +22,19 @@ namespace NES { /** - * @brief Returns 1 if the integer value is contained by the integer span. + * @brief Int contained in span + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `contained_int_span((int)arg0, temp)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class ContainedIntSpanLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "ContainedIntSpan"; - ContainedIntSpanLogicalFunction(LogicalFunction val, LogicalFunction sp); + + ContainedIntSpanLogicalFunction(LogicalFunction arg0, + LogicalFunction sp); + DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; std::vector getChildren() const override; @@ -37,6 +44,7 @@ class ContainedIntSpanLogicalFunction : public LogicalFunctionConcept { std::string explain(ExplainVerbosity verbosity) const override; LogicalFunction withInferredDataType(const Schema& schema) const override; SerializableFunction serialize() const override; + private: DataType dataType; std::vector parameters; diff --git a/nes-logical-operators/include/Functions/Meos/ContainedSpanSpanLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/ContainedSpanSpanLogicalFunction.hpp index 1a8edc8bfa..5526e7341b 100644 --- a/nes-logical-operators/include/Functions/Meos/ContainedSpanSpanLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/ContainedSpanSpanLogicalFunction.hpp @@ -22,12 +22,19 @@ namespace NES { /** - * @brief Returns 1 if integer span sp1 is contained by integer span sp2. + * @brief Intspan contained in intspan + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `contained_span_span(temp, sp0)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class ContainedSpanSpanLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "ContainedSpanSpan"; - ContainedSpanSpanLogicalFunction(LogicalFunction sp1, LogicalFunction sp2); + + ContainedSpanSpanLogicalFunction(LogicalFunction sp, + LogicalFunction arg0); + DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; std::vector getChildren() const override; @@ -37,6 +44,7 @@ class ContainedSpanSpanLogicalFunction : public LogicalFunctionConcept { std::string explain(ExplainVerbosity verbosity) const override; LogicalFunction withInferredDataType(const Schema& schema) const override; SerializableFunction serialize() const override; + private: DataType dataType; std::vector parameters; diff --git a/nes-logical-operators/include/Functions/Meos/ContainsFloatspanSpanLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/ContainsFloatspanSpanLogicalFunction.hpp index 5ae65373c0..8576c0bab9 100644 --- a/nes-logical-operators/include/Functions/Meos/ContainsFloatspanSpanLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/ContainsFloatspanSpanLogicalFunction.hpp @@ -22,12 +22,19 @@ namespace NES { /** - * @brief Returns 1 if float span sp1 contains float span sp2. + * @brief Floatspan contains floatspan + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `contains_span_span(temp, sp0)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class ContainsFloatspanSpanLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "ContainsFloatspanSpan"; - ContainsFloatspanSpanLogicalFunction(LogicalFunction sp1, LogicalFunction sp2); + + ContainsFloatspanSpanLogicalFunction(LogicalFunction sp, + LogicalFunction arg0); + DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; std::vector getChildren() const override; @@ -37,6 +44,7 @@ class ContainsFloatspanSpanLogicalFunction : public LogicalFunctionConcept { std::string explain(ExplainVerbosity verbosity) const override; LogicalFunction withInferredDataType(const Schema& schema) const override; SerializableFunction serialize() const override; + private: DataType dataType; std::vector parameters; diff --git a/nes-logical-operators/include/Functions/Meos/ContainsSpanFloatLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/ContainsSpanFloatLogicalFunction.hpp index de8cdc2a2c..4ad803e85c 100644 --- a/nes-logical-operators/include/Functions/Meos/ContainsSpanFloatLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/ContainsSpanFloatLogicalFunction.hpp @@ -22,12 +22,19 @@ namespace NES { /** - * @brief Returns 1 if the float span contains the float value. + * @brief Floatspan contains float + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `contains_span_float(temp, arg0)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class ContainsSpanFloatLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "ContainsSpanFloat"; - ContainsSpanFloatLogicalFunction(LogicalFunction sp, LogicalFunction val); + + ContainsSpanFloatLogicalFunction(LogicalFunction sp, + LogicalFunction arg0); + DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; std::vector getChildren() const override; @@ -37,6 +44,7 @@ class ContainsSpanFloatLogicalFunction : public LogicalFunctionConcept { std::string explain(ExplainVerbosity verbosity) const override; LogicalFunction withInferredDataType(const Schema& schema) const override; SerializableFunction serialize() const override; + private: DataType dataType; std::vector parameters; diff --git a/nes-logical-operators/include/Functions/Meos/ContainsSpanIntLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/ContainsSpanIntLogicalFunction.hpp index aa940b84c4..aa54d93a74 100644 --- a/nes-logical-operators/include/Functions/Meos/ContainsSpanIntLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/ContainsSpanIntLogicalFunction.hpp @@ -22,12 +22,19 @@ namespace NES { /** - * @brief Returns 1 if the integer span contains the integer value. + * @brief Intspan contains int + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `contains_span_int(temp, (int)arg0)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class ContainsSpanIntLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "ContainsSpanInt"; - ContainsSpanIntLogicalFunction(LogicalFunction sp, LogicalFunction val); + + ContainsSpanIntLogicalFunction(LogicalFunction sp, + LogicalFunction arg0); + DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; std::vector getChildren() const override; @@ -37,6 +44,7 @@ class ContainsSpanIntLogicalFunction : public LogicalFunctionConcept { std::string explain(ExplainVerbosity verbosity) const override; LogicalFunction withInferredDataType(const Schema& schema) const override; SerializableFunction serialize() const override; + private: DataType dataType; std::vector parameters; diff --git a/nes-logical-operators/include/Functions/Meos/ContainsSpanSpanLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/ContainsSpanSpanLogicalFunction.hpp index 02187a7449..c1a2c4b01c 100644 --- a/nes-logical-operators/include/Functions/Meos/ContainsSpanSpanLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/ContainsSpanSpanLogicalFunction.hpp @@ -22,12 +22,19 @@ namespace NES { /** - * @brief Returns 1 if integer span sp1 contains integer span sp2. + * @brief Intspan contains intspan + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `contains_span_span(temp, sp0)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class ContainsSpanSpanLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "ContainsSpanSpan"; - ContainsSpanSpanLogicalFunction(LogicalFunction sp1, LogicalFunction sp2); + + ContainsSpanSpanLogicalFunction(LogicalFunction sp, + LogicalFunction arg0); + DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; std::vector getChildren() const override; @@ -37,6 +44,7 @@ class ContainsSpanSpanLogicalFunction : public LogicalFunctionConcept { std::string explain(ExplainVerbosity verbosity) const override; LogicalFunction withInferredDataType(const Schema& schema) const override; SerializableFunction serialize() const override; + private: DataType dataType; std::vector parameters; diff --git a/nes-logical-operators/include/Functions/Meos/DivBigintTbigintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/DivBigintTbigintLogicalFunction.hpp index 993b9666e1..569aa82cb7 100644 --- a/nes-logical-operators/include/Functions/Meos/DivBigintTbigintLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/DivBigintTbigintLogicalFunction.hpp @@ -22,19 +22,19 @@ namespace NES { /** - * @brief Per-event div_bigint_tbigint: divides a constant int64 scalar by a single-instant tbigint value. + * @brief Per-event div_bigint_tbigint: scalar bigint divided by single-instant tbigint. * * Generated by tools/codegen/codegen_nebula.py from the MEOS function - * `div_bigint_tbigint`. Takes (scalar:FLOAT64→int64, value:FLOAT64, ts:UINT64), - * constructs a single-instant temporal, applies the division, and returns FLOAT64. + * `div_bigint_tbigint`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class DivBigintTbigintLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "DivBigintTbigint"; - DivBigintTbigintLogicalFunction(LogicalFunction scalar, - LogicalFunction value, - LogicalFunction ts); + DivBigintTbigintLogicalFunction(LogicalFunction arg0, + LogicalFunction value, + LogicalFunction ts); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/DivFloatTfloatLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/DivFloatTfloatLogicalFunction.hpp index 78060cbec2..0b96e9c5bf 100644 --- a/nes-logical-operators/include/Functions/Meos/DivFloatTfloatLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/DivFloatTfloatLogicalFunction.hpp @@ -22,19 +22,19 @@ namespace NES { /** - * @brief Per-event div_float_tfloat: divides a constant by a single-instant tfloat value. + * @brief Per-event div_float_tfloat: scalar float divided by single-instant tfloat. * * Generated by tools/codegen/codegen_nebula.py from the MEOS function - * `div_float_tfloat`. Takes (scalar:FLOAT64, value:FLOAT64, ts:UINT64), - * constructs a single-instant temporal, applies the division, and returns FLOAT64. + * `div_float_tfloat`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class DivFloatTfloatLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "DivFloatTfloat"; - DivFloatTfloatLogicalFunction(LogicalFunction scalar, - LogicalFunction value, - LogicalFunction ts); + DivFloatTfloatLogicalFunction(LogicalFunction arg0, + LogicalFunction value, + LogicalFunction ts); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/DivIntTintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/DivIntTintLogicalFunction.hpp index f48f877b8b..1b8f76111e 100644 --- a/nes-logical-operators/include/Functions/Meos/DivIntTintLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/DivIntTintLogicalFunction.hpp @@ -22,19 +22,19 @@ namespace NES { /** - * @brief Per-event div_int_tint: divides a constant by a single-instant tint value. + * @brief Per-event div_int_tint: scalar int divided by single-instant tint. * * Generated by tools/codegen/codegen_nebula.py from the MEOS function - * `div_int_tint`. Takes (scalar:FLOAT64, value:FLOAT64, ts:UINT64), - * constructs a single-instant temporal, applies the division, and returns FLOAT64. + * `div_int_tint`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class DivIntTintLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "DivIntTint"; - DivIntTintLogicalFunction(LogicalFunction scalar, - LogicalFunction value, - LogicalFunction ts); + DivIntTintLogicalFunction(LogicalFunction arg0, + LogicalFunction value, + LogicalFunction ts); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/DivTbigintBigintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/DivTbigintBigintLogicalFunction.hpp index 48d916f76d..c44a1f77ba 100644 --- a/nes-logical-operators/include/Functions/Meos/DivTbigintBigintLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/DivTbigintBigintLogicalFunction.hpp @@ -22,19 +22,19 @@ namespace NES { /** - * @brief Per-event div_tbigint_bigint: divides a single-instant tbigint value by a constant int64. + * @brief Per-event div_tbigint_bigint: single-instant tbigint divided by scalar bigint. * * Generated by tools/codegen/codegen_nebula.py from the MEOS function - * `div_tbigint_bigint`. Takes (value:FLOAT64, ts:UINT64, divisor:FLOAT64→int64), - * constructs a single-instant temporal, applies the division, and returns FLOAT64. + * `div_tbigint_bigint`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class DivTbigintBigintLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "DivTbigintBigint"; DivTbigintBigintLogicalFunction(LogicalFunction value, - LogicalFunction ts, - LogicalFunction divisor); + LogicalFunction ts, + LogicalFunction arg0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/DivTfloatFloatLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/DivTfloatFloatLogicalFunction.hpp index f028b28994..361a8b8d30 100644 --- a/nes-logical-operators/include/Functions/Meos/DivTfloatFloatLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/DivTfloatFloatLogicalFunction.hpp @@ -22,19 +22,19 @@ namespace NES { /** - * @brief Per-event div_tfloat_float: divides a single-instant tfloat value by a constant. + * @brief Per-event div_tfloat_float: single-instant tfloat divided by scalar float. * * Generated by tools/codegen/codegen_nebula.py from the MEOS function - * `div_tfloat_float`. Takes (value:FLOAT64, ts:UINT64, divisor:FLOAT64), - * constructs a single-instant temporal, applies the division, and returns FLOAT64. + * `div_tfloat_float`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class DivTfloatFloatLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "DivTfloatFloat"; DivTfloatFloatLogicalFunction(LogicalFunction value, - LogicalFunction ts, - LogicalFunction divisor); + LogicalFunction ts, + LogicalFunction arg0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/DivTintIntLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/DivTintIntLogicalFunction.hpp index 3c201c5b16..59c8d8ce88 100644 --- a/nes-logical-operators/include/Functions/Meos/DivTintIntLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/DivTintIntLogicalFunction.hpp @@ -22,19 +22,19 @@ namespace NES { /** - * @brief Per-event div_tint_int: divides a single-instant tint value by a constant integer. + * @brief Per-event div_tint_int: single-instant tint divided by scalar int. * * Generated by tools/codegen/codegen_nebula.py from the MEOS function - * `div_tint_int`. Takes (value:FLOAT64, ts:UINT64, divisor:FLOAT64→int), - * constructs a single-instant temporal, applies the division, and returns FLOAT64. + * `div_tint_int`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class DivTintIntLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "DivTintInt"; DivTintIntLogicalFunction(LogicalFunction value, - LogicalFunction ts, - LogicalFunction divisor); + LogicalFunction ts, + LogicalFunction arg0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/DivTnumberTnumberLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/DivTnumberTnumberLogicalFunction.hpp index e85de51c18..8f10d02a61 100644 --- a/nes-logical-operators/include/Functions/Meos/DivTnumberTnumberLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/DivTnumberTnumberLogicalFunction.hpp @@ -22,19 +22,18 @@ namespace NES { /** - * @brief Per-event div_tnumber_tnumber: element-wise division of two single-instant tnumbers. + * @brief Per-event div_tnumber_tnumber: two temporal numbers divided (WKB result). * * Generated by tools/codegen/codegen_nebula.py from the MEOS function - * `div_tnumber_tnumber`. Takes (value1:FLOAT64, value2:FLOAT64, ts:UINT64), - * constructs two co-instant temporals, applies the division, and returns FLOAT64. + * `div_tnumber_tnumber`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class DivTnumberTnumberLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "DivTnumberTnumber"; - DivTnumberTnumberLogicalFunction(LogicalFunction value1, - LogicalFunction value2, - LogicalFunction ts); + DivTnumberTnumberLogicalFunction(LogicalFunction traj, + LogicalFunction arg0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/EcontainsGeoTrgeometryLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EcontainsGeoTrgeometryLogicalFunction.hpp new file mode 100644 index 0000000000..d01f720c41 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EcontainsGeoTrgeometryLogicalFunction.hpp @@ -0,0 +1,45 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1 if the geometry econtains the trgeometry instant. + */ +class EcontainsGeoTrgeometryLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EcontainsGeoTrgeometry"; + EcontainsGeoTrgeometryLogicalFunction(LogicalFunction tgt_wkt, LogicalFunction ref_wkt, LogicalFunction x1, LogicalFunction y1, LogicalFunction theta1, LogicalFunction ts1); + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EcontainsTcbufferGeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EcontainsTcbufferGeoLogicalFunction.hpp index 638f59e1e7..9894847c38 100644 --- a/nes-logical-operators/include/Functions/Meos/EcontainsTcbufferGeoLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/EcontainsTcbufferGeoLogicalFunction.hpp @@ -22,17 +22,21 @@ namespace NES { /** - * @brief Returns 1.0 if the tcbuffer ever contains the static geometry, 0.0 otherwise. + * @brief Per-event econtains_tcbuffer_geo spatial predicate. * - * Args: (lon:FLOAT64, lat:FLOAT64, radius:FLOAT64, ts:UINT64, wkt:VARCHAR) -> FLOAT64. + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `econtains_tcbuffer_geo`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class EcontainsTcbufferGeoLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "EcontainsTcbufferGeo"; - EcontainsTcbufferGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, - LogicalFunction radius, LogicalFunction ts, - LogicalFunction wkt); + EcontainsTcbufferGeoLogicalFunction(LogicalFunction lon, + LogicalFunction lat, + LogicalFunction radius, + LogicalFunction timestamp, + LogicalFunction geometry); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/EcontainsTcbufferTcbufferLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EcontainsTcbufferTcbufferLogicalFunction.hpp new file mode 100644 index 0000000000..432758cb28 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EcontainsTcbufferTcbufferLogicalFunction.hpp @@ -0,0 +1,59 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event econtains_tcbuffer_tcbuffer spatial predicate. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `econtains_tcbuffer_tcbuffer`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. + */ +class EcontainsTcbufferTcbufferLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EcontainsTcbufferTcbuffer"; + + EcontainsTcbufferTcbufferLogicalFunction(LogicalFunction lonA, + LogicalFunction latA, + LogicalFunction radiusA, + LogicalFunction tsA, + LogicalFunction lonB, + LogicalFunction latB, + LogicalFunction radiusB, + LogicalFunction tsB); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EcontainsTgeoGeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EcontainsTgeoGeoLogicalFunction.hpp index c016ba2edf..40a10422ba 100644 --- a/nes-logical-operators/include/Functions/Meos/EcontainsTgeoGeoLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/EcontainsTgeoGeoLogicalFunction.hpp @@ -22,16 +22,20 @@ namespace NES { /** - * @brief Returns 1.0 if temporal geometry ever contains the static geometry. + * @brief Per-event econtains_tgeo_geo spatial predicate. * - * Args: (lon:FLOAT64, lat:FLOAT64, ts:UINT64, wkt:VARCHAR) -> FLOAT64. + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `econtains_tgeo_geo`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class EcontainsTgeoGeoLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "EcontainsTgeoGeo"; - EcontainsTgeoGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, - LogicalFunction ts, LogicalFunction wkt); + EcontainsTgeoGeoLogicalFunction(LogicalFunction lon, + LogicalFunction lat, + LogicalFunction timestamp, + LogicalFunction geometry); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/EcontainsTgeoTgeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EcontainsTgeoTgeoLogicalFunction.hpp index 41ea789905..64d6a43fde 100644 --- a/nes-logical-operators/include/Functions/Meos/EcontainsTgeoTgeoLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/EcontainsTgeoTgeoLogicalFunction.hpp @@ -22,13 +22,22 @@ namespace NES { /** - * @brief Tests whether a temporal geometry ever contains another. + * @brief Per-event econtains_tgeo_tgeo spatial predicate. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `econtains_tgeo_tgeo`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class EcontainsTgeoTgeoLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "EcontainsTgeoTgeo"; - EcontainsTgeoTgeoLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction ts1, LogicalFunction lon2, LogicalFunction lat2, LogicalFunction ts2); + EcontainsTgeoTgeoLogicalFunction(LogicalFunction lonA, + LogicalFunction latA, + LogicalFunction tsA, + LogicalFunction lonB, + LogicalFunction latB, + LogicalFunction tsB); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/EcoversGeoTrgeometryLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EcoversGeoTrgeometryLogicalFunction.hpp new file mode 100644 index 0000000000..ffc2bd6998 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EcoversGeoTrgeometryLogicalFunction.hpp @@ -0,0 +1,45 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1 if the geometry ecovers the trgeometry instant. + */ +class EcoversGeoTrgeometryLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EcoversGeoTrgeometry"; + EcoversGeoTrgeometryLogicalFunction(LogicalFunction tgt_wkt, LogicalFunction ref_wkt, LogicalFunction x1, LogicalFunction y1, LogicalFunction theta1, LogicalFunction ts1); + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EcoversTcbufferGeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EcoversTcbufferGeoLogicalFunction.hpp index d13d5b4607..965445b4d7 100644 --- a/nes-logical-operators/include/Functions/Meos/EcoversTcbufferGeoLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/EcoversTcbufferGeoLogicalFunction.hpp @@ -22,17 +22,21 @@ namespace NES { /** - * @brief Returns 1.0 if the tcbuffer ever covers the static geometry, 0.0 otherwise. + * @brief Per-event ecovers_tcbuffer_geo spatial predicate. * - * Args: (lon:FLOAT64, lat:FLOAT64, radius:FLOAT64, ts:UINT64, wkt:VARCHAR) -> FLOAT64. + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ecovers_tcbuffer_geo`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class EcoversTcbufferGeoLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "EcoversTcbufferGeo"; - EcoversTcbufferGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, - LogicalFunction radius, LogicalFunction ts, - LogicalFunction wkt); + EcoversTcbufferGeoLogicalFunction(LogicalFunction lon, + LogicalFunction lat, + LogicalFunction radius, + LogicalFunction timestamp, + LogicalFunction geometry); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/EcoversTcbufferTcbufferLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EcoversTcbufferTcbufferLogicalFunction.hpp index dfd6c46d73..6f23805465 100644 --- a/nes-logical-operators/include/Functions/Meos/EcoversTcbufferTcbufferLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/EcoversTcbufferTcbufferLogicalFunction.hpp @@ -22,19 +22,24 @@ namespace NES { /** - * @brief Returns 1.0 if the first tcbuffer instant ever covers the second, 0.0 otherwise. + * @brief Per-event ecovers_tcbuffer_tcbuffer spatial predicate. * - * Args: (lon1:FLOAT64, lat1:FLOAT64, r1:FLOAT64, ts1:UINT64, - * lon2:FLOAT64, lat2:FLOAT64, r2:FLOAT64, ts2:UINT64) -> FLOAT64. + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ecovers_tcbuffer_tcbuffer`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class EcoversTcbufferTcbufferLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "EcoversTcbufferTcbuffer"; - EcoversTcbufferTcbufferLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction r1, - LogicalFunction ts1, - LogicalFunction lon2, LogicalFunction lat2, LogicalFunction r2, - LogicalFunction ts2); + EcoversTcbufferTcbufferLogicalFunction(LogicalFunction lonA, + LogicalFunction latA, + LogicalFunction radiusA, + LogicalFunction tsA, + LogicalFunction lonB, + LogicalFunction latB, + LogicalFunction radiusB, + LogicalFunction tsB); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/EcoversTgeoGeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EcoversTgeoGeoLogicalFunction.hpp new file mode 100644 index 0000000000..98c2403a1a --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EcoversTgeoGeoLogicalFunction.hpp @@ -0,0 +1,55 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event ecovers_tgeo_geo spatial predicate. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ecovers_tgeo_geo`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. + */ +class EcoversTgeoGeoLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EcoversTgeoGeo"; + + EcoversTgeoGeoLogicalFunction(LogicalFunction lon, + LogicalFunction lat, + LogicalFunction timestamp, + LogicalFunction geometry); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EcoversTgeoTgeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EcoversTgeoTgeoLogicalFunction.hpp index 5bb9d7c90e..08a54066dc 100644 --- a/nes-logical-operators/include/Functions/Meos/EcoversTgeoTgeoLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/EcoversTgeoTgeoLogicalFunction.hpp @@ -22,13 +22,22 @@ namespace NES { /** - * @brief Tests whether a temporal geometry ever covers another. + * @brief Per-event ecovers_tgeo_tgeo spatial predicate. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ecovers_tgeo_tgeo`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class EcoversTgeoTgeoLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "EcoversTgeoTgeo"; - EcoversTgeoTgeoLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction ts1, LogicalFunction lon2, LogicalFunction lat2, LogicalFunction ts2); + EcoversTgeoTgeoLogicalFunction(LogicalFunction lonA, + LogicalFunction latA, + LogicalFunction tsA, + LogicalFunction lonB, + LogicalFunction latB, + LogicalFunction tsB); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/EcoversTrgeometryGeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EcoversTrgeometryGeoLogicalFunction.hpp new file mode 100644 index 0000000000..46b6bf5d38 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EcoversTrgeometryGeoLogicalFunction.hpp @@ -0,0 +1,45 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1 if the trgeometry instant ecovers the geometry. + */ +class EcoversTrgeometryGeoLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EcoversTrgeometryGeo"; + EcoversTrgeometryGeoLogicalFunction(LogicalFunction ref_wkt, LogicalFunction x1, LogicalFunction y1, LogicalFunction theta1, LogicalFunction ts1, LogicalFunction tgt_wkt); + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EdisjointTcbufferGeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EdisjointTcbufferGeoLogicalFunction.hpp index 682f6bfaf5..74ae5734fd 100644 --- a/nes-logical-operators/include/Functions/Meos/EdisjointTcbufferGeoLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/EdisjointTcbufferGeoLogicalFunction.hpp @@ -22,17 +22,21 @@ namespace NES { /** - * @brief Returns 1.0 if the tcbuffer is ever disjoint from the static geometry, 0.0 otherwise. + * @brief Per-event edisjoint_tcbuffer_geo spatial predicate. * - * Args: (lon:FLOAT64, lat:FLOAT64, radius:FLOAT64, ts:UINT64, wkt:VARCHAR) -> FLOAT64. + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `edisjoint_tcbuffer_geo`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class EdisjointTcbufferGeoLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "EdisjointTcbufferGeo"; - EdisjointTcbufferGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, - LogicalFunction radius, LogicalFunction ts, - LogicalFunction wkt); + EdisjointTcbufferGeoLogicalFunction(LogicalFunction lon, + LogicalFunction lat, + LogicalFunction radius, + LogicalFunction timestamp, + LogicalFunction geometry); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/EdisjointTcbufferTcbufferLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EdisjointTcbufferTcbufferLogicalFunction.hpp new file mode 100644 index 0000000000..4a71b644b3 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EdisjointTcbufferTcbufferLogicalFunction.hpp @@ -0,0 +1,59 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event edisjoint_tcbuffer_tcbuffer spatial predicate. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `edisjoint_tcbuffer_tcbuffer`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. + */ +class EdisjointTcbufferTcbufferLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EdisjointTcbufferTcbuffer"; + + EdisjointTcbufferTcbufferLogicalFunction(LogicalFunction lonA, + LogicalFunction latA, + LogicalFunction radiusA, + LogicalFunction tsA, + LogicalFunction lonB, + LogicalFunction latB, + LogicalFunction radiusB, + LogicalFunction tsB); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EdisjointTgeoGeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EdisjointTgeoGeoLogicalFunction.hpp new file mode 100644 index 0000000000..5b78fdafef --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EdisjointTgeoGeoLogicalFunction.hpp @@ -0,0 +1,55 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event edisjoint_tgeo_geo spatial predicate. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `edisjoint_tgeo_geo`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. + */ +class EdisjointTgeoGeoLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EdisjointTgeoGeo"; + + EdisjointTgeoGeoLogicalFunction(LogicalFunction lon, + LogicalFunction lat, + LogicalFunction timestamp, + LogicalFunction geometry); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EdisjointTgeoTgeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EdisjointTgeoTgeoLogicalFunction.hpp index 2c72e3220d..b90e19071b 100644 --- a/nes-logical-operators/include/Functions/Meos/EdisjointTgeoTgeoLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/EdisjointTgeoTgeoLogicalFunction.hpp @@ -22,13 +22,22 @@ namespace NES { /** - * @brief Tests whether two temporal geometries are ever disjoint. + * @brief Per-event edisjoint_tgeo_tgeo spatial predicate. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `edisjoint_tgeo_tgeo`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class EdisjointTgeoTgeoLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "EdisjointTgeoTgeo"; - EdisjointTgeoTgeoLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction ts1, LogicalFunction lon2, LogicalFunction lat2, LogicalFunction ts2); + EdisjointTgeoTgeoLogicalFunction(LogicalFunction lonA, + LogicalFunction latA, + LogicalFunction tsA, + LogicalFunction lonB, + LogicalFunction latB, + LogicalFunction tsB); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/EdisjointTrgeometryGeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EdisjointTrgeometryGeoLogicalFunction.hpp new file mode 100644 index 0000000000..1f15fa17a8 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EdisjointTrgeometryGeoLogicalFunction.hpp @@ -0,0 +1,45 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1 if the trgeometry instant edisjoint the geometry. + */ +class EdisjointTrgeometryGeoLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EdisjointTrgeometryGeo"; + EdisjointTrgeometryGeoLogicalFunction(LogicalFunction ref_wkt, LogicalFunction x1, LogicalFunction y1, LogicalFunction theta1, LogicalFunction ts1, LogicalFunction tgt_wkt); + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EdisjointTrgeometryTrgeometryLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EdisjointTrgeometryTrgeometryLogicalFunction.hpp new file mode 100644 index 0000000000..83f2cb872a --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EdisjointTrgeometryTrgeometryLogicalFunction.hpp @@ -0,0 +1,45 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1 if the two trgeometry instants edisjoint. + */ +class EdisjointTrgeometryTrgeometryLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EdisjointTrgeometryTrgeometry"; + EdisjointTrgeometryTrgeometryLogicalFunction(LogicalFunction ref1_wkt, LogicalFunction x1, LogicalFunction y1, LogicalFunction theta1, LogicalFunction ts1, LogicalFunction ref2_wkt, LogicalFunction x2, LogicalFunction y2, LogicalFunction theta2, LogicalFunction ts2); + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EdwithinTcbufferCbufferLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EdwithinTcbufferCbufferLogicalFunction.hpp new file mode 100644 index 0000000000..d7f03c9776 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EdwithinTcbufferCbufferLogicalFunction.hpp @@ -0,0 +1,57 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event ever-within-distance between a single-instant tcbuffer and a static cbuffer. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `edwithin_tcbuffer_cbuffer`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. + */ +class EdwithinTcbufferCbufferLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EdwithinTcbufferCbuffer"; + + EdwithinTcbufferCbufferLogicalFunction(LogicalFunction lon, + LogicalFunction lat, + LogicalFunction radius, + LogicalFunction timestamp, + LogicalFunction cbufLit, + LogicalFunction dist); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EdwithinTcbufferGeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EdwithinTcbufferGeoLogicalFunction.hpp index d9dcc36c65..057ef6025e 100644 --- a/nes-logical-operators/include/Functions/Meos/EdwithinTcbufferGeoLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/EdwithinTcbufferGeoLogicalFunction.hpp @@ -22,17 +22,22 @@ namespace NES { /** - * @brief Returns 1.0 if the tcbuffer ever comes within dist of the static geometry, 0.0 otherwise. + * @brief Per-event edwithin_tcbuffer_geo spatial predicate. * - * Args: (lon:FLOAT64, lat:FLOAT64, radius:FLOAT64, ts:UINT64, wkt:VARCHAR, dist:FLOAT64) -> FLOAT64. + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `edwithin_tcbuffer_geo`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class EdwithinTcbufferGeoLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "EdwithinTcbufferGeo"; - EdwithinTcbufferGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, - LogicalFunction radius, LogicalFunction ts, - LogicalFunction wkt, LogicalFunction dist); + EdwithinTcbufferGeoLogicalFunction(LogicalFunction lon, + LogicalFunction lat, + LogicalFunction radius, + LogicalFunction timestamp, + LogicalFunction geometry, + LogicalFunction dist); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/EdwithinTcbufferTcbufferLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EdwithinTcbufferTcbufferLogicalFunction.hpp index a67c2c1b1b..3b755d67ca 100644 --- a/nes-logical-operators/include/Functions/Meos/EdwithinTcbufferTcbufferLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/EdwithinTcbufferTcbufferLogicalFunction.hpp @@ -22,20 +22,25 @@ namespace NES { /** - * @brief Returns 1.0 if the two tcbuffer instants are ever within the given distance, 0.0 otherwise. + * @brief Per-event edwithin_tcbuffer_tcbuffer spatial predicate. * - * Args: (lon1:FLOAT64, lat1:FLOAT64, r1:FLOAT64, ts1:UINT64, - * lon2:FLOAT64, lat2:FLOAT64, r2:FLOAT64, ts2:UINT64, - * dist:FLOAT64) -> FLOAT64. + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `edwithin_tcbuffer_tcbuffer`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class EdwithinTcbufferTcbufferLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "EdwithinTcbufferTcbuffer"; - EdwithinTcbufferTcbufferLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction r1, - LogicalFunction ts1, - LogicalFunction lon2, LogicalFunction lat2, LogicalFunction r2, - LogicalFunction ts2, LogicalFunction dist); + EdwithinTcbufferTcbufferLogicalFunction(LogicalFunction lonA, + LogicalFunction latA, + LogicalFunction radiusA, + LogicalFunction tsA, + LogicalFunction lonB, + LogicalFunction latB, + LogicalFunction radiusB, + LogicalFunction tsB, + LogicalFunction dist); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/EdwithinTgeoGeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EdwithinTgeoGeoLogicalFunction.hpp new file mode 100644 index 0000000000..d86ee4b828 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EdwithinTgeoGeoLogicalFunction.hpp @@ -0,0 +1,56 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event edwithin_tgeo_geo spatial predicate. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `edwithin_tgeo_geo`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. + */ +class EdwithinTgeoGeoLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EdwithinTgeoGeo"; + + EdwithinTgeoGeoLogicalFunction(LogicalFunction lon, + LogicalFunction lat, + LogicalFunction timestamp, + LogicalFunction geometry, + LogicalFunction dist); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EdwithinTgeoTgeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EdwithinTgeoTgeoLogicalFunction.hpp index d6467a606e..bbc5b36e2f 100644 --- a/nes-logical-operators/include/Functions/Meos/EdwithinTgeoTgeoLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/EdwithinTgeoTgeoLogicalFunction.hpp @@ -22,13 +22,23 @@ namespace NES { /** - * @brief Tests whether two temporal geometries are ever within a distance. + * @brief Per-event edwithin_tgeo_tgeo spatial predicate. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `edwithin_tgeo_tgeo`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class EdwithinTgeoTgeoLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "EdwithinTgeoTgeo"; - EdwithinTgeoTgeoLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction ts1, LogicalFunction lon2, LogicalFunction lat2, LogicalFunction ts2, LogicalFunction dist); + EdwithinTgeoTgeoLogicalFunction(LogicalFunction lonA, + LogicalFunction latA, + LogicalFunction tsA, + LogicalFunction lonB, + LogicalFunction latB, + LogicalFunction tsB, + LogicalFunction dist); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/EdwithinTrgeometryGeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EdwithinTrgeometryGeoLogicalFunction.hpp new file mode 100644 index 0000000000..dd36398d9f --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EdwithinTrgeometryGeoLogicalFunction.hpp @@ -0,0 +1,45 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1 if the trgeometry instant is within dist of the geometry (edwithin). + */ +class EdwithinTrgeometryGeoLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EdwithinTrgeometryGeo"; + EdwithinTrgeometryGeoLogicalFunction(LogicalFunction ref_wkt, LogicalFunction x1, LogicalFunction y1, LogicalFunction theta1, LogicalFunction ts1, LogicalFunction tgt_wkt, LogicalFunction dist); + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EdwithinTrgeometryTrgeometryLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EdwithinTrgeometryTrgeometryLogicalFunction.hpp new file mode 100644 index 0000000000..90f69ce170 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EdwithinTrgeometryTrgeometryLogicalFunction.hpp @@ -0,0 +1,45 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1 if the two trgeometry instants are within dist (edwithin). + */ +class EdwithinTrgeometryTrgeometryLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EdwithinTrgeometryTrgeometry"; + EdwithinTrgeometryTrgeometryLogicalFunction(LogicalFunction ref1_wkt, LogicalFunction x1, LogicalFunction y1, LogicalFunction theta1, LogicalFunction ts1, LogicalFunction ref2_wkt, LogicalFunction x2, LogicalFunction y2, LogicalFunction theta2, LogicalFunction ts2, LogicalFunction dist); + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EintersectsTcbufferGeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EintersectsTcbufferGeoLogicalFunction.hpp index 7375b0d981..8f732af7c5 100644 --- a/nes-logical-operators/include/Functions/Meos/EintersectsTcbufferGeoLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/EintersectsTcbufferGeoLogicalFunction.hpp @@ -22,17 +22,21 @@ namespace NES { /** - * @brief Returns 1.0 if the tcbuffer ever intersects the static geometry, 0.0 otherwise. + * @brief Per-event eintersects_tcbuffer_geo spatial predicate. * - * Args: (lon:FLOAT64, lat:FLOAT64, radius:FLOAT64, ts:UINT64, wkt:VARCHAR) -> FLOAT64. + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `eintersects_tcbuffer_geo`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class EintersectsTcbufferGeoLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "EintersectsTcbufferGeo"; - EintersectsTcbufferGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, - LogicalFunction radius, LogicalFunction ts, - LogicalFunction wkt); + EintersectsTcbufferGeoLogicalFunction(LogicalFunction lon, + LogicalFunction lat, + LogicalFunction radius, + LogicalFunction timestamp, + LogicalFunction geometry); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/EintersectsTcbufferTcbufferLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EintersectsTcbufferTcbufferLogicalFunction.hpp index 9728a93196..a76443de3e 100644 --- a/nes-logical-operators/include/Functions/Meos/EintersectsTcbufferTcbufferLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/EintersectsTcbufferTcbufferLogicalFunction.hpp @@ -22,19 +22,24 @@ namespace NES { /** - * @brief Returns 1.0 if the two tcbuffer instants ever intersect, 0.0 otherwise. + * @brief Per-event eintersects_tcbuffer_tcbuffer spatial predicate. * - * Args: (lon1:FLOAT64, lat1:FLOAT64, r1:FLOAT64, ts1:UINT64, - * lon2:FLOAT64, lat2:FLOAT64, r2:FLOAT64, ts2:UINT64) -> FLOAT64. + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `eintersects_tcbuffer_tcbuffer`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class EintersectsTcbufferTcbufferLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "EintersectsTcbufferTcbuffer"; - EintersectsTcbufferTcbufferLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction r1, - LogicalFunction ts1, - LogicalFunction lon2, LogicalFunction lat2, LogicalFunction r2, - LogicalFunction ts2); + EintersectsTcbufferTcbufferLogicalFunction(LogicalFunction lonA, + LogicalFunction latA, + LogicalFunction radiusA, + LogicalFunction tsA, + LogicalFunction lonB, + LogicalFunction latB, + LogicalFunction radiusB, + LogicalFunction tsB); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/EintersectsTgeoGeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EintersectsTgeoGeoLogicalFunction.hpp index e98c349738..abc4b0da3c 100644 --- a/nes-logical-operators/include/Functions/Meos/EintersectsTgeoGeoLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/EintersectsTgeoGeoLogicalFunction.hpp @@ -22,16 +22,20 @@ namespace NES { /** - * @brief Returns 1.0 if temporal geometry ever intersects the static geometry. + * @brief Per-event eintersects_tgeo_geo spatial predicate. * - * Args: (lon:FLOAT64, lat:FLOAT64, ts:UINT64, wkt:VARCHAR) -> FLOAT64. + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `eintersects_tgeo_geo`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class EintersectsTgeoGeoLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "EintersectsTgeoGeo"; - EintersectsTgeoGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, - LogicalFunction ts, LogicalFunction wkt); + EintersectsTgeoGeoLogicalFunction(LogicalFunction lon, + LogicalFunction lat, + LogicalFunction timestamp, + LogicalFunction geometry); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/EintersectsTgeoTgeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EintersectsTgeoTgeoLogicalFunction.hpp index 465e65ffa4..a854e6cd29 100644 --- a/nes-logical-operators/include/Functions/Meos/EintersectsTgeoTgeoLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/EintersectsTgeoTgeoLogicalFunction.hpp @@ -22,13 +22,22 @@ namespace NES { /** - * @brief Tests whether two temporal geometries ever intersect. + * @brief Per-event eintersects_tgeo_tgeo spatial predicate. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `eintersects_tgeo_tgeo`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class EintersectsTgeoTgeoLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "EintersectsTgeoTgeo"; - EintersectsTgeoTgeoLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction ts1, LogicalFunction lon2, LogicalFunction lat2, LogicalFunction ts2); + EintersectsTgeoTgeoLogicalFunction(LogicalFunction lonA, + LogicalFunction latA, + LogicalFunction tsA, + LogicalFunction lonB, + LogicalFunction latB, + LogicalFunction tsB); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/EintersectsTrgeometryGeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EintersectsTrgeometryGeoLogicalFunction.hpp new file mode 100644 index 0000000000..ac902e0d3b --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EintersectsTrgeometryGeoLogicalFunction.hpp @@ -0,0 +1,45 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1 if the trgeometry instant eintersects the geometry. + */ +class EintersectsTrgeometryGeoLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EintersectsTrgeometryGeo"; + EintersectsTrgeometryGeoLogicalFunction(LogicalFunction ref_wkt, LogicalFunction x1, LogicalFunction y1, LogicalFunction theta1, LogicalFunction ts1, LogicalFunction tgt_wkt); + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EintersectsTrgeometryTrgeometryLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EintersectsTrgeometryTrgeometryLogicalFunction.hpp new file mode 100644 index 0000000000..d1ce2acd78 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EintersectsTrgeometryTrgeometryLogicalFunction.hpp @@ -0,0 +1,45 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1 if the two trgeometry instants eintersects. + */ +class EintersectsTrgeometryTrgeometryLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EintersectsTrgeometryTrgeometry"; + EintersectsTrgeometryTrgeometryLogicalFunction(LogicalFunction ref1_wkt, LogicalFunction x1, LogicalFunction y1, LogicalFunction theta1, LogicalFunction ts1, LogicalFunction ref2_wkt, LogicalFunction x2, LogicalFunction y2, LogicalFunction theta2, LogicalFunction ts2); + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EtouchesTcbufferGeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EtouchesTcbufferGeoLogicalFunction.hpp index 01e22b284b..a45e2ce58e 100644 --- a/nes-logical-operators/include/Functions/Meos/EtouchesTcbufferGeoLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/EtouchesTcbufferGeoLogicalFunction.hpp @@ -22,17 +22,21 @@ namespace NES { /** - * @brief Returns 1.0 if the tcbuffer ever touches the static geometry, 0.0 otherwise. + * @brief Per-event etouches_tcbuffer_geo spatial predicate. * - * Args: (lon:FLOAT64, lat:FLOAT64, radius:FLOAT64, ts:UINT64, wkt:VARCHAR) -> FLOAT64. + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `etouches_tcbuffer_geo`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class EtouchesTcbufferGeoLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "EtouchesTcbufferGeo"; - EtouchesTcbufferGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, - LogicalFunction radius, LogicalFunction ts, - LogicalFunction wkt); + EtouchesTcbufferGeoLogicalFunction(LogicalFunction lon, + LogicalFunction lat, + LogicalFunction radius, + LogicalFunction timestamp, + LogicalFunction geometry); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/EtouchesTcbufferTcbufferLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EtouchesTcbufferTcbufferLogicalFunction.hpp index de01556eae..4d8294bd15 100644 --- a/nes-logical-operators/include/Functions/Meos/EtouchesTcbufferTcbufferLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/EtouchesTcbufferTcbufferLogicalFunction.hpp @@ -22,19 +22,24 @@ namespace NES { /** - * @brief Returns 1.0 if the two tcbuffer instants ever touch, 0.0 otherwise. + * @brief Per-event etouches_tcbuffer_tcbuffer spatial predicate. * - * Args: (lon1:FLOAT64, lat1:FLOAT64, r1:FLOAT64, ts1:UINT64, - * lon2:FLOAT64, lat2:FLOAT64, r2:FLOAT64, ts2:UINT64) -> FLOAT64. + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `etouches_tcbuffer_tcbuffer`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class EtouchesTcbufferTcbufferLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "EtouchesTcbufferTcbuffer"; - EtouchesTcbufferTcbufferLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction r1, - LogicalFunction ts1, - LogicalFunction lon2, LogicalFunction lat2, LogicalFunction r2, - LogicalFunction ts2); + EtouchesTcbufferTcbufferLogicalFunction(LogicalFunction lonA, + LogicalFunction latA, + LogicalFunction radiusA, + LogicalFunction tsA, + LogicalFunction lonB, + LogicalFunction latB, + LogicalFunction radiusB, + LogicalFunction tsB); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/EtouchesTgeoGeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EtouchesTgeoGeoLogicalFunction.hpp index b1db05cb86..1bcf1c061a 100644 --- a/nes-logical-operators/include/Functions/Meos/EtouchesTgeoGeoLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/EtouchesTgeoGeoLogicalFunction.hpp @@ -22,16 +22,20 @@ namespace NES { /** - * @brief Returns 1.0 if temporal geometry ever touches the static geometry. + * @brief Per-event etouches_tgeo_geo spatial predicate. * - * Args: (lon:FLOAT64, lat:FLOAT64, ts:UINT64, wkt:VARCHAR) -> FLOAT64. + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `etouches_tgeo_geo`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class EtouchesTgeoGeoLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "EtouchesTgeoGeo"; - EtouchesTgeoGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, - LogicalFunction ts, LogicalFunction wkt); + EtouchesTgeoGeoLogicalFunction(LogicalFunction lon, + LogicalFunction lat, + LogicalFunction timestamp, + LogicalFunction geometry); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/EtouchesTgeoTgeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EtouchesTgeoTgeoLogicalFunction.hpp index 39cdf9d376..9dbe993868 100644 --- a/nes-logical-operators/include/Functions/Meos/EtouchesTgeoTgeoLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/EtouchesTgeoTgeoLogicalFunction.hpp @@ -22,13 +22,22 @@ namespace NES { /** - * @brief Tests whether two temporal geometries ever touch. + * @brief Per-event etouches_tgeo_tgeo spatial predicate. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `etouches_tgeo_tgeo`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class EtouchesTgeoTgeoLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "EtouchesTgeoTgeo"; - EtouchesTgeoTgeoLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction ts1, LogicalFunction lon2, LogicalFunction lat2, LogicalFunction ts2); + EtouchesTgeoTgeoLogicalFunction(LogicalFunction lonA, + LogicalFunction latA, + LogicalFunction tsA, + LogicalFunction lonB, + LogicalFunction latB, + LogicalFunction tsB); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/EtouchesTrgeometryGeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EtouchesTrgeometryGeoLogicalFunction.hpp new file mode 100644 index 0000000000..001a81fc78 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/EtouchesTrgeometryGeoLogicalFunction.hpp @@ -0,0 +1,45 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Returns 1 if the trgeometry instant etouches the geometry. + */ +class EtouchesTrgeometryGeoLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "EtouchesTrgeometryGeo"; + EtouchesTrgeometryGeoLogicalFunction(LogicalFunction ref_wkt, LogicalFunction x1, LogicalFunction y1, LogicalFunction theta1, LogicalFunction ts1, LogicalFunction tgt_wkt); + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/EverEqBigintTbigintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverEqBigintTbigintLogicalFunction.hpp index efae7f8ca1..6f25077fcd 100644 --- a/nes-logical-operators/include/Functions/Meos/EverEqBigintTbigintLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/EverEqBigintTbigintLogicalFunction.hpp @@ -22,19 +22,19 @@ namespace NES { /** - * @brief Per-event ever_eq_bigint_tbigint: tests if a single-instant tfloat value ever equals a threshold. + * @brief Per-event ever_eq_bigint_tbigint: ever-equal scalar bigint vs tbigint. * * Generated by tools/codegen/codegen_nebula.py from the MEOS function - * `ever_eq_bigint_tbigint`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), - * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + * `ever_eq_bigint_tbigint`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class EverEqBigintTbigintLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "EverEqBigintTbigint"; - EverEqBigintTbigintLogicalFunction(LogicalFunction value, - LogicalFunction threshold, - LogicalFunction ts); + EverEqBigintTbigintLogicalFunction(LogicalFunction arg0, + LogicalFunction value, + LogicalFunction ts); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/EverEqBoolTboolLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverEqBoolTboolLogicalFunction.hpp index c0b490a099..cb41d7e03e 100644 --- a/nes-logical-operators/include/Functions/Meos/EverEqBoolTboolLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/EverEqBoolTboolLogicalFunction.hpp @@ -22,19 +22,19 @@ namespace NES { /** - * @brief Per-event ever_eq_bool_tbool: tests if a single-instant tfloat value ever equals a threshold. + * @brief Per-event ever_eq_bool_tbool: ever-equal scalar bool vs tbool. * * Generated by tools/codegen/codegen_nebula.py from the MEOS function - * `ever_eq_bool_tbool`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), - * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + * `ever_eq_bool_tbool`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class EverEqBoolTboolLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "EverEqBoolTbool"; - EverEqBoolTboolLogicalFunction(LogicalFunction value, - LogicalFunction threshold, - LogicalFunction ts); + EverEqBoolTboolLogicalFunction(LogicalFunction arg0, + LogicalFunction value, + LogicalFunction ts); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/EverEqNpointTnpointLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverEqNpointTnpointLogicalFunction.hpp index 29ec840797..9f47efa8fa 100644 --- a/nes-logical-operators/include/Functions/Meos/EverEqNpointTnpointLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/EverEqNpointTnpointLogicalFunction.hpp @@ -22,13 +22,21 @@ namespace NES { /** - * @brief Returns 1.0 if the static npoint is ever equal to the tnpoint instant, 0.0 otherwise. + * @brief Ever eq npoint vs tnpoint + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ever_eq_npoint_tnpoint`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class EverEqNpointTnpointLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "EverEqNpointTnpoint"; - EverEqNpointTnpointLogicalFunction(LogicalFunction rid_np, LogicalFunction pos_np, LogicalFunction rid_tp, LogicalFunction pos_tp, LogicalFunction ts); + EverEqNpointTnpointLogicalFunction(LogicalFunction rid0, + LogicalFunction frac0, + LogicalFunction rid, + LogicalFunction frac, + LogicalFunction ts); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/EverEqPoseTposeLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverEqPoseTposeLogicalFunction.hpp index da75e450e1..746bb5e789 100644 --- a/nes-logical-operators/include/Functions/Meos/EverEqPoseTposeLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/EverEqPoseTposeLogicalFunction.hpp @@ -22,13 +22,23 @@ namespace NES { /** - * @brief Returns 1.0 if the static pose is ever equal to the 2D tpose instant, 0.0 otherwise. + * @brief Ever eq pose vs tpose + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ever_eq_pose_tpose`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class EverEqPoseTposeLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "EverEqPoseTpose"; - EverEqPoseTposeLogicalFunction(LogicalFunction x2, LogicalFunction y2, LogicalFunction theta2, LogicalFunction x, LogicalFunction y, LogicalFunction theta, LogicalFunction ts); + EverEqPoseTposeLogicalFunction(LogicalFunction px0, + LogicalFunction py0, + LogicalFunction ptheta0, + LogicalFunction x, + LogicalFunction y, + LogicalFunction theta, + LogicalFunction ts); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/EverEqTbigintBigintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverEqTbigintBigintLogicalFunction.hpp index 53667c623c..b4e5d700c4 100644 --- a/nes-logical-operators/include/Functions/Meos/EverEqTbigintBigintLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/EverEqTbigintBigintLogicalFunction.hpp @@ -22,19 +22,19 @@ namespace NES { /** - * @brief Per-event ever_eq_tbigint_bigint: tests if a single-instant tbigint value ever eqs a threshold. + * @brief Per-event ever_eq_tbigint_bigint: ever-equal tbigint vs scalar bigint. * * Generated by tools/codegen/codegen_nebula.py from the MEOS function - * `ever_eq_tbigint_bigint`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), - * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + * `ever_eq_tbigint_bigint`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class EverEqTbigintBigintLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "EverEqTbigintBigint"; EverEqTbigintBigintLogicalFunction(LogicalFunction value, - LogicalFunction threshold, - LogicalFunction ts); + LogicalFunction ts, + LogicalFunction arg0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/EverEqTboolBoolLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverEqTboolBoolLogicalFunction.hpp index a313b66594..f2f77f084b 100644 --- a/nes-logical-operators/include/Functions/Meos/EverEqTboolBoolLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/EverEqTboolBoolLogicalFunction.hpp @@ -22,19 +22,19 @@ namespace NES { /** - * @brief Per-event ever_eq_tbool_bool: tests if a single-instant tfloat value ever equals a threshold. + * @brief Per-event ever_eq_tbool_bool: ever-equal tbool vs scalar bool. * * Generated by tools/codegen/codegen_nebula.py from the MEOS function - * `ever_eq_tbool_bool`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), - * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + * `ever_eq_tbool_bool`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class EverEqTboolBoolLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "EverEqTboolBool"; EverEqTboolBoolLogicalFunction(LogicalFunction value, - LogicalFunction threshold, - LogicalFunction ts); + LogicalFunction ts, + LogicalFunction arg0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/EverEqTcbufferTcbufferLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverEqTcbufferTcbufferLogicalFunction.hpp index 24197ef994..671180845c 100644 --- a/nes-logical-operators/include/Functions/Meos/EverEqTcbufferTcbufferLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/EverEqTcbufferTcbufferLogicalFunction.hpp @@ -22,19 +22,24 @@ namespace NES { /** - * @brief Returns 1.0 if the two tcbuffer instants are ever equal, 0.0 otherwise. + * @brief Per-event ever_eq_tcbuffer_tcbuffer spatial predicate. * - * Args: (lon1:FLOAT64, lat1:FLOAT64, r1:FLOAT64, ts1:UINT64, - * lon2:FLOAT64, lat2:FLOAT64, r2:FLOAT64, ts2:UINT64) -> FLOAT64. + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ever_eq_tcbuffer_tcbuffer`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class EverEqTcbufferTcbufferLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "EverEqTcbufferTcbuffer"; - EverEqTcbufferTcbufferLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction r1, - LogicalFunction ts1, - LogicalFunction lon2, LogicalFunction lat2, LogicalFunction r2, - LogicalFunction ts2); + EverEqTcbufferTcbufferLogicalFunction(LogicalFunction lonA, + LogicalFunction latA, + LogicalFunction radiusA, + LogicalFunction tsA, + LogicalFunction lonB, + LogicalFunction latB, + LogicalFunction radiusB, + LogicalFunction tsB); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/EverEqTextTtextLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverEqTextTtextLogicalFunction.hpp index f473cb3336..0216b03d57 100644 --- a/nes-logical-operators/include/Functions/Meos/EverEqTextTtextLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/EverEqTextTtextLogicalFunction.hpp @@ -13,27 +13,38 @@ */ #pragma once + #include #include +#include #include namespace NES { +/** + * @brief Ever eqqual text vs ttext + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ever_eq_text_ttext(txt0, temp)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. + */ class EverEqTextTtextLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "EverEqTextTtext"; - EverEqTextTtextLogicalFunction(LogicalFunction value, LogicalFunction ref, LogicalFunction ts); - - DataType getDataType() const override; - LogicalFunction withDataType(const DataType&) const override; - std::vector getChildren() const override; - LogicalFunction withChildren(const std::vector&) const override; - std::string_view getType() const override; - bool operator==(const LogicalFunctionConcept&) const override; - std::string explain(ExplainVerbosity) const override; - LogicalFunction withInferredDataType(const Schema&) const override; - SerializableFunction serialize() const override; + EverEqTextTtextLogicalFunction(LogicalFunction arg0, + LogicalFunction value, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; private: DataType dataType; diff --git a/nes-logical-operators/include/Functions/Meos/EverEqTgeoGeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverEqTgeoGeoLogicalFunction.hpp index e1909cb418..44dcbfabbc 100644 --- a/nes-logical-operators/include/Functions/Meos/EverEqTgeoGeoLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/EverEqTgeoGeoLogicalFunction.hpp @@ -22,16 +22,20 @@ namespace NES { /** - * @brief Returns 1.0 if the temporal geometry is ever equal to the static geometry. + * @brief Per-event ever_eq_tgeo_geo spatial predicate. * - * Args: (lon:FLOAT64, lat:FLOAT64, ts:UINT64, wkt:VARCHAR) -> FLOAT64. + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ever_eq_tgeo_geo`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class EverEqTgeoGeoLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "EverEqTgeoGeo"; - EverEqTgeoGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, - LogicalFunction ts, LogicalFunction wkt); + EverEqTgeoGeoLogicalFunction(LogicalFunction lon, + LogicalFunction lat, + LogicalFunction timestamp, + LogicalFunction geometry); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/EverEqTgeoTgeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverEqTgeoTgeoLogicalFunction.hpp index e4fb3ca95d..82aa74383f 100644 --- a/nes-logical-operators/include/Functions/Meos/EverEqTgeoTgeoLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/EverEqTgeoTgeoLogicalFunction.hpp @@ -22,13 +22,22 @@ namespace NES { /** - * @brief Tests whether two temporal geometries are ever spatially equal. + * @brief Per-event ever_eq_tgeo_tgeo spatial predicate. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ever_eq_tgeo_tgeo`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class EverEqTgeoTgeoLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "EverEqTgeoTgeo"; - EverEqTgeoTgeoLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction ts1, LogicalFunction lon2, LogicalFunction lat2, LogicalFunction ts2); + EverEqTgeoTgeoLogicalFunction(LogicalFunction lonA, + LogicalFunction latA, + LogicalFunction tsA, + LogicalFunction lonB, + LogicalFunction latB, + LogicalFunction tsB); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/EverEqTh3indexH3indexLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverEqTh3indexH3indexLogicalFunction.hpp index 8014b55647..b8736c0731 100644 --- a/nes-logical-operators/include/Functions/Meos/EverEqTh3indexH3indexLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/EverEqTh3indexH3indexLogicalFunction.hpp @@ -22,15 +22,19 @@ namespace NES { /** - * @brief Returns 1.0 if the th3index instant is ever equal to the target H3 cell. + * @brief Ever equal th3index vs h3index * - * Args: (cell:UINT64, ts:UINT64, target:UINT64) -> FLOAT64. + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ever_eq_th3index_h3index(temp, (H3Index)arg0)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class EverEqTh3indexH3indexLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "EverEqTh3indexH3index"; - EverEqTh3indexH3indexLogicalFunction(LogicalFunction cell, LogicalFunction ts, LogicalFunction target); + EverEqTh3indexH3indexLogicalFunction(LogicalFunction cell, + LogicalFunction ts, + LogicalFunction arg0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/EverEqTjsonbJsonbLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverEqTjsonbJsonbLogicalFunction.hpp index aa53d1b34d..d6bb1408bd 100644 --- a/nes-logical-operators/include/Functions/Meos/EverEqTjsonbJsonbLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/EverEqTjsonbJsonbLogicalFunction.hpp @@ -22,13 +22,19 @@ namespace NES { /** - * @brief Returns 1.0 if the tjsonb instant value ever equals the target Jsonb. + * @brief Ever equal tjsonb vs jsonb + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ever_eq_tjsonb_jsonb`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class EverEqTjsonbJsonbLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "EverEqTjsonbJsonb"; - EverEqTjsonbJsonbLogicalFunction(LogicalFunction json_str, LogicalFunction ts, LogicalFunction target_json); + EverEqTjsonbJsonbLogicalFunction(LogicalFunction json_str, + LogicalFunction ts, + LogicalFunction arg0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/EverEqTjsonbTjsonbLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverEqTjsonbTjsonbLogicalFunction.hpp index 70be614386..38d45b5a1c 100644 --- a/nes-logical-operators/include/Functions/Meos/EverEqTjsonbTjsonbLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/EverEqTjsonbTjsonbLogicalFunction.hpp @@ -22,13 +22,20 @@ namespace NES { /** - * @brief Returns 1.0 if the two tjsonb instants are ever equal. + * @brief Ever equal tjsonb vs tjsonb + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ever_eq_tjsonb_tjsonb`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class EverEqTjsonbTjsonbLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "EverEqTjsonbTjsonb"; - EverEqTjsonbTjsonbLogicalFunction(LogicalFunction json1, LogicalFunction ts1, LogicalFunction json2, LogicalFunction ts2); + EverEqTjsonbTjsonbLogicalFunction(LogicalFunction json_str, + LogicalFunction ts, + LogicalFunction json0, + LogicalFunction ts0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/EverEqTnpointNpointLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverEqTnpointNpointLogicalFunction.hpp index 527e8a0d49..a2bcecbc91 100644 --- a/nes-logical-operators/include/Functions/Meos/EverEqTnpointNpointLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/EverEqTnpointNpointLogicalFunction.hpp @@ -22,13 +22,21 @@ namespace NES { /** - * @brief Returns 1.0 if the tnpoint instant is ever equal to the static npoint, 0.0 otherwise. + * @brief Ever eq tnpoint vs npoint + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ever_eq_tnpoint_npoint`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class EverEqTnpointNpointLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "EverEqTnpointNpoint"; - EverEqTnpointNpointLogicalFunction(LogicalFunction rid1, LogicalFunction pos1, LogicalFunction ts, LogicalFunction rid2, LogicalFunction pos2); + EverEqTnpointNpointLogicalFunction(LogicalFunction rid, + LogicalFunction frac, + LogicalFunction ts, + LogicalFunction rid0, + LogicalFunction frac0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/EverEqTnpointTnpointLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverEqTnpointTnpointLogicalFunction.hpp index 83955bbd65..0aa48d93d2 100644 --- a/nes-logical-operators/include/Functions/Meos/EverEqTnpointTnpointLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/EverEqTnpointTnpointLogicalFunction.hpp @@ -22,17 +22,22 @@ namespace NES { /** - * @brief Returns 1.0 if the two tnpoint instants are ever equal, 0.0 otherwise. + * @brief Ever eq tnpoint vs tnpoint * - * Args: (rid1:UINT64, pos1:FLOAT64, ts1:UINT64, - * rid2:UINT64, pos2:FLOAT64, ts2:UINT64) -> FLOAT64. + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ever_eq_tnpoint_tnpoint`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class EverEqTnpointTnpointLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "EverEqTnpointTnpoint"; - EverEqTnpointTnpointLogicalFunction(LogicalFunction rid1, LogicalFunction pos1, LogicalFunction ts1, - LogicalFunction rid2, LogicalFunction pos2, LogicalFunction ts2); + EverEqTnpointTnpointLogicalFunction(LogicalFunction rid, + LogicalFunction frac, + LogicalFunction ts, + LogicalFunction rid0, + LogicalFunction frac0, + LogicalFunction ts0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/EverEqTposePoseLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverEqTposePoseLogicalFunction.hpp index 4b786a6452..9dd8ba6e85 100644 --- a/nes-logical-operators/include/Functions/Meos/EverEqTposePoseLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/EverEqTposePoseLogicalFunction.hpp @@ -22,13 +22,23 @@ namespace NES { /** - * @brief Returns 1.0 if the 2D tpose instant is ever equal to the static pose, 0.0 otherwise. + * @brief Ever eq tpose vs pose + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ever_eq_tpose_pose`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class EverEqTposePoseLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "EverEqTposePose"; - EverEqTposePoseLogicalFunction(LogicalFunction x, LogicalFunction y, LogicalFunction theta, LogicalFunction ts, LogicalFunction x2, LogicalFunction y2, LogicalFunction theta2); + EverEqTposePoseLogicalFunction(LogicalFunction x, + LogicalFunction y, + LogicalFunction theta, + LogicalFunction ts, + LogicalFunction px0, + LogicalFunction py0, + LogicalFunction ptheta0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/EverEqTposeTposeLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverEqTposeTposeLogicalFunction.hpp index 5942a053fe..3a2ffa32c9 100644 --- a/nes-logical-operators/include/Functions/Meos/EverEqTposeTposeLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/EverEqTposeTposeLogicalFunction.hpp @@ -22,19 +22,24 @@ namespace NES { /** - * @brief Returns 1.0 if the two 2D tpose instants are ever equal, 0.0 otherwise. + * @brief Ever eq tpose vs tpose * - * Args: (x1:FLOAT64, y1:FLOAT64, theta1:FLOAT64, ts1:UINT64, - * x2:FLOAT64, y2:FLOAT64, theta2:FLOAT64, ts2:UINT64) -> FLOAT64. + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ever_eq_tpose_tpose`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class EverEqTposeTposeLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "EverEqTposeTpose"; - EverEqTposeTposeLogicalFunction(LogicalFunction x1, LogicalFunction y1, LogicalFunction theta1, - LogicalFunction ts1, - LogicalFunction x2, LogicalFunction y2, LogicalFunction theta2, - LogicalFunction ts2); + EverEqTposeTposeLogicalFunction(LogicalFunction x, + LogicalFunction y, + LogicalFunction theta, + LogicalFunction ts, + LogicalFunction px0, + LogicalFunction py0, + LogicalFunction ptheta0, + LogicalFunction ts0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/EverEqTquadbinQuadbinLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverEqTquadbinQuadbinLogicalFunction.hpp index c76cc261ed..74d70c6c91 100644 --- a/nes-logical-operators/include/Functions/Meos/EverEqTquadbinQuadbinLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/EverEqTquadbinQuadbinLogicalFunction.hpp @@ -22,12 +22,20 @@ namespace NES { /** - * @brief Returns 1 if the tquadbin instant ever equals the Quadbin cell. + * @brief Ever equal tquadbin vs quadbin + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ever_eq_tquadbin_quadbin(temp, (Quadbin)arg0)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class EverEqTquadbinQuadbinLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "EverEqTquadbinQuadbin"; - EverEqTquadbinQuadbinLogicalFunction(LogicalFunction inst_cell, LogicalFunction ts, LogicalFunction cell); + + EverEqTquadbinQuadbinLogicalFunction(LogicalFunction cell, + LogicalFunction ts, + LogicalFunction arg0); + DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; std::vector getChildren() const override; @@ -37,6 +45,7 @@ class EverEqTquadbinQuadbinLogicalFunction : public LogicalFunctionConcept { std::string explain(ExplainVerbosity verbosity) const override; LogicalFunction withInferredDataType(const Schema& schema) const override; SerializableFunction serialize() const override; + private: DataType dataType; std::vector parameters; diff --git a/nes-logical-operators/include/Functions/Meos/EverEqTtextTextLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverEqTtextTextLogicalFunction.hpp index dbdcf2a10d..80ec7f2a3e 100644 --- a/nes-logical-operators/include/Functions/Meos/EverEqTtextTextLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/EverEqTtextTextLogicalFunction.hpp @@ -13,27 +13,38 @@ */ #pragma once + #include #include +#include #include namespace NES { +/** + * @brief Ever eqqual ttext vs text + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ever_eq_ttext_text(temp, txt0)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. + */ class EverEqTtextTextLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "EverEqTtextText"; - EverEqTtextTextLogicalFunction(LogicalFunction value, LogicalFunction ref, LogicalFunction ts); - - DataType getDataType() const override; - LogicalFunction withDataType(const DataType&) const override; - std::vector getChildren() const override; - LogicalFunction withChildren(const std::vector&) const override; - std::string_view getType() const override; - bool operator==(const LogicalFunctionConcept&) const override; - std::string explain(ExplainVerbosity) const override; - LogicalFunction withInferredDataType(const Schema&) const override; - SerializableFunction serialize() const override; + EverEqTtextTextLogicalFunction(LogicalFunction value, + LogicalFunction ts, + LogicalFunction arg0); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; private: DataType dataType; diff --git a/nes-logical-operators/include/Functions/Meos/EverGeBigintTbigintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverGeBigintTbigintLogicalFunction.hpp index a6958eeea1..80ac070a64 100644 --- a/nes-logical-operators/include/Functions/Meos/EverGeBigintTbigintLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/EverGeBigintTbigintLogicalFunction.hpp @@ -22,19 +22,19 @@ namespace NES { /** - * @brief Per-event ever_ge_bigint_tbigint: tests if a single-instant tfloat value ever equals a threshold. + * @brief Per-event ever_ge_bigint_tbigint: ever-greater-or-equal scalar bigint vs tbigint. * * Generated by tools/codegen/codegen_nebula.py from the MEOS function - * `ever_ge_bigint_tbigint`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), - * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + * `ever_ge_bigint_tbigint`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class EverGeBigintTbigintLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "EverGeBigintTbigint"; - EverGeBigintTbigintLogicalFunction(LogicalFunction value, - LogicalFunction threshold, - LogicalFunction ts); + EverGeBigintTbigintLogicalFunction(LogicalFunction arg0, + LogicalFunction value, + LogicalFunction ts); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/EverGeTbigintBigintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverGeTbigintBigintLogicalFunction.hpp index fb283efa26..b460ae1d3b 100644 --- a/nes-logical-operators/include/Functions/Meos/EverGeTbigintBigintLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/EverGeTbigintBigintLogicalFunction.hpp @@ -22,19 +22,19 @@ namespace NES { /** - * @brief Per-event ever_ge_tbigint_bigint: tests if a single-instant tbigint value ever ges a threshold. + * @brief Per-event ever_ge_tbigint_bigint: ever-greater-or-equal tbigint vs scalar bigint. * * Generated by tools/codegen/codegen_nebula.py from the MEOS function - * `ever_ge_tbigint_bigint`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), - * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + * `ever_ge_tbigint_bigint`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class EverGeTbigintBigintLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "EverGeTbigintBigint"; EverGeTbigintBigintLogicalFunction(LogicalFunction value, - LogicalFunction threshold, - LogicalFunction ts); + LogicalFunction ts, + LogicalFunction arg0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/EverGeTextTtextLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverGeTextTtextLogicalFunction.hpp index 0f53d4231a..f35a39c8f9 100644 --- a/nes-logical-operators/include/Functions/Meos/EverGeTextTtextLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/EverGeTextTtextLogicalFunction.hpp @@ -13,27 +13,38 @@ */ #pragma once + #include #include +#include #include namespace NES { +/** + * @brief Ever gequal text vs ttext + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ever_ge_text_ttext(txt0, temp)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. + */ class EverGeTextTtextLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "EverGeTextTtext"; - EverGeTextTtextLogicalFunction(LogicalFunction value, LogicalFunction ref, LogicalFunction ts); - - DataType getDataType() const override; - LogicalFunction withDataType(const DataType&) const override; - std::vector getChildren() const override; - LogicalFunction withChildren(const std::vector&) const override; - std::string_view getType() const override; - bool operator==(const LogicalFunctionConcept&) const override; - std::string explain(ExplainVerbosity) const override; - LogicalFunction withInferredDataType(const Schema&) const override; - SerializableFunction serialize() const override; + EverGeTextTtextLogicalFunction(LogicalFunction arg0, + LogicalFunction value, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; private: DataType dataType; diff --git a/nes-logical-operators/include/Functions/Meos/EverGeTtextTextLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverGeTtextTextLogicalFunction.hpp index 6594911fef..0eb53cdfe9 100644 --- a/nes-logical-operators/include/Functions/Meos/EverGeTtextTextLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/EverGeTtextTextLogicalFunction.hpp @@ -13,27 +13,38 @@ */ #pragma once + #include #include +#include #include namespace NES { +/** + * @brief Ever gequal ttext vs text + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ever_ge_ttext_text(temp, txt0)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. + */ class EverGeTtextTextLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "EverGeTtextText"; - EverGeTtextTextLogicalFunction(LogicalFunction value, LogicalFunction ref, LogicalFunction ts); - - DataType getDataType() const override; - LogicalFunction withDataType(const DataType&) const override; - std::vector getChildren() const override; - LogicalFunction withChildren(const std::vector&) const override; - std::string_view getType() const override; - bool operator==(const LogicalFunctionConcept&) const override; - std::string explain(ExplainVerbosity) const override; - LogicalFunction withInferredDataType(const Schema&) const override; - SerializableFunction serialize() const override; + EverGeTtextTextLogicalFunction(LogicalFunction value, + LogicalFunction ts, + LogicalFunction arg0); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; private: DataType dataType; diff --git a/nes-logical-operators/include/Functions/Meos/EverGtBigintTbigintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverGtBigintTbigintLogicalFunction.hpp index 8b9627dc43..d11813643c 100644 --- a/nes-logical-operators/include/Functions/Meos/EverGtBigintTbigintLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/EverGtBigintTbigintLogicalFunction.hpp @@ -22,19 +22,19 @@ namespace NES { /** - * @brief Per-event ever_gt_bigint_tbigint: tests if a single-instant tfloat value ever equals a threshold. + * @brief Per-event ever_gt_bigint_tbigint: ever-greater-than scalar bigint vs tbigint. * * Generated by tools/codegen/codegen_nebula.py from the MEOS function - * `ever_gt_bigint_tbigint`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), - * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + * `ever_gt_bigint_tbigint`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class EverGtBigintTbigintLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "EverGtBigintTbigint"; - EverGtBigintTbigintLogicalFunction(LogicalFunction value, - LogicalFunction threshold, - LogicalFunction ts); + EverGtBigintTbigintLogicalFunction(LogicalFunction arg0, + LogicalFunction value, + LogicalFunction ts); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/EverGtTbigintBigintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverGtTbigintBigintLogicalFunction.hpp index 80fa5cf7e0..29ca63285c 100644 --- a/nes-logical-operators/include/Functions/Meos/EverGtTbigintBigintLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/EverGtTbigintBigintLogicalFunction.hpp @@ -22,19 +22,19 @@ namespace NES { /** - * @brief Per-event ever_gt_tbigint_bigint: tests if a single-instant tbigint value ever gts a threshold. + * @brief Per-event ever_gt_tbigint_bigint: ever-greater-than tbigint vs scalar bigint. * * Generated by tools/codegen/codegen_nebula.py from the MEOS function - * `ever_gt_tbigint_bigint`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), - * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + * `ever_gt_tbigint_bigint`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class EverGtTbigintBigintLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "EverGtTbigintBigint"; EverGtTbigintBigintLogicalFunction(LogicalFunction value, - LogicalFunction threshold, - LogicalFunction ts); + LogicalFunction ts, + LogicalFunction arg0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/EverGtTextTtextLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverGtTextTtextLogicalFunction.hpp index 4710eee212..1a56b6c444 100644 --- a/nes-logical-operators/include/Functions/Meos/EverGtTextTtextLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/EverGtTextTtextLogicalFunction.hpp @@ -13,27 +13,38 @@ */ #pragma once + #include #include +#include #include namespace NES { +/** + * @brief Ever gtqual text vs ttext + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ever_gt_text_ttext(txt0, temp)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. + */ class EverGtTextTtextLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "EverGtTextTtext"; - EverGtTextTtextLogicalFunction(LogicalFunction value, LogicalFunction ref, LogicalFunction ts); - - DataType getDataType() const override; - LogicalFunction withDataType(const DataType&) const override; - std::vector getChildren() const override; - LogicalFunction withChildren(const std::vector&) const override; - std::string_view getType() const override; - bool operator==(const LogicalFunctionConcept&) const override; - std::string explain(ExplainVerbosity) const override; - LogicalFunction withInferredDataType(const Schema&) const override; - SerializableFunction serialize() const override; + EverGtTextTtextLogicalFunction(LogicalFunction arg0, + LogicalFunction value, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; private: DataType dataType; diff --git a/nes-logical-operators/include/Functions/Meos/EverGtTtextTextLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverGtTtextTextLogicalFunction.hpp index c44ef057f7..96ae0cd3ea 100644 --- a/nes-logical-operators/include/Functions/Meos/EverGtTtextTextLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/EverGtTtextTextLogicalFunction.hpp @@ -13,27 +13,38 @@ */ #pragma once + #include #include +#include #include namespace NES { +/** + * @brief Ever gtqual ttext vs text + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ever_gt_ttext_text(temp, txt0)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. + */ class EverGtTtextTextLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "EverGtTtextText"; - EverGtTtextTextLogicalFunction(LogicalFunction value, LogicalFunction ref, LogicalFunction ts); - - DataType getDataType() const override; - LogicalFunction withDataType(const DataType&) const override; - std::vector getChildren() const override; - LogicalFunction withChildren(const std::vector&) const override; - std::string_view getType() const override; - bool operator==(const LogicalFunctionConcept&) const override; - std::string explain(ExplainVerbosity) const override; - LogicalFunction withInferredDataType(const Schema&) const override; - SerializableFunction serialize() const override; + EverGtTtextTextLogicalFunction(LogicalFunction value, + LogicalFunction ts, + LogicalFunction arg0); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; private: DataType dataType; diff --git a/nes-logical-operators/include/Functions/Meos/EverLeBigintTbigintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverLeBigintTbigintLogicalFunction.hpp index 6b55c629a2..789702f694 100644 --- a/nes-logical-operators/include/Functions/Meos/EverLeBigintTbigintLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/EverLeBigintTbigintLogicalFunction.hpp @@ -22,19 +22,19 @@ namespace NES { /** - * @brief Per-event ever_le_bigint_tbigint: tests if a single-instant tfloat value ever equals a threshold. + * @brief Per-event ever_le_bigint_tbigint: ever-less-or-equal scalar bigint vs tbigint. * * Generated by tools/codegen/codegen_nebula.py from the MEOS function - * `ever_le_bigint_tbigint`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), - * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + * `ever_le_bigint_tbigint`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class EverLeBigintTbigintLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "EverLeBigintTbigint"; - EverLeBigintTbigintLogicalFunction(LogicalFunction value, - LogicalFunction threshold, - LogicalFunction ts); + EverLeBigintTbigintLogicalFunction(LogicalFunction arg0, + LogicalFunction value, + LogicalFunction ts); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/EverLeTbigintBigintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverLeTbigintBigintLogicalFunction.hpp index e85cf1183b..1c0c3c003c 100644 --- a/nes-logical-operators/include/Functions/Meos/EverLeTbigintBigintLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/EverLeTbigintBigintLogicalFunction.hpp @@ -22,19 +22,19 @@ namespace NES { /** - * @brief Per-event ever_le_tbigint_bigint: tests if a single-instant tbigint value ever les a threshold. + * @brief Per-event ever_le_tbigint_bigint: ever-less-or-equal tbigint vs scalar bigint. * * Generated by tools/codegen/codegen_nebula.py from the MEOS function - * `ever_le_tbigint_bigint`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), - * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + * `ever_le_tbigint_bigint`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class EverLeTbigintBigintLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "EverLeTbigintBigint"; EverLeTbigintBigintLogicalFunction(LogicalFunction value, - LogicalFunction threshold, - LogicalFunction ts); + LogicalFunction ts, + LogicalFunction arg0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/EverLeTextTtextLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverLeTextTtextLogicalFunction.hpp index 4a1757c7be..f267236979 100644 --- a/nes-logical-operators/include/Functions/Meos/EverLeTextTtextLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/EverLeTextTtextLogicalFunction.hpp @@ -13,27 +13,38 @@ */ #pragma once + #include #include +#include #include namespace NES { +/** + * @brief Ever lequal text vs ttext + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ever_le_text_ttext(txt0, temp)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. + */ class EverLeTextTtextLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "EverLeTextTtext"; - EverLeTextTtextLogicalFunction(LogicalFunction value, LogicalFunction ref, LogicalFunction ts); - - DataType getDataType() const override; - LogicalFunction withDataType(const DataType&) const override; - std::vector getChildren() const override; - LogicalFunction withChildren(const std::vector&) const override; - std::string_view getType() const override; - bool operator==(const LogicalFunctionConcept&) const override; - std::string explain(ExplainVerbosity) const override; - LogicalFunction withInferredDataType(const Schema&) const override; - SerializableFunction serialize() const override; + EverLeTextTtextLogicalFunction(LogicalFunction arg0, + LogicalFunction value, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; private: DataType dataType; diff --git a/nes-logical-operators/include/Functions/Meos/EverLeTtextTextLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverLeTtextTextLogicalFunction.hpp index 9985d77c71..af606e91cb 100644 --- a/nes-logical-operators/include/Functions/Meos/EverLeTtextTextLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/EverLeTtextTextLogicalFunction.hpp @@ -13,27 +13,38 @@ */ #pragma once + #include #include +#include #include namespace NES { +/** + * @brief Ever lequal ttext vs text + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ever_le_ttext_text(temp, txt0)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. + */ class EverLeTtextTextLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "EverLeTtextText"; - EverLeTtextTextLogicalFunction(LogicalFunction value, LogicalFunction ref, LogicalFunction ts); - - DataType getDataType() const override; - LogicalFunction withDataType(const DataType&) const override; - std::vector getChildren() const override; - LogicalFunction withChildren(const std::vector&) const override; - std::string_view getType() const override; - bool operator==(const LogicalFunctionConcept&) const override; - std::string explain(ExplainVerbosity) const override; - LogicalFunction withInferredDataType(const Schema&) const override; - SerializableFunction serialize() const override; + EverLeTtextTextLogicalFunction(LogicalFunction value, + LogicalFunction ts, + LogicalFunction arg0); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; private: DataType dataType; diff --git a/nes-logical-operators/include/Functions/Meos/EverLtBigintTbigintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverLtBigintTbigintLogicalFunction.hpp index 21c827c647..25efa90486 100644 --- a/nes-logical-operators/include/Functions/Meos/EverLtBigintTbigintLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/EverLtBigintTbigintLogicalFunction.hpp @@ -22,19 +22,19 @@ namespace NES { /** - * @brief Per-event ever_lt_bigint_tbigint: tests if a single-instant tfloat value ever equals a threshold. + * @brief Per-event ever_lt_bigint_tbigint: ever-less-than scalar bigint vs tbigint. * * Generated by tools/codegen/codegen_nebula.py from the MEOS function - * `ever_lt_bigint_tbigint`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), - * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + * `ever_lt_bigint_tbigint`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class EverLtBigintTbigintLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "EverLtBigintTbigint"; - EverLtBigintTbigintLogicalFunction(LogicalFunction value, - LogicalFunction threshold, - LogicalFunction ts); + EverLtBigintTbigintLogicalFunction(LogicalFunction arg0, + LogicalFunction value, + LogicalFunction ts); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/EverLtTbigintBigintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverLtTbigintBigintLogicalFunction.hpp index 91456fee24..6d9a71981a 100644 --- a/nes-logical-operators/include/Functions/Meos/EverLtTbigintBigintLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/EverLtTbigintBigintLogicalFunction.hpp @@ -22,19 +22,19 @@ namespace NES { /** - * @brief Per-event ever_lt_tbigint_bigint: tests if a single-instant tbigint value ever lts a threshold. + * @brief Per-event ever_lt_tbigint_bigint: ever-less-than tbigint vs scalar bigint. * * Generated by tools/codegen/codegen_nebula.py from the MEOS function - * `ever_lt_tbigint_bigint`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), - * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + * `ever_lt_tbigint_bigint`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class EverLtTbigintBigintLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "EverLtTbigintBigint"; EverLtTbigintBigintLogicalFunction(LogicalFunction value, - LogicalFunction threshold, - LogicalFunction ts); + LogicalFunction ts, + LogicalFunction arg0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/EverLtTextTtextLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverLtTextTtextLogicalFunction.hpp index b86921dc37..fd70270644 100644 --- a/nes-logical-operators/include/Functions/Meos/EverLtTextTtextLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/EverLtTextTtextLogicalFunction.hpp @@ -13,27 +13,38 @@ */ #pragma once + #include #include +#include #include namespace NES { +/** + * @brief Ever ltqual text vs ttext + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ever_lt_text_ttext(txt0, temp)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. + */ class EverLtTextTtextLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "EverLtTextTtext"; - EverLtTextTtextLogicalFunction(LogicalFunction value, LogicalFunction ref, LogicalFunction ts); - - DataType getDataType() const override; - LogicalFunction withDataType(const DataType&) const override; - std::vector getChildren() const override; - LogicalFunction withChildren(const std::vector&) const override; - std::string_view getType() const override; - bool operator==(const LogicalFunctionConcept&) const override; - std::string explain(ExplainVerbosity) const override; - LogicalFunction withInferredDataType(const Schema&) const override; - SerializableFunction serialize() const override; + EverLtTextTtextLogicalFunction(LogicalFunction arg0, + LogicalFunction value, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; private: DataType dataType; diff --git a/nes-logical-operators/include/Functions/Meos/EverLtTtextTextLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverLtTtextTextLogicalFunction.hpp index 56d4d00c4b..f7b4974b0d 100644 --- a/nes-logical-operators/include/Functions/Meos/EverLtTtextTextLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/EverLtTtextTextLogicalFunction.hpp @@ -13,27 +13,38 @@ */ #pragma once + #include #include +#include #include namespace NES { +/** + * @brief Ever ltqual ttext vs text + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ever_lt_ttext_text(temp, txt0)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. + */ class EverLtTtextTextLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "EverLtTtextText"; - EverLtTtextTextLogicalFunction(LogicalFunction value, LogicalFunction ref, LogicalFunction ts); - - DataType getDataType() const override; - LogicalFunction withDataType(const DataType&) const override; - std::vector getChildren() const override; - LogicalFunction withChildren(const std::vector&) const override; - std::string_view getType() const override; - bool operator==(const LogicalFunctionConcept&) const override; - std::string explain(ExplainVerbosity) const override; - LogicalFunction withInferredDataType(const Schema&) const override; - SerializableFunction serialize() const override; + EverLtTtextTextLogicalFunction(LogicalFunction value, + LogicalFunction ts, + LogicalFunction arg0); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; private: DataType dataType; diff --git a/nes-logical-operators/include/Functions/Meos/EverNeBigintTbigintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverNeBigintTbigintLogicalFunction.hpp index 5b5ec3f630..3140edc831 100644 --- a/nes-logical-operators/include/Functions/Meos/EverNeBigintTbigintLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/EverNeBigintTbigintLogicalFunction.hpp @@ -22,19 +22,19 @@ namespace NES { /** - * @brief Per-event ever_ne_bigint_tbigint: tests if a single-instant tfloat value ever equals a threshold. + * @brief Per-event ever_ne_bigint_tbigint: ever-not-equal scalar bigint vs tbigint. * * Generated by tools/codegen/codegen_nebula.py from the MEOS function - * `ever_ne_bigint_tbigint`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), - * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + * `ever_ne_bigint_tbigint`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class EverNeBigintTbigintLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "EverNeBigintTbigint"; - EverNeBigintTbigintLogicalFunction(LogicalFunction value, - LogicalFunction threshold, - LogicalFunction ts); + EverNeBigintTbigintLogicalFunction(LogicalFunction arg0, + LogicalFunction value, + LogicalFunction ts); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/EverNeBoolTboolLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverNeBoolTboolLogicalFunction.hpp index b77a9ea104..bd0cbee62a 100644 --- a/nes-logical-operators/include/Functions/Meos/EverNeBoolTboolLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/EverNeBoolTboolLogicalFunction.hpp @@ -22,19 +22,19 @@ namespace NES { /** - * @brief Per-event ever_ne_bool_tbool: tests if a single-instant tfloat value ever equals a threshold. + * @brief Per-event ever_ne_bool_tbool: ever-not-equal scalar bool vs tbool. * * Generated by tools/codegen/codegen_nebula.py from the MEOS function - * `ever_ne_bool_tbool`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), - * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + * `ever_ne_bool_tbool`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class EverNeBoolTboolLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "EverNeBoolTbool"; - EverNeBoolTboolLogicalFunction(LogicalFunction value, - LogicalFunction threshold, - LogicalFunction ts); + EverNeBoolTboolLogicalFunction(LogicalFunction arg0, + LogicalFunction value, + LogicalFunction ts); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/EverNeNpointTnpointLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverNeNpointTnpointLogicalFunction.hpp index c03338e09b..9e7b7b2fdc 100644 --- a/nes-logical-operators/include/Functions/Meos/EverNeNpointTnpointLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/EverNeNpointTnpointLogicalFunction.hpp @@ -22,13 +22,21 @@ namespace NES { /** - * @brief Returns 1.0 if the static npoint is ever not equal to the tnpoint instant, 0.0 otherwise. + * @brief Ever ne npoint vs tnpoint + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ever_ne_npoint_tnpoint`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class EverNeNpointTnpointLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "EverNeNpointTnpoint"; - EverNeNpointTnpointLogicalFunction(LogicalFunction rid_np, LogicalFunction pos_np, LogicalFunction rid_tp, LogicalFunction pos_tp, LogicalFunction ts); + EverNeNpointTnpointLogicalFunction(LogicalFunction rid0, + LogicalFunction frac0, + LogicalFunction rid, + LogicalFunction frac, + LogicalFunction ts); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/EverNePoseTposeLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverNePoseTposeLogicalFunction.hpp index 94e76a2718..b0914226a9 100644 --- a/nes-logical-operators/include/Functions/Meos/EverNePoseTposeLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/EverNePoseTposeLogicalFunction.hpp @@ -22,13 +22,23 @@ namespace NES { /** - * @brief Returns 1.0 if the static pose is ever not equal to the 2D tpose instant, 0.0 otherwise. + * @brief Ever ne pose vs tpose + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ever_ne_pose_tpose`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class EverNePoseTposeLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "EverNePoseTpose"; - EverNePoseTposeLogicalFunction(LogicalFunction x2, LogicalFunction y2, LogicalFunction theta2, LogicalFunction x, LogicalFunction y, LogicalFunction theta, LogicalFunction ts); + EverNePoseTposeLogicalFunction(LogicalFunction px0, + LogicalFunction py0, + LogicalFunction ptheta0, + LogicalFunction x, + LogicalFunction y, + LogicalFunction theta, + LogicalFunction ts); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/EverNeTbigintBigintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverNeTbigintBigintLogicalFunction.hpp index 5e78502677..697669868d 100644 --- a/nes-logical-operators/include/Functions/Meos/EverNeTbigintBigintLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/EverNeTbigintBigintLogicalFunction.hpp @@ -22,19 +22,19 @@ namespace NES { /** - * @brief Per-event ever_ne_tbigint_bigint: tests if a single-instant tbigint value ever nes a threshold. + * @brief Per-event ever_ne_tbigint_bigint: ever-not-equal tbigint vs scalar bigint. * * Generated by tools/codegen/codegen_nebula.py from the MEOS function - * `ever_ne_tbigint_bigint`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), - * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + * `ever_ne_tbigint_bigint`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class EverNeTbigintBigintLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "EverNeTbigintBigint"; EverNeTbigintBigintLogicalFunction(LogicalFunction value, - LogicalFunction threshold, - LogicalFunction ts); + LogicalFunction ts, + LogicalFunction arg0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/EverNeTboolBoolLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverNeTboolBoolLogicalFunction.hpp index 07dca7e895..c9bf31fde6 100644 --- a/nes-logical-operators/include/Functions/Meos/EverNeTboolBoolLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/EverNeTboolBoolLogicalFunction.hpp @@ -22,19 +22,19 @@ namespace NES { /** - * @brief Per-event ever_ne_tbool_bool: tests if a single-instant tfloat value ever equals a threshold. + * @brief Per-event ever_ne_tbool_bool: ever-not-equal tbool vs scalar bool. * * Generated by tools/codegen/codegen_nebula.py from the MEOS function - * `ever_ne_tbool_bool`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), - * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + * `ever_ne_tbool_bool`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class EverNeTboolBoolLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "EverNeTboolBool"; EverNeTboolBoolLogicalFunction(LogicalFunction value, - LogicalFunction threshold, - LogicalFunction ts); + LogicalFunction ts, + LogicalFunction arg0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/EverNeTcbufferTcbufferLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverNeTcbufferTcbufferLogicalFunction.hpp index ae466f1ed0..855204b2fa 100644 --- a/nes-logical-operators/include/Functions/Meos/EverNeTcbufferTcbufferLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/EverNeTcbufferTcbufferLogicalFunction.hpp @@ -22,19 +22,24 @@ namespace NES { /** - * @brief Returns 1.0 if the two tcbuffer instants are ever not equal, 0.0 otherwise. + * @brief Per-event ever_ne_tcbuffer_tcbuffer spatial predicate. * - * Args: (lon1:FLOAT64, lat1:FLOAT64, r1:FLOAT64, ts1:UINT64, - * lon2:FLOAT64, lat2:FLOAT64, r2:FLOAT64, ts2:UINT64) -> FLOAT64. + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ever_ne_tcbuffer_tcbuffer`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class EverNeTcbufferTcbufferLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "EverNeTcbufferTcbuffer"; - EverNeTcbufferTcbufferLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction r1, - LogicalFunction ts1, - LogicalFunction lon2, LogicalFunction lat2, LogicalFunction r2, - LogicalFunction ts2); + EverNeTcbufferTcbufferLogicalFunction(LogicalFunction lonA, + LogicalFunction latA, + LogicalFunction radiusA, + LogicalFunction tsA, + LogicalFunction lonB, + LogicalFunction latB, + LogicalFunction radiusB, + LogicalFunction tsB); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/EverNeTextTtextLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverNeTextTtextLogicalFunction.hpp index c6aec3694b..d0412c6926 100644 --- a/nes-logical-operators/include/Functions/Meos/EverNeTextTtextLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/EverNeTextTtextLogicalFunction.hpp @@ -13,27 +13,38 @@ */ #pragma once + #include #include +#include #include namespace NES { +/** + * @brief Ever nequal text vs ttext + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ever_ne_text_ttext(txt0, temp)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. + */ class EverNeTextTtextLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "EverNeTextTtext"; - EverNeTextTtextLogicalFunction(LogicalFunction value, LogicalFunction ref, LogicalFunction ts); - - DataType getDataType() const override; - LogicalFunction withDataType(const DataType&) const override; - std::vector getChildren() const override; - LogicalFunction withChildren(const std::vector&) const override; - std::string_view getType() const override; - bool operator==(const LogicalFunctionConcept&) const override; - std::string explain(ExplainVerbosity) const override; - LogicalFunction withInferredDataType(const Schema&) const override; - SerializableFunction serialize() const override; + EverNeTextTtextLogicalFunction(LogicalFunction arg0, + LogicalFunction value, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; private: DataType dataType; diff --git a/nes-logical-operators/include/Functions/Meos/EverNeTgeoGeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverNeTgeoGeoLogicalFunction.hpp index 1279c025bd..1314fdefe1 100644 --- a/nes-logical-operators/include/Functions/Meos/EverNeTgeoGeoLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/EverNeTgeoGeoLogicalFunction.hpp @@ -22,16 +22,20 @@ namespace NES { /** - * @brief Returns 1.0 if the temporal geometry is ever not equal to the static geometry. + * @brief Per-event ever_ne_tgeo_geo spatial predicate. * - * Args: (lon:FLOAT64, lat:FLOAT64, ts:UINT64, wkt:VARCHAR) -> FLOAT64. + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ever_ne_tgeo_geo`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class EverNeTgeoGeoLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "EverNeTgeoGeo"; - EverNeTgeoGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, - LogicalFunction ts, LogicalFunction wkt); + EverNeTgeoGeoLogicalFunction(LogicalFunction lon, + LogicalFunction lat, + LogicalFunction timestamp, + LogicalFunction geometry); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/EverNeTgeoTgeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverNeTgeoTgeoLogicalFunction.hpp index 5a46ad9201..9fcbb8e89d 100644 --- a/nes-logical-operators/include/Functions/Meos/EverNeTgeoTgeoLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/EverNeTgeoTgeoLogicalFunction.hpp @@ -22,13 +22,22 @@ namespace NES { /** - * @brief Tests whether two temporal geometries are ever spatially not equal. + * @brief Per-event ever_ne_tgeo_tgeo spatial predicate. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ever_ne_tgeo_tgeo`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class EverNeTgeoTgeoLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "EverNeTgeoTgeo"; - EverNeTgeoTgeoLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction ts1, LogicalFunction lon2, LogicalFunction lat2, LogicalFunction ts2); + EverNeTgeoTgeoLogicalFunction(LogicalFunction lonA, + LogicalFunction latA, + LogicalFunction tsA, + LogicalFunction lonB, + LogicalFunction latB, + LogicalFunction tsB); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/EverNeTh3indexH3indexLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverNeTh3indexH3indexLogicalFunction.hpp index 7bc68238bd..cf8ad6962d 100644 --- a/nes-logical-operators/include/Functions/Meos/EverNeTh3indexH3indexLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/EverNeTh3indexH3indexLogicalFunction.hpp @@ -22,15 +22,19 @@ namespace NES { /** - * @brief Returns 1.0 if the th3index instant is ever not equal to the target H3 cell. + * @brief Ever neual th3index vs h3index * - * Args: (cell:UINT64, ts:UINT64, target:UINT64) -> FLOAT64. + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ever_ne_th3index_h3index(temp, (H3Index)arg0)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class EverNeTh3indexH3indexLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "EverNeTh3indexH3index"; - EverNeTh3indexH3indexLogicalFunction(LogicalFunction cell, LogicalFunction ts, LogicalFunction target); + EverNeTh3indexH3indexLogicalFunction(LogicalFunction cell, + LogicalFunction ts, + LogicalFunction arg0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/EverNeTjsonbJsonbLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverNeTjsonbJsonbLogicalFunction.hpp index ed1cfd83af..56648e4c75 100644 --- a/nes-logical-operators/include/Functions/Meos/EverNeTjsonbJsonbLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/EverNeTjsonbJsonbLogicalFunction.hpp @@ -22,13 +22,19 @@ namespace NES { /** - * @brief Returns 1.0 if the tjsonb instant value ever differs from the target Jsonb. + * @brief Ever neual tjsonb vs jsonb + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ever_ne_tjsonb_jsonb`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class EverNeTjsonbJsonbLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "EverNeTjsonbJsonb"; - EverNeTjsonbJsonbLogicalFunction(LogicalFunction json_str, LogicalFunction ts, LogicalFunction target_json); + EverNeTjsonbJsonbLogicalFunction(LogicalFunction json_str, + LogicalFunction ts, + LogicalFunction arg0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/EverNeTjsonbTjsonbLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverNeTjsonbTjsonbLogicalFunction.hpp index 0b8af0041d..915ca33e1d 100644 --- a/nes-logical-operators/include/Functions/Meos/EverNeTjsonbTjsonbLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/EverNeTjsonbTjsonbLogicalFunction.hpp @@ -22,13 +22,20 @@ namespace NES { /** - * @brief Returns 1.0 if the two tjsonb instants are ever not equal. + * @brief Ever neual tjsonb vs tjsonb + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ever_ne_tjsonb_tjsonb`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class EverNeTjsonbTjsonbLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "EverNeTjsonbTjsonb"; - EverNeTjsonbTjsonbLogicalFunction(LogicalFunction json1, LogicalFunction ts1, LogicalFunction json2, LogicalFunction ts2); + EverNeTjsonbTjsonbLogicalFunction(LogicalFunction json_str, + LogicalFunction ts, + LogicalFunction json0, + LogicalFunction ts0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/EverNeTnpointNpointLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverNeTnpointNpointLogicalFunction.hpp index 83ab3b2a26..919905eff6 100644 --- a/nes-logical-operators/include/Functions/Meos/EverNeTnpointNpointLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/EverNeTnpointNpointLogicalFunction.hpp @@ -22,13 +22,21 @@ namespace NES { /** - * @brief Returns 1.0 if the tnpoint instant is ever not equal to the static npoint, 0.0 otherwise. + * @brief Ever ne tnpoint vs npoint + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ever_ne_tnpoint_npoint`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class EverNeTnpointNpointLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "EverNeTnpointNpoint"; - EverNeTnpointNpointLogicalFunction(LogicalFunction rid1, LogicalFunction pos1, LogicalFunction ts, LogicalFunction rid2, LogicalFunction pos2); + EverNeTnpointNpointLogicalFunction(LogicalFunction rid, + LogicalFunction frac, + LogicalFunction ts, + LogicalFunction rid0, + LogicalFunction frac0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/EverNeTnpointTnpointLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverNeTnpointTnpointLogicalFunction.hpp index 70b4eb871e..a406d973b9 100644 --- a/nes-logical-operators/include/Functions/Meos/EverNeTnpointTnpointLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/EverNeTnpointTnpointLogicalFunction.hpp @@ -22,17 +22,22 @@ namespace NES { /** - * @brief Returns 1.0 if the two tnpoint instants are ever not equal, 0.0 otherwise. + * @brief Ever ne tnpoint vs tnpoint * - * Args: (rid1:UINT64, pos1:FLOAT64, ts1:UINT64, - * rid2:UINT64, pos2:FLOAT64, ts2:UINT64) -> FLOAT64. + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ever_ne_tnpoint_tnpoint`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class EverNeTnpointTnpointLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "EverNeTnpointTnpoint"; - EverNeTnpointTnpointLogicalFunction(LogicalFunction rid1, LogicalFunction pos1, LogicalFunction ts1, - LogicalFunction rid2, LogicalFunction pos2, LogicalFunction ts2); + EverNeTnpointTnpointLogicalFunction(LogicalFunction rid, + LogicalFunction frac, + LogicalFunction ts, + LogicalFunction rid0, + LogicalFunction frac0, + LogicalFunction ts0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/EverNeTposePoseLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverNeTposePoseLogicalFunction.hpp index e94c0bded7..6a23adb8c4 100644 --- a/nes-logical-operators/include/Functions/Meos/EverNeTposePoseLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/EverNeTposePoseLogicalFunction.hpp @@ -22,13 +22,23 @@ namespace NES { /** - * @brief Returns 1.0 if the 2D tpose instant is ever not equal to the static pose, 0.0 otherwise. + * @brief Ever ne tpose vs pose + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ever_ne_tpose_pose`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class EverNeTposePoseLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "EverNeTposePose"; - EverNeTposePoseLogicalFunction(LogicalFunction x, LogicalFunction y, LogicalFunction theta, LogicalFunction ts, LogicalFunction x2, LogicalFunction y2, LogicalFunction theta2); + EverNeTposePoseLogicalFunction(LogicalFunction x, + LogicalFunction y, + LogicalFunction theta, + LogicalFunction ts, + LogicalFunction px0, + LogicalFunction py0, + LogicalFunction ptheta0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/EverNeTposeTposeLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverNeTposeTposeLogicalFunction.hpp index 3a7388923b..0725f63790 100644 --- a/nes-logical-operators/include/Functions/Meos/EverNeTposeTposeLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/EverNeTposeTposeLogicalFunction.hpp @@ -22,19 +22,24 @@ namespace NES { /** - * @brief Returns 1.0 if the two 2D tpose instants are ever not equal, 0.0 otherwise. + * @brief Ever ne tpose vs tpose * - * Args: (x1:FLOAT64, y1:FLOAT64, theta1:FLOAT64, ts1:UINT64, - * x2:FLOAT64, y2:FLOAT64, theta2:FLOAT64, ts2:UINT64) -> FLOAT64. + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ever_ne_tpose_tpose`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class EverNeTposeTposeLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "EverNeTposeTpose"; - EverNeTposeTposeLogicalFunction(LogicalFunction x1, LogicalFunction y1, LogicalFunction theta1, - LogicalFunction ts1, - LogicalFunction x2, LogicalFunction y2, LogicalFunction theta2, - LogicalFunction ts2); + EverNeTposeTposeLogicalFunction(LogicalFunction x, + LogicalFunction y, + LogicalFunction theta, + LogicalFunction ts, + LogicalFunction px0, + LogicalFunction py0, + LogicalFunction ptheta0, + LogicalFunction ts0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/EverNeTquadbinQuadbinLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverNeTquadbinQuadbinLogicalFunction.hpp index c8ed26cfa7..c4b17bf2a1 100644 --- a/nes-logical-operators/include/Functions/Meos/EverNeTquadbinQuadbinLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/EverNeTquadbinQuadbinLogicalFunction.hpp @@ -22,12 +22,20 @@ namespace NES { /** - * @brief Returns 1 if the tquadbin instant ever differs from the Quadbin cell. + * @brief Ever neual tquadbin vs quadbin + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ever_ne_tquadbin_quadbin(temp, (Quadbin)arg0)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class EverNeTquadbinQuadbinLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "EverNeTquadbinQuadbin"; - EverNeTquadbinQuadbinLogicalFunction(LogicalFunction inst_cell, LogicalFunction ts, LogicalFunction cell); + + EverNeTquadbinQuadbinLogicalFunction(LogicalFunction cell, + LogicalFunction ts, + LogicalFunction arg0); + DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; std::vector getChildren() const override; @@ -37,6 +45,7 @@ class EverNeTquadbinQuadbinLogicalFunction : public LogicalFunctionConcept { std::string explain(ExplainVerbosity verbosity) const override; LogicalFunction withInferredDataType(const Schema& schema) const override; SerializableFunction serialize() const override; + private: DataType dataType; std::vector parameters; diff --git a/nes-logical-operators/include/Functions/Meos/EverNeTtextTextLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/EverNeTtextTextLogicalFunction.hpp index 243a080cb7..daee596d77 100644 --- a/nes-logical-operators/include/Functions/Meos/EverNeTtextTextLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/EverNeTtextTextLogicalFunction.hpp @@ -13,27 +13,38 @@ */ #pragma once + #include #include +#include #include namespace NES { +/** + * @brief Ever nequal ttext vs text + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ever_ne_ttext_text(temp, txt0)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. + */ class EverNeTtextTextLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "EverNeTtextText"; - EverNeTtextTextLogicalFunction(LogicalFunction value, LogicalFunction ref, LogicalFunction ts); - - DataType getDataType() const override; - LogicalFunction withDataType(const DataType&) const override; - std::vector getChildren() const override; - LogicalFunction withChildren(const std::vector&) const override; - std::string_view getType() const override; - bool operator==(const LogicalFunctionConcept&) const override; - std::string explain(ExplainVerbosity) const override; - LogicalFunction withInferredDataType(const Schema&) const override; - SerializableFunction serialize() const override; + EverNeTtextTextLogicalFunction(LogicalFunction value, + LogicalFunction ts, + LogicalFunction arg0); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; private: DataType dataType; diff --git a/nes-logical-operators/include/Functions/Meos/FloatspanLowerIncLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/FloatspanLowerIncLogicalFunction.hpp index 19fcbb21ef..dffbe83073 100644 --- a/nes-logical-operators/include/Functions/Meos/FloatspanLowerIncLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/FloatspanLowerIncLogicalFunction.hpp @@ -22,12 +22,18 @@ namespace NES { /** - * @brief Returns 1 if the lower bound of a float span is inclusive, 0 otherwise. + * @brief Floatspan lower_inc + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `span_lower_inc`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class FloatspanLowerIncLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "FloatspanLowerInc"; + FloatspanLowerIncLogicalFunction(LogicalFunction sp); + DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; std::vector getChildren() const override; @@ -37,6 +43,7 @@ class FloatspanLowerIncLogicalFunction : public LogicalFunctionConcept { std::string explain(ExplainVerbosity verbosity) const override; LogicalFunction withInferredDataType(const Schema& schema) const override; SerializableFunction serialize() const override; + private: DataType dataType; std::vector parameters; diff --git a/nes-logical-operators/include/Functions/Meos/FloatspanLowerLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/FloatspanLowerLogicalFunction.hpp index 14edef4f90..dcd89aa356 100644 --- a/nes-logical-operators/include/Functions/Meos/FloatspanLowerLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/FloatspanLowerLogicalFunction.hpp @@ -22,12 +22,18 @@ namespace NES { /** - * @brief Returns the lower bound of a float span. + * @brief Floatspan lower + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `floatspan_lower`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class FloatspanLowerLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "FloatspanLower"; + FloatspanLowerLogicalFunction(LogicalFunction sp); + DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; std::vector getChildren() const override; @@ -37,6 +43,7 @@ class FloatspanLowerLogicalFunction : public LogicalFunctionConcept { std::string explain(ExplainVerbosity verbosity) const override; LogicalFunction withInferredDataType(const Schema& schema) const override; SerializableFunction serialize() const override; + private: DataType dataType; std::vector parameters; diff --git a/nes-logical-operators/include/Functions/Meos/FloatspanUpperIncLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/FloatspanUpperIncLogicalFunction.hpp index 67656438f3..98e3a307cd 100644 --- a/nes-logical-operators/include/Functions/Meos/FloatspanUpperIncLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/FloatspanUpperIncLogicalFunction.hpp @@ -22,12 +22,18 @@ namespace NES { /** - * @brief Returns 1 if the upper bound of a float span is inclusive, 0 otherwise. + * @brief Floatspan upper_inc + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `span_upper_inc`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class FloatspanUpperIncLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "FloatspanUpperInc"; + FloatspanUpperIncLogicalFunction(LogicalFunction sp); + DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; std::vector getChildren() const override; @@ -37,6 +43,7 @@ class FloatspanUpperIncLogicalFunction : public LogicalFunctionConcept { std::string explain(ExplainVerbosity verbosity) const override; LogicalFunction withInferredDataType(const Schema& schema) const override; SerializableFunction serialize() const override; + private: DataType dataType; std::vector parameters; diff --git a/nes-logical-operators/include/Functions/Meos/FloatspanUpperLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/FloatspanUpperLogicalFunction.hpp index bc0db186db..79e5c9ef4c 100644 --- a/nes-logical-operators/include/Functions/Meos/FloatspanUpperLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/FloatspanUpperLogicalFunction.hpp @@ -22,12 +22,18 @@ namespace NES { /** - * @brief Returns the upper bound of a float span. + * @brief Floatspan upper + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `floatspan_upper`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class FloatspanUpperLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "FloatspanUpper"; + FloatspanUpperLogicalFunction(LogicalFunction sp); + DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; std::vector getChildren() const override; @@ -37,6 +43,7 @@ class FloatspanUpperLogicalFunction : public LogicalFunctionConcept { std::string explain(ExplainVerbosity verbosity) const override; LogicalFunction withInferredDataType(const Schema& schema) const override; SerializableFunction serialize() const override; + private: DataType dataType; std::vector parameters; diff --git a/nes-logical-operators/include/Functions/Meos/FloatspanWidthLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/FloatspanWidthLogicalFunction.hpp index 556a46d45a..0e456e107e 100644 --- a/nes-logical-operators/include/Functions/Meos/FloatspanWidthLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/FloatspanWidthLogicalFunction.hpp @@ -22,12 +22,18 @@ namespace NES { /** - * @brief Returns the width of a float span. + * @brief Floatspan width + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `floatspan_width`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class FloatspanWidthLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "FloatspanWidth"; + FloatspanWidthLogicalFunction(LogicalFunction sp); + DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; std::vector getChildren() const override; @@ -37,6 +43,7 @@ class FloatspanWidthLogicalFunction : public LogicalFunctionConcept { std::string explain(ExplainVerbosity verbosity) const override; LogicalFunction withInferredDataType(const Schema& schema) const override; SerializableFunction serialize() const override; + private: DataType dataType; std::vector parameters; diff --git a/nes-logical-operators/include/Functions/Meos/GeoAsEwktLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeoAsEwktLogicalFunction.hpp index c0eeca384e..9b1c1972be 100644 --- a/nes-logical-operators/include/Functions/Meos/GeoAsEwktLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/GeoAsEwktLogicalFunction.hpp @@ -22,13 +22,18 @@ namespace NES { /** - * @brief Serializes a geometry to EWKT with the given coordinate precision. + * @brief Geometry as EWKT + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `geo_as_ewkt(temp, (int)arg0)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class GeoAsEwktLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "GeoAsEwkt"; - GeoAsEwktLogicalFunction(LogicalFunction wkt, LogicalFunction precision); + GeoAsEwktLogicalFunction(LogicalFunction wkt, + LogicalFunction arg0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/GeoAsGeojsonLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeoAsGeojsonLogicalFunction.hpp index c0bd991cf0..813fd9afb9 100644 --- a/nes-logical-operators/include/Functions/Meos/GeoAsGeojsonLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/GeoAsGeojsonLogicalFunction.hpp @@ -22,13 +22,19 @@ namespace NES { /** - * @brief Serializes a geometry to a GeoJSON string with given option and precision. + * @brief Geometry as GeoJSON + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `geo_as_geojson(temp, (int)arg0, (int)arg1, nullptr)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class GeoAsGeojsonLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "GeoAsGeojson"; - GeoAsGeojsonLogicalFunction(LogicalFunction wkt, LogicalFunction option, LogicalFunction precision); + GeoAsGeojsonLogicalFunction(LogicalFunction wkt, + LogicalFunction arg0, + LogicalFunction arg1); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/GeoEqualsLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeoEqualsLogicalFunction.hpp index abe64d136c..70accaacc7 100644 --- a/nes-logical-operators/include/Functions/Meos/GeoEqualsLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/GeoEqualsLogicalFunction.hpp @@ -22,15 +22,18 @@ namespace NES { /** - * @brief Returns 1.0 if two planar geometries are spatially equal. + * @brief Geometry equals * - * Args: (wkt1:VARCHAR, wkt2:VARCHAR) -> FLOAT64. + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `geom_equals`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class GeoEqualsLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "GeoEquals"; - GeoEqualsLogicalFunction(LogicalFunction wkt1, LogicalFunction wkt2); + GeoEqualsLogicalFunction(LogicalFunction wkt, + LogicalFunction arg0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/GeoGeoNLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeoGeoNLogicalFunction.hpp index aba38ae724..08139e2bfb 100644 --- a/nes-logical-operators/include/Functions/Meos/GeoGeoNLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/GeoGeoNLogicalFunction.hpp @@ -22,13 +22,18 @@ namespace NES { /** - * @brief Returns the nth component geometry from a geometry collection as WKT. + * @brief Nth geometry in collection + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `geo_geo_n(temp, (int)arg0)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class GeoGeoNLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "GeoGeoN"; - GeoGeoNLogicalFunction(LogicalFunction wkt, LogicalFunction n); + GeoGeoNLogicalFunction(LogicalFunction wkt, + LogicalFunction arg0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/GeoIsUnitaryLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeoIsUnitaryLogicalFunction.hpp index f59d45cc61..ec91c885cc 100644 --- a/nes-logical-operators/include/Functions/Meos/GeoIsUnitaryLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/GeoIsUnitaryLogicalFunction.hpp @@ -22,15 +22,17 @@ namespace NES { /** - * @brief Returns 1.0 if the geometry is a single geometry (not a collection). + * @brief Is geometry unitary * - * Args: (wkt:VARCHAR) -> FLOAT64. + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `geo_is_unitary`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class GeoIsUnitaryLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "GeoIsUnitary"; - explicit GeoIsUnitaryLogicalFunction(LogicalFunction wkt); + GeoIsUnitaryLogicalFunction(LogicalFunction wkt); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/GeoNumGeosLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeoNumGeosLogicalFunction.hpp index d6845bc10b..602142e08b 100644 --- a/nes-logical-operators/include/Functions/Meos/GeoNumGeosLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/GeoNumGeosLogicalFunction.hpp @@ -22,15 +22,17 @@ namespace NES { /** - * @brief Returns the number of sub-geometries in a geometry collection. + * @brief Count geometry components * - * Args: (wkt:VARCHAR) -> FLOAT64. + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `geo_num_geos`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class GeoNumGeosLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "GeoNumGeos"; - explicit GeoNumGeosLogicalFunction(LogicalFunction wkt); + GeoNumGeosLogicalFunction(LogicalFunction wkt); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/GeoNumPointsLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeoNumPointsLogicalFunction.hpp index 198b5f3dae..4000821c02 100644 --- a/nes-logical-operators/include/Functions/Meos/GeoNumPointsLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/GeoNumPointsLogicalFunction.hpp @@ -22,15 +22,17 @@ namespace NES { /** - * @brief Returns the number of points in a geometry. + * @brief Count geometry points * - * Args: (wkt:VARCHAR) -> FLOAT64. + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `geo_num_points`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class GeoNumPointsLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "GeoNumPoints"; - explicit GeoNumPointsLogicalFunction(LogicalFunction wkt); + GeoNumPointsLogicalFunction(LogicalFunction wkt); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/GeoPointsLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeoPointsLogicalFunction.hpp index 445a9384d8..4636df0598 100644 --- a/nes-logical-operators/include/Functions/Meos/GeoPointsLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/GeoPointsLogicalFunction.hpp @@ -22,7 +22,11 @@ namespace NES { /** - * @brief Returns a multi-point geometry of all vertices as WKT. + * @brief Geometry geo points + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `geo_points`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class GeoPointsLogicalFunction : public LogicalFunctionConcept { public: diff --git a/nes-logical-operators/include/Functions/Meos/GeoReverseLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeoReverseLogicalFunction.hpp index 637e401c3d..aeb15e5819 100644 --- a/nes-logical-operators/include/Functions/Meos/GeoReverseLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/GeoReverseLogicalFunction.hpp @@ -22,7 +22,11 @@ namespace NES { /** - * @brief Returns the geometry with vertex order reversed as WKT. + * @brief Geometry geo reverse + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `geo_reverse`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class GeoReverseLogicalFunction : public LogicalFunctionConcept { public: diff --git a/nes-logical-operators/include/Functions/Meos/GeoRoundLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeoRoundLogicalFunction.hpp index 978675183c..14a889cf76 100644 --- a/nes-logical-operators/include/Functions/Meos/GeoRoundLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/GeoRoundLogicalFunction.hpp @@ -22,13 +22,18 @@ namespace NES { /** - * @brief Returns a geometry with coordinates rounded to maxdd decimal digits, as WKT. + * @brief Round geometry coordinates + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `geo_round(temp, (int)dec)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class GeoRoundLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "GeoRound"; - GeoRoundLogicalFunction(LogicalFunction wkt, LogicalFunction maxdd); + GeoRoundLogicalFunction(LogicalFunction wkt, + LogicalFunction arg0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/GeoSameLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeoSameLogicalFunction.hpp index 277b6790a1..43c0885d56 100644 --- a/nes-logical-operators/include/Functions/Meos/GeoSameLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/GeoSameLogicalFunction.hpp @@ -22,15 +22,18 @@ namespace NES { /** - * @brief Returns 1.0 if two planar geometries are the same (identical coordinates). + * @brief Geometry same * - * Args: (wkt1:VARCHAR, wkt2:VARCHAR) -> FLOAT64. + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `geo_same`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class GeoSameLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "GeoSame"; - GeoSameLogicalFunction(LogicalFunction wkt1, LogicalFunction wkt2); + GeoSameLogicalFunction(LogicalFunction wkt, + LogicalFunction arg0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/GeoSetSridLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeoSetSridLogicalFunction.hpp index cc8f75fd1d..60d2f600e0 100644 --- a/nes-logical-operators/include/Functions/Meos/GeoSetSridLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/GeoSetSridLogicalFunction.hpp @@ -22,13 +22,18 @@ namespace NES { /** - * @brief Returns a geometry with a new SRID assigned, as WKT. + * @brief Set geometry SRID + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `geo_set_srid(temp, (int32_t)srid)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class GeoSetSridLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "GeoSetSrid"; - GeoSetSridLogicalFunction(LogicalFunction wkt, LogicalFunction srid); + GeoSetSridLogicalFunction(LogicalFunction wkt, + LogicalFunction arg0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/GeoSridLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeoSridLogicalFunction.hpp index 7d539b2d64..40a3cfc22e 100644 --- a/nes-logical-operators/include/Functions/Meos/GeoSridLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/GeoSridLogicalFunction.hpp @@ -22,15 +22,17 @@ namespace NES { /** - * @brief Returns the SRID of a geometry. + * @brief Get geometry SRID * - * Args: (wkt:VARCHAR) -> FLOAT64. + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `geo_srid`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class GeoSridLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "GeoSrid"; - explicit GeoSridLogicalFunction(LogicalFunction wkt); + GeoSridLogicalFunction(LogicalFunction wkt); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/GeoTransformLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeoTransformLogicalFunction.hpp index 11fc951f89..714784ca69 100644 --- a/nes-logical-operators/include/Functions/Meos/GeoTransformLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/GeoTransformLogicalFunction.hpp @@ -22,13 +22,18 @@ namespace NES { /** - * @brief Returns a geometry reprojected to the target SRID, as WKT. + * @brief Transform geometry SRID + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `geo_transform(temp, (int32_t)srid)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class GeoTransformLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "GeoTransform"; - GeoTransformLogicalFunction(LogicalFunction wkt, LogicalFunction srid_to); + GeoTransformLogicalFunction(LogicalFunction wkt, + LogicalFunction arg0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/GeogAreaLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeogAreaLogicalFunction.hpp index 86ec6bfcca..34846d23f3 100644 --- a/nes-logical-operators/include/Functions/Meos/GeogAreaLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/GeogAreaLogicalFunction.hpp @@ -22,13 +22,17 @@ namespace NES { /** - * @brief Geographic area (spheroid=true) of the geometry: (wkt:VARCHAR) -> float64. + * @brief geog area + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `geog_area`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class GeogAreaLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "GeogArea"; - explicit GeogAreaLogicalFunction(LogicalFunction wkt1); + GeogAreaLogicalFunction(LogicalFunction wkt); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/GeogCentroidLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeogCentroidLogicalFunction.hpp index 535f5feebf..dbcbd99b8d 100644 --- a/nes-logical-operators/include/Functions/Meos/GeogCentroidLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/GeogCentroidLogicalFunction.hpp @@ -22,13 +22,18 @@ namespace NES { /** - * @brief Returns the centroid of a geography (use_spheroid=1 for spheroid, 0 for sphere) as WKT. + * @brief Geography centroid + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `geog_centroid(temp, (bool)arg0)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class GeogCentroidLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "GeogCentroid"; - GeogCentroidLogicalFunction(LogicalFunction wkt, LogicalFunction use_spheroid); + GeogCentroidLogicalFunction(LogicalFunction wkt, + LogicalFunction arg0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/GeogDistanceLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeogDistanceLogicalFunction.hpp index f9868257b3..3bca90b76e 100644 --- a/nes-logical-operators/include/Functions/Meos/GeogDistanceLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/GeogDistanceLogicalFunction.hpp @@ -22,15 +22,18 @@ namespace NES { /** - * @brief Returns the spheroidal distance between two geographic geometries in metres. + * @brief Geography distance * - * Args: (wkt1:VARCHAR, wkt2:VARCHAR) -> FLOAT64. + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `geog_distance`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class GeogDistanceLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "GeogDistance"; - GeogDistanceLogicalFunction(LogicalFunction wkt1, LogicalFunction wkt2); + GeogDistanceLogicalFunction(LogicalFunction wkt, + LogicalFunction arg0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/GeogDwithinLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeogDwithinLogicalFunction.hpp index bffb16c5f6..b93b74a894 100644 --- a/nes-logical-operators/include/Functions/Meos/GeogDwithinLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/GeogDwithinLogicalFunction.hpp @@ -22,15 +22,19 @@ namespace NES { /** - * @brief Returns 1.0 if two geographic geometries are within tolerance distance (spheroidal). + * @brief geog_dwithin with distance * - * Args: (wkt1:VARCHAR, wkt2:VARCHAR, tolerance:FLOAT64) -> FLOAT64. + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `geog_dwithin`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class GeogDwithinLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "GeogDwithin"; - GeogDwithinLogicalFunction(LogicalFunction wkt1, LogicalFunction wkt2, LogicalFunction tolerance); + GeogDwithinLogicalFunction(LogicalFunction wkt, + LogicalFunction arg0, + LogicalFunction arg1); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/GeogIntersectsLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeogIntersectsLogicalFunction.hpp index 6be3f835fd..343ba18a90 100644 --- a/nes-logical-operators/include/Functions/Meos/GeogIntersectsLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/GeogIntersectsLogicalFunction.hpp @@ -22,15 +22,18 @@ namespace NES { /** - * @brief Returns 1.0 if two geographic geometries intersect (spheroidal). + * @brief Geography intersects * - * Args: (wkt1:VARCHAR, wkt2:VARCHAR) -> FLOAT64. + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `geog_intersects`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class GeogIntersectsLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "GeogIntersects"; - GeogIntersectsLogicalFunction(LogicalFunction wkt1, LogicalFunction wkt2); + GeogIntersectsLogicalFunction(LogicalFunction wkt, + LogicalFunction arg0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/GeogLengthLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeogLengthLogicalFunction.hpp index fc6b2daee4..149a2b89db 100644 --- a/nes-logical-operators/include/Functions/Meos/GeogLengthLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/GeogLengthLogicalFunction.hpp @@ -22,13 +22,17 @@ namespace NES { /** - * @brief Geographic length (spheroid=true) of the geometry: (wkt:VARCHAR) -> float64. + * @brief geog length + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `geog_length`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class GeogLengthLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "GeogLength"; - explicit GeogLengthLogicalFunction(LogicalFunction wkt1); + GeogLengthLogicalFunction(LogicalFunction wkt); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/GeogPerimeterLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeogPerimeterLogicalFunction.hpp index d4a77d61cd..06287b06f6 100644 --- a/nes-logical-operators/include/Functions/Meos/GeogPerimeterLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/GeogPerimeterLogicalFunction.hpp @@ -22,13 +22,17 @@ namespace NES { /** - * @brief Geographic perimeter (spheroid=true) of the geometry: (wkt:VARCHAR) -> float64. + * @brief geog perimeter + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `geog_perimeter`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class GeogPerimeterLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "GeogPerimeter"; - explicit GeogPerimeterLogicalFunction(LogicalFunction wkt1); + GeogPerimeterLogicalFunction(LogicalFunction wkt); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/GeogPointMake2dLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeogPointMake2dLogicalFunction.hpp index d5a5932c88..3638f28364 100644 --- a/nes-logical-operators/include/Functions/Meos/GeogPointMake2dLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/GeogPointMake2dLogicalFunction.hpp @@ -22,13 +22,19 @@ namespace NES { /** - * @brief Constructs a 2D geography point from SRID, x, and y as WKT. + * @brief Make 2D geography point + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `geogpoint_make2d((int32_t)srid, x, y)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class GeogPointMake2dLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "GeogPointMake2d"; - GeogPointMake2dLogicalFunction(LogicalFunction srid, LogicalFunction x, LogicalFunction y); + GeogPointMake2dLogicalFunction(LogicalFunction srid, + LogicalFunction x, + LogicalFunction y); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/GeogPointMake3dzLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeogPointMake3dzLogicalFunction.hpp index b3f4f1e9bb..6401d04286 100644 --- a/nes-logical-operators/include/Functions/Meos/GeogPointMake3dzLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/GeogPointMake3dzLogicalFunction.hpp @@ -22,13 +22,20 @@ namespace NES { /** - * @brief Constructs a 3DZ geography point from SRID, x, y, and z as WKT. + * @brief Make 3D geography point + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `geogpoint_make3dz((int32_t)srid, x, y, z)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class GeogPointMake3dzLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "GeogPointMake3dz"; - GeogPointMake3dzLogicalFunction(LogicalFunction srid, LogicalFunction x, LogicalFunction y, LogicalFunction z); + GeogPointMake3dzLogicalFunction(LogicalFunction srid, + LogicalFunction x, + LogicalFunction y, + LogicalFunction z); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/GeogToGeomLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeogToGeomLogicalFunction.hpp index 7b476ff5a1..a4aa4d4694 100644 --- a/nes-logical-operators/include/Functions/Meos/GeogToGeomLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/GeogToGeomLogicalFunction.hpp @@ -22,7 +22,11 @@ namespace NES { /** - * @brief Converts a geography to a geometry as WKT. + * @brief geog to geom + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `geog_to_geom`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class GeogToGeomLogicalFunction : public LogicalFunctionConcept { public: diff --git a/nes-logical-operators/include/Functions/Meos/GeomAzimuthLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeomAzimuthLogicalFunction.hpp index bf5f526490..899697361b 100644 --- a/nes-logical-operators/include/Functions/Meos/GeomAzimuthLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/GeomAzimuthLogicalFunction.hpp @@ -22,17 +22,17 @@ namespace NES { /** - * @brief Static geometry azimuth geom_azimuth: (wkt1:VARCHAR, wkt2:VARCHAR) -> float64 (radians). + * @brief Geometry azimuth (single point) * - * Generated from the MEOS function `geom_azimuth`. - * Returns the azimuth angle from the first point to the second, in radians; - * returns 0.0 when the azimuth is undefined (identical points). + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `geom_azimuth`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class GeomAzimuthLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "GeomAzimuth"; - GeomAzimuthLogicalFunction(LogicalFunction wkt1, LogicalFunction wkt2); + GeomAzimuthLogicalFunction(LogicalFunction wkt); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/GeomBoundaryLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeomBoundaryLogicalFunction.hpp index bc7a730b1a..07ad30c864 100644 --- a/nes-logical-operators/include/Functions/Meos/GeomBoundaryLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/GeomBoundaryLogicalFunction.hpp @@ -22,7 +22,11 @@ namespace NES { /** - * @brief Returns the boundary of a geometry as WKT. + * @brief Geometry geom boundary + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `geom_boundary`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class GeomBoundaryLogicalFunction : public LogicalFunctionConcept { public: diff --git a/nes-logical-operators/include/Functions/Meos/GeomCentroidLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeomCentroidLogicalFunction.hpp index d79f0a2beb..630cf9cb75 100644 --- a/nes-logical-operators/include/Functions/Meos/GeomCentroidLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/GeomCentroidLogicalFunction.hpp @@ -22,7 +22,11 @@ namespace NES { /** - * @brief Returns the centroid of a geometry as WKT. + * @brief Geometry geom centroid + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `geom_centroid`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class GeomCentroidLogicalFunction : public LogicalFunctionConcept { public: diff --git a/nes-logical-operators/include/Functions/Meos/GeomContainsLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeomContainsLogicalFunction.hpp index 01a4f5f17b..c46c05282e 100644 --- a/nes-logical-operators/include/Functions/Meos/GeomContainsLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/GeomContainsLogicalFunction.hpp @@ -22,16 +22,18 @@ namespace NES { /** - * @brief Static geometry predicate geom_contains: (wkt1:VARCHAR, wkt2:VARCHAR) -> float64 (0/1). + * @brief Geometry contains * * Generated by tools/codegen/codegen_nebula.py from the MEOS function - * `geom_contains`. Operates on plain WKT strings without a temporal dimension. + * `geom_contains`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class GeomContainsLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "GeomContains"; - GeomContainsLogicalFunction(LogicalFunction wkt1, LogicalFunction wkt2); + GeomContainsLogicalFunction(LogicalFunction wkt, + LogicalFunction arg0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/GeomConvexHullLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeomConvexHullLogicalFunction.hpp index cf854b2267..b55e77ddd3 100644 --- a/nes-logical-operators/include/Functions/Meos/GeomConvexHullLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/GeomConvexHullLogicalFunction.hpp @@ -22,7 +22,11 @@ namespace NES { /** - * @brief Returns the convex hull of a geometry as WKT. + * @brief Geometry geom convex hull + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `geom_convex_hull`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class GeomConvexHullLogicalFunction : public LogicalFunctionConcept { public: diff --git a/nes-logical-operators/include/Functions/Meos/GeomCoversLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeomCoversLogicalFunction.hpp index 5b41e8b2ce..1cfa200cf2 100644 --- a/nes-logical-operators/include/Functions/Meos/GeomCoversLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/GeomCoversLogicalFunction.hpp @@ -22,15 +22,18 @@ namespace NES { /** - * @brief Static geometry function geom_covers: (wkt1:VARCHAR, wkt2:VARCHAR) -> float64 (0/1). + * @brief Geometry covers * - * Generated by tools/codegen/codegen_nebula.py from the MEOS function `geom_covers`. + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `geom_covers`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class GeomCoversLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "GeomCovers"; - GeomCoversLogicalFunction(LogicalFunction wkt1, LogicalFunction wkt2); + GeomCoversLogicalFunction(LogicalFunction wkt, + LogicalFunction arg0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/GeomDifference2dLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeomDifference2dLogicalFunction.hpp index 49f8582d56..cff048a237 100644 --- a/nes-logical-operators/include/Functions/Meos/GeomDifference2dLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/GeomDifference2dLogicalFunction.hpp @@ -22,13 +22,18 @@ namespace NES { /** - * @brief Returns the geometric difference of two geometries as WKT. + * @brief geom_difference2d + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `geom_difference2d`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class GeomDifference2dLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "GeomDifference2d"; - GeomDifference2dLogicalFunction(LogicalFunction wkt1, LogicalFunction wkt2); + GeomDifference2dLogicalFunction(LogicalFunction wkt, + LogicalFunction arg0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/GeomDisjoint2dLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeomDisjoint2dLogicalFunction.hpp index 972e387900..fb7538e47e 100644 --- a/nes-logical-operators/include/Functions/Meos/GeomDisjoint2dLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/GeomDisjoint2dLogicalFunction.hpp @@ -22,16 +22,18 @@ namespace NES { /** - * @brief Static geometry predicate geom_disjoint2d: (wkt1:VARCHAR, wkt2:VARCHAR) -> float64 (0/1). + * @brief Geometry disjoint 2D * * Generated by tools/codegen/codegen_nebula.py from the MEOS function - * `geom_disjoint2d`. Operates on plain WKT strings without a temporal dimension. + * `geom_disjoint2d`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class GeomDisjoint2dLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "GeomDisjoint2d"; - GeomDisjoint2dLogicalFunction(LogicalFunction wkt1, LogicalFunction wkt2); + GeomDisjoint2dLogicalFunction(LogicalFunction wkt, + LogicalFunction arg0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/GeomDistance2dLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeomDistance2dLogicalFunction.hpp index ff67003139..8a840a4f0d 100644 --- a/nes-logical-operators/include/Functions/Meos/GeomDistance2dLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/GeomDistance2dLogicalFunction.hpp @@ -22,15 +22,18 @@ namespace NES { /** - * @brief Static geometry function geom_distance2d: (wkt1:VARCHAR, wkt2:VARCHAR) -> float64 distance. + * @brief Geometry 2D distance * - * Generated by tools/codegen/codegen_nebula.py from the MEOS function `geom_distance2d`. + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `geom_distance2d`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class GeomDistance2dLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "GeomDistance2d"; - GeomDistance2dLogicalFunction(LogicalFunction wkt1, LogicalFunction wkt2); + GeomDistance2dLogicalFunction(LogicalFunction wkt, + LogicalFunction arg0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/GeomDistance3dLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeomDistance3dLogicalFunction.hpp index b752f82131..d911358b90 100644 --- a/nes-logical-operators/include/Functions/Meos/GeomDistance3dLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/GeomDistance3dLogicalFunction.hpp @@ -22,15 +22,18 @@ namespace NES { /** - * @brief Static geometry function geom_distance3d: (wkt1:VARCHAR, wkt2:VARCHAR) -> float64 distance. + * @brief Geometry 3D distance * - * Generated by tools/codegen/codegen_nebula.py from the MEOS function `geom_distance3d`. + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `geom_distance3d`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class GeomDistance3dLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "GeomDistance3d"; - GeomDistance3dLogicalFunction(LogicalFunction wkt1, LogicalFunction wkt2); + GeomDistance3dLogicalFunction(LogicalFunction wkt, + LogicalFunction arg0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/GeomDwithin2dLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeomDwithin2dLogicalFunction.hpp index c0f16054c4..4520cdaf07 100644 --- a/nes-logical-operators/include/Functions/Meos/GeomDwithin2dLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/GeomDwithin2dLogicalFunction.hpp @@ -22,16 +22,19 @@ namespace NES { /** - * @brief Static geometry predicate geom_dwithin2d: (wkt1:VARCHAR, wkt2:VARCHAR, dist:FLOAT64) -> float64 (0/1). + * @brief geom_dwithin2d with distance * * Generated by tools/codegen/codegen_nebula.py from the MEOS function - * `geom_dwithin2d`. Operates on plain WKT strings without a temporal dimension. + * `geom_dwithin2d`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class GeomDwithin2dLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "GeomDwithin2d"; - GeomDwithin2dLogicalFunction(LogicalFunction wkt1, LogicalFunction wkt2, LogicalFunction dist); + GeomDwithin2dLogicalFunction(LogicalFunction wkt, + LogicalFunction arg0, + LogicalFunction arg1); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/GeomDwithin3dLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeomDwithin3dLogicalFunction.hpp index f135afa6e6..1d76d6621f 100644 --- a/nes-logical-operators/include/Functions/Meos/GeomDwithin3dLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/GeomDwithin3dLogicalFunction.hpp @@ -22,15 +22,19 @@ namespace NES { /** - * @brief Static geometry function geom_dwithin3d: (wkt1:VARCHAR, wkt2:VARCHAR, dist:FLOAT64) -> float64 (0/1). + * @brief geom_dwithin3d with distance * - * Generated by tools/codegen/codegen_nebula.py from the MEOS function `geom_dwithin3d`. + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `geom_dwithin3d`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class GeomDwithin3dLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "GeomDwithin3d"; - GeomDwithin3dLogicalFunction(LogicalFunction wkt1, LogicalFunction wkt2, LogicalFunction dist); + GeomDwithin3dLogicalFunction(LogicalFunction wkt, + LogicalFunction arg0, + LogicalFunction arg1); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/GeomDwithinLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeomDwithinLogicalFunction.hpp index b80ca3ebfe..961eadeca9 100644 --- a/nes-logical-operators/include/Functions/Meos/GeomDwithinLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/GeomDwithinLogicalFunction.hpp @@ -22,15 +22,19 @@ namespace NES { /** - * @brief Returns 1.0 if two planar geometries are within tolerance distance (default planar). + * @brief geom_dwithin with distance * - * Args: (wkt1:VARCHAR, wkt2:VARCHAR, tolerance:FLOAT64) -> FLOAT64. + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `geom_dwithin`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class GeomDwithinLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "GeomDwithin"; - GeomDwithinLogicalFunction(LogicalFunction wkt1, LogicalFunction wkt2, LogicalFunction tolerance); + GeomDwithinLogicalFunction(LogicalFunction wkt, + LogicalFunction arg0, + LogicalFunction arg1); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/GeomIntersection2dCollLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeomIntersection2dCollLogicalFunction.hpp index e7dfc55e8a..1cbb7bc219 100644 --- a/nes-logical-operators/include/Functions/Meos/GeomIntersection2dCollLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/GeomIntersection2dCollLogicalFunction.hpp @@ -22,13 +22,18 @@ namespace NES { /** - * @brief Returns the collection-typed 2D intersection of two geometries as WKT. + * @brief geom_intersection2d_coll + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `geom_intersection2d_coll`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class GeomIntersection2dCollLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "GeomIntersection2dColl"; - GeomIntersection2dCollLogicalFunction(LogicalFunction wkt1, LogicalFunction wkt2); + GeomIntersection2dCollLogicalFunction(LogicalFunction wkt, + LogicalFunction arg0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/GeomIntersection2dLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeomIntersection2dLogicalFunction.hpp index 90e577a923..4a7aee2a4e 100644 --- a/nes-logical-operators/include/Functions/Meos/GeomIntersection2dLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/GeomIntersection2dLogicalFunction.hpp @@ -22,13 +22,18 @@ namespace NES { /** - * @brief Returns the geometric intersection of two geometries as WKT. + * @brief geom_intersection2d + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `geom_intersection2d`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class GeomIntersection2dLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "GeomIntersection2d"; - GeomIntersection2dLogicalFunction(LogicalFunction wkt1, LogicalFunction wkt2); + GeomIntersection2dLogicalFunction(LogicalFunction wkt, + LogicalFunction arg0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/GeomIntersects2dLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeomIntersects2dLogicalFunction.hpp index 30df4ef297..4d721c4ead 100644 --- a/nes-logical-operators/include/Functions/Meos/GeomIntersects2dLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/GeomIntersects2dLogicalFunction.hpp @@ -22,16 +22,18 @@ namespace NES { /** - * @brief Static geometry predicate geom_intersects2d: (wkt1:VARCHAR, wkt2:VARCHAR) -> float64 (0/1). + * @brief Geometry intersects 2D * * Generated by tools/codegen/codegen_nebula.py from the MEOS function - * `geom_intersects2d`. Operates on plain WKT strings without a temporal dimension. + * `geom_intersects2d`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class GeomIntersects2dLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "GeomIntersects2d"; - GeomIntersects2dLogicalFunction(LogicalFunction wkt1, LogicalFunction wkt2); + GeomIntersects2dLogicalFunction(LogicalFunction wkt, + LogicalFunction arg0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/GeomIntersects3dLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeomIntersects3dLogicalFunction.hpp index 9d80a0c50a..747b5cfbc0 100644 --- a/nes-logical-operators/include/Functions/Meos/GeomIntersects3dLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/GeomIntersects3dLogicalFunction.hpp @@ -22,15 +22,18 @@ namespace NES { /** - * @brief Static geometry function geom_intersects3d: (wkt1:VARCHAR, wkt2:VARCHAR) -> float64 (0/1). + * @brief Geometry intersects 3D * - * Generated by tools/codegen/codegen_nebula.py from the MEOS function `geom_intersects3d`. + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `geom_intersects3d`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class GeomIntersects3dLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "GeomIntersects3d"; - GeomIntersects3dLogicalFunction(LogicalFunction wkt1, LogicalFunction wkt2); + GeomIntersects3dLogicalFunction(LogicalFunction wkt, + LogicalFunction arg0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/GeomIntersectsLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeomIntersectsLogicalFunction.hpp index 807ff15884..5509359d5a 100644 --- a/nes-logical-operators/include/Functions/Meos/GeomIntersectsLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/GeomIntersectsLogicalFunction.hpp @@ -22,15 +22,18 @@ namespace NES { /** - * @brief Returns 1.0 if two planar geometries intersect (default planar, no dimension suffix). + * @brief Geometry intersects * - * Args: (wkt1:VARCHAR, wkt2:VARCHAR) -> FLOAT64. + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `geom_intersects`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class GeomIntersectsLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "GeomIntersects"; - GeomIntersectsLogicalFunction(LogicalFunction wkt1, LogicalFunction wkt2); + GeomIntersectsLogicalFunction(LogicalFunction wkt, + LogicalFunction arg0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/GeomIsEmptyLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeomIsEmptyLogicalFunction.hpp index 04bd90a2b3..f2b26a3118 100644 --- a/nes-logical-operators/include/Functions/Meos/GeomIsEmptyLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/GeomIsEmptyLogicalFunction.hpp @@ -22,13 +22,17 @@ namespace NES { /** - * @brief Returns 1.0 if the geometry is empty, 0.0 otherwise: (wkt:VARCHAR) -> float64. + * @brief Is geometry empty + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `geom_is_empty`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class GeomIsEmptyLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "GeomIsEmpty"; - explicit GeomIsEmptyLogicalFunction(LogicalFunction wkt1); + GeomIsEmptyLogicalFunction(LogicalFunction wkt); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/GeomLengthLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeomLengthLogicalFunction.hpp index 5de9ddc37b..e4ed77bb97 100644 --- a/nes-logical-operators/include/Functions/Meos/GeomLengthLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/GeomLengthLogicalFunction.hpp @@ -22,16 +22,17 @@ namespace NES { /** - * @brief Static geometry scalar geom_length: (wkt1:VARCHAR) -> float64. + * @brief Geometry length * - * Generated from the MEOS function `geom_length`. - * Operates on plain WKT strings without a temporal dimension. + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `geom_length`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class GeomLengthLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "GeomLength"; - explicit GeomLengthLogicalFunction(LogicalFunction wkt1); + GeomLengthLogicalFunction(LogicalFunction wkt); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/GeomPerimeterLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeomPerimeterLogicalFunction.hpp index a9b82a52a0..d42b40f28d 100644 --- a/nes-logical-operators/include/Functions/Meos/GeomPerimeterLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/GeomPerimeterLogicalFunction.hpp @@ -22,16 +22,17 @@ namespace NES { /** - * @brief Static geometry scalar geom_perimeter: (wkt1:VARCHAR) -> float64. + * @brief Geometry perimeter * - * Generated from the MEOS function `geom_perimeter`. - * Operates on plain WKT strings without a temporal dimension. + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `geom_perimeter`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class GeomPerimeterLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "GeomPerimeter"; - explicit GeomPerimeterLogicalFunction(LogicalFunction wkt1); + GeomPerimeterLogicalFunction(LogicalFunction wkt); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/GeomPointMake2dLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeomPointMake2dLogicalFunction.hpp index cea1afe7e1..1a1be2f5ed 100644 --- a/nes-logical-operators/include/Functions/Meos/GeomPointMake2dLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/GeomPointMake2dLogicalFunction.hpp @@ -22,13 +22,19 @@ namespace NES { /** - * @brief Constructs a 2D geometry point from SRID, x, and y as WKT. + * @brief Make 2D geometry point + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `geompoint_make2d((int32_t)srid, x, y)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class GeomPointMake2dLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "GeomPointMake2d"; - GeomPointMake2dLogicalFunction(LogicalFunction srid, LogicalFunction x, LogicalFunction y); + GeomPointMake2dLogicalFunction(LogicalFunction srid, + LogicalFunction x, + LogicalFunction y); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/GeomPointMake3dzLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeomPointMake3dzLogicalFunction.hpp index 1415b13d98..df1cffcb09 100644 --- a/nes-logical-operators/include/Functions/Meos/GeomPointMake3dzLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/GeomPointMake3dzLogicalFunction.hpp @@ -22,13 +22,20 @@ namespace NES { /** - * @brief Constructs a 3DZ geometry point from SRID, x, y, and z as WKT. + * @brief Make 3D geometry point + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `geompoint_make3dz((int32_t)srid, x, y, z)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class GeomPointMake3dzLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "GeomPointMake3dz"; - GeomPointMake3dzLogicalFunction(LogicalFunction srid, LogicalFunction x, LogicalFunction y, LogicalFunction z); + GeomPointMake3dzLogicalFunction(LogicalFunction srid, + LogicalFunction x, + LogicalFunction y, + LogicalFunction z); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/GeomShortestline2dLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeomShortestline2dLogicalFunction.hpp index 8c8e93a69b..785cc40655 100644 --- a/nes-logical-operators/include/Functions/Meos/GeomShortestline2dLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/GeomShortestline2dLogicalFunction.hpp @@ -22,13 +22,18 @@ namespace NES { /** - * @brief Returns the shortest 2D line between two geometries as WKT. + * @brief geom_shortestline2d + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `geom_shortestline2d`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class GeomShortestline2dLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "GeomShortestline2d"; - GeomShortestline2dLogicalFunction(LogicalFunction wkt1, LogicalFunction wkt2); + GeomShortestline2dLogicalFunction(LogicalFunction wkt, + LogicalFunction arg0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/GeomShortestline3dLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeomShortestline3dLogicalFunction.hpp index 8501c2783f..6186721263 100644 --- a/nes-logical-operators/include/Functions/Meos/GeomShortestline3dLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/GeomShortestline3dLogicalFunction.hpp @@ -22,13 +22,18 @@ namespace NES { /** - * @brief Returns the shortest 3D line between two geometries as WKT. + * @brief geom_shortestline3d + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `geom_shortestline3d`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class GeomShortestline3dLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "GeomShortestline3d"; - GeomShortestline3dLogicalFunction(LogicalFunction wkt1, LogicalFunction wkt2); + GeomShortestline3dLogicalFunction(LogicalFunction wkt, + LogicalFunction arg0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/GeomToGeogLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeomToGeogLogicalFunction.hpp index f9cef59303..d80183f1af 100644 --- a/nes-logical-operators/include/Functions/Meos/GeomToGeogLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/GeomToGeogLogicalFunction.hpp @@ -22,7 +22,11 @@ namespace NES { /** - * @brief Converts a geometry to a geography as WKT. + * @brief geom to geog + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `geom_to_geog`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class GeomToGeogLogicalFunction : public LogicalFunctionConcept { public: diff --git a/nes-logical-operators/include/Functions/Meos/GeomTouchesLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeomTouchesLogicalFunction.hpp index a146d450c5..a6355492d9 100644 --- a/nes-logical-operators/include/Functions/Meos/GeomTouchesLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/GeomTouchesLogicalFunction.hpp @@ -22,15 +22,18 @@ namespace NES { /** - * @brief Static geometry function geom_touches: (wkt1:VARCHAR, wkt2:VARCHAR) -> float64 (0/1). + * @brief Geometry touches * - * Generated by tools/codegen/codegen_nebula.py from the MEOS function `geom_touches`. + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `geom_touches`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class GeomTouchesLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "GeomTouches"; - GeomTouchesLogicalFunction(LogicalFunction wkt1, LogicalFunction wkt2); + GeomTouchesLogicalFunction(LogicalFunction wkt, + LogicalFunction arg0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/GeomUnaryUnionLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/GeomUnaryUnionLogicalFunction.hpp index 3b8dfed730..3112c5b30b 100644 --- a/nes-logical-operators/include/Functions/Meos/GeomUnaryUnionLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/GeomUnaryUnionLogicalFunction.hpp @@ -22,7 +22,11 @@ namespace NES { /** - * @brief Returns the topological union of a geometry's components as WKT. + * @brief Geometry geom unary union + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `geom_unary_union`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class GeomUnaryUnionLogicalFunction : public LogicalFunctionConcept { public: diff --git a/nes-logical-operators/include/Functions/Meos/H3indexCmpLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/H3indexCmpLogicalFunction.hpp index 2e9785647c..a0d459f773 100644 --- a/nes-logical-operators/include/Functions/Meos/H3indexCmpLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/H3indexCmpLogicalFunction.hpp @@ -22,13 +22,18 @@ namespace NES { /** - * @brief Returns -1, 0, or 1 comparison result for two H3 cell indices. + * @brief H3Index comparison (cmp) + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `h3index_cmp((H3Index)a, (H3Index)b)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class H3indexCmpLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "H3indexCmp"; - H3indexCmpLogicalFunction(LogicalFunction a, LogicalFunction b); + H3indexCmpLogicalFunction(LogicalFunction a, + LogicalFunction b); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/H3indexEqLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/H3indexEqLogicalFunction.hpp index 9366a95735..fcaa3f28e4 100644 --- a/nes-logical-operators/include/Functions/Meos/H3indexEqLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/H3indexEqLogicalFunction.hpp @@ -22,13 +22,18 @@ namespace NES { /** - * @brief Tests equality of two H3 cell indices. + * @brief H3Index eq comparison + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `h3index_eq((H3Index)a, (H3Index)b)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class H3indexEqLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "H3indexEq"; - H3indexEqLogicalFunction(LogicalFunction a, LogicalFunction b); + H3indexEqLogicalFunction(LogicalFunction a, + LogicalFunction b); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/H3indexGeLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/H3indexGeLogicalFunction.hpp index 70ed53efbd..b888c9cdcb 100644 --- a/nes-logical-operators/include/Functions/Meos/H3indexGeLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/H3indexGeLogicalFunction.hpp @@ -22,13 +22,18 @@ namespace NES { /** - * @brief Tests if H3 cell index a is greater than or equal to b. + * @brief H3Index ge comparison + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `h3index_ge((H3Index)a, (H3Index)b)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class H3indexGeLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "H3indexGe"; - H3indexGeLogicalFunction(LogicalFunction a, LogicalFunction b); + H3indexGeLogicalFunction(LogicalFunction a, + LogicalFunction b); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/H3indexGtLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/H3indexGtLogicalFunction.hpp index cf4caadf39..2f9c5263f3 100644 --- a/nes-logical-operators/include/Functions/Meos/H3indexGtLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/H3indexGtLogicalFunction.hpp @@ -22,13 +22,18 @@ namespace NES { /** - * @brief Tests if H3 cell index a is greater than b. + * @brief H3Index gt comparison + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `h3index_gt((H3Index)a, (H3Index)b)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class H3indexGtLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "H3indexGt"; - H3indexGtLogicalFunction(LogicalFunction a, LogicalFunction b); + H3indexGtLogicalFunction(LogicalFunction a, + LogicalFunction b); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/H3indexLeLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/H3indexLeLogicalFunction.hpp index e39658ad3e..bea424d909 100644 --- a/nes-logical-operators/include/Functions/Meos/H3indexLeLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/H3indexLeLogicalFunction.hpp @@ -22,13 +22,18 @@ namespace NES { /** - * @brief Tests if H3 cell index a is less than or equal to b. + * @brief H3Index le comparison + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `h3index_le((H3Index)a, (H3Index)b)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class H3indexLeLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "H3indexLe"; - H3indexLeLogicalFunction(LogicalFunction a, LogicalFunction b); + H3indexLeLogicalFunction(LogicalFunction a, + LogicalFunction b); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/H3indexLtLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/H3indexLtLogicalFunction.hpp index 11faa7c622..e8d5b60283 100644 --- a/nes-logical-operators/include/Functions/Meos/H3indexLtLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/H3indexLtLogicalFunction.hpp @@ -22,13 +22,18 @@ namespace NES { /** - * @brief Tests if H3 cell index a is less than b. + * @brief H3Index lt comparison + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `h3index_lt((H3Index)a, (H3Index)b)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class H3indexLtLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "H3indexLt"; - H3indexLtLogicalFunction(LogicalFunction a, LogicalFunction b); + H3indexLtLogicalFunction(LogicalFunction a, + LogicalFunction b); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/H3indexNeLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/H3indexNeLogicalFunction.hpp index 3c60d6b995..554ff35ffd 100644 --- a/nes-logical-operators/include/Functions/Meos/H3indexNeLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/H3indexNeLogicalFunction.hpp @@ -22,13 +22,18 @@ namespace NES { /** - * @brief Tests inequality of two H3 cell indices. + * @brief H3Index ne comparison + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `h3index_ne((H3Index)a, (H3Index)b)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class H3indexNeLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "H3indexNe"; - H3indexNeLogicalFunction(LogicalFunction a, LogicalFunction b); + H3indexNeLogicalFunction(LogicalFunction a, + LogicalFunction b); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/H3indexOutLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/H3indexOutLogicalFunction.hpp index e568b69e10..356f679ee0 100644 --- a/nes-logical-operators/include/Functions/Meos/H3indexOutLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/H3indexOutLogicalFunction.hpp @@ -22,7 +22,11 @@ namespace NES { /** - * @brief Converts an H3Index cell ID (UINT64) to its hex string representation. + * @brief H3Index to hex string + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `h3index_out((H3Index)cell)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class H3indexOutLogicalFunction : public LogicalFunctionConcept { public: diff --git a/nes-logical-operators/include/Functions/Meos/IntspanLowerIncLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/IntspanLowerIncLogicalFunction.hpp index bc41350f67..1fb96a6f66 100644 --- a/nes-logical-operators/include/Functions/Meos/IntspanLowerIncLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/IntspanLowerIncLogicalFunction.hpp @@ -22,12 +22,18 @@ namespace NES { /** - * @brief Returns 1 if the lower bound of an integer span is inclusive, 0 otherwise. + * @brief Intspan lower_inc + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `span_lower_inc`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class IntspanLowerIncLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "IntspanLowerInc"; + IntspanLowerIncLogicalFunction(LogicalFunction sp); + DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; std::vector getChildren() const override; @@ -37,6 +43,7 @@ class IntspanLowerIncLogicalFunction : public LogicalFunctionConcept { std::string explain(ExplainVerbosity verbosity) const override; LogicalFunction withInferredDataType(const Schema& schema) const override; SerializableFunction serialize() const override; + private: DataType dataType; std::vector parameters; diff --git a/nes-logical-operators/include/Functions/Meos/IntspanLowerLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/IntspanLowerLogicalFunction.hpp index def87ac64c..242341c2b7 100644 --- a/nes-logical-operators/include/Functions/Meos/IntspanLowerLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/IntspanLowerLogicalFunction.hpp @@ -22,12 +22,18 @@ namespace NES { /** - * @brief Returns the lower bound of an integer span. + * @brief Intspan lower + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `intspan_lower`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class IntspanLowerLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "IntspanLower"; + IntspanLowerLogicalFunction(LogicalFunction sp); + DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; std::vector getChildren() const override; @@ -37,6 +43,7 @@ class IntspanLowerLogicalFunction : public LogicalFunctionConcept { std::string explain(ExplainVerbosity verbosity) const override; LogicalFunction withInferredDataType(const Schema& schema) const override; SerializableFunction serialize() const override; + private: DataType dataType; std::vector parameters; diff --git a/nes-logical-operators/include/Functions/Meos/IntspanUpperIncLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/IntspanUpperIncLogicalFunction.hpp index ef0ebfe0e3..3361711769 100644 --- a/nes-logical-operators/include/Functions/Meos/IntspanUpperIncLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/IntspanUpperIncLogicalFunction.hpp @@ -22,12 +22,18 @@ namespace NES { /** - * @brief Returns 1 if the upper bound of an integer span is inclusive, 0 otherwise. + * @brief Intspan upper_inc + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `span_upper_inc`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class IntspanUpperIncLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "IntspanUpperInc"; + IntspanUpperIncLogicalFunction(LogicalFunction sp); + DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; std::vector getChildren() const override; @@ -37,6 +43,7 @@ class IntspanUpperIncLogicalFunction : public LogicalFunctionConcept { std::string explain(ExplainVerbosity verbosity) const override; LogicalFunction withInferredDataType(const Schema& schema) const override; SerializableFunction serialize() const override; + private: DataType dataType; std::vector parameters; diff --git a/nes-logical-operators/include/Functions/Meos/IntspanUpperLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/IntspanUpperLogicalFunction.hpp index a790b2af87..fc6d064e79 100644 --- a/nes-logical-operators/include/Functions/Meos/IntspanUpperLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/IntspanUpperLogicalFunction.hpp @@ -22,12 +22,18 @@ namespace NES { /** - * @brief Returns the upper bound of an integer span. + * @brief Intspan upper + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `intspan_upper`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class IntspanUpperLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "IntspanUpper"; + IntspanUpperLogicalFunction(LogicalFunction sp); + DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; std::vector getChildren() const override; @@ -37,6 +43,7 @@ class IntspanUpperLogicalFunction : public LogicalFunctionConcept { std::string explain(ExplainVerbosity verbosity) const override; LogicalFunction withInferredDataType(const Schema& schema) const override; SerializableFunction serialize() const override; + private: DataType dataType; std::vector parameters; diff --git a/nes-logical-operators/include/Functions/Meos/IntspanWidthLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/IntspanWidthLogicalFunction.hpp index bcfcf07049..d28067889d 100644 --- a/nes-logical-operators/include/Functions/Meos/IntspanWidthLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/IntspanWidthLogicalFunction.hpp @@ -22,12 +22,18 @@ namespace NES { /** - * @brief Returns the width of an integer span. + * @brief Intspan width + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `intspan_width`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class IntspanWidthLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "IntspanWidth"; + IntspanWidthLogicalFunction(LogicalFunction sp); + DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; std::vector getChildren() const override; @@ -37,6 +43,7 @@ class IntspanWidthLogicalFunction : public LogicalFunctionConcept { std::string explain(ExplainVerbosity verbosity) const override; LogicalFunction withInferredDataType(const Schema& schema) const override; SerializableFunction serialize() const override; + private: DataType dataType; std::vector parameters; diff --git a/nes-logical-operators/include/Functions/Meos/JsonbArrayElementTextLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/JsonbArrayElementTextLogicalFunction.hpp index 698a1c749b..be1897f50c 100644 --- a/nes-logical-operators/include/Functions/Meos/JsonbArrayElementTextLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/JsonbArrayElementTextLogicalFunction.hpp @@ -22,12 +22,19 @@ namespace NES { /** - * @brief Returns the n-th element of a JSONB array as plain text. + * @brief Jsonb array element text + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `jsonb_array_element_text(temp, (int)idx_d)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class JsonbArrayElementTextLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "JsonbArrayElementText"; - JsonbArrayElementTextLogicalFunction(LogicalFunction jb, LogicalFunction idx); + + JsonbArrayElementTextLogicalFunction(LogicalFunction jb, + LogicalFunction arg0); + DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; std::vector getChildren() const override; @@ -37,6 +44,7 @@ class JsonbArrayElementTextLogicalFunction : public LogicalFunctionConcept { std::string explain(ExplainVerbosity verbosity) const override; LogicalFunction withInferredDataType(const Schema& schema) const override; SerializableFunction serialize() const override; + private: DataType dataType; std::vector parameters; diff --git a/nes-logical-operators/include/Functions/Meos/JsonbArrayLengthLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/JsonbArrayLengthLogicalFunction.hpp index 1bd8a6ecdf..aeeb448bab 100644 --- a/nes-logical-operators/include/Functions/Meos/JsonbArrayLengthLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/JsonbArrayLengthLogicalFunction.hpp @@ -22,12 +22,18 @@ namespace NES { /** - * @brief Returns the number of elements in the outermost JSONB array. + * @brief Jsonb array length + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `jsonb_array_length(temp)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class JsonbArrayLengthLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "JsonbArrayLength"; + JsonbArrayLengthLogicalFunction(LogicalFunction jb); + DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; std::vector getChildren() const override; @@ -37,6 +43,7 @@ class JsonbArrayLengthLogicalFunction : public LogicalFunctionConcept { std::string explain(ExplainVerbosity verbosity) const override; LogicalFunction withInferredDataType(const Schema& schema) const override; SerializableFunction serialize() const override; + private: DataType dataType; std::vector parameters; diff --git a/nes-logical-operators/include/Functions/Meos/JsonbCmpLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/JsonbCmpLogicalFunction.hpp index a0d29b5285..47233c566c 100644 --- a/nes-logical-operators/include/Functions/Meos/JsonbCmpLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/JsonbCmpLogicalFunction.hpp @@ -22,12 +22,19 @@ namespace NES { /** - * @brief Returns -1, 0, or 1 comparison result for two JSONB values. + * @brief Jsonb cmp + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `jsonb_cmp(temp, jb0)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class JsonbCmpLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "JsonbCmp"; - JsonbCmpLogicalFunction(LogicalFunction jb1, LogicalFunction jb2); + + JsonbCmpLogicalFunction(LogicalFunction jb, + LogicalFunction arg0); + DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; std::vector getChildren() const override; @@ -37,6 +44,7 @@ class JsonbCmpLogicalFunction : public LogicalFunctionConcept { std::string explain(ExplainVerbosity verbosity) const override; LogicalFunction withInferredDataType(const Schema& schema) const override; SerializableFunction serialize() const override; + private: DataType dataType; std::vector parameters; diff --git a/nes-logical-operators/include/Functions/Meos/JsonbContainedLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/JsonbContainedLogicalFunction.hpp index c21a486a1f..c9369d9b4c 100644 --- a/nes-logical-operators/include/Functions/Meos/JsonbContainedLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/JsonbContainedLogicalFunction.hpp @@ -22,12 +22,19 @@ namespace NES { /** - * @brief Tests if JSONB jb1 is contained by jb2. + * @brief Jsonb contained + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `jsonb_contained(temp, jb0)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class JsonbContainedLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "JsonbContained"; - JsonbContainedLogicalFunction(LogicalFunction jb1, LogicalFunction jb2); + + JsonbContainedLogicalFunction(LogicalFunction jb, + LogicalFunction arg0); + DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; std::vector getChildren() const override; @@ -37,6 +44,7 @@ class JsonbContainedLogicalFunction : public LogicalFunctionConcept { std::string explain(ExplainVerbosity verbosity) const override; LogicalFunction withInferredDataType(const Schema& schema) const override; SerializableFunction serialize() const override; + private: DataType dataType; std::vector parameters; diff --git a/nes-logical-operators/include/Functions/Meos/JsonbContainsLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/JsonbContainsLogicalFunction.hpp index 6b768f3452..26025f70cb 100644 --- a/nes-logical-operators/include/Functions/Meos/JsonbContainsLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/JsonbContainsLogicalFunction.hpp @@ -22,12 +22,19 @@ namespace NES { /** - * @brief Tests if JSONB jb1 contains jb2. + * @brief Jsonb contains + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `jsonb_contains(temp, jb0)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class JsonbContainsLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "JsonbContains"; - JsonbContainsLogicalFunction(LogicalFunction jb1, LogicalFunction jb2); + + JsonbContainsLogicalFunction(LogicalFunction jb, + LogicalFunction arg0); + DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; std::vector getChildren() const override; @@ -37,6 +44,7 @@ class JsonbContainsLogicalFunction : public LogicalFunctionConcept { std::string explain(ExplainVerbosity verbosity) const override; LogicalFunction withInferredDataType(const Schema& schema) const override; SerializableFunction serialize() const override; + private: DataType dataType; std::vector parameters; diff --git a/nes-logical-operators/include/Functions/Meos/JsonbEqLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/JsonbEqLogicalFunction.hpp index 26d46dc090..718b0a4dee 100644 --- a/nes-logical-operators/include/Functions/Meos/JsonbEqLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/JsonbEqLogicalFunction.hpp @@ -22,12 +22,19 @@ namespace NES { /** - * @brief Tests equality of two JSONB values. + * @brief Jsonb eq comparison + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `jsonb_eq(temp, jb0)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class JsonbEqLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "JsonbEq"; - JsonbEqLogicalFunction(LogicalFunction jb1, LogicalFunction jb2); + + JsonbEqLogicalFunction(LogicalFunction jb, + LogicalFunction arg0); + DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; std::vector getChildren() const override; @@ -37,6 +44,7 @@ class JsonbEqLogicalFunction : public LogicalFunctionConcept { std::string explain(ExplainVerbosity verbosity) const override; LogicalFunction withInferredDataType(const Schema& schema) const override; SerializableFunction serialize() const override; + private: DataType dataType; std::vector parameters; diff --git a/nes-logical-operators/include/Functions/Meos/JsonbExistsLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/JsonbExistsLogicalFunction.hpp index d52da9521e..1916b94960 100644 --- a/nes-logical-operators/include/Functions/Meos/JsonbExistsLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/JsonbExistsLogicalFunction.hpp @@ -22,12 +22,19 @@ namespace NES { /** - * @brief Tests if a key exists in a JSONB object. + * @brief Jsonb exists key + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `jsonb_exists(temp, txt0)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class JsonbExistsLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "JsonbExists"; - JsonbExistsLogicalFunction(LogicalFunction jb, LogicalFunction key); + + JsonbExistsLogicalFunction(LogicalFunction jb, + LogicalFunction arg0); + DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; std::vector getChildren() const override; @@ -37,6 +44,7 @@ class JsonbExistsLogicalFunction : public LogicalFunctionConcept { std::string explain(ExplainVerbosity verbosity) const override; LogicalFunction withInferredDataType(const Schema& schema) const override; SerializableFunction serialize() const override; + private: DataType dataType; std::vector parameters; diff --git a/nes-logical-operators/include/Functions/Meos/JsonbGeLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/JsonbGeLogicalFunction.hpp index 0b8858226c..2f557168e2 100644 --- a/nes-logical-operators/include/Functions/Meos/JsonbGeLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/JsonbGeLogicalFunction.hpp @@ -22,12 +22,19 @@ namespace NES { /** - * @brief Tests if JSONB value jb1 is greater than or equal to jb2. + * @brief Jsonb ge comparison + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `jsonb_ge(temp, jb0)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class JsonbGeLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "JsonbGe"; - JsonbGeLogicalFunction(LogicalFunction jb1, LogicalFunction jb2); + + JsonbGeLogicalFunction(LogicalFunction jb, + LogicalFunction arg0); + DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; std::vector getChildren() const override; @@ -37,6 +44,7 @@ class JsonbGeLogicalFunction : public LogicalFunctionConcept { std::string explain(ExplainVerbosity verbosity) const override; LogicalFunction withInferredDataType(const Schema& schema) const override; SerializableFunction serialize() const override; + private: DataType dataType; std::vector parameters; diff --git a/nes-logical-operators/include/Functions/Meos/JsonbGtLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/JsonbGtLogicalFunction.hpp index fc8b2b0e50..a86b73b613 100644 --- a/nes-logical-operators/include/Functions/Meos/JsonbGtLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/JsonbGtLogicalFunction.hpp @@ -22,12 +22,19 @@ namespace NES { /** - * @brief Tests if JSONB value jb1 is greater than jb2. + * @brief Jsonb gt comparison + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `jsonb_gt(temp, jb0)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class JsonbGtLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "JsonbGt"; - JsonbGtLogicalFunction(LogicalFunction jb1, LogicalFunction jb2); + + JsonbGtLogicalFunction(LogicalFunction jb, + LogicalFunction arg0); + DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; std::vector getChildren() const override; @@ -37,6 +44,7 @@ class JsonbGtLogicalFunction : public LogicalFunctionConcept { std::string explain(ExplainVerbosity verbosity) const override; LogicalFunction withInferredDataType(const Schema& schema) const override; SerializableFunction serialize() const override; + private: DataType dataType; std::vector parameters; diff --git a/nes-logical-operators/include/Functions/Meos/JsonbLeLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/JsonbLeLogicalFunction.hpp index 403df06bd5..e8d32e1ddc 100644 --- a/nes-logical-operators/include/Functions/Meos/JsonbLeLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/JsonbLeLogicalFunction.hpp @@ -22,12 +22,19 @@ namespace NES { /** - * @brief Tests if JSONB value jb1 is less than or equal to jb2. + * @brief Jsonb le comparison + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `jsonb_le(temp, jb0)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class JsonbLeLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "JsonbLe"; - JsonbLeLogicalFunction(LogicalFunction jb1, LogicalFunction jb2); + + JsonbLeLogicalFunction(LogicalFunction jb, + LogicalFunction arg0); + DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; std::vector getChildren() const override; @@ -37,6 +44,7 @@ class JsonbLeLogicalFunction : public LogicalFunctionConcept { std::string explain(ExplainVerbosity verbosity) const override; LogicalFunction withInferredDataType(const Schema& schema) const override; SerializableFunction serialize() const override; + private: DataType dataType; std::vector parameters; diff --git a/nes-logical-operators/include/Functions/Meos/JsonbLtLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/JsonbLtLogicalFunction.hpp index 0ef0a9247a..e74b0e7ea3 100644 --- a/nes-logical-operators/include/Functions/Meos/JsonbLtLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/JsonbLtLogicalFunction.hpp @@ -22,12 +22,19 @@ namespace NES { /** - * @brief Tests if JSONB value jb1 is less than jb2. + * @brief Jsonb lt comparison + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `jsonb_lt(temp, jb0)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class JsonbLtLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "JsonbLt"; - JsonbLtLogicalFunction(LogicalFunction jb1, LogicalFunction jb2); + + JsonbLtLogicalFunction(LogicalFunction jb, + LogicalFunction arg0); + DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; std::vector getChildren() const override; @@ -37,6 +44,7 @@ class JsonbLtLogicalFunction : public LogicalFunctionConcept { std::string explain(ExplainVerbosity verbosity) const override; LogicalFunction withInferredDataType(const Schema& schema) const override; SerializableFunction serialize() const override; + private: DataType dataType; std::vector parameters; diff --git a/nes-logical-operators/include/Functions/Meos/JsonbNeLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/JsonbNeLogicalFunction.hpp index b11874651e..920f29d630 100644 --- a/nes-logical-operators/include/Functions/Meos/JsonbNeLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/JsonbNeLogicalFunction.hpp @@ -22,12 +22,19 @@ namespace NES { /** - * @brief Tests inequality of two JSONB values. + * @brief Jsonb ne comparison + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `jsonb_ne(temp, jb0)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class JsonbNeLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "JsonbNe"; - JsonbNeLogicalFunction(LogicalFunction jb1, LogicalFunction jb2); + + JsonbNeLogicalFunction(LogicalFunction jb, + LogicalFunction arg0); + DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; std::vector getChildren() const override; @@ -37,6 +44,7 @@ class JsonbNeLogicalFunction : public LogicalFunctionConcept { std::string explain(ExplainVerbosity verbosity) const override; LogicalFunction withInferredDataType(const Schema& schema) const override; SerializableFunction serialize() const override; + private: DataType dataType; std::vector parameters; diff --git a/nes-logical-operators/include/Functions/Meos/JsonbObjectFieldTextLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/JsonbObjectFieldTextLogicalFunction.hpp index 8522e5e813..650b003fe7 100644 --- a/nes-logical-operators/include/Functions/Meos/JsonbObjectFieldTextLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/JsonbObjectFieldTextLogicalFunction.hpp @@ -22,12 +22,19 @@ namespace NES { /** - * @brief Returns the value of a JSONB object field as plain text. + * @brief Jsonb object field text + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `jsonb_object_field_text(temp, txt0)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class JsonbObjectFieldTextLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "JsonbObjectFieldText"; - JsonbObjectFieldTextLogicalFunction(LogicalFunction jb, LogicalFunction key); + + JsonbObjectFieldTextLogicalFunction(LogicalFunction jb, + LogicalFunction arg0); + DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; std::vector getChildren() const override; @@ -37,6 +44,7 @@ class JsonbObjectFieldTextLogicalFunction : public LogicalFunctionConcept { std::string explain(ExplainVerbosity verbosity) const override; LogicalFunction withInferredDataType(const Schema& schema) const override; SerializableFunction serialize() const override; + private: DataType dataType; std::vector parameters; diff --git a/nes-logical-operators/include/Functions/Meos/JsonbPrettyLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/JsonbPrettyLogicalFunction.hpp index d7b05e5f41..45cb8330b7 100644 --- a/nes-logical-operators/include/Functions/Meos/JsonbPrettyLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/JsonbPrettyLogicalFunction.hpp @@ -22,12 +22,18 @@ namespace NES { /** - * @brief Returns a JSONB value formatted with indentation. + * @brief Jsonb pretty print + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `jsonb_pretty(temp)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class JsonbPrettyLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "JsonbPretty"; + JsonbPrettyLogicalFunction(LogicalFunction jb); + DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; std::vector getChildren() const override; @@ -37,6 +43,7 @@ class JsonbPrettyLogicalFunction : public LogicalFunctionConcept { std::string explain(ExplainVerbosity verbosity) const override; LogicalFunction withInferredDataType(const Schema& schema) const override; SerializableFunction serialize() const override; + private: DataType dataType; std::vector parameters; diff --git a/nes-logical-operators/include/Functions/Meos/JsonbToCstringLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/JsonbToCstringLogicalFunction.hpp index b27c8c836b..4bf634f76a 100644 --- a/nes-logical-operators/include/Functions/Meos/JsonbToCstringLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/JsonbToCstringLogicalFunction.hpp @@ -22,12 +22,18 @@ namespace NES { /** - * @brief Converts a JSONB value to its text representation. + * @brief Jsonb to cstring + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `jsonb_to_cstring(temp)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class JsonbToCstringLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "JsonbToCstring"; + JsonbToCstringLogicalFunction(LogicalFunction jb); + DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; std::vector getChildren() const override; @@ -37,6 +43,7 @@ class JsonbToCstringLogicalFunction : public LogicalFunctionConcept { std::string explain(ExplainVerbosity verbosity) const override; LogicalFunction withInferredDataType(const Schema& schema) const override; SerializableFunction serialize() const override; + private: DataType dataType; std::vector parameters; diff --git a/nes-logical-operators/include/Functions/Meos/LineInterpolatePointLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/LineInterpolatePointLogicalFunction.hpp index 51ef5888cd..98750b9407 100644 --- a/nes-logical-operators/include/Functions/Meos/LineInterpolatePointLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/LineInterpolatePointLogicalFunction.hpp @@ -22,13 +22,18 @@ namespace NES { /** - * @brief Returns the point (or multi-point if repeat=1) interpolated at the given fraction along a line. + * @brief Interpolate point on line + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `line_interpolate_point(temp, arg0)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class LineInterpolatePointLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "LineInterpolatePoint"; - LineInterpolatePointLogicalFunction(LogicalFunction wkt, LogicalFunction frac, LogicalFunction repeat); + LineInterpolatePointLogicalFunction(LogicalFunction wkt, + LogicalFunction arg0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/LineLocatePointLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/LineLocatePointLogicalFunction.hpp index 9a09b8181d..9b695d3b53 100644 --- a/nes-logical-operators/include/Functions/Meos/LineLocatePointLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/LineLocatePointLogicalFunction.hpp @@ -22,13 +22,18 @@ namespace NES { /** - * @brief Returns the fractional location (0–1) of the closest point on the line to a point. + * @brief Locate point on line + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `line_locate_point`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class LineLocatePointLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "LineLocatePoint"; - LineLocatePointLogicalFunction(LogicalFunction wkt1, LogicalFunction wkt2); + LineLocatePointLogicalFunction(LogicalFunction wkt, + LogicalFunction arg0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/LineNumpointsLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/LineNumpointsLogicalFunction.hpp index f3aa1e814f..bd08951ee3 100644 --- a/nes-logical-operators/include/Functions/Meos/LineNumpointsLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/LineNumpointsLogicalFunction.hpp @@ -22,7 +22,11 @@ namespace NES { /** - * @brief Returns the number of points in a linestring. + * @brief Line num points + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `line_numpoints(temp)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class LineNumpointsLogicalFunction : public LogicalFunctionConcept { public: diff --git a/nes-logical-operators/include/Functions/Meos/LinePointNLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/LinePointNLogicalFunction.hpp index 0213b796b2..418a6e7373 100644 --- a/nes-logical-operators/include/Functions/Meos/LinePointNLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/LinePointNLogicalFunction.hpp @@ -22,13 +22,18 @@ namespace NES { /** - * @brief Returns the nth point of a linestring as WKT (1-based index). + * @brief Nth point on line + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `line_point_n(temp, (int)arg0)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class LinePointNLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "LinePointN"; - LinePointNLogicalFunction(LogicalFunction wkt, LogicalFunction n); + LinePointNLogicalFunction(LogicalFunction wkt, + LogicalFunction arg0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/LineSubstringLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/LineSubstringLogicalFunction.hpp index 938bc97d69..509ecafd92 100644 --- a/nes-logical-operators/include/Functions/Meos/LineSubstringLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/LineSubstringLogicalFunction.hpp @@ -22,13 +22,19 @@ namespace NES { /** - * @brief Returns the portion of a linestring between fractional positions from and to. + * @brief Line substring + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `line_substring(temp, arg0, arg1)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class LineSubstringLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "LineSubstring"; - LineSubstringLogicalFunction(LogicalFunction wkt, LogicalFunction from_f, LogicalFunction to_f); + LineSubstringLogicalFunction(LogicalFunction wkt, + LogicalFunction arg0, + LogicalFunction arg1); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/MindistanceTcbufferTcbufferLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/MindistanceTcbufferTcbufferLogicalFunction.hpp index b473b8a36c..2dfb27a1d7 100644 --- a/nes-logical-operators/include/Functions/Meos/MindistanceTcbufferTcbufferLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/MindistanceTcbufferTcbufferLogicalFunction.hpp @@ -22,20 +22,25 @@ namespace NES { /** - * @brief Returns the minimum distance between two tcbuffer instants within the given threshold. + * @brief Per-event minimum distance between two tcbuffer instants within threshold. * - * Args: (lon1:FLOAT64, lat1:FLOAT64, r1:FLOAT64, ts1:UINT64, - * lon2:FLOAT64, lat2:FLOAT64, r2:FLOAT64, ts2:UINT64, - * dist:FLOAT64) -> FLOAT64. + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `mindistance_tcbuffer_tcbuffer`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class MindistanceTcbufferTcbufferLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "MindistanceTcbufferTcbuffer"; - MindistanceTcbufferTcbufferLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction r1, - LogicalFunction ts1, - LogicalFunction lon2, LogicalFunction lat2, LogicalFunction r2, - LogicalFunction ts2, LogicalFunction dist); + MindistanceTcbufferTcbufferLogicalFunction(LogicalFunction lonA, + LogicalFunction latA, + LogicalFunction radiusA, + LogicalFunction tsA, + LogicalFunction lonB, + LogicalFunction latB, + LogicalFunction radiusB, + LogicalFunction tsB, + LogicalFunction dist); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/MulBigintTbigintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/MulBigintTbigintLogicalFunction.hpp index bc3e2244f5..dda2b203f7 100644 --- a/nes-logical-operators/include/Functions/Meos/MulBigintTbigintLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/MulBigintTbigintLogicalFunction.hpp @@ -22,19 +22,19 @@ namespace NES { /** - * @brief Per-event mul_bigint_tbigint: multiplies a constant int64 scalar by a single-instant tbigint value. + * @brief Per-event mul_bigint_tbigint: scalar bigint times single-instant tbigint. * * Generated by tools/codegen/codegen_nebula.py from the MEOS function - * `mul_bigint_tbigint`. Takes (scalar:FLOAT64→int64, value:FLOAT64, ts:UINT64), - * constructs a single-instant temporal, applies the multiplication, and returns FLOAT64. + * `mul_bigint_tbigint`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class MulBigintTbigintLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "MulBigintTbigint"; - MulBigintTbigintLogicalFunction(LogicalFunction scalar, - LogicalFunction value, - LogicalFunction ts); + MulBigintTbigintLogicalFunction(LogicalFunction arg0, + LogicalFunction value, + LogicalFunction ts); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/MulFloatTfloatLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/MulFloatTfloatLogicalFunction.hpp index c4f788803b..8e05bb526b 100644 --- a/nes-logical-operators/include/Functions/Meos/MulFloatTfloatLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/MulFloatTfloatLogicalFunction.hpp @@ -22,19 +22,19 @@ namespace NES { /** - * @brief Per-event mul_float_tfloat: multiplies a constant by a single-instant tfloat value. + * @brief Per-event mul_float_tfloat: scalar float times single-instant tfloat. * * Generated by tools/codegen/codegen_nebula.py from the MEOS function - * `mul_float_tfloat`. Takes (scalar:FLOAT64, value:FLOAT64, ts:UINT64), - * constructs a single-instant temporal, applies the multiplication, and returns FLOAT64. + * `mul_float_tfloat`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class MulFloatTfloatLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "MulFloatTfloat"; - MulFloatTfloatLogicalFunction(LogicalFunction scalar, - LogicalFunction value, - LogicalFunction ts); + MulFloatTfloatLogicalFunction(LogicalFunction arg0, + LogicalFunction value, + LogicalFunction ts); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/MulIntTintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/MulIntTintLogicalFunction.hpp index a2f0f7f2b3..5b0aebcbd2 100644 --- a/nes-logical-operators/include/Functions/Meos/MulIntTintLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/MulIntTintLogicalFunction.hpp @@ -22,19 +22,19 @@ namespace NES { /** - * @brief Per-event mul_int_tint: multiplies a constant by a single-instant tint value. + * @brief Per-event mul_int_tint: scalar int times single-instant tint. * * Generated by tools/codegen/codegen_nebula.py from the MEOS function - * `mul_int_tint`. Takes (scalar:FLOAT64, value:FLOAT64, ts:UINT64), - * constructs a single-instant temporal, applies the multiplication, and returns FLOAT64. + * `mul_int_tint`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class MulIntTintLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "MulIntTint"; - MulIntTintLogicalFunction(LogicalFunction scalar, - LogicalFunction value, - LogicalFunction ts); + MulIntTintLogicalFunction(LogicalFunction arg0, + LogicalFunction value, + LogicalFunction ts); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/MulTbigintBigintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/MulTbigintBigintLogicalFunction.hpp index ff857a8773..b8d7c9747d 100644 --- a/nes-logical-operators/include/Functions/Meos/MulTbigintBigintLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/MulTbigintBigintLogicalFunction.hpp @@ -22,19 +22,19 @@ namespace NES { /** - * @brief Per-event mul_tbigint_bigint: multiplies a single-instant tbigint value by a constant int64. + * @brief Per-event mul_tbigint_bigint: single-instant tbigint times scalar bigint. * * Generated by tools/codegen/codegen_nebula.py from the MEOS function - * `mul_tbigint_bigint`. Takes (value:FLOAT64, ts:UINT64, factor:FLOAT64→int64), - * constructs a single-instant temporal, applies the multiplication, and returns FLOAT64. + * `mul_tbigint_bigint`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class MulTbigintBigintLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "MulTbigintBigint"; MulTbigintBigintLogicalFunction(LogicalFunction value, - LogicalFunction ts, - LogicalFunction factor); + LogicalFunction ts, + LogicalFunction arg0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/MulTfloatFloatLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/MulTfloatFloatLogicalFunction.hpp index a2f3606cca..036f59927b 100644 --- a/nes-logical-operators/include/Functions/Meos/MulTfloatFloatLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/MulTfloatFloatLogicalFunction.hpp @@ -22,19 +22,19 @@ namespace NES { /** - * @brief Per-event mul_tfloat_float: multiplies a single-instant tfloat value by a constant. + * @brief Per-event mul_tfloat_float: single-instant tfloat times scalar float. * * Generated by tools/codegen/codegen_nebula.py from the MEOS function - * `mul_tfloat_float`. Takes (value:FLOAT64, ts:UINT64, factor:FLOAT64), - * constructs a single-instant temporal, applies the multiplication, and returns FLOAT64. + * `mul_tfloat_float`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class MulTfloatFloatLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "MulTfloatFloat"; MulTfloatFloatLogicalFunction(LogicalFunction value, - LogicalFunction ts, - LogicalFunction factor); + LogicalFunction ts, + LogicalFunction arg0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/MulTintIntLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/MulTintIntLogicalFunction.hpp index bf2fbb90b5..2f2dcc0165 100644 --- a/nes-logical-operators/include/Functions/Meos/MulTintIntLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/MulTintIntLogicalFunction.hpp @@ -22,19 +22,19 @@ namespace NES { /** - * @brief Per-event mul_tint_int: multiplies a single-instant tint value by a constant integer. + * @brief Per-event mul_tint_int: single-instant tint times scalar int. * * Generated by tools/codegen/codegen_nebula.py from the MEOS function - * `mul_tint_int`. Takes (value:FLOAT64, ts:UINT64, multiplier:FLOAT64→int), - * constructs a single-instant temporal, applies the multiplication, and returns FLOAT64. + * `mul_tint_int`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class MulTintIntLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "MulTintInt"; MulTintIntLogicalFunction(LogicalFunction value, - LogicalFunction ts, - LogicalFunction multiplier); + LogicalFunction ts, + LogicalFunction arg0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/MulTnumberTnumberLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/MulTnumberTnumberLogicalFunction.hpp index e3898c52ed..3d531a8599 100644 --- a/nes-logical-operators/include/Functions/Meos/MulTnumberTnumberLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/MulTnumberTnumberLogicalFunction.hpp @@ -22,19 +22,18 @@ namespace NES { /** - * @brief Per-event mul_tnumber_tnumber: element-wise multiplication of two single-instant tnumbers. + * @brief Per-event mul_tnumber_tnumber: two temporal numbers multiplied (WKB result). * * Generated by tools/codegen/codegen_nebula.py from the MEOS function - * `mul_tnumber_tnumber`. Takes (value1:FLOAT64, value2:FLOAT64, ts:UINT64), - * constructs two co-instant temporals, applies the multiplication, and returns FLOAT64. + * `mul_tnumber_tnumber`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class MulTnumberTnumberLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "MulTnumberTnumber"; - MulTnumberTnumberLogicalFunction(LogicalFunction value1, - LogicalFunction value2, - LogicalFunction ts); + MulTnumberTnumberLogicalFunction(LogicalFunction traj, + LogicalFunction arg0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/NadTcbufferGeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/NadTcbufferGeoLogicalFunction.hpp index 8d5967deec..ba018ede7c 100644 --- a/nes-logical-operators/include/Functions/Meos/NadTcbufferGeoLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/NadTcbufferGeoLogicalFunction.hpp @@ -22,17 +22,21 @@ namespace NES { /** - * @brief Returns the nearest approach distance between the tcbuffer and a static geometry. + * @brief Per-event nearest approach distance between tcbuffer and static geometry. * - * Args: (lon:FLOAT64, lat:FLOAT64, radius:FLOAT64, ts:UINT64, wkt:VARCHAR) -> FLOAT64. + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `nad_tcbuffer_geo`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class NadTcbufferGeoLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "NadTcbufferGeo"; - NadTcbufferGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, - LogicalFunction radius, LogicalFunction ts, - LogicalFunction wkt); + NadTcbufferGeoLogicalFunction(LogicalFunction lon, + LogicalFunction lat, + LogicalFunction radius, + LogicalFunction timestamp, + LogicalFunction geometry); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/NadTcbufferTcbufferLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/NadTcbufferTcbufferLogicalFunction.hpp index 37b1182ebd..066f2570dc 100644 --- a/nes-logical-operators/include/Functions/Meos/NadTcbufferTcbufferLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/NadTcbufferTcbufferLogicalFunction.hpp @@ -22,19 +22,24 @@ namespace NES { /** - * @brief Returns the nearest approach distance between two tcbuffer instants. + * @brief Per-event nearest approach distance between two tcbuffer instants. * - * Args: (lon1:FLOAT64, lat1:FLOAT64, r1:FLOAT64, ts1:UINT64, - * lon2:FLOAT64, lat2:FLOAT64, r2:FLOAT64, ts2:UINT64) -> FLOAT64. + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `nad_tcbuffer_tcbuffer`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class NadTcbufferTcbufferLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "NadTcbufferTcbuffer"; - NadTcbufferTcbufferLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction r1, - LogicalFunction ts1, - LogicalFunction lon2, LogicalFunction lat2, LogicalFunction r2, - LogicalFunction ts2); + NadTcbufferTcbufferLogicalFunction(LogicalFunction lonA, + LogicalFunction latA, + LogicalFunction radiusA, + LogicalFunction tsA, + LogicalFunction lonB, + LogicalFunction latB, + LogicalFunction radiusB, + LogicalFunction tsB); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/NadTgeoGeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/NadTgeoGeoLogicalFunction.hpp index 7df28e013d..334c148438 100644 --- a/nes-logical-operators/include/Functions/Meos/NadTgeoGeoLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/NadTgeoGeoLogicalFunction.hpp @@ -22,16 +22,20 @@ namespace NES { /** - * @brief Returns the nearest approach distance between a temporal geometry and a static geometry. + * @brief Per-event nearest approach distance between tgeo and static geometry. * - * Args: (lon:FLOAT64, lat:FLOAT64, ts:UINT64, wkt:VARCHAR) -> FLOAT64. + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `nad_tgeo_geo`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class NadTgeoGeoLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "NadTgeoGeo"; - NadTgeoGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, - LogicalFunction ts, LogicalFunction wkt); + NadTgeoGeoLogicalFunction(LogicalFunction lon, + LogicalFunction lat, + LogicalFunction timestamp, + LogicalFunction geometry); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/NadTgeoTgeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/NadTgeoTgeoLogicalFunction.hpp new file mode 100644 index 0000000000..9a40dfa0b6 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/NadTgeoTgeoLogicalFunction.hpp @@ -0,0 +1,57 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event nearest approach distance between two tgeo instants. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `nad_tgeo_tgeo`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. + */ +class NadTgeoTgeoLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "NadTgeoTgeo"; + + NadTgeoTgeoLogicalFunction(LogicalFunction lonA, + LogicalFunction latA, + LogicalFunction tsA, + LogicalFunction lonB, + LogicalFunction latB, + LogicalFunction tsB); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/NadTnpointGeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/NadTnpointGeoLogicalFunction.hpp index 2860d4f91a..091279c99c 100644 --- a/nes-logical-operators/include/Functions/Meos/NadTnpointGeoLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/NadTnpointGeoLogicalFunction.hpp @@ -22,13 +22,20 @@ namespace NES { /** - * @brief Returns the nearest approach distance between a tnpoint instant and a static geometry. + * @brief NAD tnpoint vs geo + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `nad_tnpoint_geo(temp, gs0)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class NadTnpointGeoLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "NadTnpointGeo"; - NadTnpointGeoLogicalFunction(LogicalFunction rid, LogicalFunction pos, LogicalFunction ts, LogicalFunction wkt); + NadTnpointGeoLogicalFunction(LogicalFunction rid, + LogicalFunction frac, + LogicalFunction ts, + LogicalFunction arg0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/NadTnpointNpointLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/NadTnpointNpointLogicalFunction.hpp index 90f67e08f6..c61e967e1c 100644 --- a/nes-logical-operators/include/Functions/Meos/NadTnpointNpointLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/NadTnpointNpointLogicalFunction.hpp @@ -22,13 +22,21 @@ namespace NES { /** - * @brief Returns the nearest approach distance between a tnpoint instant and a static npoint. + * @brief NAD tnpoint vs npoint + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `nad_tnpoint_npoint(temp, np0)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class NadTnpointNpointLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "NadTnpointNpoint"; - NadTnpointNpointLogicalFunction(LogicalFunction rid1, LogicalFunction pos1, LogicalFunction ts, LogicalFunction rid2, LogicalFunction pos2); + NadTnpointNpointLogicalFunction(LogicalFunction rid, + LogicalFunction frac, + LogicalFunction ts, + LogicalFunction rid0, + LogicalFunction frac0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/NadTnpointTnpointLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/NadTnpointTnpointLogicalFunction.hpp index df02072219..0eeeb0dca7 100644 --- a/nes-logical-operators/include/Functions/Meos/NadTnpointTnpointLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/NadTnpointTnpointLogicalFunction.hpp @@ -22,17 +22,22 @@ namespace NES { /** - * @brief Returns the nearest approach distance between two tnpoint instants. + * @brief NAD tnpoint vs tnpoint * - * Args: (rid1:UINT64, pos1:FLOAT64, ts1:UINT64, - * rid2:UINT64, pos2:FLOAT64, ts2:UINT64) -> FLOAT64. + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `nad_tnpoint_tnpoint(temp, inst0)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class NadTnpointTnpointLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "NadTnpointTnpoint"; - NadTnpointTnpointLogicalFunction(LogicalFunction rid1, LogicalFunction pos1, LogicalFunction ts1, - LogicalFunction rid2, LogicalFunction pos2, LogicalFunction ts2); + NadTnpointTnpointLogicalFunction(LogicalFunction rid, + LogicalFunction frac, + LogicalFunction ts, + LogicalFunction rid0, + LogicalFunction frac0, + LogicalFunction ts0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/NadTposeGeoLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/NadTposeGeoLogicalFunction.hpp index 72614db99c..f15e1ee98e 100644 --- a/nes-logical-operators/include/Functions/Meos/NadTposeGeoLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/NadTposeGeoLogicalFunction.hpp @@ -22,13 +22,21 @@ namespace NES { /** - * @brief Returns the nearest approach distance between a 2D tpose instant and a static geometry. + * @brief NAD tpose vs geo + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `nad_tpose_geo(temp, gs0)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class NadTposeGeoLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "NadTposeGeo"; - NadTposeGeoLogicalFunction(LogicalFunction x, LogicalFunction y, LogicalFunction theta, LogicalFunction ts, LogicalFunction wkt); + NadTposeGeoLogicalFunction(LogicalFunction x, + LogicalFunction y, + LogicalFunction theta, + LogicalFunction ts, + LogicalFunction arg0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/NadTposePoseLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/NadTposePoseLogicalFunction.hpp index bccd5f063a..302a3414aa 100644 --- a/nes-logical-operators/include/Functions/Meos/NadTposePoseLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/NadTposePoseLogicalFunction.hpp @@ -22,13 +22,23 @@ namespace NES { /** - * @brief Returns the nearest approach distance between a 2D tpose instant and a static pose. + * @brief NAD tpose vs pose + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `nad_tpose_pose(temp, pose0)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class NadTposePoseLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "NadTposePose"; - NadTposePoseLogicalFunction(LogicalFunction x, LogicalFunction y, LogicalFunction theta, LogicalFunction ts, LogicalFunction x2, LogicalFunction y2, LogicalFunction theta2); + NadTposePoseLogicalFunction(LogicalFunction x, + LogicalFunction y, + LogicalFunction theta, + LogicalFunction ts, + LogicalFunction px0, + LogicalFunction py0, + LogicalFunction ptheta0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/NadTposeTposeLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/NadTposeTposeLogicalFunction.hpp index 3d09da1b7b..29a6d5f74f 100644 --- a/nes-logical-operators/include/Functions/Meos/NadTposeTposeLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/NadTposeTposeLogicalFunction.hpp @@ -22,19 +22,24 @@ namespace NES { /** - * @brief Returns the nearest approach distance between two 2D tpose instants. + * @brief NAD tpose vs tpose * - * Args: (x1:FLOAT64, y1:FLOAT64, theta1:FLOAT64, ts1:UINT64, - * x2:FLOAT64, y2:FLOAT64, theta2:FLOAT64, ts2:UINT64) -> FLOAT64. + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `nad_tpose_tpose(temp, inst0)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class NadTposeTposeLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "NadTposeTpose"; - NadTposeTposeLogicalFunction(LogicalFunction x1, LogicalFunction y1, LogicalFunction theta1, - LogicalFunction ts1, - LogicalFunction x2, LogicalFunction y2, LogicalFunction theta2, - LogicalFunction ts2); + NadTposeTposeLogicalFunction(LogicalFunction x, + LogicalFunction y, + LogicalFunction theta, + LogicalFunction ts, + LogicalFunction px0, + LogicalFunction py0, + LogicalFunction ptheta0, + LogicalFunction ts0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/QuadbinCellAreaLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/QuadbinCellAreaLogicalFunction.hpp index 56d79731ff..6cb2cdbcb9 100644 --- a/nes-logical-operators/include/Functions/Meos/QuadbinCellAreaLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/QuadbinCellAreaLogicalFunction.hpp @@ -22,7 +22,11 @@ namespace NES { /** - * @brief Returns a FLOAT64 scalar for a quadbin cell. NES token: QUADBIN_CELL_AREA. + * @brief Quadbin cell area + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `quadbin_cell_area((Quadbin)cell)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class QuadbinCellAreaLogicalFunction : public LogicalFunctionConcept { public: diff --git a/nes-logical-operators/include/Functions/Meos/QuadbinCellToParentLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/QuadbinCellToParentLogicalFunction.hpp index 57abe70a7b..064e04c7cb 100644 --- a/nes-logical-operators/include/Functions/Meos/QuadbinCellToParentLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/QuadbinCellToParentLogicalFunction.hpp @@ -22,13 +22,18 @@ namespace NES { /** - * @brief Returns a VARCHAR for a quadbin cell. NES token: QUADBIN_CELL_TO_PARENT. + * @brief Quadbin cell to parent + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `quadbin_cell_to_parent((Quadbin)cell, (uint32_t)res)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class QuadbinCellToParentLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "QuadbinCellToParent"; - QuadbinCellToParentLogicalFunction(LogicalFunction cell, LogicalFunction res); + QuadbinCellToParentLogicalFunction(LogicalFunction cell, + LogicalFunction res); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/QuadbinCellToQuadkeyLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/QuadbinCellToQuadkeyLogicalFunction.hpp index 9e5a12bcb7..85b81d9282 100644 --- a/nes-logical-operators/include/Functions/Meos/QuadbinCellToQuadkeyLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/QuadbinCellToQuadkeyLogicalFunction.hpp @@ -22,7 +22,11 @@ namespace NES { /** - * @brief Returns a VARCHAR for a quadbin cell. NES token: QUADBIN_CELL_TO_QUADKEY. + * @brief Quadbin cell to quadkey + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `quadbin_cell_to_quadkey((Quadbin)cell)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class QuadbinCellToQuadkeyLogicalFunction : public LogicalFunctionConcept { public: diff --git a/nes-logical-operators/include/Functions/Meos/QuadbinCmpLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/QuadbinCmpLogicalFunction.hpp index c9c89404df..47215d13ec 100644 --- a/nes-logical-operators/include/Functions/Meos/QuadbinCmpLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/QuadbinCmpLogicalFunction.hpp @@ -22,12 +22,19 @@ namespace NES { /** - * @brief Returns -1, 0, or 1 comparison result for two Quadbin cells. + * @brief Quadbin cmp + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `quadbin_cmp((Quadbin)a, (Quadbin)b)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class QuadbinCmpLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "QuadbinCmp"; - QuadbinCmpLogicalFunction(LogicalFunction a, LogicalFunction b); + + QuadbinCmpLogicalFunction(LogicalFunction a, + LogicalFunction b); + DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; std::vector getChildren() const override; @@ -37,6 +44,7 @@ class QuadbinCmpLogicalFunction : public LogicalFunctionConcept { std::string explain(ExplainVerbosity verbosity) const override; LogicalFunction withInferredDataType(const Schema& schema) const override; SerializableFunction serialize() const override; + private: DataType dataType; std::vector parameters; diff --git a/nes-logical-operators/include/Functions/Meos/QuadbinEqLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/QuadbinEqLogicalFunction.hpp index f60c70bca3..b308739708 100644 --- a/nes-logical-operators/include/Functions/Meos/QuadbinEqLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/QuadbinEqLogicalFunction.hpp @@ -22,12 +22,19 @@ namespace NES { /** - * @brief Tests equality of two Quadbin cell identifiers. + * @brief Quadbin eq comparison + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `quadbin_eq((Quadbin)a, (Quadbin)b)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class QuadbinEqLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "QuadbinEq"; - QuadbinEqLogicalFunction(LogicalFunction a, LogicalFunction b); + + QuadbinEqLogicalFunction(LogicalFunction a, + LogicalFunction b); + DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; std::vector getChildren() const override; @@ -37,6 +44,7 @@ class QuadbinEqLogicalFunction : public LogicalFunctionConcept { std::string explain(ExplainVerbosity verbosity) const override; LogicalFunction withInferredDataType(const Schema& schema) const override; SerializableFunction serialize() const override; + private: DataType dataType; std::vector parameters; diff --git a/nes-logical-operators/include/Functions/Meos/QuadbinGeLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/QuadbinGeLogicalFunction.hpp index 15d962f538..fc7d0dd70e 100644 --- a/nes-logical-operators/include/Functions/Meos/QuadbinGeLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/QuadbinGeLogicalFunction.hpp @@ -22,12 +22,19 @@ namespace NES { /** - * @brief Tests if Quadbin cell a is greater than or equal to b. + * @brief Quadbin ge comparison + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `quadbin_ge((Quadbin)a, (Quadbin)b)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class QuadbinGeLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "QuadbinGe"; - QuadbinGeLogicalFunction(LogicalFunction a, LogicalFunction b); + + QuadbinGeLogicalFunction(LogicalFunction a, + LogicalFunction b); + DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; std::vector getChildren() const override; @@ -37,6 +44,7 @@ class QuadbinGeLogicalFunction : public LogicalFunctionConcept { std::string explain(ExplainVerbosity verbosity) const override; LogicalFunction withInferredDataType(const Schema& schema) const override; SerializableFunction serialize() const override; + private: DataType dataType; std::vector parameters; diff --git a/nes-logical-operators/include/Functions/Meos/QuadbinGetResolutionLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/QuadbinGetResolutionLogicalFunction.hpp index b332f289fe..572db1225f 100644 --- a/nes-logical-operators/include/Functions/Meos/QuadbinGetResolutionLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/QuadbinGetResolutionLogicalFunction.hpp @@ -22,7 +22,11 @@ namespace NES { /** - * @brief Returns a FLOAT64 scalar for a quadbin cell. NES token: QUADBIN_GET_RESOLUTION. + * @brief Quadbin get resolution + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `quadbin_get_resolution((Quadbin)cell)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class QuadbinGetResolutionLogicalFunction : public LogicalFunctionConcept { public: diff --git a/nes-logical-operators/include/Functions/Meos/QuadbinGtLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/QuadbinGtLogicalFunction.hpp index cb95702033..849a6e8829 100644 --- a/nes-logical-operators/include/Functions/Meos/QuadbinGtLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/QuadbinGtLogicalFunction.hpp @@ -22,12 +22,19 @@ namespace NES { /** - * @brief Tests if Quadbin cell a is greater than b. + * @brief Quadbin gt comparison + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `quadbin_gt((Quadbin)a, (Quadbin)b)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class QuadbinGtLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "QuadbinGt"; - QuadbinGtLogicalFunction(LogicalFunction a, LogicalFunction b); + + QuadbinGtLogicalFunction(LogicalFunction a, + LogicalFunction b); + DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; std::vector getChildren() const override; @@ -37,6 +44,7 @@ class QuadbinGtLogicalFunction : public LogicalFunctionConcept { std::string explain(ExplainVerbosity verbosity) const override; LogicalFunction withInferredDataType(const Schema& schema) const override; SerializableFunction serialize() const override; + private: DataType dataType; std::vector parameters; diff --git a/nes-logical-operators/include/Functions/Meos/QuadbinIsValidCellLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/QuadbinIsValidCellLogicalFunction.hpp index be48e755b9..e461ca8a9d 100644 --- a/nes-logical-operators/include/Functions/Meos/QuadbinIsValidCellLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/QuadbinIsValidCellLogicalFunction.hpp @@ -22,7 +22,11 @@ namespace NES { /** - * @brief Returns a FLOAT64 scalar for a quadbin cell. NES token: QUADBIN_IS_VALID_CELL. + * @brief Quadbin is valid cell + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `quadbin_is_valid_cell((Quadbin)cell)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class QuadbinIsValidCellLogicalFunction : public LogicalFunctionConcept { public: diff --git a/nes-logical-operators/include/Functions/Meos/QuadbinLeLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/QuadbinLeLogicalFunction.hpp index 9028a34a25..c63b7e7d99 100644 --- a/nes-logical-operators/include/Functions/Meos/QuadbinLeLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/QuadbinLeLogicalFunction.hpp @@ -22,12 +22,19 @@ namespace NES { /** - * @brief Tests if Quadbin cell a is less than or equal to b. + * @brief Quadbin le comparison + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `quadbin_le((Quadbin)a, (Quadbin)b)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class QuadbinLeLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "QuadbinLe"; - QuadbinLeLogicalFunction(LogicalFunction a, LogicalFunction b); + + QuadbinLeLogicalFunction(LogicalFunction a, + LogicalFunction b); + DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; std::vector getChildren() const override; @@ -37,6 +44,7 @@ class QuadbinLeLogicalFunction : public LogicalFunctionConcept { std::string explain(ExplainVerbosity verbosity) const override; LogicalFunction withInferredDataType(const Schema& schema) const override; SerializableFunction serialize() const override; + private: DataType dataType; std::vector parameters; diff --git a/nes-logical-operators/include/Functions/Meos/QuadbinLtLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/QuadbinLtLogicalFunction.hpp index ac8110aaf9..2c81b3c68b 100644 --- a/nes-logical-operators/include/Functions/Meos/QuadbinLtLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/QuadbinLtLogicalFunction.hpp @@ -22,12 +22,19 @@ namespace NES { /** - * @brief Tests if Quadbin cell a is less than b. + * @brief Quadbin lt comparison + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `quadbin_lt((Quadbin)a, (Quadbin)b)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class QuadbinLtLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "QuadbinLt"; - QuadbinLtLogicalFunction(LogicalFunction a, LogicalFunction b); + + QuadbinLtLogicalFunction(LogicalFunction a, + LogicalFunction b); + DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; std::vector getChildren() const override; @@ -37,6 +44,7 @@ class QuadbinLtLogicalFunction : public LogicalFunctionConcept { std::string explain(ExplainVerbosity verbosity) const override; LogicalFunction withInferredDataType(const Schema& schema) const override; SerializableFunction serialize() const override; + private: DataType dataType; std::vector parameters; diff --git a/nes-logical-operators/include/Functions/Meos/QuadbinNeLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/QuadbinNeLogicalFunction.hpp index ecf57cf315..9dfa21de5e 100644 --- a/nes-logical-operators/include/Functions/Meos/QuadbinNeLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/QuadbinNeLogicalFunction.hpp @@ -22,12 +22,19 @@ namespace NES { /** - * @brief Tests inequality of two Quadbin cell identifiers. + * @brief Quadbin ne comparison + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `quadbin_ne((Quadbin)a, (Quadbin)b)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class QuadbinNeLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "QuadbinNe"; - QuadbinNeLogicalFunction(LogicalFunction a, LogicalFunction b); + + QuadbinNeLogicalFunction(LogicalFunction a, + LogicalFunction b); + DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; std::vector getChildren() const override; @@ -37,6 +44,7 @@ class QuadbinNeLogicalFunction : public LogicalFunctionConcept { std::string explain(ExplainVerbosity verbosity) const override; LogicalFunction withInferredDataType(const Schema& schema) const override; SerializableFunction serialize() const override; + private: DataType dataType; std::vector parameters; diff --git a/nes-logical-operators/include/Functions/Meos/QuadbinPointToCellLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/QuadbinPointToCellLogicalFunction.hpp index 6af0e0da1d..eac624a910 100644 --- a/nes-logical-operators/include/Functions/Meos/QuadbinPointToCellLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/QuadbinPointToCellLogicalFunction.hpp @@ -22,13 +22,19 @@ namespace NES { /** - * @brief Returns a VARCHAR for a quadbin cell. NES token: QUADBIN_POINT_TO_CELL. + * @brief Quadbin point to cell + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `quadbin_point_to_cell(lon, lat, (uint32_t)res)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class QuadbinPointToCellLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "QuadbinPointToCell"; - QuadbinPointToCellLogicalFunction(LogicalFunction lon, LogicalFunction lat, LogicalFunction res); + QuadbinPointToCellLogicalFunction(LogicalFunction lon, + LogicalFunction lat, + LogicalFunction res); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/QuadbinTileToCellLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/QuadbinTileToCellLogicalFunction.hpp index d655955c70..0abf2b20df 100644 --- a/nes-logical-operators/include/Functions/Meos/QuadbinTileToCellLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/QuadbinTileToCellLogicalFunction.hpp @@ -22,13 +22,19 @@ namespace NES { /** - * @brief Returns a VARCHAR for a quadbin cell. NES token: QUADBIN_TILE_TO_CELL. + * @brief Quadbin tile to cell + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `quadbin_tile_to_cell((uint32_t)x, (uint32_t)y, (uint32_t)z)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class QuadbinTileToCellLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "QuadbinTileToCell"; - QuadbinTileToCellLogicalFunction(LogicalFunction x, LogicalFunction y, LogicalFunction z); + QuadbinTileToCellLogicalFunction(LogicalFunction x, + LogicalFunction y, + LogicalFunction z); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/SubBigintTbigintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/SubBigintTbigintLogicalFunction.hpp index dfd0d17747..1bcaf5d1a6 100644 --- a/nes-logical-operators/include/Functions/Meos/SubBigintTbigintLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/SubBigintTbigintLogicalFunction.hpp @@ -22,19 +22,19 @@ namespace NES { /** - * @brief Per-event sub_bigint_tbigint: subtracts a single-instant tbigint value from a constant int64 scalar. + * @brief Per-event sub_bigint_tbigint: scalar bigint minus single-instant tbigint. * * Generated by tools/codegen/codegen_nebula.py from the MEOS function - * `sub_bigint_tbigint`. Takes (scalar:FLOAT64→int64, value:FLOAT64, ts:UINT64), - * constructs a single-instant temporal, applies the subtraction, and returns FLOAT64. + * `sub_bigint_tbigint`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class SubBigintTbigintLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "SubBigintTbigint"; - SubBigintTbigintLogicalFunction(LogicalFunction scalar, - LogicalFunction value, - LogicalFunction ts); + SubBigintTbigintLogicalFunction(LogicalFunction arg0, + LogicalFunction value, + LogicalFunction ts); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/SubFloatTfloatLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/SubFloatTfloatLogicalFunction.hpp index a0ec1c5683..4a31429c37 100644 --- a/nes-logical-operators/include/Functions/Meos/SubFloatTfloatLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/SubFloatTfloatLogicalFunction.hpp @@ -22,19 +22,19 @@ namespace NES { /** - * @brief Per-event sub_float_tfloat: subtracts a single-instant tfloat value from a constant. + * @brief Per-event sub_float_tfloat: scalar float minus single-instant tfloat. * * Generated by tools/codegen/codegen_nebula.py from the MEOS function - * `sub_float_tfloat`. Takes (scalar:FLOAT64, value:FLOAT64, ts:UINT64), - * constructs a single-instant temporal, applies the subtraction, and returns FLOAT64. + * `sub_float_tfloat`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class SubFloatTfloatLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "SubFloatTfloat"; - SubFloatTfloatLogicalFunction(LogicalFunction scalar, - LogicalFunction value, - LogicalFunction ts); + SubFloatTfloatLogicalFunction(LogicalFunction arg0, + LogicalFunction value, + LogicalFunction ts); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/SubIntTintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/SubIntTintLogicalFunction.hpp index 5e3f4a8c94..778d784e9d 100644 --- a/nes-logical-operators/include/Functions/Meos/SubIntTintLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/SubIntTintLogicalFunction.hpp @@ -22,19 +22,19 @@ namespace NES { /** - * @brief Per-event sub_int_tint: subtracts a single-instant tint value from a constant. + * @brief Per-event sub_int_tint: scalar int minus single-instant tint. * * Generated by tools/codegen/codegen_nebula.py from the MEOS function - * `sub_int_tint`. Takes (scalar:FLOAT64, value:FLOAT64, ts:UINT64), - * constructs a single-instant temporal, applies the subtraction, and returns FLOAT64. + * `sub_int_tint`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class SubIntTintLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "SubIntTint"; - SubIntTintLogicalFunction(LogicalFunction scalar, - LogicalFunction value, - LogicalFunction ts); + SubIntTintLogicalFunction(LogicalFunction arg0, + LogicalFunction value, + LogicalFunction ts); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/SubTbigintBigintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/SubTbigintBigintLogicalFunction.hpp index c1ff3f9a15..21c669aae9 100644 --- a/nes-logical-operators/include/Functions/Meos/SubTbigintBigintLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/SubTbigintBigintLogicalFunction.hpp @@ -22,19 +22,19 @@ namespace NES { /** - * @brief Per-event sub_tbigint_bigint: subtracts a constant int64 from a single-instant tbigint value. + * @brief Per-event sub_tbigint_bigint: single-instant tbigint minus scalar bigint. * * Generated by tools/codegen/codegen_nebula.py from the MEOS function - * `sub_tbigint_bigint`. Takes (value:FLOAT64, ts:UINT64, subtrahend:FLOAT64→int64), - * constructs a single-instant temporal, applies the subtraction, and returns FLOAT64. + * `sub_tbigint_bigint`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class SubTbigintBigintLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "SubTbigintBigint"; SubTbigintBigintLogicalFunction(LogicalFunction value, - LogicalFunction ts, - LogicalFunction subtrahend); + LogicalFunction ts, + LogicalFunction arg0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/SubTfloatFloatLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/SubTfloatFloatLogicalFunction.hpp index ea5a1a9d26..6e57654eae 100644 --- a/nes-logical-operators/include/Functions/Meos/SubTfloatFloatLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/SubTfloatFloatLogicalFunction.hpp @@ -22,19 +22,19 @@ namespace NES { /** - * @brief Per-event sub_tfloat_float: subtracts a constant from a single-instant tfloat value. + * @brief Per-event sub_tfloat_float: single-instant tfloat minus scalar float. * * Generated by tools/codegen/codegen_nebula.py from the MEOS function - * `sub_tfloat_float`. Takes (value:FLOAT64, ts:UINT64, subtrahend:FLOAT64), - * constructs a single-instant temporal, applies the subtraction, and returns FLOAT64. + * `sub_tfloat_float`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class SubTfloatFloatLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "SubTfloatFloat"; SubTfloatFloatLogicalFunction(LogicalFunction value, - LogicalFunction ts, - LogicalFunction subtrahend); + LogicalFunction ts, + LogicalFunction arg0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/SubTintIntLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/SubTintIntLogicalFunction.hpp index 49c77fc4d3..4927dba90e 100644 --- a/nes-logical-operators/include/Functions/Meos/SubTintIntLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/SubTintIntLogicalFunction.hpp @@ -22,19 +22,19 @@ namespace NES { /** - * @brief Per-event sub_tint_int: subtracts a constant integer from a single-instant tint value. + * @brief Per-event sub_tint_int: single-instant tint minus scalar int. * * Generated by tools/codegen/codegen_nebula.py from the MEOS function - * `sub_tint_int`. Takes (value:FLOAT64, ts:UINT64, subtrahend:FLOAT64→int), - * constructs a single-instant temporal, applies the subtraction, and returns FLOAT64. + * `sub_tint_int`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class SubTintIntLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "SubTintInt"; SubTintIntLogicalFunction(LogicalFunction value, - LogicalFunction ts, - LogicalFunction subtrahend); + LogicalFunction ts, + LogicalFunction arg0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/SubTnumberTnumberLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/SubTnumberTnumberLogicalFunction.hpp index 94891a2836..46619f61fa 100644 --- a/nes-logical-operators/include/Functions/Meos/SubTnumberTnumberLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/SubTnumberTnumberLogicalFunction.hpp @@ -22,19 +22,18 @@ namespace NES { /** - * @brief Per-event sub_tnumber_tnumber: element-wise subtraction of two single-instant tnumbers. + * @brief Per-event sub_tnumber_tnumber: two temporal numbers subtracted (WKB result). * * Generated by tools/codegen/codegen_nebula.py from the MEOS function - * `sub_tnumber_tnumber`. Takes (value1:FLOAT64, value2:FLOAT64, ts:UINT64), - * constructs two co-instant temporals, applies the subtraction, and returns FLOAT64. + * `sub_tnumber_tnumber`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class SubTnumberTnumberLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "SubTnumberTnumber"; - SubTnumberTnumberLogicalFunction(LogicalFunction value1, - LogicalFunction value2, - LogicalFunction ts); + SubTnumberTnumberLogicalFunction(LogicalFunction traj, + LogicalFunction arg0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/TEqTextTtextLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TEqTextTtextLogicalFunction.hpp new file mode 100644 index 0000000000..476c0ed8f1 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TEqTextTtextLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Temporal eqqual text vs ttext + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `teq_text_ttext(txt0, temp)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. + */ +class TEqTextTtextLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TEqTextTtext"; + + TEqTextTtextLogicalFunction(LogicalFunction arg0, + LogicalFunction value, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TEqTtextTextLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TEqTtextTextLogicalFunction.hpp new file mode 100644 index 0000000000..b8c82f691f --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TEqTtextTextLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Temporal eqqual ttext vs text + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `teq_ttext_text(temp, txt0)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. + */ +class TEqTtextTextLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TEqTtextText"; + + TEqTtextTextLogicalFunction(LogicalFunction value, + LogicalFunction ts, + LogicalFunction arg0); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TGeTextTtextLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TGeTextTtextLogicalFunction.hpp new file mode 100644 index 0000000000..33b36d0741 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TGeTextTtextLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Temporal ge text vs ttext + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `tge_text_ttext(txt0, temp)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. + */ +class TGeTextTtextLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TGeTextTtext"; + + TGeTextTtextLogicalFunction(LogicalFunction arg0, + LogicalFunction value, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TGeTtextTextLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TGeTtextTextLogicalFunction.hpp new file mode 100644 index 0000000000..4965a1a3c0 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TGeTtextTextLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Temporal ge ttext vs text + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `tge_ttext_text(temp, txt0)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. + */ +class TGeTtextTextLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TGeTtextText"; + + TGeTtextTextLogicalFunction(LogicalFunction value, + LogicalFunction ts, + LogicalFunction arg0); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TGtTextTtextLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TGtTextTtextLogicalFunction.hpp new file mode 100644 index 0000000000..a0d34e9471 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TGtTextTtextLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Temporal gt text vs ttext + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `tgt_text_ttext(txt0, temp)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. + */ +class TGtTextTtextLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TGtTextTtext"; + + TGtTextTtextLogicalFunction(LogicalFunction arg0, + LogicalFunction value, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TGtTtextTextLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TGtTtextTextLogicalFunction.hpp new file mode 100644 index 0000000000..68eb471e81 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TGtTtextTextLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Temporal gt ttext vs text + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `tgt_ttext_text(temp, txt0)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. + */ +class TGtTtextTextLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TGtTtextText"; + + TGtTtextTextLogicalFunction(LogicalFunction value, + LogicalFunction ts, + LogicalFunction arg0); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TLeTextTtextLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TLeTextTtextLogicalFunction.hpp new file mode 100644 index 0000000000..182fe3eccf --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TLeTextTtextLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Temporal le text vs ttext + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `tle_text_ttext(txt0, temp)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. + */ +class TLeTextTtextLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TLeTextTtext"; + + TLeTextTtextLogicalFunction(LogicalFunction arg0, + LogicalFunction value, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TLeTtextTextLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TLeTtextTextLogicalFunction.hpp new file mode 100644 index 0000000000..62513fc42a --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TLeTtextTextLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Temporal le ttext vs text + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `tle_ttext_text(temp, txt0)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. + */ +class TLeTtextTextLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TLeTtextText"; + + TLeTtextTextLogicalFunction(LogicalFunction value, + LogicalFunction ts, + LogicalFunction arg0); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TLtTextTtextLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TLtTextTtextLogicalFunction.hpp new file mode 100644 index 0000000000..36c99ddfa9 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TLtTextTtextLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Temporal lt text vs ttext + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `tlt_text_ttext(txt0, temp)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. + */ +class TLtTextTtextLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TLtTextTtext"; + + TLtTextTtextLogicalFunction(LogicalFunction arg0, + LogicalFunction value, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TLtTtextTextLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TLtTtextTextLogicalFunction.hpp new file mode 100644 index 0000000000..18e9f55fb7 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TLtTtextTextLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Temporal lt ttext vs text + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `tlt_ttext_text(temp, txt0)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. + */ +class TLtTtextTextLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TLtTtextText"; + + TLtTtextTextLogicalFunction(LogicalFunction value, + LogicalFunction ts, + LogicalFunction arg0); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TNeTextTtextLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TNeTextTtextLogicalFunction.hpp new file mode 100644 index 0000000000..df4c7de807 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TNeTextTtextLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Temporal nequal text vs ttext + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `tne_text_ttext(txt0, temp)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. + */ +class TNeTextTtextLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TNeTextTtext"; + + TNeTextTtextLogicalFunction(LogicalFunction arg0, + LogicalFunction value, + LogicalFunction ts); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TNeTtextTextLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TNeTtextTextLogicalFunction.hpp new file mode 100644 index 0000000000..252fe2b046 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TNeTtextTextLogicalFunction.hpp @@ -0,0 +1,54 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Temporal nequal ttext vs text + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `tne_ttext_text(temp, txt0)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. + */ +class TNeTtextTextLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TNeTtextText"; + + TNeTtextTextLogicalFunction(LogicalFunction value, + LogicalFunction ts, + LogicalFunction arg0); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TandBoolTboolLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TandBoolTboolLogicalFunction.hpp index eae9d72a0c..1f826f50ca 100644 --- a/nes-logical-operators/include/Functions/Meos/TandBoolTboolLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/TandBoolTboolLogicalFunction.hpp @@ -22,19 +22,19 @@ namespace NES { /** - * @brief Per-event tand_bool_tbool: AND of a scalar bool and a single-instant tbool. + * @brief Per-event tand_bool_tbool: temporal AND of scalar bool and tbool. * * Generated by tools/codegen/codegen_nebula.py from the MEOS function - * `tand_bool_tbool`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), - * constructs a single-instant temporal, applies the operation, and returns FLOAT64 (0.0/1.0). + * `tand_bool_tbool`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class TandBoolTboolLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "TandBoolTbool"; - TandBoolTboolLogicalFunction(LogicalFunction value, - LogicalFunction threshold, - LogicalFunction ts); + TandBoolTboolLogicalFunction(LogicalFunction arg0, + LogicalFunction value, + LogicalFunction ts); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/TandTboolBoolLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TandTboolBoolLogicalFunction.hpp index f7e834a10a..0fca5bbe69 100644 --- a/nes-logical-operators/include/Functions/Meos/TandTboolBoolLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/TandTboolBoolLogicalFunction.hpp @@ -22,19 +22,19 @@ namespace NES { /** - * @brief Per-event tand_tbool_bool: AND of a single-instant tbool and a scalar bool. + * @brief Per-event tand_tbool_bool: temporal AND of tbool and scalar bool. * * Generated by tools/codegen/codegen_nebula.py from the MEOS function - * `tand_tbool_bool`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), - * constructs a single-instant temporal, applies the operation, and returns FLOAT64 (0.0/1.0). + * `tand_tbool_bool`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class TandTboolBoolLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "TandTboolBool"; TandTboolBoolLogicalFunction(LogicalFunction value, - LogicalFunction threshold, - LogicalFunction ts); + LogicalFunction ts, + LogicalFunction arg0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/TandTboolTboolLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TandTboolTboolLogicalFunction.hpp index 1c5dd6679c..7c449afd49 100644 --- a/nes-logical-operators/include/Functions/Meos/TandTboolTboolLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/TandTboolTboolLogicalFunction.hpp @@ -22,19 +22,18 @@ namespace NES { /** - * @brief Per-event tand_tbool_tbool: AND of two single-instant tbools. + * @brief Per-event tand_tbool_tbool: temporal AND of two tbool values (WKB result). * * Generated by tools/codegen/codegen_nebula.py from the MEOS function - * `tand_tbool_tbool`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), - * constructs a single-instant temporal, applies the operation, and returns FLOAT64 (0.0/1.0). + * `tand_tbool_tbool`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class TandTboolTboolLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "TandTboolTbool"; - TandTboolTboolLogicalFunction(LogicalFunction value, - LogicalFunction threshold, - LogicalFunction ts); + TandTboolTboolLogicalFunction(LogicalFunction traj, + LogicalFunction arg0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/TbigintScaleValueLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TbigintScaleValueLogicalFunction.hpp index 5bac4a42f7..1927f797b6 100644 --- a/nes-logical-operators/include/Functions/Meos/TbigintScaleValueLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/TbigintScaleValueLogicalFunction.hpp @@ -22,19 +22,19 @@ namespace NES { /** - * @brief Per-event tbigint_scale_value: scales a single-instant tbigint to a given int64_t width. + * @brief Per-event tbigint_scale_value: scale single-instant tbigint value by scalar. * * Generated by tools/codegen/codegen_nebula.py from the MEOS function - * `tbigint_scale_value`. Takes (value:FLOAT64, ts:UINT64, width:FLOAT64→int64_t), - * constructs a single-instant temporal, applies the scale, and returns FLOAT64. + * `tbigint_scale_value`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class TbigintScaleValueLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "TbigintScaleValue"; TbigintScaleValueLogicalFunction(LogicalFunction value, - LogicalFunction ts, - LogicalFunction width); + LogicalFunction ts, + LogicalFunction arg0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/TbigintShiftScaleValueLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TbigintShiftScaleValueLogicalFunction.hpp index 5dde046e33..265d68beeb 100644 --- a/nes-logical-operators/include/Functions/Meos/TbigintShiftScaleValueLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/TbigintShiftScaleValueLogicalFunction.hpp @@ -22,11 +22,11 @@ namespace NES { /** - * @brief Per-event tbigint_shift_scale_value: shifts and scales a single-instant tbigint. + * @brief Per-event tbigint_shift_scale_value: shift then scale single-instant tbigint value. * * Generated by tools/codegen/codegen_nebula.py from the MEOS function - * `tbigint_shift_scale_value`. Takes (value:FLOAT64, ts:UINT64, shift:FLOAT64→int64_t, width:FLOAT64→int64_t), - * constructs a single-instant temporal, applies the shift-and-scale, and returns FLOAT64. + * `tbigint_shift_scale_value`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class TbigintShiftScaleValueLogicalFunction : public LogicalFunctionConcept { public: @@ -34,8 +34,8 @@ class TbigintShiftScaleValueLogicalFunction : public LogicalFunctionConcept { TbigintShiftScaleValueLogicalFunction(LogicalFunction value, LogicalFunction ts, - LogicalFunction shift, - LogicalFunction width); + LogicalFunction arg0, + LogicalFunction arg1); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/TbigintShiftValueLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TbigintShiftValueLogicalFunction.hpp index 0944b75091..ecbd021107 100644 --- a/nes-logical-operators/include/Functions/Meos/TbigintShiftValueLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/TbigintShiftValueLogicalFunction.hpp @@ -22,19 +22,19 @@ namespace NES { /** - * @brief Per-event tbigint_shift_value: shifts a single-instant tbigint by a constant int64_t. + * @brief Per-event tbigint_shift_value: shift single-instant tbigint value by scalar. * * Generated by tools/codegen/codegen_nebula.py from the MEOS function - * `tbigint_shift_value`. Takes (value:FLOAT64, ts:UINT64, shift:FLOAT64→int64_t), - * constructs a single-instant temporal, applies the shift, and returns FLOAT64. + * `tbigint_shift_value`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class TbigintShiftValueLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "TbigintShiftValue"; TbigintShiftValueLogicalFunction(LogicalFunction value, - LogicalFunction ts, - LogicalFunction shift); + LogicalFunction ts, + LogicalFunction arg0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/TbigintToTfloatLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TbigintToTfloatLogicalFunction.hpp index aafccec021..9023a8bf83 100644 --- a/nes-logical-operators/include/Functions/Meos/TbigintToTfloatLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/TbigintToTfloatLogicalFunction.hpp @@ -22,18 +22,18 @@ namespace NES { /** - * @brief Per-event tbigint_to_tfloat: converts a single-instant tbigint to tfloat, returns FLOAT64. + * @brief Per-event tbigint_to_tfloat: convert single-instant tbigint to tfloat. * * Generated by tools/codegen/codegen_nebula.py from the MEOS function - * `tbigint_to_tfloat`. Takes (value:FLOAT64, ts:UINT64), constructs a single-instant - * temporal bigint, widens to float, and returns FLOAT64. + * `tbigint_to_tfloat`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class TbigintToTfloatLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "TbigintToTfloat"; TbigintToTfloatLogicalFunction(LogicalFunction value, - LogicalFunction ts); + LogicalFunction ts); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/TbigintToTintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TbigintToTintLogicalFunction.hpp index 78e9cbb7d3..80a961d5af 100644 --- a/nes-logical-operators/include/Functions/Meos/TbigintToTintLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/TbigintToTintLogicalFunction.hpp @@ -22,18 +22,18 @@ namespace NES { /** - * @brief Per-event tbigint_to_tint: converts a single-instant tbigint to tint, returns FLOAT64. + * @brief Per-event tbigint_to_tint: convert single-instant tbigint to tint. * * Generated by tools/codegen/codegen_nebula.py from the MEOS function - * `tbigint_to_tint`. Takes (value:FLOAT64, ts:UINT64), constructs a single-instant - * temporal bigint, narrows to integer, and returns FLOAT64. + * `tbigint_to_tint`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class TbigintToTintLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "TbigintToTint"; TbigintToTintLogicalFunction(LogicalFunction value, - LogicalFunction ts); + LogicalFunction ts); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/TboolToTintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TboolToTintLogicalFunction.hpp index 08065ed414..edaadef42e 100644 --- a/nes-logical-operators/include/Functions/Meos/TboolToTintLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/TboolToTintLogicalFunction.hpp @@ -22,7 +22,7 @@ namespace NES { /** - * @brief Per-event tbool_to_tint: single-instant tbool cast to tint, result extracted -> double. + * @brief Per-event tbool_to_tint: convert single-instant tbool to tint. * * Generated by tools/codegen/codegen_nebula.py from the MEOS function * `tbool_to_tint`. Per-event scalar operator following the @@ -33,7 +33,7 @@ class TboolToTintLogicalFunction : public LogicalFunctionConcept { static constexpr std::string_view NAME = "TboolToTint"; TboolToTintLogicalFunction(LogicalFunction value, - LogicalFunction ts); + LogicalFunction ts); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/TdistanceTfloatFloatLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TdistanceTfloatFloatLogicalFunction.hpp index 0404bd65b5..1c3e73ccea 100644 --- a/nes-logical-operators/include/Functions/Meos/TdistanceTfloatFloatLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/TdistanceTfloatFloatLogicalFunction.hpp @@ -22,19 +22,19 @@ namespace NES { /** - * @brief Per-event tdistance_tfloat_float: distance between a single-instant tfloat and a float. + * @brief Per-event tdistance_tfloat_float: temporal distance between tfloat and scalar float. * * Generated by tools/codegen/codegen_nebula.py from the MEOS function - * `tdistance_tfloat_float`. Takes (value:FLOAT64, ts:UINT64, d:FLOAT64), - * constructs a single-instant temporal, applies the distance function, and returns FLOAT64. + * `tdistance_tfloat_float`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class TdistanceTfloatFloatLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "TdistanceTfloatFloat"; TdistanceTfloatFloatLogicalFunction(LogicalFunction value, - LogicalFunction ts, - LogicalFunction d); + LogicalFunction ts, + LogicalFunction arg0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/TdistanceTintIntLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TdistanceTintIntLogicalFunction.hpp index a8baa981f0..1e53f1fcd0 100644 --- a/nes-logical-operators/include/Functions/Meos/TdistanceTintIntLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/TdistanceTintIntLogicalFunction.hpp @@ -22,19 +22,19 @@ namespace NES { /** - * @brief Per-event tdistance_tint_int: distance between a single-instant tint and an integer. + * @brief Per-event tdistance_tint_int: temporal distance between tint and scalar int. * * Generated by tools/codegen/codegen_nebula.py from the MEOS function - * `tdistance_tint_int`. Takes (value:FLOAT64, ts:UINT64, d:FLOAT64→int), - * constructs a single-instant temporal, applies the distance function, and returns FLOAT64. + * `tdistance_tint_int`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class TdistanceTintIntLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "TdistanceTintInt"; TdistanceTintIntLogicalFunction(LogicalFunction value, - LogicalFunction ts, - LogicalFunction d); + LogicalFunction ts, + LogicalFunction arg0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/TdistanceTnumberTnumberLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TdistanceTnumberTnumberLogicalFunction.hpp index 1f9f544348..aee925f62f 100644 --- a/nes-logical-operators/include/Functions/Meos/TdistanceTnumberTnumberLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/TdistanceTnumberTnumberLogicalFunction.hpp @@ -22,19 +22,18 @@ namespace NES { /** - * @brief Per-event tdistance_tnumber_tnumber: distance between two co-instant tnumber values. + * @brief Per-event tdistance_tnumber_tnumber: temporal distance between two tnumbers (WKB result). * * Generated by tools/codegen/codegen_nebula.py from the MEOS function - * `tdistance_tnumber_tnumber`. Takes (value1:FLOAT64, value2:FLOAT64, ts:UINT64), - * constructs two co-instant temporals, applies the distance function, and returns FLOAT64. + * `tdistance_tnumber_tnumber`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class TdistanceTnumberTnumberLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "TdistanceTnumberTnumber"; - TdistanceTnumberTnumberLogicalFunction(LogicalFunction value1, - LogicalFunction value2, - LogicalFunction ts); + TdistanceTnumberTnumberLogicalFunction(LogicalFunction traj, + LogicalFunction arg0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/TemporalAContainsTNpointGeometryLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TemporalAContainsTNpointGeometryLogicalFunction.hpp new file mode 100644 index 0000000000..377708047d --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TemporalAContainsTNpointGeometryLogicalFunction.hpp @@ -0,0 +1,55 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event acontains_tgeo_geo via tnpoint→tgeompoint composition. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `acontains_tgeo_geo`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. + */ +class TemporalAContainsTNpointGeometryLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TemporalAContainsTNpointGeometry"; + + TemporalAContainsTNpointGeometryLogicalFunction(LogicalFunction rid, + LogicalFunction fraction, + LogicalFunction timestamp, + LogicalFunction geometry); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TemporalAContainsTNpointTNpointLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TemporalAContainsTNpointTNpointLogicalFunction.hpp new file mode 100644 index 0000000000..ffe53d096d --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TemporalAContainsTNpointTNpointLogicalFunction.hpp @@ -0,0 +1,57 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event acontains_tgeo_tgeo via tnpoint×tnpoint→tgeompoint composition. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `acontains_tgeo_tgeo`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. + */ +class TemporalAContainsTNpointTNpointLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TemporalAContainsTNpointTNpoint"; + + TemporalAContainsTNpointTNpointLogicalFunction(LogicalFunction ridA, + LogicalFunction fractionA, + LogicalFunction tsA, + LogicalFunction ridB, + LogicalFunction fractionB, + LogicalFunction tsB); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TemporalAContainsTPoseGeometryLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TemporalAContainsTPoseGeometryLogicalFunction.hpp new file mode 100644 index 0000000000..df1a06fe14 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TemporalAContainsTPoseGeometryLogicalFunction.hpp @@ -0,0 +1,56 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event acontains_tgeo_geo via tpose→tgeompoint composition. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `acontains_tgeo_geo`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. + */ +class TemporalAContainsTPoseGeometryLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TemporalAContainsTPoseGeometry"; + + TemporalAContainsTPoseGeometryLogicalFunction(LogicalFunction x, + LogicalFunction y, + LogicalFunction theta, + LogicalFunction timestamp, + LogicalFunction geometry); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TemporalAContainsTPoseTPoseLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TemporalAContainsTPoseTPoseLogicalFunction.hpp new file mode 100644 index 0000000000..c891594864 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TemporalAContainsTPoseTPoseLogicalFunction.hpp @@ -0,0 +1,59 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event acontains_tgeo_tgeo via tpose×tpose→tgeompoint composition. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `acontains_tgeo_tgeo`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. + */ +class TemporalAContainsTPoseTPoseLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TemporalAContainsTPoseTPose"; + + TemporalAContainsTPoseTPoseLogicalFunction(LogicalFunction xA, + LogicalFunction yA, + LogicalFunction thetaA, + LogicalFunction tsA, + LogicalFunction xB, + LogicalFunction yB, + LogicalFunction thetaB, + LogicalFunction tsB); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TemporalADWithinTNpointGeometryLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TemporalADWithinTNpointGeometryLogicalFunction.hpp new file mode 100644 index 0000000000..7cf7ca205e --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TemporalADWithinTNpointGeometryLogicalFunction.hpp @@ -0,0 +1,56 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event adwithin_tgeo_geo via tnpoint→tgeompoint composition. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `adwithin_tgeo_geo`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. + */ +class TemporalADWithinTNpointGeometryLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TemporalADWithinTNpointGeometry"; + + TemporalADWithinTNpointGeometryLogicalFunction(LogicalFunction rid, + LogicalFunction fraction, + LogicalFunction timestamp, + LogicalFunction geometry, + LogicalFunction dist); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TemporalADWithinTNpointTNpointLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TemporalADWithinTNpointTNpointLogicalFunction.hpp new file mode 100644 index 0000000000..5ebd99870e --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TemporalADWithinTNpointTNpointLogicalFunction.hpp @@ -0,0 +1,58 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event adwithin_tgeo_tgeo via tnpoint×tnpoint→tgeompoint composition. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `adwithin_tgeo_tgeo`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. + */ +class TemporalADWithinTNpointTNpointLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TemporalADWithinTNpointTNpoint"; + + TemporalADWithinTNpointTNpointLogicalFunction(LogicalFunction ridA, + LogicalFunction fractionA, + LogicalFunction tsA, + LogicalFunction ridB, + LogicalFunction fractionB, + LogicalFunction tsB, + LogicalFunction dist); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TemporalADWithinTPoseGeometryLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TemporalADWithinTPoseGeometryLogicalFunction.hpp new file mode 100644 index 0000000000..834cbb9797 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TemporalADWithinTPoseGeometryLogicalFunction.hpp @@ -0,0 +1,57 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event adwithin_tgeo_geo via tpose→tgeompoint composition. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `adwithin_tgeo_geo`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. + */ +class TemporalADWithinTPoseGeometryLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TemporalADWithinTPoseGeometry"; + + TemporalADWithinTPoseGeometryLogicalFunction(LogicalFunction x, + LogicalFunction y, + LogicalFunction theta, + LogicalFunction timestamp, + LogicalFunction geometry, + LogicalFunction dist); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TemporalADWithinTPoseTPoseLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TemporalADWithinTPoseTPoseLogicalFunction.hpp new file mode 100644 index 0000000000..d5c230df56 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TemporalADWithinTPoseTPoseLogicalFunction.hpp @@ -0,0 +1,60 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event adwithin_tgeo_tgeo via tpose×tpose→tgeompoint composition. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `adwithin_tgeo_tgeo`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. + */ +class TemporalADWithinTPoseTPoseLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TemporalADWithinTPoseTPose"; + + TemporalADWithinTPoseTPoseLogicalFunction(LogicalFunction xA, + LogicalFunction yA, + LogicalFunction thetaA, + LogicalFunction tsA, + LogicalFunction xB, + LogicalFunction yB, + LogicalFunction thetaB, + LogicalFunction tsB, + LogicalFunction dist); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TemporalADisjointTNpointGeometryLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TemporalADisjointTNpointGeometryLogicalFunction.hpp new file mode 100644 index 0000000000..c7cce6db52 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TemporalADisjointTNpointGeometryLogicalFunction.hpp @@ -0,0 +1,55 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event adisjoint_tgeo_geo via tnpoint→tgeompoint composition. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `adisjoint_tgeo_geo`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. + */ +class TemporalADisjointTNpointGeometryLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TemporalADisjointTNpointGeometry"; + + TemporalADisjointTNpointGeometryLogicalFunction(LogicalFunction rid, + LogicalFunction fraction, + LogicalFunction timestamp, + LogicalFunction geometry); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TemporalADisjointTNpointTNpointLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TemporalADisjointTNpointTNpointLogicalFunction.hpp new file mode 100644 index 0000000000..eda18f53de --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TemporalADisjointTNpointTNpointLogicalFunction.hpp @@ -0,0 +1,57 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event adisjoint_tgeo_tgeo via tnpoint×tnpoint→tgeompoint composition. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `adisjoint_tgeo_tgeo`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. + */ +class TemporalADisjointTNpointTNpointLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TemporalADisjointTNpointTNpoint"; + + TemporalADisjointTNpointTNpointLogicalFunction(LogicalFunction ridA, + LogicalFunction fractionA, + LogicalFunction tsA, + LogicalFunction ridB, + LogicalFunction fractionB, + LogicalFunction tsB); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TemporalADisjointTPoseGeometryLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TemporalADisjointTPoseGeometryLogicalFunction.hpp new file mode 100644 index 0000000000..ace0b13740 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TemporalADisjointTPoseGeometryLogicalFunction.hpp @@ -0,0 +1,56 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event adisjoint_tgeo_geo via tpose→tgeompoint composition. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `adisjoint_tgeo_geo`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. + */ +class TemporalADisjointTPoseGeometryLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TemporalADisjointTPoseGeometry"; + + TemporalADisjointTPoseGeometryLogicalFunction(LogicalFunction x, + LogicalFunction y, + LogicalFunction theta, + LogicalFunction timestamp, + LogicalFunction geometry); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TemporalADisjointTPoseTPoseLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TemporalADisjointTPoseTPoseLogicalFunction.hpp new file mode 100644 index 0000000000..d9f06054c6 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TemporalADisjointTPoseTPoseLogicalFunction.hpp @@ -0,0 +1,59 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event adisjoint_tgeo_tgeo via tpose×tpose→tgeompoint composition. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `adisjoint_tgeo_tgeo`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. + */ +class TemporalADisjointTPoseTPoseLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TemporalADisjointTPoseTPose"; + + TemporalADisjointTPoseTPoseLogicalFunction(LogicalFunction xA, + LogicalFunction yA, + LogicalFunction thetaA, + LogicalFunction tsA, + LogicalFunction xB, + LogicalFunction yB, + LogicalFunction thetaB, + LogicalFunction tsB); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TemporalAIntersectsTNpointGeometryLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TemporalAIntersectsTNpointGeometryLogicalFunction.hpp new file mode 100644 index 0000000000..0bdfc9a214 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TemporalAIntersectsTNpointGeometryLogicalFunction.hpp @@ -0,0 +1,55 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event aintersects_tgeo_geo via tnpoint→tgeompoint composition. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `aintersects_tgeo_geo`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. + */ +class TemporalAIntersectsTNpointGeometryLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TemporalAIntersectsTNpointGeometry"; + + TemporalAIntersectsTNpointGeometryLogicalFunction(LogicalFunction rid, + LogicalFunction fraction, + LogicalFunction timestamp, + LogicalFunction geometry); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TemporalAIntersectsTNpointTNpointLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TemporalAIntersectsTNpointTNpointLogicalFunction.hpp new file mode 100644 index 0000000000..d312194f4d --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TemporalAIntersectsTNpointTNpointLogicalFunction.hpp @@ -0,0 +1,57 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event aintersects_tgeo_tgeo via tnpoint×tnpoint→tgeompoint composition. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `aintersects_tgeo_tgeo`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. + */ +class TemporalAIntersectsTNpointTNpointLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TemporalAIntersectsTNpointTNpoint"; + + TemporalAIntersectsTNpointTNpointLogicalFunction(LogicalFunction ridA, + LogicalFunction fractionA, + LogicalFunction tsA, + LogicalFunction ridB, + LogicalFunction fractionB, + LogicalFunction tsB); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TemporalAIntersectsTPoseGeometryLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TemporalAIntersectsTPoseGeometryLogicalFunction.hpp new file mode 100644 index 0000000000..2568833d22 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TemporalAIntersectsTPoseGeometryLogicalFunction.hpp @@ -0,0 +1,56 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event aintersects_tgeo_geo via tpose→tgeompoint composition. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `aintersects_tgeo_geo`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. + */ +class TemporalAIntersectsTPoseGeometryLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TemporalAIntersectsTPoseGeometry"; + + TemporalAIntersectsTPoseGeometryLogicalFunction(LogicalFunction x, + LogicalFunction y, + LogicalFunction theta, + LogicalFunction timestamp, + LogicalFunction geometry); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TemporalAIntersectsTPoseTPoseLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TemporalAIntersectsTPoseTPoseLogicalFunction.hpp new file mode 100644 index 0000000000..43a1aba57d --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TemporalAIntersectsTPoseTPoseLogicalFunction.hpp @@ -0,0 +1,59 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event aintersects_tgeo_tgeo via tpose×tpose→tgeompoint composition. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `aintersects_tgeo_tgeo`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. + */ +class TemporalAIntersectsTPoseTPoseLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TemporalAIntersectsTPoseTPose"; + + TemporalAIntersectsTPoseTPoseLogicalFunction(LogicalFunction xA, + LogicalFunction yA, + LogicalFunction thetaA, + LogicalFunction tsA, + LogicalFunction xB, + LogicalFunction yB, + LogicalFunction thetaB, + LogicalFunction tsB); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TemporalATouchesTNpointGeometryLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TemporalATouchesTNpointGeometryLogicalFunction.hpp new file mode 100644 index 0000000000..bf137c7ef8 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TemporalATouchesTNpointGeometryLogicalFunction.hpp @@ -0,0 +1,55 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event atouches_tgeo_geo via tnpoint→tgeompoint composition. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `atouches_tgeo_geo`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. + */ +class TemporalATouchesTNpointGeometryLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TemporalATouchesTNpointGeometry"; + + TemporalATouchesTNpointGeometryLogicalFunction(LogicalFunction rid, + LogicalFunction fraction, + LogicalFunction timestamp, + LogicalFunction geometry); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TemporalATouchesTNpointTNpointLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TemporalATouchesTNpointTNpointLogicalFunction.hpp new file mode 100644 index 0000000000..380df092f3 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TemporalATouchesTNpointTNpointLogicalFunction.hpp @@ -0,0 +1,57 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event atouches_tgeo_tgeo via tnpoint×tnpoint→tgeompoint composition. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `atouches_tgeo_tgeo`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. + */ +class TemporalATouchesTNpointTNpointLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TemporalATouchesTNpointTNpoint"; + + TemporalATouchesTNpointTNpointLogicalFunction(LogicalFunction ridA, + LogicalFunction fractionA, + LogicalFunction tsA, + LogicalFunction ridB, + LogicalFunction fractionB, + LogicalFunction tsB); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TemporalATouchesTPoseGeometryLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TemporalATouchesTPoseGeometryLogicalFunction.hpp new file mode 100644 index 0000000000..b4769459ee --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TemporalATouchesTPoseGeometryLogicalFunction.hpp @@ -0,0 +1,56 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event atouches_tgeo_geo via tpose→tgeompoint composition. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `atouches_tgeo_geo`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. + */ +class TemporalATouchesTPoseGeometryLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TemporalATouchesTPoseGeometry"; + + TemporalATouchesTPoseGeometryLogicalFunction(LogicalFunction x, + LogicalFunction y, + LogicalFunction theta, + LogicalFunction timestamp, + LogicalFunction geometry); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TemporalATouchesTPoseTPoseLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TemporalATouchesTPoseTPoseLogicalFunction.hpp new file mode 100644 index 0000000000..3c61d13bfa --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TemporalATouchesTPoseTPoseLogicalFunction.hpp @@ -0,0 +1,59 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event atouches_tgeo_tgeo via tpose×tpose→tgeompoint composition. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `atouches_tgeo_tgeo`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. + */ +class TemporalATouchesTPoseTPoseLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TemporalATouchesTPoseTPose"; + + TemporalATouchesTPoseTPoseLogicalFunction(LogicalFunction xA, + LogicalFunction yA, + LogicalFunction thetaA, + LogicalFunction tsA, + LogicalFunction xB, + LogicalFunction yB, + LogicalFunction thetaB, + LogicalFunction tsB); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TemporalEContainsTNpointGeometryLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TemporalEContainsTNpointGeometryLogicalFunction.hpp new file mode 100644 index 0000000000..29d4acc169 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TemporalEContainsTNpointGeometryLogicalFunction.hpp @@ -0,0 +1,55 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event econtains_tgeo_geo via tnpoint→tgeompoint composition. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `econtains_tgeo_geo`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. + */ +class TemporalEContainsTNpointGeometryLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TemporalEContainsTNpointGeometry"; + + TemporalEContainsTNpointGeometryLogicalFunction(LogicalFunction rid, + LogicalFunction fraction, + LogicalFunction timestamp, + LogicalFunction geometry); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TemporalEContainsTNpointTNpointLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TemporalEContainsTNpointTNpointLogicalFunction.hpp new file mode 100644 index 0000000000..08382d3ee7 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TemporalEContainsTNpointTNpointLogicalFunction.hpp @@ -0,0 +1,57 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event econtains_tgeo_tgeo via tnpoint×tnpoint→tgeompoint composition. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `econtains_tgeo_tgeo`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. + */ +class TemporalEContainsTNpointTNpointLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TemporalEContainsTNpointTNpoint"; + + TemporalEContainsTNpointTNpointLogicalFunction(LogicalFunction ridA, + LogicalFunction fractionA, + LogicalFunction tsA, + LogicalFunction ridB, + LogicalFunction fractionB, + LogicalFunction tsB); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TemporalEContainsTPoseGeometryLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TemporalEContainsTPoseGeometryLogicalFunction.hpp new file mode 100644 index 0000000000..6d957099eb --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TemporalEContainsTPoseGeometryLogicalFunction.hpp @@ -0,0 +1,56 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event econtains_tgeo_geo via tpose→tgeompoint composition. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `econtains_tgeo_geo`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. + */ +class TemporalEContainsTPoseGeometryLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TemporalEContainsTPoseGeometry"; + + TemporalEContainsTPoseGeometryLogicalFunction(LogicalFunction x, + LogicalFunction y, + LogicalFunction theta, + LogicalFunction timestamp, + LogicalFunction geometry); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TemporalEContainsTPoseTPoseLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TemporalEContainsTPoseTPoseLogicalFunction.hpp new file mode 100644 index 0000000000..eccb524dbe --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TemporalEContainsTPoseTPoseLogicalFunction.hpp @@ -0,0 +1,59 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event econtains_tgeo_tgeo via tpose×tpose→tgeompoint composition. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `econtains_tgeo_tgeo`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. + */ +class TemporalEContainsTPoseTPoseLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TemporalEContainsTPoseTPose"; + + TemporalEContainsTPoseTPoseLogicalFunction(LogicalFunction xA, + LogicalFunction yA, + LogicalFunction thetaA, + LogicalFunction tsA, + LogicalFunction xB, + LogicalFunction yB, + LogicalFunction thetaB, + LogicalFunction tsB); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TemporalECoversTNpointGeometryLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TemporalECoversTNpointGeometryLogicalFunction.hpp new file mode 100644 index 0000000000..f88d43f453 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TemporalECoversTNpointGeometryLogicalFunction.hpp @@ -0,0 +1,55 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event ecovers_tgeo_geo via tnpoint→tgeompoint composition. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ecovers_tgeo_geo`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. + */ +class TemporalECoversTNpointGeometryLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TemporalECoversTNpointGeometry"; + + TemporalECoversTNpointGeometryLogicalFunction(LogicalFunction rid, + LogicalFunction fraction, + LogicalFunction timestamp, + LogicalFunction geometry); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TemporalECoversTNpointTNpointLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TemporalECoversTNpointTNpointLogicalFunction.hpp new file mode 100644 index 0000000000..462126065d --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TemporalECoversTNpointTNpointLogicalFunction.hpp @@ -0,0 +1,57 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event ecovers_tgeo_tgeo via tnpoint×tnpoint→tgeompoint composition. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ecovers_tgeo_tgeo`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. + */ +class TemporalECoversTNpointTNpointLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TemporalECoversTNpointTNpoint"; + + TemporalECoversTNpointTNpointLogicalFunction(LogicalFunction ridA, + LogicalFunction fractionA, + LogicalFunction tsA, + LogicalFunction ridB, + LogicalFunction fractionB, + LogicalFunction tsB); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TemporalECoversTPoseGeometryLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TemporalECoversTPoseGeometryLogicalFunction.hpp new file mode 100644 index 0000000000..74bc9df889 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TemporalECoversTPoseGeometryLogicalFunction.hpp @@ -0,0 +1,56 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event ecovers_tgeo_geo via tpose→tgeompoint composition. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ecovers_tgeo_geo`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. + */ +class TemporalECoversTPoseGeometryLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TemporalECoversTPoseGeometry"; + + TemporalECoversTPoseGeometryLogicalFunction(LogicalFunction x, + LogicalFunction y, + LogicalFunction theta, + LogicalFunction timestamp, + LogicalFunction geometry); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TemporalECoversTPoseTPoseLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TemporalECoversTPoseTPoseLogicalFunction.hpp new file mode 100644 index 0000000000..3ea0443143 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TemporalECoversTPoseTPoseLogicalFunction.hpp @@ -0,0 +1,59 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event ecovers_tgeo_tgeo via tpose×tpose→tgeompoint composition. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `ecovers_tgeo_tgeo`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. + */ +class TemporalECoversTPoseTPoseLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TemporalECoversTPoseTPose"; + + TemporalECoversTPoseTPoseLogicalFunction(LogicalFunction xA, + LogicalFunction yA, + LogicalFunction thetaA, + LogicalFunction tsA, + LogicalFunction xB, + LogicalFunction yB, + LogicalFunction thetaB, + LogicalFunction tsB); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TemporalEDWithinTNpointGeometryLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TemporalEDWithinTNpointGeometryLogicalFunction.hpp new file mode 100644 index 0000000000..ba11374e8c --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TemporalEDWithinTNpointGeometryLogicalFunction.hpp @@ -0,0 +1,56 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event edwithin_tgeo_geo via tnpoint→tgeompoint composition. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `edwithin_tgeo_geo`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. + */ +class TemporalEDWithinTNpointGeometryLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TemporalEDWithinTNpointGeometry"; + + TemporalEDWithinTNpointGeometryLogicalFunction(LogicalFunction rid, + LogicalFunction fraction, + LogicalFunction timestamp, + LogicalFunction geometry, + LogicalFunction dist); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TemporalEDWithinTNpointTNpointLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TemporalEDWithinTNpointTNpointLogicalFunction.hpp new file mode 100644 index 0000000000..f7f17babc8 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TemporalEDWithinTNpointTNpointLogicalFunction.hpp @@ -0,0 +1,58 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event edwithin_tgeo_tgeo via tnpoint×tnpoint→tgeompoint composition. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `edwithin_tgeo_tgeo`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. + */ +class TemporalEDWithinTNpointTNpointLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TemporalEDWithinTNpointTNpoint"; + + TemporalEDWithinTNpointTNpointLogicalFunction(LogicalFunction ridA, + LogicalFunction fractionA, + LogicalFunction tsA, + LogicalFunction ridB, + LogicalFunction fractionB, + LogicalFunction tsB, + LogicalFunction dist); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TemporalEDWithinTPoseGeometryLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TemporalEDWithinTPoseGeometryLogicalFunction.hpp new file mode 100644 index 0000000000..d1735aedc0 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TemporalEDWithinTPoseGeometryLogicalFunction.hpp @@ -0,0 +1,57 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event edwithin_tgeo_geo via tpose→tgeompoint composition. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `edwithin_tgeo_geo`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. + */ +class TemporalEDWithinTPoseGeometryLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TemporalEDWithinTPoseGeometry"; + + TemporalEDWithinTPoseGeometryLogicalFunction(LogicalFunction x, + LogicalFunction y, + LogicalFunction theta, + LogicalFunction timestamp, + LogicalFunction geometry, + LogicalFunction dist); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TemporalEDWithinTPoseTPoseLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TemporalEDWithinTPoseTPoseLogicalFunction.hpp new file mode 100644 index 0000000000..f71bef5518 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TemporalEDWithinTPoseTPoseLogicalFunction.hpp @@ -0,0 +1,60 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event edwithin_tgeo_tgeo via tpose×tpose→tgeompoint composition. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `edwithin_tgeo_tgeo`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. + */ +class TemporalEDWithinTPoseTPoseLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TemporalEDWithinTPoseTPose"; + + TemporalEDWithinTPoseTPoseLogicalFunction(LogicalFunction xA, + LogicalFunction yA, + LogicalFunction thetaA, + LogicalFunction tsA, + LogicalFunction xB, + LogicalFunction yB, + LogicalFunction thetaB, + LogicalFunction tsB, + LogicalFunction dist); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TemporalEDisjointTNpointGeometryLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TemporalEDisjointTNpointGeometryLogicalFunction.hpp new file mode 100644 index 0000000000..12b7b7ec41 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TemporalEDisjointTNpointGeometryLogicalFunction.hpp @@ -0,0 +1,55 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event edisjoint_tgeo_geo via tnpoint→tgeompoint composition. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `edisjoint_tgeo_geo`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. + */ +class TemporalEDisjointTNpointGeometryLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TemporalEDisjointTNpointGeometry"; + + TemporalEDisjointTNpointGeometryLogicalFunction(LogicalFunction rid, + LogicalFunction fraction, + LogicalFunction timestamp, + LogicalFunction geometry); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TemporalEDisjointTNpointTNpointLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TemporalEDisjointTNpointTNpointLogicalFunction.hpp new file mode 100644 index 0000000000..ddeef61d67 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TemporalEDisjointTNpointTNpointLogicalFunction.hpp @@ -0,0 +1,57 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event edisjoint_tgeo_tgeo via tnpoint×tnpoint→tgeompoint composition. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `edisjoint_tgeo_tgeo`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. + */ +class TemporalEDisjointTNpointTNpointLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TemporalEDisjointTNpointTNpoint"; + + TemporalEDisjointTNpointTNpointLogicalFunction(LogicalFunction ridA, + LogicalFunction fractionA, + LogicalFunction tsA, + LogicalFunction ridB, + LogicalFunction fractionB, + LogicalFunction tsB); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TemporalEDisjointTPoseGeometryLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TemporalEDisjointTPoseGeometryLogicalFunction.hpp new file mode 100644 index 0000000000..edba38b0bd --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TemporalEDisjointTPoseGeometryLogicalFunction.hpp @@ -0,0 +1,56 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event edisjoint_tgeo_geo via tpose→tgeompoint composition. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `edisjoint_tgeo_geo`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. + */ +class TemporalEDisjointTPoseGeometryLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TemporalEDisjointTPoseGeometry"; + + TemporalEDisjointTPoseGeometryLogicalFunction(LogicalFunction x, + LogicalFunction y, + LogicalFunction theta, + LogicalFunction timestamp, + LogicalFunction geometry); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TemporalEDisjointTPoseTPoseLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TemporalEDisjointTPoseTPoseLogicalFunction.hpp new file mode 100644 index 0000000000..0aa93982b7 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TemporalEDisjointTPoseTPoseLogicalFunction.hpp @@ -0,0 +1,59 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event edisjoint_tgeo_tgeo via tpose×tpose→tgeompoint composition. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `edisjoint_tgeo_tgeo`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. + */ +class TemporalEDisjointTPoseTPoseLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TemporalEDisjointTPoseTPose"; + + TemporalEDisjointTPoseTPoseLogicalFunction(LogicalFunction xA, + LogicalFunction yA, + LogicalFunction thetaA, + LogicalFunction tsA, + LogicalFunction xB, + LogicalFunction yB, + LogicalFunction thetaB, + LogicalFunction tsB); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TemporalEIntersectsTNpointGeometryLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TemporalEIntersectsTNpointGeometryLogicalFunction.hpp new file mode 100644 index 0000000000..02c4471fcf --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TemporalEIntersectsTNpointGeometryLogicalFunction.hpp @@ -0,0 +1,55 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event eintersects_tgeo_geo via tnpoint→tgeompoint composition. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `eintersects_tgeo_geo`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. + */ +class TemporalEIntersectsTNpointGeometryLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TemporalEIntersectsTNpointGeometry"; + + TemporalEIntersectsTNpointGeometryLogicalFunction(LogicalFunction rid, + LogicalFunction fraction, + LogicalFunction timestamp, + LogicalFunction geometry); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TemporalEIntersectsTNpointTNpointLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TemporalEIntersectsTNpointTNpointLogicalFunction.hpp new file mode 100644 index 0000000000..4c4030a205 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TemporalEIntersectsTNpointTNpointLogicalFunction.hpp @@ -0,0 +1,57 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event eintersects_tgeo_tgeo via tnpoint×tnpoint→tgeompoint composition. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `eintersects_tgeo_tgeo`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. + */ +class TemporalEIntersectsTNpointTNpointLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TemporalEIntersectsTNpointTNpoint"; + + TemporalEIntersectsTNpointTNpointLogicalFunction(LogicalFunction ridA, + LogicalFunction fractionA, + LogicalFunction tsA, + LogicalFunction ridB, + LogicalFunction fractionB, + LogicalFunction tsB); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TemporalEIntersectsTPoseGeometryLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TemporalEIntersectsTPoseGeometryLogicalFunction.hpp new file mode 100644 index 0000000000..e67f410a0d --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TemporalEIntersectsTPoseGeometryLogicalFunction.hpp @@ -0,0 +1,56 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event eintersects_tgeo_geo via tpose→tgeompoint composition. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `eintersects_tgeo_geo`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. + */ +class TemporalEIntersectsTPoseGeometryLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TemporalEIntersectsTPoseGeometry"; + + TemporalEIntersectsTPoseGeometryLogicalFunction(LogicalFunction x, + LogicalFunction y, + LogicalFunction theta, + LogicalFunction timestamp, + LogicalFunction geometry); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TemporalEIntersectsTPoseTPoseLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TemporalEIntersectsTPoseTPoseLogicalFunction.hpp new file mode 100644 index 0000000000..be5b840d29 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TemporalEIntersectsTPoseTPoseLogicalFunction.hpp @@ -0,0 +1,59 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event eintersects_tgeo_tgeo via tpose×tpose→tgeompoint composition. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `eintersects_tgeo_tgeo`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. + */ +class TemporalEIntersectsTPoseTPoseLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TemporalEIntersectsTPoseTPose"; + + TemporalEIntersectsTPoseTPoseLogicalFunction(LogicalFunction xA, + LogicalFunction yA, + LogicalFunction thetaA, + LogicalFunction tsA, + LogicalFunction xB, + LogicalFunction yB, + LogicalFunction thetaB, + LogicalFunction tsB); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TemporalETouchesTNpointGeometryLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TemporalETouchesTNpointGeometryLogicalFunction.hpp new file mode 100644 index 0000000000..94900f4513 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TemporalETouchesTNpointGeometryLogicalFunction.hpp @@ -0,0 +1,55 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event etouches_tgeo_geo via tnpoint→tgeompoint composition. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `etouches_tgeo_geo`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. + */ +class TemporalETouchesTNpointGeometryLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TemporalETouchesTNpointGeometry"; + + TemporalETouchesTNpointGeometryLogicalFunction(LogicalFunction rid, + LogicalFunction fraction, + LogicalFunction timestamp, + LogicalFunction geometry); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TemporalETouchesTNpointTNpointLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TemporalETouchesTNpointTNpointLogicalFunction.hpp new file mode 100644 index 0000000000..fba1aa82f4 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TemporalETouchesTNpointTNpointLogicalFunction.hpp @@ -0,0 +1,57 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event etouches_tgeo_tgeo via tnpoint×tnpoint→tgeompoint composition. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `etouches_tgeo_tgeo`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. + */ +class TemporalETouchesTNpointTNpointLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TemporalETouchesTNpointTNpoint"; + + TemporalETouchesTNpointTNpointLogicalFunction(LogicalFunction ridA, + LogicalFunction fractionA, + LogicalFunction tsA, + LogicalFunction ridB, + LogicalFunction fractionB, + LogicalFunction tsB); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TemporalETouchesTPoseGeometryLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TemporalETouchesTPoseGeometryLogicalFunction.hpp new file mode 100644 index 0000000000..e40139c2f5 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TemporalETouchesTPoseGeometryLogicalFunction.hpp @@ -0,0 +1,56 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event etouches_tgeo_geo via tpose→tgeompoint composition. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `etouches_tgeo_geo`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. + */ +class TemporalETouchesTPoseGeometryLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TemporalETouchesTPoseGeometry"; + + TemporalETouchesTPoseGeometryLogicalFunction(LogicalFunction x, + LogicalFunction y, + LogicalFunction theta, + LogicalFunction timestamp, + LogicalFunction geometry); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TemporalETouchesTPoseTPoseLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TemporalETouchesTPoseTPoseLogicalFunction.hpp new file mode 100644 index 0000000000..00033b85c0 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TemporalETouchesTPoseTPoseLogicalFunction.hpp @@ -0,0 +1,59 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event etouches_tgeo_tgeo via tpose×tpose→tgeompoint composition. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `etouches_tgeo_tgeo`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. + */ +class TemporalETouchesTPoseTPoseLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TemporalETouchesTPoseTPose"; + + TemporalETouchesTPoseTPoseLogicalFunction(LogicalFunction xA, + LogicalFunction yA, + LogicalFunction thetaA, + LogicalFunction tsA, + LogicalFunction xB, + LogicalFunction yB, + LogicalFunction thetaB, + LogicalFunction tsB); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TemporalNADTNpointGeometryLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TemporalNADTNpointGeometryLogicalFunction.hpp new file mode 100644 index 0000000000..0a9266429e --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TemporalNADTNpointGeometryLogicalFunction.hpp @@ -0,0 +1,55 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event nad_tgeo_geo (nearest approach distance) via tnpoint→tgeompoint composition. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `nad_tgeo_geo`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. + */ +class TemporalNADTNpointGeometryLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TemporalNADTNpointGeometry"; + + TemporalNADTNpointGeometryLogicalFunction(LogicalFunction rid, + LogicalFunction fraction, + LogicalFunction timestamp, + LogicalFunction geometry); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TemporalNADTNpointTNpointLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TemporalNADTNpointTNpointLogicalFunction.hpp new file mode 100644 index 0000000000..353998cdc7 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TemporalNADTNpointTNpointLogicalFunction.hpp @@ -0,0 +1,57 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event nad_tgeo_tgeo (nearest approach distance) via tnpoint×tnpoint→tgeompoint composition. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `nad_tgeo_tgeo`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. + */ +class TemporalNADTNpointTNpointLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TemporalNADTNpointTNpoint"; + + TemporalNADTNpointTNpointLogicalFunction(LogicalFunction ridA, + LogicalFunction fractionA, + LogicalFunction tsA, + LogicalFunction ridB, + LogicalFunction fractionB, + LogicalFunction tsB); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TemporalNADTPoseGeometryLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TemporalNADTPoseGeometryLogicalFunction.hpp new file mode 100644 index 0000000000..2b8077abd0 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TemporalNADTPoseGeometryLogicalFunction.hpp @@ -0,0 +1,56 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event nad_tgeo_geo (nearest approach distance) via tpose→tgeompoint composition. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `nad_tgeo_geo`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. + */ +class TemporalNADTPoseGeometryLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TemporalNADTPoseGeometry"; + + TemporalNADTPoseGeometryLogicalFunction(LogicalFunction x, + LogicalFunction y, + LogicalFunction theta, + LogicalFunction timestamp, + LogicalFunction geometry); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TemporalNADTPoseTPoseLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TemporalNADTPoseTPoseLogicalFunction.hpp new file mode 100644 index 0000000000..c1c36db5c9 --- /dev/null +++ b/nes-logical-operators/include/Functions/Meos/TemporalNADTPoseTPoseLogicalFunction.hpp @@ -0,0 +1,59 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Per-event nad_tgeo_tgeo (nearest approach distance) via tpose×tpose→tgeompoint composition. + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `nad_tgeo_tgeo`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. + */ +class TemporalNADTPoseTPoseLogicalFunction : public LogicalFunctionConcept { +public: + static constexpr std::string_view NAME = "TemporalNADTPoseTPose"; + + TemporalNADTPoseTPoseLogicalFunction(LogicalFunction xA, + LogicalFunction yA, + LogicalFunction thetaA, + LogicalFunction tsA, + LogicalFunction xB, + LogicalFunction yB, + LogicalFunction thetaB, + LogicalFunction tsB); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}; + +} // namespace NES diff --git a/nes-logical-operators/include/Functions/Meos/TemporalRoundLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TemporalRoundLogicalFunction.hpp index 987761a0df..dfeb2020eb 100644 --- a/nes-logical-operators/include/Functions/Meos/TemporalRoundLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/TemporalRoundLogicalFunction.hpp @@ -22,19 +22,19 @@ namespace NES { /** - * @brief Per-event temporal_round: rounds a single-instant tfloat to N decimal places. + * @brief Per-event temporal_round: round single-instant tfloat to given decimal places. * * Generated by tools/codegen/codegen_nebula.py from the MEOS function - * `temporal_round`. Takes (value:FLOAT64, ts:UINT64, maxdd:FLOAT64→int), - * constructs a single-instant temporal, applies the rounding, and returns FLOAT64. + * `temporal_round`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class TemporalRoundLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "TemporalRound"; TemporalRoundLogicalFunction(LogicalFunction value, - LogicalFunction ts, - LogicalFunction maxdd); + LogicalFunction ts, + LogicalFunction arg0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/TeqBoolTboolLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TeqBoolTboolLogicalFunction.hpp index 883d67de55..bc5a4977bb 100644 --- a/nes-logical-operators/include/Functions/Meos/TeqBoolTboolLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/TeqBoolTboolLogicalFunction.hpp @@ -22,19 +22,19 @@ namespace NES { /** - * @brief temporal EQ: scalar bool vs single-instant tbool + * @brief Per-event teq_bool_tbool: temporal equality of scalar bool and tbool. * * Generated by tools/codegen/codegen_nebula.py from the MEOS function - * `teq_bool_tbool`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), - * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + * `teq_bool_tbool`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class TeqBoolTboolLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "TeqBoolTbool"; - TeqBoolTboolLogicalFunction(LogicalFunction value, - LogicalFunction threshold, - LogicalFunction ts); + TeqBoolTboolLogicalFunction(LogicalFunction arg0, + LogicalFunction value, + LogicalFunction ts); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/TeqTboolBoolLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TeqTboolBoolLogicalFunction.hpp index af9a60f4df..dfb7b42526 100644 --- a/nes-logical-operators/include/Functions/Meos/TeqTboolBoolLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/TeqTboolBoolLogicalFunction.hpp @@ -22,19 +22,19 @@ namespace NES { /** - * @brief temporal EQ: single-instant tbool vs scalar bool + * @brief Per-event teq_tbool_bool: temporal equality of tbool and scalar bool. * * Generated by tools/codegen/codegen_nebula.py from the MEOS function - * `teq_tbool_bool`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), - * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + * `teq_tbool_bool`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class TeqTboolBoolLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "TeqTboolBool"; TeqTboolBoolLogicalFunction(LogicalFunction value, - LogicalFunction threshold, - LogicalFunction ts); + LogicalFunction ts, + LogicalFunction arg0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/TextInitcapLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TextInitcapLogicalFunction.hpp index 81e076e3c6..cee9d8a58d 100644 --- a/nes-logical-operators/include/Functions/Meos/TextInitcapLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/TextInitcapLogicalFunction.hpp @@ -22,12 +22,18 @@ namespace NES { /** - * @brief Converts the first letter of each word in a text string to upper case. + * @brief Text initcapcase + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `text_initcap`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class TextInitcapLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "TextInitcap"; + TextInitcapLogicalFunction(LogicalFunction str); + DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; std::vector getChildren() const override; @@ -37,6 +43,7 @@ class TextInitcapLogicalFunction : public LogicalFunctionConcept { std::string explain(ExplainVerbosity verbosity) const override; LogicalFunction withInferredDataType(const Schema& schema) const override; SerializableFunction serialize() const override; + private: DataType dataType; std::vector parameters; diff --git a/nes-logical-operators/include/Functions/Meos/TextLowerLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TextLowerLogicalFunction.hpp index 6e492d12d2..42713c1a9f 100644 --- a/nes-logical-operators/include/Functions/Meos/TextLowerLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/TextLowerLogicalFunction.hpp @@ -22,12 +22,18 @@ namespace NES { /** - * @brief Converts a text string to lower case. + * @brief Text lowercase + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `text_lower`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class TextLowerLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "TextLower"; + TextLowerLogicalFunction(LogicalFunction str); + DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; std::vector getChildren() const override; @@ -37,6 +43,7 @@ class TextLowerLogicalFunction : public LogicalFunctionConcept { std::string explain(ExplainVerbosity verbosity) const override; LogicalFunction withInferredDataType(const Schema& schema) const override; SerializableFunction serialize() const override; + private: DataType dataType; std::vector parameters; diff --git a/nes-logical-operators/include/Functions/Meos/TextUpperLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TextUpperLogicalFunction.hpp index e754805c5a..bf79255856 100644 --- a/nes-logical-operators/include/Functions/Meos/TextUpperLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/TextUpperLogicalFunction.hpp @@ -22,12 +22,18 @@ namespace NES { /** - * @brief Converts a text string to upper case. + * @brief Text uppercase + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `text_upper`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class TextUpperLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "TextUpper"; + TextUpperLogicalFunction(LogicalFunction str); + DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; std::vector getChildren() const override; @@ -37,6 +43,7 @@ class TextUpperLogicalFunction : public LogicalFunctionConcept { std::string explain(ExplainVerbosity verbosity) const override; LogicalFunction withInferredDataType(const Schema& schema) const override; SerializableFunction serialize() const override; + private: DataType dataType; std::vector parameters; diff --git a/nes-logical-operators/include/Functions/Meos/TextcatTextTtextLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TextcatTextTtextLogicalFunction.hpp index 3981a46b60..0dab3f4d84 100644 --- a/nes-logical-operators/include/Functions/Meos/TextcatTextTtextLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/TextcatTextTtextLogicalFunction.hpp @@ -22,16 +22,19 @@ namespace NES { /** - * @brief Per-event textcat_text_ttext: (value:VARCHAR, ts:UINT64, ref:VARCHAR) -> varchar. + * @brief Concatenate text and ttext * * Generated by tools/codegen/codegen_nebula.py from the MEOS function - * `textcat_text_ttext`. Per-event scalar operator returning VARCHAR. + * `textcat_text_ttext(txt0, temp)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class TextcatTextTtextLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "TextcatTextTtext"; - TextcatTextTtextLogicalFunction(LogicalFunction value, LogicalFunction ts, LogicalFunction ref); + TextcatTextTtextLogicalFunction(LogicalFunction arg0, + LogicalFunction value, + LogicalFunction ts); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/TextcatTtextTextLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TextcatTtextTextLogicalFunction.hpp index 319280c933..67630b784a 100644 --- a/nes-logical-operators/include/Functions/Meos/TextcatTtextTextLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/TextcatTtextTextLogicalFunction.hpp @@ -22,16 +22,19 @@ namespace NES { /** - * @brief Per-event textcat_ttext_text: (value:VARCHAR, ts:UINT64, ref:VARCHAR) -> varchar. + * @brief Concatenate ttext and text * * Generated by tools/codegen/codegen_nebula.py from the MEOS function - * `textcat_ttext_text`. Per-event scalar operator returning VARCHAR. + * `textcat_ttext_text(temp, txt0)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class TextcatTtextTextLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "TextcatTtextText"; - TextcatTtextTextLogicalFunction(LogicalFunction value, LogicalFunction ts, LogicalFunction ref); + TextcatTtextTextLogicalFunction(LogicalFunction value, + LogicalFunction ts, + LogicalFunction arg0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/TextcatTtextTtextLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TextcatTtextTtextLogicalFunction.hpp index 1e6b12cd06..af47f49acb 100644 --- a/nes-logical-operators/include/Functions/Meos/TextcatTtextTtextLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/TextcatTtextTtextLogicalFunction.hpp @@ -22,16 +22,20 @@ namespace NES { /** - * @brief Per-event textcat_ttext_ttext: (value1:VARCHAR, ts1:UINT64, value2:VARCHAR, ts2:UINT64) -> varchar. + * @brief Concatenate ttext and ttext * * Generated by tools/codegen/codegen_nebula.py from the MEOS function - * `textcat_ttext_ttext`. Per-event scalar operator returning VARCHAR. + * `textcat_ttext_ttext(temp, inst0)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class TextcatTtextTtextLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "TextcatTtextTtext"; - TextcatTtextTtextLogicalFunction(LogicalFunction value1, LogicalFunction ts1, LogicalFunction value2, LogicalFunction ts2); + TextcatTtextTtextLogicalFunction(LogicalFunction value, + LogicalFunction ts, + LogicalFunction tval0, + LogicalFunction ts0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/TfloatScaleValueLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TfloatScaleValueLogicalFunction.hpp index ad47c78148..c25d67039f 100644 --- a/nes-logical-operators/include/Functions/Meos/TfloatScaleValueLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/TfloatScaleValueLogicalFunction.hpp @@ -22,19 +22,19 @@ namespace NES { /** - * @brief Per-event tfloat_scale_value: scales the value of a single-instant tfloat by a width. + * @brief Per-event tfloat_scale_value: scale single-instant tfloat value by scalar. * * Generated by tools/codegen/codegen_nebula.py from the MEOS function - * `tfloat_scale_value`. Takes (value:FLOAT64, ts:UINT64, width:FLOAT64), - * constructs a single-instant temporal, applies the scale, and returns FLOAT64. + * `tfloat_scale_value`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class TfloatScaleValueLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "TfloatScaleValue"; TfloatScaleValueLogicalFunction(LogicalFunction value, - LogicalFunction ts, - LogicalFunction width); + LogicalFunction ts, + LogicalFunction arg0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/TfloatShiftScaleValueLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TfloatShiftScaleValueLogicalFunction.hpp index b4c2b90990..d5c8b14166 100644 --- a/nes-logical-operators/include/Functions/Meos/TfloatShiftScaleValueLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/TfloatShiftScaleValueLogicalFunction.hpp @@ -22,20 +22,20 @@ namespace NES { /** - * @brief Per-event tfloat_shift_scale_value: shifts and scales a single-instant tfloat by shift and width. + * @brief Per-event tfloat_shift_scale_value: shift then scale single-instant tfloat value. * * Generated by tools/codegen/codegen_nebula.py from the MEOS function - * `tfloat_shift_scale_value`. Takes (value:FLOAT64, ts:UINT64, shift:FLOAT64, width:FLOAT64), - * constructs a single-instant temporal, applies shift+scale, and returns FLOAT64. + * `tfloat_shift_scale_value`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class TfloatShiftScaleValueLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "TfloatShiftScaleValue"; TfloatShiftScaleValueLogicalFunction(LogicalFunction value, - LogicalFunction ts, - LogicalFunction shift, - LogicalFunction width); + LogicalFunction ts, + LogicalFunction arg0, + LogicalFunction arg1); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/TfloatShiftValueLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TfloatShiftValueLogicalFunction.hpp index 7d721d6c1b..0179fe80d7 100644 --- a/nes-logical-operators/include/Functions/Meos/TfloatShiftValueLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/TfloatShiftValueLogicalFunction.hpp @@ -22,19 +22,19 @@ namespace NES { /** - * @brief Per-event tfloat_shift_value: shifts the value of a single-instant tfloat by a scalar. + * @brief Per-event tfloat_shift_value: shift single-instant tfloat value by scalar. * * Generated by tools/codegen/codegen_nebula.py from the MEOS function - * `tfloat_shift_value`. Takes (value:FLOAT64, ts:UINT64, shift:FLOAT64), - * constructs a single-instant temporal, applies the shift, and returns FLOAT64. + * `tfloat_shift_value`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class TfloatShiftValueLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "TfloatShiftValue"; TfloatShiftValueLogicalFunction(LogicalFunction value, - LogicalFunction ts, - LogicalFunction shift); + LogicalFunction ts, + LogicalFunction arg0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/TfloatToTbigintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TfloatToTbigintLogicalFunction.hpp index 67a04b12b5..c716f7beff 100644 --- a/nes-logical-operators/include/Functions/Meos/TfloatToTbigintLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/TfloatToTbigintLogicalFunction.hpp @@ -22,18 +22,18 @@ namespace NES { /** - * @brief Per-event tfloat_to_tbigint: converts a single-instant tfloat to tbigint, returns FLOAT64. + * @brief Per-event tfloat_to_tbigint: convert single-instant tfloat to tbigint. * * Generated by tools/codegen/codegen_nebula.py from the MEOS function - * `tfloat_to_tbigint`. Takes (value:FLOAT64, ts:UINT64), constructs a single-instant - * temporal float, truncates to bigint, and returns FLOAT64. + * `tfloat_to_tbigint`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class TfloatToTbigintLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "TfloatToTbigint"; TfloatToTbigintLogicalFunction(LogicalFunction value, - LogicalFunction ts); + LogicalFunction ts); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/TfloatToTintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TfloatToTintLogicalFunction.hpp index 0d47f35168..b595ceb478 100644 --- a/nes-logical-operators/include/Functions/Meos/TfloatToTintLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/TfloatToTintLogicalFunction.hpp @@ -22,18 +22,18 @@ namespace NES { /** - * @brief Per-event tfloat_to_tint: converts a single-instant tfloat to tint, returns FLOAT64. + * @brief Per-event tfloat_to_tint: single-instant tfloat transform, value extracted -> int. * * Generated by tools/codegen/codegen_nebula.py from the MEOS function - * `tfloat_to_tint`. Takes (value:FLOAT64, ts:UINT64), constructs a single-instant - * temporal float, truncates to integer, and returns FLOAT64. + * `tfloat_to_tint`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class TfloatToTintLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "TfloatToTint"; TfloatToTintLogicalFunction(LogicalFunction value, - LogicalFunction ts); + LogicalFunction ts); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/Th3indexAreNeighborCellsLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/Th3indexAreNeighborCellsLogicalFunction.hpp index 532fce8853..39e4509088 100644 --- a/nes-logical-operators/include/Functions/Meos/Th3indexAreNeighborCellsLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/Th3indexAreNeighborCellsLogicalFunction.hpp @@ -22,16 +22,20 @@ namespace NES { /** - * @brief Returns 1.0 if the two H3 cells are neighbors (share an edge), 0.0 otherwise. + * @brief Th3index are neighbor cells * - * Args: (cell1:UINT64, ts1:UINT64, cell2:UINT64, ts2:UINT64) -> FLOAT64. + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `th3index_are_neighbor_cells(temp, inst0)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class Th3indexAreNeighborCellsLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "Th3indexAreNeighborCells"; - Th3indexAreNeighborCellsLogicalFunction(LogicalFunction cell1, LogicalFunction ts1, - LogicalFunction cell2, LogicalFunction ts2); + Th3indexAreNeighborCellsLogicalFunction(LogicalFunction cell, + LogicalFunction ts, + LogicalFunction cell0, + LogicalFunction ts0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/Th3indexCellToCenterChildLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/Th3indexCellToCenterChildLogicalFunction.hpp index 7f91065322..7c88ca63bd 100644 --- a/nes-logical-operators/include/Functions/Meos/Th3indexCellToCenterChildLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/Th3indexCellToCenterChildLogicalFunction.hpp @@ -22,15 +22,19 @@ namespace NES { /** - * @brief Returns the H3 center child cell at the given resolution as a hex string. + * @brief Th3index th3index cell to center child * - * Args: (cell:UINT64, ts:UINT64, resolution:UINT64) -> VARCHAR. + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `th3index_cell_to_center_child(temp, (int32_t)arg0)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class Th3indexCellToCenterChildLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "Th3indexCellToCenterChild"; - Th3indexCellToCenterChildLogicalFunction(LogicalFunction cell, LogicalFunction ts, LogicalFunction resolution); + Th3indexCellToCenterChildLogicalFunction(LogicalFunction cell, + LogicalFunction ts, + LogicalFunction arg0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/Th3indexCellToCenterChildNextLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/Th3indexCellToCenterChildNextLogicalFunction.hpp index 5edb86a69b..e31c08aa40 100644 --- a/nes-logical-operators/include/Functions/Meos/Th3indexCellToCenterChildNextLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/Th3indexCellToCenterChildNextLogicalFunction.hpp @@ -22,15 +22,19 @@ namespace NES { /** - * @brief Returns the H3 center child cell at resolution+1 as a hex string. + * @brief Th3index th3index cell to center child next * - * Args: (cell:UINT64, ts:UINT64) -> VARCHAR. + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `th3index_cell_to_center_child_next(temp, (int32_t)arg0)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class Th3indexCellToCenterChildNextLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "Th3indexCellToCenterChildNext"; - Th3indexCellToCenterChildNextLogicalFunction(LogicalFunction cell, LogicalFunction ts); + Th3indexCellToCenterChildNextLogicalFunction(LogicalFunction cell, + LogicalFunction ts, + LogicalFunction arg0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/Th3indexCellToChildPosLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/Th3indexCellToChildPosLogicalFunction.hpp index 1ef6e8e7b4..9ee7b744ca 100644 --- a/nes-logical-operators/include/Functions/Meos/Th3indexCellToChildPosLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/Th3indexCellToChildPosLogicalFunction.hpp @@ -22,15 +22,19 @@ namespace NES { /** - * @brief Returns the position of the H3 cell within its parent at parent_res as FLOAT64. + * @brief Th3index cell to child position * - * Args: (cell:UINT64, ts:UINT64, parent_res:UINT64) -> FLOAT64. + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `th3index_cell_to_child_pos(temp, (int32_t)arg0)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class Th3indexCellToChildPosLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "Th3indexCellToChildPos"; - Th3indexCellToChildPosLogicalFunction(LogicalFunction cell, LogicalFunction ts, LogicalFunction parent_res); + Th3indexCellToChildPosLogicalFunction(LogicalFunction cell, + LogicalFunction ts, + LogicalFunction arg0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/Th3indexCellToParentLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/Th3indexCellToParentLogicalFunction.hpp index e8f775f544..cac698cd47 100644 --- a/nes-logical-operators/include/Functions/Meos/Th3indexCellToParentLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/Th3indexCellToParentLogicalFunction.hpp @@ -22,15 +22,19 @@ namespace NES { /** - * @brief Returns the H3 parent cell at the given resolution as a hex string. + * @brief Th3index th3index cell to parent * - * Args: (cell:UINT64, ts:UINT64, resolution:UINT64) -> VARCHAR. + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `th3index_cell_to_parent(temp, (int32_t)arg0)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class Th3indexCellToParentLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "Th3indexCellToParent"; - Th3indexCellToParentLogicalFunction(LogicalFunction cell, LogicalFunction ts, LogicalFunction resolution); + Th3indexCellToParentLogicalFunction(LogicalFunction cell, + LogicalFunction ts, + LogicalFunction arg0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/Th3indexCellToParentNextLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/Th3indexCellToParentNextLogicalFunction.hpp index 54df43c800..4650a8fa74 100644 --- a/nes-logical-operators/include/Functions/Meos/Th3indexCellToParentNextLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/Th3indexCellToParentNextLogicalFunction.hpp @@ -22,15 +22,19 @@ namespace NES { /** - * @brief Returns the H3 parent cell at resolution-1 as a hex string. + * @brief Th3index th3index cell to parent next * - * Args: (cell:UINT64, ts:UINT64) -> VARCHAR. + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `th3index_cell_to_parent_next(temp, (int32_t)arg0)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class Th3indexCellToParentNextLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "Th3indexCellToParentNext"; - Th3indexCellToParentNextLogicalFunction(LogicalFunction cell, LogicalFunction ts); + Th3indexCellToParentNextLogicalFunction(LogicalFunction cell, + LogicalFunction ts, + LogicalFunction arg0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/Th3indexGetBaseCellNumberLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/Th3indexGetBaseCellNumberLogicalFunction.hpp index 8187544475..7164f755f4 100644 --- a/nes-logical-operators/include/Functions/Meos/Th3indexGetBaseCellNumberLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/Th3indexGetBaseCellNumberLogicalFunction.hpp @@ -22,15 +22,18 @@ namespace NES { /** - * @brief Returns the H3 base cell number (0-121) of the cell as FLOAT64. + * @brief Th3index th3index get base cell number * - * Args: (cell:UINT64, ts:UINT64) -> FLOAT64. + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `th3index_get_base_cell_number(temp)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class Th3indexGetBaseCellNumberLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "Th3indexGetBaseCellNumber"; - Th3indexGetBaseCellNumberLogicalFunction(LogicalFunction cell, LogicalFunction ts); + Th3indexGetBaseCellNumberLogicalFunction(LogicalFunction cell, + LogicalFunction ts); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/Th3indexGetResolutionLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/Th3indexGetResolutionLogicalFunction.hpp index d034651307..449da5178c 100644 --- a/nes-logical-operators/include/Functions/Meos/Th3indexGetResolutionLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/Th3indexGetResolutionLogicalFunction.hpp @@ -22,15 +22,18 @@ namespace NES { /** - * @brief Returns the H3 resolution (0-15) of the cell as FLOAT64. + * @brief Th3index th3index get resolution * - * Args: (cell:UINT64, ts:UINT64) -> FLOAT64. + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `th3index_get_resolution(temp)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class Th3indexGetResolutionLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "Th3indexGetResolution"; - Th3indexGetResolutionLogicalFunction(LogicalFunction cell, LogicalFunction ts); + Th3indexGetResolutionLogicalFunction(LogicalFunction cell, + LogicalFunction ts); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/Th3indexGridDistanceLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/Th3indexGridDistanceLogicalFunction.hpp index 9e5a377e6e..ada7a443f3 100644 --- a/nes-logical-operators/include/Functions/Meos/Th3indexGridDistanceLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/Th3indexGridDistanceLogicalFunction.hpp @@ -22,16 +22,20 @@ namespace NES { /** - * @brief Returns the H3 grid distance (number of cells) between two H3 cells as FLOAT64. + * @brief Th3index grid distance * - * Args: (cell1:UINT64, ts1:UINT64, cell2:UINT64, ts2:UINT64) -> FLOAT64. + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `th3index_grid_distance(temp, inst0)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class Th3indexGridDistanceLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "Th3indexGridDistance"; - Th3indexGridDistanceLogicalFunction(LogicalFunction cell1, LogicalFunction ts1, - LogicalFunction cell2, LogicalFunction ts2); + Th3indexGridDistanceLogicalFunction(LogicalFunction cell, + LogicalFunction ts, + LogicalFunction cell0, + LogicalFunction ts0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/Th3indexIsPentagonLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/Th3indexIsPentagonLogicalFunction.hpp index 60d583d8f2..d85d41f1ee 100644 --- a/nes-logical-operators/include/Functions/Meos/Th3indexIsPentagonLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/Th3indexIsPentagonLogicalFunction.hpp @@ -22,15 +22,18 @@ namespace NES { /** - * @brief Returns 1.0 if the H3 cell is a pentagon cell, 0.0 otherwise. + * @brief Th3index th3index is pentagon * - * Args: (cell:UINT64, ts:UINT64) -> FLOAT64. + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `th3index_is_pentagon(temp)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class Th3indexIsPentagonLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "Th3indexIsPentagon"; - Th3indexIsPentagonLogicalFunction(LogicalFunction cell, LogicalFunction ts); + Th3indexIsPentagonLogicalFunction(LogicalFunction cell, + LogicalFunction ts); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/Th3indexIsValidCellLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/Th3indexIsValidCellLogicalFunction.hpp index 8a8d12f282..4c839add81 100644 --- a/nes-logical-operators/include/Functions/Meos/Th3indexIsValidCellLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/Th3indexIsValidCellLogicalFunction.hpp @@ -22,15 +22,18 @@ namespace NES { /** - * @brief Returns 1.0 if the H3 cell index is valid, 0.0 otherwise. + * @brief Th3index th3index is valid cell * - * Args: (cell:UINT64, ts:UINT64) -> FLOAT64. + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `th3index_is_valid_cell(temp)`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class Th3indexIsValidCellLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "Th3indexIsValidCell"; - Th3indexIsValidCellLogicalFunction(LogicalFunction cell, LogicalFunction ts); + Th3indexIsValidCellLogicalFunction(LogicalFunction cell, + LogicalFunction ts); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/TintScaleValueLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TintScaleValueLogicalFunction.hpp index eaf261f031..d39c727442 100644 --- a/nes-logical-operators/include/Functions/Meos/TintScaleValueLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/TintScaleValueLogicalFunction.hpp @@ -22,19 +22,19 @@ namespace NES { /** - * @brief Per-event tint_scale_value: scales a single-instant tint to a given width. + * @brief Per-event tint_scale_value: scale single-instant tint value by scalar. * * Generated by tools/codegen/codegen_nebula.py from the MEOS function - * `tint_scale_value`. Takes (value:FLOAT64, ts:UINT64, width:FLOAT64→int), - * constructs a single-instant temporal, applies the scale, and returns FLOAT64. + * `tint_scale_value`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class TintScaleValueLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "TintScaleValue"; TintScaleValueLogicalFunction(LogicalFunction value, - LogicalFunction ts, - LogicalFunction width); + LogicalFunction ts, + LogicalFunction arg0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/TintShiftScaleValueLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TintShiftScaleValueLogicalFunction.hpp index 4b3ec6c91e..db8203bba6 100644 --- a/nes-logical-operators/include/Functions/Meos/TintShiftScaleValueLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/TintShiftScaleValueLogicalFunction.hpp @@ -22,20 +22,20 @@ namespace NES { /** - * @brief Per-event tint_shift_scale_value: shifts and scales a single-instant tint. + * @brief Per-event tint_shift_scale_value: shift then scale single-instant tint value. * * Generated by tools/codegen/codegen_nebula.py from the MEOS function - * `tint_shift_scale_value`. Takes (value:FLOAT64, ts:UINT64, shift:FLOAT64→int, width:FLOAT64→int), - * constructs a single-instant temporal, applies the shift-and-scale, and returns FLOAT64. + * `tint_shift_scale_value`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class TintShiftScaleValueLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "TintShiftScaleValue"; TintShiftScaleValueLogicalFunction(LogicalFunction value, - LogicalFunction ts, - LogicalFunction shift, - LogicalFunction width); + LogicalFunction ts, + LogicalFunction arg0, + LogicalFunction arg1); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/TintShiftValueLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TintShiftValueLogicalFunction.hpp index ebf94d3dd8..fb075dc2bf 100644 --- a/nes-logical-operators/include/Functions/Meos/TintShiftValueLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/TintShiftValueLogicalFunction.hpp @@ -22,19 +22,19 @@ namespace NES { /** - * @brief Per-event tint_shift_value: shifts a single-instant tint by a constant integer. + * @brief Per-event tint_shift_value: shift single-instant tint value by scalar. * * Generated by tools/codegen/codegen_nebula.py from the MEOS function - * `tint_shift_value`. Takes (value:FLOAT64, ts:UINT64, shift:FLOAT64→int), - * constructs a single-instant temporal, applies the shift, and returns FLOAT64. + * `tint_shift_value`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class TintShiftValueLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "TintShiftValue"; TintShiftValueLogicalFunction(LogicalFunction value, - LogicalFunction ts, - LogicalFunction shift); + LogicalFunction ts, + LogicalFunction arg0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/TintToTbigintLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TintToTbigintLogicalFunction.hpp index f9460e7edd..cfeb8a46eb 100644 --- a/nes-logical-operators/include/Functions/Meos/TintToTbigintLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/TintToTbigintLogicalFunction.hpp @@ -22,18 +22,18 @@ namespace NES { /** - * @brief Per-event tint_to_tbigint: converts a single-instant tint to tbigint, returns FLOAT64. + * @brief Per-event tint_to_tbigint: convert single-instant tint to tbigint. * * Generated by tools/codegen/codegen_nebula.py from the MEOS function - * `tint_to_tbigint`. Takes (value:FLOAT64, ts:UINT64), constructs a single-instant - * temporal integer, widens to bigint, and returns FLOAT64. + * `tint_to_tbigint`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class TintToTbigintLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "TintToTbigint"; TintToTbigintLogicalFunction(LogicalFunction value, - LogicalFunction ts); + LogicalFunction ts); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/TintToTfloatLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TintToTfloatLogicalFunction.hpp index 6de528f985..623e82bd44 100644 --- a/nes-logical-operators/include/Functions/Meos/TintToTfloatLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/TintToTfloatLogicalFunction.hpp @@ -22,18 +22,18 @@ namespace NES { /** - * @brief Per-event tint_to_tfloat: converts a single-instant tint to tfloat, returns FLOAT64. + * @brief Per-event tint_to_tfloat: single-instant tfloat transform, value extracted -> double. * * Generated by tools/codegen/codegen_nebula.py from the MEOS function - * `tint_to_tfloat`. Takes (value:FLOAT64, ts:UINT64), constructs a single-instant - * temporal integer, promotes to float, and returns FLOAT64. + * `tint_to_tfloat`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class TintToTfloatLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "TintToTfloat"; TintToTfloatLogicalFunction(LogicalFunction value, - LogicalFunction ts); + LogicalFunction ts); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/TneBoolTboolLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TneBoolTboolLogicalFunction.hpp index 1de3118a9e..f29c17e415 100644 --- a/nes-logical-operators/include/Functions/Meos/TneBoolTboolLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/TneBoolTboolLogicalFunction.hpp @@ -22,19 +22,19 @@ namespace NES { /** - * @brief temporal NE: scalar bool vs single-instant tbool + * @brief Per-event tne_bool_tbool: temporal inequality of scalar bool and tbool. * * Generated by tools/codegen/codegen_nebula.py from the MEOS function - * `tne_bool_tbool`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), - * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + * `tne_bool_tbool`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class TneBoolTboolLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "TneBoolTbool"; - TneBoolTboolLogicalFunction(LogicalFunction value, - LogicalFunction threshold, - LogicalFunction ts); + TneBoolTboolLogicalFunction(LogicalFunction arg0, + LogicalFunction value, + LogicalFunction ts); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/TneTboolBoolLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TneTboolBoolLogicalFunction.hpp index 2414c7ca98..0f67c12bc9 100644 --- a/nes-logical-operators/include/Functions/Meos/TneTboolBoolLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/TneTboolBoolLogicalFunction.hpp @@ -22,19 +22,19 @@ namespace NES { /** - * @brief temporal NE: single-instant tbool vs scalar bool + * @brief Per-event tne_tbool_bool: temporal inequality of tbool and scalar bool. * * Generated by tools/codegen/codegen_nebula.py from the MEOS function - * `tne_tbool_bool`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), - * constructs a single-instant temporal, applies the comparison, and returns FLOAT64 (0.0/1.0). + * `tne_tbool_bool`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class TneTboolBoolLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "TneTboolBool"; TneTboolBoolLogicalFunction(LogicalFunction value, - LogicalFunction threshold, - LogicalFunction ts); + LogicalFunction ts, + LogicalFunction arg0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/TnotTboolLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TnotTboolLogicalFunction.hpp index a9f99b5e4c..d837e5e7f0 100644 --- a/nes-logical-operators/include/Functions/Meos/TnotTboolLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/TnotTboolLogicalFunction.hpp @@ -22,7 +22,7 @@ namespace NES { /** - * @brief Per-event tnot_tbool: single-instant tbool negation, result extracted -> double. + * @brief Per-event tnot_tbool: logical NOT of single-instant tbool. * * Generated by tools/codegen/codegen_nebula.py from the MEOS function * `tnot_tbool`. Per-event scalar operator following the diff --git a/nes-logical-operators/include/Functions/Meos/TorBoolTboolLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TorBoolTboolLogicalFunction.hpp index f1c8088610..45d15b03ea 100644 --- a/nes-logical-operators/include/Functions/Meos/TorBoolTboolLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/TorBoolTboolLogicalFunction.hpp @@ -22,19 +22,19 @@ namespace NES { /** - * @brief Per-event tor_bool_tbool: OR of a scalar bool and a single-instant tbool. + * @brief Per-event tor_bool_tbool: temporal OR of scalar bool and tbool. * * Generated by tools/codegen/codegen_nebula.py from the MEOS function - * `tor_bool_tbool`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), - * constructs a single-instant temporal, applies the operation, and returns FLOAT64 (0.0/1.0). + * `tor_bool_tbool`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class TorBoolTboolLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "TorBoolTbool"; - TorBoolTboolLogicalFunction(LogicalFunction value, - LogicalFunction threshold, - LogicalFunction ts); + TorBoolTboolLogicalFunction(LogicalFunction arg0, + LogicalFunction value, + LogicalFunction ts); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/TorTboolBoolLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TorTboolBoolLogicalFunction.hpp index 423e040e7e..f6de7c0f7a 100644 --- a/nes-logical-operators/include/Functions/Meos/TorTboolBoolLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/TorTboolBoolLogicalFunction.hpp @@ -22,19 +22,19 @@ namespace NES { /** - * @brief Per-event tor_tbool_bool: OR of a single-instant tbool and a scalar bool. + * @brief Per-event tor_tbool_bool: temporal OR of tbool and scalar bool. * * Generated by tools/codegen/codegen_nebula.py from the MEOS function - * `tor_tbool_bool`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), - * constructs a single-instant temporal, applies the operation, and returns FLOAT64 (0.0/1.0). + * `tor_tbool_bool`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class TorTboolBoolLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "TorTboolBool"; TorTboolBoolLogicalFunction(LogicalFunction value, - LogicalFunction threshold, - LogicalFunction ts); + LogicalFunction ts, + LogicalFunction arg0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/TorTboolTboolLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TorTboolTboolLogicalFunction.hpp index 113d6fee9a..a4f73efb2c 100644 --- a/nes-logical-operators/include/Functions/Meos/TorTboolTboolLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/TorTboolTboolLogicalFunction.hpp @@ -22,19 +22,18 @@ namespace NES { /** - * @brief Per-event tor_tbool_tbool: OR of two single-instant tbools. + * @brief Per-event tor_tbool_tbool: temporal OR of two tbool values (WKB result). * * Generated by tools/codegen/codegen_nebula.py from the MEOS function - * `tor_tbool_tbool`. Takes (value:FLOAT64, threshold:FLOAT64, ts:UINT64), - * constructs a single-instant temporal, applies the operation, and returns FLOAT64 (0.0/1.0). + * `tor_tbool_tbool`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class TorTboolTboolLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "TorTboolTbool"; - TorTboolTboolLogicalFunction(LogicalFunction value, - LogicalFunction threshold, - LogicalFunction ts); + TorTboolTboolLogicalFunction(LogicalFunction traj, + LogicalFunction arg0); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/TtextInitcapLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TtextInitcapLogicalFunction.hpp index 3e85db4bba..ce77982752 100644 --- a/nes-logical-operators/include/Functions/Meos/TtextInitcapLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/TtextInitcapLogicalFunction.hpp @@ -22,17 +22,18 @@ namespace NES { /** - * @brief Per-event ttext_initcap: single-instant ttext transform -> varchar. + * @brief Temporal text initcapcase * * Generated by tools/codegen/codegen_nebula.py from the MEOS function - * `ttext_initcap`. Per-event scalar operator; returns the transformed text value. + * `ttext_initcap`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class TtextInitcapLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "TtextInitcap"; TtextInitcapLogicalFunction(LogicalFunction value, - LogicalFunction ts); + LogicalFunction ts); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/TtextLowerLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TtextLowerLogicalFunction.hpp index 45e44997d6..e301f0506e 100644 --- a/nes-logical-operators/include/Functions/Meos/TtextLowerLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/TtextLowerLogicalFunction.hpp @@ -22,17 +22,18 @@ namespace NES { /** - * @brief Per-event ttext_lower: single-instant ttext transform -> varchar. + * @brief Temporal text lowercase * * Generated by tools/codegen/codegen_nebula.py from the MEOS function - * `ttext_lower`. Per-event scalar operator; returns the transformed text value. + * `ttext_lower`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class TtextLowerLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "TtextLower"; TtextLowerLogicalFunction(LogicalFunction value, - LogicalFunction ts); + LogicalFunction ts); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/include/Functions/Meos/TtextUpperLogicalFunction.hpp b/nes-logical-operators/include/Functions/Meos/TtextUpperLogicalFunction.hpp index 99766bbe6b..d6583ccc1b 100644 --- a/nes-logical-operators/include/Functions/Meos/TtextUpperLogicalFunction.hpp +++ b/nes-logical-operators/include/Functions/Meos/TtextUpperLogicalFunction.hpp @@ -22,17 +22,18 @@ namespace NES { /** - * @brief Per-event ttext_upper: single-instant ttext transform -> varchar. + * @brief Temporal text uppercase * * Generated by tools/codegen/codegen_nebula.py from the MEOS function - * `ttext_upper`. Per-event scalar operator; returns the transformed text value. + * `ttext_upper`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. */ class TtextUpperLogicalFunction : public LogicalFunctionConcept { public: static constexpr std::string_view NAME = "TtextUpper"; TtextUpperLogicalFunction(LogicalFunction value, - LogicalFunction ts); + LogicalFunction ts); DataType getDataType() const override; LogicalFunction withDataType(const DataType& dataType) const override; diff --git a/nes-logical-operators/src/Functions/Meos/AcontainsGeoTrgeometryLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AcontainsGeoTrgeometryLogicalFunction.cpp new file mode 100644 index 0000000000..149b4545e0 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AcontainsGeoTrgeometryLogicalFunction.cpp @@ -0,0 +1,87 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AcontainsGeoTrgeometryLogicalFunction::AcontainsGeoTrgeometryLogicalFunction(LogicalFunction tgt_wkt, LogicalFunction ref_wkt, LogicalFunction x1, LogicalFunction y1, LogicalFunction theta1, LogicalFunction ts1) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(6); + parameters.push_back(std::move(tgt_wkt)); + parameters.push_back(std::move(ref_wkt)); + parameters.push_back(std::move(x1)); + parameters.push_back(std::move(y1)); + parameters.push_back(std::move(theta1)); + parameters.push_back(std::move(ts1)); +} +DataType AcontainsGeoTrgeometryLogicalFunction::getDataType() const { return dataType; } +LogicalFunction AcontainsGeoTrgeometryLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } +std::vector AcontainsGeoTrgeometryLogicalFunction::getChildren() const { return parameters; } +LogicalFunction AcontainsGeoTrgeometryLogicalFunction::withChildren(const std::vector& children) const { + PRECONDITION(children.size()==6,"AcontainsGeoTrgeometryLogicalFunction requires 6 children, but got {}",children.size()); + auto c=*this; c.parameters=children; return c; +} +std::string_view AcontainsGeoTrgeometryLogicalFunction::getType() const { return NAME; } +bool AcontainsGeoTrgeometryLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + return false; +} +std::string AcontainsGeoTrgeometryLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("{}({})",NAME,parameters[0].explain(v)); +} +LogicalFunction AcontainsGeoTrgeometryLogicalFunction::withInferredDataType(const Schema& schema) const { + std::vector c; c.reserve(6); + for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "tgt_wkt must be VARSIZED"); + INVARIANT(c[1].getDataType().isType(DataType::Type::VARSIZED), "ref_wkt must be VARSIZED"); + INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "x1 must be FLOAT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::FLOAT64), "y1 must be FLOAT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "theta1 must be FLOAT64"); + INVARIANT(c[5].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); + return withChildren(c); +} +SerializableFunction AcontainsGeoTrgeometryLogicalFunction::serialize() const { + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + return proto; +} +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAcontainsGeoTrgeometryLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size()==6, + "AcontainsGeoTrgeometryLogicalFunction requires 6 children but got {}", + arguments.children.size()); + return AcontainsGeoTrgeometryLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4]), + std::move(arguments.children[5])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AcontainsTcbufferGeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AcontainsTcbufferGeoLogicalFunction.cpp index 9dac9b65de..23d13cd280 100644 --- a/nes-logical-operators/src/Functions/Meos/AcontainsTcbufferGeoLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/AcontainsTcbufferGeoLogicalFunction.cpp @@ -26,64 +26,83 @@ namespace NES { -AcontainsTcbufferGeoLogicalFunction::AcontainsTcbufferGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, - LogicalFunction radius, LogicalFunction ts, - LogicalFunction wkt) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +AcontainsTcbufferGeoLogicalFunction::AcontainsTcbufferGeoLogicalFunction(LogicalFunction lon, + LogicalFunction lat, + LogicalFunction radius, + LogicalFunction timestamp, + LogicalFunction geometry) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) { parameters.reserve(5); parameters.push_back(std::move(lon)); parameters.push_back(std::move(lat)); parameters.push_back(std::move(radius)); - parameters.push_back(std::move(ts)); - parameters.push_back(std::move(wkt)); + parameters.push_back(std::move(timestamp)); + parameters.push_back(std::move(geometry)); } -DataType AcontainsTcbufferGeoLogicalFunction::getDataType() const { return dataType; } +DataType AcontainsTcbufferGeoLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction AcontainsTcbufferGeoLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector AcontainsTcbufferGeoLogicalFunction::getChildren() const { return parameters; } +std::vector AcontainsTcbufferGeoLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction AcontainsTcbufferGeoLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 5, - "AcontainsTcbufferGeoLogicalFunction requires 5 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 5, "AcontainsTcbufferGeoLogicalFunction requires 5 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view AcontainsTcbufferGeoLogicalFunction::getType() const { return NAME; } +std::string_view AcontainsTcbufferGeoLogicalFunction::getType() const +{ + return NAME; +} bool AcontainsTcbufferGeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string AcontainsTcbufferGeoLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction AcontainsTcbufferGeoLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(5); - c.emplace_back(parameters[0].withInferredDataType(schema)); - c.emplace_back(parameters[1].withInferredDataType(schema)); - c.emplace_back(parameters[2].withInferredDataType(schema)); - c.emplace_back(parameters[3].withInferredDataType(schema)); - c.emplace_back(parameters[4].withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon must be FLOAT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat must be FLOAT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "radius must be FLOAT64"); - INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); - INVARIANT(c[4].getDataType().isType(DataType::Type::VARSIZED), "wkt must be VARCHAR"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction AcontainsTcbufferGeoLogicalFunction::serialize() const @@ -92,7 +111,9 @@ SerializableFunction AcontainsTcbufferGeoLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -102,11 +123,12 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAco PRECONDITION(arguments.children.size() == 5, "AcontainsTcbufferGeoLogicalFunction requires 5 children but got {}", arguments.children.size()); - return AcontainsTcbufferGeoLogicalFunction(std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2]), - std::move(arguments.children[3]), - std::move(arguments.children[4])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + return AcontainsTcbufferGeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AcontainsTcbufferTcbufferLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AcontainsTcbufferTcbufferLogicalFunction.cpp new file mode 100644 index 0000000000..49de10fe42 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AcontainsTcbufferTcbufferLogicalFunction.cpp @@ -0,0 +1,143 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AcontainsTcbufferTcbufferLogicalFunction::AcontainsTcbufferTcbufferLogicalFunction(LogicalFunction lonA, + LogicalFunction latA, + LogicalFunction radiusA, + LogicalFunction tsA, + LogicalFunction lonB, + LogicalFunction latB, + LogicalFunction radiusB, + LogicalFunction tsB) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) +{ + parameters.reserve(8); + parameters.push_back(std::move(lonA)); + parameters.push_back(std::move(latA)); + parameters.push_back(std::move(radiusA)); + parameters.push_back(std::move(tsA)); + parameters.push_back(std::move(lonB)); + parameters.push_back(std::move(latB)); + parameters.push_back(std::move(radiusB)); + parameters.push_back(std::move(tsB)); +} + +DataType AcontainsTcbufferTcbufferLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction AcontainsTcbufferTcbufferLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector AcontainsTcbufferTcbufferLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction AcontainsTcbufferTcbufferLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 8, "AcontainsTcbufferTcbufferLogicalFunction requires 8 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; +} + +std::string_view AcontainsTcbufferTcbufferLogicalFunction::getType() const +{ + return NAME; +} + +bool AcontainsTcbufferTcbufferLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } + return false; +} + +std::string AcontainsTcbufferTcbufferLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction AcontainsTcbufferTcbufferLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); +} + +SerializableFunction AcontainsTcbufferTcbufferLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAcontainsTcbufferTcbufferLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 8, + "AcontainsTcbufferTcbufferLogicalFunction requires 8 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + auto arg5 = std::move(arguments.children[5]); + auto arg6 = std::move(arguments.children[6]); + auto arg7 = std::move(arguments.children[7]); + return AcontainsTcbufferTcbufferLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6), std::move(arg7)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AcontainsTgeoGeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AcontainsTgeoGeoLogicalFunction.cpp index b4ded1a783..5fde5170e4 100644 --- a/nes-logical-operators/src/Functions/Meos/AcontainsTgeoGeoLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/AcontainsTgeoGeoLogicalFunction.cpp @@ -26,60 +26,81 @@ namespace NES { -AcontainsTgeoGeoLogicalFunction::AcontainsTgeoGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, - LogicalFunction ts, LogicalFunction wkt) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +AcontainsTgeoGeoLogicalFunction::AcontainsTgeoGeoLogicalFunction(LogicalFunction lon, + LogicalFunction lat, + LogicalFunction timestamp, + LogicalFunction geometry) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) { parameters.reserve(4); parameters.push_back(std::move(lon)); parameters.push_back(std::move(lat)); - parameters.push_back(std::move(ts)); - parameters.push_back(std::move(wkt)); + parameters.push_back(std::move(timestamp)); + parameters.push_back(std::move(geometry)); } -DataType AcontainsTgeoGeoLogicalFunction::getDataType() const { return dataType; } +DataType AcontainsTgeoGeoLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction AcontainsTgeoGeoLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector AcontainsTgeoGeoLogicalFunction::getChildren() const { return parameters; } +std::vector AcontainsTgeoGeoLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction AcontainsTgeoGeoLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 4, - "AcontainsTgeoGeoLogicalFunction requires 4 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 4, "AcontainsTgeoGeoLogicalFunction requires 4 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view AcontainsTgeoGeoLogicalFunction::getType() const { return NAME; } +std::string_view AcontainsTgeoGeoLogicalFunction::getType() const +{ + return NAME; +} bool AcontainsTgeoGeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string AcontainsTgeoGeoLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction AcontainsTgeoGeoLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(4); - c.emplace_back(parameters[0].withInferredDataType(schema)); - c.emplace_back(parameters[1].withInferredDataType(schema)); - c.emplace_back(parameters[2].withInferredDataType(schema)); - c.emplace_back(parameters[3].withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon must be FLOAT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat must be FLOAT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); - INVARIANT(c[3].getDataType().isType(DataType::Type::VARSIZED),"wkt must be VARSIZED"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction AcontainsTgeoGeoLogicalFunction::serialize() const @@ -88,7 +109,9 @@ SerializableFunction AcontainsTgeoGeoLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -98,10 +121,11 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAco PRECONDITION(arguments.children.size() == 4, "AcontainsTgeoGeoLogicalFunction requires 4 children but got {}", arguments.children.size()); - return AcontainsTgeoGeoLogicalFunction(std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2]), - std::move(arguments.children[3])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + return AcontainsTgeoGeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AcontainsTgeoTgeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AcontainsTgeoTgeoLogicalFunction.cpp index bf5ed84ba0..677048ed17 100644 --- a/nes-logical-operators/src/Functions/Meos/AcontainsTgeoTgeoLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/AcontainsTgeoTgeoLogicalFunction.cpp @@ -26,61 +26,85 @@ namespace NES { -AcontainsTgeoTgeoLogicalFunction::AcontainsTgeoTgeoLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction ts1, LogicalFunction lon2, LogicalFunction lat2, LogicalFunction ts2) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +AcontainsTgeoTgeoLogicalFunction::AcontainsTgeoTgeoLogicalFunction(LogicalFunction lonA, + LogicalFunction latA, + LogicalFunction tsA, + LogicalFunction lonB, + LogicalFunction latB, + LogicalFunction tsB) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) { parameters.reserve(6); - parameters.push_back(std::move(lon1)); - parameters.push_back(std::move(lat1)); - parameters.push_back(std::move(ts1)); - parameters.push_back(std::move(lon2)); - parameters.push_back(std::move(lat2)); - parameters.push_back(std::move(ts2)); + parameters.push_back(std::move(lonA)); + parameters.push_back(std::move(latA)); + parameters.push_back(std::move(tsA)); + parameters.push_back(std::move(lonB)); + parameters.push_back(std::move(latB)); + parameters.push_back(std::move(tsB)); } -DataType AcontainsTgeoTgeoLogicalFunction::getDataType() const { return dataType; } +DataType AcontainsTgeoTgeoLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction AcontainsTgeoTgeoLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector AcontainsTgeoTgeoLogicalFunction::getChildren() const { return parameters; } +std::vector AcontainsTgeoTgeoLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction AcontainsTgeoTgeoLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 6, - "AcontainsTgeoTgeoLogicalFunction requires 6 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 6, "AcontainsTgeoTgeoLogicalFunction requires 6 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view AcontainsTgeoTgeoLogicalFunction::getType() const { return NAME; } +std::string_view AcontainsTgeoTgeoLogicalFunction::getType() const +{ + return NAME; +} bool AcontainsTgeoTgeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string AcontainsTgeoTgeoLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction AcontainsTgeoTgeoLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(6); - for (const auto& p : parameters) - c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon1 must be FLOAT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat1 must be FLOAT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); - INVARIANT(c[3].getDataType().isType(DataType::Type::FLOAT64), "lon2 must be FLOAT64"); - INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "lat2 must be FLOAT64"); - INVARIANT(c[5].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction AcontainsTgeoTgeoLogicalFunction::serialize() const @@ -89,7 +113,9 @@ SerializableFunction AcontainsTgeoTgeoLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -99,13 +125,13 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAco PRECONDITION(arguments.children.size() == 6, "AcontainsTgeoTgeoLogicalFunction requires 6 children but got {}", arguments.children.size()); - return AcontainsTgeoTgeoLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2]), - std::move(arguments.children[3]), - std::move(arguments.children[4]), - std::move(arguments.children[5])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + auto arg5 = std::move(arguments.children[5]); + return AcontainsTgeoTgeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AcoversGeoTrgeometryLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AcoversGeoTrgeometryLogicalFunction.cpp new file mode 100644 index 0000000000..64cbfcf348 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AcoversGeoTrgeometryLogicalFunction.cpp @@ -0,0 +1,87 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AcoversGeoTrgeometryLogicalFunction::AcoversGeoTrgeometryLogicalFunction(LogicalFunction tgt_wkt, LogicalFunction ref_wkt, LogicalFunction x1, LogicalFunction y1, LogicalFunction theta1, LogicalFunction ts1) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(6); + parameters.push_back(std::move(tgt_wkt)); + parameters.push_back(std::move(ref_wkt)); + parameters.push_back(std::move(x1)); + parameters.push_back(std::move(y1)); + parameters.push_back(std::move(theta1)); + parameters.push_back(std::move(ts1)); +} +DataType AcoversGeoTrgeometryLogicalFunction::getDataType() const { return dataType; } +LogicalFunction AcoversGeoTrgeometryLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } +std::vector AcoversGeoTrgeometryLogicalFunction::getChildren() const { return parameters; } +LogicalFunction AcoversGeoTrgeometryLogicalFunction::withChildren(const std::vector& children) const { + PRECONDITION(children.size()==6,"AcoversGeoTrgeometryLogicalFunction requires 6 children, but got {}",children.size()); + auto c=*this; c.parameters=children; return c; +} +std::string_view AcoversGeoTrgeometryLogicalFunction::getType() const { return NAME; } +bool AcoversGeoTrgeometryLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + return false; +} +std::string AcoversGeoTrgeometryLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("{}({})",NAME,parameters[0].explain(v)); +} +LogicalFunction AcoversGeoTrgeometryLogicalFunction::withInferredDataType(const Schema& schema) const { + std::vector c; c.reserve(6); + for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "tgt_wkt must be VARSIZED"); + INVARIANT(c[1].getDataType().isType(DataType::Type::VARSIZED), "ref_wkt must be VARSIZED"); + INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "x1 must be FLOAT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::FLOAT64), "y1 must be FLOAT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "theta1 must be FLOAT64"); + INVARIANT(c[5].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); + return withChildren(c); +} +SerializableFunction AcoversGeoTrgeometryLogicalFunction::serialize() const { + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + return proto; +} +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAcoversGeoTrgeometryLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size()==6, + "AcoversGeoTrgeometryLogicalFunction requires 6 children but got {}", + arguments.children.size()); + return AcoversGeoTrgeometryLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4]), + std::move(arguments.children[5])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AcoversTcbufferGeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AcoversTcbufferGeoLogicalFunction.cpp index 1d26b552ca..2317235569 100644 --- a/nes-logical-operators/src/Functions/Meos/AcoversTcbufferGeoLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/AcoversTcbufferGeoLogicalFunction.cpp @@ -26,64 +26,83 @@ namespace NES { -AcoversTcbufferGeoLogicalFunction::AcoversTcbufferGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, - LogicalFunction radius, LogicalFunction ts, - LogicalFunction wkt) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +AcoversTcbufferGeoLogicalFunction::AcoversTcbufferGeoLogicalFunction(LogicalFunction lon, + LogicalFunction lat, + LogicalFunction radius, + LogicalFunction timestamp, + LogicalFunction geometry) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) { parameters.reserve(5); parameters.push_back(std::move(lon)); parameters.push_back(std::move(lat)); parameters.push_back(std::move(radius)); - parameters.push_back(std::move(ts)); - parameters.push_back(std::move(wkt)); + parameters.push_back(std::move(timestamp)); + parameters.push_back(std::move(geometry)); } -DataType AcoversTcbufferGeoLogicalFunction::getDataType() const { return dataType; } +DataType AcoversTcbufferGeoLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction AcoversTcbufferGeoLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector AcoversTcbufferGeoLogicalFunction::getChildren() const { return parameters; } +std::vector AcoversTcbufferGeoLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction AcoversTcbufferGeoLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 5, - "AcoversTcbufferGeoLogicalFunction requires 5 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 5, "AcoversTcbufferGeoLogicalFunction requires 5 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view AcoversTcbufferGeoLogicalFunction::getType() const { return NAME; } +std::string_view AcoversTcbufferGeoLogicalFunction::getType() const +{ + return NAME; +} bool AcoversTcbufferGeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string AcoversTcbufferGeoLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction AcoversTcbufferGeoLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(5); - c.emplace_back(parameters[0].withInferredDataType(schema)); - c.emplace_back(parameters[1].withInferredDataType(schema)); - c.emplace_back(parameters[2].withInferredDataType(schema)); - c.emplace_back(parameters[3].withInferredDataType(schema)); - c.emplace_back(parameters[4].withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon must be FLOAT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat must be FLOAT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "radius must be FLOAT64"); - INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); - INVARIANT(c[4].getDataType().isType(DataType::Type::VARSIZED), "wkt must be VARCHAR"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction AcoversTcbufferGeoLogicalFunction::serialize() const @@ -92,7 +111,9 @@ SerializableFunction AcoversTcbufferGeoLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -102,11 +123,12 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAco PRECONDITION(arguments.children.size() == 5, "AcoversTcbufferGeoLogicalFunction requires 5 children but got {}", arguments.children.size()); - return AcoversTcbufferGeoLogicalFunction(std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2]), - std::move(arguments.children[3]), - std::move(arguments.children[4])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + return AcoversTcbufferGeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AcoversTcbufferTcbufferLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AcoversTcbufferTcbufferLogicalFunction.cpp index afced174f2..1616096392 100644 --- a/nes-logical-operators/src/Functions/Meos/AcoversTcbufferTcbufferLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/AcoversTcbufferTcbufferLogicalFunction.cpp @@ -26,67 +26,89 @@ namespace NES { -AcoversTcbufferTcbufferLogicalFunction::AcoversTcbufferTcbufferLogicalFunction( - LogicalFunction lon1, LogicalFunction lat1, LogicalFunction r1, LogicalFunction ts1, - LogicalFunction lon2, LogicalFunction lat2, LogicalFunction r2, LogicalFunction ts2) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +AcoversTcbufferTcbufferLogicalFunction::AcoversTcbufferTcbufferLogicalFunction(LogicalFunction lonA, + LogicalFunction latA, + LogicalFunction radiusA, + LogicalFunction tsA, + LogicalFunction lonB, + LogicalFunction latB, + LogicalFunction radiusB, + LogicalFunction tsB) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) { parameters.reserve(8); - parameters.push_back(std::move(lon1)); - parameters.push_back(std::move(lat1)); - parameters.push_back(std::move(r1)); - parameters.push_back(std::move(ts1)); - parameters.push_back(std::move(lon2)); - parameters.push_back(std::move(lat2)); - parameters.push_back(std::move(r2)); - parameters.push_back(std::move(ts2)); + parameters.push_back(std::move(lonA)); + parameters.push_back(std::move(latA)); + parameters.push_back(std::move(radiusA)); + parameters.push_back(std::move(tsA)); + parameters.push_back(std::move(lonB)); + parameters.push_back(std::move(latB)); + parameters.push_back(std::move(radiusB)); + parameters.push_back(std::move(tsB)); } -DataType AcoversTcbufferTcbufferLogicalFunction::getDataType() const { return dataType; } +DataType AcoversTcbufferTcbufferLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction AcoversTcbufferTcbufferLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector AcoversTcbufferTcbufferLogicalFunction::getChildren() const { return parameters; } +std::vector AcoversTcbufferTcbufferLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction AcoversTcbufferTcbufferLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 8, - "AcoversTcbufferTcbufferLogicalFunction requires 8 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 8, "AcoversTcbufferTcbufferLogicalFunction requires 8 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view AcoversTcbufferTcbufferLogicalFunction::getType() const { return NAME; } +std::string_view AcoversTcbufferTcbufferLogicalFunction::getType() const +{ + return NAME; +} bool AcoversTcbufferTcbufferLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string AcoversTcbufferTcbufferLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction AcoversTcbufferTcbufferLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(8); - for (const auto& p : parameters) - c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon1 must be FLOAT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat1 must be FLOAT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "r1 must be FLOAT64"); - INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); - INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "lon2 must be FLOAT64"); - INVARIANT(c[5].getDataType().isType(DataType::Type::FLOAT64), "lat2 must be FLOAT64"); - INVARIANT(c[6].getDataType().isType(DataType::Type::FLOAT64), "r2 must be FLOAT64"); - INVARIANT(c[7].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction AcoversTcbufferTcbufferLogicalFunction::serialize() const @@ -95,7 +117,9 @@ SerializableFunction AcoversTcbufferTcbufferLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -105,14 +129,15 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAco PRECONDITION(arguments.children.size() == 8, "AcoversTcbufferTcbufferLogicalFunction requires 8 children but got {}", arguments.children.size()); - return AcoversTcbufferTcbufferLogicalFunction(std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2]), - std::move(arguments.children[3]), - std::move(arguments.children[4]), - std::move(arguments.children[5]), - std::move(arguments.children[6]), - std::move(arguments.children[7])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + auto arg5 = std::move(arguments.children[5]); + auto arg6 = std::move(arguments.children[6]); + auto arg7 = std::move(arguments.children[7]); + return AcoversTcbufferTcbufferLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6), std::move(arg7)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AcoversTgeoGeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AcoversTgeoGeoLogicalFunction.cpp index 38f41209dc..4192a9ad20 100644 --- a/nes-logical-operators/src/Functions/Meos/AcoversTgeoGeoLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/AcoversTgeoGeoLogicalFunction.cpp @@ -26,60 +26,81 @@ namespace NES { -AcoversTgeoGeoLogicalFunction::AcoversTgeoGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, - LogicalFunction ts, LogicalFunction wkt) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +AcoversTgeoGeoLogicalFunction::AcoversTgeoGeoLogicalFunction(LogicalFunction lon, + LogicalFunction lat, + LogicalFunction timestamp, + LogicalFunction geometry) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) { parameters.reserve(4); parameters.push_back(std::move(lon)); parameters.push_back(std::move(lat)); - parameters.push_back(std::move(ts)); - parameters.push_back(std::move(wkt)); + parameters.push_back(std::move(timestamp)); + parameters.push_back(std::move(geometry)); } -DataType AcoversTgeoGeoLogicalFunction::getDataType() const { return dataType; } +DataType AcoversTgeoGeoLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction AcoversTgeoGeoLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector AcoversTgeoGeoLogicalFunction::getChildren() const { return parameters; } +std::vector AcoversTgeoGeoLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction AcoversTgeoGeoLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 4, - "AcoversTgeoGeoLogicalFunction requires 4 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 4, "AcoversTgeoGeoLogicalFunction requires 4 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view AcoversTgeoGeoLogicalFunction::getType() const { return NAME; } +std::string_view AcoversTgeoGeoLogicalFunction::getType() const +{ + return NAME; +} bool AcoversTgeoGeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string AcoversTgeoGeoLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction AcoversTgeoGeoLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(4); - c.emplace_back(parameters[0].withInferredDataType(schema)); - c.emplace_back(parameters[1].withInferredDataType(schema)); - c.emplace_back(parameters[2].withInferredDataType(schema)); - c.emplace_back(parameters[3].withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon must be FLOAT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat must be FLOAT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); - INVARIANT(c[3].getDataType().isType(DataType::Type::VARSIZED),"wkt must be VARSIZED"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction AcoversTgeoGeoLogicalFunction::serialize() const @@ -88,7 +109,9 @@ SerializableFunction AcoversTgeoGeoLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -98,10 +121,11 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAco PRECONDITION(arguments.children.size() == 4, "AcoversTgeoGeoLogicalFunction requires 4 children but got {}", arguments.children.size()); - return AcoversTgeoGeoLogicalFunction(std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2]), - std::move(arguments.children[3])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + return AcoversTgeoGeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AcoversTgeoTgeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AcoversTgeoTgeoLogicalFunction.cpp index fd3a00853d..01307dbe67 100644 --- a/nes-logical-operators/src/Functions/Meos/AcoversTgeoTgeoLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/AcoversTgeoTgeoLogicalFunction.cpp @@ -26,61 +26,85 @@ namespace NES { -AcoversTgeoTgeoLogicalFunction::AcoversTgeoTgeoLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction ts1, LogicalFunction lon2, LogicalFunction lat2, LogicalFunction ts2) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +AcoversTgeoTgeoLogicalFunction::AcoversTgeoTgeoLogicalFunction(LogicalFunction lonA, + LogicalFunction latA, + LogicalFunction tsA, + LogicalFunction lonB, + LogicalFunction latB, + LogicalFunction tsB) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) { parameters.reserve(6); - parameters.push_back(std::move(lon1)); - parameters.push_back(std::move(lat1)); - parameters.push_back(std::move(ts1)); - parameters.push_back(std::move(lon2)); - parameters.push_back(std::move(lat2)); - parameters.push_back(std::move(ts2)); + parameters.push_back(std::move(lonA)); + parameters.push_back(std::move(latA)); + parameters.push_back(std::move(tsA)); + parameters.push_back(std::move(lonB)); + parameters.push_back(std::move(latB)); + parameters.push_back(std::move(tsB)); } -DataType AcoversTgeoTgeoLogicalFunction::getDataType() const { return dataType; } +DataType AcoversTgeoTgeoLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction AcoversTgeoTgeoLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector AcoversTgeoTgeoLogicalFunction::getChildren() const { return parameters; } +std::vector AcoversTgeoTgeoLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction AcoversTgeoTgeoLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 6, - "AcoversTgeoTgeoLogicalFunction requires 6 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 6, "AcoversTgeoTgeoLogicalFunction requires 6 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view AcoversTgeoTgeoLogicalFunction::getType() const { return NAME; } +std::string_view AcoversTgeoTgeoLogicalFunction::getType() const +{ + return NAME; +} bool AcoversTgeoTgeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string AcoversTgeoTgeoLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction AcoversTgeoTgeoLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(6); - for (const auto& p : parameters) - c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon1 must be FLOAT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat1 must be FLOAT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); - INVARIANT(c[3].getDataType().isType(DataType::Type::FLOAT64), "lon2 must be FLOAT64"); - INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "lat2 must be FLOAT64"); - INVARIANT(c[5].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction AcoversTgeoTgeoLogicalFunction::serialize() const @@ -89,7 +113,9 @@ SerializableFunction AcoversTgeoTgeoLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -99,13 +125,13 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAco PRECONDITION(arguments.children.size() == 6, "AcoversTgeoTgeoLogicalFunction requires 6 children but got {}", arguments.children.size()); - return AcoversTgeoTgeoLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2]), - std::move(arguments.children[3]), - std::move(arguments.children[4]), - std::move(arguments.children[5])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + auto arg5 = std::move(arguments.children[5]); + return AcoversTgeoTgeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AcoversTrgeometryGeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AcoversTrgeometryGeoLogicalFunction.cpp new file mode 100644 index 0000000000..e421ef2b37 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AcoversTrgeometryGeoLogicalFunction.cpp @@ -0,0 +1,87 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AcoversTrgeometryGeoLogicalFunction::AcoversTrgeometryGeoLogicalFunction(LogicalFunction ref_wkt, LogicalFunction x1, LogicalFunction y1, LogicalFunction theta1, LogicalFunction ts1, LogicalFunction tgt_wkt) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(6); + parameters.push_back(std::move(ref_wkt)); + parameters.push_back(std::move(x1)); + parameters.push_back(std::move(y1)); + parameters.push_back(std::move(theta1)); + parameters.push_back(std::move(ts1)); + parameters.push_back(std::move(tgt_wkt)); +} +DataType AcoversTrgeometryGeoLogicalFunction::getDataType() const { return dataType; } +LogicalFunction AcoversTrgeometryGeoLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } +std::vector AcoversTrgeometryGeoLogicalFunction::getChildren() const { return parameters; } +LogicalFunction AcoversTrgeometryGeoLogicalFunction::withChildren(const std::vector& children) const { + PRECONDITION(children.size()==6,"AcoversTrgeometryGeoLogicalFunction requires 6 children, but got {}",children.size()); + auto c=*this; c.parameters=children; return c; +} +std::string_view AcoversTrgeometryGeoLogicalFunction::getType() const { return NAME; } +bool AcoversTrgeometryGeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + return false; +} +std::string AcoversTrgeometryGeoLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("{}({})",NAME,parameters[0].explain(v)); +} +LogicalFunction AcoversTrgeometryGeoLogicalFunction::withInferredDataType(const Schema& schema) const { + std::vector c; c.reserve(6); + for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "ref_wkt must be VARSIZED"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "x1 must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "y1 must be FLOAT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::FLOAT64), "theta1 must be FLOAT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); + INVARIANT(c[5].getDataType().isType(DataType::Type::VARSIZED), "tgt_wkt must be VARSIZED"); + return withChildren(c); +} +SerializableFunction AcoversTrgeometryGeoLogicalFunction::serialize() const { + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + return proto; +} +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAcoversTrgeometryGeoLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size()==6, + "AcoversTrgeometryGeoLogicalFunction requires 6 children but got {}", + arguments.children.size()); + return AcoversTrgeometryGeoLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4]), + std::move(arguments.children[5])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AddBigintTbigintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AddBigintTbigintLogicalFunction.cpp index 4c0eae2820..66eb8dfebb 100644 --- a/nes-logical-operators/src/Functions/Meos/AddBigintTbigintLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/AddBigintTbigintLogicalFunction.cpp @@ -26,46 +26,65 @@ namespace NES { -AddBigintTbigintLogicalFunction::AddBigintTbigintLogicalFunction(LogicalFunction scalar, - LogicalFunction value, - LogicalFunction ts) +AddBigintTbigintLogicalFunction::AddBigintTbigintLogicalFunction(LogicalFunction arg0, + LogicalFunction value, + LogicalFunction ts) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(3); - parameters.push_back(std::move(scalar)); + parameters.push_back(std::move(arg0)); parameters.push_back(std::move(value)); parameters.push_back(std::move(ts)); } -DataType AddBigintTbigintLogicalFunction::getDataType() const { return dataType; } +DataType AddBigintTbigintLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction AddBigintTbigintLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector AddBigintTbigintLogicalFunction::getChildren() const { return parameters; } +std::vector AddBigintTbigintLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction AddBigintTbigintLogicalFunction::withChildren(const std::vector& children) const { PRECONDITION(children.size() == 3, "AddBigintTbigintLogicalFunction requires 3 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view AddBigintTbigintLogicalFunction::getType() const { return NAME; } +std::string_view AddBigintTbigintLogicalFunction::getType() const +{ + return NAME; +} bool AddBigintTbigintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string AddBigintTbigintLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -76,7 +95,9 @@ LogicalFunction AddBigintTbigintLogicalFunction::withInferredDataType(const Sche std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -86,7 +107,9 @@ SerializableFunction AddBigintTbigintLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } diff --git a/nes-logical-operators/src/Functions/Meos/AddFloatTfloatLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AddFloatTfloatLogicalFunction.cpp index 80d3f44e21..94237e2dee 100644 --- a/nes-logical-operators/src/Functions/Meos/AddFloatTfloatLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/AddFloatTfloatLogicalFunction.cpp @@ -26,46 +26,65 @@ namespace NES { -AddFloatTfloatLogicalFunction::AddFloatTfloatLogicalFunction(LogicalFunction scalar, - LogicalFunction value, - LogicalFunction ts) +AddFloatTfloatLogicalFunction::AddFloatTfloatLogicalFunction(LogicalFunction arg0, + LogicalFunction value, + LogicalFunction ts) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(3); - parameters.push_back(std::move(scalar)); + parameters.push_back(std::move(arg0)); parameters.push_back(std::move(value)); parameters.push_back(std::move(ts)); } -DataType AddFloatTfloatLogicalFunction::getDataType() const { return dataType; } +DataType AddFloatTfloatLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction AddFloatTfloatLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector AddFloatTfloatLogicalFunction::getChildren() const { return parameters; } +std::vector AddFloatTfloatLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction AddFloatTfloatLogicalFunction::withChildren(const std::vector& children) const { PRECONDITION(children.size() == 3, "AddFloatTfloatLogicalFunction requires 3 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view AddFloatTfloatLogicalFunction::getType() const { return NAME; } +std::string_view AddFloatTfloatLogicalFunction::getType() const +{ + return NAME; +} bool AddFloatTfloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string AddFloatTfloatLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -76,7 +95,9 @@ LogicalFunction AddFloatTfloatLogicalFunction::withInferredDataType(const Schema std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -86,7 +107,9 @@ SerializableFunction AddFloatTfloatLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } diff --git a/nes-logical-operators/src/Functions/Meos/AddIntTintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AddIntTintLogicalFunction.cpp index 184848e839..3e76ac0d2b 100644 --- a/nes-logical-operators/src/Functions/Meos/AddIntTintLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/AddIntTintLogicalFunction.cpp @@ -26,46 +26,65 @@ namespace NES { -AddIntTintLogicalFunction::AddIntTintLogicalFunction(LogicalFunction scalar, - LogicalFunction value, - LogicalFunction ts) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +AddIntTintLogicalFunction::AddIntTintLogicalFunction(LogicalFunction arg0, + LogicalFunction value, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) { parameters.reserve(3); - parameters.push_back(std::move(scalar)); + parameters.push_back(std::move(arg0)); parameters.push_back(std::move(value)); parameters.push_back(std::move(ts)); } -DataType AddIntTintLogicalFunction::getDataType() const { return dataType; } +DataType AddIntTintLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction AddIntTintLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector AddIntTintLogicalFunction::getChildren() const { return parameters; } +std::vector AddIntTintLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction AddIntTintLogicalFunction::withChildren(const std::vector& children) const { PRECONDITION(children.size() == 3, "AddIntTintLogicalFunction requires 3 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view AddIntTintLogicalFunction::getType() const { return NAME; } +std::string_view AddIntTintLogicalFunction::getType() const +{ + return NAME; +} bool AddIntTintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string AddIntTintLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -76,7 +95,9 @@ LogicalFunction AddIntTintLogicalFunction::withInferredDataType(const Schema& sc std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -86,7 +107,9 @@ SerializableFunction AddIntTintLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } diff --git a/nes-logical-operators/src/Functions/Meos/AddTbigintBigintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AddTbigintBigintLogicalFunction.cpp index 68d4e06d74..aea382eef6 100644 --- a/nes-logical-operators/src/Functions/Meos/AddTbigintBigintLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/AddTbigintBigintLogicalFunction.cpp @@ -27,45 +27,64 @@ namespace NES { AddTbigintBigintLogicalFunction::AddTbigintBigintLogicalFunction(LogicalFunction value, - LogicalFunction ts, - LogicalFunction addend) + LogicalFunction ts, + LogicalFunction arg0) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(3); parameters.push_back(std::move(value)); parameters.push_back(std::move(ts)); - parameters.push_back(std::move(addend)); + parameters.push_back(std::move(arg0)); } -DataType AddTbigintBigintLogicalFunction::getDataType() const { return dataType; } +DataType AddTbigintBigintLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction AddTbigintBigintLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector AddTbigintBigintLogicalFunction::getChildren() const { return parameters; } +std::vector AddTbigintBigintLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction AddTbigintBigintLogicalFunction::withChildren(const std::vector& children) const { PRECONDITION(children.size() == 3, "AddTbigintBigintLogicalFunction requires 3 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view AddTbigintBigintLogicalFunction::getType() const { return NAME; } +std::string_view AddTbigintBigintLogicalFunction::getType() const +{ + return NAME; +} bool AddTbigintBigintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string AddTbigintBigintLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -76,7 +95,9 @@ LogicalFunction AddTbigintBigintLogicalFunction::withInferredDataType(const Sche std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -86,7 +107,9 @@ SerializableFunction AddTbigintBigintLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } diff --git a/nes-logical-operators/src/Functions/Meos/AddTfloatFloatLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AddTfloatFloatLogicalFunction.cpp index 6cc26a04a5..ea96bd0a3c 100644 --- a/nes-logical-operators/src/Functions/Meos/AddTfloatFloatLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/AddTfloatFloatLogicalFunction.cpp @@ -27,45 +27,64 @@ namespace NES { AddTfloatFloatLogicalFunction::AddTfloatFloatLogicalFunction(LogicalFunction value, - LogicalFunction ts, - LogicalFunction addend) + LogicalFunction ts, + LogicalFunction arg0) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(3); parameters.push_back(std::move(value)); parameters.push_back(std::move(ts)); - parameters.push_back(std::move(addend)); + parameters.push_back(std::move(arg0)); } -DataType AddTfloatFloatLogicalFunction::getDataType() const { return dataType; } +DataType AddTfloatFloatLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction AddTfloatFloatLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector AddTfloatFloatLogicalFunction::getChildren() const { return parameters; } +std::vector AddTfloatFloatLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction AddTfloatFloatLogicalFunction::withChildren(const std::vector& children) const { PRECONDITION(children.size() == 3, "AddTfloatFloatLogicalFunction requires 3 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view AddTfloatFloatLogicalFunction::getType() const { return NAME; } +std::string_view AddTfloatFloatLogicalFunction::getType() const +{ + return NAME; +} bool AddTfloatFloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string AddTfloatFloatLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -76,7 +95,9 @@ LogicalFunction AddTfloatFloatLogicalFunction::withInferredDataType(const Schema std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -86,7 +107,9 @@ SerializableFunction AddTfloatFloatLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } diff --git a/nes-logical-operators/src/Functions/Meos/AddTintIntLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AddTintIntLogicalFunction.cpp index a788921856..15522e06dc 100644 --- a/nes-logical-operators/src/Functions/Meos/AddTintIntLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/AddTintIntLogicalFunction.cpp @@ -27,45 +27,64 @@ namespace NES { AddTintIntLogicalFunction::AddTintIntLogicalFunction(LogicalFunction value, - LogicalFunction ts, - LogicalFunction addend) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) + LogicalFunction ts, + LogicalFunction arg0) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) { parameters.reserve(3); parameters.push_back(std::move(value)); parameters.push_back(std::move(ts)); - parameters.push_back(std::move(addend)); + parameters.push_back(std::move(arg0)); } -DataType AddTintIntLogicalFunction::getDataType() const { return dataType; } +DataType AddTintIntLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction AddTintIntLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector AddTintIntLogicalFunction::getChildren() const { return parameters; } +std::vector AddTintIntLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction AddTintIntLogicalFunction::withChildren(const std::vector& children) const { PRECONDITION(children.size() == 3, "AddTintIntLogicalFunction requires 3 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view AddTintIntLogicalFunction::getType() const { return NAME; } +std::string_view AddTintIntLogicalFunction::getType() const +{ + return NAME; +} bool AddTintIntLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string AddTintIntLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -76,7 +95,9 @@ LogicalFunction AddTintIntLogicalFunction::withInferredDataType(const Schema& sc std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -86,7 +107,9 @@ SerializableFunction AddTintIntLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } diff --git a/nes-logical-operators/src/Functions/Meos/AddTnumberTnumberLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AddTnumberTnumberLogicalFunction.cpp index 223f155801..01c804b1b8 100644 --- a/nes-logical-operators/src/Functions/Meos/AddTnumberTnumberLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/AddTnumberTnumberLogicalFunction.cpp @@ -26,46 +26,63 @@ namespace NES { -AddTnumberTnumberLogicalFunction::AddTnumberTnumberLogicalFunction(LogicalFunction value1, - LogicalFunction value2, - LogicalFunction ts) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +AddTnumberTnumberLogicalFunction::AddTnumberTnumberLogicalFunction(LogicalFunction traj, + LogicalFunction arg0) + : dataType(DataTypeProvider::provideDataType(DataType::Type::VARSIZED)) { - parameters.reserve(3); - parameters.push_back(std::move(value1)); - parameters.push_back(std::move(value2)); - parameters.push_back(std::move(ts)); + parameters.reserve(2); + parameters.push_back(std::move(traj)); + parameters.push_back(std::move(arg0)); } -DataType AddTnumberTnumberLogicalFunction::getDataType() const { return dataType; } +DataType AddTnumberTnumberLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction AddTnumberTnumberLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector AddTnumberTnumberLogicalFunction::getChildren() const { return parameters; } +std::vector AddTnumberTnumberLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction AddTnumberTnumberLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 3, "AddTnumberTnumberLogicalFunction requires 3 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 2, "AddTnumberTnumberLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view AddTnumberTnumberLogicalFunction::getType() const { return NAME; } +std::string_view AddTnumberTnumberLogicalFunction::getType() const +{ + return NAME; +} bool AddTnumberTnumberLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string AddTnumberTnumberLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -76,7 +93,9 @@ LogicalFunction AddTnumberTnumberLogicalFunction::withInferredDataType(const Sch std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -86,20 +105,21 @@ SerializableFunction AddTnumberTnumberLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAddTnumberTnumberLogicalFunction( LogicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.children.size() == 3, - "AddTnumberTnumberLogicalFunction requires 3 children but got {}", + PRECONDITION(arguments.children.size() == 2, + "AddTnumberTnumberLogicalFunction requires 2 children but got {}", arguments.children.size()); auto arg0 = std::move(arguments.children[0]); auto arg1 = std::move(arguments.children[1]); - auto arg2 = std::move(arguments.children[2]); - return AddTnumberTnumberLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); + return AddTnumberTnumberLogicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AdisjointTcbufferGeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AdisjointTcbufferGeoLogicalFunction.cpp index 713a493a0c..72ac8ed390 100644 --- a/nes-logical-operators/src/Functions/Meos/AdisjointTcbufferGeoLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/AdisjointTcbufferGeoLogicalFunction.cpp @@ -26,64 +26,83 @@ namespace NES { -AdisjointTcbufferGeoLogicalFunction::AdisjointTcbufferGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, - LogicalFunction radius, LogicalFunction ts, - LogicalFunction wkt) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +AdisjointTcbufferGeoLogicalFunction::AdisjointTcbufferGeoLogicalFunction(LogicalFunction lon, + LogicalFunction lat, + LogicalFunction radius, + LogicalFunction timestamp, + LogicalFunction geometry) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) { parameters.reserve(5); parameters.push_back(std::move(lon)); parameters.push_back(std::move(lat)); parameters.push_back(std::move(radius)); - parameters.push_back(std::move(ts)); - parameters.push_back(std::move(wkt)); + parameters.push_back(std::move(timestamp)); + parameters.push_back(std::move(geometry)); } -DataType AdisjointTcbufferGeoLogicalFunction::getDataType() const { return dataType; } +DataType AdisjointTcbufferGeoLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction AdisjointTcbufferGeoLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector AdisjointTcbufferGeoLogicalFunction::getChildren() const { return parameters; } +std::vector AdisjointTcbufferGeoLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction AdisjointTcbufferGeoLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 5, - "AdisjointTcbufferGeoLogicalFunction requires 5 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 5, "AdisjointTcbufferGeoLogicalFunction requires 5 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view AdisjointTcbufferGeoLogicalFunction::getType() const { return NAME; } +std::string_view AdisjointTcbufferGeoLogicalFunction::getType() const +{ + return NAME; +} bool AdisjointTcbufferGeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string AdisjointTcbufferGeoLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction AdisjointTcbufferGeoLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(5); - c.emplace_back(parameters[0].withInferredDataType(schema)); - c.emplace_back(parameters[1].withInferredDataType(schema)); - c.emplace_back(parameters[2].withInferredDataType(schema)); - c.emplace_back(parameters[3].withInferredDataType(schema)); - c.emplace_back(parameters[4].withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon must be FLOAT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat must be FLOAT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "radius must be FLOAT64"); - INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); - INVARIANT(c[4].getDataType().isType(DataType::Type::VARSIZED), "wkt must be VARCHAR"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction AdisjointTcbufferGeoLogicalFunction::serialize() const @@ -92,7 +111,9 @@ SerializableFunction AdisjointTcbufferGeoLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -102,11 +123,12 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAdi PRECONDITION(arguments.children.size() == 5, "AdisjointTcbufferGeoLogicalFunction requires 5 children but got {}", arguments.children.size()); - return AdisjointTcbufferGeoLogicalFunction(std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2]), - std::move(arguments.children[3]), - std::move(arguments.children[4])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + return AdisjointTcbufferGeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AdisjointTcbufferTcbufferLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AdisjointTcbufferTcbufferLogicalFunction.cpp index 7667e268f2..d3cbae2683 100644 --- a/nes-logical-operators/src/Functions/Meos/AdisjointTcbufferTcbufferLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/AdisjointTcbufferTcbufferLogicalFunction.cpp @@ -26,67 +26,89 @@ namespace NES { -AdisjointTcbufferTcbufferLogicalFunction::AdisjointTcbufferTcbufferLogicalFunction( - LogicalFunction lon1, LogicalFunction lat1, LogicalFunction r1, LogicalFunction ts1, - LogicalFunction lon2, LogicalFunction lat2, LogicalFunction r2, LogicalFunction ts2) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +AdisjointTcbufferTcbufferLogicalFunction::AdisjointTcbufferTcbufferLogicalFunction(LogicalFunction lonA, + LogicalFunction latA, + LogicalFunction radiusA, + LogicalFunction tsA, + LogicalFunction lonB, + LogicalFunction latB, + LogicalFunction radiusB, + LogicalFunction tsB) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) { parameters.reserve(8); - parameters.push_back(std::move(lon1)); - parameters.push_back(std::move(lat1)); - parameters.push_back(std::move(r1)); - parameters.push_back(std::move(ts1)); - parameters.push_back(std::move(lon2)); - parameters.push_back(std::move(lat2)); - parameters.push_back(std::move(r2)); - parameters.push_back(std::move(ts2)); + parameters.push_back(std::move(lonA)); + parameters.push_back(std::move(latA)); + parameters.push_back(std::move(radiusA)); + parameters.push_back(std::move(tsA)); + parameters.push_back(std::move(lonB)); + parameters.push_back(std::move(latB)); + parameters.push_back(std::move(radiusB)); + parameters.push_back(std::move(tsB)); } -DataType AdisjointTcbufferTcbufferLogicalFunction::getDataType() const { return dataType; } +DataType AdisjointTcbufferTcbufferLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction AdisjointTcbufferTcbufferLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector AdisjointTcbufferTcbufferLogicalFunction::getChildren() const { return parameters; } +std::vector AdisjointTcbufferTcbufferLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction AdisjointTcbufferTcbufferLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 8, - "AdisjointTcbufferTcbufferLogicalFunction requires 8 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 8, "AdisjointTcbufferTcbufferLogicalFunction requires 8 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view AdisjointTcbufferTcbufferLogicalFunction::getType() const { return NAME; } +std::string_view AdisjointTcbufferTcbufferLogicalFunction::getType() const +{ + return NAME; +} bool AdisjointTcbufferTcbufferLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string AdisjointTcbufferTcbufferLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction AdisjointTcbufferTcbufferLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(8); - for (const auto& p : parameters) - c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon1 must be FLOAT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat1 must be FLOAT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "r1 must be FLOAT64"); - INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); - INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "lon2 must be FLOAT64"); - INVARIANT(c[5].getDataType().isType(DataType::Type::FLOAT64), "lat2 must be FLOAT64"); - INVARIANT(c[6].getDataType().isType(DataType::Type::FLOAT64), "r2 must be FLOAT64"); - INVARIANT(c[7].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction AdisjointTcbufferTcbufferLogicalFunction::serialize() const @@ -95,7 +117,9 @@ SerializableFunction AdisjointTcbufferTcbufferLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -105,14 +129,15 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAdi PRECONDITION(arguments.children.size() == 8, "AdisjointTcbufferTcbufferLogicalFunction requires 8 children but got {}", arguments.children.size()); - return AdisjointTcbufferTcbufferLogicalFunction(std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2]), - std::move(arguments.children[3]), - std::move(arguments.children[4]), - std::move(arguments.children[5]), - std::move(arguments.children[6]), - std::move(arguments.children[7])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + auto arg5 = std::move(arguments.children[5]); + auto arg6 = std::move(arguments.children[6]); + auto arg7 = std::move(arguments.children[7]); + return AdisjointTcbufferTcbufferLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6), std::move(arg7)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AdisjointTgeoGeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AdisjointTgeoGeoLogicalFunction.cpp index d3f1b190ea..2cc3cff5d7 100644 --- a/nes-logical-operators/src/Functions/Meos/AdisjointTgeoGeoLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/AdisjointTgeoGeoLogicalFunction.cpp @@ -26,60 +26,81 @@ namespace NES { -AdisjointTgeoGeoLogicalFunction::AdisjointTgeoGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, - LogicalFunction ts, LogicalFunction wkt) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +AdisjointTgeoGeoLogicalFunction::AdisjointTgeoGeoLogicalFunction(LogicalFunction lon, + LogicalFunction lat, + LogicalFunction timestamp, + LogicalFunction geometry) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) { parameters.reserve(4); parameters.push_back(std::move(lon)); parameters.push_back(std::move(lat)); - parameters.push_back(std::move(ts)); - parameters.push_back(std::move(wkt)); + parameters.push_back(std::move(timestamp)); + parameters.push_back(std::move(geometry)); } -DataType AdisjointTgeoGeoLogicalFunction::getDataType() const { return dataType; } +DataType AdisjointTgeoGeoLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction AdisjointTgeoGeoLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector AdisjointTgeoGeoLogicalFunction::getChildren() const { return parameters; } +std::vector AdisjointTgeoGeoLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction AdisjointTgeoGeoLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 4, - "AdisjointTgeoGeoLogicalFunction requires 4 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 4, "AdisjointTgeoGeoLogicalFunction requires 4 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view AdisjointTgeoGeoLogicalFunction::getType() const { return NAME; } +std::string_view AdisjointTgeoGeoLogicalFunction::getType() const +{ + return NAME; +} bool AdisjointTgeoGeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string AdisjointTgeoGeoLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction AdisjointTgeoGeoLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(4); - c.emplace_back(parameters[0].withInferredDataType(schema)); - c.emplace_back(parameters[1].withInferredDataType(schema)); - c.emplace_back(parameters[2].withInferredDataType(schema)); - c.emplace_back(parameters[3].withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon must be FLOAT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat must be FLOAT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); - INVARIANT(c[3].getDataType().isType(DataType::Type::VARSIZED),"wkt must be VARSIZED"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction AdisjointTgeoGeoLogicalFunction::serialize() const @@ -88,7 +109,9 @@ SerializableFunction AdisjointTgeoGeoLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -98,10 +121,11 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAdi PRECONDITION(arguments.children.size() == 4, "AdisjointTgeoGeoLogicalFunction requires 4 children but got {}", arguments.children.size()); - return AdisjointTgeoGeoLogicalFunction(std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2]), - std::move(arguments.children[3])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + return AdisjointTgeoGeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AdisjointTgeoTgeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AdisjointTgeoTgeoLogicalFunction.cpp index 688f46c35c..e058eba3a7 100644 --- a/nes-logical-operators/src/Functions/Meos/AdisjointTgeoTgeoLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/AdisjointTgeoTgeoLogicalFunction.cpp @@ -26,61 +26,85 @@ namespace NES { -AdisjointTgeoTgeoLogicalFunction::AdisjointTgeoTgeoLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction ts1, LogicalFunction lon2, LogicalFunction lat2, LogicalFunction ts2) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +AdisjointTgeoTgeoLogicalFunction::AdisjointTgeoTgeoLogicalFunction(LogicalFunction lonA, + LogicalFunction latA, + LogicalFunction tsA, + LogicalFunction lonB, + LogicalFunction latB, + LogicalFunction tsB) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) { parameters.reserve(6); - parameters.push_back(std::move(lon1)); - parameters.push_back(std::move(lat1)); - parameters.push_back(std::move(ts1)); - parameters.push_back(std::move(lon2)); - parameters.push_back(std::move(lat2)); - parameters.push_back(std::move(ts2)); + parameters.push_back(std::move(lonA)); + parameters.push_back(std::move(latA)); + parameters.push_back(std::move(tsA)); + parameters.push_back(std::move(lonB)); + parameters.push_back(std::move(latB)); + parameters.push_back(std::move(tsB)); } -DataType AdisjointTgeoTgeoLogicalFunction::getDataType() const { return dataType; } +DataType AdisjointTgeoTgeoLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction AdisjointTgeoTgeoLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector AdisjointTgeoTgeoLogicalFunction::getChildren() const { return parameters; } +std::vector AdisjointTgeoTgeoLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction AdisjointTgeoTgeoLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 6, - "AdisjointTgeoTgeoLogicalFunction requires 6 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 6, "AdisjointTgeoTgeoLogicalFunction requires 6 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view AdisjointTgeoTgeoLogicalFunction::getType() const { return NAME; } +std::string_view AdisjointTgeoTgeoLogicalFunction::getType() const +{ + return NAME; +} bool AdisjointTgeoTgeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string AdisjointTgeoTgeoLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction AdisjointTgeoTgeoLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(6); - for (const auto& p : parameters) - c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon1 must be FLOAT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat1 must be FLOAT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); - INVARIANT(c[3].getDataType().isType(DataType::Type::FLOAT64), "lon2 must be FLOAT64"); - INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "lat2 must be FLOAT64"); - INVARIANT(c[5].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction AdisjointTgeoTgeoLogicalFunction::serialize() const @@ -89,7 +113,9 @@ SerializableFunction AdisjointTgeoTgeoLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -99,13 +125,13 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAdi PRECONDITION(arguments.children.size() == 6, "AdisjointTgeoTgeoLogicalFunction requires 6 children but got {}", arguments.children.size()); - return AdisjointTgeoTgeoLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2]), - std::move(arguments.children[3]), - std::move(arguments.children[4]), - std::move(arguments.children[5])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + auto arg5 = std::move(arguments.children[5]); + return AdisjointTgeoTgeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AdisjointTrgeometryGeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AdisjointTrgeometryGeoLogicalFunction.cpp new file mode 100644 index 0000000000..ef8980507d --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AdisjointTrgeometryGeoLogicalFunction.cpp @@ -0,0 +1,87 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AdisjointTrgeometryGeoLogicalFunction::AdisjointTrgeometryGeoLogicalFunction(LogicalFunction ref_wkt, LogicalFunction x1, LogicalFunction y1, LogicalFunction theta1, LogicalFunction ts1, LogicalFunction tgt_wkt) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(6); + parameters.push_back(std::move(ref_wkt)); + parameters.push_back(std::move(x1)); + parameters.push_back(std::move(y1)); + parameters.push_back(std::move(theta1)); + parameters.push_back(std::move(ts1)); + parameters.push_back(std::move(tgt_wkt)); +} +DataType AdisjointTrgeometryGeoLogicalFunction::getDataType() const { return dataType; } +LogicalFunction AdisjointTrgeometryGeoLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } +std::vector AdisjointTrgeometryGeoLogicalFunction::getChildren() const { return parameters; } +LogicalFunction AdisjointTrgeometryGeoLogicalFunction::withChildren(const std::vector& children) const { + PRECONDITION(children.size()==6,"AdisjointTrgeometryGeoLogicalFunction requires 6 children, but got {}",children.size()); + auto c=*this; c.parameters=children; return c; +} +std::string_view AdisjointTrgeometryGeoLogicalFunction::getType() const { return NAME; } +bool AdisjointTrgeometryGeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + return false; +} +std::string AdisjointTrgeometryGeoLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("{}({})",NAME,parameters[0].explain(v)); +} +LogicalFunction AdisjointTrgeometryGeoLogicalFunction::withInferredDataType(const Schema& schema) const { + std::vector c; c.reserve(6); + for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "ref_wkt must be VARSIZED"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "x1 must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "y1 must be FLOAT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::FLOAT64), "theta1 must be FLOAT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); + INVARIANT(c[5].getDataType().isType(DataType::Type::VARSIZED), "tgt_wkt must be VARSIZED"); + return withChildren(c); +} +SerializableFunction AdisjointTrgeometryGeoLogicalFunction::serialize() const { + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + return proto; +} +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAdisjointTrgeometryGeoLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size()==6, + "AdisjointTrgeometryGeoLogicalFunction requires 6 children but got {}", + arguments.children.size()); + return AdisjointTrgeometryGeoLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4]), + std::move(arguments.children[5])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AdisjointTrgeometryTrgeometryLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AdisjointTrgeometryTrgeometryLogicalFunction.cpp new file mode 100644 index 0000000000..93de2cb320 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AdisjointTrgeometryTrgeometryLogicalFunction.cpp @@ -0,0 +1,99 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AdisjointTrgeometryTrgeometryLogicalFunction::AdisjointTrgeometryTrgeometryLogicalFunction(LogicalFunction ref1_wkt, LogicalFunction x1, LogicalFunction y1, LogicalFunction theta1, LogicalFunction ts1, LogicalFunction ref2_wkt, LogicalFunction x2, LogicalFunction y2, LogicalFunction theta2, LogicalFunction ts2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(10); + parameters.push_back(std::move(ref1_wkt)); + parameters.push_back(std::move(x1)); + parameters.push_back(std::move(y1)); + parameters.push_back(std::move(theta1)); + parameters.push_back(std::move(ts1)); + parameters.push_back(std::move(ref2_wkt)); + parameters.push_back(std::move(x2)); + parameters.push_back(std::move(y2)); + parameters.push_back(std::move(theta2)); + parameters.push_back(std::move(ts2)); +} +DataType AdisjointTrgeometryTrgeometryLogicalFunction::getDataType() const { return dataType; } +LogicalFunction AdisjointTrgeometryTrgeometryLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } +std::vector AdisjointTrgeometryTrgeometryLogicalFunction::getChildren() const { return parameters; } +LogicalFunction AdisjointTrgeometryTrgeometryLogicalFunction::withChildren(const std::vector& children) const { + PRECONDITION(children.size()==10,"AdisjointTrgeometryTrgeometryLogicalFunction requires 10 children, but got {}",children.size()); + auto c=*this; c.parameters=children; return c; +} +std::string_view AdisjointTrgeometryTrgeometryLogicalFunction::getType() const { return NAME; } +bool AdisjointTrgeometryTrgeometryLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + return false; +} +std::string AdisjointTrgeometryTrgeometryLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("{}({})",NAME,parameters[0].explain(v)); +} +LogicalFunction AdisjointTrgeometryTrgeometryLogicalFunction::withInferredDataType(const Schema& schema) const { + std::vector c; c.reserve(10); + for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "ref1_wkt must be VARSIZED"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "x1 must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "y1 must be FLOAT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::FLOAT64), "theta1 must be FLOAT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); + INVARIANT(c[5].getDataType().isType(DataType::Type::VARSIZED), "ref2_wkt must be VARSIZED"); + INVARIANT(c[6].getDataType().isType(DataType::Type::FLOAT64), "x2 must be FLOAT64"); + INVARIANT(c[7].getDataType().isType(DataType::Type::FLOAT64), "y2 must be FLOAT64"); + INVARIANT(c[8].getDataType().isType(DataType::Type::FLOAT64), "theta2 must be FLOAT64"); + INVARIANT(c[9].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); + return withChildren(c); +} +SerializableFunction AdisjointTrgeometryTrgeometryLogicalFunction::serialize() const { + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + return proto; +} +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAdisjointTrgeometryTrgeometryLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size()==10, + "AdisjointTrgeometryTrgeometryLogicalFunction requires 10 children but got {}", + arguments.children.size()); + return AdisjointTrgeometryTrgeometryLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4]), + std::move(arguments.children[5]), + std::move(arguments.children[6]), + std::move(arguments.children[7]), + std::move(arguments.children[8]), + std::move(arguments.children[9])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AdwithinTcbufferCbufferLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AdwithinTcbufferCbufferLogicalFunction.cpp new file mode 100644 index 0000000000..e3a53253ff --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AdwithinTcbufferCbufferLogicalFunction.cpp @@ -0,0 +1,137 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AdwithinTcbufferCbufferLogicalFunction::AdwithinTcbufferCbufferLogicalFunction(LogicalFunction lon, + LogicalFunction lat, + LogicalFunction radius, + LogicalFunction timestamp, + LogicalFunction cbufLit, + LogicalFunction dist) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) +{ + parameters.reserve(6); + parameters.push_back(std::move(lon)); + parameters.push_back(std::move(lat)); + parameters.push_back(std::move(radius)); + parameters.push_back(std::move(timestamp)); + parameters.push_back(std::move(cbufLit)); + parameters.push_back(std::move(dist)); +} + +DataType AdwithinTcbufferCbufferLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction AdwithinTcbufferCbufferLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector AdwithinTcbufferCbufferLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction AdwithinTcbufferCbufferLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 6, "AdwithinTcbufferCbufferLogicalFunction requires 6 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; +} + +std::string_view AdwithinTcbufferCbufferLogicalFunction::getType() const +{ + return NAME; +} + +bool AdwithinTcbufferCbufferLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } + return false; +} + +std::string AdwithinTcbufferCbufferLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction AdwithinTcbufferCbufferLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); +} + +SerializableFunction AdwithinTcbufferCbufferLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAdwithinTcbufferCbufferLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 6, + "AdwithinTcbufferCbufferLogicalFunction requires 6 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + auto arg5 = std::move(arguments.children[5]); + return AdwithinTcbufferCbufferLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AdwithinTcbufferGeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AdwithinTcbufferGeoLogicalFunction.cpp index 66049ca77d..3ae0dd45ad 100644 --- a/nes-logical-operators/src/Functions/Meos/AdwithinTcbufferGeoLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/AdwithinTcbufferGeoLogicalFunction.cpp @@ -26,67 +26,85 @@ namespace NES { -AdwithinTcbufferGeoLogicalFunction::AdwithinTcbufferGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, - LogicalFunction radius, LogicalFunction ts, - LogicalFunction wkt, LogicalFunction dist) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +AdwithinTcbufferGeoLogicalFunction::AdwithinTcbufferGeoLogicalFunction(LogicalFunction lon, + LogicalFunction lat, + LogicalFunction radius, + LogicalFunction timestamp, + LogicalFunction geometry, + LogicalFunction dist) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) { parameters.reserve(6); parameters.push_back(std::move(lon)); parameters.push_back(std::move(lat)); parameters.push_back(std::move(radius)); - parameters.push_back(std::move(ts)); - parameters.push_back(std::move(wkt)); + parameters.push_back(std::move(timestamp)); + parameters.push_back(std::move(geometry)); parameters.push_back(std::move(dist)); } -DataType AdwithinTcbufferGeoLogicalFunction::getDataType() const { return dataType; } +DataType AdwithinTcbufferGeoLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction AdwithinTcbufferGeoLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector AdwithinTcbufferGeoLogicalFunction::getChildren() const { return parameters; } +std::vector AdwithinTcbufferGeoLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction AdwithinTcbufferGeoLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 6, - "AdwithinTcbufferGeoLogicalFunction requires 6 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 6, "AdwithinTcbufferGeoLogicalFunction requires 6 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view AdwithinTcbufferGeoLogicalFunction::getType() const { return NAME; } +std::string_view AdwithinTcbufferGeoLogicalFunction::getType() const +{ + return NAME; +} bool AdwithinTcbufferGeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string AdwithinTcbufferGeoLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction AdwithinTcbufferGeoLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(6); - c.emplace_back(parameters[0].withInferredDataType(schema)); - c.emplace_back(parameters[1].withInferredDataType(schema)); - c.emplace_back(parameters[2].withInferredDataType(schema)); - c.emplace_back(parameters[3].withInferredDataType(schema)); - c.emplace_back(parameters[4].withInferredDataType(schema)); - c.emplace_back(parameters[5].withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon must be FLOAT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat must be FLOAT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "radius must be FLOAT64"); - INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); - INVARIANT(c[4].getDataType().isType(DataType::Type::VARSIZED), "wkt must be VARCHAR"); - INVARIANT(c[5].getDataType().isType(DataType::Type::FLOAT64), "dist must be FLOAT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction AdwithinTcbufferGeoLogicalFunction::serialize() const @@ -95,7 +113,9 @@ SerializableFunction AdwithinTcbufferGeoLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -105,12 +125,13 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAdw PRECONDITION(arguments.children.size() == 6, "AdwithinTcbufferGeoLogicalFunction requires 6 children but got {}", arguments.children.size()); - return AdwithinTcbufferGeoLogicalFunction(std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2]), - std::move(arguments.children[3]), - std::move(arguments.children[4]), - std::move(arguments.children[5])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + auto arg5 = std::move(arguments.children[5]); + return AdwithinTcbufferGeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AdwithinTcbufferTcbufferLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AdwithinTcbufferTcbufferLogicalFunction.cpp index e32b576ff6..3ea3a54c84 100644 --- a/nes-logical-operators/src/Functions/Meos/AdwithinTcbufferTcbufferLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/AdwithinTcbufferTcbufferLogicalFunction.cpp @@ -26,70 +26,91 @@ namespace NES { -AdwithinTcbufferTcbufferLogicalFunction::AdwithinTcbufferTcbufferLogicalFunction( - LogicalFunction lon1, LogicalFunction lat1, LogicalFunction r1, LogicalFunction ts1, - LogicalFunction lon2, LogicalFunction lat2, LogicalFunction r2, LogicalFunction ts2, - LogicalFunction dist) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +AdwithinTcbufferTcbufferLogicalFunction::AdwithinTcbufferTcbufferLogicalFunction(LogicalFunction lonA, + LogicalFunction latA, + LogicalFunction radiusA, + LogicalFunction tsA, + LogicalFunction lonB, + LogicalFunction latB, + LogicalFunction radiusB, + LogicalFunction tsB, + LogicalFunction dist) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) { parameters.reserve(9); - parameters.push_back(std::move(lon1)); - parameters.push_back(std::move(lat1)); - parameters.push_back(std::move(r1)); - parameters.push_back(std::move(ts1)); - parameters.push_back(std::move(lon2)); - parameters.push_back(std::move(lat2)); - parameters.push_back(std::move(r2)); - parameters.push_back(std::move(ts2)); + parameters.push_back(std::move(lonA)); + parameters.push_back(std::move(latA)); + parameters.push_back(std::move(radiusA)); + parameters.push_back(std::move(tsA)); + parameters.push_back(std::move(lonB)); + parameters.push_back(std::move(latB)); + parameters.push_back(std::move(radiusB)); + parameters.push_back(std::move(tsB)); parameters.push_back(std::move(dist)); } -DataType AdwithinTcbufferTcbufferLogicalFunction::getDataType() const { return dataType; } +DataType AdwithinTcbufferTcbufferLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction AdwithinTcbufferTcbufferLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector AdwithinTcbufferTcbufferLogicalFunction::getChildren() const { return parameters; } +std::vector AdwithinTcbufferTcbufferLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction AdwithinTcbufferTcbufferLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 9, - "AdwithinTcbufferTcbufferLogicalFunction requires 9 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 9, "AdwithinTcbufferTcbufferLogicalFunction requires 9 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view AdwithinTcbufferTcbufferLogicalFunction::getType() const { return NAME; } +std::string_view AdwithinTcbufferTcbufferLogicalFunction::getType() const +{ + return NAME; +} bool AdwithinTcbufferTcbufferLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string AdwithinTcbufferTcbufferLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction AdwithinTcbufferTcbufferLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(9); - for (const auto& p : parameters) - c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon1 must be FLOAT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat1 must be FLOAT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "r1 must be FLOAT64"); - INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); - INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "lon2 must be FLOAT64"); - INVARIANT(c[5].getDataType().isType(DataType::Type::FLOAT64), "lat2 must be FLOAT64"); - INVARIANT(c[6].getDataType().isType(DataType::Type::FLOAT64), "r2 must be FLOAT64"); - INVARIANT(c[7].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); - INVARIANT(c[8].getDataType().isType(DataType::Type::FLOAT64), "dist must be FLOAT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction AdwithinTcbufferTcbufferLogicalFunction::serialize() const @@ -98,7 +119,9 @@ SerializableFunction AdwithinTcbufferTcbufferLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -108,15 +131,16 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAdw PRECONDITION(arguments.children.size() == 9, "AdwithinTcbufferTcbufferLogicalFunction requires 9 children but got {}", arguments.children.size()); - return AdwithinTcbufferTcbufferLogicalFunction(std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2]), - std::move(arguments.children[3]), - std::move(arguments.children[4]), - std::move(arguments.children[5]), - std::move(arguments.children[6]), - std::move(arguments.children[7]), - std::move(arguments.children[8])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + auto arg5 = std::move(arguments.children[5]); + auto arg6 = std::move(arguments.children[6]); + auto arg7 = std::move(arguments.children[7]); + auto arg8 = std::move(arguments.children[8]); + return AdwithinTcbufferTcbufferLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6), std::move(arg7), std::move(arg8)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AdwithinTgeoGeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AdwithinTgeoGeoLogicalFunction.cpp index 2dfe964aa3..1084e0581a 100644 --- a/nes-logical-operators/src/Functions/Meos/AdwithinTgeoGeoLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/AdwithinTgeoGeoLogicalFunction.cpp @@ -26,64 +26,83 @@ namespace NES { -AdwithinTgeoGeoLogicalFunction::AdwithinTgeoGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, - LogicalFunction ts, LogicalFunction wkt, - LogicalFunction dist) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +AdwithinTgeoGeoLogicalFunction::AdwithinTgeoGeoLogicalFunction(LogicalFunction lon, + LogicalFunction lat, + LogicalFunction timestamp, + LogicalFunction geometry, + LogicalFunction dist) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) { parameters.reserve(5); parameters.push_back(std::move(lon)); parameters.push_back(std::move(lat)); - parameters.push_back(std::move(ts)); - parameters.push_back(std::move(wkt)); + parameters.push_back(std::move(timestamp)); + parameters.push_back(std::move(geometry)); parameters.push_back(std::move(dist)); } -DataType AdwithinTgeoGeoLogicalFunction::getDataType() const { return dataType; } +DataType AdwithinTgeoGeoLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction AdwithinTgeoGeoLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector AdwithinTgeoGeoLogicalFunction::getChildren() const { return parameters; } +std::vector AdwithinTgeoGeoLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction AdwithinTgeoGeoLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 5, - "AdwithinTgeoGeoLogicalFunction requires 5 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 5, "AdwithinTgeoGeoLogicalFunction requires 5 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view AdwithinTgeoGeoLogicalFunction::getType() const { return NAME; } +std::string_view AdwithinTgeoGeoLogicalFunction::getType() const +{ + return NAME; +} bool AdwithinTgeoGeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string AdwithinTgeoGeoLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction AdwithinTgeoGeoLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(5); - c.emplace_back(parameters[0].withInferredDataType(schema)); - c.emplace_back(parameters[1].withInferredDataType(schema)); - c.emplace_back(parameters[2].withInferredDataType(schema)); - c.emplace_back(parameters[3].withInferredDataType(schema)); - c.emplace_back(parameters[4].withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon must be FLOAT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat must be FLOAT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); - INVARIANT(c[3].getDataType().isType(DataType::Type::VARSIZED),"wkt must be VARSIZED"); - INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "dist must be FLOAT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction AdwithinTgeoGeoLogicalFunction::serialize() const @@ -92,7 +111,9 @@ SerializableFunction AdwithinTgeoGeoLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -102,11 +123,12 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAdw PRECONDITION(arguments.children.size() == 5, "AdwithinTgeoGeoLogicalFunction requires 5 children but got {}", arguments.children.size()); - return AdwithinTgeoGeoLogicalFunction(std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2]), - std::move(arguments.children[3]), - std::move(arguments.children[4])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + return AdwithinTgeoGeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AdwithinTgeoTgeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AdwithinTgeoTgeoLogicalFunction.cpp index 56de5e2ca4..2fad6e003c 100644 --- a/nes-logical-operators/src/Functions/Meos/AdwithinTgeoTgeoLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/AdwithinTgeoTgeoLogicalFunction.cpp @@ -26,63 +26,87 @@ namespace NES { -AdwithinTgeoTgeoLogicalFunction::AdwithinTgeoTgeoLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction ts1, LogicalFunction lon2, LogicalFunction lat2, LogicalFunction ts2, LogicalFunction dist) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +AdwithinTgeoTgeoLogicalFunction::AdwithinTgeoTgeoLogicalFunction(LogicalFunction lonA, + LogicalFunction latA, + LogicalFunction tsA, + LogicalFunction lonB, + LogicalFunction latB, + LogicalFunction tsB, + LogicalFunction dist) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) { parameters.reserve(7); - parameters.push_back(std::move(lon1)); - parameters.push_back(std::move(lat1)); - parameters.push_back(std::move(ts1)); - parameters.push_back(std::move(lon2)); - parameters.push_back(std::move(lat2)); - parameters.push_back(std::move(ts2)); + parameters.push_back(std::move(lonA)); + parameters.push_back(std::move(latA)); + parameters.push_back(std::move(tsA)); + parameters.push_back(std::move(lonB)); + parameters.push_back(std::move(latB)); + parameters.push_back(std::move(tsB)); parameters.push_back(std::move(dist)); } -DataType AdwithinTgeoTgeoLogicalFunction::getDataType() const { return dataType; } +DataType AdwithinTgeoTgeoLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction AdwithinTgeoTgeoLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector AdwithinTgeoTgeoLogicalFunction::getChildren() const { return parameters; } +std::vector AdwithinTgeoTgeoLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction AdwithinTgeoTgeoLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 7, - "AdwithinTgeoTgeoLogicalFunction requires 7 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 7, "AdwithinTgeoTgeoLogicalFunction requires 7 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view AdwithinTgeoTgeoLogicalFunction::getType() const { return NAME; } +std::string_view AdwithinTgeoTgeoLogicalFunction::getType() const +{ + return NAME; +} bool AdwithinTgeoTgeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string AdwithinTgeoTgeoLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction AdwithinTgeoTgeoLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(7); - for (const auto& p : parameters) - c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon1 must be FLOAT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat1 must be FLOAT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); - INVARIANT(c[3].getDataType().isType(DataType::Type::FLOAT64), "lon2 must be FLOAT64"); - INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "lat2 must be FLOAT64"); - INVARIANT(c[5].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); - INVARIANT(c[6].getDataType().isType(DataType::Type::FLOAT64), "dist must be FLOAT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction AdwithinTgeoTgeoLogicalFunction::serialize() const @@ -91,7 +115,9 @@ SerializableFunction AdwithinTgeoTgeoLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -101,14 +127,14 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAdw PRECONDITION(arguments.children.size() == 7, "AdwithinTgeoTgeoLogicalFunction requires 7 children but got {}", arguments.children.size()); - return AdwithinTgeoTgeoLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2]), - std::move(arguments.children[3]), - std::move(arguments.children[4]), - std::move(arguments.children[5]), - std::move(arguments.children[6])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + auto arg5 = std::move(arguments.children[5]); + auto arg6 = std::move(arguments.children[6]); + return AdwithinTgeoTgeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AdwithinTrgeometryGeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AdwithinTrgeometryGeoLogicalFunction.cpp new file mode 100644 index 0000000000..c3042b1487 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AdwithinTrgeometryGeoLogicalFunction.cpp @@ -0,0 +1,90 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AdwithinTrgeometryGeoLogicalFunction::AdwithinTrgeometryGeoLogicalFunction(LogicalFunction ref_wkt, LogicalFunction x1, LogicalFunction y1, LogicalFunction theta1, LogicalFunction ts1, LogicalFunction tgt_wkt, LogicalFunction dist) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(7); + parameters.push_back(std::move(ref_wkt)); + parameters.push_back(std::move(x1)); + parameters.push_back(std::move(y1)); + parameters.push_back(std::move(theta1)); + parameters.push_back(std::move(ts1)); + parameters.push_back(std::move(tgt_wkt)); + parameters.push_back(std::move(dist)); +} +DataType AdwithinTrgeometryGeoLogicalFunction::getDataType() const { return dataType; } +LogicalFunction AdwithinTrgeometryGeoLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } +std::vector AdwithinTrgeometryGeoLogicalFunction::getChildren() const { return parameters; } +LogicalFunction AdwithinTrgeometryGeoLogicalFunction::withChildren(const std::vector& children) const { + PRECONDITION(children.size()==7,"AdwithinTrgeometryGeoLogicalFunction requires 7 children, but got {}",children.size()); + auto c=*this; c.parameters=children; return c; +} +std::string_view AdwithinTrgeometryGeoLogicalFunction::getType() const { return NAME; } +bool AdwithinTrgeometryGeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + return false; +} +std::string AdwithinTrgeometryGeoLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("{}({})",NAME,parameters[0].explain(v)); +} +LogicalFunction AdwithinTrgeometryGeoLogicalFunction::withInferredDataType(const Schema& schema) const { + std::vector c; c.reserve(7); + for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "ref_wkt must be VARSIZED"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "x1 must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "y1 must be FLOAT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::FLOAT64), "theta1 must be FLOAT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); + INVARIANT(c[5].getDataType().isType(DataType::Type::VARSIZED), "tgt_wkt must be VARSIZED"); + INVARIANT(c[6].getDataType().isType(DataType::Type::FLOAT64), "dist must be FLOAT64"); + return withChildren(c); +} +SerializableFunction AdwithinTrgeometryGeoLogicalFunction::serialize() const { + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + return proto; +} +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAdwithinTrgeometryGeoLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size()==7, + "AdwithinTrgeometryGeoLogicalFunction requires 7 children but got {}", + arguments.children.size()); + return AdwithinTrgeometryGeoLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4]), + std::move(arguments.children[5]), + std::move(arguments.children[6])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AdwithinTrgeometryTrgeometryLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AdwithinTrgeometryTrgeometryLogicalFunction.cpp new file mode 100644 index 0000000000..3a875a0289 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AdwithinTrgeometryTrgeometryLogicalFunction.cpp @@ -0,0 +1,102 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AdwithinTrgeometryTrgeometryLogicalFunction::AdwithinTrgeometryTrgeometryLogicalFunction(LogicalFunction ref1_wkt, LogicalFunction x1, LogicalFunction y1, LogicalFunction theta1, LogicalFunction ts1, LogicalFunction ref2_wkt, LogicalFunction x2, LogicalFunction y2, LogicalFunction theta2, LogicalFunction ts2, LogicalFunction dist) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(11); + parameters.push_back(std::move(ref1_wkt)); + parameters.push_back(std::move(x1)); + parameters.push_back(std::move(y1)); + parameters.push_back(std::move(theta1)); + parameters.push_back(std::move(ts1)); + parameters.push_back(std::move(ref2_wkt)); + parameters.push_back(std::move(x2)); + parameters.push_back(std::move(y2)); + parameters.push_back(std::move(theta2)); + parameters.push_back(std::move(ts2)); + parameters.push_back(std::move(dist)); +} +DataType AdwithinTrgeometryTrgeometryLogicalFunction::getDataType() const { return dataType; } +LogicalFunction AdwithinTrgeometryTrgeometryLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } +std::vector AdwithinTrgeometryTrgeometryLogicalFunction::getChildren() const { return parameters; } +LogicalFunction AdwithinTrgeometryTrgeometryLogicalFunction::withChildren(const std::vector& children) const { + PRECONDITION(children.size()==11,"AdwithinTrgeometryTrgeometryLogicalFunction requires 11 children, but got {}",children.size()); + auto c=*this; c.parameters=children; return c; +} +std::string_view AdwithinTrgeometryTrgeometryLogicalFunction::getType() const { return NAME; } +bool AdwithinTrgeometryTrgeometryLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + return false; +} +std::string AdwithinTrgeometryTrgeometryLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("{}({})",NAME,parameters[0].explain(v)); +} +LogicalFunction AdwithinTrgeometryTrgeometryLogicalFunction::withInferredDataType(const Schema& schema) const { + std::vector c; c.reserve(11); + for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "ref1_wkt must be VARSIZED"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "x1 must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "y1 must be FLOAT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::FLOAT64), "theta1 must be FLOAT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); + INVARIANT(c[5].getDataType().isType(DataType::Type::VARSIZED), "ref2_wkt must be VARSIZED"); + INVARIANT(c[6].getDataType().isType(DataType::Type::FLOAT64), "x2 must be FLOAT64"); + INVARIANT(c[7].getDataType().isType(DataType::Type::FLOAT64), "y2 must be FLOAT64"); + INVARIANT(c[8].getDataType().isType(DataType::Type::FLOAT64), "theta2 must be FLOAT64"); + INVARIANT(c[9].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); + INVARIANT(c[10].getDataType().isType(DataType::Type::FLOAT64), "dist must be FLOAT64"); + return withChildren(c); +} +SerializableFunction AdwithinTrgeometryTrgeometryLogicalFunction::serialize() const { + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + return proto; +} +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAdwithinTrgeometryTrgeometryLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size()==11, + "AdwithinTrgeometryTrgeometryLogicalFunction requires 11 children but got {}", + arguments.children.size()); + return AdwithinTrgeometryTrgeometryLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4]), + std::move(arguments.children[5]), + std::move(arguments.children[6]), + std::move(arguments.children[7]), + std::move(arguments.children[8]), + std::move(arguments.children[9]), + std::move(arguments.children[10])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AintersectsTcbufferGeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AintersectsTcbufferGeoLogicalFunction.cpp index 1b400ef7f9..43a36f048f 100644 --- a/nes-logical-operators/src/Functions/Meos/AintersectsTcbufferGeoLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/AintersectsTcbufferGeoLogicalFunction.cpp @@ -26,64 +26,83 @@ namespace NES { -AintersectsTcbufferGeoLogicalFunction::AintersectsTcbufferGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, - LogicalFunction radius, LogicalFunction ts, - LogicalFunction wkt) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +AintersectsTcbufferGeoLogicalFunction::AintersectsTcbufferGeoLogicalFunction(LogicalFunction lon, + LogicalFunction lat, + LogicalFunction radius, + LogicalFunction timestamp, + LogicalFunction geometry) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) { parameters.reserve(5); parameters.push_back(std::move(lon)); parameters.push_back(std::move(lat)); parameters.push_back(std::move(radius)); - parameters.push_back(std::move(ts)); - parameters.push_back(std::move(wkt)); + parameters.push_back(std::move(timestamp)); + parameters.push_back(std::move(geometry)); } -DataType AintersectsTcbufferGeoLogicalFunction::getDataType() const { return dataType; } +DataType AintersectsTcbufferGeoLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction AintersectsTcbufferGeoLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector AintersectsTcbufferGeoLogicalFunction::getChildren() const { return parameters; } +std::vector AintersectsTcbufferGeoLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction AintersectsTcbufferGeoLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 5, - "AintersectsTcbufferGeoLogicalFunction requires 5 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 5, "AintersectsTcbufferGeoLogicalFunction requires 5 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view AintersectsTcbufferGeoLogicalFunction::getType() const { return NAME; } +std::string_view AintersectsTcbufferGeoLogicalFunction::getType() const +{ + return NAME; +} bool AintersectsTcbufferGeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string AintersectsTcbufferGeoLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction AintersectsTcbufferGeoLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(5); - c.emplace_back(parameters[0].withInferredDataType(schema)); - c.emplace_back(parameters[1].withInferredDataType(schema)); - c.emplace_back(parameters[2].withInferredDataType(schema)); - c.emplace_back(parameters[3].withInferredDataType(schema)); - c.emplace_back(parameters[4].withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon must be FLOAT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat must be FLOAT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "radius must be FLOAT64"); - INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); - INVARIANT(c[4].getDataType().isType(DataType::Type::VARSIZED), "wkt must be VARCHAR"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction AintersectsTcbufferGeoLogicalFunction::serialize() const @@ -92,7 +111,9 @@ SerializableFunction AintersectsTcbufferGeoLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -102,11 +123,12 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAin PRECONDITION(arguments.children.size() == 5, "AintersectsTcbufferGeoLogicalFunction requires 5 children but got {}", arguments.children.size()); - return AintersectsTcbufferGeoLogicalFunction(std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2]), - std::move(arguments.children[3]), - std::move(arguments.children[4])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + return AintersectsTcbufferGeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AintersectsTcbufferTcbufferLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AintersectsTcbufferTcbufferLogicalFunction.cpp index 333ce45585..5e656d91d8 100644 --- a/nes-logical-operators/src/Functions/Meos/AintersectsTcbufferTcbufferLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/AintersectsTcbufferTcbufferLogicalFunction.cpp @@ -26,67 +26,89 @@ namespace NES { -AintersectsTcbufferTcbufferLogicalFunction::AintersectsTcbufferTcbufferLogicalFunction( - LogicalFunction lon1, LogicalFunction lat1, LogicalFunction r1, LogicalFunction ts1, - LogicalFunction lon2, LogicalFunction lat2, LogicalFunction r2, LogicalFunction ts2) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +AintersectsTcbufferTcbufferLogicalFunction::AintersectsTcbufferTcbufferLogicalFunction(LogicalFunction lonA, + LogicalFunction latA, + LogicalFunction radiusA, + LogicalFunction tsA, + LogicalFunction lonB, + LogicalFunction latB, + LogicalFunction radiusB, + LogicalFunction tsB) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) { parameters.reserve(8); - parameters.push_back(std::move(lon1)); - parameters.push_back(std::move(lat1)); - parameters.push_back(std::move(r1)); - parameters.push_back(std::move(ts1)); - parameters.push_back(std::move(lon2)); - parameters.push_back(std::move(lat2)); - parameters.push_back(std::move(r2)); - parameters.push_back(std::move(ts2)); + parameters.push_back(std::move(lonA)); + parameters.push_back(std::move(latA)); + parameters.push_back(std::move(radiusA)); + parameters.push_back(std::move(tsA)); + parameters.push_back(std::move(lonB)); + parameters.push_back(std::move(latB)); + parameters.push_back(std::move(radiusB)); + parameters.push_back(std::move(tsB)); } -DataType AintersectsTcbufferTcbufferLogicalFunction::getDataType() const { return dataType; } +DataType AintersectsTcbufferTcbufferLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction AintersectsTcbufferTcbufferLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector AintersectsTcbufferTcbufferLogicalFunction::getChildren() const { return parameters; } +std::vector AintersectsTcbufferTcbufferLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction AintersectsTcbufferTcbufferLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 8, - "AintersectsTcbufferTcbufferLogicalFunction requires 8 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 8, "AintersectsTcbufferTcbufferLogicalFunction requires 8 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view AintersectsTcbufferTcbufferLogicalFunction::getType() const { return NAME; } +std::string_view AintersectsTcbufferTcbufferLogicalFunction::getType() const +{ + return NAME; +} bool AintersectsTcbufferTcbufferLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string AintersectsTcbufferTcbufferLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction AintersectsTcbufferTcbufferLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(8); - for (const auto& p : parameters) - c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon1 must be FLOAT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat1 must be FLOAT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "r1 must be FLOAT64"); - INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); - INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "lon2 must be FLOAT64"); - INVARIANT(c[5].getDataType().isType(DataType::Type::FLOAT64), "lat2 must be FLOAT64"); - INVARIANT(c[6].getDataType().isType(DataType::Type::FLOAT64), "r2 must be FLOAT64"); - INVARIANT(c[7].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction AintersectsTcbufferTcbufferLogicalFunction::serialize() const @@ -95,7 +117,9 @@ SerializableFunction AintersectsTcbufferTcbufferLogicalFunction::serialize() con proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -105,14 +129,15 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAin PRECONDITION(arguments.children.size() == 8, "AintersectsTcbufferTcbufferLogicalFunction requires 8 children but got {}", arguments.children.size()); - return AintersectsTcbufferTcbufferLogicalFunction(std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2]), - std::move(arguments.children[3]), - std::move(arguments.children[4]), - std::move(arguments.children[5]), - std::move(arguments.children[6]), - std::move(arguments.children[7])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + auto arg5 = std::move(arguments.children[5]); + auto arg6 = std::move(arguments.children[6]); + auto arg7 = std::move(arguments.children[7]); + return AintersectsTcbufferTcbufferLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6), std::move(arg7)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AintersectsTgeoGeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AintersectsTgeoGeoLogicalFunction.cpp index 7e1c1f035e..69de89d08c 100644 --- a/nes-logical-operators/src/Functions/Meos/AintersectsTgeoGeoLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/AintersectsTgeoGeoLogicalFunction.cpp @@ -26,60 +26,81 @@ namespace NES { -AintersectsTgeoGeoLogicalFunction::AintersectsTgeoGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, - LogicalFunction ts, LogicalFunction wkt) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +AintersectsTgeoGeoLogicalFunction::AintersectsTgeoGeoLogicalFunction(LogicalFunction lon, + LogicalFunction lat, + LogicalFunction timestamp, + LogicalFunction geometry) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) { parameters.reserve(4); parameters.push_back(std::move(lon)); parameters.push_back(std::move(lat)); - parameters.push_back(std::move(ts)); - parameters.push_back(std::move(wkt)); + parameters.push_back(std::move(timestamp)); + parameters.push_back(std::move(geometry)); } -DataType AintersectsTgeoGeoLogicalFunction::getDataType() const { return dataType; } +DataType AintersectsTgeoGeoLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction AintersectsTgeoGeoLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector AintersectsTgeoGeoLogicalFunction::getChildren() const { return parameters; } +std::vector AintersectsTgeoGeoLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction AintersectsTgeoGeoLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 4, - "AintersectsTgeoGeoLogicalFunction requires 4 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 4, "AintersectsTgeoGeoLogicalFunction requires 4 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view AintersectsTgeoGeoLogicalFunction::getType() const { return NAME; } +std::string_view AintersectsTgeoGeoLogicalFunction::getType() const +{ + return NAME; +} bool AintersectsTgeoGeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string AintersectsTgeoGeoLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction AintersectsTgeoGeoLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(4); - c.emplace_back(parameters[0].withInferredDataType(schema)); - c.emplace_back(parameters[1].withInferredDataType(schema)); - c.emplace_back(parameters[2].withInferredDataType(schema)); - c.emplace_back(parameters[3].withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon must be FLOAT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat must be FLOAT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); - INVARIANT(c[3].getDataType().isType(DataType::Type::VARSIZED),"wkt must be VARSIZED"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction AintersectsTgeoGeoLogicalFunction::serialize() const @@ -88,7 +109,9 @@ SerializableFunction AintersectsTgeoGeoLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -98,10 +121,11 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAin PRECONDITION(arguments.children.size() == 4, "AintersectsTgeoGeoLogicalFunction requires 4 children but got {}", arguments.children.size()); - return AintersectsTgeoGeoLogicalFunction(std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2]), - std::move(arguments.children[3])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + return AintersectsTgeoGeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AintersectsTgeoTgeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AintersectsTgeoTgeoLogicalFunction.cpp index e8475bd108..ad3445f392 100644 --- a/nes-logical-operators/src/Functions/Meos/AintersectsTgeoTgeoLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/AintersectsTgeoTgeoLogicalFunction.cpp @@ -26,61 +26,85 @@ namespace NES { -AintersectsTgeoTgeoLogicalFunction::AintersectsTgeoTgeoLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction ts1, LogicalFunction lon2, LogicalFunction lat2, LogicalFunction ts2) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +AintersectsTgeoTgeoLogicalFunction::AintersectsTgeoTgeoLogicalFunction(LogicalFunction lonA, + LogicalFunction latA, + LogicalFunction tsA, + LogicalFunction lonB, + LogicalFunction latB, + LogicalFunction tsB) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) { parameters.reserve(6); - parameters.push_back(std::move(lon1)); - parameters.push_back(std::move(lat1)); - parameters.push_back(std::move(ts1)); - parameters.push_back(std::move(lon2)); - parameters.push_back(std::move(lat2)); - parameters.push_back(std::move(ts2)); + parameters.push_back(std::move(lonA)); + parameters.push_back(std::move(latA)); + parameters.push_back(std::move(tsA)); + parameters.push_back(std::move(lonB)); + parameters.push_back(std::move(latB)); + parameters.push_back(std::move(tsB)); } -DataType AintersectsTgeoTgeoLogicalFunction::getDataType() const { return dataType; } +DataType AintersectsTgeoTgeoLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction AintersectsTgeoTgeoLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector AintersectsTgeoTgeoLogicalFunction::getChildren() const { return parameters; } +std::vector AintersectsTgeoTgeoLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction AintersectsTgeoTgeoLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 6, - "AintersectsTgeoTgeoLogicalFunction requires 6 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 6, "AintersectsTgeoTgeoLogicalFunction requires 6 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view AintersectsTgeoTgeoLogicalFunction::getType() const { return NAME; } +std::string_view AintersectsTgeoTgeoLogicalFunction::getType() const +{ + return NAME; +} bool AintersectsTgeoTgeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string AintersectsTgeoTgeoLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction AintersectsTgeoTgeoLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(6); - for (const auto& p : parameters) - c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon1 must be FLOAT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat1 must be FLOAT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); - INVARIANT(c[3].getDataType().isType(DataType::Type::FLOAT64), "lon2 must be FLOAT64"); - INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "lat2 must be FLOAT64"); - INVARIANT(c[5].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction AintersectsTgeoTgeoLogicalFunction::serialize() const @@ -89,7 +113,9 @@ SerializableFunction AintersectsTgeoTgeoLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -99,13 +125,13 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAin PRECONDITION(arguments.children.size() == 6, "AintersectsTgeoTgeoLogicalFunction requires 6 children but got {}", arguments.children.size()); - return AintersectsTgeoTgeoLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2]), - std::move(arguments.children[3]), - std::move(arguments.children[4]), - std::move(arguments.children[5])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + auto arg5 = std::move(arguments.children[5]); + return AintersectsTgeoTgeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AintersectsTrgeometryGeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AintersectsTrgeometryGeoLogicalFunction.cpp new file mode 100644 index 0000000000..db016ae4c9 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AintersectsTrgeometryGeoLogicalFunction.cpp @@ -0,0 +1,87 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AintersectsTrgeometryGeoLogicalFunction::AintersectsTrgeometryGeoLogicalFunction(LogicalFunction ref_wkt, LogicalFunction x1, LogicalFunction y1, LogicalFunction theta1, LogicalFunction ts1, LogicalFunction tgt_wkt) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(6); + parameters.push_back(std::move(ref_wkt)); + parameters.push_back(std::move(x1)); + parameters.push_back(std::move(y1)); + parameters.push_back(std::move(theta1)); + parameters.push_back(std::move(ts1)); + parameters.push_back(std::move(tgt_wkt)); +} +DataType AintersectsTrgeometryGeoLogicalFunction::getDataType() const { return dataType; } +LogicalFunction AintersectsTrgeometryGeoLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } +std::vector AintersectsTrgeometryGeoLogicalFunction::getChildren() const { return parameters; } +LogicalFunction AintersectsTrgeometryGeoLogicalFunction::withChildren(const std::vector& children) const { + PRECONDITION(children.size()==6,"AintersectsTrgeometryGeoLogicalFunction requires 6 children, but got {}",children.size()); + auto c=*this; c.parameters=children; return c; +} +std::string_view AintersectsTrgeometryGeoLogicalFunction::getType() const { return NAME; } +bool AintersectsTrgeometryGeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + return false; +} +std::string AintersectsTrgeometryGeoLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("{}({})",NAME,parameters[0].explain(v)); +} +LogicalFunction AintersectsTrgeometryGeoLogicalFunction::withInferredDataType(const Schema& schema) const { + std::vector c; c.reserve(6); + for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "ref_wkt must be VARSIZED"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "x1 must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "y1 must be FLOAT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::FLOAT64), "theta1 must be FLOAT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); + INVARIANT(c[5].getDataType().isType(DataType::Type::VARSIZED), "tgt_wkt must be VARSIZED"); + return withChildren(c); +} +SerializableFunction AintersectsTrgeometryGeoLogicalFunction::serialize() const { + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + return proto; +} +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAintersectsTrgeometryGeoLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size()==6, + "AintersectsTrgeometryGeoLogicalFunction requires 6 children but got {}", + arguments.children.size()); + return AintersectsTrgeometryGeoLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4]), + std::move(arguments.children[5])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AintersectsTrgeometryTrgeometryLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AintersectsTrgeometryTrgeometryLogicalFunction.cpp new file mode 100644 index 0000000000..6d4c259fa3 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AintersectsTrgeometryTrgeometryLogicalFunction.cpp @@ -0,0 +1,99 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AintersectsTrgeometryTrgeometryLogicalFunction::AintersectsTrgeometryTrgeometryLogicalFunction(LogicalFunction ref1_wkt, LogicalFunction x1, LogicalFunction y1, LogicalFunction theta1, LogicalFunction ts1, LogicalFunction ref2_wkt, LogicalFunction x2, LogicalFunction y2, LogicalFunction theta2, LogicalFunction ts2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(10); + parameters.push_back(std::move(ref1_wkt)); + parameters.push_back(std::move(x1)); + parameters.push_back(std::move(y1)); + parameters.push_back(std::move(theta1)); + parameters.push_back(std::move(ts1)); + parameters.push_back(std::move(ref2_wkt)); + parameters.push_back(std::move(x2)); + parameters.push_back(std::move(y2)); + parameters.push_back(std::move(theta2)); + parameters.push_back(std::move(ts2)); +} +DataType AintersectsTrgeometryTrgeometryLogicalFunction::getDataType() const { return dataType; } +LogicalFunction AintersectsTrgeometryTrgeometryLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } +std::vector AintersectsTrgeometryTrgeometryLogicalFunction::getChildren() const { return parameters; } +LogicalFunction AintersectsTrgeometryTrgeometryLogicalFunction::withChildren(const std::vector& children) const { + PRECONDITION(children.size()==10,"AintersectsTrgeometryTrgeometryLogicalFunction requires 10 children, but got {}",children.size()); + auto c=*this; c.parameters=children; return c; +} +std::string_view AintersectsTrgeometryTrgeometryLogicalFunction::getType() const { return NAME; } +bool AintersectsTrgeometryTrgeometryLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + return false; +} +std::string AintersectsTrgeometryTrgeometryLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("{}({})",NAME,parameters[0].explain(v)); +} +LogicalFunction AintersectsTrgeometryTrgeometryLogicalFunction::withInferredDataType(const Schema& schema) const { + std::vector c; c.reserve(10); + for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "ref1_wkt must be VARSIZED"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "x1 must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "y1 must be FLOAT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::FLOAT64), "theta1 must be FLOAT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); + INVARIANT(c[5].getDataType().isType(DataType::Type::VARSIZED), "ref2_wkt must be VARSIZED"); + INVARIANT(c[6].getDataType().isType(DataType::Type::FLOAT64), "x2 must be FLOAT64"); + INVARIANT(c[7].getDataType().isType(DataType::Type::FLOAT64), "y2 must be FLOAT64"); + INVARIANT(c[8].getDataType().isType(DataType::Type::FLOAT64), "theta2 must be FLOAT64"); + INVARIANT(c[9].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); + return withChildren(c); +} +SerializableFunction AintersectsTrgeometryTrgeometryLogicalFunction::serialize() const { + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + return proto; +} +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAintersectsTrgeometryTrgeometryLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size()==10, + "AintersectsTrgeometryTrgeometryLogicalFunction requires 10 children but got {}", + arguments.children.size()); + return AintersectsTrgeometryTrgeometryLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4]), + std::move(arguments.children[5]), + std::move(arguments.children[6]), + std::move(arguments.children[7]), + std::move(arguments.children[8]), + std::move(arguments.children[9])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysEqBigintTbigintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysEqBigintTbigintLogicalFunction.cpp index 165908ab0c..84fa779706 100644 --- a/nes-logical-operators/src/Functions/Meos/AlwaysEqBigintTbigintLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/AlwaysEqBigintTbigintLogicalFunction.cpp @@ -26,46 +26,65 @@ namespace NES { -AlwaysEqBigintTbigintLogicalFunction::AlwaysEqBigintTbigintLogicalFunction(LogicalFunction value, - LogicalFunction threshold, - LogicalFunction ts) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +AlwaysEqBigintTbigintLogicalFunction::AlwaysEqBigintTbigintLogicalFunction(LogicalFunction arg0, + LogicalFunction value, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) { parameters.reserve(3); + parameters.push_back(std::move(arg0)); parameters.push_back(std::move(value)); - parameters.push_back(std::move(threshold)); parameters.push_back(std::move(ts)); } -DataType AlwaysEqBigintTbigintLogicalFunction::getDataType() const { return dataType; } +DataType AlwaysEqBigintTbigintLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction AlwaysEqBigintTbigintLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector AlwaysEqBigintTbigintLogicalFunction::getChildren() const { return parameters; } +std::vector AlwaysEqBigintTbigintLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction AlwaysEqBigintTbigintLogicalFunction::withChildren(const std::vector& children) const { PRECONDITION(children.size() == 3, "AlwaysEqBigintTbigintLogicalFunction requires 3 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view AlwaysEqBigintTbigintLogicalFunction::getType() const { return NAME; } +std::string_view AlwaysEqBigintTbigintLogicalFunction::getType() const +{ + return NAME; +} bool AlwaysEqBigintTbigintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string AlwaysEqBigintTbigintLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -76,7 +95,9 @@ LogicalFunction AlwaysEqBigintTbigintLogicalFunction::withInferredDataType(const std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -86,7 +107,9 @@ SerializableFunction AlwaysEqBigintTbigintLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysEqBoolTboolLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysEqBoolTboolLogicalFunction.cpp index e2ffb93ddc..f39aba92a4 100644 --- a/nes-logical-operators/src/Functions/Meos/AlwaysEqBoolTboolLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/AlwaysEqBoolTboolLogicalFunction.cpp @@ -26,46 +26,65 @@ namespace NES { -AlwaysEqBoolTboolLogicalFunction::AlwaysEqBoolTboolLogicalFunction(LogicalFunction value, - LogicalFunction threshold, - LogicalFunction ts) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +AlwaysEqBoolTboolLogicalFunction::AlwaysEqBoolTboolLogicalFunction(LogicalFunction arg0, + LogicalFunction value, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) { parameters.reserve(3); + parameters.push_back(std::move(arg0)); parameters.push_back(std::move(value)); - parameters.push_back(std::move(threshold)); parameters.push_back(std::move(ts)); } -DataType AlwaysEqBoolTboolLogicalFunction::getDataType() const { return dataType; } +DataType AlwaysEqBoolTboolLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction AlwaysEqBoolTboolLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector AlwaysEqBoolTboolLogicalFunction::getChildren() const { return parameters; } +std::vector AlwaysEqBoolTboolLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction AlwaysEqBoolTboolLogicalFunction::withChildren(const std::vector& children) const { PRECONDITION(children.size() == 3, "AlwaysEqBoolTboolLogicalFunction requires 3 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view AlwaysEqBoolTboolLogicalFunction::getType() const { return NAME; } +std::string_view AlwaysEqBoolTboolLogicalFunction::getType() const +{ + return NAME; +} bool AlwaysEqBoolTboolLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string AlwaysEqBoolTboolLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -76,7 +95,9 @@ LogicalFunction AlwaysEqBoolTboolLogicalFunction::withInferredDataType(const Sch std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -86,7 +107,9 @@ SerializableFunction AlwaysEqBoolTboolLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysEqNpointTnpointLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysEqNpointTnpointLogicalFunction.cpp index 0627232d65..0b0636d55a 100644 --- a/nes-logical-operators/src/Functions/Meos/AlwaysEqNpointTnpointLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/AlwaysEqNpointTnpointLogicalFunction.cpp @@ -26,59 +26,83 @@ namespace NES { -AlwaysEqNpointTnpointLogicalFunction::AlwaysEqNpointTnpointLogicalFunction(LogicalFunction rid_np, LogicalFunction pos_np, LogicalFunction rid_tp, LogicalFunction pos_tp, LogicalFunction ts) +AlwaysEqNpointTnpointLogicalFunction::AlwaysEqNpointTnpointLogicalFunction(LogicalFunction rid0, + LogicalFunction frac0, + LogicalFunction rid, + LogicalFunction frac, + LogicalFunction ts) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(5); - parameters.push_back(std::move(rid_np)); - parameters.push_back(std::move(pos_np)); - parameters.push_back(std::move(rid_tp)); - parameters.push_back(std::move(pos_tp)); + parameters.push_back(std::move(rid0)); + parameters.push_back(std::move(frac0)); + parameters.push_back(std::move(rid)); + parameters.push_back(std::move(frac)); parameters.push_back(std::move(ts)); } -DataType AlwaysEqNpointTnpointLogicalFunction::getDataType() const { return dataType; } +DataType AlwaysEqNpointTnpointLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction AlwaysEqNpointTnpointLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector AlwaysEqNpointTnpointLogicalFunction::getChildren() const { return parameters; } +std::vector AlwaysEqNpointTnpointLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction AlwaysEqNpointTnpointLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 5, - "AlwaysEqNpointTnpointLogicalFunction requires 5 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 5, "AlwaysEqNpointTnpointLogicalFunction requires 5 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view AlwaysEqNpointTnpointLogicalFunction::getType() const { return NAME; } +std::string_view AlwaysEqNpointTnpointLogicalFunction::getType() const +{ + return NAME; +} bool AlwaysEqNpointTnpointLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string AlwaysEqNpointTnpointLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction AlwaysEqNpointTnpointLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(5); - for (const auto& p : parameters) - c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "rid_np must be UINT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "pos_np must be FLOAT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "rid_tp must be UINT64"); - INVARIANT(c[3].getDataType().isType(DataType::Type::FLOAT64), "pos_tp must be FLOAT64"); - INVARIANT(c[4].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction AlwaysEqNpointTnpointLogicalFunction::serialize() const @@ -87,7 +111,9 @@ SerializableFunction AlwaysEqNpointTnpointLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -97,12 +123,12 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlw PRECONDITION(arguments.children.size() == 5, "AlwaysEqNpointTnpointLogicalFunction requires 5 children but got {}", arguments.children.size()); - return AlwaysEqNpointTnpointLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2]), - std::move(arguments.children[3]), - std::move(arguments.children[4])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + return AlwaysEqNpointTnpointLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysEqPoseTposeLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysEqPoseTposeLogicalFunction.cpp index a6375f3a30..370be1cde4 100644 --- a/nes-logical-operators/src/Functions/Meos/AlwaysEqPoseTposeLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/AlwaysEqPoseTposeLogicalFunction.cpp @@ -26,63 +26,87 @@ namespace NES { -AlwaysEqPoseTposeLogicalFunction::AlwaysEqPoseTposeLogicalFunction(LogicalFunction x2, LogicalFunction y2, LogicalFunction theta2, LogicalFunction x, LogicalFunction y, LogicalFunction theta, LogicalFunction ts) +AlwaysEqPoseTposeLogicalFunction::AlwaysEqPoseTposeLogicalFunction(LogicalFunction px0, + LogicalFunction py0, + LogicalFunction ptheta0, + LogicalFunction x, + LogicalFunction y, + LogicalFunction theta, + LogicalFunction ts) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(7); - parameters.push_back(std::move(x2)); - parameters.push_back(std::move(y2)); - parameters.push_back(std::move(theta2)); + parameters.push_back(std::move(px0)); + parameters.push_back(std::move(py0)); + parameters.push_back(std::move(ptheta0)); parameters.push_back(std::move(x)); parameters.push_back(std::move(y)); parameters.push_back(std::move(theta)); parameters.push_back(std::move(ts)); } -DataType AlwaysEqPoseTposeLogicalFunction::getDataType() const { return dataType; } +DataType AlwaysEqPoseTposeLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction AlwaysEqPoseTposeLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector AlwaysEqPoseTposeLogicalFunction::getChildren() const { return parameters; } +std::vector AlwaysEqPoseTposeLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction AlwaysEqPoseTposeLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 7, - "AlwaysEqPoseTposeLogicalFunction requires 7 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 7, "AlwaysEqPoseTposeLogicalFunction requires 7 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view AlwaysEqPoseTposeLogicalFunction::getType() const { return NAME; } +std::string_view AlwaysEqPoseTposeLogicalFunction::getType() const +{ + return NAME; +} bool AlwaysEqPoseTposeLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string AlwaysEqPoseTposeLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction AlwaysEqPoseTposeLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(7); - for (const auto& p : parameters) - c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "x2 must be FLOAT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "y2 must be FLOAT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "theta2 must be FLOAT64"); - INVARIANT(c[3].getDataType().isType(DataType::Type::FLOAT64), "x must be FLOAT64"); - INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "y must be FLOAT64"); - INVARIANT(c[5].getDataType().isType(DataType::Type::FLOAT64), "theta must be FLOAT64"); - INVARIANT(c[6].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction AlwaysEqPoseTposeLogicalFunction::serialize() const @@ -91,7 +115,9 @@ SerializableFunction AlwaysEqPoseTposeLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -101,14 +127,14 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlw PRECONDITION(arguments.children.size() == 7, "AlwaysEqPoseTposeLogicalFunction requires 7 children but got {}", arguments.children.size()); - return AlwaysEqPoseTposeLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2]), - std::move(arguments.children[3]), - std::move(arguments.children[4]), - std::move(arguments.children[5]), - std::move(arguments.children[6])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + auto arg5 = std::move(arguments.children[5]); + auto arg6 = std::move(arguments.children[6]); + return AlwaysEqPoseTposeLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysEqTbigintBigintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysEqTbigintBigintLogicalFunction.cpp index 98b2a73558..1c55ef1dab 100644 --- a/nes-logical-operators/src/Functions/Meos/AlwaysEqTbigintBigintLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/AlwaysEqTbigintBigintLogicalFunction.cpp @@ -27,45 +27,64 @@ namespace NES { AlwaysEqTbigintBigintLogicalFunction::AlwaysEqTbigintBigintLogicalFunction(LogicalFunction value, - LogicalFunction threshold, - LogicalFunction ts) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) + LogicalFunction ts, + LogicalFunction arg0) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) { parameters.reserve(3); parameters.push_back(std::move(value)); - parameters.push_back(std::move(threshold)); parameters.push_back(std::move(ts)); + parameters.push_back(std::move(arg0)); } -DataType AlwaysEqTbigintBigintLogicalFunction::getDataType() const { return dataType; } +DataType AlwaysEqTbigintBigintLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction AlwaysEqTbigintBigintLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector AlwaysEqTbigintBigintLogicalFunction::getChildren() const { return parameters; } +std::vector AlwaysEqTbigintBigintLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction AlwaysEqTbigintBigintLogicalFunction::withChildren(const std::vector& children) const { PRECONDITION(children.size() == 3, "AlwaysEqTbigintBigintLogicalFunction requires 3 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view AlwaysEqTbigintBigintLogicalFunction::getType() const { return NAME; } +std::string_view AlwaysEqTbigintBigintLogicalFunction::getType() const +{ + return NAME; +} bool AlwaysEqTbigintBigintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string AlwaysEqTbigintBigintLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -76,7 +95,9 @@ LogicalFunction AlwaysEqTbigintBigintLogicalFunction::withInferredDataType(const std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -86,7 +107,9 @@ SerializableFunction AlwaysEqTbigintBigintLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysEqTboolBoolLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysEqTboolBoolLogicalFunction.cpp index ae786168cc..037b094d75 100644 --- a/nes-logical-operators/src/Functions/Meos/AlwaysEqTboolBoolLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/AlwaysEqTboolBoolLogicalFunction.cpp @@ -27,45 +27,64 @@ namespace NES { AlwaysEqTboolBoolLogicalFunction::AlwaysEqTboolBoolLogicalFunction(LogicalFunction value, - LogicalFunction threshold, - LogicalFunction ts) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) + LogicalFunction ts, + LogicalFunction arg0) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) { parameters.reserve(3); parameters.push_back(std::move(value)); - parameters.push_back(std::move(threshold)); parameters.push_back(std::move(ts)); + parameters.push_back(std::move(arg0)); } -DataType AlwaysEqTboolBoolLogicalFunction::getDataType() const { return dataType; } +DataType AlwaysEqTboolBoolLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction AlwaysEqTboolBoolLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector AlwaysEqTboolBoolLogicalFunction::getChildren() const { return parameters; } +std::vector AlwaysEqTboolBoolLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction AlwaysEqTboolBoolLogicalFunction::withChildren(const std::vector& children) const { PRECONDITION(children.size() == 3, "AlwaysEqTboolBoolLogicalFunction requires 3 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view AlwaysEqTboolBoolLogicalFunction::getType() const { return NAME; } +std::string_view AlwaysEqTboolBoolLogicalFunction::getType() const +{ + return NAME; +} bool AlwaysEqTboolBoolLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string AlwaysEqTboolBoolLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -76,7 +95,9 @@ LogicalFunction AlwaysEqTboolBoolLogicalFunction::withInferredDataType(const Sch std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -86,7 +107,9 @@ SerializableFunction AlwaysEqTboolBoolLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysEqTcbufferTcbufferLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysEqTcbufferTcbufferLogicalFunction.cpp index 69b0c8aa95..10ff9ff00d 100644 --- a/nes-logical-operators/src/Functions/Meos/AlwaysEqTcbufferTcbufferLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/AlwaysEqTcbufferTcbufferLogicalFunction.cpp @@ -26,67 +26,89 @@ namespace NES { -AlwaysEqTcbufferTcbufferLogicalFunction::AlwaysEqTcbufferTcbufferLogicalFunction( - LogicalFunction lon1, LogicalFunction lat1, LogicalFunction r1, LogicalFunction ts1, - LogicalFunction lon2, LogicalFunction lat2, LogicalFunction r2, LogicalFunction ts2) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +AlwaysEqTcbufferTcbufferLogicalFunction::AlwaysEqTcbufferTcbufferLogicalFunction(LogicalFunction lonA, + LogicalFunction latA, + LogicalFunction radiusA, + LogicalFunction tsA, + LogicalFunction lonB, + LogicalFunction latB, + LogicalFunction radiusB, + LogicalFunction tsB) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) { parameters.reserve(8); - parameters.push_back(std::move(lon1)); - parameters.push_back(std::move(lat1)); - parameters.push_back(std::move(r1)); - parameters.push_back(std::move(ts1)); - parameters.push_back(std::move(lon2)); - parameters.push_back(std::move(lat2)); - parameters.push_back(std::move(r2)); - parameters.push_back(std::move(ts2)); + parameters.push_back(std::move(lonA)); + parameters.push_back(std::move(latA)); + parameters.push_back(std::move(radiusA)); + parameters.push_back(std::move(tsA)); + parameters.push_back(std::move(lonB)); + parameters.push_back(std::move(latB)); + parameters.push_back(std::move(radiusB)); + parameters.push_back(std::move(tsB)); } -DataType AlwaysEqTcbufferTcbufferLogicalFunction::getDataType() const { return dataType; } +DataType AlwaysEqTcbufferTcbufferLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction AlwaysEqTcbufferTcbufferLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector AlwaysEqTcbufferTcbufferLogicalFunction::getChildren() const { return parameters; } +std::vector AlwaysEqTcbufferTcbufferLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction AlwaysEqTcbufferTcbufferLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 8, - "AlwaysEqTcbufferTcbufferLogicalFunction requires 8 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 8, "AlwaysEqTcbufferTcbufferLogicalFunction requires 8 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view AlwaysEqTcbufferTcbufferLogicalFunction::getType() const { return NAME; } +std::string_view AlwaysEqTcbufferTcbufferLogicalFunction::getType() const +{ + return NAME; +} bool AlwaysEqTcbufferTcbufferLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string AlwaysEqTcbufferTcbufferLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction AlwaysEqTcbufferTcbufferLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(8); - for (const auto& p : parameters) - c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon1 must be FLOAT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat1 must be FLOAT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "r1 must be FLOAT64"); - INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); - INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "lon2 must be FLOAT64"); - INVARIANT(c[5].getDataType().isType(DataType::Type::FLOAT64), "lat2 must be FLOAT64"); - INVARIANT(c[6].getDataType().isType(DataType::Type::FLOAT64), "r2 must be FLOAT64"); - INVARIANT(c[7].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction AlwaysEqTcbufferTcbufferLogicalFunction::serialize() const @@ -95,7 +117,9 @@ SerializableFunction AlwaysEqTcbufferTcbufferLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -105,14 +129,15 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlw PRECONDITION(arguments.children.size() == 8, "AlwaysEqTcbufferTcbufferLogicalFunction requires 8 children but got {}", arguments.children.size()); - return AlwaysEqTcbufferTcbufferLogicalFunction(std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2]), - std::move(arguments.children[3]), - std::move(arguments.children[4]), - std::move(arguments.children[5]), - std::move(arguments.children[6]), - std::move(arguments.children[7])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + auto arg5 = std::move(arguments.children[5]); + auto arg6 = std::move(arguments.children[6]); + auto arg7 = std::move(arguments.children[7]); + return AlwaysEqTcbufferTcbufferLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6), std::move(arg7)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysEqTextTtextLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysEqTextTtextLogicalFunction.cpp index 7e21a4fe38..eb94f48cc6 100644 --- a/nes-logical-operators/src/Functions/Meos/AlwaysEqTextTtextLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/AlwaysEqTextTtextLogicalFunction.cpp @@ -13,81 +13,116 @@ */ #include -#include -#include -#include -#include + #include +#include #include -#include -#include -#include #include +#include +#include +#include #include -#include -#include -#include -#include - -namespace NES { -AlwaysEqTextTtextLogicalFunction::AlwaysEqTextTtextLogicalFunction( - LogicalFunction value, LogicalFunction ref, LogicalFunction ts) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { - parameters = {std::move(value), std::move(ref), std::move(ts)}; +namespace NES +{ + +AlwaysEqTextTtextLogicalFunction::AlwaysEqTextTtextLogicalFunction(LogicalFunction arg0, + LogicalFunction value, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(arg0)); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(ts)); } -DataType AlwaysEqTextTtextLogicalFunction::getDataType() const { return dataType; } +DataType AlwaysEqTextTtextLogicalFunction::getDataType() const +{ + return dataType; +} -LogicalFunction AlwaysEqTextTtextLogicalFunction::withDataType(const DataType& dt) const { - auto c = *this; c.dataType = dt; return c; +LogicalFunction AlwaysEqTextTtextLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector AlwaysEqTextTtextLogicalFunction::getChildren() const { return parameters; } +std::vector AlwaysEqTextTtextLogicalFunction::getChildren() const +{ + return parameters; +} -LogicalFunction AlwaysEqTextTtextLogicalFunction::withChildren(const std::vector& ch) const { - PRECONDITION(ch.size() == 3, "AlwaysEqTextTtext expects 3 params, got {}", ch.size()); - auto c = *this; c.parameters = ch; return c; +LogicalFunction AlwaysEqTextTtextLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "AlwaysEqTextTtextLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view AlwaysEqTextTtextLogicalFunction::getType() const { return NAME; } +std::string_view AlwaysEqTextTtextLogicalFunction::getType() const +{ + return NAME; +} -bool AlwaysEqTextTtextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { - const auto* o = dynamic_cast(&rhs); - return o && parameters == o->parameters; +bool AlwaysEqTextTtextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } + return false; } -std::string AlwaysEqTextTtextLogicalFunction::explain(ExplainVerbosity v) const { - return fmt::format("AlwaysEqTextTtext({}, {}, {})", - parameters[0].explain(v), parameters[1].explain(v), parameters[2].explain(v)); +std::string AlwaysEqTextTtextLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } -LogicalFunction AlwaysEqTextTtextLogicalFunction::withInferredDataType(const Schema& s) const { - std::vector ch; - ch.reserve(3); - for (auto& p : parameters) ch.push_back(p.withInferredDataType(s)); - auto isStr = [](const DataType& dt) { return dt.isType(DataType::Type::VARSIZED); }; - auto isTime = [](const DataType& dt) { return dt.isType(DataType::Type::UINT64); }; - INVARIANT(isStr(ch[0].getDataType()) && isStr(ch[1].getDataType()) && isTime(ch[2].getDataType()), - "AlwaysEqTextTtext: expects (VARCHAR, VARCHAR, UINT64)"); - return withChildren(ch); +LogicalFunction AlwaysEqTextTtextLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } -SerializableFunction AlwaysEqTextTtextLogicalFunction::serialize() const { - SerializableFunction sf; - sf.set_function_type(std::string(NAME)); - for (auto& p : parameters) *sf.add_children() = p.serialize(); - DataTypeSerializationUtil::serializeDataType(dataType, sf.mutable_data_type()); - return sf; +SerializableFunction AlwaysEqTextTtextLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } + return proto; } -LogicalFunctionRegistryReturnType -LogicalFunctionGeneratedRegistrar::RegisterAlwaysEqTextTtextLogicalFunction( - LogicalFunctionRegistryArguments arguments) { +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysEqTextTtextLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ PRECONDITION(arguments.children.size() == 3, - "AlwaysEqTextTtext expects 3 params, got {}", arguments.children.size()); - return AlwaysEqTextTtextLogicalFunction( - arguments.children[0], arguments.children[1], arguments.children[2]); + "AlwaysEqTextTtextLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return AlwaysEqTextTtextLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysEqTgeoGeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysEqTgeoGeoLogicalFunction.cpp index 34422460b8..5ac92bb901 100644 --- a/nes-logical-operators/src/Functions/Meos/AlwaysEqTgeoGeoLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/AlwaysEqTgeoGeoLogicalFunction.cpp @@ -26,60 +26,81 @@ namespace NES { -AlwaysEqTgeoGeoLogicalFunction::AlwaysEqTgeoGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, - LogicalFunction ts, LogicalFunction wkt) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +AlwaysEqTgeoGeoLogicalFunction::AlwaysEqTgeoGeoLogicalFunction(LogicalFunction lon, + LogicalFunction lat, + LogicalFunction timestamp, + LogicalFunction geometry) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) { parameters.reserve(4); parameters.push_back(std::move(lon)); parameters.push_back(std::move(lat)); - parameters.push_back(std::move(ts)); - parameters.push_back(std::move(wkt)); + parameters.push_back(std::move(timestamp)); + parameters.push_back(std::move(geometry)); } -DataType AlwaysEqTgeoGeoLogicalFunction::getDataType() const { return dataType; } +DataType AlwaysEqTgeoGeoLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction AlwaysEqTgeoGeoLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector AlwaysEqTgeoGeoLogicalFunction::getChildren() const { return parameters; } +std::vector AlwaysEqTgeoGeoLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction AlwaysEqTgeoGeoLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 4, - "AlwaysEqTgeoGeoLogicalFunction requires 4 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 4, "AlwaysEqTgeoGeoLogicalFunction requires 4 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view AlwaysEqTgeoGeoLogicalFunction::getType() const { return NAME; } +std::string_view AlwaysEqTgeoGeoLogicalFunction::getType() const +{ + return NAME; +} bool AlwaysEqTgeoGeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string AlwaysEqTgeoGeoLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction AlwaysEqTgeoGeoLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(4); - c.emplace_back(parameters[0].withInferredDataType(schema)); - c.emplace_back(parameters[1].withInferredDataType(schema)); - c.emplace_back(parameters[2].withInferredDataType(schema)); - c.emplace_back(parameters[3].withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon must be FLOAT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat must be FLOAT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); - INVARIANT(c[3].getDataType().isType(DataType::Type::VARSIZED),"wkt must be VARSIZED"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction AlwaysEqTgeoGeoLogicalFunction::serialize() const @@ -88,7 +109,9 @@ SerializableFunction AlwaysEqTgeoGeoLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -98,10 +121,11 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlw PRECONDITION(arguments.children.size() == 4, "AlwaysEqTgeoGeoLogicalFunction requires 4 children but got {}", arguments.children.size()); - return AlwaysEqTgeoGeoLogicalFunction(std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2]), - std::move(arguments.children[3])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + return AlwaysEqTgeoGeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysEqTgeoTgeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysEqTgeoTgeoLogicalFunction.cpp index 51aef4b50b..4784d055ab 100644 --- a/nes-logical-operators/src/Functions/Meos/AlwaysEqTgeoTgeoLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/AlwaysEqTgeoTgeoLogicalFunction.cpp @@ -26,61 +26,85 @@ namespace NES { -AlwaysEqTgeoTgeoLogicalFunction::AlwaysEqTgeoTgeoLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction ts1, LogicalFunction lon2, LogicalFunction lat2, LogicalFunction ts2) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +AlwaysEqTgeoTgeoLogicalFunction::AlwaysEqTgeoTgeoLogicalFunction(LogicalFunction lonA, + LogicalFunction latA, + LogicalFunction tsA, + LogicalFunction lonB, + LogicalFunction latB, + LogicalFunction tsB) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) { parameters.reserve(6); - parameters.push_back(std::move(lon1)); - parameters.push_back(std::move(lat1)); - parameters.push_back(std::move(ts1)); - parameters.push_back(std::move(lon2)); - parameters.push_back(std::move(lat2)); - parameters.push_back(std::move(ts2)); + parameters.push_back(std::move(lonA)); + parameters.push_back(std::move(latA)); + parameters.push_back(std::move(tsA)); + parameters.push_back(std::move(lonB)); + parameters.push_back(std::move(latB)); + parameters.push_back(std::move(tsB)); } -DataType AlwaysEqTgeoTgeoLogicalFunction::getDataType() const { return dataType; } +DataType AlwaysEqTgeoTgeoLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction AlwaysEqTgeoTgeoLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector AlwaysEqTgeoTgeoLogicalFunction::getChildren() const { return parameters; } +std::vector AlwaysEqTgeoTgeoLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction AlwaysEqTgeoTgeoLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 6, - "AlwaysEqTgeoTgeoLogicalFunction requires 6 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 6, "AlwaysEqTgeoTgeoLogicalFunction requires 6 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view AlwaysEqTgeoTgeoLogicalFunction::getType() const { return NAME; } +std::string_view AlwaysEqTgeoTgeoLogicalFunction::getType() const +{ + return NAME; +} bool AlwaysEqTgeoTgeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string AlwaysEqTgeoTgeoLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction AlwaysEqTgeoTgeoLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(6); - for (const auto& p : parameters) - c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon1 must be FLOAT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat1 must be FLOAT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); - INVARIANT(c[3].getDataType().isType(DataType::Type::FLOAT64), "lon2 must be FLOAT64"); - INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "lat2 must be FLOAT64"); - INVARIANT(c[5].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction AlwaysEqTgeoTgeoLogicalFunction::serialize() const @@ -89,7 +113,9 @@ SerializableFunction AlwaysEqTgeoTgeoLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -99,13 +125,13 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlw PRECONDITION(arguments.children.size() == 6, "AlwaysEqTgeoTgeoLogicalFunction requires 6 children but got {}", arguments.children.size()); - return AlwaysEqTgeoTgeoLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2]), - std::move(arguments.children[3]), - std::move(arguments.children[4]), - std::move(arguments.children[5])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + auto arg5 = std::move(arguments.children[5]); + return AlwaysEqTgeoTgeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysEqTh3indexH3indexLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysEqTh3indexH3indexLogicalFunction.cpp index e8fb5a8b8c..5e82832e2f 100644 --- a/nes-logical-operators/src/Functions/Meos/AlwaysEqTh3indexH3indexLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/AlwaysEqTh3indexH3indexLogicalFunction.cpp @@ -26,57 +26,79 @@ namespace NES { -AlwaysEqTh3indexH3indexLogicalFunction::AlwaysEqTh3indexH3indexLogicalFunction(LogicalFunction cell, LogicalFunction ts, - LogicalFunction target) +AlwaysEqTh3indexH3indexLogicalFunction::AlwaysEqTh3indexH3indexLogicalFunction(LogicalFunction cell, + LogicalFunction ts, + LogicalFunction arg0) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(3); parameters.push_back(std::move(cell)); parameters.push_back(std::move(ts)); - parameters.push_back(std::move(target)); + parameters.push_back(std::move(arg0)); } -DataType AlwaysEqTh3indexH3indexLogicalFunction::getDataType() const { return dataType; } +DataType AlwaysEqTh3indexH3indexLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction AlwaysEqTh3indexH3indexLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector AlwaysEqTh3indexH3indexLogicalFunction::getChildren() const { return parameters; } +std::vector AlwaysEqTh3indexH3indexLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction AlwaysEqTh3indexH3indexLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 3, - "AlwaysEqTh3indexH3indexLogicalFunction requires 3 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 3, "AlwaysEqTh3indexH3indexLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view AlwaysEqTh3indexH3indexLogicalFunction::getType() const { return NAME; } +std::string_view AlwaysEqTh3indexH3indexLogicalFunction::getType() const +{ + return NAME; +} bool AlwaysEqTh3indexH3indexLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string AlwaysEqTh3indexH3indexLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction AlwaysEqTh3indexH3indexLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(3); - c.emplace_back(parameters[0].withInferredDataType(schema)); - c.emplace_back(parameters[1].withInferredDataType(schema)); - c.emplace_back(parameters[2].withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "cell must be UINT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "target must be UINT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction AlwaysEqTh3indexH3indexLogicalFunction::serialize() const @@ -85,7 +107,9 @@ SerializableFunction AlwaysEqTh3indexH3indexLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -95,9 +119,10 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlw PRECONDITION(arguments.children.size() == 3, "AlwaysEqTh3indexH3indexLogicalFunction requires 3 children but got {}", arguments.children.size()); - return AlwaysEqTh3indexH3indexLogicalFunction(std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return AlwaysEqTh3indexH3indexLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysEqTjsonbJsonbLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysEqTjsonbJsonbLogicalFunction.cpp index e842930882..11897ed02b 100644 --- a/nes-logical-operators/src/Functions/Meos/AlwaysEqTjsonbJsonbLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/AlwaysEqTjsonbJsonbLogicalFunction.cpp @@ -26,55 +26,79 @@ namespace NES { -AlwaysEqTjsonbJsonbLogicalFunction::AlwaysEqTjsonbJsonbLogicalFunction(LogicalFunction json_str, LogicalFunction ts, LogicalFunction target_json) +AlwaysEqTjsonbJsonbLogicalFunction::AlwaysEqTjsonbJsonbLogicalFunction(LogicalFunction json_str, + LogicalFunction ts, + LogicalFunction arg0) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(3); parameters.push_back(std::move(json_str)); parameters.push_back(std::move(ts)); - parameters.push_back(std::move(target_json)); + parameters.push_back(std::move(arg0)); } -DataType AlwaysEqTjsonbJsonbLogicalFunction::getDataType() const { return dataType; } +DataType AlwaysEqTjsonbJsonbLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction AlwaysEqTjsonbJsonbLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector AlwaysEqTjsonbJsonbLogicalFunction::getChildren() const { return parameters; } +std::vector AlwaysEqTjsonbJsonbLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction AlwaysEqTjsonbJsonbLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 3, - "AlwaysEqTjsonbJsonbLogicalFunction requires 3 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 3, "AlwaysEqTjsonbJsonbLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view AlwaysEqTjsonbJsonbLogicalFunction::getType() const { return NAME; } +std::string_view AlwaysEqTjsonbJsonbLogicalFunction::getType() const +{ + return NAME; +} bool AlwaysEqTjsonbJsonbLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string AlwaysEqTjsonbJsonbLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction AlwaysEqTjsonbJsonbLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(3); - for (const auto& p : parameters) - c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "json_str must be VARSIZED"); - INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::VARSIZED), "target_json must be VARSIZED"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction AlwaysEqTjsonbJsonbLogicalFunction::serialize() const @@ -83,7 +107,9 @@ SerializableFunction AlwaysEqTjsonbJsonbLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -93,10 +119,10 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlw PRECONDITION(arguments.children.size() == 3, "AlwaysEqTjsonbJsonbLogicalFunction requires 3 children but got {}", arguments.children.size()); - return AlwaysEqTjsonbJsonbLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return AlwaysEqTjsonbJsonbLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysEqTjsonbTjsonbLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysEqTjsonbTjsonbLogicalFunction.cpp index 5f2d9a1f6e..0917e6c5d3 100644 --- a/nes-logical-operators/src/Functions/Meos/AlwaysEqTjsonbTjsonbLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/AlwaysEqTjsonbTjsonbLogicalFunction.cpp @@ -26,57 +26,81 @@ namespace NES { -AlwaysEqTjsonbTjsonbLogicalFunction::AlwaysEqTjsonbTjsonbLogicalFunction(LogicalFunction json1, LogicalFunction ts1, LogicalFunction json2, LogicalFunction ts2) +AlwaysEqTjsonbTjsonbLogicalFunction::AlwaysEqTjsonbTjsonbLogicalFunction(LogicalFunction json_str, + LogicalFunction ts, + LogicalFunction json0, + LogicalFunction ts0) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(4); - parameters.push_back(std::move(json1)); - parameters.push_back(std::move(ts1)); - parameters.push_back(std::move(json2)); - parameters.push_back(std::move(ts2)); + parameters.push_back(std::move(json_str)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(json0)); + parameters.push_back(std::move(ts0)); } -DataType AlwaysEqTjsonbTjsonbLogicalFunction::getDataType() const { return dataType; } +DataType AlwaysEqTjsonbTjsonbLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction AlwaysEqTjsonbTjsonbLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector AlwaysEqTjsonbTjsonbLogicalFunction::getChildren() const { return parameters; } +std::vector AlwaysEqTjsonbTjsonbLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction AlwaysEqTjsonbTjsonbLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 4, - "AlwaysEqTjsonbTjsonbLogicalFunction requires 4 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 4, "AlwaysEqTjsonbTjsonbLogicalFunction requires 4 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view AlwaysEqTjsonbTjsonbLogicalFunction::getType() const { return NAME; } +std::string_view AlwaysEqTjsonbTjsonbLogicalFunction::getType() const +{ + return NAME; +} bool AlwaysEqTjsonbTjsonbLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string AlwaysEqTjsonbTjsonbLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction AlwaysEqTjsonbTjsonbLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(4); - for (const auto& p : parameters) - c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "json1 must be VARSIZED"); - INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::VARSIZED), "json2 must be VARSIZED"); - INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction AlwaysEqTjsonbTjsonbLogicalFunction::serialize() const @@ -85,7 +109,9 @@ SerializableFunction AlwaysEqTjsonbTjsonbLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -95,11 +121,11 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlw PRECONDITION(arguments.children.size() == 4, "AlwaysEqTjsonbTjsonbLogicalFunction requires 4 children but got {}", arguments.children.size()); - return AlwaysEqTjsonbTjsonbLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2]), - std::move(arguments.children[3])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + return AlwaysEqTjsonbTjsonbLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysEqTnpointNpointLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysEqTnpointNpointLogicalFunction.cpp index 1c1e2071b7..0cfae443c3 100644 --- a/nes-logical-operators/src/Functions/Meos/AlwaysEqTnpointNpointLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/AlwaysEqTnpointNpointLogicalFunction.cpp @@ -26,59 +26,83 @@ namespace NES { -AlwaysEqTnpointNpointLogicalFunction::AlwaysEqTnpointNpointLogicalFunction(LogicalFunction rid1, LogicalFunction pos1, LogicalFunction ts, LogicalFunction rid2, LogicalFunction pos2) +AlwaysEqTnpointNpointLogicalFunction::AlwaysEqTnpointNpointLogicalFunction(LogicalFunction rid, + LogicalFunction frac, + LogicalFunction ts, + LogicalFunction rid0, + LogicalFunction frac0) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(5); - parameters.push_back(std::move(rid1)); - parameters.push_back(std::move(pos1)); + parameters.push_back(std::move(rid)); + parameters.push_back(std::move(frac)); parameters.push_back(std::move(ts)); - parameters.push_back(std::move(rid2)); - parameters.push_back(std::move(pos2)); + parameters.push_back(std::move(rid0)); + parameters.push_back(std::move(frac0)); } -DataType AlwaysEqTnpointNpointLogicalFunction::getDataType() const { return dataType; } +DataType AlwaysEqTnpointNpointLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction AlwaysEqTnpointNpointLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector AlwaysEqTnpointNpointLogicalFunction::getChildren() const { return parameters; } +std::vector AlwaysEqTnpointNpointLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction AlwaysEqTnpointNpointLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 5, - "AlwaysEqTnpointNpointLogicalFunction requires 5 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 5, "AlwaysEqTnpointNpointLogicalFunction requires 5 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view AlwaysEqTnpointNpointLogicalFunction::getType() const { return NAME; } +std::string_view AlwaysEqTnpointNpointLogicalFunction::getType() const +{ + return NAME; +} bool AlwaysEqTnpointNpointLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string AlwaysEqTnpointNpointLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction AlwaysEqTnpointNpointLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(5); - for (const auto& p : parameters) - c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "rid1 must be UINT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "pos1 must be FLOAT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); - INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "rid2 must be UINT64"); - INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "pos2 must be FLOAT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction AlwaysEqTnpointNpointLogicalFunction::serialize() const @@ -87,7 +111,9 @@ SerializableFunction AlwaysEqTnpointNpointLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -97,12 +123,12 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlw PRECONDITION(arguments.children.size() == 5, "AlwaysEqTnpointNpointLogicalFunction requires 5 children but got {}", arguments.children.size()); - return AlwaysEqTnpointNpointLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2]), - std::move(arguments.children[3]), - std::move(arguments.children[4])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + return AlwaysEqTnpointNpointLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysEqTnpointTnpointLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysEqTnpointTnpointLogicalFunction.cpp index 5d2ef221c8..f91e1a2814 100644 --- a/nes-logical-operators/src/Functions/Meos/AlwaysEqTnpointTnpointLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/AlwaysEqTnpointTnpointLogicalFunction.cpp @@ -26,63 +26,85 @@ namespace NES { -AlwaysEqTnpointTnpointLogicalFunction::AlwaysEqTnpointTnpointLogicalFunction( - LogicalFunction rid1, LogicalFunction pos1, LogicalFunction ts1, - LogicalFunction rid2, LogicalFunction pos2, LogicalFunction ts2) +AlwaysEqTnpointTnpointLogicalFunction::AlwaysEqTnpointTnpointLogicalFunction(LogicalFunction rid, + LogicalFunction frac, + LogicalFunction ts, + LogicalFunction rid0, + LogicalFunction frac0, + LogicalFunction ts0) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(6); - parameters.push_back(std::move(rid1)); - parameters.push_back(std::move(pos1)); - parameters.push_back(std::move(ts1)); - parameters.push_back(std::move(rid2)); - parameters.push_back(std::move(pos2)); - parameters.push_back(std::move(ts2)); + parameters.push_back(std::move(rid)); + parameters.push_back(std::move(frac)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(rid0)); + parameters.push_back(std::move(frac0)); + parameters.push_back(std::move(ts0)); } -DataType AlwaysEqTnpointTnpointLogicalFunction::getDataType() const { return dataType; } +DataType AlwaysEqTnpointTnpointLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction AlwaysEqTnpointTnpointLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector AlwaysEqTnpointTnpointLogicalFunction::getChildren() const { return parameters; } +std::vector AlwaysEqTnpointTnpointLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction AlwaysEqTnpointTnpointLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 6, - "AlwaysEqTnpointTnpointLogicalFunction requires 6 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 6, "AlwaysEqTnpointTnpointLogicalFunction requires 6 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view AlwaysEqTnpointTnpointLogicalFunction::getType() const { return NAME; } +std::string_view AlwaysEqTnpointTnpointLogicalFunction::getType() const +{ + return NAME; +} bool AlwaysEqTnpointTnpointLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string AlwaysEqTnpointTnpointLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction AlwaysEqTnpointTnpointLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(6); - for (const auto& p : parameters) - c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "rid1 must be UINT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "pos1 must be FLOAT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); - INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "rid2 must be UINT64"); - INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "pos2 must be FLOAT64"); - INVARIANT(c[5].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction AlwaysEqTnpointTnpointLogicalFunction::serialize() const @@ -91,7 +113,9 @@ SerializableFunction AlwaysEqTnpointTnpointLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -101,12 +125,13 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlw PRECONDITION(arguments.children.size() == 6, "AlwaysEqTnpointTnpointLogicalFunction requires 6 children but got {}", arguments.children.size()); - return AlwaysEqTnpointTnpointLogicalFunction(std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2]), - std::move(arguments.children[3]), - std::move(arguments.children[4]), - std::move(arguments.children[5])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + auto arg5 = std::move(arguments.children[5]); + return AlwaysEqTnpointTnpointLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysEqTposePoseLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysEqTposePoseLogicalFunction.cpp index 8fa49b257f..1d4ee6365c 100644 --- a/nes-logical-operators/src/Functions/Meos/AlwaysEqTposePoseLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/AlwaysEqTposePoseLogicalFunction.cpp @@ -26,7 +26,13 @@ namespace NES { -AlwaysEqTposePoseLogicalFunction::AlwaysEqTposePoseLogicalFunction(LogicalFunction x, LogicalFunction y, LogicalFunction theta, LogicalFunction ts, LogicalFunction x2, LogicalFunction y2, LogicalFunction theta2) +AlwaysEqTposePoseLogicalFunction::AlwaysEqTposePoseLogicalFunction(LogicalFunction x, + LogicalFunction y, + LogicalFunction theta, + LogicalFunction ts, + LogicalFunction px0, + LogicalFunction py0, + LogicalFunction ptheta0) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(7); @@ -34,55 +40,73 @@ AlwaysEqTposePoseLogicalFunction::AlwaysEqTposePoseLogicalFunction(LogicalFuncti parameters.push_back(std::move(y)); parameters.push_back(std::move(theta)); parameters.push_back(std::move(ts)); - parameters.push_back(std::move(x2)); - parameters.push_back(std::move(y2)); - parameters.push_back(std::move(theta2)); + parameters.push_back(std::move(px0)); + parameters.push_back(std::move(py0)); + parameters.push_back(std::move(ptheta0)); } -DataType AlwaysEqTposePoseLogicalFunction::getDataType() const { return dataType; } +DataType AlwaysEqTposePoseLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction AlwaysEqTposePoseLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector AlwaysEqTposePoseLogicalFunction::getChildren() const { return parameters; } +std::vector AlwaysEqTposePoseLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction AlwaysEqTposePoseLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 7, - "AlwaysEqTposePoseLogicalFunction requires 7 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 7, "AlwaysEqTposePoseLogicalFunction requires 7 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view AlwaysEqTposePoseLogicalFunction::getType() const { return NAME; } +std::string_view AlwaysEqTposePoseLogicalFunction::getType() const +{ + return NAME; +} bool AlwaysEqTposePoseLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string AlwaysEqTposePoseLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction AlwaysEqTposePoseLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(7); - for (const auto& p : parameters) - c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "x must be FLOAT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "y must be FLOAT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "theta must be FLOAT64"); - INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); - INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "x2 must be FLOAT64"); - INVARIANT(c[5].getDataType().isType(DataType::Type::FLOAT64), "y2 must be FLOAT64"); - INVARIANT(c[6].getDataType().isType(DataType::Type::FLOAT64), "theta2 must be FLOAT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction AlwaysEqTposePoseLogicalFunction::serialize() const @@ -91,7 +115,9 @@ SerializableFunction AlwaysEqTposePoseLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -101,14 +127,14 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlw PRECONDITION(arguments.children.size() == 7, "AlwaysEqTposePoseLogicalFunction requires 7 children but got {}", arguments.children.size()); - return AlwaysEqTposePoseLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2]), - std::move(arguments.children[3]), - std::move(arguments.children[4]), - std::move(arguments.children[5]), - std::move(arguments.children[6])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + auto arg5 = std::move(arguments.children[5]); + auto arg6 = std::move(arguments.children[6]); + return AlwaysEqTposePoseLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysEqTposeTposeLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysEqTposeTposeLogicalFunction.cpp index f3276aa7c8..9f1b7aae10 100644 --- a/nes-logical-operators/src/Functions/Meos/AlwaysEqTposeTposeLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/AlwaysEqTposeTposeLogicalFunction.cpp @@ -26,67 +26,89 @@ namespace NES { -AlwaysEqTposeTposeLogicalFunction::AlwaysEqTposeTposeLogicalFunction( - LogicalFunction x1, LogicalFunction y1, LogicalFunction theta1, LogicalFunction ts1, - LogicalFunction x2, LogicalFunction y2, LogicalFunction theta2, LogicalFunction ts2) +AlwaysEqTposeTposeLogicalFunction::AlwaysEqTposeTposeLogicalFunction(LogicalFunction x, + LogicalFunction y, + LogicalFunction theta, + LogicalFunction ts, + LogicalFunction px0, + LogicalFunction py0, + LogicalFunction ptheta0, + LogicalFunction ts0) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(8); - parameters.push_back(std::move(x1)); - parameters.push_back(std::move(y1)); - parameters.push_back(std::move(theta1)); - parameters.push_back(std::move(ts1)); - parameters.push_back(std::move(x2)); - parameters.push_back(std::move(y2)); - parameters.push_back(std::move(theta2)); - parameters.push_back(std::move(ts2)); + parameters.push_back(std::move(x)); + parameters.push_back(std::move(y)); + parameters.push_back(std::move(theta)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(px0)); + parameters.push_back(std::move(py0)); + parameters.push_back(std::move(ptheta0)); + parameters.push_back(std::move(ts0)); } -DataType AlwaysEqTposeTposeLogicalFunction::getDataType() const { return dataType; } +DataType AlwaysEqTposeTposeLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction AlwaysEqTposeTposeLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector AlwaysEqTposeTposeLogicalFunction::getChildren() const { return parameters; } +std::vector AlwaysEqTposeTposeLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction AlwaysEqTposeTposeLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 8, - "AlwaysEqTposeTposeLogicalFunction requires 8 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 8, "AlwaysEqTposeTposeLogicalFunction requires 8 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view AlwaysEqTposeTposeLogicalFunction::getType() const { return NAME; } +std::string_view AlwaysEqTposeTposeLogicalFunction::getType() const +{ + return NAME; +} bool AlwaysEqTposeTposeLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string AlwaysEqTposeTposeLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction AlwaysEqTposeTposeLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(8); - for (const auto& p : parameters) - c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "x1 must be FLOAT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "y1 must be FLOAT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "theta1 must be FLOAT64"); - INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); - INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "x2 must be FLOAT64"); - INVARIANT(c[5].getDataType().isType(DataType::Type::FLOAT64), "y2 must be FLOAT64"); - INVARIANT(c[6].getDataType().isType(DataType::Type::FLOAT64), "theta2 must be FLOAT64"); - INVARIANT(c[7].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction AlwaysEqTposeTposeLogicalFunction::serialize() const @@ -95,7 +117,9 @@ SerializableFunction AlwaysEqTposeTposeLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -105,14 +129,15 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlw PRECONDITION(arguments.children.size() == 8, "AlwaysEqTposeTposeLogicalFunction requires 8 children but got {}", arguments.children.size()); - return AlwaysEqTposeTposeLogicalFunction(std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2]), - std::move(arguments.children[3]), - std::move(arguments.children[4]), - std::move(arguments.children[5]), - std::move(arguments.children[6]), - std::move(arguments.children[7])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + auto arg5 = std::move(arguments.children[5]); + auto arg6 = std::move(arguments.children[6]); + auto arg7 = std::move(arguments.children[7]); + return AlwaysEqTposeTposeLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6), std::move(arg7)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysEqTquadbinQuadbinLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysEqTquadbinQuadbinLogicalFunction.cpp index aaf9fee915..c88065550c 100644 --- a/nes-logical-operators/src/Functions/Meos/AlwaysEqTquadbinQuadbinLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/AlwaysEqTquadbinQuadbinLogicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -25,54 +26,103 @@ namespace NES { -AlwaysEqTquadbinQuadbinLogicalFunction::AlwaysEqTquadbinQuadbinLogicalFunction(LogicalFunction inst_cell, LogicalFunction ts, LogicalFunction cell) +AlwaysEqTquadbinQuadbinLogicalFunction::AlwaysEqTquadbinQuadbinLogicalFunction(LogicalFunction cell, + LogicalFunction ts, + LogicalFunction arg0) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(3); - parameters.push_back(std::move(inst_cell)); - parameters.push_back(std::move(ts)); parameters.push_back(std::move(cell)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(arg0)); +} + +DataType AlwaysEqTquadbinQuadbinLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction AlwaysEqTquadbinQuadbinLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector AlwaysEqTquadbinQuadbinLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction AlwaysEqTquadbinQuadbinLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "AlwaysEqTquadbinQuadbinLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -DataType AlwaysEqTquadbinQuadbinLogicalFunction::getDataType() const { return dataType; } -LogicalFunction AlwaysEqTquadbinQuadbinLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } -std::vector AlwaysEqTquadbinQuadbinLogicalFunction::getChildren() const { return parameters; } -LogicalFunction AlwaysEqTquadbinQuadbinLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size()==3,"AlwaysEqTquadbinQuadbinLogicalFunction requires 3 children, but got {}",children.size()); - auto c=*this; c.parameters=children; return c; + +std::string_view AlwaysEqTquadbinQuadbinLogicalFunction::getType() const +{ + return NAME; } -std::string_view AlwaysEqTquadbinQuadbinLogicalFunction::getType() const { return NAME; } -bool AlwaysEqTquadbinQuadbinLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { - if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + +bool AlwaysEqTquadbinQuadbinLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } return false; } -std::string AlwaysEqTquadbinQuadbinLogicalFunction::explain(ExplainVerbosity v) const { - return fmt::format("{}({})",NAME,parameters[0].explain(v)); + +std::string AlwaysEqTquadbinQuadbinLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } -LogicalFunction AlwaysEqTquadbinQuadbinLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; c.reserve(3); - for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "inst_cell must be UINT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "cell must be UINT64"); - return withChildren(c); + +LogicalFunction AlwaysEqTquadbinQuadbinLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } -SerializableFunction AlwaysEqTquadbinQuadbinLogicalFunction::serialize() const { + +SerializableFunction AlwaysEqTquadbinQuadbinLogicalFunction::serialize() const +{ SerializableFunction proto; proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); - for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } return proto; } + LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysEqTquadbinQuadbinLogicalFunction( LogicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.children.size()==3, + PRECONDITION(arguments.children.size() == 3, "AlwaysEqTquadbinQuadbinLogicalFunction requires 3 children but got {}", arguments.children.size()); - return AlwaysEqTquadbinQuadbinLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return AlwaysEqTquadbinQuadbinLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysEqTtextTextLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysEqTtextTextLogicalFunction.cpp index fa16a2e415..b06f6a67a5 100644 --- a/nes-logical-operators/src/Functions/Meos/AlwaysEqTtextTextLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/AlwaysEqTtextTextLogicalFunction.cpp @@ -13,81 +13,116 @@ */ #include -#include -#include -#include -#include + #include +#include #include -#include -#include -#include #include +#include +#include +#include #include -#include -#include -#include -#include - -namespace NES { -AlwaysEqTtextTextLogicalFunction::AlwaysEqTtextTextLogicalFunction( - LogicalFunction value, LogicalFunction ref, LogicalFunction ts) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { - parameters = {std::move(value), std::move(ref), std::move(ts)}; +namespace NES +{ + +AlwaysEqTtextTextLogicalFunction::AlwaysEqTtextTextLogicalFunction(LogicalFunction value, + LogicalFunction ts, + LogicalFunction arg0) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(arg0)); } -DataType AlwaysEqTtextTextLogicalFunction::getDataType() const { return dataType; } +DataType AlwaysEqTtextTextLogicalFunction::getDataType() const +{ + return dataType; +} -LogicalFunction AlwaysEqTtextTextLogicalFunction::withDataType(const DataType& dt) const { - auto c = *this; c.dataType = dt; return c; +LogicalFunction AlwaysEqTtextTextLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector AlwaysEqTtextTextLogicalFunction::getChildren() const { return parameters; } +std::vector AlwaysEqTtextTextLogicalFunction::getChildren() const +{ + return parameters; +} -LogicalFunction AlwaysEqTtextTextLogicalFunction::withChildren(const std::vector& ch) const { - PRECONDITION(ch.size() == 3, "AlwaysEqTtextText expects 3 params, got {}", ch.size()); - auto c = *this; c.parameters = ch; return c; +LogicalFunction AlwaysEqTtextTextLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "AlwaysEqTtextTextLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view AlwaysEqTtextTextLogicalFunction::getType() const { return NAME; } +std::string_view AlwaysEqTtextTextLogicalFunction::getType() const +{ + return NAME; +} -bool AlwaysEqTtextTextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { - const auto* o = dynamic_cast(&rhs); - return o && parameters == o->parameters; +bool AlwaysEqTtextTextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } + return false; } -std::string AlwaysEqTtextTextLogicalFunction::explain(ExplainVerbosity v) const { - return fmt::format("AlwaysEqTtextText({}, {}, {})", - parameters[0].explain(v), parameters[1].explain(v), parameters[2].explain(v)); +std::string AlwaysEqTtextTextLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } -LogicalFunction AlwaysEqTtextTextLogicalFunction::withInferredDataType(const Schema& s) const { - std::vector ch; - ch.reserve(3); - for (auto& p : parameters) ch.push_back(p.withInferredDataType(s)); - auto isStr = [](const DataType& dt) { return dt.isType(DataType::Type::VARSIZED); }; - auto isTime = [](const DataType& dt) { return dt.isType(DataType::Type::UINT64); }; - INVARIANT(isStr(ch[0].getDataType()) && isStr(ch[1].getDataType()) && isTime(ch[2].getDataType()), - "AlwaysEqTtextText: expects (VARCHAR, VARCHAR, UINT64)"); - return withChildren(ch); +LogicalFunction AlwaysEqTtextTextLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } -SerializableFunction AlwaysEqTtextTextLogicalFunction::serialize() const { - SerializableFunction sf; - sf.set_function_type(std::string(NAME)); - for (auto& p : parameters) *sf.add_children() = p.serialize(); - DataTypeSerializationUtil::serializeDataType(dataType, sf.mutable_data_type()); - return sf; +SerializableFunction AlwaysEqTtextTextLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } + return proto; } -LogicalFunctionRegistryReturnType -LogicalFunctionGeneratedRegistrar::RegisterAlwaysEqTtextTextLogicalFunction( - LogicalFunctionRegistryArguments arguments) { +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysEqTtextTextLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ PRECONDITION(arguments.children.size() == 3, - "AlwaysEqTtextText expects 3 params, got {}", arguments.children.size()); - return AlwaysEqTtextTextLogicalFunction( - arguments.children[0], arguments.children[1], arguments.children[2]); + "AlwaysEqTtextTextLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return AlwaysEqTtextTextLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysGeBigintTbigintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysGeBigintTbigintLogicalFunction.cpp index 1655a5f099..c73c18e4dd 100644 --- a/nes-logical-operators/src/Functions/Meos/AlwaysGeBigintTbigintLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/AlwaysGeBigintTbigintLogicalFunction.cpp @@ -26,46 +26,65 @@ namespace NES { -AlwaysGeBigintTbigintLogicalFunction::AlwaysGeBigintTbigintLogicalFunction(LogicalFunction value, - LogicalFunction threshold, - LogicalFunction ts) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +AlwaysGeBigintTbigintLogicalFunction::AlwaysGeBigintTbigintLogicalFunction(LogicalFunction arg0, + LogicalFunction value, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) { parameters.reserve(3); + parameters.push_back(std::move(arg0)); parameters.push_back(std::move(value)); - parameters.push_back(std::move(threshold)); parameters.push_back(std::move(ts)); } -DataType AlwaysGeBigintTbigintLogicalFunction::getDataType() const { return dataType; } +DataType AlwaysGeBigintTbigintLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction AlwaysGeBigintTbigintLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector AlwaysGeBigintTbigintLogicalFunction::getChildren() const { return parameters; } +std::vector AlwaysGeBigintTbigintLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction AlwaysGeBigintTbigintLogicalFunction::withChildren(const std::vector& children) const { PRECONDITION(children.size() == 3, "AlwaysGeBigintTbigintLogicalFunction requires 3 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view AlwaysGeBigintTbigintLogicalFunction::getType() const { return NAME; } +std::string_view AlwaysGeBigintTbigintLogicalFunction::getType() const +{ + return NAME; +} bool AlwaysGeBigintTbigintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string AlwaysGeBigintTbigintLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -76,7 +95,9 @@ LogicalFunction AlwaysGeBigintTbigintLogicalFunction::withInferredDataType(const std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -86,7 +107,9 @@ SerializableFunction AlwaysGeBigintTbigintLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysGeTbigintBigintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysGeTbigintBigintLogicalFunction.cpp index d433b0175f..808c7621b0 100644 --- a/nes-logical-operators/src/Functions/Meos/AlwaysGeTbigintBigintLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/AlwaysGeTbigintBigintLogicalFunction.cpp @@ -27,45 +27,64 @@ namespace NES { AlwaysGeTbigintBigintLogicalFunction::AlwaysGeTbigintBigintLogicalFunction(LogicalFunction value, - LogicalFunction threshold, - LogicalFunction ts) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) + LogicalFunction ts, + LogicalFunction arg0) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) { parameters.reserve(3); parameters.push_back(std::move(value)); - parameters.push_back(std::move(threshold)); parameters.push_back(std::move(ts)); + parameters.push_back(std::move(arg0)); } -DataType AlwaysGeTbigintBigintLogicalFunction::getDataType() const { return dataType; } +DataType AlwaysGeTbigintBigintLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction AlwaysGeTbigintBigintLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector AlwaysGeTbigintBigintLogicalFunction::getChildren() const { return parameters; } +std::vector AlwaysGeTbigintBigintLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction AlwaysGeTbigintBigintLogicalFunction::withChildren(const std::vector& children) const { PRECONDITION(children.size() == 3, "AlwaysGeTbigintBigintLogicalFunction requires 3 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view AlwaysGeTbigintBigintLogicalFunction::getType() const { return NAME; } +std::string_view AlwaysGeTbigintBigintLogicalFunction::getType() const +{ + return NAME; +} bool AlwaysGeTbigintBigintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string AlwaysGeTbigintBigintLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -76,7 +95,9 @@ LogicalFunction AlwaysGeTbigintBigintLogicalFunction::withInferredDataType(const std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -86,7 +107,9 @@ SerializableFunction AlwaysGeTbigintBigintLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysGeTextTtextLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysGeTextTtextLogicalFunction.cpp index 78396dd1f5..baff50d0e5 100644 --- a/nes-logical-operators/src/Functions/Meos/AlwaysGeTextTtextLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/AlwaysGeTextTtextLogicalFunction.cpp @@ -13,81 +13,116 @@ */ #include -#include -#include -#include -#include + #include +#include #include -#include -#include -#include #include +#include +#include +#include #include -#include -#include -#include -#include - -namespace NES { -AlwaysGeTextTtextLogicalFunction::AlwaysGeTextTtextLogicalFunction( - LogicalFunction value, LogicalFunction ref, LogicalFunction ts) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { - parameters = {std::move(value), std::move(ref), std::move(ts)}; +namespace NES +{ + +AlwaysGeTextTtextLogicalFunction::AlwaysGeTextTtextLogicalFunction(LogicalFunction arg0, + LogicalFunction value, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(arg0)); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(ts)); } -DataType AlwaysGeTextTtextLogicalFunction::getDataType() const { return dataType; } +DataType AlwaysGeTextTtextLogicalFunction::getDataType() const +{ + return dataType; +} -LogicalFunction AlwaysGeTextTtextLogicalFunction::withDataType(const DataType& dt) const { - auto c = *this; c.dataType = dt; return c; +LogicalFunction AlwaysGeTextTtextLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector AlwaysGeTextTtextLogicalFunction::getChildren() const { return parameters; } +std::vector AlwaysGeTextTtextLogicalFunction::getChildren() const +{ + return parameters; +} -LogicalFunction AlwaysGeTextTtextLogicalFunction::withChildren(const std::vector& ch) const { - PRECONDITION(ch.size() == 3, "AlwaysGeTextTtext expects 3 params, got {}", ch.size()); - auto c = *this; c.parameters = ch; return c; +LogicalFunction AlwaysGeTextTtextLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "AlwaysGeTextTtextLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view AlwaysGeTextTtextLogicalFunction::getType() const { return NAME; } +std::string_view AlwaysGeTextTtextLogicalFunction::getType() const +{ + return NAME; +} -bool AlwaysGeTextTtextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { - const auto* o = dynamic_cast(&rhs); - return o && parameters == o->parameters; +bool AlwaysGeTextTtextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } + return false; } -std::string AlwaysGeTextTtextLogicalFunction::explain(ExplainVerbosity v) const { - return fmt::format("AlwaysGeTextTtext({}, {}, {})", - parameters[0].explain(v), parameters[1].explain(v), parameters[2].explain(v)); +std::string AlwaysGeTextTtextLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } -LogicalFunction AlwaysGeTextTtextLogicalFunction::withInferredDataType(const Schema& s) const { - std::vector ch; - ch.reserve(3); - for (auto& p : parameters) ch.push_back(p.withInferredDataType(s)); - auto isStr = [](const DataType& dt) { return dt.isType(DataType::Type::VARSIZED); }; - auto isTime = [](const DataType& dt) { return dt.isType(DataType::Type::UINT64); }; - INVARIANT(isStr(ch[0].getDataType()) && isStr(ch[1].getDataType()) && isTime(ch[2].getDataType()), - "AlwaysGeTextTtext: expects (VARCHAR, VARCHAR, UINT64)"); - return withChildren(ch); +LogicalFunction AlwaysGeTextTtextLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } -SerializableFunction AlwaysGeTextTtextLogicalFunction::serialize() const { - SerializableFunction sf; - sf.set_function_type(std::string(NAME)); - for (auto& p : parameters) *sf.add_children() = p.serialize(); - DataTypeSerializationUtil::serializeDataType(dataType, sf.mutable_data_type()); - return sf; +SerializableFunction AlwaysGeTextTtextLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } + return proto; } -LogicalFunctionRegistryReturnType -LogicalFunctionGeneratedRegistrar::RegisterAlwaysGeTextTtextLogicalFunction( - LogicalFunctionRegistryArguments arguments) { +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysGeTextTtextLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ PRECONDITION(arguments.children.size() == 3, - "AlwaysGeTextTtext expects 3 params, got {}", arguments.children.size()); - return AlwaysGeTextTtextLogicalFunction( - arguments.children[0], arguments.children[1], arguments.children[2]); + "AlwaysGeTextTtextLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return AlwaysGeTextTtextLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysGeTtextTextLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysGeTtextTextLogicalFunction.cpp index de309a500a..f9fdc19f39 100644 --- a/nes-logical-operators/src/Functions/Meos/AlwaysGeTtextTextLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/AlwaysGeTtextTextLogicalFunction.cpp @@ -13,81 +13,116 @@ */ #include -#include -#include -#include -#include + #include +#include #include -#include -#include -#include #include +#include +#include +#include #include -#include -#include -#include -#include - -namespace NES { -AlwaysGeTtextTextLogicalFunction::AlwaysGeTtextTextLogicalFunction( - LogicalFunction value, LogicalFunction ref, LogicalFunction ts) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { - parameters = {std::move(value), std::move(ref), std::move(ts)}; +namespace NES +{ + +AlwaysGeTtextTextLogicalFunction::AlwaysGeTtextTextLogicalFunction(LogicalFunction value, + LogicalFunction ts, + LogicalFunction arg0) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(arg0)); } -DataType AlwaysGeTtextTextLogicalFunction::getDataType() const { return dataType; } +DataType AlwaysGeTtextTextLogicalFunction::getDataType() const +{ + return dataType; +} -LogicalFunction AlwaysGeTtextTextLogicalFunction::withDataType(const DataType& dt) const { - auto c = *this; c.dataType = dt; return c; +LogicalFunction AlwaysGeTtextTextLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector AlwaysGeTtextTextLogicalFunction::getChildren() const { return parameters; } +std::vector AlwaysGeTtextTextLogicalFunction::getChildren() const +{ + return parameters; +} -LogicalFunction AlwaysGeTtextTextLogicalFunction::withChildren(const std::vector& ch) const { - PRECONDITION(ch.size() == 3, "AlwaysGeTtextText expects 3 params, got {}", ch.size()); - auto c = *this; c.parameters = ch; return c; +LogicalFunction AlwaysGeTtextTextLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "AlwaysGeTtextTextLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view AlwaysGeTtextTextLogicalFunction::getType() const { return NAME; } +std::string_view AlwaysGeTtextTextLogicalFunction::getType() const +{ + return NAME; +} -bool AlwaysGeTtextTextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { - const auto* o = dynamic_cast(&rhs); - return o && parameters == o->parameters; +bool AlwaysGeTtextTextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } + return false; } -std::string AlwaysGeTtextTextLogicalFunction::explain(ExplainVerbosity v) const { - return fmt::format("AlwaysGeTtextText({}, {}, {})", - parameters[0].explain(v), parameters[1].explain(v), parameters[2].explain(v)); +std::string AlwaysGeTtextTextLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } -LogicalFunction AlwaysGeTtextTextLogicalFunction::withInferredDataType(const Schema& s) const { - std::vector ch; - ch.reserve(3); - for (auto& p : parameters) ch.push_back(p.withInferredDataType(s)); - auto isStr = [](const DataType& dt) { return dt.isType(DataType::Type::VARSIZED); }; - auto isTime = [](const DataType& dt) { return dt.isType(DataType::Type::UINT64); }; - INVARIANT(isStr(ch[0].getDataType()) && isStr(ch[1].getDataType()) && isTime(ch[2].getDataType()), - "AlwaysGeTtextText: expects (VARCHAR, VARCHAR, UINT64)"); - return withChildren(ch); +LogicalFunction AlwaysGeTtextTextLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } -SerializableFunction AlwaysGeTtextTextLogicalFunction::serialize() const { - SerializableFunction sf; - sf.set_function_type(std::string(NAME)); - for (auto& p : parameters) *sf.add_children() = p.serialize(); - DataTypeSerializationUtil::serializeDataType(dataType, sf.mutable_data_type()); - return sf; +SerializableFunction AlwaysGeTtextTextLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } + return proto; } -LogicalFunctionRegistryReturnType -LogicalFunctionGeneratedRegistrar::RegisterAlwaysGeTtextTextLogicalFunction( - LogicalFunctionRegistryArguments arguments) { +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysGeTtextTextLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ PRECONDITION(arguments.children.size() == 3, - "AlwaysGeTtextText expects 3 params, got {}", arguments.children.size()); - return AlwaysGeTtextTextLogicalFunction( - arguments.children[0], arguments.children[1], arguments.children[2]); + "AlwaysGeTtextTextLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return AlwaysGeTtextTextLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysGtBigintTbigintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysGtBigintTbigintLogicalFunction.cpp index 61388c58bc..ee0e4c4d8e 100644 --- a/nes-logical-operators/src/Functions/Meos/AlwaysGtBigintTbigintLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/AlwaysGtBigintTbigintLogicalFunction.cpp @@ -26,46 +26,65 @@ namespace NES { -AlwaysGtBigintTbigintLogicalFunction::AlwaysGtBigintTbigintLogicalFunction(LogicalFunction value, - LogicalFunction threshold, - LogicalFunction ts) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +AlwaysGtBigintTbigintLogicalFunction::AlwaysGtBigintTbigintLogicalFunction(LogicalFunction arg0, + LogicalFunction value, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) { parameters.reserve(3); + parameters.push_back(std::move(arg0)); parameters.push_back(std::move(value)); - parameters.push_back(std::move(threshold)); parameters.push_back(std::move(ts)); } -DataType AlwaysGtBigintTbigintLogicalFunction::getDataType() const { return dataType; } +DataType AlwaysGtBigintTbigintLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction AlwaysGtBigintTbigintLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector AlwaysGtBigintTbigintLogicalFunction::getChildren() const { return parameters; } +std::vector AlwaysGtBigintTbigintLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction AlwaysGtBigintTbigintLogicalFunction::withChildren(const std::vector& children) const { PRECONDITION(children.size() == 3, "AlwaysGtBigintTbigintLogicalFunction requires 3 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view AlwaysGtBigintTbigintLogicalFunction::getType() const { return NAME; } +std::string_view AlwaysGtBigintTbigintLogicalFunction::getType() const +{ + return NAME; +} bool AlwaysGtBigintTbigintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string AlwaysGtBigintTbigintLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -76,7 +95,9 @@ LogicalFunction AlwaysGtBigintTbigintLogicalFunction::withInferredDataType(const std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -86,7 +107,9 @@ SerializableFunction AlwaysGtBigintTbigintLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysGtTbigintBigintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysGtTbigintBigintLogicalFunction.cpp index 3bd42528ad..e6389084f5 100644 --- a/nes-logical-operators/src/Functions/Meos/AlwaysGtTbigintBigintLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/AlwaysGtTbigintBigintLogicalFunction.cpp @@ -27,45 +27,64 @@ namespace NES { AlwaysGtTbigintBigintLogicalFunction::AlwaysGtTbigintBigintLogicalFunction(LogicalFunction value, - LogicalFunction threshold, - LogicalFunction ts) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) + LogicalFunction ts, + LogicalFunction arg0) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) { parameters.reserve(3); parameters.push_back(std::move(value)); - parameters.push_back(std::move(threshold)); parameters.push_back(std::move(ts)); + parameters.push_back(std::move(arg0)); } -DataType AlwaysGtTbigintBigintLogicalFunction::getDataType() const { return dataType; } +DataType AlwaysGtTbigintBigintLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction AlwaysGtTbigintBigintLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector AlwaysGtTbigintBigintLogicalFunction::getChildren() const { return parameters; } +std::vector AlwaysGtTbigintBigintLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction AlwaysGtTbigintBigintLogicalFunction::withChildren(const std::vector& children) const { PRECONDITION(children.size() == 3, "AlwaysGtTbigintBigintLogicalFunction requires 3 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view AlwaysGtTbigintBigintLogicalFunction::getType() const { return NAME; } +std::string_view AlwaysGtTbigintBigintLogicalFunction::getType() const +{ + return NAME; +} bool AlwaysGtTbigintBigintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string AlwaysGtTbigintBigintLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -76,7 +95,9 @@ LogicalFunction AlwaysGtTbigintBigintLogicalFunction::withInferredDataType(const std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -86,7 +107,9 @@ SerializableFunction AlwaysGtTbigintBigintLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysGtTextTtextLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysGtTextTtextLogicalFunction.cpp index 0cfebc7906..9594e8b49b 100644 --- a/nes-logical-operators/src/Functions/Meos/AlwaysGtTextTtextLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/AlwaysGtTextTtextLogicalFunction.cpp @@ -13,81 +13,116 @@ */ #include -#include -#include -#include -#include + #include +#include #include -#include -#include -#include #include +#include +#include +#include #include -#include -#include -#include -#include - -namespace NES { -AlwaysGtTextTtextLogicalFunction::AlwaysGtTextTtextLogicalFunction( - LogicalFunction value, LogicalFunction ref, LogicalFunction ts) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { - parameters = {std::move(value), std::move(ref), std::move(ts)}; +namespace NES +{ + +AlwaysGtTextTtextLogicalFunction::AlwaysGtTextTtextLogicalFunction(LogicalFunction arg0, + LogicalFunction value, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(arg0)); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(ts)); } -DataType AlwaysGtTextTtextLogicalFunction::getDataType() const { return dataType; } +DataType AlwaysGtTextTtextLogicalFunction::getDataType() const +{ + return dataType; +} -LogicalFunction AlwaysGtTextTtextLogicalFunction::withDataType(const DataType& dt) const { - auto c = *this; c.dataType = dt; return c; +LogicalFunction AlwaysGtTextTtextLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector AlwaysGtTextTtextLogicalFunction::getChildren() const { return parameters; } +std::vector AlwaysGtTextTtextLogicalFunction::getChildren() const +{ + return parameters; +} -LogicalFunction AlwaysGtTextTtextLogicalFunction::withChildren(const std::vector& ch) const { - PRECONDITION(ch.size() == 3, "AlwaysGtTextTtext expects 3 params, got {}", ch.size()); - auto c = *this; c.parameters = ch; return c; +LogicalFunction AlwaysGtTextTtextLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "AlwaysGtTextTtextLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view AlwaysGtTextTtextLogicalFunction::getType() const { return NAME; } +std::string_view AlwaysGtTextTtextLogicalFunction::getType() const +{ + return NAME; +} -bool AlwaysGtTextTtextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { - const auto* o = dynamic_cast(&rhs); - return o && parameters == o->parameters; +bool AlwaysGtTextTtextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } + return false; } -std::string AlwaysGtTextTtextLogicalFunction::explain(ExplainVerbosity v) const { - return fmt::format("AlwaysGtTextTtext({}, {}, {})", - parameters[0].explain(v), parameters[1].explain(v), parameters[2].explain(v)); +std::string AlwaysGtTextTtextLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } -LogicalFunction AlwaysGtTextTtextLogicalFunction::withInferredDataType(const Schema& s) const { - std::vector ch; - ch.reserve(3); - for (auto& p : parameters) ch.push_back(p.withInferredDataType(s)); - auto isStr = [](const DataType& dt) { return dt.isType(DataType::Type::VARSIZED); }; - auto isTime = [](const DataType& dt) { return dt.isType(DataType::Type::UINT64); }; - INVARIANT(isStr(ch[0].getDataType()) && isStr(ch[1].getDataType()) && isTime(ch[2].getDataType()), - "AlwaysGtTextTtext: expects (VARCHAR, VARCHAR, UINT64)"); - return withChildren(ch); +LogicalFunction AlwaysGtTextTtextLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } -SerializableFunction AlwaysGtTextTtextLogicalFunction::serialize() const { - SerializableFunction sf; - sf.set_function_type(std::string(NAME)); - for (auto& p : parameters) *sf.add_children() = p.serialize(); - DataTypeSerializationUtil::serializeDataType(dataType, sf.mutable_data_type()); - return sf; +SerializableFunction AlwaysGtTextTtextLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } + return proto; } -LogicalFunctionRegistryReturnType -LogicalFunctionGeneratedRegistrar::RegisterAlwaysGtTextTtextLogicalFunction( - LogicalFunctionRegistryArguments arguments) { +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysGtTextTtextLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ PRECONDITION(arguments.children.size() == 3, - "AlwaysGtTextTtext expects 3 params, got {}", arguments.children.size()); - return AlwaysGtTextTtextLogicalFunction( - arguments.children[0], arguments.children[1], arguments.children[2]); + "AlwaysGtTextTtextLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return AlwaysGtTextTtextLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysGtTtextTextLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysGtTtextTextLogicalFunction.cpp index 2bc4c83e01..f7bdd665f1 100644 --- a/nes-logical-operators/src/Functions/Meos/AlwaysGtTtextTextLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/AlwaysGtTtextTextLogicalFunction.cpp @@ -13,81 +13,116 @@ */ #include -#include -#include -#include -#include + #include +#include #include -#include -#include -#include #include +#include +#include +#include #include -#include -#include -#include -#include - -namespace NES { -AlwaysGtTtextTextLogicalFunction::AlwaysGtTtextTextLogicalFunction( - LogicalFunction value, LogicalFunction ref, LogicalFunction ts) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { - parameters = {std::move(value), std::move(ref), std::move(ts)}; +namespace NES +{ + +AlwaysGtTtextTextLogicalFunction::AlwaysGtTtextTextLogicalFunction(LogicalFunction value, + LogicalFunction ts, + LogicalFunction arg0) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(arg0)); } -DataType AlwaysGtTtextTextLogicalFunction::getDataType() const { return dataType; } +DataType AlwaysGtTtextTextLogicalFunction::getDataType() const +{ + return dataType; +} -LogicalFunction AlwaysGtTtextTextLogicalFunction::withDataType(const DataType& dt) const { - auto c = *this; c.dataType = dt; return c; +LogicalFunction AlwaysGtTtextTextLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector AlwaysGtTtextTextLogicalFunction::getChildren() const { return parameters; } +std::vector AlwaysGtTtextTextLogicalFunction::getChildren() const +{ + return parameters; +} -LogicalFunction AlwaysGtTtextTextLogicalFunction::withChildren(const std::vector& ch) const { - PRECONDITION(ch.size() == 3, "AlwaysGtTtextText expects 3 params, got {}", ch.size()); - auto c = *this; c.parameters = ch; return c; +LogicalFunction AlwaysGtTtextTextLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "AlwaysGtTtextTextLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view AlwaysGtTtextTextLogicalFunction::getType() const { return NAME; } +std::string_view AlwaysGtTtextTextLogicalFunction::getType() const +{ + return NAME; +} -bool AlwaysGtTtextTextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { - const auto* o = dynamic_cast(&rhs); - return o && parameters == o->parameters; +bool AlwaysGtTtextTextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } + return false; } -std::string AlwaysGtTtextTextLogicalFunction::explain(ExplainVerbosity v) const { - return fmt::format("AlwaysGtTtextText({}, {}, {})", - parameters[0].explain(v), parameters[1].explain(v), parameters[2].explain(v)); +std::string AlwaysGtTtextTextLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } -LogicalFunction AlwaysGtTtextTextLogicalFunction::withInferredDataType(const Schema& s) const { - std::vector ch; - ch.reserve(3); - for (auto& p : parameters) ch.push_back(p.withInferredDataType(s)); - auto isStr = [](const DataType& dt) { return dt.isType(DataType::Type::VARSIZED); }; - auto isTime = [](const DataType& dt) { return dt.isType(DataType::Type::UINT64); }; - INVARIANT(isStr(ch[0].getDataType()) && isStr(ch[1].getDataType()) && isTime(ch[2].getDataType()), - "AlwaysGtTtextText: expects (VARCHAR, VARCHAR, UINT64)"); - return withChildren(ch); +LogicalFunction AlwaysGtTtextTextLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } -SerializableFunction AlwaysGtTtextTextLogicalFunction::serialize() const { - SerializableFunction sf; - sf.set_function_type(std::string(NAME)); - for (auto& p : parameters) *sf.add_children() = p.serialize(); - DataTypeSerializationUtil::serializeDataType(dataType, sf.mutable_data_type()); - return sf; +SerializableFunction AlwaysGtTtextTextLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } + return proto; } -LogicalFunctionRegistryReturnType -LogicalFunctionGeneratedRegistrar::RegisterAlwaysGtTtextTextLogicalFunction( - LogicalFunctionRegistryArguments arguments) { +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysGtTtextTextLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ PRECONDITION(arguments.children.size() == 3, - "AlwaysGtTtextText expects 3 params, got {}", arguments.children.size()); - return AlwaysGtTtextTextLogicalFunction( - arguments.children[0], arguments.children[1], arguments.children[2]); + "AlwaysGtTtextTextLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return AlwaysGtTtextTextLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysLeBigintTbigintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysLeBigintTbigintLogicalFunction.cpp index e90f5be0b9..6a174f4fe5 100644 --- a/nes-logical-operators/src/Functions/Meos/AlwaysLeBigintTbigintLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/AlwaysLeBigintTbigintLogicalFunction.cpp @@ -26,46 +26,65 @@ namespace NES { -AlwaysLeBigintTbigintLogicalFunction::AlwaysLeBigintTbigintLogicalFunction(LogicalFunction value, - LogicalFunction threshold, - LogicalFunction ts) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +AlwaysLeBigintTbigintLogicalFunction::AlwaysLeBigintTbigintLogicalFunction(LogicalFunction arg0, + LogicalFunction value, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) { parameters.reserve(3); + parameters.push_back(std::move(arg0)); parameters.push_back(std::move(value)); - parameters.push_back(std::move(threshold)); parameters.push_back(std::move(ts)); } -DataType AlwaysLeBigintTbigintLogicalFunction::getDataType() const { return dataType; } +DataType AlwaysLeBigintTbigintLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction AlwaysLeBigintTbigintLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector AlwaysLeBigintTbigintLogicalFunction::getChildren() const { return parameters; } +std::vector AlwaysLeBigintTbigintLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction AlwaysLeBigintTbigintLogicalFunction::withChildren(const std::vector& children) const { PRECONDITION(children.size() == 3, "AlwaysLeBigintTbigintLogicalFunction requires 3 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view AlwaysLeBigintTbigintLogicalFunction::getType() const { return NAME; } +std::string_view AlwaysLeBigintTbigintLogicalFunction::getType() const +{ + return NAME; +} bool AlwaysLeBigintTbigintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string AlwaysLeBigintTbigintLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -76,7 +95,9 @@ LogicalFunction AlwaysLeBigintTbigintLogicalFunction::withInferredDataType(const std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -86,7 +107,9 @@ SerializableFunction AlwaysLeBigintTbigintLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysLeTbigintBigintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysLeTbigintBigintLogicalFunction.cpp index 86223eed0a..ca7ba6dac4 100644 --- a/nes-logical-operators/src/Functions/Meos/AlwaysLeTbigintBigintLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/AlwaysLeTbigintBigintLogicalFunction.cpp @@ -27,45 +27,64 @@ namespace NES { AlwaysLeTbigintBigintLogicalFunction::AlwaysLeTbigintBigintLogicalFunction(LogicalFunction value, - LogicalFunction threshold, - LogicalFunction ts) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) + LogicalFunction ts, + LogicalFunction arg0) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) { parameters.reserve(3); parameters.push_back(std::move(value)); - parameters.push_back(std::move(threshold)); parameters.push_back(std::move(ts)); + parameters.push_back(std::move(arg0)); } -DataType AlwaysLeTbigintBigintLogicalFunction::getDataType() const { return dataType; } +DataType AlwaysLeTbigintBigintLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction AlwaysLeTbigintBigintLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector AlwaysLeTbigintBigintLogicalFunction::getChildren() const { return parameters; } +std::vector AlwaysLeTbigintBigintLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction AlwaysLeTbigintBigintLogicalFunction::withChildren(const std::vector& children) const { PRECONDITION(children.size() == 3, "AlwaysLeTbigintBigintLogicalFunction requires 3 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view AlwaysLeTbigintBigintLogicalFunction::getType() const { return NAME; } +std::string_view AlwaysLeTbigintBigintLogicalFunction::getType() const +{ + return NAME; +} bool AlwaysLeTbigintBigintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string AlwaysLeTbigintBigintLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -76,7 +95,9 @@ LogicalFunction AlwaysLeTbigintBigintLogicalFunction::withInferredDataType(const std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -86,7 +107,9 @@ SerializableFunction AlwaysLeTbigintBigintLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysLeTextTtextLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysLeTextTtextLogicalFunction.cpp index 524c676048..dea9012d7c 100644 --- a/nes-logical-operators/src/Functions/Meos/AlwaysLeTextTtextLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/AlwaysLeTextTtextLogicalFunction.cpp @@ -13,81 +13,116 @@ */ #include -#include -#include -#include -#include + #include +#include #include -#include -#include -#include #include +#include +#include +#include #include -#include -#include -#include -#include - -namespace NES { -AlwaysLeTextTtextLogicalFunction::AlwaysLeTextTtextLogicalFunction( - LogicalFunction value, LogicalFunction ref, LogicalFunction ts) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { - parameters = {std::move(value), std::move(ref), std::move(ts)}; +namespace NES +{ + +AlwaysLeTextTtextLogicalFunction::AlwaysLeTextTtextLogicalFunction(LogicalFunction arg0, + LogicalFunction value, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(arg0)); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(ts)); } -DataType AlwaysLeTextTtextLogicalFunction::getDataType() const { return dataType; } +DataType AlwaysLeTextTtextLogicalFunction::getDataType() const +{ + return dataType; +} -LogicalFunction AlwaysLeTextTtextLogicalFunction::withDataType(const DataType& dt) const { - auto c = *this; c.dataType = dt; return c; +LogicalFunction AlwaysLeTextTtextLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector AlwaysLeTextTtextLogicalFunction::getChildren() const { return parameters; } +std::vector AlwaysLeTextTtextLogicalFunction::getChildren() const +{ + return parameters; +} -LogicalFunction AlwaysLeTextTtextLogicalFunction::withChildren(const std::vector& ch) const { - PRECONDITION(ch.size() == 3, "AlwaysLeTextTtext expects 3 params, got {}", ch.size()); - auto c = *this; c.parameters = ch; return c; +LogicalFunction AlwaysLeTextTtextLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "AlwaysLeTextTtextLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view AlwaysLeTextTtextLogicalFunction::getType() const { return NAME; } +std::string_view AlwaysLeTextTtextLogicalFunction::getType() const +{ + return NAME; +} -bool AlwaysLeTextTtextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { - const auto* o = dynamic_cast(&rhs); - return o && parameters == o->parameters; +bool AlwaysLeTextTtextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } + return false; } -std::string AlwaysLeTextTtextLogicalFunction::explain(ExplainVerbosity v) const { - return fmt::format("AlwaysLeTextTtext({}, {}, {})", - parameters[0].explain(v), parameters[1].explain(v), parameters[2].explain(v)); +std::string AlwaysLeTextTtextLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } -LogicalFunction AlwaysLeTextTtextLogicalFunction::withInferredDataType(const Schema& s) const { - std::vector ch; - ch.reserve(3); - for (auto& p : parameters) ch.push_back(p.withInferredDataType(s)); - auto isStr = [](const DataType& dt) { return dt.isType(DataType::Type::VARSIZED); }; - auto isTime = [](const DataType& dt) { return dt.isType(DataType::Type::UINT64); }; - INVARIANT(isStr(ch[0].getDataType()) && isStr(ch[1].getDataType()) && isTime(ch[2].getDataType()), - "AlwaysLeTextTtext: expects (VARCHAR, VARCHAR, UINT64)"); - return withChildren(ch); +LogicalFunction AlwaysLeTextTtextLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } -SerializableFunction AlwaysLeTextTtextLogicalFunction::serialize() const { - SerializableFunction sf; - sf.set_function_type(std::string(NAME)); - for (auto& p : parameters) *sf.add_children() = p.serialize(); - DataTypeSerializationUtil::serializeDataType(dataType, sf.mutable_data_type()); - return sf; +SerializableFunction AlwaysLeTextTtextLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } + return proto; } -LogicalFunctionRegistryReturnType -LogicalFunctionGeneratedRegistrar::RegisterAlwaysLeTextTtextLogicalFunction( - LogicalFunctionRegistryArguments arguments) { +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysLeTextTtextLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ PRECONDITION(arguments.children.size() == 3, - "AlwaysLeTextTtext expects 3 params, got {}", arguments.children.size()); - return AlwaysLeTextTtextLogicalFunction( - arguments.children[0], arguments.children[1], arguments.children[2]); + "AlwaysLeTextTtextLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return AlwaysLeTextTtextLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysLeTtextTextLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysLeTtextTextLogicalFunction.cpp index d2abaf2721..2250671e94 100644 --- a/nes-logical-operators/src/Functions/Meos/AlwaysLeTtextTextLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/AlwaysLeTtextTextLogicalFunction.cpp @@ -13,81 +13,116 @@ */ #include -#include -#include -#include -#include + #include +#include #include -#include -#include -#include #include +#include +#include +#include #include -#include -#include -#include -#include - -namespace NES { -AlwaysLeTtextTextLogicalFunction::AlwaysLeTtextTextLogicalFunction( - LogicalFunction value, LogicalFunction ref, LogicalFunction ts) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { - parameters = {std::move(value), std::move(ref), std::move(ts)}; +namespace NES +{ + +AlwaysLeTtextTextLogicalFunction::AlwaysLeTtextTextLogicalFunction(LogicalFunction value, + LogicalFunction ts, + LogicalFunction arg0) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(arg0)); } -DataType AlwaysLeTtextTextLogicalFunction::getDataType() const { return dataType; } +DataType AlwaysLeTtextTextLogicalFunction::getDataType() const +{ + return dataType; +} -LogicalFunction AlwaysLeTtextTextLogicalFunction::withDataType(const DataType& dt) const { - auto c = *this; c.dataType = dt; return c; +LogicalFunction AlwaysLeTtextTextLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector AlwaysLeTtextTextLogicalFunction::getChildren() const { return parameters; } +std::vector AlwaysLeTtextTextLogicalFunction::getChildren() const +{ + return parameters; +} -LogicalFunction AlwaysLeTtextTextLogicalFunction::withChildren(const std::vector& ch) const { - PRECONDITION(ch.size() == 3, "AlwaysLeTtextText expects 3 params, got {}", ch.size()); - auto c = *this; c.parameters = ch; return c; +LogicalFunction AlwaysLeTtextTextLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "AlwaysLeTtextTextLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view AlwaysLeTtextTextLogicalFunction::getType() const { return NAME; } +std::string_view AlwaysLeTtextTextLogicalFunction::getType() const +{ + return NAME; +} -bool AlwaysLeTtextTextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { - const auto* o = dynamic_cast(&rhs); - return o && parameters == o->parameters; +bool AlwaysLeTtextTextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } + return false; } -std::string AlwaysLeTtextTextLogicalFunction::explain(ExplainVerbosity v) const { - return fmt::format("AlwaysLeTtextText({}, {}, {})", - parameters[0].explain(v), parameters[1].explain(v), parameters[2].explain(v)); +std::string AlwaysLeTtextTextLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } -LogicalFunction AlwaysLeTtextTextLogicalFunction::withInferredDataType(const Schema& s) const { - std::vector ch; - ch.reserve(3); - for (auto& p : parameters) ch.push_back(p.withInferredDataType(s)); - auto isStr = [](const DataType& dt) { return dt.isType(DataType::Type::VARSIZED); }; - auto isTime = [](const DataType& dt) { return dt.isType(DataType::Type::UINT64); }; - INVARIANT(isStr(ch[0].getDataType()) && isStr(ch[1].getDataType()) && isTime(ch[2].getDataType()), - "AlwaysLeTtextText: expects (VARCHAR, VARCHAR, UINT64)"); - return withChildren(ch); +LogicalFunction AlwaysLeTtextTextLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } -SerializableFunction AlwaysLeTtextTextLogicalFunction::serialize() const { - SerializableFunction sf; - sf.set_function_type(std::string(NAME)); - for (auto& p : parameters) *sf.add_children() = p.serialize(); - DataTypeSerializationUtil::serializeDataType(dataType, sf.mutable_data_type()); - return sf; +SerializableFunction AlwaysLeTtextTextLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } + return proto; } -LogicalFunctionRegistryReturnType -LogicalFunctionGeneratedRegistrar::RegisterAlwaysLeTtextTextLogicalFunction( - LogicalFunctionRegistryArguments arguments) { +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysLeTtextTextLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ PRECONDITION(arguments.children.size() == 3, - "AlwaysLeTtextText expects 3 params, got {}", arguments.children.size()); - return AlwaysLeTtextTextLogicalFunction( - arguments.children[0], arguments.children[1], arguments.children[2]); + "AlwaysLeTtextTextLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return AlwaysLeTtextTextLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysLtBigintTbigintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysLtBigintTbigintLogicalFunction.cpp index 4d67ea2436..a79a3d1f23 100644 --- a/nes-logical-operators/src/Functions/Meos/AlwaysLtBigintTbigintLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/AlwaysLtBigintTbigintLogicalFunction.cpp @@ -26,46 +26,65 @@ namespace NES { -AlwaysLtBigintTbigintLogicalFunction::AlwaysLtBigintTbigintLogicalFunction(LogicalFunction value, - LogicalFunction threshold, - LogicalFunction ts) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +AlwaysLtBigintTbigintLogicalFunction::AlwaysLtBigintTbigintLogicalFunction(LogicalFunction arg0, + LogicalFunction value, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) { parameters.reserve(3); + parameters.push_back(std::move(arg0)); parameters.push_back(std::move(value)); - parameters.push_back(std::move(threshold)); parameters.push_back(std::move(ts)); } -DataType AlwaysLtBigintTbigintLogicalFunction::getDataType() const { return dataType; } +DataType AlwaysLtBigintTbigintLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction AlwaysLtBigintTbigintLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector AlwaysLtBigintTbigintLogicalFunction::getChildren() const { return parameters; } +std::vector AlwaysLtBigintTbigintLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction AlwaysLtBigintTbigintLogicalFunction::withChildren(const std::vector& children) const { PRECONDITION(children.size() == 3, "AlwaysLtBigintTbigintLogicalFunction requires 3 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view AlwaysLtBigintTbigintLogicalFunction::getType() const { return NAME; } +std::string_view AlwaysLtBigintTbigintLogicalFunction::getType() const +{ + return NAME; +} bool AlwaysLtBigintTbigintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string AlwaysLtBigintTbigintLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -76,7 +95,9 @@ LogicalFunction AlwaysLtBigintTbigintLogicalFunction::withInferredDataType(const std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -86,7 +107,9 @@ SerializableFunction AlwaysLtBigintTbigintLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysLtTbigintBigintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysLtTbigintBigintLogicalFunction.cpp index 404fab0558..394fc13f75 100644 --- a/nes-logical-operators/src/Functions/Meos/AlwaysLtTbigintBigintLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/AlwaysLtTbigintBigintLogicalFunction.cpp @@ -27,45 +27,64 @@ namespace NES { AlwaysLtTbigintBigintLogicalFunction::AlwaysLtTbigintBigintLogicalFunction(LogicalFunction value, - LogicalFunction threshold, - LogicalFunction ts) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) + LogicalFunction ts, + LogicalFunction arg0) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) { parameters.reserve(3); parameters.push_back(std::move(value)); - parameters.push_back(std::move(threshold)); parameters.push_back(std::move(ts)); + parameters.push_back(std::move(arg0)); } -DataType AlwaysLtTbigintBigintLogicalFunction::getDataType() const { return dataType; } +DataType AlwaysLtTbigintBigintLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction AlwaysLtTbigintBigintLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector AlwaysLtTbigintBigintLogicalFunction::getChildren() const { return parameters; } +std::vector AlwaysLtTbigintBigintLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction AlwaysLtTbigintBigintLogicalFunction::withChildren(const std::vector& children) const { PRECONDITION(children.size() == 3, "AlwaysLtTbigintBigintLogicalFunction requires 3 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view AlwaysLtTbigintBigintLogicalFunction::getType() const { return NAME; } +std::string_view AlwaysLtTbigintBigintLogicalFunction::getType() const +{ + return NAME; +} bool AlwaysLtTbigintBigintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string AlwaysLtTbigintBigintLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -76,7 +95,9 @@ LogicalFunction AlwaysLtTbigintBigintLogicalFunction::withInferredDataType(const std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -86,7 +107,9 @@ SerializableFunction AlwaysLtTbigintBigintLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysLtTextTtextLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysLtTextTtextLogicalFunction.cpp index edf0739950..820295de5e 100644 --- a/nes-logical-operators/src/Functions/Meos/AlwaysLtTextTtextLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/AlwaysLtTextTtextLogicalFunction.cpp @@ -13,81 +13,116 @@ */ #include -#include -#include -#include -#include + #include +#include #include -#include -#include -#include #include +#include +#include +#include #include -#include -#include -#include -#include - -namespace NES { -AlwaysLtTextTtextLogicalFunction::AlwaysLtTextTtextLogicalFunction( - LogicalFunction value, LogicalFunction ref, LogicalFunction ts) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { - parameters = {std::move(value), std::move(ref), std::move(ts)}; +namespace NES +{ + +AlwaysLtTextTtextLogicalFunction::AlwaysLtTextTtextLogicalFunction(LogicalFunction arg0, + LogicalFunction value, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(arg0)); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(ts)); } -DataType AlwaysLtTextTtextLogicalFunction::getDataType() const { return dataType; } +DataType AlwaysLtTextTtextLogicalFunction::getDataType() const +{ + return dataType; +} -LogicalFunction AlwaysLtTextTtextLogicalFunction::withDataType(const DataType& dt) const { - auto c = *this; c.dataType = dt; return c; +LogicalFunction AlwaysLtTextTtextLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector AlwaysLtTextTtextLogicalFunction::getChildren() const { return parameters; } +std::vector AlwaysLtTextTtextLogicalFunction::getChildren() const +{ + return parameters; +} -LogicalFunction AlwaysLtTextTtextLogicalFunction::withChildren(const std::vector& ch) const { - PRECONDITION(ch.size() == 3, "AlwaysLtTextTtext expects 3 params, got {}", ch.size()); - auto c = *this; c.parameters = ch; return c; +LogicalFunction AlwaysLtTextTtextLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "AlwaysLtTextTtextLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view AlwaysLtTextTtextLogicalFunction::getType() const { return NAME; } +std::string_view AlwaysLtTextTtextLogicalFunction::getType() const +{ + return NAME; +} -bool AlwaysLtTextTtextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { - const auto* o = dynamic_cast(&rhs); - return o && parameters == o->parameters; +bool AlwaysLtTextTtextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } + return false; } -std::string AlwaysLtTextTtextLogicalFunction::explain(ExplainVerbosity v) const { - return fmt::format("AlwaysLtTextTtext({}, {}, {})", - parameters[0].explain(v), parameters[1].explain(v), parameters[2].explain(v)); +std::string AlwaysLtTextTtextLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } -LogicalFunction AlwaysLtTextTtextLogicalFunction::withInferredDataType(const Schema& s) const { - std::vector ch; - ch.reserve(3); - for (auto& p : parameters) ch.push_back(p.withInferredDataType(s)); - auto isStr = [](const DataType& dt) { return dt.isType(DataType::Type::VARSIZED); }; - auto isTime = [](const DataType& dt) { return dt.isType(DataType::Type::UINT64); }; - INVARIANT(isStr(ch[0].getDataType()) && isStr(ch[1].getDataType()) && isTime(ch[2].getDataType()), - "AlwaysLtTextTtext: expects (VARCHAR, VARCHAR, UINT64)"); - return withChildren(ch); +LogicalFunction AlwaysLtTextTtextLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } -SerializableFunction AlwaysLtTextTtextLogicalFunction::serialize() const { - SerializableFunction sf; - sf.set_function_type(std::string(NAME)); - for (auto& p : parameters) *sf.add_children() = p.serialize(); - DataTypeSerializationUtil::serializeDataType(dataType, sf.mutable_data_type()); - return sf; +SerializableFunction AlwaysLtTextTtextLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } + return proto; } -LogicalFunctionRegistryReturnType -LogicalFunctionGeneratedRegistrar::RegisterAlwaysLtTextTtextLogicalFunction( - LogicalFunctionRegistryArguments arguments) { +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysLtTextTtextLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ PRECONDITION(arguments.children.size() == 3, - "AlwaysLtTextTtext expects 3 params, got {}", arguments.children.size()); - return AlwaysLtTextTtextLogicalFunction( - arguments.children[0], arguments.children[1], arguments.children[2]); + "AlwaysLtTextTtextLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return AlwaysLtTextTtextLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysLtTtextTextLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysLtTtextTextLogicalFunction.cpp index d9b3e39e33..bc0d552a89 100644 --- a/nes-logical-operators/src/Functions/Meos/AlwaysLtTtextTextLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/AlwaysLtTtextTextLogicalFunction.cpp @@ -13,81 +13,116 @@ */ #include -#include -#include -#include -#include + #include +#include #include -#include -#include -#include #include +#include +#include +#include #include -#include -#include -#include -#include - -namespace NES { -AlwaysLtTtextTextLogicalFunction::AlwaysLtTtextTextLogicalFunction( - LogicalFunction value, LogicalFunction ref, LogicalFunction ts) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { - parameters = {std::move(value), std::move(ref), std::move(ts)}; +namespace NES +{ + +AlwaysLtTtextTextLogicalFunction::AlwaysLtTtextTextLogicalFunction(LogicalFunction value, + LogicalFunction ts, + LogicalFunction arg0) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(arg0)); } -DataType AlwaysLtTtextTextLogicalFunction::getDataType() const { return dataType; } +DataType AlwaysLtTtextTextLogicalFunction::getDataType() const +{ + return dataType; +} -LogicalFunction AlwaysLtTtextTextLogicalFunction::withDataType(const DataType& dt) const { - auto c = *this; c.dataType = dt; return c; +LogicalFunction AlwaysLtTtextTextLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector AlwaysLtTtextTextLogicalFunction::getChildren() const { return parameters; } +std::vector AlwaysLtTtextTextLogicalFunction::getChildren() const +{ + return parameters; +} -LogicalFunction AlwaysLtTtextTextLogicalFunction::withChildren(const std::vector& ch) const { - PRECONDITION(ch.size() == 3, "AlwaysLtTtextText expects 3 params, got {}", ch.size()); - auto c = *this; c.parameters = ch; return c; +LogicalFunction AlwaysLtTtextTextLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "AlwaysLtTtextTextLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view AlwaysLtTtextTextLogicalFunction::getType() const { return NAME; } +std::string_view AlwaysLtTtextTextLogicalFunction::getType() const +{ + return NAME; +} -bool AlwaysLtTtextTextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { - const auto* o = dynamic_cast(&rhs); - return o && parameters == o->parameters; +bool AlwaysLtTtextTextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } + return false; } -std::string AlwaysLtTtextTextLogicalFunction::explain(ExplainVerbosity v) const { - return fmt::format("AlwaysLtTtextText({}, {}, {})", - parameters[0].explain(v), parameters[1].explain(v), parameters[2].explain(v)); +std::string AlwaysLtTtextTextLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } -LogicalFunction AlwaysLtTtextTextLogicalFunction::withInferredDataType(const Schema& s) const { - std::vector ch; - ch.reserve(3); - for (auto& p : parameters) ch.push_back(p.withInferredDataType(s)); - auto isStr = [](const DataType& dt) { return dt.isType(DataType::Type::VARSIZED); }; - auto isTime = [](const DataType& dt) { return dt.isType(DataType::Type::UINT64); }; - INVARIANT(isStr(ch[0].getDataType()) && isStr(ch[1].getDataType()) && isTime(ch[2].getDataType()), - "AlwaysLtTtextText: expects (VARCHAR, VARCHAR, UINT64)"); - return withChildren(ch); +LogicalFunction AlwaysLtTtextTextLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } -SerializableFunction AlwaysLtTtextTextLogicalFunction::serialize() const { - SerializableFunction sf; - sf.set_function_type(std::string(NAME)); - for (auto& p : parameters) *sf.add_children() = p.serialize(); - DataTypeSerializationUtil::serializeDataType(dataType, sf.mutable_data_type()); - return sf; +SerializableFunction AlwaysLtTtextTextLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } + return proto; } -LogicalFunctionRegistryReturnType -LogicalFunctionGeneratedRegistrar::RegisterAlwaysLtTtextTextLogicalFunction( - LogicalFunctionRegistryArguments arguments) { +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysLtTtextTextLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ PRECONDITION(arguments.children.size() == 3, - "AlwaysLtTtextText expects 3 params, got {}", arguments.children.size()); - return AlwaysLtTtextTextLogicalFunction( - arguments.children[0], arguments.children[1], arguments.children[2]); + "AlwaysLtTtextTextLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return AlwaysLtTtextTextLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysNeBigintTbigintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysNeBigintTbigintLogicalFunction.cpp index 69e726068e..c1ed787d86 100644 --- a/nes-logical-operators/src/Functions/Meos/AlwaysNeBigintTbigintLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/AlwaysNeBigintTbigintLogicalFunction.cpp @@ -26,46 +26,65 @@ namespace NES { -AlwaysNeBigintTbigintLogicalFunction::AlwaysNeBigintTbigintLogicalFunction(LogicalFunction value, - LogicalFunction threshold, - LogicalFunction ts) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +AlwaysNeBigintTbigintLogicalFunction::AlwaysNeBigintTbigintLogicalFunction(LogicalFunction arg0, + LogicalFunction value, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) { parameters.reserve(3); + parameters.push_back(std::move(arg0)); parameters.push_back(std::move(value)); - parameters.push_back(std::move(threshold)); parameters.push_back(std::move(ts)); } -DataType AlwaysNeBigintTbigintLogicalFunction::getDataType() const { return dataType; } +DataType AlwaysNeBigintTbigintLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction AlwaysNeBigintTbigintLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector AlwaysNeBigintTbigintLogicalFunction::getChildren() const { return parameters; } +std::vector AlwaysNeBigintTbigintLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction AlwaysNeBigintTbigintLogicalFunction::withChildren(const std::vector& children) const { PRECONDITION(children.size() == 3, "AlwaysNeBigintTbigintLogicalFunction requires 3 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view AlwaysNeBigintTbigintLogicalFunction::getType() const { return NAME; } +std::string_view AlwaysNeBigintTbigintLogicalFunction::getType() const +{ + return NAME; +} bool AlwaysNeBigintTbigintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string AlwaysNeBigintTbigintLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -76,7 +95,9 @@ LogicalFunction AlwaysNeBigintTbigintLogicalFunction::withInferredDataType(const std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -86,7 +107,9 @@ SerializableFunction AlwaysNeBigintTbigintLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysNeBoolTboolLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysNeBoolTboolLogicalFunction.cpp index 79d74af6b7..3047929016 100644 --- a/nes-logical-operators/src/Functions/Meos/AlwaysNeBoolTboolLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/AlwaysNeBoolTboolLogicalFunction.cpp @@ -26,46 +26,65 @@ namespace NES { -AlwaysNeBoolTboolLogicalFunction::AlwaysNeBoolTboolLogicalFunction(LogicalFunction value, - LogicalFunction threshold, - LogicalFunction ts) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +AlwaysNeBoolTboolLogicalFunction::AlwaysNeBoolTboolLogicalFunction(LogicalFunction arg0, + LogicalFunction value, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) { parameters.reserve(3); + parameters.push_back(std::move(arg0)); parameters.push_back(std::move(value)); - parameters.push_back(std::move(threshold)); parameters.push_back(std::move(ts)); } -DataType AlwaysNeBoolTboolLogicalFunction::getDataType() const { return dataType; } +DataType AlwaysNeBoolTboolLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction AlwaysNeBoolTboolLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector AlwaysNeBoolTboolLogicalFunction::getChildren() const { return parameters; } +std::vector AlwaysNeBoolTboolLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction AlwaysNeBoolTboolLogicalFunction::withChildren(const std::vector& children) const { PRECONDITION(children.size() == 3, "AlwaysNeBoolTboolLogicalFunction requires 3 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view AlwaysNeBoolTboolLogicalFunction::getType() const { return NAME; } +std::string_view AlwaysNeBoolTboolLogicalFunction::getType() const +{ + return NAME; +} bool AlwaysNeBoolTboolLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string AlwaysNeBoolTboolLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -76,7 +95,9 @@ LogicalFunction AlwaysNeBoolTboolLogicalFunction::withInferredDataType(const Sch std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -86,7 +107,9 @@ SerializableFunction AlwaysNeBoolTboolLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysNeNpointTnpointLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysNeNpointTnpointLogicalFunction.cpp index bc216bc4b0..3f3f85c6b7 100644 --- a/nes-logical-operators/src/Functions/Meos/AlwaysNeNpointTnpointLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/AlwaysNeNpointTnpointLogicalFunction.cpp @@ -26,59 +26,83 @@ namespace NES { -AlwaysNeNpointTnpointLogicalFunction::AlwaysNeNpointTnpointLogicalFunction(LogicalFunction rid_np, LogicalFunction pos_np, LogicalFunction rid_tp, LogicalFunction pos_tp, LogicalFunction ts) +AlwaysNeNpointTnpointLogicalFunction::AlwaysNeNpointTnpointLogicalFunction(LogicalFunction rid0, + LogicalFunction frac0, + LogicalFunction rid, + LogicalFunction frac, + LogicalFunction ts) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(5); - parameters.push_back(std::move(rid_np)); - parameters.push_back(std::move(pos_np)); - parameters.push_back(std::move(rid_tp)); - parameters.push_back(std::move(pos_tp)); + parameters.push_back(std::move(rid0)); + parameters.push_back(std::move(frac0)); + parameters.push_back(std::move(rid)); + parameters.push_back(std::move(frac)); parameters.push_back(std::move(ts)); } -DataType AlwaysNeNpointTnpointLogicalFunction::getDataType() const { return dataType; } +DataType AlwaysNeNpointTnpointLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction AlwaysNeNpointTnpointLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector AlwaysNeNpointTnpointLogicalFunction::getChildren() const { return parameters; } +std::vector AlwaysNeNpointTnpointLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction AlwaysNeNpointTnpointLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 5, - "AlwaysNeNpointTnpointLogicalFunction requires 5 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 5, "AlwaysNeNpointTnpointLogicalFunction requires 5 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view AlwaysNeNpointTnpointLogicalFunction::getType() const { return NAME; } +std::string_view AlwaysNeNpointTnpointLogicalFunction::getType() const +{ + return NAME; +} bool AlwaysNeNpointTnpointLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string AlwaysNeNpointTnpointLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction AlwaysNeNpointTnpointLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(5); - for (const auto& p : parameters) - c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "rid_np must be UINT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "pos_np must be FLOAT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "rid_tp must be UINT64"); - INVARIANT(c[3].getDataType().isType(DataType::Type::FLOAT64), "pos_tp must be FLOAT64"); - INVARIANT(c[4].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction AlwaysNeNpointTnpointLogicalFunction::serialize() const @@ -87,7 +111,9 @@ SerializableFunction AlwaysNeNpointTnpointLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -97,12 +123,12 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlw PRECONDITION(arguments.children.size() == 5, "AlwaysNeNpointTnpointLogicalFunction requires 5 children but got {}", arguments.children.size()); - return AlwaysNeNpointTnpointLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2]), - std::move(arguments.children[3]), - std::move(arguments.children[4])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + return AlwaysNeNpointTnpointLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysNePoseTposeLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysNePoseTposeLogicalFunction.cpp index 60c8744bdd..9434641a7c 100644 --- a/nes-logical-operators/src/Functions/Meos/AlwaysNePoseTposeLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/AlwaysNePoseTposeLogicalFunction.cpp @@ -26,63 +26,87 @@ namespace NES { -AlwaysNePoseTposeLogicalFunction::AlwaysNePoseTposeLogicalFunction(LogicalFunction x2, LogicalFunction y2, LogicalFunction theta2, LogicalFunction x, LogicalFunction y, LogicalFunction theta, LogicalFunction ts) +AlwaysNePoseTposeLogicalFunction::AlwaysNePoseTposeLogicalFunction(LogicalFunction px0, + LogicalFunction py0, + LogicalFunction ptheta0, + LogicalFunction x, + LogicalFunction y, + LogicalFunction theta, + LogicalFunction ts) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(7); - parameters.push_back(std::move(x2)); - parameters.push_back(std::move(y2)); - parameters.push_back(std::move(theta2)); + parameters.push_back(std::move(px0)); + parameters.push_back(std::move(py0)); + parameters.push_back(std::move(ptheta0)); parameters.push_back(std::move(x)); parameters.push_back(std::move(y)); parameters.push_back(std::move(theta)); parameters.push_back(std::move(ts)); } -DataType AlwaysNePoseTposeLogicalFunction::getDataType() const { return dataType; } +DataType AlwaysNePoseTposeLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction AlwaysNePoseTposeLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector AlwaysNePoseTposeLogicalFunction::getChildren() const { return parameters; } +std::vector AlwaysNePoseTposeLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction AlwaysNePoseTposeLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 7, - "AlwaysNePoseTposeLogicalFunction requires 7 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 7, "AlwaysNePoseTposeLogicalFunction requires 7 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view AlwaysNePoseTposeLogicalFunction::getType() const { return NAME; } +std::string_view AlwaysNePoseTposeLogicalFunction::getType() const +{ + return NAME; +} bool AlwaysNePoseTposeLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string AlwaysNePoseTposeLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction AlwaysNePoseTposeLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(7); - for (const auto& p : parameters) - c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "x2 must be FLOAT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "y2 must be FLOAT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "theta2 must be FLOAT64"); - INVARIANT(c[3].getDataType().isType(DataType::Type::FLOAT64), "x must be FLOAT64"); - INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "y must be FLOAT64"); - INVARIANT(c[5].getDataType().isType(DataType::Type::FLOAT64), "theta must be FLOAT64"); - INVARIANT(c[6].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction AlwaysNePoseTposeLogicalFunction::serialize() const @@ -91,7 +115,9 @@ SerializableFunction AlwaysNePoseTposeLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -101,14 +127,14 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlw PRECONDITION(arguments.children.size() == 7, "AlwaysNePoseTposeLogicalFunction requires 7 children but got {}", arguments.children.size()); - return AlwaysNePoseTposeLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2]), - std::move(arguments.children[3]), - std::move(arguments.children[4]), - std::move(arguments.children[5]), - std::move(arguments.children[6])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + auto arg5 = std::move(arguments.children[5]); + auto arg6 = std::move(arguments.children[6]); + return AlwaysNePoseTposeLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysNeTbigintBigintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysNeTbigintBigintLogicalFunction.cpp index f6ff33b4c6..66288b7065 100644 --- a/nes-logical-operators/src/Functions/Meos/AlwaysNeTbigintBigintLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/AlwaysNeTbigintBigintLogicalFunction.cpp @@ -27,45 +27,64 @@ namespace NES { AlwaysNeTbigintBigintLogicalFunction::AlwaysNeTbigintBigintLogicalFunction(LogicalFunction value, - LogicalFunction threshold, - LogicalFunction ts) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) + LogicalFunction ts, + LogicalFunction arg0) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) { parameters.reserve(3); parameters.push_back(std::move(value)); - parameters.push_back(std::move(threshold)); parameters.push_back(std::move(ts)); + parameters.push_back(std::move(arg0)); } -DataType AlwaysNeTbigintBigintLogicalFunction::getDataType() const { return dataType; } +DataType AlwaysNeTbigintBigintLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction AlwaysNeTbigintBigintLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector AlwaysNeTbigintBigintLogicalFunction::getChildren() const { return parameters; } +std::vector AlwaysNeTbigintBigintLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction AlwaysNeTbigintBigintLogicalFunction::withChildren(const std::vector& children) const { PRECONDITION(children.size() == 3, "AlwaysNeTbigintBigintLogicalFunction requires 3 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view AlwaysNeTbigintBigintLogicalFunction::getType() const { return NAME; } +std::string_view AlwaysNeTbigintBigintLogicalFunction::getType() const +{ + return NAME; +} bool AlwaysNeTbigintBigintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string AlwaysNeTbigintBigintLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -76,7 +95,9 @@ LogicalFunction AlwaysNeTbigintBigintLogicalFunction::withInferredDataType(const std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -86,7 +107,9 @@ SerializableFunction AlwaysNeTbigintBigintLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysNeTboolBoolLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysNeTboolBoolLogicalFunction.cpp index 3849ef5051..48c09191e0 100644 --- a/nes-logical-operators/src/Functions/Meos/AlwaysNeTboolBoolLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/AlwaysNeTboolBoolLogicalFunction.cpp @@ -27,45 +27,64 @@ namespace NES { AlwaysNeTboolBoolLogicalFunction::AlwaysNeTboolBoolLogicalFunction(LogicalFunction value, - LogicalFunction threshold, - LogicalFunction ts) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) + LogicalFunction ts, + LogicalFunction arg0) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) { parameters.reserve(3); parameters.push_back(std::move(value)); - parameters.push_back(std::move(threshold)); parameters.push_back(std::move(ts)); + parameters.push_back(std::move(arg0)); } -DataType AlwaysNeTboolBoolLogicalFunction::getDataType() const { return dataType; } +DataType AlwaysNeTboolBoolLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction AlwaysNeTboolBoolLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector AlwaysNeTboolBoolLogicalFunction::getChildren() const { return parameters; } +std::vector AlwaysNeTboolBoolLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction AlwaysNeTboolBoolLogicalFunction::withChildren(const std::vector& children) const { PRECONDITION(children.size() == 3, "AlwaysNeTboolBoolLogicalFunction requires 3 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view AlwaysNeTboolBoolLogicalFunction::getType() const { return NAME; } +std::string_view AlwaysNeTboolBoolLogicalFunction::getType() const +{ + return NAME; +} bool AlwaysNeTboolBoolLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string AlwaysNeTboolBoolLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -76,7 +95,9 @@ LogicalFunction AlwaysNeTboolBoolLogicalFunction::withInferredDataType(const Sch std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -86,7 +107,9 @@ SerializableFunction AlwaysNeTboolBoolLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysNeTcbufferTcbufferLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysNeTcbufferTcbufferLogicalFunction.cpp index 08b859b984..7ef37621f2 100644 --- a/nes-logical-operators/src/Functions/Meos/AlwaysNeTcbufferTcbufferLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/AlwaysNeTcbufferTcbufferLogicalFunction.cpp @@ -26,67 +26,89 @@ namespace NES { -AlwaysNeTcbufferTcbufferLogicalFunction::AlwaysNeTcbufferTcbufferLogicalFunction( - LogicalFunction lon1, LogicalFunction lat1, LogicalFunction r1, LogicalFunction ts1, - LogicalFunction lon2, LogicalFunction lat2, LogicalFunction r2, LogicalFunction ts2) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +AlwaysNeTcbufferTcbufferLogicalFunction::AlwaysNeTcbufferTcbufferLogicalFunction(LogicalFunction lonA, + LogicalFunction latA, + LogicalFunction radiusA, + LogicalFunction tsA, + LogicalFunction lonB, + LogicalFunction latB, + LogicalFunction radiusB, + LogicalFunction tsB) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) { parameters.reserve(8); - parameters.push_back(std::move(lon1)); - parameters.push_back(std::move(lat1)); - parameters.push_back(std::move(r1)); - parameters.push_back(std::move(ts1)); - parameters.push_back(std::move(lon2)); - parameters.push_back(std::move(lat2)); - parameters.push_back(std::move(r2)); - parameters.push_back(std::move(ts2)); + parameters.push_back(std::move(lonA)); + parameters.push_back(std::move(latA)); + parameters.push_back(std::move(radiusA)); + parameters.push_back(std::move(tsA)); + parameters.push_back(std::move(lonB)); + parameters.push_back(std::move(latB)); + parameters.push_back(std::move(radiusB)); + parameters.push_back(std::move(tsB)); } -DataType AlwaysNeTcbufferTcbufferLogicalFunction::getDataType() const { return dataType; } +DataType AlwaysNeTcbufferTcbufferLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction AlwaysNeTcbufferTcbufferLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector AlwaysNeTcbufferTcbufferLogicalFunction::getChildren() const { return parameters; } +std::vector AlwaysNeTcbufferTcbufferLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction AlwaysNeTcbufferTcbufferLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 8, - "AlwaysNeTcbufferTcbufferLogicalFunction requires 8 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 8, "AlwaysNeTcbufferTcbufferLogicalFunction requires 8 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view AlwaysNeTcbufferTcbufferLogicalFunction::getType() const { return NAME; } +std::string_view AlwaysNeTcbufferTcbufferLogicalFunction::getType() const +{ + return NAME; +} bool AlwaysNeTcbufferTcbufferLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string AlwaysNeTcbufferTcbufferLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction AlwaysNeTcbufferTcbufferLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(8); - for (const auto& p : parameters) - c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon1 must be FLOAT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat1 must be FLOAT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "r1 must be FLOAT64"); - INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); - INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "lon2 must be FLOAT64"); - INVARIANT(c[5].getDataType().isType(DataType::Type::FLOAT64), "lat2 must be FLOAT64"); - INVARIANT(c[6].getDataType().isType(DataType::Type::FLOAT64), "r2 must be FLOAT64"); - INVARIANT(c[7].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction AlwaysNeTcbufferTcbufferLogicalFunction::serialize() const @@ -95,7 +117,9 @@ SerializableFunction AlwaysNeTcbufferTcbufferLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -105,14 +129,15 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlw PRECONDITION(arguments.children.size() == 8, "AlwaysNeTcbufferTcbufferLogicalFunction requires 8 children but got {}", arguments.children.size()); - return AlwaysNeTcbufferTcbufferLogicalFunction(std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2]), - std::move(arguments.children[3]), - std::move(arguments.children[4]), - std::move(arguments.children[5]), - std::move(arguments.children[6]), - std::move(arguments.children[7])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + auto arg5 = std::move(arguments.children[5]); + auto arg6 = std::move(arguments.children[6]); + auto arg7 = std::move(arguments.children[7]); + return AlwaysNeTcbufferTcbufferLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6), std::move(arg7)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysNeTextTtextLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysNeTextTtextLogicalFunction.cpp index ae8f1344c2..9db020d0d3 100644 --- a/nes-logical-operators/src/Functions/Meos/AlwaysNeTextTtextLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/AlwaysNeTextTtextLogicalFunction.cpp @@ -13,81 +13,116 @@ */ #include -#include -#include -#include -#include + #include +#include #include -#include -#include -#include #include +#include +#include +#include #include -#include -#include -#include -#include - -namespace NES { -AlwaysNeTextTtextLogicalFunction::AlwaysNeTextTtextLogicalFunction( - LogicalFunction value, LogicalFunction ref, LogicalFunction ts) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { - parameters = {std::move(value), std::move(ref), std::move(ts)}; +namespace NES +{ + +AlwaysNeTextTtextLogicalFunction::AlwaysNeTextTtextLogicalFunction(LogicalFunction arg0, + LogicalFunction value, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(arg0)); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(ts)); } -DataType AlwaysNeTextTtextLogicalFunction::getDataType() const { return dataType; } +DataType AlwaysNeTextTtextLogicalFunction::getDataType() const +{ + return dataType; +} -LogicalFunction AlwaysNeTextTtextLogicalFunction::withDataType(const DataType& dt) const { - auto c = *this; c.dataType = dt; return c; +LogicalFunction AlwaysNeTextTtextLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector AlwaysNeTextTtextLogicalFunction::getChildren() const { return parameters; } +std::vector AlwaysNeTextTtextLogicalFunction::getChildren() const +{ + return parameters; +} -LogicalFunction AlwaysNeTextTtextLogicalFunction::withChildren(const std::vector& ch) const { - PRECONDITION(ch.size() == 3, "AlwaysNeTextTtext expects 3 params, got {}", ch.size()); - auto c = *this; c.parameters = ch; return c; +LogicalFunction AlwaysNeTextTtextLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "AlwaysNeTextTtextLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view AlwaysNeTextTtextLogicalFunction::getType() const { return NAME; } +std::string_view AlwaysNeTextTtextLogicalFunction::getType() const +{ + return NAME; +} -bool AlwaysNeTextTtextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { - const auto* o = dynamic_cast(&rhs); - return o && parameters == o->parameters; +bool AlwaysNeTextTtextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } + return false; } -std::string AlwaysNeTextTtextLogicalFunction::explain(ExplainVerbosity v) const { - return fmt::format("AlwaysNeTextTtext({}, {}, {})", - parameters[0].explain(v), parameters[1].explain(v), parameters[2].explain(v)); +std::string AlwaysNeTextTtextLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } -LogicalFunction AlwaysNeTextTtextLogicalFunction::withInferredDataType(const Schema& s) const { - std::vector ch; - ch.reserve(3); - for (auto& p : parameters) ch.push_back(p.withInferredDataType(s)); - auto isStr = [](const DataType& dt) { return dt.isType(DataType::Type::VARSIZED); }; - auto isTime = [](const DataType& dt) { return dt.isType(DataType::Type::UINT64); }; - INVARIANT(isStr(ch[0].getDataType()) && isStr(ch[1].getDataType()) && isTime(ch[2].getDataType()), - "AlwaysNeTextTtext: expects (VARCHAR, VARCHAR, UINT64)"); - return withChildren(ch); +LogicalFunction AlwaysNeTextTtextLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } -SerializableFunction AlwaysNeTextTtextLogicalFunction::serialize() const { - SerializableFunction sf; - sf.set_function_type(std::string(NAME)); - for (auto& p : parameters) *sf.add_children() = p.serialize(); - DataTypeSerializationUtil::serializeDataType(dataType, sf.mutable_data_type()); - return sf; +SerializableFunction AlwaysNeTextTtextLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } + return proto; } -LogicalFunctionRegistryReturnType -LogicalFunctionGeneratedRegistrar::RegisterAlwaysNeTextTtextLogicalFunction( - LogicalFunctionRegistryArguments arguments) { +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysNeTextTtextLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ PRECONDITION(arguments.children.size() == 3, - "AlwaysNeTextTtext expects 3 params, got {}", arguments.children.size()); - return AlwaysNeTextTtextLogicalFunction( - arguments.children[0], arguments.children[1], arguments.children[2]); + "AlwaysNeTextTtextLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return AlwaysNeTextTtextLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysNeTgeoGeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysNeTgeoGeoLogicalFunction.cpp index e31d26ac03..0293265041 100644 --- a/nes-logical-operators/src/Functions/Meos/AlwaysNeTgeoGeoLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/AlwaysNeTgeoGeoLogicalFunction.cpp @@ -26,60 +26,81 @@ namespace NES { -AlwaysNeTgeoGeoLogicalFunction::AlwaysNeTgeoGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, - LogicalFunction ts, LogicalFunction wkt) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +AlwaysNeTgeoGeoLogicalFunction::AlwaysNeTgeoGeoLogicalFunction(LogicalFunction lon, + LogicalFunction lat, + LogicalFunction timestamp, + LogicalFunction geometry) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) { parameters.reserve(4); parameters.push_back(std::move(lon)); parameters.push_back(std::move(lat)); - parameters.push_back(std::move(ts)); - parameters.push_back(std::move(wkt)); + parameters.push_back(std::move(timestamp)); + parameters.push_back(std::move(geometry)); } -DataType AlwaysNeTgeoGeoLogicalFunction::getDataType() const { return dataType; } +DataType AlwaysNeTgeoGeoLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction AlwaysNeTgeoGeoLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector AlwaysNeTgeoGeoLogicalFunction::getChildren() const { return parameters; } +std::vector AlwaysNeTgeoGeoLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction AlwaysNeTgeoGeoLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 4, - "AlwaysNeTgeoGeoLogicalFunction requires 4 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 4, "AlwaysNeTgeoGeoLogicalFunction requires 4 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view AlwaysNeTgeoGeoLogicalFunction::getType() const { return NAME; } +std::string_view AlwaysNeTgeoGeoLogicalFunction::getType() const +{ + return NAME; +} bool AlwaysNeTgeoGeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string AlwaysNeTgeoGeoLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction AlwaysNeTgeoGeoLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(4); - c.emplace_back(parameters[0].withInferredDataType(schema)); - c.emplace_back(parameters[1].withInferredDataType(schema)); - c.emplace_back(parameters[2].withInferredDataType(schema)); - c.emplace_back(parameters[3].withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon must be FLOAT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat must be FLOAT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); - INVARIANT(c[3].getDataType().isType(DataType::Type::VARSIZED),"wkt must be VARSIZED"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction AlwaysNeTgeoGeoLogicalFunction::serialize() const @@ -88,7 +109,9 @@ SerializableFunction AlwaysNeTgeoGeoLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -98,10 +121,11 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlw PRECONDITION(arguments.children.size() == 4, "AlwaysNeTgeoGeoLogicalFunction requires 4 children but got {}", arguments.children.size()); - return AlwaysNeTgeoGeoLogicalFunction(std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2]), - std::move(arguments.children[3])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + return AlwaysNeTgeoGeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysNeTgeoTgeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysNeTgeoTgeoLogicalFunction.cpp index 4f4f13589e..829b58a41c 100644 --- a/nes-logical-operators/src/Functions/Meos/AlwaysNeTgeoTgeoLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/AlwaysNeTgeoTgeoLogicalFunction.cpp @@ -26,61 +26,85 @@ namespace NES { -AlwaysNeTgeoTgeoLogicalFunction::AlwaysNeTgeoTgeoLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction ts1, LogicalFunction lon2, LogicalFunction lat2, LogicalFunction ts2) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +AlwaysNeTgeoTgeoLogicalFunction::AlwaysNeTgeoTgeoLogicalFunction(LogicalFunction lonA, + LogicalFunction latA, + LogicalFunction tsA, + LogicalFunction lonB, + LogicalFunction latB, + LogicalFunction tsB) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) { parameters.reserve(6); - parameters.push_back(std::move(lon1)); - parameters.push_back(std::move(lat1)); - parameters.push_back(std::move(ts1)); - parameters.push_back(std::move(lon2)); - parameters.push_back(std::move(lat2)); - parameters.push_back(std::move(ts2)); + parameters.push_back(std::move(lonA)); + parameters.push_back(std::move(latA)); + parameters.push_back(std::move(tsA)); + parameters.push_back(std::move(lonB)); + parameters.push_back(std::move(latB)); + parameters.push_back(std::move(tsB)); } -DataType AlwaysNeTgeoTgeoLogicalFunction::getDataType() const { return dataType; } +DataType AlwaysNeTgeoTgeoLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction AlwaysNeTgeoTgeoLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector AlwaysNeTgeoTgeoLogicalFunction::getChildren() const { return parameters; } +std::vector AlwaysNeTgeoTgeoLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction AlwaysNeTgeoTgeoLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 6, - "AlwaysNeTgeoTgeoLogicalFunction requires 6 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 6, "AlwaysNeTgeoTgeoLogicalFunction requires 6 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view AlwaysNeTgeoTgeoLogicalFunction::getType() const { return NAME; } +std::string_view AlwaysNeTgeoTgeoLogicalFunction::getType() const +{ + return NAME; +} bool AlwaysNeTgeoTgeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string AlwaysNeTgeoTgeoLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction AlwaysNeTgeoTgeoLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(6); - for (const auto& p : parameters) - c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon1 must be FLOAT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat1 must be FLOAT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); - INVARIANT(c[3].getDataType().isType(DataType::Type::FLOAT64), "lon2 must be FLOAT64"); - INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "lat2 must be FLOAT64"); - INVARIANT(c[5].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction AlwaysNeTgeoTgeoLogicalFunction::serialize() const @@ -89,7 +113,9 @@ SerializableFunction AlwaysNeTgeoTgeoLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -99,13 +125,13 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlw PRECONDITION(arguments.children.size() == 6, "AlwaysNeTgeoTgeoLogicalFunction requires 6 children but got {}", arguments.children.size()); - return AlwaysNeTgeoTgeoLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2]), - std::move(arguments.children[3]), - std::move(arguments.children[4]), - std::move(arguments.children[5])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + auto arg5 = std::move(arguments.children[5]); + return AlwaysNeTgeoTgeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysNeTh3indexH3indexLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysNeTh3indexH3indexLogicalFunction.cpp index 0ad2ea86d5..6fdf166bdb 100644 --- a/nes-logical-operators/src/Functions/Meos/AlwaysNeTh3indexH3indexLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/AlwaysNeTh3indexH3indexLogicalFunction.cpp @@ -26,57 +26,79 @@ namespace NES { -AlwaysNeTh3indexH3indexLogicalFunction::AlwaysNeTh3indexH3indexLogicalFunction(LogicalFunction cell, LogicalFunction ts, - LogicalFunction target) +AlwaysNeTh3indexH3indexLogicalFunction::AlwaysNeTh3indexH3indexLogicalFunction(LogicalFunction cell, + LogicalFunction ts, + LogicalFunction arg0) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(3); parameters.push_back(std::move(cell)); parameters.push_back(std::move(ts)); - parameters.push_back(std::move(target)); + parameters.push_back(std::move(arg0)); } -DataType AlwaysNeTh3indexH3indexLogicalFunction::getDataType() const { return dataType; } +DataType AlwaysNeTh3indexH3indexLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction AlwaysNeTh3indexH3indexLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector AlwaysNeTh3indexH3indexLogicalFunction::getChildren() const { return parameters; } +std::vector AlwaysNeTh3indexH3indexLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction AlwaysNeTh3indexH3indexLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 3, - "AlwaysNeTh3indexH3indexLogicalFunction requires 3 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 3, "AlwaysNeTh3indexH3indexLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view AlwaysNeTh3indexH3indexLogicalFunction::getType() const { return NAME; } +std::string_view AlwaysNeTh3indexH3indexLogicalFunction::getType() const +{ + return NAME; +} bool AlwaysNeTh3indexH3indexLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string AlwaysNeTh3indexH3indexLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction AlwaysNeTh3indexH3indexLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(3); - c.emplace_back(parameters[0].withInferredDataType(schema)); - c.emplace_back(parameters[1].withInferredDataType(schema)); - c.emplace_back(parameters[2].withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "cell must be UINT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "target must be UINT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction AlwaysNeTh3indexH3indexLogicalFunction::serialize() const @@ -85,7 +107,9 @@ SerializableFunction AlwaysNeTh3indexH3indexLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -95,9 +119,10 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlw PRECONDITION(arguments.children.size() == 3, "AlwaysNeTh3indexH3indexLogicalFunction requires 3 children but got {}", arguments.children.size()); - return AlwaysNeTh3indexH3indexLogicalFunction(std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return AlwaysNeTh3indexH3indexLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysNeTjsonbJsonbLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysNeTjsonbJsonbLogicalFunction.cpp index 7d06e82ecc..41d5894d68 100644 --- a/nes-logical-operators/src/Functions/Meos/AlwaysNeTjsonbJsonbLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/AlwaysNeTjsonbJsonbLogicalFunction.cpp @@ -26,55 +26,79 @@ namespace NES { -AlwaysNeTjsonbJsonbLogicalFunction::AlwaysNeTjsonbJsonbLogicalFunction(LogicalFunction json_str, LogicalFunction ts, LogicalFunction target_json) +AlwaysNeTjsonbJsonbLogicalFunction::AlwaysNeTjsonbJsonbLogicalFunction(LogicalFunction json_str, + LogicalFunction ts, + LogicalFunction arg0) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(3); parameters.push_back(std::move(json_str)); parameters.push_back(std::move(ts)); - parameters.push_back(std::move(target_json)); + parameters.push_back(std::move(arg0)); } -DataType AlwaysNeTjsonbJsonbLogicalFunction::getDataType() const { return dataType; } +DataType AlwaysNeTjsonbJsonbLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction AlwaysNeTjsonbJsonbLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector AlwaysNeTjsonbJsonbLogicalFunction::getChildren() const { return parameters; } +std::vector AlwaysNeTjsonbJsonbLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction AlwaysNeTjsonbJsonbLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 3, - "AlwaysNeTjsonbJsonbLogicalFunction requires 3 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 3, "AlwaysNeTjsonbJsonbLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view AlwaysNeTjsonbJsonbLogicalFunction::getType() const { return NAME; } +std::string_view AlwaysNeTjsonbJsonbLogicalFunction::getType() const +{ + return NAME; +} bool AlwaysNeTjsonbJsonbLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string AlwaysNeTjsonbJsonbLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction AlwaysNeTjsonbJsonbLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(3); - for (const auto& p : parameters) - c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "json_str must be VARSIZED"); - INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::VARSIZED), "target_json must be VARSIZED"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction AlwaysNeTjsonbJsonbLogicalFunction::serialize() const @@ -83,7 +107,9 @@ SerializableFunction AlwaysNeTjsonbJsonbLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -93,10 +119,10 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlw PRECONDITION(arguments.children.size() == 3, "AlwaysNeTjsonbJsonbLogicalFunction requires 3 children but got {}", arguments.children.size()); - return AlwaysNeTjsonbJsonbLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return AlwaysNeTjsonbJsonbLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysNeTjsonbTjsonbLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysNeTjsonbTjsonbLogicalFunction.cpp index 337ad23193..557d2334b3 100644 --- a/nes-logical-operators/src/Functions/Meos/AlwaysNeTjsonbTjsonbLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/AlwaysNeTjsonbTjsonbLogicalFunction.cpp @@ -26,57 +26,81 @@ namespace NES { -AlwaysNeTjsonbTjsonbLogicalFunction::AlwaysNeTjsonbTjsonbLogicalFunction(LogicalFunction json1, LogicalFunction ts1, LogicalFunction json2, LogicalFunction ts2) +AlwaysNeTjsonbTjsonbLogicalFunction::AlwaysNeTjsonbTjsonbLogicalFunction(LogicalFunction json_str, + LogicalFunction ts, + LogicalFunction json0, + LogicalFunction ts0) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(4); - parameters.push_back(std::move(json1)); - parameters.push_back(std::move(ts1)); - parameters.push_back(std::move(json2)); - parameters.push_back(std::move(ts2)); + parameters.push_back(std::move(json_str)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(json0)); + parameters.push_back(std::move(ts0)); } -DataType AlwaysNeTjsonbTjsonbLogicalFunction::getDataType() const { return dataType; } +DataType AlwaysNeTjsonbTjsonbLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction AlwaysNeTjsonbTjsonbLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector AlwaysNeTjsonbTjsonbLogicalFunction::getChildren() const { return parameters; } +std::vector AlwaysNeTjsonbTjsonbLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction AlwaysNeTjsonbTjsonbLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 4, - "AlwaysNeTjsonbTjsonbLogicalFunction requires 4 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 4, "AlwaysNeTjsonbTjsonbLogicalFunction requires 4 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view AlwaysNeTjsonbTjsonbLogicalFunction::getType() const { return NAME; } +std::string_view AlwaysNeTjsonbTjsonbLogicalFunction::getType() const +{ + return NAME; +} bool AlwaysNeTjsonbTjsonbLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string AlwaysNeTjsonbTjsonbLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction AlwaysNeTjsonbTjsonbLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(4); - for (const auto& p : parameters) - c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "json1 must be VARSIZED"); - INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::VARSIZED), "json2 must be VARSIZED"); - INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction AlwaysNeTjsonbTjsonbLogicalFunction::serialize() const @@ -85,7 +109,9 @@ SerializableFunction AlwaysNeTjsonbTjsonbLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -95,11 +121,11 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlw PRECONDITION(arguments.children.size() == 4, "AlwaysNeTjsonbTjsonbLogicalFunction requires 4 children but got {}", arguments.children.size()); - return AlwaysNeTjsonbTjsonbLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2]), - std::move(arguments.children[3])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + return AlwaysNeTjsonbTjsonbLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysNeTnpointNpointLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysNeTnpointNpointLogicalFunction.cpp index e6271da03e..390c2a89a0 100644 --- a/nes-logical-operators/src/Functions/Meos/AlwaysNeTnpointNpointLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/AlwaysNeTnpointNpointLogicalFunction.cpp @@ -26,59 +26,83 @@ namespace NES { -AlwaysNeTnpointNpointLogicalFunction::AlwaysNeTnpointNpointLogicalFunction(LogicalFunction rid1, LogicalFunction pos1, LogicalFunction ts, LogicalFunction rid2, LogicalFunction pos2) +AlwaysNeTnpointNpointLogicalFunction::AlwaysNeTnpointNpointLogicalFunction(LogicalFunction rid, + LogicalFunction frac, + LogicalFunction ts, + LogicalFunction rid0, + LogicalFunction frac0) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(5); - parameters.push_back(std::move(rid1)); - parameters.push_back(std::move(pos1)); + parameters.push_back(std::move(rid)); + parameters.push_back(std::move(frac)); parameters.push_back(std::move(ts)); - parameters.push_back(std::move(rid2)); - parameters.push_back(std::move(pos2)); + parameters.push_back(std::move(rid0)); + parameters.push_back(std::move(frac0)); } -DataType AlwaysNeTnpointNpointLogicalFunction::getDataType() const { return dataType; } +DataType AlwaysNeTnpointNpointLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction AlwaysNeTnpointNpointLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector AlwaysNeTnpointNpointLogicalFunction::getChildren() const { return parameters; } +std::vector AlwaysNeTnpointNpointLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction AlwaysNeTnpointNpointLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 5, - "AlwaysNeTnpointNpointLogicalFunction requires 5 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 5, "AlwaysNeTnpointNpointLogicalFunction requires 5 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view AlwaysNeTnpointNpointLogicalFunction::getType() const { return NAME; } +std::string_view AlwaysNeTnpointNpointLogicalFunction::getType() const +{ + return NAME; +} bool AlwaysNeTnpointNpointLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string AlwaysNeTnpointNpointLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction AlwaysNeTnpointNpointLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(5); - for (const auto& p : parameters) - c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "rid1 must be UINT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "pos1 must be FLOAT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); - INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "rid2 must be UINT64"); - INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "pos2 must be FLOAT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction AlwaysNeTnpointNpointLogicalFunction::serialize() const @@ -87,7 +111,9 @@ SerializableFunction AlwaysNeTnpointNpointLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -97,12 +123,12 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlw PRECONDITION(arguments.children.size() == 5, "AlwaysNeTnpointNpointLogicalFunction requires 5 children but got {}", arguments.children.size()); - return AlwaysNeTnpointNpointLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2]), - std::move(arguments.children[3]), - std::move(arguments.children[4])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + return AlwaysNeTnpointNpointLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysNeTnpointTnpointLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysNeTnpointTnpointLogicalFunction.cpp index 0691b0129c..8b01f20f92 100644 --- a/nes-logical-operators/src/Functions/Meos/AlwaysNeTnpointTnpointLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/AlwaysNeTnpointTnpointLogicalFunction.cpp @@ -26,63 +26,85 @@ namespace NES { -AlwaysNeTnpointTnpointLogicalFunction::AlwaysNeTnpointTnpointLogicalFunction( - LogicalFunction rid1, LogicalFunction pos1, LogicalFunction ts1, - LogicalFunction rid2, LogicalFunction pos2, LogicalFunction ts2) +AlwaysNeTnpointTnpointLogicalFunction::AlwaysNeTnpointTnpointLogicalFunction(LogicalFunction rid, + LogicalFunction frac, + LogicalFunction ts, + LogicalFunction rid0, + LogicalFunction frac0, + LogicalFunction ts0) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(6); - parameters.push_back(std::move(rid1)); - parameters.push_back(std::move(pos1)); - parameters.push_back(std::move(ts1)); - parameters.push_back(std::move(rid2)); - parameters.push_back(std::move(pos2)); - parameters.push_back(std::move(ts2)); + parameters.push_back(std::move(rid)); + parameters.push_back(std::move(frac)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(rid0)); + parameters.push_back(std::move(frac0)); + parameters.push_back(std::move(ts0)); } -DataType AlwaysNeTnpointTnpointLogicalFunction::getDataType() const { return dataType; } +DataType AlwaysNeTnpointTnpointLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction AlwaysNeTnpointTnpointLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector AlwaysNeTnpointTnpointLogicalFunction::getChildren() const { return parameters; } +std::vector AlwaysNeTnpointTnpointLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction AlwaysNeTnpointTnpointLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 6, - "AlwaysNeTnpointTnpointLogicalFunction requires 6 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 6, "AlwaysNeTnpointTnpointLogicalFunction requires 6 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view AlwaysNeTnpointTnpointLogicalFunction::getType() const { return NAME; } +std::string_view AlwaysNeTnpointTnpointLogicalFunction::getType() const +{ + return NAME; +} bool AlwaysNeTnpointTnpointLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string AlwaysNeTnpointTnpointLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction AlwaysNeTnpointTnpointLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(6); - for (const auto& p : parameters) - c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "rid1 must be UINT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "pos1 must be FLOAT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); - INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "rid2 must be UINT64"); - INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "pos2 must be FLOAT64"); - INVARIANT(c[5].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction AlwaysNeTnpointTnpointLogicalFunction::serialize() const @@ -91,7 +113,9 @@ SerializableFunction AlwaysNeTnpointTnpointLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -101,12 +125,13 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlw PRECONDITION(arguments.children.size() == 6, "AlwaysNeTnpointTnpointLogicalFunction requires 6 children but got {}", arguments.children.size()); - return AlwaysNeTnpointTnpointLogicalFunction(std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2]), - std::move(arguments.children[3]), - std::move(arguments.children[4]), - std::move(arguments.children[5])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + auto arg5 = std::move(arguments.children[5]); + return AlwaysNeTnpointTnpointLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysNeTposePoseLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysNeTposePoseLogicalFunction.cpp index c4a6e0ed28..447da2fcbe 100644 --- a/nes-logical-operators/src/Functions/Meos/AlwaysNeTposePoseLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/AlwaysNeTposePoseLogicalFunction.cpp @@ -26,7 +26,13 @@ namespace NES { -AlwaysNeTposePoseLogicalFunction::AlwaysNeTposePoseLogicalFunction(LogicalFunction x, LogicalFunction y, LogicalFunction theta, LogicalFunction ts, LogicalFunction x2, LogicalFunction y2, LogicalFunction theta2) +AlwaysNeTposePoseLogicalFunction::AlwaysNeTposePoseLogicalFunction(LogicalFunction x, + LogicalFunction y, + LogicalFunction theta, + LogicalFunction ts, + LogicalFunction px0, + LogicalFunction py0, + LogicalFunction ptheta0) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(7); @@ -34,55 +40,73 @@ AlwaysNeTposePoseLogicalFunction::AlwaysNeTposePoseLogicalFunction(LogicalFuncti parameters.push_back(std::move(y)); parameters.push_back(std::move(theta)); parameters.push_back(std::move(ts)); - parameters.push_back(std::move(x2)); - parameters.push_back(std::move(y2)); - parameters.push_back(std::move(theta2)); + parameters.push_back(std::move(px0)); + parameters.push_back(std::move(py0)); + parameters.push_back(std::move(ptheta0)); } -DataType AlwaysNeTposePoseLogicalFunction::getDataType() const { return dataType; } +DataType AlwaysNeTposePoseLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction AlwaysNeTposePoseLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector AlwaysNeTposePoseLogicalFunction::getChildren() const { return parameters; } +std::vector AlwaysNeTposePoseLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction AlwaysNeTposePoseLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 7, - "AlwaysNeTposePoseLogicalFunction requires 7 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 7, "AlwaysNeTposePoseLogicalFunction requires 7 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view AlwaysNeTposePoseLogicalFunction::getType() const { return NAME; } +std::string_view AlwaysNeTposePoseLogicalFunction::getType() const +{ + return NAME; +} bool AlwaysNeTposePoseLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string AlwaysNeTposePoseLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction AlwaysNeTposePoseLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(7); - for (const auto& p : parameters) - c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "x must be FLOAT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "y must be FLOAT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "theta must be FLOAT64"); - INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); - INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "x2 must be FLOAT64"); - INVARIANT(c[5].getDataType().isType(DataType::Type::FLOAT64), "y2 must be FLOAT64"); - INVARIANT(c[6].getDataType().isType(DataType::Type::FLOAT64), "theta2 must be FLOAT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction AlwaysNeTposePoseLogicalFunction::serialize() const @@ -91,7 +115,9 @@ SerializableFunction AlwaysNeTposePoseLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -101,14 +127,14 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlw PRECONDITION(arguments.children.size() == 7, "AlwaysNeTposePoseLogicalFunction requires 7 children but got {}", arguments.children.size()); - return AlwaysNeTposePoseLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2]), - std::move(arguments.children[3]), - std::move(arguments.children[4]), - std::move(arguments.children[5]), - std::move(arguments.children[6])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + auto arg5 = std::move(arguments.children[5]); + auto arg6 = std::move(arguments.children[6]); + return AlwaysNeTposePoseLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysNeTposeTposeLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysNeTposeTposeLogicalFunction.cpp index 8990844640..b70d438a5a 100644 --- a/nes-logical-operators/src/Functions/Meos/AlwaysNeTposeTposeLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/AlwaysNeTposeTposeLogicalFunction.cpp @@ -26,67 +26,89 @@ namespace NES { -AlwaysNeTposeTposeLogicalFunction::AlwaysNeTposeTposeLogicalFunction( - LogicalFunction x1, LogicalFunction y1, LogicalFunction theta1, LogicalFunction ts1, - LogicalFunction x2, LogicalFunction y2, LogicalFunction theta2, LogicalFunction ts2) +AlwaysNeTposeTposeLogicalFunction::AlwaysNeTposeTposeLogicalFunction(LogicalFunction x, + LogicalFunction y, + LogicalFunction theta, + LogicalFunction ts, + LogicalFunction px0, + LogicalFunction py0, + LogicalFunction ptheta0, + LogicalFunction ts0) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(8); - parameters.push_back(std::move(x1)); - parameters.push_back(std::move(y1)); - parameters.push_back(std::move(theta1)); - parameters.push_back(std::move(ts1)); - parameters.push_back(std::move(x2)); - parameters.push_back(std::move(y2)); - parameters.push_back(std::move(theta2)); - parameters.push_back(std::move(ts2)); + parameters.push_back(std::move(x)); + parameters.push_back(std::move(y)); + parameters.push_back(std::move(theta)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(px0)); + parameters.push_back(std::move(py0)); + parameters.push_back(std::move(ptheta0)); + parameters.push_back(std::move(ts0)); } -DataType AlwaysNeTposeTposeLogicalFunction::getDataType() const { return dataType; } +DataType AlwaysNeTposeTposeLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction AlwaysNeTposeTposeLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector AlwaysNeTposeTposeLogicalFunction::getChildren() const { return parameters; } +std::vector AlwaysNeTposeTposeLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction AlwaysNeTposeTposeLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 8, - "AlwaysNeTposeTposeLogicalFunction requires 8 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 8, "AlwaysNeTposeTposeLogicalFunction requires 8 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view AlwaysNeTposeTposeLogicalFunction::getType() const { return NAME; } +std::string_view AlwaysNeTposeTposeLogicalFunction::getType() const +{ + return NAME; +} bool AlwaysNeTposeTposeLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string AlwaysNeTposeTposeLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction AlwaysNeTposeTposeLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(8); - for (const auto& p : parameters) - c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "x1 must be FLOAT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "y1 must be FLOAT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "theta1 must be FLOAT64"); - INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); - INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "x2 must be FLOAT64"); - INVARIANT(c[5].getDataType().isType(DataType::Type::FLOAT64), "y2 must be FLOAT64"); - INVARIANT(c[6].getDataType().isType(DataType::Type::FLOAT64), "theta2 must be FLOAT64"); - INVARIANT(c[7].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction AlwaysNeTposeTposeLogicalFunction::serialize() const @@ -95,7 +117,9 @@ SerializableFunction AlwaysNeTposeTposeLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -105,14 +129,15 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlw PRECONDITION(arguments.children.size() == 8, "AlwaysNeTposeTposeLogicalFunction requires 8 children but got {}", arguments.children.size()); - return AlwaysNeTposeTposeLogicalFunction(std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2]), - std::move(arguments.children[3]), - std::move(arguments.children[4]), - std::move(arguments.children[5]), - std::move(arguments.children[6]), - std::move(arguments.children[7])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + auto arg5 = std::move(arguments.children[5]); + auto arg6 = std::move(arguments.children[6]); + auto arg7 = std::move(arguments.children[7]); + return AlwaysNeTposeTposeLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6), std::move(arg7)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysNeTquadbinQuadbinLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysNeTquadbinQuadbinLogicalFunction.cpp index d21c18bd8e..ea6b1097c3 100644 --- a/nes-logical-operators/src/Functions/Meos/AlwaysNeTquadbinQuadbinLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/AlwaysNeTquadbinQuadbinLogicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -25,54 +26,103 @@ namespace NES { -AlwaysNeTquadbinQuadbinLogicalFunction::AlwaysNeTquadbinQuadbinLogicalFunction(LogicalFunction inst_cell, LogicalFunction ts, LogicalFunction cell) +AlwaysNeTquadbinQuadbinLogicalFunction::AlwaysNeTquadbinQuadbinLogicalFunction(LogicalFunction cell, + LogicalFunction ts, + LogicalFunction arg0) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(3); - parameters.push_back(std::move(inst_cell)); - parameters.push_back(std::move(ts)); parameters.push_back(std::move(cell)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(arg0)); +} + +DataType AlwaysNeTquadbinQuadbinLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction AlwaysNeTquadbinQuadbinLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector AlwaysNeTquadbinQuadbinLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction AlwaysNeTquadbinQuadbinLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "AlwaysNeTquadbinQuadbinLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -DataType AlwaysNeTquadbinQuadbinLogicalFunction::getDataType() const { return dataType; } -LogicalFunction AlwaysNeTquadbinQuadbinLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } -std::vector AlwaysNeTquadbinQuadbinLogicalFunction::getChildren() const { return parameters; } -LogicalFunction AlwaysNeTquadbinQuadbinLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size()==3,"AlwaysNeTquadbinQuadbinLogicalFunction requires 3 children, but got {}",children.size()); - auto c=*this; c.parameters=children; return c; + +std::string_view AlwaysNeTquadbinQuadbinLogicalFunction::getType() const +{ + return NAME; } -std::string_view AlwaysNeTquadbinQuadbinLogicalFunction::getType() const { return NAME; } -bool AlwaysNeTquadbinQuadbinLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { - if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + +bool AlwaysNeTquadbinQuadbinLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } return false; } -std::string AlwaysNeTquadbinQuadbinLogicalFunction::explain(ExplainVerbosity v) const { - return fmt::format("{}({})",NAME,parameters[0].explain(v)); + +std::string AlwaysNeTquadbinQuadbinLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } -LogicalFunction AlwaysNeTquadbinQuadbinLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; c.reserve(3); - for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "inst_cell must be UINT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "cell must be UINT64"); - return withChildren(c); + +LogicalFunction AlwaysNeTquadbinQuadbinLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } -SerializableFunction AlwaysNeTquadbinQuadbinLogicalFunction::serialize() const { + +SerializableFunction AlwaysNeTquadbinQuadbinLogicalFunction::serialize() const +{ SerializableFunction proto; proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); - for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } return proto; } + LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysNeTquadbinQuadbinLogicalFunction( LogicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.children.size()==3, + PRECONDITION(arguments.children.size() == 3, "AlwaysNeTquadbinQuadbinLogicalFunction requires 3 children but got {}", arguments.children.size()); - return AlwaysNeTquadbinQuadbinLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return AlwaysNeTquadbinQuadbinLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AlwaysNeTtextTextLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AlwaysNeTtextTextLogicalFunction.cpp index 70c93952c5..dc0fd41e1c 100644 --- a/nes-logical-operators/src/Functions/Meos/AlwaysNeTtextTextLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/AlwaysNeTtextTextLogicalFunction.cpp @@ -13,81 +13,116 @@ */ #include -#include -#include -#include -#include + #include +#include #include -#include -#include -#include #include +#include +#include +#include #include -#include -#include -#include -#include - -namespace NES { -AlwaysNeTtextTextLogicalFunction::AlwaysNeTtextTextLogicalFunction( - LogicalFunction value, LogicalFunction ref, LogicalFunction ts) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { - parameters = {std::move(value), std::move(ref), std::move(ts)}; +namespace NES +{ + +AlwaysNeTtextTextLogicalFunction::AlwaysNeTtextTextLogicalFunction(LogicalFunction value, + LogicalFunction ts, + LogicalFunction arg0) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(arg0)); } -DataType AlwaysNeTtextTextLogicalFunction::getDataType() const { return dataType; } +DataType AlwaysNeTtextTextLogicalFunction::getDataType() const +{ + return dataType; +} -LogicalFunction AlwaysNeTtextTextLogicalFunction::withDataType(const DataType& dt) const { - auto c = *this; c.dataType = dt; return c; +LogicalFunction AlwaysNeTtextTextLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector AlwaysNeTtextTextLogicalFunction::getChildren() const { return parameters; } +std::vector AlwaysNeTtextTextLogicalFunction::getChildren() const +{ + return parameters; +} -LogicalFunction AlwaysNeTtextTextLogicalFunction::withChildren(const std::vector& ch) const { - PRECONDITION(ch.size() == 3, "AlwaysNeTtextText expects 3 params, got {}", ch.size()); - auto c = *this; c.parameters = ch; return c; +LogicalFunction AlwaysNeTtextTextLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "AlwaysNeTtextTextLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view AlwaysNeTtextTextLogicalFunction::getType() const { return NAME; } +std::string_view AlwaysNeTtextTextLogicalFunction::getType() const +{ + return NAME; +} -bool AlwaysNeTtextTextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { - const auto* o = dynamic_cast(&rhs); - return o && parameters == o->parameters; +bool AlwaysNeTtextTextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } + return false; } -std::string AlwaysNeTtextTextLogicalFunction::explain(ExplainVerbosity v) const { - return fmt::format("AlwaysNeTtextText({}, {}, {})", - parameters[0].explain(v), parameters[1].explain(v), parameters[2].explain(v)); +std::string AlwaysNeTtextTextLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } -LogicalFunction AlwaysNeTtextTextLogicalFunction::withInferredDataType(const Schema& s) const { - std::vector ch; - ch.reserve(3); - for (auto& p : parameters) ch.push_back(p.withInferredDataType(s)); - auto isStr = [](const DataType& dt) { return dt.isType(DataType::Type::VARSIZED); }; - auto isTime = [](const DataType& dt) { return dt.isType(DataType::Type::UINT64); }; - INVARIANT(isStr(ch[0].getDataType()) && isStr(ch[1].getDataType()) && isTime(ch[2].getDataType()), - "AlwaysNeTtextText: expects (VARCHAR, VARCHAR, UINT64)"); - return withChildren(ch); +LogicalFunction AlwaysNeTtextTextLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } -SerializableFunction AlwaysNeTtextTextLogicalFunction::serialize() const { - SerializableFunction sf; - sf.set_function_type(std::string(NAME)); - for (auto& p : parameters) *sf.add_children() = p.serialize(); - DataTypeSerializationUtil::serializeDataType(dataType, sf.mutable_data_type()); - return sf; +SerializableFunction AlwaysNeTtextTextLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } + return proto; } -LogicalFunctionRegistryReturnType -LogicalFunctionGeneratedRegistrar::RegisterAlwaysNeTtextTextLogicalFunction( - LogicalFunctionRegistryArguments arguments) { +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAlwaysNeTtextTextLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ PRECONDITION(arguments.children.size() == 3, - "AlwaysNeTtextText expects 3 params, got {}", arguments.children.size()); - return AlwaysNeTtextTextLogicalFunction( - arguments.children[0], arguments.children[1], arguments.children[2]); + "AlwaysNeTtextTextLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return AlwaysNeTtextTextLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AtouchesTcbufferGeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AtouchesTcbufferGeoLogicalFunction.cpp index c1560798e5..2e59e67f80 100644 --- a/nes-logical-operators/src/Functions/Meos/AtouchesTcbufferGeoLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/AtouchesTcbufferGeoLogicalFunction.cpp @@ -26,64 +26,83 @@ namespace NES { -AtouchesTcbufferGeoLogicalFunction::AtouchesTcbufferGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, - LogicalFunction radius, LogicalFunction ts, - LogicalFunction wkt) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +AtouchesTcbufferGeoLogicalFunction::AtouchesTcbufferGeoLogicalFunction(LogicalFunction lon, + LogicalFunction lat, + LogicalFunction radius, + LogicalFunction timestamp, + LogicalFunction geometry) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) { parameters.reserve(5); parameters.push_back(std::move(lon)); parameters.push_back(std::move(lat)); parameters.push_back(std::move(radius)); - parameters.push_back(std::move(ts)); - parameters.push_back(std::move(wkt)); + parameters.push_back(std::move(timestamp)); + parameters.push_back(std::move(geometry)); } -DataType AtouchesTcbufferGeoLogicalFunction::getDataType() const { return dataType; } +DataType AtouchesTcbufferGeoLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction AtouchesTcbufferGeoLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector AtouchesTcbufferGeoLogicalFunction::getChildren() const { return parameters; } +std::vector AtouchesTcbufferGeoLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction AtouchesTcbufferGeoLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 5, - "AtouchesTcbufferGeoLogicalFunction requires 5 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 5, "AtouchesTcbufferGeoLogicalFunction requires 5 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view AtouchesTcbufferGeoLogicalFunction::getType() const { return NAME; } +std::string_view AtouchesTcbufferGeoLogicalFunction::getType() const +{ + return NAME; +} bool AtouchesTcbufferGeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string AtouchesTcbufferGeoLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction AtouchesTcbufferGeoLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(5); - c.emplace_back(parameters[0].withInferredDataType(schema)); - c.emplace_back(parameters[1].withInferredDataType(schema)); - c.emplace_back(parameters[2].withInferredDataType(schema)); - c.emplace_back(parameters[3].withInferredDataType(schema)); - c.emplace_back(parameters[4].withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon must be FLOAT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat must be FLOAT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "radius must be FLOAT64"); - INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); - INVARIANT(c[4].getDataType().isType(DataType::Type::VARSIZED), "wkt must be VARCHAR"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction AtouchesTcbufferGeoLogicalFunction::serialize() const @@ -92,7 +111,9 @@ SerializableFunction AtouchesTcbufferGeoLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -102,11 +123,12 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAto PRECONDITION(arguments.children.size() == 5, "AtouchesTcbufferGeoLogicalFunction requires 5 children but got {}", arguments.children.size()); - return AtouchesTcbufferGeoLogicalFunction(std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2]), - std::move(arguments.children[3]), - std::move(arguments.children[4])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + return AtouchesTcbufferGeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AtouchesTcbufferTcbufferLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AtouchesTcbufferTcbufferLogicalFunction.cpp index 93e8cd9f52..39c0934ef1 100644 --- a/nes-logical-operators/src/Functions/Meos/AtouchesTcbufferTcbufferLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/AtouchesTcbufferTcbufferLogicalFunction.cpp @@ -26,67 +26,89 @@ namespace NES { -AtouchesTcbufferTcbufferLogicalFunction::AtouchesTcbufferTcbufferLogicalFunction( - LogicalFunction lon1, LogicalFunction lat1, LogicalFunction r1, LogicalFunction ts1, - LogicalFunction lon2, LogicalFunction lat2, LogicalFunction r2, LogicalFunction ts2) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +AtouchesTcbufferTcbufferLogicalFunction::AtouchesTcbufferTcbufferLogicalFunction(LogicalFunction lonA, + LogicalFunction latA, + LogicalFunction radiusA, + LogicalFunction tsA, + LogicalFunction lonB, + LogicalFunction latB, + LogicalFunction radiusB, + LogicalFunction tsB) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) { parameters.reserve(8); - parameters.push_back(std::move(lon1)); - parameters.push_back(std::move(lat1)); - parameters.push_back(std::move(r1)); - parameters.push_back(std::move(ts1)); - parameters.push_back(std::move(lon2)); - parameters.push_back(std::move(lat2)); - parameters.push_back(std::move(r2)); - parameters.push_back(std::move(ts2)); + parameters.push_back(std::move(lonA)); + parameters.push_back(std::move(latA)); + parameters.push_back(std::move(radiusA)); + parameters.push_back(std::move(tsA)); + parameters.push_back(std::move(lonB)); + parameters.push_back(std::move(latB)); + parameters.push_back(std::move(radiusB)); + parameters.push_back(std::move(tsB)); } -DataType AtouchesTcbufferTcbufferLogicalFunction::getDataType() const { return dataType; } +DataType AtouchesTcbufferTcbufferLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction AtouchesTcbufferTcbufferLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector AtouchesTcbufferTcbufferLogicalFunction::getChildren() const { return parameters; } +std::vector AtouchesTcbufferTcbufferLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction AtouchesTcbufferTcbufferLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 8, - "AtouchesTcbufferTcbufferLogicalFunction requires 8 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 8, "AtouchesTcbufferTcbufferLogicalFunction requires 8 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view AtouchesTcbufferTcbufferLogicalFunction::getType() const { return NAME; } +std::string_view AtouchesTcbufferTcbufferLogicalFunction::getType() const +{ + return NAME; +} bool AtouchesTcbufferTcbufferLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string AtouchesTcbufferTcbufferLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction AtouchesTcbufferTcbufferLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(8); - for (const auto& p : parameters) - c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon1 must be FLOAT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat1 must be FLOAT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "r1 must be FLOAT64"); - INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); - INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "lon2 must be FLOAT64"); - INVARIANT(c[5].getDataType().isType(DataType::Type::FLOAT64), "lat2 must be FLOAT64"); - INVARIANT(c[6].getDataType().isType(DataType::Type::FLOAT64), "r2 must be FLOAT64"); - INVARIANT(c[7].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction AtouchesTcbufferTcbufferLogicalFunction::serialize() const @@ -95,7 +117,9 @@ SerializableFunction AtouchesTcbufferTcbufferLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -105,14 +129,15 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAto PRECONDITION(arguments.children.size() == 8, "AtouchesTcbufferTcbufferLogicalFunction requires 8 children but got {}", arguments.children.size()); - return AtouchesTcbufferTcbufferLogicalFunction(std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2]), - std::move(arguments.children[3]), - std::move(arguments.children[4]), - std::move(arguments.children[5]), - std::move(arguments.children[6]), - std::move(arguments.children[7])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + auto arg5 = std::move(arguments.children[5]); + auto arg6 = std::move(arguments.children[6]); + auto arg7 = std::move(arguments.children[7]); + return AtouchesTcbufferTcbufferLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6), std::move(arg7)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AtouchesTgeoGeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AtouchesTgeoGeoLogicalFunction.cpp index a92566dc79..94cbac9aee 100644 --- a/nes-logical-operators/src/Functions/Meos/AtouchesTgeoGeoLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/AtouchesTgeoGeoLogicalFunction.cpp @@ -26,60 +26,81 @@ namespace NES { -AtouchesTgeoGeoLogicalFunction::AtouchesTgeoGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, - LogicalFunction ts, LogicalFunction wkt) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +AtouchesTgeoGeoLogicalFunction::AtouchesTgeoGeoLogicalFunction(LogicalFunction lon, + LogicalFunction lat, + LogicalFunction timestamp, + LogicalFunction geometry) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) { parameters.reserve(4); parameters.push_back(std::move(lon)); parameters.push_back(std::move(lat)); - parameters.push_back(std::move(ts)); - parameters.push_back(std::move(wkt)); + parameters.push_back(std::move(timestamp)); + parameters.push_back(std::move(geometry)); } -DataType AtouchesTgeoGeoLogicalFunction::getDataType() const { return dataType; } +DataType AtouchesTgeoGeoLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction AtouchesTgeoGeoLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector AtouchesTgeoGeoLogicalFunction::getChildren() const { return parameters; } +std::vector AtouchesTgeoGeoLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction AtouchesTgeoGeoLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 4, - "AtouchesTgeoGeoLogicalFunction requires 4 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 4, "AtouchesTgeoGeoLogicalFunction requires 4 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view AtouchesTgeoGeoLogicalFunction::getType() const { return NAME; } +std::string_view AtouchesTgeoGeoLogicalFunction::getType() const +{ + return NAME; +} bool AtouchesTgeoGeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string AtouchesTgeoGeoLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction AtouchesTgeoGeoLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(4); - c.emplace_back(parameters[0].withInferredDataType(schema)); - c.emplace_back(parameters[1].withInferredDataType(schema)); - c.emplace_back(parameters[2].withInferredDataType(schema)); - c.emplace_back(parameters[3].withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon must be FLOAT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat must be FLOAT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); - INVARIANT(c[3].getDataType().isType(DataType::Type::VARSIZED),"wkt must be VARSIZED"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction AtouchesTgeoGeoLogicalFunction::serialize() const @@ -88,7 +109,9 @@ SerializableFunction AtouchesTgeoGeoLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -98,10 +121,11 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAto PRECONDITION(arguments.children.size() == 4, "AtouchesTgeoGeoLogicalFunction requires 4 children but got {}", arguments.children.size()); - return AtouchesTgeoGeoLogicalFunction(std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2]), - std::move(arguments.children[3])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + return AtouchesTgeoGeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AtouchesTgeoTgeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AtouchesTgeoTgeoLogicalFunction.cpp index 2d3781a759..66c0286eaa 100644 --- a/nes-logical-operators/src/Functions/Meos/AtouchesTgeoTgeoLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/AtouchesTgeoTgeoLogicalFunction.cpp @@ -26,61 +26,85 @@ namespace NES { -AtouchesTgeoTgeoLogicalFunction::AtouchesTgeoTgeoLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction ts1, LogicalFunction lon2, LogicalFunction lat2, LogicalFunction ts2) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +AtouchesTgeoTgeoLogicalFunction::AtouchesTgeoTgeoLogicalFunction(LogicalFunction lonA, + LogicalFunction latA, + LogicalFunction tsA, + LogicalFunction lonB, + LogicalFunction latB, + LogicalFunction tsB) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) { parameters.reserve(6); - parameters.push_back(std::move(lon1)); - parameters.push_back(std::move(lat1)); - parameters.push_back(std::move(ts1)); - parameters.push_back(std::move(lon2)); - parameters.push_back(std::move(lat2)); - parameters.push_back(std::move(ts2)); + parameters.push_back(std::move(lonA)); + parameters.push_back(std::move(latA)); + parameters.push_back(std::move(tsA)); + parameters.push_back(std::move(lonB)); + parameters.push_back(std::move(latB)); + parameters.push_back(std::move(tsB)); } -DataType AtouchesTgeoTgeoLogicalFunction::getDataType() const { return dataType; } +DataType AtouchesTgeoTgeoLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction AtouchesTgeoTgeoLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector AtouchesTgeoTgeoLogicalFunction::getChildren() const { return parameters; } +std::vector AtouchesTgeoTgeoLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction AtouchesTgeoTgeoLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 6, - "AtouchesTgeoTgeoLogicalFunction requires 6 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 6, "AtouchesTgeoTgeoLogicalFunction requires 6 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view AtouchesTgeoTgeoLogicalFunction::getType() const { return NAME; } +std::string_view AtouchesTgeoTgeoLogicalFunction::getType() const +{ + return NAME; +} bool AtouchesTgeoTgeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string AtouchesTgeoTgeoLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction AtouchesTgeoTgeoLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(6); - for (const auto& p : parameters) - c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon1 must be FLOAT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat1 must be FLOAT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); - INVARIANT(c[3].getDataType().isType(DataType::Type::FLOAT64), "lon2 must be FLOAT64"); - INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "lat2 must be FLOAT64"); - INVARIANT(c[5].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction AtouchesTgeoTgeoLogicalFunction::serialize() const @@ -89,7 +113,9 @@ SerializableFunction AtouchesTgeoTgeoLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -99,13 +125,13 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAto PRECONDITION(arguments.children.size() == 6, "AtouchesTgeoTgeoLogicalFunction requires 6 children but got {}", arguments.children.size()); - return AtouchesTgeoTgeoLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2]), - std::move(arguments.children[3]), - std::move(arguments.children[4]), - std::move(arguments.children[5])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + auto arg5 = std::move(arguments.children[5]); + return AtouchesTgeoTgeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/AtouchesTrgeometryGeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/AtouchesTrgeometryGeoLogicalFunction.cpp new file mode 100644 index 0000000000..b9f1ab3fa5 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/AtouchesTrgeometryGeoLogicalFunction.cpp @@ -0,0 +1,87 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +AtouchesTrgeometryGeoLogicalFunction::AtouchesTrgeometryGeoLogicalFunction(LogicalFunction ref_wkt, LogicalFunction x1, LogicalFunction y1, LogicalFunction theta1, LogicalFunction ts1, LogicalFunction tgt_wkt) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(6); + parameters.push_back(std::move(ref_wkt)); + parameters.push_back(std::move(x1)); + parameters.push_back(std::move(y1)); + parameters.push_back(std::move(theta1)); + parameters.push_back(std::move(ts1)); + parameters.push_back(std::move(tgt_wkt)); +} +DataType AtouchesTrgeometryGeoLogicalFunction::getDataType() const { return dataType; } +LogicalFunction AtouchesTrgeometryGeoLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } +std::vector AtouchesTrgeometryGeoLogicalFunction::getChildren() const { return parameters; } +LogicalFunction AtouchesTrgeometryGeoLogicalFunction::withChildren(const std::vector& children) const { + PRECONDITION(children.size()==6,"AtouchesTrgeometryGeoLogicalFunction requires 6 children, but got {}",children.size()); + auto c=*this; c.parameters=children; return c; +} +std::string_view AtouchesTrgeometryGeoLogicalFunction::getType() const { return NAME; } +bool AtouchesTrgeometryGeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + return false; +} +std::string AtouchesTrgeometryGeoLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("{}({})",NAME,parameters[0].explain(v)); +} +LogicalFunction AtouchesTrgeometryGeoLogicalFunction::withInferredDataType(const Schema& schema) const { + std::vector c; c.reserve(6); + for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "ref_wkt must be VARSIZED"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "x1 must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "y1 must be FLOAT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::FLOAT64), "theta1 must be FLOAT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); + INVARIANT(c[5].getDataType().isType(DataType::Type::VARSIZED), "tgt_wkt must be VARSIZED"); + return withChildren(c); +} +SerializableFunction AtouchesTrgeometryGeoLogicalFunction::serialize() const { + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + return proto; +} +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterAtouchesTrgeometryGeoLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size()==6, + "AtouchesTrgeometryGeoLogicalFunction requires 6 children but got {}", + arguments.children.size()); + return AtouchesTrgeometryGeoLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4]), + std::move(arguments.children[5])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt index d2f3599cac..697c8e8a71 100644 --- a/nes-logical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-logical-operators/src/Functions/Meos/CMakeLists.txt @@ -574,3 +574,99 @@ add_plugin(GeomIntersects3d LogicalFunction nes-logical-operators GeomIntersects add_plugin(GeomDwithin3d LogicalFunction nes-logical-operators GeomDwithin3dLogicalFunction.cpp) add_plugin(GeomDistance2d LogicalFunction nes-logical-operators GeomDistance2dLogicalFunction.cpp) add_plugin(GeomDistance3d LogicalFunction nes-logical-operators GeomDistance3dLogicalFunction.cpp) +add_plugin(EcoversTgeoGeo LogicalFunction nes-logical-operators EcoversTgeoGeoLogicalFunction.cpp) +add_plugin(EdisjointTgeoGeo LogicalFunction nes-logical-operators EdisjointTgeoGeoLogicalFunction.cpp) +add_plugin(EdwithinTgeoGeo LogicalFunction nes-logical-operators EdwithinTgeoGeoLogicalFunction.cpp) +add_plugin(NadTgeoTgeo LogicalFunction nes-logical-operators NadTgeoTgeoLogicalFunction.cpp) +add_plugin(EcontainsTcbufferTcbuffer LogicalFunction nes-logical-operators EcontainsTcbufferTcbufferLogicalFunction.cpp) +add_plugin(AcontainsTcbufferTcbuffer LogicalFunction nes-logical-operators AcontainsTcbufferTcbufferLogicalFunction.cpp) +add_plugin(EdisjointTcbufferTcbuffer LogicalFunction nes-logical-operators EdisjointTcbufferTcbufferLogicalFunction.cpp) +add_plugin(EdwithinTcbufferCbuffer LogicalFunction nes-logical-operators EdwithinTcbufferCbufferLogicalFunction.cpp) +add_plugin(AdwithinTcbufferCbuffer LogicalFunction nes-logical-operators AdwithinTcbufferCbufferLogicalFunction.cpp) +add_plugin(EcoversTgeoGeo LogicalFunction nes-logical-operators EcoversTgeoGeoLogicalFunction.cpp) +add_plugin(EdisjointTgeoGeo LogicalFunction nes-logical-operators EdisjointTgeoGeoLogicalFunction.cpp) +add_plugin(EdwithinTgeoGeo LogicalFunction nes-logical-operators EdwithinTgeoGeoLogicalFunction.cpp) +add_plugin(NadTgeoTgeo LogicalFunction nes-logical-operators NadTgeoTgeoLogicalFunction.cpp) +add_plugin(AcontainsTcbufferTcbuffer LogicalFunction nes-logical-operators AcontainsTcbufferTcbufferLogicalFunction.cpp) +add_plugin(EcontainsTcbufferTcbuffer LogicalFunction nes-logical-operators EcontainsTcbufferTcbufferLogicalFunction.cpp) +add_plugin(EdisjointTcbufferTcbuffer LogicalFunction nes-logical-operators EdisjointTcbufferTcbufferLogicalFunction.cpp) +add_plugin(TEqTtextText LogicalFunction nes-logical-operators TEqTtextTextLogicalFunction.cpp) +add_plugin(TEqTextTtext LogicalFunction nes-logical-operators TEqTextTtextLogicalFunction.cpp) +add_plugin(TNeTtextText LogicalFunction nes-logical-operators TNeTtextTextLogicalFunction.cpp) +add_plugin(TNeTextTtext LogicalFunction nes-logical-operators TNeTextTtextLogicalFunction.cpp) +add_plugin(TGeTtextText LogicalFunction nes-logical-operators TGeTtextTextLogicalFunction.cpp) +add_plugin(TGeTextTtext LogicalFunction nes-logical-operators TGeTextTtextLogicalFunction.cpp) +add_plugin(TGtTtextText LogicalFunction nes-logical-operators TGtTtextTextLogicalFunction.cpp) +add_plugin(TGtTextTtext LogicalFunction nes-logical-operators TGtTextTtextLogicalFunction.cpp) +add_plugin(TLeTtextText LogicalFunction nes-logical-operators TLeTtextTextLogicalFunction.cpp) +add_plugin(TLeTextTtext LogicalFunction nes-logical-operators TLeTextTtextLogicalFunction.cpp) +add_plugin(TLtTtextText LogicalFunction nes-logical-operators TLtTtextTextLogicalFunction.cpp) +add_plugin(TLtTextTtext LogicalFunction nes-logical-operators TLtTextTtextLogicalFunction.cpp) +add_plugin(AcontainsGeoTrgeometry LogicalFunction nes-logical-operators AcontainsGeoTrgeometryLogicalFunction.cpp) +add_plugin(AcoversGeoTrgeometry LogicalFunction nes-logical-operators AcoversGeoTrgeometryLogicalFunction.cpp) +add_plugin(AcoversTrgeometryGeo LogicalFunction nes-logical-operators AcoversTrgeometryGeoLogicalFunction.cpp) +add_plugin(AdisjointTrgeometryGeo LogicalFunction nes-logical-operators AdisjointTrgeometryGeoLogicalFunction.cpp) +add_plugin(AdisjointTrgeometryTrgeometry LogicalFunction nes-logical-operators AdisjointTrgeometryTrgeometryLogicalFunction.cpp) +add_plugin(AdwithinTrgeometryGeo LogicalFunction nes-logical-operators AdwithinTrgeometryGeoLogicalFunction.cpp) +add_plugin(AdwithinTrgeometryTrgeometry LogicalFunction nes-logical-operators AdwithinTrgeometryTrgeometryLogicalFunction.cpp) +add_plugin(AintersectsTrgeometryGeo LogicalFunction nes-logical-operators AintersectsTrgeometryGeoLogicalFunction.cpp) +add_plugin(AintersectsTrgeometryTrgeometry LogicalFunction nes-logical-operators AintersectsTrgeometryTrgeometryLogicalFunction.cpp) +add_plugin(AtouchesTrgeometryGeo LogicalFunction nes-logical-operators AtouchesTrgeometryGeoLogicalFunction.cpp) +add_plugin(EcontainsGeoTrgeometry LogicalFunction nes-logical-operators EcontainsGeoTrgeometryLogicalFunction.cpp) +add_plugin(EcoversGeoTrgeometry LogicalFunction nes-logical-operators EcoversGeoTrgeometryLogicalFunction.cpp) +add_plugin(EcoversTrgeometryGeo LogicalFunction nes-logical-operators EcoversTrgeometryGeoLogicalFunction.cpp) +add_plugin(EdisjointTrgeometryGeo LogicalFunction nes-logical-operators EdisjointTrgeometryGeoLogicalFunction.cpp) +add_plugin(EdisjointTrgeometryTrgeometry LogicalFunction nes-logical-operators EdisjointTrgeometryTrgeometryLogicalFunction.cpp) +add_plugin(EdwithinTrgeometryGeo LogicalFunction nes-logical-operators EdwithinTrgeometryGeoLogicalFunction.cpp) +add_plugin(EdwithinTrgeometryTrgeometry LogicalFunction nes-logical-operators EdwithinTrgeometryTrgeometryLogicalFunction.cpp) +add_plugin(EintersectsTrgeometryGeo LogicalFunction nes-logical-operators EintersectsTrgeometryGeoLogicalFunction.cpp) +add_plugin(EintersectsTrgeometryTrgeometry LogicalFunction nes-logical-operators EintersectsTrgeometryTrgeometryLogicalFunction.cpp) +add_plugin(EtouchesTrgeometryGeo LogicalFunction nes-logical-operators EtouchesTrgeometryGeoLogicalFunction.cpp) +add_plugin(TemporalEIntersectsTPoseGeometry LogicalFunction nes-logical-operators TemporalEIntersectsTPoseGeometryLogicalFunction.cpp) +add_plugin(TemporalAIntersectsTPoseGeometry LogicalFunction nes-logical-operators TemporalAIntersectsTPoseGeometryLogicalFunction.cpp) +add_plugin(TemporalECoversTPoseGeometry LogicalFunction nes-logical-operators TemporalECoversTPoseGeometryLogicalFunction.cpp) +add_plugin(TemporalEDisjointTPoseGeometry LogicalFunction nes-logical-operators TemporalEDisjointTPoseGeometryLogicalFunction.cpp) +add_plugin(TemporalADisjointTPoseGeometry LogicalFunction nes-logical-operators TemporalADisjointTPoseGeometryLogicalFunction.cpp) +add_plugin(TemporalETouchesTPoseGeometry LogicalFunction nes-logical-operators TemporalETouchesTPoseGeometryLogicalFunction.cpp) +add_plugin(TemporalATouchesTPoseGeometry LogicalFunction nes-logical-operators TemporalATouchesTPoseGeometryLogicalFunction.cpp) +add_plugin(TemporalEContainsTPoseGeometry LogicalFunction nes-logical-operators TemporalEContainsTPoseGeometryLogicalFunction.cpp) +add_plugin(TemporalAContainsTPoseGeometry LogicalFunction nes-logical-operators TemporalAContainsTPoseGeometryLogicalFunction.cpp) +add_plugin(TemporalEDWithinTPoseGeometry LogicalFunction nes-logical-operators TemporalEDWithinTPoseGeometryLogicalFunction.cpp) +add_plugin(TemporalADWithinTPoseGeometry LogicalFunction nes-logical-operators TemporalADWithinTPoseGeometryLogicalFunction.cpp) +add_plugin(TemporalEIntersectsTPoseTPose LogicalFunction nes-logical-operators TemporalEIntersectsTPoseTPoseLogicalFunction.cpp) +add_plugin(TemporalAIntersectsTPoseTPose LogicalFunction nes-logical-operators TemporalAIntersectsTPoseTPoseLogicalFunction.cpp) +add_plugin(TemporalECoversTPoseTPose LogicalFunction nes-logical-operators TemporalECoversTPoseTPoseLogicalFunction.cpp) +add_plugin(TemporalEDisjointTPoseTPose LogicalFunction nes-logical-operators TemporalEDisjointTPoseTPoseLogicalFunction.cpp) +add_plugin(TemporalADisjointTPoseTPose LogicalFunction nes-logical-operators TemporalADisjointTPoseTPoseLogicalFunction.cpp) +add_plugin(TemporalETouchesTPoseTPose LogicalFunction nes-logical-operators TemporalETouchesTPoseTPoseLogicalFunction.cpp) +add_plugin(TemporalATouchesTPoseTPose LogicalFunction nes-logical-operators TemporalATouchesTPoseTPoseLogicalFunction.cpp) +add_plugin(TemporalEContainsTPoseTPose LogicalFunction nes-logical-operators TemporalEContainsTPoseTPoseLogicalFunction.cpp) +add_plugin(TemporalAContainsTPoseTPose LogicalFunction nes-logical-operators TemporalAContainsTPoseTPoseLogicalFunction.cpp) +add_plugin(TemporalEDWithinTPoseTPose LogicalFunction nes-logical-operators TemporalEDWithinTPoseTPoseLogicalFunction.cpp) +add_plugin(TemporalADWithinTPoseTPose LogicalFunction nes-logical-operators TemporalADWithinTPoseTPoseLogicalFunction.cpp) +add_plugin(TemporalNADTPoseGeometry LogicalFunction nes-logical-operators TemporalNADTPoseGeometryLogicalFunction.cpp) +add_plugin(TemporalNADTPoseTPose LogicalFunction nes-logical-operators TemporalNADTPoseTPoseLogicalFunction.cpp) +add_plugin(TemporalEIntersectsTNpointGeometry LogicalFunction nes-logical-operators TemporalEIntersectsTNpointGeometryLogicalFunction.cpp) +add_plugin(TemporalAIntersectsTNpointGeometry LogicalFunction nes-logical-operators TemporalAIntersectsTNpointGeometryLogicalFunction.cpp) +add_plugin(TemporalECoversTNpointGeometry LogicalFunction nes-logical-operators TemporalECoversTNpointGeometryLogicalFunction.cpp) +add_plugin(TemporalEDisjointTNpointGeometry LogicalFunction nes-logical-operators TemporalEDisjointTNpointGeometryLogicalFunction.cpp) +add_plugin(TemporalADisjointTNpointGeometry LogicalFunction nes-logical-operators TemporalADisjointTNpointGeometryLogicalFunction.cpp) +add_plugin(TemporalETouchesTNpointGeometry LogicalFunction nes-logical-operators TemporalETouchesTNpointGeometryLogicalFunction.cpp) +add_plugin(TemporalATouchesTNpointGeometry LogicalFunction nes-logical-operators TemporalATouchesTNpointGeometryLogicalFunction.cpp) +add_plugin(TemporalEContainsTNpointGeometry LogicalFunction nes-logical-operators TemporalEContainsTNpointGeometryLogicalFunction.cpp) +add_plugin(TemporalAContainsTNpointGeometry LogicalFunction nes-logical-operators TemporalAContainsTNpointGeometryLogicalFunction.cpp) +add_plugin(TemporalEDWithinTNpointGeometry LogicalFunction nes-logical-operators TemporalEDWithinTNpointGeometryLogicalFunction.cpp) +add_plugin(TemporalADWithinTNpointGeometry LogicalFunction nes-logical-operators TemporalADWithinTNpointGeometryLogicalFunction.cpp) +add_plugin(TemporalEIntersectsTNpointTNpoint LogicalFunction nes-logical-operators TemporalEIntersectsTNpointTNpointLogicalFunction.cpp) +add_plugin(TemporalAIntersectsTNpointTNpoint LogicalFunction nes-logical-operators TemporalAIntersectsTNpointTNpointLogicalFunction.cpp) +add_plugin(TemporalECoversTNpointTNpoint LogicalFunction nes-logical-operators TemporalECoversTNpointTNpointLogicalFunction.cpp) +add_plugin(TemporalEDisjointTNpointTNpoint LogicalFunction nes-logical-operators TemporalEDisjointTNpointTNpointLogicalFunction.cpp) +add_plugin(TemporalADisjointTNpointTNpoint LogicalFunction nes-logical-operators TemporalADisjointTNpointTNpointLogicalFunction.cpp) +add_plugin(TemporalETouchesTNpointTNpoint LogicalFunction nes-logical-operators TemporalETouchesTNpointTNpointLogicalFunction.cpp) +add_plugin(TemporalATouchesTNpointTNpoint LogicalFunction nes-logical-operators TemporalATouchesTNpointTNpointLogicalFunction.cpp) +add_plugin(TemporalEContainsTNpointTNpoint LogicalFunction nes-logical-operators TemporalEContainsTNpointTNpointLogicalFunction.cpp) +add_plugin(TemporalAContainsTNpointTNpoint LogicalFunction nes-logical-operators TemporalAContainsTNpointTNpointLogicalFunction.cpp) +add_plugin(TemporalEDWithinTNpointTNpoint LogicalFunction nes-logical-operators TemporalEDWithinTNpointTNpointLogicalFunction.cpp) +add_plugin(TemporalADWithinTNpointTNpoint LogicalFunction nes-logical-operators TemporalADWithinTNpointTNpointLogicalFunction.cpp) +add_plugin(TemporalNADTNpointGeometry LogicalFunction nes-logical-operators TemporalNADTNpointGeometryLogicalFunction.cpp) +add_plugin(TemporalNADTNpointTNpoint LogicalFunction nes-logical-operators TemporalNADTNpointTNpointLogicalFunction.cpp) diff --git a/nes-logical-operators/src/Functions/Meos/ContainedFloatSpanLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/ContainedFloatSpanLogicalFunction.cpp index 5abbd7e658..5d5c263ff4 100644 --- a/nes-logical-operators/src/Functions/Meos/ContainedFloatSpanLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/ContainedFloatSpanLogicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -25,51 +26,100 @@ namespace NES { -ContainedFloatSpanLogicalFunction::ContainedFloatSpanLogicalFunction(LogicalFunction val, LogicalFunction sp) +ContainedFloatSpanLogicalFunction::ContainedFloatSpanLogicalFunction(LogicalFunction arg0, + LogicalFunction sp) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(2); - parameters.push_back(std::move(val)); + parameters.push_back(std::move(arg0)); parameters.push_back(std::move(sp)); } -DataType ContainedFloatSpanLogicalFunction::getDataType() const { return dataType; } -LogicalFunction ContainedFloatSpanLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } -std::vector ContainedFloatSpanLogicalFunction::getChildren() const { return parameters; } -LogicalFunction ContainedFloatSpanLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size()==2,"ContainedFloatSpanLogicalFunction requires 2 children, but got {}",children.size()); - auto c=*this; c.parameters=children; return c; + +DataType ContainedFloatSpanLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction ContainedFloatSpanLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector ContainedFloatSpanLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction ContainedFloatSpanLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 2, "ContainedFloatSpanLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; +} + +std::string_view ContainedFloatSpanLogicalFunction::getType() const +{ + return NAME; } -std::string_view ContainedFloatSpanLogicalFunction::getType() const { return NAME; } -bool ContainedFloatSpanLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { - if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + +bool ContainedFloatSpanLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } return false; } -std::string ContainedFloatSpanLogicalFunction::explain(ExplainVerbosity v) const { - return fmt::format("{}({})",NAME,parameters[0].explain(v)); + +std::string ContainedFloatSpanLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } -LogicalFunction ContainedFloatSpanLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; c.reserve(2); - for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "val must be FLOAT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::VARSIZED), "sp must be VARSIZED"); - return withChildren(c); + +LogicalFunction ContainedFloatSpanLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } -SerializableFunction ContainedFloatSpanLogicalFunction::serialize() const { + +SerializableFunction ContainedFloatSpanLogicalFunction::serialize() const +{ SerializableFunction proto; proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); - for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } return proto; } + LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterContainedFloatSpanLogicalFunction( LogicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.children.size()==2, + PRECONDITION(arguments.children.size() == 2, "ContainedFloatSpanLogicalFunction requires 2 children but got {}", arguments.children.size()); - return ContainedFloatSpanLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + return ContainedFloatSpanLogicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/ContainedFloatspanSpanLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/ContainedFloatspanSpanLogicalFunction.cpp index f428c1ac2b..f763dc60a3 100644 --- a/nes-logical-operators/src/Functions/Meos/ContainedFloatspanSpanLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/ContainedFloatspanSpanLogicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -25,51 +26,100 @@ namespace NES { -ContainedFloatspanSpanLogicalFunction::ContainedFloatspanSpanLogicalFunction(LogicalFunction sp1, LogicalFunction sp2) +ContainedFloatspanSpanLogicalFunction::ContainedFloatspanSpanLogicalFunction(LogicalFunction sp, + LogicalFunction arg0) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(2); - parameters.push_back(std::move(sp1)); - parameters.push_back(std::move(sp2)); + parameters.push_back(std::move(sp)); + parameters.push_back(std::move(arg0)); +} + +DataType ContainedFloatspanSpanLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction ContainedFloatspanSpanLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector ContainedFloatspanSpanLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction ContainedFloatspanSpanLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 2, "ContainedFloatspanSpanLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -DataType ContainedFloatspanSpanLogicalFunction::getDataType() const { return dataType; } -LogicalFunction ContainedFloatspanSpanLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } -std::vector ContainedFloatspanSpanLogicalFunction::getChildren() const { return parameters; } -LogicalFunction ContainedFloatspanSpanLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size()==2,"ContainedFloatspanSpanLogicalFunction requires 2 children, but got {}",children.size()); - auto c=*this; c.parameters=children; return c; + +std::string_view ContainedFloatspanSpanLogicalFunction::getType() const +{ + return NAME; } -std::string_view ContainedFloatspanSpanLogicalFunction::getType() const { return NAME; } -bool ContainedFloatspanSpanLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { - if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + +bool ContainedFloatspanSpanLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } return false; } -std::string ContainedFloatspanSpanLogicalFunction::explain(ExplainVerbosity v) const { - return fmt::format("{}({})",NAME,parameters[0].explain(v)); + +std::string ContainedFloatspanSpanLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } -LogicalFunction ContainedFloatspanSpanLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; c.reserve(2); - for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "sp1 must be VARSIZED"); - INVARIANT(c[1].getDataType().isType(DataType::Type::VARSIZED), "sp2 must be VARSIZED"); - return withChildren(c); + +LogicalFunction ContainedFloatspanSpanLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } -SerializableFunction ContainedFloatspanSpanLogicalFunction::serialize() const { + +SerializableFunction ContainedFloatspanSpanLogicalFunction::serialize() const +{ SerializableFunction proto; proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); - for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } return proto; } + LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterContainedFloatspanSpanLogicalFunction( LogicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.children.size()==2, + PRECONDITION(arguments.children.size() == 2, "ContainedFloatspanSpanLogicalFunction requires 2 children but got {}", arguments.children.size()); - return ContainedFloatspanSpanLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + return ContainedFloatspanSpanLogicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/ContainedIntSpanLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/ContainedIntSpanLogicalFunction.cpp index 82f43f97a7..b9e1d7fd7d 100644 --- a/nes-logical-operators/src/Functions/Meos/ContainedIntSpanLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/ContainedIntSpanLogicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -25,51 +26,100 @@ namespace NES { -ContainedIntSpanLogicalFunction::ContainedIntSpanLogicalFunction(LogicalFunction val, LogicalFunction sp) +ContainedIntSpanLogicalFunction::ContainedIntSpanLogicalFunction(LogicalFunction arg0, + LogicalFunction sp) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(2); - parameters.push_back(std::move(val)); + parameters.push_back(std::move(arg0)); parameters.push_back(std::move(sp)); } -DataType ContainedIntSpanLogicalFunction::getDataType() const { return dataType; } -LogicalFunction ContainedIntSpanLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } -std::vector ContainedIntSpanLogicalFunction::getChildren() const { return parameters; } -LogicalFunction ContainedIntSpanLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size()==2,"ContainedIntSpanLogicalFunction requires 2 children, but got {}",children.size()); - auto c=*this; c.parameters=children; return c; + +DataType ContainedIntSpanLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction ContainedIntSpanLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector ContainedIntSpanLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction ContainedIntSpanLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 2, "ContainedIntSpanLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; +} + +std::string_view ContainedIntSpanLogicalFunction::getType() const +{ + return NAME; } -std::string_view ContainedIntSpanLogicalFunction::getType() const { return NAME; } -bool ContainedIntSpanLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { - if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + +bool ContainedIntSpanLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } return false; } -std::string ContainedIntSpanLogicalFunction::explain(ExplainVerbosity v) const { - return fmt::format("{}({})",NAME,parameters[0].explain(v)); + +std::string ContainedIntSpanLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } -LogicalFunction ContainedIntSpanLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; c.reserve(2); - for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "val must be FLOAT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::VARSIZED), "sp must be VARSIZED"); - return withChildren(c); + +LogicalFunction ContainedIntSpanLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } -SerializableFunction ContainedIntSpanLogicalFunction::serialize() const { + +SerializableFunction ContainedIntSpanLogicalFunction::serialize() const +{ SerializableFunction proto; proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); - for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } return proto; } + LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterContainedIntSpanLogicalFunction( LogicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.children.size()==2, + PRECONDITION(arguments.children.size() == 2, "ContainedIntSpanLogicalFunction requires 2 children but got {}", arguments.children.size()); - return ContainedIntSpanLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + return ContainedIntSpanLogicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/ContainedSpanSpanLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/ContainedSpanSpanLogicalFunction.cpp index 9f1d65a291..588cb3ec60 100644 --- a/nes-logical-operators/src/Functions/Meos/ContainedSpanSpanLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/ContainedSpanSpanLogicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -25,51 +26,100 @@ namespace NES { -ContainedSpanSpanLogicalFunction::ContainedSpanSpanLogicalFunction(LogicalFunction sp1, LogicalFunction sp2) +ContainedSpanSpanLogicalFunction::ContainedSpanSpanLogicalFunction(LogicalFunction sp, + LogicalFunction arg0) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(2); - parameters.push_back(std::move(sp1)); - parameters.push_back(std::move(sp2)); + parameters.push_back(std::move(sp)); + parameters.push_back(std::move(arg0)); +} + +DataType ContainedSpanSpanLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction ContainedSpanSpanLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector ContainedSpanSpanLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction ContainedSpanSpanLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 2, "ContainedSpanSpanLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -DataType ContainedSpanSpanLogicalFunction::getDataType() const { return dataType; } -LogicalFunction ContainedSpanSpanLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } -std::vector ContainedSpanSpanLogicalFunction::getChildren() const { return parameters; } -LogicalFunction ContainedSpanSpanLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size()==2,"ContainedSpanSpanLogicalFunction requires 2 children, but got {}",children.size()); - auto c=*this; c.parameters=children; return c; + +std::string_view ContainedSpanSpanLogicalFunction::getType() const +{ + return NAME; } -std::string_view ContainedSpanSpanLogicalFunction::getType() const { return NAME; } -bool ContainedSpanSpanLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { - if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + +bool ContainedSpanSpanLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } return false; } -std::string ContainedSpanSpanLogicalFunction::explain(ExplainVerbosity v) const { - return fmt::format("{}({})",NAME,parameters[0].explain(v)); + +std::string ContainedSpanSpanLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } -LogicalFunction ContainedSpanSpanLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; c.reserve(2); - for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "sp1 must be VARSIZED"); - INVARIANT(c[1].getDataType().isType(DataType::Type::VARSIZED), "sp2 must be VARSIZED"); - return withChildren(c); + +LogicalFunction ContainedSpanSpanLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } -SerializableFunction ContainedSpanSpanLogicalFunction::serialize() const { + +SerializableFunction ContainedSpanSpanLogicalFunction::serialize() const +{ SerializableFunction proto; proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); - for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } return proto; } + LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterContainedSpanSpanLogicalFunction( LogicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.children.size()==2, + PRECONDITION(arguments.children.size() == 2, "ContainedSpanSpanLogicalFunction requires 2 children but got {}", arguments.children.size()); - return ContainedSpanSpanLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + return ContainedSpanSpanLogicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/ContainsFloatspanSpanLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/ContainsFloatspanSpanLogicalFunction.cpp index 1fc199ac33..7d18687657 100644 --- a/nes-logical-operators/src/Functions/Meos/ContainsFloatspanSpanLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/ContainsFloatspanSpanLogicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -25,51 +26,100 @@ namespace NES { -ContainsFloatspanSpanLogicalFunction::ContainsFloatspanSpanLogicalFunction(LogicalFunction sp1, LogicalFunction sp2) +ContainsFloatspanSpanLogicalFunction::ContainsFloatspanSpanLogicalFunction(LogicalFunction sp, + LogicalFunction arg0) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(2); - parameters.push_back(std::move(sp1)); - parameters.push_back(std::move(sp2)); + parameters.push_back(std::move(sp)); + parameters.push_back(std::move(arg0)); +} + +DataType ContainsFloatspanSpanLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction ContainsFloatspanSpanLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector ContainsFloatspanSpanLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction ContainsFloatspanSpanLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 2, "ContainsFloatspanSpanLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -DataType ContainsFloatspanSpanLogicalFunction::getDataType() const { return dataType; } -LogicalFunction ContainsFloatspanSpanLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } -std::vector ContainsFloatspanSpanLogicalFunction::getChildren() const { return parameters; } -LogicalFunction ContainsFloatspanSpanLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size()==2,"ContainsFloatspanSpanLogicalFunction requires 2 children, but got {}",children.size()); - auto c=*this; c.parameters=children; return c; + +std::string_view ContainsFloatspanSpanLogicalFunction::getType() const +{ + return NAME; } -std::string_view ContainsFloatspanSpanLogicalFunction::getType() const { return NAME; } -bool ContainsFloatspanSpanLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { - if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + +bool ContainsFloatspanSpanLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } return false; } -std::string ContainsFloatspanSpanLogicalFunction::explain(ExplainVerbosity v) const { - return fmt::format("{}({})",NAME,parameters[0].explain(v)); + +std::string ContainsFloatspanSpanLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } -LogicalFunction ContainsFloatspanSpanLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; c.reserve(2); - for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "sp1 must be VARSIZED"); - INVARIANT(c[1].getDataType().isType(DataType::Type::VARSIZED), "sp2 must be VARSIZED"); - return withChildren(c); + +LogicalFunction ContainsFloatspanSpanLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } -SerializableFunction ContainsFloatspanSpanLogicalFunction::serialize() const { + +SerializableFunction ContainsFloatspanSpanLogicalFunction::serialize() const +{ SerializableFunction proto; proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); - for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } return proto; } + LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterContainsFloatspanSpanLogicalFunction( LogicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.children.size()==2, + PRECONDITION(arguments.children.size() == 2, "ContainsFloatspanSpanLogicalFunction requires 2 children but got {}", arguments.children.size()); - return ContainsFloatspanSpanLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + return ContainsFloatspanSpanLogicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/ContainsSpanFloatLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/ContainsSpanFloatLogicalFunction.cpp index aa27038af4..cb629f455f 100644 --- a/nes-logical-operators/src/Functions/Meos/ContainsSpanFloatLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/ContainsSpanFloatLogicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -25,51 +26,100 @@ namespace NES { -ContainsSpanFloatLogicalFunction::ContainsSpanFloatLogicalFunction(LogicalFunction sp, LogicalFunction val) +ContainsSpanFloatLogicalFunction::ContainsSpanFloatLogicalFunction(LogicalFunction sp, + LogicalFunction arg0) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(2); parameters.push_back(std::move(sp)); - parameters.push_back(std::move(val)); + parameters.push_back(std::move(arg0)); +} + +DataType ContainsSpanFloatLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction ContainsSpanFloatLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector ContainsSpanFloatLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction ContainsSpanFloatLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 2, "ContainsSpanFloatLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -DataType ContainsSpanFloatLogicalFunction::getDataType() const { return dataType; } -LogicalFunction ContainsSpanFloatLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } -std::vector ContainsSpanFloatLogicalFunction::getChildren() const { return parameters; } -LogicalFunction ContainsSpanFloatLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size()==2,"ContainsSpanFloatLogicalFunction requires 2 children, but got {}",children.size()); - auto c=*this; c.parameters=children; return c; + +std::string_view ContainsSpanFloatLogicalFunction::getType() const +{ + return NAME; } -std::string_view ContainsSpanFloatLogicalFunction::getType() const { return NAME; } -bool ContainsSpanFloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { - if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + +bool ContainsSpanFloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } return false; } -std::string ContainsSpanFloatLogicalFunction::explain(ExplainVerbosity v) const { - return fmt::format("{}({})",NAME,parameters[0].explain(v)); + +std::string ContainsSpanFloatLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } -LogicalFunction ContainsSpanFloatLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; c.reserve(2); - for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "sp must be VARSIZED"); - INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "val must be FLOAT64"); - return withChildren(c); + +LogicalFunction ContainsSpanFloatLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } -SerializableFunction ContainsSpanFloatLogicalFunction::serialize() const { + +SerializableFunction ContainsSpanFloatLogicalFunction::serialize() const +{ SerializableFunction proto; proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); - for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } return proto; } + LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterContainsSpanFloatLogicalFunction( LogicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.children.size()==2, + PRECONDITION(arguments.children.size() == 2, "ContainsSpanFloatLogicalFunction requires 2 children but got {}", arguments.children.size()); - return ContainsSpanFloatLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + return ContainsSpanFloatLogicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/ContainsSpanIntLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/ContainsSpanIntLogicalFunction.cpp index 9000b5c553..7c7a3b6db8 100644 --- a/nes-logical-operators/src/Functions/Meos/ContainsSpanIntLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/ContainsSpanIntLogicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -25,51 +26,100 @@ namespace NES { -ContainsSpanIntLogicalFunction::ContainsSpanIntLogicalFunction(LogicalFunction sp, LogicalFunction val) +ContainsSpanIntLogicalFunction::ContainsSpanIntLogicalFunction(LogicalFunction sp, + LogicalFunction arg0) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(2); parameters.push_back(std::move(sp)); - parameters.push_back(std::move(val)); + parameters.push_back(std::move(arg0)); +} + +DataType ContainsSpanIntLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction ContainsSpanIntLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector ContainsSpanIntLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction ContainsSpanIntLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 2, "ContainsSpanIntLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -DataType ContainsSpanIntLogicalFunction::getDataType() const { return dataType; } -LogicalFunction ContainsSpanIntLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } -std::vector ContainsSpanIntLogicalFunction::getChildren() const { return parameters; } -LogicalFunction ContainsSpanIntLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size()==2,"ContainsSpanIntLogicalFunction requires 2 children, but got {}",children.size()); - auto c=*this; c.parameters=children; return c; + +std::string_view ContainsSpanIntLogicalFunction::getType() const +{ + return NAME; } -std::string_view ContainsSpanIntLogicalFunction::getType() const { return NAME; } -bool ContainsSpanIntLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { - if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + +bool ContainsSpanIntLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } return false; } -std::string ContainsSpanIntLogicalFunction::explain(ExplainVerbosity v) const { - return fmt::format("{}({})",NAME,parameters[0].explain(v)); + +std::string ContainsSpanIntLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } -LogicalFunction ContainsSpanIntLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; c.reserve(2); - for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "sp must be VARSIZED"); - INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "val must be FLOAT64"); - return withChildren(c); + +LogicalFunction ContainsSpanIntLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } -SerializableFunction ContainsSpanIntLogicalFunction::serialize() const { + +SerializableFunction ContainsSpanIntLogicalFunction::serialize() const +{ SerializableFunction proto; proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); - for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } return proto; } + LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterContainsSpanIntLogicalFunction( LogicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.children.size()==2, + PRECONDITION(arguments.children.size() == 2, "ContainsSpanIntLogicalFunction requires 2 children but got {}", arguments.children.size()); - return ContainsSpanIntLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + return ContainsSpanIntLogicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/ContainsSpanSpanLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/ContainsSpanSpanLogicalFunction.cpp index d0b3e1c052..49a7fc3708 100644 --- a/nes-logical-operators/src/Functions/Meos/ContainsSpanSpanLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/ContainsSpanSpanLogicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -25,51 +26,100 @@ namespace NES { -ContainsSpanSpanLogicalFunction::ContainsSpanSpanLogicalFunction(LogicalFunction sp1, LogicalFunction sp2) +ContainsSpanSpanLogicalFunction::ContainsSpanSpanLogicalFunction(LogicalFunction sp, + LogicalFunction arg0) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(2); - parameters.push_back(std::move(sp1)); - parameters.push_back(std::move(sp2)); + parameters.push_back(std::move(sp)); + parameters.push_back(std::move(arg0)); +} + +DataType ContainsSpanSpanLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction ContainsSpanSpanLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector ContainsSpanSpanLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction ContainsSpanSpanLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 2, "ContainsSpanSpanLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -DataType ContainsSpanSpanLogicalFunction::getDataType() const { return dataType; } -LogicalFunction ContainsSpanSpanLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } -std::vector ContainsSpanSpanLogicalFunction::getChildren() const { return parameters; } -LogicalFunction ContainsSpanSpanLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size()==2,"ContainsSpanSpanLogicalFunction requires 2 children, but got {}",children.size()); - auto c=*this; c.parameters=children; return c; + +std::string_view ContainsSpanSpanLogicalFunction::getType() const +{ + return NAME; } -std::string_view ContainsSpanSpanLogicalFunction::getType() const { return NAME; } -bool ContainsSpanSpanLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { - if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + +bool ContainsSpanSpanLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } return false; } -std::string ContainsSpanSpanLogicalFunction::explain(ExplainVerbosity v) const { - return fmt::format("{}({})",NAME,parameters[0].explain(v)); + +std::string ContainsSpanSpanLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } -LogicalFunction ContainsSpanSpanLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; c.reserve(2); - for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "sp1 must be VARSIZED"); - INVARIANT(c[1].getDataType().isType(DataType::Type::VARSIZED), "sp2 must be VARSIZED"); - return withChildren(c); + +LogicalFunction ContainsSpanSpanLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } -SerializableFunction ContainsSpanSpanLogicalFunction::serialize() const { + +SerializableFunction ContainsSpanSpanLogicalFunction::serialize() const +{ SerializableFunction proto; proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); - for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } return proto; } + LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterContainsSpanSpanLogicalFunction( LogicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.children.size()==2, + PRECONDITION(arguments.children.size() == 2, "ContainsSpanSpanLogicalFunction requires 2 children but got {}", arguments.children.size()); - return ContainsSpanSpanLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + return ContainsSpanSpanLogicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/DivBigintTbigintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/DivBigintTbigintLogicalFunction.cpp index 166a3c2100..1b00c9f96d 100644 --- a/nes-logical-operators/src/Functions/Meos/DivBigintTbigintLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/DivBigintTbigintLogicalFunction.cpp @@ -26,46 +26,65 @@ namespace NES { -DivBigintTbigintLogicalFunction::DivBigintTbigintLogicalFunction(LogicalFunction scalar, - LogicalFunction value, - LogicalFunction ts) +DivBigintTbigintLogicalFunction::DivBigintTbigintLogicalFunction(LogicalFunction arg0, + LogicalFunction value, + LogicalFunction ts) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(3); - parameters.push_back(std::move(scalar)); + parameters.push_back(std::move(arg0)); parameters.push_back(std::move(value)); parameters.push_back(std::move(ts)); } -DataType DivBigintTbigintLogicalFunction::getDataType() const { return dataType; } +DataType DivBigintTbigintLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction DivBigintTbigintLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector DivBigintTbigintLogicalFunction::getChildren() const { return parameters; } +std::vector DivBigintTbigintLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction DivBigintTbigintLogicalFunction::withChildren(const std::vector& children) const { PRECONDITION(children.size() == 3, "DivBigintTbigintLogicalFunction requires 3 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view DivBigintTbigintLogicalFunction::getType() const { return NAME; } +std::string_view DivBigintTbigintLogicalFunction::getType() const +{ + return NAME; +} bool DivBigintTbigintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string DivBigintTbigintLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -76,7 +95,9 @@ LogicalFunction DivBigintTbigintLogicalFunction::withInferredDataType(const Sche std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -86,7 +107,9 @@ SerializableFunction DivBigintTbigintLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } diff --git a/nes-logical-operators/src/Functions/Meos/DivFloatTfloatLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/DivFloatTfloatLogicalFunction.cpp index 321d299422..631371f221 100644 --- a/nes-logical-operators/src/Functions/Meos/DivFloatTfloatLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/DivFloatTfloatLogicalFunction.cpp @@ -26,46 +26,65 @@ namespace NES { -DivFloatTfloatLogicalFunction::DivFloatTfloatLogicalFunction(LogicalFunction scalar, - LogicalFunction value, - LogicalFunction ts) +DivFloatTfloatLogicalFunction::DivFloatTfloatLogicalFunction(LogicalFunction arg0, + LogicalFunction value, + LogicalFunction ts) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(3); - parameters.push_back(std::move(scalar)); + parameters.push_back(std::move(arg0)); parameters.push_back(std::move(value)); parameters.push_back(std::move(ts)); } -DataType DivFloatTfloatLogicalFunction::getDataType() const { return dataType; } +DataType DivFloatTfloatLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction DivFloatTfloatLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector DivFloatTfloatLogicalFunction::getChildren() const { return parameters; } +std::vector DivFloatTfloatLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction DivFloatTfloatLogicalFunction::withChildren(const std::vector& children) const { PRECONDITION(children.size() == 3, "DivFloatTfloatLogicalFunction requires 3 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view DivFloatTfloatLogicalFunction::getType() const { return NAME; } +std::string_view DivFloatTfloatLogicalFunction::getType() const +{ + return NAME; +} bool DivFloatTfloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string DivFloatTfloatLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -76,7 +95,9 @@ LogicalFunction DivFloatTfloatLogicalFunction::withInferredDataType(const Schema std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -86,7 +107,9 @@ SerializableFunction DivFloatTfloatLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } diff --git a/nes-logical-operators/src/Functions/Meos/DivIntTintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/DivIntTintLogicalFunction.cpp index 5abd6ce582..e45dfdab6e 100644 --- a/nes-logical-operators/src/Functions/Meos/DivIntTintLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/DivIntTintLogicalFunction.cpp @@ -26,46 +26,65 @@ namespace NES { -DivIntTintLogicalFunction::DivIntTintLogicalFunction(LogicalFunction scalar, - LogicalFunction value, - LogicalFunction ts) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +DivIntTintLogicalFunction::DivIntTintLogicalFunction(LogicalFunction arg0, + LogicalFunction value, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) { parameters.reserve(3); - parameters.push_back(std::move(scalar)); + parameters.push_back(std::move(arg0)); parameters.push_back(std::move(value)); parameters.push_back(std::move(ts)); } -DataType DivIntTintLogicalFunction::getDataType() const { return dataType; } +DataType DivIntTintLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction DivIntTintLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector DivIntTintLogicalFunction::getChildren() const { return parameters; } +std::vector DivIntTintLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction DivIntTintLogicalFunction::withChildren(const std::vector& children) const { PRECONDITION(children.size() == 3, "DivIntTintLogicalFunction requires 3 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view DivIntTintLogicalFunction::getType() const { return NAME; } +std::string_view DivIntTintLogicalFunction::getType() const +{ + return NAME; +} bool DivIntTintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string DivIntTintLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -76,7 +95,9 @@ LogicalFunction DivIntTintLogicalFunction::withInferredDataType(const Schema& sc std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -86,7 +107,9 @@ SerializableFunction DivIntTintLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } diff --git a/nes-logical-operators/src/Functions/Meos/DivTbigintBigintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/DivTbigintBigintLogicalFunction.cpp index 3f200be7c9..125d0b2265 100644 --- a/nes-logical-operators/src/Functions/Meos/DivTbigintBigintLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/DivTbigintBigintLogicalFunction.cpp @@ -27,45 +27,64 @@ namespace NES { DivTbigintBigintLogicalFunction::DivTbigintBigintLogicalFunction(LogicalFunction value, - LogicalFunction ts, - LogicalFunction divisor) + LogicalFunction ts, + LogicalFunction arg0) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(3); parameters.push_back(std::move(value)); parameters.push_back(std::move(ts)); - parameters.push_back(std::move(divisor)); + parameters.push_back(std::move(arg0)); } -DataType DivTbigintBigintLogicalFunction::getDataType() const { return dataType; } +DataType DivTbigintBigintLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction DivTbigintBigintLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector DivTbigintBigintLogicalFunction::getChildren() const { return parameters; } +std::vector DivTbigintBigintLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction DivTbigintBigintLogicalFunction::withChildren(const std::vector& children) const { PRECONDITION(children.size() == 3, "DivTbigintBigintLogicalFunction requires 3 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view DivTbigintBigintLogicalFunction::getType() const { return NAME; } +std::string_view DivTbigintBigintLogicalFunction::getType() const +{ + return NAME; +} bool DivTbigintBigintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string DivTbigintBigintLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -76,7 +95,9 @@ LogicalFunction DivTbigintBigintLogicalFunction::withInferredDataType(const Sche std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -86,7 +107,9 @@ SerializableFunction DivTbigintBigintLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } diff --git a/nes-logical-operators/src/Functions/Meos/DivTfloatFloatLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/DivTfloatFloatLogicalFunction.cpp index a9bb9268b7..81a276450b 100644 --- a/nes-logical-operators/src/Functions/Meos/DivTfloatFloatLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/DivTfloatFloatLogicalFunction.cpp @@ -27,45 +27,64 @@ namespace NES { DivTfloatFloatLogicalFunction::DivTfloatFloatLogicalFunction(LogicalFunction value, - LogicalFunction ts, - LogicalFunction divisor) + LogicalFunction ts, + LogicalFunction arg0) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(3); parameters.push_back(std::move(value)); parameters.push_back(std::move(ts)); - parameters.push_back(std::move(divisor)); + parameters.push_back(std::move(arg0)); } -DataType DivTfloatFloatLogicalFunction::getDataType() const { return dataType; } +DataType DivTfloatFloatLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction DivTfloatFloatLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector DivTfloatFloatLogicalFunction::getChildren() const { return parameters; } +std::vector DivTfloatFloatLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction DivTfloatFloatLogicalFunction::withChildren(const std::vector& children) const { PRECONDITION(children.size() == 3, "DivTfloatFloatLogicalFunction requires 3 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view DivTfloatFloatLogicalFunction::getType() const { return NAME; } +std::string_view DivTfloatFloatLogicalFunction::getType() const +{ + return NAME; +} bool DivTfloatFloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string DivTfloatFloatLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -76,7 +95,9 @@ LogicalFunction DivTfloatFloatLogicalFunction::withInferredDataType(const Schema std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -86,7 +107,9 @@ SerializableFunction DivTfloatFloatLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } diff --git a/nes-logical-operators/src/Functions/Meos/DivTintIntLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/DivTintIntLogicalFunction.cpp index 723116937f..8424fd0fe6 100644 --- a/nes-logical-operators/src/Functions/Meos/DivTintIntLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/DivTintIntLogicalFunction.cpp @@ -27,45 +27,64 @@ namespace NES { DivTintIntLogicalFunction::DivTintIntLogicalFunction(LogicalFunction value, - LogicalFunction ts, - LogicalFunction divisor) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) + LogicalFunction ts, + LogicalFunction arg0) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) { parameters.reserve(3); parameters.push_back(std::move(value)); parameters.push_back(std::move(ts)); - parameters.push_back(std::move(divisor)); + parameters.push_back(std::move(arg0)); } -DataType DivTintIntLogicalFunction::getDataType() const { return dataType; } +DataType DivTintIntLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction DivTintIntLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector DivTintIntLogicalFunction::getChildren() const { return parameters; } +std::vector DivTintIntLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction DivTintIntLogicalFunction::withChildren(const std::vector& children) const { PRECONDITION(children.size() == 3, "DivTintIntLogicalFunction requires 3 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view DivTintIntLogicalFunction::getType() const { return NAME; } +std::string_view DivTintIntLogicalFunction::getType() const +{ + return NAME; +} bool DivTintIntLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string DivTintIntLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -76,7 +95,9 @@ LogicalFunction DivTintIntLogicalFunction::withInferredDataType(const Schema& sc std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -86,7 +107,9 @@ SerializableFunction DivTintIntLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } diff --git a/nes-logical-operators/src/Functions/Meos/DivTnumberTnumberLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/DivTnumberTnumberLogicalFunction.cpp index fc7b32aa87..769a986475 100644 --- a/nes-logical-operators/src/Functions/Meos/DivTnumberTnumberLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/DivTnumberTnumberLogicalFunction.cpp @@ -26,46 +26,63 @@ namespace NES { -DivTnumberTnumberLogicalFunction::DivTnumberTnumberLogicalFunction(LogicalFunction value1, - LogicalFunction value2, - LogicalFunction ts) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +DivTnumberTnumberLogicalFunction::DivTnumberTnumberLogicalFunction(LogicalFunction traj, + LogicalFunction arg0) + : dataType(DataTypeProvider::provideDataType(DataType::Type::VARSIZED)) { - parameters.reserve(3); - parameters.push_back(std::move(value1)); - parameters.push_back(std::move(value2)); - parameters.push_back(std::move(ts)); + parameters.reserve(2); + parameters.push_back(std::move(traj)); + parameters.push_back(std::move(arg0)); } -DataType DivTnumberTnumberLogicalFunction::getDataType() const { return dataType; } +DataType DivTnumberTnumberLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction DivTnumberTnumberLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector DivTnumberTnumberLogicalFunction::getChildren() const { return parameters; } +std::vector DivTnumberTnumberLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction DivTnumberTnumberLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 3, "DivTnumberTnumberLogicalFunction requires 3 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 2, "DivTnumberTnumberLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view DivTnumberTnumberLogicalFunction::getType() const { return NAME; } +std::string_view DivTnumberTnumberLogicalFunction::getType() const +{ + return NAME; +} bool DivTnumberTnumberLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string DivTnumberTnumberLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -76,7 +93,9 @@ LogicalFunction DivTnumberTnumberLogicalFunction::withInferredDataType(const Sch std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -86,20 +105,21 @@ SerializableFunction DivTnumberTnumberLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterDivTnumberTnumberLogicalFunction( LogicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.children.size() == 3, - "DivTnumberTnumberLogicalFunction requires 3 children but got {}", + PRECONDITION(arguments.children.size() == 2, + "DivTnumberTnumberLogicalFunction requires 2 children but got {}", arguments.children.size()); auto arg0 = std::move(arguments.children[0]); auto arg1 = std::move(arguments.children[1]); - auto arg2 = std::move(arguments.children[2]); - return DivTnumberTnumberLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); + return DivTnumberTnumberLogicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EcontainsGeoTrgeometryLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EcontainsGeoTrgeometryLogicalFunction.cpp new file mode 100644 index 0000000000..7f18fced18 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EcontainsGeoTrgeometryLogicalFunction.cpp @@ -0,0 +1,87 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EcontainsGeoTrgeometryLogicalFunction::EcontainsGeoTrgeometryLogicalFunction(LogicalFunction tgt_wkt, LogicalFunction ref_wkt, LogicalFunction x1, LogicalFunction y1, LogicalFunction theta1, LogicalFunction ts1) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(6); + parameters.push_back(std::move(tgt_wkt)); + parameters.push_back(std::move(ref_wkt)); + parameters.push_back(std::move(x1)); + parameters.push_back(std::move(y1)); + parameters.push_back(std::move(theta1)); + parameters.push_back(std::move(ts1)); +} +DataType EcontainsGeoTrgeometryLogicalFunction::getDataType() const { return dataType; } +LogicalFunction EcontainsGeoTrgeometryLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } +std::vector EcontainsGeoTrgeometryLogicalFunction::getChildren() const { return parameters; } +LogicalFunction EcontainsGeoTrgeometryLogicalFunction::withChildren(const std::vector& children) const { + PRECONDITION(children.size()==6,"EcontainsGeoTrgeometryLogicalFunction requires 6 children, but got {}",children.size()); + auto c=*this; c.parameters=children; return c; +} +std::string_view EcontainsGeoTrgeometryLogicalFunction::getType() const { return NAME; } +bool EcontainsGeoTrgeometryLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + return false; +} +std::string EcontainsGeoTrgeometryLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("{}({})",NAME,parameters[0].explain(v)); +} +LogicalFunction EcontainsGeoTrgeometryLogicalFunction::withInferredDataType(const Schema& schema) const { + std::vector c; c.reserve(6); + for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "tgt_wkt must be VARSIZED"); + INVARIANT(c[1].getDataType().isType(DataType::Type::VARSIZED), "ref_wkt must be VARSIZED"); + INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "x1 must be FLOAT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::FLOAT64), "y1 must be FLOAT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "theta1 must be FLOAT64"); + INVARIANT(c[5].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); + return withChildren(c); +} +SerializableFunction EcontainsGeoTrgeometryLogicalFunction::serialize() const { + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + return proto; +} +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEcontainsGeoTrgeometryLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size()==6, + "EcontainsGeoTrgeometryLogicalFunction requires 6 children but got {}", + arguments.children.size()); + return EcontainsGeoTrgeometryLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4]), + std::move(arguments.children[5])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EcontainsTcbufferGeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EcontainsTcbufferGeoLogicalFunction.cpp index a983252b2d..9fefbb6576 100644 --- a/nes-logical-operators/src/Functions/Meos/EcontainsTcbufferGeoLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/EcontainsTcbufferGeoLogicalFunction.cpp @@ -26,64 +26,83 @@ namespace NES { -EcontainsTcbufferGeoLogicalFunction::EcontainsTcbufferGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, - LogicalFunction radius, LogicalFunction ts, - LogicalFunction wkt) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +EcontainsTcbufferGeoLogicalFunction::EcontainsTcbufferGeoLogicalFunction(LogicalFunction lon, + LogicalFunction lat, + LogicalFunction radius, + LogicalFunction timestamp, + LogicalFunction geometry) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) { parameters.reserve(5); parameters.push_back(std::move(lon)); parameters.push_back(std::move(lat)); parameters.push_back(std::move(radius)); - parameters.push_back(std::move(ts)); - parameters.push_back(std::move(wkt)); + parameters.push_back(std::move(timestamp)); + parameters.push_back(std::move(geometry)); } -DataType EcontainsTcbufferGeoLogicalFunction::getDataType() const { return dataType; } +DataType EcontainsTcbufferGeoLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction EcontainsTcbufferGeoLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector EcontainsTcbufferGeoLogicalFunction::getChildren() const { return parameters; } +std::vector EcontainsTcbufferGeoLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction EcontainsTcbufferGeoLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 5, - "EcontainsTcbufferGeoLogicalFunction requires 5 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 5, "EcontainsTcbufferGeoLogicalFunction requires 5 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view EcontainsTcbufferGeoLogicalFunction::getType() const { return NAME; } +std::string_view EcontainsTcbufferGeoLogicalFunction::getType() const +{ + return NAME; +} bool EcontainsTcbufferGeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string EcontainsTcbufferGeoLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction EcontainsTcbufferGeoLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(5); - c.emplace_back(parameters[0].withInferredDataType(schema)); - c.emplace_back(parameters[1].withInferredDataType(schema)); - c.emplace_back(parameters[2].withInferredDataType(schema)); - c.emplace_back(parameters[3].withInferredDataType(schema)); - c.emplace_back(parameters[4].withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon must be FLOAT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat must be FLOAT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "radius must be FLOAT64"); - INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); - INVARIANT(c[4].getDataType().isType(DataType::Type::VARSIZED), "wkt must be VARCHAR"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction EcontainsTcbufferGeoLogicalFunction::serialize() const @@ -92,7 +111,9 @@ SerializableFunction EcontainsTcbufferGeoLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -102,11 +123,12 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEco PRECONDITION(arguments.children.size() == 5, "EcontainsTcbufferGeoLogicalFunction requires 5 children but got {}", arguments.children.size()); - return EcontainsTcbufferGeoLogicalFunction(std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2]), - std::move(arguments.children[3]), - std::move(arguments.children[4])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + return EcontainsTcbufferGeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EcontainsTcbufferTcbufferLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EcontainsTcbufferTcbufferLogicalFunction.cpp new file mode 100644 index 0000000000..695b38213f --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EcontainsTcbufferTcbufferLogicalFunction.cpp @@ -0,0 +1,143 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EcontainsTcbufferTcbufferLogicalFunction::EcontainsTcbufferTcbufferLogicalFunction(LogicalFunction lonA, + LogicalFunction latA, + LogicalFunction radiusA, + LogicalFunction tsA, + LogicalFunction lonB, + LogicalFunction latB, + LogicalFunction radiusB, + LogicalFunction tsB) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) +{ + parameters.reserve(8); + parameters.push_back(std::move(lonA)); + parameters.push_back(std::move(latA)); + parameters.push_back(std::move(radiusA)); + parameters.push_back(std::move(tsA)); + parameters.push_back(std::move(lonB)); + parameters.push_back(std::move(latB)); + parameters.push_back(std::move(radiusB)); + parameters.push_back(std::move(tsB)); +} + +DataType EcontainsTcbufferTcbufferLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction EcontainsTcbufferTcbufferLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector EcontainsTcbufferTcbufferLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction EcontainsTcbufferTcbufferLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 8, "EcontainsTcbufferTcbufferLogicalFunction requires 8 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; +} + +std::string_view EcontainsTcbufferTcbufferLogicalFunction::getType() const +{ + return NAME; +} + +bool EcontainsTcbufferTcbufferLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } + return false; +} + +std::string EcontainsTcbufferTcbufferLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction EcontainsTcbufferTcbufferLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); +} + +SerializableFunction EcontainsTcbufferTcbufferLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEcontainsTcbufferTcbufferLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 8, + "EcontainsTcbufferTcbufferLogicalFunction requires 8 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + auto arg5 = std::move(arguments.children[5]); + auto arg6 = std::move(arguments.children[6]); + auto arg7 = std::move(arguments.children[7]); + return EcontainsTcbufferTcbufferLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6), std::move(arg7)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EcontainsTgeoGeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EcontainsTgeoGeoLogicalFunction.cpp index a0634dd701..b98b2944e0 100644 --- a/nes-logical-operators/src/Functions/Meos/EcontainsTgeoGeoLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/EcontainsTgeoGeoLogicalFunction.cpp @@ -26,60 +26,81 @@ namespace NES { -EcontainsTgeoGeoLogicalFunction::EcontainsTgeoGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, - LogicalFunction ts, LogicalFunction wkt) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +EcontainsTgeoGeoLogicalFunction::EcontainsTgeoGeoLogicalFunction(LogicalFunction lon, + LogicalFunction lat, + LogicalFunction timestamp, + LogicalFunction geometry) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) { parameters.reserve(4); parameters.push_back(std::move(lon)); parameters.push_back(std::move(lat)); - parameters.push_back(std::move(ts)); - parameters.push_back(std::move(wkt)); + parameters.push_back(std::move(timestamp)); + parameters.push_back(std::move(geometry)); } -DataType EcontainsTgeoGeoLogicalFunction::getDataType() const { return dataType; } +DataType EcontainsTgeoGeoLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction EcontainsTgeoGeoLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector EcontainsTgeoGeoLogicalFunction::getChildren() const { return parameters; } +std::vector EcontainsTgeoGeoLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction EcontainsTgeoGeoLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 4, - "EcontainsTgeoGeoLogicalFunction requires 4 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 4, "EcontainsTgeoGeoLogicalFunction requires 4 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view EcontainsTgeoGeoLogicalFunction::getType() const { return NAME; } +std::string_view EcontainsTgeoGeoLogicalFunction::getType() const +{ + return NAME; +} bool EcontainsTgeoGeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string EcontainsTgeoGeoLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction EcontainsTgeoGeoLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(4); - c.emplace_back(parameters[0].withInferredDataType(schema)); - c.emplace_back(parameters[1].withInferredDataType(schema)); - c.emplace_back(parameters[2].withInferredDataType(schema)); - c.emplace_back(parameters[3].withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon must be FLOAT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat must be FLOAT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); - INVARIANT(c[3].getDataType().isType(DataType::Type::VARSIZED),"wkt must be VARSIZED"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction EcontainsTgeoGeoLogicalFunction::serialize() const @@ -88,7 +109,9 @@ SerializableFunction EcontainsTgeoGeoLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -98,10 +121,11 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEco PRECONDITION(arguments.children.size() == 4, "EcontainsTgeoGeoLogicalFunction requires 4 children but got {}", arguments.children.size()); - return EcontainsTgeoGeoLogicalFunction(std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2]), - std::move(arguments.children[3])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + return EcontainsTgeoGeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EcontainsTgeoTgeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EcontainsTgeoTgeoLogicalFunction.cpp index 955ec62f67..21f0c77808 100644 --- a/nes-logical-operators/src/Functions/Meos/EcontainsTgeoTgeoLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/EcontainsTgeoTgeoLogicalFunction.cpp @@ -26,61 +26,85 @@ namespace NES { -EcontainsTgeoTgeoLogicalFunction::EcontainsTgeoTgeoLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction ts1, LogicalFunction lon2, LogicalFunction lat2, LogicalFunction ts2) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +EcontainsTgeoTgeoLogicalFunction::EcontainsTgeoTgeoLogicalFunction(LogicalFunction lonA, + LogicalFunction latA, + LogicalFunction tsA, + LogicalFunction lonB, + LogicalFunction latB, + LogicalFunction tsB) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) { parameters.reserve(6); - parameters.push_back(std::move(lon1)); - parameters.push_back(std::move(lat1)); - parameters.push_back(std::move(ts1)); - parameters.push_back(std::move(lon2)); - parameters.push_back(std::move(lat2)); - parameters.push_back(std::move(ts2)); + parameters.push_back(std::move(lonA)); + parameters.push_back(std::move(latA)); + parameters.push_back(std::move(tsA)); + parameters.push_back(std::move(lonB)); + parameters.push_back(std::move(latB)); + parameters.push_back(std::move(tsB)); } -DataType EcontainsTgeoTgeoLogicalFunction::getDataType() const { return dataType; } +DataType EcontainsTgeoTgeoLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction EcontainsTgeoTgeoLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector EcontainsTgeoTgeoLogicalFunction::getChildren() const { return parameters; } +std::vector EcontainsTgeoTgeoLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction EcontainsTgeoTgeoLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 6, - "EcontainsTgeoTgeoLogicalFunction requires 6 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 6, "EcontainsTgeoTgeoLogicalFunction requires 6 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view EcontainsTgeoTgeoLogicalFunction::getType() const { return NAME; } +std::string_view EcontainsTgeoTgeoLogicalFunction::getType() const +{ + return NAME; +} bool EcontainsTgeoTgeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string EcontainsTgeoTgeoLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction EcontainsTgeoTgeoLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(6); - for (const auto& p : parameters) - c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon1 must be FLOAT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat1 must be FLOAT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); - INVARIANT(c[3].getDataType().isType(DataType::Type::FLOAT64), "lon2 must be FLOAT64"); - INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "lat2 must be FLOAT64"); - INVARIANT(c[5].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction EcontainsTgeoTgeoLogicalFunction::serialize() const @@ -89,7 +113,9 @@ SerializableFunction EcontainsTgeoTgeoLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -99,13 +125,13 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEco PRECONDITION(arguments.children.size() == 6, "EcontainsTgeoTgeoLogicalFunction requires 6 children but got {}", arguments.children.size()); - return EcontainsTgeoTgeoLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2]), - std::move(arguments.children[3]), - std::move(arguments.children[4]), - std::move(arguments.children[5])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + auto arg5 = std::move(arguments.children[5]); + return EcontainsTgeoTgeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EcoversGeoTrgeometryLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EcoversGeoTrgeometryLogicalFunction.cpp new file mode 100644 index 0000000000..4c2ab02757 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EcoversGeoTrgeometryLogicalFunction.cpp @@ -0,0 +1,87 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EcoversGeoTrgeometryLogicalFunction::EcoversGeoTrgeometryLogicalFunction(LogicalFunction tgt_wkt, LogicalFunction ref_wkt, LogicalFunction x1, LogicalFunction y1, LogicalFunction theta1, LogicalFunction ts1) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(6); + parameters.push_back(std::move(tgt_wkt)); + parameters.push_back(std::move(ref_wkt)); + parameters.push_back(std::move(x1)); + parameters.push_back(std::move(y1)); + parameters.push_back(std::move(theta1)); + parameters.push_back(std::move(ts1)); +} +DataType EcoversGeoTrgeometryLogicalFunction::getDataType() const { return dataType; } +LogicalFunction EcoversGeoTrgeometryLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } +std::vector EcoversGeoTrgeometryLogicalFunction::getChildren() const { return parameters; } +LogicalFunction EcoversGeoTrgeometryLogicalFunction::withChildren(const std::vector& children) const { + PRECONDITION(children.size()==6,"EcoversGeoTrgeometryLogicalFunction requires 6 children, but got {}",children.size()); + auto c=*this; c.parameters=children; return c; +} +std::string_view EcoversGeoTrgeometryLogicalFunction::getType() const { return NAME; } +bool EcoversGeoTrgeometryLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + return false; +} +std::string EcoversGeoTrgeometryLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("{}({})",NAME,parameters[0].explain(v)); +} +LogicalFunction EcoversGeoTrgeometryLogicalFunction::withInferredDataType(const Schema& schema) const { + std::vector c; c.reserve(6); + for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "tgt_wkt must be VARSIZED"); + INVARIANT(c[1].getDataType().isType(DataType::Type::VARSIZED), "ref_wkt must be VARSIZED"); + INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "x1 must be FLOAT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::FLOAT64), "y1 must be FLOAT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "theta1 must be FLOAT64"); + INVARIANT(c[5].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); + return withChildren(c); +} +SerializableFunction EcoversGeoTrgeometryLogicalFunction::serialize() const { + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + return proto; +} +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEcoversGeoTrgeometryLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size()==6, + "EcoversGeoTrgeometryLogicalFunction requires 6 children but got {}", + arguments.children.size()); + return EcoversGeoTrgeometryLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4]), + std::move(arguments.children[5])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EcoversTcbufferGeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EcoversTcbufferGeoLogicalFunction.cpp index cb46626800..9240106079 100644 --- a/nes-logical-operators/src/Functions/Meos/EcoversTcbufferGeoLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/EcoversTcbufferGeoLogicalFunction.cpp @@ -26,64 +26,83 @@ namespace NES { -EcoversTcbufferGeoLogicalFunction::EcoversTcbufferGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, - LogicalFunction radius, LogicalFunction ts, - LogicalFunction wkt) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +EcoversTcbufferGeoLogicalFunction::EcoversTcbufferGeoLogicalFunction(LogicalFunction lon, + LogicalFunction lat, + LogicalFunction radius, + LogicalFunction timestamp, + LogicalFunction geometry) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) { parameters.reserve(5); parameters.push_back(std::move(lon)); parameters.push_back(std::move(lat)); parameters.push_back(std::move(radius)); - parameters.push_back(std::move(ts)); - parameters.push_back(std::move(wkt)); + parameters.push_back(std::move(timestamp)); + parameters.push_back(std::move(geometry)); } -DataType EcoversTcbufferGeoLogicalFunction::getDataType() const { return dataType; } +DataType EcoversTcbufferGeoLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction EcoversTcbufferGeoLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector EcoversTcbufferGeoLogicalFunction::getChildren() const { return parameters; } +std::vector EcoversTcbufferGeoLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction EcoversTcbufferGeoLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 5, - "EcoversTcbufferGeoLogicalFunction requires 5 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 5, "EcoversTcbufferGeoLogicalFunction requires 5 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view EcoversTcbufferGeoLogicalFunction::getType() const { return NAME; } +std::string_view EcoversTcbufferGeoLogicalFunction::getType() const +{ + return NAME; +} bool EcoversTcbufferGeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string EcoversTcbufferGeoLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction EcoversTcbufferGeoLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(5); - c.emplace_back(parameters[0].withInferredDataType(schema)); - c.emplace_back(parameters[1].withInferredDataType(schema)); - c.emplace_back(parameters[2].withInferredDataType(schema)); - c.emplace_back(parameters[3].withInferredDataType(schema)); - c.emplace_back(parameters[4].withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon must be FLOAT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat must be FLOAT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "radius must be FLOAT64"); - INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); - INVARIANT(c[4].getDataType().isType(DataType::Type::VARSIZED), "wkt must be VARCHAR"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction EcoversTcbufferGeoLogicalFunction::serialize() const @@ -92,7 +111,9 @@ SerializableFunction EcoversTcbufferGeoLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -102,11 +123,12 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEco PRECONDITION(arguments.children.size() == 5, "EcoversTcbufferGeoLogicalFunction requires 5 children but got {}", arguments.children.size()); - return EcoversTcbufferGeoLogicalFunction(std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2]), - std::move(arguments.children[3]), - std::move(arguments.children[4])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + return EcoversTcbufferGeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EcoversTcbufferTcbufferLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EcoversTcbufferTcbufferLogicalFunction.cpp index 8318ad7d09..7c12723ac4 100644 --- a/nes-logical-operators/src/Functions/Meos/EcoversTcbufferTcbufferLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/EcoversTcbufferTcbufferLogicalFunction.cpp @@ -26,67 +26,89 @@ namespace NES { -EcoversTcbufferTcbufferLogicalFunction::EcoversTcbufferTcbufferLogicalFunction( - LogicalFunction lon1, LogicalFunction lat1, LogicalFunction r1, LogicalFunction ts1, - LogicalFunction lon2, LogicalFunction lat2, LogicalFunction r2, LogicalFunction ts2) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +EcoversTcbufferTcbufferLogicalFunction::EcoversTcbufferTcbufferLogicalFunction(LogicalFunction lonA, + LogicalFunction latA, + LogicalFunction radiusA, + LogicalFunction tsA, + LogicalFunction lonB, + LogicalFunction latB, + LogicalFunction radiusB, + LogicalFunction tsB) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) { parameters.reserve(8); - parameters.push_back(std::move(lon1)); - parameters.push_back(std::move(lat1)); - parameters.push_back(std::move(r1)); - parameters.push_back(std::move(ts1)); - parameters.push_back(std::move(lon2)); - parameters.push_back(std::move(lat2)); - parameters.push_back(std::move(r2)); - parameters.push_back(std::move(ts2)); + parameters.push_back(std::move(lonA)); + parameters.push_back(std::move(latA)); + parameters.push_back(std::move(radiusA)); + parameters.push_back(std::move(tsA)); + parameters.push_back(std::move(lonB)); + parameters.push_back(std::move(latB)); + parameters.push_back(std::move(radiusB)); + parameters.push_back(std::move(tsB)); } -DataType EcoversTcbufferTcbufferLogicalFunction::getDataType() const { return dataType; } +DataType EcoversTcbufferTcbufferLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction EcoversTcbufferTcbufferLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector EcoversTcbufferTcbufferLogicalFunction::getChildren() const { return parameters; } +std::vector EcoversTcbufferTcbufferLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction EcoversTcbufferTcbufferLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 8, - "EcoversTcbufferTcbufferLogicalFunction requires 8 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 8, "EcoversTcbufferTcbufferLogicalFunction requires 8 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view EcoversTcbufferTcbufferLogicalFunction::getType() const { return NAME; } +std::string_view EcoversTcbufferTcbufferLogicalFunction::getType() const +{ + return NAME; +} bool EcoversTcbufferTcbufferLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string EcoversTcbufferTcbufferLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction EcoversTcbufferTcbufferLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(8); - for (const auto& p : parameters) - c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon1 must be FLOAT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat1 must be FLOAT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "r1 must be FLOAT64"); - INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); - INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "lon2 must be FLOAT64"); - INVARIANT(c[5].getDataType().isType(DataType::Type::FLOAT64), "lat2 must be FLOAT64"); - INVARIANT(c[6].getDataType().isType(DataType::Type::FLOAT64), "r2 must be FLOAT64"); - INVARIANT(c[7].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction EcoversTcbufferTcbufferLogicalFunction::serialize() const @@ -95,7 +117,9 @@ SerializableFunction EcoversTcbufferTcbufferLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -105,14 +129,15 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEco PRECONDITION(arguments.children.size() == 8, "EcoversTcbufferTcbufferLogicalFunction requires 8 children but got {}", arguments.children.size()); - return EcoversTcbufferTcbufferLogicalFunction(std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2]), - std::move(arguments.children[3]), - std::move(arguments.children[4]), - std::move(arguments.children[5]), - std::move(arguments.children[6]), - std::move(arguments.children[7])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + auto arg5 = std::move(arguments.children[5]); + auto arg6 = std::move(arguments.children[6]); + auto arg7 = std::move(arguments.children[7]); + return EcoversTcbufferTcbufferLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6), std::move(arg7)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EcoversTgeoGeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EcoversTgeoGeoLogicalFunction.cpp new file mode 100644 index 0000000000..6d94e17a84 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EcoversTgeoGeoLogicalFunction.cpp @@ -0,0 +1,131 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EcoversTgeoGeoLogicalFunction::EcoversTgeoGeoLogicalFunction(LogicalFunction lon, + LogicalFunction lat, + LogicalFunction timestamp, + LogicalFunction geometry) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) +{ + parameters.reserve(4); + parameters.push_back(std::move(lon)); + parameters.push_back(std::move(lat)); + parameters.push_back(std::move(timestamp)); + parameters.push_back(std::move(geometry)); +} + +DataType EcoversTgeoGeoLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction EcoversTgeoGeoLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector EcoversTgeoGeoLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction EcoversTgeoGeoLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 4, "EcoversTgeoGeoLogicalFunction requires 4 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; +} + +std::string_view EcoversTgeoGeoLogicalFunction::getType() const +{ + return NAME; +} + +bool EcoversTgeoGeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } + return false; +} + +std::string EcoversTgeoGeoLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction EcoversTgeoGeoLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); +} + +SerializableFunction EcoversTgeoGeoLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEcoversTgeoGeoLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 4, + "EcoversTgeoGeoLogicalFunction requires 4 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + return EcoversTgeoGeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EcoversTgeoTgeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EcoversTgeoTgeoLogicalFunction.cpp index f060447b1a..941cc2bbf7 100644 --- a/nes-logical-operators/src/Functions/Meos/EcoversTgeoTgeoLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/EcoversTgeoTgeoLogicalFunction.cpp @@ -26,61 +26,85 @@ namespace NES { -EcoversTgeoTgeoLogicalFunction::EcoversTgeoTgeoLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction ts1, LogicalFunction lon2, LogicalFunction lat2, LogicalFunction ts2) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +EcoversTgeoTgeoLogicalFunction::EcoversTgeoTgeoLogicalFunction(LogicalFunction lonA, + LogicalFunction latA, + LogicalFunction tsA, + LogicalFunction lonB, + LogicalFunction latB, + LogicalFunction tsB) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) { parameters.reserve(6); - parameters.push_back(std::move(lon1)); - parameters.push_back(std::move(lat1)); - parameters.push_back(std::move(ts1)); - parameters.push_back(std::move(lon2)); - parameters.push_back(std::move(lat2)); - parameters.push_back(std::move(ts2)); + parameters.push_back(std::move(lonA)); + parameters.push_back(std::move(latA)); + parameters.push_back(std::move(tsA)); + parameters.push_back(std::move(lonB)); + parameters.push_back(std::move(latB)); + parameters.push_back(std::move(tsB)); } -DataType EcoversTgeoTgeoLogicalFunction::getDataType() const { return dataType; } +DataType EcoversTgeoTgeoLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction EcoversTgeoTgeoLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector EcoversTgeoTgeoLogicalFunction::getChildren() const { return parameters; } +std::vector EcoversTgeoTgeoLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction EcoversTgeoTgeoLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 6, - "EcoversTgeoTgeoLogicalFunction requires 6 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 6, "EcoversTgeoTgeoLogicalFunction requires 6 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view EcoversTgeoTgeoLogicalFunction::getType() const { return NAME; } +std::string_view EcoversTgeoTgeoLogicalFunction::getType() const +{ + return NAME; +} bool EcoversTgeoTgeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string EcoversTgeoTgeoLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction EcoversTgeoTgeoLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(6); - for (const auto& p : parameters) - c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon1 must be FLOAT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat1 must be FLOAT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); - INVARIANT(c[3].getDataType().isType(DataType::Type::FLOAT64), "lon2 must be FLOAT64"); - INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "lat2 must be FLOAT64"); - INVARIANT(c[5].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction EcoversTgeoTgeoLogicalFunction::serialize() const @@ -89,7 +113,9 @@ SerializableFunction EcoversTgeoTgeoLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -99,13 +125,13 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEco PRECONDITION(arguments.children.size() == 6, "EcoversTgeoTgeoLogicalFunction requires 6 children but got {}", arguments.children.size()); - return EcoversTgeoTgeoLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2]), - std::move(arguments.children[3]), - std::move(arguments.children[4]), - std::move(arguments.children[5])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + auto arg5 = std::move(arguments.children[5]); + return EcoversTgeoTgeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EcoversTrgeometryGeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EcoversTrgeometryGeoLogicalFunction.cpp new file mode 100644 index 0000000000..0c7e3e5a6c --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EcoversTrgeometryGeoLogicalFunction.cpp @@ -0,0 +1,87 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EcoversTrgeometryGeoLogicalFunction::EcoversTrgeometryGeoLogicalFunction(LogicalFunction ref_wkt, LogicalFunction x1, LogicalFunction y1, LogicalFunction theta1, LogicalFunction ts1, LogicalFunction tgt_wkt) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(6); + parameters.push_back(std::move(ref_wkt)); + parameters.push_back(std::move(x1)); + parameters.push_back(std::move(y1)); + parameters.push_back(std::move(theta1)); + parameters.push_back(std::move(ts1)); + parameters.push_back(std::move(tgt_wkt)); +} +DataType EcoversTrgeometryGeoLogicalFunction::getDataType() const { return dataType; } +LogicalFunction EcoversTrgeometryGeoLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } +std::vector EcoversTrgeometryGeoLogicalFunction::getChildren() const { return parameters; } +LogicalFunction EcoversTrgeometryGeoLogicalFunction::withChildren(const std::vector& children) const { + PRECONDITION(children.size()==6,"EcoversTrgeometryGeoLogicalFunction requires 6 children, but got {}",children.size()); + auto c=*this; c.parameters=children; return c; +} +std::string_view EcoversTrgeometryGeoLogicalFunction::getType() const { return NAME; } +bool EcoversTrgeometryGeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + return false; +} +std::string EcoversTrgeometryGeoLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("{}({})",NAME,parameters[0].explain(v)); +} +LogicalFunction EcoversTrgeometryGeoLogicalFunction::withInferredDataType(const Schema& schema) const { + std::vector c; c.reserve(6); + for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "ref_wkt must be VARSIZED"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "x1 must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "y1 must be FLOAT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::FLOAT64), "theta1 must be FLOAT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); + INVARIANT(c[5].getDataType().isType(DataType::Type::VARSIZED), "tgt_wkt must be VARSIZED"); + return withChildren(c); +} +SerializableFunction EcoversTrgeometryGeoLogicalFunction::serialize() const { + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + return proto; +} +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEcoversTrgeometryGeoLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size()==6, + "EcoversTrgeometryGeoLogicalFunction requires 6 children but got {}", + arguments.children.size()); + return EcoversTrgeometryGeoLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4]), + std::move(arguments.children[5])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EdisjointTcbufferGeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EdisjointTcbufferGeoLogicalFunction.cpp index ea79c9acda..47a7b04f63 100644 --- a/nes-logical-operators/src/Functions/Meos/EdisjointTcbufferGeoLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/EdisjointTcbufferGeoLogicalFunction.cpp @@ -26,64 +26,83 @@ namespace NES { -EdisjointTcbufferGeoLogicalFunction::EdisjointTcbufferGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, - LogicalFunction radius, LogicalFunction ts, - LogicalFunction wkt) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +EdisjointTcbufferGeoLogicalFunction::EdisjointTcbufferGeoLogicalFunction(LogicalFunction lon, + LogicalFunction lat, + LogicalFunction radius, + LogicalFunction timestamp, + LogicalFunction geometry) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) { parameters.reserve(5); parameters.push_back(std::move(lon)); parameters.push_back(std::move(lat)); parameters.push_back(std::move(radius)); - parameters.push_back(std::move(ts)); - parameters.push_back(std::move(wkt)); + parameters.push_back(std::move(timestamp)); + parameters.push_back(std::move(geometry)); } -DataType EdisjointTcbufferGeoLogicalFunction::getDataType() const { return dataType; } +DataType EdisjointTcbufferGeoLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction EdisjointTcbufferGeoLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector EdisjointTcbufferGeoLogicalFunction::getChildren() const { return parameters; } +std::vector EdisjointTcbufferGeoLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction EdisjointTcbufferGeoLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 5, - "EdisjointTcbufferGeoLogicalFunction requires 5 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 5, "EdisjointTcbufferGeoLogicalFunction requires 5 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view EdisjointTcbufferGeoLogicalFunction::getType() const { return NAME; } +std::string_view EdisjointTcbufferGeoLogicalFunction::getType() const +{ + return NAME; +} bool EdisjointTcbufferGeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string EdisjointTcbufferGeoLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction EdisjointTcbufferGeoLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(5); - c.emplace_back(parameters[0].withInferredDataType(schema)); - c.emplace_back(parameters[1].withInferredDataType(schema)); - c.emplace_back(parameters[2].withInferredDataType(schema)); - c.emplace_back(parameters[3].withInferredDataType(schema)); - c.emplace_back(parameters[4].withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon must be FLOAT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat must be FLOAT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "radius must be FLOAT64"); - INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); - INVARIANT(c[4].getDataType().isType(DataType::Type::VARSIZED), "wkt must be VARCHAR"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction EdisjointTcbufferGeoLogicalFunction::serialize() const @@ -92,7 +111,9 @@ SerializableFunction EdisjointTcbufferGeoLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -102,11 +123,12 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEdi PRECONDITION(arguments.children.size() == 5, "EdisjointTcbufferGeoLogicalFunction requires 5 children but got {}", arguments.children.size()); - return EdisjointTcbufferGeoLogicalFunction(std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2]), - std::move(arguments.children[3]), - std::move(arguments.children[4])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + return EdisjointTcbufferGeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EdisjointTcbufferTcbufferLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EdisjointTcbufferTcbufferLogicalFunction.cpp new file mode 100644 index 0000000000..b726ae1e3e --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EdisjointTcbufferTcbufferLogicalFunction.cpp @@ -0,0 +1,143 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EdisjointTcbufferTcbufferLogicalFunction::EdisjointTcbufferTcbufferLogicalFunction(LogicalFunction lonA, + LogicalFunction latA, + LogicalFunction radiusA, + LogicalFunction tsA, + LogicalFunction lonB, + LogicalFunction latB, + LogicalFunction radiusB, + LogicalFunction tsB) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) +{ + parameters.reserve(8); + parameters.push_back(std::move(lonA)); + parameters.push_back(std::move(latA)); + parameters.push_back(std::move(radiusA)); + parameters.push_back(std::move(tsA)); + parameters.push_back(std::move(lonB)); + parameters.push_back(std::move(latB)); + parameters.push_back(std::move(radiusB)); + parameters.push_back(std::move(tsB)); +} + +DataType EdisjointTcbufferTcbufferLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction EdisjointTcbufferTcbufferLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector EdisjointTcbufferTcbufferLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction EdisjointTcbufferTcbufferLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 8, "EdisjointTcbufferTcbufferLogicalFunction requires 8 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; +} + +std::string_view EdisjointTcbufferTcbufferLogicalFunction::getType() const +{ + return NAME; +} + +bool EdisjointTcbufferTcbufferLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } + return false; +} + +std::string EdisjointTcbufferTcbufferLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction EdisjointTcbufferTcbufferLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); +} + +SerializableFunction EdisjointTcbufferTcbufferLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEdisjointTcbufferTcbufferLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 8, + "EdisjointTcbufferTcbufferLogicalFunction requires 8 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + auto arg5 = std::move(arguments.children[5]); + auto arg6 = std::move(arguments.children[6]); + auto arg7 = std::move(arguments.children[7]); + return EdisjointTcbufferTcbufferLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6), std::move(arg7)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EdisjointTgeoGeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EdisjointTgeoGeoLogicalFunction.cpp new file mode 100644 index 0000000000..abc58472b6 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EdisjointTgeoGeoLogicalFunction.cpp @@ -0,0 +1,131 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EdisjointTgeoGeoLogicalFunction::EdisjointTgeoGeoLogicalFunction(LogicalFunction lon, + LogicalFunction lat, + LogicalFunction timestamp, + LogicalFunction geometry) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) +{ + parameters.reserve(4); + parameters.push_back(std::move(lon)); + parameters.push_back(std::move(lat)); + parameters.push_back(std::move(timestamp)); + parameters.push_back(std::move(geometry)); +} + +DataType EdisjointTgeoGeoLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction EdisjointTgeoGeoLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector EdisjointTgeoGeoLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction EdisjointTgeoGeoLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 4, "EdisjointTgeoGeoLogicalFunction requires 4 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; +} + +std::string_view EdisjointTgeoGeoLogicalFunction::getType() const +{ + return NAME; +} + +bool EdisjointTgeoGeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } + return false; +} + +std::string EdisjointTgeoGeoLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction EdisjointTgeoGeoLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); +} + +SerializableFunction EdisjointTgeoGeoLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEdisjointTgeoGeoLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 4, + "EdisjointTgeoGeoLogicalFunction requires 4 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + return EdisjointTgeoGeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EdisjointTgeoTgeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EdisjointTgeoTgeoLogicalFunction.cpp index 157a6a264a..6b82563efa 100644 --- a/nes-logical-operators/src/Functions/Meos/EdisjointTgeoTgeoLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/EdisjointTgeoTgeoLogicalFunction.cpp @@ -26,61 +26,85 @@ namespace NES { -EdisjointTgeoTgeoLogicalFunction::EdisjointTgeoTgeoLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction ts1, LogicalFunction lon2, LogicalFunction lat2, LogicalFunction ts2) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +EdisjointTgeoTgeoLogicalFunction::EdisjointTgeoTgeoLogicalFunction(LogicalFunction lonA, + LogicalFunction latA, + LogicalFunction tsA, + LogicalFunction lonB, + LogicalFunction latB, + LogicalFunction tsB) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) { parameters.reserve(6); - parameters.push_back(std::move(lon1)); - parameters.push_back(std::move(lat1)); - parameters.push_back(std::move(ts1)); - parameters.push_back(std::move(lon2)); - parameters.push_back(std::move(lat2)); - parameters.push_back(std::move(ts2)); + parameters.push_back(std::move(lonA)); + parameters.push_back(std::move(latA)); + parameters.push_back(std::move(tsA)); + parameters.push_back(std::move(lonB)); + parameters.push_back(std::move(latB)); + parameters.push_back(std::move(tsB)); } -DataType EdisjointTgeoTgeoLogicalFunction::getDataType() const { return dataType; } +DataType EdisjointTgeoTgeoLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction EdisjointTgeoTgeoLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector EdisjointTgeoTgeoLogicalFunction::getChildren() const { return parameters; } +std::vector EdisjointTgeoTgeoLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction EdisjointTgeoTgeoLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 6, - "EdisjointTgeoTgeoLogicalFunction requires 6 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 6, "EdisjointTgeoTgeoLogicalFunction requires 6 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view EdisjointTgeoTgeoLogicalFunction::getType() const { return NAME; } +std::string_view EdisjointTgeoTgeoLogicalFunction::getType() const +{ + return NAME; +} bool EdisjointTgeoTgeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string EdisjointTgeoTgeoLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction EdisjointTgeoTgeoLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(6); - for (const auto& p : parameters) - c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon1 must be FLOAT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat1 must be FLOAT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); - INVARIANT(c[3].getDataType().isType(DataType::Type::FLOAT64), "lon2 must be FLOAT64"); - INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "lat2 must be FLOAT64"); - INVARIANT(c[5].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction EdisjointTgeoTgeoLogicalFunction::serialize() const @@ -89,7 +113,9 @@ SerializableFunction EdisjointTgeoTgeoLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -99,13 +125,13 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEdi PRECONDITION(arguments.children.size() == 6, "EdisjointTgeoTgeoLogicalFunction requires 6 children but got {}", arguments.children.size()); - return EdisjointTgeoTgeoLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2]), - std::move(arguments.children[3]), - std::move(arguments.children[4]), - std::move(arguments.children[5])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + auto arg5 = std::move(arguments.children[5]); + return EdisjointTgeoTgeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EdisjointTrgeometryGeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EdisjointTrgeometryGeoLogicalFunction.cpp new file mode 100644 index 0000000000..50158a3c09 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EdisjointTrgeometryGeoLogicalFunction.cpp @@ -0,0 +1,87 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EdisjointTrgeometryGeoLogicalFunction::EdisjointTrgeometryGeoLogicalFunction(LogicalFunction ref_wkt, LogicalFunction x1, LogicalFunction y1, LogicalFunction theta1, LogicalFunction ts1, LogicalFunction tgt_wkt) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(6); + parameters.push_back(std::move(ref_wkt)); + parameters.push_back(std::move(x1)); + parameters.push_back(std::move(y1)); + parameters.push_back(std::move(theta1)); + parameters.push_back(std::move(ts1)); + parameters.push_back(std::move(tgt_wkt)); +} +DataType EdisjointTrgeometryGeoLogicalFunction::getDataType() const { return dataType; } +LogicalFunction EdisjointTrgeometryGeoLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } +std::vector EdisjointTrgeometryGeoLogicalFunction::getChildren() const { return parameters; } +LogicalFunction EdisjointTrgeometryGeoLogicalFunction::withChildren(const std::vector& children) const { + PRECONDITION(children.size()==6,"EdisjointTrgeometryGeoLogicalFunction requires 6 children, but got {}",children.size()); + auto c=*this; c.parameters=children; return c; +} +std::string_view EdisjointTrgeometryGeoLogicalFunction::getType() const { return NAME; } +bool EdisjointTrgeometryGeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + return false; +} +std::string EdisjointTrgeometryGeoLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("{}({})",NAME,parameters[0].explain(v)); +} +LogicalFunction EdisjointTrgeometryGeoLogicalFunction::withInferredDataType(const Schema& schema) const { + std::vector c; c.reserve(6); + for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "ref_wkt must be VARSIZED"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "x1 must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "y1 must be FLOAT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::FLOAT64), "theta1 must be FLOAT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); + INVARIANT(c[5].getDataType().isType(DataType::Type::VARSIZED), "tgt_wkt must be VARSIZED"); + return withChildren(c); +} +SerializableFunction EdisjointTrgeometryGeoLogicalFunction::serialize() const { + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + return proto; +} +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEdisjointTrgeometryGeoLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size()==6, + "EdisjointTrgeometryGeoLogicalFunction requires 6 children but got {}", + arguments.children.size()); + return EdisjointTrgeometryGeoLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4]), + std::move(arguments.children[5])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EdisjointTrgeometryTrgeometryLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EdisjointTrgeometryTrgeometryLogicalFunction.cpp new file mode 100644 index 0000000000..58be13e487 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EdisjointTrgeometryTrgeometryLogicalFunction.cpp @@ -0,0 +1,99 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EdisjointTrgeometryTrgeometryLogicalFunction::EdisjointTrgeometryTrgeometryLogicalFunction(LogicalFunction ref1_wkt, LogicalFunction x1, LogicalFunction y1, LogicalFunction theta1, LogicalFunction ts1, LogicalFunction ref2_wkt, LogicalFunction x2, LogicalFunction y2, LogicalFunction theta2, LogicalFunction ts2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(10); + parameters.push_back(std::move(ref1_wkt)); + parameters.push_back(std::move(x1)); + parameters.push_back(std::move(y1)); + parameters.push_back(std::move(theta1)); + parameters.push_back(std::move(ts1)); + parameters.push_back(std::move(ref2_wkt)); + parameters.push_back(std::move(x2)); + parameters.push_back(std::move(y2)); + parameters.push_back(std::move(theta2)); + parameters.push_back(std::move(ts2)); +} +DataType EdisjointTrgeometryTrgeometryLogicalFunction::getDataType() const { return dataType; } +LogicalFunction EdisjointTrgeometryTrgeometryLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } +std::vector EdisjointTrgeometryTrgeometryLogicalFunction::getChildren() const { return parameters; } +LogicalFunction EdisjointTrgeometryTrgeometryLogicalFunction::withChildren(const std::vector& children) const { + PRECONDITION(children.size()==10,"EdisjointTrgeometryTrgeometryLogicalFunction requires 10 children, but got {}",children.size()); + auto c=*this; c.parameters=children; return c; +} +std::string_view EdisjointTrgeometryTrgeometryLogicalFunction::getType() const { return NAME; } +bool EdisjointTrgeometryTrgeometryLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + return false; +} +std::string EdisjointTrgeometryTrgeometryLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("{}({})",NAME,parameters[0].explain(v)); +} +LogicalFunction EdisjointTrgeometryTrgeometryLogicalFunction::withInferredDataType(const Schema& schema) const { + std::vector c; c.reserve(10); + for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "ref1_wkt must be VARSIZED"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "x1 must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "y1 must be FLOAT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::FLOAT64), "theta1 must be FLOAT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); + INVARIANT(c[5].getDataType().isType(DataType::Type::VARSIZED), "ref2_wkt must be VARSIZED"); + INVARIANT(c[6].getDataType().isType(DataType::Type::FLOAT64), "x2 must be FLOAT64"); + INVARIANT(c[7].getDataType().isType(DataType::Type::FLOAT64), "y2 must be FLOAT64"); + INVARIANT(c[8].getDataType().isType(DataType::Type::FLOAT64), "theta2 must be FLOAT64"); + INVARIANT(c[9].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); + return withChildren(c); +} +SerializableFunction EdisjointTrgeometryTrgeometryLogicalFunction::serialize() const { + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + return proto; +} +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEdisjointTrgeometryTrgeometryLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size()==10, + "EdisjointTrgeometryTrgeometryLogicalFunction requires 10 children but got {}", + arguments.children.size()); + return EdisjointTrgeometryTrgeometryLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4]), + std::move(arguments.children[5]), + std::move(arguments.children[6]), + std::move(arguments.children[7]), + std::move(arguments.children[8]), + std::move(arguments.children[9])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EdwithinTcbufferCbufferLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EdwithinTcbufferCbufferLogicalFunction.cpp new file mode 100644 index 0000000000..18c244d549 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EdwithinTcbufferCbufferLogicalFunction.cpp @@ -0,0 +1,137 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EdwithinTcbufferCbufferLogicalFunction::EdwithinTcbufferCbufferLogicalFunction(LogicalFunction lon, + LogicalFunction lat, + LogicalFunction radius, + LogicalFunction timestamp, + LogicalFunction cbufLit, + LogicalFunction dist) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) +{ + parameters.reserve(6); + parameters.push_back(std::move(lon)); + parameters.push_back(std::move(lat)); + parameters.push_back(std::move(radius)); + parameters.push_back(std::move(timestamp)); + parameters.push_back(std::move(cbufLit)); + parameters.push_back(std::move(dist)); +} + +DataType EdwithinTcbufferCbufferLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction EdwithinTcbufferCbufferLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector EdwithinTcbufferCbufferLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction EdwithinTcbufferCbufferLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 6, "EdwithinTcbufferCbufferLogicalFunction requires 6 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; +} + +std::string_view EdwithinTcbufferCbufferLogicalFunction::getType() const +{ + return NAME; +} + +bool EdwithinTcbufferCbufferLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } + return false; +} + +std::string EdwithinTcbufferCbufferLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction EdwithinTcbufferCbufferLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); +} + +SerializableFunction EdwithinTcbufferCbufferLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEdwithinTcbufferCbufferLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 6, + "EdwithinTcbufferCbufferLogicalFunction requires 6 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + auto arg5 = std::move(arguments.children[5]); + return EdwithinTcbufferCbufferLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EdwithinTcbufferGeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EdwithinTcbufferGeoLogicalFunction.cpp index a918723e2f..4dd5708103 100644 --- a/nes-logical-operators/src/Functions/Meos/EdwithinTcbufferGeoLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/EdwithinTcbufferGeoLogicalFunction.cpp @@ -26,67 +26,85 @@ namespace NES { -EdwithinTcbufferGeoLogicalFunction::EdwithinTcbufferGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, - LogicalFunction radius, LogicalFunction ts, - LogicalFunction wkt, LogicalFunction dist) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +EdwithinTcbufferGeoLogicalFunction::EdwithinTcbufferGeoLogicalFunction(LogicalFunction lon, + LogicalFunction lat, + LogicalFunction radius, + LogicalFunction timestamp, + LogicalFunction geometry, + LogicalFunction dist) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) { parameters.reserve(6); parameters.push_back(std::move(lon)); parameters.push_back(std::move(lat)); parameters.push_back(std::move(radius)); - parameters.push_back(std::move(ts)); - parameters.push_back(std::move(wkt)); + parameters.push_back(std::move(timestamp)); + parameters.push_back(std::move(geometry)); parameters.push_back(std::move(dist)); } -DataType EdwithinTcbufferGeoLogicalFunction::getDataType() const { return dataType; } +DataType EdwithinTcbufferGeoLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction EdwithinTcbufferGeoLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector EdwithinTcbufferGeoLogicalFunction::getChildren() const { return parameters; } +std::vector EdwithinTcbufferGeoLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction EdwithinTcbufferGeoLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 6, - "EdwithinTcbufferGeoLogicalFunction requires 6 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 6, "EdwithinTcbufferGeoLogicalFunction requires 6 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view EdwithinTcbufferGeoLogicalFunction::getType() const { return NAME; } +std::string_view EdwithinTcbufferGeoLogicalFunction::getType() const +{ + return NAME; +} bool EdwithinTcbufferGeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string EdwithinTcbufferGeoLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction EdwithinTcbufferGeoLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(6); - c.emplace_back(parameters[0].withInferredDataType(schema)); - c.emplace_back(parameters[1].withInferredDataType(schema)); - c.emplace_back(parameters[2].withInferredDataType(schema)); - c.emplace_back(parameters[3].withInferredDataType(schema)); - c.emplace_back(parameters[4].withInferredDataType(schema)); - c.emplace_back(parameters[5].withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon must be FLOAT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat must be FLOAT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "radius must be FLOAT64"); - INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); - INVARIANT(c[4].getDataType().isType(DataType::Type::VARSIZED), "wkt must be VARCHAR"); - INVARIANT(c[5].getDataType().isType(DataType::Type::FLOAT64), "dist must be FLOAT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction EdwithinTcbufferGeoLogicalFunction::serialize() const @@ -95,7 +113,9 @@ SerializableFunction EdwithinTcbufferGeoLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -105,12 +125,13 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEdw PRECONDITION(arguments.children.size() == 6, "EdwithinTcbufferGeoLogicalFunction requires 6 children but got {}", arguments.children.size()); - return EdwithinTcbufferGeoLogicalFunction(std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2]), - std::move(arguments.children[3]), - std::move(arguments.children[4]), - std::move(arguments.children[5])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + auto arg5 = std::move(arguments.children[5]); + return EdwithinTcbufferGeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EdwithinTcbufferTcbufferLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EdwithinTcbufferTcbufferLogicalFunction.cpp index ec7a29673a..a831104e2a 100644 --- a/nes-logical-operators/src/Functions/Meos/EdwithinTcbufferTcbufferLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/EdwithinTcbufferTcbufferLogicalFunction.cpp @@ -26,70 +26,91 @@ namespace NES { -EdwithinTcbufferTcbufferLogicalFunction::EdwithinTcbufferTcbufferLogicalFunction( - LogicalFunction lon1, LogicalFunction lat1, LogicalFunction r1, LogicalFunction ts1, - LogicalFunction lon2, LogicalFunction lat2, LogicalFunction r2, LogicalFunction ts2, - LogicalFunction dist) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +EdwithinTcbufferTcbufferLogicalFunction::EdwithinTcbufferTcbufferLogicalFunction(LogicalFunction lonA, + LogicalFunction latA, + LogicalFunction radiusA, + LogicalFunction tsA, + LogicalFunction lonB, + LogicalFunction latB, + LogicalFunction radiusB, + LogicalFunction tsB, + LogicalFunction dist) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) { parameters.reserve(9); - parameters.push_back(std::move(lon1)); - parameters.push_back(std::move(lat1)); - parameters.push_back(std::move(r1)); - parameters.push_back(std::move(ts1)); - parameters.push_back(std::move(lon2)); - parameters.push_back(std::move(lat2)); - parameters.push_back(std::move(r2)); - parameters.push_back(std::move(ts2)); + parameters.push_back(std::move(lonA)); + parameters.push_back(std::move(latA)); + parameters.push_back(std::move(radiusA)); + parameters.push_back(std::move(tsA)); + parameters.push_back(std::move(lonB)); + parameters.push_back(std::move(latB)); + parameters.push_back(std::move(radiusB)); + parameters.push_back(std::move(tsB)); parameters.push_back(std::move(dist)); } -DataType EdwithinTcbufferTcbufferLogicalFunction::getDataType() const { return dataType; } +DataType EdwithinTcbufferTcbufferLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction EdwithinTcbufferTcbufferLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector EdwithinTcbufferTcbufferLogicalFunction::getChildren() const { return parameters; } +std::vector EdwithinTcbufferTcbufferLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction EdwithinTcbufferTcbufferLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 9, - "EdwithinTcbufferTcbufferLogicalFunction requires 9 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 9, "EdwithinTcbufferTcbufferLogicalFunction requires 9 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view EdwithinTcbufferTcbufferLogicalFunction::getType() const { return NAME; } +std::string_view EdwithinTcbufferTcbufferLogicalFunction::getType() const +{ + return NAME; +} bool EdwithinTcbufferTcbufferLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string EdwithinTcbufferTcbufferLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction EdwithinTcbufferTcbufferLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(9); - for (const auto& p : parameters) - c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon1 must be FLOAT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat1 must be FLOAT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "r1 must be FLOAT64"); - INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); - INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "lon2 must be FLOAT64"); - INVARIANT(c[5].getDataType().isType(DataType::Type::FLOAT64), "lat2 must be FLOAT64"); - INVARIANT(c[6].getDataType().isType(DataType::Type::FLOAT64), "r2 must be FLOAT64"); - INVARIANT(c[7].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); - INVARIANT(c[8].getDataType().isType(DataType::Type::FLOAT64), "dist must be FLOAT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction EdwithinTcbufferTcbufferLogicalFunction::serialize() const @@ -98,7 +119,9 @@ SerializableFunction EdwithinTcbufferTcbufferLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -108,15 +131,16 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEdw PRECONDITION(arguments.children.size() == 9, "EdwithinTcbufferTcbufferLogicalFunction requires 9 children but got {}", arguments.children.size()); - return EdwithinTcbufferTcbufferLogicalFunction(std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2]), - std::move(arguments.children[3]), - std::move(arguments.children[4]), - std::move(arguments.children[5]), - std::move(arguments.children[6]), - std::move(arguments.children[7]), - std::move(arguments.children[8])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + auto arg5 = std::move(arguments.children[5]); + auto arg6 = std::move(arguments.children[6]); + auto arg7 = std::move(arguments.children[7]); + auto arg8 = std::move(arguments.children[8]); + return EdwithinTcbufferTcbufferLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6), std::move(arg7), std::move(arg8)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EdwithinTgeoGeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EdwithinTgeoGeoLogicalFunction.cpp new file mode 100644 index 0000000000..60e4cdff41 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EdwithinTgeoGeoLogicalFunction.cpp @@ -0,0 +1,134 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EdwithinTgeoGeoLogicalFunction::EdwithinTgeoGeoLogicalFunction(LogicalFunction lon, + LogicalFunction lat, + LogicalFunction timestamp, + LogicalFunction geometry, + LogicalFunction dist) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) +{ + parameters.reserve(5); + parameters.push_back(std::move(lon)); + parameters.push_back(std::move(lat)); + parameters.push_back(std::move(timestamp)); + parameters.push_back(std::move(geometry)); + parameters.push_back(std::move(dist)); +} + +DataType EdwithinTgeoGeoLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction EdwithinTgeoGeoLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector EdwithinTgeoGeoLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction EdwithinTgeoGeoLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 5, "EdwithinTgeoGeoLogicalFunction requires 5 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; +} + +std::string_view EdwithinTgeoGeoLogicalFunction::getType() const +{ + return NAME; +} + +bool EdwithinTgeoGeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } + return false; +} + +std::string EdwithinTgeoGeoLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction EdwithinTgeoGeoLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); +} + +SerializableFunction EdwithinTgeoGeoLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEdwithinTgeoGeoLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 5, + "EdwithinTgeoGeoLogicalFunction requires 5 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + return EdwithinTgeoGeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EdwithinTgeoTgeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EdwithinTgeoTgeoLogicalFunction.cpp index 1a116ae236..cf1db629b2 100644 --- a/nes-logical-operators/src/Functions/Meos/EdwithinTgeoTgeoLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/EdwithinTgeoTgeoLogicalFunction.cpp @@ -26,63 +26,87 @@ namespace NES { -EdwithinTgeoTgeoLogicalFunction::EdwithinTgeoTgeoLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction ts1, LogicalFunction lon2, LogicalFunction lat2, LogicalFunction ts2, LogicalFunction dist) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +EdwithinTgeoTgeoLogicalFunction::EdwithinTgeoTgeoLogicalFunction(LogicalFunction lonA, + LogicalFunction latA, + LogicalFunction tsA, + LogicalFunction lonB, + LogicalFunction latB, + LogicalFunction tsB, + LogicalFunction dist) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) { parameters.reserve(7); - parameters.push_back(std::move(lon1)); - parameters.push_back(std::move(lat1)); - parameters.push_back(std::move(ts1)); - parameters.push_back(std::move(lon2)); - parameters.push_back(std::move(lat2)); - parameters.push_back(std::move(ts2)); + parameters.push_back(std::move(lonA)); + parameters.push_back(std::move(latA)); + parameters.push_back(std::move(tsA)); + parameters.push_back(std::move(lonB)); + parameters.push_back(std::move(latB)); + parameters.push_back(std::move(tsB)); parameters.push_back(std::move(dist)); } -DataType EdwithinTgeoTgeoLogicalFunction::getDataType() const { return dataType; } +DataType EdwithinTgeoTgeoLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction EdwithinTgeoTgeoLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector EdwithinTgeoTgeoLogicalFunction::getChildren() const { return parameters; } +std::vector EdwithinTgeoTgeoLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction EdwithinTgeoTgeoLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 7, - "EdwithinTgeoTgeoLogicalFunction requires 7 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 7, "EdwithinTgeoTgeoLogicalFunction requires 7 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view EdwithinTgeoTgeoLogicalFunction::getType() const { return NAME; } +std::string_view EdwithinTgeoTgeoLogicalFunction::getType() const +{ + return NAME; +} bool EdwithinTgeoTgeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string EdwithinTgeoTgeoLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction EdwithinTgeoTgeoLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(7); - for (const auto& p : parameters) - c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon1 must be FLOAT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat1 must be FLOAT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); - INVARIANT(c[3].getDataType().isType(DataType::Type::FLOAT64), "lon2 must be FLOAT64"); - INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "lat2 must be FLOAT64"); - INVARIANT(c[5].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); - INVARIANT(c[6].getDataType().isType(DataType::Type::FLOAT64), "dist must be FLOAT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction EdwithinTgeoTgeoLogicalFunction::serialize() const @@ -91,7 +115,9 @@ SerializableFunction EdwithinTgeoTgeoLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -101,14 +127,14 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEdw PRECONDITION(arguments.children.size() == 7, "EdwithinTgeoTgeoLogicalFunction requires 7 children but got {}", arguments.children.size()); - return EdwithinTgeoTgeoLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2]), - std::move(arguments.children[3]), - std::move(arguments.children[4]), - std::move(arguments.children[5]), - std::move(arguments.children[6])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + auto arg5 = std::move(arguments.children[5]); + auto arg6 = std::move(arguments.children[6]); + return EdwithinTgeoTgeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EdwithinTrgeometryGeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EdwithinTrgeometryGeoLogicalFunction.cpp new file mode 100644 index 0000000000..0734badbad --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EdwithinTrgeometryGeoLogicalFunction.cpp @@ -0,0 +1,90 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EdwithinTrgeometryGeoLogicalFunction::EdwithinTrgeometryGeoLogicalFunction(LogicalFunction ref_wkt, LogicalFunction x1, LogicalFunction y1, LogicalFunction theta1, LogicalFunction ts1, LogicalFunction tgt_wkt, LogicalFunction dist) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(7); + parameters.push_back(std::move(ref_wkt)); + parameters.push_back(std::move(x1)); + parameters.push_back(std::move(y1)); + parameters.push_back(std::move(theta1)); + parameters.push_back(std::move(ts1)); + parameters.push_back(std::move(tgt_wkt)); + parameters.push_back(std::move(dist)); +} +DataType EdwithinTrgeometryGeoLogicalFunction::getDataType() const { return dataType; } +LogicalFunction EdwithinTrgeometryGeoLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } +std::vector EdwithinTrgeometryGeoLogicalFunction::getChildren() const { return parameters; } +LogicalFunction EdwithinTrgeometryGeoLogicalFunction::withChildren(const std::vector& children) const { + PRECONDITION(children.size()==7,"EdwithinTrgeometryGeoLogicalFunction requires 7 children, but got {}",children.size()); + auto c=*this; c.parameters=children; return c; +} +std::string_view EdwithinTrgeometryGeoLogicalFunction::getType() const { return NAME; } +bool EdwithinTrgeometryGeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + return false; +} +std::string EdwithinTrgeometryGeoLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("{}({})",NAME,parameters[0].explain(v)); +} +LogicalFunction EdwithinTrgeometryGeoLogicalFunction::withInferredDataType(const Schema& schema) const { + std::vector c; c.reserve(7); + for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "ref_wkt must be VARSIZED"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "x1 must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "y1 must be FLOAT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::FLOAT64), "theta1 must be FLOAT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); + INVARIANT(c[5].getDataType().isType(DataType::Type::VARSIZED), "tgt_wkt must be VARSIZED"); + INVARIANT(c[6].getDataType().isType(DataType::Type::FLOAT64), "dist must be FLOAT64"); + return withChildren(c); +} +SerializableFunction EdwithinTrgeometryGeoLogicalFunction::serialize() const { + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + return proto; +} +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEdwithinTrgeometryGeoLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size()==7, + "EdwithinTrgeometryGeoLogicalFunction requires 7 children but got {}", + arguments.children.size()); + return EdwithinTrgeometryGeoLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4]), + std::move(arguments.children[5]), + std::move(arguments.children[6])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EdwithinTrgeometryTrgeometryLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EdwithinTrgeometryTrgeometryLogicalFunction.cpp new file mode 100644 index 0000000000..c4bbcf8dbf --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EdwithinTrgeometryTrgeometryLogicalFunction.cpp @@ -0,0 +1,102 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EdwithinTrgeometryTrgeometryLogicalFunction::EdwithinTrgeometryTrgeometryLogicalFunction(LogicalFunction ref1_wkt, LogicalFunction x1, LogicalFunction y1, LogicalFunction theta1, LogicalFunction ts1, LogicalFunction ref2_wkt, LogicalFunction x2, LogicalFunction y2, LogicalFunction theta2, LogicalFunction ts2, LogicalFunction dist) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(11); + parameters.push_back(std::move(ref1_wkt)); + parameters.push_back(std::move(x1)); + parameters.push_back(std::move(y1)); + parameters.push_back(std::move(theta1)); + parameters.push_back(std::move(ts1)); + parameters.push_back(std::move(ref2_wkt)); + parameters.push_back(std::move(x2)); + parameters.push_back(std::move(y2)); + parameters.push_back(std::move(theta2)); + parameters.push_back(std::move(ts2)); + parameters.push_back(std::move(dist)); +} +DataType EdwithinTrgeometryTrgeometryLogicalFunction::getDataType() const { return dataType; } +LogicalFunction EdwithinTrgeometryTrgeometryLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } +std::vector EdwithinTrgeometryTrgeometryLogicalFunction::getChildren() const { return parameters; } +LogicalFunction EdwithinTrgeometryTrgeometryLogicalFunction::withChildren(const std::vector& children) const { + PRECONDITION(children.size()==11,"EdwithinTrgeometryTrgeometryLogicalFunction requires 11 children, but got {}",children.size()); + auto c=*this; c.parameters=children; return c; +} +std::string_view EdwithinTrgeometryTrgeometryLogicalFunction::getType() const { return NAME; } +bool EdwithinTrgeometryTrgeometryLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + return false; +} +std::string EdwithinTrgeometryTrgeometryLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("{}({})",NAME,parameters[0].explain(v)); +} +LogicalFunction EdwithinTrgeometryTrgeometryLogicalFunction::withInferredDataType(const Schema& schema) const { + std::vector c; c.reserve(11); + for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "ref1_wkt must be VARSIZED"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "x1 must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "y1 must be FLOAT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::FLOAT64), "theta1 must be FLOAT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); + INVARIANT(c[5].getDataType().isType(DataType::Type::VARSIZED), "ref2_wkt must be VARSIZED"); + INVARIANT(c[6].getDataType().isType(DataType::Type::FLOAT64), "x2 must be FLOAT64"); + INVARIANT(c[7].getDataType().isType(DataType::Type::FLOAT64), "y2 must be FLOAT64"); + INVARIANT(c[8].getDataType().isType(DataType::Type::FLOAT64), "theta2 must be FLOAT64"); + INVARIANT(c[9].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); + INVARIANT(c[10].getDataType().isType(DataType::Type::FLOAT64), "dist must be FLOAT64"); + return withChildren(c); +} +SerializableFunction EdwithinTrgeometryTrgeometryLogicalFunction::serialize() const { + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + return proto; +} +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEdwithinTrgeometryTrgeometryLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size()==11, + "EdwithinTrgeometryTrgeometryLogicalFunction requires 11 children but got {}", + arguments.children.size()); + return EdwithinTrgeometryTrgeometryLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4]), + std::move(arguments.children[5]), + std::move(arguments.children[6]), + std::move(arguments.children[7]), + std::move(arguments.children[8]), + std::move(arguments.children[9]), + std::move(arguments.children[10])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EintersectsTcbufferGeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EintersectsTcbufferGeoLogicalFunction.cpp index acb21c03d5..9d615530ba 100644 --- a/nes-logical-operators/src/Functions/Meos/EintersectsTcbufferGeoLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/EintersectsTcbufferGeoLogicalFunction.cpp @@ -26,64 +26,83 @@ namespace NES { -EintersectsTcbufferGeoLogicalFunction::EintersectsTcbufferGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, - LogicalFunction radius, LogicalFunction ts, - LogicalFunction wkt) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +EintersectsTcbufferGeoLogicalFunction::EintersectsTcbufferGeoLogicalFunction(LogicalFunction lon, + LogicalFunction lat, + LogicalFunction radius, + LogicalFunction timestamp, + LogicalFunction geometry) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) { parameters.reserve(5); parameters.push_back(std::move(lon)); parameters.push_back(std::move(lat)); parameters.push_back(std::move(radius)); - parameters.push_back(std::move(ts)); - parameters.push_back(std::move(wkt)); + parameters.push_back(std::move(timestamp)); + parameters.push_back(std::move(geometry)); } -DataType EintersectsTcbufferGeoLogicalFunction::getDataType() const { return dataType; } +DataType EintersectsTcbufferGeoLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction EintersectsTcbufferGeoLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector EintersectsTcbufferGeoLogicalFunction::getChildren() const { return parameters; } +std::vector EintersectsTcbufferGeoLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction EintersectsTcbufferGeoLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 5, - "EintersectsTcbufferGeoLogicalFunction requires 5 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 5, "EintersectsTcbufferGeoLogicalFunction requires 5 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view EintersectsTcbufferGeoLogicalFunction::getType() const { return NAME; } +std::string_view EintersectsTcbufferGeoLogicalFunction::getType() const +{ + return NAME; +} bool EintersectsTcbufferGeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string EintersectsTcbufferGeoLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction EintersectsTcbufferGeoLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(5); - c.emplace_back(parameters[0].withInferredDataType(schema)); - c.emplace_back(parameters[1].withInferredDataType(schema)); - c.emplace_back(parameters[2].withInferredDataType(schema)); - c.emplace_back(parameters[3].withInferredDataType(schema)); - c.emplace_back(parameters[4].withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon must be FLOAT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat must be FLOAT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "radius must be FLOAT64"); - INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); - INVARIANT(c[4].getDataType().isType(DataType::Type::VARSIZED), "wkt must be VARCHAR"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction EintersectsTcbufferGeoLogicalFunction::serialize() const @@ -92,7 +111,9 @@ SerializableFunction EintersectsTcbufferGeoLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -102,11 +123,12 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEin PRECONDITION(arguments.children.size() == 5, "EintersectsTcbufferGeoLogicalFunction requires 5 children but got {}", arguments.children.size()); - return EintersectsTcbufferGeoLogicalFunction(std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2]), - std::move(arguments.children[3]), - std::move(arguments.children[4])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + return EintersectsTcbufferGeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EintersectsTcbufferTcbufferLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EintersectsTcbufferTcbufferLogicalFunction.cpp index f28607d1a3..a4fa763245 100644 --- a/nes-logical-operators/src/Functions/Meos/EintersectsTcbufferTcbufferLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/EintersectsTcbufferTcbufferLogicalFunction.cpp @@ -26,67 +26,89 @@ namespace NES { -EintersectsTcbufferTcbufferLogicalFunction::EintersectsTcbufferTcbufferLogicalFunction( - LogicalFunction lon1, LogicalFunction lat1, LogicalFunction r1, LogicalFunction ts1, - LogicalFunction lon2, LogicalFunction lat2, LogicalFunction r2, LogicalFunction ts2) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +EintersectsTcbufferTcbufferLogicalFunction::EintersectsTcbufferTcbufferLogicalFunction(LogicalFunction lonA, + LogicalFunction latA, + LogicalFunction radiusA, + LogicalFunction tsA, + LogicalFunction lonB, + LogicalFunction latB, + LogicalFunction radiusB, + LogicalFunction tsB) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) { parameters.reserve(8); - parameters.push_back(std::move(lon1)); - parameters.push_back(std::move(lat1)); - parameters.push_back(std::move(r1)); - parameters.push_back(std::move(ts1)); - parameters.push_back(std::move(lon2)); - parameters.push_back(std::move(lat2)); - parameters.push_back(std::move(r2)); - parameters.push_back(std::move(ts2)); + parameters.push_back(std::move(lonA)); + parameters.push_back(std::move(latA)); + parameters.push_back(std::move(radiusA)); + parameters.push_back(std::move(tsA)); + parameters.push_back(std::move(lonB)); + parameters.push_back(std::move(latB)); + parameters.push_back(std::move(radiusB)); + parameters.push_back(std::move(tsB)); } -DataType EintersectsTcbufferTcbufferLogicalFunction::getDataType() const { return dataType; } +DataType EintersectsTcbufferTcbufferLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction EintersectsTcbufferTcbufferLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector EintersectsTcbufferTcbufferLogicalFunction::getChildren() const { return parameters; } +std::vector EintersectsTcbufferTcbufferLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction EintersectsTcbufferTcbufferLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 8, - "EintersectsTcbufferTcbufferLogicalFunction requires 8 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 8, "EintersectsTcbufferTcbufferLogicalFunction requires 8 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view EintersectsTcbufferTcbufferLogicalFunction::getType() const { return NAME; } +std::string_view EintersectsTcbufferTcbufferLogicalFunction::getType() const +{ + return NAME; +} bool EintersectsTcbufferTcbufferLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string EintersectsTcbufferTcbufferLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction EintersectsTcbufferTcbufferLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(8); - for (const auto& p : parameters) - c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon1 must be FLOAT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat1 must be FLOAT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "r1 must be FLOAT64"); - INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); - INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "lon2 must be FLOAT64"); - INVARIANT(c[5].getDataType().isType(DataType::Type::FLOAT64), "lat2 must be FLOAT64"); - INVARIANT(c[6].getDataType().isType(DataType::Type::FLOAT64), "r2 must be FLOAT64"); - INVARIANT(c[7].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction EintersectsTcbufferTcbufferLogicalFunction::serialize() const @@ -95,7 +117,9 @@ SerializableFunction EintersectsTcbufferTcbufferLogicalFunction::serialize() con proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -105,14 +129,15 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEin PRECONDITION(arguments.children.size() == 8, "EintersectsTcbufferTcbufferLogicalFunction requires 8 children but got {}", arguments.children.size()); - return EintersectsTcbufferTcbufferLogicalFunction(std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2]), - std::move(arguments.children[3]), - std::move(arguments.children[4]), - std::move(arguments.children[5]), - std::move(arguments.children[6]), - std::move(arguments.children[7])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + auto arg5 = std::move(arguments.children[5]); + auto arg6 = std::move(arguments.children[6]); + auto arg7 = std::move(arguments.children[7]); + return EintersectsTcbufferTcbufferLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6), std::move(arg7)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EintersectsTgeoGeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EintersectsTgeoGeoLogicalFunction.cpp index 69673fe97c..afc567b32d 100644 --- a/nes-logical-operators/src/Functions/Meos/EintersectsTgeoGeoLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/EintersectsTgeoGeoLogicalFunction.cpp @@ -26,60 +26,81 @@ namespace NES { -EintersectsTgeoGeoLogicalFunction::EintersectsTgeoGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, - LogicalFunction ts, LogicalFunction wkt) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +EintersectsTgeoGeoLogicalFunction::EintersectsTgeoGeoLogicalFunction(LogicalFunction lon, + LogicalFunction lat, + LogicalFunction timestamp, + LogicalFunction geometry) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) { parameters.reserve(4); parameters.push_back(std::move(lon)); parameters.push_back(std::move(lat)); - parameters.push_back(std::move(ts)); - parameters.push_back(std::move(wkt)); + parameters.push_back(std::move(timestamp)); + parameters.push_back(std::move(geometry)); } -DataType EintersectsTgeoGeoLogicalFunction::getDataType() const { return dataType; } +DataType EintersectsTgeoGeoLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction EintersectsTgeoGeoLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector EintersectsTgeoGeoLogicalFunction::getChildren() const { return parameters; } +std::vector EintersectsTgeoGeoLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction EintersectsTgeoGeoLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 4, - "EintersectsTgeoGeoLogicalFunction requires 4 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 4, "EintersectsTgeoGeoLogicalFunction requires 4 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view EintersectsTgeoGeoLogicalFunction::getType() const { return NAME; } +std::string_view EintersectsTgeoGeoLogicalFunction::getType() const +{ + return NAME; +} bool EintersectsTgeoGeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string EintersectsTgeoGeoLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction EintersectsTgeoGeoLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(4); - c.emplace_back(parameters[0].withInferredDataType(schema)); - c.emplace_back(parameters[1].withInferredDataType(schema)); - c.emplace_back(parameters[2].withInferredDataType(schema)); - c.emplace_back(parameters[3].withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon must be FLOAT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat must be FLOAT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); - INVARIANT(c[3].getDataType().isType(DataType::Type::VARSIZED),"wkt must be VARSIZED"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction EintersectsTgeoGeoLogicalFunction::serialize() const @@ -88,7 +109,9 @@ SerializableFunction EintersectsTgeoGeoLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -98,10 +121,11 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEin PRECONDITION(arguments.children.size() == 4, "EintersectsTgeoGeoLogicalFunction requires 4 children but got {}", arguments.children.size()); - return EintersectsTgeoGeoLogicalFunction(std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2]), - std::move(arguments.children[3])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + return EintersectsTgeoGeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EintersectsTgeoTgeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EintersectsTgeoTgeoLogicalFunction.cpp index 2a597066f8..4df0ac0ff8 100644 --- a/nes-logical-operators/src/Functions/Meos/EintersectsTgeoTgeoLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/EintersectsTgeoTgeoLogicalFunction.cpp @@ -26,61 +26,85 @@ namespace NES { -EintersectsTgeoTgeoLogicalFunction::EintersectsTgeoTgeoLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction ts1, LogicalFunction lon2, LogicalFunction lat2, LogicalFunction ts2) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +EintersectsTgeoTgeoLogicalFunction::EintersectsTgeoTgeoLogicalFunction(LogicalFunction lonA, + LogicalFunction latA, + LogicalFunction tsA, + LogicalFunction lonB, + LogicalFunction latB, + LogicalFunction tsB) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) { parameters.reserve(6); - parameters.push_back(std::move(lon1)); - parameters.push_back(std::move(lat1)); - parameters.push_back(std::move(ts1)); - parameters.push_back(std::move(lon2)); - parameters.push_back(std::move(lat2)); - parameters.push_back(std::move(ts2)); + parameters.push_back(std::move(lonA)); + parameters.push_back(std::move(latA)); + parameters.push_back(std::move(tsA)); + parameters.push_back(std::move(lonB)); + parameters.push_back(std::move(latB)); + parameters.push_back(std::move(tsB)); } -DataType EintersectsTgeoTgeoLogicalFunction::getDataType() const { return dataType; } +DataType EintersectsTgeoTgeoLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction EintersectsTgeoTgeoLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector EintersectsTgeoTgeoLogicalFunction::getChildren() const { return parameters; } +std::vector EintersectsTgeoTgeoLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction EintersectsTgeoTgeoLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 6, - "EintersectsTgeoTgeoLogicalFunction requires 6 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 6, "EintersectsTgeoTgeoLogicalFunction requires 6 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view EintersectsTgeoTgeoLogicalFunction::getType() const { return NAME; } +std::string_view EintersectsTgeoTgeoLogicalFunction::getType() const +{ + return NAME; +} bool EintersectsTgeoTgeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string EintersectsTgeoTgeoLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction EintersectsTgeoTgeoLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(6); - for (const auto& p : parameters) - c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon1 must be FLOAT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat1 must be FLOAT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); - INVARIANT(c[3].getDataType().isType(DataType::Type::FLOAT64), "lon2 must be FLOAT64"); - INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "lat2 must be FLOAT64"); - INVARIANT(c[5].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction EintersectsTgeoTgeoLogicalFunction::serialize() const @@ -89,7 +113,9 @@ SerializableFunction EintersectsTgeoTgeoLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -99,13 +125,13 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEin PRECONDITION(arguments.children.size() == 6, "EintersectsTgeoTgeoLogicalFunction requires 6 children but got {}", arguments.children.size()); - return EintersectsTgeoTgeoLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2]), - std::move(arguments.children[3]), - std::move(arguments.children[4]), - std::move(arguments.children[5])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + auto arg5 = std::move(arguments.children[5]); + return EintersectsTgeoTgeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EintersectsTrgeometryGeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EintersectsTrgeometryGeoLogicalFunction.cpp new file mode 100644 index 0000000000..de239c4308 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EintersectsTrgeometryGeoLogicalFunction.cpp @@ -0,0 +1,87 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EintersectsTrgeometryGeoLogicalFunction::EintersectsTrgeometryGeoLogicalFunction(LogicalFunction ref_wkt, LogicalFunction x1, LogicalFunction y1, LogicalFunction theta1, LogicalFunction ts1, LogicalFunction tgt_wkt) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(6); + parameters.push_back(std::move(ref_wkt)); + parameters.push_back(std::move(x1)); + parameters.push_back(std::move(y1)); + parameters.push_back(std::move(theta1)); + parameters.push_back(std::move(ts1)); + parameters.push_back(std::move(tgt_wkt)); +} +DataType EintersectsTrgeometryGeoLogicalFunction::getDataType() const { return dataType; } +LogicalFunction EintersectsTrgeometryGeoLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } +std::vector EintersectsTrgeometryGeoLogicalFunction::getChildren() const { return parameters; } +LogicalFunction EintersectsTrgeometryGeoLogicalFunction::withChildren(const std::vector& children) const { + PRECONDITION(children.size()==6,"EintersectsTrgeometryGeoLogicalFunction requires 6 children, but got {}",children.size()); + auto c=*this; c.parameters=children; return c; +} +std::string_view EintersectsTrgeometryGeoLogicalFunction::getType() const { return NAME; } +bool EintersectsTrgeometryGeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + return false; +} +std::string EintersectsTrgeometryGeoLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("{}({})",NAME,parameters[0].explain(v)); +} +LogicalFunction EintersectsTrgeometryGeoLogicalFunction::withInferredDataType(const Schema& schema) const { + std::vector c; c.reserve(6); + for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "ref_wkt must be VARSIZED"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "x1 must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "y1 must be FLOAT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::FLOAT64), "theta1 must be FLOAT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); + INVARIANT(c[5].getDataType().isType(DataType::Type::VARSIZED), "tgt_wkt must be VARSIZED"); + return withChildren(c); +} +SerializableFunction EintersectsTrgeometryGeoLogicalFunction::serialize() const { + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + return proto; +} +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEintersectsTrgeometryGeoLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size()==6, + "EintersectsTrgeometryGeoLogicalFunction requires 6 children but got {}", + arguments.children.size()); + return EintersectsTrgeometryGeoLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4]), + std::move(arguments.children[5])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EintersectsTrgeometryTrgeometryLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EintersectsTrgeometryTrgeometryLogicalFunction.cpp new file mode 100644 index 0000000000..19503ba82e --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EintersectsTrgeometryTrgeometryLogicalFunction.cpp @@ -0,0 +1,99 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EintersectsTrgeometryTrgeometryLogicalFunction::EintersectsTrgeometryTrgeometryLogicalFunction(LogicalFunction ref1_wkt, LogicalFunction x1, LogicalFunction y1, LogicalFunction theta1, LogicalFunction ts1, LogicalFunction ref2_wkt, LogicalFunction x2, LogicalFunction y2, LogicalFunction theta2, LogicalFunction ts2) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(10); + parameters.push_back(std::move(ref1_wkt)); + parameters.push_back(std::move(x1)); + parameters.push_back(std::move(y1)); + parameters.push_back(std::move(theta1)); + parameters.push_back(std::move(ts1)); + parameters.push_back(std::move(ref2_wkt)); + parameters.push_back(std::move(x2)); + parameters.push_back(std::move(y2)); + parameters.push_back(std::move(theta2)); + parameters.push_back(std::move(ts2)); +} +DataType EintersectsTrgeometryTrgeometryLogicalFunction::getDataType() const { return dataType; } +LogicalFunction EintersectsTrgeometryTrgeometryLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } +std::vector EintersectsTrgeometryTrgeometryLogicalFunction::getChildren() const { return parameters; } +LogicalFunction EintersectsTrgeometryTrgeometryLogicalFunction::withChildren(const std::vector& children) const { + PRECONDITION(children.size()==10,"EintersectsTrgeometryTrgeometryLogicalFunction requires 10 children, but got {}",children.size()); + auto c=*this; c.parameters=children; return c; +} +std::string_view EintersectsTrgeometryTrgeometryLogicalFunction::getType() const { return NAME; } +bool EintersectsTrgeometryTrgeometryLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + return false; +} +std::string EintersectsTrgeometryTrgeometryLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("{}({})",NAME,parameters[0].explain(v)); +} +LogicalFunction EintersectsTrgeometryTrgeometryLogicalFunction::withInferredDataType(const Schema& schema) const { + std::vector c; c.reserve(10); + for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "ref1_wkt must be VARSIZED"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "x1 must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "y1 must be FLOAT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::FLOAT64), "theta1 must be FLOAT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); + INVARIANT(c[5].getDataType().isType(DataType::Type::VARSIZED), "ref2_wkt must be VARSIZED"); + INVARIANT(c[6].getDataType().isType(DataType::Type::FLOAT64), "x2 must be FLOAT64"); + INVARIANT(c[7].getDataType().isType(DataType::Type::FLOAT64), "y2 must be FLOAT64"); + INVARIANT(c[8].getDataType().isType(DataType::Type::FLOAT64), "theta2 must be FLOAT64"); + INVARIANT(c[9].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); + return withChildren(c); +} +SerializableFunction EintersectsTrgeometryTrgeometryLogicalFunction::serialize() const { + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + return proto; +} +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEintersectsTrgeometryTrgeometryLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size()==10, + "EintersectsTrgeometryTrgeometryLogicalFunction requires 10 children but got {}", + arguments.children.size()); + return EintersectsTrgeometryTrgeometryLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4]), + std::move(arguments.children[5]), + std::move(arguments.children[6]), + std::move(arguments.children[7]), + std::move(arguments.children[8]), + std::move(arguments.children[9])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EtouchesTcbufferGeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EtouchesTcbufferGeoLogicalFunction.cpp index 9342dd741c..39243a3c07 100644 --- a/nes-logical-operators/src/Functions/Meos/EtouchesTcbufferGeoLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/EtouchesTcbufferGeoLogicalFunction.cpp @@ -26,64 +26,83 @@ namespace NES { -EtouchesTcbufferGeoLogicalFunction::EtouchesTcbufferGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, - LogicalFunction radius, LogicalFunction ts, - LogicalFunction wkt) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +EtouchesTcbufferGeoLogicalFunction::EtouchesTcbufferGeoLogicalFunction(LogicalFunction lon, + LogicalFunction lat, + LogicalFunction radius, + LogicalFunction timestamp, + LogicalFunction geometry) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) { parameters.reserve(5); parameters.push_back(std::move(lon)); parameters.push_back(std::move(lat)); parameters.push_back(std::move(radius)); - parameters.push_back(std::move(ts)); - parameters.push_back(std::move(wkt)); + parameters.push_back(std::move(timestamp)); + parameters.push_back(std::move(geometry)); } -DataType EtouchesTcbufferGeoLogicalFunction::getDataType() const { return dataType; } +DataType EtouchesTcbufferGeoLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction EtouchesTcbufferGeoLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector EtouchesTcbufferGeoLogicalFunction::getChildren() const { return parameters; } +std::vector EtouchesTcbufferGeoLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction EtouchesTcbufferGeoLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 5, - "EtouchesTcbufferGeoLogicalFunction requires 5 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 5, "EtouchesTcbufferGeoLogicalFunction requires 5 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view EtouchesTcbufferGeoLogicalFunction::getType() const { return NAME; } +std::string_view EtouchesTcbufferGeoLogicalFunction::getType() const +{ + return NAME; +} bool EtouchesTcbufferGeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string EtouchesTcbufferGeoLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction EtouchesTcbufferGeoLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(5); - c.emplace_back(parameters[0].withInferredDataType(schema)); - c.emplace_back(parameters[1].withInferredDataType(schema)); - c.emplace_back(parameters[2].withInferredDataType(schema)); - c.emplace_back(parameters[3].withInferredDataType(schema)); - c.emplace_back(parameters[4].withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon must be FLOAT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat must be FLOAT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "radius must be FLOAT64"); - INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); - INVARIANT(c[4].getDataType().isType(DataType::Type::VARSIZED), "wkt must be VARCHAR"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction EtouchesTcbufferGeoLogicalFunction::serialize() const @@ -92,7 +111,9 @@ SerializableFunction EtouchesTcbufferGeoLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -102,11 +123,12 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEto PRECONDITION(arguments.children.size() == 5, "EtouchesTcbufferGeoLogicalFunction requires 5 children but got {}", arguments.children.size()); - return EtouchesTcbufferGeoLogicalFunction(std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2]), - std::move(arguments.children[3]), - std::move(arguments.children[4])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + return EtouchesTcbufferGeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EtouchesTcbufferTcbufferLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EtouchesTcbufferTcbufferLogicalFunction.cpp index 7c8087753d..56807c62a9 100644 --- a/nes-logical-operators/src/Functions/Meos/EtouchesTcbufferTcbufferLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/EtouchesTcbufferTcbufferLogicalFunction.cpp @@ -26,67 +26,89 @@ namespace NES { -EtouchesTcbufferTcbufferLogicalFunction::EtouchesTcbufferTcbufferLogicalFunction( - LogicalFunction lon1, LogicalFunction lat1, LogicalFunction r1, LogicalFunction ts1, - LogicalFunction lon2, LogicalFunction lat2, LogicalFunction r2, LogicalFunction ts2) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +EtouchesTcbufferTcbufferLogicalFunction::EtouchesTcbufferTcbufferLogicalFunction(LogicalFunction lonA, + LogicalFunction latA, + LogicalFunction radiusA, + LogicalFunction tsA, + LogicalFunction lonB, + LogicalFunction latB, + LogicalFunction radiusB, + LogicalFunction tsB) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) { parameters.reserve(8); - parameters.push_back(std::move(lon1)); - parameters.push_back(std::move(lat1)); - parameters.push_back(std::move(r1)); - parameters.push_back(std::move(ts1)); - parameters.push_back(std::move(lon2)); - parameters.push_back(std::move(lat2)); - parameters.push_back(std::move(r2)); - parameters.push_back(std::move(ts2)); + parameters.push_back(std::move(lonA)); + parameters.push_back(std::move(latA)); + parameters.push_back(std::move(radiusA)); + parameters.push_back(std::move(tsA)); + parameters.push_back(std::move(lonB)); + parameters.push_back(std::move(latB)); + parameters.push_back(std::move(radiusB)); + parameters.push_back(std::move(tsB)); } -DataType EtouchesTcbufferTcbufferLogicalFunction::getDataType() const { return dataType; } +DataType EtouchesTcbufferTcbufferLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction EtouchesTcbufferTcbufferLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector EtouchesTcbufferTcbufferLogicalFunction::getChildren() const { return parameters; } +std::vector EtouchesTcbufferTcbufferLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction EtouchesTcbufferTcbufferLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 8, - "EtouchesTcbufferTcbufferLogicalFunction requires 8 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 8, "EtouchesTcbufferTcbufferLogicalFunction requires 8 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view EtouchesTcbufferTcbufferLogicalFunction::getType() const { return NAME; } +std::string_view EtouchesTcbufferTcbufferLogicalFunction::getType() const +{ + return NAME; +} bool EtouchesTcbufferTcbufferLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string EtouchesTcbufferTcbufferLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction EtouchesTcbufferTcbufferLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(8); - for (const auto& p : parameters) - c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon1 must be FLOAT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat1 must be FLOAT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "r1 must be FLOAT64"); - INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); - INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "lon2 must be FLOAT64"); - INVARIANT(c[5].getDataType().isType(DataType::Type::FLOAT64), "lat2 must be FLOAT64"); - INVARIANT(c[6].getDataType().isType(DataType::Type::FLOAT64), "r2 must be FLOAT64"); - INVARIANT(c[7].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction EtouchesTcbufferTcbufferLogicalFunction::serialize() const @@ -95,7 +117,9 @@ SerializableFunction EtouchesTcbufferTcbufferLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -105,14 +129,15 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEto PRECONDITION(arguments.children.size() == 8, "EtouchesTcbufferTcbufferLogicalFunction requires 8 children but got {}", arguments.children.size()); - return EtouchesTcbufferTcbufferLogicalFunction(std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2]), - std::move(arguments.children[3]), - std::move(arguments.children[4]), - std::move(arguments.children[5]), - std::move(arguments.children[6]), - std::move(arguments.children[7])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + auto arg5 = std::move(arguments.children[5]); + auto arg6 = std::move(arguments.children[6]); + auto arg7 = std::move(arguments.children[7]); + return EtouchesTcbufferTcbufferLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6), std::move(arg7)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EtouchesTgeoGeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EtouchesTgeoGeoLogicalFunction.cpp index 8232949891..c66d13f6ff 100644 --- a/nes-logical-operators/src/Functions/Meos/EtouchesTgeoGeoLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/EtouchesTgeoGeoLogicalFunction.cpp @@ -26,60 +26,81 @@ namespace NES { -EtouchesTgeoGeoLogicalFunction::EtouchesTgeoGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, - LogicalFunction ts, LogicalFunction wkt) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +EtouchesTgeoGeoLogicalFunction::EtouchesTgeoGeoLogicalFunction(LogicalFunction lon, + LogicalFunction lat, + LogicalFunction timestamp, + LogicalFunction geometry) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) { parameters.reserve(4); parameters.push_back(std::move(lon)); parameters.push_back(std::move(lat)); - parameters.push_back(std::move(ts)); - parameters.push_back(std::move(wkt)); + parameters.push_back(std::move(timestamp)); + parameters.push_back(std::move(geometry)); } -DataType EtouchesTgeoGeoLogicalFunction::getDataType() const { return dataType; } +DataType EtouchesTgeoGeoLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction EtouchesTgeoGeoLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector EtouchesTgeoGeoLogicalFunction::getChildren() const { return parameters; } +std::vector EtouchesTgeoGeoLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction EtouchesTgeoGeoLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 4, - "EtouchesTgeoGeoLogicalFunction requires 4 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 4, "EtouchesTgeoGeoLogicalFunction requires 4 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view EtouchesTgeoGeoLogicalFunction::getType() const { return NAME; } +std::string_view EtouchesTgeoGeoLogicalFunction::getType() const +{ + return NAME; +} bool EtouchesTgeoGeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string EtouchesTgeoGeoLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction EtouchesTgeoGeoLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(4); - c.emplace_back(parameters[0].withInferredDataType(schema)); - c.emplace_back(parameters[1].withInferredDataType(schema)); - c.emplace_back(parameters[2].withInferredDataType(schema)); - c.emplace_back(parameters[3].withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon must be FLOAT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat must be FLOAT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); - INVARIANT(c[3].getDataType().isType(DataType::Type::VARSIZED),"wkt must be VARSIZED"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction EtouchesTgeoGeoLogicalFunction::serialize() const @@ -88,7 +109,9 @@ SerializableFunction EtouchesTgeoGeoLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -98,10 +121,11 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEto PRECONDITION(arguments.children.size() == 4, "EtouchesTgeoGeoLogicalFunction requires 4 children but got {}", arguments.children.size()); - return EtouchesTgeoGeoLogicalFunction(std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2]), - std::move(arguments.children[3])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + return EtouchesTgeoGeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EtouchesTgeoTgeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EtouchesTgeoTgeoLogicalFunction.cpp index 0aac78792c..3aa67d96ea 100644 --- a/nes-logical-operators/src/Functions/Meos/EtouchesTgeoTgeoLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/EtouchesTgeoTgeoLogicalFunction.cpp @@ -26,61 +26,85 @@ namespace NES { -EtouchesTgeoTgeoLogicalFunction::EtouchesTgeoTgeoLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction ts1, LogicalFunction lon2, LogicalFunction lat2, LogicalFunction ts2) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +EtouchesTgeoTgeoLogicalFunction::EtouchesTgeoTgeoLogicalFunction(LogicalFunction lonA, + LogicalFunction latA, + LogicalFunction tsA, + LogicalFunction lonB, + LogicalFunction latB, + LogicalFunction tsB) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) { parameters.reserve(6); - parameters.push_back(std::move(lon1)); - parameters.push_back(std::move(lat1)); - parameters.push_back(std::move(ts1)); - parameters.push_back(std::move(lon2)); - parameters.push_back(std::move(lat2)); - parameters.push_back(std::move(ts2)); + parameters.push_back(std::move(lonA)); + parameters.push_back(std::move(latA)); + parameters.push_back(std::move(tsA)); + parameters.push_back(std::move(lonB)); + parameters.push_back(std::move(latB)); + parameters.push_back(std::move(tsB)); } -DataType EtouchesTgeoTgeoLogicalFunction::getDataType() const { return dataType; } +DataType EtouchesTgeoTgeoLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction EtouchesTgeoTgeoLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector EtouchesTgeoTgeoLogicalFunction::getChildren() const { return parameters; } +std::vector EtouchesTgeoTgeoLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction EtouchesTgeoTgeoLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 6, - "EtouchesTgeoTgeoLogicalFunction requires 6 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 6, "EtouchesTgeoTgeoLogicalFunction requires 6 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view EtouchesTgeoTgeoLogicalFunction::getType() const { return NAME; } +std::string_view EtouchesTgeoTgeoLogicalFunction::getType() const +{ + return NAME; +} bool EtouchesTgeoTgeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string EtouchesTgeoTgeoLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction EtouchesTgeoTgeoLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(6); - for (const auto& p : parameters) - c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon1 must be FLOAT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat1 must be FLOAT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); - INVARIANT(c[3].getDataType().isType(DataType::Type::FLOAT64), "lon2 must be FLOAT64"); - INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "lat2 must be FLOAT64"); - INVARIANT(c[5].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction EtouchesTgeoTgeoLogicalFunction::serialize() const @@ -89,7 +113,9 @@ SerializableFunction EtouchesTgeoTgeoLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -99,13 +125,13 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEto PRECONDITION(arguments.children.size() == 6, "EtouchesTgeoTgeoLogicalFunction requires 6 children but got {}", arguments.children.size()); - return EtouchesTgeoTgeoLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2]), - std::move(arguments.children[3]), - std::move(arguments.children[4]), - std::move(arguments.children[5])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + auto arg5 = std::move(arguments.children[5]); + return EtouchesTgeoTgeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EtouchesTrgeometryGeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EtouchesTrgeometryGeoLogicalFunction.cpp new file mode 100644 index 0000000000..f965f540b0 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/EtouchesTrgeometryGeoLogicalFunction.cpp @@ -0,0 +1,87 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +EtouchesTrgeometryGeoLogicalFunction::EtouchesTrgeometryGeoLogicalFunction(LogicalFunction ref_wkt, LogicalFunction x1, LogicalFunction y1, LogicalFunction theta1, LogicalFunction ts1, LogicalFunction tgt_wkt) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(6); + parameters.push_back(std::move(ref_wkt)); + parameters.push_back(std::move(x1)); + parameters.push_back(std::move(y1)); + parameters.push_back(std::move(theta1)); + parameters.push_back(std::move(ts1)); + parameters.push_back(std::move(tgt_wkt)); +} +DataType EtouchesTrgeometryGeoLogicalFunction::getDataType() const { return dataType; } +LogicalFunction EtouchesTrgeometryGeoLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } +std::vector EtouchesTrgeometryGeoLogicalFunction::getChildren() const { return parameters; } +LogicalFunction EtouchesTrgeometryGeoLogicalFunction::withChildren(const std::vector& children) const { + PRECONDITION(children.size()==6,"EtouchesTrgeometryGeoLogicalFunction requires 6 children, but got {}",children.size()); + auto c=*this; c.parameters=children; return c; +} +std::string_view EtouchesTrgeometryGeoLogicalFunction::getType() const { return NAME; } +bool EtouchesTrgeometryGeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { + if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + return false; +} +std::string EtouchesTrgeometryGeoLogicalFunction::explain(ExplainVerbosity v) const { + return fmt::format("{}({})",NAME,parameters[0].explain(v)); +} +LogicalFunction EtouchesTrgeometryGeoLogicalFunction::withInferredDataType(const Schema& schema) const { + std::vector c; c.reserve(6); + for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); + INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "ref_wkt must be VARSIZED"); + INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "x1 must be FLOAT64"); + INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "y1 must be FLOAT64"); + INVARIANT(c[3].getDataType().isType(DataType::Type::FLOAT64), "theta1 must be FLOAT64"); + INVARIANT(c[4].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); + INVARIANT(c[5].getDataType().isType(DataType::Type::VARSIZED), "tgt_wkt must be VARSIZED"); + return withChildren(c); +} +SerializableFunction EtouchesTrgeometryGeoLogicalFunction::serialize() const { + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + return proto; +} +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEtouchesTrgeometryGeoLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size()==6, + "EtouchesTrgeometryGeoLogicalFunction requires 6 children but got {}", + arguments.children.size()); + return EtouchesTrgeometryGeoLogicalFunction( + std::move(arguments.children[0]), + std::move(arguments.children[1]), + std::move(arguments.children[2]), + std::move(arguments.children[3]), + std::move(arguments.children[4]), + std::move(arguments.children[5])); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverEqBigintTbigintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverEqBigintTbigintLogicalFunction.cpp index bd7bc9bd8b..864893e88b 100644 --- a/nes-logical-operators/src/Functions/Meos/EverEqBigintTbigintLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/EverEqBigintTbigintLogicalFunction.cpp @@ -26,46 +26,65 @@ namespace NES { -EverEqBigintTbigintLogicalFunction::EverEqBigintTbigintLogicalFunction(LogicalFunction value, - LogicalFunction threshold, - LogicalFunction ts) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +EverEqBigintTbigintLogicalFunction::EverEqBigintTbigintLogicalFunction(LogicalFunction arg0, + LogicalFunction value, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) { parameters.reserve(3); + parameters.push_back(std::move(arg0)); parameters.push_back(std::move(value)); - parameters.push_back(std::move(threshold)); parameters.push_back(std::move(ts)); } -DataType EverEqBigintTbigintLogicalFunction::getDataType() const { return dataType; } +DataType EverEqBigintTbigintLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction EverEqBigintTbigintLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector EverEqBigintTbigintLogicalFunction::getChildren() const { return parameters; } +std::vector EverEqBigintTbigintLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction EverEqBigintTbigintLogicalFunction::withChildren(const std::vector& children) const { PRECONDITION(children.size() == 3, "EverEqBigintTbigintLogicalFunction requires 3 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view EverEqBigintTbigintLogicalFunction::getType() const { return NAME; } +std::string_view EverEqBigintTbigintLogicalFunction::getType() const +{ + return NAME; +} bool EverEqBigintTbigintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string EverEqBigintTbigintLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -76,7 +95,9 @@ LogicalFunction EverEqBigintTbigintLogicalFunction::withInferredDataType(const S std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -86,7 +107,9 @@ SerializableFunction EverEqBigintTbigintLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } diff --git a/nes-logical-operators/src/Functions/Meos/EverEqBoolTboolLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverEqBoolTboolLogicalFunction.cpp index dfe6ced0b7..3a4133298c 100644 --- a/nes-logical-operators/src/Functions/Meos/EverEqBoolTboolLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/EverEqBoolTboolLogicalFunction.cpp @@ -26,46 +26,65 @@ namespace NES { -EverEqBoolTboolLogicalFunction::EverEqBoolTboolLogicalFunction(LogicalFunction value, - LogicalFunction threshold, - LogicalFunction ts) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +EverEqBoolTboolLogicalFunction::EverEqBoolTboolLogicalFunction(LogicalFunction arg0, + LogicalFunction value, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) { parameters.reserve(3); + parameters.push_back(std::move(arg0)); parameters.push_back(std::move(value)); - parameters.push_back(std::move(threshold)); parameters.push_back(std::move(ts)); } -DataType EverEqBoolTboolLogicalFunction::getDataType() const { return dataType; } +DataType EverEqBoolTboolLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction EverEqBoolTboolLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector EverEqBoolTboolLogicalFunction::getChildren() const { return parameters; } +std::vector EverEqBoolTboolLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction EverEqBoolTboolLogicalFunction::withChildren(const std::vector& children) const { PRECONDITION(children.size() == 3, "EverEqBoolTboolLogicalFunction requires 3 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view EverEqBoolTboolLogicalFunction::getType() const { return NAME; } +std::string_view EverEqBoolTboolLogicalFunction::getType() const +{ + return NAME; +} bool EverEqBoolTboolLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string EverEqBoolTboolLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -76,7 +95,9 @@ LogicalFunction EverEqBoolTboolLogicalFunction::withInferredDataType(const Schem std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -86,7 +107,9 @@ SerializableFunction EverEqBoolTboolLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } diff --git a/nes-logical-operators/src/Functions/Meos/EverEqNpointTnpointLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverEqNpointTnpointLogicalFunction.cpp index c7e8673ad2..871f07be96 100644 --- a/nes-logical-operators/src/Functions/Meos/EverEqNpointTnpointLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/EverEqNpointTnpointLogicalFunction.cpp @@ -26,59 +26,83 @@ namespace NES { -EverEqNpointTnpointLogicalFunction::EverEqNpointTnpointLogicalFunction(LogicalFunction rid_np, LogicalFunction pos_np, LogicalFunction rid_tp, LogicalFunction pos_tp, LogicalFunction ts) +EverEqNpointTnpointLogicalFunction::EverEqNpointTnpointLogicalFunction(LogicalFunction rid0, + LogicalFunction frac0, + LogicalFunction rid, + LogicalFunction frac, + LogicalFunction ts) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(5); - parameters.push_back(std::move(rid_np)); - parameters.push_back(std::move(pos_np)); - parameters.push_back(std::move(rid_tp)); - parameters.push_back(std::move(pos_tp)); + parameters.push_back(std::move(rid0)); + parameters.push_back(std::move(frac0)); + parameters.push_back(std::move(rid)); + parameters.push_back(std::move(frac)); parameters.push_back(std::move(ts)); } -DataType EverEqNpointTnpointLogicalFunction::getDataType() const { return dataType; } +DataType EverEqNpointTnpointLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction EverEqNpointTnpointLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector EverEqNpointTnpointLogicalFunction::getChildren() const { return parameters; } +std::vector EverEqNpointTnpointLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction EverEqNpointTnpointLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 5, - "EverEqNpointTnpointLogicalFunction requires 5 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 5, "EverEqNpointTnpointLogicalFunction requires 5 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view EverEqNpointTnpointLogicalFunction::getType() const { return NAME; } +std::string_view EverEqNpointTnpointLogicalFunction::getType() const +{ + return NAME; +} bool EverEqNpointTnpointLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string EverEqNpointTnpointLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction EverEqNpointTnpointLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(5); - for (const auto& p : parameters) - c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "rid_np must be UINT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "pos_np must be FLOAT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "rid_tp must be UINT64"); - INVARIANT(c[3].getDataType().isType(DataType::Type::FLOAT64), "pos_tp must be FLOAT64"); - INVARIANT(c[4].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction EverEqNpointTnpointLogicalFunction::serialize() const @@ -87,7 +111,9 @@ SerializableFunction EverEqNpointTnpointLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -97,12 +123,12 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEve PRECONDITION(arguments.children.size() == 5, "EverEqNpointTnpointLogicalFunction requires 5 children but got {}", arguments.children.size()); - return EverEqNpointTnpointLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2]), - std::move(arguments.children[3]), - std::move(arguments.children[4])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + return EverEqNpointTnpointLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverEqPoseTposeLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverEqPoseTposeLogicalFunction.cpp index 32dcbb6be6..c39c1c8c08 100644 --- a/nes-logical-operators/src/Functions/Meos/EverEqPoseTposeLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/EverEqPoseTposeLogicalFunction.cpp @@ -26,63 +26,87 @@ namespace NES { -EverEqPoseTposeLogicalFunction::EverEqPoseTposeLogicalFunction(LogicalFunction x2, LogicalFunction y2, LogicalFunction theta2, LogicalFunction x, LogicalFunction y, LogicalFunction theta, LogicalFunction ts) +EverEqPoseTposeLogicalFunction::EverEqPoseTposeLogicalFunction(LogicalFunction px0, + LogicalFunction py0, + LogicalFunction ptheta0, + LogicalFunction x, + LogicalFunction y, + LogicalFunction theta, + LogicalFunction ts) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(7); - parameters.push_back(std::move(x2)); - parameters.push_back(std::move(y2)); - parameters.push_back(std::move(theta2)); + parameters.push_back(std::move(px0)); + parameters.push_back(std::move(py0)); + parameters.push_back(std::move(ptheta0)); parameters.push_back(std::move(x)); parameters.push_back(std::move(y)); parameters.push_back(std::move(theta)); parameters.push_back(std::move(ts)); } -DataType EverEqPoseTposeLogicalFunction::getDataType() const { return dataType; } +DataType EverEqPoseTposeLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction EverEqPoseTposeLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector EverEqPoseTposeLogicalFunction::getChildren() const { return parameters; } +std::vector EverEqPoseTposeLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction EverEqPoseTposeLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 7, - "EverEqPoseTposeLogicalFunction requires 7 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 7, "EverEqPoseTposeLogicalFunction requires 7 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view EverEqPoseTposeLogicalFunction::getType() const { return NAME; } +std::string_view EverEqPoseTposeLogicalFunction::getType() const +{ + return NAME; +} bool EverEqPoseTposeLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string EverEqPoseTposeLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction EverEqPoseTposeLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(7); - for (const auto& p : parameters) - c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "x2 must be FLOAT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "y2 must be FLOAT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "theta2 must be FLOAT64"); - INVARIANT(c[3].getDataType().isType(DataType::Type::FLOAT64), "x must be FLOAT64"); - INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "y must be FLOAT64"); - INVARIANT(c[5].getDataType().isType(DataType::Type::FLOAT64), "theta must be FLOAT64"); - INVARIANT(c[6].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction EverEqPoseTposeLogicalFunction::serialize() const @@ -91,7 +115,9 @@ SerializableFunction EverEqPoseTposeLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -101,14 +127,14 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEve PRECONDITION(arguments.children.size() == 7, "EverEqPoseTposeLogicalFunction requires 7 children but got {}", arguments.children.size()); - return EverEqPoseTposeLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2]), - std::move(arguments.children[3]), - std::move(arguments.children[4]), - std::move(arguments.children[5]), - std::move(arguments.children[6])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + auto arg5 = std::move(arguments.children[5]); + auto arg6 = std::move(arguments.children[6]); + return EverEqPoseTposeLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverEqTbigintBigintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverEqTbigintBigintLogicalFunction.cpp index 63cb64adc8..7f2234bf54 100644 --- a/nes-logical-operators/src/Functions/Meos/EverEqTbigintBigintLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/EverEqTbigintBigintLogicalFunction.cpp @@ -27,45 +27,64 @@ namespace NES { EverEqTbigintBigintLogicalFunction::EverEqTbigintBigintLogicalFunction(LogicalFunction value, - LogicalFunction threshold, - LogicalFunction ts) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) + LogicalFunction ts, + LogicalFunction arg0) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) { parameters.reserve(3); parameters.push_back(std::move(value)); - parameters.push_back(std::move(threshold)); parameters.push_back(std::move(ts)); + parameters.push_back(std::move(arg0)); } -DataType EverEqTbigintBigintLogicalFunction::getDataType() const { return dataType; } +DataType EverEqTbigintBigintLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction EverEqTbigintBigintLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector EverEqTbigintBigintLogicalFunction::getChildren() const { return parameters; } +std::vector EverEqTbigintBigintLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction EverEqTbigintBigintLogicalFunction::withChildren(const std::vector& children) const { PRECONDITION(children.size() == 3, "EverEqTbigintBigintLogicalFunction requires 3 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view EverEqTbigintBigintLogicalFunction::getType() const { return NAME; } +std::string_view EverEqTbigintBigintLogicalFunction::getType() const +{ + return NAME; +} bool EverEqTbigintBigintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string EverEqTbigintBigintLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -76,7 +95,9 @@ LogicalFunction EverEqTbigintBigintLogicalFunction::withInferredDataType(const S std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -86,7 +107,9 @@ SerializableFunction EverEqTbigintBigintLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } diff --git a/nes-logical-operators/src/Functions/Meos/EverEqTboolBoolLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverEqTboolBoolLogicalFunction.cpp index c47995fd5f..6852f2555c 100644 --- a/nes-logical-operators/src/Functions/Meos/EverEqTboolBoolLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/EverEqTboolBoolLogicalFunction.cpp @@ -27,45 +27,64 @@ namespace NES { EverEqTboolBoolLogicalFunction::EverEqTboolBoolLogicalFunction(LogicalFunction value, - LogicalFunction threshold, - LogicalFunction ts) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) + LogicalFunction ts, + LogicalFunction arg0) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) { parameters.reserve(3); parameters.push_back(std::move(value)); - parameters.push_back(std::move(threshold)); parameters.push_back(std::move(ts)); + parameters.push_back(std::move(arg0)); } -DataType EverEqTboolBoolLogicalFunction::getDataType() const { return dataType; } +DataType EverEqTboolBoolLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction EverEqTboolBoolLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector EverEqTboolBoolLogicalFunction::getChildren() const { return parameters; } +std::vector EverEqTboolBoolLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction EverEqTboolBoolLogicalFunction::withChildren(const std::vector& children) const { PRECONDITION(children.size() == 3, "EverEqTboolBoolLogicalFunction requires 3 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view EverEqTboolBoolLogicalFunction::getType() const { return NAME; } +std::string_view EverEqTboolBoolLogicalFunction::getType() const +{ + return NAME; +} bool EverEqTboolBoolLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string EverEqTboolBoolLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -76,7 +95,9 @@ LogicalFunction EverEqTboolBoolLogicalFunction::withInferredDataType(const Schem std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -86,7 +107,9 @@ SerializableFunction EverEqTboolBoolLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } diff --git a/nes-logical-operators/src/Functions/Meos/EverEqTcbufferTcbufferLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverEqTcbufferTcbufferLogicalFunction.cpp index 5de429ba45..7bb52f7c93 100644 --- a/nes-logical-operators/src/Functions/Meos/EverEqTcbufferTcbufferLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/EverEqTcbufferTcbufferLogicalFunction.cpp @@ -26,67 +26,89 @@ namespace NES { -EverEqTcbufferTcbufferLogicalFunction::EverEqTcbufferTcbufferLogicalFunction( - LogicalFunction lon1, LogicalFunction lat1, LogicalFunction r1, LogicalFunction ts1, - LogicalFunction lon2, LogicalFunction lat2, LogicalFunction r2, LogicalFunction ts2) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +EverEqTcbufferTcbufferLogicalFunction::EverEqTcbufferTcbufferLogicalFunction(LogicalFunction lonA, + LogicalFunction latA, + LogicalFunction radiusA, + LogicalFunction tsA, + LogicalFunction lonB, + LogicalFunction latB, + LogicalFunction radiusB, + LogicalFunction tsB) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) { parameters.reserve(8); - parameters.push_back(std::move(lon1)); - parameters.push_back(std::move(lat1)); - parameters.push_back(std::move(r1)); - parameters.push_back(std::move(ts1)); - parameters.push_back(std::move(lon2)); - parameters.push_back(std::move(lat2)); - parameters.push_back(std::move(r2)); - parameters.push_back(std::move(ts2)); + parameters.push_back(std::move(lonA)); + parameters.push_back(std::move(latA)); + parameters.push_back(std::move(radiusA)); + parameters.push_back(std::move(tsA)); + parameters.push_back(std::move(lonB)); + parameters.push_back(std::move(latB)); + parameters.push_back(std::move(radiusB)); + parameters.push_back(std::move(tsB)); } -DataType EverEqTcbufferTcbufferLogicalFunction::getDataType() const { return dataType; } +DataType EverEqTcbufferTcbufferLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction EverEqTcbufferTcbufferLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector EverEqTcbufferTcbufferLogicalFunction::getChildren() const { return parameters; } +std::vector EverEqTcbufferTcbufferLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction EverEqTcbufferTcbufferLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 8, - "EverEqTcbufferTcbufferLogicalFunction requires 8 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 8, "EverEqTcbufferTcbufferLogicalFunction requires 8 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view EverEqTcbufferTcbufferLogicalFunction::getType() const { return NAME; } +std::string_view EverEqTcbufferTcbufferLogicalFunction::getType() const +{ + return NAME; +} bool EverEqTcbufferTcbufferLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string EverEqTcbufferTcbufferLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction EverEqTcbufferTcbufferLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(8); - for (const auto& p : parameters) - c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon1 must be FLOAT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat1 must be FLOAT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "r1 must be FLOAT64"); - INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); - INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "lon2 must be FLOAT64"); - INVARIANT(c[5].getDataType().isType(DataType::Type::FLOAT64), "lat2 must be FLOAT64"); - INVARIANT(c[6].getDataType().isType(DataType::Type::FLOAT64), "r2 must be FLOAT64"); - INVARIANT(c[7].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction EverEqTcbufferTcbufferLogicalFunction::serialize() const @@ -95,7 +117,9 @@ SerializableFunction EverEqTcbufferTcbufferLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -105,14 +129,15 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEve PRECONDITION(arguments.children.size() == 8, "EverEqTcbufferTcbufferLogicalFunction requires 8 children but got {}", arguments.children.size()); - return EverEqTcbufferTcbufferLogicalFunction(std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2]), - std::move(arguments.children[3]), - std::move(arguments.children[4]), - std::move(arguments.children[5]), - std::move(arguments.children[6]), - std::move(arguments.children[7])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + auto arg5 = std::move(arguments.children[5]); + auto arg6 = std::move(arguments.children[6]); + auto arg7 = std::move(arguments.children[7]); + return EverEqTcbufferTcbufferLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6), std::move(arg7)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverEqTextTtextLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverEqTextTtextLogicalFunction.cpp index 904e7ebf6b..ee6fc42cf3 100644 --- a/nes-logical-operators/src/Functions/Meos/EverEqTextTtextLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/EverEqTextTtextLogicalFunction.cpp @@ -13,81 +13,116 @@ */ #include -#include -#include -#include -#include + #include +#include #include -#include -#include -#include #include +#include +#include +#include #include -#include -#include -#include -#include - -namespace NES { -EverEqTextTtextLogicalFunction::EverEqTextTtextLogicalFunction( - LogicalFunction value, LogicalFunction ref, LogicalFunction ts) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { - parameters = {std::move(value), std::move(ref), std::move(ts)}; +namespace NES +{ + +EverEqTextTtextLogicalFunction::EverEqTextTtextLogicalFunction(LogicalFunction arg0, + LogicalFunction value, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(arg0)); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(ts)); } -DataType EverEqTextTtextLogicalFunction::getDataType() const { return dataType; } +DataType EverEqTextTtextLogicalFunction::getDataType() const +{ + return dataType; +} -LogicalFunction EverEqTextTtextLogicalFunction::withDataType(const DataType& dt) const { - auto c = *this; c.dataType = dt; return c; +LogicalFunction EverEqTextTtextLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector EverEqTextTtextLogicalFunction::getChildren() const { return parameters; } +std::vector EverEqTextTtextLogicalFunction::getChildren() const +{ + return parameters; +} -LogicalFunction EverEqTextTtextLogicalFunction::withChildren(const std::vector& ch) const { - PRECONDITION(ch.size() == 3, "EverEqTextTtext expects 3 params, got {}", ch.size()); - auto c = *this; c.parameters = ch; return c; +LogicalFunction EverEqTextTtextLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "EverEqTextTtextLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view EverEqTextTtextLogicalFunction::getType() const { return NAME; } +std::string_view EverEqTextTtextLogicalFunction::getType() const +{ + return NAME; +} -bool EverEqTextTtextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { - const auto* o = dynamic_cast(&rhs); - return o && parameters == o->parameters; +bool EverEqTextTtextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } + return false; } -std::string EverEqTextTtextLogicalFunction::explain(ExplainVerbosity v) const { - return fmt::format("EverEqTextTtext({}, {}, {})", - parameters[0].explain(v), parameters[1].explain(v), parameters[2].explain(v)); +std::string EverEqTextTtextLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } -LogicalFunction EverEqTextTtextLogicalFunction::withInferredDataType(const Schema& s) const { - std::vector ch; - ch.reserve(3); - for (auto& p : parameters) ch.push_back(p.withInferredDataType(s)); - auto isStr = [](const DataType& dt) { return dt.isType(DataType::Type::VARSIZED); }; - auto isTime = [](const DataType& dt) { return dt.isType(DataType::Type::UINT64); }; - INVARIANT(isStr(ch[0].getDataType()) && isStr(ch[1].getDataType()) && isTime(ch[2].getDataType()), - "EverEqTextTtext: expects (VARCHAR, VARCHAR, UINT64)"); - return withChildren(ch); +LogicalFunction EverEqTextTtextLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } -SerializableFunction EverEqTextTtextLogicalFunction::serialize() const { - SerializableFunction sf; - sf.set_function_type(std::string(NAME)); - for (auto& p : parameters) *sf.add_children() = p.serialize(); - DataTypeSerializationUtil::serializeDataType(dataType, sf.mutable_data_type()); - return sf; +SerializableFunction EverEqTextTtextLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } + return proto; } -LogicalFunctionRegistryReturnType -LogicalFunctionGeneratedRegistrar::RegisterEverEqTextTtextLogicalFunction( - LogicalFunctionRegistryArguments arguments) { +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverEqTextTtextLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ PRECONDITION(arguments.children.size() == 3, - "EverEqTextTtext expects 3 params, got {}", arguments.children.size()); - return EverEqTextTtextLogicalFunction( - arguments.children[0], arguments.children[1], arguments.children[2]); + "EverEqTextTtextLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return EverEqTextTtextLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverEqTgeoGeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverEqTgeoGeoLogicalFunction.cpp index a3be680597..f5df65830b 100644 --- a/nes-logical-operators/src/Functions/Meos/EverEqTgeoGeoLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/EverEqTgeoGeoLogicalFunction.cpp @@ -26,60 +26,81 @@ namespace NES { -EverEqTgeoGeoLogicalFunction::EverEqTgeoGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, - LogicalFunction ts, LogicalFunction wkt) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +EverEqTgeoGeoLogicalFunction::EverEqTgeoGeoLogicalFunction(LogicalFunction lon, + LogicalFunction lat, + LogicalFunction timestamp, + LogicalFunction geometry) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) { parameters.reserve(4); parameters.push_back(std::move(lon)); parameters.push_back(std::move(lat)); - parameters.push_back(std::move(ts)); - parameters.push_back(std::move(wkt)); + parameters.push_back(std::move(timestamp)); + parameters.push_back(std::move(geometry)); } -DataType EverEqTgeoGeoLogicalFunction::getDataType() const { return dataType; } +DataType EverEqTgeoGeoLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction EverEqTgeoGeoLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector EverEqTgeoGeoLogicalFunction::getChildren() const { return parameters; } +std::vector EverEqTgeoGeoLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction EverEqTgeoGeoLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 4, - "EverEqTgeoGeoLogicalFunction requires 4 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 4, "EverEqTgeoGeoLogicalFunction requires 4 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view EverEqTgeoGeoLogicalFunction::getType() const { return NAME; } +std::string_view EverEqTgeoGeoLogicalFunction::getType() const +{ + return NAME; +} bool EverEqTgeoGeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string EverEqTgeoGeoLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction EverEqTgeoGeoLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(4); - c.emplace_back(parameters[0].withInferredDataType(schema)); - c.emplace_back(parameters[1].withInferredDataType(schema)); - c.emplace_back(parameters[2].withInferredDataType(schema)); - c.emplace_back(parameters[3].withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon must be FLOAT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat must be FLOAT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); - INVARIANT(c[3].getDataType().isType(DataType::Type::VARSIZED),"wkt must be VARSIZED"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction EverEqTgeoGeoLogicalFunction::serialize() const @@ -88,7 +109,9 @@ SerializableFunction EverEqTgeoGeoLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -98,10 +121,11 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEve PRECONDITION(arguments.children.size() == 4, "EverEqTgeoGeoLogicalFunction requires 4 children but got {}", arguments.children.size()); - return EverEqTgeoGeoLogicalFunction(std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2]), - std::move(arguments.children[3])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + return EverEqTgeoGeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverEqTgeoTgeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverEqTgeoTgeoLogicalFunction.cpp index d5c28eae46..9f6d953b1e 100644 --- a/nes-logical-operators/src/Functions/Meos/EverEqTgeoTgeoLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/EverEqTgeoTgeoLogicalFunction.cpp @@ -26,61 +26,85 @@ namespace NES { -EverEqTgeoTgeoLogicalFunction::EverEqTgeoTgeoLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction ts1, LogicalFunction lon2, LogicalFunction lat2, LogicalFunction ts2) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +EverEqTgeoTgeoLogicalFunction::EverEqTgeoTgeoLogicalFunction(LogicalFunction lonA, + LogicalFunction latA, + LogicalFunction tsA, + LogicalFunction lonB, + LogicalFunction latB, + LogicalFunction tsB) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) { parameters.reserve(6); - parameters.push_back(std::move(lon1)); - parameters.push_back(std::move(lat1)); - parameters.push_back(std::move(ts1)); - parameters.push_back(std::move(lon2)); - parameters.push_back(std::move(lat2)); - parameters.push_back(std::move(ts2)); + parameters.push_back(std::move(lonA)); + parameters.push_back(std::move(latA)); + parameters.push_back(std::move(tsA)); + parameters.push_back(std::move(lonB)); + parameters.push_back(std::move(latB)); + parameters.push_back(std::move(tsB)); } -DataType EverEqTgeoTgeoLogicalFunction::getDataType() const { return dataType; } +DataType EverEqTgeoTgeoLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction EverEqTgeoTgeoLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector EverEqTgeoTgeoLogicalFunction::getChildren() const { return parameters; } +std::vector EverEqTgeoTgeoLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction EverEqTgeoTgeoLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 6, - "EverEqTgeoTgeoLogicalFunction requires 6 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 6, "EverEqTgeoTgeoLogicalFunction requires 6 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view EverEqTgeoTgeoLogicalFunction::getType() const { return NAME; } +std::string_view EverEqTgeoTgeoLogicalFunction::getType() const +{ + return NAME; +} bool EverEqTgeoTgeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string EverEqTgeoTgeoLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction EverEqTgeoTgeoLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(6); - for (const auto& p : parameters) - c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon1 must be FLOAT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat1 must be FLOAT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); - INVARIANT(c[3].getDataType().isType(DataType::Type::FLOAT64), "lon2 must be FLOAT64"); - INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "lat2 must be FLOAT64"); - INVARIANT(c[5].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction EverEqTgeoTgeoLogicalFunction::serialize() const @@ -89,7 +113,9 @@ SerializableFunction EverEqTgeoTgeoLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -99,13 +125,13 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEve PRECONDITION(arguments.children.size() == 6, "EverEqTgeoTgeoLogicalFunction requires 6 children but got {}", arguments.children.size()); - return EverEqTgeoTgeoLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2]), - std::move(arguments.children[3]), - std::move(arguments.children[4]), - std::move(arguments.children[5])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + auto arg5 = std::move(arguments.children[5]); + return EverEqTgeoTgeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverEqTh3indexH3indexLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverEqTh3indexH3indexLogicalFunction.cpp index 7c6aabf12e..34752cdb45 100644 --- a/nes-logical-operators/src/Functions/Meos/EverEqTh3indexH3indexLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/EverEqTh3indexH3indexLogicalFunction.cpp @@ -26,57 +26,79 @@ namespace NES { -EverEqTh3indexH3indexLogicalFunction::EverEqTh3indexH3indexLogicalFunction(LogicalFunction cell, LogicalFunction ts, - LogicalFunction target) +EverEqTh3indexH3indexLogicalFunction::EverEqTh3indexH3indexLogicalFunction(LogicalFunction cell, + LogicalFunction ts, + LogicalFunction arg0) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(3); parameters.push_back(std::move(cell)); parameters.push_back(std::move(ts)); - parameters.push_back(std::move(target)); + parameters.push_back(std::move(arg0)); } -DataType EverEqTh3indexH3indexLogicalFunction::getDataType() const { return dataType; } +DataType EverEqTh3indexH3indexLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction EverEqTh3indexH3indexLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector EverEqTh3indexH3indexLogicalFunction::getChildren() const { return parameters; } +std::vector EverEqTh3indexH3indexLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction EverEqTh3indexH3indexLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 3, - "EverEqTh3indexH3indexLogicalFunction requires 3 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 3, "EverEqTh3indexH3indexLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view EverEqTh3indexH3indexLogicalFunction::getType() const { return NAME; } +std::string_view EverEqTh3indexH3indexLogicalFunction::getType() const +{ + return NAME; +} bool EverEqTh3indexH3indexLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string EverEqTh3indexH3indexLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction EverEqTh3indexH3indexLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(3); - c.emplace_back(parameters[0].withInferredDataType(schema)); - c.emplace_back(parameters[1].withInferredDataType(schema)); - c.emplace_back(parameters[2].withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "cell must be UINT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "target must be UINT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction EverEqTh3indexH3indexLogicalFunction::serialize() const @@ -85,7 +107,9 @@ SerializableFunction EverEqTh3indexH3indexLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -95,9 +119,10 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEve PRECONDITION(arguments.children.size() == 3, "EverEqTh3indexH3indexLogicalFunction requires 3 children but got {}", arguments.children.size()); - return EverEqTh3indexH3indexLogicalFunction(std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return EverEqTh3indexH3indexLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverEqTjsonbJsonbLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverEqTjsonbJsonbLogicalFunction.cpp index 9afc80111a..5056a5e819 100644 --- a/nes-logical-operators/src/Functions/Meos/EverEqTjsonbJsonbLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/EverEqTjsonbJsonbLogicalFunction.cpp @@ -26,55 +26,79 @@ namespace NES { -EverEqTjsonbJsonbLogicalFunction::EverEqTjsonbJsonbLogicalFunction(LogicalFunction json_str, LogicalFunction ts, LogicalFunction target_json) +EverEqTjsonbJsonbLogicalFunction::EverEqTjsonbJsonbLogicalFunction(LogicalFunction json_str, + LogicalFunction ts, + LogicalFunction arg0) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(3); parameters.push_back(std::move(json_str)); parameters.push_back(std::move(ts)); - parameters.push_back(std::move(target_json)); + parameters.push_back(std::move(arg0)); } -DataType EverEqTjsonbJsonbLogicalFunction::getDataType() const { return dataType; } +DataType EverEqTjsonbJsonbLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction EverEqTjsonbJsonbLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector EverEqTjsonbJsonbLogicalFunction::getChildren() const { return parameters; } +std::vector EverEqTjsonbJsonbLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction EverEqTjsonbJsonbLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 3, - "EverEqTjsonbJsonbLogicalFunction requires 3 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 3, "EverEqTjsonbJsonbLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view EverEqTjsonbJsonbLogicalFunction::getType() const { return NAME; } +std::string_view EverEqTjsonbJsonbLogicalFunction::getType() const +{ + return NAME; +} bool EverEqTjsonbJsonbLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string EverEqTjsonbJsonbLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction EverEqTjsonbJsonbLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(3); - for (const auto& p : parameters) - c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "json_str must be VARSIZED"); - INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::VARSIZED), "target_json must be VARSIZED"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction EverEqTjsonbJsonbLogicalFunction::serialize() const @@ -83,7 +107,9 @@ SerializableFunction EverEqTjsonbJsonbLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -93,10 +119,10 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEve PRECONDITION(arguments.children.size() == 3, "EverEqTjsonbJsonbLogicalFunction requires 3 children but got {}", arguments.children.size()); - return EverEqTjsonbJsonbLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return EverEqTjsonbJsonbLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverEqTjsonbTjsonbLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverEqTjsonbTjsonbLogicalFunction.cpp index 0e675053a7..46940a49fd 100644 --- a/nes-logical-operators/src/Functions/Meos/EverEqTjsonbTjsonbLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/EverEqTjsonbTjsonbLogicalFunction.cpp @@ -26,57 +26,81 @@ namespace NES { -EverEqTjsonbTjsonbLogicalFunction::EverEqTjsonbTjsonbLogicalFunction(LogicalFunction json1, LogicalFunction ts1, LogicalFunction json2, LogicalFunction ts2) +EverEqTjsonbTjsonbLogicalFunction::EverEqTjsonbTjsonbLogicalFunction(LogicalFunction json_str, + LogicalFunction ts, + LogicalFunction json0, + LogicalFunction ts0) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(4); - parameters.push_back(std::move(json1)); - parameters.push_back(std::move(ts1)); - parameters.push_back(std::move(json2)); - parameters.push_back(std::move(ts2)); + parameters.push_back(std::move(json_str)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(json0)); + parameters.push_back(std::move(ts0)); } -DataType EverEqTjsonbTjsonbLogicalFunction::getDataType() const { return dataType; } +DataType EverEqTjsonbTjsonbLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction EverEqTjsonbTjsonbLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector EverEqTjsonbTjsonbLogicalFunction::getChildren() const { return parameters; } +std::vector EverEqTjsonbTjsonbLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction EverEqTjsonbTjsonbLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 4, - "EverEqTjsonbTjsonbLogicalFunction requires 4 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 4, "EverEqTjsonbTjsonbLogicalFunction requires 4 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view EverEqTjsonbTjsonbLogicalFunction::getType() const { return NAME; } +std::string_view EverEqTjsonbTjsonbLogicalFunction::getType() const +{ + return NAME; +} bool EverEqTjsonbTjsonbLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string EverEqTjsonbTjsonbLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction EverEqTjsonbTjsonbLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(4); - for (const auto& p : parameters) - c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "json1 must be VARSIZED"); - INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::VARSIZED), "json2 must be VARSIZED"); - INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction EverEqTjsonbTjsonbLogicalFunction::serialize() const @@ -85,7 +109,9 @@ SerializableFunction EverEqTjsonbTjsonbLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -95,11 +121,11 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEve PRECONDITION(arguments.children.size() == 4, "EverEqTjsonbTjsonbLogicalFunction requires 4 children but got {}", arguments.children.size()); - return EverEqTjsonbTjsonbLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2]), - std::move(arguments.children[3])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + return EverEqTjsonbTjsonbLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverEqTnpointNpointLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverEqTnpointNpointLogicalFunction.cpp index f1a267f874..1e3de77220 100644 --- a/nes-logical-operators/src/Functions/Meos/EverEqTnpointNpointLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/EverEqTnpointNpointLogicalFunction.cpp @@ -26,59 +26,83 @@ namespace NES { -EverEqTnpointNpointLogicalFunction::EverEqTnpointNpointLogicalFunction(LogicalFunction rid1, LogicalFunction pos1, LogicalFunction ts, LogicalFunction rid2, LogicalFunction pos2) +EverEqTnpointNpointLogicalFunction::EverEqTnpointNpointLogicalFunction(LogicalFunction rid, + LogicalFunction frac, + LogicalFunction ts, + LogicalFunction rid0, + LogicalFunction frac0) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(5); - parameters.push_back(std::move(rid1)); - parameters.push_back(std::move(pos1)); + parameters.push_back(std::move(rid)); + parameters.push_back(std::move(frac)); parameters.push_back(std::move(ts)); - parameters.push_back(std::move(rid2)); - parameters.push_back(std::move(pos2)); + parameters.push_back(std::move(rid0)); + parameters.push_back(std::move(frac0)); } -DataType EverEqTnpointNpointLogicalFunction::getDataType() const { return dataType; } +DataType EverEqTnpointNpointLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction EverEqTnpointNpointLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector EverEqTnpointNpointLogicalFunction::getChildren() const { return parameters; } +std::vector EverEqTnpointNpointLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction EverEqTnpointNpointLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 5, - "EverEqTnpointNpointLogicalFunction requires 5 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 5, "EverEqTnpointNpointLogicalFunction requires 5 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view EverEqTnpointNpointLogicalFunction::getType() const { return NAME; } +std::string_view EverEqTnpointNpointLogicalFunction::getType() const +{ + return NAME; +} bool EverEqTnpointNpointLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string EverEqTnpointNpointLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction EverEqTnpointNpointLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(5); - for (const auto& p : parameters) - c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "rid1 must be UINT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "pos1 must be FLOAT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); - INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "rid2 must be UINT64"); - INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "pos2 must be FLOAT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction EverEqTnpointNpointLogicalFunction::serialize() const @@ -87,7 +111,9 @@ SerializableFunction EverEqTnpointNpointLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -97,12 +123,12 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEve PRECONDITION(arguments.children.size() == 5, "EverEqTnpointNpointLogicalFunction requires 5 children but got {}", arguments.children.size()); - return EverEqTnpointNpointLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2]), - std::move(arguments.children[3]), - std::move(arguments.children[4])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + return EverEqTnpointNpointLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverEqTnpointTnpointLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverEqTnpointTnpointLogicalFunction.cpp index 78af507a03..5d2f35f867 100644 --- a/nes-logical-operators/src/Functions/Meos/EverEqTnpointTnpointLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/EverEqTnpointTnpointLogicalFunction.cpp @@ -26,63 +26,85 @@ namespace NES { -EverEqTnpointTnpointLogicalFunction::EverEqTnpointTnpointLogicalFunction( - LogicalFunction rid1, LogicalFunction pos1, LogicalFunction ts1, - LogicalFunction rid2, LogicalFunction pos2, LogicalFunction ts2) +EverEqTnpointTnpointLogicalFunction::EverEqTnpointTnpointLogicalFunction(LogicalFunction rid, + LogicalFunction frac, + LogicalFunction ts, + LogicalFunction rid0, + LogicalFunction frac0, + LogicalFunction ts0) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(6); - parameters.push_back(std::move(rid1)); - parameters.push_back(std::move(pos1)); - parameters.push_back(std::move(ts1)); - parameters.push_back(std::move(rid2)); - parameters.push_back(std::move(pos2)); - parameters.push_back(std::move(ts2)); + parameters.push_back(std::move(rid)); + parameters.push_back(std::move(frac)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(rid0)); + parameters.push_back(std::move(frac0)); + parameters.push_back(std::move(ts0)); } -DataType EverEqTnpointTnpointLogicalFunction::getDataType() const { return dataType; } +DataType EverEqTnpointTnpointLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction EverEqTnpointTnpointLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector EverEqTnpointTnpointLogicalFunction::getChildren() const { return parameters; } +std::vector EverEqTnpointTnpointLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction EverEqTnpointTnpointLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 6, - "EverEqTnpointTnpointLogicalFunction requires 6 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 6, "EverEqTnpointTnpointLogicalFunction requires 6 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view EverEqTnpointTnpointLogicalFunction::getType() const { return NAME; } +std::string_view EverEqTnpointTnpointLogicalFunction::getType() const +{ + return NAME; +} bool EverEqTnpointTnpointLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string EverEqTnpointTnpointLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction EverEqTnpointTnpointLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(6); - for (const auto& p : parameters) - c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "rid1 must be UINT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "pos1 must be FLOAT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); - INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "rid2 must be UINT64"); - INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "pos2 must be FLOAT64"); - INVARIANT(c[5].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction EverEqTnpointTnpointLogicalFunction::serialize() const @@ -91,7 +113,9 @@ SerializableFunction EverEqTnpointTnpointLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -101,12 +125,13 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEve PRECONDITION(arguments.children.size() == 6, "EverEqTnpointTnpointLogicalFunction requires 6 children but got {}", arguments.children.size()); - return EverEqTnpointTnpointLogicalFunction(std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2]), - std::move(arguments.children[3]), - std::move(arguments.children[4]), - std::move(arguments.children[5])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + auto arg5 = std::move(arguments.children[5]); + return EverEqTnpointTnpointLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverEqTposePoseLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverEqTposePoseLogicalFunction.cpp index a5b4200952..2e2bec44ee 100644 --- a/nes-logical-operators/src/Functions/Meos/EverEqTposePoseLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/EverEqTposePoseLogicalFunction.cpp @@ -26,7 +26,13 @@ namespace NES { -EverEqTposePoseLogicalFunction::EverEqTposePoseLogicalFunction(LogicalFunction x, LogicalFunction y, LogicalFunction theta, LogicalFunction ts, LogicalFunction x2, LogicalFunction y2, LogicalFunction theta2) +EverEqTposePoseLogicalFunction::EverEqTposePoseLogicalFunction(LogicalFunction x, + LogicalFunction y, + LogicalFunction theta, + LogicalFunction ts, + LogicalFunction px0, + LogicalFunction py0, + LogicalFunction ptheta0) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(7); @@ -34,55 +40,73 @@ EverEqTposePoseLogicalFunction::EverEqTposePoseLogicalFunction(LogicalFunction x parameters.push_back(std::move(y)); parameters.push_back(std::move(theta)); parameters.push_back(std::move(ts)); - parameters.push_back(std::move(x2)); - parameters.push_back(std::move(y2)); - parameters.push_back(std::move(theta2)); + parameters.push_back(std::move(px0)); + parameters.push_back(std::move(py0)); + parameters.push_back(std::move(ptheta0)); } -DataType EverEqTposePoseLogicalFunction::getDataType() const { return dataType; } +DataType EverEqTposePoseLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction EverEqTposePoseLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector EverEqTposePoseLogicalFunction::getChildren() const { return parameters; } +std::vector EverEqTposePoseLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction EverEqTposePoseLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 7, - "EverEqTposePoseLogicalFunction requires 7 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 7, "EverEqTposePoseLogicalFunction requires 7 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view EverEqTposePoseLogicalFunction::getType() const { return NAME; } +std::string_view EverEqTposePoseLogicalFunction::getType() const +{ + return NAME; +} bool EverEqTposePoseLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string EverEqTposePoseLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction EverEqTposePoseLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(7); - for (const auto& p : parameters) - c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "x must be FLOAT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "y must be FLOAT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "theta must be FLOAT64"); - INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); - INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "x2 must be FLOAT64"); - INVARIANT(c[5].getDataType().isType(DataType::Type::FLOAT64), "y2 must be FLOAT64"); - INVARIANT(c[6].getDataType().isType(DataType::Type::FLOAT64), "theta2 must be FLOAT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction EverEqTposePoseLogicalFunction::serialize() const @@ -91,7 +115,9 @@ SerializableFunction EverEqTposePoseLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -101,14 +127,14 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEve PRECONDITION(arguments.children.size() == 7, "EverEqTposePoseLogicalFunction requires 7 children but got {}", arguments.children.size()); - return EverEqTposePoseLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2]), - std::move(arguments.children[3]), - std::move(arguments.children[4]), - std::move(arguments.children[5]), - std::move(arguments.children[6])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + auto arg5 = std::move(arguments.children[5]); + auto arg6 = std::move(arguments.children[6]); + return EverEqTposePoseLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverEqTposeTposeLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverEqTposeTposeLogicalFunction.cpp index cb9c20bc8c..853a1965d8 100644 --- a/nes-logical-operators/src/Functions/Meos/EverEqTposeTposeLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/EverEqTposeTposeLogicalFunction.cpp @@ -26,67 +26,89 @@ namespace NES { -EverEqTposeTposeLogicalFunction::EverEqTposeTposeLogicalFunction( - LogicalFunction x1, LogicalFunction y1, LogicalFunction theta1, LogicalFunction ts1, - LogicalFunction x2, LogicalFunction y2, LogicalFunction theta2, LogicalFunction ts2) +EverEqTposeTposeLogicalFunction::EverEqTposeTposeLogicalFunction(LogicalFunction x, + LogicalFunction y, + LogicalFunction theta, + LogicalFunction ts, + LogicalFunction px0, + LogicalFunction py0, + LogicalFunction ptheta0, + LogicalFunction ts0) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(8); - parameters.push_back(std::move(x1)); - parameters.push_back(std::move(y1)); - parameters.push_back(std::move(theta1)); - parameters.push_back(std::move(ts1)); - parameters.push_back(std::move(x2)); - parameters.push_back(std::move(y2)); - parameters.push_back(std::move(theta2)); - parameters.push_back(std::move(ts2)); + parameters.push_back(std::move(x)); + parameters.push_back(std::move(y)); + parameters.push_back(std::move(theta)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(px0)); + parameters.push_back(std::move(py0)); + parameters.push_back(std::move(ptheta0)); + parameters.push_back(std::move(ts0)); } -DataType EverEqTposeTposeLogicalFunction::getDataType() const { return dataType; } +DataType EverEqTposeTposeLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction EverEqTposeTposeLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector EverEqTposeTposeLogicalFunction::getChildren() const { return parameters; } +std::vector EverEqTposeTposeLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction EverEqTposeTposeLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 8, - "EverEqTposeTposeLogicalFunction requires 8 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 8, "EverEqTposeTposeLogicalFunction requires 8 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view EverEqTposeTposeLogicalFunction::getType() const { return NAME; } +std::string_view EverEqTposeTposeLogicalFunction::getType() const +{ + return NAME; +} bool EverEqTposeTposeLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string EverEqTposeTposeLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction EverEqTposeTposeLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(8); - for (const auto& p : parameters) - c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "x1 must be FLOAT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "y1 must be FLOAT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "theta1 must be FLOAT64"); - INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); - INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "x2 must be FLOAT64"); - INVARIANT(c[5].getDataType().isType(DataType::Type::FLOAT64), "y2 must be FLOAT64"); - INVARIANT(c[6].getDataType().isType(DataType::Type::FLOAT64), "theta2 must be FLOAT64"); - INVARIANT(c[7].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction EverEqTposeTposeLogicalFunction::serialize() const @@ -95,7 +117,9 @@ SerializableFunction EverEqTposeTposeLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -105,14 +129,15 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEve PRECONDITION(arguments.children.size() == 8, "EverEqTposeTposeLogicalFunction requires 8 children but got {}", arguments.children.size()); - return EverEqTposeTposeLogicalFunction(std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2]), - std::move(arguments.children[3]), - std::move(arguments.children[4]), - std::move(arguments.children[5]), - std::move(arguments.children[6]), - std::move(arguments.children[7])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + auto arg5 = std::move(arguments.children[5]); + auto arg6 = std::move(arguments.children[6]); + auto arg7 = std::move(arguments.children[7]); + return EverEqTposeTposeLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6), std::move(arg7)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverEqTquadbinQuadbinLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverEqTquadbinQuadbinLogicalFunction.cpp index 54494e6681..68b91bc2f7 100644 --- a/nes-logical-operators/src/Functions/Meos/EverEqTquadbinQuadbinLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/EverEqTquadbinQuadbinLogicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -25,54 +26,103 @@ namespace NES { -EverEqTquadbinQuadbinLogicalFunction::EverEqTquadbinQuadbinLogicalFunction(LogicalFunction inst_cell, LogicalFunction ts, LogicalFunction cell) +EverEqTquadbinQuadbinLogicalFunction::EverEqTquadbinQuadbinLogicalFunction(LogicalFunction cell, + LogicalFunction ts, + LogicalFunction arg0) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(3); - parameters.push_back(std::move(inst_cell)); - parameters.push_back(std::move(ts)); parameters.push_back(std::move(cell)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(arg0)); +} + +DataType EverEqTquadbinQuadbinLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction EverEqTquadbinQuadbinLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector EverEqTquadbinQuadbinLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction EverEqTquadbinQuadbinLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "EverEqTquadbinQuadbinLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -DataType EverEqTquadbinQuadbinLogicalFunction::getDataType() const { return dataType; } -LogicalFunction EverEqTquadbinQuadbinLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } -std::vector EverEqTquadbinQuadbinLogicalFunction::getChildren() const { return parameters; } -LogicalFunction EverEqTquadbinQuadbinLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size()==3,"EverEqTquadbinQuadbinLogicalFunction requires 3 children, but got {}",children.size()); - auto c=*this; c.parameters=children; return c; + +std::string_view EverEqTquadbinQuadbinLogicalFunction::getType() const +{ + return NAME; } -std::string_view EverEqTquadbinQuadbinLogicalFunction::getType() const { return NAME; } -bool EverEqTquadbinQuadbinLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { - if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + +bool EverEqTquadbinQuadbinLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } return false; } -std::string EverEqTquadbinQuadbinLogicalFunction::explain(ExplainVerbosity v) const { - return fmt::format("{}({})",NAME,parameters[0].explain(v)); + +std::string EverEqTquadbinQuadbinLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } -LogicalFunction EverEqTquadbinQuadbinLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; c.reserve(3); - for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "inst_cell must be UINT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "cell must be UINT64"); - return withChildren(c); + +LogicalFunction EverEqTquadbinQuadbinLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } -SerializableFunction EverEqTquadbinQuadbinLogicalFunction::serialize() const { + +SerializableFunction EverEqTquadbinQuadbinLogicalFunction::serialize() const +{ SerializableFunction proto; proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); - for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } return proto; } + LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverEqTquadbinQuadbinLogicalFunction( LogicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.children.size()==3, + PRECONDITION(arguments.children.size() == 3, "EverEqTquadbinQuadbinLogicalFunction requires 3 children but got {}", arguments.children.size()); - return EverEqTquadbinQuadbinLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return EverEqTquadbinQuadbinLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverEqTtextTextLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverEqTtextTextLogicalFunction.cpp index ab4ee6ed85..d2c4a486b7 100644 --- a/nes-logical-operators/src/Functions/Meos/EverEqTtextTextLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/EverEqTtextTextLogicalFunction.cpp @@ -13,81 +13,116 @@ */ #include -#include -#include -#include -#include + #include +#include #include -#include -#include -#include #include +#include +#include +#include #include -#include -#include -#include -#include - -namespace NES { -EverEqTtextTextLogicalFunction::EverEqTtextTextLogicalFunction( - LogicalFunction value, LogicalFunction ref, LogicalFunction ts) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { - parameters = {std::move(value), std::move(ref), std::move(ts)}; +namespace NES +{ + +EverEqTtextTextLogicalFunction::EverEqTtextTextLogicalFunction(LogicalFunction value, + LogicalFunction ts, + LogicalFunction arg0) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(arg0)); } -DataType EverEqTtextTextLogicalFunction::getDataType() const { return dataType; } +DataType EverEqTtextTextLogicalFunction::getDataType() const +{ + return dataType; +} -LogicalFunction EverEqTtextTextLogicalFunction::withDataType(const DataType& dt) const { - auto c = *this; c.dataType = dt; return c; +LogicalFunction EverEqTtextTextLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector EverEqTtextTextLogicalFunction::getChildren() const { return parameters; } +std::vector EverEqTtextTextLogicalFunction::getChildren() const +{ + return parameters; +} -LogicalFunction EverEqTtextTextLogicalFunction::withChildren(const std::vector& ch) const { - PRECONDITION(ch.size() == 3, "EverEqTtextText expects 3 params, got {}", ch.size()); - auto c = *this; c.parameters = ch; return c; +LogicalFunction EverEqTtextTextLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "EverEqTtextTextLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view EverEqTtextTextLogicalFunction::getType() const { return NAME; } +std::string_view EverEqTtextTextLogicalFunction::getType() const +{ + return NAME; +} -bool EverEqTtextTextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { - const auto* o = dynamic_cast(&rhs); - return o && parameters == o->parameters; +bool EverEqTtextTextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } + return false; } -std::string EverEqTtextTextLogicalFunction::explain(ExplainVerbosity v) const { - return fmt::format("EverEqTtextText({}, {}, {})", - parameters[0].explain(v), parameters[1].explain(v), parameters[2].explain(v)); +std::string EverEqTtextTextLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } -LogicalFunction EverEqTtextTextLogicalFunction::withInferredDataType(const Schema& s) const { - std::vector ch; - ch.reserve(3); - for (auto& p : parameters) ch.push_back(p.withInferredDataType(s)); - auto isStr = [](const DataType& dt) { return dt.isType(DataType::Type::VARSIZED); }; - auto isTime = [](const DataType& dt) { return dt.isType(DataType::Type::UINT64); }; - INVARIANT(isStr(ch[0].getDataType()) && isStr(ch[1].getDataType()) && isTime(ch[2].getDataType()), - "EverEqTtextText: expects (VARCHAR, VARCHAR, UINT64)"); - return withChildren(ch); +LogicalFunction EverEqTtextTextLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } -SerializableFunction EverEqTtextTextLogicalFunction::serialize() const { - SerializableFunction sf; - sf.set_function_type(std::string(NAME)); - for (auto& p : parameters) *sf.add_children() = p.serialize(); - DataTypeSerializationUtil::serializeDataType(dataType, sf.mutable_data_type()); - return sf; +SerializableFunction EverEqTtextTextLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } + return proto; } -LogicalFunctionRegistryReturnType -LogicalFunctionGeneratedRegistrar::RegisterEverEqTtextTextLogicalFunction( - LogicalFunctionRegistryArguments arguments) { +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverEqTtextTextLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ PRECONDITION(arguments.children.size() == 3, - "EverEqTtextText expects 3 params, got {}", arguments.children.size()); - return EverEqTtextTextLogicalFunction( - arguments.children[0], arguments.children[1], arguments.children[2]); + "EverEqTtextTextLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return EverEqTtextTextLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverGeBigintTbigintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverGeBigintTbigintLogicalFunction.cpp index 157c6360ea..78b895c301 100644 --- a/nes-logical-operators/src/Functions/Meos/EverGeBigintTbigintLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/EverGeBigintTbigintLogicalFunction.cpp @@ -26,46 +26,65 @@ namespace NES { -EverGeBigintTbigintLogicalFunction::EverGeBigintTbigintLogicalFunction(LogicalFunction value, - LogicalFunction threshold, - LogicalFunction ts) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +EverGeBigintTbigintLogicalFunction::EverGeBigintTbigintLogicalFunction(LogicalFunction arg0, + LogicalFunction value, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) { parameters.reserve(3); + parameters.push_back(std::move(arg0)); parameters.push_back(std::move(value)); - parameters.push_back(std::move(threshold)); parameters.push_back(std::move(ts)); } -DataType EverGeBigintTbigintLogicalFunction::getDataType() const { return dataType; } +DataType EverGeBigintTbigintLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction EverGeBigintTbigintLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector EverGeBigintTbigintLogicalFunction::getChildren() const { return parameters; } +std::vector EverGeBigintTbigintLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction EverGeBigintTbigintLogicalFunction::withChildren(const std::vector& children) const { PRECONDITION(children.size() == 3, "EverGeBigintTbigintLogicalFunction requires 3 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view EverGeBigintTbigintLogicalFunction::getType() const { return NAME; } +std::string_view EverGeBigintTbigintLogicalFunction::getType() const +{ + return NAME; +} bool EverGeBigintTbigintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string EverGeBigintTbigintLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -76,7 +95,9 @@ LogicalFunction EverGeBigintTbigintLogicalFunction::withInferredDataType(const S std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -86,7 +107,9 @@ SerializableFunction EverGeBigintTbigintLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } diff --git a/nes-logical-operators/src/Functions/Meos/EverGeTbigintBigintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverGeTbigintBigintLogicalFunction.cpp index b1d661e0b8..1c31583392 100644 --- a/nes-logical-operators/src/Functions/Meos/EverGeTbigintBigintLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/EverGeTbigintBigintLogicalFunction.cpp @@ -27,45 +27,64 @@ namespace NES { EverGeTbigintBigintLogicalFunction::EverGeTbigintBigintLogicalFunction(LogicalFunction value, - LogicalFunction threshold, - LogicalFunction ts) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) + LogicalFunction ts, + LogicalFunction arg0) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) { parameters.reserve(3); parameters.push_back(std::move(value)); - parameters.push_back(std::move(threshold)); parameters.push_back(std::move(ts)); + parameters.push_back(std::move(arg0)); } -DataType EverGeTbigintBigintLogicalFunction::getDataType() const { return dataType; } +DataType EverGeTbigintBigintLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction EverGeTbigintBigintLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector EverGeTbigintBigintLogicalFunction::getChildren() const { return parameters; } +std::vector EverGeTbigintBigintLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction EverGeTbigintBigintLogicalFunction::withChildren(const std::vector& children) const { PRECONDITION(children.size() == 3, "EverGeTbigintBigintLogicalFunction requires 3 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view EverGeTbigintBigintLogicalFunction::getType() const { return NAME; } +std::string_view EverGeTbigintBigintLogicalFunction::getType() const +{ + return NAME; +} bool EverGeTbigintBigintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string EverGeTbigintBigintLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -76,7 +95,9 @@ LogicalFunction EverGeTbigintBigintLogicalFunction::withInferredDataType(const S std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -86,7 +107,9 @@ SerializableFunction EverGeTbigintBigintLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } diff --git a/nes-logical-operators/src/Functions/Meos/EverGeTextTtextLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverGeTextTtextLogicalFunction.cpp index 32514633a9..9883fc5650 100644 --- a/nes-logical-operators/src/Functions/Meos/EverGeTextTtextLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/EverGeTextTtextLogicalFunction.cpp @@ -13,81 +13,116 @@ */ #include -#include -#include -#include -#include + #include +#include #include -#include -#include -#include #include +#include +#include +#include #include -#include -#include -#include -#include - -namespace NES { -EverGeTextTtextLogicalFunction::EverGeTextTtextLogicalFunction( - LogicalFunction value, LogicalFunction ref, LogicalFunction ts) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { - parameters = {std::move(value), std::move(ref), std::move(ts)}; +namespace NES +{ + +EverGeTextTtextLogicalFunction::EverGeTextTtextLogicalFunction(LogicalFunction arg0, + LogicalFunction value, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(arg0)); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(ts)); } -DataType EverGeTextTtextLogicalFunction::getDataType() const { return dataType; } +DataType EverGeTextTtextLogicalFunction::getDataType() const +{ + return dataType; +} -LogicalFunction EverGeTextTtextLogicalFunction::withDataType(const DataType& dt) const { - auto c = *this; c.dataType = dt; return c; +LogicalFunction EverGeTextTtextLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector EverGeTextTtextLogicalFunction::getChildren() const { return parameters; } +std::vector EverGeTextTtextLogicalFunction::getChildren() const +{ + return parameters; +} -LogicalFunction EverGeTextTtextLogicalFunction::withChildren(const std::vector& ch) const { - PRECONDITION(ch.size() == 3, "EverGeTextTtext expects 3 params, got {}", ch.size()); - auto c = *this; c.parameters = ch; return c; +LogicalFunction EverGeTextTtextLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "EverGeTextTtextLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view EverGeTextTtextLogicalFunction::getType() const { return NAME; } +std::string_view EverGeTextTtextLogicalFunction::getType() const +{ + return NAME; +} -bool EverGeTextTtextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { - const auto* o = dynamic_cast(&rhs); - return o && parameters == o->parameters; +bool EverGeTextTtextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } + return false; } -std::string EverGeTextTtextLogicalFunction::explain(ExplainVerbosity v) const { - return fmt::format("EverGeTextTtext({}, {}, {})", - parameters[0].explain(v), parameters[1].explain(v), parameters[2].explain(v)); +std::string EverGeTextTtextLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } -LogicalFunction EverGeTextTtextLogicalFunction::withInferredDataType(const Schema& s) const { - std::vector ch; - ch.reserve(3); - for (auto& p : parameters) ch.push_back(p.withInferredDataType(s)); - auto isStr = [](const DataType& dt) { return dt.isType(DataType::Type::VARSIZED); }; - auto isTime = [](const DataType& dt) { return dt.isType(DataType::Type::UINT64); }; - INVARIANT(isStr(ch[0].getDataType()) && isStr(ch[1].getDataType()) && isTime(ch[2].getDataType()), - "EverGeTextTtext: expects (VARCHAR, VARCHAR, UINT64)"); - return withChildren(ch); +LogicalFunction EverGeTextTtextLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } -SerializableFunction EverGeTextTtextLogicalFunction::serialize() const { - SerializableFunction sf; - sf.set_function_type(std::string(NAME)); - for (auto& p : parameters) *sf.add_children() = p.serialize(); - DataTypeSerializationUtil::serializeDataType(dataType, sf.mutable_data_type()); - return sf; +SerializableFunction EverGeTextTtextLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } + return proto; } -LogicalFunctionRegistryReturnType -LogicalFunctionGeneratedRegistrar::RegisterEverGeTextTtextLogicalFunction( - LogicalFunctionRegistryArguments arguments) { +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverGeTextTtextLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ PRECONDITION(arguments.children.size() == 3, - "EverGeTextTtext expects 3 params, got {}", arguments.children.size()); - return EverGeTextTtextLogicalFunction( - arguments.children[0], arguments.children[1], arguments.children[2]); + "EverGeTextTtextLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return EverGeTextTtextLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverGeTtextTextLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverGeTtextTextLogicalFunction.cpp index 9e8108115b..d359fba87b 100644 --- a/nes-logical-operators/src/Functions/Meos/EverGeTtextTextLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/EverGeTtextTextLogicalFunction.cpp @@ -13,81 +13,116 @@ */ #include -#include -#include -#include -#include + #include +#include #include -#include -#include -#include #include +#include +#include +#include #include -#include -#include -#include -#include - -namespace NES { -EverGeTtextTextLogicalFunction::EverGeTtextTextLogicalFunction( - LogicalFunction value, LogicalFunction ref, LogicalFunction ts) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { - parameters = {std::move(value), std::move(ref), std::move(ts)}; +namespace NES +{ + +EverGeTtextTextLogicalFunction::EverGeTtextTextLogicalFunction(LogicalFunction value, + LogicalFunction ts, + LogicalFunction arg0) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(arg0)); } -DataType EverGeTtextTextLogicalFunction::getDataType() const { return dataType; } +DataType EverGeTtextTextLogicalFunction::getDataType() const +{ + return dataType; +} -LogicalFunction EverGeTtextTextLogicalFunction::withDataType(const DataType& dt) const { - auto c = *this; c.dataType = dt; return c; +LogicalFunction EverGeTtextTextLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector EverGeTtextTextLogicalFunction::getChildren() const { return parameters; } +std::vector EverGeTtextTextLogicalFunction::getChildren() const +{ + return parameters; +} -LogicalFunction EverGeTtextTextLogicalFunction::withChildren(const std::vector& ch) const { - PRECONDITION(ch.size() == 3, "EverGeTtextText expects 3 params, got {}", ch.size()); - auto c = *this; c.parameters = ch; return c; +LogicalFunction EverGeTtextTextLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "EverGeTtextTextLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view EverGeTtextTextLogicalFunction::getType() const { return NAME; } +std::string_view EverGeTtextTextLogicalFunction::getType() const +{ + return NAME; +} -bool EverGeTtextTextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { - const auto* o = dynamic_cast(&rhs); - return o && parameters == o->parameters; +bool EverGeTtextTextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } + return false; } -std::string EverGeTtextTextLogicalFunction::explain(ExplainVerbosity v) const { - return fmt::format("EverGeTtextText({}, {}, {})", - parameters[0].explain(v), parameters[1].explain(v), parameters[2].explain(v)); +std::string EverGeTtextTextLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } -LogicalFunction EverGeTtextTextLogicalFunction::withInferredDataType(const Schema& s) const { - std::vector ch; - ch.reserve(3); - for (auto& p : parameters) ch.push_back(p.withInferredDataType(s)); - auto isStr = [](const DataType& dt) { return dt.isType(DataType::Type::VARSIZED); }; - auto isTime = [](const DataType& dt) { return dt.isType(DataType::Type::UINT64); }; - INVARIANT(isStr(ch[0].getDataType()) && isStr(ch[1].getDataType()) && isTime(ch[2].getDataType()), - "EverGeTtextText: expects (VARCHAR, VARCHAR, UINT64)"); - return withChildren(ch); +LogicalFunction EverGeTtextTextLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } -SerializableFunction EverGeTtextTextLogicalFunction::serialize() const { - SerializableFunction sf; - sf.set_function_type(std::string(NAME)); - for (auto& p : parameters) *sf.add_children() = p.serialize(); - DataTypeSerializationUtil::serializeDataType(dataType, sf.mutable_data_type()); - return sf; +SerializableFunction EverGeTtextTextLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } + return proto; } -LogicalFunctionRegistryReturnType -LogicalFunctionGeneratedRegistrar::RegisterEverGeTtextTextLogicalFunction( - LogicalFunctionRegistryArguments arguments) { +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverGeTtextTextLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ PRECONDITION(arguments.children.size() == 3, - "EverGeTtextText expects 3 params, got {}", arguments.children.size()); - return EverGeTtextTextLogicalFunction( - arguments.children[0], arguments.children[1], arguments.children[2]); + "EverGeTtextTextLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return EverGeTtextTextLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverGtBigintTbigintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverGtBigintTbigintLogicalFunction.cpp index 77d6ddc6bb..c792984318 100644 --- a/nes-logical-operators/src/Functions/Meos/EverGtBigintTbigintLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/EverGtBigintTbigintLogicalFunction.cpp @@ -26,46 +26,65 @@ namespace NES { -EverGtBigintTbigintLogicalFunction::EverGtBigintTbigintLogicalFunction(LogicalFunction value, - LogicalFunction threshold, - LogicalFunction ts) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +EverGtBigintTbigintLogicalFunction::EverGtBigintTbigintLogicalFunction(LogicalFunction arg0, + LogicalFunction value, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) { parameters.reserve(3); + parameters.push_back(std::move(arg0)); parameters.push_back(std::move(value)); - parameters.push_back(std::move(threshold)); parameters.push_back(std::move(ts)); } -DataType EverGtBigintTbigintLogicalFunction::getDataType() const { return dataType; } +DataType EverGtBigintTbigintLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction EverGtBigintTbigintLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector EverGtBigintTbigintLogicalFunction::getChildren() const { return parameters; } +std::vector EverGtBigintTbigintLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction EverGtBigintTbigintLogicalFunction::withChildren(const std::vector& children) const { PRECONDITION(children.size() == 3, "EverGtBigintTbigintLogicalFunction requires 3 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view EverGtBigintTbigintLogicalFunction::getType() const { return NAME; } +std::string_view EverGtBigintTbigintLogicalFunction::getType() const +{ + return NAME; +} bool EverGtBigintTbigintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string EverGtBigintTbigintLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -76,7 +95,9 @@ LogicalFunction EverGtBigintTbigintLogicalFunction::withInferredDataType(const S std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -86,7 +107,9 @@ SerializableFunction EverGtBigintTbigintLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } diff --git a/nes-logical-operators/src/Functions/Meos/EverGtTbigintBigintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverGtTbigintBigintLogicalFunction.cpp index f8689bed1f..8da472b003 100644 --- a/nes-logical-operators/src/Functions/Meos/EverGtTbigintBigintLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/EverGtTbigintBigintLogicalFunction.cpp @@ -27,45 +27,64 @@ namespace NES { EverGtTbigintBigintLogicalFunction::EverGtTbigintBigintLogicalFunction(LogicalFunction value, - LogicalFunction threshold, - LogicalFunction ts) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) + LogicalFunction ts, + LogicalFunction arg0) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) { parameters.reserve(3); parameters.push_back(std::move(value)); - parameters.push_back(std::move(threshold)); parameters.push_back(std::move(ts)); + parameters.push_back(std::move(arg0)); } -DataType EverGtTbigintBigintLogicalFunction::getDataType() const { return dataType; } +DataType EverGtTbigintBigintLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction EverGtTbigintBigintLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector EverGtTbigintBigintLogicalFunction::getChildren() const { return parameters; } +std::vector EverGtTbigintBigintLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction EverGtTbigintBigintLogicalFunction::withChildren(const std::vector& children) const { PRECONDITION(children.size() == 3, "EverGtTbigintBigintLogicalFunction requires 3 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view EverGtTbigintBigintLogicalFunction::getType() const { return NAME; } +std::string_view EverGtTbigintBigintLogicalFunction::getType() const +{ + return NAME; +} bool EverGtTbigintBigintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string EverGtTbigintBigintLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -76,7 +95,9 @@ LogicalFunction EverGtTbigintBigintLogicalFunction::withInferredDataType(const S std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -86,7 +107,9 @@ SerializableFunction EverGtTbigintBigintLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } diff --git a/nes-logical-operators/src/Functions/Meos/EverGtTextTtextLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverGtTextTtextLogicalFunction.cpp index 8c77893390..2ca13314b5 100644 --- a/nes-logical-operators/src/Functions/Meos/EverGtTextTtextLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/EverGtTextTtextLogicalFunction.cpp @@ -13,81 +13,116 @@ */ #include -#include -#include -#include -#include + #include +#include #include -#include -#include -#include #include +#include +#include +#include #include -#include -#include -#include -#include - -namespace NES { -EverGtTextTtextLogicalFunction::EverGtTextTtextLogicalFunction( - LogicalFunction value, LogicalFunction ref, LogicalFunction ts) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { - parameters = {std::move(value), std::move(ref), std::move(ts)}; +namespace NES +{ + +EverGtTextTtextLogicalFunction::EverGtTextTtextLogicalFunction(LogicalFunction arg0, + LogicalFunction value, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(arg0)); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(ts)); } -DataType EverGtTextTtextLogicalFunction::getDataType() const { return dataType; } +DataType EverGtTextTtextLogicalFunction::getDataType() const +{ + return dataType; +} -LogicalFunction EverGtTextTtextLogicalFunction::withDataType(const DataType& dt) const { - auto c = *this; c.dataType = dt; return c; +LogicalFunction EverGtTextTtextLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector EverGtTextTtextLogicalFunction::getChildren() const { return parameters; } +std::vector EverGtTextTtextLogicalFunction::getChildren() const +{ + return parameters; +} -LogicalFunction EverGtTextTtextLogicalFunction::withChildren(const std::vector& ch) const { - PRECONDITION(ch.size() == 3, "EverGtTextTtext expects 3 params, got {}", ch.size()); - auto c = *this; c.parameters = ch; return c; +LogicalFunction EverGtTextTtextLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "EverGtTextTtextLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view EverGtTextTtextLogicalFunction::getType() const { return NAME; } +std::string_view EverGtTextTtextLogicalFunction::getType() const +{ + return NAME; +} -bool EverGtTextTtextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { - const auto* o = dynamic_cast(&rhs); - return o && parameters == o->parameters; +bool EverGtTextTtextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } + return false; } -std::string EverGtTextTtextLogicalFunction::explain(ExplainVerbosity v) const { - return fmt::format("EverGtTextTtext({}, {}, {})", - parameters[0].explain(v), parameters[1].explain(v), parameters[2].explain(v)); +std::string EverGtTextTtextLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } -LogicalFunction EverGtTextTtextLogicalFunction::withInferredDataType(const Schema& s) const { - std::vector ch; - ch.reserve(3); - for (auto& p : parameters) ch.push_back(p.withInferredDataType(s)); - auto isStr = [](const DataType& dt) { return dt.isType(DataType::Type::VARSIZED); }; - auto isTime = [](const DataType& dt) { return dt.isType(DataType::Type::UINT64); }; - INVARIANT(isStr(ch[0].getDataType()) && isStr(ch[1].getDataType()) && isTime(ch[2].getDataType()), - "EverGtTextTtext: expects (VARCHAR, VARCHAR, UINT64)"); - return withChildren(ch); +LogicalFunction EverGtTextTtextLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } -SerializableFunction EverGtTextTtextLogicalFunction::serialize() const { - SerializableFunction sf; - sf.set_function_type(std::string(NAME)); - for (auto& p : parameters) *sf.add_children() = p.serialize(); - DataTypeSerializationUtil::serializeDataType(dataType, sf.mutable_data_type()); - return sf; +SerializableFunction EverGtTextTtextLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } + return proto; } -LogicalFunctionRegistryReturnType -LogicalFunctionGeneratedRegistrar::RegisterEverGtTextTtextLogicalFunction( - LogicalFunctionRegistryArguments arguments) { +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverGtTextTtextLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ PRECONDITION(arguments.children.size() == 3, - "EverGtTextTtext expects 3 params, got {}", arguments.children.size()); - return EverGtTextTtextLogicalFunction( - arguments.children[0], arguments.children[1], arguments.children[2]); + "EverGtTextTtextLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return EverGtTextTtextLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverGtTtextTextLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverGtTtextTextLogicalFunction.cpp index d5c5d49221..14e829a997 100644 --- a/nes-logical-operators/src/Functions/Meos/EverGtTtextTextLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/EverGtTtextTextLogicalFunction.cpp @@ -13,81 +13,116 @@ */ #include -#include -#include -#include -#include + #include +#include #include -#include -#include -#include #include +#include +#include +#include #include -#include -#include -#include -#include - -namespace NES { -EverGtTtextTextLogicalFunction::EverGtTtextTextLogicalFunction( - LogicalFunction value, LogicalFunction ref, LogicalFunction ts) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { - parameters = {std::move(value), std::move(ref), std::move(ts)}; +namespace NES +{ + +EverGtTtextTextLogicalFunction::EverGtTtextTextLogicalFunction(LogicalFunction value, + LogicalFunction ts, + LogicalFunction arg0) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(arg0)); } -DataType EverGtTtextTextLogicalFunction::getDataType() const { return dataType; } +DataType EverGtTtextTextLogicalFunction::getDataType() const +{ + return dataType; +} -LogicalFunction EverGtTtextTextLogicalFunction::withDataType(const DataType& dt) const { - auto c = *this; c.dataType = dt; return c; +LogicalFunction EverGtTtextTextLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector EverGtTtextTextLogicalFunction::getChildren() const { return parameters; } +std::vector EverGtTtextTextLogicalFunction::getChildren() const +{ + return parameters; +} -LogicalFunction EverGtTtextTextLogicalFunction::withChildren(const std::vector& ch) const { - PRECONDITION(ch.size() == 3, "EverGtTtextText expects 3 params, got {}", ch.size()); - auto c = *this; c.parameters = ch; return c; +LogicalFunction EverGtTtextTextLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "EverGtTtextTextLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view EverGtTtextTextLogicalFunction::getType() const { return NAME; } +std::string_view EverGtTtextTextLogicalFunction::getType() const +{ + return NAME; +} -bool EverGtTtextTextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { - const auto* o = dynamic_cast(&rhs); - return o && parameters == o->parameters; +bool EverGtTtextTextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } + return false; } -std::string EverGtTtextTextLogicalFunction::explain(ExplainVerbosity v) const { - return fmt::format("EverGtTtextText({}, {}, {})", - parameters[0].explain(v), parameters[1].explain(v), parameters[2].explain(v)); +std::string EverGtTtextTextLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } -LogicalFunction EverGtTtextTextLogicalFunction::withInferredDataType(const Schema& s) const { - std::vector ch; - ch.reserve(3); - for (auto& p : parameters) ch.push_back(p.withInferredDataType(s)); - auto isStr = [](const DataType& dt) { return dt.isType(DataType::Type::VARSIZED); }; - auto isTime = [](const DataType& dt) { return dt.isType(DataType::Type::UINT64); }; - INVARIANT(isStr(ch[0].getDataType()) && isStr(ch[1].getDataType()) && isTime(ch[2].getDataType()), - "EverGtTtextText: expects (VARCHAR, VARCHAR, UINT64)"); - return withChildren(ch); +LogicalFunction EverGtTtextTextLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } -SerializableFunction EverGtTtextTextLogicalFunction::serialize() const { - SerializableFunction sf; - sf.set_function_type(std::string(NAME)); - for (auto& p : parameters) *sf.add_children() = p.serialize(); - DataTypeSerializationUtil::serializeDataType(dataType, sf.mutable_data_type()); - return sf; +SerializableFunction EverGtTtextTextLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } + return proto; } -LogicalFunctionRegistryReturnType -LogicalFunctionGeneratedRegistrar::RegisterEverGtTtextTextLogicalFunction( - LogicalFunctionRegistryArguments arguments) { +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverGtTtextTextLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ PRECONDITION(arguments.children.size() == 3, - "EverGtTtextText expects 3 params, got {}", arguments.children.size()); - return EverGtTtextTextLogicalFunction( - arguments.children[0], arguments.children[1], arguments.children[2]); + "EverGtTtextTextLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return EverGtTtextTextLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverLeBigintTbigintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverLeBigintTbigintLogicalFunction.cpp index 08cf99bcde..881ba52b9f 100644 --- a/nes-logical-operators/src/Functions/Meos/EverLeBigintTbigintLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/EverLeBigintTbigintLogicalFunction.cpp @@ -26,46 +26,65 @@ namespace NES { -EverLeBigintTbigintLogicalFunction::EverLeBigintTbigintLogicalFunction(LogicalFunction value, - LogicalFunction threshold, - LogicalFunction ts) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +EverLeBigintTbigintLogicalFunction::EverLeBigintTbigintLogicalFunction(LogicalFunction arg0, + LogicalFunction value, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) { parameters.reserve(3); + parameters.push_back(std::move(arg0)); parameters.push_back(std::move(value)); - parameters.push_back(std::move(threshold)); parameters.push_back(std::move(ts)); } -DataType EverLeBigintTbigintLogicalFunction::getDataType() const { return dataType; } +DataType EverLeBigintTbigintLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction EverLeBigintTbigintLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector EverLeBigintTbigintLogicalFunction::getChildren() const { return parameters; } +std::vector EverLeBigintTbigintLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction EverLeBigintTbigintLogicalFunction::withChildren(const std::vector& children) const { PRECONDITION(children.size() == 3, "EverLeBigintTbigintLogicalFunction requires 3 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view EverLeBigintTbigintLogicalFunction::getType() const { return NAME; } +std::string_view EverLeBigintTbigintLogicalFunction::getType() const +{ + return NAME; +} bool EverLeBigintTbigintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string EverLeBigintTbigintLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -76,7 +95,9 @@ LogicalFunction EverLeBigintTbigintLogicalFunction::withInferredDataType(const S std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -86,7 +107,9 @@ SerializableFunction EverLeBigintTbigintLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } diff --git a/nes-logical-operators/src/Functions/Meos/EverLeTbigintBigintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverLeTbigintBigintLogicalFunction.cpp index 24d09cd35e..7dc5c9a64f 100644 --- a/nes-logical-operators/src/Functions/Meos/EverLeTbigintBigintLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/EverLeTbigintBigintLogicalFunction.cpp @@ -27,45 +27,64 @@ namespace NES { EverLeTbigintBigintLogicalFunction::EverLeTbigintBigintLogicalFunction(LogicalFunction value, - LogicalFunction threshold, - LogicalFunction ts) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) + LogicalFunction ts, + LogicalFunction arg0) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) { parameters.reserve(3); parameters.push_back(std::move(value)); - parameters.push_back(std::move(threshold)); parameters.push_back(std::move(ts)); + parameters.push_back(std::move(arg0)); } -DataType EverLeTbigintBigintLogicalFunction::getDataType() const { return dataType; } +DataType EverLeTbigintBigintLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction EverLeTbigintBigintLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector EverLeTbigintBigintLogicalFunction::getChildren() const { return parameters; } +std::vector EverLeTbigintBigintLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction EverLeTbigintBigintLogicalFunction::withChildren(const std::vector& children) const { PRECONDITION(children.size() == 3, "EverLeTbigintBigintLogicalFunction requires 3 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view EverLeTbigintBigintLogicalFunction::getType() const { return NAME; } +std::string_view EverLeTbigintBigintLogicalFunction::getType() const +{ + return NAME; +} bool EverLeTbigintBigintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string EverLeTbigintBigintLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -76,7 +95,9 @@ LogicalFunction EverLeTbigintBigintLogicalFunction::withInferredDataType(const S std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -86,7 +107,9 @@ SerializableFunction EverLeTbigintBigintLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } diff --git a/nes-logical-operators/src/Functions/Meos/EverLeTextTtextLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverLeTextTtextLogicalFunction.cpp index 7faac4fac6..2f4dade5f3 100644 --- a/nes-logical-operators/src/Functions/Meos/EverLeTextTtextLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/EverLeTextTtextLogicalFunction.cpp @@ -13,81 +13,116 @@ */ #include -#include -#include -#include -#include + #include +#include #include -#include -#include -#include #include +#include +#include +#include #include -#include -#include -#include -#include - -namespace NES { -EverLeTextTtextLogicalFunction::EverLeTextTtextLogicalFunction( - LogicalFunction value, LogicalFunction ref, LogicalFunction ts) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { - parameters = {std::move(value), std::move(ref), std::move(ts)}; +namespace NES +{ + +EverLeTextTtextLogicalFunction::EverLeTextTtextLogicalFunction(LogicalFunction arg0, + LogicalFunction value, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(arg0)); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(ts)); } -DataType EverLeTextTtextLogicalFunction::getDataType() const { return dataType; } +DataType EverLeTextTtextLogicalFunction::getDataType() const +{ + return dataType; +} -LogicalFunction EverLeTextTtextLogicalFunction::withDataType(const DataType& dt) const { - auto c = *this; c.dataType = dt; return c; +LogicalFunction EverLeTextTtextLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector EverLeTextTtextLogicalFunction::getChildren() const { return parameters; } +std::vector EverLeTextTtextLogicalFunction::getChildren() const +{ + return parameters; +} -LogicalFunction EverLeTextTtextLogicalFunction::withChildren(const std::vector& ch) const { - PRECONDITION(ch.size() == 3, "EverLeTextTtext expects 3 params, got {}", ch.size()); - auto c = *this; c.parameters = ch; return c; +LogicalFunction EverLeTextTtextLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "EverLeTextTtextLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view EverLeTextTtextLogicalFunction::getType() const { return NAME; } +std::string_view EverLeTextTtextLogicalFunction::getType() const +{ + return NAME; +} -bool EverLeTextTtextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { - const auto* o = dynamic_cast(&rhs); - return o && parameters == o->parameters; +bool EverLeTextTtextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } + return false; } -std::string EverLeTextTtextLogicalFunction::explain(ExplainVerbosity v) const { - return fmt::format("EverLeTextTtext({}, {}, {})", - parameters[0].explain(v), parameters[1].explain(v), parameters[2].explain(v)); +std::string EverLeTextTtextLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } -LogicalFunction EverLeTextTtextLogicalFunction::withInferredDataType(const Schema& s) const { - std::vector ch; - ch.reserve(3); - for (auto& p : parameters) ch.push_back(p.withInferredDataType(s)); - auto isStr = [](const DataType& dt) { return dt.isType(DataType::Type::VARSIZED); }; - auto isTime = [](const DataType& dt) { return dt.isType(DataType::Type::UINT64); }; - INVARIANT(isStr(ch[0].getDataType()) && isStr(ch[1].getDataType()) && isTime(ch[2].getDataType()), - "EverLeTextTtext: expects (VARCHAR, VARCHAR, UINT64)"); - return withChildren(ch); +LogicalFunction EverLeTextTtextLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } -SerializableFunction EverLeTextTtextLogicalFunction::serialize() const { - SerializableFunction sf; - sf.set_function_type(std::string(NAME)); - for (auto& p : parameters) *sf.add_children() = p.serialize(); - DataTypeSerializationUtil::serializeDataType(dataType, sf.mutable_data_type()); - return sf; +SerializableFunction EverLeTextTtextLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } + return proto; } -LogicalFunctionRegistryReturnType -LogicalFunctionGeneratedRegistrar::RegisterEverLeTextTtextLogicalFunction( - LogicalFunctionRegistryArguments arguments) { +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverLeTextTtextLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ PRECONDITION(arguments.children.size() == 3, - "EverLeTextTtext expects 3 params, got {}", arguments.children.size()); - return EverLeTextTtextLogicalFunction( - arguments.children[0], arguments.children[1], arguments.children[2]); + "EverLeTextTtextLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return EverLeTextTtextLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverLeTtextTextLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverLeTtextTextLogicalFunction.cpp index b95fde42b0..1bf577de92 100644 --- a/nes-logical-operators/src/Functions/Meos/EverLeTtextTextLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/EverLeTtextTextLogicalFunction.cpp @@ -13,81 +13,116 @@ */ #include -#include -#include -#include -#include + #include +#include #include -#include -#include -#include #include +#include +#include +#include #include -#include -#include -#include -#include - -namespace NES { -EverLeTtextTextLogicalFunction::EverLeTtextTextLogicalFunction( - LogicalFunction value, LogicalFunction ref, LogicalFunction ts) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { - parameters = {std::move(value), std::move(ref), std::move(ts)}; +namespace NES +{ + +EverLeTtextTextLogicalFunction::EverLeTtextTextLogicalFunction(LogicalFunction value, + LogicalFunction ts, + LogicalFunction arg0) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(arg0)); } -DataType EverLeTtextTextLogicalFunction::getDataType() const { return dataType; } +DataType EverLeTtextTextLogicalFunction::getDataType() const +{ + return dataType; +} -LogicalFunction EverLeTtextTextLogicalFunction::withDataType(const DataType& dt) const { - auto c = *this; c.dataType = dt; return c; +LogicalFunction EverLeTtextTextLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector EverLeTtextTextLogicalFunction::getChildren() const { return parameters; } +std::vector EverLeTtextTextLogicalFunction::getChildren() const +{ + return parameters; +} -LogicalFunction EverLeTtextTextLogicalFunction::withChildren(const std::vector& ch) const { - PRECONDITION(ch.size() == 3, "EverLeTtextText expects 3 params, got {}", ch.size()); - auto c = *this; c.parameters = ch; return c; +LogicalFunction EverLeTtextTextLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "EverLeTtextTextLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view EverLeTtextTextLogicalFunction::getType() const { return NAME; } +std::string_view EverLeTtextTextLogicalFunction::getType() const +{ + return NAME; +} -bool EverLeTtextTextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { - const auto* o = dynamic_cast(&rhs); - return o && parameters == o->parameters; +bool EverLeTtextTextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } + return false; } -std::string EverLeTtextTextLogicalFunction::explain(ExplainVerbosity v) const { - return fmt::format("EverLeTtextText({}, {}, {})", - parameters[0].explain(v), parameters[1].explain(v), parameters[2].explain(v)); +std::string EverLeTtextTextLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } -LogicalFunction EverLeTtextTextLogicalFunction::withInferredDataType(const Schema& s) const { - std::vector ch; - ch.reserve(3); - for (auto& p : parameters) ch.push_back(p.withInferredDataType(s)); - auto isStr = [](const DataType& dt) { return dt.isType(DataType::Type::VARSIZED); }; - auto isTime = [](const DataType& dt) { return dt.isType(DataType::Type::UINT64); }; - INVARIANT(isStr(ch[0].getDataType()) && isStr(ch[1].getDataType()) && isTime(ch[2].getDataType()), - "EverLeTtextText: expects (VARCHAR, VARCHAR, UINT64)"); - return withChildren(ch); +LogicalFunction EverLeTtextTextLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } -SerializableFunction EverLeTtextTextLogicalFunction::serialize() const { - SerializableFunction sf; - sf.set_function_type(std::string(NAME)); - for (auto& p : parameters) *sf.add_children() = p.serialize(); - DataTypeSerializationUtil::serializeDataType(dataType, sf.mutable_data_type()); - return sf; +SerializableFunction EverLeTtextTextLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } + return proto; } -LogicalFunctionRegistryReturnType -LogicalFunctionGeneratedRegistrar::RegisterEverLeTtextTextLogicalFunction( - LogicalFunctionRegistryArguments arguments) { +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverLeTtextTextLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ PRECONDITION(arguments.children.size() == 3, - "EverLeTtextText expects 3 params, got {}", arguments.children.size()); - return EverLeTtextTextLogicalFunction( - arguments.children[0], arguments.children[1], arguments.children[2]); + "EverLeTtextTextLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return EverLeTtextTextLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverLtBigintTbigintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverLtBigintTbigintLogicalFunction.cpp index 23a4675cd9..b7a990d9de 100644 --- a/nes-logical-operators/src/Functions/Meos/EverLtBigintTbigintLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/EverLtBigintTbigintLogicalFunction.cpp @@ -26,46 +26,65 @@ namespace NES { -EverLtBigintTbigintLogicalFunction::EverLtBigintTbigintLogicalFunction(LogicalFunction value, - LogicalFunction threshold, - LogicalFunction ts) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +EverLtBigintTbigintLogicalFunction::EverLtBigintTbigintLogicalFunction(LogicalFunction arg0, + LogicalFunction value, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) { parameters.reserve(3); + parameters.push_back(std::move(arg0)); parameters.push_back(std::move(value)); - parameters.push_back(std::move(threshold)); parameters.push_back(std::move(ts)); } -DataType EverLtBigintTbigintLogicalFunction::getDataType() const { return dataType; } +DataType EverLtBigintTbigintLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction EverLtBigintTbigintLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector EverLtBigintTbigintLogicalFunction::getChildren() const { return parameters; } +std::vector EverLtBigintTbigintLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction EverLtBigintTbigintLogicalFunction::withChildren(const std::vector& children) const { PRECONDITION(children.size() == 3, "EverLtBigintTbigintLogicalFunction requires 3 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view EverLtBigintTbigintLogicalFunction::getType() const { return NAME; } +std::string_view EverLtBigintTbigintLogicalFunction::getType() const +{ + return NAME; +} bool EverLtBigintTbigintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string EverLtBigintTbigintLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -76,7 +95,9 @@ LogicalFunction EverLtBigintTbigintLogicalFunction::withInferredDataType(const S std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -86,7 +107,9 @@ SerializableFunction EverLtBigintTbigintLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } diff --git a/nes-logical-operators/src/Functions/Meos/EverLtTbigintBigintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverLtTbigintBigintLogicalFunction.cpp index 010345f59c..961b849b64 100644 --- a/nes-logical-operators/src/Functions/Meos/EverLtTbigintBigintLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/EverLtTbigintBigintLogicalFunction.cpp @@ -27,45 +27,64 @@ namespace NES { EverLtTbigintBigintLogicalFunction::EverLtTbigintBigintLogicalFunction(LogicalFunction value, - LogicalFunction threshold, - LogicalFunction ts) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) + LogicalFunction ts, + LogicalFunction arg0) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) { parameters.reserve(3); parameters.push_back(std::move(value)); - parameters.push_back(std::move(threshold)); parameters.push_back(std::move(ts)); + parameters.push_back(std::move(arg0)); } -DataType EverLtTbigintBigintLogicalFunction::getDataType() const { return dataType; } +DataType EverLtTbigintBigintLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction EverLtTbigintBigintLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector EverLtTbigintBigintLogicalFunction::getChildren() const { return parameters; } +std::vector EverLtTbigintBigintLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction EverLtTbigintBigintLogicalFunction::withChildren(const std::vector& children) const { PRECONDITION(children.size() == 3, "EverLtTbigintBigintLogicalFunction requires 3 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view EverLtTbigintBigintLogicalFunction::getType() const { return NAME; } +std::string_view EverLtTbigintBigintLogicalFunction::getType() const +{ + return NAME; +} bool EverLtTbigintBigintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string EverLtTbigintBigintLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -76,7 +95,9 @@ LogicalFunction EverLtTbigintBigintLogicalFunction::withInferredDataType(const S std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -86,7 +107,9 @@ SerializableFunction EverLtTbigintBigintLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } diff --git a/nes-logical-operators/src/Functions/Meos/EverLtTextTtextLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverLtTextTtextLogicalFunction.cpp index 0b0e26d872..770c5616d2 100644 --- a/nes-logical-operators/src/Functions/Meos/EverLtTextTtextLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/EverLtTextTtextLogicalFunction.cpp @@ -13,81 +13,116 @@ */ #include -#include -#include -#include -#include + #include +#include #include -#include -#include -#include #include +#include +#include +#include #include -#include -#include -#include -#include - -namespace NES { -EverLtTextTtextLogicalFunction::EverLtTextTtextLogicalFunction( - LogicalFunction value, LogicalFunction ref, LogicalFunction ts) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { - parameters = {std::move(value), std::move(ref), std::move(ts)}; +namespace NES +{ + +EverLtTextTtextLogicalFunction::EverLtTextTtextLogicalFunction(LogicalFunction arg0, + LogicalFunction value, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(arg0)); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(ts)); } -DataType EverLtTextTtextLogicalFunction::getDataType() const { return dataType; } +DataType EverLtTextTtextLogicalFunction::getDataType() const +{ + return dataType; +} -LogicalFunction EverLtTextTtextLogicalFunction::withDataType(const DataType& dt) const { - auto c = *this; c.dataType = dt; return c; +LogicalFunction EverLtTextTtextLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector EverLtTextTtextLogicalFunction::getChildren() const { return parameters; } +std::vector EverLtTextTtextLogicalFunction::getChildren() const +{ + return parameters; +} -LogicalFunction EverLtTextTtextLogicalFunction::withChildren(const std::vector& ch) const { - PRECONDITION(ch.size() == 3, "EverLtTextTtext expects 3 params, got {}", ch.size()); - auto c = *this; c.parameters = ch; return c; +LogicalFunction EverLtTextTtextLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "EverLtTextTtextLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view EverLtTextTtextLogicalFunction::getType() const { return NAME; } +std::string_view EverLtTextTtextLogicalFunction::getType() const +{ + return NAME; +} -bool EverLtTextTtextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { - const auto* o = dynamic_cast(&rhs); - return o && parameters == o->parameters; +bool EverLtTextTtextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } + return false; } -std::string EverLtTextTtextLogicalFunction::explain(ExplainVerbosity v) const { - return fmt::format("EverLtTextTtext({}, {}, {})", - parameters[0].explain(v), parameters[1].explain(v), parameters[2].explain(v)); +std::string EverLtTextTtextLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } -LogicalFunction EverLtTextTtextLogicalFunction::withInferredDataType(const Schema& s) const { - std::vector ch; - ch.reserve(3); - for (auto& p : parameters) ch.push_back(p.withInferredDataType(s)); - auto isStr = [](const DataType& dt) { return dt.isType(DataType::Type::VARSIZED); }; - auto isTime = [](const DataType& dt) { return dt.isType(DataType::Type::UINT64); }; - INVARIANT(isStr(ch[0].getDataType()) && isStr(ch[1].getDataType()) && isTime(ch[2].getDataType()), - "EverLtTextTtext: expects (VARCHAR, VARCHAR, UINT64)"); - return withChildren(ch); +LogicalFunction EverLtTextTtextLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } -SerializableFunction EverLtTextTtextLogicalFunction::serialize() const { - SerializableFunction sf; - sf.set_function_type(std::string(NAME)); - for (auto& p : parameters) *sf.add_children() = p.serialize(); - DataTypeSerializationUtil::serializeDataType(dataType, sf.mutable_data_type()); - return sf; +SerializableFunction EverLtTextTtextLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } + return proto; } -LogicalFunctionRegistryReturnType -LogicalFunctionGeneratedRegistrar::RegisterEverLtTextTtextLogicalFunction( - LogicalFunctionRegistryArguments arguments) { +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverLtTextTtextLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ PRECONDITION(arguments.children.size() == 3, - "EverLtTextTtext expects 3 params, got {}", arguments.children.size()); - return EverLtTextTtextLogicalFunction( - arguments.children[0], arguments.children[1], arguments.children[2]); + "EverLtTextTtextLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return EverLtTextTtextLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverLtTtextTextLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverLtTtextTextLogicalFunction.cpp index 2164cb10f1..5c9c4b205f 100644 --- a/nes-logical-operators/src/Functions/Meos/EverLtTtextTextLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/EverLtTtextTextLogicalFunction.cpp @@ -13,81 +13,116 @@ */ #include -#include -#include -#include -#include + #include +#include #include -#include -#include -#include #include +#include +#include +#include #include -#include -#include -#include -#include - -namespace NES { -EverLtTtextTextLogicalFunction::EverLtTtextTextLogicalFunction( - LogicalFunction value, LogicalFunction ref, LogicalFunction ts) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { - parameters = {std::move(value), std::move(ref), std::move(ts)}; +namespace NES +{ + +EverLtTtextTextLogicalFunction::EverLtTtextTextLogicalFunction(LogicalFunction value, + LogicalFunction ts, + LogicalFunction arg0) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(arg0)); } -DataType EverLtTtextTextLogicalFunction::getDataType() const { return dataType; } +DataType EverLtTtextTextLogicalFunction::getDataType() const +{ + return dataType; +} -LogicalFunction EverLtTtextTextLogicalFunction::withDataType(const DataType& dt) const { - auto c = *this; c.dataType = dt; return c; +LogicalFunction EverLtTtextTextLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector EverLtTtextTextLogicalFunction::getChildren() const { return parameters; } +std::vector EverLtTtextTextLogicalFunction::getChildren() const +{ + return parameters; +} -LogicalFunction EverLtTtextTextLogicalFunction::withChildren(const std::vector& ch) const { - PRECONDITION(ch.size() == 3, "EverLtTtextText expects 3 params, got {}", ch.size()); - auto c = *this; c.parameters = ch; return c; +LogicalFunction EverLtTtextTextLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "EverLtTtextTextLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view EverLtTtextTextLogicalFunction::getType() const { return NAME; } +std::string_view EverLtTtextTextLogicalFunction::getType() const +{ + return NAME; +} -bool EverLtTtextTextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { - const auto* o = dynamic_cast(&rhs); - return o && parameters == o->parameters; +bool EverLtTtextTextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } + return false; } -std::string EverLtTtextTextLogicalFunction::explain(ExplainVerbosity v) const { - return fmt::format("EverLtTtextText({}, {}, {})", - parameters[0].explain(v), parameters[1].explain(v), parameters[2].explain(v)); +std::string EverLtTtextTextLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } -LogicalFunction EverLtTtextTextLogicalFunction::withInferredDataType(const Schema& s) const { - std::vector ch; - ch.reserve(3); - for (auto& p : parameters) ch.push_back(p.withInferredDataType(s)); - auto isStr = [](const DataType& dt) { return dt.isType(DataType::Type::VARSIZED); }; - auto isTime = [](const DataType& dt) { return dt.isType(DataType::Type::UINT64); }; - INVARIANT(isStr(ch[0].getDataType()) && isStr(ch[1].getDataType()) && isTime(ch[2].getDataType()), - "EverLtTtextText: expects (VARCHAR, VARCHAR, UINT64)"); - return withChildren(ch); +LogicalFunction EverLtTtextTextLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } -SerializableFunction EverLtTtextTextLogicalFunction::serialize() const { - SerializableFunction sf; - sf.set_function_type(std::string(NAME)); - for (auto& p : parameters) *sf.add_children() = p.serialize(); - DataTypeSerializationUtil::serializeDataType(dataType, sf.mutable_data_type()); - return sf; +SerializableFunction EverLtTtextTextLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } + return proto; } -LogicalFunctionRegistryReturnType -LogicalFunctionGeneratedRegistrar::RegisterEverLtTtextTextLogicalFunction( - LogicalFunctionRegistryArguments arguments) { +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverLtTtextTextLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ PRECONDITION(arguments.children.size() == 3, - "EverLtTtextText expects 3 params, got {}", arguments.children.size()); - return EverLtTtextTextLogicalFunction( - arguments.children[0], arguments.children[1], arguments.children[2]); + "EverLtTtextTextLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return EverLtTtextTextLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverNeBigintTbigintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverNeBigintTbigintLogicalFunction.cpp index 12e7611d5f..6d5d2c09e3 100644 --- a/nes-logical-operators/src/Functions/Meos/EverNeBigintTbigintLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/EverNeBigintTbigintLogicalFunction.cpp @@ -26,46 +26,65 @@ namespace NES { -EverNeBigintTbigintLogicalFunction::EverNeBigintTbigintLogicalFunction(LogicalFunction value, - LogicalFunction threshold, - LogicalFunction ts) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +EverNeBigintTbigintLogicalFunction::EverNeBigintTbigintLogicalFunction(LogicalFunction arg0, + LogicalFunction value, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) { parameters.reserve(3); + parameters.push_back(std::move(arg0)); parameters.push_back(std::move(value)); - parameters.push_back(std::move(threshold)); parameters.push_back(std::move(ts)); } -DataType EverNeBigintTbigintLogicalFunction::getDataType() const { return dataType; } +DataType EverNeBigintTbigintLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction EverNeBigintTbigintLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector EverNeBigintTbigintLogicalFunction::getChildren() const { return parameters; } +std::vector EverNeBigintTbigintLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction EverNeBigintTbigintLogicalFunction::withChildren(const std::vector& children) const { PRECONDITION(children.size() == 3, "EverNeBigintTbigintLogicalFunction requires 3 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view EverNeBigintTbigintLogicalFunction::getType() const { return NAME; } +std::string_view EverNeBigintTbigintLogicalFunction::getType() const +{ + return NAME; +} bool EverNeBigintTbigintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string EverNeBigintTbigintLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -76,7 +95,9 @@ LogicalFunction EverNeBigintTbigintLogicalFunction::withInferredDataType(const S std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -86,7 +107,9 @@ SerializableFunction EverNeBigintTbigintLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } diff --git a/nes-logical-operators/src/Functions/Meos/EverNeBoolTboolLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverNeBoolTboolLogicalFunction.cpp index 97a13892b0..053999a793 100644 --- a/nes-logical-operators/src/Functions/Meos/EverNeBoolTboolLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/EverNeBoolTboolLogicalFunction.cpp @@ -26,46 +26,65 @@ namespace NES { -EverNeBoolTboolLogicalFunction::EverNeBoolTboolLogicalFunction(LogicalFunction value, - LogicalFunction threshold, - LogicalFunction ts) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +EverNeBoolTboolLogicalFunction::EverNeBoolTboolLogicalFunction(LogicalFunction arg0, + LogicalFunction value, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) { parameters.reserve(3); + parameters.push_back(std::move(arg0)); parameters.push_back(std::move(value)); - parameters.push_back(std::move(threshold)); parameters.push_back(std::move(ts)); } -DataType EverNeBoolTboolLogicalFunction::getDataType() const { return dataType; } +DataType EverNeBoolTboolLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction EverNeBoolTboolLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector EverNeBoolTboolLogicalFunction::getChildren() const { return parameters; } +std::vector EverNeBoolTboolLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction EverNeBoolTboolLogicalFunction::withChildren(const std::vector& children) const { PRECONDITION(children.size() == 3, "EverNeBoolTboolLogicalFunction requires 3 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view EverNeBoolTboolLogicalFunction::getType() const { return NAME; } +std::string_view EverNeBoolTboolLogicalFunction::getType() const +{ + return NAME; +} bool EverNeBoolTboolLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string EverNeBoolTboolLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -76,7 +95,9 @@ LogicalFunction EverNeBoolTboolLogicalFunction::withInferredDataType(const Schem std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -86,7 +107,9 @@ SerializableFunction EverNeBoolTboolLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } diff --git a/nes-logical-operators/src/Functions/Meos/EverNeNpointTnpointLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverNeNpointTnpointLogicalFunction.cpp index 0a95391835..59ef66efd1 100644 --- a/nes-logical-operators/src/Functions/Meos/EverNeNpointTnpointLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/EverNeNpointTnpointLogicalFunction.cpp @@ -26,59 +26,83 @@ namespace NES { -EverNeNpointTnpointLogicalFunction::EverNeNpointTnpointLogicalFunction(LogicalFunction rid_np, LogicalFunction pos_np, LogicalFunction rid_tp, LogicalFunction pos_tp, LogicalFunction ts) +EverNeNpointTnpointLogicalFunction::EverNeNpointTnpointLogicalFunction(LogicalFunction rid0, + LogicalFunction frac0, + LogicalFunction rid, + LogicalFunction frac, + LogicalFunction ts) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(5); - parameters.push_back(std::move(rid_np)); - parameters.push_back(std::move(pos_np)); - parameters.push_back(std::move(rid_tp)); - parameters.push_back(std::move(pos_tp)); + parameters.push_back(std::move(rid0)); + parameters.push_back(std::move(frac0)); + parameters.push_back(std::move(rid)); + parameters.push_back(std::move(frac)); parameters.push_back(std::move(ts)); } -DataType EverNeNpointTnpointLogicalFunction::getDataType() const { return dataType; } +DataType EverNeNpointTnpointLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction EverNeNpointTnpointLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector EverNeNpointTnpointLogicalFunction::getChildren() const { return parameters; } +std::vector EverNeNpointTnpointLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction EverNeNpointTnpointLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 5, - "EverNeNpointTnpointLogicalFunction requires 5 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 5, "EverNeNpointTnpointLogicalFunction requires 5 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view EverNeNpointTnpointLogicalFunction::getType() const { return NAME; } +std::string_view EverNeNpointTnpointLogicalFunction::getType() const +{ + return NAME; +} bool EverNeNpointTnpointLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string EverNeNpointTnpointLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction EverNeNpointTnpointLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(5); - for (const auto& p : parameters) - c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "rid_np must be UINT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "pos_np must be FLOAT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "rid_tp must be UINT64"); - INVARIANT(c[3].getDataType().isType(DataType::Type::FLOAT64), "pos_tp must be FLOAT64"); - INVARIANT(c[4].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction EverNeNpointTnpointLogicalFunction::serialize() const @@ -87,7 +111,9 @@ SerializableFunction EverNeNpointTnpointLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -97,12 +123,12 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEve PRECONDITION(arguments.children.size() == 5, "EverNeNpointTnpointLogicalFunction requires 5 children but got {}", arguments.children.size()); - return EverNeNpointTnpointLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2]), - std::move(arguments.children[3]), - std::move(arguments.children[4])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + return EverNeNpointTnpointLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverNePoseTposeLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverNePoseTposeLogicalFunction.cpp index dcbaca23e5..3c110a3dc7 100644 --- a/nes-logical-operators/src/Functions/Meos/EverNePoseTposeLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/EverNePoseTposeLogicalFunction.cpp @@ -26,63 +26,87 @@ namespace NES { -EverNePoseTposeLogicalFunction::EverNePoseTposeLogicalFunction(LogicalFunction x2, LogicalFunction y2, LogicalFunction theta2, LogicalFunction x, LogicalFunction y, LogicalFunction theta, LogicalFunction ts) +EverNePoseTposeLogicalFunction::EverNePoseTposeLogicalFunction(LogicalFunction px0, + LogicalFunction py0, + LogicalFunction ptheta0, + LogicalFunction x, + LogicalFunction y, + LogicalFunction theta, + LogicalFunction ts) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(7); - parameters.push_back(std::move(x2)); - parameters.push_back(std::move(y2)); - parameters.push_back(std::move(theta2)); + parameters.push_back(std::move(px0)); + parameters.push_back(std::move(py0)); + parameters.push_back(std::move(ptheta0)); parameters.push_back(std::move(x)); parameters.push_back(std::move(y)); parameters.push_back(std::move(theta)); parameters.push_back(std::move(ts)); } -DataType EverNePoseTposeLogicalFunction::getDataType() const { return dataType; } +DataType EverNePoseTposeLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction EverNePoseTposeLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector EverNePoseTposeLogicalFunction::getChildren() const { return parameters; } +std::vector EverNePoseTposeLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction EverNePoseTposeLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 7, - "EverNePoseTposeLogicalFunction requires 7 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 7, "EverNePoseTposeLogicalFunction requires 7 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view EverNePoseTposeLogicalFunction::getType() const { return NAME; } +std::string_view EverNePoseTposeLogicalFunction::getType() const +{ + return NAME; +} bool EverNePoseTposeLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string EverNePoseTposeLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction EverNePoseTposeLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(7); - for (const auto& p : parameters) - c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "x2 must be FLOAT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "y2 must be FLOAT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "theta2 must be FLOAT64"); - INVARIANT(c[3].getDataType().isType(DataType::Type::FLOAT64), "x must be FLOAT64"); - INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "y must be FLOAT64"); - INVARIANT(c[5].getDataType().isType(DataType::Type::FLOAT64), "theta must be FLOAT64"); - INVARIANT(c[6].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction EverNePoseTposeLogicalFunction::serialize() const @@ -91,7 +115,9 @@ SerializableFunction EverNePoseTposeLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -101,14 +127,14 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEve PRECONDITION(arguments.children.size() == 7, "EverNePoseTposeLogicalFunction requires 7 children but got {}", arguments.children.size()); - return EverNePoseTposeLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2]), - std::move(arguments.children[3]), - std::move(arguments.children[4]), - std::move(arguments.children[5]), - std::move(arguments.children[6])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + auto arg5 = std::move(arguments.children[5]); + auto arg6 = std::move(arguments.children[6]); + return EverNePoseTposeLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverNeTbigintBigintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverNeTbigintBigintLogicalFunction.cpp index 1c385ff7af..3698687e78 100644 --- a/nes-logical-operators/src/Functions/Meos/EverNeTbigintBigintLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/EverNeTbigintBigintLogicalFunction.cpp @@ -27,45 +27,64 @@ namespace NES { EverNeTbigintBigintLogicalFunction::EverNeTbigintBigintLogicalFunction(LogicalFunction value, - LogicalFunction threshold, - LogicalFunction ts) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) + LogicalFunction ts, + LogicalFunction arg0) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) { parameters.reserve(3); parameters.push_back(std::move(value)); - parameters.push_back(std::move(threshold)); parameters.push_back(std::move(ts)); + parameters.push_back(std::move(arg0)); } -DataType EverNeTbigintBigintLogicalFunction::getDataType() const { return dataType; } +DataType EverNeTbigintBigintLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction EverNeTbigintBigintLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector EverNeTbigintBigintLogicalFunction::getChildren() const { return parameters; } +std::vector EverNeTbigintBigintLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction EverNeTbigintBigintLogicalFunction::withChildren(const std::vector& children) const { PRECONDITION(children.size() == 3, "EverNeTbigintBigintLogicalFunction requires 3 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view EverNeTbigintBigintLogicalFunction::getType() const { return NAME; } +std::string_view EverNeTbigintBigintLogicalFunction::getType() const +{ + return NAME; +} bool EverNeTbigintBigintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string EverNeTbigintBigintLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -76,7 +95,9 @@ LogicalFunction EverNeTbigintBigintLogicalFunction::withInferredDataType(const S std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -86,7 +107,9 @@ SerializableFunction EverNeTbigintBigintLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } diff --git a/nes-logical-operators/src/Functions/Meos/EverNeTboolBoolLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverNeTboolBoolLogicalFunction.cpp index a9bf43de76..e7d5566f0d 100644 --- a/nes-logical-operators/src/Functions/Meos/EverNeTboolBoolLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/EverNeTboolBoolLogicalFunction.cpp @@ -27,45 +27,64 @@ namespace NES { EverNeTboolBoolLogicalFunction::EverNeTboolBoolLogicalFunction(LogicalFunction value, - LogicalFunction threshold, - LogicalFunction ts) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) + LogicalFunction ts, + LogicalFunction arg0) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) { parameters.reserve(3); parameters.push_back(std::move(value)); - parameters.push_back(std::move(threshold)); parameters.push_back(std::move(ts)); + parameters.push_back(std::move(arg0)); } -DataType EverNeTboolBoolLogicalFunction::getDataType() const { return dataType; } +DataType EverNeTboolBoolLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction EverNeTboolBoolLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector EverNeTboolBoolLogicalFunction::getChildren() const { return parameters; } +std::vector EverNeTboolBoolLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction EverNeTboolBoolLogicalFunction::withChildren(const std::vector& children) const { PRECONDITION(children.size() == 3, "EverNeTboolBoolLogicalFunction requires 3 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view EverNeTboolBoolLogicalFunction::getType() const { return NAME; } +std::string_view EverNeTboolBoolLogicalFunction::getType() const +{ + return NAME; +} bool EverNeTboolBoolLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string EverNeTboolBoolLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -76,7 +95,9 @@ LogicalFunction EverNeTboolBoolLogicalFunction::withInferredDataType(const Schem std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -86,7 +107,9 @@ SerializableFunction EverNeTboolBoolLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } diff --git a/nes-logical-operators/src/Functions/Meos/EverNeTcbufferTcbufferLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverNeTcbufferTcbufferLogicalFunction.cpp index 0ed031bbe2..c8803e0ce4 100644 --- a/nes-logical-operators/src/Functions/Meos/EverNeTcbufferTcbufferLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/EverNeTcbufferTcbufferLogicalFunction.cpp @@ -26,67 +26,89 @@ namespace NES { -EverNeTcbufferTcbufferLogicalFunction::EverNeTcbufferTcbufferLogicalFunction( - LogicalFunction lon1, LogicalFunction lat1, LogicalFunction r1, LogicalFunction ts1, - LogicalFunction lon2, LogicalFunction lat2, LogicalFunction r2, LogicalFunction ts2) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +EverNeTcbufferTcbufferLogicalFunction::EverNeTcbufferTcbufferLogicalFunction(LogicalFunction lonA, + LogicalFunction latA, + LogicalFunction radiusA, + LogicalFunction tsA, + LogicalFunction lonB, + LogicalFunction latB, + LogicalFunction radiusB, + LogicalFunction tsB) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) { parameters.reserve(8); - parameters.push_back(std::move(lon1)); - parameters.push_back(std::move(lat1)); - parameters.push_back(std::move(r1)); - parameters.push_back(std::move(ts1)); - parameters.push_back(std::move(lon2)); - parameters.push_back(std::move(lat2)); - parameters.push_back(std::move(r2)); - parameters.push_back(std::move(ts2)); + parameters.push_back(std::move(lonA)); + parameters.push_back(std::move(latA)); + parameters.push_back(std::move(radiusA)); + parameters.push_back(std::move(tsA)); + parameters.push_back(std::move(lonB)); + parameters.push_back(std::move(latB)); + parameters.push_back(std::move(radiusB)); + parameters.push_back(std::move(tsB)); } -DataType EverNeTcbufferTcbufferLogicalFunction::getDataType() const { return dataType; } +DataType EverNeTcbufferTcbufferLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction EverNeTcbufferTcbufferLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector EverNeTcbufferTcbufferLogicalFunction::getChildren() const { return parameters; } +std::vector EverNeTcbufferTcbufferLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction EverNeTcbufferTcbufferLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 8, - "EverNeTcbufferTcbufferLogicalFunction requires 8 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 8, "EverNeTcbufferTcbufferLogicalFunction requires 8 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view EverNeTcbufferTcbufferLogicalFunction::getType() const { return NAME; } +std::string_view EverNeTcbufferTcbufferLogicalFunction::getType() const +{ + return NAME; +} bool EverNeTcbufferTcbufferLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string EverNeTcbufferTcbufferLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction EverNeTcbufferTcbufferLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(8); - for (const auto& p : parameters) - c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon1 must be FLOAT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat1 must be FLOAT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "r1 must be FLOAT64"); - INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); - INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "lon2 must be FLOAT64"); - INVARIANT(c[5].getDataType().isType(DataType::Type::FLOAT64), "lat2 must be FLOAT64"); - INVARIANT(c[6].getDataType().isType(DataType::Type::FLOAT64), "r2 must be FLOAT64"); - INVARIANT(c[7].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction EverNeTcbufferTcbufferLogicalFunction::serialize() const @@ -95,7 +117,9 @@ SerializableFunction EverNeTcbufferTcbufferLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -105,14 +129,15 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEve PRECONDITION(arguments.children.size() == 8, "EverNeTcbufferTcbufferLogicalFunction requires 8 children but got {}", arguments.children.size()); - return EverNeTcbufferTcbufferLogicalFunction(std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2]), - std::move(arguments.children[3]), - std::move(arguments.children[4]), - std::move(arguments.children[5]), - std::move(arguments.children[6]), - std::move(arguments.children[7])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + auto arg5 = std::move(arguments.children[5]); + auto arg6 = std::move(arguments.children[6]); + auto arg7 = std::move(arguments.children[7]); + return EverNeTcbufferTcbufferLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6), std::move(arg7)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverNeTextTtextLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverNeTextTtextLogicalFunction.cpp index 99558ef377..3d9fd6aaf8 100644 --- a/nes-logical-operators/src/Functions/Meos/EverNeTextTtextLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/EverNeTextTtextLogicalFunction.cpp @@ -13,81 +13,116 @@ */ #include -#include -#include -#include -#include + #include +#include #include -#include -#include -#include #include +#include +#include +#include #include -#include -#include -#include -#include - -namespace NES { -EverNeTextTtextLogicalFunction::EverNeTextTtextLogicalFunction( - LogicalFunction value, LogicalFunction ref, LogicalFunction ts) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { - parameters = {std::move(value), std::move(ref), std::move(ts)}; +namespace NES +{ + +EverNeTextTtextLogicalFunction::EverNeTextTtextLogicalFunction(LogicalFunction arg0, + LogicalFunction value, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(arg0)); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(ts)); } -DataType EverNeTextTtextLogicalFunction::getDataType() const { return dataType; } +DataType EverNeTextTtextLogicalFunction::getDataType() const +{ + return dataType; +} -LogicalFunction EverNeTextTtextLogicalFunction::withDataType(const DataType& dt) const { - auto c = *this; c.dataType = dt; return c; +LogicalFunction EverNeTextTtextLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector EverNeTextTtextLogicalFunction::getChildren() const { return parameters; } +std::vector EverNeTextTtextLogicalFunction::getChildren() const +{ + return parameters; +} -LogicalFunction EverNeTextTtextLogicalFunction::withChildren(const std::vector& ch) const { - PRECONDITION(ch.size() == 3, "EverNeTextTtext expects 3 params, got {}", ch.size()); - auto c = *this; c.parameters = ch; return c; +LogicalFunction EverNeTextTtextLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "EverNeTextTtextLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view EverNeTextTtextLogicalFunction::getType() const { return NAME; } +std::string_view EverNeTextTtextLogicalFunction::getType() const +{ + return NAME; +} -bool EverNeTextTtextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { - const auto* o = dynamic_cast(&rhs); - return o && parameters == o->parameters; +bool EverNeTextTtextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } + return false; } -std::string EverNeTextTtextLogicalFunction::explain(ExplainVerbosity v) const { - return fmt::format("EverNeTextTtext({}, {}, {})", - parameters[0].explain(v), parameters[1].explain(v), parameters[2].explain(v)); +std::string EverNeTextTtextLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } -LogicalFunction EverNeTextTtextLogicalFunction::withInferredDataType(const Schema& s) const { - std::vector ch; - ch.reserve(3); - for (auto& p : parameters) ch.push_back(p.withInferredDataType(s)); - auto isStr = [](const DataType& dt) { return dt.isType(DataType::Type::VARSIZED); }; - auto isTime = [](const DataType& dt) { return dt.isType(DataType::Type::UINT64); }; - INVARIANT(isStr(ch[0].getDataType()) && isStr(ch[1].getDataType()) && isTime(ch[2].getDataType()), - "EverNeTextTtext: expects (VARCHAR, VARCHAR, UINT64)"); - return withChildren(ch); +LogicalFunction EverNeTextTtextLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } -SerializableFunction EverNeTextTtextLogicalFunction::serialize() const { - SerializableFunction sf; - sf.set_function_type(std::string(NAME)); - for (auto& p : parameters) *sf.add_children() = p.serialize(); - DataTypeSerializationUtil::serializeDataType(dataType, sf.mutable_data_type()); - return sf; +SerializableFunction EverNeTextTtextLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } + return proto; } -LogicalFunctionRegistryReturnType -LogicalFunctionGeneratedRegistrar::RegisterEverNeTextTtextLogicalFunction( - LogicalFunctionRegistryArguments arguments) { +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverNeTextTtextLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ PRECONDITION(arguments.children.size() == 3, - "EverNeTextTtext expects 3 params, got {}", arguments.children.size()); - return EverNeTextTtextLogicalFunction( - arguments.children[0], arguments.children[1], arguments.children[2]); + "EverNeTextTtextLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return EverNeTextTtextLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverNeTgeoGeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverNeTgeoGeoLogicalFunction.cpp index 07ba953aef..d38eadf9ac 100644 --- a/nes-logical-operators/src/Functions/Meos/EverNeTgeoGeoLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/EverNeTgeoGeoLogicalFunction.cpp @@ -26,60 +26,81 @@ namespace NES { -EverNeTgeoGeoLogicalFunction::EverNeTgeoGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, - LogicalFunction ts, LogicalFunction wkt) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +EverNeTgeoGeoLogicalFunction::EverNeTgeoGeoLogicalFunction(LogicalFunction lon, + LogicalFunction lat, + LogicalFunction timestamp, + LogicalFunction geometry) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) { parameters.reserve(4); parameters.push_back(std::move(lon)); parameters.push_back(std::move(lat)); - parameters.push_back(std::move(ts)); - parameters.push_back(std::move(wkt)); + parameters.push_back(std::move(timestamp)); + parameters.push_back(std::move(geometry)); } -DataType EverNeTgeoGeoLogicalFunction::getDataType() const { return dataType; } +DataType EverNeTgeoGeoLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction EverNeTgeoGeoLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector EverNeTgeoGeoLogicalFunction::getChildren() const { return parameters; } +std::vector EverNeTgeoGeoLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction EverNeTgeoGeoLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 4, - "EverNeTgeoGeoLogicalFunction requires 4 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 4, "EverNeTgeoGeoLogicalFunction requires 4 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view EverNeTgeoGeoLogicalFunction::getType() const { return NAME; } +std::string_view EverNeTgeoGeoLogicalFunction::getType() const +{ + return NAME; +} bool EverNeTgeoGeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string EverNeTgeoGeoLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction EverNeTgeoGeoLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(4); - c.emplace_back(parameters[0].withInferredDataType(schema)); - c.emplace_back(parameters[1].withInferredDataType(schema)); - c.emplace_back(parameters[2].withInferredDataType(schema)); - c.emplace_back(parameters[3].withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon must be FLOAT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat must be FLOAT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); - INVARIANT(c[3].getDataType().isType(DataType::Type::VARSIZED),"wkt must be VARSIZED"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction EverNeTgeoGeoLogicalFunction::serialize() const @@ -88,7 +109,9 @@ SerializableFunction EverNeTgeoGeoLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -98,10 +121,11 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEve PRECONDITION(arguments.children.size() == 4, "EverNeTgeoGeoLogicalFunction requires 4 children but got {}", arguments.children.size()); - return EverNeTgeoGeoLogicalFunction(std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2]), - std::move(arguments.children[3])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + return EverNeTgeoGeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverNeTgeoTgeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverNeTgeoTgeoLogicalFunction.cpp index d30c830b71..ea35026f84 100644 --- a/nes-logical-operators/src/Functions/Meos/EverNeTgeoTgeoLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/EverNeTgeoTgeoLogicalFunction.cpp @@ -26,61 +26,85 @@ namespace NES { -EverNeTgeoTgeoLogicalFunction::EverNeTgeoTgeoLogicalFunction(LogicalFunction lon1, LogicalFunction lat1, LogicalFunction ts1, LogicalFunction lon2, LogicalFunction lat2, LogicalFunction ts2) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +EverNeTgeoTgeoLogicalFunction::EverNeTgeoTgeoLogicalFunction(LogicalFunction lonA, + LogicalFunction latA, + LogicalFunction tsA, + LogicalFunction lonB, + LogicalFunction latB, + LogicalFunction tsB) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) { parameters.reserve(6); - parameters.push_back(std::move(lon1)); - parameters.push_back(std::move(lat1)); - parameters.push_back(std::move(ts1)); - parameters.push_back(std::move(lon2)); - parameters.push_back(std::move(lat2)); - parameters.push_back(std::move(ts2)); + parameters.push_back(std::move(lonA)); + parameters.push_back(std::move(latA)); + parameters.push_back(std::move(tsA)); + parameters.push_back(std::move(lonB)); + parameters.push_back(std::move(latB)); + parameters.push_back(std::move(tsB)); } -DataType EverNeTgeoTgeoLogicalFunction::getDataType() const { return dataType; } +DataType EverNeTgeoTgeoLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction EverNeTgeoTgeoLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector EverNeTgeoTgeoLogicalFunction::getChildren() const { return parameters; } +std::vector EverNeTgeoTgeoLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction EverNeTgeoTgeoLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 6, - "EverNeTgeoTgeoLogicalFunction requires 6 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 6, "EverNeTgeoTgeoLogicalFunction requires 6 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view EverNeTgeoTgeoLogicalFunction::getType() const { return NAME; } +std::string_view EverNeTgeoTgeoLogicalFunction::getType() const +{ + return NAME; +} bool EverNeTgeoTgeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string EverNeTgeoTgeoLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction EverNeTgeoTgeoLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(6); - for (const auto& p : parameters) - c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon1 must be FLOAT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat1 must be FLOAT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); - INVARIANT(c[3].getDataType().isType(DataType::Type::FLOAT64), "lon2 must be FLOAT64"); - INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "lat2 must be FLOAT64"); - INVARIANT(c[5].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction EverNeTgeoTgeoLogicalFunction::serialize() const @@ -89,7 +113,9 @@ SerializableFunction EverNeTgeoTgeoLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -99,13 +125,13 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEve PRECONDITION(arguments.children.size() == 6, "EverNeTgeoTgeoLogicalFunction requires 6 children but got {}", arguments.children.size()); - return EverNeTgeoTgeoLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2]), - std::move(arguments.children[3]), - std::move(arguments.children[4]), - std::move(arguments.children[5])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + auto arg5 = std::move(arguments.children[5]); + return EverNeTgeoTgeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverNeTh3indexH3indexLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverNeTh3indexH3indexLogicalFunction.cpp index cec911112c..f1cf201c6c 100644 --- a/nes-logical-operators/src/Functions/Meos/EverNeTh3indexH3indexLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/EverNeTh3indexH3indexLogicalFunction.cpp @@ -26,57 +26,79 @@ namespace NES { -EverNeTh3indexH3indexLogicalFunction::EverNeTh3indexH3indexLogicalFunction(LogicalFunction cell, LogicalFunction ts, - LogicalFunction target) +EverNeTh3indexH3indexLogicalFunction::EverNeTh3indexH3indexLogicalFunction(LogicalFunction cell, + LogicalFunction ts, + LogicalFunction arg0) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(3); parameters.push_back(std::move(cell)); parameters.push_back(std::move(ts)); - parameters.push_back(std::move(target)); + parameters.push_back(std::move(arg0)); } -DataType EverNeTh3indexH3indexLogicalFunction::getDataType() const { return dataType; } +DataType EverNeTh3indexH3indexLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction EverNeTh3indexH3indexLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector EverNeTh3indexH3indexLogicalFunction::getChildren() const { return parameters; } +std::vector EverNeTh3indexH3indexLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction EverNeTh3indexH3indexLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 3, - "EverNeTh3indexH3indexLogicalFunction requires 3 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 3, "EverNeTh3indexH3indexLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view EverNeTh3indexH3indexLogicalFunction::getType() const { return NAME; } +std::string_view EverNeTh3indexH3indexLogicalFunction::getType() const +{ + return NAME; +} bool EverNeTh3indexH3indexLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string EverNeTh3indexH3indexLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction EverNeTh3indexH3indexLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(3); - c.emplace_back(parameters[0].withInferredDataType(schema)); - c.emplace_back(parameters[1].withInferredDataType(schema)); - c.emplace_back(parameters[2].withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "cell must be UINT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "target must be UINT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction EverNeTh3indexH3indexLogicalFunction::serialize() const @@ -85,7 +107,9 @@ SerializableFunction EverNeTh3indexH3indexLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -95,9 +119,10 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEve PRECONDITION(arguments.children.size() == 3, "EverNeTh3indexH3indexLogicalFunction requires 3 children but got {}", arguments.children.size()); - return EverNeTh3indexH3indexLogicalFunction(std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return EverNeTh3indexH3indexLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverNeTjsonbJsonbLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverNeTjsonbJsonbLogicalFunction.cpp index fc161c6f65..8780a344b4 100644 --- a/nes-logical-operators/src/Functions/Meos/EverNeTjsonbJsonbLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/EverNeTjsonbJsonbLogicalFunction.cpp @@ -26,55 +26,79 @@ namespace NES { -EverNeTjsonbJsonbLogicalFunction::EverNeTjsonbJsonbLogicalFunction(LogicalFunction json_str, LogicalFunction ts, LogicalFunction target_json) +EverNeTjsonbJsonbLogicalFunction::EverNeTjsonbJsonbLogicalFunction(LogicalFunction json_str, + LogicalFunction ts, + LogicalFunction arg0) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(3); parameters.push_back(std::move(json_str)); parameters.push_back(std::move(ts)); - parameters.push_back(std::move(target_json)); + parameters.push_back(std::move(arg0)); } -DataType EverNeTjsonbJsonbLogicalFunction::getDataType() const { return dataType; } +DataType EverNeTjsonbJsonbLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction EverNeTjsonbJsonbLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector EverNeTjsonbJsonbLogicalFunction::getChildren() const { return parameters; } +std::vector EverNeTjsonbJsonbLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction EverNeTjsonbJsonbLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 3, - "EverNeTjsonbJsonbLogicalFunction requires 3 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 3, "EverNeTjsonbJsonbLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view EverNeTjsonbJsonbLogicalFunction::getType() const { return NAME; } +std::string_view EverNeTjsonbJsonbLogicalFunction::getType() const +{ + return NAME; +} bool EverNeTjsonbJsonbLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string EverNeTjsonbJsonbLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction EverNeTjsonbJsonbLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(3); - for (const auto& p : parameters) - c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "json_str must be VARSIZED"); - INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::VARSIZED), "target_json must be VARSIZED"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction EverNeTjsonbJsonbLogicalFunction::serialize() const @@ -83,7 +107,9 @@ SerializableFunction EverNeTjsonbJsonbLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -93,10 +119,10 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEve PRECONDITION(arguments.children.size() == 3, "EverNeTjsonbJsonbLogicalFunction requires 3 children but got {}", arguments.children.size()); - return EverNeTjsonbJsonbLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return EverNeTjsonbJsonbLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverNeTjsonbTjsonbLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverNeTjsonbTjsonbLogicalFunction.cpp index 658fed2696..4f44f47a2c 100644 --- a/nes-logical-operators/src/Functions/Meos/EverNeTjsonbTjsonbLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/EverNeTjsonbTjsonbLogicalFunction.cpp @@ -26,57 +26,81 @@ namespace NES { -EverNeTjsonbTjsonbLogicalFunction::EverNeTjsonbTjsonbLogicalFunction(LogicalFunction json1, LogicalFunction ts1, LogicalFunction json2, LogicalFunction ts2) +EverNeTjsonbTjsonbLogicalFunction::EverNeTjsonbTjsonbLogicalFunction(LogicalFunction json_str, + LogicalFunction ts, + LogicalFunction json0, + LogicalFunction ts0) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(4); - parameters.push_back(std::move(json1)); - parameters.push_back(std::move(ts1)); - parameters.push_back(std::move(json2)); - parameters.push_back(std::move(ts2)); + parameters.push_back(std::move(json_str)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(json0)); + parameters.push_back(std::move(ts0)); } -DataType EverNeTjsonbTjsonbLogicalFunction::getDataType() const { return dataType; } +DataType EverNeTjsonbTjsonbLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction EverNeTjsonbTjsonbLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector EverNeTjsonbTjsonbLogicalFunction::getChildren() const { return parameters; } +std::vector EverNeTjsonbTjsonbLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction EverNeTjsonbTjsonbLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 4, - "EverNeTjsonbTjsonbLogicalFunction requires 4 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 4, "EverNeTjsonbTjsonbLogicalFunction requires 4 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view EverNeTjsonbTjsonbLogicalFunction::getType() const { return NAME; } +std::string_view EverNeTjsonbTjsonbLogicalFunction::getType() const +{ + return NAME; +} bool EverNeTjsonbTjsonbLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string EverNeTjsonbTjsonbLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction EverNeTjsonbTjsonbLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(4); - for (const auto& p : parameters) - c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "json1 must be VARSIZED"); - INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::VARSIZED), "json2 must be VARSIZED"); - INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction EverNeTjsonbTjsonbLogicalFunction::serialize() const @@ -85,7 +109,9 @@ SerializableFunction EverNeTjsonbTjsonbLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -95,11 +121,11 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEve PRECONDITION(arguments.children.size() == 4, "EverNeTjsonbTjsonbLogicalFunction requires 4 children but got {}", arguments.children.size()); - return EverNeTjsonbTjsonbLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2]), - std::move(arguments.children[3])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + return EverNeTjsonbTjsonbLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverNeTnpointNpointLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverNeTnpointNpointLogicalFunction.cpp index 9a47532426..9113ad55ab 100644 --- a/nes-logical-operators/src/Functions/Meos/EverNeTnpointNpointLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/EverNeTnpointNpointLogicalFunction.cpp @@ -26,59 +26,83 @@ namespace NES { -EverNeTnpointNpointLogicalFunction::EverNeTnpointNpointLogicalFunction(LogicalFunction rid1, LogicalFunction pos1, LogicalFunction ts, LogicalFunction rid2, LogicalFunction pos2) +EverNeTnpointNpointLogicalFunction::EverNeTnpointNpointLogicalFunction(LogicalFunction rid, + LogicalFunction frac, + LogicalFunction ts, + LogicalFunction rid0, + LogicalFunction frac0) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(5); - parameters.push_back(std::move(rid1)); - parameters.push_back(std::move(pos1)); + parameters.push_back(std::move(rid)); + parameters.push_back(std::move(frac)); parameters.push_back(std::move(ts)); - parameters.push_back(std::move(rid2)); - parameters.push_back(std::move(pos2)); + parameters.push_back(std::move(rid0)); + parameters.push_back(std::move(frac0)); } -DataType EverNeTnpointNpointLogicalFunction::getDataType() const { return dataType; } +DataType EverNeTnpointNpointLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction EverNeTnpointNpointLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector EverNeTnpointNpointLogicalFunction::getChildren() const { return parameters; } +std::vector EverNeTnpointNpointLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction EverNeTnpointNpointLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 5, - "EverNeTnpointNpointLogicalFunction requires 5 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 5, "EverNeTnpointNpointLogicalFunction requires 5 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view EverNeTnpointNpointLogicalFunction::getType() const { return NAME; } +std::string_view EverNeTnpointNpointLogicalFunction::getType() const +{ + return NAME; +} bool EverNeTnpointNpointLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string EverNeTnpointNpointLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction EverNeTnpointNpointLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(5); - for (const auto& p : parameters) - c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "rid1 must be UINT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "pos1 must be FLOAT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); - INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "rid2 must be UINT64"); - INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "pos2 must be FLOAT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction EverNeTnpointNpointLogicalFunction::serialize() const @@ -87,7 +111,9 @@ SerializableFunction EverNeTnpointNpointLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -97,12 +123,12 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEve PRECONDITION(arguments.children.size() == 5, "EverNeTnpointNpointLogicalFunction requires 5 children but got {}", arguments.children.size()); - return EverNeTnpointNpointLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2]), - std::move(arguments.children[3]), - std::move(arguments.children[4])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + return EverNeTnpointNpointLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverNeTnpointTnpointLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverNeTnpointTnpointLogicalFunction.cpp index 74c753b89c..9bfa9beba0 100644 --- a/nes-logical-operators/src/Functions/Meos/EverNeTnpointTnpointLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/EverNeTnpointTnpointLogicalFunction.cpp @@ -26,63 +26,85 @@ namespace NES { -EverNeTnpointTnpointLogicalFunction::EverNeTnpointTnpointLogicalFunction( - LogicalFunction rid1, LogicalFunction pos1, LogicalFunction ts1, - LogicalFunction rid2, LogicalFunction pos2, LogicalFunction ts2) +EverNeTnpointTnpointLogicalFunction::EverNeTnpointTnpointLogicalFunction(LogicalFunction rid, + LogicalFunction frac, + LogicalFunction ts, + LogicalFunction rid0, + LogicalFunction frac0, + LogicalFunction ts0) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(6); - parameters.push_back(std::move(rid1)); - parameters.push_back(std::move(pos1)); - parameters.push_back(std::move(ts1)); - parameters.push_back(std::move(rid2)); - parameters.push_back(std::move(pos2)); - parameters.push_back(std::move(ts2)); + parameters.push_back(std::move(rid)); + parameters.push_back(std::move(frac)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(rid0)); + parameters.push_back(std::move(frac0)); + parameters.push_back(std::move(ts0)); } -DataType EverNeTnpointTnpointLogicalFunction::getDataType() const { return dataType; } +DataType EverNeTnpointTnpointLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction EverNeTnpointTnpointLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector EverNeTnpointTnpointLogicalFunction::getChildren() const { return parameters; } +std::vector EverNeTnpointTnpointLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction EverNeTnpointTnpointLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 6, - "EverNeTnpointTnpointLogicalFunction requires 6 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 6, "EverNeTnpointTnpointLogicalFunction requires 6 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view EverNeTnpointTnpointLogicalFunction::getType() const { return NAME; } +std::string_view EverNeTnpointTnpointLogicalFunction::getType() const +{ + return NAME; +} bool EverNeTnpointTnpointLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string EverNeTnpointTnpointLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction EverNeTnpointTnpointLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(6); - for (const auto& p : parameters) - c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "rid1 must be UINT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "pos1 must be FLOAT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); - INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "rid2 must be UINT64"); - INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "pos2 must be FLOAT64"); - INVARIANT(c[5].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction EverNeTnpointTnpointLogicalFunction::serialize() const @@ -91,7 +113,9 @@ SerializableFunction EverNeTnpointTnpointLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -101,12 +125,13 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEve PRECONDITION(arguments.children.size() == 6, "EverNeTnpointTnpointLogicalFunction requires 6 children but got {}", arguments.children.size()); - return EverNeTnpointTnpointLogicalFunction(std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2]), - std::move(arguments.children[3]), - std::move(arguments.children[4]), - std::move(arguments.children[5])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + auto arg5 = std::move(arguments.children[5]); + return EverNeTnpointTnpointLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverNeTposePoseLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverNeTposePoseLogicalFunction.cpp index d55ec596d1..ce7e0d90b6 100644 --- a/nes-logical-operators/src/Functions/Meos/EverNeTposePoseLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/EverNeTposePoseLogicalFunction.cpp @@ -26,7 +26,13 @@ namespace NES { -EverNeTposePoseLogicalFunction::EverNeTposePoseLogicalFunction(LogicalFunction x, LogicalFunction y, LogicalFunction theta, LogicalFunction ts, LogicalFunction x2, LogicalFunction y2, LogicalFunction theta2) +EverNeTposePoseLogicalFunction::EverNeTposePoseLogicalFunction(LogicalFunction x, + LogicalFunction y, + LogicalFunction theta, + LogicalFunction ts, + LogicalFunction px0, + LogicalFunction py0, + LogicalFunction ptheta0) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(7); @@ -34,55 +40,73 @@ EverNeTposePoseLogicalFunction::EverNeTposePoseLogicalFunction(LogicalFunction x parameters.push_back(std::move(y)); parameters.push_back(std::move(theta)); parameters.push_back(std::move(ts)); - parameters.push_back(std::move(x2)); - parameters.push_back(std::move(y2)); - parameters.push_back(std::move(theta2)); + parameters.push_back(std::move(px0)); + parameters.push_back(std::move(py0)); + parameters.push_back(std::move(ptheta0)); } -DataType EverNeTposePoseLogicalFunction::getDataType() const { return dataType; } +DataType EverNeTposePoseLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction EverNeTposePoseLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector EverNeTposePoseLogicalFunction::getChildren() const { return parameters; } +std::vector EverNeTposePoseLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction EverNeTposePoseLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 7, - "EverNeTposePoseLogicalFunction requires 7 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 7, "EverNeTposePoseLogicalFunction requires 7 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view EverNeTposePoseLogicalFunction::getType() const { return NAME; } +std::string_view EverNeTposePoseLogicalFunction::getType() const +{ + return NAME; +} bool EverNeTposePoseLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string EverNeTposePoseLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction EverNeTposePoseLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(7); - for (const auto& p : parameters) - c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "x must be FLOAT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "y must be FLOAT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "theta must be FLOAT64"); - INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); - INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "x2 must be FLOAT64"); - INVARIANT(c[5].getDataType().isType(DataType::Type::FLOAT64), "y2 must be FLOAT64"); - INVARIANT(c[6].getDataType().isType(DataType::Type::FLOAT64), "theta2 must be FLOAT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction EverNeTposePoseLogicalFunction::serialize() const @@ -91,7 +115,9 @@ SerializableFunction EverNeTposePoseLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -101,14 +127,14 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEve PRECONDITION(arguments.children.size() == 7, "EverNeTposePoseLogicalFunction requires 7 children but got {}", arguments.children.size()); - return EverNeTposePoseLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2]), - std::move(arguments.children[3]), - std::move(arguments.children[4]), - std::move(arguments.children[5]), - std::move(arguments.children[6])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + auto arg5 = std::move(arguments.children[5]); + auto arg6 = std::move(arguments.children[6]); + return EverNeTposePoseLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverNeTposeTposeLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverNeTposeTposeLogicalFunction.cpp index 0dfd61bc1a..2d9d834489 100644 --- a/nes-logical-operators/src/Functions/Meos/EverNeTposeTposeLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/EverNeTposeTposeLogicalFunction.cpp @@ -26,67 +26,89 @@ namespace NES { -EverNeTposeTposeLogicalFunction::EverNeTposeTposeLogicalFunction( - LogicalFunction x1, LogicalFunction y1, LogicalFunction theta1, LogicalFunction ts1, - LogicalFunction x2, LogicalFunction y2, LogicalFunction theta2, LogicalFunction ts2) +EverNeTposeTposeLogicalFunction::EverNeTposeTposeLogicalFunction(LogicalFunction x, + LogicalFunction y, + LogicalFunction theta, + LogicalFunction ts, + LogicalFunction px0, + LogicalFunction py0, + LogicalFunction ptheta0, + LogicalFunction ts0) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(8); - parameters.push_back(std::move(x1)); - parameters.push_back(std::move(y1)); - parameters.push_back(std::move(theta1)); - parameters.push_back(std::move(ts1)); - parameters.push_back(std::move(x2)); - parameters.push_back(std::move(y2)); - parameters.push_back(std::move(theta2)); - parameters.push_back(std::move(ts2)); + parameters.push_back(std::move(x)); + parameters.push_back(std::move(y)); + parameters.push_back(std::move(theta)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(px0)); + parameters.push_back(std::move(py0)); + parameters.push_back(std::move(ptheta0)); + parameters.push_back(std::move(ts0)); } -DataType EverNeTposeTposeLogicalFunction::getDataType() const { return dataType; } +DataType EverNeTposeTposeLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction EverNeTposeTposeLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector EverNeTposeTposeLogicalFunction::getChildren() const { return parameters; } +std::vector EverNeTposeTposeLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction EverNeTposeTposeLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 8, - "EverNeTposeTposeLogicalFunction requires 8 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 8, "EverNeTposeTposeLogicalFunction requires 8 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view EverNeTposeTposeLogicalFunction::getType() const { return NAME; } +std::string_view EverNeTposeTposeLogicalFunction::getType() const +{ + return NAME; +} bool EverNeTposeTposeLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string EverNeTposeTposeLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction EverNeTposeTposeLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(8); - for (const auto& p : parameters) - c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "x1 must be FLOAT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "y1 must be FLOAT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "theta1 must be FLOAT64"); - INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); - INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "x2 must be FLOAT64"); - INVARIANT(c[5].getDataType().isType(DataType::Type::FLOAT64), "y2 must be FLOAT64"); - INVARIANT(c[6].getDataType().isType(DataType::Type::FLOAT64), "theta2 must be FLOAT64"); - INVARIANT(c[7].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction EverNeTposeTposeLogicalFunction::serialize() const @@ -95,7 +117,9 @@ SerializableFunction EverNeTposeTposeLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -105,14 +129,15 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEve PRECONDITION(arguments.children.size() == 8, "EverNeTposeTposeLogicalFunction requires 8 children but got {}", arguments.children.size()); - return EverNeTposeTposeLogicalFunction(std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2]), - std::move(arguments.children[3]), - std::move(arguments.children[4]), - std::move(arguments.children[5]), - std::move(arguments.children[6]), - std::move(arguments.children[7])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + auto arg5 = std::move(arguments.children[5]); + auto arg6 = std::move(arguments.children[6]); + auto arg7 = std::move(arguments.children[7]); + return EverNeTposeTposeLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6), std::move(arg7)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverNeTquadbinQuadbinLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverNeTquadbinQuadbinLogicalFunction.cpp index 5be17a77a9..36ed65ef1f 100644 --- a/nes-logical-operators/src/Functions/Meos/EverNeTquadbinQuadbinLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/EverNeTquadbinQuadbinLogicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -25,54 +26,103 @@ namespace NES { -EverNeTquadbinQuadbinLogicalFunction::EverNeTquadbinQuadbinLogicalFunction(LogicalFunction inst_cell, LogicalFunction ts, LogicalFunction cell) +EverNeTquadbinQuadbinLogicalFunction::EverNeTquadbinQuadbinLogicalFunction(LogicalFunction cell, + LogicalFunction ts, + LogicalFunction arg0) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(3); - parameters.push_back(std::move(inst_cell)); - parameters.push_back(std::move(ts)); parameters.push_back(std::move(cell)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(arg0)); +} + +DataType EverNeTquadbinQuadbinLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction EverNeTquadbinQuadbinLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector EverNeTquadbinQuadbinLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction EverNeTquadbinQuadbinLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "EverNeTquadbinQuadbinLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -DataType EverNeTquadbinQuadbinLogicalFunction::getDataType() const { return dataType; } -LogicalFunction EverNeTquadbinQuadbinLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } -std::vector EverNeTquadbinQuadbinLogicalFunction::getChildren() const { return parameters; } -LogicalFunction EverNeTquadbinQuadbinLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size()==3,"EverNeTquadbinQuadbinLogicalFunction requires 3 children, but got {}",children.size()); - auto c=*this; c.parameters=children; return c; + +std::string_view EverNeTquadbinQuadbinLogicalFunction::getType() const +{ + return NAME; } -std::string_view EverNeTquadbinQuadbinLogicalFunction::getType() const { return NAME; } -bool EverNeTquadbinQuadbinLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { - if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + +bool EverNeTquadbinQuadbinLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } return false; } -std::string EverNeTquadbinQuadbinLogicalFunction::explain(ExplainVerbosity v) const { - return fmt::format("{}({})",NAME,parameters[0].explain(v)); + +std::string EverNeTquadbinQuadbinLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } -LogicalFunction EverNeTquadbinQuadbinLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; c.reserve(3); - for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "inst_cell must be UINT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "cell must be UINT64"); - return withChildren(c); + +LogicalFunction EverNeTquadbinQuadbinLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } -SerializableFunction EverNeTquadbinQuadbinLogicalFunction::serialize() const { + +SerializableFunction EverNeTquadbinQuadbinLogicalFunction::serialize() const +{ SerializableFunction proto; proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); - for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } return proto; } + LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverNeTquadbinQuadbinLogicalFunction( LogicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.children.size()==3, + PRECONDITION(arguments.children.size() == 3, "EverNeTquadbinQuadbinLogicalFunction requires 3 children but got {}", arguments.children.size()); - return EverNeTquadbinQuadbinLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return EverNeTquadbinQuadbinLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/EverNeTtextTextLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/EverNeTtextTextLogicalFunction.cpp index b0b5c15c44..e2f15d6df1 100644 --- a/nes-logical-operators/src/Functions/Meos/EverNeTtextTextLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/EverNeTtextTextLogicalFunction.cpp @@ -13,81 +13,116 @@ */ #include -#include -#include -#include -#include + #include +#include #include -#include -#include -#include #include +#include +#include +#include #include -#include -#include -#include -#include - -namespace NES { -EverNeTtextTextLogicalFunction::EverNeTtextTextLogicalFunction( - LogicalFunction value, LogicalFunction ref, LogicalFunction ts) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { - parameters = {std::move(value), std::move(ref), std::move(ts)}; +namespace NES +{ + +EverNeTtextTextLogicalFunction::EverNeTtextTextLogicalFunction(LogicalFunction value, + LogicalFunction ts, + LogicalFunction arg0) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(arg0)); } -DataType EverNeTtextTextLogicalFunction::getDataType() const { return dataType; } +DataType EverNeTtextTextLogicalFunction::getDataType() const +{ + return dataType; +} -LogicalFunction EverNeTtextTextLogicalFunction::withDataType(const DataType& dt) const { - auto c = *this; c.dataType = dt; return c; +LogicalFunction EverNeTtextTextLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector EverNeTtextTextLogicalFunction::getChildren() const { return parameters; } +std::vector EverNeTtextTextLogicalFunction::getChildren() const +{ + return parameters; +} -LogicalFunction EverNeTtextTextLogicalFunction::withChildren(const std::vector& ch) const { - PRECONDITION(ch.size() == 3, "EverNeTtextText expects 3 params, got {}", ch.size()); - auto c = *this; c.parameters = ch; return c; +LogicalFunction EverNeTtextTextLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "EverNeTtextTextLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view EverNeTtextTextLogicalFunction::getType() const { return NAME; } +std::string_view EverNeTtextTextLogicalFunction::getType() const +{ + return NAME; +} -bool EverNeTtextTextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { - const auto* o = dynamic_cast(&rhs); - return o && parameters == o->parameters; +bool EverNeTtextTextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } + return false; } -std::string EverNeTtextTextLogicalFunction::explain(ExplainVerbosity v) const { - return fmt::format("EverNeTtextText({}, {}, {})", - parameters[0].explain(v), parameters[1].explain(v), parameters[2].explain(v)); +std::string EverNeTtextTextLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } -LogicalFunction EverNeTtextTextLogicalFunction::withInferredDataType(const Schema& s) const { - std::vector ch; - ch.reserve(3); - for (auto& p : parameters) ch.push_back(p.withInferredDataType(s)); - auto isStr = [](const DataType& dt) { return dt.isType(DataType::Type::VARSIZED); }; - auto isTime = [](const DataType& dt) { return dt.isType(DataType::Type::UINT64); }; - INVARIANT(isStr(ch[0].getDataType()) && isStr(ch[1].getDataType()) && isTime(ch[2].getDataType()), - "EverNeTtextText: expects (VARCHAR, VARCHAR, UINT64)"); - return withChildren(ch); +LogicalFunction EverNeTtextTextLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } -SerializableFunction EverNeTtextTextLogicalFunction::serialize() const { - SerializableFunction sf; - sf.set_function_type(std::string(NAME)); - for (auto& p : parameters) *sf.add_children() = p.serialize(); - DataTypeSerializationUtil::serializeDataType(dataType, sf.mutable_data_type()); - return sf; +SerializableFunction EverNeTtextTextLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } + return proto; } -LogicalFunctionRegistryReturnType -LogicalFunctionGeneratedRegistrar::RegisterEverNeTtextTextLogicalFunction( - LogicalFunctionRegistryArguments arguments) { +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterEverNeTtextTextLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ PRECONDITION(arguments.children.size() == 3, - "EverNeTtextText expects 3 params, got {}", arguments.children.size()); - return EverNeTtextTextLogicalFunction( - arguments.children[0], arguments.children[1], arguments.children[2]); + "EverNeTtextTextLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return EverNeTtextTextLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/FloatspanLowerIncLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/FloatspanLowerIncLogicalFunction.cpp index c0900d9acf..430491bc98 100644 --- a/nes-logical-operators/src/Functions/Meos/FloatspanLowerIncLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/FloatspanLowerIncLogicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -31,42 +32,91 @@ FloatspanLowerIncLogicalFunction::FloatspanLowerIncLogicalFunction(LogicalFuncti parameters.reserve(1); parameters.push_back(std::move(sp)); } -DataType FloatspanLowerIncLogicalFunction::getDataType() const { return dataType; } -LogicalFunction FloatspanLowerIncLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } -std::vector FloatspanLowerIncLogicalFunction::getChildren() const { return parameters; } -LogicalFunction FloatspanLowerIncLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size()==1,"FloatspanLowerIncLogicalFunction requires 1 children, but got {}",children.size()); - auto c=*this; c.parameters=children; return c; + +DataType FloatspanLowerIncLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction FloatspanLowerIncLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector FloatspanLowerIncLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction FloatspanLowerIncLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 1, "FloatspanLowerIncLogicalFunction requires 1 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; +} + +std::string_view FloatspanLowerIncLogicalFunction::getType() const +{ + return NAME; } -std::string_view FloatspanLowerIncLogicalFunction::getType() const { return NAME; } -bool FloatspanLowerIncLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { - if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + +bool FloatspanLowerIncLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } return false; } -std::string FloatspanLowerIncLogicalFunction::explain(ExplainVerbosity v) const { - return fmt::format("{}({})",NAME,parameters[0].explain(v)); + +std::string FloatspanLowerIncLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } -LogicalFunction FloatspanLowerIncLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; c.reserve(1); - for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "sp must be VARSIZED"); - return withChildren(c); + +LogicalFunction FloatspanLowerIncLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } -SerializableFunction FloatspanLowerIncLogicalFunction::serialize() const { + +SerializableFunction FloatspanLowerIncLogicalFunction::serialize() const +{ SerializableFunction proto; proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); - for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } return proto; } + LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterFloatspanLowerIncLogicalFunction( LogicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.children.size()==1, + PRECONDITION(arguments.children.size() == 1, "FloatspanLowerIncLogicalFunction requires 1 children but got {}", arguments.children.size()); - return FloatspanLowerIncLogicalFunction( - std::move(arguments.children[0])); + auto arg0 = std::move(arguments.children[0]); + return FloatspanLowerIncLogicalFunction(std::move(arg0)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/FloatspanLowerLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/FloatspanLowerLogicalFunction.cpp index 179e1e5d04..e961f8e0b4 100644 --- a/nes-logical-operators/src/Functions/Meos/FloatspanLowerLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/FloatspanLowerLogicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -31,42 +32,91 @@ FloatspanLowerLogicalFunction::FloatspanLowerLogicalFunction(LogicalFunction sp) parameters.reserve(1); parameters.push_back(std::move(sp)); } -DataType FloatspanLowerLogicalFunction::getDataType() const { return dataType; } -LogicalFunction FloatspanLowerLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } -std::vector FloatspanLowerLogicalFunction::getChildren() const { return parameters; } -LogicalFunction FloatspanLowerLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size()==1,"FloatspanLowerLogicalFunction requires 1 children, but got {}",children.size()); - auto c=*this; c.parameters=children; return c; + +DataType FloatspanLowerLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction FloatspanLowerLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector FloatspanLowerLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction FloatspanLowerLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 1, "FloatspanLowerLogicalFunction requires 1 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; +} + +std::string_view FloatspanLowerLogicalFunction::getType() const +{ + return NAME; } -std::string_view FloatspanLowerLogicalFunction::getType() const { return NAME; } -bool FloatspanLowerLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { - if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + +bool FloatspanLowerLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } return false; } -std::string FloatspanLowerLogicalFunction::explain(ExplainVerbosity v) const { - return fmt::format("{}({})",NAME,parameters[0].explain(v)); + +std::string FloatspanLowerLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } -LogicalFunction FloatspanLowerLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; c.reserve(1); - for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "sp must be VARSIZED"); - return withChildren(c); + +LogicalFunction FloatspanLowerLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } -SerializableFunction FloatspanLowerLogicalFunction::serialize() const { + +SerializableFunction FloatspanLowerLogicalFunction::serialize() const +{ SerializableFunction proto; proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); - for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } return proto; } + LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterFloatspanLowerLogicalFunction( LogicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.children.size()==1, + PRECONDITION(arguments.children.size() == 1, "FloatspanLowerLogicalFunction requires 1 children but got {}", arguments.children.size()); - return FloatspanLowerLogicalFunction( - std::move(arguments.children[0])); + auto arg0 = std::move(arguments.children[0]); + return FloatspanLowerLogicalFunction(std::move(arg0)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/FloatspanUpperIncLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/FloatspanUpperIncLogicalFunction.cpp index b0a0e58c63..dca8cf5e30 100644 --- a/nes-logical-operators/src/Functions/Meos/FloatspanUpperIncLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/FloatspanUpperIncLogicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -31,42 +32,91 @@ FloatspanUpperIncLogicalFunction::FloatspanUpperIncLogicalFunction(LogicalFuncti parameters.reserve(1); parameters.push_back(std::move(sp)); } -DataType FloatspanUpperIncLogicalFunction::getDataType() const { return dataType; } -LogicalFunction FloatspanUpperIncLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } -std::vector FloatspanUpperIncLogicalFunction::getChildren() const { return parameters; } -LogicalFunction FloatspanUpperIncLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size()==1,"FloatspanUpperIncLogicalFunction requires 1 children, but got {}",children.size()); - auto c=*this; c.parameters=children; return c; + +DataType FloatspanUpperIncLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction FloatspanUpperIncLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector FloatspanUpperIncLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction FloatspanUpperIncLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 1, "FloatspanUpperIncLogicalFunction requires 1 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; +} + +std::string_view FloatspanUpperIncLogicalFunction::getType() const +{ + return NAME; } -std::string_view FloatspanUpperIncLogicalFunction::getType() const { return NAME; } -bool FloatspanUpperIncLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { - if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + +bool FloatspanUpperIncLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } return false; } -std::string FloatspanUpperIncLogicalFunction::explain(ExplainVerbosity v) const { - return fmt::format("{}({})",NAME,parameters[0].explain(v)); + +std::string FloatspanUpperIncLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } -LogicalFunction FloatspanUpperIncLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; c.reserve(1); - for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "sp must be VARSIZED"); - return withChildren(c); + +LogicalFunction FloatspanUpperIncLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } -SerializableFunction FloatspanUpperIncLogicalFunction::serialize() const { + +SerializableFunction FloatspanUpperIncLogicalFunction::serialize() const +{ SerializableFunction proto; proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); - for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } return proto; } + LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterFloatspanUpperIncLogicalFunction( LogicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.children.size()==1, + PRECONDITION(arguments.children.size() == 1, "FloatspanUpperIncLogicalFunction requires 1 children but got {}", arguments.children.size()); - return FloatspanUpperIncLogicalFunction( - std::move(arguments.children[0])); + auto arg0 = std::move(arguments.children[0]); + return FloatspanUpperIncLogicalFunction(std::move(arg0)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/FloatspanUpperLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/FloatspanUpperLogicalFunction.cpp index 289ea6db7f..7585c8c5d5 100644 --- a/nes-logical-operators/src/Functions/Meos/FloatspanUpperLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/FloatspanUpperLogicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -31,42 +32,91 @@ FloatspanUpperLogicalFunction::FloatspanUpperLogicalFunction(LogicalFunction sp) parameters.reserve(1); parameters.push_back(std::move(sp)); } -DataType FloatspanUpperLogicalFunction::getDataType() const { return dataType; } -LogicalFunction FloatspanUpperLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } -std::vector FloatspanUpperLogicalFunction::getChildren() const { return parameters; } -LogicalFunction FloatspanUpperLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size()==1,"FloatspanUpperLogicalFunction requires 1 children, but got {}",children.size()); - auto c=*this; c.parameters=children; return c; + +DataType FloatspanUpperLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction FloatspanUpperLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector FloatspanUpperLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction FloatspanUpperLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 1, "FloatspanUpperLogicalFunction requires 1 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; +} + +std::string_view FloatspanUpperLogicalFunction::getType() const +{ + return NAME; } -std::string_view FloatspanUpperLogicalFunction::getType() const { return NAME; } -bool FloatspanUpperLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { - if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + +bool FloatspanUpperLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } return false; } -std::string FloatspanUpperLogicalFunction::explain(ExplainVerbosity v) const { - return fmt::format("{}({})",NAME,parameters[0].explain(v)); + +std::string FloatspanUpperLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } -LogicalFunction FloatspanUpperLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; c.reserve(1); - for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "sp must be VARSIZED"); - return withChildren(c); + +LogicalFunction FloatspanUpperLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } -SerializableFunction FloatspanUpperLogicalFunction::serialize() const { + +SerializableFunction FloatspanUpperLogicalFunction::serialize() const +{ SerializableFunction proto; proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); - for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } return proto; } + LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterFloatspanUpperLogicalFunction( LogicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.children.size()==1, + PRECONDITION(arguments.children.size() == 1, "FloatspanUpperLogicalFunction requires 1 children but got {}", arguments.children.size()); - return FloatspanUpperLogicalFunction( - std::move(arguments.children[0])); + auto arg0 = std::move(arguments.children[0]); + return FloatspanUpperLogicalFunction(std::move(arg0)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/FloatspanWidthLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/FloatspanWidthLogicalFunction.cpp index 808bad3746..09ac3faa99 100644 --- a/nes-logical-operators/src/Functions/Meos/FloatspanWidthLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/FloatspanWidthLogicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -31,42 +32,91 @@ FloatspanWidthLogicalFunction::FloatspanWidthLogicalFunction(LogicalFunction sp) parameters.reserve(1); parameters.push_back(std::move(sp)); } -DataType FloatspanWidthLogicalFunction::getDataType() const { return dataType; } -LogicalFunction FloatspanWidthLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } -std::vector FloatspanWidthLogicalFunction::getChildren() const { return parameters; } -LogicalFunction FloatspanWidthLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size()==1,"FloatspanWidthLogicalFunction requires 1 children, but got {}",children.size()); - auto c=*this; c.parameters=children; return c; + +DataType FloatspanWidthLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction FloatspanWidthLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector FloatspanWidthLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction FloatspanWidthLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 1, "FloatspanWidthLogicalFunction requires 1 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; +} + +std::string_view FloatspanWidthLogicalFunction::getType() const +{ + return NAME; } -std::string_view FloatspanWidthLogicalFunction::getType() const { return NAME; } -bool FloatspanWidthLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { - if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + +bool FloatspanWidthLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } return false; } -std::string FloatspanWidthLogicalFunction::explain(ExplainVerbosity v) const { - return fmt::format("{}({})",NAME,parameters[0].explain(v)); + +std::string FloatspanWidthLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } -LogicalFunction FloatspanWidthLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; c.reserve(1); - for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "sp must be VARSIZED"); - return withChildren(c); + +LogicalFunction FloatspanWidthLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } -SerializableFunction FloatspanWidthLogicalFunction::serialize() const { + +SerializableFunction FloatspanWidthLogicalFunction::serialize() const +{ SerializableFunction proto; proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); - for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } return proto; } + LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterFloatspanWidthLogicalFunction( LogicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.children.size()==1, + PRECONDITION(arguments.children.size() == 1, "FloatspanWidthLogicalFunction requires 1 children but got {}", arguments.children.size()); - return FloatspanWidthLogicalFunction( - std::move(arguments.children[0])); + auto arg0 = std::move(arguments.children[0]); + return FloatspanWidthLogicalFunction(std::move(arg0)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/GeoAsEwktLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeoAsEwktLogicalFunction.cpp index 7b45560683..9e337e68d3 100644 --- a/nes-logical-operators/src/Functions/Meos/GeoAsEwktLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/GeoAsEwktLogicalFunction.cpp @@ -26,53 +26,77 @@ namespace NES { -GeoAsEwktLogicalFunction::GeoAsEwktLogicalFunction(LogicalFunction wkt, LogicalFunction precision) +GeoAsEwktLogicalFunction::GeoAsEwktLogicalFunction(LogicalFunction wkt, + LogicalFunction arg0) : dataType(DataTypeProvider::provideDataType(DataType::Type::VARSIZED)) { parameters.reserve(2); parameters.push_back(std::move(wkt)); - parameters.push_back(std::move(precision)); + parameters.push_back(std::move(arg0)); } -DataType GeoAsEwktLogicalFunction::getDataType() const { return dataType; } +DataType GeoAsEwktLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction GeoAsEwktLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector GeoAsEwktLogicalFunction::getChildren() const { return parameters; } +std::vector GeoAsEwktLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction GeoAsEwktLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 2, - "GeoAsEwktLogicalFunction requires 2 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 2, "GeoAsEwktLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view GeoAsEwktLogicalFunction::getType() const { return NAME; } +std::string_view GeoAsEwktLogicalFunction::getType() const +{ + return NAME; +} bool GeoAsEwktLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string GeoAsEwktLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction GeoAsEwktLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(2); - for (const auto& p : parameters) - c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "wkt must be VARSIZED"); - INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "precision must be UINT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction GeoAsEwktLogicalFunction::serialize() const @@ -81,7 +105,9 @@ SerializableFunction GeoAsEwktLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -91,9 +117,9 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeo PRECONDITION(arguments.children.size() == 2, "GeoAsEwktLogicalFunction requires 2 children but got {}", arguments.children.size()); - return GeoAsEwktLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + return GeoAsEwktLogicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/GeoAsGeojsonLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeoAsGeojsonLogicalFunction.cpp index b0f1ed3ba6..e0844620d3 100644 --- a/nes-logical-operators/src/Functions/Meos/GeoAsGeojsonLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/GeoAsGeojsonLogicalFunction.cpp @@ -26,55 +26,79 @@ namespace NES { -GeoAsGeojsonLogicalFunction::GeoAsGeojsonLogicalFunction(LogicalFunction wkt, LogicalFunction option, LogicalFunction precision) +GeoAsGeojsonLogicalFunction::GeoAsGeojsonLogicalFunction(LogicalFunction wkt, + LogicalFunction arg0, + LogicalFunction arg1) : dataType(DataTypeProvider::provideDataType(DataType::Type::VARSIZED)) { parameters.reserve(3); parameters.push_back(std::move(wkt)); - parameters.push_back(std::move(option)); - parameters.push_back(std::move(precision)); + parameters.push_back(std::move(arg0)); + parameters.push_back(std::move(arg1)); } -DataType GeoAsGeojsonLogicalFunction::getDataType() const { return dataType; } +DataType GeoAsGeojsonLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction GeoAsGeojsonLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector GeoAsGeojsonLogicalFunction::getChildren() const { return parameters; } +std::vector GeoAsGeojsonLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction GeoAsGeojsonLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 3, - "GeoAsGeojsonLogicalFunction requires 3 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 3, "GeoAsGeojsonLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view GeoAsGeojsonLogicalFunction::getType() const { return NAME; } +std::string_view GeoAsGeojsonLogicalFunction::getType() const +{ + return NAME; +} bool GeoAsGeojsonLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string GeoAsGeojsonLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction GeoAsGeojsonLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(3); - for (const auto& p : parameters) - c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "wkt must be VARSIZED"); - INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "option must be UINT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "precision must be UINT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction GeoAsGeojsonLogicalFunction::serialize() const @@ -83,7 +107,9 @@ SerializableFunction GeoAsGeojsonLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -93,10 +119,10 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeo PRECONDITION(arguments.children.size() == 3, "GeoAsGeojsonLogicalFunction requires 3 children but got {}", arguments.children.size()); - return GeoAsGeojsonLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return GeoAsGeojsonLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/GeoEqualsLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeoEqualsLogicalFunction.cpp index 48b4b40aa1..51a90ef6ef 100644 --- a/nes-logical-operators/src/Functions/Meos/GeoEqualsLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/GeoEqualsLogicalFunction.cpp @@ -26,53 +26,77 @@ namespace NES { -GeoEqualsLogicalFunction::GeoEqualsLogicalFunction(LogicalFunction wkt1, LogicalFunction wkt2) +GeoEqualsLogicalFunction::GeoEqualsLogicalFunction(LogicalFunction wkt, + LogicalFunction arg0) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(2); - parameters.push_back(std::move(wkt1)); - parameters.push_back(std::move(wkt2)); + parameters.push_back(std::move(wkt)); + parameters.push_back(std::move(arg0)); } -DataType GeoEqualsLogicalFunction::getDataType() const { return dataType; } +DataType GeoEqualsLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction GeoEqualsLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector GeoEqualsLogicalFunction::getChildren() const { return parameters; } +std::vector GeoEqualsLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction GeoEqualsLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 2, - "GeoEqualsLogicalFunction requires 2 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 2, "GeoEqualsLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view GeoEqualsLogicalFunction::getType() const { return NAME; } +std::string_view GeoEqualsLogicalFunction::getType() const +{ + return NAME; +} bool GeoEqualsLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string GeoEqualsLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction GeoEqualsLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(2); - c.emplace_back(parameters[0].withInferredDataType(schema)); - c.emplace_back(parameters[1].withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "wkt1 must be VARSIZED"); - INVARIANT(c[1].getDataType().isType(DataType::Type::VARSIZED), "wkt2 must be VARSIZED"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction GeoEqualsLogicalFunction::serialize() const @@ -81,7 +105,9 @@ SerializableFunction GeoEqualsLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -91,8 +117,9 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeo PRECONDITION(arguments.children.size() == 2, "GeoEqualsLogicalFunction requires 2 children but got {}", arguments.children.size()); - return GeoEqualsLogicalFunction(std::move(arguments.children[0]), - std::move(arguments.children[1])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + return GeoEqualsLogicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/GeoGeoNLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeoGeoNLogicalFunction.cpp index e897eab065..1ddef28bc9 100644 --- a/nes-logical-operators/src/Functions/Meos/GeoGeoNLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/GeoGeoNLogicalFunction.cpp @@ -26,53 +26,77 @@ namespace NES { -GeoGeoNLogicalFunction::GeoGeoNLogicalFunction(LogicalFunction wkt, LogicalFunction n) +GeoGeoNLogicalFunction::GeoGeoNLogicalFunction(LogicalFunction wkt, + LogicalFunction arg0) : dataType(DataTypeProvider::provideDataType(DataType::Type::VARSIZED)) { parameters.reserve(2); parameters.push_back(std::move(wkt)); - parameters.push_back(std::move(n)); + parameters.push_back(std::move(arg0)); } -DataType GeoGeoNLogicalFunction::getDataType() const { return dataType; } +DataType GeoGeoNLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction GeoGeoNLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector GeoGeoNLogicalFunction::getChildren() const { return parameters; } +std::vector GeoGeoNLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction GeoGeoNLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 2, - "GeoGeoNLogicalFunction requires 2 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 2, "GeoGeoNLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view GeoGeoNLogicalFunction::getType() const { return NAME; } +std::string_view GeoGeoNLogicalFunction::getType() const +{ + return NAME; +} bool GeoGeoNLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string GeoGeoNLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction GeoGeoNLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(2); - for (const auto& p : parameters) - c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "wkt must be VARSIZED"); - INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "n must be UINT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction GeoGeoNLogicalFunction::serialize() const @@ -81,7 +105,9 @@ SerializableFunction GeoGeoNLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -91,9 +117,9 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeo PRECONDITION(arguments.children.size() == 2, "GeoGeoNLogicalFunction requires 2 children but got {}", arguments.children.size()); - return GeoGeoNLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + return GeoGeoNLogicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/GeoIsUnitaryLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeoIsUnitaryLogicalFunction.cpp index b3f1f32798..c463b71a52 100644 --- a/nes-logical-operators/src/Functions/Meos/GeoIsUnitaryLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/GeoIsUnitaryLogicalFunction.cpp @@ -33,43 +33,68 @@ GeoIsUnitaryLogicalFunction::GeoIsUnitaryLogicalFunction(LogicalFunction wkt) parameters.push_back(std::move(wkt)); } -DataType GeoIsUnitaryLogicalFunction::getDataType() const { return dataType; } +DataType GeoIsUnitaryLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction GeoIsUnitaryLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector GeoIsUnitaryLogicalFunction::getChildren() const { return parameters; } +std::vector GeoIsUnitaryLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction GeoIsUnitaryLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 1, - "GeoIsUnitaryLogicalFunction requires 1 child, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 1, "GeoIsUnitaryLogicalFunction requires 1 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view GeoIsUnitaryLogicalFunction::getType() const { return NAME; } +std::string_view GeoIsUnitaryLogicalFunction::getType() const +{ + return NAME; +} bool GeoIsUnitaryLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string GeoIsUnitaryLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction GeoIsUnitaryLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(1); - c.emplace_back(parameters[0].withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "wkt must be VARSIZED"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction GeoIsUnitaryLogicalFunction::serialize() const @@ -78,7 +103,9 @@ SerializableFunction GeoIsUnitaryLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -86,9 +113,10 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeo LogicalFunctionRegistryArguments arguments) { PRECONDITION(arguments.children.size() == 1, - "GeoIsUnitaryLogicalFunction requires 1 child but got {}", + "GeoIsUnitaryLogicalFunction requires 1 children but got {}", arguments.children.size()); - return GeoIsUnitaryLogicalFunction(std::move(arguments.children[0])); + auto arg0 = std::move(arguments.children[0]); + return GeoIsUnitaryLogicalFunction(std::move(arg0)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/GeoNumGeosLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeoNumGeosLogicalFunction.cpp index f12ce09ac8..f6c602d5ed 100644 --- a/nes-logical-operators/src/Functions/Meos/GeoNumGeosLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/GeoNumGeosLogicalFunction.cpp @@ -33,43 +33,68 @@ GeoNumGeosLogicalFunction::GeoNumGeosLogicalFunction(LogicalFunction wkt) parameters.push_back(std::move(wkt)); } -DataType GeoNumGeosLogicalFunction::getDataType() const { return dataType; } +DataType GeoNumGeosLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction GeoNumGeosLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector GeoNumGeosLogicalFunction::getChildren() const { return parameters; } +std::vector GeoNumGeosLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction GeoNumGeosLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 1, - "GeoNumGeosLogicalFunction requires 1 child, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 1, "GeoNumGeosLogicalFunction requires 1 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view GeoNumGeosLogicalFunction::getType() const { return NAME; } +std::string_view GeoNumGeosLogicalFunction::getType() const +{ + return NAME; +} bool GeoNumGeosLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string GeoNumGeosLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction GeoNumGeosLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(1); - c.emplace_back(parameters[0].withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "wkt must be VARSIZED"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction GeoNumGeosLogicalFunction::serialize() const @@ -78,7 +103,9 @@ SerializableFunction GeoNumGeosLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -86,9 +113,10 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeo LogicalFunctionRegistryArguments arguments) { PRECONDITION(arguments.children.size() == 1, - "GeoNumGeosLogicalFunction requires 1 child but got {}", + "GeoNumGeosLogicalFunction requires 1 children but got {}", arguments.children.size()); - return GeoNumGeosLogicalFunction(std::move(arguments.children[0])); + auto arg0 = std::move(arguments.children[0]); + return GeoNumGeosLogicalFunction(std::move(arg0)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/GeoNumPointsLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeoNumPointsLogicalFunction.cpp index 740184d839..2a7abd9fef 100644 --- a/nes-logical-operators/src/Functions/Meos/GeoNumPointsLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/GeoNumPointsLogicalFunction.cpp @@ -33,43 +33,68 @@ GeoNumPointsLogicalFunction::GeoNumPointsLogicalFunction(LogicalFunction wkt) parameters.push_back(std::move(wkt)); } -DataType GeoNumPointsLogicalFunction::getDataType() const { return dataType; } +DataType GeoNumPointsLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction GeoNumPointsLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector GeoNumPointsLogicalFunction::getChildren() const { return parameters; } +std::vector GeoNumPointsLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction GeoNumPointsLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 1, - "GeoNumPointsLogicalFunction requires 1 child, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 1, "GeoNumPointsLogicalFunction requires 1 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view GeoNumPointsLogicalFunction::getType() const { return NAME; } +std::string_view GeoNumPointsLogicalFunction::getType() const +{ + return NAME; +} bool GeoNumPointsLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string GeoNumPointsLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction GeoNumPointsLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(1); - c.emplace_back(parameters[0].withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "wkt must be VARSIZED"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction GeoNumPointsLogicalFunction::serialize() const @@ -78,7 +103,9 @@ SerializableFunction GeoNumPointsLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -86,9 +113,10 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeo LogicalFunctionRegistryArguments arguments) { PRECONDITION(arguments.children.size() == 1, - "GeoNumPointsLogicalFunction requires 1 child but got {}", + "GeoNumPointsLogicalFunction requires 1 children but got {}", arguments.children.size()); - return GeoNumPointsLogicalFunction(std::move(arguments.children[0])); + auto arg0 = std::move(arguments.children[0]); + return GeoNumPointsLogicalFunction(std::move(arg0)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/GeoPointsLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeoPointsLogicalFunction.cpp index 59507b39c0..9236e96371 100644 --- a/nes-logical-operators/src/Functions/Meos/GeoPointsLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/GeoPointsLogicalFunction.cpp @@ -33,44 +33,68 @@ GeoPointsLogicalFunction::GeoPointsLogicalFunction(LogicalFunction wkt) parameters.push_back(std::move(wkt)); } -DataType GeoPointsLogicalFunction::getDataType() const { return dataType; } +DataType GeoPointsLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction GeoPointsLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector GeoPointsLogicalFunction::getChildren() const { return parameters; } +std::vector GeoPointsLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction GeoPointsLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 1, - "GeoPointsLogicalFunction requires 1 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 1, "GeoPointsLogicalFunction requires 1 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view GeoPointsLogicalFunction::getType() const { return NAME; } +std::string_view GeoPointsLogicalFunction::getType() const +{ + return NAME; +} bool GeoPointsLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string GeoPointsLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction GeoPointsLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(1); - for (const auto& p : parameters) - c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "wkt must be VARSIZED"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction GeoPointsLogicalFunction::serialize() const @@ -79,7 +103,9 @@ SerializableFunction GeoPointsLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -89,8 +115,8 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeo PRECONDITION(arguments.children.size() == 1, "GeoPointsLogicalFunction requires 1 children but got {}", arguments.children.size()); - return GeoPointsLogicalFunction( - std::move(arguments.children[0])); + auto arg0 = std::move(arguments.children[0]); + return GeoPointsLogicalFunction(std::move(arg0)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/GeoReverseLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeoReverseLogicalFunction.cpp index e70629d6e0..b65b756b17 100644 --- a/nes-logical-operators/src/Functions/Meos/GeoReverseLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/GeoReverseLogicalFunction.cpp @@ -33,44 +33,68 @@ GeoReverseLogicalFunction::GeoReverseLogicalFunction(LogicalFunction wkt) parameters.push_back(std::move(wkt)); } -DataType GeoReverseLogicalFunction::getDataType() const { return dataType; } +DataType GeoReverseLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction GeoReverseLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector GeoReverseLogicalFunction::getChildren() const { return parameters; } +std::vector GeoReverseLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction GeoReverseLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 1, - "GeoReverseLogicalFunction requires 1 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 1, "GeoReverseLogicalFunction requires 1 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view GeoReverseLogicalFunction::getType() const { return NAME; } +std::string_view GeoReverseLogicalFunction::getType() const +{ + return NAME; +} bool GeoReverseLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string GeoReverseLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction GeoReverseLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(1); - for (const auto& p : parameters) - c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "wkt must be VARSIZED"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction GeoReverseLogicalFunction::serialize() const @@ -79,7 +103,9 @@ SerializableFunction GeoReverseLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -89,8 +115,8 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeo PRECONDITION(arguments.children.size() == 1, "GeoReverseLogicalFunction requires 1 children but got {}", arguments.children.size()); - return GeoReverseLogicalFunction( - std::move(arguments.children[0])); + auto arg0 = std::move(arguments.children[0]); + return GeoReverseLogicalFunction(std::move(arg0)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/GeoRoundLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeoRoundLogicalFunction.cpp index 799e4a137a..7c292ca5e1 100644 --- a/nes-logical-operators/src/Functions/Meos/GeoRoundLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/GeoRoundLogicalFunction.cpp @@ -26,53 +26,77 @@ namespace NES { -GeoRoundLogicalFunction::GeoRoundLogicalFunction(LogicalFunction wkt, LogicalFunction maxdd) +GeoRoundLogicalFunction::GeoRoundLogicalFunction(LogicalFunction wkt, + LogicalFunction arg0) : dataType(DataTypeProvider::provideDataType(DataType::Type::VARSIZED)) { parameters.reserve(2); parameters.push_back(std::move(wkt)); - parameters.push_back(std::move(maxdd)); + parameters.push_back(std::move(arg0)); } -DataType GeoRoundLogicalFunction::getDataType() const { return dataType; } +DataType GeoRoundLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction GeoRoundLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector GeoRoundLogicalFunction::getChildren() const { return parameters; } +std::vector GeoRoundLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction GeoRoundLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 2, - "GeoRoundLogicalFunction requires 2 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 2, "GeoRoundLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view GeoRoundLogicalFunction::getType() const { return NAME; } +std::string_view GeoRoundLogicalFunction::getType() const +{ + return NAME; +} bool GeoRoundLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string GeoRoundLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction GeoRoundLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(2); - for (const auto& p : parameters) - c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "wkt must be VARSIZED"); - INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "maxdd must be UINT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction GeoRoundLogicalFunction::serialize() const @@ -81,7 +105,9 @@ SerializableFunction GeoRoundLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -91,9 +117,9 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeo PRECONDITION(arguments.children.size() == 2, "GeoRoundLogicalFunction requires 2 children but got {}", arguments.children.size()); - return GeoRoundLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + return GeoRoundLogicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/GeoSameLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeoSameLogicalFunction.cpp index 658068a60c..a73c9f5bbb 100644 --- a/nes-logical-operators/src/Functions/Meos/GeoSameLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/GeoSameLogicalFunction.cpp @@ -26,53 +26,77 @@ namespace NES { -GeoSameLogicalFunction::GeoSameLogicalFunction(LogicalFunction wkt1, LogicalFunction wkt2) +GeoSameLogicalFunction::GeoSameLogicalFunction(LogicalFunction wkt, + LogicalFunction arg0) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(2); - parameters.push_back(std::move(wkt1)); - parameters.push_back(std::move(wkt2)); + parameters.push_back(std::move(wkt)); + parameters.push_back(std::move(arg0)); } -DataType GeoSameLogicalFunction::getDataType() const { return dataType; } +DataType GeoSameLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction GeoSameLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector GeoSameLogicalFunction::getChildren() const { return parameters; } +std::vector GeoSameLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction GeoSameLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 2, - "GeoSameLogicalFunction requires 2 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 2, "GeoSameLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view GeoSameLogicalFunction::getType() const { return NAME; } +std::string_view GeoSameLogicalFunction::getType() const +{ + return NAME; +} bool GeoSameLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string GeoSameLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction GeoSameLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(2); - c.emplace_back(parameters[0].withInferredDataType(schema)); - c.emplace_back(parameters[1].withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "wkt1 must be VARSIZED"); - INVARIANT(c[1].getDataType().isType(DataType::Type::VARSIZED), "wkt2 must be VARSIZED"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction GeoSameLogicalFunction::serialize() const @@ -81,7 +105,9 @@ SerializableFunction GeoSameLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -91,8 +117,9 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeo PRECONDITION(arguments.children.size() == 2, "GeoSameLogicalFunction requires 2 children but got {}", arguments.children.size()); - return GeoSameLogicalFunction(std::move(arguments.children[0]), - std::move(arguments.children[1])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + return GeoSameLogicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/GeoSetSridLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeoSetSridLogicalFunction.cpp index 23eb26e5c9..4254bc8c7d 100644 --- a/nes-logical-operators/src/Functions/Meos/GeoSetSridLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/GeoSetSridLogicalFunction.cpp @@ -26,53 +26,77 @@ namespace NES { -GeoSetSridLogicalFunction::GeoSetSridLogicalFunction(LogicalFunction wkt, LogicalFunction srid) +GeoSetSridLogicalFunction::GeoSetSridLogicalFunction(LogicalFunction wkt, + LogicalFunction arg0) : dataType(DataTypeProvider::provideDataType(DataType::Type::VARSIZED)) { parameters.reserve(2); parameters.push_back(std::move(wkt)); - parameters.push_back(std::move(srid)); + parameters.push_back(std::move(arg0)); } -DataType GeoSetSridLogicalFunction::getDataType() const { return dataType; } +DataType GeoSetSridLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction GeoSetSridLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector GeoSetSridLogicalFunction::getChildren() const { return parameters; } +std::vector GeoSetSridLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction GeoSetSridLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 2, - "GeoSetSridLogicalFunction requires 2 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 2, "GeoSetSridLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view GeoSetSridLogicalFunction::getType() const { return NAME; } +std::string_view GeoSetSridLogicalFunction::getType() const +{ + return NAME; +} bool GeoSetSridLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string GeoSetSridLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction GeoSetSridLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(2); - for (const auto& p : parameters) - c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "wkt must be VARSIZED"); - INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "srid must be UINT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction GeoSetSridLogicalFunction::serialize() const @@ -81,7 +105,9 @@ SerializableFunction GeoSetSridLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -91,9 +117,9 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeo PRECONDITION(arguments.children.size() == 2, "GeoSetSridLogicalFunction requires 2 children but got {}", arguments.children.size()); - return GeoSetSridLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + return GeoSetSridLogicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/GeoSridLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeoSridLogicalFunction.cpp index a98433ec51..9e8bc01525 100644 --- a/nes-logical-operators/src/Functions/Meos/GeoSridLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/GeoSridLogicalFunction.cpp @@ -33,43 +33,68 @@ GeoSridLogicalFunction::GeoSridLogicalFunction(LogicalFunction wkt) parameters.push_back(std::move(wkt)); } -DataType GeoSridLogicalFunction::getDataType() const { return dataType; } +DataType GeoSridLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction GeoSridLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector GeoSridLogicalFunction::getChildren() const { return parameters; } +std::vector GeoSridLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction GeoSridLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 1, - "GeoSridLogicalFunction requires 1 child, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 1, "GeoSridLogicalFunction requires 1 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view GeoSridLogicalFunction::getType() const { return NAME; } +std::string_view GeoSridLogicalFunction::getType() const +{ + return NAME; +} bool GeoSridLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string GeoSridLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction GeoSridLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(1); - c.emplace_back(parameters[0].withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "wkt must be VARSIZED"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction GeoSridLogicalFunction::serialize() const @@ -78,7 +103,9 @@ SerializableFunction GeoSridLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -86,9 +113,10 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeo LogicalFunctionRegistryArguments arguments) { PRECONDITION(arguments.children.size() == 1, - "GeoSridLogicalFunction requires 1 child but got {}", + "GeoSridLogicalFunction requires 1 children but got {}", arguments.children.size()); - return GeoSridLogicalFunction(std::move(arguments.children[0])); + auto arg0 = std::move(arguments.children[0]); + return GeoSridLogicalFunction(std::move(arg0)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/GeoTransformLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeoTransformLogicalFunction.cpp index 38a442097f..0e87cb75d9 100644 --- a/nes-logical-operators/src/Functions/Meos/GeoTransformLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/GeoTransformLogicalFunction.cpp @@ -26,53 +26,77 @@ namespace NES { -GeoTransformLogicalFunction::GeoTransformLogicalFunction(LogicalFunction wkt, LogicalFunction srid_to) +GeoTransformLogicalFunction::GeoTransformLogicalFunction(LogicalFunction wkt, + LogicalFunction arg0) : dataType(DataTypeProvider::provideDataType(DataType::Type::VARSIZED)) { parameters.reserve(2); parameters.push_back(std::move(wkt)); - parameters.push_back(std::move(srid_to)); + parameters.push_back(std::move(arg0)); } -DataType GeoTransformLogicalFunction::getDataType() const { return dataType; } +DataType GeoTransformLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction GeoTransformLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector GeoTransformLogicalFunction::getChildren() const { return parameters; } +std::vector GeoTransformLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction GeoTransformLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 2, - "GeoTransformLogicalFunction requires 2 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 2, "GeoTransformLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view GeoTransformLogicalFunction::getType() const { return NAME; } +std::string_view GeoTransformLogicalFunction::getType() const +{ + return NAME; +} bool GeoTransformLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string GeoTransformLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction GeoTransformLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(2); - for (const auto& p : parameters) - c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "wkt must be VARSIZED"); - INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "srid_to must be UINT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction GeoTransformLogicalFunction::serialize() const @@ -81,7 +105,9 @@ SerializableFunction GeoTransformLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -91,9 +117,9 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeo PRECONDITION(arguments.children.size() == 2, "GeoTransformLogicalFunction requires 2 children but got {}", arguments.children.size()); - return GeoTransformLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + return GeoTransformLogicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/GeogAreaLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeogAreaLogicalFunction.cpp index 3e0ff84ffb..d42e6cfcc8 100644 --- a/nes-logical-operators/src/Functions/Meos/GeogAreaLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/GeogAreaLogicalFunction.cpp @@ -26,49 +26,74 @@ namespace NES { -GeogAreaLogicalFunction::GeogAreaLogicalFunction(LogicalFunction wkt1) +GeogAreaLogicalFunction::GeogAreaLogicalFunction(LogicalFunction wkt) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(1); - parameters.push_back(std::move(wkt1)); + parameters.push_back(std::move(wkt)); } -DataType GeogAreaLogicalFunction::getDataType() const { return dataType; } +DataType GeogAreaLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction GeogAreaLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector GeogAreaLogicalFunction::getChildren() const { return parameters; } +std::vector GeogAreaLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction GeogAreaLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 1, "GeogAreaLogicalFunction requires 1 child, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 1, "GeogAreaLogicalFunction requires 1 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view GeogAreaLogicalFunction::getType() const { return NAME; } +std::string_view GeogAreaLogicalFunction::getType() const +{ + return NAME; +} bool GeogAreaLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string GeogAreaLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction GeogAreaLogicalFunction::withInferredDataType(const Schema& schema) const { std::vector newChildren; - newChildren.reserve(1); - newChildren.emplace_back(parameters[0].withInferredDataType(schema)); - INVARIANT(newChildren[0].getDataType().isType(DataType::Type::VARSIZED), - "wkt1 must be VARSIZED, but was: {}", newChildren[0].getDataType()); + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -78,7 +103,9 @@ SerializableFunction GeogAreaLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -86,9 +113,10 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeo LogicalFunctionRegistryArguments arguments) { PRECONDITION(arguments.children.size() == 1, - "GeogAreaLogicalFunction requires 1 child but got {}", + "GeogAreaLogicalFunction requires 1 children but got {}", arguments.children.size()); - return GeogAreaLogicalFunction(std::move(arguments.children[0])); + auto arg0 = std::move(arguments.children[0]); + return GeogAreaLogicalFunction(std::move(arg0)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/GeogCentroidLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeogCentroidLogicalFunction.cpp index 6d434f8684..b088f2d239 100644 --- a/nes-logical-operators/src/Functions/Meos/GeogCentroidLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/GeogCentroidLogicalFunction.cpp @@ -26,53 +26,77 @@ namespace NES { -GeogCentroidLogicalFunction::GeogCentroidLogicalFunction(LogicalFunction wkt, LogicalFunction use_spheroid) +GeogCentroidLogicalFunction::GeogCentroidLogicalFunction(LogicalFunction wkt, + LogicalFunction arg0) : dataType(DataTypeProvider::provideDataType(DataType::Type::VARSIZED)) { parameters.reserve(2); parameters.push_back(std::move(wkt)); - parameters.push_back(std::move(use_spheroid)); + parameters.push_back(std::move(arg0)); } -DataType GeogCentroidLogicalFunction::getDataType() const { return dataType; } +DataType GeogCentroidLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction GeogCentroidLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector GeogCentroidLogicalFunction::getChildren() const { return parameters; } +std::vector GeogCentroidLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction GeogCentroidLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 2, - "GeogCentroidLogicalFunction requires 2 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 2, "GeogCentroidLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view GeogCentroidLogicalFunction::getType() const { return NAME; } +std::string_view GeogCentroidLogicalFunction::getType() const +{ + return NAME; +} bool GeogCentroidLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string GeogCentroidLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction GeogCentroidLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(2); - for (const auto& p : parameters) - c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "wkt must be VARSIZED"); - INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "use_spheroid must be UINT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction GeogCentroidLogicalFunction::serialize() const @@ -81,7 +105,9 @@ SerializableFunction GeogCentroidLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -91,9 +117,9 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeo PRECONDITION(arguments.children.size() == 2, "GeogCentroidLogicalFunction requires 2 children but got {}", arguments.children.size()); - return GeogCentroidLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + return GeogCentroidLogicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/GeogDistanceLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeogDistanceLogicalFunction.cpp index ac2b16b3f0..7957786079 100644 --- a/nes-logical-operators/src/Functions/Meos/GeogDistanceLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/GeogDistanceLogicalFunction.cpp @@ -26,53 +26,77 @@ namespace NES { -GeogDistanceLogicalFunction::GeogDistanceLogicalFunction(LogicalFunction wkt1, LogicalFunction wkt2) +GeogDistanceLogicalFunction::GeogDistanceLogicalFunction(LogicalFunction wkt, + LogicalFunction arg0) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(2); - parameters.push_back(std::move(wkt1)); - parameters.push_back(std::move(wkt2)); + parameters.push_back(std::move(wkt)); + parameters.push_back(std::move(arg0)); } -DataType GeogDistanceLogicalFunction::getDataType() const { return dataType; } +DataType GeogDistanceLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction GeogDistanceLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector GeogDistanceLogicalFunction::getChildren() const { return parameters; } +std::vector GeogDistanceLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction GeogDistanceLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 2, - "GeogDistanceLogicalFunction requires 2 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 2, "GeogDistanceLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view GeogDistanceLogicalFunction::getType() const { return NAME; } +std::string_view GeogDistanceLogicalFunction::getType() const +{ + return NAME; +} bool GeogDistanceLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string GeogDistanceLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction GeogDistanceLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(2); - c.emplace_back(parameters[0].withInferredDataType(schema)); - c.emplace_back(parameters[1].withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "wkt1 must be VARSIZED"); - INVARIANT(c[1].getDataType().isType(DataType::Type::VARSIZED), "wkt2 must be VARSIZED"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction GeogDistanceLogicalFunction::serialize() const @@ -81,7 +105,9 @@ SerializableFunction GeogDistanceLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -91,8 +117,9 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeo PRECONDITION(arguments.children.size() == 2, "GeogDistanceLogicalFunction requires 2 children but got {}", arguments.children.size()); - return GeogDistanceLogicalFunction(std::move(arguments.children[0]), - std::move(arguments.children[1])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + return GeogDistanceLogicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/GeogDwithinLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeogDwithinLogicalFunction.cpp index 2ddd5b07ae..9ac8969733 100644 --- a/nes-logical-operators/src/Functions/Meos/GeogDwithinLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/GeogDwithinLogicalFunction.cpp @@ -26,57 +26,79 @@ namespace NES { -GeogDwithinLogicalFunction::GeogDwithinLogicalFunction(LogicalFunction wkt1, LogicalFunction wkt2, - LogicalFunction tolerance) +GeogDwithinLogicalFunction::GeogDwithinLogicalFunction(LogicalFunction wkt, + LogicalFunction arg0, + LogicalFunction arg1) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(3); - parameters.push_back(std::move(wkt1)); - parameters.push_back(std::move(wkt2)); - parameters.push_back(std::move(tolerance)); + parameters.push_back(std::move(wkt)); + parameters.push_back(std::move(arg0)); + parameters.push_back(std::move(arg1)); } -DataType GeogDwithinLogicalFunction::getDataType() const { return dataType; } +DataType GeogDwithinLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction GeogDwithinLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector GeogDwithinLogicalFunction::getChildren() const { return parameters; } +std::vector GeogDwithinLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction GeogDwithinLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 3, - "GeogDwithinLogicalFunction requires 3 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 3, "GeogDwithinLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view GeogDwithinLogicalFunction::getType() const { return NAME; } +std::string_view GeogDwithinLogicalFunction::getType() const +{ + return NAME; +} bool GeogDwithinLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string GeogDwithinLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction GeogDwithinLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(3); - c.emplace_back(parameters[0].withInferredDataType(schema)); - c.emplace_back(parameters[1].withInferredDataType(schema)); - c.emplace_back(parameters[2].withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "wkt1 must be VARSIZED"); - INVARIANT(c[1].getDataType().isType(DataType::Type::VARSIZED), "wkt2 must be VARSIZED"); - INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "tolerance must be FLOAT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction GeogDwithinLogicalFunction::serialize() const @@ -85,7 +107,9 @@ SerializableFunction GeogDwithinLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -95,9 +119,10 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeo PRECONDITION(arguments.children.size() == 3, "GeogDwithinLogicalFunction requires 3 children but got {}", arguments.children.size()); - return GeogDwithinLogicalFunction(std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return GeogDwithinLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/GeogIntersectsLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeogIntersectsLogicalFunction.cpp index b51a3450c6..014ebc494e 100644 --- a/nes-logical-operators/src/Functions/Meos/GeogIntersectsLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/GeogIntersectsLogicalFunction.cpp @@ -26,53 +26,77 @@ namespace NES { -GeogIntersectsLogicalFunction::GeogIntersectsLogicalFunction(LogicalFunction wkt1, LogicalFunction wkt2) +GeogIntersectsLogicalFunction::GeogIntersectsLogicalFunction(LogicalFunction wkt, + LogicalFunction arg0) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(2); - parameters.push_back(std::move(wkt1)); - parameters.push_back(std::move(wkt2)); + parameters.push_back(std::move(wkt)); + parameters.push_back(std::move(arg0)); } -DataType GeogIntersectsLogicalFunction::getDataType() const { return dataType; } +DataType GeogIntersectsLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction GeogIntersectsLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector GeogIntersectsLogicalFunction::getChildren() const { return parameters; } +std::vector GeogIntersectsLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction GeogIntersectsLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 2, - "GeogIntersectsLogicalFunction requires 2 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 2, "GeogIntersectsLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view GeogIntersectsLogicalFunction::getType() const { return NAME; } +std::string_view GeogIntersectsLogicalFunction::getType() const +{ + return NAME; +} bool GeogIntersectsLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string GeogIntersectsLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction GeogIntersectsLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(2); - c.emplace_back(parameters[0].withInferredDataType(schema)); - c.emplace_back(parameters[1].withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "wkt1 must be VARSIZED"); - INVARIANT(c[1].getDataType().isType(DataType::Type::VARSIZED), "wkt2 must be VARSIZED"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction GeogIntersectsLogicalFunction::serialize() const @@ -81,7 +105,9 @@ SerializableFunction GeogIntersectsLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -91,8 +117,9 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeo PRECONDITION(arguments.children.size() == 2, "GeogIntersectsLogicalFunction requires 2 children but got {}", arguments.children.size()); - return GeogIntersectsLogicalFunction(std::move(arguments.children[0]), - std::move(arguments.children[1])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + return GeogIntersectsLogicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/GeogLengthLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeogLengthLogicalFunction.cpp index cda79e46a3..5cadfdbac6 100644 --- a/nes-logical-operators/src/Functions/Meos/GeogLengthLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/GeogLengthLogicalFunction.cpp @@ -26,49 +26,74 @@ namespace NES { -GeogLengthLogicalFunction::GeogLengthLogicalFunction(LogicalFunction wkt1) +GeogLengthLogicalFunction::GeogLengthLogicalFunction(LogicalFunction wkt) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(1); - parameters.push_back(std::move(wkt1)); + parameters.push_back(std::move(wkt)); } -DataType GeogLengthLogicalFunction::getDataType() const { return dataType; } +DataType GeogLengthLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction GeogLengthLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector GeogLengthLogicalFunction::getChildren() const { return parameters; } +std::vector GeogLengthLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction GeogLengthLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 1, "GeogLengthLogicalFunction requires 1 child, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 1, "GeogLengthLogicalFunction requires 1 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view GeogLengthLogicalFunction::getType() const { return NAME; } +std::string_view GeogLengthLogicalFunction::getType() const +{ + return NAME; +} bool GeogLengthLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string GeogLengthLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction GeogLengthLogicalFunction::withInferredDataType(const Schema& schema) const { std::vector newChildren; - newChildren.reserve(1); - newChildren.emplace_back(parameters[0].withInferredDataType(schema)); - INVARIANT(newChildren[0].getDataType().isType(DataType::Type::VARSIZED), - "wkt1 must be VARSIZED, but was: {}", newChildren[0].getDataType()); + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -78,7 +103,9 @@ SerializableFunction GeogLengthLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -86,9 +113,10 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeo LogicalFunctionRegistryArguments arguments) { PRECONDITION(arguments.children.size() == 1, - "GeogLengthLogicalFunction requires 1 child but got {}", + "GeogLengthLogicalFunction requires 1 children but got {}", arguments.children.size()); - return GeogLengthLogicalFunction(std::move(arguments.children[0])); + auto arg0 = std::move(arguments.children[0]); + return GeogLengthLogicalFunction(std::move(arg0)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/GeogPerimeterLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeogPerimeterLogicalFunction.cpp index b31424e807..c0d661ea85 100644 --- a/nes-logical-operators/src/Functions/Meos/GeogPerimeterLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/GeogPerimeterLogicalFunction.cpp @@ -26,49 +26,74 @@ namespace NES { -GeogPerimeterLogicalFunction::GeogPerimeterLogicalFunction(LogicalFunction wkt1) +GeogPerimeterLogicalFunction::GeogPerimeterLogicalFunction(LogicalFunction wkt) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(1); - parameters.push_back(std::move(wkt1)); + parameters.push_back(std::move(wkt)); } -DataType GeogPerimeterLogicalFunction::getDataType() const { return dataType; } +DataType GeogPerimeterLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction GeogPerimeterLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector GeogPerimeterLogicalFunction::getChildren() const { return parameters; } +std::vector GeogPerimeterLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction GeogPerimeterLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 1, "GeogPerimeterLogicalFunction requires 1 child, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 1, "GeogPerimeterLogicalFunction requires 1 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view GeogPerimeterLogicalFunction::getType() const { return NAME; } +std::string_view GeogPerimeterLogicalFunction::getType() const +{ + return NAME; +} bool GeogPerimeterLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string GeogPerimeterLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction GeogPerimeterLogicalFunction::withInferredDataType(const Schema& schema) const { std::vector newChildren; - newChildren.reserve(1); - newChildren.emplace_back(parameters[0].withInferredDataType(schema)); - INVARIANT(newChildren[0].getDataType().isType(DataType::Type::VARSIZED), - "wkt1 must be VARSIZED, but was: {}", newChildren[0].getDataType()); + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -78,7 +103,9 @@ SerializableFunction GeogPerimeterLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -86,9 +113,10 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeo LogicalFunctionRegistryArguments arguments) { PRECONDITION(arguments.children.size() == 1, - "GeogPerimeterLogicalFunction requires 1 child but got {}", + "GeogPerimeterLogicalFunction requires 1 children but got {}", arguments.children.size()); - return GeogPerimeterLogicalFunction(std::move(arguments.children[0])); + auto arg0 = std::move(arguments.children[0]); + return GeogPerimeterLogicalFunction(std::move(arg0)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/GeogPointMake2dLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeogPointMake2dLogicalFunction.cpp index b0f2357278..95502c3580 100644 --- a/nes-logical-operators/src/Functions/Meos/GeogPointMake2dLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/GeogPointMake2dLogicalFunction.cpp @@ -26,7 +26,9 @@ namespace NES { -GeogPointMake2dLogicalFunction::GeogPointMake2dLogicalFunction(LogicalFunction srid, LogicalFunction x, LogicalFunction y) +GeogPointMake2dLogicalFunction::GeogPointMake2dLogicalFunction(LogicalFunction srid, + LogicalFunction x, + LogicalFunction y) : dataType(DataTypeProvider::provideDataType(DataType::Type::VARSIZED)) { parameters.reserve(3); @@ -35,46 +37,68 @@ GeogPointMake2dLogicalFunction::GeogPointMake2dLogicalFunction(LogicalFunction s parameters.push_back(std::move(y)); } -DataType GeogPointMake2dLogicalFunction::getDataType() const { return dataType; } +DataType GeogPointMake2dLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction GeogPointMake2dLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector GeogPointMake2dLogicalFunction::getChildren() const { return parameters; } +std::vector GeogPointMake2dLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction GeogPointMake2dLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 3, - "GeogPointMake2dLogicalFunction requires 3 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 3, "GeogPointMake2dLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view GeogPointMake2dLogicalFunction::getType() const { return NAME; } +std::string_view GeogPointMake2dLogicalFunction::getType() const +{ + return NAME; +} bool GeogPointMake2dLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string GeogPointMake2dLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction GeogPointMake2dLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(3); - for (const auto& p : parameters) - c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "srid must be UINT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "x must be FLOAT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "y must be FLOAT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction GeogPointMake2dLogicalFunction::serialize() const @@ -83,7 +107,9 @@ SerializableFunction GeogPointMake2dLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -93,10 +119,10 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeo PRECONDITION(arguments.children.size() == 3, "GeogPointMake2dLogicalFunction requires 3 children but got {}", arguments.children.size()); - return GeogPointMake2dLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return GeogPointMake2dLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/GeogPointMake3dzLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeogPointMake3dzLogicalFunction.cpp index 23c43682f8..9a886ce82c 100644 --- a/nes-logical-operators/src/Functions/Meos/GeogPointMake3dzLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/GeogPointMake3dzLogicalFunction.cpp @@ -26,7 +26,10 @@ namespace NES { -GeogPointMake3dzLogicalFunction::GeogPointMake3dzLogicalFunction(LogicalFunction srid, LogicalFunction x, LogicalFunction y, LogicalFunction z) +GeogPointMake3dzLogicalFunction::GeogPointMake3dzLogicalFunction(LogicalFunction srid, + LogicalFunction x, + LogicalFunction y, + LogicalFunction z) : dataType(DataTypeProvider::provideDataType(DataType::Type::VARSIZED)) { parameters.reserve(4); @@ -36,47 +39,68 @@ GeogPointMake3dzLogicalFunction::GeogPointMake3dzLogicalFunction(LogicalFunction parameters.push_back(std::move(z)); } -DataType GeogPointMake3dzLogicalFunction::getDataType() const { return dataType; } +DataType GeogPointMake3dzLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction GeogPointMake3dzLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector GeogPointMake3dzLogicalFunction::getChildren() const { return parameters; } +std::vector GeogPointMake3dzLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction GeogPointMake3dzLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 4, - "GeogPointMake3dzLogicalFunction requires 4 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 4, "GeogPointMake3dzLogicalFunction requires 4 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view GeogPointMake3dzLogicalFunction::getType() const { return NAME; } +std::string_view GeogPointMake3dzLogicalFunction::getType() const +{ + return NAME; +} bool GeogPointMake3dzLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string GeogPointMake3dzLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction GeogPointMake3dzLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(4); - for (const auto& p : parameters) - c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "srid must be UINT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "x must be FLOAT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "y must be FLOAT64"); - INVARIANT(c[3].getDataType().isType(DataType::Type::FLOAT64), "z must be FLOAT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction GeogPointMake3dzLogicalFunction::serialize() const @@ -85,7 +109,9 @@ SerializableFunction GeogPointMake3dzLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -95,11 +121,11 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeo PRECONDITION(arguments.children.size() == 4, "GeogPointMake3dzLogicalFunction requires 4 children but got {}", arguments.children.size()); - return GeogPointMake3dzLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2]), - std::move(arguments.children[3])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + return GeogPointMake3dzLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/GeogToGeomLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeogToGeomLogicalFunction.cpp index a028f92f75..cebb7bb517 100644 --- a/nes-logical-operators/src/Functions/Meos/GeogToGeomLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/GeogToGeomLogicalFunction.cpp @@ -33,44 +33,68 @@ GeogToGeomLogicalFunction::GeogToGeomLogicalFunction(LogicalFunction wkt) parameters.push_back(std::move(wkt)); } -DataType GeogToGeomLogicalFunction::getDataType() const { return dataType; } +DataType GeogToGeomLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction GeogToGeomLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector GeogToGeomLogicalFunction::getChildren() const { return parameters; } +std::vector GeogToGeomLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction GeogToGeomLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 1, - "GeogToGeomLogicalFunction requires 1 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 1, "GeogToGeomLogicalFunction requires 1 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view GeogToGeomLogicalFunction::getType() const { return NAME; } +std::string_view GeogToGeomLogicalFunction::getType() const +{ + return NAME; +} bool GeogToGeomLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string GeogToGeomLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction GeogToGeomLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(1); - for (const auto& p : parameters) - c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "wkt must be VARSIZED"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction GeogToGeomLogicalFunction::serialize() const @@ -79,7 +103,9 @@ SerializableFunction GeogToGeomLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -89,8 +115,8 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeo PRECONDITION(arguments.children.size() == 1, "GeogToGeomLogicalFunction requires 1 children but got {}", arguments.children.size()); - return GeogToGeomLogicalFunction( - std::move(arguments.children[0])); + auto arg0 = std::move(arguments.children[0]); + return GeogToGeomLogicalFunction(std::move(arg0)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/GeomAzimuthLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeomAzimuthLogicalFunction.cpp index b3d52556c5..ed3e3e00d7 100644 --- a/nes-logical-operators/src/Functions/Meos/GeomAzimuthLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/GeomAzimuthLogicalFunction.cpp @@ -26,55 +26,74 @@ namespace NES { -GeomAzimuthLogicalFunction::GeomAzimuthLogicalFunction(LogicalFunction wkt1, LogicalFunction wkt2) +GeomAzimuthLogicalFunction::GeomAzimuthLogicalFunction(LogicalFunction wkt) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { - parameters.reserve(2); - parameters.push_back(std::move(wkt1)); - parameters.push_back(std::move(wkt2)); + parameters.reserve(1); + parameters.push_back(std::move(wkt)); } -DataType GeomAzimuthLogicalFunction::getDataType() const { return dataType; } +DataType GeomAzimuthLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction GeomAzimuthLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector GeomAzimuthLogicalFunction::getChildren() const { return parameters; } +std::vector GeomAzimuthLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction GeomAzimuthLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 2, "GeomAzimuthLogicalFunction requires 2 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 1, "GeomAzimuthLogicalFunction requires 1 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view GeomAzimuthLogicalFunction::getType() const { return NAME; } +std::string_view GeomAzimuthLogicalFunction::getType() const +{ + return NAME; +} bool GeomAzimuthLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string GeomAzimuthLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({}, {})", NAME, - parameters[0].explain(verbosity), - parameters[1].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction GeomAzimuthLogicalFunction::withInferredDataType(const Schema& schema) const { std::vector newChildren; - newChildren.reserve(2); + newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); - INVARIANT(newChildren[0].getDataType().isType(DataType::Type::VARSIZED), - "wkt1 must be VARSIZED, but was: {}", newChildren[0].getDataType()); - INVARIANT(newChildren[1].getDataType().isType(DataType::Type::VARSIZED), - "wkt2 must be VARSIZED, but was: {}", newChildren[1].getDataType()); + } return withChildren(newChildren); } @@ -84,18 +103,20 @@ SerializableFunction GeomAzimuthLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeomAzimuthLogicalFunction( LogicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.children.size() == 2, - "GeomAzimuthLogicalFunction requires 2 children but got {}", + PRECONDITION(arguments.children.size() == 1, + "GeomAzimuthLogicalFunction requires 1 children but got {}", arguments.children.size()); - return GeomAzimuthLogicalFunction(std::move(arguments.children[0]), - std::move(arguments.children[1])); + auto arg0 = std::move(arguments.children[0]); + return GeomAzimuthLogicalFunction(std::move(arg0)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/GeomBoundaryLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeomBoundaryLogicalFunction.cpp index 2f901cfdfb..a109b50bb8 100644 --- a/nes-logical-operators/src/Functions/Meos/GeomBoundaryLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/GeomBoundaryLogicalFunction.cpp @@ -33,44 +33,68 @@ GeomBoundaryLogicalFunction::GeomBoundaryLogicalFunction(LogicalFunction wkt) parameters.push_back(std::move(wkt)); } -DataType GeomBoundaryLogicalFunction::getDataType() const { return dataType; } +DataType GeomBoundaryLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction GeomBoundaryLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector GeomBoundaryLogicalFunction::getChildren() const { return parameters; } +std::vector GeomBoundaryLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction GeomBoundaryLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 1, - "GeomBoundaryLogicalFunction requires 1 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 1, "GeomBoundaryLogicalFunction requires 1 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view GeomBoundaryLogicalFunction::getType() const { return NAME; } +std::string_view GeomBoundaryLogicalFunction::getType() const +{ + return NAME; +} bool GeomBoundaryLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string GeomBoundaryLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction GeomBoundaryLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(1); - for (const auto& p : parameters) - c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "wkt must be VARSIZED"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction GeomBoundaryLogicalFunction::serialize() const @@ -79,7 +103,9 @@ SerializableFunction GeomBoundaryLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -89,8 +115,8 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeo PRECONDITION(arguments.children.size() == 1, "GeomBoundaryLogicalFunction requires 1 children but got {}", arguments.children.size()); - return GeomBoundaryLogicalFunction( - std::move(arguments.children[0])); + auto arg0 = std::move(arguments.children[0]); + return GeomBoundaryLogicalFunction(std::move(arg0)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/GeomCentroidLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeomCentroidLogicalFunction.cpp index 1627911bc7..ca20ba17b6 100644 --- a/nes-logical-operators/src/Functions/Meos/GeomCentroidLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/GeomCentroidLogicalFunction.cpp @@ -33,44 +33,68 @@ GeomCentroidLogicalFunction::GeomCentroidLogicalFunction(LogicalFunction wkt) parameters.push_back(std::move(wkt)); } -DataType GeomCentroidLogicalFunction::getDataType() const { return dataType; } +DataType GeomCentroidLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction GeomCentroidLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector GeomCentroidLogicalFunction::getChildren() const { return parameters; } +std::vector GeomCentroidLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction GeomCentroidLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 1, - "GeomCentroidLogicalFunction requires 1 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 1, "GeomCentroidLogicalFunction requires 1 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view GeomCentroidLogicalFunction::getType() const { return NAME; } +std::string_view GeomCentroidLogicalFunction::getType() const +{ + return NAME; +} bool GeomCentroidLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string GeomCentroidLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction GeomCentroidLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(1); - for (const auto& p : parameters) - c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "wkt must be VARSIZED"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction GeomCentroidLogicalFunction::serialize() const @@ -79,7 +103,9 @@ SerializableFunction GeomCentroidLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -89,8 +115,8 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeo PRECONDITION(arguments.children.size() == 1, "GeomCentroidLogicalFunction requires 1 children but got {}", arguments.children.size()); - return GeomCentroidLogicalFunction( - std::move(arguments.children[0])); + auto arg0 = std::move(arguments.children[0]); + return GeomCentroidLogicalFunction(std::move(arg0)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/GeomContainsLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeomContainsLogicalFunction.cpp index e4bac6c415..003bd0275c 100644 --- a/nes-logical-operators/src/Functions/Meos/GeomContainsLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/GeomContainsLogicalFunction.cpp @@ -26,43 +26,63 @@ namespace NES { -GeomContainsLogicalFunction::GeomContainsLogicalFunction(LogicalFunction wkt1, LogicalFunction wkt2) +GeomContainsLogicalFunction::GeomContainsLogicalFunction(LogicalFunction wkt, + LogicalFunction arg0) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(2); - parameters.push_back(std::move(wkt1)); - parameters.push_back(std::move(wkt2)); + parameters.push_back(std::move(wkt)); + parameters.push_back(std::move(arg0)); } -DataType GeomContainsLogicalFunction::getDataType() const { return dataType; } +DataType GeomContainsLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction GeomContainsLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector GeomContainsLogicalFunction::getChildren() const { return parameters; } +std::vector GeomContainsLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction GeomContainsLogicalFunction::withChildren(const std::vector& children) const { PRECONDITION(children.size() == 2, "GeomContainsLogicalFunction requires 2 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view GeomContainsLogicalFunction::getType() const { return NAME; } +std::string_view GeomContainsLogicalFunction::getType() const +{ + return NAME; +} bool GeomContainsLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string GeomContainsLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -73,7 +93,9 @@ LogicalFunction GeomContainsLogicalFunction::withInferredDataType(const Schema& std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -83,7 +105,9 @@ SerializableFunction GeomContainsLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -93,9 +117,9 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeo PRECONDITION(arguments.children.size() == 2, "GeomContainsLogicalFunction requires 2 children but got {}", arguments.children.size()); - return GeomContainsLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + return GeomContainsLogicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/GeomConvexHullLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeomConvexHullLogicalFunction.cpp index 6a011ddf3a..cb203382d0 100644 --- a/nes-logical-operators/src/Functions/Meos/GeomConvexHullLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/GeomConvexHullLogicalFunction.cpp @@ -33,44 +33,68 @@ GeomConvexHullLogicalFunction::GeomConvexHullLogicalFunction(LogicalFunction wkt parameters.push_back(std::move(wkt)); } -DataType GeomConvexHullLogicalFunction::getDataType() const { return dataType; } +DataType GeomConvexHullLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction GeomConvexHullLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector GeomConvexHullLogicalFunction::getChildren() const { return parameters; } +std::vector GeomConvexHullLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction GeomConvexHullLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 1, - "GeomConvexHullLogicalFunction requires 1 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 1, "GeomConvexHullLogicalFunction requires 1 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view GeomConvexHullLogicalFunction::getType() const { return NAME; } +std::string_view GeomConvexHullLogicalFunction::getType() const +{ + return NAME; +} bool GeomConvexHullLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string GeomConvexHullLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction GeomConvexHullLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(1); - for (const auto& p : parameters) - c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "wkt must be VARSIZED"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction GeomConvexHullLogicalFunction::serialize() const @@ -79,7 +103,9 @@ SerializableFunction GeomConvexHullLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -89,8 +115,8 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeo PRECONDITION(arguments.children.size() == 1, "GeomConvexHullLogicalFunction requires 1 children but got {}", arguments.children.size()); - return GeomConvexHullLogicalFunction( - std::move(arguments.children[0])); + auto arg0 = std::move(arguments.children[0]); + return GeomConvexHullLogicalFunction(std::move(arg0)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/GeomCoversLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeomCoversLogicalFunction.cpp index f1f9b565b7..adcbf8371d 100644 --- a/nes-logical-operators/src/Functions/Meos/GeomCoversLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/GeomCoversLogicalFunction.cpp @@ -26,43 +26,63 @@ namespace NES { -GeomCoversLogicalFunction::GeomCoversLogicalFunction(LogicalFunction wkt1, LogicalFunction wkt2) +GeomCoversLogicalFunction::GeomCoversLogicalFunction(LogicalFunction wkt, + LogicalFunction arg0) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(2); - parameters.push_back(std::move(wkt1)); - parameters.push_back(std::move(wkt2)); + parameters.push_back(std::move(wkt)); + parameters.push_back(std::move(arg0)); } -DataType GeomCoversLogicalFunction::getDataType() const { return dataType; } +DataType GeomCoversLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction GeomCoversLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector GeomCoversLogicalFunction::getChildren() const { return parameters; } +std::vector GeomCoversLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction GeomCoversLogicalFunction::withChildren(const std::vector& children) const { PRECONDITION(children.size() == 2, "GeomCoversLogicalFunction requires 2 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view GeomCoversLogicalFunction::getType() const { return NAME; } +std::string_view GeomCoversLogicalFunction::getType() const +{ + return NAME; +} bool GeomCoversLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string GeomCoversLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -73,7 +93,9 @@ LogicalFunction GeomCoversLogicalFunction::withInferredDataType(const Schema& sc std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -83,7 +105,9 @@ SerializableFunction GeomCoversLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -93,9 +117,9 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeo PRECONDITION(arguments.children.size() == 2, "GeomCoversLogicalFunction requires 2 children but got {}", arguments.children.size()); - return GeomCoversLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + return GeomCoversLogicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/GeomDifference2dLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeomDifference2dLogicalFunction.cpp index 8637060821..2a2582f919 100644 --- a/nes-logical-operators/src/Functions/Meos/GeomDifference2dLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/GeomDifference2dLogicalFunction.cpp @@ -26,53 +26,77 @@ namespace NES { -GeomDifference2dLogicalFunction::GeomDifference2dLogicalFunction(LogicalFunction wkt1, LogicalFunction wkt2) +GeomDifference2dLogicalFunction::GeomDifference2dLogicalFunction(LogicalFunction wkt, + LogicalFunction arg0) : dataType(DataTypeProvider::provideDataType(DataType::Type::VARSIZED)) { parameters.reserve(2); - parameters.push_back(std::move(wkt1)); - parameters.push_back(std::move(wkt2)); + parameters.push_back(std::move(wkt)); + parameters.push_back(std::move(arg0)); } -DataType GeomDifference2dLogicalFunction::getDataType() const { return dataType; } +DataType GeomDifference2dLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction GeomDifference2dLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector GeomDifference2dLogicalFunction::getChildren() const { return parameters; } +std::vector GeomDifference2dLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction GeomDifference2dLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 2, - "GeomDifference2dLogicalFunction requires 2 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 2, "GeomDifference2dLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view GeomDifference2dLogicalFunction::getType() const { return NAME; } +std::string_view GeomDifference2dLogicalFunction::getType() const +{ + return NAME; +} bool GeomDifference2dLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string GeomDifference2dLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction GeomDifference2dLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(2); - for (const auto& p : parameters) - c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "wkt1 must be VARSIZED"); - INVARIANT(c[1].getDataType().isType(DataType::Type::VARSIZED), "wkt2 must be VARSIZED"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction GeomDifference2dLogicalFunction::serialize() const @@ -81,7 +105,9 @@ SerializableFunction GeomDifference2dLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -91,9 +117,9 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeo PRECONDITION(arguments.children.size() == 2, "GeomDifference2dLogicalFunction requires 2 children but got {}", arguments.children.size()); - return GeomDifference2dLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + return GeomDifference2dLogicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/GeomDisjoint2dLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeomDisjoint2dLogicalFunction.cpp index 9354460dd0..b9d684edc5 100644 --- a/nes-logical-operators/src/Functions/Meos/GeomDisjoint2dLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/GeomDisjoint2dLogicalFunction.cpp @@ -26,43 +26,63 @@ namespace NES { -GeomDisjoint2dLogicalFunction::GeomDisjoint2dLogicalFunction(LogicalFunction wkt1, LogicalFunction wkt2) +GeomDisjoint2dLogicalFunction::GeomDisjoint2dLogicalFunction(LogicalFunction wkt, + LogicalFunction arg0) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(2); - parameters.push_back(std::move(wkt1)); - parameters.push_back(std::move(wkt2)); + parameters.push_back(std::move(wkt)); + parameters.push_back(std::move(arg0)); } -DataType GeomDisjoint2dLogicalFunction::getDataType() const { return dataType; } +DataType GeomDisjoint2dLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction GeomDisjoint2dLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector GeomDisjoint2dLogicalFunction::getChildren() const { return parameters; } +std::vector GeomDisjoint2dLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction GeomDisjoint2dLogicalFunction::withChildren(const std::vector& children) const { PRECONDITION(children.size() == 2, "GeomDisjoint2dLogicalFunction requires 2 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view GeomDisjoint2dLogicalFunction::getType() const { return NAME; } +std::string_view GeomDisjoint2dLogicalFunction::getType() const +{ + return NAME; +} bool GeomDisjoint2dLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string GeomDisjoint2dLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -73,7 +93,9 @@ LogicalFunction GeomDisjoint2dLogicalFunction::withInferredDataType(const Schema std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -83,7 +105,9 @@ SerializableFunction GeomDisjoint2dLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -93,9 +117,9 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeo PRECONDITION(arguments.children.size() == 2, "GeomDisjoint2dLogicalFunction requires 2 children but got {}", arguments.children.size()); - return GeomDisjoint2dLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + return GeomDisjoint2dLogicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/GeomDistance2dLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeomDistance2dLogicalFunction.cpp index fc109801a4..8f89e4d993 100644 --- a/nes-logical-operators/src/Functions/Meos/GeomDistance2dLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/GeomDistance2dLogicalFunction.cpp @@ -26,43 +26,63 @@ namespace NES { -GeomDistance2dLogicalFunction::GeomDistance2dLogicalFunction(LogicalFunction wkt1, LogicalFunction wkt2) +GeomDistance2dLogicalFunction::GeomDistance2dLogicalFunction(LogicalFunction wkt, + LogicalFunction arg0) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(2); - parameters.push_back(std::move(wkt1)); - parameters.push_back(std::move(wkt2)); + parameters.push_back(std::move(wkt)); + parameters.push_back(std::move(arg0)); } -DataType GeomDistance2dLogicalFunction::getDataType() const { return dataType; } +DataType GeomDistance2dLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction GeomDistance2dLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector GeomDistance2dLogicalFunction::getChildren() const { return parameters; } +std::vector GeomDistance2dLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction GeomDistance2dLogicalFunction::withChildren(const std::vector& children) const { PRECONDITION(children.size() == 2, "GeomDistance2dLogicalFunction requires 2 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view GeomDistance2dLogicalFunction::getType() const { return NAME; } +std::string_view GeomDistance2dLogicalFunction::getType() const +{ + return NAME; +} bool GeomDistance2dLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string GeomDistance2dLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -73,7 +93,9 @@ LogicalFunction GeomDistance2dLogicalFunction::withInferredDataType(const Schema std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -83,7 +105,9 @@ SerializableFunction GeomDistance2dLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -93,9 +117,9 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeo PRECONDITION(arguments.children.size() == 2, "GeomDistance2dLogicalFunction requires 2 children but got {}", arguments.children.size()); - return GeomDistance2dLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + return GeomDistance2dLogicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/GeomDistance3dLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeomDistance3dLogicalFunction.cpp index 4aef02ec00..90643c3853 100644 --- a/nes-logical-operators/src/Functions/Meos/GeomDistance3dLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/GeomDistance3dLogicalFunction.cpp @@ -26,43 +26,63 @@ namespace NES { -GeomDistance3dLogicalFunction::GeomDistance3dLogicalFunction(LogicalFunction wkt1, LogicalFunction wkt2) +GeomDistance3dLogicalFunction::GeomDistance3dLogicalFunction(LogicalFunction wkt, + LogicalFunction arg0) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(2); - parameters.push_back(std::move(wkt1)); - parameters.push_back(std::move(wkt2)); + parameters.push_back(std::move(wkt)); + parameters.push_back(std::move(arg0)); } -DataType GeomDistance3dLogicalFunction::getDataType() const { return dataType; } +DataType GeomDistance3dLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction GeomDistance3dLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector GeomDistance3dLogicalFunction::getChildren() const { return parameters; } +std::vector GeomDistance3dLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction GeomDistance3dLogicalFunction::withChildren(const std::vector& children) const { PRECONDITION(children.size() == 2, "GeomDistance3dLogicalFunction requires 2 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view GeomDistance3dLogicalFunction::getType() const { return NAME; } +std::string_view GeomDistance3dLogicalFunction::getType() const +{ + return NAME; +} bool GeomDistance3dLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string GeomDistance3dLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -73,7 +93,9 @@ LogicalFunction GeomDistance3dLogicalFunction::withInferredDataType(const Schema std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -83,7 +105,9 @@ SerializableFunction GeomDistance3dLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -93,9 +117,9 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeo PRECONDITION(arguments.children.size() == 2, "GeomDistance3dLogicalFunction requires 2 children but got {}", arguments.children.size()); - return GeomDistance3dLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + return GeomDistance3dLogicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/GeomDwithin2dLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeomDwithin2dLogicalFunction.cpp index e91b1f61bb..516a3b6503 100644 --- a/nes-logical-operators/src/Functions/Meos/GeomDwithin2dLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/GeomDwithin2dLogicalFunction.cpp @@ -26,44 +26,65 @@ namespace NES { -GeomDwithin2dLogicalFunction::GeomDwithin2dLogicalFunction(LogicalFunction wkt1, LogicalFunction wkt2, LogicalFunction dist) +GeomDwithin2dLogicalFunction::GeomDwithin2dLogicalFunction(LogicalFunction wkt, + LogicalFunction arg0, + LogicalFunction arg1) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(3); - parameters.push_back(std::move(wkt1)); - parameters.push_back(std::move(wkt2)); - parameters.push_back(std::move(dist)); + parameters.push_back(std::move(wkt)); + parameters.push_back(std::move(arg0)); + parameters.push_back(std::move(arg1)); } -DataType GeomDwithin2dLogicalFunction::getDataType() const { return dataType; } +DataType GeomDwithin2dLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction GeomDwithin2dLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector GeomDwithin2dLogicalFunction::getChildren() const { return parameters; } +std::vector GeomDwithin2dLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction GeomDwithin2dLogicalFunction::withChildren(const std::vector& children) const { PRECONDITION(children.size() == 3, "GeomDwithin2dLogicalFunction requires 3 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view GeomDwithin2dLogicalFunction::getType() const { return NAME; } +std::string_view GeomDwithin2dLogicalFunction::getType() const +{ + return NAME; +} bool GeomDwithin2dLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string GeomDwithin2dLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -74,7 +95,9 @@ LogicalFunction GeomDwithin2dLogicalFunction::withInferredDataType(const Schema& std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -84,7 +107,9 @@ SerializableFunction GeomDwithin2dLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -94,10 +119,10 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeo PRECONDITION(arguments.children.size() == 3, "GeomDwithin2dLogicalFunction requires 3 children but got {}", arguments.children.size()); - return GeomDwithin2dLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return GeomDwithin2dLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/GeomDwithin3dLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeomDwithin3dLogicalFunction.cpp index 8907cea610..0f5274f499 100644 --- a/nes-logical-operators/src/Functions/Meos/GeomDwithin3dLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/GeomDwithin3dLogicalFunction.cpp @@ -26,44 +26,65 @@ namespace NES { -GeomDwithin3dLogicalFunction::GeomDwithin3dLogicalFunction(LogicalFunction wkt1, LogicalFunction wkt2, LogicalFunction dist) +GeomDwithin3dLogicalFunction::GeomDwithin3dLogicalFunction(LogicalFunction wkt, + LogicalFunction arg0, + LogicalFunction arg1) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(3); - parameters.push_back(std::move(wkt1)); - parameters.push_back(std::move(wkt2)); - parameters.push_back(std::move(dist)); + parameters.push_back(std::move(wkt)); + parameters.push_back(std::move(arg0)); + parameters.push_back(std::move(arg1)); } -DataType GeomDwithin3dLogicalFunction::getDataType() const { return dataType; } +DataType GeomDwithin3dLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction GeomDwithin3dLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector GeomDwithin3dLogicalFunction::getChildren() const { return parameters; } +std::vector GeomDwithin3dLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction GeomDwithin3dLogicalFunction::withChildren(const std::vector& children) const { PRECONDITION(children.size() == 3, "GeomDwithin3dLogicalFunction requires 3 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view GeomDwithin3dLogicalFunction::getType() const { return NAME; } +std::string_view GeomDwithin3dLogicalFunction::getType() const +{ + return NAME; +} bool GeomDwithin3dLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string GeomDwithin3dLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -74,7 +95,9 @@ LogicalFunction GeomDwithin3dLogicalFunction::withInferredDataType(const Schema& std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -84,7 +107,9 @@ SerializableFunction GeomDwithin3dLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -94,10 +119,10 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeo PRECONDITION(arguments.children.size() == 3, "GeomDwithin3dLogicalFunction requires 3 children but got {}", arguments.children.size()); - return GeomDwithin3dLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return GeomDwithin3dLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/GeomDwithinLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeomDwithinLogicalFunction.cpp index f803655d83..34f779ea5c 100644 --- a/nes-logical-operators/src/Functions/Meos/GeomDwithinLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/GeomDwithinLogicalFunction.cpp @@ -26,57 +26,79 @@ namespace NES { -GeomDwithinLogicalFunction::GeomDwithinLogicalFunction(LogicalFunction wkt1, LogicalFunction wkt2, - LogicalFunction tolerance) +GeomDwithinLogicalFunction::GeomDwithinLogicalFunction(LogicalFunction wkt, + LogicalFunction arg0, + LogicalFunction arg1) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(3); - parameters.push_back(std::move(wkt1)); - parameters.push_back(std::move(wkt2)); - parameters.push_back(std::move(tolerance)); + parameters.push_back(std::move(wkt)); + parameters.push_back(std::move(arg0)); + parameters.push_back(std::move(arg1)); } -DataType GeomDwithinLogicalFunction::getDataType() const { return dataType; } +DataType GeomDwithinLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction GeomDwithinLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector GeomDwithinLogicalFunction::getChildren() const { return parameters; } +std::vector GeomDwithinLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction GeomDwithinLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 3, - "GeomDwithinLogicalFunction requires 3 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 3, "GeomDwithinLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view GeomDwithinLogicalFunction::getType() const { return NAME; } +std::string_view GeomDwithinLogicalFunction::getType() const +{ + return NAME; +} bool GeomDwithinLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string GeomDwithinLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction GeomDwithinLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(3); - c.emplace_back(parameters[0].withInferredDataType(schema)); - c.emplace_back(parameters[1].withInferredDataType(schema)); - c.emplace_back(parameters[2].withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "wkt1 must be VARSIZED"); - INVARIANT(c[1].getDataType().isType(DataType::Type::VARSIZED), "wkt2 must be VARSIZED"); - INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "tolerance must be FLOAT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction GeomDwithinLogicalFunction::serialize() const @@ -85,7 +107,9 @@ SerializableFunction GeomDwithinLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -95,9 +119,10 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeo PRECONDITION(arguments.children.size() == 3, "GeomDwithinLogicalFunction requires 3 children but got {}", arguments.children.size()); - return GeomDwithinLogicalFunction(std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return GeomDwithinLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/GeomIntersection2dCollLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeomIntersection2dCollLogicalFunction.cpp index 89ec07c54c..d177ccd3f1 100644 --- a/nes-logical-operators/src/Functions/Meos/GeomIntersection2dCollLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/GeomIntersection2dCollLogicalFunction.cpp @@ -26,53 +26,77 @@ namespace NES { -GeomIntersection2dCollLogicalFunction::GeomIntersection2dCollLogicalFunction(LogicalFunction wkt1, LogicalFunction wkt2) +GeomIntersection2dCollLogicalFunction::GeomIntersection2dCollLogicalFunction(LogicalFunction wkt, + LogicalFunction arg0) : dataType(DataTypeProvider::provideDataType(DataType::Type::VARSIZED)) { parameters.reserve(2); - parameters.push_back(std::move(wkt1)); - parameters.push_back(std::move(wkt2)); + parameters.push_back(std::move(wkt)); + parameters.push_back(std::move(arg0)); } -DataType GeomIntersection2dCollLogicalFunction::getDataType() const { return dataType; } +DataType GeomIntersection2dCollLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction GeomIntersection2dCollLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector GeomIntersection2dCollLogicalFunction::getChildren() const { return parameters; } +std::vector GeomIntersection2dCollLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction GeomIntersection2dCollLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 2, - "GeomIntersection2dCollLogicalFunction requires 2 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 2, "GeomIntersection2dCollLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view GeomIntersection2dCollLogicalFunction::getType() const { return NAME; } +std::string_view GeomIntersection2dCollLogicalFunction::getType() const +{ + return NAME; +} bool GeomIntersection2dCollLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string GeomIntersection2dCollLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction GeomIntersection2dCollLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(2); - for (const auto& p : parameters) - c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "wkt1 must be VARSIZED"); - INVARIANT(c[1].getDataType().isType(DataType::Type::VARSIZED), "wkt2 must be VARSIZED"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction GeomIntersection2dCollLogicalFunction::serialize() const @@ -81,7 +105,9 @@ SerializableFunction GeomIntersection2dCollLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -91,9 +117,9 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeo PRECONDITION(arguments.children.size() == 2, "GeomIntersection2dCollLogicalFunction requires 2 children but got {}", arguments.children.size()); - return GeomIntersection2dCollLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + return GeomIntersection2dCollLogicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/GeomIntersection2dLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeomIntersection2dLogicalFunction.cpp index 905e630f09..87f023a6c3 100644 --- a/nes-logical-operators/src/Functions/Meos/GeomIntersection2dLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/GeomIntersection2dLogicalFunction.cpp @@ -26,53 +26,77 @@ namespace NES { -GeomIntersection2dLogicalFunction::GeomIntersection2dLogicalFunction(LogicalFunction wkt1, LogicalFunction wkt2) +GeomIntersection2dLogicalFunction::GeomIntersection2dLogicalFunction(LogicalFunction wkt, + LogicalFunction arg0) : dataType(DataTypeProvider::provideDataType(DataType::Type::VARSIZED)) { parameters.reserve(2); - parameters.push_back(std::move(wkt1)); - parameters.push_back(std::move(wkt2)); + parameters.push_back(std::move(wkt)); + parameters.push_back(std::move(arg0)); } -DataType GeomIntersection2dLogicalFunction::getDataType() const { return dataType; } +DataType GeomIntersection2dLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction GeomIntersection2dLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector GeomIntersection2dLogicalFunction::getChildren() const { return parameters; } +std::vector GeomIntersection2dLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction GeomIntersection2dLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 2, - "GeomIntersection2dLogicalFunction requires 2 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 2, "GeomIntersection2dLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view GeomIntersection2dLogicalFunction::getType() const { return NAME; } +std::string_view GeomIntersection2dLogicalFunction::getType() const +{ + return NAME; +} bool GeomIntersection2dLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string GeomIntersection2dLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction GeomIntersection2dLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(2); - for (const auto& p : parameters) - c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "wkt1 must be VARSIZED"); - INVARIANT(c[1].getDataType().isType(DataType::Type::VARSIZED), "wkt2 must be VARSIZED"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction GeomIntersection2dLogicalFunction::serialize() const @@ -81,7 +105,9 @@ SerializableFunction GeomIntersection2dLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -91,9 +117,9 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeo PRECONDITION(arguments.children.size() == 2, "GeomIntersection2dLogicalFunction requires 2 children but got {}", arguments.children.size()); - return GeomIntersection2dLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + return GeomIntersection2dLogicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/GeomIntersects2dLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeomIntersects2dLogicalFunction.cpp index ddef3d58ed..3f211ca58c 100644 --- a/nes-logical-operators/src/Functions/Meos/GeomIntersects2dLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/GeomIntersects2dLogicalFunction.cpp @@ -26,43 +26,63 @@ namespace NES { -GeomIntersects2dLogicalFunction::GeomIntersects2dLogicalFunction(LogicalFunction wkt1, LogicalFunction wkt2) +GeomIntersects2dLogicalFunction::GeomIntersects2dLogicalFunction(LogicalFunction wkt, + LogicalFunction arg0) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(2); - parameters.push_back(std::move(wkt1)); - parameters.push_back(std::move(wkt2)); + parameters.push_back(std::move(wkt)); + parameters.push_back(std::move(arg0)); } -DataType GeomIntersects2dLogicalFunction::getDataType() const { return dataType; } +DataType GeomIntersects2dLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction GeomIntersects2dLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector GeomIntersects2dLogicalFunction::getChildren() const { return parameters; } +std::vector GeomIntersects2dLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction GeomIntersects2dLogicalFunction::withChildren(const std::vector& children) const { PRECONDITION(children.size() == 2, "GeomIntersects2dLogicalFunction requires 2 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view GeomIntersects2dLogicalFunction::getType() const { return NAME; } +std::string_view GeomIntersects2dLogicalFunction::getType() const +{ + return NAME; +} bool GeomIntersects2dLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string GeomIntersects2dLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -73,7 +93,9 @@ LogicalFunction GeomIntersects2dLogicalFunction::withInferredDataType(const Sche std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -83,7 +105,9 @@ SerializableFunction GeomIntersects2dLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -93,9 +117,9 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeo PRECONDITION(arguments.children.size() == 2, "GeomIntersects2dLogicalFunction requires 2 children but got {}", arguments.children.size()); - return GeomIntersects2dLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + return GeomIntersects2dLogicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/GeomIntersects3dLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeomIntersects3dLogicalFunction.cpp index bc0ae39b53..e9ea6d16ae 100644 --- a/nes-logical-operators/src/Functions/Meos/GeomIntersects3dLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/GeomIntersects3dLogicalFunction.cpp @@ -26,43 +26,63 @@ namespace NES { -GeomIntersects3dLogicalFunction::GeomIntersects3dLogicalFunction(LogicalFunction wkt1, LogicalFunction wkt2) +GeomIntersects3dLogicalFunction::GeomIntersects3dLogicalFunction(LogicalFunction wkt, + LogicalFunction arg0) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(2); - parameters.push_back(std::move(wkt1)); - parameters.push_back(std::move(wkt2)); + parameters.push_back(std::move(wkt)); + parameters.push_back(std::move(arg0)); } -DataType GeomIntersects3dLogicalFunction::getDataType() const { return dataType; } +DataType GeomIntersects3dLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction GeomIntersects3dLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector GeomIntersects3dLogicalFunction::getChildren() const { return parameters; } +std::vector GeomIntersects3dLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction GeomIntersects3dLogicalFunction::withChildren(const std::vector& children) const { PRECONDITION(children.size() == 2, "GeomIntersects3dLogicalFunction requires 2 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view GeomIntersects3dLogicalFunction::getType() const { return NAME; } +std::string_view GeomIntersects3dLogicalFunction::getType() const +{ + return NAME; +} bool GeomIntersects3dLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string GeomIntersects3dLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -73,7 +93,9 @@ LogicalFunction GeomIntersects3dLogicalFunction::withInferredDataType(const Sche std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -83,7 +105,9 @@ SerializableFunction GeomIntersects3dLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -93,9 +117,9 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeo PRECONDITION(arguments.children.size() == 2, "GeomIntersects3dLogicalFunction requires 2 children but got {}", arguments.children.size()); - return GeomIntersects3dLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + return GeomIntersects3dLogicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/GeomIntersectsLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeomIntersectsLogicalFunction.cpp index 52412f137a..905f5a0c0f 100644 --- a/nes-logical-operators/src/Functions/Meos/GeomIntersectsLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/GeomIntersectsLogicalFunction.cpp @@ -26,53 +26,77 @@ namespace NES { -GeomIntersectsLogicalFunction::GeomIntersectsLogicalFunction(LogicalFunction wkt1, LogicalFunction wkt2) +GeomIntersectsLogicalFunction::GeomIntersectsLogicalFunction(LogicalFunction wkt, + LogicalFunction arg0) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(2); - parameters.push_back(std::move(wkt1)); - parameters.push_back(std::move(wkt2)); + parameters.push_back(std::move(wkt)); + parameters.push_back(std::move(arg0)); } -DataType GeomIntersectsLogicalFunction::getDataType() const { return dataType; } +DataType GeomIntersectsLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction GeomIntersectsLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector GeomIntersectsLogicalFunction::getChildren() const { return parameters; } +std::vector GeomIntersectsLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction GeomIntersectsLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 2, - "GeomIntersectsLogicalFunction requires 2 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 2, "GeomIntersectsLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view GeomIntersectsLogicalFunction::getType() const { return NAME; } +std::string_view GeomIntersectsLogicalFunction::getType() const +{ + return NAME; +} bool GeomIntersectsLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string GeomIntersectsLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction GeomIntersectsLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(2); - c.emplace_back(parameters[0].withInferredDataType(schema)); - c.emplace_back(parameters[1].withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "wkt1 must be VARSIZED"); - INVARIANT(c[1].getDataType().isType(DataType::Type::VARSIZED), "wkt2 must be VARSIZED"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction GeomIntersectsLogicalFunction::serialize() const @@ -81,7 +105,9 @@ SerializableFunction GeomIntersectsLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -91,8 +117,9 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeo PRECONDITION(arguments.children.size() == 2, "GeomIntersectsLogicalFunction requires 2 children but got {}", arguments.children.size()); - return GeomIntersectsLogicalFunction(std::move(arguments.children[0]), - std::move(arguments.children[1])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + return GeomIntersectsLogicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/GeomIsEmptyLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeomIsEmptyLogicalFunction.cpp index bb4232bbc5..3d4697f4cf 100644 --- a/nes-logical-operators/src/Functions/Meos/GeomIsEmptyLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/GeomIsEmptyLogicalFunction.cpp @@ -26,49 +26,74 @@ namespace NES { -GeomIsEmptyLogicalFunction::GeomIsEmptyLogicalFunction(LogicalFunction wkt1) +GeomIsEmptyLogicalFunction::GeomIsEmptyLogicalFunction(LogicalFunction wkt) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(1); - parameters.push_back(std::move(wkt1)); + parameters.push_back(std::move(wkt)); } -DataType GeomIsEmptyLogicalFunction::getDataType() const { return dataType; } +DataType GeomIsEmptyLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction GeomIsEmptyLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector GeomIsEmptyLogicalFunction::getChildren() const { return parameters; } +std::vector GeomIsEmptyLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction GeomIsEmptyLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 1, "GeomIsEmptyLogicalFunction requires 1 child, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 1, "GeomIsEmptyLogicalFunction requires 1 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view GeomIsEmptyLogicalFunction::getType() const { return NAME; } +std::string_view GeomIsEmptyLogicalFunction::getType() const +{ + return NAME; +} bool GeomIsEmptyLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string GeomIsEmptyLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction GeomIsEmptyLogicalFunction::withInferredDataType(const Schema& schema) const { std::vector newChildren; - newChildren.reserve(1); - newChildren.emplace_back(parameters[0].withInferredDataType(schema)); - INVARIANT(newChildren[0].getDataType().isType(DataType::Type::VARSIZED), - "wkt1 must be VARSIZED, but was: {}", newChildren[0].getDataType()); + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -78,7 +103,9 @@ SerializableFunction GeomIsEmptyLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -86,9 +113,10 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeo LogicalFunctionRegistryArguments arguments) { PRECONDITION(arguments.children.size() == 1, - "GeomIsEmptyLogicalFunction requires 1 child but got {}", + "GeomIsEmptyLogicalFunction requires 1 children but got {}", arguments.children.size()); - return GeomIsEmptyLogicalFunction(std::move(arguments.children[0])); + auto arg0 = std::move(arguments.children[0]); + return GeomIsEmptyLogicalFunction(std::move(arg0)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/GeomLengthLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeomLengthLogicalFunction.cpp index c86f9b001b..17fa8e548a 100644 --- a/nes-logical-operators/src/Functions/Meos/GeomLengthLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/GeomLengthLogicalFunction.cpp @@ -26,49 +26,74 @@ namespace NES { -GeomLengthLogicalFunction::GeomLengthLogicalFunction(LogicalFunction wkt1) +GeomLengthLogicalFunction::GeomLengthLogicalFunction(LogicalFunction wkt) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(1); - parameters.push_back(std::move(wkt1)); + parameters.push_back(std::move(wkt)); } -DataType GeomLengthLogicalFunction::getDataType() const { return dataType; } +DataType GeomLengthLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction GeomLengthLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector GeomLengthLogicalFunction::getChildren() const { return parameters; } +std::vector GeomLengthLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction GeomLengthLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 1, "GeomLengthLogicalFunction requires 1 child, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 1, "GeomLengthLogicalFunction requires 1 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view GeomLengthLogicalFunction::getType() const { return NAME; } +std::string_view GeomLengthLogicalFunction::getType() const +{ + return NAME; +} bool GeomLengthLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string GeomLengthLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction GeomLengthLogicalFunction::withInferredDataType(const Schema& schema) const { std::vector newChildren; - newChildren.reserve(1); - newChildren.emplace_back(parameters[0].withInferredDataType(schema)); - INVARIANT(newChildren[0].getDataType().isType(DataType::Type::VARSIZED), - "wkt1 must be VARSIZED, but was: {}", newChildren[0].getDataType()); + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -78,7 +103,9 @@ SerializableFunction GeomLengthLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -86,9 +113,10 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeo LogicalFunctionRegistryArguments arguments) { PRECONDITION(arguments.children.size() == 1, - "GeomLengthLogicalFunction requires 1 child but got {}", + "GeomLengthLogicalFunction requires 1 children but got {}", arguments.children.size()); - return GeomLengthLogicalFunction(std::move(arguments.children[0])); + auto arg0 = std::move(arguments.children[0]); + return GeomLengthLogicalFunction(std::move(arg0)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/GeomPerimeterLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeomPerimeterLogicalFunction.cpp index 1b5b36c4cc..3f9368ec10 100644 --- a/nes-logical-operators/src/Functions/Meos/GeomPerimeterLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/GeomPerimeterLogicalFunction.cpp @@ -26,49 +26,74 @@ namespace NES { -GeomPerimeterLogicalFunction::GeomPerimeterLogicalFunction(LogicalFunction wkt1) +GeomPerimeterLogicalFunction::GeomPerimeterLogicalFunction(LogicalFunction wkt) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(1); - parameters.push_back(std::move(wkt1)); + parameters.push_back(std::move(wkt)); } -DataType GeomPerimeterLogicalFunction::getDataType() const { return dataType; } +DataType GeomPerimeterLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction GeomPerimeterLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector GeomPerimeterLogicalFunction::getChildren() const { return parameters; } +std::vector GeomPerimeterLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction GeomPerimeterLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 1, "GeomPerimeterLogicalFunction requires 1 child, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 1, "GeomPerimeterLogicalFunction requires 1 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view GeomPerimeterLogicalFunction::getType() const { return NAME; } +std::string_view GeomPerimeterLogicalFunction::getType() const +{ + return NAME; +} bool GeomPerimeterLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string GeomPerimeterLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction GeomPerimeterLogicalFunction::withInferredDataType(const Schema& schema) const { std::vector newChildren; - newChildren.reserve(1); - newChildren.emplace_back(parameters[0].withInferredDataType(schema)); - INVARIANT(newChildren[0].getDataType().isType(DataType::Type::VARSIZED), - "wkt1 must be VARSIZED, but was: {}", newChildren[0].getDataType()); + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -78,7 +103,9 @@ SerializableFunction GeomPerimeterLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -86,9 +113,10 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeo LogicalFunctionRegistryArguments arguments) { PRECONDITION(arguments.children.size() == 1, - "GeomPerimeterLogicalFunction requires 1 child but got {}", + "GeomPerimeterLogicalFunction requires 1 children but got {}", arguments.children.size()); - return GeomPerimeterLogicalFunction(std::move(arguments.children[0])); + auto arg0 = std::move(arguments.children[0]); + return GeomPerimeterLogicalFunction(std::move(arg0)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/GeomPointMake2dLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeomPointMake2dLogicalFunction.cpp index 57b066a14f..d39549009d 100644 --- a/nes-logical-operators/src/Functions/Meos/GeomPointMake2dLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/GeomPointMake2dLogicalFunction.cpp @@ -26,7 +26,9 @@ namespace NES { -GeomPointMake2dLogicalFunction::GeomPointMake2dLogicalFunction(LogicalFunction srid, LogicalFunction x, LogicalFunction y) +GeomPointMake2dLogicalFunction::GeomPointMake2dLogicalFunction(LogicalFunction srid, + LogicalFunction x, + LogicalFunction y) : dataType(DataTypeProvider::provideDataType(DataType::Type::VARSIZED)) { parameters.reserve(3); @@ -35,46 +37,68 @@ GeomPointMake2dLogicalFunction::GeomPointMake2dLogicalFunction(LogicalFunction s parameters.push_back(std::move(y)); } -DataType GeomPointMake2dLogicalFunction::getDataType() const { return dataType; } +DataType GeomPointMake2dLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction GeomPointMake2dLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector GeomPointMake2dLogicalFunction::getChildren() const { return parameters; } +std::vector GeomPointMake2dLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction GeomPointMake2dLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 3, - "GeomPointMake2dLogicalFunction requires 3 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 3, "GeomPointMake2dLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view GeomPointMake2dLogicalFunction::getType() const { return NAME; } +std::string_view GeomPointMake2dLogicalFunction::getType() const +{ + return NAME; +} bool GeomPointMake2dLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string GeomPointMake2dLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction GeomPointMake2dLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(3); - for (const auto& p : parameters) - c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "srid must be UINT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "x must be FLOAT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "y must be FLOAT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction GeomPointMake2dLogicalFunction::serialize() const @@ -83,7 +107,9 @@ SerializableFunction GeomPointMake2dLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -93,10 +119,10 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeo PRECONDITION(arguments.children.size() == 3, "GeomPointMake2dLogicalFunction requires 3 children but got {}", arguments.children.size()); - return GeomPointMake2dLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return GeomPointMake2dLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/GeomPointMake3dzLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeomPointMake3dzLogicalFunction.cpp index 065192b0a7..5c449ce354 100644 --- a/nes-logical-operators/src/Functions/Meos/GeomPointMake3dzLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/GeomPointMake3dzLogicalFunction.cpp @@ -26,7 +26,10 @@ namespace NES { -GeomPointMake3dzLogicalFunction::GeomPointMake3dzLogicalFunction(LogicalFunction srid, LogicalFunction x, LogicalFunction y, LogicalFunction z) +GeomPointMake3dzLogicalFunction::GeomPointMake3dzLogicalFunction(LogicalFunction srid, + LogicalFunction x, + LogicalFunction y, + LogicalFunction z) : dataType(DataTypeProvider::provideDataType(DataType::Type::VARSIZED)) { parameters.reserve(4); @@ -36,47 +39,68 @@ GeomPointMake3dzLogicalFunction::GeomPointMake3dzLogicalFunction(LogicalFunction parameters.push_back(std::move(z)); } -DataType GeomPointMake3dzLogicalFunction::getDataType() const { return dataType; } +DataType GeomPointMake3dzLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction GeomPointMake3dzLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector GeomPointMake3dzLogicalFunction::getChildren() const { return parameters; } +std::vector GeomPointMake3dzLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction GeomPointMake3dzLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 4, - "GeomPointMake3dzLogicalFunction requires 4 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 4, "GeomPointMake3dzLogicalFunction requires 4 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view GeomPointMake3dzLogicalFunction::getType() const { return NAME; } +std::string_view GeomPointMake3dzLogicalFunction::getType() const +{ + return NAME; +} bool GeomPointMake3dzLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string GeomPointMake3dzLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction GeomPointMake3dzLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(4); - for (const auto& p : parameters) - c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "srid must be UINT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "x must be FLOAT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "y must be FLOAT64"); - INVARIANT(c[3].getDataType().isType(DataType::Type::FLOAT64), "z must be FLOAT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction GeomPointMake3dzLogicalFunction::serialize() const @@ -85,7 +109,9 @@ SerializableFunction GeomPointMake3dzLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -95,11 +121,11 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeo PRECONDITION(arguments.children.size() == 4, "GeomPointMake3dzLogicalFunction requires 4 children but got {}", arguments.children.size()); - return GeomPointMake3dzLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2]), - std::move(arguments.children[3])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + return GeomPointMake3dzLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/GeomShortestline2dLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeomShortestline2dLogicalFunction.cpp index 4bbbba645f..49f1e951ca 100644 --- a/nes-logical-operators/src/Functions/Meos/GeomShortestline2dLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/GeomShortestline2dLogicalFunction.cpp @@ -26,53 +26,77 @@ namespace NES { -GeomShortestline2dLogicalFunction::GeomShortestline2dLogicalFunction(LogicalFunction wkt1, LogicalFunction wkt2) +GeomShortestline2dLogicalFunction::GeomShortestline2dLogicalFunction(LogicalFunction wkt, + LogicalFunction arg0) : dataType(DataTypeProvider::provideDataType(DataType::Type::VARSIZED)) { parameters.reserve(2); - parameters.push_back(std::move(wkt1)); - parameters.push_back(std::move(wkt2)); + parameters.push_back(std::move(wkt)); + parameters.push_back(std::move(arg0)); } -DataType GeomShortestline2dLogicalFunction::getDataType() const { return dataType; } +DataType GeomShortestline2dLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction GeomShortestline2dLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector GeomShortestline2dLogicalFunction::getChildren() const { return parameters; } +std::vector GeomShortestline2dLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction GeomShortestline2dLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 2, - "GeomShortestline2dLogicalFunction requires 2 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 2, "GeomShortestline2dLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view GeomShortestline2dLogicalFunction::getType() const { return NAME; } +std::string_view GeomShortestline2dLogicalFunction::getType() const +{ + return NAME; +} bool GeomShortestline2dLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string GeomShortestline2dLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction GeomShortestline2dLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(2); - for (const auto& p : parameters) - c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "wkt1 must be VARSIZED"); - INVARIANT(c[1].getDataType().isType(DataType::Type::VARSIZED), "wkt2 must be VARSIZED"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction GeomShortestline2dLogicalFunction::serialize() const @@ -81,7 +105,9 @@ SerializableFunction GeomShortestline2dLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -91,9 +117,9 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeo PRECONDITION(arguments.children.size() == 2, "GeomShortestline2dLogicalFunction requires 2 children but got {}", arguments.children.size()); - return GeomShortestline2dLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + return GeomShortestline2dLogicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/GeomShortestline3dLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeomShortestline3dLogicalFunction.cpp index 83d24813e8..ff511fe28f 100644 --- a/nes-logical-operators/src/Functions/Meos/GeomShortestline3dLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/GeomShortestline3dLogicalFunction.cpp @@ -26,53 +26,77 @@ namespace NES { -GeomShortestline3dLogicalFunction::GeomShortestline3dLogicalFunction(LogicalFunction wkt1, LogicalFunction wkt2) +GeomShortestline3dLogicalFunction::GeomShortestline3dLogicalFunction(LogicalFunction wkt, + LogicalFunction arg0) : dataType(DataTypeProvider::provideDataType(DataType::Type::VARSIZED)) { parameters.reserve(2); - parameters.push_back(std::move(wkt1)); - parameters.push_back(std::move(wkt2)); + parameters.push_back(std::move(wkt)); + parameters.push_back(std::move(arg0)); } -DataType GeomShortestline3dLogicalFunction::getDataType() const { return dataType; } +DataType GeomShortestline3dLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction GeomShortestline3dLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector GeomShortestline3dLogicalFunction::getChildren() const { return parameters; } +std::vector GeomShortestline3dLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction GeomShortestline3dLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 2, - "GeomShortestline3dLogicalFunction requires 2 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 2, "GeomShortestline3dLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view GeomShortestline3dLogicalFunction::getType() const { return NAME; } +std::string_view GeomShortestline3dLogicalFunction::getType() const +{ + return NAME; +} bool GeomShortestline3dLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string GeomShortestline3dLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction GeomShortestline3dLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(2); - for (const auto& p : parameters) - c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "wkt1 must be VARSIZED"); - INVARIANT(c[1].getDataType().isType(DataType::Type::VARSIZED), "wkt2 must be VARSIZED"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction GeomShortestline3dLogicalFunction::serialize() const @@ -81,7 +105,9 @@ SerializableFunction GeomShortestline3dLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -91,9 +117,9 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeo PRECONDITION(arguments.children.size() == 2, "GeomShortestline3dLogicalFunction requires 2 children but got {}", arguments.children.size()); - return GeomShortestline3dLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + return GeomShortestline3dLogicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/GeomToGeogLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeomToGeogLogicalFunction.cpp index c00d34698b..15dcc8f283 100644 --- a/nes-logical-operators/src/Functions/Meos/GeomToGeogLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/GeomToGeogLogicalFunction.cpp @@ -33,44 +33,68 @@ GeomToGeogLogicalFunction::GeomToGeogLogicalFunction(LogicalFunction wkt) parameters.push_back(std::move(wkt)); } -DataType GeomToGeogLogicalFunction::getDataType() const { return dataType; } +DataType GeomToGeogLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction GeomToGeogLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector GeomToGeogLogicalFunction::getChildren() const { return parameters; } +std::vector GeomToGeogLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction GeomToGeogLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 1, - "GeomToGeogLogicalFunction requires 1 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 1, "GeomToGeogLogicalFunction requires 1 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view GeomToGeogLogicalFunction::getType() const { return NAME; } +std::string_view GeomToGeogLogicalFunction::getType() const +{ + return NAME; +} bool GeomToGeogLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string GeomToGeogLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction GeomToGeogLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(1); - for (const auto& p : parameters) - c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "wkt must be VARSIZED"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction GeomToGeogLogicalFunction::serialize() const @@ -79,7 +103,9 @@ SerializableFunction GeomToGeogLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -89,8 +115,8 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeo PRECONDITION(arguments.children.size() == 1, "GeomToGeogLogicalFunction requires 1 children but got {}", arguments.children.size()); - return GeomToGeogLogicalFunction( - std::move(arguments.children[0])); + auto arg0 = std::move(arguments.children[0]); + return GeomToGeogLogicalFunction(std::move(arg0)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/GeomTouchesLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeomTouchesLogicalFunction.cpp index e8e776a850..d1c43e632c 100644 --- a/nes-logical-operators/src/Functions/Meos/GeomTouchesLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/GeomTouchesLogicalFunction.cpp @@ -26,43 +26,63 @@ namespace NES { -GeomTouchesLogicalFunction::GeomTouchesLogicalFunction(LogicalFunction wkt1, LogicalFunction wkt2) +GeomTouchesLogicalFunction::GeomTouchesLogicalFunction(LogicalFunction wkt, + LogicalFunction arg0) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(2); - parameters.push_back(std::move(wkt1)); - parameters.push_back(std::move(wkt2)); + parameters.push_back(std::move(wkt)); + parameters.push_back(std::move(arg0)); } -DataType GeomTouchesLogicalFunction::getDataType() const { return dataType; } +DataType GeomTouchesLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction GeomTouchesLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector GeomTouchesLogicalFunction::getChildren() const { return parameters; } +std::vector GeomTouchesLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction GeomTouchesLogicalFunction::withChildren(const std::vector& children) const { PRECONDITION(children.size() == 2, "GeomTouchesLogicalFunction requires 2 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view GeomTouchesLogicalFunction::getType() const { return NAME; } +std::string_view GeomTouchesLogicalFunction::getType() const +{ + return NAME; +} bool GeomTouchesLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string GeomTouchesLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -73,7 +93,9 @@ LogicalFunction GeomTouchesLogicalFunction::withInferredDataType(const Schema& s std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -83,7 +105,9 @@ SerializableFunction GeomTouchesLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -93,9 +117,9 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeo PRECONDITION(arguments.children.size() == 2, "GeomTouchesLogicalFunction requires 2 children but got {}", arguments.children.size()); - return GeomTouchesLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + return GeomTouchesLogicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/GeomUnaryUnionLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/GeomUnaryUnionLogicalFunction.cpp index 9155f6d913..991d558ce6 100644 --- a/nes-logical-operators/src/Functions/Meos/GeomUnaryUnionLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/GeomUnaryUnionLogicalFunction.cpp @@ -33,44 +33,68 @@ GeomUnaryUnionLogicalFunction::GeomUnaryUnionLogicalFunction(LogicalFunction wkt parameters.push_back(std::move(wkt)); } -DataType GeomUnaryUnionLogicalFunction::getDataType() const { return dataType; } +DataType GeomUnaryUnionLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction GeomUnaryUnionLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector GeomUnaryUnionLogicalFunction::getChildren() const { return parameters; } +std::vector GeomUnaryUnionLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction GeomUnaryUnionLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 1, - "GeomUnaryUnionLogicalFunction requires 1 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 1, "GeomUnaryUnionLogicalFunction requires 1 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view GeomUnaryUnionLogicalFunction::getType() const { return NAME; } +std::string_view GeomUnaryUnionLogicalFunction::getType() const +{ + return NAME; +} bool GeomUnaryUnionLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string GeomUnaryUnionLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction GeomUnaryUnionLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(1); - for (const auto& p : parameters) - c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "wkt must be VARSIZED"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction GeomUnaryUnionLogicalFunction::serialize() const @@ -79,7 +103,9 @@ SerializableFunction GeomUnaryUnionLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -89,8 +115,8 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterGeo PRECONDITION(arguments.children.size() == 1, "GeomUnaryUnionLogicalFunction requires 1 children but got {}", arguments.children.size()); - return GeomUnaryUnionLogicalFunction( - std::move(arguments.children[0])); + auto arg0 = std::move(arguments.children[0]); + return GeomUnaryUnionLogicalFunction(std::move(arg0)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/H3indexCmpLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/H3indexCmpLogicalFunction.cpp index 4a977150f7..13476ce147 100644 --- a/nes-logical-operators/src/Functions/Meos/H3indexCmpLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/H3indexCmpLogicalFunction.cpp @@ -26,7 +26,8 @@ namespace NES { -H3indexCmpLogicalFunction::H3indexCmpLogicalFunction(LogicalFunction a, LogicalFunction b) +H3indexCmpLogicalFunction::H3indexCmpLogicalFunction(LogicalFunction a, + LogicalFunction b) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(2); @@ -34,45 +35,68 @@ H3indexCmpLogicalFunction::H3indexCmpLogicalFunction(LogicalFunction a, LogicalF parameters.push_back(std::move(b)); } -DataType H3indexCmpLogicalFunction::getDataType() const { return dataType; } +DataType H3indexCmpLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction H3indexCmpLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector H3indexCmpLogicalFunction::getChildren() const { return parameters; } +std::vector H3indexCmpLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction H3indexCmpLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 2, - "H3indexCmpLogicalFunction requires 2 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 2, "H3indexCmpLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view H3indexCmpLogicalFunction::getType() const { return NAME; } +std::string_view H3indexCmpLogicalFunction::getType() const +{ + return NAME; +} bool H3indexCmpLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string H3indexCmpLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction H3indexCmpLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(2); - for (const auto& p : parameters) - c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "a must be UINT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "b must be UINT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction H3indexCmpLogicalFunction::serialize() const @@ -81,7 +105,9 @@ SerializableFunction H3indexCmpLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -91,9 +117,9 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterH3i PRECONDITION(arguments.children.size() == 2, "H3indexCmpLogicalFunction requires 2 children but got {}", arguments.children.size()); - return H3indexCmpLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + return H3indexCmpLogicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/H3indexEqLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/H3indexEqLogicalFunction.cpp index 95f6683a2c..13ea6ec352 100644 --- a/nes-logical-operators/src/Functions/Meos/H3indexEqLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/H3indexEqLogicalFunction.cpp @@ -26,7 +26,8 @@ namespace NES { -H3indexEqLogicalFunction::H3indexEqLogicalFunction(LogicalFunction a, LogicalFunction b) +H3indexEqLogicalFunction::H3indexEqLogicalFunction(LogicalFunction a, + LogicalFunction b) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(2); @@ -34,45 +35,68 @@ H3indexEqLogicalFunction::H3indexEqLogicalFunction(LogicalFunction a, LogicalFun parameters.push_back(std::move(b)); } -DataType H3indexEqLogicalFunction::getDataType() const { return dataType; } +DataType H3indexEqLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction H3indexEqLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector H3indexEqLogicalFunction::getChildren() const { return parameters; } +std::vector H3indexEqLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction H3indexEqLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 2, - "H3indexEqLogicalFunction requires 2 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 2, "H3indexEqLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view H3indexEqLogicalFunction::getType() const { return NAME; } +std::string_view H3indexEqLogicalFunction::getType() const +{ + return NAME; +} bool H3indexEqLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string H3indexEqLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction H3indexEqLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(2); - for (const auto& p : parameters) - c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "a must be UINT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "b must be UINT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction H3indexEqLogicalFunction::serialize() const @@ -81,7 +105,9 @@ SerializableFunction H3indexEqLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -91,9 +117,9 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterH3i PRECONDITION(arguments.children.size() == 2, "H3indexEqLogicalFunction requires 2 children but got {}", arguments.children.size()); - return H3indexEqLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + return H3indexEqLogicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/H3indexGeLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/H3indexGeLogicalFunction.cpp index 66b18248f0..3c764f4070 100644 --- a/nes-logical-operators/src/Functions/Meos/H3indexGeLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/H3indexGeLogicalFunction.cpp @@ -26,7 +26,8 @@ namespace NES { -H3indexGeLogicalFunction::H3indexGeLogicalFunction(LogicalFunction a, LogicalFunction b) +H3indexGeLogicalFunction::H3indexGeLogicalFunction(LogicalFunction a, + LogicalFunction b) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(2); @@ -34,45 +35,68 @@ H3indexGeLogicalFunction::H3indexGeLogicalFunction(LogicalFunction a, LogicalFun parameters.push_back(std::move(b)); } -DataType H3indexGeLogicalFunction::getDataType() const { return dataType; } +DataType H3indexGeLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction H3indexGeLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector H3indexGeLogicalFunction::getChildren() const { return parameters; } +std::vector H3indexGeLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction H3indexGeLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 2, - "H3indexGeLogicalFunction requires 2 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 2, "H3indexGeLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view H3indexGeLogicalFunction::getType() const { return NAME; } +std::string_view H3indexGeLogicalFunction::getType() const +{ + return NAME; +} bool H3indexGeLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string H3indexGeLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction H3indexGeLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(2); - for (const auto& p : parameters) - c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "a must be UINT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "b must be UINT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction H3indexGeLogicalFunction::serialize() const @@ -81,7 +105,9 @@ SerializableFunction H3indexGeLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -91,9 +117,9 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterH3i PRECONDITION(arguments.children.size() == 2, "H3indexGeLogicalFunction requires 2 children but got {}", arguments.children.size()); - return H3indexGeLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + return H3indexGeLogicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/H3indexGtLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/H3indexGtLogicalFunction.cpp index 02774e62c0..2137ab5f90 100644 --- a/nes-logical-operators/src/Functions/Meos/H3indexGtLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/H3indexGtLogicalFunction.cpp @@ -26,7 +26,8 @@ namespace NES { -H3indexGtLogicalFunction::H3indexGtLogicalFunction(LogicalFunction a, LogicalFunction b) +H3indexGtLogicalFunction::H3indexGtLogicalFunction(LogicalFunction a, + LogicalFunction b) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(2); @@ -34,45 +35,68 @@ H3indexGtLogicalFunction::H3indexGtLogicalFunction(LogicalFunction a, LogicalFun parameters.push_back(std::move(b)); } -DataType H3indexGtLogicalFunction::getDataType() const { return dataType; } +DataType H3indexGtLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction H3indexGtLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector H3indexGtLogicalFunction::getChildren() const { return parameters; } +std::vector H3indexGtLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction H3indexGtLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 2, - "H3indexGtLogicalFunction requires 2 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 2, "H3indexGtLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view H3indexGtLogicalFunction::getType() const { return NAME; } +std::string_view H3indexGtLogicalFunction::getType() const +{ + return NAME; +} bool H3indexGtLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string H3indexGtLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction H3indexGtLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(2); - for (const auto& p : parameters) - c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "a must be UINT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "b must be UINT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction H3indexGtLogicalFunction::serialize() const @@ -81,7 +105,9 @@ SerializableFunction H3indexGtLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -91,9 +117,9 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterH3i PRECONDITION(arguments.children.size() == 2, "H3indexGtLogicalFunction requires 2 children but got {}", arguments.children.size()); - return H3indexGtLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + return H3indexGtLogicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/H3indexLeLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/H3indexLeLogicalFunction.cpp index 2116c829a9..ce05e836ca 100644 --- a/nes-logical-operators/src/Functions/Meos/H3indexLeLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/H3indexLeLogicalFunction.cpp @@ -26,7 +26,8 @@ namespace NES { -H3indexLeLogicalFunction::H3indexLeLogicalFunction(LogicalFunction a, LogicalFunction b) +H3indexLeLogicalFunction::H3indexLeLogicalFunction(LogicalFunction a, + LogicalFunction b) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(2); @@ -34,45 +35,68 @@ H3indexLeLogicalFunction::H3indexLeLogicalFunction(LogicalFunction a, LogicalFun parameters.push_back(std::move(b)); } -DataType H3indexLeLogicalFunction::getDataType() const { return dataType; } +DataType H3indexLeLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction H3indexLeLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector H3indexLeLogicalFunction::getChildren() const { return parameters; } +std::vector H3indexLeLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction H3indexLeLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 2, - "H3indexLeLogicalFunction requires 2 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 2, "H3indexLeLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view H3indexLeLogicalFunction::getType() const { return NAME; } +std::string_view H3indexLeLogicalFunction::getType() const +{ + return NAME; +} bool H3indexLeLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string H3indexLeLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction H3indexLeLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(2); - for (const auto& p : parameters) - c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "a must be UINT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "b must be UINT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction H3indexLeLogicalFunction::serialize() const @@ -81,7 +105,9 @@ SerializableFunction H3indexLeLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -91,9 +117,9 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterH3i PRECONDITION(arguments.children.size() == 2, "H3indexLeLogicalFunction requires 2 children but got {}", arguments.children.size()); - return H3indexLeLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + return H3indexLeLogicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/H3indexLtLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/H3indexLtLogicalFunction.cpp index 330cad365b..a89dc7112e 100644 --- a/nes-logical-operators/src/Functions/Meos/H3indexLtLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/H3indexLtLogicalFunction.cpp @@ -26,7 +26,8 @@ namespace NES { -H3indexLtLogicalFunction::H3indexLtLogicalFunction(LogicalFunction a, LogicalFunction b) +H3indexLtLogicalFunction::H3indexLtLogicalFunction(LogicalFunction a, + LogicalFunction b) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(2); @@ -34,45 +35,68 @@ H3indexLtLogicalFunction::H3indexLtLogicalFunction(LogicalFunction a, LogicalFun parameters.push_back(std::move(b)); } -DataType H3indexLtLogicalFunction::getDataType() const { return dataType; } +DataType H3indexLtLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction H3indexLtLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector H3indexLtLogicalFunction::getChildren() const { return parameters; } +std::vector H3indexLtLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction H3indexLtLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 2, - "H3indexLtLogicalFunction requires 2 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 2, "H3indexLtLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view H3indexLtLogicalFunction::getType() const { return NAME; } +std::string_view H3indexLtLogicalFunction::getType() const +{ + return NAME; +} bool H3indexLtLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string H3indexLtLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction H3indexLtLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(2); - for (const auto& p : parameters) - c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "a must be UINT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "b must be UINT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction H3indexLtLogicalFunction::serialize() const @@ -81,7 +105,9 @@ SerializableFunction H3indexLtLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -91,9 +117,9 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterH3i PRECONDITION(arguments.children.size() == 2, "H3indexLtLogicalFunction requires 2 children but got {}", arguments.children.size()); - return H3indexLtLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + return H3indexLtLogicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/H3indexNeLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/H3indexNeLogicalFunction.cpp index c22c3d2263..e66a49167f 100644 --- a/nes-logical-operators/src/Functions/Meos/H3indexNeLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/H3indexNeLogicalFunction.cpp @@ -26,7 +26,8 @@ namespace NES { -H3indexNeLogicalFunction::H3indexNeLogicalFunction(LogicalFunction a, LogicalFunction b) +H3indexNeLogicalFunction::H3indexNeLogicalFunction(LogicalFunction a, + LogicalFunction b) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(2); @@ -34,45 +35,68 @@ H3indexNeLogicalFunction::H3indexNeLogicalFunction(LogicalFunction a, LogicalFun parameters.push_back(std::move(b)); } -DataType H3indexNeLogicalFunction::getDataType() const { return dataType; } +DataType H3indexNeLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction H3indexNeLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector H3indexNeLogicalFunction::getChildren() const { return parameters; } +std::vector H3indexNeLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction H3indexNeLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 2, - "H3indexNeLogicalFunction requires 2 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 2, "H3indexNeLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view H3indexNeLogicalFunction::getType() const { return NAME; } +std::string_view H3indexNeLogicalFunction::getType() const +{ + return NAME; +} bool H3indexNeLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string H3indexNeLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction H3indexNeLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(2); - for (const auto& p : parameters) - c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "a must be UINT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "b must be UINT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction H3indexNeLogicalFunction::serialize() const @@ -81,7 +105,9 @@ SerializableFunction H3indexNeLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -91,9 +117,9 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterH3i PRECONDITION(arguments.children.size() == 2, "H3indexNeLogicalFunction requires 2 children but got {}", arguments.children.size()); - return H3indexNeLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + return H3indexNeLogicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/H3indexOutLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/H3indexOutLogicalFunction.cpp index 227f25c0bf..d36a89ca7e 100644 --- a/nes-logical-operators/src/Functions/Meos/H3indexOutLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/H3indexOutLogicalFunction.cpp @@ -33,43 +33,68 @@ H3indexOutLogicalFunction::H3indexOutLogicalFunction(LogicalFunction cell) parameters.push_back(std::move(cell)); } -DataType H3indexOutLogicalFunction::getDataType() const { return dataType; } +DataType H3indexOutLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction H3indexOutLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector H3indexOutLogicalFunction::getChildren() const { return parameters; } +std::vector H3indexOutLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction H3indexOutLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 1, - "H3indexOutLogicalFunction requires 1 child, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 1, "H3indexOutLogicalFunction requires 1 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view H3indexOutLogicalFunction::getType() const { return NAME; } +std::string_view H3indexOutLogicalFunction::getType() const +{ + return NAME; +} bool H3indexOutLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string H3indexOutLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction H3indexOutLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(1); - c.emplace_back(parameters[0].withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "cell must be UINT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction H3indexOutLogicalFunction::serialize() const @@ -78,7 +103,9 @@ SerializableFunction H3indexOutLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -86,9 +113,10 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterH3i LogicalFunctionRegistryArguments arguments) { PRECONDITION(arguments.children.size() == 1, - "H3indexOutLogicalFunction requires 1 child but got {}", + "H3indexOutLogicalFunction requires 1 children but got {}", arguments.children.size()); - return H3indexOutLogicalFunction(std::move(arguments.children[0])); + auto arg0 = std::move(arguments.children[0]); + return H3indexOutLogicalFunction(std::move(arg0)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/IntspanLowerIncLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/IntspanLowerIncLogicalFunction.cpp index 9294880386..522314f58f 100644 --- a/nes-logical-operators/src/Functions/Meos/IntspanLowerIncLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/IntspanLowerIncLogicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -31,42 +32,91 @@ IntspanLowerIncLogicalFunction::IntspanLowerIncLogicalFunction(LogicalFunction s parameters.reserve(1); parameters.push_back(std::move(sp)); } -DataType IntspanLowerIncLogicalFunction::getDataType() const { return dataType; } -LogicalFunction IntspanLowerIncLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } -std::vector IntspanLowerIncLogicalFunction::getChildren() const { return parameters; } -LogicalFunction IntspanLowerIncLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size()==1,"IntspanLowerIncLogicalFunction requires 1 children, but got {}",children.size()); - auto c=*this; c.parameters=children; return c; + +DataType IntspanLowerIncLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction IntspanLowerIncLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector IntspanLowerIncLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction IntspanLowerIncLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 1, "IntspanLowerIncLogicalFunction requires 1 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; +} + +std::string_view IntspanLowerIncLogicalFunction::getType() const +{ + return NAME; } -std::string_view IntspanLowerIncLogicalFunction::getType() const { return NAME; } -bool IntspanLowerIncLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { - if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + +bool IntspanLowerIncLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } return false; } -std::string IntspanLowerIncLogicalFunction::explain(ExplainVerbosity v) const { - return fmt::format("{}({})",NAME,parameters[0].explain(v)); + +std::string IntspanLowerIncLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } -LogicalFunction IntspanLowerIncLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; c.reserve(1); - for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "sp must be VARSIZED"); - return withChildren(c); + +LogicalFunction IntspanLowerIncLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } -SerializableFunction IntspanLowerIncLogicalFunction::serialize() const { + +SerializableFunction IntspanLowerIncLogicalFunction::serialize() const +{ SerializableFunction proto; proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); - for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } return proto; } + LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterIntspanLowerIncLogicalFunction( LogicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.children.size()==1, + PRECONDITION(arguments.children.size() == 1, "IntspanLowerIncLogicalFunction requires 1 children but got {}", arguments.children.size()); - return IntspanLowerIncLogicalFunction( - std::move(arguments.children[0])); + auto arg0 = std::move(arguments.children[0]); + return IntspanLowerIncLogicalFunction(std::move(arg0)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/IntspanLowerLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/IntspanLowerLogicalFunction.cpp index 3257071541..a4a2a5fb89 100644 --- a/nes-logical-operators/src/Functions/Meos/IntspanLowerLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/IntspanLowerLogicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -31,42 +32,91 @@ IntspanLowerLogicalFunction::IntspanLowerLogicalFunction(LogicalFunction sp) parameters.reserve(1); parameters.push_back(std::move(sp)); } -DataType IntspanLowerLogicalFunction::getDataType() const { return dataType; } -LogicalFunction IntspanLowerLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } -std::vector IntspanLowerLogicalFunction::getChildren() const { return parameters; } -LogicalFunction IntspanLowerLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size()==1,"IntspanLowerLogicalFunction requires 1 children, but got {}",children.size()); - auto c=*this; c.parameters=children; return c; + +DataType IntspanLowerLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction IntspanLowerLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector IntspanLowerLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction IntspanLowerLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 1, "IntspanLowerLogicalFunction requires 1 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; +} + +std::string_view IntspanLowerLogicalFunction::getType() const +{ + return NAME; } -std::string_view IntspanLowerLogicalFunction::getType() const { return NAME; } -bool IntspanLowerLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { - if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + +bool IntspanLowerLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } return false; } -std::string IntspanLowerLogicalFunction::explain(ExplainVerbosity v) const { - return fmt::format("{}({})",NAME,parameters[0].explain(v)); + +std::string IntspanLowerLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } -LogicalFunction IntspanLowerLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; c.reserve(1); - for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "sp must be VARSIZED"); - return withChildren(c); + +LogicalFunction IntspanLowerLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } -SerializableFunction IntspanLowerLogicalFunction::serialize() const { + +SerializableFunction IntspanLowerLogicalFunction::serialize() const +{ SerializableFunction proto; proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); - for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } return proto; } + LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterIntspanLowerLogicalFunction( LogicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.children.size()==1, + PRECONDITION(arguments.children.size() == 1, "IntspanLowerLogicalFunction requires 1 children but got {}", arguments.children.size()); - return IntspanLowerLogicalFunction( - std::move(arguments.children[0])); + auto arg0 = std::move(arguments.children[0]); + return IntspanLowerLogicalFunction(std::move(arg0)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/IntspanUpperIncLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/IntspanUpperIncLogicalFunction.cpp index f3ac4aca30..baf855a4ff 100644 --- a/nes-logical-operators/src/Functions/Meos/IntspanUpperIncLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/IntspanUpperIncLogicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -31,42 +32,91 @@ IntspanUpperIncLogicalFunction::IntspanUpperIncLogicalFunction(LogicalFunction s parameters.reserve(1); parameters.push_back(std::move(sp)); } -DataType IntspanUpperIncLogicalFunction::getDataType() const { return dataType; } -LogicalFunction IntspanUpperIncLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } -std::vector IntspanUpperIncLogicalFunction::getChildren() const { return parameters; } -LogicalFunction IntspanUpperIncLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size()==1,"IntspanUpperIncLogicalFunction requires 1 children, but got {}",children.size()); - auto c=*this; c.parameters=children; return c; + +DataType IntspanUpperIncLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction IntspanUpperIncLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector IntspanUpperIncLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction IntspanUpperIncLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 1, "IntspanUpperIncLogicalFunction requires 1 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; +} + +std::string_view IntspanUpperIncLogicalFunction::getType() const +{ + return NAME; } -std::string_view IntspanUpperIncLogicalFunction::getType() const { return NAME; } -bool IntspanUpperIncLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { - if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + +bool IntspanUpperIncLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } return false; } -std::string IntspanUpperIncLogicalFunction::explain(ExplainVerbosity v) const { - return fmt::format("{}({})",NAME,parameters[0].explain(v)); + +std::string IntspanUpperIncLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } -LogicalFunction IntspanUpperIncLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; c.reserve(1); - for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "sp must be VARSIZED"); - return withChildren(c); + +LogicalFunction IntspanUpperIncLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } -SerializableFunction IntspanUpperIncLogicalFunction::serialize() const { + +SerializableFunction IntspanUpperIncLogicalFunction::serialize() const +{ SerializableFunction proto; proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); - for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } return proto; } + LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterIntspanUpperIncLogicalFunction( LogicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.children.size()==1, + PRECONDITION(arguments.children.size() == 1, "IntspanUpperIncLogicalFunction requires 1 children but got {}", arguments.children.size()); - return IntspanUpperIncLogicalFunction( - std::move(arguments.children[0])); + auto arg0 = std::move(arguments.children[0]); + return IntspanUpperIncLogicalFunction(std::move(arg0)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/IntspanUpperLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/IntspanUpperLogicalFunction.cpp index e3d25cef69..e56928c1dd 100644 --- a/nes-logical-operators/src/Functions/Meos/IntspanUpperLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/IntspanUpperLogicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -31,42 +32,91 @@ IntspanUpperLogicalFunction::IntspanUpperLogicalFunction(LogicalFunction sp) parameters.reserve(1); parameters.push_back(std::move(sp)); } -DataType IntspanUpperLogicalFunction::getDataType() const { return dataType; } -LogicalFunction IntspanUpperLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } -std::vector IntspanUpperLogicalFunction::getChildren() const { return parameters; } -LogicalFunction IntspanUpperLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size()==1,"IntspanUpperLogicalFunction requires 1 children, but got {}",children.size()); - auto c=*this; c.parameters=children; return c; + +DataType IntspanUpperLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction IntspanUpperLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector IntspanUpperLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction IntspanUpperLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 1, "IntspanUpperLogicalFunction requires 1 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; +} + +std::string_view IntspanUpperLogicalFunction::getType() const +{ + return NAME; } -std::string_view IntspanUpperLogicalFunction::getType() const { return NAME; } -bool IntspanUpperLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { - if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + +bool IntspanUpperLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } return false; } -std::string IntspanUpperLogicalFunction::explain(ExplainVerbosity v) const { - return fmt::format("{}({})",NAME,parameters[0].explain(v)); + +std::string IntspanUpperLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } -LogicalFunction IntspanUpperLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; c.reserve(1); - for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "sp must be VARSIZED"); - return withChildren(c); + +LogicalFunction IntspanUpperLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } -SerializableFunction IntspanUpperLogicalFunction::serialize() const { + +SerializableFunction IntspanUpperLogicalFunction::serialize() const +{ SerializableFunction proto; proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); - for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } return proto; } + LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterIntspanUpperLogicalFunction( LogicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.children.size()==1, + PRECONDITION(arguments.children.size() == 1, "IntspanUpperLogicalFunction requires 1 children but got {}", arguments.children.size()); - return IntspanUpperLogicalFunction( - std::move(arguments.children[0])); + auto arg0 = std::move(arguments.children[0]); + return IntspanUpperLogicalFunction(std::move(arg0)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/IntspanWidthLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/IntspanWidthLogicalFunction.cpp index 1e505303e7..a74c99238a 100644 --- a/nes-logical-operators/src/Functions/Meos/IntspanWidthLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/IntspanWidthLogicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -31,42 +32,91 @@ IntspanWidthLogicalFunction::IntspanWidthLogicalFunction(LogicalFunction sp) parameters.reserve(1); parameters.push_back(std::move(sp)); } -DataType IntspanWidthLogicalFunction::getDataType() const { return dataType; } -LogicalFunction IntspanWidthLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } -std::vector IntspanWidthLogicalFunction::getChildren() const { return parameters; } -LogicalFunction IntspanWidthLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size()==1,"IntspanWidthLogicalFunction requires 1 children, but got {}",children.size()); - auto c=*this; c.parameters=children; return c; + +DataType IntspanWidthLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction IntspanWidthLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector IntspanWidthLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction IntspanWidthLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 1, "IntspanWidthLogicalFunction requires 1 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; +} + +std::string_view IntspanWidthLogicalFunction::getType() const +{ + return NAME; } -std::string_view IntspanWidthLogicalFunction::getType() const { return NAME; } -bool IntspanWidthLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { - if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + +bool IntspanWidthLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } return false; } -std::string IntspanWidthLogicalFunction::explain(ExplainVerbosity v) const { - return fmt::format("{}({})",NAME,parameters[0].explain(v)); + +std::string IntspanWidthLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } -LogicalFunction IntspanWidthLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; c.reserve(1); - for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "sp must be VARSIZED"); - return withChildren(c); + +LogicalFunction IntspanWidthLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } -SerializableFunction IntspanWidthLogicalFunction::serialize() const { + +SerializableFunction IntspanWidthLogicalFunction::serialize() const +{ SerializableFunction proto; proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); - for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } return proto; } + LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterIntspanWidthLogicalFunction( LogicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.children.size()==1, + PRECONDITION(arguments.children.size() == 1, "IntspanWidthLogicalFunction requires 1 children but got {}", arguments.children.size()); - return IntspanWidthLogicalFunction( - std::move(arguments.children[0])); + auto arg0 = std::move(arguments.children[0]); + return IntspanWidthLogicalFunction(std::move(arg0)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/JsonbArrayElementTextLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/JsonbArrayElementTextLogicalFunction.cpp index eeeb98206a..ea4bce5f19 100644 --- a/nes-logical-operators/src/Functions/Meos/JsonbArrayElementTextLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/JsonbArrayElementTextLogicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -25,51 +26,100 @@ namespace NES { -JsonbArrayElementTextLogicalFunction::JsonbArrayElementTextLogicalFunction(LogicalFunction jb, LogicalFunction idx) +JsonbArrayElementTextLogicalFunction::JsonbArrayElementTextLogicalFunction(LogicalFunction jb, + LogicalFunction arg0) : dataType(DataTypeProvider::provideDataType(DataType::Type::VARSIZED)) { parameters.reserve(2); parameters.push_back(std::move(jb)); - parameters.push_back(std::move(idx)); + parameters.push_back(std::move(arg0)); +} + +DataType JsonbArrayElementTextLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction JsonbArrayElementTextLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector JsonbArrayElementTextLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction JsonbArrayElementTextLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 2, "JsonbArrayElementTextLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -DataType JsonbArrayElementTextLogicalFunction::getDataType() const { return dataType; } -LogicalFunction JsonbArrayElementTextLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } -std::vector JsonbArrayElementTextLogicalFunction::getChildren() const { return parameters; } -LogicalFunction JsonbArrayElementTextLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size()==2,"JsonbArrayElementTextLogicalFunction requires 2 children, but got {}",children.size()); - auto c=*this; c.parameters=children; return c; + +std::string_view JsonbArrayElementTextLogicalFunction::getType() const +{ + return NAME; } -std::string_view JsonbArrayElementTextLogicalFunction::getType() const { return NAME; } -bool JsonbArrayElementTextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { - if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + +bool JsonbArrayElementTextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } return false; } -std::string JsonbArrayElementTextLogicalFunction::explain(ExplainVerbosity v) const { - return fmt::format("{}({})",NAME,parameters[0].explain(v)); + +std::string JsonbArrayElementTextLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } -LogicalFunction JsonbArrayElementTextLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; c.reserve(2); - for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "jb must be VARSIZED"); - INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "idx must be FLOAT64"); - return withChildren(c); + +LogicalFunction JsonbArrayElementTextLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } -SerializableFunction JsonbArrayElementTextLogicalFunction::serialize() const { + +SerializableFunction JsonbArrayElementTextLogicalFunction::serialize() const +{ SerializableFunction proto; proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); - for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } return proto; } + LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterJsonbArrayElementTextLogicalFunction( LogicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.children.size()==2, + PRECONDITION(arguments.children.size() == 2, "JsonbArrayElementTextLogicalFunction requires 2 children but got {}", arguments.children.size()); - return JsonbArrayElementTextLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + return JsonbArrayElementTextLogicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/JsonbArrayLengthLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/JsonbArrayLengthLogicalFunction.cpp index 27818e1a0c..0bc8d70405 100644 --- a/nes-logical-operators/src/Functions/Meos/JsonbArrayLengthLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/JsonbArrayLengthLogicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -31,42 +32,91 @@ JsonbArrayLengthLogicalFunction::JsonbArrayLengthLogicalFunction(LogicalFunction parameters.reserve(1); parameters.push_back(std::move(jb)); } -DataType JsonbArrayLengthLogicalFunction::getDataType() const { return dataType; } -LogicalFunction JsonbArrayLengthLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } -std::vector JsonbArrayLengthLogicalFunction::getChildren() const { return parameters; } -LogicalFunction JsonbArrayLengthLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size()==1,"JsonbArrayLengthLogicalFunction requires 1 children, but got {}",children.size()); - auto c=*this; c.parameters=children; return c; + +DataType JsonbArrayLengthLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction JsonbArrayLengthLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector JsonbArrayLengthLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction JsonbArrayLengthLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 1, "JsonbArrayLengthLogicalFunction requires 1 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; +} + +std::string_view JsonbArrayLengthLogicalFunction::getType() const +{ + return NAME; } -std::string_view JsonbArrayLengthLogicalFunction::getType() const { return NAME; } -bool JsonbArrayLengthLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { - if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + +bool JsonbArrayLengthLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } return false; } -std::string JsonbArrayLengthLogicalFunction::explain(ExplainVerbosity v) const { - return fmt::format("{}({})",NAME,parameters[0].explain(v)); + +std::string JsonbArrayLengthLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } -LogicalFunction JsonbArrayLengthLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; c.reserve(1); - for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "jb must be VARSIZED"); - return withChildren(c); + +LogicalFunction JsonbArrayLengthLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } -SerializableFunction JsonbArrayLengthLogicalFunction::serialize() const { + +SerializableFunction JsonbArrayLengthLogicalFunction::serialize() const +{ SerializableFunction proto; proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); - for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } return proto; } + LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterJsonbArrayLengthLogicalFunction( LogicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.children.size()==1, + PRECONDITION(arguments.children.size() == 1, "JsonbArrayLengthLogicalFunction requires 1 children but got {}", arguments.children.size()); - return JsonbArrayLengthLogicalFunction( - std::move(arguments.children[0])); + auto arg0 = std::move(arguments.children[0]); + return JsonbArrayLengthLogicalFunction(std::move(arg0)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/JsonbCmpLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/JsonbCmpLogicalFunction.cpp index 5d9bb95672..713b15995b 100644 --- a/nes-logical-operators/src/Functions/Meos/JsonbCmpLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/JsonbCmpLogicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -25,51 +26,100 @@ namespace NES { -JsonbCmpLogicalFunction::JsonbCmpLogicalFunction(LogicalFunction jb1, LogicalFunction jb2) +JsonbCmpLogicalFunction::JsonbCmpLogicalFunction(LogicalFunction jb, + LogicalFunction arg0) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(2); - parameters.push_back(std::move(jb1)); - parameters.push_back(std::move(jb2)); + parameters.push_back(std::move(jb)); + parameters.push_back(std::move(arg0)); +} + +DataType JsonbCmpLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction JsonbCmpLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector JsonbCmpLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction JsonbCmpLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 2, "JsonbCmpLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -DataType JsonbCmpLogicalFunction::getDataType() const { return dataType; } -LogicalFunction JsonbCmpLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } -std::vector JsonbCmpLogicalFunction::getChildren() const { return parameters; } -LogicalFunction JsonbCmpLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size()==2,"JsonbCmpLogicalFunction requires 2 children, but got {}",children.size()); - auto c=*this; c.parameters=children; return c; + +std::string_view JsonbCmpLogicalFunction::getType() const +{ + return NAME; } -std::string_view JsonbCmpLogicalFunction::getType() const { return NAME; } -bool JsonbCmpLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { - if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + +bool JsonbCmpLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } return false; } -std::string JsonbCmpLogicalFunction::explain(ExplainVerbosity v) const { - return fmt::format("{}({})",NAME,parameters[0].explain(v)); + +std::string JsonbCmpLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } -LogicalFunction JsonbCmpLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; c.reserve(2); - for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "jb1 must be VARSIZED"); - INVARIANT(c[1].getDataType().isType(DataType::Type::VARSIZED), "jb2 must be VARSIZED"); - return withChildren(c); + +LogicalFunction JsonbCmpLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } -SerializableFunction JsonbCmpLogicalFunction::serialize() const { + +SerializableFunction JsonbCmpLogicalFunction::serialize() const +{ SerializableFunction proto; proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); - for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } return proto; } + LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterJsonbCmpLogicalFunction( LogicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.children.size()==2, + PRECONDITION(arguments.children.size() == 2, "JsonbCmpLogicalFunction requires 2 children but got {}", arguments.children.size()); - return JsonbCmpLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + return JsonbCmpLogicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/JsonbContainedLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/JsonbContainedLogicalFunction.cpp index 98e208008c..1ad143498b 100644 --- a/nes-logical-operators/src/Functions/Meos/JsonbContainedLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/JsonbContainedLogicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -25,51 +26,100 @@ namespace NES { -JsonbContainedLogicalFunction::JsonbContainedLogicalFunction(LogicalFunction jb1, LogicalFunction jb2) +JsonbContainedLogicalFunction::JsonbContainedLogicalFunction(LogicalFunction jb, + LogicalFunction arg0) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(2); - parameters.push_back(std::move(jb1)); - parameters.push_back(std::move(jb2)); + parameters.push_back(std::move(jb)); + parameters.push_back(std::move(arg0)); +} + +DataType JsonbContainedLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction JsonbContainedLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector JsonbContainedLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction JsonbContainedLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 2, "JsonbContainedLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -DataType JsonbContainedLogicalFunction::getDataType() const { return dataType; } -LogicalFunction JsonbContainedLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } -std::vector JsonbContainedLogicalFunction::getChildren() const { return parameters; } -LogicalFunction JsonbContainedLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size()==2,"JsonbContainedLogicalFunction requires 2 children, but got {}",children.size()); - auto c=*this; c.parameters=children; return c; + +std::string_view JsonbContainedLogicalFunction::getType() const +{ + return NAME; } -std::string_view JsonbContainedLogicalFunction::getType() const { return NAME; } -bool JsonbContainedLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { - if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + +bool JsonbContainedLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } return false; } -std::string JsonbContainedLogicalFunction::explain(ExplainVerbosity v) const { - return fmt::format("{}({})",NAME,parameters[0].explain(v)); + +std::string JsonbContainedLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } -LogicalFunction JsonbContainedLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; c.reserve(2); - for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "jb1 must be VARSIZED"); - INVARIANT(c[1].getDataType().isType(DataType::Type::VARSIZED), "jb2 must be VARSIZED"); - return withChildren(c); + +LogicalFunction JsonbContainedLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } -SerializableFunction JsonbContainedLogicalFunction::serialize() const { + +SerializableFunction JsonbContainedLogicalFunction::serialize() const +{ SerializableFunction proto; proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); - for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } return proto; } + LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterJsonbContainedLogicalFunction( LogicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.children.size()==2, + PRECONDITION(arguments.children.size() == 2, "JsonbContainedLogicalFunction requires 2 children but got {}", arguments.children.size()); - return JsonbContainedLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + return JsonbContainedLogicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/JsonbContainsLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/JsonbContainsLogicalFunction.cpp index 2a265fdf7a..000ca0697c 100644 --- a/nes-logical-operators/src/Functions/Meos/JsonbContainsLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/JsonbContainsLogicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -25,51 +26,100 @@ namespace NES { -JsonbContainsLogicalFunction::JsonbContainsLogicalFunction(LogicalFunction jb1, LogicalFunction jb2) +JsonbContainsLogicalFunction::JsonbContainsLogicalFunction(LogicalFunction jb, + LogicalFunction arg0) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(2); - parameters.push_back(std::move(jb1)); - parameters.push_back(std::move(jb2)); + parameters.push_back(std::move(jb)); + parameters.push_back(std::move(arg0)); +} + +DataType JsonbContainsLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction JsonbContainsLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector JsonbContainsLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction JsonbContainsLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 2, "JsonbContainsLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -DataType JsonbContainsLogicalFunction::getDataType() const { return dataType; } -LogicalFunction JsonbContainsLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } -std::vector JsonbContainsLogicalFunction::getChildren() const { return parameters; } -LogicalFunction JsonbContainsLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size()==2,"JsonbContainsLogicalFunction requires 2 children, but got {}",children.size()); - auto c=*this; c.parameters=children; return c; + +std::string_view JsonbContainsLogicalFunction::getType() const +{ + return NAME; } -std::string_view JsonbContainsLogicalFunction::getType() const { return NAME; } -bool JsonbContainsLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { - if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + +bool JsonbContainsLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } return false; } -std::string JsonbContainsLogicalFunction::explain(ExplainVerbosity v) const { - return fmt::format("{}({})",NAME,parameters[0].explain(v)); + +std::string JsonbContainsLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } -LogicalFunction JsonbContainsLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; c.reserve(2); - for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "jb1 must be VARSIZED"); - INVARIANT(c[1].getDataType().isType(DataType::Type::VARSIZED), "jb2 must be VARSIZED"); - return withChildren(c); + +LogicalFunction JsonbContainsLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } -SerializableFunction JsonbContainsLogicalFunction::serialize() const { + +SerializableFunction JsonbContainsLogicalFunction::serialize() const +{ SerializableFunction proto; proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); - for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } return proto; } + LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterJsonbContainsLogicalFunction( LogicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.children.size()==2, + PRECONDITION(arguments.children.size() == 2, "JsonbContainsLogicalFunction requires 2 children but got {}", arguments.children.size()); - return JsonbContainsLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + return JsonbContainsLogicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/JsonbEqLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/JsonbEqLogicalFunction.cpp index 78c704a6c3..9833cf8c8e 100644 --- a/nes-logical-operators/src/Functions/Meos/JsonbEqLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/JsonbEqLogicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -25,51 +26,100 @@ namespace NES { -JsonbEqLogicalFunction::JsonbEqLogicalFunction(LogicalFunction jb1, LogicalFunction jb2) +JsonbEqLogicalFunction::JsonbEqLogicalFunction(LogicalFunction jb, + LogicalFunction arg0) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(2); - parameters.push_back(std::move(jb1)); - parameters.push_back(std::move(jb2)); + parameters.push_back(std::move(jb)); + parameters.push_back(std::move(arg0)); +} + +DataType JsonbEqLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction JsonbEqLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector JsonbEqLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction JsonbEqLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 2, "JsonbEqLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -DataType JsonbEqLogicalFunction::getDataType() const { return dataType; } -LogicalFunction JsonbEqLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } -std::vector JsonbEqLogicalFunction::getChildren() const { return parameters; } -LogicalFunction JsonbEqLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size()==2,"JsonbEqLogicalFunction requires 2 children, but got {}",children.size()); - auto c=*this; c.parameters=children; return c; + +std::string_view JsonbEqLogicalFunction::getType() const +{ + return NAME; } -std::string_view JsonbEqLogicalFunction::getType() const { return NAME; } -bool JsonbEqLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { - if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + +bool JsonbEqLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } return false; } -std::string JsonbEqLogicalFunction::explain(ExplainVerbosity v) const { - return fmt::format("{}({})",NAME,parameters[0].explain(v)); + +std::string JsonbEqLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } -LogicalFunction JsonbEqLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; c.reserve(2); - for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "jb1 must be VARSIZED"); - INVARIANT(c[1].getDataType().isType(DataType::Type::VARSIZED), "jb2 must be VARSIZED"); - return withChildren(c); + +LogicalFunction JsonbEqLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } -SerializableFunction JsonbEqLogicalFunction::serialize() const { + +SerializableFunction JsonbEqLogicalFunction::serialize() const +{ SerializableFunction proto; proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); - for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } return proto; } + LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterJsonbEqLogicalFunction( LogicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.children.size()==2, + PRECONDITION(arguments.children.size() == 2, "JsonbEqLogicalFunction requires 2 children but got {}", arguments.children.size()); - return JsonbEqLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + return JsonbEqLogicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/JsonbExistsLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/JsonbExistsLogicalFunction.cpp index bd9e490b85..5b32ef83e4 100644 --- a/nes-logical-operators/src/Functions/Meos/JsonbExistsLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/JsonbExistsLogicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -25,51 +26,100 @@ namespace NES { -JsonbExistsLogicalFunction::JsonbExistsLogicalFunction(LogicalFunction jb, LogicalFunction key) +JsonbExistsLogicalFunction::JsonbExistsLogicalFunction(LogicalFunction jb, + LogicalFunction arg0) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(2); parameters.push_back(std::move(jb)); - parameters.push_back(std::move(key)); + parameters.push_back(std::move(arg0)); +} + +DataType JsonbExistsLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction JsonbExistsLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector JsonbExistsLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction JsonbExistsLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 2, "JsonbExistsLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -DataType JsonbExistsLogicalFunction::getDataType() const { return dataType; } -LogicalFunction JsonbExistsLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } -std::vector JsonbExistsLogicalFunction::getChildren() const { return parameters; } -LogicalFunction JsonbExistsLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size()==2,"JsonbExistsLogicalFunction requires 2 children, but got {}",children.size()); - auto c=*this; c.parameters=children; return c; + +std::string_view JsonbExistsLogicalFunction::getType() const +{ + return NAME; } -std::string_view JsonbExistsLogicalFunction::getType() const { return NAME; } -bool JsonbExistsLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { - if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + +bool JsonbExistsLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } return false; } -std::string JsonbExistsLogicalFunction::explain(ExplainVerbosity v) const { - return fmt::format("{}({})",NAME,parameters[0].explain(v)); + +std::string JsonbExistsLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } -LogicalFunction JsonbExistsLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; c.reserve(2); - for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "jb must be VARSIZED"); - INVARIANT(c[1].getDataType().isType(DataType::Type::VARSIZED), "key must be VARSIZED"); - return withChildren(c); + +LogicalFunction JsonbExistsLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } -SerializableFunction JsonbExistsLogicalFunction::serialize() const { + +SerializableFunction JsonbExistsLogicalFunction::serialize() const +{ SerializableFunction proto; proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); - for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } return proto; } + LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterJsonbExistsLogicalFunction( LogicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.children.size()==2, + PRECONDITION(arguments.children.size() == 2, "JsonbExistsLogicalFunction requires 2 children but got {}", arguments.children.size()); - return JsonbExistsLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + return JsonbExistsLogicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/JsonbGeLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/JsonbGeLogicalFunction.cpp index b2c1034589..5b209580aa 100644 --- a/nes-logical-operators/src/Functions/Meos/JsonbGeLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/JsonbGeLogicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -25,51 +26,100 @@ namespace NES { -JsonbGeLogicalFunction::JsonbGeLogicalFunction(LogicalFunction jb1, LogicalFunction jb2) +JsonbGeLogicalFunction::JsonbGeLogicalFunction(LogicalFunction jb, + LogicalFunction arg0) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(2); - parameters.push_back(std::move(jb1)); - parameters.push_back(std::move(jb2)); + parameters.push_back(std::move(jb)); + parameters.push_back(std::move(arg0)); +} + +DataType JsonbGeLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction JsonbGeLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector JsonbGeLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction JsonbGeLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 2, "JsonbGeLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -DataType JsonbGeLogicalFunction::getDataType() const { return dataType; } -LogicalFunction JsonbGeLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } -std::vector JsonbGeLogicalFunction::getChildren() const { return parameters; } -LogicalFunction JsonbGeLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size()==2,"JsonbGeLogicalFunction requires 2 children, but got {}",children.size()); - auto c=*this; c.parameters=children; return c; + +std::string_view JsonbGeLogicalFunction::getType() const +{ + return NAME; } -std::string_view JsonbGeLogicalFunction::getType() const { return NAME; } -bool JsonbGeLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { - if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + +bool JsonbGeLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } return false; } -std::string JsonbGeLogicalFunction::explain(ExplainVerbosity v) const { - return fmt::format("{}({})",NAME,parameters[0].explain(v)); + +std::string JsonbGeLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } -LogicalFunction JsonbGeLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; c.reserve(2); - for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "jb1 must be VARSIZED"); - INVARIANT(c[1].getDataType().isType(DataType::Type::VARSIZED), "jb2 must be VARSIZED"); - return withChildren(c); + +LogicalFunction JsonbGeLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } -SerializableFunction JsonbGeLogicalFunction::serialize() const { + +SerializableFunction JsonbGeLogicalFunction::serialize() const +{ SerializableFunction proto; proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); - for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } return proto; } + LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterJsonbGeLogicalFunction( LogicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.children.size()==2, + PRECONDITION(arguments.children.size() == 2, "JsonbGeLogicalFunction requires 2 children but got {}", arguments.children.size()); - return JsonbGeLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + return JsonbGeLogicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/JsonbGtLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/JsonbGtLogicalFunction.cpp index 62fe716b3e..e183f0de19 100644 --- a/nes-logical-operators/src/Functions/Meos/JsonbGtLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/JsonbGtLogicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -25,51 +26,100 @@ namespace NES { -JsonbGtLogicalFunction::JsonbGtLogicalFunction(LogicalFunction jb1, LogicalFunction jb2) +JsonbGtLogicalFunction::JsonbGtLogicalFunction(LogicalFunction jb, + LogicalFunction arg0) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(2); - parameters.push_back(std::move(jb1)); - parameters.push_back(std::move(jb2)); + parameters.push_back(std::move(jb)); + parameters.push_back(std::move(arg0)); +} + +DataType JsonbGtLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction JsonbGtLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector JsonbGtLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction JsonbGtLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 2, "JsonbGtLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -DataType JsonbGtLogicalFunction::getDataType() const { return dataType; } -LogicalFunction JsonbGtLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } -std::vector JsonbGtLogicalFunction::getChildren() const { return parameters; } -LogicalFunction JsonbGtLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size()==2,"JsonbGtLogicalFunction requires 2 children, but got {}",children.size()); - auto c=*this; c.parameters=children; return c; + +std::string_view JsonbGtLogicalFunction::getType() const +{ + return NAME; } -std::string_view JsonbGtLogicalFunction::getType() const { return NAME; } -bool JsonbGtLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { - if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + +bool JsonbGtLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } return false; } -std::string JsonbGtLogicalFunction::explain(ExplainVerbosity v) const { - return fmt::format("{}({})",NAME,parameters[0].explain(v)); + +std::string JsonbGtLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } -LogicalFunction JsonbGtLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; c.reserve(2); - for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "jb1 must be VARSIZED"); - INVARIANT(c[1].getDataType().isType(DataType::Type::VARSIZED), "jb2 must be VARSIZED"); - return withChildren(c); + +LogicalFunction JsonbGtLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } -SerializableFunction JsonbGtLogicalFunction::serialize() const { + +SerializableFunction JsonbGtLogicalFunction::serialize() const +{ SerializableFunction proto; proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); - for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } return proto; } + LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterJsonbGtLogicalFunction( LogicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.children.size()==2, + PRECONDITION(arguments.children.size() == 2, "JsonbGtLogicalFunction requires 2 children but got {}", arguments.children.size()); - return JsonbGtLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + return JsonbGtLogicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/JsonbLeLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/JsonbLeLogicalFunction.cpp index 0eade1d471..2279ca5103 100644 --- a/nes-logical-operators/src/Functions/Meos/JsonbLeLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/JsonbLeLogicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -25,51 +26,100 @@ namespace NES { -JsonbLeLogicalFunction::JsonbLeLogicalFunction(LogicalFunction jb1, LogicalFunction jb2) +JsonbLeLogicalFunction::JsonbLeLogicalFunction(LogicalFunction jb, + LogicalFunction arg0) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(2); - parameters.push_back(std::move(jb1)); - parameters.push_back(std::move(jb2)); + parameters.push_back(std::move(jb)); + parameters.push_back(std::move(arg0)); +} + +DataType JsonbLeLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction JsonbLeLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector JsonbLeLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction JsonbLeLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 2, "JsonbLeLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -DataType JsonbLeLogicalFunction::getDataType() const { return dataType; } -LogicalFunction JsonbLeLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } -std::vector JsonbLeLogicalFunction::getChildren() const { return parameters; } -LogicalFunction JsonbLeLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size()==2,"JsonbLeLogicalFunction requires 2 children, but got {}",children.size()); - auto c=*this; c.parameters=children; return c; + +std::string_view JsonbLeLogicalFunction::getType() const +{ + return NAME; } -std::string_view JsonbLeLogicalFunction::getType() const { return NAME; } -bool JsonbLeLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { - if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + +bool JsonbLeLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } return false; } -std::string JsonbLeLogicalFunction::explain(ExplainVerbosity v) const { - return fmt::format("{}({})",NAME,parameters[0].explain(v)); + +std::string JsonbLeLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } -LogicalFunction JsonbLeLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; c.reserve(2); - for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "jb1 must be VARSIZED"); - INVARIANT(c[1].getDataType().isType(DataType::Type::VARSIZED), "jb2 must be VARSIZED"); - return withChildren(c); + +LogicalFunction JsonbLeLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } -SerializableFunction JsonbLeLogicalFunction::serialize() const { + +SerializableFunction JsonbLeLogicalFunction::serialize() const +{ SerializableFunction proto; proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); - for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } return proto; } + LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterJsonbLeLogicalFunction( LogicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.children.size()==2, + PRECONDITION(arguments.children.size() == 2, "JsonbLeLogicalFunction requires 2 children but got {}", arguments.children.size()); - return JsonbLeLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + return JsonbLeLogicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/JsonbLtLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/JsonbLtLogicalFunction.cpp index 6d3d008e2f..346db546fa 100644 --- a/nes-logical-operators/src/Functions/Meos/JsonbLtLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/JsonbLtLogicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -25,51 +26,100 @@ namespace NES { -JsonbLtLogicalFunction::JsonbLtLogicalFunction(LogicalFunction jb1, LogicalFunction jb2) +JsonbLtLogicalFunction::JsonbLtLogicalFunction(LogicalFunction jb, + LogicalFunction arg0) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(2); - parameters.push_back(std::move(jb1)); - parameters.push_back(std::move(jb2)); + parameters.push_back(std::move(jb)); + parameters.push_back(std::move(arg0)); +} + +DataType JsonbLtLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction JsonbLtLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector JsonbLtLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction JsonbLtLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 2, "JsonbLtLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -DataType JsonbLtLogicalFunction::getDataType() const { return dataType; } -LogicalFunction JsonbLtLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } -std::vector JsonbLtLogicalFunction::getChildren() const { return parameters; } -LogicalFunction JsonbLtLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size()==2,"JsonbLtLogicalFunction requires 2 children, but got {}",children.size()); - auto c=*this; c.parameters=children; return c; + +std::string_view JsonbLtLogicalFunction::getType() const +{ + return NAME; } -std::string_view JsonbLtLogicalFunction::getType() const { return NAME; } -bool JsonbLtLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { - if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + +bool JsonbLtLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } return false; } -std::string JsonbLtLogicalFunction::explain(ExplainVerbosity v) const { - return fmt::format("{}({})",NAME,parameters[0].explain(v)); + +std::string JsonbLtLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } -LogicalFunction JsonbLtLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; c.reserve(2); - for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "jb1 must be VARSIZED"); - INVARIANT(c[1].getDataType().isType(DataType::Type::VARSIZED), "jb2 must be VARSIZED"); - return withChildren(c); + +LogicalFunction JsonbLtLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } -SerializableFunction JsonbLtLogicalFunction::serialize() const { + +SerializableFunction JsonbLtLogicalFunction::serialize() const +{ SerializableFunction proto; proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); - for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } return proto; } + LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterJsonbLtLogicalFunction( LogicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.children.size()==2, + PRECONDITION(arguments.children.size() == 2, "JsonbLtLogicalFunction requires 2 children but got {}", arguments.children.size()); - return JsonbLtLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + return JsonbLtLogicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/JsonbNeLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/JsonbNeLogicalFunction.cpp index 3cf57efd86..9e4d098e22 100644 --- a/nes-logical-operators/src/Functions/Meos/JsonbNeLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/JsonbNeLogicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -25,51 +26,100 @@ namespace NES { -JsonbNeLogicalFunction::JsonbNeLogicalFunction(LogicalFunction jb1, LogicalFunction jb2) +JsonbNeLogicalFunction::JsonbNeLogicalFunction(LogicalFunction jb, + LogicalFunction arg0) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(2); - parameters.push_back(std::move(jb1)); - parameters.push_back(std::move(jb2)); + parameters.push_back(std::move(jb)); + parameters.push_back(std::move(arg0)); +} + +DataType JsonbNeLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction JsonbNeLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector JsonbNeLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction JsonbNeLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 2, "JsonbNeLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -DataType JsonbNeLogicalFunction::getDataType() const { return dataType; } -LogicalFunction JsonbNeLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } -std::vector JsonbNeLogicalFunction::getChildren() const { return parameters; } -LogicalFunction JsonbNeLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size()==2,"JsonbNeLogicalFunction requires 2 children, but got {}",children.size()); - auto c=*this; c.parameters=children; return c; + +std::string_view JsonbNeLogicalFunction::getType() const +{ + return NAME; } -std::string_view JsonbNeLogicalFunction::getType() const { return NAME; } -bool JsonbNeLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { - if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + +bool JsonbNeLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } return false; } -std::string JsonbNeLogicalFunction::explain(ExplainVerbosity v) const { - return fmt::format("{}({})",NAME,parameters[0].explain(v)); + +std::string JsonbNeLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } -LogicalFunction JsonbNeLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; c.reserve(2); - for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "jb1 must be VARSIZED"); - INVARIANT(c[1].getDataType().isType(DataType::Type::VARSIZED), "jb2 must be VARSIZED"); - return withChildren(c); + +LogicalFunction JsonbNeLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } -SerializableFunction JsonbNeLogicalFunction::serialize() const { + +SerializableFunction JsonbNeLogicalFunction::serialize() const +{ SerializableFunction proto; proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); - for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } return proto; } + LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterJsonbNeLogicalFunction( LogicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.children.size()==2, + PRECONDITION(arguments.children.size() == 2, "JsonbNeLogicalFunction requires 2 children but got {}", arguments.children.size()); - return JsonbNeLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + return JsonbNeLogicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/JsonbObjectFieldTextLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/JsonbObjectFieldTextLogicalFunction.cpp index bf42574906..ae77912c33 100644 --- a/nes-logical-operators/src/Functions/Meos/JsonbObjectFieldTextLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/JsonbObjectFieldTextLogicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -25,51 +26,100 @@ namespace NES { -JsonbObjectFieldTextLogicalFunction::JsonbObjectFieldTextLogicalFunction(LogicalFunction jb, LogicalFunction key) +JsonbObjectFieldTextLogicalFunction::JsonbObjectFieldTextLogicalFunction(LogicalFunction jb, + LogicalFunction arg0) : dataType(DataTypeProvider::provideDataType(DataType::Type::VARSIZED)) { parameters.reserve(2); parameters.push_back(std::move(jb)); - parameters.push_back(std::move(key)); + parameters.push_back(std::move(arg0)); +} + +DataType JsonbObjectFieldTextLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction JsonbObjectFieldTextLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector JsonbObjectFieldTextLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction JsonbObjectFieldTextLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 2, "JsonbObjectFieldTextLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -DataType JsonbObjectFieldTextLogicalFunction::getDataType() const { return dataType; } -LogicalFunction JsonbObjectFieldTextLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } -std::vector JsonbObjectFieldTextLogicalFunction::getChildren() const { return parameters; } -LogicalFunction JsonbObjectFieldTextLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size()==2,"JsonbObjectFieldTextLogicalFunction requires 2 children, but got {}",children.size()); - auto c=*this; c.parameters=children; return c; + +std::string_view JsonbObjectFieldTextLogicalFunction::getType() const +{ + return NAME; } -std::string_view JsonbObjectFieldTextLogicalFunction::getType() const { return NAME; } -bool JsonbObjectFieldTextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { - if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + +bool JsonbObjectFieldTextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } return false; } -std::string JsonbObjectFieldTextLogicalFunction::explain(ExplainVerbosity v) const { - return fmt::format("{}({})",NAME,parameters[0].explain(v)); + +std::string JsonbObjectFieldTextLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } -LogicalFunction JsonbObjectFieldTextLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; c.reserve(2); - for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "jb must be VARSIZED"); - INVARIANT(c[1].getDataType().isType(DataType::Type::VARSIZED), "key must be VARSIZED"); - return withChildren(c); + +LogicalFunction JsonbObjectFieldTextLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } -SerializableFunction JsonbObjectFieldTextLogicalFunction::serialize() const { + +SerializableFunction JsonbObjectFieldTextLogicalFunction::serialize() const +{ SerializableFunction proto; proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); - for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } return proto; } + LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterJsonbObjectFieldTextLogicalFunction( LogicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.children.size()==2, + PRECONDITION(arguments.children.size() == 2, "JsonbObjectFieldTextLogicalFunction requires 2 children but got {}", arguments.children.size()); - return JsonbObjectFieldTextLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + return JsonbObjectFieldTextLogicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/JsonbPrettyLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/JsonbPrettyLogicalFunction.cpp index 2c975d3cf3..bac2f957e4 100644 --- a/nes-logical-operators/src/Functions/Meos/JsonbPrettyLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/JsonbPrettyLogicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -31,42 +32,91 @@ JsonbPrettyLogicalFunction::JsonbPrettyLogicalFunction(LogicalFunction jb) parameters.reserve(1); parameters.push_back(std::move(jb)); } -DataType JsonbPrettyLogicalFunction::getDataType() const { return dataType; } -LogicalFunction JsonbPrettyLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } -std::vector JsonbPrettyLogicalFunction::getChildren() const { return parameters; } -LogicalFunction JsonbPrettyLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size()==1,"JsonbPrettyLogicalFunction requires 1 children, but got {}",children.size()); - auto c=*this; c.parameters=children; return c; + +DataType JsonbPrettyLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction JsonbPrettyLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector JsonbPrettyLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction JsonbPrettyLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 1, "JsonbPrettyLogicalFunction requires 1 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; +} + +std::string_view JsonbPrettyLogicalFunction::getType() const +{ + return NAME; } -std::string_view JsonbPrettyLogicalFunction::getType() const { return NAME; } -bool JsonbPrettyLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { - if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + +bool JsonbPrettyLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } return false; } -std::string JsonbPrettyLogicalFunction::explain(ExplainVerbosity v) const { - return fmt::format("{}({})",NAME,parameters[0].explain(v)); + +std::string JsonbPrettyLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } -LogicalFunction JsonbPrettyLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; c.reserve(1); - for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "jb must be VARSIZED"); - return withChildren(c); + +LogicalFunction JsonbPrettyLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } -SerializableFunction JsonbPrettyLogicalFunction::serialize() const { + +SerializableFunction JsonbPrettyLogicalFunction::serialize() const +{ SerializableFunction proto; proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); - for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } return proto; } + LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterJsonbPrettyLogicalFunction( LogicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.children.size()==1, + PRECONDITION(arguments.children.size() == 1, "JsonbPrettyLogicalFunction requires 1 children but got {}", arguments.children.size()); - return JsonbPrettyLogicalFunction( - std::move(arguments.children[0])); + auto arg0 = std::move(arguments.children[0]); + return JsonbPrettyLogicalFunction(std::move(arg0)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/JsonbToCstringLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/JsonbToCstringLogicalFunction.cpp index 0e4d672bc4..01c8445550 100644 --- a/nes-logical-operators/src/Functions/Meos/JsonbToCstringLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/JsonbToCstringLogicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -31,42 +32,91 @@ JsonbToCstringLogicalFunction::JsonbToCstringLogicalFunction(LogicalFunction jb) parameters.reserve(1); parameters.push_back(std::move(jb)); } -DataType JsonbToCstringLogicalFunction::getDataType() const { return dataType; } -LogicalFunction JsonbToCstringLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } -std::vector JsonbToCstringLogicalFunction::getChildren() const { return parameters; } -LogicalFunction JsonbToCstringLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size()==1,"JsonbToCstringLogicalFunction requires 1 children, but got {}",children.size()); - auto c=*this; c.parameters=children; return c; + +DataType JsonbToCstringLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction JsonbToCstringLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector JsonbToCstringLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction JsonbToCstringLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 1, "JsonbToCstringLogicalFunction requires 1 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; +} + +std::string_view JsonbToCstringLogicalFunction::getType() const +{ + return NAME; } -std::string_view JsonbToCstringLogicalFunction::getType() const { return NAME; } -bool JsonbToCstringLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { - if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + +bool JsonbToCstringLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } return false; } -std::string JsonbToCstringLogicalFunction::explain(ExplainVerbosity v) const { - return fmt::format("{}({})",NAME,parameters[0].explain(v)); + +std::string JsonbToCstringLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } -LogicalFunction JsonbToCstringLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; c.reserve(1); - for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "jb must be VARSIZED"); - return withChildren(c); + +LogicalFunction JsonbToCstringLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } -SerializableFunction JsonbToCstringLogicalFunction::serialize() const { + +SerializableFunction JsonbToCstringLogicalFunction::serialize() const +{ SerializableFunction proto; proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); - for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } return proto; } + LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterJsonbToCstringLogicalFunction( LogicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.children.size()==1, + PRECONDITION(arguments.children.size() == 1, "JsonbToCstringLogicalFunction requires 1 children but got {}", arguments.children.size()); - return JsonbToCstringLogicalFunction( - std::move(arguments.children[0])); + auto arg0 = std::move(arguments.children[0]); + return JsonbToCstringLogicalFunction(std::move(arg0)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/LineInterpolatePointLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/LineInterpolatePointLogicalFunction.cpp index 92f79d391a..8adae219bd 100644 --- a/nes-logical-operators/src/Functions/Meos/LineInterpolatePointLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/LineInterpolatePointLogicalFunction.cpp @@ -26,55 +26,77 @@ namespace NES { -LineInterpolatePointLogicalFunction::LineInterpolatePointLogicalFunction(LogicalFunction wkt, LogicalFunction frac, LogicalFunction repeat) +LineInterpolatePointLogicalFunction::LineInterpolatePointLogicalFunction(LogicalFunction wkt, + LogicalFunction arg0) : dataType(DataTypeProvider::provideDataType(DataType::Type::VARSIZED)) { - parameters.reserve(3); + parameters.reserve(2); parameters.push_back(std::move(wkt)); - parameters.push_back(std::move(frac)); - parameters.push_back(std::move(repeat)); + parameters.push_back(std::move(arg0)); } -DataType LineInterpolatePointLogicalFunction::getDataType() const { return dataType; } +DataType LineInterpolatePointLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction LineInterpolatePointLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector LineInterpolatePointLogicalFunction::getChildren() const { return parameters; } +std::vector LineInterpolatePointLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction LineInterpolatePointLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 3, - "LineInterpolatePointLogicalFunction requires 3 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 2, "LineInterpolatePointLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view LineInterpolatePointLogicalFunction::getType() const { return NAME; } +std::string_view LineInterpolatePointLogicalFunction::getType() const +{ + return NAME; +} bool LineInterpolatePointLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string LineInterpolatePointLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction LineInterpolatePointLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(3); - for (const auto& p : parameters) - c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "wkt must be VARSIZED"); - INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "frac must be FLOAT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "repeat must be UINT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction LineInterpolatePointLogicalFunction::serialize() const @@ -83,20 +105,21 @@ SerializableFunction LineInterpolatePointLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterLineInterpolatePointLogicalFunction( LogicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.children.size() == 3, - "LineInterpolatePointLogicalFunction requires 3 children but got {}", + PRECONDITION(arguments.children.size() == 2, + "LineInterpolatePointLogicalFunction requires 2 children but got {}", arguments.children.size()); - return LineInterpolatePointLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + return LineInterpolatePointLogicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/LineLocatePointLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/LineLocatePointLogicalFunction.cpp index 3140e7b1c5..cbcb8907e1 100644 --- a/nes-logical-operators/src/Functions/Meos/LineLocatePointLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/LineLocatePointLogicalFunction.cpp @@ -26,53 +26,77 @@ namespace NES { -LineLocatePointLogicalFunction::LineLocatePointLogicalFunction(LogicalFunction wkt1, LogicalFunction wkt2) +LineLocatePointLogicalFunction::LineLocatePointLogicalFunction(LogicalFunction wkt, + LogicalFunction arg0) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(2); - parameters.push_back(std::move(wkt1)); - parameters.push_back(std::move(wkt2)); + parameters.push_back(std::move(wkt)); + parameters.push_back(std::move(arg0)); } -DataType LineLocatePointLogicalFunction::getDataType() const { return dataType; } +DataType LineLocatePointLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction LineLocatePointLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector LineLocatePointLogicalFunction::getChildren() const { return parameters; } +std::vector LineLocatePointLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction LineLocatePointLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 2, - "LineLocatePointLogicalFunction requires 2 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 2, "LineLocatePointLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view LineLocatePointLogicalFunction::getType() const { return NAME; } +std::string_view LineLocatePointLogicalFunction::getType() const +{ + return NAME; +} bool LineLocatePointLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string LineLocatePointLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction LineLocatePointLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(2); - for (const auto& p : parameters) - c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "wkt1 must be VARSIZED"); - INVARIANT(c[1].getDataType().isType(DataType::Type::VARSIZED), "wkt2 must be VARSIZED"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction LineLocatePointLogicalFunction::serialize() const @@ -81,7 +105,9 @@ SerializableFunction LineLocatePointLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -91,9 +117,9 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterLin PRECONDITION(arguments.children.size() == 2, "LineLocatePointLogicalFunction requires 2 children but got {}", arguments.children.size()); - return LineLocatePointLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + return LineLocatePointLogicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/LineNumpointsLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/LineNumpointsLogicalFunction.cpp index 66ff6308ca..d365f979f4 100644 --- a/nes-logical-operators/src/Functions/Meos/LineNumpointsLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/LineNumpointsLogicalFunction.cpp @@ -33,44 +33,68 @@ LineNumpointsLogicalFunction::LineNumpointsLogicalFunction(LogicalFunction wkt) parameters.push_back(std::move(wkt)); } -DataType LineNumpointsLogicalFunction::getDataType() const { return dataType; } +DataType LineNumpointsLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction LineNumpointsLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector LineNumpointsLogicalFunction::getChildren() const { return parameters; } +std::vector LineNumpointsLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction LineNumpointsLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 1, - "LineNumpointsLogicalFunction requires 1 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 1, "LineNumpointsLogicalFunction requires 1 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view LineNumpointsLogicalFunction::getType() const { return NAME; } +std::string_view LineNumpointsLogicalFunction::getType() const +{ + return NAME; +} bool LineNumpointsLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string LineNumpointsLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction LineNumpointsLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(1); - for (const auto& p : parameters) - c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "wkt must be VARSIZED"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction LineNumpointsLogicalFunction::serialize() const @@ -79,7 +103,9 @@ SerializableFunction LineNumpointsLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -89,8 +115,8 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterLin PRECONDITION(arguments.children.size() == 1, "LineNumpointsLogicalFunction requires 1 children but got {}", arguments.children.size()); - return LineNumpointsLogicalFunction( - std::move(arguments.children[0])); + auto arg0 = std::move(arguments.children[0]); + return LineNumpointsLogicalFunction(std::move(arg0)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/LinePointNLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/LinePointNLogicalFunction.cpp index b91adbe8e7..113f036410 100644 --- a/nes-logical-operators/src/Functions/Meos/LinePointNLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/LinePointNLogicalFunction.cpp @@ -26,53 +26,77 @@ namespace NES { -LinePointNLogicalFunction::LinePointNLogicalFunction(LogicalFunction wkt, LogicalFunction n) +LinePointNLogicalFunction::LinePointNLogicalFunction(LogicalFunction wkt, + LogicalFunction arg0) : dataType(DataTypeProvider::provideDataType(DataType::Type::VARSIZED)) { parameters.reserve(2); parameters.push_back(std::move(wkt)); - parameters.push_back(std::move(n)); + parameters.push_back(std::move(arg0)); } -DataType LinePointNLogicalFunction::getDataType() const { return dataType; } +DataType LinePointNLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction LinePointNLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector LinePointNLogicalFunction::getChildren() const { return parameters; } +std::vector LinePointNLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction LinePointNLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 2, - "LinePointNLogicalFunction requires 2 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 2, "LinePointNLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view LinePointNLogicalFunction::getType() const { return NAME; } +std::string_view LinePointNLogicalFunction::getType() const +{ + return NAME; +} bool LinePointNLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string LinePointNLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction LinePointNLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(2); - for (const auto& p : parameters) - c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "wkt must be VARSIZED"); - INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "n must be UINT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction LinePointNLogicalFunction::serialize() const @@ -81,7 +105,9 @@ SerializableFunction LinePointNLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -91,9 +117,9 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterLin PRECONDITION(arguments.children.size() == 2, "LinePointNLogicalFunction requires 2 children but got {}", arguments.children.size()); - return LinePointNLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + return LinePointNLogicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/LineSubstringLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/LineSubstringLogicalFunction.cpp index a3fe7ed33d..2ec9e2bea3 100644 --- a/nes-logical-operators/src/Functions/Meos/LineSubstringLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/LineSubstringLogicalFunction.cpp @@ -26,55 +26,79 @@ namespace NES { -LineSubstringLogicalFunction::LineSubstringLogicalFunction(LogicalFunction wkt, LogicalFunction from_f, LogicalFunction to_f) +LineSubstringLogicalFunction::LineSubstringLogicalFunction(LogicalFunction wkt, + LogicalFunction arg0, + LogicalFunction arg1) : dataType(DataTypeProvider::provideDataType(DataType::Type::VARSIZED)) { parameters.reserve(3); parameters.push_back(std::move(wkt)); - parameters.push_back(std::move(from_f)); - parameters.push_back(std::move(to_f)); + parameters.push_back(std::move(arg0)); + parameters.push_back(std::move(arg1)); } -DataType LineSubstringLogicalFunction::getDataType() const { return dataType; } +DataType LineSubstringLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction LineSubstringLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector LineSubstringLogicalFunction::getChildren() const { return parameters; } +std::vector LineSubstringLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction LineSubstringLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 3, - "LineSubstringLogicalFunction requires 3 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 3, "LineSubstringLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view LineSubstringLogicalFunction::getType() const { return NAME; } +std::string_view LineSubstringLogicalFunction::getType() const +{ + return NAME; +} bool LineSubstringLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string LineSubstringLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction LineSubstringLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(3); - for (const auto& p : parameters) - c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "wkt must be VARSIZED"); - INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "from_f must be FLOAT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "to_f must be FLOAT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction LineSubstringLogicalFunction::serialize() const @@ -83,7 +107,9 @@ SerializableFunction LineSubstringLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -93,10 +119,10 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterLin PRECONDITION(arguments.children.size() == 3, "LineSubstringLogicalFunction requires 3 children but got {}", arguments.children.size()); - return LineSubstringLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return LineSubstringLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/MindistanceTcbufferTcbufferLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/MindistanceTcbufferTcbufferLogicalFunction.cpp index 280265eb0f..044093d6ac 100644 --- a/nes-logical-operators/src/Functions/Meos/MindistanceTcbufferTcbufferLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/MindistanceTcbufferTcbufferLogicalFunction.cpp @@ -26,70 +26,91 @@ namespace NES { -MindistanceTcbufferTcbufferLogicalFunction::MindistanceTcbufferTcbufferLogicalFunction( - LogicalFunction lon1, LogicalFunction lat1, LogicalFunction r1, LogicalFunction ts1, - LogicalFunction lon2, LogicalFunction lat2, LogicalFunction r2, LogicalFunction ts2, - LogicalFunction dist) +MindistanceTcbufferTcbufferLogicalFunction::MindistanceTcbufferTcbufferLogicalFunction(LogicalFunction lonA, + LogicalFunction latA, + LogicalFunction radiusA, + LogicalFunction tsA, + LogicalFunction lonB, + LogicalFunction latB, + LogicalFunction radiusB, + LogicalFunction tsB, + LogicalFunction dist) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(9); - parameters.push_back(std::move(lon1)); - parameters.push_back(std::move(lat1)); - parameters.push_back(std::move(r1)); - parameters.push_back(std::move(ts1)); - parameters.push_back(std::move(lon2)); - parameters.push_back(std::move(lat2)); - parameters.push_back(std::move(r2)); - parameters.push_back(std::move(ts2)); + parameters.push_back(std::move(lonA)); + parameters.push_back(std::move(latA)); + parameters.push_back(std::move(radiusA)); + parameters.push_back(std::move(tsA)); + parameters.push_back(std::move(lonB)); + parameters.push_back(std::move(latB)); + parameters.push_back(std::move(radiusB)); + parameters.push_back(std::move(tsB)); parameters.push_back(std::move(dist)); } -DataType MindistanceTcbufferTcbufferLogicalFunction::getDataType() const { return dataType; } +DataType MindistanceTcbufferTcbufferLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction MindistanceTcbufferTcbufferLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector MindistanceTcbufferTcbufferLogicalFunction::getChildren() const { return parameters; } +std::vector MindistanceTcbufferTcbufferLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction MindistanceTcbufferTcbufferLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 9, - "MindistanceTcbufferTcbufferLogicalFunction requires 9 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 9, "MindistanceTcbufferTcbufferLogicalFunction requires 9 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view MindistanceTcbufferTcbufferLogicalFunction::getType() const { return NAME; } +std::string_view MindistanceTcbufferTcbufferLogicalFunction::getType() const +{ + return NAME; +} bool MindistanceTcbufferTcbufferLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string MindistanceTcbufferTcbufferLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction MindistanceTcbufferTcbufferLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(9); - for (const auto& p : parameters) - c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon1 must be FLOAT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat1 must be FLOAT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "r1 must be FLOAT64"); - INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); - INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "lon2 must be FLOAT64"); - INVARIANT(c[5].getDataType().isType(DataType::Type::FLOAT64), "lat2 must be FLOAT64"); - INVARIANT(c[6].getDataType().isType(DataType::Type::FLOAT64), "r2 must be FLOAT64"); - INVARIANT(c[7].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); - INVARIANT(c[8].getDataType().isType(DataType::Type::FLOAT64), "dist must be FLOAT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction MindistanceTcbufferTcbufferLogicalFunction::serialize() const @@ -98,7 +119,9 @@ SerializableFunction MindistanceTcbufferTcbufferLogicalFunction::serialize() con proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -108,15 +131,16 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterMin PRECONDITION(arguments.children.size() == 9, "MindistanceTcbufferTcbufferLogicalFunction requires 9 children but got {}", arguments.children.size()); - return MindistanceTcbufferTcbufferLogicalFunction(std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2]), - std::move(arguments.children[3]), - std::move(arguments.children[4]), - std::move(arguments.children[5]), - std::move(arguments.children[6]), - std::move(arguments.children[7]), - std::move(arguments.children[8])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + auto arg5 = std::move(arguments.children[5]); + auto arg6 = std::move(arguments.children[6]); + auto arg7 = std::move(arguments.children[7]); + auto arg8 = std::move(arguments.children[8]); + return MindistanceTcbufferTcbufferLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6), std::move(arg7), std::move(arg8)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/MulBigintTbigintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/MulBigintTbigintLogicalFunction.cpp index 97c43c36c7..59e436d5f5 100644 --- a/nes-logical-operators/src/Functions/Meos/MulBigintTbigintLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/MulBigintTbigintLogicalFunction.cpp @@ -26,46 +26,65 @@ namespace NES { -MulBigintTbigintLogicalFunction::MulBigintTbigintLogicalFunction(LogicalFunction scalar, - LogicalFunction value, - LogicalFunction ts) +MulBigintTbigintLogicalFunction::MulBigintTbigintLogicalFunction(LogicalFunction arg0, + LogicalFunction value, + LogicalFunction ts) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(3); - parameters.push_back(std::move(scalar)); + parameters.push_back(std::move(arg0)); parameters.push_back(std::move(value)); parameters.push_back(std::move(ts)); } -DataType MulBigintTbigintLogicalFunction::getDataType() const { return dataType; } +DataType MulBigintTbigintLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction MulBigintTbigintLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector MulBigintTbigintLogicalFunction::getChildren() const { return parameters; } +std::vector MulBigintTbigintLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction MulBigintTbigintLogicalFunction::withChildren(const std::vector& children) const { PRECONDITION(children.size() == 3, "MulBigintTbigintLogicalFunction requires 3 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view MulBigintTbigintLogicalFunction::getType() const { return NAME; } +std::string_view MulBigintTbigintLogicalFunction::getType() const +{ + return NAME; +} bool MulBigintTbigintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string MulBigintTbigintLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -76,7 +95,9 @@ LogicalFunction MulBigintTbigintLogicalFunction::withInferredDataType(const Sche std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -86,7 +107,9 @@ SerializableFunction MulBigintTbigintLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } diff --git a/nes-logical-operators/src/Functions/Meos/MulFloatTfloatLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/MulFloatTfloatLogicalFunction.cpp index 7a38b56a88..c4e341db57 100644 --- a/nes-logical-operators/src/Functions/Meos/MulFloatTfloatLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/MulFloatTfloatLogicalFunction.cpp @@ -26,46 +26,65 @@ namespace NES { -MulFloatTfloatLogicalFunction::MulFloatTfloatLogicalFunction(LogicalFunction scalar, - LogicalFunction value, - LogicalFunction ts) +MulFloatTfloatLogicalFunction::MulFloatTfloatLogicalFunction(LogicalFunction arg0, + LogicalFunction value, + LogicalFunction ts) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(3); - parameters.push_back(std::move(scalar)); + parameters.push_back(std::move(arg0)); parameters.push_back(std::move(value)); parameters.push_back(std::move(ts)); } -DataType MulFloatTfloatLogicalFunction::getDataType() const { return dataType; } +DataType MulFloatTfloatLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction MulFloatTfloatLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector MulFloatTfloatLogicalFunction::getChildren() const { return parameters; } +std::vector MulFloatTfloatLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction MulFloatTfloatLogicalFunction::withChildren(const std::vector& children) const { PRECONDITION(children.size() == 3, "MulFloatTfloatLogicalFunction requires 3 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view MulFloatTfloatLogicalFunction::getType() const { return NAME; } +std::string_view MulFloatTfloatLogicalFunction::getType() const +{ + return NAME; +} bool MulFloatTfloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string MulFloatTfloatLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -76,7 +95,9 @@ LogicalFunction MulFloatTfloatLogicalFunction::withInferredDataType(const Schema std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -86,7 +107,9 @@ SerializableFunction MulFloatTfloatLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } diff --git a/nes-logical-operators/src/Functions/Meos/MulIntTintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/MulIntTintLogicalFunction.cpp index 6b5cc688ee..240c98e62f 100644 --- a/nes-logical-operators/src/Functions/Meos/MulIntTintLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/MulIntTintLogicalFunction.cpp @@ -26,46 +26,65 @@ namespace NES { -MulIntTintLogicalFunction::MulIntTintLogicalFunction(LogicalFunction scalar, - LogicalFunction value, - LogicalFunction ts) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +MulIntTintLogicalFunction::MulIntTintLogicalFunction(LogicalFunction arg0, + LogicalFunction value, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) { parameters.reserve(3); - parameters.push_back(std::move(scalar)); + parameters.push_back(std::move(arg0)); parameters.push_back(std::move(value)); parameters.push_back(std::move(ts)); } -DataType MulIntTintLogicalFunction::getDataType() const { return dataType; } +DataType MulIntTintLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction MulIntTintLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector MulIntTintLogicalFunction::getChildren() const { return parameters; } +std::vector MulIntTintLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction MulIntTintLogicalFunction::withChildren(const std::vector& children) const { PRECONDITION(children.size() == 3, "MulIntTintLogicalFunction requires 3 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view MulIntTintLogicalFunction::getType() const { return NAME; } +std::string_view MulIntTintLogicalFunction::getType() const +{ + return NAME; +} bool MulIntTintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string MulIntTintLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -76,7 +95,9 @@ LogicalFunction MulIntTintLogicalFunction::withInferredDataType(const Schema& sc std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -86,7 +107,9 @@ SerializableFunction MulIntTintLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } diff --git a/nes-logical-operators/src/Functions/Meos/MulTbigintBigintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/MulTbigintBigintLogicalFunction.cpp index 0d1e68e0d1..a342ef8f47 100644 --- a/nes-logical-operators/src/Functions/Meos/MulTbigintBigintLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/MulTbigintBigintLogicalFunction.cpp @@ -27,45 +27,64 @@ namespace NES { MulTbigintBigintLogicalFunction::MulTbigintBigintLogicalFunction(LogicalFunction value, - LogicalFunction ts, - LogicalFunction factor) + LogicalFunction ts, + LogicalFunction arg0) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(3); parameters.push_back(std::move(value)); parameters.push_back(std::move(ts)); - parameters.push_back(std::move(factor)); + parameters.push_back(std::move(arg0)); } -DataType MulTbigintBigintLogicalFunction::getDataType() const { return dataType; } +DataType MulTbigintBigintLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction MulTbigintBigintLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector MulTbigintBigintLogicalFunction::getChildren() const { return parameters; } +std::vector MulTbigintBigintLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction MulTbigintBigintLogicalFunction::withChildren(const std::vector& children) const { PRECONDITION(children.size() == 3, "MulTbigintBigintLogicalFunction requires 3 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view MulTbigintBigintLogicalFunction::getType() const { return NAME; } +std::string_view MulTbigintBigintLogicalFunction::getType() const +{ + return NAME; +} bool MulTbigintBigintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string MulTbigintBigintLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -76,7 +95,9 @@ LogicalFunction MulTbigintBigintLogicalFunction::withInferredDataType(const Sche std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -86,7 +107,9 @@ SerializableFunction MulTbigintBigintLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } diff --git a/nes-logical-operators/src/Functions/Meos/MulTfloatFloatLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/MulTfloatFloatLogicalFunction.cpp index c28dba03cf..823c1f66b3 100644 --- a/nes-logical-operators/src/Functions/Meos/MulTfloatFloatLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/MulTfloatFloatLogicalFunction.cpp @@ -27,45 +27,64 @@ namespace NES { MulTfloatFloatLogicalFunction::MulTfloatFloatLogicalFunction(LogicalFunction value, - LogicalFunction ts, - LogicalFunction factor) + LogicalFunction ts, + LogicalFunction arg0) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(3); parameters.push_back(std::move(value)); parameters.push_back(std::move(ts)); - parameters.push_back(std::move(factor)); + parameters.push_back(std::move(arg0)); } -DataType MulTfloatFloatLogicalFunction::getDataType() const { return dataType; } +DataType MulTfloatFloatLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction MulTfloatFloatLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector MulTfloatFloatLogicalFunction::getChildren() const { return parameters; } +std::vector MulTfloatFloatLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction MulTfloatFloatLogicalFunction::withChildren(const std::vector& children) const { PRECONDITION(children.size() == 3, "MulTfloatFloatLogicalFunction requires 3 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view MulTfloatFloatLogicalFunction::getType() const { return NAME; } +std::string_view MulTfloatFloatLogicalFunction::getType() const +{ + return NAME; +} bool MulTfloatFloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string MulTfloatFloatLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -76,7 +95,9 @@ LogicalFunction MulTfloatFloatLogicalFunction::withInferredDataType(const Schema std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -86,7 +107,9 @@ SerializableFunction MulTfloatFloatLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } diff --git a/nes-logical-operators/src/Functions/Meos/MulTintIntLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/MulTintIntLogicalFunction.cpp index e973fe3aa8..51629ab3e6 100644 --- a/nes-logical-operators/src/Functions/Meos/MulTintIntLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/MulTintIntLogicalFunction.cpp @@ -27,45 +27,64 @@ namespace NES { MulTintIntLogicalFunction::MulTintIntLogicalFunction(LogicalFunction value, - LogicalFunction ts, - LogicalFunction multiplier) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) + LogicalFunction ts, + LogicalFunction arg0) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) { parameters.reserve(3); parameters.push_back(std::move(value)); parameters.push_back(std::move(ts)); - parameters.push_back(std::move(multiplier)); + parameters.push_back(std::move(arg0)); } -DataType MulTintIntLogicalFunction::getDataType() const { return dataType; } +DataType MulTintIntLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction MulTintIntLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector MulTintIntLogicalFunction::getChildren() const { return parameters; } +std::vector MulTintIntLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction MulTintIntLogicalFunction::withChildren(const std::vector& children) const { PRECONDITION(children.size() == 3, "MulTintIntLogicalFunction requires 3 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view MulTintIntLogicalFunction::getType() const { return NAME; } +std::string_view MulTintIntLogicalFunction::getType() const +{ + return NAME; +} bool MulTintIntLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string MulTintIntLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -76,7 +95,9 @@ LogicalFunction MulTintIntLogicalFunction::withInferredDataType(const Schema& sc std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -86,7 +107,9 @@ SerializableFunction MulTintIntLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } diff --git a/nes-logical-operators/src/Functions/Meos/MulTnumberTnumberLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/MulTnumberTnumberLogicalFunction.cpp index 9d5d5fa562..21bed7eb8f 100644 --- a/nes-logical-operators/src/Functions/Meos/MulTnumberTnumberLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/MulTnumberTnumberLogicalFunction.cpp @@ -26,46 +26,63 @@ namespace NES { -MulTnumberTnumberLogicalFunction::MulTnumberTnumberLogicalFunction(LogicalFunction value1, - LogicalFunction value2, - LogicalFunction ts) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +MulTnumberTnumberLogicalFunction::MulTnumberTnumberLogicalFunction(LogicalFunction traj, + LogicalFunction arg0) + : dataType(DataTypeProvider::provideDataType(DataType::Type::VARSIZED)) { - parameters.reserve(3); - parameters.push_back(std::move(value1)); - parameters.push_back(std::move(value2)); - parameters.push_back(std::move(ts)); + parameters.reserve(2); + parameters.push_back(std::move(traj)); + parameters.push_back(std::move(arg0)); } -DataType MulTnumberTnumberLogicalFunction::getDataType() const { return dataType; } +DataType MulTnumberTnumberLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction MulTnumberTnumberLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector MulTnumberTnumberLogicalFunction::getChildren() const { return parameters; } +std::vector MulTnumberTnumberLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction MulTnumberTnumberLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 3, "MulTnumberTnumberLogicalFunction requires 3 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 2, "MulTnumberTnumberLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view MulTnumberTnumberLogicalFunction::getType() const { return NAME; } +std::string_view MulTnumberTnumberLogicalFunction::getType() const +{ + return NAME; +} bool MulTnumberTnumberLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string MulTnumberTnumberLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -76,7 +93,9 @@ LogicalFunction MulTnumberTnumberLogicalFunction::withInferredDataType(const Sch std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -86,20 +105,21 @@ SerializableFunction MulTnumberTnumberLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterMulTnumberTnumberLogicalFunction( LogicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.children.size() == 3, - "MulTnumberTnumberLogicalFunction requires 3 children but got {}", + PRECONDITION(arguments.children.size() == 2, + "MulTnumberTnumberLogicalFunction requires 2 children but got {}", arguments.children.size()); auto arg0 = std::move(arguments.children[0]); auto arg1 = std::move(arguments.children[1]); - auto arg2 = std::move(arguments.children[2]); - return MulTnumberTnumberLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); + return MulTnumberTnumberLogicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/NadTcbufferGeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/NadTcbufferGeoLogicalFunction.cpp index 678ff7cebb..c3e3b62f5f 100644 --- a/nes-logical-operators/src/Functions/Meos/NadTcbufferGeoLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/NadTcbufferGeoLogicalFunction.cpp @@ -26,64 +26,83 @@ namespace NES { -NadTcbufferGeoLogicalFunction::NadTcbufferGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, - LogicalFunction radius, LogicalFunction ts, - LogicalFunction wkt) +NadTcbufferGeoLogicalFunction::NadTcbufferGeoLogicalFunction(LogicalFunction lon, + LogicalFunction lat, + LogicalFunction radius, + LogicalFunction timestamp, + LogicalFunction geometry) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(5); parameters.push_back(std::move(lon)); parameters.push_back(std::move(lat)); parameters.push_back(std::move(radius)); - parameters.push_back(std::move(ts)); - parameters.push_back(std::move(wkt)); + parameters.push_back(std::move(timestamp)); + parameters.push_back(std::move(geometry)); } -DataType NadTcbufferGeoLogicalFunction::getDataType() const { return dataType; } +DataType NadTcbufferGeoLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction NadTcbufferGeoLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector NadTcbufferGeoLogicalFunction::getChildren() const { return parameters; } +std::vector NadTcbufferGeoLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction NadTcbufferGeoLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 5, - "NadTcbufferGeoLogicalFunction requires 5 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 5, "NadTcbufferGeoLogicalFunction requires 5 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view NadTcbufferGeoLogicalFunction::getType() const { return NAME; } +std::string_view NadTcbufferGeoLogicalFunction::getType() const +{ + return NAME; +} bool NadTcbufferGeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string NadTcbufferGeoLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction NadTcbufferGeoLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(5); - c.emplace_back(parameters[0].withInferredDataType(schema)); - c.emplace_back(parameters[1].withInferredDataType(schema)); - c.emplace_back(parameters[2].withInferredDataType(schema)); - c.emplace_back(parameters[3].withInferredDataType(schema)); - c.emplace_back(parameters[4].withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon must be FLOAT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat must be FLOAT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "radius must be FLOAT64"); - INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); - INVARIANT(c[4].getDataType().isType(DataType::Type::VARSIZED), "wkt must be VARCHAR"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction NadTcbufferGeoLogicalFunction::serialize() const @@ -92,7 +111,9 @@ SerializableFunction NadTcbufferGeoLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -102,11 +123,12 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterNad PRECONDITION(arguments.children.size() == 5, "NadTcbufferGeoLogicalFunction requires 5 children but got {}", arguments.children.size()); - return NadTcbufferGeoLogicalFunction(std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2]), - std::move(arguments.children[3]), - std::move(arguments.children[4])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + return NadTcbufferGeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/NadTcbufferTcbufferLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/NadTcbufferTcbufferLogicalFunction.cpp index abf97eb658..02cb68de12 100644 --- a/nes-logical-operators/src/Functions/Meos/NadTcbufferTcbufferLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/NadTcbufferTcbufferLogicalFunction.cpp @@ -26,67 +26,89 @@ namespace NES { -NadTcbufferTcbufferLogicalFunction::NadTcbufferTcbufferLogicalFunction( - LogicalFunction lon1, LogicalFunction lat1, LogicalFunction r1, LogicalFunction ts1, - LogicalFunction lon2, LogicalFunction lat2, LogicalFunction r2, LogicalFunction ts2) +NadTcbufferTcbufferLogicalFunction::NadTcbufferTcbufferLogicalFunction(LogicalFunction lonA, + LogicalFunction latA, + LogicalFunction radiusA, + LogicalFunction tsA, + LogicalFunction lonB, + LogicalFunction latB, + LogicalFunction radiusB, + LogicalFunction tsB) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(8); - parameters.push_back(std::move(lon1)); - parameters.push_back(std::move(lat1)); - parameters.push_back(std::move(r1)); - parameters.push_back(std::move(ts1)); - parameters.push_back(std::move(lon2)); - parameters.push_back(std::move(lat2)); - parameters.push_back(std::move(r2)); - parameters.push_back(std::move(ts2)); + parameters.push_back(std::move(lonA)); + parameters.push_back(std::move(latA)); + parameters.push_back(std::move(radiusA)); + parameters.push_back(std::move(tsA)); + parameters.push_back(std::move(lonB)); + parameters.push_back(std::move(latB)); + parameters.push_back(std::move(radiusB)); + parameters.push_back(std::move(tsB)); } -DataType NadTcbufferTcbufferLogicalFunction::getDataType() const { return dataType; } +DataType NadTcbufferTcbufferLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction NadTcbufferTcbufferLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector NadTcbufferTcbufferLogicalFunction::getChildren() const { return parameters; } +std::vector NadTcbufferTcbufferLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction NadTcbufferTcbufferLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 8, - "NadTcbufferTcbufferLogicalFunction requires 8 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 8, "NadTcbufferTcbufferLogicalFunction requires 8 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view NadTcbufferTcbufferLogicalFunction::getType() const { return NAME; } +std::string_view NadTcbufferTcbufferLogicalFunction::getType() const +{ + return NAME; +} bool NadTcbufferTcbufferLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string NadTcbufferTcbufferLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction NadTcbufferTcbufferLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(8); - for (const auto& p : parameters) - c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon1 must be FLOAT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat1 must be FLOAT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "r1 must be FLOAT64"); - INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); - INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "lon2 must be FLOAT64"); - INVARIANT(c[5].getDataType().isType(DataType::Type::FLOAT64), "lat2 must be FLOAT64"); - INVARIANT(c[6].getDataType().isType(DataType::Type::FLOAT64), "r2 must be FLOAT64"); - INVARIANT(c[7].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction NadTcbufferTcbufferLogicalFunction::serialize() const @@ -95,7 +117,9 @@ SerializableFunction NadTcbufferTcbufferLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -105,14 +129,15 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterNad PRECONDITION(arguments.children.size() == 8, "NadTcbufferTcbufferLogicalFunction requires 8 children but got {}", arguments.children.size()); - return NadTcbufferTcbufferLogicalFunction(std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2]), - std::move(arguments.children[3]), - std::move(arguments.children[4]), - std::move(arguments.children[5]), - std::move(arguments.children[6]), - std::move(arguments.children[7])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + auto arg5 = std::move(arguments.children[5]); + auto arg6 = std::move(arguments.children[6]); + auto arg7 = std::move(arguments.children[7]); + return NadTcbufferTcbufferLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6), std::move(arg7)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/NadTgeoGeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/NadTgeoGeoLogicalFunction.cpp index 406db3c77f..a7f622f340 100644 --- a/nes-logical-operators/src/Functions/Meos/NadTgeoGeoLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/NadTgeoGeoLogicalFunction.cpp @@ -26,60 +26,81 @@ namespace NES { -NadTgeoGeoLogicalFunction::NadTgeoGeoLogicalFunction(LogicalFunction lon, LogicalFunction lat, - LogicalFunction ts, LogicalFunction wkt) +NadTgeoGeoLogicalFunction::NadTgeoGeoLogicalFunction(LogicalFunction lon, + LogicalFunction lat, + LogicalFunction timestamp, + LogicalFunction geometry) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(4); parameters.push_back(std::move(lon)); parameters.push_back(std::move(lat)); - parameters.push_back(std::move(ts)); - parameters.push_back(std::move(wkt)); + parameters.push_back(std::move(timestamp)); + parameters.push_back(std::move(geometry)); } -DataType NadTgeoGeoLogicalFunction::getDataType() const { return dataType; } +DataType NadTgeoGeoLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction NadTgeoGeoLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector NadTgeoGeoLogicalFunction::getChildren() const { return parameters; } +std::vector NadTgeoGeoLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction NadTgeoGeoLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 4, - "NadTgeoGeoLogicalFunction requires 4 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 4, "NadTgeoGeoLogicalFunction requires 4 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view NadTgeoGeoLogicalFunction::getType() const { return NAME; } +std::string_view NadTgeoGeoLogicalFunction::getType() const +{ + return NAME; +} bool NadTgeoGeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string NadTgeoGeoLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction NadTgeoGeoLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(4); - c.emplace_back(parameters[0].withInferredDataType(schema)); - c.emplace_back(parameters[1].withInferredDataType(schema)); - c.emplace_back(parameters[2].withInferredDataType(schema)); - c.emplace_back(parameters[3].withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon must be FLOAT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat must be FLOAT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); - INVARIANT(c[3].getDataType().isType(DataType::Type::VARSIZED),"wkt must be VARSIZED"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction NadTgeoGeoLogicalFunction::serialize() const @@ -88,7 +109,9 @@ SerializableFunction NadTgeoGeoLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -98,10 +121,11 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterNad PRECONDITION(arguments.children.size() == 4, "NadTgeoGeoLogicalFunction requires 4 children but got {}", arguments.children.size()); - return NadTgeoGeoLogicalFunction(std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2]), - std::move(arguments.children[3])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + return NadTgeoGeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/NadTgeoTgeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/NadTgeoTgeoLogicalFunction.cpp new file mode 100644 index 0000000000..74f796d654 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/NadTgeoTgeoLogicalFunction.cpp @@ -0,0 +1,137 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +NadTgeoTgeoLogicalFunction::NadTgeoTgeoLogicalFunction(LogicalFunction lonA, + LogicalFunction latA, + LogicalFunction tsA, + LogicalFunction lonB, + LogicalFunction latB, + LogicalFunction tsB) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(6); + parameters.push_back(std::move(lonA)); + parameters.push_back(std::move(latA)); + parameters.push_back(std::move(tsA)); + parameters.push_back(std::move(lonB)); + parameters.push_back(std::move(latB)); + parameters.push_back(std::move(tsB)); +} + +DataType NadTgeoTgeoLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction NadTgeoTgeoLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector NadTgeoTgeoLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction NadTgeoTgeoLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 6, "NadTgeoTgeoLogicalFunction requires 6 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; +} + +std::string_view NadTgeoTgeoLogicalFunction::getType() const +{ + return NAME; +} + +bool NadTgeoTgeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } + return false; +} + +std::string NadTgeoTgeoLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction NadTgeoTgeoLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); +} + +SerializableFunction NadTgeoTgeoLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterNadTgeoTgeoLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 6, + "NadTgeoTgeoLogicalFunction requires 6 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + auto arg5 = std::move(arguments.children[5]); + return NadTgeoTgeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/NadTnpointGeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/NadTnpointGeoLogicalFunction.cpp index 86e022e4a7..06a925b27e 100644 --- a/nes-logical-operators/src/Functions/Meos/NadTnpointGeoLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/NadTnpointGeoLogicalFunction.cpp @@ -26,57 +26,81 @@ namespace NES { -NadTnpointGeoLogicalFunction::NadTnpointGeoLogicalFunction(LogicalFunction rid, LogicalFunction pos, LogicalFunction ts, LogicalFunction wkt) +NadTnpointGeoLogicalFunction::NadTnpointGeoLogicalFunction(LogicalFunction rid, + LogicalFunction frac, + LogicalFunction ts, + LogicalFunction arg0) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(4); parameters.push_back(std::move(rid)); - parameters.push_back(std::move(pos)); + parameters.push_back(std::move(frac)); parameters.push_back(std::move(ts)); - parameters.push_back(std::move(wkt)); + parameters.push_back(std::move(arg0)); } -DataType NadTnpointGeoLogicalFunction::getDataType() const { return dataType; } +DataType NadTnpointGeoLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction NadTnpointGeoLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector NadTnpointGeoLogicalFunction::getChildren() const { return parameters; } +std::vector NadTnpointGeoLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction NadTnpointGeoLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 4, - "NadTnpointGeoLogicalFunction requires 4 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 4, "NadTnpointGeoLogicalFunction requires 4 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view NadTnpointGeoLogicalFunction::getType() const { return NAME; } +std::string_view NadTnpointGeoLogicalFunction::getType() const +{ + return NAME; +} bool NadTnpointGeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string NadTnpointGeoLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction NadTnpointGeoLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(4); - for (const auto& p : parameters) - c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "rid must be UINT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "pos must be FLOAT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); - INVARIANT(c[3].getDataType().isType(DataType::Type::VARSIZED), "wkt must be VARSIZED"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction NadTnpointGeoLogicalFunction::serialize() const @@ -85,7 +109,9 @@ SerializableFunction NadTnpointGeoLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -95,11 +121,11 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterNad PRECONDITION(arguments.children.size() == 4, "NadTnpointGeoLogicalFunction requires 4 children but got {}", arguments.children.size()); - return NadTnpointGeoLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2]), - std::move(arguments.children[3])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + return NadTnpointGeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/NadTnpointNpointLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/NadTnpointNpointLogicalFunction.cpp index 4b74567379..e4dea05c39 100644 --- a/nes-logical-operators/src/Functions/Meos/NadTnpointNpointLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/NadTnpointNpointLogicalFunction.cpp @@ -26,59 +26,83 @@ namespace NES { -NadTnpointNpointLogicalFunction::NadTnpointNpointLogicalFunction(LogicalFunction rid1, LogicalFunction pos1, LogicalFunction ts, LogicalFunction rid2, LogicalFunction pos2) +NadTnpointNpointLogicalFunction::NadTnpointNpointLogicalFunction(LogicalFunction rid, + LogicalFunction frac, + LogicalFunction ts, + LogicalFunction rid0, + LogicalFunction frac0) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(5); - parameters.push_back(std::move(rid1)); - parameters.push_back(std::move(pos1)); + parameters.push_back(std::move(rid)); + parameters.push_back(std::move(frac)); parameters.push_back(std::move(ts)); - parameters.push_back(std::move(rid2)); - parameters.push_back(std::move(pos2)); + parameters.push_back(std::move(rid0)); + parameters.push_back(std::move(frac0)); } -DataType NadTnpointNpointLogicalFunction::getDataType() const { return dataType; } +DataType NadTnpointNpointLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction NadTnpointNpointLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector NadTnpointNpointLogicalFunction::getChildren() const { return parameters; } +std::vector NadTnpointNpointLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction NadTnpointNpointLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 5, - "NadTnpointNpointLogicalFunction requires 5 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 5, "NadTnpointNpointLogicalFunction requires 5 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view NadTnpointNpointLogicalFunction::getType() const { return NAME; } +std::string_view NadTnpointNpointLogicalFunction::getType() const +{ + return NAME; +} bool NadTnpointNpointLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string NadTnpointNpointLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction NadTnpointNpointLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(5); - for (const auto& p : parameters) - c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "rid1 must be UINT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "pos1 must be FLOAT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); - INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "rid2 must be UINT64"); - INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "pos2 must be FLOAT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction NadTnpointNpointLogicalFunction::serialize() const @@ -87,7 +111,9 @@ SerializableFunction NadTnpointNpointLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -97,12 +123,12 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterNad PRECONDITION(arguments.children.size() == 5, "NadTnpointNpointLogicalFunction requires 5 children but got {}", arguments.children.size()); - return NadTnpointNpointLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2]), - std::move(arguments.children[3]), - std::move(arguments.children[4])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + return NadTnpointNpointLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/NadTnpointTnpointLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/NadTnpointTnpointLogicalFunction.cpp index 64a45be719..cd7452a240 100644 --- a/nes-logical-operators/src/Functions/Meos/NadTnpointTnpointLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/NadTnpointTnpointLogicalFunction.cpp @@ -26,63 +26,85 @@ namespace NES { -NadTnpointTnpointLogicalFunction::NadTnpointTnpointLogicalFunction( - LogicalFunction rid1, LogicalFunction pos1, LogicalFunction ts1, - LogicalFunction rid2, LogicalFunction pos2, LogicalFunction ts2) +NadTnpointTnpointLogicalFunction::NadTnpointTnpointLogicalFunction(LogicalFunction rid, + LogicalFunction frac, + LogicalFunction ts, + LogicalFunction rid0, + LogicalFunction frac0, + LogicalFunction ts0) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(6); - parameters.push_back(std::move(rid1)); - parameters.push_back(std::move(pos1)); - parameters.push_back(std::move(ts1)); - parameters.push_back(std::move(rid2)); - parameters.push_back(std::move(pos2)); - parameters.push_back(std::move(ts2)); + parameters.push_back(std::move(rid)); + parameters.push_back(std::move(frac)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(rid0)); + parameters.push_back(std::move(frac0)); + parameters.push_back(std::move(ts0)); } -DataType NadTnpointTnpointLogicalFunction::getDataType() const { return dataType; } +DataType NadTnpointTnpointLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction NadTnpointTnpointLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector NadTnpointTnpointLogicalFunction::getChildren() const { return parameters; } +std::vector NadTnpointTnpointLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction NadTnpointTnpointLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 6, - "NadTnpointTnpointLogicalFunction requires 6 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 6, "NadTnpointTnpointLogicalFunction requires 6 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view NadTnpointTnpointLogicalFunction::getType() const { return NAME; } +std::string_view NadTnpointTnpointLogicalFunction::getType() const +{ + return NAME; +} bool NadTnpointTnpointLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string NadTnpointTnpointLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction NadTnpointTnpointLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(6); - for (const auto& p : parameters) - c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "rid1 must be UINT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "pos1 must be FLOAT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); - INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "rid2 must be UINT64"); - INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "pos2 must be FLOAT64"); - INVARIANT(c[5].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction NadTnpointTnpointLogicalFunction::serialize() const @@ -91,7 +113,9 @@ SerializableFunction NadTnpointTnpointLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -101,12 +125,13 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterNad PRECONDITION(arguments.children.size() == 6, "NadTnpointTnpointLogicalFunction requires 6 children but got {}", arguments.children.size()); - return NadTnpointTnpointLogicalFunction(std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2]), - std::move(arguments.children[3]), - std::move(arguments.children[4]), - std::move(arguments.children[5])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + auto arg5 = std::move(arguments.children[5]); + return NadTnpointTnpointLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/NadTposeGeoLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/NadTposeGeoLogicalFunction.cpp index b32aea7cef..dc59fdba46 100644 --- a/nes-logical-operators/src/Functions/Meos/NadTposeGeoLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/NadTposeGeoLogicalFunction.cpp @@ -26,7 +26,11 @@ namespace NES { -NadTposeGeoLogicalFunction::NadTposeGeoLogicalFunction(LogicalFunction x, LogicalFunction y, LogicalFunction theta, LogicalFunction ts, LogicalFunction wkt) +NadTposeGeoLogicalFunction::NadTposeGeoLogicalFunction(LogicalFunction x, + LogicalFunction y, + LogicalFunction theta, + LogicalFunction ts, + LogicalFunction arg0) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(5); @@ -34,51 +38,71 @@ NadTposeGeoLogicalFunction::NadTposeGeoLogicalFunction(LogicalFunction x, Logica parameters.push_back(std::move(y)); parameters.push_back(std::move(theta)); parameters.push_back(std::move(ts)); - parameters.push_back(std::move(wkt)); + parameters.push_back(std::move(arg0)); } -DataType NadTposeGeoLogicalFunction::getDataType() const { return dataType; } +DataType NadTposeGeoLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction NadTposeGeoLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector NadTposeGeoLogicalFunction::getChildren() const { return parameters; } +std::vector NadTposeGeoLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction NadTposeGeoLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 5, - "NadTposeGeoLogicalFunction requires 5 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 5, "NadTposeGeoLogicalFunction requires 5 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view NadTposeGeoLogicalFunction::getType() const { return NAME; } +std::string_view NadTposeGeoLogicalFunction::getType() const +{ + return NAME; +} bool NadTposeGeoLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string NadTposeGeoLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction NadTposeGeoLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(5); - for (const auto& p : parameters) - c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "x must be FLOAT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "y must be FLOAT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "theta must be FLOAT64"); - INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); - INVARIANT(c[4].getDataType().isType(DataType::Type::VARSIZED), "wkt must be VARSIZED"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction NadTposeGeoLogicalFunction::serialize() const @@ -87,7 +111,9 @@ SerializableFunction NadTposeGeoLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -97,12 +123,12 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterNad PRECONDITION(arguments.children.size() == 5, "NadTposeGeoLogicalFunction requires 5 children but got {}", arguments.children.size()); - return NadTposeGeoLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2]), - std::move(arguments.children[3]), - std::move(arguments.children[4])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + return NadTposeGeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/NadTposePoseLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/NadTposePoseLogicalFunction.cpp index d4647c9627..a7214039e5 100644 --- a/nes-logical-operators/src/Functions/Meos/NadTposePoseLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/NadTposePoseLogicalFunction.cpp @@ -26,7 +26,13 @@ namespace NES { -NadTposePoseLogicalFunction::NadTposePoseLogicalFunction(LogicalFunction x, LogicalFunction y, LogicalFunction theta, LogicalFunction ts, LogicalFunction x2, LogicalFunction y2, LogicalFunction theta2) +NadTposePoseLogicalFunction::NadTposePoseLogicalFunction(LogicalFunction x, + LogicalFunction y, + LogicalFunction theta, + LogicalFunction ts, + LogicalFunction px0, + LogicalFunction py0, + LogicalFunction ptheta0) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(7); @@ -34,55 +40,73 @@ NadTposePoseLogicalFunction::NadTposePoseLogicalFunction(LogicalFunction x, Logi parameters.push_back(std::move(y)); parameters.push_back(std::move(theta)); parameters.push_back(std::move(ts)); - parameters.push_back(std::move(x2)); - parameters.push_back(std::move(y2)); - parameters.push_back(std::move(theta2)); + parameters.push_back(std::move(px0)); + parameters.push_back(std::move(py0)); + parameters.push_back(std::move(ptheta0)); } -DataType NadTposePoseLogicalFunction::getDataType() const { return dataType; } +DataType NadTposePoseLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction NadTposePoseLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector NadTposePoseLogicalFunction::getChildren() const { return parameters; } +std::vector NadTposePoseLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction NadTposePoseLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 7, - "NadTposePoseLogicalFunction requires 7 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 7, "NadTposePoseLogicalFunction requires 7 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view NadTposePoseLogicalFunction::getType() const { return NAME; } +std::string_view NadTposePoseLogicalFunction::getType() const +{ + return NAME; +} bool NadTposePoseLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string NadTposePoseLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction NadTposePoseLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(7); - for (const auto& p : parameters) - c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "x must be FLOAT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "y must be FLOAT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "theta must be FLOAT64"); - INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); - INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "x2 must be FLOAT64"); - INVARIANT(c[5].getDataType().isType(DataType::Type::FLOAT64), "y2 must be FLOAT64"); - INVARIANT(c[6].getDataType().isType(DataType::Type::FLOAT64), "theta2 must be FLOAT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction NadTposePoseLogicalFunction::serialize() const @@ -91,7 +115,9 @@ SerializableFunction NadTposePoseLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -101,14 +127,14 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterNad PRECONDITION(arguments.children.size() == 7, "NadTposePoseLogicalFunction requires 7 children but got {}", arguments.children.size()); - return NadTposePoseLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2]), - std::move(arguments.children[3]), - std::move(arguments.children[4]), - std::move(arguments.children[5]), - std::move(arguments.children[6])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + auto arg5 = std::move(arguments.children[5]); + auto arg6 = std::move(arguments.children[6]); + return NadTposePoseLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/NadTposeTposeLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/NadTposeTposeLogicalFunction.cpp index e311b3d71f..c376842399 100644 --- a/nes-logical-operators/src/Functions/Meos/NadTposeTposeLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/NadTposeTposeLogicalFunction.cpp @@ -26,67 +26,89 @@ namespace NES { -NadTposeTposeLogicalFunction::NadTposeTposeLogicalFunction( - LogicalFunction x1, LogicalFunction y1, LogicalFunction theta1, LogicalFunction ts1, - LogicalFunction x2, LogicalFunction y2, LogicalFunction theta2, LogicalFunction ts2) +NadTposeTposeLogicalFunction::NadTposeTposeLogicalFunction(LogicalFunction x, + LogicalFunction y, + LogicalFunction theta, + LogicalFunction ts, + LogicalFunction px0, + LogicalFunction py0, + LogicalFunction ptheta0, + LogicalFunction ts0) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(8); - parameters.push_back(std::move(x1)); - parameters.push_back(std::move(y1)); - parameters.push_back(std::move(theta1)); - parameters.push_back(std::move(ts1)); - parameters.push_back(std::move(x2)); - parameters.push_back(std::move(y2)); - parameters.push_back(std::move(theta2)); - parameters.push_back(std::move(ts2)); + parameters.push_back(std::move(x)); + parameters.push_back(std::move(y)); + parameters.push_back(std::move(theta)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(px0)); + parameters.push_back(std::move(py0)); + parameters.push_back(std::move(ptheta0)); + parameters.push_back(std::move(ts0)); } -DataType NadTposeTposeLogicalFunction::getDataType() const { return dataType; } +DataType NadTposeTposeLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction NadTposeTposeLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector NadTposeTposeLogicalFunction::getChildren() const { return parameters; } +std::vector NadTposeTposeLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction NadTposeTposeLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 8, - "NadTposeTposeLogicalFunction requires 8 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 8, "NadTposeTposeLogicalFunction requires 8 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view NadTposeTposeLogicalFunction::getType() const { return NAME; } +std::string_view NadTposeTposeLogicalFunction::getType() const +{ + return NAME; +} bool NadTposeTposeLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string NadTposeTposeLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction NadTposeTposeLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(8); - for (const auto& p : parameters) - c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "x1 must be FLOAT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "y1 must be FLOAT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::FLOAT64), "theta1 must be FLOAT64"); - INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); - INVARIANT(c[4].getDataType().isType(DataType::Type::FLOAT64), "x2 must be FLOAT64"); - INVARIANT(c[5].getDataType().isType(DataType::Type::FLOAT64), "y2 must be FLOAT64"); - INVARIANT(c[6].getDataType().isType(DataType::Type::FLOAT64), "theta2 must be FLOAT64"); - INVARIANT(c[7].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction NadTposeTposeLogicalFunction::serialize() const @@ -95,7 +117,9 @@ SerializableFunction NadTposeTposeLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -105,14 +129,15 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterNad PRECONDITION(arguments.children.size() == 8, "NadTposeTposeLogicalFunction requires 8 children but got {}", arguments.children.size()); - return NadTposeTposeLogicalFunction(std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2]), - std::move(arguments.children[3]), - std::move(arguments.children[4]), - std::move(arguments.children[5]), - std::move(arguments.children[6]), - std::move(arguments.children[7])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + auto arg5 = std::move(arguments.children[5]); + auto arg6 = std::move(arguments.children[6]); + auto arg7 = std::move(arguments.children[7]); + return NadTposeTposeLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6), std::move(arg7)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/QuadbinCellAreaLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/QuadbinCellAreaLogicalFunction.cpp index 4e1828ac1b..6f1a59a495 100644 --- a/nes-logical-operators/src/Functions/Meos/QuadbinCellAreaLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/QuadbinCellAreaLogicalFunction.cpp @@ -33,43 +33,68 @@ QuadbinCellAreaLogicalFunction::QuadbinCellAreaLogicalFunction(LogicalFunction c parameters.push_back(std::move(cell)); } -DataType QuadbinCellAreaLogicalFunction::getDataType() const { return dataType; } +DataType QuadbinCellAreaLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction QuadbinCellAreaLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector QuadbinCellAreaLogicalFunction::getChildren() const { return parameters; } +std::vector QuadbinCellAreaLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction QuadbinCellAreaLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 1, - "QuadbinCellAreaLogicalFunction requires 1 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 1, "QuadbinCellAreaLogicalFunction requires 1 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view QuadbinCellAreaLogicalFunction::getType() const { return NAME; } +std::string_view QuadbinCellAreaLogicalFunction::getType() const +{ + return NAME; +} bool QuadbinCellAreaLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string QuadbinCellAreaLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction QuadbinCellAreaLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(1); - c.emplace_back(parameters[0].withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "cell must be UINT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction QuadbinCellAreaLogicalFunction::serialize() const @@ -78,7 +103,9 @@ SerializableFunction QuadbinCellAreaLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -88,8 +115,8 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterQua PRECONDITION(arguments.children.size() == 1, "QuadbinCellAreaLogicalFunction requires 1 children but got {}", arguments.children.size()); - return QuadbinCellAreaLogicalFunction( - std::move(arguments.children[0])); + auto arg0 = std::move(arguments.children[0]); + return QuadbinCellAreaLogicalFunction(std::move(arg0)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/QuadbinCellToParentLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/QuadbinCellToParentLogicalFunction.cpp index d2b9d2f050..1f7546988d 100644 --- a/nes-logical-operators/src/Functions/Meos/QuadbinCellToParentLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/QuadbinCellToParentLogicalFunction.cpp @@ -26,7 +26,8 @@ namespace NES { -QuadbinCellToParentLogicalFunction::QuadbinCellToParentLogicalFunction(LogicalFunction cell, LogicalFunction res) +QuadbinCellToParentLogicalFunction::QuadbinCellToParentLogicalFunction(LogicalFunction cell, + LogicalFunction res) : dataType(DataTypeProvider::provideDataType(DataType::Type::VARSIZED)) { parameters.reserve(2); @@ -34,45 +35,68 @@ QuadbinCellToParentLogicalFunction::QuadbinCellToParentLogicalFunction(LogicalFu parameters.push_back(std::move(res)); } -DataType QuadbinCellToParentLogicalFunction::getDataType() const { return dataType; } +DataType QuadbinCellToParentLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction QuadbinCellToParentLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector QuadbinCellToParentLogicalFunction::getChildren() const { return parameters; } +std::vector QuadbinCellToParentLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction QuadbinCellToParentLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 2, - "QuadbinCellToParentLogicalFunction requires 2 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 2, "QuadbinCellToParentLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view QuadbinCellToParentLogicalFunction::getType() const { return NAME; } +std::string_view QuadbinCellToParentLogicalFunction::getType() const +{ + return NAME; +} bool QuadbinCellToParentLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string QuadbinCellToParentLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction QuadbinCellToParentLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(2); - c.emplace_back(parameters[0].withInferredDataType(schema)); - c.emplace_back(parameters[1].withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "cell must be UINT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "res must be UINT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction QuadbinCellToParentLogicalFunction::serialize() const @@ -81,7 +105,9 @@ SerializableFunction QuadbinCellToParentLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -91,9 +117,9 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterQua PRECONDITION(arguments.children.size() == 2, "QuadbinCellToParentLogicalFunction requires 2 children but got {}", arguments.children.size()); - return QuadbinCellToParentLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + return QuadbinCellToParentLogicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/QuadbinCellToQuadkeyLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/QuadbinCellToQuadkeyLogicalFunction.cpp index 547d5861cc..992d783d0c 100644 --- a/nes-logical-operators/src/Functions/Meos/QuadbinCellToQuadkeyLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/QuadbinCellToQuadkeyLogicalFunction.cpp @@ -33,43 +33,68 @@ QuadbinCellToQuadkeyLogicalFunction::QuadbinCellToQuadkeyLogicalFunction(Logical parameters.push_back(std::move(cell)); } -DataType QuadbinCellToQuadkeyLogicalFunction::getDataType() const { return dataType; } +DataType QuadbinCellToQuadkeyLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction QuadbinCellToQuadkeyLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector QuadbinCellToQuadkeyLogicalFunction::getChildren() const { return parameters; } +std::vector QuadbinCellToQuadkeyLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction QuadbinCellToQuadkeyLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 1, - "QuadbinCellToQuadkeyLogicalFunction requires 1 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 1, "QuadbinCellToQuadkeyLogicalFunction requires 1 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view QuadbinCellToQuadkeyLogicalFunction::getType() const { return NAME; } +std::string_view QuadbinCellToQuadkeyLogicalFunction::getType() const +{ + return NAME; +} bool QuadbinCellToQuadkeyLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string QuadbinCellToQuadkeyLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction QuadbinCellToQuadkeyLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(1); - c.emplace_back(parameters[0].withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "cell must be UINT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction QuadbinCellToQuadkeyLogicalFunction::serialize() const @@ -78,7 +103,9 @@ SerializableFunction QuadbinCellToQuadkeyLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -88,8 +115,8 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterQua PRECONDITION(arguments.children.size() == 1, "QuadbinCellToQuadkeyLogicalFunction requires 1 children but got {}", arguments.children.size()); - return QuadbinCellToQuadkeyLogicalFunction( - std::move(arguments.children[0])); + auto arg0 = std::move(arguments.children[0]); + return QuadbinCellToQuadkeyLogicalFunction(std::move(arg0)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/QuadbinCmpLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/QuadbinCmpLogicalFunction.cpp index 15c0fe2c39..80a54f5094 100644 --- a/nes-logical-operators/src/Functions/Meos/QuadbinCmpLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/QuadbinCmpLogicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -25,50 +26,100 @@ namespace NES { -QuadbinCmpLogicalFunction::QuadbinCmpLogicalFunction(LogicalFunction a, LogicalFunction b) +QuadbinCmpLogicalFunction::QuadbinCmpLogicalFunction(LogicalFunction a, + LogicalFunction b) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(2); parameters.push_back(std::move(a)); parameters.push_back(std::move(b)); } -DataType QuadbinCmpLogicalFunction::getDataType() const { return dataType; } -LogicalFunction QuadbinCmpLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } -std::vector QuadbinCmpLogicalFunction::getChildren() const { return parameters; } -LogicalFunction QuadbinCmpLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size()==2,"QuadbinCmpLogicalFunction requires 2 children, but got {}",children.size()); - auto c=*this; c.parameters=children; return c; + +DataType QuadbinCmpLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction QuadbinCmpLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector QuadbinCmpLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction QuadbinCmpLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 2, "QuadbinCmpLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; +} + +std::string_view QuadbinCmpLogicalFunction::getType() const +{ + return NAME; } -std::string_view QuadbinCmpLogicalFunction::getType() const { return NAME; } -bool QuadbinCmpLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { - if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + +bool QuadbinCmpLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } return false; } -std::string QuadbinCmpLogicalFunction::explain(ExplainVerbosity v) const { - return fmt::format("{}({})",NAME,parameters[0].explain(v)); + +std::string QuadbinCmpLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } -LogicalFunction QuadbinCmpLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; c.reserve(2); - for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "a must be UINT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "b must be UINT64"); - return withChildren(c); + +LogicalFunction QuadbinCmpLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } -SerializableFunction QuadbinCmpLogicalFunction::serialize() const { + +SerializableFunction QuadbinCmpLogicalFunction::serialize() const +{ SerializableFunction proto; proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); - for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } return proto; } + LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterQuadbinCmpLogicalFunction( LogicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.children.size()==2, + PRECONDITION(arguments.children.size() == 2, "QuadbinCmpLogicalFunction requires 2 children but got {}", arguments.children.size()); - return QuadbinCmpLogicalFunction(std::move(arguments.children[0]), - std::move(arguments.children[1])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + return QuadbinCmpLogicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/QuadbinEqLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/QuadbinEqLogicalFunction.cpp index 7a3277ea9c..d3bdddf7c4 100644 --- a/nes-logical-operators/src/Functions/Meos/QuadbinEqLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/QuadbinEqLogicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -25,50 +26,100 @@ namespace NES { -QuadbinEqLogicalFunction::QuadbinEqLogicalFunction(LogicalFunction a, LogicalFunction b) +QuadbinEqLogicalFunction::QuadbinEqLogicalFunction(LogicalFunction a, + LogicalFunction b) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(2); parameters.push_back(std::move(a)); parameters.push_back(std::move(b)); } -DataType QuadbinEqLogicalFunction::getDataType() const { return dataType; } -LogicalFunction QuadbinEqLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } -std::vector QuadbinEqLogicalFunction::getChildren() const { return parameters; } -LogicalFunction QuadbinEqLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size()==2,"QuadbinEqLogicalFunction requires 2 children, but got {}",children.size()); - auto c=*this; c.parameters=children; return c; + +DataType QuadbinEqLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction QuadbinEqLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector QuadbinEqLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction QuadbinEqLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 2, "QuadbinEqLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; +} + +std::string_view QuadbinEqLogicalFunction::getType() const +{ + return NAME; } -std::string_view QuadbinEqLogicalFunction::getType() const { return NAME; } -bool QuadbinEqLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { - if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + +bool QuadbinEqLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } return false; } -std::string QuadbinEqLogicalFunction::explain(ExplainVerbosity v) const { - return fmt::format("{}({})",NAME,parameters[0].explain(v)); + +std::string QuadbinEqLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } -LogicalFunction QuadbinEqLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; c.reserve(2); - for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "a must be UINT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "b must be UINT64"); - return withChildren(c); + +LogicalFunction QuadbinEqLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } -SerializableFunction QuadbinEqLogicalFunction::serialize() const { + +SerializableFunction QuadbinEqLogicalFunction::serialize() const +{ SerializableFunction proto; proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); - for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } return proto; } + LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterQuadbinEqLogicalFunction( LogicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.children.size()==2, + PRECONDITION(arguments.children.size() == 2, "QuadbinEqLogicalFunction requires 2 children but got {}", arguments.children.size()); - return QuadbinEqLogicalFunction(std::move(arguments.children[0]), - std::move(arguments.children[1])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + return QuadbinEqLogicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/QuadbinGeLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/QuadbinGeLogicalFunction.cpp index fd5ebf6317..2cc22f13a6 100644 --- a/nes-logical-operators/src/Functions/Meos/QuadbinGeLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/QuadbinGeLogicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -25,50 +26,100 @@ namespace NES { -QuadbinGeLogicalFunction::QuadbinGeLogicalFunction(LogicalFunction a, LogicalFunction b) +QuadbinGeLogicalFunction::QuadbinGeLogicalFunction(LogicalFunction a, + LogicalFunction b) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(2); parameters.push_back(std::move(a)); parameters.push_back(std::move(b)); } -DataType QuadbinGeLogicalFunction::getDataType() const { return dataType; } -LogicalFunction QuadbinGeLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } -std::vector QuadbinGeLogicalFunction::getChildren() const { return parameters; } -LogicalFunction QuadbinGeLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size()==2,"QuadbinGeLogicalFunction requires 2 children, but got {}",children.size()); - auto c=*this; c.parameters=children; return c; + +DataType QuadbinGeLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction QuadbinGeLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector QuadbinGeLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction QuadbinGeLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 2, "QuadbinGeLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; +} + +std::string_view QuadbinGeLogicalFunction::getType() const +{ + return NAME; } -std::string_view QuadbinGeLogicalFunction::getType() const { return NAME; } -bool QuadbinGeLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { - if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + +bool QuadbinGeLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } return false; } -std::string QuadbinGeLogicalFunction::explain(ExplainVerbosity v) const { - return fmt::format("{}({})",NAME,parameters[0].explain(v)); + +std::string QuadbinGeLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } -LogicalFunction QuadbinGeLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; c.reserve(2); - for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "a must be UINT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "b must be UINT64"); - return withChildren(c); + +LogicalFunction QuadbinGeLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } -SerializableFunction QuadbinGeLogicalFunction::serialize() const { + +SerializableFunction QuadbinGeLogicalFunction::serialize() const +{ SerializableFunction proto; proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); - for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } return proto; } + LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterQuadbinGeLogicalFunction( LogicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.children.size()==2, + PRECONDITION(arguments.children.size() == 2, "QuadbinGeLogicalFunction requires 2 children but got {}", arguments.children.size()); - return QuadbinGeLogicalFunction(std::move(arguments.children[0]), - std::move(arguments.children[1])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + return QuadbinGeLogicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/QuadbinGetResolutionLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/QuadbinGetResolutionLogicalFunction.cpp index c8bc6be072..80083d56a2 100644 --- a/nes-logical-operators/src/Functions/Meos/QuadbinGetResolutionLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/QuadbinGetResolutionLogicalFunction.cpp @@ -33,43 +33,68 @@ QuadbinGetResolutionLogicalFunction::QuadbinGetResolutionLogicalFunction(Logical parameters.push_back(std::move(cell)); } -DataType QuadbinGetResolutionLogicalFunction::getDataType() const { return dataType; } +DataType QuadbinGetResolutionLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction QuadbinGetResolutionLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector QuadbinGetResolutionLogicalFunction::getChildren() const { return parameters; } +std::vector QuadbinGetResolutionLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction QuadbinGetResolutionLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 1, - "QuadbinGetResolutionLogicalFunction requires 1 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 1, "QuadbinGetResolutionLogicalFunction requires 1 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view QuadbinGetResolutionLogicalFunction::getType() const { return NAME; } +std::string_view QuadbinGetResolutionLogicalFunction::getType() const +{ + return NAME; +} bool QuadbinGetResolutionLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string QuadbinGetResolutionLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction QuadbinGetResolutionLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(1); - c.emplace_back(parameters[0].withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "cell must be UINT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction QuadbinGetResolutionLogicalFunction::serialize() const @@ -78,7 +103,9 @@ SerializableFunction QuadbinGetResolutionLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -88,8 +115,8 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterQua PRECONDITION(arguments.children.size() == 1, "QuadbinGetResolutionLogicalFunction requires 1 children but got {}", arguments.children.size()); - return QuadbinGetResolutionLogicalFunction( - std::move(arguments.children[0])); + auto arg0 = std::move(arguments.children[0]); + return QuadbinGetResolutionLogicalFunction(std::move(arg0)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/QuadbinGtLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/QuadbinGtLogicalFunction.cpp index 276ade9d2a..a94a0b0f99 100644 --- a/nes-logical-operators/src/Functions/Meos/QuadbinGtLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/QuadbinGtLogicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -25,50 +26,100 @@ namespace NES { -QuadbinGtLogicalFunction::QuadbinGtLogicalFunction(LogicalFunction a, LogicalFunction b) +QuadbinGtLogicalFunction::QuadbinGtLogicalFunction(LogicalFunction a, + LogicalFunction b) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(2); parameters.push_back(std::move(a)); parameters.push_back(std::move(b)); } -DataType QuadbinGtLogicalFunction::getDataType() const { return dataType; } -LogicalFunction QuadbinGtLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } -std::vector QuadbinGtLogicalFunction::getChildren() const { return parameters; } -LogicalFunction QuadbinGtLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size()==2,"QuadbinGtLogicalFunction requires 2 children, but got {}",children.size()); - auto c=*this; c.parameters=children; return c; + +DataType QuadbinGtLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction QuadbinGtLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector QuadbinGtLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction QuadbinGtLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 2, "QuadbinGtLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; +} + +std::string_view QuadbinGtLogicalFunction::getType() const +{ + return NAME; } -std::string_view QuadbinGtLogicalFunction::getType() const { return NAME; } -bool QuadbinGtLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { - if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + +bool QuadbinGtLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } return false; } -std::string QuadbinGtLogicalFunction::explain(ExplainVerbosity v) const { - return fmt::format("{}({})",NAME,parameters[0].explain(v)); + +std::string QuadbinGtLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } -LogicalFunction QuadbinGtLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; c.reserve(2); - for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "a must be UINT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "b must be UINT64"); - return withChildren(c); + +LogicalFunction QuadbinGtLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } -SerializableFunction QuadbinGtLogicalFunction::serialize() const { + +SerializableFunction QuadbinGtLogicalFunction::serialize() const +{ SerializableFunction proto; proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); - for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } return proto; } + LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterQuadbinGtLogicalFunction( LogicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.children.size()==2, + PRECONDITION(arguments.children.size() == 2, "QuadbinGtLogicalFunction requires 2 children but got {}", arguments.children.size()); - return QuadbinGtLogicalFunction(std::move(arguments.children[0]), - std::move(arguments.children[1])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + return QuadbinGtLogicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/QuadbinIsValidCellLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/QuadbinIsValidCellLogicalFunction.cpp index fee9e32794..63b0890715 100644 --- a/nes-logical-operators/src/Functions/Meos/QuadbinIsValidCellLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/QuadbinIsValidCellLogicalFunction.cpp @@ -33,43 +33,68 @@ QuadbinIsValidCellLogicalFunction::QuadbinIsValidCellLogicalFunction(LogicalFunc parameters.push_back(std::move(cell)); } -DataType QuadbinIsValidCellLogicalFunction::getDataType() const { return dataType; } +DataType QuadbinIsValidCellLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction QuadbinIsValidCellLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector QuadbinIsValidCellLogicalFunction::getChildren() const { return parameters; } +std::vector QuadbinIsValidCellLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction QuadbinIsValidCellLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 1, - "QuadbinIsValidCellLogicalFunction requires 1 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 1, "QuadbinIsValidCellLogicalFunction requires 1 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view QuadbinIsValidCellLogicalFunction::getType() const { return NAME; } +std::string_view QuadbinIsValidCellLogicalFunction::getType() const +{ + return NAME; +} bool QuadbinIsValidCellLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string QuadbinIsValidCellLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction QuadbinIsValidCellLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(1); - c.emplace_back(parameters[0].withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "cell must be UINT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction QuadbinIsValidCellLogicalFunction::serialize() const @@ -78,7 +103,9 @@ SerializableFunction QuadbinIsValidCellLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -88,8 +115,8 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterQua PRECONDITION(arguments.children.size() == 1, "QuadbinIsValidCellLogicalFunction requires 1 children but got {}", arguments.children.size()); - return QuadbinIsValidCellLogicalFunction( - std::move(arguments.children[0])); + auto arg0 = std::move(arguments.children[0]); + return QuadbinIsValidCellLogicalFunction(std::move(arg0)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/QuadbinLeLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/QuadbinLeLogicalFunction.cpp index 2324d5bcde..6de712af8d 100644 --- a/nes-logical-operators/src/Functions/Meos/QuadbinLeLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/QuadbinLeLogicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -25,50 +26,100 @@ namespace NES { -QuadbinLeLogicalFunction::QuadbinLeLogicalFunction(LogicalFunction a, LogicalFunction b) +QuadbinLeLogicalFunction::QuadbinLeLogicalFunction(LogicalFunction a, + LogicalFunction b) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(2); parameters.push_back(std::move(a)); parameters.push_back(std::move(b)); } -DataType QuadbinLeLogicalFunction::getDataType() const { return dataType; } -LogicalFunction QuadbinLeLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } -std::vector QuadbinLeLogicalFunction::getChildren() const { return parameters; } -LogicalFunction QuadbinLeLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size()==2,"QuadbinLeLogicalFunction requires 2 children, but got {}",children.size()); - auto c=*this; c.parameters=children; return c; + +DataType QuadbinLeLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction QuadbinLeLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector QuadbinLeLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction QuadbinLeLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 2, "QuadbinLeLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; +} + +std::string_view QuadbinLeLogicalFunction::getType() const +{ + return NAME; } -std::string_view QuadbinLeLogicalFunction::getType() const { return NAME; } -bool QuadbinLeLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { - if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + +bool QuadbinLeLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } return false; } -std::string QuadbinLeLogicalFunction::explain(ExplainVerbosity v) const { - return fmt::format("{}({})",NAME,parameters[0].explain(v)); + +std::string QuadbinLeLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } -LogicalFunction QuadbinLeLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; c.reserve(2); - for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "a must be UINT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "b must be UINT64"); - return withChildren(c); + +LogicalFunction QuadbinLeLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } -SerializableFunction QuadbinLeLogicalFunction::serialize() const { + +SerializableFunction QuadbinLeLogicalFunction::serialize() const +{ SerializableFunction proto; proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); - for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } return proto; } + LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterQuadbinLeLogicalFunction( LogicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.children.size()==2, + PRECONDITION(arguments.children.size() == 2, "QuadbinLeLogicalFunction requires 2 children but got {}", arguments.children.size()); - return QuadbinLeLogicalFunction(std::move(arguments.children[0]), - std::move(arguments.children[1])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + return QuadbinLeLogicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/QuadbinLtLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/QuadbinLtLogicalFunction.cpp index 498cd10e33..d925d6de7b 100644 --- a/nes-logical-operators/src/Functions/Meos/QuadbinLtLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/QuadbinLtLogicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -25,50 +26,100 @@ namespace NES { -QuadbinLtLogicalFunction::QuadbinLtLogicalFunction(LogicalFunction a, LogicalFunction b) +QuadbinLtLogicalFunction::QuadbinLtLogicalFunction(LogicalFunction a, + LogicalFunction b) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(2); parameters.push_back(std::move(a)); parameters.push_back(std::move(b)); } -DataType QuadbinLtLogicalFunction::getDataType() const { return dataType; } -LogicalFunction QuadbinLtLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } -std::vector QuadbinLtLogicalFunction::getChildren() const { return parameters; } -LogicalFunction QuadbinLtLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size()==2,"QuadbinLtLogicalFunction requires 2 children, but got {}",children.size()); - auto c=*this; c.parameters=children; return c; + +DataType QuadbinLtLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction QuadbinLtLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector QuadbinLtLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction QuadbinLtLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 2, "QuadbinLtLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; +} + +std::string_view QuadbinLtLogicalFunction::getType() const +{ + return NAME; } -std::string_view QuadbinLtLogicalFunction::getType() const { return NAME; } -bool QuadbinLtLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { - if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + +bool QuadbinLtLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } return false; } -std::string QuadbinLtLogicalFunction::explain(ExplainVerbosity v) const { - return fmt::format("{}({})",NAME,parameters[0].explain(v)); + +std::string QuadbinLtLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } -LogicalFunction QuadbinLtLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; c.reserve(2); - for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "a must be UINT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "b must be UINT64"); - return withChildren(c); + +LogicalFunction QuadbinLtLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } -SerializableFunction QuadbinLtLogicalFunction::serialize() const { + +SerializableFunction QuadbinLtLogicalFunction::serialize() const +{ SerializableFunction proto; proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); - for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } return proto; } + LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterQuadbinLtLogicalFunction( LogicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.children.size()==2, + PRECONDITION(arguments.children.size() == 2, "QuadbinLtLogicalFunction requires 2 children but got {}", arguments.children.size()); - return QuadbinLtLogicalFunction(std::move(arguments.children[0]), - std::move(arguments.children[1])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + return QuadbinLtLogicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/QuadbinNeLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/QuadbinNeLogicalFunction.cpp index 41b48c540d..64ec3f49fc 100644 --- a/nes-logical-operators/src/Functions/Meos/QuadbinNeLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/QuadbinNeLogicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -25,50 +26,100 @@ namespace NES { -QuadbinNeLogicalFunction::QuadbinNeLogicalFunction(LogicalFunction a, LogicalFunction b) +QuadbinNeLogicalFunction::QuadbinNeLogicalFunction(LogicalFunction a, + LogicalFunction b) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(2); parameters.push_back(std::move(a)); parameters.push_back(std::move(b)); } -DataType QuadbinNeLogicalFunction::getDataType() const { return dataType; } -LogicalFunction QuadbinNeLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } -std::vector QuadbinNeLogicalFunction::getChildren() const { return parameters; } -LogicalFunction QuadbinNeLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size()==2,"QuadbinNeLogicalFunction requires 2 children, but got {}",children.size()); - auto c=*this; c.parameters=children; return c; + +DataType QuadbinNeLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction QuadbinNeLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector QuadbinNeLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction QuadbinNeLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 2, "QuadbinNeLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; +} + +std::string_view QuadbinNeLogicalFunction::getType() const +{ + return NAME; } -std::string_view QuadbinNeLogicalFunction::getType() const { return NAME; } -bool QuadbinNeLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { - if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + +bool QuadbinNeLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } return false; } -std::string QuadbinNeLogicalFunction::explain(ExplainVerbosity v) const { - return fmt::format("{}({})",NAME,parameters[0].explain(v)); + +std::string QuadbinNeLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } -LogicalFunction QuadbinNeLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; c.reserve(2); - for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "a must be UINT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "b must be UINT64"); - return withChildren(c); + +LogicalFunction QuadbinNeLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } -SerializableFunction QuadbinNeLogicalFunction::serialize() const { + +SerializableFunction QuadbinNeLogicalFunction::serialize() const +{ SerializableFunction proto; proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); - for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } return proto; } + LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterQuadbinNeLogicalFunction( LogicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.children.size()==2, + PRECONDITION(arguments.children.size() == 2, "QuadbinNeLogicalFunction requires 2 children but got {}", arguments.children.size()); - return QuadbinNeLogicalFunction(std::move(arguments.children[0]), - std::move(arguments.children[1])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + return QuadbinNeLogicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/QuadbinPointToCellLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/QuadbinPointToCellLogicalFunction.cpp index 33311bcde9..17ce9231a8 100644 --- a/nes-logical-operators/src/Functions/Meos/QuadbinPointToCellLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/QuadbinPointToCellLogicalFunction.cpp @@ -26,7 +26,9 @@ namespace NES { -QuadbinPointToCellLogicalFunction::QuadbinPointToCellLogicalFunction(LogicalFunction lon, LogicalFunction lat, LogicalFunction res) +QuadbinPointToCellLogicalFunction::QuadbinPointToCellLogicalFunction(LogicalFunction lon, + LogicalFunction lat, + LogicalFunction res) : dataType(DataTypeProvider::provideDataType(DataType::Type::VARSIZED)) { parameters.reserve(3); @@ -35,47 +37,68 @@ QuadbinPointToCellLogicalFunction::QuadbinPointToCellLogicalFunction(LogicalFunc parameters.push_back(std::move(res)); } -DataType QuadbinPointToCellLogicalFunction::getDataType() const { return dataType; } +DataType QuadbinPointToCellLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction QuadbinPointToCellLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector QuadbinPointToCellLogicalFunction::getChildren() const { return parameters; } +std::vector QuadbinPointToCellLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction QuadbinPointToCellLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 3, - "QuadbinPointToCellLogicalFunction requires 3 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 3, "QuadbinPointToCellLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view QuadbinPointToCellLogicalFunction::getType() const { return NAME; } +std::string_view QuadbinPointToCellLogicalFunction::getType() const +{ + return NAME; +} bool QuadbinPointToCellLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string QuadbinPointToCellLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction QuadbinPointToCellLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(3); - c.emplace_back(parameters[0].withInferredDataType(schema)); - c.emplace_back(parameters[1].withInferredDataType(schema)); - c.emplace_back(parameters[2].withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::FLOAT64), "lon must be FLOAT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::FLOAT64), "lat must be FLOAT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "res must be UINT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction QuadbinPointToCellLogicalFunction::serialize() const @@ -84,7 +107,9 @@ SerializableFunction QuadbinPointToCellLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -94,10 +119,10 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterQua PRECONDITION(arguments.children.size() == 3, "QuadbinPointToCellLogicalFunction requires 3 children but got {}", arguments.children.size()); - return QuadbinPointToCellLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return QuadbinPointToCellLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/QuadbinTileToCellLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/QuadbinTileToCellLogicalFunction.cpp index 334bd4a162..3520904fa8 100644 --- a/nes-logical-operators/src/Functions/Meos/QuadbinTileToCellLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/QuadbinTileToCellLogicalFunction.cpp @@ -26,7 +26,9 @@ namespace NES { -QuadbinTileToCellLogicalFunction::QuadbinTileToCellLogicalFunction(LogicalFunction x, LogicalFunction y, LogicalFunction z) +QuadbinTileToCellLogicalFunction::QuadbinTileToCellLogicalFunction(LogicalFunction x, + LogicalFunction y, + LogicalFunction z) : dataType(DataTypeProvider::provideDataType(DataType::Type::VARSIZED)) { parameters.reserve(3); @@ -35,47 +37,68 @@ QuadbinTileToCellLogicalFunction::QuadbinTileToCellLogicalFunction(LogicalFuncti parameters.push_back(std::move(z)); } -DataType QuadbinTileToCellLogicalFunction::getDataType() const { return dataType; } +DataType QuadbinTileToCellLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction QuadbinTileToCellLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector QuadbinTileToCellLogicalFunction::getChildren() const { return parameters; } +std::vector QuadbinTileToCellLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction QuadbinTileToCellLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 3, - "QuadbinTileToCellLogicalFunction requires 3 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 3, "QuadbinTileToCellLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view QuadbinTileToCellLogicalFunction::getType() const { return NAME; } +std::string_view QuadbinTileToCellLogicalFunction::getType() const +{ + return NAME; +} bool QuadbinTileToCellLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string QuadbinTileToCellLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction QuadbinTileToCellLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(3); - c.emplace_back(parameters[0].withInferredDataType(schema)); - c.emplace_back(parameters[1].withInferredDataType(schema)); - c.emplace_back(parameters[2].withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "x must be UINT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "y must be UINT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "z must be UINT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction QuadbinTileToCellLogicalFunction::serialize() const @@ -84,7 +107,9 @@ SerializableFunction QuadbinTileToCellLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -94,10 +119,10 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterQua PRECONDITION(arguments.children.size() == 3, "QuadbinTileToCellLogicalFunction requires 3 children but got {}", arguments.children.size()); - return QuadbinTileToCellLogicalFunction( - std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return QuadbinTileToCellLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/SubBigintTbigintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/SubBigintTbigintLogicalFunction.cpp index 1d28d41eeb..96da9df974 100644 --- a/nes-logical-operators/src/Functions/Meos/SubBigintTbigintLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/SubBigintTbigintLogicalFunction.cpp @@ -26,46 +26,65 @@ namespace NES { -SubBigintTbigintLogicalFunction::SubBigintTbigintLogicalFunction(LogicalFunction scalar, - LogicalFunction value, - LogicalFunction ts) +SubBigintTbigintLogicalFunction::SubBigintTbigintLogicalFunction(LogicalFunction arg0, + LogicalFunction value, + LogicalFunction ts) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(3); - parameters.push_back(std::move(scalar)); + parameters.push_back(std::move(arg0)); parameters.push_back(std::move(value)); parameters.push_back(std::move(ts)); } -DataType SubBigintTbigintLogicalFunction::getDataType() const { return dataType; } +DataType SubBigintTbigintLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction SubBigintTbigintLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector SubBigintTbigintLogicalFunction::getChildren() const { return parameters; } +std::vector SubBigintTbigintLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction SubBigintTbigintLogicalFunction::withChildren(const std::vector& children) const { PRECONDITION(children.size() == 3, "SubBigintTbigintLogicalFunction requires 3 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view SubBigintTbigintLogicalFunction::getType() const { return NAME; } +std::string_view SubBigintTbigintLogicalFunction::getType() const +{ + return NAME; +} bool SubBigintTbigintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string SubBigintTbigintLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -76,7 +95,9 @@ LogicalFunction SubBigintTbigintLogicalFunction::withInferredDataType(const Sche std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -86,7 +107,9 @@ SerializableFunction SubBigintTbigintLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } diff --git a/nes-logical-operators/src/Functions/Meos/SubFloatTfloatLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/SubFloatTfloatLogicalFunction.cpp index 30d298ffb2..23e7ca2812 100644 --- a/nes-logical-operators/src/Functions/Meos/SubFloatTfloatLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/SubFloatTfloatLogicalFunction.cpp @@ -26,46 +26,65 @@ namespace NES { -SubFloatTfloatLogicalFunction::SubFloatTfloatLogicalFunction(LogicalFunction scalar, - LogicalFunction value, - LogicalFunction ts) +SubFloatTfloatLogicalFunction::SubFloatTfloatLogicalFunction(LogicalFunction arg0, + LogicalFunction value, + LogicalFunction ts) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(3); - parameters.push_back(std::move(scalar)); + parameters.push_back(std::move(arg0)); parameters.push_back(std::move(value)); parameters.push_back(std::move(ts)); } -DataType SubFloatTfloatLogicalFunction::getDataType() const { return dataType; } +DataType SubFloatTfloatLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction SubFloatTfloatLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector SubFloatTfloatLogicalFunction::getChildren() const { return parameters; } +std::vector SubFloatTfloatLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction SubFloatTfloatLogicalFunction::withChildren(const std::vector& children) const { PRECONDITION(children.size() == 3, "SubFloatTfloatLogicalFunction requires 3 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view SubFloatTfloatLogicalFunction::getType() const { return NAME; } +std::string_view SubFloatTfloatLogicalFunction::getType() const +{ + return NAME; +} bool SubFloatTfloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string SubFloatTfloatLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -76,7 +95,9 @@ LogicalFunction SubFloatTfloatLogicalFunction::withInferredDataType(const Schema std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -86,7 +107,9 @@ SerializableFunction SubFloatTfloatLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } diff --git a/nes-logical-operators/src/Functions/Meos/SubIntTintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/SubIntTintLogicalFunction.cpp index 137088701d..28129a305f 100644 --- a/nes-logical-operators/src/Functions/Meos/SubIntTintLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/SubIntTintLogicalFunction.cpp @@ -26,46 +26,65 @@ namespace NES { -SubIntTintLogicalFunction::SubIntTintLogicalFunction(LogicalFunction scalar, - LogicalFunction value, - LogicalFunction ts) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +SubIntTintLogicalFunction::SubIntTintLogicalFunction(LogicalFunction arg0, + LogicalFunction value, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) { parameters.reserve(3); - parameters.push_back(std::move(scalar)); + parameters.push_back(std::move(arg0)); parameters.push_back(std::move(value)); parameters.push_back(std::move(ts)); } -DataType SubIntTintLogicalFunction::getDataType() const { return dataType; } +DataType SubIntTintLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction SubIntTintLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector SubIntTintLogicalFunction::getChildren() const { return parameters; } +std::vector SubIntTintLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction SubIntTintLogicalFunction::withChildren(const std::vector& children) const { PRECONDITION(children.size() == 3, "SubIntTintLogicalFunction requires 3 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view SubIntTintLogicalFunction::getType() const { return NAME; } +std::string_view SubIntTintLogicalFunction::getType() const +{ + return NAME; +} bool SubIntTintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string SubIntTintLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -76,7 +95,9 @@ LogicalFunction SubIntTintLogicalFunction::withInferredDataType(const Schema& sc std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -86,7 +107,9 @@ SerializableFunction SubIntTintLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } diff --git a/nes-logical-operators/src/Functions/Meos/SubTbigintBigintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/SubTbigintBigintLogicalFunction.cpp index ba377c8c8a..75215c3d9e 100644 --- a/nes-logical-operators/src/Functions/Meos/SubTbigintBigintLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/SubTbigintBigintLogicalFunction.cpp @@ -27,45 +27,64 @@ namespace NES { SubTbigintBigintLogicalFunction::SubTbigintBigintLogicalFunction(LogicalFunction value, - LogicalFunction ts, - LogicalFunction subtrahend) + LogicalFunction ts, + LogicalFunction arg0) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(3); parameters.push_back(std::move(value)); parameters.push_back(std::move(ts)); - parameters.push_back(std::move(subtrahend)); + parameters.push_back(std::move(arg0)); } -DataType SubTbigintBigintLogicalFunction::getDataType() const { return dataType; } +DataType SubTbigintBigintLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction SubTbigintBigintLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector SubTbigintBigintLogicalFunction::getChildren() const { return parameters; } +std::vector SubTbigintBigintLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction SubTbigintBigintLogicalFunction::withChildren(const std::vector& children) const { PRECONDITION(children.size() == 3, "SubTbigintBigintLogicalFunction requires 3 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view SubTbigintBigintLogicalFunction::getType() const { return NAME; } +std::string_view SubTbigintBigintLogicalFunction::getType() const +{ + return NAME; +} bool SubTbigintBigintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string SubTbigintBigintLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -76,7 +95,9 @@ LogicalFunction SubTbigintBigintLogicalFunction::withInferredDataType(const Sche std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -86,7 +107,9 @@ SerializableFunction SubTbigintBigintLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } diff --git a/nes-logical-operators/src/Functions/Meos/SubTfloatFloatLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/SubTfloatFloatLogicalFunction.cpp index d1eda09525..7c39fdfb03 100644 --- a/nes-logical-operators/src/Functions/Meos/SubTfloatFloatLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/SubTfloatFloatLogicalFunction.cpp @@ -27,45 +27,64 @@ namespace NES { SubTfloatFloatLogicalFunction::SubTfloatFloatLogicalFunction(LogicalFunction value, - LogicalFunction ts, - LogicalFunction subtrahend) + LogicalFunction ts, + LogicalFunction arg0) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(3); parameters.push_back(std::move(value)); parameters.push_back(std::move(ts)); - parameters.push_back(std::move(subtrahend)); + parameters.push_back(std::move(arg0)); } -DataType SubTfloatFloatLogicalFunction::getDataType() const { return dataType; } +DataType SubTfloatFloatLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction SubTfloatFloatLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector SubTfloatFloatLogicalFunction::getChildren() const { return parameters; } +std::vector SubTfloatFloatLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction SubTfloatFloatLogicalFunction::withChildren(const std::vector& children) const { PRECONDITION(children.size() == 3, "SubTfloatFloatLogicalFunction requires 3 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view SubTfloatFloatLogicalFunction::getType() const { return NAME; } +std::string_view SubTfloatFloatLogicalFunction::getType() const +{ + return NAME; +} bool SubTfloatFloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string SubTfloatFloatLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -76,7 +95,9 @@ LogicalFunction SubTfloatFloatLogicalFunction::withInferredDataType(const Schema std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -86,7 +107,9 @@ SerializableFunction SubTfloatFloatLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } diff --git a/nes-logical-operators/src/Functions/Meos/SubTintIntLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/SubTintIntLogicalFunction.cpp index 1b18e51bce..0c604b53d7 100644 --- a/nes-logical-operators/src/Functions/Meos/SubTintIntLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/SubTintIntLogicalFunction.cpp @@ -27,45 +27,64 @@ namespace NES { SubTintIntLogicalFunction::SubTintIntLogicalFunction(LogicalFunction value, - LogicalFunction ts, - LogicalFunction subtrahend) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) + LogicalFunction ts, + LogicalFunction arg0) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) { parameters.reserve(3); parameters.push_back(std::move(value)); parameters.push_back(std::move(ts)); - parameters.push_back(std::move(subtrahend)); + parameters.push_back(std::move(arg0)); } -DataType SubTintIntLogicalFunction::getDataType() const { return dataType; } +DataType SubTintIntLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction SubTintIntLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector SubTintIntLogicalFunction::getChildren() const { return parameters; } +std::vector SubTintIntLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction SubTintIntLogicalFunction::withChildren(const std::vector& children) const { PRECONDITION(children.size() == 3, "SubTintIntLogicalFunction requires 3 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view SubTintIntLogicalFunction::getType() const { return NAME; } +std::string_view SubTintIntLogicalFunction::getType() const +{ + return NAME; +} bool SubTintIntLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string SubTintIntLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -76,7 +95,9 @@ LogicalFunction SubTintIntLogicalFunction::withInferredDataType(const Schema& sc std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -86,7 +107,9 @@ SerializableFunction SubTintIntLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } diff --git a/nes-logical-operators/src/Functions/Meos/SubTnumberTnumberLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/SubTnumberTnumberLogicalFunction.cpp index 844fe38ede..cd8bbbd10a 100644 --- a/nes-logical-operators/src/Functions/Meos/SubTnumberTnumberLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/SubTnumberTnumberLogicalFunction.cpp @@ -26,46 +26,63 @@ namespace NES { -SubTnumberTnumberLogicalFunction::SubTnumberTnumberLogicalFunction(LogicalFunction value1, - LogicalFunction value2, - LogicalFunction ts) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +SubTnumberTnumberLogicalFunction::SubTnumberTnumberLogicalFunction(LogicalFunction traj, + LogicalFunction arg0) + : dataType(DataTypeProvider::provideDataType(DataType::Type::VARSIZED)) { - parameters.reserve(3); - parameters.push_back(std::move(value1)); - parameters.push_back(std::move(value2)); - parameters.push_back(std::move(ts)); + parameters.reserve(2); + parameters.push_back(std::move(traj)); + parameters.push_back(std::move(arg0)); } -DataType SubTnumberTnumberLogicalFunction::getDataType() const { return dataType; } +DataType SubTnumberTnumberLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction SubTnumberTnumberLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector SubTnumberTnumberLogicalFunction::getChildren() const { return parameters; } +std::vector SubTnumberTnumberLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction SubTnumberTnumberLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 3, "SubTnumberTnumberLogicalFunction requires 3 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 2, "SubTnumberTnumberLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view SubTnumberTnumberLogicalFunction::getType() const { return NAME; } +std::string_view SubTnumberTnumberLogicalFunction::getType() const +{ + return NAME; +} bool SubTnumberTnumberLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string SubTnumberTnumberLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -76,7 +93,9 @@ LogicalFunction SubTnumberTnumberLogicalFunction::withInferredDataType(const Sch std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -86,20 +105,21 @@ SerializableFunction SubTnumberTnumberLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterSubTnumberTnumberLogicalFunction( LogicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.children.size() == 3, - "SubTnumberTnumberLogicalFunction requires 3 children but got {}", + PRECONDITION(arguments.children.size() == 2, + "SubTnumberTnumberLogicalFunction requires 2 children but got {}", arguments.children.size()); auto arg0 = std::move(arguments.children[0]); auto arg1 = std::move(arguments.children[1]); - auto arg2 = std::move(arguments.children[2]); - return SubTnumberTnumberLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); + return SubTnumberTnumberLogicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TEqTextTtextLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TEqTextTtextLogicalFunction.cpp new file mode 100644 index 0000000000..e9cbbdf3cd --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TEqTextTtextLogicalFunction.cpp @@ -0,0 +1,128 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TEqTextTtextLogicalFunction::TEqTextTtextLogicalFunction(LogicalFunction arg0, + LogicalFunction value, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(arg0)); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(ts)); +} + +DataType TEqTextTtextLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction TEqTextTtextLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector TEqTextTtextLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction TEqTextTtextLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "TEqTextTtextLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; +} + +std::string_view TEqTextTtextLogicalFunction::getType() const +{ + return NAME; +} + +bool TEqTextTtextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } + return false; +} + +std::string TEqTextTtextLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TEqTextTtextLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); +} + +SerializableFunction TEqTextTtextLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTEqTextTtextLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "TEqTextTtextLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return TEqTextTtextLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TEqTtextTextLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TEqTtextTextLogicalFunction.cpp new file mode 100644 index 0000000000..a0c102c9dc --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TEqTtextTextLogicalFunction.cpp @@ -0,0 +1,128 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TEqTtextTextLogicalFunction::TEqTtextTextLogicalFunction(LogicalFunction value, + LogicalFunction ts, + LogicalFunction arg0) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(arg0)); +} + +DataType TEqTtextTextLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction TEqTtextTextLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector TEqTtextTextLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction TEqTtextTextLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "TEqTtextTextLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; +} + +std::string_view TEqTtextTextLogicalFunction::getType() const +{ + return NAME; +} + +bool TEqTtextTextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } + return false; +} + +std::string TEqTtextTextLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TEqTtextTextLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); +} + +SerializableFunction TEqTtextTextLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTEqTtextTextLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "TEqTtextTextLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return TEqTtextTextLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TGeTextTtextLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TGeTextTtextLogicalFunction.cpp new file mode 100644 index 0000000000..19746e11cd --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TGeTextTtextLogicalFunction.cpp @@ -0,0 +1,128 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TGeTextTtextLogicalFunction::TGeTextTtextLogicalFunction(LogicalFunction arg0, + LogicalFunction value, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(arg0)); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(ts)); +} + +DataType TGeTextTtextLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction TGeTextTtextLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector TGeTextTtextLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction TGeTextTtextLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "TGeTextTtextLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; +} + +std::string_view TGeTextTtextLogicalFunction::getType() const +{ + return NAME; +} + +bool TGeTextTtextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } + return false; +} + +std::string TGeTextTtextLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TGeTextTtextLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); +} + +SerializableFunction TGeTextTtextLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTGeTextTtextLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "TGeTextTtextLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return TGeTextTtextLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TGeTtextTextLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TGeTtextTextLogicalFunction.cpp new file mode 100644 index 0000000000..ce731c6baa --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TGeTtextTextLogicalFunction.cpp @@ -0,0 +1,128 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TGeTtextTextLogicalFunction::TGeTtextTextLogicalFunction(LogicalFunction value, + LogicalFunction ts, + LogicalFunction arg0) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(arg0)); +} + +DataType TGeTtextTextLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction TGeTtextTextLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector TGeTtextTextLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction TGeTtextTextLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "TGeTtextTextLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; +} + +std::string_view TGeTtextTextLogicalFunction::getType() const +{ + return NAME; +} + +bool TGeTtextTextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } + return false; +} + +std::string TGeTtextTextLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TGeTtextTextLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); +} + +SerializableFunction TGeTtextTextLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTGeTtextTextLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "TGeTtextTextLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return TGeTtextTextLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TGtTextTtextLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TGtTextTtextLogicalFunction.cpp new file mode 100644 index 0000000000..1358e902bf --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TGtTextTtextLogicalFunction.cpp @@ -0,0 +1,128 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TGtTextTtextLogicalFunction::TGtTextTtextLogicalFunction(LogicalFunction arg0, + LogicalFunction value, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(arg0)); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(ts)); +} + +DataType TGtTextTtextLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction TGtTextTtextLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector TGtTextTtextLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction TGtTextTtextLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "TGtTextTtextLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; +} + +std::string_view TGtTextTtextLogicalFunction::getType() const +{ + return NAME; +} + +bool TGtTextTtextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } + return false; +} + +std::string TGtTextTtextLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TGtTextTtextLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); +} + +SerializableFunction TGtTextTtextLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTGtTextTtextLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "TGtTextTtextLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return TGtTextTtextLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TGtTtextTextLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TGtTtextTextLogicalFunction.cpp new file mode 100644 index 0000000000..f520dfe274 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TGtTtextTextLogicalFunction.cpp @@ -0,0 +1,128 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TGtTtextTextLogicalFunction::TGtTtextTextLogicalFunction(LogicalFunction value, + LogicalFunction ts, + LogicalFunction arg0) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(arg0)); +} + +DataType TGtTtextTextLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction TGtTtextTextLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector TGtTtextTextLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction TGtTtextTextLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "TGtTtextTextLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; +} + +std::string_view TGtTtextTextLogicalFunction::getType() const +{ + return NAME; +} + +bool TGtTtextTextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } + return false; +} + +std::string TGtTtextTextLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TGtTtextTextLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); +} + +SerializableFunction TGtTtextTextLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTGtTtextTextLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "TGtTtextTextLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return TGtTtextTextLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TLeTextTtextLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TLeTextTtextLogicalFunction.cpp new file mode 100644 index 0000000000..fe2276ff7c --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TLeTextTtextLogicalFunction.cpp @@ -0,0 +1,128 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TLeTextTtextLogicalFunction::TLeTextTtextLogicalFunction(LogicalFunction arg0, + LogicalFunction value, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(arg0)); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(ts)); +} + +DataType TLeTextTtextLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction TLeTextTtextLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector TLeTextTtextLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction TLeTextTtextLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "TLeTextTtextLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; +} + +std::string_view TLeTextTtextLogicalFunction::getType() const +{ + return NAME; +} + +bool TLeTextTtextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } + return false; +} + +std::string TLeTextTtextLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TLeTextTtextLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); +} + +SerializableFunction TLeTextTtextLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTLeTextTtextLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "TLeTextTtextLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return TLeTextTtextLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TLeTtextTextLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TLeTtextTextLogicalFunction.cpp new file mode 100644 index 0000000000..cb08e562c8 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TLeTtextTextLogicalFunction.cpp @@ -0,0 +1,128 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TLeTtextTextLogicalFunction::TLeTtextTextLogicalFunction(LogicalFunction value, + LogicalFunction ts, + LogicalFunction arg0) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(arg0)); +} + +DataType TLeTtextTextLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction TLeTtextTextLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector TLeTtextTextLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction TLeTtextTextLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "TLeTtextTextLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; +} + +std::string_view TLeTtextTextLogicalFunction::getType() const +{ + return NAME; +} + +bool TLeTtextTextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } + return false; +} + +std::string TLeTtextTextLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TLeTtextTextLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); +} + +SerializableFunction TLeTtextTextLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTLeTtextTextLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "TLeTtextTextLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return TLeTtextTextLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TLtTextTtextLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TLtTextTtextLogicalFunction.cpp new file mode 100644 index 0000000000..feb9c52352 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TLtTextTtextLogicalFunction.cpp @@ -0,0 +1,128 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TLtTextTtextLogicalFunction::TLtTextTtextLogicalFunction(LogicalFunction arg0, + LogicalFunction value, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(arg0)); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(ts)); +} + +DataType TLtTextTtextLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction TLtTextTtextLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector TLtTextTtextLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction TLtTextTtextLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "TLtTextTtextLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; +} + +std::string_view TLtTextTtextLogicalFunction::getType() const +{ + return NAME; +} + +bool TLtTextTtextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } + return false; +} + +std::string TLtTextTtextLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TLtTextTtextLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); +} + +SerializableFunction TLtTextTtextLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTLtTextTtextLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "TLtTextTtextLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return TLtTextTtextLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TLtTtextTextLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TLtTtextTextLogicalFunction.cpp new file mode 100644 index 0000000000..8db59152c0 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TLtTtextTextLogicalFunction.cpp @@ -0,0 +1,128 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TLtTtextTextLogicalFunction::TLtTtextTextLogicalFunction(LogicalFunction value, + LogicalFunction ts, + LogicalFunction arg0) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(arg0)); +} + +DataType TLtTtextTextLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction TLtTtextTextLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector TLtTtextTextLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction TLtTtextTextLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "TLtTtextTextLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; +} + +std::string_view TLtTtextTextLogicalFunction::getType() const +{ + return NAME; +} + +bool TLtTtextTextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } + return false; +} + +std::string TLtTtextTextLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TLtTtextTextLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); +} + +SerializableFunction TLtTtextTextLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTLtTtextTextLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "TLtTtextTextLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return TLtTtextTextLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TNeTextTtextLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TNeTextTtextLogicalFunction.cpp new file mode 100644 index 0000000000..57ff63982c --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TNeTextTtextLogicalFunction.cpp @@ -0,0 +1,128 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TNeTextTtextLogicalFunction::TNeTextTtextLogicalFunction(LogicalFunction arg0, + LogicalFunction value, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(arg0)); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(ts)); +} + +DataType TNeTextTtextLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction TNeTextTtextLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector TNeTextTtextLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction TNeTextTtextLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "TNeTextTtextLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; +} + +std::string_view TNeTextTtextLogicalFunction::getType() const +{ + return NAME; +} + +bool TNeTextTtextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } + return false; +} + +std::string TNeTextTtextLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TNeTextTtextLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); +} + +SerializableFunction TNeTextTtextLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTNeTextTtextLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "TNeTextTtextLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return TNeTextTtextLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TNeTtextTextLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TNeTtextTextLogicalFunction.cpp new file mode 100644 index 0000000000..8715c6021a --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TNeTtextTextLogicalFunction.cpp @@ -0,0 +1,128 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TNeTtextTextLogicalFunction::TNeTtextTextLogicalFunction(LogicalFunction value, + LogicalFunction ts, + LogicalFunction arg0) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(3); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(arg0)); +} + +DataType TNeTtextTextLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction TNeTtextTextLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector TNeTtextTextLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction TNeTtextTextLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 3, "TNeTtextTextLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; +} + +std::string_view TNeTtextTextLogicalFunction::getType() const +{ + return NAME; +} + +bool TNeTtextTextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } + return false; +} + +std::string TNeTtextTextLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TNeTtextTextLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); +} + +SerializableFunction TNeTtextTextLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTNeTtextTextLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 3, + "TNeTtextTextLogicalFunction requires 3 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return TNeTtextTextLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TandBoolTboolLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TandBoolTboolLogicalFunction.cpp index fc0338db82..7684111cc4 100644 --- a/nes-logical-operators/src/Functions/Meos/TandBoolTboolLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/TandBoolTboolLogicalFunction.cpp @@ -26,46 +26,65 @@ namespace NES { -TandBoolTboolLogicalFunction::TandBoolTboolLogicalFunction(LogicalFunction value, - LogicalFunction threshold, - LogicalFunction ts) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +TandBoolTboolLogicalFunction::TandBoolTboolLogicalFunction(LogicalFunction arg0, + LogicalFunction value, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::BOOLEAN)) { parameters.reserve(3); + parameters.push_back(std::move(arg0)); parameters.push_back(std::move(value)); - parameters.push_back(std::move(threshold)); parameters.push_back(std::move(ts)); } -DataType TandBoolTboolLogicalFunction::getDataType() const { return dataType; } +DataType TandBoolTboolLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction TandBoolTboolLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector TandBoolTboolLogicalFunction::getChildren() const { return parameters; } +std::vector TandBoolTboolLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction TandBoolTboolLogicalFunction::withChildren(const std::vector& children) const { PRECONDITION(children.size() == 3, "TandBoolTboolLogicalFunction requires 3 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view TandBoolTboolLogicalFunction::getType() const { return NAME; } +std::string_view TandBoolTboolLogicalFunction::getType() const +{ + return NAME; +} bool TandBoolTboolLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string TandBoolTboolLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -76,7 +95,9 @@ LogicalFunction TandBoolTboolLogicalFunction::withInferredDataType(const Schema& std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -86,7 +107,9 @@ SerializableFunction TandBoolTboolLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } diff --git a/nes-logical-operators/src/Functions/Meos/TandTboolBoolLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TandTboolBoolLogicalFunction.cpp index 5e7300f734..85982de0ca 100644 --- a/nes-logical-operators/src/Functions/Meos/TandTboolBoolLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/TandTboolBoolLogicalFunction.cpp @@ -27,45 +27,64 @@ namespace NES { TandTboolBoolLogicalFunction::TandTboolBoolLogicalFunction(LogicalFunction value, - LogicalFunction threshold, - LogicalFunction ts) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) + LogicalFunction ts, + LogicalFunction arg0) + : dataType(DataTypeProvider::provideDataType(DataType::Type::BOOLEAN)) { parameters.reserve(3); parameters.push_back(std::move(value)); - parameters.push_back(std::move(threshold)); parameters.push_back(std::move(ts)); + parameters.push_back(std::move(arg0)); } -DataType TandTboolBoolLogicalFunction::getDataType() const { return dataType; } +DataType TandTboolBoolLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction TandTboolBoolLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector TandTboolBoolLogicalFunction::getChildren() const { return parameters; } +std::vector TandTboolBoolLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction TandTboolBoolLogicalFunction::withChildren(const std::vector& children) const { PRECONDITION(children.size() == 3, "TandTboolBoolLogicalFunction requires 3 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view TandTboolBoolLogicalFunction::getType() const { return NAME; } +std::string_view TandTboolBoolLogicalFunction::getType() const +{ + return NAME; +} bool TandTboolBoolLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string TandTboolBoolLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -76,7 +95,9 @@ LogicalFunction TandTboolBoolLogicalFunction::withInferredDataType(const Schema& std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -86,7 +107,9 @@ SerializableFunction TandTboolBoolLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } diff --git a/nes-logical-operators/src/Functions/Meos/TandTboolTboolLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TandTboolTboolLogicalFunction.cpp index c8023935d5..6fe4d7d7bc 100644 --- a/nes-logical-operators/src/Functions/Meos/TandTboolTboolLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/TandTboolTboolLogicalFunction.cpp @@ -26,46 +26,63 @@ namespace NES { -TandTboolTboolLogicalFunction::TandTboolTboolLogicalFunction(LogicalFunction value, - LogicalFunction threshold, - LogicalFunction ts) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +TandTboolTboolLogicalFunction::TandTboolTboolLogicalFunction(LogicalFunction traj, + LogicalFunction arg0) + : dataType(DataTypeProvider::provideDataType(DataType::Type::VARSIZED)) { - parameters.reserve(3); - parameters.push_back(std::move(value)); - parameters.push_back(std::move(threshold)); - parameters.push_back(std::move(ts)); + parameters.reserve(2); + parameters.push_back(std::move(traj)); + parameters.push_back(std::move(arg0)); } -DataType TandTboolTboolLogicalFunction::getDataType() const { return dataType; } +DataType TandTboolTboolLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction TandTboolTboolLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector TandTboolTboolLogicalFunction::getChildren() const { return parameters; } +std::vector TandTboolTboolLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction TandTboolTboolLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 3, "TandTboolTboolLogicalFunction requires 3 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 2, "TandTboolTboolLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view TandTboolTboolLogicalFunction::getType() const { return NAME; } +std::string_view TandTboolTboolLogicalFunction::getType() const +{ + return NAME; +} bool TandTboolTboolLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string TandTboolTboolLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -76,7 +93,9 @@ LogicalFunction TandTboolTboolLogicalFunction::withInferredDataType(const Schema std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -86,20 +105,21 @@ SerializableFunction TandTboolTboolLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTandTboolTboolLogicalFunction( LogicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.children.size() == 3, - "TandTboolTboolLogicalFunction requires 3 children but got {}", + PRECONDITION(arguments.children.size() == 2, + "TandTboolTboolLogicalFunction requires 2 children but got {}", arguments.children.size()); auto arg0 = std::move(arguments.children[0]); auto arg1 = std::move(arguments.children[1]); - auto arg2 = std::move(arguments.children[2]); - return TandTboolTboolLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); + return TandTboolTboolLogicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TbigintScaleValueLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TbigintScaleValueLogicalFunction.cpp index e8e23a4277..ba0a7f7b7e 100644 --- a/nes-logical-operators/src/Functions/Meos/TbigintScaleValueLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/TbigintScaleValueLogicalFunction.cpp @@ -27,45 +27,64 @@ namespace NES { TbigintScaleValueLogicalFunction::TbigintScaleValueLogicalFunction(LogicalFunction value, - LogicalFunction ts, - LogicalFunction width) + LogicalFunction ts, + LogicalFunction arg0) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(3); parameters.push_back(std::move(value)); parameters.push_back(std::move(ts)); - parameters.push_back(std::move(width)); + parameters.push_back(std::move(arg0)); } -DataType TbigintScaleValueLogicalFunction::getDataType() const { return dataType; } +DataType TbigintScaleValueLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction TbigintScaleValueLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector TbigintScaleValueLogicalFunction::getChildren() const { return parameters; } +std::vector TbigintScaleValueLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction TbigintScaleValueLogicalFunction::withChildren(const std::vector& children) const { PRECONDITION(children.size() == 3, "TbigintScaleValueLogicalFunction requires 3 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view TbigintScaleValueLogicalFunction::getType() const { return NAME; } +std::string_view TbigintScaleValueLogicalFunction::getType() const +{ + return NAME; +} bool TbigintScaleValueLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string TbigintScaleValueLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -76,7 +95,9 @@ LogicalFunction TbigintScaleValueLogicalFunction::withInferredDataType(const Sch std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -86,7 +107,9 @@ SerializableFunction TbigintScaleValueLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } diff --git a/nes-logical-operators/src/Functions/Meos/TbigintShiftScaleValueLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TbigintShiftScaleValueLogicalFunction.cpp index ea572eba5d..e827f5208d 100644 --- a/nes-logical-operators/src/Functions/Meos/TbigintShiftScaleValueLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/TbigintShiftScaleValueLogicalFunction.cpp @@ -27,47 +27,66 @@ namespace NES { TbigintShiftScaleValueLogicalFunction::TbigintShiftScaleValueLogicalFunction(LogicalFunction value, - LogicalFunction ts, - LogicalFunction shift, - LogicalFunction width) + LogicalFunction ts, + LogicalFunction arg0, + LogicalFunction arg1) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(4); parameters.push_back(std::move(value)); parameters.push_back(std::move(ts)); - parameters.push_back(std::move(shift)); - parameters.push_back(std::move(width)); + parameters.push_back(std::move(arg0)); + parameters.push_back(std::move(arg1)); } -DataType TbigintShiftScaleValueLogicalFunction::getDataType() const { return dataType; } +DataType TbigintShiftScaleValueLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction TbigintShiftScaleValueLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector TbigintShiftScaleValueLogicalFunction::getChildren() const { return parameters; } +std::vector TbigintShiftScaleValueLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction TbigintShiftScaleValueLogicalFunction::withChildren(const std::vector& children) const { PRECONDITION(children.size() == 4, "TbigintShiftScaleValueLogicalFunction requires 4 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view TbigintShiftScaleValueLogicalFunction::getType() const { return NAME; } +std::string_view TbigintShiftScaleValueLogicalFunction::getType() const +{ + return NAME; +} bool TbigintShiftScaleValueLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string TbigintShiftScaleValueLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -78,7 +97,9 @@ LogicalFunction TbigintShiftScaleValueLogicalFunction::withInferredDataType(cons std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -88,7 +109,9 @@ SerializableFunction TbigintShiftScaleValueLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } diff --git a/nes-logical-operators/src/Functions/Meos/TbigintShiftValueLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TbigintShiftValueLogicalFunction.cpp index 090ac77e50..f8ec40e420 100644 --- a/nes-logical-operators/src/Functions/Meos/TbigintShiftValueLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/TbigintShiftValueLogicalFunction.cpp @@ -27,45 +27,64 @@ namespace NES { TbigintShiftValueLogicalFunction::TbigintShiftValueLogicalFunction(LogicalFunction value, - LogicalFunction ts, - LogicalFunction shift) + LogicalFunction ts, + LogicalFunction arg0) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(3); parameters.push_back(std::move(value)); parameters.push_back(std::move(ts)); - parameters.push_back(std::move(shift)); + parameters.push_back(std::move(arg0)); } -DataType TbigintShiftValueLogicalFunction::getDataType() const { return dataType; } +DataType TbigintShiftValueLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction TbigintShiftValueLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector TbigintShiftValueLogicalFunction::getChildren() const { return parameters; } +std::vector TbigintShiftValueLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction TbigintShiftValueLogicalFunction::withChildren(const std::vector& children) const { PRECONDITION(children.size() == 3, "TbigintShiftValueLogicalFunction requires 3 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view TbigintShiftValueLogicalFunction::getType() const { return NAME; } +std::string_view TbigintShiftValueLogicalFunction::getType() const +{ + return NAME; +} bool TbigintShiftValueLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string TbigintShiftValueLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -76,7 +95,9 @@ LogicalFunction TbigintShiftValueLogicalFunction::withInferredDataType(const Sch std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -86,7 +107,9 @@ SerializableFunction TbigintShiftValueLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } diff --git a/nes-logical-operators/src/Functions/Meos/TbigintToTfloatLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TbigintToTfloatLogicalFunction.cpp index 65b2a6cefd..8edc6c58aa 100644 --- a/nes-logical-operators/src/Functions/Meos/TbigintToTfloatLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/TbigintToTfloatLogicalFunction.cpp @@ -27,7 +27,7 @@ namespace NES { TbigintToTfloatLogicalFunction::TbigintToTfloatLogicalFunction(LogicalFunction value, - LogicalFunction ts) + LogicalFunction ts) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(2); @@ -35,35 +35,54 @@ TbigintToTfloatLogicalFunction::TbigintToTfloatLogicalFunction(LogicalFunction v parameters.push_back(std::move(ts)); } -DataType TbigintToTfloatLogicalFunction::getDataType() const { return dataType; } +DataType TbigintToTfloatLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction TbigintToTfloatLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector TbigintToTfloatLogicalFunction::getChildren() const { return parameters; } +std::vector TbigintToTfloatLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction TbigintToTfloatLogicalFunction::withChildren(const std::vector& children) const { PRECONDITION(children.size() == 2, "TbigintToTfloatLogicalFunction requires 2 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view TbigintToTfloatLogicalFunction::getType() const { return NAME; } +std::string_view TbigintToTfloatLogicalFunction::getType() const +{ + return NAME; +} bool TbigintToTfloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string TbigintToTfloatLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -74,7 +93,9 @@ LogicalFunction TbigintToTfloatLogicalFunction::withInferredDataType(const Schem std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -84,7 +105,9 @@ SerializableFunction TbigintToTfloatLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } diff --git a/nes-logical-operators/src/Functions/Meos/TbigintToTintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TbigintToTintLogicalFunction.cpp index 312df7d30a..98d455635b 100644 --- a/nes-logical-operators/src/Functions/Meos/TbigintToTintLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/TbigintToTintLogicalFunction.cpp @@ -27,43 +27,62 @@ namespace NES { TbigintToTintLogicalFunction::TbigintToTintLogicalFunction(LogicalFunction value, - LogicalFunction ts) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) { parameters.reserve(2); parameters.push_back(std::move(value)); parameters.push_back(std::move(ts)); } -DataType TbigintToTintLogicalFunction::getDataType() const { return dataType; } +DataType TbigintToTintLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction TbigintToTintLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector TbigintToTintLogicalFunction::getChildren() const { return parameters; } +std::vector TbigintToTintLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction TbigintToTintLogicalFunction::withChildren(const std::vector& children) const { PRECONDITION(children.size() == 2, "TbigintToTintLogicalFunction requires 2 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view TbigintToTintLogicalFunction::getType() const { return NAME; } +std::string_view TbigintToTintLogicalFunction::getType() const +{ + return NAME; +} bool TbigintToTintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string TbigintToTintLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -74,7 +93,9 @@ LogicalFunction TbigintToTintLogicalFunction::withInferredDataType(const Schema& std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -84,7 +105,9 @@ SerializableFunction TbigintToTintLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } diff --git a/nes-logical-operators/src/Functions/Meos/TboolToTintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TboolToTintLogicalFunction.cpp index 7ffe35b195..e588b4993e 100644 --- a/nes-logical-operators/src/Functions/Meos/TboolToTintLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/TboolToTintLogicalFunction.cpp @@ -27,43 +27,62 @@ namespace NES { TboolToTintLogicalFunction::TboolToTintLogicalFunction(LogicalFunction value, - LogicalFunction ts) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) { parameters.reserve(2); parameters.push_back(std::move(value)); parameters.push_back(std::move(ts)); } -DataType TboolToTintLogicalFunction::getDataType() const { return dataType; } +DataType TboolToTintLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction TboolToTintLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector TboolToTintLogicalFunction::getChildren() const { return parameters; } +std::vector TboolToTintLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction TboolToTintLogicalFunction::withChildren(const std::vector& children) const { PRECONDITION(children.size() == 2, "TboolToTintLogicalFunction requires 2 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view TboolToTintLogicalFunction::getType() const { return NAME; } +std::string_view TboolToTintLogicalFunction::getType() const +{ + return NAME; +} bool TboolToTintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string TboolToTintLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -74,7 +93,9 @@ LogicalFunction TboolToTintLogicalFunction::withInferredDataType(const Schema& s std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -84,7 +105,9 @@ SerializableFunction TboolToTintLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } diff --git a/nes-logical-operators/src/Functions/Meos/TdistanceTfloatFloatLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TdistanceTfloatFloatLogicalFunction.cpp index 3532410708..595196749b 100644 --- a/nes-logical-operators/src/Functions/Meos/TdistanceTfloatFloatLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/TdistanceTfloatFloatLogicalFunction.cpp @@ -27,45 +27,64 @@ namespace NES { TdistanceTfloatFloatLogicalFunction::TdistanceTfloatFloatLogicalFunction(LogicalFunction value, - LogicalFunction ts, - LogicalFunction d) + LogicalFunction ts, + LogicalFunction arg0) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(3); parameters.push_back(std::move(value)); parameters.push_back(std::move(ts)); - parameters.push_back(std::move(d)); + parameters.push_back(std::move(arg0)); } -DataType TdistanceTfloatFloatLogicalFunction::getDataType() const { return dataType; } +DataType TdistanceTfloatFloatLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction TdistanceTfloatFloatLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector TdistanceTfloatFloatLogicalFunction::getChildren() const { return parameters; } +std::vector TdistanceTfloatFloatLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction TdistanceTfloatFloatLogicalFunction::withChildren(const std::vector& children) const { PRECONDITION(children.size() == 3, "TdistanceTfloatFloatLogicalFunction requires 3 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view TdistanceTfloatFloatLogicalFunction::getType() const { return NAME; } +std::string_view TdistanceTfloatFloatLogicalFunction::getType() const +{ + return NAME; +} bool TdistanceTfloatFloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string TdistanceTfloatFloatLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -76,7 +95,9 @@ LogicalFunction TdistanceTfloatFloatLogicalFunction::withInferredDataType(const std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -86,7 +107,9 @@ SerializableFunction TdistanceTfloatFloatLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } diff --git a/nes-logical-operators/src/Functions/Meos/TdistanceTintIntLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TdistanceTintIntLogicalFunction.cpp index 01517365af..1e3293e4c2 100644 --- a/nes-logical-operators/src/Functions/Meos/TdistanceTintIntLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/TdistanceTintIntLogicalFunction.cpp @@ -27,45 +27,64 @@ namespace NES { TdistanceTintIntLogicalFunction::TdistanceTintIntLogicalFunction(LogicalFunction value, - LogicalFunction ts, - LogicalFunction d) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) + LogicalFunction ts, + LogicalFunction arg0) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) { parameters.reserve(3); parameters.push_back(std::move(value)); parameters.push_back(std::move(ts)); - parameters.push_back(std::move(d)); + parameters.push_back(std::move(arg0)); } -DataType TdistanceTintIntLogicalFunction::getDataType() const { return dataType; } +DataType TdistanceTintIntLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction TdistanceTintIntLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector TdistanceTintIntLogicalFunction::getChildren() const { return parameters; } +std::vector TdistanceTintIntLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction TdistanceTintIntLogicalFunction::withChildren(const std::vector& children) const { PRECONDITION(children.size() == 3, "TdistanceTintIntLogicalFunction requires 3 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view TdistanceTintIntLogicalFunction::getType() const { return NAME; } +std::string_view TdistanceTintIntLogicalFunction::getType() const +{ + return NAME; +} bool TdistanceTintIntLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string TdistanceTintIntLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -76,7 +95,9 @@ LogicalFunction TdistanceTintIntLogicalFunction::withInferredDataType(const Sche std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -86,7 +107,9 @@ SerializableFunction TdistanceTintIntLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } diff --git a/nes-logical-operators/src/Functions/Meos/TdistanceTnumberTnumberLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TdistanceTnumberTnumberLogicalFunction.cpp index 2ff41374c1..e745bd00d3 100644 --- a/nes-logical-operators/src/Functions/Meos/TdistanceTnumberTnumberLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/TdistanceTnumberTnumberLogicalFunction.cpp @@ -26,46 +26,63 @@ namespace NES { -TdistanceTnumberTnumberLogicalFunction::TdistanceTnumberTnumberLogicalFunction(LogicalFunction value1, - LogicalFunction value2, - LogicalFunction ts) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +TdistanceTnumberTnumberLogicalFunction::TdistanceTnumberTnumberLogicalFunction(LogicalFunction traj, + LogicalFunction arg0) + : dataType(DataTypeProvider::provideDataType(DataType::Type::VARSIZED)) { - parameters.reserve(3); - parameters.push_back(std::move(value1)); - parameters.push_back(std::move(value2)); - parameters.push_back(std::move(ts)); + parameters.reserve(2); + parameters.push_back(std::move(traj)); + parameters.push_back(std::move(arg0)); } -DataType TdistanceTnumberTnumberLogicalFunction::getDataType() const { return dataType; } +DataType TdistanceTnumberTnumberLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction TdistanceTnumberTnumberLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector TdistanceTnumberTnumberLogicalFunction::getChildren() const { return parameters; } +std::vector TdistanceTnumberTnumberLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction TdistanceTnumberTnumberLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 3, "TdistanceTnumberTnumberLogicalFunction requires 3 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 2, "TdistanceTnumberTnumberLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view TdistanceTnumberTnumberLogicalFunction::getType() const { return NAME; } +std::string_view TdistanceTnumberTnumberLogicalFunction::getType() const +{ + return NAME; +} bool TdistanceTnumberTnumberLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string TdistanceTnumberTnumberLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -76,7 +93,9 @@ LogicalFunction TdistanceTnumberTnumberLogicalFunction::withInferredDataType(con std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -86,20 +105,21 @@ SerializableFunction TdistanceTnumberTnumberLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTdistanceTnumberTnumberLogicalFunction( LogicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.children.size() == 3, - "TdistanceTnumberTnumberLogicalFunction requires 3 children but got {}", + PRECONDITION(arguments.children.size() == 2, + "TdistanceTnumberTnumberLogicalFunction requires 2 children but got {}", arguments.children.size()); auto arg0 = std::move(arguments.children[0]); auto arg1 = std::move(arguments.children[1]); - auto arg2 = std::move(arguments.children[2]); - return TdistanceTnumberTnumberLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); + return TdistanceTnumberTnumberLogicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TemporalAContainsTNpointGeometryLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TemporalAContainsTNpointGeometryLogicalFunction.cpp new file mode 100644 index 0000000000..dba3ab64a2 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TemporalAContainsTNpointGeometryLogicalFunction.cpp @@ -0,0 +1,131 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TemporalAContainsTNpointGeometryLogicalFunction::TemporalAContainsTNpointGeometryLogicalFunction(LogicalFunction rid, + LogicalFunction fraction, + LogicalFunction timestamp, + LogicalFunction geometry) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) +{ + parameters.reserve(4); + parameters.push_back(std::move(rid)); + parameters.push_back(std::move(fraction)); + parameters.push_back(std::move(timestamp)); + parameters.push_back(std::move(geometry)); +} + +DataType TemporalAContainsTNpointGeometryLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction TemporalAContainsTNpointGeometryLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector TemporalAContainsTNpointGeometryLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction TemporalAContainsTNpointGeometryLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 4, "TemporalAContainsTNpointGeometryLogicalFunction requires 4 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; +} + +std::string_view TemporalAContainsTNpointGeometryLogicalFunction::getType() const +{ + return NAME; +} + +bool TemporalAContainsTNpointGeometryLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } + return false; +} + +std::string TemporalAContainsTNpointGeometryLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TemporalAContainsTNpointGeometryLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); +} + +SerializableFunction TemporalAContainsTNpointGeometryLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTemporalAContainsTNpointGeometryLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 4, + "TemporalAContainsTNpointGeometryLogicalFunction requires 4 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + return TemporalAContainsTNpointGeometryLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TemporalAContainsTNpointTNpointLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TemporalAContainsTNpointTNpointLogicalFunction.cpp new file mode 100644 index 0000000000..cdfed10b7b --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TemporalAContainsTNpointTNpointLogicalFunction.cpp @@ -0,0 +1,137 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TemporalAContainsTNpointTNpointLogicalFunction::TemporalAContainsTNpointTNpointLogicalFunction(LogicalFunction ridA, + LogicalFunction fractionA, + LogicalFunction tsA, + LogicalFunction ridB, + LogicalFunction fractionB, + LogicalFunction tsB) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) +{ + parameters.reserve(6); + parameters.push_back(std::move(ridA)); + parameters.push_back(std::move(fractionA)); + parameters.push_back(std::move(tsA)); + parameters.push_back(std::move(ridB)); + parameters.push_back(std::move(fractionB)); + parameters.push_back(std::move(tsB)); +} + +DataType TemporalAContainsTNpointTNpointLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction TemporalAContainsTNpointTNpointLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector TemporalAContainsTNpointTNpointLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction TemporalAContainsTNpointTNpointLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 6, "TemporalAContainsTNpointTNpointLogicalFunction requires 6 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; +} + +std::string_view TemporalAContainsTNpointTNpointLogicalFunction::getType() const +{ + return NAME; +} + +bool TemporalAContainsTNpointTNpointLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } + return false; +} + +std::string TemporalAContainsTNpointTNpointLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TemporalAContainsTNpointTNpointLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); +} + +SerializableFunction TemporalAContainsTNpointTNpointLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTemporalAContainsTNpointTNpointLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 6, + "TemporalAContainsTNpointTNpointLogicalFunction requires 6 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + auto arg5 = std::move(arguments.children[5]); + return TemporalAContainsTNpointTNpointLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TemporalAContainsTPoseGeometryLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TemporalAContainsTPoseGeometryLogicalFunction.cpp new file mode 100644 index 0000000000..a6f30574fd --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TemporalAContainsTPoseGeometryLogicalFunction.cpp @@ -0,0 +1,134 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TemporalAContainsTPoseGeometryLogicalFunction::TemporalAContainsTPoseGeometryLogicalFunction(LogicalFunction x, + LogicalFunction y, + LogicalFunction theta, + LogicalFunction timestamp, + LogicalFunction geometry) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) +{ + parameters.reserve(5); + parameters.push_back(std::move(x)); + parameters.push_back(std::move(y)); + parameters.push_back(std::move(theta)); + parameters.push_back(std::move(timestamp)); + parameters.push_back(std::move(geometry)); +} + +DataType TemporalAContainsTPoseGeometryLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction TemporalAContainsTPoseGeometryLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector TemporalAContainsTPoseGeometryLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction TemporalAContainsTPoseGeometryLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 5, "TemporalAContainsTPoseGeometryLogicalFunction requires 5 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; +} + +std::string_view TemporalAContainsTPoseGeometryLogicalFunction::getType() const +{ + return NAME; +} + +bool TemporalAContainsTPoseGeometryLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } + return false; +} + +std::string TemporalAContainsTPoseGeometryLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TemporalAContainsTPoseGeometryLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); +} + +SerializableFunction TemporalAContainsTPoseGeometryLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTemporalAContainsTPoseGeometryLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 5, + "TemporalAContainsTPoseGeometryLogicalFunction requires 5 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + return TemporalAContainsTPoseGeometryLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TemporalAContainsTPoseTPoseLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TemporalAContainsTPoseTPoseLogicalFunction.cpp new file mode 100644 index 0000000000..5e9e42c95d --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TemporalAContainsTPoseTPoseLogicalFunction.cpp @@ -0,0 +1,143 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TemporalAContainsTPoseTPoseLogicalFunction::TemporalAContainsTPoseTPoseLogicalFunction(LogicalFunction xA, + LogicalFunction yA, + LogicalFunction thetaA, + LogicalFunction tsA, + LogicalFunction xB, + LogicalFunction yB, + LogicalFunction thetaB, + LogicalFunction tsB) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) +{ + parameters.reserve(8); + parameters.push_back(std::move(xA)); + parameters.push_back(std::move(yA)); + parameters.push_back(std::move(thetaA)); + parameters.push_back(std::move(tsA)); + parameters.push_back(std::move(xB)); + parameters.push_back(std::move(yB)); + parameters.push_back(std::move(thetaB)); + parameters.push_back(std::move(tsB)); +} + +DataType TemporalAContainsTPoseTPoseLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction TemporalAContainsTPoseTPoseLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector TemporalAContainsTPoseTPoseLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction TemporalAContainsTPoseTPoseLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 8, "TemporalAContainsTPoseTPoseLogicalFunction requires 8 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; +} + +std::string_view TemporalAContainsTPoseTPoseLogicalFunction::getType() const +{ + return NAME; +} + +bool TemporalAContainsTPoseTPoseLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } + return false; +} + +std::string TemporalAContainsTPoseTPoseLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TemporalAContainsTPoseTPoseLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); +} + +SerializableFunction TemporalAContainsTPoseTPoseLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTemporalAContainsTPoseTPoseLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 8, + "TemporalAContainsTPoseTPoseLogicalFunction requires 8 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + auto arg5 = std::move(arguments.children[5]); + auto arg6 = std::move(arguments.children[6]); + auto arg7 = std::move(arguments.children[7]); + return TemporalAContainsTPoseTPoseLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6), std::move(arg7)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TemporalADWithinTNpointGeometryLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TemporalADWithinTNpointGeometryLogicalFunction.cpp new file mode 100644 index 0000000000..9efbfa35f8 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TemporalADWithinTNpointGeometryLogicalFunction.cpp @@ -0,0 +1,134 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TemporalADWithinTNpointGeometryLogicalFunction::TemporalADWithinTNpointGeometryLogicalFunction(LogicalFunction rid, + LogicalFunction fraction, + LogicalFunction timestamp, + LogicalFunction geometry, + LogicalFunction dist) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) +{ + parameters.reserve(5); + parameters.push_back(std::move(rid)); + parameters.push_back(std::move(fraction)); + parameters.push_back(std::move(timestamp)); + parameters.push_back(std::move(geometry)); + parameters.push_back(std::move(dist)); +} + +DataType TemporalADWithinTNpointGeometryLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction TemporalADWithinTNpointGeometryLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector TemporalADWithinTNpointGeometryLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction TemporalADWithinTNpointGeometryLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 5, "TemporalADWithinTNpointGeometryLogicalFunction requires 5 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; +} + +std::string_view TemporalADWithinTNpointGeometryLogicalFunction::getType() const +{ + return NAME; +} + +bool TemporalADWithinTNpointGeometryLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } + return false; +} + +std::string TemporalADWithinTNpointGeometryLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TemporalADWithinTNpointGeometryLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); +} + +SerializableFunction TemporalADWithinTNpointGeometryLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTemporalADWithinTNpointGeometryLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 5, + "TemporalADWithinTNpointGeometryLogicalFunction requires 5 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + return TemporalADWithinTNpointGeometryLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TemporalADWithinTNpointTNpointLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TemporalADWithinTNpointTNpointLogicalFunction.cpp new file mode 100644 index 0000000000..0fdc8260c0 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TemporalADWithinTNpointTNpointLogicalFunction.cpp @@ -0,0 +1,140 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TemporalADWithinTNpointTNpointLogicalFunction::TemporalADWithinTNpointTNpointLogicalFunction(LogicalFunction ridA, + LogicalFunction fractionA, + LogicalFunction tsA, + LogicalFunction ridB, + LogicalFunction fractionB, + LogicalFunction tsB, + LogicalFunction dist) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) +{ + parameters.reserve(7); + parameters.push_back(std::move(ridA)); + parameters.push_back(std::move(fractionA)); + parameters.push_back(std::move(tsA)); + parameters.push_back(std::move(ridB)); + parameters.push_back(std::move(fractionB)); + parameters.push_back(std::move(tsB)); + parameters.push_back(std::move(dist)); +} + +DataType TemporalADWithinTNpointTNpointLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction TemporalADWithinTNpointTNpointLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector TemporalADWithinTNpointTNpointLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction TemporalADWithinTNpointTNpointLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 7, "TemporalADWithinTNpointTNpointLogicalFunction requires 7 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; +} + +std::string_view TemporalADWithinTNpointTNpointLogicalFunction::getType() const +{ + return NAME; +} + +bool TemporalADWithinTNpointTNpointLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } + return false; +} + +std::string TemporalADWithinTNpointTNpointLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TemporalADWithinTNpointTNpointLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); +} + +SerializableFunction TemporalADWithinTNpointTNpointLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTemporalADWithinTNpointTNpointLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 7, + "TemporalADWithinTNpointTNpointLogicalFunction requires 7 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + auto arg5 = std::move(arguments.children[5]); + auto arg6 = std::move(arguments.children[6]); + return TemporalADWithinTNpointTNpointLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TemporalADWithinTPoseGeometryLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TemporalADWithinTPoseGeometryLogicalFunction.cpp new file mode 100644 index 0000000000..a6e555655f --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TemporalADWithinTPoseGeometryLogicalFunction.cpp @@ -0,0 +1,137 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TemporalADWithinTPoseGeometryLogicalFunction::TemporalADWithinTPoseGeometryLogicalFunction(LogicalFunction x, + LogicalFunction y, + LogicalFunction theta, + LogicalFunction timestamp, + LogicalFunction geometry, + LogicalFunction dist) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) +{ + parameters.reserve(6); + parameters.push_back(std::move(x)); + parameters.push_back(std::move(y)); + parameters.push_back(std::move(theta)); + parameters.push_back(std::move(timestamp)); + parameters.push_back(std::move(geometry)); + parameters.push_back(std::move(dist)); +} + +DataType TemporalADWithinTPoseGeometryLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction TemporalADWithinTPoseGeometryLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector TemporalADWithinTPoseGeometryLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction TemporalADWithinTPoseGeometryLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 6, "TemporalADWithinTPoseGeometryLogicalFunction requires 6 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; +} + +std::string_view TemporalADWithinTPoseGeometryLogicalFunction::getType() const +{ + return NAME; +} + +bool TemporalADWithinTPoseGeometryLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } + return false; +} + +std::string TemporalADWithinTPoseGeometryLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TemporalADWithinTPoseGeometryLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); +} + +SerializableFunction TemporalADWithinTPoseGeometryLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTemporalADWithinTPoseGeometryLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 6, + "TemporalADWithinTPoseGeometryLogicalFunction requires 6 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + auto arg5 = std::move(arguments.children[5]); + return TemporalADWithinTPoseGeometryLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TemporalADWithinTPoseTPoseLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TemporalADWithinTPoseTPoseLogicalFunction.cpp new file mode 100644 index 0000000000..2671303591 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TemporalADWithinTPoseTPoseLogicalFunction.cpp @@ -0,0 +1,146 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TemporalADWithinTPoseTPoseLogicalFunction::TemporalADWithinTPoseTPoseLogicalFunction(LogicalFunction xA, + LogicalFunction yA, + LogicalFunction thetaA, + LogicalFunction tsA, + LogicalFunction xB, + LogicalFunction yB, + LogicalFunction thetaB, + LogicalFunction tsB, + LogicalFunction dist) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) +{ + parameters.reserve(9); + parameters.push_back(std::move(xA)); + parameters.push_back(std::move(yA)); + parameters.push_back(std::move(thetaA)); + parameters.push_back(std::move(tsA)); + parameters.push_back(std::move(xB)); + parameters.push_back(std::move(yB)); + parameters.push_back(std::move(thetaB)); + parameters.push_back(std::move(tsB)); + parameters.push_back(std::move(dist)); +} + +DataType TemporalADWithinTPoseTPoseLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction TemporalADWithinTPoseTPoseLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector TemporalADWithinTPoseTPoseLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction TemporalADWithinTPoseTPoseLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 9, "TemporalADWithinTPoseTPoseLogicalFunction requires 9 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; +} + +std::string_view TemporalADWithinTPoseTPoseLogicalFunction::getType() const +{ + return NAME; +} + +bool TemporalADWithinTPoseTPoseLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } + return false; +} + +std::string TemporalADWithinTPoseTPoseLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TemporalADWithinTPoseTPoseLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); +} + +SerializableFunction TemporalADWithinTPoseTPoseLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTemporalADWithinTPoseTPoseLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 9, + "TemporalADWithinTPoseTPoseLogicalFunction requires 9 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + auto arg5 = std::move(arguments.children[5]); + auto arg6 = std::move(arguments.children[6]); + auto arg7 = std::move(arguments.children[7]); + auto arg8 = std::move(arguments.children[8]); + return TemporalADWithinTPoseTPoseLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6), std::move(arg7), std::move(arg8)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TemporalADisjointTNpointGeometryLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TemporalADisjointTNpointGeometryLogicalFunction.cpp new file mode 100644 index 0000000000..5173527fd2 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TemporalADisjointTNpointGeometryLogicalFunction.cpp @@ -0,0 +1,131 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TemporalADisjointTNpointGeometryLogicalFunction::TemporalADisjointTNpointGeometryLogicalFunction(LogicalFunction rid, + LogicalFunction fraction, + LogicalFunction timestamp, + LogicalFunction geometry) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) +{ + parameters.reserve(4); + parameters.push_back(std::move(rid)); + parameters.push_back(std::move(fraction)); + parameters.push_back(std::move(timestamp)); + parameters.push_back(std::move(geometry)); +} + +DataType TemporalADisjointTNpointGeometryLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction TemporalADisjointTNpointGeometryLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector TemporalADisjointTNpointGeometryLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction TemporalADisjointTNpointGeometryLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 4, "TemporalADisjointTNpointGeometryLogicalFunction requires 4 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; +} + +std::string_view TemporalADisjointTNpointGeometryLogicalFunction::getType() const +{ + return NAME; +} + +bool TemporalADisjointTNpointGeometryLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } + return false; +} + +std::string TemporalADisjointTNpointGeometryLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TemporalADisjointTNpointGeometryLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); +} + +SerializableFunction TemporalADisjointTNpointGeometryLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTemporalADisjointTNpointGeometryLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 4, + "TemporalADisjointTNpointGeometryLogicalFunction requires 4 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + return TemporalADisjointTNpointGeometryLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TemporalADisjointTNpointTNpointLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TemporalADisjointTNpointTNpointLogicalFunction.cpp new file mode 100644 index 0000000000..ec1295c537 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TemporalADisjointTNpointTNpointLogicalFunction.cpp @@ -0,0 +1,137 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TemporalADisjointTNpointTNpointLogicalFunction::TemporalADisjointTNpointTNpointLogicalFunction(LogicalFunction ridA, + LogicalFunction fractionA, + LogicalFunction tsA, + LogicalFunction ridB, + LogicalFunction fractionB, + LogicalFunction tsB) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) +{ + parameters.reserve(6); + parameters.push_back(std::move(ridA)); + parameters.push_back(std::move(fractionA)); + parameters.push_back(std::move(tsA)); + parameters.push_back(std::move(ridB)); + parameters.push_back(std::move(fractionB)); + parameters.push_back(std::move(tsB)); +} + +DataType TemporalADisjointTNpointTNpointLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction TemporalADisjointTNpointTNpointLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector TemporalADisjointTNpointTNpointLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction TemporalADisjointTNpointTNpointLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 6, "TemporalADisjointTNpointTNpointLogicalFunction requires 6 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; +} + +std::string_view TemporalADisjointTNpointTNpointLogicalFunction::getType() const +{ + return NAME; +} + +bool TemporalADisjointTNpointTNpointLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } + return false; +} + +std::string TemporalADisjointTNpointTNpointLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TemporalADisjointTNpointTNpointLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); +} + +SerializableFunction TemporalADisjointTNpointTNpointLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTemporalADisjointTNpointTNpointLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 6, + "TemporalADisjointTNpointTNpointLogicalFunction requires 6 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + auto arg5 = std::move(arguments.children[5]); + return TemporalADisjointTNpointTNpointLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TemporalADisjointTPoseGeometryLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TemporalADisjointTPoseGeometryLogicalFunction.cpp new file mode 100644 index 0000000000..69aed0913d --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TemporalADisjointTPoseGeometryLogicalFunction.cpp @@ -0,0 +1,134 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TemporalADisjointTPoseGeometryLogicalFunction::TemporalADisjointTPoseGeometryLogicalFunction(LogicalFunction x, + LogicalFunction y, + LogicalFunction theta, + LogicalFunction timestamp, + LogicalFunction geometry) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) +{ + parameters.reserve(5); + parameters.push_back(std::move(x)); + parameters.push_back(std::move(y)); + parameters.push_back(std::move(theta)); + parameters.push_back(std::move(timestamp)); + parameters.push_back(std::move(geometry)); +} + +DataType TemporalADisjointTPoseGeometryLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction TemporalADisjointTPoseGeometryLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector TemporalADisjointTPoseGeometryLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction TemporalADisjointTPoseGeometryLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 5, "TemporalADisjointTPoseGeometryLogicalFunction requires 5 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; +} + +std::string_view TemporalADisjointTPoseGeometryLogicalFunction::getType() const +{ + return NAME; +} + +bool TemporalADisjointTPoseGeometryLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } + return false; +} + +std::string TemporalADisjointTPoseGeometryLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TemporalADisjointTPoseGeometryLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); +} + +SerializableFunction TemporalADisjointTPoseGeometryLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTemporalADisjointTPoseGeometryLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 5, + "TemporalADisjointTPoseGeometryLogicalFunction requires 5 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + return TemporalADisjointTPoseGeometryLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TemporalADisjointTPoseTPoseLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TemporalADisjointTPoseTPoseLogicalFunction.cpp new file mode 100644 index 0000000000..3b2c24176c --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TemporalADisjointTPoseTPoseLogicalFunction.cpp @@ -0,0 +1,143 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TemporalADisjointTPoseTPoseLogicalFunction::TemporalADisjointTPoseTPoseLogicalFunction(LogicalFunction xA, + LogicalFunction yA, + LogicalFunction thetaA, + LogicalFunction tsA, + LogicalFunction xB, + LogicalFunction yB, + LogicalFunction thetaB, + LogicalFunction tsB) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) +{ + parameters.reserve(8); + parameters.push_back(std::move(xA)); + parameters.push_back(std::move(yA)); + parameters.push_back(std::move(thetaA)); + parameters.push_back(std::move(tsA)); + parameters.push_back(std::move(xB)); + parameters.push_back(std::move(yB)); + parameters.push_back(std::move(thetaB)); + parameters.push_back(std::move(tsB)); +} + +DataType TemporalADisjointTPoseTPoseLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction TemporalADisjointTPoseTPoseLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector TemporalADisjointTPoseTPoseLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction TemporalADisjointTPoseTPoseLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 8, "TemporalADisjointTPoseTPoseLogicalFunction requires 8 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; +} + +std::string_view TemporalADisjointTPoseTPoseLogicalFunction::getType() const +{ + return NAME; +} + +bool TemporalADisjointTPoseTPoseLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } + return false; +} + +std::string TemporalADisjointTPoseTPoseLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TemporalADisjointTPoseTPoseLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); +} + +SerializableFunction TemporalADisjointTPoseTPoseLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTemporalADisjointTPoseTPoseLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 8, + "TemporalADisjointTPoseTPoseLogicalFunction requires 8 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + auto arg5 = std::move(arguments.children[5]); + auto arg6 = std::move(arguments.children[6]); + auto arg7 = std::move(arguments.children[7]); + return TemporalADisjointTPoseTPoseLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6), std::move(arg7)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TemporalAIntersectsTNpointGeometryLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TemporalAIntersectsTNpointGeometryLogicalFunction.cpp new file mode 100644 index 0000000000..80ce0a3854 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TemporalAIntersectsTNpointGeometryLogicalFunction.cpp @@ -0,0 +1,131 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TemporalAIntersectsTNpointGeometryLogicalFunction::TemporalAIntersectsTNpointGeometryLogicalFunction(LogicalFunction rid, + LogicalFunction fraction, + LogicalFunction timestamp, + LogicalFunction geometry) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) +{ + parameters.reserve(4); + parameters.push_back(std::move(rid)); + parameters.push_back(std::move(fraction)); + parameters.push_back(std::move(timestamp)); + parameters.push_back(std::move(geometry)); +} + +DataType TemporalAIntersectsTNpointGeometryLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction TemporalAIntersectsTNpointGeometryLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector TemporalAIntersectsTNpointGeometryLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction TemporalAIntersectsTNpointGeometryLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 4, "TemporalAIntersectsTNpointGeometryLogicalFunction requires 4 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; +} + +std::string_view TemporalAIntersectsTNpointGeometryLogicalFunction::getType() const +{ + return NAME; +} + +bool TemporalAIntersectsTNpointGeometryLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } + return false; +} + +std::string TemporalAIntersectsTNpointGeometryLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TemporalAIntersectsTNpointGeometryLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); +} + +SerializableFunction TemporalAIntersectsTNpointGeometryLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTemporalAIntersectsTNpointGeometryLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 4, + "TemporalAIntersectsTNpointGeometryLogicalFunction requires 4 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + return TemporalAIntersectsTNpointGeometryLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TemporalAIntersectsTNpointTNpointLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TemporalAIntersectsTNpointTNpointLogicalFunction.cpp new file mode 100644 index 0000000000..a69a301c05 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TemporalAIntersectsTNpointTNpointLogicalFunction.cpp @@ -0,0 +1,137 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TemporalAIntersectsTNpointTNpointLogicalFunction::TemporalAIntersectsTNpointTNpointLogicalFunction(LogicalFunction ridA, + LogicalFunction fractionA, + LogicalFunction tsA, + LogicalFunction ridB, + LogicalFunction fractionB, + LogicalFunction tsB) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) +{ + parameters.reserve(6); + parameters.push_back(std::move(ridA)); + parameters.push_back(std::move(fractionA)); + parameters.push_back(std::move(tsA)); + parameters.push_back(std::move(ridB)); + parameters.push_back(std::move(fractionB)); + parameters.push_back(std::move(tsB)); +} + +DataType TemporalAIntersectsTNpointTNpointLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction TemporalAIntersectsTNpointTNpointLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector TemporalAIntersectsTNpointTNpointLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction TemporalAIntersectsTNpointTNpointLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 6, "TemporalAIntersectsTNpointTNpointLogicalFunction requires 6 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; +} + +std::string_view TemporalAIntersectsTNpointTNpointLogicalFunction::getType() const +{ + return NAME; +} + +bool TemporalAIntersectsTNpointTNpointLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } + return false; +} + +std::string TemporalAIntersectsTNpointTNpointLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TemporalAIntersectsTNpointTNpointLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); +} + +SerializableFunction TemporalAIntersectsTNpointTNpointLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTemporalAIntersectsTNpointTNpointLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 6, + "TemporalAIntersectsTNpointTNpointLogicalFunction requires 6 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + auto arg5 = std::move(arguments.children[5]); + return TemporalAIntersectsTNpointTNpointLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TemporalAIntersectsTPoseGeometryLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TemporalAIntersectsTPoseGeometryLogicalFunction.cpp new file mode 100644 index 0000000000..e152146e01 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TemporalAIntersectsTPoseGeometryLogicalFunction.cpp @@ -0,0 +1,134 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TemporalAIntersectsTPoseGeometryLogicalFunction::TemporalAIntersectsTPoseGeometryLogicalFunction(LogicalFunction x, + LogicalFunction y, + LogicalFunction theta, + LogicalFunction timestamp, + LogicalFunction geometry) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) +{ + parameters.reserve(5); + parameters.push_back(std::move(x)); + parameters.push_back(std::move(y)); + parameters.push_back(std::move(theta)); + parameters.push_back(std::move(timestamp)); + parameters.push_back(std::move(geometry)); +} + +DataType TemporalAIntersectsTPoseGeometryLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction TemporalAIntersectsTPoseGeometryLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector TemporalAIntersectsTPoseGeometryLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction TemporalAIntersectsTPoseGeometryLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 5, "TemporalAIntersectsTPoseGeometryLogicalFunction requires 5 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; +} + +std::string_view TemporalAIntersectsTPoseGeometryLogicalFunction::getType() const +{ + return NAME; +} + +bool TemporalAIntersectsTPoseGeometryLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } + return false; +} + +std::string TemporalAIntersectsTPoseGeometryLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TemporalAIntersectsTPoseGeometryLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); +} + +SerializableFunction TemporalAIntersectsTPoseGeometryLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTemporalAIntersectsTPoseGeometryLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 5, + "TemporalAIntersectsTPoseGeometryLogicalFunction requires 5 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + return TemporalAIntersectsTPoseGeometryLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TemporalAIntersectsTPoseTPoseLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TemporalAIntersectsTPoseTPoseLogicalFunction.cpp new file mode 100644 index 0000000000..c8e82a659f --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TemporalAIntersectsTPoseTPoseLogicalFunction.cpp @@ -0,0 +1,143 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TemporalAIntersectsTPoseTPoseLogicalFunction::TemporalAIntersectsTPoseTPoseLogicalFunction(LogicalFunction xA, + LogicalFunction yA, + LogicalFunction thetaA, + LogicalFunction tsA, + LogicalFunction xB, + LogicalFunction yB, + LogicalFunction thetaB, + LogicalFunction tsB) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) +{ + parameters.reserve(8); + parameters.push_back(std::move(xA)); + parameters.push_back(std::move(yA)); + parameters.push_back(std::move(thetaA)); + parameters.push_back(std::move(tsA)); + parameters.push_back(std::move(xB)); + parameters.push_back(std::move(yB)); + parameters.push_back(std::move(thetaB)); + parameters.push_back(std::move(tsB)); +} + +DataType TemporalAIntersectsTPoseTPoseLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction TemporalAIntersectsTPoseTPoseLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector TemporalAIntersectsTPoseTPoseLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction TemporalAIntersectsTPoseTPoseLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 8, "TemporalAIntersectsTPoseTPoseLogicalFunction requires 8 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; +} + +std::string_view TemporalAIntersectsTPoseTPoseLogicalFunction::getType() const +{ + return NAME; +} + +bool TemporalAIntersectsTPoseTPoseLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } + return false; +} + +std::string TemporalAIntersectsTPoseTPoseLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TemporalAIntersectsTPoseTPoseLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); +} + +SerializableFunction TemporalAIntersectsTPoseTPoseLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTemporalAIntersectsTPoseTPoseLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 8, + "TemporalAIntersectsTPoseTPoseLogicalFunction requires 8 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + auto arg5 = std::move(arguments.children[5]); + auto arg6 = std::move(arguments.children[6]); + auto arg7 = std::move(arguments.children[7]); + return TemporalAIntersectsTPoseTPoseLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6), std::move(arg7)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TemporalATouchesTNpointGeometryLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TemporalATouchesTNpointGeometryLogicalFunction.cpp new file mode 100644 index 0000000000..e0af8cb32e --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TemporalATouchesTNpointGeometryLogicalFunction.cpp @@ -0,0 +1,131 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TemporalATouchesTNpointGeometryLogicalFunction::TemporalATouchesTNpointGeometryLogicalFunction(LogicalFunction rid, + LogicalFunction fraction, + LogicalFunction timestamp, + LogicalFunction geometry) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) +{ + parameters.reserve(4); + parameters.push_back(std::move(rid)); + parameters.push_back(std::move(fraction)); + parameters.push_back(std::move(timestamp)); + parameters.push_back(std::move(geometry)); +} + +DataType TemporalATouchesTNpointGeometryLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction TemporalATouchesTNpointGeometryLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector TemporalATouchesTNpointGeometryLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction TemporalATouchesTNpointGeometryLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 4, "TemporalATouchesTNpointGeometryLogicalFunction requires 4 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; +} + +std::string_view TemporalATouchesTNpointGeometryLogicalFunction::getType() const +{ + return NAME; +} + +bool TemporalATouchesTNpointGeometryLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } + return false; +} + +std::string TemporalATouchesTNpointGeometryLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TemporalATouchesTNpointGeometryLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); +} + +SerializableFunction TemporalATouchesTNpointGeometryLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTemporalATouchesTNpointGeometryLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 4, + "TemporalATouchesTNpointGeometryLogicalFunction requires 4 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + return TemporalATouchesTNpointGeometryLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TemporalATouchesTNpointTNpointLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TemporalATouchesTNpointTNpointLogicalFunction.cpp new file mode 100644 index 0000000000..bb7257d12b --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TemporalATouchesTNpointTNpointLogicalFunction.cpp @@ -0,0 +1,137 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TemporalATouchesTNpointTNpointLogicalFunction::TemporalATouchesTNpointTNpointLogicalFunction(LogicalFunction ridA, + LogicalFunction fractionA, + LogicalFunction tsA, + LogicalFunction ridB, + LogicalFunction fractionB, + LogicalFunction tsB) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) +{ + parameters.reserve(6); + parameters.push_back(std::move(ridA)); + parameters.push_back(std::move(fractionA)); + parameters.push_back(std::move(tsA)); + parameters.push_back(std::move(ridB)); + parameters.push_back(std::move(fractionB)); + parameters.push_back(std::move(tsB)); +} + +DataType TemporalATouchesTNpointTNpointLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction TemporalATouchesTNpointTNpointLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector TemporalATouchesTNpointTNpointLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction TemporalATouchesTNpointTNpointLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 6, "TemporalATouchesTNpointTNpointLogicalFunction requires 6 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; +} + +std::string_view TemporalATouchesTNpointTNpointLogicalFunction::getType() const +{ + return NAME; +} + +bool TemporalATouchesTNpointTNpointLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } + return false; +} + +std::string TemporalATouchesTNpointTNpointLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TemporalATouchesTNpointTNpointLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); +} + +SerializableFunction TemporalATouchesTNpointTNpointLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTemporalATouchesTNpointTNpointLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 6, + "TemporalATouchesTNpointTNpointLogicalFunction requires 6 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + auto arg5 = std::move(arguments.children[5]); + return TemporalATouchesTNpointTNpointLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TemporalATouchesTPoseGeometryLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TemporalATouchesTPoseGeometryLogicalFunction.cpp new file mode 100644 index 0000000000..e3a8a01cb0 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TemporalATouchesTPoseGeometryLogicalFunction.cpp @@ -0,0 +1,134 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TemporalATouchesTPoseGeometryLogicalFunction::TemporalATouchesTPoseGeometryLogicalFunction(LogicalFunction x, + LogicalFunction y, + LogicalFunction theta, + LogicalFunction timestamp, + LogicalFunction geometry) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) +{ + parameters.reserve(5); + parameters.push_back(std::move(x)); + parameters.push_back(std::move(y)); + parameters.push_back(std::move(theta)); + parameters.push_back(std::move(timestamp)); + parameters.push_back(std::move(geometry)); +} + +DataType TemporalATouchesTPoseGeometryLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction TemporalATouchesTPoseGeometryLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector TemporalATouchesTPoseGeometryLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction TemporalATouchesTPoseGeometryLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 5, "TemporalATouchesTPoseGeometryLogicalFunction requires 5 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; +} + +std::string_view TemporalATouchesTPoseGeometryLogicalFunction::getType() const +{ + return NAME; +} + +bool TemporalATouchesTPoseGeometryLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } + return false; +} + +std::string TemporalATouchesTPoseGeometryLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TemporalATouchesTPoseGeometryLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); +} + +SerializableFunction TemporalATouchesTPoseGeometryLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTemporalATouchesTPoseGeometryLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 5, + "TemporalATouchesTPoseGeometryLogicalFunction requires 5 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + return TemporalATouchesTPoseGeometryLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TemporalATouchesTPoseTPoseLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TemporalATouchesTPoseTPoseLogicalFunction.cpp new file mode 100644 index 0000000000..9890aa1413 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TemporalATouchesTPoseTPoseLogicalFunction.cpp @@ -0,0 +1,143 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TemporalATouchesTPoseTPoseLogicalFunction::TemporalATouchesTPoseTPoseLogicalFunction(LogicalFunction xA, + LogicalFunction yA, + LogicalFunction thetaA, + LogicalFunction tsA, + LogicalFunction xB, + LogicalFunction yB, + LogicalFunction thetaB, + LogicalFunction tsB) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) +{ + parameters.reserve(8); + parameters.push_back(std::move(xA)); + parameters.push_back(std::move(yA)); + parameters.push_back(std::move(thetaA)); + parameters.push_back(std::move(tsA)); + parameters.push_back(std::move(xB)); + parameters.push_back(std::move(yB)); + parameters.push_back(std::move(thetaB)); + parameters.push_back(std::move(tsB)); +} + +DataType TemporalATouchesTPoseTPoseLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction TemporalATouchesTPoseTPoseLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector TemporalATouchesTPoseTPoseLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction TemporalATouchesTPoseTPoseLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 8, "TemporalATouchesTPoseTPoseLogicalFunction requires 8 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; +} + +std::string_view TemporalATouchesTPoseTPoseLogicalFunction::getType() const +{ + return NAME; +} + +bool TemporalATouchesTPoseTPoseLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } + return false; +} + +std::string TemporalATouchesTPoseTPoseLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TemporalATouchesTPoseTPoseLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); +} + +SerializableFunction TemporalATouchesTPoseTPoseLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTemporalATouchesTPoseTPoseLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 8, + "TemporalATouchesTPoseTPoseLogicalFunction requires 8 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + auto arg5 = std::move(arguments.children[5]); + auto arg6 = std::move(arguments.children[6]); + auto arg7 = std::move(arguments.children[7]); + return TemporalATouchesTPoseTPoseLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6), std::move(arg7)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TemporalEContainsTNpointGeometryLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TemporalEContainsTNpointGeometryLogicalFunction.cpp new file mode 100644 index 0000000000..213e4cb9fa --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TemporalEContainsTNpointGeometryLogicalFunction.cpp @@ -0,0 +1,131 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TemporalEContainsTNpointGeometryLogicalFunction::TemporalEContainsTNpointGeometryLogicalFunction(LogicalFunction rid, + LogicalFunction fraction, + LogicalFunction timestamp, + LogicalFunction geometry) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) +{ + parameters.reserve(4); + parameters.push_back(std::move(rid)); + parameters.push_back(std::move(fraction)); + parameters.push_back(std::move(timestamp)); + parameters.push_back(std::move(geometry)); +} + +DataType TemporalEContainsTNpointGeometryLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction TemporalEContainsTNpointGeometryLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector TemporalEContainsTNpointGeometryLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction TemporalEContainsTNpointGeometryLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 4, "TemporalEContainsTNpointGeometryLogicalFunction requires 4 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; +} + +std::string_view TemporalEContainsTNpointGeometryLogicalFunction::getType() const +{ + return NAME; +} + +bool TemporalEContainsTNpointGeometryLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } + return false; +} + +std::string TemporalEContainsTNpointGeometryLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TemporalEContainsTNpointGeometryLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); +} + +SerializableFunction TemporalEContainsTNpointGeometryLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTemporalEContainsTNpointGeometryLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 4, + "TemporalEContainsTNpointGeometryLogicalFunction requires 4 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + return TemporalEContainsTNpointGeometryLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TemporalEContainsTNpointTNpointLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TemporalEContainsTNpointTNpointLogicalFunction.cpp new file mode 100644 index 0000000000..4e1321c7b2 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TemporalEContainsTNpointTNpointLogicalFunction.cpp @@ -0,0 +1,137 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TemporalEContainsTNpointTNpointLogicalFunction::TemporalEContainsTNpointTNpointLogicalFunction(LogicalFunction ridA, + LogicalFunction fractionA, + LogicalFunction tsA, + LogicalFunction ridB, + LogicalFunction fractionB, + LogicalFunction tsB) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) +{ + parameters.reserve(6); + parameters.push_back(std::move(ridA)); + parameters.push_back(std::move(fractionA)); + parameters.push_back(std::move(tsA)); + parameters.push_back(std::move(ridB)); + parameters.push_back(std::move(fractionB)); + parameters.push_back(std::move(tsB)); +} + +DataType TemporalEContainsTNpointTNpointLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction TemporalEContainsTNpointTNpointLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector TemporalEContainsTNpointTNpointLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction TemporalEContainsTNpointTNpointLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 6, "TemporalEContainsTNpointTNpointLogicalFunction requires 6 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; +} + +std::string_view TemporalEContainsTNpointTNpointLogicalFunction::getType() const +{ + return NAME; +} + +bool TemporalEContainsTNpointTNpointLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } + return false; +} + +std::string TemporalEContainsTNpointTNpointLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TemporalEContainsTNpointTNpointLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); +} + +SerializableFunction TemporalEContainsTNpointTNpointLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTemporalEContainsTNpointTNpointLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 6, + "TemporalEContainsTNpointTNpointLogicalFunction requires 6 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + auto arg5 = std::move(arguments.children[5]); + return TemporalEContainsTNpointTNpointLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TemporalEContainsTPoseGeometryLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TemporalEContainsTPoseGeometryLogicalFunction.cpp new file mode 100644 index 0000000000..a8a961578e --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TemporalEContainsTPoseGeometryLogicalFunction.cpp @@ -0,0 +1,134 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TemporalEContainsTPoseGeometryLogicalFunction::TemporalEContainsTPoseGeometryLogicalFunction(LogicalFunction x, + LogicalFunction y, + LogicalFunction theta, + LogicalFunction timestamp, + LogicalFunction geometry) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) +{ + parameters.reserve(5); + parameters.push_back(std::move(x)); + parameters.push_back(std::move(y)); + parameters.push_back(std::move(theta)); + parameters.push_back(std::move(timestamp)); + parameters.push_back(std::move(geometry)); +} + +DataType TemporalEContainsTPoseGeometryLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction TemporalEContainsTPoseGeometryLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector TemporalEContainsTPoseGeometryLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction TemporalEContainsTPoseGeometryLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 5, "TemporalEContainsTPoseGeometryLogicalFunction requires 5 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; +} + +std::string_view TemporalEContainsTPoseGeometryLogicalFunction::getType() const +{ + return NAME; +} + +bool TemporalEContainsTPoseGeometryLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } + return false; +} + +std::string TemporalEContainsTPoseGeometryLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TemporalEContainsTPoseGeometryLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); +} + +SerializableFunction TemporalEContainsTPoseGeometryLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTemporalEContainsTPoseGeometryLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 5, + "TemporalEContainsTPoseGeometryLogicalFunction requires 5 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + return TemporalEContainsTPoseGeometryLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TemporalEContainsTPoseTPoseLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TemporalEContainsTPoseTPoseLogicalFunction.cpp new file mode 100644 index 0000000000..f66a1b707c --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TemporalEContainsTPoseTPoseLogicalFunction.cpp @@ -0,0 +1,143 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TemporalEContainsTPoseTPoseLogicalFunction::TemporalEContainsTPoseTPoseLogicalFunction(LogicalFunction xA, + LogicalFunction yA, + LogicalFunction thetaA, + LogicalFunction tsA, + LogicalFunction xB, + LogicalFunction yB, + LogicalFunction thetaB, + LogicalFunction tsB) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) +{ + parameters.reserve(8); + parameters.push_back(std::move(xA)); + parameters.push_back(std::move(yA)); + parameters.push_back(std::move(thetaA)); + parameters.push_back(std::move(tsA)); + parameters.push_back(std::move(xB)); + parameters.push_back(std::move(yB)); + parameters.push_back(std::move(thetaB)); + parameters.push_back(std::move(tsB)); +} + +DataType TemporalEContainsTPoseTPoseLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction TemporalEContainsTPoseTPoseLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector TemporalEContainsTPoseTPoseLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction TemporalEContainsTPoseTPoseLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 8, "TemporalEContainsTPoseTPoseLogicalFunction requires 8 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; +} + +std::string_view TemporalEContainsTPoseTPoseLogicalFunction::getType() const +{ + return NAME; +} + +bool TemporalEContainsTPoseTPoseLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } + return false; +} + +std::string TemporalEContainsTPoseTPoseLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TemporalEContainsTPoseTPoseLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); +} + +SerializableFunction TemporalEContainsTPoseTPoseLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTemporalEContainsTPoseTPoseLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 8, + "TemporalEContainsTPoseTPoseLogicalFunction requires 8 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + auto arg5 = std::move(arguments.children[5]); + auto arg6 = std::move(arguments.children[6]); + auto arg7 = std::move(arguments.children[7]); + return TemporalEContainsTPoseTPoseLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6), std::move(arg7)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TemporalECoversTNpointGeometryLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TemporalECoversTNpointGeometryLogicalFunction.cpp new file mode 100644 index 0000000000..970db8715f --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TemporalECoversTNpointGeometryLogicalFunction.cpp @@ -0,0 +1,131 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TemporalECoversTNpointGeometryLogicalFunction::TemporalECoversTNpointGeometryLogicalFunction(LogicalFunction rid, + LogicalFunction fraction, + LogicalFunction timestamp, + LogicalFunction geometry) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) +{ + parameters.reserve(4); + parameters.push_back(std::move(rid)); + parameters.push_back(std::move(fraction)); + parameters.push_back(std::move(timestamp)); + parameters.push_back(std::move(geometry)); +} + +DataType TemporalECoversTNpointGeometryLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction TemporalECoversTNpointGeometryLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector TemporalECoversTNpointGeometryLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction TemporalECoversTNpointGeometryLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 4, "TemporalECoversTNpointGeometryLogicalFunction requires 4 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; +} + +std::string_view TemporalECoversTNpointGeometryLogicalFunction::getType() const +{ + return NAME; +} + +bool TemporalECoversTNpointGeometryLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } + return false; +} + +std::string TemporalECoversTNpointGeometryLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TemporalECoversTNpointGeometryLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); +} + +SerializableFunction TemporalECoversTNpointGeometryLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTemporalECoversTNpointGeometryLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 4, + "TemporalECoversTNpointGeometryLogicalFunction requires 4 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + return TemporalECoversTNpointGeometryLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TemporalECoversTNpointTNpointLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TemporalECoversTNpointTNpointLogicalFunction.cpp new file mode 100644 index 0000000000..70503741a2 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TemporalECoversTNpointTNpointLogicalFunction.cpp @@ -0,0 +1,137 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TemporalECoversTNpointTNpointLogicalFunction::TemporalECoversTNpointTNpointLogicalFunction(LogicalFunction ridA, + LogicalFunction fractionA, + LogicalFunction tsA, + LogicalFunction ridB, + LogicalFunction fractionB, + LogicalFunction tsB) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) +{ + parameters.reserve(6); + parameters.push_back(std::move(ridA)); + parameters.push_back(std::move(fractionA)); + parameters.push_back(std::move(tsA)); + parameters.push_back(std::move(ridB)); + parameters.push_back(std::move(fractionB)); + parameters.push_back(std::move(tsB)); +} + +DataType TemporalECoversTNpointTNpointLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction TemporalECoversTNpointTNpointLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector TemporalECoversTNpointTNpointLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction TemporalECoversTNpointTNpointLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 6, "TemporalECoversTNpointTNpointLogicalFunction requires 6 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; +} + +std::string_view TemporalECoversTNpointTNpointLogicalFunction::getType() const +{ + return NAME; +} + +bool TemporalECoversTNpointTNpointLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } + return false; +} + +std::string TemporalECoversTNpointTNpointLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TemporalECoversTNpointTNpointLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); +} + +SerializableFunction TemporalECoversTNpointTNpointLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTemporalECoversTNpointTNpointLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 6, + "TemporalECoversTNpointTNpointLogicalFunction requires 6 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + auto arg5 = std::move(arguments.children[5]); + return TemporalECoversTNpointTNpointLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TemporalECoversTPoseGeometryLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TemporalECoversTPoseGeometryLogicalFunction.cpp new file mode 100644 index 0000000000..5b5099171d --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TemporalECoversTPoseGeometryLogicalFunction.cpp @@ -0,0 +1,134 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TemporalECoversTPoseGeometryLogicalFunction::TemporalECoversTPoseGeometryLogicalFunction(LogicalFunction x, + LogicalFunction y, + LogicalFunction theta, + LogicalFunction timestamp, + LogicalFunction geometry) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) +{ + parameters.reserve(5); + parameters.push_back(std::move(x)); + parameters.push_back(std::move(y)); + parameters.push_back(std::move(theta)); + parameters.push_back(std::move(timestamp)); + parameters.push_back(std::move(geometry)); +} + +DataType TemporalECoversTPoseGeometryLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction TemporalECoversTPoseGeometryLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector TemporalECoversTPoseGeometryLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction TemporalECoversTPoseGeometryLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 5, "TemporalECoversTPoseGeometryLogicalFunction requires 5 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; +} + +std::string_view TemporalECoversTPoseGeometryLogicalFunction::getType() const +{ + return NAME; +} + +bool TemporalECoversTPoseGeometryLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } + return false; +} + +std::string TemporalECoversTPoseGeometryLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TemporalECoversTPoseGeometryLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); +} + +SerializableFunction TemporalECoversTPoseGeometryLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTemporalECoversTPoseGeometryLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 5, + "TemporalECoversTPoseGeometryLogicalFunction requires 5 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + return TemporalECoversTPoseGeometryLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TemporalECoversTPoseTPoseLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TemporalECoversTPoseTPoseLogicalFunction.cpp new file mode 100644 index 0000000000..a046acb75e --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TemporalECoversTPoseTPoseLogicalFunction.cpp @@ -0,0 +1,143 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TemporalECoversTPoseTPoseLogicalFunction::TemporalECoversTPoseTPoseLogicalFunction(LogicalFunction xA, + LogicalFunction yA, + LogicalFunction thetaA, + LogicalFunction tsA, + LogicalFunction xB, + LogicalFunction yB, + LogicalFunction thetaB, + LogicalFunction tsB) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) +{ + parameters.reserve(8); + parameters.push_back(std::move(xA)); + parameters.push_back(std::move(yA)); + parameters.push_back(std::move(thetaA)); + parameters.push_back(std::move(tsA)); + parameters.push_back(std::move(xB)); + parameters.push_back(std::move(yB)); + parameters.push_back(std::move(thetaB)); + parameters.push_back(std::move(tsB)); +} + +DataType TemporalECoversTPoseTPoseLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction TemporalECoversTPoseTPoseLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector TemporalECoversTPoseTPoseLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction TemporalECoversTPoseTPoseLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 8, "TemporalECoversTPoseTPoseLogicalFunction requires 8 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; +} + +std::string_view TemporalECoversTPoseTPoseLogicalFunction::getType() const +{ + return NAME; +} + +bool TemporalECoversTPoseTPoseLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } + return false; +} + +std::string TemporalECoversTPoseTPoseLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TemporalECoversTPoseTPoseLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); +} + +SerializableFunction TemporalECoversTPoseTPoseLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTemporalECoversTPoseTPoseLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 8, + "TemporalECoversTPoseTPoseLogicalFunction requires 8 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + auto arg5 = std::move(arguments.children[5]); + auto arg6 = std::move(arguments.children[6]); + auto arg7 = std::move(arguments.children[7]); + return TemporalECoversTPoseTPoseLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6), std::move(arg7)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TemporalEDWithinTNpointGeometryLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TemporalEDWithinTNpointGeometryLogicalFunction.cpp new file mode 100644 index 0000000000..8306e04863 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TemporalEDWithinTNpointGeometryLogicalFunction.cpp @@ -0,0 +1,134 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TemporalEDWithinTNpointGeometryLogicalFunction::TemporalEDWithinTNpointGeometryLogicalFunction(LogicalFunction rid, + LogicalFunction fraction, + LogicalFunction timestamp, + LogicalFunction geometry, + LogicalFunction dist) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) +{ + parameters.reserve(5); + parameters.push_back(std::move(rid)); + parameters.push_back(std::move(fraction)); + parameters.push_back(std::move(timestamp)); + parameters.push_back(std::move(geometry)); + parameters.push_back(std::move(dist)); +} + +DataType TemporalEDWithinTNpointGeometryLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction TemporalEDWithinTNpointGeometryLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector TemporalEDWithinTNpointGeometryLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction TemporalEDWithinTNpointGeometryLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 5, "TemporalEDWithinTNpointGeometryLogicalFunction requires 5 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; +} + +std::string_view TemporalEDWithinTNpointGeometryLogicalFunction::getType() const +{ + return NAME; +} + +bool TemporalEDWithinTNpointGeometryLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } + return false; +} + +std::string TemporalEDWithinTNpointGeometryLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TemporalEDWithinTNpointGeometryLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); +} + +SerializableFunction TemporalEDWithinTNpointGeometryLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTemporalEDWithinTNpointGeometryLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 5, + "TemporalEDWithinTNpointGeometryLogicalFunction requires 5 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + return TemporalEDWithinTNpointGeometryLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TemporalEDWithinTNpointTNpointLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TemporalEDWithinTNpointTNpointLogicalFunction.cpp new file mode 100644 index 0000000000..68a8f03ecb --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TemporalEDWithinTNpointTNpointLogicalFunction.cpp @@ -0,0 +1,140 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TemporalEDWithinTNpointTNpointLogicalFunction::TemporalEDWithinTNpointTNpointLogicalFunction(LogicalFunction ridA, + LogicalFunction fractionA, + LogicalFunction tsA, + LogicalFunction ridB, + LogicalFunction fractionB, + LogicalFunction tsB, + LogicalFunction dist) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) +{ + parameters.reserve(7); + parameters.push_back(std::move(ridA)); + parameters.push_back(std::move(fractionA)); + parameters.push_back(std::move(tsA)); + parameters.push_back(std::move(ridB)); + parameters.push_back(std::move(fractionB)); + parameters.push_back(std::move(tsB)); + parameters.push_back(std::move(dist)); +} + +DataType TemporalEDWithinTNpointTNpointLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction TemporalEDWithinTNpointTNpointLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector TemporalEDWithinTNpointTNpointLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction TemporalEDWithinTNpointTNpointLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 7, "TemporalEDWithinTNpointTNpointLogicalFunction requires 7 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; +} + +std::string_view TemporalEDWithinTNpointTNpointLogicalFunction::getType() const +{ + return NAME; +} + +bool TemporalEDWithinTNpointTNpointLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } + return false; +} + +std::string TemporalEDWithinTNpointTNpointLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TemporalEDWithinTNpointTNpointLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); +} + +SerializableFunction TemporalEDWithinTNpointTNpointLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTemporalEDWithinTNpointTNpointLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 7, + "TemporalEDWithinTNpointTNpointLogicalFunction requires 7 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + auto arg5 = std::move(arguments.children[5]); + auto arg6 = std::move(arguments.children[6]); + return TemporalEDWithinTNpointTNpointLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TemporalEDWithinTPoseGeometryLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TemporalEDWithinTPoseGeometryLogicalFunction.cpp new file mode 100644 index 0000000000..38173e13e2 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TemporalEDWithinTPoseGeometryLogicalFunction.cpp @@ -0,0 +1,137 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TemporalEDWithinTPoseGeometryLogicalFunction::TemporalEDWithinTPoseGeometryLogicalFunction(LogicalFunction x, + LogicalFunction y, + LogicalFunction theta, + LogicalFunction timestamp, + LogicalFunction geometry, + LogicalFunction dist) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) +{ + parameters.reserve(6); + parameters.push_back(std::move(x)); + parameters.push_back(std::move(y)); + parameters.push_back(std::move(theta)); + parameters.push_back(std::move(timestamp)); + parameters.push_back(std::move(geometry)); + parameters.push_back(std::move(dist)); +} + +DataType TemporalEDWithinTPoseGeometryLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction TemporalEDWithinTPoseGeometryLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector TemporalEDWithinTPoseGeometryLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction TemporalEDWithinTPoseGeometryLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 6, "TemporalEDWithinTPoseGeometryLogicalFunction requires 6 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; +} + +std::string_view TemporalEDWithinTPoseGeometryLogicalFunction::getType() const +{ + return NAME; +} + +bool TemporalEDWithinTPoseGeometryLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } + return false; +} + +std::string TemporalEDWithinTPoseGeometryLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TemporalEDWithinTPoseGeometryLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); +} + +SerializableFunction TemporalEDWithinTPoseGeometryLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTemporalEDWithinTPoseGeometryLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 6, + "TemporalEDWithinTPoseGeometryLogicalFunction requires 6 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + auto arg5 = std::move(arguments.children[5]); + return TemporalEDWithinTPoseGeometryLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TemporalEDWithinTPoseTPoseLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TemporalEDWithinTPoseTPoseLogicalFunction.cpp new file mode 100644 index 0000000000..0ee9617c1d --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TemporalEDWithinTPoseTPoseLogicalFunction.cpp @@ -0,0 +1,146 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TemporalEDWithinTPoseTPoseLogicalFunction::TemporalEDWithinTPoseTPoseLogicalFunction(LogicalFunction xA, + LogicalFunction yA, + LogicalFunction thetaA, + LogicalFunction tsA, + LogicalFunction xB, + LogicalFunction yB, + LogicalFunction thetaB, + LogicalFunction tsB, + LogicalFunction dist) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) +{ + parameters.reserve(9); + parameters.push_back(std::move(xA)); + parameters.push_back(std::move(yA)); + parameters.push_back(std::move(thetaA)); + parameters.push_back(std::move(tsA)); + parameters.push_back(std::move(xB)); + parameters.push_back(std::move(yB)); + parameters.push_back(std::move(thetaB)); + parameters.push_back(std::move(tsB)); + parameters.push_back(std::move(dist)); +} + +DataType TemporalEDWithinTPoseTPoseLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction TemporalEDWithinTPoseTPoseLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector TemporalEDWithinTPoseTPoseLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction TemporalEDWithinTPoseTPoseLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 9, "TemporalEDWithinTPoseTPoseLogicalFunction requires 9 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; +} + +std::string_view TemporalEDWithinTPoseTPoseLogicalFunction::getType() const +{ + return NAME; +} + +bool TemporalEDWithinTPoseTPoseLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } + return false; +} + +std::string TemporalEDWithinTPoseTPoseLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TemporalEDWithinTPoseTPoseLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); +} + +SerializableFunction TemporalEDWithinTPoseTPoseLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTemporalEDWithinTPoseTPoseLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 9, + "TemporalEDWithinTPoseTPoseLogicalFunction requires 9 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + auto arg5 = std::move(arguments.children[5]); + auto arg6 = std::move(arguments.children[6]); + auto arg7 = std::move(arguments.children[7]); + auto arg8 = std::move(arguments.children[8]); + return TemporalEDWithinTPoseTPoseLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6), std::move(arg7), std::move(arg8)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TemporalEDisjointTNpointGeometryLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TemporalEDisjointTNpointGeometryLogicalFunction.cpp new file mode 100644 index 0000000000..cbd9b1a6d0 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TemporalEDisjointTNpointGeometryLogicalFunction.cpp @@ -0,0 +1,131 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TemporalEDisjointTNpointGeometryLogicalFunction::TemporalEDisjointTNpointGeometryLogicalFunction(LogicalFunction rid, + LogicalFunction fraction, + LogicalFunction timestamp, + LogicalFunction geometry) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) +{ + parameters.reserve(4); + parameters.push_back(std::move(rid)); + parameters.push_back(std::move(fraction)); + parameters.push_back(std::move(timestamp)); + parameters.push_back(std::move(geometry)); +} + +DataType TemporalEDisjointTNpointGeometryLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction TemporalEDisjointTNpointGeometryLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector TemporalEDisjointTNpointGeometryLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction TemporalEDisjointTNpointGeometryLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 4, "TemporalEDisjointTNpointGeometryLogicalFunction requires 4 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; +} + +std::string_view TemporalEDisjointTNpointGeometryLogicalFunction::getType() const +{ + return NAME; +} + +bool TemporalEDisjointTNpointGeometryLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } + return false; +} + +std::string TemporalEDisjointTNpointGeometryLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TemporalEDisjointTNpointGeometryLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); +} + +SerializableFunction TemporalEDisjointTNpointGeometryLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTemporalEDisjointTNpointGeometryLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 4, + "TemporalEDisjointTNpointGeometryLogicalFunction requires 4 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + return TemporalEDisjointTNpointGeometryLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TemporalEDisjointTNpointTNpointLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TemporalEDisjointTNpointTNpointLogicalFunction.cpp new file mode 100644 index 0000000000..be7e1341a9 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TemporalEDisjointTNpointTNpointLogicalFunction.cpp @@ -0,0 +1,137 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TemporalEDisjointTNpointTNpointLogicalFunction::TemporalEDisjointTNpointTNpointLogicalFunction(LogicalFunction ridA, + LogicalFunction fractionA, + LogicalFunction tsA, + LogicalFunction ridB, + LogicalFunction fractionB, + LogicalFunction tsB) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) +{ + parameters.reserve(6); + parameters.push_back(std::move(ridA)); + parameters.push_back(std::move(fractionA)); + parameters.push_back(std::move(tsA)); + parameters.push_back(std::move(ridB)); + parameters.push_back(std::move(fractionB)); + parameters.push_back(std::move(tsB)); +} + +DataType TemporalEDisjointTNpointTNpointLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction TemporalEDisjointTNpointTNpointLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector TemporalEDisjointTNpointTNpointLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction TemporalEDisjointTNpointTNpointLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 6, "TemporalEDisjointTNpointTNpointLogicalFunction requires 6 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; +} + +std::string_view TemporalEDisjointTNpointTNpointLogicalFunction::getType() const +{ + return NAME; +} + +bool TemporalEDisjointTNpointTNpointLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } + return false; +} + +std::string TemporalEDisjointTNpointTNpointLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TemporalEDisjointTNpointTNpointLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); +} + +SerializableFunction TemporalEDisjointTNpointTNpointLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTemporalEDisjointTNpointTNpointLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 6, + "TemporalEDisjointTNpointTNpointLogicalFunction requires 6 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + auto arg5 = std::move(arguments.children[5]); + return TemporalEDisjointTNpointTNpointLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TemporalEDisjointTPoseGeometryLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TemporalEDisjointTPoseGeometryLogicalFunction.cpp new file mode 100644 index 0000000000..34d0974c49 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TemporalEDisjointTPoseGeometryLogicalFunction.cpp @@ -0,0 +1,134 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TemporalEDisjointTPoseGeometryLogicalFunction::TemporalEDisjointTPoseGeometryLogicalFunction(LogicalFunction x, + LogicalFunction y, + LogicalFunction theta, + LogicalFunction timestamp, + LogicalFunction geometry) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) +{ + parameters.reserve(5); + parameters.push_back(std::move(x)); + parameters.push_back(std::move(y)); + parameters.push_back(std::move(theta)); + parameters.push_back(std::move(timestamp)); + parameters.push_back(std::move(geometry)); +} + +DataType TemporalEDisjointTPoseGeometryLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction TemporalEDisjointTPoseGeometryLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector TemporalEDisjointTPoseGeometryLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction TemporalEDisjointTPoseGeometryLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 5, "TemporalEDisjointTPoseGeometryLogicalFunction requires 5 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; +} + +std::string_view TemporalEDisjointTPoseGeometryLogicalFunction::getType() const +{ + return NAME; +} + +bool TemporalEDisjointTPoseGeometryLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } + return false; +} + +std::string TemporalEDisjointTPoseGeometryLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TemporalEDisjointTPoseGeometryLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); +} + +SerializableFunction TemporalEDisjointTPoseGeometryLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTemporalEDisjointTPoseGeometryLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 5, + "TemporalEDisjointTPoseGeometryLogicalFunction requires 5 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + return TemporalEDisjointTPoseGeometryLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TemporalEDisjointTPoseTPoseLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TemporalEDisjointTPoseTPoseLogicalFunction.cpp new file mode 100644 index 0000000000..4f6d937e17 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TemporalEDisjointTPoseTPoseLogicalFunction.cpp @@ -0,0 +1,143 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TemporalEDisjointTPoseTPoseLogicalFunction::TemporalEDisjointTPoseTPoseLogicalFunction(LogicalFunction xA, + LogicalFunction yA, + LogicalFunction thetaA, + LogicalFunction tsA, + LogicalFunction xB, + LogicalFunction yB, + LogicalFunction thetaB, + LogicalFunction tsB) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) +{ + parameters.reserve(8); + parameters.push_back(std::move(xA)); + parameters.push_back(std::move(yA)); + parameters.push_back(std::move(thetaA)); + parameters.push_back(std::move(tsA)); + parameters.push_back(std::move(xB)); + parameters.push_back(std::move(yB)); + parameters.push_back(std::move(thetaB)); + parameters.push_back(std::move(tsB)); +} + +DataType TemporalEDisjointTPoseTPoseLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction TemporalEDisjointTPoseTPoseLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector TemporalEDisjointTPoseTPoseLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction TemporalEDisjointTPoseTPoseLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 8, "TemporalEDisjointTPoseTPoseLogicalFunction requires 8 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; +} + +std::string_view TemporalEDisjointTPoseTPoseLogicalFunction::getType() const +{ + return NAME; +} + +bool TemporalEDisjointTPoseTPoseLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } + return false; +} + +std::string TemporalEDisjointTPoseTPoseLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TemporalEDisjointTPoseTPoseLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); +} + +SerializableFunction TemporalEDisjointTPoseTPoseLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTemporalEDisjointTPoseTPoseLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 8, + "TemporalEDisjointTPoseTPoseLogicalFunction requires 8 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + auto arg5 = std::move(arguments.children[5]); + auto arg6 = std::move(arguments.children[6]); + auto arg7 = std::move(arguments.children[7]); + return TemporalEDisjointTPoseTPoseLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6), std::move(arg7)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TemporalEIntersectsTNpointGeometryLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TemporalEIntersectsTNpointGeometryLogicalFunction.cpp new file mode 100644 index 0000000000..5860977c20 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TemporalEIntersectsTNpointGeometryLogicalFunction.cpp @@ -0,0 +1,131 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TemporalEIntersectsTNpointGeometryLogicalFunction::TemporalEIntersectsTNpointGeometryLogicalFunction(LogicalFunction rid, + LogicalFunction fraction, + LogicalFunction timestamp, + LogicalFunction geometry) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) +{ + parameters.reserve(4); + parameters.push_back(std::move(rid)); + parameters.push_back(std::move(fraction)); + parameters.push_back(std::move(timestamp)); + parameters.push_back(std::move(geometry)); +} + +DataType TemporalEIntersectsTNpointGeometryLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction TemporalEIntersectsTNpointGeometryLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector TemporalEIntersectsTNpointGeometryLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction TemporalEIntersectsTNpointGeometryLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 4, "TemporalEIntersectsTNpointGeometryLogicalFunction requires 4 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; +} + +std::string_view TemporalEIntersectsTNpointGeometryLogicalFunction::getType() const +{ + return NAME; +} + +bool TemporalEIntersectsTNpointGeometryLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } + return false; +} + +std::string TemporalEIntersectsTNpointGeometryLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TemporalEIntersectsTNpointGeometryLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); +} + +SerializableFunction TemporalEIntersectsTNpointGeometryLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTemporalEIntersectsTNpointGeometryLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 4, + "TemporalEIntersectsTNpointGeometryLogicalFunction requires 4 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + return TemporalEIntersectsTNpointGeometryLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TemporalEIntersectsTNpointTNpointLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TemporalEIntersectsTNpointTNpointLogicalFunction.cpp new file mode 100644 index 0000000000..dff7a41b5d --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TemporalEIntersectsTNpointTNpointLogicalFunction.cpp @@ -0,0 +1,137 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TemporalEIntersectsTNpointTNpointLogicalFunction::TemporalEIntersectsTNpointTNpointLogicalFunction(LogicalFunction ridA, + LogicalFunction fractionA, + LogicalFunction tsA, + LogicalFunction ridB, + LogicalFunction fractionB, + LogicalFunction tsB) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) +{ + parameters.reserve(6); + parameters.push_back(std::move(ridA)); + parameters.push_back(std::move(fractionA)); + parameters.push_back(std::move(tsA)); + parameters.push_back(std::move(ridB)); + parameters.push_back(std::move(fractionB)); + parameters.push_back(std::move(tsB)); +} + +DataType TemporalEIntersectsTNpointTNpointLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction TemporalEIntersectsTNpointTNpointLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector TemporalEIntersectsTNpointTNpointLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction TemporalEIntersectsTNpointTNpointLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 6, "TemporalEIntersectsTNpointTNpointLogicalFunction requires 6 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; +} + +std::string_view TemporalEIntersectsTNpointTNpointLogicalFunction::getType() const +{ + return NAME; +} + +bool TemporalEIntersectsTNpointTNpointLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } + return false; +} + +std::string TemporalEIntersectsTNpointTNpointLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TemporalEIntersectsTNpointTNpointLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); +} + +SerializableFunction TemporalEIntersectsTNpointTNpointLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTemporalEIntersectsTNpointTNpointLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 6, + "TemporalEIntersectsTNpointTNpointLogicalFunction requires 6 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + auto arg5 = std::move(arguments.children[5]); + return TemporalEIntersectsTNpointTNpointLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TemporalEIntersectsTPoseGeometryLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TemporalEIntersectsTPoseGeometryLogicalFunction.cpp new file mode 100644 index 0000000000..124a9204ac --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TemporalEIntersectsTPoseGeometryLogicalFunction.cpp @@ -0,0 +1,134 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TemporalEIntersectsTPoseGeometryLogicalFunction::TemporalEIntersectsTPoseGeometryLogicalFunction(LogicalFunction x, + LogicalFunction y, + LogicalFunction theta, + LogicalFunction timestamp, + LogicalFunction geometry) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) +{ + parameters.reserve(5); + parameters.push_back(std::move(x)); + parameters.push_back(std::move(y)); + parameters.push_back(std::move(theta)); + parameters.push_back(std::move(timestamp)); + parameters.push_back(std::move(geometry)); +} + +DataType TemporalEIntersectsTPoseGeometryLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction TemporalEIntersectsTPoseGeometryLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector TemporalEIntersectsTPoseGeometryLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction TemporalEIntersectsTPoseGeometryLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 5, "TemporalEIntersectsTPoseGeometryLogicalFunction requires 5 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; +} + +std::string_view TemporalEIntersectsTPoseGeometryLogicalFunction::getType() const +{ + return NAME; +} + +bool TemporalEIntersectsTPoseGeometryLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } + return false; +} + +std::string TemporalEIntersectsTPoseGeometryLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TemporalEIntersectsTPoseGeometryLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); +} + +SerializableFunction TemporalEIntersectsTPoseGeometryLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTemporalEIntersectsTPoseGeometryLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 5, + "TemporalEIntersectsTPoseGeometryLogicalFunction requires 5 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + return TemporalEIntersectsTPoseGeometryLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TemporalEIntersectsTPoseTPoseLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TemporalEIntersectsTPoseTPoseLogicalFunction.cpp new file mode 100644 index 0000000000..75a8a8665c --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TemporalEIntersectsTPoseTPoseLogicalFunction.cpp @@ -0,0 +1,143 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TemporalEIntersectsTPoseTPoseLogicalFunction::TemporalEIntersectsTPoseTPoseLogicalFunction(LogicalFunction xA, + LogicalFunction yA, + LogicalFunction thetaA, + LogicalFunction tsA, + LogicalFunction xB, + LogicalFunction yB, + LogicalFunction thetaB, + LogicalFunction tsB) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) +{ + parameters.reserve(8); + parameters.push_back(std::move(xA)); + parameters.push_back(std::move(yA)); + parameters.push_back(std::move(thetaA)); + parameters.push_back(std::move(tsA)); + parameters.push_back(std::move(xB)); + parameters.push_back(std::move(yB)); + parameters.push_back(std::move(thetaB)); + parameters.push_back(std::move(tsB)); +} + +DataType TemporalEIntersectsTPoseTPoseLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction TemporalEIntersectsTPoseTPoseLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector TemporalEIntersectsTPoseTPoseLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction TemporalEIntersectsTPoseTPoseLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 8, "TemporalEIntersectsTPoseTPoseLogicalFunction requires 8 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; +} + +std::string_view TemporalEIntersectsTPoseTPoseLogicalFunction::getType() const +{ + return NAME; +} + +bool TemporalEIntersectsTPoseTPoseLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } + return false; +} + +std::string TemporalEIntersectsTPoseTPoseLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TemporalEIntersectsTPoseTPoseLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); +} + +SerializableFunction TemporalEIntersectsTPoseTPoseLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTemporalEIntersectsTPoseTPoseLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 8, + "TemporalEIntersectsTPoseTPoseLogicalFunction requires 8 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + auto arg5 = std::move(arguments.children[5]); + auto arg6 = std::move(arguments.children[6]); + auto arg7 = std::move(arguments.children[7]); + return TemporalEIntersectsTPoseTPoseLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6), std::move(arg7)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TemporalETouchesTNpointGeometryLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TemporalETouchesTNpointGeometryLogicalFunction.cpp new file mode 100644 index 0000000000..09821a8cb3 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TemporalETouchesTNpointGeometryLogicalFunction.cpp @@ -0,0 +1,131 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TemporalETouchesTNpointGeometryLogicalFunction::TemporalETouchesTNpointGeometryLogicalFunction(LogicalFunction rid, + LogicalFunction fraction, + LogicalFunction timestamp, + LogicalFunction geometry) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) +{ + parameters.reserve(4); + parameters.push_back(std::move(rid)); + parameters.push_back(std::move(fraction)); + parameters.push_back(std::move(timestamp)); + parameters.push_back(std::move(geometry)); +} + +DataType TemporalETouchesTNpointGeometryLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction TemporalETouchesTNpointGeometryLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector TemporalETouchesTNpointGeometryLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction TemporalETouchesTNpointGeometryLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 4, "TemporalETouchesTNpointGeometryLogicalFunction requires 4 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; +} + +std::string_view TemporalETouchesTNpointGeometryLogicalFunction::getType() const +{ + return NAME; +} + +bool TemporalETouchesTNpointGeometryLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } + return false; +} + +std::string TemporalETouchesTNpointGeometryLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TemporalETouchesTNpointGeometryLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); +} + +SerializableFunction TemporalETouchesTNpointGeometryLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTemporalETouchesTNpointGeometryLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 4, + "TemporalETouchesTNpointGeometryLogicalFunction requires 4 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + return TemporalETouchesTNpointGeometryLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TemporalETouchesTNpointTNpointLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TemporalETouchesTNpointTNpointLogicalFunction.cpp new file mode 100644 index 0000000000..b3d8b8c0ba --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TemporalETouchesTNpointTNpointLogicalFunction.cpp @@ -0,0 +1,137 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TemporalETouchesTNpointTNpointLogicalFunction::TemporalETouchesTNpointTNpointLogicalFunction(LogicalFunction ridA, + LogicalFunction fractionA, + LogicalFunction tsA, + LogicalFunction ridB, + LogicalFunction fractionB, + LogicalFunction tsB) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) +{ + parameters.reserve(6); + parameters.push_back(std::move(ridA)); + parameters.push_back(std::move(fractionA)); + parameters.push_back(std::move(tsA)); + parameters.push_back(std::move(ridB)); + parameters.push_back(std::move(fractionB)); + parameters.push_back(std::move(tsB)); +} + +DataType TemporalETouchesTNpointTNpointLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction TemporalETouchesTNpointTNpointLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector TemporalETouchesTNpointTNpointLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction TemporalETouchesTNpointTNpointLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 6, "TemporalETouchesTNpointTNpointLogicalFunction requires 6 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; +} + +std::string_view TemporalETouchesTNpointTNpointLogicalFunction::getType() const +{ + return NAME; +} + +bool TemporalETouchesTNpointTNpointLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } + return false; +} + +std::string TemporalETouchesTNpointTNpointLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TemporalETouchesTNpointTNpointLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); +} + +SerializableFunction TemporalETouchesTNpointTNpointLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTemporalETouchesTNpointTNpointLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 6, + "TemporalETouchesTNpointTNpointLogicalFunction requires 6 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + auto arg5 = std::move(arguments.children[5]); + return TemporalETouchesTNpointTNpointLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TemporalETouchesTPoseGeometryLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TemporalETouchesTPoseGeometryLogicalFunction.cpp new file mode 100644 index 0000000000..cf0f71eb87 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TemporalETouchesTPoseGeometryLogicalFunction.cpp @@ -0,0 +1,134 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TemporalETouchesTPoseGeometryLogicalFunction::TemporalETouchesTPoseGeometryLogicalFunction(LogicalFunction x, + LogicalFunction y, + LogicalFunction theta, + LogicalFunction timestamp, + LogicalFunction geometry) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) +{ + parameters.reserve(5); + parameters.push_back(std::move(x)); + parameters.push_back(std::move(y)); + parameters.push_back(std::move(theta)); + parameters.push_back(std::move(timestamp)); + parameters.push_back(std::move(geometry)); +} + +DataType TemporalETouchesTPoseGeometryLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction TemporalETouchesTPoseGeometryLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector TemporalETouchesTPoseGeometryLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction TemporalETouchesTPoseGeometryLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 5, "TemporalETouchesTPoseGeometryLogicalFunction requires 5 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; +} + +std::string_view TemporalETouchesTPoseGeometryLogicalFunction::getType() const +{ + return NAME; +} + +bool TemporalETouchesTPoseGeometryLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } + return false; +} + +std::string TemporalETouchesTPoseGeometryLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TemporalETouchesTPoseGeometryLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); +} + +SerializableFunction TemporalETouchesTPoseGeometryLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTemporalETouchesTPoseGeometryLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 5, + "TemporalETouchesTPoseGeometryLogicalFunction requires 5 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + return TemporalETouchesTPoseGeometryLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TemporalETouchesTPoseTPoseLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TemporalETouchesTPoseTPoseLogicalFunction.cpp new file mode 100644 index 0000000000..9fbc60bb0c --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TemporalETouchesTPoseTPoseLogicalFunction.cpp @@ -0,0 +1,143 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TemporalETouchesTPoseTPoseLogicalFunction::TemporalETouchesTPoseTPoseLogicalFunction(LogicalFunction xA, + LogicalFunction yA, + LogicalFunction thetaA, + LogicalFunction tsA, + LogicalFunction xB, + LogicalFunction yB, + LogicalFunction thetaB, + LogicalFunction tsB) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) +{ + parameters.reserve(8); + parameters.push_back(std::move(xA)); + parameters.push_back(std::move(yA)); + parameters.push_back(std::move(thetaA)); + parameters.push_back(std::move(tsA)); + parameters.push_back(std::move(xB)); + parameters.push_back(std::move(yB)); + parameters.push_back(std::move(thetaB)); + parameters.push_back(std::move(tsB)); +} + +DataType TemporalETouchesTPoseTPoseLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction TemporalETouchesTPoseTPoseLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector TemporalETouchesTPoseTPoseLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction TemporalETouchesTPoseTPoseLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 8, "TemporalETouchesTPoseTPoseLogicalFunction requires 8 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; +} + +std::string_view TemporalETouchesTPoseTPoseLogicalFunction::getType() const +{ + return NAME; +} + +bool TemporalETouchesTPoseTPoseLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } + return false; +} + +std::string TemporalETouchesTPoseTPoseLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TemporalETouchesTPoseTPoseLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); +} + +SerializableFunction TemporalETouchesTPoseTPoseLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTemporalETouchesTPoseTPoseLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 8, + "TemporalETouchesTPoseTPoseLogicalFunction requires 8 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + auto arg5 = std::move(arguments.children[5]); + auto arg6 = std::move(arguments.children[6]); + auto arg7 = std::move(arguments.children[7]); + return TemporalETouchesTPoseTPoseLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6), std::move(arg7)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TemporalNADTNpointGeometryLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TemporalNADTNpointGeometryLogicalFunction.cpp new file mode 100644 index 0000000000..dc09df6d3f --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TemporalNADTNpointGeometryLogicalFunction.cpp @@ -0,0 +1,131 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TemporalNADTNpointGeometryLogicalFunction::TemporalNADTNpointGeometryLogicalFunction(LogicalFunction rid, + LogicalFunction fraction, + LogicalFunction timestamp, + LogicalFunction geometry) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(4); + parameters.push_back(std::move(rid)); + parameters.push_back(std::move(fraction)); + parameters.push_back(std::move(timestamp)); + parameters.push_back(std::move(geometry)); +} + +DataType TemporalNADTNpointGeometryLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction TemporalNADTNpointGeometryLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector TemporalNADTNpointGeometryLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction TemporalNADTNpointGeometryLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 4, "TemporalNADTNpointGeometryLogicalFunction requires 4 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; +} + +std::string_view TemporalNADTNpointGeometryLogicalFunction::getType() const +{ + return NAME; +} + +bool TemporalNADTNpointGeometryLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } + return false; +} + +std::string TemporalNADTNpointGeometryLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TemporalNADTNpointGeometryLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); +} + +SerializableFunction TemporalNADTNpointGeometryLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTemporalNADTNpointGeometryLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 4, + "TemporalNADTNpointGeometryLogicalFunction requires 4 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + return TemporalNADTNpointGeometryLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TemporalNADTNpointTNpointLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TemporalNADTNpointTNpointLogicalFunction.cpp new file mode 100644 index 0000000000..d2e91c4560 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TemporalNADTNpointTNpointLogicalFunction.cpp @@ -0,0 +1,137 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TemporalNADTNpointTNpointLogicalFunction::TemporalNADTNpointTNpointLogicalFunction(LogicalFunction ridA, + LogicalFunction fractionA, + LogicalFunction tsA, + LogicalFunction ridB, + LogicalFunction fractionB, + LogicalFunction tsB) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(6); + parameters.push_back(std::move(ridA)); + parameters.push_back(std::move(fractionA)); + parameters.push_back(std::move(tsA)); + parameters.push_back(std::move(ridB)); + parameters.push_back(std::move(fractionB)); + parameters.push_back(std::move(tsB)); +} + +DataType TemporalNADTNpointTNpointLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction TemporalNADTNpointTNpointLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector TemporalNADTNpointTNpointLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction TemporalNADTNpointTNpointLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 6, "TemporalNADTNpointTNpointLogicalFunction requires 6 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; +} + +std::string_view TemporalNADTNpointTNpointLogicalFunction::getType() const +{ + return NAME; +} + +bool TemporalNADTNpointTNpointLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } + return false; +} + +std::string TemporalNADTNpointTNpointLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TemporalNADTNpointTNpointLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); +} + +SerializableFunction TemporalNADTNpointTNpointLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTemporalNADTNpointTNpointLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 6, + "TemporalNADTNpointTNpointLogicalFunction requires 6 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + auto arg5 = std::move(arguments.children[5]); + return TemporalNADTNpointTNpointLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TemporalNADTPoseGeometryLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TemporalNADTPoseGeometryLogicalFunction.cpp new file mode 100644 index 0000000000..2749835251 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TemporalNADTPoseGeometryLogicalFunction.cpp @@ -0,0 +1,134 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TemporalNADTPoseGeometryLogicalFunction::TemporalNADTPoseGeometryLogicalFunction(LogicalFunction x, + LogicalFunction y, + LogicalFunction theta, + LogicalFunction timestamp, + LogicalFunction geometry) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(5); + parameters.push_back(std::move(x)); + parameters.push_back(std::move(y)); + parameters.push_back(std::move(theta)); + parameters.push_back(std::move(timestamp)); + parameters.push_back(std::move(geometry)); +} + +DataType TemporalNADTPoseGeometryLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction TemporalNADTPoseGeometryLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector TemporalNADTPoseGeometryLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction TemporalNADTPoseGeometryLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 5, "TemporalNADTPoseGeometryLogicalFunction requires 5 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; +} + +std::string_view TemporalNADTPoseGeometryLogicalFunction::getType() const +{ + return NAME; +} + +bool TemporalNADTPoseGeometryLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } + return false; +} + +std::string TemporalNADTPoseGeometryLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TemporalNADTPoseGeometryLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); +} + +SerializableFunction TemporalNADTPoseGeometryLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTemporalNADTPoseGeometryLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 5, + "TemporalNADTPoseGeometryLogicalFunction requires 5 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + return TemporalNADTPoseGeometryLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TemporalNADTPoseTPoseLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TemporalNADTPoseTPoseLogicalFunction.cpp new file mode 100644 index 0000000000..b7a47f6625 --- /dev/null +++ b/nes-logical-operators/src/Functions/Meos/TemporalNADTPoseTPoseLogicalFunction.cpp @@ -0,0 +1,143 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{ + +TemporalNADTPoseTPoseLogicalFunction::TemporalNADTPoseTPoseLogicalFunction(LogicalFunction xA, + LogicalFunction yA, + LogicalFunction thetaA, + LogicalFunction tsA, + LogicalFunction xB, + LogicalFunction yB, + LogicalFunction thetaB, + LogicalFunction tsB) + : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +{ + parameters.reserve(8); + parameters.push_back(std::move(xA)); + parameters.push_back(std::move(yA)); + parameters.push_back(std::move(thetaA)); + parameters.push_back(std::move(tsA)); + parameters.push_back(std::move(xB)); + parameters.push_back(std::move(yB)); + parameters.push_back(std::move(thetaB)); + parameters.push_back(std::move(tsB)); +} + +DataType TemporalNADTPoseTPoseLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction TemporalNADTPoseTPoseLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector TemporalNADTPoseTPoseLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction TemporalNADTPoseTPoseLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 8, "TemporalNADTPoseTPoseLogicalFunction requires 8 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; +} + +std::string_view TemporalNADTPoseTPoseLogicalFunction::getType() const +{ + return NAME; +} + +bool TemporalNADTPoseTPoseLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } + return false; +} + +std::string TemporalNADTPoseTPoseLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); +} + +LogicalFunction TemporalNADTPoseTPoseLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); +} + +SerializableFunction TemporalNADTPoseTPoseLogicalFunction::serialize() const +{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } + return proto; +} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTemporalNADTPoseTPoseLogicalFunction( + LogicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.children.size() == 8, + "TemporalNADTPoseTPoseLogicalFunction requires 8 children but got {}", + arguments.children.size()); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + auto arg4 = std::move(arguments.children[4]); + auto arg5 = std::move(arguments.children[5]); + auto arg6 = std::move(arguments.children[6]); + auto arg7 = std::move(arguments.children[7]); + return TemporalNADTPoseTPoseLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6), std::move(arg7)); +} + +} // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TemporalRoundLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TemporalRoundLogicalFunction.cpp index 95163814fd..7d59b14f59 100644 --- a/nes-logical-operators/src/Functions/Meos/TemporalRoundLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/TemporalRoundLogicalFunction.cpp @@ -27,45 +27,64 @@ namespace NES { TemporalRoundLogicalFunction::TemporalRoundLogicalFunction(LogicalFunction value, - LogicalFunction ts, - LogicalFunction maxdd) + LogicalFunction ts, + LogicalFunction arg0) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(3); parameters.push_back(std::move(value)); parameters.push_back(std::move(ts)); - parameters.push_back(std::move(maxdd)); + parameters.push_back(std::move(arg0)); } -DataType TemporalRoundLogicalFunction::getDataType() const { return dataType; } +DataType TemporalRoundLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction TemporalRoundLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector TemporalRoundLogicalFunction::getChildren() const { return parameters; } +std::vector TemporalRoundLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction TemporalRoundLogicalFunction::withChildren(const std::vector& children) const { PRECONDITION(children.size() == 3, "TemporalRoundLogicalFunction requires 3 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view TemporalRoundLogicalFunction::getType() const { return NAME; } +std::string_view TemporalRoundLogicalFunction::getType() const +{ + return NAME; +} bool TemporalRoundLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string TemporalRoundLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -76,7 +95,9 @@ LogicalFunction TemporalRoundLogicalFunction::withInferredDataType(const Schema& std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -86,7 +107,9 @@ SerializableFunction TemporalRoundLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } diff --git a/nes-logical-operators/src/Functions/Meos/TeqBoolTboolLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TeqBoolTboolLogicalFunction.cpp index 96ca3ab52f..46c3588397 100644 --- a/nes-logical-operators/src/Functions/Meos/TeqBoolTboolLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/TeqBoolTboolLogicalFunction.cpp @@ -26,46 +26,65 @@ namespace NES { -TeqBoolTboolLogicalFunction::TeqBoolTboolLogicalFunction(LogicalFunction value, - LogicalFunction threshold, - LogicalFunction ts) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +TeqBoolTboolLogicalFunction::TeqBoolTboolLogicalFunction(LogicalFunction arg0, + LogicalFunction value, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::BOOLEAN)) { parameters.reserve(3); + parameters.push_back(std::move(arg0)); parameters.push_back(std::move(value)); - parameters.push_back(std::move(threshold)); parameters.push_back(std::move(ts)); } -DataType TeqBoolTboolLogicalFunction::getDataType() const { return dataType; } +DataType TeqBoolTboolLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction TeqBoolTboolLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector TeqBoolTboolLogicalFunction::getChildren() const { return parameters; } +std::vector TeqBoolTboolLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction TeqBoolTboolLogicalFunction::withChildren(const std::vector& children) const { PRECONDITION(children.size() == 3, "TeqBoolTboolLogicalFunction requires 3 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view TeqBoolTboolLogicalFunction::getType() const { return NAME; } +std::string_view TeqBoolTboolLogicalFunction::getType() const +{ + return NAME; +} bool TeqBoolTboolLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string TeqBoolTboolLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -76,7 +95,9 @@ LogicalFunction TeqBoolTboolLogicalFunction::withInferredDataType(const Schema& std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -86,7 +107,9 @@ SerializableFunction TeqBoolTboolLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } diff --git a/nes-logical-operators/src/Functions/Meos/TeqTboolBoolLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TeqTboolBoolLogicalFunction.cpp index f0fb48a313..6209caa3e1 100644 --- a/nes-logical-operators/src/Functions/Meos/TeqTboolBoolLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/TeqTboolBoolLogicalFunction.cpp @@ -27,45 +27,64 @@ namespace NES { TeqTboolBoolLogicalFunction::TeqTboolBoolLogicalFunction(LogicalFunction value, - LogicalFunction threshold, - LogicalFunction ts) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) + LogicalFunction ts, + LogicalFunction arg0) + : dataType(DataTypeProvider::provideDataType(DataType::Type::BOOLEAN)) { parameters.reserve(3); parameters.push_back(std::move(value)); - parameters.push_back(std::move(threshold)); parameters.push_back(std::move(ts)); + parameters.push_back(std::move(arg0)); } -DataType TeqTboolBoolLogicalFunction::getDataType() const { return dataType; } +DataType TeqTboolBoolLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction TeqTboolBoolLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector TeqTboolBoolLogicalFunction::getChildren() const { return parameters; } +std::vector TeqTboolBoolLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction TeqTboolBoolLogicalFunction::withChildren(const std::vector& children) const { PRECONDITION(children.size() == 3, "TeqTboolBoolLogicalFunction requires 3 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view TeqTboolBoolLogicalFunction::getType() const { return NAME; } +std::string_view TeqTboolBoolLogicalFunction::getType() const +{ + return NAME; +} bool TeqTboolBoolLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string TeqTboolBoolLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -76,7 +95,9 @@ LogicalFunction TeqTboolBoolLogicalFunction::withInferredDataType(const Schema& std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -86,7 +107,9 @@ SerializableFunction TeqTboolBoolLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } diff --git a/nes-logical-operators/src/Functions/Meos/TextInitcapLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TextInitcapLogicalFunction.cpp index f562bf5407..5a1186c878 100644 --- a/nes-logical-operators/src/Functions/Meos/TextInitcapLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/TextInitcapLogicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -31,41 +32,91 @@ TextInitcapLogicalFunction::TextInitcapLogicalFunction(LogicalFunction str) parameters.reserve(1); parameters.push_back(std::move(str)); } -DataType TextInitcapLogicalFunction::getDataType() const { return dataType; } -LogicalFunction TextInitcapLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } -std::vector TextInitcapLogicalFunction::getChildren() const { return parameters; } -LogicalFunction TextInitcapLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size()==1,"TextInitcapLogicalFunction requires 1 child, but got {}",children.size()); - auto c=*this; c.parameters=children; return c; + +DataType TextInitcapLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction TextInitcapLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector TextInitcapLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction TextInitcapLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 1, "TextInitcapLogicalFunction requires 1 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; +} + +std::string_view TextInitcapLogicalFunction::getType() const +{ + return NAME; } -std::string_view TextInitcapLogicalFunction::getType() const { return NAME; } -bool TextInitcapLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { - if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + +bool TextInitcapLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } return false; } -std::string TextInitcapLogicalFunction::explain(ExplainVerbosity v) const { - return fmt::format("{}({})",NAME,parameters[0].explain(v)); + +std::string TextInitcapLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } -LogicalFunction TextInitcapLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; c.reserve(1); - c.emplace_back(parameters[0].withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "str must be VARSIZED"); - return withChildren(c); + +LogicalFunction TextInitcapLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } -SerializableFunction TextInitcapLogicalFunction::serialize() const { + +SerializableFunction TextInitcapLogicalFunction::serialize() const +{ SerializableFunction proto; proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); - for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } return proto; } + LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTextInitcapLogicalFunction( LogicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.children.size()==1, - "TextInitcapLogicalFunction requires 1 child but got {}", + PRECONDITION(arguments.children.size() == 1, + "TextInitcapLogicalFunction requires 1 children but got {}", arguments.children.size()); - return TextInitcapLogicalFunction(std::move(arguments.children[0])); + auto arg0 = std::move(arguments.children[0]); + return TextInitcapLogicalFunction(std::move(arg0)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TextLowerLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TextLowerLogicalFunction.cpp index 6513d1e0f7..7ad983dece 100644 --- a/nes-logical-operators/src/Functions/Meos/TextLowerLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/TextLowerLogicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -31,41 +32,91 @@ TextLowerLogicalFunction::TextLowerLogicalFunction(LogicalFunction str) parameters.reserve(1); parameters.push_back(std::move(str)); } -DataType TextLowerLogicalFunction::getDataType() const { return dataType; } -LogicalFunction TextLowerLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } -std::vector TextLowerLogicalFunction::getChildren() const { return parameters; } -LogicalFunction TextLowerLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size()==1,"TextLowerLogicalFunction requires 1 child, but got {}",children.size()); - auto c=*this; c.parameters=children; return c; + +DataType TextLowerLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction TextLowerLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector TextLowerLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction TextLowerLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 1, "TextLowerLogicalFunction requires 1 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; +} + +std::string_view TextLowerLogicalFunction::getType() const +{ + return NAME; } -std::string_view TextLowerLogicalFunction::getType() const { return NAME; } -bool TextLowerLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { - if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + +bool TextLowerLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } return false; } -std::string TextLowerLogicalFunction::explain(ExplainVerbosity v) const { - return fmt::format("{}({})",NAME,parameters[0].explain(v)); + +std::string TextLowerLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } -LogicalFunction TextLowerLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; c.reserve(1); - c.emplace_back(parameters[0].withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "str must be VARSIZED"); - return withChildren(c); + +LogicalFunction TextLowerLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } -SerializableFunction TextLowerLogicalFunction::serialize() const { + +SerializableFunction TextLowerLogicalFunction::serialize() const +{ SerializableFunction proto; proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); - for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } return proto; } + LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTextLowerLogicalFunction( LogicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.children.size()==1, - "TextLowerLogicalFunction requires 1 child but got {}", + PRECONDITION(arguments.children.size() == 1, + "TextLowerLogicalFunction requires 1 children but got {}", arguments.children.size()); - return TextLowerLogicalFunction(std::move(arguments.children[0])); + auto arg0 = std::move(arguments.children[0]); + return TextLowerLogicalFunction(std::move(arg0)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TextUpperLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TextUpperLogicalFunction.cpp index 35db545b9e..132ed502c6 100644 --- a/nes-logical-operators/src/Functions/Meos/TextUpperLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/TextUpperLogicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -31,41 +32,91 @@ TextUpperLogicalFunction::TextUpperLogicalFunction(LogicalFunction str) parameters.reserve(1); parameters.push_back(std::move(str)); } -DataType TextUpperLogicalFunction::getDataType() const { return dataType; } -LogicalFunction TextUpperLogicalFunction::withDataType(const DataType& d) const { auto c=*this; c.dataType=d; return c; } -std::vector TextUpperLogicalFunction::getChildren() const { return parameters; } -LogicalFunction TextUpperLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size()==1,"TextUpperLogicalFunction requires 1 child, but got {}",children.size()); - auto c=*this; c.parameters=children; return c; + +DataType TextUpperLogicalFunction::getDataType() const +{ + return dataType; +} + +LogicalFunction TextUpperLogicalFunction::withDataType(const DataType& newDataType) const +{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +} + +std::vector TextUpperLogicalFunction::getChildren() const +{ + return parameters; +} + +LogicalFunction TextUpperLogicalFunction::withChildren(const std::vector& children) const +{ + PRECONDITION(children.size() == 1, "TextUpperLogicalFunction requires 1 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; +} + +std::string_view TextUpperLogicalFunction::getType() const +{ + return NAME; } -std::string_view TextUpperLogicalFunction::getType() const { return NAME; } -bool TextUpperLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { - if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters; + +bool TextUpperLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{ + if (const auto* other = dynamic_cast(&rhs)) + { + return parameters == other->parameters; + } return false; } -std::string TextUpperLogicalFunction::explain(ExplainVerbosity v) const { - return fmt::format("{}({})",NAME,parameters[0].explain(v)); + +std::string TextUpperLogicalFunction::explain(ExplainVerbosity verbosity) const +{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } -LogicalFunction TextUpperLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; c.reserve(1); - c.emplace_back(parameters[0].withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::VARSIZED), "str must be VARSIZED"); - return withChildren(c); + +LogicalFunction TextUpperLogicalFunction::withInferredDataType(const Schema& schema) const +{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } -SerializableFunction TextUpperLogicalFunction::serialize() const { + +SerializableFunction TextUpperLogicalFunction::serialize() const +{ SerializableFunction proto; proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); - for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize()); + for (const auto& child : parameters) + { + proto.add_children()->CopyFrom(child.serialize()); + } return proto; } + LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTextUpperLogicalFunction( LogicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.children.size()==1, - "TextUpperLogicalFunction requires 1 child but got {}", + PRECONDITION(arguments.children.size() == 1, + "TextUpperLogicalFunction requires 1 children but got {}", arguments.children.size()); - return TextUpperLogicalFunction(std::move(arguments.children[0])); + auto arg0 = std::move(arguments.children[0]); + return TextUpperLogicalFunction(std::move(arg0)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TextcatTextTtextLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TextcatTextTtextLogicalFunction.cpp index 9b7be445b6..36958da659 100644 --- a/nes-logical-operators/src/Functions/Meos/TextcatTextTtextLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/TextcatTextTtextLogicalFunction.cpp @@ -26,44 +26,65 @@ namespace NES { -TextcatTextTtextLogicalFunction::TextcatTextTtextLogicalFunction(LogicalFunction value, LogicalFunction ts, LogicalFunction ref) +TextcatTextTtextLogicalFunction::TextcatTextTtextLogicalFunction(LogicalFunction arg0, + LogicalFunction value, + LogicalFunction ts) : dataType(DataTypeProvider::provideDataType(DataType::Type::VARSIZED)) { parameters.reserve(3); + parameters.push_back(std::move(arg0)); parameters.push_back(std::move(value)); parameters.push_back(std::move(ts)); - parameters.push_back(std::move(ref)); } -DataType TextcatTextTtextLogicalFunction::getDataType() const { return dataType; } +DataType TextcatTextTtextLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction TextcatTextTtextLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector TextcatTextTtextLogicalFunction::getChildren() const { return parameters; } +std::vector TextcatTextTtextLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction TextcatTextTtextLogicalFunction::withChildren(const std::vector& children) const { PRECONDITION(children.size() == 3, "TextcatTextTtextLogicalFunction requires 3 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view TextcatTextTtextLogicalFunction::getType() const { return NAME; } +std::string_view TextcatTextTtextLogicalFunction::getType() const +{ + return NAME; +} bool TextcatTextTtextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string TextcatTextTtextLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -74,7 +95,9 @@ LogicalFunction TextcatTextTtextLogicalFunction::withInferredDataType(const Sche std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -84,7 +107,9 @@ SerializableFunction TextcatTextTtextLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } diff --git a/nes-logical-operators/src/Functions/Meos/TextcatTtextTextLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TextcatTtextTextLogicalFunction.cpp index db6687cd5a..e49d2bf969 100644 --- a/nes-logical-operators/src/Functions/Meos/TextcatTtextTextLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/TextcatTtextTextLogicalFunction.cpp @@ -26,44 +26,65 @@ namespace NES { -TextcatTtextTextLogicalFunction::TextcatTtextTextLogicalFunction(LogicalFunction value, LogicalFunction ts, LogicalFunction ref) +TextcatTtextTextLogicalFunction::TextcatTtextTextLogicalFunction(LogicalFunction value, + LogicalFunction ts, + LogicalFunction arg0) : dataType(DataTypeProvider::provideDataType(DataType::Type::VARSIZED)) { parameters.reserve(3); parameters.push_back(std::move(value)); parameters.push_back(std::move(ts)); - parameters.push_back(std::move(ref)); + parameters.push_back(std::move(arg0)); } -DataType TextcatTtextTextLogicalFunction::getDataType() const { return dataType; } +DataType TextcatTtextTextLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction TextcatTtextTextLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector TextcatTtextTextLogicalFunction::getChildren() const { return parameters; } +std::vector TextcatTtextTextLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction TextcatTtextTextLogicalFunction::withChildren(const std::vector& children) const { PRECONDITION(children.size() == 3, "TextcatTtextTextLogicalFunction requires 3 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view TextcatTtextTextLogicalFunction::getType() const { return NAME; } +std::string_view TextcatTtextTextLogicalFunction::getType() const +{ + return NAME; +} bool TextcatTtextTextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string TextcatTtextTextLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -74,7 +95,9 @@ LogicalFunction TextcatTtextTextLogicalFunction::withInferredDataType(const Sche std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -84,7 +107,9 @@ SerializableFunction TextcatTtextTextLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } diff --git a/nes-logical-operators/src/Functions/Meos/TextcatTtextTtextLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TextcatTtextTtextLogicalFunction.cpp index f806a02d5f..d3249b6131 100644 --- a/nes-logical-operators/src/Functions/Meos/TextcatTtextTtextLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/TextcatTtextTtextLogicalFunction.cpp @@ -26,45 +26,67 @@ namespace NES { -TextcatTtextTtextLogicalFunction::TextcatTtextTtextLogicalFunction(LogicalFunction value1, LogicalFunction ts1, LogicalFunction value2, LogicalFunction ts2) +TextcatTtextTtextLogicalFunction::TextcatTtextTtextLogicalFunction(LogicalFunction value, + LogicalFunction ts, + LogicalFunction tval0, + LogicalFunction ts0) : dataType(DataTypeProvider::provideDataType(DataType::Type::VARSIZED)) { parameters.reserve(4); - parameters.push_back(std::move(value1)); - parameters.push_back(std::move(ts1)); - parameters.push_back(std::move(value2)); - parameters.push_back(std::move(ts2)); + parameters.push_back(std::move(value)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(tval0)); + parameters.push_back(std::move(ts0)); } -DataType TextcatTtextTtextLogicalFunction::getDataType() const { return dataType; } +DataType TextcatTtextTtextLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction TextcatTtextTtextLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector TextcatTtextTtextLogicalFunction::getChildren() const { return parameters; } +std::vector TextcatTtextTtextLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction TextcatTtextTtextLogicalFunction::withChildren(const std::vector& children) const { PRECONDITION(children.size() == 4, "TextcatTtextTtextLogicalFunction requires 4 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view TextcatTtextTtextLogicalFunction::getType() const { return NAME; } +std::string_view TextcatTtextTtextLogicalFunction::getType() const +{ + return NAME; +} bool TextcatTtextTtextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string TextcatTtextTtextLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -75,7 +97,9 @@ LogicalFunction TextcatTtextTtextLogicalFunction::withInferredDataType(const Sch std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -85,7 +109,9 @@ SerializableFunction TextcatTtextTtextLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } diff --git a/nes-logical-operators/src/Functions/Meos/TfloatCeilLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TfloatCeilLogicalFunction.cpp index 79c19c517a..0de1c71bea 100644 --- a/nes-logical-operators/src/Functions/Meos/TfloatCeilLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/TfloatCeilLogicalFunction.cpp @@ -35,35 +35,54 @@ TfloatCeilLogicalFunction::TfloatCeilLogicalFunction(LogicalFunction value, parameters.push_back(std::move(ts)); } -DataType TfloatCeilLogicalFunction::getDataType() const { return dataType; } +DataType TfloatCeilLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction TfloatCeilLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector TfloatCeilLogicalFunction::getChildren() const { return parameters; } +std::vector TfloatCeilLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction TfloatCeilLogicalFunction::withChildren(const std::vector& children) const { PRECONDITION(children.size() == 2, "TfloatCeilLogicalFunction requires 2 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view TfloatCeilLogicalFunction::getType() const { return NAME; } +std::string_view TfloatCeilLogicalFunction::getType() const +{ + return NAME; +} bool TfloatCeilLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string TfloatCeilLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -74,7 +93,9 @@ LogicalFunction TfloatCeilLogicalFunction::withInferredDataType(const Schema& sc std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -84,7 +105,9 @@ SerializableFunction TfloatCeilLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } diff --git a/nes-logical-operators/src/Functions/Meos/TfloatExpLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TfloatExpLogicalFunction.cpp index bf6a97e365..33234e797f 100644 --- a/nes-logical-operators/src/Functions/Meos/TfloatExpLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/TfloatExpLogicalFunction.cpp @@ -35,35 +35,54 @@ TfloatExpLogicalFunction::TfloatExpLogicalFunction(LogicalFunction value, parameters.push_back(std::move(ts)); } -DataType TfloatExpLogicalFunction::getDataType() const { return dataType; } +DataType TfloatExpLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction TfloatExpLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector TfloatExpLogicalFunction::getChildren() const { return parameters; } +std::vector TfloatExpLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction TfloatExpLogicalFunction::withChildren(const std::vector& children) const { PRECONDITION(children.size() == 2, "TfloatExpLogicalFunction requires 2 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view TfloatExpLogicalFunction::getType() const { return NAME; } +std::string_view TfloatExpLogicalFunction::getType() const +{ + return NAME; +} bool TfloatExpLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string TfloatExpLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -74,7 +93,9 @@ LogicalFunction TfloatExpLogicalFunction::withInferredDataType(const Schema& sch std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -84,7 +105,9 @@ SerializableFunction TfloatExpLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } diff --git a/nes-logical-operators/src/Functions/Meos/TfloatFloorLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TfloatFloorLogicalFunction.cpp index 3c9196c92e..7fe9ee08fc 100644 --- a/nes-logical-operators/src/Functions/Meos/TfloatFloorLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/TfloatFloorLogicalFunction.cpp @@ -35,35 +35,54 @@ TfloatFloorLogicalFunction::TfloatFloorLogicalFunction(LogicalFunction value, parameters.push_back(std::move(ts)); } -DataType TfloatFloorLogicalFunction::getDataType() const { return dataType; } +DataType TfloatFloorLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction TfloatFloorLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector TfloatFloorLogicalFunction::getChildren() const { return parameters; } +std::vector TfloatFloorLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction TfloatFloorLogicalFunction::withChildren(const std::vector& children) const { PRECONDITION(children.size() == 2, "TfloatFloorLogicalFunction requires 2 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view TfloatFloorLogicalFunction::getType() const { return NAME; } +std::string_view TfloatFloorLogicalFunction::getType() const +{ + return NAME; +} bool TfloatFloorLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string TfloatFloorLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -74,7 +93,9 @@ LogicalFunction TfloatFloorLogicalFunction::withInferredDataType(const Schema& s std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -84,7 +105,9 @@ SerializableFunction TfloatFloorLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } diff --git a/nes-logical-operators/src/Functions/Meos/TfloatLnLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TfloatLnLogicalFunction.cpp index 2d12b9baa5..b07ad8e2d4 100644 --- a/nes-logical-operators/src/Functions/Meos/TfloatLnLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/TfloatLnLogicalFunction.cpp @@ -35,35 +35,54 @@ TfloatLnLogicalFunction::TfloatLnLogicalFunction(LogicalFunction value, parameters.push_back(std::move(ts)); } -DataType TfloatLnLogicalFunction::getDataType() const { return dataType; } +DataType TfloatLnLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction TfloatLnLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector TfloatLnLogicalFunction::getChildren() const { return parameters; } +std::vector TfloatLnLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction TfloatLnLogicalFunction::withChildren(const std::vector& children) const { PRECONDITION(children.size() == 2, "TfloatLnLogicalFunction requires 2 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view TfloatLnLogicalFunction::getType() const { return NAME; } +std::string_view TfloatLnLogicalFunction::getType() const +{ + return NAME; +} bool TfloatLnLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string TfloatLnLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -74,7 +93,9 @@ LogicalFunction TfloatLnLogicalFunction::withInferredDataType(const Schema& sche std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -84,7 +105,9 @@ SerializableFunction TfloatLnLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } diff --git a/nes-logical-operators/src/Functions/Meos/TfloatLog10LogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TfloatLog10LogicalFunction.cpp index 22fe17e9ba..3e438772be 100644 --- a/nes-logical-operators/src/Functions/Meos/TfloatLog10LogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/TfloatLog10LogicalFunction.cpp @@ -35,35 +35,54 @@ TfloatLog10LogicalFunction::TfloatLog10LogicalFunction(LogicalFunction value, parameters.push_back(std::move(ts)); } -DataType TfloatLog10LogicalFunction::getDataType() const { return dataType; } +DataType TfloatLog10LogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction TfloatLog10LogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector TfloatLog10LogicalFunction::getChildren() const { return parameters; } +std::vector TfloatLog10LogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction TfloatLog10LogicalFunction::withChildren(const std::vector& children) const { PRECONDITION(children.size() == 2, "TfloatLog10LogicalFunction requires 2 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view TfloatLog10LogicalFunction::getType() const { return NAME; } +std::string_view TfloatLog10LogicalFunction::getType() const +{ + return NAME; +} bool TfloatLog10LogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string TfloatLog10LogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -74,7 +93,9 @@ LogicalFunction TfloatLog10LogicalFunction::withInferredDataType(const Schema& s std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -84,7 +105,9 @@ SerializableFunction TfloatLog10LogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } diff --git a/nes-logical-operators/src/Functions/Meos/TfloatRadiansLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TfloatRadiansLogicalFunction.cpp index fff28b7bca..74d5f2d0cc 100644 --- a/nes-logical-operators/src/Functions/Meos/TfloatRadiansLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/TfloatRadiansLogicalFunction.cpp @@ -35,35 +35,54 @@ TfloatRadiansLogicalFunction::TfloatRadiansLogicalFunction(LogicalFunction value parameters.push_back(std::move(ts)); } -DataType TfloatRadiansLogicalFunction::getDataType() const { return dataType; } +DataType TfloatRadiansLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction TfloatRadiansLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector TfloatRadiansLogicalFunction::getChildren() const { return parameters; } +std::vector TfloatRadiansLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction TfloatRadiansLogicalFunction::withChildren(const std::vector& children) const { PRECONDITION(children.size() == 2, "TfloatRadiansLogicalFunction requires 2 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view TfloatRadiansLogicalFunction::getType() const { return NAME; } +std::string_view TfloatRadiansLogicalFunction::getType() const +{ + return NAME; +} bool TfloatRadiansLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string TfloatRadiansLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -74,7 +93,9 @@ LogicalFunction TfloatRadiansLogicalFunction::withInferredDataType(const Schema& std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -84,7 +105,9 @@ SerializableFunction TfloatRadiansLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } diff --git a/nes-logical-operators/src/Functions/Meos/TfloatScaleValueLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TfloatScaleValueLogicalFunction.cpp index 7631f17ea6..296b714674 100644 --- a/nes-logical-operators/src/Functions/Meos/TfloatScaleValueLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/TfloatScaleValueLogicalFunction.cpp @@ -27,45 +27,64 @@ namespace NES { TfloatScaleValueLogicalFunction::TfloatScaleValueLogicalFunction(LogicalFunction value, - LogicalFunction ts, - LogicalFunction width) + LogicalFunction ts, + LogicalFunction arg0) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(3); parameters.push_back(std::move(value)); parameters.push_back(std::move(ts)); - parameters.push_back(std::move(width)); + parameters.push_back(std::move(arg0)); } -DataType TfloatScaleValueLogicalFunction::getDataType() const { return dataType; } +DataType TfloatScaleValueLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction TfloatScaleValueLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector TfloatScaleValueLogicalFunction::getChildren() const { return parameters; } +std::vector TfloatScaleValueLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction TfloatScaleValueLogicalFunction::withChildren(const std::vector& children) const { PRECONDITION(children.size() == 3, "TfloatScaleValueLogicalFunction requires 3 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view TfloatScaleValueLogicalFunction::getType() const { return NAME; } +std::string_view TfloatScaleValueLogicalFunction::getType() const +{ + return NAME; +} bool TfloatScaleValueLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string TfloatScaleValueLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -76,7 +95,9 @@ LogicalFunction TfloatScaleValueLogicalFunction::withInferredDataType(const Sche std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -86,7 +107,9 @@ SerializableFunction TfloatScaleValueLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } diff --git a/nes-logical-operators/src/Functions/Meos/TfloatShiftScaleValueLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TfloatShiftScaleValueLogicalFunction.cpp index ef6f4c2a71..9fe4dd7898 100644 --- a/nes-logical-operators/src/Functions/Meos/TfloatShiftScaleValueLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/TfloatShiftScaleValueLogicalFunction.cpp @@ -27,47 +27,66 @@ namespace NES { TfloatShiftScaleValueLogicalFunction::TfloatShiftScaleValueLogicalFunction(LogicalFunction value, - LogicalFunction ts, - LogicalFunction shift, - LogicalFunction width) + LogicalFunction ts, + LogicalFunction arg0, + LogicalFunction arg1) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(4); parameters.push_back(std::move(value)); parameters.push_back(std::move(ts)); - parameters.push_back(std::move(shift)); - parameters.push_back(std::move(width)); + parameters.push_back(std::move(arg0)); + parameters.push_back(std::move(arg1)); } -DataType TfloatShiftScaleValueLogicalFunction::getDataType() const { return dataType; } +DataType TfloatShiftScaleValueLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction TfloatShiftScaleValueLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector TfloatShiftScaleValueLogicalFunction::getChildren() const { return parameters; } +std::vector TfloatShiftScaleValueLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction TfloatShiftScaleValueLogicalFunction::withChildren(const std::vector& children) const { PRECONDITION(children.size() == 4, "TfloatShiftScaleValueLogicalFunction requires 4 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view TfloatShiftScaleValueLogicalFunction::getType() const { return NAME; } +std::string_view TfloatShiftScaleValueLogicalFunction::getType() const +{ + return NAME; +} bool TfloatShiftScaleValueLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string TfloatShiftScaleValueLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -78,7 +97,9 @@ LogicalFunction TfloatShiftScaleValueLogicalFunction::withInferredDataType(const std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -88,7 +109,9 @@ SerializableFunction TfloatShiftScaleValueLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } diff --git a/nes-logical-operators/src/Functions/Meos/TfloatShiftValueLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TfloatShiftValueLogicalFunction.cpp index d4c4cea5de..bd50ef0c11 100644 --- a/nes-logical-operators/src/Functions/Meos/TfloatShiftValueLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/TfloatShiftValueLogicalFunction.cpp @@ -27,45 +27,64 @@ namespace NES { TfloatShiftValueLogicalFunction::TfloatShiftValueLogicalFunction(LogicalFunction value, - LogicalFunction ts, - LogicalFunction shift) + LogicalFunction ts, + LogicalFunction arg0) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(3); parameters.push_back(std::move(value)); parameters.push_back(std::move(ts)); - parameters.push_back(std::move(shift)); + parameters.push_back(std::move(arg0)); } -DataType TfloatShiftValueLogicalFunction::getDataType() const { return dataType; } +DataType TfloatShiftValueLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction TfloatShiftValueLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector TfloatShiftValueLogicalFunction::getChildren() const { return parameters; } +std::vector TfloatShiftValueLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction TfloatShiftValueLogicalFunction::withChildren(const std::vector& children) const { PRECONDITION(children.size() == 3, "TfloatShiftValueLogicalFunction requires 3 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view TfloatShiftValueLogicalFunction::getType() const { return NAME; } +std::string_view TfloatShiftValueLogicalFunction::getType() const +{ + return NAME; +} bool TfloatShiftValueLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string TfloatShiftValueLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -76,7 +95,9 @@ LogicalFunction TfloatShiftValueLogicalFunction::withInferredDataType(const Sche std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -86,7 +107,9 @@ SerializableFunction TfloatShiftValueLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } diff --git a/nes-logical-operators/src/Functions/Meos/TfloatToTbigintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TfloatToTbigintLogicalFunction.cpp index b86add8d10..a67b4abba8 100644 --- a/nes-logical-operators/src/Functions/Meos/TfloatToTbigintLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/TfloatToTbigintLogicalFunction.cpp @@ -27,7 +27,7 @@ namespace NES { TfloatToTbigintLogicalFunction::TfloatToTbigintLogicalFunction(LogicalFunction value, - LogicalFunction ts) + LogicalFunction ts) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(2); @@ -35,35 +35,54 @@ TfloatToTbigintLogicalFunction::TfloatToTbigintLogicalFunction(LogicalFunction v parameters.push_back(std::move(ts)); } -DataType TfloatToTbigintLogicalFunction::getDataType() const { return dataType; } +DataType TfloatToTbigintLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction TfloatToTbigintLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector TfloatToTbigintLogicalFunction::getChildren() const { return parameters; } +std::vector TfloatToTbigintLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction TfloatToTbigintLogicalFunction::withChildren(const std::vector& children) const { PRECONDITION(children.size() == 2, "TfloatToTbigintLogicalFunction requires 2 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view TfloatToTbigintLogicalFunction::getType() const { return NAME; } +std::string_view TfloatToTbigintLogicalFunction::getType() const +{ + return NAME; +} bool TfloatToTbigintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string TfloatToTbigintLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -74,7 +93,9 @@ LogicalFunction TfloatToTbigintLogicalFunction::withInferredDataType(const Schem std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -84,7 +105,9 @@ SerializableFunction TfloatToTbigintLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } diff --git a/nes-logical-operators/src/Functions/Meos/TfloatToTintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TfloatToTintLogicalFunction.cpp index 63bf97d316..a9ac52789e 100644 --- a/nes-logical-operators/src/Functions/Meos/TfloatToTintLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/TfloatToTintLogicalFunction.cpp @@ -27,43 +27,62 @@ namespace NES { TfloatToTintLogicalFunction::TfloatToTintLogicalFunction(LogicalFunction value, - LogicalFunction ts) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) { parameters.reserve(2); parameters.push_back(std::move(value)); parameters.push_back(std::move(ts)); } -DataType TfloatToTintLogicalFunction::getDataType() const { return dataType; } +DataType TfloatToTintLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction TfloatToTintLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector TfloatToTintLogicalFunction::getChildren() const { return parameters; } +std::vector TfloatToTintLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction TfloatToTintLogicalFunction::withChildren(const std::vector& children) const { PRECONDITION(children.size() == 2, "TfloatToTintLogicalFunction requires 2 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view TfloatToTintLogicalFunction::getType() const { return NAME; } +std::string_view TfloatToTintLogicalFunction::getType() const +{ + return NAME; +} bool TfloatToTintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string TfloatToTintLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -74,7 +93,9 @@ LogicalFunction TfloatToTintLogicalFunction::withInferredDataType(const Schema& std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -84,7 +105,9 @@ SerializableFunction TfloatToTintLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } diff --git a/nes-logical-operators/src/Functions/Meos/Th3indexAreNeighborCellsLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/Th3indexAreNeighborCellsLogicalFunction.cpp index 420cdbd9c6..ebd3ff33a9 100644 --- a/nes-logical-operators/src/Functions/Meos/Th3indexAreNeighborCellsLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/Th3indexAreNeighborCellsLogicalFunction.cpp @@ -26,60 +26,81 @@ namespace NES { -Th3indexAreNeighborCellsLogicalFunction::Th3indexAreNeighborCellsLogicalFunction(LogicalFunction cell1, LogicalFunction ts1, - LogicalFunction cell2, LogicalFunction ts2) +Th3indexAreNeighborCellsLogicalFunction::Th3indexAreNeighborCellsLogicalFunction(LogicalFunction cell, + LogicalFunction ts, + LogicalFunction cell0, + LogicalFunction ts0) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(4); - parameters.push_back(std::move(cell1)); - parameters.push_back(std::move(ts1)); - parameters.push_back(std::move(cell2)); - parameters.push_back(std::move(ts2)); + parameters.push_back(std::move(cell)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(cell0)); + parameters.push_back(std::move(ts0)); } -DataType Th3indexAreNeighborCellsLogicalFunction::getDataType() const { return dataType; } +DataType Th3indexAreNeighborCellsLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction Th3indexAreNeighborCellsLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector Th3indexAreNeighborCellsLogicalFunction::getChildren() const { return parameters; } +std::vector Th3indexAreNeighborCellsLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction Th3indexAreNeighborCellsLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 4, - "Th3indexAreNeighborCellsLogicalFunction requires 4 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 4, "Th3indexAreNeighborCellsLogicalFunction requires 4 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view Th3indexAreNeighborCellsLogicalFunction::getType() const { return NAME; } +std::string_view Th3indexAreNeighborCellsLogicalFunction::getType() const +{ + return NAME; +} bool Th3indexAreNeighborCellsLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string Th3indexAreNeighborCellsLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction Th3indexAreNeighborCellsLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(4); - c.emplace_back(parameters[0].withInferredDataType(schema)); - c.emplace_back(parameters[1].withInferredDataType(schema)); - c.emplace_back(parameters[2].withInferredDataType(schema)); - c.emplace_back(parameters[3].withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "cell1 must be UINT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "cell2 must be UINT64"); - INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction Th3indexAreNeighborCellsLogicalFunction::serialize() const @@ -88,7 +109,9 @@ SerializableFunction Th3indexAreNeighborCellsLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -98,10 +121,11 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTh3 PRECONDITION(arguments.children.size() == 4, "Th3indexAreNeighborCellsLogicalFunction requires 4 children but got {}", arguments.children.size()); - return Th3indexAreNeighborCellsLogicalFunction(std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2]), - std::move(arguments.children[3])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + return Th3indexAreNeighborCellsLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/Th3indexCellToCenterChildLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/Th3indexCellToCenterChildLogicalFunction.cpp index 1b23759a61..87f7c91b31 100644 --- a/nes-logical-operators/src/Functions/Meos/Th3indexCellToCenterChildLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/Th3indexCellToCenterChildLogicalFunction.cpp @@ -26,57 +26,79 @@ namespace NES { -Th3indexCellToCenterChildLogicalFunction::Th3indexCellToCenterChildLogicalFunction(LogicalFunction cell, LogicalFunction ts, - LogicalFunction resolution) +Th3indexCellToCenterChildLogicalFunction::Th3indexCellToCenterChildLogicalFunction(LogicalFunction cell, + LogicalFunction ts, + LogicalFunction arg0) : dataType(DataTypeProvider::provideDataType(DataType::Type::VARSIZED)) { parameters.reserve(3); parameters.push_back(std::move(cell)); parameters.push_back(std::move(ts)); - parameters.push_back(std::move(resolution)); + parameters.push_back(std::move(arg0)); } -DataType Th3indexCellToCenterChildLogicalFunction::getDataType() const { return dataType; } +DataType Th3indexCellToCenterChildLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction Th3indexCellToCenterChildLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector Th3indexCellToCenterChildLogicalFunction::getChildren() const { return parameters; } +std::vector Th3indexCellToCenterChildLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction Th3indexCellToCenterChildLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 3, - "Th3indexCellToCenterChildLogicalFunction requires 3 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 3, "Th3indexCellToCenterChildLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view Th3indexCellToCenterChildLogicalFunction::getType() const { return NAME; } +std::string_view Th3indexCellToCenterChildLogicalFunction::getType() const +{ + return NAME; +} bool Th3indexCellToCenterChildLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string Th3indexCellToCenterChildLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction Th3indexCellToCenterChildLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(3); - c.emplace_back(parameters[0].withInferredDataType(schema)); - c.emplace_back(parameters[1].withInferredDataType(schema)); - c.emplace_back(parameters[2].withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "cell must be UINT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "resolution must be UINT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction Th3indexCellToCenterChildLogicalFunction::serialize() const @@ -85,7 +107,9 @@ SerializableFunction Th3indexCellToCenterChildLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -95,9 +119,10 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTh3 PRECONDITION(arguments.children.size() == 3, "Th3indexCellToCenterChildLogicalFunction requires 3 children but got {}", arguments.children.size()); - return Th3indexCellToCenterChildLogicalFunction(std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return Th3indexCellToCenterChildLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/Th3indexCellToCenterChildNextLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/Th3indexCellToCenterChildNextLogicalFunction.cpp index 8bb6a4bfcf..d22d34a95e 100644 --- a/nes-logical-operators/src/Functions/Meos/Th3indexCellToCenterChildNextLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/Th3indexCellToCenterChildNextLogicalFunction.cpp @@ -26,53 +26,79 @@ namespace NES { -Th3indexCellToCenterChildNextLogicalFunction::Th3indexCellToCenterChildNextLogicalFunction(LogicalFunction cell, LogicalFunction ts) +Th3indexCellToCenterChildNextLogicalFunction::Th3indexCellToCenterChildNextLogicalFunction(LogicalFunction cell, + LogicalFunction ts, + LogicalFunction arg0) : dataType(DataTypeProvider::provideDataType(DataType::Type::VARSIZED)) { - parameters.reserve(2); + parameters.reserve(3); parameters.push_back(std::move(cell)); parameters.push_back(std::move(ts)); + parameters.push_back(std::move(arg0)); } -DataType Th3indexCellToCenterChildNextLogicalFunction::getDataType() const { return dataType; } +DataType Th3indexCellToCenterChildNextLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction Th3indexCellToCenterChildNextLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector Th3indexCellToCenterChildNextLogicalFunction::getChildren() const { return parameters; } +std::vector Th3indexCellToCenterChildNextLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction Th3indexCellToCenterChildNextLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 2, - "Th3indexCellToCenterChildNextLogicalFunction requires 2 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 3, "Th3indexCellToCenterChildNextLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view Th3indexCellToCenterChildNextLogicalFunction::getType() const { return NAME; } +std::string_view Th3indexCellToCenterChildNextLogicalFunction::getType() const +{ + return NAME; +} bool Th3indexCellToCenterChildNextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string Th3indexCellToCenterChildNextLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction Th3indexCellToCenterChildNextLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(2); - c.emplace_back(parameters[0].withInferredDataType(schema)); - c.emplace_back(parameters[1].withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "cell must be UINT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction Th3indexCellToCenterChildNextLogicalFunction::serialize() const @@ -81,18 +107,22 @@ SerializableFunction Th3indexCellToCenterChildNextLogicalFunction::serialize() c proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTh3indexCellToCenterChildNextLogicalFunction( LogicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.children.size() == 2, - "Th3indexCellToCenterChildNextLogicalFunction requires 2 children but got {}", + PRECONDITION(arguments.children.size() == 3, + "Th3indexCellToCenterChildNextLogicalFunction requires 3 children but got {}", arguments.children.size()); - return Th3indexCellToCenterChildNextLogicalFunction(std::move(arguments.children[0]), - std::move(arguments.children[1])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return Th3indexCellToCenterChildNextLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/Th3indexCellToChildPosLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/Th3indexCellToChildPosLogicalFunction.cpp index 0c673ff91e..c4a98f9435 100644 --- a/nes-logical-operators/src/Functions/Meos/Th3indexCellToChildPosLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/Th3indexCellToChildPosLogicalFunction.cpp @@ -26,57 +26,79 @@ namespace NES { -Th3indexCellToChildPosLogicalFunction::Th3indexCellToChildPosLogicalFunction(LogicalFunction cell, LogicalFunction ts, - LogicalFunction parent_res) +Th3indexCellToChildPosLogicalFunction::Th3indexCellToChildPosLogicalFunction(LogicalFunction cell, + LogicalFunction ts, + LogicalFunction arg0) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(3); parameters.push_back(std::move(cell)); parameters.push_back(std::move(ts)); - parameters.push_back(std::move(parent_res)); + parameters.push_back(std::move(arg0)); } -DataType Th3indexCellToChildPosLogicalFunction::getDataType() const { return dataType; } +DataType Th3indexCellToChildPosLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction Th3indexCellToChildPosLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector Th3indexCellToChildPosLogicalFunction::getChildren() const { return parameters; } +std::vector Th3indexCellToChildPosLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction Th3indexCellToChildPosLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 3, - "Th3indexCellToChildPosLogicalFunction requires 3 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 3, "Th3indexCellToChildPosLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view Th3indexCellToChildPosLogicalFunction::getType() const { return NAME; } +std::string_view Th3indexCellToChildPosLogicalFunction::getType() const +{ + return NAME; +} bool Th3indexCellToChildPosLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string Th3indexCellToChildPosLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction Th3indexCellToChildPosLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(3); - c.emplace_back(parameters[0].withInferredDataType(schema)); - c.emplace_back(parameters[1].withInferredDataType(schema)); - c.emplace_back(parameters[2].withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "cell must be UINT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "parent_res must be UINT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction Th3indexCellToChildPosLogicalFunction::serialize() const @@ -85,7 +107,9 @@ SerializableFunction Th3indexCellToChildPosLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -95,9 +119,10 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTh3 PRECONDITION(arguments.children.size() == 3, "Th3indexCellToChildPosLogicalFunction requires 3 children but got {}", arguments.children.size()); - return Th3indexCellToChildPosLogicalFunction(std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return Th3indexCellToChildPosLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/Th3indexCellToParentLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/Th3indexCellToParentLogicalFunction.cpp index 0ae233f25a..bc722b1f03 100644 --- a/nes-logical-operators/src/Functions/Meos/Th3indexCellToParentLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/Th3indexCellToParentLogicalFunction.cpp @@ -26,57 +26,79 @@ namespace NES { -Th3indexCellToParentLogicalFunction::Th3indexCellToParentLogicalFunction(LogicalFunction cell, LogicalFunction ts, - LogicalFunction resolution) +Th3indexCellToParentLogicalFunction::Th3indexCellToParentLogicalFunction(LogicalFunction cell, + LogicalFunction ts, + LogicalFunction arg0) : dataType(DataTypeProvider::provideDataType(DataType::Type::VARSIZED)) { parameters.reserve(3); parameters.push_back(std::move(cell)); parameters.push_back(std::move(ts)); - parameters.push_back(std::move(resolution)); + parameters.push_back(std::move(arg0)); } -DataType Th3indexCellToParentLogicalFunction::getDataType() const { return dataType; } +DataType Th3indexCellToParentLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction Th3indexCellToParentLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector Th3indexCellToParentLogicalFunction::getChildren() const { return parameters; } +std::vector Th3indexCellToParentLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction Th3indexCellToParentLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 3, - "Th3indexCellToParentLogicalFunction requires 3 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 3, "Th3indexCellToParentLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view Th3indexCellToParentLogicalFunction::getType() const { return NAME; } +std::string_view Th3indexCellToParentLogicalFunction::getType() const +{ + return NAME; +} bool Th3indexCellToParentLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string Th3indexCellToParentLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction Th3indexCellToParentLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(3); - c.emplace_back(parameters[0].withInferredDataType(schema)); - c.emplace_back(parameters[1].withInferredDataType(schema)); - c.emplace_back(parameters[2].withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "cell must be UINT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "resolution must be UINT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction Th3indexCellToParentLogicalFunction::serialize() const @@ -85,7 +107,9 @@ SerializableFunction Th3indexCellToParentLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -95,9 +119,10 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTh3 PRECONDITION(arguments.children.size() == 3, "Th3indexCellToParentLogicalFunction requires 3 children but got {}", arguments.children.size()); - return Th3indexCellToParentLogicalFunction(std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return Th3indexCellToParentLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/Th3indexCellToParentNextLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/Th3indexCellToParentNextLogicalFunction.cpp index 4e975cb109..fba0546989 100644 --- a/nes-logical-operators/src/Functions/Meos/Th3indexCellToParentNextLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/Th3indexCellToParentNextLogicalFunction.cpp @@ -26,53 +26,79 @@ namespace NES { -Th3indexCellToParentNextLogicalFunction::Th3indexCellToParentNextLogicalFunction(LogicalFunction cell, LogicalFunction ts) +Th3indexCellToParentNextLogicalFunction::Th3indexCellToParentNextLogicalFunction(LogicalFunction cell, + LogicalFunction ts, + LogicalFunction arg0) : dataType(DataTypeProvider::provideDataType(DataType::Type::VARSIZED)) { - parameters.reserve(2); + parameters.reserve(3); parameters.push_back(std::move(cell)); parameters.push_back(std::move(ts)); + parameters.push_back(std::move(arg0)); } -DataType Th3indexCellToParentNextLogicalFunction::getDataType() const { return dataType; } +DataType Th3indexCellToParentNextLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction Th3indexCellToParentNextLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector Th3indexCellToParentNextLogicalFunction::getChildren() const { return parameters; } +std::vector Th3indexCellToParentNextLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction Th3indexCellToParentNextLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 2, - "Th3indexCellToParentNextLogicalFunction requires 2 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 3, "Th3indexCellToParentNextLogicalFunction requires 3 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view Th3indexCellToParentNextLogicalFunction::getType() const { return NAME; } +std::string_view Th3indexCellToParentNextLogicalFunction::getType() const +{ + return NAME; +} bool Th3indexCellToParentNextLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string Th3indexCellToParentNextLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction Th3indexCellToParentNextLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(2); - c.emplace_back(parameters[0].withInferredDataType(schema)); - c.emplace_back(parameters[1].withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "cell must be UINT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction Th3indexCellToParentNextLogicalFunction::serialize() const @@ -81,18 +107,22 @@ SerializableFunction Th3indexCellToParentNextLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTh3indexCellToParentNextLogicalFunction( LogicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.children.size() == 2, - "Th3indexCellToParentNextLogicalFunction requires 2 children but got {}", + PRECONDITION(arguments.children.size() == 3, + "Th3indexCellToParentNextLogicalFunction requires 3 children but got {}", arguments.children.size()); - return Th3indexCellToParentNextLogicalFunction(std::move(arguments.children[0]), - std::move(arguments.children[1])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + return Th3indexCellToParentNextLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/Th3indexGetBaseCellNumberLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/Th3indexGetBaseCellNumberLogicalFunction.cpp index 5dee128ea8..26308db9ff 100644 --- a/nes-logical-operators/src/Functions/Meos/Th3indexGetBaseCellNumberLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/Th3indexGetBaseCellNumberLogicalFunction.cpp @@ -26,7 +26,8 @@ namespace NES { -Th3indexGetBaseCellNumberLogicalFunction::Th3indexGetBaseCellNumberLogicalFunction(LogicalFunction cell, LogicalFunction ts) +Th3indexGetBaseCellNumberLogicalFunction::Th3indexGetBaseCellNumberLogicalFunction(LogicalFunction cell, + LogicalFunction ts) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(2); @@ -34,45 +35,68 @@ Th3indexGetBaseCellNumberLogicalFunction::Th3indexGetBaseCellNumberLogicalFuncti parameters.push_back(std::move(ts)); } -DataType Th3indexGetBaseCellNumberLogicalFunction::getDataType() const { return dataType; } +DataType Th3indexGetBaseCellNumberLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction Th3indexGetBaseCellNumberLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector Th3indexGetBaseCellNumberLogicalFunction::getChildren() const { return parameters; } +std::vector Th3indexGetBaseCellNumberLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction Th3indexGetBaseCellNumberLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 2, - "Th3indexGetBaseCellNumberLogicalFunction requires 2 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 2, "Th3indexGetBaseCellNumberLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view Th3indexGetBaseCellNumberLogicalFunction::getType() const { return NAME; } +std::string_view Th3indexGetBaseCellNumberLogicalFunction::getType() const +{ + return NAME; +} bool Th3indexGetBaseCellNumberLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string Th3indexGetBaseCellNumberLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction Th3indexGetBaseCellNumberLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(2); - c.emplace_back(parameters[0].withInferredDataType(schema)); - c.emplace_back(parameters[1].withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "cell must be UINT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction Th3indexGetBaseCellNumberLogicalFunction::serialize() const @@ -81,7 +105,9 @@ SerializableFunction Th3indexGetBaseCellNumberLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -91,8 +117,9 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTh3 PRECONDITION(arguments.children.size() == 2, "Th3indexGetBaseCellNumberLogicalFunction requires 2 children but got {}", arguments.children.size()); - return Th3indexGetBaseCellNumberLogicalFunction(std::move(arguments.children[0]), - std::move(arguments.children[1])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + return Th3indexGetBaseCellNumberLogicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/Th3indexGetResolutionLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/Th3indexGetResolutionLogicalFunction.cpp index 300491aee2..d139994ac2 100644 --- a/nes-logical-operators/src/Functions/Meos/Th3indexGetResolutionLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/Th3indexGetResolutionLogicalFunction.cpp @@ -26,7 +26,8 @@ namespace NES { -Th3indexGetResolutionLogicalFunction::Th3indexGetResolutionLogicalFunction(LogicalFunction cell, LogicalFunction ts) +Th3indexGetResolutionLogicalFunction::Th3indexGetResolutionLogicalFunction(LogicalFunction cell, + LogicalFunction ts) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(2); @@ -34,45 +35,68 @@ Th3indexGetResolutionLogicalFunction::Th3indexGetResolutionLogicalFunction(Logic parameters.push_back(std::move(ts)); } -DataType Th3indexGetResolutionLogicalFunction::getDataType() const { return dataType; } +DataType Th3indexGetResolutionLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction Th3indexGetResolutionLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector Th3indexGetResolutionLogicalFunction::getChildren() const { return parameters; } +std::vector Th3indexGetResolutionLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction Th3indexGetResolutionLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 2, - "Th3indexGetResolutionLogicalFunction requires 2 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 2, "Th3indexGetResolutionLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view Th3indexGetResolutionLogicalFunction::getType() const { return NAME; } +std::string_view Th3indexGetResolutionLogicalFunction::getType() const +{ + return NAME; +} bool Th3indexGetResolutionLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string Th3indexGetResolutionLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction Th3indexGetResolutionLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(2); - c.emplace_back(parameters[0].withInferredDataType(schema)); - c.emplace_back(parameters[1].withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "cell must be UINT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction Th3indexGetResolutionLogicalFunction::serialize() const @@ -81,7 +105,9 @@ SerializableFunction Th3indexGetResolutionLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -91,8 +117,9 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTh3 PRECONDITION(arguments.children.size() == 2, "Th3indexGetResolutionLogicalFunction requires 2 children but got {}", arguments.children.size()); - return Th3indexGetResolutionLogicalFunction(std::move(arguments.children[0]), - std::move(arguments.children[1])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + return Th3indexGetResolutionLogicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/Th3indexGridDistanceLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/Th3indexGridDistanceLogicalFunction.cpp index fbe6ca4117..9202619018 100644 --- a/nes-logical-operators/src/Functions/Meos/Th3indexGridDistanceLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/Th3indexGridDistanceLogicalFunction.cpp @@ -26,60 +26,81 @@ namespace NES { -Th3indexGridDistanceLogicalFunction::Th3indexGridDistanceLogicalFunction(LogicalFunction cell1, LogicalFunction ts1, - LogicalFunction cell2, LogicalFunction ts2) +Th3indexGridDistanceLogicalFunction::Th3indexGridDistanceLogicalFunction(LogicalFunction cell, + LogicalFunction ts, + LogicalFunction cell0, + LogicalFunction ts0) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(4); - parameters.push_back(std::move(cell1)); - parameters.push_back(std::move(ts1)); - parameters.push_back(std::move(cell2)); - parameters.push_back(std::move(ts2)); + parameters.push_back(std::move(cell)); + parameters.push_back(std::move(ts)); + parameters.push_back(std::move(cell0)); + parameters.push_back(std::move(ts0)); } -DataType Th3indexGridDistanceLogicalFunction::getDataType() const { return dataType; } +DataType Th3indexGridDistanceLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction Th3indexGridDistanceLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector Th3indexGridDistanceLogicalFunction::getChildren() const { return parameters; } +std::vector Th3indexGridDistanceLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction Th3indexGridDistanceLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 4, - "Th3indexGridDistanceLogicalFunction requires 4 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 4, "Th3indexGridDistanceLogicalFunction requires 4 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view Th3indexGridDistanceLogicalFunction::getType() const { return NAME; } +std::string_view Th3indexGridDistanceLogicalFunction::getType() const +{ + return NAME; +} bool Th3indexGridDistanceLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string Th3indexGridDistanceLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction Th3indexGridDistanceLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(4); - c.emplace_back(parameters[0].withInferredDataType(schema)); - c.emplace_back(parameters[1].withInferredDataType(schema)); - c.emplace_back(parameters[2].withInferredDataType(schema)); - c.emplace_back(parameters[3].withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "cell1 must be UINT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "ts1 must be UINT64"); - INVARIANT(c[2].getDataType().isType(DataType::Type::UINT64), "cell2 must be UINT64"); - INVARIANT(c[3].getDataType().isType(DataType::Type::UINT64), "ts2 must be UINT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction Th3indexGridDistanceLogicalFunction::serialize() const @@ -88,7 +109,9 @@ SerializableFunction Th3indexGridDistanceLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -98,10 +121,11 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTh3 PRECONDITION(arguments.children.size() == 4, "Th3indexGridDistanceLogicalFunction requires 4 children but got {}", arguments.children.size()); - return Th3indexGridDistanceLogicalFunction(std::move(arguments.children[0]), - std::move(arguments.children[1]), - std::move(arguments.children[2]), - std::move(arguments.children[3])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + auto arg2 = std::move(arguments.children[2]); + auto arg3 = std::move(arguments.children[3]); + return Th3indexGridDistanceLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/Th3indexIsPentagonLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/Th3indexIsPentagonLogicalFunction.cpp index ad627972b4..781247a971 100644 --- a/nes-logical-operators/src/Functions/Meos/Th3indexIsPentagonLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/Th3indexIsPentagonLogicalFunction.cpp @@ -26,7 +26,8 @@ namespace NES { -Th3indexIsPentagonLogicalFunction::Th3indexIsPentagonLogicalFunction(LogicalFunction cell, LogicalFunction ts) +Th3indexIsPentagonLogicalFunction::Th3indexIsPentagonLogicalFunction(LogicalFunction cell, + LogicalFunction ts) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(2); @@ -34,45 +35,68 @@ Th3indexIsPentagonLogicalFunction::Th3indexIsPentagonLogicalFunction(LogicalFunc parameters.push_back(std::move(ts)); } -DataType Th3indexIsPentagonLogicalFunction::getDataType() const { return dataType; } +DataType Th3indexIsPentagonLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction Th3indexIsPentagonLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector Th3indexIsPentagonLogicalFunction::getChildren() const { return parameters; } +std::vector Th3indexIsPentagonLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction Th3indexIsPentagonLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 2, - "Th3indexIsPentagonLogicalFunction requires 2 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 2, "Th3indexIsPentagonLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view Th3indexIsPentagonLogicalFunction::getType() const { return NAME; } +std::string_view Th3indexIsPentagonLogicalFunction::getType() const +{ + return NAME; +} bool Th3indexIsPentagonLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string Th3indexIsPentagonLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction Th3indexIsPentagonLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(2); - c.emplace_back(parameters[0].withInferredDataType(schema)); - c.emplace_back(parameters[1].withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "cell must be UINT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction Th3indexIsPentagonLogicalFunction::serialize() const @@ -81,7 +105,9 @@ SerializableFunction Th3indexIsPentagonLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -91,8 +117,9 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTh3 PRECONDITION(arguments.children.size() == 2, "Th3indexIsPentagonLogicalFunction requires 2 children but got {}", arguments.children.size()); - return Th3indexIsPentagonLogicalFunction(std::move(arguments.children[0]), - std::move(arguments.children[1])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + return Th3indexIsPentagonLogicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/Th3indexIsValidCellLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/Th3indexIsValidCellLogicalFunction.cpp index 9dc00f3032..84362727fd 100644 --- a/nes-logical-operators/src/Functions/Meos/Th3indexIsValidCellLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/Th3indexIsValidCellLogicalFunction.cpp @@ -26,7 +26,8 @@ namespace NES { -Th3indexIsValidCellLogicalFunction::Th3indexIsValidCellLogicalFunction(LogicalFunction cell, LogicalFunction ts) +Th3indexIsValidCellLogicalFunction::Th3indexIsValidCellLogicalFunction(LogicalFunction cell, + LogicalFunction ts) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(2); @@ -34,45 +35,68 @@ Th3indexIsValidCellLogicalFunction::Th3indexIsValidCellLogicalFunction(LogicalFu parameters.push_back(std::move(ts)); } -DataType Th3indexIsValidCellLogicalFunction::getDataType() const { return dataType; } +DataType Th3indexIsValidCellLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction Th3indexIsValidCellLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector Th3indexIsValidCellLogicalFunction::getChildren() const { return parameters; } +std::vector Th3indexIsValidCellLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction Th3indexIsValidCellLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 2, - "Th3indexIsValidCellLogicalFunction requires 2 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 2, "Th3indexIsValidCellLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view Th3indexIsValidCellLogicalFunction::getType() const { return NAME; } +std::string_view Th3indexIsValidCellLogicalFunction::getType() const +{ + return NAME; +} bool Th3indexIsValidCellLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string Th3indexIsValidCellLogicalFunction::explain(ExplainVerbosity verbosity) const { - return fmt::format("{}({})", NAME, parameters[0].explain(verbosity)); + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } + args += parameters[index].explain(verbosity); + } + return fmt::format("{}({})", NAME, args); } LogicalFunction Th3indexIsValidCellLogicalFunction::withInferredDataType(const Schema& schema) const { - std::vector c; - c.reserve(2); - c.emplace_back(parameters[0].withInferredDataType(schema)); - c.emplace_back(parameters[1].withInferredDataType(schema)); - INVARIANT(c[0].getDataType().isType(DataType::Type::UINT64), "cell must be UINT64"); - INVARIANT(c[1].getDataType().isType(DataType::Type::UINT64), "ts must be UINT64"); - return withChildren(c); + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + { + newChildren.emplace_back(child.withInferredDataType(schema)); + } + return withChildren(newChildren); } SerializableFunction Th3indexIsValidCellLogicalFunction::serialize() const @@ -81,7 +105,9 @@ SerializableFunction Th3indexIsValidCellLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } @@ -91,8 +117,9 @@ LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTh3 PRECONDITION(arguments.children.size() == 2, "Th3indexIsValidCellLogicalFunction requires 2 children but got {}", arguments.children.size()); - return Th3indexIsValidCellLogicalFunction(std::move(arguments.children[0]), - std::move(arguments.children[1])); + auto arg0 = std::move(arguments.children[0]); + auto arg1 = std::move(arguments.children[1]); + return Th3indexIsValidCellLogicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TintScaleValueLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TintScaleValueLogicalFunction.cpp index d51aadcdef..6ab5688ae7 100644 --- a/nes-logical-operators/src/Functions/Meos/TintScaleValueLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/TintScaleValueLogicalFunction.cpp @@ -27,45 +27,64 @@ namespace NES { TintScaleValueLogicalFunction::TintScaleValueLogicalFunction(LogicalFunction value, - LogicalFunction ts, - LogicalFunction width) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) + LogicalFunction ts, + LogicalFunction arg0) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) { parameters.reserve(3); parameters.push_back(std::move(value)); parameters.push_back(std::move(ts)); - parameters.push_back(std::move(width)); + parameters.push_back(std::move(arg0)); } -DataType TintScaleValueLogicalFunction::getDataType() const { return dataType; } +DataType TintScaleValueLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction TintScaleValueLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector TintScaleValueLogicalFunction::getChildren() const { return parameters; } +std::vector TintScaleValueLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction TintScaleValueLogicalFunction::withChildren(const std::vector& children) const { PRECONDITION(children.size() == 3, "TintScaleValueLogicalFunction requires 3 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view TintScaleValueLogicalFunction::getType() const { return NAME; } +std::string_view TintScaleValueLogicalFunction::getType() const +{ + return NAME; +} bool TintScaleValueLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string TintScaleValueLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -76,7 +95,9 @@ LogicalFunction TintScaleValueLogicalFunction::withInferredDataType(const Schema std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -86,7 +107,9 @@ SerializableFunction TintScaleValueLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } diff --git a/nes-logical-operators/src/Functions/Meos/TintShiftScaleValueLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TintShiftScaleValueLogicalFunction.cpp index b4096559fb..ded8a34f32 100644 --- a/nes-logical-operators/src/Functions/Meos/TintShiftScaleValueLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/TintShiftScaleValueLogicalFunction.cpp @@ -27,47 +27,66 @@ namespace NES { TintShiftScaleValueLogicalFunction::TintShiftScaleValueLogicalFunction(LogicalFunction value, - LogicalFunction ts, - LogicalFunction shift, - LogicalFunction width) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) + LogicalFunction ts, + LogicalFunction arg0, + LogicalFunction arg1) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) { parameters.reserve(4); parameters.push_back(std::move(value)); parameters.push_back(std::move(ts)); - parameters.push_back(std::move(shift)); - parameters.push_back(std::move(width)); + parameters.push_back(std::move(arg0)); + parameters.push_back(std::move(arg1)); } -DataType TintShiftScaleValueLogicalFunction::getDataType() const { return dataType; } +DataType TintShiftScaleValueLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction TintShiftScaleValueLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector TintShiftScaleValueLogicalFunction::getChildren() const { return parameters; } +std::vector TintShiftScaleValueLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction TintShiftScaleValueLogicalFunction::withChildren(const std::vector& children) const { PRECONDITION(children.size() == 4, "TintShiftScaleValueLogicalFunction requires 4 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view TintShiftScaleValueLogicalFunction::getType() const { return NAME; } +std::string_view TintShiftScaleValueLogicalFunction::getType() const +{ + return NAME; +} bool TintShiftScaleValueLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string TintShiftScaleValueLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -78,7 +97,9 @@ LogicalFunction TintShiftScaleValueLogicalFunction::withInferredDataType(const S std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -88,7 +109,9 @@ SerializableFunction TintShiftScaleValueLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } diff --git a/nes-logical-operators/src/Functions/Meos/TintShiftValueLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TintShiftValueLogicalFunction.cpp index c540e6ea81..8b6aff56ab 100644 --- a/nes-logical-operators/src/Functions/Meos/TintShiftValueLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/TintShiftValueLogicalFunction.cpp @@ -27,45 +27,64 @@ namespace NES { TintShiftValueLogicalFunction::TintShiftValueLogicalFunction(LogicalFunction value, - LogicalFunction ts, - LogicalFunction shift) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) + LogicalFunction ts, + LogicalFunction arg0) + : dataType(DataTypeProvider::provideDataType(DataType::Type::INT32)) { parameters.reserve(3); parameters.push_back(std::move(value)); parameters.push_back(std::move(ts)); - parameters.push_back(std::move(shift)); + parameters.push_back(std::move(arg0)); } -DataType TintShiftValueLogicalFunction::getDataType() const { return dataType; } +DataType TintShiftValueLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction TintShiftValueLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector TintShiftValueLogicalFunction::getChildren() const { return parameters; } +std::vector TintShiftValueLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction TintShiftValueLogicalFunction::withChildren(const std::vector& children) const { PRECONDITION(children.size() == 3, "TintShiftValueLogicalFunction requires 3 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view TintShiftValueLogicalFunction::getType() const { return NAME; } +std::string_view TintShiftValueLogicalFunction::getType() const +{ + return NAME; +} bool TintShiftValueLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string TintShiftValueLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -76,7 +95,9 @@ LogicalFunction TintShiftValueLogicalFunction::withInferredDataType(const Schema std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -86,7 +107,9 @@ SerializableFunction TintShiftValueLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } diff --git a/nes-logical-operators/src/Functions/Meos/TintToTbigintLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TintToTbigintLogicalFunction.cpp index 681eb6857d..65349fe1ed 100644 --- a/nes-logical-operators/src/Functions/Meos/TintToTbigintLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/TintToTbigintLogicalFunction.cpp @@ -27,7 +27,7 @@ namespace NES { TintToTbigintLogicalFunction::TintToTbigintLogicalFunction(LogicalFunction value, - LogicalFunction ts) + LogicalFunction ts) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(2); @@ -35,35 +35,54 @@ TintToTbigintLogicalFunction::TintToTbigintLogicalFunction(LogicalFunction value parameters.push_back(std::move(ts)); } -DataType TintToTbigintLogicalFunction::getDataType() const { return dataType; } +DataType TintToTbigintLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction TintToTbigintLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector TintToTbigintLogicalFunction::getChildren() const { return parameters; } +std::vector TintToTbigintLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction TintToTbigintLogicalFunction::withChildren(const std::vector& children) const { PRECONDITION(children.size() == 2, "TintToTbigintLogicalFunction requires 2 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view TintToTbigintLogicalFunction::getType() const { return NAME; } +std::string_view TintToTbigintLogicalFunction::getType() const +{ + return NAME; +} bool TintToTbigintLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string TintToTbigintLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -74,7 +93,9 @@ LogicalFunction TintToTbigintLogicalFunction::withInferredDataType(const Schema& std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -84,7 +105,9 @@ SerializableFunction TintToTbigintLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } diff --git a/nes-logical-operators/src/Functions/Meos/TintToTfloatLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TintToTfloatLogicalFunction.cpp index 08c9e80ad4..9f6957af15 100644 --- a/nes-logical-operators/src/Functions/Meos/TintToTfloatLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/TintToTfloatLogicalFunction.cpp @@ -27,7 +27,7 @@ namespace NES { TintToTfloatLogicalFunction::TintToTfloatLogicalFunction(LogicalFunction value, - LogicalFunction ts) + LogicalFunction ts) : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) { parameters.reserve(2); @@ -35,35 +35,54 @@ TintToTfloatLogicalFunction::TintToTfloatLogicalFunction(LogicalFunction value, parameters.push_back(std::move(ts)); } -DataType TintToTfloatLogicalFunction::getDataType() const { return dataType; } +DataType TintToTfloatLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction TintToTfloatLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector TintToTfloatLogicalFunction::getChildren() const { return parameters; } +std::vector TintToTfloatLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction TintToTfloatLogicalFunction::withChildren(const std::vector& children) const { PRECONDITION(children.size() == 2, "TintToTfloatLogicalFunction requires 2 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view TintToTfloatLogicalFunction::getType() const { return NAME; } +std::string_view TintToTfloatLogicalFunction::getType() const +{ + return NAME; +} bool TintToTfloatLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string TintToTfloatLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -74,7 +93,9 @@ LogicalFunction TintToTfloatLogicalFunction::withInferredDataType(const Schema& std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -84,7 +105,9 @@ SerializableFunction TintToTfloatLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } diff --git a/nes-logical-operators/src/Functions/Meos/TneBoolTboolLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TneBoolTboolLogicalFunction.cpp index c70f8b5ad8..6bce0fdc49 100644 --- a/nes-logical-operators/src/Functions/Meos/TneBoolTboolLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/TneBoolTboolLogicalFunction.cpp @@ -26,46 +26,65 @@ namespace NES { -TneBoolTboolLogicalFunction::TneBoolTboolLogicalFunction(LogicalFunction value, - LogicalFunction threshold, - LogicalFunction ts) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +TneBoolTboolLogicalFunction::TneBoolTboolLogicalFunction(LogicalFunction arg0, + LogicalFunction value, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::BOOLEAN)) { parameters.reserve(3); + parameters.push_back(std::move(arg0)); parameters.push_back(std::move(value)); - parameters.push_back(std::move(threshold)); parameters.push_back(std::move(ts)); } -DataType TneBoolTboolLogicalFunction::getDataType() const { return dataType; } +DataType TneBoolTboolLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction TneBoolTboolLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector TneBoolTboolLogicalFunction::getChildren() const { return parameters; } +std::vector TneBoolTboolLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction TneBoolTboolLogicalFunction::withChildren(const std::vector& children) const { PRECONDITION(children.size() == 3, "TneBoolTboolLogicalFunction requires 3 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view TneBoolTboolLogicalFunction::getType() const { return NAME; } +std::string_view TneBoolTboolLogicalFunction::getType() const +{ + return NAME; +} bool TneBoolTboolLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string TneBoolTboolLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -76,7 +95,9 @@ LogicalFunction TneBoolTboolLogicalFunction::withInferredDataType(const Schema& std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -86,7 +107,9 @@ SerializableFunction TneBoolTboolLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } diff --git a/nes-logical-operators/src/Functions/Meos/TneTboolBoolLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TneTboolBoolLogicalFunction.cpp index 4e6d17868d..8c15a123ff 100644 --- a/nes-logical-operators/src/Functions/Meos/TneTboolBoolLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/TneTboolBoolLogicalFunction.cpp @@ -27,45 +27,64 @@ namespace NES { TneTboolBoolLogicalFunction::TneTboolBoolLogicalFunction(LogicalFunction value, - LogicalFunction threshold, - LogicalFunction ts) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) + LogicalFunction ts, + LogicalFunction arg0) + : dataType(DataTypeProvider::provideDataType(DataType::Type::BOOLEAN)) { parameters.reserve(3); parameters.push_back(std::move(value)); - parameters.push_back(std::move(threshold)); parameters.push_back(std::move(ts)); + parameters.push_back(std::move(arg0)); } -DataType TneTboolBoolLogicalFunction::getDataType() const { return dataType; } +DataType TneTboolBoolLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction TneTboolBoolLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector TneTboolBoolLogicalFunction::getChildren() const { return parameters; } +std::vector TneTboolBoolLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction TneTboolBoolLogicalFunction::withChildren(const std::vector& children) const { PRECONDITION(children.size() == 3, "TneTboolBoolLogicalFunction requires 3 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view TneTboolBoolLogicalFunction::getType() const { return NAME; } +std::string_view TneTboolBoolLogicalFunction::getType() const +{ + return NAME; +} bool TneTboolBoolLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string TneTboolBoolLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -76,7 +95,9 @@ LogicalFunction TneTboolBoolLogicalFunction::withInferredDataType(const Schema& std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -86,7 +107,9 @@ SerializableFunction TneTboolBoolLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } diff --git a/nes-logical-operators/src/Functions/Meos/TnotTboolLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TnotTboolLogicalFunction.cpp index 91f7eb92e1..573495990b 100644 --- a/nes-logical-operators/src/Functions/Meos/TnotTboolLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/TnotTboolLogicalFunction.cpp @@ -28,42 +28,61 @@ namespace NES TnotTboolLogicalFunction::TnotTboolLogicalFunction(LogicalFunction value, LogicalFunction ts) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) + : dataType(DataTypeProvider::provideDataType(DataType::Type::BOOLEAN)) { parameters.reserve(2); parameters.push_back(std::move(value)); parameters.push_back(std::move(ts)); } -DataType TnotTboolLogicalFunction::getDataType() const { return dataType; } +DataType TnotTboolLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction TnotTboolLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector TnotTboolLogicalFunction::getChildren() const { return parameters; } +std::vector TnotTboolLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction TnotTboolLogicalFunction::withChildren(const std::vector& children) const { PRECONDITION(children.size() == 2, "TnotTboolLogicalFunction requires 2 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view TnotTboolLogicalFunction::getType() const { return NAME; } +std::string_view TnotTboolLogicalFunction::getType() const +{ + return NAME; +} bool TnotTboolLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string TnotTboolLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -74,7 +93,9 @@ LogicalFunction TnotTboolLogicalFunction::withInferredDataType(const Schema& sch std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -84,7 +105,9 @@ SerializableFunction TnotTboolLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } diff --git a/nes-logical-operators/src/Functions/Meos/TorBoolTboolLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TorBoolTboolLogicalFunction.cpp index 33d0326e8f..124017ec3a 100644 --- a/nes-logical-operators/src/Functions/Meos/TorBoolTboolLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/TorBoolTboolLogicalFunction.cpp @@ -26,46 +26,65 @@ namespace NES { -TorBoolTboolLogicalFunction::TorBoolTboolLogicalFunction(LogicalFunction value, - LogicalFunction threshold, - LogicalFunction ts) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +TorBoolTboolLogicalFunction::TorBoolTboolLogicalFunction(LogicalFunction arg0, + LogicalFunction value, + LogicalFunction ts) + : dataType(DataTypeProvider::provideDataType(DataType::Type::BOOLEAN)) { parameters.reserve(3); + parameters.push_back(std::move(arg0)); parameters.push_back(std::move(value)); - parameters.push_back(std::move(threshold)); parameters.push_back(std::move(ts)); } -DataType TorBoolTboolLogicalFunction::getDataType() const { return dataType; } +DataType TorBoolTboolLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction TorBoolTboolLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector TorBoolTboolLogicalFunction::getChildren() const { return parameters; } +std::vector TorBoolTboolLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction TorBoolTboolLogicalFunction::withChildren(const std::vector& children) const { PRECONDITION(children.size() == 3, "TorBoolTboolLogicalFunction requires 3 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view TorBoolTboolLogicalFunction::getType() const { return NAME; } +std::string_view TorBoolTboolLogicalFunction::getType() const +{ + return NAME; +} bool TorBoolTboolLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string TorBoolTboolLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -76,7 +95,9 @@ LogicalFunction TorBoolTboolLogicalFunction::withInferredDataType(const Schema& std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -86,7 +107,9 @@ SerializableFunction TorBoolTboolLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } diff --git a/nes-logical-operators/src/Functions/Meos/TorTboolBoolLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TorTboolBoolLogicalFunction.cpp index f185e26c88..063f0775a9 100644 --- a/nes-logical-operators/src/Functions/Meos/TorTboolBoolLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/TorTboolBoolLogicalFunction.cpp @@ -27,45 +27,64 @@ namespace NES { TorTboolBoolLogicalFunction::TorTboolBoolLogicalFunction(LogicalFunction value, - LogicalFunction threshold, - LogicalFunction ts) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) + LogicalFunction ts, + LogicalFunction arg0) + : dataType(DataTypeProvider::provideDataType(DataType::Type::BOOLEAN)) { parameters.reserve(3); parameters.push_back(std::move(value)); - parameters.push_back(std::move(threshold)); parameters.push_back(std::move(ts)); + parameters.push_back(std::move(arg0)); } -DataType TorTboolBoolLogicalFunction::getDataType() const { return dataType; } +DataType TorTboolBoolLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction TorTboolBoolLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector TorTboolBoolLogicalFunction::getChildren() const { return parameters; } +std::vector TorTboolBoolLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction TorTboolBoolLogicalFunction::withChildren(const std::vector& children) const { PRECONDITION(children.size() == 3, "TorTboolBoolLogicalFunction requires 3 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view TorTboolBoolLogicalFunction::getType() const { return NAME; } +std::string_view TorTboolBoolLogicalFunction::getType() const +{ + return NAME; +} bool TorTboolBoolLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string TorTboolBoolLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -76,7 +95,9 @@ LogicalFunction TorTboolBoolLogicalFunction::withInferredDataType(const Schema& std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -86,7 +107,9 @@ SerializableFunction TorTboolBoolLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } diff --git a/nes-logical-operators/src/Functions/Meos/TorTboolTboolLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TorTboolTboolLogicalFunction.cpp index 32f064daed..3cc34b35bd 100644 --- a/nes-logical-operators/src/Functions/Meos/TorTboolTboolLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/TorTboolTboolLogicalFunction.cpp @@ -26,46 +26,63 @@ namespace NES { -TorTboolTboolLogicalFunction::TorTboolTboolLogicalFunction(LogicalFunction value, - LogicalFunction threshold, - LogicalFunction ts) - : dataType(DataTypeProvider::provideDataType(DataType::Type::FLOAT64)) +TorTboolTboolLogicalFunction::TorTboolTboolLogicalFunction(LogicalFunction traj, + LogicalFunction arg0) + : dataType(DataTypeProvider::provideDataType(DataType::Type::VARSIZED)) { - parameters.reserve(3); - parameters.push_back(std::move(value)); - parameters.push_back(std::move(threshold)); - parameters.push_back(std::move(ts)); + parameters.reserve(2); + parameters.push_back(std::move(traj)); + parameters.push_back(std::move(arg0)); } -DataType TorTboolTboolLogicalFunction::getDataType() const { return dataType; } +DataType TorTboolTboolLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction TorTboolTboolLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector TorTboolTboolLogicalFunction::getChildren() const { return parameters; } +std::vector TorTboolTboolLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction TorTboolTboolLogicalFunction::withChildren(const std::vector& children) const { - PRECONDITION(children.size() == 3, "TorTboolTboolLogicalFunction requires 3 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + PRECONDITION(children.size() == 2, "TorTboolTboolLogicalFunction requires 2 children, but got {}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view TorTboolTboolLogicalFunction::getType() const { return NAME; } +std::string_view TorTboolTboolLogicalFunction::getType() const +{ + return NAME; +} bool TorTboolTboolLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string TorTboolTboolLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -76,7 +93,9 @@ LogicalFunction TorTboolTboolLogicalFunction::withInferredDataType(const Schema& std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -86,20 +105,21 @@ SerializableFunction TorTboolTboolLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::RegisterTorTboolTboolLogicalFunction( LogicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.children.size() == 3, - "TorTboolTboolLogicalFunction requires 3 children but got {}", + PRECONDITION(arguments.children.size() == 2, + "TorTboolTboolLogicalFunction requires 2 children but got {}", arguments.children.size()); auto arg0 = std::move(arguments.children[0]); auto arg1 = std::move(arguments.children[1]); - auto arg2 = std::move(arguments.children[2]); - return TorTboolTboolLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); + return TorTboolTboolLogicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-logical-operators/src/Functions/Meos/TtextInitcapLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TtextInitcapLogicalFunction.cpp index 9e3fc38f7c..b4115bca7e 100644 --- a/nes-logical-operators/src/Functions/Meos/TtextInitcapLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/TtextInitcapLogicalFunction.cpp @@ -27,7 +27,7 @@ namespace NES { TtextInitcapLogicalFunction::TtextInitcapLogicalFunction(LogicalFunction value, - LogicalFunction ts) + LogicalFunction ts) : dataType(DataTypeProvider::provideDataType(DataType::Type::VARSIZED)) { parameters.reserve(2); @@ -35,35 +35,54 @@ TtextInitcapLogicalFunction::TtextInitcapLogicalFunction(LogicalFunction value, parameters.push_back(std::move(ts)); } -DataType TtextInitcapLogicalFunction::getDataType() const { return dataType; } +DataType TtextInitcapLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction TtextInitcapLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector TtextInitcapLogicalFunction::getChildren() const { return parameters; } +std::vector TtextInitcapLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction TtextInitcapLogicalFunction::withChildren(const std::vector& children) const { PRECONDITION(children.size() == 2, "TtextInitcapLogicalFunction requires 2 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view TtextInitcapLogicalFunction::getType() const { return NAME; } +std::string_view TtextInitcapLogicalFunction::getType() const +{ + return NAME; +} bool TtextInitcapLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string TtextInitcapLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -74,7 +93,9 @@ LogicalFunction TtextInitcapLogicalFunction::withInferredDataType(const Schema& std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -84,7 +105,9 @@ SerializableFunction TtextInitcapLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } diff --git a/nes-logical-operators/src/Functions/Meos/TtextLowerLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TtextLowerLogicalFunction.cpp index f171eb7600..b41d7a5109 100644 --- a/nes-logical-operators/src/Functions/Meos/TtextLowerLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/TtextLowerLogicalFunction.cpp @@ -27,7 +27,7 @@ namespace NES { TtextLowerLogicalFunction::TtextLowerLogicalFunction(LogicalFunction value, - LogicalFunction ts) + LogicalFunction ts) : dataType(DataTypeProvider::provideDataType(DataType::Type::VARSIZED)) { parameters.reserve(2); @@ -35,35 +35,54 @@ TtextLowerLogicalFunction::TtextLowerLogicalFunction(LogicalFunction value, parameters.push_back(std::move(ts)); } -DataType TtextLowerLogicalFunction::getDataType() const { return dataType; } +DataType TtextLowerLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction TtextLowerLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector TtextLowerLogicalFunction::getChildren() const { return parameters; } +std::vector TtextLowerLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction TtextLowerLogicalFunction::withChildren(const std::vector& children) const { PRECONDITION(children.size() == 2, "TtextLowerLogicalFunction requires 2 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view TtextLowerLogicalFunction::getType() const { return NAME; } +std::string_view TtextLowerLogicalFunction::getType() const +{ + return NAME; +} bool TtextLowerLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string TtextLowerLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -74,7 +93,9 @@ LogicalFunction TtextLowerLogicalFunction::withInferredDataType(const Schema& sc std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -84,7 +105,9 @@ SerializableFunction TtextLowerLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } diff --git a/nes-logical-operators/src/Functions/Meos/TtextUpperLogicalFunction.cpp b/nes-logical-operators/src/Functions/Meos/TtextUpperLogicalFunction.cpp index 8e68f39a99..15d18d7f27 100644 --- a/nes-logical-operators/src/Functions/Meos/TtextUpperLogicalFunction.cpp +++ b/nes-logical-operators/src/Functions/Meos/TtextUpperLogicalFunction.cpp @@ -27,7 +27,7 @@ namespace NES { TtextUpperLogicalFunction::TtextUpperLogicalFunction(LogicalFunction value, - LogicalFunction ts) + LogicalFunction ts) : dataType(DataTypeProvider::provideDataType(DataType::Type::VARSIZED)) { parameters.reserve(2); @@ -35,35 +35,54 @@ TtextUpperLogicalFunction::TtextUpperLogicalFunction(LogicalFunction value, parameters.push_back(std::move(ts)); } -DataType TtextUpperLogicalFunction::getDataType() const { return dataType; } +DataType TtextUpperLogicalFunction::getDataType() const +{ + return dataType; +} LogicalFunction TtextUpperLogicalFunction::withDataType(const DataType& newDataType) const { - auto copy = *this; copy.dataType = newDataType; return copy; + auto copy = *this; + copy.dataType = newDataType; + return copy; } -std::vector TtextUpperLogicalFunction::getChildren() const { return parameters; } +std::vector TtextUpperLogicalFunction::getChildren() const +{ + return parameters; +} LogicalFunction TtextUpperLogicalFunction::withChildren(const std::vector& children) const { PRECONDITION(children.size() == 2, "TtextUpperLogicalFunction requires 2 children, but got {}", children.size()); - auto copy = *this; copy.parameters = children; return copy; + auto copy = *this; + copy.parameters = children; + return copy; } -std::string_view TtextUpperLogicalFunction::getType() const { return NAME; } +std::string_view TtextUpperLogicalFunction::getType() const +{ + return NAME; +} bool TtextUpperLogicalFunction::operator==(const LogicalFunctionConcept& rhs) const { if (const auto* other = dynamic_cast(&rhs)) + { return parameters == other->parameters; + } return false; } std::string TtextUpperLogicalFunction::explain(ExplainVerbosity verbosity) const { std::string args; - for (size_t index = 0; index < parameters.size(); ++index) { - if (index > 0) args += ", "; + for (size_t index = 0; index < parameters.size(); ++index) + { + if (index > 0) + { + args += ", "; + } args += parameters[index].explain(verbosity); } return fmt::format("{}({})", NAME, args); @@ -74,7 +93,9 @@ LogicalFunction TtextUpperLogicalFunction::withInferredDataType(const Schema& sc std::vector newChildren; newChildren.reserve(parameters.size()); for (const auto& child : parameters) + { newChildren.emplace_back(child.withInferredDataType(schema)); + } return withChildren(newChildren); } @@ -84,7 +105,9 @@ SerializableFunction TtextUpperLogicalFunction::serialize() const proto.set_function_type(std::string(NAME)); DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); for (const auto& child : parameters) + { proto.add_children()->CopyFrom(child.serialize()); + } return proto; } diff --git a/nes-physical-operators/include/Functions/Meos/AcontainsGeoTrgeometryPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AcontainsGeoTrgeometryPhysicalFunction.hpp new file mode 100644 index 0000000000..64b993a907 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AcontainsGeoTrgeometryPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class AcontainsGeoTrgeometryPhysicalFunction : public PhysicalFunctionConcept { +public: + AcontainsGeoTrgeometryPhysicalFunction(PhysicalFunction tgt_wkt, PhysicalFunction ref_wkt, PhysicalFunction x1, PhysicalFunction y1, PhysicalFunction theta1, PhysicalFunction ts1); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AcontainsTcbufferGeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AcontainsTcbufferGeoPhysicalFunction.hpp index 5f13a86276..108bbf6d56 100644 --- a/nes-physical-operators/include/Functions/Meos/AcontainsTcbufferGeoPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/AcontainsTcbufferGeoPhysicalFunction.hpp @@ -21,16 +21,25 @@ namespace NES { +/** + * @brief Physical operator for `acontains_tcbuffer_geo`. + * + * Per-event acontains_tcbuffer_geo spatial predicate. + * + * Generated by tools/codegen/codegen_nebula.py. + */ class AcontainsTcbufferGeoPhysicalFunction : public PhysicalFunctionConcept { public: - AcontainsTcbufferGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, - PhysicalFunction radius, PhysicalFunction ts, - PhysicalFunction wkt); + AcontainsTcbufferGeoPhysicalFunction(PhysicalFunction lonFunction, + PhysicalFunction latFunction, + PhysicalFunction radiusFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AcontainsTcbufferTcbufferPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AcontainsTcbufferTcbufferPhysicalFunction.hpp new file mode 100644 index 0000000000..714edab137 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AcontainsTcbufferTcbufferPhysicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `acontains_tcbuffer_tcbuffer`. + * + * Per-event acontains_tcbuffer_tcbuffer spatial predicate. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class AcontainsTcbufferTcbufferPhysicalFunction : public PhysicalFunctionConcept { +public: + AcontainsTcbufferTcbufferPhysicalFunction(PhysicalFunction lonAFunction, + PhysicalFunction latAFunction, + PhysicalFunction radiusAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction lonBFunction, + PhysicalFunction latBFunction, + PhysicalFunction radiusBFunction, + PhysicalFunction tsBFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AcontainsTgeoGeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AcontainsTgeoGeoPhysicalFunction.hpp index 37739af8b7..dcc9490423 100644 --- a/nes-physical-operators/include/Functions/Meos/AcontainsTgeoGeoPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/AcontainsTgeoGeoPhysicalFunction.hpp @@ -21,15 +21,24 @@ namespace NES { +/** + * @brief Physical operator for `acontains_tgeo_geo`. + * + * Per-event acontains_tgeo_geo spatial predicate. + * + * Generated by tools/codegen/codegen_nebula.py. + */ class AcontainsTgeoGeoPhysicalFunction : public PhysicalFunctionConcept { public: - AcontainsTgeoGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, - PhysicalFunction ts, PhysicalFunction wkt); + AcontainsTgeoGeoPhysicalFunction(PhysicalFunction lonFunction, + PhysicalFunction latFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AcontainsTgeoTgeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AcontainsTgeoTgeoPhysicalFunction.hpp index 5c3bf5237f..a39e00ffbc 100644 --- a/nes-physical-operators/include/Functions/Meos/AcontainsTgeoTgeoPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/AcontainsTgeoTgeoPhysicalFunction.hpp @@ -21,12 +21,26 @@ namespace NES { +/** + * @brief Physical operator for `acontains_tgeo_tgeo`. + * + * Per-event acontains_tgeo_tgeo spatial predicate. + * + * Generated by tools/codegen/codegen_nebula.py. + */ class AcontainsTgeoTgeoPhysicalFunction : public PhysicalFunctionConcept { public: - AcontainsTgeoTgeoPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction ts1, PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction ts2); + AcontainsTgeoTgeoPhysicalFunction(PhysicalFunction lonAFunction, + PhysicalFunction latAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction lonBFunction, + PhysicalFunction latBFunction, + PhysicalFunction tsBFunction); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AcoversGeoTrgeometryPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AcoversGeoTrgeometryPhysicalFunction.hpp new file mode 100644 index 0000000000..57b3dd0586 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AcoversGeoTrgeometryPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class AcoversGeoTrgeometryPhysicalFunction : public PhysicalFunctionConcept { +public: + AcoversGeoTrgeometryPhysicalFunction(PhysicalFunction tgt_wkt, PhysicalFunction ref_wkt, PhysicalFunction x1, PhysicalFunction y1, PhysicalFunction theta1, PhysicalFunction ts1); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AcoversTcbufferGeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AcoversTcbufferGeoPhysicalFunction.hpp index e4d4381bbe..660161810b 100644 --- a/nes-physical-operators/include/Functions/Meos/AcoversTcbufferGeoPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/AcoversTcbufferGeoPhysicalFunction.hpp @@ -21,16 +21,25 @@ namespace NES { +/** + * @brief Physical operator for `acovers_tcbuffer_geo`. + * + * Per-event acovers_tcbuffer_geo spatial predicate. + * + * Generated by tools/codegen/codegen_nebula.py. + */ class AcoversTcbufferGeoPhysicalFunction : public PhysicalFunctionConcept { public: - AcoversTcbufferGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, - PhysicalFunction radius, PhysicalFunction ts, - PhysicalFunction wkt); + AcoversTcbufferGeoPhysicalFunction(PhysicalFunction lonFunction, + PhysicalFunction latFunction, + PhysicalFunction radiusFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AcoversTcbufferTcbufferPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AcoversTcbufferTcbufferPhysicalFunction.hpp index cac2f7aaa0..836362f6cb 100644 --- a/nes-physical-operators/include/Functions/Meos/AcoversTcbufferTcbufferPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/AcoversTcbufferTcbufferPhysicalFunction.hpp @@ -21,17 +21,28 @@ namespace NES { +/** + * @brief Physical operator for `acovers_tcbuffer_tcbuffer`. + * + * Per-event acovers_tcbuffer_tcbuffer spatial predicate. + * + * Generated by tools/codegen/codegen_nebula.py. + */ class AcoversTcbufferTcbufferPhysicalFunction : public PhysicalFunctionConcept { public: - AcoversTcbufferTcbufferPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction r1, - PhysicalFunction ts1, - PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction r2, - PhysicalFunction ts2); + AcoversTcbufferTcbufferPhysicalFunction(PhysicalFunction lonAFunction, + PhysicalFunction latAFunction, + PhysicalFunction radiusAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction lonBFunction, + PhysicalFunction latBFunction, + PhysicalFunction radiusBFunction, + PhysicalFunction tsBFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AcoversTgeoGeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AcoversTgeoGeoPhysicalFunction.hpp index b98adc08e9..6cf9fb71ec 100644 --- a/nes-physical-operators/include/Functions/Meos/AcoversTgeoGeoPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/AcoversTgeoGeoPhysicalFunction.hpp @@ -21,15 +21,24 @@ namespace NES { +/** + * @brief Physical operator for `acovers_tgeo_geo`. + * + * Per-event acovers_tgeo_geo spatial predicate. + * + * Generated by tools/codegen/codegen_nebula.py. + */ class AcoversTgeoGeoPhysicalFunction : public PhysicalFunctionConcept { public: - AcoversTgeoGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, - PhysicalFunction ts, PhysicalFunction wkt); + AcoversTgeoGeoPhysicalFunction(PhysicalFunction lonFunction, + PhysicalFunction latFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AcoversTgeoTgeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AcoversTgeoTgeoPhysicalFunction.hpp index 298e0f13b1..3a56716ffc 100644 --- a/nes-physical-operators/include/Functions/Meos/AcoversTgeoTgeoPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/AcoversTgeoTgeoPhysicalFunction.hpp @@ -21,12 +21,26 @@ namespace NES { +/** + * @brief Physical operator for `acovers_tgeo_tgeo`. + * + * Per-event acovers_tgeo_tgeo spatial predicate. + * + * Generated by tools/codegen/codegen_nebula.py. + */ class AcoversTgeoTgeoPhysicalFunction : public PhysicalFunctionConcept { public: - AcoversTgeoTgeoPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction ts1, PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction ts2); + AcoversTgeoTgeoPhysicalFunction(PhysicalFunction lonAFunction, + PhysicalFunction latAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction lonBFunction, + PhysicalFunction latBFunction, + PhysicalFunction tsBFunction); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AcoversTrgeometryGeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AcoversTrgeometryGeoPhysicalFunction.hpp new file mode 100644 index 0000000000..28a167368a --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AcoversTrgeometryGeoPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class AcoversTrgeometryGeoPhysicalFunction : public PhysicalFunctionConcept { +public: + AcoversTrgeometryGeoPhysicalFunction(PhysicalFunction ref_wkt, PhysicalFunction x1, PhysicalFunction y1, PhysicalFunction theta1, PhysicalFunction ts1, PhysicalFunction tgt_wkt); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AddBigintTbigintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AddBigintTbigintPhysicalFunction.hpp index 002afad790..fd8e4c3598 100644 --- a/nes-physical-operators/include/Functions/Meos/AddBigintTbigintPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/AddBigintTbigintPhysicalFunction.hpp @@ -24,15 +24,15 @@ namespace NES { /** * @brief Physical operator for `add_bigint_tbigint`. * - * Per-event add_bigint_tbigint: adds a constant int64 scalar to a single-instant tbigint value. + * Per-event add_bigint_tbigint: scalar bigint plus single-instant tbigint. * * Generated by tools/codegen/codegen_nebula.py. */ class AddBigintTbigintPhysicalFunction : public PhysicalFunctionConcept { public: - AddBigintTbigintPhysicalFunction(PhysicalFunction scalarFunction, - PhysicalFunction valueFunction, - PhysicalFunction tsFunction); + AddBigintTbigintPhysicalFunction(PhysicalFunction arg0Function, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; diff --git a/nes-physical-operators/include/Functions/Meos/AddFloatTfloatPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AddFloatTfloatPhysicalFunction.hpp index 8c37def1c6..42f0013569 100644 --- a/nes-physical-operators/include/Functions/Meos/AddFloatTfloatPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/AddFloatTfloatPhysicalFunction.hpp @@ -24,15 +24,15 @@ namespace NES { /** * @brief Physical operator for `add_float_tfloat`. * - * Per-event add_float_tfloat: adds a constant to a single-instant tfloat value. + * Per-event add_float_tfloat: scalar float plus single-instant tfloat. * * Generated by tools/codegen/codegen_nebula.py. */ class AddFloatTfloatPhysicalFunction : public PhysicalFunctionConcept { public: - AddFloatTfloatPhysicalFunction(PhysicalFunction scalarFunction, - PhysicalFunction valueFunction, - PhysicalFunction tsFunction); + AddFloatTfloatPhysicalFunction(PhysicalFunction arg0Function, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; diff --git a/nes-physical-operators/include/Functions/Meos/AddIntTintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AddIntTintPhysicalFunction.hpp index 086b9058c2..1033395edc 100644 --- a/nes-physical-operators/include/Functions/Meos/AddIntTintPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/AddIntTintPhysicalFunction.hpp @@ -24,15 +24,15 @@ namespace NES { /** * @brief Physical operator for `add_int_tint`. * - * Per-event add_int_tint: adds a constant to a single-instant tint value. + * Per-event add_int_tint: scalar int plus single-instant tint. * * Generated by tools/codegen/codegen_nebula.py. */ class AddIntTintPhysicalFunction : public PhysicalFunctionConcept { public: - AddIntTintPhysicalFunction(PhysicalFunction scalarFunction, - PhysicalFunction valueFunction, - PhysicalFunction tsFunction); + AddIntTintPhysicalFunction(PhysicalFunction arg0Function, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; diff --git a/nes-physical-operators/include/Functions/Meos/AddTbigintBigintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AddTbigintBigintPhysicalFunction.hpp index 86f61b764c..f82cbc7c6a 100644 --- a/nes-physical-operators/include/Functions/Meos/AddTbigintBigintPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/AddTbigintBigintPhysicalFunction.hpp @@ -24,15 +24,15 @@ namespace NES { /** * @brief Physical operator for `add_tbigint_bigint`. * - * Per-event add_tbigint_bigint: adds a constant int64 to a single-instant tbigint value. + * Per-event add_tbigint_bigint: single-instant tbigint plus scalar bigint. * * Generated by tools/codegen/codegen_nebula.py. */ class AddTbigintBigintPhysicalFunction : public PhysicalFunctionConcept { public: AddTbigintBigintPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction tsFunction, - PhysicalFunction addendFunction); + PhysicalFunction tsFunction, + PhysicalFunction arg0Function); VarVal execute(const Record& record, ArenaRef& arena) const override; diff --git a/nes-physical-operators/include/Functions/Meos/AddTfloatFloatPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AddTfloatFloatPhysicalFunction.hpp index 599af33b95..32a6d51f1d 100644 --- a/nes-physical-operators/include/Functions/Meos/AddTfloatFloatPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/AddTfloatFloatPhysicalFunction.hpp @@ -24,15 +24,15 @@ namespace NES { /** * @brief Physical operator for `add_tfloat_float`. * - * Per-event add_tfloat_float: adds a constant to a single-instant tfloat value. + * Per-event add_tfloat_float: single-instant tfloat plus scalar float. * * Generated by tools/codegen/codegen_nebula.py. */ class AddTfloatFloatPhysicalFunction : public PhysicalFunctionConcept { public: AddTfloatFloatPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction tsFunction, - PhysicalFunction addendFunction); + PhysicalFunction tsFunction, + PhysicalFunction arg0Function); VarVal execute(const Record& record, ArenaRef& arena) const override; diff --git a/nes-physical-operators/include/Functions/Meos/AddTintIntPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AddTintIntPhysicalFunction.hpp index e2fd8daba7..03505efd9c 100644 --- a/nes-physical-operators/include/Functions/Meos/AddTintIntPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/AddTintIntPhysicalFunction.hpp @@ -24,15 +24,15 @@ namespace NES { /** * @brief Physical operator for `add_tint_int`. * - * Per-event add_tint_int: adds a constant integer to a single-instant tint value. + * Per-event add_tint_int: single-instant tint plus scalar int. * * Generated by tools/codegen/codegen_nebula.py. */ class AddTintIntPhysicalFunction : public PhysicalFunctionConcept { public: AddTintIntPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction tsFunction, - PhysicalFunction addendFunction); + PhysicalFunction tsFunction, + PhysicalFunction arg0Function); VarVal execute(const Record& record, ArenaRef& arena) const override; diff --git a/nes-physical-operators/include/Functions/Meos/AddTnumberTnumberPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AddTnumberTnumberPhysicalFunction.hpp index c45dd431d3..f67bad56d3 100644 --- a/nes-physical-operators/include/Functions/Meos/AddTnumberTnumberPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/AddTnumberTnumberPhysicalFunction.hpp @@ -24,15 +24,14 @@ namespace NES { /** * @brief Physical operator for `add_tnumber_tnumber`. * - * Per-event element-wise addition of two co-instant tnumbers. + * Per-event add_tnumber_tnumber: two temporal numbers added (WKB result). * * Generated by tools/codegen/codegen_nebula.py. */ class AddTnumberTnumberPhysicalFunction : public PhysicalFunctionConcept { public: - AddTnumberTnumberPhysicalFunction(PhysicalFunction value1Function, - PhysicalFunction value2Function, - PhysicalFunction tsFunction); + AddTnumberTnumberPhysicalFunction(PhysicalFunction trajFunction, + PhysicalFunction arg0Function); VarVal execute(const Record& record, ArenaRef& arena) const override; diff --git a/nes-physical-operators/include/Functions/Meos/AdisjointTcbufferGeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AdisjointTcbufferGeoPhysicalFunction.hpp index dd573a50a1..174c47a818 100644 --- a/nes-physical-operators/include/Functions/Meos/AdisjointTcbufferGeoPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/AdisjointTcbufferGeoPhysicalFunction.hpp @@ -21,16 +21,25 @@ namespace NES { +/** + * @brief Physical operator for `adisjoint_tcbuffer_geo`. + * + * Per-event adisjoint_tcbuffer_geo spatial predicate. + * + * Generated by tools/codegen/codegen_nebula.py. + */ class AdisjointTcbufferGeoPhysicalFunction : public PhysicalFunctionConcept { public: - AdisjointTcbufferGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, - PhysicalFunction radius, PhysicalFunction ts, - PhysicalFunction wkt); + AdisjointTcbufferGeoPhysicalFunction(PhysicalFunction lonFunction, + PhysicalFunction latFunction, + PhysicalFunction radiusFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AdisjointTcbufferTcbufferPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AdisjointTcbufferTcbufferPhysicalFunction.hpp index 3b0c4c1d0f..8f02e868d7 100644 --- a/nes-physical-operators/include/Functions/Meos/AdisjointTcbufferTcbufferPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/AdisjointTcbufferTcbufferPhysicalFunction.hpp @@ -21,17 +21,28 @@ namespace NES { +/** + * @brief Physical operator for `adisjoint_tcbuffer_tcbuffer`. + * + * Per-event adisjoint_tcbuffer_tcbuffer spatial predicate. + * + * Generated by tools/codegen/codegen_nebula.py. + */ class AdisjointTcbufferTcbufferPhysicalFunction : public PhysicalFunctionConcept { public: - AdisjointTcbufferTcbufferPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction r1, - PhysicalFunction ts1, - PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction r2, - PhysicalFunction ts2); + AdisjointTcbufferTcbufferPhysicalFunction(PhysicalFunction lonAFunction, + PhysicalFunction latAFunction, + PhysicalFunction radiusAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction lonBFunction, + PhysicalFunction latBFunction, + PhysicalFunction radiusBFunction, + PhysicalFunction tsBFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AdisjointTgeoGeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AdisjointTgeoGeoPhysicalFunction.hpp index 645e98dc41..29fb9010b0 100644 --- a/nes-physical-operators/include/Functions/Meos/AdisjointTgeoGeoPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/AdisjointTgeoGeoPhysicalFunction.hpp @@ -21,15 +21,24 @@ namespace NES { +/** + * @brief Physical operator for `adisjoint_tgeo_geo`. + * + * Per-event adisjoint_tgeo_geo spatial predicate. + * + * Generated by tools/codegen/codegen_nebula.py. + */ class AdisjointTgeoGeoPhysicalFunction : public PhysicalFunctionConcept { public: - AdisjointTgeoGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, - PhysicalFunction ts, PhysicalFunction wkt); + AdisjointTgeoGeoPhysicalFunction(PhysicalFunction lonFunction, + PhysicalFunction latFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AdisjointTgeoTgeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AdisjointTgeoTgeoPhysicalFunction.hpp index c5fea46730..3e4b5d4bb4 100644 --- a/nes-physical-operators/include/Functions/Meos/AdisjointTgeoTgeoPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/AdisjointTgeoTgeoPhysicalFunction.hpp @@ -21,12 +21,26 @@ namespace NES { +/** + * @brief Physical operator for `adisjoint_tgeo_tgeo`. + * + * Per-event adisjoint_tgeo_tgeo spatial predicate. + * + * Generated by tools/codegen/codegen_nebula.py. + */ class AdisjointTgeoTgeoPhysicalFunction : public PhysicalFunctionConcept { public: - AdisjointTgeoTgeoPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction ts1, PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction ts2); + AdisjointTgeoTgeoPhysicalFunction(PhysicalFunction lonAFunction, + PhysicalFunction latAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction lonBFunction, + PhysicalFunction latBFunction, + PhysicalFunction tsBFunction); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AdisjointTrgeometryGeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AdisjointTrgeometryGeoPhysicalFunction.hpp new file mode 100644 index 0000000000..4c23c53acf --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AdisjointTrgeometryGeoPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class AdisjointTrgeometryGeoPhysicalFunction : public PhysicalFunctionConcept { +public: + AdisjointTrgeometryGeoPhysicalFunction(PhysicalFunction ref_wkt, PhysicalFunction x1, PhysicalFunction y1, PhysicalFunction theta1, PhysicalFunction ts1, PhysicalFunction tgt_wkt); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AdisjointTrgeometryTrgeometryPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AdisjointTrgeometryTrgeometryPhysicalFunction.hpp new file mode 100644 index 0000000000..7107780fe9 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AdisjointTrgeometryTrgeometryPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class AdisjointTrgeometryTrgeometryPhysicalFunction : public PhysicalFunctionConcept { +public: + AdisjointTrgeometryTrgeometryPhysicalFunction(PhysicalFunction ref1_wkt, PhysicalFunction x1, PhysicalFunction y1, PhysicalFunction theta1, PhysicalFunction ts1, PhysicalFunction ref2_wkt, PhysicalFunction x2, PhysicalFunction y2, PhysicalFunction theta2, PhysicalFunction ts2); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AdwithinTcbufferCbufferPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AdwithinTcbufferCbufferPhysicalFunction.hpp new file mode 100644 index 0000000000..2dfb93fdec --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AdwithinTcbufferCbufferPhysicalFunction.hpp @@ -0,0 +1,46 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `adwithin_tcbuffer_cbuffer`. + * + * Per-event always-within-distance between a single-instant tcbuffer and a static cbuffer. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class AdwithinTcbufferCbufferPhysicalFunction : public PhysicalFunctionConcept { +public: + AdwithinTcbufferCbufferPhysicalFunction(PhysicalFunction lonFunction, + PhysicalFunction latFunction, + PhysicalFunction radiusFunction, + PhysicalFunction timestampFunction, + PhysicalFunction cbufLitFunction, + PhysicalFunction distFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AdwithinTcbufferGeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AdwithinTcbufferGeoPhysicalFunction.hpp index 62bfbd22eb..87e1189714 100644 --- a/nes-physical-operators/include/Functions/Meos/AdwithinTcbufferGeoPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/AdwithinTcbufferGeoPhysicalFunction.hpp @@ -21,16 +21,26 @@ namespace NES { +/** + * @brief Physical operator for `adwithin_tcbuffer_geo`. + * + * Per-event adwithin_tcbuffer_geo spatial predicate. + * + * Generated by tools/codegen/codegen_nebula.py. + */ class AdwithinTcbufferGeoPhysicalFunction : public PhysicalFunctionConcept { public: - AdwithinTcbufferGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, - PhysicalFunction radius, PhysicalFunction ts, - PhysicalFunction wkt, PhysicalFunction dist); + AdwithinTcbufferGeoPhysicalFunction(PhysicalFunction lonFunction, + PhysicalFunction latFunction, + PhysicalFunction radiusFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction, + PhysicalFunction distFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AdwithinTcbufferTcbufferPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AdwithinTcbufferTcbufferPhysicalFunction.hpp index 1c4700ae3f..a10a8ce1a1 100644 --- a/nes-physical-operators/include/Functions/Meos/AdwithinTcbufferTcbufferPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/AdwithinTcbufferTcbufferPhysicalFunction.hpp @@ -21,17 +21,29 @@ namespace NES { +/** + * @brief Physical operator for `adwithin_tcbuffer_tcbuffer`. + * + * Per-event adwithin_tcbuffer_tcbuffer spatial predicate. + * + * Generated by tools/codegen/codegen_nebula.py. + */ class AdwithinTcbufferTcbufferPhysicalFunction : public PhysicalFunctionConcept { public: - AdwithinTcbufferTcbufferPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction r1, - PhysicalFunction ts1, - PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction r2, - PhysicalFunction ts2, PhysicalFunction dist); + AdwithinTcbufferTcbufferPhysicalFunction(PhysicalFunction lonAFunction, + PhysicalFunction latAFunction, + PhysicalFunction radiusAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction lonBFunction, + PhysicalFunction latBFunction, + PhysicalFunction radiusBFunction, + PhysicalFunction tsBFunction, + PhysicalFunction distFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AdwithinTgeoGeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AdwithinTgeoGeoPhysicalFunction.hpp index 141a31d9ab..e795996397 100644 --- a/nes-physical-operators/include/Functions/Meos/AdwithinTgeoGeoPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/AdwithinTgeoGeoPhysicalFunction.hpp @@ -21,16 +21,25 @@ namespace NES { +/** + * @brief Physical operator for `adwithin_tgeo_geo`. + * + * Per-event adwithin_tgeo_geo spatial predicate. + * + * Generated by tools/codegen/codegen_nebula.py. + */ class AdwithinTgeoGeoPhysicalFunction : public PhysicalFunctionConcept { public: - AdwithinTgeoGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, - PhysicalFunction ts, PhysicalFunction wkt, - PhysicalFunction dist); + AdwithinTgeoGeoPhysicalFunction(PhysicalFunction lonFunction, + PhysicalFunction latFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction, + PhysicalFunction distFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AdwithinTgeoTgeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AdwithinTgeoTgeoPhysicalFunction.hpp index 4f171e71ad..52ce2372fd 100644 --- a/nes-physical-operators/include/Functions/Meos/AdwithinTgeoTgeoPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/AdwithinTgeoTgeoPhysicalFunction.hpp @@ -21,12 +21,27 @@ namespace NES { +/** + * @brief Physical operator for `adwithin_tgeo_tgeo`. + * + * Per-event adwithin_tgeo_tgeo spatial predicate. + * + * Generated by tools/codegen/codegen_nebula.py. + */ class AdwithinTgeoTgeoPhysicalFunction : public PhysicalFunctionConcept { public: - AdwithinTgeoTgeoPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction ts1, PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction ts2, PhysicalFunction dist); + AdwithinTgeoTgeoPhysicalFunction(PhysicalFunction lonAFunction, + PhysicalFunction latAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction lonBFunction, + PhysicalFunction latBFunction, + PhysicalFunction tsBFunction, + PhysicalFunction distFunction); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AdwithinTrgeometryGeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AdwithinTrgeometryGeoPhysicalFunction.hpp new file mode 100644 index 0000000000..76f98a972e --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AdwithinTrgeometryGeoPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class AdwithinTrgeometryGeoPhysicalFunction : public PhysicalFunctionConcept { +public: + AdwithinTrgeometryGeoPhysicalFunction(PhysicalFunction ref_wkt, PhysicalFunction x1, PhysicalFunction y1, PhysicalFunction theta1, PhysicalFunction ts1, PhysicalFunction tgt_wkt, PhysicalFunction dist); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AdwithinTrgeometryTrgeometryPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AdwithinTrgeometryTrgeometryPhysicalFunction.hpp new file mode 100644 index 0000000000..4ae9f2a5c6 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AdwithinTrgeometryTrgeometryPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class AdwithinTrgeometryTrgeometryPhysicalFunction : public PhysicalFunctionConcept { +public: + AdwithinTrgeometryTrgeometryPhysicalFunction(PhysicalFunction ref1_wkt, PhysicalFunction x1, PhysicalFunction y1, PhysicalFunction theta1, PhysicalFunction ts1, PhysicalFunction ref2_wkt, PhysicalFunction x2, PhysicalFunction y2, PhysicalFunction theta2, PhysicalFunction ts2, PhysicalFunction dist); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AintersectsTcbufferGeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AintersectsTcbufferGeoPhysicalFunction.hpp index d6114f4a3c..b37e2c65c4 100644 --- a/nes-physical-operators/include/Functions/Meos/AintersectsTcbufferGeoPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/AintersectsTcbufferGeoPhysicalFunction.hpp @@ -21,16 +21,25 @@ namespace NES { +/** + * @brief Physical operator for `aintersects_tcbuffer_geo`. + * + * Per-event aintersects_tcbuffer_geo spatial predicate. + * + * Generated by tools/codegen/codegen_nebula.py. + */ class AintersectsTcbufferGeoPhysicalFunction : public PhysicalFunctionConcept { public: - AintersectsTcbufferGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, - PhysicalFunction radius, PhysicalFunction ts, - PhysicalFunction wkt); + AintersectsTcbufferGeoPhysicalFunction(PhysicalFunction lonFunction, + PhysicalFunction latFunction, + PhysicalFunction radiusFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AintersectsTcbufferTcbufferPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AintersectsTcbufferTcbufferPhysicalFunction.hpp index 1bea980358..a30e8fc7b0 100644 --- a/nes-physical-operators/include/Functions/Meos/AintersectsTcbufferTcbufferPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/AintersectsTcbufferTcbufferPhysicalFunction.hpp @@ -21,17 +21,28 @@ namespace NES { +/** + * @brief Physical operator for `aintersects_tcbuffer_tcbuffer`. + * + * Per-event aintersects_tcbuffer_tcbuffer spatial predicate. + * + * Generated by tools/codegen/codegen_nebula.py. + */ class AintersectsTcbufferTcbufferPhysicalFunction : public PhysicalFunctionConcept { public: - AintersectsTcbufferTcbufferPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction r1, - PhysicalFunction ts1, - PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction r2, - PhysicalFunction ts2); + AintersectsTcbufferTcbufferPhysicalFunction(PhysicalFunction lonAFunction, + PhysicalFunction latAFunction, + PhysicalFunction radiusAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction lonBFunction, + PhysicalFunction latBFunction, + PhysicalFunction radiusBFunction, + PhysicalFunction tsBFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AintersectsTgeoGeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AintersectsTgeoGeoPhysicalFunction.hpp index 4ececd4f99..dd0ff11ebe 100644 --- a/nes-physical-operators/include/Functions/Meos/AintersectsTgeoGeoPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/AintersectsTgeoGeoPhysicalFunction.hpp @@ -21,15 +21,24 @@ namespace NES { +/** + * @brief Physical operator for `aintersects_tgeo_geo`. + * + * Per-event aintersects_tgeo_geo spatial predicate. + * + * Generated by tools/codegen/codegen_nebula.py. + */ class AintersectsTgeoGeoPhysicalFunction : public PhysicalFunctionConcept { public: - AintersectsTgeoGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, - PhysicalFunction ts, PhysicalFunction wkt); + AintersectsTgeoGeoPhysicalFunction(PhysicalFunction lonFunction, + PhysicalFunction latFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AintersectsTgeoTgeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AintersectsTgeoTgeoPhysicalFunction.hpp index 5359651e51..c254b36a7b 100644 --- a/nes-physical-operators/include/Functions/Meos/AintersectsTgeoTgeoPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/AintersectsTgeoTgeoPhysicalFunction.hpp @@ -21,12 +21,26 @@ namespace NES { +/** + * @brief Physical operator for `aintersects_tgeo_tgeo`. + * + * Per-event aintersects_tgeo_tgeo spatial predicate. + * + * Generated by tools/codegen/codegen_nebula.py. + */ class AintersectsTgeoTgeoPhysicalFunction : public PhysicalFunctionConcept { public: - AintersectsTgeoTgeoPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction ts1, PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction ts2); + AintersectsTgeoTgeoPhysicalFunction(PhysicalFunction lonAFunction, + PhysicalFunction latAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction lonBFunction, + PhysicalFunction latBFunction, + PhysicalFunction tsBFunction); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AintersectsTrgeometryGeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AintersectsTrgeometryGeoPhysicalFunction.hpp new file mode 100644 index 0000000000..7e5e62d2ad --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AintersectsTrgeometryGeoPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class AintersectsTrgeometryGeoPhysicalFunction : public PhysicalFunctionConcept { +public: + AintersectsTrgeometryGeoPhysicalFunction(PhysicalFunction ref_wkt, PhysicalFunction x1, PhysicalFunction y1, PhysicalFunction theta1, PhysicalFunction ts1, PhysicalFunction tgt_wkt); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AintersectsTrgeometryTrgeometryPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AintersectsTrgeometryTrgeometryPhysicalFunction.hpp new file mode 100644 index 0000000000..93eb6c3a90 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AintersectsTrgeometryTrgeometryPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class AintersectsTrgeometryTrgeometryPhysicalFunction : public PhysicalFunctionConcept { +public: + AintersectsTrgeometryTrgeometryPhysicalFunction(PhysicalFunction ref1_wkt, PhysicalFunction x1, PhysicalFunction y1, PhysicalFunction theta1, PhysicalFunction ts1, PhysicalFunction ref2_wkt, PhysicalFunction x2, PhysicalFunction y2, PhysicalFunction theta2, PhysicalFunction ts2); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysEqBigintTbigintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysEqBigintTbigintPhysicalFunction.hpp index 2b35d1eec5..0ce68994f1 100644 --- a/nes-physical-operators/include/Functions/Meos/AlwaysEqBigintTbigintPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/AlwaysEqBigintTbigintPhysicalFunction.hpp @@ -24,15 +24,15 @@ namespace NES { /** * @brief Physical operator for `always_eq_bigint_tbigint`. * - * Per-event always_eq_bigint_tbigint: tests if a single-instant tfloat value ever equals a threshold. + * Per-event always_eq_bigint_tbigint: always-equal scalar bigint vs tbigint. * * Generated by tools/codegen/codegen_nebula.py. */ class AlwaysEqBigintTbigintPhysicalFunction : public PhysicalFunctionConcept { public: - AlwaysEqBigintTbigintPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction thresholdFunction, - PhysicalFunction tsFunction); + AlwaysEqBigintTbigintPhysicalFunction(PhysicalFunction arg0Function, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysEqBoolTboolPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysEqBoolTboolPhysicalFunction.hpp index c98290da98..6fef347849 100644 --- a/nes-physical-operators/include/Functions/Meos/AlwaysEqBoolTboolPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/AlwaysEqBoolTboolPhysicalFunction.hpp @@ -24,15 +24,15 @@ namespace NES { /** * @brief Physical operator for `always_eq_bool_tbool`. * - * Per-event always_eq_bool_tbool: tests if a single-instant tfloat value ever equals a threshold. + * Per-event always_eq_bool_tbool: always-equal scalar bool vs tbool. * * Generated by tools/codegen/codegen_nebula.py. */ class AlwaysEqBoolTboolPhysicalFunction : public PhysicalFunctionConcept { public: - AlwaysEqBoolTboolPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction thresholdFunction, - PhysicalFunction tsFunction); + AlwaysEqBoolTboolPhysicalFunction(PhysicalFunction arg0Function, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysEqNpointTnpointPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysEqNpointTnpointPhysicalFunction.hpp index cba9924d21..70b0d9fbce 100644 --- a/nes-physical-operators/include/Functions/Meos/AlwaysEqNpointTnpointPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/AlwaysEqNpointTnpointPhysicalFunction.hpp @@ -21,12 +21,25 @@ namespace NES { +/** + * @brief Physical operator for `always_eq_npoint_tnpoint`. + * + * Always eq npoint vs tnpoint + * + * Generated by tools/codegen/codegen_nebula.py. + */ class AlwaysEqNpointTnpointPhysicalFunction : public PhysicalFunctionConcept { public: - AlwaysEqNpointTnpointPhysicalFunction(PhysicalFunction rid_np, PhysicalFunction pos_np, PhysicalFunction rid_tp, PhysicalFunction pos_tp, PhysicalFunction ts); + AlwaysEqNpointTnpointPhysicalFunction(PhysicalFunction rid0Function, + PhysicalFunction frac0Function, + PhysicalFunction ridFunction, + PhysicalFunction fracFunction, + PhysicalFunction tsFunction); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysEqPoseTposePhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysEqPoseTposePhysicalFunction.hpp index 29adc32501..c4044c66c5 100644 --- a/nes-physical-operators/include/Functions/Meos/AlwaysEqPoseTposePhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/AlwaysEqPoseTposePhysicalFunction.hpp @@ -21,12 +21,27 @@ namespace NES { +/** + * @brief Physical operator for `always_eq_pose_tpose`. + * + * Always eq pose vs tpose + * + * Generated by tools/codegen/codegen_nebula.py. + */ class AlwaysEqPoseTposePhysicalFunction : public PhysicalFunctionConcept { public: - AlwaysEqPoseTposePhysicalFunction(PhysicalFunction x2, PhysicalFunction y2, PhysicalFunction theta2, PhysicalFunction x, PhysicalFunction y, PhysicalFunction theta, PhysicalFunction ts); + AlwaysEqPoseTposePhysicalFunction(PhysicalFunction px0Function, + PhysicalFunction py0Function, + PhysicalFunction ptheta0Function, + PhysicalFunction xFunction, + PhysicalFunction yFunction, + PhysicalFunction thetaFunction, + PhysicalFunction tsFunction); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysEqTbigintBigintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysEqTbigintBigintPhysicalFunction.hpp index 1a2954e0d9..daf5e28f5c 100644 --- a/nes-physical-operators/include/Functions/Meos/AlwaysEqTbigintBigintPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/AlwaysEqTbigintBigintPhysicalFunction.hpp @@ -24,15 +24,15 @@ namespace NES { /** * @brief Physical operator for `always_eq_tbigint_bigint`. * - * Per-event always_eq_tbigint_bigint: tests if a single-instant tbigint value always eqs a threshold. + * Per-event always_eq_tbigint_bigint: always-equal tbigint vs scalar bigint. * * Generated by tools/codegen/codegen_nebula.py. */ class AlwaysEqTbigintBigintPhysicalFunction : public PhysicalFunctionConcept { public: AlwaysEqTbigintBigintPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction thresholdFunction, - PhysicalFunction tsFunction); + PhysicalFunction tsFunction, + PhysicalFunction arg0Function); VarVal execute(const Record& record, ArenaRef& arena) const override; diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysEqTboolBoolPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysEqTboolBoolPhysicalFunction.hpp index f3bfd249ad..74094201a5 100644 --- a/nes-physical-operators/include/Functions/Meos/AlwaysEqTboolBoolPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/AlwaysEqTboolBoolPhysicalFunction.hpp @@ -24,15 +24,15 @@ namespace NES { /** * @brief Physical operator for `always_eq_tbool_bool`. * - * Per-event always_eq_tbool_bool: tests if a single-instant tfloat value ever equals a threshold. + * Per-event always_eq_tbool_bool: always-equal tbool vs scalar bool. * * Generated by tools/codegen/codegen_nebula.py. */ class AlwaysEqTboolBoolPhysicalFunction : public PhysicalFunctionConcept { public: AlwaysEqTboolBoolPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction thresholdFunction, - PhysicalFunction tsFunction); + PhysicalFunction tsFunction, + PhysicalFunction arg0Function); VarVal execute(const Record& record, ArenaRef& arena) const override; diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysEqTcbufferTcbufferPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysEqTcbufferTcbufferPhysicalFunction.hpp index 0729d3718d..8280348056 100644 --- a/nes-physical-operators/include/Functions/Meos/AlwaysEqTcbufferTcbufferPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/AlwaysEqTcbufferTcbufferPhysicalFunction.hpp @@ -21,17 +21,28 @@ namespace NES { +/** + * @brief Physical operator for `always_eq_tcbuffer_tcbuffer`. + * + * Per-event always_eq_tcbuffer_tcbuffer spatial predicate. + * + * Generated by tools/codegen/codegen_nebula.py. + */ class AlwaysEqTcbufferTcbufferPhysicalFunction : public PhysicalFunctionConcept { public: - AlwaysEqTcbufferTcbufferPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction r1, - PhysicalFunction ts1, - PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction r2, - PhysicalFunction ts2); + AlwaysEqTcbufferTcbufferPhysicalFunction(PhysicalFunction lonAFunction, + PhysicalFunction latAFunction, + PhysicalFunction radiusAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction lonBFunction, + PhysicalFunction latBFunction, + PhysicalFunction radiusBFunction, + PhysicalFunction tsBFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysEqTextTtextPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysEqTextTtextPhysicalFunction.hpp index c153240e8c..425c9fb8f7 100644 --- a/nes-physical-operators/include/Functions/Meos/AlwaysEqTextTtextPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/AlwaysEqTextTtextPhysicalFunction.hpp @@ -21,16 +21,23 @@ namespace NES { +/** + * @brief Physical operator for `always_eq_text_ttext(txt0, temp)`. + * + * Always eqqual text vs ttext + * + * Generated by tools/codegen/codegen_nebula.py. + */ class AlwaysEqTextTtextPhysicalFunction : public PhysicalFunctionConcept { public: - AlwaysEqTextTtextPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction refFunction, - PhysicalFunction tsFunction); + AlwaysEqTextTtextPhysicalFunction(PhysicalFunction arg0Function, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysEqTgeoGeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysEqTgeoGeoPhysicalFunction.hpp index 374b10708d..717e59d4a9 100644 --- a/nes-physical-operators/include/Functions/Meos/AlwaysEqTgeoGeoPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/AlwaysEqTgeoGeoPhysicalFunction.hpp @@ -21,15 +21,24 @@ namespace NES { +/** + * @brief Physical operator for `always_eq_tgeo_geo`. + * + * Per-event always_eq_tgeo_geo spatial predicate. + * + * Generated by tools/codegen/codegen_nebula.py. + */ class AlwaysEqTgeoGeoPhysicalFunction : public PhysicalFunctionConcept { public: - AlwaysEqTgeoGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, - PhysicalFunction ts, PhysicalFunction wkt); + AlwaysEqTgeoGeoPhysicalFunction(PhysicalFunction lonFunction, + PhysicalFunction latFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysEqTgeoTgeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysEqTgeoTgeoPhysicalFunction.hpp index 8a48929cf6..738be5a266 100644 --- a/nes-physical-operators/include/Functions/Meos/AlwaysEqTgeoTgeoPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/AlwaysEqTgeoTgeoPhysicalFunction.hpp @@ -21,12 +21,26 @@ namespace NES { +/** + * @brief Physical operator for `always_eq_tgeo_tgeo`. + * + * Per-event always_eq_tgeo_tgeo spatial predicate. + * + * Generated by tools/codegen/codegen_nebula.py. + */ class AlwaysEqTgeoTgeoPhysicalFunction : public PhysicalFunctionConcept { public: - AlwaysEqTgeoTgeoPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction ts1, PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction ts2); + AlwaysEqTgeoTgeoPhysicalFunction(PhysicalFunction lonAFunction, + PhysicalFunction latAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction lonBFunction, + PhysicalFunction latBFunction, + PhysicalFunction tsBFunction); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysEqTh3indexH3indexPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysEqTh3indexH3indexPhysicalFunction.hpp index 09e76ee3fe..a06507caef 100644 --- a/nes-physical-operators/include/Functions/Meos/AlwaysEqTh3indexH3indexPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/AlwaysEqTh3indexH3indexPhysicalFunction.hpp @@ -21,14 +21,23 @@ namespace NES { +/** + * @brief Physical operator for `always_eq_th3index_h3index(temp, (H3Index)arg0)`. + * + * Always equal th3index vs h3index + * + * Generated by tools/codegen/codegen_nebula.py. + */ class AlwaysEqTh3indexH3indexPhysicalFunction : public PhysicalFunctionConcept { public: - AlwaysEqTh3indexH3indexPhysicalFunction(PhysicalFunction cell, PhysicalFunction ts, PhysicalFunction target); + AlwaysEqTh3indexH3indexPhysicalFunction(PhysicalFunction cellFunction, + PhysicalFunction tsFunction, + PhysicalFunction arg0Function); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysEqTjsonbJsonbPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysEqTjsonbJsonbPhysicalFunction.hpp index 873bdd2b06..712ea20802 100644 --- a/nes-physical-operators/include/Functions/Meos/AlwaysEqTjsonbJsonbPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/AlwaysEqTjsonbJsonbPhysicalFunction.hpp @@ -21,12 +21,23 @@ namespace NES { +/** + * @brief Physical operator for `always_eq_tjsonb_jsonb`. + * + * Always equal tjsonb vs jsonb + * + * Generated by tools/codegen/codegen_nebula.py. + */ class AlwaysEqTjsonbJsonbPhysicalFunction : public PhysicalFunctionConcept { public: - AlwaysEqTjsonbJsonbPhysicalFunction(PhysicalFunction json_str, PhysicalFunction ts, PhysicalFunction target_json); + AlwaysEqTjsonbJsonbPhysicalFunction(PhysicalFunction json_strFunction, + PhysicalFunction tsFunction, + PhysicalFunction arg0Function); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysEqTjsonbTjsonbPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysEqTjsonbTjsonbPhysicalFunction.hpp index 1e5ffc433c..b647cf0d2b 100644 --- a/nes-physical-operators/include/Functions/Meos/AlwaysEqTjsonbTjsonbPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/AlwaysEqTjsonbTjsonbPhysicalFunction.hpp @@ -21,12 +21,24 @@ namespace NES { +/** + * @brief Physical operator for `always_eq_tjsonb_tjsonb`. + * + * Always equal tjsonb vs tjsonb + * + * Generated by tools/codegen/codegen_nebula.py. + */ class AlwaysEqTjsonbTjsonbPhysicalFunction : public PhysicalFunctionConcept { public: - AlwaysEqTjsonbTjsonbPhysicalFunction(PhysicalFunction json1, PhysicalFunction ts1, PhysicalFunction json2, PhysicalFunction ts2); + AlwaysEqTjsonbTjsonbPhysicalFunction(PhysicalFunction json_strFunction, + PhysicalFunction tsFunction, + PhysicalFunction json0Function, + PhysicalFunction ts0Function); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysEqTnpointNpointPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysEqTnpointNpointPhysicalFunction.hpp index b430b92485..b252596b9e 100644 --- a/nes-physical-operators/include/Functions/Meos/AlwaysEqTnpointNpointPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/AlwaysEqTnpointNpointPhysicalFunction.hpp @@ -21,12 +21,25 @@ namespace NES { +/** + * @brief Physical operator for `always_eq_tnpoint_npoint`. + * + * Always eq tnpoint vs npoint + * + * Generated by tools/codegen/codegen_nebula.py. + */ class AlwaysEqTnpointNpointPhysicalFunction : public PhysicalFunctionConcept { public: - AlwaysEqTnpointNpointPhysicalFunction(PhysicalFunction rid1, PhysicalFunction pos1, PhysicalFunction ts, PhysicalFunction rid2, PhysicalFunction pos2); + AlwaysEqTnpointNpointPhysicalFunction(PhysicalFunction ridFunction, + PhysicalFunction fracFunction, + PhysicalFunction tsFunction, + PhysicalFunction rid0Function, + PhysicalFunction frac0Function); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysEqTnpointTnpointPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysEqTnpointTnpointPhysicalFunction.hpp index 550ab6cd9a..bd133274b3 100644 --- a/nes-physical-operators/include/Functions/Meos/AlwaysEqTnpointTnpointPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/AlwaysEqTnpointTnpointPhysicalFunction.hpp @@ -21,13 +21,26 @@ namespace NES { +/** + * @brief Physical operator for `always_eq_tnpoint_tnpoint`. + * + * Always eq tnpoint vs tnpoint + * + * Generated by tools/codegen/codegen_nebula.py. + */ class AlwaysEqTnpointTnpointPhysicalFunction : public PhysicalFunctionConcept { public: - AlwaysEqTnpointTnpointPhysicalFunction(PhysicalFunction rid1, PhysicalFunction pos1, PhysicalFunction ts1, - PhysicalFunction rid2, PhysicalFunction pos2, PhysicalFunction ts2); + AlwaysEqTnpointTnpointPhysicalFunction(PhysicalFunction ridFunction, + PhysicalFunction fracFunction, + PhysicalFunction tsFunction, + PhysicalFunction rid0Function, + PhysicalFunction frac0Function, + PhysicalFunction ts0Function); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysEqTposePosePhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysEqTposePosePhysicalFunction.hpp index 4b12612425..b208c49438 100644 --- a/nes-physical-operators/include/Functions/Meos/AlwaysEqTposePosePhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/AlwaysEqTposePosePhysicalFunction.hpp @@ -21,12 +21,27 @@ namespace NES { +/** + * @brief Physical operator for `always_eq_tpose_pose`. + * + * Always eq tpose vs pose + * + * Generated by tools/codegen/codegen_nebula.py. + */ class AlwaysEqTposePosePhysicalFunction : public PhysicalFunctionConcept { public: - AlwaysEqTposePosePhysicalFunction(PhysicalFunction x, PhysicalFunction y, PhysicalFunction theta, PhysicalFunction ts, PhysicalFunction x2, PhysicalFunction y2, PhysicalFunction theta2); + AlwaysEqTposePosePhysicalFunction(PhysicalFunction xFunction, + PhysicalFunction yFunction, + PhysicalFunction thetaFunction, + PhysicalFunction tsFunction, + PhysicalFunction px0Function, + PhysicalFunction py0Function, + PhysicalFunction ptheta0Function); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysEqTposeTposePhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysEqTposeTposePhysicalFunction.hpp index 16cfd9d3d2..ef3c5198da 100644 --- a/nes-physical-operators/include/Functions/Meos/AlwaysEqTposeTposePhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/AlwaysEqTposeTposePhysicalFunction.hpp @@ -21,15 +21,28 @@ namespace NES { +/** + * @brief Physical operator for `always_eq_tpose_tpose`. + * + * Always eq tpose vs tpose + * + * Generated by tools/codegen/codegen_nebula.py. + */ class AlwaysEqTposeTposePhysicalFunction : public PhysicalFunctionConcept { public: - AlwaysEqTposeTposePhysicalFunction(PhysicalFunction x1, PhysicalFunction y1, PhysicalFunction theta1, - PhysicalFunction ts1, - PhysicalFunction x2, PhysicalFunction y2, PhysicalFunction theta2, - PhysicalFunction ts2); + AlwaysEqTposeTposePhysicalFunction(PhysicalFunction xFunction, + PhysicalFunction yFunction, + PhysicalFunction thetaFunction, + PhysicalFunction tsFunction, + PhysicalFunction px0Function, + PhysicalFunction py0Function, + PhysicalFunction ptheta0Function, + PhysicalFunction ts0Function); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysEqTquadbinQuadbinPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysEqTquadbinQuadbinPhysicalFunction.hpp index 73755be1d8..d87f417cd1 100644 --- a/nes-physical-operators/include/Functions/Meos/AlwaysEqTquadbinQuadbinPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/AlwaysEqTquadbinQuadbinPhysicalFunction.hpp @@ -21,12 +21,23 @@ namespace NES { +/** + * @brief Physical operator for `always_eq_tquadbin_quadbin(temp, (Quadbin)arg0)`. + * + * Always equal tquadbin vs quadbin + * + * Generated by tools/codegen/codegen_nebula.py. + */ class AlwaysEqTquadbinQuadbinPhysicalFunction : public PhysicalFunctionConcept { public: - AlwaysEqTquadbinQuadbinPhysicalFunction(PhysicalFunction inst_cell, PhysicalFunction ts, PhysicalFunction cell); + AlwaysEqTquadbinQuadbinPhysicalFunction(PhysicalFunction cellFunction, + PhysicalFunction tsFunction, + PhysicalFunction arg0Function); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysEqTtextTextPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysEqTtextTextPhysicalFunction.hpp index bb18e0e23b..f58e263aaa 100644 --- a/nes-physical-operators/include/Functions/Meos/AlwaysEqTtextTextPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/AlwaysEqTtextTextPhysicalFunction.hpp @@ -21,16 +21,23 @@ namespace NES { +/** + * @brief Physical operator for `always_eq_ttext_text(temp, txt0)`. + * + * Always eqqual ttext vs text + * + * Generated by tools/codegen/codegen_nebula.py. + */ class AlwaysEqTtextTextPhysicalFunction : public PhysicalFunctionConcept { public: AlwaysEqTtextTextPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction refFunction, - PhysicalFunction tsFunction); + PhysicalFunction tsFunction, + PhysicalFunction arg0Function); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysGeBigintTbigintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysGeBigintTbigintPhysicalFunction.hpp index 6273862456..985f52e63d 100644 --- a/nes-physical-operators/include/Functions/Meos/AlwaysGeBigintTbigintPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/AlwaysGeBigintTbigintPhysicalFunction.hpp @@ -24,15 +24,15 @@ namespace NES { /** * @brief Physical operator for `always_ge_bigint_tbigint`. * - * Per-event always_ge_bigint_tbigint: tests if a single-instant tfloat value ever equals a threshold. + * Per-event always_ge_bigint_tbigint: always-greater-or-equal scalar bigint vs tbigint. * * Generated by tools/codegen/codegen_nebula.py. */ class AlwaysGeBigintTbigintPhysicalFunction : public PhysicalFunctionConcept { public: - AlwaysGeBigintTbigintPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction thresholdFunction, - PhysicalFunction tsFunction); + AlwaysGeBigintTbigintPhysicalFunction(PhysicalFunction arg0Function, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysGeTbigintBigintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysGeTbigintBigintPhysicalFunction.hpp index 696a10033e..5f1625715e 100644 --- a/nes-physical-operators/include/Functions/Meos/AlwaysGeTbigintBigintPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/AlwaysGeTbigintBigintPhysicalFunction.hpp @@ -24,15 +24,15 @@ namespace NES { /** * @brief Physical operator for `always_ge_tbigint_bigint`. * - * Per-event always_ge_tbigint_bigint: tests if a single-instant tbigint value always ges a threshold. + * Per-event always_ge_tbigint_bigint: always-greater-or-equal tbigint vs scalar bigint. * * Generated by tools/codegen/codegen_nebula.py. */ class AlwaysGeTbigintBigintPhysicalFunction : public PhysicalFunctionConcept { public: AlwaysGeTbigintBigintPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction thresholdFunction, - PhysicalFunction tsFunction); + PhysicalFunction tsFunction, + PhysicalFunction arg0Function); VarVal execute(const Record& record, ArenaRef& arena) const override; diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysGeTextTtextPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysGeTextTtextPhysicalFunction.hpp index af0e9f151f..dfdf90b0a0 100644 --- a/nes-physical-operators/include/Functions/Meos/AlwaysGeTextTtextPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/AlwaysGeTextTtextPhysicalFunction.hpp @@ -21,16 +21,23 @@ namespace NES { +/** + * @brief Physical operator for `always_ge_text_ttext(txt0, temp)`. + * + * Always gequal text vs ttext + * + * Generated by tools/codegen/codegen_nebula.py. + */ class AlwaysGeTextTtextPhysicalFunction : public PhysicalFunctionConcept { public: - AlwaysGeTextTtextPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction refFunction, - PhysicalFunction tsFunction); + AlwaysGeTextTtextPhysicalFunction(PhysicalFunction arg0Function, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysGeTtextTextPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysGeTtextTextPhysicalFunction.hpp index 532634173a..333420c1f7 100644 --- a/nes-physical-operators/include/Functions/Meos/AlwaysGeTtextTextPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/AlwaysGeTtextTextPhysicalFunction.hpp @@ -21,16 +21,23 @@ namespace NES { +/** + * @brief Physical operator for `always_ge_ttext_text(temp, txt0)`. + * + * Always gequal ttext vs text + * + * Generated by tools/codegen/codegen_nebula.py. + */ class AlwaysGeTtextTextPhysicalFunction : public PhysicalFunctionConcept { public: AlwaysGeTtextTextPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction refFunction, - PhysicalFunction tsFunction); + PhysicalFunction tsFunction, + PhysicalFunction arg0Function); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysGtBigintTbigintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysGtBigintTbigintPhysicalFunction.hpp index 837f31024b..7e396029d5 100644 --- a/nes-physical-operators/include/Functions/Meos/AlwaysGtBigintTbigintPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/AlwaysGtBigintTbigintPhysicalFunction.hpp @@ -24,15 +24,15 @@ namespace NES { /** * @brief Physical operator for `always_gt_bigint_tbigint`. * - * Per-event always_gt_bigint_tbigint: tests if a single-instant tfloat value ever equals a threshold. + * Per-event always_gt_bigint_tbigint: always-greater-than scalar bigint vs tbigint. * * Generated by tools/codegen/codegen_nebula.py. */ class AlwaysGtBigintTbigintPhysicalFunction : public PhysicalFunctionConcept { public: - AlwaysGtBigintTbigintPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction thresholdFunction, - PhysicalFunction tsFunction); + AlwaysGtBigintTbigintPhysicalFunction(PhysicalFunction arg0Function, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysGtTbigintBigintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysGtTbigintBigintPhysicalFunction.hpp index 057d173cb8..1d33f42648 100644 --- a/nes-physical-operators/include/Functions/Meos/AlwaysGtTbigintBigintPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/AlwaysGtTbigintBigintPhysicalFunction.hpp @@ -24,15 +24,15 @@ namespace NES { /** * @brief Physical operator for `always_gt_tbigint_bigint`. * - * Per-event always_gt_tbigint_bigint: tests if a single-instant tbigint value always gts a threshold. + * Per-event always_gt_tbigint_bigint: always-greater-than tbigint vs scalar bigint. * * Generated by tools/codegen/codegen_nebula.py. */ class AlwaysGtTbigintBigintPhysicalFunction : public PhysicalFunctionConcept { public: AlwaysGtTbigintBigintPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction thresholdFunction, - PhysicalFunction tsFunction); + PhysicalFunction tsFunction, + PhysicalFunction arg0Function); VarVal execute(const Record& record, ArenaRef& arena) const override; diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysGtTextTtextPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysGtTextTtextPhysicalFunction.hpp index bfd56b4d06..0b229a2be4 100644 --- a/nes-physical-operators/include/Functions/Meos/AlwaysGtTextTtextPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/AlwaysGtTextTtextPhysicalFunction.hpp @@ -21,16 +21,23 @@ namespace NES { +/** + * @brief Physical operator for `always_gt_text_ttext(txt0, temp)`. + * + * Always gtqual text vs ttext + * + * Generated by tools/codegen/codegen_nebula.py. + */ class AlwaysGtTextTtextPhysicalFunction : public PhysicalFunctionConcept { public: - AlwaysGtTextTtextPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction refFunction, - PhysicalFunction tsFunction); + AlwaysGtTextTtextPhysicalFunction(PhysicalFunction arg0Function, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysGtTtextTextPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysGtTtextTextPhysicalFunction.hpp index 0eefe82b23..42f2e70872 100644 --- a/nes-physical-operators/include/Functions/Meos/AlwaysGtTtextTextPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/AlwaysGtTtextTextPhysicalFunction.hpp @@ -21,16 +21,23 @@ namespace NES { +/** + * @brief Physical operator for `always_gt_ttext_text(temp, txt0)`. + * + * Always gtqual ttext vs text + * + * Generated by tools/codegen/codegen_nebula.py. + */ class AlwaysGtTtextTextPhysicalFunction : public PhysicalFunctionConcept { public: AlwaysGtTtextTextPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction refFunction, - PhysicalFunction tsFunction); + PhysicalFunction tsFunction, + PhysicalFunction arg0Function); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysLeBigintTbigintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysLeBigintTbigintPhysicalFunction.hpp index b03bae0e62..e135c26591 100644 --- a/nes-physical-operators/include/Functions/Meos/AlwaysLeBigintTbigintPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/AlwaysLeBigintTbigintPhysicalFunction.hpp @@ -24,15 +24,15 @@ namespace NES { /** * @brief Physical operator for `always_le_bigint_tbigint`. * - * Per-event always_le_bigint_tbigint: tests if a single-instant tfloat value ever equals a threshold. + * Per-event always_le_bigint_tbigint: always-less-or-equal scalar bigint vs tbigint. * * Generated by tools/codegen/codegen_nebula.py. */ class AlwaysLeBigintTbigintPhysicalFunction : public PhysicalFunctionConcept { public: - AlwaysLeBigintTbigintPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction thresholdFunction, - PhysicalFunction tsFunction); + AlwaysLeBigintTbigintPhysicalFunction(PhysicalFunction arg0Function, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysLeTbigintBigintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysLeTbigintBigintPhysicalFunction.hpp index 7eaec26d2a..00edf025ee 100644 --- a/nes-physical-operators/include/Functions/Meos/AlwaysLeTbigintBigintPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/AlwaysLeTbigintBigintPhysicalFunction.hpp @@ -24,15 +24,15 @@ namespace NES { /** * @brief Physical operator for `always_le_tbigint_bigint`. * - * Per-event always_le_tbigint_bigint: tests if a single-instant tbigint value always les a threshold. + * Per-event always_le_tbigint_bigint: always-less-or-equal tbigint vs scalar bigint. * * Generated by tools/codegen/codegen_nebula.py. */ class AlwaysLeTbigintBigintPhysicalFunction : public PhysicalFunctionConcept { public: AlwaysLeTbigintBigintPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction thresholdFunction, - PhysicalFunction tsFunction); + PhysicalFunction tsFunction, + PhysicalFunction arg0Function); VarVal execute(const Record& record, ArenaRef& arena) const override; diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysLeTextTtextPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysLeTextTtextPhysicalFunction.hpp index 8926066803..d95da543e1 100644 --- a/nes-physical-operators/include/Functions/Meos/AlwaysLeTextTtextPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/AlwaysLeTextTtextPhysicalFunction.hpp @@ -21,16 +21,23 @@ namespace NES { +/** + * @brief Physical operator for `always_le_text_ttext(txt0, temp)`. + * + * Always lequal text vs ttext + * + * Generated by tools/codegen/codegen_nebula.py. + */ class AlwaysLeTextTtextPhysicalFunction : public PhysicalFunctionConcept { public: - AlwaysLeTextTtextPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction refFunction, - PhysicalFunction tsFunction); + AlwaysLeTextTtextPhysicalFunction(PhysicalFunction arg0Function, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysLeTtextTextPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysLeTtextTextPhysicalFunction.hpp index 0458033afd..26d29f3474 100644 --- a/nes-physical-operators/include/Functions/Meos/AlwaysLeTtextTextPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/AlwaysLeTtextTextPhysicalFunction.hpp @@ -21,16 +21,23 @@ namespace NES { +/** + * @brief Physical operator for `always_le_ttext_text(temp, txt0)`. + * + * Always lequal ttext vs text + * + * Generated by tools/codegen/codegen_nebula.py. + */ class AlwaysLeTtextTextPhysicalFunction : public PhysicalFunctionConcept { public: AlwaysLeTtextTextPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction refFunction, - PhysicalFunction tsFunction); + PhysicalFunction tsFunction, + PhysicalFunction arg0Function); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysLtBigintTbigintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysLtBigintTbigintPhysicalFunction.hpp index 111aa16311..1c0c55c291 100644 --- a/nes-physical-operators/include/Functions/Meos/AlwaysLtBigintTbigintPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/AlwaysLtBigintTbigintPhysicalFunction.hpp @@ -24,15 +24,15 @@ namespace NES { /** * @brief Physical operator for `always_lt_bigint_tbigint`. * - * Per-event always_lt_bigint_tbigint: tests if a single-instant tfloat value ever equals a threshold. + * Per-event always_lt_bigint_tbigint: always-less-than scalar bigint vs tbigint. * * Generated by tools/codegen/codegen_nebula.py. */ class AlwaysLtBigintTbigintPhysicalFunction : public PhysicalFunctionConcept { public: - AlwaysLtBigintTbigintPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction thresholdFunction, - PhysicalFunction tsFunction); + AlwaysLtBigintTbigintPhysicalFunction(PhysicalFunction arg0Function, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysLtTbigintBigintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysLtTbigintBigintPhysicalFunction.hpp index 576af1c9b3..6407656ff6 100644 --- a/nes-physical-operators/include/Functions/Meos/AlwaysLtTbigintBigintPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/AlwaysLtTbigintBigintPhysicalFunction.hpp @@ -24,15 +24,15 @@ namespace NES { /** * @brief Physical operator for `always_lt_tbigint_bigint`. * - * Per-event always_lt_tbigint_bigint: tests if a single-instant tbigint value always lts a threshold. + * Per-event always_lt_tbigint_bigint: always-less-than tbigint vs scalar bigint. * * Generated by tools/codegen/codegen_nebula.py. */ class AlwaysLtTbigintBigintPhysicalFunction : public PhysicalFunctionConcept { public: AlwaysLtTbigintBigintPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction thresholdFunction, - PhysicalFunction tsFunction); + PhysicalFunction tsFunction, + PhysicalFunction arg0Function); VarVal execute(const Record& record, ArenaRef& arena) const override; diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysLtTextTtextPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysLtTextTtextPhysicalFunction.hpp index d4f63548ce..3a97ea64a5 100644 --- a/nes-physical-operators/include/Functions/Meos/AlwaysLtTextTtextPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/AlwaysLtTextTtextPhysicalFunction.hpp @@ -21,16 +21,23 @@ namespace NES { +/** + * @brief Physical operator for `always_lt_text_ttext(txt0, temp)`. + * + * Always ltqual text vs ttext + * + * Generated by tools/codegen/codegen_nebula.py. + */ class AlwaysLtTextTtextPhysicalFunction : public PhysicalFunctionConcept { public: - AlwaysLtTextTtextPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction refFunction, - PhysicalFunction tsFunction); + AlwaysLtTextTtextPhysicalFunction(PhysicalFunction arg0Function, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysLtTtextTextPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysLtTtextTextPhysicalFunction.hpp index 9c3f5862d3..db750e9056 100644 --- a/nes-physical-operators/include/Functions/Meos/AlwaysLtTtextTextPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/AlwaysLtTtextTextPhysicalFunction.hpp @@ -21,16 +21,23 @@ namespace NES { +/** + * @brief Physical operator for `always_lt_ttext_text(temp, txt0)`. + * + * Always ltqual ttext vs text + * + * Generated by tools/codegen/codegen_nebula.py. + */ class AlwaysLtTtextTextPhysicalFunction : public PhysicalFunctionConcept { public: AlwaysLtTtextTextPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction refFunction, - PhysicalFunction tsFunction); + PhysicalFunction tsFunction, + PhysicalFunction arg0Function); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysNeBigintTbigintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysNeBigintTbigintPhysicalFunction.hpp index 1b3bccff1b..3ed21898f1 100644 --- a/nes-physical-operators/include/Functions/Meos/AlwaysNeBigintTbigintPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/AlwaysNeBigintTbigintPhysicalFunction.hpp @@ -24,15 +24,15 @@ namespace NES { /** * @brief Physical operator for `always_ne_bigint_tbigint`. * - * Per-event always_ne_bigint_tbigint: tests if a single-instant tfloat value ever equals a threshold. + * Per-event always_ne_bigint_tbigint: always-not-equal scalar bigint vs tbigint. * * Generated by tools/codegen/codegen_nebula.py. */ class AlwaysNeBigintTbigintPhysicalFunction : public PhysicalFunctionConcept { public: - AlwaysNeBigintTbigintPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction thresholdFunction, - PhysicalFunction tsFunction); + AlwaysNeBigintTbigintPhysicalFunction(PhysicalFunction arg0Function, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysNeBoolTboolPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysNeBoolTboolPhysicalFunction.hpp index deb38a50f1..a38e1f3ebe 100644 --- a/nes-physical-operators/include/Functions/Meos/AlwaysNeBoolTboolPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/AlwaysNeBoolTboolPhysicalFunction.hpp @@ -24,15 +24,15 @@ namespace NES { /** * @brief Physical operator for `always_ne_bool_tbool`. * - * Per-event always_ne_bool_tbool: tests if a single-instant tfloat value ever equals a threshold. + * Per-event always_ne_bool_tbool: always-not-equal scalar bool vs tbool. * * Generated by tools/codegen/codegen_nebula.py. */ class AlwaysNeBoolTboolPhysicalFunction : public PhysicalFunctionConcept { public: - AlwaysNeBoolTboolPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction thresholdFunction, - PhysicalFunction tsFunction); + AlwaysNeBoolTboolPhysicalFunction(PhysicalFunction arg0Function, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysNeNpointTnpointPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysNeNpointTnpointPhysicalFunction.hpp index 451ff1f286..73b1327947 100644 --- a/nes-physical-operators/include/Functions/Meos/AlwaysNeNpointTnpointPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/AlwaysNeNpointTnpointPhysicalFunction.hpp @@ -21,12 +21,25 @@ namespace NES { +/** + * @brief Physical operator for `always_ne_npoint_tnpoint`. + * + * Always ne npoint vs tnpoint + * + * Generated by tools/codegen/codegen_nebula.py. + */ class AlwaysNeNpointTnpointPhysicalFunction : public PhysicalFunctionConcept { public: - AlwaysNeNpointTnpointPhysicalFunction(PhysicalFunction rid_np, PhysicalFunction pos_np, PhysicalFunction rid_tp, PhysicalFunction pos_tp, PhysicalFunction ts); + AlwaysNeNpointTnpointPhysicalFunction(PhysicalFunction rid0Function, + PhysicalFunction frac0Function, + PhysicalFunction ridFunction, + PhysicalFunction fracFunction, + PhysicalFunction tsFunction); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysNePoseTposePhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysNePoseTposePhysicalFunction.hpp index 771235ac8a..3e33c5a606 100644 --- a/nes-physical-operators/include/Functions/Meos/AlwaysNePoseTposePhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/AlwaysNePoseTposePhysicalFunction.hpp @@ -21,12 +21,27 @@ namespace NES { +/** + * @brief Physical operator for `always_ne_pose_tpose`. + * + * Always ne pose vs tpose + * + * Generated by tools/codegen/codegen_nebula.py. + */ class AlwaysNePoseTposePhysicalFunction : public PhysicalFunctionConcept { public: - AlwaysNePoseTposePhysicalFunction(PhysicalFunction x2, PhysicalFunction y2, PhysicalFunction theta2, PhysicalFunction x, PhysicalFunction y, PhysicalFunction theta, PhysicalFunction ts); + AlwaysNePoseTposePhysicalFunction(PhysicalFunction px0Function, + PhysicalFunction py0Function, + PhysicalFunction ptheta0Function, + PhysicalFunction xFunction, + PhysicalFunction yFunction, + PhysicalFunction thetaFunction, + PhysicalFunction tsFunction); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysNeTbigintBigintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysNeTbigintBigintPhysicalFunction.hpp index 3841644db4..28e59efdd1 100644 --- a/nes-physical-operators/include/Functions/Meos/AlwaysNeTbigintBigintPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/AlwaysNeTbigintBigintPhysicalFunction.hpp @@ -24,15 +24,15 @@ namespace NES { /** * @brief Physical operator for `always_ne_tbigint_bigint`. * - * Per-event always_ne_tbigint_bigint: tests if a single-instant tbigint value always nes a threshold. + * Per-event always_ne_tbigint_bigint: always-not-equal tbigint vs scalar bigint. * * Generated by tools/codegen/codegen_nebula.py. */ class AlwaysNeTbigintBigintPhysicalFunction : public PhysicalFunctionConcept { public: AlwaysNeTbigintBigintPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction thresholdFunction, - PhysicalFunction tsFunction); + PhysicalFunction tsFunction, + PhysicalFunction arg0Function); VarVal execute(const Record& record, ArenaRef& arena) const override; diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysNeTboolBoolPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysNeTboolBoolPhysicalFunction.hpp index aa6c793541..6c40c2f2bd 100644 --- a/nes-physical-operators/include/Functions/Meos/AlwaysNeTboolBoolPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/AlwaysNeTboolBoolPhysicalFunction.hpp @@ -24,15 +24,15 @@ namespace NES { /** * @brief Physical operator for `always_ne_tbool_bool`. * - * Per-event always_ne_tbool_bool: tests if a single-instant tfloat value ever equals a threshold. + * Per-event always_ne_tbool_bool: always-not-equal tbool vs scalar bool. * * Generated by tools/codegen/codegen_nebula.py. */ class AlwaysNeTboolBoolPhysicalFunction : public PhysicalFunctionConcept { public: AlwaysNeTboolBoolPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction thresholdFunction, - PhysicalFunction tsFunction); + PhysicalFunction tsFunction, + PhysicalFunction arg0Function); VarVal execute(const Record& record, ArenaRef& arena) const override; diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysNeTcbufferTcbufferPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysNeTcbufferTcbufferPhysicalFunction.hpp index 19395bb0f1..cb3e61675d 100644 --- a/nes-physical-operators/include/Functions/Meos/AlwaysNeTcbufferTcbufferPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/AlwaysNeTcbufferTcbufferPhysicalFunction.hpp @@ -21,17 +21,28 @@ namespace NES { +/** + * @brief Physical operator for `always_ne_tcbuffer_tcbuffer`. + * + * Per-event always_ne_tcbuffer_tcbuffer spatial predicate. + * + * Generated by tools/codegen/codegen_nebula.py. + */ class AlwaysNeTcbufferTcbufferPhysicalFunction : public PhysicalFunctionConcept { public: - AlwaysNeTcbufferTcbufferPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction r1, - PhysicalFunction ts1, - PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction r2, - PhysicalFunction ts2); + AlwaysNeTcbufferTcbufferPhysicalFunction(PhysicalFunction lonAFunction, + PhysicalFunction latAFunction, + PhysicalFunction radiusAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction lonBFunction, + PhysicalFunction latBFunction, + PhysicalFunction radiusBFunction, + PhysicalFunction tsBFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysNeTextTtextPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysNeTextTtextPhysicalFunction.hpp index 30bb284e6d..6bd6577436 100644 --- a/nes-physical-operators/include/Functions/Meos/AlwaysNeTextTtextPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/AlwaysNeTextTtextPhysicalFunction.hpp @@ -21,16 +21,23 @@ namespace NES { +/** + * @brief Physical operator for `always_ne_text_ttext(txt0, temp)`. + * + * Always nequal text vs ttext + * + * Generated by tools/codegen/codegen_nebula.py. + */ class AlwaysNeTextTtextPhysicalFunction : public PhysicalFunctionConcept { public: - AlwaysNeTextTtextPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction refFunction, - PhysicalFunction tsFunction); + AlwaysNeTextTtextPhysicalFunction(PhysicalFunction arg0Function, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysNeTgeoGeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysNeTgeoGeoPhysicalFunction.hpp index e32cdf4c59..7ab3136875 100644 --- a/nes-physical-operators/include/Functions/Meos/AlwaysNeTgeoGeoPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/AlwaysNeTgeoGeoPhysicalFunction.hpp @@ -21,15 +21,24 @@ namespace NES { +/** + * @brief Physical operator for `always_ne_tgeo_geo`. + * + * Per-event always_ne_tgeo_geo spatial predicate. + * + * Generated by tools/codegen/codegen_nebula.py. + */ class AlwaysNeTgeoGeoPhysicalFunction : public PhysicalFunctionConcept { public: - AlwaysNeTgeoGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, - PhysicalFunction ts, PhysicalFunction wkt); + AlwaysNeTgeoGeoPhysicalFunction(PhysicalFunction lonFunction, + PhysicalFunction latFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysNeTgeoTgeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysNeTgeoTgeoPhysicalFunction.hpp index 888863999f..48d62e8259 100644 --- a/nes-physical-operators/include/Functions/Meos/AlwaysNeTgeoTgeoPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/AlwaysNeTgeoTgeoPhysicalFunction.hpp @@ -21,12 +21,26 @@ namespace NES { +/** + * @brief Physical operator for `always_ne_tgeo_tgeo`. + * + * Per-event always_ne_tgeo_tgeo spatial predicate. + * + * Generated by tools/codegen/codegen_nebula.py. + */ class AlwaysNeTgeoTgeoPhysicalFunction : public PhysicalFunctionConcept { public: - AlwaysNeTgeoTgeoPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction ts1, PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction ts2); + AlwaysNeTgeoTgeoPhysicalFunction(PhysicalFunction lonAFunction, + PhysicalFunction latAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction lonBFunction, + PhysicalFunction latBFunction, + PhysicalFunction tsBFunction); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysNeTh3indexH3indexPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysNeTh3indexH3indexPhysicalFunction.hpp index 1c46209d5f..51566aa1ac 100644 --- a/nes-physical-operators/include/Functions/Meos/AlwaysNeTh3indexH3indexPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/AlwaysNeTh3indexH3indexPhysicalFunction.hpp @@ -21,14 +21,23 @@ namespace NES { +/** + * @brief Physical operator for `always_ne_th3index_h3index(temp, (H3Index)arg0)`. + * + * Always neual th3index vs h3index + * + * Generated by tools/codegen/codegen_nebula.py. + */ class AlwaysNeTh3indexH3indexPhysicalFunction : public PhysicalFunctionConcept { public: - AlwaysNeTh3indexH3indexPhysicalFunction(PhysicalFunction cell, PhysicalFunction ts, PhysicalFunction target); + AlwaysNeTh3indexH3indexPhysicalFunction(PhysicalFunction cellFunction, + PhysicalFunction tsFunction, + PhysicalFunction arg0Function); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysNeTjsonbJsonbPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysNeTjsonbJsonbPhysicalFunction.hpp index 87c19495c7..e368496cf8 100644 --- a/nes-physical-operators/include/Functions/Meos/AlwaysNeTjsonbJsonbPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/AlwaysNeTjsonbJsonbPhysicalFunction.hpp @@ -21,12 +21,23 @@ namespace NES { +/** + * @brief Physical operator for `always_ne_tjsonb_jsonb`. + * + * Always neual tjsonb vs jsonb + * + * Generated by tools/codegen/codegen_nebula.py. + */ class AlwaysNeTjsonbJsonbPhysicalFunction : public PhysicalFunctionConcept { public: - AlwaysNeTjsonbJsonbPhysicalFunction(PhysicalFunction json_str, PhysicalFunction ts, PhysicalFunction target_json); + AlwaysNeTjsonbJsonbPhysicalFunction(PhysicalFunction json_strFunction, + PhysicalFunction tsFunction, + PhysicalFunction arg0Function); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysNeTjsonbTjsonbPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysNeTjsonbTjsonbPhysicalFunction.hpp index fb24860d65..5e9fa9b87f 100644 --- a/nes-physical-operators/include/Functions/Meos/AlwaysNeTjsonbTjsonbPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/AlwaysNeTjsonbTjsonbPhysicalFunction.hpp @@ -21,12 +21,24 @@ namespace NES { +/** + * @brief Physical operator for `always_ne_tjsonb_tjsonb`. + * + * Always neual tjsonb vs tjsonb + * + * Generated by tools/codegen/codegen_nebula.py. + */ class AlwaysNeTjsonbTjsonbPhysicalFunction : public PhysicalFunctionConcept { public: - AlwaysNeTjsonbTjsonbPhysicalFunction(PhysicalFunction json1, PhysicalFunction ts1, PhysicalFunction json2, PhysicalFunction ts2); + AlwaysNeTjsonbTjsonbPhysicalFunction(PhysicalFunction json_strFunction, + PhysicalFunction tsFunction, + PhysicalFunction json0Function, + PhysicalFunction ts0Function); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysNeTnpointNpointPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysNeTnpointNpointPhysicalFunction.hpp index e2e017c3af..0c418097c4 100644 --- a/nes-physical-operators/include/Functions/Meos/AlwaysNeTnpointNpointPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/AlwaysNeTnpointNpointPhysicalFunction.hpp @@ -21,12 +21,25 @@ namespace NES { +/** + * @brief Physical operator for `always_ne_tnpoint_npoint`. + * + * Always ne tnpoint vs npoint + * + * Generated by tools/codegen/codegen_nebula.py. + */ class AlwaysNeTnpointNpointPhysicalFunction : public PhysicalFunctionConcept { public: - AlwaysNeTnpointNpointPhysicalFunction(PhysicalFunction rid1, PhysicalFunction pos1, PhysicalFunction ts, PhysicalFunction rid2, PhysicalFunction pos2); + AlwaysNeTnpointNpointPhysicalFunction(PhysicalFunction ridFunction, + PhysicalFunction fracFunction, + PhysicalFunction tsFunction, + PhysicalFunction rid0Function, + PhysicalFunction frac0Function); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysNeTnpointTnpointPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysNeTnpointTnpointPhysicalFunction.hpp index f06db451c4..3bf2b90ecc 100644 --- a/nes-physical-operators/include/Functions/Meos/AlwaysNeTnpointTnpointPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/AlwaysNeTnpointTnpointPhysicalFunction.hpp @@ -21,13 +21,26 @@ namespace NES { +/** + * @brief Physical operator for `always_ne_tnpoint_tnpoint`. + * + * Always ne tnpoint vs tnpoint + * + * Generated by tools/codegen/codegen_nebula.py. + */ class AlwaysNeTnpointTnpointPhysicalFunction : public PhysicalFunctionConcept { public: - AlwaysNeTnpointTnpointPhysicalFunction(PhysicalFunction rid1, PhysicalFunction pos1, PhysicalFunction ts1, - PhysicalFunction rid2, PhysicalFunction pos2, PhysicalFunction ts2); + AlwaysNeTnpointTnpointPhysicalFunction(PhysicalFunction ridFunction, + PhysicalFunction fracFunction, + PhysicalFunction tsFunction, + PhysicalFunction rid0Function, + PhysicalFunction frac0Function, + PhysicalFunction ts0Function); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysNeTposePosePhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysNeTposePosePhysicalFunction.hpp index d5b11fc7bd..a2c7a88615 100644 --- a/nes-physical-operators/include/Functions/Meos/AlwaysNeTposePosePhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/AlwaysNeTposePosePhysicalFunction.hpp @@ -21,12 +21,27 @@ namespace NES { +/** + * @brief Physical operator for `always_ne_tpose_pose`. + * + * Always ne tpose vs pose + * + * Generated by tools/codegen/codegen_nebula.py. + */ class AlwaysNeTposePosePhysicalFunction : public PhysicalFunctionConcept { public: - AlwaysNeTposePosePhysicalFunction(PhysicalFunction x, PhysicalFunction y, PhysicalFunction theta, PhysicalFunction ts, PhysicalFunction x2, PhysicalFunction y2, PhysicalFunction theta2); + AlwaysNeTposePosePhysicalFunction(PhysicalFunction xFunction, + PhysicalFunction yFunction, + PhysicalFunction thetaFunction, + PhysicalFunction tsFunction, + PhysicalFunction px0Function, + PhysicalFunction py0Function, + PhysicalFunction ptheta0Function); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysNeTposeTposePhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysNeTposeTposePhysicalFunction.hpp index b31cf86f60..b38469b997 100644 --- a/nes-physical-operators/include/Functions/Meos/AlwaysNeTposeTposePhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/AlwaysNeTposeTposePhysicalFunction.hpp @@ -21,15 +21,28 @@ namespace NES { +/** + * @brief Physical operator for `always_ne_tpose_tpose`. + * + * Always ne tpose vs tpose + * + * Generated by tools/codegen/codegen_nebula.py. + */ class AlwaysNeTposeTposePhysicalFunction : public PhysicalFunctionConcept { public: - AlwaysNeTposeTposePhysicalFunction(PhysicalFunction x1, PhysicalFunction y1, PhysicalFunction theta1, - PhysicalFunction ts1, - PhysicalFunction x2, PhysicalFunction y2, PhysicalFunction theta2, - PhysicalFunction ts2); + AlwaysNeTposeTposePhysicalFunction(PhysicalFunction xFunction, + PhysicalFunction yFunction, + PhysicalFunction thetaFunction, + PhysicalFunction tsFunction, + PhysicalFunction px0Function, + PhysicalFunction py0Function, + PhysicalFunction ptheta0Function, + PhysicalFunction ts0Function); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysNeTquadbinQuadbinPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysNeTquadbinQuadbinPhysicalFunction.hpp index c2c47ae822..1e6cc01f0b 100644 --- a/nes-physical-operators/include/Functions/Meos/AlwaysNeTquadbinQuadbinPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/AlwaysNeTquadbinQuadbinPhysicalFunction.hpp @@ -21,12 +21,23 @@ namespace NES { +/** + * @brief Physical operator for `always_ne_tquadbin_quadbin(temp, (Quadbin)arg0)`. + * + * Always neual tquadbin vs quadbin + * + * Generated by tools/codegen/codegen_nebula.py. + */ class AlwaysNeTquadbinQuadbinPhysicalFunction : public PhysicalFunctionConcept { public: - AlwaysNeTquadbinQuadbinPhysicalFunction(PhysicalFunction inst_cell, PhysicalFunction ts, PhysicalFunction cell); + AlwaysNeTquadbinQuadbinPhysicalFunction(PhysicalFunction cellFunction, + PhysicalFunction tsFunction, + PhysicalFunction arg0Function); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AlwaysNeTtextTextPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AlwaysNeTtextTextPhysicalFunction.hpp index 22d74b1704..d40d60e95c 100644 --- a/nes-physical-operators/include/Functions/Meos/AlwaysNeTtextTextPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/AlwaysNeTtextTextPhysicalFunction.hpp @@ -21,16 +21,23 @@ namespace NES { +/** + * @brief Physical operator for `always_ne_ttext_text(temp, txt0)`. + * + * Always nequal ttext vs text + * + * Generated by tools/codegen/codegen_nebula.py. + */ class AlwaysNeTtextTextPhysicalFunction : public PhysicalFunctionConcept { public: AlwaysNeTtextTextPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction refFunction, - PhysicalFunction tsFunction); + PhysicalFunction tsFunction, + PhysicalFunction arg0Function); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AtouchesTcbufferGeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AtouchesTcbufferGeoPhysicalFunction.hpp index 174402845a..89b2da8e47 100644 --- a/nes-physical-operators/include/Functions/Meos/AtouchesTcbufferGeoPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/AtouchesTcbufferGeoPhysicalFunction.hpp @@ -21,16 +21,25 @@ namespace NES { +/** + * @brief Physical operator for `atouches_tcbuffer_geo`. + * + * Per-event atouches_tcbuffer_geo spatial predicate. + * + * Generated by tools/codegen/codegen_nebula.py. + */ class AtouchesTcbufferGeoPhysicalFunction : public PhysicalFunctionConcept { public: - AtouchesTcbufferGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, - PhysicalFunction radius, PhysicalFunction ts, - PhysicalFunction wkt); + AtouchesTcbufferGeoPhysicalFunction(PhysicalFunction lonFunction, + PhysicalFunction latFunction, + PhysicalFunction radiusFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AtouchesTcbufferTcbufferPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AtouchesTcbufferTcbufferPhysicalFunction.hpp index f1d60816f4..f27c490e4c 100644 --- a/nes-physical-operators/include/Functions/Meos/AtouchesTcbufferTcbufferPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/AtouchesTcbufferTcbufferPhysicalFunction.hpp @@ -21,17 +21,28 @@ namespace NES { +/** + * @brief Physical operator for `atouches_tcbuffer_tcbuffer`. + * + * Per-event atouches_tcbuffer_tcbuffer spatial predicate. + * + * Generated by tools/codegen/codegen_nebula.py. + */ class AtouchesTcbufferTcbufferPhysicalFunction : public PhysicalFunctionConcept { public: - AtouchesTcbufferTcbufferPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction r1, - PhysicalFunction ts1, - PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction r2, - PhysicalFunction ts2); + AtouchesTcbufferTcbufferPhysicalFunction(PhysicalFunction lonAFunction, + PhysicalFunction latAFunction, + PhysicalFunction radiusAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction lonBFunction, + PhysicalFunction latBFunction, + PhysicalFunction radiusBFunction, + PhysicalFunction tsBFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AtouchesTgeoGeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AtouchesTgeoGeoPhysicalFunction.hpp index 7cf0d71d4c..5f487d025b 100644 --- a/nes-physical-operators/include/Functions/Meos/AtouchesTgeoGeoPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/AtouchesTgeoGeoPhysicalFunction.hpp @@ -21,15 +21,24 @@ namespace NES { +/** + * @brief Physical operator for `atouches_tgeo_geo`. + * + * Per-event atouches_tgeo_geo spatial predicate. + * + * Generated by tools/codegen/codegen_nebula.py. + */ class AtouchesTgeoGeoPhysicalFunction : public PhysicalFunctionConcept { public: - AtouchesTgeoGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, - PhysicalFunction ts, PhysicalFunction wkt); + AtouchesTgeoGeoPhysicalFunction(PhysicalFunction lonFunction, + PhysicalFunction latFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AtouchesTgeoTgeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AtouchesTgeoTgeoPhysicalFunction.hpp index f4f472222d..9a89ad2e6e 100644 --- a/nes-physical-operators/include/Functions/Meos/AtouchesTgeoTgeoPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/AtouchesTgeoTgeoPhysicalFunction.hpp @@ -21,12 +21,26 @@ namespace NES { +/** + * @brief Physical operator for `atouches_tgeo_tgeo`. + * + * Per-event atouches_tgeo_tgeo spatial predicate. + * + * Generated by tools/codegen/codegen_nebula.py. + */ class AtouchesTgeoTgeoPhysicalFunction : public PhysicalFunctionConcept { public: - AtouchesTgeoTgeoPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction ts1, PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction ts2); + AtouchesTgeoTgeoPhysicalFunction(PhysicalFunction lonAFunction, + PhysicalFunction latAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction lonBFunction, + PhysicalFunction latBFunction, + PhysicalFunction tsBFunction); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/AtouchesTrgeometryGeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/AtouchesTrgeometryGeoPhysicalFunction.hpp new file mode 100644 index 0000000000..10bf0df47b --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/AtouchesTrgeometryGeoPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class AtouchesTrgeometryGeoPhysicalFunction : public PhysicalFunctionConcept { +public: + AtouchesTrgeometryGeoPhysicalFunction(PhysicalFunction ref_wkt, PhysicalFunction x1, PhysicalFunction y1, PhysicalFunction theta1, PhysicalFunction ts1, PhysicalFunction tgt_wkt); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/ContainedFloatSpanPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/ContainedFloatSpanPhysicalFunction.hpp index aa96e932db..8025ed4cab 100644 --- a/nes-physical-operators/include/Functions/Meos/ContainedFloatSpanPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/ContainedFloatSpanPhysicalFunction.hpp @@ -21,12 +21,22 @@ namespace NES { +/** + * @brief Physical operator for `contained_float_span(arg0, temp)`. + * + * Float contained in span + * + * Generated by tools/codegen/codegen_nebula.py. + */ class ContainedFloatSpanPhysicalFunction : public PhysicalFunctionConcept { public: - ContainedFloatSpanPhysicalFunction(PhysicalFunction val, PhysicalFunction sp); + ContainedFloatSpanPhysicalFunction(PhysicalFunction arg0Function, + PhysicalFunction spFunction); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/ContainedFloatspanSpanPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/ContainedFloatspanSpanPhysicalFunction.hpp index 497932d8e5..54625b5b6f 100644 --- a/nes-physical-operators/include/Functions/Meos/ContainedFloatspanSpanPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/ContainedFloatspanSpanPhysicalFunction.hpp @@ -21,12 +21,22 @@ namespace NES { +/** + * @brief Physical operator for `contained_span_span(temp, sp0)`. + * + * Floatspan contained in floatspan + * + * Generated by tools/codegen/codegen_nebula.py. + */ class ContainedFloatspanSpanPhysicalFunction : public PhysicalFunctionConcept { public: - ContainedFloatspanSpanPhysicalFunction(PhysicalFunction sp1, PhysicalFunction sp2); + ContainedFloatspanSpanPhysicalFunction(PhysicalFunction spFunction, + PhysicalFunction arg0Function); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/ContainedIntSpanPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/ContainedIntSpanPhysicalFunction.hpp index a552bc08f5..47db35bf37 100644 --- a/nes-physical-operators/include/Functions/Meos/ContainedIntSpanPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/ContainedIntSpanPhysicalFunction.hpp @@ -21,12 +21,22 @@ namespace NES { +/** + * @brief Physical operator for `contained_int_span((int)arg0, temp)`. + * + * Int contained in span + * + * Generated by tools/codegen/codegen_nebula.py. + */ class ContainedIntSpanPhysicalFunction : public PhysicalFunctionConcept { public: - ContainedIntSpanPhysicalFunction(PhysicalFunction val, PhysicalFunction sp); + ContainedIntSpanPhysicalFunction(PhysicalFunction arg0Function, + PhysicalFunction spFunction); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/ContainedSpanSpanPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/ContainedSpanSpanPhysicalFunction.hpp index c330b5ce9f..91c0f47613 100644 --- a/nes-physical-operators/include/Functions/Meos/ContainedSpanSpanPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/ContainedSpanSpanPhysicalFunction.hpp @@ -21,12 +21,22 @@ namespace NES { +/** + * @brief Physical operator for `contained_span_span(temp, sp0)`. + * + * Intspan contained in intspan + * + * Generated by tools/codegen/codegen_nebula.py. + */ class ContainedSpanSpanPhysicalFunction : public PhysicalFunctionConcept { public: - ContainedSpanSpanPhysicalFunction(PhysicalFunction sp1, PhysicalFunction sp2); + ContainedSpanSpanPhysicalFunction(PhysicalFunction spFunction, + PhysicalFunction arg0Function); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/ContainsFloatspanSpanPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/ContainsFloatspanSpanPhysicalFunction.hpp index ea6a55abd1..291ce94d76 100644 --- a/nes-physical-operators/include/Functions/Meos/ContainsFloatspanSpanPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/ContainsFloatspanSpanPhysicalFunction.hpp @@ -21,12 +21,22 @@ namespace NES { +/** + * @brief Physical operator for `contains_span_span(temp, sp0)`. + * + * Floatspan contains floatspan + * + * Generated by tools/codegen/codegen_nebula.py. + */ class ContainsFloatspanSpanPhysicalFunction : public PhysicalFunctionConcept { public: - ContainsFloatspanSpanPhysicalFunction(PhysicalFunction sp1, PhysicalFunction sp2); + ContainsFloatspanSpanPhysicalFunction(PhysicalFunction spFunction, + PhysicalFunction arg0Function); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/ContainsSpanFloatPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/ContainsSpanFloatPhysicalFunction.hpp index 721f0426a2..5a5bc31101 100644 --- a/nes-physical-operators/include/Functions/Meos/ContainsSpanFloatPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/ContainsSpanFloatPhysicalFunction.hpp @@ -21,12 +21,22 @@ namespace NES { +/** + * @brief Physical operator for `contains_span_float(temp, arg0)`. + * + * Floatspan contains float + * + * Generated by tools/codegen/codegen_nebula.py. + */ class ContainsSpanFloatPhysicalFunction : public PhysicalFunctionConcept { public: - ContainsSpanFloatPhysicalFunction(PhysicalFunction sp, PhysicalFunction val); + ContainsSpanFloatPhysicalFunction(PhysicalFunction spFunction, + PhysicalFunction arg0Function); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/ContainsSpanIntPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/ContainsSpanIntPhysicalFunction.hpp index b14d09beb7..1f8d0383ee 100644 --- a/nes-physical-operators/include/Functions/Meos/ContainsSpanIntPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/ContainsSpanIntPhysicalFunction.hpp @@ -21,12 +21,22 @@ namespace NES { +/** + * @brief Physical operator for `contains_span_int(temp, (int)arg0)`. + * + * Intspan contains int + * + * Generated by tools/codegen/codegen_nebula.py. + */ class ContainsSpanIntPhysicalFunction : public PhysicalFunctionConcept { public: - ContainsSpanIntPhysicalFunction(PhysicalFunction sp, PhysicalFunction val); + ContainsSpanIntPhysicalFunction(PhysicalFunction spFunction, + PhysicalFunction arg0Function); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/ContainsSpanSpanPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/ContainsSpanSpanPhysicalFunction.hpp index 48988e61a4..2983f7460a 100644 --- a/nes-physical-operators/include/Functions/Meos/ContainsSpanSpanPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/ContainsSpanSpanPhysicalFunction.hpp @@ -21,12 +21,22 @@ namespace NES { +/** + * @brief Physical operator for `contains_span_span(temp, sp0)`. + * + * Intspan contains intspan + * + * Generated by tools/codegen/codegen_nebula.py. + */ class ContainsSpanSpanPhysicalFunction : public PhysicalFunctionConcept { public: - ContainsSpanSpanPhysicalFunction(PhysicalFunction sp1, PhysicalFunction sp2); + ContainsSpanSpanPhysicalFunction(PhysicalFunction spFunction, + PhysicalFunction arg0Function); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/DivBigintTbigintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/DivBigintTbigintPhysicalFunction.hpp index 388ea20550..cecc3180b5 100644 --- a/nes-physical-operators/include/Functions/Meos/DivBigintTbigintPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/DivBigintTbigintPhysicalFunction.hpp @@ -24,15 +24,15 @@ namespace NES { /** * @brief Physical operator for `div_bigint_tbigint`. * - * Per-event div_bigint_tbigint: divides a constant int64 scalar by a single-instant tbigint value. + * Per-event div_bigint_tbigint: scalar bigint divided by single-instant tbigint. * * Generated by tools/codegen/codegen_nebula.py. */ class DivBigintTbigintPhysicalFunction : public PhysicalFunctionConcept { public: - DivBigintTbigintPhysicalFunction(PhysicalFunction scalarFunction, - PhysicalFunction valueFunction, - PhysicalFunction tsFunction); + DivBigintTbigintPhysicalFunction(PhysicalFunction arg0Function, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; diff --git a/nes-physical-operators/include/Functions/Meos/DivFloatTfloatPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/DivFloatTfloatPhysicalFunction.hpp index 3ac3044b9b..8e32e22111 100644 --- a/nes-physical-operators/include/Functions/Meos/DivFloatTfloatPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/DivFloatTfloatPhysicalFunction.hpp @@ -24,15 +24,15 @@ namespace NES { /** * @brief Physical operator for `div_float_tfloat`. * - * Per-event div_float_tfloat: divides a constant by a single-instant tfloat value. + * Per-event div_float_tfloat: scalar float divided by single-instant tfloat. * * Generated by tools/codegen/codegen_nebula.py. */ class DivFloatTfloatPhysicalFunction : public PhysicalFunctionConcept { public: - DivFloatTfloatPhysicalFunction(PhysicalFunction scalarFunction, - PhysicalFunction valueFunction, - PhysicalFunction tsFunction); + DivFloatTfloatPhysicalFunction(PhysicalFunction arg0Function, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; diff --git a/nes-physical-operators/include/Functions/Meos/DivIntTintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/DivIntTintPhysicalFunction.hpp index e368a96708..4523f91b00 100644 --- a/nes-physical-operators/include/Functions/Meos/DivIntTintPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/DivIntTintPhysicalFunction.hpp @@ -24,15 +24,15 @@ namespace NES { /** * @brief Physical operator for `div_int_tint`. * - * Per-event div_int_tint: divides a constant by a single-instant tint value. + * Per-event div_int_tint: scalar int divided by single-instant tint. * * Generated by tools/codegen/codegen_nebula.py. */ class DivIntTintPhysicalFunction : public PhysicalFunctionConcept { public: - DivIntTintPhysicalFunction(PhysicalFunction scalarFunction, - PhysicalFunction valueFunction, - PhysicalFunction tsFunction); + DivIntTintPhysicalFunction(PhysicalFunction arg0Function, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; diff --git a/nes-physical-operators/include/Functions/Meos/DivTbigintBigintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/DivTbigintBigintPhysicalFunction.hpp index aafdd6ad39..c7e5d35ef6 100644 --- a/nes-physical-operators/include/Functions/Meos/DivTbigintBigintPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/DivTbigintBigintPhysicalFunction.hpp @@ -24,15 +24,15 @@ namespace NES { /** * @brief Physical operator for `div_tbigint_bigint`. * - * Per-event div_tbigint_bigint: divides a single-instant tbigint value by a constant int64. + * Per-event div_tbigint_bigint: single-instant tbigint divided by scalar bigint. * * Generated by tools/codegen/codegen_nebula.py. */ class DivTbigintBigintPhysicalFunction : public PhysicalFunctionConcept { public: DivTbigintBigintPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction tsFunction, - PhysicalFunction divisorFunction); + PhysicalFunction tsFunction, + PhysicalFunction arg0Function); VarVal execute(const Record& record, ArenaRef& arena) const override; diff --git a/nes-physical-operators/include/Functions/Meos/DivTfloatFloatPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/DivTfloatFloatPhysicalFunction.hpp index c221eba2e9..a4b1303f6e 100644 --- a/nes-physical-operators/include/Functions/Meos/DivTfloatFloatPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/DivTfloatFloatPhysicalFunction.hpp @@ -24,15 +24,15 @@ namespace NES { /** * @brief Physical operator for `div_tfloat_float`. * - * Per-event div_tfloat_float: divides a single-instant tfloat value by a constant. + * Per-event div_tfloat_float: single-instant tfloat divided by scalar float. * * Generated by tools/codegen/codegen_nebula.py. */ class DivTfloatFloatPhysicalFunction : public PhysicalFunctionConcept { public: DivTfloatFloatPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction tsFunction, - PhysicalFunction divisorFunction); + PhysicalFunction tsFunction, + PhysicalFunction arg0Function); VarVal execute(const Record& record, ArenaRef& arena) const override; diff --git a/nes-physical-operators/include/Functions/Meos/DivTintIntPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/DivTintIntPhysicalFunction.hpp index 40c7f5a1a3..2c2794257a 100644 --- a/nes-physical-operators/include/Functions/Meos/DivTintIntPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/DivTintIntPhysicalFunction.hpp @@ -24,15 +24,15 @@ namespace NES { /** * @brief Physical operator for `div_tint_int`. * - * Per-event div_tint_int: divides a single-instant tint value by a constant integer. + * Per-event div_tint_int: single-instant tint divided by scalar int. * * Generated by tools/codegen/codegen_nebula.py. */ class DivTintIntPhysicalFunction : public PhysicalFunctionConcept { public: DivTintIntPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction tsFunction, - PhysicalFunction divisorFunction); + PhysicalFunction tsFunction, + PhysicalFunction arg0Function); VarVal execute(const Record& record, ArenaRef& arena) const override; diff --git a/nes-physical-operators/include/Functions/Meos/DivTnumberTnumberPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/DivTnumberTnumberPhysicalFunction.hpp index 3fde0ad5da..bbd6671ea4 100644 --- a/nes-physical-operators/include/Functions/Meos/DivTnumberTnumberPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/DivTnumberTnumberPhysicalFunction.hpp @@ -24,15 +24,14 @@ namespace NES { /** * @brief Physical operator for `div_tnumber_tnumber`. * - * Per-event element-wise division of two co-instant tnumbers. + * Per-event div_tnumber_tnumber: two temporal numbers divided (WKB result). * * Generated by tools/codegen/codegen_nebula.py. */ class DivTnumberTnumberPhysicalFunction : public PhysicalFunctionConcept { public: - DivTnumberTnumberPhysicalFunction(PhysicalFunction value1Function, - PhysicalFunction value2Function, - PhysicalFunction tsFunction); + DivTnumberTnumberPhysicalFunction(PhysicalFunction trajFunction, + PhysicalFunction arg0Function); VarVal execute(const Record& record, ArenaRef& arena) const override; diff --git a/nes-physical-operators/include/Functions/Meos/EcontainsGeoTrgeometryPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EcontainsGeoTrgeometryPhysicalFunction.hpp new file mode 100644 index 0000000000..1c829c0fa7 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EcontainsGeoTrgeometryPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class EcontainsGeoTrgeometryPhysicalFunction : public PhysicalFunctionConcept { +public: + EcontainsGeoTrgeometryPhysicalFunction(PhysicalFunction tgt_wkt, PhysicalFunction ref_wkt, PhysicalFunction x1, PhysicalFunction y1, PhysicalFunction theta1, PhysicalFunction ts1); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EcontainsTcbufferGeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EcontainsTcbufferGeoPhysicalFunction.hpp index 8eaa930500..105b252184 100644 --- a/nes-physical-operators/include/Functions/Meos/EcontainsTcbufferGeoPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/EcontainsTcbufferGeoPhysicalFunction.hpp @@ -21,16 +21,25 @@ namespace NES { +/** + * @brief Physical operator for `econtains_tcbuffer_geo`. + * + * Per-event econtains_tcbuffer_geo spatial predicate. + * + * Generated by tools/codegen/codegen_nebula.py. + */ class EcontainsTcbufferGeoPhysicalFunction : public PhysicalFunctionConcept { public: - EcontainsTcbufferGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, - PhysicalFunction radius, PhysicalFunction ts, - PhysicalFunction wkt); + EcontainsTcbufferGeoPhysicalFunction(PhysicalFunction lonFunction, + PhysicalFunction latFunction, + PhysicalFunction radiusFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EcontainsTcbufferTcbufferPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EcontainsTcbufferTcbufferPhysicalFunction.hpp new file mode 100644 index 0000000000..78ac97beff --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EcontainsTcbufferTcbufferPhysicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `econtains_tcbuffer_tcbuffer`. + * + * Per-event econtains_tcbuffer_tcbuffer spatial predicate. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class EcontainsTcbufferTcbufferPhysicalFunction : public PhysicalFunctionConcept { +public: + EcontainsTcbufferTcbufferPhysicalFunction(PhysicalFunction lonAFunction, + PhysicalFunction latAFunction, + PhysicalFunction radiusAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction lonBFunction, + PhysicalFunction latBFunction, + PhysicalFunction radiusBFunction, + PhysicalFunction tsBFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EcontainsTgeoGeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EcontainsTgeoGeoPhysicalFunction.hpp index 72918a88c2..f13345478d 100644 --- a/nes-physical-operators/include/Functions/Meos/EcontainsTgeoGeoPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/EcontainsTgeoGeoPhysicalFunction.hpp @@ -21,15 +21,24 @@ namespace NES { +/** + * @brief Physical operator for `econtains_tgeo_geo`. + * + * Per-event econtains_tgeo_geo spatial predicate. + * + * Generated by tools/codegen/codegen_nebula.py. + */ class EcontainsTgeoGeoPhysicalFunction : public PhysicalFunctionConcept { public: - EcontainsTgeoGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, - PhysicalFunction ts, PhysicalFunction wkt); + EcontainsTgeoGeoPhysicalFunction(PhysicalFunction lonFunction, + PhysicalFunction latFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EcontainsTgeoTgeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EcontainsTgeoTgeoPhysicalFunction.hpp index 56f7b49cc8..cc2c39cf63 100644 --- a/nes-physical-operators/include/Functions/Meos/EcontainsTgeoTgeoPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/EcontainsTgeoTgeoPhysicalFunction.hpp @@ -21,12 +21,26 @@ namespace NES { +/** + * @brief Physical operator for `econtains_tgeo_tgeo`. + * + * Per-event econtains_tgeo_tgeo spatial predicate. + * + * Generated by tools/codegen/codegen_nebula.py. + */ class EcontainsTgeoTgeoPhysicalFunction : public PhysicalFunctionConcept { public: - EcontainsTgeoTgeoPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction ts1, PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction ts2); + EcontainsTgeoTgeoPhysicalFunction(PhysicalFunction lonAFunction, + PhysicalFunction latAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction lonBFunction, + PhysicalFunction latBFunction, + PhysicalFunction tsBFunction); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EcoversGeoTrgeometryPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EcoversGeoTrgeometryPhysicalFunction.hpp new file mode 100644 index 0000000000..33c2d73ef4 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EcoversGeoTrgeometryPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class EcoversGeoTrgeometryPhysicalFunction : public PhysicalFunctionConcept { +public: + EcoversGeoTrgeometryPhysicalFunction(PhysicalFunction tgt_wkt, PhysicalFunction ref_wkt, PhysicalFunction x1, PhysicalFunction y1, PhysicalFunction theta1, PhysicalFunction ts1); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EcoversTcbufferGeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EcoversTcbufferGeoPhysicalFunction.hpp index 2c5c6953a3..bce039152e 100644 --- a/nes-physical-operators/include/Functions/Meos/EcoversTcbufferGeoPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/EcoversTcbufferGeoPhysicalFunction.hpp @@ -21,16 +21,25 @@ namespace NES { +/** + * @brief Physical operator for `ecovers_tcbuffer_geo`. + * + * Per-event ecovers_tcbuffer_geo spatial predicate. + * + * Generated by tools/codegen/codegen_nebula.py. + */ class EcoversTcbufferGeoPhysicalFunction : public PhysicalFunctionConcept { public: - EcoversTcbufferGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, - PhysicalFunction radius, PhysicalFunction ts, - PhysicalFunction wkt); + EcoversTcbufferGeoPhysicalFunction(PhysicalFunction lonFunction, + PhysicalFunction latFunction, + PhysicalFunction radiusFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EcoversTcbufferTcbufferPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EcoversTcbufferTcbufferPhysicalFunction.hpp index ebd234cb88..3653ea5ed6 100644 --- a/nes-physical-operators/include/Functions/Meos/EcoversTcbufferTcbufferPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/EcoversTcbufferTcbufferPhysicalFunction.hpp @@ -21,17 +21,28 @@ namespace NES { +/** + * @brief Physical operator for `ecovers_tcbuffer_tcbuffer`. + * + * Per-event ecovers_tcbuffer_tcbuffer spatial predicate. + * + * Generated by tools/codegen/codegen_nebula.py. + */ class EcoversTcbufferTcbufferPhysicalFunction : public PhysicalFunctionConcept { public: - EcoversTcbufferTcbufferPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction r1, - PhysicalFunction ts1, - PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction r2, - PhysicalFunction ts2); + EcoversTcbufferTcbufferPhysicalFunction(PhysicalFunction lonAFunction, + PhysicalFunction latAFunction, + PhysicalFunction radiusAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction lonBFunction, + PhysicalFunction latBFunction, + PhysicalFunction radiusBFunction, + PhysicalFunction tsBFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EcoversTgeoGeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EcoversTgeoGeoPhysicalFunction.hpp new file mode 100644 index 0000000000..ba916b5cb6 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EcoversTgeoGeoPhysicalFunction.hpp @@ -0,0 +1,44 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `ecovers_tgeo_geo`. + * + * Per-event ecovers_tgeo_geo spatial predicate. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class EcoversTgeoGeoPhysicalFunction : public PhysicalFunctionConcept { +public: + EcoversTgeoGeoPhysicalFunction(PhysicalFunction lonFunction, + PhysicalFunction latFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EcoversTgeoTgeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EcoversTgeoTgeoPhysicalFunction.hpp index 28b70fad9b..f59f49d41b 100644 --- a/nes-physical-operators/include/Functions/Meos/EcoversTgeoTgeoPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/EcoversTgeoTgeoPhysicalFunction.hpp @@ -21,12 +21,26 @@ namespace NES { +/** + * @brief Physical operator for `ecovers_tgeo_tgeo`. + * + * Per-event ecovers_tgeo_tgeo spatial predicate. + * + * Generated by tools/codegen/codegen_nebula.py. + */ class EcoversTgeoTgeoPhysicalFunction : public PhysicalFunctionConcept { public: - EcoversTgeoTgeoPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction ts1, PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction ts2); + EcoversTgeoTgeoPhysicalFunction(PhysicalFunction lonAFunction, + PhysicalFunction latAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction lonBFunction, + PhysicalFunction latBFunction, + PhysicalFunction tsBFunction); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EcoversTrgeometryGeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EcoversTrgeometryGeoPhysicalFunction.hpp new file mode 100644 index 0000000000..706faff086 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EcoversTrgeometryGeoPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class EcoversTrgeometryGeoPhysicalFunction : public PhysicalFunctionConcept { +public: + EcoversTrgeometryGeoPhysicalFunction(PhysicalFunction ref_wkt, PhysicalFunction x1, PhysicalFunction y1, PhysicalFunction theta1, PhysicalFunction ts1, PhysicalFunction tgt_wkt); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EdisjointTcbufferGeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EdisjointTcbufferGeoPhysicalFunction.hpp index 140e6a0e98..a2fb5ee8fd 100644 --- a/nes-physical-operators/include/Functions/Meos/EdisjointTcbufferGeoPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/EdisjointTcbufferGeoPhysicalFunction.hpp @@ -21,16 +21,25 @@ namespace NES { +/** + * @brief Physical operator for `edisjoint_tcbuffer_geo`. + * + * Per-event edisjoint_tcbuffer_geo spatial predicate. + * + * Generated by tools/codegen/codegen_nebula.py. + */ class EdisjointTcbufferGeoPhysicalFunction : public PhysicalFunctionConcept { public: - EdisjointTcbufferGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, - PhysicalFunction radius, PhysicalFunction ts, - PhysicalFunction wkt); + EdisjointTcbufferGeoPhysicalFunction(PhysicalFunction lonFunction, + PhysicalFunction latFunction, + PhysicalFunction radiusFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EdisjointTcbufferTcbufferPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EdisjointTcbufferTcbufferPhysicalFunction.hpp new file mode 100644 index 0000000000..f32df866a0 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EdisjointTcbufferTcbufferPhysicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `edisjoint_tcbuffer_tcbuffer`. + * + * Per-event edisjoint_tcbuffer_tcbuffer spatial predicate. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class EdisjointTcbufferTcbufferPhysicalFunction : public PhysicalFunctionConcept { +public: + EdisjointTcbufferTcbufferPhysicalFunction(PhysicalFunction lonAFunction, + PhysicalFunction latAFunction, + PhysicalFunction radiusAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction lonBFunction, + PhysicalFunction latBFunction, + PhysicalFunction radiusBFunction, + PhysicalFunction tsBFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EdisjointTgeoGeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EdisjointTgeoGeoPhysicalFunction.hpp new file mode 100644 index 0000000000..f002ced9cb --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EdisjointTgeoGeoPhysicalFunction.hpp @@ -0,0 +1,44 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `edisjoint_tgeo_geo`. + * + * Per-event edisjoint_tgeo_geo spatial predicate. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class EdisjointTgeoGeoPhysicalFunction : public PhysicalFunctionConcept { +public: + EdisjointTgeoGeoPhysicalFunction(PhysicalFunction lonFunction, + PhysicalFunction latFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EdisjointTgeoTgeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EdisjointTgeoTgeoPhysicalFunction.hpp index 80c52445ec..12157a31a9 100644 --- a/nes-physical-operators/include/Functions/Meos/EdisjointTgeoTgeoPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/EdisjointTgeoTgeoPhysicalFunction.hpp @@ -21,12 +21,26 @@ namespace NES { +/** + * @brief Physical operator for `edisjoint_tgeo_tgeo`. + * + * Per-event edisjoint_tgeo_tgeo spatial predicate. + * + * Generated by tools/codegen/codegen_nebula.py. + */ class EdisjointTgeoTgeoPhysicalFunction : public PhysicalFunctionConcept { public: - EdisjointTgeoTgeoPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction ts1, PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction ts2); + EdisjointTgeoTgeoPhysicalFunction(PhysicalFunction lonAFunction, + PhysicalFunction latAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction lonBFunction, + PhysicalFunction latBFunction, + PhysicalFunction tsBFunction); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EdisjointTrgeometryGeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EdisjointTrgeometryGeoPhysicalFunction.hpp new file mode 100644 index 0000000000..ecf4a89e72 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EdisjointTrgeometryGeoPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class EdisjointTrgeometryGeoPhysicalFunction : public PhysicalFunctionConcept { +public: + EdisjointTrgeometryGeoPhysicalFunction(PhysicalFunction ref_wkt, PhysicalFunction x1, PhysicalFunction y1, PhysicalFunction theta1, PhysicalFunction ts1, PhysicalFunction tgt_wkt); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EdisjointTrgeometryTrgeometryPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EdisjointTrgeometryTrgeometryPhysicalFunction.hpp new file mode 100644 index 0000000000..b84f2fb97d --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EdisjointTrgeometryTrgeometryPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class EdisjointTrgeometryTrgeometryPhysicalFunction : public PhysicalFunctionConcept { +public: + EdisjointTrgeometryTrgeometryPhysicalFunction(PhysicalFunction ref1_wkt, PhysicalFunction x1, PhysicalFunction y1, PhysicalFunction theta1, PhysicalFunction ts1, PhysicalFunction ref2_wkt, PhysicalFunction x2, PhysicalFunction y2, PhysicalFunction theta2, PhysicalFunction ts2); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EdwithinTcbufferCbufferPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EdwithinTcbufferCbufferPhysicalFunction.hpp new file mode 100644 index 0000000000..31e9fbe801 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EdwithinTcbufferCbufferPhysicalFunction.hpp @@ -0,0 +1,46 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `edwithin_tcbuffer_cbuffer`. + * + * Per-event ever-within-distance between a single-instant tcbuffer and a static cbuffer. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class EdwithinTcbufferCbufferPhysicalFunction : public PhysicalFunctionConcept { +public: + EdwithinTcbufferCbufferPhysicalFunction(PhysicalFunction lonFunction, + PhysicalFunction latFunction, + PhysicalFunction radiusFunction, + PhysicalFunction timestampFunction, + PhysicalFunction cbufLitFunction, + PhysicalFunction distFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EdwithinTcbufferGeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EdwithinTcbufferGeoPhysicalFunction.hpp index 9dbb55e258..04dfc4c59c 100644 --- a/nes-physical-operators/include/Functions/Meos/EdwithinTcbufferGeoPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/EdwithinTcbufferGeoPhysicalFunction.hpp @@ -21,16 +21,26 @@ namespace NES { +/** + * @brief Physical operator for `edwithin_tcbuffer_geo`. + * + * Per-event edwithin_tcbuffer_geo spatial predicate. + * + * Generated by tools/codegen/codegen_nebula.py. + */ class EdwithinTcbufferGeoPhysicalFunction : public PhysicalFunctionConcept { public: - EdwithinTcbufferGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, - PhysicalFunction radius, PhysicalFunction ts, - PhysicalFunction wkt, PhysicalFunction dist); + EdwithinTcbufferGeoPhysicalFunction(PhysicalFunction lonFunction, + PhysicalFunction latFunction, + PhysicalFunction radiusFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction, + PhysicalFunction distFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EdwithinTcbufferTcbufferPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EdwithinTcbufferTcbufferPhysicalFunction.hpp index 4ff9cac817..4d6cb24b6d 100644 --- a/nes-physical-operators/include/Functions/Meos/EdwithinTcbufferTcbufferPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/EdwithinTcbufferTcbufferPhysicalFunction.hpp @@ -21,17 +21,29 @@ namespace NES { +/** + * @brief Physical operator for `edwithin_tcbuffer_tcbuffer`. + * + * Per-event edwithin_tcbuffer_tcbuffer spatial predicate. + * + * Generated by tools/codegen/codegen_nebula.py. + */ class EdwithinTcbufferTcbufferPhysicalFunction : public PhysicalFunctionConcept { public: - EdwithinTcbufferTcbufferPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction r1, - PhysicalFunction ts1, - PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction r2, - PhysicalFunction ts2, PhysicalFunction dist); + EdwithinTcbufferTcbufferPhysicalFunction(PhysicalFunction lonAFunction, + PhysicalFunction latAFunction, + PhysicalFunction radiusAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction lonBFunction, + PhysicalFunction latBFunction, + PhysicalFunction radiusBFunction, + PhysicalFunction tsBFunction, + PhysicalFunction distFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EdwithinTgeoGeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EdwithinTgeoGeoPhysicalFunction.hpp new file mode 100644 index 0000000000..93a288946f --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EdwithinTgeoGeoPhysicalFunction.hpp @@ -0,0 +1,45 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `edwithin_tgeo_geo`. + * + * Per-event edwithin_tgeo_geo spatial predicate. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class EdwithinTgeoGeoPhysicalFunction : public PhysicalFunctionConcept { +public: + EdwithinTgeoGeoPhysicalFunction(PhysicalFunction lonFunction, + PhysicalFunction latFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction, + PhysicalFunction distFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EdwithinTgeoTgeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EdwithinTgeoTgeoPhysicalFunction.hpp index 41509fbd7d..87d0522d69 100644 --- a/nes-physical-operators/include/Functions/Meos/EdwithinTgeoTgeoPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/EdwithinTgeoTgeoPhysicalFunction.hpp @@ -21,12 +21,27 @@ namespace NES { +/** + * @brief Physical operator for `edwithin_tgeo_tgeo`. + * + * Per-event edwithin_tgeo_tgeo spatial predicate. + * + * Generated by tools/codegen/codegen_nebula.py. + */ class EdwithinTgeoTgeoPhysicalFunction : public PhysicalFunctionConcept { public: - EdwithinTgeoTgeoPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction ts1, PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction ts2, PhysicalFunction dist); + EdwithinTgeoTgeoPhysicalFunction(PhysicalFunction lonAFunction, + PhysicalFunction latAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction lonBFunction, + PhysicalFunction latBFunction, + PhysicalFunction tsBFunction, + PhysicalFunction distFunction); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EdwithinTrgeometryGeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EdwithinTrgeometryGeoPhysicalFunction.hpp new file mode 100644 index 0000000000..714de43c4c --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EdwithinTrgeometryGeoPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class EdwithinTrgeometryGeoPhysicalFunction : public PhysicalFunctionConcept { +public: + EdwithinTrgeometryGeoPhysicalFunction(PhysicalFunction ref_wkt, PhysicalFunction x1, PhysicalFunction y1, PhysicalFunction theta1, PhysicalFunction ts1, PhysicalFunction tgt_wkt, PhysicalFunction dist); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EdwithinTrgeometryTrgeometryPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EdwithinTrgeometryTrgeometryPhysicalFunction.hpp new file mode 100644 index 0000000000..fc572ac48c --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EdwithinTrgeometryTrgeometryPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class EdwithinTrgeometryTrgeometryPhysicalFunction : public PhysicalFunctionConcept { +public: + EdwithinTrgeometryTrgeometryPhysicalFunction(PhysicalFunction ref1_wkt, PhysicalFunction x1, PhysicalFunction y1, PhysicalFunction theta1, PhysicalFunction ts1, PhysicalFunction ref2_wkt, PhysicalFunction x2, PhysicalFunction y2, PhysicalFunction theta2, PhysicalFunction ts2, PhysicalFunction dist); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EintersectsTcbufferGeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EintersectsTcbufferGeoPhysicalFunction.hpp index 47bdf4ea97..63c2eb7075 100644 --- a/nes-physical-operators/include/Functions/Meos/EintersectsTcbufferGeoPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/EintersectsTcbufferGeoPhysicalFunction.hpp @@ -21,16 +21,25 @@ namespace NES { +/** + * @brief Physical operator for `eintersects_tcbuffer_geo`. + * + * Per-event eintersects_tcbuffer_geo spatial predicate. + * + * Generated by tools/codegen/codegen_nebula.py. + */ class EintersectsTcbufferGeoPhysicalFunction : public PhysicalFunctionConcept { public: - EintersectsTcbufferGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, - PhysicalFunction radius, PhysicalFunction ts, - PhysicalFunction wkt); + EintersectsTcbufferGeoPhysicalFunction(PhysicalFunction lonFunction, + PhysicalFunction latFunction, + PhysicalFunction radiusFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EintersectsTcbufferTcbufferPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EintersectsTcbufferTcbufferPhysicalFunction.hpp index d2b3e01556..9ccf2ab4f7 100644 --- a/nes-physical-operators/include/Functions/Meos/EintersectsTcbufferTcbufferPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/EintersectsTcbufferTcbufferPhysicalFunction.hpp @@ -21,17 +21,28 @@ namespace NES { +/** + * @brief Physical operator for `eintersects_tcbuffer_tcbuffer`. + * + * Per-event eintersects_tcbuffer_tcbuffer spatial predicate. + * + * Generated by tools/codegen/codegen_nebula.py. + */ class EintersectsTcbufferTcbufferPhysicalFunction : public PhysicalFunctionConcept { public: - EintersectsTcbufferTcbufferPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction r1, - PhysicalFunction ts1, - PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction r2, - PhysicalFunction ts2); + EintersectsTcbufferTcbufferPhysicalFunction(PhysicalFunction lonAFunction, + PhysicalFunction latAFunction, + PhysicalFunction radiusAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction lonBFunction, + PhysicalFunction latBFunction, + PhysicalFunction radiusBFunction, + PhysicalFunction tsBFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EintersectsTgeoGeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EintersectsTgeoGeoPhysicalFunction.hpp index 0835b534c0..63ab26824c 100644 --- a/nes-physical-operators/include/Functions/Meos/EintersectsTgeoGeoPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/EintersectsTgeoGeoPhysicalFunction.hpp @@ -21,15 +21,24 @@ namespace NES { +/** + * @brief Physical operator for `eintersects_tgeo_geo`. + * + * Per-event eintersects_tgeo_geo spatial predicate. + * + * Generated by tools/codegen/codegen_nebula.py. + */ class EintersectsTgeoGeoPhysicalFunction : public PhysicalFunctionConcept { public: - EintersectsTgeoGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, - PhysicalFunction ts, PhysicalFunction wkt); + EintersectsTgeoGeoPhysicalFunction(PhysicalFunction lonFunction, + PhysicalFunction latFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EintersectsTgeoTgeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EintersectsTgeoTgeoPhysicalFunction.hpp index 5059b28ad4..4c7721526a 100644 --- a/nes-physical-operators/include/Functions/Meos/EintersectsTgeoTgeoPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/EintersectsTgeoTgeoPhysicalFunction.hpp @@ -21,12 +21,26 @@ namespace NES { +/** + * @brief Physical operator for `eintersects_tgeo_tgeo`. + * + * Per-event eintersects_tgeo_tgeo spatial predicate. + * + * Generated by tools/codegen/codegen_nebula.py. + */ class EintersectsTgeoTgeoPhysicalFunction : public PhysicalFunctionConcept { public: - EintersectsTgeoTgeoPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction ts1, PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction ts2); + EintersectsTgeoTgeoPhysicalFunction(PhysicalFunction lonAFunction, + PhysicalFunction latAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction lonBFunction, + PhysicalFunction latBFunction, + PhysicalFunction tsBFunction); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EintersectsTrgeometryGeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EintersectsTrgeometryGeoPhysicalFunction.hpp new file mode 100644 index 0000000000..80b8162757 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EintersectsTrgeometryGeoPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class EintersectsTrgeometryGeoPhysicalFunction : public PhysicalFunctionConcept { +public: + EintersectsTrgeometryGeoPhysicalFunction(PhysicalFunction ref_wkt, PhysicalFunction x1, PhysicalFunction y1, PhysicalFunction theta1, PhysicalFunction ts1, PhysicalFunction tgt_wkt); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EintersectsTrgeometryTrgeometryPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EintersectsTrgeometryTrgeometryPhysicalFunction.hpp new file mode 100644 index 0000000000..02520859a9 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EintersectsTrgeometryTrgeometryPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class EintersectsTrgeometryTrgeometryPhysicalFunction : public PhysicalFunctionConcept { +public: + EintersectsTrgeometryTrgeometryPhysicalFunction(PhysicalFunction ref1_wkt, PhysicalFunction x1, PhysicalFunction y1, PhysicalFunction theta1, PhysicalFunction ts1, PhysicalFunction ref2_wkt, PhysicalFunction x2, PhysicalFunction y2, PhysicalFunction theta2, PhysicalFunction ts2); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EtouchesTcbufferGeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EtouchesTcbufferGeoPhysicalFunction.hpp index a3dede45c9..c16db22bda 100644 --- a/nes-physical-operators/include/Functions/Meos/EtouchesTcbufferGeoPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/EtouchesTcbufferGeoPhysicalFunction.hpp @@ -21,16 +21,25 @@ namespace NES { +/** + * @brief Physical operator for `etouches_tcbuffer_geo`. + * + * Per-event etouches_tcbuffer_geo spatial predicate. + * + * Generated by tools/codegen/codegen_nebula.py. + */ class EtouchesTcbufferGeoPhysicalFunction : public PhysicalFunctionConcept { public: - EtouchesTcbufferGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, - PhysicalFunction radius, PhysicalFunction ts, - PhysicalFunction wkt); + EtouchesTcbufferGeoPhysicalFunction(PhysicalFunction lonFunction, + PhysicalFunction latFunction, + PhysicalFunction radiusFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EtouchesTcbufferTcbufferPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EtouchesTcbufferTcbufferPhysicalFunction.hpp index 791dd19e8c..cab92f21db 100644 --- a/nes-physical-operators/include/Functions/Meos/EtouchesTcbufferTcbufferPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/EtouchesTcbufferTcbufferPhysicalFunction.hpp @@ -21,17 +21,28 @@ namespace NES { +/** + * @brief Physical operator for `etouches_tcbuffer_tcbuffer`. + * + * Per-event etouches_tcbuffer_tcbuffer spatial predicate. + * + * Generated by tools/codegen/codegen_nebula.py. + */ class EtouchesTcbufferTcbufferPhysicalFunction : public PhysicalFunctionConcept { public: - EtouchesTcbufferTcbufferPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction r1, - PhysicalFunction ts1, - PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction r2, - PhysicalFunction ts2); + EtouchesTcbufferTcbufferPhysicalFunction(PhysicalFunction lonAFunction, + PhysicalFunction latAFunction, + PhysicalFunction radiusAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction lonBFunction, + PhysicalFunction latBFunction, + PhysicalFunction radiusBFunction, + PhysicalFunction tsBFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EtouchesTgeoGeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EtouchesTgeoGeoPhysicalFunction.hpp index d89e05afd9..2cee68ec92 100644 --- a/nes-physical-operators/include/Functions/Meos/EtouchesTgeoGeoPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/EtouchesTgeoGeoPhysicalFunction.hpp @@ -21,15 +21,24 @@ namespace NES { +/** + * @brief Physical operator for `etouches_tgeo_geo`. + * + * Per-event etouches_tgeo_geo spatial predicate. + * + * Generated by tools/codegen/codegen_nebula.py. + */ class EtouchesTgeoGeoPhysicalFunction : public PhysicalFunctionConcept { public: - EtouchesTgeoGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, - PhysicalFunction ts, PhysicalFunction wkt); + EtouchesTgeoGeoPhysicalFunction(PhysicalFunction lonFunction, + PhysicalFunction latFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EtouchesTgeoTgeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EtouchesTgeoTgeoPhysicalFunction.hpp index 464922ce60..1075f68d62 100644 --- a/nes-physical-operators/include/Functions/Meos/EtouchesTgeoTgeoPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/EtouchesTgeoTgeoPhysicalFunction.hpp @@ -21,12 +21,26 @@ namespace NES { +/** + * @brief Physical operator for `etouches_tgeo_tgeo`. + * + * Per-event etouches_tgeo_tgeo spatial predicate. + * + * Generated by tools/codegen/codegen_nebula.py. + */ class EtouchesTgeoTgeoPhysicalFunction : public PhysicalFunctionConcept { public: - EtouchesTgeoTgeoPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction ts1, PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction ts2); + EtouchesTgeoTgeoPhysicalFunction(PhysicalFunction lonAFunction, + PhysicalFunction latAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction lonBFunction, + PhysicalFunction latBFunction, + PhysicalFunction tsBFunction); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EtouchesTrgeometryGeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EtouchesTrgeometryGeoPhysicalFunction.hpp new file mode 100644 index 0000000000..3054073386 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/EtouchesTrgeometryGeoPhysicalFunction.hpp @@ -0,0 +1,32 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +class EtouchesTrgeometryGeoPhysicalFunction : public PhysicalFunctionConcept { +public: + EtouchesTrgeometryGeoPhysicalFunction(PhysicalFunction ref_wkt, PhysicalFunction x1, PhysicalFunction y1, PhysicalFunction theta1, PhysicalFunction ts1, PhysicalFunction tgt_wkt); + VarVal execute(const Record& record, ArenaRef& arena) const override; +private: + std::vector paramFns; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverEqBigintTbigintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverEqBigintTbigintPhysicalFunction.hpp index 25c40ac239..2be047dc17 100644 --- a/nes-physical-operators/include/Functions/Meos/EverEqBigintTbigintPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/EverEqBigintTbigintPhysicalFunction.hpp @@ -24,15 +24,15 @@ namespace NES { /** * @brief Physical operator for `ever_eq_bigint_tbigint`. * - * Per-event ever_eq_bigint_tbigint: tests if a single-instant tfloat value ever equals a threshold. + * Per-event ever_eq_bigint_tbigint: ever-equal scalar bigint vs tbigint. * * Generated by tools/codegen/codegen_nebula.py. */ class EverEqBigintTbigintPhysicalFunction : public PhysicalFunctionConcept { public: - EverEqBigintTbigintPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction thresholdFunction, - PhysicalFunction tsFunction); + EverEqBigintTbigintPhysicalFunction(PhysicalFunction arg0Function, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; diff --git a/nes-physical-operators/include/Functions/Meos/EverEqBoolTboolPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverEqBoolTboolPhysicalFunction.hpp index f51a3d12b2..e83b359249 100644 --- a/nes-physical-operators/include/Functions/Meos/EverEqBoolTboolPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/EverEqBoolTboolPhysicalFunction.hpp @@ -24,15 +24,15 @@ namespace NES { /** * @brief Physical operator for `ever_eq_bool_tbool`. * - * Per-event ever_eq_bool_tbool: tests if a single-instant tfloat value ever equals a threshold. + * Per-event ever_eq_bool_tbool: ever-equal scalar bool vs tbool. * * Generated by tools/codegen/codegen_nebula.py. */ class EverEqBoolTboolPhysicalFunction : public PhysicalFunctionConcept { public: - EverEqBoolTboolPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction thresholdFunction, - PhysicalFunction tsFunction); + EverEqBoolTboolPhysicalFunction(PhysicalFunction arg0Function, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; diff --git a/nes-physical-operators/include/Functions/Meos/EverEqNpointTnpointPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverEqNpointTnpointPhysicalFunction.hpp index 0f2fcb08ac..befbe9d18b 100644 --- a/nes-physical-operators/include/Functions/Meos/EverEqNpointTnpointPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/EverEqNpointTnpointPhysicalFunction.hpp @@ -21,12 +21,25 @@ namespace NES { +/** + * @brief Physical operator for `ever_eq_npoint_tnpoint`. + * + * Ever eq npoint vs tnpoint + * + * Generated by tools/codegen/codegen_nebula.py. + */ class EverEqNpointTnpointPhysicalFunction : public PhysicalFunctionConcept { public: - EverEqNpointTnpointPhysicalFunction(PhysicalFunction rid_np, PhysicalFunction pos_np, PhysicalFunction rid_tp, PhysicalFunction pos_tp, PhysicalFunction ts); + EverEqNpointTnpointPhysicalFunction(PhysicalFunction rid0Function, + PhysicalFunction frac0Function, + PhysicalFunction ridFunction, + PhysicalFunction fracFunction, + PhysicalFunction tsFunction); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverEqPoseTposePhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverEqPoseTposePhysicalFunction.hpp index b8defb26a6..aad5f1d69f 100644 --- a/nes-physical-operators/include/Functions/Meos/EverEqPoseTposePhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/EverEqPoseTposePhysicalFunction.hpp @@ -21,12 +21,27 @@ namespace NES { +/** + * @brief Physical operator for `ever_eq_pose_tpose`. + * + * Ever eq pose vs tpose + * + * Generated by tools/codegen/codegen_nebula.py. + */ class EverEqPoseTposePhysicalFunction : public PhysicalFunctionConcept { public: - EverEqPoseTposePhysicalFunction(PhysicalFunction x2, PhysicalFunction y2, PhysicalFunction theta2, PhysicalFunction x, PhysicalFunction y, PhysicalFunction theta, PhysicalFunction ts); + EverEqPoseTposePhysicalFunction(PhysicalFunction px0Function, + PhysicalFunction py0Function, + PhysicalFunction ptheta0Function, + PhysicalFunction xFunction, + PhysicalFunction yFunction, + PhysicalFunction thetaFunction, + PhysicalFunction tsFunction); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverEqTbigintBigintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverEqTbigintBigintPhysicalFunction.hpp index 0d9dd4195f..564ebfc4ac 100644 --- a/nes-physical-operators/include/Functions/Meos/EverEqTbigintBigintPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/EverEqTbigintBigintPhysicalFunction.hpp @@ -24,15 +24,15 @@ namespace NES { /** * @brief Physical operator for `ever_eq_tbigint_bigint`. * - * Per-event ever_eq_tbigint_bigint: tests if a single-instant tbigint value ever eqs a threshold. + * Per-event ever_eq_tbigint_bigint: ever-equal tbigint vs scalar bigint. * * Generated by tools/codegen/codegen_nebula.py. */ class EverEqTbigintBigintPhysicalFunction : public PhysicalFunctionConcept { public: EverEqTbigintBigintPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction thresholdFunction, - PhysicalFunction tsFunction); + PhysicalFunction tsFunction, + PhysicalFunction arg0Function); VarVal execute(const Record& record, ArenaRef& arena) const override; diff --git a/nes-physical-operators/include/Functions/Meos/EverEqTboolBoolPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverEqTboolBoolPhysicalFunction.hpp index 50715d2d12..c7b71d6081 100644 --- a/nes-physical-operators/include/Functions/Meos/EverEqTboolBoolPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/EverEqTboolBoolPhysicalFunction.hpp @@ -24,15 +24,15 @@ namespace NES { /** * @brief Physical operator for `ever_eq_tbool_bool`. * - * Per-event ever_eq_tbool_bool: tests if a single-instant tfloat value ever equals a threshold. + * Per-event ever_eq_tbool_bool: ever-equal tbool vs scalar bool. * * Generated by tools/codegen/codegen_nebula.py. */ class EverEqTboolBoolPhysicalFunction : public PhysicalFunctionConcept { public: EverEqTboolBoolPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction thresholdFunction, - PhysicalFunction tsFunction); + PhysicalFunction tsFunction, + PhysicalFunction arg0Function); VarVal execute(const Record& record, ArenaRef& arena) const override; diff --git a/nes-physical-operators/include/Functions/Meos/EverEqTcbufferTcbufferPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverEqTcbufferTcbufferPhysicalFunction.hpp index 8fef36a992..a61e9b745e 100644 --- a/nes-physical-operators/include/Functions/Meos/EverEqTcbufferTcbufferPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/EverEqTcbufferTcbufferPhysicalFunction.hpp @@ -21,17 +21,28 @@ namespace NES { +/** + * @brief Physical operator for `ever_eq_tcbuffer_tcbuffer`. + * + * Per-event ever_eq_tcbuffer_tcbuffer spatial predicate. + * + * Generated by tools/codegen/codegen_nebula.py. + */ class EverEqTcbufferTcbufferPhysicalFunction : public PhysicalFunctionConcept { public: - EverEqTcbufferTcbufferPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction r1, - PhysicalFunction ts1, - PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction r2, - PhysicalFunction ts2); + EverEqTcbufferTcbufferPhysicalFunction(PhysicalFunction lonAFunction, + PhysicalFunction latAFunction, + PhysicalFunction radiusAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction lonBFunction, + PhysicalFunction latBFunction, + PhysicalFunction radiusBFunction, + PhysicalFunction tsBFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverEqTextTtextPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverEqTextTtextPhysicalFunction.hpp index 219398d2d4..1d7bbaef3f 100644 --- a/nes-physical-operators/include/Functions/Meos/EverEqTextTtextPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/EverEqTextTtextPhysicalFunction.hpp @@ -21,16 +21,23 @@ namespace NES { +/** + * @brief Physical operator for `ever_eq_text_ttext(txt0, temp)`. + * + * Ever eqqual text vs ttext + * + * Generated by tools/codegen/codegen_nebula.py. + */ class EverEqTextTtextPhysicalFunction : public PhysicalFunctionConcept { public: - EverEqTextTtextPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction refFunction, - PhysicalFunction tsFunction); + EverEqTextTtextPhysicalFunction(PhysicalFunction arg0Function, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverEqTgeoGeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverEqTgeoGeoPhysicalFunction.hpp index ae43d9ba2f..160a04b10b 100644 --- a/nes-physical-operators/include/Functions/Meos/EverEqTgeoGeoPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/EverEqTgeoGeoPhysicalFunction.hpp @@ -21,15 +21,24 @@ namespace NES { +/** + * @brief Physical operator for `ever_eq_tgeo_geo`. + * + * Per-event ever_eq_tgeo_geo spatial predicate. + * + * Generated by tools/codegen/codegen_nebula.py. + */ class EverEqTgeoGeoPhysicalFunction : public PhysicalFunctionConcept { public: - EverEqTgeoGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, - PhysicalFunction ts, PhysicalFunction wkt); + EverEqTgeoGeoPhysicalFunction(PhysicalFunction lonFunction, + PhysicalFunction latFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverEqTgeoTgeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverEqTgeoTgeoPhysicalFunction.hpp index 5571b9a7fe..213df2daf1 100644 --- a/nes-physical-operators/include/Functions/Meos/EverEqTgeoTgeoPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/EverEqTgeoTgeoPhysicalFunction.hpp @@ -21,12 +21,26 @@ namespace NES { +/** + * @brief Physical operator for `ever_eq_tgeo_tgeo`. + * + * Per-event ever_eq_tgeo_tgeo spatial predicate. + * + * Generated by tools/codegen/codegen_nebula.py. + */ class EverEqTgeoTgeoPhysicalFunction : public PhysicalFunctionConcept { public: - EverEqTgeoTgeoPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction ts1, PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction ts2); + EverEqTgeoTgeoPhysicalFunction(PhysicalFunction lonAFunction, + PhysicalFunction latAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction lonBFunction, + PhysicalFunction latBFunction, + PhysicalFunction tsBFunction); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverEqTh3indexH3indexPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverEqTh3indexH3indexPhysicalFunction.hpp index 7d62fb93ff..d10ff54a01 100644 --- a/nes-physical-operators/include/Functions/Meos/EverEqTh3indexH3indexPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/EverEqTh3indexH3indexPhysicalFunction.hpp @@ -21,14 +21,23 @@ namespace NES { +/** + * @brief Physical operator for `ever_eq_th3index_h3index(temp, (H3Index)arg0)`. + * + * Ever equal th3index vs h3index + * + * Generated by tools/codegen/codegen_nebula.py. + */ class EverEqTh3indexH3indexPhysicalFunction : public PhysicalFunctionConcept { public: - EverEqTh3indexH3indexPhysicalFunction(PhysicalFunction cell, PhysicalFunction ts, PhysicalFunction target); + EverEqTh3indexH3indexPhysicalFunction(PhysicalFunction cellFunction, + PhysicalFunction tsFunction, + PhysicalFunction arg0Function); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverEqTjsonbJsonbPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverEqTjsonbJsonbPhysicalFunction.hpp index bc2a532a7e..7529f14b12 100644 --- a/nes-physical-operators/include/Functions/Meos/EverEqTjsonbJsonbPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/EverEqTjsonbJsonbPhysicalFunction.hpp @@ -21,12 +21,23 @@ namespace NES { +/** + * @brief Physical operator for `ever_eq_tjsonb_jsonb`. + * + * Ever equal tjsonb vs jsonb + * + * Generated by tools/codegen/codegen_nebula.py. + */ class EverEqTjsonbJsonbPhysicalFunction : public PhysicalFunctionConcept { public: - EverEqTjsonbJsonbPhysicalFunction(PhysicalFunction json_str, PhysicalFunction ts, PhysicalFunction target_json); + EverEqTjsonbJsonbPhysicalFunction(PhysicalFunction json_strFunction, + PhysicalFunction tsFunction, + PhysicalFunction arg0Function); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverEqTjsonbTjsonbPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverEqTjsonbTjsonbPhysicalFunction.hpp index 8d77ff0b11..80a1fa484c 100644 --- a/nes-physical-operators/include/Functions/Meos/EverEqTjsonbTjsonbPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/EverEqTjsonbTjsonbPhysicalFunction.hpp @@ -21,12 +21,24 @@ namespace NES { +/** + * @brief Physical operator for `ever_eq_tjsonb_tjsonb`. + * + * Ever equal tjsonb vs tjsonb + * + * Generated by tools/codegen/codegen_nebula.py. + */ class EverEqTjsonbTjsonbPhysicalFunction : public PhysicalFunctionConcept { public: - EverEqTjsonbTjsonbPhysicalFunction(PhysicalFunction json1, PhysicalFunction ts1, PhysicalFunction json2, PhysicalFunction ts2); + EverEqTjsonbTjsonbPhysicalFunction(PhysicalFunction json_strFunction, + PhysicalFunction tsFunction, + PhysicalFunction json0Function, + PhysicalFunction ts0Function); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverEqTnpointNpointPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverEqTnpointNpointPhysicalFunction.hpp index 43751866cc..7bf7c835bb 100644 --- a/nes-physical-operators/include/Functions/Meos/EverEqTnpointNpointPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/EverEqTnpointNpointPhysicalFunction.hpp @@ -21,12 +21,25 @@ namespace NES { +/** + * @brief Physical operator for `ever_eq_tnpoint_npoint`. + * + * Ever eq tnpoint vs npoint + * + * Generated by tools/codegen/codegen_nebula.py. + */ class EverEqTnpointNpointPhysicalFunction : public PhysicalFunctionConcept { public: - EverEqTnpointNpointPhysicalFunction(PhysicalFunction rid1, PhysicalFunction pos1, PhysicalFunction ts, PhysicalFunction rid2, PhysicalFunction pos2); + EverEqTnpointNpointPhysicalFunction(PhysicalFunction ridFunction, + PhysicalFunction fracFunction, + PhysicalFunction tsFunction, + PhysicalFunction rid0Function, + PhysicalFunction frac0Function); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverEqTnpointTnpointPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverEqTnpointTnpointPhysicalFunction.hpp index d4bca5295e..2c8679d5fa 100644 --- a/nes-physical-operators/include/Functions/Meos/EverEqTnpointTnpointPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/EverEqTnpointTnpointPhysicalFunction.hpp @@ -21,13 +21,26 @@ namespace NES { +/** + * @brief Physical operator for `ever_eq_tnpoint_tnpoint`. + * + * Ever eq tnpoint vs tnpoint + * + * Generated by tools/codegen/codegen_nebula.py. + */ class EverEqTnpointTnpointPhysicalFunction : public PhysicalFunctionConcept { public: - EverEqTnpointTnpointPhysicalFunction(PhysicalFunction rid1, PhysicalFunction pos1, PhysicalFunction ts1, - PhysicalFunction rid2, PhysicalFunction pos2, PhysicalFunction ts2); + EverEqTnpointTnpointPhysicalFunction(PhysicalFunction ridFunction, + PhysicalFunction fracFunction, + PhysicalFunction tsFunction, + PhysicalFunction rid0Function, + PhysicalFunction frac0Function, + PhysicalFunction ts0Function); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverEqTposePosePhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverEqTposePosePhysicalFunction.hpp index a304cc7b82..eb1111cc1d 100644 --- a/nes-physical-operators/include/Functions/Meos/EverEqTposePosePhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/EverEqTposePosePhysicalFunction.hpp @@ -21,12 +21,27 @@ namespace NES { +/** + * @brief Physical operator for `ever_eq_tpose_pose`. + * + * Ever eq tpose vs pose + * + * Generated by tools/codegen/codegen_nebula.py. + */ class EverEqTposePosePhysicalFunction : public PhysicalFunctionConcept { public: - EverEqTposePosePhysicalFunction(PhysicalFunction x, PhysicalFunction y, PhysicalFunction theta, PhysicalFunction ts, PhysicalFunction x2, PhysicalFunction y2, PhysicalFunction theta2); + EverEqTposePosePhysicalFunction(PhysicalFunction xFunction, + PhysicalFunction yFunction, + PhysicalFunction thetaFunction, + PhysicalFunction tsFunction, + PhysicalFunction px0Function, + PhysicalFunction py0Function, + PhysicalFunction ptheta0Function); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverEqTposeTposePhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverEqTposeTposePhysicalFunction.hpp index 56abe9061c..b41239e695 100644 --- a/nes-physical-operators/include/Functions/Meos/EverEqTposeTposePhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/EverEqTposeTposePhysicalFunction.hpp @@ -21,15 +21,28 @@ namespace NES { +/** + * @brief Physical operator for `ever_eq_tpose_tpose`. + * + * Ever eq tpose vs tpose + * + * Generated by tools/codegen/codegen_nebula.py. + */ class EverEqTposeTposePhysicalFunction : public PhysicalFunctionConcept { public: - EverEqTposeTposePhysicalFunction(PhysicalFunction x1, PhysicalFunction y1, PhysicalFunction theta1, - PhysicalFunction ts1, - PhysicalFunction x2, PhysicalFunction y2, PhysicalFunction theta2, - PhysicalFunction ts2); + EverEqTposeTposePhysicalFunction(PhysicalFunction xFunction, + PhysicalFunction yFunction, + PhysicalFunction thetaFunction, + PhysicalFunction tsFunction, + PhysicalFunction px0Function, + PhysicalFunction py0Function, + PhysicalFunction ptheta0Function, + PhysicalFunction ts0Function); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverEqTquadbinQuadbinPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverEqTquadbinQuadbinPhysicalFunction.hpp index 72a8284b89..6b11921e57 100644 --- a/nes-physical-operators/include/Functions/Meos/EverEqTquadbinQuadbinPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/EverEqTquadbinQuadbinPhysicalFunction.hpp @@ -21,12 +21,23 @@ namespace NES { +/** + * @brief Physical operator for `ever_eq_tquadbin_quadbin(temp, (Quadbin)arg0)`. + * + * Ever equal tquadbin vs quadbin + * + * Generated by tools/codegen/codegen_nebula.py. + */ class EverEqTquadbinQuadbinPhysicalFunction : public PhysicalFunctionConcept { public: - EverEqTquadbinQuadbinPhysicalFunction(PhysicalFunction inst_cell, PhysicalFunction ts, PhysicalFunction cell); + EverEqTquadbinQuadbinPhysicalFunction(PhysicalFunction cellFunction, + PhysicalFunction tsFunction, + PhysicalFunction arg0Function); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverEqTtextTextPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverEqTtextTextPhysicalFunction.hpp index 28c8346c06..2eeef8a1b9 100644 --- a/nes-physical-operators/include/Functions/Meos/EverEqTtextTextPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/EverEqTtextTextPhysicalFunction.hpp @@ -21,16 +21,23 @@ namespace NES { +/** + * @brief Physical operator for `ever_eq_ttext_text(temp, txt0)`. + * + * Ever eqqual ttext vs text + * + * Generated by tools/codegen/codegen_nebula.py. + */ class EverEqTtextTextPhysicalFunction : public PhysicalFunctionConcept { public: EverEqTtextTextPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction refFunction, - PhysicalFunction tsFunction); + PhysicalFunction tsFunction, + PhysicalFunction arg0Function); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverGeBigintTbigintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverGeBigintTbigintPhysicalFunction.hpp index 5713b4fedb..5f8c04f1c0 100644 --- a/nes-physical-operators/include/Functions/Meos/EverGeBigintTbigintPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/EverGeBigintTbigintPhysicalFunction.hpp @@ -24,15 +24,15 @@ namespace NES { /** * @brief Physical operator for `ever_ge_bigint_tbigint`. * - * Per-event ever_ge_bigint_tbigint: tests if a single-instant tfloat value ever equals a threshold. + * Per-event ever_ge_bigint_tbigint: ever-greater-or-equal scalar bigint vs tbigint. * * Generated by tools/codegen/codegen_nebula.py. */ class EverGeBigintTbigintPhysicalFunction : public PhysicalFunctionConcept { public: - EverGeBigintTbigintPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction thresholdFunction, - PhysicalFunction tsFunction); + EverGeBigintTbigintPhysicalFunction(PhysicalFunction arg0Function, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; diff --git a/nes-physical-operators/include/Functions/Meos/EverGeTbigintBigintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverGeTbigintBigintPhysicalFunction.hpp index 390aee0c48..cbe6f46aa0 100644 --- a/nes-physical-operators/include/Functions/Meos/EverGeTbigintBigintPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/EverGeTbigintBigintPhysicalFunction.hpp @@ -24,15 +24,15 @@ namespace NES { /** * @brief Physical operator for `ever_ge_tbigint_bigint`. * - * Per-event ever_ge_tbigint_bigint: tests if a single-instant tbigint value ever ges a threshold. + * Per-event ever_ge_tbigint_bigint: ever-greater-or-equal tbigint vs scalar bigint. * * Generated by tools/codegen/codegen_nebula.py. */ class EverGeTbigintBigintPhysicalFunction : public PhysicalFunctionConcept { public: EverGeTbigintBigintPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction thresholdFunction, - PhysicalFunction tsFunction); + PhysicalFunction tsFunction, + PhysicalFunction arg0Function); VarVal execute(const Record& record, ArenaRef& arena) const override; diff --git a/nes-physical-operators/include/Functions/Meos/EverGeTextTtextPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverGeTextTtextPhysicalFunction.hpp index c033017647..cb24f10adf 100644 --- a/nes-physical-operators/include/Functions/Meos/EverGeTextTtextPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/EverGeTextTtextPhysicalFunction.hpp @@ -21,16 +21,23 @@ namespace NES { +/** + * @brief Physical operator for `ever_ge_text_ttext(txt0, temp)`. + * + * Ever gequal text vs ttext + * + * Generated by tools/codegen/codegen_nebula.py. + */ class EverGeTextTtextPhysicalFunction : public PhysicalFunctionConcept { public: - EverGeTextTtextPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction refFunction, - PhysicalFunction tsFunction); + EverGeTextTtextPhysicalFunction(PhysicalFunction arg0Function, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverGeTtextTextPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverGeTtextTextPhysicalFunction.hpp index e75180efa1..7309a99a5b 100644 --- a/nes-physical-operators/include/Functions/Meos/EverGeTtextTextPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/EverGeTtextTextPhysicalFunction.hpp @@ -21,16 +21,23 @@ namespace NES { +/** + * @brief Physical operator for `ever_ge_ttext_text(temp, txt0)`. + * + * Ever gequal ttext vs text + * + * Generated by tools/codegen/codegen_nebula.py. + */ class EverGeTtextTextPhysicalFunction : public PhysicalFunctionConcept { public: EverGeTtextTextPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction refFunction, - PhysicalFunction tsFunction); + PhysicalFunction tsFunction, + PhysicalFunction arg0Function); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverGtBigintTbigintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverGtBigintTbigintPhysicalFunction.hpp index b8b9a59577..96122101c2 100644 --- a/nes-physical-operators/include/Functions/Meos/EverGtBigintTbigintPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/EverGtBigintTbigintPhysicalFunction.hpp @@ -24,15 +24,15 @@ namespace NES { /** * @brief Physical operator for `ever_gt_bigint_tbigint`. * - * Per-event ever_gt_bigint_tbigint: tests if a single-instant tfloat value ever equals a threshold. + * Per-event ever_gt_bigint_tbigint: ever-greater-than scalar bigint vs tbigint. * * Generated by tools/codegen/codegen_nebula.py. */ class EverGtBigintTbigintPhysicalFunction : public PhysicalFunctionConcept { public: - EverGtBigintTbigintPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction thresholdFunction, - PhysicalFunction tsFunction); + EverGtBigintTbigintPhysicalFunction(PhysicalFunction arg0Function, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; diff --git a/nes-physical-operators/include/Functions/Meos/EverGtTbigintBigintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverGtTbigintBigintPhysicalFunction.hpp index a13411d83f..6b856c7723 100644 --- a/nes-physical-operators/include/Functions/Meos/EverGtTbigintBigintPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/EverGtTbigintBigintPhysicalFunction.hpp @@ -24,15 +24,15 @@ namespace NES { /** * @brief Physical operator for `ever_gt_tbigint_bigint`. * - * Per-event ever_gt_tbigint_bigint: tests if a single-instant tbigint value ever gts a threshold. + * Per-event ever_gt_tbigint_bigint: ever-greater-than tbigint vs scalar bigint. * * Generated by tools/codegen/codegen_nebula.py. */ class EverGtTbigintBigintPhysicalFunction : public PhysicalFunctionConcept { public: EverGtTbigintBigintPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction thresholdFunction, - PhysicalFunction tsFunction); + PhysicalFunction tsFunction, + PhysicalFunction arg0Function); VarVal execute(const Record& record, ArenaRef& arena) const override; diff --git a/nes-physical-operators/include/Functions/Meos/EverGtTextTtextPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverGtTextTtextPhysicalFunction.hpp index 9b919651de..8c0cf88612 100644 --- a/nes-physical-operators/include/Functions/Meos/EverGtTextTtextPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/EverGtTextTtextPhysicalFunction.hpp @@ -21,16 +21,23 @@ namespace NES { +/** + * @brief Physical operator for `ever_gt_text_ttext(txt0, temp)`. + * + * Ever gtqual text vs ttext + * + * Generated by tools/codegen/codegen_nebula.py. + */ class EverGtTextTtextPhysicalFunction : public PhysicalFunctionConcept { public: - EverGtTextTtextPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction refFunction, - PhysicalFunction tsFunction); + EverGtTextTtextPhysicalFunction(PhysicalFunction arg0Function, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverGtTtextTextPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverGtTtextTextPhysicalFunction.hpp index e9cb4b2425..5a95d840c1 100644 --- a/nes-physical-operators/include/Functions/Meos/EverGtTtextTextPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/EverGtTtextTextPhysicalFunction.hpp @@ -21,16 +21,23 @@ namespace NES { +/** + * @brief Physical operator for `ever_gt_ttext_text(temp, txt0)`. + * + * Ever gtqual ttext vs text + * + * Generated by tools/codegen/codegen_nebula.py. + */ class EverGtTtextTextPhysicalFunction : public PhysicalFunctionConcept { public: EverGtTtextTextPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction refFunction, - PhysicalFunction tsFunction); + PhysicalFunction tsFunction, + PhysicalFunction arg0Function); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverLeBigintTbigintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverLeBigintTbigintPhysicalFunction.hpp index 186b8bf9d2..99b1c2836a 100644 --- a/nes-physical-operators/include/Functions/Meos/EverLeBigintTbigintPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/EverLeBigintTbigintPhysicalFunction.hpp @@ -24,15 +24,15 @@ namespace NES { /** * @brief Physical operator for `ever_le_bigint_tbigint`. * - * Per-event ever_le_bigint_tbigint: tests if a single-instant tfloat value ever equals a threshold. + * Per-event ever_le_bigint_tbigint: ever-less-or-equal scalar bigint vs tbigint. * * Generated by tools/codegen/codegen_nebula.py. */ class EverLeBigintTbigintPhysicalFunction : public PhysicalFunctionConcept { public: - EverLeBigintTbigintPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction thresholdFunction, - PhysicalFunction tsFunction); + EverLeBigintTbigintPhysicalFunction(PhysicalFunction arg0Function, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; diff --git a/nes-physical-operators/include/Functions/Meos/EverLeTbigintBigintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverLeTbigintBigintPhysicalFunction.hpp index 8e99ab050c..ee135f5ab3 100644 --- a/nes-physical-operators/include/Functions/Meos/EverLeTbigintBigintPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/EverLeTbigintBigintPhysicalFunction.hpp @@ -24,15 +24,15 @@ namespace NES { /** * @brief Physical operator for `ever_le_tbigint_bigint`. * - * Per-event ever_le_tbigint_bigint: tests if a single-instant tbigint value ever les a threshold. + * Per-event ever_le_tbigint_bigint: ever-less-or-equal tbigint vs scalar bigint. * * Generated by tools/codegen/codegen_nebula.py. */ class EverLeTbigintBigintPhysicalFunction : public PhysicalFunctionConcept { public: EverLeTbigintBigintPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction thresholdFunction, - PhysicalFunction tsFunction); + PhysicalFunction tsFunction, + PhysicalFunction arg0Function); VarVal execute(const Record& record, ArenaRef& arena) const override; diff --git a/nes-physical-operators/include/Functions/Meos/EverLeTextTtextPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverLeTextTtextPhysicalFunction.hpp index 5b13de2733..344c0b9cce 100644 --- a/nes-physical-operators/include/Functions/Meos/EverLeTextTtextPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/EverLeTextTtextPhysicalFunction.hpp @@ -21,16 +21,23 @@ namespace NES { +/** + * @brief Physical operator for `ever_le_text_ttext(txt0, temp)`. + * + * Ever lequal text vs ttext + * + * Generated by tools/codegen/codegen_nebula.py. + */ class EverLeTextTtextPhysicalFunction : public PhysicalFunctionConcept { public: - EverLeTextTtextPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction refFunction, - PhysicalFunction tsFunction); + EverLeTextTtextPhysicalFunction(PhysicalFunction arg0Function, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverLeTtextTextPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverLeTtextTextPhysicalFunction.hpp index 9b40274844..353eaaf203 100644 --- a/nes-physical-operators/include/Functions/Meos/EverLeTtextTextPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/EverLeTtextTextPhysicalFunction.hpp @@ -21,16 +21,23 @@ namespace NES { +/** + * @brief Physical operator for `ever_le_ttext_text(temp, txt0)`. + * + * Ever lequal ttext vs text + * + * Generated by tools/codegen/codegen_nebula.py. + */ class EverLeTtextTextPhysicalFunction : public PhysicalFunctionConcept { public: EverLeTtextTextPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction refFunction, - PhysicalFunction tsFunction); + PhysicalFunction tsFunction, + PhysicalFunction arg0Function); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverLtBigintTbigintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverLtBigintTbigintPhysicalFunction.hpp index 3496b311cd..c0f460b7c5 100644 --- a/nes-physical-operators/include/Functions/Meos/EverLtBigintTbigintPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/EverLtBigintTbigintPhysicalFunction.hpp @@ -24,15 +24,15 @@ namespace NES { /** * @brief Physical operator for `ever_lt_bigint_tbigint`. * - * Per-event ever_lt_bigint_tbigint: tests if a single-instant tfloat value ever equals a threshold. + * Per-event ever_lt_bigint_tbigint: ever-less-than scalar bigint vs tbigint. * * Generated by tools/codegen/codegen_nebula.py. */ class EverLtBigintTbigintPhysicalFunction : public PhysicalFunctionConcept { public: - EverLtBigintTbigintPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction thresholdFunction, - PhysicalFunction tsFunction); + EverLtBigintTbigintPhysicalFunction(PhysicalFunction arg0Function, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; diff --git a/nes-physical-operators/include/Functions/Meos/EverLtTbigintBigintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverLtTbigintBigintPhysicalFunction.hpp index cbb8e2338b..dd8ec19283 100644 --- a/nes-physical-operators/include/Functions/Meos/EverLtTbigintBigintPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/EverLtTbigintBigintPhysicalFunction.hpp @@ -24,15 +24,15 @@ namespace NES { /** * @brief Physical operator for `ever_lt_tbigint_bigint`. * - * Per-event ever_lt_tbigint_bigint: tests if a single-instant tbigint value ever lts a threshold. + * Per-event ever_lt_tbigint_bigint: ever-less-than tbigint vs scalar bigint. * * Generated by tools/codegen/codegen_nebula.py. */ class EverLtTbigintBigintPhysicalFunction : public PhysicalFunctionConcept { public: EverLtTbigintBigintPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction thresholdFunction, - PhysicalFunction tsFunction); + PhysicalFunction tsFunction, + PhysicalFunction arg0Function); VarVal execute(const Record& record, ArenaRef& arena) const override; diff --git a/nes-physical-operators/include/Functions/Meos/EverLtTextTtextPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverLtTextTtextPhysicalFunction.hpp index ff1d4e1de3..415498263f 100644 --- a/nes-physical-operators/include/Functions/Meos/EverLtTextTtextPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/EverLtTextTtextPhysicalFunction.hpp @@ -21,16 +21,23 @@ namespace NES { +/** + * @brief Physical operator for `ever_lt_text_ttext(txt0, temp)`. + * + * Ever ltqual text vs ttext + * + * Generated by tools/codegen/codegen_nebula.py. + */ class EverLtTextTtextPhysicalFunction : public PhysicalFunctionConcept { public: - EverLtTextTtextPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction refFunction, - PhysicalFunction tsFunction); + EverLtTextTtextPhysicalFunction(PhysicalFunction arg0Function, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverLtTtextTextPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverLtTtextTextPhysicalFunction.hpp index d3f18c8fd8..e12029c594 100644 --- a/nes-physical-operators/include/Functions/Meos/EverLtTtextTextPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/EverLtTtextTextPhysicalFunction.hpp @@ -21,16 +21,23 @@ namespace NES { +/** + * @brief Physical operator for `ever_lt_ttext_text(temp, txt0)`. + * + * Ever ltqual ttext vs text + * + * Generated by tools/codegen/codegen_nebula.py. + */ class EverLtTtextTextPhysicalFunction : public PhysicalFunctionConcept { public: EverLtTtextTextPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction refFunction, - PhysicalFunction tsFunction); + PhysicalFunction tsFunction, + PhysicalFunction arg0Function); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverNeBigintTbigintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverNeBigintTbigintPhysicalFunction.hpp index 61cdf7d943..e2f372596a 100644 --- a/nes-physical-operators/include/Functions/Meos/EverNeBigintTbigintPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/EverNeBigintTbigintPhysicalFunction.hpp @@ -24,15 +24,15 @@ namespace NES { /** * @brief Physical operator for `ever_ne_bigint_tbigint`. * - * Per-event ever_ne_bigint_tbigint: tests if a single-instant tfloat value ever equals a threshold. + * Per-event ever_ne_bigint_tbigint: ever-not-equal scalar bigint vs tbigint. * * Generated by tools/codegen/codegen_nebula.py. */ class EverNeBigintTbigintPhysicalFunction : public PhysicalFunctionConcept { public: - EverNeBigintTbigintPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction thresholdFunction, - PhysicalFunction tsFunction); + EverNeBigintTbigintPhysicalFunction(PhysicalFunction arg0Function, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; diff --git a/nes-physical-operators/include/Functions/Meos/EverNeBoolTboolPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverNeBoolTboolPhysicalFunction.hpp index bda9de3732..dfad962903 100644 --- a/nes-physical-operators/include/Functions/Meos/EverNeBoolTboolPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/EverNeBoolTboolPhysicalFunction.hpp @@ -24,15 +24,15 @@ namespace NES { /** * @brief Physical operator for `ever_ne_bool_tbool`. * - * Per-event ever_ne_bool_tbool: tests if a single-instant tfloat value ever equals a threshold. + * Per-event ever_ne_bool_tbool: ever-not-equal scalar bool vs tbool. * * Generated by tools/codegen/codegen_nebula.py. */ class EverNeBoolTboolPhysicalFunction : public PhysicalFunctionConcept { public: - EverNeBoolTboolPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction thresholdFunction, - PhysicalFunction tsFunction); + EverNeBoolTboolPhysicalFunction(PhysicalFunction arg0Function, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; diff --git a/nes-physical-operators/include/Functions/Meos/EverNeNpointTnpointPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverNeNpointTnpointPhysicalFunction.hpp index 98789d427d..f20fb9b6b5 100644 --- a/nes-physical-operators/include/Functions/Meos/EverNeNpointTnpointPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/EverNeNpointTnpointPhysicalFunction.hpp @@ -21,12 +21,25 @@ namespace NES { +/** + * @brief Physical operator for `ever_ne_npoint_tnpoint`. + * + * Ever ne npoint vs tnpoint + * + * Generated by tools/codegen/codegen_nebula.py. + */ class EverNeNpointTnpointPhysicalFunction : public PhysicalFunctionConcept { public: - EverNeNpointTnpointPhysicalFunction(PhysicalFunction rid_np, PhysicalFunction pos_np, PhysicalFunction rid_tp, PhysicalFunction pos_tp, PhysicalFunction ts); + EverNeNpointTnpointPhysicalFunction(PhysicalFunction rid0Function, + PhysicalFunction frac0Function, + PhysicalFunction ridFunction, + PhysicalFunction fracFunction, + PhysicalFunction tsFunction); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverNePoseTposePhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverNePoseTposePhysicalFunction.hpp index 227b02aa36..c531a4a021 100644 --- a/nes-physical-operators/include/Functions/Meos/EverNePoseTposePhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/EverNePoseTposePhysicalFunction.hpp @@ -21,12 +21,27 @@ namespace NES { +/** + * @brief Physical operator for `ever_ne_pose_tpose`. + * + * Ever ne pose vs tpose + * + * Generated by tools/codegen/codegen_nebula.py. + */ class EverNePoseTposePhysicalFunction : public PhysicalFunctionConcept { public: - EverNePoseTposePhysicalFunction(PhysicalFunction x2, PhysicalFunction y2, PhysicalFunction theta2, PhysicalFunction x, PhysicalFunction y, PhysicalFunction theta, PhysicalFunction ts); + EverNePoseTposePhysicalFunction(PhysicalFunction px0Function, + PhysicalFunction py0Function, + PhysicalFunction ptheta0Function, + PhysicalFunction xFunction, + PhysicalFunction yFunction, + PhysicalFunction thetaFunction, + PhysicalFunction tsFunction); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverNeTbigintBigintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverNeTbigintBigintPhysicalFunction.hpp index 54ff0c5f7b..471b8a7aaa 100644 --- a/nes-physical-operators/include/Functions/Meos/EverNeTbigintBigintPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/EverNeTbigintBigintPhysicalFunction.hpp @@ -24,15 +24,15 @@ namespace NES { /** * @brief Physical operator for `ever_ne_tbigint_bigint`. * - * Per-event ever_ne_tbigint_bigint: tests if a single-instant tbigint value ever nes a threshold. + * Per-event ever_ne_tbigint_bigint: ever-not-equal tbigint vs scalar bigint. * * Generated by tools/codegen/codegen_nebula.py. */ class EverNeTbigintBigintPhysicalFunction : public PhysicalFunctionConcept { public: EverNeTbigintBigintPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction thresholdFunction, - PhysicalFunction tsFunction); + PhysicalFunction tsFunction, + PhysicalFunction arg0Function); VarVal execute(const Record& record, ArenaRef& arena) const override; diff --git a/nes-physical-operators/include/Functions/Meos/EverNeTboolBoolPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverNeTboolBoolPhysicalFunction.hpp index fb18c1610b..e9ba883b80 100644 --- a/nes-physical-operators/include/Functions/Meos/EverNeTboolBoolPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/EverNeTboolBoolPhysicalFunction.hpp @@ -24,15 +24,15 @@ namespace NES { /** * @brief Physical operator for `ever_ne_tbool_bool`. * - * Per-event ever_ne_tbool_bool: tests if a single-instant tfloat value ever equals a threshold. + * Per-event ever_ne_tbool_bool: ever-not-equal tbool vs scalar bool. * * Generated by tools/codegen/codegen_nebula.py. */ class EverNeTboolBoolPhysicalFunction : public PhysicalFunctionConcept { public: EverNeTboolBoolPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction thresholdFunction, - PhysicalFunction tsFunction); + PhysicalFunction tsFunction, + PhysicalFunction arg0Function); VarVal execute(const Record& record, ArenaRef& arena) const override; diff --git a/nes-physical-operators/include/Functions/Meos/EverNeTcbufferTcbufferPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverNeTcbufferTcbufferPhysicalFunction.hpp index 28318c6b8b..5e1a09d2e3 100644 --- a/nes-physical-operators/include/Functions/Meos/EverNeTcbufferTcbufferPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/EverNeTcbufferTcbufferPhysicalFunction.hpp @@ -21,17 +21,28 @@ namespace NES { +/** + * @brief Physical operator for `ever_ne_tcbuffer_tcbuffer`. + * + * Per-event ever_ne_tcbuffer_tcbuffer spatial predicate. + * + * Generated by tools/codegen/codegen_nebula.py. + */ class EverNeTcbufferTcbufferPhysicalFunction : public PhysicalFunctionConcept { public: - EverNeTcbufferTcbufferPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction r1, - PhysicalFunction ts1, - PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction r2, - PhysicalFunction ts2); + EverNeTcbufferTcbufferPhysicalFunction(PhysicalFunction lonAFunction, + PhysicalFunction latAFunction, + PhysicalFunction radiusAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction lonBFunction, + PhysicalFunction latBFunction, + PhysicalFunction radiusBFunction, + PhysicalFunction tsBFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverNeTextTtextPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverNeTextTtextPhysicalFunction.hpp index 43f3c09e8e..5171ac0002 100644 --- a/nes-physical-operators/include/Functions/Meos/EverNeTextTtextPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/EverNeTextTtextPhysicalFunction.hpp @@ -21,16 +21,23 @@ namespace NES { +/** + * @brief Physical operator for `ever_ne_text_ttext(txt0, temp)`. + * + * Ever nequal text vs ttext + * + * Generated by tools/codegen/codegen_nebula.py. + */ class EverNeTextTtextPhysicalFunction : public PhysicalFunctionConcept { public: - EverNeTextTtextPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction refFunction, - PhysicalFunction tsFunction); + EverNeTextTtextPhysicalFunction(PhysicalFunction arg0Function, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverNeTgeoGeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverNeTgeoGeoPhysicalFunction.hpp index 28bad836ba..c8b1214c26 100644 --- a/nes-physical-operators/include/Functions/Meos/EverNeTgeoGeoPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/EverNeTgeoGeoPhysicalFunction.hpp @@ -21,15 +21,24 @@ namespace NES { +/** + * @brief Physical operator for `ever_ne_tgeo_geo`. + * + * Per-event ever_ne_tgeo_geo spatial predicate. + * + * Generated by tools/codegen/codegen_nebula.py. + */ class EverNeTgeoGeoPhysicalFunction : public PhysicalFunctionConcept { public: - EverNeTgeoGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, - PhysicalFunction ts, PhysicalFunction wkt); + EverNeTgeoGeoPhysicalFunction(PhysicalFunction lonFunction, + PhysicalFunction latFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverNeTgeoTgeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverNeTgeoTgeoPhysicalFunction.hpp index 7d7e4b4280..b78623271b 100644 --- a/nes-physical-operators/include/Functions/Meos/EverNeTgeoTgeoPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/EverNeTgeoTgeoPhysicalFunction.hpp @@ -21,12 +21,26 @@ namespace NES { +/** + * @brief Physical operator for `ever_ne_tgeo_tgeo`. + * + * Per-event ever_ne_tgeo_tgeo spatial predicate. + * + * Generated by tools/codegen/codegen_nebula.py. + */ class EverNeTgeoTgeoPhysicalFunction : public PhysicalFunctionConcept { public: - EverNeTgeoTgeoPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction ts1, PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction ts2); + EverNeTgeoTgeoPhysicalFunction(PhysicalFunction lonAFunction, + PhysicalFunction latAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction lonBFunction, + PhysicalFunction latBFunction, + PhysicalFunction tsBFunction); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverNeTh3indexH3indexPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverNeTh3indexH3indexPhysicalFunction.hpp index 413bbf83b7..5d89cd69fc 100644 --- a/nes-physical-operators/include/Functions/Meos/EverNeTh3indexH3indexPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/EverNeTh3indexH3indexPhysicalFunction.hpp @@ -21,14 +21,23 @@ namespace NES { +/** + * @brief Physical operator for `ever_ne_th3index_h3index(temp, (H3Index)arg0)`. + * + * Ever neual th3index vs h3index + * + * Generated by tools/codegen/codegen_nebula.py. + */ class EverNeTh3indexH3indexPhysicalFunction : public PhysicalFunctionConcept { public: - EverNeTh3indexH3indexPhysicalFunction(PhysicalFunction cell, PhysicalFunction ts, PhysicalFunction target); + EverNeTh3indexH3indexPhysicalFunction(PhysicalFunction cellFunction, + PhysicalFunction tsFunction, + PhysicalFunction arg0Function); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverNeTjsonbJsonbPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverNeTjsonbJsonbPhysicalFunction.hpp index 5dbb1e78b5..0b8402e8ed 100644 --- a/nes-physical-operators/include/Functions/Meos/EverNeTjsonbJsonbPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/EverNeTjsonbJsonbPhysicalFunction.hpp @@ -21,12 +21,23 @@ namespace NES { +/** + * @brief Physical operator for `ever_ne_tjsonb_jsonb`. + * + * Ever neual tjsonb vs jsonb + * + * Generated by tools/codegen/codegen_nebula.py. + */ class EverNeTjsonbJsonbPhysicalFunction : public PhysicalFunctionConcept { public: - EverNeTjsonbJsonbPhysicalFunction(PhysicalFunction json_str, PhysicalFunction ts, PhysicalFunction target_json); + EverNeTjsonbJsonbPhysicalFunction(PhysicalFunction json_strFunction, + PhysicalFunction tsFunction, + PhysicalFunction arg0Function); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverNeTjsonbTjsonbPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverNeTjsonbTjsonbPhysicalFunction.hpp index 4672a1af38..bc7e513009 100644 --- a/nes-physical-operators/include/Functions/Meos/EverNeTjsonbTjsonbPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/EverNeTjsonbTjsonbPhysicalFunction.hpp @@ -21,12 +21,24 @@ namespace NES { +/** + * @brief Physical operator for `ever_ne_tjsonb_tjsonb`. + * + * Ever neual tjsonb vs tjsonb + * + * Generated by tools/codegen/codegen_nebula.py. + */ class EverNeTjsonbTjsonbPhysicalFunction : public PhysicalFunctionConcept { public: - EverNeTjsonbTjsonbPhysicalFunction(PhysicalFunction json1, PhysicalFunction ts1, PhysicalFunction json2, PhysicalFunction ts2); + EverNeTjsonbTjsonbPhysicalFunction(PhysicalFunction json_strFunction, + PhysicalFunction tsFunction, + PhysicalFunction json0Function, + PhysicalFunction ts0Function); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverNeTnpointNpointPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverNeTnpointNpointPhysicalFunction.hpp index 52802bbd8b..b8a2d8d242 100644 --- a/nes-physical-operators/include/Functions/Meos/EverNeTnpointNpointPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/EverNeTnpointNpointPhysicalFunction.hpp @@ -21,12 +21,25 @@ namespace NES { +/** + * @brief Physical operator for `ever_ne_tnpoint_npoint`. + * + * Ever ne tnpoint vs npoint + * + * Generated by tools/codegen/codegen_nebula.py. + */ class EverNeTnpointNpointPhysicalFunction : public PhysicalFunctionConcept { public: - EverNeTnpointNpointPhysicalFunction(PhysicalFunction rid1, PhysicalFunction pos1, PhysicalFunction ts, PhysicalFunction rid2, PhysicalFunction pos2); + EverNeTnpointNpointPhysicalFunction(PhysicalFunction ridFunction, + PhysicalFunction fracFunction, + PhysicalFunction tsFunction, + PhysicalFunction rid0Function, + PhysicalFunction frac0Function); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverNeTnpointTnpointPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverNeTnpointTnpointPhysicalFunction.hpp index 3647332d45..e608289168 100644 --- a/nes-physical-operators/include/Functions/Meos/EverNeTnpointTnpointPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/EverNeTnpointTnpointPhysicalFunction.hpp @@ -21,13 +21,26 @@ namespace NES { +/** + * @brief Physical operator for `ever_ne_tnpoint_tnpoint`. + * + * Ever ne tnpoint vs tnpoint + * + * Generated by tools/codegen/codegen_nebula.py. + */ class EverNeTnpointTnpointPhysicalFunction : public PhysicalFunctionConcept { public: - EverNeTnpointTnpointPhysicalFunction(PhysicalFunction rid1, PhysicalFunction pos1, PhysicalFunction ts1, - PhysicalFunction rid2, PhysicalFunction pos2, PhysicalFunction ts2); + EverNeTnpointTnpointPhysicalFunction(PhysicalFunction ridFunction, + PhysicalFunction fracFunction, + PhysicalFunction tsFunction, + PhysicalFunction rid0Function, + PhysicalFunction frac0Function, + PhysicalFunction ts0Function); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverNeTposePosePhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverNeTposePosePhysicalFunction.hpp index 2a1d144bdc..ff1cec26b0 100644 --- a/nes-physical-operators/include/Functions/Meos/EverNeTposePosePhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/EverNeTposePosePhysicalFunction.hpp @@ -21,12 +21,27 @@ namespace NES { +/** + * @brief Physical operator for `ever_ne_tpose_pose`. + * + * Ever ne tpose vs pose + * + * Generated by tools/codegen/codegen_nebula.py. + */ class EverNeTposePosePhysicalFunction : public PhysicalFunctionConcept { public: - EverNeTposePosePhysicalFunction(PhysicalFunction x, PhysicalFunction y, PhysicalFunction theta, PhysicalFunction ts, PhysicalFunction x2, PhysicalFunction y2, PhysicalFunction theta2); + EverNeTposePosePhysicalFunction(PhysicalFunction xFunction, + PhysicalFunction yFunction, + PhysicalFunction thetaFunction, + PhysicalFunction tsFunction, + PhysicalFunction px0Function, + PhysicalFunction py0Function, + PhysicalFunction ptheta0Function); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverNeTposeTposePhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverNeTposeTposePhysicalFunction.hpp index 06e0615b1b..872dc90ace 100644 --- a/nes-physical-operators/include/Functions/Meos/EverNeTposeTposePhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/EverNeTposeTposePhysicalFunction.hpp @@ -21,15 +21,28 @@ namespace NES { +/** + * @brief Physical operator for `ever_ne_tpose_tpose`. + * + * Ever ne tpose vs tpose + * + * Generated by tools/codegen/codegen_nebula.py. + */ class EverNeTposeTposePhysicalFunction : public PhysicalFunctionConcept { public: - EverNeTposeTposePhysicalFunction(PhysicalFunction x1, PhysicalFunction y1, PhysicalFunction theta1, - PhysicalFunction ts1, - PhysicalFunction x2, PhysicalFunction y2, PhysicalFunction theta2, - PhysicalFunction ts2); + EverNeTposeTposePhysicalFunction(PhysicalFunction xFunction, + PhysicalFunction yFunction, + PhysicalFunction thetaFunction, + PhysicalFunction tsFunction, + PhysicalFunction px0Function, + PhysicalFunction py0Function, + PhysicalFunction ptheta0Function, + PhysicalFunction ts0Function); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverNeTquadbinQuadbinPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverNeTquadbinQuadbinPhysicalFunction.hpp index 4eb94e28ee..531e0a4e22 100644 --- a/nes-physical-operators/include/Functions/Meos/EverNeTquadbinQuadbinPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/EverNeTquadbinQuadbinPhysicalFunction.hpp @@ -21,12 +21,23 @@ namespace NES { +/** + * @brief Physical operator for `ever_ne_tquadbin_quadbin(temp, (Quadbin)arg0)`. + * + * Ever neual tquadbin vs quadbin + * + * Generated by tools/codegen/codegen_nebula.py. + */ class EverNeTquadbinQuadbinPhysicalFunction : public PhysicalFunctionConcept { public: - EverNeTquadbinQuadbinPhysicalFunction(PhysicalFunction inst_cell, PhysicalFunction ts, PhysicalFunction cell); + EverNeTquadbinQuadbinPhysicalFunction(PhysicalFunction cellFunction, + PhysicalFunction tsFunction, + PhysicalFunction arg0Function); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/EverNeTtextTextPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/EverNeTtextTextPhysicalFunction.hpp index 729ae700a2..0a8eaaec49 100644 --- a/nes-physical-operators/include/Functions/Meos/EverNeTtextTextPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/EverNeTtextTextPhysicalFunction.hpp @@ -21,16 +21,23 @@ namespace NES { +/** + * @brief Physical operator for `ever_ne_ttext_text(temp, txt0)`. + * + * Ever nequal ttext vs text + * + * Generated by tools/codegen/codegen_nebula.py. + */ class EverNeTtextTextPhysicalFunction : public PhysicalFunctionConcept { public: EverNeTtextTextPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction refFunction, - PhysicalFunction tsFunction); + PhysicalFunction tsFunction, + PhysicalFunction arg0Function); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/FloatspanLowerIncPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/FloatspanLowerIncPhysicalFunction.hpp index 854ad3cd5d..df7ca32892 100644 --- a/nes-physical-operators/include/Functions/Meos/FloatspanLowerIncPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/FloatspanLowerIncPhysicalFunction.hpp @@ -21,12 +21,21 @@ namespace NES { +/** + * @brief Physical operator for `span_lower_inc`. + * + * Floatspan lower_inc + * + * Generated by tools/codegen/codegen_nebula.py. + */ class FloatspanLowerIncPhysicalFunction : public PhysicalFunctionConcept { public: - FloatspanLowerIncPhysicalFunction(PhysicalFunction sp); + FloatspanLowerIncPhysicalFunction(PhysicalFunction spFunction); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/FloatspanLowerPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/FloatspanLowerPhysicalFunction.hpp index b8716cd5a8..92eba0c374 100644 --- a/nes-physical-operators/include/Functions/Meos/FloatspanLowerPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/FloatspanLowerPhysicalFunction.hpp @@ -21,12 +21,21 @@ namespace NES { +/** + * @brief Physical operator for `floatspan_lower`. + * + * Floatspan lower + * + * Generated by tools/codegen/codegen_nebula.py. + */ class FloatspanLowerPhysicalFunction : public PhysicalFunctionConcept { public: - FloatspanLowerPhysicalFunction(PhysicalFunction sp); + FloatspanLowerPhysicalFunction(PhysicalFunction spFunction); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/FloatspanUpperIncPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/FloatspanUpperIncPhysicalFunction.hpp index 9607979672..3bd13e5de4 100644 --- a/nes-physical-operators/include/Functions/Meos/FloatspanUpperIncPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/FloatspanUpperIncPhysicalFunction.hpp @@ -21,12 +21,21 @@ namespace NES { +/** + * @brief Physical operator for `span_upper_inc`. + * + * Floatspan upper_inc + * + * Generated by tools/codegen/codegen_nebula.py. + */ class FloatspanUpperIncPhysicalFunction : public PhysicalFunctionConcept { public: - FloatspanUpperIncPhysicalFunction(PhysicalFunction sp); + FloatspanUpperIncPhysicalFunction(PhysicalFunction spFunction); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/FloatspanUpperPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/FloatspanUpperPhysicalFunction.hpp index b7702106f4..1007fc20d9 100644 --- a/nes-physical-operators/include/Functions/Meos/FloatspanUpperPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/FloatspanUpperPhysicalFunction.hpp @@ -21,12 +21,21 @@ namespace NES { +/** + * @brief Physical operator for `floatspan_upper`. + * + * Floatspan upper + * + * Generated by tools/codegen/codegen_nebula.py. + */ class FloatspanUpperPhysicalFunction : public PhysicalFunctionConcept { public: - FloatspanUpperPhysicalFunction(PhysicalFunction sp); + FloatspanUpperPhysicalFunction(PhysicalFunction spFunction); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/FloatspanWidthPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/FloatspanWidthPhysicalFunction.hpp index d1a3aae9f1..d8541a233e 100644 --- a/nes-physical-operators/include/Functions/Meos/FloatspanWidthPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/FloatspanWidthPhysicalFunction.hpp @@ -21,12 +21,21 @@ namespace NES { +/** + * @brief Physical operator for `floatspan_width`. + * + * Floatspan width + * + * Generated by tools/codegen/codegen_nebula.py. + */ class FloatspanWidthPhysicalFunction : public PhysicalFunctionConcept { public: - FloatspanWidthPhysicalFunction(PhysicalFunction sp); + FloatspanWidthPhysicalFunction(PhysicalFunction spFunction); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeoAsEwktPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeoAsEwktPhysicalFunction.hpp index b400321472..71650992f7 100644 --- a/nes-physical-operators/include/Functions/Meos/GeoAsEwktPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/GeoAsEwktPhysicalFunction.hpp @@ -21,12 +21,22 @@ namespace NES { +/** + * @brief Physical operator for `geo_as_ewkt(temp, (int)arg0)`. + * + * Geometry as EWKT + * + * Generated by tools/codegen/codegen_nebula.py. + */ class GeoAsEwktPhysicalFunction : public PhysicalFunctionConcept { public: - GeoAsEwktPhysicalFunction(PhysicalFunction wkt, PhysicalFunction precision); + GeoAsEwktPhysicalFunction(PhysicalFunction wktFunction, + PhysicalFunction arg0Function); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeoAsGeojsonPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeoAsGeojsonPhysicalFunction.hpp index e8ad9401a5..161cb301e6 100644 --- a/nes-physical-operators/include/Functions/Meos/GeoAsGeojsonPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/GeoAsGeojsonPhysicalFunction.hpp @@ -21,12 +21,23 @@ namespace NES { +/** + * @brief Physical operator for `geo_as_geojson(temp, (int)arg0, (int)arg1, nullptr)`. + * + * Geometry as GeoJSON + * + * Generated by tools/codegen/codegen_nebula.py. + */ class GeoAsGeojsonPhysicalFunction : public PhysicalFunctionConcept { public: - GeoAsGeojsonPhysicalFunction(PhysicalFunction wkt, PhysicalFunction option, PhysicalFunction precision); + GeoAsGeojsonPhysicalFunction(PhysicalFunction wktFunction, + PhysicalFunction arg0Function, + PhysicalFunction arg1Function); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeoEqualsPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeoEqualsPhysicalFunction.hpp index c3f9b3222a..dc8f738575 100644 --- a/nes-physical-operators/include/Functions/Meos/GeoEqualsPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/GeoEqualsPhysicalFunction.hpp @@ -21,14 +21,22 @@ namespace NES { +/** + * @brief Physical operator for `geom_equals`. + * + * Geometry equals + * + * Generated by tools/codegen/codegen_nebula.py. + */ class GeoEqualsPhysicalFunction : public PhysicalFunctionConcept { public: - GeoEqualsPhysicalFunction(PhysicalFunction wkt1, PhysicalFunction wkt2); + GeoEqualsPhysicalFunction(PhysicalFunction wktFunction, + PhysicalFunction arg0Function); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeoGeoNPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeoGeoNPhysicalFunction.hpp index 8e6b2244d6..fdffa991a9 100644 --- a/nes-physical-operators/include/Functions/Meos/GeoGeoNPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/GeoGeoNPhysicalFunction.hpp @@ -21,12 +21,22 @@ namespace NES { +/** + * @brief Physical operator for `geo_geo_n(temp, (int)arg0)`. + * + * Nth geometry in collection + * + * Generated by tools/codegen/codegen_nebula.py. + */ class GeoGeoNPhysicalFunction : public PhysicalFunctionConcept { public: - GeoGeoNPhysicalFunction(PhysicalFunction wkt, PhysicalFunction n); + GeoGeoNPhysicalFunction(PhysicalFunction wktFunction, + PhysicalFunction arg0Function); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeoIsUnitaryPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeoIsUnitaryPhysicalFunction.hpp index ed45b95057..d79836dcbd 100644 --- a/nes-physical-operators/include/Functions/Meos/GeoIsUnitaryPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/GeoIsUnitaryPhysicalFunction.hpp @@ -21,14 +21,21 @@ namespace NES { +/** + * @brief Physical operator for `geo_is_unitary`. + * + * Is geometry unitary + * + * Generated by tools/codegen/codegen_nebula.py. + */ class GeoIsUnitaryPhysicalFunction : public PhysicalFunctionConcept { public: - explicit GeoIsUnitaryPhysicalFunction(PhysicalFunction wkt); + GeoIsUnitaryPhysicalFunction(PhysicalFunction wktFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeoNumGeosPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeoNumGeosPhysicalFunction.hpp index 98f5925b9b..814504647c 100644 --- a/nes-physical-operators/include/Functions/Meos/GeoNumGeosPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/GeoNumGeosPhysicalFunction.hpp @@ -21,14 +21,21 @@ namespace NES { +/** + * @brief Physical operator for `geo_num_geos`. + * + * Count geometry components + * + * Generated by tools/codegen/codegen_nebula.py. + */ class GeoNumGeosPhysicalFunction : public PhysicalFunctionConcept { public: - explicit GeoNumGeosPhysicalFunction(PhysicalFunction wkt); + GeoNumGeosPhysicalFunction(PhysicalFunction wktFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeoNumPointsPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeoNumPointsPhysicalFunction.hpp index d3f0c444a2..ced5d88d05 100644 --- a/nes-physical-operators/include/Functions/Meos/GeoNumPointsPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/GeoNumPointsPhysicalFunction.hpp @@ -21,14 +21,21 @@ namespace NES { +/** + * @brief Physical operator for `geo_num_points`. + * + * Count geometry points + * + * Generated by tools/codegen/codegen_nebula.py. + */ class GeoNumPointsPhysicalFunction : public PhysicalFunctionConcept { public: - explicit GeoNumPointsPhysicalFunction(PhysicalFunction wkt); + GeoNumPointsPhysicalFunction(PhysicalFunction wktFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeoPointsPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeoPointsPhysicalFunction.hpp index 84a1a22979..a4baeec916 100644 --- a/nes-physical-operators/include/Functions/Meos/GeoPointsPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/GeoPointsPhysicalFunction.hpp @@ -21,12 +21,21 @@ namespace NES { +/** + * @brief Physical operator for `geo_points`. + * + * Geometry geo points + * + * Generated by tools/codegen/codegen_nebula.py. + */ class GeoPointsPhysicalFunction : public PhysicalFunctionConcept { public: - GeoPointsPhysicalFunction(PhysicalFunction wkt); + GeoPointsPhysicalFunction(PhysicalFunction wktFunction); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeoReversePhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeoReversePhysicalFunction.hpp index 47707c49b1..e3b4f7e9ed 100644 --- a/nes-physical-operators/include/Functions/Meos/GeoReversePhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/GeoReversePhysicalFunction.hpp @@ -21,12 +21,21 @@ namespace NES { +/** + * @brief Physical operator for `geo_reverse`. + * + * Geometry geo reverse + * + * Generated by tools/codegen/codegen_nebula.py. + */ class GeoReversePhysicalFunction : public PhysicalFunctionConcept { public: - GeoReversePhysicalFunction(PhysicalFunction wkt); + GeoReversePhysicalFunction(PhysicalFunction wktFunction); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeoRoundPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeoRoundPhysicalFunction.hpp index a71935cf2c..eabf2d3397 100644 --- a/nes-physical-operators/include/Functions/Meos/GeoRoundPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/GeoRoundPhysicalFunction.hpp @@ -21,12 +21,22 @@ namespace NES { +/** + * @brief Physical operator for `geo_round(temp, (int)dec)`. + * + * Round geometry coordinates + * + * Generated by tools/codegen/codegen_nebula.py. + */ class GeoRoundPhysicalFunction : public PhysicalFunctionConcept { public: - GeoRoundPhysicalFunction(PhysicalFunction wkt, PhysicalFunction maxdd); + GeoRoundPhysicalFunction(PhysicalFunction wktFunction, + PhysicalFunction arg0Function); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeoSamePhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeoSamePhysicalFunction.hpp index a2053e8731..4579ada6cc 100644 --- a/nes-physical-operators/include/Functions/Meos/GeoSamePhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/GeoSamePhysicalFunction.hpp @@ -21,14 +21,22 @@ namespace NES { +/** + * @brief Physical operator for `geo_same`. + * + * Geometry same + * + * Generated by tools/codegen/codegen_nebula.py. + */ class GeoSamePhysicalFunction : public PhysicalFunctionConcept { public: - GeoSamePhysicalFunction(PhysicalFunction wkt1, PhysicalFunction wkt2); + GeoSamePhysicalFunction(PhysicalFunction wktFunction, + PhysicalFunction arg0Function); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeoSetSridPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeoSetSridPhysicalFunction.hpp index 76be53ae86..131617606b 100644 --- a/nes-physical-operators/include/Functions/Meos/GeoSetSridPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/GeoSetSridPhysicalFunction.hpp @@ -21,12 +21,22 @@ namespace NES { +/** + * @brief Physical operator for `geo_set_srid(temp, (int32_t)srid)`. + * + * Set geometry SRID + * + * Generated by tools/codegen/codegen_nebula.py. + */ class GeoSetSridPhysicalFunction : public PhysicalFunctionConcept { public: - GeoSetSridPhysicalFunction(PhysicalFunction wkt, PhysicalFunction srid); + GeoSetSridPhysicalFunction(PhysicalFunction wktFunction, + PhysicalFunction arg0Function); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeoSridPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeoSridPhysicalFunction.hpp index 3e452c1ec7..17325bfaca 100644 --- a/nes-physical-operators/include/Functions/Meos/GeoSridPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/GeoSridPhysicalFunction.hpp @@ -21,14 +21,21 @@ namespace NES { +/** + * @brief Physical operator for `geo_srid`. + * + * Get geometry SRID + * + * Generated by tools/codegen/codegen_nebula.py. + */ class GeoSridPhysicalFunction : public PhysicalFunctionConcept { public: - explicit GeoSridPhysicalFunction(PhysicalFunction wkt); + GeoSridPhysicalFunction(PhysicalFunction wktFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeoTransformPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeoTransformPhysicalFunction.hpp index 6498c79b57..bb039402fe 100644 --- a/nes-physical-operators/include/Functions/Meos/GeoTransformPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/GeoTransformPhysicalFunction.hpp @@ -21,12 +21,22 @@ namespace NES { +/** + * @brief Physical operator for `geo_transform(temp, (int32_t)srid)`. + * + * Transform geometry SRID + * + * Generated by tools/codegen/codegen_nebula.py. + */ class GeoTransformPhysicalFunction : public PhysicalFunctionConcept { public: - GeoTransformPhysicalFunction(PhysicalFunction wkt, PhysicalFunction srid_to); + GeoTransformPhysicalFunction(PhysicalFunction wktFunction, + PhysicalFunction arg0Function); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeogAreaPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeogAreaPhysicalFunction.hpp index 65ffccf01d..2ea2c9c4af 100644 --- a/nes-physical-operators/include/Functions/Meos/GeogAreaPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/GeogAreaPhysicalFunction.hpp @@ -21,14 +21,21 @@ namespace NES { +/** + * @brief Physical operator for `geog_area`. + * + * geog area + * + * Generated by tools/codegen/codegen_nebula.py. + */ class GeogAreaPhysicalFunction : public PhysicalFunctionConcept { public: - explicit GeogAreaPhysicalFunction(PhysicalFunction wkt1Function); + GeogAreaPhysicalFunction(PhysicalFunction wktFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeogCentroidPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeogCentroidPhysicalFunction.hpp index a92650b0b0..77626d8787 100644 --- a/nes-physical-operators/include/Functions/Meos/GeogCentroidPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/GeogCentroidPhysicalFunction.hpp @@ -21,12 +21,22 @@ namespace NES { +/** + * @brief Physical operator for `geog_centroid(temp, (bool)arg0)`. + * + * Geography centroid + * + * Generated by tools/codegen/codegen_nebula.py. + */ class GeogCentroidPhysicalFunction : public PhysicalFunctionConcept { public: - GeogCentroidPhysicalFunction(PhysicalFunction wkt, PhysicalFunction use_spheroid); + GeogCentroidPhysicalFunction(PhysicalFunction wktFunction, + PhysicalFunction arg0Function); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeogDistancePhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeogDistancePhysicalFunction.hpp index de46d9e42d..03702ab8c5 100644 --- a/nes-physical-operators/include/Functions/Meos/GeogDistancePhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/GeogDistancePhysicalFunction.hpp @@ -21,14 +21,22 @@ namespace NES { +/** + * @brief Physical operator for `geog_distance`. + * + * Geography distance + * + * Generated by tools/codegen/codegen_nebula.py. + */ class GeogDistancePhysicalFunction : public PhysicalFunctionConcept { public: - GeogDistancePhysicalFunction(PhysicalFunction wkt1, PhysicalFunction wkt2); + GeogDistancePhysicalFunction(PhysicalFunction wktFunction, + PhysicalFunction arg0Function); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeogDwithinPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeogDwithinPhysicalFunction.hpp index 20e604f0e3..c973d4839f 100644 --- a/nes-physical-operators/include/Functions/Meos/GeogDwithinPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/GeogDwithinPhysicalFunction.hpp @@ -21,14 +21,23 @@ namespace NES { +/** + * @brief Physical operator for `geog_dwithin`. + * + * geog_dwithin with distance + * + * Generated by tools/codegen/codegen_nebula.py. + */ class GeogDwithinPhysicalFunction : public PhysicalFunctionConcept { public: - GeogDwithinPhysicalFunction(PhysicalFunction wkt1, PhysicalFunction wkt2, PhysicalFunction tolerance); + GeogDwithinPhysicalFunction(PhysicalFunction wktFunction, + PhysicalFunction arg0Function, + PhysicalFunction arg1Function); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeogIntersectsPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeogIntersectsPhysicalFunction.hpp index 5e81e97871..9b6ef97ffc 100644 --- a/nes-physical-operators/include/Functions/Meos/GeogIntersectsPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/GeogIntersectsPhysicalFunction.hpp @@ -21,14 +21,22 @@ namespace NES { +/** + * @brief Physical operator for `geog_intersects`. + * + * Geography intersects + * + * Generated by tools/codegen/codegen_nebula.py. + */ class GeogIntersectsPhysicalFunction : public PhysicalFunctionConcept { public: - GeogIntersectsPhysicalFunction(PhysicalFunction wkt1, PhysicalFunction wkt2); + GeogIntersectsPhysicalFunction(PhysicalFunction wktFunction, + PhysicalFunction arg0Function); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeogLengthPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeogLengthPhysicalFunction.hpp index 281637b5da..44067de9f9 100644 --- a/nes-physical-operators/include/Functions/Meos/GeogLengthPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/GeogLengthPhysicalFunction.hpp @@ -21,14 +21,21 @@ namespace NES { +/** + * @brief Physical operator for `geog_length`. + * + * geog length + * + * Generated by tools/codegen/codegen_nebula.py. + */ class GeogLengthPhysicalFunction : public PhysicalFunctionConcept { public: - explicit GeogLengthPhysicalFunction(PhysicalFunction wkt1Function); + GeogLengthPhysicalFunction(PhysicalFunction wktFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeogPerimeterPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeogPerimeterPhysicalFunction.hpp index 589296f949..3c91dba2fa 100644 --- a/nes-physical-operators/include/Functions/Meos/GeogPerimeterPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/GeogPerimeterPhysicalFunction.hpp @@ -21,14 +21,21 @@ namespace NES { +/** + * @brief Physical operator for `geog_perimeter`. + * + * geog perimeter + * + * Generated by tools/codegen/codegen_nebula.py. + */ class GeogPerimeterPhysicalFunction : public PhysicalFunctionConcept { public: - explicit GeogPerimeterPhysicalFunction(PhysicalFunction wkt1Function); + GeogPerimeterPhysicalFunction(PhysicalFunction wktFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeogPointMake2dPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeogPointMake2dPhysicalFunction.hpp index 6b47a161b3..ac7e9173d8 100644 --- a/nes-physical-operators/include/Functions/Meos/GeogPointMake2dPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/GeogPointMake2dPhysicalFunction.hpp @@ -21,12 +21,23 @@ namespace NES { +/** + * @brief Physical operator for `geogpoint_make2d((int32_t)srid, x, y)`. + * + * Make 2D geography point + * + * Generated by tools/codegen/codegen_nebula.py. + */ class GeogPointMake2dPhysicalFunction : public PhysicalFunctionConcept { public: - GeogPointMake2dPhysicalFunction(PhysicalFunction srid, PhysicalFunction x, PhysicalFunction y); + GeogPointMake2dPhysicalFunction(PhysicalFunction sridFunction, + PhysicalFunction xFunction, + PhysicalFunction yFunction); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeogPointMake3dzPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeogPointMake3dzPhysicalFunction.hpp index 274fac0b04..919d75374b 100644 --- a/nes-physical-operators/include/Functions/Meos/GeogPointMake3dzPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/GeogPointMake3dzPhysicalFunction.hpp @@ -21,12 +21,24 @@ namespace NES { +/** + * @brief Physical operator for `geogpoint_make3dz((int32_t)srid, x, y, z)`. + * + * Make 3D geography point + * + * Generated by tools/codegen/codegen_nebula.py. + */ class GeogPointMake3dzPhysicalFunction : public PhysicalFunctionConcept { public: - GeogPointMake3dzPhysicalFunction(PhysicalFunction srid, PhysicalFunction x, PhysicalFunction y, PhysicalFunction z); + GeogPointMake3dzPhysicalFunction(PhysicalFunction sridFunction, + PhysicalFunction xFunction, + PhysicalFunction yFunction, + PhysicalFunction zFunction); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeogToGeomPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeogToGeomPhysicalFunction.hpp index cb732983de..138c125997 100644 --- a/nes-physical-operators/include/Functions/Meos/GeogToGeomPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/GeogToGeomPhysicalFunction.hpp @@ -21,12 +21,21 @@ namespace NES { +/** + * @brief Physical operator for `geog_to_geom`. + * + * geog to geom + * + * Generated by tools/codegen/codegen_nebula.py. + */ class GeogToGeomPhysicalFunction : public PhysicalFunctionConcept { public: - GeogToGeomPhysicalFunction(PhysicalFunction wkt); + GeogToGeomPhysicalFunction(PhysicalFunction wktFunction); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeomAzimuthPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeomAzimuthPhysicalFunction.hpp index fc38a19987..9c931903ad 100644 --- a/nes-physical-operators/include/Functions/Meos/GeomAzimuthPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/GeomAzimuthPhysicalFunction.hpp @@ -21,14 +21,21 @@ namespace NES { +/** + * @brief Physical operator for `geom_azimuth`. + * + * Geometry azimuth (single point) + * + * Generated by tools/codegen/codegen_nebula.py. + */ class GeomAzimuthPhysicalFunction : public PhysicalFunctionConcept { public: - GeomAzimuthPhysicalFunction(PhysicalFunction wkt1Function, PhysicalFunction wkt2Function); + GeomAzimuthPhysicalFunction(PhysicalFunction wktFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeomBoundaryPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeomBoundaryPhysicalFunction.hpp index af559402d7..a1f1039513 100644 --- a/nes-physical-operators/include/Functions/Meos/GeomBoundaryPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/GeomBoundaryPhysicalFunction.hpp @@ -21,12 +21,21 @@ namespace NES { +/** + * @brief Physical operator for `geom_boundary`. + * + * Geometry geom boundary + * + * Generated by tools/codegen/codegen_nebula.py. + */ class GeomBoundaryPhysicalFunction : public PhysicalFunctionConcept { public: - GeomBoundaryPhysicalFunction(PhysicalFunction wkt); + GeomBoundaryPhysicalFunction(PhysicalFunction wktFunction); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeomCentroidPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeomCentroidPhysicalFunction.hpp index 4701a611bb..501a04b43a 100644 --- a/nes-physical-operators/include/Functions/Meos/GeomCentroidPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/GeomCentroidPhysicalFunction.hpp @@ -21,12 +21,21 @@ namespace NES { +/** + * @brief Physical operator for `geom_centroid`. + * + * Geometry geom centroid + * + * Generated by tools/codegen/codegen_nebula.py. + */ class GeomCentroidPhysicalFunction : public PhysicalFunctionConcept { public: - GeomCentroidPhysicalFunction(PhysicalFunction wkt); + GeomCentroidPhysicalFunction(PhysicalFunction wktFunction); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeomContainsPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeomContainsPhysicalFunction.hpp index 4ddd7fdc80..bcfa0ae1c6 100644 --- a/nes-physical-operators/include/Functions/Meos/GeomContainsPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/GeomContainsPhysicalFunction.hpp @@ -21,14 +21,22 @@ namespace NES { +/** + * @brief Physical operator for `geom_contains`. + * + * Geometry contains + * + * Generated by tools/codegen/codegen_nebula.py. + */ class GeomContainsPhysicalFunction : public PhysicalFunctionConcept { public: - GeomContainsPhysicalFunction(PhysicalFunction wkt1Function, PhysicalFunction wkt2Function); + GeomContainsPhysicalFunction(PhysicalFunction wktFunction, + PhysicalFunction arg0Function); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeomConvexHullPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeomConvexHullPhysicalFunction.hpp index 70f3cbe643..f99a7c4a6c 100644 --- a/nes-physical-operators/include/Functions/Meos/GeomConvexHullPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/GeomConvexHullPhysicalFunction.hpp @@ -21,12 +21,21 @@ namespace NES { +/** + * @brief Physical operator for `geom_convex_hull`. + * + * Geometry geom convex hull + * + * Generated by tools/codegen/codegen_nebula.py. + */ class GeomConvexHullPhysicalFunction : public PhysicalFunctionConcept { public: - GeomConvexHullPhysicalFunction(PhysicalFunction wkt); + GeomConvexHullPhysicalFunction(PhysicalFunction wktFunction); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeomCoversPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeomCoversPhysicalFunction.hpp index fc4766e34e..27ff29fd18 100644 --- a/nes-physical-operators/include/Functions/Meos/GeomCoversPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/GeomCoversPhysicalFunction.hpp @@ -21,14 +21,22 @@ namespace NES { +/** + * @brief Physical operator for `geom_covers`. + * + * Geometry covers + * + * Generated by tools/codegen/codegen_nebula.py. + */ class GeomCoversPhysicalFunction : public PhysicalFunctionConcept { public: - GeomCoversPhysicalFunction(PhysicalFunction wkt1Function, PhysicalFunction wkt2Function); + GeomCoversPhysicalFunction(PhysicalFunction wktFunction, + PhysicalFunction arg0Function); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeomDifference2dPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeomDifference2dPhysicalFunction.hpp index 4e5ebac981..f8ed39138f 100644 --- a/nes-physical-operators/include/Functions/Meos/GeomDifference2dPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/GeomDifference2dPhysicalFunction.hpp @@ -21,12 +21,22 @@ namespace NES { +/** + * @brief Physical operator for `geom_difference2d`. + * + * geom_difference2d + * + * Generated by tools/codegen/codegen_nebula.py. + */ class GeomDifference2dPhysicalFunction : public PhysicalFunctionConcept { public: - GeomDifference2dPhysicalFunction(PhysicalFunction wkt1, PhysicalFunction wkt2); + GeomDifference2dPhysicalFunction(PhysicalFunction wktFunction, + PhysicalFunction arg0Function); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeomDisjoint2dPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeomDisjoint2dPhysicalFunction.hpp index b503ce25b0..a5aae0e8da 100644 --- a/nes-physical-operators/include/Functions/Meos/GeomDisjoint2dPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/GeomDisjoint2dPhysicalFunction.hpp @@ -21,14 +21,22 @@ namespace NES { +/** + * @brief Physical operator for `geom_disjoint2d`. + * + * Geometry disjoint 2D + * + * Generated by tools/codegen/codegen_nebula.py. + */ class GeomDisjoint2dPhysicalFunction : public PhysicalFunctionConcept { public: - GeomDisjoint2dPhysicalFunction(PhysicalFunction wkt1Function, PhysicalFunction wkt2Function); + GeomDisjoint2dPhysicalFunction(PhysicalFunction wktFunction, + PhysicalFunction arg0Function); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeomDistance2dPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeomDistance2dPhysicalFunction.hpp index 139d856a64..c25ab64449 100644 --- a/nes-physical-operators/include/Functions/Meos/GeomDistance2dPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/GeomDistance2dPhysicalFunction.hpp @@ -21,14 +21,22 @@ namespace NES { +/** + * @brief Physical operator for `geom_distance2d`. + * + * Geometry 2D distance + * + * Generated by tools/codegen/codegen_nebula.py. + */ class GeomDistance2dPhysicalFunction : public PhysicalFunctionConcept { public: - GeomDistance2dPhysicalFunction(PhysicalFunction wkt1Function, PhysicalFunction wkt2Function); + GeomDistance2dPhysicalFunction(PhysicalFunction wktFunction, + PhysicalFunction arg0Function); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeomDistance3dPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeomDistance3dPhysicalFunction.hpp index 1e609d2cf7..3797576614 100644 --- a/nes-physical-operators/include/Functions/Meos/GeomDistance3dPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/GeomDistance3dPhysicalFunction.hpp @@ -21,14 +21,22 @@ namespace NES { +/** + * @brief Physical operator for `geom_distance3d`. + * + * Geometry 3D distance + * + * Generated by tools/codegen/codegen_nebula.py. + */ class GeomDistance3dPhysicalFunction : public PhysicalFunctionConcept { public: - GeomDistance3dPhysicalFunction(PhysicalFunction wkt1Function, PhysicalFunction wkt2Function); + GeomDistance3dPhysicalFunction(PhysicalFunction wktFunction, + PhysicalFunction arg0Function); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeomDwithin2dPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeomDwithin2dPhysicalFunction.hpp index d2410721bc..3cb8500f39 100644 --- a/nes-physical-operators/include/Functions/Meos/GeomDwithin2dPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/GeomDwithin2dPhysicalFunction.hpp @@ -21,14 +21,23 @@ namespace NES { +/** + * @brief Physical operator for `geom_dwithin2d`. + * + * geom_dwithin2d with distance + * + * Generated by tools/codegen/codegen_nebula.py. + */ class GeomDwithin2dPhysicalFunction : public PhysicalFunctionConcept { public: - GeomDwithin2dPhysicalFunction(PhysicalFunction wkt1Function, PhysicalFunction wkt2Function, PhysicalFunction distFunction); + GeomDwithin2dPhysicalFunction(PhysicalFunction wktFunction, + PhysicalFunction arg0Function, + PhysicalFunction arg1Function); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeomDwithin3dPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeomDwithin3dPhysicalFunction.hpp index 4e895d8a95..0f987f800f 100644 --- a/nes-physical-operators/include/Functions/Meos/GeomDwithin3dPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/GeomDwithin3dPhysicalFunction.hpp @@ -21,14 +21,23 @@ namespace NES { +/** + * @brief Physical operator for `geom_dwithin3d`. + * + * geom_dwithin3d with distance + * + * Generated by tools/codegen/codegen_nebula.py. + */ class GeomDwithin3dPhysicalFunction : public PhysicalFunctionConcept { public: - GeomDwithin3dPhysicalFunction(PhysicalFunction wkt1Function, PhysicalFunction wkt2Function, PhysicalFunction distFunction); + GeomDwithin3dPhysicalFunction(PhysicalFunction wktFunction, + PhysicalFunction arg0Function, + PhysicalFunction arg1Function); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeomDwithinPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeomDwithinPhysicalFunction.hpp index 75375972e6..bbbe73c42b 100644 --- a/nes-physical-operators/include/Functions/Meos/GeomDwithinPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/GeomDwithinPhysicalFunction.hpp @@ -21,14 +21,23 @@ namespace NES { +/** + * @brief Physical operator for `geom_dwithin`. + * + * geom_dwithin with distance + * + * Generated by tools/codegen/codegen_nebula.py. + */ class GeomDwithinPhysicalFunction : public PhysicalFunctionConcept { public: - GeomDwithinPhysicalFunction(PhysicalFunction wkt1, PhysicalFunction wkt2, PhysicalFunction tolerance); + GeomDwithinPhysicalFunction(PhysicalFunction wktFunction, + PhysicalFunction arg0Function, + PhysicalFunction arg1Function); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeomIntersection2dCollPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeomIntersection2dCollPhysicalFunction.hpp index f9377c5aa3..85e2c338df 100644 --- a/nes-physical-operators/include/Functions/Meos/GeomIntersection2dCollPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/GeomIntersection2dCollPhysicalFunction.hpp @@ -21,12 +21,22 @@ namespace NES { +/** + * @brief Physical operator for `geom_intersection2d_coll`. + * + * geom_intersection2d_coll + * + * Generated by tools/codegen/codegen_nebula.py. + */ class GeomIntersection2dCollPhysicalFunction : public PhysicalFunctionConcept { public: - GeomIntersection2dCollPhysicalFunction(PhysicalFunction wkt1, PhysicalFunction wkt2); + GeomIntersection2dCollPhysicalFunction(PhysicalFunction wktFunction, + PhysicalFunction arg0Function); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeomIntersection2dPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeomIntersection2dPhysicalFunction.hpp index 80cee17fa6..21a8478952 100644 --- a/nes-physical-operators/include/Functions/Meos/GeomIntersection2dPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/GeomIntersection2dPhysicalFunction.hpp @@ -21,12 +21,22 @@ namespace NES { +/** + * @brief Physical operator for `geom_intersection2d`. + * + * geom_intersection2d + * + * Generated by tools/codegen/codegen_nebula.py. + */ class GeomIntersection2dPhysicalFunction : public PhysicalFunctionConcept { public: - GeomIntersection2dPhysicalFunction(PhysicalFunction wkt1, PhysicalFunction wkt2); + GeomIntersection2dPhysicalFunction(PhysicalFunction wktFunction, + PhysicalFunction arg0Function); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeomIntersects2dPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeomIntersects2dPhysicalFunction.hpp index 2aba593ea7..173ee38533 100644 --- a/nes-physical-operators/include/Functions/Meos/GeomIntersects2dPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/GeomIntersects2dPhysicalFunction.hpp @@ -21,14 +21,22 @@ namespace NES { +/** + * @brief Physical operator for `geom_intersects2d`. + * + * Geometry intersects 2D + * + * Generated by tools/codegen/codegen_nebula.py. + */ class GeomIntersects2dPhysicalFunction : public PhysicalFunctionConcept { public: - GeomIntersects2dPhysicalFunction(PhysicalFunction wkt1Function, PhysicalFunction wkt2Function); + GeomIntersects2dPhysicalFunction(PhysicalFunction wktFunction, + PhysicalFunction arg0Function); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeomIntersects3dPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeomIntersects3dPhysicalFunction.hpp index fc27c5635e..9ab5a74d00 100644 --- a/nes-physical-operators/include/Functions/Meos/GeomIntersects3dPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/GeomIntersects3dPhysicalFunction.hpp @@ -21,14 +21,22 @@ namespace NES { +/** + * @brief Physical operator for `geom_intersects3d`. + * + * Geometry intersects 3D + * + * Generated by tools/codegen/codegen_nebula.py. + */ class GeomIntersects3dPhysicalFunction : public PhysicalFunctionConcept { public: - GeomIntersects3dPhysicalFunction(PhysicalFunction wkt1Function, PhysicalFunction wkt2Function); + GeomIntersects3dPhysicalFunction(PhysicalFunction wktFunction, + PhysicalFunction arg0Function); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeomIntersectsPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeomIntersectsPhysicalFunction.hpp index 9db923782d..026db3f455 100644 --- a/nes-physical-operators/include/Functions/Meos/GeomIntersectsPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/GeomIntersectsPhysicalFunction.hpp @@ -21,14 +21,22 @@ namespace NES { +/** + * @brief Physical operator for `geom_intersects`. + * + * Geometry intersects + * + * Generated by tools/codegen/codegen_nebula.py. + */ class GeomIntersectsPhysicalFunction : public PhysicalFunctionConcept { public: - GeomIntersectsPhysicalFunction(PhysicalFunction wkt1, PhysicalFunction wkt2); + GeomIntersectsPhysicalFunction(PhysicalFunction wktFunction, + PhysicalFunction arg0Function); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeomIsEmptyPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeomIsEmptyPhysicalFunction.hpp index c007fb1000..43f671cba6 100644 --- a/nes-physical-operators/include/Functions/Meos/GeomIsEmptyPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/GeomIsEmptyPhysicalFunction.hpp @@ -21,14 +21,21 @@ namespace NES { +/** + * @brief Physical operator for `geom_is_empty`. + * + * Is geometry empty + * + * Generated by tools/codegen/codegen_nebula.py. + */ class GeomIsEmptyPhysicalFunction : public PhysicalFunctionConcept { public: - explicit GeomIsEmptyPhysicalFunction(PhysicalFunction wkt1Function); + GeomIsEmptyPhysicalFunction(PhysicalFunction wktFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeomLengthPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeomLengthPhysicalFunction.hpp index d7aced0440..aa41303be7 100644 --- a/nes-physical-operators/include/Functions/Meos/GeomLengthPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/GeomLengthPhysicalFunction.hpp @@ -21,14 +21,21 @@ namespace NES { +/** + * @brief Physical operator for `geom_length`. + * + * Geometry length + * + * Generated by tools/codegen/codegen_nebula.py. + */ class GeomLengthPhysicalFunction : public PhysicalFunctionConcept { public: - explicit GeomLengthPhysicalFunction(PhysicalFunction wkt1Function); + GeomLengthPhysicalFunction(PhysicalFunction wktFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeomPerimeterPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeomPerimeterPhysicalFunction.hpp index 281310c367..f15765c748 100644 --- a/nes-physical-operators/include/Functions/Meos/GeomPerimeterPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/GeomPerimeterPhysicalFunction.hpp @@ -21,14 +21,21 @@ namespace NES { +/** + * @brief Physical operator for `geom_perimeter`. + * + * Geometry perimeter + * + * Generated by tools/codegen/codegen_nebula.py. + */ class GeomPerimeterPhysicalFunction : public PhysicalFunctionConcept { public: - explicit GeomPerimeterPhysicalFunction(PhysicalFunction wkt1Function); + GeomPerimeterPhysicalFunction(PhysicalFunction wktFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeomPointMake2dPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeomPointMake2dPhysicalFunction.hpp index 2bfe851c1f..bf055859c2 100644 --- a/nes-physical-operators/include/Functions/Meos/GeomPointMake2dPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/GeomPointMake2dPhysicalFunction.hpp @@ -21,12 +21,23 @@ namespace NES { +/** + * @brief Physical operator for `geompoint_make2d((int32_t)srid, x, y)`. + * + * Make 2D geometry point + * + * Generated by tools/codegen/codegen_nebula.py. + */ class GeomPointMake2dPhysicalFunction : public PhysicalFunctionConcept { public: - GeomPointMake2dPhysicalFunction(PhysicalFunction srid, PhysicalFunction x, PhysicalFunction y); + GeomPointMake2dPhysicalFunction(PhysicalFunction sridFunction, + PhysicalFunction xFunction, + PhysicalFunction yFunction); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeomPointMake3dzPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeomPointMake3dzPhysicalFunction.hpp index 24deab91b2..bf5963d902 100644 --- a/nes-physical-operators/include/Functions/Meos/GeomPointMake3dzPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/GeomPointMake3dzPhysicalFunction.hpp @@ -21,12 +21,24 @@ namespace NES { +/** + * @brief Physical operator for `geompoint_make3dz((int32_t)srid, x, y, z)`. + * + * Make 3D geometry point + * + * Generated by tools/codegen/codegen_nebula.py. + */ class GeomPointMake3dzPhysicalFunction : public PhysicalFunctionConcept { public: - GeomPointMake3dzPhysicalFunction(PhysicalFunction srid, PhysicalFunction x, PhysicalFunction y, PhysicalFunction z); + GeomPointMake3dzPhysicalFunction(PhysicalFunction sridFunction, + PhysicalFunction xFunction, + PhysicalFunction yFunction, + PhysicalFunction zFunction); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeomShortestline2dPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeomShortestline2dPhysicalFunction.hpp index a7bf75d20f..d10e6857aa 100644 --- a/nes-physical-operators/include/Functions/Meos/GeomShortestline2dPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/GeomShortestline2dPhysicalFunction.hpp @@ -21,12 +21,22 @@ namespace NES { +/** + * @brief Physical operator for `geom_shortestline2d`. + * + * geom_shortestline2d + * + * Generated by tools/codegen/codegen_nebula.py. + */ class GeomShortestline2dPhysicalFunction : public PhysicalFunctionConcept { public: - GeomShortestline2dPhysicalFunction(PhysicalFunction wkt1, PhysicalFunction wkt2); + GeomShortestline2dPhysicalFunction(PhysicalFunction wktFunction, + PhysicalFunction arg0Function); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeomShortestline3dPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeomShortestline3dPhysicalFunction.hpp index ffc731f5d2..599aaa654e 100644 --- a/nes-physical-operators/include/Functions/Meos/GeomShortestline3dPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/GeomShortestline3dPhysicalFunction.hpp @@ -21,12 +21,22 @@ namespace NES { +/** + * @brief Physical operator for `geom_shortestline3d`. + * + * geom_shortestline3d + * + * Generated by tools/codegen/codegen_nebula.py. + */ class GeomShortestline3dPhysicalFunction : public PhysicalFunctionConcept { public: - GeomShortestline3dPhysicalFunction(PhysicalFunction wkt1, PhysicalFunction wkt2); + GeomShortestline3dPhysicalFunction(PhysicalFunction wktFunction, + PhysicalFunction arg0Function); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeomToGeogPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeomToGeogPhysicalFunction.hpp index 6fa9c50df7..33683f09d6 100644 --- a/nes-physical-operators/include/Functions/Meos/GeomToGeogPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/GeomToGeogPhysicalFunction.hpp @@ -21,12 +21,21 @@ namespace NES { +/** + * @brief Physical operator for `geom_to_geog`. + * + * geom to geog + * + * Generated by tools/codegen/codegen_nebula.py. + */ class GeomToGeogPhysicalFunction : public PhysicalFunctionConcept { public: - GeomToGeogPhysicalFunction(PhysicalFunction wkt); + GeomToGeogPhysicalFunction(PhysicalFunction wktFunction); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeomTouchesPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeomTouchesPhysicalFunction.hpp index 9fac03a277..bdd8453cda 100644 --- a/nes-physical-operators/include/Functions/Meos/GeomTouchesPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/GeomTouchesPhysicalFunction.hpp @@ -21,14 +21,22 @@ namespace NES { +/** + * @brief Physical operator for `geom_touches`. + * + * Geometry touches + * + * Generated by tools/codegen/codegen_nebula.py. + */ class GeomTouchesPhysicalFunction : public PhysicalFunctionConcept { public: - GeomTouchesPhysicalFunction(PhysicalFunction wkt1Function, PhysicalFunction wkt2Function); + GeomTouchesPhysicalFunction(PhysicalFunction wktFunction, + PhysicalFunction arg0Function); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/GeomUnaryUnionPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/GeomUnaryUnionPhysicalFunction.hpp index e09db70ba5..03d5e43e62 100644 --- a/nes-physical-operators/include/Functions/Meos/GeomUnaryUnionPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/GeomUnaryUnionPhysicalFunction.hpp @@ -21,12 +21,21 @@ namespace NES { +/** + * @brief Physical operator for `geom_unary_union`. + * + * Geometry geom unary union + * + * Generated by tools/codegen/codegen_nebula.py. + */ class GeomUnaryUnionPhysicalFunction : public PhysicalFunctionConcept { public: - GeomUnaryUnionPhysicalFunction(PhysicalFunction wkt); + GeomUnaryUnionPhysicalFunction(PhysicalFunction wktFunction); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/H3indexCmpPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/H3indexCmpPhysicalFunction.hpp index 5c8febc7a3..7752ca4386 100644 --- a/nes-physical-operators/include/Functions/Meos/H3indexCmpPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/H3indexCmpPhysicalFunction.hpp @@ -21,12 +21,22 @@ namespace NES { +/** + * @brief Physical operator for `h3index_cmp((H3Index)a, (H3Index)b)`. + * + * H3Index comparison (cmp) + * + * Generated by tools/codegen/codegen_nebula.py. + */ class H3indexCmpPhysicalFunction : public PhysicalFunctionConcept { public: - H3indexCmpPhysicalFunction(PhysicalFunction a, PhysicalFunction b); + H3indexCmpPhysicalFunction(PhysicalFunction aFunction, + PhysicalFunction bFunction); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/H3indexEqPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/H3indexEqPhysicalFunction.hpp index 7dc9cacf8a..a42bbf4625 100644 --- a/nes-physical-operators/include/Functions/Meos/H3indexEqPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/H3indexEqPhysicalFunction.hpp @@ -21,12 +21,22 @@ namespace NES { +/** + * @brief Physical operator for `h3index_eq((H3Index)a, (H3Index)b)`. + * + * H3Index eq comparison + * + * Generated by tools/codegen/codegen_nebula.py. + */ class H3indexEqPhysicalFunction : public PhysicalFunctionConcept { public: - H3indexEqPhysicalFunction(PhysicalFunction a, PhysicalFunction b); + H3indexEqPhysicalFunction(PhysicalFunction aFunction, + PhysicalFunction bFunction); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/H3indexGePhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/H3indexGePhysicalFunction.hpp index ebcaf7dcac..e9e9f248a7 100644 --- a/nes-physical-operators/include/Functions/Meos/H3indexGePhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/H3indexGePhysicalFunction.hpp @@ -21,12 +21,22 @@ namespace NES { +/** + * @brief Physical operator for `h3index_ge((H3Index)a, (H3Index)b)`. + * + * H3Index ge comparison + * + * Generated by tools/codegen/codegen_nebula.py. + */ class H3indexGePhysicalFunction : public PhysicalFunctionConcept { public: - H3indexGePhysicalFunction(PhysicalFunction a, PhysicalFunction b); + H3indexGePhysicalFunction(PhysicalFunction aFunction, + PhysicalFunction bFunction); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/H3indexGtPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/H3indexGtPhysicalFunction.hpp index 50bf965ca3..c5417f7917 100644 --- a/nes-physical-operators/include/Functions/Meos/H3indexGtPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/H3indexGtPhysicalFunction.hpp @@ -21,12 +21,22 @@ namespace NES { +/** + * @brief Physical operator for `h3index_gt((H3Index)a, (H3Index)b)`. + * + * H3Index gt comparison + * + * Generated by tools/codegen/codegen_nebula.py. + */ class H3indexGtPhysicalFunction : public PhysicalFunctionConcept { public: - H3indexGtPhysicalFunction(PhysicalFunction a, PhysicalFunction b); + H3indexGtPhysicalFunction(PhysicalFunction aFunction, + PhysicalFunction bFunction); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/H3indexLePhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/H3indexLePhysicalFunction.hpp index d08a506963..e2b398d970 100644 --- a/nes-physical-operators/include/Functions/Meos/H3indexLePhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/H3indexLePhysicalFunction.hpp @@ -21,12 +21,22 @@ namespace NES { +/** + * @brief Physical operator for `h3index_le((H3Index)a, (H3Index)b)`. + * + * H3Index le comparison + * + * Generated by tools/codegen/codegen_nebula.py. + */ class H3indexLePhysicalFunction : public PhysicalFunctionConcept { public: - H3indexLePhysicalFunction(PhysicalFunction a, PhysicalFunction b); + H3indexLePhysicalFunction(PhysicalFunction aFunction, + PhysicalFunction bFunction); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/H3indexLtPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/H3indexLtPhysicalFunction.hpp index 6e58dce8f0..d979cc6226 100644 --- a/nes-physical-operators/include/Functions/Meos/H3indexLtPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/H3indexLtPhysicalFunction.hpp @@ -21,12 +21,22 @@ namespace NES { +/** + * @brief Physical operator for `h3index_lt((H3Index)a, (H3Index)b)`. + * + * H3Index lt comparison + * + * Generated by tools/codegen/codegen_nebula.py. + */ class H3indexLtPhysicalFunction : public PhysicalFunctionConcept { public: - H3indexLtPhysicalFunction(PhysicalFunction a, PhysicalFunction b); + H3indexLtPhysicalFunction(PhysicalFunction aFunction, + PhysicalFunction bFunction); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/H3indexNePhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/H3indexNePhysicalFunction.hpp index 3065e3e410..662ef33442 100644 --- a/nes-physical-operators/include/Functions/Meos/H3indexNePhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/H3indexNePhysicalFunction.hpp @@ -21,12 +21,22 @@ namespace NES { +/** + * @brief Physical operator for `h3index_ne((H3Index)a, (H3Index)b)`. + * + * H3Index ne comparison + * + * Generated by tools/codegen/codegen_nebula.py. + */ class H3indexNePhysicalFunction : public PhysicalFunctionConcept { public: - H3indexNePhysicalFunction(PhysicalFunction a, PhysicalFunction b); + H3indexNePhysicalFunction(PhysicalFunction aFunction, + PhysicalFunction bFunction); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/H3indexOutPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/H3indexOutPhysicalFunction.hpp index 4a4e18cb8e..e1f8c2ca08 100644 --- a/nes-physical-operators/include/Functions/Meos/H3indexOutPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/H3indexOutPhysicalFunction.hpp @@ -21,12 +21,21 @@ namespace NES { +/** + * @brief Physical operator for `h3index_out((H3Index)cell)`. + * + * H3Index to hex string + * + * Generated by tools/codegen/codegen_nebula.py. + */ class H3indexOutPhysicalFunction : public PhysicalFunctionConcept { public: - H3indexOutPhysicalFunction(PhysicalFunction cell); + H3indexOutPhysicalFunction(PhysicalFunction cellFunction); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/IntspanLowerIncPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/IntspanLowerIncPhysicalFunction.hpp index b0ef7fa840..22fccfde10 100644 --- a/nes-physical-operators/include/Functions/Meos/IntspanLowerIncPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/IntspanLowerIncPhysicalFunction.hpp @@ -21,12 +21,21 @@ namespace NES { +/** + * @brief Physical operator for `span_lower_inc`. + * + * Intspan lower_inc + * + * Generated by tools/codegen/codegen_nebula.py. + */ class IntspanLowerIncPhysicalFunction : public PhysicalFunctionConcept { public: - IntspanLowerIncPhysicalFunction(PhysicalFunction sp); + IntspanLowerIncPhysicalFunction(PhysicalFunction spFunction); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/IntspanLowerPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/IntspanLowerPhysicalFunction.hpp index f4b4d69463..d969ab5443 100644 --- a/nes-physical-operators/include/Functions/Meos/IntspanLowerPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/IntspanLowerPhysicalFunction.hpp @@ -21,12 +21,21 @@ namespace NES { +/** + * @brief Physical operator for `intspan_lower`. + * + * Intspan lower + * + * Generated by tools/codegen/codegen_nebula.py. + */ class IntspanLowerPhysicalFunction : public PhysicalFunctionConcept { public: - IntspanLowerPhysicalFunction(PhysicalFunction sp); + IntspanLowerPhysicalFunction(PhysicalFunction spFunction); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/IntspanUpperIncPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/IntspanUpperIncPhysicalFunction.hpp index fc458932e0..553a9e0051 100644 --- a/nes-physical-operators/include/Functions/Meos/IntspanUpperIncPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/IntspanUpperIncPhysicalFunction.hpp @@ -21,12 +21,21 @@ namespace NES { +/** + * @brief Physical operator for `span_upper_inc`. + * + * Intspan upper_inc + * + * Generated by tools/codegen/codegen_nebula.py. + */ class IntspanUpperIncPhysicalFunction : public PhysicalFunctionConcept { public: - IntspanUpperIncPhysicalFunction(PhysicalFunction sp); + IntspanUpperIncPhysicalFunction(PhysicalFunction spFunction); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/IntspanUpperPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/IntspanUpperPhysicalFunction.hpp index 70c6dc1b7e..8774d38cd8 100644 --- a/nes-physical-operators/include/Functions/Meos/IntspanUpperPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/IntspanUpperPhysicalFunction.hpp @@ -21,12 +21,21 @@ namespace NES { +/** + * @brief Physical operator for `intspan_upper`. + * + * Intspan upper + * + * Generated by tools/codegen/codegen_nebula.py. + */ class IntspanUpperPhysicalFunction : public PhysicalFunctionConcept { public: - IntspanUpperPhysicalFunction(PhysicalFunction sp); + IntspanUpperPhysicalFunction(PhysicalFunction spFunction); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/IntspanWidthPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/IntspanWidthPhysicalFunction.hpp index c94fb8d7a2..a589bc8f54 100644 --- a/nes-physical-operators/include/Functions/Meos/IntspanWidthPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/IntspanWidthPhysicalFunction.hpp @@ -21,12 +21,21 @@ namespace NES { +/** + * @brief Physical operator for `intspan_width`. + * + * Intspan width + * + * Generated by tools/codegen/codegen_nebula.py. + */ class IntspanWidthPhysicalFunction : public PhysicalFunctionConcept { public: - IntspanWidthPhysicalFunction(PhysicalFunction sp); + IntspanWidthPhysicalFunction(PhysicalFunction spFunction); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/JsonbArrayElementTextPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/JsonbArrayElementTextPhysicalFunction.hpp index e52d066842..c7889febf0 100644 --- a/nes-physical-operators/include/Functions/Meos/JsonbArrayElementTextPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/JsonbArrayElementTextPhysicalFunction.hpp @@ -21,12 +21,22 @@ namespace NES { +/** + * @brief Physical operator for `jsonb_array_element_text(temp, (int)idx_d)`. + * + * Jsonb array element text + * + * Generated by tools/codegen/codegen_nebula.py. + */ class JsonbArrayElementTextPhysicalFunction : public PhysicalFunctionConcept { public: - JsonbArrayElementTextPhysicalFunction(PhysicalFunction jb, PhysicalFunction idx); + JsonbArrayElementTextPhysicalFunction(PhysicalFunction jbFunction, + PhysicalFunction arg0Function); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/JsonbArrayLengthPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/JsonbArrayLengthPhysicalFunction.hpp index ba933c81dc..b9a6d6f507 100644 --- a/nes-physical-operators/include/Functions/Meos/JsonbArrayLengthPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/JsonbArrayLengthPhysicalFunction.hpp @@ -21,12 +21,21 @@ namespace NES { +/** + * @brief Physical operator for `jsonb_array_length(temp)`. + * + * Jsonb array length + * + * Generated by tools/codegen/codegen_nebula.py. + */ class JsonbArrayLengthPhysicalFunction : public PhysicalFunctionConcept { public: - JsonbArrayLengthPhysicalFunction(PhysicalFunction jb); + JsonbArrayLengthPhysicalFunction(PhysicalFunction jbFunction); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/JsonbCmpPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/JsonbCmpPhysicalFunction.hpp index e6731320ad..1aadaa022e 100644 --- a/nes-physical-operators/include/Functions/Meos/JsonbCmpPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/JsonbCmpPhysicalFunction.hpp @@ -21,12 +21,22 @@ namespace NES { +/** + * @brief Physical operator for `jsonb_cmp(temp, jb0)`. + * + * Jsonb cmp + * + * Generated by tools/codegen/codegen_nebula.py. + */ class JsonbCmpPhysicalFunction : public PhysicalFunctionConcept { public: - JsonbCmpPhysicalFunction(PhysicalFunction jb1, PhysicalFunction jb2); + JsonbCmpPhysicalFunction(PhysicalFunction jbFunction, + PhysicalFunction arg0Function); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/JsonbContainedPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/JsonbContainedPhysicalFunction.hpp index dd8f0762ce..35e7b75237 100644 --- a/nes-physical-operators/include/Functions/Meos/JsonbContainedPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/JsonbContainedPhysicalFunction.hpp @@ -21,12 +21,22 @@ namespace NES { +/** + * @brief Physical operator for `jsonb_contained(temp, jb0)`. + * + * Jsonb contained + * + * Generated by tools/codegen/codegen_nebula.py. + */ class JsonbContainedPhysicalFunction : public PhysicalFunctionConcept { public: - JsonbContainedPhysicalFunction(PhysicalFunction jb1, PhysicalFunction jb2); + JsonbContainedPhysicalFunction(PhysicalFunction jbFunction, + PhysicalFunction arg0Function); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/JsonbContainsPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/JsonbContainsPhysicalFunction.hpp index 720ee36c32..0134fb6bbe 100644 --- a/nes-physical-operators/include/Functions/Meos/JsonbContainsPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/JsonbContainsPhysicalFunction.hpp @@ -21,12 +21,22 @@ namespace NES { +/** + * @brief Physical operator for `jsonb_contains(temp, jb0)`. + * + * Jsonb contains + * + * Generated by tools/codegen/codegen_nebula.py. + */ class JsonbContainsPhysicalFunction : public PhysicalFunctionConcept { public: - JsonbContainsPhysicalFunction(PhysicalFunction jb1, PhysicalFunction jb2); + JsonbContainsPhysicalFunction(PhysicalFunction jbFunction, + PhysicalFunction arg0Function); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/JsonbEqPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/JsonbEqPhysicalFunction.hpp index 1dd185496c..c36694cced 100644 --- a/nes-physical-operators/include/Functions/Meos/JsonbEqPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/JsonbEqPhysicalFunction.hpp @@ -21,12 +21,22 @@ namespace NES { +/** + * @brief Physical operator for `jsonb_eq(temp, jb0)`. + * + * Jsonb eq comparison + * + * Generated by tools/codegen/codegen_nebula.py. + */ class JsonbEqPhysicalFunction : public PhysicalFunctionConcept { public: - JsonbEqPhysicalFunction(PhysicalFunction jb1, PhysicalFunction jb2); + JsonbEqPhysicalFunction(PhysicalFunction jbFunction, + PhysicalFunction arg0Function); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/JsonbExistsPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/JsonbExistsPhysicalFunction.hpp index 51f35b38c2..65fb81c556 100644 --- a/nes-physical-operators/include/Functions/Meos/JsonbExistsPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/JsonbExistsPhysicalFunction.hpp @@ -21,12 +21,22 @@ namespace NES { +/** + * @brief Physical operator for `jsonb_exists(temp, txt0)`. + * + * Jsonb exists key + * + * Generated by tools/codegen/codegen_nebula.py. + */ class JsonbExistsPhysicalFunction : public PhysicalFunctionConcept { public: - JsonbExistsPhysicalFunction(PhysicalFunction jb, PhysicalFunction key); + JsonbExistsPhysicalFunction(PhysicalFunction jbFunction, + PhysicalFunction arg0Function); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/JsonbGePhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/JsonbGePhysicalFunction.hpp index d9176132ab..6d7b99caee 100644 --- a/nes-physical-operators/include/Functions/Meos/JsonbGePhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/JsonbGePhysicalFunction.hpp @@ -21,12 +21,22 @@ namespace NES { +/** + * @brief Physical operator for `jsonb_ge(temp, jb0)`. + * + * Jsonb ge comparison + * + * Generated by tools/codegen/codegen_nebula.py. + */ class JsonbGePhysicalFunction : public PhysicalFunctionConcept { public: - JsonbGePhysicalFunction(PhysicalFunction jb1, PhysicalFunction jb2); + JsonbGePhysicalFunction(PhysicalFunction jbFunction, + PhysicalFunction arg0Function); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/JsonbGtPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/JsonbGtPhysicalFunction.hpp index 4767a426be..1330c793d7 100644 --- a/nes-physical-operators/include/Functions/Meos/JsonbGtPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/JsonbGtPhysicalFunction.hpp @@ -21,12 +21,22 @@ namespace NES { +/** + * @brief Physical operator for `jsonb_gt(temp, jb0)`. + * + * Jsonb gt comparison + * + * Generated by tools/codegen/codegen_nebula.py. + */ class JsonbGtPhysicalFunction : public PhysicalFunctionConcept { public: - JsonbGtPhysicalFunction(PhysicalFunction jb1, PhysicalFunction jb2); + JsonbGtPhysicalFunction(PhysicalFunction jbFunction, + PhysicalFunction arg0Function); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/JsonbLePhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/JsonbLePhysicalFunction.hpp index 6626c9e9af..03c7e29ab8 100644 --- a/nes-physical-operators/include/Functions/Meos/JsonbLePhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/JsonbLePhysicalFunction.hpp @@ -21,12 +21,22 @@ namespace NES { +/** + * @brief Physical operator for `jsonb_le(temp, jb0)`. + * + * Jsonb le comparison + * + * Generated by tools/codegen/codegen_nebula.py. + */ class JsonbLePhysicalFunction : public PhysicalFunctionConcept { public: - JsonbLePhysicalFunction(PhysicalFunction jb1, PhysicalFunction jb2); + JsonbLePhysicalFunction(PhysicalFunction jbFunction, + PhysicalFunction arg0Function); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/JsonbLtPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/JsonbLtPhysicalFunction.hpp index 2afc6a3929..f1f1367c6b 100644 --- a/nes-physical-operators/include/Functions/Meos/JsonbLtPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/JsonbLtPhysicalFunction.hpp @@ -21,12 +21,22 @@ namespace NES { +/** + * @brief Physical operator for `jsonb_lt(temp, jb0)`. + * + * Jsonb lt comparison + * + * Generated by tools/codegen/codegen_nebula.py. + */ class JsonbLtPhysicalFunction : public PhysicalFunctionConcept { public: - JsonbLtPhysicalFunction(PhysicalFunction jb1, PhysicalFunction jb2); + JsonbLtPhysicalFunction(PhysicalFunction jbFunction, + PhysicalFunction arg0Function); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/JsonbNePhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/JsonbNePhysicalFunction.hpp index fc3447db4f..cc8d0ae1ac 100644 --- a/nes-physical-operators/include/Functions/Meos/JsonbNePhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/JsonbNePhysicalFunction.hpp @@ -21,12 +21,22 @@ namespace NES { +/** + * @brief Physical operator for `jsonb_ne(temp, jb0)`. + * + * Jsonb ne comparison + * + * Generated by tools/codegen/codegen_nebula.py. + */ class JsonbNePhysicalFunction : public PhysicalFunctionConcept { public: - JsonbNePhysicalFunction(PhysicalFunction jb1, PhysicalFunction jb2); + JsonbNePhysicalFunction(PhysicalFunction jbFunction, + PhysicalFunction arg0Function); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/JsonbObjectFieldTextPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/JsonbObjectFieldTextPhysicalFunction.hpp index d8102c91dc..bad798e2aa 100644 --- a/nes-physical-operators/include/Functions/Meos/JsonbObjectFieldTextPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/JsonbObjectFieldTextPhysicalFunction.hpp @@ -21,12 +21,22 @@ namespace NES { +/** + * @brief Physical operator for `jsonb_object_field_text(temp, txt0)`. + * + * Jsonb object field text + * + * Generated by tools/codegen/codegen_nebula.py. + */ class JsonbObjectFieldTextPhysicalFunction : public PhysicalFunctionConcept { public: - JsonbObjectFieldTextPhysicalFunction(PhysicalFunction jb, PhysicalFunction key); + JsonbObjectFieldTextPhysicalFunction(PhysicalFunction jbFunction, + PhysicalFunction arg0Function); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/JsonbPrettyPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/JsonbPrettyPhysicalFunction.hpp index 5a2ff0e542..656fb7c24f 100644 --- a/nes-physical-operators/include/Functions/Meos/JsonbPrettyPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/JsonbPrettyPhysicalFunction.hpp @@ -21,12 +21,21 @@ namespace NES { +/** + * @brief Physical operator for `jsonb_pretty(temp)`. + * + * Jsonb pretty print + * + * Generated by tools/codegen/codegen_nebula.py. + */ class JsonbPrettyPhysicalFunction : public PhysicalFunctionConcept { public: - JsonbPrettyPhysicalFunction(PhysicalFunction jb); + JsonbPrettyPhysicalFunction(PhysicalFunction jbFunction); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/JsonbToCstringPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/JsonbToCstringPhysicalFunction.hpp index f05366a0d1..d1b1a75464 100644 --- a/nes-physical-operators/include/Functions/Meos/JsonbToCstringPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/JsonbToCstringPhysicalFunction.hpp @@ -21,12 +21,21 @@ namespace NES { +/** + * @brief Physical operator for `jsonb_to_cstring(temp)`. + * + * Jsonb to cstring + * + * Generated by tools/codegen/codegen_nebula.py. + */ class JsonbToCstringPhysicalFunction : public PhysicalFunctionConcept { public: - JsonbToCstringPhysicalFunction(PhysicalFunction jb); + JsonbToCstringPhysicalFunction(PhysicalFunction jbFunction); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/LineInterpolatePointPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/LineInterpolatePointPhysicalFunction.hpp index b619a62647..bef68009b8 100644 --- a/nes-physical-operators/include/Functions/Meos/LineInterpolatePointPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/LineInterpolatePointPhysicalFunction.hpp @@ -21,12 +21,22 @@ namespace NES { +/** + * @brief Physical operator for `line_interpolate_point(temp, arg0)`. + * + * Interpolate point on line + * + * Generated by tools/codegen/codegen_nebula.py. + */ class LineInterpolatePointPhysicalFunction : public PhysicalFunctionConcept { public: - LineInterpolatePointPhysicalFunction(PhysicalFunction wkt, PhysicalFunction frac, PhysicalFunction repeat); + LineInterpolatePointPhysicalFunction(PhysicalFunction wktFunction, + PhysicalFunction arg0Function); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/LineLocatePointPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/LineLocatePointPhysicalFunction.hpp index 93adb2a189..ea56a76582 100644 --- a/nes-physical-operators/include/Functions/Meos/LineLocatePointPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/LineLocatePointPhysicalFunction.hpp @@ -21,12 +21,22 @@ namespace NES { +/** + * @brief Physical operator for `line_locate_point`. + * + * Locate point on line + * + * Generated by tools/codegen/codegen_nebula.py. + */ class LineLocatePointPhysicalFunction : public PhysicalFunctionConcept { public: - LineLocatePointPhysicalFunction(PhysicalFunction wkt1, PhysicalFunction wkt2); + LineLocatePointPhysicalFunction(PhysicalFunction wktFunction, + PhysicalFunction arg0Function); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/LineNumpointsPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/LineNumpointsPhysicalFunction.hpp index 1a03421945..8c14754e9a 100644 --- a/nes-physical-operators/include/Functions/Meos/LineNumpointsPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/LineNumpointsPhysicalFunction.hpp @@ -21,12 +21,21 @@ namespace NES { +/** + * @brief Physical operator for `line_numpoints(temp)`. + * + * Line num points + * + * Generated by tools/codegen/codegen_nebula.py. + */ class LineNumpointsPhysicalFunction : public PhysicalFunctionConcept { public: - LineNumpointsPhysicalFunction(PhysicalFunction wkt); + LineNumpointsPhysicalFunction(PhysicalFunction wktFunction); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/LinePointNPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/LinePointNPhysicalFunction.hpp index 71d4238170..82656a618d 100644 --- a/nes-physical-operators/include/Functions/Meos/LinePointNPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/LinePointNPhysicalFunction.hpp @@ -21,12 +21,22 @@ namespace NES { +/** + * @brief Physical operator for `line_point_n(temp, (int)arg0)`. + * + * Nth point on line + * + * Generated by tools/codegen/codegen_nebula.py. + */ class LinePointNPhysicalFunction : public PhysicalFunctionConcept { public: - LinePointNPhysicalFunction(PhysicalFunction wkt, PhysicalFunction n); + LinePointNPhysicalFunction(PhysicalFunction wktFunction, + PhysicalFunction arg0Function); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/LineSubstringPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/LineSubstringPhysicalFunction.hpp index 23994e81d2..f26e72fd64 100644 --- a/nes-physical-operators/include/Functions/Meos/LineSubstringPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/LineSubstringPhysicalFunction.hpp @@ -21,12 +21,23 @@ namespace NES { +/** + * @brief Physical operator for `line_substring(temp, arg0, arg1)`. + * + * Line substring + * + * Generated by tools/codegen/codegen_nebula.py. + */ class LineSubstringPhysicalFunction : public PhysicalFunctionConcept { public: - LineSubstringPhysicalFunction(PhysicalFunction wkt, PhysicalFunction from_f, PhysicalFunction to_f); + LineSubstringPhysicalFunction(PhysicalFunction wktFunction, + PhysicalFunction arg0Function, + PhysicalFunction arg1Function); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/MindistanceTcbufferTcbufferPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/MindistanceTcbufferTcbufferPhysicalFunction.hpp index 1bbffb3bb6..556259f4be 100644 --- a/nes-physical-operators/include/Functions/Meos/MindistanceTcbufferTcbufferPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/MindistanceTcbufferTcbufferPhysicalFunction.hpp @@ -21,17 +21,29 @@ namespace NES { +/** + * @brief Physical operator for `mindistance_tcbuffer_tcbuffer`. + * + * Per-event minimum distance between two tcbuffer instants within threshold. + * + * Generated by tools/codegen/codegen_nebula.py. + */ class MindistanceTcbufferTcbufferPhysicalFunction : public PhysicalFunctionConcept { public: - MindistanceTcbufferTcbufferPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction r1, - PhysicalFunction ts1, - PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction r2, - PhysicalFunction ts2, PhysicalFunction dist); + MindistanceTcbufferTcbufferPhysicalFunction(PhysicalFunction lonAFunction, + PhysicalFunction latAFunction, + PhysicalFunction radiusAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction lonBFunction, + PhysicalFunction latBFunction, + PhysicalFunction radiusBFunction, + PhysicalFunction tsBFunction, + PhysicalFunction distFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/MulBigintTbigintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/MulBigintTbigintPhysicalFunction.hpp index 8e83307019..6edb9007e9 100644 --- a/nes-physical-operators/include/Functions/Meos/MulBigintTbigintPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/MulBigintTbigintPhysicalFunction.hpp @@ -24,15 +24,15 @@ namespace NES { /** * @brief Physical operator for `mul_bigint_tbigint`. * - * Per-event mul_bigint_tbigint: multiplies a constant int64 scalar by a single-instant tbigint value. + * Per-event mul_bigint_tbigint: scalar bigint times single-instant tbigint. * * Generated by tools/codegen/codegen_nebula.py. */ class MulBigintTbigintPhysicalFunction : public PhysicalFunctionConcept { public: - MulBigintTbigintPhysicalFunction(PhysicalFunction scalarFunction, - PhysicalFunction valueFunction, - PhysicalFunction tsFunction); + MulBigintTbigintPhysicalFunction(PhysicalFunction arg0Function, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; diff --git a/nes-physical-operators/include/Functions/Meos/MulFloatTfloatPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/MulFloatTfloatPhysicalFunction.hpp index c9b029f509..50d4a3d60f 100644 --- a/nes-physical-operators/include/Functions/Meos/MulFloatTfloatPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/MulFloatTfloatPhysicalFunction.hpp @@ -24,15 +24,15 @@ namespace NES { /** * @brief Physical operator for `mul_float_tfloat`. * - * Per-event mul_float_tfloat: multiplies a constant by a single-instant tfloat value. + * Per-event mul_float_tfloat: scalar float times single-instant tfloat. * * Generated by tools/codegen/codegen_nebula.py. */ class MulFloatTfloatPhysicalFunction : public PhysicalFunctionConcept { public: - MulFloatTfloatPhysicalFunction(PhysicalFunction scalarFunction, - PhysicalFunction valueFunction, - PhysicalFunction tsFunction); + MulFloatTfloatPhysicalFunction(PhysicalFunction arg0Function, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; diff --git a/nes-physical-operators/include/Functions/Meos/MulIntTintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/MulIntTintPhysicalFunction.hpp index c5799619f8..a082e36f87 100644 --- a/nes-physical-operators/include/Functions/Meos/MulIntTintPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/MulIntTintPhysicalFunction.hpp @@ -24,15 +24,15 @@ namespace NES { /** * @brief Physical operator for `mul_int_tint`. * - * Per-event mul_int_tint: multiplies a constant by a single-instant tint value. + * Per-event mul_int_tint: scalar int times single-instant tint. * * Generated by tools/codegen/codegen_nebula.py. */ class MulIntTintPhysicalFunction : public PhysicalFunctionConcept { public: - MulIntTintPhysicalFunction(PhysicalFunction scalarFunction, - PhysicalFunction valueFunction, - PhysicalFunction tsFunction); + MulIntTintPhysicalFunction(PhysicalFunction arg0Function, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; diff --git a/nes-physical-operators/include/Functions/Meos/MulTbigintBigintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/MulTbigintBigintPhysicalFunction.hpp index 3736f42e2d..8f9f13d716 100644 --- a/nes-physical-operators/include/Functions/Meos/MulTbigintBigintPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/MulTbigintBigintPhysicalFunction.hpp @@ -24,15 +24,15 @@ namespace NES { /** * @brief Physical operator for `mul_tbigint_bigint`. * - * Per-event mul_tbigint_bigint: multiplies a single-instant tbigint value by a constant int64. + * Per-event mul_tbigint_bigint: single-instant tbigint times scalar bigint. * * Generated by tools/codegen/codegen_nebula.py. */ class MulTbigintBigintPhysicalFunction : public PhysicalFunctionConcept { public: MulTbigintBigintPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction tsFunction, - PhysicalFunction factorFunction); + PhysicalFunction tsFunction, + PhysicalFunction arg0Function); VarVal execute(const Record& record, ArenaRef& arena) const override; diff --git a/nes-physical-operators/include/Functions/Meos/MulTfloatFloatPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/MulTfloatFloatPhysicalFunction.hpp index 5014e03f50..e63403d614 100644 --- a/nes-physical-operators/include/Functions/Meos/MulTfloatFloatPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/MulTfloatFloatPhysicalFunction.hpp @@ -24,15 +24,15 @@ namespace NES { /** * @brief Physical operator for `mul_tfloat_float`. * - * Per-event mul_tfloat_float: multiplies a single-instant tfloat value by a constant. + * Per-event mul_tfloat_float: single-instant tfloat times scalar float. * * Generated by tools/codegen/codegen_nebula.py. */ class MulTfloatFloatPhysicalFunction : public PhysicalFunctionConcept { public: MulTfloatFloatPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction tsFunction, - PhysicalFunction factorFunction); + PhysicalFunction tsFunction, + PhysicalFunction arg0Function); VarVal execute(const Record& record, ArenaRef& arena) const override; diff --git a/nes-physical-operators/include/Functions/Meos/MulTintIntPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/MulTintIntPhysicalFunction.hpp index 8f3215281f..eb4dab785a 100644 --- a/nes-physical-operators/include/Functions/Meos/MulTintIntPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/MulTintIntPhysicalFunction.hpp @@ -24,15 +24,15 @@ namespace NES { /** * @brief Physical operator for `mul_tint_int`. * - * Per-event mul_tint_int: multiplies a single-instant tint value by a constant integer. + * Per-event mul_tint_int: single-instant tint times scalar int. * * Generated by tools/codegen/codegen_nebula.py. */ class MulTintIntPhysicalFunction : public PhysicalFunctionConcept { public: MulTintIntPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction tsFunction, - PhysicalFunction multiplierFunction); + PhysicalFunction tsFunction, + PhysicalFunction arg0Function); VarVal execute(const Record& record, ArenaRef& arena) const override; diff --git a/nes-physical-operators/include/Functions/Meos/MulTnumberTnumberPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/MulTnumberTnumberPhysicalFunction.hpp index f3b4af1bcf..8d2bea7a57 100644 --- a/nes-physical-operators/include/Functions/Meos/MulTnumberTnumberPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/MulTnumberTnumberPhysicalFunction.hpp @@ -24,15 +24,14 @@ namespace NES { /** * @brief Physical operator for `mul_tnumber_tnumber`. * - * Per-event element-wise multiplication of two co-instant tnumbers. + * Per-event mul_tnumber_tnumber: two temporal numbers multiplied (WKB result). * * Generated by tools/codegen/codegen_nebula.py. */ class MulTnumberTnumberPhysicalFunction : public PhysicalFunctionConcept { public: - MulTnumberTnumberPhysicalFunction(PhysicalFunction value1Function, - PhysicalFunction value2Function, - PhysicalFunction tsFunction); + MulTnumberTnumberPhysicalFunction(PhysicalFunction trajFunction, + PhysicalFunction arg0Function); VarVal execute(const Record& record, ArenaRef& arena) const override; diff --git a/nes-physical-operators/include/Functions/Meos/NadTcbufferGeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/NadTcbufferGeoPhysicalFunction.hpp index acb4d8ab50..b9bc5cece1 100644 --- a/nes-physical-operators/include/Functions/Meos/NadTcbufferGeoPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/NadTcbufferGeoPhysicalFunction.hpp @@ -21,16 +21,25 @@ namespace NES { +/** + * @brief Physical operator for `nad_tcbuffer_geo`. + * + * Per-event nearest approach distance between tcbuffer and static geometry. + * + * Generated by tools/codegen/codegen_nebula.py. + */ class NadTcbufferGeoPhysicalFunction : public PhysicalFunctionConcept { public: - NadTcbufferGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, - PhysicalFunction radius, PhysicalFunction ts, - PhysicalFunction wkt); + NadTcbufferGeoPhysicalFunction(PhysicalFunction lonFunction, + PhysicalFunction latFunction, + PhysicalFunction radiusFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/NadTcbufferTcbufferPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/NadTcbufferTcbufferPhysicalFunction.hpp index 9de7220367..c6773eb42b 100644 --- a/nes-physical-operators/include/Functions/Meos/NadTcbufferTcbufferPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/NadTcbufferTcbufferPhysicalFunction.hpp @@ -21,17 +21,28 @@ namespace NES { +/** + * @brief Physical operator for `nad_tcbuffer_tcbuffer`. + * + * Per-event nearest approach distance between two tcbuffer instants. + * + * Generated by tools/codegen/codegen_nebula.py. + */ class NadTcbufferTcbufferPhysicalFunction : public PhysicalFunctionConcept { public: - NadTcbufferTcbufferPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction r1, - PhysicalFunction ts1, - PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction r2, - PhysicalFunction ts2); + NadTcbufferTcbufferPhysicalFunction(PhysicalFunction lonAFunction, + PhysicalFunction latAFunction, + PhysicalFunction radiusAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction lonBFunction, + PhysicalFunction latBFunction, + PhysicalFunction radiusBFunction, + PhysicalFunction tsBFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/NadTgeoGeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/NadTgeoGeoPhysicalFunction.hpp index 529a874595..d9e153e9eb 100644 --- a/nes-physical-operators/include/Functions/Meos/NadTgeoGeoPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/NadTgeoGeoPhysicalFunction.hpp @@ -21,15 +21,24 @@ namespace NES { +/** + * @brief Physical operator for `nad_tgeo_geo`. + * + * Per-event nearest approach distance between tgeo and static geometry. + * + * Generated by tools/codegen/codegen_nebula.py. + */ class NadTgeoGeoPhysicalFunction : public PhysicalFunctionConcept { public: - NadTgeoGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, - PhysicalFunction ts, PhysicalFunction wkt); + NadTgeoGeoPhysicalFunction(PhysicalFunction lonFunction, + PhysicalFunction latFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/NadTgeoTgeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/NadTgeoTgeoPhysicalFunction.hpp new file mode 100644 index 0000000000..1b59fbde86 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/NadTgeoTgeoPhysicalFunction.hpp @@ -0,0 +1,46 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `nad_tgeo_tgeo`. + * + * Per-event nearest approach distance between two tgeo instants. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class NadTgeoTgeoPhysicalFunction : public PhysicalFunctionConcept { +public: + NadTgeoTgeoPhysicalFunction(PhysicalFunction lonAFunction, + PhysicalFunction latAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction lonBFunction, + PhysicalFunction latBFunction, + PhysicalFunction tsBFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/NadTnpointGeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/NadTnpointGeoPhysicalFunction.hpp index 1d927ba586..1b2919bc98 100644 --- a/nes-physical-operators/include/Functions/Meos/NadTnpointGeoPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/NadTnpointGeoPhysicalFunction.hpp @@ -21,12 +21,24 @@ namespace NES { +/** + * @brief Physical operator for `nad_tnpoint_geo(temp, gs0)`. + * + * NAD tnpoint vs geo + * + * Generated by tools/codegen/codegen_nebula.py. + */ class NadTnpointGeoPhysicalFunction : public PhysicalFunctionConcept { public: - NadTnpointGeoPhysicalFunction(PhysicalFunction rid, PhysicalFunction pos, PhysicalFunction ts, PhysicalFunction wkt); + NadTnpointGeoPhysicalFunction(PhysicalFunction ridFunction, + PhysicalFunction fracFunction, + PhysicalFunction tsFunction, + PhysicalFunction arg0Function); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/NadTnpointNpointPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/NadTnpointNpointPhysicalFunction.hpp index 989d1c2707..66d0c844f5 100644 --- a/nes-physical-operators/include/Functions/Meos/NadTnpointNpointPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/NadTnpointNpointPhysicalFunction.hpp @@ -21,12 +21,25 @@ namespace NES { +/** + * @brief Physical operator for `nad_tnpoint_npoint(temp, np0)`. + * + * NAD tnpoint vs npoint + * + * Generated by tools/codegen/codegen_nebula.py. + */ class NadTnpointNpointPhysicalFunction : public PhysicalFunctionConcept { public: - NadTnpointNpointPhysicalFunction(PhysicalFunction rid1, PhysicalFunction pos1, PhysicalFunction ts, PhysicalFunction rid2, PhysicalFunction pos2); + NadTnpointNpointPhysicalFunction(PhysicalFunction ridFunction, + PhysicalFunction fracFunction, + PhysicalFunction tsFunction, + PhysicalFunction rid0Function, + PhysicalFunction frac0Function); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/NadTnpointTnpointPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/NadTnpointTnpointPhysicalFunction.hpp index d6819b22ef..12d366a551 100644 --- a/nes-physical-operators/include/Functions/Meos/NadTnpointTnpointPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/NadTnpointTnpointPhysicalFunction.hpp @@ -21,13 +21,26 @@ namespace NES { +/** + * @brief Physical operator for `nad_tnpoint_tnpoint(temp, inst0)`. + * + * NAD tnpoint vs tnpoint + * + * Generated by tools/codegen/codegen_nebula.py. + */ class NadTnpointTnpointPhysicalFunction : public PhysicalFunctionConcept { public: - NadTnpointTnpointPhysicalFunction(PhysicalFunction rid1, PhysicalFunction pos1, PhysicalFunction ts1, - PhysicalFunction rid2, PhysicalFunction pos2, PhysicalFunction ts2); + NadTnpointTnpointPhysicalFunction(PhysicalFunction ridFunction, + PhysicalFunction fracFunction, + PhysicalFunction tsFunction, + PhysicalFunction rid0Function, + PhysicalFunction frac0Function, + PhysicalFunction ts0Function); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/NadTposeGeoPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/NadTposeGeoPhysicalFunction.hpp index 55ad411307..73b8feb82e 100644 --- a/nes-physical-operators/include/Functions/Meos/NadTposeGeoPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/NadTposeGeoPhysicalFunction.hpp @@ -21,12 +21,25 @@ namespace NES { +/** + * @brief Physical operator for `nad_tpose_geo(temp, gs0)`. + * + * NAD tpose vs geo + * + * Generated by tools/codegen/codegen_nebula.py. + */ class NadTposeGeoPhysicalFunction : public PhysicalFunctionConcept { public: - NadTposeGeoPhysicalFunction(PhysicalFunction x, PhysicalFunction y, PhysicalFunction theta, PhysicalFunction ts, PhysicalFunction wkt); + NadTposeGeoPhysicalFunction(PhysicalFunction xFunction, + PhysicalFunction yFunction, + PhysicalFunction thetaFunction, + PhysicalFunction tsFunction, + PhysicalFunction arg0Function); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/NadTposePosePhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/NadTposePosePhysicalFunction.hpp index 1f9ed513ba..f94958ba00 100644 --- a/nes-physical-operators/include/Functions/Meos/NadTposePosePhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/NadTposePosePhysicalFunction.hpp @@ -21,12 +21,27 @@ namespace NES { +/** + * @brief Physical operator for `nad_tpose_pose(temp, pose0)`. + * + * NAD tpose vs pose + * + * Generated by tools/codegen/codegen_nebula.py. + */ class NadTposePosePhysicalFunction : public PhysicalFunctionConcept { public: - NadTposePosePhysicalFunction(PhysicalFunction x, PhysicalFunction y, PhysicalFunction theta, PhysicalFunction ts, PhysicalFunction x2, PhysicalFunction y2, PhysicalFunction theta2); + NadTposePosePhysicalFunction(PhysicalFunction xFunction, + PhysicalFunction yFunction, + PhysicalFunction thetaFunction, + PhysicalFunction tsFunction, + PhysicalFunction px0Function, + PhysicalFunction py0Function, + PhysicalFunction ptheta0Function); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/NadTposeTposePhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/NadTposeTposePhysicalFunction.hpp index b5f2e25824..19d8b6a93c 100644 --- a/nes-physical-operators/include/Functions/Meos/NadTposeTposePhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/NadTposeTposePhysicalFunction.hpp @@ -21,15 +21,28 @@ namespace NES { +/** + * @brief Physical operator for `nad_tpose_tpose(temp, inst0)`. + * + * NAD tpose vs tpose + * + * Generated by tools/codegen/codegen_nebula.py. + */ class NadTposeTposePhysicalFunction : public PhysicalFunctionConcept { public: - NadTposeTposePhysicalFunction(PhysicalFunction x1, PhysicalFunction y1, PhysicalFunction theta1, - PhysicalFunction ts1, - PhysicalFunction x2, PhysicalFunction y2, PhysicalFunction theta2, - PhysicalFunction ts2); + NadTposeTposePhysicalFunction(PhysicalFunction xFunction, + PhysicalFunction yFunction, + PhysicalFunction thetaFunction, + PhysicalFunction tsFunction, + PhysicalFunction px0Function, + PhysicalFunction py0Function, + PhysicalFunction ptheta0Function, + PhysicalFunction ts0Function); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/QuadbinCellAreaPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/QuadbinCellAreaPhysicalFunction.hpp index 796b3fea82..53a4c2aac4 100644 --- a/nes-physical-operators/include/Functions/Meos/QuadbinCellAreaPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/QuadbinCellAreaPhysicalFunction.hpp @@ -21,12 +21,21 @@ namespace NES { +/** + * @brief Physical operator for `quadbin_cell_area((Quadbin)cell)`. + * + * Quadbin cell area + * + * Generated by tools/codegen/codegen_nebula.py. + */ class QuadbinCellAreaPhysicalFunction : public PhysicalFunctionConcept { public: - QuadbinCellAreaPhysicalFunction(PhysicalFunction cell); + QuadbinCellAreaPhysicalFunction(PhysicalFunction cellFunction); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/QuadbinCellToParentPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/QuadbinCellToParentPhysicalFunction.hpp index 1f8f5d9545..c978cd386c 100644 --- a/nes-physical-operators/include/Functions/Meos/QuadbinCellToParentPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/QuadbinCellToParentPhysicalFunction.hpp @@ -21,12 +21,22 @@ namespace NES { +/** + * @brief Physical operator for `quadbin_cell_to_parent((Quadbin)cell, (uint32_t)res)`. + * + * Quadbin cell to parent + * + * Generated by tools/codegen/codegen_nebula.py. + */ class QuadbinCellToParentPhysicalFunction : public PhysicalFunctionConcept { public: - QuadbinCellToParentPhysicalFunction(PhysicalFunction cell, PhysicalFunction res); + QuadbinCellToParentPhysicalFunction(PhysicalFunction cellFunction, + PhysicalFunction resFunction); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/QuadbinCellToQuadkeyPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/QuadbinCellToQuadkeyPhysicalFunction.hpp index 69b7da24f4..0664cf281d 100644 --- a/nes-physical-operators/include/Functions/Meos/QuadbinCellToQuadkeyPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/QuadbinCellToQuadkeyPhysicalFunction.hpp @@ -21,12 +21,21 @@ namespace NES { +/** + * @brief Physical operator for `quadbin_cell_to_quadkey((Quadbin)cell)`. + * + * Quadbin cell to quadkey + * + * Generated by tools/codegen/codegen_nebula.py. + */ class QuadbinCellToQuadkeyPhysicalFunction : public PhysicalFunctionConcept { public: - QuadbinCellToQuadkeyPhysicalFunction(PhysicalFunction cell); + QuadbinCellToQuadkeyPhysicalFunction(PhysicalFunction cellFunction); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/QuadbinCmpPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/QuadbinCmpPhysicalFunction.hpp index 5baceef177..180b316f7b 100644 --- a/nes-physical-operators/include/Functions/Meos/QuadbinCmpPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/QuadbinCmpPhysicalFunction.hpp @@ -21,12 +21,22 @@ namespace NES { +/** + * @brief Physical operator for `quadbin_cmp((Quadbin)a, (Quadbin)b)`. + * + * Quadbin cmp + * + * Generated by tools/codegen/codegen_nebula.py. + */ class QuadbinCmpPhysicalFunction : public PhysicalFunctionConcept { public: - QuadbinCmpPhysicalFunction(PhysicalFunction a, PhysicalFunction b); + QuadbinCmpPhysicalFunction(PhysicalFunction aFunction, + PhysicalFunction bFunction); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/QuadbinEqPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/QuadbinEqPhysicalFunction.hpp index 37f8b6dafd..12fe1a3b62 100644 --- a/nes-physical-operators/include/Functions/Meos/QuadbinEqPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/QuadbinEqPhysicalFunction.hpp @@ -21,12 +21,22 @@ namespace NES { +/** + * @brief Physical operator for `quadbin_eq((Quadbin)a, (Quadbin)b)`. + * + * Quadbin eq comparison + * + * Generated by tools/codegen/codegen_nebula.py. + */ class QuadbinEqPhysicalFunction : public PhysicalFunctionConcept { public: - QuadbinEqPhysicalFunction(PhysicalFunction a, PhysicalFunction b); + QuadbinEqPhysicalFunction(PhysicalFunction aFunction, + PhysicalFunction bFunction); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/QuadbinGePhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/QuadbinGePhysicalFunction.hpp index 31817dc002..c4a8a7aec5 100644 --- a/nes-physical-operators/include/Functions/Meos/QuadbinGePhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/QuadbinGePhysicalFunction.hpp @@ -21,12 +21,22 @@ namespace NES { +/** + * @brief Physical operator for `quadbin_ge((Quadbin)a, (Quadbin)b)`. + * + * Quadbin ge comparison + * + * Generated by tools/codegen/codegen_nebula.py. + */ class QuadbinGePhysicalFunction : public PhysicalFunctionConcept { public: - QuadbinGePhysicalFunction(PhysicalFunction a, PhysicalFunction b); + QuadbinGePhysicalFunction(PhysicalFunction aFunction, + PhysicalFunction bFunction); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/QuadbinGetResolutionPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/QuadbinGetResolutionPhysicalFunction.hpp index c456176fae..5b18ac3cde 100644 --- a/nes-physical-operators/include/Functions/Meos/QuadbinGetResolutionPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/QuadbinGetResolutionPhysicalFunction.hpp @@ -21,12 +21,21 @@ namespace NES { +/** + * @brief Physical operator for `quadbin_get_resolution((Quadbin)cell)`. + * + * Quadbin get resolution + * + * Generated by tools/codegen/codegen_nebula.py. + */ class QuadbinGetResolutionPhysicalFunction : public PhysicalFunctionConcept { public: - QuadbinGetResolutionPhysicalFunction(PhysicalFunction cell); + QuadbinGetResolutionPhysicalFunction(PhysicalFunction cellFunction); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/QuadbinGtPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/QuadbinGtPhysicalFunction.hpp index 1e6ce98100..1f9664e14b 100644 --- a/nes-physical-operators/include/Functions/Meos/QuadbinGtPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/QuadbinGtPhysicalFunction.hpp @@ -21,12 +21,22 @@ namespace NES { +/** + * @brief Physical operator for `quadbin_gt((Quadbin)a, (Quadbin)b)`. + * + * Quadbin gt comparison + * + * Generated by tools/codegen/codegen_nebula.py. + */ class QuadbinGtPhysicalFunction : public PhysicalFunctionConcept { public: - QuadbinGtPhysicalFunction(PhysicalFunction a, PhysicalFunction b); + QuadbinGtPhysicalFunction(PhysicalFunction aFunction, + PhysicalFunction bFunction); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/QuadbinIsValidCellPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/QuadbinIsValidCellPhysicalFunction.hpp index b33082239a..6ee112a436 100644 --- a/nes-physical-operators/include/Functions/Meos/QuadbinIsValidCellPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/QuadbinIsValidCellPhysicalFunction.hpp @@ -21,12 +21,21 @@ namespace NES { +/** + * @brief Physical operator for `quadbin_is_valid_cell((Quadbin)cell)`. + * + * Quadbin is valid cell + * + * Generated by tools/codegen/codegen_nebula.py. + */ class QuadbinIsValidCellPhysicalFunction : public PhysicalFunctionConcept { public: - QuadbinIsValidCellPhysicalFunction(PhysicalFunction cell); + QuadbinIsValidCellPhysicalFunction(PhysicalFunction cellFunction); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/QuadbinLePhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/QuadbinLePhysicalFunction.hpp index dedbfcaf69..f56939adc6 100644 --- a/nes-physical-operators/include/Functions/Meos/QuadbinLePhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/QuadbinLePhysicalFunction.hpp @@ -21,12 +21,22 @@ namespace NES { +/** + * @brief Physical operator for `quadbin_le((Quadbin)a, (Quadbin)b)`. + * + * Quadbin le comparison + * + * Generated by tools/codegen/codegen_nebula.py. + */ class QuadbinLePhysicalFunction : public PhysicalFunctionConcept { public: - QuadbinLePhysicalFunction(PhysicalFunction a, PhysicalFunction b); + QuadbinLePhysicalFunction(PhysicalFunction aFunction, + PhysicalFunction bFunction); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/QuadbinLtPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/QuadbinLtPhysicalFunction.hpp index db539794d8..dbc0d0c90b 100644 --- a/nes-physical-operators/include/Functions/Meos/QuadbinLtPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/QuadbinLtPhysicalFunction.hpp @@ -21,12 +21,22 @@ namespace NES { +/** + * @brief Physical operator for `quadbin_lt((Quadbin)a, (Quadbin)b)`. + * + * Quadbin lt comparison + * + * Generated by tools/codegen/codegen_nebula.py. + */ class QuadbinLtPhysicalFunction : public PhysicalFunctionConcept { public: - QuadbinLtPhysicalFunction(PhysicalFunction a, PhysicalFunction b); + QuadbinLtPhysicalFunction(PhysicalFunction aFunction, + PhysicalFunction bFunction); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/QuadbinNePhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/QuadbinNePhysicalFunction.hpp index ccd3222667..98d22d69fe 100644 --- a/nes-physical-operators/include/Functions/Meos/QuadbinNePhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/QuadbinNePhysicalFunction.hpp @@ -21,12 +21,22 @@ namespace NES { +/** + * @brief Physical operator for `quadbin_ne((Quadbin)a, (Quadbin)b)`. + * + * Quadbin ne comparison + * + * Generated by tools/codegen/codegen_nebula.py. + */ class QuadbinNePhysicalFunction : public PhysicalFunctionConcept { public: - QuadbinNePhysicalFunction(PhysicalFunction a, PhysicalFunction b); + QuadbinNePhysicalFunction(PhysicalFunction aFunction, + PhysicalFunction bFunction); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/QuadbinPointToCellPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/QuadbinPointToCellPhysicalFunction.hpp index 8b20f0ef23..0da223264b 100644 --- a/nes-physical-operators/include/Functions/Meos/QuadbinPointToCellPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/QuadbinPointToCellPhysicalFunction.hpp @@ -21,12 +21,23 @@ namespace NES { +/** + * @brief Physical operator for `quadbin_point_to_cell(lon, lat, (uint32_t)res)`. + * + * Quadbin point to cell + * + * Generated by tools/codegen/codegen_nebula.py. + */ class QuadbinPointToCellPhysicalFunction : public PhysicalFunctionConcept { public: - QuadbinPointToCellPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, PhysicalFunction res); + QuadbinPointToCellPhysicalFunction(PhysicalFunction lonFunction, + PhysicalFunction latFunction, + PhysicalFunction resFunction); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/QuadbinTileToCellPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/QuadbinTileToCellPhysicalFunction.hpp index 02ac96c13f..9354d86b94 100644 --- a/nes-physical-operators/include/Functions/Meos/QuadbinTileToCellPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/QuadbinTileToCellPhysicalFunction.hpp @@ -21,12 +21,23 @@ namespace NES { +/** + * @brief Physical operator for `quadbin_tile_to_cell((uint32_t)x, (uint32_t)y, (uint32_t)z)`. + * + * Quadbin tile to cell + * + * Generated by tools/codegen/codegen_nebula.py. + */ class QuadbinTileToCellPhysicalFunction : public PhysicalFunctionConcept { public: - QuadbinTileToCellPhysicalFunction(PhysicalFunction x, PhysicalFunction y, PhysicalFunction z); + QuadbinTileToCellPhysicalFunction(PhysicalFunction xFunction, + PhysicalFunction yFunction, + PhysicalFunction zFunction); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/SubBigintTbigintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/SubBigintTbigintPhysicalFunction.hpp index 3c3558ab49..c762fd1138 100644 --- a/nes-physical-operators/include/Functions/Meos/SubBigintTbigintPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/SubBigintTbigintPhysicalFunction.hpp @@ -24,15 +24,15 @@ namespace NES { /** * @brief Physical operator for `sub_bigint_tbigint`. * - * Per-event sub_bigint_tbigint: subtracts a single-instant tbigint value from a constant int64 scalar. + * Per-event sub_bigint_tbigint: scalar bigint minus single-instant tbigint. * * Generated by tools/codegen/codegen_nebula.py. */ class SubBigintTbigintPhysicalFunction : public PhysicalFunctionConcept { public: - SubBigintTbigintPhysicalFunction(PhysicalFunction scalarFunction, - PhysicalFunction valueFunction, - PhysicalFunction tsFunction); + SubBigintTbigintPhysicalFunction(PhysicalFunction arg0Function, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; diff --git a/nes-physical-operators/include/Functions/Meos/SubFloatTfloatPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/SubFloatTfloatPhysicalFunction.hpp index bc997c36cc..3df66dbc4f 100644 --- a/nes-physical-operators/include/Functions/Meos/SubFloatTfloatPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/SubFloatTfloatPhysicalFunction.hpp @@ -24,15 +24,15 @@ namespace NES { /** * @brief Physical operator for `sub_float_tfloat`. * - * Per-event sub_float_tfloat: subtracts a single-instant tfloat value from a constant. + * Per-event sub_float_tfloat: scalar float minus single-instant tfloat. * * Generated by tools/codegen/codegen_nebula.py. */ class SubFloatTfloatPhysicalFunction : public PhysicalFunctionConcept { public: - SubFloatTfloatPhysicalFunction(PhysicalFunction scalarFunction, - PhysicalFunction valueFunction, - PhysicalFunction tsFunction); + SubFloatTfloatPhysicalFunction(PhysicalFunction arg0Function, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; diff --git a/nes-physical-operators/include/Functions/Meos/SubIntTintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/SubIntTintPhysicalFunction.hpp index 051774283e..8cf0ecd9f8 100644 --- a/nes-physical-operators/include/Functions/Meos/SubIntTintPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/SubIntTintPhysicalFunction.hpp @@ -24,15 +24,15 @@ namespace NES { /** * @brief Physical operator for `sub_int_tint`. * - * Per-event sub_int_tint: subtracts a single-instant tint value from a constant. + * Per-event sub_int_tint: scalar int minus single-instant tint. * * Generated by tools/codegen/codegen_nebula.py. */ class SubIntTintPhysicalFunction : public PhysicalFunctionConcept { public: - SubIntTintPhysicalFunction(PhysicalFunction scalarFunction, - PhysicalFunction valueFunction, - PhysicalFunction tsFunction); + SubIntTintPhysicalFunction(PhysicalFunction arg0Function, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; diff --git a/nes-physical-operators/include/Functions/Meos/SubTbigintBigintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/SubTbigintBigintPhysicalFunction.hpp index 5e42e74482..3d348ffd4c 100644 --- a/nes-physical-operators/include/Functions/Meos/SubTbigintBigintPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/SubTbigintBigintPhysicalFunction.hpp @@ -24,15 +24,15 @@ namespace NES { /** * @brief Physical operator for `sub_tbigint_bigint`. * - * Per-event sub_tbigint_bigint: subtracts a constant int64 from a single-instant tbigint value. + * Per-event sub_tbigint_bigint: single-instant tbigint minus scalar bigint. * * Generated by tools/codegen/codegen_nebula.py. */ class SubTbigintBigintPhysicalFunction : public PhysicalFunctionConcept { public: SubTbigintBigintPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction tsFunction, - PhysicalFunction subtrahendFunction); + PhysicalFunction tsFunction, + PhysicalFunction arg0Function); VarVal execute(const Record& record, ArenaRef& arena) const override; diff --git a/nes-physical-operators/include/Functions/Meos/SubTfloatFloatPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/SubTfloatFloatPhysicalFunction.hpp index f1ed79336a..4716b9a2cd 100644 --- a/nes-physical-operators/include/Functions/Meos/SubTfloatFloatPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/SubTfloatFloatPhysicalFunction.hpp @@ -24,15 +24,15 @@ namespace NES { /** * @brief Physical operator for `sub_tfloat_float`. * - * Per-event sub_tfloat_float: subtracts a constant from a single-instant tfloat value. + * Per-event sub_tfloat_float: single-instant tfloat minus scalar float. * * Generated by tools/codegen/codegen_nebula.py. */ class SubTfloatFloatPhysicalFunction : public PhysicalFunctionConcept { public: SubTfloatFloatPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction tsFunction, - PhysicalFunction subtrahendFunction); + PhysicalFunction tsFunction, + PhysicalFunction arg0Function); VarVal execute(const Record& record, ArenaRef& arena) const override; diff --git a/nes-physical-operators/include/Functions/Meos/SubTintIntPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/SubTintIntPhysicalFunction.hpp index d7792e3f00..ef13975e5e 100644 --- a/nes-physical-operators/include/Functions/Meos/SubTintIntPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/SubTintIntPhysicalFunction.hpp @@ -24,15 +24,15 @@ namespace NES { /** * @brief Physical operator for `sub_tint_int`. * - * Per-event sub_tint_int: subtracts a constant integer from a single-instant tint value. + * Per-event sub_tint_int: single-instant tint minus scalar int. * * Generated by tools/codegen/codegen_nebula.py. */ class SubTintIntPhysicalFunction : public PhysicalFunctionConcept { public: SubTintIntPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction tsFunction, - PhysicalFunction subtrahendFunction); + PhysicalFunction tsFunction, + PhysicalFunction arg0Function); VarVal execute(const Record& record, ArenaRef& arena) const override; diff --git a/nes-physical-operators/include/Functions/Meos/SubTnumberTnumberPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/SubTnumberTnumberPhysicalFunction.hpp index 8e411da16d..1d73f03e72 100644 --- a/nes-physical-operators/include/Functions/Meos/SubTnumberTnumberPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/SubTnumberTnumberPhysicalFunction.hpp @@ -24,15 +24,14 @@ namespace NES { /** * @brief Physical operator for `sub_tnumber_tnumber`. * - * Per-event element-wise subtraction of two co-instant tnumbers. + * Per-event sub_tnumber_tnumber: two temporal numbers subtracted (WKB result). * * Generated by tools/codegen/codegen_nebula.py. */ class SubTnumberTnumberPhysicalFunction : public PhysicalFunctionConcept { public: - SubTnumberTnumberPhysicalFunction(PhysicalFunction value1Function, - PhysicalFunction value2Function, - PhysicalFunction tsFunction); + SubTnumberTnumberPhysicalFunction(PhysicalFunction trajFunction, + PhysicalFunction arg0Function); VarVal execute(const Record& record, ArenaRef& arena) const override; diff --git a/nes-physical-operators/include/Functions/Meos/TEqTextTtextPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TEqTextTtextPhysicalFunction.hpp new file mode 100644 index 0000000000..545311853e --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TEqTextTtextPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `teq_text_ttext(txt0, temp)`. + * + * Temporal eqqual text vs ttext + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TEqTextTtextPhysicalFunction : public PhysicalFunctionConcept { +public: + TEqTextTtextPhysicalFunction(PhysicalFunction arg0Function, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TEqTtextTextPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TEqTtextTextPhysicalFunction.hpp new file mode 100644 index 0000000000..c9886b4e9a --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TEqTtextTextPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `teq_ttext_text(temp, txt0)`. + * + * Temporal eqqual ttext vs text + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TEqTtextTextPhysicalFunction : public PhysicalFunctionConcept { +public: + TEqTtextTextPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction, + PhysicalFunction arg0Function); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TGeTextTtextPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TGeTextTtextPhysicalFunction.hpp new file mode 100644 index 0000000000..d0edf1d7cc --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TGeTextTtextPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `tge_text_ttext(txt0, temp)`. + * + * Temporal ge text vs ttext + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TGeTextTtextPhysicalFunction : public PhysicalFunctionConcept { +public: + TGeTextTtextPhysicalFunction(PhysicalFunction arg0Function, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TGeTtextTextPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TGeTtextTextPhysicalFunction.hpp new file mode 100644 index 0000000000..1a3b55cf29 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TGeTtextTextPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `tge_ttext_text(temp, txt0)`. + * + * Temporal ge ttext vs text + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TGeTtextTextPhysicalFunction : public PhysicalFunctionConcept { +public: + TGeTtextTextPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction, + PhysicalFunction arg0Function); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TGtTextTtextPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TGtTextTtextPhysicalFunction.hpp new file mode 100644 index 0000000000..954726161c --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TGtTextTtextPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `tgt_text_ttext(txt0, temp)`. + * + * Temporal gt text vs ttext + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TGtTextTtextPhysicalFunction : public PhysicalFunctionConcept { +public: + TGtTextTtextPhysicalFunction(PhysicalFunction arg0Function, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TGtTtextTextPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TGtTtextTextPhysicalFunction.hpp new file mode 100644 index 0000000000..473fabfcee --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TGtTtextTextPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `tgt_ttext_text(temp, txt0)`. + * + * Temporal gt ttext vs text + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TGtTtextTextPhysicalFunction : public PhysicalFunctionConcept { +public: + TGtTtextTextPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction, + PhysicalFunction arg0Function); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TLeTextTtextPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TLeTextTtextPhysicalFunction.hpp new file mode 100644 index 0000000000..6cce9376c7 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TLeTextTtextPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `tle_text_ttext(txt0, temp)`. + * + * Temporal le text vs ttext + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TLeTextTtextPhysicalFunction : public PhysicalFunctionConcept { +public: + TLeTextTtextPhysicalFunction(PhysicalFunction arg0Function, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TLeTtextTextPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TLeTtextTextPhysicalFunction.hpp new file mode 100644 index 0000000000..fa116dd48d --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TLeTtextTextPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `tle_ttext_text(temp, txt0)`. + * + * Temporal le ttext vs text + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TLeTtextTextPhysicalFunction : public PhysicalFunctionConcept { +public: + TLeTtextTextPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction, + PhysicalFunction arg0Function); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TLtTextTtextPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TLtTextTtextPhysicalFunction.hpp new file mode 100644 index 0000000000..9efc932da8 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TLtTextTtextPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `tlt_text_ttext(txt0, temp)`. + * + * Temporal lt text vs ttext + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TLtTextTtextPhysicalFunction : public PhysicalFunctionConcept { +public: + TLtTextTtextPhysicalFunction(PhysicalFunction arg0Function, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TLtTtextTextPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TLtTtextTextPhysicalFunction.hpp new file mode 100644 index 0000000000..2d339975cf --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TLtTtextTextPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `tlt_ttext_text(temp, txt0)`. + * + * Temporal lt ttext vs text + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TLtTtextTextPhysicalFunction : public PhysicalFunctionConcept { +public: + TLtTtextTextPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction, + PhysicalFunction arg0Function); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TNeTextTtextPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TNeTextTtextPhysicalFunction.hpp new file mode 100644 index 0000000000..59acfa8bee --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TNeTextTtextPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `tne_text_ttext(txt0, temp)`. + * + * Temporal nequal text vs ttext + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TNeTextTtextPhysicalFunction : public PhysicalFunctionConcept { +public: + TNeTextTtextPhysicalFunction(PhysicalFunction arg0Function, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TNeTtextTextPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TNeTtextTextPhysicalFunction.hpp new file mode 100644 index 0000000000..1c0159cf9d --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TNeTtextTextPhysicalFunction.hpp @@ -0,0 +1,43 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `tne_ttext_text(temp, txt0)`. + * + * Temporal nequal ttext vs text + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TNeTtextTextPhysicalFunction : public PhysicalFunctionConcept { +public: + TNeTtextTextPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction, + PhysicalFunction arg0Function); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TandBoolTboolPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TandBoolTboolPhysicalFunction.hpp index 541123f801..cda51805f8 100644 --- a/nes-physical-operators/include/Functions/Meos/TandBoolTboolPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/TandBoolTboolPhysicalFunction.hpp @@ -24,15 +24,15 @@ namespace NES { /** * @brief Physical operator for `tand_bool_tbool`. * - * Per-event tand_bool_tbool: AND of a scalar bool and a single-instant tbool. + * Per-event tand_bool_tbool: temporal AND of scalar bool and tbool. * * Generated by tools/codegen/codegen_nebula.py. */ class TandBoolTboolPhysicalFunction : public PhysicalFunctionConcept { public: - TandBoolTboolPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction thresholdFunction, - PhysicalFunction tsFunction); + TandBoolTboolPhysicalFunction(PhysicalFunction arg0Function, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; diff --git a/nes-physical-operators/include/Functions/Meos/TandTboolBoolPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TandTboolBoolPhysicalFunction.hpp index e7227db724..2d38f30eab 100644 --- a/nes-physical-operators/include/Functions/Meos/TandTboolBoolPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/TandTboolBoolPhysicalFunction.hpp @@ -24,15 +24,15 @@ namespace NES { /** * @brief Physical operator for `tand_tbool_bool`. * - * Per-event tand_tbool_bool: AND of a single-instant tbool and a scalar bool. + * Per-event tand_tbool_bool: temporal AND of tbool and scalar bool. * * Generated by tools/codegen/codegen_nebula.py. */ class TandTboolBoolPhysicalFunction : public PhysicalFunctionConcept { public: TandTboolBoolPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction thresholdFunction, - PhysicalFunction tsFunction); + PhysicalFunction tsFunction, + PhysicalFunction arg0Function); VarVal execute(const Record& record, ArenaRef& arena) const override; diff --git a/nes-physical-operators/include/Functions/Meos/TandTboolTboolPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TandTboolTboolPhysicalFunction.hpp index cdbb608e49..e5d7c1a631 100644 --- a/nes-physical-operators/include/Functions/Meos/TandTboolTboolPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/TandTboolTboolPhysicalFunction.hpp @@ -24,15 +24,14 @@ namespace NES { /** * @brief Physical operator for `tand_tbool_tbool`. * - * Per-event tand_tbool_tbool: AND of two single-instant tbools. + * Per-event tand_tbool_tbool: temporal AND of two tbool values (WKB result). * * Generated by tools/codegen/codegen_nebula.py. */ class TandTboolTboolPhysicalFunction : public PhysicalFunctionConcept { public: - TandTboolTboolPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction thresholdFunction, - PhysicalFunction tsFunction); + TandTboolTboolPhysicalFunction(PhysicalFunction trajFunction, + PhysicalFunction arg0Function); VarVal execute(const Record& record, ArenaRef& arena) const override; diff --git a/nes-physical-operators/include/Functions/Meos/TbigintScaleValuePhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TbigintScaleValuePhysicalFunction.hpp index 5965e5c4dc..c3c528ec58 100644 --- a/nes-physical-operators/include/Functions/Meos/TbigintScaleValuePhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/TbigintScaleValuePhysicalFunction.hpp @@ -24,16 +24,15 @@ namespace NES { /** * @brief Physical operator for `tbigint_scale_value`. * - * Per-event tbigint_scale_value: scales the value span of a single-instant tbigint - * to a given int64_t width. + * Per-event tbigint_scale_value: scale single-instant tbigint value by scalar. * * Generated by tools/codegen/codegen_nebula.py. */ class TbigintScaleValuePhysicalFunction : public PhysicalFunctionConcept { public: TbigintScaleValuePhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction tsFunction, - PhysicalFunction widthFunction); + PhysicalFunction tsFunction, + PhysicalFunction arg0Function); VarVal execute(const Record& record, ArenaRef& arena) const override; diff --git a/nes-physical-operators/include/Functions/Meos/TbigintShiftScaleValuePhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TbigintShiftScaleValuePhysicalFunction.hpp index 63758b98e2..df177fd010 100644 --- a/nes-physical-operators/include/Functions/Meos/TbigintShiftScaleValuePhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/TbigintShiftScaleValuePhysicalFunction.hpp @@ -24,17 +24,16 @@ namespace NES { /** * @brief Physical operator for `tbigint_shift_scale_value`. * - * Per-event tbigint_shift_scale_value: shifts the value span of a single-instant - * tbigint by a constant int64_t and scales it to the given int64_t width. + * Per-event tbigint_shift_scale_value: shift then scale single-instant tbigint value. * * Generated by tools/codegen/codegen_nebula.py. */ class TbigintShiftScaleValuePhysicalFunction : public PhysicalFunctionConcept { public: TbigintShiftScaleValuePhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction tsFunction, - PhysicalFunction shiftFunction, - PhysicalFunction widthFunction); + PhysicalFunction tsFunction, + PhysicalFunction arg0Function, + PhysicalFunction arg1Function); VarVal execute(const Record& record, ArenaRef& arena) const override; diff --git a/nes-physical-operators/include/Functions/Meos/TbigintShiftValuePhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TbigintShiftValuePhysicalFunction.hpp index 7acf342692..2b4b8894d8 100644 --- a/nes-physical-operators/include/Functions/Meos/TbigintShiftValuePhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/TbigintShiftValuePhysicalFunction.hpp @@ -24,16 +24,15 @@ namespace NES { /** * @brief Physical operator for `tbigint_shift_value`. * - * Per-event tbigint_shift_value: shifts the value span of a single-instant tbigint - * by a constant int64_t. + * Per-event tbigint_shift_value: shift single-instant tbigint value by scalar. * * Generated by tools/codegen/codegen_nebula.py. */ class TbigintShiftValuePhysicalFunction : public PhysicalFunctionConcept { public: TbigintShiftValuePhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction tsFunction, - PhysicalFunction shiftFunction); + PhysicalFunction tsFunction, + PhysicalFunction arg0Function); VarVal execute(const Record& record, ArenaRef& arena) const override; diff --git a/nes-physical-operators/include/Functions/Meos/TbigintToTfloatPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TbigintToTfloatPhysicalFunction.hpp index a59b288ff5..763217b93b 100644 --- a/nes-physical-operators/include/Functions/Meos/TbigintToTfloatPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/TbigintToTfloatPhysicalFunction.hpp @@ -24,14 +24,14 @@ namespace NES { /** * @brief Physical operator for `tbigint_to_tfloat`. * - * Per-event tbigint_to_tfloat: single-instant tbigint converted to tfloat, result extracted -> double. + * Per-event tbigint_to_tfloat: convert single-instant tbigint to tfloat. * * Generated by tools/codegen/codegen_nebula.py. */ class TbigintToTfloatPhysicalFunction : public PhysicalFunctionConcept { public: TbigintToTfloatPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction tsFunction); + PhysicalFunction tsFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; diff --git a/nes-physical-operators/include/Functions/Meos/TbigintToTintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TbigintToTintPhysicalFunction.hpp index a122dcf560..3b5995175c 100644 --- a/nes-physical-operators/include/Functions/Meos/TbigintToTintPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/TbigintToTintPhysicalFunction.hpp @@ -24,14 +24,14 @@ namespace NES { /** * @brief Physical operator for `tbigint_to_tint`. * - * Per-event tbigint_to_tint: single-instant tbigint converted to tint, result extracted -> double. + * Per-event tbigint_to_tint: convert single-instant tbigint to tint. * * Generated by tools/codegen/codegen_nebula.py. */ class TbigintToTintPhysicalFunction : public PhysicalFunctionConcept { public: TbigintToTintPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction tsFunction); + PhysicalFunction tsFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; diff --git a/nes-physical-operators/include/Functions/Meos/TboolToTintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TboolToTintPhysicalFunction.hpp index 473cc7f507..5c4b6914fe 100644 --- a/nes-physical-operators/include/Functions/Meos/TboolToTintPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/TboolToTintPhysicalFunction.hpp @@ -24,14 +24,14 @@ namespace NES { /** * @brief Physical operator for `tbool_to_tint`. * - * Per-event tbool_to_tint: single-instant tbool cast to tint, result extracted -> double. + * Per-event tbool_to_tint: convert single-instant tbool to tint. * * Generated by tools/codegen/codegen_nebula.py. */ class TboolToTintPhysicalFunction : public PhysicalFunctionConcept { public: TboolToTintPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction tsFunction); + PhysicalFunction tsFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; diff --git a/nes-physical-operators/include/Functions/Meos/TdistanceTfloatFloatPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TdistanceTfloatFloatPhysicalFunction.hpp index 06bf692313..e2cfbfb89f 100644 --- a/nes-physical-operators/include/Functions/Meos/TdistanceTfloatFloatPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/TdistanceTfloatFloatPhysicalFunction.hpp @@ -24,15 +24,15 @@ namespace NES { /** * @brief Physical operator for `tdistance_tfloat_float`. * - * Per-event tdistance_tfloat_float: distance between a single-instant tfloat and a float. + * Per-event tdistance_tfloat_float: temporal distance between tfloat and scalar float. * * Generated by tools/codegen/codegen_nebula.py. */ class TdistanceTfloatFloatPhysicalFunction : public PhysicalFunctionConcept { public: TdistanceTfloatFloatPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction tsFunction, - PhysicalFunction dFunction); + PhysicalFunction tsFunction, + PhysicalFunction arg0Function); VarVal execute(const Record& record, ArenaRef& arena) const override; diff --git a/nes-physical-operators/include/Functions/Meos/TdistanceTintIntPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TdistanceTintIntPhysicalFunction.hpp index 02d4ffe164..2fb6376948 100644 --- a/nes-physical-operators/include/Functions/Meos/TdistanceTintIntPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/TdistanceTintIntPhysicalFunction.hpp @@ -24,16 +24,15 @@ namespace NES { /** * @brief Physical operator for `tdistance_tint_int`. * - * Per-event tdistance_tint_int: computes the temporal distance between a - * single-instant tint value and a constant integer. + * Per-event tdistance_tint_int: temporal distance between tint and scalar int. * * Generated by tools/codegen/codegen_nebula.py. */ class TdistanceTintIntPhysicalFunction : public PhysicalFunctionConcept { public: TdistanceTintIntPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction tsFunction, - PhysicalFunction dFunction); + PhysicalFunction tsFunction, + PhysicalFunction arg0Function); VarVal execute(const Record& record, ArenaRef& arena) const override; diff --git a/nes-physical-operators/include/Functions/Meos/TdistanceTnumberTnumberPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TdistanceTnumberTnumberPhysicalFunction.hpp index 107d00bae1..2d96c815cf 100644 --- a/nes-physical-operators/include/Functions/Meos/TdistanceTnumberTnumberPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/TdistanceTnumberTnumberPhysicalFunction.hpp @@ -24,15 +24,14 @@ namespace NES { /** * @brief Physical operator for `tdistance_tnumber_tnumber`. * - * Per-event tdistance_tnumber_tnumber: distance between two co-instant tnumber values. + * Per-event tdistance_tnumber_tnumber: temporal distance between two tnumbers (WKB result). * * Generated by tools/codegen/codegen_nebula.py. */ class TdistanceTnumberTnumberPhysicalFunction : public PhysicalFunctionConcept { public: - TdistanceTnumberTnumberPhysicalFunction(PhysicalFunction value1Function, - PhysicalFunction value2Function, - PhysicalFunction tsFunction); + TdistanceTnumberTnumberPhysicalFunction(PhysicalFunction trajFunction, + PhysicalFunction arg0Function); VarVal execute(const Record& record, ArenaRef& arena) const override; diff --git a/nes-physical-operators/include/Functions/Meos/TemporalAContainsTNpointGeometryPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TemporalAContainsTNpointGeometryPhysicalFunction.hpp new file mode 100644 index 0000000000..2ff6051e29 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TemporalAContainsTNpointGeometryPhysicalFunction.hpp @@ -0,0 +1,44 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `acontains_tgeo_geo`. + * + * Per-event acontains_tgeo_geo via tnpoint→tgeompoint composition. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TemporalAContainsTNpointGeometryPhysicalFunction : public PhysicalFunctionConcept { +public: + TemporalAContainsTNpointGeometryPhysicalFunction(PhysicalFunction ridFunction, + PhysicalFunction fractionFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TemporalAContainsTNpointTNpointPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TemporalAContainsTNpointTNpointPhysicalFunction.hpp new file mode 100644 index 0000000000..a8d287806d --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TemporalAContainsTNpointTNpointPhysicalFunction.hpp @@ -0,0 +1,46 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `acontains_tgeo_tgeo`. + * + * Per-event acontains_tgeo_tgeo via tnpoint×tnpoint→tgeompoint composition. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TemporalAContainsTNpointTNpointPhysicalFunction : public PhysicalFunctionConcept { +public: + TemporalAContainsTNpointTNpointPhysicalFunction(PhysicalFunction ridAFunction, + PhysicalFunction fractionAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction ridBFunction, + PhysicalFunction fractionBFunction, + PhysicalFunction tsBFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TemporalAContainsTPoseGeometryPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TemporalAContainsTPoseGeometryPhysicalFunction.hpp new file mode 100644 index 0000000000..c8edd1e4d1 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TemporalAContainsTPoseGeometryPhysicalFunction.hpp @@ -0,0 +1,45 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `acontains_tgeo_geo`. + * + * Per-event acontains_tgeo_geo via tpose→tgeompoint composition. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TemporalAContainsTPoseGeometryPhysicalFunction : public PhysicalFunctionConcept { +public: + TemporalAContainsTPoseGeometryPhysicalFunction(PhysicalFunction xFunction, + PhysicalFunction yFunction, + PhysicalFunction thetaFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TemporalAContainsTPoseTPosePhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TemporalAContainsTPoseTPosePhysicalFunction.hpp new file mode 100644 index 0000000000..e16dee73c9 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TemporalAContainsTPoseTPosePhysicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `acontains_tgeo_tgeo`. + * + * Per-event acontains_tgeo_tgeo via tpose×tpose→tgeompoint composition. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TemporalAContainsTPoseTPosePhysicalFunction : public PhysicalFunctionConcept { +public: + TemporalAContainsTPoseTPosePhysicalFunction(PhysicalFunction xAFunction, + PhysicalFunction yAFunction, + PhysicalFunction thetaAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction xBFunction, + PhysicalFunction yBFunction, + PhysicalFunction thetaBFunction, + PhysicalFunction tsBFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TemporalADWithinTNpointGeometryPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TemporalADWithinTNpointGeometryPhysicalFunction.hpp new file mode 100644 index 0000000000..486ed1078f --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TemporalADWithinTNpointGeometryPhysicalFunction.hpp @@ -0,0 +1,45 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `adwithin_tgeo_geo`. + * + * Per-event adwithin_tgeo_geo via tnpoint→tgeompoint composition. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TemporalADWithinTNpointGeometryPhysicalFunction : public PhysicalFunctionConcept { +public: + TemporalADWithinTNpointGeometryPhysicalFunction(PhysicalFunction ridFunction, + PhysicalFunction fractionFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction, + PhysicalFunction distFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TemporalADWithinTNpointTNpointPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TemporalADWithinTNpointTNpointPhysicalFunction.hpp new file mode 100644 index 0000000000..32b67f4eb5 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TemporalADWithinTNpointTNpointPhysicalFunction.hpp @@ -0,0 +1,47 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `adwithin_tgeo_tgeo`. + * + * Per-event adwithin_tgeo_tgeo via tnpoint×tnpoint→tgeompoint composition. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TemporalADWithinTNpointTNpointPhysicalFunction : public PhysicalFunctionConcept { +public: + TemporalADWithinTNpointTNpointPhysicalFunction(PhysicalFunction ridAFunction, + PhysicalFunction fractionAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction ridBFunction, + PhysicalFunction fractionBFunction, + PhysicalFunction tsBFunction, + PhysicalFunction distFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TemporalADWithinTPoseGeometryPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TemporalADWithinTPoseGeometryPhysicalFunction.hpp new file mode 100644 index 0000000000..1c521aedf3 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TemporalADWithinTPoseGeometryPhysicalFunction.hpp @@ -0,0 +1,46 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `adwithin_tgeo_geo`. + * + * Per-event adwithin_tgeo_geo via tpose→tgeompoint composition. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TemporalADWithinTPoseGeometryPhysicalFunction : public PhysicalFunctionConcept { +public: + TemporalADWithinTPoseGeometryPhysicalFunction(PhysicalFunction xFunction, + PhysicalFunction yFunction, + PhysicalFunction thetaFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction, + PhysicalFunction distFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TemporalADWithinTPoseTPosePhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TemporalADWithinTPoseTPosePhysicalFunction.hpp new file mode 100644 index 0000000000..b118e16bbf --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TemporalADWithinTPoseTPosePhysicalFunction.hpp @@ -0,0 +1,49 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `adwithin_tgeo_tgeo`. + * + * Per-event adwithin_tgeo_tgeo via tpose×tpose→tgeompoint composition. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TemporalADWithinTPoseTPosePhysicalFunction : public PhysicalFunctionConcept { +public: + TemporalADWithinTPoseTPosePhysicalFunction(PhysicalFunction xAFunction, + PhysicalFunction yAFunction, + PhysicalFunction thetaAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction xBFunction, + PhysicalFunction yBFunction, + PhysicalFunction thetaBFunction, + PhysicalFunction tsBFunction, + PhysicalFunction distFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TemporalADisjointTNpointGeometryPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TemporalADisjointTNpointGeometryPhysicalFunction.hpp new file mode 100644 index 0000000000..8937f85243 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TemporalADisjointTNpointGeometryPhysicalFunction.hpp @@ -0,0 +1,44 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `adisjoint_tgeo_geo`. + * + * Per-event adisjoint_tgeo_geo via tnpoint→tgeompoint composition. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TemporalADisjointTNpointGeometryPhysicalFunction : public PhysicalFunctionConcept { +public: + TemporalADisjointTNpointGeometryPhysicalFunction(PhysicalFunction ridFunction, + PhysicalFunction fractionFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TemporalADisjointTNpointTNpointPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TemporalADisjointTNpointTNpointPhysicalFunction.hpp new file mode 100644 index 0000000000..3639ba077e --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TemporalADisjointTNpointTNpointPhysicalFunction.hpp @@ -0,0 +1,46 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `adisjoint_tgeo_tgeo`. + * + * Per-event adisjoint_tgeo_tgeo via tnpoint×tnpoint→tgeompoint composition. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TemporalADisjointTNpointTNpointPhysicalFunction : public PhysicalFunctionConcept { +public: + TemporalADisjointTNpointTNpointPhysicalFunction(PhysicalFunction ridAFunction, + PhysicalFunction fractionAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction ridBFunction, + PhysicalFunction fractionBFunction, + PhysicalFunction tsBFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TemporalADisjointTPoseGeometryPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TemporalADisjointTPoseGeometryPhysicalFunction.hpp new file mode 100644 index 0000000000..2c97639547 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TemporalADisjointTPoseGeometryPhysicalFunction.hpp @@ -0,0 +1,45 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `adisjoint_tgeo_geo`. + * + * Per-event adisjoint_tgeo_geo via tpose→tgeompoint composition. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TemporalADisjointTPoseGeometryPhysicalFunction : public PhysicalFunctionConcept { +public: + TemporalADisjointTPoseGeometryPhysicalFunction(PhysicalFunction xFunction, + PhysicalFunction yFunction, + PhysicalFunction thetaFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TemporalADisjointTPoseTPosePhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TemporalADisjointTPoseTPosePhysicalFunction.hpp new file mode 100644 index 0000000000..397d1b8b31 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TemporalADisjointTPoseTPosePhysicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `adisjoint_tgeo_tgeo`. + * + * Per-event adisjoint_tgeo_tgeo via tpose×tpose→tgeompoint composition. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TemporalADisjointTPoseTPosePhysicalFunction : public PhysicalFunctionConcept { +public: + TemporalADisjointTPoseTPosePhysicalFunction(PhysicalFunction xAFunction, + PhysicalFunction yAFunction, + PhysicalFunction thetaAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction xBFunction, + PhysicalFunction yBFunction, + PhysicalFunction thetaBFunction, + PhysicalFunction tsBFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TemporalAIntersectsTNpointGeometryPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TemporalAIntersectsTNpointGeometryPhysicalFunction.hpp new file mode 100644 index 0000000000..61f203a23f --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TemporalAIntersectsTNpointGeometryPhysicalFunction.hpp @@ -0,0 +1,44 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `aintersects_tgeo_geo`. + * + * Per-event aintersects_tgeo_geo via tnpoint→tgeompoint composition. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TemporalAIntersectsTNpointGeometryPhysicalFunction : public PhysicalFunctionConcept { +public: + TemporalAIntersectsTNpointGeometryPhysicalFunction(PhysicalFunction ridFunction, + PhysicalFunction fractionFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TemporalAIntersectsTNpointTNpointPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TemporalAIntersectsTNpointTNpointPhysicalFunction.hpp new file mode 100644 index 0000000000..2ca428a88f --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TemporalAIntersectsTNpointTNpointPhysicalFunction.hpp @@ -0,0 +1,46 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `aintersects_tgeo_tgeo`. + * + * Per-event aintersects_tgeo_tgeo via tnpoint×tnpoint→tgeompoint composition. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TemporalAIntersectsTNpointTNpointPhysicalFunction : public PhysicalFunctionConcept { +public: + TemporalAIntersectsTNpointTNpointPhysicalFunction(PhysicalFunction ridAFunction, + PhysicalFunction fractionAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction ridBFunction, + PhysicalFunction fractionBFunction, + PhysicalFunction tsBFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TemporalAIntersectsTPoseGeometryPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TemporalAIntersectsTPoseGeometryPhysicalFunction.hpp new file mode 100644 index 0000000000..463c554640 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TemporalAIntersectsTPoseGeometryPhysicalFunction.hpp @@ -0,0 +1,45 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `aintersects_tgeo_geo`. + * + * Per-event aintersects_tgeo_geo via tpose→tgeompoint composition. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TemporalAIntersectsTPoseGeometryPhysicalFunction : public PhysicalFunctionConcept { +public: + TemporalAIntersectsTPoseGeometryPhysicalFunction(PhysicalFunction xFunction, + PhysicalFunction yFunction, + PhysicalFunction thetaFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TemporalAIntersectsTPoseTPosePhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TemporalAIntersectsTPoseTPosePhysicalFunction.hpp new file mode 100644 index 0000000000..5203ce323c --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TemporalAIntersectsTPoseTPosePhysicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `aintersects_tgeo_tgeo`. + * + * Per-event aintersects_tgeo_tgeo via tpose×tpose→tgeompoint composition. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TemporalAIntersectsTPoseTPosePhysicalFunction : public PhysicalFunctionConcept { +public: + TemporalAIntersectsTPoseTPosePhysicalFunction(PhysicalFunction xAFunction, + PhysicalFunction yAFunction, + PhysicalFunction thetaAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction xBFunction, + PhysicalFunction yBFunction, + PhysicalFunction thetaBFunction, + PhysicalFunction tsBFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TemporalATouchesTNpointGeometryPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TemporalATouchesTNpointGeometryPhysicalFunction.hpp new file mode 100644 index 0000000000..cc0a615df0 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TemporalATouchesTNpointGeometryPhysicalFunction.hpp @@ -0,0 +1,44 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `atouches_tgeo_geo`. + * + * Per-event atouches_tgeo_geo via tnpoint→tgeompoint composition. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TemporalATouchesTNpointGeometryPhysicalFunction : public PhysicalFunctionConcept { +public: + TemporalATouchesTNpointGeometryPhysicalFunction(PhysicalFunction ridFunction, + PhysicalFunction fractionFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TemporalATouchesTNpointTNpointPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TemporalATouchesTNpointTNpointPhysicalFunction.hpp new file mode 100644 index 0000000000..c351cd35e4 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TemporalATouchesTNpointTNpointPhysicalFunction.hpp @@ -0,0 +1,46 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `atouches_tgeo_tgeo`. + * + * Per-event atouches_tgeo_tgeo via tnpoint×tnpoint→tgeompoint composition. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TemporalATouchesTNpointTNpointPhysicalFunction : public PhysicalFunctionConcept { +public: + TemporalATouchesTNpointTNpointPhysicalFunction(PhysicalFunction ridAFunction, + PhysicalFunction fractionAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction ridBFunction, + PhysicalFunction fractionBFunction, + PhysicalFunction tsBFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TemporalATouchesTPoseGeometryPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TemporalATouchesTPoseGeometryPhysicalFunction.hpp new file mode 100644 index 0000000000..38b9d5f857 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TemporalATouchesTPoseGeometryPhysicalFunction.hpp @@ -0,0 +1,45 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `atouches_tgeo_geo`. + * + * Per-event atouches_tgeo_geo via tpose→tgeompoint composition. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TemporalATouchesTPoseGeometryPhysicalFunction : public PhysicalFunctionConcept { +public: + TemporalATouchesTPoseGeometryPhysicalFunction(PhysicalFunction xFunction, + PhysicalFunction yFunction, + PhysicalFunction thetaFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TemporalATouchesTPoseTPosePhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TemporalATouchesTPoseTPosePhysicalFunction.hpp new file mode 100644 index 0000000000..cb36801463 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TemporalATouchesTPoseTPosePhysicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `atouches_tgeo_tgeo`. + * + * Per-event atouches_tgeo_tgeo via tpose×tpose→tgeompoint composition. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TemporalATouchesTPoseTPosePhysicalFunction : public PhysicalFunctionConcept { +public: + TemporalATouchesTPoseTPosePhysicalFunction(PhysicalFunction xAFunction, + PhysicalFunction yAFunction, + PhysicalFunction thetaAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction xBFunction, + PhysicalFunction yBFunction, + PhysicalFunction thetaBFunction, + PhysicalFunction tsBFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TemporalEContainsTNpointGeometryPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TemporalEContainsTNpointGeometryPhysicalFunction.hpp new file mode 100644 index 0000000000..600062e668 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TemporalEContainsTNpointGeometryPhysicalFunction.hpp @@ -0,0 +1,44 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `econtains_tgeo_geo`. + * + * Per-event econtains_tgeo_geo via tnpoint→tgeompoint composition. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TemporalEContainsTNpointGeometryPhysicalFunction : public PhysicalFunctionConcept { +public: + TemporalEContainsTNpointGeometryPhysicalFunction(PhysicalFunction ridFunction, + PhysicalFunction fractionFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TemporalEContainsTNpointTNpointPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TemporalEContainsTNpointTNpointPhysicalFunction.hpp new file mode 100644 index 0000000000..815cd14a84 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TemporalEContainsTNpointTNpointPhysicalFunction.hpp @@ -0,0 +1,46 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `econtains_tgeo_tgeo`. + * + * Per-event econtains_tgeo_tgeo via tnpoint×tnpoint→tgeompoint composition. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TemporalEContainsTNpointTNpointPhysicalFunction : public PhysicalFunctionConcept { +public: + TemporalEContainsTNpointTNpointPhysicalFunction(PhysicalFunction ridAFunction, + PhysicalFunction fractionAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction ridBFunction, + PhysicalFunction fractionBFunction, + PhysicalFunction tsBFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TemporalEContainsTPoseGeometryPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TemporalEContainsTPoseGeometryPhysicalFunction.hpp new file mode 100644 index 0000000000..a1d26498d8 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TemporalEContainsTPoseGeometryPhysicalFunction.hpp @@ -0,0 +1,45 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `econtains_tgeo_geo`. + * + * Per-event econtains_tgeo_geo via tpose→tgeompoint composition. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TemporalEContainsTPoseGeometryPhysicalFunction : public PhysicalFunctionConcept { +public: + TemporalEContainsTPoseGeometryPhysicalFunction(PhysicalFunction xFunction, + PhysicalFunction yFunction, + PhysicalFunction thetaFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TemporalEContainsTPoseTPosePhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TemporalEContainsTPoseTPosePhysicalFunction.hpp new file mode 100644 index 0000000000..4274d1dd87 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TemporalEContainsTPoseTPosePhysicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `econtains_tgeo_tgeo`. + * + * Per-event econtains_tgeo_tgeo via tpose×tpose→tgeompoint composition. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TemporalEContainsTPoseTPosePhysicalFunction : public PhysicalFunctionConcept { +public: + TemporalEContainsTPoseTPosePhysicalFunction(PhysicalFunction xAFunction, + PhysicalFunction yAFunction, + PhysicalFunction thetaAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction xBFunction, + PhysicalFunction yBFunction, + PhysicalFunction thetaBFunction, + PhysicalFunction tsBFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TemporalECoversTNpointGeometryPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TemporalECoversTNpointGeometryPhysicalFunction.hpp new file mode 100644 index 0000000000..34d85c6280 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TemporalECoversTNpointGeometryPhysicalFunction.hpp @@ -0,0 +1,44 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `ecovers_tgeo_geo`. + * + * Per-event ecovers_tgeo_geo via tnpoint→tgeompoint composition. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TemporalECoversTNpointGeometryPhysicalFunction : public PhysicalFunctionConcept { +public: + TemporalECoversTNpointGeometryPhysicalFunction(PhysicalFunction ridFunction, + PhysicalFunction fractionFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TemporalECoversTNpointTNpointPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TemporalECoversTNpointTNpointPhysicalFunction.hpp new file mode 100644 index 0000000000..c68773b938 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TemporalECoversTNpointTNpointPhysicalFunction.hpp @@ -0,0 +1,46 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `ecovers_tgeo_tgeo`. + * + * Per-event ecovers_tgeo_tgeo via tnpoint×tnpoint→tgeompoint composition. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TemporalECoversTNpointTNpointPhysicalFunction : public PhysicalFunctionConcept { +public: + TemporalECoversTNpointTNpointPhysicalFunction(PhysicalFunction ridAFunction, + PhysicalFunction fractionAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction ridBFunction, + PhysicalFunction fractionBFunction, + PhysicalFunction tsBFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TemporalECoversTPoseGeometryPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TemporalECoversTPoseGeometryPhysicalFunction.hpp new file mode 100644 index 0000000000..20f2a613e6 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TemporalECoversTPoseGeometryPhysicalFunction.hpp @@ -0,0 +1,45 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `ecovers_tgeo_geo`. + * + * Per-event ecovers_tgeo_geo via tpose→tgeompoint composition. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TemporalECoversTPoseGeometryPhysicalFunction : public PhysicalFunctionConcept { +public: + TemporalECoversTPoseGeometryPhysicalFunction(PhysicalFunction xFunction, + PhysicalFunction yFunction, + PhysicalFunction thetaFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TemporalECoversTPoseTPosePhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TemporalECoversTPoseTPosePhysicalFunction.hpp new file mode 100644 index 0000000000..62f15eba19 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TemporalECoversTPoseTPosePhysicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `ecovers_tgeo_tgeo`. + * + * Per-event ecovers_tgeo_tgeo via tpose×tpose→tgeompoint composition. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TemporalECoversTPoseTPosePhysicalFunction : public PhysicalFunctionConcept { +public: + TemporalECoversTPoseTPosePhysicalFunction(PhysicalFunction xAFunction, + PhysicalFunction yAFunction, + PhysicalFunction thetaAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction xBFunction, + PhysicalFunction yBFunction, + PhysicalFunction thetaBFunction, + PhysicalFunction tsBFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TemporalEDWithinTNpointGeometryPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TemporalEDWithinTNpointGeometryPhysicalFunction.hpp new file mode 100644 index 0000000000..e2d602be2b --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TemporalEDWithinTNpointGeometryPhysicalFunction.hpp @@ -0,0 +1,45 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `edwithin_tgeo_geo`. + * + * Per-event edwithin_tgeo_geo via tnpoint→tgeompoint composition. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TemporalEDWithinTNpointGeometryPhysicalFunction : public PhysicalFunctionConcept { +public: + TemporalEDWithinTNpointGeometryPhysicalFunction(PhysicalFunction ridFunction, + PhysicalFunction fractionFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction, + PhysicalFunction distFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TemporalEDWithinTNpointTNpointPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TemporalEDWithinTNpointTNpointPhysicalFunction.hpp new file mode 100644 index 0000000000..b79225a078 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TemporalEDWithinTNpointTNpointPhysicalFunction.hpp @@ -0,0 +1,47 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `edwithin_tgeo_tgeo`. + * + * Per-event edwithin_tgeo_tgeo via tnpoint×tnpoint→tgeompoint composition. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TemporalEDWithinTNpointTNpointPhysicalFunction : public PhysicalFunctionConcept { +public: + TemporalEDWithinTNpointTNpointPhysicalFunction(PhysicalFunction ridAFunction, + PhysicalFunction fractionAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction ridBFunction, + PhysicalFunction fractionBFunction, + PhysicalFunction tsBFunction, + PhysicalFunction distFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TemporalEDWithinTPoseGeometryPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TemporalEDWithinTPoseGeometryPhysicalFunction.hpp new file mode 100644 index 0000000000..81444a6e73 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TemporalEDWithinTPoseGeometryPhysicalFunction.hpp @@ -0,0 +1,46 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `edwithin_tgeo_geo`. + * + * Per-event edwithin_tgeo_geo via tpose→tgeompoint composition. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TemporalEDWithinTPoseGeometryPhysicalFunction : public PhysicalFunctionConcept { +public: + TemporalEDWithinTPoseGeometryPhysicalFunction(PhysicalFunction xFunction, + PhysicalFunction yFunction, + PhysicalFunction thetaFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction, + PhysicalFunction distFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TemporalEDWithinTPoseTPosePhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TemporalEDWithinTPoseTPosePhysicalFunction.hpp new file mode 100644 index 0000000000..c21a827e24 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TemporalEDWithinTPoseTPosePhysicalFunction.hpp @@ -0,0 +1,49 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `edwithin_tgeo_tgeo`. + * + * Per-event edwithin_tgeo_tgeo via tpose×tpose→tgeompoint composition. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TemporalEDWithinTPoseTPosePhysicalFunction : public PhysicalFunctionConcept { +public: + TemporalEDWithinTPoseTPosePhysicalFunction(PhysicalFunction xAFunction, + PhysicalFunction yAFunction, + PhysicalFunction thetaAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction xBFunction, + PhysicalFunction yBFunction, + PhysicalFunction thetaBFunction, + PhysicalFunction tsBFunction, + PhysicalFunction distFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TemporalEDisjointTNpointGeometryPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TemporalEDisjointTNpointGeometryPhysicalFunction.hpp new file mode 100644 index 0000000000..1a21bf05f8 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TemporalEDisjointTNpointGeometryPhysicalFunction.hpp @@ -0,0 +1,44 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `edisjoint_tgeo_geo`. + * + * Per-event edisjoint_tgeo_geo via tnpoint→tgeompoint composition. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TemporalEDisjointTNpointGeometryPhysicalFunction : public PhysicalFunctionConcept { +public: + TemporalEDisjointTNpointGeometryPhysicalFunction(PhysicalFunction ridFunction, + PhysicalFunction fractionFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TemporalEDisjointTNpointTNpointPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TemporalEDisjointTNpointTNpointPhysicalFunction.hpp new file mode 100644 index 0000000000..d7070955fa --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TemporalEDisjointTNpointTNpointPhysicalFunction.hpp @@ -0,0 +1,46 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `edisjoint_tgeo_tgeo`. + * + * Per-event edisjoint_tgeo_tgeo via tnpoint×tnpoint→tgeompoint composition. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TemporalEDisjointTNpointTNpointPhysicalFunction : public PhysicalFunctionConcept { +public: + TemporalEDisjointTNpointTNpointPhysicalFunction(PhysicalFunction ridAFunction, + PhysicalFunction fractionAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction ridBFunction, + PhysicalFunction fractionBFunction, + PhysicalFunction tsBFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TemporalEDisjointTPoseGeometryPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TemporalEDisjointTPoseGeometryPhysicalFunction.hpp new file mode 100644 index 0000000000..d237becd3e --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TemporalEDisjointTPoseGeometryPhysicalFunction.hpp @@ -0,0 +1,45 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `edisjoint_tgeo_geo`. + * + * Per-event edisjoint_tgeo_geo via tpose→tgeompoint composition. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TemporalEDisjointTPoseGeometryPhysicalFunction : public PhysicalFunctionConcept { +public: + TemporalEDisjointTPoseGeometryPhysicalFunction(PhysicalFunction xFunction, + PhysicalFunction yFunction, + PhysicalFunction thetaFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TemporalEDisjointTPoseTPosePhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TemporalEDisjointTPoseTPosePhysicalFunction.hpp new file mode 100644 index 0000000000..ce08281e25 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TemporalEDisjointTPoseTPosePhysicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `edisjoint_tgeo_tgeo`. + * + * Per-event edisjoint_tgeo_tgeo via tpose×tpose→tgeompoint composition. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TemporalEDisjointTPoseTPosePhysicalFunction : public PhysicalFunctionConcept { +public: + TemporalEDisjointTPoseTPosePhysicalFunction(PhysicalFunction xAFunction, + PhysicalFunction yAFunction, + PhysicalFunction thetaAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction xBFunction, + PhysicalFunction yBFunction, + PhysicalFunction thetaBFunction, + PhysicalFunction tsBFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TemporalEIntersectsTNpointGeometryPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TemporalEIntersectsTNpointGeometryPhysicalFunction.hpp new file mode 100644 index 0000000000..ec6ebf93c8 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TemporalEIntersectsTNpointGeometryPhysicalFunction.hpp @@ -0,0 +1,44 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `eintersects_tgeo_geo`. + * + * Per-event eintersects_tgeo_geo via tnpoint→tgeompoint composition. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TemporalEIntersectsTNpointGeometryPhysicalFunction : public PhysicalFunctionConcept { +public: + TemporalEIntersectsTNpointGeometryPhysicalFunction(PhysicalFunction ridFunction, + PhysicalFunction fractionFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TemporalEIntersectsTNpointTNpointPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TemporalEIntersectsTNpointTNpointPhysicalFunction.hpp new file mode 100644 index 0000000000..afca7c962e --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TemporalEIntersectsTNpointTNpointPhysicalFunction.hpp @@ -0,0 +1,46 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `eintersects_tgeo_tgeo`. + * + * Per-event eintersects_tgeo_tgeo via tnpoint×tnpoint→tgeompoint composition. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TemporalEIntersectsTNpointTNpointPhysicalFunction : public PhysicalFunctionConcept { +public: + TemporalEIntersectsTNpointTNpointPhysicalFunction(PhysicalFunction ridAFunction, + PhysicalFunction fractionAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction ridBFunction, + PhysicalFunction fractionBFunction, + PhysicalFunction tsBFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TemporalEIntersectsTPoseGeometryPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TemporalEIntersectsTPoseGeometryPhysicalFunction.hpp new file mode 100644 index 0000000000..06ddd69125 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TemporalEIntersectsTPoseGeometryPhysicalFunction.hpp @@ -0,0 +1,45 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `eintersects_tgeo_geo`. + * + * Per-event eintersects_tgeo_geo via tpose→tgeompoint composition. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TemporalEIntersectsTPoseGeometryPhysicalFunction : public PhysicalFunctionConcept { +public: + TemporalEIntersectsTPoseGeometryPhysicalFunction(PhysicalFunction xFunction, + PhysicalFunction yFunction, + PhysicalFunction thetaFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TemporalEIntersectsTPoseTPosePhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TemporalEIntersectsTPoseTPosePhysicalFunction.hpp new file mode 100644 index 0000000000..ac09b4a5db --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TemporalEIntersectsTPoseTPosePhysicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `eintersects_tgeo_tgeo`. + * + * Per-event eintersects_tgeo_tgeo via tpose×tpose→tgeompoint composition. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TemporalEIntersectsTPoseTPosePhysicalFunction : public PhysicalFunctionConcept { +public: + TemporalEIntersectsTPoseTPosePhysicalFunction(PhysicalFunction xAFunction, + PhysicalFunction yAFunction, + PhysicalFunction thetaAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction xBFunction, + PhysicalFunction yBFunction, + PhysicalFunction thetaBFunction, + PhysicalFunction tsBFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TemporalETouchesTNpointGeometryPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TemporalETouchesTNpointGeometryPhysicalFunction.hpp new file mode 100644 index 0000000000..d6b2e25621 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TemporalETouchesTNpointGeometryPhysicalFunction.hpp @@ -0,0 +1,44 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `etouches_tgeo_geo`. + * + * Per-event etouches_tgeo_geo via tnpoint→tgeompoint composition. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TemporalETouchesTNpointGeometryPhysicalFunction : public PhysicalFunctionConcept { +public: + TemporalETouchesTNpointGeometryPhysicalFunction(PhysicalFunction ridFunction, + PhysicalFunction fractionFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TemporalETouchesTNpointTNpointPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TemporalETouchesTNpointTNpointPhysicalFunction.hpp new file mode 100644 index 0000000000..4a316f5e0e --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TemporalETouchesTNpointTNpointPhysicalFunction.hpp @@ -0,0 +1,46 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `etouches_tgeo_tgeo`. + * + * Per-event etouches_tgeo_tgeo via tnpoint×tnpoint→tgeompoint composition. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TemporalETouchesTNpointTNpointPhysicalFunction : public PhysicalFunctionConcept { +public: + TemporalETouchesTNpointTNpointPhysicalFunction(PhysicalFunction ridAFunction, + PhysicalFunction fractionAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction ridBFunction, + PhysicalFunction fractionBFunction, + PhysicalFunction tsBFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TemporalETouchesTPoseGeometryPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TemporalETouchesTPoseGeometryPhysicalFunction.hpp new file mode 100644 index 0000000000..91ad757b95 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TemporalETouchesTPoseGeometryPhysicalFunction.hpp @@ -0,0 +1,45 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `etouches_tgeo_geo`. + * + * Per-event etouches_tgeo_geo via tpose→tgeompoint composition. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TemporalETouchesTPoseGeometryPhysicalFunction : public PhysicalFunctionConcept { +public: + TemporalETouchesTPoseGeometryPhysicalFunction(PhysicalFunction xFunction, + PhysicalFunction yFunction, + PhysicalFunction thetaFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TemporalETouchesTPoseTPosePhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TemporalETouchesTPoseTPosePhysicalFunction.hpp new file mode 100644 index 0000000000..2d44649a19 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TemporalETouchesTPoseTPosePhysicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `etouches_tgeo_tgeo`. + * + * Per-event etouches_tgeo_tgeo via tpose×tpose→tgeompoint composition. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TemporalETouchesTPoseTPosePhysicalFunction : public PhysicalFunctionConcept { +public: + TemporalETouchesTPoseTPosePhysicalFunction(PhysicalFunction xAFunction, + PhysicalFunction yAFunction, + PhysicalFunction thetaAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction xBFunction, + PhysicalFunction yBFunction, + PhysicalFunction thetaBFunction, + PhysicalFunction tsBFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TemporalNADTNpointGeometryPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TemporalNADTNpointGeometryPhysicalFunction.hpp new file mode 100644 index 0000000000..3a5d20562b --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TemporalNADTNpointGeometryPhysicalFunction.hpp @@ -0,0 +1,44 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `nad_tgeo_geo`. + * + * Per-event nad_tgeo_geo (nearest approach distance) via tnpoint→tgeompoint composition. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TemporalNADTNpointGeometryPhysicalFunction : public PhysicalFunctionConcept { +public: + TemporalNADTNpointGeometryPhysicalFunction(PhysicalFunction ridFunction, + PhysicalFunction fractionFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TemporalNADTNpointTNpointPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TemporalNADTNpointTNpointPhysicalFunction.hpp new file mode 100644 index 0000000000..ff302241e2 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TemporalNADTNpointTNpointPhysicalFunction.hpp @@ -0,0 +1,46 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `nad_tgeo_tgeo`. + * + * Per-event nad_tgeo_tgeo (nearest approach distance) via tnpoint×tnpoint→tgeompoint composition. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TemporalNADTNpointTNpointPhysicalFunction : public PhysicalFunctionConcept { +public: + TemporalNADTNpointTNpointPhysicalFunction(PhysicalFunction ridAFunction, + PhysicalFunction fractionAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction ridBFunction, + PhysicalFunction fractionBFunction, + PhysicalFunction tsBFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TemporalNADTPoseGeometryPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TemporalNADTPoseGeometryPhysicalFunction.hpp new file mode 100644 index 0000000000..557e9176b8 --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TemporalNADTPoseGeometryPhysicalFunction.hpp @@ -0,0 +1,45 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `nad_tgeo_geo`. + * + * Per-event nad_tgeo_geo (nearest approach distance) via tpose→tgeompoint composition. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TemporalNADTPoseGeometryPhysicalFunction : public PhysicalFunctionConcept { +public: + TemporalNADTPoseGeometryPhysicalFunction(PhysicalFunction xFunction, + PhysicalFunction yFunction, + PhysicalFunction thetaFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TemporalNADTPoseTPosePhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TemporalNADTPoseTPosePhysicalFunction.hpp new file mode 100644 index 0000000000..723fa7db9d --- /dev/null +++ b/nes-physical-operators/include/Functions/Meos/TemporalNADTPoseTPosePhysicalFunction.hpp @@ -0,0 +1,48 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES { + +/** + * @brief Physical operator for `nad_tgeo_tgeo`. + * + * Per-event nad_tgeo_tgeo (nearest approach distance) via tpose×tpose→tgeompoint composition. + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class TemporalNADTPoseTPosePhysicalFunction : public PhysicalFunctionConcept { +public: + TemporalNADTPoseTPosePhysicalFunction(PhysicalFunction xAFunction, + PhysicalFunction yAFunction, + PhysicalFunction thetaAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction xBFunction, + PhysicalFunction yBFunction, + PhysicalFunction thetaBFunction, + PhysicalFunction tsBFunction); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}; + +} // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TemporalRoundPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TemporalRoundPhysicalFunction.hpp index 4b169faee3..188e135545 100644 --- a/nes-physical-operators/include/Functions/Meos/TemporalRoundPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/TemporalRoundPhysicalFunction.hpp @@ -24,15 +24,15 @@ namespace NES { /** * @brief Physical operator for `temporal_round`. * - * Per-event temporal_round: rounds a single-instant tfloat to N decimal places. + * Per-event temporal_round: round single-instant tfloat to given decimal places. * * Generated by tools/codegen/codegen_nebula.py. */ class TemporalRoundPhysicalFunction : public PhysicalFunctionConcept { public: TemporalRoundPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction tsFunction, - PhysicalFunction maxddFunction); + PhysicalFunction tsFunction, + PhysicalFunction arg0Function); VarVal execute(const Record& record, ArenaRef& arena) const override; diff --git a/nes-physical-operators/include/Functions/Meos/TeqBoolTboolPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TeqBoolTboolPhysicalFunction.hpp index ef746e752b..7e9cabbf60 100644 --- a/nes-physical-operators/include/Functions/Meos/TeqBoolTboolPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/TeqBoolTboolPhysicalFunction.hpp @@ -24,15 +24,15 @@ namespace NES { /** * @brief Physical operator for `teq_bool_tbool`. * - * temporal EQ: scalar bool vs single-instant tbool + * Per-event teq_bool_tbool: temporal equality of scalar bool and tbool. * * Generated by tools/codegen/codegen_nebula.py. */ class TeqBoolTboolPhysicalFunction : public PhysicalFunctionConcept { public: - TeqBoolTboolPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction thresholdFunction, - PhysicalFunction tsFunction); + TeqBoolTboolPhysicalFunction(PhysicalFunction arg0Function, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; diff --git a/nes-physical-operators/include/Functions/Meos/TeqTboolBoolPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TeqTboolBoolPhysicalFunction.hpp index 80a2c14469..4351233ca0 100644 --- a/nes-physical-operators/include/Functions/Meos/TeqTboolBoolPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/TeqTboolBoolPhysicalFunction.hpp @@ -24,15 +24,15 @@ namespace NES { /** * @brief Physical operator for `teq_tbool_bool`. * - * temporal EQ: single-instant tbool vs scalar bool + * Per-event teq_tbool_bool: temporal equality of tbool and scalar bool. * * Generated by tools/codegen/codegen_nebula.py. */ class TeqTboolBoolPhysicalFunction : public PhysicalFunctionConcept { public: TeqTboolBoolPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction thresholdFunction, - PhysicalFunction tsFunction); + PhysicalFunction tsFunction, + PhysicalFunction arg0Function); VarVal execute(const Record& record, ArenaRef& arena) const override; diff --git a/nes-physical-operators/include/Functions/Meos/TextInitcapPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TextInitcapPhysicalFunction.hpp index 588c90bc6d..2209fc7f2e 100644 --- a/nes-physical-operators/include/Functions/Meos/TextInitcapPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/TextInitcapPhysicalFunction.hpp @@ -21,12 +21,21 @@ namespace NES { +/** + * @brief Physical operator for `text_initcap`. + * + * Text initcapcase + * + * Generated by tools/codegen/codegen_nebula.py. + */ class TextInitcapPhysicalFunction : public PhysicalFunctionConcept { public: - TextInitcapPhysicalFunction(PhysicalFunction str); + TextInitcapPhysicalFunction(PhysicalFunction strFunction); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TextLowerPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TextLowerPhysicalFunction.hpp index 1f93c01a7a..ef3be13d96 100644 --- a/nes-physical-operators/include/Functions/Meos/TextLowerPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/TextLowerPhysicalFunction.hpp @@ -21,12 +21,21 @@ namespace NES { +/** + * @brief Physical operator for `text_lower`. + * + * Text lowercase + * + * Generated by tools/codegen/codegen_nebula.py. + */ class TextLowerPhysicalFunction : public PhysicalFunctionConcept { public: - TextLowerPhysicalFunction(PhysicalFunction str); + TextLowerPhysicalFunction(PhysicalFunction strFunction); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TextUpperPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TextUpperPhysicalFunction.hpp index 276e77130a..30df49cef3 100644 --- a/nes-physical-operators/include/Functions/Meos/TextUpperPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/TextUpperPhysicalFunction.hpp @@ -21,12 +21,21 @@ namespace NES { +/** + * @brief Physical operator for `text_upper`. + * + * Text uppercase + * + * Generated by tools/codegen/codegen_nebula.py. + */ class TextUpperPhysicalFunction : public PhysicalFunctionConcept { public: - TextUpperPhysicalFunction(PhysicalFunction str); + TextUpperPhysicalFunction(PhysicalFunction strFunction); + VarVal execute(const Record& record, ArenaRef& arena) const override; + private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TextcatTextTtextPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TextcatTextTtextPhysicalFunction.hpp index ea60fa0eb5..e0bd1eea7a 100644 --- a/nes-physical-operators/include/Functions/Meos/TextcatTextTtextPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/TextcatTextTtextPhysicalFunction.hpp @@ -21,14 +21,23 @@ namespace NES { +/** + * @brief Physical operator for `textcat_text_ttext(txt0, temp)`. + * + * Concatenate text and ttext + * + * Generated by tools/codegen/codegen_nebula.py. + */ class TextcatTextTtextPhysicalFunction : public PhysicalFunctionConcept { public: - TextcatTextTtextPhysicalFunction(PhysicalFunction valueFunction, PhysicalFunction tsFunction, PhysicalFunction refFunction); + TextcatTextTtextPhysicalFunction(PhysicalFunction arg0Function, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TextcatTtextTextPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TextcatTtextTextPhysicalFunction.hpp index 48fc8bad05..9548764528 100644 --- a/nes-physical-operators/include/Functions/Meos/TextcatTtextTextPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/TextcatTtextTextPhysicalFunction.hpp @@ -21,14 +21,23 @@ namespace NES { +/** + * @brief Physical operator for `textcat_ttext_text(temp, txt0)`. + * + * Concatenate ttext and text + * + * Generated by tools/codegen/codegen_nebula.py. + */ class TextcatTtextTextPhysicalFunction : public PhysicalFunctionConcept { public: - TextcatTtextTextPhysicalFunction(PhysicalFunction valueFunction, PhysicalFunction tsFunction, PhysicalFunction refFunction); + TextcatTtextTextPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction, + PhysicalFunction arg0Function); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TextcatTtextTtextPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TextcatTtextTtextPhysicalFunction.hpp index f5ebc98ff6..f7d8df3ae0 100644 --- a/nes-physical-operators/include/Functions/Meos/TextcatTtextTtextPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/TextcatTtextTtextPhysicalFunction.hpp @@ -21,14 +21,24 @@ namespace NES { +/** + * @brief Physical operator for `textcat_ttext_ttext(temp, inst0)`. + * + * Concatenate ttext and ttext + * + * Generated by tools/codegen/codegen_nebula.py. + */ class TextcatTtextTtextPhysicalFunction : public PhysicalFunctionConcept { public: - TextcatTtextTtextPhysicalFunction(PhysicalFunction value1Function, PhysicalFunction ts1Function, PhysicalFunction value2Function, PhysicalFunction ts2Function); + TextcatTtextTtextPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction, + PhysicalFunction tval0Function, + PhysicalFunction ts0Function); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TfloatScaleValuePhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TfloatScaleValuePhysicalFunction.hpp index 776ae3e08b..1dd2c94c52 100644 --- a/nes-physical-operators/include/Functions/Meos/TfloatScaleValuePhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/TfloatScaleValuePhysicalFunction.hpp @@ -24,16 +24,15 @@ namespace NES { /** * @brief Physical operator for `tfloat_scale_value`. * - * Per-event tfloat_scale_value: scales a single-instant tfloat by a width, value extracted -> double. - * Takes (value:FLOAT64, ts:UINT64, width:FLOAT64). + * Per-event tfloat_scale_value: scale single-instant tfloat value by scalar. * * Generated by tools/codegen/codegen_nebula.py. */ class TfloatScaleValuePhysicalFunction : public PhysicalFunctionConcept { public: TfloatScaleValuePhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction tsFunction, - PhysicalFunction widthFunction); + PhysicalFunction tsFunction, + PhysicalFunction arg0Function); VarVal execute(const Record& record, ArenaRef& arena) const override; diff --git a/nes-physical-operators/include/Functions/Meos/TfloatShiftScaleValuePhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TfloatShiftScaleValuePhysicalFunction.hpp index efdb1e1c98..b0ef81fddc 100644 --- a/nes-physical-operators/include/Functions/Meos/TfloatShiftScaleValuePhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/TfloatShiftScaleValuePhysicalFunction.hpp @@ -24,16 +24,16 @@ namespace NES { /** * @brief Physical operator for `tfloat_shift_scale_value`. * - * Per-event tfloat_shift_scale_value: shifts and scales a single-instant tfloat. + * Per-event tfloat_shift_scale_value: shift then scale single-instant tfloat value. * * Generated by tools/codegen/codegen_nebula.py. */ class TfloatShiftScaleValuePhysicalFunction : public PhysicalFunctionConcept { public: TfloatShiftScaleValuePhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction tsFunction, - PhysicalFunction shiftFunction, - PhysicalFunction widthFunction); + PhysicalFunction tsFunction, + PhysicalFunction arg0Function, + PhysicalFunction arg1Function); VarVal execute(const Record& record, ArenaRef& arena) const override; diff --git a/nes-physical-operators/include/Functions/Meos/TfloatShiftValuePhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TfloatShiftValuePhysicalFunction.hpp index f8cc2632b2..dc73cf4a47 100644 --- a/nes-physical-operators/include/Functions/Meos/TfloatShiftValuePhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/TfloatShiftValuePhysicalFunction.hpp @@ -24,16 +24,15 @@ namespace NES { /** * @brief Physical operator for `tfloat_shift_value`. * - * Per-event tfloat_shift_value: shifts a single-instant tfloat by a scalar, value extracted -> double. - * Takes (value:FLOAT64, ts:UINT64, shift:FLOAT64). + * Per-event tfloat_shift_value: shift single-instant tfloat value by scalar. * * Generated by tools/codegen/codegen_nebula.py. */ class TfloatShiftValuePhysicalFunction : public PhysicalFunctionConcept { public: TfloatShiftValuePhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction tsFunction, - PhysicalFunction shiftFunction); + PhysicalFunction tsFunction, + PhysicalFunction arg0Function); VarVal execute(const Record& record, ArenaRef& arena) const override; diff --git a/nes-physical-operators/include/Functions/Meos/TfloatToTbigintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TfloatToTbigintPhysicalFunction.hpp index 0a6d8397fb..5eefbf9c4d 100644 --- a/nes-physical-operators/include/Functions/Meos/TfloatToTbigintPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/TfloatToTbigintPhysicalFunction.hpp @@ -24,14 +24,14 @@ namespace NES { /** * @brief Physical operator for `tfloat_to_tbigint`. * - * Per-event tfloat_to_tbigint: single-instant tfloat converted to tbigint, result extracted -> double. + * Per-event tfloat_to_tbigint: convert single-instant tfloat to tbigint. * * Generated by tools/codegen/codegen_nebula.py. */ class TfloatToTbigintPhysicalFunction : public PhysicalFunctionConcept { public: TfloatToTbigintPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction tsFunction); + PhysicalFunction tsFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; diff --git a/nes-physical-operators/include/Functions/Meos/TfloatToTintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TfloatToTintPhysicalFunction.hpp index 48c2bd2f92..eeab6a4123 100644 --- a/nes-physical-operators/include/Functions/Meos/TfloatToTintPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/TfloatToTintPhysicalFunction.hpp @@ -24,14 +24,14 @@ namespace NES { /** * @brief Physical operator for `tfloat_to_tint`. * - * Per-event tfloat_to_tint: single-instant tfloat converted to tint, result extracted -> double. + * Per-event tfloat_to_tint: single-instant tfloat transform, value extracted -> int. * * Generated by tools/codegen/codegen_nebula.py. */ class TfloatToTintPhysicalFunction : public PhysicalFunctionConcept { public: TfloatToTintPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction tsFunction); + PhysicalFunction tsFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; diff --git a/nes-physical-operators/include/Functions/Meos/Th3indexAreNeighborCellsPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/Th3indexAreNeighborCellsPhysicalFunction.hpp index ef1ef99ec4..1608768e0a 100644 --- a/nes-physical-operators/include/Functions/Meos/Th3indexAreNeighborCellsPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/Th3indexAreNeighborCellsPhysicalFunction.hpp @@ -21,15 +21,24 @@ namespace NES { +/** + * @brief Physical operator for `th3index_are_neighbor_cells(temp, inst0)`. + * + * Th3index are neighbor cells + * + * Generated by tools/codegen/codegen_nebula.py. + */ class Th3indexAreNeighborCellsPhysicalFunction : public PhysicalFunctionConcept { public: - Th3indexAreNeighborCellsPhysicalFunction(PhysicalFunction cell1, PhysicalFunction ts1, - PhysicalFunction cell2, PhysicalFunction ts2); + Th3indexAreNeighborCellsPhysicalFunction(PhysicalFunction cellFunction, + PhysicalFunction tsFunction, + PhysicalFunction cell0Function, + PhysicalFunction ts0Function); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/Th3indexCellToCenterChildNextPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/Th3indexCellToCenterChildNextPhysicalFunction.hpp index bdaa24c2b9..b5e2b007b6 100644 --- a/nes-physical-operators/include/Functions/Meos/Th3indexCellToCenterChildNextPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/Th3indexCellToCenterChildNextPhysicalFunction.hpp @@ -21,14 +21,23 @@ namespace NES { +/** + * @brief Physical operator for `th3index_cell_to_center_child_next(temp, (int32_t)arg0)`. + * + * Th3index th3index cell to center child next + * + * Generated by tools/codegen/codegen_nebula.py. + */ class Th3indexCellToCenterChildNextPhysicalFunction : public PhysicalFunctionConcept { public: - Th3indexCellToCenterChildNextPhysicalFunction(PhysicalFunction cell, PhysicalFunction ts); + Th3indexCellToCenterChildNextPhysicalFunction(PhysicalFunction cellFunction, + PhysicalFunction tsFunction, + PhysicalFunction arg0Function); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/Th3indexCellToCenterChildPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/Th3indexCellToCenterChildPhysicalFunction.hpp index 6dd997905c..97e59a7895 100644 --- a/nes-physical-operators/include/Functions/Meos/Th3indexCellToCenterChildPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/Th3indexCellToCenterChildPhysicalFunction.hpp @@ -21,14 +21,23 @@ namespace NES { +/** + * @brief Physical operator for `th3index_cell_to_center_child(temp, (int32_t)arg0)`. + * + * Th3index th3index cell to center child + * + * Generated by tools/codegen/codegen_nebula.py. + */ class Th3indexCellToCenterChildPhysicalFunction : public PhysicalFunctionConcept { public: - Th3indexCellToCenterChildPhysicalFunction(PhysicalFunction cell, PhysicalFunction ts, PhysicalFunction resolution); + Th3indexCellToCenterChildPhysicalFunction(PhysicalFunction cellFunction, + PhysicalFunction tsFunction, + PhysicalFunction arg0Function); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/Th3indexCellToChildPosPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/Th3indexCellToChildPosPhysicalFunction.hpp index ef0d4277c6..4ddafec5ff 100644 --- a/nes-physical-operators/include/Functions/Meos/Th3indexCellToChildPosPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/Th3indexCellToChildPosPhysicalFunction.hpp @@ -21,14 +21,23 @@ namespace NES { +/** + * @brief Physical operator for `th3index_cell_to_child_pos(temp, (int32_t)arg0)`. + * + * Th3index cell to child position + * + * Generated by tools/codegen/codegen_nebula.py. + */ class Th3indexCellToChildPosPhysicalFunction : public PhysicalFunctionConcept { public: - Th3indexCellToChildPosPhysicalFunction(PhysicalFunction cell, PhysicalFunction ts, PhysicalFunction parent_res); + Th3indexCellToChildPosPhysicalFunction(PhysicalFunction cellFunction, + PhysicalFunction tsFunction, + PhysicalFunction arg0Function); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/Th3indexCellToParentNextPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/Th3indexCellToParentNextPhysicalFunction.hpp index 89f54a3bd9..9e82809c0d 100644 --- a/nes-physical-operators/include/Functions/Meos/Th3indexCellToParentNextPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/Th3indexCellToParentNextPhysicalFunction.hpp @@ -21,14 +21,23 @@ namespace NES { +/** + * @brief Physical operator for `th3index_cell_to_parent_next(temp, (int32_t)arg0)`. + * + * Th3index th3index cell to parent next + * + * Generated by tools/codegen/codegen_nebula.py. + */ class Th3indexCellToParentNextPhysicalFunction : public PhysicalFunctionConcept { public: - Th3indexCellToParentNextPhysicalFunction(PhysicalFunction cell, PhysicalFunction ts); + Th3indexCellToParentNextPhysicalFunction(PhysicalFunction cellFunction, + PhysicalFunction tsFunction, + PhysicalFunction arg0Function); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/Th3indexCellToParentPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/Th3indexCellToParentPhysicalFunction.hpp index 91630d0c57..96975fe098 100644 --- a/nes-physical-operators/include/Functions/Meos/Th3indexCellToParentPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/Th3indexCellToParentPhysicalFunction.hpp @@ -21,14 +21,23 @@ namespace NES { +/** + * @brief Physical operator for `th3index_cell_to_parent(temp, (int32_t)arg0)`. + * + * Th3index th3index cell to parent + * + * Generated by tools/codegen/codegen_nebula.py. + */ class Th3indexCellToParentPhysicalFunction : public PhysicalFunctionConcept { public: - Th3indexCellToParentPhysicalFunction(PhysicalFunction cell, PhysicalFunction ts, PhysicalFunction resolution); + Th3indexCellToParentPhysicalFunction(PhysicalFunction cellFunction, + PhysicalFunction tsFunction, + PhysicalFunction arg0Function); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/Th3indexGetBaseCellNumberPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/Th3indexGetBaseCellNumberPhysicalFunction.hpp index 644d2b5e78..eae61af055 100644 --- a/nes-physical-operators/include/Functions/Meos/Th3indexGetBaseCellNumberPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/Th3indexGetBaseCellNumberPhysicalFunction.hpp @@ -21,14 +21,22 @@ namespace NES { +/** + * @brief Physical operator for `th3index_get_base_cell_number(temp)`. + * + * Th3index th3index get base cell number + * + * Generated by tools/codegen/codegen_nebula.py. + */ class Th3indexGetBaseCellNumberPhysicalFunction : public PhysicalFunctionConcept { public: - Th3indexGetBaseCellNumberPhysicalFunction(PhysicalFunction cell, PhysicalFunction ts); + Th3indexGetBaseCellNumberPhysicalFunction(PhysicalFunction cellFunction, + PhysicalFunction tsFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/Th3indexGetResolutionPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/Th3indexGetResolutionPhysicalFunction.hpp index 9595512c09..a12af49522 100644 --- a/nes-physical-operators/include/Functions/Meos/Th3indexGetResolutionPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/Th3indexGetResolutionPhysicalFunction.hpp @@ -21,14 +21,22 @@ namespace NES { +/** + * @brief Physical operator for `th3index_get_resolution(temp)`. + * + * Th3index th3index get resolution + * + * Generated by tools/codegen/codegen_nebula.py. + */ class Th3indexGetResolutionPhysicalFunction : public PhysicalFunctionConcept { public: - Th3indexGetResolutionPhysicalFunction(PhysicalFunction cell, PhysicalFunction ts); + Th3indexGetResolutionPhysicalFunction(PhysicalFunction cellFunction, + PhysicalFunction tsFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/Th3indexGridDistancePhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/Th3indexGridDistancePhysicalFunction.hpp index a6064c1cdd..b4879ae8fc 100644 --- a/nes-physical-operators/include/Functions/Meos/Th3indexGridDistancePhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/Th3indexGridDistancePhysicalFunction.hpp @@ -21,15 +21,24 @@ namespace NES { +/** + * @brief Physical operator for `th3index_grid_distance(temp, inst0)`. + * + * Th3index grid distance + * + * Generated by tools/codegen/codegen_nebula.py. + */ class Th3indexGridDistancePhysicalFunction : public PhysicalFunctionConcept { public: - Th3indexGridDistancePhysicalFunction(PhysicalFunction cell1, PhysicalFunction ts1, - PhysicalFunction cell2, PhysicalFunction ts2); + Th3indexGridDistancePhysicalFunction(PhysicalFunction cellFunction, + PhysicalFunction tsFunction, + PhysicalFunction cell0Function, + PhysicalFunction ts0Function); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/Th3indexIsPentagonPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/Th3indexIsPentagonPhysicalFunction.hpp index b174fd09fa..1cb9ab0dad 100644 --- a/nes-physical-operators/include/Functions/Meos/Th3indexIsPentagonPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/Th3indexIsPentagonPhysicalFunction.hpp @@ -21,14 +21,22 @@ namespace NES { +/** + * @brief Physical operator for `th3index_is_pentagon(temp)`. + * + * Th3index th3index is pentagon + * + * Generated by tools/codegen/codegen_nebula.py. + */ class Th3indexIsPentagonPhysicalFunction : public PhysicalFunctionConcept { public: - Th3indexIsPentagonPhysicalFunction(PhysicalFunction cell, PhysicalFunction ts); + Th3indexIsPentagonPhysicalFunction(PhysicalFunction cellFunction, + PhysicalFunction tsFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/Th3indexIsValidCellPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/Th3indexIsValidCellPhysicalFunction.hpp index 68f711e6b6..35f5c86113 100644 --- a/nes-physical-operators/include/Functions/Meos/Th3indexIsValidCellPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/Th3indexIsValidCellPhysicalFunction.hpp @@ -21,14 +21,22 @@ namespace NES { +/** + * @brief Physical operator for `th3index_is_valid_cell(temp)`. + * + * Th3index th3index is valid cell + * + * Generated by tools/codegen/codegen_nebula.py. + */ class Th3indexIsValidCellPhysicalFunction : public PhysicalFunctionConcept { public: - Th3indexIsValidCellPhysicalFunction(PhysicalFunction cell, PhysicalFunction ts); + Th3indexIsValidCellPhysicalFunction(PhysicalFunction cellFunction, + PhysicalFunction tsFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TintScaleValuePhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TintScaleValuePhysicalFunction.hpp index e55e1d9ad3..baba737172 100644 --- a/nes-physical-operators/include/Functions/Meos/TintScaleValuePhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/TintScaleValuePhysicalFunction.hpp @@ -24,16 +24,15 @@ namespace NES { /** * @brief Physical operator for `tint_scale_value`. * - * Per-event tint_scale_value: scales the value span of a single-instant tint - * to the given integer width. + * Per-event tint_scale_value: scale single-instant tint value by scalar. * * Generated by tools/codegen/codegen_nebula.py. */ class TintScaleValuePhysicalFunction : public PhysicalFunctionConcept { public: TintScaleValuePhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction tsFunction, - PhysicalFunction widthFunction); + PhysicalFunction tsFunction, + PhysicalFunction arg0Function); VarVal execute(const Record& record, ArenaRef& arena) const override; diff --git a/nes-physical-operators/include/Functions/Meos/TintShiftScaleValuePhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TintShiftScaleValuePhysicalFunction.hpp index d6c7628c8c..be9ff076b4 100644 --- a/nes-physical-operators/include/Functions/Meos/TintShiftScaleValuePhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/TintShiftScaleValuePhysicalFunction.hpp @@ -24,17 +24,16 @@ namespace NES { /** * @brief Physical operator for `tint_shift_scale_value`. * - * Per-event tint_shift_scale_value: shifts the value span of a single-instant - * tint by a constant integer and scales it to the given integer width. + * Per-event tint_shift_scale_value: shift then scale single-instant tint value. * * Generated by tools/codegen/codegen_nebula.py. */ class TintShiftScaleValuePhysicalFunction : public PhysicalFunctionConcept { public: TintShiftScaleValuePhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction tsFunction, - PhysicalFunction shiftFunction, - PhysicalFunction widthFunction); + PhysicalFunction tsFunction, + PhysicalFunction arg0Function, + PhysicalFunction arg1Function); VarVal execute(const Record& record, ArenaRef& arena) const override; diff --git a/nes-physical-operators/include/Functions/Meos/TintShiftValuePhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TintShiftValuePhysicalFunction.hpp index f12e6e7240..e1b40c61ba 100644 --- a/nes-physical-operators/include/Functions/Meos/TintShiftValuePhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/TintShiftValuePhysicalFunction.hpp @@ -24,16 +24,15 @@ namespace NES { /** * @brief Physical operator for `tint_shift_value`. * - * Per-event tint_shift_value: shifts the value span of a single-instant tint - * by a constant integer. + * Per-event tint_shift_value: shift single-instant tint value by scalar. * * Generated by tools/codegen/codegen_nebula.py. */ class TintShiftValuePhysicalFunction : public PhysicalFunctionConcept { public: TintShiftValuePhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction tsFunction, - PhysicalFunction shiftFunction); + PhysicalFunction tsFunction, + PhysicalFunction arg0Function); VarVal execute(const Record& record, ArenaRef& arena) const override; diff --git a/nes-physical-operators/include/Functions/Meos/TintToTbigintPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TintToTbigintPhysicalFunction.hpp index 0d761ed1a8..027dea7c91 100644 --- a/nes-physical-operators/include/Functions/Meos/TintToTbigintPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/TintToTbigintPhysicalFunction.hpp @@ -24,14 +24,14 @@ namespace NES { /** * @brief Physical operator for `tint_to_tbigint`. * - * Per-event tint_to_tbigint: single-instant tint converted to tbigint, result extracted -> double. + * Per-event tint_to_tbigint: convert single-instant tint to tbigint. * * Generated by tools/codegen/codegen_nebula.py. */ class TintToTbigintPhysicalFunction : public PhysicalFunctionConcept { public: TintToTbigintPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction tsFunction); + PhysicalFunction tsFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; diff --git a/nes-physical-operators/include/Functions/Meos/TintToTfloatPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TintToTfloatPhysicalFunction.hpp index c338179d9b..4a3ebf9536 100644 --- a/nes-physical-operators/include/Functions/Meos/TintToTfloatPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/TintToTfloatPhysicalFunction.hpp @@ -24,14 +24,14 @@ namespace NES { /** * @brief Physical operator for `tint_to_tfloat`. * - * Per-event tint_to_tfloat: single-instant tint promoted to tfloat, result extracted -> double. + * Per-event tint_to_tfloat: single-instant tfloat transform, value extracted -> double. * * Generated by tools/codegen/codegen_nebula.py. */ class TintToTfloatPhysicalFunction : public PhysicalFunctionConcept { public: TintToTfloatPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction tsFunction); + PhysicalFunction tsFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; diff --git a/nes-physical-operators/include/Functions/Meos/TneBoolTboolPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TneBoolTboolPhysicalFunction.hpp index b9d2bfccf8..3026f9f452 100644 --- a/nes-physical-operators/include/Functions/Meos/TneBoolTboolPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/TneBoolTboolPhysicalFunction.hpp @@ -24,15 +24,15 @@ namespace NES { /** * @brief Physical operator for `tne_bool_tbool`. * - * temporal NE: scalar bool vs single-instant tbool + * Per-event tne_bool_tbool: temporal inequality of scalar bool and tbool. * * Generated by tools/codegen/codegen_nebula.py. */ class TneBoolTboolPhysicalFunction : public PhysicalFunctionConcept { public: - TneBoolTboolPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction thresholdFunction, - PhysicalFunction tsFunction); + TneBoolTboolPhysicalFunction(PhysicalFunction arg0Function, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; diff --git a/nes-physical-operators/include/Functions/Meos/TneTboolBoolPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TneTboolBoolPhysicalFunction.hpp index 543dab6dc5..28c5b1fe75 100644 --- a/nes-physical-operators/include/Functions/Meos/TneTboolBoolPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/TneTboolBoolPhysicalFunction.hpp @@ -24,15 +24,15 @@ namespace NES { /** * @brief Physical operator for `tne_tbool_bool`. * - * temporal NE: single-instant tbool vs scalar bool + * Per-event tne_tbool_bool: temporal inequality of tbool and scalar bool. * * Generated by tools/codegen/codegen_nebula.py. */ class TneTboolBoolPhysicalFunction : public PhysicalFunctionConcept { public: TneTboolBoolPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction thresholdFunction, - PhysicalFunction tsFunction); + PhysicalFunction tsFunction, + PhysicalFunction arg0Function); VarVal execute(const Record& record, ArenaRef& arena) const override; diff --git a/nes-physical-operators/include/Functions/Meos/TnotTboolPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TnotTboolPhysicalFunction.hpp index 6ef701368a..96d62532c5 100644 --- a/nes-physical-operators/include/Functions/Meos/TnotTboolPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/TnotTboolPhysicalFunction.hpp @@ -24,7 +24,7 @@ namespace NES { /** * @brief Physical operator for `tnot_tbool`. * - * Per-event tnot_tbool: single-instant tbool negation, result extracted -> double. + * Per-event tnot_tbool: logical NOT of single-instant tbool. * * Generated by tools/codegen/codegen_nebula.py. */ diff --git a/nes-physical-operators/include/Functions/Meos/TorBoolTboolPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TorBoolTboolPhysicalFunction.hpp index 6f01525fca..8de3b29c8c 100644 --- a/nes-physical-operators/include/Functions/Meos/TorBoolTboolPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/TorBoolTboolPhysicalFunction.hpp @@ -24,15 +24,15 @@ namespace NES { /** * @brief Physical operator for `tor_bool_tbool`. * - * Per-event tor_bool_tbool: OR of a scalar bool and a single-instant tbool. + * Per-event tor_bool_tbool: temporal OR of scalar bool and tbool. * * Generated by tools/codegen/codegen_nebula.py. */ class TorBoolTboolPhysicalFunction : public PhysicalFunctionConcept { public: - TorBoolTboolPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction thresholdFunction, - PhysicalFunction tsFunction); + TorBoolTboolPhysicalFunction(PhysicalFunction arg0Function, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; diff --git a/nes-physical-operators/include/Functions/Meos/TorTboolBoolPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TorTboolBoolPhysicalFunction.hpp index cc438a08e5..68e6a564d7 100644 --- a/nes-physical-operators/include/Functions/Meos/TorTboolBoolPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/TorTboolBoolPhysicalFunction.hpp @@ -24,15 +24,15 @@ namespace NES { /** * @brief Physical operator for `tor_tbool_bool`. * - * Per-event tor_tbool_bool: OR of a single-instant tbool and a scalar bool. + * Per-event tor_tbool_bool: temporal OR of tbool and scalar bool. * * Generated by tools/codegen/codegen_nebula.py. */ class TorTboolBoolPhysicalFunction : public PhysicalFunctionConcept { public: TorTboolBoolPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction thresholdFunction, - PhysicalFunction tsFunction); + PhysicalFunction tsFunction, + PhysicalFunction arg0Function); VarVal execute(const Record& record, ArenaRef& arena) const override; diff --git a/nes-physical-operators/include/Functions/Meos/TorTboolTboolPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TorTboolTboolPhysicalFunction.hpp index e7334cdad2..f22c754ced 100644 --- a/nes-physical-operators/include/Functions/Meos/TorTboolTboolPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/TorTboolTboolPhysicalFunction.hpp @@ -24,15 +24,14 @@ namespace NES { /** * @brief Physical operator for `tor_tbool_tbool`. * - * Per-event tor_tbool_tbool: OR of two single-instant tbools. + * Per-event tor_tbool_tbool: temporal OR of two tbool values (WKB result). * * Generated by tools/codegen/codegen_nebula.py. */ class TorTboolTboolPhysicalFunction : public PhysicalFunctionConcept { public: - TorTboolTboolPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction thresholdFunction, - PhysicalFunction tsFunction); + TorTboolTboolPhysicalFunction(PhysicalFunction trajFunction, + PhysicalFunction arg0Function); VarVal execute(const Record& record, ArenaRef& arena) const override; diff --git a/nes-physical-operators/include/Functions/Meos/TtextInitcapPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TtextInitcapPhysicalFunction.hpp index 3d04a89181..bd15bb1aaf 100644 --- a/nes-physical-operators/include/Functions/Meos/TtextInitcapPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/TtextInitcapPhysicalFunction.hpp @@ -21,15 +21,22 @@ namespace NES { +/** + * @brief Physical operator for `ttext_initcap`. + * + * Temporal text initcapcase + * + * Generated by tools/codegen/codegen_nebula.py. + */ class TtextInitcapPhysicalFunction : public PhysicalFunctionConcept { public: TtextInitcapPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction tsFunction); + PhysicalFunction tsFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TtextLowerPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TtextLowerPhysicalFunction.hpp index 8605f87d65..06c740e84b 100644 --- a/nes-physical-operators/include/Functions/Meos/TtextLowerPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/TtextLowerPhysicalFunction.hpp @@ -21,15 +21,22 @@ namespace NES { +/** + * @brief Physical operator for `ttext_lower`. + * + * Temporal text lowercase + * + * Generated by tools/codegen/codegen_nebula.py. + */ class TtextLowerPhysicalFunction : public PhysicalFunctionConcept { public: TtextLowerPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction tsFunction); + PhysicalFunction tsFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/include/Functions/Meos/TtextUpperPhysicalFunction.hpp b/nes-physical-operators/include/Functions/Meos/TtextUpperPhysicalFunction.hpp index aa98369b8d..3063b6d3da 100644 --- a/nes-physical-operators/include/Functions/Meos/TtextUpperPhysicalFunction.hpp +++ b/nes-physical-operators/include/Functions/Meos/TtextUpperPhysicalFunction.hpp @@ -21,15 +21,22 @@ namespace NES { +/** + * @brief Physical operator for `ttext_upper`. + * + * Temporal text uppercase + * + * Generated by tools/codegen/codegen_nebula.py. + */ class TtextUpperPhysicalFunction : public PhysicalFunctionConcept { public: TtextUpperPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction tsFunction); + PhysicalFunction tsFunction); VarVal execute(const Record& record, ArenaRef& arena) const override; private: - std::vector paramFns; + std::vector parameterFunctions; }; } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AcontainsGeoTrgeometryPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AcontainsGeoTrgeometryPhysicalFunction.cpp new file mode 100644 index 0000000000..1594a958f8 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AcontainsGeoTrgeometryPhysicalFunction.cpp @@ -0,0 +1,97 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +#include +} + +namespace NES { + +AcontainsGeoTrgeometryPhysicalFunction::AcontainsGeoTrgeometryPhysicalFunction(PhysicalFunction tgt_wkt, PhysicalFunction ref_wkt, PhysicalFunction x1, PhysicalFunction y1, PhysicalFunction theta1, PhysicalFunction ts1) { + paramFns.reserve(6); + paramFns.push_back(std::move(tgt_wkt)); + paramFns.push_back(std::move(ref_wkt)); + paramFns.push_back(std::move(x1)); + paramFns.push_back(std::move(y1)); + paramFns.push_back(std::move(theta1)); + paramFns.push_back(std::move(ts1)); +} + +VarVal AcontainsGeoTrgeometryPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { + auto tgt_wkt = paramFns[0].execute(record, arena).cast(); + auto ref_wkt = paramFns[1].execute(record, arena).cast(); + auto x1 = paramFns[2].execute(record, arena).cast(); + auto y1 = paramFns[3].execute(record, arena).cast(); + auto theta1 = paramFns[4].execute(record, arena).cast(); + auto ts1 = paramFns[5].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](const char* tgt_wkt, uint32_t tgt_wktsz, const char* ref_wkt, uint32_t ref_wktsz, double x1, double y1, double theta1, uint64_t ts1) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + char* ref1_str = (char*)malloc(ref_wktsz + 1); + memcpy(ref1_str, ref_wkt, ref_wktsz); ref1_str[ref_wktsz] = '\0'; + GSERIALIZED* gref1 = geom_in(ref1_str, -1); free(ref1_str); + if (!gref1) return 0.0; + Pose* pose1 = pose_make_2d(x1, y1, theta1, false, 0); + if (!pose1) { free(gref1); return 0.0; } + TInstant* inst1 = trgeometryinst_make(gref1, pose1, (TimestampTz)ts1); + free(gref1); free(pose1); + if (!inst1) return 0.0; + char* tgt_str = (char*)malloc(tgt_wktsz + 1); + memcpy(tgt_str, tgt_wkt, tgt_wktsz); tgt_str[tgt_wktsz] = '\0'; + GSERIALIZED* gs_tgt = geom_in(tgt_str, -1); free(tgt_str); + if (!gs_tgt) { free(inst1); return 0.0; } + int r = acontains_geo_trgeometry(gs_tgt, (Temporal*)inst1); + free(inst1); free(gs_tgt); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + tgt_wkt, ref_wkt, x1, y1, theta1, ts1); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAcontainsGeoTrgeometryPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size()==6, + "AcontainsGeoTrgeometryPhysicalFunction requires 6 children but got {}", + arguments.childFunctions.size()); + return AcontainsGeoTrgeometryPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4]), + std::move(arguments.childFunctions[5])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AcontainsTcbufferGeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AcontainsTcbufferGeoPhysicalFunction.cpp index 1df12b657a..fda14b99e9 100644 --- a/nes-physical-operators/src/Functions/Meos/AcontainsTcbufferGeoPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/AcontainsTcbufferGeoPhysicalFunction.cpp @@ -13,77 +13,97 @@ */ #include + #include #include #include +#include #include #include #include #include +#include #include +#include #include #include -#include -#include -#include extern "C" { #include -#include #include } namespace NES { -AcontainsTcbufferGeoPhysicalFunction::AcontainsTcbufferGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, - PhysicalFunction radius, PhysicalFunction ts, - PhysicalFunction wkt) +AcontainsTcbufferGeoPhysicalFunction::AcontainsTcbufferGeoPhysicalFunction(PhysicalFunction lonFunction, + PhysicalFunction latFunction, + PhysicalFunction radiusFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction) { - paramFns.reserve(5); - paramFns.push_back(std::move(lon)); - paramFns.push_back(std::move(lat)); - paramFns.push_back(std::move(radius)); - paramFns.push_back(std::move(ts)); - paramFns.push_back(std::move(wkt)); + parameterFunctions.reserve(5); + parameterFunctions.push_back(std::move(lonFunction)); + parameterFunctions.push_back(std::move(latFunction)); + parameterFunctions.push_back(std::move(radiusFunction)); + parameterFunctions.push_back(std::move(timestampFunction)); + parameterFunctions.push_back(std::move(geometryFunction)); } VarVal AcontainsTcbufferGeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto lon = paramFns[0].execute(record, arena).cast(); - auto lat = paramFns[1].execute(record, arena).cast(); - auto radius = paramFns[2].execute(record, arena).cast(); - auto ts = paramFns[3].execute(record, arena).cast(); - auto wkt = paramFns[4].execute(record, arena); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto lon = parameterValues[0].cast>(); + auto lat = parameterValues[1].cast>(); + auto radius = parameterValues[2].cast>(); + auto timestamp = parameterValues[3].cast>(); + auto geometry = parameterValues[4].cast(); const auto result = nautilus::invoke( - +[](double lon, double lat, double radius, uint64_t ts, - const char* wkt, uint32_t wkt_len) -> double { - try { + +[](double lonValue, + double latValue, + double radiusValue, + uint64_t timestampValue, + const char* geometryPtr, + uint32_t geometrySize) -> int { + try + { MEOS::Meos::ensureMeosInitialized(); - // Build tcbuffer instant: point + radius → cbuffer → instant - std::string pt_str = fmt::format("POINT({} {})", lon, lat); - GSERIALIZED* pt_gs = geom_in(pt_str.c_str(), -1); - if (!pt_gs) return 0.0; - Cbuffer* cb = cbuffer_make(pt_gs, radius); - free(pt_gs); - if (!cb) return 0.0; - Temporal* tcb_inst = (Temporal*)tcbufferinst_make(cb, (TimestampTz)ts); - free(cb); - if (!tcb_inst) return 0.0; - // Build target geometry from null-terminated WKT copy - char* wkt_str = (char*)malloc(wkt_len + 1); - memcpy(wkt_str, wkt, wkt_len); - wkt_str[wkt_len] = '\0'; - GSERIALIZED* target_gs = geom_in(wkt_str, -1); - free(wkt_str); - if (!target_gs) { free(tcb_inst); return 0.0; } - int r = acontains_tcbuffer_geo(tcb_inst, target_gs); - free(tcb_inst); - free(target_gs); - return r > 0 ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + if (!(lonValue >= -180.0 && lonValue <= 180.0 && latValue >= -90.0 && latValue <= 90.0)) return 0; + if (radiusValue < 0.0) return 0; + + const std::string timestampString = MEOS::Meos::convertEpochToTimestamp(timestampValue); + std::string tcbufferWkt = fmt::format("Cbuffer(Point({} {}),{})@{}", + lonValue, latValue, radiusValue, timestampString); + std::string staticGeometryWkt(geometryPtr, geometrySize); + + while (!staticGeometryWkt.empty() && (staticGeometryWkt.front() == '\'' || staticGeometryWkt.front() == '"')) + staticGeometryWkt.erase(staticGeometryWkt.begin()); + while (!staticGeometryWkt.empty() && (staticGeometryWkt.back() == '\'' || staticGeometryWkt.back() == '"')) + staticGeometryWkt.pop_back(); + + if (tcbufferWkt.empty() || staticGeometryWkt.empty()) return 0; + + Temporal* tcbuffer = tcbuffer_in(tcbufferWkt.c_str()); + if (!tcbuffer) return 0; + MEOS::Meos::StaticGeometry staticGeometry(staticGeometryWkt); + if (!staticGeometry.getGeometry()) { free(tcbuffer); return 0; } + + int r = acontains_tcbuffer_geo(tcbuffer, staticGeometry.getGeometry()); + free(tcbuffer); + return r; + } + catch (const std::exception&) + { + return 0; + } }, - lon, lat, radius, ts, wkt); + lon, lat, radius, timestamp, geometry.getContent(), geometry.getContentSize()); return VarVal(result); } @@ -94,11 +114,12 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterA PRECONDITION(arguments.childFunctions.size() == 5, "AcontainsTcbufferGeoPhysicalFunction requires 5 children but got {}", arguments.childFunctions.size()); - return AcontainsTcbufferGeoPhysicalFunction(std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2]), - std::move(arguments.childFunctions[3]), - std::move(arguments.childFunctions[4])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + return AcontainsTcbufferGeoPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AcontainsTcbufferTcbufferPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AcontainsTcbufferTcbufferPhysicalFunction.cpp new file mode 100644 index 0000000000..5ce23901e5 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AcontainsTcbufferTcbufferPhysicalFunction.cpp @@ -0,0 +1,127 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +AcontainsTcbufferTcbufferPhysicalFunction::AcontainsTcbufferTcbufferPhysicalFunction(PhysicalFunction lonAFunction, + PhysicalFunction latAFunction, + PhysicalFunction radiusAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction lonBFunction, + PhysicalFunction latBFunction, + PhysicalFunction radiusBFunction, + PhysicalFunction tsBFunction) +{ + parameterFunctions.reserve(8); + parameterFunctions.push_back(std::move(lonAFunction)); + parameterFunctions.push_back(std::move(latAFunction)); + parameterFunctions.push_back(std::move(radiusAFunction)); + parameterFunctions.push_back(std::move(tsAFunction)); + parameterFunctions.push_back(std::move(lonBFunction)); + parameterFunctions.push_back(std::move(latBFunction)); + parameterFunctions.push_back(std::move(radiusBFunction)); + parameterFunctions.push_back(std::move(tsBFunction)); +} + +VarVal AcontainsTcbufferTcbufferPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto lonA = parameterValues[0].cast>(); + auto latA = parameterValues[1].cast>(); + auto radiusA = parameterValues[2].cast>(); + auto tsA = parameterValues[3].cast>(); + auto lonB = parameterValues[4].cast>(); + auto latB = parameterValues[5].cast>(); + auto radiusB = parameterValues[6].cast>(); + auto tsB = parameterValues[7].cast>(); + + const auto result = nautilus::invoke( + +[](double lonAValue, double latAValue, double radiusAValue, uint64_t tsAValue, + double lonBValue, double latBValue, double radiusBValue, uint64_t tsBValue) -> int { + try + { + MEOS::Meos::ensureMeosInitialized(); + if (!(lonAValue >= -180.0 && lonAValue <= 180.0 && latAValue >= -90.0 && latAValue <= 90.0)) return 0; + if (!(lonBValue >= -180.0 && lonBValue <= 180.0 && latBValue >= -90.0 && latBValue <= 90.0)) return 0; + if (radiusAValue < 0.0 || radiusBValue < 0.0) return 0; + + const std::string tsAString = MEOS::Meos::convertEpochToTimestamp(tsAValue); + const std::string tsBString = MEOS::Meos::convertEpochToTimestamp(tsBValue); + std::string wktA = fmt::format("Cbuffer(Point({} {}),{})@{}", lonAValue, latAValue, radiusAValue, tsAString); + std::string wktB = fmt::format("Cbuffer(Point({} {}),{})@{}", lonBValue, latBValue, radiusBValue, tsBString); + + Temporal* tA = tcbuffer_in(wktA.c_str()); + if (!tA) return 0; + Temporal* tB = tcbuffer_in(wktB.c_str()); + if (!tB) { free(tA); return 0; } + + int r = acontains_tcbuffer_tcbuffer(tA, tB); + free(tA); + free(tB); + return r; + } + catch (const std::exception&) + { + return 0; + } + }, + lonA, latA, radiusA, tsA, lonB, latB, radiusB, tsB); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAcontainsTcbufferTcbufferPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 8, + "AcontainsTcbufferTcbufferPhysicalFunction requires 8 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + auto arg5 = std::move(arguments.childFunctions[5]); + auto arg6 = std::move(arguments.childFunctions[6]); + auto arg7 = std::move(arguments.childFunctions[7]); + return AcontainsTcbufferTcbufferPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6), std::move(arg7)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AcontainsTgeoGeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AcontainsTgeoGeoPhysicalFunction.cpp index 6695a335d9..ccb3d542ae 100644 --- a/nes-physical-operators/src/Functions/Meos/AcontainsTgeoGeoPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/AcontainsTgeoGeoPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -34,40 +35,75 @@ extern "C" { namespace NES { -AcontainsTgeoGeoPhysicalFunction::AcontainsTgeoGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, - PhysicalFunction ts, PhysicalFunction wkt) +AcontainsTgeoGeoPhysicalFunction::AcontainsTgeoGeoPhysicalFunction(PhysicalFunction lonFunction, + PhysicalFunction latFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction) { - paramFns.reserve(4); - paramFns.push_back(std::move(lon)); - paramFns.push_back(std::move(lat)); - paramFns.push_back(std::move(ts)); - paramFns.push_back(std::move(wkt)); + parameterFunctions.reserve(4); + parameterFunctions.push_back(std::move(lonFunction)); + parameterFunctions.push_back(std::move(latFunction)); + parameterFunctions.push_back(std::move(timestampFunction)); + parameterFunctions.push_back(std::move(geometryFunction)); } VarVal AcontainsTgeoGeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto lon = paramFns[0].execute(record, arena).cast(); - auto lat = paramFns[1].execute(record, arena).cast(); - auto ts = paramFns[2].execute(record, arena).cast(); - auto wkt = paramFns[3].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto lon = parameterValues[0].cast>(); + auto lat = parameterValues[1].cast>(); + auto timestamp = parameterValues[2].cast>(); + auto geometry = parameterValues[3].cast(); const auto result = nautilus::invoke( - +[](double lon, double lat, uint64_t ts, - const char* w, uint32_t wsz) -> double { - try { + +[](double lonValue, + double latValue, + uint64_t timestampValue, + const char* geometryPtr, + uint32_t geometrySize) -> int { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string wktStr(w, wsz); - std::string tgeoWkt = fmt::format("SRID=4326;POINT({},{})@{}", lon, lat, ts); - Temporal* tgeo = tgeompoint_in(tgeoWkt.c_str()); - if (!tgeo) return 0.0; - GSERIALIZED* gs = geom_in(wktStr.c_str(), -1); - if (!gs) { free(tgeo); return 0.0; } - int r = acontains_tgeo_geo(tgeo, gs); - free(tgeo); free(gs); - return r > 0 ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + if (!(lonValue >= -180.0 && lonValue <= 180.0 && latValue >= -90.0 && latValue <= 90.0)) { + return 0; + } + + const std::string timestampString = MEOS::Meos::convertEpochToTimestamp(timestampValue); + std::string temporalGeometryWkt = fmt::format("SRID=4326;Point({} {})@{}", lonValue, latValue, timestampString); + std::string staticGeometryWkt(geometryPtr, geometrySize); + + while (!staticGeometryWkt.empty() && (staticGeometryWkt.front() == '\'' || staticGeometryWkt.front() == '"')) + staticGeometryWkt.erase(staticGeometryWkt.begin()); + while (!staticGeometryWkt.empty() && (staticGeometryWkt.back() == '\'' || staticGeometryWkt.back() == '"')) + staticGeometryWkt.pop_back(); + + if (temporalGeometryWkt.empty() || staticGeometryWkt.empty()) + return 0; + + MEOS::Meos::TemporalGeometry temporalGeometry(temporalGeometryWkt); + if (!temporalGeometry.getGeometry()) return 0; + MEOS::Meos::StaticGeometry staticGeometry(staticGeometryWkt); + if (!staticGeometry.getGeometry()) return 0; + + // MEOS spatial-relation call — same shape as TemporalEDWithin's + // edwithin_tgeo_geo, but specific MEOS function per generated operator. + // Real MEOS spatial-rel signature: int fn(const Temporal *, const GSERIALIZED *) + // (no `atstart` flag — that's specific to geog_dwithin / edwithin's 3-arg variant). + return acontains_tgeo_geo(temporalGeometry.getGeometry(), + staticGeometry.getGeometry()); + } + catch (const std::exception&) + { + return 0; + } }, - lon, lat, ts, wkt); + lon, lat, timestamp, geometry.getContent(), geometry.getContentSize()); return VarVal(result); } @@ -78,10 +114,11 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterA PRECONDITION(arguments.childFunctions.size() == 4, "AcontainsTgeoGeoPhysicalFunction requires 4 children but got {}", arguments.childFunctions.size()); - return AcontainsTgeoGeoPhysicalFunction(std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2]), - std::move(arguments.childFunctions[3])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + return AcontainsTgeoGeoPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AcontainsTgeoTgeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AcontainsTgeoTgeoPhysicalFunction.cpp index 5bacc09a11..a91e91cdb6 100644 --- a/nes-physical-operators/src/Functions/Meos/AcontainsTgeoTgeoPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/AcontainsTgeoTgeoPhysicalFunction.cpp @@ -13,10 +13,10 @@ */ #include + #include #include #include -#include #include #include #include @@ -34,42 +34,68 @@ extern "C" { namespace NES { -AcontainsTgeoTgeoPhysicalFunction::AcontainsTgeoTgeoPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction ts1, PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction ts2) +AcontainsTgeoTgeoPhysicalFunction::AcontainsTgeoTgeoPhysicalFunction(PhysicalFunction lonAFunction, + PhysicalFunction latAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction lonBFunction, + PhysicalFunction latBFunction, + PhysicalFunction tsBFunction) { - paramFns.reserve(6); - paramFns.push_back(std::move(lon1)); - paramFns.push_back(std::move(lat1)); - paramFns.push_back(std::move(ts1)); - paramFns.push_back(std::move(lon2)); - paramFns.push_back(std::move(lat2)); - paramFns.push_back(std::move(ts2)); + parameterFunctions.reserve(6); + parameterFunctions.push_back(std::move(lonAFunction)); + parameterFunctions.push_back(std::move(latAFunction)); + parameterFunctions.push_back(std::move(tsAFunction)); + parameterFunctions.push_back(std::move(lonBFunction)); + parameterFunctions.push_back(std::move(latBFunction)); + parameterFunctions.push_back(std::move(tsBFunction)); } VarVal AcontainsTgeoTgeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto lon1 = paramFns[0].execute(record, arena).cast(); - auto lat1 = paramFns[1].execute(record, arena).cast(); - auto ts1 = paramFns[2].execute(record, arena).cast(); - auto lon2 = paramFns[3].execute(record, arena).cast(); - auto lat2 = paramFns[4].execute(record, arena).cast(); - auto ts2 = paramFns[5].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto lonA = parameterValues[0].cast>(); + auto latA = parameterValues[1].cast>(); + auto tsA = parameterValues[2].cast>(); + auto lonB = parameterValues[3].cast>(); + auto latB = parameterValues[4].cast>(); + auto tsB = parameterValues[5].cast>(); + const auto result = nautilus::invoke( - +[](double lon1, double lat1, uint64_t ts1, - double lon2, double lat2, uint64_t ts2) -> double { - try { + +[](double lonAValue, double latAValue, uint64_t tsAValue, + double lonBValue, double latBValue, uint64_t tsBValue) -> int { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string wkt1 = fmt::format("SRID=4326;POINT({},{})@{}", lon1, lat1, ts1); - Temporal* t1 = tgeompoint_in(wkt1.c_str()); - if (!t1) return 0.0; - std::string wkt2 = fmt::format("SRID=4326;POINT({},{})@{}", lon2, lat2, ts2); - Temporal* t2 = tgeompoint_in(wkt2.c_str()); - if (!t2) { free(t1); return 0.0; } - int r = acontains_tgeo_tgeo(t1, t2); - free(t1); free(t2); - return r > 0 ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + if (!(lonAValue >= -180.0 && lonAValue <= 180.0 && latAValue >= -90.0 && latAValue <= 90.0)) return 0; + if (!(lonBValue >= -180.0 && lonBValue <= 180.0 && latBValue >= -90.0 && latBValue <= 90.0)) return 0; + + const std::string tsAString = MEOS::Meos::convertEpochToTimestamp(tsAValue); + const std::string tsBString = MEOS::Meos::convertEpochToTimestamp(tsBValue); + std::string temporalGeometryAWkt = fmt::format("SRID=4326;Point({} {})@{}", lonAValue, latAValue, tsAString); + std::string temporalGeometryBWkt = fmt::format("SRID=4326;Point({} {})@{}", lonBValue, latBValue, tsBString); + + MEOS::Meos::TemporalGeometry temporalGeometryA(temporalGeometryAWkt); + if (!temporalGeometryA.getGeometry()) return 0; + MEOS::Meos::TemporalGeometry temporalGeometryB(temporalGeometryBWkt); + if (!temporalGeometryB.getGeometry()) return 0; + + // MEOS *_tgeo_tgeo spatial-relation: int fn(const Temporal*, const Temporal*). + return acontains_tgeo_tgeo(temporalGeometryA.getGeometry(), + temporalGeometryB.getGeometry()); + } + catch (const std::exception&) + { + return 0; + } }, - lon1, lat1, ts1, lon2, lat2, ts2); + lonA, latA, tsA, lonB, latB, tsB); + return VarVal(result); } @@ -79,13 +105,13 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterA PRECONDITION(arguments.childFunctions.size() == 6, "AcontainsTgeoTgeoPhysicalFunction requires 6 children but got {}", arguments.childFunctions.size()); - return AcontainsTgeoTgeoPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2]), - std::move(arguments.childFunctions[3]), - std::move(arguments.childFunctions[4]), - std::move(arguments.childFunctions[5])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + auto arg5 = std::move(arguments.childFunctions[5]); + return AcontainsTgeoTgeoPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AcoversGeoTrgeometryPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AcoversGeoTrgeometryPhysicalFunction.cpp new file mode 100644 index 0000000000..4ae52609ba --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AcoversGeoTrgeometryPhysicalFunction.cpp @@ -0,0 +1,97 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +#include +} + +namespace NES { + +AcoversGeoTrgeometryPhysicalFunction::AcoversGeoTrgeometryPhysicalFunction(PhysicalFunction tgt_wkt, PhysicalFunction ref_wkt, PhysicalFunction x1, PhysicalFunction y1, PhysicalFunction theta1, PhysicalFunction ts1) { + paramFns.reserve(6); + paramFns.push_back(std::move(tgt_wkt)); + paramFns.push_back(std::move(ref_wkt)); + paramFns.push_back(std::move(x1)); + paramFns.push_back(std::move(y1)); + paramFns.push_back(std::move(theta1)); + paramFns.push_back(std::move(ts1)); +} + +VarVal AcoversGeoTrgeometryPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { + auto tgt_wkt = paramFns[0].execute(record, arena).cast(); + auto ref_wkt = paramFns[1].execute(record, arena).cast(); + auto x1 = paramFns[2].execute(record, arena).cast(); + auto y1 = paramFns[3].execute(record, arena).cast(); + auto theta1 = paramFns[4].execute(record, arena).cast(); + auto ts1 = paramFns[5].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](const char* tgt_wkt, uint32_t tgt_wktsz, const char* ref_wkt, uint32_t ref_wktsz, double x1, double y1, double theta1, uint64_t ts1) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + char* ref1_str = (char*)malloc(ref_wktsz + 1); + memcpy(ref1_str, ref_wkt, ref_wktsz); ref1_str[ref_wktsz] = '\0'; + GSERIALIZED* gref1 = geom_in(ref1_str, -1); free(ref1_str); + if (!gref1) return 0.0; + Pose* pose1 = pose_make_2d(x1, y1, theta1, false, 0); + if (!pose1) { free(gref1); return 0.0; } + TInstant* inst1 = trgeometryinst_make(gref1, pose1, (TimestampTz)ts1); + free(gref1); free(pose1); + if (!inst1) return 0.0; + char* tgt_str = (char*)malloc(tgt_wktsz + 1); + memcpy(tgt_str, tgt_wkt, tgt_wktsz); tgt_str[tgt_wktsz] = '\0'; + GSERIALIZED* gs_tgt = geom_in(tgt_str, -1); free(tgt_str); + if (!gs_tgt) { free(inst1); return 0.0; } + int r = acovers_geo_trgeometry(gs_tgt, (Temporal*)inst1); + free(inst1); free(gs_tgt); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + tgt_wkt, ref_wkt, x1, y1, theta1, ts1); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAcoversGeoTrgeometryPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size()==6, + "AcoversGeoTrgeometryPhysicalFunction requires 6 children but got {}", + arguments.childFunctions.size()); + return AcoversGeoTrgeometryPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4]), + std::move(arguments.childFunctions[5])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AcoversTcbufferGeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AcoversTcbufferGeoPhysicalFunction.cpp index 5296b89f95..09b959a04f 100644 --- a/nes-physical-operators/src/Functions/Meos/AcoversTcbufferGeoPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/AcoversTcbufferGeoPhysicalFunction.cpp @@ -13,77 +13,97 @@ */ #include + #include #include #include +#include #include #include #include #include +#include #include +#include #include #include -#include -#include -#include extern "C" { #include -#include #include } namespace NES { -AcoversTcbufferGeoPhysicalFunction::AcoversTcbufferGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, - PhysicalFunction radius, PhysicalFunction ts, - PhysicalFunction wkt) +AcoversTcbufferGeoPhysicalFunction::AcoversTcbufferGeoPhysicalFunction(PhysicalFunction lonFunction, + PhysicalFunction latFunction, + PhysicalFunction radiusFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction) { - paramFns.reserve(5); - paramFns.push_back(std::move(lon)); - paramFns.push_back(std::move(lat)); - paramFns.push_back(std::move(radius)); - paramFns.push_back(std::move(ts)); - paramFns.push_back(std::move(wkt)); + parameterFunctions.reserve(5); + parameterFunctions.push_back(std::move(lonFunction)); + parameterFunctions.push_back(std::move(latFunction)); + parameterFunctions.push_back(std::move(radiusFunction)); + parameterFunctions.push_back(std::move(timestampFunction)); + parameterFunctions.push_back(std::move(geometryFunction)); } VarVal AcoversTcbufferGeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto lon = paramFns[0].execute(record, arena).cast(); - auto lat = paramFns[1].execute(record, arena).cast(); - auto radius = paramFns[2].execute(record, arena).cast(); - auto ts = paramFns[3].execute(record, arena).cast(); - auto wkt = paramFns[4].execute(record, arena); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto lon = parameterValues[0].cast>(); + auto lat = parameterValues[1].cast>(); + auto radius = parameterValues[2].cast>(); + auto timestamp = parameterValues[3].cast>(); + auto geometry = parameterValues[4].cast(); const auto result = nautilus::invoke( - +[](double lon, double lat, double radius, uint64_t ts, - const char* wkt, uint32_t wkt_len) -> double { - try { + +[](double lonValue, + double latValue, + double radiusValue, + uint64_t timestampValue, + const char* geometryPtr, + uint32_t geometrySize) -> int { + try + { MEOS::Meos::ensureMeosInitialized(); - // Build tcbuffer instant: point + radius → cbuffer → instant - std::string pt_str = fmt::format("POINT({} {})", lon, lat); - GSERIALIZED* pt_gs = geom_in(pt_str.c_str(), -1); - if (!pt_gs) return 0.0; - Cbuffer* cb = cbuffer_make(pt_gs, radius); - free(pt_gs); - if (!cb) return 0.0; - Temporal* tcb_inst = (Temporal*)tcbufferinst_make(cb, (TimestampTz)ts); - free(cb); - if (!tcb_inst) return 0.0; - // Build target geometry from null-terminated WKT copy - char* wkt_str = (char*)malloc(wkt_len + 1); - memcpy(wkt_str, wkt, wkt_len); - wkt_str[wkt_len] = '\0'; - GSERIALIZED* target_gs = geom_in(wkt_str, -1); - free(wkt_str); - if (!target_gs) { free(tcb_inst); return 0.0; } - int r = acovers_tcbuffer_geo(tcb_inst, target_gs); - free(tcb_inst); - free(target_gs); - return r > 0 ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + if (!(lonValue >= -180.0 && lonValue <= 180.0 && latValue >= -90.0 && latValue <= 90.0)) return 0; + if (radiusValue < 0.0) return 0; + + const std::string timestampString = MEOS::Meos::convertEpochToTimestamp(timestampValue); + std::string tcbufferWkt = fmt::format("Cbuffer(Point({} {}),{})@{}", + lonValue, latValue, radiusValue, timestampString); + std::string staticGeometryWkt(geometryPtr, geometrySize); + + while (!staticGeometryWkt.empty() && (staticGeometryWkt.front() == '\'' || staticGeometryWkt.front() == '"')) + staticGeometryWkt.erase(staticGeometryWkt.begin()); + while (!staticGeometryWkt.empty() && (staticGeometryWkt.back() == '\'' || staticGeometryWkt.back() == '"')) + staticGeometryWkt.pop_back(); + + if (tcbufferWkt.empty() || staticGeometryWkt.empty()) return 0; + + Temporal* tcbuffer = tcbuffer_in(tcbufferWkt.c_str()); + if (!tcbuffer) return 0; + MEOS::Meos::StaticGeometry staticGeometry(staticGeometryWkt); + if (!staticGeometry.getGeometry()) { free(tcbuffer); return 0; } + + int r = acovers_tcbuffer_geo(tcbuffer, staticGeometry.getGeometry()); + free(tcbuffer); + return r; + } + catch (const std::exception&) + { + return 0; + } }, - lon, lat, radius, ts, wkt); + lon, lat, radius, timestamp, geometry.getContent(), geometry.getContentSize()); return VarVal(result); } @@ -94,11 +114,12 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterA PRECONDITION(arguments.childFunctions.size() == 5, "AcoversTcbufferGeoPhysicalFunction requires 5 children but got {}", arguments.childFunctions.size()); - return AcoversTcbufferGeoPhysicalFunction(std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2]), - std::move(arguments.childFunctions[3]), - std::move(arguments.childFunctions[4])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + return AcoversTcbufferGeoPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AcoversTcbufferTcbufferPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AcoversTcbufferTcbufferPhysicalFunction.cpp index b3b62e4503..40900265c9 100644 --- a/nes-physical-operators/src/Functions/Meos/AcoversTcbufferTcbufferPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/AcoversTcbufferTcbufferPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -20,75 +21,88 @@ #include #include #include +#include #include +#include #include #include -#include -#include extern "C" { #include -#include #include } namespace NES { -AcoversTcbufferTcbufferPhysicalFunction::AcoversTcbufferTcbufferPhysicalFunction( - PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction r1, PhysicalFunction ts1, - PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction r2, PhysicalFunction ts2) +AcoversTcbufferTcbufferPhysicalFunction::AcoversTcbufferTcbufferPhysicalFunction(PhysicalFunction lonAFunction, + PhysicalFunction latAFunction, + PhysicalFunction radiusAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction lonBFunction, + PhysicalFunction latBFunction, + PhysicalFunction radiusBFunction, + PhysicalFunction tsBFunction) { - paramFns.reserve(8); - paramFns.push_back(std::move(lon1)); - paramFns.push_back(std::move(lat1)); - paramFns.push_back(std::move(r1)); - paramFns.push_back(std::move(ts1)); - paramFns.push_back(std::move(lon2)); - paramFns.push_back(std::move(lat2)); - paramFns.push_back(std::move(r2)); - paramFns.push_back(std::move(ts2)); + parameterFunctions.reserve(8); + parameterFunctions.push_back(std::move(lonAFunction)); + parameterFunctions.push_back(std::move(latAFunction)); + parameterFunctions.push_back(std::move(radiusAFunction)); + parameterFunctions.push_back(std::move(tsAFunction)); + parameterFunctions.push_back(std::move(lonBFunction)); + parameterFunctions.push_back(std::move(latBFunction)); + parameterFunctions.push_back(std::move(radiusBFunction)); + parameterFunctions.push_back(std::move(tsBFunction)); } VarVal AcoversTcbufferTcbufferPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto lon1 = paramFns[0].execute(record, arena).cast(); - auto lat1 = paramFns[1].execute(record, arena).cast(); - auto r1 = paramFns[2].execute(record, arena).cast(); - auto ts1 = paramFns[3].execute(record, arena).cast(); - auto lon2 = paramFns[4].execute(record, arena).cast(); - auto lat2 = paramFns[5].execute(record, arena).cast(); - auto r2 = paramFns[6].execute(record, arena).cast(); - auto ts2 = paramFns[7].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto lonA = parameterValues[0].cast>(); + auto latA = parameterValues[1].cast>(); + auto radiusA = parameterValues[2].cast>(); + auto tsA = parameterValues[3].cast>(); + auto lonB = parameterValues[4].cast>(); + auto latB = parameterValues[5].cast>(); + auto radiusB = parameterValues[6].cast>(); + auto tsB = parameterValues[7].cast>(); const auto result = nautilus::invoke( - +[](double lon1, double lat1, double r1, uint64_t ts1, - double lon2, double lat2, double r2, uint64_t ts2) -> double { - try { + +[](double lonAValue, double latAValue, double radiusAValue, uint64_t tsAValue, + double lonBValue, double latBValue, double radiusBValue, uint64_t tsBValue) -> int { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string pt1 = fmt::format("POINT({} {})", lon1, lat1); - GSERIALIZED* gs1 = geom_in(pt1.c_str(), -1); - if (!gs1) return 0.0; - Cbuffer* cb1 = cbuffer_make(gs1, r1); - free(gs1); - if (!cb1) return 0.0; - Temporal* tcb1 = (Temporal*)tcbufferinst_make(cb1, (TimestampTz)ts1); - free(cb1); - if (!tcb1) return 0.0; - std::string pt2 = fmt::format("POINT({} {})", lon2, lat2); - GSERIALIZED* gs2 = geom_in(pt2.c_str(), -1); - if (!gs2) { free(tcb1); return 0.0; } - Cbuffer* cb2 = cbuffer_make(gs2, r2); - free(gs2); - if (!cb2) { free(tcb1); return 0.0; } - Temporal* tcb2 = (Temporal*)tcbufferinst_make(cb2, (TimestampTz)ts2); - free(cb2); - if (!tcb2) { free(tcb1); return 0.0; } - int r = acovers_tcbuffer_tcbuffer(tcb1, tcb2); - free(tcb1); free(tcb2); - return r > 0 ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + if (!(lonAValue >= -180.0 && lonAValue <= 180.0 && latAValue >= -90.0 && latAValue <= 90.0)) return 0; + if (!(lonBValue >= -180.0 && lonBValue <= 180.0 && latBValue >= -90.0 && latBValue <= 90.0)) return 0; + if (radiusAValue < 0.0 || radiusBValue < 0.0) return 0; + + const std::string tsAString = MEOS::Meos::convertEpochToTimestamp(tsAValue); + const std::string tsBString = MEOS::Meos::convertEpochToTimestamp(tsBValue); + std::string wktA = fmt::format("Cbuffer(Point({} {}),{})@{}", lonAValue, latAValue, radiusAValue, tsAString); + std::string wktB = fmt::format("Cbuffer(Point({} {}),{})@{}", lonBValue, latBValue, radiusBValue, tsBString); + + Temporal* tA = tcbuffer_in(wktA.c_str()); + if (!tA) return 0; + Temporal* tB = tcbuffer_in(wktB.c_str()); + if (!tB) { free(tA); return 0; } + + int r = acovers_tcbuffer_tcbuffer(tA, tB); + free(tA); + free(tB); + return r; + } + catch (const std::exception&) + { + return 0; + } }, - lon1, lat1, r1, ts1, lon2, lat2, r2, ts2); + lonA, latA, radiusA, tsA, lonB, latB, radiusB, tsB); return VarVal(result); } @@ -99,14 +113,15 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterA PRECONDITION(arguments.childFunctions.size() == 8, "AcoversTcbufferTcbufferPhysicalFunction requires 8 children but got {}", arguments.childFunctions.size()); - return AcoversTcbufferTcbufferPhysicalFunction(std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2]), - std::move(arguments.childFunctions[3]), - std::move(arguments.childFunctions[4]), - std::move(arguments.childFunctions[5]), - std::move(arguments.childFunctions[6]), - std::move(arguments.childFunctions[7])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + auto arg5 = std::move(arguments.childFunctions[5]); + auto arg6 = std::move(arguments.childFunctions[6]); + auto arg7 = std::move(arguments.childFunctions[7]); + return AcoversTcbufferTcbufferPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6), std::move(arg7)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AcoversTgeoGeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AcoversTgeoGeoPhysicalFunction.cpp index 2ed4f96b36..6e8dfb9b1e 100644 --- a/nes-physical-operators/src/Functions/Meos/AcoversTgeoGeoPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/AcoversTgeoGeoPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -34,40 +35,75 @@ extern "C" { namespace NES { -AcoversTgeoGeoPhysicalFunction::AcoversTgeoGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, - PhysicalFunction ts, PhysicalFunction wkt) +AcoversTgeoGeoPhysicalFunction::AcoversTgeoGeoPhysicalFunction(PhysicalFunction lonFunction, + PhysicalFunction latFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction) { - paramFns.reserve(4); - paramFns.push_back(std::move(lon)); - paramFns.push_back(std::move(lat)); - paramFns.push_back(std::move(ts)); - paramFns.push_back(std::move(wkt)); + parameterFunctions.reserve(4); + parameterFunctions.push_back(std::move(lonFunction)); + parameterFunctions.push_back(std::move(latFunction)); + parameterFunctions.push_back(std::move(timestampFunction)); + parameterFunctions.push_back(std::move(geometryFunction)); } VarVal AcoversTgeoGeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto lon = paramFns[0].execute(record, arena).cast(); - auto lat = paramFns[1].execute(record, arena).cast(); - auto ts = paramFns[2].execute(record, arena).cast(); - auto wkt = paramFns[3].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto lon = parameterValues[0].cast>(); + auto lat = parameterValues[1].cast>(); + auto timestamp = parameterValues[2].cast>(); + auto geometry = parameterValues[3].cast(); const auto result = nautilus::invoke( - +[](double lon, double lat, uint64_t ts, - const char* w, uint32_t wsz) -> double { - try { + +[](double lonValue, + double latValue, + uint64_t timestampValue, + const char* geometryPtr, + uint32_t geometrySize) -> int { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string wktStr(w, wsz); - std::string tgeoWkt = fmt::format("SRID=4326;POINT({},{})@{}", lon, lat, ts); - Temporal* tgeo = tgeompoint_in(tgeoWkt.c_str()); - if (!tgeo) return 0.0; - GSERIALIZED* gs = geom_in(wktStr.c_str(), -1); - if (!gs) { free(tgeo); return 0.0; } - int r = acovers_tgeo_geo(tgeo, gs); - free(tgeo); free(gs); - return r > 0 ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + if (!(lonValue >= -180.0 && lonValue <= 180.0 && latValue >= -90.0 && latValue <= 90.0)) { + return 0; + } + + const std::string timestampString = MEOS::Meos::convertEpochToTimestamp(timestampValue); + std::string temporalGeometryWkt = fmt::format("SRID=4326;Point({} {})@{}", lonValue, latValue, timestampString); + std::string staticGeometryWkt(geometryPtr, geometrySize); + + while (!staticGeometryWkt.empty() && (staticGeometryWkt.front() == '\'' || staticGeometryWkt.front() == '"')) + staticGeometryWkt.erase(staticGeometryWkt.begin()); + while (!staticGeometryWkt.empty() && (staticGeometryWkt.back() == '\'' || staticGeometryWkt.back() == '"')) + staticGeometryWkt.pop_back(); + + if (temporalGeometryWkt.empty() || staticGeometryWkt.empty()) + return 0; + + MEOS::Meos::TemporalGeometry temporalGeometry(temporalGeometryWkt); + if (!temporalGeometry.getGeometry()) return 0; + MEOS::Meos::StaticGeometry staticGeometry(staticGeometryWkt); + if (!staticGeometry.getGeometry()) return 0; + + // MEOS spatial-relation call — same shape as TemporalEDWithin's + // edwithin_tgeo_geo, but specific MEOS function per generated operator. + // Real MEOS spatial-rel signature: int fn(const Temporal *, const GSERIALIZED *) + // (no `atstart` flag — that's specific to geog_dwithin / edwithin's 3-arg variant). + return acovers_tgeo_geo(temporalGeometry.getGeometry(), + staticGeometry.getGeometry()); + } + catch (const std::exception&) + { + return 0; + } }, - lon, lat, ts, wkt); + lon, lat, timestamp, geometry.getContent(), geometry.getContentSize()); return VarVal(result); } @@ -78,10 +114,11 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterA PRECONDITION(arguments.childFunctions.size() == 4, "AcoversTgeoGeoPhysicalFunction requires 4 children but got {}", arguments.childFunctions.size()); - return AcoversTgeoGeoPhysicalFunction(std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2]), - std::move(arguments.childFunctions[3])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + return AcoversTgeoGeoPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AcoversTgeoTgeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AcoversTgeoTgeoPhysicalFunction.cpp index 8898176bd1..a98b828f6e 100644 --- a/nes-physical-operators/src/Functions/Meos/AcoversTgeoTgeoPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/AcoversTgeoTgeoPhysicalFunction.cpp @@ -13,10 +13,10 @@ */ #include + #include #include #include -#include #include #include #include @@ -34,42 +34,68 @@ extern "C" { namespace NES { -AcoversTgeoTgeoPhysicalFunction::AcoversTgeoTgeoPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction ts1, PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction ts2) +AcoversTgeoTgeoPhysicalFunction::AcoversTgeoTgeoPhysicalFunction(PhysicalFunction lonAFunction, + PhysicalFunction latAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction lonBFunction, + PhysicalFunction latBFunction, + PhysicalFunction tsBFunction) { - paramFns.reserve(6); - paramFns.push_back(std::move(lon1)); - paramFns.push_back(std::move(lat1)); - paramFns.push_back(std::move(ts1)); - paramFns.push_back(std::move(lon2)); - paramFns.push_back(std::move(lat2)); - paramFns.push_back(std::move(ts2)); + parameterFunctions.reserve(6); + parameterFunctions.push_back(std::move(lonAFunction)); + parameterFunctions.push_back(std::move(latAFunction)); + parameterFunctions.push_back(std::move(tsAFunction)); + parameterFunctions.push_back(std::move(lonBFunction)); + parameterFunctions.push_back(std::move(latBFunction)); + parameterFunctions.push_back(std::move(tsBFunction)); } VarVal AcoversTgeoTgeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto lon1 = paramFns[0].execute(record, arena).cast(); - auto lat1 = paramFns[1].execute(record, arena).cast(); - auto ts1 = paramFns[2].execute(record, arena).cast(); - auto lon2 = paramFns[3].execute(record, arena).cast(); - auto lat2 = paramFns[4].execute(record, arena).cast(); - auto ts2 = paramFns[5].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto lonA = parameterValues[0].cast>(); + auto latA = parameterValues[1].cast>(); + auto tsA = parameterValues[2].cast>(); + auto lonB = parameterValues[3].cast>(); + auto latB = parameterValues[4].cast>(); + auto tsB = parameterValues[5].cast>(); + const auto result = nautilus::invoke( - +[](double lon1, double lat1, uint64_t ts1, - double lon2, double lat2, uint64_t ts2) -> double { - try { + +[](double lonAValue, double latAValue, uint64_t tsAValue, + double lonBValue, double latBValue, uint64_t tsBValue) -> int { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string wkt1 = fmt::format("SRID=4326;POINT({},{})@{}", lon1, lat1, ts1); - Temporal* t1 = tgeompoint_in(wkt1.c_str()); - if (!t1) return 0.0; - std::string wkt2 = fmt::format("SRID=4326;POINT({},{})@{}", lon2, lat2, ts2); - Temporal* t2 = tgeompoint_in(wkt2.c_str()); - if (!t2) { free(t1); return 0.0; } - int r = acovers_tgeo_tgeo(t1, t2); - free(t1); free(t2); - return r > 0 ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + if (!(lonAValue >= -180.0 && lonAValue <= 180.0 && latAValue >= -90.0 && latAValue <= 90.0)) return 0; + if (!(lonBValue >= -180.0 && lonBValue <= 180.0 && latBValue >= -90.0 && latBValue <= 90.0)) return 0; + + const std::string tsAString = MEOS::Meos::convertEpochToTimestamp(tsAValue); + const std::string tsBString = MEOS::Meos::convertEpochToTimestamp(tsBValue); + std::string temporalGeometryAWkt = fmt::format("SRID=4326;Point({} {})@{}", lonAValue, latAValue, tsAString); + std::string temporalGeometryBWkt = fmt::format("SRID=4326;Point({} {})@{}", lonBValue, latBValue, tsBString); + + MEOS::Meos::TemporalGeometry temporalGeometryA(temporalGeometryAWkt); + if (!temporalGeometryA.getGeometry()) return 0; + MEOS::Meos::TemporalGeometry temporalGeometryB(temporalGeometryBWkt); + if (!temporalGeometryB.getGeometry()) return 0; + + // MEOS *_tgeo_tgeo spatial-relation: int fn(const Temporal*, const Temporal*). + return acovers_tgeo_tgeo(temporalGeometryA.getGeometry(), + temporalGeometryB.getGeometry()); + } + catch (const std::exception&) + { + return 0; + } }, - lon1, lat1, ts1, lon2, lat2, ts2); + lonA, latA, tsA, lonB, latB, tsB); + return VarVal(result); } @@ -79,13 +105,13 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterA PRECONDITION(arguments.childFunctions.size() == 6, "AcoversTgeoTgeoPhysicalFunction requires 6 children but got {}", arguments.childFunctions.size()); - return AcoversTgeoTgeoPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2]), - std::move(arguments.childFunctions[3]), - std::move(arguments.childFunctions[4]), - std::move(arguments.childFunctions[5])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + auto arg5 = std::move(arguments.childFunctions[5]); + return AcoversTgeoTgeoPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AcoversTrgeometryGeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AcoversTrgeometryGeoPhysicalFunction.cpp new file mode 100644 index 0000000000..e30fbd9901 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AcoversTrgeometryGeoPhysicalFunction.cpp @@ -0,0 +1,97 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +#include +} + +namespace NES { + +AcoversTrgeometryGeoPhysicalFunction::AcoversTrgeometryGeoPhysicalFunction(PhysicalFunction ref_wkt, PhysicalFunction x1, PhysicalFunction y1, PhysicalFunction theta1, PhysicalFunction ts1, PhysicalFunction tgt_wkt) { + paramFns.reserve(6); + paramFns.push_back(std::move(ref_wkt)); + paramFns.push_back(std::move(x1)); + paramFns.push_back(std::move(y1)); + paramFns.push_back(std::move(theta1)); + paramFns.push_back(std::move(ts1)); + paramFns.push_back(std::move(tgt_wkt)); +} + +VarVal AcoversTrgeometryGeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { + auto ref_wkt = paramFns[0].execute(record, arena).cast(); + auto x1 = paramFns[1].execute(record, arena).cast(); + auto y1 = paramFns[2].execute(record, arena).cast(); + auto theta1 = paramFns[3].execute(record, arena).cast(); + auto ts1 = paramFns[4].execute(record, arena).cast(); + auto tgt_wkt = paramFns[5].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](const char* ref_wkt, uint32_t ref_wktsz, double x1, double y1, double theta1, uint64_t ts1, const char* tgt_wkt, uint32_t tgt_wktsz) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + char* ref1_str = (char*)malloc(ref_wktsz + 1); + memcpy(ref1_str, ref_wkt, ref_wktsz); ref1_str[ref_wktsz] = '\0'; + GSERIALIZED* gref1 = geom_in(ref1_str, -1); free(ref1_str); + if (!gref1) return 0.0; + Pose* pose1 = pose_make_2d(x1, y1, theta1, false, 0); + if (!pose1) { free(gref1); return 0.0; } + TInstant* inst1 = trgeometryinst_make(gref1, pose1, (TimestampTz)ts1); + free(gref1); free(pose1); + if (!inst1) return 0.0; + char* tgt_str = (char*)malloc(tgt_wktsz + 1); + memcpy(tgt_str, tgt_wkt, tgt_wktsz); tgt_str[tgt_wktsz] = '\0'; + GSERIALIZED* gs_tgt = geom_in(tgt_str, -1); free(tgt_str); + if (!gs_tgt) { free(inst1); return 0.0; } + int r = acovers_trgeometry_geo((Temporal*)inst1, gs_tgt); + free(inst1); free(gs_tgt); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + ref_wkt, x1, y1, theta1, ts1, tgt_wkt); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAcoversTrgeometryGeoPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size()==6, + "AcoversTrgeometryGeoPhysicalFunction requires 6 children but got {}", + arguments.childFunctions.size()); + return AcoversTrgeometryGeoPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4]), + std::move(arguments.childFunctions[5])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AddBigintTbigintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AddBigintTbigintPhysicalFunction.cpp index 524b303ad8..5007bf6648 100644 --- a/nes-physical-operators/src/Functions/Meos/AddBigintTbigintPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/AddBigintTbigintPhysicalFunction.cpp @@ -35,12 +35,12 @@ extern "C" { namespace NES { -AddBigintTbigintPhysicalFunction::AddBigintTbigintPhysicalFunction(PhysicalFunction scalarFunction, - PhysicalFunction valueFunction, - PhysicalFunction tsFunction) +AddBigintTbigintPhysicalFunction::AddBigintTbigintPhysicalFunction(PhysicalFunction arg0Function, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction) { parameterFunctions.reserve(3); - parameterFunctions.push_back(std::move(scalarFunction)); + parameterFunctions.push_back(std::move(arg0Function)); parameterFunctions.push_back(std::move(valueFunction)); parameterFunctions.push_back(std::move(tsFunction)); } @@ -50,29 +50,38 @@ VarVal AddBigintTbigintPhysicalFunction::execute(const Record& record, ArenaRef& std::vector parameterValues; parameterValues.reserve(parameterFunctions.size()); for (const auto& function : parameterFunctions) + { parameterValues.emplace_back(function.execute(record, arena)); + } - auto scalar = parameterValues[0].cast>(); - auto value = parameterValues[1].cast>(); - auto ts = parameterValues[2].cast>(); + auto arg0 = parameterValues[0].cast>(); + auto value = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); const auto result = nautilus::invoke( - +[](double scalar_d, double value_d, uint64_t ts) -> double { - try { + +[](double arg0, + double value, + uint64_t ts) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string tempWkt = fmt::format("{}@{}", static_cast(value_d), - MEOS::Meos::convertEpochToTimestamp(ts)); + std::string tempWkt = fmt::format("{}@{}", static_cast(value), MEOS::Meos::convertEpochToTimestamp(ts)); Temporal* temp = tbigint_in(tempWkt.c_str()); if (!temp) return 0.0; - Temporal* res = add_bigint_tbigint(static_cast(scalar_d), temp); + + Temporal* res = add_bigint_tbigint(static_cast(arg0), temp); free(temp); if (!res) return 0.0; - double r = static_cast(tbigint_start_value(res)); + double r = tbigint_start_value(res); free(res); return r; - } catch (const std::exception&) { return 0.0; } + } + catch (const std::exception&) + { + return 0.0; + } }, - scalar, value, ts); + arg0, value, ts); return VarVal(result); } diff --git a/nes-physical-operators/src/Functions/Meos/AddFloatTfloatPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AddFloatTfloatPhysicalFunction.cpp index 50cf48bbf9..8979d5690d 100644 --- a/nes-physical-operators/src/Functions/Meos/AddFloatTfloatPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/AddFloatTfloatPhysicalFunction.cpp @@ -35,12 +35,12 @@ extern "C" { namespace NES { -AddFloatTfloatPhysicalFunction::AddFloatTfloatPhysicalFunction(PhysicalFunction scalarFunction, - PhysicalFunction valueFunction, - PhysicalFunction tsFunction) +AddFloatTfloatPhysicalFunction::AddFloatTfloatPhysicalFunction(PhysicalFunction arg0Function, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction) { parameterFunctions.reserve(3); - parameterFunctions.push_back(std::move(scalarFunction)); + parameterFunctions.push_back(std::move(arg0Function)); parameterFunctions.push_back(std::move(valueFunction)); parameterFunctions.push_back(std::move(tsFunction)); } @@ -50,28 +50,38 @@ VarVal AddFloatTfloatPhysicalFunction::execute(const Record& record, ArenaRef& a std::vector parameterValues; parameterValues.reserve(parameterFunctions.size()); for (const auto& function : parameterFunctions) + { parameterValues.emplace_back(function.execute(record, arena)); + } - auto scalar = parameterValues[0].cast>(); - auto value = parameterValues[1].cast>(); - auto ts = parameterValues[2].cast>(); + auto arg0 = parameterValues[0].cast>(); + auto value = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); const auto result = nautilus::invoke( - +[](double scalar, double value, uint64_t ts) -> double { - try { + +[](double arg0, + double value, + uint64_t ts) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); std::string tempWkt = fmt::format("{}@{}", value, MEOS::Meos::convertEpochToTimestamp(ts)); Temporal* temp = tfloat_in(tempWkt.c_str()); if (!temp) return 0.0; - Temporal* res = add_float_tfloat(scalar, temp); + + Temporal* res = add_float_tfloat(arg0, temp); free(temp); if (!res) return 0.0; double r = tfloat_start_value(res); free(res); return r; - } catch (const std::exception&) { return 0.0; } + } + catch (const std::exception&) + { + return 0.0; + } }, - scalar, value, ts); + arg0, value, ts); return VarVal(result); } diff --git a/nes-physical-operators/src/Functions/Meos/AddIntTintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AddIntTintPhysicalFunction.cpp index f6cb83b692..7a13aae9f2 100644 --- a/nes-physical-operators/src/Functions/Meos/AddIntTintPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/AddIntTintPhysicalFunction.cpp @@ -35,12 +35,12 @@ extern "C" { namespace NES { -AddIntTintPhysicalFunction::AddIntTintPhysicalFunction(PhysicalFunction scalarFunction, - PhysicalFunction valueFunction, - PhysicalFunction tsFunction) +AddIntTintPhysicalFunction::AddIntTintPhysicalFunction(PhysicalFunction arg0Function, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction) { parameterFunctions.reserve(3); - parameterFunctions.push_back(std::move(scalarFunction)); + parameterFunctions.push_back(std::move(arg0Function)); parameterFunctions.push_back(std::move(valueFunction)); parameterFunctions.push_back(std::move(tsFunction)); } @@ -50,28 +50,38 @@ VarVal AddIntTintPhysicalFunction::execute(const Record& record, ArenaRef& arena std::vector parameterValues; parameterValues.reserve(parameterFunctions.size()); for (const auto& function : parameterFunctions) + { parameterValues.emplace_back(function.execute(record, arena)); + } - auto scalar = parameterValues[0].cast>(); - auto value = parameterValues[1].cast>(); - auto ts = parameterValues[2].cast>(); + auto arg0 = parameterValues[0].cast>(); + auto value = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); const auto result = nautilus::invoke( - +[](double scalar_d, double value_d, uint64_t ts) -> double { - try { + +[](int32_t arg0, + int32_t value, + uint64_t ts) -> int { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string tempWkt = fmt::format("{}@{}", static_cast(value_d), MEOS::Meos::convertEpochToTimestamp(ts)); + std::string tempWkt = fmt::format("{}@{}", value, MEOS::Meos::convertEpochToTimestamp(ts)); Temporal* temp = tint_in(tempWkt.c_str()); - if (!temp) return 0.0; - Temporal* res = add_int_tint(static_cast(scalar_d), temp); + if (!temp) return 0; + + Temporal* res = add_int_tint(arg0, temp); free(temp); - if (!res) return 0.0; - double r = static_cast(tint_start_value(res)); + if (!res) return 0; + int r = tint_start_value(res); free(res); return r; - } catch (const std::exception&) { return 0.0; } + } + catch (const std::exception&) + { + return 0; + } }, - scalar, value, ts); + arg0, value, ts); return VarVal(result); } diff --git a/nes-physical-operators/src/Functions/Meos/AddTbigintBigintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AddTbigintBigintPhysicalFunction.cpp index 0744733c6f..81f26e0213 100644 --- a/nes-physical-operators/src/Functions/Meos/AddTbigintBigintPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/AddTbigintBigintPhysicalFunction.cpp @@ -36,13 +36,13 @@ extern "C" { namespace NES { AddTbigintBigintPhysicalFunction::AddTbigintBigintPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction tsFunction, - PhysicalFunction addendFunction) + PhysicalFunction tsFunction, + PhysicalFunction arg0Function) { parameterFunctions.reserve(3); parameterFunctions.push_back(std::move(valueFunction)); parameterFunctions.push_back(std::move(tsFunction)); - parameterFunctions.push_back(std::move(addendFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } VarVal AddTbigintBigintPhysicalFunction::execute(const Record& record, ArenaRef& arena) const @@ -50,29 +50,38 @@ VarVal AddTbigintBigintPhysicalFunction::execute(const Record& record, ArenaRef& std::vector parameterValues; parameterValues.reserve(parameterFunctions.size()); for (const auto& function : parameterFunctions) + { parameterValues.emplace_back(function.execute(record, arena)); + } - auto value = parameterValues[0].cast>(); - auto ts = parameterValues[1].cast>(); - auto addend = parameterValues[2].cast>(); + auto value = parameterValues[0].cast>(); + auto ts = parameterValues[1].cast>(); + auto arg0 = parameterValues[2].cast>(); const auto result = nautilus::invoke( - +[](double value, uint64_t ts, double addend_d) -> double { - try { + +[](double value, + uint64_t ts, + double arg0) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string tempWkt = fmt::format("{}@{}", static_cast(value), - MEOS::Meos::convertEpochToTimestamp(ts)); + std::string tempWkt = fmt::format("{}@{}", static_cast(value), MEOS::Meos::convertEpochToTimestamp(ts)); Temporal* temp = tbigint_in(tempWkt.c_str()); if (!temp) return 0.0; - Temporal* res = add_tbigint_bigint(temp, static_cast(addend_d)); + + Temporal* res = add_tbigint_bigint(temp, static_cast(arg0)); free(temp); if (!res) return 0.0; - double r = static_cast(tbigint_start_value(res)); + double r = tbigint_start_value(res); free(res); return r; - } catch (const std::exception&) { return 0.0; } + } + catch (const std::exception&) + { + return 0.0; + } }, - value, ts, addend); + value, ts, arg0); return VarVal(result); } diff --git a/nes-physical-operators/src/Functions/Meos/AddTfloatFloatPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AddTfloatFloatPhysicalFunction.cpp index 75dc0a3994..0ff08dbb3f 100644 --- a/nes-physical-operators/src/Functions/Meos/AddTfloatFloatPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/AddTfloatFloatPhysicalFunction.cpp @@ -36,13 +36,13 @@ extern "C" { namespace NES { AddTfloatFloatPhysicalFunction::AddTfloatFloatPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction tsFunction, - PhysicalFunction addendFunction) + PhysicalFunction tsFunction, + PhysicalFunction arg0Function) { parameterFunctions.reserve(3); parameterFunctions.push_back(std::move(valueFunction)); parameterFunctions.push_back(std::move(tsFunction)); - parameterFunctions.push_back(std::move(addendFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } VarVal AddTfloatFloatPhysicalFunction::execute(const Record& record, ArenaRef& arena) const @@ -50,28 +50,38 @@ VarVal AddTfloatFloatPhysicalFunction::execute(const Record& record, ArenaRef& a std::vector parameterValues; parameterValues.reserve(parameterFunctions.size()); for (const auto& function : parameterFunctions) + { parameterValues.emplace_back(function.execute(record, arena)); + } - auto value = parameterValues[0].cast>(); - auto ts = parameterValues[1].cast>(); - auto addend = parameterValues[2].cast>(); + auto value = parameterValues[0].cast>(); + auto ts = parameterValues[1].cast>(); + auto arg0 = parameterValues[2].cast>(); const auto result = nautilus::invoke( - +[](double value, uint64_t ts, double addend) -> double { - try { + +[](double value, + uint64_t ts, + double arg0) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); std::string tempWkt = fmt::format("{}@{}", value, MEOS::Meos::convertEpochToTimestamp(ts)); Temporal* temp = tfloat_in(tempWkt.c_str()); if (!temp) return 0.0; - Temporal* res = add_tfloat_float(temp, addend); + + Temporal* res = add_tfloat_float(temp, arg0); free(temp); if (!res) return 0.0; double r = tfloat_start_value(res); free(res); return r; - } catch (const std::exception&) { return 0.0; } + } + catch (const std::exception&) + { + return 0.0; + } }, - value, ts, addend); + value, ts, arg0); return VarVal(result); } diff --git a/nes-physical-operators/src/Functions/Meos/AddTintIntPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AddTintIntPhysicalFunction.cpp index 031a677e61..236a6b53bd 100644 --- a/nes-physical-operators/src/Functions/Meos/AddTintIntPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/AddTintIntPhysicalFunction.cpp @@ -36,13 +36,13 @@ extern "C" { namespace NES { AddTintIntPhysicalFunction::AddTintIntPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction tsFunction, - PhysicalFunction addendFunction) + PhysicalFunction tsFunction, + PhysicalFunction arg0Function) { parameterFunctions.reserve(3); parameterFunctions.push_back(std::move(valueFunction)); parameterFunctions.push_back(std::move(tsFunction)); - parameterFunctions.push_back(std::move(addendFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } VarVal AddTintIntPhysicalFunction::execute(const Record& record, ArenaRef& arena) const @@ -50,28 +50,38 @@ VarVal AddTintIntPhysicalFunction::execute(const Record& record, ArenaRef& arena std::vector parameterValues; parameterValues.reserve(parameterFunctions.size()); for (const auto& function : parameterFunctions) + { parameterValues.emplace_back(function.execute(record, arena)); + } - auto value = parameterValues[0].cast>(); - auto ts = parameterValues[1].cast>(); - auto addend = parameterValues[2].cast>(); + auto value = parameterValues[0].cast>(); + auto ts = parameterValues[1].cast>(); + auto arg0 = parameterValues[2].cast>(); const auto result = nautilus::invoke( - +[](double value, uint64_t ts, double addend_d) -> double { - try { + +[](int32_t value, + uint64_t ts, + int32_t arg0) -> int { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string tempWkt = fmt::format("{}@{}", static_cast(value), MEOS::Meos::convertEpochToTimestamp(ts)); + std::string tempWkt = fmt::format("{}@{}", value, MEOS::Meos::convertEpochToTimestamp(ts)); Temporal* temp = tint_in(tempWkt.c_str()); - if (!temp) return 0.0; - Temporal* res = add_tint_int(temp, static_cast(addend_d)); + if (!temp) return 0; + + Temporal* res = add_tint_int(temp, arg0); free(temp); - if (!res) return 0.0; - double r = static_cast(tint_start_value(res)); + if (!res) return 0; + int r = tint_start_value(res); free(res); return r; - } catch (const std::exception&) { return 0.0; } + } + catch (const std::exception&) + { + return 0; + } }, - value, ts, addend); + value, ts, arg0); return VarVal(result); } diff --git a/nes-physical-operators/src/Functions/Meos/AddTnumberTnumberPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AddTnumberTnumberPhysicalFunction.cpp index 6f709c0ceb..52e5c1a9fd 100644 --- a/nes-physical-operators/src/Functions/Meos/AddTnumberTnumberPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/AddTnumberTnumberPhysicalFunction.cpp @@ -22,7 +22,8 @@ #include #include #include -#include +#include +#include #include #include #include @@ -35,14 +36,12 @@ extern "C" { namespace NES { -AddTnumberTnumberPhysicalFunction::AddTnumberTnumberPhysicalFunction(PhysicalFunction value1Function, - PhysicalFunction value2Function, - PhysicalFunction tsFunction) +AddTnumberTnumberPhysicalFunction::AddTnumberTnumberPhysicalFunction(PhysicalFunction trajFunction, + PhysicalFunction arg0Function) { - parameterFunctions.reserve(3); - parameterFunctions.push_back(std::move(value1Function)); - parameterFunctions.push_back(std::move(value2Function)); - parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.reserve(2); + parameterFunctions.push_back(std::move(trajFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } VarVal AddTnumberTnumberPhysicalFunction::execute(const Record& record, ArenaRef& arena) const @@ -50,45 +49,74 @@ VarVal AddTnumberTnumberPhysicalFunction::execute(const Record& record, ArenaRef std::vector parameterValues; parameterValues.reserve(parameterFunctions.size()); for (const auto& function : parameterFunctions) + { parameterValues.emplace_back(function.execute(record, arena)); + } - auto value1 = parameterValues[0].cast>(); - auto value2 = parameterValues[1].cast>(); - auto ts = parameterValues[2].cast>(); + auto traj = parameterValues[0].cast(); + auto arg0 = parameterValues[1].cast(); - const auto result = nautilus::invoke( - +[](double value1, double value2, uint64_t ts) -> double { - try { + // Call MEOS f(Temporal*, Temporal*) -> Temporal* over the two hex-WKB + // operands and serialize the result back to hex-WKB inside the invoke; the + // returned heap string is copied into the arena below. Both operands and the + // MEOS result are freed here. + auto hexStr = nautilus::invoke( + +[](const char* aPtr, uint32_t aSize, const char* bPtr, uint32_t bSize) -> char* + { + try + { MEOS::Meos::ensureMeosInitialized(); - const std::string tsStr = MEOS::Meos::convertEpochToTimestamp(ts); - std::string wkt1 = fmt::format("{}@{}", value1, tsStr); - std::string wkt2 = fmt::format("{}@{}", value2, tsStr); - Temporal* t1 = tfloat_in(wkt1.c_str()); - Temporal* t2 = tfloat_in(wkt2.c_str()); - if (!t1 || !t2) { free(t1); free(t2); return 0.0; } - Temporal* res = add_tnumber_tnumber(t1, t2); - free(t1); free(t2); - if (!res) return 0.0; - double r = tfloat_start_value(res); + std::string aHex(aPtr, aSize); + std::string bHex(bPtr, bSize); + Temporal* a = temporal_from_hexwkb(aHex.c_str()); + if (!a) return (char*) nullptr; + Temporal* b = temporal_from_hexwkb(bHex.c_str()); + if (!b) { free(a); return (char*) nullptr; } + Temporal* res = add_tnumber_tnumber(a, b); + free(a); + free(b); + if (!res) return (char*) nullptr; + size_t hexSize = 0; + char* hexOut = temporal_as_hexwkb(res, 0, &hexSize); free(res); - return r; - } catch (const std::exception&) { return 0.0; } + return hexOut; + } + catch (const std::exception&) + { + return (char*) nullptr; + } }, - value1, value2, ts); + traj.getContent(), traj.getContentSize(), arg0.getContent(), arg0.getContentSize()); - return VarVal(result); + const auto hexLen = nautilus::invoke( + +[](const char* s) -> uint32_t { return s ? (uint32_t) strlen(s) : (uint32_t) 0; }, + hexStr); + + auto variableSized = arena.allocateVariableSizedData(hexLen); + + nautilus::invoke( + +[](int8_t* dest, const char* s, uint32_t len) -> void + { + if (s) + { + memcpy(dest, s, len); + free((void*) s); + } + }, + variableSized.getContent(), hexStr, hexLen); + + return variableSized; } PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAddTnumberTnumberPhysicalFunction( PhysicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.childFunctions.size() == 3, - "AddTnumberTnumberPhysicalFunction requires 3 children but got {}", + PRECONDITION(arguments.childFunctions.size() == 2, + "AddTnumberTnumberPhysicalFunction requires 2 children but got {}", arguments.childFunctions.size()); auto arg0 = std::move(arguments.childFunctions[0]); auto arg1 = std::move(arguments.childFunctions[1]); - auto arg2 = std::move(arguments.childFunctions[2]); - return AddTnumberTnumberPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); + return AddTnumberTnumberPhysicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AdisjointTcbufferGeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AdisjointTcbufferGeoPhysicalFunction.cpp index 4657c698eb..db39adc3cb 100644 --- a/nes-physical-operators/src/Functions/Meos/AdisjointTcbufferGeoPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/AdisjointTcbufferGeoPhysicalFunction.cpp @@ -13,77 +13,97 @@ */ #include + #include #include #include +#include #include #include #include #include +#include #include +#include #include #include -#include -#include -#include extern "C" { #include -#include #include } namespace NES { -AdisjointTcbufferGeoPhysicalFunction::AdisjointTcbufferGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, - PhysicalFunction radius, PhysicalFunction ts, - PhysicalFunction wkt) +AdisjointTcbufferGeoPhysicalFunction::AdisjointTcbufferGeoPhysicalFunction(PhysicalFunction lonFunction, + PhysicalFunction latFunction, + PhysicalFunction radiusFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction) { - paramFns.reserve(5); - paramFns.push_back(std::move(lon)); - paramFns.push_back(std::move(lat)); - paramFns.push_back(std::move(radius)); - paramFns.push_back(std::move(ts)); - paramFns.push_back(std::move(wkt)); + parameterFunctions.reserve(5); + parameterFunctions.push_back(std::move(lonFunction)); + parameterFunctions.push_back(std::move(latFunction)); + parameterFunctions.push_back(std::move(radiusFunction)); + parameterFunctions.push_back(std::move(timestampFunction)); + parameterFunctions.push_back(std::move(geometryFunction)); } VarVal AdisjointTcbufferGeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto lon = paramFns[0].execute(record, arena).cast(); - auto lat = paramFns[1].execute(record, arena).cast(); - auto radius = paramFns[2].execute(record, arena).cast(); - auto ts = paramFns[3].execute(record, arena).cast(); - auto wkt = paramFns[4].execute(record, arena); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto lon = parameterValues[0].cast>(); + auto lat = parameterValues[1].cast>(); + auto radius = parameterValues[2].cast>(); + auto timestamp = parameterValues[3].cast>(); + auto geometry = parameterValues[4].cast(); const auto result = nautilus::invoke( - +[](double lon, double lat, double radius, uint64_t ts, - const char* wkt, uint32_t wkt_len) -> double { - try { + +[](double lonValue, + double latValue, + double radiusValue, + uint64_t timestampValue, + const char* geometryPtr, + uint32_t geometrySize) -> int { + try + { MEOS::Meos::ensureMeosInitialized(); - // Build tcbuffer instant: point + radius → cbuffer → instant - std::string pt_str = fmt::format("POINT({} {})", lon, lat); - GSERIALIZED* pt_gs = geom_in(pt_str.c_str(), -1); - if (!pt_gs) return 0.0; - Cbuffer* cb = cbuffer_make(pt_gs, radius); - free(pt_gs); - if (!cb) return 0.0; - Temporal* tcb_inst = (Temporal*)tcbufferinst_make(cb, (TimestampTz)ts); - free(cb); - if (!tcb_inst) return 0.0; - // Build target geometry from null-terminated WKT copy - char* wkt_str = (char*)malloc(wkt_len + 1); - memcpy(wkt_str, wkt, wkt_len); - wkt_str[wkt_len] = '\0'; - GSERIALIZED* target_gs = geom_in(wkt_str, -1); - free(wkt_str); - if (!target_gs) { free(tcb_inst); return 0.0; } - int r = adisjoint_tcbuffer_geo(tcb_inst, target_gs); - free(tcb_inst); - free(target_gs); - return r > 0 ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + if (!(lonValue >= -180.0 && lonValue <= 180.0 && latValue >= -90.0 && latValue <= 90.0)) return 0; + if (radiusValue < 0.0) return 0; + + const std::string timestampString = MEOS::Meos::convertEpochToTimestamp(timestampValue); + std::string tcbufferWkt = fmt::format("Cbuffer(Point({} {}),{})@{}", + lonValue, latValue, radiusValue, timestampString); + std::string staticGeometryWkt(geometryPtr, geometrySize); + + while (!staticGeometryWkt.empty() && (staticGeometryWkt.front() == '\'' || staticGeometryWkt.front() == '"')) + staticGeometryWkt.erase(staticGeometryWkt.begin()); + while (!staticGeometryWkt.empty() && (staticGeometryWkt.back() == '\'' || staticGeometryWkt.back() == '"')) + staticGeometryWkt.pop_back(); + + if (tcbufferWkt.empty() || staticGeometryWkt.empty()) return 0; + + Temporal* tcbuffer = tcbuffer_in(tcbufferWkt.c_str()); + if (!tcbuffer) return 0; + MEOS::Meos::StaticGeometry staticGeometry(staticGeometryWkt); + if (!staticGeometry.getGeometry()) { free(tcbuffer); return 0; } + + int r = adisjoint_tcbuffer_geo(tcbuffer, staticGeometry.getGeometry()); + free(tcbuffer); + return r; + } + catch (const std::exception&) + { + return 0; + } }, - lon, lat, radius, ts, wkt); + lon, lat, radius, timestamp, geometry.getContent(), geometry.getContentSize()); return VarVal(result); } @@ -94,11 +114,12 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterA PRECONDITION(arguments.childFunctions.size() == 5, "AdisjointTcbufferGeoPhysicalFunction requires 5 children but got {}", arguments.childFunctions.size()); - return AdisjointTcbufferGeoPhysicalFunction(std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2]), - std::move(arguments.childFunctions[3]), - std::move(arguments.childFunctions[4])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + return AdisjointTcbufferGeoPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AdisjointTcbufferTcbufferPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AdisjointTcbufferTcbufferPhysicalFunction.cpp index 99b5187524..8ace07c0ca 100644 --- a/nes-physical-operators/src/Functions/Meos/AdisjointTcbufferTcbufferPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/AdisjointTcbufferTcbufferPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -20,75 +21,88 @@ #include #include #include +#include #include +#include #include #include -#include -#include extern "C" { #include -#include #include } namespace NES { -AdisjointTcbufferTcbufferPhysicalFunction::AdisjointTcbufferTcbufferPhysicalFunction( - PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction r1, PhysicalFunction ts1, - PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction r2, PhysicalFunction ts2) +AdisjointTcbufferTcbufferPhysicalFunction::AdisjointTcbufferTcbufferPhysicalFunction(PhysicalFunction lonAFunction, + PhysicalFunction latAFunction, + PhysicalFunction radiusAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction lonBFunction, + PhysicalFunction latBFunction, + PhysicalFunction radiusBFunction, + PhysicalFunction tsBFunction) { - paramFns.reserve(8); - paramFns.push_back(std::move(lon1)); - paramFns.push_back(std::move(lat1)); - paramFns.push_back(std::move(r1)); - paramFns.push_back(std::move(ts1)); - paramFns.push_back(std::move(lon2)); - paramFns.push_back(std::move(lat2)); - paramFns.push_back(std::move(r2)); - paramFns.push_back(std::move(ts2)); + parameterFunctions.reserve(8); + parameterFunctions.push_back(std::move(lonAFunction)); + parameterFunctions.push_back(std::move(latAFunction)); + parameterFunctions.push_back(std::move(radiusAFunction)); + parameterFunctions.push_back(std::move(tsAFunction)); + parameterFunctions.push_back(std::move(lonBFunction)); + parameterFunctions.push_back(std::move(latBFunction)); + parameterFunctions.push_back(std::move(radiusBFunction)); + parameterFunctions.push_back(std::move(tsBFunction)); } VarVal AdisjointTcbufferTcbufferPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto lon1 = paramFns[0].execute(record, arena).cast(); - auto lat1 = paramFns[1].execute(record, arena).cast(); - auto r1 = paramFns[2].execute(record, arena).cast(); - auto ts1 = paramFns[3].execute(record, arena).cast(); - auto lon2 = paramFns[4].execute(record, arena).cast(); - auto lat2 = paramFns[5].execute(record, arena).cast(); - auto r2 = paramFns[6].execute(record, arena).cast(); - auto ts2 = paramFns[7].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto lonA = parameterValues[0].cast>(); + auto latA = parameterValues[1].cast>(); + auto radiusA = parameterValues[2].cast>(); + auto tsA = parameterValues[3].cast>(); + auto lonB = parameterValues[4].cast>(); + auto latB = parameterValues[5].cast>(); + auto radiusB = parameterValues[6].cast>(); + auto tsB = parameterValues[7].cast>(); const auto result = nautilus::invoke( - +[](double lon1, double lat1, double r1, uint64_t ts1, - double lon2, double lat2, double r2, uint64_t ts2) -> double { - try { + +[](double lonAValue, double latAValue, double radiusAValue, uint64_t tsAValue, + double lonBValue, double latBValue, double radiusBValue, uint64_t tsBValue) -> int { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string pt1 = fmt::format("POINT({} {})", lon1, lat1); - GSERIALIZED* gs1 = geom_in(pt1.c_str(), -1); - if (!gs1) return 0.0; - Cbuffer* cb1 = cbuffer_make(gs1, r1); - free(gs1); - if (!cb1) return 0.0; - Temporal* tcb1 = (Temporal*)tcbufferinst_make(cb1, (TimestampTz)ts1); - free(cb1); - if (!tcb1) return 0.0; - std::string pt2 = fmt::format("POINT({} {})", lon2, lat2); - GSERIALIZED* gs2 = geom_in(pt2.c_str(), -1); - if (!gs2) { free(tcb1); return 0.0; } - Cbuffer* cb2 = cbuffer_make(gs2, r2); - free(gs2); - if (!cb2) { free(tcb1); return 0.0; } - Temporal* tcb2 = (Temporal*)tcbufferinst_make(cb2, (TimestampTz)ts2); - free(cb2); - if (!tcb2) { free(tcb1); return 0.0; } - int r = adisjoint_tcbuffer_tcbuffer(tcb1, tcb2); - free(tcb1); free(tcb2); - return r > 0 ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + if (!(lonAValue >= -180.0 && lonAValue <= 180.0 && latAValue >= -90.0 && latAValue <= 90.0)) return 0; + if (!(lonBValue >= -180.0 && lonBValue <= 180.0 && latBValue >= -90.0 && latBValue <= 90.0)) return 0; + if (radiusAValue < 0.0 || radiusBValue < 0.0) return 0; + + const std::string tsAString = MEOS::Meos::convertEpochToTimestamp(tsAValue); + const std::string tsBString = MEOS::Meos::convertEpochToTimestamp(tsBValue); + std::string wktA = fmt::format("Cbuffer(Point({} {}),{})@{}", lonAValue, latAValue, radiusAValue, tsAString); + std::string wktB = fmt::format("Cbuffer(Point({} {}),{})@{}", lonBValue, latBValue, radiusBValue, tsBString); + + Temporal* tA = tcbuffer_in(wktA.c_str()); + if (!tA) return 0; + Temporal* tB = tcbuffer_in(wktB.c_str()); + if (!tB) { free(tA); return 0; } + + int r = adisjoint_tcbuffer_tcbuffer(tA, tB); + free(tA); + free(tB); + return r; + } + catch (const std::exception&) + { + return 0; + } }, - lon1, lat1, r1, ts1, lon2, lat2, r2, ts2); + lonA, latA, radiusA, tsA, lonB, latB, radiusB, tsB); return VarVal(result); } @@ -99,14 +113,15 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterA PRECONDITION(arguments.childFunctions.size() == 8, "AdisjointTcbufferTcbufferPhysicalFunction requires 8 children but got {}", arguments.childFunctions.size()); - return AdisjointTcbufferTcbufferPhysicalFunction(std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2]), - std::move(arguments.childFunctions[3]), - std::move(arguments.childFunctions[4]), - std::move(arguments.childFunctions[5]), - std::move(arguments.childFunctions[6]), - std::move(arguments.childFunctions[7])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + auto arg5 = std::move(arguments.childFunctions[5]); + auto arg6 = std::move(arguments.childFunctions[6]); + auto arg7 = std::move(arguments.childFunctions[7]); + return AdisjointTcbufferTcbufferPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6), std::move(arg7)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AdisjointTgeoGeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AdisjointTgeoGeoPhysicalFunction.cpp index 0f63cbf5d2..729442f8e6 100644 --- a/nes-physical-operators/src/Functions/Meos/AdisjointTgeoGeoPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/AdisjointTgeoGeoPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -34,40 +35,75 @@ extern "C" { namespace NES { -AdisjointTgeoGeoPhysicalFunction::AdisjointTgeoGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, - PhysicalFunction ts, PhysicalFunction wkt) +AdisjointTgeoGeoPhysicalFunction::AdisjointTgeoGeoPhysicalFunction(PhysicalFunction lonFunction, + PhysicalFunction latFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction) { - paramFns.reserve(4); - paramFns.push_back(std::move(lon)); - paramFns.push_back(std::move(lat)); - paramFns.push_back(std::move(ts)); - paramFns.push_back(std::move(wkt)); + parameterFunctions.reserve(4); + parameterFunctions.push_back(std::move(lonFunction)); + parameterFunctions.push_back(std::move(latFunction)); + parameterFunctions.push_back(std::move(timestampFunction)); + parameterFunctions.push_back(std::move(geometryFunction)); } VarVal AdisjointTgeoGeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto lon = paramFns[0].execute(record, arena).cast(); - auto lat = paramFns[1].execute(record, arena).cast(); - auto ts = paramFns[2].execute(record, arena).cast(); - auto wkt = paramFns[3].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto lon = parameterValues[0].cast>(); + auto lat = parameterValues[1].cast>(); + auto timestamp = parameterValues[2].cast>(); + auto geometry = parameterValues[3].cast(); const auto result = nautilus::invoke( - +[](double lon, double lat, uint64_t ts, - const char* w, uint32_t wsz) -> double { - try { + +[](double lonValue, + double latValue, + uint64_t timestampValue, + const char* geometryPtr, + uint32_t geometrySize) -> int { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string wktStr(w, wsz); - std::string tgeoWkt = fmt::format("SRID=4326;POINT({},{})@{}", lon, lat, ts); - Temporal* tgeo = tgeompoint_in(tgeoWkt.c_str()); - if (!tgeo) return 0.0; - GSERIALIZED* gs = geom_in(wktStr.c_str(), -1); - if (!gs) { free(tgeo); return 0.0; } - int r = adisjoint_tgeo_geo(tgeo, gs); - free(tgeo); free(gs); - return r > 0 ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + if (!(lonValue >= -180.0 && lonValue <= 180.0 && latValue >= -90.0 && latValue <= 90.0)) { + return 0; + } + + const std::string timestampString = MEOS::Meos::convertEpochToTimestamp(timestampValue); + std::string temporalGeometryWkt = fmt::format("SRID=4326;Point({} {})@{}", lonValue, latValue, timestampString); + std::string staticGeometryWkt(geometryPtr, geometrySize); + + while (!staticGeometryWkt.empty() && (staticGeometryWkt.front() == '\'' || staticGeometryWkt.front() == '"')) + staticGeometryWkt.erase(staticGeometryWkt.begin()); + while (!staticGeometryWkt.empty() && (staticGeometryWkt.back() == '\'' || staticGeometryWkt.back() == '"')) + staticGeometryWkt.pop_back(); + + if (temporalGeometryWkt.empty() || staticGeometryWkt.empty()) + return 0; + + MEOS::Meos::TemporalGeometry temporalGeometry(temporalGeometryWkt); + if (!temporalGeometry.getGeometry()) return 0; + MEOS::Meos::StaticGeometry staticGeometry(staticGeometryWkt); + if (!staticGeometry.getGeometry()) return 0; + + // MEOS spatial-relation call — same shape as TemporalEDWithin's + // edwithin_tgeo_geo, but specific MEOS function per generated operator. + // Real MEOS spatial-rel signature: int fn(const Temporal *, const GSERIALIZED *) + // (no `atstart` flag — that's specific to geog_dwithin / edwithin's 3-arg variant). + return adisjoint_tgeo_geo(temporalGeometry.getGeometry(), + staticGeometry.getGeometry()); + } + catch (const std::exception&) + { + return 0; + } }, - lon, lat, ts, wkt); + lon, lat, timestamp, geometry.getContent(), geometry.getContentSize()); return VarVal(result); } @@ -78,10 +114,11 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterA PRECONDITION(arguments.childFunctions.size() == 4, "AdisjointTgeoGeoPhysicalFunction requires 4 children but got {}", arguments.childFunctions.size()); - return AdisjointTgeoGeoPhysicalFunction(std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2]), - std::move(arguments.childFunctions[3])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + return AdisjointTgeoGeoPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AdisjointTgeoTgeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AdisjointTgeoTgeoPhysicalFunction.cpp index aeba15bf79..662688b0a5 100644 --- a/nes-physical-operators/src/Functions/Meos/AdisjointTgeoTgeoPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/AdisjointTgeoTgeoPhysicalFunction.cpp @@ -13,10 +13,10 @@ */ #include + #include #include #include -#include #include #include #include @@ -34,42 +34,68 @@ extern "C" { namespace NES { -AdisjointTgeoTgeoPhysicalFunction::AdisjointTgeoTgeoPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction ts1, PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction ts2) +AdisjointTgeoTgeoPhysicalFunction::AdisjointTgeoTgeoPhysicalFunction(PhysicalFunction lonAFunction, + PhysicalFunction latAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction lonBFunction, + PhysicalFunction latBFunction, + PhysicalFunction tsBFunction) { - paramFns.reserve(6); - paramFns.push_back(std::move(lon1)); - paramFns.push_back(std::move(lat1)); - paramFns.push_back(std::move(ts1)); - paramFns.push_back(std::move(lon2)); - paramFns.push_back(std::move(lat2)); - paramFns.push_back(std::move(ts2)); + parameterFunctions.reserve(6); + parameterFunctions.push_back(std::move(lonAFunction)); + parameterFunctions.push_back(std::move(latAFunction)); + parameterFunctions.push_back(std::move(tsAFunction)); + parameterFunctions.push_back(std::move(lonBFunction)); + parameterFunctions.push_back(std::move(latBFunction)); + parameterFunctions.push_back(std::move(tsBFunction)); } VarVal AdisjointTgeoTgeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto lon1 = paramFns[0].execute(record, arena).cast(); - auto lat1 = paramFns[1].execute(record, arena).cast(); - auto ts1 = paramFns[2].execute(record, arena).cast(); - auto lon2 = paramFns[3].execute(record, arena).cast(); - auto lat2 = paramFns[4].execute(record, arena).cast(); - auto ts2 = paramFns[5].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto lonA = parameterValues[0].cast>(); + auto latA = parameterValues[1].cast>(); + auto tsA = parameterValues[2].cast>(); + auto lonB = parameterValues[3].cast>(); + auto latB = parameterValues[4].cast>(); + auto tsB = parameterValues[5].cast>(); + const auto result = nautilus::invoke( - +[](double lon1, double lat1, uint64_t ts1, - double lon2, double lat2, uint64_t ts2) -> double { - try { + +[](double lonAValue, double latAValue, uint64_t tsAValue, + double lonBValue, double latBValue, uint64_t tsBValue) -> int { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string wkt1 = fmt::format("SRID=4326;POINT({},{})@{}", lon1, lat1, ts1); - Temporal* t1 = tgeompoint_in(wkt1.c_str()); - if (!t1) return 0.0; - std::string wkt2 = fmt::format("SRID=4326;POINT({},{})@{}", lon2, lat2, ts2); - Temporal* t2 = tgeompoint_in(wkt2.c_str()); - if (!t2) { free(t1); return 0.0; } - int r = adisjoint_tgeo_tgeo(t1, t2); - free(t1); free(t2); - return r > 0 ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + if (!(lonAValue >= -180.0 && lonAValue <= 180.0 && latAValue >= -90.0 && latAValue <= 90.0)) return 0; + if (!(lonBValue >= -180.0 && lonBValue <= 180.0 && latBValue >= -90.0 && latBValue <= 90.0)) return 0; + + const std::string tsAString = MEOS::Meos::convertEpochToTimestamp(tsAValue); + const std::string tsBString = MEOS::Meos::convertEpochToTimestamp(tsBValue); + std::string temporalGeometryAWkt = fmt::format("SRID=4326;Point({} {})@{}", lonAValue, latAValue, tsAString); + std::string temporalGeometryBWkt = fmt::format("SRID=4326;Point({} {})@{}", lonBValue, latBValue, tsBString); + + MEOS::Meos::TemporalGeometry temporalGeometryA(temporalGeometryAWkt); + if (!temporalGeometryA.getGeometry()) return 0; + MEOS::Meos::TemporalGeometry temporalGeometryB(temporalGeometryBWkt); + if (!temporalGeometryB.getGeometry()) return 0; + + // MEOS *_tgeo_tgeo spatial-relation: int fn(const Temporal*, const Temporal*). + return adisjoint_tgeo_tgeo(temporalGeometryA.getGeometry(), + temporalGeometryB.getGeometry()); + } + catch (const std::exception&) + { + return 0; + } }, - lon1, lat1, ts1, lon2, lat2, ts2); + lonA, latA, tsA, lonB, latB, tsB); + return VarVal(result); } @@ -79,13 +105,13 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterA PRECONDITION(arguments.childFunctions.size() == 6, "AdisjointTgeoTgeoPhysicalFunction requires 6 children but got {}", arguments.childFunctions.size()); - return AdisjointTgeoTgeoPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2]), - std::move(arguments.childFunctions[3]), - std::move(arguments.childFunctions[4]), - std::move(arguments.childFunctions[5])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + auto arg5 = std::move(arguments.childFunctions[5]); + return AdisjointTgeoTgeoPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AdisjointTrgeometryGeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AdisjointTrgeometryGeoPhysicalFunction.cpp new file mode 100644 index 0000000000..342218783b --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AdisjointTrgeometryGeoPhysicalFunction.cpp @@ -0,0 +1,97 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +#include +} + +namespace NES { + +AdisjointTrgeometryGeoPhysicalFunction::AdisjointTrgeometryGeoPhysicalFunction(PhysicalFunction ref_wkt, PhysicalFunction x1, PhysicalFunction y1, PhysicalFunction theta1, PhysicalFunction ts1, PhysicalFunction tgt_wkt) { + paramFns.reserve(6); + paramFns.push_back(std::move(ref_wkt)); + paramFns.push_back(std::move(x1)); + paramFns.push_back(std::move(y1)); + paramFns.push_back(std::move(theta1)); + paramFns.push_back(std::move(ts1)); + paramFns.push_back(std::move(tgt_wkt)); +} + +VarVal AdisjointTrgeometryGeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { + auto ref_wkt = paramFns[0].execute(record, arena).cast(); + auto x1 = paramFns[1].execute(record, arena).cast(); + auto y1 = paramFns[2].execute(record, arena).cast(); + auto theta1 = paramFns[3].execute(record, arena).cast(); + auto ts1 = paramFns[4].execute(record, arena).cast(); + auto tgt_wkt = paramFns[5].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](const char* ref_wkt, uint32_t ref_wktsz, double x1, double y1, double theta1, uint64_t ts1, const char* tgt_wkt, uint32_t tgt_wktsz) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + char* ref1_str = (char*)malloc(ref_wktsz + 1); + memcpy(ref1_str, ref_wkt, ref_wktsz); ref1_str[ref_wktsz] = '\0'; + GSERIALIZED* gref1 = geom_in(ref1_str, -1); free(ref1_str); + if (!gref1) return 0.0; + Pose* pose1 = pose_make_2d(x1, y1, theta1, false, 0); + if (!pose1) { free(gref1); return 0.0; } + TInstant* inst1 = trgeometryinst_make(gref1, pose1, (TimestampTz)ts1); + free(gref1); free(pose1); + if (!inst1) return 0.0; + char* tgt_str = (char*)malloc(tgt_wktsz + 1); + memcpy(tgt_str, tgt_wkt, tgt_wktsz); tgt_str[tgt_wktsz] = '\0'; + GSERIALIZED* gs_tgt = geom_in(tgt_str, -1); free(tgt_str); + if (!gs_tgt) { free(inst1); return 0.0; } + int r = adisjoint_trgeometry_geo((Temporal*)inst1, gs_tgt); + free(inst1); free(gs_tgt); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + ref_wkt, x1, y1, theta1, ts1, tgt_wkt); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAdisjointTrgeometryGeoPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size()==6, + "AdisjointTrgeometryGeoPhysicalFunction requires 6 children but got {}", + arguments.childFunctions.size()); + return AdisjointTrgeometryGeoPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4]), + std::move(arguments.childFunctions[5])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AdisjointTrgeometryTrgeometryPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AdisjointTrgeometryTrgeometryPhysicalFunction.cpp new file mode 100644 index 0000000000..af768b2ebd --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AdisjointTrgeometryTrgeometryPhysicalFunction.cpp @@ -0,0 +1,114 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +#include +} + +namespace NES { + +AdisjointTrgeometryTrgeometryPhysicalFunction::AdisjointTrgeometryTrgeometryPhysicalFunction(PhysicalFunction ref1_wkt, PhysicalFunction x1, PhysicalFunction y1, PhysicalFunction theta1, PhysicalFunction ts1, PhysicalFunction ref2_wkt, PhysicalFunction x2, PhysicalFunction y2, PhysicalFunction theta2, PhysicalFunction ts2) { + paramFns.reserve(10); + paramFns.push_back(std::move(ref1_wkt)); + paramFns.push_back(std::move(x1)); + paramFns.push_back(std::move(y1)); + paramFns.push_back(std::move(theta1)); + paramFns.push_back(std::move(ts1)); + paramFns.push_back(std::move(ref2_wkt)); + paramFns.push_back(std::move(x2)); + paramFns.push_back(std::move(y2)); + paramFns.push_back(std::move(theta2)); + paramFns.push_back(std::move(ts2)); +} + +VarVal AdisjointTrgeometryTrgeometryPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { + auto ref1_wkt = paramFns[0].execute(record, arena).cast(); + auto x1 = paramFns[1].execute(record, arena).cast(); + auto y1 = paramFns[2].execute(record, arena).cast(); + auto theta1 = paramFns[3].execute(record, arena).cast(); + auto ts1 = paramFns[4].execute(record, arena).cast(); + auto ref2_wkt = paramFns[5].execute(record, arena).cast(); + auto x2 = paramFns[6].execute(record, arena).cast(); + auto y2 = paramFns[7].execute(record, arena).cast(); + auto theta2 = paramFns[8].execute(record, arena).cast(); + auto ts2 = paramFns[9].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](const char* ref1_wkt, uint32_t ref1_wktsz, double x1, double y1, double theta1, uint64_t ts1, const char* ref2_wkt, uint32_t ref2_wktsz, double x2, double y2, double theta2, uint64_t ts2) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + char* ref1_str = (char*)malloc(ref1_wktsz + 1); + memcpy(ref1_str, ref1_wkt, ref1_wktsz); ref1_str[ref1_wktsz] = '\0'; + GSERIALIZED* gref1 = geom_in(ref1_str, -1); free(ref1_str); + if (!gref1) return 0.0; + Pose* pose1 = pose_make_2d(x1, y1, theta1, false, 0); + if (!pose1) { free(gref1); return 0.0; } + TInstant* inst1 = trgeometryinst_make(gref1, pose1, (TimestampTz)ts1); + free(gref1); free(pose1); + if (!inst1) return 0.0; + char* ref2_str = (char*)malloc(ref2_wktsz + 1); + memcpy(ref2_str, ref2_wkt, ref2_wktsz); ref2_str[ref2_wktsz] = '\0'; + GSERIALIZED* gref2 = geom_in(ref2_str, -1); free(ref2_str); + if (!gref2) return 0.0; + Pose* pose2 = pose_make_2d(x2, y2, theta2, false, 0); + if (!pose2) { free(gref2); return 0.0; } + TInstant* inst2 = trgeometryinst_make(gref2, pose2, (TimestampTz)ts2); + free(gref2); free(pose2); + if (!inst2) { free(inst1); return 0.0; } + int r = adisjoint_trgeometry_trgeometry((Temporal*)inst1, (Temporal*)inst2); + free(inst1); free(inst2); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + ref1_wkt, x1, y1, theta1, ts1, ref2_wkt, x2, y2, theta2, ts2); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAdisjointTrgeometryTrgeometryPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size()==10, + "AdisjointTrgeometryTrgeometryPhysicalFunction requires 10 children but got {}", + arguments.childFunctions.size()); + return AdisjointTrgeometryTrgeometryPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4]), + std::move(arguments.childFunctions[5]), + std::move(arguments.childFunctions[6]), + std::move(arguments.childFunctions[7]), + std::move(arguments.childFunctions[8]), + std::move(arguments.childFunctions[9])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AdwithinTcbufferCbufferPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AdwithinTcbufferCbufferPhysicalFunction.cpp new file mode 100644 index 0000000000..3f1516802f --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AdwithinTcbufferCbufferPhysicalFunction.cpp @@ -0,0 +1,126 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +AdwithinTcbufferCbufferPhysicalFunction::AdwithinTcbufferCbufferPhysicalFunction(PhysicalFunction lonFunction, + PhysicalFunction latFunction, + PhysicalFunction radiusFunction, + PhysicalFunction timestampFunction, + PhysicalFunction cbufLitFunction, + PhysicalFunction distFunction) +{ + parameterFunctions.reserve(6); + parameterFunctions.push_back(std::move(lonFunction)); + parameterFunctions.push_back(std::move(latFunction)); + parameterFunctions.push_back(std::move(radiusFunction)); + parameterFunctions.push_back(std::move(timestampFunction)); + parameterFunctions.push_back(std::move(cbufLitFunction)); + parameterFunctions.push_back(std::move(distFunction)); +} + +VarVal AdwithinTcbufferCbufferPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto lon = parameterValues[0].cast>(); + auto lat = parameterValues[1].cast>(); + auto radius = parameterValues[2].cast>(); + auto timestamp = parameterValues[3].cast>(); + auto cbufLit = parameterValues[4].cast(); + auto dist = parameterValues[5].cast>(); + + const auto result = nautilus::invoke( + +[](double lonValue, double latValue, double radiusValue, uint64_t timestampValue, + const char* cbufLitPtr, uint32_t cbufLitSize, double distValue) -> int { + try + { + MEOS::Meos::ensureMeosInitialized(); + if (!(lonValue >= -180.0 && lonValue <= 180.0 && latValue >= -90.0 && latValue <= 90.0)) return 0; + if (radiusValue < 0.0) return 0; + + const std::string timestampString = MEOS::Meos::convertEpochToTimestamp(timestampValue); + std::string tcbufferWkt = fmt::format("Cbuffer(Point({} {}),{})@{}", + lonValue, latValue, radiusValue, timestampString); + std::string cbufferLiteral(cbufLitPtr, cbufLitSize); + + while (!cbufferLiteral.empty() && (cbufferLiteral.front() == '\'' || cbufferLiteral.front() == '"')) + cbufferLiteral.erase(cbufferLiteral.begin()); + while (!cbufferLiteral.empty() && (cbufferLiteral.back() == '\'' || cbufferLiteral.back() == '"')) + cbufferLiteral.pop_back(); + + if (tcbufferWkt.empty() || cbufferLiteral.empty()) return 0; + + Temporal* tcbuffer = tcbuffer_in(tcbufferWkt.c_str()); + if (!tcbuffer) return 0; + Cbuffer* cb = cbuffer_in(cbufferLiteral.c_str()); + if (!cb) { free(tcbuffer); return 0; } + + int r = adwithin_tcbuffer_cbuffer(tcbuffer, cb, distValue); + free(tcbuffer); + free(cb); + return r; + } + catch (const std::exception&) + { + return 0; + } + }, + lon, lat, radius, timestamp, cbufLit.getContent(), cbufLit.getContentSize(), dist); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAdwithinTcbufferCbufferPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 6, + "AdwithinTcbufferCbufferPhysicalFunction requires 6 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + auto arg5 = std::move(arguments.childFunctions[5]); + return AdwithinTcbufferCbufferPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AdwithinTcbufferGeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AdwithinTcbufferGeoPhysicalFunction.cpp index f49454910a..64b9a7bc94 100644 --- a/nes-physical-operators/src/Functions/Meos/AdwithinTcbufferGeoPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/AdwithinTcbufferGeoPhysicalFunction.cpp @@ -13,79 +13,96 @@ */ #include + #include #include #include +#include #include #include #include #include +#include #include +#include #include #include -#include -#include -#include extern "C" { #include -#include #include } namespace NES { -AdwithinTcbufferGeoPhysicalFunction::AdwithinTcbufferGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, - PhysicalFunction radius, PhysicalFunction ts, - PhysicalFunction wkt, PhysicalFunction dist) +AdwithinTcbufferGeoPhysicalFunction::AdwithinTcbufferGeoPhysicalFunction(PhysicalFunction lonFunction, + PhysicalFunction latFunction, + PhysicalFunction radiusFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction, + PhysicalFunction distFunction) { - paramFns.reserve(6); - paramFns.push_back(std::move(lon)); - paramFns.push_back(std::move(lat)); - paramFns.push_back(std::move(radius)); - paramFns.push_back(std::move(ts)); - paramFns.push_back(std::move(wkt)); - paramFns.push_back(std::move(dist)); + parameterFunctions.reserve(6); + parameterFunctions.push_back(std::move(lonFunction)); + parameterFunctions.push_back(std::move(latFunction)); + parameterFunctions.push_back(std::move(radiusFunction)); + parameterFunctions.push_back(std::move(timestampFunction)); + parameterFunctions.push_back(std::move(geometryFunction)); + parameterFunctions.push_back(std::move(distFunction)); } VarVal AdwithinTcbufferGeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto lon = paramFns[0].execute(record, arena).cast(); - auto lat = paramFns[1].execute(record, arena).cast(); - auto radius = paramFns[2].execute(record, arena).cast(); - auto ts = paramFns[3].execute(record, arena).cast(); - auto wkt = paramFns[4].execute(record, arena); - auto dist = paramFns[5].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto lon = parameterValues[0].cast>(); + auto lat = parameterValues[1].cast>(); + auto radius = parameterValues[2].cast>(); + auto timestamp = parameterValues[3].cast>(); + auto geometry = parameterValues[4].cast(); + auto dist = parameterValues[5].cast>(); const auto result = nautilus::invoke( - +[](double lon, double lat, double radius, uint64_t ts, - const char* wkt, uint32_t wkt_len, double dist) -> double { - try { + +[](double lonValue, double latValue, double radiusValue, uint64_t timestampValue, + const char* geometryPtr, uint32_t geometrySize, double distValue) -> int { + try + { MEOS::Meos::ensureMeosInitialized(); - // Build tcbuffer instant from lon/lat/radius/ts - std::string pt_str = fmt::format("POINT({} {})", lon, lat); - GSERIALIZED* pt_gs = geom_in(pt_str.c_str(), -1); - if (!pt_gs) return 0.0; - Cbuffer* cb = cbuffer_make(pt_gs, radius); - free(pt_gs); - if (!cb) return 0.0; - Temporal* tcb_inst = (Temporal*)tcbufferinst_make(cb, (TimestampTz)ts); - free(cb); - if (!tcb_inst) return 0.0; - // Build target geometry from null-terminated WKT copy - char* wkt_str = (char*)malloc(wkt_len + 1); - memcpy(wkt_str, wkt, wkt_len); - wkt_str[wkt_len] = '\0'; - GSERIALIZED* target_gs = geom_in(wkt_str, -1); - free(wkt_str); - if (!target_gs) { free(tcb_inst); return 0.0; } - int r = adwithin_tcbuffer_geo(tcb_inst, target_gs, dist); - free(tcb_inst); - free(target_gs); - return r > 0 ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + if (!(lonValue >= -180.0 && lonValue <= 180.0 && latValue >= -90.0 && latValue <= 90.0)) return 0; + if (radiusValue < 0.0) return 0; + + const std::string timestampString = MEOS::Meos::convertEpochToTimestamp(timestampValue); + std::string tcbufferWkt = fmt::format("Cbuffer(Point({} {}),{})@{}", + lonValue, latValue, radiusValue, timestampString); + std::string staticGeometryWkt(geometryPtr, geometrySize); + + while (!staticGeometryWkt.empty() && (staticGeometryWkt.front() == '\'' || staticGeometryWkt.front() == '"')) + staticGeometryWkt.erase(staticGeometryWkt.begin()); + while (!staticGeometryWkt.empty() && (staticGeometryWkt.back() == '\'' || staticGeometryWkt.back() == '"')) + staticGeometryWkt.pop_back(); + + if (tcbufferWkt.empty() || staticGeometryWkt.empty()) return 0; + + Temporal* tcbuffer = tcbuffer_in(tcbufferWkt.c_str()); + if (!tcbuffer) return 0; + MEOS::Meos::StaticGeometry staticGeometry(staticGeometryWkt); + if (!staticGeometry.getGeometry()) { free(tcbuffer); return 0; } + + int r = adwithin_tcbuffer_geo(tcbuffer, staticGeometry.getGeometry(), distValue); + free(tcbuffer); + return r; + } + catch (const std::exception&) + { + return 0; + } }, - lon, lat, radius, ts, wkt, dist); + lon, lat, radius, timestamp, geometry.getContent(), geometry.getContentSize(), dist); return VarVal(result); } @@ -96,12 +113,13 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterA PRECONDITION(arguments.childFunctions.size() == 6, "AdwithinTcbufferGeoPhysicalFunction requires 6 children but got {}", arguments.childFunctions.size()); - return AdwithinTcbufferGeoPhysicalFunction(std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2]), - std::move(arguments.childFunctions[3]), - std::move(arguments.childFunctions[4]), - std::move(arguments.childFunctions[5])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + auto arg5 = std::move(arguments.childFunctions[5]); + return AdwithinTcbufferGeoPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AdwithinTcbufferTcbufferPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AdwithinTcbufferTcbufferPhysicalFunction.cpp index 36a331f03f..12ce674b14 100644 --- a/nes-physical-operators/src/Functions/Meos/AdwithinTcbufferTcbufferPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/AdwithinTcbufferTcbufferPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -20,79 +21,92 @@ #include #include #include +#include #include +#include #include #include -#include -#include extern "C" { #include -#include #include } namespace NES { -AdwithinTcbufferTcbufferPhysicalFunction::AdwithinTcbufferTcbufferPhysicalFunction( - PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction r1, PhysicalFunction ts1, - PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction r2, PhysicalFunction ts2, - PhysicalFunction dist) +AdwithinTcbufferTcbufferPhysicalFunction::AdwithinTcbufferTcbufferPhysicalFunction(PhysicalFunction lonAFunction, + PhysicalFunction latAFunction, + PhysicalFunction radiusAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction lonBFunction, + PhysicalFunction latBFunction, + PhysicalFunction radiusBFunction, + PhysicalFunction tsBFunction, + PhysicalFunction distFunction) { - paramFns.reserve(9); - paramFns.push_back(std::move(lon1)); - paramFns.push_back(std::move(lat1)); - paramFns.push_back(std::move(r1)); - paramFns.push_back(std::move(ts1)); - paramFns.push_back(std::move(lon2)); - paramFns.push_back(std::move(lat2)); - paramFns.push_back(std::move(r2)); - paramFns.push_back(std::move(ts2)); - paramFns.push_back(std::move(dist)); + parameterFunctions.reserve(9); + parameterFunctions.push_back(std::move(lonAFunction)); + parameterFunctions.push_back(std::move(latAFunction)); + parameterFunctions.push_back(std::move(radiusAFunction)); + parameterFunctions.push_back(std::move(tsAFunction)); + parameterFunctions.push_back(std::move(lonBFunction)); + parameterFunctions.push_back(std::move(latBFunction)); + parameterFunctions.push_back(std::move(radiusBFunction)); + parameterFunctions.push_back(std::move(tsBFunction)); + parameterFunctions.push_back(std::move(distFunction)); } VarVal AdwithinTcbufferTcbufferPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto lon1 = paramFns[0].execute(record, arena).cast(); - auto lat1 = paramFns[1].execute(record, arena).cast(); - auto r1 = paramFns[2].execute(record, arena).cast(); - auto ts1 = paramFns[3].execute(record, arena).cast(); - auto lon2 = paramFns[4].execute(record, arena).cast(); - auto lat2 = paramFns[5].execute(record, arena).cast(); - auto r2 = paramFns[6].execute(record, arena).cast(); - auto ts2 = paramFns[7].execute(record, arena).cast(); - auto dist = paramFns[8].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto lonA = parameterValues[0].cast>(); + auto latA = parameterValues[1].cast>(); + auto radiusA = parameterValues[2].cast>(); + auto tsA = parameterValues[3].cast>(); + auto lonB = parameterValues[4].cast>(); + auto latB = parameterValues[5].cast>(); + auto radiusB = parameterValues[6].cast>(); + auto tsB = parameterValues[7].cast>(); + auto dist = parameterValues[8].cast>(); const auto result = nautilus::invoke( - +[](double lon1, double lat1, double r1, uint64_t ts1, - double lon2, double lat2, double r2, uint64_t ts2, - double dist) -> double { - try { + +[](double lonAValue, double latAValue, double radiusAValue, uint64_t tsAValue, + double lonBValue, double latBValue, double radiusBValue, uint64_t tsBValue, + double distValue) -> int { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string pt1 = fmt::format("POINT({} {})", lon1, lat1); - GSERIALIZED* gs1 = geom_in(pt1.c_str(), -1); - if (!gs1) return 0.0; - Cbuffer* cb1 = cbuffer_make(gs1, r1); - free(gs1); - if (!cb1) return 0.0; - Temporal* tcb1 = (Temporal*)tcbufferinst_make(cb1, (TimestampTz)ts1); - free(cb1); - if (!tcb1) return 0.0; - std::string pt2 = fmt::format("POINT({} {})", lon2, lat2); - GSERIALIZED* gs2 = geom_in(pt2.c_str(), -1); - if (!gs2) { free(tcb1); return 0.0; } - Cbuffer* cb2 = cbuffer_make(gs2, r2); - free(gs2); - if (!cb2) { free(tcb1); return 0.0; } - Temporal* tcb2 = (Temporal*)tcbufferinst_make(cb2, (TimestampTz)ts2); - free(cb2); - if (!tcb2) { free(tcb1); return 0.0; } - int r = adwithin_tcbuffer_tcbuffer(tcb1, tcb2, dist); - free(tcb1); free(tcb2); - return r > 0 ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + if (!(lonAValue >= -180.0 && lonAValue <= 180.0 && latAValue >= -90.0 && latAValue <= 90.0)) return 0; + if (!(lonBValue >= -180.0 && lonBValue <= 180.0 && latBValue >= -90.0 && latBValue <= 90.0)) return 0; + if (radiusAValue < 0.0 || radiusBValue < 0.0) return 0; + + const std::string tsAString = MEOS::Meos::convertEpochToTimestamp(tsAValue); + const std::string tsBString = MEOS::Meos::convertEpochToTimestamp(tsBValue); + std::string wktA = fmt::format("Cbuffer(Point({} {}),{})@{}", lonAValue, latAValue, radiusAValue, tsAString); + std::string wktB = fmt::format("Cbuffer(Point({} {}),{})@{}", lonBValue, latBValue, radiusBValue, tsBString); + + Temporal* tA = tcbuffer_in(wktA.c_str()); + if (!tA) return 0; + Temporal* tB = tcbuffer_in(wktB.c_str()); + if (!tB) { free(tA); return 0; } + + int r = adwithin_tcbuffer_tcbuffer(tA, tB, distValue); + free(tA); + free(tB); + return r; + } + catch (const std::exception&) + { + return 0; + } }, - lon1, lat1, r1, ts1, lon2, lat2, r2, ts2, dist); + lonA, latA, radiusA, tsA, lonB, latB, radiusB, tsB, dist); return VarVal(result); } @@ -103,15 +117,16 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterA PRECONDITION(arguments.childFunctions.size() == 9, "AdwithinTcbufferTcbufferPhysicalFunction requires 9 children but got {}", arguments.childFunctions.size()); - return AdwithinTcbufferTcbufferPhysicalFunction(std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2]), - std::move(arguments.childFunctions[3]), - std::move(arguments.childFunctions[4]), - std::move(arguments.childFunctions[5]), - std::move(arguments.childFunctions[6]), - std::move(arguments.childFunctions[7]), - std::move(arguments.childFunctions[8])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + auto arg5 = std::move(arguments.childFunctions[5]); + auto arg6 = std::move(arguments.childFunctions[6]); + auto arg7 = std::move(arguments.childFunctions[7]); + auto arg8 = std::move(arguments.childFunctions[8]); + return AdwithinTcbufferTcbufferPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6), std::move(arg7), std::move(arg8)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AdwithinTgeoGeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AdwithinTgeoGeoPhysicalFunction.cpp index f46ab72996..a357d6d396 100644 --- a/nes-physical-operators/src/Functions/Meos/AdwithinTgeoGeoPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/AdwithinTgeoGeoPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -34,43 +35,75 @@ extern "C" { namespace NES { -AdwithinTgeoGeoPhysicalFunction::AdwithinTgeoGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, - PhysicalFunction ts, PhysicalFunction wkt, - PhysicalFunction dist) +AdwithinTgeoGeoPhysicalFunction::AdwithinTgeoGeoPhysicalFunction(PhysicalFunction lonFunction, + PhysicalFunction latFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction, + PhysicalFunction distFunction) { - paramFns.reserve(5); - paramFns.push_back(std::move(lon)); - paramFns.push_back(std::move(lat)); - paramFns.push_back(std::move(ts)); - paramFns.push_back(std::move(wkt)); - paramFns.push_back(std::move(dist)); + parameterFunctions.reserve(5); + parameterFunctions.push_back(std::move(lonFunction)); + parameterFunctions.push_back(std::move(latFunction)); + parameterFunctions.push_back(std::move(timestampFunction)); + parameterFunctions.push_back(std::move(geometryFunction)); + parameterFunctions.push_back(std::move(distFunction)); } VarVal AdwithinTgeoGeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto lon = paramFns[0].execute(record, arena).cast(); - auto lat = paramFns[1].execute(record, arena).cast(); - auto ts = paramFns[2].execute(record, arena).cast(); - auto wkt = paramFns[3].execute(record, arena).cast(); - auto dist = paramFns[4].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto lon = parameterValues[0].cast>(); + auto lat = parameterValues[1].cast>(); + auto timestamp = parameterValues[2].cast>(); + auto geometry = parameterValues[3].cast(); + auto dist = parameterValues[4].cast>(); const auto result = nautilus::invoke( - +[](double lon, double lat, uint64_t ts, - const char* w, uint32_t wsz, double dist) -> double { - try { + +[](double lonValue, + double latValue, + uint64_t timestampValue, + const char* geometryPtr, + uint32_t geometrySize, + double distValue) -> int { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string wktStr(w, wsz); - std::string tgeoWkt = fmt::format("SRID=4326;POINT({},{})@{}", lon, lat, ts); - Temporal* tgeo = tgeompoint_in(tgeoWkt.c_str()); - if (!tgeo) return 0.0; - GSERIALIZED* gs = geom_in(wktStr.c_str(), -1); - if (!gs) { free(tgeo); return 0.0; } - int r = adwithin_tgeo_geo(tgeo, gs, dist); - free(tgeo); free(gs); - return r > 0 ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + if (!(lonValue >= -180.0 && lonValue <= 180.0 && latValue >= -90.0 && latValue <= 90.0)) return 0; + + const std::string timestampString = MEOS::Meos::convertEpochToTimestamp(timestampValue); + std::string temporalGeometryWkt = fmt::format("SRID=4326;Point({} {})@{}", lonValue, latValue, timestampString); + std::string staticGeometryWkt(geometryPtr, geometrySize); + + while (!staticGeometryWkt.empty() && (staticGeometryWkt.front() == '\'' || staticGeometryWkt.front() == '"')) + staticGeometryWkt.erase(staticGeometryWkt.begin()); + while (!staticGeometryWkt.empty() && (staticGeometryWkt.back() == '\'' || staticGeometryWkt.back() == '"')) + staticGeometryWkt.pop_back(); + + if (temporalGeometryWkt.empty() || staticGeometryWkt.empty()) return 0; + + MEOS::Meos::TemporalGeometry temporalGeometry(temporalGeometryWkt); + if (!temporalGeometry.getGeometry()) return 0; + MEOS::Meos::StaticGeometry staticGeometry(staticGeometryWkt); + if (!staticGeometry.getGeometry()) return 0; + + // MEOS *_tgeo_geo with trailing distance arg + // — int fn(const Temporal*, const GSERIALIZED*, double). + return adwithin_tgeo_geo(temporalGeometry.getGeometry(), + staticGeometry.getGeometry(), + distValue); + } + catch (const std::exception&) + { + return 0; + } }, - lon, lat, ts, wkt, dist); + lon, lat, timestamp, geometry.getContent(), geometry.getContentSize(), dist); return VarVal(result); } @@ -81,11 +114,12 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterA PRECONDITION(arguments.childFunctions.size() == 5, "AdwithinTgeoGeoPhysicalFunction requires 5 children but got {}", arguments.childFunctions.size()); - return AdwithinTgeoGeoPhysicalFunction(std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2]), - std::move(arguments.childFunctions[3]), - std::move(arguments.childFunctions[4])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + return AdwithinTgeoGeoPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AdwithinTgeoTgeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AdwithinTgeoTgeoPhysicalFunction.cpp index fdcebcbde5..b9ead2c73a 100644 --- a/nes-physical-operators/src/Functions/Meos/AdwithinTgeoTgeoPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/AdwithinTgeoTgeoPhysicalFunction.cpp @@ -13,10 +13,10 @@ */ #include + #include #include #include -#include #include #include #include @@ -34,45 +34,74 @@ extern "C" { namespace NES { -AdwithinTgeoTgeoPhysicalFunction::AdwithinTgeoTgeoPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction ts1, PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction ts2, PhysicalFunction dist) +AdwithinTgeoTgeoPhysicalFunction::AdwithinTgeoTgeoPhysicalFunction(PhysicalFunction lonAFunction, + PhysicalFunction latAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction lonBFunction, + PhysicalFunction latBFunction, + PhysicalFunction tsBFunction, + PhysicalFunction distFunction) { - paramFns.reserve(7); - paramFns.push_back(std::move(lon1)); - paramFns.push_back(std::move(lat1)); - paramFns.push_back(std::move(ts1)); - paramFns.push_back(std::move(lon2)); - paramFns.push_back(std::move(lat2)); - paramFns.push_back(std::move(ts2)); - paramFns.push_back(std::move(dist)); + parameterFunctions.reserve(7); + parameterFunctions.push_back(std::move(lonAFunction)); + parameterFunctions.push_back(std::move(latAFunction)); + parameterFunctions.push_back(std::move(tsAFunction)); + parameterFunctions.push_back(std::move(lonBFunction)); + parameterFunctions.push_back(std::move(latBFunction)); + parameterFunctions.push_back(std::move(tsBFunction)); + parameterFunctions.push_back(std::move(distFunction)); } VarVal AdwithinTgeoTgeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto lon1 = paramFns[0].execute(record, arena).cast(); - auto lat1 = paramFns[1].execute(record, arena).cast(); - auto ts1 = paramFns[2].execute(record, arena).cast(); - auto lon2 = paramFns[3].execute(record, arena).cast(); - auto lat2 = paramFns[4].execute(record, arena).cast(); - auto ts2 = paramFns[5].execute(record, arena).cast(); - auto dist = paramFns[6].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto lonA = parameterValues[0].cast>(); + auto latA = parameterValues[1].cast>(); + auto tsA = parameterValues[2].cast>(); + auto lonB = parameterValues[3].cast>(); + auto latB = parameterValues[4].cast>(); + auto tsB = parameterValues[5].cast>(); + auto dist = parameterValues[6].cast>(); + const auto result = nautilus::invoke( - +[](double lon1, double lat1, uint64_t ts1, - double lon2, double lat2, uint64_t ts2, - double dist) -> double { - try { + +[](double lonAValue, double latAValue, uint64_t tsAValue, + double lonBValue, double latBValue, uint64_t tsBValue, + double distValue) -> int { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string wkt1 = fmt::format("SRID=4326;POINT({},{})@{}", lon1, lat1, ts1); - Temporal* t1 = tgeompoint_in(wkt1.c_str()); - if (!t1) return 0.0; - std::string wkt2 = fmt::format("SRID=4326;POINT({},{})@{}", lon2, lat2, ts2); - Temporal* t2 = tgeompoint_in(wkt2.c_str()); - if (!t2) { free(t1); return 0.0; } - int r = adwithin_tgeo_tgeo(t1, t2, dist); - free(t1); free(t2); - return r > 0 ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + if (!(lonAValue >= -180.0 && lonAValue <= 180.0 && latAValue >= -90.0 && latAValue <= 90.0)) return 0; + if (!(lonBValue >= -180.0 && lonBValue <= 180.0 && latBValue >= -90.0 && latBValue <= 90.0)) return 0; + + const std::string tsAString = MEOS::Meos::convertEpochToTimestamp(tsAValue); + const std::string tsBString = MEOS::Meos::convertEpochToTimestamp(tsBValue); + std::string temporalGeometryAWkt = fmt::format("SRID=4326;Point({} {})@{}", lonAValue, latAValue, tsAString); + std::string temporalGeometryBWkt = fmt::format("SRID=4326;Point({} {})@{}", lonBValue, latBValue, tsBString); + + MEOS::Meos::TemporalGeometry temporalGeometryA(temporalGeometryAWkt); + if (!temporalGeometryA.getGeometry()) return 0; + MEOS::Meos::TemporalGeometry temporalGeometryB(temporalGeometryBWkt); + if (!temporalGeometryB.getGeometry()) return 0; + + // MEOS *_tgeo_tgeo with trailing distance arg + // — int fn(const Temporal*, const Temporal*, double). + return adwithin_tgeo_tgeo(temporalGeometryA.getGeometry(), + temporalGeometryB.getGeometry(), + distValue); + } + catch (const std::exception&) + { + return 0; + } }, - lon1, lat1, ts1, lon2, lat2, ts2, dist); + lonA, latA, tsA, lonB, latB, tsB, dist); + return VarVal(result); } @@ -82,14 +111,14 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterA PRECONDITION(arguments.childFunctions.size() == 7, "AdwithinTgeoTgeoPhysicalFunction requires 7 children but got {}", arguments.childFunctions.size()); - return AdwithinTgeoTgeoPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2]), - std::move(arguments.childFunctions[3]), - std::move(arguments.childFunctions[4]), - std::move(arguments.childFunctions[5]), - std::move(arguments.childFunctions[6])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + auto arg5 = std::move(arguments.childFunctions[5]); + auto arg6 = std::move(arguments.childFunctions[6]); + return AdwithinTgeoTgeoPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AdwithinTrgeometryGeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AdwithinTrgeometryGeoPhysicalFunction.cpp new file mode 100644 index 0000000000..22554ef260 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AdwithinTrgeometryGeoPhysicalFunction.cpp @@ -0,0 +1,100 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +#include +} + +namespace NES { + +AdwithinTrgeometryGeoPhysicalFunction::AdwithinTrgeometryGeoPhysicalFunction(PhysicalFunction ref_wkt, PhysicalFunction x1, PhysicalFunction y1, PhysicalFunction theta1, PhysicalFunction ts1, PhysicalFunction tgt_wkt, PhysicalFunction dist) { + paramFns.reserve(7); + paramFns.push_back(std::move(ref_wkt)); + paramFns.push_back(std::move(x1)); + paramFns.push_back(std::move(y1)); + paramFns.push_back(std::move(theta1)); + paramFns.push_back(std::move(ts1)); + paramFns.push_back(std::move(tgt_wkt)); + paramFns.push_back(std::move(dist)); +} + +VarVal AdwithinTrgeometryGeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { + auto ref_wkt = paramFns[0].execute(record, arena).cast(); + auto x1 = paramFns[1].execute(record, arena).cast(); + auto y1 = paramFns[2].execute(record, arena).cast(); + auto theta1 = paramFns[3].execute(record, arena).cast(); + auto ts1 = paramFns[4].execute(record, arena).cast(); + auto tgt_wkt = paramFns[5].execute(record, arena).cast(); + auto dist = paramFns[6].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](const char* ref_wkt, uint32_t ref_wktsz, double x1, double y1, double theta1, uint64_t ts1, const char* tgt_wkt, uint32_t tgt_wktsz, double dist) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + char* ref1_str = (char*)malloc(ref_wktsz + 1); + memcpy(ref1_str, ref_wkt, ref_wktsz); ref1_str[ref_wktsz] = '\0'; + GSERIALIZED* gref1 = geom_in(ref1_str, -1); free(ref1_str); + if (!gref1) return 0.0; + Pose* pose1 = pose_make_2d(x1, y1, theta1, false, 0); + if (!pose1) { free(gref1); return 0.0; } + TInstant* inst1 = trgeometryinst_make(gref1, pose1, (TimestampTz)ts1); + free(gref1); free(pose1); + if (!inst1) return 0.0; + char* tgt_str = (char*)malloc(tgt_wktsz + 1); + memcpy(tgt_str, tgt_wkt, tgt_wktsz); tgt_str[tgt_wktsz] = '\0'; + GSERIALIZED* gs_tgt = geom_in(tgt_str, -1); free(tgt_str); + if (!gs_tgt) { free(inst1); return 0.0; } + int r = adwithin_trgeometry_geo((Temporal*)inst1, gs_tgt, dist); + free(inst1); free(gs_tgt); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + ref_wkt, x1, y1, theta1, ts1, tgt_wkt, dist); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAdwithinTrgeometryGeoPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size()==7, + "AdwithinTrgeometryGeoPhysicalFunction requires 7 children but got {}", + arguments.childFunctions.size()); + return AdwithinTrgeometryGeoPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4]), + std::move(arguments.childFunctions[5]), + std::move(arguments.childFunctions[6])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AdwithinTrgeometryTrgeometryPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AdwithinTrgeometryTrgeometryPhysicalFunction.cpp new file mode 100644 index 0000000000..ec58653385 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AdwithinTrgeometryTrgeometryPhysicalFunction.cpp @@ -0,0 +1,117 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +#include +} + +namespace NES { + +AdwithinTrgeometryTrgeometryPhysicalFunction::AdwithinTrgeometryTrgeometryPhysicalFunction(PhysicalFunction ref1_wkt, PhysicalFunction x1, PhysicalFunction y1, PhysicalFunction theta1, PhysicalFunction ts1, PhysicalFunction ref2_wkt, PhysicalFunction x2, PhysicalFunction y2, PhysicalFunction theta2, PhysicalFunction ts2, PhysicalFunction dist) { + paramFns.reserve(11); + paramFns.push_back(std::move(ref1_wkt)); + paramFns.push_back(std::move(x1)); + paramFns.push_back(std::move(y1)); + paramFns.push_back(std::move(theta1)); + paramFns.push_back(std::move(ts1)); + paramFns.push_back(std::move(ref2_wkt)); + paramFns.push_back(std::move(x2)); + paramFns.push_back(std::move(y2)); + paramFns.push_back(std::move(theta2)); + paramFns.push_back(std::move(ts2)); + paramFns.push_back(std::move(dist)); +} + +VarVal AdwithinTrgeometryTrgeometryPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { + auto ref1_wkt = paramFns[0].execute(record, arena).cast(); + auto x1 = paramFns[1].execute(record, arena).cast(); + auto y1 = paramFns[2].execute(record, arena).cast(); + auto theta1 = paramFns[3].execute(record, arena).cast(); + auto ts1 = paramFns[4].execute(record, arena).cast(); + auto ref2_wkt = paramFns[5].execute(record, arena).cast(); + auto x2 = paramFns[6].execute(record, arena).cast(); + auto y2 = paramFns[7].execute(record, arena).cast(); + auto theta2 = paramFns[8].execute(record, arena).cast(); + auto ts2 = paramFns[9].execute(record, arena).cast(); + auto dist = paramFns[10].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](const char* ref1_wkt, uint32_t ref1_wktsz, double x1, double y1, double theta1, uint64_t ts1, const char* ref2_wkt, uint32_t ref2_wktsz, double x2, double y2, double theta2, uint64_t ts2, double dist) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + char* ref1_str = (char*)malloc(ref1_wktsz + 1); + memcpy(ref1_str, ref1_wkt, ref1_wktsz); ref1_str[ref1_wktsz] = '\0'; + GSERIALIZED* gref1 = geom_in(ref1_str, -1); free(ref1_str); + if (!gref1) return 0.0; + Pose* pose1 = pose_make_2d(x1, y1, theta1, false, 0); + if (!pose1) { free(gref1); return 0.0; } + TInstant* inst1 = trgeometryinst_make(gref1, pose1, (TimestampTz)ts1); + free(gref1); free(pose1); + if (!inst1) return 0.0; + char* ref2_str = (char*)malloc(ref2_wktsz + 1); + memcpy(ref2_str, ref2_wkt, ref2_wktsz); ref2_str[ref2_wktsz] = '\0'; + GSERIALIZED* gref2 = geom_in(ref2_str, -1); free(ref2_str); + if (!gref2) return 0.0; + Pose* pose2 = pose_make_2d(x2, y2, theta2, false, 0); + if (!pose2) { free(gref2); return 0.0; } + TInstant* inst2 = trgeometryinst_make(gref2, pose2, (TimestampTz)ts2); + free(gref2); free(pose2); + if (!inst2) { free(inst1); return 0.0; } + int r = adwithin_trgeometry_trgeometry((Temporal*)inst1, (Temporal*)inst2, dist); + free(inst1); free(inst2); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + ref1_wkt, x1, y1, theta1, ts1, ref2_wkt, x2, y2, theta2, ts2, dist); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAdwithinTrgeometryTrgeometryPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size()==11, + "AdwithinTrgeometryTrgeometryPhysicalFunction requires 11 children but got {}", + arguments.childFunctions.size()); + return AdwithinTrgeometryTrgeometryPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4]), + std::move(arguments.childFunctions[5]), + std::move(arguments.childFunctions[6]), + std::move(arguments.childFunctions[7]), + std::move(arguments.childFunctions[8]), + std::move(arguments.childFunctions[9]), + std::move(arguments.childFunctions[10])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AintersectsTcbufferGeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AintersectsTcbufferGeoPhysicalFunction.cpp index 29ddcc1a02..0af296e0da 100644 --- a/nes-physical-operators/src/Functions/Meos/AintersectsTcbufferGeoPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/AintersectsTcbufferGeoPhysicalFunction.cpp @@ -13,77 +13,97 @@ */ #include + #include #include #include +#include #include #include #include #include +#include #include +#include #include #include -#include -#include -#include extern "C" { #include -#include #include } namespace NES { -AintersectsTcbufferGeoPhysicalFunction::AintersectsTcbufferGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, - PhysicalFunction radius, PhysicalFunction ts, - PhysicalFunction wkt) +AintersectsTcbufferGeoPhysicalFunction::AintersectsTcbufferGeoPhysicalFunction(PhysicalFunction lonFunction, + PhysicalFunction latFunction, + PhysicalFunction radiusFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction) { - paramFns.reserve(5); - paramFns.push_back(std::move(lon)); - paramFns.push_back(std::move(lat)); - paramFns.push_back(std::move(radius)); - paramFns.push_back(std::move(ts)); - paramFns.push_back(std::move(wkt)); + parameterFunctions.reserve(5); + parameterFunctions.push_back(std::move(lonFunction)); + parameterFunctions.push_back(std::move(latFunction)); + parameterFunctions.push_back(std::move(radiusFunction)); + parameterFunctions.push_back(std::move(timestampFunction)); + parameterFunctions.push_back(std::move(geometryFunction)); } VarVal AintersectsTcbufferGeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto lon = paramFns[0].execute(record, arena).cast(); - auto lat = paramFns[1].execute(record, arena).cast(); - auto radius = paramFns[2].execute(record, arena).cast(); - auto ts = paramFns[3].execute(record, arena).cast(); - auto wkt = paramFns[4].execute(record, arena); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto lon = parameterValues[0].cast>(); + auto lat = parameterValues[1].cast>(); + auto radius = parameterValues[2].cast>(); + auto timestamp = parameterValues[3].cast>(); + auto geometry = parameterValues[4].cast(); const auto result = nautilus::invoke( - +[](double lon, double lat, double radius, uint64_t ts, - const char* wkt, uint32_t wkt_len) -> double { - try { + +[](double lonValue, + double latValue, + double radiusValue, + uint64_t timestampValue, + const char* geometryPtr, + uint32_t geometrySize) -> int { + try + { MEOS::Meos::ensureMeosInitialized(); - // Build tcbuffer instant: point + radius → cbuffer → instant - std::string pt_str = fmt::format("POINT({} {})", lon, lat); - GSERIALIZED* pt_gs = geom_in(pt_str.c_str(), -1); - if (!pt_gs) return 0.0; - Cbuffer* cb = cbuffer_make(pt_gs, radius); - free(pt_gs); - if (!cb) return 0.0; - Temporal* tcb_inst = (Temporal*)tcbufferinst_make(cb, (TimestampTz)ts); - free(cb); - if (!tcb_inst) return 0.0; - // Build target geometry from null-terminated WKT copy - char* wkt_str = (char*)malloc(wkt_len + 1); - memcpy(wkt_str, wkt, wkt_len); - wkt_str[wkt_len] = '\0'; - GSERIALIZED* target_gs = geom_in(wkt_str, -1); - free(wkt_str); - if (!target_gs) { free(tcb_inst); return 0.0; } - int r = aintersects_tcbuffer_geo(tcb_inst, target_gs); - free(tcb_inst); - free(target_gs); - return r > 0 ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + if (!(lonValue >= -180.0 && lonValue <= 180.0 && latValue >= -90.0 && latValue <= 90.0)) return 0; + if (radiusValue < 0.0) return 0; + + const std::string timestampString = MEOS::Meos::convertEpochToTimestamp(timestampValue); + std::string tcbufferWkt = fmt::format("Cbuffer(Point({} {}),{})@{}", + lonValue, latValue, radiusValue, timestampString); + std::string staticGeometryWkt(geometryPtr, geometrySize); + + while (!staticGeometryWkt.empty() && (staticGeometryWkt.front() == '\'' || staticGeometryWkt.front() == '"')) + staticGeometryWkt.erase(staticGeometryWkt.begin()); + while (!staticGeometryWkt.empty() && (staticGeometryWkt.back() == '\'' || staticGeometryWkt.back() == '"')) + staticGeometryWkt.pop_back(); + + if (tcbufferWkt.empty() || staticGeometryWkt.empty()) return 0; + + Temporal* tcbuffer = tcbuffer_in(tcbufferWkt.c_str()); + if (!tcbuffer) return 0; + MEOS::Meos::StaticGeometry staticGeometry(staticGeometryWkt); + if (!staticGeometry.getGeometry()) { free(tcbuffer); return 0; } + + int r = aintersects_tcbuffer_geo(tcbuffer, staticGeometry.getGeometry()); + free(tcbuffer); + return r; + } + catch (const std::exception&) + { + return 0; + } }, - lon, lat, radius, ts, wkt); + lon, lat, radius, timestamp, geometry.getContent(), geometry.getContentSize()); return VarVal(result); } @@ -94,11 +114,12 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterA PRECONDITION(arguments.childFunctions.size() == 5, "AintersectsTcbufferGeoPhysicalFunction requires 5 children but got {}", arguments.childFunctions.size()); - return AintersectsTcbufferGeoPhysicalFunction(std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2]), - std::move(arguments.childFunctions[3]), - std::move(arguments.childFunctions[4])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + return AintersectsTcbufferGeoPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AintersectsTcbufferTcbufferPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AintersectsTcbufferTcbufferPhysicalFunction.cpp index ffec1430f4..c474c7337e 100644 --- a/nes-physical-operators/src/Functions/Meos/AintersectsTcbufferTcbufferPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/AintersectsTcbufferTcbufferPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -20,75 +21,88 @@ #include #include #include +#include #include +#include #include #include -#include -#include extern "C" { #include -#include #include } namespace NES { -AintersectsTcbufferTcbufferPhysicalFunction::AintersectsTcbufferTcbufferPhysicalFunction( - PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction r1, PhysicalFunction ts1, - PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction r2, PhysicalFunction ts2) +AintersectsTcbufferTcbufferPhysicalFunction::AintersectsTcbufferTcbufferPhysicalFunction(PhysicalFunction lonAFunction, + PhysicalFunction latAFunction, + PhysicalFunction radiusAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction lonBFunction, + PhysicalFunction latBFunction, + PhysicalFunction radiusBFunction, + PhysicalFunction tsBFunction) { - paramFns.reserve(8); - paramFns.push_back(std::move(lon1)); - paramFns.push_back(std::move(lat1)); - paramFns.push_back(std::move(r1)); - paramFns.push_back(std::move(ts1)); - paramFns.push_back(std::move(lon2)); - paramFns.push_back(std::move(lat2)); - paramFns.push_back(std::move(r2)); - paramFns.push_back(std::move(ts2)); + parameterFunctions.reserve(8); + parameterFunctions.push_back(std::move(lonAFunction)); + parameterFunctions.push_back(std::move(latAFunction)); + parameterFunctions.push_back(std::move(radiusAFunction)); + parameterFunctions.push_back(std::move(tsAFunction)); + parameterFunctions.push_back(std::move(lonBFunction)); + parameterFunctions.push_back(std::move(latBFunction)); + parameterFunctions.push_back(std::move(radiusBFunction)); + parameterFunctions.push_back(std::move(tsBFunction)); } VarVal AintersectsTcbufferTcbufferPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto lon1 = paramFns[0].execute(record, arena).cast(); - auto lat1 = paramFns[1].execute(record, arena).cast(); - auto r1 = paramFns[2].execute(record, arena).cast(); - auto ts1 = paramFns[3].execute(record, arena).cast(); - auto lon2 = paramFns[4].execute(record, arena).cast(); - auto lat2 = paramFns[5].execute(record, arena).cast(); - auto r2 = paramFns[6].execute(record, arena).cast(); - auto ts2 = paramFns[7].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto lonA = parameterValues[0].cast>(); + auto latA = parameterValues[1].cast>(); + auto radiusA = parameterValues[2].cast>(); + auto tsA = parameterValues[3].cast>(); + auto lonB = parameterValues[4].cast>(); + auto latB = parameterValues[5].cast>(); + auto radiusB = parameterValues[6].cast>(); + auto tsB = parameterValues[7].cast>(); const auto result = nautilus::invoke( - +[](double lon1, double lat1, double r1, uint64_t ts1, - double lon2, double lat2, double r2, uint64_t ts2) -> double { - try { + +[](double lonAValue, double latAValue, double radiusAValue, uint64_t tsAValue, + double lonBValue, double latBValue, double radiusBValue, uint64_t tsBValue) -> int { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string pt1 = fmt::format("POINT({} {})", lon1, lat1); - GSERIALIZED* gs1 = geom_in(pt1.c_str(), -1); - if (!gs1) return 0.0; - Cbuffer* cb1 = cbuffer_make(gs1, r1); - free(gs1); - if (!cb1) return 0.0; - Temporal* tcb1 = (Temporal*)tcbufferinst_make(cb1, (TimestampTz)ts1); - free(cb1); - if (!tcb1) return 0.0; - std::string pt2 = fmt::format("POINT({} {})", lon2, lat2); - GSERIALIZED* gs2 = geom_in(pt2.c_str(), -1); - if (!gs2) { free(tcb1); return 0.0; } - Cbuffer* cb2 = cbuffer_make(gs2, r2); - free(gs2); - if (!cb2) { free(tcb1); return 0.0; } - Temporal* tcb2 = (Temporal*)tcbufferinst_make(cb2, (TimestampTz)ts2); - free(cb2); - if (!tcb2) { free(tcb1); return 0.0; } - int r = aintersects_tcbuffer_tcbuffer(tcb1, tcb2); - free(tcb1); free(tcb2); - return r > 0 ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + if (!(lonAValue >= -180.0 && lonAValue <= 180.0 && latAValue >= -90.0 && latAValue <= 90.0)) return 0; + if (!(lonBValue >= -180.0 && lonBValue <= 180.0 && latBValue >= -90.0 && latBValue <= 90.0)) return 0; + if (radiusAValue < 0.0 || radiusBValue < 0.0) return 0; + + const std::string tsAString = MEOS::Meos::convertEpochToTimestamp(tsAValue); + const std::string tsBString = MEOS::Meos::convertEpochToTimestamp(tsBValue); + std::string wktA = fmt::format("Cbuffer(Point({} {}),{})@{}", lonAValue, latAValue, radiusAValue, tsAString); + std::string wktB = fmt::format("Cbuffer(Point({} {}),{})@{}", lonBValue, latBValue, radiusBValue, tsBString); + + Temporal* tA = tcbuffer_in(wktA.c_str()); + if (!tA) return 0; + Temporal* tB = tcbuffer_in(wktB.c_str()); + if (!tB) { free(tA); return 0; } + + int r = aintersects_tcbuffer_tcbuffer(tA, tB); + free(tA); + free(tB); + return r; + } + catch (const std::exception&) + { + return 0; + } }, - lon1, lat1, r1, ts1, lon2, lat2, r2, ts2); + lonA, latA, radiusA, tsA, lonB, latB, radiusB, tsB); return VarVal(result); } @@ -99,14 +113,15 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterA PRECONDITION(arguments.childFunctions.size() == 8, "AintersectsTcbufferTcbufferPhysicalFunction requires 8 children but got {}", arguments.childFunctions.size()); - return AintersectsTcbufferTcbufferPhysicalFunction(std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2]), - std::move(arguments.childFunctions[3]), - std::move(arguments.childFunctions[4]), - std::move(arguments.childFunctions[5]), - std::move(arguments.childFunctions[6]), - std::move(arguments.childFunctions[7])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + auto arg5 = std::move(arguments.childFunctions[5]); + auto arg6 = std::move(arguments.childFunctions[6]); + auto arg7 = std::move(arguments.childFunctions[7]); + return AintersectsTcbufferTcbufferPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6), std::move(arg7)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AintersectsTgeoGeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AintersectsTgeoGeoPhysicalFunction.cpp index df6f10ca10..d9ed36c662 100644 --- a/nes-physical-operators/src/Functions/Meos/AintersectsTgeoGeoPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/AintersectsTgeoGeoPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -34,40 +35,75 @@ extern "C" { namespace NES { -AintersectsTgeoGeoPhysicalFunction::AintersectsTgeoGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, - PhysicalFunction ts, PhysicalFunction wkt) +AintersectsTgeoGeoPhysicalFunction::AintersectsTgeoGeoPhysicalFunction(PhysicalFunction lonFunction, + PhysicalFunction latFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction) { - paramFns.reserve(4); - paramFns.push_back(std::move(lon)); - paramFns.push_back(std::move(lat)); - paramFns.push_back(std::move(ts)); - paramFns.push_back(std::move(wkt)); + parameterFunctions.reserve(4); + parameterFunctions.push_back(std::move(lonFunction)); + parameterFunctions.push_back(std::move(latFunction)); + parameterFunctions.push_back(std::move(timestampFunction)); + parameterFunctions.push_back(std::move(geometryFunction)); } VarVal AintersectsTgeoGeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto lon = paramFns[0].execute(record, arena).cast(); - auto lat = paramFns[1].execute(record, arena).cast(); - auto ts = paramFns[2].execute(record, arena).cast(); - auto wkt = paramFns[3].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto lon = parameterValues[0].cast>(); + auto lat = parameterValues[1].cast>(); + auto timestamp = parameterValues[2].cast>(); + auto geometry = parameterValues[3].cast(); const auto result = nautilus::invoke( - +[](double lon, double lat, uint64_t ts, - const char* w, uint32_t wsz) -> double { - try { + +[](double lonValue, + double latValue, + uint64_t timestampValue, + const char* geometryPtr, + uint32_t geometrySize) -> int { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string wktStr(w, wsz); - std::string tgeoWkt = fmt::format("SRID=4326;POINT({},{})@{}", lon, lat, ts); - Temporal* tgeo = tgeompoint_in(tgeoWkt.c_str()); - if (!tgeo) return 0.0; - GSERIALIZED* gs = geom_in(wktStr.c_str(), -1); - if (!gs) { free(tgeo); return 0.0; } - int r = aintersects_tgeo_geo(tgeo, gs); - free(tgeo); free(gs); - return r > 0 ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + if (!(lonValue >= -180.0 && lonValue <= 180.0 && latValue >= -90.0 && latValue <= 90.0)) { + return 0; + } + + const std::string timestampString = MEOS::Meos::convertEpochToTimestamp(timestampValue); + std::string temporalGeometryWkt = fmt::format("SRID=4326;Point({} {})@{}", lonValue, latValue, timestampString); + std::string staticGeometryWkt(geometryPtr, geometrySize); + + while (!staticGeometryWkt.empty() && (staticGeometryWkt.front() == '\'' || staticGeometryWkt.front() == '"')) + staticGeometryWkt.erase(staticGeometryWkt.begin()); + while (!staticGeometryWkt.empty() && (staticGeometryWkt.back() == '\'' || staticGeometryWkt.back() == '"')) + staticGeometryWkt.pop_back(); + + if (temporalGeometryWkt.empty() || staticGeometryWkt.empty()) + return 0; + + MEOS::Meos::TemporalGeometry temporalGeometry(temporalGeometryWkt); + if (!temporalGeometry.getGeometry()) return 0; + MEOS::Meos::StaticGeometry staticGeometry(staticGeometryWkt); + if (!staticGeometry.getGeometry()) return 0; + + // MEOS spatial-relation call — same shape as TemporalEDWithin's + // edwithin_tgeo_geo, but specific MEOS function per generated operator. + // Real MEOS spatial-rel signature: int fn(const Temporal *, const GSERIALIZED *) + // (no `atstart` flag — that's specific to geog_dwithin / edwithin's 3-arg variant). + return aintersects_tgeo_geo(temporalGeometry.getGeometry(), + staticGeometry.getGeometry()); + } + catch (const std::exception&) + { + return 0; + } }, - lon, lat, ts, wkt); + lon, lat, timestamp, geometry.getContent(), geometry.getContentSize()); return VarVal(result); } @@ -78,10 +114,11 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterA PRECONDITION(arguments.childFunctions.size() == 4, "AintersectsTgeoGeoPhysicalFunction requires 4 children but got {}", arguments.childFunctions.size()); - return AintersectsTgeoGeoPhysicalFunction(std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2]), - std::move(arguments.childFunctions[3])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + return AintersectsTgeoGeoPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AintersectsTgeoTgeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AintersectsTgeoTgeoPhysicalFunction.cpp index 8ddff7ddee..9061648dd6 100644 --- a/nes-physical-operators/src/Functions/Meos/AintersectsTgeoTgeoPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/AintersectsTgeoTgeoPhysicalFunction.cpp @@ -13,10 +13,10 @@ */ #include + #include #include #include -#include #include #include #include @@ -34,42 +34,68 @@ extern "C" { namespace NES { -AintersectsTgeoTgeoPhysicalFunction::AintersectsTgeoTgeoPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction ts1, PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction ts2) +AintersectsTgeoTgeoPhysicalFunction::AintersectsTgeoTgeoPhysicalFunction(PhysicalFunction lonAFunction, + PhysicalFunction latAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction lonBFunction, + PhysicalFunction latBFunction, + PhysicalFunction tsBFunction) { - paramFns.reserve(6); - paramFns.push_back(std::move(lon1)); - paramFns.push_back(std::move(lat1)); - paramFns.push_back(std::move(ts1)); - paramFns.push_back(std::move(lon2)); - paramFns.push_back(std::move(lat2)); - paramFns.push_back(std::move(ts2)); + parameterFunctions.reserve(6); + parameterFunctions.push_back(std::move(lonAFunction)); + parameterFunctions.push_back(std::move(latAFunction)); + parameterFunctions.push_back(std::move(tsAFunction)); + parameterFunctions.push_back(std::move(lonBFunction)); + parameterFunctions.push_back(std::move(latBFunction)); + parameterFunctions.push_back(std::move(tsBFunction)); } VarVal AintersectsTgeoTgeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto lon1 = paramFns[0].execute(record, arena).cast(); - auto lat1 = paramFns[1].execute(record, arena).cast(); - auto ts1 = paramFns[2].execute(record, arena).cast(); - auto lon2 = paramFns[3].execute(record, arena).cast(); - auto lat2 = paramFns[4].execute(record, arena).cast(); - auto ts2 = paramFns[5].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto lonA = parameterValues[0].cast>(); + auto latA = parameterValues[1].cast>(); + auto tsA = parameterValues[2].cast>(); + auto lonB = parameterValues[3].cast>(); + auto latB = parameterValues[4].cast>(); + auto tsB = parameterValues[5].cast>(); + const auto result = nautilus::invoke( - +[](double lon1, double lat1, uint64_t ts1, - double lon2, double lat2, uint64_t ts2) -> double { - try { + +[](double lonAValue, double latAValue, uint64_t tsAValue, + double lonBValue, double latBValue, uint64_t tsBValue) -> int { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string wkt1 = fmt::format("SRID=4326;POINT({},{})@{}", lon1, lat1, ts1); - Temporal* t1 = tgeompoint_in(wkt1.c_str()); - if (!t1) return 0.0; - std::string wkt2 = fmt::format("SRID=4326;POINT({},{})@{}", lon2, lat2, ts2); - Temporal* t2 = tgeompoint_in(wkt2.c_str()); - if (!t2) { free(t1); return 0.0; } - int r = aintersects_tgeo_tgeo(t1, t2); - free(t1); free(t2); - return r > 0 ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + if (!(lonAValue >= -180.0 && lonAValue <= 180.0 && latAValue >= -90.0 && latAValue <= 90.0)) return 0; + if (!(lonBValue >= -180.0 && lonBValue <= 180.0 && latBValue >= -90.0 && latBValue <= 90.0)) return 0; + + const std::string tsAString = MEOS::Meos::convertEpochToTimestamp(tsAValue); + const std::string tsBString = MEOS::Meos::convertEpochToTimestamp(tsBValue); + std::string temporalGeometryAWkt = fmt::format("SRID=4326;Point({} {})@{}", lonAValue, latAValue, tsAString); + std::string temporalGeometryBWkt = fmt::format("SRID=4326;Point({} {})@{}", lonBValue, latBValue, tsBString); + + MEOS::Meos::TemporalGeometry temporalGeometryA(temporalGeometryAWkt); + if (!temporalGeometryA.getGeometry()) return 0; + MEOS::Meos::TemporalGeometry temporalGeometryB(temporalGeometryBWkt); + if (!temporalGeometryB.getGeometry()) return 0; + + // MEOS *_tgeo_tgeo spatial-relation: int fn(const Temporal*, const Temporal*). + return aintersects_tgeo_tgeo(temporalGeometryA.getGeometry(), + temporalGeometryB.getGeometry()); + } + catch (const std::exception&) + { + return 0; + } }, - lon1, lat1, ts1, lon2, lat2, ts2); + lonA, latA, tsA, lonB, latB, tsB); + return VarVal(result); } @@ -79,13 +105,13 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterA PRECONDITION(arguments.childFunctions.size() == 6, "AintersectsTgeoTgeoPhysicalFunction requires 6 children but got {}", arguments.childFunctions.size()); - return AintersectsTgeoTgeoPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2]), - std::move(arguments.childFunctions[3]), - std::move(arguments.childFunctions[4]), - std::move(arguments.childFunctions[5])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + auto arg5 = std::move(arguments.childFunctions[5]); + return AintersectsTgeoTgeoPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AintersectsTrgeometryGeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AintersectsTrgeometryGeoPhysicalFunction.cpp new file mode 100644 index 0000000000..986f1587b0 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AintersectsTrgeometryGeoPhysicalFunction.cpp @@ -0,0 +1,97 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +#include +} + +namespace NES { + +AintersectsTrgeometryGeoPhysicalFunction::AintersectsTrgeometryGeoPhysicalFunction(PhysicalFunction ref_wkt, PhysicalFunction x1, PhysicalFunction y1, PhysicalFunction theta1, PhysicalFunction ts1, PhysicalFunction tgt_wkt) { + paramFns.reserve(6); + paramFns.push_back(std::move(ref_wkt)); + paramFns.push_back(std::move(x1)); + paramFns.push_back(std::move(y1)); + paramFns.push_back(std::move(theta1)); + paramFns.push_back(std::move(ts1)); + paramFns.push_back(std::move(tgt_wkt)); +} + +VarVal AintersectsTrgeometryGeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { + auto ref_wkt = paramFns[0].execute(record, arena).cast(); + auto x1 = paramFns[1].execute(record, arena).cast(); + auto y1 = paramFns[2].execute(record, arena).cast(); + auto theta1 = paramFns[3].execute(record, arena).cast(); + auto ts1 = paramFns[4].execute(record, arena).cast(); + auto tgt_wkt = paramFns[5].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](const char* ref_wkt, uint32_t ref_wktsz, double x1, double y1, double theta1, uint64_t ts1, const char* tgt_wkt, uint32_t tgt_wktsz) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + char* ref1_str = (char*)malloc(ref_wktsz + 1); + memcpy(ref1_str, ref_wkt, ref_wktsz); ref1_str[ref_wktsz] = '\0'; + GSERIALIZED* gref1 = geom_in(ref1_str, -1); free(ref1_str); + if (!gref1) return 0.0; + Pose* pose1 = pose_make_2d(x1, y1, theta1, false, 0); + if (!pose1) { free(gref1); return 0.0; } + TInstant* inst1 = trgeometryinst_make(gref1, pose1, (TimestampTz)ts1); + free(gref1); free(pose1); + if (!inst1) return 0.0; + char* tgt_str = (char*)malloc(tgt_wktsz + 1); + memcpy(tgt_str, tgt_wkt, tgt_wktsz); tgt_str[tgt_wktsz] = '\0'; + GSERIALIZED* gs_tgt = geom_in(tgt_str, -1); free(tgt_str); + if (!gs_tgt) { free(inst1); return 0.0; } + int r = aintersects_trgeometry_geo((Temporal*)inst1, gs_tgt); + free(inst1); free(gs_tgt); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + ref_wkt, x1, y1, theta1, ts1, tgt_wkt); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAintersectsTrgeometryGeoPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size()==6, + "AintersectsTrgeometryGeoPhysicalFunction requires 6 children but got {}", + arguments.childFunctions.size()); + return AintersectsTrgeometryGeoPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4]), + std::move(arguments.childFunctions[5])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AintersectsTrgeometryTrgeometryPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AintersectsTrgeometryTrgeometryPhysicalFunction.cpp new file mode 100644 index 0000000000..a40131f757 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AintersectsTrgeometryTrgeometryPhysicalFunction.cpp @@ -0,0 +1,114 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +#include +} + +namespace NES { + +AintersectsTrgeometryTrgeometryPhysicalFunction::AintersectsTrgeometryTrgeometryPhysicalFunction(PhysicalFunction ref1_wkt, PhysicalFunction x1, PhysicalFunction y1, PhysicalFunction theta1, PhysicalFunction ts1, PhysicalFunction ref2_wkt, PhysicalFunction x2, PhysicalFunction y2, PhysicalFunction theta2, PhysicalFunction ts2) { + paramFns.reserve(10); + paramFns.push_back(std::move(ref1_wkt)); + paramFns.push_back(std::move(x1)); + paramFns.push_back(std::move(y1)); + paramFns.push_back(std::move(theta1)); + paramFns.push_back(std::move(ts1)); + paramFns.push_back(std::move(ref2_wkt)); + paramFns.push_back(std::move(x2)); + paramFns.push_back(std::move(y2)); + paramFns.push_back(std::move(theta2)); + paramFns.push_back(std::move(ts2)); +} + +VarVal AintersectsTrgeometryTrgeometryPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { + auto ref1_wkt = paramFns[0].execute(record, arena).cast(); + auto x1 = paramFns[1].execute(record, arena).cast(); + auto y1 = paramFns[2].execute(record, arena).cast(); + auto theta1 = paramFns[3].execute(record, arena).cast(); + auto ts1 = paramFns[4].execute(record, arena).cast(); + auto ref2_wkt = paramFns[5].execute(record, arena).cast(); + auto x2 = paramFns[6].execute(record, arena).cast(); + auto y2 = paramFns[7].execute(record, arena).cast(); + auto theta2 = paramFns[8].execute(record, arena).cast(); + auto ts2 = paramFns[9].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](const char* ref1_wkt, uint32_t ref1_wktsz, double x1, double y1, double theta1, uint64_t ts1, const char* ref2_wkt, uint32_t ref2_wktsz, double x2, double y2, double theta2, uint64_t ts2) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + char* ref1_str = (char*)malloc(ref1_wktsz + 1); + memcpy(ref1_str, ref1_wkt, ref1_wktsz); ref1_str[ref1_wktsz] = '\0'; + GSERIALIZED* gref1 = geom_in(ref1_str, -1); free(ref1_str); + if (!gref1) return 0.0; + Pose* pose1 = pose_make_2d(x1, y1, theta1, false, 0); + if (!pose1) { free(gref1); return 0.0; } + TInstant* inst1 = trgeometryinst_make(gref1, pose1, (TimestampTz)ts1); + free(gref1); free(pose1); + if (!inst1) return 0.0; + char* ref2_str = (char*)malloc(ref2_wktsz + 1); + memcpy(ref2_str, ref2_wkt, ref2_wktsz); ref2_str[ref2_wktsz] = '\0'; + GSERIALIZED* gref2 = geom_in(ref2_str, -1); free(ref2_str); + if (!gref2) return 0.0; + Pose* pose2 = pose_make_2d(x2, y2, theta2, false, 0); + if (!pose2) { free(gref2); return 0.0; } + TInstant* inst2 = trgeometryinst_make(gref2, pose2, (TimestampTz)ts2); + free(gref2); free(pose2); + if (!inst2) { free(inst1); return 0.0; } + int r = aintersects_trgeometry_trgeometry((Temporal*)inst1, (Temporal*)inst2); + free(inst1); free(inst2); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + ref1_wkt, x1, y1, theta1, ts1, ref2_wkt, x2, y2, theta2, ts2); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAintersectsTrgeometryTrgeometryPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size()==10, + "AintersectsTrgeometryTrgeometryPhysicalFunction requires 10 children but got {}", + arguments.childFunctions.size()); + return AintersectsTrgeometryTrgeometryPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4]), + std::move(arguments.childFunctions[5]), + std::move(arguments.childFunctions[6]), + std::move(arguments.childFunctions[7]), + std::move(arguments.childFunctions[8]), + std::move(arguments.childFunctions[9])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysEqBigintTbigintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysEqBigintTbigintPhysicalFunction.cpp index 48bb0541a1..8be4d59e81 100644 --- a/nes-physical-operators/src/Functions/Meos/AlwaysEqBigintTbigintPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/AlwaysEqBigintTbigintPhysicalFunction.cpp @@ -35,12 +35,12 @@ extern "C" { namespace NES { -AlwaysEqBigintTbigintPhysicalFunction::AlwaysEqBigintTbigintPhysicalFunction(PhysicalFunction scalarFunction, - PhysicalFunction valueFunction, - PhysicalFunction tsFunction) +AlwaysEqBigintTbigintPhysicalFunction::AlwaysEqBigintTbigintPhysicalFunction(PhysicalFunction arg0Function, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction) { parameterFunctions.reserve(3); - parameterFunctions.push_back(std::move(scalarFunction)); + parameterFunctions.push_back(std::move(arg0Function)); parameterFunctions.push_back(std::move(valueFunction)); parameterFunctions.push_back(std::move(tsFunction)); } @@ -50,26 +50,35 @@ VarVal AlwaysEqBigintTbigintPhysicalFunction::execute(const Record& record, Aren std::vector parameterValues; parameterValues.reserve(parameterFunctions.size()); for (const auto& function : parameterFunctions) + { parameterValues.emplace_back(function.execute(record, arena)); + } - auto scalar = parameterValues[0].cast>(); - auto value = parameterValues[1].cast>(); - auto ts = parameterValues[2].cast>(); + auto arg0 = parameterValues[0].cast>(); + auto value = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); const auto result = nautilus::invoke( - +[](double d, double v, uint64_t t) -> double { - try { + +[](double arg0, + double value, + uint64_t ts) -> int { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); - std::string wkt = fmt::format("{}@{}", static_cast(v), ts_str); - Temporal* temp = tbigint_in(wkt.c_str()); - if (!temp) return 0.0; - int r = always_eq_bigint_tbigint(static_cast(d), temp); + std::string tempWkt = fmt::format("{}@{}", static_cast(value), MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tbigint_in(tempWkt.c_str()); + if (!temp) return 0; + + int r = always_eq_bigint_tbigint(static_cast(arg0), temp); free(temp); - return static_cast(r); - } catch (const std::exception&) { return 0.0; } + return r; + } + catch (const std::exception&) + { + return 0; + } }, - scalar, value, ts); + arg0, value, ts); return VarVal(result); } diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysEqBoolTboolPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysEqBoolTboolPhysicalFunction.cpp index 58a56e62f0..ba0f5654ae 100644 --- a/nes-physical-operators/src/Functions/Meos/AlwaysEqBoolTboolPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/AlwaysEqBoolTboolPhysicalFunction.cpp @@ -35,12 +35,12 @@ extern "C" { namespace NES { -AlwaysEqBoolTboolPhysicalFunction::AlwaysEqBoolTboolPhysicalFunction(PhysicalFunction scalarFunction, - PhysicalFunction valueFunction, - PhysicalFunction tsFunction) +AlwaysEqBoolTboolPhysicalFunction::AlwaysEqBoolTboolPhysicalFunction(PhysicalFunction arg0Function, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction) { parameterFunctions.reserve(3); - parameterFunctions.push_back(std::move(scalarFunction)); + parameterFunctions.push_back(std::move(arg0Function)); parameterFunctions.push_back(std::move(valueFunction)); parameterFunctions.push_back(std::move(tsFunction)); } @@ -50,26 +50,35 @@ VarVal AlwaysEqBoolTboolPhysicalFunction::execute(const Record& record, ArenaRef std::vector parameterValues; parameterValues.reserve(parameterFunctions.size()); for (const auto& function : parameterFunctions) + { parameterValues.emplace_back(function.execute(record, arena)); + } - auto scalar = parameterValues[0].cast>(); - auto value = parameterValues[1].cast>(); - auto ts = parameterValues[2].cast>(); + auto arg0 = parameterValues[0].cast>(); + auto value = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); const auto result = nautilus::invoke( - +[](double b, double v, uint64_t t) -> double { - try { + +[](double arg0, + double value, + uint64_t ts) -> int { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); - std::string wkt = fmt::format("{}@{}", (v != 0.0 ? "t" : "f"), ts_str); - Temporal* temp = tbool_in(wkt.c_str()); - if (!temp) return 0.0; - int r = always_eq_bool_tbool(static_cast(b != 0.0), temp); + std::string tempWkt = fmt::format("{}@{}", value != 0.0 ? "t" : "f", MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tbool_in(tempWkt.c_str()); + if (!temp) return 0; + + int r = always_eq_bool_tbool(static_cast(arg0 != 0.0), temp); free(temp); - return static_cast(r); - } catch (const std::exception&) { return 0.0; } + return r; + } + catch (const std::exception&) + { + return 0; + } }, - scalar, value, ts); + arg0, value, ts); return VarVal(result); } diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysEqNpointTnpointPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysEqNpointTnpointPhysicalFunction.cpp index fc8c94d546..3cc05433d2 100644 --- a/nes-physical-operators/src/Functions/Meos/AlwaysEqNpointTnpointPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/AlwaysEqNpointTnpointPhysicalFunction.cpp @@ -13,61 +13,85 @@ */ #include + #include #include #include +#include #include #include #include #include +#include #include +#include #include #include -#include -#include extern "C" { #include -#include #include } namespace NES { -AlwaysEqNpointTnpointPhysicalFunction::AlwaysEqNpointTnpointPhysicalFunction(PhysicalFunction rid_np, PhysicalFunction pos_np, PhysicalFunction rid_tp, PhysicalFunction pos_tp, PhysicalFunction ts) +AlwaysEqNpointTnpointPhysicalFunction::AlwaysEqNpointTnpointPhysicalFunction(PhysicalFunction rid0Function, + PhysicalFunction frac0Function, + PhysicalFunction ridFunction, + PhysicalFunction fracFunction, + PhysicalFunction tsFunction) { - paramFns.reserve(5); - paramFns.push_back(std::move(rid_np)); - paramFns.push_back(std::move(pos_np)); - paramFns.push_back(std::move(rid_tp)); - paramFns.push_back(std::move(pos_tp)); - paramFns.push_back(std::move(ts)); + parameterFunctions.reserve(5); + parameterFunctions.push_back(std::move(rid0Function)); + parameterFunctions.push_back(std::move(frac0Function)); + parameterFunctions.push_back(std::move(ridFunction)); + parameterFunctions.push_back(std::move(fracFunction)); + parameterFunctions.push_back(std::move(tsFunction)); } VarVal AlwaysEqNpointTnpointPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto rid_np = paramFns[0].execute(record, arena).cast(); - auto pos_np = paramFns[1].execute(record, arena).cast(); - auto rid_tp = paramFns[2].execute(record, arena).cast(); - auto pos_tp = paramFns[3].execute(record, arena).cast(); - auto ts = paramFns[4].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto rid0 = parameterValues[0].cast>(); + auto frac0 = parameterValues[1].cast>(); + auto rid = parameterValues[2].cast>(); + auto frac = parameterValues[3].cast>(); + auto ts = parameterValues[4].cast>(); + const auto result = nautilus::invoke( - +[](uint64_t rid_np, double pos_np, uint64_t rid_tp, double pos_tp, uint64_t ts) -> double { - try { + +[](uint64_t rid0, + double frac0, + int64_t rid, + double frac, + uint64_t ts) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - Npoint* np_s = npoint_make((int64_t)rid_np, pos_np); - if (!np_s) return 0.0; - Npoint* np_t = npoint_make((int64_t)rid_tp, pos_tp); - if (!np_t) { free(np_s); return 0.0; } - Temporal* inst = (Temporal*)tnpointinst_make(np_t, (TimestampTz)ts); - free(np_t); - if (!inst) { free(np_s); return 0.0; } - int r = always_eq_npoint_tnpoint(np_s, inst); - free(np_s); free(inst); - return r > 0 ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + if (frac < 0.0 || frac > 1.0) return 0.0; + std::string tempWkt = fmt::format("NPoint({},{})@{}", rid, frac, MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tnpoint_in(tempWkt.c_str()); + if (!temp) return 0.0; + Npoint* np0 = npoint_make((int64_t)rid0, frac0); + if (!np0) { free(temp); return 0.0; } + + double r = always_eq_npoint_tnpoint(np0, temp); + free(temp); + free(np0); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, - rid_np, pos_np, rid_tp, pos_tp, ts); + rid0, frac0, rid, frac, ts); + return VarVal(result); } @@ -77,12 +101,12 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterA PRECONDITION(arguments.childFunctions.size() == 5, "AlwaysEqNpointTnpointPhysicalFunction requires 5 children but got {}", arguments.childFunctions.size()); - return AlwaysEqNpointTnpointPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2]), - std::move(arguments.childFunctions[3]), - std::move(arguments.childFunctions[4])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + return AlwaysEqNpointTnpointPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysEqPoseTposePhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysEqPoseTposePhysicalFunction.cpp index 036c8801dd..4bc1bea0b1 100644 --- a/nes-physical-operators/src/Functions/Meos/AlwaysEqPoseTposePhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/AlwaysEqPoseTposePhysicalFunction.cpp @@ -13,65 +13,92 @@ */ #include + #include #include #include +#include #include #include #include #include +#include #include +#include #include #include -#include -#include extern "C" { #include -#include #include } namespace NES { -AlwaysEqPoseTposePhysicalFunction::AlwaysEqPoseTposePhysicalFunction(PhysicalFunction x2, PhysicalFunction y2, PhysicalFunction theta2, PhysicalFunction x, PhysicalFunction y, PhysicalFunction theta, PhysicalFunction ts) +AlwaysEqPoseTposePhysicalFunction::AlwaysEqPoseTposePhysicalFunction(PhysicalFunction px0Function, + PhysicalFunction py0Function, + PhysicalFunction ptheta0Function, + PhysicalFunction xFunction, + PhysicalFunction yFunction, + PhysicalFunction thetaFunction, + PhysicalFunction tsFunction) { - paramFns.reserve(7); - paramFns.push_back(std::move(x2)); - paramFns.push_back(std::move(y2)); - paramFns.push_back(std::move(theta2)); - paramFns.push_back(std::move(x)); - paramFns.push_back(std::move(y)); - paramFns.push_back(std::move(theta)); - paramFns.push_back(std::move(ts)); + parameterFunctions.reserve(7); + parameterFunctions.push_back(std::move(px0Function)); + parameterFunctions.push_back(std::move(py0Function)); + parameterFunctions.push_back(std::move(ptheta0Function)); + parameterFunctions.push_back(std::move(xFunction)); + parameterFunctions.push_back(std::move(yFunction)); + parameterFunctions.push_back(std::move(thetaFunction)); + parameterFunctions.push_back(std::move(tsFunction)); } VarVal AlwaysEqPoseTposePhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto x2 = paramFns[0].execute(record, arena).cast(); - auto y2 = paramFns[1].execute(record, arena).cast(); - auto theta2 = paramFns[2].execute(record, arena).cast(); - auto x = paramFns[3].execute(record, arena).cast(); - auto y = paramFns[4].execute(record, arena).cast(); - auto theta = paramFns[5].execute(record, arena).cast(); - auto ts = paramFns[6].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto px0 = parameterValues[0].cast>(); + auto py0 = parameterValues[1].cast>(); + auto ptheta0 = parameterValues[2].cast>(); + auto x = parameterValues[3].cast>(); + auto y = parameterValues[4].cast>(); + auto theta = parameterValues[5].cast>(); + auto ts = parameterValues[6].cast>(); + const auto result = nautilus::invoke( - +[](double x2, double y2, double theta2, double x, double y, double theta, uint64_t ts) -> double { - try { + +[](double px0, + double py0, + double ptheta0, + double x, + double y, + double theta, + uint64_t ts) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - Pose* pose_s = pose_make_2d(x2, y2, theta2, false, 0); - if (!pose_s) return 0.0; - Pose* pose_t = pose_make_2d(x, y, theta, false, 0); - if (!pose_t) { free(pose_s); return 0.0; } - Temporal* inst = (Temporal*)tposeinst_make(pose_t, (TimestampTz)ts); - free(pose_t); - if (!inst) { free(pose_s); return 0.0; } - int r = always_eq_pose_tpose(pose_s, inst); - free(pose_s); free(inst); - return r > 0 ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + std::string tempWkt = fmt::format("Pose(Point({} {}),{})@{}", x, y, theta, MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tpose_in(tempWkt.c_str()); + if (!temp) return 0.0; + Pose* pose0 = pose_make_2d(px0, py0, ptheta0, false, 0); + if (!pose0) { free(temp); return 0.0; } + + double r = always_eq_pose_tpose(pose0, temp); + free(temp); + free(pose0); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, - x2, y2, theta2, x, y, theta, ts); + px0, py0, ptheta0, x, y, theta, ts); + return VarVal(result); } @@ -81,14 +108,14 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterA PRECONDITION(arguments.childFunctions.size() == 7, "AlwaysEqPoseTposePhysicalFunction requires 7 children but got {}", arguments.childFunctions.size()); - return AlwaysEqPoseTposePhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2]), - std::move(arguments.childFunctions[3]), - std::move(arguments.childFunctions[4]), - std::move(arguments.childFunctions[5]), - std::move(arguments.childFunctions[6])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + auto arg5 = std::move(arguments.childFunctions[5]); + auto arg6 = std::move(arguments.childFunctions[6]); + return AlwaysEqPoseTposePhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysEqTbigintBigintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysEqTbigintBigintPhysicalFunction.cpp index 83f88e654b..3db4be6912 100644 --- a/nes-physical-operators/src/Functions/Meos/AlwaysEqTbigintBigintPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/AlwaysEqTbigintBigintPhysicalFunction.cpp @@ -36,13 +36,13 @@ extern "C" { namespace NES { AlwaysEqTbigintBigintPhysicalFunction::AlwaysEqTbigintBigintPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction thresholdFunction, - PhysicalFunction tsFunction) + PhysicalFunction tsFunction, + PhysicalFunction arg0Function) { parameterFunctions.reserve(3); parameterFunctions.push_back(std::move(valueFunction)); - parameterFunctions.push_back(std::move(thresholdFunction)); parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } VarVal AlwaysEqTbigintBigintPhysicalFunction::execute(const Record& record, ArenaRef& arena) const @@ -50,25 +50,35 @@ VarVal AlwaysEqTbigintBigintPhysicalFunction::execute(const Record& record, Aren std::vector parameterValues; parameterValues.reserve(parameterFunctions.size()); for (const auto& function : parameterFunctions) + { parameterValues.emplace_back(function.execute(record, arena)); + } - auto value = parameterValues[0].cast>(); - auto threshold = parameterValues[1].cast>(); - auto ts = parameterValues[2].cast>(); + auto value = parameterValues[0].cast>(); + auto ts = parameterValues[1].cast>(); + auto arg0 = parameterValues[2].cast>(); const auto result = nautilus::invoke( - +[](double value, double threshold, uint64_t ts) -> double { - try { + +[](double value, + uint64_t ts, + double arg0) -> int { + try + { MEOS::Meos::ensureMeosInitialized(); std::string tempWkt = fmt::format("{}@{}", static_cast(value), MEOS::Meos::convertEpochToTimestamp(ts)); Temporal* temp = tbigint_in(tempWkt.c_str()); - if (!temp) return 0.0; - int r = always_eq_tbigint_bigint(temp, static_cast(threshold)); + if (!temp) return 0; + + int r = always_eq_tbigint_bigint(temp, static_cast(arg0)); free(temp); - return static_cast(r); - } catch (const std::exception&) { return 0.0; } + return r; + } + catch (const std::exception&) + { + return 0; + } }, - value, threshold, ts); + value, ts, arg0); return VarVal(result); } diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysEqTboolBoolPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysEqTboolBoolPhysicalFunction.cpp index c661e73b5a..698f8f2659 100644 --- a/nes-physical-operators/src/Functions/Meos/AlwaysEqTboolBoolPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/AlwaysEqTboolBoolPhysicalFunction.cpp @@ -36,13 +36,13 @@ extern "C" { namespace NES { AlwaysEqTboolBoolPhysicalFunction::AlwaysEqTboolBoolPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction thresholdFunction, - PhysicalFunction tsFunction) + PhysicalFunction tsFunction, + PhysicalFunction arg0Function) { parameterFunctions.reserve(3); parameterFunctions.push_back(std::move(valueFunction)); - parameterFunctions.push_back(std::move(thresholdFunction)); parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } VarVal AlwaysEqTboolBoolPhysicalFunction::execute(const Record& record, ArenaRef& arena) const @@ -50,26 +50,35 @@ VarVal AlwaysEqTboolBoolPhysicalFunction::execute(const Record& record, ArenaRef std::vector parameterValues; parameterValues.reserve(parameterFunctions.size()); for (const auto& function : parameterFunctions) + { parameterValues.emplace_back(function.execute(record, arena)); + } - auto value = parameterValues[0].cast>(); - auto threshold = parameterValues[1].cast>(); - auto ts = parameterValues[2].cast>(); + auto value = parameterValues[0].cast>(); + auto ts = parameterValues[1].cast>(); + auto arg0 = parameterValues[2].cast>(); const auto result = nautilus::invoke( - +[](double v, double thr, uint64_t t) -> double { - try { + +[](double value, + uint64_t ts, + double arg0) -> int { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); - std::string wkt = fmt::format("{}@{}", (v != 0.0 ? "t" : "f"), ts_str); - Temporal* temp = tbool_in(wkt.c_str()); - if (!temp) return 0.0; - int r = always_eq_tbool_bool(temp, static_cast(thr != 0.0)); + std::string tempWkt = fmt::format("{}@{}", value != 0.0 ? "t" : "f", MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tbool_in(tempWkt.c_str()); + if (!temp) return 0; + + int r = always_eq_tbool_bool(temp, static_cast(arg0 != 0.0)); free(temp); - return static_cast(r); - } catch (const std::exception&) { return 0.0; } + return r; + } + catch (const std::exception&) + { + return 0; + } }, - value, threshold, ts); + value, ts, arg0); return VarVal(result); } diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysEqTcbufferTcbufferPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysEqTcbufferTcbufferPhysicalFunction.cpp index acd2036781..80b6c638bc 100644 --- a/nes-physical-operators/src/Functions/Meos/AlwaysEqTcbufferTcbufferPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/AlwaysEqTcbufferTcbufferPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -20,75 +21,88 @@ #include #include #include +#include #include +#include #include #include -#include -#include extern "C" { #include -#include #include } namespace NES { -AlwaysEqTcbufferTcbufferPhysicalFunction::AlwaysEqTcbufferTcbufferPhysicalFunction( - PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction r1, PhysicalFunction ts1, - PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction r2, PhysicalFunction ts2) +AlwaysEqTcbufferTcbufferPhysicalFunction::AlwaysEqTcbufferTcbufferPhysicalFunction(PhysicalFunction lonAFunction, + PhysicalFunction latAFunction, + PhysicalFunction radiusAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction lonBFunction, + PhysicalFunction latBFunction, + PhysicalFunction radiusBFunction, + PhysicalFunction tsBFunction) { - paramFns.reserve(8); - paramFns.push_back(std::move(lon1)); - paramFns.push_back(std::move(lat1)); - paramFns.push_back(std::move(r1)); - paramFns.push_back(std::move(ts1)); - paramFns.push_back(std::move(lon2)); - paramFns.push_back(std::move(lat2)); - paramFns.push_back(std::move(r2)); - paramFns.push_back(std::move(ts2)); + parameterFunctions.reserve(8); + parameterFunctions.push_back(std::move(lonAFunction)); + parameterFunctions.push_back(std::move(latAFunction)); + parameterFunctions.push_back(std::move(radiusAFunction)); + parameterFunctions.push_back(std::move(tsAFunction)); + parameterFunctions.push_back(std::move(lonBFunction)); + parameterFunctions.push_back(std::move(latBFunction)); + parameterFunctions.push_back(std::move(radiusBFunction)); + parameterFunctions.push_back(std::move(tsBFunction)); } VarVal AlwaysEqTcbufferTcbufferPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto lon1 = paramFns[0].execute(record, arena).cast(); - auto lat1 = paramFns[1].execute(record, arena).cast(); - auto r1 = paramFns[2].execute(record, arena).cast(); - auto ts1 = paramFns[3].execute(record, arena).cast(); - auto lon2 = paramFns[4].execute(record, arena).cast(); - auto lat2 = paramFns[5].execute(record, arena).cast(); - auto r2 = paramFns[6].execute(record, arena).cast(); - auto ts2 = paramFns[7].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto lonA = parameterValues[0].cast>(); + auto latA = parameterValues[1].cast>(); + auto radiusA = parameterValues[2].cast>(); + auto tsA = parameterValues[3].cast>(); + auto lonB = parameterValues[4].cast>(); + auto latB = parameterValues[5].cast>(); + auto radiusB = parameterValues[6].cast>(); + auto tsB = parameterValues[7].cast>(); const auto result = nautilus::invoke( - +[](double lon1, double lat1, double r1, uint64_t ts1, - double lon2, double lat2, double r2, uint64_t ts2) -> double { - try { + +[](double lonAValue, double latAValue, double radiusAValue, uint64_t tsAValue, + double lonBValue, double latBValue, double radiusBValue, uint64_t tsBValue) -> int { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string pt1 = fmt::format("POINT({} {})", lon1, lat1); - GSERIALIZED* gs1 = geom_in(pt1.c_str(), -1); - if (!gs1) return 0.0; - Cbuffer* cb1 = cbuffer_make(gs1, r1); - free(gs1); - if (!cb1) return 0.0; - Temporal* tcb1 = (Temporal*)tcbufferinst_make(cb1, (TimestampTz)ts1); - free(cb1); - if (!tcb1) return 0.0; - std::string pt2 = fmt::format("POINT({} {})", lon2, lat2); - GSERIALIZED* gs2 = geom_in(pt2.c_str(), -1); - if (!gs2) { free(tcb1); return 0.0; } - Cbuffer* cb2 = cbuffer_make(gs2, r2); - free(gs2); - if (!cb2) { free(tcb1); return 0.0; } - Temporal* tcb2 = (Temporal*)tcbufferinst_make(cb2, (TimestampTz)ts2); - free(cb2); - if (!tcb2) { free(tcb1); return 0.0; } - int r = always_eq_tcbuffer_tcbuffer(tcb1, tcb2); - free(tcb1); free(tcb2); - return r > 0 ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + if (!(lonAValue >= -180.0 && lonAValue <= 180.0 && latAValue >= -90.0 && latAValue <= 90.0)) return 0; + if (!(lonBValue >= -180.0 && lonBValue <= 180.0 && latBValue >= -90.0 && latBValue <= 90.0)) return 0; + if (radiusAValue < 0.0 || radiusBValue < 0.0) return 0; + + const std::string tsAString = MEOS::Meos::convertEpochToTimestamp(tsAValue); + const std::string tsBString = MEOS::Meos::convertEpochToTimestamp(tsBValue); + std::string wktA = fmt::format("Cbuffer(Point({} {}),{})@{}", lonAValue, latAValue, radiusAValue, tsAString); + std::string wktB = fmt::format("Cbuffer(Point({} {}),{})@{}", lonBValue, latBValue, radiusBValue, tsBString); + + Temporal* tA = tcbuffer_in(wktA.c_str()); + if (!tA) return 0; + Temporal* tB = tcbuffer_in(wktB.c_str()); + if (!tB) { free(tA); return 0; } + + int r = always_eq_tcbuffer_tcbuffer(tA, tB); + free(tA); + free(tB); + return r; + } + catch (const std::exception&) + { + return 0; + } }, - lon1, lat1, r1, ts1, lon2, lat2, r2, ts2); + lonA, latA, radiusA, tsA, lonB, latB, radiusB, tsB); return VarVal(result); } @@ -99,14 +113,15 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterA PRECONDITION(arguments.childFunctions.size() == 8, "AlwaysEqTcbufferTcbufferPhysicalFunction requires 8 children but got {}", arguments.childFunctions.size()); - return AlwaysEqTcbufferTcbufferPhysicalFunction(std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2]), - std::move(arguments.childFunctions[3]), - std::move(arguments.childFunctions[4]), - std::move(arguments.childFunctions[5]), - std::move(arguments.childFunctions[6]), - std::move(arguments.childFunctions[7])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + auto arg5 = std::move(arguments.childFunctions[5]); + auto arg6 = std::move(arguments.childFunctions[6]); + auto arg7 = std::move(arguments.childFunctions[7]); + return AlwaysEqTcbufferTcbufferPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6), std::move(arg7)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysEqTextTtextPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysEqTextTtextPhysicalFunction.cpp index 1d0db7a137..c63e52b8cd 100644 --- a/nes-physical-operators/src/Functions/Meos/AlwaysEqTextTtextPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/AlwaysEqTextTtextPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -33,44 +34,59 @@ extern "C" { namespace NES { -AlwaysEqTextTtextPhysicalFunction::AlwaysEqTextTtextPhysicalFunction( - PhysicalFunction valueFunction, PhysicalFunction refFunction, PhysicalFunction tsFunction) +AlwaysEqTextTtextPhysicalFunction::AlwaysEqTextTtextPhysicalFunction(PhysicalFunction arg0Function, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction) { - paramFns.reserve(3); - paramFns.push_back(std::move(valueFunction)); - paramFns.push_back(std::move(refFunction)); - paramFns.push_back(std::move(tsFunction)); + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(arg0Function)); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); } VarVal AlwaysEqTextTtextPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto ref = paramFns[0].execute(record, arena).cast(); - auto value = paramFns[1].execute(record, arena).cast(); - auto ts = paramFns[2].execute(record, arena).cast>(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto arg0 = parameterValues[0].cast(); + auto value = parameterValues[1].cast(); + auto ts = parameterValues[2].cast>(); const auto result = nautilus::invoke( - +[](const char* r, uint32_t rsz, const char* v, uint32_t vsz, uint64_t t) -> double { - try { + +[](const char* arg0Ptr, uint32_t arg0Size, + const char* valuePtr, uint32_t valueSize, + uint64_t ts) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string ref_str(r, rsz); - std::string val_str(v, vsz); - while (!ref_str.empty() && (ref_str.front() == '\'' || ref_str.front() == '"')) ref_str = ref_str.substr(1); - while (!ref_str.empty() && (ref_str.back() == '\'' || ref_str.back() == '"')) ref_str = ref_str.substr(0, ref_str.size()-1); - while (!val_str.empty() && (val_str.front() == '\'' || val_str.front() == '"')) val_str = val_str.substr(1); - while (!val_str.empty() && (val_str.back() == '\'' || val_str.back() == '"')) val_str = val_str.substr(0, val_str.size()-1); - std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); - std::string wkt = "'" + val_str + "'@" + ts_str; - Temporal* temp = ttext_in(wkt.c_str()); + std::string tempVal(valuePtr, valueSize); + while (!tempVal.empty() && (tempVal.front() == '\'' || tempVal.front() == '"')) tempVal.erase(tempVal.begin()); + while (!tempVal.empty() && (tempVal.back() == '\'' || tempVal.back() == '"')) tempVal.pop_back(); + std::string tempWkt = "'" + tempVal + "'@" + MEOS::Meos::convertEpochToTimestamp(ts); + Temporal* temp = ttext_in(tempWkt.c_str()); if (!temp) return 0.0; - text* txt = cstring_to_text(ref_str.c_str()); - if (!txt) { free(temp); return 0.0; } - int result = always_eq_text_ttext(txt, temp); + std::string arg0S(arg0Ptr, arg0Size); + while (!arg0S.empty() && (arg0S.front() == '\'' || arg0S.front() == '"')) arg0S.erase(arg0S.begin()); + while (!arg0S.empty() && (arg0S.back() == '\'' || arg0S.back() == '"')) arg0S.pop_back(); + text* txt0 = cstring_to_text(arg0S.c_str()); + if (!txt0) { free(temp); return 0.0; } + + double r = always_eq_text_ttext(txt0, temp); free(temp); - free(txt); - return static_cast(result); - } catch (const std::exception&) { return 0.0; } + free(txt0); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, - ref, value, ts); + arg0.getContent(), arg0.getContentSize(), value.getContent(), value.getContentSize(), ts); return VarVal(result); } @@ -81,10 +97,10 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterA PRECONDITION(arguments.childFunctions.size() == 3, "AlwaysEqTextTtextPhysicalFunction requires 3 children but got {}", arguments.childFunctions.size()); - return AlwaysEqTextTtextPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return AlwaysEqTextTtextPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysEqTgeoGeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysEqTgeoGeoPhysicalFunction.cpp index d834e46c81..92d056835a 100644 --- a/nes-physical-operators/src/Functions/Meos/AlwaysEqTgeoGeoPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/AlwaysEqTgeoGeoPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -34,40 +35,75 @@ extern "C" { namespace NES { -AlwaysEqTgeoGeoPhysicalFunction::AlwaysEqTgeoGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, - PhysicalFunction ts, PhysicalFunction wkt) +AlwaysEqTgeoGeoPhysicalFunction::AlwaysEqTgeoGeoPhysicalFunction(PhysicalFunction lonFunction, + PhysicalFunction latFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction) { - paramFns.reserve(4); - paramFns.push_back(std::move(lon)); - paramFns.push_back(std::move(lat)); - paramFns.push_back(std::move(ts)); - paramFns.push_back(std::move(wkt)); + parameterFunctions.reserve(4); + parameterFunctions.push_back(std::move(lonFunction)); + parameterFunctions.push_back(std::move(latFunction)); + parameterFunctions.push_back(std::move(timestampFunction)); + parameterFunctions.push_back(std::move(geometryFunction)); } VarVal AlwaysEqTgeoGeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto lon = paramFns[0].execute(record, arena).cast(); - auto lat = paramFns[1].execute(record, arena).cast(); - auto ts = paramFns[2].execute(record, arena).cast(); - auto wkt = paramFns[3].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto lon = parameterValues[0].cast>(); + auto lat = parameterValues[1].cast>(); + auto timestamp = parameterValues[2].cast>(); + auto geometry = parameterValues[3].cast(); const auto result = nautilus::invoke( - +[](double lon, double lat, uint64_t ts, - const char* w, uint32_t wsz) -> double { - try { + +[](double lonValue, + double latValue, + uint64_t timestampValue, + const char* geometryPtr, + uint32_t geometrySize) -> int { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string wktStr(w, wsz); - std::string tgeoWkt = fmt::format("SRID=4326;POINT({},{})@{}", lon, lat, ts); - Temporal* tgeo = tgeompoint_in(tgeoWkt.c_str()); - if (!tgeo) return 0.0; - GSERIALIZED* gs = geom_in(wktStr.c_str(), -1); - if (!gs) { free(tgeo); return 0.0; } - double r = always_eq_tgeo_geo(tgeo, gs) > 0 ? 1.0 : 0.0; - free(tgeo); free(gs); - return r; - } catch (const std::exception&) { return 0.0; } + if (!(lonValue >= -180.0 && lonValue <= 180.0 && latValue >= -90.0 && latValue <= 90.0)) { + return 0; + } + + const std::string timestampString = MEOS::Meos::convertEpochToTimestamp(timestampValue); + std::string temporalGeometryWkt = fmt::format("SRID=4326;Point({} {})@{}", lonValue, latValue, timestampString); + std::string staticGeometryWkt(geometryPtr, geometrySize); + + while (!staticGeometryWkt.empty() && (staticGeometryWkt.front() == '\'' || staticGeometryWkt.front() == '"')) + staticGeometryWkt.erase(staticGeometryWkt.begin()); + while (!staticGeometryWkt.empty() && (staticGeometryWkt.back() == '\'' || staticGeometryWkt.back() == '"')) + staticGeometryWkt.pop_back(); + + if (temporalGeometryWkt.empty() || staticGeometryWkt.empty()) + return 0; + + MEOS::Meos::TemporalGeometry temporalGeometry(temporalGeometryWkt); + if (!temporalGeometry.getGeometry()) return 0; + MEOS::Meos::StaticGeometry staticGeometry(staticGeometryWkt); + if (!staticGeometry.getGeometry()) return 0; + + // MEOS spatial-relation call — same shape as TemporalEDWithin's + // edwithin_tgeo_geo, but specific MEOS function per generated operator. + // Real MEOS spatial-rel signature: int fn(const Temporal *, const GSERIALIZED *) + // (no `atstart` flag — that's specific to geog_dwithin / edwithin's 3-arg variant). + return always_eq_tgeo_geo(temporalGeometry.getGeometry(), + staticGeometry.getGeometry()); + } + catch (const std::exception&) + { + return 0; + } }, - lon, lat, ts, wkt); + lon, lat, timestamp, geometry.getContent(), geometry.getContentSize()); return VarVal(result); } @@ -78,10 +114,11 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterA PRECONDITION(arguments.childFunctions.size() == 4, "AlwaysEqTgeoGeoPhysicalFunction requires 4 children but got {}", arguments.childFunctions.size()); - return AlwaysEqTgeoGeoPhysicalFunction(std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2]), - std::move(arguments.childFunctions[3])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + return AlwaysEqTgeoGeoPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysEqTgeoTgeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysEqTgeoTgeoPhysicalFunction.cpp index 5a019e301f..c5ea551f07 100644 --- a/nes-physical-operators/src/Functions/Meos/AlwaysEqTgeoTgeoPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/AlwaysEqTgeoTgeoPhysicalFunction.cpp @@ -13,10 +13,10 @@ */ #include + #include #include #include -#include #include #include #include @@ -34,42 +34,68 @@ extern "C" { namespace NES { -AlwaysEqTgeoTgeoPhysicalFunction::AlwaysEqTgeoTgeoPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction ts1, PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction ts2) +AlwaysEqTgeoTgeoPhysicalFunction::AlwaysEqTgeoTgeoPhysicalFunction(PhysicalFunction lonAFunction, + PhysicalFunction latAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction lonBFunction, + PhysicalFunction latBFunction, + PhysicalFunction tsBFunction) { - paramFns.reserve(6); - paramFns.push_back(std::move(lon1)); - paramFns.push_back(std::move(lat1)); - paramFns.push_back(std::move(ts1)); - paramFns.push_back(std::move(lon2)); - paramFns.push_back(std::move(lat2)); - paramFns.push_back(std::move(ts2)); + parameterFunctions.reserve(6); + parameterFunctions.push_back(std::move(lonAFunction)); + parameterFunctions.push_back(std::move(latAFunction)); + parameterFunctions.push_back(std::move(tsAFunction)); + parameterFunctions.push_back(std::move(lonBFunction)); + parameterFunctions.push_back(std::move(latBFunction)); + parameterFunctions.push_back(std::move(tsBFunction)); } VarVal AlwaysEqTgeoTgeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto lon1 = paramFns[0].execute(record, arena).cast(); - auto lat1 = paramFns[1].execute(record, arena).cast(); - auto ts1 = paramFns[2].execute(record, arena).cast(); - auto lon2 = paramFns[3].execute(record, arena).cast(); - auto lat2 = paramFns[4].execute(record, arena).cast(); - auto ts2 = paramFns[5].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto lonA = parameterValues[0].cast>(); + auto latA = parameterValues[1].cast>(); + auto tsA = parameterValues[2].cast>(); + auto lonB = parameterValues[3].cast>(); + auto latB = parameterValues[4].cast>(); + auto tsB = parameterValues[5].cast>(); + const auto result = nautilus::invoke( - +[](double lon1, double lat1, uint64_t ts1, - double lon2, double lat2, uint64_t ts2) -> double { - try { + +[](double lonAValue, double latAValue, uint64_t tsAValue, + double lonBValue, double latBValue, uint64_t tsBValue) -> int { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string wkt1 = fmt::format("SRID=4326;POINT({},{})@{}", lon1, lat1, ts1); - Temporal* t1 = tgeompoint_in(wkt1.c_str()); - if (!t1) return 0.0; - std::string wkt2 = fmt::format("SRID=4326;POINT({},{})@{}", lon2, lat2, ts2); - Temporal* t2 = tgeompoint_in(wkt2.c_str()); - if (!t2) { free(t1); return 0.0; } - int r = always_eq_tgeo_tgeo(t1, t2); - free(t1); free(t2); - return r > 0 ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + if (!(lonAValue >= -180.0 && lonAValue <= 180.0 && latAValue >= -90.0 && latAValue <= 90.0)) return 0; + if (!(lonBValue >= -180.0 && lonBValue <= 180.0 && latBValue >= -90.0 && latBValue <= 90.0)) return 0; + + const std::string tsAString = MEOS::Meos::convertEpochToTimestamp(tsAValue); + const std::string tsBString = MEOS::Meos::convertEpochToTimestamp(tsBValue); + std::string temporalGeometryAWkt = fmt::format("SRID=4326;Point({} {})@{}", lonAValue, latAValue, tsAString); + std::string temporalGeometryBWkt = fmt::format("SRID=4326;Point({} {})@{}", lonBValue, latBValue, tsBString); + + MEOS::Meos::TemporalGeometry temporalGeometryA(temporalGeometryAWkt); + if (!temporalGeometryA.getGeometry()) return 0; + MEOS::Meos::TemporalGeometry temporalGeometryB(temporalGeometryBWkt); + if (!temporalGeometryB.getGeometry()) return 0; + + // MEOS *_tgeo_tgeo spatial-relation: int fn(const Temporal*, const Temporal*). + return always_eq_tgeo_tgeo(temporalGeometryA.getGeometry(), + temporalGeometryB.getGeometry()); + } + catch (const std::exception&) + { + return 0; + } }, - lon1, lat1, ts1, lon2, lat2, ts2); + lonA, latA, tsA, lonB, latB, tsB); + return VarVal(result); } @@ -79,13 +105,13 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterA PRECONDITION(arguments.childFunctions.size() == 6, "AlwaysEqTgeoTgeoPhysicalFunction requires 6 children but got {}", arguments.childFunctions.size()); - return AlwaysEqTgeoTgeoPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2]), - std::move(arguments.childFunctions[3]), - std::move(arguments.childFunctions[4]), - std::move(arguments.childFunctions[5])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + auto arg5 = std::move(arguments.childFunctions[5]); + return AlwaysEqTgeoTgeoPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysEqTh3indexH3indexPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysEqTh3indexH3indexPhysicalFunction.cpp index 567249216c..4f017c6342 100644 --- a/nes-physical-operators/src/Functions/Meos/AlwaysEqTh3indexH3indexPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/AlwaysEqTh3indexH3indexPhysicalFunction.cpp @@ -13,14 +13,18 @@ */ #include + #include #include #include +#include #include #include #include #include +#include #include +#include #include #include @@ -31,33 +35,49 @@ extern "C" { namespace NES { -AlwaysEqTh3indexH3indexPhysicalFunction::AlwaysEqTh3indexH3indexPhysicalFunction(PhysicalFunction cell, PhysicalFunction ts, - PhysicalFunction target) +AlwaysEqTh3indexH3indexPhysicalFunction::AlwaysEqTh3indexH3indexPhysicalFunction(PhysicalFunction cellFunction, + PhysicalFunction tsFunction, + PhysicalFunction arg0Function) { - paramFns.reserve(3); - paramFns.push_back(std::move(cell)); - paramFns.push_back(std::move(ts)); - paramFns.push_back(std::move(target)); + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(cellFunction)); + parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } VarVal AlwaysEqTh3indexH3indexPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto cell = paramFns[0].execute(record, arena).cast(); - auto ts = paramFns[1].execute(record, arena).cast(); - auto target = paramFns[2].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto cell = parameterValues[0].cast>(); + auto ts = parameterValues[1].cast>(); + auto arg0 = parameterValues[2].cast>(); const auto result = nautilus::invoke( - +[](uint64_t cell, uint64_t ts, uint64_t target) -> double { - try { + +[](uint64_t cell, + uint64_t ts, + uint64_t arg0) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - Temporal* inst = th3indexinst_make((H3Index)cell, (TimestampTz)ts); - if (!inst) return 0.0; - int r = always_eq_th3index_h3index(inst, (H3Index)target); - free(inst); - return r > 0 ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + Temporal* temp = th3indexinst_make((H3Index)cell, (TimestampTz)ts); + if (!temp) return 0.0; + + double r = always_eq_th3index_h3index(temp, (H3Index)arg0); + free(temp); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, - cell, ts, target); + cell, ts, arg0); return VarVal(result); } @@ -68,9 +88,10 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterA PRECONDITION(arguments.childFunctions.size() == 3, "AlwaysEqTh3indexH3indexPhysicalFunction requires 3 children but got {}", arguments.childFunctions.size()); - return AlwaysEqTh3indexH3indexPhysicalFunction(std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return AlwaysEqTh3indexH3indexPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysEqTjsonbJsonbPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysEqTjsonbJsonbPhysicalFunction.cpp index df011191c4..ef7f4a795d 100644 --- a/nes-physical-operators/src/Functions/Meos/AlwaysEqTjsonbJsonbPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/AlwaysEqTjsonbJsonbPhysicalFunction.cpp @@ -13,18 +13,20 @@ */ #include + #include #include #include +#include #include #include #include #include +#include #include +#include #include #include -#include -#include extern "C" { #include @@ -33,40 +35,58 @@ extern "C" { namespace NES { -AlwaysEqTjsonbJsonbPhysicalFunction::AlwaysEqTjsonbJsonbPhysicalFunction(PhysicalFunction json_str, PhysicalFunction ts, PhysicalFunction target_json) +AlwaysEqTjsonbJsonbPhysicalFunction::AlwaysEqTjsonbJsonbPhysicalFunction(PhysicalFunction json_strFunction, + PhysicalFunction tsFunction, + PhysicalFunction arg0Function) { - paramFns.reserve(3); - paramFns.push_back(std::move(json_str)); - paramFns.push_back(std::move(ts)); - paramFns.push_back(std::move(target_json)); + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(json_strFunction)); + parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } VarVal AlwaysEqTjsonbJsonbPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto json_str = paramFns[0].execute(record, arena); - auto ts = paramFns[1].execute(record, arena).cast(); - auto target_json = paramFns[2].execute(record, arena); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto json_str = parameterValues[0].cast(); + auto ts = parameterValues[1].cast>(); + auto arg0 = parameterValues[2].cast(); + const auto result = nautilus::invoke( - +[](const char* json_str, uint32_t json_len, uint64_t ts, const char* target_json, uint32_t target_len) -> double { - try { + +[](const char* json_strPtr, uint32_t json_strSize, + uint64_t ts, + const char* arg0Ptr, uint32_t arg0Size) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - char* s1 = (char*)malloc(json_len + 1); - memcpy(s1, json_str, json_len); s1[json_len] = '\0'; - Jsonb* jb = jsonb_in(s1); free(s1); - if (!jb) return 0.0; - TInstant* inst = tjsonbinst_make(jb, (TimestampTz)ts); - free(jb); - if (!inst) return 0.0; - char* s2 = (char*)malloc(target_len + 1); - memcpy(s2, target_json, target_len); s2[target_len] = '\0'; - Jsonb* target = jsonb_in(s2); free(s2); - if (!target) { free(inst); return 0.0; } - bool r = always_eq_tjsonb_jsonb((Temporal*)inst, target) > 0; - free(inst); free(target); - return r ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + std::string tempS(json_strPtr, json_strSize); + Jsonb* tempJb = jsonb_in(tempS.c_str()); + if (!tempJb) return 0.0; + Temporal* temp = (Temporal*)tjsonbinst_make(tempJb, (TimestampTz)ts); + free(tempJb); + if (!temp) return 0.0; + std::string arg0S(arg0Ptr, arg0Size); + Jsonb* jb0 = jsonb_in(arg0S.c_str()); + if (!jb0) { free(temp); return 0.0; } + + double r = always_eq_tjsonb_jsonb(temp, jb0); + free(temp); + free(jb0); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, - json_str, ts, target_json); + json_str.getContent(), json_str.getContentSize(), ts, arg0.getContent(), arg0.getContentSize()); + return VarVal(result); } @@ -76,10 +96,10 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterA PRECONDITION(arguments.childFunctions.size() == 3, "AlwaysEqTjsonbJsonbPhysicalFunction requires 3 children but got {}", arguments.childFunctions.size()); - return AlwaysEqTjsonbJsonbPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return AlwaysEqTjsonbJsonbPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysEqTjsonbTjsonbPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysEqTjsonbTjsonbPhysicalFunction.cpp index ec8932d190..3b826a5e5e 100644 --- a/nes-physical-operators/src/Functions/Meos/AlwaysEqTjsonbTjsonbPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/AlwaysEqTjsonbTjsonbPhysicalFunction.cpp @@ -13,18 +13,20 @@ */ #include + #include #include #include +#include #include #include #include #include +#include #include +#include #include #include -#include -#include extern "C" { #include @@ -33,45 +35,65 @@ extern "C" { namespace NES { -AlwaysEqTjsonbTjsonbPhysicalFunction::AlwaysEqTjsonbTjsonbPhysicalFunction(PhysicalFunction json1, PhysicalFunction ts1, PhysicalFunction json2, PhysicalFunction ts2) +AlwaysEqTjsonbTjsonbPhysicalFunction::AlwaysEqTjsonbTjsonbPhysicalFunction(PhysicalFunction json_strFunction, + PhysicalFunction tsFunction, + PhysicalFunction json0Function, + PhysicalFunction ts0Function) { - paramFns.reserve(4); - paramFns.push_back(std::move(json1)); - paramFns.push_back(std::move(ts1)); - paramFns.push_back(std::move(json2)); - paramFns.push_back(std::move(ts2)); + parameterFunctions.reserve(4); + parameterFunctions.push_back(std::move(json_strFunction)); + parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(json0Function)); + parameterFunctions.push_back(std::move(ts0Function)); } VarVal AlwaysEqTjsonbTjsonbPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto json1 = paramFns[0].execute(record, arena); - auto ts1 = paramFns[1].execute(record, arena).cast(); - auto json2 = paramFns[2].execute(record, arena); - auto ts2 = paramFns[3].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto json_str = parameterValues[0].cast(); + auto ts = parameterValues[1].cast>(); + auto json0 = parameterValues[2].cast(); + auto ts0 = parameterValues[3].cast>(); + const auto result = nautilus::invoke( - +[](const char* json1, uint32_t json1_len, uint64_t ts1, const char* json2, uint32_t json2_len, uint64_t ts2) -> double { - try { + +[](const char* json_strPtr, uint32_t json_strSize, + uint64_t ts, + const char* json0Ptr, uint32_t json0Size, + uint64_t ts0) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - char* s1 = (char*)malloc(json1_len + 1); - memcpy(s1, json1, json1_len); s1[json1_len] = '\0'; - Jsonb* jb1 = jsonb_in(s1); free(s1); - if (!jb1) return 0.0; - TInstant* inst1 = tjsonbinst_make(jb1, (TimestampTz)ts1); - free(jb1); - if (!inst1) return 0.0; - char* s2 = (char*)malloc(json2_len + 1); - memcpy(s2, json2, json2_len); s2[json2_len] = '\0'; - Jsonb* jb2 = jsonb_in(s2); free(s2); - if (!jb2) { free(inst1); return 0.0; } - TInstant* inst2 = tjsonbinst_make(jb2, (TimestampTz)ts2); - free(jb2); - if (!inst2) { free(inst1); return 0.0; } - int r = always_eq_tjsonb_tjsonb((Temporal*)inst1, (Temporal*)inst2); - free(inst1); free(inst2); - return r > 0 ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + std::string tempS(json_strPtr, json_strSize); + Jsonb* tempJb = jsonb_in(tempS.c_str()); + if (!tempJb) return 0.0; + Temporal* temp = (Temporal*)tjsonbinst_make(tempJb, (TimestampTz)ts); + free(tempJb); + if (!temp) return 0.0; + std::string json0S(json0Ptr, json0Size); + Jsonb* jb0 = jsonb_in(json0S.c_str()); + if (!jb0) { free(temp); return 0.0; } + Temporal* inst0 = (Temporal*)tjsonbinst_make(jb0, (TimestampTz)ts0); + free(jb0); + if (!inst0) { free(temp); return 0.0; } + + double r = always_eq_tjsonb_tjsonb(temp, inst0); + free(temp); + free(inst0); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, - json1, ts1, json2, ts2); + json_str.getContent(), json_str.getContentSize(), ts, json0.getContent(), json0.getContentSize(), ts0); + return VarVal(result); } @@ -81,11 +103,11 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterA PRECONDITION(arguments.childFunctions.size() == 4, "AlwaysEqTjsonbTjsonbPhysicalFunction requires 4 children but got {}", arguments.childFunctions.size()); - return AlwaysEqTjsonbTjsonbPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2]), - std::move(arguments.childFunctions[3])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + return AlwaysEqTjsonbTjsonbPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysEqTnpointNpointPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysEqTnpointNpointPhysicalFunction.cpp index 41a5538a86..090cd36c3f 100644 --- a/nes-physical-operators/src/Functions/Meos/AlwaysEqTnpointNpointPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/AlwaysEqTnpointNpointPhysicalFunction.cpp @@ -13,61 +13,85 @@ */ #include + #include #include #include +#include #include #include #include #include +#include #include +#include #include #include -#include -#include extern "C" { #include -#include #include } namespace NES { -AlwaysEqTnpointNpointPhysicalFunction::AlwaysEqTnpointNpointPhysicalFunction(PhysicalFunction rid1, PhysicalFunction pos1, PhysicalFunction ts, PhysicalFunction rid2, PhysicalFunction pos2) +AlwaysEqTnpointNpointPhysicalFunction::AlwaysEqTnpointNpointPhysicalFunction(PhysicalFunction ridFunction, + PhysicalFunction fracFunction, + PhysicalFunction tsFunction, + PhysicalFunction rid0Function, + PhysicalFunction frac0Function) { - paramFns.reserve(5); - paramFns.push_back(std::move(rid1)); - paramFns.push_back(std::move(pos1)); - paramFns.push_back(std::move(ts)); - paramFns.push_back(std::move(rid2)); - paramFns.push_back(std::move(pos2)); + parameterFunctions.reserve(5); + parameterFunctions.push_back(std::move(ridFunction)); + parameterFunctions.push_back(std::move(fracFunction)); + parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(rid0Function)); + parameterFunctions.push_back(std::move(frac0Function)); } VarVal AlwaysEqTnpointNpointPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto rid1 = paramFns[0].execute(record, arena).cast(); - auto pos1 = paramFns[1].execute(record, arena).cast(); - auto ts = paramFns[2].execute(record, arena).cast(); - auto rid2 = paramFns[3].execute(record, arena).cast(); - auto pos2 = paramFns[4].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto rid = parameterValues[0].cast>(); + auto frac = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + auto rid0 = parameterValues[3].cast>(); + auto frac0 = parameterValues[4].cast>(); + const auto result = nautilus::invoke( - +[](uint64_t rid1, double pos1, uint64_t ts, uint64_t rid2, double pos2) -> double { - try { + +[](int64_t rid, + double frac, + uint64_t ts, + uint64_t rid0, + double frac0) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - Npoint* np1 = npoint_make((int64_t)rid1, pos1); - if (!np1) return 0.0; - Temporal* inst = (Temporal*)tnpointinst_make(np1, (TimestampTz)ts); - free(np1); - if (!inst) return 0.0; - Npoint* np2 = npoint_make((int64_t)rid2, pos2); - if (!np2) { free(inst); return 0.0; } - int r = always_eq_tnpoint_npoint(inst, np2); - free(inst); free(np2); - return r > 0 ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + if (frac < 0.0 || frac > 1.0) return 0.0; + std::string tempWkt = fmt::format("NPoint({},{})@{}", rid, frac, MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tnpoint_in(tempWkt.c_str()); + if (!temp) return 0.0; + Npoint* np0 = npoint_make((int64_t)rid0, frac0); + if (!np0) { free(temp); return 0.0; } + + double r = always_eq_tnpoint_npoint(temp, np0); + free(temp); + free(np0); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, - rid1, pos1, ts, rid2, pos2); + rid, frac, ts, rid0, frac0); + return VarVal(result); } @@ -77,12 +101,12 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterA PRECONDITION(arguments.childFunctions.size() == 5, "AlwaysEqTnpointNpointPhysicalFunction requires 5 children but got {}", arguments.childFunctions.size()); - return AlwaysEqTnpointNpointPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2]), - std::move(arguments.childFunctions[3]), - std::move(arguments.childFunctions[4])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + return AlwaysEqTnpointNpointPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysEqTnpointTnpointPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysEqTnpointTnpointPhysicalFunction.cpp index 3f5955d6b2..7e3265c26e 100644 --- a/nes-physical-operators/src/Functions/Meos/AlwaysEqTnpointTnpointPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/AlwaysEqTnpointTnpointPhysicalFunction.cpp @@ -13,17 +13,20 @@ */ #include + #include #include #include +#include #include #include #include #include +#include #include +#include #include #include -#include extern "C" { #include @@ -32,49 +35,69 @@ extern "C" { namespace NES { -AlwaysEqTnpointTnpointPhysicalFunction::AlwaysEqTnpointTnpointPhysicalFunction( - PhysicalFunction rid1, PhysicalFunction pos1, PhysicalFunction ts1, - PhysicalFunction rid2, PhysicalFunction pos2, PhysicalFunction ts2) +AlwaysEqTnpointTnpointPhysicalFunction::AlwaysEqTnpointTnpointPhysicalFunction(PhysicalFunction ridFunction, + PhysicalFunction fracFunction, + PhysicalFunction tsFunction, + PhysicalFunction rid0Function, + PhysicalFunction frac0Function, + PhysicalFunction ts0Function) { - paramFns.reserve(6); - paramFns.push_back(std::move(rid1)); - paramFns.push_back(std::move(pos1)); - paramFns.push_back(std::move(ts1)); - paramFns.push_back(std::move(rid2)); - paramFns.push_back(std::move(pos2)); - paramFns.push_back(std::move(ts2)); + parameterFunctions.reserve(6); + parameterFunctions.push_back(std::move(ridFunction)); + parameterFunctions.push_back(std::move(fracFunction)); + parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(rid0Function)); + parameterFunctions.push_back(std::move(frac0Function)); + parameterFunctions.push_back(std::move(ts0Function)); } VarVal AlwaysEqTnpointTnpointPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto rid1 = paramFns[0].execute(record, arena).cast(); - auto pos1 = paramFns[1].execute(record, arena).cast(); - auto ts1 = paramFns[2].execute(record, arena).cast(); - auto rid2 = paramFns[3].execute(record, arena).cast(); - auto pos2 = paramFns[4].execute(record, arena).cast(); - auto ts2 = paramFns[5].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto rid = parameterValues[0].cast>(); + auto frac = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + auto rid0 = parameterValues[3].cast>(); + auto frac0 = parameterValues[4].cast>(); + auto ts0 = parameterValues[5].cast>(); const auto result = nautilus::invoke( - +[](uint64_t rid1, double pos1, uint64_t ts1, - uint64_t rid2, double pos2, uint64_t ts2) -> double { - try { + +[](int64_t rid, + double frac, + uint64_t ts, + uint64_t rid0, + double frac0, + uint64_t ts0) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - Npoint* np1 = npoint_make((int64_t)rid1, pos1); - if (!np1) return 0.0; - Temporal* inst1 = (Temporal*)tnpointinst_make(np1, (TimestampTz)ts1); - free(np1); - if (!inst1) return 0.0; - Npoint* np2 = npoint_make((int64_t)rid2, pos2); - if (!np2) { free(inst1); return 0.0; } - Temporal* inst2 = (Temporal*)tnpointinst_make(np2, (TimestampTz)ts2); - free(np2); - if (!inst2) { free(inst1); return 0.0; } - int r = always_eq_tnpoint_tnpoint(inst1, inst2); - free(inst1); free(inst2); - return r > 0 ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + if (frac < 0.0 || frac > 1.0) return 0.0; + std::string tempWkt = fmt::format("NPoint({},{})@{}", rid, frac, MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tnpoint_in(tempWkt.c_str()); + if (!temp) return 0.0; + Npoint* np0 = npoint_make((int64_t)rid0, frac0); + if (!np0) { free(temp); return 0.0; } + Temporal* inst0 = (Temporal*)tnpointinst_make(np0, (TimestampTz)ts0); + free(np0); + if (!inst0) { free(temp); return 0.0; } + + double r = always_eq_tnpoint_tnpoint(temp, inst0); + free(temp); + free(inst0); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, - rid1, pos1, ts1, rid2, pos2, ts2); + rid, frac, ts, rid0, frac0, ts0); return VarVal(result); } @@ -85,12 +108,13 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterA PRECONDITION(arguments.childFunctions.size() == 6, "AlwaysEqTnpointTnpointPhysicalFunction requires 6 children but got {}", arguments.childFunctions.size()); - return AlwaysEqTnpointTnpointPhysicalFunction(std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2]), - std::move(arguments.childFunctions[3]), - std::move(arguments.childFunctions[4]), - std::move(arguments.childFunctions[5])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + auto arg5 = std::move(arguments.childFunctions[5]); + return AlwaysEqTnpointTnpointPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysEqTposePosePhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysEqTposePosePhysicalFunction.cpp index 72132c2984..62d19238e6 100644 --- a/nes-physical-operators/src/Functions/Meos/AlwaysEqTposePosePhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/AlwaysEqTposePosePhysicalFunction.cpp @@ -13,65 +13,92 @@ */ #include + #include #include #include +#include #include #include #include #include +#include #include +#include #include #include -#include -#include extern "C" { #include -#include #include } namespace NES { -AlwaysEqTposePosePhysicalFunction::AlwaysEqTposePosePhysicalFunction(PhysicalFunction x, PhysicalFunction y, PhysicalFunction theta, PhysicalFunction ts, PhysicalFunction x2, PhysicalFunction y2, PhysicalFunction theta2) +AlwaysEqTposePosePhysicalFunction::AlwaysEqTposePosePhysicalFunction(PhysicalFunction xFunction, + PhysicalFunction yFunction, + PhysicalFunction thetaFunction, + PhysicalFunction tsFunction, + PhysicalFunction px0Function, + PhysicalFunction py0Function, + PhysicalFunction ptheta0Function) { - paramFns.reserve(7); - paramFns.push_back(std::move(x)); - paramFns.push_back(std::move(y)); - paramFns.push_back(std::move(theta)); - paramFns.push_back(std::move(ts)); - paramFns.push_back(std::move(x2)); - paramFns.push_back(std::move(y2)); - paramFns.push_back(std::move(theta2)); + parameterFunctions.reserve(7); + parameterFunctions.push_back(std::move(xFunction)); + parameterFunctions.push_back(std::move(yFunction)); + parameterFunctions.push_back(std::move(thetaFunction)); + parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(px0Function)); + parameterFunctions.push_back(std::move(py0Function)); + parameterFunctions.push_back(std::move(ptheta0Function)); } VarVal AlwaysEqTposePosePhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto x = paramFns[0].execute(record, arena).cast(); - auto y = paramFns[1].execute(record, arena).cast(); - auto theta = paramFns[2].execute(record, arena).cast(); - auto ts = paramFns[3].execute(record, arena).cast(); - auto x2 = paramFns[4].execute(record, arena).cast(); - auto y2 = paramFns[5].execute(record, arena).cast(); - auto theta2 = paramFns[6].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto x = parameterValues[0].cast>(); + auto y = parameterValues[1].cast>(); + auto theta = parameterValues[2].cast>(); + auto ts = parameterValues[3].cast>(); + auto px0 = parameterValues[4].cast>(); + auto py0 = parameterValues[5].cast>(); + auto ptheta0 = parameterValues[6].cast>(); + const auto result = nautilus::invoke( - +[](double x, double y, double theta, uint64_t ts, double x2, double y2, double theta2) -> double { - try { + +[](double x, + double y, + double theta, + uint64_t ts, + double px0, + double py0, + double ptheta0) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - Pose* pose1 = pose_make_2d(x, y, theta, false, 0); - if (!pose1) return 0.0; - Temporal* inst = (Temporal*)tposeinst_make(pose1, (TimestampTz)ts); - free(pose1); - if (!inst) return 0.0; - Pose* pose2 = pose_make_2d(x2, y2, theta2, false, 0); - if (!pose2) { free(inst); return 0.0; } - int r = always_eq_tpose_pose(inst, pose2); - free(inst); free(pose2); - return r > 0 ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + std::string tempWkt = fmt::format("Pose(Point({} {}),{})@{}", x, y, theta, MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tpose_in(tempWkt.c_str()); + if (!temp) return 0.0; + Pose* pose0 = pose_make_2d(px0, py0, ptheta0, false, 0); + if (!pose0) { free(temp); return 0.0; } + + double r = always_eq_tpose_pose(temp, pose0); + free(temp); + free(pose0); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, - x, y, theta, ts, x2, y2, theta2); + x, y, theta, ts, px0, py0, ptheta0); + return VarVal(result); } @@ -81,14 +108,14 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterA PRECONDITION(arguments.childFunctions.size() == 7, "AlwaysEqTposePosePhysicalFunction requires 7 children but got {}", arguments.childFunctions.size()); - return AlwaysEqTposePosePhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2]), - std::move(arguments.childFunctions[3]), - std::move(arguments.childFunctions[4]), - std::move(arguments.childFunctions[5]), - std::move(arguments.childFunctions[6])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + auto arg5 = std::move(arguments.childFunctions[5]); + auto arg6 = std::move(arguments.childFunctions[6]); + return AlwaysEqTposePosePhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysEqTposeTposePhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysEqTposeTposePhysicalFunction.cpp index 18dd6ab81e..59949b17e8 100644 --- a/nes-physical-operators/src/Functions/Meos/AlwaysEqTposeTposePhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/AlwaysEqTposeTposePhysicalFunction.cpp @@ -13,17 +13,20 @@ */ #include + #include #include #include +#include #include #include #include #include +#include #include +#include #include #include -#include extern "C" { #include @@ -32,53 +35,76 @@ extern "C" { namespace NES { -AlwaysEqTposeTposePhysicalFunction::AlwaysEqTposeTposePhysicalFunction( - PhysicalFunction x1, PhysicalFunction y1, PhysicalFunction theta1, PhysicalFunction ts1, - PhysicalFunction x2, PhysicalFunction y2, PhysicalFunction theta2, PhysicalFunction ts2) +AlwaysEqTposeTposePhysicalFunction::AlwaysEqTposeTposePhysicalFunction(PhysicalFunction xFunction, + PhysicalFunction yFunction, + PhysicalFunction thetaFunction, + PhysicalFunction tsFunction, + PhysicalFunction px0Function, + PhysicalFunction py0Function, + PhysicalFunction ptheta0Function, + PhysicalFunction ts0Function) { - paramFns.reserve(8); - paramFns.push_back(std::move(x1)); - paramFns.push_back(std::move(y1)); - paramFns.push_back(std::move(theta1)); - paramFns.push_back(std::move(ts1)); - paramFns.push_back(std::move(x2)); - paramFns.push_back(std::move(y2)); - paramFns.push_back(std::move(theta2)); - paramFns.push_back(std::move(ts2)); + parameterFunctions.reserve(8); + parameterFunctions.push_back(std::move(xFunction)); + parameterFunctions.push_back(std::move(yFunction)); + parameterFunctions.push_back(std::move(thetaFunction)); + parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(px0Function)); + parameterFunctions.push_back(std::move(py0Function)); + parameterFunctions.push_back(std::move(ptheta0Function)); + parameterFunctions.push_back(std::move(ts0Function)); } VarVal AlwaysEqTposeTposePhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto x1 = paramFns[0].execute(record, arena).cast(); - auto y1 = paramFns[1].execute(record, arena).cast(); - auto theta1 = paramFns[2].execute(record, arena).cast(); - auto ts1 = paramFns[3].execute(record, arena).cast(); - auto x2 = paramFns[4].execute(record, arena).cast(); - auto y2 = paramFns[5].execute(record, arena).cast(); - auto theta2 = paramFns[6].execute(record, arena).cast(); - auto ts2 = paramFns[7].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto x = parameterValues[0].cast>(); + auto y = parameterValues[1].cast>(); + auto theta = parameterValues[2].cast>(); + auto ts = parameterValues[3].cast>(); + auto px0 = parameterValues[4].cast>(); + auto py0 = parameterValues[5].cast>(); + auto ptheta0 = parameterValues[6].cast>(); + auto ts0 = parameterValues[7].cast>(); const auto result = nautilus::invoke( - +[](double x1, double y1, double theta1, uint64_t ts1, - double x2, double y2, double theta2, uint64_t ts2) -> double { - try { + +[](double x, + double y, + double theta, + uint64_t ts, + double px0, + double py0, + double ptheta0, + uint64_t ts0) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - Pose* p1 = pose_make_2d(x1, y1, theta1, false, 0); - if (!p1) return 0.0; - Temporal* inst1 = (Temporal*)tposeinst_make(p1, (TimestampTz)ts1); - free(p1); - if (!inst1) return 0.0; - Pose* p2 = pose_make_2d(x2, y2, theta2, false, 0); - if (!p2) { free(inst1); return 0.0; } - Temporal* inst2 = (Temporal*)tposeinst_make(p2, (TimestampTz)ts2); - free(p2); - if (!inst2) { free(inst1); return 0.0; } - int r = always_eq_tpose_tpose(inst1, inst2); - free(inst1); free(inst2); - return r > 0 ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + std::string tempWkt = fmt::format("Pose(Point({} {}),{})@{}", x, y, theta, MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tpose_in(tempWkt.c_str()); + if (!temp) return 0.0; + Pose* pose0A = pose_make_2d(px0, py0, ptheta0, false, 0); + if (!pose0A) { free(temp); return 0.0; } + Temporal* inst0 = (Temporal*)tposeinst_make(pose0A, (TimestampTz)ts0); + free(pose0A); + if (!inst0) { free(temp); return 0.0; } + + double r = always_eq_tpose_tpose(temp, inst0); + free(temp); + free(inst0); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, - x1, y1, theta1, ts1, x2, y2, theta2, ts2); + x, y, theta, ts, px0, py0, ptheta0, ts0); return VarVal(result); } @@ -89,14 +115,15 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterA PRECONDITION(arguments.childFunctions.size() == 8, "AlwaysEqTposeTposePhysicalFunction requires 8 children but got {}", arguments.childFunctions.size()); - return AlwaysEqTposeTposePhysicalFunction(std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2]), - std::move(arguments.childFunctions[3]), - std::move(arguments.childFunctions[4]), - std::move(arguments.childFunctions[5]), - std::move(arguments.childFunctions[6]), - std::move(arguments.childFunctions[7])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + auto arg5 = std::move(arguments.childFunctions[5]); + auto arg6 = std::move(arguments.childFunctions[6]); + auto arg7 = std::move(arguments.childFunctions[7]); + return AlwaysEqTposeTposePhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6), std::move(arg7)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysEqTquadbinQuadbinPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysEqTquadbinQuadbinPhysicalFunction.cpp index 8add7b7f51..b22fb441e2 100644 --- a/nes-physical-operators/src/Functions/Meos/AlwaysEqTquadbinQuadbinPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/AlwaysEqTquadbinQuadbinPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -21,7 +22,9 @@ #include #include #include +#include #include +#include #include #include @@ -32,40 +35,63 @@ extern "C" { namespace NES { -AlwaysEqTquadbinQuadbinPhysicalFunction::AlwaysEqTquadbinQuadbinPhysicalFunction(PhysicalFunction inst_cell, PhysicalFunction ts, PhysicalFunction cell) { - paramFns.reserve(3); - paramFns.push_back(std::move(inst_cell)); - paramFns.push_back(std::move(ts)); - paramFns.push_back(std::move(cell)); +AlwaysEqTquadbinQuadbinPhysicalFunction::AlwaysEqTquadbinQuadbinPhysicalFunction(PhysicalFunction cellFunction, + PhysicalFunction tsFunction, + PhysicalFunction arg0Function) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(cellFunction)); + parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } -VarVal AlwaysEqTquadbinQuadbinPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto inst_cell = paramFns[0].execute(record, arena).cast(); - auto ts = paramFns[1].execute(record, arena).cast(); - auto cell = paramFns[2].execute(record, arena).cast(); +VarVal AlwaysEqTquadbinQuadbinPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto cell = parameterValues[0].cast>(); + auto ts = parameterValues[1].cast>(); + auto arg0 = parameterValues[2].cast>(); + const auto result = nautilus::invoke( - +[](uint64_t ic, uint64_t ts, uint64_t cell) -> double { - MEOS::Meos::ensureMeosInitialized(); - TInstant* inst = tquadbininst_make((Quadbin)ic, (TimestampTz)ts); - if (!inst) return 0.0; - int r = always_eq_tquadbin_quadbin((const Temporal*)inst, (Quadbin)cell); - free(inst); - return r > 0 ? 1.0 : 0.0; + +[](uint64_t cell, + uint64_t ts, + uint64_t arg0) -> double { + try + { + MEOS::Meos::ensureMeosInitialized(); + Temporal* temp = (Temporal*)tquadbininst_make((Quadbin)cell, (TimestampTz)ts); + if (!temp) return 0.0; + + double r = always_eq_tquadbin_quadbin(temp, (Quadbin)arg0); + free(temp); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, - inst_cell, ts, cell); + cell, ts, arg0); + return VarVal(result); } PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysEqTquadbinQuadbinPhysicalFunction( PhysicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.childFunctions.size()==3, + PRECONDITION(arguments.childFunctions.size() == 3, "AlwaysEqTquadbinQuadbinPhysicalFunction requires 3 children but got {}", arguments.childFunctions.size()); - return AlwaysEqTquadbinQuadbinPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return AlwaysEqTquadbinQuadbinPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysEqTtextTextPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysEqTtextTextPhysicalFunction.cpp index 93bdd51e9e..82b67b0ada 100644 --- a/nes-physical-operators/src/Functions/Meos/AlwaysEqTtextTextPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/AlwaysEqTtextTextPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -33,44 +34,59 @@ extern "C" { namespace NES { -AlwaysEqTtextTextPhysicalFunction::AlwaysEqTtextTextPhysicalFunction( - PhysicalFunction valueFunction, PhysicalFunction refFunction, PhysicalFunction tsFunction) +AlwaysEqTtextTextPhysicalFunction::AlwaysEqTtextTextPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction, + PhysicalFunction arg0Function) { - paramFns.reserve(3); - paramFns.push_back(std::move(valueFunction)); - paramFns.push_back(std::move(refFunction)); - paramFns.push_back(std::move(tsFunction)); + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } VarVal AlwaysEqTtextTextPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto value = paramFns[0].execute(record, arena).cast(); - auto ref = paramFns[1].execute(record, arena).cast(); - auto ts = paramFns[2].execute(record, arena).cast>(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto value = parameterValues[0].cast(); + auto ts = parameterValues[1].cast>(); + auto arg0 = parameterValues[2].cast(); const auto result = nautilus::invoke( - +[](const char* v, uint32_t vsz, const char* r, uint32_t rsz, uint64_t t) -> double { - try { + +[](const char* valuePtr, uint32_t valueSize, + uint64_t ts, + const char* arg0Ptr, uint32_t arg0Size) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string val_str(v, vsz); - std::string ref_str(r, rsz); - while (!val_str.empty() && (val_str.front() == '\'' || val_str.front() == '"')) val_str = val_str.substr(1); - while (!val_str.empty() && (val_str.back() == '\'' || val_str.back() == '"')) val_str = val_str.substr(0, val_str.size()-1); - while (!ref_str.empty() && (ref_str.front() == '\'' || ref_str.front() == '"')) ref_str = ref_str.substr(1); - while (!ref_str.empty() && (ref_str.back() == '\'' || ref_str.back() == '"')) ref_str = ref_str.substr(0, ref_str.size()-1); - std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); - std::string wkt = "'" + val_str + "'@" + ts_str; - Temporal* temp = ttext_in(wkt.c_str()); + std::string tempVal(valuePtr, valueSize); + while (!tempVal.empty() && (tempVal.front() == '\'' || tempVal.front() == '"')) tempVal.erase(tempVal.begin()); + while (!tempVal.empty() && (tempVal.back() == '\'' || tempVal.back() == '"')) tempVal.pop_back(); + std::string tempWkt = "'" + tempVal + "'@" + MEOS::Meos::convertEpochToTimestamp(ts); + Temporal* temp = ttext_in(tempWkt.c_str()); if (!temp) return 0.0; - text* txt = cstring_to_text(ref_str.c_str()); - if (!txt) { free(temp); return 0.0; } - int result = always_eq_ttext_text(temp, txt); + std::string arg0S(arg0Ptr, arg0Size); + while (!arg0S.empty() && (arg0S.front() == '\'' || arg0S.front() == '"')) arg0S.erase(arg0S.begin()); + while (!arg0S.empty() && (arg0S.back() == '\'' || arg0S.back() == '"')) arg0S.pop_back(); + text* txt0 = cstring_to_text(arg0S.c_str()); + if (!txt0) { free(temp); return 0.0; } + + double r = always_eq_ttext_text(temp, txt0); free(temp); - free(txt); - return static_cast(result); - } catch (const std::exception&) { return 0.0; } + free(txt0); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, - value, ref, ts); + value.getContent(), value.getContentSize(), ts, arg0.getContent(), arg0.getContentSize()); return VarVal(result); } @@ -81,10 +97,10 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterA PRECONDITION(arguments.childFunctions.size() == 3, "AlwaysEqTtextTextPhysicalFunction requires 3 children but got {}", arguments.childFunctions.size()); - return AlwaysEqTtextTextPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return AlwaysEqTtextTextPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysGeBigintTbigintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysGeBigintTbigintPhysicalFunction.cpp index 27ecad58bc..a65124a683 100644 --- a/nes-physical-operators/src/Functions/Meos/AlwaysGeBigintTbigintPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/AlwaysGeBigintTbigintPhysicalFunction.cpp @@ -35,12 +35,12 @@ extern "C" { namespace NES { -AlwaysGeBigintTbigintPhysicalFunction::AlwaysGeBigintTbigintPhysicalFunction(PhysicalFunction scalarFunction, - PhysicalFunction valueFunction, - PhysicalFunction tsFunction) +AlwaysGeBigintTbigintPhysicalFunction::AlwaysGeBigintTbigintPhysicalFunction(PhysicalFunction arg0Function, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction) { parameterFunctions.reserve(3); - parameterFunctions.push_back(std::move(scalarFunction)); + parameterFunctions.push_back(std::move(arg0Function)); parameterFunctions.push_back(std::move(valueFunction)); parameterFunctions.push_back(std::move(tsFunction)); } @@ -50,26 +50,35 @@ VarVal AlwaysGeBigintTbigintPhysicalFunction::execute(const Record& record, Aren std::vector parameterValues; parameterValues.reserve(parameterFunctions.size()); for (const auto& function : parameterFunctions) + { parameterValues.emplace_back(function.execute(record, arena)); + } - auto scalar = parameterValues[0].cast>(); - auto value = parameterValues[1].cast>(); - auto ts = parameterValues[2].cast>(); + auto arg0 = parameterValues[0].cast>(); + auto value = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); const auto result = nautilus::invoke( - +[](double d, double v, uint64_t t) -> double { - try { + +[](double arg0, + double value, + uint64_t ts) -> int { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); - std::string wkt = fmt::format("{}@{}", static_cast(v), ts_str); - Temporal* temp = tbigint_in(wkt.c_str()); - if (!temp) return 0.0; - int r = always_ge_bigint_tbigint(static_cast(d), temp); + std::string tempWkt = fmt::format("{}@{}", static_cast(value), MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tbigint_in(tempWkt.c_str()); + if (!temp) return 0; + + int r = always_ge_bigint_tbigint(static_cast(arg0), temp); free(temp); - return static_cast(r); - } catch (const std::exception&) { return 0.0; } + return r; + } + catch (const std::exception&) + { + return 0; + } }, - scalar, value, ts); + arg0, value, ts); return VarVal(result); } diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysGeTbigintBigintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysGeTbigintBigintPhysicalFunction.cpp index d16a0b080a..c3f08fdae5 100644 --- a/nes-physical-operators/src/Functions/Meos/AlwaysGeTbigintBigintPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/AlwaysGeTbigintBigintPhysicalFunction.cpp @@ -36,13 +36,13 @@ extern "C" { namespace NES { AlwaysGeTbigintBigintPhysicalFunction::AlwaysGeTbigintBigintPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction thresholdFunction, - PhysicalFunction tsFunction) + PhysicalFunction tsFunction, + PhysicalFunction arg0Function) { parameterFunctions.reserve(3); parameterFunctions.push_back(std::move(valueFunction)); - parameterFunctions.push_back(std::move(thresholdFunction)); parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } VarVal AlwaysGeTbigintBigintPhysicalFunction::execute(const Record& record, ArenaRef& arena) const @@ -50,25 +50,35 @@ VarVal AlwaysGeTbigintBigintPhysicalFunction::execute(const Record& record, Aren std::vector parameterValues; parameterValues.reserve(parameterFunctions.size()); for (const auto& function : parameterFunctions) + { parameterValues.emplace_back(function.execute(record, arena)); + } - auto value = parameterValues[0].cast>(); - auto threshold = parameterValues[1].cast>(); - auto ts = parameterValues[2].cast>(); + auto value = parameterValues[0].cast>(); + auto ts = parameterValues[1].cast>(); + auto arg0 = parameterValues[2].cast>(); const auto result = nautilus::invoke( - +[](double value, double threshold, uint64_t ts) -> double { - try { + +[](double value, + uint64_t ts, + double arg0) -> int { + try + { MEOS::Meos::ensureMeosInitialized(); std::string tempWkt = fmt::format("{}@{}", static_cast(value), MEOS::Meos::convertEpochToTimestamp(ts)); Temporal* temp = tbigint_in(tempWkt.c_str()); - if (!temp) return 0.0; - int r = always_ge_tbigint_bigint(temp, static_cast(threshold)); + if (!temp) return 0; + + int r = always_ge_tbigint_bigint(temp, static_cast(arg0)); free(temp); - return static_cast(r); - } catch (const std::exception&) { return 0.0; } + return r; + } + catch (const std::exception&) + { + return 0; + } }, - value, threshold, ts); + value, ts, arg0); return VarVal(result); } diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysGeTextTtextPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysGeTextTtextPhysicalFunction.cpp index 955a72eb30..38d67145e9 100644 --- a/nes-physical-operators/src/Functions/Meos/AlwaysGeTextTtextPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/AlwaysGeTextTtextPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -33,44 +34,59 @@ extern "C" { namespace NES { -AlwaysGeTextTtextPhysicalFunction::AlwaysGeTextTtextPhysicalFunction( - PhysicalFunction valueFunction, PhysicalFunction refFunction, PhysicalFunction tsFunction) +AlwaysGeTextTtextPhysicalFunction::AlwaysGeTextTtextPhysicalFunction(PhysicalFunction arg0Function, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction) { - paramFns.reserve(3); - paramFns.push_back(std::move(valueFunction)); - paramFns.push_back(std::move(refFunction)); - paramFns.push_back(std::move(tsFunction)); + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(arg0Function)); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); } VarVal AlwaysGeTextTtextPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto ref = paramFns[0].execute(record, arena).cast(); - auto value = paramFns[1].execute(record, arena).cast(); - auto ts = paramFns[2].execute(record, arena).cast>(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto arg0 = parameterValues[0].cast(); + auto value = parameterValues[1].cast(); + auto ts = parameterValues[2].cast>(); const auto result = nautilus::invoke( - +[](const char* r, uint32_t rsz, const char* v, uint32_t vsz, uint64_t t) -> double { - try { + +[](const char* arg0Ptr, uint32_t arg0Size, + const char* valuePtr, uint32_t valueSize, + uint64_t ts) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string ref_str(r, rsz); - std::string val_str(v, vsz); - while (!ref_str.empty() && (ref_str.front() == '\'' || ref_str.front() == '"')) ref_str = ref_str.substr(1); - while (!ref_str.empty() && (ref_str.back() == '\'' || ref_str.back() == '"')) ref_str = ref_str.substr(0, ref_str.size()-1); - while (!val_str.empty() && (val_str.front() == '\'' || val_str.front() == '"')) val_str = val_str.substr(1); - while (!val_str.empty() && (val_str.back() == '\'' || val_str.back() == '"')) val_str = val_str.substr(0, val_str.size()-1); - std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); - std::string wkt = "'" + val_str + "'@" + ts_str; - Temporal* temp = ttext_in(wkt.c_str()); + std::string tempVal(valuePtr, valueSize); + while (!tempVal.empty() && (tempVal.front() == '\'' || tempVal.front() == '"')) tempVal.erase(tempVal.begin()); + while (!tempVal.empty() && (tempVal.back() == '\'' || tempVal.back() == '"')) tempVal.pop_back(); + std::string tempWkt = "'" + tempVal + "'@" + MEOS::Meos::convertEpochToTimestamp(ts); + Temporal* temp = ttext_in(tempWkt.c_str()); if (!temp) return 0.0; - text* txt = cstring_to_text(ref_str.c_str()); - if (!txt) { free(temp); return 0.0; } - int result = always_ge_text_ttext(txt, temp); + std::string arg0S(arg0Ptr, arg0Size); + while (!arg0S.empty() && (arg0S.front() == '\'' || arg0S.front() == '"')) arg0S.erase(arg0S.begin()); + while (!arg0S.empty() && (arg0S.back() == '\'' || arg0S.back() == '"')) arg0S.pop_back(); + text* txt0 = cstring_to_text(arg0S.c_str()); + if (!txt0) { free(temp); return 0.0; } + + double r = always_ge_text_ttext(txt0, temp); free(temp); - free(txt); - return static_cast(result); - } catch (const std::exception&) { return 0.0; } + free(txt0); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, - ref, value, ts); + arg0.getContent(), arg0.getContentSize(), value.getContent(), value.getContentSize(), ts); return VarVal(result); } @@ -81,10 +97,10 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterA PRECONDITION(arguments.childFunctions.size() == 3, "AlwaysGeTextTtextPhysicalFunction requires 3 children but got {}", arguments.childFunctions.size()); - return AlwaysGeTextTtextPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return AlwaysGeTextTtextPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysGeTtextTextPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysGeTtextTextPhysicalFunction.cpp index 403605380d..3e5915d58b 100644 --- a/nes-physical-operators/src/Functions/Meos/AlwaysGeTtextTextPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/AlwaysGeTtextTextPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -33,44 +34,59 @@ extern "C" { namespace NES { -AlwaysGeTtextTextPhysicalFunction::AlwaysGeTtextTextPhysicalFunction( - PhysicalFunction valueFunction, PhysicalFunction refFunction, PhysicalFunction tsFunction) +AlwaysGeTtextTextPhysicalFunction::AlwaysGeTtextTextPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction, + PhysicalFunction arg0Function) { - paramFns.reserve(3); - paramFns.push_back(std::move(valueFunction)); - paramFns.push_back(std::move(refFunction)); - paramFns.push_back(std::move(tsFunction)); + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } VarVal AlwaysGeTtextTextPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto value = paramFns[0].execute(record, arena).cast(); - auto ref = paramFns[1].execute(record, arena).cast(); - auto ts = paramFns[2].execute(record, arena).cast>(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto value = parameterValues[0].cast(); + auto ts = parameterValues[1].cast>(); + auto arg0 = parameterValues[2].cast(); const auto result = nautilus::invoke( - +[](const char* v, uint32_t vsz, const char* r, uint32_t rsz, uint64_t t) -> double { - try { + +[](const char* valuePtr, uint32_t valueSize, + uint64_t ts, + const char* arg0Ptr, uint32_t arg0Size) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string val_str(v, vsz); - std::string ref_str(r, rsz); - while (!val_str.empty() && (val_str.front() == '\'' || val_str.front() == '"')) val_str = val_str.substr(1); - while (!val_str.empty() && (val_str.back() == '\'' || val_str.back() == '"')) val_str = val_str.substr(0, val_str.size()-1); - while (!ref_str.empty() && (ref_str.front() == '\'' || ref_str.front() == '"')) ref_str = ref_str.substr(1); - while (!ref_str.empty() && (ref_str.back() == '\'' || ref_str.back() == '"')) ref_str = ref_str.substr(0, ref_str.size()-1); - std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); - std::string wkt = "'" + val_str + "'@" + ts_str; - Temporal* temp = ttext_in(wkt.c_str()); + std::string tempVal(valuePtr, valueSize); + while (!tempVal.empty() && (tempVal.front() == '\'' || tempVal.front() == '"')) tempVal.erase(tempVal.begin()); + while (!tempVal.empty() && (tempVal.back() == '\'' || tempVal.back() == '"')) tempVal.pop_back(); + std::string tempWkt = "'" + tempVal + "'@" + MEOS::Meos::convertEpochToTimestamp(ts); + Temporal* temp = ttext_in(tempWkt.c_str()); if (!temp) return 0.0; - text* txt = cstring_to_text(ref_str.c_str()); - if (!txt) { free(temp); return 0.0; } - int result = always_ge_ttext_text(temp, txt); + std::string arg0S(arg0Ptr, arg0Size); + while (!arg0S.empty() && (arg0S.front() == '\'' || arg0S.front() == '"')) arg0S.erase(arg0S.begin()); + while (!arg0S.empty() && (arg0S.back() == '\'' || arg0S.back() == '"')) arg0S.pop_back(); + text* txt0 = cstring_to_text(arg0S.c_str()); + if (!txt0) { free(temp); return 0.0; } + + double r = always_ge_ttext_text(temp, txt0); free(temp); - free(txt); - return static_cast(result); - } catch (const std::exception&) { return 0.0; } + free(txt0); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, - value, ref, ts); + value.getContent(), value.getContentSize(), ts, arg0.getContent(), arg0.getContentSize()); return VarVal(result); } @@ -81,10 +97,10 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterA PRECONDITION(arguments.childFunctions.size() == 3, "AlwaysGeTtextTextPhysicalFunction requires 3 children but got {}", arguments.childFunctions.size()); - return AlwaysGeTtextTextPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return AlwaysGeTtextTextPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysGtBigintTbigintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysGtBigintTbigintPhysicalFunction.cpp index 02b2f7e25c..d17001db77 100644 --- a/nes-physical-operators/src/Functions/Meos/AlwaysGtBigintTbigintPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/AlwaysGtBigintTbigintPhysicalFunction.cpp @@ -35,12 +35,12 @@ extern "C" { namespace NES { -AlwaysGtBigintTbigintPhysicalFunction::AlwaysGtBigintTbigintPhysicalFunction(PhysicalFunction scalarFunction, - PhysicalFunction valueFunction, - PhysicalFunction tsFunction) +AlwaysGtBigintTbigintPhysicalFunction::AlwaysGtBigintTbigintPhysicalFunction(PhysicalFunction arg0Function, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction) { parameterFunctions.reserve(3); - parameterFunctions.push_back(std::move(scalarFunction)); + parameterFunctions.push_back(std::move(arg0Function)); parameterFunctions.push_back(std::move(valueFunction)); parameterFunctions.push_back(std::move(tsFunction)); } @@ -50,26 +50,35 @@ VarVal AlwaysGtBigintTbigintPhysicalFunction::execute(const Record& record, Aren std::vector parameterValues; parameterValues.reserve(parameterFunctions.size()); for (const auto& function : parameterFunctions) + { parameterValues.emplace_back(function.execute(record, arena)); + } - auto scalar = parameterValues[0].cast>(); - auto value = parameterValues[1].cast>(); - auto ts = parameterValues[2].cast>(); + auto arg0 = parameterValues[0].cast>(); + auto value = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); const auto result = nautilus::invoke( - +[](double d, double v, uint64_t t) -> double { - try { + +[](double arg0, + double value, + uint64_t ts) -> int { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); - std::string wkt = fmt::format("{}@{}", static_cast(v), ts_str); - Temporal* temp = tbigint_in(wkt.c_str()); - if (!temp) return 0.0; - int r = always_gt_bigint_tbigint(static_cast(d), temp); + std::string tempWkt = fmt::format("{}@{}", static_cast(value), MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tbigint_in(tempWkt.c_str()); + if (!temp) return 0; + + int r = always_gt_bigint_tbigint(static_cast(arg0), temp); free(temp); - return static_cast(r); - } catch (const std::exception&) { return 0.0; } + return r; + } + catch (const std::exception&) + { + return 0; + } }, - scalar, value, ts); + arg0, value, ts); return VarVal(result); } diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysGtTbigintBigintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysGtTbigintBigintPhysicalFunction.cpp index e1fd28cdb2..0d86227580 100644 --- a/nes-physical-operators/src/Functions/Meos/AlwaysGtTbigintBigintPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/AlwaysGtTbigintBigintPhysicalFunction.cpp @@ -36,13 +36,13 @@ extern "C" { namespace NES { AlwaysGtTbigintBigintPhysicalFunction::AlwaysGtTbigintBigintPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction thresholdFunction, - PhysicalFunction tsFunction) + PhysicalFunction tsFunction, + PhysicalFunction arg0Function) { parameterFunctions.reserve(3); parameterFunctions.push_back(std::move(valueFunction)); - parameterFunctions.push_back(std::move(thresholdFunction)); parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } VarVal AlwaysGtTbigintBigintPhysicalFunction::execute(const Record& record, ArenaRef& arena) const @@ -50,25 +50,35 @@ VarVal AlwaysGtTbigintBigintPhysicalFunction::execute(const Record& record, Aren std::vector parameterValues; parameterValues.reserve(parameterFunctions.size()); for (const auto& function : parameterFunctions) + { parameterValues.emplace_back(function.execute(record, arena)); + } - auto value = parameterValues[0].cast>(); - auto threshold = parameterValues[1].cast>(); - auto ts = parameterValues[2].cast>(); + auto value = parameterValues[0].cast>(); + auto ts = parameterValues[1].cast>(); + auto arg0 = parameterValues[2].cast>(); const auto result = nautilus::invoke( - +[](double value, double threshold, uint64_t ts) -> double { - try { + +[](double value, + uint64_t ts, + double arg0) -> int { + try + { MEOS::Meos::ensureMeosInitialized(); std::string tempWkt = fmt::format("{}@{}", static_cast(value), MEOS::Meos::convertEpochToTimestamp(ts)); Temporal* temp = tbigint_in(tempWkt.c_str()); - if (!temp) return 0.0; - int r = always_gt_tbigint_bigint(temp, static_cast(threshold)); + if (!temp) return 0; + + int r = always_gt_tbigint_bigint(temp, static_cast(arg0)); free(temp); - return static_cast(r); - } catch (const std::exception&) { return 0.0; } + return r; + } + catch (const std::exception&) + { + return 0; + } }, - value, threshold, ts); + value, ts, arg0); return VarVal(result); } diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysGtTextTtextPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysGtTextTtextPhysicalFunction.cpp index e2627e708b..79d38cd3ec 100644 --- a/nes-physical-operators/src/Functions/Meos/AlwaysGtTextTtextPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/AlwaysGtTextTtextPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -33,44 +34,59 @@ extern "C" { namespace NES { -AlwaysGtTextTtextPhysicalFunction::AlwaysGtTextTtextPhysicalFunction( - PhysicalFunction valueFunction, PhysicalFunction refFunction, PhysicalFunction tsFunction) +AlwaysGtTextTtextPhysicalFunction::AlwaysGtTextTtextPhysicalFunction(PhysicalFunction arg0Function, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction) { - paramFns.reserve(3); - paramFns.push_back(std::move(valueFunction)); - paramFns.push_back(std::move(refFunction)); - paramFns.push_back(std::move(tsFunction)); + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(arg0Function)); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); } VarVal AlwaysGtTextTtextPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto ref = paramFns[0].execute(record, arena).cast(); - auto value = paramFns[1].execute(record, arena).cast(); - auto ts = paramFns[2].execute(record, arena).cast>(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto arg0 = parameterValues[0].cast(); + auto value = parameterValues[1].cast(); + auto ts = parameterValues[2].cast>(); const auto result = nautilus::invoke( - +[](const char* r, uint32_t rsz, const char* v, uint32_t vsz, uint64_t t) -> double { - try { + +[](const char* arg0Ptr, uint32_t arg0Size, + const char* valuePtr, uint32_t valueSize, + uint64_t ts) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string ref_str(r, rsz); - std::string val_str(v, vsz); - while (!ref_str.empty() && (ref_str.front() == '\'' || ref_str.front() == '"')) ref_str = ref_str.substr(1); - while (!ref_str.empty() && (ref_str.back() == '\'' || ref_str.back() == '"')) ref_str = ref_str.substr(0, ref_str.size()-1); - while (!val_str.empty() && (val_str.front() == '\'' || val_str.front() == '"')) val_str = val_str.substr(1); - while (!val_str.empty() && (val_str.back() == '\'' || val_str.back() == '"')) val_str = val_str.substr(0, val_str.size()-1); - std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); - std::string wkt = "'" + val_str + "'@" + ts_str; - Temporal* temp = ttext_in(wkt.c_str()); + std::string tempVal(valuePtr, valueSize); + while (!tempVal.empty() && (tempVal.front() == '\'' || tempVal.front() == '"')) tempVal.erase(tempVal.begin()); + while (!tempVal.empty() && (tempVal.back() == '\'' || tempVal.back() == '"')) tempVal.pop_back(); + std::string tempWkt = "'" + tempVal + "'@" + MEOS::Meos::convertEpochToTimestamp(ts); + Temporal* temp = ttext_in(tempWkt.c_str()); if (!temp) return 0.0; - text* txt = cstring_to_text(ref_str.c_str()); - if (!txt) { free(temp); return 0.0; } - int result = always_gt_text_ttext(txt, temp); + std::string arg0S(arg0Ptr, arg0Size); + while (!arg0S.empty() && (arg0S.front() == '\'' || arg0S.front() == '"')) arg0S.erase(arg0S.begin()); + while (!arg0S.empty() && (arg0S.back() == '\'' || arg0S.back() == '"')) arg0S.pop_back(); + text* txt0 = cstring_to_text(arg0S.c_str()); + if (!txt0) { free(temp); return 0.0; } + + double r = always_gt_text_ttext(txt0, temp); free(temp); - free(txt); - return static_cast(result); - } catch (const std::exception&) { return 0.0; } + free(txt0); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, - ref, value, ts); + arg0.getContent(), arg0.getContentSize(), value.getContent(), value.getContentSize(), ts); return VarVal(result); } @@ -81,10 +97,10 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterA PRECONDITION(arguments.childFunctions.size() == 3, "AlwaysGtTextTtextPhysicalFunction requires 3 children but got {}", arguments.childFunctions.size()); - return AlwaysGtTextTtextPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return AlwaysGtTextTtextPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysGtTtextTextPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysGtTtextTextPhysicalFunction.cpp index e2743d07c7..ddcab0540a 100644 --- a/nes-physical-operators/src/Functions/Meos/AlwaysGtTtextTextPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/AlwaysGtTtextTextPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -33,44 +34,59 @@ extern "C" { namespace NES { -AlwaysGtTtextTextPhysicalFunction::AlwaysGtTtextTextPhysicalFunction( - PhysicalFunction valueFunction, PhysicalFunction refFunction, PhysicalFunction tsFunction) +AlwaysGtTtextTextPhysicalFunction::AlwaysGtTtextTextPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction, + PhysicalFunction arg0Function) { - paramFns.reserve(3); - paramFns.push_back(std::move(valueFunction)); - paramFns.push_back(std::move(refFunction)); - paramFns.push_back(std::move(tsFunction)); + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } VarVal AlwaysGtTtextTextPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto value = paramFns[0].execute(record, arena).cast(); - auto ref = paramFns[1].execute(record, arena).cast(); - auto ts = paramFns[2].execute(record, arena).cast>(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto value = parameterValues[0].cast(); + auto ts = parameterValues[1].cast>(); + auto arg0 = parameterValues[2].cast(); const auto result = nautilus::invoke( - +[](const char* v, uint32_t vsz, const char* r, uint32_t rsz, uint64_t t) -> double { - try { + +[](const char* valuePtr, uint32_t valueSize, + uint64_t ts, + const char* arg0Ptr, uint32_t arg0Size) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string val_str(v, vsz); - std::string ref_str(r, rsz); - while (!val_str.empty() && (val_str.front() == '\'' || val_str.front() == '"')) val_str = val_str.substr(1); - while (!val_str.empty() && (val_str.back() == '\'' || val_str.back() == '"')) val_str = val_str.substr(0, val_str.size()-1); - while (!ref_str.empty() && (ref_str.front() == '\'' || ref_str.front() == '"')) ref_str = ref_str.substr(1); - while (!ref_str.empty() && (ref_str.back() == '\'' || ref_str.back() == '"')) ref_str = ref_str.substr(0, ref_str.size()-1); - std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); - std::string wkt = "'" + val_str + "'@" + ts_str; - Temporal* temp = ttext_in(wkt.c_str()); + std::string tempVal(valuePtr, valueSize); + while (!tempVal.empty() && (tempVal.front() == '\'' || tempVal.front() == '"')) tempVal.erase(tempVal.begin()); + while (!tempVal.empty() && (tempVal.back() == '\'' || tempVal.back() == '"')) tempVal.pop_back(); + std::string tempWkt = "'" + tempVal + "'@" + MEOS::Meos::convertEpochToTimestamp(ts); + Temporal* temp = ttext_in(tempWkt.c_str()); if (!temp) return 0.0; - text* txt = cstring_to_text(ref_str.c_str()); - if (!txt) { free(temp); return 0.0; } - int result = always_gt_ttext_text(temp, txt); + std::string arg0S(arg0Ptr, arg0Size); + while (!arg0S.empty() && (arg0S.front() == '\'' || arg0S.front() == '"')) arg0S.erase(arg0S.begin()); + while (!arg0S.empty() && (arg0S.back() == '\'' || arg0S.back() == '"')) arg0S.pop_back(); + text* txt0 = cstring_to_text(arg0S.c_str()); + if (!txt0) { free(temp); return 0.0; } + + double r = always_gt_ttext_text(temp, txt0); free(temp); - free(txt); - return static_cast(result); - } catch (const std::exception&) { return 0.0; } + free(txt0); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, - value, ref, ts); + value.getContent(), value.getContentSize(), ts, arg0.getContent(), arg0.getContentSize()); return VarVal(result); } @@ -81,10 +97,10 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterA PRECONDITION(arguments.childFunctions.size() == 3, "AlwaysGtTtextTextPhysicalFunction requires 3 children but got {}", arguments.childFunctions.size()); - return AlwaysGtTtextTextPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return AlwaysGtTtextTextPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysLeBigintTbigintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysLeBigintTbigintPhysicalFunction.cpp index 7ab05b7beb..4dffc4cd49 100644 --- a/nes-physical-operators/src/Functions/Meos/AlwaysLeBigintTbigintPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/AlwaysLeBigintTbigintPhysicalFunction.cpp @@ -35,12 +35,12 @@ extern "C" { namespace NES { -AlwaysLeBigintTbigintPhysicalFunction::AlwaysLeBigintTbigintPhysicalFunction(PhysicalFunction scalarFunction, - PhysicalFunction valueFunction, - PhysicalFunction tsFunction) +AlwaysLeBigintTbigintPhysicalFunction::AlwaysLeBigintTbigintPhysicalFunction(PhysicalFunction arg0Function, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction) { parameterFunctions.reserve(3); - parameterFunctions.push_back(std::move(scalarFunction)); + parameterFunctions.push_back(std::move(arg0Function)); parameterFunctions.push_back(std::move(valueFunction)); parameterFunctions.push_back(std::move(tsFunction)); } @@ -50,26 +50,35 @@ VarVal AlwaysLeBigintTbigintPhysicalFunction::execute(const Record& record, Aren std::vector parameterValues; parameterValues.reserve(parameterFunctions.size()); for (const auto& function : parameterFunctions) + { parameterValues.emplace_back(function.execute(record, arena)); + } - auto scalar = parameterValues[0].cast>(); - auto value = parameterValues[1].cast>(); - auto ts = parameterValues[2].cast>(); + auto arg0 = parameterValues[0].cast>(); + auto value = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); const auto result = nautilus::invoke( - +[](double d, double v, uint64_t t) -> double { - try { + +[](double arg0, + double value, + uint64_t ts) -> int { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); - std::string wkt = fmt::format("{}@{}", static_cast(v), ts_str); - Temporal* temp = tbigint_in(wkt.c_str()); - if (!temp) return 0.0; - int r = always_le_bigint_tbigint(static_cast(d), temp); + std::string tempWkt = fmt::format("{}@{}", static_cast(value), MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tbigint_in(tempWkt.c_str()); + if (!temp) return 0; + + int r = always_le_bigint_tbigint(static_cast(arg0), temp); free(temp); - return static_cast(r); - } catch (const std::exception&) { return 0.0; } + return r; + } + catch (const std::exception&) + { + return 0; + } }, - scalar, value, ts); + arg0, value, ts); return VarVal(result); } diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysLeTbigintBigintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysLeTbigintBigintPhysicalFunction.cpp index 18083698c0..9d66c6032a 100644 --- a/nes-physical-operators/src/Functions/Meos/AlwaysLeTbigintBigintPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/AlwaysLeTbigintBigintPhysicalFunction.cpp @@ -36,13 +36,13 @@ extern "C" { namespace NES { AlwaysLeTbigintBigintPhysicalFunction::AlwaysLeTbigintBigintPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction thresholdFunction, - PhysicalFunction tsFunction) + PhysicalFunction tsFunction, + PhysicalFunction arg0Function) { parameterFunctions.reserve(3); parameterFunctions.push_back(std::move(valueFunction)); - parameterFunctions.push_back(std::move(thresholdFunction)); parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } VarVal AlwaysLeTbigintBigintPhysicalFunction::execute(const Record& record, ArenaRef& arena) const @@ -50,25 +50,35 @@ VarVal AlwaysLeTbigintBigintPhysicalFunction::execute(const Record& record, Aren std::vector parameterValues; parameterValues.reserve(parameterFunctions.size()); for (const auto& function : parameterFunctions) + { parameterValues.emplace_back(function.execute(record, arena)); + } - auto value = parameterValues[0].cast>(); - auto threshold = parameterValues[1].cast>(); - auto ts = parameterValues[2].cast>(); + auto value = parameterValues[0].cast>(); + auto ts = parameterValues[1].cast>(); + auto arg0 = parameterValues[2].cast>(); const auto result = nautilus::invoke( - +[](double value, double threshold, uint64_t ts) -> double { - try { + +[](double value, + uint64_t ts, + double arg0) -> int { + try + { MEOS::Meos::ensureMeosInitialized(); std::string tempWkt = fmt::format("{}@{}", static_cast(value), MEOS::Meos::convertEpochToTimestamp(ts)); Temporal* temp = tbigint_in(tempWkt.c_str()); - if (!temp) return 0.0; - int r = always_le_tbigint_bigint(temp, static_cast(threshold)); + if (!temp) return 0; + + int r = always_le_tbigint_bigint(temp, static_cast(arg0)); free(temp); - return static_cast(r); - } catch (const std::exception&) { return 0.0; } + return r; + } + catch (const std::exception&) + { + return 0; + } }, - value, threshold, ts); + value, ts, arg0); return VarVal(result); } diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysLeTextTtextPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysLeTextTtextPhysicalFunction.cpp index 0e5a9d1aee..e9fa1c910a 100644 --- a/nes-physical-operators/src/Functions/Meos/AlwaysLeTextTtextPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/AlwaysLeTextTtextPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -33,44 +34,59 @@ extern "C" { namespace NES { -AlwaysLeTextTtextPhysicalFunction::AlwaysLeTextTtextPhysicalFunction( - PhysicalFunction valueFunction, PhysicalFunction refFunction, PhysicalFunction tsFunction) +AlwaysLeTextTtextPhysicalFunction::AlwaysLeTextTtextPhysicalFunction(PhysicalFunction arg0Function, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction) { - paramFns.reserve(3); - paramFns.push_back(std::move(valueFunction)); - paramFns.push_back(std::move(refFunction)); - paramFns.push_back(std::move(tsFunction)); + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(arg0Function)); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); } VarVal AlwaysLeTextTtextPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto ref = paramFns[0].execute(record, arena).cast(); - auto value = paramFns[1].execute(record, arena).cast(); - auto ts = paramFns[2].execute(record, arena).cast>(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto arg0 = parameterValues[0].cast(); + auto value = parameterValues[1].cast(); + auto ts = parameterValues[2].cast>(); const auto result = nautilus::invoke( - +[](const char* r, uint32_t rsz, const char* v, uint32_t vsz, uint64_t t) -> double { - try { + +[](const char* arg0Ptr, uint32_t arg0Size, + const char* valuePtr, uint32_t valueSize, + uint64_t ts) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string ref_str(r, rsz); - std::string val_str(v, vsz); - while (!ref_str.empty() && (ref_str.front() == '\'' || ref_str.front() == '"')) ref_str = ref_str.substr(1); - while (!ref_str.empty() && (ref_str.back() == '\'' || ref_str.back() == '"')) ref_str = ref_str.substr(0, ref_str.size()-1); - while (!val_str.empty() && (val_str.front() == '\'' || val_str.front() == '"')) val_str = val_str.substr(1); - while (!val_str.empty() && (val_str.back() == '\'' || val_str.back() == '"')) val_str = val_str.substr(0, val_str.size()-1); - std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); - std::string wkt = "'" + val_str + "'@" + ts_str; - Temporal* temp = ttext_in(wkt.c_str()); + std::string tempVal(valuePtr, valueSize); + while (!tempVal.empty() && (tempVal.front() == '\'' || tempVal.front() == '"')) tempVal.erase(tempVal.begin()); + while (!tempVal.empty() && (tempVal.back() == '\'' || tempVal.back() == '"')) tempVal.pop_back(); + std::string tempWkt = "'" + tempVal + "'@" + MEOS::Meos::convertEpochToTimestamp(ts); + Temporal* temp = ttext_in(tempWkt.c_str()); if (!temp) return 0.0; - text* txt = cstring_to_text(ref_str.c_str()); - if (!txt) { free(temp); return 0.0; } - int result = always_le_text_ttext(txt, temp); + std::string arg0S(arg0Ptr, arg0Size); + while (!arg0S.empty() && (arg0S.front() == '\'' || arg0S.front() == '"')) arg0S.erase(arg0S.begin()); + while (!arg0S.empty() && (arg0S.back() == '\'' || arg0S.back() == '"')) arg0S.pop_back(); + text* txt0 = cstring_to_text(arg0S.c_str()); + if (!txt0) { free(temp); return 0.0; } + + double r = always_le_text_ttext(txt0, temp); free(temp); - free(txt); - return static_cast(result); - } catch (const std::exception&) { return 0.0; } + free(txt0); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, - ref, value, ts); + arg0.getContent(), arg0.getContentSize(), value.getContent(), value.getContentSize(), ts); return VarVal(result); } @@ -81,10 +97,10 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterA PRECONDITION(arguments.childFunctions.size() == 3, "AlwaysLeTextTtextPhysicalFunction requires 3 children but got {}", arguments.childFunctions.size()); - return AlwaysLeTextTtextPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return AlwaysLeTextTtextPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysLeTtextTextPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysLeTtextTextPhysicalFunction.cpp index 1b17b2c5a1..1013c3d5e2 100644 --- a/nes-physical-operators/src/Functions/Meos/AlwaysLeTtextTextPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/AlwaysLeTtextTextPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -33,44 +34,59 @@ extern "C" { namespace NES { -AlwaysLeTtextTextPhysicalFunction::AlwaysLeTtextTextPhysicalFunction( - PhysicalFunction valueFunction, PhysicalFunction refFunction, PhysicalFunction tsFunction) +AlwaysLeTtextTextPhysicalFunction::AlwaysLeTtextTextPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction, + PhysicalFunction arg0Function) { - paramFns.reserve(3); - paramFns.push_back(std::move(valueFunction)); - paramFns.push_back(std::move(refFunction)); - paramFns.push_back(std::move(tsFunction)); + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } VarVal AlwaysLeTtextTextPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto value = paramFns[0].execute(record, arena).cast(); - auto ref = paramFns[1].execute(record, arena).cast(); - auto ts = paramFns[2].execute(record, arena).cast>(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto value = parameterValues[0].cast(); + auto ts = parameterValues[1].cast>(); + auto arg0 = parameterValues[2].cast(); const auto result = nautilus::invoke( - +[](const char* v, uint32_t vsz, const char* r, uint32_t rsz, uint64_t t) -> double { - try { + +[](const char* valuePtr, uint32_t valueSize, + uint64_t ts, + const char* arg0Ptr, uint32_t arg0Size) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string val_str(v, vsz); - std::string ref_str(r, rsz); - while (!val_str.empty() && (val_str.front() == '\'' || val_str.front() == '"')) val_str = val_str.substr(1); - while (!val_str.empty() && (val_str.back() == '\'' || val_str.back() == '"')) val_str = val_str.substr(0, val_str.size()-1); - while (!ref_str.empty() && (ref_str.front() == '\'' || ref_str.front() == '"')) ref_str = ref_str.substr(1); - while (!ref_str.empty() && (ref_str.back() == '\'' || ref_str.back() == '"')) ref_str = ref_str.substr(0, ref_str.size()-1); - std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); - std::string wkt = "'" + val_str + "'@" + ts_str; - Temporal* temp = ttext_in(wkt.c_str()); + std::string tempVal(valuePtr, valueSize); + while (!tempVal.empty() && (tempVal.front() == '\'' || tempVal.front() == '"')) tempVal.erase(tempVal.begin()); + while (!tempVal.empty() && (tempVal.back() == '\'' || tempVal.back() == '"')) tempVal.pop_back(); + std::string tempWkt = "'" + tempVal + "'@" + MEOS::Meos::convertEpochToTimestamp(ts); + Temporal* temp = ttext_in(tempWkt.c_str()); if (!temp) return 0.0; - text* txt = cstring_to_text(ref_str.c_str()); - if (!txt) { free(temp); return 0.0; } - int result = always_le_ttext_text(temp, txt); + std::string arg0S(arg0Ptr, arg0Size); + while (!arg0S.empty() && (arg0S.front() == '\'' || arg0S.front() == '"')) arg0S.erase(arg0S.begin()); + while (!arg0S.empty() && (arg0S.back() == '\'' || arg0S.back() == '"')) arg0S.pop_back(); + text* txt0 = cstring_to_text(arg0S.c_str()); + if (!txt0) { free(temp); return 0.0; } + + double r = always_le_ttext_text(temp, txt0); free(temp); - free(txt); - return static_cast(result); - } catch (const std::exception&) { return 0.0; } + free(txt0); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, - value, ref, ts); + value.getContent(), value.getContentSize(), ts, arg0.getContent(), arg0.getContentSize()); return VarVal(result); } @@ -81,10 +97,10 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterA PRECONDITION(arguments.childFunctions.size() == 3, "AlwaysLeTtextTextPhysicalFunction requires 3 children but got {}", arguments.childFunctions.size()); - return AlwaysLeTtextTextPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return AlwaysLeTtextTextPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysLtBigintTbigintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysLtBigintTbigintPhysicalFunction.cpp index 04418bb813..1fbfe623d6 100644 --- a/nes-physical-operators/src/Functions/Meos/AlwaysLtBigintTbigintPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/AlwaysLtBigintTbigintPhysicalFunction.cpp @@ -35,12 +35,12 @@ extern "C" { namespace NES { -AlwaysLtBigintTbigintPhysicalFunction::AlwaysLtBigintTbigintPhysicalFunction(PhysicalFunction scalarFunction, - PhysicalFunction valueFunction, - PhysicalFunction tsFunction) +AlwaysLtBigintTbigintPhysicalFunction::AlwaysLtBigintTbigintPhysicalFunction(PhysicalFunction arg0Function, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction) { parameterFunctions.reserve(3); - parameterFunctions.push_back(std::move(scalarFunction)); + parameterFunctions.push_back(std::move(arg0Function)); parameterFunctions.push_back(std::move(valueFunction)); parameterFunctions.push_back(std::move(tsFunction)); } @@ -50,26 +50,35 @@ VarVal AlwaysLtBigintTbigintPhysicalFunction::execute(const Record& record, Aren std::vector parameterValues; parameterValues.reserve(parameterFunctions.size()); for (const auto& function : parameterFunctions) + { parameterValues.emplace_back(function.execute(record, arena)); + } - auto scalar = parameterValues[0].cast>(); - auto value = parameterValues[1].cast>(); - auto ts = parameterValues[2].cast>(); + auto arg0 = parameterValues[0].cast>(); + auto value = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); const auto result = nautilus::invoke( - +[](double d, double v, uint64_t t) -> double { - try { + +[](double arg0, + double value, + uint64_t ts) -> int { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); - std::string wkt = fmt::format("{}@{}", static_cast(v), ts_str); - Temporal* temp = tbigint_in(wkt.c_str()); - if (!temp) return 0.0; - int r = always_lt_bigint_tbigint(static_cast(d), temp); + std::string tempWkt = fmt::format("{}@{}", static_cast(value), MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tbigint_in(tempWkt.c_str()); + if (!temp) return 0; + + int r = always_lt_bigint_tbigint(static_cast(arg0), temp); free(temp); - return static_cast(r); - } catch (const std::exception&) { return 0.0; } + return r; + } + catch (const std::exception&) + { + return 0; + } }, - scalar, value, ts); + arg0, value, ts); return VarVal(result); } diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysLtTbigintBigintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysLtTbigintBigintPhysicalFunction.cpp index 1c222e3c3f..0039773dac 100644 --- a/nes-physical-operators/src/Functions/Meos/AlwaysLtTbigintBigintPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/AlwaysLtTbigintBigintPhysicalFunction.cpp @@ -36,13 +36,13 @@ extern "C" { namespace NES { AlwaysLtTbigintBigintPhysicalFunction::AlwaysLtTbigintBigintPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction thresholdFunction, - PhysicalFunction tsFunction) + PhysicalFunction tsFunction, + PhysicalFunction arg0Function) { parameterFunctions.reserve(3); parameterFunctions.push_back(std::move(valueFunction)); - parameterFunctions.push_back(std::move(thresholdFunction)); parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } VarVal AlwaysLtTbigintBigintPhysicalFunction::execute(const Record& record, ArenaRef& arena) const @@ -50,25 +50,35 @@ VarVal AlwaysLtTbigintBigintPhysicalFunction::execute(const Record& record, Aren std::vector parameterValues; parameterValues.reserve(parameterFunctions.size()); for (const auto& function : parameterFunctions) + { parameterValues.emplace_back(function.execute(record, arena)); + } - auto value = parameterValues[0].cast>(); - auto threshold = parameterValues[1].cast>(); - auto ts = parameterValues[2].cast>(); + auto value = parameterValues[0].cast>(); + auto ts = parameterValues[1].cast>(); + auto arg0 = parameterValues[2].cast>(); const auto result = nautilus::invoke( - +[](double value, double threshold, uint64_t ts) -> double { - try { + +[](double value, + uint64_t ts, + double arg0) -> int { + try + { MEOS::Meos::ensureMeosInitialized(); std::string tempWkt = fmt::format("{}@{}", static_cast(value), MEOS::Meos::convertEpochToTimestamp(ts)); Temporal* temp = tbigint_in(tempWkt.c_str()); - if (!temp) return 0.0; - int r = always_lt_tbigint_bigint(temp, static_cast(threshold)); + if (!temp) return 0; + + int r = always_lt_tbigint_bigint(temp, static_cast(arg0)); free(temp); - return static_cast(r); - } catch (const std::exception&) { return 0.0; } + return r; + } + catch (const std::exception&) + { + return 0; + } }, - value, threshold, ts); + value, ts, arg0); return VarVal(result); } diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysLtTextTtextPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysLtTextTtextPhysicalFunction.cpp index ca73bb826e..44c2fdfde7 100644 --- a/nes-physical-operators/src/Functions/Meos/AlwaysLtTextTtextPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/AlwaysLtTextTtextPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -33,44 +34,59 @@ extern "C" { namespace NES { -AlwaysLtTextTtextPhysicalFunction::AlwaysLtTextTtextPhysicalFunction( - PhysicalFunction valueFunction, PhysicalFunction refFunction, PhysicalFunction tsFunction) +AlwaysLtTextTtextPhysicalFunction::AlwaysLtTextTtextPhysicalFunction(PhysicalFunction arg0Function, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction) { - paramFns.reserve(3); - paramFns.push_back(std::move(valueFunction)); - paramFns.push_back(std::move(refFunction)); - paramFns.push_back(std::move(tsFunction)); + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(arg0Function)); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); } VarVal AlwaysLtTextTtextPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto ref = paramFns[0].execute(record, arena).cast(); - auto value = paramFns[1].execute(record, arena).cast(); - auto ts = paramFns[2].execute(record, arena).cast>(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto arg0 = parameterValues[0].cast(); + auto value = parameterValues[1].cast(); + auto ts = parameterValues[2].cast>(); const auto result = nautilus::invoke( - +[](const char* r, uint32_t rsz, const char* v, uint32_t vsz, uint64_t t) -> double { - try { + +[](const char* arg0Ptr, uint32_t arg0Size, + const char* valuePtr, uint32_t valueSize, + uint64_t ts) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string ref_str(r, rsz); - std::string val_str(v, vsz); - while (!ref_str.empty() && (ref_str.front() == '\'' || ref_str.front() == '"')) ref_str = ref_str.substr(1); - while (!ref_str.empty() && (ref_str.back() == '\'' || ref_str.back() == '"')) ref_str = ref_str.substr(0, ref_str.size()-1); - while (!val_str.empty() && (val_str.front() == '\'' || val_str.front() == '"')) val_str = val_str.substr(1); - while (!val_str.empty() && (val_str.back() == '\'' || val_str.back() == '"')) val_str = val_str.substr(0, val_str.size()-1); - std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); - std::string wkt = "'" + val_str + "'@" + ts_str; - Temporal* temp = ttext_in(wkt.c_str()); + std::string tempVal(valuePtr, valueSize); + while (!tempVal.empty() && (tempVal.front() == '\'' || tempVal.front() == '"')) tempVal.erase(tempVal.begin()); + while (!tempVal.empty() && (tempVal.back() == '\'' || tempVal.back() == '"')) tempVal.pop_back(); + std::string tempWkt = "'" + tempVal + "'@" + MEOS::Meos::convertEpochToTimestamp(ts); + Temporal* temp = ttext_in(tempWkt.c_str()); if (!temp) return 0.0; - text* txt = cstring_to_text(ref_str.c_str()); - if (!txt) { free(temp); return 0.0; } - int result = always_lt_text_ttext(txt, temp); + std::string arg0S(arg0Ptr, arg0Size); + while (!arg0S.empty() && (arg0S.front() == '\'' || arg0S.front() == '"')) arg0S.erase(arg0S.begin()); + while (!arg0S.empty() && (arg0S.back() == '\'' || arg0S.back() == '"')) arg0S.pop_back(); + text* txt0 = cstring_to_text(arg0S.c_str()); + if (!txt0) { free(temp); return 0.0; } + + double r = always_lt_text_ttext(txt0, temp); free(temp); - free(txt); - return static_cast(result); - } catch (const std::exception&) { return 0.0; } + free(txt0); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, - ref, value, ts); + arg0.getContent(), arg0.getContentSize(), value.getContent(), value.getContentSize(), ts); return VarVal(result); } @@ -81,10 +97,10 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterA PRECONDITION(arguments.childFunctions.size() == 3, "AlwaysLtTextTtextPhysicalFunction requires 3 children but got {}", arguments.childFunctions.size()); - return AlwaysLtTextTtextPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return AlwaysLtTextTtextPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysLtTtextTextPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysLtTtextTextPhysicalFunction.cpp index eae1a0dc44..d7922ae5a5 100644 --- a/nes-physical-operators/src/Functions/Meos/AlwaysLtTtextTextPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/AlwaysLtTtextTextPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -33,44 +34,59 @@ extern "C" { namespace NES { -AlwaysLtTtextTextPhysicalFunction::AlwaysLtTtextTextPhysicalFunction( - PhysicalFunction valueFunction, PhysicalFunction refFunction, PhysicalFunction tsFunction) +AlwaysLtTtextTextPhysicalFunction::AlwaysLtTtextTextPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction, + PhysicalFunction arg0Function) { - paramFns.reserve(3); - paramFns.push_back(std::move(valueFunction)); - paramFns.push_back(std::move(refFunction)); - paramFns.push_back(std::move(tsFunction)); + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } VarVal AlwaysLtTtextTextPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto value = paramFns[0].execute(record, arena).cast(); - auto ref = paramFns[1].execute(record, arena).cast(); - auto ts = paramFns[2].execute(record, arena).cast>(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto value = parameterValues[0].cast(); + auto ts = parameterValues[1].cast>(); + auto arg0 = parameterValues[2].cast(); const auto result = nautilus::invoke( - +[](const char* v, uint32_t vsz, const char* r, uint32_t rsz, uint64_t t) -> double { - try { + +[](const char* valuePtr, uint32_t valueSize, + uint64_t ts, + const char* arg0Ptr, uint32_t arg0Size) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string val_str(v, vsz); - std::string ref_str(r, rsz); - while (!val_str.empty() && (val_str.front() == '\'' || val_str.front() == '"')) val_str = val_str.substr(1); - while (!val_str.empty() && (val_str.back() == '\'' || val_str.back() == '"')) val_str = val_str.substr(0, val_str.size()-1); - while (!ref_str.empty() && (ref_str.front() == '\'' || ref_str.front() == '"')) ref_str = ref_str.substr(1); - while (!ref_str.empty() && (ref_str.back() == '\'' || ref_str.back() == '"')) ref_str = ref_str.substr(0, ref_str.size()-1); - std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); - std::string wkt = "'" + val_str + "'@" + ts_str; - Temporal* temp = ttext_in(wkt.c_str()); + std::string tempVal(valuePtr, valueSize); + while (!tempVal.empty() && (tempVal.front() == '\'' || tempVal.front() == '"')) tempVal.erase(tempVal.begin()); + while (!tempVal.empty() && (tempVal.back() == '\'' || tempVal.back() == '"')) tempVal.pop_back(); + std::string tempWkt = "'" + tempVal + "'@" + MEOS::Meos::convertEpochToTimestamp(ts); + Temporal* temp = ttext_in(tempWkt.c_str()); if (!temp) return 0.0; - text* txt = cstring_to_text(ref_str.c_str()); - if (!txt) { free(temp); return 0.0; } - int result = always_lt_ttext_text(temp, txt); + std::string arg0S(arg0Ptr, arg0Size); + while (!arg0S.empty() && (arg0S.front() == '\'' || arg0S.front() == '"')) arg0S.erase(arg0S.begin()); + while (!arg0S.empty() && (arg0S.back() == '\'' || arg0S.back() == '"')) arg0S.pop_back(); + text* txt0 = cstring_to_text(arg0S.c_str()); + if (!txt0) { free(temp); return 0.0; } + + double r = always_lt_ttext_text(temp, txt0); free(temp); - free(txt); - return static_cast(result); - } catch (const std::exception&) { return 0.0; } + free(txt0); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, - value, ref, ts); + value.getContent(), value.getContentSize(), ts, arg0.getContent(), arg0.getContentSize()); return VarVal(result); } @@ -81,10 +97,10 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterA PRECONDITION(arguments.childFunctions.size() == 3, "AlwaysLtTtextTextPhysicalFunction requires 3 children but got {}", arguments.childFunctions.size()); - return AlwaysLtTtextTextPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return AlwaysLtTtextTextPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysNeBigintTbigintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysNeBigintTbigintPhysicalFunction.cpp index efc2b248c5..0388366dbb 100644 --- a/nes-physical-operators/src/Functions/Meos/AlwaysNeBigintTbigintPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/AlwaysNeBigintTbigintPhysicalFunction.cpp @@ -35,12 +35,12 @@ extern "C" { namespace NES { -AlwaysNeBigintTbigintPhysicalFunction::AlwaysNeBigintTbigintPhysicalFunction(PhysicalFunction scalarFunction, - PhysicalFunction valueFunction, - PhysicalFunction tsFunction) +AlwaysNeBigintTbigintPhysicalFunction::AlwaysNeBigintTbigintPhysicalFunction(PhysicalFunction arg0Function, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction) { parameterFunctions.reserve(3); - parameterFunctions.push_back(std::move(scalarFunction)); + parameterFunctions.push_back(std::move(arg0Function)); parameterFunctions.push_back(std::move(valueFunction)); parameterFunctions.push_back(std::move(tsFunction)); } @@ -50,26 +50,35 @@ VarVal AlwaysNeBigintTbigintPhysicalFunction::execute(const Record& record, Aren std::vector parameterValues; parameterValues.reserve(parameterFunctions.size()); for (const auto& function : parameterFunctions) + { parameterValues.emplace_back(function.execute(record, arena)); + } - auto scalar = parameterValues[0].cast>(); - auto value = parameterValues[1].cast>(); - auto ts = parameterValues[2].cast>(); + auto arg0 = parameterValues[0].cast>(); + auto value = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); const auto result = nautilus::invoke( - +[](double d, double v, uint64_t t) -> double { - try { + +[](double arg0, + double value, + uint64_t ts) -> int { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); - std::string wkt = fmt::format("{}@{}", static_cast(v), ts_str); - Temporal* temp = tbigint_in(wkt.c_str()); - if (!temp) return 0.0; - int r = always_ne_bigint_tbigint(static_cast(d), temp); + std::string tempWkt = fmt::format("{}@{}", static_cast(value), MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tbigint_in(tempWkt.c_str()); + if (!temp) return 0; + + int r = always_ne_bigint_tbigint(static_cast(arg0), temp); free(temp); - return static_cast(r); - } catch (const std::exception&) { return 0.0; } + return r; + } + catch (const std::exception&) + { + return 0; + } }, - scalar, value, ts); + arg0, value, ts); return VarVal(result); } diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysNeBoolTboolPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysNeBoolTboolPhysicalFunction.cpp index b459fba06d..84a3de0c25 100644 --- a/nes-physical-operators/src/Functions/Meos/AlwaysNeBoolTboolPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/AlwaysNeBoolTboolPhysicalFunction.cpp @@ -35,12 +35,12 @@ extern "C" { namespace NES { -AlwaysNeBoolTboolPhysicalFunction::AlwaysNeBoolTboolPhysicalFunction(PhysicalFunction scalarFunction, - PhysicalFunction valueFunction, - PhysicalFunction tsFunction) +AlwaysNeBoolTboolPhysicalFunction::AlwaysNeBoolTboolPhysicalFunction(PhysicalFunction arg0Function, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction) { parameterFunctions.reserve(3); - parameterFunctions.push_back(std::move(scalarFunction)); + parameterFunctions.push_back(std::move(arg0Function)); parameterFunctions.push_back(std::move(valueFunction)); parameterFunctions.push_back(std::move(tsFunction)); } @@ -50,26 +50,35 @@ VarVal AlwaysNeBoolTboolPhysicalFunction::execute(const Record& record, ArenaRef std::vector parameterValues; parameterValues.reserve(parameterFunctions.size()); for (const auto& function : parameterFunctions) + { parameterValues.emplace_back(function.execute(record, arena)); + } - auto scalar = parameterValues[0].cast>(); - auto value = parameterValues[1].cast>(); - auto ts = parameterValues[2].cast>(); + auto arg0 = parameterValues[0].cast>(); + auto value = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); const auto result = nautilus::invoke( - +[](double b, double v, uint64_t t) -> double { - try { + +[](double arg0, + double value, + uint64_t ts) -> int { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); - std::string wkt = fmt::format("{}@{}", (v != 0.0 ? "t" : "f"), ts_str); - Temporal* temp = tbool_in(wkt.c_str()); - if (!temp) return 0.0; - int r = always_ne_bool_tbool(static_cast(b != 0.0), temp); + std::string tempWkt = fmt::format("{}@{}", value != 0.0 ? "t" : "f", MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tbool_in(tempWkt.c_str()); + if (!temp) return 0; + + int r = always_ne_bool_tbool(static_cast(arg0 != 0.0), temp); free(temp); - return static_cast(r); - } catch (const std::exception&) { return 0.0; } + return r; + } + catch (const std::exception&) + { + return 0; + } }, - scalar, value, ts); + arg0, value, ts); return VarVal(result); } diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysNeNpointTnpointPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysNeNpointTnpointPhysicalFunction.cpp index 1dac3ef61b..bfc0489dea 100644 --- a/nes-physical-operators/src/Functions/Meos/AlwaysNeNpointTnpointPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/AlwaysNeNpointTnpointPhysicalFunction.cpp @@ -13,61 +13,85 @@ */ #include + #include #include #include +#include #include #include #include #include +#include #include +#include #include #include -#include -#include extern "C" { #include -#include #include } namespace NES { -AlwaysNeNpointTnpointPhysicalFunction::AlwaysNeNpointTnpointPhysicalFunction(PhysicalFunction rid_np, PhysicalFunction pos_np, PhysicalFunction rid_tp, PhysicalFunction pos_tp, PhysicalFunction ts) +AlwaysNeNpointTnpointPhysicalFunction::AlwaysNeNpointTnpointPhysicalFunction(PhysicalFunction rid0Function, + PhysicalFunction frac0Function, + PhysicalFunction ridFunction, + PhysicalFunction fracFunction, + PhysicalFunction tsFunction) { - paramFns.reserve(5); - paramFns.push_back(std::move(rid_np)); - paramFns.push_back(std::move(pos_np)); - paramFns.push_back(std::move(rid_tp)); - paramFns.push_back(std::move(pos_tp)); - paramFns.push_back(std::move(ts)); + parameterFunctions.reserve(5); + parameterFunctions.push_back(std::move(rid0Function)); + parameterFunctions.push_back(std::move(frac0Function)); + parameterFunctions.push_back(std::move(ridFunction)); + parameterFunctions.push_back(std::move(fracFunction)); + parameterFunctions.push_back(std::move(tsFunction)); } VarVal AlwaysNeNpointTnpointPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto rid_np = paramFns[0].execute(record, arena).cast(); - auto pos_np = paramFns[1].execute(record, arena).cast(); - auto rid_tp = paramFns[2].execute(record, arena).cast(); - auto pos_tp = paramFns[3].execute(record, arena).cast(); - auto ts = paramFns[4].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto rid0 = parameterValues[0].cast>(); + auto frac0 = parameterValues[1].cast>(); + auto rid = parameterValues[2].cast>(); + auto frac = parameterValues[3].cast>(); + auto ts = parameterValues[4].cast>(); + const auto result = nautilus::invoke( - +[](uint64_t rid_np, double pos_np, uint64_t rid_tp, double pos_tp, uint64_t ts) -> double { - try { + +[](uint64_t rid0, + double frac0, + int64_t rid, + double frac, + uint64_t ts) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - Npoint* np_s = npoint_make((int64_t)rid_np, pos_np); - if (!np_s) return 0.0; - Npoint* np_t = npoint_make((int64_t)rid_tp, pos_tp); - if (!np_t) { free(np_s); return 0.0; } - Temporal* inst = (Temporal*)tnpointinst_make(np_t, (TimestampTz)ts); - free(np_t); - if (!inst) { free(np_s); return 0.0; } - int r = always_ne_npoint_tnpoint(np_s, inst); - free(np_s); free(inst); - return r > 0 ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + if (frac < 0.0 || frac > 1.0) return 0.0; + std::string tempWkt = fmt::format("NPoint({},{})@{}", rid, frac, MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tnpoint_in(tempWkt.c_str()); + if (!temp) return 0.0; + Npoint* np0 = npoint_make((int64_t)rid0, frac0); + if (!np0) { free(temp); return 0.0; } + + double r = always_ne_npoint_tnpoint(np0, temp); + free(temp); + free(np0); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, - rid_np, pos_np, rid_tp, pos_tp, ts); + rid0, frac0, rid, frac, ts); + return VarVal(result); } @@ -77,12 +101,12 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterA PRECONDITION(arguments.childFunctions.size() == 5, "AlwaysNeNpointTnpointPhysicalFunction requires 5 children but got {}", arguments.childFunctions.size()); - return AlwaysNeNpointTnpointPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2]), - std::move(arguments.childFunctions[3]), - std::move(arguments.childFunctions[4])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + return AlwaysNeNpointTnpointPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysNePoseTposePhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysNePoseTposePhysicalFunction.cpp index c0e6643536..44af35e8a5 100644 --- a/nes-physical-operators/src/Functions/Meos/AlwaysNePoseTposePhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/AlwaysNePoseTposePhysicalFunction.cpp @@ -13,65 +13,92 @@ */ #include + #include #include #include +#include #include #include #include #include +#include #include +#include #include #include -#include -#include extern "C" { #include -#include #include } namespace NES { -AlwaysNePoseTposePhysicalFunction::AlwaysNePoseTposePhysicalFunction(PhysicalFunction x2, PhysicalFunction y2, PhysicalFunction theta2, PhysicalFunction x, PhysicalFunction y, PhysicalFunction theta, PhysicalFunction ts) +AlwaysNePoseTposePhysicalFunction::AlwaysNePoseTposePhysicalFunction(PhysicalFunction px0Function, + PhysicalFunction py0Function, + PhysicalFunction ptheta0Function, + PhysicalFunction xFunction, + PhysicalFunction yFunction, + PhysicalFunction thetaFunction, + PhysicalFunction tsFunction) { - paramFns.reserve(7); - paramFns.push_back(std::move(x2)); - paramFns.push_back(std::move(y2)); - paramFns.push_back(std::move(theta2)); - paramFns.push_back(std::move(x)); - paramFns.push_back(std::move(y)); - paramFns.push_back(std::move(theta)); - paramFns.push_back(std::move(ts)); + parameterFunctions.reserve(7); + parameterFunctions.push_back(std::move(px0Function)); + parameterFunctions.push_back(std::move(py0Function)); + parameterFunctions.push_back(std::move(ptheta0Function)); + parameterFunctions.push_back(std::move(xFunction)); + parameterFunctions.push_back(std::move(yFunction)); + parameterFunctions.push_back(std::move(thetaFunction)); + parameterFunctions.push_back(std::move(tsFunction)); } VarVal AlwaysNePoseTposePhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto x2 = paramFns[0].execute(record, arena).cast(); - auto y2 = paramFns[1].execute(record, arena).cast(); - auto theta2 = paramFns[2].execute(record, arena).cast(); - auto x = paramFns[3].execute(record, arena).cast(); - auto y = paramFns[4].execute(record, arena).cast(); - auto theta = paramFns[5].execute(record, arena).cast(); - auto ts = paramFns[6].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto px0 = parameterValues[0].cast>(); + auto py0 = parameterValues[1].cast>(); + auto ptheta0 = parameterValues[2].cast>(); + auto x = parameterValues[3].cast>(); + auto y = parameterValues[4].cast>(); + auto theta = parameterValues[5].cast>(); + auto ts = parameterValues[6].cast>(); + const auto result = nautilus::invoke( - +[](double x2, double y2, double theta2, double x, double y, double theta, uint64_t ts) -> double { - try { + +[](double px0, + double py0, + double ptheta0, + double x, + double y, + double theta, + uint64_t ts) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - Pose* pose_s = pose_make_2d(x2, y2, theta2, false, 0); - if (!pose_s) return 0.0; - Pose* pose_t = pose_make_2d(x, y, theta, false, 0); - if (!pose_t) { free(pose_s); return 0.0; } - Temporal* inst = (Temporal*)tposeinst_make(pose_t, (TimestampTz)ts); - free(pose_t); - if (!inst) { free(pose_s); return 0.0; } - int r = always_ne_pose_tpose(pose_s, inst); - free(pose_s); free(inst); - return r > 0 ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + std::string tempWkt = fmt::format("Pose(Point({} {}),{})@{}", x, y, theta, MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tpose_in(tempWkt.c_str()); + if (!temp) return 0.0; + Pose* pose0 = pose_make_2d(px0, py0, ptheta0, false, 0); + if (!pose0) { free(temp); return 0.0; } + + double r = always_ne_pose_tpose(pose0, temp); + free(temp); + free(pose0); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, - x2, y2, theta2, x, y, theta, ts); + px0, py0, ptheta0, x, y, theta, ts); + return VarVal(result); } @@ -81,14 +108,14 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterA PRECONDITION(arguments.childFunctions.size() == 7, "AlwaysNePoseTposePhysicalFunction requires 7 children but got {}", arguments.childFunctions.size()); - return AlwaysNePoseTposePhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2]), - std::move(arguments.childFunctions[3]), - std::move(arguments.childFunctions[4]), - std::move(arguments.childFunctions[5]), - std::move(arguments.childFunctions[6])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + auto arg5 = std::move(arguments.childFunctions[5]); + auto arg6 = std::move(arguments.childFunctions[6]); + return AlwaysNePoseTposePhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysNeTbigintBigintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysNeTbigintBigintPhysicalFunction.cpp index b8848188c2..30032023d1 100644 --- a/nes-physical-operators/src/Functions/Meos/AlwaysNeTbigintBigintPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/AlwaysNeTbigintBigintPhysicalFunction.cpp @@ -36,13 +36,13 @@ extern "C" { namespace NES { AlwaysNeTbigintBigintPhysicalFunction::AlwaysNeTbigintBigintPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction thresholdFunction, - PhysicalFunction tsFunction) + PhysicalFunction tsFunction, + PhysicalFunction arg0Function) { parameterFunctions.reserve(3); parameterFunctions.push_back(std::move(valueFunction)); - parameterFunctions.push_back(std::move(thresholdFunction)); parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } VarVal AlwaysNeTbigintBigintPhysicalFunction::execute(const Record& record, ArenaRef& arena) const @@ -50,25 +50,35 @@ VarVal AlwaysNeTbigintBigintPhysicalFunction::execute(const Record& record, Aren std::vector parameterValues; parameterValues.reserve(parameterFunctions.size()); for (const auto& function : parameterFunctions) + { parameterValues.emplace_back(function.execute(record, arena)); + } - auto value = parameterValues[0].cast>(); - auto threshold = parameterValues[1].cast>(); - auto ts = parameterValues[2].cast>(); + auto value = parameterValues[0].cast>(); + auto ts = parameterValues[1].cast>(); + auto arg0 = parameterValues[2].cast>(); const auto result = nautilus::invoke( - +[](double value, double threshold, uint64_t ts) -> double { - try { + +[](double value, + uint64_t ts, + double arg0) -> int { + try + { MEOS::Meos::ensureMeosInitialized(); std::string tempWkt = fmt::format("{}@{}", static_cast(value), MEOS::Meos::convertEpochToTimestamp(ts)); Temporal* temp = tbigint_in(tempWkt.c_str()); - if (!temp) return 0.0; - int r = always_ne_tbigint_bigint(temp, static_cast(threshold)); + if (!temp) return 0; + + int r = always_ne_tbigint_bigint(temp, static_cast(arg0)); free(temp); - return static_cast(r); - } catch (const std::exception&) { return 0.0; } + return r; + } + catch (const std::exception&) + { + return 0; + } }, - value, threshold, ts); + value, ts, arg0); return VarVal(result); } diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysNeTboolBoolPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysNeTboolBoolPhysicalFunction.cpp index 4d3b327a92..b96149f20e 100644 --- a/nes-physical-operators/src/Functions/Meos/AlwaysNeTboolBoolPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/AlwaysNeTboolBoolPhysicalFunction.cpp @@ -36,13 +36,13 @@ extern "C" { namespace NES { AlwaysNeTboolBoolPhysicalFunction::AlwaysNeTboolBoolPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction thresholdFunction, - PhysicalFunction tsFunction) + PhysicalFunction tsFunction, + PhysicalFunction arg0Function) { parameterFunctions.reserve(3); parameterFunctions.push_back(std::move(valueFunction)); - parameterFunctions.push_back(std::move(thresholdFunction)); parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } VarVal AlwaysNeTboolBoolPhysicalFunction::execute(const Record& record, ArenaRef& arena) const @@ -50,26 +50,35 @@ VarVal AlwaysNeTboolBoolPhysicalFunction::execute(const Record& record, ArenaRef std::vector parameterValues; parameterValues.reserve(parameterFunctions.size()); for (const auto& function : parameterFunctions) + { parameterValues.emplace_back(function.execute(record, arena)); + } - auto value = parameterValues[0].cast>(); - auto threshold = parameterValues[1].cast>(); - auto ts = parameterValues[2].cast>(); + auto value = parameterValues[0].cast>(); + auto ts = parameterValues[1].cast>(); + auto arg0 = parameterValues[2].cast>(); const auto result = nautilus::invoke( - +[](double v, double thr, uint64_t t) -> double { - try { + +[](double value, + uint64_t ts, + double arg0) -> int { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); - std::string wkt = fmt::format("{}@{}", (v != 0.0 ? "t" : "f"), ts_str); - Temporal* temp = tbool_in(wkt.c_str()); - if (!temp) return 0.0; - int r = always_ne_tbool_bool(temp, static_cast(thr != 0.0)); + std::string tempWkt = fmt::format("{}@{}", value != 0.0 ? "t" : "f", MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tbool_in(tempWkt.c_str()); + if (!temp) return 0; + + int r = always_ne_tbool_bool(temp, static_cast(arg0 != 0.0)); free(temp); - return static_cast(r); - } catch (const std::exception&) { return 0.0; } + return r; + } + catch (const std::exception&) + { + return 0; + } }, - value, threshold, ts); + value, ts, arg0); return VarVal(result); } diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysNeTcbufferTcbufferPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysNeTcbufferTcbufferPhysicalFunction.cpp index e142ca34b0..951fede1ba 100644 --- a/nes-physical-operators/src/Functions/Meos/AlwaysNeTcbufferTcbufferPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/AlwaysNeTcbufferTcbufferPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -20,75 +21,88 @@ #include #include #include +#include #include +#include #include #include -#include -#include extern "C" { #include -#include #include } namespace NES { -AlwaysNeTcbufferTcbufferPhysicalFunction::AlwaysNeTcbufferTcbufferPhysicalFunction( - PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction r1, PhysicalFunction ts1, - PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction r2, PhysicalFunction ts2) +AlwaysNeTcbufferTcbufferPhysicalFunction::AlwaysNeTcbufferTcbufferPhysicalFunction(PhysicalFunction lonAFunction, + PhysicalFunction latAFunction, + PhysicalFunction radiusAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction lonBFunction, + PhysicalFunction latBFunction, + PhysicalFunction radiusBFunction, + PhysicalFunction tsBFunction) { - paramFns.reserve(8); - paramFns.push_back(std::move(lon1)); - paramFns.push_back(std::move(lat1)); - paramFns.push_back(std::move(r1)); - paramFns.push_back(std::move(ts1)); - paramFns.push_back(std::move(lon2)); - paramFns.push_back(std::move(lat2)); - paramFns.push_back(std::move(r2)); - paramFns.push_back(std::move(ts2)); + parameterFunctions.reserve(8); + parameterFunctions.push_back(std::move(lonAFunction)); + parameterFunctions.push_back(std::move(latAFunction)); + parameterFunctions.push_back(std::move(radiusAFunction)); + parameterFunctions.push_back(std::move(tsAFunction)); + parameterFunctions.push_back(std::move(lonBFunction)); + parameterFunctions.push_back(std::move(latBFunction)); + parameterFunctions.push_back(std::move(radiusBFunction)); + parameterFunctions.push_back(std::move(tsBFunction)); } VarVal AlwaysNeTcbufferTcbufferPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto lon1 = paramFns[0].execute(record, arena).cast(); - auto lat1 = paramFns[1].execute(record, arena).cast(); - auto r1 = paramFns[2].execute(record, arena).cast(); - auto ts1 = paramFns[3].execute(record, arena).cast(); - auto lon2 = paramFns[4].execute(record, arena).cast(); - auto lat2 = paramFns[5].execute(record, arena).cast(); - auto r2 = paramFns[6].execute(record, arena).cast(); - auto ts2 = paramFns[7].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto lonA = parameterValues[0].cast>(); + auto latA = parameterValues[1].cast>(); + auto radiusA = parameterValues[2].cast>(); + auto tsA = parameterValues[3].cast>(); + auto lonB = parameterValues[4].cast>(); + auto latB = parameterValues[5].cast>(); + auto radiusB = parameterValues[6].cast>(); + auto tsB = parameterValues[7].cast>(); const auto result = nautilus::invoke( - +[](double lon1, double lat1, double r1, uint64_t ts1, - double lon2, double lat2, double r2, uint64_t ts2) -> double { - try { + +[](double lonAValue, double latAValue, double radiusAValue, uint64_t tsAValue, + double lonBValue, double latBValue, double radiusBValue, uint64_t tsBValue) -> int { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string pt1 = fmt::format("POINT({} {})", lon1, lat1); - GSERIALIZED* gs1 = geom_in(pt1.c_str(), -1); - if (!gs1) return 0.0; - Cbuffer* cb1 = cbuffer_make(gs1, r1); - free(gs1); - if (!cb1) return 0.0; - Temporal* tcb1 = (Temporal*)tcbufferinst_make(cb1, (TimestampTz)ts1); - free(cb1); - if (!tcb1) return 0.0; - std::string pt2 = fmt::format("POINT({} {})", lon2, lat2); - GSERIALIZED* gs2 = geom_in(pt2.c_str(), -1); - if (!gs2) { free(tcb1); return 0.0; } - Cbuffer* cb2 = cbuffer_make(gs2, r2); - free(gs2); - if (!cb2) { free(tcb1); return 0.0; } - Temporal* tcb2 = (Temporal*)tcbufferinst_make(cb2, (TimestampTz)ts2); - free(cb2); - if (!tcb2) { free(tcb1); return 0.0; } - int r = always_ne_tcbuffer_tcbuffer(tcb1, tcb2); - free(tcb1); free(tcb2); - return r > 0 ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + if (!(lonAValue >= -180.0 && lonAValue <= 180.0 && latAValue >= -90.0 && latAValue <= 90.0)) return 0; + if (!(lonBValue >= -180.0 && lonBValue <= 180.0 && latBValue >= -90.0 && latBValue <= 90.0)) return 0; + if (radiusAValue < 0.0 || radiusBValue < 0.0) return 0; + + const std::string tsAString = MEOS::Meos::convertEpochToTimestamp(tsAValue); + const std::string tsBString = MEOS::Meos::convertEpochToTimestamp(tsBValue); + std::string wktA = fmt::format("Cbuffer(Point({} {}),{})@{}", lonAValue, latAValue, radiusAValue, tsAString); + std::string wktB = fmt::format("Cbuffer(Point({} {}),{})@{}", lonBValue, latBValue, radiusBValue, tsBString); + + Temporal* tA = tcbuffer_in(wktA.c_str()); + if (!tA) return 0; + Temporal* tB = tcbuffer_in(wktB.c_str()); + if (!tB) { free(tA); return 0; } + + int r = always_ne_tcbuffer_tcbuffer(tA, tB); + free(tA); + free(tB); + return r; + } + catch (const std::exception&) + { + return 0; + } }, - lon1, lat1, r1, ts1, lon2, lat2, r2, ts2); + lonA, latA, radiusA, tsA, lonB, latB, radiusB, tsB); return VarVal(result); } @@ -99,14 +113,15 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterA PRECONDITION(arguments.childFunctions.size() == 8, "AlwaysNeTcbufferTcbufferPhysicalFunction requires 8 children but got {}", arguments.childFunctions.size()); - return AlwaysNeTcbufferTcbufferPhysicalFunction(std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2]), - std::move(arguments.childFunctions[3]), - std::move(arguments.childFunctions[4]), - std::move(arguments.childFunctions[5]), - std::move(arguments.childFunctions[6]), - std::move(arguments.childFunctions[7])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + auto arg5 = std::move(arguments.childFunctions[5]); + auto arg6 = std::move(arguments.childFunctions[6]); + auto arg7 = std::move(arguments.childFunctions[7]); + return AlwaysNeTcbufferTcbufferPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6), std::move(arg7)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysNeTextTtextPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysNeTextTtextPhysicalFunction.cpp index 83e39a5bfa..a53973c5d6 100644 --- a/nes-physical-operators/src/Functions/Meos/AlwaysNeTextTtextPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/AlwaysNeTextTtextPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -33,44 +34,59 @@ extern "C" { namespace NES { -AlwaysNeTextTtextPhysicalFunction::AlwaysNeTextTtextPhysicalFunction( - PhysicalFunction valueFunction, PhysicalFunction refFunction, PhysicalFunction tsFunction) +AlwaysNeTextTtextPhysicalFunction::AlwaysNeTextTtextPhysicalFunction(PhysicalFunction arg0Function, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction) { - paramFns.reserve(3); - paramFns.push_back(std::move(valueFunction)); - paramFns.push_back(std::move(refFunction)); - paramFns.push_back(std::move(tsFunction)); + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(arg0Function)); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); } VarVal AlwaysNeTextTtextPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto ref = paramFns[0].execute(record, arena).cast(); - auto value = paramFns[1].execute(record, arena).cast(); - auto ts = paramFns[2].execute(record, arena).cast>(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto arg0 = parameterValues[0].cast(); + auto value = parameterValues[1].cast(); + auto ts = parameterValues[2].cast>(); const auto result = nautilus::invoke( - +[](const char* r, uint32_t rsz, const char* v, uint32_t vsz, uint64_t t) -> double { - try { + +[](const char* arg0Ptr, uint32_t arg0Size, + const char* valuePtr, uint32_t valueSize, + uint64_t ts) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string ref_str(r, rsz); - std::string val_str(v, vsz); - while (!ref_str.empty() && (ref_str.front() == '\'' || ref_str.front() == '"')) ref_str = ref_str.substr(1); - while (!ref_str.empty() && (ref_str.back() == '\'' || ref_str.back() == '"')) ref_str = ref_str.substr(0, ref_str.size()-1); - while (!val_str.empty() && (val_str.front() == '\'' || val_str.front() == '"')) val_str = val_str.substr(1); - while (!val_str.empty() && (val_str.back() == '\'' || val_str.back() == '"')) val_str = val_str.substr(0, val_str.size()-1); - std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); - std::string wkt = "'" + val_str + "'@" + ts_str; - Temporal* temp = ttext_in(wkt.c_str()); + std::string tempVal(valuePtr, valueSize); + while (!tempVal.empty() && (tempVal.front() == '\'' || tempVal.front() == '"')) tempVal.erase(tempVal.begin()); + while (!tempVal.empty() && (tempVal.back() == '\'' || tempVal.back() == '"')) tempVal.pop_back(); + std::string tempWkt = "'" + tempVal + "'@" + MEOS::Meos::convertEpochToTimestamp(ts); + Temporal* temp = ttext_in(tempWkt.c_str()); if (!temp) return 0.0; - text* txt = cstring_to_text(ref_str.c_str()); - if (!txt) { free(temp); return 0.0; } - int result = always_ne_text_ttext(txt, temp); + std::string arg0S(arg0Ptr, arg0Size); + while (!arg0S.empty() && (arg0S.front() == '\'' || arg0S.front() == '"')) arg0S.erase(arg0S.begin()); + while (!arg0S.empty() && (arg0S.back() == '\'' || arg0S.back() == '"')) arg0S.pop_back(); + text* txt0 = cstring_to_text(arg0S.c_str()); + if (!txt0) { free(temp); return 0.0; } + + double r = always_ne_text_ttext(txt0, temp); free(temp); - free(txt); - return static_cast(result); - } catch (const std::exception&) { return 0.0; } + free(txt0); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, - ref, value, ts); + arg0.getContent(), arg0.getContentSize(), value.getContent(), value.getContentSize(), ts); return VarVal(result); } @@ -81,10 +97,10 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterA PRECONDITION(arguments.childFunctions.size() == 3, "AlwaysNeTextTtextPhysicalFunction requires 3 children but got {}", arguments.childFunctions.size()); - return AlwaysNeTextTtextPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return AlwaysNeTextTtextPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysNeTgeoGeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysNeTgeoGeoPhysicalFunction.cpp index 6591e10cb6..378188b2de 100644 --- a/nes-physical-operators/src/Functions/Meos/AlwaysNeTgeoGeoPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/AlwaysNeTgeoGeoPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -34,40 +35,75 @@ extern "C" { namespace NES { -AlwaysNeTgeoGeoPhysicalFunction::AlwaysNeTgeoGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, - PhysicalFunction ts, PhysicalFunction wkt) +AlwaysNeTgeoGeoPhysicalFunction::AlwaysNeTgeoGeoPhysicalFunction(PhysicalFunction lonFunction, + PhysicalFunction latFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction) { - paramFns.reserve(4); - paramFns.push_back(std::move(lon)); - paramFns.push_back(std::move(lat)); - paramFns.push_back(std::move(ts)); - paramFns.push_back(std::move(wkt)); + parameterFunctions.reserve(4); + parameterFunctions.push_back(std::move(lonFunction)); + parameterFunctions.push_back(std::move(latFunction)); + parameterFunctions.push_back(std::move(timestampFunction)); + parameterFunctions.push_back(std::move(geometryFunction)); } VarVal AlwaysNeTgeoGeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto lon = paramFns[0].execute(record, arena).cast(); - auto lat = paramFns[1].execute(record, arena).cast(); - auto ts = paramFns[2].execute(record, arena).cast(); - auto wkt = paramFns[3].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto lon = parameterValues[0].cast>(); + auto lat = parameterValues[1].cast>(); + auto timestamp = parameterValues[2].cast>(); + auto geometry = parameterValues[3].cast(); const auto result = nautilus::invoke( - +[](double lon, double lat, uint64_t ts, - const char* w, uint32_t wsz) -> double { - try { + +[](double lonValue, + double latValue, + uint64_t timestampValue, + const char* geometryPtr, + uint32_t geometrySize) -> int { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string wktStr(w, wsz); - std::string tgeoWkt = fmt::format("SRID=4326;POINT({},{})@{}", lon, lat, ts); - Temporal* tgeo = tgeompoint_in(tgeoWkt.c_str()); - if (!tgeo) return 0.0; - GSERIALIZED* gs = geom_in(wktStr.c_str(), -1); - if (!gs) { free(tgeo); return 0.0; } - double r = always_ne_tgeo_geo(tgeo, gs) > 0 ? 1.0 : 0.0; - free(tgeo); free(gs); - return r; - } catch (const std::exception&) { return 0.0; } + if (!(lonValue >= -180.0 && lonValue <= 180.0 && latValue >= -90.0 && latValue <= 90.0)) { + return 0; + } + + const std::string timestampString = MEOS::Meos::convertEpochToTimestamp(timestampValue); + std::string temporalGeometryWkt = fmt::format("SRID=4326;Point({} {})@{}", lonValue, latValue, timestampString); + std::string staticGeometryWkt(geometryPtr, geometrySize); + + while (!staticGeometryWkt.empty() && (staticGeometryWkt.front() == '\'' || staticGeometryWkt.front() == '"')) + staticGeometryWkt.erase(staticGeometryWkt.begin()); + while (!staticGeometryWkt.empty() && (staticGeometryWkt.back() == '\'' || staticGeometryWkt.back() == '"')) + staticGeometryWkt.pop_back(); + + if (temporalGeometryWkt.empty() || staticGeometryWkt.empty()) + return 0; + + MEOS::Meos::TemporalGeometry temporalGeometry(temporalGeometryWkt); + if (!temporalGeometry.getGeometry()) return 0; + MEOS::Meos::StaticGeometry staticGeometry(staticGeometryWkt); + if (!staticGeometry.getGeometry()) return 0; + + // MEOS spatial-relation call — same shape as TemporalEDWithin's + // edwithin_tgeo_geo, but specific MEOS function per generated operator. + // Real MEOS spatial-rel signature: int fn(const Temporal *, const GSERIALIZED *) + // (no `atstart` flag — that's specific to geog_dwithin / edwithin's 3-arg variant). + return always_ne_tgeo_geo(temporalGeometry.getGeometry(), + staticGeometry.getGeometry()); + } + catch (const std::exception&) + { + return 0; + } }, - lon, lat, ts, wkt); + lon, lat, timestamp, geometry.getContent(), geometry.getContentSize()); return VarVal(result); } @@ -78,10 +114,11 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterA PRECONDITION(arguments.childFunctions.size() == 4, "AlwaysNeTgeoGeoPhysicalFunction requires 4 children but got {}", arguments.childFunctions.size()); - return AlwaysNeTgeoGeoPhysicalFunction(std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2]), - std::move(arguments.childFunctions[3])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + return AlwaysNeTgeoGeoPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysNeTgeoTgeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysNeTgeoTgeoPhysicalFunction.cpp index bd05ab175c..a219236cf7 100644 --- a/nes-physical-operators/src/Functions/Meos/AlwaysNeTgeoTgeoPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/AlwaysNeTgeoTgeoPhysicalFunction.cpp @@ -13,10 +13,10 @@ */ #include + #include #include #include -#include #include #include #include @@ -34,42 +34,68 @@ extern "C" { namespace NES { -AlwaysNeTgeoTgeoPhysicalFunction::AlwaysNeTgeoTgeoPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction ts1, PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction ts2) +AlwaysNeTgeoTgeoPhysicalFunction::AlwaysNeTgeoTgeoPhysicalFunction(PhysicalFunction lonAFunction, + PhysicalFunction latAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction lonBFunction, + PhysicalFunction latBFunction, + PhysicalFunction tsBFunction) { - paramFns.reserve(6); - paramFns.push_back(std::move(lon1)); - paramFns.push_back(std::move(lat1)); - paramFns.push_back(std::move(ts1)); - paramFns.push_back(std::move(lon2)); - paramFns.push_back(std::move(lat2)); - paramFns.push_back(std::move(ts2)); + parameterFunctions.reserve(6); + parameterFunctions.push_back(std::move(lonAFunction)); + parameterFunctions.push_back(std::move(latAFunction)); + parameterFunctions.push_back(std::move(tsAFunction)); + parameterFunctions.push_back(std::move(lonBFunction)); + parameterFunctions.push_back(std::move(latBFunction)); + parameterFunctions.push_back(std::move(tsBFunction)); } VarVal AlwaysNeTgeoTgeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto lon1 = paramFns[0].execute(record, arena).cast(); - auto lat1 = paramFns[1].execute(record, arena).cast(); - auto ts1 = paramFns[2].execute(record, arena).cast(); - auto lon2 = paramFns[3].execute(record, arena).cast(); - auto lat2 = paramFns[4].execute(record, arena).cast(); - auto ts2 = paramFns[5].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto lonA = parameterValues[0].cast>(); + auto latA = parameterValues[1].cast>(); + auto tsA = parameterValues[2].cast>(); + auto lonB = parameterValues[3].cast>(); + auto latB = parameterValues[4].cast>(); + auto tsB = parameterValues[5].cast>(); + const auto result = nautilus::invoke( - +[](double lon1, double lat1, uint64_t ts1, - double lon2, double lat2, uint64_t ts2) -> double { - try { + +[](double lonAValue, double latAValue, uint64_t tsAValue, + double lonBValue, double latBValue, uint64_t tsBValue) -> int { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string wkt1 = fmt::format("SRID=4326;POINT({},{})@{}", lon1, lat1, ts1); - Temporal* t1 = tgeompoint_in(wkt1.c_str()); - if (!t1) return 0.0; - std::string wkt2 = fmt::format("SRID=4326;POINT({},{})@{}", lon2, lat2, ts2); - Temporal* t2 = tgeompoint_in(wkt2.c_str()); - if (!t2) { free(t1); return 0.0; } - int r = always_ne_tgeo_tgeo(t1, t2); - free(t1); free(t2); - return r > 0 ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + if (!(lonAValue >= -180.0 && lonAValue <= 180.0 && latAValue >= -90.0 && latAValue <= 90.0)) return 0; + if (!(lonBValue >= -180.0 && lonBValue <= 180.0 && latBValue >= -90.0 && latBValue <= 90.0)) return 0; + + const std::string tsAString = MEOS::Meos::convertEpochToTimestamp(tsAValue); + const std::string tsBString = MEOS::Meos::convertEpochToTimestamp(tsBValue); + std::string temporalGeometryAWkt = fmt::format("SRID=4326;Point({} {})@{}", lonAValue, latAValue, tsAString); + std::string temporalGeometryBWkt = fmt::format("SRID=4326;Point({} {})@{}", lonBValue, latBValue, tsBString); + + MEOS::Meos::TemporalGeometry temporalGeometryA(temporalGeometryAWkt); + if (!temporalGeometryA.getGeometry()) return 0; + MEOS::Meos::TemporalGeometry temporalGeometryB(temporalGeometryBWkt); + if (!temporalGeometryB.getGeometry()) return 0; + + // MEOS *_tgeo_tgeo spatial-relation: int fn(const Temporal*, const Temporal*). + return always_ne_tgeo_tgeo(temporalGeometryA.getGeometry(), + temporalGeometryB.getGeometry()); + } + catch (const std::exception&) + { + return 0; + } }, - lon1, lat1, ts1, lon2, lat2, ts2); + lonA, latA, tsA, lonB, latB, tsB); + return VarVal(result); } @@ -79,13 +105,13 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterA PRECONDITION(arguments.childFunctions.size() == 6, "AlwaysNeTgeoTgeoPhysicalFunction requires 6 children but got {}", arguments.childFunctions.size()); - return AlwaysNeTgeoTgeoPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2]), - std::move(arguments.childFunctions[3]), - std::move(arguments.childFunctions[4]), - std::move(arguments.childFunctions[5])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + auto arg5 = std::move(arguments.childFunctions[5]); + return AlwaysNeTgeoTgeoPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysNeTh3indexH3indexPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysNeTh3indexH3indexPhysicalFunction.cpp index ac819a26dd..80a98ff206 100644 --- a/nes-physical-operators/src/Functions/Meos/AlwaysNeTh3indexH3indexPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/AlwaysNeTh3indexH3indexPhysicalFunction.cpp @@ -13,14 +13,18 @@ */ #include + #include #include #include +#include #include #include #include #include +#include #include +#include #include #include @@ -31,33 +35,49 @@ extern "C" { namespace NES { -AlwaysNeTh3indexH3indexPhysicalFunction::AlwaysNeTh3indexH3indexPhysicalFunction(PhysicalFunction cell, PhysicalFunction ts, - PhysicalFunction target) +AlwaysNeTh3indexH3indexPhysicalFunction::AlwaysNeTh3indexH3indexPhysicalFunction(PhysicalFunction cellFunction, + PhysicalFunction tsFunction, + PhysicalFunction arg0Function) { - paramFns.reserve(3); - paramFns.push_back(std::move(cell)); - paramFns.push_back(std::move(ts)); - paramFns.push_back(std::move(target)); + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(cellFunction)); + parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } VarVal AlwaysNeTh3indexH3indexPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto cell = paramFns[0].execute(record, arena).cast(); - auto ts = paramFns[1].execute(record, arena).cast(); - auto target = paramFns[2].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto cell = parameterValues[0].cast>(); + auto ts = parameterValues[1].cast>(); + auto arg0 = parameterValues[2].cast>(); const auto result = nautilus::invoke( - +[](uint64_t cell, uint64_t ts, uint64_t target) -> double { - try { + +[](uint64_t cell, + uint64_t ts, + uint64_t arg0) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - Temporal* inst = th3indexinst_make((H3Index)cell, (TimestampTz)ts); - if (!inst) return 0.0; - int r = always_ne_th3index_h3index(inst, (H3Index)target); - free(inst); - return r > 0 ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + Temporal* temp = th3indexinst_make((H3Index)cell, (TimestampTz)ts); + if (!temp) return 0.0; + + double r = always_ne_th3index_h3index(temp, (H3Index)arg0); + free(temp); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, - cell, ts, target); + cell, ts, arg0); return VarVal(result); } @@ -68,9 +88,10 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterA PRECONDITION(arguments.childFunctions.size() == 3, "AlwaysNeTh3indexH3indexPhysicalFunction requires 3 children but got {}", arguments.childFunctions.size()); - return AlwaysNeTh3indexH3indexPhysicalFunction(std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return AlwaysNeTh3indexH3indexPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysNeTjsonbJsonbPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysNeTjsonbJsonbPhysicalFunction.cpp index c5cd9a5537..f7ec0374ef 100644 --- a/nes-physical-operators/src/Functions/Meos/AlwaysNeTjsonbJsonbPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/AlwaysNeTjsonbJsonbPhysicalFunction.cpp @@ -13,18 +13,20 @@ */ #include + #include #include #include +#include #include #include #include #include +#include #include +#include #include #include -#include -#include extern "C" { #include @@ -33,40 +35,58 @@ extern "C" { namespace NES { -AlwaysNeTjsonbJsonbPhysicalFunction::AlwaysNeTjsonbJsonbPhysicalFunction(PhysicalFunction json_str, PhysicalFunction ts, PhysicalFunction target_json) +AlwaysNeTjsonbJsonbPhysicalFunction::AlwaysNeTjsonbJsonbPhysicalFunction(PhysicalFunction json_strFunction, + PhysicalFunction tsFunction, + PhysicalFunction arg0Function) { - paramFns.reserve(3); - paramFns.push_back(std::move(json_str)); - paramFns.push_back(std::move(ts)); - paramFns.push_back(std::move(target_json)); + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(json_strFunction)); + parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } VarVal AlwaysNeTjsonbJsonbPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto json_str = paramFns[0].execute(record, arena); - auto ts = paramFns[1].execute(record, arena).cast(); - auto target_json = paramFns[2].execute(record, arena); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto json_str = parameterValues[0].cast(); + auto ts = parameterValues[1].cast>(); + auto arg0 = parameterValues[2].cast(); + const auto result = nautilus::invoke( - +[](const char* json_str, uint32_t json_len, uint64_t ts, const char* target_json, uint32_t target_len) -> double { - try { + +[](const char* json_strPtr, uint32_t json_strSize, + uint64_t ts, + const char* arg0Ptr, uint32_t arg0Size) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - char* s1 = (char*)malloc(json_len + 1); - memcpy(s1, json_str, json_len); s1[json_len] = '\0'; - Jsonb* jb = jsonb_in(s1); free(s1); - if (!jb) return 0.0; - TInstant* inst = tjsonbinst_make(jb, (TimestampTz)ts); - free(jb); - if (!inst) return 0.0; - char* s2 = (char*)malloc(target_len + 1); - memcpy(s2, target_json, target_len); s2[target_len] = '\0'; - Jsonb* target = jsonb_in(s2); free(s2); - if (!target) { free(inst); return 0.0; } - bool r = always_ne_tjsonb_jsonb((Temporal*)inst, target) > 0; - free(inst); free(target); - return r ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + std::string tempS(json_strPtr, json_strSize); + Jsonb* tempJb = jsonb_in(tempS.c_str()); + if (!tempJb) return 0.0; + Temporal* temp = (Temporal*)tjsonbinst_make(tempJb, (TimestampTz)ts); + free(tempJb); + if (!temp) return 0.0; + std::string arg0S(arg0Ptr, arg0Size); + Jsonb* jb0 = jsonb_in(arg0S.c_str()); + if (!jb0) { free(temp); return 0.0; } + + double r = always_ne_tjsonb_jsonb(temp, jb0); + free(temp); + free(jb0); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, - json_str, ts, target_json); + json_str.getContent(), json_str.getContentSize(), ts, arg0.getContent(), arg0.getContentSize()); + return VarVal(result); } @@ -76,10 +96,10 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterA PRECONDITION(arguments.childFunctions.size() == 3, "AlwaysNeTjsonbJsonbPhysicalFunction requires 3 children but got {}", arguments.childFunctions.size()); - return AlwaysNeTjsonbJsonbPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return AlwaysNeTjsonbJsonbPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysNeTjsonbTjsonbPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysNeTjsonbTjsonbPhysicalFunction.cpp index 8bf4b65a00..2cfb5711a6 100644 --- a/nes-physical-operators/src/Functions/Meos/AlwaysNeTjsonbTjsonbPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/AlwaysNeTjsonbTjsonbPhysicalFunction.cpp @@ -13,18 +13,20 @@ */ #include + #include #include #include +#include #include #include #include #include +#include #include +#include #include #include -#include -#include extern "C" { #include @@ -33,45 +35,65 @@ extern "C" { namespace NES { -AlwaysNeTjsonbTjsonbPhysicalFunction::AlwaysNeTjsonbTjsonbPhysicalFunction(PhysicalFunction json1, PhysicalFunction ts1, PhysicalFunction json2, PhysicalFunction ts2) +AlwaysNeTjsonbTjsonbPhysicalFunction::AlwaysNeTjsonbTjsonbPhysicalFunction(PhysicalFunction json_strFunction, + PhysicalFunction tsFunction, + PhysicalFunction json0Function, + PhysicalFunction ts0Function) { - paramFns.reserve(4); - paramFns.push_back(std::move(json1)); - paramFns.push_back(std::move(ts1)); - paramFns.push_back(std::move(json2)); - paramFns.push_back(std::move(ts2)); + parameterFunctions.reserve(4); + parameterFunctions.push_back(std::move(json_strFunction)); + parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(json0Function)); + parameterFunctions.push_back(std::move(ts0Function)); } VarVal AlwaysNeTjsonbTjsonbPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto json1 = paramFns[0].execute(record, arena); - auto ts1 = paramFns[1].execute(record, arena).cast(); - auto json2 = paramFns[2].execute(record, arena); - auto ts2 = paramFns[3].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto json_str = parameterValues[0].cast(); + auto ts = parameterValues[1].cast>(); + auto json0 = parameterValues[2].cast(); + auto ts0 = parameterValues[3].cast>(); + const auto result = nautilus::invoke( - +[](const char* json1, uint32_t json1_len, uint64_t ts1, const char* json2, uint32_t json2_len, uint64_t ts2) -> double { - try { + +[](const char* json_strPtr, uint32_t json_strSize, + uint64_t ts, + const char* json0Ptr, uint32_t json0Size, + uint64_t ts0) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - char* s1 = (char*)malloc(json1_len + 1); - memcpy(s1, json1, json1_len); s1[json1_len] = '\0'; - Jsonb* jb1 = jsonb_in(s1); free(s1); - if (!jb1) return 0.0; - TInstant* inst1 = tjsonbinst_make(jb1, (TimestampTz)ts1); - free(jb1); - if (!inst1) return 0.0; - char* s2 = (char*)malloc(json2_len + 1); - memcpy(s2, json2, json2_len); s2[json2_len] = '\0'; - Jsonb* jb2 = jsonb_in(s2); free(s2); - if (!jb2) { free(inst1); return 0.0; } - TInstant* inst2 = tjsonbinst_make(jb2, (TimestampTz)ts2); - free(jb2); - if (!inst2) { free(inst1); return 0.0; } - int r = always_ne_tjsonb_tjsonb((Temporal*)inst1, (Temporal*)inst2); - free(inst1); free(inst2); - return r > 0 ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + std::string tempS(json_strPtr, json_strSize); + Jsonb* tempJb = jsonb_in(tempS.c_str()); + if (!tempJb) return 0.0; + Temporal* temp = (Temporal*)tjsonbinst_make(tempJb, (TimestampTz)ts); + free(tempJb); + if (!temp) return 0.0; + std::string json0S(json0Ptr, json0Size); + Jsonb* jb0 = jsonb_in(json0S.c_str()); + if (!jb0) { free(temp); return 0.0; } + Temporal* inst0 = (Temporal*)tjsonbinst_make(jb0, (TimestampTz)ts0); + free(jb0); + if (!inst0) { free(temp); return 0.0; } + + double r = always_ne_tjsonb_tjsonb(temp, inst0); + free(temp); + free(inst0); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, - json1, ts1, json2, ts2); + json_str.getContent(), json_str.getContentSize(), ts, json0.getContent(), json0.getContentSize(), ts0); + return VarVal(result); } @@ -81,11 +103,11 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterA PRECONDITION(arguments.childFunctions.size() == 4, "AlwaysNeTjsonbTjsonbPhysicalFunction requires 4 children but got {}", arguments.childFunctions.size()); - return AlwaysNeTjsonbTjsonbPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2]), - std::move(arguments.childFunctions[3])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + return AlwaysNeTjsonbTjsonbPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysNeTnpointNpointPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysNeTnpointNpointPhysicalFunction.cpp index fde3d1240e..806949198a 100644 --- a/nes-physical-operators/src/Functions/Meos/AlwaysNeTnpointNpointPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/AlwaysNeTnpointNpointPhysicalFunction.cpp @@ -13,61 +13,85 @@ */ #include + #include #include #include +#include #include #include #include #include +#include #include +#include #include #include -#include -#include extern "C" { #include -#include #include } namespace NES { -AlwaysNeTnpointNpointPhysicalFunction::AlwaysNeTnpointNpointPhysicalFunction(PhysicalFunction rid1, PhysicalFunction pos1, PhysicalFunction ts, PhysicalFunction rid2, PhysicalFunction pos2) +AlwaysNeTnpointNpointPhysicalFunction::AlwaysNeTnpointNpointPhysicalFunction(PhysicalFunction ridFunction, + PhysicalFunction fracFunction, + PhysicalFunction tsFunction, + PhysicalFunction rid0Function, + PhysicalFunction frac0Function) { - paramFns.reserve(5); - paramFns.push_back(std::move(rid1)); - paramFns.push_back(std::move(pos1)); - paramFns.push_back(std::move(ts)); - paramFns.push_back(std::move(rid2)); - paramFns.push_back(std::move(pos2)); + parameterFunctions.reserve(5); + parameterFunctions.push_back(std::move(ridFunction)); + parameterFunctions.push_back(std::move(fracFunction)); + parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(rid0Function)); + parameterFunctions.push_back(std::move(frac0Function)); } VarVal AlwaysNeTnpointNpointPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto rid1 = paramFns[0].execute(record, arena).cast(); - auto pos1 = paramFns[1].execute(record, arena).cast(); - auto ts = paramFns[2].execute(record, arena).cast(); - auto rid2 = paramFns[3].execute(record, arena).cast(); - auto pos2 = paramFns[4].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto rid = parameterValues[0].cast>(); + auto frac = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + auto rid0 = parameterValues[3].cast>(); + auto frac0 = parameterValues[4].cast>(); + const auto result = nautilus::invoke( - +[](uint64_t rid1, double pos1, uint64_t ts, uint64_t rid2, double pos2) -> double { - try { + +[](int64_t rid, + double frac, + uint64_t ts, + uint64_t rid0, + double frac0) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - Npoint* np1 = npoint_make((int64_t)rid1, pos1); - if (!np1) return 0.0; - Temporal* inst = (Temporal*)tnpointinst_make(np1, (TimestampTz)ts); - free(np1); - if (!inst) return 0.0; - Npoint* np2 = npoint_make((int64_t)rid2, pos2); - if (!np2) { free(inst); return 0.0; } - int r = always_ne_tnpoint_npoint(inst, np2); - free(inst); free(np2); - return r > 0 ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + if (frac < 0.0 || frac > 1.0) return 0.0; + std::string tempWkt = fmt::format("NPoint({},{})@{}", rid, frac, MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tnpoint_in(tempWkt.c_str()); + if (!temp) return 0.0; + Npoint* np0 = npoint_make((int64_t)rid0, frac0); + if (!np0) { free(temp); return 0.0; } + + double r = always_ne_tnpoint_npoint(temp, np0); + free(temp); + free(np0); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, - rid1, pos1, ts, rid2, pos2); + rid, frac, ts, rid0, frac0); + return VarVal(result); } @@ -77,12 +101,12 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterA PRECONDITION(arguments.childFunctions.size() == 5, "AlwaysNeTnpointNpointPhysicalFunction requires 5 children but got {}", arguments.childFunctions.size()); - return AlwaysNeTnpointNpointPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2]), - std::move(arguments.childFunctions[3]), - std::move(arguments.childFunctions[4])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + return AlwaysNeTnpointNpointPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysNeTnpointTnpointPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysNeTnpointTnpointPhysicalFunction.cpp index 1ee5511def..c4eaab3ed3 100644 --- a/nes-physical-operators/src/Functions/Meos/AlwaysNeTnpointTnpointPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/AlwaysNeTnpointTnpointPhysicalFunction.cpp @@ -13,17 +13,20 @@ */ #include + #include #include #include +#include #include #include #include #include +#include #include +#include #include #include -#include extern "C" { #include @@ -32,49 +35,69 @@ extern "C" { namespace NES { -AlwaysNeTnpointTnpointPhysicalFunction::AlwaysNeTnpointTnpointPhysicalFunction( - PhysicalFunction rid1, PhysicalFunction pos1, PhysicalFunction ts1, - PhysicalFunction rid2, PhysicalFunction pos2, PhysicalFunction ts2) +AlwaysNeTnpointTnpointPhysicalFunction::AlwaysNeTnpointTnpointPhysicalFunction(PhysicalFunction ridFunction, + PhysicalFunction fracFunction, + PhysicalFunction tsFunction, + PhysicalFunction rid0Function, + PhysicalFunction frac0Function, + PhysicalFunction ts0Function) { - paramFns.reserve(6); - paramFns.push_back(std::move(rid1)); - paramFns.push_back(std::move(pos1)); - paramFns.push_back(std::move(ts1)); - paramFns.push_back(std::move(rid2)); - paramFns.push_back(std::move(pos2)); - paramFns.push_back(std::move(ts2)); + parameterFunctions.reserve(6); + parameterFunctions.push_back(std::move(ridFunction)); + parameterFunctions.push_back(std::move(fracFunction)); + parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(rid0Function)); + parameterFunctions.push_back(std::move(frac0Function)); + parameterFunctions.push_back(std::move(ts0Function)); } VarVal AlwaysNeTnpointTnpointPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto rid1 = paramFns[0].execute(record, arena).cast(); - auto pos1 = paramFns[1].execute(record, arena).cast(); - auto ts1 = paramFns[2].execute(record, arena).cast(); - auto rid2 = paramFns[3].execute(record, arena).cast(); - auto pos2 = paramFns[4].execute(record, arena).cast(); - auto ts2 = paramFns[5].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto rid = parameterValues[0].cast>(); + auto frac = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + auto rid0 = parameterValues[3].cast>(); + auto frac0 = parameterValues[4].cast>(); + auto ts0 = parameterValues[5].cast>(); const auto result = nautilus::invoke( - +[](uint64_t rid1, double pos1, uint64_t ts1, - uint64_t rid2, double pos2, uint64_t ts2) -> double { - try { + +[](int64_t rid, + double frac, + uint64_t ts, + uint64_t rid0, + double frac0, + uint64_t ts0) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - Npoint* np1 = npoint_make((int64_t)rid1, pos1); - if (!np1) return 0.0; - Temporal* inst1 = (Temporal*)tnpointinst_make(np1, (TimestampTz)ts1); - free(np1); - if (!inst1) return 0.0; - Npoint* np2 = npoint_make((int64_t)rid2, pos2); - if (!np2) { free(inst1); return 0.0; } - Temporal* inst2 = (Temporal*)tnpointinst_make(np2, (TimestampTz)ts2); - free(np2); - if (!inst2) { free(inst1); return 0.0; } - int r = always_ne_tnpoint_tnpoint(inst1, inst2); - free(inst1); free(inst2); - return r > 0 ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + if (frac < 0.0 || frac > 1.0) return 0.0; + std::string tempWkt = fmt::format("NPoint({},{})@{}", rid, frac, MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tnpoint_in(tempWkt.c_str()); + if (!temp) return 0.0; + Npoint* np0 = npoint_make((int64_t)rid0, frac0); + if (!np0) { free(temp); return 0.0; } + Temporal* inst0 = (Temporal*)tnpointinst_make(np0, (TimestampTz)ts0); + free(np0); + if (!inst0) { free(temp); return 0.0; } + + double r = always_ne_tnpoint_tnpoint(temp, inst0); + free(temp); + free(inst0); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, - rid1, pos1, ts1, rid2, pos2, ts2); + rid, frac, ts, rid0, frac0, ts0); return VarVal(result); } @@ -85,12 +108,13 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterA PRECONDITION(arguments.childFunctions.size() == 6, "AlwaysNeTnpointTnpointPhysicalFunction requires 6 children but got {}", arguments.childFunctions.size()); - return AlwaysNeTnpointTnpointPhysicalFunction(std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2]), - std::move(arguments.childFunctions[3]), - std::move(arguments.childFunctions[4]), - std::move(arguments.childFunctions[5])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + auto arg5 = std::move(arguments.childFunctions[5]); + return AlwaysNeTnpointTnpointPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysNeTposePosePhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysNeTposePosePhysicalFunction.cpp index 3d0472a51d..fa4693f3e3 100644 --- a/nes-physical-operators/src/Functions/Meos/AlwaysNeTposePosePhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/AlwaysNeTposePosePhysicalFunction.cpp @@ -13,65 +13,92 @@ */ #include + #include #include #include +#include #include #include #include #include +#include #include +#include #include #include -#include -#include extern "C" { #include -#include #include } namespace NES { -AlwaysNeTposePosePhysicalFunction::AlwaysNeTposePosePhysicalFunction(PhysicalFunction x, PhysicalFunction y, PhysicalFunction theta, PhysicalFunction ts, PhysicalFunction x2, PhysicalFunction y2, PhysicalFunction theta2) +AlwaysNeTposePosePhysicalFunction::AlwaysNeTposePosePhysicalFunction(PhysicalFunction xFunction, + PhysicalFunction yFunction, + PhysicalFunction thetaFunction, + PhysicalFunction tsFunction, + PhysicalFunction px0Function, + PhysicalFunction py0Function, + PhysicalFunction ptheta0Function) { - paramFns.reserve(7); - paramFns.push_back(std::move(x)); - paramFns.push_back(std::move(y)); - paramFns.push_back(std::move(theta)); - paramFns.push_back(std::move(ts)); - paramFns.push_back(std::move(x2)); - paramFns.push_back(std::move(y2)); - paramFns.push_back(std::move(theta2)); + parameterFunctions.reserve(7); + parameterFunctions.push_back(std::move(xFunction)); + parameterFunctions.push_back(std::move(yFunction)); + parameterFunctions.push_back(std::move(thetaFunction)); + parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(px0Function)); + parameterFunctions.push_back(std::move(py0Function)); + parameterFunctions.push_back(std::move(ptheta0Function)); } VarVal AlwaysNeTposePosePhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto x = paramFns[0].execute(record, arena).cast(); - auto y = paramFns[1].execute(record, arena).cast(); - auto theta = paramFns[2].execute(record, arena).cast(); - auto ts = paramFns[3].execute(record, arena).cast(); - auto x2 = paramFns[4].execute(record, arena).cast(); - auto y2 = paramFns[5].execute(record, arena).cast(); - auto theta2 = paramFns[6].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto x = parameterValues[0].cast>(); + auto y = parameterValues[1].cast>(); + auto theta = parameterValues[2].cast>(); + auto ts = parameterValues[3].cast>(); + auto px0 = parameterValues[4].cast>(); + auto py0 = parameterValues[5].cast>(); + auto ptheta0 = parameterValues[6].cast>(); + const auto result = nautilus::invoke( - +[](double x, double y, double theta, uint64_t ts, double x2, double y2, double theta2) -> double { - try { + +[](double x, + double y, + double theta, + uint64_t ts, + double px0, + double py0, + double ptheta0) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - Pose* pose1 = pose_make_2d(x, y, theta, false, 0); - if (!pose1) return 0.0; - Temporal* inst = (Temporal*)tposeinst_make(pose1, (TimestampTz)ts); - free(pose1); - if (!inst) return 0.0; - Pose* pose2 = pose_make_2d(x2, y2, theta2, false, 0); - if (!pose2) { free(inst); return 0.0; } - int r = always_ne_tpose_pose(inst, pose2); - free(inst); free(pose2); - return r > 0 ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + std::string tempWkt = fmt::format("Pose(Point({} {}),{})@{}", x, y, theta, MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tpose_in(tempWkt.c_str()); + if (!temp) return 0.0; + Pose* pose0 = pose_make_2d(px0, py0, ptheta0, false, 0); + if (!pose0) { free(temp); return 0.0; } + + double r = always_ne_tpose_pose(temp, pose0); + free(temp); + free(pose0); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, - x, y, theta, ts, x2, y2, theta2); + x, y, theta, ts, px0, py0, ptheta0); + return VarVal(result); } @@ -81,14 +108,14 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterA PRECONDITION(arguments.childFunctions.size() == 7, "AlwaysNeTposePosePhysicalFunction requires 7 children but got {}", arguments.childFunctions.size()); - return AlwaysNeTposePosePhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2]), - std::move(arguments.childFunctions[3]), - std::move(arguments.childFunctions[4]), - std::move(arguments.childFunctions[5]), - std::move(arguments.childFunctions[6])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + auto arg5 = std::move(arguments.childFunctions[5]); + auto arg6 = std::move(arguments.childFunctions[6]); + return AlwaysNeTposePosePhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysNeTposeTposePhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysNeTposeTposePhysicalFunction.cpp index 5f716ed3ed..c695629c8f 100644 --- a/nes-physical-operators/src/Functions/Meos/AlwaysNeTposeTposePhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/AlwaysNeTposeTposePhysicalFunction.cpp @@ -13,17 +13,20 @@ */ #include + #include #include #include +#include #include #include #include #include +#include #include +#include #include #include -#include extern "C" { #include @@ -32,53 +35,76 @@ extern "C" { namespace NES { -AlwaysNeTposeTposePhysicalFunction::AlwaysNeTposeTposePhysicalFunction( - PhysicalFunction x1, PhysicalFunction y1, PhysicalFunction theta1, PhysicalFunction ts1, - PhysicalFunction x2, PhysicalFunction y2, PhysicalFunction theta2, PhysicalFunction ts2) +AlwaysNeTposeTposePhysicalFunction::AlwaysNeTposeTposePhysicalFunction(PhysicalFunction xFunction, + PhysicalFunction yFunction, + PhysicalFunction thetaFunction, + PhysicalFunction tsFunction, + PhysicalFunction px0Function, + PhysicalFunction py0Function, + PhysicalFunction ptheta0Function, + PhysicalFunction ts0Function) { - paramFns.reserve(8); - paramFns.push_back(std::move(x1)); - paramFns.push_back(std::move(y1)); - paramFns.push_back(std::move(theta1)); - paramFns.push_back(std::move(ts1)); - paramFns.push_back(std::move(x2)); - paramFns.push_back(std::move(y2)); - paramFns.push_back(std::move(theta2)); - paramFns.push_back(std::move(ts2)); + parameterFunctions.reserve(8); + parameterFunctions.push_back(std::move(xFunction)); + parameterFunctions.push_back(std::move(yFunction)); + parameterFunctions.push_back(std::move(thetaFunction)); + parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(px0Function)); + parameterFunctions.push_back(std::move(py0Function)); + parameterFunctions.push_back(std::move(ptheta0Function)); + parameterFunctions.push_back(std::move(ts0Function)); } VarVal AlwaysNeTposeTposePhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto x1 = paramFns[0].execute(record, arena).cast(); - auto y1 = paramFns[1].execute(record, arena).cast(); - auto theta1 = paramFns[2].execute(record, arena).cast(); - auto ts1 = paramFns[3].execute(record, arena).cast(); - auto x2 = paramFns[4].execute(record, arena).cast(); - auto y2 = paramFns[5].execute(record, arena).cast(); - auto theta2 = paramFns[6].execute(record, arena).cast(); - auto ts2 = paramFns[7].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto x = parameterValues[0].cast>(); + auto y = parameterValues[1].cast>(); + auto theta = parameterValues[2].cast>(); + auto ts = parameterValues[3].cast>(); + auto px0 = parameterValues[4].cast>(); + auto py0 = parameterValues[5].cast>(); + auto ptheta0 = parameterValues[6].cast>(); + auto ts0 = parameterValues[7].cast>(); const auto result = nautilus::invoke( - +[](double x1, double y1, double theta1, uint64_t ts1, - double x2, double y2, double theta2, uint64_t ts2) -> double { - try { + +[](double x, + double y, + double theta, + uint64_t ts, + double px0, + double py0, + double ptheta0, + uint64_t ts0) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - Pose* p1 = pose_make_2d(x1, y1, theta1, false, 0); - if (!p1) return 0.0; - Temporal* inst1 = (Temporal*)tposeinst_make(p1, (TimestampTz)ts1); - free(p1); - if (!inst1) return 0.0; - Pose* p2 = pose_make_2d(x2, y2, theta2, false, 0); - if (!p2) { free(inst1); return 0.0; } - Temporal* inst2 = (Temporal*)tposeinst_make(p2, (TimestampTz)ts2); - free(p2); - if (!inst2) { free(inst1); return 0.0; } - int r = always_ne_tpose_tpose(inst1, inst2); - free(inst1); free(inst2); - return r > 0 ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + std::string tempWkt = fmt::format("Pose(Point({} {}),{})@{}", x, y, theta, MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tpose_in(tempWkt.c_str()); + if (!temp) return 0.0; + Pose* pose0A = pose_make_2d(px0, py0, ptheta0, false, 0); + if (!pose0A) { free(temp); return 0.0; } + Temporal* inst0 = (Temporal*)tposeinst_make(pose0A, (TimestampTz)ts0); + free(pose0A); + if (!inst0) { free(temp); return 0.0; } + + double r = always_ne_tpose_tpose(temp, inst0); + free(temp); + free(inst0); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, - x1, y1, theta1, ts1, x2, y2, theta2, ts2); + x, y, theta, ts, px0, py0, ptheta0, ts0); return VarVal(result); } @@ -89,14 +115,15 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterA PRECONDITION(arguments.childFunctions.size() == 8, "AlwaysNeTposeTposePhysicalFunction requires 8 children but got {}", arguments.childFunctions.size()); - return AlwaysNeTposeTposePhysicalFunction(std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2]), - std::move(arguments.childFunctions[3]), - std::move(arguments.childFunctions[4]), - std::move(arguments.childFunctions[5]), - std::move(arguments.childFunctions[6]), - std::move(arguments.childFunctions[7])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + auto arg5 = std::move(arguments.childFunctions[5]); + auto arg6 = std::move(arguments.childFunctions[6]); + auto arg7 = std::move(arguments.childFunctions[7]); + return AlwaysNeTposeTposePhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6), std::move(arg7)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysNeTquadbinQuadbinPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysNeTquadbinQuadbinPhysicalFunction.cpp index 97666e2782..38b5da0b53 100644 --- a/nes-physical-operators/src/Functions/Meos/AlwaysNeTquadbinQuadbinPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/AlwaysNeTquadbinQuadbinPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -21,7 +22,9 @@ #include #include #include +#include #include +#include #include #include @@ -32,40 +35,63 @@ extern "C" { namespace NES { -AlwaysNeTquadbinQuadbinPhysicalFunction::AlwaysNeTquadbinQuadbinPhysicalFunction(PhysicalFunction inst_cell, PhysicalFunction ts, PhysicalFunction cell) { - paramFns.reserve(3); - paramFns.push_back(std::move(inst_cell)); - paramFns.push_back(std::move(ts)); - paramFns.push_back(std::move(cell)); +AlwaysNeTquadbinQuadbinPhysicalFunction::AlwaysNeTquadbinQuadbinPhysicalFunction(PhysicalFunction cellFunction, + PhysicalFunction tsFunction, + PhysicalFunction arg0Function) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(cellFunction)); + parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } -VarVal AlwaysNeTquadbinQuadbinPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto inst_cell = paramFns[0].execute(record, arena).cast(); - auto ts = paramFns[1].execute(record, arena).cast(); - auto cell = paramFns[2].execute(record, arena).cast(); +VarVal AlwaysNeTquadbinQuadbinPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto cell = parameterValues[0].cast>(); + auto ts = parameterValues[1].cast>(); + auto arg0 = parameterValues[2].cast>(); + const auto result = nautilus::invoke( - +[](uint64_t ic, uint64_t ts, uint64_t cell) -> double { - MEOS::Meos::ensureMeosInitialized(); - TInstant* inst = tquadbininst_make((Quadbin)ic, (TimestampTz)ts); - if (!inst) return 0.0; - int r = always_ne_tquadbin_quadbin((const Temporal*)inst, (Quadbin)cell); - free(inst); - return r > 0 ? 1.0 : 0.0; + +[](uint64_t cell, + uint64_t ts, + uint64_t arg0) -> double { + try + { + MEOS::Meos::ensureMeosInitialized(); + Temporal* temp = (Temporal*)tquadbininst_make((Quadbin)cell, (TimestampTz)ts); + if (!temp) return 0.0; + + double r = always_ne_tquadbin_quadbin(temp, (Quadbin)arg0); + free(temp); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, - inst_cell, ts, cell); + cell, ts, arg0); + return VarVal(result); } PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAlwaysNeTquadbinQuadbinPhysicalFunction( PhysicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.childFunctions.size()==3, + PRECONDITION(arguments.childFunctions.size() == 3, "AlwaysNeTquadbinQuadbinPhysicalFunction requires 3 children but got {}", arguments.childFunctions.size()); - return AlwaysNeTquadbinQuadbinPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return AlwaysNeTquadbinQuadbinPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AlwaysNeTtextTextPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AlwaysNeTtextTextPhysicalFunction.cpp index d962d3476a..8f6964a1de 100644 --- a/nes-physical-operators/src/Functions/Meos/AlwaysNeTtextTextPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/AlwaysNeTtextTextPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -33,44 +34,59 @@ extern "C" { namespace NES { -AlwaysNeTtextTextPhysicalFunction::AlwaysNeTtextTextPhysicalFunction( - PhysicalFunction valueFunction, PhysicalFunction refFunction, PhysicalFunction tsFunction) +AlwaysNeTtextTextPhysicalFunction::AlwaysNeTtextTextPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction, + PhysicalFunction arg0Function) { - paramFns.reserve(3); - paramFns.push_back(std::move(valueFunction)); - paramFns.push_back(std::move(refFunction)); - paramFns.push_back(std::move(tsFunction)); + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } VarVal AlwaysNeTtextTextPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto value = paramFns[0].execute(record, arena).cast(); - auto ref = paramFns[1].execute(record, arena).cast(); - auto ts = paramFns[2].execute(record, arena).cast>(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto value = parameterValues[0].cast(); + auto ts = parameterValues[1].cast>(); + auto arg0 = parameterValues[2].cast(); const auto result = nautilus::invoke( - +[](const char* v, uint32_t vsz, const char* r, uint32_t rsz, uint64_t t) -> double { - try { + +[](const char* valuePtr, uint32_t valueSize, + uint64_t ts, + const char* arg0Ptr, uint32_t arg0Size) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string val_str(v, vsz); - std::string ref_str(r, rsz); - while (!val_str.empty() && (val_str.front() == '\'' || val_str.front() == '"')) val_str = val_str.substr(1); - while (!val_str.empty() && (val_str.back() == '\'' || val_str.back() == '"')) val_str = val_str.substr(0, val_str.size()-1); - while (!ref_str.empty() && (ref_str.front() == '\'' || ref_str.front() == '"')) ref_str = ref_str.substr(1); - while (!ref_str.empty() && (ref_str.back() == '\'' || ref_str.back() == '"')) ref_str = ref_str.substr(0, ref_str.size()-1); - std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); - std::string wkt = "'" + val_str + "'@" + ts_str; - Temporal* temp = ttext_in(wkt.c_str()); + std::string tempVal(valuePtr, valueSize); + while (!tempVal.empty() && (tempVal.front() == '\'' || tempVal.front() == '"')) tempVal.erase(tempVal.begin()); + while (!tempVal.empty() && (tempVal.back() == '\'' || tempVal.back() == '"')) tempVal.pop_back(); + std::string tempWkt = "'" + tempVal + "'@" + MEOS::Meos::convertEpochToTimestamp(ts); + Temporal* temp = ttext_in(tempWkt.c_str()); if (!temp) return 0.0; - text* txt = cstring_to_text(ref_str.c_str()); - if (!txt) { free(temp); return 0.0; } - int result = always_ne_ttext_text(temp, txt); + std::string arg0S(arg0Ptr, arg0Size); + while (!arg0S.empty() && (arg0S.front() == '\'' || arg0S.front() == '"')) arg0S.erase(arg0S.begin()); + while (!arg0S.empty() && (arg0S.back() == '\'' || arg0S.back() == '"')) arg0S.pop_back(); + text* txt0 = cstring_to_text(arg0S.c_str()); + if (!txt0) { free(temp); return 0.0; } + + double r = always_ne_ttext_text(temp, txt0); free(temp); - free(txt); - return static_cast(result); - } catch (const std::exception&) { return 0.0; } + free(txt0); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, - value, ref, ts); + value.getContent(), value.getContentSize(), ts, arg0.getContent(), arg0.getContentSize()); return VarVal(result); } @@ -81,10 +97,10 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterA PRECONDITION(arguments.childFunctions.size() == 3, "AlwaysNeTtextTextPhysicalFunction requires 3 children but got {}", arguments.childFunctions.size()); - return AlwaysNeTtextTextPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return AlwaysNeTtextTextPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AtouchesTcbufferGeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AtouchesTcbufferGeoPhysicalFunction.cpp index cc651d7b83..bdd1f29212 100644 --- a/nes-physical-operators/src/Functions/Meos/AtouchesTcbufferGeoPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/AtouchesTcbufferGeoPhysicalFunction.cpp @@ -13,77 +13,97 @@ */ #include + #include #include #include +#include #include #include #include #include +#include #include +#include #include #include -#include -#include -#include extern "C" { #include -#include #include } namespace NES { -AtouchesTcbufferGeoPhysicalFunction::AtouchesTcbufferGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, - PhysicalFunction radius, PhysicalFunction ts, - PhysicalFunction wkt) +AtouchesTcbufferGeoPhysicalFunction::AtouchesTcbufferGeoPhysicalFunction(PhysicalFunction lonFunction, + PhysicalFunction latFunction, + PhysicalFunction radiusFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction) { - paramFns.reserve(5); - paramFns.push_back(std::move(lon)); - paramFns.push_back(std::move(lat)); - paramFns.push_back(std::move(radius)); - paramFns.push_back(std::move(ts)); - paramFns.push_back(std::move(wkt)); + parameterFunctions.reserve(5); + parameterFunctions.push_back(std::move(lonFunction)); + parameterFunctions.push_back(std::move(latFunction)); + parameterFunctions.push_back(std::move(radiusFunction)); + parameterFunctions.push_back(std::move(timestampFunction)); + parameterFunctions.push_back(std::move(geometryFunction)); } VarVal AtouchesTcbufferGeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto lon = paramFns[0].execute(record, arena).cast(); - auto lat = paramFns[1].execute(record, arena).cast(); - auto radius = paramFns[2].execute(record, arena).cast(); - auto ts = paramFns[3].execute(record, arena).cast(); - auto wkt = paramFns[4].execute(record, arena); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto lon = parameterValues[0].cast>(); + auto lat = parameterValues[1].cast>(); + auto radius = parameterValues[2].cast>(); + auto timestamp = parameterValues[3].cast>(); + auto geometry = parameterValues[4].cast(); const auto result = nautilus::invoke( - +[](double lon, double lat, double radius, uint64_t ts, - const char* wkt, uint32_t wkt_len) -> double { - try { + +[](double lonValue, + double latValue, + double radiusValue, + uint64_t timestampValue, + const char* geometryPtr, + uint32_t geometrySize) -> int { + try + { MEOS::Meos::ensureMeosInitialized(); - // Build tcbuffer instant: point + radius → cbuffer → instant - std::string pt_str = fmt::format("POINT({} {})", lon, lat); - GSERIALIZED* pt_gs = geom_in(pt_str.c_str(), -1); - if (!pt_gs) return 0.0; - Cbuffer* cb = cbuffer_make(pt_gs, radius); - free(pt_gs); - if (!cb) return 0.0; - Temporal* tcb_inst = (Temporal*)tcbufferinst_make(cb, (TimestampTz)ts); - free(cb); - if (!tcb_inst) return 0.0; - // Build target geometry from null-terminated WKT copy - char* wkt_str = (char*)malloc(wkt_len + 1); - memcpy(wkt_str, wkt, wkt_len); - wkt_str[wkt_len] = '\0'; - GSERIALIZED* target_gs = geom_in(wkt_str, -1); - free(wkt_str); - if (!target_gs) { free(tcb_inst); return 0.0; } - int r = atouches_tcbuffer_geo(tcb_inst, target_gs); - free(tcb_inst); - free(target_gs); - return r > 0 ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + if (!(lonValue >= -180.0 && lonValue <= 180.0 && latValue >= -90.0 && latValue <= 90.0)) return 0; + if (radiusValue < 0.0) return 0; + + const std::string timestampString = MEOS::Meos::convertEpochToTimestamp(timestampValue); + std::string tcbufferWkt = fmt::format("Cbuffer(Point({} {}),{})@{}", + lonValue, latValue, radiusValue, timestampString); + std::string staticGeometryWkt(geometryPtr, geometrySize); + + while (!staticGeometryWkt.empty() && (staticGeometryWkt.front() == '\'' || staticGeometryWkt.front() == '"')) + staticGeometryWkt.erase(staticGeometryWkt.begin()); + while (!staticGeometryWkt.empty() && (staticGeometryWkt.back() == '\'' || staticGeometryWkt.back() == '"')) + staticGeometryWkt.pop_back(); + + if (tcbufferWkt.empty() || staticGeometryWkt.empty()) return 0; + + Temporal* tcbuffer = tcbuffer_in(tcbufferWkt.c_str()); + if (!tcbuffer) return 0; + MEOS::Meos::StaticGeometry staticGeometry(staticGeometryWkt); + if (!staticGeometry.getGeometry()) { free(tcbuffer); return 0; } + + int r = atouches_tcbuffer_geo(tcbuffer, staticGeometry.getGeometry()); + free(tcbuffer); + return r; + } + catch (const std::exception&) + { + return 0; + } }, - lon, lat, radius, ts, wkt); + lon, lat, radius, timestamp, geometry.getContent(), geometry.getContentSize()); return VarVal(result); } @@ -94,11 +114,12 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterA PRECONDITION(arguments.childFunctions.size() == 5, "AtouchesTcbufferGeoPhysicalFunction requires 5 children but got {}", arguments.childFunctions.size()); - return AtouchesTcbufferGeoPhysicalFunction(std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2]), - std::move(arguments.childFunctions[3]), - std::move(arguments.childFunctions[4])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + return AtouchesTcbufferGeoPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AtouchesTcbufferTcbufferPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AtouchesTcbufferTcbufferPhysicalFunction.cpp index 9c77f7d23a..3d0175fde0 100644 --- a/nes-physical-operators/src/Functions/Meos/AtouchesTcbufferTcbufferPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/AtouchesTcbufferTcbufferPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -20,75 +21,88 @@ #include #include #include +#include #include +#include #include #include -#include -#include extern "C" { #include -#include #include } namespace NES { -AtouchesTcbufferTcbufferPhysicalFunction::AtouchesTcbufferTcbufferPhysicalFunction( - PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction r1, PhysicalFunction ts1, - PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction r2, PhysicalFunction ts2) +AtouchesTcbufferTcbufferPhysicalFunction::AtouchesTcbufferTcbufferPhysicalFunction(PhysicalFunction lonAFunction, + PhysicalFunction latAFunction, + PhysicalFunction radiusAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction lonBFunction, + PhysicalFunction latBFunction, + PhysicalFunction radiusBFunction, + PhysicalFunction tsBFunction) { - paramFns.reserve(8); - paramFns.push_back(std::move(lon1)); - paramFns.push_back(std::move(lat1)); - paramFns.push_back(std::move(r1)); - paramFns.push_back(std::move(ts1)); - paramFns.push_back(std::move(lon2)); - paramFns.push_back(std::move(lat2)); - paramFns.push_back(std::move(r2)); - paramFns.push_back(std::move(ts2)); + parameterFunctions.reserve(8); + parameterFunctions.push_back(std::move(lonAFunction)); + parameterFunctions.push_back(std::move(latAFunction)); + parameterFunctions.push_back(std::move(radiusAFunction)); + parameterFunctions.push_back(std::move(tsAFunction)); + parameterFunctions.push_back(std::move(lonBFunction)); + parameterFunctions.push_back(std::move(latBFunction)); + parameterFunctions.push_back(std::move(radiusBFunction)); + parameterFunctions.push_back(std::move(tsBFunction)); } VarVal AtouchesTcbufferTcbufferPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto lon1 = paramFns[0].execute(record, arena).cast(); - auto lat1 = paramFns[1].execute(record, arena).cast(); - auto r1 = paramFns[2].execute(record, arena).cast(); - auto ts1 = paramFns[3].execute(record, arena).cast(); - auto lon2 = paramFns[4].execute(record, arena).cast(); - auto lat2 = paramFns[5].execute(record, arena).cast(); - auto r2 = paramFns[6].execute(record, arena).cast(); - auto ts2 = paramFns[7].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto lonA = parameterValues[0].cast>(); + auto latA = parameterValues[1].cast>(); + auto radiusA = parameterValues[2].cast>(); + auto tsA = parameterValues[3].cast>(); + auto lonB = parameterValues[4].cast>(); + auto latB = parameterValues[5].cast>(); + auto radiusB = parameterValues[6].cast>(); + auto tsB = parameterValues[7].cast>(); const auto result = nautilus::invoke( - +[](double lon1, double lat1, double r1, uint64_t ts1, - double lon2, double lat2, double r2, uint64_t ts2) -> double { - try { + +[](double lonAValue, double latAValue, double radiusAValue, uint64_t tsAValue, + double lonBValue, double latBValue, double radiusBValue, uint64_t tsBValue) -> int { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string pt1 = fmt::format("POINT({} {})", lon1, lat1); - GSERIALIZED* gs1 = geom_in(pt1.c_str(), -1); - if (!gs1) return 0.0; - Cbuffer* cb1 = cbuffer_make(gs1, r1); - free(gs1); - if (!cb1) return 0.0; - Temporal* tcb1 = (Temporal*)tcbufferinst_make(cb1, (TimestampTz)ts1); - free(cb1); - if (!tcb1) return 0.0; - std::string pt2 = fmt::format("POINT({} {})", lon2, lat2); - GSERIALIZED* gs2 = geom_in(pt2.c_str(), -1); - if (!gs2) { free(tcb1); return 0.0; } - Cbuffer* cb2 = cbuffer_make(gs2, r2); - free(gs2); - if (!cb2) { free(tcb1); return 0.0; } - Temporal* tcb2 = (Temporal*)tcbufferinst_make(cb2, (TimestampTz)ts2); - free(cb2); - if (!tcb2) { free(tcb1); return 0.0; } - int r = atouches_tcbuffer_tcbuffer(tcb1, tcb2); - free(tcb1); free(tcb2); - return r > 0 ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + if (!(lonAValue >= -180.0 && lonAValue <= 180.0 && latAValue >= -90.0 && latAValue <= 90.0)) return 0; + if (!(lonBValue >= -180.0 && lonBValue <= 180.0 && latBValue >= -90.0 && latBValue <= 90.0)) return 0; + if (radiusAValue < 0.0 || radiusBValue < 0.0) return 0; + + const std::string tsAString = MEOS::Meos::convertEpochToTimestamp(tsAValue); + const std::string tsBString = MEOS::Meos::convertEpochToTimestamp(tsBValue); + std::string wktA = fmt::format("Cbuffer(Point({} {}),{})@{}", lonAValue, latAValue, radiusAValue, tsAString); + std::string wktB = fmt::format("Cbuffer(Point({} {}),{})@{}", lonBValue, latBValue, radiusBValue, tsBString); + + Temporal* tA = tcbuffer_in(wktA.c_str()); + if (!tA) return 0; + Temporal* tB = tcbuffer_in(wktB.c_str()); + if (!tB) { free(tA); return 0; } + + int r = atouches_tcbuffer_tcbuffer(tA, tB); + free(tA); + free(tB); + return r; + } + catch (const std::exception&) + { + return 0; + } }, - lon1, lat1, r1, ts1, lon2, lat2, r2, ts2); + lonA, latA, radiusA, tsA, lonB, latB, radiusB, tsB); return VarVal(result); } @@ -99,14 +113,15 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterA PRECONDITION(arguments.childFunctions.size() == 8, "AtouchesTcbufferTcbufferPhysicalFunction requires 8 children but got {}", arguments.childFunctions.size()); - return AtouchesTcbufferTcbufferPhysicalFunction(std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2]), - std::move(arguments.childFunctions[3]), - std::move(arguments.childFunctions[4]), - std::move(arguments.childFunctions[5]), - std::move(arguments.childFunctions[6]), - std::move(arguments.childFunctions[7])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + auto arg5 = std::move(arguments.childFunctions[5]); + auto arg6 = std::move(arguments.childFunctions[6]); + auto arg7 = std::move(arguments.childFunctions[7]); + return AtouchesTcbufferTcbufferPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6), std::move(arg7)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AtouchesTgeoGeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AtouchesTgeoGeoPhysicalFunction.cpp index a7c1d6dac1..2a4946976b 100644 --- a/nes-physical-operators/src/Functions/Meos/AtouchesTgeoGeoPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/AtouchesTgeoGeoPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -34,40 +35,75 @@ extern "C" { namespace NES { -AtouchesTgeoGeoPhysicalFunction::AtouchesTgeoGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, - PhysicalFunction ts, PhysicalFunction wkt) +AtouchesTgeoGeoPhysicalFunction::AtouchesTgeoGeoPhysicalFunction(PhysicalFunction lonFunction, + PhysicalFunction latFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction) { - paramFns.reserve(4); - paramFns.push_back(std::move(lon)); - paramFns.push_back(std::move(lat)); - paramFns.push_back(std::move(ts)); - paramFns.push_back(std::move(wkt)); + parameterFunctions.reserve(4); + parameterFunctions.push_back(std::move(lonFunction)); + parameterFunctions.push_back(std::move(latFunction)); + parameterFunctions.push_back(std::move(timestampFunction)); + parameterFunctions.push_back(std::move(geometryFunction)); } VarVal AtouchesTgeoGeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto lon = paramFns[0].execute(record, arena).cast(); - auto lat = paramFns[1].execute(record, arena).cast(); - auto ts = paramFns[2].execute(record, arena).cast(); - auto wkt = paramFns[3].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto lon = parameterValues[0].cast>(); + auto lat = parameterValues[1].cast>(); + auto timestamp = parameterValues[2].cast>(); + auto geometry = parameterValues[3].cast(); const auto result = nautilus::invoke( - +[](double lon, double lat, uint64_t ts, - const char* w, uint32_t wsz) -> double { - try { + +[](double lonValue, + double latValue, + uint64_t timestampValue, + const char* geometryPtr, + uint32_t geometrySize) -> int { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string wktStr(w, wsz); - std::string tgeoWkt = fmt::format("SRID=4326;POINT({},{})@{}", lon, lat, ts); - Temporal* tgeo = tgeompoint_in(tgeoWkt.c_str()); - if (!tgeo) return 0.0; - GSERIALIZED* gs = geom_in(wktStr.c_str(), -1); - if (!gs) { free(tgeo); return 0.0; } - int r = atouches_tgeo_geo(tgeo, gs); - free(tgeo); free(gs); - return r > 0 ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + if (!(lonValue >= -180.0 && lonValue <= 180.0 && latValue >= -90.0 && latValue <= 90.0)) { + return 0; + } + + const std::string timestampString = MEOS::Meos::convertEpochToTimestamp(timestampValue); + std::string temporalGeometryWkt = fmt::format("SRID=4326;Point({} {})@{}", lonValue, latValue, timestampString); + std::string staticGeometryWkt(geometryPtr, geometrySize); + + while (!staticGeometryWkt.empty() && (staticGeometryWkt.front() == '\'' || staticGeometryWkt.front() == '"')) + staticGeometryWkt.erase(staticGeometryWkt.begin()); + while (!staticGeometryWkt.empty() && (staticGeometryWkt.back() == '\'' || staticGeometryWkt.back() == '"')) + staticGeometryWkt.pop_back(); + + if (temporalGeometryWkt.empty() || staticGeometryWkt.empty()) + return 0; + + MEOS::Meos::TemporalGeometry temporalGeometry(temporalGeometryWkt); + if (!temporalGeometry.getGeometry()) return 0; + MEOS::Meos::StaticGeometry staticGeometry(staticGeometryWkt); + if (!staticGeometry.getGeometry()) return 0; + + // MEOS spatial-relation call — same shape as TemporalEDWithin's + // edwithin_tgeo_geo, but specific MEOS function per generated operator. + // Real MEOS spatial-rel signature: int fn(const Temporal *, const GSERIALIZED *) + // (no `atstart` flag — that's specific to geog_dwithin / edwithin's 3-arg variant). + return atouches_tgeo_geo(temporalGeometry.getGeometry(), + staticGeometry.getGeometry()); + } + catch (const std::exception&) + { + return 0; + } }, - lon, lat, ts, wkt); + lon, lat, timestamp, geometry.getContent(), geometry.getContentSize()); return VarVal(result); } @@ -78,10 +114,11 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterA PRECONDITION(arguments.childFunctions.size() == 4, "AtouchesTgeoGeoPhysicalFunction requires 4 children but got {}", arguments.childFunctions.size()); - return AtouchesTgeoGeoPhysicalFunction(std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2]), - std::move(arguments.childFunctions[3])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + return AtouchesTgeoGeoPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AtouchesTgeoTgeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AtouchesTgeoTgeoPhysicalFunction.cpp index 30434656d5..b759c9e014 100644 --- a/nes-physical-operators/src/Functions/Meos/AtouchesTgeoTgeoPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/AtouchesTgeoTgeoPhysicalFunction.cpp @@ -13,10 +13,10 @@ */ #include + #include #include #include -#include #include #include #include @@ -34,42 +34,68 @@ extern "C" { namespace NES { -AtouchesTgeoTgeoPhysicalFunction::AtouchesTgeoTgeoPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction ts1, PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction ts2) +AtouchesTgeoTgeoPhysicalFunction::AtouchesTgeoTgeoPhysicalFunction(PhysicalFunction lonAFunction, + PhysicalFunction latAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction lonBFunction, + PhysicalFunction latBFunction, + PhysicalFunction tsBFunction) { - paramFns.reserve(6); - paramFns.push_back(std::move(lon1)); - paramFns.push_back(std::move(lat1)); - paramFns.push_back(std::move(ts1)); - paramFns.push_back(std::move(lon2)); - paramFns.push_back(std::move(lat2)); - paramFns.push_back(std::move(ts2)); + parameterFunctions.reserve(6); + parameterFunctions.push_back(std::move(lonAFunction)); + parameterFunctions.push_back(std::move(latAFunction)); + parameterFunctions.push_back(std::move(tsAFunction)); + parameterFunctions.push_back(std::move(lonBFunction)); + parameterFunctions.push_back(std::move(latBFunction)); + parameterFunctions.push_back(std::move(tsBFunction)); } VarVal AtouchesTgeoTgeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto lon1 = paramFns[0].execute(record, arena).cast(); - auto lat1 = paramFns[1].execute(record, arena).cast(); - auto ts1 = paramFns[2].execute(record, arena).cast(); - auto lon2 = paramFns[3].execute(record, arena).cast(); - auto lat2 = paramFns[4].execute(record, arena).cast(); - auto ts2 = paramFns[5].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto lonA = parameterValues[0].cast>(); + auto latA = parameterValues[1].cast>(); + auto tsA = parameterValues[2].cast>(); + auto lonB = parameterValues[3].cast>(); + auto latB = parameterValues[4].cast>(); + auto tsB = parameterValues[5].cast>(); + const auto result = nautilus::invoke( - +[](double lon1, double lat1, uint64_t ts1, - double lon2, double lat2, uint64_t ts2) -> double { - try { + +[](double lonAValue, double latAValue, uint64_t tsAValue, + double lonBValue, double latBValue, uint64_t tsBValue) -> int { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string wkt1 = fmt::format("SRID=4326;POINT({},{})@{}", lon1, lat1, ts1); - Temporal* t1 = tgeompoint_in(wkt1.c_str()); - if (!t1) return 0.0; - std::string wkt2 = fmt::format("SRID=4326;POINT({},{})@{}", lon2, lat2, ts2); - Temporal* t2 = tgeompoint_in(wkt2.c_str()); - if (!t2) { free(t1); return 0.0; } - int r = atouches_tgeo_tgeo(t1, t2); - free(t1); free(t2); - return r > 0 ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + if (!(lonAValue >= -180.0 && lonAValue <= 180.0 && latAValue >= -90.0 && latAValue <= 90.0)) return 0; + if (!(lonBValue >= -180.0 && lonBValue <= 180.0 && latBValue >= -90.0 && latBValue <= 90.0)) return 0; + + const std::string tsAString = MEOS::Meos::convertEpochToTimestamp(tsAValue); + const std::string tsBString = MEOS::Meos::convertEpochToTimestamp(tsBValue); + std::string temporalGeometryAWkt = fmt::format("SRID=4326;Point({} {})@{}", lonAValue, latAValue, tsAString); + std::string temporalGeometryBWkt = fmt::format("SRID=4326;Point({} {})@{}", lonBValue, latBValue, tsBString); + + MEOS::Meos::TemporalGeometry temporalGeometryA(temporalGeometryAWkt); + if (!temporalGeometryA.getGeometry()) return 0; + MEOS::Meos::TemporalGeometry temporalGeometryB(temporalGeometryBWkt); + if (!temporalGeometryB.getGeometry()) return 0; + + // MEOS *_tgeo_tgeo spatial-relation: int fn(const Temporal*, const Temporal*). + return atouches_tgeo_tgeo(temporalGeometryA.getGeometry(), + temporalGeometryB.getGeometry()); + } + catch (const std::exception&) + { + return 0; + } }, - lon1, lat1, ts1, lon2, lat2, ts2); + lonA, latA, tsA, lonB, latB, tsB); + return VarVal(result); } @@ -79,13 +105,13 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterA PRECONDITION(arguments.childFunctions.size() == 6, "AtouchesTgeoTgeoPhysicalFunction requires 6 children but got {}", arguments.childFunctions.size()); - return AtouchesTgeoTgeoPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2]), - std::move(arguments.childFunctions[3]), - std::move(arguments.childFunctions[4]), - std::move(arguments.childFunctions[5])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + auto arg5 = std::move(arguments.childFunctions[5]); + return AtouchesTgeoTgeoPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/AtouchesTrgeometryGeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/AtouchesTrgeometryGeoPhysicalFunction.cpp new file mode 100644 index 0000000000..9ece028436 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/AtouchesTrgeometryGeoPhysicalFunction.cpp @@ -0,0 +1,97 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +#include +} + +namespace NES { + +AtouchesTrgeometryGeoPhysicalFunction::AtouchesTrgeometryGeoPhysicalFunction(PhysicalFunction ref_wkt, PhysicalFunction x1, PhysicalFunction y1, PhysicalFunction theta1, PhysicalFunction ts1, PhysicalFunction tgt_wkt) { + paramFns.reserve(6); + paramFns.push_back(std::move(ref_wkt)); + paramFns.push_back(std::move(x1)); + paramFns.push_back(std::move(y1)); + paramFns.push_back(std::move(theta1)); + paramFns.push_back(std::move(ts1)); + paramFns.push_back(std::move(tgt_wkt)); +} + +VarVal AtouchesTrgeometryGeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { + auto ref_wkt = paramFns[0].execute(record, arena).cast(); + auto x1 = paramFns[1].execute(record, arena).cast(); + auto y1 = paramFns[2].execute(record, arena).cast(); + auto theta1 = paramFns[3].execute(record, arena).cast(); + auto ts1 = paramFns[4].execute(record, arena).cast(); + auto tgt_wkt = paramFns[5].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](const char* ref_wkt, uint32_t ref_wktsz, double x1, double y1, double theta1, uint64_t ts1, const char* tgt_wkt, uint32_t tgt_wktsz) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + char* ref1_str = (char*)malloc(ref_wktsz + 1); + memcpy(ref1_str, ref_wkt, ref_wktsz); ref1_str[ref_wktsz] = '\0'; + GSERIALIZED* gref1 = geom_in(ref1_str, -1); free(ref1_str); + if (!gref1) return 0.0; + Pose* pose1 = pose_make_2d(x1, y1, theta1, false, 0); + if (!pose1) { free(gref1); return 0.0; } + TInstant* inst1 = trgeometryinst_make(gref1, pose1, (TimestampTz)ts1); + free(gref1); free(pose1); + if (!inst1) return 0.0; + char* tgt_str = (char*)malloc(tgt_wktsz + 1); + memcpy(tgt_str, tgt_wkt, tgt_wktsz); tgt_str[tgt_wktsz] = '\0'; + GSERIALIZED* gs_tgt = geom_in(tgt_str, -1); free(tgt_str); + if (!gs_tgt) { free(inst1); return 0.0; } + int r = atouches_trgeometry_geo((Temporal*)inst1, gs_tgt); + free(inst1); free(gs_tgt); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + ref_wkt, x1, y1, theta1, ts1, tgt_wkt); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterAtouchesTrgeometryGeoPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size()==6, + "AtouchesTrgeometryGeoPhysicalFunction requires 6 children but got {}", + arguments.childFunctions.size()); + return AtouchesTrgeometryGeoPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4]), + std::move(arguments.childFunctions[5])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt index 117075e83e..a99b012bb0 100644 --- a/nes-physical-operators/src/Functions/Meos/CMakeLists.txt +++ b/nes-physical-operators/src/Functions/Meos/CMakeLists.txt @@ -573,4 +573,100 @@ add_plugin(GeomIntersects3d PhysicalFunction nes-physical-operators GeomIntersec add_plugin(GeomDwithin3d PhysicalFunction nes-physical-operators GeomDwithin3dPhysicalFunction.cpp) add_plugin(GeomDistance2d PhysicalFunction nes-physical-operators GeomDistance2dPhysicalFunction.cpp) add_plugin(GeomDistance3d PhysicalFunction nes-physical-operators GeomDistance3dPhysicalFunction.cpp) +add_plugin(EcoversTgeoGeo PhysicalFunction nes-physical-operators EcoversTgeoGeoPhysicalFunction.cpp) +add_plugin(EdisjointTgeoGeo PhysicalFunction nes-physical-operators EdisjointTgeoGeoPhysicalFunction.cpp) +add_plugin(EdwithinTgeoGeo PhysicalFunction nes-physical-operators EdwithinTgeoGeoPhysicalFunction.cpp) +add_plugin(NadTgeoTgeo PhysicalFunction nes-physical-operators NadTgeoTgeoPhysicalFunction.cpp) +add_plugin(EcontainsTcbufferTcbuffer PhysicalFunction nes-physical-operators EcontainsTcbufferTcbufferPhysicalFunction.cpp) +add_plugin(AcontainsTcbufferTcbuffer PhysicalFunction nes-physical-operators AcontainsTcbufferTcbufferPhysicalFunction.cpp) +add_plugin(EdisjointTcbufferTcbuffer PhysicalFunction nes-physical-operators EdisjointTcbufferTcbufferPhysicalFunction.cpp) +add_plugin(EdwithinTcbufferCbuffer PhysicalFunction nes-physical-operators EdwithinTcbufferCbufferPhysicalFunction.cpp) +add_plugin(AdwithinTcbufferCbuffer PhysicalFunction nes-physical-operators AdwithinTcbufferCbufferPhysicalFunction.cpp) +add_plugin(EcoversTgeoGeo PhysicalFunction nes-physical-operators EcoversTgeoGeoPhysicalFunction.cpp) +add_plugin(EdisjointTgeoGeo PhysicalFunction nes-physical-operators EdisjointTgeoGeoPhysicalFunction.cpp) +add_plugin(EdwithinTgeoGeo PhysicalFunction nes-physical-operators EdwithinTgeoGeoPhysicalFunction.cpp) +add_plugin(NadTgeoTgeo PhysicalFunction nes-physical-operators NadTgeoTgeoPhysicalFunction.cpp) +add_plugin(AcontainsTcbufferTcbuffer PhysicalFunction nes-physical-operators AcontainsTcbufferTcbufferPhysicalFunction.cpp) +add_plugin(EcontainsTcbufferTcbuffer PhysicalFunction nes-physical-operators EcontainsTcbufferTcbufferPhysicalFunction.cpp) +add_plugin(EdisjointTcbufferTcbuffer PhysicalFunction nes-physical-operators EdisjointTcbufferTcbufferPhysicalFunction.cpp) +add_plugin(TEqTtextText PhysicalFunction nes-physical-operators TEqTtextTextPhysicalFunction.cpp) +add_plugin(TEqTextTtext PhysicalFunction nes-physical-operators TEqTextTtextPhysicalFunction.cpp) +add_plugin(TNeTtextText PhysicalFunction nes-physical-operators TNeTtextTextPhysicalFunction.cpp) +add_plugin(TNeTextTtext PhysicalFunction nes-physical-operators TNeTextTtextPhysicalFunction.cpp) +add_plugin(TGeTtextText PhysicalFunction nes-physical-operators TGeTtextTextPhysicalFunction.cpp) +add_plugin(TGeTextTtext PhysicalFunction nes-physical-operators TGeTextTtextPhysicalFunction.cpp) +add_plugin(TGtTtextText PhysicalFunction nes-physical-operators TGtTtextTextPhysicalFunction.cpp) +add_plugin(TGtTextTtext PhysicalFunction nes-physical-operators TGtTextTtextPhysicalFunction.cpp) +add_plugin(TLeTtextText PhysicalFunction nes-physical-operators TLeTtextTextPhysicalFunction.cpp) +add_plugin(TLeTextTtext PhysicalFunction nes-physical-operators TLeTextTtextPhysicalFunction.cpp) +add_plugin(TLtTtextText PhysicalFunction nes-physical-operators TLtTtextTextPhysicalFunction.cpp) +add_plugin(TLtTextTtext PhysicalFunction nes-physical-operators TLtTextTtextPhysicalFunction.cpp) +add_plugin(AcontainsGeoTrgeometry PhysicalFunction nes-physical-operators AcontainsGeoTrgeometryPhysicalFunction.cpp) +add_plugin(AcoversGeoTrgeometry PhysicalFunction nes-physical-operators AcoversGeoTrgeometryPhysicalFunction.cpp) +add_plugin(AcoversTrgeometryGeo PhysicalFunction nes-physical-operators AcoversTrgeometryGeoPhysicalFunction.cpp) +add_plugin(AdisjointTrgeometryGeo PhysicalFunction nes-physical-operators AdisjointTrgeometryGeoPhysicalFunction.cpp) +add_plugin(AdisjointTrgeometryTrgeometry PhysicalFunction nes-physical-operators AdisjointTrgeometryTrgeometryPhysicalFunction.cpp) +add_plugin(AdwithinTrgeometryGeo PhysicalFunction nes-physical-operators AdwithinTrgeometryGeoPhysicalFunction.cpp) +add_plugin(AdwithinTrgeometryTrgeometry PhysicalFunction nes-physical-operators AdwithinTrgeometryTrgeometryPhysicalFunction.cpp) +add_plugin(AintersectsTrgeometryGeo PhysicalFunction nes-physical-operators AintersectsTrgeometryGeoPhysicalFunction.cpp) +add_plugin(AintersectsTrgeometryTrgeometry PhysicalFunction nes-physical-operators AintersectsTrgeometryTrgeometryPhysicalFunction.cpp) +add_plugin(AtouchesTrgeometryGeo PhysicalFunction nes-physical-operators AtouchesTrgeometryGeoPhysicalFunction.cpp) +add_plugin(EcontainsGeoTrgeometry PhysicalFunction nes-physical-operators EcontainsGeoTrgeometryPhysicalFunction.cpp) +add_plugin(EcoversGeoTrgeometry PhysicalFunction nes-physical-operators EcoversGeoTrgeometryPhysicalFunction.cpp) +add_plugin(EcoversTrgeometryGeo PhysicalFunction nes-physical-operators EcoversTrgeometryGeoPhysicalFunction.cpp) +add_plugin(EdisjointTrgeometryGeo PhysicalFunction nes-physical-operators EdisjointTrgeometryGeoPhysicalFunction.cpp) +add_plugin(EdisjointTrgeometryTrgeometry PhysicalFunction nes-physical-operators EdisjointTrgeometryTrgeometryPhysicalFunction.cpp) +add_plugin(EdwithinTrgeometryGeo PhysicalFunction nes-physical-operators EdwithinTrgeometryGeoPhysicalFunction.cpp) +add_plugin(EdwithinTrgeometryTrgeometry PhysicalFunction nes-physical-operators EdwithinTrgeometryTrgeometryPhysicalFunction.cpp) +add_plugin(EintersectsTrgeometryGeo PhysicalFunction nes-physical-operators EintersectsTrgeometryGeoPhysicalFunction.cpp) +add_plugin(EintersectsTrgeometryTrgeometry PhysicalFunction nes-physical-operators EintersectsTrgeometryTrgeometryPhysicalFunction.cpp) +add_plugin(EtouchesTrgeometryGeo PhysicalFunction nes-physical-operators EtouchesTrgeometryGeoPhysicalFunction.cpp) +add_plugin(TemporalEIntersectsTPoseGeometry PhysicalFunction nes-physical-operators TemporalEIntersectsTPoseGeometryPhysicalFunction.cpp) +add_plugin(TemporalAIntersectsTPoseGeometry PhysicalFunction nes-physical-operators TemporalAIntersectsTPoseGeometryPhysicalFunction.cpp) +add_plugin(TemporalECoversTPoseGeometry PhysicalFunction nes-physical-operators TemporalECoversTPoseGeometryPhysicalFunction.cpp) +add_plugin(TemporalEDisjointTPoseGeometry PhysicalFunction nes-physical-operators TemporalEDisjointTPoseGeometryPhysicalFunction.cpp) +add_plugin(TemporalADisjointTPoseGeometry PhysicalFunction nes-physical-operators TemporalADisjointTPoseGeometryPhysicalFunction.cpp) +add_plugin(TemporalETouchesTPoseGeometry PhysicalFunction nes-physical-operators TemporalETouchesTPoseGeometryPhysicalFunction.cpp) +add_plugin(TemporalATouchesTPoseGeometry PhysicalFunction nes-physical-operators TemporalATouchesTPoseGeometryPhysicalFunction.cpp) +add_plugin(TemporalEContainsTPoseGeometry PhysicalFunction nes-physical-operators TemporalEContainsTPoseGeometryPhysicalFunction.cpp) +add_plugin(TemporalAContainsTPoseGeometry PhysicalFunction nes-physical-operators TemporalAContainsTPoseGeometryPhysicalFunction.cpp) +add_plugin(TemporalEDWithinTPoseGeometry PhysicalFunction nes-physical-operators TemporalEDWithinTPoseGeometryPhysicalFunction.cpp) +add_plugin(TemporalADWithinTPoseGeometry PhysicalFunction nes-physical-operators TemporalADWithinTPoseGeometryPhysicalFunction.cpp) +add_plugin(TemporalEIntersectsTPoseTPose PhysicalFunction nes-physical-operators TemporalEIntersectsTPoseTPosePhysicalFunction.cpp) +add_plugin(TemporalAIntersectsTPoseTPose PhysicalFunction nes-physical-operators TemporalAIntersectsTPoseTPosePhysicalFunction.cpp) +add_plugin(TemporalECoversTPoseTPose PhysicalFunction nes-physical-operators TemporalECoversTPoseTPosePhysicalFunction.cpp) +add_plugin(TemporalEDisjointTPoseTPose PhysicalFunction nes-physical-operators TemporalEDisjointTPoseTPosePhysicalFunction.cpp) +add_plugin(TemporalADisjointTPoseTPose PhysicalFunction nes-physical-operators TemporalADisjointTPoseTPosePhysicalFunction.cpp) +add_plugin(TemporalETouchesTPoseTPose PhysicalFunction nes-physical-operators TemporalETouchesTPoseTPosePhysicalFunction.cpp) +add_plugin(TemporalATouchesTPoseTPose PhysicalFunction nes-physical-operators TemporalATouchesTPoseTPosePhysicalFunction.cpp) +add_plugin(TemporalEContainsTPoseTPose PhysicalFunction nes-physical-operators TemporalEContainsTPoseTPosePhysicalFunction.cpp) +add_plugin(TemporalAContainsTPoseTPose PhysicalFunction nes-physical-operators TemporalAContainsTPoseTPosePhysicalFunction.cpp) +add_plugin(TemporalEDWithinTPoseTPose PhysicalFunction nes-physical-operators TemporalEDWithinTPoseTPosePhysicalFunction.cpp) +add_plugin(TemporalADWithinTPoseTPose PhysicalFunction nes-physical-operators TemporalADWithinTPoseTPosePhysicalFunction.cpp) +add_plugin(TemporalNADTPoseGeometry PhysicalFunction nes-physical-operators TemporalNADTPoseGeometryPhysicalFunction.cpp) +add_plugin(TemporalNADTPoseTPose PhysicalFunction nes-physical-operators TemporalNADTPoseTPosePhysicalFunction.cpp) +add_plugin(TemporalEIntersectsTNpointGeometry PhysicalFunction nes-physical-operators TemporalEIntersectsTNpointGeometryPhysicalFunction.cpp) +add_plugin(TemporalAIntersectsTNpointGeometry PhysicalFunction nes-physical-operators TemporalAIntersectsTNpointGeometryPhysicalFunction.cpp) +add_plugin(TemporalECoversTNpointGeometry PhysicalFunction nes-physical-operators TemporalECoversTNpointGeometryPhysicalFunction.cpp) +add_plugin(TemporalEDisjointTNpointGeometry PhysicalFunction nes-physical-operators TemporalEDisjointTNpointGeometryPhysicalFunction.cpp) +add_plugin(TemporalADisjointTNpointGeometry PhysicalFunction nes-physical-operators TemporalADisjointTNpointGeometryPhysicalFunction.cpp) +add_plugin(TemporalETouchesTNpointGeometry PhysicalFunction nes-physical-operators TemporalETouchesTNpointGeometryPhysicalFunction.cpp) +add_plugin(TemporalATouchesTNpointGeometry PhysicalFunction nes-physical-operators TemporalATouchesTNpointGeometryPhysicalFunction.cpp) +add_plugin(TemporalEContainsTNpointGeometry PhysicalFunction nes-physical-operators TemporalEContainsTNpointGeometryPhysicalFunction.cpp) +add_plugin(TemporalAContainsTNpointGeometry PhysicalFunction nes-physical-operators TemporalAContainsTNpointGeometryPhysicalFunction.cpp) +add_plugin(TemporalEDWithinTNpointGeometry PhysicalFunction nes-physical-operators TemporalEDWithinTNpointGeometryPhysicalFunction.cpp) +add_plugin(TemporalADWithinTNpointGeometry PhysicalFunction nes-physical-operators TemporalADWithinTNpointGeometryPhysicalFunction.cpp) +add_plugin(TemporalEIntersectsTNpointTNpoint PhysicalFunction nes-physical-operators TemporalEIntersectsTNpointTNpointPhysicalFunction.cpp) +add_plugin(TemporalAIntersectsTNpointTNpoint PhysicalFunction nes-physical-operators TemporalAIntersectsTNpointTNpointPhysicalFunction.cpp) +add_plugin(TemporalECoversTNpointTNpoint PhysicalFunction nes-physical-operators TemporalECoversTNpointTNpointPhysicalFunction.cpp) +add_plugin(TemporalEDisjointTNpointTNpoint PhysicalFunction nes-physical-operators TemporalEDisjointTNpointTNpointPhysicalFunction.cpp) +add_plugin(TemporalADisjointTNpointTNpoint PhysicalFunction nes-physical-operators TemporalADisjointTNpointTNpointPhysicalFunction.cpp) +add_plugin(TemporalETouchesTNpointTNpoint PhysicalFunction nes-physical-operators TemporalETouchesTNpointTNpointPhysicalFunction.cpp) +add_plugin(TemporalATouchesTNpointTNpoint PhysicalFunction nes-physical-operators TemporalATouchesTNpointTNpointPhysicalFunction.cpp) +add_plugin(TemporalEContainsTNpointTNpoint PhysicalFunction nes-physical-operators TemporalEContainsTNpointTNpointPhysicalFunction.cpp) +add_plugin(TemporalAContainsTNpointTNpoint PhysicalFunction nes-physical-operators TemporalAContainsTNpointTNpointPhysicalFunction.cpp) +add_plugin(TemporalEDWithinTNpointTNpoint PhysicalFunction nes-physical-operators TemporalEDWithinTNpointTNpointPhysicalFunction.cpp) +add_plugin(TemporalADWithinTNpointTNpoint PhysicalFunction nes-physical-operators TemporalADWithinTNpointTNpointPhysicalFunction.cpp) +add_plugin(TemporalNADTNpointGeometry PhysicalFunction nes-physical-operators TemporalNADTNpointGeometryPhysicalFunction.cpp) +add_plugin(TemporalNADTNpointTNpoint PhysicalFunction nes-physical-operators TemporalNADTNpointTNpointPhysicalFunction.cpp) endif() diff --git a/nes-physical-operators/src/Functions/Meos/ContainedFloatSpanPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/ContainedFloatSpanPhysicalFunction.cpp index 66db627cfc..cc7808c192 100644 --- a/nes-physical-operators/src/Functions/Meos/ContainedFloatSpanPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/ContainedFloatSpanPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -21,51 +22,71 @@ #include #include #include +#include #include +#include #include #include extern "C" { #include } -#include namespace NES { -ContainedFloatSpanPhysicalFunction::ContainedFloatSpanPhysicalFunction(PhysicalFunction val, PhysicalFunction sp) { - paramFns.reserve(2); - paramFns.push_back(std::move(val)); - paramFns.push_back(std::move(sp)); +ContainedFloatSpanPhysicalFunction::ContainedFloatSpanPhysicalFunction(PhysicalFunction arg0Function, + PhysicalFunction spFunction) +{ + parameterFunctions.reserve(2); + parameterFunctions.push_back(std::move(arg0Function)); + parameterFunctions.push_back(std::move(spFunction)); } -VarVal ContainedFloatSpanPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto val = paramFns[0].execute(record, arena).cast(); - auto sp = paramFns[1].execute(record, arena).cast(); +VarVal ContainedFloatSpanPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto arg0 = parameterValues[0].cast>(); + auto sp = parameterValues[1].cast(); + const auto result = nautilus::invoke( - +[](double val_d, const char* w, uint32_t wsz) -> double { - try { + +[](double arg0, + const char* spPtr, uint32_t spSize) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string s(w, wsz); - Span* sp = floatspan_in(s.c_str()); - if (!sp) return 0.0; - bool r = contained_float_span(val_d, sp); - free(sp); - return r ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + std::string tempS(spPtr, spSize); + Span* temp = floatspan_in(tempS.c_str()); + if (!temp) return 0.0; + + double r = contained_float_span(arg0, temp); + free(temp); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, - val, sp); + arg0, sp.getContent(), sp.getContentSize()); + return VarVal(result); } PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterContainedFloatSpanPhysicalFunction( PhysicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.childFunctions.size()==2, + PRECONDITION(arguments.childFunctions.size() == 2, "ContainedFloatSpanPhysicalFunction requires 2 children but got {}", arguments.childFunctions.size()); - return ContainedFloatSpanPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + return ContainedFloatSpanPhysicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/ContainedFloatspanSpanPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/ContainedFloatspanSpanPhysicalFunction.cpp index d2a2fa66cf..f3c6a39e0e 100644 --- a/nes-physical-operators/src/Functions/Meos/ContainedFloatspanSpanPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/ContainedFloatspanSpanPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -21,53 +22,77 @@ #include #include #include +#include #include +#include #include #include extern "C" { #include } -#include namespace NES { -ContainedFloatspanSpanPhysicalFunction::ContainedFloatspanSpanPhysicalFunction(PhysicalFunction sp1, PhysicalFunction sp2) { - paramFns.reserve(2); - paramFns.push_back(std::move(sp1)); - paramFns.push_back(std::move(sp2)); +ContainedFloatspanSpanPhysicalFunction::ContainedFloatspanSpanPhysicalFunction(PhysicalFunction spFunction, + PhysicalFunction arg0Function) +{ + parameterFunctions.reserve(2); + parameterFunctions.push_back(std::move(spFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } -VarVal ContainedFloatspanSpanPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto sp1 = paramFns[0].execute(record, arena).cast(); - auto sp2 = paramFns[1].execute(record, arena).cast(); +VarVal ContainedFloatspanSpanPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto sp = parameterValues[0].cast(); + auto arg0 = parameterValues[1].cast(); + const auto result = nautilus::invoke( - +[](const char* w1, uint32_t w1sz, const char* w2, uint32_t w2sz) -> double { - try { + +[](const char* spPtr, uint32_t spSize, + const char* arg0Ptr, uint32_t arg0Size) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string s1(w1,w1sz), s2(w2,w2sz); - Span* sp1 = floatspan_in(s1.c_str()); - if (!sp1) return 0.0; - Span* sp2 = floatspan_in(s2.c_str()); - if (!sp2) { free(sp1); return 0.0; } - bool r = contained_span_span(sp1, sp2); - free(sp1); free(sp2); - return r ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + std::string tempS(spPtr, spSize); + Span* temp = floatspan_in(tempS.c_str()); + if (!temp) return 0.0; + std::string arg0S(arg0Ptr, arg0Size); + while (!arg0S.empty() && (arg0S.front()=='\'' || arg0S.front()=='"')) arg0S.erase(arg0S.begin()); + while (!arg0S.empty() && (arg0S.back()=='\'' || arg0S.back()=='"')) arg0S.pop_back(); + Span* arg0B = floatspan_in(arg0S.c_str()); + if (!arg0B) { free(temp); return 0.0; } + + double r = contained_span_span(temp, sp0); + free(temp); + free(arg0B); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, - sp1, sp2); + sp.getContent(), sp.getContentSize(), arg0.getContent(), arg0.getContentSize()); + return VarVal(result); } PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterContainedFloatspanSpanPhysicalFunction( PhysicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.childFunctions.size()==2, + PRECONDITION(arguments.childFunctions.size() == 2, "ContainedFloatspanSpanPhysicalFunction requires 2 children but got {}", arguments.childFunctions.size()); - return ContainedFloatspanSpanPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + return ContainedFloatspanSpanPhysicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/ContainedIntSpanPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/ContainedIntSpanPhysicalFunction.cpp index 49251292e7..14300ca3d1 100644 --- a/nes-physical-operators/src/Functions/Meos/ContainedIntSpanPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/ContainedIntSpanPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -21,51 +22,71 @@ #include #include #include +#include #include +#include #include #include extern "C" { #include } -#include namespace NES { -ContainedIntSpanPhysicalFunction::ContainedIntSpanPhysicalFunction(PhysicalFunction val, PhysicalFunction sp) { - paramFns.reserve(2); - paramFns.push_back(std::move(val)); - paramFns.push_back(std::move(sp)); +ContainedIntSpanPhysicalFunction::ContainedIntSpanPhysicalFunction(PhysicalFunction arg0Function, + PhysicalFunction spFunction) +{ + parameterFunctions.reserve(2); + parameterFunctions.push_back(std::move(arg0Function)); + parameterFunctions.push_back(std::move(spFunction)); } -VarVal ContainedIntSpanPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto val = paramFns[0].execute(record, arena).cast(); - auto sp = paramFns[1].execute(record, arena).cast(); +VarVal ContainedIntSpanPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto arg0 = parameterValues[0].cast>(); + auto sp = parameterValues[1].cast(); + const auto result = nautilus::invoke( - +[](double val_d, const char* w, uint32_t wsz) -> double { - try { + +[](double arg0, + const char* spPtr, uint32_t spSize) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string s(w, wsz); - Span* sp = intspan_in(s.c_str()); - if (!sp) return 0.0; - bool r = contained_int_span((int)val_d, sp); - free(sp); - return r ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + std::string tempS(spPtr, spSize); + Span* temp = intspan_in(tempS.c_str()); + if (!temp) return 0.0; + + double r = contained_int_span((int)arg0, temp); + free(temp); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, - val, sp); + arg0, sp.getContent(), sp.getContentSize()); + return VarVal(result); } PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterContainedIntSpanPhysicalFunction( PhysicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.childFunctions.size()==2, + PRECONDITION(arguments.childFunctions.size() == 2, "ContainedIntSpanPhysicalFunction requires 2 children but got {}", arguments.childFunctions.size()); - return ContainedIntSpanPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + return ContainedIntSpanPhysicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/ContainedSpanSpanPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/ContainedSpanSpanPhysicalFunction.cpp index f77aa41c49..13659a794e 100644 --- a/nes-physical-operators/src/Functions/Meos/ContainedSpanSpanPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/ContainedSpanSpanPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -21,53 +22,77 @@ #include #include #include +#include #include +#include #include #include extern "C" { #include } -#include namespace NES { -ContainedSpanSpanPhysicalFunction::ContainedSpanSpanPhysicalFunction(PhysicalFunction sp1, PhysicalFunction sp2) { - paramFns.reserve(2); - paramFns.push_back(std::move(sp1)); - paramFns.push_back(std::move(sp2)); +ContainedSpanSpanPhysicalFunction::ContainedSpanSpanPhysicalFunction(PhysicalFunction spFunction, + PhysicalFunction arg0Function) +{ + parameterFunctions.reserve(2); + parameterFunctions.push_back(std::move(spFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } -VarVal ContainedSpanSpanPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto sp1 = paramFns[0].execute(record, arena).cast(); - auto sp2 = paramFns[1].execute(record, arena).cast(); +VarVal ContainedSpanSpanPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto sp = parameterValues[0].cast(); + auto arg0 = parameterValues[1].cast(); + const auto result = nautilus::invoke( - +[](const char* w1, uint32_t w1sz, const char* w2, uint32_t w2sz) -> double { - try { + +[](const char* spPtr, uint32_t spSize, + const char* arg0Ptr, uint32_t arg0Size) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string s1(w1,w1sz), s2(w2,w2sz); - Span* sp1 = intspan_in(s1.c_str()); - if (!sp1) return 0.0; - Span* sp2 = intspan_in(s2.c_str()); - if (!sp2) { free(sp1); return 0.0; } - bool r = contained_span_span(sp1, sp2); - free(sp1); free(sp2); - return r ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + std::string tempS(spPtr, spSize); + Span* temp = intspan_in(tempS.c_str()); + if (!temp) return 0.0; + std::string arg0S(arg0Ptr, arg0Size); + while (!arg0S.empty() && (arg0S.front()=='\'' || arg0S.front()=='"')) arg0S.erase(arg0S.begin()); + while (!arg0S.empty() && (arg0S.back()=='\'' || arg0S.back()=='"')) arg0S.pop_back(); + Span* arg0B = intspan_in(arg0S.c_str()); + if (!arg0B) { free(temp); return 0.0; } + + double r = contained_span_span(temp, sp0); + free(temp); + free(arg0B); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, - sp1, sp2); + sp.getContent(), sp.getContentSize(), arg0.getContent(), arg0.getContentSize()); + return VarVal(result); } PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterContainedSpanSpanPhysicalFunction( PhysicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.childFunctions.size()==2, + PRECONDITION(arguments.childFunctions.size() == 2, "ContainedSpanSpanPhysicalFunction requires 2 children but got {}", arguments.childFunctions.size()); - return ContainedSpanSpanPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + return ContainedSpanSpanPhysicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/ContainsFloatspanSpanPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/ContainsFloatspanSpanPhysicalFunction.cpp index 61db808900..062460e21d 100644 --- a/nes-physical-operators/src/Functions/Meos/ContainsFloatspanSpanPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/ContainsFloatspanSpanPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -21,53 +22,77 @@ #include #include #include +#include #include +#include #include #include extern "C" { #include } -#include namespace NES { -ContainsFloatspanSpanPhysicalFunction::ContainsFloatspanSpanPhysicalFunction(PhysicalFunction sp1, PhysicalFunction sp2) { - paramFns.reserve(2); - paramFns.push_back(std::move(sp1)); - paramFns.push_back(std::move(sp2)); +ContainsFloatspanSpanPhysicalFunction::ContainsFloatspanSpanPhysicalFunction(PhysicalFunction spFunction, + PhysicalFunction arg0Function) +{ + parameterFunctions.reserve(2); + parameterFunctions.push_back(std::move(spFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } -VarVal ContainsFloatspanSpanPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto sp1 = paramFns[0].execute(record, arena).cast(); - auto sp2 = paramFns[1].execute(record, arena).cast(); +VarVal ContainsFloatspanSpanPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto sp = parameterValues[0].cast(); + auto arg0 = parameterValues[1].cast(); + const auto result = nautilus::invoke( - +[](const char* w1, uint32_t w1sz, const char* w2, uint32_t w2sz) -> double { - try { + +[](const char* spPtr, uint32_t spSize, + const char* arg0Ptr, uint32_t arg0Size) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string s1(w1,w1sz), s2(w2,w2sz); - Span* sp1 = floatspan_in(s1.c_str()); - if (!sp1) return 0.0; - Span* sp2 = floatspan_in(s2.c_str()); - if (!sp2) { free(sp1); return 0.0; } - bool r = contains_span_span(sp1, sp2); - free(sp1); free(sp2); - return r ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + std::string tempS(spPtr, spSize); + Span* temp = floatspan_in(tempS.c_str()); + if (!temp) return 0.0; + std::string arg0S(arg0Ptr, arg0Size); + while (!arg0S.empty() && (arg0S.front()=='\'' || arg0S.front()=='"')) arg0S.erase(arg0S.begin()); + while (!arg0S.empty() && (arg0S.back()=='\'' || arg0S.back()=='"')) arg0S.pop_back(); + Span* arg0B = floatspan_in(arg0S.c_str()); + if (!arg0B) { free(temp); return 0.0; } + + double r = contains_span_span(temp, sp0); + free(temp); + free(arg0B); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, - sp1, sp2); + sp.getContent(), sp.getContentSize(), arg0.getContent(), arg0.getContentSize()); + return VarVal(result); } PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterContainsFloatspanSpanPhysicalFunction( PhysicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.childFunctions.size()==2, + PRECONDITION(arguments.childFunctions.size() == 2, "ContainsFloatspanSpanPhysicalFunction requires 2 children but got {}", arguments.childFunctions.size()); - return ContainsFloatspanSpanPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + return ContainsFloatspanSpanPhysicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/ContainsSpanFloatPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/ContainsSpanFloatPhysicalFunction.cpp index a6d9d95eb9..8c8ab7ef81 100644 --- a/nes-physical-operators/src/Functions/Meos/ContainsSpanFloatPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/ContainsSpanFloatPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -21,51 +22,71 @@ #include #include #include +#include #include +#include #include #include extern "C" { #include } -#include namespace NES { -ContainsSpanFloatPhysicalFunction::ContainsSpanFloatPhysicalFunction(PhysicalFunction sp, PhysicalFunction val) { - paramFns.reserve(2); - paramFns.push_back(std::move(sp)); - paramFns.push_back(std::move(val)); +ContainsSpanFloatPhysicalFunction::ContainsSpanFloatPhysicalFunction(PhysicalFunction spFunction, + PhysicalFunction arg0Function) +{ + parameterFunctions.reserve(2); + parameterFunctions.push_back(std::move(spFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } -VarVal ContainsSpanFloatPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto sp = paramFns[0].execute(record, arena).cast(); - auto val = paramFns[1].execute(record, arena).cast(); +VarVal ContainsSpanFloatPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto sp = parameterValues[0].cast(); + auto arg0 = parameterValues[1].cast>(); + const auto result = nautilus::invoke( - +[](const char* w, uint32_t wsz, double val_d) -> double { - try { + +[](const char* spPtr, uint32_t spSize, + double arg0) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string s(w, wsz); - Span* sp = floatspan_in(s.c_str()); - if (!sp) return 0.0; - bool r = contains_span_float(sp, val_d); - free(sp); - return r ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + std::string tempS(spPtr, spSize); + Span* temp = floatspan_in(tempS.c_str()); + if (!temp) return 0.0; + + double r = contains_span_float(temp, arg0); + free(temp); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, - sp, val); + sp.getContent(), sp.getContentSize(), arg0); + return VarVal(result); } PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterContainsSpanFloatPhysicalFunction( PhysicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.childFunctions.size()==2, + PRECONDITION(arguments.childFunctions.size() == 2, "ContainsSpanFloatPhysicalFunction requires 2 children but got {}", arguments.childFunctions.size()); - return ContainsSpanFloatPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + return ContainsSpanFloatPhysicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/ContainsSpanIntPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/ContainsSpanIntPhysicalFunction.cpp index 8f42a14a5b..6cfd651a14 100644 --- a/nes-physical-operators/src/Functions/Meos/ContainsSpanIntPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/ContainsSpanIntPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -21,51 +22,71 @@ #include #include #include +#include #include +#include #include #include extern "C" { #include } -#include namespace NES { -ContainsSpanIntPhysicalFunction::ContainsSpanIntPhysicalFunction(PhysicalFunction sp, PhysicalFunction val) { - paramFns.reserve(2); - paramFns.push_back(std::move(sp)); - paramFns.push_back(std::move(val)); +ContainsSpanIntPhysicalFunction::ContainsSpanIntPhysicalFunction(PhysicalFunction spFunction, + PhysicalFunction arg0Function) +{ + parameterFunctions.reserve(2); + parameterFunctions.push_back(std::move(spFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } -VarVal ContainsSpanIntPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto sp = paramFns[0].execute(record, arena).cast(); - auto val = paramFns[1].execute(record, arena).cast(); +VarVal ContainsSpanIntPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto sp = parameterValues[0].cast(); + auto arg0 = parameterValues[1].cast>(); + const auto result = nautilus::invoke( - +[](const char* w, uint32_t wsz, double val_d) -> double { - try { + +[](const char* spPtr, uint32_t spSize, + double arg0) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string s(w, wsz); - Span* sp = intspan_in(s.c_str()); - if (!sp) return 0.0; - bool r = contains_span_int(sp, (int)val_d); - free(sp); - return r ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + std::string tempS(spPtr, spSize); + Span* temp = intspan_in(tempS.c_str()); + if (!temp) return 0.0; + + double r = contains_span_int(temp, (int)arg0); + free(temp); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, - sp, val); + sp.getContent(), sp.getContentSize(), arg0); + return VarVal(result); } PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterContainsSpanIntPhysicalFunction( PhysicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.childFunctions.size()==2, + PRECONDITION(arguments.childFunctions.size() == 2, "ContainsSpanIntPhysicalFunction requires 2 children but got {}", arguments.childFunctions.size()); - return ContainsSpanIntPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + return ContainsSpanIntPhysicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/ContainsSpanSpanPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/ContainsSpanSpanPhysicalFunction.cpp index 081d76faf7..535fa4d5be 100644 --- a/nes-physical-operators/src/Functions/Meos/ContainsSpanSpanPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/ContainsSpanSpanPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -21,53 +22,77 @@ #include #include #include +#include #include +#include #include #include extern "C" { #include } -#include namespace NES { -ContainsSpanSpanPhysicalFunction::ContainsSpanSpanPhysicalFunction(PhysicalFunction sp1, PhysicalFunction sp2) { - paramFns.reserve(2); - paramFns.push_back(std::move(sp1)); - paramFns.push_back(std::move(sp2)); +ContainsSpanSpanPhysicalFunction::ContainsSpanSpanPhysicalFunction(PhysicalFunction spFunction, + PhysicalFunction arg0Function) +{ + parameterFunctions.reserve(2); + parameterFunctions.push_back(std::move(spFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } -VarVal ContainsSpanSpanPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto sp1 = paramFns[0].execute(record, arena).cast(); - auto sp2 = paramFns[1].execute(record, arena).cast(); +VarVal ContainsSpanSpanPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto sp = parameterValues[0].cast(); + auto arg0 = parameterValues[1].cast(); + const auto result = nautilus::invoke( - +[](const char* w1, uint32_t w1sz, const char* w2, uint32_t w2sz) -> double { - try { + +[](const char* spPtr, uint32_t spSize, + const char* arg0Ptr, uint32_t arg0Size) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string s1(w1,w1sz), s2(w2,w2sz); - Span* sp1 = intspan_in(s1.c_str()); - if (!sp1) return 0.0; - Span* sp2 = intspan_in(s2.c_str()); - if (!sp2) { free(sp1); return 0.0; } - bool r = contains_span_span(sp1, sp2); - free(sp1); free(sp2); - return r ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + std::string tempS(spPtr, spSize); + Span* temp = intspan_in(tempS.c_str()); + if (!temp) return 0.0; + std::string arg0S(arg0Ptr, arg0Size); + while (!arg0S.empty() && (arg0S.front()=='\'' || arg0S.front()=='"')) arg0S.erase(arg0S.begin()); + while (!arg0S.empty() && (arg0S.back()=='\'' || arg0S.back()=='"')) arg0S.pop_back(); + Span* arg0B = intspan_in(arg0S.c_str()); + if (!arg0B) { free(temp); return 0.0; } + + double r = contains_span_span(temp, sp0); + free(temp); + free(arg0B); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, - sp1, sp2); + sp.getContent(), sp.getContentSize(), arg0.getContent(), arg0.getContentSize()); + return VarVal(result); } PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterContainsSpanSpanPhysicalFunction( PhysicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.childFunctions.size()==2, + PRECONDITION(arguments.childFunctions.size() == 2, "ContainsSpanSpanPhysicalFunction requires 2 children but got {}", arguments.childFunctions.size()); - return ContainsSpanSpanPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + return ContainsSpanSpanPhysicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/DivBigintTbigintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/DivBigintTbigintPhysicalFunction.cpp index 5d79d2132b..81e81d439c 100644 --- a/nes-physical-operators/src/Functions/Meos/DivBigintTbigintPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/DivBigintTbigintPhysicalFunction.cpp @@ -35,12 +35,12 @@ extern "C" { namespace NES { -DivBigintTbigintPhysicalFunction::DivBigintTbigintPhysicalFunction(PhysicalFunction scalarFunction, - PhysicalFunction valueFunction, - PhysicalFunction tsFunction) +DivBigintTbigintPhysicalFunction::DivBigintTbigintPhysicalFunction(PhysicalFunction arg0Function, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction) { parameterFunctions.reserve(3); - parameterFunctions.push_back(std::move(scalarFunction)); + parameterFunctions.push_back(std::move(arg0Function)); parameterFunctions.push_back(std::move(valueFunction)); parameterFunctions.push_back(std::move(tsFunction)); } @@ -50,29 +50,38 @@ VarVal DivBigintTbigintPhysicalFunction::execute(const Record& record, ArenaRef& std::vector parameterValues; parameterValues.reserve(parameterFunctions.size()); for (const auto& function : parameterFunctions) + { parameterValues.emplace_back(function.execute(record, arena)); + } - auto scalar = parameterValues[0].cast>(); - auto value = parameterValues[1].cast>(); - auto ts = parameterValues[2].cast>(); + auto arg0 = parameterValues[0].cast>(); + auto value = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); const auto result = nautilus::invoke( - +[](double scalar_d, double value_d, uint64_t ts) -> double { - try { + +[](double arg0, + double value, + uint64_t ts) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string tempWkt = fmt::format("{}@{}", static_cast(value_d), - MEOS::Meos::convertEpochToTimestamp(ts)); + std::string tempWkt = fmt::format("{}@{}", static_cast(value), MEOS::Meos::convertEpochToTimestamp(ts)); Temporal* temp = tbigint_in(tempWkt.c_str()); if (!temp) return 0.0; - Temporal* res = div_bigint_tbigint(static_cast(scalar_d), temp); + + Temporal* res = div_bigint_tbigint(static_cast(arg0), temp); free(temp); if (!res) return 0.0; - double r = static_cast(tbigint_start_value(res)); + double r = tbigint_start_value(res); free(res); return r; - } catch (const std::exception&) { return 0.0; } + } + catch (const std::exception&) + { + return 0.0; + } }, - scalar, value, ts); + arg0, value, ts); return VarVal(result); } diff --git a/nes-physical-operators/src/Functions/Meos/DivFloatTfloatPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/DivFloatTfloatPhysicalFunction.cpp index f920a90108..862fc5a5fe 100644 --- a/nes-physical-operators/src/Functions/Meos/DivFloatTfloatPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/DivFloatTfloatPhysicalFunction.cpp @@ -35,12 +35,12 @@ extern "C" { namespace NES { -DivFloatTfloatPhysicalFunction::DivFloatTfloatPhysicalFunction(PhysicalFunction scalarFunction, - PhysicalFunction valueFunction, - PhysicalFunction tsFunction) +DivFloatTfloatPhysicalFunction::DivFloatTfloatPhysicalFunction(PhysicalFunction arg0Function, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction) { parameterFunctions.reserve(3); - parameterFunctions.push_back(std::move(scalarFunction)); + parameterFunctions.push_back(std::move(arg0Function)); parameterFunctions.push_back(std::move(valueFunction)); parameterFunctions.push_back(std::move(tsFunction)); } @@ -50,28 +50,38 @@ VarVal DivFloatTfloatPhysicalFunction::execute(const Record& record, ArenaRef& a std::vector parameterValues; parameterValues.reserve(parameterFunctions.size()); for (const auto& function : parameterFunctions) + { parameterValues.emplace_back(function.execute(record, arena)); + } - auto scalar = parameterValues[0].cast>(); - auto value = parameterValues[1].cast>(); - auto ts = parameterValues[2].cast>(); + auto arg0 = parameterValues[0].cast>(); + auto value = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); const auto result = nautilus::invoke( - +[](double scalar, double value, uint64_t ts) -> double { - try { + +[](double arg0, + double value, + uint64_t ts) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); std::string tempWkt = fmt::format("{}@{}", value, MEOS::Meos::convertEpochToTimestamp(ts)); Temporal* temp = tfloat_in(tempWkt.c_str()); if (!temp) return 0.0; - Temporal* res = div_float_tfloat(scalar, temp); + + Temporal* res = div_float_tfloat(arg0, temp); free(temp); if (!res) return 0.0; double r = tfloat_start_value(res); free(res); return r; - } catch (const std::exception&) { return 0.0; } + } + catch (const std::exception&) + { + return 0.0; + } }, - scalar, value, ts); + arg0, value, ts); return VarVal(result); } diff --git a/nes-physical-operators/src/Functions/Meos/DivIntTintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/DivIntTintPhysicalFunction.cpp index d612334db7..3e95541334 100644 --- a/nes-physical-operators/src/Functions/Meos/DivIntTintPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/DivIntTintPhysicalFunction.cpp @@ -35,12 +35,12 @@ extern "C" { namespace NES { -DivIntTintPhysicalFunction::DivIntTintPhysicalFunction(PhysicalFunction scalarFunction, - PhysicalFunction valueFunction, - PhysicalFunction tsFunction) +DivIntTintPhysicalFunction::DivIntTintPhysicalFunction(PhysicalFunction arg0Function, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction) { parameterFunctions.reserve(3); - parameterFunctions.push_back(std::move(scalarFunction)); + parameterFunctions.push_back(std::move(arg0Function)); parameterFunctions.push_back(std::move(valueFunction)); parameterFunctions.push_back(std::move(tsFunction)); } @@ -50,28 +50,38 @@ VarVal DivIntTintPhysicalFunction::execute(const Record& record, ArenaRef& arena std::vector parameterValues; parameterValues.reserve(parameterFunctions.size()); for (const auto& function : parameterFunctions) + { parameterValues.emplace_back(function.execute(record, arena)); + } - auto scalar = parameterValues[0].cast>(); - auto value = parameterValues[1].cast>(); - auto ts = parameterValues[2].cast>(); + auto arg0 = parameterValues[0].cast>(); + auto value = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); const auto result = nautilus::invoke( - +[](double scalar_d, double value_d, uint64_t ts) -> double { - try { + +[](int32_t arg0, + int32_t value, + uint64_t ts) -> int { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string tempWkt = fmt::format("{}@{}", static_cast(value_d), MEOS::Meos::convertEpochToTimestamp(ts)); + std::string tempWkt = fmt::format("{}@{}", value, MEOS::Meos::convertEpochToTimestamp(ts)); Temporal* temp = tint_in(tempWkt.c_str()); - if (!temp) return 0.0; - Temporal* res = div_int_tint(static_cast(scalar_d), temp); + if (!temp) return 0; + + Temporal* res = div_int_tint(arg0, temp); free(temp); - if (!res) return 0.0; - double r = static_cast(tint_start_value(res)); + if (!res) return 0; + int r = tint_start_value(res); free(res); return r; - } catch (const std::exception&) { return 0.0; } + } + catch (const std::exception&) + { + return 0; + } }, - scalar, value, ts); + arg0, value, ts); return VarVal(result); } diff --git a/nes-physical-operators/src/Functions/Meos/DivTbigintBigintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/DivTbigintBigintPhysicalFunction.cpp index 381188aedf..d3cde73b7c 100644 --- a/nes-physical-operators/src/Functions/Meos/DivTbigintBigintPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/DivTbigintBigintPhysicalFunction.cpp @@ -36,13 +36,13 @@ extern "C" { namespace NES { DivTbigintBigintPhysicalFunction::DivTbigintBigintPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction tsFunction, - PhysicalFunction divisorFunction) + PhysicalFunction tsFunction, + PhysicalFunction arg0Function) { parameterFunctions.reserve(3); parameterFunctions.push_back(std::move(valueFunction)); parameterFunctions.push_back(std::move(tsFunction)); - parameterFunctions.push_back(std::move(divisorFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } VarVal DivTbigintBigintPhysicalFunction::execute(const Record& record, ArenaRef& arena) const @@ -50,29 +50,38 @@ VarVal DivTbigintBigintPhysicalFunction::execute(const Record& record, ArenaRef& std::vector parameterValues; parameterValues.reserve(parameterFunctions.size()); for (const auto& function : parameterFunctions) + { parameterValues.emplace_back(function.execute(record, arena)); + } - auto value = parameterValues[0].cast>(); - auto ts = parameterValues[1].cast>(); - auto divisor = parameterValues[2].cast>(); + auto value = parameterValues[0].cast>(); + auto ts = parameterValues[1].cast>(); + auto arg0 = parameterValues[2].cast>(); const auto result = nautilus::invoke( - +[](double value, uint64_t ts, double divisor_d) -> double { - try { + +[](double value, + uint64_t ts, + double arg0) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string tempWkt = fmt::format("{}@{}", static_cast(value), - MEOS::Meos::convertEpochToTimestamp(ts)); + std::string tempWkt = fmt::format("{}@{}", static_cast(value), MEOS::Meos::convertEpochToTimestamp(ts)); Temporal* temp = tbigint_in(tempWkt.c_str()); if (!temp) return 0.0; - Temporal* res = div_tbigint_bigint(temp, static_cast(divisor_d)); + + Temporal* res = div_tbigint_bigint(temp, static_cast(arg0)); free(temp); if (!res) return 0.0; - double r = static_cast(tbigint_start_value(res)); + double r = tbigint_start_value(res); free(res); return r; - } catch (const std::exception&) { return 0.0; } + } + catch (const std::exception&) + { + return 0.0; + } }, - value, ts, divisor); + value, ts, arg0); return VarVal(result); } diff --git a/nes-physical-operators/src/Functions/Meos/DivTfloatFloatPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/DivTfloatFloatPhysicalFunction.cpp index c0f7e9da02..14b7e4bb59 100644 --- a/nes-physical-operators/src/Functions/Meos/DivTfloatFloatPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/DivTfloatFloatPhysicalFunction.cpp @@ -36,13 +36,13 @@ extern "C" { namespace NES { DivTfloatFloatPhysicalFunction::DivTfloatFloatPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction tsFunction, - PhysicalFunction divisorFunction) + PhysicalFunction tsFunction, + PhysicalFunction arg0Function) { parameterFunctions.reserve(3); parameterFunctions.push_back(std::move(valueFunction)); parameterFunctions.push_back(std::move(tsFunction)); - parameterFunctions.push_back(std::move(divisorFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } VarVal DivTfloatFloatPhysicalFunction::execute(const Record& record, ArenaRef& arena) const @@ -50,28 +50,38 @@ VarVal DivTfloatFloatPhysicalFunction::execute(const Record& record, ArenaRef& a std::vector parameterValues; parameterValues.reserve(parameterFunctions.size()); for (const auto& function : parameterFunctions) + { parameterValues.emplace_back(function.execute(record, arena)); + } - auto value = parameterValues[0].cast>(); - auto ts = parameterValues[1].cast>(); - auto divisor = parameterValues[2].cast>(); + auto value = parameterValues[0].cast>(); + auto ts = parameterValues[1].cast>(); + auto arg0 = parameterValues[2].cast>(); const auto result = nautilus::invoke( - +[](double value, uint64_t ts, double divisor) -> double { - try { + +[](double value, + uint64_t ts, + double arg0) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); std::string tempWkt = fmt::format("{}@{}", value, MEOS::Meos::convertEpochToTimestamp(ts)); Temporal* temp = tfloat_in(tempWkt.c_str()); if (!temp) return 0.0; - Temporal* res = div_tfloat_float(temp, divisor); + + Temporal* res = div_tfloat_float(temp, arg0); free(temp); if (!res) return 0.0; double r = tfloat_start_value(res); free(res); return r; - } catch (const std::exception&) { return 0.0; } + } + catch (const std::exception&) + { + return 0.0; + } }, - value, ts, divisor); + value, ts, arg0); return VarVal(result); } diff --git a/nes-physical-operators/src/Functions/Meos/DivTintIntPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/DivTintIntPhysicalFunction.cpp index 540c8b52e3..9f1d6ac4cc 100644 --- a/nes-physical-operators/src/Functions/Meos/DivTintIntPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/DivTintIntPhysicalFunction.cpp @@ -36,13 +36,13 @@ extern "C" { namespace NES { DivTintIntPhysicalFunction::DivTintIntPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction tsFunction, - PhysicalFunction divisorFunction) + PhysicalFunction tsFunction, + PhysicalFunction arg0Function) { parameterFunctions.reserve(3); parameterFunctions.push_back(std::move(valueFunction)); parameterFunctions.push_back(std::move(tsFunction)); - parameterFunctions.push_back(std::move(divisorFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } VarVal DivTintIntPhysicalFunction::execute(const Record& record, ArenaRef& arena) const @@ -50,28 +50,38 @@ VarVal DivTintIntPhysicalFunction::execute(const Record& record, ArenaRef& arena std::vector parameterValues; parameterValues.reserve(parameterFunctions.size()); for (const auto& function : parameterFunctions) + { parameterValues.emplace_back(function.execute(record, arena)); + } - auto value = parameterValues[0].cast>(); - auto ts = parameterValues[1].cast>(); - auto divisor = parameterValues[2].cast>(); + auto value = parameterValues[0].cast>(); + auto ts = parameterValues[1].cast>(); + auto arg0 = parameterValues[2].cast>(); const auto result = nautilus::invoke( - +[](double value, uint64_t ts, double divisor_d) -> double { - try { + +[](int32_t value, + uint64_t ts, + int32_t arg0) -> int { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string tempWkt = fmt::format("{}@{}", static_cast(value), MEOS::Meos::convertEpochToTimestamp(ts)); + std::string tempWkt = fmt::format("{}@{}", value, MEOS::Meos::convertEpochToTimestamp(ts)); Temporal* temp = tint_in(tempWkt.c_str()); - if (!temp) return 0.0; - Temporal* res = div_tint_int(temp, static_cast(divisor_d)); + if (!temp) return 0; + + Temporal* res = div_tint_int(temp, arg0); free(temp); - if (!res) return 0.0; - double r = static_cast(tint_start_value(res)); + if (!res) return 0; + int r = tint_start_value(res); free(res); return r; - } catch (const std::exception&) { return 0.0; } + } + catch (const std::exception&) + { + return 0; + } }, - value, ts, divisor); + value, ts, arg0); return VarVal(result); } diff --git a/nes-physical-operators/src/Functions/Meos/DivTnumberTnumberPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/DivTnumberTnumberPhysicalFunction.cpp index 1cab4168d2..dfd8a3d1ea 100644 --- a/nes-physical-operators/src/Functions/Meos/DivTnumberTnumberPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/DivTnumberTnumberPhysicalFunction.cpp @@ -22,7 +22,8 @@ #include #include #include -#include +#include +#include #include #include #include @@ -35,14 +36,12 @@ extern "C" { namespace NES { -DivTnumberTnumberPhysicalFunction::DivTnumberTnumberPhysicalFunction(PhysicalFunction value1Function, - PhysicalFunction value2Function, - PhysicalFunction tsFunction) +DivTnumberTnumberPhysicalFunction::DivTnumberTnumberPhysicalFunction(PhysicalFunction trajFunction, + PhysicalFunction arg0Function) { - parameterFunctions.reserve(3); - parameterFunctions.push_back(std::move(value1Function)); - parameterFunctions.push_back(std::move(value2Function)); - parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.reserve(2); + parameterFunctions.push_back(std::move(trajFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } VarVal DivTnumberTnumberPhysicalFunction::execute(const Record& record, ArenaRef& arena) const @@ -50,45 +49,74 @@ VarVal DivTnumberTnumberPhysicalFunction::execute(const Record& record, ArenaRef std::vector parameterValues; parameterValues.reserve(parameterFunctions.size()); for (const auto& function : parameterFunctions) + { parameterValues.emplace_back(function.execute(record, arena)); + } - auto value1 = parameterValues[0].cast>(); - auto value2 = parameterValues[1].cast>(); - auto ts = parameterValues[2].cast>(); + auto traj = parameterValues[0].cast(); + auto arg0 = parameterValues[1].cast(); - const auto result = nautilus::invoke( - +[](double value1, double value2, uint64_t ts) -> double { - try { + // Call MEOS f(Temporal*, Temporal*) -> Temporal* over the two hex-WKB + // operands and serialize the result back to hex-WKB inside the invoke; the + // returned heap string is copied into the arena below. Both operands and the + // MEOS result are freed here. + auto hexStr = nautilus::invoke( + +[](const char* aPtr, uint32_t aSize, const char* bPtr, uint32_t bSize) -> char* + { + try + { MEOS::Meos::ensureMeosInitialized(); - const std::string tsStr = MEOS::Meos::convertEpochToTimestamp(ts); - std::string wkt1 = fmt::format("{}@{}", value1, tsStr); - std::string wkt2 = fmt::format("{}@{}", value2, tsStr); - Temporal* t1 = tfloat_in(wkt1.c_str()); - Temporal* t2 = tfloat_in(wkt2.c_str()); - if (!t1 || !t2) { free(t1); free(t2); return 0.0; } - Temporal* res = div_tnumber_tnumber(t1, t2); - free(t1); free(t2); - if (!res) return 0.0; - double r = tfloat_start_value(res); + std::string aHex(aPtr, aSize); + std::string bHex(bPtr, bSize); + Temporal* a = temporal_from_hexwkb(aHex.c_str()); + if (!a) return (char*) nullptr; + Temporal* b = temporal_from_hexwkb(bHex.c_str()); + if (!b) { free(a); return (char*) nullptr; } + Temporal* res = div_tnumber_tnumber(a, b); + free(a); + free(b); + if (!res) return (char*) nullptr; + size_t hexSize = 0; + char* hexOut = temporal_as_hexwkb(res, 0, &hexSize); free(res); - return r; - } catch (const std::exception&) { return 0.0; } + return hexOut; + } + catch (const std::exception&) + { + return (char*) nullptr; + } }, - value1, value2, ts); + traj.getContent(), traj.getContentSize(), arg0.getContent(), arg0.getContentSize()); - return VarVal(result); + const auto hexLen = nautilus::invoke( + +[](const char* s) -> uint32_t { return s ? (uint32_t) strlen(s) : (uint32_t) 0; }, + hexStr); + + auto variableSized = arena.allocateVariableSizedData(hexLen); + + nautilus::invoke( + +[](int8_t* dest, const char* s, uint32_t len) -> void + { + if (s) + { + memcpy(dest, s, len); + free((void*) s); + } + }, + variableSized.getContent(), hexStr, hexLen); + + return variableSized; } PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterDivTnumberTnumberPhysicalFunction( PhysicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.childFunctions.size() == 3, - "DivTnumberTnumberPhysicalFunction requires 3 children but got {}", + PRECONDITION(arguments.childFunctions.size() == 2, + "DivTnumberTnumberPhysicalFunction requires 2 children but got {}", arguments.childFunctions.size()); auto arg0 = std::move(arguments.childFunctions[0]); auto arg1 = std::move(arguments.childFunctions[1]); - auto arg2 = std::move(arguments.childFunctions[2]); - return DivTnumberTnumberPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); + return DivTnumberTnumberPhysicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EcontainsGeoTrgeometryPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EcontainsGeoTrgeometryPhysicalFunction.cpp new file mode 100644 index 0000000000..b8d3f1f339 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EcontainsGeoTrgeometryPhysicalFunction.cpp @@ -0,0 +1,97 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +#include +} + +namespace NES { + +EcontainsGeoTrgeometryPhysicalFunction::EcontainsGeoTrgeometryPhysicalFunction(PhysicalFunction tgt_wkt, PhysicalFunction ref_wkt, PhysicalFunction x1, PhysicalFunction y1, PhysicalFunction theta1, PhysicalFunction ts1) { + paramFns.reserve(6); + paramFns.push_back(std::move(tgt_wkt)); + paramFns.push_back(std::move(ref_wkt)); + paramFns.push_back(std::move(x1)); + paramFns.push_back(std::move(y1)); + paramFns.push_back(std::move(theta1)); + paramFns.push_back(std::move(ts1)); +} + +VarVal EcontainsGeoTrgeometryPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { + auto tgt_wkt = paramFns[0].execute(record, arena).cast(); + auto ref_wkt = paramFns[1].execute(record, arena).cast(); + auto x1 = paramFns[2].execute(record, arena).cast(); + auto y1 = paramFns[3].execute(record, arena).cast(); + auto theta1 = paramFns[4].execute(record, arena).cast(); + auto ts1 = paramFns[5].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](const char* tgt_wkt, uint32_t tgt_wktsz, const char* ref_wkt, uint32_t ref_wktsz, double x1, double y1, double theta1, uint64_t ts1) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + char* ref1_str = (char*)malloc(ref_wktsz + 1); + memcpy(ref1_str, ref_wkt, ref_wktsz); ref1_str[ref_wktsz] = '\0'; + GSERIALIZED* gref1 = geom_in(ref1_str, -1); free(ref1_str); + if (!gref1) return 0.0; + Pose* pose1 = pose_make_2d(x1, y1, theta1, false, 0); + if (!pose1) { free(gref1); return 0.0; } + TInstant* inst1 = trgeometryinst_make(gref1, pose1, (TimestampTz)ts1); + free(gref1); free(pose1); + if (!inst1) return 0.0; + char* tgt_str = (char*)malloc(tgt_wktsz + 1); + memcpy(tgt_str, tgt_wkt, tgt_wktsz); tgt_str[tgt_wktsz] = '\0'; + GSERIALIZED* gs_tgt = geom_in(tgt_str, -1); free(tgt_str); + if (!gs_tgt) { free(inst1); return 0.0; } + int r = econtains_geo_trgeometry(gs_tgt, (Temporal*)inst1); + free(inst1); free(gs_tgt); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + tgt_wkt, ref_wkt, x1, y1, theta1, ts1); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEcontainsGeoTrgeometryPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size()==6, + "EcontainsGeoTrgeometryPhysicalFunction requires 6 children but got {}", + arguments.childFunctions.size()); + return EcontainsGeoTrgeometryPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4]), + std::move(arguments.childFunctions[5])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EcontainsTcbufferGeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EcontainsTcbufferGeoPhysicalFunction.cpp index 18addc2839..288f9cc3a3 100644 --- a/nes-physical-operators/src/Functions/Meos/EcontainsTcbufferGeoPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/EcontainsTcbufferGeoPhysicalFunction.cpp @@ -13,77 +13,97 @@ */ #include + #include #include #include +#include #include #include #include #include +#include #include +#include #include #include -#include -#include -#include extern "C" { #include -#include #include } namespace NES { -EcontainsTcbufferGeoPhysicalFunction::EcontainsTcbufferGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, - PhysicalFunction radius, PhysicalFunction ts, - PhysicalFunction wkt) +EcontainsTcbufferGeoPhysicalFunction::EcontainsTcbufferGeoPhysicalFunction(PhysicalFunction lonFunction, + PhysicalFunction latFunction, + PhysicalFunction radiusFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction) { - paramFns.reserve(5); - paramFns.push_back(std::move(lon)); - paramFns.push_back(std::move(lat)); - paramFns.push_back(std::move(radius)); - paramFns.push_back(std::move(ts)); - paramFns.push_back(std::move(wkt)); + parameterFunctions.reserve(5); + parameterFunctions.push_back(std::move(lonFunction)); + parameterFunctions.push_back(std::move(latFunction)); + parameterFunctions.push_back(std::move(radiusFunction)); + parameterFunctions.push_back(std::move(timestampFunction)); + parameterFunctions.push_back(std::move(geometryFunction)); } VarVal EcontainsTcbufferGeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto lon = paramFns[0].execute(record, arena).cast(); - auto lat = paramFns[1].execute(record, arena).cast(); - auto radius = paramFns[2].execute(record, arena).cast(); - auto ts = paramFns[3].execute(record, arena).cast(); - auto wkt = paramFns[4].execute(record, arena); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto lon = parameterValues[0].cast>(); + auto lat = parameterValues[1].cast>(); + auto radius = parameterValues[2].cast>(); + auto timestamp = parameterValues[3].cast>(); + auto geometry = parameterValues[4].cast(); const auto result = nautilus::invoke( - +[](double lon, double lat, double radius, uint64_t ts, - const char* wkt, uint32_t wkt_len) -> double { - try { + +[](double lonValue, + double latValue, + double radiusValue, + uint64_t timestampValue, + const char* geometryPtr, + uint32_t geometrySize) -> int { + try + { MEOS::Meos::ensureMeosInitialized(); - // Build tcbuffer instant: point + radius → cbuffer → instant - std::string pt_str = fmt::format("POINT({} {})", lon, lat); - GSERIALIZED* pt_gs = geom_in(pt_str.c_str(), -1); - if (!pt_gs) return 0.0; - Cbuffer* cb = cbuffer_make(pt_gs, radius); - free(pt_gs); - if (!cb) return 0.0; - Temporal* tcb_inst = (Temporal*)tcbufferinst_make(cb, (TimestampTz)ts); - free(cb); - if (!tcb_inst) return 0.0; - // Build target geometry from null-terminated WKT copy - char* wkt_str = (char*)malloc(wkt_len + 1); - memcpy(wkt_str, wkt, wkt_len); - wkt_str[wkt_len] = '\0'; - GSERIALIZED* target_gs = geom_in(wkt_str, -1); - free(wkt_str); - if (!target_gs) { free(tcb_inst); return 0.0; } - int r = econtains_tcbuffer_geo(tcb_inst, target_gs); - free(tcb_inst); - free(target_gs); - return r > 0 ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + if (!(lonValue >= -180.0 && lonValue <= 180.0 && latValue >= -90.0 && latValue <= 90.0)) return 0; + if (radiusValue < 0.0) return 0; + + const std::string timestampString = MEOS::Meos::convertEpochToTimestamp(timestampValue); + std::string tcbufferWkt = fmt::format("Cbuffer(Point({} {}),{})@{}", + lonValue, latValue, radiusValue, timestampString); + std::string staticGeometryWkt(geometryPtr, geometrySize); + + while (!staticGeometryWkt.empty() && (staticGeometryWkt.front() == '\'' || staticGeometryWkt.front() == '"')) + staticGeometryWkt.erase(staticGeometryWkt.begin()); + while (!staticGeometryWkt.empty() && (staticGeometryWkt.back() == '\'' || staticGeometryWkt.back() == '"')) + staticGeometryWkt.pop_back(); + + if (tcbufferWkt.empty() || staticGeometryWkt.empty()) return 0; + + Temporal* tcbuffer = tcbuffer_in(tcbufferWkt.c_str()); + if (!tcbuffer) return 0; + MEOS::Meos::StaticGeometry staticGeometry(staticGeometryWkt); + if (!staticGeometry.getGeometry()) { free(tcbuffer); return 0; } + + int r = econtains_tcbuffer_geo(tcbuffer, staticGeometry.getGeometry()); + free(tcbuffer); + return r; + } + catch (const std::exception&) + { + return 0; + } }, - lon, lat, radius, ts, wkt); + lon, lat, radius, timestamp, geometry.getContent(), geometry.getContentSize()); return VarVal(result); } @@ -94,11 +114,12 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterE PRECONDITION(arguments.childFunctions.size() == 5, "EcontainsTcbufferGeoPhysicalFunction requires 5 children but got {}", arguments.childFunctions.size()); - return EcontainsTcbufferGeoPhysicalFunction(std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2]), - std::move(arguments.childFunctions[3]), - std::move(arguments.childFunctions[4])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + return EcontainsTcbufferGeoPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EcontainsTcbufferTcbufferPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EcontainsTcbufferTcbufferPhysicalFunction.cpp new file mode 100644 index 0000000000..b934371697 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EcontainsTcbufferTcbufferPhysicalFunction.cpp @@ -0,0 +1,127 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +EcontainsTcbufferTcbufferPhysicalFunction::EcontainsTcbufferTcbufferPhysicalFunction(PhysicalFunction lonAFunction, + PhysicalFunction latAFunction, + PhysicalFunction radiusAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction lonBFunction, + PhysicalFunction latBFunction, + PhysicalFunction radiusBFunction, + PhysicalFunction tsBFunction) +{ + parameterFunctions.reserve(8); + parameterFunctions.push_back(std::move(lonAFunction)); + parameterFunctions.push_back(std::move(latAFunction)); + parameterFunctions.push_back(std::move(radiusAFunction)); + parameterFunctions.push_back(std::move(tsAFunction)); + parameterFunctions.push_back(std::move(lonBFunction)); + parameterFunctions.push_back(std::move(latBFunction)); + parameterFunctions.push_back(std::move(radiusBFunction)); + parameterFunctions.push_back(std::move(tsBFunction)); +} + +VarVal EcontainsTcbufferTcbufferPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto lonA = parameterValues[0].cast>(); + auto latA = parameterValues[1].cast>(); + auto radiusA = parameterValues[2].cast>(); + auto tsA = parameterValues[3].cast>(); + auto lonB = parameterValues[4].cast>(); + auto latB = parameterValues[5].cast>(); + auto radiusB = parameterValues[6].cast>(); + auto tsB = parameterValues[7].cast>(); + + const auto result = nautilus::invoke( + +[](double lonAValue, double latAValue, double radiusAValue, uint64_t tsAValue, + double lonBValue, double latBValue, double radiusBValue, uint64_t tsBValue) -> int { + try + { + MEOS::Meos::ensureMeosInitialized(); + if (!(lonAValue >= -180.0 && lonAValue <= 180.0 && latAValue >= -90.0 && latAValue <= 90.0)) return 0; + if (!(lonBValue >= -180.0 && lonBValue <= 180.0 && latBValue >= -90.0 && latBValue <= 90.0)) return 0; + if (radiusAValue < 0.0 || radiusBValue < 0.0) return 0; + + const std::string tsAString = MEOS::Meos::convertEpochToTimestamp(tsAValue); + const std::string tsBString = MEOS::Meos::convertEpochToTimestamp(tsBValue); + std::string wktA = fmt::format("Cbuffer(Point({} {}),{})@{}", lonAValue, latAValue, radiusAValue, tsAString); + std::string wktB = fmt::format("Cbuffer(Point({} {}),{})@{}", lonBValue, latBValue, radiusBValue, tsBString); + + Temporal* tA = tcbuffer_in(wktA.c_str()); + if (!tA) return 0; + Temporal* tB = tcbuffer_in(wktB.c_str()); + if (!tB) { free(tA); return 0; } + + int r = econtains_tcbuffer_tcbuffer(tA, tB); + free(tA); + free(tB); + return r; + } + catch (const std::exception&) + { + return 0; + } + }, + lonA, latA, radiusA, tsA, lonB, latB, radiusB, tsB); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEcontainsTcbufferTcbufferPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 8, + "EcontainsTcbufferTcbufferPhysicalFunction requires 8 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + auto arg5 = std::move(arguments.childFunctions[5]); + auto arg6 = std::move(arguments.childFunctions[6]); + auto arg7 = std::move(arguments.childFunctions[7]); + return EcontainsTcbufferTcbufferPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6), std::move(arg7)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EcontainsTgeoGeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EcontainsTgeoGeoPhysicalFunction.cpp index 129536b774..a6ccc5a532 100644 --- a/nes-physical-operators/src/Functions/Meos/EcontainsTgeoGeoPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/EcontainsTgeoGeoPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -34,40 +35,75 @@ extern "C" { namespace NES { -EcontainsTgeoGeoPhysicalFunction::EcontainsTgeoGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, - PhysicalFunction ts, PhysicalFunction wkt) +EcontainsTgeoGeoPhysicalFunction::EcontainsTgeoGeoPhysicalFunction(PhysicalFunction lonFunction, + PhysicalFunction latFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction) { - paramFns.reserve(4); - paramFns.push_back(std::move(lon)); - paramFns.push_back(std::move(lat)); - paramFns.push_back(std::move(ts)); - paramFns.push_back(std::move(wkt)); + parameterFunctions.reserve(4); + parameterFunctions.push_back(std::move(lonFunction)); + parameterFunctions.push_back(std::move(latFunction)); + parameterFunctions.push_back(std::move(timestampFunction)); + parameterFunctions.push_back(std::move(geometryFunction)); } VarVal EcontainsTgeoGeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto lon = paramFns[0].execute(record, arena).cast(); - auto lat = paramFns[1].execute(record, arena).cast(); - auto ts = paramFns[2].execute(record, arena).cast(); - auto wkt = paramFns[3].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto lon = parameterValues[0].cast>(); + auto lat = parameterValues[1].cast>(); + auto timestamp = parameterValues[2].cast>(); + auto geometry = parameterValues[3].cast(); const auto result = nautilus::invoke( - +[](double lon, double lat, uint64_t ts, - const char* w, uint32_t wsz) -> double { - try { + +[](double lonValue, + double latValue, + uint64_t timestampValue, + const char* geometryPtr, + uint32_t geometrySize) -> int { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string wktStr(w, wsz); - std::string tgeoWkt = fmt::format("SRID=4326;POINT({},{})@{}", lon, lat, ts); - Temporal* tgeo = tgeompoint_in(tgeoWkt.c_str()); - if (!tgeo) return 0.0; - GSERIALIZED* gs = geom_in(wktStr.c_str(), -1); - if (!gs) { free(tgeo); return 0.0; } - int r = econtains_tgeo_geo(tgeo, gs); - free(tgeo); free(gs); - return r > 0 ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + if (!(lonValue >= -180.0 && lonValue <= 180.0 && latValue >= -90.0 && latValue <= 90.0)) { + return 0; + } + + const std::string timestampString = MEOS::Meos::convertEpochToTimestamp(timestampValue); + std::string temporalGeometryWkt = fmt::format("SRID=4326;Point({} {})@{}", lonValue, latValue, timestampString); + std::string staticGeometryWkt(geometryPtr, geometrySize); + + while (!staticGeometryWkt.empty() && (staticGeometryWkt.front() == '\'' || staticGeometryWkt.front() == '"')) + staticGeometryWkt.erase(staticGeometryWkt.begin()); + while (!staticGeometryWkt.empty() && (staticGeometryWkt.back() == '\'' || staticGeometryWkt.back() == '"')) + staticGeometryWkt.pop_back(); + + if (temporalGeometryWkt.empty() || staticGeometryWkt.empty()) + return 0; + + MEOS::Meos::TemporalGeometry temporalGeometry(temporalGeometryWkt); + if (!temporalGeometry.getGeometry()) return 0; + MEOS::Meos::StaticGeometry staticGeometry(staticGeometryWkt); + if (!staticGeometry.getGeometry()) return 0; + + // MEOS spatial-relation call — same shape as TemporalEDWithin's + // edwithin_tgeo_geo, but specific MEOS function per generated operator. + // Real MEOS spatial-rel signature: int fn(const Temporal *, const GSERIALIZED *) + // (no `atstart` flag — that's specific to geog_dwithin / edwithin's 3-arg variant). + return econtains_tgeo_geo(temporalGeometry.getGeometry(), + staticGeometry.getGeometry()); + } + catch (const std::exception&) + { + return 0; + } }, - lon, lat, ts, wkt); + lon, lat, timestamp, geometry.getContent(), geometry.getContentSize()); return VarVal(result); } @@ -78,10 +114,11 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterE PRECONDITION(arguments.childFunctions.size() == 4, "EcontainsTgeoGeoPhysicalFunction requires 4 children but got {}", arguments.childFunctions.size()); - return EcontainsTgeoGeoPhysicalFunction(std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2]), - std::move(arguments.childFunctions[3])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + return EcontainsTgeoGeoPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EcontainsTgeoTgeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EcontainsTgeoTgeoPhysicalFunction.cpp index 5ca82ffa6d..8f3fc541fb 100644 --- a/nes-physical-operators/src/Functions/Meos/EcontainsTgeoTgeoPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/EcontainsTgeoTgeoPhysicalFunction.cpp @@ -13,10 +13,10 @@ */ #include + #include #include #include -#include #include #include #include @@ -34,42 +34,68 @@ extern "C" { namespace NES { -EcontainsTgeoTgeoPhysicalFunction::EcontainsTgeoTgeoPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction ts1, PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction ts2) +EcontainsTgeoTgeoPhysicalFunction::EcontainsTgeoTgeoPhysicalFunction(PhysicalFunction lonAFunction, + PhysicalFunction latAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction lonBFunction, + PhysicalFunction latBFunction, + PhysicalFunction tsBFunction) { - paramFns.reserve(6); - paramFns.push_back(std::move(lon1)); - paramFns.push_back(std::move(lat1)); - paramFns.push_back(std::move(ts1)); - paramFns.push_back(std::move(lon2)); - paramFns.push_back(std::move(lat2)); - paramFns.push_back(std::move(ts2)); + parameterFunctions.reserve(6); + parameterFunctions.push_back(std::move(lonAFunction)); + parameterFunctions.push_back(std::move(latAFunction)); + parameterFunctions.push_back(std::move(tsAFunction)); + parameterFunctions.push_back(std::move(lonBFunction)); + parameterFunctions.push_back(std::move(latBFunction)); + parameterFunctions.push_back(std::move(tsBFunction)); } VarVal EcontainsTgeoTgeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto lon1 = paramFns[0].execute(record, arena).cast(); - auto lat1 = paramFns[1].execute(record, arena).cast(); - auto ts1 = paramFns[2].execute(record, arena).cast(); - auto lon2 = paramFns[3].execute(record, arena).cast(); - auto lat2 = paramFns[4].execute(record, arena).cast(); - auto ts2 = paramFns[5].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto lonA = parameterValues[0].cast>(); + auto latA = parameterValues[1].cast>(); + auto tsA = parameterValues[2].cast>(); + auto lonB = parameterValues[3].cast>(); + auto latB = parameterValues[4].cast>(); + auto tsB = parameterValues[5].cast>(); + const auto result = nautilus::invoke( - +[](double lon1, double lat1, uint64_t ts1, - double lon2, double lat2, uint64_t ts2) -> double { - try { + +[](double lonAValue, double latAValue, uint64_t tsAValue, + double lonBValue, double latBValue, uint64_t tsBValue) -> int { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string wkt1 = fmt::format("SRID=4326;POINT({},{})@{}", lon1, lat1, ts1); - Temporal* t1 = tgeompoint_in(wkt1.c_str()); - if (!t1) return 0.0; - std::string wkt2 = fmt::format("SRID=4326;POINT({},{})@{}", lon2, lat2, ts2); - Temporal* t2 = tgeompoint_in(wkt2.c_str()); - if (!t2) { free(t1); return 0.0; } - int r = econtains_tgeo_tgeo(t1, t2); - free(t1); free(t2); - return r > 0 ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + if (!(lonAValue >= -180.0 && lonAValue <= 180.0 && latAValue >= -90.0 && latAValue <= 90.0)) return 0; + if (!(lonBValue >= -180.0 && lonBValue <= 180.0 && latBValue >= -90.0 && latBValue <= 90.0)) return 0; + + const std::string tsAString = MEOS::Meos::convertEpochToTimestamp(tsAValue); + const std::string tsBString = MEOS::Meos::convertEpochToTimestamp(tsBValue); + std::string temporalGeometryAWkt = fmt::format("SRID=4326;Point({} {})@{}", lonAValue, latAValue, tsAString); + std::string temporalGeometryBWkt = fmt::format("SRID=4326;Point({} {})@{}", lonBValue, latBValue, tsBString); + + MEOS::Meos::TemporalGeometry temporalGeometryA(temporalGeometryAWkt); + if (!temporalGeometryA.getGeometry()) return 0; + MEOS::Meos::TemporalGeometry temporalGeometryB(temporalGeometryBWkt); + if (!temporalGeometryB.getGeometry()) return 0; + + // MEOS *_tgeo_tgeo spatial-relation: int fn(const Temporal*, const Temporal*). + return econtains_tgeo_tgeo(temporalGeometryA.getGeometry(), + temporalGeometryB.getGeometry()); + } + catch (const std::exception&) + { + return 0; + } }, - lon1, lat1, ts1, lon2, lat2, ts2); + lonA, latA, tsA, lonB, latB, tsB); + return VarVal(result); } @@ -79,13 +105,13 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterE PRECONDITION(arguments.childFunctions.size() == 6, "EcontainsTgeoTgeoPhysicalFunction requires 6 children but got {}", arguments.childFunctions.size()); - return EcontainsTgeoTgeoPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2]), - std::move(arguments.childFunctions[3]), - std::move(arguments.childFunctions[4]), - std::move(arguments.childFunctions[5])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + auto arg5 = std::move(arguments.childFunctions[5]); + return EcontainsTgeoTgeoPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EcoversGeoTrgeometryPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EcoversGeoTrgeometryPhysicalFunction.cpp new file mode 100644 index 0000000000..2f7eebcbfa --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EcoversGeoTrgeometryPhysicalFunction.cpp @@ -0,0 +1,97 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +#include +} + +namespace NES { + +EcoversGeoTrgeometryPhysicalFunction::EcoversGeoTrgeometryPhysicalFunction(PhysicalFunction tgt_wkt, PhysicalFunction ref_wkt, PhysicalFunction x1, PhysicalFunction y1, PhysicalFunction theta1, PhysicalFunction ts1) { + paramFns.reserve(6); + paramFns.push_back(std::move(tgt_wkt)); + paramFns.push_back(std::move(ref_wkt)); + paramFns.push_back(std::move(x1)); + paramFns.push_back(std::move(y1)); + paramFns.push_back(std::move(theta1)); + paramFns.push_back(std::move(ts1)); +} + +VarVal EcoversGeoTrgeometryPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { + auto tgt_wkt = paramFns[0].execute(record, arena).cast(); + auto ref_wkt = paramFns[1].execute(record, arena).cast(); + auto x1 = paramFns[2].execute(record, arena).cast(); + auto y1 = paramFns[3].execute(record, arena).cast(); + auto theta1 = paramFns[4].execute(record, arena).cast(); + auto ts1 = paramFns[5].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](const char* tgt_wkt, uint32_t tgt_wktsz, const char* ref_wkt, uint32_t ref_wktsz, double x1, double y1, double theta1, uint64_t ts1) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + char* ref1_str = (char*)malloc(ref_wktsz + 1); + memcpy(ref1_str, ref_wkt, ref_wktsz); ref1_str[ref_wktsz] = '\0'; + GSERIALIZED* gref1 = geom_in(ref1_str, -1); free(ref1_str); + if (!gref1) return 0.0; + Pose* pose1 = pose_make_2d(x1, y1, theta1, false, 0); + if (!pose1) { free(gref1); return 0.0; } + TInstant* inst1 = trgeometryinst_make(gref1, pose1, (TimestampTz)ts1); + free(gref1); free(pose1); + if (!inst1) return 0.0; + char* tgt_str = (char*)malloc(tgt_wktsz + 1); + memcpy(tgt_str, tgt_wkt, tgt_wktsz); tgt_str[tgt_wktsz] = '\0'; + GSERIALIZED* gs_tgt = geom_in(tgt_str, -1); free(tgt_str); + if (!gs_tgt) { free(inst1); return 0.0; } + int r = ecovers_geo_trgeometry(gs_tgt, (Temporal*)inst1); + free(inst1); free(gs_tgt); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + tgt_wkt, ref_wkt, x1, y1, theta1, ts1); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEcoversGeoTrgeometryPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size()==6, + "EcoversGeoTrgeometryPhysicalFunction requires 6 children but got {}", + arguments.childFunctions.size()); + return EcoversGeoTrgeometryPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4]), + std::move(arguments.childFunctions[5])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EcoversTcbufferGeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EcoversTcbufferGeoPhysicalFunction.cpp index ddea00a297..2071c9cf99 100644 --- a/nes-physical-operators/src/Functions/Meos/EcoversTcbufferGeoPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/EcoversTcbufferGeoPhysicalFunction.cpp @@ -13,77 +13,97 @@ */ #include + #include #include #include +#include #include #include #include #include +#include #include +#include #include #include -#include -#include -#include extern "C" { #include -#include #include } namespace NES { -EcoversTcbufferGeoPhysicalFunction::EcoversTcbufferGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, - PhysicalFunction radius, PhysicalFunction ts, - PhysicalFunction wkt) +EcoversTcbufferGeoPhysicalFunction::EcoversTcbufferGeoPhysicalFunction(PhysicalFunction lonFunction, + PhysicalFunction latFunction, + PhysicalFunction radiusFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction) { - paramFns.reserve(5); - paramFns.push_back(std::move(lon)); - paramFns.push_back(std::move(lat)); - paramFns.push_back(std::move(radius)); - paramFns.push_back(std::move(ts)); - paramFns.push_back(std::move(wkt)); + parameterFunctions.reserve(5); + parameterFunctions.push_back(std::move(lonFunction)); + parameterFunctions.push_back(std::move(latFunction)); + parameterFunctions.push_back(std::move(radiusFunction)); + parameterFunctions.push_back(std::move(timestampFunction)); + parameterFunctions.push_back(std::move(geometryFunction)); } VarVal EcoversTcbufferGeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto lon = paramFns[0].execute(record, arena).cast(); - auto lat = paramFns[1].execute(record, arena).cast(); - auto radius = paramFns[2].execute(record, arena).cast(); - auto ts = paramFns[3].execute(record, arena).cast(); - auto wkt = paramFns[4].execute(record, arena); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto lon = parameterValues[0].cast>(); + auto lat = parameterValues[1].cast>(); + auto radius = parameterValues[2].cast>(); + auto timestamp = parameterValues[3].cast>(); + auto geometry = parameterValues[4].cast(); const auto result = nautilus::invoke( - +[](double lon, double lat, double radius, uint64_t ts, - const char* wkt, uint32_t wkt_len) -> double { - try { + +[](double lonValue, + double latValue, + double radiusValue, + uint64_t timestampValue, + const char* geometryPtr, + uint32_t geometrySize) -> int { + try + { MEOS::Meos::ensureMeosInitialized(); - // Build tcbuffer instant: point + radius → cbuffer → instant - std::string pt_str = fmt::format("POINT({} {})", lon, lat); - GSERIALIZED* pt_gs = geom_in(pt_str.c_str(), -1); - if (!pt_gs) return 0.0; - Cbuffer* cb = cbuffer_make(pt_gs, radius); - free(pt_gs); - if (!cb) return 0.0; - Temporal* tcb_inst = (Temporal*)tcbufferinst_make(cb, (TimestampTz)ts); - free(cb); - if (!tcb_inst) return 0.0; - // Build target geometry from null-terminated WKT copy - char* wkt_str = (char*)malloc(wkt_len + 1); - memcpy(wkt_str, wkt, wkt_len); - wkt_str[wkt_len] = '\0'; - GSERIALIZED* target_gs = geom_in(wkt_str, -1); - free(wkt_str); - if (!target_gs) { free(tcb_inst); return 0.0; } - int r = ecovers_tcbuffer_geo(tcb_inst, target_gs); - free(tcb_inst); - free(target_gs); - return r > 0 ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + if (!(lonValue >= -180.0 && lonValue <= 180.0 && latValue >= -90.0 && latValue <= 90.0)) return 0; + if (radiusValue < 0.0) return 0; + + const std::string timestampString = MEOS::Meos::convertEpochToTimestamp(timestampValue); + std::string tcbufferWkt = fmt::format("Cbuffer(Point({} {}),{})@{}", + lonValue, latValue, radiusValue, timestampString); + std::string staticGeometryWkt(geometryPtr, geometrySize); + + while (!staticGeometryWkt.empty() && (staticGeometryWkt.front() == '\'' || staticGeometryWkt.front() == '"')) + staticGeometryWkt.erase(staticGeometryWkt.begin()); + while (!staticGeometryWkt.empty() && (staticGeometryWkt.back() == '\'' || staticGeometryWkt.back() == '"')) + staticGeometryWkt.pop_back(); + + if (tcbufferWkt.empty() || staticGeometryWkt.empty()) return 0; + + Temporal* tcbuffer = tcbuffer_in(tcbufferWkt.c_str()); + if (!tcbuffer) return 0; + MEOS::Meos::StaticGeometry staticGeometry(staticGeometryWkt); + if (!staticGeometry.getGeometry()) { free(tcbuffer); return 0; } + + int r = ecovers_tcbuffer_geo(tcbuffer, staticGeometry.getGeometry()); + free(tcbuffer); + return r; + } + catch (const std::exception&) + { + return 0; + } }, - lon, lat, radius, ts, wkt); + lon, lat, radius, timestamp, geometry.getContent(), geometry.getContentSize()); return VarVal(result); } @@ -94,11 +114,12 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterE PRECONDITION(arguments.childFunctions.size() == 5, "EcoversTcbufferGeoPhysicalFunction requires 5 children but got {}", arguments.childFunctions.size()); - return EcoversTcbufferGeoPhysicalFunction(std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2]), - std::move(arguments.childFunctions[3]), - std::move(arguments.childFunctions[4])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + return EcoversTcbufferGeoPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EcoversTcbufferTcbufferPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EcoversTcbufferTcbufferPhysicalFunction.cpp index 7aac08ea8c..b00bb5025a 100644 --- a/nes-physical-operators/src/Functions/Meos/EcoversTcbufferTcbufferPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/EcoversTcbufferTcbufferPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -20,75 +21,88 @@ #include #include #include +#include #include +#include #include #include -#include -#include extern "C" { #include -#include #include } namespace NES { -EcoversTcbufferTcbufferPhysicalFunction::EcoversTcbufferTcbufferPhysicalFunction( - PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction r1, PhysicalFunction ts1, - PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction r2, PhysicalFunction ts2) +EcoversTcbufferTcbufferPhysicalFunction::EcoversTcbufferTcbufferPhysicalFunction(PhysicalFunction lonAFunction, + PhysicalFunction latAFunction, + PhysicalFunction radiusAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction lonBFunction, + PhysicalFunction latBFunction, + PhysicalFunction radiusBFunction, + PhysicalFunction tsBFunction) { - paramFns.reserve(8); - paramFns.push_back(std::move(lon1)); - paramFns.push_back(std::move(lat1)); - paramFns.push_back(std::move(r1)); - paramFns.push_back(std::move(ts1)); - paramFns.push_back(std::move(lon2)); - paramFns.push_back(std::move(lat2)); - paramFns.push_back(std::move(r2)); - paramFns.push_back(std::move(ts2)); + parameterFunctions.reserve(8); + parameterFunctions.push_back(std::move(lonAFunction)); + parameterFunctions.push_back(std::move(latAFunction)); + parameterFunctions.push_back(std::move(radiusAFunction)); + parameterFunctions.push_back(std::move(tsAFunction)); + parameterFunctions.push_back(std::move(lonBFunction)); + parameterFunctions.push_back(std::move(latBFunction)); + parameterFunctions.push_back(std::move(radiusBFunction)); + parameterFunctions.push_back(std::move(tsBFunction)); } VarVal EcoversTcbufferTcbufferPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto lon1 = paramFns[0].execute(record, arena).cast(); - auto lat1 = paramFns[1].execute(record, arena).cast(); - auto r1 = paramFns[2].execute(record, arena).cast(); - auto ts1 = paramFns[3].execute(record, arena).cast(); - auto lon2 = paramFns[4].execute(record, arena).cast(); - auto lat2 = paramFns[5].execute(record, arena).cast(); - auto r2 = paramFns[6].execute(record, arena).cast(); - auto ts2 = paramFns[7].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto lonA = parameterValues[0].cast>(); + auto latA = parameterValues[1].cast>(); + auto radiusA = parameterValues[2].cast>(); + auto tsA = parameterValues[3].cast>(); + auto lonB = parameterValues[4].cast>(); + auto latB = parameterValues[5].cast>(); + auto radiusB = parameterValues[6].cast>(); + auto tsB = parameterValues[7].cast>(); const auto result = nautilus::invoke( - +[](double lon1, double lat1, double r1, uint64_t ts1, - double lon2, double lat2, double r2, uint64_t ts2) -> double { - try { + +[](double lonAValue, double latAValue, double radiusAValue, uint64_t tsAValue, + double lonBValue, double latBValue, double radiusBValue, uint64_t tsBValue) -> int { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string pt1 = fmt::format("POINT({} {})", lon1, lat1); - GSERIALIZED* gs1 = geom_in(pt1.c_str(), -1); - if (!gs1) return 0.0; - Cbuffer* cb1 = cbuffer_make(gs1, r1); - free(gs1); - if (!cb1) return 0.0; - Temporal* tcb1 = (Temporal*)tcbufferinst_make(cb1, (TimestampTz)ts1); - free(cb1); - if (!tcb1) return 0.0; - std::string pt2 = fmt::format("POINT({} {})", lon2, lat2); - GSERIALIZED* gs2 = geom_in(pt2.c_str(), -1); - if (!gs2) { free(tcb1); return 0.0; } - Cbuffer* cb2 = cbuffer_make(gs2, r2); - free(gs2); - if (!cb2) { free(tcb1); return 0.0; } - Temporal* tcb2 = (Temporal*)tcbufferinst_make(cb2, (TimestampTz)ts2); - free(cb2); - if (!tcb2) { free(tcb1); return 0.0; } - int r = ecovers_tcbuffer_tcbuffer(tcb1, tcb2); - free(tcb1); free(tcb2); - return r > 0 ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + if (!(lonAValue >= -180.0 && lonAValue <= 180.0 && latAValue >= -90.0 && latAValue <= 90.0)) return 0; + if (!(lonBValue >= -180.0 && lonBValue <= 180.0 && latBValue >= -90.0 && latBValue <= 90.0)) return 0; + if (radiusAValue < 0.0 || radiusBValue < 0.0) return 0; + + const std::string tsAString = MEOS::Meos::convertEpochToTimestamp(tsAValue); + const std::string tsBString = MEOS::Meos::convertEpochToTimestamp(tsBValue); + std::string wktA = fmt::format("Cbuffer(Point({} {}),{})@{}", lonAValue, latAValue, radiusAValue, tsAString); + std::string wktB = fmt::format("Cbuffer(Point({} {}),{})@{}", lonBValue, latBValue, radiusBValue, tsBString); + + Temporal* tA = tcbuffer_in(wktA.c_str()); + if (!tA) return 0; + Temporal* tB = tcbuffer_in(wktB.c_str()); + if (!tB) { free(tA); return 0; } + + int r = ecovers_tcbuffer_tcbuffer(tA, tB); + free(tA); + free(tB); + return r; + } + catch (const std::exception&) + { + return 0; + } }, - lon1, lat1, r1, ts1, lon2, lat2, r2, ts2); + lonA, latA, radiusA, tsA, lonB, latB, radiusB, tsB); return VarVal(result); } @@ -99,14 +113,15 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterE PRECONDITION(arguments.childFunctions.size() == 8, "EcoversTcbufferTcbufferPhysicalFunction requires 8 children but got {}", arguments.childFunctions.size()); - return EcoversTcbufferTcbufferPhysicalFunction(std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2]), - std::move(arguments.childFunctions[3]), - std::move(arguments.childFunctions[4]), - std::move(arguments.childFunctions[5]), - std::move(arguments.childFunctions[6]), - std::move(arguments.childFunctions[7])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + auto arg5 = std::move(arguments.childFunctions[5]); + auto arg6 = std::move(arguments.childFunctions[6]); + auto arg7 = std::move(arguments.childFunctions[7]); + return EcoversTcbufferTcbufferPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6), std::move(arg7)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EcoversTgeoGeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EcoversTgeoGeoPhysicalFunction.cpp new file mode 100644 index 0000000000..75eddcdbc7 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EcoversTgeoGeoPhysicalFunction.cpp @@ -0,0 +1,124 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +EcoversTgeoGeoPhysicalFunction::EcoversTgeoGeoPhysicalFunction(PhysicalFunction lonFunction, + PhysicalFunction latFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction) +{ + parameterFunctions.reserve(4); + parameterFunctions.push_back(std::move(lonFunction)); + parameterFunctions.push_back(std::move(latFunction)); + parameterFunctions.push_back(std::move(timestampFunction)); + parameterFunctions.push_back(std::move(geometryFunction)); +} + +VarVal EcoversTgeoGeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto lon = parameterValues[0].cast>(); + auto lat = parameterValues[1].cast>(); + auto timestamp = parameterValues[2].cast>(); + auto geometry = parameterValues[3].cast(); + + const auto result = nautilus::invoke( + +[](double lonValue, + double latValue, + uint64_t timestampValue, + const char* geometryPtr, + uint32_t geometrySize) -> int { + try + { + MEOS::Meos::ensureMeosInitialized(); + if (!(lonValue >= -180.0 && lonValue <= 180.0 && latValue >= -90.0 && latValue <= 90.0)) { + return 0; + } + + const std::string timestampString = MEOS::Meos::convertEpochToTimestamp(timestampValue); + std::string temporalGeometryWkt = fmt::format("SRID=4326;Point({} {})@{}", lonValue, latValue, timestampString); + std::string staticGeometryWkt(geometryPtr, geometrySize); + + while (!staticGeometryWkt.empty() && (staticGeometryWkt.front() == '\'' || staticGeometryWkt.front() == '"')) + staticGeometryWkt.erase(staticGeometryWkt.begin()); + while (!staticGeometryWkt.empty() && (staticGeometryWkt.back() == '\'' || staticGeometryWkt.back() == '"')) + staticGeometryWkt.pop_back(); + + if (temporalGeometryWkt.empty() || staticGeometryWkt.empty()) + return 0; + + MEOS::Meos::TemporalGeometry temporalGeometry(temporalGeometryWkt); + if (!temporalGeometry.getGeometry()) return 0; + MEOS::Meos::StaticGeometry staticGeometry(staticGeometryWkt); + if (!staticGeometry.getGeometry()) return 0; + + // MEOS spatial-relation call — same shape as TemporalEDWithin's + // edwithin_tgeo_geo, but specific MEOS function per generated operator. + // Real MEOS spatial-rel signature: int fn(const Temporal *, const GSERIALIZED *) + // (no `atstart` flag — that's specific to geog_dwithin / edwithin's 3-arg variant). + return ecovers_tgeo_geo(temporalGeometry.getGeometry(), + staticGeometry.getGeometry()); + } + catch (const std::exception&) + { + return 0; + } + }, + lon, lat, timestamp, geometry.getContent(), geometry.getContentSize()); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEcoversTgeoGeoPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 4, + "EcoversTgeoGeoPhysicalFunction requires 4 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + return EcoversTgeoGeoPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EcoversTgeoTgeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EcoversTgeoTgeoPhysicalFunction.cpp index dd35059bc7..8ef0298018 100644 --- a/nes-physical-operators/src/Functions/Meos/EcoversTgeoTgeoPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/EcoversTgeoTgeoPhysicalFunction.cpp @@ -13,10 +13,10 @@ */ #include + #include #include #include -#include #include #include #include @@ -34,42 +34,68 @@ extern "C" { namespace NES { -EcoversTgeoTgeoPhysicalFunction::EcoversTgeoTgeoPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction ts1, PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction ts2) +EcoversTgeoTgeoPhysicalFunction::EcoversTgeoTgeoPhysicalFunction(PhysicalFunction lonAFunction, + PhysicalFunction latAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction lonBFunction, + PhysicalFunction latBFunction, + PhysicalFunction tsBFunction) { - paramFns.reserve(6); - paramFns.push_back(std::move(lon1)); - paramFns.push_back(std::move(lat1)); - paramFns.push_back(std::move(ts1)); - paramFns.push_back(std::move(lon2)); - paramFns.push_back(std::move(lat2)); - paramFns.push_back(std::move(ts2)); + parameterFunctions.reserve(6); + parameterFunctions.push_back(std::move(lonAFunction)); + parameterFunctions.push_back(std::move(latAFunction)); + parameterFunctions.push_back(std::move(tsAFunction)); + parameterFunctions.push_back(std::move(lonBFunction)); + parameterFunctions.push_back(std::move(latBFunction)); + parameterFunctions.push_back(std::move(tsBFunction)); } VarVal EcoversTgeoTgeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto lon1 = paramFns[0].execute(record, arena).cast(); - auto lat1 = paramFns[1].execute(record, arena).cast(); - auto ts1 = paramFns[2].execute(record, arena).cast(); - auto lon2 = paramFns[3].execute(record, arena).cast(); - auto lat2 = paramFns[4].execute(record, arena).cast(); - auto ts2 = paramFns[5].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto lonA = parameterValues[0].cast>(); + auto latA = parameterValues[1].cast>(); + auto tsA = parameterValues[2].cast>(); + auto lonB = parameterValues[3].cast>(); + auto latB = parameterValues[4].cast>(); + auto tsB = parameterValues[5].cast>(); + const auto result = nautilus::invoke( - +[](double lon1, double lat1, uint64_t ts1, - double lon2, double lat2, uint64_t ts2) -> double { - try { + +[](double lonAValue, double latAValue, uint64_t tsAValue, + double lonBValue, double latBValue, uint64_t tsBValue) -> int { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string wkt1 = fmt::format("SRID=4326;POINT({},{})@{}", lon1, lat1, ts1); - Temporal* t1 = tgeompoint_in(wkt1.c_str()); - if (!t1) return 0.0; - std::string wkt2 = fmt::format("SRID=4326;POINT({},{})@{}", lon2, lat2, ts2); - Temporal* t2 = tgeompoint_in(wkt2.c_str()); - if (!t2) { free(t1); return 0.0; } - int r = ecovers_tgeo_tgeo(t1, t2); - free(t1); free(t2); - return r > 0 ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + if (!(lonAValue >= -180.0 && lonAValue <= 180.0 && latAValue >= -90.0 && latAValue <= 90.0)) return 0; + if (!(lonBValue >= -180.0 && lonBValue <= 180.0 && latBValue >= -90.0 && latBValue <= 90.0)) return 0; + + const std::string tsAString = MEOS::Meos::convertEpochToTimestamp(tsAValue); + const std::string tsBString = MEOS::Meos::convertEpochToTimestamp(tsBValue); + std::string temporalGeometryAWkt = fmt::format("SRID=4326;Point({} {})@{}", lonAValue, latAValue, tsAString); + std::string temporalGeometryBWkt = fmt::format("SRID=4326;Point({} {})@{}", lonBValue, latBValue, tsBString); + + MEOS::Meos::TemporalGeometry temporalGeometryA(temporalGeometryAWkt); + if (!temporalGeometryA.getGeometry()) return 0; + MEOS::Meos::TemporalGeometry temporalGeometryB(temporalGeometryBWkt); + if (!temporalGeometryB.getGeometry()) return 0; + + // MEOS *_tgeo_tgeo spatial-relation: int fn(const Temporal*, const Temporal*). + return ecovers_tgeo_tgeo(temporalGeometryA.getGeometry(), + temporalGeometryB.getGeometry()); + } + catch (const std::exception&) + { + return 0; + } }, - lon1, lat1, ts1, lon2, lat2, ts2); + lonA, latA, tsA, lonB, latB, tsB); + return VarVal(result); } @@ -79,13 +105,13 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterE PRECONDITION(arguments.childFunctions.size() == 6, "EcoversTgeoTgeoPhysicalFunction requires 6 children but got {}", arguments.childFunctions.size()); - return EcoversTgeoTgeoPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2]), - std::move(arguments.childFunctions[3]), - std::move(arguments.childFunctions[4]), - std::move(arguments.childFunctions[5])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + auto arg5 = std::move(arguments.childFunctions[5]); + return EcoversTgeoTgeoPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EcoversTrgeometryGeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EcoversTrgeometryGeoPhysicalFunction.cpp new file mode 100644 index 0000000000..c1e7089166 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EcoversTrgeometryGeoPhysicalFunction.cpp @@ -0,0 +1,97 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +#include +} + +namespace NES { + +EcoversTrgeometryGeoPhysicalFunction::EcoversTrgeometryGeoPhysicalFunction(PhysicalFunction ref_wkt, PhysicalFunction x1, PhysicalFunction y1, PhysicalFunction theta1, PhysicalFunction ts1, PhysicalFunction tgt_wkt) { + paramFns.reserve(6); + paramFns.push_back(std::move(ref_wkt)); + paramFns.push_back(std::move(x1)); + paramFns.push_back(std::move(y1)); + paramFns.push_back(std::move(theta1)); + paramFns.push_back(std::move(ts1)); + paramFns.push_back(std::move(tgt_wkt)); +} + +VarVal EcoversTrgeometryGeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { + auto ref_wkt = paramFns[0].execute(record, arena).cast(); + auto x1 = paramFns[1].execute(record, arena).cast(); + auto y1 = paramFns[2].execute(record, arena).cast(); + auto theta1 = paramFns[3].execute(record, arena).cast(); + auto ts1 = paramFns[4].execute(record, arena).cast(); + auto tgt_wkt = paramFns[5].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](const char* ref_wkt, uint32_t ref_wktsz, double x1, double y1, double theta1, uint64_t ts1, const char* tgt_wkt, uint32_t tgt_wktsz) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + char* ref1_str = (char*)malloc(ref_wktsz + 1); + memcpy(ref1_str, ref_wkt, ref_wktsz); ref1_str[ref_wktsz] = '\0'; + GSERIALIZED* gref1 = geom_in(ref1_str, -1); free(ref1_str); + if (!gref1) return 0.0; + Pose* pose1 = pose_make_2d(x1, y1, theta1, false, 0); + if (!pose1) { free(gref1); return 0.0; } + TInstant* inst1 = trgeometryinst_make(gref1, pose1, (TimestampTz)ts1); + free(gref1); free(pose1); + if (!inst1) return 0.0; + char* tgt_str = (char*)malloc(tgt_wktsz + 1); + memcpy(tgt_str, tgt_wkt, tgt_wktsz); tgt_str[tgt_wktsz] = '\0'; + GSERIALIZED* gs_tgt = geom_in(tgt_str, -1); free(tgt_str); + if (!gs_tgt) { free(inst1); return 0.0; } + int r = ecovers_trgeometry_geo((Temporal*)inst1, gs_tgt); + free(inst1); free(gs_tgt); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + ref_wkt, x1, y1, theta1, ts1, tgt_wkt); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEcoversTrgeometryGeoPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size()==6, + "EcoversTrgeometryGeoPhysicalFunction requires 6 children but got {}", + arguments.childFunctions.size()); + return EcoversTrgeometryGeoPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4]), + std::move(arguments.childFunctions[5])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EdisjointTcbufferGeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EdisjointTcbufferGeoPhysicalFunction.cpp index ef4bf0993c..3ef325e1fa 100644 --- a/nes-physical-operators/src/Functions/Meos/EdisjointTcbufferGeoPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/EdisjointTcbufferGeoPhysicalFunction.cpp @@ -13,77 +13,97 @@ */ #include + #include #include #include +#include #include #include #include #include +#include #include +#include #include #include -#include -#include -#include extern "C" { #include -#include #include } namespace NES { -EdisjointTcbufferGeoPhysicalFunction::EdisjointTcbufferGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, - PhysicalFunction radius, PhysicalFunction ts, - PhysicalFunction wkt) +EdisjointTcbufferGeoPhysicalFunction::EdisjointTcbufferGeoPhysicalFunction(PhysicalFunction lonFunction, + PhysicalFunction latFunction, + PhysicalFunction radiusFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction) { - paramFns.reserve(5); - paramFns.push_back(std::move(lon)); - paramFns.push_back(std::move(lat)); - paramFns.push_back(std::move(radius)); - paramFns.push_back(std::move(ts)); - paramFns.push_back(std::move(wkt)); + parameterFunctions.reserve(5); + parameterFunctions.push_back(std::move(lonFunction)); + parameterFunctions.push_back(std::move(latFunction)); + parameterFunctions.push_back(std::move(radiusFunction)); + parameterFunctions.push_back(std::move(timestampFunction)); + parameterFunctions.push_back(std::move(geometryFunction)); } VarVal EdisjointTcbufferGeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto lon = paramFns[0].execute(record, arena).cast(); - auto lat = paramFns[1].execute(record, arena).cast(); - auto radius = paramFns[2].execute(record, arena).cast(); - auto ts = paramFns[3].execute(record, arena).cast(); - auto wkt = paramFns[4].execute(record, arena); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto lon = parameterValues[0].cast>(); + auto lat = parameterValues[1].cast>(); + auto radius = parameterValues[2].cast>(); + auto timestamp = parameterValues[3].cast>(); + auto geometry = parameterValues[4].cast(); const auto result = nautilus::invoke( - +[](double lon, double lat, double radius, uint64_t ts, - const char* wkt, uint32_t wkt_len) -> double { - try { + +[](double lonValue, + double latValue, + double radiusValue, + uint64_t timestampValue, + const char* geometryPtr, + uint32_t geometrySize) -> int { + try + { MEOS::Meos::ensureMeosInitialized(); - // Build tcbuffer instant: point + radius → cbuffer → instant - std::string pt_str = fmt::format("POINT({} {})", lon, lat); - GSERIALIZED* pt_gs = geom_in(pt_str.c_str(), -1); - if (!pt_gs) return 0.0; - Cbuffer* cb = cbuffer_make(pt_gs, radius); - free(pt_gs); - if (!cb) return 0.0; - Temporal* tcb_inst = (Temporal*)tcbufferinst_make(cb, (TimestampTz)ts); - free(cb); - if (!tcb_inst) return 0.0; - // Build target geometry from null-terminated WKT copy - char* wkt_str = (char*)malloc(wkt_len + 1); - memcpy(wkt_str, wkt, wkt_len); - wkt_str[wkt_len] = '\0'; - GSERIALIZED* target_gs = geom_in(wkt_str, -1); - free(wkt_str); - if (!target_gs) { free(tcb_inst); return 0.0; } - int r = edisjoint_tcbuffer_geo(tcb_inst, target_gs); - free(tcb_inst); - free(target_gs); - return r > 0 ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + if (!(lonValue >= -180.0 && lonValue <= 180.0 && latValue >= -90.0 && latValue <= 90.0)) return 0; + if (radiusValue < 0.0) return 0; + + const std::string timestampString = MEOS::Meos::convertEpochToTimestamp(timestampValue); + std::string tcbufferWkt = fmt::format("Cbuffer(Point({} {}),{})@{}", + lonValue, latValue, radiusValue, timestampString); + std::string staticGeometryWkt(geometryPtr, geometrySize); + + while (!staticGeometryWkt.empty() && (staticGeometryWkt.front() == '\'' || staticGeometryWkt.front() == '"')) + staticGeometryWkt.erase(staticGeometryWkt.begin()); + while (!staticGeometryWkt.empty() && (staticGeometryWkt.back() == '\'' || staticGeometryWkt.back() == '"')) + staticGeometryWkt.pop_back(); + + if (tcbufferWkt.empty() || staticGeometryWkt.empty()) return 0; + + Temporal* tcbuffer = tcbuffer_in(tcbufferWkt.c_str()); + if (!tcbuffer) return 0; + MEOS::Meos::StaticGeometry staticGeometry(staticGeometryWkt); + if (!staticGeometry.getGeometry()) { free(tcbuffer); return 0; } + + int r = edisjoint_tcbuffer_geo(tcbuffer, staticGeometry.getGeometry()); + free(tcbuffer); + return r; + } + catch (const std::exception&) + { + return 0; + } }, - lon, lat, radius, ts, wkt); + lon, lat, radius, timestamp, geometry.getContent(), geometry.getContentSize()); return VarVal(result); } @@ -94,11 +114,12 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterE PRECONDITION(arguments.childFunctions.size() == 5, "EdisjointTcbufferGeoPhysicalFunction requires 5 children but got {}", arguments.childFunctions.size()); - return EdisjointTcbufferGeoPhysicalFunction(std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2]), - std::move(arguments.childFunctions[3]), - std::move(arguments.childFunctions[4])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + return EdisjointTcbufferGeoPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EdisjointTcbufferTcbufferPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EdisjointTcbufferTcbufferPhysicalFunction.cpp new file mode 100644 index 0000000000..aac64482f5 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EdisjointTcbufferTcbufferPhysicalFunction.cpp @@ -0,0 +1,127 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +EdisjointTcbufferTcbufferPhysicalFunction::EdisjointTcbufferTcbufferPhysicalFunction(PhysicalFunction lonAFunction, + PhysicalFunction latAFunction, + PhysicalFunction radiusAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction lonBFunction, + PhysicalFunction latBFunction, + PhysicalFunction radiusBFunction, + PhysicalFunction tsBFunction) +{ + parameterFunctions.reserve(8); + parameterFunctions.push_back(std::move(lonAFunction)); + parameterFunctions.push_back(std::move(latAFunction)); + parameterFunctions.push_back(std::move(radiusAFunction)); + parameterFunctions.push_back(std::move(tsAFunction)); + parameterFunctions.push_back(std::move(lonBFunction)); + parameterFunctions.push_back(std::move(latBFunction)); + parameterFunctions.push_back(std::move(radiusBFunction)); + parameterFunctions.push_back(std::move(tsBFunction)); +} + +VarVal EdisjointTcbufferTcbufferPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto lonA = parameterValues[0].cast>(); + auto latA = parameterValues[1].cast>(); + auto radiusA = parameterValues[2].cast>(); + auto tsA = parameterValues[3].cast>(); + auto lonB = parameterValues[4].cast>(); + auto latB = parameterValues[5].cast>(); + auto radiusB = parameterValues[6].cast>(); + auto tsB = parameterValues[7].cast>(); + + const auto result = nautilus::invoke( + +[](double lonAValue, double latAValue, double radiusAValue, uint64_t tsAValue, + double lonBValue, double latBValue, double radiusBValue, uint64_t tsBValue) -> int { + try + { + MEOS::Meos::ensureMeosInitialized(); + if (!(lonAValue >= -180.0 && lonAValue <= 180.0 && latAValue >= -90.0 && latAValue <= 90.0)) return 0; + if (!(lonBValue >= -180.0 && lonBValue <= 180.0 && latBValue >= -90.0 && latBValue <= 90.0)) return 0; + if (radiusAValue < 0.0 || radiusBValue < 0.0) return 0; + + const std::string tsAString = MEOS::Meos::convertEpochToTimestamp(tsAValue); + const std::string tsBString = MEOS::Meos::convertEpochToTimestamp(tsBValue); + std::string wktA = fmt::format("Cbuffer(Point({} {}),{})@{}", lonAValue, latAValue, radiusAValue, tsAString); + std::string wktB = fmt::format("Cbuffer(Point({} {}),{})@{}", lonBValue, latBValue, radiusBValue, tsBString); + + Temporal* tA = tcbuffer_in(wktA.c_str()); + if (!tA) return 0; + Temporal* tB = tcbuffer_in(wktB.c_str()); + if (!tB) { free(tA); return 0; } + + int r = edisjoint_tcbuffer_tcbuffer(tA, tB); + free(tA); + free(tB); + return r; + } + catch (const std::exception&) + { + return 0; + } + }, + lonA, latA, radiusA, tsA, lonB, latB, radiusB, tsB); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEdisjointTcbufferTcbufferPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 8, + "EdisjointTcbufferTcbufferPhysicalFunction requires 8 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + auto arg5 = std::move(arguments.childFunctions[5]); + auto arg6 = std::move(arguments.childFunctions[6]); + auto arg7 = std::move(arguments.childFunctions[7]); + return EdisjointTcbufferTcbufferPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6), std::move(arg7)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EdisjointTgeoGeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EdisjointTgeoGeoPhysicalFunction.cpp new file mode 100644 index 0000000000..38fa375872 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EdisjointTgeoGeoPhysicalFunction.cpp @@ -0,0 +1,124 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +EdisjointTgeoGeoPhysicalFunction::EdisjointTgeoGeoPhysicalFunction(PhysicalFunction lonFunction, + PhysicalFunction latFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction) +{ + parameterFunctions.reserve(4); + parameterFunctions.push_back(std::move(lonFunction)); + parameterFunctions.push_back(std::move(latFunction)); + parameterFunctions.push_back(std::move(timestampFunction)); + parameterFunctions.push_back(std::move(geometryFunction)); +} + +VarVal EdisjointTgeoGeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto lon = parameterValues[0].cast>(); + auto lat = parameterValues[1].cast>(); + auto timestamp = parameterValues[2].cast>(); + auto geometry = parameterValues[3].cast(); + + const auto result = nautilus::invoke( + +[](double lonValue, + double latValue, + uint64_t timestampValue, + const char* geometryPtr, + uint32_t geometrySize) -> int { + try + { + MEOS::Meos::ensureMeosInitialized(); + if (!(lonValue >= -180.0 && lonValue <= 180.0 && latValue >= -90.0 && latValue <= 90.0)) { + return 0; + } + + const std::string timestampString = MEOS::Meos::convertEpochToTimestamp(timestampValue); + std::string temporalGeometryWkt = fmt::format("SRID=4326;Point({} {})@{}", lonValue, latValue, timestampString); + std::string staticGeometryWkt(geometryPtr, geometrySize); + + while (!staticGeometryWkt.empty() && (staticGeometryWkt.front() == '\'' || staticGeometryWkt.front() == '"')) + staticGeometryWkt.erase(staticGeometryWkt.begin()); + while (!staticGeometryWkt.empty() && (staticGeometryWkt.back() == '\'' || staticGeometryWkt.back() == '"')) + staticGeometryWkt.pop_back(); + + if (temporalGeometryWkt.empty() || staticGeometryWkt.empty()) + return 0; + + MEOS::Meos::TemporalGeometry temporalGeometry(temporalGeometryWkt); + if (!temporalGeometry.getGeometry()) return 0; + MEOS::Meos::StaticGeometry staticGeometry(staticGeometryWkt); + if (!staticGeometry.getGeometry()) return 0; + + // MEOS spatial-relation call — same shape as TemporalEDWithin's + // edwithin_tgeo_geo, but specific MEOS function per generated operator. + // Real MEOS spatial-rel signature: int fn(const Temporal *, const GSERIALIZED *) + // (no `atstart` flag — that's specific to geog_dwithin / edwithin's 3-arg variant). + return edisjoint_tgeo_geo(temporalGeometry.getGeometry(), + staticGeometry.getGeometry()); + } + catch (const std::exception&) + { + return 0; + } + }, + lon, lat, timestamp, geometry.getContent(), geometry.getContentSize()); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEdisjointTgeoGeoPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 4, + "EdisjointTgeoGeoPhysicalFunction requires 4 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + return EdisjointTgeoGeoPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EdisjointTgeoTgeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EdisjointTgeoTgeoPhysicalFunction.cpp index 1708e377b0..b24c7ec93c 100644 --- a/nes-physical-operators/src/Functions/Meos/EdisjointTgeoTgeoPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/EdisjointTgeoTgeoPhysicalFunction.cpp @@ -13,10 +13,10 @@ */ #include + #include #include #include -#include #include #include #include @@ -34,42 +34,68 @@ extern "C" { namespace NES { -EdisjointTgeoTgeoPhysicalFunction::EdisjointTgeoTgeoPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction ts1, PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction ts2) +EdisjointTgeoTgeoPhysicalFunction::EdisjointTgeoTgeoPhysicalFunction(PhysicalFunction lonAFunction, + PhysicalFunction latAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction lonBFunction, + PhysicalFunction latBFunction, + PhysicalFunction tsBFunction) { - paramFns.reserve(6); - paramFns.push_back(std::move(lon1)); - paramFns.push_back(std::move(lat1)); - paramFns.push_back(std::move(ts1)); - paramFns.push_back(std::move(lon2)); - paramFns.push_back(std::move(lat2)); - paramFns.push_back(std::move(ts2)); + parameterFunctions.reserve(6); + parameterFunctions.push_back(std::move(lonAFunction)); + parameterFunctions.push_back(std::move(latAFunction)); + parameterFunctions.push_back(std::move(tsAFunction)); + parameterFunctions.push_back(std::move(lonBFunction)); + parameterFunctions.push_back(std::move(latBFunction)); + parameterFunctions.push_back(std::move(tsBFunction)); } VarVal EdisjointTgeoTgeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto lon1 = paramFns[0].execute(record, arena).cast(); - auto lat1 = paramFns[1].execute(record, arena).cast(); - auto ts1 = paramFns[2].execute(record, arena).cast(); - auto lon2 = paramFns[3].execute(record, arena).cast(); - auto lat2 = paramFns[4].execute(record, arena).cast(); - auto ts2 = paramFns[5].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto lonA = parameterValues[0].cast>(); + auto latA = parameterValues[1].cast>(); + auto tsA = parameterValues[2].cast>(); + auto lonB = parameterValues[3].cast>(); + auto latB = parameterValues[4].cast>(); + auto tsB = parameterValues[5].cast>(); + const auto result = nautilus::invoke( - +[](double lon1, double lat1, uint64_t ts1, - double lon2, double lat2, uint64_t ts2) -> double { - try { + +[](double lonAValue, double latAValue, uint64_t tsAValue, + double lonBValue, double latBValue, uint64_t tsBValue) -> int { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string wkt1 = fmt::format("SRID=4326;POINT({},{})@{}", lon1, lat1, ts1); - Temporal* t1 = tgeompoint_in(wkt1.c_str()); - if (!t1) return 0.0; - std::string wkt2 = fmt::format("SRID=4326;POINT({},{})@{}", lon2, lat2, ts2); - Temporal* t2 = tgeompoint_in(wkt2.c_str()); - if (!t2) { free(t1); return 0.0; } - int r = edisjoint_tgeo_tgeo(t1, t2); - free(t1); free(t2); - return r > 0 ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + if (!(lonAValue >= -180.0 && lonAValue <= 180.0 && latAValue >= -90.0 && latAValue <= 90.0)) return 0; + if (!(lonBValue >= -180.0 && lonBValue <= 180.0 && latBValue >= -90.0 && latBValue <= 90.0)) return 0; + + const std::string tsAString = MEOS::Meos::convertEpochToTimestamp(tsAValue); + const std::string tsBString = MEOS::Meos::convertEpochToTimestamp(tsBValue); + std::string temporalGeometryAWkt = fmt::format("SRID=4326;Point({} {})@{}", lonAValue, latAValue, tsAString); + std::string temporalGeometryBWkt = fmt::format("SRID=4326;Point({} {})@{}", lonBValue, latBValue, tsBString); + + MEOS::Meos::TemporalGeometry temporalGeometryA(temporalGeometryAWkt); + if (!temporalGeometryA.getGeometry()) return 0; + MEOS::Meos::TemporalGeometry temporalGeometryB(temporalGeometryBWkt); + if (!temporalGeometryB.getGeometry()) return 0; + + // MEOS *_tgeo_tgeo spatial-relation: int fn(const Temporal*, const Temporal*). + return edisjoint_tgeo_tgeo(temporalGeometryA.getGeometry(), + temporalGeometryB.getGeometry()); + } + catch (const std::exception&) + { + return 0; + } }, - lon1, lat1, ts1, lon2, lat2, ts2); + lonA, latA, tsA, lonB, latB, tsB); + return VarVal(result); } @@ -79,13 +105,13 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterE PRECONDITION(arguments.childFunctions.size() == 6, "EdisjointTgeoTgeoPhysicalFunction requires 6 children but got {}", arguments.childFunctions.size()); - return EdisjointTgeoTgeoPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2]), - std::move(arguments.childFunctions[3]), - std::move(arguments.childFunctions[4]), - std::move(arguments.childFunctions[5])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + auto arg5 = std::move(arguments.childFunctions[5]); + return EdisjointTgeoTgeoPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EdisjointTrgeometryGeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EdisjointTrgeometryGeoPhysicalFunction.cpp new file mode 100644 index 0000000000..5622a76fbd --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EdisjointTrgeometryGeoPhysicalFunction.cpp @@ -0,0 +1,97 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +#include +} + +namespace NES { + +EdisjointTrgeometryGeoPhysicalFunction::EdisjointTrgeometryGeoPhysicalFunction(PhysicalFunction ref_wkt, PhysicalFunction x1, PhysicalFunction y1, PhysicalFunction theta1, PhysicalFunction ts1, PhysicalFunction tgt_wkt) { + paramFns.reserve(6); + paramFns.push_back(std::move(ref_wkt)); + paramFns.push_back(std::move(x1)); + paramFns.push_back(std::move(y1)); + paramFns.push_back(std::move(theta1)); + paramFns.push_back(std::move(ts1)); + paramFns.push_back(std::move(tgt_wkt)); +} + +VarVal EdisjointTrgeometryGeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { + auto ref_wkt = paramFns[0].execute(record, arena).cast(); + auto x1 = paramFns[1].execute(record, arena).cast(); + auto y1 = paramFns[2].execute(record, arena).cast(); + auto theta1 = paramFns[3].execute(record, arena).cast(); + auto ts1 = paramFns[4].execute(record, arena).cast(); + auto tgt_wkt = paramFns[5].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](const char* ref_wkt, uint32_t ref_wktsz, double x1, double y1, double theta1, uint64_t ts1, const char* tgt_wkt, uint32_t tgt_wktsz) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + char* ref1_str = (char*)malloc(ref_wktsz + 1); + memcpy(ref1_str, ref_wkt, ref_wktsz); ref1_str[ref_wktsz] = '\0'; + GSERIALIZED* gref1 = geom_in(ref1_str, -1); free(ref1_str); + if (!gref1) return 0.0; + Pose* pose1 = pose_make_2d(x1, y1, theta1, false, 0); + if (!pose1) { free(gref1); return 0.0; } + TInstant* inst1 = trgeometryinst_make(gref1, pose1, (TimestampTz)ts1); + free(gref1); free(pose1); + if (!inst1) return 0.0; + char* tgt_str = (char*)malloc(tgt_wktsz + 1); + memcpy(tgt_str, tgt_wkt, tgt_wktsz); tgt_str[tgt_wktsz] = '\0'; + GSERIALIZED* gs_tgt = geom_in(tgt_str, -1); free(tgt_str); + if (!gs_tgt) { free(inst1); return 0.0; } + int r = edisjoint_trgeometry_geo((Temporal*)inst1, gs_tgt); + free(inst1); free(gs_tgt); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + ref_wkt, x1, y1, theta1, ts1, tgt_wkt); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEdisjointTrgeometryGeoPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size()==6, + "EdisjointTrgeometryGeoPhysicalFunction requires 6 children but got {}", + arguments.childFunctions.size()); + return EdisjointTrgeometryGeoPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4]), + std::move(arguments.childFunctions[5])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EdisjointTrgeometryTrgeometryPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EdisjointTrgeometryTrgeometryPhysicalFunction.cpp new file mode 100644 index 0000000000..1fede355b0 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EdisjointTrgeometryTrgeometryPhysicalFunction.cpp @@ -0,0 +1,114 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +#include +} + +namespace NES { + +EdisjointTrgeometryTrgeometryPhysicalFunction::EdisjointTrgeometryTrgeometryPhysicalFunction(PhysicalFunction ref1_wkt, PhysicalFunction x1, PhysicalFunction y1, PhysicalFunction theta1, PhysicalFunction ts1, PhysicalFunction ref2_wkt, PhysicalFunction x2, PhysicalFunction y2, PhysicalFunction theta2, PhysicalFunction ts2) { + paramFns.reserve(10); + paramFns.push_back(std::move(ref1_wkt)); + paramFns.push_back(std::move(x1)); + paramFns.push_back(std::move(y1)); + paramFns.push_back(std::move(theta1)); + paramFns.push_back(std::move(ts1)); + paramFns.push_back(std::move(ref2_wkt)); + paramFns.push_back(std::move(x2)); + paramFns.push_back(std::move(y2)); + paramFns.push_back(std::move(theta2)); + paramFns.push_back(std::move(ts2)); +} + +VarVal EdisjointTrgeometryTrgeometryPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { + auto ref1_wkt = paramFns[0].execute(record, arena).cast(); + auto x1 = paramFns[1].execute(record, arena).cast(); + auto y1 = paramFns[2].execute(record, arena).cast(); + auto theta1 = paramFns[3].execute(record, arena).cast(); + auto ts1 = paramFns[4].execute(record, arena).cast(); + auto ref2_wkt = paramFns[5].execute(record, arena).cast(); + auto x2 = paramFns[6].execute(record, arena).cast(); + auto y2 = paramFns[7].execute(record, arena).cast(); + auto theta2 = paramFns[8].execute(record, arena).cast(); + auto ts2 = paramFns[9].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](const char* ref1_wkt, uint32_t ref1_wktsz, double x1, double y1, double theta1, uint64_t ts1, const char* ref2_wkt, uint32_t ref2_wktsz, double x2, double y2, double theta2, uint64_t ts2) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + char* ref1_str = (char*)malloc(ref1_wktsz + 1); + memcpy(ref1_str, ref1_wkt, ref1_wktsz); ref1_str[ref1_wktsz] = '\0'; + GSERIALIZED* gref1 = geom_in(ref1_str, -1); free(ref1_str); + if (!gref1) return 0.0; + Pose* pose1 = pose_make_2d(x1, y1, theta1, false, 0); + if (!pose1) { free(gref1); return 0.0; } + TInstant* inst1 = trgeometryinst_make(gref1, pose1, (TimestampTz)ts1); + free(gref1); free(pose1); + if (!inst1) return 0.0; + char* ref2_str = (char*)malloc(ref2_wktsz + 1); + memcpy(ref2_str, ref2_wkt, ref2_wktsz); ref2_str[ref2_wktsz] = '\0'; + GSERIALIZED* gref2 = geom_in(ref2_str, -1); free(ref2_str); + if (!gref2) return 0.0; + Pose* pose2 = pose_make_2d(x2, y2, theta2, false, 0); + if (!pose2) { free(gref2); return 0.0; } + TInstant* inst2 = trgeometryinst_make(gref2, pose2, (TimestampTz)ts2); + free(gref2); free(pose2); + if (!inst2) { free(inst1); return 0.0; } + int r = edisjoint_trgeometry_trgeometry((Temporal*)inst1, (Temporal*)inst2); + free(inst1); free(inst2); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + ref1_wkt, x1, y1, theta1, ts1, ref2_wkt, x2, y2, theta2, ts2); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEdisjointTrgeometryTrgeometryPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size()==10, + "EdisjointTrgeometryTrgeometryPhysicalFunction requires 10 children but got {}", + arguments.childFunctions.size()); + return EdisjointTrgeometryTrgeometryPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4]), + std::move(arguments.childFunctions[5]), + std::move(arguments.childFunctions[6]), + std::move(arguments.childFunctions[7]), + std::move(arguments.childFunctions[8]), + std::move(arguments.childFunctions[9])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EdwithinTcbufferCbufferPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EdwithinTcbufferCbufferPhysicalFunction.cpp new file mode 100644 index 0000000000..c975864d2a --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EdwithinTcbufferCbufferPhysicalFunction.cpp @@ -0,0 +1,126 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +EdwithinTcbufferCbufferPhysicalFunction::EdwithinTcbufferCbufferPhysicalFunction(PhysicalFunction lonFunction, + PhysicalFunction latFunction, + PhysicalFunction radiusFunction, + PhysicalFunction timestampFunction, + PhysicalFunction cbufLitFunction, + PhysicalFunction distFunction) +{ + parameterFunctions.reserve(6); + parameterFunctions.push_back(std::move(lonFunction)); + parameterFunctions.push_back(std::move(latFunction)); + parameterFunctions.push_back(std::move(radiusFunction)); + parameterFunctions.push_back(std::move(timestampFunction)); + parameterFunctions.push_back(std::move(cbufLitFunction)); + parameterFunctions.push_back(std::move(distFunction)); +} + +VarVal EdwithinTcbufferCbufferPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto lon = parameterValues[0].cast>(); + auto lat = parameterValues[1].cast>(); + auto radius = parameterValues[2].cast>(); + auto timestamp = parameterValues[3].cast>(); + auto cbufLit = parameterValues[4].cast(); + auto dist = parameterValues[5].cast>(); + + const auto result = nautilus::invoke( + +[](double lonValue, double latValue, double radiusValue, uint64_t timestampValue, + const char* cbufLitPtr, uint32_t cbufLitSize, double distValue) -> int { + try + { + MEOS::Meos::ensureMeosInitialized(); + if (!(lonValue >= -180.0 && lonValue <= 180.0 && latValue >= -90.0 && latValue <= 90.0)) return 0; + if (radiusValue < 0.0) return 0; + + const std::string timestampString = MEOS::Meos::convertEpochToTimestamp(timestampValue); + std::string tcbufferWkt = fmt::format("Cbuffer(Point({} {}),{})@{}", + lonValue, latValue, radiusValue, timestampString); + std::string cbufferLiteral(cbufLitPtr, cbufLitSize); + + while (!cbufferLiteral.empty() && (cbufferLiteral.front() == '\'' || cbufferLiteral.front() == '"')) + cbufferLiteral.erase(cbufferLiteral.begin()); + while (!cbufferLiteral.empty() && (cbufferLiteral.back() == '\'' || cbufferLiteral.back() == '"')) + cbufferLiteral.pop_back(); + + if (tcbufferWkt.empty() || cbufferLiteral.empty()) return 0; + + Temporal* tcbuffer = tcbuffer_in(tcbufferWkt.c_str()); + if (!tcbuffer) return 0; + Cbuffer* cb = cbuffer_in(cbufferLiteral.c_str()); + if (!cb) { free(tcbuffer); return 0; } + + int r = edwithin_tcbuffer_cbuffer(tcbuffer, cb, distValue); + free(tcbuffer); + free(cb); + return r; + } + catch (const std::exception&) + { + return 0; + } + }, + lon, lat, radius, timestamp, cbufLit.getContent(), cbufLit.getContentSize(), dist); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEdwithinTcbufferCbufferPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 6, + "EdwithinTcbufferCbufferPhysicalFunction requires 6 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + auto arg5 = std::move(arguments.childFunctions[5]); + return EdwithinTcbufferCbufferPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EdwithinTcbufferGeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EdwithinTcbufferGeoPhysicalFunction.cpp index 074a407bb2..ae1d8cd124 100644 --- a/nes-physical-operators/src/Functions/Meos/EdwithinTcbufferGeoPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/EdwithinTcbufferGeoPhysicalFunction.cpp @@ -13,79 +13,96 @@ */ #include + #include #include #include +#include #include #include #include #include +#include #include +#include #include #include -#include -#include -#include extern "C" { #include -#include #include } namespace NES { -EdwithinTcbufferGeoPhysicalFunction::EdwithinTcbufferGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, - PhysicalFunction radius, PhysicalFunction ts, - PhysicalFunction wkt, PhysicalFunction dist) +EdwithinTcbufferGeoPhysicalFunction::EdwithinTcbufferGeoPhysicalFunction(PhysicalFunction lonFunction, + PhysicalFunction latFunction, + PhysicalFunction radiusFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction, + PhysicalFunction distFunction) { - paramFns.reserve(6); - paramFns.push_back(std::move(lon)); - paramFns.push_back(std::move(lat)); - paramFns.push_back(std::move(radius)); - paramFns.push_back(std::move(ts)); - paramFns.push_back(std::move(wkt)); - paramFns.push_back(std::move(dist)); + parameterFunctions.reserve(6); + parameterFunctions.push_back(std::move(lonFunction)); + parameterFunctions.push_back(std::move(latFunction)); + parameterFunctions.push_back(std::move(radiusFunction)); + parameterFunctions.push_back(std::move(timestampFunction)); + parameterFunctions.push_back(std::move(geometryFunction)); + parameterFunctions.push_back(std::move(distFunction)); } VarVal EdwithinTcbufferGeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto lon = paramFns[0].execute(record, arena).cast(); - auto lat = paramFns[1].execute(record, arena).cast(); - auto radius = paramFns[2].execute(record, arena).cast(); - auto ts = paramFns[3].execute(record, arena).cast(); - auto wkt = paramFns[4].execute(record, arena); - auto dist = paramFns[5].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto lon = parameterValues[0].cast>(); + auto lat = parameterValues[1].cast>(); + auto radius = parameterValues[2].cast>(); + auto timestamp = parameterValues[3].cast>(); + auto geometry = parameterValues[4].cast(); + auto dist = parameterValues[5].cast>(); const auto result = nautilus::invoke( - +[](double lon, double lat, double radius, uint64_t ts, - const char* wkt, uint32_t wkt_len, double dist) -> double { - try { + +[](double lonValue, double latValue, double radiusValue, uint64_t timestampValue, + const char* geometryPtr, uint32_t geometrySize, double distValue) -> int { + try + { MEOS::Meos::ensureMeosInitialized(); - // Build tcbuffer instant from lon/lat/radius/ts - std::string pt_str = fmt::format("POINT({} {})", lon, lat); - GSERIALIZED* pt_gs = geom_in(pt_str.c_str(), -1); - if (!pt_gs) return 0.0; - Cbuffer* cb = cbuffer_make(pt_gs, radius); - free(pt_gs); - if (!cb) return 0.0; - Temporal* tcb_inst = (Temporal*)tcbufferinst_make(cb, (TimestampTz)ts); - free(cb); - if (!tcb_inst) return 0.0; - // Build target geometry from null-terminated WKT copy - char* wkt_str = (char*)malloc(wkt_len + 1); - memcpy(wkt_str, wkt, wkt_len); - wkt_str[wkt_len] = '\0'; - GSERIALIZED* target_gs = geom_in(wkt_str, -1); - free(wkt_str); - if (!target_gs) { free(tcb_inst); return 0.0; } - int r = edwithin_tcbuffer_geo(tcb_inst, target_gs, dist); - free(tcb_inst); - free(target_gs); - return r > 0 ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + if (!(lonValue >= -180.0 && lonValue <= 180.0 && latValue >= -90.0 && latValue <= 90.0)) return 0; + if (radiusValue < 0.0) return 0; + + const std::string timestampString = MEOS::Meos::convertEpochToTimestamp(timestampValue); + std::string tcbufferWkt = fmt::format("Cbuffer(Point({} {}),{})@{}", + lonValue, latValue, radiusValue, timestampString); + std::string staticGeometryWkt(geometryPtr, geometrySize); + + while (!staticGeometryWkt.empty() && (staticGeometryWkt.front() == '\'' || staticGeometryWkt.front() == '"')) + staticGeometryWkt.erase(staticGeometryWkt.begin()); + while (!staticGeometryWkt.empty() && (staticGeometryWkt.back() == '\'' || staticGeometryWkt.back() == '"')) + staticGeometryWkt.pop_back(); + + if (tcbufferWkt.empty() || staticGeometryWkt.empty()) return 0; + + Temporal* tcbuffer = tcbuffer_in(tcbufferWkt.c_str()); + if (!tcbuffer) return 0; + MEOS::Meos::StaticGeometry staticGeometry(staticGeometryWkt); + if (!staticGeometry.getGeometry()) { free(tcbuffer); return 0; } + + int r = edwithin_tcbuffer_geo(tcbuffer, staticGeometry.getGeometry(), distValue); + free(tcbuffer); + return r; + } + catch (const std::exception&) + { + return 0; + } }, - lon, lat, radius, ts, wkt, dist); + lon, lat, radius, timestamp, geometry.getContent(), geometry.getContentSize(), dist); return VarVal(result); } @@ -96,12 +113,13 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterE PRECONDITION(arguments.childFunctions.size() == 6, "EdwithinTcbufferGeoPhysicalFunction requires 6 children but got {}", arguments.childFunctions.size()); - return EdwithinTcbufferGeoPhysicalFunction(std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2]), - std::move(arguments.childFunctions[3]), - std::move(arguments.childFunctions[4]), - std::move(arguments.childFunctions[5])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + auto arg5 = std::move(arguments.childFunctions[5]); + return EdwithinTcbufferGeoPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EdwithinTcbufferTcbufferPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EdwithinTcbufferTcbufferPhysicalFunction.cpp index 0516c6be91..eee32842d1 100644 --- a/nes-physical-operators/src/Functions/Meos/EdwithinTcbufferTcbufferPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/EdwithinTcbufferTcbufferPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -20,79 +21,92 @@ #include #include #include +#include #include +#include #include #include -#include -#include extern "C" { #include -#include #include } namespace NES { -EdwithinTcbufferTcbufferPhysicalFunction::EdwithinTcbufferTcbufferPhysicalFunction( - PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction r1, PhysicalFunction ts1, - PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction r2, PhysicalFunction ts2, - PhysicalFunction dist) +EdwithinTcbufferTcbufferPhysicalFunction::EdwithinTcbufferTcbufferPhysicalFunction(PhysicalFunction lonAFunction, + PhysicalFunction latAFunction, + PhysicalFunction radiusAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction lonBFunction, + PhysicalFunction latBFunction, + PhysicalFunction radiusBFunction, + PhysicalFunction tsBFunction, + PhysicalFunction distFunction) { - paramFns.reserve(9); - paramFns.push_back(std::move(lon1)); - paramFns.push_back(std::move(lat1)); - paramFns.push_back(std::move(r1)); - paramFns.push_back(std::move(ts1)); - paramFns.push_back(std::move(lon2)); - paramFns.push_back(std::move(lat2)); - paramFns.push_back(std::move(r2)); - paramFns.push_back(std::move(ts2)); - paramFns.push_back(std::move(dist)); + parameterFunctions.reserve(9); + parameterFunctions.push_back(std::move(lonAFunction)); + parameterFunctions.push_back(std::move(latAFunction)); + parameterFunctions.push_back(std::move(radiusAFunction)); + parameterFunctions.push_back(std::move(tsAFunction)); + parameterFunctions.push_back(std::move(lonBFunction)); + parameterFunctions.push_back(std::move(latBFunction)); + parameterFunctions.push_back(std::move(radiusBFunction)); + parameterFunctions.push_back(std::move(tsBFunction)); + parameterFunctions.push_back(std::move(distFunction)); } VarVal EdwithinTcbufferTcbufferPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto lon1 = paramFns[0].execute(record, arena).cast(); - auto lat1 = paramFns[1].execute(record, arena).cast(); - auto r1 = paramFns[2].execute(record, arena).cast(); - auto ts1 = paramFns[3].execute(record, arena).cast(); - auto lon2 = paramFns[4].execute(record, arena).cast(); - auto lat2 = paramFns[5].execute(record, arena).cast(); - auto r2 = paramFns[6].execute(record, arena).cast(); - auto ts2 = paramFns[7].execute(record, arena).cast(); - auto dist = paramFns[8].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto lonA = parameterValues[0].cast>(); + auto latA = parameterValues[1].cast>(); + auto radiusA = parameterValues[2].cast>(); + auto tsA = parameterValues[3].cast>(); + auto lonB = parameterValues[4].cast>(); + auto latB = parameterValues[5].cast>(); + auto radiusB = parameterValues[6].cast>(); + auto tsB = parameterValues[7].cast>(); + auto dist = parameterValues[8].cast>(); const auto result = nautilus::invoke( - +[](double lon1, double lat1, double r1, uint64_t ts1, - double lon2, double lat2, double r2, uint64_t ts2, - double dist) -> double { - try { + +[](double lonAValue, double latAValue, double radiusAValue, uint64_t tsAValue, + double lonBValue, double latBValue, double radiusBValue, uint64_t tsBValue, + double distValue) -> int { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string pt1 = fmt::format("POINT({} {})", lon1, lat1); - GSERIALIZED* gs1 = geom_in(pt1.c_str(), -1); - if (!gs1) return 0.0; - Cbuffer* cb1 = cbuffer_make(gs1, r1); - free(gs1); - if (!cb1) return 0.0; - Temporal* tcb1 = (Temporal*)tcbufferinst_make(cb1, (TimestampTz)ts1); - free(cb1); - if (!tcb1) return 0.0; - std::string pt2 = fmt::format("POINT({} {})", lon2, lat2); - GSERIALIZED* gs2 = geom_in(pt2.c_str(), -1); - if (!gs2) { free(tcb1); return 0.0; } - Cbuffer* cb2 = cbuffer_make(gs2, r2); - free(gs2); - if (!cb2) { free(tcb1); return 0.0; } - Temporal* tcb2 = (Temporal*)tcbufferinst_make(cb2, (TimestampTz)ts2); - free(cb2); - if (!tcb2) { free(tcb1); return 0.0; } - int r = edwithin_tcbuffer_tcbuffer(tcb1, tcb2, dist); - free(tcb1); free(tcb2); - return r > 0 ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + if (!(lonAValue >= -180.0 && lonAValue <= 180.0 && latAValue >= -90.0 && latAValue <= 90.0)) return 0; + if (!(lonBValue >= -180.0 && lonBValue <= 180.0 && latBValue >= -90.0 && latBValue <= 90.0)) return 0; + if (radiusAValue < 0.0 || radiusBValue < 0.0) return 0; + + const std::string tsAString = MEOS::Meos::convertEpochToTimestamp(tsAValue); + const std::string tsBString = MEOS::Meos::convertEpochToTimestamp(tsBValue); + std::string wktA = fmt::format("Cbuffer(Point({} {}),{})@{}", lonAValue, latAValue, radiusAValue, tsAString); + std::string wktB = fmt::format("Cbuffer(Point({} {}),{})@{}", lonBValue, latBValue, radiusBValue, tsBString); + + Temporal* tA = tcbuffer_in(wktA.c_str()); + if (!tA) return 0; + Temporal* tB = tcbuffer_in(wktB.c_str()); + if (!tB) { free(tA); return 0; } + + int r = edwithin_tcbuffer_tcbuffer(tA, tB, distValue); + free(tA); + free(tB); + return r; + } + catch (const std::exception&) + { + return 0; + } }, - lon1, lat1, r1, ts1, lon2, lat2, r2, ts2, dist); + lonA, latA, radiusA, tsA, lonB, latB, radiusB, tsB, dist); return VarVal(result); } @@ -103,15 +117,16 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterE PRECONDITION(arguments.childFunctions.size() == 9, "EdwithinTcbufferTcbufferPhysicalFunction requires 9 children but got {}", arguments.childFunctions.size()); - return EdwithinTcbufferTcbufferPhysicalFunction(std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2]), - std::move(arguments.childFunctions[3]), - std::move(arguments.childFunctions[4]), - std::move(arguments.childFunctions[5]), - std::move(arguments.childFunctions[6]), - std::move(arguments.childFunctions[7]), - std::move(arguments.childFunctions[8])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + auto arg5 = std::move(arguments.childFunctions[5]); + auto arg6 = std::move(arguments.childFunctions[6]); + auto arg7 = std::move(arguments.childFunctions[7]); + auto arg8 = std::move(arguments.childFunctions[8]); + return EdwithinTcbufferTcbufferPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6), std::move(arg7), std::move(arg8)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EdwithinTgeoGeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EdwithinTgeoGeoPhysicalFunction.cpp new file mode 100644 index 0000000000..a947348670 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EdwithinTgeoGeoPhysicalFunction.cpp @@ -0,0 +1,125 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +EdwithinTgeoGeoPhysicalFunction::EdwithinTgeoGeoPhysicalFunction(PhysicalFunction lonFunction, + PhysicalFunction latFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction, + PhysicalFunction distFunction) +{ + parameterFunctions.reserve(5); + parameterFunctions.push_back(std::move(lonFunction)); + parameterFunctions.push_back(std::move(latFunction)); + parameterFunctions.push_back(std::move(timestampFunction)); + parameterFunctions.push_back(std::move(geometryFunction)); + parameterFunctions.push_back(std::move(distFunction)); +} + +VarVal EdwithinTgeoGeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto lon = parameterValues[0].cast>(); + auto lat = parameterValues[1].cast>(); + auto timestamp = parameterValues[2].cast>(); + auto geometry = parameterValues[3].cast(); + auto dist = parameterValues[4].cast>(); + + const auto result = nautilus::invoke( + +[](double lonValue, + double latValue, + uint64_t timestampValue, + const char* geometryPtr, + uint32_t geometrySize, + double distValue) -> int { + try + { + MEOS::Meos::ensureMeosInitialized(); + if (!(lonValue >= -180.0 && lonValue <= 180.0 && latValue >= -90.0 && latValue <= 90.0)) return 0; + + const std::string timestampString = MEOS::Meos::convertEpochToTimestamp(timestampValue); + std::string temporalGeometryWkt = fmt::format("SRID=4326;Point({} {})@{}", lonValue, latValue, timestampString); + std::string staticGeometryWkt(geometryPtr, geometrySize); + + while (!staticGeometryWkt.empty() && (staticGeometryWkt.front() == '\'' || staticGeometryWkt.front() == '"')) + staticGeometryWkt.erase(staticGeometryWkt.begin()); + while (!staticGeometryWkt.empty() && (staticGeometryWkt.back() == '\'' || staticGeometryWkt.back() == '"')) + staticGeometryWkt.pop_back(); + + if (temporalGeometryWkt.empty() || staticGeometryWkt.empty()) return 0; + + MEOS::Meos::TemporalGeometry temporalGeometry(temporalGeometryWkt); + if (!temporalGeometry.getGeometry()) return 0; + MEOS::Meos::StaticGeometry staticGeometry(staticGeometryWkt); + if (!staticGeometry.getGeometry()) return 0; + + // MEOS *_tgeo_geo with trailing distance arg + // — int fn(const Temporal*, const GSERIALIZED*, double). + return edwithin_tgeo_geo(temporalGeometry.getGeometry(), + staticGeometry.getGeometry(), + distValue); + } + catch (const std::exception&) + { + return 0; + } + }, + lon, lat, timestamp, geometry.getContent(), geometry.getContentSize(), dist); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEdwithinTgeoGeoPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 5, + "EdwithinTgeoGeoPhysicalFunction requires 5 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + return EdwithinTgeoGeoPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EdwithinTgeoTgeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EdwithinTgeoTgeoPhysicalFunction.cpp index 96a13325fc..91e3ecf7e9 100644 --- a/nes-physical-operators/src/Functions/Meos/EdwithinTgeoTgeoPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/EdwithinTgeoTgeoPhysicalFunction.cpp @@ -13,10 +13,10 @@ */ #include + #include #include #include -#include #include #include #include @@ -34,45 +34,74 @@ extern "C" { namespace NES { -EdwithinTgeoTgeoPhysicalFunction::EdwithinTgeoTgeoPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction ts1, PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction ts2, PhysicalFunction dist) +EdwithinTgeoTgeoPhysicalFunction::EdwithinTgeoTgeoPhysicalFunction(PhysicalFunction lonAFunction, + PhysicalFunction latAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction lonBFunction, + PhysicalFunction latBFunction, + PhysicalFunction tsBFunction, + PhysicalFunction distFunction) { - paramFns.reserve(7); - paramFns.push_back(std::move(lon1)); - paramFns.push_back(std::move(lat1)); - paramFns.push_back(std::move(ts1)); - paramFns.push_back(std::move(lon2)); - paramFns.push_back(std::move(lat2)); - paramFns.push_back(std::move(ts2)); - paramFns.push_back(std::move(dist)); + parameterFunctions.reserve(7); + parameterFunctions.push_back(std::move(lonAFunction)); + parameterFunctions.push_back(std::move(latAFunction)); + parameterFunctions.push_back(std::move(tsAFunction)); + parameterFunctions.push_back(std::move(lonBFunction)); + parameterFunctions.push_back(std::move(latBFunction)); + parameterFunctions.push_back(std::move(tsBFunction)); + parameterFunctions.push_back(std::move(distFunction)); } VarVal EdwithinTgeoTgeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto lon1 = paramFns[0].execute(record, arena).cast(); - auto lat1 = paramFns[1].execute(record, arena).cast(); - auto ts1 = paramFns[2].execute(record, arena).cast(); - auto lon2 = paramFns[3].execute(record, arena).cast(); - auto lat2 = paramFns[4].execute(record, arena).cast(); - auto ts2 = paramFns[5].execute(record, arena).cast(); - auto dist = paramFns[6].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto lonA = parameterValues[0].cast>(); + auto latA = parameterValues[1].cast>(); + auto tsA = parameterValues[2].cast>(); + auto lonB = parameterValues[3].cast>(); + auto latB = parameterValues[4].cast>(); + auto tsB = parameterValues[5].cast>(); + auto dist = parameterValues[6].cast>(); + const auto result = nautilus::invoke( - +[](double lon1, double lat1, uint64_t ts1, - double lon2, double lat2, uint64_t ts2, - double dist) -> double { - try { + +[](double lonAValue, double latAValue, uint64_t tsAValue, + double lonBValue, double latBValue, uint64_t tsBValue, + double distValue) -> int { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string wkt1 = fmt::format("SRID=4326;POINT({},{})@{}", lon1, lat1, ts1); - Temporal* t1 = tgeompoint_in(wkt1.c_str()); - if (!t1) return 0.0; - std::string wkt2 = fmt::format("SRID=4326;POINT({},{})@{}", lon2, lat2, ts2); - Temporal* t2 = tgeompoint_in(wkt2.c_str()); - if (!t2) { free(t1); return 0.0; } - int r = edwithin_tgeo_tgeo(t1, t2, dist); - free(t1); free(t2); - return r > 0 ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + if (!(lonAValue >= -180.0 && lonAValue <= 180.0 && latAValue >= -90.0 && latAValue <= 90.0)) return 0; + if (!(lonBValue >= -180.0 && lonBValue <= 180.0 && latBValue >= -90.0 && latBValue <= 90.0)) return 0; + + const std::string tsAString = MEOS::Meos::convertEpochToTimestamp(tsAValue); + const std::string tsBString = MEOS::Meos::convertEpochToTimestamp(tsBValue); + std::string temporalGeometryAWkt = fmt::format("SRID=4326;Point({} {})@{}", lonAValue, latAValue, tsAString); + std::string temporalGeometryBWkt = fmt::format("SRID=4326;Point({} {})@{}", lonBValue, latBValue, tsBString); + + MEOS::Meos::TemporalGeometry temporalGeometryA(temporalGeometryAWkt); + if (!temporalGeometryA.getGeometry()) return 0; + MEOS::Meos::TemporalGeometry temporalGeometryB(temporalGeometryBWkt); + if (!temporalGeometryB.getGeometry()) return 0; + + // MEOS *_tgeo_tgeo with trailing distance arg + // — int fn(const Temporal*, const Temporal*, double). + return edwithin_tgeo_tgeo(temporalGeometryA.getGeometry(), + temporalGeometryB.getGeometry(), + distValue); + } + catch (const std::exception&) + { + return 0; + } }, - lon1, lat1, ts1, lon2, lat2, ts2, dist); + lonA, latA, tsA, lonB, latB, tsB, dist); + return VarVal(result); } @@ -82,14 +111,14 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterE PRECONDITION(arguments.childFunctions.size() == 7, "EdwithinTgeoTgeoPhysicalFunction requires 7 children but got {}", arguments.childFunctions.size()); - return EdwithinTgeoTgeoPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2]), - std::move(arguments.childFunctions[3]), - std::move(arguments.childFunctions[4]), - std::move(arguments.childFunctions[5]), - std::move(arguments.childFunctions[6])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + auto arg5 = std::move(arguments.childFunctions[5]); + auto arg6 = std::move(arguments.childFunctions[6]); + return EdwithinTgeoTgeoPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EdwithinTrgeometryGeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EdwithinTrgeometryGeoPhysicalFunction.cpp new file mode 100644 index 0000000000..b10616f19d --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EdwithinTrgeometryGeoPhysicalFunction.cpp @@ -0,0 +1,100 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +#include +} + +namespace NES { + +EdwithinTrgeometryGeoPhysicalFunction::EdwithinTrgeometryGeoPhysicalFunction(PhysicalFunction ref_wkt, PhysicalFunction x1, PhysicalFunction y1, PhysicalFunction theta1, PhysicalFunction ts1, PhysicalFunction tgt_wkt, PhysicalFunction dist) { + paramFns.reserve(7); + paramFns.push_back(std::move(ref_wkt)); + paramFns.push_back(std::move(x1)); + paramFns.push_back(std::move(y1)); + paramFns.push_back(std::move(theta1)); + paramFns.push_back(std::move(ts1)); + paramFns.push_back(std::move(tgt_wkt)); + paramFns.push_back(std::move(dist)); +} + +VarVal EdwithinTrgeometryGeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { + auto ref_wkt = paramFns[0].execute(record, arena).cast(); + auto x1 = paramFns[1].execute(record, arena).cast(); + auto y1 = paramFns[2].execute(record, arena).cast(); + auto theta1 = paramFns[3].execute(record, arena).cast(); + auto ts1 = paramFns[4].execute(record, arena).cast(); + auto tgt_wkt = paramFns[5].execute(record, arena).cast(); + auto dist = paramFns[6].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](const char* ref_wkt, uint32_t ref_wktsz, double x1, double y1, double theta1, uint64_t ts1, const char* tgt_wkt, uint32_t tgt_wktsz, double dist) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + char* ref1_str = (char*)malloc(ref_wktsz + 1); + memcpy(ref1_str, ref_wkt, ref_wktsz); ref1_str[ref_wktsz] = '\0'; + GSERIALIZED* gref1 = geom_in(ref1_str, -1); free(ref1_str); + if (!gref1) return 0.0; + Pose* pose1 = pose_make_2d(x1, y1, theta1, false, 0); + if (!pose1) { free(gref1); return 0.0; } + TInstant* inst1 = trgeometryinst_make(gref1, pose1, (TimestampTz)ts1); + free(gref1); free(pose1); + if (!inst1) return 0.0; + char* tgt_str = (char*)malloc(tgt_wktsz + 1); + memcpy(tgt_str, tgt_wkt, tgt_wktsz); tgt_str[tgt_wktsz] = '\0'; + GSERIALIZED* gs_tgt = geom_in(tgt_str, -1); free(tgt_str); + if (!gs_tgt) { free(inst1); return 0.0; } + int r = edwithin_trgeometry_geo((Temporal*)inst1, gs_tgt, dist); + free(inst1); free(gs_tgt); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + ref_wkt, x1, y1, theta1, ts1, tgt_wkt, dist); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEdwithinTrgeometryGeoPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size()==7, + "EdwithinTrgeometryGeoPhysicalFunction requires 7 children but got {}", + arguments.childFunctions.size()); + return EdwithinTrgeometryGeoPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4]), + std::move(arguments.childFunctions[5]), + std::move(arguments.childFunctions[6])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EdwithinTrgeometryTrgeometryPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EdwithinTrgeometryTrgeometryPhysicalFunction.cpp new file mode 100644 index 0000000000..6c5ddc2ffa --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EdwithinTrgeometryTrgeometryPhysicalFunction.cpp @@ -0,0 +1,117 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +#include +} + +namespace NES { + +EdwithinTrgeometryTrgeometryPhysicalFunction::EdwithinTrgeometryTrgeometryPhysicalFunction(PhysicalFunction ref1_wkt, PhysicalFunction x1, PhysicalFunction y1, PhysicalFunction theta1, PhysicalFunction ts1, PhysicalFunction ref2_wkt, PhysicalFunction x2, PhysicalFunction y2, PhysicalFunction theta2, PhysicalFunction ts2, PhysicalFunction dist) { + paramFns.reserve(11); + paramFns.push_back(std::move(ref1_wkt)); + paramFns.push_back(std::move(x1)); + paramFns.push_back(std::move(y1)); + paramFns.push_back(std::move(theta1)); + paramFns.push_back(std::move(ts1)); + paramFns.push_back(std::move(ref2_wkt)); + paramFns.push_back(std::move(x2)); + paramFns.push_back(std::move(y2)); + paramFns.push_back(std::move(theta2)); + paramFns.push_back(std::move(ts2)); + paramFns.push_back(std::move(dist)); +} + +VarVal EdwithinTrgeometryTrgeometryPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { + auto ref1_wkt = paramFns[0].execute(record, arena).cast(); + auto x1 = paramFns[1].execute(record, arena).cast(); + auto y1 = paramFns[2].execute(record, arena).cast(); + auto theta1 = paramFns[3].execute(record, arena).cast(); + auto ts1 = paramFns[4].execute(record, arena).cast(); + auto ref2_wkt = paramFns[5].execute(record, arena).cast(); + auto x2 = paramFns[6].execute(record, arena).cast(); + auto y2 = paramFns[7].execute(record, arena).cast(); + auto theta2 = paramFns[8].execute(record, arena).cast(); + auto ts2 = paramFns[9].execute(record, arena).cast(); + auto dist = paramFns[10].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](const char* ref1_wkt, uint32_t ref1_wktsz, double x1, double y1, double theta1, uint64_t ts1, const char* ref2_wkt, uint32_t ref2_wktsz, double x2, double y2, double theta2, uint64_t ts2, double dist) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + char* ref1_str = (char*)malloc(ref1_wktsz + 1); + memcpy(ref1_str, ref1_wkt, ref1_wktsz); ref1_str[ref1_wktsz] = '\0'; + GSERIALIZED* gref1 = geom_in(ref1_str, -1); free(ref1_str); + if (!gref1) return 0.0; + Pose* pose1 = pose_make_2d(x1, y1, theta1, false, 0); + if (!pose1) { free(gref1); return 0.0; } + TInstant* inst1 = trgeometryinst_make(gref1, pose1, (TimestampTz)ts1); + free(gref1); free(pose1); + if (!inst1) return 0.0; + char* ref2_str = (char*)malloc(ref2_wktsz + 1); + memcpy(ref2_str, ref2_wkt, ref2_wktsz); ref2_str[ref2_wktsz] = '\0'; + GSERIALIZED* gref2 = geom_in(ref2_str, -1); free(ref2_str); + if (!gref2) return 0.0; + Pose* pose2 = pose_make_2d(x2, y2, theta2, false, 0); + if (!pose2) { free(gref2); return 0.0; } + TInstant* inst2 = trgeometryinst_make(gref2, pose2, (TimestampTz)ts2); + free(gref2); free(pose2); + if (!inst2) { free(inst1); return 0.0; } + int r = edwithin_trgeometry_trgeometry((Temporal*)inst1, (Temporal*)inst2, dist); + free(inst1); free(inst2); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + ref1_wkt, x1, y1, theta1, ts1, ref2_wkt, x2, y2, theta2, ts2, dist); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEdwithinTrgeometryTrgeometryPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size()==11, + "EdwithinTrgeometryTrgeometryPhysicalFunction requires 11 children but got {}", + arguments.childFunctions.size()); + return EdwithinTrgeometryTrgeometryPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4]), + std::move(arguments.childFunctions[5]), + std::move(arguments.childFunctions[6]), + std::move(arguments.childFunctions[7]), + std::move(arguments.childFunctions[8]), + std::move(arguments.childFunctions[9]), + std::move(arguments.childFunctions[10])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EintersectsTcbufferGeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EintersectsTcbufferGeoPhysicalFunction.cpp index b2ffefe945..3ae7ba1ec3 100644 --- a/nes-physical-operators/src/Functions/Meos/EintersectsTcbufferGeoPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/EintersectsTcbufferGeoPhysicalFunction.cpp @@ -13,77 +13,97 @@ */ #include + #include #include #include +#include #include #include #include #include +#include #include +#include #include #include -#include -#include -#include extern "C" { #include -#include #include } namespace NES { -EintersectsTcbufferGeoPhysicalFunction::EintersectsTcbufferGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, - PhysicalFunction radius, PhysicalFunction ts, - PhysicalFunction wkt) +EintersectsTcbufferGeoPhysicalFunction::EintersectsTcbufferGeoPhysicalFunction(PhysicalFunction lonFunction, + PhysicalFunction latFunction, + PhysicalFunction radiusFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction) { - paramFns.reserve(5); - paramFns.push_back(std::move(lon)); - paramFns.push_back(std::move(lat)); - paramFns.push_back(std::move(radius)); - paramFns.push_back(std::move(ts)); - paramFns.push_back(std::move(wkt)); + parameterFunctions.reserve(5); + parameterFunctions.push_back(std::move(lonFunction)); + parameterFunctions.push_back(std::move(latFunction)); + parameterFunctions.push_back(std::move(radiusFunction)); + parameterFunctions.push_back(std::move(timestampFunction)); + parameterFunctions.push_back(std::move(geometryFunction)); } VarVal EintersectsTcbufferGeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto lon = paramFns[0].execute(record, arena).cast(); - auto lat = paramFns[1].execute(record, arena).cast(); - auto radius = paramFns[2].execute(record, arena).cast(); - auto ts = paramFns[3].execute(record, arena).cast(); - auto wkt = paramFns[4].execute(record, arena); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto lon = parameterValues[0].cast>(); + auto lat = parameterValues[1].cast>(); + auto radius = parameterValues[2].cast>(); + auto timestamp = parameterValues[3].cast>(); + auto geometry = parameterValues[4].cast(); const auto result = nautilus::invoke( - +[](double lon, double lat, double radius, uint64_t ts, - const char* wkt, uint32_t wkt_len) -> double { - try { + +[](double lonValue, + double latValue, + double radiusValue, + uint64_t timestampValue, + const char* geometryPtr, + uint32_t geometrySize) -> int { + try + { MEOS::Meos::ensureMeosInitialized(); - // Build tcbuffer instant: point + radius → cbuffer → instant - std::string pt_str = fmt::format("POINT({} {})", lon, lat); - GSERIALIZED* pt_gs = geom_in(pt_str.c_str(), -1); - if (!pt_gs) return 0.0; - Cbuffer* cb = cbuffer_make(pt_gs, radius); - free(pt_gs); - if (!cb) return 0.0; - Temporal* tcb_inst = (Temporal*)tcbufferinst_make(cb, (TimestampTz)ts); - free(cb); - if (!tcb_inst) return 0.0; - // Build target geometry from null-terminated WKT copy - char* wkt_str = (char*)malloc(wkt_len + 1); - memcpy(wkt_str, wkt, wkt_len); - wkt_str[wkt_len] = '\0'; - GSERIALIZED* target_gs = geom_in(wkt_str, -1); - free(wkt_str); - if (!target_gs) { free(tcb_inst); return 0.0; } - int r = eintersects_tcbuffer_geo(tcb_inst, target_gs); - free(tcb_inst); - free(target_gs); - return r > 0 ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + if (!(lonValue >= -180.0 && lonValue <= 180.0 && latValue >= -90.0 && latValue <= 90.0)) return 0; + if (radiusValue < 0.0) return 0; + + const std::string timestampString = MEOS::Meos::convertEpochToTimestamp(timestampValue); + std::string tcbufferWkt = fmt::format("Cbuffer(Point({} {}),{})@{}", + lonValue, latValue, radiusValue, timestampString); + std::string staticGeometryWkt(geometryPtr, geometrySize); + + while (!staticGeometryWkt.empty() && (staticGeometryWkt.front() == '\'' || staticGeometryWkt.front() == '"')) + staticGeometryWkt.erase(staticGeometryWkt.begin()); + while (!staticGeometryWkt.empty() && (staticGeometryWkt.back() == '\'' || staticGeometryWkt.back() == '"')) + staticGeometryWkt.pop_back(); + + if (tcbufferWkt.empty() || staticGeometryWkt.empty()) return 0; + + Temporal* tcbuffer = tcbuffer_in(tcbufferWkt.c_str()); + if (!tcbuffer) return 0; + MEOS::Meos::StaticGeometry staticGeometry(staticGeometryWkt); + if (!staticGeometry.getGeometry()) { free(tcbuffer); return 0; } + + int r = eintersects_tcbuffer_geo(tcbuffer, staticGeometry.getGeometry()); + free(tcbuffer); + return r; + } + catch (const std::exception&) + { + return 0; + } }, - lon, lat, radius, ts, wkt); + lon, lat, radius, timestamp, geometry.getContent(), geometry.getContentSize()); return VarVal(result); } @@ -94,11 +114,12 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterE PRECONDITION(arguments.childFunctions.size() == 5, "EintersectsTcbufferGeoPhysicalFunction requires 5 children but got {}", arguments.childFunctions.size()); - return EintersectsTcbufferGeoPhysicalFunction(std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2]), - std::move(arguments.childFunctions[3]), - std::move(arguments.childFunctions[4])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + return EintersectsTcbufferGeoPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EintersectsTcbufferTcbufferPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EintersectsTcbufferTcbufferPhysicalFunction.cpp index b0adf16a3f..c9089bd5a6 100644 --- a/nes-physical-operators/src/Functions/Meos/EintersectsTcbufferTcbufferPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/EintersectsTcbufferTcbufferPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -20,75 +21,88 @@ #include #include #include +#include #include +#include #include #include -#include -#include extern "C" { #include -#include #include } namespace NES { -EintersectsTcbufferTcbufferPhysicalFunction::EintersectsTcbufferTcbufferPhysicalFunction( - PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction r1, PhysicalFunction ts1, - PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction r2, PhysicalFunction ts2) +EintersectsTcbufferTcbufferPhysicalFunction::EintersectsTcbufferTcbufferPhysicalFunction(PhysicalFunction lonAFunction, + PhysicalFunction latAFunction, + PhysicalFunction radiusAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction lonBFunction, + PhysicalFunction latBFunction, + PhysicalFunction radiusBFunction, + PhysicalFunction tsBFunction) { - paramFns.reserve(8); - paramFns.push_back(std::move(lon1)); - paramFns.push_back(std::move(lat1)); - paramFns.push_back(std::move(r1)); - paramFns.push_back(std::move(ts1)); - paramFns.push_back(std::move(lon2)); - paramFns.push_back(std::move(lat2)); - paramFns.push_back(std::move(r2)); - paramFns.push_back(std::move(ts2)); + parameterFunctions.reserve(8); + parameterFunctions.push_back(std::move(lonAFunction)); + parameterFunctions.push_back(std::move(latAFunction)); + parameterFunctions.push_back(std::move(radiusAFunction)); + parameterFunctions.push_back(std::move(tsAFunction)); + parameterFunctions.push_back(std::move(lonBFunction)); + parameterFunctions.push_back(std::move(latBFunction)); + parameterFunctions.push_back(std::move(radiusBFunction)); + parameterFunctions.push_back(std::move(tsBFunction)); } VarVal EintersectsTcbufferTcbufferPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto lon1 = paramFns[0].execute(record, arena).cast(); - auto lat1 = paramFns[1].execute(record, arena).cast(); - auto r1 = paramFns[2].execute(record, arena).cast(); - auto ts1 = paramFns[3].execute(record, arena).cast(); - auto lon2 = paramFns[4].execute(record, arena).cast(); - auto lat2 = paramFns[5].execute(record, arena).cast(); - auto r2 = paramFns[6].execute(record, arena).cast(); - auto ts2 = paramFns[7].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto lonA = parameterValues[0].cast>(); + auto latA = parameterValues[1].cast>(); + auto radiusA = parameterValues[2].cast>(); + auto tsA = parameterValues[3].cast>(); + auto lonB = parameterValues[4].cast>(); + auto latB = parameterValues[5].cast>(); + auto radiusB = parameterValues[6].cast>(); + auto tsB = parameterValues[7].cast>(); const auto result = nautilus::invoke( - +[](double lon1, double lat1, double r1, uint64_t ts1, - double lon2, double lat2, double r2, uint64_t ts2) -> double { - try { + +[](double lonAValue, double latAValue, double radiusAValue, uint64_t tsAValue, + double lonBValue, double latBValue, double radiusBValue, uint64_t tsBValue) -> int { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string pt1 = fmt::format("POINT({} {})", lon1, lat1); - GSERIALIZED* gs1 = geom_in(pt1.c_str(), -1); - if (!gs1) return 0.0; - Cbuffer* cb1 = cbuffer_make(gs1, r1); - free(gs1); - if (!cb1) return 0.0; - Temporal* tcb1 = (Temporal*)tcbufferinst_make(cb1, (TimestampTz)ts1); - free(cb1); - if (!tcb1) return 0.0; - std::string pt2 = fmt::format("POINT({} {})", lon2, lat2); - GSERIALIZED* gs2 = geom_in(pt2.c_str(), -1); - if (!gs2) { free(tcb1); return 0.0; } - Cbuffer* cb2 = cbuffer_make(gs2, r2); - free(gs2); - if (!cb2) { free(tcb1); return 0.0; } - Temporal* tcb2 = (Temporal*)tcbufferinst_make(cb2, (TimestampTz)ts2); - free(cb2); - if (!tcb2) { free(tcb1); return 0.0; } - int r = eintersects_tcbuffer_tcbuffer(tcb1, tcb2); - free(tcb1); free(tcb2); - return r > 0 ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + if (!(lonAValue >= -180.0 && lonAValue <= 180.0 && latAValue >= -90.0 && latAValue <= 90.0)) return 0; + if (!(lonBValue >= -180.0 && lonBValue <= 180.0 && latBValue >= -90.0 && latBValue <= 90.0)) return 0; + if (radiusAValue < 0.0 || radiusBValue < 0.0) return 0; + + const std::string tsAString = MEOS::Meos::convertEpochToTimestamp(tsAValue); + const std::string tsBString = MEOS::Meos::convertEpochToTimestamp(tsBValue); + std::string wktA = fmt::format("Cbuffer(Point({} {}),{})@{}", lonAValue, latAValue, radiusAValue, tsAString); + std::string wktB = fmt::format("Cbuffer(Point({} {}),{})@{}", lonBValue, latBValue, radiusBValue, tsBString); + + Temporal* tA = tcbuffer_in(wktA.c_str()); + if (!tA) return 0; + Temporal* tB = tcbuffer_in(wktB.c_str()); + if (!tB) { free(tA); return 0; } + + int r = eintersects_tcbuffer_tcbuffer(tA, tB); + free(tA); + free(tB); + return r; + } + catch (const std::exception&) + { + return 0; + } }, - lon1, lat1, r1, ts1, lon2, lat2, r2, ts2); + lonA, latA, radiusA, tsA, lonB, latB, radiusB, tsB); return VarVal(result); } @@ -99,14 +113,15 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterE PRECONDITION(arguments.childFunctions.size() == 8, "EintersectsTcbufferTcbufferPhysicalFunction requires 8 children but got {}", arguments.childFunctions.size()); - return EintersectsTcbufferTcbufferPhysicalFunction(std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2]), - std::move(arguments.childFunctions[3]), - std::move(arguments.childFunctions[4]), - std::move(arguments.childFunctions[5]), - std::move(arguments.childFunctions[6]), - std::move(arguments.childFunctions[7])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + auto arg5 = std::move(arguments.childFunctions[5]); + auto arg6 = std::move(arguments.childFunctions[6]); + auto arg7 = std::move(arguments.childFunctions[7]); + return EintersectsTcbufferTcbufferPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6), std::move(arg7)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EintersectsTgeoGeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EintersectsTgeoGeoPhysicalFunction.cpp index fa8a810099..c6a0ce3d7b 100644 --- a/nes-physical-operators/src/Functions/Meos/EintersectsTgeoGeoPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/EintersectsTgeoGeoPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -34,40 +35,75 @@ extern "C" { namespace NES { -EintersectsTgeoGeoPhysicalFunction::EintersectsTgeoGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, - PhysicalFunction ts, PhysicalFunction wkt) +EintersectsTgeoGeoPhysicalFunction::EintersectsTgeoGeoPhysicalFunction(PhysicalFunction lonFunction, + PhysicalFunction latFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction) { - paramFns.reserve(4); - paramFns.push_back(std::move(lon)); - paramFns.push_back(std::move(lat)); - paramFns.push_back(std::move(ts)); - paramFns.push_back(std::move(wkt)); + parameterFunctions.reserve(4); + parameterFunctions.push_back(std::move(lonFunction)); + parameterFunctions.push_back(std::move(latFunction)); + parameterFunctions.push_back(std::move(timestampFunction)); + parameterFunctions.push_back(std::move(geometryFunction)); } VarVal EintersectsTgeoGeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto lon = paramFns[0].execute(record, arena).cast(); - auto lat = paramFns[1].execute(record, arena).cast(); - auto ts = paramFns[2].execute(record, arena).cast(); - auto wkt = paramFns[3].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto lon = parameterValues[0].cast>(); + auto lat = parameterValues[1].cast>(); + auto timestamp = parameterValues[2].cast>(); + auto geometry = parameterValues[3].cast(); const auto result = nautilus::invoke( - +[](double lon, double lat, uint64_t ts, - const char* w, uint32_t wsz) -> double { - try { + +[](double lonValue, + double latValue, + uint64_t timestampValue, + const char* geometryPtr, + uint32_t geometrySize) -> int { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string wktStr(w, wsz); - std::string tgeoWkt = fmt::format("SRID=4326;POINT({},{})@{}", lon, lat, ts); - Temporal* tgeo = tgeompoint_in(tgeoWkt.c_str()); - if (!tgeo) return 0.0; - GSERIALIZED* gs = geom_in(wktStr.c_str(), -1); - if (!gs) { free(tgeo); return 0.0; } - int r = eintersects_tgeo_geo(tgeo, gs); - free(tgeo); free(gs); - return r > 0 ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + if (!(lonValue >= -180.0 && lonValue <= 180.0 && latValue >= -90.0 && latValue <= 90.0)) { + return 0; + } + + const std::string timestampString = MEOS::Meos::convertEpochToTimestamp(timestampValue); + std::string temporalGeometryWkt = fmt::format("SRID=4326;Point({} {})@{}", lonValue, latValue, timestampString); + std::string staticGeometryWkt(geometryPtr, geometrySize); + + while (!staticGeometryWkt.empty() && (staticGeometryWkt.front() == '\'' || staticGeometryWkt.front() == '"')) + staticGeometryWkt.erase(staticGeometryWkt.begin()); + while (!staticGeometryWkt.empty() && (staticGeometryWkt.back() == '\'' || staticGeometryWkt.back() == '"')) + staticGeometryWkt.pop_back(); + + if (temporalGeometryWkt.empty() || staticGeometryWkt.empty()) + return 0; + + MEOS::Meos::TemporalGeometry temporalGeometry(temporalGeometryWkt); + if (!temporalGeometry.getGeometry()) return 0; + MEOS::Meos::StaticGeometry staticGeometry(staticGeometryWkt); + if (!staticGeometry.getGeometry()) return 0; + + // MEOS spatial-relation call — same shape as TemporalEDWithin's + // edwithin_tgeo_geo, but specific MEOS function per generated operator. + // Real MEOS spatial-rel signature: int fn(const Temporal *, const GSERIALIZED *) + // (no `atstart` flag — that's specific to geog_dwithin / edwithin's 3-arg variant). + return eintersects_tgeo_geo(temporalGeometry.getGeometry(), + staticGeometry.getGeometry()); + } + catch (const std::exception&) + { + return 0; + } }, - lon, lat, ts, wkt); + lon, lat, timestamp, geometry.getContent(), geometry.getContentSize()); return VarVal(result); } @@ -78,10 +114,11 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterE PRECONDITION(arguments.childFunctions.size() == 4, "EintersectsTgeoGeoPhysicalFunction requires 4 children but got {}", arguments.childFunctions.size()); - return EintersectsTgeoGeoPhysicalFunction(std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2]), - std::move(arguments.childFunctions[3])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + return EintersectsTgeoGeoPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EintersectsTgeoTgeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EintersectsTgeoTgeoPhysicalFunction.cpp index f1b9a19f49..084439fd05 100644 --- a/nes-physical-operators/src/Functions/Meos/EintersectsTgeoTgeoPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/EintersectsTgeoTgeoPhysicalFunction.cpp @@ -13,10 +13,10 @@ */ #include + #include #include #include -#include #include #include #include @@ -34,42 +34,68 @@ extern "C" { namespace NES { -EintersectsTgeoTgeoPhysicalFunction::EintersectsTgeoTgeoPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction ts1, PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction ts2) +EintersectsTgeoTgeoPhysicalFunction::EintersectsTgeoTgeoPhysicalFunction(PhysicalFunction lonAFunction, + PhysicalFunction latAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction lonBFunction, + PhysicalFunction latBFunction, + PhysicalFunction tsBFunction) { - paramFns.reserve(6); - paramFns.push_back(std::move(lon1)); - paramFns.push_back(std::move(lat1)); - paramFns.push_back(std::move(ts1)); - paramFns.push_back(std::move(lon2)); - paramFns.push_back(std::move(lat2)); - paramFns.push_back(std::move(ts2)); + parameterFunctions.reserve(6); + parameterFunctions.push_back(std::move(lonAFunction)); + parameterFunctions.push_back(std::move(latAFunction)); + parameterFunctions.push_back(std::move(tsAFunction)); + parameterFunctions.push_back(std::move(lonBFunction)); + parameterFunctions.push_back(std::move(latBFunction)); + parameterFunctions.push_back(std::move(tsBFunction)); } VarVal EintersectsTgeoTgeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto lon1 = paramFns[0].execute(record, arena).cast(); - auto lat1 = paramFns[1].execute(record, arena).cast(); - auto ts1 = paramFns[2].execute(record, arena).cast(); - auto lon2 = paramFns[3].execute(record, arena).cast(); - auto lat2 = paramFns[4].execute(record, arena).cast(); - auto ts2 = paramFns[5].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto lonA = parameterValues[0].cast>(); + auto latA = parameterValues[1].cast>(); + auto tsA = parameterValues[2].cast>(); + auto lonB = parameterValues[3].cast>(); + auto latB = parameterValues[4].cast>(); + auto tsB = parameterValues[5].cast>(); + const auto result = nautilus::invoke( - +[](double lon1, double lat1, uint64_t ts1, - double lon2, double lat2, uint64_t ts2) -> double { - try { + +[](double lonAValue, double latAValue, uint64_t tsAValue, + double lonBValue, double latBValue, uint64_t tsBValue) -> int { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string wkt1 = fmt::format("SRID=4326;POINT({},{})@{}", lon1, lat1, ts1); - Temporal* t1 = tgeompoint_in(wkt1.c_str()); - if (!t1) return 0.0; - std::string wkt2 = fmt::format("SRID=4326;POINT({},{})@{}", lon2, lat2, ts2); - Temporal* t2 = tgeompoint_in(wkt2.c_str()); - if (!t2) { free(t1); return 0.0; } - int r = eintersects_tgeo_tgeo(t1, t2); - free(t1); free(t2); - return r > 0 ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + if (!(lonAValue >= -180.0 && lonAValue <= 180.0 && latAValue >= -90.0 && latAValue <= 90.0)) return 0; + if (!(lonBValue >= -180.0 && lonBValue <= 180.0 && latBValue >= -90.0 && latBValue <= 90.0)) return 0; + + const std::string tsAString = MEOS::Meos::convertEpochToTimestamp(tsAValue); + const std::string tsBString = MEOS::Meos::convertEpochToTimestamp(tsBValue); + std::string temporalGeometryAWkt = fmt::format("SRID=4326;Point({} {})@{}", lonAValue, latAValue, tsAString); + std::string temporalGeometryBWkt = fmt::format("SRID=4326;Point({} {})@{}", lonBValue, latBValue, tsBString); + + MEOS::Meos::TemporalGeometry temporalGeometryA(temporalGeometryAWkt); + if (!temporalGeometryA.getGeometry()) return 0; + MEOS::Meos::TemporalGeometry temporalGeometryB(temporalGeometryBWkt); + if (!temporalGeometryB.getGeometry()) return 0; + + // MEOS *_tgeo_tgeo spatial-relation: int fn(const Temporal*, const Temporal*). + return eintersects_tgeo_tgeo(temporalGeometryA.getGeometry(), + temporalGeometryB.getGeometry()); + } + catch (const std::exception&) + { + return 0; + } }, - lon1, lat1, ts1, lon2, lat2, ts2); + lonA, latA, tsA, lonB, latB, tsB); + return VarVal(result); } @@ -79,13 +105,13 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterE PRECONDITION(arguments.childFunctions.size() == 6, "EintersectsTgeoTgeoPhysicalFunction requires 6 children but got {}", arguments.childFunctions.size()); - return EintersectsTgeoTgeoPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2]), - std::move(arguments.childFunctions[3]), - std::move(arguments.childFunctions[4]), - std::move(arguments.childFunctions[5])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + auto arg5 = std::move(arguments.childFunctions[5]); + return EintersectsTgeoTgeoPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EintersectsTrgeometryGeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EintersectsTrgeometryGeoPhysicalFunction.cpp new file mode 100644 index 0000000000..30afdf09db --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EintersectsTrgeometryGeoPhysicalFunction.cpp @@ -0,0 +1,97 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +#include +} + +namespace NES { + +EintersectsTrgeometryGeoPhysicalFunction::EintersectsTrgeometryGeoPhysicalFunction(PhysicalFunction ref_wkt, PhysicalFunction x1, PhysicalFunction y1, PhysicalFunction theta1, PhysicalFunction ts1, PhysicalFunction tgt_wkt) { + paramFns.reserve(6); + paramFns.push_back(std::move(ref_wkt)); + paramFns.push_back(std::move(x1)); + paramFns.push_back(std::move(y1)); + paramFns.push_back(std::move(theta1)); + paramFns.push_back(std::move(ts1)); + paramFns.push_back(std::move(tgt_wkt)); +} + +VarVal EintersectsTrgeometryGeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { + auto ref_wkt = paramFns[0].execute(record, arena).cast(); + auto x1 = paramFns[1].execute(record, arena).cast(); + auto y1 = paramFns[2].execute(record, arena).cast(); + auto theta1 = paramFns[3].execute(record, arena).cast(); + auto ts1 = paramFns[4].execute(record, arena).cast(); + auto tgt_wkt = paramFns[5].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](const char* ref_wkt, uint32_t ref_wktsz, double x1, double y1, double theta1, uint64_t ts1, const char* tgt_wkt, uint32_t tgt_wktsz) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + char* ref1_str = (char*)malloc(ref_wktsz + 1); + memcpy(ref1_str, ref_wkt, ref_wktsz); ref1_str[ref_wktsz] = '\0'; + GSERIALIZED* gref1 = geom_in(ref1_str, -1); free(ref1_str); + if (!gref1) return 0.0; + Pose* pose1 = pose_make_2d(x1, y1, theta1, false, 0); + if (!pose1) { free(gref1); return 0.0; } + TInstant* inst1 = trgeometryinst_make(gref1, pose1, (TimestampTz)ts1); + free(gref1); free(pose1); + if (!inst1) return 0.0; + char* tgt_str = (char*)malloc(tgt_wktsz + 1); + memcpy(tgt_str, tgt_wkt, tgt_wktsz); tgt_str[tgt_wktsz] = '\0'; + GSERIALIZED* gs_tgt = geom_in(tgt_str, -1); free(tgt_str); + if (!gs_tgt) { free(inst1); return 0.0; } + int r = eintersects_trgeometry_geo((Temporal*)inst1, gs_tgt); + free(inst1); free(gs_tgt); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + ref_wkt, x1, y1, theta1, ts1, tgt_wkt); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEintersectsTrgeometryGeoPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size()==6, + "EintersectsTrgeometryGeoPhysicalFunction requires 6 children but got {}", + arguments.childFunctions.size()); + return EintersectsTrgeometryGeoPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4]), + std::move(arguments.childFunctions[5])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EintersectsTrgeometryTrgeometryPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EintersectsTrgeometryTrgeometryPhysicalFunction.cpp new file mode 100644 index 0000000000..5147d20668 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EintersectsTrgeometryTrgeometryPhysicalFunction.cpp @@ -0,0 +1,114 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +#include +} + +namespace NES { + +EintersectsTrgeometryTrgeometryPhysicalFunction::EintersectsTrgeometryTrgeometryPhysicalFunction(PhysicalFunction ref1_wkt, PhysicalFunction x1, PhysicalFunction y1, PhysicalFunction theta1, PhysicalFunction ts1, PhysicalFunction ref2_wkt, PhysicalFunction x2, PhysicalFunction y2, PhysicalFunction theta2, PhysicalFunction ts2) { + paramFns.reserve(10); + paramFns.push_back(std::move(ref1_wkt)); + paramFns.push_back(std::move(x1)); + paramFns.push_back(std::move(y1)); + paramFns.push_back(std::move(theta1)); + paramFns.push_back(std::move(ts1)); + paramFns.push_back(std::move(ref2_wkt)); + paramFns.push_back(std::move(x2)); + paramFns.push_back(std::move(y2)); + paramFns.push_back(std::move(theta2)); + paramFns.push_back(std::move(ts2)); +} + +VarVal EintersectsTrgeometryTrgeometryPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { + auto ref1_wkt = paramFns[0].execute(record, arena).cast(); + auto x1 = paramFns[1].execute(record, arena).cast(); + auto y1 = paramFns[2].execute(record, arena).cast(); + auto theta1 = paramFns[3].execute(record, arena).cast(); + auto ts1 = paramFns[4].execute(record, arena).cast(); + auto ref2_wkt = paramFns[5].execute(record, arena).cast(); + auto x2 = paramFns[6].execute(record, arena).cast(); + auto y2 = paramFns[7].execute(record, arena).cast(); + auto theta2 = paramFns[8].execute(record, arena).cast(); + auto ts2 = paramFns[9].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](const char* ref1_wkt, uint32_t ref1_wktsz, double x1, double y1, double theta1, uint64_t ts1, const char* ref2_wkt, uint32_t ref2_wktsz, double x2, double y2, double theta2, uint64_t ts2) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + char* ref1_str = (char*)malloc(ref1_wktsz + 1); + memcpy(ref1_str, ref1_wkt, ref1_wktsz); ref1_str[ref1_wktsz] = '\0'; + GSERIALIZED* gref1 = geom_in(ref1_str, -1); free(ref1_str); + if (!gref1) return 0.0; + Pose* pose1 = pose_make_2d(x1, y1, theta1, false, 0); + if (!pose1) { free(gref1); return 0.0; } + TInstant* inst1 = trgeometryinst_make(gref1, pose1, (TimestampTz)ts1); + free(gref1); free(pose1); + if (!inst1) return 0.0; + char* ref2_str = (char*)malloc(ref2_wktsz + 1); + memcpy(ref2_str, ref2_wkt, ref2_wktsz); ref2_str[ref2_wktsz] = '\0'; + GSERIALIZED* gref2 = geom_in(ref2_str, -1); free(ref2_str); + if (!gref2) return 0.0; + Pose* pose2 = pose_make_2d(x2, y2, theta2, false, 0); + if (!pose2) { free(gref2); return 0.0; } + TInstant* inst2 = trgeometryinst_make(gref2, pose2, (TimestampTz)ts2); + free(gref2); free(pose2); + if (!inst2) { free(inst1); return 0.0; } + int r = eintersects_trgeometry_trgeometry((Temporal*)inst1, (Temporal*)inst2); + free(inst1); free(inst2); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + ref1_wkt, x1, y1, theta1, ts1, ref2_wkt, x2, y2, theta2, ts2); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEintersectsTrgeometryTrgeometryPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size()==10, + "EintersectsTrgeometryTrgeometryPhysicalFunction requires 10 children but got {}", + arguments.childFunctions.size()); + return EintersectsTrgeometryTrgeometryPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4]), + std::move(arguments.childFunctions[5]), + std::move(arguments.childFunctions[6]), + std::move(arguments.childFunctions[7]), + std::move(arguments.childFunctions[8]), + std::move(arguments.childFunctions[9])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EtouchesTcbufferGeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EtouchesTcbufferGeoPhysicalFunction.cpp index cb9ab44e8e..2271289bf2 100644 --- a/nes-physical-operators/src/Functions/Meos/EtouchesTcbufferGeoPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/EtouchesTcbufferGeoPhysicalFunction.cpp @@ -13,77 +13,97 @@ */ #include + #include #include #include +#include #include #include #include #include +#include #include +#include #include #include -#include -#include -#include extern "C" { #include -#include #include } namespace NES { -EtouchesTcbufferGeoPhysicalFunction::EtouchesTcbufferGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, - PhysicalFunction radius, PhysicalFunction ts, - PhysicalFunction wkt) +EtouchesTcbufferGeoPhysicalFunction::EtouchesTcbufferGeoPhysicalFunction(PhysicalFunction lonFunction, + PhysicalFunction latFunction, + PhysicalFunction radiusFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction) { - paramFns.reserve(5); - paramFns.push_back(std::move(lon)); - paramFns.push_back(std::move(lat)); - paramFns.push_back(std::move(radius)); - paramFns.push_back(std::move(ts)); - paramFns.push_back(std::move(wkt)); + parameterFunctions.reserve(5); + parameterFunctions.push_back(std::move(lonFunction)); + parameterFunctions.push_back(std::move(latFunction)); + parameterFunctions.push_back(std::move(radiusFunction)); + parameterFunctions.push_back(std::move(timestampFunction)); + parameterFunctions.push_back(std::move(geometryFunction)); } VarVal EtouchesTcbufferGeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto lon = paramFns[0].execute(record, arena).cast(); - auto lat = paramFns[1].execute(record, arena).cast(); - auto radius = paramFns[2].execute(record, arena).cast(); - auto ts = paramFns[3].execute(record, arena).cast(); - auto wkt = paramFns[4].execute(record, arena); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto lon = parameterValues[0].cast>(); + auto lat = parameterValues[1].cast>(); + auto radius = parameterValues[2].cast>(); + auto timestamp = parameterValues[3].cast>(); + auto geometry = parameterValues[4].cast(); const auto result = nautilus::invoke( - +[](double lon, double lat, double radius, uint64_t ts, - const char* wkt, uint32_t wkt_len) -> double { - try { + +[](double lonValue, + double latValue, + double radiusValue, + uint64_t timestampValue, + const char* geometryPtr, + uint32_t geometrySize) -> int { + try + { MEOS::Meos::ensureMeosInitialized(); - // Build tcbuffer instant: point + radius → cbuffer → instant - std::string pt_str = fmt::format("POINT({} {})", lon, lat); - GSERIALIZED* pt_gs = geom_in(pt_str.c_str(), -1); - if (!pt_gs) return 0.0; - Cbuffer* cb = cbuffer_make(pt_gs, radius); - free(pt_gs); - if (!cb) return 0.0; - Temporal* tcb_inst = (Temporal*)tcbufferinst_make(cb, (TimestampTz)ts); - free(cb); - if (!tcb_inst) return 0.0; - // Build target geometry from null-terminated WKT copy - char* wkt_str = (char*)malloc(wkt_len + 1); - memcpy(wkt_str, wkt, wkt_len); - wkt_str[wkt_len] = '\0'; - GSERIALIZED* target_gs = geom_in(wkt_str, -1); - free(wkt_str); - if (!target_gs) { free(tcb_inst); return 0.0; } - int r = etouches_tcbuffer_geo(tcb_inst, target_gs); - free(tcb_inst); - free(target_gs); - return r > 0 ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + if (!(lonValue >= -180.0 && lonValue <= 180.0 && latValue >= -90.0 && latValue <= 90.0)) return 0; + if (radiusValue < 0.0) return 0; + + const std::string timestampString = MEOS::Meos::convertEpochToTimestamp(timestampValue); + std::string tcbufferWkt = fmt::format("Cbuffer(Point({} {}),{})@{}", + lonValue, latValue, radiusValue, timestampString); + std::string staticGeometryWkt(geometryPtr, geometrySize); + + while (!staticGeometryWkt.empty() && (staticGeometryWkt.front() == '\'' || staticGeometryWkt.front() == '"')) + staticGeometryWkt.erase(staticGeometryWkt.begin()); + while (!staticGeometryWkt.empty() && (staticGeometryWkt.back() == '\'' || staticGeometryWkt.back() == '"')) + staticGeometryWkt.pop_back(); + + if (tcbufferWkt.empty() || staticGeometryWkt.empty()) return 0; + + Temporal* tcbuffer = tcbuffer_in(tcbufferWkt.c_str()); + if (!tcbuffer) return 0; + MEOS::Meos::StaticGeometry staticGeometry(staticGeometryWkt); + if (!staticGeometry.getGeometry()) { free(tcbuffer); return 0; } + + int r = etouches_tcbuffer_geo(tcbuffer, staticGeometry.getGeometry()); + free(tcbuffer); + return r; + } + catch (const std::exception&) + { + return 0; + } }, - lon, lat, radius, ts, wkt); + lon, lat, radius, timestamp, geometry.getContent(), geometry.getContentSize()); return VarVal(result); } @@ -94,11 +114,12 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterE PRECONDITION(arguments.childFunctions.size() == 5, "EtouchesTcbufferGeoPhysicalFunction requires 5 children but got {}", arguments.childFunctions.size()); - return EtouchesTcbufferGeoPhysicalFunction(std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2]), - std::move(arguments.childFunctions[3]), - std::move(arguments.childFunctions[4])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + return EtouchesTcbufferGeoPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EtouchesTcbufferTcbufferPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EtouchesTcbufferTcbufferPhysicalFunction.cpp index 987ae7c18c..262642b94a 100644 --- a/nes-physical-operators/src/Functions/Meos/EtouchesTcbufferTcbufferPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/EtouchesTcbufferTcbufferPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -20,75 +21,88 @@ #include #include #include +#include #include +#include #include #include -#include -#include extern "C" { #include -#include #include } namespace NES { -EtouchesTcbufferTcbufferPhysicalFunction::EtouchesTcbufferTcbufferPhysicalFunction( - PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction r1, PhysicalFunction ts1, - PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction r2, PhysicalFunction ts2) +EtouchesTcbufferTcbufferPhysicalFunction::EtouchesTcbufferTcbufferPhysicalFunction(PhysicalFunction lonAFunction, + PhysicalFunction latAFunction, + PhysicalFunction radiusAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction lonBFunction, + PhysicalFunction latBFunction, + PhysicalFunction radiusBFunction, + PhysicalFunction tsBFunction) { - paramFns.reserve(8); - paramFns.push_back(std::move(lon1)); - paramFns.push_back(std::move(lat1)); - paramFns.push_back(std::move(r1)); - paramFns.push_back(std::move(ts1)); - paramFns.push_back(std::move(lon2)); - paramFns.push_back(std::move(lat2)); - paramFns.push_back(std::move(r2)); - paramFns.push_back(std::move(ts2)); + parameterFunctions.reserve(8); + parameterFunctions.push_back(std::move(lonAFunction)); + parameterFunctions.push_back(std::move(latAFunction)); + parameterFunctions.push_back(std::move(radiusAFunction)); + parameterFunctions.push_back(std::move(tsAFunction)); + parameterFunctions.push_back(std::move(lonBFunction)); + parameterFunctions.push_back(std::move(latBFunction)); + parameterFunctions.push_back(std::move(radiusBFunction)); + parameterFunctions.push_back(std::move(tsBFunction)); } VarVal EtouchesTcbufferTcbufferPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto lon1 = paramFns[0].execute(record, arena).cast(); - auto lat1 = paramFns[1].execute(record, arena).cast(); - auto r1 = paramFns[2].execute(record, arena).cast(); - auto ts1 = paramFns[3].execute(record, arena).cast(); - auto lon2 = paramFns[4].execute(record, arena).cast(); - auto lat2 = paramFns[5].execute(record, arena).cast(); - auto r2 = paramFns[6].execute(record, arena).cast(); - auto ts2 = paramFns[7].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto lonA = parameterValues[0].cast>(); + auto latA = parameterValues[1].cast>(); + auto radiusA = parameterValues[2].cast>(); + auto tsA = parameterValues[3].cast>(); + auto lonB = parameterValues[4].cast>(); + auto latB = parameterValues[5].cast>(); + auto radiusB = parameterValues[6].cast>(); + auto tsB = parameterValues[7].cast>(); const auto result = nautilus::invoke( - +[](double lon1, double lat1, double r1, uint64_t ts1, - double lon2, double lat2, double r2, uint64_t ts2) -> double { - try { + +[](double lonAValue, double latAValue, double radiusAValue, uint64_t tsAValue, + double lonBValue, double latBValue, double radiusBValue, uint64_t tsBValue) -> int { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string pt1 = fmt::format("POINT({} {})", lon1, lat1); - GSERIALIZED* gs1 = geom_in(pt1.c_str(), -1); - if (!gs1) return 0.0; - Cbuffer* cb1 = cbuffer_make(gs1, r1); - free(gs1); - if (!cb1) return 0.0; - Temporal* tcb1 = (Temporal*)tcbufferinst_make(cb1, (TimestampTz)ts1); - free(cb1); - if (!tcb1) return 0.0; - std::string pt2 = fmt::format("POINT({} {})", lon2, lat2); - GSERIALIZED* gs2 = geom_in(pt2.c_str(), -1); - if (!gs2) { free(tcb1); return 0.0; } - Cbuffer* cb2 = cbuffer_make(gs2, r2); - free(gs2); - if (!cb2) { free(tcb1); return 0.0; } - Temporal* tcb2 = (Temporal*)tcbufferinst_make(cb2, (TimestampTz)ts2); - free(cb2); - if (!tcb2) { free(tcb1); return 0.0; } - int r = etouches_tcbuffer_tcbuffer(tcb1, tcb2); - free(tcb1); free(tcb2); - return r > 0 ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + if (!(lonAValue >= -180.0 && lonAValue <= 180.0 && latAValue >= -90.0 && latAValue <= 90.0)) return 0; + if (!(lonBValue >= -180.0 && lonBValue <= 180.0 && latBValue >= -90.0 && latBValue <= 90.0)) return 0; + if (radiusAValue < 0.0 || radiusBValue < 0.0) return 0; + + const std::string tsAString = MEOS::Meos::convertEpochToTimestamp(tsAValue); + const std::string tsBString = MEOS::Meos::convertEpochToTimestamp(tsBValue); + std::string wktA = fmt::format("Cbuffer(Point({} {}),{})@{}", lonAValue, latAValue, radiusAValue, tsAString); + std::string wktB = fmt::format("Cbuffer(Point({} {}),{})@{}", lonBValue, latBValue, radiusBValue, tsBString); + + Temporal* tA = tcbuffer_in(wktA.c_str()); + if (!tA) return 0; + Temporal* tB = tcbuffer_in(wktB.c_str()); + if (!tB) { free(tA); return 0; } + + int r = etouches_tcbuffer_tcbuffer(tA, tB); + free(tA); + free(tB); + return r; + } + catch (const std::exception&) + { + return 0; + } }, - lon1, lat1, r1, ts1, lon2, lat2, r2, ts2); + lonA, latA, radiusA, tsA, lonB, latB, radiusB, tsB); return VarVal(result); } @@ -99,14 +113,15 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterE PRECONDITION(arguments.childFunctions.size() == 8, "EtouchesTcbufferTcbufferPhysicalFunction requires 8 children but got {}", arguments.childFunctions.size()); - return EtouchesTcbufferTcbufferPhysicalFunction(std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2]), - std::move(arguments.childFunctions[3]), - std::move(arguments.childFunctions[4]), - std::move(arguments.childFunctions[5]), - std::move(arguments.childFunctions[6]), - std::move(arguments.childFunctions[7])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + auto arg5 = std::move(arguments.childFunctions[5]); + auto arg6 = std::move(arguments.childFunctions[6]); + auto arg7 = std::move(arguments.childFunctions[7]); + return EtouchesTcbufferTcbufferPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6), std::move(arg7)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EtouchesTgeoGeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EtouchesTgeoGeoPhysicalFunction.cpp index f3be297dc5..059d3c36d4 100644 --- a/nes-physical-operators/src/Functions/Meos/EtouchesTgeoGeoPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/EtouchesTgeoGeoPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -34,40 +35,75 @@ extern "C" { namespace NES { -EtouchesTgeoGeoPhysicalFunction::EtouchesTgeoGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, - PhysicalFunction ts, PhysicalFunction wkt) +EtouchesTgeoGeoPhysicalFunction::EtouchesTgeoGeoPhysicalFunction(PhysicalFunction lonFunction, + PhysicalFunction latFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction) { - paramFns.reserve(4); - paramFns.push_back(std::move(lon)); - paramFns.push_back(std::move(lat)); - paramFns.push_back(std::move(ts)); - paramFns.push_back(std::move(wkt)); + parameterFunctions.reserve(4); + parameterFunctions.push_back(std::move(lonFunction)); + parameterFunctions.push_back(std::move(latFunction)); + parameterFunctions.push_back(std::move(timestampFunction)); + parameterFunctions.push_back(std::move(geometryFunction)); } VarVal EtouchesTgeoGeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto lon = paramFns[0].execute(record, arena).cast(); - auto lat = paramFns[1].execute(record, arena).cast(); - auto ts = paramFns[2].execute(record, arena).cast(); - auto wkt = paramFns[3].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto lon = parameterValues[0].cast>(); + auto lat = parameterValues[1].cast>(); + auto timestamp = parameterValues[2].cast>(); + auto geometry = parameterValues[3].cast(); const auto result = nautilus::invoke( - +[](double lon, double lat, uint64_t ts, - const char* w, uint32_t wsz) -> double { - try { + +[](double lonValue, + double latValue, + uint64_t timestampValue, + const char* geometryPtr, + uint32_t geometrySize) -> int { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string wktStr(w, wsz); - std::string tgeoWkt = fmt::format("SRID=4326;POINT({},{})@{}", lon, lat, ts); - Temporal* tgeo = tgeompoint_in(tgeoWkt.c_str()); - if (!tgeo) return 0.0; - GSERIALIZED* gs = geom_in(wktStr.c_str(), -1); - if (!gs) { free(tgeo); return 0.0; } - int r = etouches_tgeo_geo(tgeo, gs); - free(tgeo); free(gs); - return r > 0 ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + if (!(lonValue >= -180.0 && lonValue <= 180.0 && latValue >= -90.0 && latValue <= 90.0)) { + return 0; + } + + const std::string timestampString = MEOS::Meos::convertEpochToTimestamp(timestampValue); + std::string temporalGeometryWkt = fmt::format("SRID=4326;Point({} {})@{}", lonValue, latValue, timestampString); + std::string staticGeometryWkt(geometryPtr, geometrySize); + + while (!staticGeometryWkt.empty() && (staticGeometryWkt.front() == '\'' || staticGeometryWkt.front() == '"')) + staticGeometryWkt.erase(staticGeometryWkt.begin()); + while (!staticGeometryWkt.empty() && (staticGeometryWkt.back() == '\'' || staticGeometryWkt.back() == '"')) + staticGeometryWkt.pop_back(); + + if (temporalGeometryWkt.empty() || staticGeometryWkt.empty()) + return 0; + + MEOS::Meos::TemporalGeometry temporalGeometry(temporalGeometryWkt); + if (!temporalGeometry.getGeometry()) return 0; + MEOS::Meos::StaticGeometry staticGeometry(staticGeometryWkt); + if (!staticGeometry.getGeometry()) return 0; + + // MEOS spatial-relation call — same shape as TemporalEDWithin's + // edwithin_tgeo_geo, but specific MEOS function per generated operator. + // Real MEOS spatial-rel signature: int fn(const Temporal *, const GSERIALIZED *) + // (no `atstart` flag — that's specific to geog_dwithin / edwithin's 3-arg variant). + return etouches_tgeo_geo(temporalGeometry.getGeometry(), + staticGeometry.getGeometry()); + } + catch (const std::exception&) + { + return 0; + } }, - lon, lat, ts, wkt); + lon, lat, timestamp, geometry.getContent(), geometry.getContentSize()); return VarVal(result); } @@ -78,10 +114,11 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterE PRECONDITION(arguments.childFunctions.size() == 4, "EtouchesTgeoGeoPhysicalFunction requires 4 children but got {}", arguments.childFunctions.size()); - return EtouchesTgeoGeoPhysicalFunction(std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2]), - std::move(arguments.childFunctions[3])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + return EtouchesTgeoGeoPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EtouchesTgeoTgeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EtouchesTgeoTgeoPhysicalFunction.cpp index 502df9fc65..e371f5d717 100644 --- a/nes-physical-operators/src/Functions/Meos/EtouchesTgeoTgeoPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/EtouchesTgeoTgeoPhysicalFunction.cpp @@ -13,10 +13,10 @@ */ #include + #include #include #include -#include #include #include #include @@ -34,42 +34,68 @@ extern "C" { namespace NES { -EtouchesTgeoTgeoPhysicalFunction::EtouchesTgeoTgeoPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction ts1, PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction ts2) +EtouchesTgeoTgeoPhysicalFunction::EtouchesTgeoTgeoPhysicalFunction(PhysicalFunction lonAFunction, + PhysicalFunction latAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction lonBFunction, + PhysicalFunction latBFunction, + PhysicalFunction tsBFunction) { - paramFns.reserve(6); - paramFns.push_back(std::move(lon1)); - paramFns.push_back(std::move(lat1)); - paramFns.push_back(std::move(ts1)); - paramFns.push_back(std::move(lon2)); - paramFns.push_back(std::move(lat2)); - paramFns.push_back(std::move(ts2)); + parameterFunctions.reserve(6); + parameterFunctions.push_back(std::move(lonAFunction)); + parameterFunctions.push_back(std::move(latAFunction)); + parameterFunctions.push_back(std::move(tsAFunction)); + parameterFunctions.push_back(std::move(lonBFunction)); + parameterFunctions.push_back(std::move(latBFunction)); + parameterFunctions.push_back(std::move(tsBFunction)); } VarVal EtouchesTgeoTgeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto lon1 = paramFns[0].execute(record, arena).cast(); - auto lat1 = paramFns[1].execute(record, arena).cast(); - auto ts1 = paramFns[2].execute(record, arena).cast(); - auto lon2 = paramFns[3].execute(record, arena).cast(); - auto lat2 = paramFns[4].execute(record, arena).cast(); - auto ts2 = paramFns[5].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto lonA = parameterValues[0].cast>(); + auto latA = parameterValues[1].cast>(); + auto tsA = parameterValues[2].cast>(); + auto lonB = parameterValues[3].cast>(); + auto latB = parameterValues[4].cast>(); + auto tsB = parameterValues[5].cast>(); + const auto result = nautilus::invoke( - +[](double lon1, double lat1, uint64_t ts1, - double lon2, double lat2, uint64_t ts2) -> double { - try { + +[](double lonAValue, double latAValue, uint64_t tsAValue, + double lonBValue, double latBValue, uint64_t tsBValue) -> int { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string wkt1 = fmt::format("SRID=4326;POINT({},{})@{}", lon1, lat1, ts1); - Temporal* t1 = tgeompoint_in(wkt1.c_str()); - if (!t1) return 0.0; - std::string wkt2 = fmt::format("SRID=4326;POINT({},{})@{}", lon2, lat2, ts2); - Temporal* t2 = tgeompoint_in(wkt2.c_str()); - if (!t2) { free(t1); return 0.0; } - int r = etouches_tgeo_tgeo(t1, t2); - free(t1); free(t2); - return r > 0 ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + if (!(lonAValue >= -180.0 && lonAValue <= 180.0 && latAValue >= -90.0 && latAValue <= 90.0)) return 0; + if (!(lonBValue >= -180.0 && lonBValue <= 180.0 && latBValue >= -90.0 && latBValue <= 90.0)) return 0; + + const std::string tsAString = MEOS::Meos::convertEpochToTimestamp(tsAValue); + const std::string tsBString = MEOS::Meos::convertEpochToTimestamp(tsBValue); + std::string temporalGeometryAWkt = fmt::format("SRID=4326;Point({} {})@{}", lonAValue, latAValue, tsAString); + std::string temporalGeometryBWkt = fmt::format("SRID=4326;Point({} {})@{}", lonBValue, latBValue, tsBString); + + MEOS::Meos::TemporalGeometry temporalGeometryA(temporalGeometryAWkt); + if (!temporalGeometryA.getGeometry()) return 0; + MEOS::Meos::TemporalGeometry temporalGeometryB(temporalGeometryBWkt); + if (!temporalGeometryB.getGeometry()) return 0; + + // MEOS *_tgeo_tgeo spatial-relation: int fn(const Temporal*, const Temporal*). + return etouches_tgeo_tgeo(temporalGeometryA.getGeometry(), + temporalGeometryB.getGeometry()); + } + catch (const std::exception&) + { + return 0; + } }, - lon1, lat1, ts1, lon2, lat2, ts2); + lonA, latA, tsA, lonB, latB, tsB); + return VarVal(result); } @@ -79,13 +105,13 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterE PRECONDITION(arguments.childFunctions.size() == 6, "EtouchesTgeoTgeoPhysicalFunction requires 6 children but got {}", arguments.childFunctions.size()); - return EtouchesTgeoTgeoPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2]), - std::move(arguments.childFunctions[3]), - std::move(arguments.childFunctions[4]), - std::move(arguments.childFunctions[5])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + auto arg5 = std::move(arguments.childFunctions[5]); + return EtouchesTgeoTgeoPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EtouchesTrgeometryGeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EtouchesTrgeometryGeoPhysicalFunction.cpp new file mode 100644 index 0000000000..6bb5e3ba5d --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/EtouchesTrgeometryGeoPhysicalFunction.cpp @@ -0,0 +1,97 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +#include +} + +namespace NES { + +EtouchesTrgeometryGeoPhysicalFunction::EtouchesTrgeometryGeoPhysicalFunction(PhysicalFunction ref_wkt, PhysicalFunction x1, PhysicalFunction y1, PhysicalFunction theta1, PhysicalFunction ts1, PhysicalFunction tgt_wkt) { + paramFns.reserve(6); + paramFns.push_back(std::move(ref_wkt)); + paramFns.push_back(std::move(x1)); + paramFns.push_back(std::move(y1)); + paramFns.push_back(std::move(theta1)); + paramFns.push_back(std::move(ts1)); + paramFns.push_back(std::move(tgt_wkt)); +} + +VarVal EtouchesTrgeometryGeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { + auto ref_wkt = paramFns[0].execute(record, arena).cast(); + auto x1 = paramFns[1].execute(record, arena).cast(); + auto y1 = paramFns[2].execute(record, arena).cast(); + auto theta1 = paramFns[3].execute(record, arena).cast(); + auto ts1 = paramFns[4].execute(record, arena).cast(); + auto tgt_wkt = paramFns[5].execute(record, arena).cast(); + const auto result = nautilus::invoke( + +[](const char* ref_wkt, uint32_t ref_wktsz, double x1, double y1, double theta1, uint64_t ts1, const char* tgt_wkt, uint32_t tgt_wktsz) -> double { + try { + MEOS::Meos::ensureMeosInitialized(); + char* ref1_str = (char*)malloc(ref_wktsz + 1); + memcpy(ref1_str, ref_wkt, ref_wktsz); ref1_str[ref_wktsz] = '\0'; + GSERIALIZED* gref1 = geom_in(ref1_str, -1); free(ref1_str); + if (!gref1) return 0.0; + Pose* pose1 = pose_make_2d(x1, y1, theta1, false, 0); + if (!pose1) { free(gref1); return 0.0; } + TInstant* inst1 = trgeometryinst_make(gref1, pose1, (TimestampTz)ts1); + free(gref1); free(pose1); + if (!inst1) return 0.0; + char* tgt_str = (char*)malloc(tgt_wktsz + 1); + memcpy(tgt_str, tgt_wkt, tgt_wktsz); tgt_str[tgt_wktsz] = '\0'; + GSERIALIZED* gs_tgt = geom_in(tgt_str, -1); free(tgt_str); + if (!gs_tgt) { free(inst1); return 0.0; } + int r = etouches_trgeometry_geo((Temporal*)inst1, gs_tgt); + free(inst1); free(gs_tgt); + return r > 0 ? 1.0 : 0.0; + } catch (const std::exception&) { return 0.0; } + }, + ref_wkt, x1, y1, theta1, ts1, tgt_wkt); + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEtouchesTrgeometryGeoPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size()==6, + "EtouchesTrgeometryGeoPhysicalFunction requires 6 children but got {}", + arguments.childFunctions.size()); + return EtouchesTrgeometryGeoPhysicalFunction( + std::move(arguments.childFunctions[0]), + std::move(arguments.childFunctions[1]), + std::move(arguments.childFunctions[2]), + std::move(arguments.childFunctions[3]), + std::move(arguments.childFunctions[4]), + std::move(arguments.childFunctions[5])); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverEqBigintTbigintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverEqBigintTbigintPhysicalFunction.cpp index b287987b4f..26b13bbdcd 100644 --- a/nes-physical-operators/src/Functions/Meos/EverEqBigintTbigintPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/EverEqBigintTbigintPhysicalFunction.cpp @@ -35,12 +35,12 @@ extern "C" { namespace NES { -EverEqBigintTbigintPhysicalFunction::EverEqBigintTbigintPhysicalFunction(PhysicalFunction scalarFunction, - PhysicalFunction valueFunction, - PhysicalFunction tsFunction) +EverEqBigintTbigintPhysicalFunction::EverEqBigintTbigintPhysicalFunction(PhysicalFunction arg0Function, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction) { parameterFunctions.reserve(3); - parameterFunctions.push_back(std::move(scalarFunction)); + parameterFunctions.push_back(std::move(arg0Function)); parameterFunctions.push_back(std::move(valueFunction)); parameterFunctions.push_back(std::move(tsFunction)); } @@ -50,26 +50,35 @@ VarVal EverEqBigintTbigintPhysicalFunction::execute(const Record& record, ArenaR std::vector parameterValues; parameterValues.reserve(parameterFunctions.size()); for (const auto& function : parameterFunctions) + { parameterValues.emplace_back(function.execute(record, arena)); + } - auto scalar = parameterValues[0].cast>(); - auto value = parameterValues[1].cast>(); - auto ts = parameterValues[2].cast>(); + auto arg0 = parameterValues[0].cast>(); + auto value = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); const auto result = nautilus::invoke( - +[](double d, double v, uint64_t t) -> double { - try { + +[](double arg0, + double value, + uint64_t ts) -> int { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); - std::string wkt = fmt::format("{}@{}", static_cast(v), ts_str); - Temporal* temp = tbigint_in(wkt.c_str()); - if (!temp) return 0.0; - int r = ever_eq_bigint_tbigint(static_cast(d), temp); + std::string tempWkt = fmt::format("{}@{}", static_cast(value), MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tbigint_in(tempWkt.c_str()); + if (!temp) return 0; + + int r = ever_eq_bigint_tbigint(static_cast(arg0), temp); free(temp); - return static_cast(r); - } catch (const std::exception&) { return 0.0; } + return r; + } + catch (const std::exception&) + { + return 0; + } }, - scalar, value, ts); + arg0, value, ts); return VarVal(result); } diff --git a/nes-physical-operators/src/Functions/Meos/EverEqBoolTboolPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverEqBoolTboolPhysicalFunction.cpp index 2bcf7b5d88..ffcf426ecd 100644 --- a/nes-physical-operators/src/Functions/Meos/EverEqBoolTboolPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/EverEqBoolTboolPhysicalFunction.cpp @@ -35,12 +35,12 @@ extern "C" { namespace NES { -EverEqBoolTboolPhysicalFunction::EverEqBoolTboolPhysicalFunction(PhysicalFunction scalarFunction, - PhysicalFunction valueFunction, - PhysicalFunction tsFunction) +EverEqBoolTboolPhysicalFunction::EverEqBoolTboolPhysicalFunction(PhysicalFunction arg0Function, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction) { parameterFunctions.reserve(3); - parameterFunctions.push_back(std::move(scalarFunction)); + parameterFunctions.push_back(std::move(arg0Function)); parameterFunctions.push_back(std::move(valueFunction)); parameterFunctions.push_back(std::move(tsFunction)); } @@ -50,26 +50,35 @@ VarVal EverEqBoolTboolPhysicalFunction::execute(const Record& record, ArenaRef& std::vector parameterValues; parameterValues.reserve(parameterFunctions.size()); for (const auto& function : parameterFunctions) + { parameterValues.emplace_back(function.execute(record, arena)); + } - auto scalar = parameterValues[0].cast>(); - auto value = parameterValues[1].cast>(); - auto ts = parameterValues[2].cast>(); + auto arg0 = parameterValues[0].cast>(); + auto value = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); const auto result = nautilus::invoke( - +[](double b, double v, uint64_t t) -> double { - try { + +[](double arg0, + double value, + uint64_t ts) -> int { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); - std::string wkt = fmt::format("{}@{}", (v != 0.0 ? "t" : "f"), ts_str); - Temporal* temp = tbool_in(wkt.c_str()); - if (!temp) return 0.0; - int r = ever_eq_bool_tbool(static_cast(b != 0.0), temp); + std::string tempWkt = fmt::format("{}@{}", value != 0.0 ? "t" : "f", MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tbool_in(tempWkt.c_str()); + if (!temp) return 0; + + int r = ever_eq_bool_tbool(static_cast(arg0 != 0.0), temp); free(temp); - return static_cast(r); - } catch (const std::exception&) { return 0.0; } + return r; + } + catch (const std::exception&) + { + return 0; + } }, - scalar, value, ts); + arg0, value, ts); return VarVal(result); } diff --git a/nes-physical-operators/src/Functions/Meos/EverEqNpointTnpointPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverEqNpointTnpointPhysicalFunction.cpp index 172d4caa24..1e437c04dd 100644 --- a/nes-physical-operators/src/Functions/Meos/EverEqNpointTnpointPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/EverEqNpointTnpointPhysicalFunction.cpp @@ -13,61 +13,85 @@ */ #include + #include #include #include +#include #include #include #include #include +#include #include +#include #include #include -#include -#include extern "C" { #include -#include #include } namespace NES { -EverEqNpointTnpointPhysicalFunction::EverEqNpointTnpointPhysicalFunction(PhysicalFunction rid_np, PhysicalFunction pos_np, PhysicalFunction rid_tp, PhysicalFunction pos_tp, PhysicalFunction ts) +EverEqNpointTnpointPhysicalFunction::EverEqNpointTnpointPhysicalFunction(PhysicalFunction rid0Function, + PhysicalFunction frac0Function, + PhysicalFunction ridFunction, + PhysicalFunction fracFunction, + PhysicalFunction tsFunction) { - paramFns.reserve(5); - paramFns.push_back(std::move(rid_np)); - paramFns.push_back(std::move(pos_np)); - paramFns.push_back(std::move(rid_tp)); - paramFns.push_back(std::move(pos_tp)); - paramFns.push_back(std::move(ts)); + parameterFunctions.reserve(5); + parameterFunctions.push_back(std::move(rid0Function)); + parameterFunctions.push_back(std::move(frac0Function)); + parameterFunctions.push_back(std::move(ridFunction)); + parameterFunctions.push_back(std::move(fracFunction)); + parameterFunctions.push_back(std::move(tsFunction)); } VarVal EverEqNpointTnpointPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto rid_np = paramFns[0].execute(record, arena).cast(); - auto pos_np = paramFns[1].execute(record, arena).cast(); - auto rid_tp = paramFns[2].execute(record, arena).cast(); - auto pos_tp = paramFns[3].execute(record, arena).cast(); - auto ts = paramFns[4].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto rid0 = parameterValues[0].cast>(); + auto frac0 = parameterValues[1].cast>(); + auto rid = parameterValues[2].cast>(); + auto frac = parameterValues[3].cast>(); + auto ts = parameterValues[4].cast>(); + const auto result = nautilus::invoke( - +[](uint64_t rid_np, double pos_np, uint64_t rid_tp, double pos_tp, uint64_t ts) -> double { - try { + +[](uint64_t rid0, + double frac0, + int64_t rid, + double frac, + uint64_t ts) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - Npoint* np_s = npoint_make((int64_t)rid_np, pos_np); - if (!np_s) return 0.0; - Npoint* np_t = npoint_make((int64_t)rid_tp, pos_tp); - if (!np_t) { free(np_s); return 0.0; } - Temporal* inst = (Temporal*)tnpointinst_make(np_t, (TimestampTz)ts); - free(np_t); - if (!inst) { free(np_s); return 0.0; } - int r = ever_eq_npoint_tnpoint(np_s, inst); - free(np_s); free(inst); - return r > 0 ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + if (frac < 0.0 || frac > 1.0) return 0.0; + std::string tempWkt = fmt::format("NPoint({},{})@{}", rid, frac, MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tnpoint_in(tempWkt.c_str()); + if (!temp) return 0.0; + Npoint* np0 = npoint_make((int64_t)rid0, frac0); + if (!np0) { free(temp); return 0.0; } + + double r = ever_eq_npoint_tnpoint(np0, temp); + free(temp); + free(np0); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, - rid_np, pos_np, rid_tp, pos_tp, ts); + rid0, frac0, rid, frac, ts); + return VarVal(result); } @@ -77,12 +101,12 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterE PRECONDITION(arguments.childFunctions.size() == 5, "EverEqNpointTnpointPhysicalFunction requires 5 children but got {}", arguments.childFunctions.size()); - return EverEqNpointTnpointPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2]), - std::move(arguments.childFunctions[3]), - std::move(arguments.childFunctions[4])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + return EverEqNpointTnpointPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverEqPoseTposePhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverEqPoseTposePhysicalFunction.cpp index 4d2c2464a6..6a5afbf85d 100644 --- a/nes-physical-operators/src/Functions/Meos/EverEqPoseTposePhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/EverEqPoseTposePhysicalFunction.cpp @@ -13,65 +13,92 @@ */ #include + #include #include #include +#include #include #include #include #include +#include #include +#include #include #include -#include -#include extern "C" { #include -#include #include } namespace NES { -EverEqPoseTposePhysicalFunction::EverEqPoseTposePhysicalFunction(PhysicalFunction x2, PhysicalFunction y2, PhysicalFunction theta2, PhysicalFunction x, PhysicalFunction y, PhysicalFunction theta, PhysicalFunction ts) +EverEqPoseTposePhysicalFunction::EverEqPoseTposePhysicalFunction(PhysicalFunction px0Function, + PhysicalFunction py0Function, + PhysicalFunction ptheta0Function, + PhysicalFunction xFunction, + PhysicalFunction yFunction, + PhysicalFunction thetaFunction, + PhysicalFunction tsFunction) { - paramFns.reserve(7); - paramFns.push_back(std::move(x2)); - paramFns.push_back(std::move(y2)); - paramFns.push_back(std::move(theta2)); - paramFns.push_back(std::move(x)); - paramFns.push_back(std::move(y)); - paramFns.push_back(std::move(theta)); - paramFns.push_back(std::move(ts)); + parameterFunctions.reserve(7); + parameterFunctions.push_back(std::move(px0Function)); + parameterFunctions.push_back(std::move(py0Function)); + parameterFunctions.push_back(std::move(ptheta0Function)); + parameterFunctions.push_back(std::move(xFunction)); + parameterFunctions.push_back(std::move(yFunction)); + parameterFunctions.push_back(std::move(thetaFunction)); + parameterFunctions.push_back(std::move(tsFunction)); } VarVal EverEqPoseTposePhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto x2 = paramFns[0].execute(record, arena).cast(); - auto y2 = paramFns[1].execute(record, arena).cast(); - auto theta2 = paramFns[2].execute(record, arena).cast(); - auto x = paramFns[3].execute(record, arena).cast(); - auto y = paramFns[4].execute(record, arena).cast(); - auto theta = paramFns[5].execute(record, arena).cast(); - auto ts = paramFns[6].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto px0 = parameterValues[0].cast>(); + auto py0 = parameterValues[1].cast>(); + auto ptheta0 = parameterValues[2].cast>(); + auto x = parameterValues[3].cast>(); + auto y = parameterValues[4].cast>(); + auto theta = parameterValues[5].cast>(); + auto ts = parameterValues[6].cast>(); + const auto result = nautilus::invoke( - +[](double x2, double y2, double theta2, double x, double y, double theta, uint64_t ts) -> double { - try { + +[](double px0, + double py0, + double ptheta0, + double x, + double y, + double theta, + uint64_t ts) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - Pose* pose_s = pose_make_2d(x2, y2, theta2, false, 0); - if (!pose_s) return 0.0; - Pose* pose_t = pose_make_2d(x, y, theta, false, 0); - if (!pose_t) { free(pose_s); return 0.0; } - Temporal* inst = (Temporal*)tposeinst_make(pose_t, (TimestampTz)ts); - free(pose_t); - if (!inst) { free(pose_s); return 0.0; } - int r = ever_eq_pose_tpose(pose_s, inst); - free(pose_s); free(inst); - return r > 0 ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + std::string tempWkt = fmt::format("Pose(Point({} {}),{})@{}", x, y, theta, MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tpose_in(tempWkt.c_str()); + if (!temp) return 0.0; + Pose* pose0 = pose_make_2d(px0, py0, ptheta0, false, 0); + if (!pose0) { free(temp); return 0.0; } + + double r = ever_eq_pose_tpose(pose0, temp); + free(temp); + free(pose0); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, - x2, y2, theta2, x, y, theta, ts); + px0, py0, ptheta0, x, y, theta, ts); + return VarVal(result); } @@ -81,14 +108,14 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterE PRECONDITION(arguments.childFunctions.size() == 7, "EverEqPoseTposePhysicalFunction requires 7 children but got {}", arguments.childFunctions.size()); - return EverEqPoseTposePhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2]), - std::move(arguments.childFunctions[3]), - std::move(arguments.childFunctions[4]), - std::move(arguments.childFunctions[5]), - std::move(arguments.childFunctions[6])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + auto arg5 = std::move(arguments.childFunctions[5]); + auto arg6 = std::move(arguments.childFunctions[6]); + return EverEqPoseTposePhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverEqTbigintBigintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverEqTbigintBigintPhysicalFunction.cpp index bbbda8e3b1..5f64f6a0bb 100644 --- a/nes-physical-operators/src/Functions/Meos/EverEqTbigintBigintPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/EverEqTbigintBigintPhysicalFunction.cpp @@ -36,13 +36,13 @@ extern "C" { namespace NES { EverEqTbigintBigintPhysicalFunction::EverEqTbigintBigintPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction thresholdFunction, - PhysicalFunction tsFunction) + PhysicalFunction tsFunction, + PhysicalFunction arg0Function) { parameterFunctions.reserve(3); parameterFunctions.push_back(std::move(valueFunction)); - parameterFunctions.push_back(std::move(thresholdFunction)); parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } VarVal EverEqTbigintBigintPhysicalFunction::execute(const Record& record, ArenaRef& arena) const @@ -50,25 +50,35 @@ VarVal EverEqTbigintBigintPhysicalFunction::execute(const Record& record, ArenaR std::vector parameterValues; parameterValues.reserve(parameterFunctions.size()); for (const auto& function : parameterFunctions) + { parameterValues.emplace_back(function.execute(record, arena)); + } - auto value = parameterValues[0].cast>(); - auto threshold = parameterValues[1].cast>(); - auto ts = parameterValues[2].cast>(); + auto value = parameterValues[0].cast>(); + auto ts = parameterValues[1].cast>(); + auto arg0 = parameterValues[2].cast>(); const auto result = nautilus::invoke( - +[](double value, double threshold, uint64_t ts) -> double { - try { + +[](double value, + uint64_t ts, + double arg0) -> int { + try + { MEOS::Meos::ensureMeosInitialized(); std::string tempWkt = fmt::format("{}@{}", static_cast(value), MEOS::Meos::convertEpochToTimestamp(ts)); Temporal* temp = tbigint_in(tempWkt.c_str()); - if (!temp) return 0.0; - int r = ever_eq_tbigint_bigint(temp, static_cast(threshold)); + if (!temp) return 0; + + int r = ever_eq_tbigint_bigint(temp, static_cast(arg0)); free(temp); - return static_cast(r); - } catch (const std::exception&) { return 0.0; } + return r; + } + catch (const std::exception&) + { + return 0; + } }, - value, threshold, ts); + value, ts, arg0); return VarVal(result); } diff --git a/nes-physical-operators/src/Functions/Meos/EverEqTboolBoolPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverEqTboolBoolPhysicalFunction.cpp index b786054542..4d07abb020 100644 --- a/nes-physical-operators/src/Functions/Meos/EverEqTboolBoolPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/EverEqTboolBoolPhysicalFunction.cpp @@ -36,13 +36,13 @@ extern "C" { namespace NES { EverEqTboolBoolPhysicalFunction::EverEqTboolBoolPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction thresholdFunction, - PhysicalFunction tsFunction) + PhysicalFunction tsFunction, + PhysicalFunction arg0Function) { parameterFunctions.reserve(3); parameterFunctions.push_back(std::move(valueFunction)); - parameterFunctions.push_back(std::move(thresholdFunction)); parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } VarVal EverEqTboolBoolPhysicalFunction::execute(const Record& record, ArenaRef& arena) const @@ -50,26 +50,35 @@ VarVal EverEqTboolBoolPhysicalFunction::execute(const Record& record, ArenaRef& std::vector parameterValues; parameterValues.reserve(parameterFunctions.size()); for (const auto& function : parameterFunctions) + { parameterValues.emplace_back(function.execute(record, arena)); + } - auto value = parameterValues[0].cast>(); - auto threshold = parameterValues[1].cast>(); - auto ts = parameterValues[2].cast>(); + auto value = parameterValues[0].cast>(); + auto ts = parameterValues[1].cast>(); + auto arg0 = parameterValues[2].cast>(); const auto result = nautilus::invoke( - +[](double v, double thr, uint64_t t) -> double { - try { + +[](double value, + uint64_t ts, + double arg0) -> int { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); - std::string wkt = fmt::format("{}@{}", (v != 0.0 ? "t" : "f"), ts_str); - Temporal* temp = tbool_in(wkt.c_str()); - if (!temp) return 0.0; - int r = ever_eq_tbool_bool(temp, static_cast(thr != 0.0)); + std::string tempWkt = fmt::format("{}@{}", value != 0.0 ? "t" : "f", MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tbool_in(tempWkt.c_str()); + if (!temp) return 0; + + int r = ever_eq_tbool_bool(temp, static_cast(arg0 != 0.0)); free(temp); - return static_cast(r); - } catch (const std::exception&) { return 0.0; } + return r; + } + catch (const std::exception&) + { + return 0; + } }, - value, threshold, ts); + value, ts, arg0); return VarVal(result); } diff --git a/nes-physical-operators/src/Functions/Meos/EverEqTcbufferTcbufferPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverEqTcbufferTcbufferPhysicalFunction.cpp index 7f3fc0d69d..be5f58b771 100644 --- a/nes-physical-operators/src/Functions/Meos/EverEqTcbufferTcbufferPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/EverEqTcbufferTcbufferPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -20,75 +21,88 @@ #include #include #include +#include #include +#include #include #include -#include -#include extern "C" { #include -#include #include } namespace NES { -EverEqTcbufferTcbufferPhysicalFunction::EverEqTcbufferTcbufferPhysicalFunction( - PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction r1, PhysicalFunction ts1, - PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction r2, PhysicalFunction ts2) +EverEqTcbufferTcbufferPhysicalFunction::EverEqTcbufferTcbufferPhysicalFunction(PhysicalFunction lonAFunction, + PhysicalFunction latAFunction, + PhysicalFunction radiusAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction lonBFunction, + PhysicalFunction latBFunction, + PhysicalFunction radiusBFunction, + PhysicalFunction tsBFunction) { - paramFns.reserve(8); - paramFns.push_back(std::move(lon1)); - paramFns.push_back(std::move(lat1)); - paramFns.push_back(std::move(r1)); - paramFns.push_back(std::move(ts1)); - paramFns.push_back(std::move(lon2)); - paramFns.push_back(std::move(lat2)); - paramFns.push_back(std::move(r2)); - paramFns.push_back(std::move(ts2)); + parameterFunctions.reserve(8); + parameterFunctions.push_back(std::move(lonAFunction)); + parameterFunctions.push_back(std::move(latAFunction)); + parameterFunctions.push_back(std::move(radiusAFunction)); + parameterFunctions.push_back(std::move(tsAFunction)); + parameterFunctions.push_back(std::move(lonBFunction)); + parameterFunctions.push_back(std::move(latBFunction)); + parameterFunctions.push_back(std::move(radiusBFunction)); + parameterFunctions.push_back(std::move(tsBFunction)); } VarVal EverEqTcbufferTcbufferPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto lon1 = paramFns[0].execute(record, arena).cast(); - auto lat1 = paramFns[1].execute(record, arena).cast(); - auto r1 = paramFns[2].execute(record, arena).cast(); - auto ts1 = paramFns[3].execute(record, arena).cast(); - auto lon2 = paramFns[4].execute(record, arena).cast(); - auto lat2 = paramFns[5].execute(record, arena).cast(); - auto r2 = paramFns[6].execute(record, arena).cast(); - auto ts2 = paramFns[7].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto lonA = parameterValues[0].cast>(); + auto latA = parameterValues[1].cast>(); + auto radiusA = parameterValues[2].cast>(); + auto tsA = parameterValues[3].cast>(); + auto lonB = parameterValues[4].cast>(); + auto latB = parameterValues[5].cast>(); + auto radiusB = parameterValues[6].cast>(); + auto tsB = parameterValues[7].cast>(); const auto result = nautilus::invoke( - +[](double lon1, double lat1, double r1, uint64_t ts1, - double lon2, double lat2, double r2, uint64_t ts2) -> double { - try { + +[](double lonAValue, double latAValue, double radiusAValue, uint64_t tsAValue, + double lonBValue, double latBValue, double radiusBValue, uint64_t tsBValue) -> int { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string pt1 = fmt::format("POINT({} {})", lon1, lat1); - GSERIALIZED* gs1 = geom_in(pt1.c_str(), -1); - if (!gs1) return 0.0; - Cbuffer* cb1 = cbuffer_make(gs1, r1); - free(gs1); - if (!cb1) return 0.0; - Temporal* tcb1 = (Temporal*)tcbufferinst_make(cb1, (TimestampTz)ts1); - free(cb1); - if (!tcb1) return 0.0; - std::string pt2 = fmt::format("POINT({} {})", lon2, lat2); - GSERIALIZED* gs2 = geom_in(pt2.c_str(), -1); - if (!gs2) { free(tcb1); return 0.0; } - Cbuffer* cb2 = cbuffer_make(gs2, r2); - free(gs2); - if (!cb2) { free(tcb1); return 0.0; } - Temporal* tcb2 = (Temporal*)tcbufferinst_make(cb2, (TimestampTz)ts2); - free(cb2); - if (!tcb2) { free(tcb1); return 0.0; } - int r = ever_eq_tcbuffer_tcbuffer(tcb1, tcb2); - free(tcb1); free(tcb2); - return r > 0 ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + if (!(lonAValue >= -180.0 && lonAValue <= 180.0 && latAValue >= -90.0 && latAValue <= 90.0)) return 0; + if (!(lonBValue >= -180.0 && lonBValue <= 180.0 && latBValue >= -90.0 && latBValue <= 90.0)) return 0; + if (radiusAValue < 0.0 || radiusBValue < 0.0) return 0; + + const std::string tsAString = MEOS::Meos::convertEpochToTimestamp(tsAValue); + const std::string tsBString = MEOS::Meos::convertEpochToTimestamp(tsBValue); + std::string wktA = fmt::format("Cbuffer(Point({} {}),{})@{}", lonAValue, latAValue, radiusAValue, tsAString); + std::string wktB = fmt::format("Cbuffer(Point({} {}),{})@{}", lonBValue, latBValue, radiusBValue, tsBString); + + Temporal* tA = tcbuffer_in(wktA.c_str()); + if (!tA) return 0; + Temporal* tB = tcbuffer_in(wktB.c_str()); + if (!tB) { free(tA); return 0; } + + int r = ever_eq_tcbuffer_tcbuffer(tA, tB); + free(tA); + free(tB); + return r; + } + catch (const std::exception&) + { + return 0; + } }, - lon1, lat1, r1, ts1, lon2, lat2, r2, ts2); + lonA, latA, radiusA, tsA, lonB, latB, radiusB, tsB); return VarVal(result); } @@ -99,14 +113,15 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterE PRECONDITION(arguments.childFunctions.size() == 8, "EverEqTcbufferTcbufferPhysicalFunction requires 8 children but got {}", arguments.childFunctions.size()); - return EverEqTcbufferTcbufferPhysicalFunction(std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2]), - std::move(arguments.childFunctions[3]), - std::move(arguments.childFunctions[4]), - std::move(arguments.childFunctions[5]), - std::move(arguments.childFunctions[6]), - std::move(arguments.childFunctions[7])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + auto arg5 = std::move(arguments.childFunctions[5]); + auto arg6 = std::move(arguments.childFunctions[6]); + auto arg7 = std::move(arguments.childFunctions[7]); + return EverEqTcbufferTcbufferPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6), std::move(arg7)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverEqTextTtextPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverEqTextTtextPhysicalFunction.cpp index b220c17db5..07275d18f0 100644 --- a/nes-physical-operators/src/Functions/Meos/EverEqTextTtextPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/EverEqTextTtextPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -33,44 +34,59 @@ extern "C" { namespace NES { -EverEqTextTtextPhysicalFunction::EverEqTextTtextPhysicalFunction( - PhysicalFunction valueFunction, PhysicalFunction refFunction, PhysicalFunction tsFunction) +EverEqTextTtextPhysicalFunction::EverEqTextTtextPhysicalFunction(PhysicalFunction arg0Function, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction) { - paramFns.reserve(3); - paramFns.push_back(std::move(valueFunction)); - paramFns.push_back(std::move(refFunction)); - paramFns.push_back(std::move(tsFunction)); + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(arg0Function)); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); } VarVal EverEqTextTtextPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto ref = paramFns[0].execute(record, arena).cast(); - auto value = paramFns[1].execute(record, arena).cast(); - auto ts = paramFns[2].execute(record, arena).cast>(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto arg0 = parameterValues[0].cast(); + auto value = parameterValues[1].cast(); + auto ts = parameterValues[2].cast>(); const auto result = nautilus::invoke( - +[](const char* r, uint32_t rsz, const char* v, uint32_t vsz, uint64_t t) -> double { - try { + +[](const char* arg0Ptr, uint32_t arg0Size, + const char* valuePtr, uint32_t valueSize, + uint64_t ts) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string ref_str(r, rsz); - std::string val_str(v, vsz); - while (!ref_str.empty() && (ref_str.front() == '\'' || ref_str.front() == '"')) ref_str = ref_str.substr(1); - while (!ref_str.empty() && (ref_str.back() == '\'' || ref_str.back() == '"')) ref_str = ref_str.substr(0, ref_str.size()-1); - while (!val_str.empty() && (val_str.front() == '\'' || val_str.front() == '"')) val_str = val_str.substr(1); - while (!val_str.empty() && (val_str.back() == '\'' || val_str.back() == '"')) val_str = val_str.substr(0, val_str.size()-1); - std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); - std::string wkt = "'" + val_str + "'@" + ts_str; - Temporal* temp = ttext_in(wkt.c_str()); + std::string tempVal(valuePtr, valueSize); + while (!tempVal.empty() && (tempVal.front() == '\'' || tempVal.front() == '"')) tempVal.erase(tempVal.begin()); + while (!tempVal.empty() && (tempVal.back() == '\'' || tempVal.back() == '"')) tempVal.pop_back(); + std::string tempWkt = "'" + tempVal + "'@" + MEOS::Meos::convertEpochToTimestamp(ts); + Temporal* temp = ttext_in(tempWkt.c_str()); if (!temp) return 0.0; - text* txt = cstring_to_text(ref_str.c_str()); - if (!txt) { free(temp); return 0.0; } - int result = ever_eq_text_ttext(txt, temp); + std::string arg0S(arg0Ptr, arg0Size); + while (!arg0S.empty() && (arg0S.front() == '\'' || arg0S.front() == '"')) arg0S.erase(arg0S.begin()); + while (!arg0S.empty() && (arg0S.back() == '\'' || arg0S.back() == '"')) arg0S.pop_back(); + text* txt0 = cstring_to_text(arg0S.c_str()); + if (!txt0) { free(temp); return 0.0; } + + double r = ever_eq_text_ttext(txt0, temp); free(temp); - free(txt); - return static_cast(result); - } catch (const std::exception&) { return 0.0; } + free(txt0); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, - ref, value, ts); + arg0.getContent(), arg0.getContentSize(), value.getContent(), value.getContentSize(), ts); return VarVal(result); } @@ -81,10 +97,10 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterE PRECONDITION(arguments.childFunctions.size() == 3, "EverEqTextTtextPhysicalFunction requires 3 children but got {}", arguments.childFunctions.size()); - return EverEqTextTtextPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return EverEqTextTtextPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverEqTgeoGeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverEqTgeoGeoPhysicalFunction.cpp index 55f9b0af02..f5dfa1f28c 100644 --- a/nes-physical-operators/src/Functions/Meos/EverEqTgeoGeoPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/EverEqTgeoGeoPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -34,40 +35,75 @@ extern "C" { namespace NES { -EverEqTgeoGeoPhysicalFunction::EverEqTgeoGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, - PhysicalFunction ts, PhysicalFunction wkt) +EverEqTgeoGeoPhysicalFunction::EverEqTgeoGeoPhysicalFunction(PhysicalFunction lonFunction, + PhysicalFunction latFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction) { - paramFns.reserve(4); - paramFns.push_back(std::move(lon)); - paramFns.push_back(std::move(lat)); - paramFns.push_back(std::move(ts)); - paramFns.push_back(std::move(wkt)); + parameterFunctions.reserve(4); + parameterFunctions.push_back(std::move(lonFunction)); + parameterFunctions.push_back(std::move(latFunction)); + parameterFunctions.push_back(std::move(timestampFunction)); + parameterFunctions.push_back(std::move(geometryFunction)); } VarVal EverEqTgeoGeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto lon = paramFns[0].execute(record, arena).cast(); - auto lat = paramFns[1].execute(record, arena).cast(); - auto ts = paramFns[2].execute(record, arena).cast(); - auto wkt = paramFns[3].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto lon = parameterValues[0].cast>(); + auto lat = parameterValues[1].cast>(); + auto timestamp = parameterValues[2].cast>(); + auto geometry = parameterValues[3].cast(); const auto result = nautilus::invoke( - +[](double lon, double lat, uint64_t ts, - const char* w, uint32_t wsz) -> double { - try { + +[](double lonValue, + double latValue, + uint64_t timestampValue, + const char* geometryPtr, + uint32_t geometrySize) -> int { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string wktStr(w, wsz); - std::string tgeoWkt = fmt::format("SRID=4326;POINT({},{})@{}", lon, lat, ts); - Temporal* tgeo = tgeompoint_in(tgeoWkt.c_str()); - if (!tgeo) return 0.0; - GSERIALIZED* gs = geom_in(wktStr.c_str(), -1); - if (!gs) { free(tgeo); return 0.0; } - double r = ever_eq_tgeo_geo(tgeo, gs) > 0 ? 1.0 : 0.0; - free(tgeo); free(gs); - return r; - } catch (const std::exception&) { return 0.0; } + if (!(lonValue >= -180.0 && lonValue <= 180.0 && latValue >= -90.0 && latValue <= 90.0)) { + return 0; + } + + const std::string timestampString = MEOS::Meos::convertEpochToTimestamp(timestampValue); + std::string temporalGeometryWkt = fmt::format("SRID=4326;Point({} {})@{}", lonValue, latValue, timestampString); + std::string staticGeometryWkt(geometryPtr, geometrySize); + + while (!staticGeometryWkt.empty() && (staticGeometryWkt.front() == '\'' || staticGeometryWkt.front() == '"')) + staticGeometryWkt.erase(staticGeometryWkt.begin()); + while (!staticGeometryWkt.empty() && (staticGeometryWkt.back() == '\'' || staticGeometryWkt.back() == '"')) + staticGeometryWkt.pop_back(); + + if (temporalGeometryWkt.empty() || staticGeometryWkt.empty()) + return 0; + + MEOS::Meos::TemporalGeometry temporalGeometry(temporalGeometryWkt); + if (!temporalGeometry.getGeometry()) return 0; + MEOS::Meos::StaticGeometry staticGeometry(staticGeometryWkt); + if (!staticGeometry.getGeometry()) return 0; + + // MEOS spatial-relation call — same shape as TemporalEDWithin's + // edwithin_tgeo_geo, but specific MEOS function per generated operator. + // Real MEOS spatial-rel signature: int fn(const Temporal *, const GSERIALIZED *) + // (no `atstart` flag — that's specific to geog_dwithin / edwithin's 3-arg variant). + return ever_eq_tgeo_geo(temporalGeometry.getGeometry(), + staticGeometry.getGeometry()); + } + catch (const std::exception&) + { + return 0; + } }, - lon, lat, ts, wkt); + lon, lat, timestamp, geometry.getContent(), geometry.getContentSize()); return VarVal(result); } @@ -78,10 +114,11 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterE PRECONDITION(arguments.childFunctions.size() == 4, "EverEqTgeoGeoPhysicalFunction requires 4 children but got {}", arguments.childFunctions.size()); - return EverEqTgeoGeoPhysicalFunction(std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2]), - std::move(arguments.childFunctions[3])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + return EverEqTgeoGeoPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverEqTgeoTgeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverEqTgeoTgeoPhysicalFunction.cpp index 101c1833ed..f452b50fd3 100644 --- a/nes-physical-operators/src/Functions/Meos/EverEqTgeoTgeoPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/EverEqTgeoTgeoPhysicalFunction.cpp @@ -13,10 +13,10 @@ */ #include + #include #include #include -#include #include #include #include @@ -34,42 +34,68 @@ extern "C" { namespace NES { -EverEqTgeoTgeoPhysicalFunction::EverEqTgeoTgeoPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction ts1, PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction ts2) +EverEqTgeoTgeoPhysicalFunction::EverEqTgeoTgeoPhysicalFunction(PhysicalFunction lonAFunction, + PhysicalFunction latAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction lonBFunction, + PhysicalFunction latBFunction, + PhysicalFunction tsBFunction) { - paramFns.reserve(6); - paramFns.push_back(std::move(lon1)); - paramFns.push_back(std::move(lat1)); - paramFns.push_back(std::move(ts1)); - paramFns.push_back(std::move(lon2)); - paramFns.push_back(std::move(lat2)); - paramFns.push_back(std::move(ts2)); + parameterFunctions.reserve(6); + parameterFunctions.push_back(std::move(lonAFunction)); + parameterFunctions.push_back(std::move(latAFunction)); + parameterFunctions.push_back(std::move(tsAFunction)); + parameterFunctions.push_back(std::move(lonBFunction)); + parameterFunctions.push_back(std::move(latBFunction)); + parameterFunctions.push_back(std::move(tsBFunction)); } VarVal EverEqTgeoTgeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto lon1 = paramFns[0].execute(record, arena).cast(); - auto lat1 = paramFns[1].execute(record, arena).cast(); - auto ts1 = paramFns[2].execute(record, arena).cast(); - auto lon2 = paramFns[3].execute(record, arena).cast(); - auto lat2 = paramFns[4].execute(record, arena).cast(); - auto ts2 = paramFns[5].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto lonA = parameterValues[0].cast>(); + auto latA = parameterValues[1].cast>(); + auto tsA = parameterValues[2].cast>(); + auto lonB = parameterValues[3].cast>(); + auto latB = parameterValues[4].cast>(); + auto tsB = parameterValues[5].cast>(); + const auto result = nautilus::invoke( - +[](double lon1, double lat1, uint64_t ts1, - double lon2, double lat2, uint64_t ts2) -> double { - try { + +[](double lonAValue, double latAValue, uint64_t tsAValue, + double lonBValue, double latBValue, uint64_t tsBValue) -> int { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string wkt1 = fmt::format("SRID=4326;POINT({},{})@{}", lon1, lat1, ts1); - Temporal* t1 = tgeompoint_in(wkt1.c_str()); - if (!t1) return 0.0; - std::string wkt2 = fmt::format("SRID=4326;POINT({},{})@{}", lon2, lat2, ts2); - Temporal* t2 = tgeompoint_in(wkt2.c_str()); - if (!t2) { free(t1); return 0.0; } - int r = ever_eq_tgeo_tgeo(t1, t2); - free(t1); free(t2); - return r > 0 ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + if (!(lonAValue >= -180.0 && lonAValue <= 180.0 && latAValue >= -90.0 && latAValue <= 90.0)) return 0; + if (!(lonBValue >= -180.0 && lonBValue <= 180.0 && latBValue >= -90.0 && latBValue <= 90.0)) return 0; + + const std::string tsAString = MEOS::Meos::convertEpochToTimestamp(tsAValue); + const std::string tsBString = MEOS::Meos::convertEpochToTimestamp(tsBValue); + std::string temporalGeometryAWkt = fmt::format("SRID=4326;Point({} {})@{}", lonAValue, latAValue, tsAString); + std::string temporalGeometryBWkt = fmt::format("SRID=4326;Point({} {})@{}", lonBValue, latBValue, tsBString); + + MEOS::Meos::TemporalGeometry temporalGeometryA(temporalGeometryAWkt); + if (!temporalGeometryA.getGeometry()) return 0; + MEOS::Meos::TemporalGeometry temporalGeometryB(temporalGeometryBWkt); + if (!temporalGeometryB.getGeometry()) return 0; + + // MEOS *_tgeo_tgeo spatial-relation: int fn(const Temporal*, const Temporal*). + return ever_eq_tgeo_tgeo(temporalGeometryA.getGeometry(), + temporalGeometryB.getGeometry()); + } + catch (const std::exception&) + { + return 0; + } }, - lon1, lat1, ts1, lon2, lat2, ts2); + lonA, latA, tsA, lonB, latB, tsB); + return VarVal(result); } @@ -79,13 +105,13 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterE PRECONDITION(arguments.childFunctions.size() == 6, "EverEqTgeoTgeoPhysicalFunction requires 6 children but got {}", arguments.childFunctions.size()); - return EverEqTgeoTgeoPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2]), - std::move(arguments.childFunctions[3]), - std::move(arguments.childFunctions[4]), - std::move(arguments.childFunctions[5])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + auto arg5 = std::move(arguments.childFunctions[5]); + return EverEqTgeoTgeoPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverEqTh3indexH3indexPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverEqTh3indexH3indexPhysicalFunction.cpp index a488198ce1..b75429bb4a 100644 --- a/nes-physical-operators/src/Functions/Meos/EverEqTh3indexH3indexPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/EverEqTh3indexH3indexPhysicalFunction.cpp @@ -13,14 +13,18 @@ */ #include + #include #include #include +#include #include #include #include #include +#include #include +#include #include #include @@ -31,33 +35,49 @@ extern "C" { namespace NES { -EverEqTh3indexH3indexPhysicalFunction::EverEqTh3indexH3indexPhysicalFunction(PhysicalFunction cell, PhysicalFunction ts, - PhysicalFunction target) +EverEqTh3indexH3indexPhysicalFunction::EverEqTh3indexH3indexPhysicalFunction(PhysicalFunction cellFunction, + PhysicalFunction tsFunction, + PhysicalFunction arg0Function) { - paramFns.reserve(3); - paramFns.push_back(std::move(cell)); - paramFns.push_back(std::move(ts)); - paramFns.push_back(std::move(target)); + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(cellFunction)); + parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } VarVal EverEqTh3indexH3indexPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto cell = paramFns[0].execute(record, arena).cast(); - auto ts = paramFns[1].execute(record, arena).cast(); - auto target = paramFns[2].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto cell = parameterValues[0].cast>(); + auto ts = parameterValues[1].cast>(); + auto arg0 = parameterValues[2].cast>(); const auto result = nautilus::invoke( - +[](uint64_t cell, uint64_t ts, uint64_t target) -> double { - try { + +[](uint64_t cell, + uint64_t ts, + uint64_t arg0) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - Temporal* inst = th3indexinst_make((H3Index)cell, (TimestampTz)ts); - if (!inst) return 0.0; - int r = ever_eq_th3index_h3index(inst, (H3Index)target); - free(inst); - return r > 0 ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + Temporal* temp = th3indexinst_make((H3Index)cell, (TimestampTz)ts); + if (!temp) return 0.0; + + double r = ever_eq_th3index_h3index(temp, (H3Index)arg0); + free(temp); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, - cell, ts, target); + cell, ts, arg0); return VarVal(result); } @@ -68,9 +88,10 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterE PRECONDITION(arguments.childFunctions.size() == 3, "EverEqTh3indexH3indexPhysicalFunction requires 3 children but got {}", arguments.childFunctions.size()); - return EverEqTh3indexH3indexPhysicalFunction(std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return EverEqTh3indexH3indexPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverEqTjsonbJsonbPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverEqTjsonbJsonbPhysicalFunction.cpp index 92dea4c786..919d64afbb 100644 --- a/nes-physical-operators/src/Functions/Meos/EverEqTjsonbJsonbPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/EverEqTjsonbJsonbPhysicalFunction.cpp @@ -13,18 +13,20 @@ */ #include + #include #include #include +#include #include #include #include #include +#include #include +#include #include #include -#include -#include extern "C" { #include @@ -33,40 +35,58 @@ extern "C" { namespace NES { -EverEqTjsonbJsonbPhysicalFunction::EverEqTjsonbJsonbPhysicalFunction(PhysicalFunction json_str, PhysicalFunction ts, PhysicalFunction target_json) +EverEqTjsonbJsonbPhysicalFunction::EverEqTjsonbJsonbPhysicalFunction(PhysicalFunction json_strFunction, + PhysicalFunction tsFunction, + PhysicalFunction arg0Function) { - paramFns.reserve(3); - paramFns.push_back(std::move(json_str)); - paramFns.push_back(std::move(ts)); - paramFns.push_back(std::move(target_json)); + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(json_strFunction)); + parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } VarVal EverEqTjsonbJsonbPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto json_str = paramFns[0].execute(record, arena); - auto ts = paramFns[1].execute(record, arena).cast(); - auto target_json = paramFns[2].execute(record, arena); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto json_str = parameterValues[0].cast(); + auto ts = parameterValues[1].cast>(); + auto arg0 = parameterValues[2].cast(); + const auto result = nautilus::invoke( - +[](const char* json_str, uint32_t json_len, uint64_t ts, const char* target_json, uint32_t target_len) -> double { - try { + +[](const char* json_strPtr, uint32_t json_strSize, + uint64_t ts, + const char* arg0Ptr, uint32_t arg0Size) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - char* s1 = (char*)malloc(json_len + 1); - memcpy(s1, json_str, json_len); s1[json_len] = '\0'; - Jsonb* jb = jsonb_in(s1); free(s1); - if (!jb) return 0.0; - TInstant* inst = tjsonbinst_make(jb, (TimestampTz)ts); - free(jb); - if (!inst) return 0.0; - char* s2 = (char*)malloc(target_len + 1); - memcpy(s2, target_json, target_len); s2[target_len] = '\0'; - Jsonb* target = jsonb_in(s2); free(s2); - if (!target) { free(inst); return 0.0; } - bool r = ever_eq_tjsonb_jsonb((Temporal*)inst, target) > 0; - free(inst); free(target); - return r ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + std::string tempS(json_strPtr, json_strSize); + Jsonb* tempJb = jsonb_in(tempS.c_str()); + if (!tempJb) return 0.0; + Temporal* temp = (Temporal*)tjsonbinst_make(tempJb, (TimestampTz)ts); + free(tempJb); + if (!temp) return 0.0; + std::string arg0S(arg0Ptr, arg0Size); + Jsonb* jb0 = jsonb_in(arg0S.c_str()); + if (!jb0) { free(temp); return 0.0; } + + double r = ever_eq_tjsonb_jsonb(temp, jb0); + free(temp); + free(jb0); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, - json_str, ts, target_json); + json_str.getContent(), json_str.getContentSize(), ts, arg0.getContent(), arg0.getContentSize()); + return VarVal(result); } @@ -76,10 +96,10 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterE PRECONDITION(arguments.childFunctions.size() == 3, "EverEqTjsonbJsonbPhysicalFunction requires 3 children but got {}", arguments.childFunctions.size()); - return EverEqTjsonbJsonbPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return EverEqTjsonbJsonbPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverEqTjsonbTjsonbPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverEqTjsonbTjsonbPhysicalFunction.cpp index bbfb0752bb..327c282b11 100644 --- a/nes-physical-operators/src/Functions/Meos/EverEqTjsonbTjsonbPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/EverEqTjsonbTjsonbPhysicalFunction.cpp @@ -13,18 +13,20 @@ */ #include + #include #include #include +#include #include #include #include #include +#include #include +#include #include #include -#include -#include extern "C" { #include @@ -33,45 +35,65 @@ extern "C" { namespace NES { -EverEqTjsonbTjsonbPhysicalFunction::EverEqTjsonbTjsonbPhysicalFunction(PhysicalFunction json1, PhysicalFunction ts1, PhysicalFunction json2, PhysicalFunction ts2) +EverEqTjsonbTjsonbPhysicalFunction::EverEqTjsonbTjsonbPhysicalFunction(PhysicalFunction json_strFunction, + PhysicalFunction tsFunction, + PhysicalFunction json0Function, + PhysicalFunction ts0Function) { - paramFns.reserve(4); - paramFns.push_back(std::move(json1)); - paramFns.push_back(std::move(ts1)); - paramFns.push_back(std::move(json2)); - paramFns.push_back(std::move(ts2)); + parameterFunctions.reserve(4); + parameterFunctions.push_back(std::move(json_strFunction)); + parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(json0Function)); + parameterFunctions.push_back(std::move(ts0Function)); } VarVal EverEqTjsonbTjsonbPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto json1 = paramFns[0].execute(record, arena); - auto ts1 = paramFns[1].execute(record, arena).cast(); - auto json2 = paramFns[2].execute(record, arena); - auto ts2 = paramFns[3].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto json_str = parameterValues[0].cast(); + auto ts = parameterValues[1].cast>(); + auto json0 = parameterValues[2].cast(); + auto ts0 = parameterValues[3].cast>(); + const auto result = nautilus::invoke( - +[](const char* json1, uint32_t json1_len, uint64_t ts1, const char* json2, uint32_t json2_len, uint64_t ts2) -> double { - try { + +[](const char* json_strPtr, uint32_t json_strSize, + uint64_t ts, + const char* json0Ptr, uint32_t json0Size, + uint64_t ts0) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - char* s1 = (char*)malloc(json1_len + 1); - memcpy(s1, json1, json1_len); s1[json1_len] = '\0'; - Jsonb* jb1 = jsonb_in(s1); free(s1); - if (!jb1) return 0.0; - TInstant* inst1 = tjsonbinst_make(jb1, (TimestampTz)ts1); - free(jb1); - if (!inst1) return 0.0; - char* s2 = (char*)malloc(json2_len + 1); - memcpy(s2, json2, json2_len); s2[json2_len] = '\0'; - Jsonb* jb2 = jsonb_in(s2); free(s2); - if (!jb2) { free(inst1); return 0.0; } - TInstant* inst2 = tjsonbinst_make(jb2, (TimestampTz)ts2); - free(jb2); - if (!inst2) { free(inst1); return 0.0; } - int r = ever_eq_tjsonb_tjsonb((Temporal*)inst1, (Temporal*)inst2); - free(inst1); free(inst2); - return r > 0 ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + std::string tempS(json_strPtr, json_strSize); + Jsonb* tempJb = jsonb_in(tempS.c_str()); + if (!tempJb) return 0.0; + Temporal* temp = (Temporal*)tjsonbinst_make(tempJb, (TimestampTz)ts); + free(tempJb); + if (!temp) return 0.0; + std::string json0S(json0Ptr, json0Size); + Jsonb* jb0 = jsonb_in(json0S.c_str()); + if (!jb0) { free(temp); return 0.0; } + Temporal* inst0 = (Temporal*)tjsonbinst_make(jb0, (TimestampTz)ts0); + free(jb0); + if (!inst0) { free(temp); return 0.0; } + + double r = ever_eq_tjsonb_tjsonb(temp, inst0); + free(temp); + free(inst0); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, - json1, ts1, json2, ts2); + json_str.getContent(), json_str.getContentSize(), ts, json0.getContent(), json0.getContentSize(), ts0); + return VarVal(result); } @@ -81,11 +103,11 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterE PRECONDITION(arguments.childFunctions.size() == 4, "EverEqTjsonbTjsonbPhysicalFunction requires 4 children but got {}", arguments.childFunctions.size()); - return EverEqTjsonbTjsonbPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2]), - std::move(arguments.childFunctions[3])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + return EverEqTjsonbTjsonbPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverEqTnpointNpointPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverEqTnpointNpointPhysicalFunction.cpp index 3e5ec5e1d5..93f799f876 100644 --- a/nes-physical-operators/src/Functions/Meos/EverEqTnpointNpointPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/EverEqTnpointNpointPhysicalFunction.cpp @@ -13,61 +13,85 @@ */ #include + #include #include #include +#include #include #include #include #include +#include #include +#include #include #include -#include -#include extern "C" { #include -#include #include } namespace NES { -EverEqTnpointNpointPhysicalFunction::EverEqTnpointNpointPhysicalFunction(PhysicalFunction rid1, PhysicalFunction pos1, PhysicalFunction ts, PhysicalFunction rid2, PhysicalFunction pos2) +EverEqTnpointNpointPhysicalFunction::EverEqTnpointNpointPhysicalFunction(PhysicalFunction ridFunction, + PhysicalFunction fracFunction, + PhysicalFunction tsFunction, + PhysicalFunction rid0Function, + PhysicalFunction frac0Function) { - paramFns.reserve(5); - paramFns.push_back(std::move(rid1)); - paramFns.push_back(std::move(pos1)); - paramFns.push_back(std::move(ts)); - paramFns.push_back(std::move(rid2)); - paramFns.push_back(std::move(pos2)); + parameterFunctions.reserve(5); + parameterFunctions.push_back(std::move(ridFunction)); + parameterFunctions.push_back(std::move(fracFunction)); + parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(rid0Function)); + parameterFunctions.push_back(std::move(frac0Function)); } VarVal EverEqTnpointNpointPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto rid1 = paramFns[0].execute(record, arena).cast(); - auto pos1 = paramFns[1].execute(record, arena).cast(); - auto ts = paramFns[2].execute(record, arena).cast(); - auto rid2 = paramFns[3].execute(record, arena).cast(); - auto pos2 = paramFns[4].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto rid = parameterValues[0].cast>(); + auto frac = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + auto rid0 = parameterValues[3].cast>(); + auto frac0 = parameterValues[4].cast>(); + const auto result = nautilus::invoke( - +[](uint64_t rid1, double pos1, uint64_t ts, uint64_t rid2, double pos2) -> double { - try { + +[](int64_t rid, + double frac, + uint64_t ts, + uint64_t rid0, + double frac0) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - Npoint* np1 = npoint_make((int64_t)rid1, pos1); - if (!np1) return 0.0; - Temporal* inst = (Temporal*)tnpointinst_make(np1, (TimestampTz)ts); - free(np1); - if (!inst) return 0.0; - Npoint* np2 = npoint_make((int64_t)rid2, pos2); - if (!np2) { free(inst); return 0.0; } - int r = ever_eq_tnpoint_npoint(inst, np2); - free(inst); free(np2); - return r > 0 ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + if (frac < 0.0 || frac > 1.0) return 0.0; + std::string tempWkt = fmt::format("NPoint({},{})@{}", rid, frac, MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tnpoint_in(tempWkt.c_str()); + if (!temp) return 0.0; + Npoint* np0 = npoint_make((int64_t)rid0, frac0); + if (!np0) { free(temp); return 0.0; } + + double r = ever_eq_tnpoint_npoint(temp, np0); + free(temp); + free(np0); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, - rid1, pos1, ts, rid2, pos2); + rid, frac, ts, rid0, frac0); + return VarVal(result); } @@ -77,12 +101,12 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterE PRECONDITION(arguments.childFunctions.size() == 5, "EverEqTnpointNpointPhysicalFunction requires 5 children but got {}", arguments.childFunctions.size()); - return EverEqTnpointNpointPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2]), - std::move(arguments.childFunctions[3]), - std::move(arguments.childFunctions[4])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + return EverEqTnpointNpointPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverEqTnpointTnpointPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverEqTnpointTnpointPhysicalFunction.cpp index 438f74a8b6..591b754822 100644 --- a/nes-physical-operators/src/Functions/Meos/EverEqTnpointTnpointPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/EverEqTnpointTnpointPhysicalFunction.cpp @@ -13,17 +13,20 @@ */ #include + #include #include #include +#include #include #include #include #include +#include #include +#include #include #include -#include extern "C" { #include @@ -32,49 +35,69 @@ extern "C" { namespace NES { -EverEqTnpointTnpointPhysicalFunction::EverEqTnpointTnpointPhysicalFunction( - PhysicalFunction rid1, PhysicalFunction pos1, PhysicalFunction ts1, - PhysicalFunction rid2, PhysicalFunction pos2, PhysicalFunction ts2) +EverEqTnpointTnpointPhysicalFunction::EverEqTnpointTnpointPhysicalFunction(PhysicalFunction ridFunction, + PhysicalFunction fracFunction, + PhysicalFunction tsFunction, + PhysicalFunction rid0Function, + PhysicalFunction frac0Function, + PhysicalFunction ts0Function) { - paramFns.reserve(6); - paramFns.push_back(std::move(rid1)); - paramFns.push_back(std::move(pos1)); - paramFns.push_back(std::move(ts1)); - paramFns.push_back(std::move(rid2)); - paramFns.push_back(std::move(pos2)); - paramFns.push_back(std::move(ts2)); + parameterFunctions.reserve(6); + parameterFunctions.push_back(std::move(ridFunction)); + parameterFunctions.push_back(std::move(fracFunction)); + parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(rid0Function)); + parameterFunctions.push_back(std::move(frac0Function)); + parameterFunctions.push_back(std::move(ts0Function)); } VarVal EverEqTnpointTnpointPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto rid1 = paramFns[0].execute(record, arena).cast(); - auto pos1 = paramFns[1].execute(record, arena).cast(); - auto ts1 = paramFns[2].execute(record, arena).cast(); - auto rid2 = paramFns[3].execute(record, arena).cast(); - auto pos2 = paramFns[4].execute(record, arena).cast(); - auto ts2 = paramFns[5].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto rid = parameterValues[0].cast>(); + auto frac = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + auto rid0 = parameterValues[3].cast>(); + auto frac0 = parameterValues[4].cast>(); + auto ts0 = parameterValues[5].cast>(); const auto result = nautilus::invoke( - +[](uint64_t rid1, double pos1, uint64_t ts1, - uint64_t rid2, double pos2, uint64_t ts2) -> double { - try { + +[](int64_t rid, + double frac, + uint64_t ts, + uint64_t rid0, + double frac0, + uint64_t ts0) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - Npoint* np1 = npoint_make((int64_t)rid1, pos1); - if (!np1) return 0.0; - Temporal* inst1 = (Temporal*)tnpointinst_make(np1, (TimestampTz)ts1); - free(np1); - if (!inst1) return 0.0; - Npoint* np2 = npoint_make((int64_t)rid2, pos2); - if (!np2) { free(inst1); return 0.0; } - Temporal* inst2 = (Temporal*)tnpointinst_make(np2, (TimestampTz)ts2); - free(np2); - if (!inst2) { free(inst1); return 0.0; } - int r = ever_eq_tnpoint_tnpoint(inst1, inst2); - free(inst1); free(inst2); - return r > 0 ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + if (frac < 0.0 || frac > 1.0) return 0.0; + std::string tempWkt = fmt::format("NPoint({},{})@{}", rid, frac, MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tnpoint_in(tempWkt.c_str()); + if (!temp) return 0.0; + Npoint* np0 = npoint_make((int64_t)rid0, frac0); + if (!np0) { free(temp); return 0.0; } + Temporal* inst0 = (Temporal*)tnpointinst_make(np0, (TimestampTz)ts0); + free(np0); + if (!inst0) { free(temp); return 0.0; } + + double r = ever_eq_tnpoint_tnpoint(temp, inst0); + free(temp); + free(inst0); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, - rid1, pos1, ts1, rid2, pos2, ts2); + rid, frac, ts, rid0, frac0, ts0); return VarVal(result); } @@ -85,12 +108,13 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterE PRECONDITION(arguments.childFunctions.size() == 6, "EverEqTnpointTnpointPhysicalFunction requires 6 children but got {}", arguments.childFunctions.size()); - return EverEqTnpointTnpointPhysicalFunction(std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2]), - std::move(arguments.childFunctions[3]), - std::move(arguments.childFunctions[4]), - std::move(arguments.childFunctions[5])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + auto arg5 = std::move(arguments.childFunctions[5]); + return EverEqTnpointTnpointPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverEqTposePosePhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverEqTposePosePhysicalFunction.cpp index 9fddd8a541..cf3d6a4d31 100644 --- a/nes-physical-operators/src/Functions/Meos/EverEqTposePosePhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/EverEqTposePosePhysicalFunction.cpp @@ -13,65 +13,92 @@ */ #include + #include #include #include +#include #include #include #include #include +#include #include +#include #include #include -#include -#include extern "C" { #include -#include #include } namespace NES { -EverEqTposePosePhysicalFunction::EverEqTposePosePhysicalFunction(PhysicalFunction x, PhysicalFunction y, PhysicalFunction theta, PhysicalFunction ts, PhysicalFunction x2, PhysicalFunction y2, PhysicalFunction theta2) +EverEqTposePosePhysicalFunction::EverEqTposePosePhysicalFunction(PhysicalFunction xFunction, + PhysicalFunction yFunction, + PhysicalFunction thetaFunction, + PhysicalFunction tsFunction, + PhysicalFunction px0Function, + PhysicalFunction py0Function, + PhysicalFunction ptheta0Function) { - paramFns.reserve(7); - paramFns.push_back(std::move(x)); - paramFns.push_back(std::move(y)); - paramFns.push_back(std::move(theta)); - paramFns.push_back(std::move(ts)); - paramFns.push_back(std::move(x2)); - paramFns.push_back(std::move(y2)); - paramFns.push_back(std::move(theta2)); + parameterFunctions.reserve(7); + parameterFunctions.push_back(std::move(xFunction)); + parameterFunctions.push_back(std::move(yFunction)); + parameterFunctions.push_back(std::move(thetaFunction)); + parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(px0Function)); + parameterFunctions.push_back(std::move(py0Function)); + parameterFunctions.push_back(std::move(ptheta0Function)); } VarVal EverEqTposePosePhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto x = paramFns[0].execute(record, arena).cast(); - auto y = paramFns[1].execute(record, arena).cast(); - auto theta = paramFns[2].execute(record, arena).cast(); - auto ts = paramFns[3].execute(record, arena).cast(); - auto x2 = paramFns[4].execute(record, arena).cast(); - auto y2 = paramFns[5].execute(record, arena).cast(); - auto theta2 = paramFns[6].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto x = parameterValues[0].cast>(); + auto y = parameterValues[1].cast>(); + auto theta = parameterValues[2].cast>(); + auto ts = parameterValues[3].cast>(); + auto px0 = parameterValues[4].cast>(); + auto py0 = parameterValues[5].cast>(); + auto ptheta0 = parameterValues[6].cast>(); + const auto result = nautilus::invoke( - +[](double x, double y, double theta, uint64_t ts, double x2, double y2, double theta2) -> double { - try { + +[](double x, + double y, + double theta, + uint64_t ts, + double px0, + double py0, + double ptheta0) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - Pose* pose1 = pose_make_2d(x, y, theta, false, 0); - if (!pose1) return 0.0; - Temporal* inst = (Temporal*)tposeinst_make(pose1, (TimestampTz)ts); - free(pose1); - if (!inst) return 0.0; - Pose* pose2 = pose_make_2d(x2, y2, theta2, false, 0); - if (!pose2) { free(inst); return 0.0; } - int r = ever_eq_tpose_pose(inst, pose2); - free(inst); free(pose2); - return r > 0 ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + std::string tempWkt = fmt::format("Pose(Point({} {}),{})@{}", x, y, theta, MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tpose_in(tempWkt.c_str()); + if (!temp) return 0.0; + Pose* pose0 = pose_make_2d(px0, py0, ptheta0, false, 0); + if (!pose0) { free(temp); return 0.0; } + + double r = ever_eq_tpose_pose(temp, pose0); + free(temp); + free(pose0); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, - x, y, theta, ts, x2, y2, theta2); + x, y, theta, ts, px0, py0, ptheta0); + return VarVal(result); } @@ -81,14 +108,14 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterE PRECONDITION(arguments.childFunctions.size() == 7, "EverEqTposePosePhysicalFunction requires 7 children but got {}", arguments.childFunctions.size()); - return EverEqTposePosePhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2]), - std::move(arguments.childFunctions[3]), - std::move(arguments.childFunctions[4]), - std::move(arguments.childFunctions[5]), - std::move(arguments.childFunctions[6])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + auto arg5 = std::move(arguments.childFunctions[5]); + auto arg6 = std::move(arguments.childFunctions[6]); + return EverEqTposePosePhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverEqTposeTposePhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverEqTposeTposePhysicalFunction.cpp index cb888a09a3..03dac3827a 100644 --- a/nes-physical-operators/src/Functions/Meos/EverEqTposeTposePhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/EverEqTposeTposePhysicalFunction.cpp @@ -13,17 +13,20 @@ */ #include + #include #include #include +#include #include #include #include #include +#include #include +#include #include #include -#include extern "C" { #include @@ -32,53 +35,76 @@ extern "C" { namespace NES { -EverEqTposeTposePhysicalFunction::EverEqTposeTposePhysicalFunction( - PhysicalFunction x1, PhysicalFunction y1, PhysicalFunction theta1, PhysicalFunction ts1, - PhysicalFunction x2, PhysicalFunction y2, PhysicalFunction theta2, PhysicalFunction ts2) +EverEqTposeTposePhysicalFunction::EverEqTposeTposePhysicalFunction(PhysicalFunction xFunction, + PhysicalFunction yFunction, + PhysicalFunction thetaFunction, + PhysicalFunction tsFunction, + PhysicalFunction px0Function, + PhysicalFunction py0Function, + PhysicalFunction ptheta0Function, + PhysicalFunction ts0Function) { - paramFns.reserve(8); - paramFns.push_back(std::move(x1)); - paramFns.push_back(std::move(y1)); - paramFns.push_back(std::move(theta1)); - paramFns.push_back(std::move(ts1)); - paramFns.push_back(std::move(x2)); - paramFns.push_back(std::move(y2)); - paramFns.push_back(std::move(theta2)); - paramFns.push_back(std::move(ts2)); + parameterFunctions.reserve(8); + parameterFunctions.push_back(std::move(xFunction)); + parameterFunctions.push_back(std::move(yFunction)); + parameterFunctions.push_back(std::move(thetaFunction)); + parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(px0Function)); + parameterFunctions.push_back(std::move(py0Function)); + parameterFunctions.push_back(std::move(ptheta0Function)); + parameterFunctions.push_back(std::move(ts0Function)); } VarVal EverEqTposeTposePhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto x1 = paramFns[0].execute(record, arena).cast(); - auto y1 = paramFns[1].execute(record, arena).cast(); - auto theta1 = paramFns[2].execute(record, arena).cast(); - auto ts1 = paramFns[3].execute(record, arena).cast(); - auto x2 = paramFns[4].execute(record, arena).cast(); - auto y2 = paramFns[5].execute(record, arena).cast(); - auto theta2 = paramFns[6].execute(record, arena).cast(); - auto ts2 = paramFns[7].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto x = parameterValues[0].cast>(); + auto y = parameterValues[1].cast>(); + auto theta = parameterValues[2].cast>(); + auto ts = parameterValues[3].cast>(); + auto px0 = parameterValues[4].cast>(); + auto py0 = parameterValues[5].cast>(); + auto ptheta0 = parameterValues[6].cast>(); + auto ts0 = parameterValues[7].cast>(); const auto result = nautilus::invoke( - +[](double x1, double y1, double theta1, uint64_t ts1, - double x2, double y2, double theta2, uint64_t ts2) -> double { - try { + +[](double x, + double y, + double theta, + uint64_t ts, + double px0, + double py0, + double ptheta0, + uint64_t ts0) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - Pose* p1 = pose_make_2d(x1, y1, theta1, false, 0); - if (!p1) return 0.0; - Temporal* inst1 = (Temporal*)tposeinst_make(p1, (TimestampTz)ts1); - free(p1); - if (!inst1) return 0.0; - Pose* p2 = pose_make_2d(x2, y2, theta2, false, 0); - if (!p2) { free(inst1); return 0.0; } - Temporal* inst2 = (Temporal*)tposeinst_make(p2, (TimestampTz)ts2); - free(p2); - if (!inst2) { free(inst1); return 0.0; } - int r = ever_eq_tpose_tpose(inst1, inst2); - free(inst1); free(inst2); - return r > 0 ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + std::string tempWkt = fmt::format("Pose(Point({} {}),{})@{}", x, y, theta, MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tpose_in(tempWkt.c_str()); + if (!temp) return 0.0; + Pose* pose0A = pose_make_2d(px0, py0, ptheta0, false, 0); + if (!pose0A) { free(temp); return 0.0; } + Temporal* inst0 = (Temporal*)tposeinst_make(pose0A, (TimestampTz)ts0); + free(pose0A); + if (!inst0) { free(temp); return 0.0; } + + double r = ever_eq_tpose_tpose(temp, inst0); + free(temp); + free(inst0); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, - x1, y1, theta1, ts1, x2, y2, theta2, ts2); + x, y, theta, ts, px0, py0, ptheta0, ts0); return VarVal(result); } @@ -89,14 +115,15 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterE PRECONDITION(arguments.childFunctions.size() == 8, "EverEqTposeTposePhysicalFunction requires 8 children but got {}", arguments.childFunctions.size()); - return EverEqTposeTposePhysicalFunction(std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2]), - std::move(arguments.childFunctions[3]), - std::move(arguments.childFunctions[4]), - std::move(arguments.childFunctions[5]), - std::move(arguments.childFunctions[6]), - std::move(arguments.childFunctions[7])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + auto arg5 = std::move(arguments.childFunctions[5]); + auto arg6 = std::move(arguments.childFunctions[6]); + auto arg7 = std::move(arguments.childFunctions[7]); + return EverEqTposeTposePhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6), std::move(arg7)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverEqTquadbinQuadbinPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverEqTquadbinQuadbinPhysicalFunction.cpp index 0e07768481..7be40fd02e 100644 --- a/nes-physical-operators/src/Functions/Meos/EverEqTquadbinQuadbinPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/EverEqTquadbinQuadbinPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -21,7 +22,9 @@ #include #include #include +#include #include +#include #include #include @@ -32,40 +35,63 @@ extern "C" { namespace NES { -EverEqTquadbinQuadbinPhysicalFunction::EverEqTquadbinQuadbinPhysicalFunction(PhysicalFunction inst_cell, PhysicalFunction ts, PhysicalFunction cell) { - paramFns.reserve(3); - paramFns.push_back(std::move(inst_cell)); - paramFns.push_back(std::move(ts)); - paramFns.push_back(std::move(cell)); +EverEqTquadbinQuadbinPhysicalFunction::EverEqTquadbinQuadbinPhysicalFunction(PhysicalFunction cellFunction, + PhysicalFunction tsFunction, + PhysicalFunction arg0Function) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(cellFunction)); + parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } -VarVal EverEqTquadbinQuadbinPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto inst_cell = paramFns[0].execute(record, arena).cast(); - auto ts = paramFns[1].execute(record, arena).cast(); - auto cell = paramFns[2].execute(record, arena).cast(); +VarVal EverEqTquadbinQuadbinPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto cell = parameterValues[0].cast>(); + auto ts = parameterValues[1].cast>(); + auto arg0 = parameterValues[2].cast>(); + const auto result = nautilus::invoke( - +[](uint64_t ic, uint64_t ts, uint64_t cell) -> double { - MEOS::Meos::ensureMeosInitialized(); - TInstant* inst = tquadbininst_make((Quadbin)ic, (TimestampTz)ts); - if (!inst) return 0.0; - int r = ever_eq_tquadbin_quadbin((const Temporal*)inst, (Quadbin)cell); - free(inst); - return r > 0 ? 1.0 : 0.0; + +[](uint64_t cell, + uint64_t ts, + uint64_t arg0) -> double { + try + { + MEOS::Meos::ensureMeosInitialized(); + Temporal* temp = (Temporal*)tquadbininst_make((Quadbin)cell, (TimestampTz)ts); + if (!temp) return 0.0; + + double r = ever_eq_tquadbin_quadbin(temp, (Quadbin)arg0); + free(temp); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, - inst_cell, ts, cell); + cell, ts, arg0); + return VarVal(result); } PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverEqTquadbinQuadbinPhysicalFunction( PhysicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.childFunctions.size()==3, + PRECONDITION(arguments.childFunctions.size() == 3, "EverEqTquadbinQuadbinPhysicalFunction requires 3 children but got {}", arguments.childFunctions.size()); - return EverEqTquadbinQuadbinPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return EverEqTquadbinQuadbinPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverEqTtextTextPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverEqTtextTextPhysicalFunction.cpp index 6e40e212b4..8a1170dcd5 100644 --- a/nes-physical-operators/src/Functions/Meos/EverEqTtextTextPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/EverEqTtextTextPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -33,44 +34,59 @@ extern "C" { namespace NES { -EverEqTtextTextPhysicalFunction::EverEqTtextTextPhysicalFunction( - PhysicalFunction valueFunction, PhysicalFunction refFunction, PhysicalFunction tsFunction) +EverEqTtextTextPhysicalFunction::EverEqTtextTextPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction, + PhysicalFunction arg0Function) { - paramFns.reserve(3); - paramFns.push_back(std::move(valueFunction)); - paramFns.push_back(std::move(refFunction)); - paramFns.push_back(std::move(tsFunction)); + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } VarVal EverEqTtextTextPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto value = paramFns[0].execute(record, arena).cast(); - auto ref = paramFns[1].execute(record, arena).cast(); - auto ts = paramFns[2].execute(record, arena).cast>(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto value = parameterValues[0].cast(); + auto ts = parameterValues[1].cast>(); + auto arg0 = parameterValues[2].cast(); const auto result = nautilus::invoke( - +[](const char* v, uint32_t vsz, const char* r, uint32_t rsz, uint64_t t) -> double { - try { + +[](const char* valuePtr, uint32_t valueSize, + uint64_t ts, + const char* arg0Ptr, uint32_t arg0Size) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string val_str(v, vsz); - std::string ref_str(r, rsz); - while (!val_str.empty() && (val_str.front() == '\'' || val_str.front() == '"')) val_str = val_str.substr(1); - while (!val_str.empty() && (val_str.back() == '\'' || val_str.back() == '"')) val_str = val_str.substr(0, val_str.size()-1); - while (!ref_str.empty() && (ref_str.front() == '\'' || ref_str.front() == '"')) ref_str = ref_str.substr(1); - while (!ref_str.empty() && (ref_str.back() == '\'' || ref_str.back() == '"')) ref_str = ref_str.substr(0, ref_str.size()-1); - std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); - std::string wkt = "'" + val_str + "'@" + ts_str; - Temporal* temp = ttext_in(wkt.c_str()); + std::string tempVal(valuePtr, valueSize); + while (!tempVal.empty() && (tempVal.front() == '\'' || tempVal.front() == '"')) tempVal.erase(tempVal.begin()); + while (!tempVal.empty() && (tempVal.back() == '\'' || tempVal.back() == '"')) tempVal.pop_back(); + std::string tempWkt = "'" + tempVal + "'@" + MEOS::Meos::convertEpochToTimestamp(ts); + Temporal* temp = ttext_in(tempWkt.c_str()); if (!temp) return 0.0; - text* txt = cstring_to_text(ref_str.c_str()); - if (!txt) { free(temp); return 0.0; } - int result = ever_eq_ttext_text(temp, txt); + std::string arg0S(arg0Ptr, arg0Size); + while (!arg0S.empty() && (arg0S.front() == '\'' || arg0S.front() == '"')) arg0S.erase(arg0S.begin()); + while (!arg0S.empty() && (arg0S.back() == '\'' || arg0S.back() == '"')) arg0S.pop_back(); + text* txt0 = cstring_to_text(arg0S.c_str()); + if (!txt0) { free(temp); return 0.0; } + + double r = ever_eq_ttext_text(temp, txt0); free(temp); - free(txt); - return static_cast(result); - } catch (const std::exception&) { return 0.0; } + free(txt0); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, - value, ref, ts); + value.getContent(), value.getContentSize(), ts, arg0.getContent(), arg0.getContentSize()); return VarVal(result); } @@ -81,10 +97,10 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterE PRECONDITION(arguments.childFunctions.size() == 3, "EverEqTtextTextPhysicalFunction requires 3 children but got {}", arguments.childFunctions.size()); - return EverEqTtextTextPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return EverEqTtextTextPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverGeBigintTbigintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverGeBigintTbigintPhysicalFunction.cpp index 11e9eb48d4..b5efb7374e 100644 --- a/nes-physical-operators/src/Functions/Meos/EverGeBigintTbigintPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/EverGeBigintTbigintPhysicalFunction.cpp @@ -35,12 +35,12 @@ extern "C" { namespace NES { -EverGeBigintTbigintPhysicalFunction::EverGeBigintTbigintPhysicalFunction(PhysicalFunction scalarFunction, - PhysicalFunction valueFunction, - PhysicalFunction tsFunction) +EverGeBigintTbigintPhysicalFunction::EverGeBigintTbigintPhysicalFunction(PhysicalFunction arg0Function, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction) { parameterFunctions.reserve(3); - parameterFunctions.push_back(std::move(scalarFunction)); + parameterFunctions.push_back(std::move(arg0Function)); parameterFunctions.push_back(std::move(valueFunction)); parameterFunctions.push_back(std::move(tsFunction)); } @@ -50,26 +50,35 @@ VarVal EverGeBigintTbigintPhysicalFunction::execute(const Record& record, ArenaR std::vector parameterValues; parameterValues.reserve(parameterFunctions.size()); for (const auto& function : parameterFunctions) + { parameterValues.emplace_back(function.execute(record, arena)); + } - auto scalar = parameterValues[0].cast>(); - auto value = parameterValues[1].cast>(); - auto ts = parameterValues[2].cast>(); + auto arg0 = parameterValues[0].cast>(); + auto value = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); const auto result = nautilus::invoke( - +[](double d, double v, uint64_t t) -> double { - try { + +[](double arg0, + double value, + uint64_t ts) -> int { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); - std::string wkt = fmt::format("{}@{}", static_cast(v), ts_str); - Temporal* temp = tbigint_in(wkt.c_str()); - if (!temp) return 0.0; - int r = ever_ge_bigint_tbigint(static_cast(d), temp); + std::string tempWkt = fmt::format("{}@{}", static_cast(value), MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tbigint_in(tempWkt.c_str()); + if (!temp) return 0; + + int r = ever_ge_bigint_tbigint(static_cast(arg0), temp); free(temp); - return static_cast(r); - } catch (const std::exception&) { return 0.0; } + return r; + } + catch (const std::exception&) + { + return 0; + } }, - scalar, value, ts); + arg0, value, ts); return VarVal(result); } diff --git a/nes-physical-operators/src/Functions/Meos/EverGeTbigintBigintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverGeTbigintBigintPhysicalFunction.cpp index 66e760ca67..6b357f066a 100644 --- a/nes-physical-operators/src/Functions/Meos/EverGeTbigintBigintPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/EverGeTbigintBigintPhysicalFunction.cpp @@ -36,13 +36,13 @@ extern "C" { namespace NES { EverGeTbigintBigintPhysicalFunction::EverGeTbigintBigintPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction thresholdFunction, - PhysicalFunction tsFunction) + PhysicalFunction tsFunction, + PhysicalFunction arg0Function) { parameterFunctions.reserve(3); parameterFunctions.push_back(std::move(valueFunction)); - parameterFunctions.push_back(std::move(thresholdFunction)); parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } VarVal EverGeTbigintBigintPhysicalFunction::execute(const Record& record, ArenaRef& arena) const @@ -50,25 +50,35 @@ VarVal EverGeTbigintBigintPhysicalFunction::execute(const Record& record, ArenaR std::vector parameterValues; parameterValues.reserve(parameterFunctions.size()); for (const auto& function : parameterFunctions) + { parameterValues.emplace_back(function.execute(record, arena)); + } - auto value = parameterValues[0].cast>(); - auto threshold = parameterValues[1].cast>(); - auto ts = parameterValues[2].cast>(); + auto value = parameterValues[0].cast>(); + auto ts = parameterValues[1].cast>(); + auto arg0 = parameterValues[2].cast>(); const auto result = nautilus::invoke( - +[](double value, double threshold, uint64_t ts) -> double { - try { + +[](double value, + uint64_t ts, + double arg0) -> int { + try + { MEOS::Meos::ensureMeosInitialized(); std::string tempWkt = fmt::format("{}@{}", static_cast(value), MEOS::Meos::convertEpochToTimestamp(ts)); Temporal* temp = tbigint_in(tempWkt.c_str()); - if (!temp) return 0.0; - int r = ever_ge_tbigint_bigint(temp, static_cast(threshold)); + if (!temp) return 0; + + int r = ever_ge_tbigint_bigint(temp, static_cast(arg0)); free(temp); - return static_cast(r); - } catch (const std::exception&) { return 0.0; } + return r; + } + catch (const std::exception&) + { + return 0; + } }, - value, threshold, ts); + value, ts, arg0); return VarVal(result); } diff --git a/nes-physical-operators/src/Functions/Meos/EverGeTextTtextPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverGeTextTtextPhysicalFunction.cpp index 492b064d6b..b083e83bc3 100644 --- a/nes-physical-operators/src/Functions/Meos/EverGeTextTtextPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/EverGeTextTtextPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -33,44 +34,59 @@ extern "C" { namespace NES { -EverGeTextTtextPhysicalFunction::EverGeTextTtextPhysicalFunction( - PhysicalFunction valueFunction, PhysicalFunction refFunction, PhysicalFunction tsFunction) +EverGeTextTtextPhysicalFunction::EverGeTextTtextPhysicalFunction(PhysicalFunction arg0Function, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction) { - paramFns.reserve(3); - paramFns.push_back(std::move(valueFunction)); - paramFns.push_back(std::move(refFunction)); - paramFns.push_back(std::move(tsFunction)); + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(arg0Function)); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); } VarVal EverGeTextTtextPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto ref = paramFns[0].execute(record, arena).cast(); - auto value = paramFns[1].execute(record, arena).cast(); - auto ts = paramFns[2].execute(record, arena).cast>(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto arg0 = parameterValues[0].cast(); + auto value = parameterValues[1].cast(); + auto ts = parameterValues[2].cast>(); const auto result = nautilus::invoke( - +[](const char* r, uint32_t rsz, const char* v, uint32_t vsz, uint64_t t) -> double { - try { + +[](const char* arg0Ptr, uint32_t arg0Size, + const char* valuePtr, uint32_t valueSize, + uint64_t ts) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string ref_str(r, rsz); - std::string val_str(v, vsz); - while (!ref_str.empty() && (ref_str.front() == '\'' || ref_str.front() == '"')) ref_str = ref_str.substr(1); - while (!ref_str.empty() && (ref_str.back() == '\'' || ref_str.back() == '"')) ref_str = ref_str.substr(0, ref_str.size()-1); - while (!val_str.empty() && (val_str.front() == '\'' || val_str.front() == '"')) val_str = val_str.substr(1); - while (!val_str.empty() && (val_str.back() == '\'' || val_str.back() == '"')) val_str = val_str.substr(0, val_str.size()-1); - std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); - std::string wkt = "'" + val_str + "'@" + ts_str; - Temporal* temp = ttext_in(wkt.c_str()); + std::string tempVal(valuePtr, valueSize); + while (!tempVal.empty() && (tempVal.front() == '\'' || tempVal.front() == '"')) tempVal.erase(tempVal.begin()); + while (!tempVal.empty() && (tempVal.back() == '\'' || tempVal.back() == '"')) tempVal.pop_back(); + std::string tempWkt = "'" + tempVal + "'@" + MEOS::Meos::convertEpochToTimestamp(ts); + Temporal* temp = ttext_in(tempWkt.c_str()); if (!temp) return 0.0; - text* txt = cstring_to_text(ref_str.c_str()); - if (!txt) { free(temp); return 0.0; } - int result = ever_ge_text_ttext(txt, temp); + std::string arg0S(arg0Ptr, arg0Size); + while (!arg0S.empty() && (arg0S.front() == '\'' || arg0S.front() == '"')) arg0S.erase(arg0S.begin()); + while (!arg0S.empty() && (arg0S.back() == '\'' || arg0S.back() == '"')) arg0S.pop_back(); + text* txt0 = cstring_to_text(arg0S.c_str()); + if (!txt0) { free(temp); return 0.0; } + + double r = ever_ge_text_ttext(txt0, temp); free(temp); - free(txt); - return static_cast(result); - } catch (const std::exception&) { return 0.0; } + free(txt0); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, - ref, value, ts); + arg0.getContent(), arg0.getContentSize(), value.getContent(), value.getContentSize(), ts); return VarVal(result); } @@ -81,10 +97,10 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterE PRECONDITION(arguments.childFunctions.size() == 3, "EverGeTextTtextPhysicalFunction requires 3 children but got {}", arguments.childFunctions.size()); - return EverGeTextTtextPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return EverGeTextTtextPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverGeTtextTextPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverGeTtextTextPhysicalFunction.cpp index 1205e71ec5..969b5c94b8 100644 --- a/nes-physical-operators/src/Functions/Meos/EverGeTtextTextPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/EverGeTtextTextPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -33,44 +34,59 @@ extern "C" { namespace NES { -EverGeTtextTextPhysicalFunction::EverGeTtextTextPhysicalFunction( - PhysicalFunction valueFunction, PhysicalFunction refFunction, PhysicalFunction tsFunction) +EverGeTtextTextPhysicalFunction::EverGeTtextTextPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction, + PhysicalFunction arg0Function) { - paramFns.reserve(3); - paramFns.push_back(std::move(valueFunction)); - paramFns.push_back(std::move(refFunction)); - paramFns.push_back(std::move(tsFunction)); + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } VarVal EverGeTtextTextPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto value = paramFns[0].execute(record, arena).cast(); - auto ref = paramFns[1].execute(record, arena).cast(); - auto ts = paramFns[2].execute(record, arena).cast>(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto value = parameterValues[0].cast(); + auto ts = parameterValues[1].cast>(); + auto arg0 = parameterValues[2].cast(); const auto result = nautilus::invoke( - +[](const char* v, uint32_t vsz, const char* r, uint32_t rsz, uint64_t t) -> double { - try { + +[](const char* valuePtr, uint32_t valueSize, + uint64_t ts, + const char* arg0Ptr, uint32_t arg0Size) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string val_str(v, vsz); - std::string ref_str(r, rsz); - while (!val_str.empty() && (val_str.front() == '\'' || val_str.front() == '"')) val_str = val_str.substr(1); - while (!val_str.empty() && (val_str.back() == '\'' || val_str.back() == '"')) val_str = val_str.substr(0, val_str.size()-1); - while (!ref_str.empty() && (ref_str.front() == '\'' || ref_str.front() == '"')) ref_str = ref_str.substr(1); - while (!ref_str.empty() && (ref_str.back() == '\'' || ref_str.back() == '"')) ref_str = ref_str.substr(0, ref_str.size()-1); - std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); - std::string wkt = "'" + val_str + "'@" + ts_str; - Temporal* temp = ttext_in(wkt.c_str()); + std::string tempVal(valuePtr, valueSize); + while (!tempVal.empty() && (tempVal.front() == '\'' || tempVal.front() == '"')) tempVal.erase(tempVal.begin()); + while (!tempVal.empty() && (tempVal.back() == '\'' || tempVal.back() == '"')) tempVal.pop_back(); + std::string tempWkt = "'" + tempVal + "'@" + MEOS::Meos::convertEpochToTimestamp(ts); + Temporal* temp = ttext_in(tempWkt.c_str()); if (!temp) return 0.0; - text* txt = cstring_to_text(ref_str.c_str()); - if (!txt) { free(temp); return 0.0; } - int result = ever_ge_ttext_text(temp, txt); + std::string arg0S(arg0Ptr, arg0Size); + while (!arg0S.empty() && (arg0S.front() == '\'' || arg0S.front() == '"')) arg0S.erase(arg0S.begin()); + while (!arg0S.empty() && (arg0S.back() == '\'' || arg0S.back() == '"')) arg0S.pop_back(); + text* txt0 = cstring_to_text(arg0S.c_str()); + if (!txt0) { free(temp); return 0.0; } + + double r = ever_ge_ttext_text(temp, txt0); free(temp); - free(txt); - return static_cast(result); - } catch (const std::exception&) { return 0.0; } + free(txt0); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, - value, ref, ts); + value.getContent(), value.getContentSize(), ts, arg0.getContent(), arg0.getContentSize()); return VarVal(result); } @@ -81,10 +97,10 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterE PRECONDITION(arguments.childFunctions.size() == 3, "EverGeTtextTextPhysicalFunction requires 3 children but got {}", arguments.childFunctions.size()); - return EverGeTtextTextPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return EverGeTtextTextPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverGtBigintTbigintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverGtBigintTbigintPhysicalFunction.cpp index 93b2b47576..eba2b10aee 100644 --- a/nes-physical-operators/src/Functions/Meos/EverGtBigintTbigintPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/EverGtBigintTbigintPhysicalFunction.cpp @@ -35,12 +35,12 @@ extern "C" { namespace NES { -EverGtBigintTbigintPhysicalFunction::EverGtBigintTbigintPhysicalFunction(PhysicalFunction scalarFunction, - PhysicalFunction valueFunction, - PhysicalFunction tsFunction) +EverGtBigintTbigintPhysicalFunction::EverGtBigintTbigintPhysicalFunction(PhysicalFunction arg0Function, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction) { parameterFunctions.reserve(3); - parameterFunctions.push_back(std::move(scalarFunction)); + parameterFunctions.push_back(std::move(arg0Function)); parameterFunctions.push_back(std::move(valueFunction)); parameterFunctions.push_back(std::move(tsFunction)); } @@ -50,26 +50,35 @@ VarVal EverGtBigintTbigintPhysicalFunction::execute(const Record& record, ArenaR std::vector parameterValues; parameterValues.reserve(parameterFunctions.size()); for (const auto& function : parameterFunctions) + { parameterValues.emplace_back(function.execute(record, arena)); + } - auto scalar = parameterValues[0].cast>(); - auto value = parameterValues[1].cast>(); - auto ts = parameterValues[2].cast>(); + auto arg0 = parameterValues[0].cast>(); + auto value = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); const auto result = nautilus::invoke( - +[](double d, double v, uint64_t t) -> double { - try { + +[](double arg0, + double value, + uint64_t ts) -> int { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); - std::string wkt = fmt::format("{}@{}", static_cast(v), ts_str); - Temporal* temp = tbigint_in(wkt.c_str()); - if (!temp) return 0.0; - int r = ever_gt_bigint_tbigint(static_cast(d), temp); + std::string tempWkt = fmt::format("{}@{}", static_cast(value), MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tbigint_in(tempWkt.c_str()); + if (!temp) return 0; + + int r = ever_gt_bigint_tbigint(static_cast(arg0), temp); free(temp); - return static_cast(r); - } catch (const std::exception&) { return 0.0; } + return r; + } + catch (const std::exception&) + { + return 0; + } }, - scalar, value, ts); + arg0, value, ts); return VarVal(result); } diff --git a/nes-physical-operators/src/Functions/Meos/EverGtTbigintBigintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverGtTbigintBigintPhysicalFunction.cpp index fc74e3aef9..38874203a2 100644 --- a/nes-physical-operators/src/Functions/Meos/EverGtTbigintBigintPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/EverGtTbigintBigintPhysicalFunction.cpp @@ -36,13 +36,13 @@ extern "C" { namespace NES { EverGtTbigintBigintPhysicalFunction::EverGtTbigintBigintPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction thresholdFunction, - PhysicalFunction tsFunction) + PhysicalFunction tsFunction, + PhysicalFunction arg0Function) { parameterFunctions.reserve(3); parameterFunctions.push_back(std::move(valueFunction)); - parameterFunctions.push_back(std::move(thresholdFunction)); parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } VarVal EverGtTbigintBigintPhysicalFunction::execute(const Record& record, ArenaRef& arena) const @@ -50,25 +50,35 @@ VarVal EverGtTbigintBigintPhysicalFunction::execute(const Record& record, ArenaR std::vector parameterValues; parameterValues.reserve(parameterFunctions.size()); for (const auto& function : parameterFunctions) + { parameterValues.emplace_back(function.execute(record, arena)); + } - auto value = parameterValues[0].cast>(); - auto threshold = parameterValues[1].cast>(); - auto ts = parameterValues[2].cast>(); + auto value = parameterValues[0].cast>(); + auto ts = parameterValues[1].cast>(); + auto arg0 = parameterValues[2].cast>(); const auto result = nautilus::invoke( - +[](double value, double threshold, uint64_t ts) -> double { - try { + +[](double value, + uint64_t ts, + double arg0) -> int { + try + { MEOS::Meos::ensureMeosInitialized(); std::string tempWkt = fmt::format("{}@{}", static_cast(value), MEOS::Meos::convertEpochToTimestamp(ts)); Temporal* temp = tbigint_in(tempWkt.c_str()); - if (!temp) return 0.0; - int r = ever_gt_tbigint_bigint(temp, static_cast(threshold)); + if (!temp) return 0; + + int r = ever_gt_tbigint_bigint(temp, static_cast(arg0)); free(temp); - return static_cast(r); - } catch (const std::exception&) { return 0.0; } + return r; + } + catch (const std::exception&) + { + return 0; + } }, - value, threshold, ts); + value, ts, arg0); return VarVal(result); } diff --git a/nes-physical-operators/src/Functions/Meos/EverGtTextTtextPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverGtTextTtextPhysicalFunction.cpp index a2cdb95ab0..9b28280e3d 100644 --- a/nes-physical-operators/src/Functions/Meos/EverGtTextTtextPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/EverGtTextTtextPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -33,44 +34,59 @@ extern "C" { namespace NES { -EverGtTextTtextPhysicalFunction::EverGtTextTtextPhysicalFunction( - PhysicalFunction valueFunction, PhysicalFunction refFunction, PhysicalFunction tsFunction) +EverGtTextTtextPhysicalFunction::EverGtTextTtextPhysicalFunction(PhysicalFunction arg0Function, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction) { - paramFns.reserve(3); - paramFns.push_back(std::move(valueFunction)); - paramFns.push_back(std::move(refFunction)); - paramFns.push_back(std::move(tsFunction)); + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(arg0Function)); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); } VarVal EverGtTextTtextPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto ref = paramFns[0].execute(record, arena).cast(); - auto value = paramFns[1].execute(record, arena).cast(); - auto ts = paramFns[2].execute(record, arena).cast>(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto arg0 = parameterValues[0].cast(); + auto value = parameterValues[1].cast(); + auto ts = parameterValues[2].cast>(); const auto result = nautilus::invoke( - +[](const char* r, uint32_t rsz, const char* v, uint32_t vsz, uint64_t t) -> double { - try { + +[](const char* arg0Ptr, uint32_t arg0Size, + const char* valuePtr, uint32_t valueSize, + uint64_t ts) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string ref_str(r, rsz); - std::string val_str(v, vsz); - while (!ref_str.empty() && (ref_str.front() == '\'' || ref_str.front() == '"')) ref_str = ref_str.substr(1); - while (!ref_str.empty() && (ref_str.back() == '\'' || ref_str.back() == '"')) ref_str = ref_str.substr(0, ref_str.size()-1); - while (!val_str.empty() && (val_str.front() == '\'' || val_str.front() == '"')) val_str = val_str.substr(1); - while (!val_str.empty() && (val_str.back() == '\'' || val_str.back() == '"')) val_str = val_str.substr(0, val_str.size()-1); - std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); - std::string wkt = "'" + val_str + "'@" + ts_str; - Temporal* temp = ttext_in(wkt.c_str()); + std::string tempVal(valuePtr, valueSize); + while (!tempVal.empty() && (tempVal.front() == '\'' || tempVal.front() == '"')) tempVal.erase(tempVal.begin()); + while (!tempVal.empty() && (tempVal.back() == '\'' || tempVal.back() == '"')) tempVal.pop_back(); + std::string tempWkt = "'" + tempVal + "'@" + MEOS::Meos::convertEpochToTimestamp(ts); + Temporal* temp = ttext_in(tempWkt.c_str()); if (!temp) return 0.0; - text* txt = cstring_to_text(ref_str.c_str()); - if (!txt) { free(temp); return 0.0; } - int result = ever_gt_text_ttext(txt, temp); + std::string arg0S(arg0Ptr, arg0Size); + while (!arg0S.empty() && (arg0S.front() == '\'' || arg0S.front() == '"')) arg0S.erase(arg0S.begin()); + while (!arg0S.empty() && (arg0S.back() == '\'' || arg0S.back() == '"')) arg0S.pop_back(); + text* txt0 = cstring_to_text(arg0S.c_str()); + if (!txt0) { free(temp); return 0.0; } + + double r = ever_gt_text_ttext(txt0, temp); free(temp); - free(txt); - return static_cast(result); - } catch (const std::exception&) { return 0.0; } + free(txt0); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, - ref, value, ts); + arg0.getContent(), arg0.getContentSize(), value.getContent(), value.getContentSize(), ts); return VarVal(result); } @@ -81,10 +97,10 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterE PRECONDITION(arguments.childFunctions.size() == 3, "EverGtTextTtextPhysicalFunction requires 3 children but got {}", arguments.childFunctions.size()); - return EverGtTextTtextPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return EverGtTextTtextPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverGtTtextTextPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverGtTtextTextPhysicalFunction.cpp index 8840ab0cad..8c2bad3e43 100644 --- a/nes-physical-operators/src/Functions/Meos/EverGtTtextTextPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/EverGtTtextTextPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -33,44 +34,59 @@ extern "C" { namespace NES { -EverGtTtextTextPhysicalFunction::EverGtTtextTextPhysicalFunction( - PhysicalFunction valueFunction, PhysicalFunction refFunction, PhysicalFunction tsFunction) +EverGtTtextTextPhysicalFunction::EverGtTtextTextPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction, + PhysicalFunction arg0Function) { - paramFns.reserve(3); - paramFns.push_back(std::move(valueFunction)); - paramFns.push_back(std::move(refFunction)); - paramFns.push_back(std::move(tsFunction)); + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } VarVal EverGtTtextTextPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto value = paramFns[0].execute(record, arena).cast(); - auto ref = paramFns[1].execute(record, arena).cast(); - auto ts = paramFns[2].execute(record, arena).cast>(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto value = parameterValues[0].cast(); + auto ts = parameterValues[1].cast>(); + auto arg0 = parameterValues[2].cast(); const auto result = nautilus::invoke( - +[](const char* v, uint32_t vsz, const char* r, uint32_t rsz, uint64_t t) -> double { - try { + +[](const char* valuePtr, uint32_t valueSize, + uint64_t ts, + const char* arg0Ptr, uint32_t arg0Size) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string val_str(v, vsz); - std::string ref_str(r, rsz); - while (!val_str.empty() && (val_str.front() == '\'' || val_str.front() == '"')) val_str = val_str.substr(1); - while (!val_str.empty() && (val_str.back() == '\'' || val_str.back() == '"')) val_str = val_str.substr(0, val_str.size()-1); - while (!ref_str.empty() && (ref_str.front() == '\'' || ref_str.front() == '"')) ref_str = ref_str.substr(1); - while (!ref_str.empty() && (ref_str.back() == '\'' || ref_str.back() == '"')) ref_str = ref_str.substr(0, ref_str.size()-1); - std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); - std::string wkt = "'" + val_str + "'@" + ts_str; - Temporal* temp = ttext_in(wkt.c_str()); + std::string tempVal(valuePtr, valueSize); + while (!tempVal.empty() && (tempVal.front() == '\'' || tempVal.front() == '"')) tempVal.erase(tempVal.begin()); + while (!tempVal.empty() && (tempVal.back() == '\'' || tempVal.back() == '"')) tempVal.pop_back(); + std::string tempWkt = "'" + tempVal + "'@" + MEOS::Meos::convertEpochToTimestamp(ts); + Temporal* temp = ttext_in(tempWkt.c_str()); if (!temp) return 0.0; - text* txt = cstring_to_text(ref_str.c_str()); - if (!txt) { free(temp); return 0.0; } - int result = ever_gt_ttext_text(temp, txt); + std::string arg0S(arg0Ptr, arg0Size); + while (!arg0S.empty() && (arg0S.front() == '\'' || arg0S.front() == '"')) arg0S.erase(arg0S.begin()); + while (!arg0S.empty() && (arg0S.back() == '\'' || arg0S.back() == '"')) arg0S.pop_back(); + text* txt0 = cstring_to_text(arg0S.c_str()); + if (!txt0) { free(temp); return 0.0; } + + double r = ever_gt_ttext_text(temp, txt0); free(temp); - free(txt); - return static_cast(result); - } catch (const std::exception&) { return 0.0; } + free(txt0); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, - value, ref, ts); + value.getContent(), value.getContentSize(), ts, arg0.getContent(), arg0.getContentSize()); return VarVal(result); } @@ -81,10 +97,10 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterE PRECONDITION(arguments.childFunctions.size() == 3, "EverGtTtextTextPhysicalFunction requires 3 children but got {}", arguments.childFunctions.size()); - return EverGtTtextTextPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return EverGtTtextTextPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverLeBigintTbigintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverLeBigintTbigintPhysicalFunction.cpp index df155c47aa..6b65d7e689 100644 --- a/nes-physical-operators/src/Functions/Meos/EverLeBigintTbigintPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/EverLeBigintTbigintPhysicalFunction.cpp @@ -35,12 +35,12 @@ extern "C" { namespace NES { -EverLeBigintTbigintPhysicalFunction::EverLeBigintTbigintPhysicalFunction(PhysicalFunction scalarFunction, - PhysicalFunction valueFunction, - PhysicalFunction tsFunction) +EverLeBigintTbigintPhysicalFunction::EverLeBigintTbigintPhysicalFunction(PhysicalFunction arg0Function, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction) { parameterFunctions.reserve(3); - parameterFunctions.push_back(std::move(scalarFunction)); + parameterFunctions.push_back(std::move(arg0Function)); parameterFunctions.push_back(std::move(valueFunction)); parameterFunctions.push_back(std::move(tsFunction)); } @@ -50,26 +50,35 @@ VarVal EverLeBigintTbigintPhysicalFunction::execute(const Record& record, ArenaR std::vector parameterValues; parameterValues.reserve(parameterFunctions.size()); for (const auto& function : parameterFunctions) + { parameterValues.emplace_back(function.execute(record, arena)); + } - auto scalar = parameterValues[0].cast>(); - auto value = parameterValues[1].cast>(); - auto ts = parameterValues[2].cast>(); + auto arg0 = parameterValues[0].cast>(); + auto value = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); const auto result = nautilus::invoke( - +[](double d, double v, uint64_t t) -> double { - try { + +[](double arg0, + double value, + uint64_t ts) -> int { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); - std::string wkt = fmt::format("{}@{}", static_cast(v), ts_str); - Temporal* temp = tbigint_in(wkt.c_str()); - if (!temp) return 0.0; - int r = ever_le_bigint_tbigint(static_cast(d), temp); + std::string tempWkt = fmt::format("{}@{}", static_cast(value), MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tbigint_in(tempWkt.c_str()); + if (!temp) return 0; + + int r = ever_le_bigint_tbigint(static_cast(arg0), temp); free(temp); - return static_cast(r); - } catch (const std::exception&) { return 0.0; } + return r; + } + catch (const std::exception&) + { + return 0; + } }, - scalar, value, ts); + arg0, value, ts); return VarVal(result); } diff --git a/nes-physical-operators/src/Functions/Meos/EverLeTbigintBigintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverLeTbigintBigintPhysicalFunction.cpp index b1b012d279..b378927048 100644 --- a/nes-physical-operators/src/Functions/Meos/EverLeTbigintBigintPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/EverLeTbigintBigintPhysicalFunction.cpp @@ -36,13 +36,13 @@ extern "C" { namespace NES { EverLeTbigintBigintPhysicalFunction::EverLeTbigintBigintPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction thresholdFunction, - PhysicalFunction tsFunction) + PhysicalFunction tsFunction, + PhysicalFunction arg0Function) { parameterFunctions.reserve(3); parameterFunctions.push_back(std::move(valueFunction)); - parameterFunctions.push_back(std::move(thresholdFunction)); parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } VarVal EverLeTbigintBigintPhysicalFunction::execute(const Record& record, ArenaRef& arena) const @@ -50,25 +50,35 @@ VarVal EverLeTbigintBigintPhysicalFunction::execute(const Record& record, ArenaR std::vector parameterValues; parameterValues.reserve(parameterFunctions.size()); for (const auto& function : parameterFunctions) + { parameterValues.emplace_back(function.execute(record, arena)); + } - auto value = parameterValues[0].cast>(); - auto threshold = parameterValues[1].cast>(); - auto ts = parameterValues[2].cast>(); + auto value = parameterValues[0].cast>(); + auto ts = parameterValues[1].cast>(); + auto arg0 = parameterValues[2].cast>(); const auto result = nautilus::invoke( - +[](double value, double threshold, uint64_t ts) -> double { - try { + +[](double value, + uint64_t ts, + double arg0) -> int { + try + { MEOS::Meos::ensureMeosInitialized(); std::string tempWkt = fmt::format("{}@{}", static_cast(value), MEOS::Meos::convertEpochToTimestamp(ts)); Temporal* temp = tbigint_in(tempWkt.c_str()); - if (!temp) return 0.0; - int r = ever_le_tbigint_bigint(temp, static_cast(threshold)); + if (!temp) return 0; + + int r = ever_le_tbigint_bigint(temp, static_cast(arg0)); free(temp); - return static_cast(r); - } catch (const std::exception&) { return 0.0; } + return r; + } + catch (const std::exception&) + { + return 0; + } }, - value, threshold, ts); + value, ts, arg0); return VarVal(result); } diff --git a/nes-physical-operators/src/Functions/Meos/EverLeTextTtextPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverLeTextTtextPhysicalFunction.cpp index b813d4dc2c..b7c80259d2 100644 --- a/nes-physical-operators/src/Functions/Meos/EverLeTextTtextPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/EverLeTextTtextPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -33,44 +34,59 @@ extern "C" { namespace NES { -EverLeTextTtextPhysicalFunction::EverLeTextTtextPhysicalFunction( - PhysicalFunction valueFunction, PhysicalFunction refFunction, PhysicalFunction tsFunction) +EverLeTextTtextPhysicalFunction::EverLeTextTtextPhysicalFunction(PhysicalFunction arg0Function, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction) { - paramFns.reserve(3); - paramFns.push_back(std::move(valueFunction)); - paramFns.push_back(std::move(refFunction)); - paramFns.push_back(std::move(tsFunction)); + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(arg0Function)); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); } VarVal EverLeTextTtextPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto ref = paramFns[0].execute(record, arena).cast(); - auto value = paramFns[1].execute(record, arena).cast(); - auto ts = paramFns[2].execute(record, arena).cast>(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto arg0 = parameterValues[0].cast(); + auto value = parameterValues[1].cast(); + auto ts = parameterValues[2].cast>(); const auto result = nautilus::invoke( - +[](const char* r, uint32_t rsz, const char* v, uint32_t vsz, uint64_t t) -> double { - try { + +[](const char* arg0Ptr, uint32_t arg0Size, + const char* valuePtr, uint32_t valueSize, + uint64_t ts) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string ref_str(r, rsz); - std::string val_str(v, vsz); - while (!ref_str.empty() && (ref_str.front() == '\'' || ref_str.front() == '"')) ref_str = ref_str.substr(1); - while (!ref_str.empty() && (ref_str.back() == '\'' || ref_str.back() == '"')) ref_str = ref_str.substr(0, ref_str.size()-1); - while (!val_str.empty() && (val_str.front() == '\'' || val_str.front() == '"')) val_str = val_str.substr(1); - while (!val_str.empty() && (val_str.back() == '\'' || val_str.back() == '"')) val_str = val_str.substr(0, val_str.size()-1); - std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); - std::string wkt = "'" + val_str + "'@" + ts_str; - Temporal* temp = ttext_in(wkt.c_str()); + std::string tempVal(valuePtr, valueSize); + while (!tempVal.empty() && (tempVal.front() == '\'' || tempVal.front() == '"')) tempVal.erase(tempVal.begin()); + while (!tempVal.empty() && (tempVal.back() == '\'' || tempVal.back() == '"')) tempVal.pop_back(); + std::string tempWkt = "'" + tempVal + "'@" + MEOS::Meos::convertEpochToTimestamp(ts); + Temporal* temp = ttext_in(tempWkt.c_str()); if (!temp) return 0.0; - text* txt = cstring_to_text(ref_str.c_str()); - if (!txt) { free(temp); return 0.0; } - int result = ever_le_text_ttext(txt, temp); + std::string arg0S(arg0Ptr, arg0Size); + while (!arg0S.empty() && (arg0S.front() == '\'' || arg0S.front() == '"')) arg0S.erase(arg0S.begin()); + while (!arg0S.empty() && (arg0S.back() == '\'' || arg0S.back() == '"')) arg0S.pop_back(); + text* txt0 = cstring_to_text(arg0S.c_str()); + if (!txt0) { free(temp); return 0.0; } + + double r = ever_le_text_ttext(txt0, temp); free(temp); - free(txt); - return static_cast(result); - } catch (const std::exception&) { return 0.0; } + free(txt0); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, - ref, value, ts); + arg0.getContent(), arg0.getContentSize(), value.getContent(), value.getContentSize(), ts); return VarVal(result); } @@ -81,10 +97,10 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterE PRECONDITION(arguments.childFunctions.size() == 3, "EverLeTextTtextPhysicalFunction requires 3 children but got {}", arguments.childFunctions.size()); - return EverLeTextTtextPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return EverLeTextTtextPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverLeTtextTextPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverLeTtextTextPhysicalFunction.cpp index 9e5b4da4b4..3c6d5d29d4 100644 --- a/nes-physical-operators/src/Functions/Meos/EverLeTtextTextPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/EverLeTtextTextPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -33,44 +34,59 @@ extern "C" { namespace NES { -EverLeTtextTextPhysicalFunction::EverLeTtextTextPhysicalFunction( - PhysicalFunction valueFunction, PhysicalFunction refFunction, PhysicalFunction tsFunction) +EverLeTtextTextPhysicalFunction::EverLeTtextTextPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction, + PhysicalFunction arg0Function) { - paramFns.reserve(3); - paramFns.push_back(std::move(valueFunction)); - paramFns.push_back(std::move(refFunction)); - paramFns.push_back(std::move(tsFunction)); + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } VarVal EverLeTtextTextPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto value = paramFns[0].execute(record, arena).cast(); - auto ref = paramFns[1].execute(record, arena).cast(); - auto ts = paramFns[2].execute(record, arena).cast>(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto value = parameterValues[0].cast(); + auto ts = parameterValues[1].cast>(); + auto arg0 = parameterValues[2].cast(); const auto result = nautilus::invoke( - +[](const char* v, uint32_t vsz, const char* r, uint32_t rsz, uint64_t t) -> double { - try { + +[](const char* valuePtr, uint32_t valueSize, + uint64_t ts, + const char* arg0Ptr, uint32_t arg0Size) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string val_str(v, vsz); - std::string ref_str(r, rsz); - while (!val_str.empty() && (val_str.front() == '\'' || val_str.front() == '"')) val_str = val_str.substr(1); - while (!val_str.empty() && (val_str.back() == '\'' || val_str.back() == '"')) val_str = val_str.substr(0, val_str.size()-1); - while (!ref_str.empty() && (ref_str.front() == '\'' || ref_str.front() == '"')) ref_str = ref_str.substr(1); - while (!ref_str.empty() && (ref_str.back() == '\'' || ref_str.back() == '"')) ref_str = ref_str.substr(0, ref_str.size()-1); - std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); - std::string wkt = "'" + val_str + "'@" + ts_str; - Temporal* temp = ttext_in(wkt.c_str()); + std::string tempVal(valuePtr, valueSize); + while (!tempVal.empty() && (tempVal.front() == '\'' || tempVal.front() == '"')) tempVal.erase(tempVal.begin()); + while (!tempVal.empty() && (tempVal.back() == '\'' || tempVal.back() == '"')) tempVal.pop_back(); + std::string tempWkt = "'" + tempVal + "'@" + MEOS::Meos::convertEpochToTimestamp(ts); + Temporal* temp = ttext_in(tempWkt.c_str()); if (!temp) return 0.0; - text* txt = cstring_to_text(ref_str.c_str()); - if (!txt) { free(temp); return 0.0; } - int result = ever_le_ttext_text(temp, txt); + std::string arg0S(arg0Ptr, arg0Size); + while (!arg0S.empty() && (arg0S.front() == '\'' || arg0S.front() == '"')) arg0S.erase(arg0S.begin()); + while (!arg0S.empty() && (arg0S.back() == '\'' || arg0S.back() == '"')) arg0S.pop_back(); + text* txt0 = cstring_to_text(arg0S.c_str()); + if (!txt0) { free(temp); return 0.0; } + + double r = ever_le_ttext_text(temp, txt0); free(temp); - free(txt); - return static_cast(result); - } catch (const std::exception&) { return 0.0; } + free(txt0); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, - value, ref, ts); + value.getContent(), value.getContentSize(), ts, arg0.getContent(), arg0.getContentSize()); return VarVal(result); } @@ -81,10 +97,10 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterE PRECONDITION(arguments.childFunctions.size() == 3, "EverLeTtextTextPhysicalFunction requires 3 children but got {}", arguments.childFunctions.size()); - return EverLeTtextTextPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return EverLeTtextTextPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverLtBigintTbigintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverLtBigintTbigintPhysicalFunction.cpp index 415516e939..c004ac853b 100644 --- a/nes-physical-operators/src/Functions/Meos/EverLtBigintTbigintPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/EverLtBigintTbigintPhysicalFunction.cpp @@ -35,12 +35,12 @@ extern "C" { namespace NES { -EverLtBigintTbigintPhysicalFunction::EverLtBigintTbigintPhysicalFunction(PhysicalFunction scalarFunction, - PhysicalFunction valueFunction, - PhysicalFunction tsFunction) +EverLtBigintTbigintPhysicalFunction::EverLtBigintTbigintPhysicalFunction(PhysicalFunction arg0Function, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction) { parameterFunctions.reserve(3); - parameterFunctions.push_back(std::move(scalarFunction)); + parameterFunctions.push_back(std::move(arg0Function)); parameterFunctions.push_back(std::move(valueFunction)); parameterFunctions.push_back(std::move(tsFunction)); } @@ -50,26 +50,35 @@ VarVal EverLtBigintTbigintPhysicalFunction::execute(const Record& record, ArenaR std::vector parameterValues; parameterValues.reserve(parameterFunctions.size()); for (const auto& function : parameterFunctions) + { parameterValues.emplace_back(function.execute(record, arena)); + } - auto scalar = parameterValues[0].cast>(); - auto value = parameterValues[1].cast>(); - auto ts = parameterValues[2].cast>(); + auto arg0 = parameterValues[0].cast>(); + auto value = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); const auto result = nautilus::invoke( - +[](double d, double v, uint64_t t) -> double { - try { + +[](double arg0, + double value, + uint64_t ts) -> int { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); - std::string wkt = fmt::format("{}@{}", static_cast(v), ts_str); - Temporal* temp = tbigint_in(wkt.c_str()); - if (!temp) return 0.0; - int r = ever_lt_bigint_tbigint(static_cast(d), temp); + std::string tempWkt = fmt::format("{}@{}", static_cast(value), MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tbigint_in(tempWkt.c_str()); + if (!temp) return 0; + + int r = ever_lt_bigint_tbigint(static_cast(arg0), temp); free(temp); - return static_cast(r); - } catch (const std::exception&) { return 0.0; } + return r; + } + catch (const std::exception&) + { + return 0; + } }, - scalar, value, ts); + arg0, value, ts); return VarVal(result); } diff --git a/nes-physical-operators/src/Functions/Meos/EverLtTbigintBigintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverLtTbigintBigintPhysicalFunction.cpp index d28da880aa..0b8d622939 100644 --- a/nes-physical-operators/src/Functions/Meos/EverLtTbigintBigintPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/EverLtTbigintBigintPhysicalFunction.cpp @@ -36,13 +36,13 @@ extern "C" { namespace NES { EverLtTbigintBigintPhysicalFunction::EverLtTbigintBigintPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction thresholdFunction, - PhysicalFunction tsFunction) + PhysicalFunction tsFunction, + PhysicalFunction arg0Function) { parameterFunctions.reserve(3); parameterFunctions.push_back(std::move(valueFunction)); - parameterFunctions.push_back(std::move(thresholdFunction)); parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } VarVal EverLtTbigintBigintPhysicalFunction::execute(const Record& record, ArenaRef& arena) const @@ -50,25 +50,35 @@ VarVal EverLtTbigintBigintPhysicalFunction::execute(const Record& record, ArenaR std::vector parameterValues; parameterValues.reserve(parameterFunctions.size()); for (const auto& function : parameterFunctions) + { parameterValues.emplace_back(function.execute(record, arena)); + } - auto value = parameterValues[0].cast>(); - auto threshold = parameterValues[1].cast>(); - auto ts = parameterValues[2].cast>(); + auto value = parameterValues[0].cast>(); + auto ts = parameterValues[1].cast>(); + auto arg0 = parameterValues[2].cast>(); const auto result = nautilus::invoke( - +[](double value, double threshold, uint64_t ts) -> double { - try { + +[](double value, + uint64_t ts, + double arg0) -> int { + try + { MEOS::Meos::ensureMeosInitialized(); std::string tempWkt = fmt::format("{}@{}", static_cast(value), MEOS::Meos::convertEpochToTimestamp(ts)); Temporal* temp = tbigint_in(tempWkt.c_str()); - if (!temp) return 0.0; - int r = ever_lt_tbigint_bigint(temp, static_cast(threshold)); + if (!temp) return 0; + + int r = ever_lt_tbigint_bigint(temp, static_cast(arg0)); free(temp); - return static_cast(r); - } catch (const std::exception&) { return 0.0; } + return r; + } + catch (const std::exception&) + { + return 0; + } }, - value, threshold, ts); + value, ts, arg0); return VarVal(result); } diff --git a/nes-physical-operators/src/Functions/Meos/EverLtTextTtextPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverLtTextTtextPhysicalFunction.cpp index 2d712dac08..71cf357f15 100644 --- a/nes-physical-operators/src/Functions/Meos/EverLtTextTtextPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/EverLtTextTtextPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -33,44 +34,59 @@ extern "C" { namespace NES { -EverLtTextTtextPhysicalFunction::EverLtTextTtextPhysicalFunction( - PhysicalFunction valueFunction, PhysicalFunction refFunction, PhysicalFunction tsFunction) +EverLtTextTtextPhysicalFunction::EverLtTextTtextPhysicalFunction(PhysicalFunction arg0Function, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction) { - paramFns.reserve(3); - paramFns.push_back(std::move(valueFunction)); - paramFns.push_back(std::move(refFunction)); - paramFns.push_back(std::move(tsFunction)); + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(arg0Function)); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); } VarVal EverLtTextTtextPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto ref = paramFns[0].execute(record, arena).cast(); - auto value = paramFns[1].execute(record, arena).cast(); - auto ts = paramFns[2].execute(record, arena).cast>(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto arg0 = parameterValues[0].cast(); + auto value = parameterValues[1].cast(); + auto ts = parameterValues[2].cast>(); const auto result = nautilus::invoke( - +[](const char* r, uint32_t rsz, const char* v, uint32_t vsz, uint64_t t) -> double { - try { + +[](const char* arg0Ptr, uint32_t arg0Size, + const char* valuePtr, uint32_t valueSize, + uint64_t ts) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string ref_str(r, rsz); - std::string val_str(v, vsz); - while (!ref_str.empty() && (ref_str.front() == '\'' || ref_str.front() == '"')) ref_str = ref_str.substr(1); - while (!ref_str.empty() && (ref_str.back() == '\'' || ref_str.back() == '"')) ref_str = ref_str.substr(0, ref_str.size()-1); - while (!val_str.empty() && (val_str.front() == '\'' || val_str.front() == '"')) val_str = val_str.substr(1); - while (!val_str.empty() && (val_str.back() == '\'' || val_str.back() == '"')) val_str = val_str.substr(0, val_str.size()-1); - std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); - std::string wkt = "'" + val_str + "'@" + ts_str; - Temporal* temp = ttext_in(wkt.c_str()); + std::string tempVal(valuePtr, valueSize); + while (!tempVal.empty() && (tempVal.front() == '\'' || tempVal.front() == '"')) tempVal.erase(tempVal.begin()); + while (!tempVal.empty() && (tempVal.back() == '\'' || tempVal.back() == '"')) tempVal.pop_back(); + std::string tempWkt = "'" + tempVal + "'@" + MEOS::Meos::convertEpochToTimestamp(ts); + Temporal* temp = ttext_in(tempWkt.c_str()); if (!temp) return 0.0; - text* txt = cstring_to_text(ref_str.c_str()); - if (!txt) { free(temp); return 0.0; } - int result = ever_lt_text_ttext(txt, temp); + std::string arg0S(arg0Ptr, arg0Size); + while (!arg0S.empty() && (arg0S.front() == '\'' || arg0S.front() == '"')) arg0S.erase(arg0S.begin()); + while (!arg0S.empty() && (arg0S.back() == '\'' || arg0S.back() == '"')) arg0S.pop_back(); + text* txt0 = cstring_to_text(arg0S.c_str()); + if (!txt0) { free(temp); return 0.0; } + + double r = ever_lt_text_ttext(txt0, temp); free(temp); - free(txt); - return static_cast(result); - } catch (const std::exception&) { return 0.0; } + free(txt0); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, - ref, value, ts); + arg0.getContent(), arg0.getContentSize(), value.getContent(), value.getContentSize(), ts); return VarVal(result); } @@ -81,10 +97,10 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterE PRECONDITION(arguments.childFunctions.size() == 3, "EverLtTextTtextPhysicalFunction requires 3 children but got {}", arguments.childFunctions.size()); - return EverLtTextTtextPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return EverLtTextTtextPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverLtTtextTextPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverLtTtextTextPhysicalFunction.cpp index 925aef9102..becb395ea2 100644 --- a/nes-physical-operators/src/Functions/Meos/EverLtTtextTextPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/EverLtTtextTextPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -33,44 +34,59 @@ extern "C" { namespace NES { -EverLtTtextTextPhysicalFunction::EverLtTtextTextPhysicalFunction( - PhysicalFunction valueFunction, PhysicalFunction refFunction, PhysicalFunction tsFunction) +EverLtTtextTextPhysicalFunction::EverLtTtextTextPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction, + PhysicalFunction arg0Function) { - paramFns.reserve(3); - paramFns.push_back(std::move(valueFunction)); - paramFns.push_back(std::move(refFunction)); - paramFns.push_back(std::move(tsFunction)); + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } VarVal EverLtTtextTextPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto value = paramFns[0].execute(record, arena).cast(); - auto ref = paramFns[1].execute(record, arena).cast(); - auto ts = paramFns[2].execute(record, arena).cast>(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto value = parameterValues[0].cast(); + auto ts = parameterValues[1].cast>(); + auto arg0 = parameterValues[2].cast(); const auto result = nautilus::invoke( - +[](const char* v, uint32_t vsz, const char* r, uint32_t rsz, uint64_t t) -> double { - try { + +[](const char* valuePtr, uint32_t valueSize, + uint64_t ts, + const char* arg0Ptr, uint32_t arg0Size) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string val_str(v, vsz); - std::string ref_str(r, rsz); - while (!val_str.empty() && (val_str.front() == '\'' || val_str.front() == '"')) val_str = val_str.substr(1); - while (!val_str.empty() && (val_str.back() == '\'' || val_str.back() == '"')) val_str = val_str.substr(0, val_str.size()-1); - while (!ref_str.empty() && (ref_str.front() == '\'' || ref_str.front() == '"')) ref_str = ref_str.substr(1); - while (!ref_str.empty() && (ref_str.back() == '\'' || ref_str.back() == '"')) ref_str = ref_str.substr(0, ref_str.size()-1); - std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); - std::string wkt = "'" + val_str + "'@" + ts_str; - Temporal* temp = ttext_in(wkt.c_str()); + std::string tempVal(valuePtr, valueSize); + while (!tempVal.empty() && (tempVal.front() == '\'' || tempVal.front() == '"')) tempVal.erase(tempVal.begin()); + while (!tempVal.empty() && (tempVal.back() == '\'' || tempVal.back() == '"')) tempVal.pop_back(); + std::string tempWkt = "'" + tempVal + "'@" + MEOS::Meos::convertEpochToTimestamp(ts); + Temporal* temp = ttext_in(tempWkt.c_str()); if (!temp) return 0.0; - text* txt = cstring_to_text(ref_str.c_str()); - if (!txt) { free(temp); return 0.0; } - int result = ever_lt_ttext_text(temp, txt); + std::string arg0S(arg0Ptr, arg0Size); + while (!arg0S.empty() && (arg0S.front() == '\'' || arg0S.front() == '"')) arg0S.erase(arg0S.begin()); + while (!arg0S.empty() && (arg0S.back() == '\'' || arg0S.back() == '"')) arg0S.pop_back(); + text* txt0 = cstring_to_text(arg0S.c_str()); + if (!txt0) { free(temp); return 0.0; } + + double r = ever_lt_ttext_text(temp, txt0); free(temp); - free(txt); - return static_cast(result); - } catch (const std::exception&) { return 0.0; } + free(txt0); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, - value, ref, ts); + value.getContent(), value.getContentSize(), ts, arg0.getContent(), arg0.getContentSize()); return VarVal(result); } @@ -81,10 +97,10 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterE PRECONDITION(arguments.childFunctions.size() == 3, "EverLtTtextTextPhysicalFunction requires 3 children but got {}", arguments.childFunctions.size()); - return EverLtTtextTextPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return EverLtTtextTextPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverNeBigintTbigintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverNeBigintTbigintPhysicalFunction.cpp index e1bb0ccf09..4398019eff 100644 --- a/nes-physical-operators/src/Functions/Meos/EverNeBigintTbigintPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/EverNeBigintTbigintPhysicalFunction.cpp @@ -35,12 +35,12 @@ extern "C" { namespace NES { -EverNeBigintTbigintPhysicalFunction::EverNeBigintTbigintPhysicalFunction(PhysicalFunction scalarFunction, - PhysicalFunction valueFunction, - PhysicalFunction tsFunction) +EverNeBigintTbigintPhysicalFunction::EverNeBigintTbigintPhysicalFunction(PhysicalFunction arg0Function, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction) { parameterFunctions.reserve(3); - parameterFunctions.push_back(std::move(scalarFunction)); + parameterFunctions.push_back(std::move(arg0Function)); parameterFunctions.push_back(std::move(valueFunction)); parameterFunctions.push_back(std::move(tsFunction)); } @@ -50,26 +50,35 @@ VarVal EverNeBigintTbigintPhysicalFunction::execute(const Record& record, ArenaR std::vector parameterValues; parameterValues.reserve(parameterFunctions.size()); for (const auto& function : parameterFunctions) + { parameterValues.emplace_back(function.execute(record, arena)); + } - auto scalar = parameterValues[0].cast>(); - auto value = parameterValues[1].cast>(); - auto ts = parameterValues[2].cast>(); + auto arg0 = parameterValues[0].cast>(); + auto value = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); const auto result = nautilus::invoke( - +[](double d, double v, uint64_t t) -> double { - try { + +[](double arg0, + double value, + uint64_t ts) -> int { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); - std::string wkt = fmt::format("{}@{}", static_cast(v), ts_str); - Temporal* temp = tbigint_in(wkt.c_str()); - if (!temp) return 0.0; - int r = ever_ne_bigint_tbigint(static_cast(d), temp); + std::string tempWkt = fmt::format("{}@{}", static_cast(value), MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tbigint_in(tempWkt.c_str()); + if (!temp) return 0; + + int r = ever_ne_bigint_tbigint(static_cast(arg0), temp); free(temp); - return static_cast(r); - } catch (const std::exception&) { return 0.0; } + return r; + } + catch (const std::exception&) + { + return 0; + } }, - scalar, value, ts); + arg0, value, ts); return VarVal(result); } diff --git a/nes-physical-operators/src/Functions/Meos/EverNeBoolTboolPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverNeBoolTboolPhysicalFunction.cpp index 88fc83c45f..17aad3b23e 100644 --- a/nes-physical-operators/src/Functions/Meos/EverNeBoolTboolPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/EverNeBoolTboolPhysicalFunction.cpp @@ -35,12 +35,12 @@ extern "C" { namespace NES { -EverNeBoolTboolPhysicalFunction::EverNeBoolTboolPhysicalFunction(PhysicalFunction scalarFunction, - PhysicalFunction valueFunction, - PhysicalFunction tsFunction) +EverNeBoolTboolPhysicalFunction::EverNeBoolTboolPhysicalFunction(PhysicalFunction arg0Function, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction) { parameterFunctions.reserve(3); - parameterFunctions.push_back(std::move(scalarFunction)); + parameterFunctions.push_back(std::move(arg0Function)); parameterFunctions.push_back(std::move(valueFunction)); parameterFunctions.push_back(std::move(tsFunction)); } @@ -50,26 +50,35 @@ VarVal EverNeBoolTboolPhysicalFunction::execute(const Record& record, ArenaRef& std::vector parameterValues; parameterValues.reserve(parameterFunctions.size()); for (const auto& function : parameterFunctions) + { parameterValues.emplace_back(function.execute(record, arena)); + } - auto scalar = parameterValues[0].cast>(); - auto value = parameterValues[1].cast>(); - auto ts = parameterValues[2].cast>(); + auto arg0 = parameterValues[0].cast>(); + auto value = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); const auto result = nautilus::invoke( - +[](double b, double v, uint64_t t) -> double { - try { + +[](double arg0, + double value, + uint64_t ts) -> int { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); - std::string wkt = fmt::format("{}@{}", (v != 0.0 ? "t" : "f"), ts_str); - Temporal* temp = tbool_in(wkt.c_str()); - if (!temp) return 0.0; - int r = ever_ne_bool_tbool(static_cast(b != 0.0), temp); + std::string tempWkt = fmt::format("{}@{}", value != 0.0 ? "t" : "f", MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tbool_in(tempWkt.c_str()); + if (!temp) return 0; + + int r = ever_ne_bool_tbool(static_cast(arg0 != 0.0), temp); free(temp); - return static_cast(r); - } catch (const std::exception&) { return 0.0; } + return r; + } + catch (const std::exception&) + { + return 0; + } }, - scalar, value, ts); + arg0, value, ts); return VarVal(result); } diff --git a/nes-physical-operators/src/Functions/Meos/EverNeNpointTnpointPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverNeNpointTnpointPhysicalFunction.cpp index 35f9bd221c..2e3f7b3f07 100644 --- a/nes-physical-operators/src/Functions/Meos/EverNeNpointTnpointPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/EverNeNpointTnpointPhysicalFunction.cpp @@ -13,61 +13,85 @@ */ #include + #include #include #include +#include #include #include #include #include +#include #include +#include #include #include -#include -#include extern "C" { #include -#include #include } namespace NES { -EverNeNpointTnpointPhysicalFunction::EverNeNpointTnpointPhysicalFunction(PhysicalFunction rid_np, PhysicalFunction pos_np, PhysicalFunction rid_tp, PhysicalFunction pos_tp, PhysicalFunction ts) +EverNeNpointTnpointPhysicalFunction::EverNeNpointTnpointPhysicalFunction(PhysicalFunction rid0Function, + PhysicalFunction frac0Function, + PhysicalFunction ridFunction, + PhysicalFunction fracFunction, + PhysicalFunction tsFunction) { - paramFns.reserve(5); - paramFns.push_back(std::move(rid_np)); - paramFns.push_back(std::move(pos_np)); - paramFns.push_back(std::move(rid_tp)); - paramFns.push_back(std::move(pos_tp)); - paramFns.push_back(std::move(ts)); + parameterFunctions.reserve(5); + parameterFunctions.push_back(std::move(rid0Function)); + parameterFunctions.push_back(std::move(frac0Function)); + parameterFunctions.push_back(std::move(ridFunction)); + parameterFunctions.push_back(std::move(fracFunction)); + parameterFunctions.push_back(std::move(tsFunction)); } VarVal EverNeNpointTnpointPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto rid_np = paramFns[0].execute(record, arena).cast(); - auto pos_np = paramFns[1].execute(record, arena).cast(); - auto rid_tp = paramFns[2].execute(record, arena).cast(); - auto pos_tp = paramFns[3].execute(record, arena).cast(); - auto ts = paramFns[4].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto rid0 = parameterValues[0].cast>(); + auto frac0 = parameterValues[1].cast>(); + auto rid = parameterValues[2].cast>(); + auto frac = parameterValues[3].cast>(); + auto ts = parameterValues[4].cast>(); + const auto result = nautilus::invoke( - +[](uint64_t rid_np, double pos_np, uint64_t rid_tp, double pos_tp, uint64_t ts) -> double { - try { + +[](uint64_t rid0, + double frac0, + int64_t rid, + double frac, + uint64_t ts) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - Npoint* np_s = npoint_make((int64_t)rid_np, pos_np); - if (!np_s) return 0.0; - Npoint* np_t = npoint_make((int64_t)rid_tp, pos_tp); - if (!np_t) { free(np_s); return 0.0; } - Temporal* inst = (Temporal*)tnpointinst_make(np_t, (TimestampTz)ts); - free(np_t); - if (!inst) { free(np_s); return 0.0; } - int r = ever_ne_npoint_tnpoint(np_s, inst); - free(np_s); free(inst); - return r > 0 ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + if (frac < 0.0 || frac > 1.0) return 0.0; + std::string tempWkt = fmt::format("NPoint({},{})@{}", rid, frac, MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tnpoint_in(tempWkt.c_str()); + if (!temp) return 0.0; + Npoint* np0 = npoint_make((int64_t)rid0, frac0); + if (!np0) { free(temp); return 0.0; } + + double r = ever_ne_npoint_tnpoint(np0, temp); + free(temp); + free(np0); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, - rid_np, pos_np, rid_tp, pos_tp, ts); + rid0, frac0, rid, frac, ts); + return VarVal(result); } @@ -77,12 +101,12 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterE PRECONDITION(arguments.childFunctions.size() == 5, "EverNeNpointTnpointPhysicalFunction requires 5 children but got {}", arguments.childFunctions.size()); - return EverNeNpointTnpointPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2]), - std::move(arguments.childFunctions[3]), - std::move(arguments.childFunctions[4])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + return EverNeNpointTnpointPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverNePoseTposePhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverNePoseTposePhysicalFunction.cpp index 8aad773b72..2e1be99d52 100644 --- a/nes-physical-operators/src/Functions/Meos/EverNePoseTposePhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/EverNePoseTposePhysicalFunction.cpp @@ -13,65 +13,92 @@ */ #include + #include #include #include +#include #include #include #include #include +#include #include +#include #include #include -#include -#include extern "C" { #include -#include #include } namespace NES { -EverNePoseTposePhysicalFunction::EverNePoseTposePhysicalFunction(PhysicalFunction x2, PhysicalFunction y2, PhysicalFunction theta2, PhysicalFunction x, PhysicalFunction y, PhysicalFunction theta, PhysicalFunction ts) +EverNePoseTposePhysicalFunction::EverNePoseTposePhysicalFunction(PhysicalFunction px0Function, + PhysicalFunction py0Function, + PhysicalFunction ptheta0Function, + PhysicalFunction xFunction, + PhysicalFunction yFunction, + PhysicalFunction thetaFunction, + PhysicalFunction tsFunction) { - paramFns.reserve(7); - paramFns.push_back(std::move(x2)); - paramFns.push_back(std::move(y2)); - paramFns.push_back(std::move(theta2)); - paramFns.push_back(std::move(x)); - paramFns.push_back(std::move(y)); - paramFns.push_back(std::move(theta)); - paramFns.push_back(std::move(ts)); + parameterFunctions.reserve(7); + parameterFunctions.push_back(std::move(px0Function)); + parameterFunctions.push_back(std::move(py0Function)); + parameterFunctions.push_back(std::move(ptheta0Function)); + parameterFunctions.push_back(std::move(xFunction)); + parameterFunctions.push_back(std::move(yFunction)); + parameterFunctions.push_back(std::move(thetaFunction)); + parameterFunctions.push_back(std::move(tsFunction)); } VarVal EverNePoseTposePhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto x2 = paramFns[0].execute(record, arena).cast(); - auto y2 = paramFns[1].execute(record, arena).cast(); - auto theta2 = paramFns[2].execute(record, arena).cast(); - auto x = paramFns[3].execute(record, arena).cast(); - auto y = paramFns[4].execute(record, arena).cast(); - auto theta = paramFns[5].execute(record, arena).cast(); - auto ts = paramFns[6].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto px0 = parameterValues[0].cast>(); + auto py0 = parameterValues[1].cast>(); + auto ptheta0 = parameterValues[2].cast>(); + auto x = parameterValues[3].cast>(); + auto y = parameterValues[4].cast>(); + auto theta = parameterValues[5].cast>(); + auto ts = parameterValues[6].cast>(); + const auto result = nautilus::invoke( - +[](double x2, double y2, double theta2, double x, double y, double theta, uint64_t ts) -> double { - try { + +[](double px0, + double py0, + double ptheta0, + double x, + double y, + double theta, + uint64_t ts) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - Pose* pose_s = pose_make_2d(x2, y2, theta2, false, 0); - if (!pose_s) return 0.0; - Pose* pose_t = pose_make_2d(x, y, theta, false, 0); - if (!pose_t) { free(pose_s); return 0.0; } - Temporal* inst = (Temporal*)tposeinst_make(pose_t, (TimestampTz)ts); - free(pose_t); - if (!inst) { free(pose_s); return 0.0; } - int r = ever_ne_pose_tpose(pose_s, inst); - free(pose_s); free(inst); - return r > 0 ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + std::string tempWkt = fmt::format("Pose(Point({} {}),{})@{}", x, y, theta, MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tpose_in(tempWkt.c_str()); + if (!temp) return 0.0; + Pose* pose0 = pose_make_2d(px0, py0, ptheta0, false, 0); + if (!pose0) { free(temp); return 0.0; } + + double r = ever_ne_pose_tpose(pose0, temp); + free(temp); + free(pose0); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, - x2, y2, theta2, x, y, theta, ts); + px0, py0, ptheta0, x, y, theta, ts); + return VarVal(result); } @@ -81,14 +108,14 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterE PRECONDITION(arguments.childFunctions.size() == 7, "EverNePoseTposePhysicalFunction requires 7 children but got {}", arguments.childFunctions.size()); - return EverNePoseTposePhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2]), - std::move(arguments.childFunctions[3]), - std::move(arguments.childFunctions[4]), - std::move(arguments.childFunctions[5]), - std::move(arguments.childFunctions[6])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + auto arg5 = std::move(arguments.childFunctions[5]); + auto arg6 = std::move(arguments.childFunctions[6]); + return EverNePoseTposePhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverNeTbigintBigintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverNeTbigintBigintPhysicalFunction.cpp index b102a2901b..b8645c455c 100644 --- a/nes-physical-operators/src/Functions/Meos/EverNeTbigintBigintPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/EverNeTbigintBigintPhysicalFunction.cpp @@ -36,13 +36,13 @@ extern "C" { namespace NES { EverNeTbigintBigintPhysicalFunction::EverNeTbigintBigintPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction thresholdFunction, - PhysicalFunction tsFunction) + PhysicalFunction tsFunction, + PhysicalFunction arg0Function) { parameterFunctions.reserve(3); parameterFunctions.push_back(std::move(valueFunction)); - parameterFunctions.push_back(std::move(thresholdFunction)); parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } VarVal EverNeTbigintBigintPhysicalFunction::execute(const Record& record, ArenaRef& arena) const @@ -50,25 +50,35 @@ VarVal EverNeTbigintBigintPhysicalFunction::execute(const Record& record, ArenaR std::vector parameterValues; parameterValues.reserve(parameterFunctions.size()); for (const auto& function : parameterFunctions) + { parameterValues.emplace_back(function.execute(record, arena)); + } - auto value = parameterValues[0].cast>(); - auto threshold = parameterValues[1].cast>(); - auto ts = parameterValues[2].cast>(); + auto value = parameterValues[0].cast>(); + auto ts = parameterValues[1].cast>(); + auto arg0 = parameterValues[2].cast>(); const auto result = nautilus::invoke( - +[](double value, double threshold, uint64_t ts) -> double { - try { + +[](double value, + uint64_t ts, + double arg0) -> int { + try + { MEOS::Meos::ensureMeosInitialized(); std::string tempWkt = fmt::format("{}@{}", static_cast(value), MEOS::Meos::convertEpochToTimestamp(ts)); Temporal* temp = tbigint_in(tempWkt.c_str()); - if (!temp) return 0.0; - int r = ever_ne_tbigint_bigint(temp, static_cast(threshold)); + if (!temp) return 0; + + int r = ever_ne_tbigint_bigint(temp, static_cast(arg0)); free(temp); - return static_cast(r); - } catch (const std::exception&) { return 0.0; } + return r; + } + catch (const std::exception&) + { + return 0; + } }, - value, threshold, ts); + value, ts, arg0); return VarVal(result); } diff --git a/nes-physical-operators/src/Functions/Meos/EverNeTboolBoolPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverNeTboolBoolPhysicalFunction.cpp index 6002b94504..8bf1990d4a 100644 --- a/nes-physical-operators/src/Functions/Meos/EverNeTboolBoolPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/EverNeTboolBoolPhysicalFunction.cpp @@ -36,13 +36,13 @@ extern "C" { namespace NES { EverNeTboolBoolPhysicalFunction::EverNeTboolBoolPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction thresholdFunction, - PhysicalFunction tsFunction) + PhysicalFunction tsFunction, + PhysicalFunction arg0Function) { parameterFunctions.reserve(3); parameterFunctions.push_back(std::move(valueFunction)); - parameterFunctions.push_back(std::move(thresholdFunction)); parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } VarVal EverNeTboolBoolPhysicalFunction::execute(const Record& record, ArenaRef& arena) const @@ -50,26 +50,35 @@ VarVal EverNeTboolBoolPhysicalFunction::execute(const Record& record, ArenaRef& std::vector parameterValues; parameterValues.reserve(parameterFunctions.size()); for (const auto& function : parameterFunctions) + { parameterValues.emplace_back(function.execute(record, arena)); + } - auto value = parameterValues[0].cast>(); - auto threshold = parameterValues[1].cast>(); - auto ts = parameterValues[2].cast>(); + auto value = parameterValues[0].cast>(); + auto ts = parameterValues[1].cast>(); + auto arg0 = parameterValues[2].cast>(); const auto result = nautilus::invoke( - +[](double v, double thr, uint64_t t) -> double { - try { + +[](double value, + uint64_t ts, + double arg0) -> int { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); - std::string wkt = fmt::format("{}@{}", (v != 0.0 ? "t" : "f"), ts_str); - Temporal* temp = tbool_in(wkt.c_str()); - if (!temp) return 0.0; - int r = ever_ne_tbool_bool(temp, static_cast(thr != 0.0)); + std::string tempWkt = fmt::format("{}@{}", value != 0.0 ? "t" : "f", MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tbool_in(tempWkt.c_str()); + if (!temp) return 0; + + int r = ever_ne_tbool_bool(temp, static_cast(arg0 != 0.0)); free(temp); - return static_cast(r); - } catch (const std::exception&) { return 0.0; } + return r; + } + catch (const std::exception&) + { + return 0; + } }, - value, threshold, ts); + value, ts, arg0); return VarVal(result); } diff --git a/nes-physical-operators/src/Functions/Meos/EverNeTcbufferTcbufferPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverNeTcbufferTcbufferPhysicalFunction.cpp index 10f7ece074..312c3b5279 100644 --- a/nes-physical-operators/src/Functions/Meos/EverNeTcbufferTcbufferPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/EverNeTcbufferTcbufferPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -20,75 +21,88 @@ #include #include #include +#include #include +#include #include #include -#include -#include extern "C" { #include -#include #include } namespace NES { -EverNeTcbufferTcbufferPhysicalFunction::EverNeTcbufferTcbufferPhysicalFunction( - PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction r1, PhysicalFunction ts1, - PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction r2, PhysicalFunction ts2) +EverNeTcbufferTcbufferPhysicalFunction::EverNeTcbufferTcbufferPhysicalFunction(PhysicalFunction lonAFunction, + PhysicalFunction latAFunction, + PhysicalFunction radiusAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction lonBFunction, + PhysicalFunction latBFunction, + PhysicalFunction radiusBFunction, + PhysicalFunction tsBFunction) { - paramFns.reserve(8); - paramFns.push_back(std::move(lon1)); - paramFns.push_back(std::move(lat1)); - paramFns.push_back(std::move(r1)); - paramFns.push_back(std::move(ts1)); - paramFns.push_back(std::move(lon2)); - paramFns.push_back(std::move(lat2)); - paramFns.push_back(std::move(r2)); - paramFns.push_back(std::move(ts2)); + parameterFunctions.reserve(8); + parameterFunctions.push_back(std::move(lonAFunction)); + parameterFunctions.push_back(std::move(latAFunction)); + parameterFunctions.push_back(std::move(radiusAFunction)); + parameterFunctions.push_back(std::move(tsAFunction)); + parameterFunctions.push_back(std::move(lonBFunction)); + parameterFunctions.push_back(std::move(latBFunction)); + parameterFunctions.push_back(std::move(radiusBFunction)); + parameterFunctions.push_back(std::move(tsBFunction)); } VarVal EverNeTcbufferTcbufferPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto lon1 = paramFns[0].execute(record, arena).cast(); - auto lat1 = paramFns[1].execute(record, arena).cast(); - auto r1 = paramFns[2].execute(record, arena).cast(); - auto ts1 = paramFns[3].execute(record, arena).cast(); - auto lon2 = paramFns[4].execute(record, arena).cast(); - auto lat2 = paramFns[5].execute(record, arena).cast(); - auto r2 = paramFns[6].execute(record, arena).cast(); - auto ts2 = paramFns[7].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto lonA = parameterValues[0].cast>(); + auto latA = parameterValues[1].cast>(); + auto radiusA = parameterValues[2].cast>(); + auto tsA = parameterValues[3].cast>(); + auto lonB = parameterValues[4].cast>(); + auto latB = parameterValues[5].cast>(); + auto radiusB = parameterValues[6].cast>(); + auto tsB = parameterValues[7].cast>(); const auto result = nautilus::invoke( - +[](double lon1, double lat1, double r1, uint64_t ts1, - double lon2, double lat2, double r2, uint64_t ts2) -> double { - try { + +[](double lonAValue, double latAValue, double radiusAValue, uint64_t tsAValue, + double lonBValue, double latBValue, double radiusBValue, uint64_t tsBValue) -> int { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string pt1 = fmt::format("POINT({} {})", lon1, lat1); - GSERIALIZED* gs1 = geom_in(pt1.c_str(), -1); - if (!gs1) return 0.0; - Cbuffer* cb1 = cbuffer_make(gs1, r1); - free(gs1); - if (!cb1) return 0.0; - Temporal* tcb1 = (Temporal*)tcbufferinst_make(cb1, (TimestampTz)ts1); - free(cb1); - if (!tcb1) return 0.0; - std::string pt2 = fmt::format("POINT({} {})", lon2, lat2); - GSERIALIZED* gs2 = geom_in(pt2.c_str(), -1); - if (!gs2) { free(tcb1); return 0.0; } - Cbuffer* cb2 = cbuffer_make(gs2, r2); - free(gs2); - if (!cb2) { free(tcb1); return 0.0; } - Temporal* tcb2 = (Temporal*)tcbufferinst_make(cb2, (TimestampTz)ts2); - free(cb2); - if (!tcb2) { free(tcb1); return 0.0; } - int r = ever_ne_tcbuffer_tcbuffer(tcb1, tcb2); - free(tcb1); free(tcb2); - return r > 0 ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + if (!(lonAValue >= -180.0 && lonAValue <= 180.0 && latAValue >= -90.0 && latAValue <= 90.0)) return 0; + if (!(lonBValue >= -180.0 && lonBValue <= 180.0 && latBValue >= -90.0 && latBValue <= 90.0)) return 0; + if (radiusAValue < 0.0 || radiusBValue < 0.0) return 0; + + const std::string tsAString = MEOS::Meos::convertEpochToTimestamp(tsAValue); + const std::string tsBString = MEOS::Meos::convertEpochToTimestamp(tsBValue); + std::string wktA = fmt::format("Cbuffer(Point({} {}),{})@{}", lonAValue, latAValue, radiusAValue, tsAString); + std::string wktB = fmt::format("Cbuffer(Point({} {}),{})@{}", lonBValue, latBValue, radiusBValue, tsBString); + + Temporal* tA = tcbuffer_in(wktA.c_str()); + if (!tA) return 0; + Temporal* tB = tcbuffer_in(wktB.c_str()); + if (!tB) { free(tA); return 0; } + + int r = ever_ne_tcbuffer_tcbuffer(tA, tB); + free(tA); + free(tB); + return r; + } + catch (const std::exception&) + { + return 0; + } }, - lon1, lat1, r1, ts1, lon2, lat2, r2, ts2); + lonA, latA, radiusA, tsA, lonB, latB, radiusB, tsB); return VarVal(result); } @@ -99,14 +113,15 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterE PRECONDITION(arguments.childFunctions.size() == 8, "EverNeTcbufferTcbufferPhysicalFunction requires 8 children but got {}", arguments.childFunctions.size()); - return EverNeTcbufferTcbufferPhysicalFunction(std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2]), - std::move(arguments.childFunctions[3]), - std::move(arguments.childFunctions[4]), - std::move(arguments.childFunctions[5]), - std::move(arguments.childFunctions[6]), - std::move(arguments.childFunctions[7])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + auto arg5 = std::move(arguments.childFunctions[5]); + auto arg6 = std::move(arguments.childFunctions[6]); + auto arg7 = std::move(arguments.childFunctions[7]); + return EverNeTcbufferTcbufferPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6), std::move(arg7)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverNeTextTtextPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverNeTextTtextPhysicalFunction.cpp index d1da80d397..4e5897fe03 100644 --- a/nes-physical-operators/src/Functions/Meos/EverNeTextTtextPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/EverNeTextTtextPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -33,44 +34,59 @@ extern "C" { namespace NES { -EverNeTextTtextPhysicalFunction::EverNeTextTtextPhysicalFunction( - PhysicalFunction valueFunction, PhysicalFunction refFunction, PhysicalFunction tsFunction) +EverNeTextTtextPhysicalFunction::EverNeTextTtextPhysicalFunction(PhysicalFunction arg0Function, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction) { - paramFns.reserve(3); - paramFns.push_back(std::move(valueFunction)); - paramFns.push_back(std::move(refFunction)); - paramFns.push_back(std::move(tsFunction)); + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(arg0Function)); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); } VarVal EverNeTextTtextPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto ref = paramFns[0].execute(record, arena).cast(); - auto value = paramFns[1].execute(record, arena).cast(); - auto ts = paramFns[2].execute(record, arena).cast>(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto arg0 = parameterValues[0].cast(); + auto value = parameterValues[1].cast(); + auto ts = parameterValues[2].cast>(); const auto result = nautilus::invoke( - +[](const char* r, uint32_t rsz, const char* v, uint32_t vsz, uint64_t t) -> double { - try { + +[](const char* arg0Ptr, uint32_t arg0Size, + const char* valuePtr, uint32_t valueSize, + uint64_t ts) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string ref_str(r, rsz); - std::string val_str(v, vsz); - while (!ref_str.empty() && (ref_str.front() == '\'' || ref_str.front() == '"')) ref_str = ref_str.substr(1); - while (!ref_str.empty() && (ref_str.back() == '\'' || ref_str.back() == '"')) ref_str = ref_str.substr(0, ref_str.size()-1); - while (!val_str.empty() && (val_str.front() == '\'' || val_str.front() == '"')) val_str = val_str.substr(1); - while (!val_str.empty() && (val_str.back() == '\'' || val_str.back() == '"')) val_str = val_str.substr(0, val_str.size()-1); - std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); - std::string wkt = "'" + val_str + "'@" + ts_str; - Temporal* temp = ttext_in(wkt.c_str()); + std::string tempVal(valuePtr, valueSize); + while (!tempVal.empty() && (tempVal.front() == '\'' || tempVal.front() == '"')) tempVal.erase(tempVal.begin()); + while (!tempVal.empty() && (tempVal.back() == '\'' || tempVal.back() == '"')) tempVal.pop_back(); + std::string tempWkt = "'" + tempVal + "'@" + MEOS::Meos::convertEpochToTimestamp(ts); + Temporal* temp = ttext_in(tempWkt.c_str()); if (!temp) return 0.0; - text* txt = cstring_to_text(ref_str.c_str()); - if (!txt) { free(temp); return 0.0; } - int result = ever_ne_text_ttext(txt, temp); + std::string arg0S(arg0Ptr, arg0Size); + while (!arg0S.empty() && (arg0S.front() == '\'' || arg0S.front() == '"')) arg0S.erase(arg0S.begin()); + while (!arg0S.empty() && (arg0S.back() == '\'' || arg0S.back() == '"')) arg0S.pop_back(); + text* txt0 = cstring_to_text(arg0S.c_str()); + if (!txt0) { free(temp); return 0.0; } + + double r = ever_ne_text_ttext(txt0, temp); free(temp); - free(txt); - return static_cast(result); - } catch (const std::exception&) { return 0.0; } + free(txt0); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, - ref, value, ts); + arg0.getContent(), arg0.getContentSize(), value.getContent(), value.getContentSize(), ts); return VarVal(result); } @@ -81,10 +97,10 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterE PRECONDITION(arguments.childFunctions.size() == 3, "EverNeTextTtextPhysicalFunction requires 3 children but got {}", arguments.childFunctions.size()); - return EverNeTextTtextPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return EverNeTextTtextPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverNeTgeoGeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverNeTgeoGeoPhysicalFunction.cpp index fd0a57634d..bf881440e7 100644 --- a/nes-physical-operators/src/Functions/Meos/EverNeTgeoGeoPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/EverNeTgeoGeoPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -34,40 +35,75 @@ extern "C" { namespace NES { -EverNeTgeoGeoPhysicalFunction::EverNeTgeoGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, - PhysicalFunction ts, PhysicalFunction wkt) +EverNeTgeoGeoPhysicalFunction::EverNeTgeoGeoPhysicalFunction(PhysicalFunction lonFunction, + PhysicalFunction latFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction) { - paramFns.reserve(4); - paramFns.push_back(std::move(lon)); - paramFns.push_back(std::move(lat)); - paramFns.push_back(std::move(ts)); - paramFns.push_back(std::move(wkt)); + parameterFunctions.reserve(4); + parameterFunctions.push_back(std::move(lonFunction)); + parameterFunctions.push_back(std::move(latFunction)); + parameterFunctions.push_back(std::move(timestampFunction)); + parameterFunctions.push_back(std::move(geometryFunction)); } VarVal EverNeTgeoGeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto lon = paramFns[0].execute(record, arena).cast(); - auto lat = paramFns[1].execute(record, arena).cast(); - auto ts = paramFns[2].execute(record, arena).cast(); - auto wkt = paramFns[3].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto lon = parameterValues[0].cast>(); + auto lat = parameterValues[1].cast>(); + auto timestamp = parameterValues[2].cast>(); + auto geometry = parameterValues[3].cast(); const auto result = nautilus::invoke( - +[](double lon, double lat, uint64_t ts, - const char* w, uint32_t wsz) -> double { - try { + +[](double lonValue, + double latValue, + uint64_t timestampValue, + const char* geometryPtr, + uint32_t geometrySize) -> int { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string wktStr(w, wsz); - std::string tgeoWkt = fmt::format("SRID=4326;POINT({},{})@{}", lon, lat, ts); - Temporal* tgeo = tgeompoint_in(tgeoWkt.c_str()); - if (!tgeo) return 0.0; - GSERIALIZED* gs = geom_in(wktStr.c_str(), -1); - if (!gs) { free(tgeo); return 0.0; } - double r = ever_ne_tgeo_geo(tgeo, gs) > 0 ? 1.0 : 0.0; - free(tgeo); free(gs); - return r; - } catch (const std::exception&) { return 0.0; } + if (!(lonValue >= -180.0 && lonValue <= 180.0 && latValue >= -90.0 && latValue <= 90.0)) { + return 0; + } + + const std::string timestampString = MEOS::Meos::convertEpochToTimestamp(timestampValue); + std::string temporalGeometryWkt = fmt::format("SRID=4326;Point({} {})@{}", lonValue, latValue, timestampString); + std::string staticGeometryWkt(geometryPtr, geometrySize); + + while (!staticGeometryWkt.empty() && (staticGeometryWkt.front() == '\'' || staticGeometryWkt.front() == '"')) + staticGeometryWkt.erase(staticGeometryWkt.begin()); + while (!staticGeometryWkt.empty() && (staticGeometryWkt.back() == '\'' || staticGeometryWkt.back() == '"')) + staticGeometryWkt.pop_back(); + + if (temporalGeometryWkt.empty() || staticGeometryWkt.empty()) + return 0; + + MEOS::Meos::TemporalGeometry temporalGeometry(temporalGeometryWkt); + if (!temporalGeometry.getGeometry()) return 0; + MEOS::Meos::StaticGeometry staticGeometry(staticGeometryWkt); + if (!staticGeometry.getGeometry()) return 0; + + // MEOS spatial-relation call — same shape as TemporalEDWithin's + // edwithin_tgeo_geo, but specific MEOS function per generated operator. + // Real MEOS spatial-rel signature: int fn(const Temporal *, const GSERIALIZED *) + // (no `atstart` flag — that's specific to geog_dwithin / edwithin's 3-arg variant). + return ever_ne_tgeo_geo(temporalGeometry.getGeometry(), + staticGeometry.getGeometry()); + } + catch (const std::exception&) + { + return 0; + } }, - lon, lat, ts, wkt); + lon, lat, timestamp, geometry.getContent(), geometry.getContentSize()); return VarVal(result); } @@ -78,10 +114,11 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterE PRECONDITION(arguments.childFunctions.size() == 4, "EverNeTgeoGeoPhysicalFunction requires 4 children but got {}", arguments.childFunctions.size()); - return EverNeTgeoGeoPhysicalFunction(std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2]), - std::move(arguments.childFunctions[3])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + return EverNeTgeoGeoPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverNeTgeoTgeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverNeTgeoTgeoPhysicalFunction.cpp index 07e36fb39e..b3a67e8426 100644 --- a/nes-physical-operators/src/Functions/Meos/EverNeTgeoTgeoPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/EverNeTgeoTgeoPhysicalFunction.cpp @@ -13,10 +13,10 @@ */ #include + #include #include #include -#include #include #include #include @@ -34,42 +34,68 @@ extern "C" { namespace NES { -EverNeTgeoTgeoPhysicalFunction::EverNeTgeoTgeoPhysicalFunction(PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction ts1, PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction ts2) +EverNeTgeoTgeoPhysicalFunction::EverNeTgeoTgeoPhysicalFunction(PhysicalFunction lonAFunction, + PhysicalFunction latAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction lonBFunction, + PhysicalFunction latBFunction, + PhysicalFunction tsBFunction) { - paramFns.reserve(6); - paramFns.push_back(std::move(lon1)); - paramFns.push_back(std::move(lat1)); - paramFns.push_back(std::move(ts1)); - paramFns.push_back(std::move(lon2)); - paramFns.push_back(std::move(lat2)); - paramFns.push_back(std::move(ts2)); + parameterFunctions.reserve(6); + parameterFunctions.push_back(std::move(lonAFunction)); + parameterFunctions.push_back(std::move(latAFunction)); + parameterFunctions.push_back(std::move(tsAFunction)); + parameterFunctions.push_back(std::move(lonBFunction)); + parameterFunctions.push_back(std::move(latBFunction)); + parameterFunctions.push_back(std::move(tsBFunction)); } VarVal EverNeTgeoTgeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto lon1 = paramFns[0].execute(record, arena).cast(); - auto lat1 = paramFns[1].execute(record, arena).cast(); - auto ts1 = paramFns[2].execute(record, arena).cast(); - auto lon2 = paramFns[3].execute(record, arena).cast(); - auto lat2 = paramFns[4].execute(record, arena).cast(); - auto ts2 = paramFns[5].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto lonA = parameterValues[0].cast>(); + auto latA = parameterValues[1].cast>(); + auto tsA = parameterValues[2].cast>(); + auto lonB = parameterValues[3].cast>(); + auto latB = parameterValues[4].cast>(); + auto tsB = parameterValues[5].cast>(); + const auto result = nautilus::invoke( - +[](double lon1, double lat1, uint64_t ts1, - double lon2, double lat2, uint64_t ts2) -> double { - try { + +[](double lonAValue, double latAValue, uint64_t tsAValue, + double lonBValue, double latBValue, uint64_t tsBValue) -> int { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string wkt1 = fmt::format("SRID=4326;POINT({},{})@{}", lon1, lat1, ts1); - Temporal* t1 = tgeompoint_in(wkt1.c_str()); - if (!t1) return 0.0; - std::string wkt2 = fmt::format("SRID=4326;POINT({},{})@{}", lon2, lat2, ts2); - Temporal* t2 = tgeompoint_in(wkt2.c_str()); - if (!t2) { free(t1); return 0.0; } - int r = ever_ne_tgeo_tgeo(t1, t2); - free(t1); free(t2); - return r > 0 ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + if (!(lonAValue >= -180.0 && lonAValue <= 180.0 && latAValue >= -90.0 && latAValue <= 90.0)) return 0; + if (!(lonBValue >= -180.0 && lonBValue <= 180.0 && latBValue >= -90.0 && latBValue <= 90.0)) return 0; + + const std::string tsAString = MEOS::Meos::convertEpochToTimestamp(tsAValue); + const std::string tsBString = MEOS::Meos::convertEpochToTimestamp(tsBValue); + std::string temporalGeometryAWkt = fmt::format("SRID=4326;Point({} {})@{}", lonAValue, latAValue, tsAString); + std::string temporalGeometryBWkt = fmt::format("SRID=4326;Point({} {})@{}", lonBValue, latBValue, tsBString); + + MEOS::Meos::TemporalGeometry temporalGeometryA(temporalGeometryAWkt); + if (!temporalGeometryA.getGeometry()) return 0; + MEOS::Meos::TemporalGeometry temporalGeometryB(temporalGeometryBWkt); + if (!temporalGeometryB.getGeometry()) return 0; + + // MEOS *_tgeo_tgeo spatial-relation: int fn(const Temporal*, const Temporal*). + return ever_ne_tgeo_tgeo(temporalGeometryA.getGeometry(), + temporalGeometryB.getGeometry()); + } + catch (const std::exception&) + { + return 0; + } }, - lon1, lat1, ts1, lon2, lat2, ts2); + lonA, latA, tsA, lonB, latB, tsB); + return VarVal(result); } @@ -79,13 +105,13 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterE PRECONDITION(arguments.childFunctions.size() == 6, "EverNeTgeoTgeoPhysicalFunction requires 6 children but got {}", arguments.childFunctions.size()); - return EverNeTgeoTgeoPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2]), - std::move(arguments.childFunctions[3]), - std::move(arguments.childFunctions[4]), - std::move(arguments.childFunctions[5])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + auto arg5 = std::move(arguments.childFunctions[5]); + return EverNeTgeoTgeoPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverNeTh3indexH3indexPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverNeTh3indexH3indexPhysicalFunction.cpp index 42ebd4deb8..b08acee83a 100644 --- a/nes-physical-operators/src/Functions/Meos/EverNeTh3indexH3indexPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/EverNeTh3indexH3indexPhysicalFunction.cpp @@ -13,14 +13,18 @@ */ #include + #include #include #include +#include #include #include #include #include +#include #include +#include #include #include @@ -31,33 +35,49 @@ extern "C" { namespace NES { -EverNeTh3indexH3indexPhysicalFunction::EverNeTh3indexH3indexPhysicalFunction(PhysicalFunction cell, PhysicalFunction ts, - PhysicalFunction target) +EverNeTh3indexH3indexPhysicalFunction::EverNeTh3indexH3indexPhysicalFunction(PhysicalFunction cellFunction, + PhysicalFunction tsFunction, + PhysicalFunction arg0Function) { - paramFns.reserve(3); - paramFns.push_back(std::move(cell)); - paramFns.push_back(std::move(ts)); - paramFns.push_back(std::move(target)); + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(cellFunction)); + parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } VarVal EverNeTh3indexH3indexPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto cell = paramFns[0].execute(record, arena).cast(); - auto ts = paramFns[1].execute(record, arena).cast(); - auto target = paramFns[2].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto cell = parameterValues[0].cast>(); + auto ts = parameterValues[1].cast>(); + auto arg0 = parameterValues[2].cast>(); const auto result = nautilus::invoke( - +[](uint64_t cell, uint64_t ts, uint64_t target) -> double { - try { + +[](uint64_t cell, + uint64_t ts, + uint64_t arg0) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - Temporal* inst = th3indexinst_make((H3Index)cell, (TimestampTz)ts); - if (!inst) return 0.0; - int r = ever_ne_th3index_h3index(inst, (H3Index)target); - free(inst); - return r > 0 ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + Temporal* temp = th3indexinst_make((H3Index)cell, (TimestampTz)ts); + if (!temp) return 0.0; + + double r = ever_ne_th3index_h3index(temp, (H3Index)arg0); + free(temp); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, - cell, ts, target); + cell, ts, arg0); return VarVal(result); } @@ -68,9 +88,10 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterE PRECONDITION(arguments.childFunctions.size() == 3, "EverNeTh3indexH3indexPhysicalFunction requires 3 children but got {}", arguments.childFunctions.size()); - return EverNeTh3indexH3indexPhysicalFunction(std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return EverNeTh3indexH3indexPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverNeTjsonbJsonbPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverNeTjsonbJsonbPhysicalFunction.cpp index 05e67e0377..76c9cec1f8 100644 --- a/nes-physical-operators/src/Functions/Meos/EverNeTjsonbJsonbPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/EverNeTjsonbJsonbPhysicalFunction.cpp @@ -13,18 +13,20 @@ */ #include + #include #include #include +#include #include #include #include #include +#include #include +#include #include #include -#include -#include extern "C" { #include @@ -33,40 +35,58 @@ extern "C" { namespace NES { -EverNeTjsonbJsonbPhysicalFunction::EverNeTjsonbJsonbPhysicalFunction(PhysicalFunction json_str, PhysicalFunction ts, PhysicalFunction target_json) +EverNeTjsonbJsonbPhysicalFunction::EverNeTjsonbJsonbPhysicalFunction(PhysicalFunction json_strFunction, + PhysicalFunction tsFunction, + PhysicalFunction arg0Function) { - paramFns.reserve(3); - paramFns.push_back(std::move(json_str)); - paramFns.push_back(std::move(ts)); - paramFns.push_back(std::move(target_json)); + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(json_strFunction)); + parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } VarVal EverNeTjsonbJsonbPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto json_str = paramFns[0].execute(record, arena); - auto ts = paramFns[1].execute(record, arena).cast(); - auto target_json = paramFns[2].execute(record, arena); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto json_str = parameterValues[0].cast(); + auto ts = parameterValues[1].cast>(); + auto arg0 = parameterValues[2].cast(); + const auto result = nautilus::invoke( - +[](const char* json_str, uint32_t json_len, uint64_t ts, const char* target_json, uint32_t target_len) -> double { - try { + +[](const char* json_strPtr, uint32_t json_strSize, + uint64_t ts, + const char* arg0Ptr, uint32_t arg0Size) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - char* s1 = (char*)malloc(json_len + 1); - memcpy(s1, json_str, json_len); s1[json_len] = '\0'; - Jsonb* jb = jsonb_in(s1); free(s1); - if (!jb) return 0.0; - TInstant* inst = tjsonbinst_make(jb, (TimestampTz)ts); - free(jb); - if (!inst) return 0.0; - char* s2 = (char*)malloc(target_len + 1); - memcpy(s2, target_json, target_len); s2[target_len] = '\0'; - Jsonb* target = jsonb_in(s2); free(s2); - if (!target) { free(inst); return 0.0; } - bool r = ever_ne_tjsonb_jsonb((Temporal*)inst, target) > 0; - free(inst); free(target); - return r ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + std::string tempS(json_strPtr, json_strSize); + Jsonb* tempJb = jsonb_in(tempS.c_str()); + if (!tempJb) return 0.0; + Temporal* temp = (Temporal*)tjsonbinst_make(tempJb, (TimestampTz)ts); + free(tempJb); + if (!temp) return 0.0; + std::string arg0S(arg0Ptr, arg0Size); + Jsonb* jb0 = jsonb_in(arg0S.c_str()); + if (!jb0) { free(temp); return 0.0; } + + double r = ever_ne_tjsonb_jsonb(temp, jb0); + free(temp); + free(jb0); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, - json_str, ts, target_json); + json_str.getContent(), json_str.getContentSize(), ts, arg0.getContent(), arg0.getContentSize()); + return VarVal(result); } @@ -76,10 +96,10 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterE PRECONDITION(arguments.childFunctions.size() == 3, "EverNeTjsonbJsonbPhysicalFunction requires 3 children but got {}", arguments.childFunctions.size()); - return EverNeTjsonbJsonbPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return EverNeTjsonbJsonbPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverNeTjsonbTjsonbPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverNeTjsonbTjsonbPhysicalFunction.cpp index f060309a62..5b22e7b0ef 100644 --- a/nes-physical-operators/src/Functions/Meos/EverNeTjsonbTjsonbPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/EverNeTjsonbTjsonbPhysicalFunction.cpp @@ -13,18 +13,20 @@ */ #include + #include #include #include +#include #include #include #include #include +#include #include +#include #include #include -#include -#include extern "C" { #include @@ -33,45 +35,65 @@ extern "C" { namespace NES { -EverNeTjsonbTjsonbPhysicalFunction::EverNeTjsonbTjsonbPhysicalFunction(PhysicalFunction json1, PhysicalFunction ts1, PhysicalFunction json2, PhysicalFunction ts2) +EverNeTjsonbTjsonbPhysicalFunction::EverNeTjsonbTjsonbPhysicalFunction(PhysicalFunction json_strFunction, + PhysicalFunction tsFunction, + PhysicalFunction json0Function, + PhysicalFunction ts0Function) { - paramFns.reserve(4); - paramFns.push_back(std::move(json1)); - paramFns.push_back(std::move(ts1)); - paramFns.push_back(std::move(json2)); - paramFns.push_back(std::move(ts2)); + parameterFunctions.reserve(4); + parameterFunctions.push_back(std::move(json_strFunction)); + parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(json0Function)); + parameterFunctions.push_back(std::move(ts0Function)); } VarVal EverNeTjsonbTjsonbPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto json1 = paramFns[0].execute(record, arena); - auto ts1 = paramFns[1].execute(record, arena).cast(); - auto json2 = paramFns[2].execute(record, arena); - auto ts2 = paramFns[3].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto json_str = parameterValues[0].cast(); + auto ts = parameterValues[1].cast>(); + auto json0 = parameterValues[2].cast(); + auto ts0 = parameterValues[3].cast>(); + const auto result = nautilus::invoke( - +[](const char* json1, uint32_t json1_len, uint64_t ts1, const char* json2, uint32_t json2_len, uint64_t ts2) -> double { - try { + +[](const char* json_strPtr, uint32_t json_strSize, + uint64_t ts, + const char* json0Ptr, uint32_t json0Size, + uint64_t ts0) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - char* s1 = (char*)malloc(json1_len + 1); - memcpy(s1, json1, json1_len); s1[json1_len] = '\0'; - Jsonb* jb1 = jsonb_in(s1); free(s1); - if (!jb1) return 0.0; - TInstant* inst1 = tjsonbinst_make(jb1, (TimestampTz)ts1); - free(jb1); - if (!inst1) return 0.0; - char* s2 = (char*)malloc(json2_len + 1); - memcpy(s2, json2, json2_len); s2[json2_len] = '\0'; - Jsonb* jb2 = jsonb_in(s2); free(s2); - if (!jb2) { free(inst1); return 0.0; } - TInstant* inst2 = tjsonbinst_make(jb2, (TimestampTz)ts2); - free(jb2); - if (!inst2) { free(inst1); return 0.0; } - int r = ever_ne_tjsonb_tjsonb((Temporal*)inst1, (Temporal*)inst2); - free(inst1); free(inst2); - return r > 0 ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + std::string tempS(json_strPtr, json_strSize); + Jsonb* tempJb = jsonb_in(tempS.c_str()); + if (!tempJb) return 0.0; + Temporal* temp = (Temporal*)tjsonbinst_make(tempJb, (TimestampTz)ts); + free(tempJb); + if (!temp) return 0.0; + std::string json0S(json0Ptr, json0Size); + Jsonb* jb0 = jsonb_in(json0S.c_str()); + if (!jb0) { free(temp); return 0.0; } + Temporal* inst0 = (Temporal*)tjsonbinst_make(jb0, (TimestampTz)ts0); + free(jb0); + if (!inst0) { free(temp); return 0.0; } + + double r = ever_ne_tjsonb_tjsonb(temp, inst0); + free(temp); + free(inst0); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, - json1, ts1, json2, ts2); + json_str.getContent(), json_str.getContentSize(), ts, json0.getContent(), json0.getContentSize(), ts0); + return VarVal(result); } @@ -81,11 +103,11 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterE PRECONDITION(arguments.childFunctions.size() == 4, "EverNeTjsonbTjsonbPhysicalFunction requires 4 children but got {}", arguments.childFunctions.size()); - return EverNeTjsonbTjsonbPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2]), - std::move(arguments.childFunctions[3])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + return EverNeTjsonbTjsonbPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverNeTnpointNpointPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverNeTnpointNpointPhysicalFunction.cpp index fcdd0cdab9..e2c2162c8a 100644 --- a/nes-physical-operators/src/Functions/Meos/EverNeTnpointNpointPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/EverNeTnpointNpointPhysicalFunction.cpp @@ -13,61 +13,85 @@ */ #include + #include #include #include +#include #include #include #include #include +#include #include +#include #include #include -#include -#include extern "C" { #include -#include #include } namespace NES { -EverNeTnpointNpointPhysicalFunction::EverNeTnpointNpointPhysicalFunction(PhysicalFunction rid1, PhysicalFunction pos1, PhysicalFunction ts, PhysicalFunction rid2, PhysicalFunction pos2) +EverNeTnpointNpointPhysicalFunction::EverNeTnpointNpointPhysicalFunction(PhysicalFunction ridFunction, + PhysicalFunction fracFunction, + PhysicalFunction tsFunction, + PhysicalFunction rid0Function, + PhysicalFunction frac0Function) { - paramFns.reserve(5); - paramFns.push_back(std::move(rid1)); - paramFns.push_back(std::move(pos1)); - paramFns.push_back(std::move(ts)); - paramFns.push_back(std::move(rid2)); - paramFns.push_back(std::move(pos2)); + parameterFunctions.reserve(5); + parameterFunctions.push_back(std::move(ridFunction)); + parameterFunctions.push_back(std::move(fracFunction)); + parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(rid0Function)); + parameterFunctions.push_back(std::move(frac0Function)); } VarVal EverNeTnpointNpointPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto rid1 = paramFns[0].execute(record, arena).cast(); - auto pos1 = paramFns[1].execute(record, arena).cast(); - auto ts = paramFns[2].execute(record, arena).cast(); - auto rid2 = paramFns[3].execute(record, arena).cast(); - auto pos2 = paramFns[4].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto rid = parameterValues[0].cast>(); + auto frac = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + auto rid0 = parameterValues[3].cast>(); + auto frac0 = parameterValues[4].cast>(); + const auto result = nautilus::invoke( - +[](uint64_t rid1, double pos1, uint64_t ts, uint64_t rid2, double pos2) -> double { - try { + +[](int64_t rid, + double frac, + uint64_t ts, + uint64_t rid0, + double frac0) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - Npoint* np1 = npoint_make((int64_t)rid1, pos1); - if (!np1) return 0.0; - Temporal* inst = (Temporal*)tnpointinst_make(np1, (TimestampTz)ts); - free(np1); - if (!inst) return 0.0; - Npoint* np2 = npoint_make((int64_t)rid2, pos2); - if (!np2) { free(inst); return 0.0; } - int r = ever_ne_tnpoint_npoint(inst, np2); - free(inst); free(np2); - return r > 0 ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + if (frac < 0.0 || frac > 1.0) return 0.0; + std::string tempWkt = fmt::format("NPoint({},{})@{}", rid, frac, MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tnpoint_in(tempWkt.c_str()); + if (!temp) return 0.0; + Npoint* np0 = npoint_make((int64_t)rid0, frac0); + if (!np0) { free(temp); return 0.0; } + + double r = ever_ne_tnpoint_npoint(temp, np0); + free(temp); + free(np0); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, - rid1, pos1, ts, rid2, pos2); + rid, frac, ts, rid0, frac0); + return VarVal(result); } @@ -77,12 +101,12 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterE PRECONDITION(arguments.childFunctions.size() == 5, "EverNeTnpointNpointPhysicalFunction requires 5 children but got {}", arguments.childFunctions.size()); - return EverNeTnpointNpointPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2]), - std::move(arguments.childFunctions[3]), - std::move(arguments.childFunctions[4])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + return EverNeTnpointNpointPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverNeTnpointTnpointPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverNeTnpointTnpointPhysicalFunction.cpp index 96cde58e77..423308175f 100644 --- a/nes-physical-operators/src/Functions/Meos/EverNeTnpointTnpointPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/EverNeTnpointTnpointPhysicalFunction.cpp @@ -13,17 +13,20 @@ */ #include + #include #include #include +#include #include #include #include #include +#include #include +#include #include #include -#include extern "C" { #include @@ -32,49 +35,69 @@ extern "C" { namespace NES { -EverNeTnpointTnpointPhysicalFunction::EverNeTnpointTnpointPhysicalFunction( - PhysicalFunction rid1, PhysicalFunction pos1, PhysicalFunction ts1, - PhysicalFunction rid2, PhysicalFunction pos2, PhysicalFunction ts2) +EverNeTnpointTnpointPhysicalFunction::EverNeTnpointTnpointPhysicalFunction(PhysicalFunction ridFunction, + PhysicalFunction fracFunction, + PhysicalFunction tsFunction, + PhysicalFunction rid0Function, + PhysicalFunction frac0Function, + PhysicalFunction ts0Function) { - paramFns.reserve(6); - paramFns.push_back(std::move(rid1)); - paramFns.push_back(std::move(pos1)); - paramFns.push_back(std::move(ts1)); - paramFns.push_back(std::move(rid2)); - paramFns.push_back(std::move(pos2)); - paramFns.push_back(std::move(ts2)); + parameterFunctions.reserve(6); + parameterFunctions.push_back(std::move(ridFunction)); + parameterFunctions.push_back(std::move(fracFunction)); + parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(rid0Function)); + parameterFunctions.push_back(std::move(frac0Function)); + parameterFunctions.push_back(std::move(ts0Function)); } VarVal EverNeTnpointTnpointPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto rid1 = paramFns[0].execute(record, arena).cast(); - auto pos1 = paramFns[1].execute(record, arena).cast(); - auto ts1 = paramFns[2].execute(record, arena).cast(); - auto rid2 = paramFns[3].execute(record, arena).cast(); - auto pos2 = paramFns[4].execute(record, arena).cast(); - auto ts2 = paramFns[5].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto rid = parameterValues[0].cast>(); + auto frac = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + auto rid0 = parameterValues[3].cast>(); + auto frac0 = parameterValues[4].cast>(); + auto ts0 = parameterValues[5].cast>(); const auto result = nautilus::invoke( - +[](uint64_t rid1, double pos1, uint64_t ts1, - uint64_t rid2, double pos2, uint64_t ts2) -> double { - try { + +[](int64_t rid, + double frac, + uint64_t ts, + uint64_t rid0, + double frac0, + uint64_t ts0) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - Npoint* np1 = npoint_make((int64_t)rid1, pos1); - if (!np1) return 0.0; - Temporal* inst1 = (Temporal*)tnpointinst_make(np1, (TimestampTz)ts1); - free(np1); - if (!inst1) return 0.0; - Npoint* np2 = npoint_make((int64_t)rid2, pos2); - if (!np2) { free(inst1); return 0.0; } - Temporal* inst2 = (Temporal*)tnpointinst_make(np2, (TimestampTz)ts2); - free(np2); - if (!inst2) { free(inst1); return 0.0; } - int r = ever_ne_tnpoint_tnpoint(inst1, inst2); - free(inst1); free(inst2); - return r > 0 ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + if (frac < 0.0 || frac > 1.0) return 0.0; + std::string tempWkt = fmt::format("NPoint({},{})@{}", rid, frac, MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tnpoint_in(tempWkt.c_str()); + if (!temp) return 0.0; + Npoint* np0 = npoint_make((int64_t)rid0, frac0); + if (!np0) { free(temp); return 0.0; } + Temporal* inst0 = (Temporal*)tnpointinst_make(np0, (TimestampTz)ts0); + free(np0); + if (!inst0) { free(temp); return 0.0; } + + double r = ever_ne_tnpoint_tnpoint(temp, inst0); + free(temp); + free(inst0); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, - rid1, pos1, ts1, rid2, pos2, ts2); + rid, frac, ts, rid0, frac0, ts0); return VarVal(result); } @@ -85,12 +108,13 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterE PRECONDITION(arguments.childFunctions.size() == 6, "EverNeTnpointTnpointPhysicalFunction requires 6 children but got {}", arguments.childFunctions.size()); - return EverNeTnpointTnpointPhysicalFunction(std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2]), - std::move(arguments.childFunctions[3]), - std::move(arguments.childFunctions[4]), - std::move(arguments.childFunctions[5])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + auto arg5 = std::move(arguments.childFunctions[5]); + return EverNeTnpointTnpointPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverNeTposePosePhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverNeTposePosePhysicalFunction.cpp index 99f9def5be..ad5208a732 100644 --- a/nes-physical-operators/src/Functions/Meos/EverNeTposePosePhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/EverNeTposePosePhysicalFunction.cpp @@ -13,65 +13,92 @@ */ #include + #include #include #include +#include #include #include #include #include +#include #include +#include #include #include -#include -#include extern "C" { #include -#include #include } namespace NES { -EverNeTposePosePhysicalFunction::EverNeTposePosePhysicalFunction(PhysicalFunction x, PhysicalFunction y, PhysicalFunction theta, PhysicalFunction ts, PhysicalFunction x2, PhysicalFunction y2, PhysicalFunction theta2) +EverNeTposePosePhysicalFunction::EverNeTposePosePhysicalFunction(PhysicalFunction xFunction, + PhysicalFunction yFunction, + PhysicalFunction thetaFunction, + PhysicalFunction tsFunction, + PhysicalFunction px0Function, + PhysicalFunction py0Function, + PhysicalFunction ptheta0Function) { - paramFns.reserve(7); - paramFns.push_back(std::move(x)); - paramFns.push_back(std::move(y)); - paramFns.push_back(std::move(theta)); - paramFns.push_back(std::move(ts)); - paramFns.push_back(std::move(x2)); - paramFns.push_back(std::move(y2)); - paramFns.push_back(std::move(theta2)); + parameterFunctions.reserve(7); + parameterFunctions.push_back(std::move(xFunction)); + parameterFunctions.push_back(std::move(yFunction)); + parameterFunctions.push_back(std::move(thetaFunction)); + parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(px0Function)); + parameterFunctions.push_back(std::move(py0Function)); + parameterFunctions.push_back(std::move(ptheta0Function)); } VarVal EverNeTposePosePhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto x = paramFns[0].execute(record, arena).cast(); - auto y = paramFns[1].execute(record, arena).cast(); - auto theta = paramFns[2].execute(record, arena).cast(); - auto ts = paramFns[3].execute(record, arena).cast(); - auto x2 = paramFns[4].execute(record, arena).cast(); - auto y2 = paramFns[5].execute(record, arena).cast(); - auto theta2 = paramFns[6].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto x = parameterValues[0].cast>(); + auto y = parameterValues[1].cast>(); + auto theta = parameterValues[2].cast>(); + auto ts = parameterValues[3].cast>(); + auto px0 = parameterValues[4].cast>(); + auto py0 = parameterValues[5].cast>(); + auto ptheta0 = parameterValues[6].cast>(); + const auto result = nautilus::invoke( - +[](double x, double y, double theta, uint64_t ts, double x2, double y2, double theta2) -> double { - try { + +[](double x, + double y, + double theta, + uint64_t ts, + double px0, + double py0, + double ptheta0) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - Pose* pose1 = pose_make_2d(x, y, theta, false, 0); - if (!pose1) return 0.0; - Temporal* inst = (Temporal*)tposeinst_make(pose1, (TimestampTz)ts); - free(pose1); - if (!inst) return 0.0; - Pose* pose2 = pose_make_2d(x2, y2, theta2, false, 0); - if (!pose2) { free(inst); return 0.0; } - int r = ever_ne_tpose_pose(inst, pose2); - free(inst); free(pose2); - return r > 0 ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + std::string tempWkt = fmt::format("Pose(Point({} {}),{})@{}", x, y, theta, MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tpose_in(tempWkt.c_str()); + if (!temp) return 0.0; + Pose* pose0 = pose_make_2d(px0, py0, ptheta0, false, 0); + if (!pose0) { free(temp); return 0.0; } + + double r = ever_ne_tpose_pose(temp, pose0); + free(temp); + free(pose0); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, - x, y, theta, ts, x2, y2, theta2); + x, y, theta, ts, px0, py0, ptheta0); + return VarVal(result); } @@ -81,14 +108,14 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterE PRECONDITION(arguments.childFunctions.size() == 7, "EverNeTposePosePhysicalFunction requires 7 children but got {}", arguments.childFunctions.size()); - return EverNeTposePosePhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2]), - std::move(arguments.childFunctions[3]), - std::move(arguments.childFunctions[4]), - std::move(arguments.childFunctions[5]), - std::move(arguments.childFunctions[6])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + auto arg5 = std::move(arguments.childFunctions[5]); + auto arg6 = std::move(arguments.childFunctions[6]); + return EverNeTposePosePhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverNeTposeTposePhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverNeTposeTposePhysicalFunction.cpp index 2433995d0e..0228b579f3 100644 --- a/nes-physical-operators/src/Functions/Meos/EverNeTposeTposePhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/EverNeTposeTposePhysicalFunction.cpp @@ -13,17 +13,20 @@ */ #include + #include #include #include +#include #include #include #include #include +#include #include +#include #include #include -#include extern "C" { #include @@ -32,53 +35,76 @@ extern "C" { namespace NES { -EverNeTposeTposePhysicalFunction::EverNeTposeTposePhysicalFunction( - PhysicalFunction x1, PhysicalFunction y1, PhysicalFunction theta1, PhysicalFunction ts1, - PhysicalFunction x2, PhysicalFunction y2, PhysicalFunction theta2, PhysicalFunction ts2) +EverNeTposeTposePhysicalFunction::EverNeTposeTposePhysicalFunction(PhysicalFunction xFunction, + PhysicalFunction yFunction, + PhysicalFunction thetaFunction, + PhysicalFunction tsFunction, + PhysicalFunction px0Function, + PhysicalFunction py0Function, + PhysicalFunction ptheta0Function, + PhysicalFunction ts0Function) { - paramFns.reserve(8); - paramFns.push_back(std::move(x1)); - paramFns.push_back(std::move(y1)); - paramFns.push_back(std::move(theta1)); - paramFns.push_back(std::move(ts1)); - paramFns.push_back(std::move(x2)); - paramFns.push_back(std::move(y2)); - paramFns.push_back(std::move(theta2)); - paramFns.push_back(std::move(ts2)); + parameterFunctions.reserve(8); + parameterFunctions.push_back(std::move(xFunction)); + parameterFunctions.push_back(std::move(yFunction)); + parameterFunctions.push_back(std::move(thetaFunction)); + parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(px0Function)); + parameterFunctions.push_back(std::move(py0Function)); + parameterFunctions.push_back(std::move(ptheta0Function)); + parameterFunctions.push_back(std::move(ts0Function)); } VarVal EverNeTposeTposePhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto x1 = paramFns[0].execute(record, arena).cast(); - auto y1 = paramFns[1].execute(record, arena).cast(); - auto theta1 = paramFns[2].execute(record, arena).cast(); - auto ts1 = paramFns[3].execute(record, arena).cast(); - auto x2 = paramFns[4].execute(record, arena).cast(); - auto y2 = paramFns[5].execute(record, arena).cast(); - auto theta2 = paramFns[6].execute(record, arena).cast(); - auto ts2 = paramFns[7].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto x = parameterValues[0].cast>(); + auto y = parameterValues[1].cast>(); + auto theta = parameterValues[2].cast>(); + auto ts = parameterValues[3].cast>(); + auto px0 = parameterValues[4].cast>(); + auto py0 = parameterValues[5].cast>(); + auto ptheta0 = parameterValues[6].cast>(); + auto ts0 = parameterValues[7].cast>(); const auto result = nautilus::invoke( - +[](double x1, double y1, double theta1, uint64_t ts1, - double x2, double y2, double theta2, uint64_t ts2) -> double { - try { + +[](double x, + double y, + double theta, + uint64_t ts, + double px0, + double py0, + double ptheta0, + uint64_t ts0) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - Pose* p1 = pose_make_2d(x1, y1, theta1, false, 0); - if (!p1) return 0.0; - Temporal* inst1 = (Temporal*)tposeinst_make(p1, (TimestampTz)ts1); - free(p1); - if (!inst1) return 0.0; - Pose* p2 = pose_make_2d(x2, y2, theta2, false, 0); - if (!p2) { free(inst1); return 0.0; } - Temporal* inst2 = (Temporal*)tposeinst_make(p2, (TimestampTz)ts2); - free(p2); - if (!inst2) { free(inst1); return 0.0; } - int r = ever_ne_tpose_tpose(inst1, inst2); - free(inst1); free(inst2); - return r > 0 ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + std::string tempWkt = fmt::format("Pose(Point({} {}),{})@{}", x, y, theta, MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tpose_in(tempWkt.c_str()); + if (!temp) return 0.0; + Pose* pose0A = pose_make_2d(px0, py0, ptheta0, false, 0); + if (!pose0A) { free(temp); return 0.0; } + Temporal* inst0 = (Temporal*)tposeinst_make(pose0A, (TimestampTz)ts0); + free(pose0A); + if (!inst0) { free(temp); return 0.0; } + + double r = ever_ne_tpose_tpose(temp, inst0); + free(temp); + free(inst0); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, - x1, y1, theta1, ts1, x2, y2, theta2, ts2); + x, y, theta, ts, px0, py0, ptheta0, ts0); return VarVal(result); } @@ -89,14 +115,15 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterE PRECONDITION(arguments.childFunctions.size() == 8, "EverNeTposeTposePhysicalFunction requires 8 children but got {}", arguments.childFunctions.size()); - return EverNeTposeTposePhysicalFunction(std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2]), - std::move(arguments.childFunctions[3]), - std::move(arguments.childFunctions[4]), - std::move(arguments.childFunctions[5]), - std::move(arguments.childFunctions[6]), - std::move(arguments.childFunctions[7])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + auto arg5 = std::move(arguments.childFunctions[5]); + auto arg6 = std::move(arguments.childFunctions[6]); + auto arg7 = std::move(arguments.childFunctions[7]); + return EverNeTposeTposePhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6), std::move(arg7)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverNeTquadbinQuadbinPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverNeTquadbinQuadbinPhysicalFunction.cpp index 4c2955b1a3..b8e04d3187 100644 --- a/nes-physical-operators/src/Functions/Meos/EverNeTquadbinQuadbinPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/EverNeTquadbinQuadbinPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -21,7 +22,9 @@ #include #include #include +#include #include +#include #include #include @@ -32,40 +35,63 @@ extern "C" { namespace NES { -EverNeTquadbinQuadbinPhysicalFunction::EverNeTquadbinQuadbinPhysicalFunction(PhysicalFunction inst_cell, PhysicalFunction ts, PhysicalFunction cell) { - paramFns.reserve(3); - paramFns.push_back(std::move(inst_cell)); - paramFns.push_back(std::move(ts)); - paramFns.push_back(std::move(cell)); +EverNeTquadbinQuadbinPhysicalFunction::EverNeTquadbinQuadbinPhysicalFunction(PhysicalFunction cellFunction, + PhysicalFunction tsFunction, + PhysicalFunction arg0Function) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(cellFunction)); + parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } -VarVal EverNeTquadbinQuadbinPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto inst_cell = paramFns[0].execute(record, arena).cast(); - auto ts = paramFns[1].execute(record, arena).cast(); - auto cell = paramFns[2].execute(record, arena).cast(); +VarVal EverNeTquadbinQuadbinPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto cell = parameterValues[0].cast>(); + auto ts = parameterValues[1].cast>(); + auto arg0 = parameterValues[2].cast>(); + const auto result = nautilus::invoke( - +[](uint64_t ic, uint64_t ts, uint64_t cell) -> double { - MEOS::Meos::ensureMeosInitialized(); - TInstant* inst = tquadbininst_make((Quadbin)ic, (TimestampTz)ts); - if (!inst) return 0.0; - int r = ever_ne_tquadbin_quadbin((const Temporal*)inst, (Quadbin)cell); - free(inst); - return r > 0 ? 1.0 : 0.0; + +[](uint64_t cell, + uint64_t ts, + uint64_t arg0) -> double { + try + { + MEOS::Meos::ensureMeosInitialized(); + Temporal* temp = (Temporal*)tquadbininst_make((Quadbin)cell, (TimestampTz)ts); + if (!temp) return 0.0; + + double r = ever_ne_tquadbin_quadbin(temp, (Quadbin)arg0); + free(temp); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, - inst_cell, ts, cell); + cell, ts, arg0); + return VarVal(result); } PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterEverNeTquadbinQuadbinPhysicalFunction( PhysicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.childFunctions.size()==3, + PRECONDITION(arguments.childFunctions.size() == 3, "EverNeTquadbinQuadbinPhysicalFunction requires 3 children but got {}", arguments.childFunctions.size()); - return EverNeTquadbinQuadbinPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return EverNeTquadbinQuadbinPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/EverNeTtextTextPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/EverNeTtextTextPhysicalFunction.cpp index 2b3d082952..9961c29d6c 100644 --- a/nes-physical-operators/src/Functions/Meos/EverNeTtextTextPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/EverNeTtextTextPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -33,44 +34,59 @@ extern "C" { namespace NES { -EverNeTtextTextPhysicalFunction::EverNeTtextTextPhysicalFunction( - PhysicalFunction valueFunction, PhysicalFunction refFunction, PhysicalFunction tsFunction) +EverNeTtextTextPhysicalFunction::EverNeTtextTextPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction, + PhysicalFunction arg0Function) { - paramFns.reserve(3); - paramFns.push_back(std::move(valueFunction)); - paramFns.push_back(std::move(refFunction)); - paramFns.push_back(std::move(tsFunction)); + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } VarVal EverNeTtextTextPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto value = paramFns[0].execute(record, arena).cast(); - auto ref = paramFns[1].execute(record, arena).cast(); - auto ts = paramFns[2].execute(record, arena).cast>(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto value = parameterValues[0].cast(); + auto ts = parameterValues[1].cast>(); + auto arg0 = parameterValues[2].cast(); const auto result = nautilus::invoke( - +[](const char* v, uint32_t vsz, const char* r, uint32_t rsz, uint64_t t) -> double { - try { + +[](const char* valuePtr, uint32_t valueSize, + uint64_t ts, + const char* arg0Ptr, uint32_t arg0Size) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string val_str(v, vsz); - std::string ref_str(r, rsz); - while (!val_str.empty() && (val_str.front() == '\'' || val_str.front() == '"')) val_str = val_str.substr(1); - while (!val_str.empty() && (val_str.back() == '\'' || val_str.back() == '"')) val_str = val_str.substr(0, val_str.size()-1); - while (!ref_str.empty() && (ref_str.front() == '\'' || ref_str.front() == '"')) ref_str = ref_str.substr(1); - while (!ref_str.empty() && (ref_str.back() == '\'' || ref_str.back() == '"')) ref_str = ref_str.substr(0, ref_str.size()-1); - std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); - std::string wkt = "'" + val_str + "'@" + ts_str; - Temporal* temp = ttext_in(wkt.c_str()); + std::string tempVal(valuePtr, valueSize); + while (!tempVal.empty() && (tempVal.front() == '\'' || tempVal.front() == '"')) tempVal.erase(tempVal.begin()); + while (!tempVal.empty() && (tempVal.back() == '\'' || tempVal.back() == '"')) tempVal.pop_back(); + std::string tempWkt = "'" + tempVal + "'@" + MEOS::Meos::convertEpochToTimestamp(ts); + Temporal* temp = ttext_in(tempWkt.c_str()); if (!temp) return 0.0; - text* txt = cstring_to_text(ref_str.c_str()); - if (!txt) { free(temp); return 0.0; } - int result = ever_ne_ttext_text(temp, txt); + std::string arg0S(arg0Ptr, arg0Size); + while (!arg0S.empty() && (arg0S.front() == '\'' || arg0S.front() == '"')) arg0S.erase(arg0S.begin()); + while (!arg0S.empty() && (arg0S.back() == '\'' || arg0S.back() == '"')) arg0S.pop_back(); + text* txt0 = cstring_to_text(arg0S.c_str()); + if (!txt0) { free(temp); return 0.0; } + + double r = ever_ne_ttext_text(temp, txt0); free(temp); - free(txt); - return static_cast(result); - } catch (const std::exception&) { return 0.0; } + free(txt0); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, - value, ref, ts); + value.getContent(), value.getContentSize(), ts, arg0.getContent(), arg0.getContentSize()); return VarVal(result); } @@ -81,10 +97,10 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterE PRECONDITION(arguments.childFunctions.size() == 3, "EverNeTtextTextPhysicalFunction requires 3 children but got {}", arguments.childFunctions.size()); - return EverNeTtextTextPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return EverNeTtextTextPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/FloatspanLowerIncPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/FloatspanLowerIncPhysicalFunction.cpp index b2f34231dd..d8cf63a2fe 100644 --- a/nes-physical-operators/src/Functions/Meos/FloatspanLowerIncPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/FloatspanLowerIncPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -21,49 +22,66 @@ #include #include #include +#include #include +#include #include #include extern "C" { #include } -#include -#include namespace NES { -FloatspanLowerIncPhysicalFunction::FloatspanLowerIncPhysicalFunction(PhysicalFunction sp) { - paramFns.reserve(1); - paramFns.push_back(std::move(sp)); +FloatspanLowerIncPhysicalFunction::FloatspanLowerIncPhysicalFunction(PhysicalFunction spFunction) +{ + parameterFunctions.reserve(1); + parameterFunctions.push_back(std::move(spFunction)); } -VarVal FloatspanLowerIncPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto sp = paramFns[0].execute(record, arena).cast(); +VarVal FloatspanLowerIncPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto sp = parameterValues[0].cast(); + const auto result = nautilus::invoke( - +[](const char* w, uint32_t wsz) -> double { - try { + +[](const char* spPtr, uint32_t spSize) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string s(w, wsz); - Span* sp = floatspan_in(s.c_str()); - if (!sp) return 0.0; - bool r = span_lower_inc(sp); - free(sp); - return r ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + std::string tempS(spPtr, spSize); + Span* temp = floatspan_in(tempS.c_str()); + if (!temp) return 0.0; + + double r = span_lower_inc(temp); + free(temp); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, - sp); + sp.getContent(), sp.getContentSize()); + return VarVal(result); } PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterFloatspanLowerIncPhysicalFunction( PhysicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.childFunctions.size()==1, + PRECONDITION(arguments.childFunctions.size() == 1, "FloatspanLowerIncPhysicalFunction requires 1 children but got {}", arguments.childFunctions.size()); - return FloatspanLowerIncPhysicalFunction( - std::move(arguments.childFunctions[0])); + auto arg0 = std::move(arguments.childFunctions[0]); + return FloatspanLowerIncPhysicalFunction(std::move(arg0)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/FloatspanLowerPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/FloatspanLowerPhysicalFunction.cpp index 83aadcd6b4..ea646c04df 100644 --- a/nes-physical-operators/src/Functions/Meos/FloatspanLowerPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/FloatspanLowerPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -21,49 +22,66 @@ #include #include #include +#include #include +#include #include #include extern "C" { #include } -#include -#include namespace NES { -FloatspanLowerPhysicalFunction::FloatspanLowerPhysicalFunction(PhysicalFunction sp) { - paramFns.reserve(1); - paramFns.push_back(std::move(sp)); +FloatspanLowerPhysicalFunction::FloatspanLowerPhysicalFunction(PhysicalFunction spFunction) +{ + parameterFunctions.reserve(1); + parameterFunctions.push_back(std::move(spFunction)); } -VarVal FloatspanLowerPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto sp = paramFns[0].execute(record, arena).cast(); +VarVal FloatspanLowerPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto sp = parameterValues[0].cast(); + const auto result = nautilus::invoke( - +[](const char* w, uint32_t wsz) -> double { - try { + +[](const char* spPtr, uint32_t spSize) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string s(w, wsz); - Span* sp = floatspan_in(s.c_str()); - if (!sp) return 0.0; - double r = (double)floatspan_lower(sp); - free(sp); + std::string tempS(spPtr, spSize); + Span* temp = floatspan_in(tempS.c_str()); + if (!temp) return 0.0; + + double r = floatspan_lower(temp); + free(temp); return r; - } catch (const std::exception&) { return 0.0; } + } + catch (const std::exception&) + { + return 0.0; + } }, - sp); + sp.getContent(), sp.getContentSize()); + return VarVal(result); } PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterFloatspanLowerPhysicalFunction( PhysicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.childFunctions.size()==1, + PRECONDITION(arguments.childFunctions.size() == 1, "FloatspanLowerPhysicalFunction requires 1 children but got {}", arguments.childFunctions.size()); - return FloatspanLowerPhysicalFunction( - std::move(arguments.childFunctions[0])); + auto arg0 = std::move(arguments.childFunctions[0]); + return FloatspanLowerPhysicalFunction(std::move(arg0)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/FloatspanUpperIncPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/FloatspanUpperIncPhysicalFunction.cpp index 7934b149f3..0fa721235c 100644 --- a/nes-physical-operators/src/Functions/Meos/FloatspanUpperIncPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/FloatspanUpperIncPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -21,49 +22,66 @@ #include #include #include +#include #include +#include #include #include extern "C" { #include } -#include -#include namespace NES { -FloatspanUpperIncPhysicalFunction::FloatspanUpperIncPhysicalFunction(PhysicalFunction sp) { - paramFns.reserve(1); - paramFns.push_back(std::move(sp)); +FloatspanUpperIncPhysicalFunction::FloatspanUpperIncPhysicalFunction(PhysicalFunction spFunction) +{ + parameterFunctions.reserve(1); + parameterFunctions.push_back(std::move(spFunction)); } -VarVal FloatspanUpperIncPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto sp = paramFns[0].execute(record, arena).cast(); +VarVal FloatspanUpperIncPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto sp = parameterValues[0].cast(); + const auto result = nautilus::invoke( - +[](const char* w, uint32_t wsz) -> double { - try { + +[](const char* spPtr, uint32_t spSize) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string s(w, wsz); - Span* sp = floatspan_in(s.c_str()); - if (!sp) return 0.0; - bool r = span_upper_inc(sp); - free(sp); - return r ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + std::string tempS(spPtr, spSize); + Span* temp = floatspan_in(tempS.c_str()); + if (!temp) return 0.0; + + double r = span_upper_inc(temp); + free(temp); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, - sp); + sp.getContent(), sp.getContentSize()); + return VarVal(result); } PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterFloatspanUpperIncPhysicalFunction( PhysicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.childFunctions.size()==1, + PRECONDITION(arguments.childFunctions.size() == 1, "FloatspanUpperIncPhysicalFunction requires 1 children but got {}", arguments.childFunctions.size()); - return FloatspanUpperIncPhysicalFunction( - std::move(arguments.childFunctions[0])); + auto arg0 = std::move(arguments.childFunctions[0]); + return FloatspanUpperIncPhysicalFunction(std::move(arg0)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/FloatspanUpperPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/FloatspanUpperPhysicalFunction.cpp index 6bd7454ea6..e9f2147002 100644 --- a/nes-physical-operators/src/Functions/Meos/FloatspanUpperPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/FloatspanUpperPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -21,49 +22,66 @@ #include #include #include +#include #include +#include #include #include extern "C" { #include } -#include -#include namespace NES { -FloatspanUpperPhysicalFunction::FloatspanUpperPhysicalFunction(PhysicalFunction sp) { - paramFns.reserve(1); - paramFns.push_back(std::move(sp)); +FloatspanUpperPhysicalFunction::FloatspanUpperPhysicalFunction(PhysicalFunction spFunction) +{ + parameterFunctions.reserve(1); + parameterFunctions.push_back(std::move(spFunction)); } -VarVal FloatspanUpperPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto sp = paramFns[0].execute(record, arena).cast(); +VarVal FloatspanUpperPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto sp = parameterValues[0].cast(); + const auto result = nautilus::invoke( - +[](const char* w, uint32_t wsz) -> double { - try { + +[](const char* spPtr, uint32_t spSize) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string s(w, wsz); - Span* sp = floatspan_in(s.c_str()); - if (!sp) return 0.0; - double r = (double)floatspan_upper(sp); - free(sp); + std::string tempS(spPtr, spSize); + Span* temp = floatspan_in(tempS.c_str()); + if (!temp) return 0.0; + + double r = floatspan_upper(temp); + free(temp); return r; - } catch (const std::exception&) { return 0.0; } + } + catch (const std::exception&) + { + return 0.0; + } }, - sp); + sp.getContent(), sp.getContentSize()); + return VarVal(result); } PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterFloatspanUpperPhysicalFunction( PhysicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.childFunctions.size()==1, + PRECONDITION(arguments.childFunctions.size() == 1, "FloatspanUpperPhysicalFunction requires 1 children but got {}", arguments.childFunctions.size()); - return FloatspanUpperPhysicalFunction( - std::move(arguments.childFunctions[0])); + auto arg0 = std::move(arguments.childFunctions[0]); + return FloatspanUpperPhysicalFunction(std::move(arg0)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/FloatspanWidthPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/FloatspanWidthPhysicalFunction.cpp index fb3ce36657..e8cd08d63f 100644 --- a/nes-physical-operators/src/Functions/Meos/FloatspanWidthPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/FloatspanWidthPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -21,49 +22,66 @@ #include #include #include +#include #include +#include #include #include extern "C" { #include } -#include -#include namespace NES { -FloatspanWidthPhysicalFunction::FloatspanWidthPhysicalFunction(PhysicalFunction sp) { - paramFns.reserve(1); - paramFns.push_back(std::move(sp)); +FloatspanWidthPhysicalFunction::FloatspanWidthPhysicalFunction(PhysicalFunction spFunction) +{ + parameterFunctions.reserve(1); + parameterFunctions.push_back(std::move(spFunction)); } -VarVal FloatspanWidthPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto sp = paramFns[0].execute(record, arena).cast(); +VarVal FloatspanWidthPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto sp = parameterValues[0].cast(); + const auto result = nautilus::invoke( - +[](const char* w, uint32_t wsz) -> double { - try { + +[](const char* spPtr, uint32_t spSize) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string s(w, wsz); - Span* sp = floatspan_in(s.c_str()); - if (!sp) return 0.0; - double r = (double)floatspan_width(sp); - free(sp); + std::string tempS(spPtr, spSize); + Span* temp = floatspan_in(tempS.c_str()); + if (!temp) return 0.0; + + double r = floatspan_width(temp); + free(temp); return r; - } catch (const std::exception&) { return 0.0; } + } + catch (const std::exception&) + { + return 0.0; + } }, - sp); + sp.getContent(), sp.getContentSize()); + return VarVal(result); } PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterFloatspanWidthPhysicalFunction( PhysicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.childFunctions.size()==1, + PRECONDITION(arguments.childFunctions.size() == 1, "FloatspanWidthPhysicalFunction requires 1 children but got {}", arguments.childFunctions.size()); - return FloatspanWidthPhysicalFunction( - std::move(arguments.childFunctions[0])); + auto arg0 = std::move(arguments.childFunctions[0]); + return FloatspanWidthPhysicalFunction(std::move(arg0)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/GeoAsEwktPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeoAsEwktPhysicalFunction.cpp index 723f76d418..8a19aaa161 100644 --- a/nes-physical-operators/src/Functions/Meos/GeoAsEwktPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/GeoAsEwktPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -21,8 +22,10 @@ #include #include #include +#include #include #include +#include #include #include @@ -33,38 +36,56 @@ extern "C" { namespace NES { -GeoAsEwktPhysicalFunction::GeoAsEwktPhysicalFunction(PhysicalFunction wkt, PhysicalFunction precision) +GeoAsEwktPhysicalFunction::GeoAsEwktPhysicalFunction(PhysicalFunction wktFunction, + PhysicalFunction arg0Function) { - paramFns.reserve(2); - paramFns.push_back(std::move(wkt)); - paramFns.push_back(std::move(precision)); + parameterFunctions.reserve(2); + parameterFunctions.push_back(std::move(wktFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } VarVal GeoAsEwktPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto wkt = paramFns[0].execute(record, arena).cast(); - auto precision = paramFns[1].execute(record, arena).cast>(); - constexpr uint32_t MAX_LEN = 16384; + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto wkt = parameterValues[0].cast(); + auto arg0 = parameterValues[1].cast>(); + + constexpr uint32_t MAX_LEN = 4096; auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); const auto actualLen = nautilus::invoke( - +[](const char* w, uint32_t wsz, uint64_t precision, char* buf, uint32_t bufMax) -> uint32_t { - try { + +[](const char* wktPtr, uint32_t wktSize, + double arg0, + char* buf, + uint32_t bufMax) -> uint32_t { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string s(w, wsz); - GSERIALIZED* gs = geom_in(s.c_str(), -1); - if (!gs) return 0u; - char* out = geo_as_ewkt(gs, (int)precision); - free(gs); + std::string tempS(wktPtr, wktSize); + GSERIALIZED* temp = geom_in(tempS.c_str(), -1); + if (!temp) return 0u; + + char* out = geo_as_ewkt(temp, (int)arg0); + free(temp); if (!out) return 0u; uint32_t len = static_cast(strlen(out)); if (len > bufMax) len = bufMax; memcpy(buf, out, len); free(out); return len; - } catch (const std::exception&) { return 0u; } + } + catch (const std::exception&) + { + return 0u; + } }, - wkt, precision, outBuf.getContent(), nautilus::val(MAX_LEN)); + wkt.getContent(), wkt.getContentSize(), arg0, outBuf.getContent(), nautilus::val(MAX_LEN)); VarVal(actualLen).writeToMemory(outBuf.getReference()); return outBuf; @@ -76,9 +97,9 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterG PRECONDITION(arguments.childFunctions.size() == 2, "GeoAsEwktPhysicalFunction requires 2 children but got {}", arguments.childFunctions.size()); - return GeoAsEwktPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + return GeoAsEwktPhysicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/GeoAsGeojsonPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeoAsGeojsonPhysicalFunction.cpp index 4cc0e6ed08..971046f1bd 100644 --- a/nes-physical-operators/src/Functions/Meos/GeoAsGeojsonPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/GeoAsGeojsonPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -21,8 +22,10 @@ #include #include #include +#include #include #include +#include #include #include @@ -33,40 +36,60 @@ extern "C" { namespace NES { -GeoAsGeojsonPhysicalFunction::GeoAsGeojsonPhysicalFunction(PhysicalFunction wkt, PhysicalFunction option, PhysicalFunction precision) +GeoAsGeojsonPhysicalFunction::GeoAsGeojsonPhysicalFunction(PhysicalFunction wktFunction, + PhysicalFunction arg0Function, + PhysicalFunction arg1Function) { - paramFns.reserve(3); - paramFns.push_back(std::move(wkt)); - paramFns.push_back(std::move(option)); - paramFns.push_back(std::move(precision)); + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(wktFunction)); + parameterFunctions.push_back(std::move(arg0Function)); + parameterFunctions.push_back(std::move(arg1Function)); } VarVal GeoAsGeojsonPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto wkt = paramFns[0].execute(record, arena).cast(); - auto option = paramFns[1].execute(record, arena).cast>(); - auto precision = paramFns[2].execute(record, arena).cast>(); - constexpr uint32_t MAX_LEN = 16384; + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto wkt = parameterValues[0].cast(); + auto arg0 = parameterValues[1].cast>(); + auto arg1 = parameterValues[2].cast>(); + + constexpr uint32_t MAX_LEN = 4096; auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); const auto actualLen = nautilus::invoke( - +[](const char* w, uint32_t wsz, uint64_t option, uint64_t precision, char* buf, uint32_t bufMax) -> uint32_t { - try { + +[](const char* wktPtr, uint32_t wktSize, + double arg0, + double arg1, + char* buf, + uint32_t bufMax) -> uint32_t { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string s(w, wsz); - GSERIALIZED* gs = geom_in(s.c_str(), -1); - if (!gs) return 0u; - char* out = geo_as_geojson(gs, (int)option, (int)precision, nullptr); - free(gs); + std::string tempS(wktPtr, wktSize); + GSERIALIZED* temp = geom_in(tempS.c_str(), -1); + if (!temp) return 0u; + + char* out = geo_as_geojson(temp, (int)arg0, (int)arg1, nullptr); + free(temp); if (!out) return 0u; uint32_t len = static_cast(strlen(out)); if (len > bufMax) len = bufMax; memcpy(buf, out, len); free(out); return len; - } catch (const std::exception&) { return 0u; } + } + catch (const std::exception&) + { + return 0u; + } }, - wkt, option, precision, outBuf.getContent(), nautilus::val(MAX_LEN)); + wkt.getContent(), wkt.getContentSize(), arg0, arg1, outBuf.getContent(), nautilus::val(MAX_LEN)); VarVal(actualLen).writeToMemory(outBuf.getReference()); return outBuf; @@ -78,10 +101,10 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterG PRECONDITION(arguments.childFunctions.size() == 3, "GeoAsGeojsonPhysicalFunction requires 3 children but got {}", arguments.childFunctions.size()); - return GeoAsGeojsonPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return GeoAsGeojsonPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/GeoEqualsPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeoEqualsPhysicalFunction.cpp index 6738dce23f..0ebb956f3b 100644 --- a/nes-physical-operators/src/Functions/Meos/GeoEqualsPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/GeoEqualsPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -21,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -33,34 +35,50 @@ extern "C" { namespace NES { -GeoEqualsPhysicalFunction::GeoEqualsPhysicalFunction(PhysicalFunction wkt1, PhysicalFunction wkt2) +GeoEqualsPhysicalFunction::GeoEqualsPhysicalFunction(PhysicalFunction wktFunction, + PhysicalFunction arg0Function) { - paramFns.reserve(2); - paramFns.push_back(std::move(wkt1)); - paramFns.push_back(std::move(wkt2)); + parameterFunctions.reserve(2); + parameterFunctions.push_back(std::move(wktFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } VarVal GeoEqualsPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto s1 = paramFns[0].execute(record, arena).cast(); - auto s2 = paramFns[1].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto wkt = parameterValues[0].cast(); + auto arg0 = parameterValues[1].cast(); const auto result = nautilus::invoke( - +[](const char* w1, uint32_t w1sz, const char* w2, uint32_t w2sz) -> double { - try { + +[](const char* wktPtr, uint32_t wktSize, + const char* arg0Ptr, uint32_t arg0Size) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string s1(w1, w1sz); - std::string s2(w2, w2sz); - GSERIALIZED* gs1 = geom_in(s1.c_str(), -1); - if (!gs1) return 0.0; - GSERIALIZED* gs2 = geom_in(s2.c_str(), -1); - if (!gs2) { free(gs1); return 0.0; } - double r = (double)geo_equals(gs1, gs2); - free(gs1); free(gs2); + std::string tempS(wktPtr, wktSize); + GSERIALIZED* temp = geom_in(tempS.c_str(), -1); + if (!temp) return 0.0; + std::string arg0S(arg0Ptr, arg0Size); + GSERIALIZED* gs0 = geom_in(arg0S.c_str(), -1); + if (!gs0) { free(temp); return 0.0; } + + double r = geom_equals(temp, gs0); + free(temp); + free(gs0); return r; - } catch (const std::exception&) { return 0.0; } + } + catch (const std::exception&) + { + return 0.0; + } }, - s1, s2); + wkt.getContent(), wkt.getContentSize(), arg0.getContent(), arg0.getContentSize()); return VarVal(result); } @@ -71,8 +89,9 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterG PRECONDITION(arguments.childFunctions.size() == 2, "GeoEqualsPhysicalFunction requires 2 children but got {}", arguments.childFunctions.size()); - return GeoEqualsPhysicalFunction(std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + return GeoEqualsPhysicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/GeoGeoNPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeoGeoNPhysicalFunction.cpp index eb66754dd6..51ca4e6d29 100644 --- a/nes-physical-operators/src/Functions/Meos/GeoGeoNPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/GeoGeoNPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -21,8 +22,10 @@ #include #include #include +#include #include #include +#include #include #include @@ -33,41 +36,59 @@ extern "C" { namespace NES { -GeoGeoNPhysicalFunction::GeoGeoNPhysicalFunction(PhysicalFunction wkt, PhysicalFunction n) +GeoGeoNPhysicalFunction::GeoGeoNPhysicalFunction(PhysicalFunction wktFunction, + PhysicalFunction arg0Function) { - paramFns.reserve(2); - paramFns.push_back(std::move(wkt)); - paramFns.push_back(std::move(n)); + parameterFunctions.reserve(2); + parameterFunctions.push_back(std::move(wktFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } VarVal GeoGeoNPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto wkt = paramFns[0].execute(record, arena).cast(); - auto n = paramFns[1].execute(record, arena).cast>(); - constexpr uint32_t MAX_LEN = 8192; + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto wkt = parameterValues[0].cast(); + auto arg0 = parameterValues[1].cast>(); + + constexpr uint32_t MAX_LEN = 4096; auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); const auto actualLen = nautilus::invoke( - +[](const char* w, uint32_t wsz, uint64_t n, char* buf, uint32_t bufMax) -> uint32_t { - try { + +[](const char* wktPtr, uint32_t wktSize, + double arg0, + char* buf, + uint32_t bufMax) -> uint32_t { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string s(w, wsz); - GSERIALIZED* gs = geom_in(s.c_str(), -1); - if (!gs) return 0u; - GSERIALIZED* result = geo_geo_n(gs, (int)n); - free(gs); - if (!result) return 0u; - char* out = geo_as_text(result, -1); - free(result); + std::string tempS(wktPtr, wktSize); + GSERIALIZED* temp = geom_in(tempS.c_str(), -1); + if (!temp) return 0u; + + GSERIALIZED* gres = geo_geo_n(temp, (int)arg0); + free(temp); + if (!gres) return 0u; + char* out = geo_as_text(gres, -1); + free(gres); if (!out) return 0u; uint32_t len = static_cast(strlen(out)); if (len > bufMax) len = bufMax; memcpy(buf, out, len); free(out); return len; - } catch (const std::exception&) { return 0u; } + } + catch (const std::exception&) + { + return 0u; + } }, - wkt, n, outBuf.getContent(), nautilus::val(MAX_LEN)); + wkt.getContent(), wkt.getContentSize(), arg0, outBuf.getContent(), nautilus::val(MAX_LEN)); VarVal(actualLen).writeToMemory(outBuf.getReference()); return outBuf; @@ -79,9 +100,9 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterG PRECONDITION(arguments.childFunctions.size() == 2, "GeoGeoNPhysicalFunction requires 2 children but got {}", arguments.childFunctions.size()); - return GeoGeoNPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + return GeoGeoNPhysicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/GeoIsUnitaryPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeoIsUnitaryPhysicalFunction.cpp index 703403de4d..213227592e 100644 --- a/nes-physical-operators/src/Functions/Meos/GeoIsUnitaryPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/GeoIsUnitaryPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -21,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -33,29 +35,42 @@ extern "C" { namespace NES { -GeoIsUnitaryPhysicalFunction::GeoIsUnitaryPhysicalFunction(PhysicalFunction wkt) +GeoIsUnitaryPhysicalFunction::GeoIsUnitaryPhysicalFunction(PhysicalFunction wktFunction) { - paramFns.reserve(1); - paramFns.push_back(std::move(wkt)); + parameterFunctions.reserve(1); + parameterFunctions.push_back(std::move(wktFunction)); } VarVal GeoIsUnitaryPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto s1 = paramFns[0].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto wkt = parameterValues[0].cast(); const auto result = nautilus::invoke( - +[](const char* w1, uint32_t w1sz) -> double { - try { + +[](const char* wktPtr, uint32_t wktSize) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string s1(w1, w1sz); - GSERIALIZED* gs1 = geom_in(s1.c_str(), -1); - if (!gs1) return 0.0; - double r = geo_is_unitary(gs1) ? 1.0 : 0.0; - free(gs1); + std::string tempS(wktPtr, wktSize); + GSERIALIZED* temp = geom_in(tempS.c_str(), -1); + if (!temp) return 0.0; + + double r = geo_is_unitary(temp); + free(temp); return r; - } catch (const std::exception&) { return 0.0; } + } + catch (const std::exception&) + { + return 0.0; + } }, - s1); + wkt.getContent(), wkt.getContentSize()); return VarVal(result); } @@ -64,9 +79,10 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterG PhysicalFunctionRegistryArguments arguments) { PRECONDITION(arguments.childFunctions.size() == 1, - "GeoIsUnitaryPhysicalFunction requires 1 child but got {}", + "GeoIsUnitaryPhysicalFunction requires 1 children but got {}", arguments.childFunctions.size()); - return GeoIsUnitaryPhysicalFunction(std::move(arguments.childFunctions[0])); + auto arg0 = std::move(arguments.childFunctions[0]); + return GeoIsUnitaryPhysicalFunction(std::move(arg0)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/GeoNumGeosPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeoNumGeosPhysicalFunction.cpp index fe4373d05e..d4a2142419 100644 --- a/nes-physical-operators/src/Functions/Meos/GeoNumGeosPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/GeoNumGeosPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -21,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -33,29 +35,42 @@ extern "C" { namespace NES { -GeoNumGeosPhysicalFunction::GeoNumGeosPhysicalFunction(PhysicalFunction wkt) +GeoNumGeosPhysicalFunction::GeoNumGeosPhysicalFunction(PhysicalFunction wktFunction) { - paramFns.reserve(1); - paramFns.push_back(std::move(wkt)); + parameterFunctions.reserve(1); + parameterFunctions.push_back(std::move(wktFunction)); } VarVal GeoNumGeosPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto s1 = paramFns[0].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto wkt = parameterValues[0].cast(); const auto result = nautilus::invoke( - +[](const char* w1, uint32_t w1sz) -> double { - try { + +[](const char* wktPtr, uint32_t wktSize) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string s1(w1, w1sz); - GSERIALIZED* gs1 = geom_in(s1.c_str(), -1); - if (!gs1) return 0.0; - double r = (double)geo_num_geos(gs1); - free(gs1); + std::string tempS(wktPtr, wktSize); + GSERIALIZED* temp = geom_in(tempS.c_str(), -1); + if (!temp) return 0.0; + + double r = geo_num_geos(temp); + free(temp); return r; - } catch (const std::exception&) { return 0.0; } + } + catch (const std::exception&) + { + return 0.0; + } }, - s1); + wkt.getContent(), wkt.getContentSize()); return VarVal(result); } @@ -64,9 +79,10 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterG PhysicalFunctionRegistryArguments arguments) { PRECONDITION(arguments.childFunctions.size() == 1, - "GeoNumGeosPhysicalFunction requires 1 child but got {}", + "GeoNumGeosPhysicalFunction requires 1 children but got {}", arguments.childFunctions.size()); - return GeoNumGeosPhysicalFunction(std::move(arguments.childFunctions[0])); + auto arg0 = std::move(arguments.childFunctions[0]); + return GeoNumGeosPhysicalFunction(std::move(arg0)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/GeoNumPointsPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeoNumPointsPhysicalFunction.cpp index bee045998f..80947f7165 100644 --- a/nes-physical-operators/src/Functions/Meos/GeoNumPointsPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/GeoNumPointsPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -21,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -33,29 +35,42 @@ extern "C" { namespace NES { -GeoNumPointsPhysicalFunction::GeoNumPointsPhysicalFunction(PhysicalFunction wkt) +GeoNumPointsPhysicalFunction::GeoNumPointsPhysicalFunction(PhysicalFunction wktFunction) { - paramFns.reserve(1); - paramFns.push_back(std::move(wkt)); + parameterFunctions.reserve(1); + parameterFunctions.push_back(std::move(wktFunction)); } VarVal GeoNumPointsPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto s1 = paramFns[0].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto wkt = parameterValues[0].cast(); const auto result = nautilus::invoke( - +[](const char* w1, uint32_t w1sz) -> double { - try { + +[](const char* wktPtr, uint32_t wktSize) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string s1(w1, w1sz); - GSERIALIZED* gs1 = geom_in(s1.c_str(), -1); - if (!gs1) return 0.0; - double r = (double)geo_num_points(gs1); - free(gs1); + std::string tempS(wktPtr, wktSize); + GSERIALIZED* temp = geom_in(tempS.c_str(), -1); + if (!temp) return 0.0; + + double r = geo_num_points(temp); + free(temp); return r; - } catch (const std::exception&) { return 0.0; } + } + catch (const std::exception&) + { + return 0.0; + } }, - s1); + wkt.getContent(), wkt.getContentSize()); return VarVal(result); } @@ -64,9 +79,10 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterG PhysicalFunctionRegistryArguments arguments) { PRECONDITION(arguments.childFunctions.size() == 1, - "GeoNumPointsPhysicalFunction requires 1 child but got {}", + "GeoNumPointsPhysicalFunction requires 1 children but got {}", arguments.childFunctions.size()); - return GeoNumPointsPhysicalFunction(std::move(arguments.childFunctions[0])); + auto arg0 = std::move(arguments.childFunctions[0]); + return GeoNumPointsPhysicalFunction(std::move(arg0)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/GeoPointsPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeoPointsPhysicalFunction.cpp index 663752a656..79106d5671 100644 --- a/nes-physical-operators/src/Functions/Meos/GeoPointsPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/GeoPointsPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -21,8 +22,10 @@ #include #include #include +#include #include #include +#include #include #include @@ -33,39 +36,55 @@ extern "C" { namespace NES { -GeoPointsPhysicalFunction::GeoPointsPhysicalFunction(PhysicalFunction wkt) +GeoPointsPhysicalFunction::GeoPointsPhysicalFunction(PhysicalFunction wktFunction) { - paramFns.reserve(1); - paramFns.push_back(std::move(wkt)); + parameterFunctions.reserve(1); + parameterFunctions.push_back(std::move(wktFunction)); } VarVal GeoPointsPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto wkt = paramFns[0].execute(record, arena).cast(); - constexpr uint32_t MAX_LEN = 8192; + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto wkt = parameterValues[0].cast(); + + constexpr uint32_t MAX_LEN = 4096; auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); const auto actualLen = nautilus::invoke( - +[](const char* wkt, uint32_t wsz, char* buf, uint32_t bufMax) -> uint32_t { - try { + +[](const char* wktPtr, uint32_t wktSize, + char* buf, + uint32_t bufMax) -> uint32_t { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string s(wkt, wsz); - GSERIALIZED* gs = geom_in(s.c_str(), -1); - if (!gs) return 0u; - GSERIALIZED* result = geo_points(gs); - free(gs); - if (!result) return 0u; - char* out = geo_as_text(result, -1); - free(result); + std::string tempS(wktPtr, wktSize); + GSERIALIZED* temp = geom_in(tempS.c_str(), -1); + if (!temp) return 0u; + + GSERIALIZED* gres = geo_points(temp); + free(temp); + if (!gres) return 0u; + char* out = geo_as_text(gres, -1); + free(gres); if (!out) return 0u; uint32_t len = static_cast(strlen(out)); if (len > bufMax) len = bufMax; memcpy(buf, out, len); free(out); return len; - } catch (const std::exception&) { return 0u; } + } + catch (const std::exception&) + { + return 0u; + } }, - wkt, outBuf.getContent(), nautilus::val(8192)); + wkt.getContent(), wkt.getContentSize(), outBuf.getContent(), nautilus::val(MAX_LEN)); VarVal(actualLen).writeToMemory(outBuf.getReference()); return outBuf; @@ -77,8 +96,8 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterG PRECONDITION(arguments.childFunctions.size() == 1, "GeoPointsPhysicalFunction requires 1 children but got {}", arguments.childFunctions.size()); - return GeoPointsPhysicalFunction( - std::move(arguments.childFunctions[0])); + auto arg0 = std::move(arguments.childFunctions[0]); + return GeoPointsPhysicalFunction(std::move(arg0)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/GeoReversePhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeoReversePhysicalFunction.cpp index 43b6d87faf..10d84f57b9 100644 --- a/nes-physical-operators/src/Functions/Meos/GeoReversePhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/GeoReversePhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -21,8 +22,10 @@ #include #include #include +#include #include #include +#include #include #include @@ -33,39 +36,55 @@ extern "C" { namespace NES { -GeoReversePhysicalFunction::GeoReversePhysicalFunction(PhysicalFunction wkt) +GeoReversePhysicalFunction::GeoReversePhysicalFunction(PhysicalFunction wktFunction) { - paramFns.reserve(1); - paramFns.push_back(std::move(wkt)); + parameterFunctions.reserve(1); + parameterFunctions.push_back(std::move(wktFunction)); } VarVal GeoReversePhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto wkt = paramFns[0].execute(record, arena).cast(); - constexpr uint32_t MAX_LEN = 8192; + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto wkt = parameterValues[0].cast(); + + constexpr uint32_t MAX_LEN = 4096; auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); const auto actualLen = nautilus::invoke( - +[](const char* wkt, uint32_t wsz, char* buf, uint32_t bufMax) -> uint32_t { - try { + +[](const char* wktPtr, uint32_t wktSize, + char* buf, + uint32_t bufMax) -> uint32_t { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string s(wkt, wsz); - GSERIALIZED* gs = geom_in(s.c_str(), -1); - if (!gs) return 0u; - GSERIALIZED* result = geo_reverse(gs); - free(gs); - if (!result) return 0u; - char* out = geo_as_text(result, -1); - free(result); + std::string tempS(wktPtr, wktSize); + GSERIALIZED* temp = geom_in(tempS.c_str(), -1); + if (!temp) return 0u; + + GSERIALIZED* gres = geo_reverse(temp); + free(temp); + if (!gres) return 0u; + char* out = geo_as_text(gres, -1); + free(gres); if (!out) return 0u; uint32_t len = static_cast(strlen(out)); if (len > bufMax) len = bufMax; memcpy(buf, out, len); free(out); return len; - } catch (const std::exception&) { return 0u; } + } + catch (const std::exception&) + { + return 0u; + } }, - wkt, outBuf.getContent(), nautilus::val(8192)); + wkt.getContent(), wkt.getContentSize(), outBuf.getContent(), nautilus::val(MAX_LEN)); VarVal(actualLen).writeToMemory(outBuf.getReference()); return outBuf; @@ -77,8 +96,8 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterG PRECONDITION(arguments.childFunctions.size() == 1, "GeoReversePhysicalFunction requires 1 children but got {}", arguments.childFunctions.size()); - return GeoReversePhysicalFunction( - std::move(arguments.childFunctions[0])); + auto arg0 = std::move(arguments.childFunctions[0]); + return GeoReversePhysicalFunction(std::move(arg0)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/GeoRoundPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeoRoundPhysicalFunction.cpp index 4b8cf3e557..3f2f91a8f6 100644 --- a/nes-physical-operators/src/Functions/Meos/GeoRoundPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/GeoRoundPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -21,8 +22,10 @@ #include #include #include +#include #include #include +#include #include #include @@ -33,41 +36,59 @@ extern "C" { namespace NES { -GeoRoundPhysicalFunction::GeoRoundPhysicalFunction(PhysicalFunction wkt, PhysicalFunction maxdd) +GeoRoundPhysicalFunction::GeoRoundPhysicalFunction(PhysicalFunction wktFunction, + PhysicalFunction arg0Function) { - paramFns.reserve(2); - paramFns.push_back(std::move(wkt)); - paramFns.push_back(std::move(maxdd)); + parameterFunctions.reserve(2); + parameterFunctions.push_back(std::move(wktFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } VarVal GeoRoundPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto wkt = paramFns[0].execute(record, arena).cast(); - auto maxdd = paramFns[1].execute(record, arena).cast>(); - constexpr uint32_t MAX_LEN = 8192; + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto wkt = parameterValues[0].cast(); + auto arg0 = parameterValues[1].cast>(); + + constexpr uint32_t MAX_LEN = 4096; auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); const auto actualLen = nautilus::invoke( - +[](const char* w, uint32_t wsz, uint64_t maxdd, char* buf, uint32_t bufMax) -> uint32_t { - try { + +[](const char* wktPtr, uint32_t wktSize, + double arg0, + char* buf, + uint32_t bufMax) -> uint32_t { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string s(w, wsz); - GSERIALIZED* gs = geom_in(s.c_str(), -1); - if (!gs) return 0u; - GSERIALIZED* result = geo_round(gs, (int)maxdd); - free(gs); - if (!result) return 0u; - char* out = geo_as_text(result, -1); - free(result); + std::string tempS(wktPtr, wktSize); + GSERIALIZED* temp = geom_in(tempS.c_str(), -1); + if (!temp) return 0u; + + GSERIALIZED* gres = geo_round(temp, (int)dec); + free(temp); + if (!gres) return 0u; + char* out = geo_as_text(gres, -1); + free(gres); if (!out) return 0u; uint32_t len = static_cast(strlen(out)); if (len > bufMax) len = bufMax; memcpy(buf, out, len); free(out); return len; - } catch (const std::exception&) { return 0u; } + } + catch (const std::exception&) + { + return 0u; + } }, - wkt, maxdd, outBuf.getContent(), nautilus::val(MAX_LEN)); + wkt.getContent(), wkt.getContentSize(), arg0, outBuf.getContent(), nautilus::val(MAX_LEN)); VarVal(actualLen).writeToMemory(outBuf.getReference()); return outBuf; @@ -79,9 +100,9 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterG PRECONDITION(arguments.childFunctions.size() == 2, "GeoRoundPhysicalFunction requires 2 children but got {}", arguments.childFunctions.size()); - return GeoRoundPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + return GeoRoundPhysicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/GeoSamePhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeoSamePhysicalFunction.cpp index 3bf6a98d77..6617de137b 100644 --- a/nes-physical-operators/src/Functions/Meos/GeoSamePhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/GeoSamePhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -21,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -33,34 +35,50 @@ extern "C" { namespace NES { -GeoSamePhysicalFunction::GeoSamePhysicalFunction(PhysicalFunction wkt1, PhysicalFunction wkt2) +GeoSamePhysicalFunction::GeoSamePhysicalFunction(PhysicalFunction wktFunction, + PhysicalFunction arg0Function) { - paramFns.reserve(2); - paramFns.push_back(std::move(wkt1)); - paramFns.push_back(std::move(wkt2)); + parameterFunctions.reserve(2); + parameterFunctions.push_back(std::move(wktFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } VarVal GeoSamePhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto s1 = paramFns[0].execute(record, arena).cast(); - auto s2 = paramFns[1].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto wkt = parameterValues[0].cast(); + auto arg0 = parameterValues[1].cast(); const auto result = nautilus::invoke( - +[](const char* w1, uint32_t w1sz, const char* w2, uint32_t w2sz) -> double { - try { + +[](const char* wktPtr, uint32_t wktSize, + const char* arg0Ptr, uint32_t arg0Size) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string s1(w1, w1sz); - std::string s2(w2, w2sz); - GSERIALIZED* gs1 = geom_in(s1.c_str(), -1); - if (!gs1) return 0.0; - GSERIALIZED* gs2 = geom_in(s2.c_str(), -1); - if (!gs2) { free(gs1); return 0.0; } - double r = geo_same(gs1, gs2) ? 1.0 : 0.0; - free(gs1); free(gs2); + std::string tempS(wktPtr, wktSize); + GSERIALIZED* temp = geom_in(tempS.c_str(), -1); + if (!temp) return 0.0; + std::string arg0S(arg0Ptr, arg0Size); + GSERIALIZED* gs0 = geom_in(arg0S.c_str(), -1); + if (!gs0) { free(temp); return 0.0; } + + double r = geo_same(temp, gs0); + free(temp); + free(gs0); return r; - } catch (const std::exception&) { return 0.0; } + } + catch (const std::exception&) + { + return 0.0; + } }, - s1, s2); + wkt.getContent(), wkt.getContentSize(), arg0.getContent(), arg0.getContentSize()); return VarVal(result); } @@ -71,8 +89,9 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterG PRECONDITION(arguments.childFunctions.size() == 2, "GeoSamePhysicalFunction requires 2 children but got {}", arguments.childFunctions.size()); - return GeoSamePhysicalFunction(std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + return GeoSamePhysicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/GeoSetSridPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeoSetSridPhysicalFunction.cpp index b8ff54f049..e324c377f7 100644 --- a/nes-physical-operators/src/Functions/Meos/GeoSetSridPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/GeoSetSridPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -21,8 +22,10 @@ #include #include #include +#include #include #include +#include #include #include @@ -33,41 +36,59 @@ extern "C" { namespace NES { -GeoSetSridPhysicalFunction::GeoSetSridPhysicalFunction(PhysicalFunction wkt, PhysicalFunction srid) +GeoSetSridPhysicalFunction::GeoSetSridPhysicalFunction(PhysicalFunction wktFunction, + PhysicalFunction arg0Function) { - paramFns.reserve(2); - paramFns.push_back(std::move(wkt)); - paramFns.push_back(std::move(srid)); + parameterFunctions.reserve(2); + parameterFunctions.push_back(std::move(wktFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } VarVal GeoSetSridPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto wkt = paramFns[0].execute(record, arena).cast(); - auto srid = paramFns[1].execute(record, arena).cast>(); - constexpr uint32_t MAX_LEN = 8192; + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto wkt = parameterValues[0].cast(); + auto arg0 = parameterValues[1].cast>(); + + constexpr uint32_t MAX_LEN = 4096; auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); const auto actualLen = nautilus::invoke( - +[](const char* w, uint32_t wsz, uint64_t srid, char* buf, uint32_t bufMax) -> uint32_t { - try { + +[](const char* wktPtr, uint32_t wktSize, + uint64_t arg0, + char* buf, + uint32_t bufMax) -> uint32_t { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string s(w, wsz); - GSERIALIZED* gs = geom_in(s.c_str(), -1); - if (!gs) return 0u; - GSERIALIZED* result = geo_set_srid(gs, (int32_t)srid); - free(gs); - if (!result) return 0u; - char* out = geo_as_text(result, -1); - free(result); + std::string tempS(wktPtr, wktSize); + GSERIALIZED* temp = geom_in(tempS.c_str(), -1); + if (!temp) return 0u; + + GSERIALIZED* gres = geo_set_srid(temp, (int32_t)srid); + free(temp); + if (!gres) return 0u; + char* out = geo_as_text(gres, -1); + free(gres); if (!out) return 0u; uint32_t len = static_cast(strlen(out)); if (len > bufMax) len = bufMax; memcpy(buf, out, len); free(out); return len; - } catch (const std::exception&) { return 0u; } + } + catch (const std::exception&) + { + return 0u; + } }, - wkt, srid, outBuf.getContent(), nautilus::val(MAX_LEN)); + wkt.getContent(), wkt.getContentSize(), arg0, outBuf.getContent(), nautilus::val(MAX_LEN)); VarVal(actualLen).writeToMemory(outBuf.getReference()); return outBuf; @@ -79,9 +100,9 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterG PRECONDITION(arguments.childFunctions.size() == 2, "GeoSetSridPhysicalFunction requires 2 children but got {}", arguments.childFunctions.size()); - return GeoSetSridPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + return GeoSetSridPhysicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/GeoSridPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeoSridPhysicalFunction.cpp index 4da9726a29..2c565363e9 100644 --- a/nes-physical-operators/src/Functions/Meos/GeoSridPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/GeoSridPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -21,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -33,29 +35,42 @@ extern "C" { namespace NES { -GeoSridPhysicalFunction::GeoSridPhysicalFunction(PhysicalFunction wkt) +GeoSridPhysicalFunction::GeoSridPhysicalFunction(PhysicalFunction wktFunction) { - paramFns.reserve(1); - paramFns.push_back(std::move(wkt)); + parameterFunctions.reserve(1); + parameterFunctions.push_back(std::move(wktFunction)); } VarVal GeoSridPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto s1 = paramFns[0].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto wkt = parameterValues[0].cast(); const auto result = nautilus::invoke( - +[](const char* w1, uint32_t w1sz) -> double { - try { + +[](const char* wktPtr, uint32_t wktSize) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string s1(w1, w1sz); - GSERIALIZED* gs1 = geom_in(s1.c_str(), -1); - if (!gs1) return 0.0; - double r = (double)geo_srid(gs1); - free(gs1); + std::string tempS(wktPtr, wktSize); + GSERIALIZED* temp = geom_in(tempS.c_str(), -1); + if (!temp) return 0.0; + + double r = geo_srid(temp); + free(temp); return r; - } catch (const std::exception&) { return 0.0; } + } + catch (const std::exception&) + { + return 0.0; + } }, - s1); + wkt.getContent(), wkt.getContentSize()); return VarVal(result); } @@ -64,9 +79,10 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterG PhysicalFunctionRegistryArguments arguments) { PRECONDITION(arguments.childFunctions.size() == 1, - "GeoSridPhysicalFunction requires 1 child but got {}", + "GeoSridPhysicalFunction requires 1 children but got {}", arguments.childFunctions.size()); - return GeoSridPhysicalFunction(std::move(arguments.childFunctions[0])); + auto arg0 = std::move(arguments.childFunctions[0]); + return GeoSridPhysicalFunction(std::move(arg0)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/GeoTransformPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeoTransformPhysicalFunction.cpp index 704b8afc6a..e1ed76db3e 100644 --- a/nes-physical-operators/src/Functions/Meos/GeoTransformPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/GeoTransformPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -21,8 +22,10 @@ #include #include #include +#include #include #include +#include #include #include @@ -33,41 +36,59 @@ extern "C" { namespace NES { -GeoTransformPhysicalFunction::GeoTransformPhysicalFunction(PhysicalFunction wkt, PhysicalFunction srid_to) +GeoTransformPhysicalFunction::GeoTransformPhysicalFunction(PhysicalFunction wktFunction, + PhysicalFunction arg0Function) { - paramFns.reserve(2); - paramFns.push_back(std::move(wkt)); - paramFns.push_back(std::move(srid_to)); + parameterFunctions.reserve(2); + parameterFunctions.push_back(std::move(wktFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } VarVal GeoTransformPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto wkt = paramFns[0].execute(record, arena).cast(); - auto srid_to = paramFns[1].execute(record, arena).cast>(); - constexpr uint32_t MAX_LEN = 8192; + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto wkt = parameterValues[0].cast(); + auto arg0 = parameterValues[1].cast>(); + + constexpr uint32_t MAX_LEN = 4096; auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); const auto actualLen = nautilus::invoke( - +[](const char* w, uint32_t wsz, uint64_t srid_to, char* buf, uint32_t bufMax) -> uint32_t { - try { + +[](const char* wktPtr, uint32_t wktSize, + uint64_t arg0, + char* buf, + uint32_t bufMax) -> uint32_t { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string s(w, wsz); - GSERIALIZED* gs = geom_in(s.c_str(), -1); - if (!gs) return 0u; - GSERIALIZED* result = geo_transform(gs, (int32_t)srid_to); - free(gs); - if (!result) return 0u; - char* out = geo_as_text(result, -1); - free(result); + std::string tempS(wktPtr, wktSize); + GSERIALIZED* temp = geom_in(tempS.c_str(), -1); + if (!temp) return 0u; + + GSERIALIZED* gres = geo_transform(temp, (int32_t)srid); + free(temp); + if (!gres) return 0u; + char* out = geo_as_text(gres, -1); + free(gres); if (!out) return 0u; uint32_t len = static_cast(strlen(out)); if (len > bufMax) len = bufMax; memcpy(buf, out, len); free(out); return len; - } catch (const std::exception&) { return 0u; } + } + catch (const std::exception&) + { + return 0u; + } }, - wkt, srid_to, outBuf.getContent(), nautilus::val(MAX_LEN)); + wkt.getContent(), wkt.getContentSize(), arg0, outBuf.getContent(), nautilus::val(MAX_LEN)); VarVal(actualLen).writeToMemory(outBuf.getReference()); return outBuf; @@ -79,9 +100,9 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterG PRECONDITION(arguments.childFunctions.size() == 2, "GeoTransformPhysicalFunction requires 2 children but got {}", arguments.childFunctions.size()); - return GeoTransformPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + return GeoTransformPhysicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/GeogAreaPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeogAreaPhysicalFunction.cpp index 1d0da3f9a4..41459242bc 100644 --- a/nes-physical-operators/src/Functions/Meos/GeogAreaPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/GeogAreaPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -34,29 +35,42 @@ extern "C" { namespace NES { -GeogAreaPhysicalFunction::GeogAreaPhysicalFunction(PhysicalFunction wkt1Function) +GeogAreaPhysicalFunction::GeogAreaPhysicalFunction(PhysicalFunction wktFunction) { - paramFns.reserve(1); - paramFns.push_back(std::move(wkt1Function)); + parameterFunctions.reserve(1); + parameterFunctions.push_back(std::move(wktFunction)); } VarVal GeogAreaPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto wkt1 = paramFns[0].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto wkt = parameterValues[0].cast(); const auto result = nautilus::invoke( - +[](const char* w1, uint32_t w1sz) -> double { - try { + +[](const char* wktPtr, uint32_t wktSize) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string s1(w1, w1sz); - GSERIALIZED* gs1 = geom_in(s1.c_str(), -1); - if (!gs1) return 0.0; - double r = geog_area(gs1, true); - free(gs1); + std::string tempS(wktPtr, wktSize); + GSERIALIZED* temp = geog_in(tempS.c_str(), -1); + if (!temp) return 0.0; + + double r = geog_area(temp); + free(temp); return r; - } catch (const std::exception&) { return 0.0; } + } + catch (const std::exception&) + { + return 0.0; + } }, - wkt1); + wkt.getContent(), wkt.getContentSize()); return VarVal(result); } @@ -65,9 +79,10 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterG PhysicalFunctionRegistryArguments arguments) { PRECONDITION(arguments.childFunctions.size() == 1, - "GeogAreaPhysicalFunction requires 1 child but got {}", + "GeogAreaPhysicalFunction requires 1 children but got {}", arguments.childFunctions.size()); - return GeogAreaPhysicalFunction(std::move(arguments.childFunctions[0])); + auto arg0 = std::move(arguments.childFunctions[0]); + return GeogAreaPhysicalFunction(std::move(arg0)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/GeogCentroidPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeogCentroidPhysicalFunction.cpp index 5c15715054..43dd6a8167 100644 --- a/nes-physical-operators/src/Functions/Meos/GeogCentroidPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/GeogCentroidPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -21,8 +22,10 @@ #include #include #include +#include #include #include +#include #include #include @@ -33,41 +36,59 @@ extern "C" { namespace NES { -GeogCentroidPhysicalFunction::GeogCentroidPhysicalFunction(PhysicalFunction wkt, PhysicalFunction use_spheroid) +GeogCentroidPhysicalFunction::GeogCentroidPhysicalFunction(PhysicalFunction wktFunction, + PhysicalFunction arg0Function) { - paramFns.reserve(2); - paramFns.push_back(std::move(wkt)); - paramFns.push_back(std::move(use_spheroid)); + parameterFunctions.reserve(2); + parameterFunctions.push_back(std::move(wktFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } VarVal GeogCentroidPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto wkt = paramFns[0].execute(record, arena).cast(); - auto use_spheroid = paramFns[1].execute(record, arena).cast>(); - constexpr uint32_t MAX_LEN = 8192; + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto wkt = parameterValues[0].cast(); + auto arg0 = parameterValues[1].cast>(); + + constexpr uint32_t MAX_LEN = 4096; auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); const auto actualLen = nautilus::invoke( - +[](const char* w, uint32_t wsz, uint64_t use_spheroid, char* buf, uint32_t bufMax) -> uint32_t { - try { + +[](const char* wktPtr, uint32_t wktSize, + double arg0, + char* buf, + uint32_t bufMax) -> uint32_t { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string s(w, wsz); - GSERIALIZED* gs = geog_in(s.c_str(), -1); - if (!gs) return 0u; - GSERIALIZED* result = geog_centroid(gs, (bool)use_spheroid); - free(gs); - if (!result) return 0u; - char* out = geo_as_text(result, -1); - free(result); + std::string tempS(wktPtr, wktSize); + GSERIALIZED* temp = geog_in(tempS.c_str(), -1); + if (!temp) return 0u; + + GSERIALIZED* gres = geog_centroid(temp, (bool)arg0); + free(temp); + if (!gres) return 0u; + char* out = geo_as_text(gres, -1); + free(gres); if (!out) return 0u; uint32_t len = static_cast(strlen(out)); if (len > bufMax) len = bufMax; memcpy(buf, out, len); free(out); return len; - } catch (const std::exception&) { return 0u; } + } + catch (const std::exception&) + { + return 0u; + } }, - wkt, use_spheroid, outBuf.getContent(), nautilus::val(MAX_LEN)); + wkt.getContent(), wkt.getContentSize(), arg0, outBuf.getContent(), nautilus::val(MAX_LEN)); VarVal(actualLen).writeToMemory(outBuf.getReference()); return outBuf; @@ -79,9 +100,9 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterG PRECONDITION(arguments.childFunctions.size() == 2, "GeogCentroidPhysicalFunction requires 2 children but got {}", arguments.childFunctions.size()); - return GeogCentroidPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + return GeogCentroidPhysicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/GeogDistancePhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeogDistancePhysicalFunction.cpp index 552fff69e4..a7c673b751 100644 --- a/nes-physical-operators/src/Functions/Meos/GeogDistancePhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/GeogDistancePhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -21,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -33,34 +35,50 @@ extern "C" { namespace NES { -GeogDistancePhysicalFunction::GeogDistancePhysicalFunction(PhysicalFunction wkt1, PhysicalFunction wkt2) +GeogDistancePhysicalFunction::GeogDistancePhysicalFunction(PhysicalFunction wktFunction, + PhysicalFunction arg0Function) { - paramFns.reserve(2); - paramFns.push_back(std::move(wkt1)); - paramFns.push_back(std::move(wkt2)); + parameterFunctions.reserve(2); + parameterFunctions.push_back(std::move(wktFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } VarVal GeogDistancePhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto s1 = paramFns[0].execute(record, arena).cast(); - auto s2 = paramFns[1].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto wkt = parameterValues[0].cast(); + auto arg0 = parameterValues[1].cast(); const auto result = nautilus::invoke( - +[](const char* w1, uint32_t w1sz, const char* w2, uint32_t w2sz) -> double { - try { + +[](const char* wktPtr, uint32_t wktSize, + const char* arg0Ptr, uint32_t arg0Size) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string s1(w1, w1sz); - std::string s2(w2, w2sz); - GSERIALIZED* gs1 = geom_in(s1.c_str(), -1); - if (!gs1) return 0.0; - GSERIALIZED* gs2 = geom_in(s2.c_str(), -1); - if (!gs2) { free(gs1); return 0.0; } - double r = geog_distance(gs1, gs2); - free(gs1); free(gs2); + std::string tempS(wktPtr, wktSize); + GSERIALIZED* temp = geom_in(tempS.c_str(), -1); + if (!temp) return 0.0; + std::string arg0S(arg0Ptr, arg0Size); + GSERIALIZED* gs0 = geom_in(arg0S.c_str(), -1); + if (!gs0) { free(temp); return 0.0; } + + double r = geog_distance(temp, gs0); + free(temp); + free(gs0); return r; - } catch (const std::exception&) { return 0.0; } + } + catch (const std::exception&) + { + return 0.0; + } }, - s1, s2); + wkt.getContent(), wkt.getContentSize(), arg0.getContent(), arg0.getContentSize()); return VarVal(result); } @@ -71,8 +89,9 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterG PRECONDITION(arguments.childFunctions.size() == 2, "GeogDistancePhysicalFunction requires 2 children but got {}", arguments.childFunctions.size()); - return GeogDistancePhysicalFunction(std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + return GeogDistancePhysicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/GeogDwithinPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeogDwithinPhysicalFunction.cpp index 733ed8129d..7bfd78137f 100644 --- a/nes-physical-operators/src/Functions/Meos/GeogDwithinPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/GeogDwithinPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -21,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -33,39 +35,54 @@ extern "C" { namespace NES { -GeogDwithinPhysicalFunction::GeogDwithinPhysicalFunction(PhysicalFunction wkt1, PhysicalFunction wkt2, - PhysicalFunction tolerance) +GeogDwithinPhysicalFunction::GeogDwithinPhysicalFunction(PhysicalFunction wktFunction, + PhysicalFunction arg0Function, + PhysicalFunction arg1Function) { - paramFns.reserve(3); - paramFns.push_back(std::move(wkt1)); - paramFns.push_back(std::move(wkt2)); - paramFns.push_back(std::move(tolerance)); + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(wktFunction)); + parameterFunctions.push_back(std::move(arg0Function)); + parameterFunctions.push_back(std::move(arg1Function)); } VarVal GeogDwithinPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto s1 = paramFns[0].execute(record, arena).cast(); - auto s2 = paramFns[1].execute(record, arena).cast(); - auto tol = paramFns[2].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto wkt = parameterValues[0].cast(); + auto arg0 = parameterValues[1].cast(); + auto arg1 = parameterValues[2].cast>(); const auto result = nautilus::invoke( - +[](const char* w1, uint32_t w1sz, - const char* w2, uint32_t w2sz, - double tol) -> double { - try { + +[](const char* wktPtr, uint32_t wktSize, + const char* arg0Ptr, uint32_t arg0Size, + double arg1) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string s1(w1, w1sz); - std::string s2(w2, w2sz); - GSERIALIZED* gs1 = geom_in(s1.c_str(), -1); - if (!gs1) return 0.0; - GSERIALIZED* gs2 = geom_in(s2.c_str(), -1); - if (!gs2) { free(gs1); return 0.0; } - double r = geog_dwithin(gs1, gs2, tol, true) ? 1.0 : 0.0; - free(gs1); free(gs2); + std::string tempS(wktPtr, wktSize); + GSERIALIZED* temp = geom_in(tempS.c_str(), -1); + if (!temp) return 0.0; + std::string arg0S(arg0Ptr, arg0Size); + GSERIALIZED* gs0 = geom_in(arg0S.c_str(), -1); + if (!gs0) { free(temp); return 0.0; } + + double r = geog_dwithin(temp, gs0, arg1); + free(temp); + free(gs0); return r; - } catch (const std::exception&) { return 0.0; } + } + catch (const std::exception&) + { + return 0.0; + } }, - s1, s2, tol); + wkt.getContent(), wkt.getContentSize(), arg0.getContent(), arg0.getContentSize(), arg1); return VarVal(result); } @@ -76,9 +93,10 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterG PRECONDITION(arguments.childFunctions.size() == 3, "GeogDwithinPhysicalFunction requires 3 children but got {}", arguments.childFunctions.size()); - return GeogDwithinPhysicalFunction(std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return GeogDwithinPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/GeogIntersectsPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeogIntersectsPhysicalFunction.cpp index 868260650b..b95ca1b50d 100644 --- a/nes-physical-operators/src/Functions/Meos/GeogIntersectsPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/GeogIntersectsPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -21,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -33,34 +35,50 @@ extern "C" { namespace NES { -GeogIntersectsPhysicalFunction::GeogIntersectsPhysicalFunction(PhysicalFunction wkt1, PhysicalFunction wkt2) +GeogIntersectsPhysicalFunction::GeogIntersectsPhysicalFunction(PhysicalFunction wktFunction, + PhysicalFunction arg0Function) { - paramFns.reserve(2); - paramFns.push_back(std::move(wkt1)); - paramFns.push_back(std::move(wkt2)); + parameterFunctions.reserve(2); + parameterFunctions.push_back(std::move(wktFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } VarVal GeogIntersectsPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto s1 = paramFns[0].execute(record, arena).cast(); - auto s2 = paramFns[1].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto wkt = parameterValues[0].cast(); + auto arg0 = parameterValues[1].cast(); const auto result = nautilus::invoke( - +[](const char* w1, uint32_t w1sz, const char* w2, uint32_t w2sz) -> double { - try { + +[](const char* wktPtr, uint32_t wktSize, + const char* arg0Ptr, uint32_t arg0Size) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string s1(w1, w1sz); - std::string s2(w2, w2sz); - GSERIALIZED* gs1 = geom_in(s1.c_str(), -1); - if (!gs1) return 0.0; - GSERIALIZED* gs2 = geom_in(s2.c_str(), -1); - if (!gs2) { free(gs1); return 0.0; } - double r = geog_intersects(gs1, gs2, true) ? 1.0 : 0.0; - free(gs1); free(gs2); + std::string tempS(wktPtr, wktSize); + GSERIALIZED* temp = geom_in(tempS.c_str(), -1); + if (!temp) return 0.0; + std::string arg0S(arg0Ptr, arg0Size); + GSERIALIZED* gs0 = geom_in(arg0S.c_str(), -1); + if (!gs0) { free(temp); return 0.0; } + + double r = geog_intersects(temp, gs0); + free(temp); + free(gs0); return r; - } catch (const std::exception&) { return 0.0; } + } + catch (const std::exception&) + { + return 0.0; + } }, - s1, s2); + wkt.getContent(), wkt.getContentSize(), arg0.getContent(), arg0.getContentSize()); return VarVal(result); } @@ -71,8 +89,9 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterG PRECONDITION(arguments.childFunctions.size() == 2, "GeogIntersectsPhysicalFunction requires 2 children but got {}", arguments.childFunctions.size()); - return GeogIntersectsPhysicalFunction(std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + return GeogIntersectsPhysicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/GeogLengthPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeogLengthPhysicalFunction.cpp index 0e6c8e3e2a..4fcd163ebe 100644 --- a/nes-physical-operators/src/Functions/Meos/GeogLengthPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/GeogLengthPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -34,29 +35,42 @@ extern "C" { namespace NES { -GeogLengthPhysicalFunction::GeogLengthPhysicalFunction(PhysicalFunction wkt1Function) +GeogLengthPhysicalFunction::GeogLengthPhysicalFunction(PhysicalFunction wktFunction) { - paramFns.reserve(1); - paramFns.push_back(std::move(wkt1Function)); + parameterFunctions.reserve(1); + parameterFunctions.push_back(std::move(wktFunction)); } VarVal GeogLengthPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto wkt1 = paramFns[0].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto wkt = parameterValues[0].cast(); const auto result = nautilus::invoke( - +[](const char* w1, uint32_t w1sz) -> double { - try { + +[](const char* wktPtr, uint32_t wktSize) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string s1(w1, w1sz); - GSERIALIZED* gs1 = geom_in(s1.c_str(), -1); - if (!gs1) return 0.0; - double r = geog_length(gs1, true); - free(gs1); + std::string tempS(wktPtr, wktSize); + GSERIALIZED* temp = geog_in(tempS.c_str(), -1); + if (!temp) return 0.0; + + double r = geog_length(temp); + free(temp); return r; - } catch (const std::exception&) { return 0.0; } + } + catch (const std::exception&) + { + return 0.0; + } }, - wkt1); + wkt.getContent(), wkt.getContentSize()); return VarVal(result); } @@ -65,9 +79,10 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterG PhysicalFunctionRegistryArguments arguments) { PRECONDITION(arguments.childFunctions.size() == 1, - "GeogLengthPhysicalFunction requires 1 child but got {}", + "GeogLengthPhysicalFunction requires 1 children but got {}", arguments.childFunctions.size()); - return GeogLengthPhysicalFunction(std::move(arguments.childFunctions[0])); + auto arg0 = std::move(arguments.childFunctions[0]); + return GeogLengthPhysicalFunction(std::move(arg0)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/GeogPerimeterPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeogPerimeterPhysicalFunction.cpp index dca1cd8972..30bf433f12 100644 --- a/nes-physical-operators/src/Functions/Meos/GeogPerimeterPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/GeogPerimeterPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -34,29 +35,42 @@ extern "C" { namespace NES { -GeogPerimeterPhysicalFunction::GeogPerimeterPhysicalFunction(PhysicalFunction wkt1Function) +GeogPerimeterPhysicalFunction::GeogPerimeterPhysicalFunction(PhysicalFunction wktFunction) { - paramFns.reserve(1); - paramFns.push_back(std::move(wkt1Function)); + parameterFunctions.reserve(1); + parameterFunctions.push_back(std::move(wktFunction)); } VarVal GeogPerimeterPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto wkt1 = paramFns[0].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto wkt = parameterValues[0].cast(); const auto result = nautilus::invoke( - +[](const char* w1, uint32_t w1sz) -> double { - try { + +[](const char* wktPtr, uint32_t wktSize) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string s1(w1, w1sz); - GSERIALIZED* gs1 = geom_in(s1.c_str(), -1); - if (!gs1) return 0.0; - double r = geog_perimeter(gs1, true); - free(gs1); + std::string tempS(wktPtr, wktSize); + GSERIALIZED* temp = geog_in(tempS.c_str(), -1); + if (!temp) return 0.0; + + double r = geog_perimeter(temp); + free(temp); return r; - } catch (const std::exception&) { return 0.0; } + } + catch (const std::exception&) + { + return 0.0; + } }, - wkt1); + wkt.getContent(), wkt.getContentSize()); return VarVal(result); } @@ -65,9 +79,10 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterG PhysicalFunctionRegistryArguments arguments) { PRECONDITION(arguments.childFunctions.size() == 1, - "GeogPerimeterPhysicalFunction requires 1 child but got {}", + "GeogPerimeterPhysicalFunction requires 1 children but got {}", arguments.childFunctions.size()); - return GeogPerimeterPhysicalFunction(std::move(arguments.childFunctions[0])); + auto arg0 = std::move(arguments.childFunctions[0]); + return GeogPerimeterPhysicalFunction(std::move(arg0)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/GeogPointMake2dPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeogPointMake2dPhysicalFunction.cpp index 36dc8999ae..ba19435de3 100644 --- a/nes-physical-operators/src/Functions/Meos/GeogPointMake2dPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/GeogPointMake2dPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -21,8 +22,10 @@ #include #include #include +#include #include #include +#include #include #include @@ -33,37 +36,57 @@ extern "C" { namespace NES { -GeogPointMake2dPhysicalFunction::GeogPointMake2dPhysicalFunction(PhysicalFunction srid, PhysicalFunction x, PhysicalFunction y) +GeogPointMake2dPhysicalFunction::GeogPointMake2dPhysicalFunction(PhysicalFunction sridFunction, + PhysicalFunction xFunction, + PhysicalFunction yFunction) { - paramFns.reserve(3); - paramFns.push_back(std::move(srid)); - paramFns.push_back(std::move(x)); - paramFns.push_back(std::move(y)); + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(sridFunction)); + parameterFunctions.push_back(std::move(xFunction)); + parameterFunctions.push_back(std::move(yFunction)); } VarVal GeogPointMake2dPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto srid = paramFns[0].execute(record, arena).cast>(); - auto x = paramFns[1].execute(record, arena).cast(); - auto y = paramFns[2].execute(record, arena).cast(); - constexpr uint32_t MAX_LEN = 8192; + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto srid = parameterValues[0].cast>(); + auto x = parameterValues[1].cast>(); + auto y = parameterValues[2].cast>(); + + constexpr uint32_t MAX_LEN = 4096; auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); const auto actualLen = nautilus::invoke( - +[](uint64_t srid, double x, double y, char* buf, uint32_t bufMax) -> uint32_t { - try { + +[](uint64_t srid, + double x, + double y, + char* buf, + uint32_t bufMax) -> uint32_t { + try + { MEOS::Meos::ensureMeosInitialized(); - GSERIALIZED* result = geogpoint_make2d((int32_t)srid, x, y); - if (!result) return 0u; - char* out = geo_as_text(result, -1); - free(result); + + GSERIALIZED* gres = geogpoint_make2d((int32_t)srid, x, y); + if (!gres) return 0u; + char* out = geo_as_text(gres, -1); + free(gres); if (!out) return 0u; uint32_t len = static_cast(strlen(out)); if (len > bufMax) len = bufMax; memcpy(buf, out, len); free(out); return len; - } catch (const std::exception&) { return 0u; } + } + catch (const std::exception&) + { + return 0u; + } }, srid, x, y, outBuf.getContent(), nautilus::val(MAX_LEN)); @@ -77,10 +100,10 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterG PRECONDITION(arguments.childFunctions.size() == 3, "GeogPointMake2dPhysicalFunction requires 3 children but got {}", arguments.childFunctions.size()); - return GeogPointMake2dPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return GeogPointMake2dPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/GeogPointMake3dzPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeogPointMake3dzPhysicalFunction.cpp index 4011670d90..a5bff5f9b2 100644 --- a/nes-physical-operators/src/Functions/Meos/GeogPointMake3dzPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/GeogPointMake3dzPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -21,8 +22,10 @@ #include #include #include +#include #include #include +#include #include #include @@ -33,39 +36,61 @@ extern "C" { namespace NES { -GeogPointMake3dzPhysicalFunction::GeogPointMake3dzPhysicalFunction(PhysicalFunction srid, PhysicalFunction x, PhysicalFunction y, PhysicalFunction z) +GeogPointMake3dzPhysicalFunction::GeogPointMake3dzPhysicalFunction(PhysicalFunction sridFunction, + PhysicalFunction xFunction, + PhysicalFunction yFunction, + PhysicalFunction zFunction) { - paramFns.reserve(4); - paramFns.push_back(std::move(srid)); - paramFns.push_back(std::move(x)); - paramFns.push_back(std::move(y)); - paramFns.push_back(std::move(z)); + parameterFunctions.reserve(4); + parameterFunctions.push_back(std::move(sridFunction)); + parameterFunctions.push_back(std::move(xFunction)); + parameterFunctions.push_back(std::move(yFunction)); + parameterFunctions.push_back(std::move(zFunction)); } VarVal GeogPointMake3dzPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto srid = paramFns[0].execute(record, arena).cast>(); - auto x = paramFns[1].execute(record, arena).cast(); - auto y = paramFns[2].execute(record, arena).cast(); - auto z = paramFns[3].execute(record, arena).cast(); - constexpr uint32_t MAX_LEN = 8192; + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto srid = parameterValues[0].cast>(); + auto x = parameterValues[1].cast>(); + auto y = parameterValues[2].cast>(); + auto z = parameterValues[3].cast>(); + + constexpr uint32_t MAX_LEN = 4096; auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); const auto actualLen = nautilus::invoke( - +[](uint64_t srid, double x, double y, double z, char* buf, uint32_t bufMax) -> uint32_t { - try { + +[](uint64_t srid, + double x, + double y, + double z, + char* buf, + uint32_t bufMax) -> uint32_t { + try + { MEOS::Meos::ensureMeosInitialized(); - GSERIALIZED* result = geogpoint_make3dz((int32_t)srid, x, y, z); - if (!result) return 0u; - char* out = geo_as_text(result, -1); - free(result); + + GSERIALIZED* gres = geogpoint_make3dz((int32_t)srid, x, y, z); + if (!gres) return 0u; + char* out = geo_as_text(gres, -1); + free(gres); if (!out) return 0u; uint32_t len = static_cast(strlen(out)); if (len > bufMax) len = bufMax; memcpy(buf, out, len); free(out); return len; - } catch (const std::exception&) { return 0u; } + } + catch (const std::exception&) + { + return 0u; + } }, srid, x, y, z, outBuf.getContent(), nautilus::val(MAX_LEN)); @@ -79,11 +104,11 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterG PRECONDITION(arguments.childFunctions.size() == 4, "GeogPointMake3dzPhysicalFunction requires 4 children but got {}", arguments.childFunctions.size()); - return GeogPointMake3dzPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2]), - std::move(arguments.childFunctions[3])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + return GeogPointMake3dzPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/GeogToGeomPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeogToGeomPhysicalFunction.cpp index 9f20aaa671..4439d7f6d7 100644 --- a/nes-physical-operators/src/Functions/Meos/GeogToGeomPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/GeogToGeomPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -21,8 +22,10 @@ #include #include #include +#include #include #include +#include #include #include @@ -33,39 +36,55 @@ extern "C" { namespace NES { -GeogToGeomPhysicalFunction::GeogToGeomPhysicalFunction(PhysicalFunction wkt) +GeogToGeomPhysicalFunction::GeogToGeomPhysicalFunction(PhysicalFunction wktFunction) { - paramFns.reserve(1); - paramFns.push_back(std::move(wkt)); + parameterFunctions.reserve(1); + parameterFunctions.push_back(std::move(wktFunction)); } VarVal GeogToGeomPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto wkt = paramFns[0].execute(record, arena).cast(); - constexpr uint32_t MAX_LEN = 8192; + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto wkt = parameterValues[0].cast(); + + constexpr uint32_t MAX_LEN = 4096; auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); const auto actualLen = nautilus::invoke( - +[](const char* w, uint32_t wsz, char* buf, uint32_t bufMax) -> uint32_t { - try { + +[](const char* wktPtr, uint32_t wktSize, + char* buf, + uint32_t bufMax) -> uint32_t { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string s(w, wsz); - GSERIALIZED* gs = geog_in(s.c_str(), -1); - if (!gs) return 0u; - GSERIALIZED* result = geog_to_geom(gs); - free(gs); - if (!result) return 0u; - char* out = geo_as_text(result, -1); - free(result); + std::string tempS(wktPtr, wktSize); + GSERIALIZED* temp = geog_in(tempS.c_str(), -1); + if (!temp) return 0u; + + GSERIALIZED* gres = geog_to_geom(temp); + free(temp); + if (!gres) return 0u; + char* out = geo_as_text(gres, -1); + free(gres); if (!out) return 0u; uint32_t len = static_cast(strlen(out)); if (len > bufMax) len = bufMax; memcpy(buf, out, len); free(out); return len; - } catch (const std::exception&) { return 0u; } + } + catch (const std::exception&) + { + return 0u; + } }, - wkt, outBuf.getContent(), nautilus::val(MAX_LEN)); + wkt.getContent(), wkt.getContentSize(), outBuf.getContent(), nautilus::val(MAX_LEN)); VarVal(actualLen).writeToMemory(outBuf.getReference()); return outBuf; @@ -77,8 +96,8 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterG PRECONDITION(arguments.childFunctions.size() == 1, "GeogToGeomPhysicalFunction requires 1 children but got {}", arguments.childFunctions.size()); - return GeogToGeomPhysicalFunction( - std::move(arguments.childFunctions[0])); + auto arg0 = std::move(arguments.childFunctions[0]); + return GeogToGeomPhysicalFunction(std::move(arg0)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/GeomAzimuthPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeomAzimuthPhysicalFunction.cpp index bb301910ba..831c9b4325 100644 --- a/nes-physical-operators/src/Functions/Meos/GeomAzimuthPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/GeomAzimuthPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -34,35 +35,42 @@ extern "C" { namespace NES { -GeomAzimuthPhysicalFunction::GeomAzimuthPhysicalFunction(PhysicalFunction wkt1Function, - PhysicalFunction wkt2Function) +GeomAzimuthPhysicalFunction::GeomAzimuthPhysicalFunction(PhysicalFunction wktFunction) { - paramFns.reserve(2); - paramFns.push_back(std::move(wkt1Function)); - paramFns.push_back(std::move(wkt2Function)); + parameterFunctions.reserve(1); + parameterFunctions.push_back(std::move(wktFunction)); } VarVal GeomAzimuthPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto wkt1 = paramFns[0].execute(record, arena).cast(); - auto wkt2 = paramFns[1].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto wkt = parameterValues[0].cast(); const auto result = nautilus::invoke( - +[](const char* w1, uint32_t w1sz, const char* w2, uint32_t w2sz) -> double { - try { + +[](const char* wktPtr, uint32_t wktSize) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string s1(w1, w1sz), s2(w2, w2sz); - GSERIALIZED* gs1 = geom_in(s1.c_str(), -1); - if (!gs1) return 0.0; - GSERIALIZED* gs2 = geom_in(s2.c_str(), -1); - if (!gs2) { free(gs1); return 0.0; } - double azimuth = 0.0; - geom_azimuth(gs1, gs2, &azimuth); - free(gs1); free(gs2); - return azimuth; - } catch (const std::exception&) { return 0.0; } + std::string tempS(wktPtr, wktSize); + GSERIALIZED* temp = geom_in(tempS.c_str(), -1); + if (!temp) return 0.0; + + double r = geom_azimuth(temp); + free(temp); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, - wkt1, wkt2); + wkt.getContent(), wkt.getContentSize()); return VarVal(result); } @@ -70,11 +78,11 @@ VarVal GeomAzimuthPhysicalFunction::execute(const Record& record, ArenaRef& aren PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterGeomAzimuthPhysicalFunction( PhysicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.childFunctions.size() == 2, - "GeomAzimuthPhysicalFunction requires 2 children but got {}", + PRECONDITION(arguments.childFunctions.size() == 1, + "GeomAzimuthPhysicalFunction requires 1 children but got {}", arguments.childFunctions.size()); - return GeomAzimuthPhysicalFunction(std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1])); + auto arg0 = std::move(arguments.childFunctions[0]); + return GeomAzimuthPhysicalFunction(std::move(arg0)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/GeomBoundaryPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeomBoundaryPhysicalFunction.cpp index c2dc54d45d..9d6181f684 100644 --- a/nes-physical-operators/src/Functions/Meos/GeomBoundaryPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/GeomBoundaryPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -21,8 +22,10 @@ #include #include #include +#include #include #include +#include #include #include @@ -33,39 +36,55 @@ extern "C" { namespace NES { -GeomBoundaryPhysicalFunction::GeomBoundaryPhysicalFunction(PhysicalFunction wkt) +GeomBoundaryPhysicalFunction::GeomBoundaryPhysicalFunction(PhysicalFunction wktFunction) { - paramFns.reserve(1); - paramFns.push_back(std::move(wkt)); + parameterFunctions.reserve(1); + parameterFunctions.push_back(std::move(wktFunction)); } VarVal GeomBoundaryPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto wkt = paramFns[0].execute(record, arena).cast(); - constexpr uint32_t MAX_LEN = 8192; + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto wkt = parameterValues[0].cast(); + + constexpr uint32_t MAX_LEN = 4096; auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); const auto actualLen = nautilus::invoke( - +[](const char* wkt, uint32_t wsz, char* buf, uint32_t bufMax) -> uint32_t { - try { + +[](const char* wktPtr, uint32_t wktSize, + char* buf, + uint32_t bufMax) -> uint32_t { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string s(wkt, wsz); - GSERIALIZED* gs = geom_in(s.c_str(), -1); - if (!gs) return 0u; - GSERIALIZED* result = geom_boundary(gs); - free(gs); - if (!result) return 0u; - char* out = geo_as_text(result, -1); - free(result); + std::string tempS(wktPtr, wktSize); + GSERIALIZED* temp = geom_in(tempS.c_str(), -1); + if (!temp) return 0u; + + GSERIALIZED* gres = geom_boundary(temp); + free(temp); + if (!gres) return 0u; + char* out = geo_as_text(gres, -1); + free(gres); if (!out) return 0u; uint32_t len = static_cast(strlen(out)); if (len > bufMax) len = bufMax; memcpy(buf, out, len); free(out); return len; - } catch (const std::exception&) { return 0u; } + } + catch (const std::exception&) + { + return 0u; + } }, - wkt, outBuf.getContent(), nautilus::val(8192)); + wkt.getContent(), wkt.getContentSize(), outBuf.getContent(), nautilus::val(MAX_LEN)); VarVal(actualLen).writeToMemory(outBuf.getReference()); return outBuf; @@ -77,8 +96,8 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterG PRECONDITION(arguments.childFunctions.size() == 1, "GeomBoundaryPhysicalFunction requires 1 children but got {}", arguments.childFunctions.size()); - return GeomBoundaryPhysicalFunction( - std::move(arguments.childFunctions[0])); + auto arg0 = std::move(arguments.childFunctions[0]); + return GeomBoundaryPhysicalFunction(std::move(arg0)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/GeomCentroidPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeomCentroidPhysicalFunction.cpp index 380553bc1c..797fbe84db 100644 --- a/nes-physical-operators/src/Functions/Meos/GeomCentroidPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/GeomCentroidPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -21,8 +22,10 @@ #include #include #include +#include #include #include +#include #include #include @@ -33,39 +36,55 @@ extern "C" { namespace NES { -GeomCentroidPhysicalFunction::GeomCentroidPhysicalFunction(PhysicalFunction wkt) +GeomCentroidPhysicalFunction::GeomCentroidPhysicalFunction(PhysicalFunction wktFunction) { - paramFns.reserve(1); - paramFns.push_back(std::move(wkt)); + parameterFunctions.reserve(1); + parameterFunctions.push_back(std::move(wktFunction)); } VarVal GeomCentroidPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto wkt = paramFns[0].execute(record, arena).cast(); - constexpr uint32_t MAX_LEN = 8192; + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto wkt = parameterValues[0].cast(); + + constexpr uint32_t MAX_LEN = 4096; auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); const auto actualLen = nautilus::invoke( - +[](const char* wkt, uint32_t wsz, char* buf, uint32_t bufMax) -> uint32_t { - try { + +[](const char* wktPtr, uint32_t wktSize, + char* buf, + uint32_t bufMax) -> uint32_t { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string s(wkt, wsz); - GSERIALIZED* gs = geom_in(s.c_str(), -1); - if (!gs) return 0u; - GSERIALIZED* result = geom_centroid(gs); - free(gs); - if (!result) return 0u; - char* out = geo_as_text(result, -1); - free(result); + std::string tempS(wktPtr, wktSize); + GSERIALIZED* temp = geom_in(tempS.c_str(), -1); + if (!temp) return 0u; + + GSERIALIZED* gres = geom_centroid(temp); + free(temp); + if (!gres) return 0u; + char* out = geo_as_text(gres, -1); + free(gres); if (!out) return 0u; uint32_t len = static_cast(strlen(out)); if (len > bufMax) len = bufMax; memcpy(buf, out, len); free(out); return len; - } catch (const std::exception&) { return 0u; } + } + catch (const std::exception&) + { + return 0u; + } }, - wkt, outBuf.getContent(), nautilus::val(8192)); + wkt.getContent(), wkt.getContentSize(), outBuf.getContent(), nautilus::val(MAX_LEN)); VarVal(actualLen).writeToMemory(outBuf.getReference()); return outBuf; @@ -77,8 +96,8 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterG PRECONDITION(arguments.childFunctions.size() == 1, "GeomCentroidPhysicalFunction requires 1 children but got {}", arguments.childFunctions.size()); - return GeomCentroidPhysicalFunction( - std::move(arguments.childFunctions[0])); + auto arg0 = std::move(arguments.childFunctions[0]); + return GeomCentroidPhysicalFunction(std::move(arg0)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/GeomContainsPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeomContainsPhysicalFunction.cpp index f72e9879d9..7e82360cc8 100644 --- a/nes-physical-operators/src/Functions/Meos/GeomContainsPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/GeomContainsPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -34,34 +35,50 @@ extern "C" { namespace NES { -GeomContainsPhysicalFunction::GeomContainsPhysicalFunction(PhysicalFunction wkt1Function, - PhysicalFunction wkt2Function) +GeomContainsPhysicalFunction::GeomContainsPhysicalFunction(PhysicalFunction wktFunction, + PhysicalFunction arg0Function) { - paramFns.reserve(2); - paramFns.push_back(std::move(wkt1Function)); - paramFns.push_back(std::move(wkt2Function)); + parameterFunctions.reserve(2); + parameterFunctions.push_back(std::move(wktFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } VarVal GeomContainsPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto wkt1 = paramFns[0].execute(record, arena).cast(); - auto wkt2 = paramFns[1].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto wkt = parameterValues[0].cast(); + auto arg0 = parameterValues[1].cast(); const auto result = nautilus::invoke( - +[](const char* w1, uint32_t w1sz, const char* w2, uint32_t w2sz) -> double { - try { + +[](const char* wktPtr, uint32_t wktSize, + const char* arg0Ptr, uint32_t arg0Size) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string s1(w1, w1sz), s2(w2, w2sz); - GSERIALIZED* gs1 = geom_in(s1.c_str(), -1); - if (!gs1) return 0.0; - GSERIALIZED* gs2 = geom_in(s2.c_str(), -1); - if (!gs2) { free(gs1); return 0.0; } - bool r = geom_contains(gs1, gs2); - free(gs1); free(gs2); - return r ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + std::string tempS(wktPtr, wktSize); + GSERIALIZED* temp = geom_in(tempS.c_str(), -1); + if (!temp) return 0.0; + std::string arg0S(arg0Ptr, arg0Size); + GSERIALIZED* gs0 = geom_in(arg0S.c_str(), -1); + if (!gs0) { free(temp); return 0.0; } + + double r = geom_contains(temp, gs0); + free(temp); + free(gs0); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, - wkt1, wkt2); + wkt.getContent(), wkt.getContentSize(), arg0.getContent(), arg0.getContentSize()); return VarVal(result); } @@ -72,9 +89,9 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterG PRECONDITION(arguments.childFunctions.size() == 2, "GeomContainsPhysicalFunction requires 2 children but got {}", arguments.childFunctions.size()); - return GeomContainsPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + return GeomContainsPhysicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/GeomConvexHullPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeomConvexHullPhysicalFunction.cpp index 139552c7f9..8eb2fdd63b 100644 --- a/nes-physical-operators/src/Functions/Meos/GeomConvexHullPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/GeomConvexHullPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -21,8 +22,10 @@ #include #include #include +#include #include #include +#include #include #include @@ -33,39 +36,55 @@ extern "C" { namespace NES { -GeomConvexHullPhysicalFunction::GeomConvexHullPhysicalFunction(PhysicalFunction wkt) +GeomConvexHullPhysicalFunction::GeomConvexHullPhysicalFunction(PhysicalFunction wktFunction) { - paramFns.reserve(1); - paramFns.push_back(std::move(wkt)); + parameterFunctions.reserve(1); + parameterFunctions.push_back(std::move(wktFunction)); } VarVal GeomConvexHullPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto wkt = paramFns[0].execute(record, arena).cast(); - constexpr uint32_t MAX_LEN = 8192; + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto wkt = parameterValues[0].cast(); + + constexpr uint32_t MAX_LEN = 4096; auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); const auto actualLen = nautilus::invoke( - +[](const char* wkt, uint32_t wsz, char* buf, uint32_t bufMax) -> uint32_t { - try { + +[](const char* wktPtr, uint32_t wktSize, + char* buf, + uint32_t bufMax) -> uint32_t { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string s(wkt, wsz); - GSERIALIZED* gs = geom_in(s.c_str(), -1); - if (!gs) return 0u; - GSERIALIZED* result = geom_convex_hull(gs); - free(gs); - if (!result) return 0u; - char* out = geo_as_text(result, -1); - free(result); + std::string tempS(wktPtr, wktSize); + GSERIALIZED* temp = geom_in(tempS.c_str(), -1); + if (!temp) return 0u; + + GSERIALIZED* gres = geom_convex_hull(temp); + free(temp); + if (!gres) return 0u; + char* out = geo_as_text(gres, -1); + free(gres); if (!out) return 0u; uint32_t len = static_cast(strlen(out)); if (len > bufMax) len = bufMax; memcpy(buf, out, len); free(out); return len; - } catch (const std::exception&) { return 0u; } + } + catch (const std::exception&) + { + return 0u; + } }, - wkt, outBuf.getContent(), nautilus::val(8192)); + wkt.getContent(), wkt.getContentSize(), outBuf.getContent(), nautilus::val(MAX_LEN)); VarVal(actualLen).writeToMemory(outBuf.getReference()); return outBuf; @@ -77,8 +96,8 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterG PRECONDITION(arguments.childFunctions.size() == 1, "GeomConvexHullPhysicalFunction requires 1 children but got {}", arguments.childFunctions.size()); - return GeomConvexHullPhysicalFunction( - std::move(arguments.childFunctions[0])); + auto arg0 = std::move(arguments.childFunctions[0]); + return GeomConvexHullPhysicalFunction(std::move(arg0)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/GeomCoversPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeomCoversPhysicalFunction.cpp index c757aa9fb8..7a2fc977b2 100644 --- a/nes-physical-operators/src/Functions/Meos/GeomCoversPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/GeomCoversPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -34,34 +35,50 @@ extern "C" { namespace NES { -GeomCoversPhysicalFunction::GeomCoversPhysicalFunction(PhysicalFunction wkt1Function, - PhysicalFunction wkt2Function) +GeomCoversPhysicalFunction::GeomCoversPhysicalFunction(PhysicalFunction wktFunction, + PhysicalFunction arg0Function) { - paramFns.reserve(2); - paramFns.push_back(std::move(wkt1Function)); - paramFns.push_back(std::move(wkt2Function)); + parameterFunctions.reserve(2); + parameterFunctions.push_back(std::move(wktFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } VarVal GeomCoversPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto wkt1 = paramFns[0].execute(record, arena).cast(); - auto wkt2 = paramFns[1].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto wkt = parameterValues[0].cast(); + auto arg0 = parameterValues[1].cast(); const auto result = nautilus::invoke( - +[](const char* w1, uint32_t w1sz, const char* w2, uint32_t w2sz) -> double { - try { + +[](const char* wktPtr, uint32_t wktSize, + const char* arg0Ptr, uint32_t arg0Size) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string s1(w1, w1sz), s2(w2, w2sz); - GSERIALIZED* gs1 = geom_in(s1.c_str(), -1); - if (!gs1) return 0.0; - GSERIALIZED* gs2 = geom_in(s2.c_str(), -1); - if (!gs2) { free(gs1); return 0.0; } - bool r = geom_covers(gs1, gs2); - free(gs1); free(gs2); - return r ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + std::string tempS(wktPtr, wktSize); + GSERIALIZED* temp = geom_in(tempS.c_str(), -1); + if (!temp) return 0.0; + std::string arg0S(arg0Ptr, arg0Size); + GSERIALIZED* gs0 = geom_in(arg0S.c_str(), -1); + if (!gs0) { free(temp); return 0.0; } + + double r = geom_covers(temp, gs0); + free(temp); + free(gs0); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, - wkt1, wkt2); + wkt.getContent(), wkt.getContentSize(), arg0.getContent(), arg0.getContentSize()); return VarVal(result); } @@ -72,9 +89,9 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterG PRECONDITION(arguments.childFunctions.size() == 2, "GeomCoversPhysicalFunction requires 2 children but got {}", arguments.childFunctions.size()); - return GeomCoversPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + return GeomCoversPhysicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/GeomDifference2dPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeomDifference2dPhysicalFunction.cpp index dbc64686f2..5432bcba1d 100644 --- a/nes-physical-operators/src/Functions/Meos/GeomDifference2dPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/GeomDifference2dPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -21,8 +22,10 @@ #include #include #include +#include #include #include +#include #include #include @@ -33,44 +36,63 @@ extern "C" { namespace NES { -GeomDifference2dPhysicalFunction::GeomDifference2dPhysicalFunction(PhysicalFunction wkt1, PhysicalFunction wkt2) +GeomDifference2dPhysicalFunction::GeomDifference2dPhysicalFunction(PhysicalFunction wktFunction, + PhysicalFunction arg0Function) { - paramFns.reserve(2); - paramFns.push_back(std::move(wkt1)); - paramFns.push_back(std::move(wkt2)); + parameterFunctions.reserve(2); + parameterFunctions.push_back(std::move(wktFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } VarVal GeomDifference2dPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto wkt1 = paramFns[0].execute(record, arena).cast(); - auto wkt2 = paramFns[1].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto wkt = parameterValues[0].cast(); + auto arg0 = parameterValues[1].cast(); - constexpr uint32_t MAX_LEN = 8192; + constexpr uint32_t MAX_LEN = 4096; auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); const auto actualLen = nautilus::invoke( - +[](const char* w1, uint32_t w1sz, const char* w2, uint32_t w2sz, char* buf, uint32_t bufMax) -> uint32_t { - try { + +[](const char* wktPtr, uint32_t wktSize, + const char* arg0Ptr, uint32_t arg0Size, + char* buf, + uint32_t bufMax) -> uint32_t { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string s1(w1, w1sz), s2(w2, w2sz); - GSERIALIZED* gs1 = geom_in(s1.c_str(), -1); - if (!gs1) return 0u; - GSERIALIZED* gs2 = geom_in(s2.c_str(), -1); - if (!gs2) { free(gs1); return 0u; } - GSERIALIZED* result = geom_difference2d(gs1, gs2); - free(gs1); free(gs2); - if (!result) return 0u; - char* out = geo_as_text(result, -1); - free(result); + std::string tempS(wktPtr, wktSize); + GSERIALIZED* temp = geom_in(tempS.c_str(), -1); + if (!temp) return 0u; + std::string arg0S(arg0Ptr, arg0Size); + GSERIALIZED* gs0 = geom_in(arg0S.c_str(), -1); + if (!gs0) { free(temp); return 0u; } + + GSERIALIZED* gres = geom_difference2d(temp, gs0); + free(temp); + free(gs0); + if (!gres) return 0u; + char* out = geo_as_text(gres, -1); + free(gres); if (!out) return 0u; uint32_t len = static_cast(strlen(out)); if (len > bufMax) len = bufMax; memcpy(buf, out, len); free(out); return len; - } catch (const std::exception&) { return 0u; } + } + catch (const std::exception&) + { + return 0u; + } }, - wkt1, wkt2, outBuf.getContent(), nautilus::val(MAX_LEN)); + wkt.getContent(), wkt.getContentSize(), arg0.getContent(), arg0.getContentSize(), outBuf.getContent(), nautilus::val(MAX_LEN)); VarVal(actualLen).writeToMemory(outBuf.getReference()); return outBuf; @@ -82,9 +104,9 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterG PRECONDITION(arguments.childFunctions.size() == 2, "GeomDifference2dPhysicalFunction requires 2 children but got {}", arguments.childFunctions.size()); - return GeomDifference2dPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + return GeomDifference2dPhysicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/GeomDisjoint2dPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeomDisjoint2dPhysicalFunction.cpp index 83741db21b..4a5cf9048a 100644 --- a/nes-physical-operators/src/Functions/Meos/GeomDisjoint2dPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/GeomDisjoint2dPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -34,34 +35,50 @@ extern "C" { namespace NES { -GeomDisjoint2dPhysicalFunction::GeomDisjoint2dPhysicalFunction(PhysicalFunction wkt1Function, - PhysicalFunction wkt2Function) +GeomDisjoint2dPhysicalFunction::GeomDisjoint2dPhysicalFunction(PhysicalFunction wktFunction, + PhysicalFunction arg0Function) { - paramFns.reserve(2); - paramFns.push_back(std::move(wkt1Function)); - paramFns.push_back(std::move(wkt2Function)); + parameterFunctions.reserve(2); + parameterFunctions.push_back(std::move(wktFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } VarVal GeomDisjoint2dPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto wkt1 = paramFns[0].execute(record, arena).cast(); - auto wkt2 = paramFns[1].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto wkt = parameterValues[0].cast(); + auto arg0 = parameterValues[1].cast(); const auto result = nautilus::invoke( - +[](const char* w1, uint32_t w1sz, const char* w2, uint32_t w2sz) -> double { - try { + +[](const char* wktPtr, uint32_t wktSize, + const char* arg0Ptr, uint32_t arg0Size) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string s1(w1, w1sz), s2(w2, w2sz); - GSERIALIZED* gs1 = geom_in(s1.c_str(), -1); - if (!gs1) return 0.0; - GSERIALIZED* gs2 = geom_in(s2.c_str(), -1); - if (!gs2) { free(gs1); return 0.0; } - bool r = geom_disjoint2d(gs1, gs2); - free(gs1); free(gs2); - return r ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + std::string tempS(wktPtr, wktSize); + GSERIALIZED* temp = geom_in(tempS.c_str(), -1); + if (!temp) return 0.0; + std::string arg0S(arg0Ptr, arg0Size); + GSERIALIZED* gs0 = geom_in(arg0S.c_str(), -1); + if (!gs0) { free(temp); return 0.0; } + + double r = geom_disjoint2d(temp, gs0); + free(temp); + free(gs0); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, - wkt1, wkt2); + wkt.getContent(), wkt.getContentSize(), arg0.getContent(), arg0.getContentSize()); return VarVal(result); } @@ -72,9 +89,9 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterG PRECONDITION(arguments.childFunctions.size() == 2, "GeomDisjoint2dPhysicalFunction requires 2 children but got {}", arguments.childFunctions.size()); - return GeomDisjoint2dPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + return GeomDisjoint2dPhysicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/GeomDistance2dPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeomDistance2dPhysicalFunction.cpp index 9a29adab1c..1c22ecc349 100644 --- a/nes-physical-operators/src/Functions/Meos/GeomDistance2dPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/GeomDistance2dPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -34,34 +35,50 @@ extern "C" { namespace NES { -GeomDistance2dPhysicalFunction::GeomDistance2dPhysicalFunction(PhysicalFunction wkt1Function, - PhysicalFunction wkt2Function) +GeomDistance2dPhysicalFunction::GeomDistance2dPhysicalFunction(PhysicalFunction wktFunction, + PhysicalFunction arg0Function) { - paramFns.reserve(2); - paramFns.push_back(std::move(wkt1Function)); - paramFns.push_back(std::move(wkt2Function)); + parameterFunctions.reserve(2); + parameterFunctions.push_back(std::move(wktFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } VarVal GeomDistance2dPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto wkt1 = paramFns[0].execute(record, arena).cast(); - auto wkt2 = paramFns[1].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto wkt = parameterValues[0].cast(); + auto arg0 = parameterValues[1].cast(); const auto result = nautilus::invoke( - +[](const char* w1, uint32_t w1sz, const char* w2, uint32_t w2sz) -> double { - try { + +[](const char* wktPtr, uint32_t wktSize, + const char* arg0Ptr, uint32_t arg0Size) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string s1(w1, w1sz), s2(w2, w2sz); - GSERIALIZED* gs1 = geom_in(s1.c_str(), -1); - if (!gs1) return 0.0; - GSERIALIZED* gs2 = geom_in(s2.c_str(), -1); - if (!gs2) { free(gs1); return 0.0; } - double r = geom_distance2d(gs1, gs2); - free(gs1); free(gs2); + std::string tempS(wktPtr, wktSize); + GSERIALIZED* temp = geom_in(tempS.c_str(), -1); + if (!temp) return 0.0; + std::string arg0S(arg0Ptr, arg0Size); + GSERIALIZED* gs0 = geom_in(arg0S.c_str(), -1); + if (!gs0) { free(temp); return 0.0; } + + double r = geom_distance2d(temp, gs0); + free(temp); + free(gs0); return r; - } catch (const std::exception&) { return 0.0; } + } + catch (const std::exception&) + { + return 0.0; + } }, - wkt1, wkt2); + wkt.getContent(), wkt.getContentSize(), arg0.getContent(), arg0.getContentSize()); return VarVal(result); } @@ -72,9 +89,9 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterG PRECONDITION(arguments.childFunctions.size() == 2, "GeomDistance2dPhysicalFunction requires 2 children but got {}", arguments.childFunctions.size()); - return GeomDistance2dPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + return GeomDistance2dPhysicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/GeomDistance3dPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeomDistance3dPhysicalFunction.cpp index 05c7667dce..568e9931da 100644 --- a/nes-physical-operators/src/Functions/Meos/GeomDistance3dPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/GeomDistance3dPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -34,34 +35,50 @@ extern "C" { namespace NES { -GeomDistance3dPhysicalFunction::GeomDistance3dPhysicalFunction(PhysicalFunction wkt1Function, - PhysicalFunction wkt2Function) +GeomDistance3dPhysicalFunction::GeomDistance3dPhysicalFunction(PhysicalFunction wktFunction, + PhysicalFunction arg0Function) { - paramFns.reserve(2); - paramFns.push_back(std::move(wkt1Function)); - paramFns.push_back(std::move(wkt2Function)); + parameterFunctions.reserve(2); + parameterFunctions.push_back(std::move(wktFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } VarVal GeomDistance3dPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto wkt1 = paramFns[0].execute(record, arena).cast(); - auto wkt2 = paramFns[1].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto wkt = parameterValues[0].cast(); + auto arg0 = parameterValues[1].cast(); const auto result = nautilus::invoke( - +[](const char* w1, uint32_t w1sz, const char* w2, uint32_t w2sz) -> double { - try { + +[](const char* wktPtr, uint32_t wktSize, + const char* arg0Ptr, uint32_t arg0Size) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string s1(w1, w1sz), s2(w2, w2sz); - GSERIALIZED* gs1 = geom_in(s1.c_str(), -1); - if (!gs1) return 0.0; - GSERIALIZED* gs2 = geom_in(s2.c_str(), -1); - if (!gs2) { free(gs1); return 0.0; } - double r = geom_distance3d(gs1, gs2); - free(gs1); free(gs2); + std::string tempS(wktPtr, wktSize); + GSERIALIZED* temp = geom_in(tempS.c_str(), -1); + if (!temp) return 0.0; + std::string arg0S(arg0Ptr, arg0Size); + GSERIALIZED* gs0 = geom_in(arg0S.c_str(), -1); + if (!gs0) { free(temp); return 0.0; } + + double r = geom_distance3d(temp, gs0); + free(temp); + free(gs0); return r; - } catch (const std::exception&) { return 0.0; } + } + catch (const std::exception&) + { + return 0.0; + } }, - wkt1, wkt2); + wkt.getContent(), wkt.getContentSize(), arg0.getContent(), arg0.getContentSize()); return VarVal(result); } @@ -72,9 +89,9 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterG PRECONDITION(arguments.childFunctions.size() == 2, "GeomDistance3dPhysicalFunction requires 2 children but got {}", arguments.childFunctions.size()); - return GeomDistance3dPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + return GeomDistance3dPhysicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/GeomDwithin2dPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeomDwithin2dPhysicalFunction.cpp index 47c5446716..1a94d473c6 100644 --- a/nes-physical-operators/src/Functions/Meos/GeomDwithin2dPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/GeomDwithin2dPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -34,37 +35,54 @@ extern "C" { namespace NES { -GeomDwithin2dPhysicalFunction::GeomDwithin2dPhysicalFunction(PhysicalFunction wkt1Function, - PhysicalFunction wkt2Function, - PhysicalFunction distFunction) +GeomDwithin2dPhysicalFunction::GeomDwithin2dPhysicalFunction(PhysicalFunction wktFunction, + PhysicalFunction arg0Function, + PhysicalFunction arg1Function) { - paramFns.reserve(3); - paramFns.push_back(std::move(wkt1Function)); - paramFns.push_back(std::move(wkt2Function)); - paramFns.push_back(std::move(distFunction)); + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(wktFunction)); + parameterFunctions.push_back(std::move(arg0Function)); + parameterFunctions.push_back(std::move(arg1Function)); } VarVal GeomDwithin2dPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto wkt1 = paramFns[0].execute(record, arena).cast(); - auto wkt2 = paramFns[1].execute(record, arena).cast(); - auto dist = paramFns[2].execute(record, arena).cast>(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto wkt = parameterValues[0].cast(); + auto arg0 = parameterValues[1].cast(); + auto arg1 = parameterValues[2].cast>(); const auto result = nautilus::invoke( - +[](const char* w1, uint32_t w1sz, const char* w2, uint32_t w2sz, double d) -> double { - try { + +[](const char* wktPtr, uint32_t wktSize, + const char* arg0Ptr, uint32_t arg0Size, + double arg1) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string s1(w1, w1sz), s2(w2, w2sz); - GSERIALIZED* gs1 = geom_in(s1.c_str(), -1); - if (!gs1) return 0.0; - GSERIALIZED* gs2 = geom_in(s2.c_str(), -1); - if (!gs2) { free(gs1); return 0.0; } - bool r = geom_dwithin2d(gs1, gs2, d); - free(gs1); free(gs2); - return r ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + std::string tempS(wktPtr, wktSize); + GSERIALIZED* temp = geom_in(tempS.c_str(), -1); + if (!temp) return 0.0; + std::string arg0S(arg0Ptr, arg0Size); + GSERIALIZED* gs0 = geom_in(arg0S.c_str(), -1); + if (!gs0) { free(temp); return 0.0; } + + double r = geom_dwithin2d(temp, gs0, arg1); + free(temp); + free(gs0); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, - wkt1, wkt2, dist); + wkt.getContent(), wkt.getContentSize(), arg0.getContent(), arg0.getContentSize(), arg1); return VarVal(result); } @@ -75,10 +93,10 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterG PRECONDITION(arguments.childFunctions.size() == 3, "GeomDwithin2dPhysicalFunction requires 3 children but got {}", arguments.childFunctions.size()); - return GeomDwithin2dPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return GeomDwithin2dPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/GeomDwithin3dPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeomDwithin3dPhysicalFunction.cpp index 429b558521..fbdf788366 100644 --- a/nes-physical-operators/src/Functions/Meos/GeomDwithin3dPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/GeomDwithin3dPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -34,37 +35,54 @@ extern "C" { namespace NES { -GeomDwithin3dPhysicalFunction::GeomDwithin3dPhysicalFunction(PhysicalFunction wkt1Function, - PhysicalFunction wkt2Function, - PhysicalFunction distFunction) +GeomDwithin3dPhysicalFunction::GeomDwithin3dPhysicalFunction(PhysicalFunction wktFunction, + PhysicalFunction arg0Function, + PhysicalFunction arg1Function) { - paramFns.reserve(3); - paramFns.push_back(std::move(wkt1Function)); - paramFns.push_back(std::move(wkt2Function)); - paramFns.push_back(std::move(distFunction)); + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(wktFunction)); + parameterFunctions.push_back(std::move(arg0Function)); + parameterFunctions.push_back(std::move(arg1Function)); } VarVal GeomDwithin3dPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto wkt1 = paramFns[0].execute(record, arena).cast(); - auto wkt2 = paramFns[1].execute(record, arena).cast(); - auto dist = paramFns[2].execute(record, arena).cast>(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto wkt = parameterValues[0].cast(); + auto arg0 = parameterValues[1].cast(); + auto arg1 = parameterValues[2].cast>(); const auto result = nautilus::invoke( - +[](const char* w1, uint32_t w1sz, const char* w2, uint32_t w2sz, double d) -> double { - try { + +[](const char* wktPtr, uint32_t wktSize, + const char* arg0Ptr, uint32_t arg0Size, + double arg1) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string s1(w1, w1sz), s2(w2, w2sz); - GSERIALIZED* gs1 = geom_in(s1.c_str(), -1); - if (!gs1) return 0.0; - GSERIALIZED* gs2 = geom_in(s2.c_str(), -1); - if (!gs2) { free(gs1); return 0.0; } - bool r = geom_dwithin3d(gs1, gs2, d); - free(gs1); free(gs2); - return r ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + std::string tempS(wktPtr, wktSize); + GSERIALIZED* temp = geom_in(tempS.c_str(), -1); + if (!temp) return 0.0; + std::string arg0S(arg0Ptr, arg0Size); + GSERIALIZED* gs0 = geom_in(arg0S.c_str(), -1); + if (!gs0) { free(temp); return 0.0; } + + double r = geom_dwithin3d(temp, gs0, arg1); + free(temp); + free(gs0); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, - wkt1, wkt2, dist); + wkt.getContent(), wkt.getContentSize(), arg0.getContent(), arg0.getContentSize(), arg1); return VarVal(result); } @@ -75,10 +93,10 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterG PRECONDITION(arguments.childFunctions.size() == 3, "GeomDwithin3dPhysicalFunction requires 3 children but got {}", arguments.childFunctions.size()); - return GeomDwithin3dPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return GeomDwithin3dPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/GeomDwithinPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeomDwithinPhysicalFunction.cpp index c66c4affd1..ec5742666d 100644 --- a/nes-physical-operators/src/Functions/Meos/GeomDwithinPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/GeomDwithinPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -21,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -33,39 +35,54 @@ extern "C" { namespace NES { -GeomDwithinPhysicalFunction::GeomDwithinPhysicalFunction(PhysicalFunction wkt1, PhysicalFunction wkt2, - PhysicalFunction tolerance) +GeomDwithinPhysicalFunction::GeomDwithinPhysicalFunction(PhysicalFunction wktFunction, + PhysicalFunction arg0Function, + PhysicalFunction arg1Function) { - paramFns.reserve(3); - paramFns.push_back(std::move(wkt1)); - paramFns.push_back(std::move(wkt2)); - paramFns.push_back(std::move(tolerance)); + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(wktFunction)); + parameterFunctions.push_back(std::move(arg0Function)); + parameterFunctions.push_back(std::move(arg1Function)); } VarVal GeomDwithinPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto s1 = paramFns[0].execute(record, arena).cast(); - auto s2 = paramFns[1].execute(record, arena).cast(); - auto tol = paramFns[2].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto wkt = parameterValues[0].cast(); + auto arg0 = parameterValues[1].cast(); + auto arg1 = parameterValues[2].cast>(); const auto result = nautilus::invoke( - +[](const char* w1, uint32_t w1sz, - const char* w2, uint32_t w2sz, - double tol) -> double { - try { + +[](const char* wktPtr, uint32_t wktSize, + const char* arg0Ptr, uint32_t arg0Size, + double arg1) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string s1(w1, w1sz); - std::string s2(w2, w2sz); - GSERIALIZED* gs1 = geom_in(s1.c_str(), -1); - if (!gs1) return 0.0; - GSERIALIZED* gs2 = geom_in(s2.c_str(), -1); - if (!gs2) { free(gs1); return 0.0; } - double r = geom_dwithin(gs1, gs2, tol) ? 1.0 : 0.0; - free(gs1); free(gs2); + std::string tempS(wktPtr, wktSize); + GSERIALIZED* temp = geom_in(tempS.c_str(), -1); + if (!temp) return 0.0; + std::string arg0S(arg0Ptr, arg0Size); + GSERIALIZED* gs0 = geom_in(arg0S.c_str(), -1); + if (!gs0) { free(temp); return 0.0; } + + double r = geom_dwithin(temp, gs0, arg1); + free(temp); + free(gs0); return r; - } catch (const std::exception&) { return 0.0; } + } + catch (const std::exception&) + { + return 0.0; + } }, - s1, s2, tol); + wkt.getContent(), wkt.getContentSize(), arg0.getContent(), arg0.getContentSize(), arg1); return VarVal(result); } @@ -76,9 +93,10 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterG PRECONDITION(arguments.childFunctions.size() == 3, "GeomDwithinPhysicalFunction requires 3 children but got {}", arguments.childFunctions.size()); - return GeomDwithinPhysicalFunction(std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return GeomDwithinPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/GeomIntersection2dCollPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeomIntersection2dCollPhysicalFunction.cpp index 29f1e7d7f2..cb602dd2b8 100644 --- a/nes-physical-operators/src/Functions/Meos/GeomIntersection2dCollPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/GeomIntersection2dCollPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -21,8 +22,10 @@ #include #include #include +#include #include #include +#include #include #include @@ -33,43 +36,63 @@ extern "C" { namespace NES { -GeomIntersection2dCollPhysicalFunction::GeomIntersection2dCollPhysicalFunction(PhysicalFunction wkt1, PhysicalFunction wkt2) +GeomIntersection2dCollPhysicalFunction::GeomIntersection2dCollPhysicalFunction(PhysicalFunction wktFunction, + PhysicalFunction arg0Function) { - paramFns.reserve(2); - paramFns.push_back(std::move(wkt1)); - paramFns.push_back(std::move(wkt2)); + parameterFunctions.reserve(2); + parameterFunctions.push_back(std::move(wktFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } VarVal GeomIntersection2dCollPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto wkt1 = paramFns[0].execute(record, arena).cast(); - auto wkt2 = paramFns[1].execute(record, arena).cast(); - constexpr uint32_t MAX_LEN = 8192; + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto wkt = parameterValues[0].cast(); + auto arg0 = parameterValues[1].cast(); + + constexpr uint32_t MAX_LEN = 4096; auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); const auto actualLen = nautilus::invoke( - +[](const char* w1, uint32_t w1sz, const char* w2, uint32_t w2sz, char* buf, uint32_t bufMax) -> uint32_t { - try { + +[](const char* wktPtr, uint32_t wktSize, + const char* arg0Ptr, uint32_t arg0Size, + char* buf, + uint32_t bufMax) -> uint32_t { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string s1(w1, w1sz), s2(w2, w2sz); - GSERIALIZED* gs1 = geom_in(s1.c_str(), -1); - if (!gs1) return 0u; - GSERIALIZED* gs2 = geom_in(s2.c_str(), -1); - if (!gs2) { free(gs1); return 0u; } - GSERIALIZED* result = geom_intersection2d_coll(gs1, gs2); - free(gs1); free(gs2); - if (!result) return 0u; - char* out = geo_as_text(result, -1); - free(result); + std::string tempS(wktPtr, wktSize); + GSERIALIZED* temp = geom_in(tempS.c_str(), -1); + if (!temp) return 0u; + std::string arg0S(arg0Ptr, arg0Size); + GSERIALIZED* gs0 = geom_in(arg0S.c_str(), -1); + if (!gs0) { free(temp); return 0u; } + + GSERIALIZED* gres = geom_intersection2d_coll(temp, gs0); + free(temp); + free(gs0); + if (!gres) return 0u; + char* out = geo_as_text(gres, -1); + free(gres); if (!out) return 0u; uint32_t len = static_cast(strlen(out)); if (len > bufMax) len = bufMax; memcpy(buf, out, len); free(out); return len; - } catch (const std::exception&) { return 0u; } + } + catch (const std::exception&) + { + return 0u; + } }, - wkt1, wkt2, outBuf.getContent(), nautilus::val(MAX_LEN)); + wkt.getContent(), wkt.getContentSize(), arg0.getContent(), arg0.getContentSize(), outBuf.getContent(), nautilus::val(MAX_LEN)); VarVal(actualLen).writeToMemory(outBuf.getReference()); return outBuf; @@ -81,9 +104,9 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterG PRECONDITION(arguments.childFunctions.size() == 2, "GeomIntersection2dCollPhysicalFunction requires 2 children but got {}", arguments.childFunctions.size()); - return GeomIntersection2dCollPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + return GeomIntersection2dCollPhysicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/GeomIntersection2dPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeomIntersection2dPhysicalFunction.cpp index 574fad5631..630f782b1d 100644 --- a/nes-physical-operators/src/Functions/Meos/GeomIntersection2dPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/GeomIntersection2dPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -21,8 +22,10 @@ #include #include #include +#include #include #include +#include #include #include @@ -33,44 +36,63 @@ extern "C" { namespace NES { -GeomIntersection2dPhysicalFunction::GeomIntersection2dPhysicalFunction(PhysicalFunction wkt1, PhysicalFunction wkt2) +GeomIntersection2dPhysicalFunction::GeomIntersection2dPhysicalFunction(PhysicalFunction wktFunction, + PhysicalFunction arg0Function) { - paramFns.reserve(2); - paramFns.push_back(std::move(wkt1)); - paramFns.push_back(std::move(wkt2)); + parameterFunctions.reserve(2); + parameterFunctions.push_back(std::move(wktFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } VarVal GeomIntersection2dPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto wkt1 = paramFns[0].execute(record, arena).cast(); - auto wkt2 = paramFns[1].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto wkt = parameterValues[0].cast(); + auto arg0 = parameterValues[1].cast(); - constexpr uint32_t MAX_LEN = 8192; + constexpr uint32_t MAX_LEN = 4096; auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); const auto actualLen = nautilus::invoke( - +[](const char* w1, uint32_t w1sz, const char* w2, uint32_t w2sz, char* buf, uint32_t bufMax) -> uint32_t { - try { + +[](const char* wktPtr, uint32_t wktSize, + const char* arg0Ptr, uint32_t arg0Size, + char* buf, + uint32_t bufMax) -> uint32_t { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string s1(w1, w1sz), s2(w2, w2sz); - GSERIALIZED* gs1 = geom_in(s1.c_str(), -1); - if (!gs1) return 0u; - GSERIALIZED* gs2 = geom_in(s2.c_str(), -1); - if (!gs2) { free(gs1); return 0u; } - GSERIALIZED* result = geom_intersection2d(gs1, gs2); - free(gs1); free(gs2); - if (!result) return 0u; - char* out = geo_as_text(result, -1); - free(result); + std::string tempS(wktPtr, wktSize); + GSERIALIZED* temp = geom_in(tempS.c_str(), -1); + if (!temp) return 0u; + std::string arg0S(arg0Ptr, arg0Size); + GSERIALIZED* gs0 = geom_in(arg0S.c_str(), -1); + if (!gs0) { free(temp); return 0u; } + + GSERIALIZED* gres = geom_intersection2d(temp, gs0); + free(temp); + free(gs0); + if (!gres) return 0u; + char* out = geo_as_text(gres, -1); + free(gres); if (!out) return 0u; uint32_t len = static_cast(strlen(out)); if (len > bufMax) len = bufMax; memcpy(buf, out, len); free(out); return len; - } catch (const std::exception&) { return 0u; } + } + catch (const std::exception&) + { + return 0u; + } }, - wkt1, wkt2, outBuf.getContent(), nautilus::val(MAX_LEN)); + wkt.getContent(), wkt.getContentSize(), arg0.getContent(), arg0.getContentSize(), outBuf.getContent(), nautilus::val(MAX_LEN)); VarVal(actualLen).writeToMemory(outBuf.getReference()); return outBuf; @@ -82,9 +104,9 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterG PRECONDITION(arguments.childFunctions.size() == 2, "GeomIntersection2dPhysicalFunction requires 2 children but got {}", arguments.childFunctions.size()); - return GeomIntersection2dPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + return GeomIntersection2dPhysicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/GeomIntersects2dPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeomIntersects2dPhysicalFunction.cpp index 9fc552d4f2..105e4212f5 100644 --- a/nes-physical-operators/src/Functions/Meos/GeomIntersects2dPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/GeomIntersects2dPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -34,34 +35,50 @@ extern "C" { namespace NES { -GeomIntersects2dPhysicalFunction::GeomIntersects2dPhysicalFunction(PhysicalFunction wkt1Function, - PhysicalFunction wkt2Function) +GeomIntersects2dPhysicalFunction::GeomIntersects2dPhysicalFunction(PhysicalFunction wktFunction, + PhysicalFunction arg0Function) { - paramFns.reserve(2); - paramFns.push_back(std::move(wkt1Function)); - paramFns.push_back(std::move(wkt2Function)); + parameterFunctions.reserve(2); + parameterFunctions.push_back(std::move(wktFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } VarVal GeomIntersects2dPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto wkt1 = paramFns[0].execute(record, arena).cast(); - auto wkt2 = paramFns[1].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto wkt = parameterValues[0].cast(); + auto arg0 = parameterValues[1].cast(); const auto result = nautilus::invoke( - +[](const char* w1, uint32_t w1sz, const char* w2, uint32_t w2sz) -> double { - try { + +[](const char* wktPtr, uint32_t wktSize, + const char* arg0Ptr, uint32_t arg0Size) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string s1(w1, w1sz), s2(w2, w2sz); - GSERIALIZED* gs1 = geom_in(s1.c_str(), -1); - if (!gs1) return 0.0; - GSERIALIZED* gs2 = geom_in(s2.c_str(), -1); - if (!gs2) { free(gs1); return 0.0; } - bool r = geom_intersects2d(gs1, gs2); - free(gs1); free(gs2); - return r ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + std::string tempS(wktPtr, wktSize); + GSERIALIZED* temp = geom_in(tempS.c_str(), -1); + if (!temp) return 0.0; + std::string arg0S(arg0Ptr, arg0Size); + GSERIALIZED* gs0 = geom_in(arg0S.c_str(), -1); + if (!gs0) { free(temp); return 0.0; } + + double r = geom_intersects2d(temp, gs0); + free(temp); + free(gs0); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, - wkt1, wkt2); + wkt.getContent(), wkt.getContentSize(), arg0.getContent(), arg0.getContentSize()); return VarVal(result); } @@ -72,9 +89,9 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterG PRECONDITION(arguments.childFunctions.size() == 2, "GeomIntersects2dPhysicalFunction requires 2 children but got {}", arguments.childFunctions.size()); - return GeomIntersects2dPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + return GeomIntersects2dPhysicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/GeomIntersects3dPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeomIntersects3dPhysicalFunction.cpp index cbd4e019c2..00af55e41f 100644 --- a/nes-physical-operators/src/Functions/Meos/GeomIntersects3dPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/GeomIntersects3dPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -34,34 +35,50 @@ extern "C" { namespace NES { -GeomIntersects3dPhysicalFunction::GeomIntersects3dPhysicalFunction(PhysicalFunction wkt1Function, - PhysicalFunction wkt2Function) +GeomIntersects3dPhysicalFunction::GeomIntersects3dPhysicalFunction(PhysicalFunction wktFunction, + PhysicalFunction arg0Function) { - paramFns.reserve(2); - paramFns.push_back(std::move(wkt1Function)); - paramFns.push_back(std::move(wkt2Function)); + parameterFunctions.reserve(2); + parameterFunctions.push_back(std::move(wktFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } VarVal GeomIntersects3dPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto wkt1 = paramFns[0].execute(record, arena).cast(); - auto wkt2 = paramFns[1].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto wkt = parameterValues[0].cast(); + auto arg0 = parameterValues[1].cast(); const auto result = nautilus::invoke( - +[](const char* w1, uint32_t w1sz, const char* w2, uint32_t w2sz) -> double { - try { + +[](const char* wktPtr, uint32_t wktSize, + const char* arg0Ptr, uint32_t arg0Size) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string s1(w1, w1sz), s2(w2, w2sz); - GSERIALIZED* gs1 = geom_in(s1.c_str(), -1); - if (!gs1) return 0.0; - GSERIALIZED* gs2 = geom_in(s2.c_str(), -1); - if (!gs2) { free(gs1); return 0.0; } - bool r = geom_intersects3d(gs1, gs2); - free(gs1); free(gs2); - return r ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + std::string tempS(wktPtr, wktSize); + GSERIALIZED* temp = geom_in(tempS.c_str(), -1); + if (!temp) return 0.0; + std::string arg0S(arg0Ptr, arg0Size); + GSERIALIZED* gs0 = geom_in(arg0S.c_str(), -1); + if (!gs0) { free(temp); return 0.0; } + + double r = geom_intersects3d(temp, gs0); + free(temp); + free(gs0); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, - wkt1, wkt2); + wkt.getContent(), wkt.getContentSize(), arg0.getContent(), arg0.getContentSize()); return VarVal(result); } @@ -72,9 +89,9 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterG PRECONDITION(arguments.childFunctions.size() == 2, "GeomIntersects3dPhysicalFunction requires 2 children but got {}", arguments.childFunctions.size()); - return GeomIntersects3dPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + return GeomIntersects3dPhysicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/GeomIntersectsPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeomIntersectsPhysicalFunction.cpp index 7b4878ec95..196b810da0 100644 --- a/nes-physical-operators/src/Functions/Meos/GeomIntersectsPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/GeomIntersectsPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -21,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -33,34 +35,50 @@ extern "C" { namespace NES { -GeomIntersectsPhysicalFunction::GeomIntersectsPhysicalFunction(PhysicalFunction wkt1, PhysicalFunction wkt2) +GeomIntersectsPhysicalFunction::GeomIntersectsPhysicalFunction(PhysicalFunction wktFunction, + PhysicalFunction arg0Function) { - paramFns.reserve(2); - paramFns.push_back(std::move(wkt1)); - paramFns.push_back(std::move(wkt2)); + parameterFunctions.reserve(2); + parameterFunctions.push_back(std::move(wktFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } VarVal GeomIntersectsPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto s1 = paramFns[0].execute(record, arena).cast(); - auto s2 = paramFns[1].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto wkt = parameterValues[0].cast(); + auto arg0 = parameterValues[1].cast(); const auto result = nautilus::invoke( - +[](const char* w1, uint32_t w1sz, const char* w2, uint32_t w2sz) -> double { - try { + +[](const char* wktPtr, uint32_t wktSize, + const char* arg0Ptr, uint32_t arg0Size) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string s1(w1, w1sz); - std::string s2(w2, w2sz); - GSERIALIZED* gs1 = geom_in(s1.c_str(), -1); - if (!gs1) return 0.0; - GSERIALIZED* gs2 = geom_in(s2.c_str(), -1); - if (!gs2) { free(gs1); return 0.0; } - double r = geom_intersects(gs1, gs2) ? 1.0 : 0.0; - free(gs1); free(gs2); + std::string tempS(wktPtr, wktSize); + GSERIALIZED* temp = geom_in(tempS.c_str(), -1); + if (!temp) return 0.0; + std::string arg0S(arg0Ptr, arg0Size); + GSERIALIZED* gs0 = geom_in(arg0S.c_str(), -1); + if (!gs0) { free(temp); return 0.0; } + + double r = geom_intersects(temp, gs0); + free(temp); + free(gs0); return r; - } catch (const std::exception&) { return 0.0; } + } + catch (const std::exception&) + { + return 0.0; + } }, - s1, s2); + wkt.getContent(), wkt.getContentSize(), arg0.getContent(), arg0.getContentSize()); return VarVal(result); } @@ -71,8 +89,9 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterG PRECONDITION(arguments.childFunctions.size() == 2, "GeomIntersectsPhysicalFunction requires 2 children but got {}", arguments.childFunctions.size()); - return GeomIntersectsPhysicalFunction(std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + return GeomIntersectsPhysicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/GeomIsEmptyPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeomIsEmptyPhysicalFunction.cpp index cfca0f65e0..0ccd3d0397 100644 --- a/nes-physical-operators/src/Functions/Meos/GeomIsEmptyPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/GeomIsEmptyPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -34,29 +35,42 @@ extern "C" { namespace NES { -GeomIsEmptyPhysicalFunction::GeomIsEmptyPhysicalFunction(PhysicalFunction wkt1Function) +GeomIsEmptyPhysicalFunction::GeomIsEmptyPhysicalFunction(PhysicalFunction wktFunction) { - paramFns.reserve(1); - paramFns.push_back(std::move(wkt1Function)); + parameterFunctions.reserve(1); + parameterFunctions.push_back(std::move(wktFunction)); } VarVal GeomIsEmptyPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto wkt1 = paramFns[0].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto wkt = parameterValues[0].cast(); const auto result = nautilus::invoke( - +[](const char* w1, uint32_t w1sz) -> double { - try { + +[](const char* wktPtr, uint32_t wktSize) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string s1(w1, w1sz); - GSERIALIZED* gs1 = geom_in(s1.c_str(), -1); - if (!gs1) return 0.0; - double r = geo_is_empty(gs1) ? 1.0 : 0.0; - free(gs1); + std::string tempS(wktPtr, wktSize); + GSERIALIZED* temp = geom_in(tempS.c_str(), -1); + if (!temp) return 0.0; + + double r = geom_is_empty(temp); + free(temp); return r; - } catch (const std::exception&) { return 0.0; } + } + catch (const std::exception&) + { + return 0.0; + } }, - wkt1); + wkt.getContent(), wkt.getContentSize()); return VarVal(result); } @@ -65,9 +79,10 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterG PhysicalFunctionRegistryArguments arguments) { PRECONDITION(arguments.childFunctions.size() == 1, - "GeomIsEmptyPhysicalFunction requires 1 child but got {}", + "GeomIsEmptyPhysicalFunction requires 1 children but got {}", arguments.childFunctions.size()); - return GeomIsEmptyPhysicalFunction(std::move(arguments.childFunctions[0])); + auto arg0 = std::move(arguments.childFunctions[0]); + return GeomIsEmptyPhysicalFunction(std::move(arg0)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/GeomLengthPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeomLengthPhysicalFunction.cpp index 79ac73c676..f60208c45a 100644 --- a/nes-physical-operators/src/Functions/Meos/GeomLengthPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/GeomLengthPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -34,29 +35,42 @@ extern "C" { namespace NES { -GeomLengthPhysicalFunction::GeomLengthPhysicalFunction(PhysicalFunction wkt1Function) +GeomLengthPhysicalFunction::GeomLengthPhysicalFunction(PhysicalFunction wktFunction) { - paramFns.reserve(1); - paramFns.push_back(std::move(wkt1Function)); + parameterFunctions.reserve(1); + parameterFunctions.push_back(std::move(wktFunction)); } VarVal GeomLengthPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto wkt1 = paramFns[0].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto wkt = parameterValues[0].cast(); const auto result = nautilus::invoke( - +[](const char* w1, uint32_t w1sz) -> double { - try { + +[](const char* wktPtr, uint32_t wktSize) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string s1(w1, w1sz); - GSERIALIZED* gs1 = geom_in(s1.c_str(), -1); - if (!gs1) return 0.0; - double r = geom_length(gs1); - free(gs1); + std::string tempS(wktPtr, wktSize); + GSERIALIZED* temp = geom_in(tempS.c_str(), -1); + if (!temp) return 0.0; + + double r = geom_length(temp); + free(temp); return r; - } catch (const std::exception&) { return 0.0; } + } + catch (const std::exception&) + { + return 0.0; + } }, - wkt1); + wkt.getContent(), wkt.getContentSize()); return VarVal(result); } @@ -65,9 +79,10 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterG PhysicalFunctionRegistryArguments arguments) { PRECONDITION(arguments.childFunctions.size() == 1, - "GeomLengthPhysicalFunction requires 1 child but got {}", + "GeomLengthPhysicalFunction requires 1 children but got {}", arguments.childFunctions.size()); - return GeomLengthPhysicalFunction(std::move(arguments.childFunctions[0])); + auto arg0 = std::move(arguments.childFunctions[0]); + return GeomLengthPhysicalFunction(std::move(arg0)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/GeomPerimeterPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeomPerimeterPhysicalFunction.cpp index 7e56e10181..30090e6373 100644 --- a/nes-physical-operators/src/Functions/Meos/GeomPerimeterPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/GeomPerimeterPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -34,29 +35,42 @@ extern "C" { namespace NES { -GeomPerimeterPhysicalFunction::GeomPerimeterPhysicalFunction(PhysicalFunction wkt1Function) +GeomPerimeterPhysicalFunction::GeomPerimeterPhysicalFunction(PhysicalFunction wktFunction) { - paramFns.reserve(1); - paramFns.push_back(std::move(wkt1Function)); + parameterFunctions.reserve(1); + parameterFunctions.push_back(std::move(wktFunction)); } VarVal GeomPerimeterPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto wkt1 = paramFns[0].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto wkt = parameterValues[0].cast(); const auto result = nautilus::invoke( - +[](const char* w1, uint32_t w1sz) -> double { - try { + +[](const char* wktPtr, uint32_t wktSize) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string s1(w1, w1sz); - GSERIALIZED* gs1 = geom_in(s1.c_str(), -1); - if (!gs1) return 0.0; - double r = geom_perimeter(gs1); - free(gs1); + std::string tempS(wktPtr, wktSize); + GSERIALIZED* temp = geom_in(tempS.c_str(), -1); + if (!temp) return 0.0; + + double r = geom_perimeter(temp); + free(temp); return r; - } catch (const std::exception&) { return 0.0; } + } + catch (const std::exception&) + { + return 0.0; + } }, - wkt1); + wkt.getContent(), wkt.getContentSize()); return VarVal(result); } @@ -65,9 +79,10 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterG PhysicalFunctionRegistryArguments arguments) { PRECONDITION(arguments.childFunctions.size() == 1, - "GeomPerimeterPhysicalFunction requires 1 child but got {}", + "GeomPerimeterPhysicalFunction requires 1 children but got {}", arguments.childFunctions.size()); - return GeomPerimeterPhysicalFunction(std::move(arguments.childFunctions[0])); + auto arg0 = std::move(arguments.childFunctions[0]); + return GeomPerimeterPhysicalFunction(std::move(arg0)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/GeomPointMake2dPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeomPointMake2dPhysicalFunction.cpp index edbcad0082..e5c6c7fb80 100644 --- a/nes-physical-operators/src/Functions/Meos/GeomPointMake2dPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/GeomPointMake2dPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -21,8 +22,10 @@ #include #include #include +#include #include #include +#include #include #include @@ -33,37 +36,57 @@ extern "C" { namespace NES { -GeomPointMake2dPhysicalFunction::GeomPointMake2dPhysicalFunction(PhysicalFunction srid, PhysicalFunction x, PhysicalFunction y) +GeomPointMake2dPhysicalFunction::GeomPointMake2dPhysicalFunction(PhysicalFunction sridFunction, + PhysicalFunction xFunction, + PhysicalFunction yFunction) { - paramFns.reserve(3); - paramFns.push_back(std::move(srid)); - paramFns.push_back(std::move(x)); - paramFns.push_back(std::move(y)); + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(sridFunction)); + parameterFunctions.push_back(std::move(xFunction)); + parameterFunctions.push_back(std::move(yFunction)); } VarVal GeomPointMake2dPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto srid = paramFns[0].execute(record, arena).cast>(); - auto x = paramFns[1].execute(record, arena).cast(); - auto y = paramFns[2].execute(record, arena).cast(); - constexpr uint32_t MAX_LEN = 8192; + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto srid = parameterValues[0].cast>(); + auto x = parameterValues[1].cast>(); + auto y = parameterValues[2].cast>(); + + constexpr uint32_t MAX_LEN = 4096; auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); const auto actualLen = nautilus::invoke( - +[](uint64_t srid, double x, double y, char* buf, uint32_t bufMax) -> uint32_t { - try { + +[](uint64_t srid, + double x, + double y, + char* buf, + uint32_t bufMax) -> uint32_t { + try + { MEOS::Meos::ensureMeosInitialized(); - GSERIALIZED* result = geompoint_make2d((int32_t)srid, x, y); - if (!result) return 0u; - char* out = geo_as_text(result, -1); - free(result); + + GSERIALIZED* gres = geompoint_make2d((int32_t)srid, x, y); + if (!gres) return 0u; + char* out = geo_as_text(gres, -1); + free(gres); if (!out) return 0u; uint32_t len = static_cast(strlen(out)); if (len > bufMax) len = bufMax; memcpy(buf, out, len); free(out); return len; - } catch (const std::exception&) { return 0u; } + } + catch (const std::exception&) + { + return 0u; + } }, srid, x, y, outBuf.getContent(), nautilus::val(MAX_LEN)); @@ -77,10 +100,10 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterG PRECONDITION(arguments.childFunctions.size() == 3, "GeomPointMake2dPhysicalFunction requires 3 children but got {}", arguments.childFunctions.size()); - return GeomPointMake2dPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return GeomPointMake2dPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/GeomPointMake3dzPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeomPointMake3dzPhysicalFunction.cpp index 4b233579da..878e4669a3 100644 --- a/nes-physical-operators/src/Functions/Meos/GeomPointMake3dzPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/GeomPointMake3dzPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -21,8 +22,10 @@ #include #include #include +#include #include #include +#include #include #include @@ -33,39 +36,61 @@ extern "C" { namespace NES { -GeomPointMake3dzPhysicalFunction::GeomPointMake3dzPhysicalFunction(PhysicalFunction srid, PhysicalFunction x, PhysicalFunction y, PhysicalFunction z) +GeomPointMake3dzPhysicalFunction::GeomPointMake3dzPhysicalFunction(PhysicalFunction sridFunction, + PhysicalFunction xFunction, + PhysicalFunction yFunction, + PhysicalFunction zFunction) { - paramFns.reserve(4); - paramFns.push_back(std::move(srid)); - paramFns.push_back(std::move(x)); - paramFns.push_back(std::move(y)); - paramFns.push_back(std::move(z)); + parameterFunctions.reserve(4); + parameterFunctions.push_back(std::move(sridFunction)); + parameterFunctions.push_back(std::move(xFunction)); + parameterFunctions.push_back(std::move(yFunction)); + parameterFunctions.push_back(std::move(zFunction)); } VarVal GeomPointMake3dzPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto srid = paramFns[0].execute(record, arena).cast>(); - auto x = paramFns[1].execute(record, arena).cast(); - auto y = paramFns[2].execute(record, arena).cast(); - auto z = paramFns[3].execute(record, arena).cast(); - constexpr uint32_t MAX_LEN = 8192; + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto srid = parameterValues[0].cast>(); + auto x = parameterValues[1].cast>(); + auto y = parameterValues[2].cast>(); + auto z = parameterValues[3].cast>(); + + constexpr uint32_t MAX_LEN = 4096; auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); const auto actualLen = nautilus::invoke( - +[](uint64_t srid, double x, double y, double z, char* buf, uint32_t bufMax) -> uint32_t { - try { + +[](uint64_t srid, + double x, + double y, + double z, + char* buf, + uint32_t bufMax) -> uint32_t { + try + { MEOS::Meos::ensureMeosInitialized(); - GSERIALIZED* result = geompoint_make3dz((int32_t)srid, x, y, z); - if (!result) return 0u; - char* out = geo_as_text(result, -1); - free(result); + + GSERIALIZED* gres = geompoint_make3dz((int32_t)srid, x, y, z); + if (!gres) return 0u; + char* out = geo_as_text(gres, -1); + free(gres); if (!out) return 0u; uint32_t len = static_cast(strlen(out)); if (len > bufMax) len = bufMax; memcpy(buf, out, len); free(out); return len; - } catch (const std::exception&) { return 0u; } + } + catch (const std::exception&) + { + return 0u; + } }, srid, x, y, z, outBuf.getContent(), nautilus::val(MAX_LEN)); @@ -79,11 +104,11 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterG PRECONDITION(arguments.childFunctions.size() == 4, "GeomPointMake3dzPhysicalFunction requires 4 children but got {}", arguments.childFunctions.size()); - return GeomPointMake3dzPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2]), - std::move(arguments.childFunctions[3])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + return GeomPointMake3dzPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/GeomShortestline2dPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeomShortestline2dPhysicalFunction.cpp index 7a1ad18e0c..d8e4b37017 100644 --- a/nes-physical-operators/src/Functions/Meos/GeomShortestline2dPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/GeomShortestline2dPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -21,8 +22,10 @@ #include #include #include +#include #include #include +#include #include #include @@ -33,44 +36,63 @@ extern "C" { namespace NES { -GeomShortestline2dPhysicalFunction::GeomShortestline2dPhysicalFunction(PhysicalFunction wkt1, PhysicalFunction wkt2) +GeomShortestline2dPhysicalFunction::GeomShortestline2dPhysicalFunction(PhysicalFunction wktFunction, + PhysicalFunction arg0Function) { - paramFns.reserve(2); - paramFns.push_back(std::move(wkt1)); - paramFns.push_back(std::move(wkt2)); + parameterFunctions.reserve(2); + parameterFunctions.push_back(std::move(wktFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } VarVal GeomShortestline2dPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto wkt1 = paramFns[0].execute(record, arena).cast(); - auto wkt2 = paramFns[1].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto wkt = parameterValues[0].cast(); + auto arg0 = parameterValues[1].cast(); - constexpr uint32_t MAX_LEN = 8192; + constexpr uint32_t MAX_LEN = 4096; auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); const auto actualLen = nautilus::invoke( - +[](const char* w1, uint32_t w1sz, const char* w2, uint32_t w2sz, char* buf, uint32_t bufMax) -> uint32_t { - try { + +[](const char* wktPtr, uint32_t wktSize, + const char* arg0Ptr, uint32_t arg0Size, + char* buf, + uint32_t bufMax) -> uint32_t { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string s1(w1, w1sz), s2(w2, w2sz); - GSERIALIZED* gs1 = geom_in(s1.c_str(), -1); - if (!gs1) return 0u; - GSERIALIZED* gs2 = geom_in(s2.c_str(), -1); - if (!gs2) { free(gs1); return 0u; } - GSERIALIZED* result = geom_shortestline2d(gs1, gs2); - free(gs1); free(gs2); - if (!result) return 0u; - char* out = geo_as_text(result, -1); - free(result); + std::string tempS(wktPtr, wktSize); + GSERIALIZED* temp = geom_in(tempS.c_str(), -1); + if (!temp) return 0u; + std::string arg0S(arg0Ptr, arg0Size); + GSERIALIZED* gs0 = geom_in(arg0S.c_str(), -1); + if (!gs0) { free(temp); return 0u; } + + GSERIALIZED* gres = geom_shortestline2d(temp, gs0); + free(temp); + free(gs0); + if (!gres) return 0u; + char* out = geo_as_text(gres, -1); + free(gres); if (!out) return 0u; uint32_t len = static_cast(strlen(out)); if (len > bufMax) len = bufMax; memcpy(buf, out, len); free(out); return len; - } catch (const std::exception&) { return 0u; } + } + catch (const std::exception&) + { + return 0u; + } }, - wkt1, wkt2, outBuf.getContent(), nautilus::val(MAX_LEN)); + wkt.getContent(), wkt.getContentSize(), arg0.getContent(), arg0.getContentSize(), outBuf.getContent(), nautilus::val(MAX_LEN)); VarVal(actualLen).writeToMemory(outBuf.getReference()); return outBuf; @@ -82,9 +104,9 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterG PRECONDITION(arguments.childFunctions.size() == 2, "GeomShortestline2dPhysicalFunction requires 2 children but got {}", arguments.childFunctions.size()); - return GeomShortestline2dPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + return GeomShortestline2dPhysicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/GeomShortestline3dPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeomShortestline3dPhysicalFunction.cpp index d95bb20070..95da1409bd 100644 --- a/nes-physical-operators/src/Functions/Meos/GeomShortestline3dPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/GeomShortestline3dPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -21,8 +22,10 @@ #include #include #include +#include #include #include +#include #include #include @@ -33,44 +36,63 @@ extern "C" { namespace NES { -GeomShortestline3dPhysicalFunction::GeomShortestline3dPhysicalFunction(PhysicalFunction wkt1, PhysicalFunction wkt2) +GeomShortestline3dPhysicalFunction::GeomShortestline3dPhysicalFunction(PhysicalFunction wktFunction, + PhysicalFunction arg0Function) { - paramFns.reserve(2); - paramFns.push_back(std::move(wkt1)); - paramFns.push_back(std::move(wkt2)); + parameterFunctions.reserve(2); + parameterFunctions.push_back(std::move(wktFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } VarVal GeomShortestline3dPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto wkt1 = paramFns[0].execute(record, arena).cast(); - auto wkt2 = paramFns[1].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto wkt = parameterValues[0].cast(); + auto arg0 = parameterValues[1].cast(); - constexpr uint32_t MAX_LEN = 8192; + constexpr uint32_t MAX_LEN = 4096; auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); const auto actualLen = nautilus::invoke( - +[](const char* w1, uint32_t w1sz, const char* w2, uint32_t w2sz, char* buf, uint32_t bufMax) -> uint32_t { - try { + +[](const char* wktPtr, uint32_t wktSize, + const char* arg0Ptr, uint32_t arg0Size, + char* buf, + uint32_t bufMax) -> uint32_t { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string s1(w1, w1sz), s2(w2, w2sz); - GSERIALIZED* gs1 = geom_in(s1.c_str(), -1); - if (!gs1) return 0u; - GSERIALIZED* gs2 = geom_in(s2.c_str(), -1); - if (!gs2) { free(gs1); return 0u; } - GSERIALIZED* result = geom_shortestline3d(gs1, gs2); - free(gs1); free(gs2); - if (!result) return 0u; - char* out = geo_as_text(result, -1); - free(result); + std::string tempS(wktPtr, wktSize); + GSERIALIZED* temp = geom_in(tempS.c_str(), -1); + if (!temp) return 0u; + std::string arg0S(arg0Ptr, arg0Size); + GSERIALIZED* gs0 = geom_in(arg0S.c_str(), -1); + if (!gs0) { free(temp); return 0u; } + + GSERIALIZED* gres = geom_shortestline3d(temp, gs0); + free(temp); + free(gs0); + if (!gres) return 0u; + char* out = geo_as_text(gres, -1); + free(gres); if (!out) return 0u; uint32_t len = static_cast(strlen(out)); if (len > bufMax) len = bufMax; memcpy(buf, out, len); free(out); return len; - } catch (const std::exception&) { return 0u; } + } + catch (const std::exception&) + { + return 0u; + } }, - wkt1, wkt2, outBuf.getContent(), nautilus::val(MAX_LEN)); + wkt.getContent(), wkt.getContentSize(), arg0.getContent(), arg0.getContentSize(), outBuf.getContent(), nautilus::val(MAX_LEN)); VarVal(actualLen).writeToMemory(outBuf.getReference()); return outBuf; @@ -82,9 +104,9 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterG PRECONDITION(arguments.childFunctions.size() == 2, "GeomShortestline3dPhysicalFunction requires 2 children but got {}", arguments.childFunctions.size()); - return GeomShortestline3dPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + return GeomShortestline3dPhysicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/GeomToGeogPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeomToGeogPhysicalFunction.cpp index 1e1731b9b5..41a1783565 100644 --- a/nes-physical-operators/src/Functions/Meos/GeomToGeogPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/GeomToGeogPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -21,8 +22,10 @@ #include #include #include +#include #include #include +#include #include #include @@ -33,39 +36,55 @@ extern "C" { namespace NES { -GeomToGeogPhysicalFunction::GeomToGeogPhysicalFunction(PhysicalFunction wkt) +GeomToGeogPhysicalFunction::GeomToGeogPhysicalFunction(PhysicalFunction wktFunction) { - paramFns.reserve(1); - paramFns.push_back(std::move(wkt)); + parameterFunctions.reserve(1); + parameterFunctions.push_back(std::move(wktFunction)); } VarVal GeomToGeogPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto wkt = paramFns[0].execute(record, arena).cast(); - constexpr uint32_t MAX_LEN = 8192; + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto wkt = parameterValues[0].cast(); + + constexpr uint32_t MAX_LEN = 4096; auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); const auto actualLen = nautilus::invoke( - +[](const char* w, uint32_t wsz, char* buf, uint32_t bufMax) -> uint32_t { - try { + +[](const char* wktPtr, uint32_t wktSize, + char* buf, + uint32_t bufMax) -> uint32_t { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string s(w, wsz); - GSERIALIZED* gs = geom_in(s.c_str(), -1); - if (!gs) return 0u; - GSERIALIZED* result = geom_to_geog(gs); - free(gs); - if (!result) return 0u; - char* out = geo_as_text(result, -1); - free(result); + std::string tempS(wktPtr, wktSize); + GSERIALIZED* temp = geog_in(tempS.c_str(), -1); + if (!temp) return 0u; + + GSERIALIZED* gres = geom_to_geog(temp); + free(temp); + if (!gres) return 0u; + char* out = geo_as_text(gres, -1); + free(gres); if (!out) return 0u; uint32_t len = static_cast(strlen(out)); if (len > bufMax) len = bufMax; memcpy(buf, out, len); free(out); return len; - } catch (const std::exception&) { return 0u; } + } + catch (const std::exception&) + { + return 0u; + } }, - wkt, outBuf.getContent(), nautilus::val(MAX_LEN)); + wkt.getContent(), wkt.getContentSize(), outBuf.getContent(), nautilus::val(MAX_LEN)); VarVal(actualLen).writeToMemory(outBuf.getReference()); return outBuf; @@ -77,8 +96,8 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterG PRECONDITION(arguments.childFunctions.size() == 1, "GeomToGeogPhysicalFunction requires 1 children but got {}", arguments.childFunctions.size()); - return GeomToGeogPhysicalFunction( - std::move(arguments.childFunctions[0])); + auto arg0 = std::move(arguments.childFunctions[0]); + return GeomToGeogPhysicalFunction(std::move(arg0)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/GeomTouchesPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeomTouchesPhysicalFunction.cpp index 8df0beaafe..866b05a3c5 100644 --- a/nes-physical-operators/src/Functions/Meos/GeomTouchesPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/GeomTouchesPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -34,34 +35,50 @@ extern "C" { namespace NES { -GeomTouchesPhysicalFunction::GeomTouchesPhysicalFunction(PhysicalFunction wkt1Function, - PhysicalFunction wkt2Function) +GeomTouchesPhysicalFunction::GeomTouchesPhysicalFunction(PhysicalFunction wktFunction, + PhysicalFunction arg0Function) { - paramFns.reserve(2); - paramFns.push_back(std::move(wkt1Function)); - paramFns.push_back(std::move(wkt2Function)); + parameterFunctions.reserve(2); + parameterFunctions.push_back(std::move(wktFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } VarVal GeomTouchesPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto wkt1 = paramFns[0].execute(record, arena).cast(); - auto wkt2 = paramFns[1].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto wkt = parameterValues[0].cast(); + auto arg0 = parameterValues[1].cast(); const auto result = nautilus::invoke( - +[](const char* w1, uint32_t w1sz, const char* w2, uint32_t w2sz) -> double { - try { + +[](const char* wktPtr, uint32_t wktSize, + const char* arg0Ptr, uint32_t arg0Size) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string s1(w1, w1sz), s2(w2, w2sz); - GSERIALIZED* gs1 = geom_in(s1.c_str(), -1); - if (!gs1) return 0.0; - GSERIALIZED* gs2 = geom_in(s2.c_str(), -1); - if (!gs2) { free(gs1); return 0.0; } - bool r = geom_touches(gs1, gs2); - free(gs1); free(gs2); - return r ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + std::string tempS(wktPtr, wktSize); + GSERIALIZED* temp = geom_in(tempS.c_str(), -1); + if (!temp) return 0.0; + std::string arg0S(arg0Ptr, arg0Size); + GSERIALIZED* gs0 = geom_in(arg0S.c_str(), -1); + if (!gs0) { free(temp); return 0.0; } + + double r = geom_touches(temp, gs0); + free(temp); + free(gs0); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, - wkt1, wkt2); + wkt.getContent(), wkt.getContentSize(), arg0.getContent(), arg0.getContentSize()); return VarVal(result); } @@ -72,9 +89,9 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterG PRECONDITION(arguments.childFunctions.size() == 2, "GeomTouchesPhysicalFunction requires 2 children but got {}", arguments.childFunctions.size()); - return GeomTouchesPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + return GeomTouchesPhysicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/GeomUnaryUnionPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/GeomUnaryUnionPhysicalFunction.cpp index bfc68105ce..6d48da78fa 100644 --- a/nes-physical-operators/src/Functions/Meos/GeomUnaryUnionPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/GeomUnaryUnionPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -21,8 +22,10 @@ #include #include #include +#include #include #include +#include #include #include @@ -33,39 +36,55 @@ extern "C" { namespace NES { -GeomUnaryUnionPhysicalFunction::GeomUnaryUnionPhysicalFunction(PhysicalFunction wkt) +GeomUnaryUnionPhysicalFunction::GeomUnaryUnionPhysicalFunction(PhysicalFunction wktFunction) { - paramFns.reserve(1); - paramFns.push_back(std::move(wkt)); + parameterFunctions.reserve(1); + parameterFunctions.push_back(std::move(wktFunction)); } VarVal GeomUnaryUnionPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto wkt = paramFns[0].execute(record, arena).cast(); - constexpr uint32_t MAX_LEN = 8192; + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto wkt = parameterValues[0].cast(); + + constexpr uint32_t MAX_LEN = 4096; auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); const auto actualLen = nautilus::invoke( - +[](const char* wkt, uint32_t wsz, char* buf, uint32_t bufMax) -> uint32_t { - try { + +[](const char* wktPtr, uint32_t wktSize, + char* buf, + uint32_t bufMax) -> uint32_t { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string s(wkt, wsz); - GSERIALIZED* gs = geom_in(s.c_str(), -1); - if (!gs) return 0u; - GSERIALIZED* result = geom_unary_union(gs, 0.0); - free(gs); - if (!result) return 0u; - char* out = geo_as_text(result, -1); - free(result); + std::string tempS(wktPtr, wktSize); + GSERIALIZED* temp = geom_in(tempS.c_str(), -1); + if (!temp) return 0u; + + GSERIALIZED* gres = geom_unary_union(temp); + free(temp); + if (!gres) return 0u; + char* out = geo_as_text(gres, -1); + free(gres); if (!out) return 0u; uint32_t len = static_cast(strlen(out)); if (len > bufMax) len = bufMax; memcpy(buf, out, len); free(out); return len; - } catch (const std::exception&) { return 0u; } + } + catch (const std::exception&) + { + return 0u; + } }, - wkt, outBuf.getContent(), nautilus::val(8192)); + wkt.getContent(), wkt.getContentSize(), outBuf.getContent(), nautilus::val(MAX_LEN)); VarVal(actualLen).writeToMemory(outBuf.getReference()); return outBuf; @@ -77,8 +96,8 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterG PRECONDITION(arguments.childFunctions.size() == 1, "GeomUnaryUnionPhysicalFunction requires 1 children but got {}", arguments.childFunctions.size()); - return GeomUnaryUnionPhysicalFunction( - std::move(arguments.childFunctions[0])); + auto arg0 = std::move(arguments.childFunctions[0]); + return GeomUnaryUnionPhysicalFunction(std::move(arg0)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/H3indexCmpPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/H3indexCmpPhysicalFunction.cpp index 13a6b9d241..fd00b4557c 100644 --- a/nes-physical-operators/src/Functions/Meos/H3indexCmpPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/H3indexCmpPhysicalFunction.cpp @@ -13,14 +13,18 @@ */ #include + #include #include #include +#include #include #include #include #include +#include #include +#include #include #include @@ -31,25 +35,43 @@ extern "C" { namespace NES { -H3indexCmpPhysicalFunction::H3indexCmpPhysicalFunction(PhysicalFunction a, PhysicalFunction b) +H3indexCmpPhysicalFunction::H3indexCmpPhysicalFunction(PhysicalFunction aFunction, + PhysicalFunction bFunction) { - paramFns.reserve(2); - paramFns.push_back(std::move(a)); - paramFns.push_back(std::move(b)); + parameterFunctions.reserve(2); + parameterFunctions.push_back(std::move(aFunction)); + parameterFunctions.push_back(std::move(bFunction)); } VarVal H3indexCmpPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto a = paramFns[0].execute(record, arena).cast(); - auto b = paramFns[1].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto a = parameterValues[0].cast>(); + auto b = parameterValues[1].cast>(); + const auto result = nautilus::invoke( - +[](uint64_t a, uint64_t b) -> double { - try { + +[](uint64_t a, + uint64_t b) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - return (double)h3index_cmp((H3Index)a, (H3Index)b); - } catch (const std::exception&) { return 0.0; } + + double r = h3index_cmp((H3Index)a, (H3Index)b); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, a, b); + return VarVal(result); } @@ -59,9 +81,9 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterH PRECONDITION(arguments.childFunctions.size() == 2, "H3indexCmpPhysicalFunction requires 2 children but got {}", arguments.childFunctions.size()); - return H3indexCmpPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + return H3indexCmpPhysicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/H3indexEqPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/H3indexEqPhysicalFunction.cpp index ad35230f13..23b04d3ac3 100644 --- a/nes-physical-operators/src/Functions/Meos/H3indexEqPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/H3indexEqPhysicalFunction.cpp @@ -13,14 +13,18 @@ */ #include + #include #include #include +#include #include #include #include #include +#include #include +#include #include #include @@ -31,26 +35,43 @@ extern "C" { namespace NES { -H3indexEqPhysicalFunction::H3indexEqPhysicalFunction(PhysicalFunction a, PhysicalFunction b) +H3indexEqPhysicalFunction::H3indexEqPhysicalFunction(PhysicalFunction aFunction, + PhysicalFunction bFunction) { - paramFns.reserve(2); - paramFns.push_back(std::move(a)); - paramFns.push_back(std::move(b)); + parameterFunctions.reserve(2); + parameterFunctions.push_back(std::move(aFunction)); + parameterFunctions.push_back(std::move(bFunction)); } VarVal H3indexEqPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto a = paramFns[0].execute(record, arena).cast(); - auto b = paramFns[1].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto a = parameterValues[0].cast>(); + auto b = parameterValues[1].cast>(); + const auto result = nautilus::invoke( - +[](uint64_t a, uint64_t b) -> double { - try { + +[](uint64_t a, + uint64_t b) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - bool r = h3index_eq((H3Index)a, (H3Index)b); - return r ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + + double r = h3index_eq((H3Index)a, (H3Index)b); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, a, b); + return VarVal(result); } @@ -60,9 +81,9 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterH PRECONDITION(arguments.childFunctions.size() == 2, "H3indexEqPhysicalFunction requires 2 children but got {}", arguments.childFunctions.size()); - return H3indexEqPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + return H3indexEqPhysicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/H3indexGePhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/H3indexGePhysicalFunction.cpp index 2a3e75abac..728d4d84bf 100644 --- a/nes-physical-operators/src/Functions/Meos/H3indexGePhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/H3indexGePhysicalFunction.cpp @@ -13,14 +13,18 @@ */ #include + #include #include #include +#include #include #include #include #include +#include #include +#include #include #include @@ -31,26 +35,43 @@ extern "C" { namespace NES { -H3indexGePhysicalFunction::H3indexGePhysicalFunction(PhysicalFunction a, PhysicalFunction b) +H3indexGePhysicalFunction::H3indexGePhysicalFunction(PhysicalFunction aFunction, + PhysicalFunction bFunction) { - paramFns.reserve(2); - paramFns.push_back(std::move(a)); - paramFns.push_back(std::move(b)); + parameterFunctions.reserve(2); + parameterFunctions.push_back(std::move(aFunction)); + parameterFunctions.push_back(std::move(bFunction)); } VarVal H3indexGePhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto a = paramFns[0].execute(record, arena).cast(); - auto b = paramFns[1].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto a = parameterValues[0].cast>(); + auto b = parameterValues[1].cast>(); + const auto result = nautilus::invoke( - +[](uint64_t a, uint64_t b) -> double { - try { + +[](uint64_t a, + uint64_t b) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - bool r = h3index_ge((H3Index)a, (H3Index)b); - return r ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + + double r = h3index_ge((H3Index)a, (H3Index)b); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, a, b); + return VarVal(result); } @@ -60,9 +81,9 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterH PRECONDITION(arguments.childFunctions.size() == 2, "H3indexGePhysicalFunction requires 2 children but got {}", arguments.childFunctions.size()); - return H3indexGePhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + return H3indexGePhysicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/H3indexGtPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/H3indexGtPhysicalFunction.cpp index c7125d6c48..ad440191e1 100644 --- a/nes-physical-operators/src/Functions/Meos/H3indexGtPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/H3indexGtPhysicalFunction.cpp @@ -13,14 +13,18 @@ */ #include + #include #include #include +#include #include #include #include #include +#include #include +#include #include #include @@ -31,26 +35,43 @@ extern "C" { namespace NES { -H3indexGtPhysicalFunction::H3indexGtPhysicalFunction(PhysicalFunction a, PhysicalFunction b) +H3indexGtPhysicalFunction::H3indexGtPhysicalFunction(PhysicalFunction aFunction, + PhysicalFunction bFunction) { - paramFns.reserve(2); - paramFns.push_back(std::move(a)); - paramFns.push_back(std::move(b)); + parameterFunctions.reserve(2); + parameterFunctions.push_back(std::move(aFunction)); + parameterFunctions.push_back(std::move(bFunction)); } VarVal H3indexGtPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto a = paramFns[0].execute(record, arena).cast(); - auto b = paramFns[1].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto a = parameterValues[0].cast>(); + auto b = parameterValues[1].cast>(); + const auto result = nautilus::invoke( - +[](uint64_t a, uint64_t b) -> double { - try { + +[](uint64_t a, + uint64_t b) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - bool r = h3index_gt((H3Index)a, (H3Index)b); - return r ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + + double r = h3index_gt((H3Index)a, (H3Index)b); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, a, b); + return VarVal(result); } @@ -60,9 +81,9 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterH PRECONDITION(arguments.childFunctions.size() == 2, "H3indexGtPhysicalFunction requires 2 children but got {}", arguments.childFunctions.size()); - return H3indexGtPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + return H3indexGtPhysicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/H3indexLePhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/H3indexLePhysicalFunction.cpp index 36cc8f4658..9cf73bafd3 100644 --- a/nes-physical-operators/src/Functions/Meos/H3indexLePhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/H3indexLePhysicalFunction.cpp @@ -13,14 +13,18 @@ */ #include + #include #include #include +#include #include #include #include #include +#include #include +#include #include #include @@ -31,26 +35,43 @@ extern "C" { namespace NES { -H3indexLePhysicalFunction::H3indexLePhysicalFunction(PhysicalFunction a, PhysicalFunction b) +H3indexLePhysicalFunction::H3indexLePhysicalFunction(PhysicalFunction aFunction, + PhysicalFunction bFunction) { - paramFns.reserve(2); - paramFns.push_back(std::move(a)); - paramFns.push_back(std::move(b)); + parameterFunctions.reserve(2); + parameterFunctions.push_back(std::move(aFunction)); + parameterFunctions.push_back(std::move(bFunction)); } VarVal H3indexLePhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto a = paramFns[0].execute(record, arena).cast(); - auto b = paramFns[1].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto a = parameterValues[0].cast>(); + auto b = parameterValues[1].cast>(); + const auto result = nautilus::invoke( - +[](uint64_t a, uint64_t b) -> double { - try { + +[](uint64_t a, + uint64_t b) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - bool r = h3index_le((H3Index)a, (H3Index)b); - return r ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + + double r = h3index_le((H3Index)a, (H3Index)b); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, a, b); + return VarVal(result); } @@ -60,9 +81,9 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterH PRECONDITION(arguments.childFunctions.size() == 2, "H3indexLePhysicalFunction requires 2 children but got {}", arguments.childFunctions.size()); - return H3indexLePhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + return H3indexLePhysicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/H3indexLtPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/H3indexLtPhysicalFunction.cpp index b7d302be73..108ef6d80b 100644 --- a/nes-physical-operators/src/Functions/Meos/H3indexLtPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/H3indexLtPhysicalFunction.cpp @@ -13,14 +13,18 @@ */ #include + #include #include #include +#include #include #include #include #include +#include #include +#include #include #include @@ -31,26 +35,43 @@ extern "C" { namespace NES { -H3indexLtPhysicalFunction::H3indexLtPhysicalFunction(PhysicalFunction a, PhysicalFunction b) +H3indexLtPhysicalFunction::H3indexLtPhysicalFunction(PhysicalFunction aFunction, + PhysicalFunction bFunction) { - paramFns.reserve(2); - paramFns.push_back(std::move(a)); - paramFns.push_back(std::move(b)); + parameterFunctions.reserve(2); + parameterFunctions.push_back(std::move(aFunction)); + parameterFunctions.push_back(std::move(bFunction)); } VarVal H3indexLtPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto a = paramFns[0].execute(record, arena).cast(); - auto b = paramFns[1].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto a = parameterValues[0].cast>(); + auto b = parameterValues[1].cast>(); + const auto result = nautilus::invoke( - +[](uint64_t a, uint64_t b) -> double { - try { + +[](uint64_t a, + uint64_t b) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - bool r = h3index_lt((H3Index)a, (H3Index)b); - return r ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + + double r = h3index_lt((H3Index)a, (H3Index)b); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, a, b); + return VarVal(result); } @@ -60,9 +81,9 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterH PRECONDITION(arguments.childFunctions.size() == 2, "H3indexLtPhysicalFunction requires 2 children but got {}", arguments.childFunctions.size()); - return H3indexLtPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + return H3indexLtPhysicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/H3indexNePhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/H3indexNePhysicalFunction.cpp index 10b3891b6e..fa062c33bc 100644 --- a/nes-physical-operators/src/Functions/Meos/H3indexNePhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/H3indexNePhysicalFunction.cpp @@ -13,14 +13,18 @@ */ #include + #include #include #include +#include #include #include #include #include +#include #include +#include #include #include @@ -31,26 +35,43 @@ extern "C" { namespace NES { -H3indexNePhysicalFunction::H3indexNePhysicalFunction(PhysicalFunction a, PhysicalFunction b) +H3indexNePhysicalFunction::H3indexNePhysicalFunction(PhysicalFunction aFunction, + PhysicalFunction bFunction) { - paramFns.reserve(2); - paramFns.push_back(std::move(a)); - paramFns.push_back(std::move(b)); + parameterFunctions.reserve(2); + parameterFunctions.push_back(std::move(aFunction)); + parameterFunctions.push_back(std::move(bFunction)); } VarVal H3indexNePhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto a = paramFns[0].execute(record, arena).cast(); - auto b = paramFns[1].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto a = parameterValues[0].cast>(); + auto b = parameterValues[1].cast>(); + const auto result = nautilus::invoke( - +[](uint64_t a, uint64_t b) -> double { - try { + +[](uint64_t a, + uint64_t b) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - bool r = h3index_ne((H3Index)a, (H3Index)b); - return r ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + + double r = h3index_ne((H3Index)a, (H3Index)b); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, a, b); + return VarVal(result); } @@ -60,9 +81,9 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterH PRECONDITION(arguments.childFunctions.size() == 2, "H3indexNePhysicalFunction requires 2 children but got {}", arguments.childFunctions.size()); - return H3indexNePhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + return H3indexNePhysicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/H3indexOutPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/H3indexOutPhysicalFunction.cpp index d32838c3f2..fc292a70dc 100644 --- a/nes-physical-operators/src/Functions/Meos/H3indexOutPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/H3indexOutPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -21,7 +22,10 @@ #include #include #include +#include #include +#include +#include #include #include @@ -29,35 +33,51 @@ extern "C" { #include #include } -#include namespace NES { -H3indexOutPhysicalFunction::H3indexOutPhysicalFunction(PhysicalFunction cell) +H3indexOutPhysicalFunction::H3indexOutPhysicalFunction(PhysicalFunction cellFunction) { - paramFns.reserve(1); - paramFns.push_back(std::move(cell)); + parameterFunctions.reserve(1); + parameterFunctions.push_back(std::move(cellFunction)); } VarVal H3indexOutPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto cell = paramFns[0].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } - constexpr uint32_t MAX_LEN = 32; + auto cell = parameterValues[0].cast>(); + + constexpr uint32_t MAX_LEN = 4096; auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); const auto actualLen = nautilus::invoke( - +[](uint64_t cell, char* buf, uint32_t bufMax) -> uint32_t { - try { + +[](uint64_t cell, + char* buf, + uint32_t bufMax) -> uint32_t { + try + { MEOS::Meos::ensureMeosInitialized(); - char* hex = h3index_out((H3Index)cell); + + H3Index hcell = h3index_out((H3Index)cell); + if (hcell == 0) return 0u; + char* hex = h3index_out(hcell); if (!hex) return 0u; uint32_t len = static_cast(strlen(hex)); if (len > bufMax) len = bufMax; memcpy(buf, hex, len); free(hex); return len; - } catch (const std::exception&) { return 0u; } + } + catch (const std::exception&) + { + return 0u; + } }, cell, outBuf.getContent(), nautilus::val(MAX_LEN)); @@ -69,9 +89,10 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterH PhysicalFunctionRegistryArguments arguments) { PRECONDITION(arguments.childFunctions.size() == 1, - "H3indexOutPhysicalFunction requires 1 child but got {}", + "H3indexOutPhysicalFunction requires 1 children but got {}", arguments.childFunctions.size()); - return H3indexOutPhysicalFunction(std::move(arguments.childFunctions[0])); + auto arg0 = std::move(arguments.childFunctions[0]); + return H3indexOutPhysicalFunction(std::move(arg0)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/IntspanLowerIncPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/IntspanLowerIncPhysicalFunction.cpp index f8292f7447..c1e30ff490 100644 --- a/nes-physical-operators/src/Functions/Meos/IntspanLowerIncPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/IntspanLowerIncPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -21,49 +22,66 @@ #include #include #include +#include #include +#include #include #include extern "C" { #include } -#include -#include namespace NES { -IntspanLowerIncPhysicalFunction::IntspanLowerIncPhysicalFunction(PhysicalFunction sp) { - paramFns.reserve(1); - paramFns.push_back(std::move(sp)); +IntspanLowerIncPhysicalFunction::IntspanLowerIncPhysicalFunction(PhysicalFunction spFunction) +{ + parameterFunctions.reserve(1); + parameterFunctions.push_back(std::move(spFunction)); } -VarVal IntspanLowerIncPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto sp = paramFns[0].execute(record, arena).cast(); +VarVal IntspanLowerIncPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto sp = parameterValues[0].cast(); + const auto result = nautilus::invoke( - +[](const char* w, uint32_t wsz) -> double { - try { + +[](const char* spPtr, uint32_t spSize) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string s(w, wsz); - Span* sp = intspan_in(s.c_str()); - if (!sp) return 0.0; - bool r = span_lower_inc(sp); - free(sp); - return r ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + std::string tempS(spPtr, spSize); + Span* temp = intspan_in(tempS.c_str()); + if (!temp) return 0.0; + + double r = span_lower_inc(temp); + free(temp); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, - sp); + sp.getContent(), sp.getContentSize()); + return VarVal(result); } PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterIntspanLowerIncPhysicalFunction( PhysicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.childFunctions.size()==1, + PRECONDITION(arguments.childFunctions.size() == 1, "IntspanLowerIncPhysicalFunction requires 1 children but got {}", arguments.childFunctions.size()); - return IntspanLowerIncPhysicalFunction( - std::move(arguments.childFunctions[0])); + auto arg0 = std::move(arguments.childFunctions[0]); + return IntspanLowerIncPhysicalFunction(std::move(arg0)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/IntspanLowerPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/IntspanLowerPhysicalFunction.cpp index 8d30564a7f..e62d8e4616 100644 --- a/nes-physical-operators/src/Functions/Meos/IntspanLowerPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/IntspanLowerPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -21,49 +22,66 @@ #include #include #include +#include #include +#include #include #include extern "C" { #include } -#include -#include namespace NES { -IntspanLowerPhysicalFunction::IntspanLowerPhysicalFunction(PhysicalFunction sp) { - paramFns.reserve(1); - paramFns.push_back(std::move(sp)); +IntspanLowerPhysicalFunction::IntspanLowerPhysicalFunction(PhysicalFunction spFunction) +{ + parameterFunctions.reserve(1); + parameterFunctions.push_back(std::move(spFunction)); } -VarVal IntspanLowerPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto sp = paramFns[0].execute(record, arena).cast(); +VarVal IntspanLowerPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto sp = parameterValues[0].cast(); + const auto result = nautilus::invoke( - +[](const char* w, uint32_t wsz) -> double { - try { + +[](const char* spPtr, uint32_t spSize) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string s(w, wsz); - Span* sp = intspan_in(s.c_str()); - if (!sp) return 0.0; - double r = (double)intspan_lower(sp); - free(sp); + std::string tempS(spPtr, spSize); + Span* temp = intspan_in(tempS.c_str()); + if (!temp) return 0.0; + + double r = intspan_lower(temp); + free(temp); return r; - } catch (const std::exception&) { return 0.0; } + } + catch (const std::exception&) + { + return 0.0; + } }, - sp); + sp.getContent(), sp.getContentSize()); + return VarVal(result); } PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterIntspanLowerPhysicalFunction( PhysicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.childFunctions.size()==1, + PRECONDITION(arguments.childFunctions.size() == 1, "IntspanLowerPhysicalFunction requires 1 children but got {}", arguments.childFunctions.size()); - return IntspanLowerPhysicalFunction( - std::move(arguments.childFunctions[0])); + auto arg0 = std::move(arguments.childFunctions[0]); + return IntspanLowerPhysicalFunction(std::move(arg0)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/IntspanUpperIncPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/IntspanUpperIncPhysicalFunction.cpp index db8019ddd3..5110220fff 100644 --- a/nes-physical-operators/src/Functions/Meos/IntspanUpperIncPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/IntspanUpperIncPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -21,49 +22,66 @@ #include #include #include +#include #include +#include #include #include extern "C" { #include } -#include -#include namespace NES { -IntspanUpperIncPhysicalFunction::IntspanUpperIncPhysicalFunction(PhysicalFunction sp) { - paramFns.reserve(1); - paramFns.push_back(std::move(sp)); +IntspanUpperIncPhysicalFunction::IntspanUpperIncPhysicalFunction(PhysicalFunction spFunction) +{ + parameterFunctions.reserve(1); + parameterFunctions.push_back(std::move(spFunction)); } -VarVal IntspanUpperIncPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto sp = paramFns[0].execute(record, arena).cast(); +VarVal IntspanUpperIncPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto sp = parameterValues[0].cast(); + const auto result = nautilus::invoke( - +[](const char* w, uint32_t wsz) -> double { - try { + +[](const char* spPtr, uint32_t spSize) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string s(w, wsz); - Span* sp = intspan_in(s.c_str()); - if (!sp) return 0.0; - bool r = span_upper_inc(sp); - free(sp); - return r ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + std::string tempS(spPtr, spSize); + Span* temp = intspan_in(tempS.c_str()); + if (!temp) return 0.0; + + double r = span_upper_inc(temp); + free(temp); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, - sp); + sp.getContent(), sp.getContentSize()); + return VarVal(result); } PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterIntspanUpperIncPhysicalFunction( PhysicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.childFunctions.size()==1, + PRECONDITION(arguments.childFunctions.size() == 1, "IntspanUpperIncPhysicalFunction requires 1 children but got {}", arguments.childFunctions.size()); - return IntspanUpperIncPhysicalFunction( - std::move(arguments.childFunctions[0])); + auto arg0 = std::move(arguments.childFunctions[0]); + return IntspanUpperIncPhysicalFunction(std::move(arg0)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/IntspanUpperPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/IntspanUpperPhysicalFunction.cpp index 525d717bb5..d29da96aac 100644 --- a/nes-physical-operators/src/Functions/Meos/IntspanUpperPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/IntspanUpperPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -21,49 +22,66 @@ #include #include #include +#include #include +#include #include #include extern "C" { #include } -#include -#include namespace NES { -IntspanUpperPhysicalFunction::IntspanUpperPhysicalFunction(PhysicalFunction sp) { - paramFns.reserve(1); - paramFns.push_back(std::move(sp)); +IntspanUpperPhysicalFunction::IntspanUpperPhysicalFunction(PhysicalFunction spFunction) +{ + parameterFunctions.reserve(1); + parameterFunctions.push_back(std::move(spFunction)); } -VarVal IntspanUpperPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto sp = paramFns[0].execute(record, arena).cast(); +VarVal IntspanUpperPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto sp = parameterValues[0].cast(); + const auto result = nautilus::invoke( - +[](const char* w, uint32_t wsz) -> double { - try { + +[](const char* spPtr, uint32_t spSize) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string s(w, wsz); - Span* sp = intspan_in(s.c_str()); - if (!sp) return 0.0; - double r = (double)intspan_upper(sp); - free(sp); + std::string tempS(spPtr, spSize); + Span* temp = intspan_in(tempS.c_str()); + if (!temp) return 0.0; + + double r = intspan_upper(temp); + free(temp); return r; - } catch (const std::exception&) { return 0.0; } + } + catch (const std::exception&) + { + return 0.0; + } }, - sp); + sp.getContent(), sp.getContentSize()); + return VarVal(result); } PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterIntspanUpperPhysicalFunction( PhysicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.childFunctions.size()==1, + PRECONDITION(arguments.childFunctions.size() == 1, "IntspanUpperPhysicalFunction requires 1 children but got {}", arguments.childFunctions.size()); - return IntspanUpperPhysicalFunction( - std::move(arguments.childFunctions[0])); + auto arg0 = std::move(arguments.childFunctions[0]); + return IntspanUpperPhysicalFunction(std::move(arg0)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/IntspanWidthPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/IntspanWidthPhysicalFunction.cpp index f869f833f1..74e89fd6b0 100644 --- a/nes-physical-operators/src/Functions/Meos/IntspanWidthPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/IntspanWidthPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -21,49 +22,66 @@ #include #include #include +#include #include +#include #include #include extern "C" { #include } -#include -#include namespace NES { -IntspanWidthPhysicalFunction::IntspanWidthPhysicalFunction(PhysicalFunction sp) { - paramFns.reserve(1); - paramFns.push_back(std::move(sp)); +IntspanWidthPhysicalFunction::IntspanWidthPhysicalFunction(PhysicalFunction spFunction) +{ + parameterFunctions.reserve(1); + parameterFunctions.push_back(std::move(spFunction)); } -VarVal IntspanWidthPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto sp = paramFns[0].execute(record, arena).cast(); +VarVal IntspanWidthPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto sp = parameterValues[0].cast(); + const auto result = nautilus::invoke( - +[](const char* w, uint32_t wsz) -> double { - try { + +[](const char* spPtr, uint32_t spSize) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string s(w, wsz); - Span* sp = intspan_in(s.c_str()); - if (!sp) return 0.0; - double r = (double)intspan_width(sp); - free(sp); + std::string tempS(spPtr, spSize); + Span* temp = intspan_in(tempS.c_str()); + if (!temp) return 0.0; + + double r = intspan_width(temp); + free(temp); return r; - } catch (const std::exception&) { return 0.0; } + } + catch (const std::exception&) + { + return 0.0; + } }, - sp); + sp.getContent(), sp.getContentSize()); + return VarVal(result); } PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterIntspanWidthPhysicalFunction( PhysicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.childFunctions.size()==1, + PRECONDITION(arguments.childFunctions.size() == 1, "IntspanWidthPhysicalFunction requires 1 children but got {}", arguments.childFunctions.size()); - return IntspanWidthPhysicalFunction( - std::move(arguments.childFunctions[0])); + auto arg0 = std::move(arguments.childFunctions[0]); + return IntspanWidthPhysicalFunction(std::move(arg0)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/JsonbArrayElementTextPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/JsonbArrayElementTextPhysicalFunction.cpp index d8d985a96c..4abc81b574 100644 --- a/nes-physical-operators/src/Functions/Meos/JsonbArrayElementTextPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/JsonbArrayElementTextPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -21,7 +22,10 @@ #include #include #include +#include #include +#include +#include #include #include @@ -29,44 +33,63 @@ extern "C" { #include #include } -#include -#include namespace NES { -JsonbArrayElementTextPhysicalFunction::JsonbArrayElementTextPhysicalFunction(PhysicalFunction jb, PhysicalFunction idx) { - paramFns.reserve(2); - paramFns.push_back(std::move(jb)); - paramFns.push_back(std::move(idx)); +JsonbArrayElementTextPhysicalFunction::JsonbArrayElementTextPhysicalFunction(PhysicalFunction jbFunction, + PhysicalFunction arg0Function) +{ + parameterFunctions.reserve(2); + parameterFunctions.push_back(std::move(jbFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } -VarVal JsonbArrayElementTextPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto jb = paramFns[0].execute(record, arena).cast(); - auto idx = paramFns[1].execute(record, arena).cast(); +VarVal JsonbArrayElementTextPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto jb = parameterValues[0].cast(); + auto arg0 = parameterValues[1].cast>(); + constexpr uint32_t MAX_LEN = 4096; auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); + const auto actualLen = nautilus::invoke( - +[](const char* w, uint32_t wsz, double idx_d, - char* buf, uint32_t bufMax) -> uint32_t { - try { + +[](const char* jbPtr, uint32_t jbSize, + double arg0, + char* buf, + uint32_t bufMax) -> uint32_t { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string s(w, wsz); - Jsonb* jb = jsonb_in(s.c_str()); - if (!jb) return 0u; - text* res = jsonb_array_element_text(jb, (int)idx_d); - free(jb); - if (!res) return 0u; - char* out = text_to_cstring(res); - free(res); + std::string tempS(jbPtr, jbSize); + Jsonb* temp = jsonb_in(tempS.c_str()); + if (!temp) return 0u; + + text* tres = jsonb_array_element_text(temp, (int)idx_d); + free(temp); + if (!tres) return 0u; + char* out = text_to_cstring(tres); + free(tres); if (!out) return 0u; uint32_t len = static_cast(strlen(out)); if (len > bufMax) len = bufMax; memcpy(buf, out, len); free(out); return len; - } catch (const std::exception&) { return 0u; } + } + catch (const std::exception&) + { + return 0u; + } }, - jb, idx, outBuf.getContent(), nautilus::val(MAX_LEN)); + jb.getContent(), jb.getContentSize(), arg0, outBuf.getContent(), nautilus::val(MAX_LEN)); + VarVal(actualLen).writeToMemory(outBuf.getReference()); return outBuf; } @@ -74,12 +97,12 @@ VarVal JsonbArrayElementTextPhysicalFunction::execute(const Record& record, Aren PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterJsonbArrayElementTextPhysicalFunction( PhysicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.childFunctions.size()==2, + PRECONDITION(arguments.childFunctions.size() == 2, "JsonbArrayElementTextPhysicalFunction requires 2 children but got {}", arguments.childFunctions.size()); - return JsonbArrayElementTextPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + return JsonbArrayElementTextPhysicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/JsonbArrayLengthPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/JsonbArrayLengthPhysicalFunction.cpp index 96316e05a9..7c133b0b80 100644 --- a/nes-physical-operators/src/Functions/Meos/JsonbArrayLengthPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/JsonbArrayLengthPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -21,7 +22,9 @@ #include #include #include +#include #include +#include #include #include @@ -29,42 +32,57 @@ extern "C" { #include #include } -#include -#include namespace NES { -JsonbArrayLengthPhysicalFunction::JsonbArrayLengthPhysicalFunction(PhysicalFunction jb) { - paramFns.reserve(1); - paramFns.push_back(std::move(jb)); +JsonbArrayLengthPhysicalFunction::JsonbArrayLengthPhysicalFunction(PhysicalFunction jbFunction) +{ + parameterFunctions.reserve(1); + parameterFunctions.push_back(std::move(jbFunction)); } -VarVal JsonbArrayLengthPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto jb = paramFns[0].execute(record, arena).cast(); +VarVal JsonbArrayLengthPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto jb = parameterValues[0].cast(); + const auto result = nautilus::invoke( - +[](const char* w, uint32_t wsz) -> double { - try { + +[](const char* jbPtr, uint32_t jbSize) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string s(w, wsz); - Jsonb* jb = jsonb_in(s.c_str()); - if (!jb) return 0.0; - int r = jsonb_array_length(jb); - free(jb); - return (double)r; - } catch (const std::exception&) { return 0.0; } + std::string tempS(jbPtr, jbSize); + Jsonb* temp = jsonb_in(tempS.c_str()); + if (!temp) return 0.0; + + double r = jsonb_array_length(temp); + free(temp); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, - jb); + jb.getContent(), jb.getContentSize()); + return VarVal(result); } PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterJsonbArrayLengthPhysicalFunction( PhysicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.childFunctions.size()==1, + PRECONDITION(arguments.childFunctions.size() == 1, "JsonbArrayLengthPhysicalFunction requires 1 children but got {}", arguments.childFunctions.size()); - return JsonbArrayLengthPhysicalFunction( - std::move(arguments.childFunctions[0])); + auto arg0 = std::move(arguments.childFunctions[0]); + return JsonbArrayLengthPhysicalFunction(std::move(arg0)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/JsonbCmpPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/JsonbCmpPhysicalFunction.cpp index 4c4a40666b..b00b2aa063 100644 --- a/nes-physical-operators/src/Functions/Meos/JsonbCmpPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/JsonbCmpPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -21,7 +22,9 @@ #include #include #include +#include #include +#include #include #include @@ -29,47 +32,66 @@ extern "C" { #include #include } -#include -#include namespace NES { -JsonbCmpPhysicalFunction::JsonbCmpPhysicalFunction(PhysicalFunction jb1, PhysicalFunction jb2) { - paramFns.reserve(2); - paramFns.push_back(std::move(jb1)); - paramFns.push_back(std::move(jb2)); +JsonbCmpPhysicalFunction::JsonbCmpPhysicalFunction(PhysicalFunction jbFunction, + PhysicalFunction arg0Function) +{ + parameterFunctions.reserve(2); + parameterFunctions.push_back(std::move(jbFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } -VarVal JsonbCmpPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto jb1 = paramFns[0].execute(record, arena).cast(); - auto jb2 = paramFns[1].execute(record, arena).cast(); +VarVal JsonbCmpPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto jb = parameterValues[0].cast(); + auto arg0 = parameterValues[1].cast(); + const auto result = nautilus::invoke( - +[](const char* w1, uint32_t w1sz, const char* w2, uint32_t w2sz) -> double { - try { + +[](const char* jbPtr, uint32_t jbSize, + const char* arg0Ptr, uint32_t arg0Size) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string s1(w1,w1sz), s2(w2,w2sz); - Jsonb* jb1 = jsonb_in(s1.c_str()); - if (!jb1) return 0.0; - Jsonb* jb2 = jsonb_in(s2.c_str()); - if (!jb2) { free(jb1); return 0.0; } - double r = (double)jsonb_cmp(jb1, jb2); - free(jb1); free(jb2); + std::string tempS(jbPtr, jbSize); + Jsonb* temp = jsonb_in(tempS.c_str()); + if (!temp) return 0.0; + std::string arg0S(arg0Ptr, arg0Size); + Jsonb* jb0 = jsonb_in(arg0S.c_str()); + if (!jb0) { free(temp); return 0.0; } + + double r = jsonb_cmp(temp, jb0); + free(temp); + free(jb0); return r; - } catch (const std::exception&) { return 0.0; } + } + catch (const std::exception&) + { + return 0.0; + } }, - jb1, jb2); + jb.getContent(), jb.getContentSize(), arg0.getContent(), arg0.getContentSize()); + return VarVal(result); } PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterJsonbCmpPhysicalFunction( PhysicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.childFunctions.size()==2, + PRECONDITION(arguments.childFunctions.size() == 2, "JsonbCmpPhysicalFunction requires 2 children but got {}", arguments.childFunctions.size()); - return JsonbCmpPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + return JsonbCmpPhysicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/JsonbContainedPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/JsonbContainedPhysicalFunction.cpp index c2e4453730..24ceb01d77 100644 --- a/nes-physical-operators/src/Functions/Meos/JsonbContainedPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/JsonbContainedPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -21,7 +22,9 @@ #include #include #include +#include #include +#include #include #include @@ -29,47 +32,66 @@ extern "C" { #include #include } -#include -#include namespace NES { -JsonbContainedPhysicalFunction::JsonbContainedPhysicalFunction(PhysicalFunction jb1, PhysicalFunction jb2) { - paramFns.reserve(2); - paramFns.push_back(std::move(jb1)); - paramFns.push_back(std::move(jb2)); +JsonbContainedPhysicalFunction::JsonbContainedPhysicalFunction(PhysicalFunction jbFunction, + PhysicalFunction arg0Function) +{ + parameterFunctions.reserve(2); + parameterFunctions.push_back(std::move(jbFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } -VarVal JsonbContainedPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto jb1 = paramFns[0].execute(record, arena).cast(); - auto jb2 = paramFns[1].execute(record, arena).cast(); +VarVal JsonbContainedPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto jb = parameterValues[0].cast(); + auto arg0 = parameterValues[1].cast(); + const auto result = nautilus::invoke( - +[](const char* w1, uint32_t w1sz, const char* w2, uint32_t w2sz) -> double { - try { + +[](const char* jbPtr, uint32_t jbSize, + const char* arg0Ptr, uint32_t arg0Size) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string s1(w1,w1sz), s2(w2,w2sz); - Jsonb* jb1 = jsonb_in(s1.c_str()); - if (!jb1) return 0.0; - Jsonb* jb2 = jsonb_in(s2.c_str()); - if (!jb2) { free(jb1); return 0.0; } - bool r = jsonb_contained(jb1, jb2); - free(jb1); free(jb2); - return r ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + std::string tempS(jbPtr, jbSize); + Jsonb* temp = jsonb_in(tempS.c_str()); + if (!temp) return 0.0; + std::string arg0S(arg0Ptr, arg0Size); + Jsonb* jb0 = jsonb_in(arg0S.c_str()); + if (!jb0) { free(temp); return 0.0; } + + double r = jsonb_contained(temp, jb0); + free(temp); + free(jb0); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, - jb1, jb2); + jb.getContent(), jb.getContentSize(), arg0.getContent(), arg0.getContentSize()); + return VarVal(result); } PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterJsonbContainedPhysicalFunction( PhysicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.childFunctions.size()==2, + PRECONDITION(arguments.childFunctions.size() == 2, "JsonbContainedPhysicalFunction requires 2 children but got {}", arguments.childFunctions.size()); - return JsonbContainedPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + return JsonbContainedPhysicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/JsonbContainsPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/JsonbContainsPhysicalFunction.cpp index fde9b098c8..0751b8b0c3 100644 --- a/nes-physical-operators/src/Functions/Meos/JsonbContainsPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/JsonbContainsPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -21,7 +22,9 @@ #include #include #include +#include #include +#include #include #include @@ -29,47 +32,66 @@ extern "C" { #include #include } -#include -#include namespace NES { -JsonbContainsPhysicalFunction::JsonbContainsPhysicalFunction(PhysicalFunction jb1, PhysicalFunction jb2) { - paramFns.reserve(2); - paramFns.push_back(std::move(jb1)); - paramFns.push_back(std::move(jb2)); +JsonbContainsPhysicalFunction::JsonbContainsPhysicalFunction(PhysicalFunction jbFunction, + PhysicalFunction arg0Function) +{ + parameterFunctions.reserve(2); + parameterFunctions.push_back(std::move(jbFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } -VarVal JsonbContainsPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto jb1 = paramFns[0].execute(record, arena).cast(); - auto jb2 = paramFns[1].execute(record, arena).cast(); +VarVal JsonbContainsPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto jb = parameterValues[0].cast(); + auto arg0 = parameterValues[1].cast(); + const auto result = nautilus::invoke( - +[](const char* w1, uint32_t w1sz, const char* w2, uint32_t w2sz) -> double { - try { + +[](const char* jbPtr, uint32_t jbSize, + const char* arg0Ptr, uint32_t arg0Size) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string s1(w1,w1sz), s2(w2,w2sz); - Jsonb* jb1 = jsonb_in(s1.c_str()); - if (!jb1) return 0.0; - Jsonb* jb2 = jsonb_in(s2.c_str()); - if (!jb2) { free(jb1); return 0.0; } - bool r = jsonb_contains(jb1, jb2); - free(jb1); free(jb2); - return r ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + std::string tempS(jbPtr, jbSize); + Jsonb* temp = jsonb_in(tempS.c_str()); + if (!temp) return 0.0; + std::string arg0S(arg0Ptr, arg0Size); + Jsonb* jb0 = jsonb_in(arg0S.c_str()); + if (!jb0) { free(temp); return 0.0; } + + double r = jsonb_contains(temp, jb0); + free(temp); + free(jb0); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, - jb1, jb2); + jb.getContent(), jb.getContentSize(), arg0.getContent(), arg0.getContentSize()); + return VarVal(result); } PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterJsonbContainsPhysicalFunction( PhysicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.childFunctions.size()==2, + PRECONDITION(arguments.childFunctions.size() == 2, "JsonbContainsPhysicalFunction requires 2 children but got {}", arguments.childFunctions.size()); - return JsonbContainsPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + return JsonbContainsPhysicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/JsonbEqPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/JsonbEqPhysicalFunction.cpp index 9deb0b0086..1560b6d5e2 100644 --- a/nes-physical-operators/src/Functions/Meos/JsonbEqPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/JsonbEqPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -21,7 +22,9 @@ #include #include #include +#include #include +#include #include #include @@ -29,47 +32,66 @@ extern "C" { #include #include } -#include -#include namespace NES { -JsonbEqPhysicalFunction::JsonbEqPhysicalFunction(PhysicalFunction jb1, PhysicalFunction jb2) { - paramFns.reserve(2); - paramFns.push_back(std::move(jb1)); - paramFns.push_back(std::move(jb2)); +JsonbEqPhysicalFunction::JsonbEqPhysicalFunction(PhysicalFunction jbFunction, + PhysicalFunction arg0Function) +{ + parameterFunctions.reserve(2); + parameterFunctions.push_back(std::move(jbFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } -VarVal JsonbEqPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto jb1 = paramFns[0].execute(record, arena).cast(); - auto jb2 = paramFns[1].execute(record, arena).cast(); +VarVal JsonbEqPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto jb = parameterValues[0].cast(); + auto arg0 = parameterValues[1].cast(); + const auto result = nautilus::invoke( - +[](const char* w1, uint32_t w1sz, const char* w2, uint32_t w2sz) -> double { - try { + +[](const char* jbPtr, uint32_t jbSize, + const char* arg0Ptr, uint32_t arg0Size) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string s1(w1,w1sz), s2(w2,w2sz); - Jsonb* jb1 = jsonb_in(s1.c_str()); - if (!jb1) return 0.0; - Jsonb* jb2 = jsonb_in(s2.c_str()); - if (!jb2) { free(jb1); return 0.0; } - bool r = jsonb_eq(jb1, jb2); - free(jb1); free(jb2); - return r ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + std::string tempS(jbPtr, jbSize); + Jsonb* temp = jsonb_in(tempS.c_str()); + if (!temp) return 0.0; + std::string arg0S(arg0Ptr, arg0Size); + Jsonb* jb0 = jsonb_in(arg0S.c_str()); + if (!jb0) { free(temp); return 0.0; } + + double r = jsonb_eq(temp, jb0); + free(temp); + free(jb0); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, - jb1, jb2); + jb.getContent(), jb.getContentSize(), arg0.getContent(), arg0.getContentSize()); + return VarVal(result); } PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterJsonbEqPhysicalFunction( PhysicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.childFunctions.size()==2, + PRECONDITION(arguments.childFunctions.size() == 2, "JsonbEqPhysicalFunction requires 2 children but got {}", arguments.childFunctions.size()); - return JsonbEqPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + return JsonbEqPhysicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/JsonbExistsPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/JsonbExistsPhysicalFunction.cpp index 94e38788b1..d919fcd24d 100644 --- a/nes-physical-operators/src/Functions/Meos/JsonbExistsPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/JsonbExistsPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -21,7 +22,9 @@ #include #include #include +#include #include +#include #include #include @@ -29,46 +32,68 @@ extern "C" { #include #include } -#include -#include namespace NES { -JsonbExistsPhysicalFunction::JsonbExistsPhysicalFunction(PhysicalFunction jb, PhysicalFunction key) { - paramFns.reserve(2); - paramFns.push_back(std::move(jb)); - paramFns.push_back(std::move(key)); +JsonbExistsPhysicalFunction::JsonbExistsPhysicalFunction(PhysicalFunction jbFunction, + PhysicalFunction arg0Function) +{ + parameterFunctions.reserve(2); + parameterFunctions.push_back(std::move(jbFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } -VarVal JsonbExistsPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto jb = paramFns[0].execute(record, arena).cast(); - auto key = paramFns[1].execute(record, arena).cast(); +VarVal JsonbExistsPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto jb = parameterValues[0].cast(); + auto arg0 = parameterValues[1].cast(); + const auto result = nautilus::invoke( - +[](const char* wj, uint32_t wjsz, const char* wk, uint32_t wksz) -> double { - try { + +[](const char* jbPtr, uint32_t jbSize, + const char* arg0Ptr, uint32_t arg0Size) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string sj(wj,wjsz), sk(wk,wksz); - Jsonb* jb = jsonb_in(sj.c_str()); - if (!jb) return 0.0; - text* key = cstring_to_text(sk.c_str()); - bool r = jsonb_exists(jb, key); - free(jb); free(key); - return r ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + std::string tempS(jbPtr, jbSize); + Jsonb* temp = jsonb_in(tempS.c_str()); + if (!temp) return 0.0; + std::string arg0S(arg0Ptr, arg0Size); + while (!arg0S.empty() && (arg0S.front() == '\'' || arg0S.front() == '"')) arg0S.erase(arg0S.begin()); + while (!arg0S.empty() && (arg0S.back() == '\'' || arg0S.back() == '"')) arg0S.pop_back(); + text* txt0 = cstring_to_text(arg0S.c_str()); + if (!txt0) { free(temp); return 0.0; } + + double r = jsonb_exists(temp, txt0); + free(temp); + free(txt0); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, - jb, key); + jb.getContent(), jb.getContentSize(), arg0.getContent(), arg0.getContentSize()); + return VarVal(result); } PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterJsonbExistsPhysicalFunction( PhysicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.childFunctions.size()==2, + PRECONDITION(arguments.childFunctions.size() == 2, "JsonbExistsPhysicalFunction requires 2 children but got {}", arguments.childFunctions.size()); - return JsonbExistsPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + return JsonbExistsPhysicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/JsonbGePhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/JsonbGePhysicalFunction.cpp index 1c6f252e94..0a6d886d5f 100644 --- a/nes-physical-operators/src/Functions/Meos/JsonbGePhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/JsonbGePhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -21,7 +22,9 @@ #include #include #include +#include #include +#include #include #include @@ -29,47 +32,66 @@ extern "C" { #include #include } -#include -#include namespace NES { -JsonbGePhysicalFunction::JsonbGePhysicalFunction(PhysicalFunction jb1, PhysicalFunction jb2) { - paramFns.reserve(2); - paramFns.push_back(std::move(jb1)); - paramFns.push_back(std::move(jb2)); +JsonbGePhysicalFunction::JsonbGePhysicalFunction(PhysicalFunction jbFunction, + PhysicalFunction arg0Function) +{ + parameterFunctions.reserve(2); + parameterFunctions.push_back(std::move(jbFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } -VarVal JsonbGePhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto jb1 = paramFns[0].execute(record, arena).cast(); - auto jb2 = paramFns[1].execute(record, arena).cast(); +VarVal JsonbGePhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto jb = parameterValues[0].cast(); + auto arg0 = parameterValues[1].cast(); + const auto result = nautilus::invoke( - +[](const char* w1, uint32_t w1sz, const char* w2, uint32_t w2sz) -> double { - try { + +[](const char* jbPtr, uint32_t jbSize, + const char* arg0Ptr, uint32_t arg0Size) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string s1(w1,w1sz), s2(w2,w2sz); - Jsonb* jb1 = jsonb_in(s1.c_str()); - if (!jb1) return 0.0; - Jsonb* jb2 = jsonb_in(s2.c_str()); - if (!jb2) { free(jb1); return 0.0; } - bool r = jsonb_ge(jb1, jb2); - free(jb1); free(jb2); - return r ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + std::string tempS(jbPtr, jbSize); + Jsonb* temp = jsonb_in(tempS.c_str()); + if (!temp) return 0.0; + std::string arg0S(arg0Ptr, arg0Size); + Jsonb* jb0 = jsonb_in(arg0S.c_str()); + if (!jb0) { free(temp); return 0.0; } + + double r = jsonb_ge(temp, jb0); + free(temp); + free(jb0); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, - jb1, jb2); + jb.getContent(), jb.getContentSize(), arg0.getContent(), arg0.getContentSize()); + return VarVal(result); } PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterJsonbGePhysicalFunction( PhysicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.childFunctions.size()==2, + PRECONDITION(arguments.childFunctions.size() == 2, "JsonbGePhysicalFunction requires 2 children but got {}", arguments.childFunctions.size()); - return JsonbGePhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + return JsonbGePhysicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/JsonbGtPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/JsonbGtPhysicalFunction.cpp index 2268a7962c..cc33f1aa28 100644 --- a/nes-physical-operators/src/Functions/Meos/JsonbGtPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/JsonbGtPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -21,7 +22,9 @@ #include #include #include +#include #include +#include #include #include @@ -29,47 +32,66 @@ extern "C" { #include #include } -#include -#include namespace NES { -JsonbGtPhysicalFunction::JsonbGtPhysicalFunction(PhysicalFunction jb1, PhysicalFunction jb2) { - paramFns.reserve(2); - paramFns.push_back(std::move(jb1)); - paramFns.push_back(std::move(jb2)); +JsonbGtPhysicalFunction::JsonbGtPhysicalFunction(PhysicalFunction jbFunction, + PhysicalFunction arg0Function) +{ + parameterFunctions.reserve(2); + parameterFunctions.push_back(std::move(jbFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } -VarVal JsonbGtPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto jb1 = paramFns[0].execute(record, arena).cast(); - auto jb2 = paramFns[1].execute(record, arena).cast(); +VarVal JsonbGtPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto jb = parameterValues[0].cast(); + auto arg0 = parameterValues[1].cast(); + const auto result = nautilus::invoke( - +[](const char* w1, uint32_t w1sz, const char* w2, uint32_t w2sz) -> double { - try { + +[](const char* jbPtr, uint32_t jbSize, + const char* arg0Ptr, uint32_t arg0Size) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string s1(w1,w1sz), s2(w2,w2sz); - Jsonb* jb1 = jsonb_in(s1.c_str()); - if (!jb1) return 0.0; - Jsonb* jb2 = jsonb_in(s2.c_str()); - if (!jb2) { free(jb1); return 0.0; } - bool r = jsonb_gt(jb1, jb2); - free(jb1); free(jb2); - return r ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + std::string tempS(jbPtr, jbSize); + Jsonb* temp = jsonb_in(tempS.c_str()); + if (!temp) return 0.0; + std::string arg0S(arg0Ptr, arg0Size); + Jsonb* jb0 = jsonb_in(arg0S.c_str()); + if (!jb0) { free(temp); return 0.0; } + + double r = jsonb_gt(temp, jb0); + free(temp); + free(jb0); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, - jb1, jb2); + jb.getContent(), jb.getContentSize(), arg0.getContent(), arg0.getContentSize()); + return VarVal(result); } PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterJsonbGtPhysicalFunction( PhysicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.childFunctions.size()==2, + PRECONDITION(arguments.childFunctions.size() == 2, "JsonbGtPhysicalFunction requires 2 children but got {}", arguments.childFunctions.size()); - return JsonbGtPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + return JsonbGtPhysicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/JsonbLePhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/JsonbLePhysicalFunction.cpp index cf91c9a3fa..f094bdb8b0 100644 --- a/nes-physical-operators/src/Functions/Meos/JsonbLePhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/JsonbLePhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -21,7 +22,9 @@ #include #include #include +#include #include +#include #include #include @@ -29,47 +32,66 @@ extern "C" { #include #include } -#include -#include namespace NES { -JsonbLePhysicalFunction::JsonbLePhysicalFunction(PhysicalFunction jb1, PhysicalFunction jb2) { - paramFns.reserve(2); - paramFns.push_back(std::move(jb1)); - paramFns.push_back(std::move(jb2)); +JsonbLePhysicalFunction::JsonbLePhysicalFunction(PhysicalFunction jbFunction, + PhysicalFunction arg0Function) +{ + parameterFunctions.reserve(2); + parameterFunctions.push_back(std::move(jbFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } -VarVal JsonbLePhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto jb1 = paramFns[0].execute(record, arena).cast(); - auto jb2 = paramFns[1].execute(record, arena).cast(); +VarVal JsonbLePhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto jb = parameterValues[0].cast(); + auto arg0 = parameterValues[1].cast(); + const auto result = nautilus::invoke( - +[](const char* w1, uint32_t w1sz, const char* w2, uint32_t w2sz) -> double { - try { + +[](const char* jbPtr, uint32_t jbSize, + const char* arg0Ptr, uint32_t arg0Size) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string s1(w1,w1sz), s2(w2,w2sz); - Jsonb* jb1 = jsonb_in(s1.c_str()); - if (!jb1) return 0.0; - Jsonb* jb2 = jsonb_in(s2.c_str()); - if (!jb2) { free(jb1); return 0.0; } - bool r = jsonb_le(jb1, jb2); - free(jb1); free(jb2); - return r ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + std::string tempS(jbPtr, jbSize); + Jsonb* temp = jsonb_in(tempS.c_str()); + if (!temp) return 0.0; + std::string arg0S(arg0Ptr, arg0Size); + Jsonb* jb0 = jsonb_in(arg0S.c_str()); + if (!jb0) { free(temp); return 0.0; } + + double r = jsonb_le(temp, jb0); + free(temp); + free(jb0); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, - jb1, jb2); + jb.getContent(), jb.getContentSize(), arg0.getContent(), arg0.getContentSize()); + return VarVal(result); } PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterJsonbLePhysicalFunction( PhysicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.childFunctions.size()==2, + PRECONDITION(arguments.childFunctions.size() == 2, "JsonbLePhysicalFunction requires 2 children but got {}", arguments.childFunctions.size()); - return JsonbLePhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + return JsonbLePhysicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/JsonbLtPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/JsonbLtPhysicalFunction.cpp index 6e16640bc2..4a83a25b23 100644 --- a/nes-physical-operators/src/Functions/Meos/JsonbLtPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/JsonbLtPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -21,7 +22,9 @@ #include #include #include +#include #include +#include #include #include @@ -29,47 +32,66 @@ extern "C" { #include #include } -#include -#include namespace NES { -JsonbLtPhysicalFunction::JsonbLtPhysicalFunction(PhysicalFunction jb1, PhysicalFunction jb2) { - paramFns.reserve(2); - paramFns.push_back(std::move(jb1)); - paramFns.push_back(std::move(jb2)); +JsonbLtPhysicalFunction::JsonbLtPhysicalFunction(PhysicalFunction jbFunction, + PhysicalFunction arg0Function) +{ + parameterFunctions.reserve(2); + parameterFunctions.push_back(std::move(jbFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } -VarVal JsonbLtPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto jb1 = paramFns[0].execute(record, arena).cast(); - auto jb2 = paramFns[1].execute(record, arena).cast(); +VarVal JsonbLtPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto jb = parameterValues[0].cast(); + auto arg0 = parameterValues[1].cast(); + const auto result = nautilus::invoke( - +[](const char* w1, uint32_t w1sz, const char* w2, uint32_t w2sz) -> double { - try { + +[](const char* jbPtr, uint32_t jbSize, + const char* arg0Ptr, uint32_t arg0Size) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string s1(w1,w1sz), s2(w2,w2sz); - Jsonb* jb1 = jsonb_in(s1.c_str()); - if (!jb1) return 0.0; - Jsonb* jb2 = jsonb_in(s2.c_str()); - if (!jb2) { free(jb1); return 0.0; } - bool r = jsonb_lt(jb1, jb2); - free(jb1); free(jb2); - return r ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + std::string tempS(jbPtr, jbSize); + Jsonb* temp = jsonb_in(tempS.c_str()); + if (!temp) return 0.0; + std::string arg0S(arg0Ptr, arg0Size); + Jsonb* jb0 = jsonb_in(arg0S.c_str()); + if (!jb0) { free(temp); return 0.0; } + + double r = jsonb_lt(temp, jb0); + free(temp); + free(jb0); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, - jb1, jb2); + jb.getContent(), jb.getContentSize(), arg0.getContent(), arg0.getContentSize()); + return VarVal(result); } PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterJsonbLtPhysicalFunction( PhysicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.childFunctions.size()==2, + PRECONDITION(arguments.childFunctions.size() == 2, "JsonbLtPhysicalFunction requires 2 children but got {}", arguments.childFunctions.size()); - return JsonbLtPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + return JsonbLtPhysicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/JsonbNePhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/JsonbNePhysicalFunction.cpp index 2dafe77f76..fa45583296 100644 --- a/nes-physical-operators/src/Functions/Meos/JsonbNePhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/JsonbNePhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -21,7 +22,9 @@ #include #include #include +#include #include +#include #include #include @@ -29,47 +32,66 @@ extern "C" { #include #include } -#include -#include namespace NES { -JsonbNePhysicalFunction::JsonbNePhysicalFunction(PhysicalFunction jb1, PhysicalFunction jb2) { - paramFns.reserve(2); - paramFns.push_back(std::move(jb1)); - paramFns.push_back(std::move(jb2)); +JsonbNePhysicalFunction::JsonbNePhysicalFunction(PhysicalFunction jbFunction, + PhysicalFunction arg0Function) +{ + parameterFunctions.reserve(2); + parameterFunctions.push_back(std::move(jbFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } -VarVal JsonbNePhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto jb1 = paramFns[0].execute(record, arena).cast(); - auto jb2 = paramFns[1].execute(record, arena).cast(); +VarVal JsonbNePhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto jb = parameterValues[0].cast(); + auto arg0 = parameterValues[1].cast(); + const auto result = nautilus::invoke( - +[](const char* w1, uint32_t w1sz, const char* w2, uint32_t w2sz) -> double { - try { + +[](const char* jbPtr, uint32_t jbSize, + const char* arg0Ptr, uint32_t arg0Size) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string s1(w1,w1sz), s2(w2,w2sz); - Jsonb* jb1 = jsonb_in(s1.c_str()); - if (!jb1) return 0.0; - Jsonb* jb2 = jsonb_in(s2.c_str()); - if (!jb2) { free(jb1); return 0.0; } - bool r = jsonb_ne(jb1, jb2); - free(jb1); free(jb2); - return r ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + std::string tempS(jbPtr, jbSize); + Jsonb* temp = jsonb_in(tempS.c_str()); + if (!temp) return 0.0; + std::string arg0S(arg0Ptr, arg0Size); + Jsonb* jb0 = jsonb_in(arg0S.c_str()); + if (!jb0) { free(temp); return 0.0; } + + double r = jsonb_ne(temp, jb0); + free(temp); + free(jb0); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, - jb1, jb2); + jb.getContent(), jb.getContentSize(), arg0.getContent(), arg0.getContentSize()); + return VarVal(result); } PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterJsonbNePhysicalFunction( PhysicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.childFunctions.size()==2, + PRECONDITION(arguments.childFunctions.size() == 2, "JsonbNePhysicalFunction requires 2 children but got {}", arguments.childFunctions.size()); - return JsonbNePhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + return JsonbNePhysicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/JsonbObjectFieldTextPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/JsonbObjectFieldTextPhysicalFunction.cpp index 1dd63f6647..7190361f57 100644 --- a/nes-physical-operators/src/Functions/Meos/JsonbObjectFieldTextPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/JsonbObjectFieldTextPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -21,7 +22,10 @@ #include #include #include +#include #include +#include +#include #include #include @@ -29,45 +33,69 @@ extern "C" { #include #include } -#include -#include namespace NES { -JsonbObjectFieldTextPhysicalFunction::JsonbObjectFieldTextPhysicalFunction(PhysicalFunction jb, PhysicalFunction key) { - paramFns.reserve(2); - paramFns.push_back(std::move(jb)); - paramFns.push_back(std::move(key)); +JsonbObjectFieldTextPhysicalFunction::JsonbObjectFieldTextPhysicalFunction(PhysicalFunction jbFunction, + PhysicalFunction arg0Function) +{ + parameterFunctions.reserve(2); + parameterFunctions.push_back(std::move(jbFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } -VarVal JsonbObjectFieldTextPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto jb = paramFns[0].execute(record, arena).cast(); - auto key = paramFns[1].execute(record, arena).cast(); +VarVal JsonbObjectFieldTextPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto jb = parameterValues[0].cast(); + auto arg0 = parameterValues[1].cast(); + constexpr uint32_t MAX_LEN = 4096; auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); + const auto actualLen = nautilus::invoke( - +[](const char* wj, uint32_t wjsz, const char* wk, uint32_t wksz, - char* buf, uint32_t bufMax) -> uint32_t { - try { + +[](const char* jbPtr, uint32_t jbSize, + const char* arg0Ptr, uint32_t arg0Size, + char* buf, + uint32_t bufMax) -> uint32_t { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string sj(wj,wjsz), sk(wk,wksz); - Jsonb* jb = jsonb_in(sj.c_str()); - if (!jb) return 0u; - text* key = cstring_to_text(sk.c_str()); - text* res = jsonb_object_field_text(jb, key); - free(jb); free(key); - if (!res) return 0u; - char* out = text_to_cstring(res); - free(res); + std::string tempS(jbPtr, jbSize); + Jsonb* temp = jsonb_in(tempS.c_str()); + if (!temp) return 0u; + std::string arg0S(arg0Ptr, arg0Size); + while (!arg0S.empty() && (arg0S.front() == '\'' || arg0S.front() == '"')) arg0S.erase(arg0S.begin()); + while (!arg0S.empty() && (arg0S.back() == '\'' || arg0S.back() == '"')) arg0S.pop_back(); + text* txt0 = cstring_to_text(arg0S.c_str()); + if (!txt0) { free(temp); return 0u; } + + text* tres = jsonb_object_field_text(temp, txt0); + free(temp); + free(txt0); + if (!tres) return 0u; + char* out = text_to_cstring(tres); + free(tres); if (!out) return 0u; uint32_t len = static_cast(strlen(out)); if (len > bufMax) len = bufMax; memcpy(buf, out, len); free(out); return len; - } catch (const std::exception&) { return 0u; } + } + catch (const std::exception&) + { + return 0u; + } }, - jb, key, outBuf.getContent(), nautilus::val(MAX_LEN)); + jb.getContent(), jb.getContentSize(), arg0.getContent(), arg0.getContentSize(), outBuf.getContent(), nautilus::val(MAX_LEN)); + VarVal(actualLen).writeToMemory(outBuf.getReference()); return outBuf; } @@ -75,12 +103,12 @@ VarVal JsonbObjectFieldTextPhysicalFunction::execute(const Record& record, Arena PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterJsonbObjectFieldTextPhysicalFunction( PhysicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.childFunctions.size()==2, + PRECONDITION(arguments.childFunctions.size() == 2, "JsonbObjectFieldTextPhysicalFunction requires 2 children but got {}", arguments.childFunctions.size()); - return JsonbObjectFieldTextPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + return JsonbObjectFieldTextPhysicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/JsonbPrettyPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/JsonbPrettyPhysicalFunction.cpp index eec46372d1..8626c21a47 100644 --- a/nes-physical-operators/src/Functions/Meos/JsonbPrettyPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/JsonbPrettyPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -21,7 +22,10 @@ #include #include #include +#include #include +#include +#include #include #include @@ -29,41 +33,56 @@ extern "C" { #include #include } -#include -#include namespace NES { -JsonbPrettyPhysicalFunction::JsonbPrettyPhysicalFunction(PhysicalFunction jb) { - paramFns.reserve(1); - paramFns.push_back(std::move(jb)); +JsonbPrettyPhysicalFunction::JsonbPrettyPhysicalFunction(PhysicalFunction jbFunction) +{ + parameterFunctions.reserve(1); + parameterFunctions.push_back(std::move(jbFunction)); } -VarVal JsonbPrettyPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto jb = paramFns[0].execute(record, arena).cast(); +VarVal JsonbPrettyPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto jb = parameterValues[0].cast(); + constexpr uint32_t MAX_LEN = 4096; auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); + const auto actualLen = nautilus::invoke( - +[](const char* w, uint32_t wsz, char* buf, uint32_t bufMax) -> uint32_t { - try { + +[](const char* jbPtr, uint32_t jbSize, + char* buf, + uint32_t bufMax) -> uint32_t { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string s(w, wsz); - Jsonb* jb = jsonb_in(s.c_str()); - if (!jb) return 0u; - text* res = jsonb_pretty(jb); - free(jb); - if (!res) return 0u; - char* out = text_to_cstring(res); - free(res); + std::string tempS(jbPtr, jbSize); + Jsonb* temp = jsonb_in(tempS.c_str()); + if (!temp) return 0u; + + char* out = jsonb_pretty(temp); + free(temp); if (!out) return 0u; uint32_t len = static_cast(strlen(out)); if (len > bufMax) len = bufMax; memcpy(buf, out, len); free(out); return len; - } catch (const std::exception&) { return 0u; } + } + catch (const std::exception&) + { + return 0u; + } }, - jb, outBuf.getContent(), nautilus::val(MAX_LEN)); + jb.getContent(), jb.getContentSize(), outBuf.getContent(), nautilus::val(MAX_LEN)); + VarVal(actualLen).writeToMemory(outBuf.getReference()); return outBuf; } @@ -71,11 +90,11 @@ VarVal JsonbPrettyPhysicalFunction::execute(const Record& record, ArenaRef& aren PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterJsonbPrettyPhysicalFunction( PhysicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.childFunctions.size()==1, + PRECONDITION(arguments.childFunctions.size() == 1, "JsonbPrettyPhysicalFunction requires 1 children but got {}", arguments.childFunctions.size()); - return JsonbPrettyPhysicalFunction( - std::move(arguments.childFunctions[0])); + auto arg0 = std::move(arguments.childFunctions[0]); + return JsonbPrettyPhysicalFunction(std::move(arg0)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/JsonbToCstringPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/JsonbToCstringPhysicalFunction.cpp index c919b965ce..f6c78b6e86 100644 --- a/nes-physical-operators/src/Functions/Meos/JsonbToCstringPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/JsonbToCstringPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -21,7 +22,10 @@ #include #include #include +#include #include +#include +#include #include #include @@ -29,38 +33,56 @@ extern "C" { #include #include } -#include -#include namespace NES { -JsonbToCstringPhysicalFunction::JsonbToCstringPhysicalFunction(PhysicalFunction jb) { - paramFns.reserve(1); - paramFns.push_back(std::move(jb)); +JsonbToCstringPhysicalFunction::JsonbToCstringPhysicalFunction(PhysicalFunction jbFunction) +{ + parameterFunctions.reserve(1); + parameterFunctions.push_back(std::move(jbFunction)); } -VarVal JsonbToCstringPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto jb = paramFns[0].execute(record, arena).cast(); +VarVal JsonbToCstringPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto jb = parameterValues[0].cast(); + constexpr uint32_t MAX_LEN = 4096; auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); + const auto actualLen = nautilus::invoke( - +[](const char* w, uint32_t wsz, char* buf, uint32_t bufMax) -> uint32_t { - try { + +[](const char* jbPtr, uint32_t jbSize, + char* buf, + uint32_t bufMax) -> uint32_t { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string s(w, wsz); - Jsonb* jb = jsonb_in(s.c_str()); - if (!jb) return 0u; - char* out = jsonb_to_cstring(jb); - free(jb); + std::string tempS(jbPtr, jbSize); + Jsonb* temp = jsonb_in(tempS.c_str()); + if (!temp) return 0u; + + char* out = jsonb_to_cstring(temp); + free(temp); if (!out) return 0u; uint32_t len = static_cast(strlen(out)); if (len > bufMax) len = bufMax; memcpy(buf, out, len); free(out); return len; - } catch (const std::exception&) { return 0u; } + } + catch (const std::exception&) + { + return 0u; + } }, - jb, outBuf.getContent(), nautilus::val(MAX_LEN)); + jb.getContent(), jb.getContentSize(), outBuf.getContent(), nautilus::val(MAX_LEN)); + VarVal(actualLen).writeToMemory(outBuf.getReference()); return outBuf; } @@ -68,11 +90,11 @@ VarVal JsonbToCstringPhysicalFunction::execute(const Record& record, ArenaRef& a PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterJsonbToCstringPhysicalFunction( PhysicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.childFunctions.size()==1, + PRECONDITION(arguments.childFunctions.size() == 1, "JsonbToCstringPhysicalFunction requires 1 children but got {}", arguments.childFunctions.size()); - return JsonbToCstringPhysicalFunction( - std::move(arguments.childFunctions[0])); + auto arg0 = std::move(arguments.childFunctions[0]); + return JsonbToCstringPhysicalFunction(std::move(arg0)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/LineInterpolatePointPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/LineInterpolatePointPhysicalFunction.cpp index e1bd9be8a5..c99fc449ea 100644 --- a/nes-physical-operators/src/Functions/Meos/LineInterpolatePointPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/LineInterpolatePointPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -21,8 +22,10 @@ #include #include #include +#include #include #include +#include #include #include @@ -33,43 +36,59 @@ extern "C" { namespace NES { -LineInterpolatePointPhysicalFunction::LineInterpolatePointPhysicalFunction(PhysicalFunction wkt, PhysicalFunction frac, PhysicalFunction repeat) +LineInterpolatePointPhysicalFunction::LineInterpolatePointPhysicalFunction(PhysicalFunction wktFunction, + PhysicalFunction arg0Function) { - paramFns.reserve(3); - paramFns.push_back(std::move(wkt)); - paramFns.push_back(std::move(frac)); - paramFns.push_back(std::move(repeat)); + parameterFunctions.reserve(2); + parameterFunctions.push_back(std::move(wktFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } VarVal LineInterpolatePointPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto wkt = paramFns[0].execute(record, arena).cast(); - auto frac = paramFns[1].execute(record, arena).cast(); - auto repeat = paramFns[2].execute(record, arena).cast>(); - constexpr uint32_t MAX_LEN = 8192; + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto wkt = parameterValues[0].cast(); + auto arg0 = parameterValues[1].cast>(); + + constexpr uint32_t MAX_LEN = 4096; auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); const auto actualLen = nautilus::invoke( - +[](const char* w, uint32_t wsz, double frac, uint64_t repeat, char* buf, uint32_t bufMax) -> uint32_t { - try { + +[](const char* wktPtr, uint32_t wktSize, + double arg0, + char* buf, + uint32_t bufMax) -> uint32_t { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string s(w, wsz); - GSERIALIZED* gs = geom_in(s.c_str(), -1); - if (!gs) return 0u; - GSERIALIZED* result = line_interpolate_point(gs, frac, (bool)repeat); - free(gs); - if (!result) return 0u; - char* out = geo_as_text(result, -1); - free(result); + std::string tempS(wktPtr, wktSize); + GSERIALIZED* temp = geom_in(tempS.c_str(), -1); + if (!temp) return 0u; + + GSERIALIZED* gres = line_interpolate_point(temp, arg0); + free(temp); + if (!gres) return 0u; + char* out = geo_as_text(gres, -1); + free(gres); if (!out) return 0u; uint32_t len = static_cast(strlen(out)); if (len > bufMax) len = bufMax; memcpy(buf, out, len); free(out); return len; - } catch (const std::exception&) { return 0u; } + } + catch (const std::exception&) + { + return 0u; + } }, - wkt, frac, repeat, outBuf.getContent(), nautilus::val(MAX_LEN)); + wkt.getContent(), wkt.getContentSize(), arg0, outBuf.getContent(), nautilus::val(MAX_LEN)); VarVal(actualLen).writeToMemory(outBuf.getReference()); return outBuf; @@ -78,13 +97,12 @@ VarVal LineInterpolatePointPhysicalFunction::execute(const Record& record, Arena PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterLineInterpolatePointPhysicalFunction( PhysicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.childFunctions.size() == 3, - "LineInterpolatePointPhysicalFunction requires 3 children but got {}", + PRECONDITION(arguments.childFunctions.size() == 2, + "LineInterpolatePointPhysicalFunction requires 2 children but got {}", arguments.childFunctions.size()); - return LineInterpolatePointPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + return LineInterpolatePointPhysicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/LineLocatePointPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/LineLocatePointPhysicalFunction.cpp index 0f0e12b8bb..126b71771b 100644 --- a/nes-physical-operators/src/Functions/Meos/LineLocatePointPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/LineLocatePointPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -21,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -33,32 +35,51 @@ extern "C" { namespace NES { -LineLocatePointPhysicalFunction::LineLocatePointPhysicalFunction(PhysicalFunction wkt1, PhysicalFunction wkt2) +LineLocatePointPhysicalFunction::LineLocatePointPhysicalFunction(PhysicalFunction wktFunction, + PhysicalFunction arg0Function) { - paramFns.reserve(2); - paramFns.push_back(std::move(wkt1)); - paramFns.push_back(std::move(wkt2)); + parameterFunctions.reserve(2); + parameterFunctions.push_back(std::move(wktFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } VarVal LineLocatePointPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto wkt1 = paramFns[0].execute(record, arena).cast(); - auto wkt2 = paramFns[1].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto wkt = parameterValues[0].cast(); + auto arg0 = parameterValues[1].cast(); + const auto result = nautilus::invoke( - +[](const char* w1, uint32_t w1sz, const char* w2, uint32_t w2sz) -> double { - try { + +[](const char* wktPtr, uint32_t wktSize, + const char* arg0Ptr, uint32_t arg0Size) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string s1(w1, w1sz), s2(w2, w2sz); - GSERIALIZED* gs1 = geom_in(s1.c_str(), -1); - if (!gs1) return 0.0; - GSERIALIZED* gs2 = geom_in(s2.c_str(), -1); - if (!gs2) { free(gs1); return 0.0; } - double r = line_locate_point(gs1, gs2); - free(gs1); free(gs2); + std::string tempS(wktPtr, wktSize); + GSERIALIZED* temp = geom_in(tempS.c_str(), -1); + if (!temp) return 0.0; + std::string arg0S(arg0Ptr, arg0Size); + GSERIALIZED* gs0 = geom_in(arg0S.c_str(), -1); + if (!gs0) { free(temp); return 0.0; } + + double r = line_locate_point(temp, gs0); + free(temp); + free(gs0); return r; - } catch (const std::exception&) { return 0.0; } + } + catch (const std::exception&) + { + return 0.0; + } }, - wkt1, wkt2); + wkt.getContent(), wkt.getContentSize(), arg0.getContent(), arg0.getContentSize()); + return VarVal(result); } @@ -68,9 +89,9 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterL PRECONDITION(arguments.childFunctions.size() == 2, "LineLocatePointPhysicalFunction requires 2 children but got {}", arguments.childFunctions.size()); - return LineLocatePointPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + return LineLocatePointPhysicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/LineNumpointsPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/LineNumpointsPhysicalFunction.cpp index 97ca449b29..c9f2b28003 100644 --- a/nes-physical-operators/src/Functions/Meos/LineNumpointsPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/LineNumpointsPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -21,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -33,28 +35,43 @@ extern "C" { namespace NES { -LineNumpointsPhysicalFunction::LineNumpointsPhysicalFunction(PhysicalFunction wkt) +LineNumpointsPhysicalFunction::LineNumpointsPhysicalFunction(PhysicalFunction wktFunction) { - paramFns.reserve(1); - paramFns.push_back(std::move(wkt)); + parameterFunctions.reserve(1); + parameterFunctions.push_back(std::move(wktFunction)); } VarVal LineNumpointsPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto wkt = paramFns[0].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto wkt = parameterValues[0].cast(); + const auto result = nautilus::invoke( - +[](const char* w, uint32_t wsz) -> double { - try { + +[](const char* wktPtr, uint32_t wktSize) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string s(w, wsz); - GSERIALIZED* gs = geom_in(s.c_str(), -1); - if (!gs) return 0.0; - int n = line_numpoints(gs); - free(gs); - return (double)n; - } catch (const std::exception&) { return 0.0; } + std::string tempS(wktPtr, wktSize); + GSERIALIZED* temp = geom_in(tempS.c_str(), -1); + if (!temp) return 0.0; + + double r = line_numpoints(temp); + free(temp); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, - wkt); + wkt.getContent(), wkt.getContentSize()); + return VarVal(result); } @@ -64,8 +81,8 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterL PRECONDITION(arguments.childFunctions.size() == 1, "LineNumpointsPhysicalFunction requires 1 children but got {}", arguments.childFunctions.size()); - return LineNumpointsPhysicalFunction( - std::move(arguments.childFunctions[0])); + auto arg0 = std::move(arguments.childFunctions[0]); + return LineNumpointsPhysicalFunction(std::move(arg0)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/LinePointNPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/LinePointNPhysicalFunction.cpp index 4edece9170..230584109b 100644 --- a/nes-physical-operators/src/Functions/Meos/LinePointNPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/LinePointNPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -21,8 +22,10 @@ #include #include #include +#include #include #include +#include #include #include @@ -33,41 +36,59 @@ extern "C" { namespace NES { -LinePointNPhysicalFunction::LinePointNPhysicalFunction(PhysicalFunction wkt, PhysicalFunction n) +LinePointNPhysicalFunction::LinePointNPhysicalFunction(PhysicalFunction wktFunction, + PhysicalFunction arg0Function) { - paramFns.reserve(2); - paramFns.push_back(std::move(wkt)); - paramFns.push_back(std::move(n)); + parameterFunctions.reserve(2); + parameterFunctions.push_back(std::move(wktFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } VarVal LinePointNPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto wkt = paramFns[0].execute(record, arena).cast(); - auto n = paramFns[1].execute(record, arena).cast>(); - constexpr uint32_t MAX_LEN = 8192; + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto wkt = parameterValues[0].cast(); + auto arg0 = parameterValues[1].cast>(); + + constexpr uint32_t MAX_LEN = 4096; auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); const auto actualLen = nautilus::invoke( - +[](const char* w, uint32_t wsz, uint64_t n, char* buf, uint32_t bufMax) -> uint32_t { - try { + +[](const char* wktPtr, uint32_t wktSize, + double arg0, + char* buf, + uint32_t bufMax) -> uint32_t { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string s(w, wsz); - GSERIALIZED* gs = geom_in(s.c_str(), -1); - if (!gs) return 0u; - GSERIALIZED* result = line_point_n(gs, (int)n); - free(gs); - if (!result) return 0u; - char* out = geo_as_text(result, -1); - free(result); + std::string tempS(wktPtr, wktSize); + GSERIALIZED* temp = geom_in(tempS.c_str(), -1); + if (!temp) return 0u; + + GSERIALIZED* gres = line_point_n(temp, (int)arg0); + free(temp); + if (!gres) return 0u; + char* out = geo_as_text(gres, -1); + free(gres); if (!out) return 0u; uint32_t len = static_cast(strlen(out)); if (len > bufMax) len = bufMax; memcpy(buf, out, len); free(out); return len; - } catch (const std::exception&) { return 0u; } + } + catch (const std::exception&) + { + return 0u; + } }, - wkt, n, outBuf.getContent(), nautilus::val(MAX_LEN)); + wkt.getContent(), wkt.getContentSize(), arg0, outBuf.getContent(), nautilus::val(MAX_LEN)); VarVal(actualLen).writeToMemory(outBuf.getReference()); return outBuf; @@ -79,9 +100,9 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterL PRECONDITION(arguments.childFunctions.size() == 2, "LinePointNPhysicalFunction requires 2 children but got {}", arguments.childFunctions.size()); - return LinePointNPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + return LinePointNPhysicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/LineSubstringPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/LineSubstringPhysicalFunction.cpp index 94674a3bc2..ec77b78ab5 100644 --- a/nes-physical-operators/src/Functions/Meos/LineSubstringPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/LineSubstringPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -21,8 +22,10 @@ #include #include #include +#include #include #include +#include #include #include @@ -33,43 +36,63 @@ extern "C" { namespace NES { -LineSubstringPhysicalFunction::LineSubstringPhysicalFunction(PhysicalFunction wkt, PhysicalFunction from_f, PhysicalFunction to_f) +LineSubstringPhysicalFunction::LineSubstringPhysicalFunction(PhysicalFunction wktFunction, + PhysicalFunction arg0Function, + PhysicalFunction arg1Function) { - paramFns.reserve(3); - paramFns.push_back(std::move(wkt)); - paramFns.push_back(std::move(from_f)); - paramFns.push_back(std::move(to_f)); + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(wktFunction)); + parameterFunctions.push_back(std::move(arg0Function)); + parameterFunctions.push_back(std::move(arg1Function)); } VarVal LineSubstringPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto wkt = paramFns[0].execute(record, arena).cast(); - auto from_f = paramFns[1].execute(record, arena).cast(); - auto to_f = paramFns[2].execute(record, arena).cast(); - constexpr uint32_t MAX_LEN = 8192; + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto wkt = parameterValues[0].cast(); + auto arg0 = parameterValues[1].cast>(); + auto arg1 = parameterValues[2].cast>(); + + constexpr uint32_t MAX_LEN = 4096; auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); const auto actualLen = nautilus::invoke( - +[](const char* w, uint32_t wsz, double from_f, double to_f, char* buf, uint32_t bufMax) -> uint32_t { - try { + +[](const char* wktPtr, uint32_t wktSize, + double arg0, + double arg1, + char* buf, + uint32_t bufMax) -> uint32_t { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string s(w, wsz); - GSERIALIZED* gs = geom_in(s.c_str(), -1); - if (!gs) return 0u; - GSERIALIZED* result = line_substring(gs, from_f, to_f); - free(gs); - if (!result) return 0u; - char* out = geo_as_text(result, -1); - free(result); + std::string tempS(wktPtr, wktSize); + GSERIALIZED* temp = geom_in(tempS.c_str(), -1); + if (!temp) return 0u; + + GSERIALIZED* gres = line_substring(temp, arg0, arg1); + free(temp); + if (!gres) return 0u; + char* out = geo_as_text(gres, -1); + free(gres); if (!out) return 0u; uint32_t len = static_cast(strlen(out)); if (len > bufMax) len = bufMax; memcpy(buf, out, len); free(out); return len; - } catch (const std::exception&) { return 0u; } + } + catch (const std::exception&) + { + return 0u; + } }, - wkt, from_f, to_f, outBuf.getContent(), nautilus::val(MAX_LEN)); + wkt.getContent(), wkt.getContentSize(), arg0, arg1, outBuf.getContent(), nautilus::val(MAX_LEN)); VarVal(actualLen).writeToMemory(outBuf.getReference()); return outBuf; @@ -81,10 +104,10 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterL PRECONDITION(arguments.childFunctions.size() == 3, "LineSubstringPhysicalFunction requires 3 children but got {}", arguments.childFunctions.size()); - return LineSubstringPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return LineSubstringPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/MindistanceTcbufferTcbufferPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/MindistanceTcbufferTcbufferPhysicalFunction.cpp index 07e5591857..712fe97843 100644 --- a/nes-physical-operators/src/Functions/Meos/MindistanceTcbufferTcbufferPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/MindistanceTcbufferTcbufferPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -20,79 +21,92 @@ #include #include #include +#include #include +#include #include #include -#include -#include extern "C" { #include -#include #include } namespace NES { -MindistanceTcbufferTcbufferPhysicalFunction::MindistanceTcbufferTcbufferPhysicalFunction( - PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction r1, PhysicalFunction ts1, - PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction r2, PhysicalFunction ts2, - PhysicalFunction dist) +MindistanceTcbufferTcbufferPhysicalFunction::MindistanceTcbufferTcbufferPhysicalFunction(PhysicalFunction lonAFunction, + PhysicalFunction latAFunction, + PhysicalFunction radiusAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction lonBFunction, + PhysicalFunction latBFunction, + PhysicalFunction radiusBFunction, + PhysicalFunction tsBFunction, + PhysicalFunction distFunction) { - paramFns.reserve(9); - paramFns.push_back(std::move(lon1)); - paramFns.push_back(std::move(lat1)); - paramFns.push_back(std::move(r1)); - paramFns.push_back(std::move(ts1)); - paramFns.push_back(std::move(lon2)); - paramFns.push_back(std::move(lat2)); - paramFns.push_back(std::move(r2)); - paramFns.push_back(std::move(ts2)); - paramFns.push_back(std::move(dist)); + parameterFunctions.reserve(9); + parameterFunctions.push_back(std::move(lonAFunction)); + parameterFunctions.push_back(std::move(latAFunction)); + parameterFunctions.push_back(std::move(radiusAFunction)); + parameterFunctions.push_back(std::move(tsAFunction)); + parameterFunctions.push_back(std::move(lonBFunction)); + parameterFunctions.push_back(std::move(latBFunction)); + parameterFunctions.push_back(std::move(radiusBFunction)); + parameterFunctions.push_back(std::move(tsBFunction)); + parameterFunctions.push_back(std::move(distFunction)); } VarVal MindistanceTcbufferTcbufferPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto lon1 = paramFns[0].execute(record, arena).cast(); - auto lat1 = paramFns[1].execute(record, arena).cast(); - auto r1 = paramFns[2].execute(record, arena).cast(); - auto ts1 = paramFns[3].execute(record, arena).cast(); - auto lon2 = paramFns[4].execute(record, arena).cast(); - auto lat2 = paramFns[5].execute(record, arena).cast(); - auto r2 = paramFns[6].execute(record, arena).cast(); - auto ts2 = paramFns[7].execute(record, arena).cast(); - auto dist = paramFns[8].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto lonA = parameterValues[0].cast>(); + auto latA = parameterValues[1].cast>(); + auto radiusA = parameterValues[2].cast>(); + auto tsA = parameterValues[3].cast>(); + auto lonB = parameterValues[4].cast>(); + auto latB = parameterValues[5].cast>(); + auto radiusB = parameterValues[6].cast>(); + auto tsB = parameterValues[7].cast>(); + auto dist = parameterValues[8].cast>(); const auto result = nautilus::invoke( - +[](double lon1, double lat1, double r1, uint64_t ts1, - double lon2, double lat2, double r2, uint64_t ts2, - double dist) -> double { - try { + +[](double lonAValue, double latAValue, double radiusAValue, uint64_t tsAValue, + double lonBValue, double latBValue, double radiusBValue, uint64_t tsBValue, + double distValue) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string pt1 = fmt::format("POINT({} {})", lon1, lat1); - GSERIALIZED* gs1 = geom_in(pt1.c_str(), -1); - if (!gs1) return 0.0; - Cbuffer* cb1 = cbuffer_make(gs1, r1); - free(gs1); - if (!cb1) return 0.0; - Temporal* tcb1 = (Temporal*)tcbufferinst_make(cb1, (TimestampTz)ts1); - free(cb1); - if (!tcb1) return 0.0; - std::string pt2 = fmt::format("POINT({} {})", lon2, lat2); - GSERIALIZED* gs2 = geom_in(pt2.c_str(), -1); - if (!gs2) { free(tcb1); return 0.0; } - Cbuffer* cb2 = cbuffer_make(gs2, r2); - free(gs2); - if (!cb2) { free(tcb1); return 0.0; } - Temporal* tcb2 = (Temporal*)tcbufferinst_make(cb2, (TimestampTz)ts2); - free(cb2); - if (!tcb2) { free(tcb1); return 0.0; } - double r = mindistance_tcbuffer_tcbuffer(tcb1, tcb2, dist); - free(tcb1); free(tcb2); + if (!(lonAValue >= -180.0 && lonAValue <= 180.0 && latAValue >= -90.0 && latAValue <= 90.0)) return 0; + if (!(lonBValue >= -180.0 && lonBValue <= 180.0 && latBValue >= -90.0 && latBValue <= 90.0)) return 0; + if (radiusAValue < 0.0 || radiusBValue < 0.0) return 0; + + const std::string tsAString = MEOS::Meos::convertEpochToTimestamp(tsAValue); + const std::string tsBString = MEOS::Meos::convertEpochToTimestamp(tsBValue); + std::string wktA = fmt::format("Cbuffer(Point({} {}),{})@{}", lonAValue, latAValue, radiusAValue, tsAString); + std::string wktB = fmt::format("Cbuffer(Point({} {}),{})@{}", lonBValue, latBValue, radiusBValue, tsBString); + + Temporal* tA = tcbuffer_in(wktA.c_str()); + if (!tA) return 0; + Temporal* tB = tcbuffer_in(wktB.c_str()); + if (!tB) { free(tA); return 0; } + + double r = mindistance_tcbuffer_tcbuffer(tA, tB, distValue); + free(tA); + free(tB); return r; - } catch (const std::exception&) { return -1.0; } + } + catch (const std::exception&) + { + return 0; + } }, - lon1, lat1, r1, ts1, lon2, lat2, r2, ts2, dist); + lonA, latA, radiusA, tsA, lonB, latB, radiusB, tsB, dist); return VarVal(result); } @@ -103,15 +117,16 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterM PRECONDITION(arguments.childFunctions.size() == 9, "MindistanceTcbufferTcbufferPhysicalFunction requires 9 children but got {}", arguments.childFunctions.size()); - return MindistanceTcbufferTcbufferPhysicalFunction(std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2]), - std::move(arguments.childFunctions[3]), - std::move(arguments.childFunctions[4]), - std::move(arguments.childFunctions[5]), - std::move(arguments.childFunctions[6]), - std::move(arguments.childFunctions[7]), - std::move(arguments.childFunctions[8])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + auto arg5 = std::move(arguments.childFunctions[5]); + auto arg6 = std::move(arguments.childFunctions[6]); + auto arg7 = std::move(arguments.childFunctions[7]); + auto arg8 = std::move(arguments.childFunctions[8]); + return MindistanceTcbufferTcbufferPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6), std::move(arg7), std::move(arg8)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/MulBigintTbigintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/MulBigintTbigintPhysicalFunction.cpp index 0919846d1d..25f613158a 100644 --- a/nes-physical-operators/src/Functions/Meos/MulBigintTbigintPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/MulBigintTbigintPhysicalFunction.cpp @@ -35,12 +35,12 @@ extern "C" { namespace NES { -MulBigintTbigintPhysicalFunction::MulBigintTbigintPhysicalFunction(PhysicalFunction scalarFunction, - PhysicalFunction valueFunction, - PhysicalFunction tsFunction) +MulBigintTbigintPhysicalFunction::MulBigintTbigintPhysicalFunction(PhysicalFunction arg0Function, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction) { parameterFunctions.reserve(3); - parameterFunctions.push_back(std::move(scalarFunction)); + parameterFunctions.push_back(std::move(arg0Function)); parameterFunctions.push_back(std::move(valueFunction)); parameterFunctions.push_back(std::move(tsFunction)); } @@ -50,29 +50,38 @@ VarVal MulBigintTbigintPhysicalFunction::execute(const Record& record, ArenaRef& std::vector parameterValues; parameterValues.reserve(parameterFunctions.size()); for (const auto& function : parameterFunctions) + { parameterValues.emplace_back(function.execute(record, arena)); + } - auto scalar = parameterValues[0].cast>(); - auto value = parameterValues[1].cast>(); - auto ts = parameterValues[2].cast>(); + auto arg0 = parameterValues[0].cast>(); + auto value = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); const auto result = nautilus::invoke( - +[](double scalar_d, double value_d, uint64_t ts) -> double { - try { + +[](double arg0, + double value, + uint64_t ts) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string tempWkt = fmt::format("{}@{}", static_cast(value_d), - MEOS::Meos::convertEpochToTimestamp(ts)); + std::string tempWkt = fmt::format("{}@{}", static_cast(value), MEOS::Meos::convertEpochToTimestamp(ts)); Temporal* temp = tbigint_in(tempWkt.c_str()); if (!temp) return 0.0; - Temporal* res = mul_bigint_tbigint(static_cast(scalar_d), temp); + + Temporal* res = mul_bigint_tbigint(static_cast(arg0), temp); free(temp); if (!res) return 0.0; - double r = static_cast(tbigint_start_value(res)); + double r = tbigint_start_value(res); free(res); return r; - } catch (const std::exception&) { return 0.0; } + } + catch (const std::exception&) + { + return 0.0; + } }, - scalar, value, ts); + arg0, value, ts); return VarVal(result); } diff --git a/nes-physical-operators/src/Functions/Meos/MulFloatTfloatPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/MulFloatTfloatPhysicalFunction.cpp index 94fe98aa57..63c2a87407 100644 --- a/nes-physical-operators/src/Functions/Meos/MulFloatTfloatPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/MulFloatTfloatPhysicalFunction.cpp @@ -35,12 +35,12 @@ extern "C" { namespace NES { -MulFloatTfloatPhysicalFunction::MulFloatTfloatPhysicalFunction(PhysicalFunction scalarFunction, - PhysicalFunction valueFunction, - PhysicalFunction tsFunction) +MulFloatTfloatPhysicalFunction::MulFloatTfloatPhysicalFunction(PhysicalFunction arg0Function, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction) { parameterFunctions.reserve(3); - parameterFunctions.push_back(std::move(scalarFunction)); + parameterFunctions.push_back(std::move(arg0Function)); parameterFunctions.push_back(std::move(valueFunction)); parameterFunctions.push_back(std::move(tsFunction)); } @@ -50,28 +50,38 @@ VarVal MulFloatTfloatPhysicalFunction::execute(const Record& record, ArenaRef& a std::vector parameterValues; parameterValues.reserve(parameterFunctions.size()); for (const auto& function : parameterFunctions) + { parameterValues.emplace_back(function.execute(record, arena)); + } - auto scalar = parameterValues[0].cast>(); - auto value = parameterValues[1].cast>(); - auto ts = parameterValues[2].cast>(); + auto arg0 = parameterValues[0].cast>(); + auto value = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); const auto result = nautilus::invoke( - +[](double scalar, double value, uint64_t ts) -> double { - try { + +[](double arg0, + double value, + uint64_t ts) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); std::string tempWkt = fmt::format("{}@{}", value, MEOS::Meos::convertEpochToTimestamp(ts)); Temporal* temp = tfloat_in(tempWkt.c_str()); if (!temp) return 0.0; - Temporal* res = mul_float_tfloat(scalar, temp); + + Temporal* res = mul_float_tfloat(arg0, temp); free(temp); if (!res) return 0.0; double r = tfloat_start_value(res); free(res); return r; - } catch (const std::exception&) { return 0.0; } + } + catch (const std::exception&) + { + return 0.0; + } }, - scalar, value, ts); + arg0, value, ts); return VarVal(result); } diff --git a/nes-physical-operators/src/Functions/Meos/MulIntTintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/MulIntTintPhysicalFunction.cpp index 19b58599e9..811406e15a 100644 --- a/nes-physical-operators/src/Functions/Meos/MulIntTintPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/MulIntTintPhysicalFunction.cpp @@ -35,12 +35,12 @@ extern "C" { namespace NES { -MulIntTintPhysicalFunction::MulIntTintPhysicalFunction(PhysicalFunction scalarFunction, - PhysicalFunction valueFunction, - PhysicalFunction tsFunction) +MulIntTintPhysicalFunction::MulIntTintPhysicalFunction(PhysicalFunction arg0Function, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction) { parameterFunctions.reserve(3); - parameterFunctions.push_back(std::move(scalarFunction)); + parameterFunctions.push_back(std::move(arg0Function)); parameterFunctions.push_back(std::move(valueFunction)); parameterFunctions.push_back(std::move(tsFunction)); } @@ -50,28 +50,38 @@ VarVal MulIntTintPhysicalFunction::execute(const Record& record, ArenaRef& arena std::vector parameterValues; parameterValues.reserve(parameterFunctions.size()); for (const auto& function : parameterFunctions) + { parameterValues.emplace_back(function.execute(record, arena)); + } - auto scalar = parameterValues[0].cast>(); - auto value = parameterValues[1].cast>(); - auto ts = parameterValues[2].cast>(); + auto arg0 = parameterValues[0].cast>(); + auto value = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); const auto result = nautilus::invoke( - +[](double scalar_d, double value_d, uint64_t ts) -> double { - try { + +[](int32_t arg0, + int32_t value, + uint64_t ts) -> int { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string tempWkt = fmt::format("{}@{}", static_cast(value_d), MEOS::Meos::convertEpochToTimestamp(ts)); + std::string tempWkt = fmt::format("{}@{}", value, MEOS::Meos::convertEpochToTimestamp(ts)); Temporal* temp = tint_in(tempWkt.c_str()); - if (!temp) return 0.0; - Temporal* res = mul_int_tint(static_cast(scalar_d), temp); + if (!temp) return 0; + + Temporal* res = mul_int_tint(arg0, temp); free(temp); - if (!res) return 0.0; - double r = static_cast(tint_start_value(res)); + if (!res) return 0; + int r = tint_start_value(res); free(res); return r; - } catch (const std::exception&) { return 0.0; } + } + catch (const std::exception&) + { + return 0; + } }, - scalar, value, ts); + arg0, value, ts); return VarVal(result); } diff --git a/nes-physical-operators/src/Functions/Meos/MulTbigintBigintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/MulTbigintBigintPhysicalFunction.cpp index b99b8a6441..35b83d2eec 100644 --- a/nes-physical-operators/src/Functions/Meos/MulTbigintBigintPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/MulTbigintBigintPhysicalFunction.cpp @@ -36,13 +36,13 @@ extern "C" { namespace NES { MulTbigintBigintPhysicalFunction::MulTbigintBigintPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction tsFunction, - PhysicalFunction factorFunction) + PhysicalFunction tsFunction, + PhysicalFunction arg0Function) { parameterFunctions.reserve(3); parameterFunctions.push_back(std::move(valueFunction)); parameterFunctions.push_back(std::move(tsFunction)); - parameterFunctions.push_back(std::move(factorFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } VarVal MulTbigintBigintPhysicalFunction::execute(const Record& record, ArenaRef& arena) const @@ -50,29 +50,38 @@ VarVal MulTbigintBigintPhysicalFunction::execute(const Record& record, ArenaRef& std::vector parameterValues; parameterValues.reserve(parameterFunctions.size()); for (const auto& function : parameterFunctions) + { parameterValues.emplace_back(function.execute(record, arena)); + } - auto value = parameterValues[0].cast>(); - auto ts = parameterValues[1].cast>(); - auto factor = parameterValues[2].cast>(); + auto value = parameterValues[0].cast>(); + auto ts = parameterValues[1].cast>(); + auto arg0 = parameterValues[2].cast>(); const auto result = nautilus::invoke( - +[](double value, uint64_t ts, double factor_d) -> double { - try { + +[](double value, + uint64_t ts, + double arg0) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string tempWkt = fmt::format("{}@{}", static_cast(value), - MEOS::Meos::convertEpochToTimestamp(ts)); + std::string tempWkt = fmt::format("{}@{}", static_cast(value), MEOS::Meos::convertEpochToTimestamp(ts)); Temporal* temp = tbigint_in(tempWkt.c_str()); if (!temp) return 0.0; - Temporal* res = mul_tbigint_bigint(temp, static_cast(factor_d)); + + Temporal* res = mul_tbigint_bigint(temp, static_cast(arg0)); free(temp); if (!res) return 0.0; - double r = static_cast(tbigint_start_value(res)); + double r = tbigint_start_value(res); free(res); return r; - } catch (const std::exception&) { return 0.0; } + } + catch (const std::exception&) + { + return 0.0; + } }, - value, ts, factor); + value, ts, arg0); return VarVal(result); } diff --git a/nes-physical-operators/src/Functions/Meos/MulTfloatFloatPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/MulTfloatFloatPhysicalFunction.cpp index 80205907b6..905311f9ff 100644 --- a/nes-physical-operators/src/Functions/Meos/MulTfloatFloatPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/MulTfloatFloatPhysicalFunction.cpp @@ -36,13 +36,13 @@ extern "C" { namespace NES { MulTfloatFloatPhysicalFunction::MulTfloatFloatPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction tsFunction, - PhysicalFunction factorFunction) + PhysicalFunction tsFunction, + PhysicalFunction arg0Function) { parameterFunctions.reserve(3); parameterFunctions.push_back(std::move(valueFunction)); parameterFunctions.push_back(std::move(tsFunction)); - parameterFunctions.push_back(std::move(factorFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } VarVal MulTfloatFloatPhysicalFunction::execute(const Record& record, ArenaRef& arena) const @@ -50,28 +50,38 @@ VarVal MulTfloatFloatPhysicalFunction::execute(const Record& record, ArenaRef& a std::vector parameterValues; parameterValues.reserve(parameterFunctions.size()); for (const auto& function : parameterFunctions) + { parameterValues.emplace_back(function.execute(record, arena)); + } - auto value = parameterValues[0].cast>(); - auto ts = parameterValues[1].cast>(); - auto factor = parameterValues[2].cast>(); + auto value = parameterValues[0].cast>(); + auto ts = parameterValues[1].cast>(); + auto arg0 = parameterValues[2].cast>(); const auto result = nautilus::invoke( - +[](double value, uint64_t ts, double factor) -> double { - try { + +[](double value, + uint64_t ts, + double arg0) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); std::string tempWkt = fmt::format("{}@{}", value, MEOS::Meos::convertEpochToTimestamp(ts)); Temporal* temp = tfloat_in(tempWkt.c_str()); if (!temp) return 0.0; - Temporal* res = mul_tfloat_float(temp, factor); + + Temporal* res = mul_tfloat_float(temp, arg0); free(temp); if (!res) return 0.0; double r = tfloat_start_value(res); free(res); return r; - } catch (const std::exception&) { return 0.0; } + } + catch (const std::exception&) + { + return 0.0; + } }, - value, ts, factor); + value, ts, arg0); return VarVal(result); } diff --git a/nes-physical-operators/src/Functions/Meos/MulTintIntPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/MulTintIntPhysicalFunction.cpp index 18b90450ae..6c61ed9947 100644 --- a/nes-physical-operators/src/Functions/Meos/MulTintIntPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/MulTintIntPhysicalFunction.cpp @@ -36,13 +36,13 @@ extern "C" { namespace NES { MulTintIntPhysicalFunction::MulTintIntPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction tsFunction, - PhysicalFunction multiplierFunction) + PhysicalFunction tsFunction, + PhysicalFunction arg0Function) { parameterFunctions.reserve(3); parameterFunctions.push_back(std::move(valueFunction)); parameterFunctions.push_back(std::move(tsFunction)); - parameterFunctions.push_back(std::move(multiplierFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } VarVal MulTintIntPhysicalFunction::execute(const Record& record, ArenaRef& arena) const @@ -50,28 +50,38 @@ VarVal MulTintIntPhysicalFunction::execute(const Record& record, ArenaRef& arena std::vector parameterValues; parameterValues.reserve(parameterFunctions.size()); for (const auto& function : parameterFunctions) + { parameterValues.emplace_back(function.execute(record, arena)); + } - auto value = parameterValues[0].cast>(); - auto ts = parameterValues[1].cast>(); - auto multiplier = parameterValues[2].cast>(); + auto value = parameterValues[0].cast>(); + auto ts = parameterValues[1].cast>(); + auto arg0 = parameterValues[2].cast>(); const auto result = nautilus::invoke( - +[](double value, uint64_t ts, double multiplier_d) -> double { - try { + +[](int32_t value, + uint64_t ts, + int32_t arg0) -> int { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string tempWkt = fmt::format("{}@{}", static_cast(value), MEOS::Meos::convertEpochToTimestamp(ts)); + std::string tempWkt = fmt::format("{}@{}", value, MEOS::Meos::convertEpochToTimestamp(ts)); Temporal* temp = tint_in(tempWkt.c_str()); - if (!temp) return 0.0; - Temporal* res = mul_tint_int(temp, static_cast(multiplier_d)); + if (!temp) return 0; + + Temporal* res = mul_tint_int(temp, arg0); free(temp); - if (!res) return 0.0; - double r = static_cast(tint_start_value(res)); + if (!res) return 0; + int r = tint_start_value(res); free(res); return r; - } catch (const std::exception&) { return 0.0; } + } + catch (const std::exception&) + { + return 0; + } }, - value, ts, multiplier); + value, ts, arg0); return VarVal(result); } diff --git a/nes-physical-operators/src/Functions/Meos/MulTnumberTnumberPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/MulTnumberTnumberPhysicalFunction.cpp index 30f600c42b..5e7f9a2fc1 100644 --- a/nes-physical-operators/src/Functions/Meos/MulTnumberTnumberPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/MulTnumberTnumberPhysicalFunction.cpp @@ -22,7 +22,8 @@ #include #include #include -#include +#include +#include #include #include #include @@ -35,14 +36,12 @@ extern "C" { namespace NES { -MulTnumberTnumberPhysicalFunction::MulTnumberTnumberPhysicalFunction(PhysicalFunction value1Function, - PhysicalFunction value2Function, - PhysicalFunction tsFunction) +MulTnumberTnumberPhysicalFunction::MulTnumberTnumberPhysicalFunction(PhysicalFunction trajFunction, + PhysicalFunction arg0Function) { - parameterFunctions.reserve(3); - parameterFunctions.push_back(std::move(value1Function)); - parameterFunctions.push_back(std::move(value2Function)); - parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.reserve(2); + parameterFunctions.push_back(std::move(trajFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } VarVal MulTnumberTnumberPhysicalFunction::execute(const Record& record, ArenaRef& arena) const @@ -50,45 +49,74 @@ VarVal MulTnumberTnumberPhysicalFunction::execute(const Record& record, ArenaRef std::vector parameterValues; parameterValues.reserve(parameterFunctions.size()); for (const auto& function : parameterFunctions) + { parameterValues.emplace_back(function.execute(record, arena)); + } - auto value1 = parameterValues[0].cast>(); - auto value2 = parameterValues[1].cast>(); - auto ts = parameterValues[2].cast>(); + auto traj = parameterValues[0].cast(); + auto arg0 = parameterValues[1].cast(); - const auto result = nautilus::invoke( - +[](double value1, double value2, uint64_t ts) -> double { - try { + // Call MEOS f(Temporal*, Temporal*) -> Temporal* over the two hex-WKB + // operands and serialize the result back to hex-WKB inside the invoke; the + // returned heap string is copied into the arena below. Both operands and the + // MEOS result are freed here. + auto hexStr = nautilus::invoke( + +[](const char* aPtr, uint32_t aSize, const char* bPtr, uint32_t bSize) -> char* + { + try + { MEOS::Meos::ensureMeosInitialized(); - const std::string tsStr = MEOS::Meos::convertEpochToTimestamp(ts); - std::string wkt1 = fmt::format("{}@{}", value1, tsStr); - std::string wkt2 = fmt::format("{}@{}", value2, tsStr); - Temporal* t1 = tfloat_in(wkt1.c_str()); - Temporal* t2 = tfloat_in(wkt2.c_str()); - if (!t1 || !t2) { free(t1); free(t2); return 0.0; } - Temporal* res = mul_tnumber_tnumber(t1, t2); - free(t1); free(t2); - if (!res) return 0.0; - double r = tfloat_start_value(res); + std::string aHex(aPtr, aSize); + std::string bHex(bPtr, bSize); + Temporal* a = temporal_from_hexwkb(aHex.c_str()); + if (!a) return (char*) nullptr; + Temporal* b = temporal_from_hexwkb(bHex.c_str()); + if (!b) { free(a); return (char*) nullptr; } + Temporal* res = mul_tnumber_tnumber(a, b); + free(a); + free(b); + if (!res) return (char*) nullptr; + size_t hexSize = 0; + char* hexOut = temporal_as_hexwkb(res, 0, &hexSize); free(res); - return r; - } catch (const std::exception&) { return 0.0; } + return hexOut; + } + catch (const std::exception&) + { + return (char*) nullptr; + } }, - value1, value2, ts); + traj.getContent(), traj.getContentSize(), arg0.getContent(), arg0.getContentSize()); - return VarVal(result); + const auto hexLen = nautilus::invoke( + +[](const char* s) -> uint32_t { return s ? (uint32_t) strlen(s) : (uint32_t) 0; }, + hexStr); + + auto variableSized = arena.allocateVariableSizedData(hexLen); + + nautilus::invoke( + +[](int8_t* dest, const char* s, uint32_t len) -> void + { + if (s) + { + memcpy(dest, s, len); + free((void*) s); + } + }, + variableSized.getContent(), hexStr, hexLen); + + return variableSized; } PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterMulTnumberTnumberPhysicalFunction( PhysicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.childFunctions.size() == 3, - "MulTnumberTnumberPhysicalFunction requires 3 children but got {}", + PRECONDITION(arguments.childFunctions.size() == 2, + "MulTnumberTnumberPhysicalFunction requires 2 children but got {}", arguments.childFunctions.size()); auto arg0 = std::move(arguments.childFunctions[0]); auto arg1 = std::move(arguments.childFunctions[1]); - auto arg2 = std::move(arguments.childFunctions[2]); - return MulTnumberTnumberPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); + return MulTnumberTnumberPhysicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/NadTcbufferGeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/NadTcbufferGeoPhysicalFunction.cpp index 9c53b9dd6e..fd1f87efaa 100644 --- a/nes-physical-operators/src/Functions/Meos/NadTcbufferGeoPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/NadTcbufferGeoPhysicalFunction.cpp @@ -13,77 +13,97 @@ */ #include + #include #include #include +#include #include #include #include #include +#include #include +#include #include #include -#include -#include -#include extern "C" { #include -#include #include } namespace NES { -NadTcbufferGeoPhysicalFunction::NadTcbufferGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, - PhysicalFunction radius, PhysicalFunction ts, - PhysicalFunction wkt) +NadTcbufferGeoPhysicalFunction::NadTcbufferGeoPhysicalFunction(PhysicalFunction lonFunction, + PhysicalFunction latFunction, + PhysicalFunction radiusFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction) { - paramFns.reserve(5); - paramFns.push_back(std::move(lon)); - paramFns.push_back(std::move(lat)); - paramFns.push_back(std::move(radius)); - paramFns.push_back(std::move(ts)); - paramFns.push_back(std::move(wkt)); + parameterFunctions.reserve(5); + parameterFunctions.push_back(std::move(lonFunction)); + parameterFunctions.push_back(std::move(latFunction)); + parameterFunctions.push_back(std::move(radiusFunction)); + parameterFunctions.push_back(std::move(timestampFunction)); + parameterFunctions.push_back(std::move(geometryFunction)); } VarVal NadTcbufferGeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto lon = paramFns[0].execute(record, arena).cast(); - auto lat = paramFns[1].execute(record, arena).cast(); - auto radius = paramFns[2].execute(record, arena).cast(); - auto ts = paramFns[3].execute(record, arena).cast(); - auto wkt = paramFns[4].execute(record, arena); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto lon = parameterValues[0].cast>(); + auto lat = parameterValues[1].cast>(); + auto radius = parameterValues[2].cast>(); + auto timestamp = parameterValues[3].cast>(); + auto geometry = parameterValues[4].cast(); const auto result = nautilus::invoke( - +[](double lon, double lat, double radius, uint64_t ts, - const char* wkt, uint32_t wkt_len) -> double { - try { + +[](double lonValue, + double latValue, + double radiusValue, + uint64_t timestampValue, + const char* geometryPtr, + uint32_t geometrySize) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - // Build tcbuffer instant: point + radius → cbuffer → instant - std::string pt_str = fmt::format("POINT({} {})", lon, lat); - GSERIALIZED* pt_gs = geom_in(pt_str.c_str(), -1); - if (!pt_gs) return 0.0; - Cbuffer* cb = cbuffer_make(pt_gs, radius); - free(pt_gs); - if (!cb) return 0.0; - Temporal* tcb_inst = (Temporal*)tcbufferinst_make(cb, (TimestampTz)ts); - free(cb); - if (!tcb_inst) return 0.0; - // Build target geometry from null-terminated WKT copy - char* wkt_str = (char*)malloc(wkt_len + 1); - memcpy(wkt_str, wkt, wkt_len); - wkt_str[wkt_len] = '\0'; - GSERIALIZED* target_gs = geom_in(wkt_str, -1); - free(wkt_str); - if (!target_gs) { free(tcb_inst); return 0.0; } - double r = nad_tcbuffer_geo(tcb_inst, target_gs); - free(tcb_inst); - free(target_gs); + if (!(lonValue >= -180.0 && lonValue <= 180.0 && latValue >= -90.0 && latValue <= 90.0)) return 0; + if (radiusValue < 0.0) return 0; + + const std::string timestampString = MEOS::Meos::convertEpochToTimestamp(timestampValue); + std::string tcbufferWkt = fmt::format("Cbuffer(Point({} {}),{})@{}", + lonValue, latValue, radiusValue, timestampString); + std::string staticGeometryWkt(geometryPtr, geometrySize); + + while (!staticGeometryWkt.empty() && (staticGeometryWkt.front() == '\'' || staticGeometryWkt.front() == '"')) + staticGeometryWkt.erase(staticGeometryWkt.begin()); + while (!staticGeometryWkt.empty() && (staticGeometryWkt.back() == '\'' || staticGeometryWkt.back() == '"')) + staticGeometryWkt.pop_back(); + + if (tcbufferWkt.empty() || staticGeometryWkt.empty()) return 0; + + Temporal* tcbuffer = tcbuffer_in(tcbufferWkt.c_str()); + if (!tcbuffer) return 0; + MEOS::Meos::StaticGeometry staticGeometry(staticGeometryWkt); + if (!staticGeometry.getGeometry()) { free(tcbuffer); return 0; } + + double r = nad_tcbuffer_geo(tcbuffer, staticGeometry.getGeometry()); + free(tcbuffer); return r; - } catch (const std::exception&) { return -1.0; } + } + catch (const std::exception&) + { + return 0; + } }, - lon, lat, radius, ts, wkt); + lon, lat, radius, timestamp, geometry.getContent(), geometry.getContentSize()); return VarVal(result); } @@ -94,11 +114,12 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterN PRECONDITION(arguments.childFunctions.size() == 5, "NadTcbufferGeoPhysicalFunction requires 5 children but got {}", arguments.childFunctions.size()); - return NadTcbufferGeoPhysicalFunction(std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2]), - std::move(arguments.childFunctions[3]), - std::move(arguments.childFunctions[4])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + return NadTcbufferGeoPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/NadTcbufferTcbufferPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/NadTcbufferTcbufferPhysicalFunction.cpp index d55646d9de..eddffbb420 100644 --- a/nes-physical-operators/src/Functions/Meos/NadTcbufferTcbufferPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/NadTcbufferTcbufferPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -20,75 +21,88 @@ #include #include #include +#include #include +#include #include #include -#include -#include extern "C" { #include -#include #include } namespace NES { -NadTcbufferTcbufferPhysicalFunction::NadTcbufferTcbufferPhysicalFunction( - PhysicalFunction lon1, PhysicalFunction lat1, PhysicalFunction r1, PhysicalFunction ts1, - PhysicalFunction lon2, PhysicalFunction lat2, PhysicalFunction r2, PhysicalFunction ts2) +NadTcbufferTcbufferPhysicalFunction::NadTcbufferTcbufferPhysicalFunction(PhysicalFunction lonAFunction, + PhysicalFunction latAFunction, + PhysicalFunction radiusAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction lonBFunction, + PhysicalFunction latBFunction, + PhysicalFunction radiusBFunction, + PhysicalFunction tsBFunction) { - paramFns.reserve(8); - paramFns.push_back(std::move(lon1)); - paramFns.push_back(std::move(lat1)); - paramFns.push_back(std::move(r1)); - paramFns.push_back(std::move(ts1)); - paramFns.push_back(std::move(lon2)); - paramFns.push_back(std::move(lat2)); - paramFns.push_back(std::move(r2)); - paramFns.push_back(std::move(ts2)); + parameterFunctions.reserve(8); + parameterFunctions.push_back(std::move(lonAFunction)); + parameterFunctions.push_back(std::move(latAFunction)); + parameterFunctions.push_back(std::move(radiusAFunction)); + parameterFunctions.push_back(std::move(tsAFunction)); + parameterFunctions.push_back(std::move(lonBFunction)); + parameterFunctions.push_back(std::move(latBFunction)); + parameterFunctions.push_back(std::move(radiusBFunction)); + parameterFunctions.push_back(std::move(tsBFunction)); } VarVal NadTcbufferTcbufferPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto lon1 = paramFns[0].execute(record, arena).cast(); - auto lat1 = paramFns[1].execute(record, arena).cast(); - auto r1 = paramFns[2].execute(record, arena).cast(); - auto ts1 = paramFns[3].execute(record, arena).cast(); - auto lon2 = paramFns[4].execute(record, arena).cast(); - auto lat2 = paramFns[5].execute(record, arena).cast(); - auto r2 = paramFns[6].execute(record, arena).cast(); - auto ts2 = paramFns[7].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto lonA = parameterValues[0].cast>(); + auto latA = parameterValues[1].cast>(); + auto radiusA = parameterValues[2].cast>(); + auto tsA = parameterValues[3].cast>(); + auto lonB = parameterValues[4].cast>(); + auto latB = parameterValues[5].cast>(); + auto radiusB = parameterValues[6].cast>(); + auto tsB = parameterValues[7].cast>(); const auto result = nautilus::invoke( - +[](double lon1, double lat1, double r1, uint64_t ts1, - double lon2, double lat2, double r2, uint64_t ts2) -> double { - try { + +[](double lonAValue, double latAValue, double radiusAValue, uint64_t tsAValue, + double lonBValue, double latBValue, double radiusBValue, uint64_t tsBValue) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string pt1 = fmt::format("POINT({} {})", lon1, lat1); - GSERIALIZED* gs1 = geom_in(pt1.c_str(), -1); - if (!gs1) return 0.0; - Cbuffer* cb1 = cbuffer_make(gs1, r1); - free(gs1); - if (!cb1) return 0.0; - Temporal* tcb1 = (Temporal*)tcbufferinst_make(cb1, (TimestampTz)ts1); - free(cb1); - if (!tcb1) return 0.0; - std::string pt2 = fmt::format("POINT({} {})", lon2, lat2); - GSERIALIZED* gs2 = geom_in(pt2.c_str(), -1); - if (!gs2) { free(tcb1); return 0.0; } - Cbuffer* cb2 = cbuffer_make(gs2, r2); - free(gs2); - if (!cb2) { free(tcb1); return 0.0; } - Temporal* tcb2 = (Temporal*)tcbufferinst_make(cb2, (TimestampTz)ts2); - free(cb2); - if (!tcb2) { free(tcb1); return 0.0; } - double r = nad_tcbuffer_tcbuffer(tcb1, tcb2); - free(tcb1); free(tcb2); + if (!(lonAValue >= -180.0 && lonAValue <= 180.0 && latAValue >= -90.0 && latAValue <= 90.0)) return 0; + if (!(lonBValue >= -180.0 && lonBValue <= 180.0 && latBValue >= -90.0 && latBValue <= 90.0)) return 0; + if (radiusAValue < 0.0 || radiusBValue < 0.0) return 0; + + const std::string tsAString = MEOS::Meos::convertEpochToTimestamp(tsAValue); + const std::string tsBString = MEOS::Meos::convertEpochToTimestamp(tsBValue); + std::string wktA = fmt::format("Cbuffer(Point({} {}),{})@{}", lonAValue, latAValue, radiusAValue, tsAString); + std::string wktB = fmt::format("Cbuffer(Point({} {}),{})@{}", lonBValue, latBValue, radiusBValue, tsBString); + + Temporal* tA = tcbuffer_in(wktA.c_str()); + if (!tA) return 0; + Temporal* tB = tcbuffer_in(wktB.c_str()); + if (!tB) { free(tA); return 0; } + + double r = nad_tcbuffer_tcbuffer(tA, tB); + free(tA); + free(tB); return r; - } catch (const std::exception&) { return -1.0; } + } + catch (const std::exception&) + { + return 0; + } }, - lon1, lat1, r1, ts1, lon2, lat2, r2, ts2); + lonA, latA, radiusA, tsA, lonB, latB, radiusB, tsB); return VarVal(result); } @@ -99,14 +113,15 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterN PRECONDITION(arguments.childFunctions.size() == 8, "NadTcbufferTcbufferPhysicalFunction requires 8 children but got {}", arguments.childFunctions.size()); - return NadTcbufferTcbufferPhysicalFunction(std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2]), - std::move(arguments.childFunctions[3]), - std::move(arguments.childFunctions[4]), - std::move(arguments.childFunctions[5]), - std::move(arguments.childFunctions[6]), - std::move(arguments.childFunctions[7])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + auto arg5 = std::move(arguments.childFunctions[5]); + auto arg6 = std::move(arguments.childFunctions[6]); + auto arg7 = std::move(arguments.childFunctions[7]); + return NadTcbufferTcbufferPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6), std::move(arg7)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/NadTgeoGeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/NadTgeoGeoPhysicalFunction.cpp index 1990fd476c..4ac2272a5e 100644 --- a/nes-physical-operators/src/Functions/Meos/NadTgeoGeoPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/NadTgeoGeoPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -34,40 +35,75 @@ extern "C" { namespace NES { -NadTgeoGeoPhysicalFunction::NadTgeoGeoPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, - PhysicalFunction ts, PhysicalFunction wkt) +NadTgeoGeoPhysicalFunction::NadTgeoGeoPhysicalFunction(PhysicalFunction lonFunction, + PhysicalFunction latFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction) { - paramFns.reserve(4); - paramFns.push_back(std::move(lon)); - paramFns.push_back(std::move(lat)); - paramFns.push_back(std::move(ts)); - paramFns.push_back(std::move(wkt)); + parameterFunctions.reserve(4); + parameterFunctions.push_back(std::move(lonFunction)); + parameterFunctions.push_back(std::move(latFunction)); + parameterFunctions.push_back(std::move(timestampFunction)); + parameterFunctions.push_back(std::move(geometryFunction)); } VarVal NadTgeoGeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto lon = paramFns[0].execute(record, arena).cast(); - auto lat = paramFns[1].execute(record, arena).cast(); - auto ts = paramFns[2].execute(record, arena).cast(); - auto wkt = paramFns[3].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto lon = parameterValues[0].cast>(); + auto lat = parameterValues[1].cast>(); + auto timestamp = parameterValues[2].cast>(); + auto geometry = parameterValues[3].cast(); const auto result = nautilus::invoke( - +[](double lon, double lat, uint64_t ts, - const char* w, uint32_t wsz) -> double { - try { + +[](double lonValue, + double latValue, + uint64_t timestampValue, + const char* geometryPtr, + uint32_t geometrySize) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string wktStr(w, wsz); - std::string tgeoWkt = fmt::format("SRID=4326;POINT({},{})@{}", lon, lat, ts); - Temporal* tgeo = tgeompoint_in(tgeoWkt.c_str()); - if (!tgeo) return 0.0; - GSERIALIZED* gs = geom_in(wktStr.c_str(), -1); - if (!gs) { free(tgeo); return 0.0; } - double r = nad_tgeo_geo(tgeo, gs); - free(tgeo); free(gs); - return r; - } catch (const std::exception&) { return 0.0; } + if (!(lonValue >= -180.0 && lonValue <= 180.0 && latValue >= -90.0 && latValue <= 90.0)) { + return 0; + } + + const std::string timestampString = MEOS::Meos::convertEpochToTimestamp(timestampValue); + std::string temporalGeometryWkt = fmt::format("SRID=4326;Point({} {})@{}", lonValue, latValue, timestampString); + std::string staticGeometryWkt(geometryPtr, geometrySize); + + while (!staticGeometryWkt.empty() && (staticGeometryWkt.front() == '\'' || staticGeometryWkt.front() == '"')) + staticGeometryWkt.erase(staticGeometryWkt.begin()); + while (!staticGeometryWkt.empty() && (staticGeometryWkt.back() == '\'' || staticGeometryWkt.back() == '"')) + staticGeometryWkt.pop_back(); + + if (temporalGeometryWkt.empty() || staticGeometryWkt.empty()) + return 0; + + MEOS::Meos::TemporalGeometry temporalGeometry(temporalGeometryWkt); + if (!temporalGeometry.getGeometry()) return 0; + MEOS::Meos::StaticGeometry staticGeometry(staticGeometryWkt); + if (!staticGeometry.getGeometry()) return 0; + + // MEOS spatial-relation call — same shape as TemporalEDWithin's + // edwithin_tgeo_geo, but specific MEOS function per generated operator. + // Real MEOS spatial-rel signature: int fn(const Temporal *, const GSERIALIZED *) + // (no `atstart` flag — that's specific to geog_dwithin / edwithin's 3-arg variant). + return nad_tgeo_geo(temporalGeometry.getGeometry(), + staticGeometry.getGeometry()); + } + catch (const std::exception&) + { + return 0; + } }, - lon, lat, ts, wkt); + lon, lat, timestamp, geometry.getContent(), geometry.getContentSize()); return VarVal(result); } @@ -78,10 +114,11 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterN PRECONDITION(arguments.childFunctions.size() == 4, "NadTgeoGeoPhysicalFunction requires 4 children but got {}", arguments.childFunctions.size()); - return NadTgeoGeoPhysicalFunction(std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2]), - std::move(arguments.childFunctions[3])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + return NadTgeoGeoPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/NadTgeoTgeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/NadTgeoTgeoPhysicalFunction.cpp new file mode 100644 index 0000000000..1268cf460d --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/NadTgeoTgeoPhysicalFunction.cpp @@ -0,0 +1,117 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +} + +namespace NES { + +NadTgeoTgeoPhysicalFunction::NadTgeoTgeoPhysicalFunction(PhysicalFunction lonAFunction, + PhysicalFunction latAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction lonBFunction, + PhysicalFunction latBFunction, + PhysicalFunction tsBFunction) +{ + parameterFunctions.reserve(6); + parameterFunctions.push_back(std::move(lonAFunction)); + parameterFunctions.push_back(std::move(latAFunction)); + parameterFunctions.push_back(std::move(tsAFunction)); + parameterFunctions.push_back(std::move(lonBFunction)); + parameterFunctions.push_back(std::move(latBFunction)); + parameterFunctions.push_back(std::move(tsBFunction)); +} + +VarVal NadTgeoTgeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto lonA = parameterValues[0].cast>(); + auto latA = parameterValues[1].cast>(); + auto tsA = parameterValues[2].cast>(); + auto lonB = parameterValues[3].cast>(); + auto latB = parameterValues[4].cast>(); + auto tsB = parameterValues[5].cast>(); + + const auto result = nautilus::invoke( + +[](double lonAValue, double latAValue, uint64_t tsAValue, + double lonBValue, double latBValue, uint64_t tsBValue) -> double { + try + { + MEOS::Meos::ensureMeosInitialized(); + if (!(lonAValue >= -180.0 && lonAValue <= 180.0 && latAValue >= -90.0 && latAValue <= 90.0)) return 0; + if (!(lonBValue >= -180.0 && lonBValue <= 180.0 && latBValue >= -90.0 && latBValue <= 90.0)) return 0; + + const std::string tsAString = MEOS::Meos::convertEpochToTimestamp(tsAValue); + const std::string tsBString = MEOS::Meos::convertEpochToTimestamp(tsBValue); + std::string temporalGeometryAWkt = fmt::format("SRID=4326;Point({} {})@{}", lonAValue, latAValue, tsAString); + std::string temporalGeometryBWkt = fmt::format("SRID=4326;Point({} {})@{}", lonBValue, latBValue, tsBString); + + MEOS::Meos::TemporalGeometry temporalGeometryA(temporalGeometryAWkt); + if (!temporalGeometryA.getGeometry()) return 0; + MEOS::Meos::TemporalGeometry temporalGeometryB(temporalGeometryBWkt); + if (!temporalGeometryB.getGeometry()) return 0; + + // MEOS *_tgeo_tgeo spatial-relation: int fn(const Temporal*, const Temporal*). + return nad_tgeo_tgeo(temporalGeometryA.getGeometry(), + temporalGeometryB.getGeometry()); + } + catch (const std::exception&) + { + return 0; + } + }, + lonA, latA, tsA, lonB, latB, tsB); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterNadTgeoTgeoPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 6, + "NadTgeoTgeoPhysicalFunction requires 6 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + auto arg5 = std::move(arguments.childFunctions[5]); + return NadTgeoTgeoPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/NadTnpointGeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/NadTnpointGeoPhysicalFunction.cpp index f56b5303df..deaa9418e7 100644 --- a/nes-physical-operators/src/Functions/Meos/NadTnpointGeoPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/NadTnpointGeoPhysicalFunction.cpp @@ -13,18 +13,20 @@ */ #include + #include #include #include +#include #include #include #include #include +#include #include +#include #include #include -#include -#include extern "C" { #include @@ -34,42 +36,60 @@ extern "C" { namespace NES { -NadTnpointGeoPhysicalFunction::NadTnpointGeoPhysicalFunction(PhysicalFunction rid, PhysicalFunction pos, PhysicalFunction ts, PhysicalFunction wkt) +NadTnpointGeoPhysicalFunction::NadTnpointGeoPhysicalFunction(PhysicalFunction ridFunction, + PhysicalFunction fracFunction, + PhysicalFunction tsFunction, + PhysicalFunction arg0Function) { - paramFns.reserve(4); - paramFns.push_back(std::move(rid)); - paramFns.push_back(std::move(pos)); - paramFns.push_back(std::move(ts)); - paramFns.push_back(std::move(wkt)); + parameterFunctions.reserve(4); + parameterFunctions.push_back(std::move(ridFunction)); + parameterFunctions.push_back(std::move(fracFunction)); + parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } VarVal NadTnpointGeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto rid = paramFns[0].execute(record, arena).cast(); - auto pos = paramFns[1].execute(record, arena).cast(); - auto ts = paramFns[2].execute(record, arena).cast(); - auto wkt = paramFns[3].execute(record, arena); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto rid = parameterValues[0].cast>(); + auto frac = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + auto arg0 = parameterValues[3].cast(); + const auto result = nautilus::invoke( - +[](uint64_t rid, double pos, uint64_t ts, const char* wkt, uint32_t wkt_len) -> double { - try { + +[](int64_t rid, + double frac, + uint64_t ts, + const char* arg0Ptr, uint32_t arg0Size) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - Npoint* np = npoint_make((int64_t)rid, pos); - if (!np) return 0.0; - Temporal* inst = (Temporal*)tnpointinst_make(np, (TimestampTz)ts); - free(np); - if (!inst) return 0.0; - char* wkt_str = (char*)malloc(wkt_len + 1); - memcpy(wkt_str, wkt, wkt_len); - wkt_str[wkt_len] = '\0'; - GSERIALIZED* gs = geom_in(wkt_str, -1); - free(wkt_str); - if (!gs) { free(inst); return 0.0; } - double r = nad_tnpoint_geo(inst, gs); - free(inst); free(gs); + if (frac < 0.0 || frac > 1.0) return 0.0; + std::string tempWkt = fmt::format("NPoint({},{})@{}", rid, frac, MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tnpoint_in(tempWkt.c_str()); + if (!temp) return 0.0; + std::string arg0S(arg0Ptr, arg0Size); + GSERIALIZED* gs0 = geom_in(arg0S.c_str(), -1); + if (!gs0) { free(temp); return 0.0; } + + double r = nad_tnpoint_geo(temp, gs0); + free(temp); + free(gs0); return r; - } catch (const std::exception&) { return 0.0; } + } + catch (const std::exception&) + { + return 0.0; + } }, - rid, pos, ts, wkt); + rid, frac, ts, arg0.getContent(), arg0.getContentSize()); + return VarVal(result); } @@ -79,11 +99,11 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterN PRECONDITION(arguments.childFunctions.size() == 4, "NadTnpointGeoPhysicalFunction requires 4 children but got {}", arguments.childFunctions.size()); - return NadTnpointGeoPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2]), - std::move(arguments.childFunctions[3])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + return NadTnpointGeoPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/NadTnpointNpointPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/NadTnpointNpointPhysicalFunction.cpp index 52016d483a..69aa55b2d8 100644 --- a/nes-physical-operators/src/Functions/Meos/NadTnpointNpointPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/NadTnpointNpointPhysicalFunction.cpp @@ -13,61 +13,85 @@ */ #include + #include #include #include +#include #include #include #include #include +#include #include +#include #include #include -#include -#include extern "C" { #include -#include #include } namespace NES { -NadTnpointNpointPhysicalFunction::NadTnpointNpointPhysicalFunction(PhysicalFunction rid1, PhysicalFunction pos1, PhysicalFunction ts, PhysicalFunction rid2, PhysicalFunction pos2) +NadTnpointNpointPhysicalFunction::NadTnpointNpointPhysicalFunction(PhysicalFunction ridFunction, + PhysicalFunction fracFunction, + PhysicalFunction tsFunction, + PhysicalFunction rid0Function, + PhysicalFunction frac0Function) { - paramFns.reserve(5); - paramFns.push_back(std::move(rid1)); - paramFns.push_back(std::move(pos1)); - paramFns.push_back(std::move(ts)); - paramFns.push_back(std::move(rid2)); - paramFns.push_back(std::move(pos2)); + parameterFunctions.reserve(5); + parameterFunctions.push_back(std::move(ridFunction)); + parameterFunctions.push_back(std::move(fracFunction)); + parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(rid0Function)); + parameterFunctions.push_back(std::move(frac0Function)); } VarVal NadTnpointNpointPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto rid1 = paramFns[0].execute(record, arena).cast(); - auto pos1 = paramFns[1].execute(record, arena).cast(); - auto ts = paramFns[2].execute(record, arena).cast(); - auto rid2 = paramFns[3].execute(record, arena).cast(); - auto pos2 = paramFns[4].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto rid = parameterValues[0].cast>(); + auto frac = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + auto rid0 = parameterValues[3].cast>(); + auto frac0 = parameterValues[4].cast>(); + const auto result = nautilus::invoke( - +[](uint64_t rid1, double pos1, uint64_t ts, uint64_t rid2, double pos2) -> double { - try { + +[](int64_t rid, + double frac, + uint64_t ts, + uint64_t rid0, + double frac0) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - Npoint* np1 = npoint_make((int64_t)rid1, pos1); - if (!np1) return 0.0; - Temporal* inst = (Temporal*)tnpointinst_make(np1, (TimestampTz)ts); - free(np1); - if (!inst) return 0.0; - Npoint* np2 = npoint_make((int64_t)rid2, pos2); - if (!np2) { free(inst); return 0.0; } - double r = nad_tnpoint_npoint(inst, np2); - free(inst); free(np2); + if (frac < 0.0 || frac > 1.0) return 0.0; + std::string tempWkt = fmt::format("NPoint({},{})@{}", rid, frac, MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tnpoint_in(tempWkt.c_str()); + if (!temp) return 0.0; + Npoint* np0 = npoint_make((int64_t)rid0, frac0); + if (!np0) { free(temp); return 0.0; } + + double r = nad_tnpoint_npoint(temp, np0); + free(temp); + free(np0); return r; - } catch (const std::exception&) { return 0.0; } + } + catch (const std::exception&) + { + return 0.0; + } }, - rid1, pos1, ts, rid2, pos2); + rid, frac, ts, rid0, frac0); + return VarVal(result); } @@ -77,12 +101,12 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterN PRECONDITION(arguments.childFunctions.size() == 5, "NadTnpointNpointPhysicalFunction requires 5 children but got {}", arguments.childFunctions.size()); - return NadTnpointNpointPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2]), - std::move(arguments.childFunctions[3]), - std::move(arguments.childFunctions[4])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + return NadTnpointNpointPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/NadTnpointTnpointPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/NadTnpointTnpointPhysicalFunction.cpp index b126f6b1bf..2be6a1ed47 100644 --- a/nes-physical-operators/src/Functions/Meos/NadTnpointTnpointPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/NadTnpointTnpointPhysicalFunction.cpp @@ -13,17 +13,20 @@ */ #include + #include #include #include +#include #include #include #include #include +#include #include +#include #include #include -#include extern "C" { #include @@ -32,49 +35,69 @@ extern "C" { namespace NES { -NadTnpointTnpointPhysicalFunction::NadTnpointTnpointPhysicalFunction( - PhysicalFunction rid1, PhysicalFunction pos1, PhysicalFunction ts1, - PhysicalFunction rid2, PhysicalFunction pos2, PhysicalFunction ts2) +NadTnpointTnpointPhysicalFunction::NadTnpointTnpointPhysicalFunction(PhysicalFunction ridFunction, + PhysicalFunction fracFunction, + PhysicalFunction tsFunction, + PhysicalFunction rid0Function, + PhysicalFunction frac0Function, + PhysicalFunction ts0Function) { - paramFns.reserve(6); - paramFns.push_back(std::move(rid1)); - paramFns.push_back(std::move(pos1)); - paramFns.push_back(std::move(ts1)); - paramFns.push_back(std::move(rid2)); - paramFns.push_back(std::move(pos2)); - paramFns.push_back(std::move(ts2)); + parameterFunctions.reserve(6); + parameterFunctions.push_back(std::move(ridFunction)); + parameterFunctions.push_back(std::move(fracFunction)); + parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(rid0Function)); + parameterFunctions.push_back(std::move(frac0Function)); + parameterFunctions.push_back(std::move(ts0Function)); } VarVal NadTnpointTnpointPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto rid1 = paramFns[0].execute(record, arena).cast(); - auto pos1 = paramFns[1].execute(record, arena).cast(); - auto ts1 = paramFns[2].execute(record, arena).cast(); - auto rid2 = paramFns[3].execute(record, arena).cast(); - auto pos2 = paramFns[4].execute(record, arena).cast(); - auto ts2 = paramFns[5].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto rid = parameterValues[0].cast>(); + auto frac = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + auto rid0 = parameterValues[3].cast>(); + auto frac0 = parameterValues[4].cast>(); + auto ts0 = parameterValues[5].cast>(); const auto result = nautilus::invoke( - +[](uint64_t rid1, double pos1, uint64_t ts1, - uint64_t rid2, double pos2, uint64_t ts2) -> double { - try { + +[](int64_t rid, + double frac, + uint64_t ts, + uint64_t rid0, + double frac0, + uint64_t ts0) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - Npoint* np1 = npoint_make((int64_t)rid1, pos1); - if (!np1) return 0.0; - Temporal* inst1 = (Temporal*)tnpointinst_make(np1, (TimestampTz)ts1); - free(np1); - if (!inst1) return 0.0; - Npoint* np2 = npoint_make((int64_t)rid2, pos2); - if (!np2) { free(inst1); return 0.0; } - Temporal* inst2 = (Temporal*)tnpointinst_make(np2, (TimestampTz)ts2); - free(np2); - if (!inst2) { free(inst1); return 0.0; } - double r = nad_tnpoint_tnpoint(inst1, inst2); - free(inst1); free(inst2); + if (frac < 0.0 || frac > 1.0) return 0.0; + std::string tempWkt = fmt::format("NPoint({},{})@{}", rid, frac, MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tnpoint_in(tempWkt.c_str()); + if (!temp) return 0.0; + Npoint* np0 = npoint_make((int64_t)rid0, frac0); + if (!np0) { free(temp); return 0.0; } + Temporal* inst0 = (Temporal*)tnpointinst_make(np0, (TimestampTz)ts0); + free(np0); + if (!inst0) { free(temp); return 0.0; } + + double r = nad_tnpoint_tnpoint(temp, inst0); + free(temp); + free(inst0); return r; - } catch (const std::exception&) { return -1.0; } + } + catch (const std::exception&) + { + return 0.0; + } }, - rid1, pos1, ts1, rid2, pos2, ts2); + rid, frac, ts, rid0, frac0, ts0); return VarVal(result); } @@ -85,12 +108,13 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterN PRECONDITION(arguments.childFunctions.size() == 6, "NadTnpointTnpointPhysicalFunction requires 6 children but got {}", arguments.childFunctions.size()); - return NadTnpointTnpointPhysicalFunction(std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2]), - std::move(arguments.childFunctions[3]), - std::move(arguments.childFunctions[4]), - std::move(arguments.childFunctions[5])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + auto arg5 = std::move(arguments.childFunctions[5]); + return NadTnpointTnpointPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/NadTposeGeoPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/NadTposeGeoPhysicalFunction.cpp index 30160666ae..4538f8f4ab 100644 --- a/nes-physical-operators/src/Functions/Meos/NadTposeGeoPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/NadTposeGeoPhysicalFunction.cpp @@ -13,18 +13,20 @@ */ #include + #include #include #include +#include #include #include #include #include +#include #include +#include #include #include -#include -#include extern "C" { #include @@ -34,44 +36,63 @@ extern "C" { namespace NES { -NadTposeGeoPhysicalFunction::NadTposeGeoPhysicalFunction(PhysicalFunction x, PhysicalFunction y, PhysicalFunction theta, PhysicalFunction ts, PhysicalFunction wkt) +NadTposeGeoPhysicalFunction::NadTposeGeoPhysicalFunction(PhysicalFunction xFunction, + PhysicalFunction yFunction, + PhysicalFunction thetaFunction, + PhysicalFunction tsFunction, + PhysicalFunction arg0Function) { - paramFns.reserve(5); - paramFns.push_back(std::move(x)); - paramFns.push_back(std::move(y)); - paramFns.push_back(std::move(theta)); - paramFns.push_back(std::move(ts)); - paramFns.push_back(std::move(wkt)); + parameterFunctions.reserve(5); + parameterFunctions.push_back(std::move(xFunction)); + parameterFunctions.push_back(std::move(yFunction)); + parameterFunctions.push_back(std::move(thetaFunction)); + parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } VarVal NadTposeGeoPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto x = paramFns[0].execute(record, arena).cast(); - auto y = paramFns[1].execute(record, arena).cast(); - auto theta = paramFns[2].execute(record, arena).cast(); - auto ts = paramFns[3].execute(record, arena).cast(); - auto wkt = paramFns[4].execute(record, arena); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto x = parameterValues[0].cast>(); + auto y = parameterValues[1].cast>(); + auto theta = parameterValues[2].cast>(); + auto ts = parameterValues[3].cast>(); + auto arg0 = parameterValues[4].cast(); + const auto result = nautilus::invoke( - +[](double x, double y, double theta, uint64_t ts, const char* wkt, uint32_t wkt_len) -> double { - try { + +[](double x, + double y, + double theta, + uint64_t ts, + const char* arg0Ptr, uint32_t arg0Size) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - Pose* pose = pose_make_2d(x, y, theta, false, 0); - if (!pose) return 0.0; - Temporal* inst = (Temporal*)tposeinst_make(pose, (TimestampTz)ts); - free(pose); - if (!inst) return 0.0; - char* wkt_str = (char*)malloc(wkt_len + 1); - memcpy(wkt_str, wkt, wkt_len); - wkt_str[wkt_len] = '\0'; - GSERIALIZED* gs = geom_in(wkt_str, -1); - free(wkt_str); - if (!gs) { free(inst); return 0.0; } - double r = nad_tpose_geo(inst, gs); - free(inst); free(gs); + std::string tempWkt = fmt::format("Pose(Point({} {}),{})@{}", x, y, theta, MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tpose_in(tempWkt.c_str()); + if (!temp) return 0.0; + std::string arg0S(arg0Ptr, arg0Size); + GSERIALIZED* gs0 = geom_in(arg0S.c_str(), -1); + if (!gs0) { free(temp); return 0.0; } + + double r = nad_tpose_geo(temp, gs0); + free(temp); + free(gs0); return r; - } catch (const std::exception&) { return 0.0; } + } + catch (const std::exception&) + { + return 0.0; + } }, - x, y, theta, ts, wkt); + x, y, theta, ts, arg0.getContent(), arg0.getContentSize()); + return VarVal(result); } @@ -81,12 +102,12 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterN PRECONDITION(arguments.childFunctions.size() == 5, "NadTposeGeoPhysicalFunction requires 5 children but got {}", arguments.childFunctions.size()); - return NadTposeGeoPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2]), - std::move(arguments.childFunctions[3]), - std::move(arguments.childFunctions[4])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + return NadTposeGeoPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/NadTposePosePhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/NadTposePosePhysicalFunction.cpp index fe253d9ed5..b8a9e17b72 100644 --- a/nes-physical-operators/src/Functions/Meos/NadTposePosePhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/NadTposePosePhysicalFunction.cpp @@ -13,18 +13,20 @@ */ #include + #include #include #include +#include #include #include #include #include +#include #include +#include #include #include -#include -#include extern "C" { #include @@ -34,44 +36,70 @@ extern "C" { namespace NES { -NadTposePosePhysicalFunction::NadTposePosePhysicalFunction(PhysicalFunction x, PhysicalFunction y, PhysicalFunction theta, PhysicalFunction ts, PhysicalFunction x2, PhysicalFunction y2, PhysicalFunction theta2) +NadTposePosePhysicalFunction::NadTposePosePhysicalFunction(PhysicalFunction xFunction, + PhysicalFunction yFunction, + PhysicalFunction thetaFunction, + PhysicalFunction tsFunction, + PhysicalFunction px0Function, + PhysicalFunction py0Function, + PhysicalFunction ptheta0Function) { - paramFns.reserve(7); - paramFns.push_back(std::move(x)); - paramFns.push_back(std::move(y)); - paramFns.push_back(std::move(theta)); - paramFns.push_back(std::move(ts)); - paramFns.push_back(std::move(x2)); - paramFns.push_back(std::move(y2)); - paramFns.push_back(std::move(theta2)); + parameterFunctions.reserve(7); + parameterFunctions.push_back(std::move(xFunction)); + parameterFunctions.push_back(std::move(yFunction)); + parameterFunctions.push_back(std::move(thetaFunction)); + parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(px0Function)); + parameterFunctions.push_back(std::move(py0Function)); + parameterFunctions.push_back(std::move(ptheta0Function)); } VarVal NadTposePosePhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto x = paramFns[0].execute(record, arena).cast(); - auto y = paramFns[1].execute(record, arena).cast(); - auto theta = paramFns[2].execute(record, arena).cast(); - auto ts = paramFns[3].execute(record, arena).cast(); - auto x2 = paramFns[4].execute(record, arena).cast(); - auto y2 = paramFns[5].execute(record, arena).cast(); - auto theta2 = paramFns[6].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto x = parameterValues[0].cast>(); + auto y = parameterValues[1].cast>(); + auto theta = parameterValues[2].cast>(); + auto ts = parameterValues[3].cast>(); + auto px0 = parameterValues[4].cast>(); + auto py0 = parameterValues[5].cast>(); + auto ptheta0 = parameterValues[6].cast>(); + const auto result = nautilus::invoke( - +[](double x, double y, double theta, uint64_t ts, double x2, double y2, double theta2) -> double { - try { + +[](double x, + double y, + double theta, + uint64_t ts, + double px0, + double py0, + double ptheta0) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - Pose* pose1 = pose_make_2d(x, y, theta, false, 0); - if (!pose1) return 0.0; - Temporal* inst = (Temporal*)tposeinst_make(pose1, (TimestampTz)ts); - free(pose1); - if (!inst) return 0.0; - Pose* pose2 = pose_make_2d(x2, y2, theta2, false, 0); - if (!pose2) { free(inst); return 0.0; } - double r = nad_tpose_pose(inst, pose2); - free(inst); free(pose2); + std::string tempWkt = fmt::format("Pose(Point({} {}),{})@{}", x, y, theta, MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tpose_in(tempWkt.c_str()); + if (!temp) return 0.0; + Pose* pose0 = pose_make_2d(px0, py0, ptheta0, false, 0); + if (!pose0) { free(temp); return 0.0; } + + double r = nad_tpose_pose(temp, pose0); + free(temp); + free(pose0); return r; - } catch (const std::exception&) { return 0.0; } + } + catch (const std::exception&) + { + return 0.0; + } }, - x, y, theta, ts, x2, y2, theta2); + x, y, theta, ts, px0, py0, ptheta0); + return VarVal(result); } @@ -81,14 +109,14 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterN PRECONDITION(arguments.childFunctions.size() == 7, "NadTposePosePhysicalFunction requires 7 children but got {}", arguments.childFunctions.size()); - return NadTposePosePhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2]), - std::move(arguments.childFunctions[3]), - std::move(arguments.childFunctions[4]), - std::move(arguments.childFunctions[5]), - std::move(arguments.childFunctions[6])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + auto arg5 = std::move(arguments.childFunctions[5]); + auto arg6 = std::move(arguments.childFunctions[6]); + return NadTposePosePhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/NadTposeTposePhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/NadTposeTposePhysicalFunction.cpp index 57f3232df9..6f6e168126 100644 --- a/nes-physical-operators/src/Functions/Meos/NadTposeTposePhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/NadTposeTposePhysicalFunction.cpp @@ -13,17 +13,20 @@ */ #include + #include #include #include +#include #include #include #include #include +#include #include +#include #include #include -#include extern "C" { #include @@ -32,53 +35,76 @@ extern "C" { namespace NES { -NadTposeTposePhysicalFunction::NadTposeTposePhysicalFunction( - PhysicalFunction x1, PhysicalFunction y1, PhysicalFunction theta1, PhysicalFunction ts1, - PhysicalFunction x2, PhysicalFunction y2, PhysicalFunction theta2, PhysicalFunction ts2) +NadTposeTposePhysicalFunction::NadTposeTposePhysicalFunction(PhysicalFunction xFunction, + PhysicalFunction yFunction, + PhysicalFunction thetaFunction, + PhysicalFunction tsFunction, + PhysicalFunction px0Function, + PhysicalFunction py0Function, + PhysicalFunction ptheta0Function, + PhysicalFunction ts0Function) { - paramFns.reserve(8); - paramFns.push_back(std::move(x1)); - paramFns.push_back(std::move(y1)); - paramFns.push_back(std::move(theta1)); - paramFns.push_back(std::move(ts1)); - paramFns.push_back(std::move(x2)); - paramFns.push_back(std::move(y2)); - paramFns.push_back(std::move(theta2)); - paramFns.push_back(std::move(ts2)); + parameterFunctions.reserve(8); + parameterFunctions.push_back(std::move(xFunction)); + parameterFunctions.push_back(std::move(yFunction)); + parameterFunctions.push_back(std::move(thetaFunction)); + parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(px0Function)); + parameterFunctions.push_back(std::move(py0Function)); + parameterFunctions.push_back(std::move(ptheta0Function)); + parameterFunctions.push_back(std::move(ts0Function)); } VarVal NadTposeTposePhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto x1 = paramFns[0].execute(record, arena).cast(); - auto y1 = paramFns[1].execute(record, arena).cast(); - auto theta1 = paramFns[2].execute(record, arena).cast(); - auto ts1 = paramFns[3].execute(record, arena).cast(); - auto x2 = paramFns[4].execute(record, arena).cast(); - auto y2 = paramFns[5].execute(record, arena).cast(); - auto theta2 = paramFns[6].execute(record, arena).cast(); - auto ts2 = paramFns[7].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto x = parameterValues[0].cast>(); + auto y = parameterValues[1].cast>(); + auto theta = parameterValues[2].cast>(); + auto ts = parameterValues[3].cast>(); + auto px0 = parameterValues[4].cast>(); + auto py0 = parameterValues[5].cast>(); + auto ptheta0 = parameterValues[6].cast>(); + auto ts0 = parameterValues[7].cast>(); const auto result = nautilus::invoke( - +[](double x1, double y1, double theta1, uint64_t ts1, - double x2, double y2, double theta2, uint64_t ts2) -> double { - try { + +[](double x, + double y, + double theta, + uint64_t ts, + double px0, + double py0, + double ptheta0, + uint64_t ts0) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - Pose* p1 = pose_make_2d(x1, y1, theta1, false, 0); - if (!p1) return 0.0; - Temporal* inst1 = (Temporal*)tposeinst_make(p1, (TimestampTz)ts1); - free(p1); - if (!inst1) return 0.0; - Pose* p2 = pose_make_2d(x2, y2, theta2, false, 0); - if (!p2) { free(inst1); return 0.0; } - Temporal* inst2 = (Temporal*)tposeinst_make(p2, (TimestampTz)ts2); - free(p2); - if (!inst2) { free(inst1); return 0.0; } - double r = nad_tpose_tpose(inst1, inst2); - free(inst1); free(inst2); + std::string tempWkt = fmt::format("Pose(Point({} {}),{})@{}", x, y, theta, MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tpose_in(tempWkt.c_str()); + if (!temp) return 0.0; + Pose* pose0A = pose_make_2d(px0, py0, ptheta0, false, 0); + if (!pose0A) { free(temp); return 0.0; } + Temporal* inst0 = (Temporal*)tposeinst_make(pose0A, (TimestampTz)ts0); + free(pose0A); + if (!inst0) { free(temp); return 0.0; } + + double r = nad_tpose_tpose(temp, inst0); + free(temp); + free(inst0); return r; - } catch (const std::exception&) { return -1.0; } + } + catch (const std::exception&) + { + return 0.0; + } }, - x1, y1, theta1, ts1, x2, y2, theta2, ts2); + x, y, theta, ts, px0, py0, ptheta0, ts0); return VarVal(result); } @@ -89,14 +115,15 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterN PRECONDITION(arguments.childFunctions.size() == 8, "NadTposeTposePhysicalFunction requires 8 children but got {}", arguments.childFunctions.size()); - return NadTposeTposePhysicalFunction(std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2]), - std::move(arguments.childFunctions[3]), - std::move(arguments.childFunctions[4]), - std::move(arguments.childFunctions[5]), - std::move(arguments.childFunctions[6]), - std::move(arguments.childFunctions[7])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + auto arg5 = std::move(arguments.childFunctions[5]); + auto arg6 = std::move(arguments.childFunctions[6]); + auto arg7 = std::move(arguments.childFunctions[7]); + return NadTposeTposePhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6), std::move(arg7)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/QuadbinCellAreaPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/QuadbinCellAreaPhysicalFunction.cpp index 3289b28210..a9054cd004 100644 --- a/nes-physical-operators/src/Functions/Meos/QuadbinCellAreaPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/QuadbinCellAreaPhysicalFunction.cpp @@ -13,14 +13,18 @@ */ #include + #include #include #include +#include #include #include #include #include +#include #include +#include #include #include @@ -28,28 +32,42 @@ extern "C" { #include #include } -#include -#include namespace NES { -QuadbinCellAreaPhysicalFunction::QuadbinCellAreaPhysicalFunction(PhysicalFunction cell) +QuadbinCellAreaPhysicalFunction::QuadbinCellAreaPhysicalFunction(PhysicalFunction cellFunction) { - paramFns.reserve(1); - paramFns.push_back(std::move(cell)); + parameterFunctions.reserve(1); + parameterFunctions.push_back(std::move(cellFunction)); } VarVal QuadbinCellAreaPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto cell = paramFns[0].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto cell = parameterValues[0].cast>(); + const auto result = nautilus::invoke( +[](uint64_t cell) -> double { - try { + try + { MEOS::Meos::ensureMeosInitialized(); - return quadbin_cell_area((Quadbin)cell); - } catch (const std::exception&) { return 0.0; } + + double r = quadbin_cell_area((Quadbin)cell); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, cell); + return VarVal(result); } @@ -59,8 +77,8 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterQ PRECONDITION(arguments.childFunctions.size() == 1, "QuadbinCellAreaPhysicalFunction requires 1 children but got {}", arguments.childFunctions.size()); - return QuadbinCellAreaPhysicalFunction( - std::move(arguments.childFunctions[0])); + auto arg0 = std::move(arguments.childFunctions[0]); + return QuadbinCellAreaPhysicalFunction(std::move(arg0)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/QuadbinCellToParentPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/QuadbinCellToParentPhysicalFunction.cpp index 047bd77f29..dd4ee73359 100644 --- a/nes-physical-operators/src/Functions/Meos/QuadbinCellToParentPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/QuadbinCellToParentPhysicalFunction.cpp @@ -13,14 +13,19 @@ */ #include + #include #include #include +#include #include #include #include #include +#include #include +#include +#include #include #include @@ -28,39 +33,54 @@ extern "C" { #include #include } -#include -#include namespace NES { -QuadbinCellToParentPhysicalFunction::QuadbinCellToParentPhysicalFunction(PhysicalFunction cell, PhysicalFunction res) +QuadbinCellToParentPhysicalFunction::QuadbinCellToParentPhysicalFunction(PhysicalFunction cellFunction, + PhysicalFunction resFunction) { - paramFns.reserve(2); - paramFns.push_back(std::move(cell)); - paramFns.push_back(std::move(res)); + parameterFunctions.reserve(2); + parameterFunctions.push_back(std::move(cellFunction)); + parameterFunctions.push_back(std::move(resFunction)); } VarVal QuadbinCellToParentPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto cell = paramFns[0].execute(record, arena).cast(); - auto res = paramFns[1].execute(record, arena).cast(); - constexpr uint32_t MAX_LEN = 32; + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto cell = parameterValues[0].cast>(); + auto res = parameterValues[1].cast>(); + + constexpr uint32_t MAX_LEN = 4096; auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); const auto actualLen = nautilus::invoke( - +[](uint64_t cell, uint64_t res, char* buf, uint32_t bufMax) -> uint32_t { - try { + +[](uint64_t cell, + uint64_t res, + char* buf, + uint32_t bufMax) -> uint32_t { + try + { MEOS::Meos::ensureMeosInitialized(); - Quadbin parent = quadbin_cell_to_parent((Quadbin)cell, (uint32_t)res); - if (parent == 0) return 0u; - char* s = quadbin_index_to_string(parent); - if (!s) return 0u; - uint32_t len = (uint32_t)strlen(s); + + Quadbin qcell = quadbin_cell_to_parent((Quadbin)cell, (uint32_t)res); + char* qstr = quadbin_index_to_string(qcell); + if (!qstr) return 0u; + uint32_t len = static_cast(strlen(qstr)); if (len > bufMax) len = bufMax; - memcpy(buf, s, len); - free(s); + memcpy(buf, qstr, len); + free(qstr); return len; - } catch (const std::exception&) { return 0u; } + } + catch (const std::exception&) + { + return 0u; + } }, cell, res, outBuf.getContent(), nautilus::val(MAX_LEN)); @@ -74,9 +94,9 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterQ PRECONDITION(arguments.childFunctions.size() == 2, "QuadbinCellToParentPhysicalFunction requires 2 children but got {}", arguments.childFunctions.size()); - return QuadbinCellToParentPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + return QuadbinCellToParentPhysicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/QuadbinCellToQuadkeyPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/QuadbinCellToQuadkeyPhysicalFunction.cpp index a45874a29f..e0fbfc1382 100644 --- a/nes-physical-operators/src/Functions/Meos/QuadbinCellToQuadkeyPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/QuadbinCellToQuadkeyPhysicalFunction.cpp @@ -13,14 +13,19 @@ */ #include + #include #include #include +#include #include #include #include #include +#include #include +#include +#include #include #include @@ -28,35 +33,49 @@ extern "C" { #include #include } -#include -#include namespace NES { -QuadbinCellToQuadkeyPhysicalFunction::QuadbinCellToQuadkeyPhysicalFunction(PhysicalFunction cell) +QuadbinCellToQuadkeyPhysicalFunction::QuadbinCellToQuadkeyPhysicalFunction(PhysicalFunction cellFunction) { - paramFns.reserve(1); - paramFns.push_back(std::move(cell)); + parameterFunctions.reserve(1); + parameterFunctions.push_back(std::move(cellFunction)); } VarVal QuadbinCellToQuadkeyPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto cell = paramFns[0].execute(record, arena).cast(); - constexpr uint32_t MAX_LEN = 64; + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto cell = parameterValues[0].cast>(); + + constexpr uint32_t MAX_LEN = 4096; auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); const auto actualLen = nautilus::invoke( - +[](uint64_t cell, char* buf, uint32_t bufMax) -> uint32_t { - try { + +[](uint64_t cell, + char* buf, + uint32_t bufMax) -> uint32_t { + try + { MEOS::Meos::ensureMeosInitialized(); - char* s = quadbin_cell_to_quadkey((Quadbin)cell); - if (!s) return 0u; - uint32_t len = (uint32_t)strlen(s); + + char* out = quadbin_cell_to_quadkey((Quadbin)cell); + if (!out) return 0u; + uint32_t len = static_cast(strlen(out)); if (len > bufMax) len = bufMax; - memcpy(buf, s, len); - free(s); + memcpy(buf, out, len); + free(out); return len; - } catch (const std::exception&) { return 0u; } + } + catch (const std::exception&) + { + return 0u; + } }, cell, outBuf.getContent(), nautilus::val(MAX_LEN)); @@ -70,8 +89,8 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterQ PRECONDITION(arguments.childFunctions.size() == 1, "QuadbinCellToQuadkeyPhysicalFunction requires 1 children but got {}", arguments.childFunctions.size()); - return QuadbinCellToQuadkeyPhysicalFunction( - std::move(arguments.childFunctions[0])); + auto arg0 = std::move(arguments.childFunctions[0]); + return QuadbinCellToQuadkeyPhysicalFunction(std::move(arg0)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/QuadbinCmpPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/QuadbinCmpPhysicalFunction.cpp index 87b8c8e616..3fc15db52f 100644 --- a/nes-physical-operators/src/Functions/Meos/QuadbinCmpPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/QuadbinCmpPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -21,7 +22,9 @@ #include #include #include +#include #include +#include #include #include @@ -32,33 +35,55 @@ extern "C" { namespace NES { -QuadbinCmpPhysicalFunction::QuadbinCmpPhysicalFunction(PhysicalFunction a, PhysicalFunction b) +QuadbinCmpPhysicalFunction::QuadbinCmpPhysicalFunction(PhysicalFunction aFunction, + PhysicalFunction bFunction) { - paramFns.reserve(2); - paramFns.push_back(std::move(a)); - paramFns.push_back(std::move(b)); + parameterFunctions.reserve(2); + parameterFunctions.push_back(std::move(aFunction)); + parameterFunctions.push_back(std::move(bFunction)); } -VarVal QuadbinCmpPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto a = paramFns[0].execute(record, arena).cast(); - auto b = paramFns[1].execute(record, arena).cast(); +VarVal QuadbinCmpPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto a = parameterValues[0].cast>(); + auto b = parameterValues[1].cast>(); + const auto result = nautilus::invoke( - +[](uint64_t a, uint64_t b) -> double { - MEOS::Meos::ensureMeosInitialized(); - return (double)quadbin_cmp((Quadbin)a, (Quadbin)b); + +[](uint64_t a, + uint64_t b) -> double { + try + { + MEOS::Meos::ensureMeosInitialized(); + + double r = quadbin_cmp((Quadbin)a, (Quadbin)b); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, a, b); + return VarVal(result); } PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterQuadbinCmpPhysicalFunction( PhysicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.childFunctions.size()==2, + PRECONDITION(arguments.childFunctions.size() == 2, "QuadbinCmpPhysicalFunction requires 2 children but got {}", arguments.childFunctions.size()); - return QuadbinCmpPhysicalFunction(std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + return QuadbinCmpPhysicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/QuadbinEqPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/QuadbinEqPhysicalFunction.cpp index 5c419aa581..fecfd26dce 100644 --- a/nes-physical-operators/src/Functions/Meos/QuadbinEqPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/QuadbinEqPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -21,7 +22,9 @@ #include #include #include +#include #include +#include #include #include @@ -32,34 +35,55 @@ extern "C" { namespace NES { -QuadbinEqPhysicalFunction::QuadbinEqPhysicalFunction(PhysicalFunction a, PhysicalFunction b) +QuadbinEqPhysicalFunction::QuadbinEqPhysicalFunction(PhysicalFunction aFunction, + PhysicalFunction bFunction) { - paramFns.reserve(2); - paramFns.push_back(std::move(a)); - paramFns.push_back(std::move(b)); + parameterFunctions.reserve(2); + parameterFunctions.push_back(std::move(aFunction)); + parameterFunctions.push_back(std::move(bFunction)); } -VarVal QuadbinEqPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto a = paramFns[0].execute(record, arena).cast(); - auto b = paramFns[1].execute(record, arena).cast(); +VarVal QuadbinEqPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto a = parameterValues[0].cast>(); + auto b = parameterValues[1].cast>(); + const auto result = nautilus::invoke( - +[](uint64_t a, uint64_t b) -> double { - MEOS::Meos::ensureMeosInitialized(); - bool r = quadbin_eq((Quadbin)a, (Quadbin)b); - return r ? 1.0 : 0.0; + +[](uint64_t a, + uint64_t b) -> double { + try + { + MEOS::Meos::ensureMeosInitialized(); + + double r = quadbin_eq((Quadbin)a, (Quadbin)b); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, a, b); + return VarVal(result); } PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterQuadbinEqPhysicalFunction( PhysicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.childFunctions.size()==2, + PRECONDITION(arguments.childFunctions.size() == 2, "QuadbinEqPhysicalFunction requires 2 children but got {}", arguments.childFunctions.size()); - return QuadbinEqPhysicalFunction(std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + return QuadbinEqPhysicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/QuadbinGePhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/QuadbinGePhysicalFunction.cpp index 7162678576..c730703056 100644 --- a/nes-physical-operators/src/Functions/Meos/QuadbinGePhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/QuadbinGePhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -21,7 +22,9 @@ #include #include #include +#include #include +#include #include #include @@ -32,34 +35,55 @@ extern "C" { namespace NES { -QuadbinGePhysicalFunction::QuadbinGePhysicalFunction(PhysicalFunction a, PhysicalFunction b) +QuadbinGePhysicalFunction::QuadbinGePhysicalFunction(PhysicalFunction aFunction, + PhysicalFunction bFunction) { - paramFns.reserve(2); - paramFns.push_back(std::move(a)); - paramFns.push_back(std::move(b)); + parameterFunctions.reserve(2); + parameterFunctions.push_back(std::move(aFunction)); + parameterFunctions.push_back(std::move(bFunction)); } -VarVal QuadbinGePhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto a = paramFns[0].execute(record, arena).cast(); - auto b = paramFns[1].execute(record, arena).cast(); +VarVal QuadbinGePhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto a = parameterValues[0].cast>(); + auto b = parameterValues[1].cast>(); + const auto result = nautilus::invoke( - +[](uint64_t a, uint64_t b) -> double { - MEOS::Meos::ensureMeosInitialized(); - bool r = quadbin_ge((Quadbin)a, (Quadbin)b); - return r ? 1.0 : 0.0; + +[](uint64_t a, + uint64_t b) -> double { + try + { + MEOS::Meos::ensureMeosInitialized(); + + double r = quadbin_ge((Quadbin)a, (Quadbin)b); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, a, b); + return VarVal(result); } PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterQuadbinGePhysicalFunction( PhysicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.childFunctions.size()==2, + PRECONDITION(arguments.childFunctions.size() == 2, "QuadbinGePhysicalFunction requires 2 children but got {}", arguments.childFunctions.size()); - return QuadbinGePhysicalFunction(std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + return QuadbinGePhysicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/QuadbinGetResolutionPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/QuadbinGetResolutionPhysicalFunction.cpp index 0a725eeef1..3c0a0038f2 100644 --- a/nes-physical-operators/src/Functions/Meos/QuadbinGetResolutionPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/QuadbinGetResolutionPhysicalFunction.cpp @@ -13,14 +13,18 @@ */ #include + #include #include #include +#include #include #include #include #include +#include #include +#include #include #include @@ -28,28 +32,42 @@ extern "C" { #include #include } -#include -#include namespace NES { -QuadbinGetResolutionPhysicalFunction::QuadbinGetResolutionPhysicalFunction(PhysicalFunction cell) +QuadbinGetResolutionPhysicalFunction::QuadbinGetResolutionPhysicalFunction(PhysicalFunction cellFunction) { - paramFns.reserve(1); - paramFns.push_back(std::move(cell)); + parameterFunctions.reserve(1); + parameterFunctions.push_back(std::move(cellFunction)); } VarVal QuadbinGetResolutionPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto cell = paramFns[0].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto cell = parameterValues[0].cast>(); + const auto result = nautilus::invoke( +[](uint64_t cell) -> double { - try { + try + { MEOS::Meos::ensureMeosInitialized(); - return (double)quadbin_get_resolution((Quadbin)cell); - } catch (const std::exception&) { return 0.0; } + + double r = quadbin_get_resolution((Quadbin)cell); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, cell); + return VarVal(result); } @@ -59,8 +77,8 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterQ PRECONDITION(arguments.childFunctions.size() == 1, "QuadbinGetResolutionPhysicalFunction requires 1 children but got {}", arguments.childFunctions.size()); - return QuadbinGetResolutionPhysicalFunction( - std::move(arguments.childFunctions[0])); + auto arg0 = std::move(arguments.childFunctions[0]); + return QuadbinGetResolutionPhysicalFunction(std::move(arg0)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/QuadbinGtPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/QuadbinGtPhysicalFunction.cpp index 953e1e9076..5f163b430a 100644 --- a/nes-physical-operators/src/Functions/Meos/QuadbinGtPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/QuadbinGtPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -21,7 +22,9 @@ #include #include #include +#include #include +#include #include #include @@ -32,34 +35,55 @@ extern "C" { namespace NES { -QuadbinGtPhysicalFunction::QuadbinGtPhysicalFunction(PhysicalFunction a, PhysicalFunction b) +QuadbinGtPhysicalFunction::QuadbinGtPhysicalFunction(PhysicalFunction aFunction, + PhysicalFunction bFunction) { - paramFns.reserve(2); - paramFns.push_back(std::move(a)); - paramFns.push_back(std::move(b)); + parameterFunctions.reserve(2); + parameterFunctions.push_back(std::move(aFunction)); + parameterFunctions.push_back(std::move(bFunction)); } -VarVal QuadbinGtPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto a = paramFns[0].execute(record, arena).cast(); - auto b = paramFns[1].execute(record, arena).cast(); +VarVal QuadbinGtPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto a = parameterValues[0].cast>(); + auto b = parameterValues[1].cast>(); + const auto result = nautilus::invoke( - +[](uint64_t a, uint64_t b) -> double { - MEOS::Meos::ensureMeosInitialized(); - bool r = quadbin_gt((Quadbin)a, (Quadbin)b); - return r ? 1.0 : 0.0; + +[](uint64_t a, + uint64_t b) -> double { + try + { + MEOS::Meos::ensureMeosInitialized(); + + double r = quadbin_gt((Quadbin)a, (Quadbin)b); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, a, b); + return VarVal(result); } PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterQuadbinGtPhysicalFunction( PhysicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.childFunctions.size()==2, + PRECONDITION(arguments.childFunctions.size() == 2, "QuadbinGtPhysicalFunction requires 2 children but got {}", arguments.childFunctions.size()); - return QuadbinGtPhysicalFunction(std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + return QuadbinGtPhysicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/QuadbinIsValidCellPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/QuadbinIsValidCellPhysicalFunction.cpp index 60360c76c4..a46e6b163a 100644 --- a/nes-physical-operators/src/Functions/Meos/QuadbinIsValidCellPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/QuadbinIsValidCellPhysicalFunction.cpp @@ -13,14 +13,18 @@ */ #include + #include #include #include +#include #include #include #include #include +#include #include +#include #include #include @@ -28,28 +32,42 @@ extern "C" { #include #include } -#include -#include namespace NES { -QuadbinIsValidCellPhysicalFunction::QuadbinIsValidCellPhysicalFunction(PhysicalFunction cell) +QuadbinIsValidCellPhysicalFunction::QuadbinIsValidCellPhysicalFunction(PhysicalFunction cellFunction) { - paramFns.reserve(1); - paramFns.push_back(std::move(cell)); + parameterFunctions.reserve(1); + parameterFunctions.push_back(std::move(cellFunction)); } VarVal QuadbinIsValidCellPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto cell = paramFns[0].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto cell = parameterValues[0].cast>(); + const auto result = nautilus::invoke( +[](uint64_t cell) -> double { - try { + try + { MEOS::Meos::ensureMeosInitialized(); - return quadbin_is_valid_cell((Quadbin)cell) ? 1.0 : 0.0; - } catch (const std::exception&) { return 0.0; } + + double r = quadbin_is_valid_cell((Quadbin)cell); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, cell); + return VarVal(result); } @@ -59,8 +77,8 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterQ PRECONDITION(arguments.childFunctions.size() == 1, "QuadbinIsValidCellPhysicalFunction requires 1 children but got {}", arguments.childFunctions.size()); - return QuadbinIsValidCellPhysicalFunction( - std::move(arguments.childFunctions[0])); + auto arg0 = std::move(arguments.childFunctions[0]); + return QuadbinIsValidCellPhysicalFunction(std::move(arg0)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/QuadbinLePhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/QuadbinLePhysicalFunction.cpp index b3b898c384..28d51f6789 100644 --- a/nes-physical-operators/src/Functions/Meos/QuadbinLePhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/QuadbinLePhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -21,7 +22,9 @@ #include #include #include +#include #include +#include #include #include @@ -32,34 +35,55 @@ extern "C" { namespace NES { -QuadbinLePhysicalFunction::QuadbinLePhysicalFunction(PhysicalFunction a, PhysicalFunction b) +QuadbinLePhysicalFunction::QuadbinLePhysicalFunction(PhysicalFunction aFunction, + PhysicalFunction bFunction) { - paramFns.reserve(2); - paramFns.push_back(std::move(a)); - paramFns.push_back(std::move(b)); + parameterFunctions.reserve(2); + parameterFunctions.push_back(std::move(aFunction)); + parameterFunctions.push_back(std::move(bFunction)); } -VarVal QuadbinLePhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto a = paramFns[0].execute(record, arena).cast(); - auto b = paramFns[1].execute(record, arena).cast(); +VarVal QuadbinLePhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto a = parameterValues[0].cast>(); + auto b = parameterValues[1].cast>(); + const auto result = nautilus::invoke( - +[](uint64_t a, uint64_t b) -> double { - MEOS::Meos::ensureMeosInitialized(); - bool r = quadbin_le((Quadbin)a, (Quadbin)b); - return r ? 1.0 : 0.0; + +[](uint64_t a, + uint64_t b) -> double { + try + { + MEOS::Meos::ensureMeosInitialized(); + + double r = quadbin_le((Quadbin)a, (Quadbin)b); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, a, b); + return VarVal(result); } PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterQuadbinLePhysicalFunction( PhysicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.childFunctions.size()==2, + PRECONDITION(arguments.childFunctions.size() == 2, "QuadbinLePhysicalFunction requires 2 children but got {}", arguments.childFunctions.size()); - return QuadbinLePhysicalFunction(std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + return QuadbinLePhysicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/QuadbinLtPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/QuadbinLtPhysicalFunction.cpp index 57d6c86ed1..077c6bd3aa 100644 --- a/nes-physical-operators/src/Functions/Meos/QuadbinLtPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/QuadbinLtPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -21,7 +22,9 @@ #include #include #include +#include #include +#include #include #include @@ -32,34 +35,55 @@ extern "C" { namespace NES { -QuadbinLtPhysicalFunction::QuadbinLtPhysicalFunction(PhysicalFunction a, PhysicalFunction b) +QuadbinLtPhysicalFunction::QuadbinLtPhysicalFunction(PhysicalFunction aFunction, + PhysicalFunction bFunction) { - paramFns.reserve(2); - paramFns.push_back(std::move(a)); - paramFns.push_back(std::move(b)); + parameterFunctions.reserve(2); + parameterFunctions.push_back(std::move(aFunction)); + parameterFunctions.push_back(std::move(bFunction)); } -VarVal QuadbinLtPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto a = paramFns[0].execute(record, arena).cast(); - auto b = paramFns[1].execute(record, arena).cast(); +VarVal QuadbinLtPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto a = parameterValues[0].cast>(); + auto b = parameterValues[1].cast>(); + const auto result = nautilus::invoke( - +[](uint64_t a, uint64_t b) -> double { - MEOS::Meos::ensureMeosInitialized(); - bool r = quadbin_lt((Quadbin)a, (Quadbin)b); - return r ? 1.0 : 0.0; + +[](uint64_t a, + uint64_t b) -> double { + try + { + MEOS::Meos::ensureMeosInitialized(); + + double r = quadbin_lt((Quadbin)a, (Quadbin)b); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, a, b); + return VarVal(result); } PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterQuadbinLtPhysicalFunction( PhysicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.childFunctions.size()==2, + PRECONDITION(arguments.childFunctions.size() == 2, "QuadbinLtPhysicalFunction requires 2 children but got {}", arguments.childFunctions.size()); - return QuadbinLtPhysicalFunction(std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + return QuadbinLtPhysicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/QuadbinNePhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/QuadbinNePhysicalFunction.cpp index a7c9bef66a..8831df9e2d 100644 --- a/nes-physical-operators/src/Functions/Meos/QuadbinNePhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/QuadbinNePhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -21,7 +22,9 @@ #include #include #include +#include #include +#include #include #include @@ -32,34 +35,55 @@ extern "C" { namespace NES { -QuadbinNePhysicalFunction::QuadbinNePhysicalFunction(PhysicalFunction a, PhysicalFunction b) +QuadbinNePhysicalFunction::QuadbinNePhysicalFunction(PhysicalFunction aFunction, + PhysicalFunction bFunction) { - paramFns.reserve(2); - paramFns.push_back(std::move(a)); - paramFns.push_back(std::move(b)); + parameterFunctions.reserve(2); + parameterFunctions.push_back(std::move(aFunction)); + parameterFunctions.push_back(std::move(bFunction)); } -VarVal QuadbinNePhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto a = paramFns[0].execute(record, arena).cast(); - auto b = paramFns[1].execute(record, arena).cast(); +VarVal QuadbinNePhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto a = parameterValues[0].cast>(); + auto b = parameterValues[1].cast>(); + const auto result = nautilus::invoke( - +[](uint64_t a, uint64_t b) -> double { - MEOS::Meos::ensureMeosInitialized(); - bool r = quadbin_ne((Quadbin)a, (Quadbin)b); - return r ? 1.0 : 0.0; + +[](uint64_t a, + uint64_t b) -> double { + try + { + MEOS::Meos::ensureMeosInitialized(); + + double r = quadbin_ne((Quadbin)a, (Quadbin)b); + return r; + } + catch (const std::exception&) + { + return 0.0; + } }, a, b); + return VarVal(result); } PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterQuadbinNePhysicalFunction( PhysicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.childFunctions.size()==2, + PRECONDITION(arguments.childFunctions.size() == 2, "QuadbinNePhysicalFunction requires 2 children but got {}", arguments.childFunctions.size()); - return QuadbinNePhysicalFunction(std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + return QuadbinNePhysicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/QuadbinPointToCellPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/QuadbinPointToCellPhysicalFunction.cpp index eb526d8409..3a951eb77f 100644 --- a/nes-physical-operators/src/Functions/Meos/QuadbinPointToCellPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/QuadbinPointToCellPhysicalFunction.cpp @@ -13,14 +13,19 @@ */ #include + #include #include #include +#include #include #include #include #include +#include #include +#include +#include #include #include @@ -28,41 +33,58 @@ extern "C" { #include #include } -#include -#include namespace NES { -QuadbinPointToCellPhysicalFunction::QuadbinPointToCellPhysicalFunction(PhysicalFunction lon, PhysicalFunction lat, PhysicalFunction res) +QuadbinPointToCellPhysicalFunction::QuadbinPointToCellPhysicalFunction(PhysicalFunction lonFunction, + PhysicalFunction latFunction, + PhysicalFunction resFunction) { - paramFns.reserve(3); - paramFns.push_back(std::move(lon)); - paramFns.push_back(std::move(lat)); - paramFns.push_back(std::move(res)); + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(lonFunction)); + parameterFunctions.push_back(std::move(latFunction)); + parameterFunctions.push_back(std::move(resFunction)); } VarVal QuadbinPointToCellPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto lon = paramFns[0].execute(record, arena).cast(); - auto lat = paramFns[1].execute(record, arena).cast(); - auto res = paramFns[2].execute(record, arena).cast(); - constexpr uint32_t MAX_LEN = 32; + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto lon = parameterValues[0].cast>(); + auto lat = parameterValues[1].cast>(); + auto res = parameterValues[2].cast>(); + + constexpr uint32_t MAX_LEN = 4096; auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); const auto actualLen = nautilus::invoke( - +[](double lon, double lat, uint64_t res, char* buf, uint32_t bufMax) -> uint32_t { - try { + +[](double lon, + double lat, + uint64_t res, + char* buf, + uint32_t bufMax) -> uint32_t { + try + { MEOS::Meos::ensureMeosInitialized(); - Quadbin cell = quadbin_point_to_cell(lon, lat, (uint32_t)res); - if (cell == 0) return 0u; - char* s = quadbin_index_to_string(cell); - if (!s) return 0u; - uint32_t len = (uint32_t)strlen(s); + + Quadbin qcell = quadbin_point_to_cell(lon, lat, (uint32_t)res); + char* qstr = quadbin_index_to_string(qcell); + if (!qstr) return 0u; + uint32_t len = static_cast(strlen(qstr)); if (len > bufMax) len = bufMax; - memcpy(buf, s, len); - free(s); + memcpy(buf, qstr, len); + free(qstr); return len; - } catch (const std::exception&) { return 0u; } + } + catch (const std::exception&) + { + return 0u; + } }, lon, lat, res, outBuf.getContent(), nautilus::val(MAX_LEN)); @@ -76,10 +98,10 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterQ PRECONDITION(arguments.childFunctions.size() == 3, "QuadbinPointToCellPhysicalFunction requires 3 children but got {}", arguments.childFunctions.size()); - return QuadbinPointToCellPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return QuadbinPointToCellPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/QuadbinTileToCellPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/QuadbinTileToCellPhysicalFunction.cpp index 517bef3c93..b515dfe42f 100644 --- a/nes-physical-operators/src/Functions/Meos/QuadbinTileToCellPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/QuadbinTileToCellPhysicalFunction.cpp @@ -13,14 +13,19 @@ */ #include + #include #include #include +#include #include #include #include #include +#include #include +#include +#include #include #include @@ -28,41 +33,58 @@ extern "C" { #include #include } -#include -#include namespace NES { -QuadbinTileToCellPhysicalFunction::QuadbinTileToCellPhysicalFunction(PhysicalFunction x, PhysicalFunction y, PhysicalFunction z) +QuadbinTileToCellPhysicalFunction::QuadbinTileToCellPhysicalFunction(PhysicalFunction xFunction, + PhysicalFunction yFunction, + PhysicalFunction zFunction) { - paramFns.reserve(3); - paramFns.push_back(std::move(x)); - paramFns.push_back(std::move(y)); - paramFns.push_back(std::move(z)); + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(xFunction)); + parameterFunctions.push_back(std::move(yFunction)); + parameterFunctions.push_back(std::move(zFunction)); } VarVal QuadbinTileToCellPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto x = paramFns[0].execute(record, arena).cast(); - auto y = paramFns[1].execute(record, arena).cast(); - auto z = paramFns[2].execute(record, arena).cast(); - constexpr uint32_t MAX_LEN = 32; + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto x = parameterValues[0].cast>(); + auto y = parameterValues[1].cast>(); + auto z = parameterValues[2].cast>(); + + constexpr uint32_t MAX_LEN = 4096; auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); const auto actualLen = nautilus::invoke( - +[](uint64_t x, uint64_t y, uint64_t z, char* buf, uint32_t bufMax) -> uint32_t { - try { + +[](uint64_t x, + uint64_t y, + uint64_t z, + char* buf, + uint32_t bufMax) -> uint32_t { + try + { MEOS::Meos::ensureMeosInitialized(); - Quadbin cell = quadbin_tile_to_cell((uint32_t)x, (uint32_t)y, (uint32_t)z); - if (cell == 0) return 0u; - char* s = quadbin_index_to_string(cell); - if (!s) return 0u; - uint32_t len = (uint32_t)strlen(s); + + Quadbin qcell = quadbin_tile_to_cell((uint32_t)x, (uint32_t)y, (uint32_t)z); + char* qstr = quadbin_index_to_string(qcell); + if (!qstr) return 0u; + uint32_t len = static_cast(strlen(qstr)); if (len > bufMax) len = bufMax; - memcpy(buf, s, len); - free(s); + memcpy(buf, qstr, len); + free(qstr); return len; - } catch (const std::exception&) { return 0u; } + } + catch (const std::exception&) + { + return 0u; + } }, x, y, z, outBuf.getContent(), nautilus::val(MAX_LEN)); @@ -76,10 +98,10 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterQ PRECONDITION(arguments.childFunctions.size() == 3, "QuadbinTileToCellPhysicalFunction requires 3 children but got {}", arguments.childFunctions.size()); - return QuadbinTileToCellPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return QuadbinTileToCellPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/SubBigintTbigintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/SubBigintTbigintPhysicalFunction.cpp index a6331aec84..aa57db448b 100644 --- a/nes-physical-operators/src/Functions/Meos/SubBigintTbigintPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/SubBigintTbigintPhysicalFunction.cpp @@ -35,12 +35,12 @@ extern "C" { namespace NES { -SubBigintTbigintPhysicalFunction::SubBigintTbigintPhysicalFunction(PhysicalFunction scalarFunction, - PhysicalFunction valueFunction, - PhysicalFunction tsFunction) +SubBigintTbigintPhysicalFunction::SubBigintTbigintPhysicalFunction(PhysicalFunction arg0Function, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction) { parameterFunctions.reserve(3); - parameterFunctions.push_back(std::move(scalarFunction)); + parameterFunctions.push_back(std::move(arg0Function)); parameterFunctions.push_back(std::move(valueFunction)); parameterFunctions.push_back(std::move(tsFunction)); } @@ -50,29 +50,38 @@ VarVal SubBigintTbigintPhysicalFunction::execute(const Record& record, ArenaRef& std::vector parameterValues; parameterValues.reserve(parameterFunctions.size()); for (const auto& function : parameterFunctions) + { parameterValues.emplace_back(function.execute(record, arena)); + } - auto scalar = parameterValues[0].cast>(); - auto value = parameterValues[1].cast>(); - auto ts = parameterValues[2].cast>(); + auto arg0 = parameterValues[0].cast>(); + auto value = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); const auto result = nautilus::invoke( - +[](double scalar_d, double value_d, uint64_t ts) -> double { - try { + +[](double arg0, + double value, + uint64_t ts) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string tempWkt = fmt::format("{}@{}", static_cast(value_d), - MEOS::Meos::convertEpochToTimestamp(ts)); + std::string tempWkt = fmt::format("{}@{}", static_cast(value), MEOS::Meos::convertEpochToTimestamp(ts)); Temporal* temp = tbigint_in(tempWkt.c_str()); if (!temp) return 0.0; - Temporal* res = sub_bigint_tbigint(static_cast(scalar_d), temp); + + Temporal* res = sub_bigint_tbigint(static_cast(arg0), temp); free(temp); if (!res) return 0.0; - double r = static_cast(tbigint_start_value(res)); + double r = tbigint_start_value(res); free(res); return r; - } catch (const std::exception&) { return 0.0; } + } + catch (const std::exception&) + { + return 0.0; + } }, - scalar, value, ts); + arg0, value, ts); return VarVal(result); } diff --git a/nes-physical-operators/src/Functions/Meos/SubFloatTfloatPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/SubFloatTfloatPhysicalFunction.cpp index 1f4e5254ac..db5f8fde12 100644 --- a/nes-physical-operators/src/Functions/Meos/SubFloatTfloatPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/SubFloatTfloatPhysicalFunction.cpp @@ -35,12 +35,12 @@ extern "C" { namespace NES { -SubFloatTfloatPhysicalFunction::SubFloatTfloatPhysicalFunction(PhysicalFunction scalarFunction, - PhysicalFunction valueFunction, - PhysicalFunction tsFunction) +SubFloatTfloatPhysicalFunction::SubFloatTfloatPhysicalFunction(PhysicalFunction arg0Function, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction) { parameterFunctions.reserve(3); - parameterFunctions.push_back(std::move(scalarFunction)); + parameterFunctions.push_back(std::move(arg0Function)); parameterFunctions.push_back(std::move(valueFunction)); parameterFunctions.push_back(std::move(tsFunction)); } @@ -50,28 +50,38 @@ VarVal SubFloatTfloatPhysicalFunction::execute(const Record& record, ArenaRef& a std::vector parameterValues; parameterValues.reserve(parameterFunctions.size()); for (const auto& function : parameterFunctions) + { parameterValues.emplace_back(function.execute(record, arena)); + } - auto scalar = parameterValues[0].cast>(); - auto value = parameterValues[1].cast>(); - auto ts = parameterValues[2].cast>(); + auto arg0 = parameterValues[0].cast>(); + auto value = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); const auto result = nautilus::invoke( - +[](double scalar, double value, uint64_t ts) -> double { - try { + +[](double arg0, + double value, + uint64_t ts) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); std::string tempWkt = fmt::format("{}@{}", value, MEOS::Meos::convertEpochToTimestamp(ts)); Temporal* temp = tfloat_in(tempWkt.c_str()); if (!temp) return 0.0; - Temporal* res = sub_float_tfloat(scalar, temp); + + Temporal* res = sub_float_tfloat(arg0, temp); free(temp); if (!res) return 0.0; double r = tfloat_start_value(res); free(res); return r; - } catch (const std::exception&) { return 0.0; } + } + catch (const std::exception&) + { + return 0.0; + } }, - scalar, value, ts); + arg0, value, ts); return VarVal(result); } diff --git a/nes-physical-operators/src/Functions/Meos/SubIntTintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/SubIntTintPhysicalFunction.cpp index 07f4ec11c7..1a235dc2fe 100644 --- a/nes-physical-operators/src/Functions/Meos/SubIntTintPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/SubIntTintPhysicalFunction.cpp @@ -35,12 +35,12 @@ extern "C" { namespace NES { -SubIntTintPhysicalFunction::SubIntTintPhysicalFunction(PhysicalFunction scalarFunction, - PhysicalFunction valueFunction, - PhysicalFunction tsFunction) +SubIntTintPhysicalFunction::SubIntTintPhysicalFunction(PhysicalFunction arg0Function, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction) { parameterFunctions.reserve(3); - parameterFunctions.push_back(std::move(scalarFunction)); + parameterFunctions.push_back(std::move(arg0Function)); parameterFunctions.push_back(std::move(valueFunction)); parameterFunctions.push_back(std::move(tsFunction)); } @@ -50,28 +50,38 @@ VarVal SubIntTintPhysicalFunction::execute(const Record& record, ArenaRef& arena std::vector parameterValues; parameterValues.reserve(parameterFunctions.size()); for (const auto& function : parameterFunctions) + { parameterValues.emplace_back(function.execute(record, arena)); + } - auto scalar = parameterValues[0].cast>(); - auto value = parameterValues[1].cast>(); - auto ts = parameterValues[2].cast>(); + auto arg0 = parameterValues[0].cast>(); + auto value = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); const auto result = nautilus::invoke( - +[](double scalar_d, double value_d, uint64_t ts) -> double { - try { + +[](int32_t arg0, + int32_t value, + uint64_t ts) -> int { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string tempWkt = fmt::format("{}@{}", static_cast(value_d), MEOS::Meos::convertEpochToTimestamp(ts)); + std::string tempWkt = fmt::format("{}@{}", value, MEOS::Meos::convertEpochToTimestamp(ts)); Temporal* temp = tint_in(tempWkt.c_str()); - if (!temp) return 0.0; - Temporal* res = sub_int_tint(static_cast(scalar_d), temp); + if (!temp) return 0; + + Temporal* res = sub_int_tint(arg0, temp); free(temp); - if (!res) return 0.0; - double r = static_cast(tint_start_value(res)); + if (!res) return 0; + int r = tint_start_value(res); free(res); return r; - } catch (const std::exception&) { return 0.0; } + } + catch (const std::exception&) + { + return 0; + } }, - scalar, value, ts); + arg0, value, ts); return VarVal(result); } diff --git a/nes-physical-operators/src/Functions/Meos/SubTbigintBigintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/SubTbigintBigintPhysicalFunction.cpp index f625c29498..68815b66cd 100644 --- a/nes-physical-operators/src/Functions/Meos/SubTbigintBigintPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/SubTbigintBigintPhysicalFunction.cpp @@ -36,13 +36,13 @@ extern "C" { namespace NES { SubTbigintBigintPhysicalFunction::SubTbigintBigintPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction tsFunction, - PhysicalFunction subtrahendFunction) + PhysicalFunction tsFunction, + PhysicalFunction arg0Function) { parameterFunctions.reserve(3); parameterFunctions.push_back(std::move(valueFunction)); parameterFunctions.push_back(std::move(tsFunction)); - parameterFunctions.push_back(std::move(subtrahendFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } VarVal SubTbigintBigintPhysicalFunction::execute(const Record& record, ArenaRef& arena) const @@ -50,29 +50,38 @@ VarVal SubTbigintBigintPhysicalFunction::execute(const Record& record, ArenaRef& std::vector parameterValues; parameterValues.reserve(parameterFunctions.size()); for (const auto& function : parameterFunctions) + { parameterValues.emplace_back(function.execute(record, arena)); + } - auto value = parameterValues[0].cast>(); - auto ts = parameterValues[1].cast>(); - auto subtrahend = parameterValues[2].cast>(); + auto value = parameterValues[0].cast>(); + auto ts = parameterValues[1].cast>(); + auto arg0 = parameterValues[2].cast>(); const auto result = nautilus::invoke( - +[](double value, uint64_t ts, double subtrahend_d) -> double { - try { + +[](double value, + uint64_t ts, + double arg0) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string tempWkt = fmt::format("{}@{}", static_cast(value), - MEOS::Meos::convertEpochToTimestamp(ts)); + std::string tempWkt = fmt::format("{}@{}", static_cast(value), MEOS::Meos::convertEpochToTimestamp(ts)); Temporal* temp = tbigint_in(tempWkt.c_str()); if (!temp) return 0.0; - Temporal* res = sub_tbigint_bigint(temp, static_cast(subtrahend_d)); + + Temporal* res = sub_tbigint_bigint(temp, static_cast(arg0)); free(temp); if (!res) return 0.0; - double r = static_cast(tbigint_start_value(res)); + double r = tbigint_start_value(res); free(res); return r; - } catch (const std::exception&) { return 0.0; } + } + catch (const std::exception&) + { + return 0.0; + } }, - value, ts, subtrahend); + value, ts, arg0); return VarVal(result); } diff --git a/nes-physical-operators/src/Functions/Meos/SubTfloatFloatPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/SubTfloatFloatPhysicalFunction.cpp index 75e6eb5c39..946478c58e 100644 --- a/nes-physical-operators/src/Functions/Meos/SubTfloatFloatPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/SubTfloatFloatPhysicalFunction.cpp @@ -36,13 +36,13 @@ extern "C" { namespace NES { SubTfloatFloatPhysicalFunction::SubTfloatFloatPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction tsFunction, - PhysicalFunction subtrahendFunction) + PhysicalFunction tsFunction, + PhysicalFunction arg0Function) { parameterFunctions.reserve(3); parameterFunctions.push_back(std::move(valueFunction)); parameterFunctions.push_back(std::move(tsFunction)); - parameterFunctions.push_back(std::move(subtrahendFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } VarVal SubTfloatFloatPhysicalFunction::execute(const Record& record, ArenaRef& arena) const @@ -50,28 +50,38 @@ VarVal SubTfloatFloatPhysicalFunction::execute(const Record& record, ArenaRef& a std::vector parameterValues; parameterValues.reserve(parameterFunctions.size()); for (const auto& function : parameterFunctions) + { parameterValues.emplace_back(function.execute(record, arena)); + } - auto value = parameterValues[0].cast>(); - auto ts = parameterValues[1].cast>(); - auto subtrahend = parameterValues[2].cast>(); + auto value = parameterValues[0].cast>(); + auto ts = parameterValues[1].cast>(); + auto arg0 = parameterValues[2].cast>(); const auto result = nautilus::invoke( - +[](double value, uint64_t ts, double subtrahend) -> double { - try { + +[](double value, + uint64_t ts, + double arg0) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); std::string tempWkt = fmt::format("{}@{}", value, MEOS::Meos::convertEpochToTimestamp(ts)); Temporal* temp = tfloat_in(tempWkt.c_str()); if (!temp) return 0.0; - Temporal* res = sub_tfloat_float(temp, subtrahend); + + Temporal* res = sub_tfloat_float(temp, arg0); free(temp); if (!res) return 0.0; double r = tfloat_start_value(res); free(res); return r; - } catch (const std::exception&) { return 0.0; } + } + catch (const std::exception&) + { + return 0.0; + } }, - value, ts, subtrahend); + value, ts, arg0); return VarVal(result); } diff --git a/nes-physical-operators/src/Functions/Meos/SubTintIntPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/SubTintIntPhysicalFunction.cpp index c086705591..ef184b3853 100644 --- a/nes-physical-operators/src/Functions/Meos/SubTintIntPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/SubTintIntPhysicalFunction.cpp @@ -36,13 +36,13 @@ extern "C" { namespace NES { SubTintIntPhysicalFunction::SubTintIntPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction tsFunction, - PhysicalFunction subtrahendFunction) + PhysicalFunction tsFunction, + PhysicalFunction arg0Function) { parameterFunctions.reserve(3); parameterFunctions.push_back(std::move(valueFunction)); parameterFunctions.push_back(std::move(tsFunction)); - parameterFunctions.push_back(std::move(subtrahendFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } VarVal SubTintIntPhysicalFunction::execute(const Record& record, ArenaRef& arena) const @@ -50,28 +50,38 @@ VarVal SubTintIntPhysicalFunction::execute(const Record& record, ArenaRef& arena std::vector parameterValues; parameterValues.reserve(parameterFunctions.size()); for (const auto& function : parameterFunctions) + { parameterValues.emplace_back(function.execute(record, arena)); + } - auto value = parameterValues[0].cast>(); - auto ts = parameterValues[1].cast>(); - auto subtrahend = parameterValues[2].cast>(); + auto value = parameterValues[0].cast>(); + auto ts = parameterValues[1].cast>(); + auto arg0 = parameterValues[2].cast>(); const auto result = nautilus::invoke( - +[](double value, uint64_t ts, double subtrahend_d) -> double { - try { + +[](int32_t value, + uint64_t ts, + int32_t arg0) -> int { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string tempWkt = fmt::format("{}@{}", static_cast(value), MEOS::Meos::convertEpochToTimestamp(ts)); + std::string tempWkt = fmt::format("{}@{}", value, MEOS::Meos::convertEpochToTimestamp(ts)); Temporal* temp = tint_in(tempWkt.c_str()); - if (!temp) return 0.0; - Temporal* res = sub_tint_int(temp, static_cast(subtrahend_d)); + if (!temp) return 0; + + Temporal* res = sub_tint_int(temp, arg0); free(temp); - if (!res) return 0.0; - double r = static_cast(tint_start_value(res)); + if (!res) return 0; + int r = tint_start_value(res); free(res); return r; - } catch (const std::exception&) { return 0.0; } + } + catch (const std::exception&) + { + return 0; + } }, - value, ts, subtrahend); + value, ts, arg0); return VarVal(result); } diff --git a/nes-physical-operators/src/Functions/Meos/SubTnumberTnumberPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/SubTnumberTnumberPhysicalFunction.cpp index 4c57908824..23e072d343 100644 --- a/nes-physical-operators/src/Functions/Meos/SubTnumberTnumberPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/SubTnumberTnumberPhysicalFunction.cpp @@ -22,7 +22,8 @@ #include #include #include -#include +#include +#include #include #include #include @@ -35,14 +36,12 @@ extern "C" { namespace NES { -SubTnumberTnumberPhysicalFunction::SubTnumberTnumberPhysicalFunction(PhysicalFunction value1Function, - PhysicalFunction value2Function, - PhysicalFunction tsFunction) +SubTnumberTnumberPhysicalFunction::SubTnumberTnumberPhysicalFunction(PhysicalFunction trajFunction, + PhysicalFunction arg0Function) { - parameterFunctions.reserve(3); - parameterFunctions.push_back(std::move(value1Function)); - parameterFunctions.push_back(std::move(value2Function)); - parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.reserve(2); + parameterFunctions.push_back(std::move(trajFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } VarVal SubTnumberTnumberPhysicalFunction::execute(const Record& record, ArenaRef& arena) const @@ -50,45 +49,74 @@ VarVal SubTnumberTnumberPhysicalFunction::execute(const Record& record, ArenaRef std::vector parameterValues; parameterValues.reserve(parameterFunctions.size()); for (const auto& function : parameterFunctions) + { parameterValues.emplace_back(function.execute(record, arena)); + } - auto value1 = parameterValues[0].cast>(); - auto value2 = parameterValues[1].cast>(); - auto ts = parameterValues[2].cast>(); + auto traj = parameterValues[0].cast(); + auto arg0 = parameterValues[1].cast(); - const auto result = nautilus::invoke( - +[](double value1, double value2, uint64_t ts) -> double { - try { + // Call MEOS f(Temporal*, Temporal*) -> Temporal* over the two hex-WKB + // operands and serialize the result back to hex-WKB inside the invoke; the + // returned heap string is copied into the arena below. Both operands and the + // MEOS result are freed here. + auto hexStr = nautilus::invoke( + +[](const char* aPtr, uint32_t aSize, const char* bPtr, uint32_t bSize) -> char* + { + try + { MEOS::Meos::ensureMeosInitialized(); - const std::string tsStr = MEOS::Meos::convertEpochToTimestamp(ts); - std::string wkt1 = fmt::format("{}@{}", value1, tsStr); - std::string wkt2 = fmt::format("{}@{}", value2, tsStr); - Temporal* t1 = tfloat_in(wkt1.c_str()); - Temporal* t2 = tfloat_in(wkt2.c_str()); - if (!t1 || !t2) { free(t1); free(t2); return 0.0; } - Temporal* res = sub_tnumber_tnumber(t1, t2); - free(t1); free(t2); - if (!res) return 0.0; - double r = tfloat_start_value(res); + std::string aHex(aPtr, aSize); + std::string bHex(bPtr, bSize); + Temporal* a = temporal_from_hexwkb(aHex.c_str()); + if (!a) return (char*) nullptr; + Temporal* b = temporal_from_hexwkb(bHex.c_str()); + if (!b) { free(a); return (char*) nullptr; } + Temporal* res = sub_tnumber_tnumber(a, b); + free(a); + free(b); + if (!res) return (char*) nullptr; + size_t hexSize = 0; + char* hexOut = temporal_as_hexwkb(res, 0, &hexSize); free(res); - return r; - } catch (const std::exception&) { return 0.0; } + return hexOut; + } + catch (const std::exception&) + { + return (char*) nullptr; + } }, - value1, value2, ts); + traj.getContent(), traj.getContentSize(), arg0.getContent(), arg0.getContentSize()); - return VarVal(result); + const auto hexLen = nautilus::invoke( + +[](const char* s) -> uint32_t { return s ? (uint32_t) strlen(s) : (uint32_t) 0; }, + hexStr); + + auto variableSized = arena.allocateVariableSizedData(hexLen); + + nautilus::invoke( + +[](int8_t* dest, const char* s, uint32_t len) -> void + { + if (s) + { + memcpy(dest, s, len); + free((void*) s); + } + }, + variableSized.getContent(), hexStr, hexLen); + + return variableSized; } PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterSubTnumberTnumberPhysicalFunction( PhysicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.childFunctions.size() == 3, - "SubTnumberTnumberPhysicalFunction requires 3 children but got {}", + PRECONDITION(arguments.childFunctions.size() == 2, + "SubTnumberTnumberPhysicalFunction requires 2 children but got {}", arguments.childFunctions.size()); auto arg0 = std::move(arguments.childFunctions[0]); auto arg1 = std::move(arguments.childFunctions[1]); - auto arg2 = std::move(arguments.childFunctions[2]); - return SubTnumberTnumberPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); + return SubTnumberTnumberPhysicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TEqTextTtextPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TEqTextTtextPhysicalFunction.cpp new file mode 100644 index 0000000000..887d00a3f0 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TEqTextTtextPhysicalFunction.cpp @@ -0,0 +1,106 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +} + +namespace NES { + +TEqTextTtextPhysicalFunction::TEqTextTtextPhysicalFunction(PhysicalFunction arg0Function, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(arg0Function)); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal TEqTextTtextPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto arg0 = parameterValues[0].cast(); + auto value = parameterValues[1].cast(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](const char* arg0Ptr, uint32_t arg0Size, + const char* valuePtr, uint32_t valueSize, + uint64_t ts) -> double { + try + { + MEOS::Meos::ensureMeosInitialized(); + std::string tempVal(valuePtr, valueSize); + while (!tempVal.empty() && (tempVal.front() == '\'' || tempVal.front() == '"')) tempVal.erase(tempVal.begin()); + while (!tempVal.empty() && (tempVal.back() == '\'' || tempVal.back() == '"')) tempVal.pop_back(); + std::string tempWkt = "'" + tempVal + "'@" + MEOS::Meos::convertEpochToTimestamp(ts); + Temporal* temp = ttext_in(tempWkt.c_str()); + if (!temp) return 0.0; + std::string arg0S(arg0Ptr, arg0Size); + while (!arg0S.empty() && (arg0S.front() == '\'' || arg0S.front() == '"')) arg0S.erase(arg0S.begin()); + while (!arg0S.empty() && (arg0S.back() == '\'' || arg0S.back() == '"')) arg0S.pop_back(); + text* txt0 = cstring_to_text(arg0S.c_str()); + if (!txt0) { free(temp); return 0.0; } + + double r = teq_text_ttext(txt0, temp); + free(temp); + free(txt0); + return r; + } + catch (const std::exception&) + { + return 0.0; + } + }, + arg0.getContent(), arg0.getContentSize(), value.getContent(), value.getContentSize(), ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTEqTextTtextPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "TEqTextTtextPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return TEqTextTtextPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TEqTtextTextPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TEqTtextTextPhysicalFunction.cpp new file mode 100644 index 0000000000..48e65ff53b --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TEqTtextTextPhysicalFunction.cpp @@ -0,0 +1,106 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +} + +namespace NES { + +TEqTtextTextPhysicalFunction::TEqTtextTextPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction, + PhysicalFunction arg0Function) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(arg0Function)); +} + +VarVal TEqTtextTextPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto value = parameterValues[0].cast(); + auto ts = parameterValues[1].cast>(); + auto arg0 = parameterValues[2].cast(); + + const auto result = nautilus::invoke( + +[](const char* valuePtr, uint32_t valueSize, + uint64_t ts, + const char* arg0Ptr, uint32_t arg0Size) -> double { + try + { + MEOS::Meos::ensureMeosInitialized(); + std::string tempVal(valuePtr, valueSize); + while (!tempVal.empty() && (tempVal.front() == '\'' || tempVal.front() == '"')) tempVal.erase(tempVal.begin()); + while (!tempVal.empty() && (tempVal.back() == '\'' || tempVal.back() == '"')) tempVal.pop_back(); + std::string tempWkt = "'" + tempVal + "'@" + MEOS::Meos::convertEpochToTimestamp(ts); + Temporal* temp = ttext_in(tempWkt.c_str()); + if (!temp) return 0.0; + std::string arg0S(arg0Ptr, arg0Size); + while (!arg0S.empty() && (arg0S.front() == '\'' || arg0S.front() == '"')) arg0S.erase(arg0S.begin()); + while (!arg0S.empty() && (arg0S.back() == '\'' || arg0S.back() == '"')) arg0S.pop_back(); + text* txt0 = cstring_to_text(arg0S.c_str()); + if (!txt0) { free(temp); return 0.0; } + + double r = teq_ttext_text(temp, txt0); + free(temp); + free(txt0); + return r; + } + catch (const std::exception&) + { + return 0.0; + } + }, + value.getContent(), value.getContentSize(), ts, arg0.getContent(), arg0.getContentSize()); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTEqTtextTextPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "TEqTtextTextPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return TEqTtextTextPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TGeTextTtextPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TGeTextTtextPhysicalFunction.cpp new file mode 100644 index 0000000000..27da35d74b --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TGeTextTtextPhysicalFunction.cpp @@ -0,0 +1,106 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +} + +namespace NES { + +TGeTextTtextPhysicalFunction::TGeTextTtextPhysicalFunction(PhysicalFunction arg0Function, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(arg0Function)); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal TGeTextTtextPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto arg0 = parameterValues[0].cast(); + auto value = parameterValues[1].cast(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](const char* arg0Ptr, uint32_t arg0Size, + const char* valuePtr, uint32_t valueSize, + uint64_t ts) -> double { + try + { + MEOS::Meos::ensureMeosInitialized(); + std::string tempVal(valuePtr, valueSize); + while (!tempVal.empty() && (tempVal.front() == '\'' || tempVal.front() == '"')) tempVal.erase(tempVal.begin()); + while (!tempVal.empty() && (tempVal.back() == '\'' || tempVal.back() == '"')) tempVal.pop_back(); + std::string tempWkt = "'" + tempVal + "'@" + MEOS::Meos::convertEpochToTimestamp(ts); + Temporal* temp = ttext_in(tempWkt.c_str()); + if (!temp) return 0.0; + std::string arg0S(arg0Ptr, arg0Size); + while (!arg0S.empty() && (arg0S.front() == '\'' || arg0S.front() == '"')) arg0S.erase(arg0S.begin()); + while (!arg0S.empty() && (arg0S.back() == '\'' || arg0S.back() == '"')) arg0S.pop_back(); + text* txt0 = cstring_to_text(arg0S.c_str()); + if (!txt0) { free(temp); return 0.0; } + + double r = tge_text_ttext(txt0, temp); + free(temp); + free(txt0); + return r; + } + catch (const std::exception&) + { + return 0.0; + } + }, + arg0.getContent(), arg0.getContentSize(), value.getContent(), value.getContentSize(), ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTGeTextTtextPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "TGeTextTtextPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return TGeTextTtextPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TGeTtextTextPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TGeTtextTextPhysicalFunction.cpp new file mode 100644 index 0000000000..945ffd0c97 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TGeTtextTextPhysicalFunction.cpp @@ -0,0 +1,106 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +} + +namespace NES { + +TGeTtextTextPhysicalFunction::TGeTtextTextPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction, + PhysicalFunction arg0Function) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(arg0Function)); +} + +VarVal TGeTtextTextPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto value = parameterValues[0].cast(); + auto ts = parameterValues[1].cast>(); + auto arg0 = parameterValues[2].cast(); + + const auto result = nautilus::invoke( + +[](const char* valuePtr, uint32_t valueSize, + uint64_t ts, + const char* arg0Ptr, uint32_t arg0Size) -> double { + try + { + MEOS::Meos::ensureMeosInitialized(); + std::string tempVal(valuePtr, valueSize); + while (!tempVal.empty() && (tempVal.front() == '\'' || tempVal.front() == '"')) tempVal.erase(tempVal.begin()); + while (!tempVal.empty() && (tempVal.back() == '\'' || tempVal.back() == '"')) tempVal.pop_back(); + std::string tempWkt = "'" + tempVal + "'@" + MEOS::Meos::convertEpochToTimestamp(ts); + Temporal* temp = ttext_in(tempWkt.c_str()); + if (!temp) return 0.0; + std::string arg0S(arg0Ptr, arg0Size); + while (!arg0S.empty() && (arg0S.front() == '\'' || arg0S.front() == '"')) arg0S.erase(arg0S.begin()); + while (!arg0S.empty() && (arg0S.back() == '\'' || arg0S.back() == '"')) arg0S.pop_back(); + text* txt0 = cstring_to_text(arg0S.c_str()); + if (!txt0) { free(temp); return 0.0; } + + double r = tge_ttext_text(temp, txt0); + free(temp); + free(txt0); + return r; + } + catch (const std::exception&) + { + return 0.0; + } + }, + value.getContent(), value.getContentSize(), ts, arg0.getContent(), arg0.getContentSize()); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTGeTtextTextPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "TGeTtextTextPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return TGeTtextTextPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TGtTextTtextPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TGtTextTtextPhysicalFunction.cpp new file mode 100644 index 0000000000..b514af30e9 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TGtTextTtextPhysicalFunction.cpp @@ -0,0 +1,106 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +} + +namespace NES { + +TGtTextTtextPhysicalFunction::TGtTextTtextPhysicalFunction(PhysicalFunction arg0Function, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(arg0Function)); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal TGtTextTtextPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto arg0 = parameterValues[0].cast(); + auto value = parameterValues[1].cast(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](const char* arg0Ptr, uint32_t arg0Size, + const char* valuePtr, uint32_t valueSize, + uint64_t ts) -> double { + try + { + MEOS::Meos::ensureMeosInitialized(); + std::string tempVal(valuePtr, valueSize); + while (!tempVal.empty() && (tempVal.front() == '\'' || tempVal.front() == '"')) tempVal.erase(tempVal.begin()); + while (!tempVal.empty() && (tempVal.back() == '\'' || tempVal.back() == '"')) tempVal.pop_back(); + std::string tempWkt = "'" + tempVal + "'@" + MEOS::Meos::convertEpochToTimestamp(ts); + Temporal* temp = ttext_in(tempWkt.c_str()); + if (!temp) return 0.0; + std::string arg0S(arg0Ptr, arg0Size); + while (!arg0S.empty() && (arg0S.front() == '\'' || arg0S.front() == '"')) arg0S.erase(arg0S.begin()); + while (!arg0S.empty() && (arg0S.back() == '\'' || arg0S.back() == '"')) arg0S.pop_back(); + text* txt0 = cstring_to_text(arg0S.c_str()); + if (!txt0) { free(temp); return 0.0; } + + double r = tgt_text_ttext(txt0, temp); + free(temp); + free(txt0); + return r; + } + catch (const std::exception&) + { + return 0.0; + } + }, + arg0.getContent(), arg0.getContentSize(), value.getContent(), value.getContentSize(), ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTGtTextTtextPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "TGtTextTtextPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return TGtTextTtextPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TGtTtextTextPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TGtTtextTextPhysicalFunction.cpp new file mode 100644 index 0000000000..722d05c597 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TGtTtextTextPhysicalFunction.cpp @@ -0,0 +1,106 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +} + +namespace NES { + +TGtTtextTextPhysicalFunction::TGtTtextTextPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction, + PhysicalFunction arg0Function) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(arg0Function)); +} + +VarVal TGtTtextTextPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto value = parameterValues[0].cast(); + auto ts = parameterValues[1].cast>(); + auto arg0 = parameterValues[2].cast(); + + const auto result = nautilus::invoke( + +[](const char* valuePtr, uint32_t valueSize, + uint64_t ts, + const char* arg0Ptr, uint32_t arg0Size) -> double { + try + { + MEOS::Meos::ensureMeosInitialized(); + std::string tempVal(valuePtr, valueSize); + while (!tempVal.empty() && (tempVal.front() == '\'' || tempVal.front() == '"')) tempVal.erase(tempVal.begin()); + while (!tempVal.empty() && (tempVal.back() == '\'' || tempVal.back() == '"')) tempVal.pop_back(); + std::string tempWkt = "'" + tempVal + "'@" + MEOS::Meos::convertEpochToTimestamp(ts); + Temporal* temp = ttext_in(tempWkt.c_str()); + if (!temp) return 0.0; + std::string arg0S(arg0Ptr, arg0Size); + while (!arg0S.empty() && (arg0S.front() == '\'' || arg0S.front() == '"')) arg0S.erase(arg0S.begin()); + while (!arg0S.empty() && (arg0S.back() == '\'' || arg0S.back() == '"')) arg0S.pop_back(); + text* txt0 = cstring_to_text(arg0S.c_str()); + if (!txt0) { free(temp); return 0.0; } + + double r = tgt_ttext_text(temp, txt0); + free(temp); + free(txt0); + return r; + } + catch (const std::exception&) + { + return 0.0; + } + }, + value.getContent(), value.getContentSize(), ts, arg0.getContent(), arg0.getContentSize()); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTGtTtextTextPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "TGtTtextTextPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return TGtTtextTextPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TLeTextTtextPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TLeTextTtextPhysicalFunction.cpp new file mode 100644 index 0000000000..d6cdf8e16f --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TLeTextTtextPhysicalFunction.cpp @@ -0,0 +1,106 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +} + +namespace NES { + +TLeTextTtextPhysicalFunction::TLeTextTtextPhysicalFunction(PhysicalFunction arg0Function, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(arg0Function)); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal TLeTextTtextPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto arg0 = parameterValues[0].cast(); + auto value = parameterValues[1].cast(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](const char* arg0Ptr, uint32_t arg0Size, + const char* valuePtr, uint32_t valueSize, + uint64_t ts) -> double { + try + { + MEOS::Meos::ensureMeosInitialized(); + std::string tempVal(valuePtr, valueSize); + while (!tempVal.empty() && (tempVal.front() == '\'' || tempVal.front() == '"')) tempVal.erase(tempVal.begin()); + while (!tempVal.empty() && (tempVal.back() == '\'' || tempVal.back() == '"')) tempVal.pop_back(); + std::string tempWkt = "'" + tempVal + "'@" + MEOS::Meos::convertEpochToTimestamp(ts); + Temporal* temp = ttext_in(tempWkt.c_str()); + if (!temp) return 0.0; + std::string arg0S(arg0Ptr, arg0Size); + while (!arg0S.empty() && (arg0S.front() == '\'' || arg0S.front() == '"')) arg0S.erase(arg0S.begin()); + while (!arg0S.empty() && (arg0S.back() == '\'' || arg0S.back() == '"')) arg0S.pop_back(); + text* txt0 = cstring_to_text(arg0S.c_str()); + if (!txt0) { free(temp); return 0.0; } + + double r = tle_text_ttext(txt0, temp); + free(temp); + free(txt0); + return r; + } + catch (const std::exception&) + { + return 0.0; + } + }, + arg0.getContent(), arg0.getContentSize(), value.getContent(), value.getContentSize(), ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTLeTextTtextPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "TLeTextTtextPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return TLeTextTtextPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TLeTtextTextPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TLeTtextTextPhysicalFunction.cpp new file mode 100644 index 0000000000..024e4fdaef --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TLeTtextTextPhysicalFunction.cpp @@ -0,0 +1,106 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +} + +namespace NES { + +TLeTtextTextPhysicalFunction::TLeTtextTextPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction, + PhysicalFunction arg0Function) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(arg0Function)); +} + +VarVal TLeTtextTextPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto value = parameterValues[0].cast(); + auto ts = parameterValues[1].cast>(); + auto arg0 = parameterValues[2].cast(); + + const auto result = nautilus::invoke( + +[](const char* valuePtr, uint32_t valueSize, + uint64_t ts, + const char* arg0Ptr, uint32_t arg0Size) -> double { + try + { + MEOS::Meos::ensureMeosInitialized(); + std::string tempVal(valuePtr, valueSize); + while (!tempVal.empty() && (tempVal.front() == '\'' || tempVal.front() == '"')) tempVal.erase(tempVal.begin()); + while (!tempVal.empty() && (tempVal.back() == '\'' || tempVal.back() == '"')) tempVal.pop_back(); + std::string tempWkt = "'" + tempVal + "'@" + MEOS::Meos::convertEpochToTimestamp(ts); + Temporal* temp = ttext_in(tempWkt.c_str()); + if (!temp) return 0.0; + std::string arg0S(arg0Ptr, arg0Size); + while (!arg0S.empty() && (arg0S.front() == '\'' || arg0S.front() == '"')) arg0S.erase(arg0S.begin()); + while (!arg0S.empty() && (arg0S.back() == '\'' || arg0S.back() == '"')) arg0S.pop_back(); + text* txt0 = cstring_to_text(arg0S.c_str()); + if (!txt0) { free(temp); return 0.0; } + + double r = tle_ttext_text(temp, txt0); + free(temp); + free(txt0); + return r; + } + catch (const std::exception&) + { + return 0.0; + } + }, + value.getContent(), value.getContentSize(), ts, arg0.getContent(), arg0.getContentSize()); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTLeTtextTextPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "TLeTtextTextPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return TLeTtextTextPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TLtTextTtextPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TLtTextTtextPhysicalFunction.cpp new file mode 100644 index 0000000000..2991bd7e90 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TLtTextTtextPhysicalFunction.cpp @@ -0,0 +1,106 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +} + +namespace NES { + +TLtTextTtextPhysicalFunction::TLtTextTtextPhysicalFunction(PhysicalFunction arg0Function, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(arg0Function)); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal TLtTextTtextPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto arg0 = parameterValues[0].cast(); + auto value = parameterValues[1].cast(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](const char* arg0Ptr, uint32_t arg0Size, + const char* valuePtr, uint32_t valueSize, + uint64_t ts) -> double { + try + { + MEOS::Meos::ensureMeosInitialized(); + std::string tempVal(valuePtr, valueSize); + while (!tempVal.empty() && (tempVal.front() == '\'' || tempVal.front() == '"')) tempVal.erase(tempVal.begin()); + while (!tempVal.empty() && (tempVal.back() == '\'' || tempVal.back() == '"')) tempVal.pop_back(); + std::string tempWkt = "'" + tempVal + "'@" + MEOS::Meos::convertEpochToTimestamp(ts); + Temporal* temp = ttext_in(tempWkt.c_str()); + if (!temp) return 0.0; + std::string arg0S(arg0Ptr, arg0Size); + while (!arg0S.empty() && (arg0S.front() == '\'' || arg0S.front() == '"')) arg0S.erase(arg0S.begin()); + while (!arg0S.empty() && (arg0S.back() == '\'' || arg0S.back() == '"')) arg0S.pop_back(); + text* txt0 = cstring_to_text(arg0S.c_str()); + if (!txt0) { free(temp); return 0.0; } + + double r = tlt_text_ttext(txt0, temp); + free(temp); + free(txt0); + return r; + } + catch (const std::exception&) + { + return 0.0; + } + }, + arg0.getContent(), arg0.getContentSize(), value.getContent(), value.getContentSize(), ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTLtTextTtextPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "TLtTextTtextPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return TLtTextTtextPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TLtTtextTextPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TLtTtextTextPhysicalFunction.cpp new file mode 100644 index 0000000000..4ae06764cd --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TLtTtextTextPhysicalFunction.cpp @@ -0,0 +1,106 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +} + +namespace NES { + +TLtTtextTextPhysicalFunction::TLtTtextTextPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction, + PhysicalFunction arg0Function) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(arg0Function)); +} + +VarVal TLtTtextTextPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto value = parameterValues[0].cast(); + auto ts = parameterValues[1].cast>(); + auto arg0 = parameterValues[2].cast(); + + const auto result = nautilus::invoke( + +[](const char* valuePtr, uint32_t valueSize, + uint64_t ts, + const char* arg0Ptr, uint32_t arg0Size) -> double { + try + { + MEOS::Meos::ensureMeosInitialized(); + std::string tempVal(valuePtr, valueSize); + while (!tempVal.empty() && (tempVal.front() == '\'' || tempVal.front() == '"')) tempVal.erase(tempVal.begin()); + while (!tempVal.empty() && (tempVal.back() == '\'' || tempVal.back() == '"')) tempVal.pop_back(); + std::string tempWkt = "'" + tempVal + "'@" + MEOS::Meos::convertEpochToTimestamp(ts); + Temporal* temp = ttext_in(tempWkt.c_str()); + if (!temp) return 0.0; + std::string arg0S(arg0Ptr, arg0Size); + while (!arg0S.empty() && (arg0S.front() == '\'' || arg0S.front() == '"')) arg0S.erase(arg0S.begin()); + while (!arg0S.empty() && (arg0S.back() == '\'' || arg0S.back() == '"')) arg0S.pop_back(); + text* txt0 = cstring_to_text(arg0S.c_str()); + if (!txt0) { free(temp); return 0.0; } + + double r = tlt_ttext_text(temp, txt0); + free(temp); + free(txt0); + return r; + } + catch (const std::exception&) + { + return 0.0; + } + }, + value.getContent(), value.getContentSize(), ts, arg0.getContent(), arg0.getContentSize()); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTLtTtextTextPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "TLtTtextTextPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return TLtTtextTextPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TNeTextTtextPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TNeTextTtextPhysicalFunction.cpp new file mode 100644 index 0000000000..fe957929e7 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TNeTextTtextPhysicalFunction.cpp @@ -0,0 +1,106 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +} + +namespace NES { + +TNeTextTtextPhysicalFunction::TNeTextTtextPhysicalFunction(PhysicalFunction arg0Function, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(arg0Function)); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); +} + +VarVal TNeTextTtextPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto arg0 = parameterValues[0].cast(); + auto value = parameterValues[1].cast(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](const char* arg0Ptr, uint32_t arg0Size, + const char* valuePtr, uint32_t valueSize, + uint64_t ts) -> double { + try + { + MEOS::Meos::ensureMeosInitialized(); + std::string tempVal(valuePtr, valueSize); + while (!tempVal.empty() && (tempVal.front() == '\'' || tempVal.front() == '"')) tempVal.erase(tempVal.begin()); + while (!tempVal.empty() && (tempVal.back() == '\'' || tempVal.back() == '"')) tempVal.pop_back(); + std::string tempWkt = "'" + tempVal + "'@" + MEOS::Meos::convertEpochToTimestamp(ts); + Temporal* temp = ttext_in(tempWkt.c_str()); + if (!temp) return 0.0; + std::string arg0S(arg0Ptr, arg0Size); + while (!arg0S.empty() && (arg0S.front() == '\'' || arg0S.front() == '"')) arg0S.erase(arg0S.begin()); + while (!arg0S.empty() && (arg0S.back() == '\'' || arg0S.back() == '"')) arg0S.pop_back(); + text* txt0 = cstring_to_text(arg0S.c_str()); + if (!txt0) { free(temp); return 0.0; } + + double r = tne_text_ttext(txt0, temp); + free(temp); + free(txt0); + return r; + } + catch (const std::exception&) + { + return 0.0; + } + }, + arg0.getContent(), arg0.getContentSize(), value.getContent(), value.getContentSize(), ts); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTNeTextTtextPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "TNeTextTtextPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return TNeTextTtextPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TNeTtextTextPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TNeTtextTextPhysicalFunction.cpp new file mode 100644 index 0000000000..dd6c4b914f --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TNeTtextTextPhysicalFunction.cpp @@ -0,0 +1,106 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +} + +namespace NES { + +TNeTtextTextPhysicalFunction::TNeTtextTextPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction, + PhysicalFunction arg0Function) +{ + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(arg0Function)); +} + +VarVal TNeTtextTextPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto value = parameterValues[0].cast(); + auto ts = parameterValues[1].cast>(); + auto arg0 = parameterValues[2].cast(); + + const auto result = nautilus::invoke( + +[](const char* valuePtr, uint32_t valueSize, + uint64_t ts, + const char* arg0Ptr, uint32_t arg0Size) -> double { + try + { + MEOS::Meos::ensureMeosInitialized(); + std::string tempVal(valuePtr, valueSize); + while (!tempVal.empty() && (tempVal.front() == '\'' || tempVal.front() == '"')) tempVal.erase(tempVal.begin()); + while (!tempVal.empty() && (tempVal.back() == '\'' || tempVal.back() == '"')) tempVal.pop_back(); + std::string tempWkt = "'" + tempVal + "'@" + MEOS::Meos::convertEpochToTimestamp(ts); + Temporal* temp = ttext_in(tempWkt.c_str()); + if (!temp) return 0.0; + std::string arg0S(arg0Ptr, arg0Size); + while (!arg0S.empty() && (arg0S.front() == '\'' || arg0S.front() == '"')) arg0S.erase(arg0S.begin()); + while (!arg0S.empty() && (arg0S.back() == '\'' || arg0S.back() == '"')) arg0S.pop_back(); + text* txt0 = cstring_to_text(arg0S.c_str()); + if (!txt0) { free(temp); return 0.0; } + + double r = tne_ttext_text(temp, txt0); + free(temp); + free(txt0); + return r; + } + catch (const std::exception&) + { + return 0.0; + } + }, + value.getContent(), value.getContentSize(), ts, arg0.getContent(), arg0.getContentSize()); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTNeTtextTextPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 3, + "TNeTtextTextPhysicalFunction requires 3 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return TNeTtextTextPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TandBoolTboolPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TandBoolTboolPhysicalFunction.cpp index 16f0f24724..8f94a30a81 100644 --- a/nes-physical-operators/src/Functions/Meos/TandBoolTboolPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/TandBoolTboolPhysicalFunction.cpp @@ -35,12 +35,12 @@ extern "C" { namespace NES { -TandBoolTboolPhysicalFunction::TandBoolTboolPhysicalFunction(PhysicalFunction scalarFunction, - PhysicalFunction valueFunction, - PhysicalFunction tsFunction) +TandBoolTboolPhysicalFunction::TandBoolTboolPhysicalFunction(PhysicalFunction arg0Function, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction) { parameterFunctions.reserve(3); - parameterFunctions.push_back(std::move(scalarFunction)); + parameterFunctions.push_back(std::move(arg0Function)); parameterFunctions.push_back(std::move(valueFunction)); parameterFunctions.push_back(std::move(tsFunction)); } @@ -50,29 +50,38 @@ VarVal TandBoolTboolPhysicalFunction::execute(const Record& record, ArenaRef& ar std::vector parameterValues; parameterValues.reserve(parameterFunctions.size()); for (const auto& function : parameterFunctions) + { parameterValues.emplace_back(function.execute(record, arena)); + } - auto scalar = parameterValues[0].cast>(); - auto value = parameterValues[1].cast>(); - auto ts = parameterValues[2].cast>(); + auto arg0 = parameterValues[0].cast>(); + auto value = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); const auto result = nautilus::invoke( - +[](double b, double v, uint64_t t) -> double { - try { + +[](double arg0, + double value, + uint64_t ts) -> bool { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); - std::string wkt = fmt::format("{}@{}", (v != 0.0 ? "t" : "f"), ts_str); - Temporal* temp = tbool_in(wkt.c_str()); - if (!temp) return 0.0; - Temporal* res = tand_bool_tbool(static_cast(b != 0.0), temp); + std::string tempWkt = fmt::format("{}@{}", value != 0.0 ? "t" : "f", MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tbool_in(tempWkt.c_str()); + if (!temp) return false; + + Temporal* res = tand_bool_tbool(static_cast(arg0 != 0.0), temp); free(temp); - if (!res) return 0.0; + if (!res) return false; bool r = tbool_start_value(res); free(res); - return static_cast(r ? 1.0 : 0.0); - } catch (const std::exception&) { return 0.0; } + return r; + } + catch (const std::exception&) + { + return false; + } }, - scalar, value, ts); + arg0, value, ts); return VarVal(result); } diff --git a/nes-physical-operators/src/Functions/Meos/TandTboolBoolPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TandTboolBoolPhysicalFunction.cpp index ef430d4016..06066129fb 100644 --- a/nes-physical-operators/src/Functions/Meos/TandTboolBoolPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/TandTboolBoolPhysicalFunction.cpp @@ -36,13 +36,13 @@ extern "C" { namespace NES { TandTboolBoolPhysicalFunction::TandTboolBoolPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction scalarFunction, - PhysicalFunction tsFunction) + PhysicalFunction tsFunction, + PhysicalFunction arg0Function) { parameterFunctions.reserve(3); parameterFunctions.push_back(std::move(valueFunction)); - parameterFunctions.push_back(std::move(scalarFunction)); parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } VarVal TandTboolBoolPhysicalFunction::execute(const Record& record, ArenaRef& arena) const @@ -50,29 +50,38 @@ VarVal TandTboolBoolPhysicalFunction::execute(const Record& record, ArenaRef& ar std::vector parameterValues; parameterValues.reserve(parameterFunctions.size()); for (const auto& function : parameterFunctions) + { parameterValues.emplace_back(function.execute(record, arena)); + } - auto value = parameterValues[0].cast>(); - auto scalar = parameterValues[1].cast>(); - auto ts = parameterValues[2].cast>(); + auto value = parameterValues[0].cast>(); + auto ts = parameterValues[1].cast>(); + auto arg0 = parameterValues[2].cast>(); const auto result = nautilus::invoke( - +[](double v, double s, uint64_t t) -> double { - try { + +[](double value, + uint64_t ts, + double arg0) -> bool { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); - std::string wkt = fmt::format("{}@{}", (v != 0.0 ? "t" : "f"), ts_str); - Temporal* temp = tbool_in(wkt.c_str()); - if (!temp) return 0.0; - Temporal* res = tand_tbool_bool(temp, static_cast(s != 0.0)); + std::string tempWkt = fmt::format("{}@{}", value != 0.0 ? "t" : "f", MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tbool_in(tempWkt.c_str()); + if (!temp) return false; + + Temporal* res = tand_tbool_bool(temp, static_cast(arg0 != 0.0)); free(temp); - if (!res) return 0.0; + if (!res) return false; bool r = tbool_start_value(res); free(res); - return static_cast(r ? 1.0 : 0.0); - } catch (const std::exception&) { return 0.0; } + return r; + } + catch (const std::exception&) + { + return false; + } }, - value, scalar, ts); + value, ts, arg0); return VarVal(result); } diff --git a/nes-physical-operators/src/Functions/Meos/TandTboolTboolPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TandTboolTboolPhysicalFunction.cpp index ec1c4beb98..dd6b92e60d 100644 --- a/nes-physical-operators/src/Functions/Meos/TandTboolTboolPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/TandTboolTboolPhysicalFunction.cpp @@ -22,7 +22,8 @@ #include #include #include -#include +#include +#include #include #include #include @@ -35,14 +36,12 @@ extern "C" { namespace NES { -TandTboolTboolPhysicalFunction::TandTboolTboolPhysicalFunction(PhysicalFunction value1Function, - PhysicalFunction value2Function, - PhysicalFunction tsFunction) +TandTboolTboolPhysicalFunction::TandTboolTboolPhysicalFunction(PhysicalFunction trajFunction, + PhysicalFunction arg0Function) { - parameterFunctions.reserve(3); - parameterFunctions.push_back(std::move(value1Function)); - parameterFunctions.push_back(std::move(value2Function)); - parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.reserve(2); + parameterFunctions.push_back(std::move(trajFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } VarVal TandTboolTboolPhysicalFunction::execute(const Record& record, ArenaRef& arena) const @@ -50,46 +49,74 @@ VarVal TandTboolTboolPhysicalFunction::execute(const Record& record, ArenaRef& a std::vector parameterValues; parameterValues.reserve(parameterFunctions.size()); for (const auto& function : parameterFunctions) + { parameterValues.emplace_back(function.execute(record, arena)); + } - auto value1 = parameterValues[0].cast>(); - auto value2 = parameterValues[1].cast>(); - auto ts = parameterValues[2].cast>(); + auto traj = parameterValues[0].cast(); + auto arg0 = parameterValues[1].cast(); - const auto result = nautilus::invoke( - +[](double v1, double v2, uint64_t t) -> double { - try { + // Call MEOS f(Temporal*, Temporal*) -> Temporal* over the two hex-WKB + // operands and serialize the result back to hex-WKB inside the invoke; the + // returned heap string is copied into the arena below. Both operands and the + // MEOS result are freed here. + auto hexStr = nautilus::invoke( + +[](const char* aPtr, uint32_t aSize, const char* bPtr, uint32_t bSize) -> char* + { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); - std::string wkt1 = fmt::format("{}@{}", (v1 != 0.0 ? "t" : "f"), ts_str); - std::string wkt2 = fmt::format("{}@{}", (v2 != 0.0 ? "t" : "f"), ts_str); - Temporal* temp1 = tbool_in(wkt1.c_str()); - if (!temp1) return 0.0; - Temporal* temp2 = tbool_in(wkt2.c_str()); - if (!temp2) { free(temp1); return 0.0; } - Temporal* res = tand_tbool_tbool(temp1, temp2); - free(temp1); free(temp2); - if (!res) return 0.0; - bool r = tbool_start_value(res); + std::string aHex(aPtr, aSize); + std::string bHex(bPtr, bSize); + Temporal* a = temporal_from_hexwkb(aHex.c_str()); + if (!a) return (char*) nullptr; + Temporal* b = temporal_from_hexwkb(bHex.c_str()); + if (!b) { free(a); return (char*) nullptr; } + Temporal* res = tand_tbool_tbool(a, b); + free(a); + free(b); + if (!res) return (char*) nullptr; + size_t hexSize = 0; + char* hexOut = temporal_as_hexwkb(res, 0, &hexSize); free(res); - return static_cast(r ? 1.0 : 0.0); - } catch (const std::exception&) { return 0.0; } + return hexOut; + } + catch (const std::exception&) + { + return (char*) nullptr; + } }, - value1, value2, ts); + traj.getContent(), traj.getContentSize(), arg0.getContent(), arg0.getContentSize()); - return VarVal(result); + const auto hexLen = nautilus::invoke( + +[](const char* s) -> uint32_t { return s ? (uint32_t) strlen(s) : (uint32_t) 0; }, + hexStr); + + auto variableSized = arena.allocateVariableSizedData(hexLen); + + nautilus::invoke( + +[](int8_t* dest, const char* s, uint32_t len) -> void + { + if (s) + { + memcpy(dest, s, len); + free((void*) s); + } + }, + variableSized.getContent(), hexStr, hexLen); + + return variableSized; } PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTandTboolTboolPhysicalFunction( PhysicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.childFunctions.size() == 3, - "TandTboolTboolPhysicalFunction requires 3 children but got {}", + PRECONDITION(arguments.childFunctions.size() == 2, + "TandTboolTboolPhysicalFunction requires 2 children but got {}", arguments.childFunctions.size()); auto arg0 = std::move(arguments.childFunctions[0]); auto arg1 = std::move(arguments.childFunctions[1]); - auto arg2 = std::move(arguments.childFunctions[2]); - return TandTboolTboolPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); + return TandTboolTboolPhysicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TbigintScaleValuePhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TbigintScaleValuePhysicalFunction.cpp index dc8c1fcfd9..118e153230 100644 --- a/nes-physical-operators/src/Functions/Meos/TbigintScaleValuePhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/TbigintScaleValuePhysicalFunction.cpp @@ -36,13 +36,13 @@ extern "C" { namespace NES { TbigintScaleValuePhysicalFunction::TbigintScaleValuePhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction tsFunction, - PhysicalFunction widthFunction) + PhysicalFunction tsFunction, + PhysicalFunction arg0Function) { parameterFunctions.reserve(3); parameterFunctions.push_back(std::move(valueFunction)); parameterFunctions.push_back(std::move(tsFunction)); - parameterFunctions.push_back(std::move(widthFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } VarVal TbigintScaleValuePhysicalFunction::execute(const Record& record, ArenaRef& arena) const @@ -50,28 +50,38 @@ VarVal TbigintScaleValuePhysicalFunction::execute(const Record& record, ArenaRef std::vector parameterValues; parameterValues.reserve(parameterFunctions.size()); for (const auto& function : parameterFunctions) + { parameterValues.emplace_back(function.execute(record, arena)); + } auto value = parameterValues[0].cast>(); - auto ts = parameterValues[1].cast>(); - auto width = parameterValues[2].cast>(); + auto ts = parameterValues[1].cast>(); + auto arg0 = parameterValues[2].cast>(); const auto result = nautilus::invoke( - +[](double value, uint64_t ts, double width_d) -> double { - try { + +[](double value, + uint64_t ts, + double arg0) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); std::string tempWkt = fmt::format("{}@{}", static_cast(value), MEOS::Meos::convertEpochToTimestamp(ts)); Temporal* temp = tbigint_in(tempWkt.c_str()); if (!temp) return 0.0; - Temporal* res = tbigint_scale_value(temp, static_cast(width_d)); + + Temporal* res = tbigint_scale_value(temp, static_cast(arg0)); free(temp); if (!res) return 0.0; - double r = static_cast(tbigint_start_value(res)); + double r = tbigint_start_value(res); free(res); return r; - } catch (const std::exception&) { return 0.0; } + } + catch (const std::exception&) + { + return 0.0; + } }, - value, ts, width); + value, ts, arg0); return VarVal(result); } diff --git a/nes-physical-operators/src/Functions/Meos/TbigintShiftScaleValuePhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TbigintShiftScaleValuePhysicalFunction.cpp index b0e2632357..942c2f2be3 100644 --- a/nes-physical-operators/src/Functions/Meos/TbigintShiftScaleValuePhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/TbigintShiftScaleValuePhysicalFunction.cpp @@ -36,15 +36,15 @@ extern "C" { namespace NES { TbigintShiftScaleValuePhysicalFunction::TbigintShiftScaleValuePhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction tsFunction, - PhysicalFunction shiftFunction, - PhysicalFunction widthFunction) + PhysicalFunction tsFunction, + PhysicalFunction arg0Function, + PhysicalFunction arg1Function) { parameterFunctions.reserve(4); parameterFunctions.push_back(std::move(valueFunction)); parameterFunctions.push_back(std::move(tsFunction)); - parameterFunctions.push_back(std::move(shiftFunction)); - parameterFunctions.push_back(std::move(widthFunction)); + parameterFunctions.push_back(std::move(arg0Function)); + parameterFunctions.push_back(std::move(arg1Function)); } VarVal TbigintShiftScaleValuePhysicalFunction::execute(const Record& record, ArenaRef& arena) const @@ -52,29 +52,40 @@ VarVal TbigintShiftScaleValuePhysicalFunction::execute(const Record& record, Are std::vector parameterValues; parameterValues.reserve(parameterFunctions.size()); for (const auto& function : parameterFunctions) + { parameterValues.emplace_back(function.execute(record, arena)); + } auto value = parameterValues[0].cast>(); - auto ts = parameterValues[1].cast>(); - auto shift = parameterValues[2].cast>(); - auto width = parameterValues[3].cast>(); + auto ts = parameterValues[1].cast>(); + auto arg0 = parameterValues[2].cast>(); + auto arg1 = parameterValues[3].cast>(); const auto result = nautilus::invoke( - +[](double value, uint64_t ts, double shift_d, double width_d) -> double { - try { + +[](double value, + uint64_t ts, + double arg0, + double arg1) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); std::string tempWkt = fmt::format("{}@{}", static_cast(value), MEOS::Meos::convertEpochToTimestamp(ts)); Temporal* temp = tbigint_in(tempWkt.c_str()); if (!temp) return 0.0; - Temporal* res = tbigint_shift_scale_value(temp, static_cast(shift_d), static_cast(width_d)); + + Temporal* res = tbigint_shift_scale_value(temp, static_cast(arg0), static_cast(arg1)); free(temp); if (!res) return 0.0; - double r = static_cast(tbigint_start_value(res)); + double r = tbigint_start_value(res); free(res); return r; - } catch (const std::exception&) { return 0.0; } + } + catch (const std::exception&) + { + return 0.0; + } }, - value, ts, shift, width); + value, ts, arg0, arg1); return VarVal(result); } diff --git a/nes-physical-operators/src/Functions/Meos/TbigintShiftValuePhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TbigintShiftValuePhysicalFunction.cpp index c2d8da4f88..008c9db0f4 100644 --- a/nes-physical-operators/src/Functions/Meos/TbigintShiftValuePhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/TbigintShiftValuePhysicalFunction.cpp @@ -36,13 +36,13 @@ extern "C" { namespace NES { TbigintShiftValuePhysicalFunction::TbigintShiftValuePhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction tsFunction, - PhysicalFunction shiftFunction) + PhysicalFunction tsFunction, + PhysicalFunction arg0Function) { parameterFunctions.reserve(3); parameterFunctions.push_back(std::move(valueFunction)); parameterFunctions.push_back(std::move(tsFunction)); - parameterFunctions.push_back(std::move(shiftFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } VarVal TbigintShiftValuePhysicalFunction::execute(const Record& record, ArenaRef& arena) const @@ -50,28 +50,38 @@ VarVal TbigintShiftValuePhysicalFunction::execute(const Record& record, ArenaRef std::vector parameterValues; parameterValues.reserve(parameterFunctions.size()); for (const auto& function : parameterFunctions) + { parameterValues.emplace_back(function.execute(record, arena)); + } auto value = parameterValues[0].cast>(); - auto ts = parameterValues[1].cast>(); - auto shift = parameterValues[2].cast>(); + auto ts = parameterValues[1].cast>(); + auto arg0 = parameterValues[2].cast>(); const auto result = nautilus::invoke( - +[](double value, uint64_t ts, double shift_d) -> double { - try { + +[](double value, + uint64_t ts, + double arg0) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); std::string tempWkt = fmt::format("{}@{}", static_cast(value), MEOS::Meos::convertEpochToTimestamp(ts)); Temporal* temp = tbigint_in(tempWkt.c_str()); if (!temp) return 0.0; - Temporal* res = tbigint_shift_value(temp, static_cast(shift_d)); + + Temporal* res = tbigint_shift_value(temp, static_cast(arg0)); free(temp); if (!res) return 0.0; - double r = static_cast(tbigint_start_value(res)); + double r = tbigint_start_value(res); free(res); return r; - } catch (const std::exception&) { return 0.0; } + } + catch (const std::exception&) + { + return 0.0; + } }, - value, ts, shift); + value, ts, arg0); return VarVal(result); } diff --git a/nes-physical-operators/src/Functions/Meos/TbigintToTfloatPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TbigintToTfloatPhysicalFunction.cpp index a8ba3a08b4..d760ecc657 100644 --- a/nes-physical-operators/src/Functions/Meos/TbigintToTfloatPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/TbigintToTfloatPhysicalFunction.cpp @@ -36,7 +36,7 @@ extern "C" { namespace NES { TbigintToTfloatPhysicalFunction::TbigintToTfloatPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction tsFunction) + PhysicalFunction tsFunction) { parameterFunctions.reserve(2); parameterFunctions.push_back(std::move(valueFunction)); @@ -48,25 +48,34 @@ VarVal TbigintToTfloatPhysicalFunction::execute(const Record& record, ArenaRef& std::vector parameterValues; parameterValues.reserve(parameterFunctions.size()); for (const auto& function : parameterFunctions) + { parameterValues.emplace_back(function.execute(record, arena)); + } auto value = parameterValues[0].cast>(); - auto ts = parameterValues[1].cast>(); + auto ts = parameterValues[1].cast>(); const auto result = nautilus::invoke( - +[](double value, uint64_t ts) -> double { - try { + +[](double value, + uint64_t ts) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); std::string tempWkt = fmt::format("{}@{}", static_cast(value), MEOS::Meos::convertEpochToTimestamp(ts)); Temporal* temp = tbigint_in(tempWkt.c_str()); if (!temp) return 0.0; + Temporal* res = tbigint_to_tfloat(temp); free(temp); if (!res) return 0.0; double r = tfloat_start_value(res); free(res); return r; - } catch (const std::exception&) { return 0.0; } + } + catch (const std::exception&) + { + return 0.0; + } }, value, ts); diff --git a/nes-physical-operators/src/Functions/Meos/TbigintToTintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TbigintToTintPhysicalFunction.cpp index 32a231a74a..400b155459 100644 --- a/nes-physical-operators/src/Functions/Meos/TbigintToTintPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/TbigintToTintPhysicalFunction.cpp @@ -36,7 +36,7 @@ extern "C" { namespace NES { TbigintToTintPhysicalFunction::TbigintToTintPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction tsFunction) + PhysicalFunction tsFunction) { parameterFunctions.reserve(2); parameterFunctions.push_back(std::move(valueFunction)); @@ -48,25 +48,34 @@ VarVal TbigintToTintPhysicalFunction::execute(const Record& record, ArenaRef& ar std::vector parameterValues; parameterValues.reserve(parameterFunctions.size()); for (const auto& function : parameterFunctions) + { parameterValues.emplace_back(function.execute(record, arena)); + } auto value = parameterValues[0].cast>(); - auto ts = parameterValues[1].cast>(); + auto ts = parameterValues[1].cast>(); const auto result = nautilus::invoke( - +[](double value, uint64_t ts) -> double { - try { + +[](double value, + uint64_t ts) -> int { + try + { MEOS::Meos::ensureMeosInitialized(); std::string tempWkt = fmt::format("{}@{}", static_cast(value), MEOS::Meos::convertEpochToTimestamp(ts)); Temporal* temp = tbigint_in(tempWkt.c_str()); - if (!temp) return 0.0; + if (!temp) return 0; + Temporal* res = tbigint_to_tint(temp); free(temp); - if (!res) return 0.0; - double r = static_cast(tint_start_value(res)); + if (!res) return 0; + int r = tint_start_value(res); free(res); return r; - } catch (const std::exception&) { return 0.0; } + } + catch (const std::exception&) + { + return 0; + } }, value, ts); diff --git a/nes-physical-operators/src/Functions/Meos/TboolToTintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TboolToTintPhysicalFunction.cpp index 7f20b301ad..dcb72c9e1e 100644 --- a/nes-physical-operators/src/Functions/Meos/TboolToTintPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/TboolToTintPhysicalFunction.cpp @@ -36,7 +36,7 @@ extern "C" { namespace NES { TboolToTintPhysicalFunction::TboolToTintPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction tsFunction) + PhysicalFunction tsFunction) { parameterFunctions.reserve(2); parameterFunctions.push_back(std::move(valueFunction)); @@ -48,26 +48,34 @@ VarVal TboolToTintPhysicalFunction::execute(const Record& record, ArenaRef& aren std::vector parameterValues; parameterValues.reserve(parameterFunctions.size()); for (const auto& function : parameterFunctions) + { parameterValues.emplace_back(function.execute(record, arena)); + } auto value = parameterValues[0].cast>(); - auto ts = parameterValues[1].cast>(); + auto ts = parameterValues[1].cast>(); const auto result = nautilus::invoke( - +[](double v, uint64_t t) -> double { - try { + +[](double value, + uint64_t ts) -> int { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); - std::string wkt = fmt::format("{}@{}", (v != 0.0 ? "t" : "f"), ts_str); - Temporal* temp = tbool_in(wkt.c_str()); - if (!temp) return 0.0; + std::string tempWkt = fmt::format("{}@{}", value != 0.0 ? "t" : "f", MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tbool_in(tempWkt.c_str()); + if (!temp) return 0; + Temporal* res = tbool_to_tint(temp); free(temp); - if (!res) return 0.0; + if (!res) return 0; int r = tint_start_value(res); free(res); - return static_cast(r); - } catch (const std::exception&) { return 0.0; } + return r; + } + catch (const std::exception&) + { + return 0; + } }, value, ts); diff --git a/nes-physical-operators/src/Functions/Meos/TdistanceTfloatFloatPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TdistanceTfloatFloatPhysicalFunction.cpp index f32584b1fc..cb18b54621 100644 --- a/nes-physical-operators/src/Functions/Meos/TdistanceTfloatFloatPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/TdistanceTfloatFloatPhysicalFunction.cpp @@ -36,13 +36,13 @@ extern "C" { namespace NES { TdistanceTfloatFloatPhysicalFunction::TdistanceTfloatFloatPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction tsFunction, - PhysicalFunction dFunction) + PhysicalFunction tsFunction, + PhysicalFunction arg0Function) { parameterFunctions.reserve(3); parameterFunctions.push_back(std::move(valueFunction)); parameterFunctions.push_back(std::move(tsFunction)); - parameterFunctions.push_back(std::move(dFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } VarVal TdistanceTfloatFloatPhysicalFunction::execute(const Record& record, ArenaRef& arena) const @@ -50,28 +50,38 @@ VarVal TdistanceTfloatFloatPhysicalFunction::execute(const Record& record, Arena std::vector parameterValues; parameterValues.reserve(parameterFunctions.size()); for (const auto& function : parameterFunctions) + { parameterValues.emplace_back(function.execute(record, arena)); + } auto value = parameterValues[0].cast>(); - auto ts = parameterValues[1].cast>(); - auto d = parameterValues[2].cast>(); + auto ts = parameterValues[1].cast>(); + auto arg0 = parameterValues[2].cast>(); const auto result = nautilus::invoke( - +[](double value, uint64_t ts, double d) -> double { - try { + +[](double value, + uint64_t ts, + double arg0) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); std::string tempWkt = fmt::format("{}@{}", value, MEOS::Meos::convertEpochToTimestamp(ts)); Temporal* temp = tfloat_in(tempWkt.c_str()); if (!temp) return 0.0; - Temporal* res = tdistance_tfloat_float(temp, d); + + Temporal* res = tdistance_tfloat_float(temp, arg0); free(temp); if (!res) return 0.0; double r = tfloat_start_value(res); free(res); return r; - } catch (const std::exception&) { return 0.0; } + } + catch (const std::exception&) + { + return 0.0; + } }, - value, ts, d); + value, ts, arg0); return VarVal(result); } diff --git a/nes-physical-operators/src/Functions/Meos/TdistanceTintIntPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TdistanceTintIntPhysicalFunction.cpp index fc43b94327..d54444943e 100644 --- a/nes-physical-operators/src/Functions/Meos/TdistanceTintIntPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/TdistanceTintIntPhysicalFunction.cpp @@ -36,13 +36,13 @@ extern "C" { namespace NES { TdistanceTintIntPhysicalFunction::TdistanceTintIntPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction tsFunction, - PhysicalFunction dFunction) + PhysicalFunction tsFunction, + PhysicalFunction arg0Function) { parameterFunctions.reserve(3); parameterFunctions.push_back(std::move(valueFunction)); parameterFunctions.push_back(std::move(tsFunction)); - parameterFunctions.push_back(std::move(dFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } VarVal TdistanceTintIntPhysicalFunction::execute(const Record& record, ArenaRef& arena) const @@ -50,28 +50,38 @@ VarVal TdistanceTintIntPhysicalFunction::execute(const Record& record, ArenaRef& std::vector parameterValues; parameterValues.reserve(parameterFunctions.size()); for (const auto& function : parameterFunctions) + { parameterValues.emplace_back(function.execute(record, arena)); + } - auto value = parameterValues[0].cast>(); - auto ts = parameterValues[1].cast>(); - auto d = parameterValues[2].cast>(); + auto value = parameterValues[0].cast>(); + auto ts = parameterValues[1].cast>(); + auto arg0 = parameterValues[2].cast>(); const auto result = nautilus::invoke( - +[](double value, uint64_t ts, double d_val) -> double { - try { + +[](int32_t value, + uint64_t ts, + int32_t arg0) -> int { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string tempWkt = fmt::format("{}@{}", static_cast(value), MEOS::Meos::convertEpochToTimestamp(ts)); + std::string tempWkt = fmt::format("{}@{}", value, MEOS::Meos::convertEpochToTimestamp(ts)); Temporal* temp = tint_in(tempWkt.c_str()); - if (!temp) return 0.0; - Temporal* res = tdistance_tint_int(temp, static_cast(d_val)); + if (!temp) return 0; + + Temporal* res = tdistance_tint_int(temp, arg0); free(temp); - if (!res) return 0.0; - double r = static_cast(tint_start_value(res)); + if (!res) return 0; + int r = tint_start_value(res); free(res); return r; - } catch (const std::exception&) { return 0.0; } + } + catch (const std::exception&) + { + return 0; + } }, - value, ts, d); + value, ts, arg0); return VarVal(result); } diff --git a/nes-physical-operators/src/Functions/Meos/TdistanceTnumberTnumberPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TdistanceTnumberTnumberPhysicalFunction.cpp index 26696f4bb7..461770dec2 100644 --- a/nes-physical-operators/src/Functions/Meos/TdistanceTnumberTnumberPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/TdistanceTnumberTnumberPhysicalFunction.cpp @@ -22,7 +22,8 @@ #include #include #include -#include +#include +#include #include #include #include @@ -35,14 +36,12 @@ extern "C" { namespace NES { -TdistanceTnumberTnumberPhysicalFunction::TdistanceTnumberTnumberPhysicalFunction(PhysicalFunction value1Function, - PhysicalFunction value2Function, - PhysicalFunction tsFunction) +TdistanceTnumberTnumberPhysicalFunction::TdistanceTnumberTnumberPhysicalFunction(PhysicalFunction trajFunction, + PhysicalFunction arg0Function) { - parameterFunctions.reserve(3); - parameterFunctions.push_back(std::move(value1Function)); - parameterFunctions.push_back(std::move(value2Function)); - parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.reserve(2); + parameterFunctions.push_back(std::move(trajFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } VarVal TdistanceTnumberTnumberPhysicalFunction::execute(const Record& record, ArenaRef& arena) const @@ -50,45 +49,74 @@ VarVal TdistanceTnumberTnumberPhysicalFunction::execute(const Record& record, Ar std::vector parameterValues; parameterValues.reserve(parameterFunctions.size()); for (const auto& function : parameterFunctions) + { parameterValues.emplace_back(function.execute(record, arena)); + } - auto value1 = parameterValues[0].cast>(); - auto value2 = parameterValues[1].cast>(); - auto ts = parameterValues[2].cast>(); + auto traj = parameterValues[0].cast(); + auto arg0 = parameterValues[1].cast(); - const auto result = nautilus::invoke( - +[](double value1, double value2, uint64_t ts) -> double { - try { + // Call MEOS f(Temporal*, Temporal*) -> Temporal* over the two hex-WKB + // operands and serialize the result back to hex-WKB inside the invoke; the + // returned heap string is copied into the arena below. Both operands and the + // MEOS result are freed here. + auto hexStr = nautilus::invoke( + +[](const char* aPtr, uint32_t aSize, const char* bPtr, uint32_t bSize) -> char* + { + try + { MEOS::Meos::ensureMeosInitialized(); - const std::string tsStr = MEOS::Meos::convertEpochToTimestamp(ts); - std::string wkt1 = fmt::format("{}@{}", value1, tsStr); - std::string wkt2 = fmt::format("{}@{}", value2, tsStr); - Temporal* t1 = tfloat_in(wkt1.c_str()); - Temporal* t2 = tfloat_in(wkt2.c_str()); - if (!t1 || !t2) { free(t1); free(t2); return 0.0; } - Temporal* res = tdistance_tnumber_tnumber(t1, t2); - free(t1); free(t2); - if (!res) return 0.0; - double r = tfloat_start_value(res); + std::string aHex(aPtr, aSize); + std::string bHex(bPtr, bSize); + Temporal* a = temporal_from_hexwkb(aHex.c_str()); + if (!a) return (char*) nullptr; + Temporal* b = temporal_from_hexwkb(bHex.c_str()); + if (!b) { free(a); return (char*) nullptr; } + Temporal* res = tdistance_tnumber_tnumber(a, b); + free(a); + free(b); + if (!res) return (char*) nullptr; + size_t hexSize = 0; + char* hexOut = temporal_as_hexwkb(res, 0, &hexSize); free(res); - return r; - } catch (const std::exception&) { return 0.0; } + return hexOut; + } + catch (const std::exception&) + { + return (char*) nullptr; + } }, - value1, value2, ts); + traj.getContent(), traj.getContentSize(), arg0.getContent(), arg0.getContentSize()); - return VarVal(result); + const auto hexLen = nautilus::invoke( + +[](const char* s) -> uint32_t { return s ? (uint32_t) strlen(s) : (uint32_t) 0; }, + hexStr); + + auto variableSized = arena.allocateVariableSizedData(hexLen); + + nautilus::invoke( + +[](int8_t* dest, const char* s, uint32_t len) -> void + { + if (s) + { + memcpy(dest, s, len); + free((void*) s); + } + }, + variableSized.getContent(), hexStr, hexLen); + + return variableSized; } PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTdistanceTnumberTnumberPhysicalFunction( PhysicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.childFunctions.size() == 3, - "TdistanceTnumberTnumberPhysicalFunction requires 3 children but got {}", + PRECONDITION(arguments.childFunctions.size() == 2, + "TdistanceTnumberTnumberPhysicalFunction requires 2 children but got {}", arguments.childFunctions.size()); auto arg0 = std::move(arguments.childFunctions[0]); auto arg1 = std::move(arguments.childFunctions[1]); - auto arg2 = std::move(arguments.childFunctions[2]); - return TdistanceTnumberTnumberPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); + return TdistanceTnumberTnumberPhysicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TemporalAContainsTNpointGeometryPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TemporalAContainsTNpointGeometryPhysicalFunction.cpp new file mode 100644 index 0000000000..9117a27506 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TemporalAContainsTNpointGeometryPhysicalFunction.cpp @@ -0,0 +1,118 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +TemporalAContainsTNpointGeometryPhysicalFunction::TemporalAContainsTNpointGeometryPhysicalFunction(PhysicalFunction ridFunction, + PhysicalFunction fractionFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction) +{ + parameterFunctions.reserve(4); + parameterFunctions.push_back(std::move(ridFunction)); + parameterFunctions.push_back(std::move(fractionFunction)); + parameterFunctions.push_back(std::move(timestampFunction)); + parameterFunctions.push_back(std::move(geometryFunction)); +} + +VarVal TemporalAContainsTNpointGeometryPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto rid = parameterValues[0].cast>(); + auto fraction = parameterValues[1].cast>(); + auto timestamp = parameterValues[2].cast>(); + auto geometry = parameterValues[3].cast(); + + const auto result = nautilus::invoke( + +[](uint64_t ridValue, double fractionValue, uint64_t timestampValue, + const char* geometryPtr, uint32_t geometrySize) -> int { + try + { + MEOS::Meos::ensureMeosInitialized(); + + const std::string timestampString = MEOS::Meos::convertEpochToTimestamp(timestampValue); + std::string tnpointWkt = fmt::format("NPoint({}, {})@{}", ridValue, fractionValue, timestampString); + std::string staticGeometryWkt(geometryPtr, geometrySize); + + while (!staticGeometryWkt.empty() && (staticGeometryWkt.front() == '\'' || staticGeometryWkt.front() == '"')) + staticGeometryWkt.erase(staticGeometryWkt.begin()); + while (!staticGeometryWkt.empty() && (staticGeometryWkt.back() == '\'' || staticGeometryWkt.back() == '"')) + staticGeometryWkt.pop_back(); + + if (tnpointWkt.empty() || staticGeometryWkt.empty()) return 0; + + Temporal* tnpoint = tnpoint_in(tnpointWkt.c_str()); + if (!tnpoint) return 0; + Temporal* tgeo = tnpoint_to_tgeompoint(tnpoint); + if (!tgeo) { free(tnpoint); return 0; } + MEOS::Meos::StaticGeometry staticGeometry(staticGeometryWkt); + if (!staticGeometry.getGeometry()) { free(tgeo); free(tnpoint); return 0; } + + int r = acontains_tgeo_geo(tgeo, staticGeometry.getGeometry()); + free(tgeo); + free(tnpoint); + return r; + } + catch (const std::exception&) + { + return 0; + } + }, + rid, fraction, timestamp, geometry.getContent(), geometry.getContentSize()); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTemporalAContainsTNpointGeometryPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 4, + "TemporalAContainsTNpointGeometryPhysicalFunction requires 4 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + return TemporalAContainsTNpointGeometryPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TemporalAContainsTNpointTNpointPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TemporalAContainsTNpointTNpointPhysicalFunction.cpp new file mode 100644 index 0000000000..e347e885d8 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TemporalAContainsTNpointTNpointPhysicalFunction.cpp @@ -0,0 +1,126 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +TemporalAContainsTNpointTNpointPhysicalFunction::TemporalAContainsTNpointTNpointPhysicalFunction(PhysicalFunction ridAFunction, + PhysicalFunction fractionAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction ridBFunction, + PhysicalFunction fractionBFunction, + PhysicalFunction tsBFunction) +{ + parameterFunctions.reserve(6); + parameterFunctions.push_back(std::move(ridAFunction)); + parameterFunctions.push_back(std::move(fractionAFunction)); + parameterFunctions.push_back(std::move(tsAFunction)); + parameterFunctions.push_back(std::move(ridBFunction)); + parameterFunctions.push_back(std::move(fractionBFunction)); + parameterFunctions.push_back(std::move(tsBFunction)); +} + +VarVal TemporalAContainsTNpointTNpointPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto ridA = parameterValues[0].cast>(); + auto fractionA = parameterValues[1].cast>(); + auto tsA = parameterValues[2].cast>(); + auto ridB = parameterValues[3].cast>(); + auto fractionB = parameterValues[4].cast>(); + auto tsB = parameterValues[5].cast>(); + + const auto result = nautilus::invoke( + +[](uint64_t ridAValue, double fractionAValue, uint64_t tsAValue, + uint64_t ridBValue, double fractionBValue, uint64_t tsBValue) -> int { + try + { + MEOS::Meos::ensureMeosInitialized(); + + const std::string tsAString = MEOS::Meos::convertEpochToTimestamp(tsAValue); + const std::string tsBString = MEOS::Meos::convertEpochToTimestamp(tsBValue); + std::string tnpointAWkt = fmt::format("NPoint({}, {})@{}", ridAValue, fractionAValue, tsAString); + std::string tnpointBWkt = fmt::format("NPoint({}, {})@{}", ridBValue, fractionBValue, tsBString); + + if (tnpointAWkt.empty() || tnpointBWkt.empty()) return 0; + + Temporal* tnpointA = tnpoint_in(tnpointAWkt.c_str()); + if (!tnpointA) return 0; + Temporal* tgeoA = tnpoint_to_tgeompoint(tnpointA); + if (!tgeoA) { free(tnpointA); return 0; } + Temporal* tnpointB = tnpoint_in(tnpointBWkt.c_str()); + if (!tnpointB) { free(tgeoA); free(tnpointA); return 0; } + Temporal* tgeoB = tnpoint_to_tgeompoint(tnpointB); + if (!tgeoB) { free(tnpointB); free(tgeoA); free(tnpointA); return 0; } + + int r = acontains_tgeo_tgeo(tgeoA, tgeoB); + free(tgeoB); + free(tnpointB); + free(tgeoA); + free(tnpointA); + return r; + } + catch (const std::exception&) + { + return 0; + } + }, + ridA, fractionA, tsA, ridB, fractionB, tsB); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTemporalAContainsTNpointTNpointPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 6, + "TemporalAContainsTNpointTNpointPhysicalFunction requires 6 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + auto arg5 = std::move(arguments.childFunctions[5]); + return TemporalAContainsTNpointTNpointPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TemporalAContainsTPoseGeometryPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TemporalAContainsTPoseGeometryPhysicalFunction.cpp new file mode 100644 index 0000000000..6cfcceb550 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TemporalAContainsTPoseGeometryPhysicalFunction.cpp @@ -0,0 +1,124 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +TemporalAContainsTPoseGeometryPhysicalFunction::TemporalAContainsTPoseGeometryPhysicalFunction(PhysicalFunction xFunction, + PhysicalFunction yFunction, + PhysicalFunction thetaFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction) +{ + parameterFunctions.reserve(5); + parameterFunctions.push_back(std::move(xFunction)); + parameterFunctions.push_back(std::move(yFunction)); + parameterFunctions.push_back(std::move(thetaFunction)); + parameterFunctions.push_back(std::move(timestampFunction)); + parameterFunctions.push_back(std::move(geometryFunction)); +} + +VarVal TemporalAContainsTPoseGeometryPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto x = parameterValues[0].cast>(); + auto y = parameterValues[1].cast>(); + auto theta = parameterValues[2].cast>(); + auto timestamp = parameterValues[3].cast>(); + auto geometry = parameterValues[4].cast(); + + const auto result = nautilus::invoke( + +[](double xValue, double yValue, double thetaValue, uint64_t timestampValue, + const char* geometryPtr, uint32_t geometrySize) -> int { + try + { + MEOS::Meos::ensureMeosInitialized(); + if (!(xValue >= -180.0 && xValue <= 180.0 && yValue >= -90.0 && yValue <= 90.0)) return 0; + + const std::string timestampString = MEOS::Meos::convertEpochToTimestamp(timestampValue); + std::string tposeWkt = fmt::format("Pose(Point({} {}), {})@{}", + xValue, yValue, thetaValue, timestampString); + std::string staticGeometryWkt(geometryPtr, geometrySize); + + while (!staticGeometryWkt.empty() && (staticGeometryWkt.front() == '\'' || staticGeometryWkt.front() == '"')) + staticGeometryWkt.erase(staticGeometryWkt.begin()); + while (!staticGeometryWkt.empty() && (staticGeometryWkt.back() == '\'' || staticGeometryWkt.back() == '"')) + staticGeometryWkt.pop_back(); + + if (tposeWkt.empty() || staticGeometryWkt.empty()) return 0; + + Temporal* tpose = tpose_in(tposeWkt.c_str()); + if (!tpose) return 0; + Temporal* tgeo = tpose_to_tpoint(tpose); + if (!tgeo) { free(tpose); return 0; } + MEOS::Meos::StaticGeometry staticGeometry(staticGeometryWkt); + if (!staticGeometry.getGeometry()) { free(tgeo); free(tpose); return 0; } + + int r = acontains_tgeo_geo(tgeo, staticGeometry.getGeometry()); + free(tgeo); + free(tpose); + return r; + } + catch (const std::exception&) + { + return 0; + } + }, + x, y, theta, timestamp, geometry.getContent(), geometry.getContentSize()); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTemporalAContainsTPoseGeometryPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 5, + "TemporalAContainsTPoseGeometryPhysicalFunction requires 5 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + return TemporalAContainsTPoseGeometryPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TemporalAContainsTPoseTPosePhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TemporalAContainsTPoseTPosePhysicalFunction.cpp new file mode 100644 index 0000000000..4c41e64de6 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TemporalAContainsTPoseTPosePhysicalFunction.cpp @@ -0,0 +1,136 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +TemporalAContainsTPoseTPosePhysicalFunction::TemporalAContainsTPoseTPosePhysicalFunction(PhysicalFunction xAFunction, + PhysicalFunction yAFunction, + PhysicalFunction thetaAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction xBFunction, + PhysicalFunction yBFunction, + PhysicalFunction thetaBFunction, + PhysicalFunction tsBFunction) +{ + parameterFunctions.reserve(8); + parameterFunctions.push_back(std::move(xAFunction)); + parameterFunctions.push_back(std::move(yAFunction)); + parameterFunctions.push_back(std::move(thetaAFunction)); + parameterFunctions.push_back(std::move(tsAFunction)); + parameterFunctions.push_back(std::move(xBFunction)); + parameterFunctions.push_back(std::move(yBFunction)); + parameterFunctions.push_back(std::move(thetaBFunction)); + parameterFunctions.push_back(std::move(tsBFunction)); +} + +VarVal TemporalAContainsTPoseTPosePhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto xA = parameterValues[0].cast>(); + auto yA = parameterValues[1].cast>(); + auto thetaA = parameterValues[2].cast>(); + auto tsA = parameterValues[3].cast>(); + auto xB = parameterValues[4].cast>(); + auto yB = parameterValues[5].cast>(); + auto thetaB = parameterValues[6].cast>(); + auto tsB = parameterValues[7].cast>(); + + const auto result = nautilus::invoke( + +[](double xAValue, double yAValue, double thetaAValue, uint64_t tsAValue, + double xBValue, double yBValue, double thetaBValue, uint64_t tsBValue) -> int { + try + { + MEOS::Meos::ensureMeosInitialized(); + if (!(xAValue >= -180.0 && xAValue <= 180.0 && yAValue >= -90.0 && yAValue <= 90.0)) return 0; + if (!(xBValue >= -180.0 && xBValue <= 180.0 && yBValue >= -90.0 && yBValue <= 90.0)) return 0; + + const std::string tsAString = MEOS::Meos::convertEpochToTimestamp(tsAValue); + const std::string tsBString = MEOS::Meos::convertEpochToTimestamp(tsBValue); + std::string tposeAWkt = fmt::format("Pose(Point({} {}), {})@{}", xAValue, yAValue, thetaAValue, tsAString); + std::string tposeBWkt = fmt::format("Pose(Point({} {}), {})@{}", xBValue, yBValue, thetaBValue, tsBString); + + if (tposeAWkt.empty() || tposeBWkt.empty()) return 0; + + Temporal* tposeA = tpose_in(tposeAWkt.c_str()); + if (!tposeA) return 0; + Temporal* tgeoA = tpose_to_tpoint(tposeA); + if (!tgeoA) { free(tposeA); return 0; } + Temporal* tposeB = tpose_in(tposeBWkt.c_str()); + if (!tposeB) { free(tgeoA); free(tposeA); return 0; } + Temporal* tgeoB = tpose_to_tpoint(tposeB); + if (!tgeoB) { free(tposeB); free(tgeoA); free(tposeA); return 0; } + + int r = acontains_tgeo_tgeo(tgeoA, tgeoB); + free(tgeoB); + free(tposeB); + free(tgeoA); + free(tposeA); + return r; + } + catch (const std::exception&) + { + return 0; + } + }, + xA, yA, thetaA, tsA, xB, yB, thetaB, tsB); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTemporalAContainsTPoseTPosePhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 8, + "TemporalAContainsTPoseTPosePhysicalFunction requires 8 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + auto arg5 = std::move(arguments.childFunctions[5]); + auto arg6 = std::move(arguments.childFunctions[6]); + auto arg7 = std::move(arguments.childFunctions[7]); + return TemporalAContainsTPoseTPosePhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6), std::move(arg7)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TemporalADWithinTNpointGeometryPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TemporalADWithinTNpointGeometryPhysicalFunction.cpp new file mode 100644 index 0000000000..da99a247fc --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TemporalADWithinTNpointGeometryPhysicalFunction.cpp @@ -0,0 +1,122 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +TemporalADWithinTNpointGeometryPhysicalFunction::TemporalADWithinTNpointGeometryPhysicalFunction(PhysicalFunction ridFunction, + PhysicalFunction fractionFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction, + PhysicalFunction distFunction) +{ + parameterFunctions.reserve(5); + parameterFunctions.push_back(std::move(ridFunction)); + parameterFunctions.push_back(std::move(fractionFunction)); + parameterFunctions.push_back(std::move(timestampFunction)); + parameterFunctions.push_back(std::move(geometryFunction)); + parameterFunctions.push_back(std::move(distFunction)); +} + +VarVal TemporalADWithinTNpointGeometryPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto rid = parameterValues[0].cast>(); + auto fraction = parameterValues[1].cast>(); + auto timestamp = parameterValues[2].cast>(); + auto geometry = parameterValues[3].cast(); + auto dist = parameterValues[4].cast>(); + + const auto result = nautilus::invoke( + +[](uint64_t ridValue, double fractionValue, uint64_t timestampValue, + const char* geometryPtr, uint32_t geometrySize, double distValue) -> int { + try + { + MEOS::Meos::ensureMeosInitialized(); + + const std::string timestampString = MEOS::Meos::convertEpochToTimestamp(timestampValue); + std::string tnpointWkt = fmt::format("NPoint({}, {})@{}", ridValue, fractionValue, timestampString); + std::string staticGeometryWkt(geometryPtr, geometrySize); + + while (!staticGeometryWkt.empty() && (staticGeometryWkt.front() == '\'' || staticGeometryWkt.front() == '"')) + staticGeometryWkt.erase(staticGeometryWkt.begin()); + while (!staticGeometryWkt.empty() && (staticGeometryWkt.back() == '\'' || staticGeometryWkt.back() == '"')) + staticGeometryWkt.pop_back(); + + if (tnpointWkt.empty() || staticGeometryWkt.empty()) return 0; + + Temporal* tnpoint = tnpoint_in(tnpointWkt.c_str()); + if (!tnpoint) return 0; + Temporal* tgeo = tnpoint_to_tgeompoint(tnpoint); + if (!tgeo) { free(tnpoint); return 0; } + MEOS::Meos::StaticGeometry staticGeometry(staticGeometryWkt); + if (!staticGeometry.getGeometry()) { free(tgeo); free(tnpoint); return 0; } + + int r = adwithin_tgeo_geo(tgeo, staticGeometry.getGeometry(), distValue); + free(tgeo); + free(tnpoint); + return r; + } + catch (const std::exception&) + { + return 0; + } + }, + rid, fraction, timestamp, geometry.getContent(), geometry.getContentSize(), dist); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTemporalADWithinTNpointGeometryPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 5, + "TemporalADWithinTNpointGeometryPhysicalFunction requires 5 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + return TemporalADWithinTNpointGeometryPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TemporalADWithinTNpointTNpointPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TemporalADWithinTNpointTNpointPhysicalFunction.cpp new file mode 100644 index 0000000000..3f2423f4dd --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TemporalADWithinTNpointTNpointPhysicalFunction.cpp @@ -0,0 +1,131 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +TemporalADWithinTNpointTNpointPhysicalFunction::TemporalADWithinTNpointTNpointPhysicalFunction(PhysicalFunction ridAFunction, + PhysicalFunction fractionAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction ridBFunction, + PhysicalFunction fractionBFunction, + PhysicalFunction tsBFunction, + PhysicalFunction distFunction) +{ + parameterFunctions.reserve(7); + parameterFunctions.push_back(std::move(ridAFunction)); + parameterFunctions.push_back(std::move(fractionAFunction)); + parameterFunctions.push_back(std::move(tsAFunction)); + parameterFunctions.push_back(std::move(ridBFunction)); + parameterFunctions.push_back(std::move(fractionBFunction)); + parameterFunctions.push_back(std::move(tsBFunction)); + parameterFunctions.push_back(std::move(distFunction)); +} + +VarVal TemporalADWithinTNpointTNpointPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto ridA = parameterValues[0].cast>(); + auto fractionA = parameterValues[1].cast>(); + auto tsA = parameterValues[2].cast>(); + auto ridB = parameterValues[3].cast>(); + auto fractionB = parameterValues[4].cast>(); + auto tsB = parameterValues[5].cast>(); + auto dist = parameterValues[6].cast>(); + + const auto result = nautilus::invoke( + +[](uint64_t ridAValue, double fractionAValue, uint64_t tsAValue, + uint64_t ridBValue, double fractionBValue, uint64_t tsBValue, + double distValue) -> int { + try + { + MEOS::Meos::ensureMeosInitialized(); + + const std::string tsAString = MEOS::Meos::convertEpochToTimestamp(tsAValue); + const std::string tsBString = MEOS::Meos::convertEpochToTimestamp(tsBValue); + std::string tnpointAWkt = fmt::format("NPoint({}, {})@{}", ridAValue, fractionAValue, tsAString); + std::string tnpointBWkt = fmt::format("NPoint({}, {})@{}", ridBValue, fractionBValue, tsBString); + + if (tnpointAWkt.empty() || tnpointBWkt.empty()) return 0; + + Temporal* tnpointA = tnpoint_in(tnpointAWkt.c_str()); + if (!tnpointA) return 0; + Temporal* tgeoA = tnpoint_to_tgeompoint(tnpointA); + if (!tgeoA) { free(tnpointA); return 0; } + Temporal* tnpointB = tnpoint_in(tnpointBWkt.c_str()); + if (!tnpointB) { free(tgeoA); free(tnpointA); return 0; } + Temporal* tgeoB = tnpoint_to_tgeompoint(tnpointB); + if (!tgeoB) { free(tnpointB); free(tgeoA); free(tnpointA); return 0; } + + int r = adwithin_tgeo_tgeo(tgeoA, tgeoB, distValue); + free(tgeoB); + free(tnpointB); + free(tgeoA); + free(tnpointA); + return r; + } + catch (const std::exception&) + { + return 0; + } + }, + ridA, fractionA, tsA, ridB, fractionB, tsB, dist); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTemporalADWithinTNpointTNpointPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 7, + "TemporalADWithinTNpointTNpointPhysicalFunction requires 7 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + auto arg5 = std::move(arguments.childFunctions[5]); + auto arg6 = std::move(arguments.childFunctions[6]); + return TemporalADWithinTNpointTNpointPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TemporalADWithinTPoseGeometryPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TemporalADWithinTPoseGeometryPhysicalFunction.cpp new file mode 100644 index 0000000000..a7a4aa8702 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TemporalADWithinTPoseGeometryPhysicalFunction.cpp @@ -0,0 +1,128 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +TemporalADWithinTPoseGeometryPhysicalFunction::TemporalADWithinTPoseGeometryPhysicalFunction(PhysicalFunction xFunction, + PhysicalFunction yFunction, + PhysicalFunction thetaFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction, + PhysicalFunction distFunction) +{ + parameterFunctions.reserve(6); + parameterFunctions.push_back(std::move(xFunction)); + parameterFunctions.push_back(std::move(yFunction)); + parameterFunctions.push_back(std::move(thetaFunction)); + parameterFunctions.push_back(std::move(timestampFunction)); + parameterFunctions.push_back(std::move(geometryFunction)); + parameterFunctions.push_back(std::move(distFunction)); +} + +VarVal TemporalADWithinTPoseGeometryPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto x = parameterValues[0].cast>(); + auto y = parameterValues[1].cast>(); + auto theta = parameterValues[2].cast>(); + auto timestamp = parameterValues[3].cast>(); + auto geometry = parameterValues[4].cast(); + auto dist = parameterValues[5].cast>(); + + const auto result = nautilus::invoke( + +[](double xValue, double yValue, double thetaValue, uint64_t timestampValue, + const char* geometryPtr, uint32_t geometrySize, double distValue) -> int { + try + { + MEOS::Meos::ensureMeosInitialized(); + if (!(xValue >= -180.0 && xValue <= 180.0 && yValue >= -90.0 && yValue <= 90.0)) return 0; + + const std::string timestampString = MEOS::Meos::convertEpochToTimestamp(timestampValue); + std::string tposeWkt = fmt::format("Pose(Point({} {}), {})@{}", + xValue, yValue, thetaValue, timestampString); + std::string staticGeometryWkt(geometryPtr, geometrySize); + + while (!staticGeometryWkt.empty() && (staticGeometryWkt.front() == '\'' || staticGeometryWkt.front() == '"')) + staticGeometryWkt.erase(staticGeometryWkt.begin()); + while (!staticGeometryWkt.empty() && (staticGeometryWkt.back() == '\'' || staticGeometryWkt.back() == '"')) + staticGeometryWkt.pop_back(); + + if (tposeWkt.empty() || staticGeometryWkt.empty()) return 0; + + Temporal* tpose = tpose_in(tposeWkt.c_str()); + if (!tpose) return 0; + Temporal* tgeo = tpose_to_tpoint(tpose); + if (!tgeo) { free(tpose); return 0; } + MEOS::Meos::StaticGeometry staticGeometry(staticGeometryWkt); + if (!staticGeometry.getGeometry()) { free(tgeo); free(tpose); return 0; } + + int r = adwithin_tgeo_geo(tgeo, staticGeometry.getGeometry(), distValue); + free(tgeo); + free(tpose); + return r; + } + catch (const std::exception&) + { + return 0; + } + }, + x, y, theta, timestamp, geometry.getContent(), geometry.getContentSize(), dist); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTemporalADWithinTPoseGeometryPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 6, + "TemporalADWithinTPoseGeometryPhysicalFunction requires 6 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + auto arg5 = std::move(arguments.childFunctions[5]); + return TemporalADWithinTPoseGeometryPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TemporalADWithinTPoseTPosePhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TemporalADWithinTPoseTPosePhysicalFunction.cpp new file mode 100644 index 0000000000..988729ce54 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TemporalADWithinTPoseTPosePhysicalFunction.cpp @@ -0,0 +1,141 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +TemporalADWithinTPoseTPosePhysicalFunction::TemporalADWithinTPoseTPosePhysicalFunction(PhysicalFunction xAFunction, + PhysicalFunction yAFunction, + PhysicalFunction thetaAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction xBFunction, + PhysicalFunction yBFunction, + PhysicalFunction thetaBFunction, + PhysicalFunction tsBFunction, + PhysicalFunction distFunction) +{ + parameterFunctions.reserve(9); + parameterFunctions.push_back(std::move(xAFunction)); + parameterFunctions.push_back(std::move(yAFunction)); + parameterFunctions.push_back(std::move(thetaAFunction)); + parameterFunctions.push_back(std::move(tsAFunction)); + parameterFunctions.push_back(std::move(xBFunction)); + parameterFunctions.push_back(std::move(yBFunction)); + parameterFunctions.push_back(std::move(thetaBFunction)); + parameterFunctions.push_back(std::move(tsBFunction)); + parameterFunctions.push_back(std::move(distFunction)); +} + +VarVal TemporalADWithinTPoseTPosePhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto xA = parameterValues[0].cast>(); + auto yA = parameterValues[1].cast>(); + auto thetaA = parameterValues[2].cast>(); + auto tsA = parameterValues[3].cast>(); + auto xB = parameterValues[4].cast>(); + auto yB = parameterValues[5].cast>(); + auto thetaB = parameterValues[6].cast>(); + auto tsB = parameterValues[7].cast>(); + auto dist = parameterValues[8].cast>(); + + const auto result = nautilus::invoke( + +[](double xAValue, double yAValue, double thetaAValue, uint64_t tsAValue, + double xBValue, double yBValue, double thetaBValue, uint64_t tsBValue, + double distValue) -> int { + try + { + MEOS::Meos::ensureMeosInitialized(); + if (!(xAValue >= -180.0 && xAValue <= 180.0 && yAValue >= -90.0 && yAValue <= 90.0)) return 0; + if (!(xBValue >= -180.0 && xBValue <= 180.0 && yBValue >= -90.0 && yBValue <= 90.0)) return 0; + + const std::string tsAString = MEOS::Meos::convertEpochToTimestamp(tsAValue); + const std::string tsBString = MEOS::Meos::convertEpochToTimestamp(tsBValue); + std::string tposeAWkt = fmt::format("Pose(Point({} {}), {})@{}", xAValue, yAValue, thetaAValue, tsAString); + std::string tposeBWkt = fmt::format("Pose(Point({} {}), {})@{}", xBValue, yBValue, thetaBValue, tsBString); + + if (tposeAWkt.empty() || tposeBWkt.empty()) return 0; + + Temporal* tposeA = tpose_in(tposeAWkt.c_str()); + if (!tposeA) return 0; + Temporal* tgeoA = tpose_to_tpoint(tposeA); + if (!tgeoA) { free(tposeA); return 0; } + Temporal* tposeB = tpose_in(tposeBWkt.c_str()); + if (!tposeB) { free(tgeoA); free(tposeA); return 0; } + Temporal* tgeoB = tpose_to_tpoint(tposeB); + if (!tgeoB) { free(tposeB); free(tgeoA); free(tposeA); return 0; } + + int r = adwithin_tgeo_tgeo(tgeoA, tgeoB, distValue); + free(tgeoB); + free(tposeB); + free(tgeoA); + free(tposeA); + return r; + } + catch (const std::exception&) + { + return 0; + } + }, + xA, yA, thetaA, tsA, xB, yB, thetaB, tsB, dist); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTemporalADWithinTPoseTPosePhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 9, + "TemporalADWithinTPoseTPosePhysicalFunction requires 9 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + auto arg5 = std::move(arguments.childFunctions[5]); + auto arg6 = std::move(arguments.childFunctions[6]); + auto arg7 = std::move(arguments.childFunctions[7]); + auto arg8 = std::move(arguments.childFunctions[8]); + return TemporalADWithinTPoseTPosePhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6), std::move(arg7), std::move(arg8)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TemporalADisjointTNpointGeometryPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TemporalADisjointTNpointGeometryPhysicalFunction.cpp new file mode 100644 index 0000000000..dff22a4085 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TemporalADisjointTNpointGeometryPhysicalFunction.cpp @@ -0,0 +1,118 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +TemporalADisjointTNpointGeometryPhysicalFunction::TemporalADisjointTNpointGeometryPhysicalFunction(PhysicalFunction ridFunction, + PhysicalFunction fractionFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction) +{ + parameterFunctions.reserve(4); + parameterFunctions.push_back(std::move(ridFunction)); + parameterFunctions.push_back(std::move(fractionFunction)); + parameterFunctions.push_back(std::move(timestampFunction)); + parameterFunctions.push_back(std::move(geometryFunction)); +} + +VarVal TemporalADisjointTNpointGeometryPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto rid = parameterValues[0].cast>(); + auto fraction = parameterValues[1].cast>(); + auto timestamp = parameterValues[2].cast>(); + auto geometry = parameterValues[3].cast(); + + const auto result = nautilus::invoke( + +[](uint64_t ridValue, double fractionValue, uint64_t timestampValue, + const char* geometryPtr, uint32_t geometrySize) -> int { + try + { + MEOS::Meos::ensureMeosInitialized(); + + const std::string timestampString = MEOS::Meos::convertEpochToTimestamp(timestampValue); + std::string tnpointWkt = fmt::format("NPoint({}, {})@{}", ridValue, fractionValue, timestampString); + std::string staticGeometryWkt(geometryPtr, geometrySize); + + while (!staticGeometryWkt.empty() && (staticGeometryWkt.front() == '\'' || staticGeometryWkt.front() == '"')) + staticGeometryWkt.erase(staticGeometryWkt.begin()); + while (!staticGeometryWkt.empty() && (staticGeometryWkt.back() == '\'' || staticGeometryWkt.back() == '"')) + staticGeometryWkt.pop_back(); + + if (tnpointWkt.empty() || staticGeometryWkt.empty()) return 0; + + Temporal* tnpoint = tnpoint_in(tnpointWkt.c_str()); + if (!tnpoint) return 0; + Temporal* tgeo = tnpoint_to_tgeompoint(tnpoint); + if (!tgeo) { free(tnpoint); return 0; } + MEOS::Meos::StaticGeometry staticGeometry(staticGeometryWkt); + if (!staticGeometry.getGeometry()) { free(tgeo); free(tnpoint); return 0; } + + int r = adisjoint_tgeo_geo(tgeo, staticGeometry.getGeometry()); + free(tgeo); + free(tnpoint); + return r; + } + catch (const std::exception&) + { + return 0; + } + }, + rid, fraction, timestamp, geometry.getContent(), geometry.getContentSize()); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTemporalADisjointTNpointGeometryPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 4, + "TemporalADisjointTNpointGeometryPhysicalFunction requires 4 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + return TemporalADisjointTNpointGeometryPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TemporalADisjointTNpointTNpointPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TemporalADisjointTNpointTNpointPhysicalFunction.cpp new file mode 100644 index 0000000000..8a07cc2dfb --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TemporalADisjointTNpointTNpointPhysicalFunction.cpp @@ -0,0 +1,126 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +TemporalADisjointTNpointTNpointPhysicalFunction::TemporalADisjointTNpointTNpointPhysicalFunction(PhysicalFunction ridAFunction, + PhysicalFunction fractionAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction ridBFunction, + PhysicalFunction fractionBFunction, + PhysicalFunction tsBFunction) +{ + parameterFunctions.reserve(6); + parameterFunctions.push_back(std::move(ridAFunction)); + parameterFunctions.push_back(std::move(fractionAFunction)); + parameterFunctions.push_back(std::move(tsAFunction)); + parameterFunctions.push_back(std::move(ridBFunction)); + parameterFunctions.push_back(std::move(fractionBFunction)); + parameterFunctions.push_back(std::move(tsBFunction)); +} + +VarVal TemporalADisjointTNpointTNpointPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto ridA = parameterValues[0].cast>(); + auto fractionA = parameterValues[1].cast>(); + auto tsA = parameterValues[2].cast>(); + auto ridB = parameterValues[3].cast>(); + auto fractionB = parameterValues[4].cast>(); + auto tsB = parameterValues[5].cast>(); + + const auto result = nautilus::invoke( + +[](uint64_t ridAValue, double fractionAValue, uint64_t tsAValue, + uint64_t ridBValue, double fractionBValue, uint64_t tsBValue) -> int { + try + { + MEOS::Meos::ensureMeosInitialized(); + + const std::string tsAString = MEOS::Meos::convertEpochToTimestamp(tsAValue); + const std::string tsBString = MEOS::Meos::convertEpochToTimestamp(tsBValue); + std::string tnpointAWkt = fmt::format("NPoint({}, {})@{}", ridAValue, fractionAValue, tsAString); + std::string tnpointBWkt = fmt::format("NPoint({}, {})@{}", ridBValue, fractionBValue, tsBString); + + if (tnpointAWkt.empty() || tnpointBWkt.empty()) return 0; + + Temporal* tnpointA = tnpoint_in(tnpointAWkt.c_str()); + if (!tnpointA) return 0; + Temporal* tgeoA = tnpoint_to_tgeompoint(tnpointA); + if (!tgeoA) { free(tnpointA); return 0; } + Temporal* tnpointB = tnpoint_in(tnpointBWkt.c_str()); + if (!tnpointB) { free(tgeoA); free(tnpointA); return 0; } + Temporal* tgeoB = tnpoint_to_tgeompoint(tnpointB); + if (!tgeoB) { free(tnpointB); free(tgeoA); free(tnpointA); return 0; } + + int r = adisjoint_tgeo_tgeo(tgeoA, tgeoB); + free(tgeoB); + free(tnpointB); + free(tgeoA); + free(tnpointA); + return r; + } + catch (const std::exception&) + { + return 0; + } + }, + ridA, fractionA, tsA, ridB, fractionB, tsB); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTemporalADisjointTNpointTNpointPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 6, + "TemporalADisjointTNpointTNpointPhysicalFunction requires 6 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + auto arg5 = std::move(arguments.childFunctions[5]); + return TemporalADisjointTNpointTNpointPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TemporalADisjointTPoseGeometryPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TemporalADisjointTPoseGeometryPhysicalFunction.cpp new file mode 100644 index 0000000000..c83756ca94 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TemporalADisjointTPoseGeometryPhysicalFunction.cpp @@ -0,0 +1,124 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +TemporalADisjointTPoseGeometryPhysicalFunction::TemporalADisjointTPoseGeometryPhysicalFunction(PhysicalFunction xFunction, + PhysicalFunction yFunction, + PhysicalFunction thetaFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction) +{ + parameterFunctions.reserve(5); + parameterFunctions.push_back(std::move(xFunction)); + parameterFunctions.push_back(std::move(yFunction)); + parameterFunctions.push_back(std::move(thetaFunction)); + parameterFunctions.push_back(std::move(timestampFunction)); + parameterFunctions.push_back(std::move(geometryFunction)); +} + +VarVal TemporalADisjointTPoseGeometryPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto x = parameterValues[0].cast>(); + auto y = parameterValues[1].cast>(); + auto theta = parameterValues[2].cast>(); + auto timestamp = parameterValues[3].cast>(); + auto geometry = parameterValues[4].cast(); + + const auto result = nautilus::invoke( + +[](double xValue, double yValue, double thetaValue, uint64_t timestampValue, + const char* geometryPtr, uint32_t geometrySize) -> int { + try + { + MEOS::Meos::ensureMeosInitialized(); + if (!(xValue >= -180.0 && xValue <= 180.0 && yValue >= -90.0 && yValue <= 90.0)) return 0; + + const std::string timestampString = MEOS::Meos::convertEpochToTimestamp(timestampValue); + std::string tposeWkt = fmt::format("Pose(Point({} {}), {})@{}", + xValue, yValue, thetaValue, timestampString); + std::string staticGeometryWkt(geometryPtr, geometrySize); + + while (!staticGeometryWkt.empty() && (staticGeometryWkt.front() == '\'' || staticGeometryWkt.front() == '"')) + staticGeometryWkt.erase(staticGeometryWkt.begin()); + while (!staticGeometryWkt.empty() && (staticGeometryWkt.back() == '\'' || staticGeometryWkt.back() == '"')) + staticGeometryWkt.pop_back(); + + if (tposeWkt.empty() || staticGeometryWkt.empty()) return 0; + + Temporal* tpose = tpose_in(tposeWkt.c_str()); + if (!tpose) return 0; + Temporal* tgeo = tpose_to_tpoint(tpose); + if (!tgeo) { free(tpose); return 0; } + MEOS::Meos::StaticGeometry staticGeometry(staticGeometryWkt); + if (!staticGeometry.getGeometry()) { free(tgeo); free(tpose); return 0; } + + int r = adisjoint_tgeo_geo(tgeo, staticGeometry.getGeometry()); + free(tgeo); + free(tpose); + return r; + } + catch (const std::exception&) + { + return 0; + } + }, + x, y, theta, timestamp, geometry.getContent(), geometry.getContentSize()); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTemporalADisjointTPoseGeometryPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 5, + "TemporalADisjointTPoseGeometryPhysicalFunction requires 5 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + return TemporalADisjointTPoseGeometryPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TemporalADisjointTPoseTPosePhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TemporalADisjointTPoseTPosePhysicalFunction.cpp new file mode 100644 index 0000000000..4c762fbfc1 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TemporalADisjointTPoseTPosePhysicalFunction.cpp @@ -0,0 +1,136 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +TemporalADisjointTPoseTPosePhysicalFunction::TemporalADisjointTPoseTPosePhysicalFunction(PhysicalFunction xAFunction, + PhysicalFunction yAFunction, + PhysicalFunction thetaAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction xBFunction, + PhysicalFunction yBFunction, + PhysicalFunction thetaBFunction, + PhysicalFunction tsBFunction) +{ + parameterFunctions.reserve(8); + parameterFunctions.push_back(std::move(xAFunction)); + parameterFunctions.push_back(std::move(yAFunction)); + parameterFunctions.push_back(std::move(thetaAFunction)); + parameterFunctions.push_back(std::move(tsAFunction)); + parameterFunctions.push_back(std::move(xBFunction)); + parameterFunctions.push_back(std::move(yBFunction)); + parameterFunctions.push_back(std::move(thetaBFunction)); + parameterFunctions.push_back(std::move(tsBFunction)); +} + +VarVal TemporalADisjointTPoseTPosePhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto xA = parameterValues[0].cast>(); + auto yA = parameterValues[1].cast>(); + auto thetaA = parameterValues[2].cast>(); + auto tsA = parameterValues[3].cast>(); + auto xB = parameterValues[4].cast>(); + auto yB = parameterValues[5].cast>(); + auto thetaB = parameterValues[6].cast>(); + auto tsB = parameterValues[7].cast>(); + + const auto result = nautilus::invoke( + +[](double xAValue, double yAValue, double thetaAValue, uint64_t tsAValue, + double xBValue, double yBValue, double thetaBValue, uint64_t tsBValue) -> int { + try + { + MEOS::Meos::ensureMeosInitialized(); + if (!(xAValue >= -180.0 && xAValue <= 180.0 && yAValue >= -90.0 && yAValue <= 90.0)) return 0; + if (!(xBValue >= -180.0 && xBValue <= 180.0 && yBValue >= -90.0 && yBValue <= 90.0)) return 0; + + const std::string tsAString = MEOS::Meos::convertEpochToTimestamp(tsAValue); + const std::string tsBString = MEOS::Meos::convertEpochToTimestamp(tsBValue); + std::string tposeAWkt = fmt::format("Pose(Point({} {}), {})@{}", xAValue, yAValue, thetaAValue, tsAString); + std::string tposeBWkt = fmt::format("Pose(Point({} {}), {})@{}", xBValue, yBValue, thetaBValue, tsBString); + + if (tposeAWkt.empty() || tposeBWkt.empty()) return 0; + + Temporal* tposeA = tpose_in(tposeAWkt.c_str()); + if (!tposeA) return 0; + Temporal* tgeoA = tpose_to_tpoint(tposeA); + if (!tgeoA) { free(tposeA); return 0; } + Temporal* tposeB = tpose_in(tposeBWkt.c_str()); + if (!tposeB) { free(tgeoA); free(tposeA); return 0; } + Temporal* tgeoB = tpose_to_tpoint(tposeB); + if (!tgeoB) { free(tposeB); free(tgeoA); free(tposeA); return 0; } + + int r = adisjoint_tgeo_tgeo(tgeoA, tgeoB); + free(tgeoB); + free(tposeB); + free(tgeoA); + free(tposeA); + return r; + } + catch (const std::exception&) + { + return 0; + } + }, + xA, yA, thetaA, tsA, xB, yB, thetaB, tsB); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTemporalADisjointTPoseTPosePhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 8, + "TemporalADisjointTPoseTPosePhysicalFunction requires 8 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + auto arg5 = std::move(arguments.childFunctions[5]); + auto arg6 = std::move(arguments.childFunctions[6]); + auto arg7 = std::move(arguments.childFunctions[7]); + return TemporalADisjointTPoseTPosePhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6), std::move(arg7)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TemporalAIntersectsTNpointGeometryPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TemporalAIntersectsTNpointGeometryPhysicalFunction.cpp new file mode 100644 index 0000000000..a50638053f --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TemporalAIntersectsTNpointGeometryPhysicalFunction.cpp @@ -0,0 +1,118 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +TemporalAIntersectsTNpointGeometryPhysicalFunction::TemporalAIntersectsTNpointGeometryPhysicalFunction(PhysicalFunction ridFunction, + PhysicalFunction fractionFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction) +{ + parameterFunctions.reserve(4); + parameterFunctions.push_back(std::move(ridFunction)); + parameterFunctions.push_back(std::move(fractionFunction)); + parameterFunctions.push_back(std::move(timestampFunction)); + parameterFunctions.push_back(std::move(geometryFunction)); +} + +VarVal TemporalAIntersectsTNpointGeometryPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto rid = parameterValues[0].cast>(); + auto fraction = parameterValues[1].cast>(); + auto timestamp = parameterValues[2].cast>(); + auto geometry = parameterValues[3].cast(); + + const auto result = nautilus::invoke( + +[](uint64_t ridValue, double fractionValue, uint64_t timestampValue, + const char* geometryPtr, uint32_t geometrySize) -> int { + try + { + MEOS::Meos::ensureMeosInitialized(); + + const std::string timestampString = MEOS::Meos::convertEpochToTimestamp(timestampValue); + std::string tnpointWkt = fmt::format("NPoint({}, {})@{}", ridValue, fractionValue, timestampString); + std::string staticGeometryWkt(geometryPtr, geometrySize); + + while (!staticGeometryWkt.empty() && (staticGeometryWkt.front() == '\'' || staticGeometryWkt.front() == '"')) + staticGeometryWkt.erase(staticGeometryWkt.begin()); + while (!staticGeometryWkt.empty() && (staticGeometryWkt.back() == '\'' || staticGeometryWkt.back() == '"')) + staticGeometryWkt.pop_back(); + + if (tnpointWkt.empty() || staticGeometryWkt.empty()) return 0; + + Temporal* tnpoint = tnpoint_in(tnpointWkt.c_str()); + if (!tnpoint) return 0; + Temporal* tgeo = tnpoint_to_tgeompoint(tnpoint); + if (!tgeo) { free(tnpoint); return 0; } + MEOS::Meos::StaticGeometry staticGeometry(staticGeometryWkt); + if (!staticGeometry.getGeometry()) { free(tgeo); free(tnpoint); return 0; } + + int r = aintersects_tgeo_geo(tgeo, staticGeometry.getGeometry()); + free(tgeo); + free(tnpoint); + return r; + } + catch (const std::exception&) + { + return 0; + } + }, + rid, fraction, timestamp, geometry.getContent(), geometry.getContentSize()); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTemporalAIntersectsTNpointGeometryPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 4, + "TemporalAIntersectsTNpointGeometryPhysicalFunction requires 4 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + return TemporalAIntersectsTNpointGeometryPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TemporalAIntersectsTNpointTNpointPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TemporalAIntersectsTNpointTNpointPhysicalFunction.cpp new file mode 100644 index 0000000000..daa80b7093 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TemporalAIntersectsTNpointTNpointPhysicalFunction.cpp @@ -0,0 +1,126 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +TemporalAIntersectsTNpointTNpointPhysicalFunction::TemporalAIntersectsTNpointTNpointPhysicalFunction(PhysicalFunction ridAFunction, + PhysicalFunction fractionAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction ridBFunction, + PhysicalFunction fractionBFunction, + PhysicalFunction tsBFunction) +{ + parameterFunctions.reserve(6); + parameterFunctions.push_back(std::move(ridAFunction)); + parameterFunctions.push_back(std::move(fractionAFunction)); + parameterFunctions.push_back(std::move(tsAFunction)); + parameterFunctions.push_back(std::move(ridBFunction)); + parameterFunctions.push_back(std::move(fractionBFunction)); + parameterFunctions.push_back(std::move(tsBFunction)); +} + +VarVal TemporalAIntersectsTNpointTNpointPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto ridA = parameterValues[0].cast>(); + auto fractionA = parameterValues[1].cast>(); + auto tsA = parameterValues[2].cast>(); + auto ridB = parameterValues[3].cast>(); + auto fractionB = parameterValues[4].cast>(); + auto tsB = parameterValues[5].cast>(); + + const auto result = nautilus::invoke( + +[](uint64_t ridAValue, double fractionAValue, uint64_t tsAValue, + uint64_t ridBValue, double fractionBValue, uint64_t tsBValue) -> int { + try + { + MEOS::Meos::ensureMeosInitialized(); + + const std::string tsAString = MEOS::Meos::convertEpochToTimestamp(tsAValue); + const std::string tsBString = MEOS::Meos::convertEpochToTimestamp(tsBValue); + std::string tnpointAWkt = fmt::format("NPoint({}, {})@{}", ridAValue, fractionAValue, tsAString); + std::string tnpointBWkt = fmt::format("NPoint({}, {})@{}", ridBValue, fractionBValue, tsBString); + + if (tnpointAWkt.empty() || tnpointBWkt.empty()) return 0; + + Temporal* tnpointA = tnpoint_in(tnpointAWkt.c_str()); + if (!tnpointA) return 0; + Temporal* tgeoA = tnpoint_to_tgeompoint(tnpointA); + if (!tgeoA) { free(tnpointA); return 0; } + Temporal* tnpointB = tnpoint_in(tnpointBWkt.c_str()); + if (!tnpointB) { free(tgeoA); free(tnpointA); return 0; } + Temporal* tgeoB = tnpoint_to_tgeompoint(tnpointB); + if (!tgeoB) { free(tnpointB); free(tgeoA); free(tnpointA); return 0; } + + int r = aintersects_tgeo_tgeo(tgeoA, tgeoB); + free(tgeoB); + free(tnpointB); + free(tgeoA); + free(tnpointA); + return r; + } + catch (const std::exception&) + { + return 0; + } + }, + ridA, fractionA, tsA, ridB, fractionB, tsB); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTemporalAIntersectsTNpointTNpointPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 6, + "TemporalAIntersectsTNpointTNpointPhysicalFunction requires 6 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + auto arg5 = std::move(arguments.childFunctions[5]); + return TemporalAIntersectsTNpointTNpointPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TemporalAIntersectsTPoseGeometryPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TemporalAIntersectsTPoseGeometryPhysicalFunction.cpp new file mode 100644 index 0000000000..98370112a6 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TemporalAIntersectsTPoseGeometryPhysicalFunction.cpp @@ -0,0 +1,124 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +TemporalAIntersectsTPoseGeometryPhysicalFunction::TemporalAIntersectsTPoseGeometryPhysicalFunction(PhysicalFunction xFunction, + PhysicalFunction yFunction, + PhysicalFunction thetaFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction) +{ + parameterFunctions.reserve(5); + parameterFunctions.push_back(std::move(xFunction)); + parameterFunctions.push_back(std::move(yFunction)); + parameterFunctions.push_back(std::move(thetaFunction)); + parameterFunctions.push_back(std::move(timestampFunction)); + parameterFunctions.push_back(std::move(geometryFunction)); +} + +VarVal TemporalAIntersectsTPoseGeometryPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto x = parameterValues[0].cast>(); + auto y = parameterValues[1].cast>(); + auto theta = parameterValues[2].cast>(); + auto timestamp = parameterValues[3].cast>(); + auto geometry = parameterValues[4].cast(); + + const auto result = nautilus::invoke( + +[](double xValue, double yValue, double thetaValue, uint64_t timestampValue, + const char* geometryPtr, uint32_t geometrySize) -> int { + try + { + MEOS::Meos::ensureMeosInitialized(); + if (!(xValue >= -180.0 && xValue <= 180.0 && yValue >= -90.0 && yValue <= 90.0)) return 0; + + const std::string timestampString = MEOS::Meos::convertEpochToTimestamp(timestampValue); + std::string tposeWkt = fmt::format("Pose(Point({} {}), {})@{}", + xValue, yValue, thetaValue, timestampString); + std::string staticGeometryWkt(geometryPtr, geometrySize); + + while (!staticGeometryWkt.empty() && (staticGeometryWkt.front() == '\'' || staticGeometryWkt.front() == '"')) + staticGeometryWkt.erase(staticGeometryWkt.begin()); + while (!staticGeometryWkt.empty() && (staticGeometryWkt.back() == '\'' || staticGeometryWkt.back() == '"')) + staticGeometryWkt.pop_back(); + + if (tposeWkt.empty() || staticGeometryWkt.empty()) return 0; + + Temporal* tpose = tpose_in(tposeWkt.c_str()); + if (!tpose) return 0; + Temporal* tgeo = tpose_to_tpoint(tpose); + if (!tgeo) { free(tpose); return 0; } + MEOS::Meos::StaticGeometry staticGeometry(staticGeometryWkt); + if (!staticGeometry.getGeometry()) { free(tgeo); free(tpose); return 0; } + + int r = aintersects_tgeo_geo(tgeo, staticGeometry.getGeometry()); + free(tgeo); + free(tpose); + return r; + } + catch (const std::exception&) + { + return 0; + } + }, + x, y, theta, timestamp, geometry.getContent(), geometry.getContentSize()); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTemporalAIntersectsTPoseGeometryPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 5, + "TemporalAIntersectsTPoseGeometryPhysicalFunction requires 5 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + return TemporalAIntersectsTPoseGeometryPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TemporalAIntersectsTPoseTPosePhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TemporalAIntersectsTPoseTPosePhysicalFunction.cpp new file mode 100644 index 0000000000..f583c92e19 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TemporalAIntersectsTPoseTPosePhysicalFunction.cpp @@ -0,0 +1,136 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +TemporalAIntersectsTPoseTPosePhysicalFunction::TemporalAIntersectsTPoseTPosePhysicalFunction(PhysicalFunction xAFunction, + PhysicalFunction yAFunction, + PhysicalFunction thetaAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction xBFunction, + PhysicalFunction yBFunction, + PhysicalFunction thetaBFunction, + PhysicalFunction tsBFunction) +{ + parameterFunctions.reserve(8); + parameterFunctions.push_back(std::move(xAFunction)); + parameterFunctions.push_back(std::move(yAFunction)); + parameterFunctions.push_back(std::move(thetaAFunction)); + parameterFunctions.push_back(std::move(tsAFunction)); + parameterFunctions.push_back(std::move(xBFunction)); + parameterFunctions.push_back(std::move(yBFunction)); + parameterFunctions.push_back(std::move(thetaBFunction)); + parameterFunctions.push_back(std::move(tsBFunction)); +} + +VarVal TemporalAIntersectsTPoseTPosePhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto xA = parameterValues[0].cast>(); + auto yA = parameterValues[1].cast>(); + auto thetaA = parameterValues[2].cast>(); + auto tsA = parameterValues[3].cast>(); + auto xB = parameterValues[4].cast>(); + auto yB = parameterValues[5].cast>(); + auto thetaB = parameterValues[6].cast>(); + auto tsB = parameterValues[7].cast>(); + + const auto result = nautilus::invoke( + +[](double xAValue, double yAValue, double thetaAValue, uint64_t tsAValue, + double xBValue, double yBValue, double thetaBValue, uint64_t tsBValue) -> int { + try + { + MEOS::Meos::ensureMeosInitialized(); + if (!(xAValue >= -180.0 && xAValue <= 180.0 && yAValue >= -90.0 && yAValue <= 90.0)) return 0; + if (!(xBValue >= -180.0 && xBValue <= 180.0 && yBValue >= -90.0 && yBValue <= 90.0)) return 0; + + const std::string tsAString = MEOS::Meos::convertEpochToTimestamp(tsAValue); + const std::string tsBString = MEOS::Meos::convertEpochToTimestamp(tsBValue); + std::string tposeAWkt = fmt::format("Pose(Point({} {}), {})@{}", xAValue, yAValue, thetaAValue, tsAString); + std::string tposeBWkt = fmt::format("Pose(Point({} {}), {})@{}", xBValue, yBValue, thetaBValue, tsBString); + + if (tposeAWkt.empty() || tposeBWkt.empty()) return 0; + + Temporal* tposeA = tpose_in(tposeAWkt.c_str()); + if (!tposeA) return 0; + Temporal* tgeoA = tpose_to_tpoint(tposeA); + if (!tgeoA) { free(tposeA); return 0; } + Temporal* tposeB = tpose_in(tposeBWkt.c_str()); + if (!tposeB) { free(tgeoA); free(tposeA); return 0; } + Temporal* tgeoB = tpose_to_tpoint(tposeB); + if (!tgeoB) { free(tposeB); free(tgeoA); free(tposeA); return 0; } + + int r = aintersects_tgeo_tgeo(tgeoA, tgeoB); + free(tgeoB); + free(tposeB); + free(tgeoA); + free(tposeA); + return r; + } + catch (const std::exception&) + { + return 0; + } + }, + xA, yA, thetaA, tsA, xB, yB, thetaB, tsB); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTemporalAIntersectsTPoseTPosePhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 8, + "TemporalAIntersectsTPoseTPosePhysicalFunction requires 8 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + auto arg5 = std::move(arguments.childFunctions[5]); + auto arg6 = std::move(arguments.childFunctions[6]); + auto arg7 = std::move(arguments.childFunctions[7]); + return TemporalAIntersectsTPoseTPosePhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6), std::move(arg7)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TemporalATouchesTNpointGeometryPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TemporalATouchesTNpointGeometryPhysicalFunction.cpp new file mode 100644 index 0000000000..83b47a5f65 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TemporalATouchesTNpointGeometryPhysicalFunction.cpp @@ -0,0 +1,118 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +TemporalATouchesTNpointGeometryPhysicalFunction::TemporalATouchesTNpointGeometryPhysicalFunction(PhysicalFunction ridFunction, + PhysicalFunction fractionFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction) +{ + parameterFunctions.reserve(4); + parameterFunctions.push_back(std::move(ridFunction)); + parameterFunctions.push_back(std::move(fractionFunction)); + parameterFunctions.push_back(std::move(timestampFunction)); + parameterFunctions.push_back(std::move(geometryFunction)); +} + +VarVal TemporalATouchesTNpointGeometryPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto rid = parameterValues[0].cast>(); + auto fraction = parameterValues[1].cast>(); + auto timestamp = parameterValues[2].cast>(); + auto geometry = parameterValues[3].cast(); + + const auto result = nautilus::invoke( + +[](uint64_t ridValue, double fractionValue, uint64_t timestampValue, + const char* geometryPtr, uint32_t geometrySize) -> int { + try + { + MEOS::Meos::ensureMeosInitialized(); + + const std::string timestampString = MEOS::Meos::convertEpochToTimestamp(timestampValue); + std::string tnpointWkt = fmt::format("NPoint({}, {})@{}", ridValue, fractionValue, timestampString); + std::string staticGeometryWkt(geometryPtr, geometrySize); + + while (!staticGeometryWkt.empty() && (staticGeometryWkt.front() == '\'' || staticGeometryWkt.front() == '"')) + staticGeometryWkt.erase(staticGeometryWkt.begin()); + while (!staticGeometryWkt.empty() && (staticGeometryWkt.back() == '\'' || staticGeometryWkt.back() == '"')) + staticGeometryWkt.pop_back(); + + if (tnpointWkt.empty() || staticGeometryWkt.empty()) return 0; + + Temporal* tnpoint = tnpoint_in(tnpointWkt.c_str()); + if (!tnpoint) return 0; + Temporal* tgeo = tnpoint_to_tgeompoint(tnpoint); + if (!tgeo) { free(tnpoint); return 0; } + MEOS::Meos::StaticGeometry staticGeometry(staticGeometryWkt); + if (!staticGeometry.getGeometry()) { free(tgeo); free(tnpoint); return 0; } + + int r = atouches_tgeo_geo(tgeo, staticGeometry.getGeometry()); + free(tgeo); + free(tnpoint); + return r; + } + catch (const std::exception&) + { + return 0; + } + }, + rid, fraction, timestamp, geometry.getContent(), geometry.getContentSize()); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTemporalATouchesTNpointGeometryPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 4, + "TemporalATouchesTNpointGeometryPhysicalFunction requires 4 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + return TemporalATouchesTNpointGeometryPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TemporalATouchesTNpointTNpointPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TemporalATouchesTNpointTNpointPhysicalFunction.cpp new file mode 100644 index 0000000000..9efb004284 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TemporalATouchesTNpointTNpointPhysicalFunction.cpp @@ -0,0 +1,126 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +TemporalATouchesTNpointTNpointPhysicalFunction::TemporalATouchesTNpointTNpointPhysicalFunction(PhysicalFunction ridAFunction, + PhysicalFunction fractionAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction ridBFunction, + PhysicalFunction fractionBFunction, + PhysicalFunction tsBFunction) +{ + parameterFunctions.reserve(6); + parameterFunctions.push_back(std::move(ridAFunction)); + parameterFunctions.push_back(std::move(fractionAFunction)); + parameterFunctions.push_back(std::move(tsAFunction)); + parameterFunctions.push_back(std::move(ridBFunction)); + parameterFunctions.push_back(std::move(fractionBFunction)); + parameterFunctions.push_back(std::move(tsBFunction)); +} + +VarVal TemporalATouchesTNpointTNpointPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto ridA = parameterValues[0].cast>(); + auto fractionA = parameterValues[1].cast>(); + auto tsA = parameterValues[2].cast>(); + auto ridB = parameterValues[3].cast>(); + auto fractionB = parameterValues[4].cast>(); + auto tsB = parameterValues[5].cast>(); + + const auto result = nautilus::invoke( + +[](uint64_t ridAValue, double fractionAValue, uint64_t tsAValue, + uint64_t ridBValue, double fractionBValue, uint64_t tsBValue) -> int { + try + { + MEOS::Meos::ensureMeosInitialized(); + + const std::string tsAString = MEOS::Meos::convertEpochToTimestamp(tsAValue); + const std::string tsBString = MEOS::Meos::convertEpochToTimestamp(tsBValue); + std::string tnpointAWkt = fmt::format("NPoint({}, {})@{}", ridAValue, fractionAValue, tsAString); + std::string tnpointBWkt = fmt::format("NPoint({}, {})@{}", ridBValue, fractionBValue, tsBString); + + if (tnpointAWkt.empty() || tnpointBWkt.empty()) return 0; + + Temporal* tnpointA = tnpoint_in(tnpointAWkt.c_str()); + if (!tnpointA) return 0; + Temporal* tgeoA = tnpoint_to_tgeompoint(tnpointA); + if (!tgeoA) { free(tnpointA); return 0; } + Temporal* tnpointB = tnpoint_in(tnpointBWkt.c_str()); + if (!tnpointB) { free(tgeoA); free(tnpointA); return 0; } + Temporal* tgeoB = tnpoint_to_tgeompoint(tnpointB); + if (!tgeoB) { free(tnpointB); free(tgeoA); free(tnpointA); return 0; } + + int r = atouches_tgeo_tgeo(tgeoA, tgeoB); + free(tgeoB); + free(tnpointB); + free(tgeoA); + free(tnpointA); + return r; + } + catch (const std::exception&) + { + return 0; + } + }, + ridA, fractionA, tsA, ridB, fractionB, tsB); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTemporalATouchesTNpointTNpointPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 6, + "TemporalATouchesTNpointTNpointPhysicalFunction requires 6 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + auto arg5 = std::move(arguments.childFunctions[5]); + return TemporalATouchesTNpointTNpointPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TemporalATouchesTPoseGeometryPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TemporalATouchesTPoseGeometryPhysicalFunction.cpp new file mode 100644 index 0000000000..b8b52bd58d --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TemporalATouchesTPoseGeometryPhysicalFunction.cpp @@ -0,0 +1,124 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +TemporalATouchesTPoseGeometryPhysicalFunction::TemporalATouchesTPoseGeometryPhysicalFunction(PhysicalFunction xFunction, + PhysicalFunction yFunction, + PhysicalFunction thetaFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction) +{ + parameterFunctions.reserve(5); + parameterFunctions.push_back(std::move(xFunction)); + parameterFunctions.push_back(std::move(yFunction)); + parameterFunctions.push_back(std::move(thetaFunction)); + parameterFunctions.push_back(std::move(timestampFunction)); + parameterFunctions.push_back(std::move(geometryFunction)); +} + +VarVal TemporalATouchesTPoseGeometryPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto x = parameterValues[0].cast>(); + auto y = parameterValues[1].cast>(); + auto theta = parameterValues[2].cast>(); + auto timestamp = parameterValues[3].cast>(); + auto geometry = parameterValues[4].cast(); + + const auto result = nautilus::invoke( + +[](double xValue, double yValue, double thetaValue, uint64_t timestampValue, + const char* geometryPtr, uint32_t geometrySize) -> int { + try + { + MEOS::Meos::ensureMeosInitialized(); + if (!(xValue >= -180.0 && xValue <= 180.0 && yValue >= -90.0 && yValue <= 90.0)) return 0; + + const std::string timestampString = MEOS::Meos::convertEpochToTimestamp(timestampValue); + std::string tposeWkt = fmt::format("Pose(Point({} {}), {})@{}", + xValue, yValue, thetaValue, timestampString); + std::string staticGeometryWkt(geometryPtr, geometrySize); + + while (!staticGeometryWkt.empty() && (staticGeometryWkt.front() == '\'' || staticGeometryWkt.front() == '"')) + staticGeometryWkt.erase(staticGeometryWkt.begin()); + while (!staticGeometryWkt.empty() && (staticGeometryWkt.back() == '\'' || staticGeometryWkt.back() == '"')) + staticGeometryWkt.pop_back(); + + if (tposeWkt.empty() || staticGeometryWkt.empty()) return 0; + + Temporal* tpose = tpose_in(tposeWkt.c_str()); + if (!tpose) return 0; + Temporal* tgeo = tpose_to_tpoint(tpose); + if (!tgeo) { free(tpose); return 0; } + MEOS::Meos::StaticGeometry staticGeometry(staticGeometryWkt); + if (!staticGeometry.getGeometry()) { free(tgeo); free(tpose); return 0; } + + int r = atouches_tgeo_geo(tgeo, staticGeometry.getGeometry()); + free(tgeo); + free(tpose); + return r; + } + catch (const std::exception&) + { + return 0; + } + }, + x, y, theta, timestamp, geometry.getContent(), geometry.getContentSize()); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTemporalATouchesTPoseGeometryPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 5, + "TemporalATouchesTPoseGeometryPhysicalFunction requires 5 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + return TemporalATouchesTPoseGeometryPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TemporalATouchesTPoseTPosePhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TemporalATouchesTPoseTPosePhysicalFunction.cpp new file mode 100644 index 0000000000..65767e2a08 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TemporalATouchesTPoseTPosePhysicalFunction.cpp @@ -0,0 +1,136 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +TemporalATouchesTPoseTPosePhysicalFunction::TemporalATouchesTPoseTPosePhysicalFunction(PhysicalFunction xAFunction, + PhysicalFunction yAFunction, + PhysicalFunction thetaAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction xBFunction, + PhysicalFunction yBFunction, + PhysicalFunction thetaBFunction, + PhysicalFunction tsBFunction) +{ + parameterFunctions.reserve(8); + parameterFunctions.push_back(std::move(xAFunction)); + parameterFunctions.push_back(std::move(yAFunction)); + parameterFunctions.push_back(std::move(thetaAFunction)); + parameterFunctions.push_back(std::move(tsAFunction)); + parameterFunctions.push_back(std::move(xBFunction)); + parameterFunctions.push_back(std::move(yBFunction)); + parameterFunctions.push_back(std::move(thetaBFunction)); + parameterFunctions.push_back(std::move(tsBFunction)); +} + +VarVal TemporalATouchesTPoseTPosePhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto xA = parameterValues[0].cast>(); + auto yA = parameterValues[1].cast>(); + auto thetaA = parameterValues[2].cast>(); + auto tsA = parameterValues[3].cast>(); + auto xB = parameterValues[4].cast>(); + auto yB = parameterValues[5].cast>(); + auto thetaB = parameterValues[6].cast>(); + auto tsB = parameterValues[7].cast>(); + + const auto result = nautilus::invoke( + +[](double xAValue, double yAValue, double thetaAValue, uint64_t tsAValue, + double xBValue, double yBValue, double thetaBValue, uint64_t tsBValue) -> int { + try + { + MEOS::Meos::ensureMeosInitialized(); + if (!(xAValue >= -180.0 && xAValue <= 180.0 && yAValue >= -90.0 && yAValue <= 90.0)) return 0; + if (!(xBValue >= -180.0 && xBValue <= 180.0 && yBValue >= -90.0 && yBValue <= 90.0)) return 0; + + const std::string tsAString = MEOS::Meos::convertEpochToTimestamp(tsAValue); + const std::string tsBString = MEOS::Meos::convertEpochToTimestamp(tsBValue); + std::string tposeAWkt = fmt::format("Pose(Point({} {}), {})@{}", xAValue, yAValue, thetaAValue, tsAString); + std::string tposeBWkt = fmt::format("Pose(Point({} {}), {})@{}", xBValue, yBValue, thetaBValue, tsBString); + + if (tposeAWkt.empty() || tposeBWkt.empty()) return 0; + + Temporal* tposeA = tpose_in(tposeAWkt.c_str()); + if (!tposeA) return 0; + Temporal* tgeoA = tpose_to_tpoint(tposeA); + if (!tgeoA) { free(tposeA); return 0; } + Temporal* tposeB = tpose_in(tposeBWkt.c_str()); + if (!tposeB) { free(tgeoA); free(tposeA); return 0; } + Temporal* tgeoB = tpose_to_tpoint(tposeB); + if (!tgeoB) { free(tposeB); free(tgeoA); free(tposeA); return 0; } + + int r = atouches_tgeo_tgeo(tgeoA, tgeoB); + free(tgeoB); + free(tposeB); + free(tgeoA); + free(tposeA); + return r; + } + catch (const std::exception&) + { + return 0; + } + }, + xA, yA, thetaA, tsA, xB, yB, thetaB, tsB); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTemporalATouchesTPoseTPosePhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 8, + "TemporalATouchesTPoseTPosePhysicalFunction requires 8 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + auto arg5 = std::move(arguments.childFunctions[5]); + auto arg6 = std::move(arguments.childFunctions[6]); + auto arg7 = std::move(arguments.childFunctions[7]); + return TemporalATouchesTPoseTPosePhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6), std::move(arg7)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TemporalEContainsTNpointGeometryPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TemporalEContainsTNpointGeometryPhysicalFunction.cpp new file mode 100644 index 0000000000..e895fbcd94 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TemporalEContainsTNpointGeometryPhysicalFunction.cpp @@ -0,0 +1,118 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +TemporalEContainsTNpointGeometryPhysicalFunction::TemporalEContainsTNpointGeometryPhysicalFunction(PhysicalFunction ridFunction, + PhysicalFunction fractionFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction) +{ + parameterFunctions.reserve(4); + parameterFunctions.push_back(std::move(ridFunction)); + parameterFunctions.push_back(std::move(fractionFunction)); + parameterFunctions.push_back(std::move(timestampFunction)); + parameterFunctions.push_back(std::move(geometryFunction)); +} + +VarVal TemporalEContainsTNpointGeometryPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto rid = parameterValues[0].cast>(); + auto fraction = parameterValues[1].cast>(); + auto timestamp = parameterValues[2].cast>(); + auto geometry = parameterValues[3].cast(); + + const auto result = nautilus::invoke( + +[](uint64_t ridValue, double fractionValue, uint64_t timestampValue, + const char* geometryPtr, uint32_t geometrySize) -> int { + try + { + MEOS::Meos::ensureMeosInitialized(); + + const std::string timestampString = MEOS::Meos::convertEpochToTimestamp(timestampValue); + std::string tnpointWkt = fmt::format("NPoint({}, {})@{}", ridValue, fractionValue, timestampString); + std::string staticGeometryWkt(geometryPtr, geometrySize); + + while (!staticGeometryWkt.empty() && (staticGeometryWkt.front() == '\'' || staticGeometryWkt.front() == '"')) + staticGeometryWkt.erase(staticGeometryWkt.begin()); + while (!staticGeometryWkt.empty() && (staticGeometryWkt.back() == '\'' || staticGeometryWkt.back() == '"')) + staticGeometryWkt.pop_back(); + + if (tnpointWkt.empty() || staticGeometryWkt.empty()) return 0; + + Temporal* tnpoint = tnpoint_in(tnpointWkt.c_str()); + if (!tnpoint) return 0; + Temporal* tgeo = tnpoint_to_tgeompoint(tnpoint); + if (!tgeo) { free(tnpoint); return 0; } + MEOS::Meos::StaticGeometry staticGeometry(staticGeometryWkt); + if (!staticGeometry.getGeometry()) { free(tgeo); free(tnpoint); return 0; } + + int r = econtains_tgeo_geo(tgeo, staticGeometry.getGeometry()); + free(tgeo); + free(tnpoint); + return r; + } + catch (const std::exception&) + { + return 0; + } + }, + rid, fraction, timestamp, geometry.getContent(), geometry.getContentSize()); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTemporalEContainsTNpointGeometryPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 4, + "TemporalEContainsTNpointGeometryPhysicalFunction requires 4 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + return TemporalEContainsTNpointGeometryPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TemporalEContainsTNpointTNpointPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TemporalEContainsTNpointTNpointPhysicalFunction.cpp new file mode 100644 index 0000000000..b435a68713 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TemporalEContainsTNpointTNpointPhysicalFunction.cpp @@ -0,0 +1,126 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +TemporalEContainsTNpointTNpointPhysicalFunction::TemporalEContainsTNpointTNpointPhysicalFunction(PhysicalFunction ridAFunction, + PhysicalFunction fractionAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction ridBFunction, + PhysicalFunction fractionBFunction, + PhysicalFunction tsBFunction) +{ + parameterFunctions.reserve(6); + parameterFunctions.push_back(std::move(ridAFunction)); + parameterFunctions.push_back(std::move(fractionAFunction)); + parameterFunctions.push_back(std::move(tsAFunction)); + parameterFunctions.push_back(std::move(ridBFunction)); + parameterFunctions.push_back(std::move(fractionBFunction)); + parameterFunctions.push_back(std::move(tsBFunction)); +} + +VarVal TemporalEContainsTNpointTNpointPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto ridA = parameterValues[0].cast>(); + auto fractionA = parameterValues[1].cast>(); + auto tsA = parameterValues[2].cast>(); + auto ridB = parameterValues[3].cast>(); + auto fractionB = parameterValues[4].cast>(); + auto tsB = parameterValues[5].cast>(); + + const auto result = nautilus::invoke( + +[](uint64_t ridAValue, double fractionAValue, uint64_t tsAValue, + uint64_t ridBValue, double fractionBValue, uint64_t tsBValue) -> int { + try + { + MEOS::Meos::ensureMeosInitialized(); + + const std::string tsAString = MEOS::Meos::convertEpochToTimestamp(tsAValue); + const std::string tsBString = MEOS::Meos::convertEpochToTimestamp(tsBValue); + std::string tnpointAWkt = fmt::format("NPoint({}, {})@{}", ridAValue, fractionAValue, tsAString); + std::string tnpointBWkt = fmt::format("NPoint({}, {})@{}", ridBValue, fractionBValue, tsBString); + + if (tnpointAWkt.empty() || tnpointBWkt.empty()) return 0; + + Temporal* tnpointA = tnpoint_in(tnpointAWkt.c_str()); + if (!tnpointA) return 0; + Temporal* tgeoA = tnpoint_to_tgeompoint(tnpointA); + if (!tgeoA) { free(tnpointA); return 0; } + Temporal* tnpointB = tnpoint_in(tnpointBWkt.c_str()); + if (!tnpointB) { free(tgeoA); free(tnpointA); return 0; } + Temporal* tgeoB = tnpoint_to_tgeompoint(tnpointB); + if (!tgeoB) { free(tnpointB); free(tgeoA); free(tnpointA); return 0; } + + int r = econtains_tgeo_tgeo(tgeoA, tgeoB); + free(tgeoB); + free(tnpointB); + free(tgeoA); + free(tnpointA); + return r; + } + catch (const std::exception&) + { + return 0; + } + }, + ridA, fractionA, tsA, ridB, fractionB, tsB); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTemporalEContainsTNpointTNpointPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 6, + "TemporalEContainsTNpointTNpointPhysicalFunction requires 6 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + auto arg5 = std::move(arguments.childFunctions[5]); + return TemporalEContainsTNpointTNpointPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TemporalEContainsTPoseGeometryPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TemporalEContainsTPoseGeometryPhysicalFunction.cpp new file mode 100644 index 0000000000..3ac62f1c41 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TemporalEContainsTPoseGeometryPhysicalFunction.cpp @@ -0,0 +1,124 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +TemporalEContainsTPoseGeometryPhysicalFunction::TemporalEContainsTPoseGeometryPhysicalFunction(PhysicalFunction xFunction, + PhysicalFunction yFunction, + PhysicalFunction thetaFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction) +{ + parameterFunctions.reserve(5); + parameterFunctions.push_back(std::move(xFunction)); + parameterFunctions.push_back(std::move(yFunction)); + parameterFunctions.push_back(std::move(thetaFunction)); + parameterFunctions.push_back(std::move(timestampFunction)); + parameterFunctions.push_back(std::move(geometryFunction)); +} + +VarVal TemporalEContainsTPoseGeometryPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto x = parameterValues[0].cast>(); + auto y = parameterValues[1].cast>(); + auto theta = parameterValues[2].cast>(); + auto timestamp = parameterValues[3].cast>(); + auto geometry = parameterValues[4].cast(); + + const auto result = nautilus::invoke( + +[](double xValue, double yValue, double thetaValue, uint64_t timestampValue, + const char* geometryPtr, uint32_t geometrySize) -> int { + try + { + MEOS::Meos::ensureMeosInitialized(); + if (!(xValue >= -180.0 && xValue <= 180.0 && yValue >= -90.0 && yValue <= 90.0)) return 0; + + const std::string timestampString = MEOS::Meos::convertEpochToTimestamp(timestampValue); + std::string tposeWkt = fmt::format("Pose(Point({} {}), {})@{}", + xValue, yValue, thetaValue, timestampString); + std::string staticGeometryWkt(geometryPtr, geometrySize); + + while (!staticGeometryWkt.empty() && (staticGeometryWkt.front() == '\'' || staticGeometryWkt.front() == '"')) + staticGeometryWkt.erase(staticGeometryWkt.begin()); + while (!staticGeometryWkt.empty() && (staticGeometryWkt.back() == '\'' || staticGeometryWkt.back() == '"')) + staticGeometryWkt.pop_back(); + + if (tposeWkt.empty() || staticGeometryWkt.empty()) return 0; + + Temporal* tpose = tpose_in(tposeWkt.c_str()); + if (!tpose) return 0; + Temporal* tgeo = tpose_to_tpoint(tpose); + if (!tgeo) { free(tpose); return 0; } + MEOS::Meos::StaticGeometry staticGeometry(staticGeometryWkt); + if (!staticGeometry.getGeometry()) { free(tgeo); free(tpose); return 0; } + + int r = econtains_tgeo_geo(tgeo, staticGeometry.getGeometry()); + free(tgeo); + free(tpose); + return r; + } + catch (const std::exception&) + { + return 0; + } + }, + x, y, theta, timestamp, geometry.getContent(), geometry.getContentSize()); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTemporalEContainsTPoseGeometryPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 5, + "TemporalEContainsTPoseGeometryPhysicalFunction requires 5 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + return TemporalEContainsTPoseGeometryPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TemporalEContainsTPoseTPosePhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TemporalEContainsTPoseTPosePhysicalFunction.cpp new file mode 100644 index 0000000000..aea0df7fc9 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TemporalEContainsTPoseTPosePhysicalFunction.cpp @@ -0,0 +1,136 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +TemporalEContainsTPoseTPosePhysicalFunction::TemporalEContainsTPoseTPosePhysicalFunction(PhysicalFunction xAFunction, + PhysicalFunction yAFunction, + PhysicalFunction thetaAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction xBFunction, + PhysicalFunction yBFunction, + PhysicalFunction thetaBFunction, + PhysicalFunction tsBFunction) +{ + parameterFunctions.reserve(8); + parameterFunctions.push_back(std::move(xAFunction)); + parameterFunctions.push_back(std::move(yAFunction)); + parameterFunctions.push_back(std::move(thetaAFunction)); + parameterFunctions.push_back(std::move(tsAFunction)); + parameterFunctions.push_back(std::move(xBFunction)); + parameterFunctions.push_back(std::move(yBFunction)); + parameterFunctions.push_back(std::move(thetaBFunction)); + parameterFunctions.push_back(std::move(tsBFunction)); +} + +VarVal TemporalEContainsTPoseTPosePhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto xA = parameterValues[0].cast>(); + auto yA = parameterValues[1].cast>(); + auto thetaA = parameterValues[2].cast>(); + auto tsA = parameterValues[3].cast>(); + auto xB = parameterValues[4].cast>(); + auto yB = parameterValues[5].cast>(); + auto thetaB = parameterValues[6].cast>(); + auto tsB = parameterValues[7].cast>(); + + const auto result = nautilus::invoke( + +[](double xAValue, double yAValue, double thetaAValue, uint64_t tsAValue, + double xBValue, double yBValue, double thetaBValue, uint64_t tsBValue) -> int { + try + { + MEOS::Meos::ensureMeosInitialized(); + if (!(xAValue >= -180.0 && xAValue <= 180.0 && yAValue >= -90.0 && yAValue <= 90.0)) return 0; + if (!(xBValue >= -180.0 && xBValue <= 180.0 && yBValue >= -90.0 && yBValue <= 90.0)) return 0; + + const std::string tsAString = MEOS::Meos::convertEpochToTimestamp(tsAValue); + const std::string tsBString = MEOS::Meos::convertEpochToTimestamp(tsBValue); + std::string tposeAWkt = fmt::format("Pose(Point({} {}), {})@{}", xAValue, yAValue, thetaAValue, tsAString); + std::string tposeBWkt = fmt::format("Pose(Point({} {}), {})@{}", xBValue, yBValue, thetaBValue, tsBString); + + if (tposeAWkt.empty() || tposeBWkt.empty()) return 0; + + Temporal* tposeA = tpose_in(tposeAWkt.c_str()); + if (!tposeA) return 0; + Temporal* tgeoA = tpose_to_tpoint(tposeA); + if (!tgeoA) { free(tposeA); return 0; } + Temporal* tposeB = tpose_in(tposeBWkt.c_str()); + if (!tposeB) { free(tgeoA); free(tposeA); return 0; } + Temporal* tgeoB = tpose_to_tpoint(tposeB); + if (!tgeoB) { free(tposeB); free(tgeoA); free(tposeA); return 0; } + + int r = econtains_tgeo_tgeo(tgeoA, tgeoB); + free(tgeoB); + free(tposeB); + free(tgeoA); + free(tposeA); + return r; + } + catch (const std::exception&) + { + return 0; + } + }, + xA, yA, thetaA, tsA, xB, yB, thetaB, tsB); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTemporalEContainsTPoseTPosePhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 8, + "TemporalEContainsTPoseTPosePhysicalFunction requires 8 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + auto arg5 = std::move(arguments.childFunctions[5]); + auto arg6 = std::move(arguments.childFunctions[6]); + auto arg7 = std::move(arguments.childFunctions[7]); + return TemporalEContainsTPoseTPosePhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6), std::move(arg7)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TemporalECoversTNpointGeometryPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TemporalECoversTNpointGeometryPhysicalFunction.cpp new file mode 100644 index 0000000000..b5ea18d1a0 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TemporalECoversTNpointGeometryPhysicalFunction.cpp @@ -0,0 +1,118 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +TemporalECoversTNpointGeometryPhysicalFunction::TemporalECoversTNpointGeometryPhysicalFunction(PhysicalFunction ridFunction, + PhysicalFunction fractionFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction) +{ + parameterFunctions.reserve(4); + parameterFunctions.push_back(std::move(ridFunction)); + parameterFunctions.push_back(std::move(fractionFunction)); + parameterFunctions.push_back(std::move(timestampFunction)); + parameterFunctions.push_back(std::move(geometryFunction)); +} + +VarVal TemporalECoversTNpointGeometryPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto rid = parameterValues[0].cast>(); + auto fraction = parameterValues[1].cast>(); + auto timestamp = parameterValues[2].cast>(); + auto geometry = parameterValues[3].cast(); + + const auto result = nautilus::invoke( + +[](uint64_t ridValue, double fractionValue, uint64_t timestampValue, + const char* geometryPtr, uint32_t geometrySize) -> int { + try + { + MEOS::Meos::ensureMeosInitialized(); + + const std::string timestampString = MEOS::Meos::convertEpochToTimestamp(timestampValue); + std::string tnpointWkt = fmt::format("NPoint({}, {})@{}", ridValue, fractionValue, timestampString); + std::string staticGeometryWkt(geometryPtr, geometrySize); + + while (!staticGeometryWkt.empty() && (staticGeometryWkt.front() == '\'' || staticGeometryWkt.front() == '"')) + staticGeometryWkt.erase(staticGeometryWkt.begin()); + while (!staticGeometryWkt.empty() && (staticGeometryWkt.back() == '\'' || staticGeometryWkt.back() == '"')) + staticGeometryWkt.pop_back(); + + if (tnpointWkt.empty() || staticGeometryWkt.empty()) return 0; + + Temporal* tnpoint = tnpoint_in(tnpointWkt.c_str()); + if (!tnpoint) return 0; + Temporal* tgeo = tnpoint_to_tgeompoint(tnpoint); + if (!tgeo) { free(tnpoint); return 0; } + MEOS::Meos::StaticGeometry staticGeometry(staticGeometryWkt); + if (!staticGeometry.getGeometry()) { free(tgeo); free(tnpoint); return 0; } + + int r = ecovers_tgeo_geo(tgeo, staticGeometry.getGeometry()); + free(tgeo); + free(tnpoint); + return r; + } + catch (const std::exception&) + { + return 0; + } + }, + rid, fraction, timestamp, geometry.getContent(), geometry.getContentSize()); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTemporalECoversTNpointGeometryPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 4, + "TemporalECoversTNpointGeometryPhysicalFunction requires 4 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + return TemporalECoversTNpointGeometryPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TemporalECoversTNpointTNpointPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TemporalECoversTNpointTNpointPhysicalFunction.cpp new file mode 100644 index 0000000000..000b4cd7b5 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TemporalECoversTNpointTNpointPhysicalFunction.cpp @@ -0,0 +1,126 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +TemporalECoversTNpointTNpointPhysicalFunction::TemporalECoversTNpointTNpointPhysicalFunction(PhysicalFunction ridAFunction, + PhysicalFunction fractionAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction ridBFunction, + PhysicalFunction fractionBFunction, + PhysicalFunction tsBFunction) +{ + parameterFunctions.reserve(6); + parameterFunctions.push_back(std::move(ridAFunction)); + parameterFunctions.push_back(std::move(fractionAFunction)); + parameterFunctions.push_back(std::move(tsAFunction)); + parameterFunctions.push_back(std::move(ridBFunction)); + parameterFunctions.push_back(std::move(fractionBFunction)); + parameterFunctions.push_back(std::move(tsBFunction)); +} + +VarVal TemporalECoversTNpointTNpointPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto ridA = parameterValues[0].cast>(); + auto fractionA = parameterValues[1].cast>(); + auto tsA = parameterValues[2].cast>(); + auto ridB = parameterValues[3].cast>(); + auto fractionB = parameterValues[4].cast>(); + auto tsB = parameterValues[5].cast>(); + + const auto result = nautilus::invoke( + +[](uint64_t ridAValue, double fractionAValue, uint64_t tsAValue, + uint64_t ridBValue, double fractionBValue, uint64_t tsBValue) -> int { + try + { + MEOS::Meos::ensureMeosInitialized(); + + const std::string tsAString = MEOS::Meos::convertEpochToTimestamp(tsAValue); + const std::string tsBString = MEOS::Meos::convertEpochToTimestamp(tsBValue); + std::string tnpointAWkt = fmt::format("NPoint({}, {})@{}", ridAValue, fractionAValue, tsAString); + std::string tnpointBWkt = fmt::format("NPoint({}, {})@{}", ridBValue, fractionBValue, tsBString); + + if (tnpointAWkt.empty() || tnpointBWkt.empty()) return 0; + + Temporal* tnpointA = tnpoint_in(tnpointAWkt.c_str()); + if (!tnpointA) return 0; + Temporal* tgeoA = tnpoint_to_tgeompoint(tnpointA); + if (!tgeoA) { free(tnpointA); return 0; } + Temporal* tnpointB = tnpoint_in(tnpointBWkt.c_str()); + if (!tnpointB) { free(tgeoA); free(tnpointA); return 0; } + Temporal* tgeoB = tnpoint_to_tgeompoint(tnpointB); + if (!tgeoB) { free(tnpointB); free(tgeoA); free(tnpointA); return 0; } + + int r = ecovers_tgeo_tgeo(tgeoA, tgeoB); + free(tgeoB); + free(tnpointB); + free(tgeoA); + free(tnpointA); + return r; + } + catch (const std::exception&) + { + return 0; + } + }, + ridA, fractionA, tsA, ridB, fractionB, tsB); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTemporalECoversTNpointTNpointPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 6, + "TemporalECoversTNpointTNpointPhysicalFunction requires 6 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + auto arg5 = std::move(arguments.childFunctions[5]); + return TemporalECoversTNpointTNpointPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TemporalECoversTPoseGeometryPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TemporalECoversTPoseGeometryPhysicalFunction.cpp new file mode 100644 index 0000000000..6cf9f98956 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TemporalECoversTPoseGeometryPhysicalFunction.cpp @@ -0,0 +1,124 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +TemporalECoversTPoseGeometryPhysicalFunction::TemporalECoversTPoseGeometryPhysicalFunction(PhysicalFunction xFunction, + PhysicalFunction yFunction, + PhysicalFunction thetaFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction) +{ + parameterFunctions.reserve(5); + parameterFunctions.push_back(std::move(xFunction)); + parameterFunctions.push_back(std::move(yFunction)); + parameterFunctions.push_back(std::move(thetaFunction)); + parameterFunctions.push_back(std::move(timestampFunction)); + parameterFunctions.push_back(std::move(geometryFunction)); +} + +VarVal TemporalECoversTPoseGeometryPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto x = parameterValues[0].cast>(); + auto y = parameterValues[1].cast>(); + auto theta = parameterValues[2].cast>(); + auto timestamp = parameterValues[3].cast>(); + auto geometry = parameterValues[4].cast(); + + const auto result = nautilus::invoke( + +[](double xValue, double yValue, double thetaValue, uint64_t timestampValue, + const char* geometryPtr, uint32_t geometrySize) -> int { + try + { + MEOS::Meos::ensureMeosInitialized(); + if (!(xValue >= -180.0 && xValue <= 180.0 && yValue >= -90.0 && yValue <= 90.0)) return 0; + + const std::string timestampString = MEOS::Meos::convertEpochToTimestamp(timestampValue); + std::string tposeWkt = fmt::format("Pose(Point({} {}), {})@{}", + xValue, yValue, thetaValue, timestampString); + std::string staticGeometryWkt(geometryPtr, geometrySize); + + while (!staticGeometryWkt.empty() && (staticGeometryWkt.front() == '\'' || staticGeometryWkt.front() == '"')) + staticGeometryWkt.erase(staticGeometryWkt.begin()); + while (!staticGeometryWkt.empty() && (staticGeometryWkt.back() == '\'' || staticGeometryWkt.back() == '"')) + staticGeometryWkt.pop_back(); + + if (tposeWkt.empty() || staticGeometryWkt.empty()) return 0; + + Temporal* tpose = tpose_in(tposeWkt.c_str()); + if (!tpose) return 0; + Temporal* tgeo = tpose_to_tpoint(tpose); + if (!tgeo) { free(tpose); return 0; } + MEOS::Meos::StaticGeometry staticGeometry(staticGeometryWkt); + if (!staticGeometry.getGeometry()) { free(tgeo); free(tpose); return 0; } + + int r = ecovers_tgeo_geo(tgeo, staticGeometry.getGeometry()); + free(tgeo); + free(tpose); + return r; + } + catch (const std::exception&) + { + return 0; + } + }, + x, y, theta, timestamp, geometry.getContent(), geometry.getContentSize()); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTemporalECoversTPoseGeometryPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 5, + "TemporalECoversTPoseGeometryPhysicalFunction requires 5 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + return TemporalECoversTPoseGeometryPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TemporalECoversTPoseTPosePhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TemporalECoversTPoseTPosePhysicalFunction.cpp new file mode 100644 index 0000000000..57e165f1e4 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TemporalECoversTPoseTPosePhysicalFunction.cpp @@ -0,0 +1,136 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +TemporalECoversTPoseTPosePhysicalFunction::TemporalECoversTPoseTPosePhysicalFunction(PhysicalFunction xAFunction, + PhysicalFunction yAFunction, + PhysicalFunction thetaAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction xBFunction, + PhysicalFunction yBFunction, + PhysicalFunction thetaBFunction, + PhysicalFunction tsBFunction) +{ + parameterFunctions.reserve(8); + parameterFunctions.push_back(std::move(xAFunction)); + parameterFunctions.push_back(std::move(yAFunction)); + parameterFunctions.push_back(std::move(thetaAFunction)); + parameterFunctions.push_back(std::move(tsAFunction)); + parameterFunctions.push_back(std::move(xBFunction)); + parameterFunctions.push_back(std::move(yBFunction)); + parameterFunctions.push_back(std::move(thetaBFunction)); + parameterFunctions.push_back(std::move(tsBFunction)); +} + +VarVal TemporalECoversTPoseTPosePhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto xA = parameterValues[0].cast>(); + auto yA = parameterValues[1].cast>(); + auto thetaA = parameterValues[2].cast>(); + auto tsA = parameterValues[3].cast>(); + auto xB = parameterValues[4].cast>(); + auto yB = parameterValues[5].cast>(); + auto thetaB = parameterValues[6].cast>(); + auto tsB = parameterValues[7].cast>(); + + const auto result = nautilus::invoke( + +[](double xAValue, double yAValue, double thetaAValue, uint64_t tsAValue, + double xBValue, double yBValue, double thetaBValue, uint64_t tsBValue) -> int { + try + { + MEOS::Meos::ensureMeosInitialized(); + if (!(xAValue >= -180.0 && xAValue <= 180.0 && yAValue >= -90.0 && yAValue <= 90.0)) return 0; + if (!(xBValue >= -180.0 && xBValue <= 180.0 && yBValue >= -90.0 && yBValue <= 90.0)) return 0; + + const std::string tsAString = MEOS::Meos::convertEpochToTimestamp(tsAValue); + const std::string tsBString = MEOS::Meos::convertEpochToTimestamp(tsBValue); + std::string tposeAWkt = fmt::format("Pose(Point({} {}), {})@{}", xAValue, yAValue, thetaAValue, tsAString); + std::string tposeBWkt = fmt::format("Pose(Point({} {}), {})@{}", xBValue, yBValue, thetaBValue, tsBString); + + if (tposeAWkt.empty() || tposeBWkt.empty()) return 0; + + Temporal* tposeA = tpose_in(tposeAWkt.c_str()); + if (!tposeA) return 0; + Temporal* tgeoA = tpose_to_tpoint(tposeA); + if (!tgeoA) { free(tposeA); return 0; } + Temporal* tposeB = tpose_in(tposeBWkt.c_str()); + if (!tposeB) { free(tgeoA); free(tposeA); return 0; } + Temporal* tgeoB = tpose_to_tpoint(tposeB); + if (!tgeoB) { free(tposeB); free(tgeoA); free(tposeA); return 0; } + + int r = ecovers_tgeo_tgeo(tgeoA, tgeoB); + free(tgeoB); + free(tposeB); + free(tgeoA); + free(tposeA); + return r; + } + catch (const std::exception&) + { + return 0; + } + }, + xA, yA, thetaA, tsA, xB, yB, thetaB, tsB); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTemporalECoversTPoseTPosePhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 8, + "TemporalECoversTPoseTPosePhysicalFunction requires 8 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + auto arg5 = std::move(arguments.childFunctions[5]); + auto arg6 = std::move(arguments.childFunctions[6]); + auto arg7 = std::move(arguments.childFunctions[7]); + return TemporalECoversTPoseTPosePhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6), std::move(arg7)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TemporalEDWithinTNpointGeometryPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TemporalEDWithinTNpointGeometryPhysicalFunction.cpp new file mode 100644 index 0000000000..e90a95349b --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TemporalEDWithinTNpointGeometryPhysicalFunction.cpp @@ -0,0 +1,122 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +TemporalEDWithinTNpointGeometryPhysicalFunction::TemporalEDWithinTNpointGeometryPhysicalFunction(PhysicalFunction ridFunction, + PhysicalFunction fractionFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction, + PhysicalFunction distFunction) +{ + parameterFunctions.reserve(5); + parameterFunctions.push_back(std::move(ridFunction)); + parameterFunctions.push_back(std::move(fractionFunction)); + parameterFunctions.push_back(std::move(timestampFunction)); + parameterFunctions.push_back(std::move(geometryFunction)); + parameterFunctions.push_back(std::move(distFunction)); +} + +VarVal TemporalEDWithinTNpointGeometryPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto rid = parameterValues[0].cast>(); + auto fraction = parameterValues[1].cast>(); + auto timestamp = parameterValues[2].cast>(); + auto geometry = parameterValues[3].cast(); + auto dist = parameterValues[4].cast>(); + + const auto result = nautilus::invoke( + +[](uint64_t ridValue, double fractionValue, uint64_t timestampValue, + const char* geometryPtr, uint32_t geometrySize, double distValue) -> int { + try + { + MEOS::Meos::ensureMeosInitialized(); + + const std::string timestampString = MEOS::Meos::convertEpochToTimestamp(timestampValue); + std::string tnpointWkt = fmt::format("NPoint({}, {})@{}", ridValue, fractionValue, timestampString); + std::string staticGeometryWkt(geometryPtr, geometrySize); + + while (!staticGeometryWkt.empty() && (staticGeometryWkt.front() == '\'' || staticGeometryWkt.front() == '"')) + staticGeometryWkt.erase(staticGeometryWkt.begin()); + while (!staticGeometryWkt.empty() && (staticGeometryWkt.back() == '\'' || staticGeometryWkt.back() == '"')) + staticGeometryWkt.pop_back(); + + if (tnpointWkt.empty() || staticGeometryWkt.empty()) return 0; + + Temporal* tnpoint = tnpoint_in(tnpointWkt.c_str()); + if (!tnpoint) return 0; + Temporal* tgeo = tnpoint_to_tgeompoint(tnpoint); + if (!tgeo) { free(tnpoint); return 0; } + MEOS::Meos::StaticGeometry staticGeometry(staticGeometryWkt); + if (!staticGeometry.getGeometry()) { free(tgeo); free(tnpoint); return 0; } + + int r = edwithin_tgeo_geo(tgeo, staticGeometry.getGeometry(), distValue); + free(tgeo); + free(tnpoint); + return r; + } + catch (const std::exception&) + { + return 0; + } + }, + rid, fraction, timestamp, geometry.getContent(), geometry.getContentSize(), dist); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTemporalEDWithinTNpointGeometryPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 5, + "TemporalEDWithinTNpointGeometryPhysicalFunction requires 5 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + return TemporalEDWithinTNpointGeometryPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TemporalEDWithinTNpointTNpointPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TemporalEDWithinTNpointTNpointPhysicalFunction.cpp new file mode 100644 index 0000000000..724348f800 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TemporalEDWithinTNpointTNpointPhysicalFunction.cpp @@ -0,0 +1,131 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +TemporalEDWithinTNpointTNpointPhysicalFunction::TemporalEDWithinTNpointTNpointPhysicalFunction(PhysicalFunction ridAFunction, + PhysicalFunction fractionAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction ridBFunction, + PhysicalFunction fractionBFunction, + PhysicalFunction tsBFunction, + PhysicalFunction distFunction) +{ + parameterFunctions.reserve(7); + parameterFunctions.push_back(std::move(ridAFunction)); + parameterFunctions.push_back(std::move(fractionAFunction)); + parameterFunctions.push_back(std::move(tsAFunction)); + parameterFunctions.push_back(std::move(ridBFunction)); + parameterFunctions.push_back(std::move(fractionBFunction)); + parameterFunctions.push_back(std::move(tsBFunction)); + parameterFunctions.push_back(std::move(distFunction)); +} + +VarVal TemporalEDWithinTNpointTNpointPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto ridA = parameterValues[0].cast>(); + auto fractionA = parameterValues[1].cast>(); + auto tsA = parameterValues[2].cast>(); + auto ridB = parameterValues[3].cast>(); + auto fractionB = parameterValues[4].cast>(); + auto tsB = parameterValues[5].cast>(); + auto dist = parameterValues[6].cast>(); + + const auto result = nautilus::invoke( + +[](uint64_t ridAValue, double fractionAValue, uint64_t tsAValue, + uint64_t ridBValue, double fractionBValue, uint64_t tsBValue, + double distValue) -> int { + try + { + MEOS::Meos::ensureMeosInitialized(); + + const std::string tsAString = MEOS::Meos::convertEpochToTimestamp(tsAValue); + const std::string tsBString = MEOS::Meos::convertEpochToTimestamp(tsBValue); + std::string tnpointAWkt = fmt::format("NPoint({}, {})@{}", ridAValue, fractionAValue, tsAString); + std::string tnpointBWkt = fmt::format("NPoint({}, {})@{}", ridBValue, fractionBValue, tsBString); + + if (tnpointAWkt.empty() || tnpointBWkt.empty()) return 0; + + Temporal* tnpointA = tnpoint_in(tnpointAWkt.c_str()); + if (!tnpointA) return 0; + Temporal* tgeoA = tnpoint_to_tgeompoint(tnpointA); + if (!tgeoA) { free(tnpointA); return 0; } + Temporal* tnpointB = tnpoint_in(tnpointBWkt.c_str()); + if (!tnpointB) { free(tgeoA); free(tnpointA); return 0; } + Temporal* tgeoB = tnpoint_to_tgeompoint(tnpointB); + if (!tgeoB) { free(tnpointB); free(tgeoA); free(tnpointA); return 0; } + + int r = edwithin_tgeo_tgeo(tgeoA, tgeoB, distValue); + free(tgeoB); + free(tnpointB); + free(tgeoA); + free(tnpointA); + return r; + } + catch (const std::exception&) + { + return 0; + } + }, + ridA, fractionA, tsA, ridB, fractionB, tsB, dist); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTemporalEDWithinTNpointTNpointPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 7, + "TemporalEDWithinTNpointTNpointPhysicalFunction requires 7 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + auto arg5 = std::move(arguments.childFunctions[5]); + auto arg6 = std::move(arguments.childFunctions[6]); + return TemporalEDWithinTNpointTNpointPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TemporalEDWithinTPoseGeometryPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TemporalEDWithinTPoseGeometryPhysicalFunction.cpp new file mode 100644 index 0000000000..b2fb976ef9 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TemporalEDWithinTPoseGeometryPhysicalFunction.cpp @@ -0,0 +1,128 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +TemporalEDWithinTPoseGeometryPhysicalFunction::TemporalEDWithinTPoseGeometryPhysicalFunction(PhysicalFunction xFunction, + PhysicalFunction yFunction, + PhysicalFunction thetaFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction, + PhysicalFunction distFunction) +{ + parameterFunctions.reserve(6); + parameterFunctions.push_back(std::move(xFunction)); + parameterFunctions.push_back(std::move(yFunction)); + parameterFunctions.push_back(std::move(thetaFunction)); + parameterFunctions.push_back(std::move(timestampFunction)); + parameterFunctions.push_back(std::move(geometryFunction)); + parameterFunctions.push_back(std::move(distFunction)); +} + +VarVal TemporalEDWithinTPoseGeometryPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto x = parameterValues[0].cast>(); + auto y = parameterValues[1].cast>(); + auto theta = parameterValues[2].cast>(); + auto timestamp = parameterValues[3].cast>(); + auto geometry = parameterValues[4].cast(); + auto dist = parameterValues[5].cast>(); + + const auto result = nautilus::invoke( + +[](double xValue, double yValue, double thetaValue, uint64_t timestampValue, + const char* geometryPtr, uint32_t geometrySize, double distValue) -> int { + try + { + MEOS::Meos::ensureMeosInitialized(); + if (!(xValue >= -180.0 && xValue <= 180.0 && yValue >= -90.0 && yValue <= 90.0)) return 0; + + const std::string timestampString = MEOS::Meos::convertEpochToTimestamp(timestampValue); + std::string tposeWkt = fmt::format("Pose(Point({} {}), {})@{}", + xValue, yValue, thetaValue, timestampString); + std::string staticGeometryWkt(geometryPtr, geometrySize); + + while (!staticGeometryWkt.empty() && (staticGeometryWkt.front() == '\'' || staticGeometryWkt.front() == '"')) + staticGeometryWkt.erase(staticGeometryWkt.begin()); + while (!staticGeometryWkt.empty() && (staticGeometryWkt.back() == '\'' || staticGeometryWkt.back() == '"')) + staticGeometryWkt.pop_back(); + + if (tposeWkt.empty() || staticGeometryWkt.empty()) return 0; + + Temporal* tpose = tpose_in(tposeWkt.c_str()); + if (!tpose) return 0; + Temporal* tgeo = tpose_to_tpoint(tpose); + if (!tgeo) { free(tpose); return 0; } + MEOS::Meos::StaticGeometry staticGeometry(staticGeometryWkt); + if (!staticGeometry.getGeometry()) { free(tgeo); free(tpose); return 0; } + + int r = edwithin_tgeo_geo(tgeo, staticGeometry.getGeometry(), distValue); + free(tgeo); + free(tpose); + return r; + } + catch (const std::exception&) + { + return 0; + } + }, + x, y, theta, timestamp, geometry.getContent(), geometry.getContentSize(), dist); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTemporalEDWithinTPoseGeometryPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 6, + "TemporalEDWithinTPoseGeometryPhysicalFunction requires 6 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + auto arg5 = std::move(arguments.childFunctions[5]); + return TemporalEDWithinTPoseGeometryPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TemporalEDWithinTPoseTPosePhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TemporalEDWithinTPoseTPosePhysicalFunction.cpp new file mode 100644 index 0000000000..36f2ef4921 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TemporalEDWithinTPoseTPosePhysicalFunction.cpp @@ -0,0 +1,141 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +TemporalEDWithinTPoseTPosePhysicalFunction::TemporalEDWithinTPoseTPosePhysicalFunction(PhysicalFunction xAFunction, + PhysicalFunction yAFunction, + PhysicalFunction thetaAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction xBFunction, + PhysicalFunction yBFunction, + PhysicalFunction thetaBFunction, + PhysicalFunction tsBFunction, + PhysicalFunction distFunction) +{ + parameterFunctions.reserve(9); + parameterFunctions.push_back(std::move(xAFunction)); + parameterFunctions.push_back(std::move(yAFunction)); + parameterFunctions.push_back(std::move(thetaAFunction)); + parameterFunctions.push_back(std::move(tsAFunction)); + parameterFunctions.push_back(std::move(xBFunction)); + parameterFunctions.push_back(std::move(yBFunction)); + parameterFunctions.push_back(std::move(thetaBFunction)); + parameterFunctions.push_back(std::move(tsBFunction)); + parameterFunctions.push_back(std::move(distFunction)); +} + +VarVal TemporalEDWithinTPoseTPosePhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto xA = parameterValues[0].cast>(); + auto yA = parameterValues[1].cast>(); + auto thetaA = parameterValues[2].cast>(); + auto tsA = parameterValues[3].cast>(); + auto xB = parameterValues[4].cast>(); + auto yB = parameterValues[5].cast>(); + auto thetaB = parameterValues[6].cast>(); + auto tsB = parameterValues[7].cast>(); + auto dist = parameterValues[8].cast>(); + + const auto result = nautilus::invoke( + +[](double xAValue, double yAValue, double thetaAValue, uint64_t tsAValue, + double xBValue, double yBValue, double thetaBValue, uint64_t tsBValue, + double distValue) -> int { + try + { + MEOS::Meos::ensureMeosInitialized(); + if (!(xAValue >= -180.0 && xAValue <= 180.0 && yAValue >= -90.0 && yAValue <= 90.0)) return 0; + if (!(xBValue >= -180.0 && xBValue <= 180.0 && yBValue >= -90.0 && yBValue <= 90.0)) return 0; + + const std::string tsAString = MEOS::Meos::convertEpochToTimestamp(tsAValue); + const std::string tsBString = MEOS::Meos::convertEpochToTimestamp(tsBValue); + std::string tposeAWkt = fmt::format("Pose(Point({} {}), {})@{}", xAValue, yAValue, thetaAValue, tsAString); + std::string tposeBWkt = fmt::format("Pose(Point({} {}), {})@{}", xBValue, yBValue, thetaBValue, tsBString); + + if (tposeAWkt.empty() || tposeBWkt.empty()) return 0; + + Temporal* tposeA = tpose_in(tposeAWkt.c_str()); + if (!tposeA) return 0; + Temporal* tgeoA = tpose_to_tpoint(tposeA); + if (!tgeoA) { free(tposeA); return 0; } + Temporal* tposeB = tpose_in(tposeBWkt.c_str()); + if (!tposeB) { free(tgeoA); free(tposeA); return 0; } + Temporal* tgeoB = tpose_to_tpoint(tposeB); + if (!tgeoB) { free(tposeB); free(tgeoA); free(tposeA); return 0; } + + int r = edwithin_tgeo_tgeo(tgeoA, tgeoB, distValue); + free(tgeoB); + free(tposeB); + free(tgeoA); + free(tposeA); + return r; + } + catch (const std::exception&) + { + return 0; + } + }, + xA, yA, thetaA, tsA, xB, yB, thetaB, tsB, dist); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTemporalEDWithinTPoseTPosePhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 9, + "TemporalEDWithinTPoseTPosePhysicalFunction requires 9 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + auto arg5 = std::move(arguments.childFunctions[5]); + auto arg6 = std::move(arguments.childFunctions[6]); + auto arg7 = std::move(arguments.childFunctions[7]); + auto arg8 = std::move(arguments.childFunctions[8]); + return TemporalEDWithinTPoseTPosePhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6), std::move(arg7), std::move(arg8)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TemporalEDisjointTNpointGeometryPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TemporalEDisjointTNpointGeometryPhysicalFunction.cpp new file mode 100644 index 0000000000..46f7468653 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TemporalEDisjointTNpointGeometryPhysicalFunction.cpp @@ -0,0 +1,118 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +TemporalEDisjointTNpointGeometryPhysicalFunction::TemporalEDisjointTNpointGeometryPhysicalFunction(PhysicalFunction ridFunction, + PhysicalFunction fractionFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction) +{ + parameterFunctions.reserve(4); + parameterFunctions.push_back(std::move(ridFunction)); + parameterFunctions.push_back(std::move(fractionFunction)); + parameterFunctions.push_back(std::move(timestampFunction)); + parameterFunctions.push_back(std::move(geometryFunction)); +} + +VarVal TemporalEDisjointTNpointGeometryPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto rid = parameterValues[0].cast>(); + auto fraction = parameterValues[1].cast>(); + auto timestamp = parameterValues[2].cast>(); + auto geometry = parameterValues[3].cast(); + + const auto result = nautilus::invoke( + +[](uint64_t ridValue, double fractionValue, uint64_t timestampValue, + const char* geometryPtr, uint32_t geometrySize) -> int { + try + { + MEOS::Meos::ensureMeosInitialized(); + + const std::string timestampString = MEOS::Meos::convertEpochToTimestamp(timestampValue); + std::string tnpointWkt = fmt::format("NPoint({}, {})@{}", ridValue, fractionValue, timestampString); + std::string staticGeometryWkt(geometryPtr, geometrySize); + + while (!staticGeometryWkt.empty() && (staticGeometryWkt.front() == '\'' || staticGeometryWkt.front() == '"')) + staticGeometryWkt.erase(staticGeometryWkt.begin()); + while (!staticGeometryWkt.empty() && (staticGeometryWkt.back() == '\'' || staticGeometryWkt.back() == '"')) + staticGeometryWkt.pop_back(); + + if (tnpointWkt.empty() || staticGeometryWkt.empty()) return 0; + + Temporal* tnpoint = tnpoint_in(tnpointWkt.c_str()); + if (!tnpoint) return 0; + Temporal* tgeo = tnpoint_to_tgeompoint(tnpoint); + if (!tgeo) { free(tnpoint); return 0; } + MEOS::Meos::StaticGeometry staticGeometry(staticGeometryWkt); + if (!staticGeometry.getGeometry()) { free(tgeo); free(tnpoint); return 0; } + + int r = edisjoint_tgeo_geo(tgeo, staticGeometry.getGeometry()); + free(tgeo); + free(tnpoint); + return r; + } + catch (const std::exception&) + { + return 0; + } + }, + rid, fraction, timestamp, geometry.getContent(), geometry.getContentSize()); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTemporalEDisjointTNpointGeometryPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 4, + "TemporalEDisjointTNpointGeometryPhysicalFunction requires 4 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + return TemporalEDisjointTNpointGeometryPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TemporalEDisjointTNpointTNpointPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TemporalEDisjointTNpointTNpointPhysicalFunction.cpp new file mode 100644 index 0000000000..382139b115 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TemporalEDisjointTNpointTNpointPhysicalFunction.cpp @@ -0,0 +1,126 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +TemporalEDisjointTNpointTNpointPhysicalFunction::TemporalEDisjointTNpointTNpointPhysicalFunction(PhysicalFunction ridAFunction, + PhysicalFunction fractionAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction ridBFunction, + PhysicalFunction fractionBFunction, + PhysicalFunction tsBFunction) +{ + parameterFunctions.reserve(6); + parameterFunctions.push_back(std::move(ridAFunction)); + parameterFunctions.push_back(std::move(fractionAFunction)); + parameterFunctions.push_back(std::move(tsAFunction)); + parameterFunctions.push_back(std::move(ridBFunction)); + parameterFunctions.push_back(std::move(fractionBFunction)); + parameterFunctions.push_back(std::move(tsBFunction)); +} + +VarVal TemporalEDisjointTNpointTNpointPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto ridA = parameterValues[0].cast>(); + auto fractionA = parameterValues[1].cast>(); + auto tsA = parameterValues[2].cast>(); + auto ridB = parameterValues[3].cast>(); + auto fractionB = parameterValues[4].cast>(); + auto tsB = parameterValues[5].cast>(); + + const auto result = nautilus::invoke( + +[](uint64_t ridAValue, double fractionAValue, uint64_t tsAValue, + uint64_t ridBValue, double fractionBValue, uint64_t tsBValue) -> int { + try + { + MEOS::Meos::ensureMeosInitialized(); + + const std::string tsAString = MEOS::Meos::convertEpochToTimestamp(tsAValue); + const std::string tsBString = MEOS::Meos::convertEpochToTimestamp(tsBValue); + std::string tnpointAWkt = fmt::format("NPoint({}, {})@{}", ridAValue, fractionAValue, tsAString); + std::string tnpointBWkt = fmt::format("NPoint({}, {})@{}", ridBValue, fractionBValue, tsBString); + + if (tnpointAWkt.empty() || tnpointBWkt.empty()) return 0; + + Temporal* tnpointA = tnpoint_in(tnpointAWkt.c_str()); + if (!tnpointA) return 0; + Temporal* tgeoA = tnpoint_to_tgeompoint(tnpointA); + if (!tgeoA) { free(tnpointA); return 0; } + Temporal* tnpointB = tnpoint_in(tnpointBWkt.c_str()); + if (!tnpointB) { free(tgeoA); free(tnpointA); return 0; } + Temporal* tgeoB = tnpoint_to_tgeompoint(tnpointB); + if (!tgeoB) { free(tnpointB); free(tgeoA); free(tnpointA); return 0; } + + int r = edisjoint_tgeo_tgeo(tgeoA, tgeoB); + free(tgeoB); + free(tnpointB); + free(tgeoA); + free(tnpointA); + return r; + } + catch (const std::exception&) + { + return 0; + } + }, + ridA, fractionA, tsA, ridB, fractionB, tsB); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTemporalEDisjointTNpointTNpointPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 6, + "TemporalEDisjointTNpointTNpointPhysicalFunction requires 6 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + auto arg5 = std::move(arguments.childFunctions[5]); + return TemporalEDisjointTNpointTNpointPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TemporalEDisjointTPoseGeometryPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TemporalEDisjointTPoseGeometryPhysicalFunction.cpp new file mode 100644 index 0000000000..ecc47f1b43 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TemporalEDisjointTPoseGeometryPhysicalFunction.cpp @@ -0,0 +1,124 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +TemporalEDisjointTPoseGeometryPhysicalFunction::TemporalEDisjointTPoseGeometryPhysicalFunction(PhysicalFunction xFunction, + PhysicalFunction yFunction, + PhysicalFunction thetaFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction) +{ + parameterFunctions.reserve(5); + parameterFunctions.push_back(std::move(xFunction)); + parameterFunctions.push_back(std::move(yFunction)); + parameterFunctions.push_back(std::move(thetaFunction)); + parameterFunctions.push_back(std::move(timestampFunction)); + parameterFunctions.push_back(std::move(geometryFunction)); +} + +VarVal TemporalEDisjointTPoseGeometryPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto x = parameterValues[0].cast>(); + auto y = parameterValues[1].cast>(); + auto theta = parameterValues[2].cast>(); + auto timestamp = parameterValues[3].cast>(); + auto geometry = parameterValues[4].cast(); + + const auto result = nautilus::invoke( + +[](double xValue, double yValue, double thetaValue, uint64_t timestampValue, + const char* geometryPtr, uint32_t geometrySize) -> int { + try + { + MEOS::Meos::ensureMeosInitialized(); + if (!(xValue >= -180.0 && xValue <= 180.0 && yValue >= -90.0 && yValue <= 90.0)) return 0; + + const std::string timestampString = MEOS::Meos::convertEpochToTimestamp(timestampValue); + std::string tposeWkt = fmt::format("Pose(Point({} {}), {})@{}", + xValue, yValue, thetaValue, timestampString); + std::string staticGeometryWkt(geometryPtr, geometrySize); + + while (!staticGeometryWkt.empty() && (staticGeometryWkt.front() == '\'' || staticGeometryWkt.front() == '"')) + staticGeometryWkt.erase(staticGeometryWkt.begin()); + while (!staticGeometryWkt.empty() && (staticGeometryWkt.back() == '\'' || staticGeometryWkt.back() == '"')) + staticGeometryWkt.pop_back(); + + if (tposeWkt.empty() || staticGeometryWkt.empty()) return 0; + + Temporal* tpose = tpose_in(tposeWkt.c_str()); + if (!tpose) return 0; + Temporal* tgeo = tpose_to_tpoint(tpose); + if (!tgeo) { free(tpose); return 0; } + MEOS::Meos::StaticGeometry staticGeometry(staticGeometryWkt); + if (!staticGeometry.getGeometry()) { free(tgeo); free(tpose); return 0; } + + int r = edisjoint_tgeo_geo(tgeo, staticGeometry.getGeometry()); + free(tgeo); + free(tpose); + return r; + } + catch (const std::exception&) + { + return 0; + } + }, + x, y, theta, timestamp, geometry.getContent(), geometry.getContentSize()); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTemporalEDisjointTPoseGeometryPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 5, + "TemporalEDisjointTPoseGeometryPhysicalFunction requires 5 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + return TemporalEDisjointTPoseGeometryPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TemporalEDisjointTPoseTPosePhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TemporalEDisjointTPoseTPosePhysicalFunction.cpp new file mode 100644 index 0000000000..b80c5ba86b --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TemporalEDisjointTPoseTPosePhysicalFunction.cpp @@ -0,0 +1,136 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +TemporalEDisjointTPoseTPosePhysicalFunction::TemporalEDisjointTPoseTPosePhysicalFunction(PhysicalFunction xAFunction, + PhysicalFunction yAFunction, + PhysicalFunction thetaAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction xBFunction, + PhysicalFunction yBFunction, + PhysicalFunction thetaBFunction, + PhysicalFunction tsBFunction) +{ + parameterFunctions.reserve(8); + parameterFunctions.push_back(std::move(xAFunction)); + parameterFunctions.push_back(std::move(yAFunction)); + parameterFunctions.push_back(std::move(thetaAFunction)); + parameterFunctions.push_back(std::move(tsAFunction)); + parameterFunctions.push_back(std::move(xBFunction)); + parameterFunctions.push_back(std::move(yBFunction)); + parameterFunctions.push_back(std::move(thetaBFunction)); + parameterFunctions.push_back(std::move(tsBFunction)); +} + +VarVal TemporalEDisjointTPoseTPosePhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto xA = parameterValues[0].cast>(); + auto yA = parameterValues[1].cast>(); + auto thetaA = parameterValues[2].cast>(); + auto tsA = parameterValues[3].cast>(); + auto xB = parameterValues[4].cast>(); + auto yB = parameterValues[5].cast>(); + auto thetaB = parameterValues[6].cast>(); + auto tsB = parameterValues[7].cast>(); + + const auto result = nautilus::invoke( + +[](double xAValue, double yAValue, double thetaAValue, uint64_t tsAValue, + double xBValue, double yBValue, double thetaBValue, uint64_t tsBValue) -> int { + try + { + MEOS::Meos::ensureMeosInitialized(); + if (!(xAValue >= -180.0 && xAValue <= 180.0 && yAValue >= -90.0 && yAValue <= 90.0)) return 0; + if (!(xBValue >= -180.0 && xBValue <= 180.0 && yBValue >= -90.0 && yBValue <= 90.0)) return 0; + + const std::string tsAString = MEOS::Meos::convertEpochToTimestamp(tsAValue); + const std::string tsBString = MEOS::Meos::convertEpochToTimestamp(tsBValue); + std::string tposeAWkt = fmt::format("Pose(Point({} {}), {})@{}", xAValue, yAValue, thetaAValue, tsAString); + std::string tposeBWkt = fmt::format("Pose(Point({} {}), {})@{}", xBValue, yBValue, thetaBValue, tsBString); + + if (tposeAWkt.empty() || tposeBWkt.empty()) return 0; + + Temporal* tposeA = tpose_in(tposeAWkt.c_str()); + if (!tposeA) return 0; + Temporal* tgeoA = tpose_to_tpoint(tposeA); + if (!tgeoA) { free(tposeA); return 0; } + Temporal* tposeB = tpose_in(tposeBWkt.c_str()); + if (!tposeB) { free(tgeoA); free(tposeA); return 0; } + Temporal* tgeoB = tpose_to_tpoint(tposeB); + if (!tgeoB) { free(tposeB); free(tgeoA); free(tposeA); return 0; } + + int r = edisjoint_tgeo_tgeo(tgeoA, tgeoB); + free(tgeoB); + free(tposeB); + free(tgeoA); + free(tposeA); + return r; + } + catch (const std::exception&) + { + return 0; + } + }, + xA, yA, thetaA, tsA, xB, yB, thetaB, tsB); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTemporalEDisjointTPoseTPosePhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 8, + "TemporalEDisjointTPoseTPosePhysicalFunction requires 8 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + auto arg5 = std::move(arguments.childFunctions[5]); + auto arg6 = std::move(arguments.childFunctions[6]); + auto arg7 = std::move(arguments.childFunctions[7]); + return TemporalEDisjointTPoseTPosePhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6), std::move(arg7)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TemporalEIntersectsTNpointGeometryPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TemporalEIntersectsTNpointGeometryPhysicalFunction.cpp new file mode 100644 index 0000000000..f725c4834c --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TemporalEIntersectsTNpointGeometryPhysicalFunction.cpp @@ -0,0 +1,118 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +TemporalEIntersectsTNpointGeometryPhysicalFunction::TemporalEIntersectsTNpointGeometryPhysicalFunction(PhysicalFunction ridFunction, + PhysicalFunction fractionFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction) +{ + parameterFunctions.reserve(4); + parameterFunctions.push_back(std::move(ridFunction)); + parameterFunctions.push_back(std::move(fractionFunction)); + parameterFunctions.push_back(std::move(timestampFunction)); + parameterFunctions.push_back(std::move(geometryFunction)); +} + +VarVal TemporalEIntersectsTNpointGeometryPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto rid = parameterValues[0].cast>(); + auto fraction = parameterValues[1].cast>(); + auto timestamp = parameterValues[2].cast>(); + auto geometry = parameterValues[3].cast(); + + const auto result = nautilus::invoke( + +[](uint64_t ridValue, double fractionValue, uint64_t timestampValue, + const char* geometryPtr, uint32_t geometrySize) -> int { + try + { + MEOS::Meos::ensureMeosInitialized(); + + const std::string timestampString = MEOS::Meos::convertEpochToTimestamp(timestampValue); + std::string tnpointWkt = fmt::format("NPoint({}, {})@{}", ridValue, fractionValue, timestampString); + std::string staticGeometryWkt(geometryPtr, geometrySize); + + while (!staticGeometryWkt.empty() && (staticGeometryWkt.front() == '\'' || staticGeometryWkt.front() == '"')) + staticGeometryWkt.erase(staticGeometryWkt.begin()); + while (!staticGeometryWkt.empty() && (staticGeometryWkt.back() == '\'' || staticGeometryWkt.back() == '"')) + staticGeometryWkt.pop_back(); + + if (tnpointWkt.empty() || staticGeometryWkt.empty()) return 0; + + Temporal* tnpoint = tnpoint_in(tnpointWkt.c_str()); + if (!tnpoint) return 0; + Temporal* tgeo = tnpoint_to_tgeompoint(tnpoint); + if (!tgeo) { free(tnpoint); return 0; } + MEOS::Meos::StaticGeometry staticGeometry(staticGeometryWkt); + if (!staticGeometry.getGeometry()) { free(tgeo); free(tnpoint); return 0; } + + int r = eintersects_tgeo_geo(tgeo, staticGeometry.getGeometry()); + free(tgeo); + free(tnpoint); + return r; + } + catch (const std::exception&) + { + return 0; + } + }, + rid, fraction, timestamp, geometry.getContent(), geometry.getContentSize()); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTemporalEIntersectsTNpointGeometryPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 4, + "TemporalEIntersectsTNpointGeometryPhysicalFunction requires 4 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + return TemporalEIntersectsTNpointGeometryPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TemporalEIntersectsTNpointTNpointPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TemporalEIntersectsTNpointTNpointPhysicalFunction.cpp new file mode 100644 index 0000000000..e958e3f6dd --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TemporalEIntersectsTNpointTNpointPhysicalFunction.cpp @@ -0,0 +1,126 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +TemporalEIntersectsTNpointTNpointPhysicalFunction::TemporalEIntersectsTNpointTNpointPhysicalFunction(PhysicalFunction ridAFunction, + PhysicalFunction fractionAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction ridBFunction, + PhysicalFunction fractionBFunction, + PhysicalFunction tsBFunction) +{ + parameterFunctions.reserve(6); + parameterFunctions.push_back(std::move(ridAFunction)); + parameterFunctions.push_back(std::move(fractionAFunction)); + parameterFunctions.push_back(std::move(tsAFunction)); + parameterFunctions.push_back(std::move(ridBFunction)); + parameterFunctions.push_back(std::move(fractionBFunction)); + parameterFunctions.push_back(std::move(tsBFunction)); +} + +VarVal TemporalEIntersectsTNpointTNpointPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto ridA = parameterValues[0].cast>(); + auto fractionA = parameterValues[1].cast>(); + auto tsA = parameterValues[2].cast>(); + auto ridB = parameterValues[3].cast>(); + auto fractionB = parameterValues[4].cast>(); + auto tsB = parameterValues[5].cast>(); + + const auto result = nautilus::invoke( + +[](uint64_t ridAValue, double fractionAValue, uint64_t tsAValue, + uint64_t ridBValue, double fractionBValue, uint64_t tsBValue) -> int { + try + { + MEOS::Meos::ensureMeosInitialized(); + + const std::string tsAString = MEOS::Meos::convertEpochToTimestamp(tsAValue); + const std::string tsBString = MEOS::Meos::convertEpochToTimestamp(tsBValue); + std::string tnpointAWkt = fmt::format("NPoint({}, {})@{}", ridAValue, fractionAValue, tsAString); + std::string tnpointBWkt = fmt::format("NPoint({}, {})@{}", ridBValue, fractionBValue, tsBString); + + if (tnpointAWkt.empty() || tnpointBWkt.empty()) return 0; + + Temporal* tnpointA = tnpoint_in(tnpointAWkt.c_str()); + if (!tnpointA) return 0; + Temporal* tgeoA = tnpoint_to_tgeompoint(tnpointA); + if (!tgeoA) { free(tnpointA); return 0; } + Temporal* tnpointB = tnpoint_in(tnpointBWkt.c_str()); + if (!tnpointB) { free(tgeoA); free(tnpointA); return 0; } + Temporal* tgeoB = tnpoint_to_tgeompoint(tnpointB); + if (!tgeoB) { free(tnpointB); free(tgeoA); free(tnpointA); return 0; } + + int r = eintersects_tgeo_tgeo(tgeoA, tgeoB); + free(tgeoB); + free(tnpointB); + free(tgeoA); + free(tnpointA); + return r; + } + catch (const std::exception&) + { + return 0; + } + }, + ridA, fractionA, tsA, ridB, fractionB, tsB); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTemporalEIntersectsTNpointTNpointPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 6, + "TemporalEIntersectsTNpointTNpointPhysicalFunction requires 6 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + auto arg5 = std::move(arguments.childFunctions[5]); + return TemporalEIntersectsTNpointTNpointPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TemporalEIntersectsTPoseGeometryPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TemporalEIntersectsTPoseGeometryPhysicalFunction.cpp new file mode 100644 index 0000000000..02a357ae40 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TemporalEIntersectsTPoseGeometryPhysicalFunction.cpp @@ -0,0 +1,124 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +TemporalEIntersectsTPoseGeometryPhysicalFunction::TemporalEIntersectsTPoseGeometryPhysicalFunction(PhysicalFunction xFunction, + PhysicalFunction yFunction, + PhysicalFunction thetaFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction) +{ + parameterFunctions.reserve(5); + parameterFunctions.push_back(std::move(xFunction)); + parameterFunctions.push_back(std::move(yFunction)); + parameterFunctions.push_back(std::move(thetaFunction)); + parameterFunctions.push_back(std::move(timestampFunction)); + parameterFunctions.push_back(std::move(geometryFunction)); +} + +VarVal TemporalEIntersectsTPoseGeometryPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto x = parameterValues[0].cast>(); + auto y = parameterValues[1].cast>(); + auto theta = parameterValues[2].cast>(); + auto timestamp = parameterValues[3].cast>(); + auto geometry = parameterValues[4].cast(); + + const auto result = nautilus::invoke( + +[](double xValue, double yValue, double thetaValue, uint64_t timestampValue, + const char* geometryPtr, uint32_t geometrySize) -> int { + try + { + MEOS::Meos::ensureMeosInitialized(); + if (!(xValue >= -180.0 && xValue <= 180.0 && yValue >= -90.0 && yValue <= 90.0)) return 0; + + const std::string timestampString = MEOS::Meos::convertEpochToTimestamp(timestampValue); + std::string tposeWkt = fmt::format("Pose(Point({} {}), {})@{}", + xValue, yValue, thetaValue, timestampString); + std::string staticGeometryWkt(geometryPtr, geometrySize); + + while (!staticGeometryWkt.empty() && (staticGeometryWkt.front() == '\'' || staticGeometryWkt.front() == '"')) + staticGeometryWkt.erase(staticGeometryWkt.begin()); + while (!staticGeometryWkt.empty() && (staticGeometryWkt.back() == '\'' || staticGeometryWkt.back() == '"')) + staticGeometryWkt.pop_back(); + + if (tposeWkt.empty() || staticGeometryWkt.empty()) return 0; + + Temporal* tpose = tpose_in(tposeWkt.c_str()); + if (!tpose) return 0; + Temporal* tgeo = tpose_to_tpoint(tpose); + if (!tgeo) { free(tpose); return 0; } + MEOS::Meos::StaticGeometry staticGeometry(staticGeometryWkt); + if (!staticGeometry.getGeometry()) { free(tgeo); free(tpose); return 0; } + + int r = eintersects_tgeo_geo(tgeo, staticGeometry.getGeometry()); + free(tgeo); + free(tpose); + return r; + } + catch (const std::exception&) + { + return 0; + } + }, + x, y, theta, timestamp, geometry.getContent(), geometry.getContentSize()); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTemporalEIntersectsTPoseGeometryPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 5, + "TemporalEIntersectsTPoseGeometryPhysicalFunction requires 5 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + return TemporalEIntersectsTPoseGeometryPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TemporalEIntersectsTPoseTPosePhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TemporalEIntersectsTPoseTPosePhysicalFunction.cpp new file mode 100644 index 0000000000..a0ae84b98f --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TemporalEIntersectsTPoseTPosePhysicalFunction.cpp @@ -0,0 +1,136 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +TemporalEIntersectsTPoseTPosePhysicalFunction::TemporalEIntersectsTPoseTPosePhysicalFunction(PhysicalFunction xAFunction, + PhysicalFunction yAFunction, + PhysicalFunction thetaAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction xBFunction, + PhysicalFunction yBFunction, + PhysicalFunction thetaBFunction, + PhysicalFunction tsBFunction) +{ + parameterFunctions.reserve(8); + parameterFunctions.push_back(std::move(xAFunction)); + parameterFunctions.push_back(std::move(yAFunction)); + parameterFunctions.push_back(std::move(thetaAFunction)); + parameterFunctions.push_back(std::move(tsAFunction)); + parameterFunctions.push_back(std::move(xBFunction)); + parameterFunctions.push_back(std::move(yBFunction)); + parameterFunctions.push_back(std::move(thetaBFunction)); + parameterFunctions.push_back(std::move(tsBFunction)); +} + +VarVal TemporalEIntersectsTPoseTPosePhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto xA = parameterValues[0].cast>(); + auto yA = parameterValues[1].cast>(); + auto thetaA = parameterValues[2].cast>(); + auto tsA = parameterValues[3].cast>(); + auto xB = parameterValues[4].cast>(); + auto yB = parameterValues[5].cast>(); + auto thetaB = parameterValues[6].cast>(); + auto tsB = parameterValues[7].cast>(); + + const auto result = nautilus::invoke( + +[](double xAValue, double yAValue, double thetaAValue, uint64_t tsAValue, + double xBValue, double yBValue, double thetaBValue, uint64_t tsBValue) -> int { + try + { + MEOS::Meos::ensureMeosInitialized(); + if (!(xAValue >= -180.0 && xAValue <= 180.0 && yAValue >= -90.0 && yAValue <= 90.0)) return 0; + if (!(xBValue >= -180.0 && xBValue <= 180.0 && yBValue >= -90.0 && yBValue <= 90.0)) return 0; + + const std::string tsAString = MEOS::Meos::convertEpochToTimestamp(tsAValue); + const std::string tsBString = MEOS::Meos::convertEpochToTimestamp(tsBValue); + std::string tposeAWkt = fmt::format("Pose(Point({} {}), {})@{}", xAValue, yAValue, thetaAValue, tsAString); + std::string tposeBWkt = fmt::format("Pose(Point({} {}), {})@{}", xBValue, yBValue, thetaBValue, tsBString); + + if (tposeAWkt.empty() || tposeBWkt.empty()) return 0; + + Temporal* tposeA = tpose_in(tposeAWkt.c_str()); + if (!tposeA) return 0; + Temporal* tgeoA = tpose_to_tpoint(tposeA); + if (!tgeoA) { free(tposeA); return 0; } + Temporal* tposeB = tpose_in(tposeBWkt.c_str()); + if (!tposeB) { free(tgeoA); free(tposeA); return 0; } + Temporal* tgeoB = tpose_to_tpoint(tposeB); + if (!tgeoB) { free(tposeB); free(tgeoA); free(tposeA); return 0; } + + int r = eintersects_tgeo_tgeo(tgeoA, tgeoB); + free(tgeoB); + free(tposeB); + free(tgeoA); + free(tposeA); + return r; + } + catch (const std::exception&) + { + return 0; + } + }, + xA, yA, thetaA, tsA, xB, yB, thetaB, tsB); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTemporalEIntersectsTPoseTPosePhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 8, + "TemporalEIntersectsTPoseTPosePhysicalFunction requires 8 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + auto arg5 = std::move(arguments.childFunctions[5]); + auto arg6 = std::move(arguments.childFunctions[6]); + auto arg7 = std::move(arguments.childFunctions[7]); + return TemporalEIntersectsTPoseTPosePhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6), std::move(arg7)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TemporalETouchesTNpointGeometryPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TemporalETouchesTNpointGeometryPhysicalFunction.cpp new file mode 100644 index 0000000000..1d5cac5d68 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TemporalETouchesTNpointGeometryPhysicalFunction.cpp @@ -0,0 +1,118 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +TemporalETouchesTNpointGeometryPhysicalFunction::TemporalETouchesTNpointGeometryPhysicalFunction(PhysicalFunction ridFunction, + PhysicalFunction fractionFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction) +{ + parameterFunctions.reserve(4); + parameterFunctions.push_back(std::move(ridFunction)); + parameterFunctions.push_back(std::move(fractionFunction)); + parameterFunctions.push_back(std::move(timestampFunction)); + parameterFunctions.push_back(std::move(geometryFunction)); +} + +VarVal TemporalETouchesTNpointGeometryPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto rid = parameterValues[0].cast>(); + auto fraction = parameterValues[1].cast>(); + auto timestamp = parameterValues[2].cast>(); + auto geometry = parameterValues[3].cast(); + + const auto result = nautilus::invoke( + +[](uint64_t ridValue, double fractionValue, uint64_t timestampValue, + const char* geometryPtr, uint32_t geometrySize) -> int { + try + { + MEOS::Meos::ensureMeosInitialized(); + + const std::string timestampString = MEOS::Meos::convertEpochToTimestamp(timestampValue); + std::string tnpointWkt = fmt::format("NPoint({}, {})@{}", ridValue, fractionValue, timestampString); + std::string staticGeometryWkt(geometryPtr, geometrySize); + + while (!staticGeometryWkt.empty() && (staticGeometryWkt.front() == '\'' || staticGeometryWkt.front() == '"')) + staticGeometryWkt.erase(staticGeometryWkt.begin()); + while (!staticGeometryWkt.empty() && (staticGeometryWkt.back() == '\'' || staticGeometryWkt.back() == '"')) + staticGeometryWkt.pop_back(); + + if (tnpointWkt.empty() || staticGeometryWkt.empty()) return 0; + + Temporal* tnpoint = tnpoint_in(tnpointWkt.c_str()); + if (!tnpoint) return 0; + Temporal* tgeo = tnpoint_to_tgeompoint(tnpoint); + if (!tgeo) { free(tnpoint); return 0; } + MEOS::Meos::StaticGeometry staticGeometry(staticGeometryWkt); + if (!staticGeometry.getGeometry()) { free(tgeo); free(tnpoint); return 0; } + + int r = etouches_tgeo_geo(tgeo, staticGeometry.getGeometry()); + free(tgeo); + free(tnpoint); + return r; + } + catch (const std::exception&) + { + return 0; + } + }, + rid, fraction, timestamp, geometry.getContent(), geometry.getContentSize()); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTemporalETouchesTNpointGeometryPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 4, + "TemporalETouchesTNpointGeometryPhysicalFunction requires 4 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + return TemporalETouchesTNpointGeometryPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TemporalETouchesTNpointTNpointPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TemporalETouchesTNpointTNpointPhysicalFunction.cpp new file mode 100644 index 0000000000..7c6c5ceb1f --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TemporalETouchesTNpointTNpointPhysicalFunction.cpp @@ -0,0 +1,126 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +TemporalETouchesTNpointTNpointPhysicalFunction::TemporalETouchesTNpointTNpointPhysicalFunction(PhysicalFunction ridAFunction, + PhysicalFunction fractionAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction ridBFunction, + PhysicalFunction fractionBFunction, + PhysicalFunction tsBFunction) +{ + parameterFunctions.reserve(6); + parameterFunctions.push_back(std::move(ridAFunction)); + parameterFunctions.push_back(std::move(fractionAFunction)); + parameterFunctions.push_back(std::move(tsAFunction)); + parameterFunctions.push_back(std::move(ridBFunction)); + parameterFunctions.push_back(std::move(fractionBFunction)); + parameterFunctions.push_back(std::move(tsBFunction)); +} + +VarVal TemporalETouchesTNpointTNpointPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto ridA = parameterValues[0].cast>(); + auto fractionA = parameterValues[1].cast>(); + auto tsA = parameterValues[2].cast>(); + auto ridB = parameterValues[3].cast>(); + auto fractionB = parameterValues[4].cast>(); + auto tsB = parameterValues[5].cast>(); + + const auto result = nautilus::invoke( + +[](uint64_t ridAValue, double fractionAValue, uint64_t tsAValue, + uint64_t ridBValue, double fractionBValue, uint64_t tsBValue) -> int { + try + { + MEOS::Meos::ensureMeosInitialized(); + + const std::string tsAString = MEOS::Meos::convertEpochToTimestamp(tsAValue); + const std::string tsBString = MEOS::Meos::convertEpochToTimestamp(tsBValue); + std::string tnpointAWkt = fmt::format("NPoint({}, {})@{}", ridAValue, fractionAValue, tsAString); + std::string tnpointBWkt = fmt::format("NPoint({}, {})@{}", ridBValue, fractionBValue, tsBString); + + if (tnpointAWkt.empty() || tnpointBWkt.empty()) return 0; + + Temporal* tnpointA = tnpoint_in(tnpointAWkt.c_str()); + if (!tnpointA) return 0; + Temporal* tgeoA = tnpoint_to_tgeompoint(tnpointA); + if (!tgeoA) { free(tnpointA); return 0; } + Temporal* tnpointB = tnpoint_in(tnpointBWkt.c_str()); + if (!tnpointB) { free(tgeoA); free(tnpointA); return 0; } + Temporal* tgeoB = tnpoint_to_tgeompoint(tnpointB); + if (!tgeoB) { free(tnpointB); free(tgeoA); free(tnpointA); return 0; } + + int r = etouches_tgeo_tgeo(tgeoA, tgeoB); + free(tgeoB); + free(tnpointB); + free(tgeoA); + free(tnpointA); + return r; + } + catch (const std::exception&) + { + return 0; + } + }, + ridA, fractionA, tsA, ridB, fractionB, tsB); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTemporalETouchesTNpointTNpointPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 6, + "TemporalETouchesTNpointTNpointPhysicalFunction requires 6 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + auto arg5 = std::move(arguments.childFunctions[5]); + return TemporalETouchesTNpointTNpointPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TemporalETouchesTPoseGeometryPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TemporalETouchesTPoseGeometryPhysicalFunction.cpp new file mode 100644 index 0000000000..762fb564bb --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TemporalETouchesTPoseGeometryPhysicalFunction.cpp @@ -0,0 +1,124 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +TemporalETouchesTPoseGeometryPhysicalFunction::TemporalETouchesTPoseGeometryPhysicalFunction(PhysicalFunction xFunction, + PhysicalFunction yFunction, + PhysicalFunction thetaFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction) +{ + parameterFunctions.reserve(5); + parameterFunctions.push_back(std::move(xFunction)); + parameterFunctions.push_back(std::move(yFunction)); + parameterFunctions.push_back(std::move(thetaFunction)); + parameterFunctions.push_back(std::move(timestampFunction)); + parameterFunctions.push_back(std::move(geometryFunction)); +} + +VarVal TemporalETouchesTPoseGeometryPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto x = parameterValues[0].cast>(); + auto y = parameterValues[1].cast>(); + auto theta = parameterValues[2].cast>(); + auto timestamp = parameterValues[3].cast>(); + auto geometry = parameterValues[4].cast(); + + const auto result = nautilus::invoke( + +[](double xValue, double yValue, double thetaValue, uint64_t timestampValue, + const char* geometryPtr, uint32_t geometrySize) -> int { + try + { + MEOS::Meos::ensureMeosInitialized(); + if (!(xValue >= -180.0 && xValue <= 180.0 && yValue >= -90.0 && yValue <= 90.0)) return 0; + + const std::string timestampString = MEOS::Meos::convertEpochToTimestamp(timestampValue); + std::string tposeWkt = fmt::format("Pose(Point({} {}), {})@{}", + xValue, yValue, thetaValue, timestampString); + std::string staticGeometryWkt(geometryPtr, geometrySize); + + while (!staticGeometryWkt.empty() && (staticGeometryWkt.front() == '\'' || staticGeometryWkt.front() == '"')) + staticGeometryWkt.erase(staticGeometryWkt.begin()); + while (!staticGeometryWkt.empty() && (staticGeometryWkt.back() == '\'' || staticGeometryWkt.back() == '"')) + staticGeometryWkt.pop_back(); + + if (tposeWkt.empty() || staticGeometryWkt.empty()) return 0; + + Temporal* tpose = tpose_in(tposeWkt.c_str()); + if (!tpose) return 0; + Temporal* tgeo = tpose_to_tpoint(tpose); + if (!tgeo) { free(tpose); return 0; } + MEOS::Meos::StaticGeometry staticGeometry(staticGeometryWkt); + if (!staticGeometry.getGeometry()) { free(tgeo); free(tpose); return 0; } + + int r = etouches_tgeo_geo(tgeo, staticGeometry.getGeometry()); + free(tgeo); + free(tpose); + return r; + } + catch (const std::exception&) + { + return 0; + } + }, + x, y, theta, timestamp, geometry.getContent(), geometry.getContentSize()); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTemporalETouchesTPoseGeometryPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 5, + "TemporalETouchesTPoseGeometryPhysicalFunction requires 5 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + return TemporalETouchesTPoseGeometryPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TemporalETouchesTPoseTPosePhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TemporalETouchesTPoseTPosePhysicalFunction.cpp new file mode 100644 index 0000000000..b3de0feea9 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TemporalETouchesTPoseTPosePhysicalFunction.cpp @@ -0,0 +1,136 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +TemporalETouchesTPoseTPosePhysicalFunction::TemporalETouchesTPoseTPosePhysicalFunction(PhysicalFunction xAFunction, + PhysicalFunction yAFunction, + PhysicalFunction thetaAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction xBFunction, + PhysicalFunction yBFunction, + PhysicalFunction thetaBFunction, + PhysicalFunction tsBFunction) +{ + parameterFunctions.reserve(8); + parameterFunctions.push_back(std::move(xAFunction)); + parameterFunctions.push_back(std::move(yAFunction)); + parameterFunctions.push_back(std::move(thetaAFunction)); + parameterFunctions.push_back(std::move(tsAFunction)); + parameterFunctions.push_back(std::move(xBFunction)); + parameterFunctions.push_back(std::move(yBFunction)); + parameterFunctions.push_back(std::move(thetaBFunction)); + parameterFunctions.push_back(std::move(tsBFunction)); +} + +VarVal TemporalETouchesTPoseTPosePhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto xA = parameterValues[0].cast>(); + auto yA = parameterValues[1].cast>(); + auto thetaA = parameterValues[2].cast>(); + auto tsA = parameterValues[3].cast>(); + auto xB = parameterValues[4].cast>(); + auto yB = parameterValues[5].cast>(); + auto thetaB = parameterValues[6].cast>(); + auto tsB = parameterValues[7].cast>(); + + const auto result = nautilus::invoke( + +[](double xAValue, double yAValue, double thetaAValue, uint64_t tsAValue, + double xBValue, double yBValue, double thetaBValue, uint64_t tsBValue) -> int { + try + { + MEOS::Meos::ensureMeosInitialized(); + if (!(xAValue >= -180.0 && xAValue <= 180.0 && yAValue >= -90.0 && yAValue <= 90.0)) return 0; + if (!(xBValue >= -180.0 && xBValue <= 180.0 && yBValue >= -90.0 && yBValue <= 90.0)) return 0; + + const std::string tsAString = MEOS::Meos::convertEpochToTimestamp(tsAValue); + const std::string tsBString = MEOS::Meos::convertEpochToTimestamp(tsBValue); + std::string tposeAWkt = fmt::format("Pose(Point({} {}), {})@{}", xAValue, yAValue, thetaAValue, tsAString); + std::string tposeBWkt = fmt::format("Pose(Point({} {}), {})@{}", xBValue, yBValue, thetaBValue, tsBString); + + if (tposeAWkt.empty() || tposeBWkt.empty()) return 0; + + Temporal* tposeA = tpose_in(tposeAWkt.c_str()); + if (!tposeA) return 0; + Temporal* tgeoA = tpose_to_tpoint(tposeA); + if (!tgeoA) { free(tposeA); return 0; } + Temporal* tposeB = tpose_in(tposeBWkt.c_str()); + if (!tposeB) { free(tgeoA); free(tposeA); return 0; } + Temporal* tgeoB = tpose_to_tpoint(tposeB); + if (!tgeoB) { free(tposeB); free(tgeoA); free(tposeA); return 0; } + + int r = etouches_tgeo_tgeo(tgeoA, tgeoB); + free(tgeoB); + free(tposeB); + free(tgeoA); + free(tposeA); + return r; + } + catch (const std::exception&) + { + return 0; + } + }, + xA, yA, thetaA, tsA, xB, yB, thetaB, tsB); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTemporalETouchesTPoseTPosePhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 8, + "TemporalETouchesTPoseTPosePhysicalFunction requires 8 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + auto arg5 = std::move(arguments.childFunctions[5]); + auto arg6 = std::move(arguments.childFunctions[6]); + auto arg7 = std::move(arguments.childFunctions[7]); + return TemporalETouchesTPoseTPosePhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6), std::move(arg7)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TemporalNADTNpointGeometryPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TemporalNADTNpointGeometryPhysicalFunction.cpp new file mode 100644 index 0000000000..0fcdb346b0 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TemporalNADTNpointGeometryPhysicalFunction.cpp @@ -0,0 +1,118 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +TemporalNADTNpointGeometryPhysicalFunction::TemporalNADTNpointGeometryPhysicalFunction(PhysicalFunction ridFunction, + PhysicalFunction fractionFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction) +{ + parameterFunctions.reserve(4); + parameterFunctions.push_back(std::move(ridFunction)); + parameterFunctions.push_back(std::move(fractionFunction)); + parameterFunctions.push_back(std::move(timestampFunction)); + parameterFunctions.push_back(std::move(geometryFunction)); +} + +VarVal TemporalNADTNpointGeometryPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto rid = parameterValues[0].cast>(); + auto fraction = parameterValues[1].cast>(); + auto timestamp = parameterValues[2].cast>(); + auto geometry = parameterValues[3].cast(); + + const auto result = nautilus::invoke( + +[](uint64_t ridValue, double fractionValue, uint64_t timestampValue, + const char* geometryPtr, uint32_t geometrySize) -> double { + try + { + MEOS::Meos::ensureMeosInitialized(); + + const std::string timestampString = MEOS::Meos::convertEpochToTimestamp(timestampValue); + std::string tnpointWkt = fmt::format("NPoint({}, {})@{}", ridValue, fractionValue, timestampString); + std::string staticGeometryWkt(geometryPtr, geometrySize); + + while (!staticGeometryWkt.empty() && (staticGeometryWkt.front() == '\'' || staticGeometryWkt.front() == '"')) + staticGeometryWkt.erase(staticGeometryWkt.begin()); + while (!staticGeometryWkt.empty() && (staticGeometryWkt.back() == '\'' || staticGeometryWkt.back() == '"')) + staticGeometryWkt.pop_back(); + + if (tnpointWkt.empty() || staticGeometryWkt.empty()) return 0; + + Temporal* tnpoint = tnpoint_in(tnpointWkt.c_str()); + if (!tnpoint) return 0; + Temporal* tgeo = tnpoint_to_tgeompoint(tnpoint); + if (!tgeo) { free(tnpoint); return 0; } + MEOS::Meos::StaticGeometry staticGeometry(staticGeometryWkt); + if (!staticGeometry.getGeometry()) { free(tgeo); free(tnpoint); return 0; } + + double r = nad_tgeo_geo(tgeo, staticGeometry.getGeometry()); + free(tgeo); + free(tnpoint); + return r; + } + catch (const std::exception&) + { + return 0; + } + }, + rid, fraction, timestamp, geometry.getContent(), geometry.getContentSize()); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTemporalNADTNpointGeometryPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 4, + "TemporalNADTNpointGeometryPhysicalFunction requires 4 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + return TemporalNADTNpointGeometryPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TemporalNADTNpointTNpointPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TemporalNADTNpointTNpointPhysicalFunction.cpp new file mode 100644 index 0000000000..7a983a6778 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TemporalNADTNpointTNpointPhysicalFunction.cpp @@ -0,0 +1,126 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +TemporalNADTNpointTNpointPhysicalFunction::TemporalNADTNpointTNpointPhysicalFunction(PhysicalFunction ridAFunction, + PhysicalFunction fractionAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction ridBFunction, + PhysicalFunction fractionBFunction, + PhysicalFunction tsBFunction) +{ + parameterFunctions.reserve(6); + parameterFunctions.push_back(std::move(ridAFunction)); + parameterFunctions.push_back(std::move(fractionAFunction)); + parameterFunctions.push_back(std::move(tsAFunction)); + parameterFunctions.push_back(std::move(ridBFunction)); + parameterFunctions.push_back(std::move(fractionBFunction)); + parameterFunctions.push_back(std::move(tsBFunction)); +} + +VarVal TemporalNADTNpointTNpointPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto ridA = parameterValues[0].cast>(); + auto fractionA = parameterValues[1].cast>(); + auto tsA = parameterValues[2].cast>(); + auto ridB = parameterValues[3].cast>(); + auto fractionB = parameterValues[4].cast>(); + auto tsB = parameterValues[5].cast>(); + + const auto result = nautilus::invoke( + +[](uint64_t ridAValue, double fractionAValue, uint64_t tsAValue, + uint64_t ridBValue, double fractionBValue, uint64_t tsBValue) -> double { + try + { + MEOS::Meos::ensureMeosInitialized(); + + const std::string tsAString = MEOS::Meos::convertEpochToTimestamp(tsAValue); + const std::string tsBString = MEOS::Meos::convertEpochToTimestamp(tsBValue); + std::string tnpointAWkt = fmt::format("NPoint({}, {})@{}", ridAValue, fractionAValue, tsAString); + std::string tnpointBWkt = fmt::format("NPoint({}, {})@{}", ridBValue, fractionBValue, tsBString); + + if (tnpointAWkt.empty() || tnpointBWkt.empty()) return 0; + + Temporal* tnpointA = tnpoint_in(tnpointAWkt.c_str()); + if (!tnpointA) return 0; + Temporal* tgeoA = tnpoint_to_tgeompoint(tnpointA); + if (!tgeoA) { free(tnpointA); return 0; } + Temporal* tnpointB = tnpoint_in(tnpointBWkt.c_str()); + if (!tnpointB) { free(tgeoA); free(tnpointA); return 0; } + Temporal* tgeoB = tnpoint_to_tgeompoint(tnpointB); + if (!tgeoB) { free(tnpointB); free(tgeoA); free(tnpointA); return 0; } + + double r = nad_tgeo_tgeo(tgeoA, tgeoB); + free(tgeoB); + free(tnpointB); + free(tgeoA); + free(tnpointA); + return r; + } + catch (const std::exception&) + { + return 0; + } + }, + ridA, fractionA, tsA, ridB, fractionB, tsB); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTemporalNADTNpointTNpointPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 6, + "TemporalNADTNpointTNpointPhysicalFunction requires 6 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + auto arg5 = std::move(arguments.childFunctions[5]); + return TemporalNADTNpointTNpointPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TemporalNADTPoseGeometryPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TemporalNADTPoseGeometryPhysicalFunction.cpp new file mode 100644 index 0000000000..2a01203e48 --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TemporalNADTPoseGeometryPhysicalFunction.cpp @@ -0,0 +1,124 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +TemporalNADTPoseGeometryPhysicalFunction::TemporalNADTPoseGeometryPhysicalFunction(PhysicalFunction xFunction, + PhysicalFunction yFunction, + PhysicalFunction thetaFunction, + PhysicalFunction timestampFunction, + PhysicalFunction geometryFunction) +{ + parameterFunctions.reserve(5); + parameterFunctions.push_back(std::move(xFunction)); + parameterFunctions.push_back(std::move(yFunction)); + parameterFunctions.push_back(std::move(thetaFunction)); + parameterFunctions.push_back(std::move(timestampFunction)); + parameterFunctions.push_back(std::move(geometryFunction)); +} + +VarVal TemporalNADTPoseGeometryPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto x = parameterValues[0].cast>(); + auto y = parameterValues[1].cast>(); + auto theta = parameterValues[2].cast>(); + auto timestamp = parameterValues[3].cast>(); + auto geometry = parameterValues[4].cast(); + + const auto result = nautilus::invoke( + +[](double xValue, double yValue, double thetaValue, uint64_t timestampValue, + const char* geometryPtr, uint32_t geometrySize) -> double { + try + { + MEOS::Meos::ensureMeosInitialized(); + if (!(xValue >= -180.0 && xValue <= 180.0 && yValue >= -90.0 && yValue <= 90.0)) return 0; + + const std::string timestampString = MEOS::Meos::convertEpochToTimestamp(timestampValue); + std::string tposeWkt = fmt::format("Pose(Point({} {}), {})@{}", + xValue, yValue, thetaValue, timestampString); + std::string staticGeometryWkt(geometryPtr, geometrySize); + + while (!staticGeometryWkt.empty() && (staticGeometryWkt.front() == '\'' || staticGeometryWkt.front() == '"')) + staticGeometryWkt.erase(staticGeometryWkt.begin()); + while (!staticGeometryWkt.empty() && (staticGeometryWkt.back() == '\'' || staticGeometryWkt.back() == '"')) + staticGeometryWkt.pop_back(); + + if (tposeWkt.empty() || staticGeometryWkt.empty()) return 0; + + Temporal* tpose = tpose_in(tposeWkt.c_str()); + if (!tpose) return 0; + Temporal* tgeo = tpose_to_tpoint(tpose); + if (!tgeo) { free(tpose); return 0; } + MEOS::Meos::StaticGeometry staticGeometry(staticGeometryWkt); + if (!staticGeometry.getGeometry()) { free(tgeo); free(tpose); return 0; } + + double r = nad_tgeo_geo(tgeo, staticGeometry.getGeometry()); + free(tgeo); + free(tpose); + return r; + } + catch (const std::exception&) + { + return 0; + } + }, + x, y, theta, timestamp, geometry.getContent(), geometry.getContentSize()); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTemporalNADTPoseGeometryPhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 5, + "TemporalNADTPoseGeometryPhysicalFunction requires 5 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + return TemporalNADTPoseGeometryPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TemporalNADTPoseTPosePhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TemporalNADTPoseTPosePhysicalFunction.cpp new file mode 100644 index 0000000000..8e657790aa --- /dev/null +++ b/nes-physical-operators/src/Functions/Meos/TemporalNADTPoseTPosePhysicalFunction.cpp @@ -0,0 +1,136 @@ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +} + +namespace NES { + +TemporalNADTPoseTPosePhysicalFunction::TemporalNADTPoseTPosePhysicalFunction(PhysicalFunction xAFunction, + PhysicalFunction yAFunction, + PhysicalFunction thetaAFunction, + PhysicalFunction tsAFunction, + PhysicalFunction xBFunction, + PhysicalFunction yBFunction, + PhysicalFunction thetaBFunction, + PhysicalFunction tsBFunction) +{ + parameterFunctions.reserve(8); + parameterFunctions.push_back(std::move(xAFunction)); + parameterFunctions.push_back(std::move(yAFunction)); + parameterFunctions.push_back(std::move(thetaAFunction)); + parameterFunctions.push_back(std::move(tsAFunction)); + parameterFunctions.push_back(std::move(xBFunction)); + parameterFunctions.push_back(std::move(yBFunction)); + parameterFunctions.push_back(std::move(thetaBFunction)); + parameterFunctions.push_back(std::move(tsBFunction)); +} + +VarVal TemporalNADTPoseTPosePhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto xA = parameterValues[0].cast>(); + auto yA = parameterValues[1].cast>(); + auto thetaA = parameterValues[2].cast>(); + auto tsA = parameterValues[3].cast>(); + auto xB = parameterValues[4].cast>(); + auto yB = parameterValues[5].cast>(); + auto thetaB = parameterValues[6].cast>(); + auto tsB = parameterValues[7].cast>(); + + const auto result = nautilus::invoke( + +[](double xAValue, double yAValue, double thetaAValue, uint64_t tsAValue, + double xBValue, double yBValue, double thetaBValue, uint64_t tsBValue) -> double { + try + { + MEOS::Meos::ensureMeosInitialized(); + if (!(xAValue >= -180.0 && xAValue <= 180.0 && yAValue >= -90.0 && yAValue <= 90.0)) return 0; + if (!(xBValue >= -180.0 && xBValue <= 180.0 && yBValue >= -90.0 && yBValue <= 90.0)) return 0; + + const std::string tsAString = MEOS::Meos::convertEpochToTimestamp(tsAValue); + const std::string tsBString = MEOS::Meos::convertEpochToTimestamp(tsBValue); + std::string tposeAWkt = fmt::format("Pose(Point({} {}), {})@{}", xAValue, yAValue, thetaAValue, tsAString); + std::string tposeBWkt = fmt::format("Pose(Point({} {}), {})@{}", xBValue, yBValue, thetaBValue, tsBString); + + if (tposeAWkt.empty() || tposeBWkt.empty()) return 0; + + Temporal* tposeA = tpose_in(tposeAWkt.c_str()); + if (!tposeA) return 0; + Temporal* tgeoA = tpose_to_tpoint(tposeA); + if (!tgeoA) { free(tposeA); return 0; } + Temporal* tposeB = tpose_in(tposeBWkt.c_str()); + if (!tposeB) { free(tgeoA); free(tposeA); return 0; } + Temporal* tgeoB = tpose_to_tpoint(tposeB); + if (!tgeoB) { free(tposeB); free(tgeoA); free(tposeA); return 0; } + + double r = nad_tgeo_tgeo(tgeoA, tgeoB); + free(tgeoB); + free(tposeB); + free(tgeoA); + free(tposeA); + return r; + } + catch (const std::exception&) + { + return 0; + } + }, + xA, yA, thetaA, tsA, xB, yB, thetaB, tsB); + + return VarVal(result); +} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTemporalNADTPoseTPosePhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{ + PRECONDITION(arguments.childFunctions.size() == 8, + "TemporalNADTPoseTPosePhysicalFunction requires 8 children but got {}", + arguments.childFunctions.size()); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + auto arg4 = std::move(arguments.childFunctions[4]); + auto arg5 = std::move(arguments.childFunctions[5]); + auto arg6 = std::move(arguments.childFunctions[6]); + auto arg7 = std::move(arguments.childFunctions[7]); + return TemporalNADTPoseTPosePhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6), std::move(arg7)); +} + +} // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TemporalRoundPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TemporalRoundPhysicalFunction.cpp index 8836fe5bdf..9c2163e95e 100644 --- a/nes-physical-operators/src/Functions/Meos/TemporalRoundPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/TemporalRoundPhysicalFunction.cpp @@ -36,13 +36,13 @@ extern "C" { namespace NES { TemporalRoundPhysicalFunction::TemporalRoundPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction tsFunction, - PhysicalFunction maxddFunction) + PhysicalFunction tsFunction, + PhysicalFunction arg0Function) { parameterFunctions.reserve(3); parameterFunctions.push_back(std::move(valueFunction)); parameterFunctions.push_back(std::move(tsFunction)); - parameterFunctions.push_back(std::move(maxddFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } VarVal TemporalRoundPhysicalFunction::execute(const Record& record, ArenaRef& arena) const @@ -50,28 +50,38 @@ VarVal TemporalRoundPhysicalFunction::execute(const Record& record, ArenaRef& ar std::vector parameterValues; parameterValues.reserve(parameterFunctions.size()); for (const auto& function : parameterFunctions) + { parameterValues.emplace_back(function.execute(record, arena)); + } auto value = parameterValues[0].cast>(); - auto ts = parameterValues[1].cast>(); - auto maxdd = parameterValues[2].cast>(); + auto ts = parameterValues[1].cast>(); + auto arg0 = parameterValues[2].cast>(); const auto result = nautilus::invoke( - +[](double value, uint64_t ts, double maxdd_d) -> double { - try { + +[](double value, + uint64_t ts, + double arg0) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); std::string tempWkt = fmt::format("{}@{}", value, MEOS::Meos::convertEpochToTimestamp(ts)); Temporal* temp = tfloat_in(tempWkt.c_str()); if (!temp) return 0.0; - Temporal* res = temporal_round(temp, static_cast(maxdd_d)); + + Temporal* res = temporal_round(temp, static_cast(arg0)); free(temp); if (!res) return 0.0; double r = tfloat_start_value(res); free(res); return r; - } catch (const std::exception&) { return 0.0; } + } + catch (const std::exception&) + { + return 0.0; + } }, - value, ts, maxdd); + value, ts, arg0); return VarVal(result); } diff --git a/nes-physical-operators/src/Functions/Meos/TeqBoolTboolPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TeqBoolTboolPhysicalFunction.cpp index 5b46a75014..5a930cea4e 100644 --- a/nes-physical-operators/src/Functions/Meos/TeqBoolTboolPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/TeqBoolTboolPhysicalFunction.cpp @@ -35,13 +35,13 @@ extern "C" { namespace NES { -TeqBoolTboolPhysicalFunction::TeqBoolTboolPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction thresholdFunction, - PhysicalFunction tsFunction) +TeqBoolTboolPhysicalFunction::TeqBoolTboolPhysicalFunction(PhysicalFunction arg0Function, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction) { parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(arg0Function)); parameterFunctions.push_back(std::move(valueFunction)); - parameterFunctions.push_back(std::move(thresholdFunction)); parameterFunctions.push_back(std::move(tsFunction)); } @@ -50,30 +50,38 @@ VarVal TeqBoolTboolPhysicalFunction::execute(const Record& record, ArenaRef& are std::vector parameterValues; parameterValues.reserve(parameterFunctions.size()); for (const auto& function : parameterFunctions) + { parameterValues.emplace_back(function.execute(record, arena)); + } - auto value = parameterValues[0].cast>(); - auto thresh = parameterValues[1].cast>(); - auto ts = parameterValues[2].cast>(); + auto arg0 = parameterValues[0].cast>(); + auto value = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); const auto result = nautilus::invoke( - +[](double v, double s, uint64_t t) -> double { - try { + +[](double arg0, + double value, + uint64_t ts) -> bool { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); - bool sv = (v != 0.0); - std::string wkt = fmt::format("{}", (s != 0.0 ? "t" : "f")) + "@" + ts_str; - Temporal* temp = tbool_in(wkt.c_str()); - if (!temp) return 0.0; - Temporal* res = teq_bool_tbool(sv, temp); + std::string tempWkt = fmt::format("{}@{}", value != 0.0 ? "t" : "f", MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tbool_in(tempWkt.c_str()); + if (!temp) return false; + + Temporal* res = teq_bool_tbool(static_cast(arg0 != 0.0), temp); free(temp); - if (!res) return 0.0; + if (!res) return false; bool r = tbool_start_value(res); free(res); - return static_cast(r ? 1.0 : 0.0); - } catch (const std::exception&) { return 0.0; } + return r; + } + catch (const std::exception&) + { + return false; + } }, - value, thresh, ts); + arg0, value, ts); return VarVal(result); } diff --git a/nes-physical-operators/src/Functions/Meos/TeqTboolBoolPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TeqTboolBoolPhysicalFunction.cpp index 71041e3dc8..68acca4fa7 100644 --- a/nes-physical-operators/src/Functions/Meos/TeqTboolBoolPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/TeqTboolBoolPhysicalFunction.cpp @@ -36,13 +36,13 @@ extern "C" { namespace NES { TeqTboolBoolPhysicalFunction::TeqTboolBoolPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction thresholdFunction, - PhysicalFunction tsFunction) + PhysicalFunction tsFunction, + PhysicalFunction arg0Function) { parameterFunctions.reserve(3); parameterFunctions.push_back(std::move(valueFunction)); - parameterFunctions.push_back(std::move(thresholdFunction)); parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } VarVal TeqTboolBoolPhysicalFunction::execute(const Record& record, ArenaRef& arena) const @@ -50,30 +50,38 @@ VarVal TeqTboolBoolPhysicalFunction::execute(const Record& record, ArenaRef& are std::vector parameterValues; parameterValues.reserve(parameterFunctions.size()); for (const auto& function : parameterFunctions) + { parameterValues.emplace_back(function.execute(record, arena)); + } auto value = parameterValues[0].cast>(); - auto thresh = parameterValues[1].cast>(); - auto ts = parameterValues[2].cast>(); + auto ts = parameterValues[1].cast>(); + auto arg0 = parameterValues[2].cast>(); const auto result = nautilus::invoke( - +[](double v, double s, uint64_t t) -> double { - try { + +[](double value, + uint64_t ts, + double arg0) -> bool { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); - std::string wkt = fmt::format("{}", (v != 0.0 ? "t" : "f")) + "@" + ts_str; - Temporal* temp = tbool_in(wkt.c_str()); - if (!temp) return 0.0; - bool sv = (s != 0.0); - Temporal* res = teq_tbool_bool(temp, sv); + std::string tempWkt = fmt::format("{}@{}", value != 0.0 ? "t" : "f", MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tbool_in(tempWkt.c_str()); + if (!temp) return false; + + Temporal* res = teq_tbool_bool(temp, static_cast(arg0 != 0.0)); free(temp); - if (!res) return 0.0; + if (!res) return false; bool r = tbool_start_value(res); free(res); - return static_cast(r ? 1.0 : 0.0); - } catch (const std::exception&) { return 0.0; } + return r; + } + catch (const std::exception&) + { + return false; + } }, - value, thresh, ts); + value, ts, arg0); return VarVal(result); } diff --git a/nes-physical-operators/src/Functions/Meos/TextInitcapPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TextInitcapPhysicalFunction.cpp index 92efe41695..8fdbcf15c3 100644 --- a/nes-physical-operators/src/Functions/Meos/TextInitcapPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/TextInitcapPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -21,49 +22,71 @@ #include #include #include +#include #include +#include +#include #include #include extern "C" { #include } -#include -#include namespace NES { -TextInitcapPhysicalFunction::TextInitcapPhysicalFunction(PhysicalFunction str) +TextInitcapPhysicalFunction::TextInitcapPhysicalFunction(PhysicalFunction strFunction) { - paramFns.reserve(1); - paramFns.push_back(std::move(str)); + parameterFunctions.reserve(1); + parameterFunctions.push_back(std::move(strFunction)); } -VarVal TextInitcapPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto str = paramFns[0].execute(record, arena).cast(); +VarVal TextInitcapPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto str = parameterValues[0].cast(); + constexpr uint32_t MAX_LEN = 4096; auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); + const auto actualLen = nautilus::invoke( - +[](const char* w, uint32_t wsz, char* buf, uint32_t bufMax) -> uint32_t { - try { + +[](const char* strPtr, uint32_t strSize, + char* buf, + uint32_t bufMax) -> uint32_t { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string s(w, wsz); - text* t = cstring_to_text(s.c_str()); - if (!t) return 0u; - text* res = text_initcap(t); - free(t); - if (!res) return 0u; - char* out = text_to_cstring(res); - free(res); + std::string tempRawStr(strPtr, strSize); + while (!tempRawStr.empty() && (tempRawStr.front() == '\'' || tempRawStr.front() == '"')) tempRawStr.erase(tempRawStr.begin()); + while (!tempRawStr.empty() && (tempRawStr.back() == '\'' || tempRawStr.back() == '"')) tempRawStr.pop_back(); + text* temp = cstring_to_text(tempRawStr.c_str()); + if (!temp) return 0u; + + text* tres = text_initcap(temp); + free(temp); + if (!tres) return 0u; + char* out = text_to_cstring(tres); + free(tres); if (!out) return 0u; uint32_t len = static_cast(strlen(out)); if (len > bufMax) len = bufMax; memcpy(buf, out, len); free(out); return len; - } catch (const std::exception&) { return 0u; } + } + catch (const std::exception&) + { + return 0u; + } }, - str, outBuf.getContent(), nautilus::val(MAX_LEN)); + str.getContent(), str.getContentSize(), outBuf.getContent(), nautilus::val(MAX_LEN)); + VarVal(actualLen).writeToMemory(outBuf.getReference()); return outBuf; } @@ -71,10 +94,11 @@ VarVal TextInitcapPhysicalFunction::execute(const Record& record, ArenaRef& aren PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTextInitcapPhysicalFunction( PhysicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.childFunctions.size()==1, - "TextInitcapPhysicalFunction requires 1 child but got {}", + PRECONDITION(arguments.childFunctions.size() == 1, + "TextInitcapPhysicalFunction requires 1 children but got {}", arguments.childFunctions.size()); - return TextInitcapPhysicalFunction(std::move(arguments.childFunctions[0])); + auto arg0 = std::move(arguments.childFunctions[0]); + return TextInitcapPhysicalFunction(std::move(arg0)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TextLowerPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TextLowerPhysicalFunction.cpp index d59a527b8a..4d34513adc 100644 --- a/nes-physical-operators/src/Functions/Meos/TextLowerPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/TextLowerPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -21,49 +22,71 @@ #include #include #include +#include #include +#include +#include #include #include extern "C" { #include } -#include -#include namespace NES { -TextLowerPhysicalFunction::TextLowerPhysicalFunction(PhysicalFunction str) +TextLowerPhysicalFunction::TextLowerPhysicalFunction(PhysicalFunction strFunction) { - paramFns.reserve(1); - paramFns.push_back(std::move(str)); + parameterFunctions.reserve(1); + parameterFunctions.push_back(std::move(strFunction)); } -VarVal TextLowerPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto str = paramFns[0].execute(record, arena).cast(); +VarVal TextLowerPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto str = parameterValues[0].cast(); + constexpr uint32_t MAX_LEN = 4096; auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); + const auto actualLen = nautilus::invoke( - +[](const char* w, uint32_t wsz, char* buf, uint32_t bufMax) -> uint32_t { - try { + +[](const char* strPtr, uint32_t strSize, + char* buf, + uint32_t bufMax) -> uint32_t { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string s(w, wsz); - text* t = cstring_to_text(s.c_str()); - if (!t) return 0u; - text* res = text_lower(t); - free(t); - if (!res) return 0u; - char* out = text_to_cstring(res); - free(res); + std::string tempRawStr(strPtr, strSize); + while (!tempRawStr.empty() && (tempRawStr.front() == '\'' || tempRawStr.front() == '"')) tempRawStr.erase(tempRawStr.begin()); + while (!tempRawStr.empty() && (tempRawStr.back() == '\'' || tempRawStr.back() == '"')) tempRawStr.pop_back(); + text* temp = cstring_to_text(tempRawStr.c_str()); + if (!temp) return 0u; + + text* tres = text_lower(temp); + free(temp); + if (!tres) return 0u; + char* out = text_to_cstring(tres); + free(tres); if (!out) return 0u; uint32_t len = static_cast(strlen(out)); if (len > bufMax) len = bufMax; memcpy(buf, out, len); free(out); return len; - } catch (const std::exception&) { return 0u; } + } + catch (const std::exception&) + { + return 0u; + } }, - str, outBuf.getContent(), nautilus::val(MAX_LEN)); + str.getContent(), str.getContentSize(), outBuf.getContent(), nautilus::val(MAX_LEN)); + VarVal(actualLen).writeToMemory(outBuf.getReference()); return outBuf; } @@ -71,10 +94,11 @@ VarVal TextLowerPhysicalFunction::execute(const Record& record, ArenaRef& arena) PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTextLowerPhysicalFunction( PhysicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.childFunctions.size()==1, - "TextLowerPhysicalFunction requires 1 child but got {}", + PRECONDITION(arguments.childFunctions.size() == 1, + "TextLowerPhysicalFunction requires 1 children but got {}", arguments.childFunctions.size()); - return TextLowerPhysicalFunction(std::move(arguments.childFunctions[0])); + auto arg0 = std::move(arguments.childFunctions[0]); + return TextLowerPhysicalFunction(std::move(arg0)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TextUpperPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TextUpperPhysicalFunction.cpp index e8fdcb3b4e..19fae5f4a5 100644 --- a/nes-physical-operators/src/Functions/Meos/TextUpperPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/TextUpperPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -21,49 +22,71 @@ #include #include #include +#include #include +#include +#include #include #include extern "C" { #include } -#include -#include namespace NES { -TextUpperPhysicalFunction::TextUpperPhysicalFunction(PhysicalFunction str) +TextUpperPhysicalFunction::TextUpperPhysicalFunction(PhysicalFunction strFunction) { - paramFns.reserve(1); - paramFns.push_back(std::move(str)); + parameterFunctions.reserve(1); + parameterFunctions.push_back(std::move(strFunction)); } -VarVal TextUpperPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto str = paramFns[0].execute(record, arena).cast(); +VarVal TextUpperPhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto str = parameterValues[0].cast(); + constexpr uint32_t MAX_LEN = 4096; auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); + const auto actualLen = nautilus::invoke( - +[](const char* w, uint32_t wsz, char* buf, uint32_t bufMax) -> uint32_t { - try { + +[](const char* strPtr, uint32_t strSize, + char* buf, + uint32_t bufMax) -> uint32_t { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string s(w, wsz); - text* t = cstring_to_text(s.c_str()); - if (!t) return 0u; - text* res = text_upper(t); - free(t); - if (!res) return 0u; - char* out = text_to_cstring(res); - free(res); + std::string tempRawStr(strPtr, strSize); + while (!tempRawStr.empty() && (tempRawStr.front() == '\'' || tempRawStr.front() == '"')) tempRawStr.erase(tempRawStr.begin()); + while (!tempRawStr.empty() && (tempRawStr.back() == '\'' || tempRawStr.back() == '"')) tempRawStr.pop_back(); + text* temp = cstring_to_text(tempRawStr.c_str()); + if (!temp) return 0u; + + text* tres = text_upper(temp); + free(temp); + if (!tres) return 0u; + char* out = text_to_cstring(tres); + free(tres); if (!out) return 0u; uint32_t len = static_cast(strlen(out)); if (len > bufMax) len = bufMax; memcpy(buf, out, len); free(out); return len; - } catch (const std::exception&) { return 0u; } + } + catch (const std::exception&) + { + return 0u; + } }, - str, outBuf.getContent(), nautilus::val(MAX_LEN)); + str.getContent(), str.getContentSize(), outBuf.getContent(), nautilus::val(MAX_LEN)); + VarVal(actualLen).writeToMemory(outBuf.getReference()); return outBuf; } @@ -71,10 +94,11 @@ VarVal TextUpperPhysicalFunction::execute(const Record& record, ArenaRef& arena) PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTextUpperPhysicalFunction( PhysicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.childFunctions.size()==1, - "TextUpperPhysicalFunction requires 1 child but got {}", + PRECONDITION(arguments.childFunctions.size() == 1, + "TextUpperPhysicalFunction requires 1 children but got {}", arguments.childFunctions.size()); - return TextUpperPhysicalFunction(std::move(arguments.childFunctions[0])); + auto arg0 = std::move(arguments.childFunctions[0]); + return TextUpperPhysicalFunction(std::move(arg0)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TextcatTextTtextPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TextcatTextTtextPhysicalFunction.cpp index 7c65dcbbd4..6d7e02ea5d 100644 --- a/nes-physical-operators/src/Functions/Meos/TextcatTextTtextPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/TextcatTextTtextPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -24,6 +25,7 @@ #include #include #include +#include #include #include @@ -34,57 +36,74 @@ extern "C" { namespace NES { TextcatTextTtextPhysicalFunction::TextcatTextTtextPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction tsFunction, - PhysicalFunction refFunction) + PhysicalFunction tsFunction, + PhysicalFunction arg0Function) { - paramFns.reserve(3); - paramFns.push_back(std::move(valueFunction)); - paramFns.push_back(std::move(tsFunction)); - paramFns.push_back(std::move(refFunction)); + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } VarVal TextcatTextTtextPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto value = paramFns[0].execute(record, arena).cast(); - auto ts = paramFns[1].execute(record, arena).cast>(); - auto ref = paramFns[2].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto value = parameterValues[0].cast(); + auto ts = parameterValues[1].cast>(); + auto arg0 = parameterValues[2].cast(); - constexpr uint32_t MAX_LEN = 8192; + constexpr uint32_t MAX_LEN = 4096; auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); const auto actualLen = nautilus::invoke( - +[](const char* v, uint32_t vsz, uint64_t t, const char* r, uint32_t rsz, char* buf, uint32_t bufMax) -> uint32_t { - try { + +[](const char* valuePtr, uint32_t valueSize, + uint64_t ts, + const char* arg0Ptr, uint32_t arg0Size, + char* buf, + uint32_t bufMax) -> uint32_t { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string val_str(v, vsz); - while (!val_str.empty() && (val_str.front() == '\'' || val_str.front() == '"')) val_str = val_str.substr(1); - while (!val_str.empty() && (val_str.back() == '\'' || val_str.back() == '"')) val_str = val_str.substr(0, val_str.size() - 1); - std::string ref_str(r, rsz); - while (!ref_str.empty() && (ref_str.front() == '\'' || ref_str.front() == '"')) ref_str = ref_str.substr(1); - while (!ref_str.empty() && (ref_str.back() == '\'' || ref_str.back() == '"')) ref_str = ref_str.substr(0, ref_str.size() - 1); - std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); - std::string wkt = "'" + val_str + "'@" + ts_str; - Temporal* temp = ttext_in(wkt.c_str()); + std::string tempVal(valuePtr, valueSize); + while (!tempVal.empty() && (tempVal.front() == '\'' || tempVal.front() == '"')) tempVal.erase(tempVal.begin()); + while (!tempVal.empty() && (tempVal.back() == '\'' || tempVal.back() == '"')) tempVal.pop_back(); + std::string tempWkt = "'" + tempVal + "'@" + MEOS::Meos::convertEpochToTimestamp(ts); + Temporal* temp = ttext_in(tempWkt.c_str()); if (!temp) return 0u; - text* txt = cstring_to_text(ref_str.c_str()); - if (!txt) { free(temp); return 0u; } - Temporal* res = textcat_text_ttext(txt, temp); - free(temp); free(txt); - if (!res) return 0u; - text* out_txt = ttext_start_value(res); - free(res); - if (!out_txt) return 0u; - char* cstr = text_to_cstring(out_txt); - free(out_txt); - if (!cstr) return 0u; - uint32_t len = static_cast(std::strlen(cstr)); + std::string arg0S(arg0Ptr, arg0Size); + while (!arg0S.empty() && (arg0S.front() == '\'' || arg0S.front() == '"')) arg0S.erase(arg0S.begin()); + while (!arg0S.empty() && (arg0S.back() == '\'' || arg0S.back() == '"')) arg0S.pop_back(); + text* txt0 = cstring_to_text(arg0S.c_str()); + if (!txt0) { free(temp); return 0u; } + + Temporal* tres = textcat_text_ttext(txt0, temp); + free(temp); + free(txt0); + if (!tres) return 0u; + text* txt = ttext_start_value(tres); + free(tres); + if (!txt) return 0u; + char* out = text_to_cstring(txt); + free(txt); + if (!out) return 0u; + uint32_t len = static_cast(strlen(out)); if (len > bufMax) len = bufMax; - std::memcpy(buf, cstr, len); - free(cstr); + memcpy(buf, out, len); + free(out); return len; - } catch (const std::exception&) { return 0u; } + } + catch (const std::exception&) + { + return 0u; + } }, - value, ts, ref, outBuf.getContent(), nautilus::val(MAX_LEN)); + value.getContent(), value.getContentSize(), ts, arg0.getContent(), arg0.getContentSize(), outBuf.getContent(), nautilus::val(MAX_LEN)); VarVal(actualLen).writeToMemory(outBuf.getReference()); return outBuf; @@ -96,10 +115,10 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterT PRECONDITION(arguments.childFunctions.size() == 3, "TextcatTextTtextPhysicalFunction requires 3 children but got {}", arguments.childFunctions.size()); - return TextcatTextTtextPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return TextcatTextTtextPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TextcatTtextTextPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TextcatTtextTextPhysicalFunction.cpp index 3b4d396a5b..58e775c2d9 100644 --- a/nes-physical-operators/src/Functions/Meos/TextcatTtextTextPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/TextcatTtextTextPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -24,6 +25,7 @@ #include #include #include +#include #include #include @@ -34,57 +36,74 @@ extern "C" { namespace NES { TextcatTtextTextPhysicalFunction::TextcatTtextTextPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction tsFunction, - PhysicalFunction refFunction) + PhysicalFunction tsFunction, + PhysicalFunction arg0Function) { - paramFns.reserve(3); - paramFns.push_back(std::move(valueFunction)); - paramFns.push_back(std::move(tsFunction)); - paramFns.push_back(std::move(refFunction)); + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } VarVal TextcatTtextTextPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto value = paramFns[0].execute(record, arena).cast(); - auto ts = paramFns[1].execute(record, arena).cast>(); - auto ref = paramFns[2].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto value = parameterValues[0].cast(); + auto ts = parameterValues[1].cast>(); + auto arg0 = parameterValues[2].cast(); - constexpr uint32_t MAX_LEN = 8192; + constexpr uint32_t MAX_LEN = 4096; auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); const auto actualLen = nautilus::invoke( - +[](const char* v, uint32_t vsz, uint64_t t, const char* r, uint32_t rsz, char* buf, uint32_t bufMax) -> uint32_t { - try { + +[](const char* valuePtr, uint32_t valueSize, + uint64_t ts, + const char* arg0Ptr, uint32_t arg0Size, + char* buf, + uint32_t bufMax) -> uint32_t { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string val_str(v, vsz); - while (!val_str.empty() && (val_str.front() == '\'' || val_str.front() == '"')) val_str = val_str.substr(1); - while (!val_str.empty() && (val_str.back() == '\'' || val_str.back() == '"')) val_str = val_str.substr(0, val_str.size() - 1); - std::string ref_str(r, rsz); - while (!ref_str.empty() && (ref_str.front() == '\'' || ref_str.front() == '"')) ref_str = ref_str.substr(1); - while (!ref_str.empty() && (ref_str.back() == '\'' || ref_str.back() == '"')) ref_str = ref_str.substr(0, ref_str.size() - 1); - std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); - std::string wkt = "'" + val_str + "'@" + ts_str; - Temporal* temp = ttext_in(wkt.c_str()); + std::string tempVal(valuePtr, valueSize); + while (!tempVal.empty() && (tempVal.front() == '\'' || tempVal.front() == '"')) tempVal.erase(tempVal.begin()); + while (!tempVal.empty() && (tempVal.back() == '\'' || tempVal.back() == '"')) tempVal.pop_back(); + std::string tempWkt = "'" + tempVal + "'@" + MEOS::Meos::convertEpochToTimestamp(ts); + Temporal* temp = ttext_in(tempWkt.c_str()); if (!temp) return 0u; - text* txt = cstring_to_text(ref_str.c_str()); - if (!txt) { free(temp); return 0u; } - Temporal* res = textcat_ttext_text(temp, txt); - free(temp); free(txt); - if (!res) return 0u; - text* out_txt = ttext_start_value(res); - free(res); - if (!out_txt) return 0u; - char* cstr = text_to_cstring(out_txt); - free(out_txt); - if (!cstr) return 0u; - uint32_t len = static_cast(std::strlen(cstr)); + std::string arg0S(arg0Ptr, arg0Size); + while (!arg0S.empty() && (arg0S.front() == '\'' || arg0S.front() == '"')) arg0S.erase(arg0S.begin()); + while (!arg0S.empty() && (arg0S.back() == '\'' || arg0S.back() == '"')) arg0S.pop_back(); + text* txt0 = cstring_to_text(arg0S.c_str()); + if (!txt0) { free(temp); return 0u; } + + Temporal* tres = textcat_ttext_text(temp, txt0); + free(temp); + free(txt0); + if (!tres) return 0u; + text* txt = ttext_start_value(tres); + free(tres); + if (!txt) return 0u; + char* out = text_to_cstring(txt); + free(txt); + if (!out) return 0u; + uint32_t len = static_cast(strlen(out)); if (len > bufMax) len = bufMax; - std::memcpy(buf, cstr, len); - free(cstr); + memcpy(buf, out, len); + free(out); return len; - } catch (const std::exception&) { return 0u; } + } + catch (const std::exception&) + { + return 0u; + } }, - value, ts, ref, outBuf.getContent(), nautilus::val(MAX_LEN)); + value.getContent(), value.getContentSize(), ts, arg0.getContent(), arg0.getContentSize(), outBuf.getContent(), nautilus::val(MAX_LEN)); VarVal(actualLen).writeToMemory(outBuf.getReference()); return outBuf; @@ -96,10 +115,10 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterT PRECONDITION(arguments.childFunctions.size() == 3, "TextcatTtextTextPhysicalFunction requires 3 children but got {}", arguments.childFunctions.size()); - return TextcatTtextTextPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return TextcatTtextTextPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TextcatTtextTtextPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TextcatTtextTtextPhysicalFunction.cpp index ed92d1e6e4..b38c9f822d 100644 --- a/nes-physical-operators/src/Functions/Meos/TextcatTtextTtextPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/TextcatTtextTtextPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -24,6 +25,7 @@ #include #include #include +#include #include #include @@ -33,64 +35,80 @@ extern "C" { namespace NES { -TextcatTtextTtextPhysicalFunction::TextcatTtextTtextPhysicalFunction(PhysicalFunction value1Function, - PhysicalFunction ts1Function, - PhysicalFunction value2Function, - PhysicalFunction ts2Function) +TextcatTtextTtextPhysicalFunction::TextcatTtextTtextPhysicalFunction(PhysicalFunction valueFunction, + PhysicalFunction tsFunction, + PhysicalFunction tval0Function, + PhysicalFunction ts0Function) { - paramFns.reserve(4); - paramFns.push_back(std::move(value1Function)); - paramFns.push_back(std::move(ts1Function)); - paramFns.push_back(std::move(value2Function)); - paramFns.push_back(std::move(ts2Function)); + parameterFunctions.reserve(4); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(tval0Function)); + parameterFunctions.push_back(std::move(ts0Function)); } VarVal TextcatTtextTtextPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto value1 = paramFns[0].execute(record, arena).cast(); - auto ts1 = paramFns[1].execute(record, arena).cast>(); - auto value2 = paramFns[2].execute(record, arena).cast(); - auto ts2 = paramFns[3].execute(record, arena).cast>(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto value = parameterValues[0].cast(); + auto ts = parameterValues[1].cast>(); + auto tval0 = parameterValues[2].cast(); + auto ts0 = parameterValues[3].cast>(); - constexpr uint32_t MAX_LEN = 8192; + constexpr uint32_t MAX_LEN = 4096; auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); const auto actualLen = nautilus::invoke( - +[](const char* v1, uint32_t v1sz, uint64_t t1, - const char* v2, uint32_t v2sz, uint64_t t2, - char* buf, uint32_t bufMax) -> uint32_t { - try { + +[](const char* valuePtr, uint32_t valueSize, + uint64_t ts, + const char* tval0Ptr, uint32_t tval0Size, + uint64_t ts0, + char* buf, + uint32_t bufMax) -> uint32_t { + try + { MEOS::Meos::ensureMeosInitialized(); - auto strip = [](std::string s) { - while (!s.empty() && (s.front() == '\'' || s.front() == '"')) s = s.substr(1); - while (!s.empty() && (s.back() == '\'' || s.back() == '"')) s = s.substr(0, s.size() - 1); - return s; - }; - std::string s1 = strip(std::string(v1, v1sz)); - std::string s2 = strip(std::string(v2, v2sz)); - std::string ts1_str = MEOS::Meos::convertEpochToTimestamp(t1); - std::string ts2_str = MEOS::Meos::convertEpochToTimestamp(t2); - Temporal* temp1 = ttext_in(("'" + s1 + "'@" + ts1_str).c_str()); - if (!temp1) return 0u; - Temporal* temp2 = ttext_in(("'" + s2 + "'@" + ts2_str).c_str()); - if (!temp2) { free(temp1); return 0u; } - Temporal* res = textcat_ttext_ttext(temp1, temp2); - free(temp1); free(temp2); - if (!res) return 0u; - text* out_txt = ttext_start_value(res); - free(res); - if (!out_txt) return 0u; - char* cstr = text_to_cstring(out_txt); - free(out_txt); - if (!cstr) return 0u; - uint32_t len = static_cast(std::strlen(cstr)); + std::string tempVal(valuePtr, valueSize); + while (!tempVal.empty() && (tempVal.front() == '\'' || tempVal.front() == '"')) tempVal.erase(tempVal.begin()); + while (!tempVal.empty() && (tempVal.back() == '\'' || tempVal.back() == '"')) tempVal.pop_back(); + std::string tempWkt = "'" + tempVal + "'@" + MEOS::Meos::convertEpochToTimestamp(ts); + Temporal* temp = ttext_in(tempWkt.c_str()); + if (!temp) return 0u; + std::string tval0S(tval0Ptr, tval0Size); + while (!tval0S.empty() && (tval0S.front() == '\'' || tval0S.front() == '"')) tval0S.erase(tval0S.begin()); + while (!tval0S.empty() && (tval0S.back() == '\'' || tval0S.back() == '"')) tval0S.pop_back(); + std::string tval0Wkt = "'" + tval0S + "'@" + MEOS::Meos::convertEpochToTimestamp(ts0); + Temporal* inst0 = ttext_in(tval0Wkt.c_str()); + if (!inst0) { free(temp); return 0u; } + + Temporal* tres = textcat_ttext_ttext(temp, inst0); + free(temp); + free(inst0); + if (!tres) return 0u; + text* txt = ttext_start_value(tres); + free(tres); + if (!txt) return 0u; + char* out = text_to_cstring(txt); + free(txt); + if (!out) return 0u; + uint32_t len = static_cast(strlen(out)); if (len > bufMax) len = bufMax; - std::memcpy(buf, cstr, len); - free(cstr); + memcpy(buf, out, len); + free(out); return len; - } catch (const std::exception&) { return 0u; } + } + catch (const std::exception&) + { + return 0u; + } }, - value1, ts1, value2, ts2, outBuf.getContent(), nautilus::val(MAX_LEN)); + value.getContent(), value.getContentSize(), ts, tval0.getContent(), tval0.getContentSize(), ts0, outBuf.getContent(), nautilus::val(MAX_LEN)); VarVal(actualLen).writeToMemory(outBuf.getReference()); return outBuf; @@ -102,11 +120,11 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterT PRECONDITION(arguments.childFunctions.size() == 4, "TextcatTtextTtextPhysicalFunction requires 4 children but got {}", arguments.childFunctions.size()); - return TextcatTtextTtextPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2]), - std::move(arguments.childFunctions[3])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + return TextcatTtextTtextPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TfloatCeilPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TfloatCeilPhysicalFunction.cpp index bb3c5d6d7b..6b71aa471c 100644 --- a/nes-physical-operators/src/Functions/Meos/TfloatCeilPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/TfloatCeilPhysicalFunction.cpp @@ -48,25 +48,34 @@ VarVal TfloatCeilPhysicalFunction::execute(const Record& record, ArenaRef& arena std::vector parameterValues; parameterValues.reserve(parameterFunctions.size()); for (const auto& function : parameterFunctions) + { parameterValues.emplace_back(function.execute(record, arena)); + } auto value = parameterValues[0].cast>(); auto ts = parameterValues[1].cast>(); const auto result = nautilus::invoke( - +[](double value, uint64_t ts) -> double { - try { + +[](double value, + uint64_t ts) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); std::string tempWkt = fmt::format("{}@{}", value, MEOS::Meos::convertEpochToTimestamp(ts)); Temporal* temp = tfloat_in(tempWkt.c_str()); if (!temp) return 0.0; + Temporal* res = tfloat_ceil(temp); free(temp); if (!res) return 0.0; double r = tfloat_start_value(res); free(res); return r; - } catch (const std::exception&) { return 0.0; } + } + catch (const std::exception&) + { + return 0.0; + } }, value, ts); diff --git a/nes-physical-operators/src/Functions/Meos/TfloatExpPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TfloatExpPhysicalFunction.cpp index be30a495cc..c531b724e1 100644 --- a/nes-physical-operators/src/Functions/Meos/TfloatExpPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/TfloatExpPhysicalFunction.cpp @@ -48,25 +48,34 @@ VarVal TfloatExpPhysicalFunction::execute(const Record& record, ArenaRef& arena) std::vector parameterValues; parameterValues.reserve(parameterFunctions.size()); for (const auto& function : parameterFunctions) + { parameterValues.emplace_back(function.execute(record, arena)); + } auto value = parameterValues[0].cast>(); auto ts = parameterValues[1].cast>(); const auto result = nautilus::invoke( - +[](double value, uint64_t ts) -> double { - try { + +[](double value, + uint64_t ts) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); std::string tempWkt = fmt::format("{}@{}", value, MEOS::Meos::convertEpochToTimestamp(ts)); Temporal* temp = tfloat_in(tempWkt.c_str()); if (!temp) return 0.0; + Temporal* res = tfloat_exp(temp); free(temp); if (!res) return 0.0; double r = tfloat_start_value(res); free(res); return r; - } catch (const std::exception&) { return 0.0; } + } + catch (const std::exception&) + { + return 0.0; + } }, value, ts); diff --git a/nes-physical-operators/src/Functions/Meos/TfloatFloorPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TfloatFloorPhysicalFunction.cpp index 3a3ba34521..1ae0585080 100644 --- a/nes-physical-operators/src/Functions/Meos/TfloatFloorPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/TfloatFloorPhysicalFunction.cpp @@ -48,25 +48,34 @@ VarVal TfloatFloorPhysicalFunction::execute(const Record& record, ArenaRef& aren std::vector parameterValues; parameterValues.reserve(parameterFunctions.size()); for (const auto& function : parameterFunctions) + { parameterValues.emplace_back(function.execute(record, arena)); + } auto value = parameterValues[0].cast>(); auto ts = parameterValues[1].cast>(); const auto result = nautilus::invoke( - +[](double value, uint64_t ts) -> double { - try { + +[](double value, + uint64_t ts) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); std::string tempWkt = fmt::format("{}@{}", value, MEOS::Meos::convertEpochToTimestamp(ts)); Temporal* temp = tfloat_in(tempWkt.c_str()); if (!temp) return 0.0; + Temporal* res = tfloat_floor(temp); free(temp); if (!res) return 0.0; double r = tfloat_start_value(res); free(res); return r; - } catch (const std::exception&) { return 0.0; } + } + catch (const std::exception&) + { + return 0.0; + } }, value, ts); diff --git a/nes-physical-operators/src/Functions/Meos/TfloatLnPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TfloatLnPhysicalFunction.cpp index 78550610c8..06280a0083 100644 --- a/nes-physical-operators/src/Functions/Meos/TfloatLnPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/TfloatLnPhysicalFunction.cpp @@ -48,25 +48,34 @@ VarVal TfloatLnPhysicalFunction::execute(const Record& record, ArenaRef& arena) std::vector parameterValues; parameterValues.reserve(parameterFunctions.size()); for (const auto& function : parameterFunctions) + { parameterValues.emplace_back(function.execute(record, arena)); + } auto value = parameterValues[0].cast>(); auto ts = parameterValues[1].cast>(); const auto result = nautilus::invoke( - +[](double value, uint64_t ts) -> double { - try { + +[](double value, + uint64_t ts) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); std::string tempWkt = fmt::format("{}@{}", value, MEOS::Meos::convertEpochToTimestamp(ts)); Temporal* temp = tfloat_in(tempWkt.c_str()); if (!temp) return 0.0; + Temporal* res = tfloat_ln(temp); free(temp); if (!res) return 0.0; double r = tfloat_start_value(res); free(res); return r; - } catch (const std::exception&) { return 0.0; } + } + catch (const std::exception&) + { + return 0.0; + } }, value, ts); diff --git a/nes-physical-operators/src/Functions/Meos/TfloatLog10PhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TfloatLog10PhysicalFunction.cpp index 59fba49cc9..550f333667 100644 --- a/nes-physical-operators/src/Functions/Meos/TfloatLog10PhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/TfloatLog10PhysicalFunction.cpp @@ -48,25 +48,34 @@ VarVal TfloatLog10PhysicalFunction::execute(const Record& record, ArenaRef& aren std::vector parameterValues; parameterValues.reserve(parameterFunctions.size()); for (const auto& function : parameterFunctions) + { parameterValues.emplace_back(function.execute(record, arena)); + } auto value = parameterValues[0].cast>(); auto ts = parameterValues[1].cast>(); const auto result = nautilus::invoke( - +[](double value, uint64_t ts) -> double { - try { + +[](double value, + uint64_t ts) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); std::string tempWkt = fmt::format("{}@{}", value, MEOS::Meos::convertEpochToTimestamp(ts)); Temporal* temp = tfloat_in(tempWkt.c_str()); if (!temp) return 0.0; + Temporal* res = tfloat_log10(temp); free(temp); if (!res) return 0.0; double r = tfloat_start_value(res); free(res); return r; - } catch (const std::exception&) { return 0.0; } + } + catch (const std::exception&) + { + return 0.0; + } }, value, ts); diff --git a/nes-physical-operators/src/Functions/Meos/TfloatRadiansPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TfloatRadiansPhysicalFunction.cpp index 7988802ffb..d5afc7a083 100644 --- a/nes-physical-operators/src/Functions/Meos/TfloatRadiansPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/TfloatRadiansPhysicalFunction.cpp @@ -48,25 +48,34 @@ VarVal TfloatRadiansPhysicalFunction::execute(const Record& record, ArenaRef& ar std::vector parameterValues; parameterValues.reserve(parameterFunctions.size()); for (const auto& function : parameterFunctions) + { parameterValues.emplace_back(function.execute(record, arena)); + } auto value = parameterValues[0].cast>(); auto ts = parameterValues[1].cast>(); const auto result = nautilus::invoke( - +[](double value, uint64_t ts) -> double { - try { + +[](double value, + uint64_t ts) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); std::string tempWkt = fmt::format("{}@{}", value, MEOS::Meos::convertEpochToTimestamp(ts)); Temporal* temp = tfloat_in(tempWkt.c_str()); if (!temp) return 0.0; + Temporal* res = tfloat_radians(temp); free(temp); if (!res) return 0.0; double r = tfloat_start_value(res); free(res); return r; - } catch (const std::exception&) { return 0.0; } + } + catch (const std::exception&) + { + return 0.0; + } }, value, ts); diff --git a/nes-physical-operators/src/Functions/Meos/TfloatScaleValuePhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TfloatScaleValuePhysicalFunction.cpp index ddf3cb4de1..f0f90887cc 100644 --- a/nes-physical-operators/src/Functions/Meos/TfloatScaleValuePhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/TfloatScaleValuePhysicalFunction.cpp @@ -36,13 +36,13 @@ extern "C" { namespace NES { TfloatScaleValuePhysicalFunction::TfloatScaleValuePhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction tsFunction, - PhysicalFunction widthFunction) + PhysicalFunction tsFunction, + PhysicalFunction arg0Function) { parameterFunctions.reserve(3); parameterFunctions.push_back(std::move(valueFunction)); parameterFunctions.push_back(std::move(tsFunction)); - parameterFunctions.push_back(std::move(widthFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } VarVal TfloatScaleValuePhysicalFunction::execute(const Record& record, ArenaRef& arena) const @@ -50,28 +50,38 @@ VarVal TfloatScaleValuePhysicalFunction::execute(const Record& record, ArenaRef& std::vector parameterValues; parameterValues.reserve(parameterFunctions.size()); for (const auto& function : parameterFunctions) + { parameterValues.emplace_back(function.execute(record, arena)); + } auto value = parameterValues[0].cast>(); - auto ts = parameterValues[1].cast>(); - auto width = parameterValues[2].cast>(); + auto ts = parameterValues[1].cast>(); + auto arg0 = parameterValues[2].cast>(); const auto result = nautilus::invoke( - +[](double value, uint64_t ts, double width) -> double { - try { + +[](double value, + uint64_t ts, + double arg0) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); std::string tempWkt = fmt::format("{}@{}", value, MEOS::Meos::convertEpochToTimestamp(ts)); Temporal* temp = tfloat_in(tempWkt.c_str()); if (!temp) return 0.0; - Temporal* res = tfloat_scale_value(temp, width); + + Temporal* res = tfloat_scale_value(temp, arg0); free(temp); if (!res) return 0.0; double r = tfloat_start_value(res); free(res); return r; - } catch (const std::exception&) { return 0.0; } + } + catch (const std::exception&) + { + return 0.0; + } }, - value, ts, width); + value, ts, arg0); return VarVal(result); } diff --git a/nes-physical-operators/src/Functions/Meos/TfloatShiftScaleValuePhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TfloatShiftScaleValuePhysicalFunction.cpp index 7095a9c943..06afaa9b89 100644 --- a/nes-physical-operators/src/Functions/Meos/TfloatShiftScaleValuePhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/TfloatShiftScaleValuePhysicalFunction.cpp @@ -36,15 +36,15 @@ extern "C" { namespace NES { TfloatShiftScaleValuePhysicalFunction::TfloatShiftScaleValuePhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction tsFunction, - PhysicalFunction shiftFunction, - PhysicalFunction widthFunction) + PhysicalFunction tsFunction, + PhysicalFunction arg0Function, + PhysicalFunction arg1Function) { parameterFunctions.reserve(4); parameterFunctions.push_back(std::move(valueFunction)); parameterFunctions.push_back(std::move(tsFunction)); - parameterFunctions.push_back(std::move(shiftFunction)); - parameterFunctions.push_back(std::move(widthFunction)); + parameterFunctions.push_back(std::move(arg0Function)); + parameterFunctions.push_back(std::move(arg1Function)); } VarVal TfloatShiftScaleValuePhysicalFunction::execute(const Record& record, ArenaRef& arena) const @@ -52,29 +52,40 @@ VarVal TfloatShiftScaleValuePhysicalFunction::execute(const Record& record, Aren std::vector parameterValues; parameterValues.reserve(parameterFunctions.size()); for (const auto& function : parameterFunctions) + { parameterValues.emplace_back(function.execute(record, arena)); + } auto value = parameterValues[0].cast>(); - auto ts = parameterValues[1].cast>(); - auto shift = parameterValues[2].cast>(); - auto width = parameterValues[3].cast>(); + auto ts = parameterValues[1].cast>(); + auto arg0 = parameterValues[2].cast>(); + auto arg1 = parameterValues[3].cast>(); const auto result = nautilus::invoke( - +[](double value, uint64_t ts, double shift, double width) -> double { - try { + +[](double value, + uint64_t ts, + double arg0, + double arg1) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); std::string tempWkt = fmt::format("{}@{}", value, MEOS::Meos::convertEpochToTimestamp(ts)); Temporal* temp = tfloat_in(tempWkt.c_str()); if (!temp) return 0.0; - Temporal* res = tfloat_shift_scale_value(temp, shift, width); + + Temporal* res = tfloat_shift_scale_value(temp, arg0, arg1); free(temp); if (!res) return 0.0; double r = tfloat_start_value(res); free(res); return r; - } catch (const std::exception&) { return 0.0; } + } + catch (const std::exception&) + { + return 0.0; + } }, - value, ts, shift, width); + value, ts, arg0, arg1); return VarVal(result); } diff --git a/nes-physical-operators/src/Functions/Meos/TfloatShiftValuePhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TfloatShiftValuePhysicalFunction.cpp index 3f5de19d9f..ef973d75d9 100644 --- a/nes-physical-operators/src/Functions/Meos/TfloatShiftValuePhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/TfloatShiftValuePhysicalFunction.cpp @@ -36,13 +36,13 @@ extern "C" { namespace NES { TfloatShiftValuePhysicalFunction::TfloatShiftValuePhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction tsFunction, - PhysicalFunction shiftFunction) + PhysicalFunction tsFunction, + PhysicalFunction arg0Function) { parameterFunctions.reserve(3); parameterFunctions.push_back(std::move(valueFunction)); parameterFunctions.push_back(std::move(tsFunction)); - parameterFunctions.push_back(std::move(shiftFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } VarVal TfloatShiftValuePhysicalFunction::execute(const Record& record, ArenaRef& arena) const @@ -50,28 +50,38 @@ VarVal TfloatShiftValuePhysicalFunction::execute(const Record& record, ArenaRef& std::vector parameterValues; parameterValues.reserve(parameterFunctions.size()); for (const auto& function : parameterFunctions) + { parameterValues.emplace_back(function.execute(record, arena)); + } auto value = parameterValues[0].cast>(); - auto ts = parameterValues[1].cast>(); - auto shift = parameterValues[2].cast>(); + auto ts = parameterValues[1].cast>(); + auto arg0 = parameterValues[2].cast>(); const auto result = nautilus::invoke( - +[](double value, uint64_t ts, double shift) -> double { - try { + +[](double value, + uint64_t ts, + double arg0) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); std::string tempWkt = fmt::format("{}@{}", value, MEOS::Meos::convertEpochToTimestamp(ts)); Temporal* temp = tfloat_in(tempWkt.c_str()); if (!temp) return 0.0; - Temporal* res = tfloat_shift_value(temp, shift); + + Temporal* res = tfloat_shift_value(temp, arg0); free(temp); if (!res) return 0.0; double r = tfloat_start_value(res); free(res); return r; - } catch (const std::exception&) { return 0.0; } + } + catch (const std::exception&) + { + return 0.0; + } }, - value, ts, shift); + value, ts, arg0); return VarVal(result); } diff --git a/nes-physical-operators/src/Functions/Meos/TfloatToTbigintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TfloatToTbigintPhysicalFunction.cpp index 9549684d2b..2328c60a8c 100644 --- a/nes-physical-operators/src/Functions/Meos/TfloatToTbigintPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/TfloatToTbigintPhysicalFunction.cpp @@ -36,7 +36,7 @@ extern "C" { namespace NES { TfloatToTbigintPhysicalFunction::TfloatToTbigintPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction tsFunction) + PhysicalFunction tsFunction) { parameterFunctions.reserve(2); parameterFunctions.push_back(std::move(valueFunction)); @@ -48,25 +48,34 @@ VarVal TfloatToTbigintPhysicalFunction::execute(const Record& record, ArenaRef& std::vector parameterValues; parameterValues.reserve(parameterFunctions.size()); for (const auto& function : parameterFunctions) + { parameterValues.emplace_back(function.execute(record, arena)); + } auto value = parameterValues[0].cast>(); - auto ts = parameterValues[1].cast>(); + auto ts = parameterValues[1].cast>(); const auto result = nautilus::invoke( - +[](double value, uint64_t ts) -> double { - try { + +[](double value, + uint64_t ts) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); std::string tempWkt = fmt::format("{}@{}", value, MEOS::Meos::convertEpochToTimestamp(ts)); Temporal* temp = tfloat_in(tempWkt.c_str()); if (!temp) return 0.0; + Temporal* res = tfloat_to_tbigint(temp); free(temp); if (!res) return 0.0; - double r = static_cast(tbigint_start_value(res)); + double r = tbigint_start_value(res); free(res); return r; - } catch (const std::exception&) { return 0.0; } + } + catch (const std::exception&) + { + return 0.0; + } }, value, ts); diff --git a/nes-physical-operators/src/Functions/Meos/TfloatToTintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TfloatToTintPhysicalFunction.cpp index 1c2f2cca6d..d4ee0b491c 100644 --- a/nes-physical-operators/src/Functions/Meos/TfloatToTintPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/TfloatToTintPhysicalFunction.cpp @@ -36,7 +36,7 @@ extern "C" { namespace NES { TfloatToTintPhysicalFunction::TfloatToTintPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction tsFunction) + PhysicalFunction tsFunction) { parameterFunctions.reserve(2); parameterFunctions.push_back(std::move(valueFunction)); @@ -48,25 +48,34 @@ VarVal TfloatToTintPhysicalFunction::execute(const Record& record, ArenaRef& are std::vector parameterValues; parameterValues.reserve(parameterFunctions.size()); for (const auto& function : parameterFunctions) + { parameterValues.emplace_back(function.execute(record, arena)); + } auto value = parameterValues[0].cast>(); - auto ts = parameterValues[1].cast>(); + auto ts = parameterValues[1].cast>(); const auto result = nautilus::invoke( - +[](double value, uint64_t ts) -> double { - try { + +[](double value, + uint64_t ts) -> int { + try + { MEOS::Meos::ensureMeosInitialized(); std::string tempWkt = fmt::format("{}@{}", value, MEOS::Meos::convertEpochToTimestamp(ts)); Temporal* temp = tfloat_in(tempWkt.c_str()); - if (!temp) return 0.0; + if (!temp) return 0; + Temporal* res = tfloat_to_tint(temp); free(temp); - if (!res) return 0.0; - double r = static_cast(tint_start_value(res)); + if (!res) return 0; + int r = tint_start_value(res); free(res); return r; - } catch (const std::exception&) { return 0.0; } + } + catch (const std::exception&) + { + return 0; + } }, value, ts); diff --git a/nes-physical-operators/src/Functions/Meos/Th3indexAreNeighborCellsPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/Th3indexAreNeighborCellsPhysicalFunction.cpp index 82d4b04de1..a2a8065f9c 100644 --- a/nes-physical-operators/src/Functions/Meos/Th3indexAreNeighborCellsPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/Th3indexAreNeighborCellsPhysicalFunction.cpp @@ -13,14 +13,18 @@ */ #include + #include #include #include +#include #include #include #include #include +#include #include +#include #include #include @@ -31,41 +35,56 @@ extern "C" { namespace NES { -Th3indexAreNeighborCellsPhysicalFunction::Th3indexAreNeighborCellsPhysicalFunction(PhysicalFunction cell1, PhysicalFunction ts1, - PhysicalFunction cell2, PhysicalFunction ts2) +Th3indexAreNeighborCellsPhysicalFunction::Th3indexAreNeighborCellsPhysicalFunction(PhysicalFunction cellFunction, + PhysicalFunction tsFunction, + PhysicalFunction cell0Function, + PhysicalFunction ts0Function) { - paramFns.reserve(4); - paramFns.push_back(std::move(cell1)); - paramFns.push_back(std::move(ts1)); - paramFns.push_back(std::move(cell2)); - paramFns.push_back(std::move(ts2)); + parameterFunctions.reserve(4); + parameterFunctions.push_back(std::move(cellFunction)); + parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(cell0Function)); + parameterFunctions.push_back(std::move(ts0Function)); } VarVal Th3indexAreNeighborCellsPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto cell1 = paramFns[0].execute(record, arena).cast(); - auto ts1 = paramFns[1].execute(record, arena).cast(); - auto cell2 = paramFns[2].execute(record, arena).cast(); - auto ts2 = paramFns[3].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto cell = parameterValues[0].cast>(); + auto ts = parameterValues[1].cast>(); + auto cell0 = parameterValues[2].cast>(); + auto ts0 = parameterValues[3].cast>(); const auto result = nautilus::invoke( - +[](uint64_t cell1, uint64_t ts1, uint64_t cell2, uint64_t ts2) -> double { - try { + +[](uint64_t cell, + uint64_t ts, + uint64_t cell0, + uint64_t ts0) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - Temporal* inst1 = th3indexinst_make((H3Index)cell1, (TimestampTz)ts1); - if (!inst1) return 0.0; - Temporal* inst2 = th3indexinst_make((H3Index)cell2, (TimestampTz)ts2); - if (!inst2) { free(inst1); return 0.0; } - Temporal* res = th3index_are_neighbor_cells(inst1, inst2); - free(inst1); - free(inst2); - if (!res) return 0.0; - double r = tbool_start_value(res) ? 1.0 : 0.0; - free(res); + Temporal* temp = th3indexinst_make((H3Index)cell, (TimestampTz)ts); + if (!temp) return 0.0; + Temporal* inst0 = th3indexinst_make((H3Index)cell0, (TimestampTz)ts0); + if (!inst0) { free(temp); return 0.0; } + + double r = th3index_are_neighbor_cells(temp, inst0); + free(temp); + free(inst0); return r; - } catch (const std::exception&) { return 0.0; } + } + catch (const std::exception&) + { + return 0.0; + } }, - cell1, ts1, cell2, ts2); + cell, ts, cell0, ts0); return VarVal(result); } @@ -76,10 +95,11 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterT PRECONDITION(arguments.childFunctions.size() == 4, "Th3indexAreNeighborCellsPhysicalFunction requires 4 children but got {}", arguments.childFunctions.size()); - return Th3indexAreNeighborCellsPhysicalFunction(std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2]), - std::move(arguments.childFunctions[3])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + return Th3indexAreNeighborCellsPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/Th3indexCellToCenterChildNextPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/Th3indexCellToCenterChildNextPhysicalFunction.cpp index 716401e4b0..8e7e3486fa 100644 --- a/nes-physical-operators/src/Functions/Meos/Th3indexCellToCenterChildNextPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/Th3indexCellToCenterChildNextPhysicalFunction.cpp @@ -13,14 +13,19 @@ */ #include + #include #include #include +#include #include #include #include #include +#include #include +#include +#include #include #include @@ -28,47 +33,66 @@ extern "C" { #include #include } -#include -#include namespace NES { -Th3indexCellToCenterChildNextPhysicalFunction::Th3indexCellToCenterChildNextPhysicalFunction(PhysicalFunction cell, PhysicalFunction ts) +Th3indexCellToCenterChildNextPhysicalFunction::Th3indexCellToCenterChildNextPhysicalFunction(PhysicalFunction cellFunction, + PhysicalFunction tsFunction, + PhysicalFunction arg0Function) { - paramFns.reserve(2); - paramFns.push_back(std::move(cell)); - paramFns.push_back(std::move(ts)); + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(cellFunction)); + parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } VarVal Th3indexCellToCenterChildNextPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto cell = paramFns[0].execute(record, arena).cast(); - auto ts = paramFns[1].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto cell = parameterValues[0].cast>(); + auto ts = parameterValues[1].cast>(); + auto arg0 = parameterValues[2].cast>(); - constexpr uint32_t MAX_LEN = 32; + constexpr uint32_t MAX_LEN = 4096; auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); const auto actualLen = nautilus::invoke( - +[](uint64_t cell, uint64_t ts, char* buf, uint32_t bufMax) -> uint32_t { - try { + +[](uint64_t cell, + uint64_t ts, + double arg0, + char* buf, + uint32_t bufMax) -> uint32_t { + try + { MEOS::Meos::ensureMeosInitialized(); - Temporal* inst = th3indexinst_make((H3Index)cell, (TimestampTz)ts); - if (!inst) return 0u; - Temporal* res = th3index_cell_to_center_child_next(inst); - free(inst); - if (!res) return 0u; - H3Index result_cell = th3index_start_value(res); - free(res); - char* hex = h3index_out(result_cell); + Temporal* temp = th3indexinst_make((H3Index)cell, (TimestampTz)ts); + if (!temp) return 0u; + + Temporal* tres = th3index_cell_to_center_child_next(temp, (int32_t)arg0); + free(temp); + if (!tres) return 0u; + H3Index hcell = th3index_start_value(tres); + free(tres); + char* hex = h3index_out(hcell); if (!hex) return 0u; uint32_t len = static_cast(strlen(hex)); if (len > bufMax) len = bufMax; memcpy(buf, hex, len); free(hex); return len; - } catch (const std::exception&) { return 0u; } + } + catch (const std::exception&) + { + return 0u; + } }, - cell, ts, outBuf.getContent(), nautilus::val(MAX_LEN)); + cell, ts, arg0, outBuf.getContent(), nautilus::val(MAX_LEN)); VarVal(actualLen).writeToMemory(outBuf.getReference()); return outBuf; @@ -77,11 +101,13 @@ VarVal Th3indexCellToCenterChildNextPhysicalFunction::execute(const Record& reco PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTh3indexCellToCenterChildNextPhysicalFunction( PhysicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.childFunctions.size() == 2, - "Th3indexCellToCenterChildNextPhysicalFunction requires 2 children but got {}", + PRECONDITION(arguments.childFunctions.size() == 3, + "Th3indexCellToCenterChildNextPhysicalFunction requires 3 children but got {}", arguments.childFunctions.size()); - return Th3indexCellToCenterChildNextPhysicalFunction(std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return Th3indexCellToCenterChildNextPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/Th3indexCellToCenterChildPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/Th3indexCellToCenterChildPhysicalFunction.cpp index b0d88b84c3..c49d83afc5 100644 --- a/nes-physical-operators/src/Functions/Meos/Th3indexCellToCenterChildPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/Th3indexCellToCenterChildPhysicalFunction.cpp @@ -13,14 +13,19 @@ */ #include + #include #include #include +#include #include #include #include #include +#include #include +#include +#include #include #include @@ -28,50 +33,66 @@ extern "C" { #include #include } -#include -#include namespace NES { -Th3indexCellToCenterChildPhysicalFunction::Th3indexCellToCenterChildPhysicalFunction(PhysicalFunction cell, PhysicalFunction ts, - PhysicalFunction resolution) +Th3indexCellToCenterChildPhysicalFunction::Th3indexCellToCenterChildPhysicalFunction(PhysicalFunction cellFunction, + PhysicalFunction tsFunction, + PhysicalFunction arg0Function) { - paramFns.reserve(3); - paramFns.push_back(std::move(cell)); - paramFns.push_back(std::move(ts)); - paramFns.push_back(std::move(resolution)); + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(cellFunction)); + parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } VarVal Th3indexCellToCenterChildPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto cell = paramFns[0].execute(record, arena).cast(); - auto ts = paramFns[1].execute(record, arena).cast(); - auto resolution = paramFns[2].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto cell = parameterValues[0].cast>(); + auto ts = parameterValues[1].cast>(); + auto arg0 = parameterValues[2].cast>(); - constexpr uint32_t MAX_LEN = 32; + constexpr uint32_t MAX_LEN = 4096; auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); const auto actualLen = nautilus::invoke( - +[](uint64_t cell, uint64_t ts, uint64_t resolution, char* buf, uint32_t bufMax) -> uint32_t { - try { + +[](uint64_t cell, + uint64_t ts, + double arg0, + char* buf, + uint32_t bufMax) -> uint32_t { + try + { MEOS::Meos::ensureMeosInitialized(); - Temporal* inst = th3indexinst_make((H3Index)cell, (TimestampTz)ts); - if (!inst) return 0u; - Temporal* res = th3index_cell_to_center_child(inst, (int32_t)resolution); - free(inst); - if (!res) return 0u; - H3Index result_cell = th3index_start_value(res); - free(res); - char* hex = h3index_out(result_cell); + Temporal* temp = th3indexinst_make((H3Index)cell, (TimestampTz)ts); + if (!temp) return 0u; + + Temporal* tres = th3index_cell_to_center_child(temp, (int32_t)arg0); + free(temp); + if (!tres) return 0u; + H3Index hcell = th3index_start_value(tres); + free(tres); + char* hex = h3index_out(hcell); if (!hex) return 0u; uint32_t len = static_cast(strlen(hex)); if (len > bufMax) len = bufMax; memcpy(buf, hex, len); free(hex); return len; - } catch (const std::exception&) { return 0u; } + } + catch (const std::exception&) + { + return 0u; + } }, - cell, ts, resolution, outBuf.getContent(), nautilus::val(MAX_LEN)); + cell, ts, arg0, outBuf.getContent(), nautilus::val(MAX_LEN)); VarVal(actualLen).writeToMemory(outBuf.getReference()); return outBuf; @@ -83,9 +104,10 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterT PRECONDITION(arguments.childFunctions.size() == 3, "Th3indexCellToCenterChildPhysicalFunction requires 3 children but got {}", arguments.childFunctions.size()); - return Th3indexCellToCenterChildPhysicalFunction(std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return Th3indexCellToCenterChildPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/Th3indexCellToChildPosPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/Th3indexCellToChildPosPhysicalFunction.cpp index ab53a9fb18..8f2ed670cb 100644 --- a/nes-physical-operators/src/Functions/Meos/Th3indexCellToChildPosPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/Th3indexCellToChildPosPhysicalFunction.cpp @@ -13,14 +13,18 @@ */ #include + #include #include #include +#include #include #include #include #include +#include #include +#include #include #include @@ -31,36 +35,49 @@ extern "C" { namespace NES { -Th3indexCellToChildPosPhysicalFunction::Th3indexCellToChildPosPhysicalFunction(PhysicalFunction cell, PhysicalFunction ts, - PhysicalFunction parent_res) +Th3indexCellToChildPosPhysicalFunction::Th3indexCellToChildPosPhysicalFunction(PhysicalFunction cellFunction, + PhysicalFunction tsFunction, + PhysicalFunction arg0Function) { - paramFns.reserve(3); - paramFns.push_back(std::move(cell)); - paramFns.push_back(std::move(ts)); - paramFns.push_back(std::move(parent_res)); + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(cellFunction)); + parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } VarVal Th3indexCellToChildPosPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto cell = paramFns[0].execute(record, arena).cast(); - auto ts = paramFns[1].execute(record, arena).cast(); - auto parent_res = paramFns[2].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto cell = parameterValues[0].cast>(); + auto ts = parameterValues[1].cast>(); + auto arg0 = parameterValues[2].cast>(); const auto result = nautilus::invoke( - +[](uint64_t cell, uint64_t ts, uint64_t parent_res) -> double { - try { + +[](uint64_t cell, + uint64_t ts, + double arg0) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - Temporal* inst = th3indexinst_make((H3Index)cell, (TimestampTz)ts); - if (!inst) return 0.0; - Temporal* res = th3index_cell_to_child_pos(inst, (int32_t)parent_res); - free(inst); - if (!res) return 0.0; - double r = (double)tint_start_value(res); - free(res); + Temporal* temp = th3indexinst_make((H3Index)cell, (TimestampTz)ts); + if (!temp) return 0.0; + + double r = th3index_cell_to_child_pos(temp, (int32_t)arg0); + free(temp); return r; - } catch (const std::exception&) { return 0.0; } + } + catch (const std::exception&) + { + return 0.0; + } }, - cell, ts, parent_res); + cell, ts, arg0); return VarVal(result); } @@ -71,9 +88,10 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterT PRECONDITION(arguments.childFunctions.size() == 3, "Th3indexCellToChildPosPhysicalFunction requires 3 children but got {}", arguments.childFunctions.size()); - return Th3indexCellToChildPosPhysicalFunction(std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return Th3indexCellToChildPosPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/Th3indexCellToParentNextPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/Th3indexCellToParentNextPhysicalFunction.cpp index 53a04ef550..af3cc07843 100644 --- a/nes-physical-operators/src/Functions/Meos/Th3indexCellToParentNextPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/Th3indexCellToParentNextPhysicalFunction.cpp @@ -13,14 +13,19 @@ */ #include + #include #include #include +#include #include #include #include #include +#include #include +#include +#include #include #include @@ -28,47 +33,66 @@ extern "C" { #include #include } -#include -#include namespace NES { -Th3indexCellToParentNextPhysicalFunction::Th3indexCellToParentNextPhysicalFunction(PhysicalFunction cell, PhysicalFunction ts) +Th3indexCellToParentNextPhysicalFunction::Th3indexCellToParentNextPhysicalFunction(PhysicalFunction cellFunction, + PhysicalFunction tsFunction, + PhysicalFunction arg0Function) { - paramFns.reserve(2); - paramFns.push_back(std::move(cell)); - paramFns.push_back(std::move(ts)); + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(cellFunction)); + parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } VarVal Th3indexCellToParentNextPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto cell = paramFns[0].execute(record, arena).cast(); - auto ts = paramFns[1].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto cell = parameterValues[0].cast>(); + auto ts = parameterValues[1].cast>(); + auto arg0 = parameterValues[2].cast>(); - constexpr uint32_t MAX_LEN = 32; + constexpr uint32_t MAX_LEN = 4096; auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); const auto actualLen = nautilus::invoke( - +[](uint64_t cell, uint64_t ts, char* buf, uint32_t bufMax) -> uint32_t { - try { + +[](uint64_t cell, + uint64_t ts, + double arg0, + char* buf, + uint32_t bufMax) -> uint32_t { + try + { MEOS::Meos::ensureMeosInitialized(); - Temporal* inst = th3indexinst_make((H3Index)cell, (TimestampTz)ts); - if (!inst) return 0u; - Temporal* res = th3index_cell_to_parent_next(inst); - free(inst); - if (!res) return 0u; - H3Index result_cell = th3index_start_value(res); - free(res); - char* hex = h3index_out(result_cell); + Temporal* temp = th3indexinst_make((H3Index)cell, (TimestampTz)ts); + if (!temp) return 0u; + + Temporal* tres = th3index_cell_to_parent_next(temp, (int32_t)arg0); + free(temp); + if (!tres) return 0u; + H3Index hcell = th3index_start_value(tres); + free(tres); + char* hex = h3index_out(hcell); if (!hex) return 0u; uint32_t len = static_cast(strlen(hex)); if (len > bufMax) len = bufMax; memcpy(buf, hex, len); free(hex); return len; - } catch (const std::exception&) { return 0u; } + } + catch (const std::exception&) + { + return 0u; + } }, - cell, ts, outBuf.getContent(), nautilus::val(MAX_LEN)); + cell, ts, arg0, outBuf.getContent(), nautilus::val(MAX_LEN)); VarVal(actualLen).writeToMemory(outBuf.getReference()); return outBuf; @@ -77,11 +101,13 @@ VarVal Th3indexCellToParentNextPhysicalFunction::execute(const Record& record, A PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTh3indexCellToParentNextPhysicalFunction( PhysicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.childFunctions.size() == 2, - "Th3indexCellToParentNextPhysicalFunction requires 2 children but got {}", + PRECONDITION(arguments.childFunctions.size() == 3, + "Th3indexCellToParentNextPhysicalFunction requires 3 children but got {}", arguments.childFunctions.size()); - return Th3indexCellToParentNextPhysicalFunction(std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return Th3indexCellToParentNextPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/Th3indexCellToParentPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/Th3indexCellToParentPhysicalFunction.cpp index f991d67e81..af11af8eee 100644 --- a/nes-physical-operators/src/Functions/Meos/Th3indexCellToParentPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/Th3indexCellToParentPhysicalFunction.cpp @@ -13,14 +13,19 @@ */ #include + #include #include #include +#include #include #include #include #include +#include #include +#include +#include #include #include @@ -28,50 +33,66 @@ extern "C" { #include #include } -#include -#include namespace NES { -Th3indexCellToParentPhysicalFunction::Th3indexCellToParentPhysicalFunction(PhysicalFunction cell, PhysicalFunction ts, - PhysicalFunction resolution) +Th3indexCellToParentPhysicalFunction::Th3indexCellToParentPhysicalFunction(PhysicalFunction cellFunction, + PhysicalFunction tsFunction, + PhysicalFunction arg0Function) { - paramFns.reserve(3); - paramFns.push_back(std::move(cell)); - paramFns.push_back(std::move(ts)); - paramFns.push_back(std::move(resolution)); + parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(cellFunction)); + parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } VarVal Th3indexCellToParentPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto cell = paramFns[0].execute(record, arena).cast(); - auto ts = paramFns[1].execute(record, arena).cast(); - auto resolution = paramFns[2].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto cell = parameterValues[0].cast>(); + auto ts = parameterValues[1].cast>(); + auto arg0 = parameterValues[2].cast>(); - constexpr uint32_t MAX_LEN = 32; + constexpr uint32_t MAX_LEN = 4096; auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); const auto actualLen = nautilus::invoke( - +[](uint64_t cell, uint64_t ts, uint64_t resolution, char* buf, uint32_t bufMax) -> uint32_t { - try { + +[](uint64_t cell, + uint64_t ts, + double arg0, + char* buf, + uint32_t bufMax) -> uint32_t { + try + { MEOS::Meos::ensureMeosInitialized(); - Temporal* inst = th3indexinst_make((H3Index)cell, (TimestampTz)ts); - if (!inst) return 0u; - Temporal* res = th3index_cell_to_parent(inst, (int32_t)resolution); - free(inst); - if (!res) return 0u; - H3Index result_cell = th3index_start_value(res); - free(res); - char* hex = h3index_out(result_cell); + Temporal* temp = th3indexinst_make((H3Index)cell, (TimestampTz)ts); + if (!temp) return 0u; + + Temporal* tres = th3index_cell_to_parent(temp, (int32_t)arg0); + free(temp); + if (!tres) return 0u; + H3Index hcell = th3index_start_value(tres); + free(tres); + char* hex = h3index_out(hcell); if (!hex) return 0u; uint32_t len = static_cast(strlen(hex)); if (len > bufMax) len = bufMax; memcpy(buf, hex, len); free(hex); return len; - } catch (const std::exception&) { return 0u; } + } + catch (const std::exception&) + { + return 0u; + } }, - cell, ts, resolution, outBuf.getContent(), nautilus::val(MAX_LEN)); + cell, ts, arg0, outBuf.getContent(), nautilus::val(MAX_LEN)); VarVal(actualLen).writeToMemory(outBuf.getReference()); return outBuf; @@ -83,9 +104,10 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterT PRECONDITION(arguments.childFunctions.size() == 3, "Th3indexCellToParentPhysicalFunction requires 3 children but got {}", arguments.childFunctions.size()); - return Th3indexCellToParentPhysicalFunction(std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + return Th3indexCellToParentPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/Th3indexGetBaseCellNumberPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/Th3indexGetBaseCellNumberPhysicalFunction.cpp index 2de1f4f7c2..a34af5b3a9 100644 --- a/nes-physical-operators/src/Functions/Meos/Th3indexGetBaseCellNumberPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/Th3indexGetBaseCellNumberPhysicalFunction.cpp @@ -13,14 +13,18 @@ */ #include + #include #include #include +#include #include #include #include #include +#include #include +#include #include #include @@ -31,31 +35,43 @@ extern "C" { namespace NES { -Th3indexGetBaseCellNumberPhysicalFunction::Th3indexGetBaseCellNumberPhysicalFunction(PhysicalFunction cell, PhysicalFunction ts) +Th3indexGetBaseCellNumberPhysicalFunction::Th3indexGetBaseCellNumberPhysicalFunction(PhysicalFunction cellFunction, + PhysicalFunction tsFunction) { - paramFns.reserve(2); - paramFns.push_back(std::move(cell)); - paramFns.push_back(std::move(ts)); + parameterFunctions.reserve(2); + parameterFunctions.push_back(std::move(cellFunction)); + parameterFunctions.push_back(std::move(tsFunction)); } VarVal Th3indexGetBaseCellNumberPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto cell = paramFns[0].execute(record, arena).cast(); - auto ts = paramFns[1].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto cell = parameterValues[0].cast>(); + auto ts = parameterValues[1].cast>(); const auto result = nautilus::invoke( - +[](uint64_t cell, uint64_t ts) -> double { - try { + +[](uint64_t cell, + uint64_t ts) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - Temporal* inst = th3indexinst_make((H3Index)cell, (TimestampTz)ts); - if (!inst) return 0.0; - Temporal* res = th3index_get_base_cell_number(inst); - free(inst); - if (!res) return 0.0; - double r = (double)tint_start_value(res); - free(res); + Temporal* temp = th3indexinst_make((H3Index)cell, (TimestampTz)ts); + if (!temp) return 0.0; + + double r = th3index_get_base_cell_number(temp); + free(temp); return r; - } catch (const std::exception&) { return 0.0; } + } + catch (const std::exception&) + { + return 0.0; + } }, cell, ts); @@ -68,8 +84,9 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterT PRECONDITION(arguments.childFunctions.size() == 2, "Th3indexGetBaseCellNumberPhysicalFunction requires 2 children but got {}", arguments.childFunctions.size()); - return Th3indexGetBaseCellNumberPhysicalFunction(std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + return Th3indexGetBaseCellNumberPhysicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/Th3indexGetResolutionPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/Th3indexGetResolutionPhysicalFunction.cpp index 87eb8b9a37..03b37a3c57 100644 --- a/nes-physical-operators/src/Functions/Meos/Th3indexGetResolutionPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/Th3indexGetResolutionPhysicalFunction.cpp @@ -13,14 +13,18 @@ */ #include + #include #include #include +#include #include #include #include #include +#include #include +#include #include #include @@ -31,31 +35,43 @@ extern "C" { namespace NES { -Th3indexGetResolutionPhysicalFunction::Th3indexGetResolutionPhysicalFunction(PhysicalFunction cell, PhysicalFunction ts) +Th3indexGetResolutionPhysicalFunction::Th3indexGetResolutionPhysicalFunction(PhysicalFunction cellFunction, + PhysicalFunction tsFunction) { - paramFns.reserve(2); - paramFns.push_back(std::move(cell)); - paramFns.push_back(std::move(ts)); + parameterFunctions.reserve(2); + parameterFunctions.push_back(std::move(cellFunction)); + parameterFunctions.push_back(std::move(tsFunction)); } VarVal Th3indexGetResolutionPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto cell = paramFns[0].execute(record, arena).cast(); - auto ts = paramFns[1].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto cell = parameterValues[0].cast>(); + auto ts = parameterValues[1].cast>(); const auto result = nautilus::invoke( - +[](uint64_t cell, uint64_t ts) -> double { - try { + +[](uint64_t cell, + uint64_t ts) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - Temporal* inst = th3indexinst_make((H3Index)cell, (TimestampTz)ts); - if (!inst) return 0.0; - Temporal* res = th3index_get_resolution(inst); - free(inst); - if (!res) return 0.0; - double r = (double)tint_start_value(res); - free(res); + Temporal* temp = th3indexinst_make((H3Index)cell, (TimestampTz)ts); + if (!temp) return 0.0; + + double r = th3index_get_resolution(temp); + free(temp); return r; - } catch (const std::exception&) { return 0.0; } + } + catch (const std::exception&) + { + return 0.0; + } }, cell, ts); @@ -68,8 +84,9 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterT PRECONDITION(arguments.childFunctions.size() == 2, "Th3indexGetResolutionPhysicalFunction requires 2 children but got {}", arguments.childFunctions.size()); - return Th3indexGetResolutionPhysicalFunction(std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + return Th3indexGetResolutionPhysicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/Th3indexGridDistancePhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/Th3indexGridDistancePhysicalFunction.cpp index daec755b58..7b2c02c06a 100644 --- a/nes-physical-operators/src/Functions/Meos/Th3indexGridDistancePhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/Th3indexGridDistancePhysicalFunction.cpp @@ -13,14 +13,18 @@ */ #include + #include #include #include +#include #include #include #include #include +#include #include +#include #include #include @@ -31,41 +35,56 @@ extern "C" { namespace NES { -Th3indexGridDistancePhysicalFunction::Th3indexGridDistancePhysicalFunction(PhysicalFunction cell1, PhysicalFunction ts1, - PhysicalFunction cell2, PhysicalFunction ts2) +Th3indexGridDistancePhysicalFunction::Th3indexGridDistancePhysicalFunction(PhysicalFunction cellFunction, + PhysicalFunction tsFunction, + PhysicalFunction cell0Function, + PhysicalFunction ts0Function) { - paramFns.reserve(4); - paramFns.push_back(std::move(cell1)); - paramFns.push_back(std::move(ts1)); - paramFns.push_back(std::move(cell2)); - paramFns.push_back(std::move(ts2)); + parameterFunctions.reserve(4); + parameterFunctions.push_back(std::move(cellFunction)); + parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(cell0Function)); + parameterFunctions.push_back(std::move(ts0Function)); } VarVal Th3indexGridDistancePhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto cell1 = paramFns[0].execute(record, arena).cast(); - auto ts1 = paramFns[1].execute(record, arena).cast(); - auto cell2 = paramFns[2].execute(record, arena).cast(); - auto ts2 = paramFns[3].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto cell = parameterValues[0].cast>(); + auto ts = parameterValues[1].cast>(); + auto cell0 = parameterValues[2].cast>(); + auto ts0 = parameterValues[3].cast>(); const auto result = nautilus::invoke( - +[](uint64_t cell1, uint64_t ts1, uint64_t cell2, uint64_t ts2) -> double { - try { + +[](uint64_t cell, + uint64_t ts, + uint64_t cell0, + uint64_t ts0) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - Temporal* inst1 = th3indexinst_make((H3Index)cell1, (TimestampTz)ts1); - if (!inst1) return 0.0; - Temporal* inst2 = th3indexinst_make((H3Index)cell2, (TimestampTz)ts2); - if (!inst2) { free(inst1); return 0.0; } - Temporal* res = th3index_grid_distance(inst1, inst2); - free(inst1); - free(inst2); - if (!res) return 0.0; - double r = (double)tint_start_value(res); - free(res); + Temporal* temp = th3indexinst_make((H3Index)cell, (TimestampTz)ts); + if (!temp) return 0.0; + Temporal* inst0 = th3indexinst_make((H3Index)cell0, (TimestampTz)ts0); + if (!inst0) { free(temp); return 0.0; } + + double r = th3index_grid_distance(temp, inst0); + free(temp); + free(inst0); return r; - } catch (const std::exception&) { return 0.0; } + } + catch (const std::exception&) + { + return 0.0; + } }, - cell1, ts1, cell2, ts2); + cell, ts, cell0, ts0); return VarVal(result); } @@ -76,10 +95,11 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterT PRECONDITION(arguments.childFunctions.size() == 4, "Th3indexGridDistancePhysicalFunction requires 4 children but got {}", arguments.childFunctions.size()); - return Th3indexGridDistancePhysicalFunction(std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1]), - std::move(arguments.childFunctions[2]), - std::move(arguments.childFunctions[3])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + auto arg2 = std::move(arguments.childFunctions[2]); + auto arg3 = std::move(arguments.childFunctions[3]); + return Th3indexGridDistancePhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/Th3indexIsPentagonPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/Th3indexIsPentagonPhysicalFunction.cpp index 0b318b0b0f..9806cc8074 100644 --- a/nes-physical-operators/src/Functions/Meos/Th3indexIsPentagonPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/Th3indexIsPentagonPhysicalFunction.cpp @@ -13,14 +13,18 @@ */ #include + #include #include #include +#include #include #include #include #include +#include #include +#include #include #include @@ -31,31 +35,43 @@ extern "C" { namespace NES { -Th3indexIsPentagonPhysicalFunction::Th3indexIsPentagonPhysicalFunction(PhysicalFunction cell, PhysicalFunction ts) +Th3indexIsPentagonPhysicalFunction::Th3indexIsPentagonPhysicalFunction(PhysicalFunction cellFunction, + PhysicalFunction tsFunction) { - paramFns.reserve(2); - paramFns.push_back(std::move(cell)); - paramFns.push_back(std::move(ts)); + parameterFunctions.reserve(2); + parameterFunctions.push_back(std::move(cellFunction)); + parameterFunctions.push_back(std::move(tsFunction)); } VarVal Th3indexIsPentagonPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto cell = paramFns[0].execute(record, arena).cast(); - auto ts = paramFns[1].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto cell = parameterValues[0].cast>(); + auto ts = parameterValues[1].cast>(); const auto result = nautilus::invoke( - +[](uint64_t cell, uint64_t ts) -> double { - try { + +[](uint64_t cell, + uint64_t ts) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - Temporal* inst = th3indexinst_make((H3Index)cell, (TimestampTz)ts); - if (!inst) return 0.0; - Temporal* res = th3index_is_pentagon(inst); - free(inst); - if (!res) return 0.0; - double r = tbool_start_value(res) ? 1.0 : 0.0; - free(res); + Temporal* temp = th3indexinst_make((H3Index)cell, (TimestampTz)ts); + if (!temp) return 0.0; + + double r = th3index_is_pentagon(temp); + free(temp); return r; - } catch (const std::exception&) { return 0.0; } + } + catch (const std::exception&) + { + return 0.0; + } }, cell, ts); @@ -68,8 +84,9 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterT PRECONDITION(arguments.childFunctions.size() == 2, "Th3indexIsPentagonPhysicalFunction requires 2 children but got {}", arguments.childFunctions.size()); - return Th3indexIsPentagonPhysicalFunction(std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + return Th3indexIsPentagonPhysicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/Th3indexIsValidCellPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/Th3indexIsValidCellPhysicalFunction.cpp index 5a435832c3..4dc19426a9 100644 --- a/nes-physical-operators/src/Functions/Meos/Th3indexIsValidCellPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/Th3indexIsValidCellPhysicalFunction.cpp @@ -13,14 +13,18 @@ */ #include + #include #include #include +#include #include #include #include #include +#include #include +#include #include #include @@ -31,31 +35,43 @@ extern "C" { namespace NES { -Th3indexIsValidCellPhysicalFunction::Th3indexIsValidCellPhysicalFunction(PhysicalFunction cell, PhysicalFunction ts) +Th3indexIsValidCellPhysicalFunction::Th3indexIsValidCellPhysicalFunction(PhysicalFunction cellFunction, + PhysicalFunction tsFunction) { - paramFns.reserve(2); - paramFns.push_back(std::move(cell)); - paramFns.push_back(std::move(ts)); + parameterFunctions.reserve(2); + parameterFunctions.push_back(std::move(cellFunction)); + parameterFunctions.push_back(std::move(tsFunction)); } VarVal Th3indexIsValidCellPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto cell = paramFns[0].execute(record, arena).cast(); - auto ts = paramFns[1].execute(record, arena).cast(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto cell = parameterValues[0].cast>(); + auto ts = parameterValues[1].cast>(); const auto result = nautilus::invoke( - +[](uint64_t cell, uint64_t ts) -> double { - try { + +[](uint64_t cell, + uint64_t ts) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - Temporal* inst = th3indexinst_make((H3Index)cell, (TimestampTz)ts); - if (!inst) return 0.0; - Temporal* res = th3index_is_valid_cell(inst); - free(inst); - if (!res) return 0.0; - double r = tbool_start_value(res) ? 1.0 : 0.0; - free(res); + Temporal* temp = th3indexinst_make((H3Index)cell, (TimestampTz)ts); + if (!temp) return 0.0; + + double r = th3index_is_valid_cell(temp); + free(temp); return r; - } catch (const std::exception&) { return 0.0; } + } + catch (const std::exception&) + { + return 0.0; + } }, cell, ts); @@ -68,8 +84,9 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterT PRECONDITION(arguments.childFunctions.size() == 2, "Th3indexIsValidCellPhysicalFunction requires 2 children but got {}", arguments.childFunctions.size()); - return Th3indexIsValidCellPhysicalFunction(std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + return Th3indexIsValidCellPhysicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TintScaleValuePhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TintScaleValuePhysicalFunction.cpp index aebbb9ed6b..62068e1b76 100644 --- a/nes-physical-operators/src/Functions/Meos/TintScaleValuePhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/TintScaleValuePhysicalFunction.cpp @@ -36,13 +36,13 @@ extern "C" { namespace NES { TintScaleValuePhysicalFunction::TintScaleValuePhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction tsFunction, - PhysicalFunction widthFunction) + PhysicalFunction tsFunction, + PhysicalFunction arg0Function) { parameterFunctions.reserve(3); parameterFunctions.push_back(std::move(valueFunction)); parameterFunctions.push_back(std::move(tsFunction)); - parameterFunctions.push_back(std::move(widthFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } VarVal TintScaleValuePhysicalFunction::execute(const Record& record, ArenaRef& arena) const @@ -50,28 +50,38 @@ VarVal TintScaleValuePhysicalFunction::execute(const Record& record, ArenaRef& a std::vector parameterValues; parameterValues.reserve(parameterFunctions.size()); for (const auto& function : parameterFunctions) + { parameterValues.emplace_back(function.execute(record, arena)); + } - auto value = parameterValues[0].cast>(); - auto ts = parameterValues[1].cast>(); - auto width = parameterValues[2].cast>(); + auto value = parameterValues[0].cast>(); + auto ts = parameterValues[1].cast>(); + auto arg0 = parameterValues[2].cast>(); const auto result = nautilus::invoke( - +[](double value, uint64_t ts, double width_d) -> double { - try { + +[](int32_t value, + uint64_t ts, + int32_t arg0) -> int { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string tempWkt = fmt::format("{}@{}", static_cast(value), MEOS::Meos::convertEpochToTimestamp(ts)); + std::string tempWkt = fmt::format("{}@{}", value, MEOS::Meos::convertEpochToTimestamp(ts)); Temporal* temp = tint_in(tempWkt.c_str()); - if (!temp) return 0.0; - Temporal* res = tint_scale_value(temp, static_cast(width_d)); + if (!temp) return 0; + + Temporal* res = tint_scale_value(temp, arg0); free(temp); - if (!res) return 0.0; - double r = static_cast(tint_start_value(res)); + if (!res) return 0; + int r = tint_start_value(res); free(res); return r; - } catch (const std::exception&) { return 0.0; } + } + catch (const std::exception&) + { + return 0; + } }, - value, ts, width); + value, ts, arg0); return VarVal(result); } diff --git a/nes-physical-operators/src/Functions/Meos/TintShiftScaleValuePhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TintShiftScaleValuePhysicalFunction.cpp index ff1780d328..8f68bd8399 100644 --- a/nes-physical-operators/src/Functions/Meos/TintShiftScaleValuePhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/TintShiftScaleValuePhysicalFunction.cpp @@ -36,15 +36,15 @@ extern "C" { namespace NES { TintShiftScaleValuePhysicalFunction::TintShiftScaleValuePhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction tsFunction, - PhysicalFunction shiftFunction, - PhysicalFunction widthFunction) + PhysicalFunction tsFunction, + PhysicalFunction arg0Function, + PhysicalFunction arg1Function) { parameterFunctions.reserve(4); parameterFunctions.push_back(std::move(valueFunction)); parameterFunctions.push_back(std::move(tsFunction)); - parameterFunctions.push_back(std::move(shiftFunction)); - parameterFunctions.push_back(std::move(widthFunction)); + parameterFunctions.push_back(std::move(arg0Function)); + parameterFunctions.push_back(std::move(arg1Function)); } VarVal TintShiftScaleValuePhysicalFunction::execute(const Record& record, ArenaRef& arena) const @@ -52,29 +52,40 @@ VarVal TintShiftScaleValuePhysicalFunction::execute(const Record& record, ArenaR std::vector parameterValues; parameterValues.reserve(parameterFunctions.size()); for (const auto& function : parameterFunctions) + { parameterValues.emplace_back(function.execute(record, arena)); + } - auto value = parameterValues[0].cast>(); - auto ts = parameterValues[1].cast>(); - auto shift = parameterValues[2].cast>(); - auto width = parameterValues[3].cast>(); + auto value = parameterValues[0].cast>(); + auto ts = parameterValues[1].cast>(); + auto arg0 = parameterValues[2].cast>(); + auto arg1 = parameterValues[3].cast>(); const auto result = nautilus::invoke( - +[](double value, uint64_t ts, double shift_d, double width_d) -> double { - try { + +[](int32_t value, + uint64_t ts, + int32_t arg0, + int32_t arg1) -> int { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string tempWkt = fmt::format("{}@{}", static_cast(value), MEOS::Meos::convertEpochToTimestamp(ts)); + std::string tempWkt = fmt::format("{}@{}", value, MEOS::Meos::convertEpochToTimestamp(ts)); Temporal* temp = tint_in(tempWkt.c_str()); - if (!temp) return 0.0; - Temporal* res = tint_shift_scale_value(temp, static_cast(shift_d), static_cast(width_d)); + if (!temp) return 0; + + Temporal* res = tint_shift_scale_value(temp, arg0, arg1); free(temp); - if (!res) return 0.0; - double r = static_cast(tint_start_value(res)); + if (!res) return 0; + int r = tint_start_value(res); free(res); return r; - } catch (const std::exception&) { return 0.0; } + } + catch (const std::exception&) + { + return 0; + } }, - value, ts, shift, width); + value, ts, arg0, arg1); return VarVal(result); } diff --git a/nes-physical-operators/src/Functions/Meos/TintShiftValuePhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TintShiftValuePhysicalFunction.cpp index 608e63b0f7..946c319688 100644 --- a/nes-physical-operators/src/Functions/Meos/TintShiftValuePhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/TintShiftValuePhysicalFunction.cpp @@ -36,13 +36,13 @@ extern "C" { namespace NES { TintShiftValuePhysicalFunction::TintShiftValuePhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction tsFunction, - PhysicalFunction shiftFunction) + PhysicalFunction tsFunction, + PhysicalFunction arg0Function) { parameterFunctions.reserve(3); parameterFunctions.push_back(std::move(valueFunction)); parameterFunctions.push_back(std::move(tsFunction)); - parameterFunctions.push_back(std::move(shiftFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } VarVal TintShiftValuePhysicalFunction::execute(const Record& record, ArenaRef& arena) const @@ -50,28 +50,38 @@ VarVal TintShiftValuePhysicalFunction::execute(const Record& record, ArenaRef& a std::vector parameterValues; parameterValues.reserve(parameterFunctions.size()); for (const auto& function : parameterFunctions) + { parameterValues.emplace_back(function.execute(record, arena)); + } - auto value = parameterValues[0].cast>(); - auto ts = parameterValues[1].cast>(); - auto shift = parameterValues[2].cast>(); + auto value = parameterValues[0].cast>(); + auto ts = parameterValues[1].cast>(); + auto arg0 = parameterValues[2].cast>(); const auto result = nautilus::invoke( - +[](double value, uint64_t ts, double shift_d) -> double { - try { + +[](int32_t value, + uint64_t ts, + int32_t arg0) -> int { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string tempWkt = fmt::format("{}@{}", static_cast(value), MEOS::Meos::convertEpochToTimestamp(ts)); + std::string tempWkt = fmt::format("{}@{}", value, MEOS::Meos::convertEpochToTimestamp(ts)); Temporal* temp = tint_in(tempWkt.c_str()); - if (!temp) return 0.0; - Temporal* res = tint_shift_value(temp, static_cast(shift_d)); + if (!temp) return 0; + + Temporal* res = tint_shift_value(temp, arg0); free(temp); - if (!res) return 0.0; - double r = static_cast(tint_start_value(res)); + if (!res) return 0; + int r = tint_start_value(res); free(res); return r; - } catch (const std::exception&) { return 0.0; } + } + catch (const std::exception&) + { + return 0; + } }, - value, ts, shift); + value, ts, arg0); return VarVal(result); } diff --git a/nes-physical-operators/src/Functions/Meos/TintToTbigintPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TintToTbigintPhysicalFunction.cpp index 36a685a163..66825ff616 100644 --- a/nes-physical-operators/src/Functions/Meos/TintToTbigintPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/TintToTbigintPhysicalFunction.cpp @@ -36,7 +36,7 @@ extern "C" { namespace NES { TintToTbigintPhysicalFunction::TintToTbigintPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction tsFunction) + PhysicalFunction tsFunction) { parameterFunctions.reserve(2); parameterFunctions.push_back(std::move(valueFunction)); @@ -48,25 +48,34 @@ VarVal TintToTbigintPhysicalFunction::execute(const Record& record, ArenaRef& ar std::vector parameterValues; parameterValues.reserve(parameterFunctions.size()); for (const auto& function : parameterFunctions) + { parameterValues.emplace_back(function.execute(record, arena)); + } - auto value = parameterValues[0].cast>(); - auto ts = parameterValues[1].cast>(); + auto value = parameterValues[0].cast>(); + auto ts = parameterValues[1].cast>(); const auto result = nautilus::invoke( - +[](double value, uint64_t ts) -> double { - try { + +[](int32_t value, + uint64_t ts) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string tempWkt = fmt::format("{}@{}", static_cast(value), MEOS::Meos::convertEpochToTimestamp(ts)); + std::string tempWkt = fmt::format("{}@{}", value, MEOS::Meos::convertEpochToTimestamp(ts)); Temporal* temp = tint_in(tempWkt.c_str()); if (!temp) return 0.0; + Temporal* res = tint_to_tbigint(temp); free(temp); if (!res) return 0.0; - double r = static_cast(tbigint_start_value(res)); + double r = tbigint_start_value(res); free(res); return r; - } catch (const std::exception&) { return 0.0; } + } + catch (const std::exception&) + { + return 0.0; + } }, value, ts); diff --git a/nes-physical-operators/src/Functions/Meos/TintToTfloatPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TintToTfloatPhysicalFunction.cpp index 23eb9eb5dc..49fe1fb891 100644 --- a/nes-physical-operators/src/Functions/Meos/TintToTfloatPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/TintToTfloatPhysicalFunction.cpp @@ -36,7 +36,7 @@ extern "C" { namespace NES { TintToTfloatPhysicalFunction::TintToTfloatPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction tsFunction) + PhysicalFunction tsFunction) { parameterFunctions.reserve(2); parameterFunctions.push_back(std::move(valueFunction)); @@ -48,26 +48,34 @@ VarVal TintToTfloatPhysicalFunction::execute(const Record& record, ArenaRef& are std::vector parameterValues; parameterValues.reserve(parameterFunctions.size()); for (const auto& function : parameterFunctions) + { parameterValues.emplace_back(function.execute(record, arena)); + } auto value = parameterValues[0].cast>(); - auto ts = parameterValues[1].cast>(); + auto ts = parameterValues[1].cast>(); const auto result = nautilus::invoke( - +[](double value, uint64_t ts) -> double { - try { + +[](double value, + uint64_t ts) -> double { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string tempWkt = fmt::format("{}@{}", static_cast(value), - MEOS::Meos::convertEpochToTimestamp(ts)); - Temporal* temp = tint_in(tempWkt.c_str()); + std::string tempWkt = fmt::format("{}@{}", value, MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tfloat_in(tempWkt.c_str()); if (!temp) return 0.0; + Temporal* res = tint_to_tfloat(temp); free(temp); if (!res) return 0.0; double r = tfloat_start_value(res); free(res); return r; - } catch (const std::exception&) { return 0.0; } + } + catch (const std::exception&) + { + return 0.0; + } }, value, ts); diff --git a/nes-physical-operators/src/Functions/Meos/TneBoolTboolPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TneBoolTboolPhysicalFunction.cpp index ca66826959..427e0c403b 100644 --- a/nes-physical-operators/src/Functions/Meos/TneBoolTboolPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/TneBoolTboolPhysicalFunction.cpp @@ -35,13 +35,13 @@ extern "C" { namespace NES { -TneBoolTboolPhysicalFunction::TneBoolTboolPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction thresholdFunction, - PhysicalFunction tsFunction) +TneBoolTboolPhysicalFunction::TneBoolTboolPhysicalFunction(PhysicalFunction arg0Function, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction) { parameterFunctions.reserve(3); + parameterFunctions.push_back(std::move(arg0Function)); parameterFunctions.push_back(std::move(valueFunction)); - parameterFunctions.push_back(std::move(thresholdFunction)); parameterFunctions.push_back(std::move(tsFunction)); } @@ -50,30 +50,38 @@ VarVal TneBoolTboolPhysicalFunction::execute(const Record& record, ArenaRef& are std::vector parameterValues; parameterValues.reserve(parameterFunctions.size()); for (const auto& function : parameterFunctions) + { parameterValues.emplace_back(function.execute(record, arena)); + } - auto value = parameterValues[0].cast>(); - auto thresh = parameterValues[1].cast>(); - auto ts = parameterValues[2].cast>(); + auto arg0 = parameterValues[0].cast>(); + auto value = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); const auto result = nautilus::invoke( - +[](double v, double s, uint64_t t) -> double { - try { + +[](double arg0, + double value, + uint64_t ts) -> bool { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); - bool sv = (v != 0.0); - std::string wkt = fmt::format("{}", (s != 0.0 ? "t" : "f")) + "@" + ts_str; - Temporal* temp = tbool_in(wkt.c_str()); - if (!temp) return 0.0; - Temporal* res = tne_bool_tbool(sv, temp); + std::string tempWkt = fmt::format("{}@{}", value != 0.0 ? "t" : "f", MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tbool_in(tempWkt.c_str()); + if (!temp) return false; + + Temporal* res = tne_bool_tbool(static_cast(arg0 != 0.0), temp); free(temp); - if (!res) return 0.0; + if (!res) return false; bool r = tbool_start_value(res); free(res); - return static_cast(r ? 1.0 : 0.0); - } catch (const std::exception&) { return 0.0; } + return r; + } + catch (const std::exception&) + { + return false; + } }, - value, thresh, ts); + arg0, value, ts); return VarVal(result); } diff --git a/nes-physical-operators/src/Functions/Meos/TneTboolBoolPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TneTboolBoolPhysicalFunction.cpp index f189f48fcf..edc54aedce 100644 --- a/nes-physical-operators/src/Functions/Meos/TneTboolBoolPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/TneTboolBoolPhysicalFunction.cpp @@ -36,13 +36,13 @@ extern "C" { namespace NES { TneTboolBoolPhysicalFunction::TneTboolBoolPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction thresholdFunction, - PhysicalFunction tsFunction) + PhysicalFunction tsFunction, + PhysicalFunction arg0Function) { parameterFunctions.reserve(3); parameterFunctions.push_back(std::move(valueFunction)); - parameterFunctions.push_back(std::move(thresholdFunction)); parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } VarVal TneTboolBoolPhysicalFunction::execute(const Record& record, ArenaRef& arena) const @@ -50,30 +50,38 @@ VarVal TneTboolBoolPhysicalFunction::execute(const Record& record, ArenaRef& are std::vector parameterValues; parameterValues.reserve(parameterFunctions.size()); for (const auto& function : parameterFunctions) + { parameterValues.emplace_back(function.execute(record, arena)); + } auto value = parameterValues[0].cast>(); - auto thresh = parameterValues[1].cast>(); - auto ts = parameterValues[2].cast>(); + auto ts = parameterValues[1].cast>(); + auto arg0 = parameterValues[2].cast>(); const auto result = nautilus::invoke( - +[](double v, double s, uint64_t t) -> double { - try { + +[](double value, + uint64_t ts, + double arg0) -> bool { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); - std::string wkt = fmt::format("{}", (v != 0.0 ? "t" : "f")) + "@" + ts_str; - Temporal* temp = tbool_in(wkt.c_str()); - if (!temp) return 0.0; - bool sv = (s != 0.0); - Temporal* res = tne_tbool_bool(temp, sv); + std::string tempWkt = fmt::format("{}@{}", value != 0.0 ? "t" : "f", MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tbool_in(tempWkt.c_str()); + if (!temp) return false; + + Temporal* res = tne_tbool_bool(temp, static_cast(arg0 != 0.0)); free(temp); - if (!res) return 0.0; + if (!res) return false; bool r = tbool_start_value(res); free(res); - return static_cast(r ? 1.0 : 0.0); - } catch (const std::exception&) { return 0.0; } + return r; + } + catch (const std::exception&) + { + return false; + } }, - value, thresh, ts); + value, ts, arg0); return VarVal(result); } diff --git a/nes-physical-operators/src/Functions/Meos/TnotTboolPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TnotTboolPhysicalFunction.cpp index 10c86464d8..5c45d1ade9 100644 --- a/nes-physical-operators/src/Functions/Meos/TnotTboolPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/TnotTboolPhysicalFunction.cpp @@ -36,7 +36,7 @@ extern "C" { namespace NES { TnotTboolPhysicalFunction::TnotTboolPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction tsFunction) + PhysicalFunction tsFunction) { parameterFunctions.reserve(2); parameterFunctions.push_back(std::move(valueFunction)); @@ -48,26 +48,34 @@ VarVal TnotTboolPhysicalFunction::execute(const Record& record, ArenaRef& arena) std::vector parameterValues; parameterValues.reserve(parameterFunctions.size()); for (const auto& function : parameterFunctions) + { parameterValues.emplace_back(function.execute(record, arena)); + } auto value = parameterValues[0].cast>(); - auto ts = parameterValues[1].cast>(); + auto ts = parameterValues[1].cast>(); const auto result = nautilus::invoke( - +[](double v, uint64_t t) -> double { - try { + +[](double value, + uint64_t ts) -> bool { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); - std::string wkt = fmt::format("{}@{}", (v != 0.0 ? "t" : "f"), ts_str); - Temporal* temp = tbool_in(wkt.c_str()); - if (!temp) return 0.0; + std::string tempWkt = fmt::format("{}@{}", value != 0.0 ? "t" : "f", MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tbool_in(tempWkt.c_str()); + if (!temp) return false; + Temporal* res = tnot_tbool(temp); free(temp); - if (!res) return 0.0; + if (!res) return false; bool r = tbool_start_value(res); free(res); - return static_cast(r ? 1.0 : 0.0); - } catch (const std::exception&) { return 0.0; } + return r; + } + catch (const std::exception&) + { + return false; + } }, value, ts); diff --git a/nes-physical-operators/src/Functions/Meos/TorBoolTboolPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TorBoolTboolPhysicalFunction.cpp index dbf186f3ff..478c0c8498 100644 --- a/nes-physical-operators/src/Functions/Meos/TorBoolTboolPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/TorBoolTboolPhysicalFunction.cpp @@ -35,12 +35,12 @@ extern "C" { namespace NES { -TorBoolTboolPhysicalFunction::TorBoolTboolPhysicalFunction(PhysicalFunction scalarFunction, - PhysicalFunction valueFunction, - PhysicalFunction tsFunction) +TorBoolTboolPhysicalFunction::TorBoolTboolPhysicalFunction(PhysicalFunction arg0Function, + PhysicalFunction valueFunction, + PhysicalFunction tsFunction) { parameterFunctions.reserve(3); - parameterFunctions.push_back(std::move(scalarFunction)); + parameterFunctions.push_back(std::move(arg0Function)); parameterFunctions.push_back(std::move(valueFunction)); parameterFunctions.push_back(std::move(tsFunction)); } @@ -50,29 +50,38 @@ VarVal TorBoolTboolPhysicalFunction::execute(const Record& record, ArenaRef& are std::vector parameterValues; parameterValues.reserve(parameterFunctions.size()); for (const auto& function : parameterFunctions) + { parameterValues.emplace_back(function.execute(record, arena)); + } - auto scalar = parameterValues[0].cast>(); - auto value = parameterValues[1].cast>(); - auto ts = parameterValues[2].cast>(); + auto arg0 = parameterValues[0].cast>(); + auto value = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); const auto result = nautilus::invoke( - +[](double b, double v, uint64_t t) -> double { - try { + +[](double arg0, + double value, + uint64_t ts) -> bool { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); - std::string wkt = fmt::format("{}@{}", (v != 0.0 ? "t" : "f"), ts_str); - Temporal* temp = tbool_in(wkt.c_str()); - if (!temp) return 0.0; - Temporal* res = tor_bool_tbool(static_cast(b != 0.0), temp); + std::string tempWkt = fmt::format("{}@{}", value != 0.0 ? "t" : "f", MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tbool_in(tempWkt.c_str()); + if (!temp) return false; + + Temporal* res = tor_bool_tbool(static_cast(arg0 != 0.0), temp); free(temp); - if (!res) return 0.0; + if (!res) return false; bool r = tbool_start_value(res); free(res); - return static_cast(r ? 1.0 : 0.0); - } catch (const std::exception&) { return 0.0; } + return r; + } + catch (const std::exception&) + { + return false; + } }, - scalar, value, ts); + arg0, value, ts); return VarVal(result); } diff --git a/nes-physical-operators/src/Functions/Meos/TorTboolBoolPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TorTboolBoolPhysicalFunction.cpp index a39f01e2c7..69b37b5dd0 100644 --- a/nes-physical-operators/src/Functions/Meos/TorTboolBoolPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/TorTboolBoolPhysicalFunction.cpp @@ -36,13 +36,13 @@ extern "C" { namespace NES { TorTboolBoolPhysicalFunction::TorTboolBoolPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction scalarFunction, - PhysicalFunction tsFunction) + PhysicalFunction tsFunction, + PhysicalFunction arg0Function) { parameterFunctions.reserve(3); parameterFunctions.push_back(std::move(valueFunction)); - parameterFunctions.push_back(std::move(scalarFunction)); parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } VarVal TorTboolBoolPhysicalFunction::execute(const Record& record, ArenaRef& arena) const @@ -50,29 +50,38 @@ VarVal TorTboolBoolPhysicalFunction::execute(const Record& record, ArenaRef& are std::vector parameterValues; parameterValues.reserve(parameterFunctions.size()); for (const auto& function : parameterFunctions) + { parameterValues.emplace_back(function.execute(record, arena)); + } - auto value = parameterValues[0].cast>(); - auto scalar = parameterValues[1].cast>(); - auto ts = parameterValues[2].cast>(); + auto value = parameterValues[0].cast>(); + auto ts = parameterValues[1].cast>(); + auto arg0 = parameterValues[2].cast>(); const auto result = nautilus::invoke( - +[](double v, double s, uint64_t t) -> double { - try { + +[](double value, + uint64_t ts, + double arg0) -> bool { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); - std::string wkt = fmt::format("{}@{}", (v != 0.0 ? "t" : "f"), ts_str); - Temporal* temp = tbool_in(wkt.c_str()); - if (!temp) return 0.0; - Temporal* res = tor_tbool_bool(temp, static_cast(s != 0.0)); + std::string tempWkt = fmt::format("{}@{}", value != 0.0 ? "t" : "f", MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = tbool_in(tempWkt.c_str()); + if (!temp) return false; + + Temporal* res = tor_tbool_bool(temp, static_cast(arg0 != 0.0)); free(temp); - if (!res) return 0.0; + if (!res) return false; bool r = tbool_start_value(res); free(res); - return static_cast(r ? 1.0 : 0.0); - } catch (const std::exception&) { return 0.0; } + return r; + } + catch (const std::exception&) + { + return false; + } }, - value, scalar, ts); + value, ts, arg0); return VarVal(result); } diff --git a/nes-physical-operators/src/Functions/Meos/TorTboolTboolPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TorTboolTboolPhysicalFunction.cpp index a27e8f674a..69b9be7bf3 100644 --- a/nes-physical-operators/src/Functions/Meos/TorTboolTboolPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/TorTboolTboolPhysicalFunction.cpp @@ -22,7 +22,8 @@ #include #include #include -#include +#include +#include #include #include #include @@ -35,14 +36,12 @@ extern "C" { namespace NES { -TorTboolTboolPhysicalFunction::TorTboolTboolPhysicalFunction(PhysicalFunction value1Function, - PhysicalFunction value2Function, - PhysicalFunction tsFunction) +TorTboolTboolPhysicalFunction::TorTboolTboolPhysicalFunction(PhysicalFunction trajFunction, + PhysicalFunction arg0Function) { - parameterFunctions.reserve(3); - parameterFunctions.push_back(std::move(value1Function)); - parameterFunctions.push_back(std::move(value2Function)); - parameterFunctions.push_back(std::move(tsFunction)); + parameterFunctions.reserve(2); + parameterFunctions.push_back(std::move(trajFunction)); + parameterFunctions.push_back(std::move(arg0Function)); } VarVal TorTboolTboolPhysicalFunction::execute(const Record& record, ArenaRef& arena) const @@ -50,46 +49,74 @@ VarVal TorTboolTboolPhysicalFunction::execute(const Record& record, ArenaRef& ar std::vector parameterValues; parameterValues.reserve(parameterFunctions.size()); for (const auto& function : parameterFunctions) + { parameterValues.emplace_back(function.execute(record, arena)); + } - auto value1 = parameterValues[0].cast>(); - auto value2 = parameterValues[1].cast>(); - auto ts = parameterValues[2].cast>(); + auto traj = parameterValues[0].cast(); + auto arg0 = parameterValues[1].cast(); - const auto result = nautilus::invoke( - +[](double v1, double v2, uint64_t t) -> double { - try { + // Call MEOS f(Temporal*, Temporal*) -> Temporal* over the two hex-WKB + // operands and serialize the result back to hex-WKB inside the invoke; the + // returned heap string is copied into the arena below. Both operands and the + // MEOS result are freed here. + auto hexStr = nautilus::invoke( + +[](const char* aPtr, uint32_t aSize, const char* bPtr, uint32_t bSize) -> char* + { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); - std::string wkt1 = fmt::format("{}@{}", (v1 != 0.0 ? "t" : "f"), ts_str); - std::string wkt2 = fmt::format("{}@{}", (v2 != 0.0 ? "t" : "f"), ts_str); - Temporal* temp1 = tbool_in(wkt1.c_str()); - if (!temp1) return 0.0; - Temporal* temp2 = tbool_in(wkt2.c_str()); - if (!temp2) { free(temp1); return 0.0; } - Temporal* res = tor_tbool_tbool(temp1, temp2); - free(temp1); free(temp2); - if (!res) return 0.0; - bool r = tbool_start_value(res); + std::string aHex(aPtr, aSize); + std::string bHex(bPtr, bSize); + Temporal* a = temporal_from_hexwkb(aHex.c_str()); + if (!a) return (char*) nullptr; + Temporal* b = temporal_from_hexwkb(bHex.c_str()); + if (!b) { free(a); return (char*) nullptr; } + Temporal* res = tor_tbool_tbool(a, b); + free(a); + free(b); + if (!res) return (char*) nullptr; + size_t hexSize = 0; + char* hexOut = temporal_as_hexwkb(res, 0, &hexSize); free(res); - return static_cast(r ? 1.0 : 0.0); - } catch (const std::exception&) { return 0.0; } + return hexOut; + } + catch (const std::exception&) + { + return (char*) nullptr; + } }, - value1, value2, ts); + traj.getContent(), traj.getContentSize(), arg0.getContent(), arg0.getContentSize()); - return VarVal(result); + const auto hexLen = nautilus::invoke( + +[](const char* s) -> uint32_t { return s ? (uint32_t) strlen(s) : (uint32_t) 0; }, + hexStr); + + auto variableSized = arena.allocateVariableSizedData(hexLen); + + nautilus::invoke( + +[](int8_t* dest, const char* s, uint32_t len) -> void + { + if (s) + { + memcpy(dest, s, len); + free((void*) s); + } + }, + variableSized.getContent(), hexStr, hexLen); + + return variableSized; } PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterTorTboolTboolPhysicalFunction( PhysicalFunctionRegistryArguments arguments) { - PRECONDITION(arguments.childFunctions.size() == 3, - "TorTboolTboolPhysicalFunction requires 3 children but got {}", + PRECONDITION(arguments.childFunctions.size() == 2, + "TorTboolTboolPhysicalFunction requires 2 children but got {}", arguments.childFunctions.size()); auto arg0 = std::move(arguments.childFunctions[0]); auto arg1 = std::move(arguments.childFunctions[1]); - auto arg2 = std::move(arguments.childFunctions[2]); - return TorTboolTboolPhysicalFunction(std::move(arg0), std::move(arg1), std::move(arg2)); + return TorTboolTboolPhysicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TtextInitcapPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TtextInitcapPhysicalFunction.cpp index 54f48e699e..6f357d71b8 100644 --- a/nes-physical-operators/src/Functions/Meos/TtextInitcapPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/TtextInitcapPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -24,6 +25,7 @@ #include #include #include +#include #include #include @@ -34,51 +36,64 @@ extern "C" { namespace NES { TtextInitcapPhysicalFunction::TtextInitcapPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction tsFunction) + PhysicalFunction tsFunction) { - paramFns.reserve(2); - paramFns.push_back(std::move(valueFunction)); - paramFns.push_back(std::move(tsFunction)); + parameterFunctions.reserve(2); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); } VarVal TtextInitcapPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto value = paramFns[0].execute(record, arena).cast(); - auto ts = paramFns[1].execute(record, arena).cast>(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto value = parameterValues[0].cast(); + auto ts = parameterValues[1].cast>(); constexpr uint32_t MAX_LEN = 4096; auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); const auto actualLen = nautilus::invoke( - +[](const char* v, uint32_t vsz, uint64_t t, char* buf, uint32_t bufMax) -> uint32_t { - try { + +[](const char* valuePtr, uint32_t valueSize, + uint64_t ts, + char* buf, + uint32_t bufMax) -> uint32_t { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string val_str(v, vsz); - while (!val_str.empty() && (val_str.front() == '\'' || val_str.front() == '"')) - val_str = val_str.substr(1); - while (!val_str.empty() && (val_str.back() == '\'' || val_str.back() == '"')) - val_str = val_str.substr(0, val_str.size() - 1); - std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); - std::string wkt = "'" + val_str + "'@" + ts_str; - Temporal* temp = ttext_in(wkt.c_str()); + std::string tempVal(valuePtr, valueSize); + while (!tempVal.empty() && (tempVal.front() == '\'' || tempVal.front() == '"')) tempVal.erase(tempVal.begin()); + while (!tempVal.empty() && (tempVal.back() == '\'' || tempVal.back() == '"')) tempVal.pop_back(); + std::string tempWkt = "'" + tempVal + "'@" + MEOS::Meos::convertEpochToTimestamp(ts); + Temporal* temp = ttext_in(tempWkt.c_str()); if (!temp) return 0u; - Temporal* res = ttext_initcap(temp); + + Temporal* tres = ttext_initcap(temp); free(temp); - if (!res) return 0u; - text* txt = ttext_start_value(res); - free(res); + if (!tres) return 0u; + text* txt = ttext_start_value(tres); + free(tres); if (!txt) return 0u; - char* cstr = text_to_cstring(txt); + char* out = text_to_cstring(txt); free(txt); - if (!cstr) return 0u; - uint32_t len = static_cast(std::strlen(cstr)); + if (!out) return 0u; + uint32_t len = static_cast(strlen(out)); if (len > bufMax) len = bufMax; - std::memcpy(buf, cstr, len); - free(cstr); + memcpy(buf, out, len); + free(out); return len; - } catch (const std::exception&) { return 0u; } + } + catch (const std::exception&) + { + return 0u; + } }, - value, ts, outBuf.getContent(), nautilus::val(MAX_LEN)); + value.getContent(), value.getContentSize(), ts, outBuf.getContent(), nautilus::val(MAX_LEN)); VarVal(actualLen).writeToMemory(outBuf.getReference()); return outBuf; @@ -90,9 +105,9 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterT PRECONDITION(arguments.childFunctions.size() == 2, "TtextInitcapPhysicalFunction requires 2 children but got {}", arguments.childFunctions.size()); - return TtextInitcapPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + return TtextInitcapPhysicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TtextLowerPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TtextLowerPhysicalFunction.cpp index 16ef19011a..b7450fb40c 100644 --- a/nes-physical-operators/src/Functions/Meos/TtextLowerPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/TtextLowerPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -24,6 +25,7 @@ #include #include #include +#include #include #include @@ -34,51 +36,64 @@ extern "C" { namespace NES { TtextLowerPhysicalFunction::TtextLowerPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction tsFunction) + PhysicalFunction tsFunction) { - paramFns.reserve(2); - paramFns.push_back(std::move(valueFunction)); - paramFns.push_back(std::move(tsFunction)); + parameterFunctions.reserve(2); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); } VarVal TtextLowerPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto value = paramFns[0].execute(record, arena).cast(); - auto ts = paramFns[1].execute(record, arena).cast>(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto value = parameterValues[0].cast(); + auto ts = parameterValues[1].cast>(); constexpr uint32_t MAX_LEN = 4096; auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); const auto actualLen = nautilus::invoke( - +[](const char* v, uint32_t vsz, uint64_t t, char* buf, uint32_t bufMax) -> uint32_t { - try { + +[](const char* valuePtr, uint32_t valueSize, + uint64_t ts, + char* buf, + uint32_t bufMax) -> uint32_t { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string val_str(v, vsz); - while (!val_str.empty() && (val_str.front() == '\'' || val_str.front() == '"')) - val_str = val_str.substr(1); - while (!val_str.empty() && (val_str.back() == '\'' || val_str.back() == '"')) - val_str = val_str.substr(0, val_str.size() - 1); - std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); - std::string wkt = "'" + val_str + "'@" + ts_str; - Temporal* temp = ttext_in(wkt.c_str()); + std::string tempVal(valuePtr, valueSize); + while (!tempVal.empty() && (tempVal.front() == '\'' || tempVal.front() == '"')) tempVal.erase(tempVal.begin()); + while (!tempVal.empty() && (tempVal.back() == '\'' || tempVal.back() == '"')) tempVal.pop_back(); + std::string tempWkt = "'" + tempVal + "'@" + MEOS::Meos::convertEpochToTimestamp(ts); + Temporal* temp = ttext_in(tempWkt.c_str()); if (!temp) return 0u; - Temporal* res = ttext_lower(temp); + + Temporal* tres = ttext_lower(temp); free(temp); - if (!res) return 0u; - text* txt = ttext_start_value(res); - free(res); + if (!tres) return 0u; + text* txt = ttext_start_value(tres); + free(tres); if (!txt) return 0u; - char* cstr = text_to_cstring(txt); + char* out = text_to_cstring(txt); free(txt); - if (!cstr) return 0u; - uint32_t len = static_cast(std::strlen(cstr)); + if (!out) return 0u; + uint32_t len = static_cast(strlen(out)); if (len > bufMax) len = bufMax; - std::memcpy(buf, cstr, len); - free(cstr); + memcpy(buf, out, len); + free(out); return len; - } catch (const std::exception&) { return 0u; } + } + catch (const std::exception&) + { + return 0u; + } }, - value, ts, outBuf.getContent(), nautilus::val(MAX_LEN)); + value.getContent(), value.getContentSize(), ts, outBuf.getContent(), nautilus::val(MAX_LEN)); VarVal(actualLen).writeToMemory(outBuf.getReference()); return outBuf; @@ -90,9 +105,9 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterT PRECONDITION(arguments.childFunctions.size() == 2, "TtextLowerPhysicalFunction requires 2 children but got {}", arguments.childFunctions.size()); - return TtextLowerPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + return TtextLowerPhysicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-physical-operators/src/Functions/Meos/TtextUpperPhysicalFunction.cpp b/nes-physical-operators/src/Functions/Meos/TtextUpperPhysicalFunction.cpp index 9c4e91e507..dfc34c0add 100644 --- a/nes-physical-operators/src/Functions/Meos/TtextUpperPhysicalFunction.cpp +++ b/nes-physical-operators/src/Functions/Meos/TtextUpperPhysicalFunction.cpp @@ -13,6 +13,7 @@ */ #include + #include #include #include @@ -24,6 +25,7 @@ #include #include #include +#include #include #include @@ -34,51 +36,64 @@ extern "C" { namespace NES { TtextUpperPhysicalFunction::TtextUpperPhysicalFunction(PhysicalFunction valueFunction, - PhysicalFunction tsFunction) + PhysicalFunction tsFunction) { - paramFns.reserve(2); - paramFns.push_back(std::move(valueFunction)); - paramFns.push_back(std::move(tsFunction)); + parameterFunctions.reserve(2); + parameterFunctions.push_back(std::move(valueFunction)); + parameterFunctions.push_back(std::move(tsFunction)); } VarVal TtextUpperPhysicalFunction::execute(const Record& record, ArenaRef& arena) const { - auto value = paramFns[0].execute(record, arena).cast(); - auto ts = paramFns[1].execute(record, arena).cast>(); + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + { + parameterValues.emplace_back(function.execute(record, arena)); + } + + auto value = parameterValues[0].cast(); + auto ts = parameterValues[1].cast>(); constexpr uint32_t MAX_LEN = 4096; auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); const auto actualLen = nautilus::invoke( - +[](const char* v, uint32_t vsz, uint64_t t, char* buf, uint32_t bufMax) -> uint32_t { - try { + +[](const char* valuePtr, uint32_t valueSize, + uint64_t ts, + char* buf, + uint32_t bufMax) -> uint32_t { + try + { MEOS::Meos::ensureMeosInitialized(); - std::string val_str(v, vsz); - while (!val_str.empty() && (val_str.front() == '\'' || val_str.front() == '"')) - val_str = val_str.substr(1); - while (!val_str.empty() && (val_str.back() == '\'' || val_str.back() == '"')) - val_str = val_str.substr(0, val_str.size() - 1); - std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); - std::string wkt = "'" + val_str + "'@" + ts_str; - Temporal* temp = ttext_in(wkt.c_str()); + std::string tempVal(valuePtr, valueSize); + while (!tempVal.empty() && (tempVal.front() == '\'' || tempVal.front() == '"')) tempVal.erase(tempVal.begin()); + while (!tempVal.empty() && (tempVal.back() == '\'' || tempVal.back() == '"')) tempVal.pop_back(); + std::string tempWkt = "'" + tempVal + "'@" + MEOS::Meos::convertEpochToTimestamp(ts); + Temporal* temp = ttext_in(tempWkt.c_str()); if (!temp) return 0u; - Temporal* res = ttext_upper(temp); + + Temporal* tres = ttext_upper(temp); free(temp); - if (!res) return 0u; - text* txt = ttext_start_value(res); - free(res); + if (!tres) return 0u; + text* txt = ttext_start_value(tres); + free(tres); if (!txt) return 0u; - char* cstr = text_to_cstring(txt); + char* out = text_to_cstring(txt); free(txt); - if (!cstr) return 0u; - uint32_t len = static_cast(std::strlen(cstr)); + if (!out) return 0u; + uint32_t len = static_cast(strlen(out)); if (len > bufMax) len = bufMax; - std::memcpy(buf, cstr, len); - free(cstr); + memcpy(buf, out, len); + free(out); return len; - } catch (const std::exception&) { return 0u; } + } + catch (const std::exception&) + { + return 0u; + } }, - value, ts, outBuf.getContent(), nautilus::val(MAX_LEN)); + value.getContent(), value.getContentSize(), ts, outBuf.getContent(), nautilus::val(MAX_LEN)); VarVal(actualLen).writeToMemory(outBuf.getReference()); return outBuf; @@ -90,9 +105,9 @@ PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::RegisterT PRECONDITION(arguments.childFunctions.size() == 2, "TtextUpperPhysicalFunction requires 2 children but got {}", arguments.childFunctions.size()); - return TtextUpperPhysicalFunction( - std::move(arguments.childFunctions[0]), - std::move(arguments.childFunctions[1])); + auto arg0 = std::move(arguments.childFunctions[0]); + auto arg1 = std::move(arguments.childFunctions[1]); + return TtextUpperPhysicalFunction(std::move(arg0), std::move(arg1)); } } // namespace NES diff --git a/nes-sql-parser/AntlrSQL.g4 b/nes-sql-parser/AntlrSQL.g4 index bb55433a5c..c5c7cc759d 100644 --- a/nes-sql-parser/AntlrSQL.g4 +++ b/nes-sql-parser/AntlrSQL.g4 @@ -295,7 +295,7 @@ timeUnit: MS timestampParameter: name=identifier; -functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT | TGE_TTEXT_TEXT | TGE_TEXT_TTEXT | TGT_TTEXT_TEXT | TGT_TEXT_TTEXT | TLE_TTEXT_TEXT | TLE_TEXT_TTEXT | TLT_TTEXT_TEXT | TLT_TEXT_TTEXT | TTEXT_UPPER | TTEXT_LOWER | TTEXT_INITCAP | TEXTCAT_TTEXT_TEXT | TEXTCAT_TEXT_TTEXT | TEXTCAT_TTEXT_TTEXT | GEOM_LENGTH | GEOM_PERIMETER | GEOM_AZIMUTH | GEOG_AREA | GEOG_LENGTH | GEOG_PERIMETER | GEOM_IS_EMPTY | AINTERSECTS_TGEO_GEO | ACOVERS_TGEO_GEO | ADISJOINT_TGEO_GEO | ADWITHIN_TGEO_GEO | EINTERSECTS_TGEO_GEO | ETOUCHES_TGEO_GEO | ECONTAINS_TGEO_GEO | ACONTAINS_TGEO_GEO | ATOUCHES_TGEO_GEO | GEO_NUM_POINTS | GEO_NUM_GEOS | GEO_SRID | GEO_IS_UNITARY | GEO_EQUALS | GEO_SAME | GEOG_DISTANCE | NAD_TGEO_GEO | EVER_EQ_TGEO_GEO | EVER_NE_TGEO_GEO | ALWAYS_EQ_TGEO_GEO | ALWAYS_NE_TGEO_GEO | GEOG_INTERSECTS | GEOG_DWITHIN | ACOVERS_GEO_TGEO | GEOM_INTERSECTS | GEOM_DWITHIN | H3_GS_POINT_TO_CELL | EVER_EQ_TH3INDEX_H3INDEX | EVER_NE_TH3INDEX_H3INDEX | ALWAYS_EQ_TH3INDEX_H3INDEX | ALWAYS_NE_TH3INDEX_H3INDEX | TH3INDEX_GET_RESOLUTION | TH3INDEX_GET_BASE_CELL_NUMBER | TH3INDEX_IS_VALID_CELL | TH3INDEX_IS_PENTAGON | TH3INDEX_CELL_TO_PARENT_NEXT | TH3INDEX_CELL_TO_CENTER_CHILD_NEXT | TH3INDEX_CELL_TO_PARENT | TH3INDEX_CELL_TO_CENTER_CHILD | TH3INDEX_CELL_TO_CHILD_POS | TH3INDEX_ARE_NEIGHBOR_CELLS | TH3INDEX_GRID_DISTANCE | EINTERSECTS_TCBUFFER_GEO | AINTERSECTS_TCBUFFER_GEO | ECOVERS_TCBUFFER_GEO | ACOVERS_TCBUFFER_GEO | EDISJOINT_TCBUFFER_GEO | ADISJOINT_TCBUFFER_GEO | ETOUCHES_TCBUFFER_GEO | ATOUCHES_TCBUFFER_GEO | ECONTAINS_TCBUFFER_GEO | ACONTAINS_TCBUFFER_GEO | NAD_TCBUFFER_GEO | EDWITHIN_TCBUFFER_GEO | ADWITHIN_TCBUFFER_GEO | EINTERSECTS_TCBUFFER_CBUFFER | AINTERSECTS_TCBUFFER_CBUFFER | ECOVERS_TCBUFFER_CBUFFER | ACOVERS_TCBUFFER_CBUFFER | EDISJOINT_TCBUFFER_CBUFFER | ADISJOINT_TCBUFFER_CBUFFER | ETOUCHES_TCBUFFER_CBUFFER | ATOUCHES_TCBUFFER_CBUFFER | ECONTAINS_TCBUFFER_CBUFFER | ACONTAINS_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_CBUFFER | ALWAYS_EQ_TCBUFFER_CBUFFER | EVER_NE_TCBUFFER_CBUFFER | ALWAYS_NE_TCBUFFER_CBUFFER | NAD_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_TCBUFFER | ALWAYS_EQ_TCBUFFER_TCBUFFER | EVER_NE_TCBUFFER_TCBUFFER | ALWAYS_NE_TCBUFFER_TCBUFFER | EINTERSECTS_TCBUFFER_TCBUFFER | AINTERSECTS_TCBUFFER_TCBUFFER | ECOVERS_TCBUFFER_TCBUFFER | ACOVERS_TCBUFFER_TCBUFFER | ADISJOINT_TCBUFFER_TCBUFFER | ETOUCHES_TCBUFFER_TCBUFFER | ATOUCHES_TCBUFFER_TCBUFFER | NAD_TCBUFFER_TCBUFFER | EDWITHIN_TCBUFFER_TCBUFFER | ADWITHIN_TCBUFFER_TCBUFFER | MINDISTANCE_TCBUFFER_TCBUFFER | NAD_TNPOINT_GEO | EVER_EQ_TNPOINT_NPOINT | ALWAYS_EQ_TNPOINT_NPOINT | EVER_NE_TNPOINT_NPOINT | ALWAYS_NE_TNPOINT_NPOINT | NAD_TNPOINT_NPOINT | EVER_EQ_NPOINT_TNPOINT | ALWAYS_EQ_NPOINT_TNPOINT | EVER_NE_NPOINT_TNPOINT | ALWAYS_NE_NPOINT_TNPOINT | EVER_EQ_TNPOINT_TNPOINT | ALWAYS_EQ_TNPOINT_TNPOINT | EVER_NE_TNPOINT_TNPOINT | ALWAYS_NE_TNPOINT_TNPOINT | NAD_TNPOINT_TNPOINT | NAD_TPOSE_GEO | EVER_EQ_TPOSE_POSE | ALWAYS_EQ_TPOSE_POSE | EVER_NE_TPOSE_POSE | ALWAYS_NE_TPOSE_POSE | NAD_TPOSE_POSE | EVER_EQ_POSE_TPOSE | ALWAYS_EQ_POSE_TPOSE | EVER_NE_POSE_TPOSE | ALWAYS_NE_POSE_TPOSE | EVER_EQ_TPOSE_TPOSE | ALWAYS_EQ_TPOSE_TPOSE | EVER_NE_TPOSE_TPOSE | ALWAYS_NE_TPOSE_TPOSE | NAD_TPOSE_TPOSE | EVER_EQ_TRGEOMETRY_GEO | ALWAYS_EQ_TRGEOMETRY_GEO | EVER_NE_TRGEOMETRY_GEO | ALWAYS_NE_TRGEOMETRY_GEO | NAD_TRGEOMETRY_GEO | EVER_EQ_GEO_TRGEOMETRY | ALWAYS_EQ_GEO_TRGEOMETRY | EVER_NE_GEO_TRGEOMETRY | ALWAYS_NE_GEO_TRGEOMETRY | EVER_EQ_TRGEOMETRY_TRGEOMETRY | ALWAYS_EQ_TRGEOMETRY_TRGEOMETRY | EVER_NE_TRGEOMETRY_TRGEOMETRY | ALWAYS_NE_TRGEOMETRY_TRGEOMETRY | NAD_TRGEOMETRY_TRGEOMETRY | EINTERSECTS_TPCPOINT_GEO | NAD_TPCPOINT_GEO | QUADBIN_POINT_TO_CELL | QUADBIN_IS_VALID_CELL | QUADBIN_GET_RESOLUTION | QUADBIN_CELL_AREA | QUADBIN_CELL_TO_QUADKEY | QUADBIN_CELL_TO_PARENT | QUADBIN_TILE_TO_CELL | EVER_EQ_TJSONB_JSONB | ALWAYS_EQ_TJSONB_JSONB | EVER_NE_TJSONB_JSONB | ALWAYS_NE_TJSONB_JSONB | EVER_EQ_TJSONB_TJSONB | ALWAYS_EQ_TJSONB_TJSONB | EVER_NE_TJSONB_TJSONB | ALWAYS_NE_TJSONB_TJSONB | GEOM_BOUNDARY | GEOM_CENTROID | GEOM_CONVEX_HULL | GEO_REVERSE | GEO_POINTS | GEOM_UNARY_UNION | GEOM_DIFFERENCE2D | GEOM_INTERSECTION2D | GEOM_SHORTESTLINE2D | GEOM_SHORTESTLINE3D | GEO_SET_SRID | GEO_TRANSFORM | GEO_ROUND | GEOM_BUFFER | LINE_NUMPOINTS | LINE_LOCATE_POINT | LINE_INTERPOLATE_POINT | LINE_SUBSTRING | GEOM_POINT_MAKE2D | GEOM_POINT_MAKE3DZ | GEOG_POINT_MAKE2D | GEOG_POINT_MAKE3DZ | GEOM_TO_GEOG | GEOG_TO_GEOM | GEOG_CENTROID | GEO_GEO_N | LINE_POINT_N | GEOM_INTERSECTION2D_COLL | GEO_AS_GEOJSON | GEO_AS_HEXEWKB | GEO_AS_EWKT | GEO_FROM_GEOJSON | GEOM_FROM_HEXEWKB | GEO_TRANSFORM_PIPELINE | GEOM_MIN_BOUNDING_CENTER | GEOM_MIN_BOUNDING_RADIUS | EVER_EQ_TGEO_TGEO | EVER_NE_TGEO_TGEO | ALWAYS_EQ_TGEO_TGEO | ALWAYS_NE_TGEO_TGEO | EINTERSECTS_TGEO_TGEO | ECOVERS_TGEO_TGEO | EDISJOINT_TGEO_TGEO | ECONTAINS_TGEO_TGEO | ETOUCHES_TGEO_TGEO | AINTERSECTS_TGEO_TGEO | ACOVERS_TGEO_TGEO | ADISJOINT_TGEO_TGEO | ACONTAINS_TGEO_TGEO | ATOUCHES_TGEO_TGEO | EDWITHIN_TGEO_TGEO | ADWITHIN_TGEO_TGEO | H3INDEX_EQ | H3INDEX_NE | H3INDEX_LT | H3INDEX_LE | H3INDEX_GT | H3INDEX_GE | H3INDEX_CMP | H3INDEX_OUT | H3INDEX_IN | JSON_ARRAY_LENGTH | JSON_TYPEOF | JSON_OBJECT_FIELD_TEXT | JSON_ARRAY_ELEMENT_TEXT | JSONB_ARRAY_LENGTH | JSONB_EQ | JSONB_NE | JSONB_LT | JSONB_LE | JSONB_GT | JSONB_GE | JSONB_CMP | JSONB_CONTAINS | JSONB_CONTAINED | JSONB_EXISTS | JSONB_TO_CSTRING | JSONB_PRETTY | JSONB_OBJECT_FIELD_TEXT | JSONB_ARRAY_ELEMENT_TEXT | INTSPAN_MAKE | FLOATSPAN_MAKE | INTSPAN_LOWER | INTSPAN_UPPER | INTSPAN_WIDTH | INTSPAN_LOWER_INC | INTSPAN_UPPER_INC | FLOATSPAN_LOWER | FLOATSPAN_UPPER | FLOATSPAN_WIDTH | FLOATSPAN_LOWER_INC | FLOATSPAN_UPPER_INC | CONTAINED_INT_SPAN | CONTAINED_FLOAT_SPAN | CONTAINS_SPAN_INT | CONTAINS_SPAN_FLOAT | CONTAINED_SPAN_SPAN | CONTAINS_SPAN_SPAN | CONTAINED_FLOATSPAN_SPAN | CONTAINS_FLOATSPAN_SPAN | TEXT_UPPER | TEXT_LOWER | TEXT_INITCAP | QUADBIN_EQ | QUADBIN_NE | QUADBIN_LT | QUADBIN_LE | QUADBIN_GT | QUADBIN_GE | QUADBIN_CMP | EVER_EQ_QUADBIN_TQUADBIN | EVER_NE_QUADBIN_TQUADBIN | ALWAYS_EQ_QUADBIN_TQUADBIN | ALWAYS_NE_QUADBIN_TQUADBIN | EVER_EQ_TQUADBIN_QUADBIN | EVER_NE_TQUADBIN_QUADBIN | ALWAYS_EQ_TQUADBIN_QUADBIN | ALWAYS_NE_TQUADBIN_QUADBIN | EVER_EQ_TQUADBIN_TQUADBIN | EVER_NE_TQUADBIN_TQUADBIN | ALWAYS_EQ_TQUADBIN_TQUADBIN | ALWAYS_NE_TQUADBIN_TQUADBIN | GEOM_RELATE_PATTERN | GEOM_INTERSECTS2D | GEOM_DWITHIN2D | GEOM_CONTAINS | GEOM_DISJOINT2D | GEOM_COVERS | GEOM_TOUCHES | GEOM_INTERSECTS3D | GEOM_DWITHIN3D | GEOM_DISTANCE2D | GEOM_DISTANCE3D; +functionName: IDENTIFIER | AVG | MAX | MIN | SUM | COUNT | MEDIAN | ARRAY_AGG | VAR | TEMPORAL_SEQUENCE | TEMPORAL_EINTERSECTS_GEOMETRY | TEMPORAL_AINTERSECTS_GEOMETRY | TEMPORAL_ECONTAINS_GEOMETRY | ALWAYS_EQ_BIGINT_TBIGINT | ALWAYS_GE_BIGINT_TBIGINT | ALWAYS_GT_BIGINT_TBIGINT | ALWAYS_LE_BIGINT_TBIGINT | ALWAYS_LT_BIGINT_TBIGINT | ALWAYS_NE_BIGINT_TBIGINT | ALWAYS_EQ_TBIGINT_BIGINT | ALWAYS_GE_TBIGINT_BIGINT | ALWAYS_GT_TBIGINT_BIGINT | ALWAYS_LE_TBIGINT_BIGINT | ALWAYS_LT_TBIGINT_BIGINT | ALWAYS_NE_TBIGINT_BIGINT | ALWAYS_EQ_TBIGINT_TBIGINT | ALWAYS_GE_TBIGINT_TBIGINT | ALWAYS_GT_TBIGINT_TBIGINT | ALWAYS_LE_TBIGINT_TBIGINT | ALWAYS_LT_TBIGINT_TBIGINT | ALWAYS_NE_TBIGINT_TBIGINT | ALWAYS_EQ_BOOL_TBOOL | ALWAYS_NE_BOOL_TBOOL | ALWAYS_EQ_FLOAT_TFLOAT | ALWAYS_GE_FLOAT_TFLOAT | ALWAYS_GT_FLOAT_TFLOAT | ALWAYS_LE_FLOAT_TFLOAT | ALWAYS_LT_FLOAT_TFLOAT | ALWAYS_NE_FLOAT_TFLOAT | ALWAYS_EQ_TBOOL_BOOL | ALWAYS_NE_TBOOL_BOOL | ALWAYS_EQ_TEMPORAL_TEMPORAL | ALWAYS_GE_TEMPORAL_TEMPORAL | ALWAYS_GT_TEMPORAL_TEMPORAL | ALWAYS_LE_TEMPORAL_TEMPORAL | ALWAYS_LT_TEMPORAL_TEMPORAL | ALWAYS_NE_TEMPORAL_TEMPORAL | ALWAYS_EQ_TFLOAT_FLOAT | ALWAYS_GE_TFLOAT_FLOAT | ALWAYS_GT_TFLOAT_FLOAT | ALWAYS_LE_TFLOAT_FLOAT | ALWAYS_LT_TFLOAT_FLOAT | ALWAYS_NE_TFLOAT_FLOAT | ALWAYS_EQ_TFLOAT_TFLOAT | ALWAYS_GE_TFLOAT_TFLOAT | ALWAYS_GT_TFLOAT_TFLOAT | ALWAYS_LE_TFLOAT_TFLOAT | ALWAYS_LT_TFLOAT_TFLOAT | ALWAYS_NE_TFLOAT_TFLOAT | ALWAYS_EQ_INT_TINT | ALWAYS_GE_INT_TINT | ALWAYS_GT_INT_TINT | ALWAYS_LE_INT_TINT | ALWAYS_LT_INT_TINT | ALWAYS_NE_INT_TINT | ALWAYS_EQ_TINT_INT | ALWAYS_GE_TINT_INT | ALWAYS_GT_TINT_INT | ALWAYS_LE_TINT_INT | ALWAYS_LT_TINT_INT | ALWAYS_NE_TINT_INT | ALWAYS_EQ_TINT_TINT | ALWAYS_GE_TINT_TINT | ALWAYS_GT_TINT_TINT | ALWAYS_LE_TINT_TINT | ALWAYS_LT_TINT_TINT | ALWAYS_NE_TINT_TINT | EDWITHIN_TGEO_GEO | EVER_EQ_BIGINT_TBIGINT | EVER_GE_BIGINT_TBIGINT | EVER_GT_BIGINT_TBIGINT | EVER_LE_BIGINT_TBIGINT | EVER_LT_BIGINT_TBIGINT | EVER_NE_BIGINT_TBIGINT | EVER_EQ_TBIGINT_BIGINT | EVER_GE_TBIGINT_BIGINT | EVER_GT_TBIGINT_BIGINT | EVER_LE_TBIGINT_BIGINT | EVER_LT_TBIGINT_BIGINT | EVER_NE_TBIGINT_BIGINT | EVER_EQ_TBIGINT_TBIGINT | EVER_GE_TBIGINT_TBIGINT | EVER_GT_TBIGINT_TBIGINT | EVER_LE_TBIGINT_TBIGINT | EVER_LT_TBIGINT_TBIGINT | EVER_NE_TBIGINT_TBIGINT | EVER_EQ_BOOL_TBOOL | EVER_NE_BOOL_TBOOL | EVER_EQ_FLOAT_TFLOAT | EVER_GE_FLOAT_TFLOAT | EVER_GT_FLOAT_TFLOAT | EVER_LE_FLOAT_TFLOAT | EVER_LT_FLOAT_TFLOAT | EVER_NE_FLOAT_TFLOAT | EVER_EQ_TBOOL_BOOL | EVER_NE_TBOOL_BOOL | EVER_EQ_TEMPORAL_TEMPORAL | EVER_GE_TEMPORAL_TEMPORAL | EVER_GT_TEMPORAL_TEMPORAL | EVER_LE_TEMPORAL_TEMPORAL | EVER_LT_TEMPORAL_TEMPORAL | EVER_NE_TEMPORAL_TEMPORAL | EVER_EQ_TFLOAT_FLOAT | EVER_GE_TFLOAT_FLOAT | EVER_GT_TFLOAT_FLOAT | EVER_LE_TFLOAT_FLOAT | EVER_LT_TFLOAT_FLOAT | EVER_NE_TFLOAT_FLOAT | EVER_EQ_TFLOAT_TFLOAT | EVER_GE_TFLOAT_TFLOAT | EVER_GT_TFLOAT_TFLOAT | EVER_LE_TFLOAT_TFLOAT | EVER_LT_TFLOAT_TFLOAT | EVER_NE_TFLOAT_TFLOAT | EVER_EQ_INT_TINT | EVER_GE_INT_TINT | EVER_GT_INT_TINT | EVER_LE_INT_TINT | EVER_LT_INT_TINT | EVER_NE_INT_TINT | EVER_EQ_TINT_INT | EVER_GE_TINT_INT | EVER_GT_TINT_INT | EVER_LE_TINT_INT | EVER_LT_TINT_INT | EVER_NE_TINT_INT | EVER_EQ_TINT_TINT | EVER_GE_TINT_TINT | EVER_GT_TINT_TINT | EVER_LE_TINT_TINT | EVER_LT_TINT_TINT | EVER_NE_TINT_TINT | TGEO_AT_STBOX | ADD_BIGINT_TBIGINT | ADD_FLOAT_TFLOAT | ADD_INT_TINT | ADD_TBIGINT_BIGINT | ADD_TFLOAT_FLOAT | ADD_TINT_INT | ADD_TNUMBER_TNUMBER | DIV_BIGINT_TBIGINT | DIV_FLOAT_TFLOAT | DIV_INT_TINT | DIV_TBIGINT_BIGINT | DIV_TFLOAT_FLOAT | DIV_TINT_INT | DIV_TNUMBER_TNUMBER | MUL_BIGINT_TBIGINT | MUL_FLOAT_TFLOAT | MUL_INT_TINT | MUL_TBIGINT_BIGINT | MUL_TFLOAT_FLOAT | MUL_TINT_INT | MUL_TNUMBER_TNUMBER | SUB_BIGINT_TBIGINT | SUB_FLOAT_TFLOAT | SUB_INT_TINT | SUB_TBIGINT_BIGINT | SUB_TFLOAT_FLOAT | SUB_TINT_INT | SUB_TNUMBER_TNUMBER | TDISTANCE_TFLOAT_FLOAT | TDISTANCE_TINT_INT | TDISTANCE_TNUMBER_TNUMBER | TEMPORAL_ROUND | TFLOAT_CEIL | TFLOAT_COS | TFLOAT_DEGREES | TFLOAT_EXP | TFLOAT_FLOOR | TFLOAT_LN | TFLOAT_LOG10 | TFLOAT_RADIANS | TFLOAT_SCALE_VALUE | TFLOAT_SHIFT_SCALE_VALUE | TBIGINT_SCALE_VALUE | TBIGINT_SHIFT_SCALE_VALUE | TBIGINT_SHIFT_VALUE | TBIGINT_TO_TFLOAT | TBIGINT_TO_TINT | TFLOAT_SHIFT_VALUE | TFLOAT_SIN | TFLOAT_TAN | TFLOAT_TO_TBIGINT | TFLOAT_TO_TINT | TINT_SCALE_VALUE | TINT_SHIFT_SCALE_VALUE | TINT_SHIFT_VALUE | TINT_TO_TBIGINT | TINT_TO_TFLOAT | TNUMBER_ABS | TAND_BOOL_TBOOL | TAND_TBOOL_BOOL | TAND_TBOOL_TBOOL | TNOT_TBOOL | TOR_BOOL_TBOOL | TOR_TBOOL_BOOL | TOR_TBOOL_TBOOL | TEQ_BOOL_TBOOL | TEQ_FLOAT_TFLOAT | TEQ_INT_TINT | TEQ_TBOOL_BOOL | TEQ_TEMPORAL_TEMPORAL | TEQ_TFLOAT_FLOAT | TEQ_TINT_INT | TNE_TBOOL_BOOL | TNE_BOOL_TBOOL | TNE_TFLOAT_FLOAT | TNE_FLOAT_TFLOAT | TNE_TINT_INT | TNE_INT_TINT | TNE_TEMPORAL_TEMPORAL | TGE_TFLOAT_FLOAT | TGE_FLOAT_TFLOAT | TGE_TINT_INT | TGE_INT_TINT | TGE_TEMPORAL_TEMPORAL | TGT_TFLOAT_FLOAT | TGT_FLOAT_TFLOAT | TGT_TINT_INT | TGT_INT_TINT | TGT_TEMPORAL_TEMPORAL | TLE_TFLOAT_FLOAT | TLE_FLOAT_TFLOAT | TLE_TINT_INT | TLE_INT_TINT | TLE_TEMPORAL_TEMPORAL | TLT_TFLOAT_FLOAT | TLT_FLOAT_TFLOAT | TLT_TINT_INT | TLT_INT_TINT | TLT_TEMPORAL_TEMPORAL | TBOOL_TO_TINT | EVER_EQ_TTEXT_TEXT | EVER_NE_TTEXT_TEXT | EVER_GE_TTEXT_TEXT | EVER_GT_TTEXT_TEXT | EVER_LE_TTEXT_TEXT | EVER_LT_TTEXT_TEXT | EVER_EQ_TEXT_TTEXT | EVER_NE_TEXT_TTEXT | EVER_GE_TEXT_TTEXT | EVER_GT_TEXT_TTEXT | EVER_LE_TEXT_TTEXT | EVER_LT_TEXT_TTEXT | ALWAYS_EQ_TTEXT_TEXT | ALWAYS_NE_TTEXT_TEXT | ALWAYS_GE_TTEXT_TEXT | ALWAYS_GT_TTEXT_TEXT | ALWAYS_LE_TTEXT_TEXT | ALWAYS_LT_TTEXT_TEXT | ALWAYS_EQ_TEXT_TTEXT | ALWAYS_NE_TEXT_TTEXT | ALWAYS_GE_TEXT_TTEXT | ALWAYS_GT_TEXT_TTEXT | ALWAYS_LE_TEXT_TTEXT | ALWAYS_LT_TEXT_TTEXT | TEQ_TTEXT_TEXT | TNE_TTEXT_TEXT | TEQ_TEXT_TTEXT | TNE_TEXT_TTEXT | TGE_TTEXT_TEXT | TGE_TEXT_TTEXT | TGT_TTEXT_TEXT | TGT_TEXT_TTEXT | TLE_TTEXT_TEXT | TLE_TEXT_TTEXT | TLT_TTEXT_TEXT | TLT_TEXT_TTEXT | TTEXT_UPPER | TTEXT_LOWER | TTEXT_INITCAP | TEXTCAT_TTEXT_TEXT | TEXTCAT_TEXT_TTEXT | TEXTCAT_TTEXT_TTEXT | GEOM_LENGTH | GEOM_PERIMETER | GEOM_AZIMUTH | GEOG_AREA | GEOG_LENGTH | GEOG_PERIMETER | GEOM_IS_EMPTY | AINTERSECTS_TGEO_GEO | ACOVERS_TGEO_GEO | ADISJOINT_TGEO_GEO | ADWITHIN_TGEO_GEO | EINTERSECTS_TGEO_GEO | ETOUCHES_TGEO_GEO | ECONTAINS_TGEO_GEO | ACONTAINS_TGEO_GEO | ATOUCHES_TGEO_GEO | GEO_NUM_POINTS | GEO_NUM_GEOS | GEO_SRID | GEO_IS_UNITARY | GEO_EQUALS | GEO_SAME | GEOG_DISTANCE | NAD_TGEO_GEO | EVER_EQ_TGEO_GEO | EVER_NE_TGEO_GEO | ALWAYS_EQ_TGEO_GEO | ALWAYS_NE_TGEO_GEO | GEOG_INTERSECTS | GEOG_DWITHIN | ACOVERS_GEO_TGEO | GEOM_INTERSECTS | GEOM_DWITHIN | H3_GS_POINT_TO_CELL | EVER_EQ_TH3INDEX_H3INDEX | EVER_NE_TH3INDEX_H3INDEX | ALWAYS_EQ_TH3INDEX_H3INDEX | ALWAYS_NE_TH3INDEX_H3INDEX | TH3INDEX_GET_RESOLUTION | TH3INDEX_GET_BASE_CELL_NUMBER | TH3INDEX_IS_VALID_CELL | TH3INDEX_IS_PENTAGON | TH3INDEX_CELL_TO_PARENT_NEXT | TH3INDEX_CELL_TO_CENTER_CHILD_NEXT | TH3INDEX_CELL_TO_PARENT | TH3INDEX_CELL_TO_CENTER_CHILD | TH3INDEX_CELL_TO_CHILD_POS | TH3INDEX_ARE_NEIGHBOR_CELLS | TH3INDEX_GRID_DISTANCE | EINTERSECTS_TCBUFFER_GEO | AINTERSECTS_TCBUFFER_GEO | ECOVERS_TCBUFFER_GEO | ACOVERS_TCBUFFER_GEO | EDISJOINT_TCBUFFER_GEO | ADISJOINT_TCBUFFER_GEO | ETOUCHES_TCBUFFER_GEO | ATOUCHES_TCBUFFER_GEO | ECONTAINS_TCBUFFER_GEO | ACONTAINS_TCBUFFER_GEO | NAD_TCBUFFER_GEO | EDWITHIN_TCBUFFER_GEO | ADWITHIN_TCBUFFER_GEO | EINTERSECTS_TCBUFFER_CBUFFER | AINTERSECTS_TCBUFFER_CBUFFER | ECOVERS_TCBUFFER_CBUFFER | ACOVERS_TCBUFFER_CBUFFER | EDISJOINT_TCBUFFER_CBUFFER | ADISJOINT_TCBUFFER_CBUFFER | ETOUCHES_TCBUFFER_CBUFFER | ATOUCHES_TCBUFFER_CBUFFER | ECONTAINS_TCBUFFER_CBUFFER | ACONTAINS_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_CBUFFER | ALWAYS_EQ_TCBUFFER_CBUFFER | EVER_NE_TCBUFFER_CBUFFER | ALWAYS_NE_TCBUFFER_CBUFFER | NAD_TCBUFFER_CBUFFER | EVER_EQ_TCBUFFER_TCBUFFER | ALWAYS_EQ_TCBUFFER_TCBUFFER | EVER_NE_TCBUFFER_TCBUFFER | ALWAYS_NE_TCBUFFER_TCBUFFER | EINTERSECTS_TCBUFFER_TCBUFFER | AINTERSECTS_TCBUFFER_TCBUFFER | ECOVERS_TCBUFFER_TCBUFFER | ACOVERS_TCBUFFER_TCBUFFER | ADISJOINT_TCBUFFER_TCBUFFER | ETOUCHES_TCBUFFER_TCBUFFER | ATOUCHES_TCBUFFER_TCBUFFER | NAD_TCBUFFER_TCBUFFER | EDWITHIN_TCBUFFER_TCBUFFER | ADWITHIN_TCBUFFER_TCBUFFER | MINDISTANCE_TCBUFFER_TCBUFFER | NAD_TNPOINT_GEO | EVER_EQ_TNPOINT_NPOINT | ALWAYS_EQ_TNPOINT_NPOINT | EVER_NE_TNPOINT_NPOINT | ALWAYS_NE_TNPOINT_NPOINT | NAD_TNPOINT_NPOINT | EVER_EQ_NPOINT_TNPOINT | ALWAYS_EQ_NPOINT_TNPOINT | EVER_NE_NPOINT_TNPOINT | ALWAYS_NE_NPOINT_TNPOINT | EVER_EQ_TNPOINT_TNPOINT | ALWAYS_EQ_TNPOINT_TNPOINT | EVER_NE_TNPOINT_TNPOINT | ALWAYS_NE_TNPOINT_TNPOINT | NAD_TNPOINT_TNPOINT | NAD_TPOSE_GEO | EVER_EQ_TPOSE_POSE | ALWAYS_EQ_TPOSE_POSE | EVER_NE_TPOSE_POSE | ALWAYS_NE_TPOSE_POSE | NAD_TPOSE_POSE | EVER_EQ_POSE_TPOSE | ALWAYS_EQ_POSE_TPOSE | EVER_NE_POSE_TPOSE | ALWAYS_NE_POSE_TPOSE | EVER_EQ_TPOSE_TPOSE | ALWAYS_EQ_TPOSE_TPOSE | EVER_NE_TPOSE_TPOSE | ALWAYS_NE_TPOSE_TPOSE | NAD_TPOSE_TPOSE | EVER_EQ_TRGEOMETRY_GEO | ALWAYS_EQ_TRGEOMETRY_GEO | EVER_NE_TRGEOMETRY_GEO | ALWAYS_NE_TRGEOMETRY_GEO | NAD_TRGEOMETRY_GEO | EVER_EQ_GEO_TRGEOMETRY | ALWAYS_EQ_GEO_TRGEOMETRY | EVER_NE_GEO_TRGEOMETRY | ALWAYS_NE_GEO_TRGEOMETRY | EVER_EQ_TRGEOMETRY_TRGEOMETRY | ALWAYS_EQ_TRGEOMETRY_TRGEOMETRY | EVER_NE_TRGEOMETRY_TRGEOMETRY | ALWAYS_NE_TRGEOMETRY_TRGEOMETRY | NAD_TRGEOMETRY_TRGEOMETRY | EINTERSECTS_TPCPOINT_GEO | NAD_TPCPOINT_GEO | QUADBIN_POINT_TO_CELL | QUADBIN_IS_VALID_CELL | QUADBIN_GET_RESOLUTION | QUADBIN_CELL_AREA | QUADBIN_CELL_TO_QUADKEY | QUADBIN_CELL_TO_PARENT | QUADBIN_TILE_TO_CELL | EVER_EQ_TJSONB_JSONB | ALWAYS_EQ_TJSONB_JSONB | EVER_NE_TJSONB_JSONB | ALWAYS_NE_TJSONB_JSONB | EVER_EQ_TJSONB_TJSONB | ALWAYS_EQ_TJSONB_TJSONB | EVER_NE_TJSONB_TJSONB | ALWAYS_NE_TJSONB_TJSONB | GEOM_BOUNDARY | GEOM_CENTROID | GEOM_CONVEX_HULL | GEO_REVERSE | GEO_POINTS | GEOM_UNARY_UNION | GEOM_DIFFERENCE2D | GEOM_INTERSECTION2D | GEOM_SHORTESTLINE2D | GEOM_SHORTESTLINE3D | GEO_SET_SRID | GEO_TRANSFORM | GEO_ROUND | GEOM_BUFFER | LINE_NUMPOINTS | LINE_LOCATE_POINT | LINE_INTERPOLATE_POINT | LINE_SUBSTRING | GEOM_POINT_MAKE2D | GEOM_POINT_MAKE3DZ | GEOG_POINT_MAKE2D | GEOG_POINT_MAKE3DZ | GEOM_TO_GEOG | GEOG_TO_GEOM | GEOG_CENTROID | GEO_GEO_N | LINE_POINT_N | GEOM_INTERSECTION2D_COLL | GEO_AS_GEOJSON | GEO_AS_HEXEWKB | GEO_AS_EWKT | GEO_FROM_GEOJSON | GEOM_FROM_HEXEWKB | GEO_TRANSFORM_PIPELINE | GEOM_MIN_BOUNDING_CENTER | GEOM_MIN_BOUNDING_RADIUS | EVER_EQ_TGEO_TGEO | EVER_NE_TGEO_TGEO | ALWAYS_EQ_TGEO_TGEO | ALWAYS_NE_TGEO_TGEO | EINTERSECTS_TGEO_TGEO | ECOVERS_TGEO_TGEO | EDISJOINT_TGEO_TGEO | ECONTAINS_TGEO_TGEO | ETOUCHES_TGEO_TGEO | AINTERSECTS_TGEO_TGEO | ACOVERS_TGEO_TGEO | ADISJOINT_TGEO_TGEO | ACONTAINS_TGEO_TGEO | ATOUCHES_TGEO_TGEO | EDWITHIN_TGEO_TGEO | ADWITHIN_TGEO_TGEO | H3INDEX_EQ | H3INDEX_NE | H3INDEX_LT | H3INDEX_LE | H3INDEX_GT | H3INDEX_GE | H3INDEX_CMP | H3INDEX_OUT | H3INDEX_IN | JSON_ARRAY_LENGTH | JSON_TYPEOF | JSON_OBJECT_FIELD_TEXT | JSON_ARRAY_ELEMENT_TEXT | JSONB_ARRAY_LENGTH | JSONB_EQ | JSONB_NE | JSONB_LT | JSONB_LE | JSONB_GT | JSONB_GE | JSONB_CMP | JSONB_CONTAINS | JSONB_CONTAINED | JSONB_EXISTS | JSONB_TO_CSTRING | JSONB_PRETTY | JSONB_OBJECT_FIELD_TEXT | JSONB_ARRAY_ELEMENT_TEXT | INTSPAN_MAKE | FLOATSPAN_MAKE | INTSPAN_LOWER | INTSPAN_UPPER | INTSPAN_WIDTH | INTSPAN_LOWER_INC | INTSPAN_UPPER_INC | FLOATSPAN_LOWER | FLOATSPAN_UPPER | FLOATSPAN_WIDTH | FLOATSPAN_LOWER_INC | FLOATSPAN_UPPER_INC | CONTAINED_INT_SPAN | CONTAINED_FLOAT_SPAN | CONTAINS_SPAN_INT | CONTAINS_SPAN_FLOAT | CONTAINED_SPAN_SPAN | CONTAINS_SPAN_SPAN | CONTAINED_FLOATSPAN_SPAN | CONTAINS_FLOATSPAN_SPAN | TEXT_UPPER | TEXT_LOWER | TEXT_INITCAP | QUADBIN_EQ | QUADBIN_NE | QUADBIN_LT | QUADBIN_LE | QUADBIN_GT | QUADBIN_GE | QUADBIN_CMP | EVER_EQ_QUADBIN_TQUADBIN | EVER_NE_QUADBIN_TQUADBIN | ALWAYS_EQ_QUADBIN_TQUADBIN | ALWAYS_NE_QUADBIN_TQUADBIN | EVER_EQ_TQUADBIN_QUADBIN | EVER_NE_TQUADBIN_QUADBIN | ALWAYS_EQ_TQUADBIN_QUADBIN | ALWAYS_NE_TQUADBIN_QUADBIN | EVER_EQ_TQUADBIN_TQUADBIN | EVER_NE_TQUADBIN_TQUADBIN | ALWAYS_EQ_TQUADBIN_TQUADBIN | ALWAYS_NE_TQUADBIN_TQUADBIN | GEOM_RELATE_PATTERN | GEOM_INTERSECTS2D | GEOM_DWITHIN2D | GEOM_CONTAINS | GEOM_DISJOINT2D | GEOM_COVERS | GEOM_TOUCHES | GEOM_INTERSECTS3D | GEOM_DWITHIN3D | GEOM_DISTANCE2D | GEOM_DISTANCE3D | ECOVERS_TGEO_GEO | EDISJOINT_TGEO_GEO | NAD_TGEO_TGEO | ECONTAINS_TCBUFFER_TCBUFFER | ACONTAINS_TCBUFFER_TCBUFFER | EDISJOINT_TCBUFFER_TCBUFFER | EDWITHIN_TCBUFFER_CBUFFER | ADWITHIN_TCBUFFER_CBUFFER | ECOVERS_TGEO_GEO | EDISJOINT_TGEO_GEO | NAD_TGEO_TGEO | ACONTAINS_TCBUFFER_TCBUFFER | ECONTAINS_TCBUFFER_TCBUFFER | EDISJOINT_TCBUFFER_TCBUFFER | EVEREQTH3INDEXH3INDEX | EVERNETH3INDEXH3INDEX | ALWAYSEQTH3INDEXH3INDEX | ALWAYSNETH3INDEXH3INDEX | EVEREQTQUADBINQUADBIN | EVERNETQUADBINQUADBIN | ALWAYSEQTQUADBINQUADBIN | ALWAYSNETQUADBINQUADBIN | EVEREQTTEXTTEXT | EVEREQTEXTTTEXT | EVERNETTEXTTEXT | EVERNETEXTTTEXT | EVERGETTEXTTEXT | EVERGETEXTTTEXT | EVERGTTTEXTTEXT | EVERGTTEXTTTEXT | EVERLETTEXTTEXT | EVERLETEXTTTEXT | EVERLTTTEXTTEXT | EVERLTTEXTTTEXT | ALWAYSEQTTEXTTEXT | ALWAYSEQTEXTTTEXT | ALWAYSNETTEXTTEXT | ALWAYSNETEXTTTEXT | ALWAYSGETTEXTTEXT | ALWAYSGETEXTTTEXT | ALWAYSGTTTEXTTEXT | ALWAYSGTTEXTTTEXT | ALWAYSLETTEXTTEXT | ALWAYSLETEXTTTEXT | ALWAYSLTTTEXTTEXT | ALWAYSLTTEXTTTEXT | EVEREQTJSONBJSONB | EVERNETJSONBJSONB | ALWAYSEQTJSONBJSONB | ALWAYSNETJSONBJSONB | EVEREQTJSONBTJSONB | EVERNETJSONBTJSONB | ALWAYSEQTJSONBTJSONB | ALWAYSNETJSONBTJSONB | EVEREQNPOINTTNPOINT | EVEREQTNPOINTNPOINT | EVEREQTNPOINTTNPOINT | EVERNENPOINTTNPOINT | EVERNETNPOINTNPOINT | EVERNETNPOINTTNPOINT | ALWAYSEQNPOINTTNPOINT | ALWAYSEQTNPOINTNPOINT | ALWAYSEQTNPOINTTNPOINT | ALWAYSNENPOINTTNPOINT | ALWAYSNETNPOINTNPOINT | ALWAYSNETNPOINTTNPOINT | EVEREQPOSETPOSE | EVEREQTPOSEPOSE | EVEREQTPOSETPOSE | EVERNEPOSETPOSE | EVERNETPOSEPOSE | EVERNETPOSETPOSE | ALWAYSEQPOSETPOSE | ALWAYSEQTPOSEPOSE | ALWAYSEQTPOSETPOSE | ALWAYSNEPOSETPOSE | ALWAYSNETPOSEPOSE | ALWAYSNETPOSETPOSE | GEOMBOUNDARY | GEOMCENTROID | GEOMCONVEXHULL | GEOREVERSE | GEOPOINTS | GEOMUNARYUNION | GEOSRID | GEONUMGEOS | GEONUMPOINTS | GEOMLENGTH | GEOMPERIMETER | GEOMISEMPTY | GEOMAZIMUTH | GEOISUNITARY | GEOEQUALS | GEOSAME | GEOMINTERSECTS | GEOMINTERSECTS2D | GEOMINTERSECTS3D | GEOMCONTAINS | GEOMCOVERS | GEOMDISJOINT2D | GEOMTOUCHES | GEOGINTERSECTS | GEOGDISTANCE | LINELOCATEPOINT | GEOMDISTANCE2D | GEOMDISTANCE3D | GEOMDWITHIN2D | GEOMDWITHIN3D | GEOGDWITHIN | GEOMDWITHIN | GEOMINTERSECTION2D | GEOMINTERSECTION2DCOLL | GEOMDIFFERENCE2D | GEOMSHORTESTLINE2D | GEOMSHORTESTLINE3D | GEOGAREA | GEOGLENGTH | GEOGPERIMETER | GEOGTOGEOM | GEOMTOGEOG | INTSPANLOWER | INTSPANUPPER | INTSPANWIDTH | INTSPANLOWERINC | INTSPANUPPERINC | FLOATSPANLOWER | FLOATSPANUPPER | FLOATSPANWIDTH | FLOATSPANLOWERINC | FLOATSPANUPPERINC | ACONTAINS_GEO_TRGEOMETRY | ACOVERS_GEO_TRGEOMETRY | ACOVERS_TRGEOMETRY_GEO | ADISJOINT_TRGEOMETRY_GEO | ADISJOINT_TRGEOMETRY_TRGEOMETRY | ADWITHIN_TRGEOMETRY_GEO | ADWITHIN_TRGEOMETRY_TRGEOMETRY | AINTERSECTS_TRGEOMETRY_GEO | AINTERSECTS_TRGEOMETRY_TRGEOMETRY | ATOUCHES_TRGEOMETRY_GEO | ECONTAINS_GEO_TRGEOMETRY | ECOVERS_GEO_TRGEOMETRY | ECOVERS_TRGEOMETRY_GEO | EDISJOINT_TRGEOMETRY_GEO | EDISJOINT_TRGEOMETRY_TRGEOMETRY | EDWITHIN_TRGEOMETRY_GEO | EDWITHIN_TRGEOMETRY_TRGEOMETRY | EINTERSECTS_TRGEOMETRY_GEO | EINTERSECTS_TRGEOMETRY_TRGEOMETRY | ETOUCHES_TRGEOMETRY_GEO | TEMPORAL_EINTERSECTS_TPOSE_GEOMETRY | TEMPORAL_AINTERSECTS_TPOSE_GEOMETRY | TEMPORAL_ECOVERS_TPOSE_GEOMETRY | TEMPORAL_EDISJOINT_TPOSE_GEOMETRY | TEMPORAL_ADISJOINT_TPOSE_GEOMETRY | TEMPORAL_ETOUCHES_TPOSE_GEOMETRY | TEMPORAL_ATOUCHES_TPOSE_GEOMETRY | TEMPORAL_ECONTAINS_TPOSE_GEOMETRY | TEMPORAL_ACONTAINS_TPOSE_GEOMETRY | TEMPORAL_EDWITHIN_TPOSE_GEOMETRY | TEMPORAL_ADWITHIN_TPOSE_GEOMETRY | TEMPORAL_EINTERSECTS_TPOSE_TPOSE | TEMPORAL_AINTERSECTS_TPOSE_TPOSE | TEMPORAL_ECOVERS_TPOSE_TPOSE | TEMPORAL_EDISJOINT_TPOSE_TPOSE | TEMPORAL_ADISJOINT_TPOSE_TPOSE | TEMPORAL_ETOUCHES_TPOSE_TPOSE | TEMPORAL_ATOUCHES_TPOSE_TPOSE | TEMPORAL_ECONTAINS_TPOSE_TPOSE | TEMPORAL_ACONTAINS_TPOSE_TPOSE | TEMPORAL_EDWITHIN_TPOSE_TPOSE | TEMPORAL_ADWITHIN_TPOSE_TPOSE | TEMPORAL_NAD_TPOSE_GEOMETRY | TEMPORAL_NAD_TPOSE_TPOSE | TEMPORAL_EINTERSECTS_TNPOINT_GEOMETRY | TEMPORAL_AINTERSECTS_TNPOINT_GEOMETRY | TEMPORAL_ECOVERS_TNPOINT_GEOMETRY | TEMPORAL_EDISJOINT_TNPOINT_GEOMETRY | TEMPORAL_ADISJOINT_TNPOINT_GEOMETRY | TEMPORAL_ETOUCHES_TNPOINT_GEOMETRY | TEMPORAL_ATOUCHES_TNPOINT_GEOMETRY | TEMPORAL_ECONTAINS_TNPOINT_GEOMETRY | TEMPORAL_ACONTAINS_TNPOINT_GEOMETRY | TEMPORAL_EDWITHIN_TNPOINT_GEOMETRY | TEMPORAL_ADWITHIN_TNPOINT_GEOMETRY | TEMPORAL_EINTERSECTS_TNPOINT_TNPOINT | TEMPORAL_AINTERSECTS_TNPOINT_TNPOINT | TEMPORAL_ECOVERS_TNPOINT_TNPOINT | TEMPORAL_EDISJOINT_TNPOINT_TNPOINT | TEMPORAL_ADISJOINT_TNPOINT_TNPOINT | TEMPORAL_ETOUCHES_TNPOINT_TNPOINT | TEMPORAL_ATOUCHES_TNPOINT_TNPOINT | TEMPORAL_ECONTAINS_TNPOINT_TNPOINT | TEMPORAL_ACONTAINS_TNPOINT_TNPOINT | TEMPORAL_EDWITHIN_TNPOINT_TNPOINT | TEMPORAL_ADWITHIN_TNPOINT_TNPOINT | TEMPORAL_NAD_TNPOINT_GEOMETRY | TEMPORAL_NAD_TNPOINT_TNPOINT; sinkClause: INTO sink (',' sink)*; @@ -1044,6 +1044,206 @@ GEOM_INTERSECTS3D: 'GEOM_INTERSECTS3D' | 'geom_intersects3d'; GEOM_DWITHIN3D: 'GEOM_DWITHIN3D' | 'geom_dwithin3d'; GEOM_DISTANCE2D: 'GEOM_DISTANCE2D' | 'geom_distance2d'; GEOM_DISTANCE3D: 'GEOM_DISTANCE3D' | 'geom_distance3d'; +/* BEGIN CODEGEN LEXER TOKENS */ +ECOVERS_TGEO_GEO: 'ECOVERS_TGEO_GEO' | 'ecovers_tgeo_geo'; +EDISJOINT_TGEO_GEO: 'EDISJOINT_TGEO_GEO' | 'edisjoint_tgeo_geo'; +NAD_TGEO_TGEO: 'NAD_TGEO_TGEO' | 'nad_tgeo_tgeo'; +ECONTAINS_TCBUFFER_TCBUFFER: 'ECONTAINS_TCBUFFER_TCBUFFER' | 'econtains_tcbuffer_tcbuffer'; +ACONTAINS_TCBUFFER_TCBUFFER: 'ACONTAINS_TCBUFFER_TCBUFFER' | 'acontains_tcbuffer_tcbuffer'; +EDISJOINT_TCBUFFER_TCBUFFER: 'EDISJOINT_TCBUFFER_TCBUFFER' | 'edisjoint_tcbuffer_tcbuffer'; +EDWITHIN_TCBUFFER_CBUFFER: 'EDWITHIN_TCBUFFER_CBUFFER' | 'edwithin_tcbuffer_cbuffer'; +ADWITHIN_TCBUFFER_CBUFFER: 'ADWITHIN_TCBUFFER_CBUFFER' | 'adwithin_tcbuffer_cbuffer'; +ECOVERS_TGEO_GEO: 'ECOVERS_TGEO_GEO' | 'ecovers_tgeo_geo'; +EDISJOINT_TGEO_GEO: 'EDISJOINT_TGEO_GEO' | 'edisjoint_tgeo_geo'; +NAD_TGEO_TGEO: 'NAD_TGEO_TGEO' | 'nad_tgeo_tgeo'; +ACONTAINS_TCBUFFER_TCBUFFER: 'ACONTAINS_TCBUFFER_TCBUFFER' | 'acontains_tcbuffer_tcbuffer'; +ECONTAINS_TCBUFFER_TCBUFFER: 'ECONTAINS_TCBUFFER_TCBUFFER' | 'econtains_tcbuffer_tcbuffer'; +EDISJOINT_TCBUFFER_TCBUFFER: 'EDISJOINT_TCBUFFER_TCBUFFER' | 'edisjoint_tcbuffer_tcbuffer'; +EVEREQTH3INDEXH3INDEX: 'EVEREQTH3INDEXH3INDEX' | 'evereqth3indexh3index'; +EVERNETH3INDEXH3INDEX: 'EVERNETH3INDEXH3INDEX' | 'everneth3indexh3index'; +ALWAYSEQTH3INDEXH3INDEX: 'ALWAYSEQTH3INDEXH3INDEX' | 'alwayseqth3indexh3index'; +ALWAYSNETH3INDEXH3INDEX: 'ALWAYSNETH3INDEXH3INDEX' | 'alwaysneth3indexh3index'; +EVEREQTQUADBINQUADBIN: 'EVEREQTQUADBINQUADBIN' | 'evereqtquadbinquadbin'; +EVERNETQUADBINQUADBIN: 'EVERNETQUADBINQUADBIN' | 'evernetquadbinquadbin'; +ALWAYSEQTQUADBINQUADBIN: 'ALWAYSEQTQUADBINQUADBIN' | 'alwayseqtquadbinquadbin'; +ALWAYSNETQUADBINQUADBIN: 'ALWAYSNETQUADBINQUADBIN' | 'alwaysnetquadbinquadbin'; +EVEREQTTEXTTEXT: 'EVEREQTTEXTTEXT' | 'evereqttexttext'; +EVEREQTEXTTTEXT: 'EVEREQTEXTTTEXT' | 'evereqtextttext'; +EVERNETTEXTTEXT: 'EVERNETTEXTTEXT' | 'evernettexttext'; +EVERNETEXTTTEXT: 'EVERNETEXTTTEXT' | 'evernetextttext'; +EVERGETTEXTTEXT: 'EVERGETTEXTTEXT' | 'evergettexttext'; +EVERGETEXTTTEXT: 'EVERGETEXTTTEXT' | 'evergetextttext'; +EVERGTTTEXTTEXT: 'EVERGTTTEXTTEXT' | 'evergtttexttext'; +EVERGTTEXTTTEXT: 'EVERGTTEXTTTEXT' | 'evergttextttext'; +EVERLETTEXTTEXT: 'EVERLETTEXTTEXT' | 'everlettexttext'; +EVERLETEXTTTEXT: 'EVERLETEXTTTEXT' | 'everletextttext'; +EVERLTTTEXTTEXT: 'EVERLTTTEXTTEXT' | 'everltttexttext'; +EVERLTTEXTTTEXT: 'EVERLTTEXTTTEXT' | 'everlttextttext'; +ALWAYSEQTTEXTTEXT: 'ALWAYSEQTTEXTTEXT' | 'alwayseqttexttext'; +ALWAYSEQTEXTTTEXT: 'ALWAYSEQTEXTTTEXT' | 'alwayseqtextttext'; +ALWAYSNETTEXTTEXT: 'ALWAYSNETTEXTTEXT' | 'alwaysnettexttext'; +ALWAYSNETEXTTTEXT: 'ALWAYSNETEXTTTEXT' | 'alwaysnetextttext'; +ALWAYSGETTEXTTEXT: 'ALWAYSGETTEXTTEXT' | 'alwaysgettexttext'; +ALWAYSGETEXTTTEXT: 'ALWAYSGETEXTTTEXT' | 'alwaysgetextttext'; +ALWAYSGTTTEXTTEXT: 'ALWAYSGTTTEXTTEXT' | 'alwaysgtttexttext'; +ALWAYSGTTEXTTTEXT: 'ALWAYSGTTEXTTTEXT' | 'alwaysgttextttext'; +ALWAYSLETTEXTTEXT: 'ALWAYSLETTEXTTEXT' | 'alwayslettexttext'; +ALWAYSLETEXTTTEXT: 'ALWAYSLETEXTTTEXT' | 'alwaysletextttext'; +ALWAYSLTTTEXTTEXT: 'ALWAYSLTTTEXTTEXT' | 'alwaysltttexttext'; +ALWAYSLTTEXTTTEXT: 'ALWAYSLTTEXTTTEXT' | 'alwayslttextttext'; +EVEREQTJSONBJSONB: 'EVEREQTJSONBJSONB' | 'evereqtjsonbjsonb'; +EVERNETJSONBJSONB: 'EVERNETJSONBJSONB' | 'evernetjsonbjsonb'; +ALWAYSEQTJSONBJSONB: 'ALWAYSEQTJSONBJSONB' | 'alwayseqtjsonbjsonb'; +ALWAYSNETJSONBJSONB: 'ALWAYSNETJSONBJSONB' | 'alwaysnetjsonbjsonb'; +EVEREQTJSONBTJSONB: 'EVEREQTJSONBTJSONB' | 'evereqtjsonbtjsonb'; +EVERNETJSONBTJSONB: 'EVERNETJSONBTJSONB' | 'evernetjsonbtjsonb'; +ALWAYSEQTJSONBTJSONB: 'ALWAYSEQTJSONBTJSONB' | 'alwayseqtjsonbtjsonb'; +ALWAYSNETJSONBTJSONB: 'ALWAYSNETJSONBTJSONB' | 'alwaysnetjsonbtjsonb'; +EVEREQNPOINTTNPOINT: 'EVEREQNPOINTTNPOINT' | 'evereqnpointtnpoint'; +EVEREQTNPOINTNPOINT: 'EVEREQTNPOINTNPOINT' | 'evereqtnpointnpoint'; +EVEREQTNPOINTTNPOINT: 'EVEREQTNPOINTTNPOINT' | 'evereqtnpointtnpoint'; +EVERNENPOINTTNPOINT: 'EVERNENPOINTTNPOINT' | 'evernenpointtnpoint'; +EVERNETNPOINTNPOINT: 'EVERNETNPOINTNPOINT' | 'evernetnpointnpoint'; +EVERNETNPOINTTNPOINT: 'EVERNETNPOINTTNPOINT' | 'evernetnpointtnpoint'; +ALWAYSEQNPOINTTNPOINT: 'ALWAYSEQNPOINTTNPOINT' | 'alwayseqnpointtnpoint'; +ALWAYSEQTNPOINTNPOINT: 'ALWAYSEQTNPOINTNPOINT' | 'alwayseqtnpointnpoint'; +ALWAYSEQTNPOINTTNPOINT: 'ALWAYSEQTNPOINTTNPOINT' | 'alwayseqtnpointtnpoint'; +ALWAYSNENPOINTTNPOINT: 'ALWAYSNENPOINTTNPOINT' | 'alwaysnenpointtnpoint'; +ALWAYSNETNPOINTNPOINT: 'ALWAYSNETNPOINTNPOINT' | 'alwaysnetnpointnpoint'; +ALWAYSNETNPOINTTNPOINT: 'ALWAYSNETNPOINTTNPOINT' | 'alwaysnetnpointtnpoint'; +EVEREQPOSETPOSE: 'EVEREQPOSETPOSE' | 'evereqposetpose'; +EVEREQTPOSEPOSE: 'EVEREQTPOSEPOSE' | 'evereqtposepose'; +EVEREQTPOSETPOSE: 'EVEREQTPOSETPOSE' | 'evereqtposetpose'; +EVERNEPOSETPOSE: 'EVERNEPOSETPOSE' | 'everneposetpose'; +EVERNETPOSEPOSE: 'EVERNETPOSEPOSE' | 'evernetposepose'; +EVERNETPOSETPOSE: 'EVERNETPOSETPOSE' | 'evernetposetpose'; +ALWAYSEQPOSETPOSE: 'ALWAYSEQPOSETPOSE' | 'alwayseqposetpose'; +ALWAYSEQTPOSEPOSE: 'ALWAYSEQTPOSEPOSE' | 'alwayseqtposepose'; +ALWAYSEQTPOSETPOSE: 'ALWAYSEQTPOSETPOSE' | 'alwayseqtposetpose'; +ALWAYSNEPOSETPOSE: 'ALWAYSNEPOSETPOSE' | 'alwaysneposetpose'; +ALWAYSNETPOSEPOSE: 'ALWAYSNETPOSEPOSE' | 'alwaysnetposepose'; +ALWAYSNETPOSETPOSE: 'ALWAYSNETPOSETPOSE' | 'alwaysnetposetpose'; +GEOMBOUNDARY: 'GEOMBOUNDARY' | 'geomboundary'; +GEOMCENTROID: 'GEOMCENTROID' | 'geomcentroid'; +GEOMCONVEXHULL: 'GEOMCONVEXHULL' | 'geomconvexhull'; +GEOREVERSE: 'GEOREVERSE' | 'georeverse'; +GEOPOINTS: 'GEOPOINTS' | 'geopoints'; +GEOMUNARYUNION: 'GEOMUNARYUNION' | 'geomunaryunion'; +GEOSRID: 'GEOSRID' | 'geosrid'; +GEONUMGEOS: 'GEONUMGEOS' | 'geonumgeos'; +GEONUMPOINTS: 'GEONUMPOINTS' | 'geonumpoints'; +GEOMLENGTH: 'GEOMLENGTH' | 'geomlength'; +GEOMPERIMETER: 'GEOMPERIMETER' | 'geomperimeter'; +GEOMISEMPTY: 'GEOMISEMPTY' | 'geomisempty'; +GEOMAZIMUTH: 'GEOMAZIMUTH' | 'geomazimuth'; +GEOISUNITARY: 'GEOISUNITARY' | 'geoisunitary'; +GEOEQUALS: 'GEOEQUALS' | 'geoequals'; +GEOSAME: 'GEOSAME' | 'geosame'; +GEOMINTERSECTS: 'GEOMINTERSECTS' | 'geomintersects'; +GEOMINTERSECTS2D: 'GEOMINTERSECTS2D' | 'geomintersects2d'; +GEOMINTERSECTS3D: 'GEOMINTERSECTS3D' | 'geomintersects3d'; +GEOMCONTAINS: 'GEOMCONTAINS' | 'geomcontains'; +GEOMCOVERS: 'GEOMCOVERS' | 'geomcovers'; +GEOMDISJOINT2D: 'GEOMDISJOINT2D' | 'geomdisjoint2d'; +GEOMTOUCHES: 'GEOMTOUCHES' | 'geomtouches'; +GEOGINTERSECTS: 'GEOGINTERSECTS' | 'geogintersects'; +GEOGDISTANCE: 'GEOGDISTANCE' | 'geogdistance'; +LINELOCATEPOINT: 'LINELOCATEPOINT' | 'linelocatepoint'; +GEOMDISTANCE2D: 'GEOMDISTANCE2D' | 'geomdistance2d'; +GEOMDISTANCE3D: 'GEOMDISTANCE3D' | 'geomdistance3d'; +GEOMDWITHIN2D: 'GEOMDWITHIN2D' | 'geomdwithin2d'; +GEOMDWITHIN3D: 'GEOMDWITHIN3D' | 'geomdwithin3d'; +GEOGDWITHIN: 'GEOGDWITHIN' | 'geogdwithin'; +GEOMDWITHIN: 'GEOMDWITHIN' | 'geomdwithin'; +GEOMINTERSECTION2D: 'GEOMINTERSECTION2D' | 'geomintersection2d'; +GEOMINTERSECTION2DCOLL: 'GEOMINTERSECTION2DCOLL' | 'geomintersection2dcoll'; +GEOMDIFFERENCE2D: 'GEOMDIFFERENCE2D' | 'geomdifference2d'; +GEOMSHORTESTLINE2D: 'GEOMSHORTESTLINE2D' | 'geomshortestline2d'; +GEOMSHORTESTLINE3D: 'GEOMSHORTESTLINE3D' | 'geomshortestline3d'; +GEOGAREA: 'GEOGAREA' | 'geogarea'; +GEOGLENGTH: 'GEOGLENGTH' | 'geoglength'; +GEOGPERIMETER: 'GEOGPERIMETER' | 'geogperimeter'; +GEOGTOGEOM: 'GEOGTOGEOM' | 'geogtogeom'; +GEOMTOGEOG: 'GEOMTOGEOG' | 'geomtogeog'; +INTSPANLOWER: 'INTSPANLOWER' | 'intspanlower'; +INTSPANUPPER: 'INTSPANUPPER' | 'intspanupper'; +INTSPANWIDTH: 'INTSPANWIDTH' | 'intspanwidth'; +INTSPANLOWERINC: 'INTSPANLOWERINC' | 'intspanlowerinc'; +INTSPANUPPERINC: 'INTSPANUPPERINC' | 'intspanupperinc'; +FLOATSPANLOWER: 'FLOATSPANLOWER' | 'floatspanlower'; +FLOATSPANUPPER: 'FLOATSPANUPPER' | 'floatspanupper'; +FLOATSPANWIDTH: 'FLOATSPANWIDTH' | 'floatspanwidth'; +FLOATSPANLOWERINC: 'FLOATSPANLOWERINC' | 'floatspanlowerinc'; +FLOATSPANUPPERINC: 'FLOATSPANUPPERINC' | 'floatspanupperinc'; +ACONTAINS_GEO_TRGEOMETRY: 'ACONTAINS_GEO_TRGEOMETRY' | 'acontains_geo_trgeometry'; +ACOVERS_GEO_TRGEOMETRY: 'ACOVERS_GEO_TRGEOMETRY' | 'acovers_geo_trgeometry'; +ACOVERS_TRGEOMETRY_GEO: 'ACOVERS_TRGEOMETRY_GEO' | 'acovers_trgeometry_geo'; +ADISJOINT_TRGEOMETRY_GEO: 'ADISJOINT_TRGEOMETRY_GEO' | 'adisjoint_trgeometry_geo'; +ADISJOINT_TRGEOMETRY_TRGEOMETRY: 'ADISJOINT_TRGEOMETRY_TRGEOMETRY' | 'adisjoint_trgeometry_trgeometry'; +ADWITHIN_TRGEOMETRY_GEO: 'ADWITHIN_TRGEOMETRY_GEO' | 'adwithin_trgeometry_geo'; +ADWITHIN_TRGEOMETRY_TRGEOMETRY: 'ADWITHIN_TRGEOMETRY_TRGEOMETRY' | 'adwithin_trgeometry_trgeometry'; +AINTERSECTS_TRGEOMETRY_GEO: 'AINTERSECTS_TRGEOMETRY_GEO' | 'aintersects_trgeometry_geo'; +AINTERSECTS_TRGEOMETRY_TRGEOMETRY: 'AINTERSECTS_TRGEOMETRY_TRGEOMETRY' | 'aintersects_trgeometry_trgeometry'; +ATOUCHES_TRGEOMETRY_GEO: 'ATOUCHES_TRGEOMETRY_GEO' | 'atouches_trgeometry_geo'; +ECONTAINS_GEO_TRGEOMETRY: 'ECONTAINS_GEO_TRGEOMETRY' | 'econtains_geo_trgeometry'; +ECOVERS_GEO_TRGEOMETRY: 'ECOVERS_GEO_TRGEOMETRY' | 'ecovers_geo_trgeometry'; +ECOVERS_TRGEOMETRY_GEO: 'ECOVERS_TRGEOMETRY_GEO' | 'ecovers_trgeometry_geo'; +EDISJOINT_TRGEOMETRY_GEO: 'EDISJOINT_TRGEOMETRY_GEO' | 'edisjoint_trgeometry_geo'; +EDISJOINT_TRGEOMETRY_TRGEOMETRY: 'EDISJOINT_TRGEOMETRY_TRGEOMETRY' | 'edisjoint_trgeometry_trgeometry'; +EDWITHIN_TRGEOMETRY_GEO: 'EDWITHIN_TRGEOMETRY_GEO' | 'edwithin_trgeometry_geo'; +EDWITHIN_TRGEOMETRY_TRGEOMETRY: 'EDWITHIN_TRGEOMETRY_TRGEOMETRY' | 'edwithin_trgeometry_trgeometry'; +EINTERSECTS_TRGEOMETRY_GEO: 'EINTERSECTS_TRGEOMETRY_GEO' | 'eintersects_trgeometry_geo'; +EINTERSECTS_TRGEOMETRY_TRGEOMETRY: 'EINTERSECTS_TRGEOMETRY_TRGEOMETRY' | 'eintersects_trgeometry_trgeometry'; +ETOUCHES_TRGEOMETRY_GEO: 'ETOUCHES_TRGEOMETRY_GEO' | 'etouches_trgeometry_geo'; +TEMPORAL_EINTERSECTS_TPOSE_GEOMETRY: 'TEMPORAL_EINTERSECTS_TPOSE_GEOMETRY' | 'temporal_eintersects_tpose_geometry'; +TEMPORAL_AINTERSECTS_TPOSE_GEOMETRY: 'TEMPORAL_AINTERSECTS_TPOSE_GEOMETRY' | 'temporal_aintersects_tpose_geometry'; +TEMPORAL_ECOVERS_TPOSE_GEOMETRY: 'TEMPORAL_ECOVERS_TPOSE_GEOMETRY' | 'temporal_ecovers_tpose_geometry'; +TEMPORAL_EDISJOINT_TPOSE_GEOMETRY: 'TEMPORAL_EDISJOINT_TPOSE_GEOMETRY' | 'temporal_edisjoint_tpose_geometry'; +TEMPORAL_ADISJOINT_TPOSE_GEOMETRY: 'TEMPORAL_ADISJOINT_TPOSE_GEOMETRY' | 'temporal_adisjoint_tpose_geometry'; +TEMPORAL_ETOUCHES_TPOSE_GEOMETRY: 'TEMPORAL_ETOUCHES_TPOSE_GEOMETRY' | 'temporal_etouches_tpose_geometry'; +TEMPORAL_ATOUCHES_TPOSE_GEOMETRY: 'TEMPORAL_ATOUCHES_TPOSE_GEOMETRY' | 'temporal_atouches_tpose_geometry'; +TEMPORAL_ECONTAINS_TPOSE_GEOMETRY: 'TEMPORAL_ECONTAINS_TPOSE_GEOMETRY' | 'temporal_econtains_tpose_geometry'; +TEMPORAL_ACONTAINS_TPOSE_GEOMETRY: 'TEMPORAL_ACONTAINS_TPOSE_GEOMETRY' | 'temporal_acontains_tpose_geometry'; +TEMPORAL_EDWITHIN_TPOSE_GEOMETRY: 'TEMPORAL_EDWITHIN_TPOSE_GEOMETRY' | 'temporal_edwithin_tpose_geometry'; +TEMPORAL_ADWITHIN_TPOSE_GEOMETRY: 'TEMPORAL_ADWITHIN_TPOSE_GEOMETRY' | 'temporal_adwithin_tpose_geometry'; +TEMPORAL_EINTERSECTS_TPOSE_TPOSE: 'TEMPORAL_EINTERSECTS_TPOSE_TPOSE' | 'temporal_eintersects_tpose_tpose'; +TEMPORAL_AINTERSECTS_TPOSE_TPOSE: 'TEMPORAL_AINTERSECTS_TPOSE_TPOSE' | 'temporal_aintersects_tpose_tpose'; +TEMPORAL_ECOVERS_TPOSE_TPOSE: 'TEMPORAL_ECOVERS_TPOSE_TPOSE' | 'temporal_ecovers_tpose_tpose'; +TEMPORAL_EDISJOINT_TPOSE_TPOSE: 'TEMPORAL_EDISJOINT_TPOSE_TPOSE' | 'temporal_edisjoint_tpose_tpose'; +TEMPORAL_ADISJOINT_TPOSE_TPOSE: 'TEMPORAL_ADISJOINT_TPOSE_TPOSE' | 'temporal_adisjoint_tpose_tpose'; +TEMPORAL_ETOUCHES_TPOSE_TPOSE: 'TEMPORAL_ETOUCHES_TPOSE_TPOSE' | 'temporal_etouches_tpose_tpose'; +TEMPORAL_ATOUCHES_TPOSE_TPOSE: 'TEMPORAL_ATOUCHES_TPOSE_TPOSE' | 'temporal_atouches_tpose_tpose'; +TEMPORAL_ECONTAINS_TPOSE_TPOSE: 'TEMPORAL_ECONTAINS_TPOSE_TPOSE' | 'temporal_econtains_tpose_tpose'; +TEMPORAL_ACONTAINS_TPOSE_TPOSE: 'TEMPORAL_ACONTAINS_TPOSE_TPOSE' | 'temporal_acontains_tpose_tpose'; +TEMPORAL_EDWITHIN_TPOSE_TPOSE: 'TEMPORAL_EDWITHIN_TPOSE_TPOSE' | 'temporal_edwithin_tpose_tpose'; +TEMPORAL_ADWITHIN_TPOSE_TPOSE: 'TEMPORAL_ADWITHIN_TPOSE_TPOSE' | 'temporal_adwithin_tpose_tpose'; +TEMPORAL_NAD_TPOSE_GEOMETRY: 'TEMPORAL_NAD_TPOSE_GEOMETRY' | 'temporal_nad_tpose_geometry'; +TEMPORAL_NAD_TPOSE_TPOSE: 'TEMPORAL_NAD_TPOSE_TPOSE' | 'temporal_nad_tpose_tpose'; +TEMPORAL_EINTERSECTS_TNPOINT_GEOMETRY: 'TEMPORAL_EINTERSECTS_TNPOINT_GEOMETRY' | 'temporal_eintersects_tnpoint_geometry'; +TEMPORAL_AINTERSECTS_TNPOINT_GEOMETRY: 'TEMPORAL_AINTERSECTS_TNPOINT_GEOMETRY' | 'temporal_aintersects_tnpoint_geometry'; +TEMPORAL_ECOVERS_TNPOINT_GEOMETRY: 'TEMPORAL_ECOVERS_TNPOINT_GEOMETRY' | 'temporal_ecovers_tnpoint_geometry'; +TEMPORAL_EDISJOINT_TNPOINT_GEOMETRY: 'TEMPORAL_EDISJOINT_TNPOINT_GEOMETRY' | 'temporal_edisjoint_tnpoint_geometry'; +TEMPORAL_ADISJOINT_TNPOINT_GEOMETRY: 'TEMPORAL_ADISJOINT_TNPOINT_GEOMETRY' | 'temporal_adisjoint_tnpoint_geometry'; +TEMPORAL_ETOUCHES_TNPOINT_GEOMETRY: 'TEMPORAL_ETOUCHES_TNPOINT_GEOMETRY' | 'temporal_etouches_tnpoint_geometry'; +TEMPORAL_ATOUCHES_TNPOINT_GEOMETRY: 'TEMPORAL_ATOUCHES_TNPOINT_GEOMETRY' | 'temporal_atouches_tnpoint_geometry'; +TEMPORAL_ECONTAINS_TNPOINT_GEOMETRY: 'TEMPORAL_ECONTAINS_TNPOINT_GEOMETRY' | 'temporal_econtains_tnpoint_geometry'; +TEMPORAL_ACONTAINS_TNPOINT_GEOMETRY: 'TEMPORAL_ACONTAINS_TNPOINT_GEOMETRY' | 'temporal_acontains_tnpoint_geometry'; +TEMPORAL_EDWITHIN_TNPOINT_GEOMETRY: 'TEMPORAL_EDWITHIN_TNPOINT_GEOMETRY' | 'temporal_edwithin_tnpoint_geometry'; +TEMPORAL_ADWITHIN_TNPOINT_GEOMETRY: 'TEMPORAL_ADWITHIN_TNPOINT_GEOMETRY' | 'temporal_adwithin_tnpoint_geometry'; +TEMPORAL_EINTERSECTS_TNPOINT_TNPOINT: 'TEMPORAL_EINTERSECTS_TNPOINT_TNPOINT' | 'temporal_eintersects_tnpoint_tnpoint'; +TEMPORAL_AINTERSECTS_TNPOINT_TNPOINT: 'TEMPORAL_AINTERSECTS_TNPOINT_TNPOINT' | 'temporal_aintersects_tnpoint_tnpoint'; +TEMPORAL_ECOVERS_TNPOINT_TNPOINT: 'TEMPORAL_ECOVERS_TNPOINT_TNPOINT' | 'temporal_ecovers_tnpoint_tnpoint'; +TEMPORAL_EDISJOINT_TNPOINT_TNPOINT: 'TEMPORAL_EDISJOINT_TNPOINT_TNPOINT' | 'temporal_edisjoint_tnpoint_tnpoint'; +TEMPORAL_ADISJOINT_TNPOINT_TNPOINT: 'TEMPORAL_ADISJOINT_TNPOINT_TNPOINT' | 'temporal_adisjoint_tnpoint_tnpoint'; +TEMPORAL_ETOUCHES_TNPOINT_TNPOINT: 'TEMPORAL_ETOUCHES_TNPOINT_TNPOINT' | 'temporal_etouches_tnpoint_tnpoint'; +TEMPORAL_ATOUCHES_TNPOINT_TNPOINT: 'TEMPORAL_ATOUCHES_TNPOINT_TNPOINT' | 'temporal_atouches_tnpoint_tnpoint'; +TEMPORAL_ECONTAINS_TNPOINT_TNPOINT: 'TEMPORAL_ECONTAINS_TNPOINT_TNPOINT' | 'temporal_econtains_tnpoint_tnpoint'; +TEMPORAL_ACONTAINS_TNPOINT_TNPOINT: 'TEMPORAL_ACONTAINS_TNPOINT_TNPOINT' | 'temporal_acontains_tnpoint_tnpoint'; +TEMPORAL_EDWITHIN_TNPOINT_TNPOINT: 'TEMPORAL_EDWITHIN_TNPOINT_TNPOINT' | 'temporal_edwithin_tnpoint_tnpoint'; +TEMPORAL_ADWITHIN_TNPOINT_TNPOINT: 'TEMPORAL_ADWITHIN_TNPOINT_TNPOINT' | 'temporal_adwithin_tnpoint_tnpoint'; +TEMPORAL_NAD_TNPOINT_GEOMETRY: 'TEMPORAL_NAD_TNPOINT_GEOMETRY' | 'temporal_nad_tnpoint_geometry'; +TEMPORAL_NAD_TNPOINT_TNPOINT: 'TEMPORAL_NAD_TNPOINT_TNPOINT' | 'temporal_nad_tnpoint_tnpoint'; +/* END CODEGEN LEXER TOKENS */ WATERMARK: 'WATERMARK' | 'watermark'; OFFSET: 'OFFSET' | 'offset'; LOCALHOST: 'LOCALHOST' | 'localhost'; diff --git a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp index 93f08c119f..8a892f29d1 100644 --- a/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp +++ b/nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp @@ -625,6 +625,102 @@ #include #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include @@ -12486,6 +12582,5409 @@ void AntlrSQLQueryPlanCreator::exitFunctionCall(AntlrSQLParser::FunctionCallCont } break; /* END CODEGEN PARSER GLUE: ALWAYS_NE_TFLOAT_TFLOAT */ + /* BEGIN CODEGEN PARSER GLUE: ECOVERS_TGEO_GEO */ + case AntlrSQLLexer::ECOVERS_TGEO_GEO: + { + const auto argCount = context->expression().size(); + if (argCount != 4) + throw InvalidQuerySyntax("ECOVERS_TGEO_GEO requires exactly 4 arguments (lon, lat, timestamp, geometry), but got {}", argCount); + + /* Lift the WKT constant into the function builder */ + while (!helpers.top().constantBuilder.empty()) + { + auto v = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + helpers.top().functionBuilder.emplace_back( + ConstantValueLogicalFunction( + DataTypeProvider::provideDataType(DataType::Type::VARSIZED), std::move(v))); + } + + auto geometry = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto timestamp = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lat = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lon = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back( + EcoversTgeoGeoLogicalFunction(lon, lat, timestamp, geometry)); + } + break; + /* END CODEGEN PARSER GLUE: ECOVERS_TGEO_GEO */ + + /* BEGIN CODEGEN PARSER GLUE: EDISJOINT_TGEO_GEO */ + case AntlrSQLLexer::EDISJOINT_TGEO_GEO: + { + const auto argCount = context->expression().size(); + if (argCount != 4) + throw InvalidQuerySyntax("EDISJOINT_TGEO_GEO requires exactly 4 arguments (lon, lat, timestamp, geometry), but got {}", argCount); + + /* Lift the WKT constant into the function builder */ + while (!helpers.top().constantBuilder.empty()) + { + auto v = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + helpers.top().functionBuilder.emplace_back( + ConstantValueLogicalFunction( + DataTypeProvider::provideDataType(DataType::Type::VARSIZED), std::move(v))); + } + + auto geometry = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto timestamp = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lat = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lon = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back( + EdisjointTgeoGeoLogicalFunction(lon, lat, timestamp, geometry)); + } + break; + /* END CODEGEN PARSER GLUE: EDISJOINT_TGEO_GEO */ + + /* BEGIN CODEGEN PARSER GLUE: NAD_TGEO_TGEO */ + case AntlrSQLLexer::NAD_TGEO_TGEO: + { + const auto argCount = context->expression().size(); + if (argCount != 6) + throw InvalidQuerySyntax("NAD_TGEO_TGEO requires exactly 6 arguments (lonA, latA, tsA, lonB, latB, tsB), but got {}", argCount); + + auto tsB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto latB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lonB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto tsA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto latA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lonA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back( + NadTgeoTgeoLogicalFunction(lonA, latA, tsA, lonB, latB, tsB)); + } + break; + /* END CODEGEN PARSER GLUE: NAD_TGEO_TGEO */ + + /* BEGIN CODEGEN PARSER GLUE: ECONTAINS_TCBUFFER_TCBUFFER */ + case AntlrSQLLexer::ECONTAINS_TCBUFFER_TCBUFFER: + { + const auto argCount = context->expression().size(); + if (argCount != 8) + throw InvalidQuerySyntax("ECONTAINS_TCBUFFER_TCBUFFER requires exactly 8 arguments (lonA, latA, radiusA, tsA, lonB, latB, radiusB, tsB), but got {}", argCount); + + auto tsB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto radiusB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto latB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lonB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto tsA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto radiusA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto latA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lonA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back( + EcontainsTcbufferTcbufferLogicalFunction(lonA, latA, radiusA, tsA, lonB, latB, radiusB, tsB)); + } + break; + /* END CODEGEN PARSER GLUE: ECONTAINS_TCBUFFER_TCBUFFER */ + + /* BEGIN CODEGEN PARSER GLUE: ACONTAINS_TCBUFFER_TCBUFFER */ + case AntlrSQLLexer::ACONTAINS_TCBUFFER_TCBUFFER: + { + const auto argCount = context->expression().size(); + if (argCount != 8) + throw InvalidQuerySyntax("ACONTAINS_TCBUFFER_TCBUFFER requires exactly 8 arguments (lonA, latA, radiusA, tsA, lonB, latB, radiusB, tsB), but got {}", argCount); + + auto tsB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto radiusB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto latB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lonB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto tsA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto radiusA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto latA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lonA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back( + AcontainsTcbufferTcbufferLogicalFunction(lonA, latA, radiusA, tsA, lonB, latB, radiusB, tsB)); + } + break; + /* END CODEGEN PARSER GLUE: ACONTAINS_TCBUFFER_TCBUFFER */ + + /* BEGIN CODEGEN PARSER GLUE: EDISJOINT_TCBUFFER_TCBUFFER */ + case AntlrSQLLexer::EDISJOINT_TCBUFFER_TCBUFFER: + { + const auto argCount = context->expression().size(); + if (argCount != 8) + throw InvalidQuerySyntax("EDISJOINT_TCBUFFER_TCBUFFER requires exactly 8 arguments (lonA, latA, radiusA, tsA, lonB, latB, radiusB, tsB), but got {}", argCount); + + auto tsB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto radiusB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto latB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lonB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto tsA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto radiusA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto latA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lonA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back( + EdisjointTcbufferTcbufferLogicalFunction(lonA, latA, radiusA, tsA, lonB, latB, radiusB, tsB)); + } + break; + /* END CODEGEN PARSER GLUE: EDISJOINT_TCBUFFER_TCBUFFER */ + + /* BEGIN CODEGEN PARSER GLUE: EDWITHIN_TCBUFFER_CBUFFER */ + case AntlrSQLLexer::EDWITHIN_TCBUFFER_CBUFFER: + { + const auto argCount = context->expression().size(); + if (argCount != 6) + throw InvalidQuerySyntax("EDWITHIN_TCBUFFER_CBUFFER requires exactly 6 arguments (lon, lat, radius, timestamp, blob, distance), but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto blobLast = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto distLast = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto timestamp = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto radius = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lat = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lon = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back( + EdwithinTcbufferCbufferLogicalFunction(lon, lat, radius, timestamp, blobLast, distLast)); + } + break; + /* END CODEGEN PARSER GLUE: EDWITHIN_TCBUFFER_CBUFFER */ + + /* BEGIN CODEGEN PARSER GLUE: ADWITHIN_TCBUFFER_CBUFFER */ + case AntlrSQLLexer::ADWITHIN_TCBUFFER_CBUFFER: + { + const auto argCount = context->expression().size(); + if (argCount != 6) + throw InvalidQuerySyntax("ADWITHIN_TCBUFFER_CBUFFER requires exactly 6 arguments (lon, lat, radius, timestamp, blob, distance), but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto blobLast = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto distLast = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto timestamp = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto radius = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lat = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lon = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back( + AdwithinTcbufferCbufferLogicalFunction(lon, lat, radius, timestamp, blobLast, distLast)); + } + break; + /* END CODEGEN PARSER GLUE: ADWITHIN_TCBUFFER_CBUFFER */ + + /* BEGIN CODEGEN PARSER GLUE: ECOVERS_TGEO_GEO */ + case AntlrSQLLexer::ECOVERS_TGEO_GEO: + { + const auto argCount = context->expression().size(); + if (argCount != 4) + throw InvalidQuerySyntax("ECOVERS_TGEO_GEO requires exactly 4 arguments (lon, lat, timestamp, geometry), but got {}", argCount); + + /* Lift the WKT constant into the function builder */ + while (!helpers.top().constantBuilder.empty()) + { + auto v = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + helpers.top().functionBuilder.emplace_back( + ConstantValueLogicalFunction( + DataTypeProvider::provideDataType(DataType::Type::VARSIZED), std::move(v))); + } + + auto geometry = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto timestamp = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lat = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lon = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back( + EcoversTgeoGeoLogicalFunction(lon, lat, timestamp, geometry)); + } + break; + /* END CODEGEN PARSER GLUE: ECOVERS_TGEO_GEO */ + + /* BEGIN CODEGEN PARSER GLUE: EDISJOINT_TGEO_GEO */ + case AntlrSQLLexer::EDISJOINT_TGEO_GEO: + { + const auto argCount = context->expression().size(); + if (argCount != 4) + throw InvalidQuerySyntax("EDISJOINT_TGEO_GEO requires exactly 4 arguments (lon, lat, timestamp, geometry), but got {}", argCount); + + /* Lift the WKT constant into the function builder */ + while (!helpers.top().constantBuilder.empty()) + { + auto v = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + helpers.top().functionBuilder.emplace_back( + ConstantValueLogicalFunction( + DataTypeProvider::provideDataType(DataType::Type::VARSIZED), std::move(v))); + } + + auto geometry = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto timestamp = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lat = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lon = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back( + EdisjointTgeoGeoLogicalFunction(lon, lat, timestamp, geometry)); + } + break; + /* END CODEGEN PARSER GLUE: EDISJOINT_TGEO_GEO */ + + /* BEGIN CODEGEN PARSER GLUE: NAD_TGEO_TGEO */ + case AntlrSQLLexer::NAD_TGEO_TGEO: + { + const auto argCount = context->expression().size(); + if (argCount != 6) + throw InvalidQuerySyntax("NAD_TGEO_TGEO requires exactly 6 arguments (lonA, latA, tsA, lonB, latB, tsB), but got {}", argCount); + + auto tsB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto latB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lonB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto tsA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto latA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lonA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back( + NadTgeoTgeoLogicalFunction(lonA, latA, tsA, lonB, latB, tsB)); + } + break; + /* END CODEGEN PARSER GLUE: NAD_TGEO_TGEO */ + + /* BEGIN CODEGEN PARSER GLUE: ACONTAINS_TCBUFFER_TCBUFFER */ + case AntlrSQLLexer::ACONTAINS_TCBUFFER_TCBUFFER: + { + const auto argCount = context->expression().size(); + if (argCount != 8) + throw InvalidQuerySyntax("ACONTAINS_TCBUFFER_TCBUFFER requires exactly 8 arguments (lonA, latA, radiusA, tsA, lonB, latB, radiusB, tsB), but got {}", argCount); + + auto tsB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto radiusB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto latB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lonB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto tsA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto radiusA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto latA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lonA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back( + AcontainsTcbufferTcbufferLogicalFunction(lonA, latA, radiusA, tsA, lonB, latB, radiusB, tsB)); + } + break; + /* END CODEGEN PARSER GLUE: ACONTAINS_TCBUFFER_TCBUFFER */ + + /* BEGIN CODEGEN PARSER GLUE: ECONTAINS_TCBUFFER_TCBUFFER */ + case AntlrSQLLexer::ECONTAINS_TCBUFFER_TCBUFFER: + { + const auto argCount = context->expression().size(); + if (argCount != 8) + throw InvalidQuerySyntax("ECONTAINS_TCBUFFER_TCBUFFER requires exactly 8 arguments (lonA, latA, radiusA, tsA, lonB, latB, radiusB, tsB), but got {}", argCount); + + auto tsB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto radiusB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto latB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lonB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto tsA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto radiusA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto latA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lonA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back( + EcontainsTcbufferTcbufferLogicalFunction(lonA, latA, radiusA, tsA, lonB, latB, radiusB, tsB)); + } + break; + /* END CODEGEN PARSER GLUE: ECONTAINS_TCBUFFER_TCBUFFER */ + + /* BEGIN CODEGEN PARSER GLUE: EDISJOINT_TCBUFFER_TCBUFFER */ + case AntlrSQLLexer::EDISJOINT_TCBUFFER_TCBUFFER: + { + const auto argCount = context->expression().size(); + if (argCount != 8) + throw InvalidQuerySyntax("EDISJOINT_TCBUFFER_TCBUFFER requires exactly 8 arguments (lonA, latA, radiusA, tsA, lonB, latB, radiusB, tsB), but got {}", argCount); + + auto tsB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto radiusB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto latB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lonB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto tsA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto radiusA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto latA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lonA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back( + EdisjointTcbufferTcbufferLogicalFunction(lonA, latA, radiusA, tsA, lonB, latB, radiusB, tsB)); + } + break; + /* END CODEGEN PARSER GLUE: EDISJOINT_TCBUFFER_TCBUFFER */ + + /* BEGIN CODEGEN PARSER GLUE: EVEREQTH3INDEXH3INDEX */ + case AntlrSQLLexer::EVEREQTH3INDEXH3INDEX: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("EVEREQTH3INDEXH3INDEX requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverEqTh3indexH3indexLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: EVEREQTH3INDEXH3INDEX */ + + /* BEGIN CODEGEN PARSER GLUE: EVERNETH3INDEXH3INDEX */ + case AntlrSQLLexer::EVERNETH3INDEXH3INDEX: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("EVERNETH3INDEXH3INDEX requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverNeTh3indexH3indexLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: EVERNETH3INDEXH3INDEX */ + + /* BEGIN CODEGEN PARSER GLUE: ALWAYSEQTH3INDEXH3INDEX */ + case AntlrSQLLexer::ALWAYSEQTH3INDEXH3INDEX: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("ALWAYSEQTH3INDEXH3INDEX requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AlwaysEqTh3indexH3indexLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: ALWAYSEQTH3INDEXH3INDEX */ + + /* BEGIN CODEGEN PARSER GLUE: ALWAYSNETH3INDEXH3INDEX */ + case AntlrSQLLexer::ALWAYSNETH3INDEXH3INDEX: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("ALWAYSNETH3INDEXH3INDEX requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AlwaysNeTh3indexH3indexLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: ALWAYSNETH3INDEXH3INDEX */ + + /* BEGIN CODEGEN PARSER GLUE: EVEREQTQUADBINQUADBIN */ + case AntlrSQLLexer::EVEREQTQUADBINQUADBIN: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("EVEREQTQUADBINQUADBIN requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverEqTquadbinQuadbinLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: EVEREQTQUADBINQUADBIN */ + + /* BEGIN CODEGEN PARSER GLUE: EVERNETQUADBINQUADBIN */ + case AntlrSQLLexer::EVERNETQUADBINQUADBIN: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("EVERNETQUADBINQUADBIN requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverNeTquadbinQuadbinLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: EVERNETQUADBINQUADBIN */ + + /* BEGIN CODEGEN PARSER GLUE: ALWAYSEQTQUADBINQUADBIN */ + case AntlrSQLLexer::ALWAYSEQTQUADBINQUADBIN: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("ALWAYSEQTQUADBINQUADBIN requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AlwaysEqTquadbinQuadbinLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: ALWAYSEQTQUADBINQUADBIN */ + + /* BEGIN CODEGEN PARSER GLUE: ALWAYSNETQUADBINQUADBIN */ + case AntlrSQLLexer::ALWAYSNETQUADBINQUADBIN: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("ALWAYSNETQUADBINQUADBIN requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AlwaysNeTquadbinQuadbinLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: ALWAYSNETQUADBINQUADBIN */ + + /* BEGIN CODEGEN PARSER GLUE: EVEREQTTEXTTEXT */ + case AntlrSQLLexer::EVEREQTTEXTTEXT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("EVEREQTTEXTTEXT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverEqTtextTextLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: EVEREQTTEXTTEXT */ + + /* BEGIN CODEGEN PARSER GLUE: EVEREQTEXTTTEXT */ + case AntlrSQLLexer::EVEREQTEXTTTEXT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("EVEREQTEXTTTEXT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverEqTextTtextLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: EVEREQTEXTTTEXT */ + + /* BEGIN CODEGEN PARSER GLUE: EVERNETTEXTTEXT */ + case AntlrSQLLexer::EVERNETTEXTTEXT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("EVERNETTEXTTEXT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverNeTtextTextLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: EVERNETTEXTTEXT */ + + /* BEGIN CODEGEN PARSER GLUE: EVERNETEXTTTEXT */ + case AntlrSQLLexer::EVERNETEXTTTEXT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("EVERNETEXTTTEXT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverNeTextTtextLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: EVERNETEXTTTEXT */ + + /* BEGIN CODEGEN PARSER GLUE: EVERGETTEXTTEXT */ + case AntlrSQLLexer::EVERGETTEXTTEXT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("EVERGETTEXTTEXT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverGeTtextTextLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: EVERGETTEXTTEXT */ + + /* BEGIN CODEGEN PARSER GLUE: EVERGETEXTTTEXT */ + case AntlrSQLLexer::EVERGETEXTTTEXT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("EVERGETEXTTTEXT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverGeTextTtextLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: EVERGETEXTTTEXT */ + + /* BEGIN CODEGEN PARSER GLUE: EVERGTTTEXTTEXT */ + case AntlrSQLLexer::EVERGTTTEXTTEXT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("EVERGTTTEXTTEXT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverGtTtextTextLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: EVERGTTTEXTTEXT */ + + /* BEGIN CODEGEN PARSER GLUE: EVERGTTEXTTTEXT */ + case AntlrSQLLexer::EVERGTTEXTTTEXT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("EVERGTTEXTTTEXT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverGtTextTtextLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: EVERGTTEXTTTEXT */ + + /* BEGIN CODEGEN PARSER GLUE: EVERLETTEXTTEXT */ + case AntlrSQLLexer::EVERLETTEXTTEXT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("EVERLETTEXTTEXT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverLeTtextTextLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: EVERLETTEXTTEXT */ + + /* BEGIN CODEGEN PARSER GLUE: EVERLETEXTTTEXT */ + case AntlrSQLLexer::EVERLETEXTTTEXT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("EVERLETEXTTTEXT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverLeTextTtextLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: EVERLETEXTTTEXT */ + + /* BEGIN CODEGEN PARSER GLUE: EVERLTTTEXTTEXT */ + case AntlrSQLLexer::EVERLTTTEXTTEXT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("EVERLTTTEXTTEXT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverLtTtextTextLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: EVERLTTTEXTTEXT */ + + /* BEGIN CODEGEN PARSER GLUE: EVERLTTEXTTTEXT */ + case AntlrSQLLexer::EVERLTTEXTTTEXT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("EVERLTTEXTTTEXT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverLtTextTtextLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: EVERLTTEXTTTEXT */ + + /* BEGIN CODEGEN PARSER GLUE: ALWAYSEQTTEXTTEXT */ + case AntlrSQLLexer::ALWAYSEQTTEXTTEXT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("ALWAYSEQTTEXTTEXT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AlwaysEqTtextTextLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: ALWAYSEQTTEXTTEXT */ + + /* BEGIN CODEGEN PARSER GLUE: ALWAYSEQTEXTTTEXT */ + case AntlrSQLLexer::ALWAYSEQTEXTTTEXT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("ALWAYSEQTEXTTTEXT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AlwaysEqTextTtextLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: ALWAYSEQTEXTTTEXT */ + + /* BEGIN CODEGEN PARSER GLUE: ALWAYSNETTEXTTEXT */ + case AntlrSQLLexer::ALWAYSNETTEXTTEXT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("ALWAYSNETTEXTTEXT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AlwaysNeTtextTextLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: ALWAYSNETTEXTTEXT */ + + /* BEGIN CODEGEN PARSER GLUE: ALWAYSNETEXTTTEXT */ + case AntlrSQLLexer::ALWAYSNETEXTTTEXT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("ALWAYSNETEXTTTEXT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AlwaysNeTextTtextLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: ALWAYSNETEXTTTEXT */ + + /* BEGIN CODEGEN PARSER GLUE: ALWAYSGETTEXTTEXT */ + case AntlrSQLLexer::ALWAYSGETTEXTTEXT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("ALWAYSGETTEXTTEXT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AlwaysGeTtextTextLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: ALWAYSGETTEXTTEXT */ + + /* BEGIN CODEGEN PARSER GLUE: ALWAYSGETEXTTTEXT */ + case AntlrSQLLexer::ALWAYSGETEXTTTEXT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("ALWAYSGETEXTTTEXT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AlwaysGeTextTtextLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: ALWAYSGETEXTTTEXT */ + + /* BEGIN CODEGEN PARSER GLUE: ALWAYSGTTTEXTTEXT */ + case AntlrSQLLexer::ALWAYSGTTTEXTTEXT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("ALWAYSGTTTEXTTEXT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AlwaysGtTtextTextLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: ALWAYSGTTTEXTTEXT */ + + /* BEGIN CODEGEN PARSER GLUE: ALWAYSGTTEXTTTEXT */ + case AntlrSQLLexer::ALWAYSGTTEXTTTEXT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("ALWAYSGTTEXTTTEXT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AlwaysGtTextTtextLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: ALWAYSGTTEXTTTEXT */ + + /* BEGIN CODEGEN PARSER GLUE: ALWAYSLETTEXTTEXT */ + case AntlrSQLLexer::ALWAYSLETTEXTTEXT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("ALWAYSLETTEXTTEXT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AlwaysLeTtextTextLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: ALWAYSLETTEXTTEXT */ + + /* BEGIN CODEGEN PARSER GLUE: ALWAYSLETEXTTTEXT */ + case AntlrSQLLexer::ALWAYSLETEXTTTEXT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("ALWAYSLETEXTTTEXT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AlwaysLeTextTtextLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: ALWAYSLETEXTTTEXT */ + + /* BEGIN CODEGEN PARSER GLUE: ALWAYSLTTTEXTTEXT */ + case AntlrSQLLexer::ALWAYSLTTTEXTTEXT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("ALWAYSLTTTEXTTEXT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AlwaysLtTtextTextLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: ALWAYSLTTTEXTTEXT */ + + /* BEGIN CODEGEN PARSER GLUE: ALWAYSLTTEXTTTEXT */ + case AntlrSQLLexer::ALWAYSLTTEXTTTEXT: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("ALWAYSLTTEXTTTEXT requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AlwaysLtTextTtextLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: ALWAYSLTTEXTTTEXT */ + + /* BEGIN CODEGEN PARSER GLUE: EVEREQTJSONBJSONB */ + case AntlrSQLLexer::EVEREQTJSONBJSONB: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("EVEREQTJSONBJSONB requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverEqTjsonbJsonbLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: EVEREQTJSONBJSONB */ + + /* BEGIN CODEGEN PARSER GLUE: EVERNETJSONBJSONB */ + case AntlrSQLLexer::EVERNETJSONBJSONB: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("EVERNETJSONBJSONB requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverNeTjsonbJsonbLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: EVERNETJSONBJSONB */ + + /* BEGIN CODEGEN PARSER GLUE: ALWAYSEQTJSONBJSONB */ + case AntlrSQLLexer::ALWAYSEQTJSONBJSONB: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("ALWAYSEQTJSONBJSONB requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AlwaysEqTjsonbJsonbLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: ALWAYSEQTJSONBJSONB */ + + /* BEGIN CODEGEN PARSER GLUE: ALWAYSNETJSONBJSONB */ + case AntlrSQLLexer::ALWAYSNETJSONBJSONB: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("ALWAYSNETJSONBJSONB requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AlwaysNeTjsonbJsonbLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: ALWAYSNETJSONBJSONB */ + + /* BEGIN CODEGEN PARSER GLUE: EVEREQTJSONBTJSONB */ + case AntlrSQLLexer::EVEREQTJSONBTJSONB: + { + const auto argCount = context->expression().size(); + if (argCount != 4) + throw InvalidQuerySyntax("EVEREQTJSONBTJSONB requires exactly 4 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a3 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverEqTjsonbTjsonbLogicalFunction(a0, a1, a2, a3)); + } + break; + /* END CODEGEN PARSER GLUE: EVEREQTJSONBTJSONB */ + + /* BEGIN CODEGEN PARSER GLUE: EVERNETJSONBTJSONB */ + case AntlrSQLLexer::EVERNETJSONBTJSONB: + { + const auto argCount = context->expression().size(); + if (argCount != 4) + throw InvalidQuerySyntax("EVERNETJSONBTJSONB requires exactly 4 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a3 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverNeTjsonbTjsonbLogicalFunction(a0, a1, a2, a3)); + } + break; + /* END CODEGEN PARSER GLUE: EVERNETJSONBTJSONB */ + + /* BEGIN CODEGEN PARSER GLUE: ALWAYSEQTJSONBTJSONB */ + case AntlrSQLLexer::ALWAYSEQTJSONBTJSONB: + { + const auto argCount = context->expression().size(); + if (argCount != 4) + throw InvalidQuerySyntax("ALWAYSEQTJSONBTJSONB requires exactly 4 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a3 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AlwaysEqTjsonbTjsonbLogicalFunction(a0, a1, a2, a3)); + } + break; + /* END CODEGEN PARSER GLUE: ALWAYSEQTJSONBTJSONB */ + + /* BEGIN CODEGEN PARSER GLUE: ALWAYSNETJSONBTJSONB */ + case AntlrSQLLexer::ALWAYSNETJSONBTJSONB: + { + const auto argCount = context->expression().size(); + if (argCount != 4) + throw InvalidQuerySyntax("ALWAYSNETJSONBTJSONB requires exactly 4 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a3 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AlwaysNeTjsonbTjsonbLogicalFunction(a0, a1, a2, a3)); + } + break; + /* END CODEGEN PARSER GLUE: ALWAYSNETJSONBTJSONB */ + + /* BEGIN CODEGEN PARSER GLUE: EVEREQNPOINTTNPOINT */ + case AntlrSQLLexer::EVEREQNPOINTTNPOINT: + { + const auto argCount = context->expression().size(); + if (argCount != 5) + throw InvalidQuerySyntax("EVEREQNPOINTTNPOINT requires exactly 5 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a4 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a3 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverEqNpointTnpointLogicalFunction(a0, a1, a2, a3, a4)); + } + break; + /* END CODEGEN PARSER GLUE: EVEREQNPOINTTNPOINT */ + + /* BEGIN CODEGEN PARSER GLUE: EVEREQTNPOINTNPOINT */ + case AntlrSQLLexer::EVEREQTNPOINTNPOINT: + { + const auto argCount = context->expression().size(); + if (argCount != 5) + throw InvalidQuerySyntax("EVEREQTNPOINTNPOINT requires exactly 5 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a4 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a3 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverEqTnpointNpointLogicalFunction(a0, a1, a2, a3, a4)); + } + break; + /* END CODEGEN PARSER GLUE: EVEREQTNPOINTNPOINT */ + + /* BEGIN CODEGEN PARSER GLUE: EVEREQTNPOINTTNPOINT */ + case AntlrSQLLexer::EVEREQTNPOINTTNPOINT: + { + const auto argCount = context->expression().size(); + if (argCount != 6) + throw InvalidQuerySyntax("EVEREQTNPOINTTNPOINT requires exactly 6 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a5 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a4 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a3 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverEqTnpointTnpointLogicalFunction(a0, a1, a2, a3, a4, a5)); + } + break; + /* END CODEGEN PARSER GLUE: EVEREQTNPOINTTNPOINT */ + + /* BEGIN CODEGEN PARSER GLUE: EVERNENPOINTTNPOINT */ + case AntlrSQLLexer::EVERNENPOINTTNPOINT: + { + const auto argCount = context->expression().size(); + if (argCount != 5) + throw InvalidQuerySyntax("EVERNENPOINTTNPOINT requires exactly 5 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a4 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a3 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverNeNpointTnpointLogicalFunction(a0, a1, a2, a3, a4)); + } + break; + /* END CODEGEN PARSER GLUE: EVERNENPOINTTNPOINT */ + + /* BEGIN CODEGEN PARSER GLUE: EVERNETNPOINTNPOINT */ + case AntlrSQLLexer::EVERNETNPOINTNPOINT: + { + const auto argCount = context->expression().size(); + if (argCount != 5) + throw InvalidQuerySyntax("EVERNETNPOINTNPOINT requires exactly 5 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a4 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a3 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverNeTnpointNpointLogicalFunction(a0, a1, a2, a3, a4)); + } + break; + /* END CODEGEN PARSER GLUE: EVERNETNPOINTNPOINT */ + + /* BEGIN CODEGEN PARSER GLUE: EVERNETNPOINTTNPOINT */ + case AntlrSQLLexer::EVERNETNPOINTTNPOINT: + { + const auto argCount = context->expression().size(); + if (argCount != 6) + throw InvalidQuerySyntax("EVERNETNPOINTTNPOINT requires exactly 6 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a5 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a4 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a3 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverNeTnpointTnpointLogicalFunction(a0, a1, a2, a3, a4, a5)); + } + break; + /* END CODEGEN PARSER GLUE: EVERNETNPOINTTNPOINT */ + + /* BEGIN CODEGEN PARSER GLUE: ALWAYSEQNPOINTTNPOINT */ + case AntlrSQLLexer::ALWAYSEQNPOINTTNPOINT: + { + const auto argCount = context->expression().size(); + if (argCount != 5) + throw InvalidQuerySyntax("ALWAYSEQNPOINTTNPOINT requires exactly 5 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a4 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a3 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AlwaysEqNpointTnpointLogicalFunction(a0, a1, a2, a3, a4)); + } + break; + /* END CODEGEN PARSER GLUE: ALWAYSEQNPOINTTNPOINT */ + + /* BEGIN CODEGEN PARSER GLUE: ALWAYSEQTNPOINTNPOINT */ + case AntlrSQLLexer::ALWAYSEQTNPOINTNPOINT: + { + const auto argCount = context->expression().size(); + if (argCount != 5) + throw InvalidQuerySyntax("ALWAYSEQTNPOINTNPOINT requires exactly 5 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a4 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a3 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AlwaysEqTnpointNpointLogicalFunction(a0, a1, a2, a3, a4)); + } + break; + /* END CODEGEN PARSER GLUE: ALWAYSEQTNPOINTNPOINT */ + + /* BEGIN CODEGEN PARSER GLUE: ALWAYSEQTNPOINTTNPOINT */ + case AntlrSQLLexer::ALWAYSEQTNPOINTTNPOINT: + { + const auto argCount = context->expression().size(); + if (argCount != 6) + throw InvalidQuerySyntax("ALWAYSEQTNPOINTTNPOINT requires exactly 6 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a5 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a4 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a3 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AlwaysEqTnpointTnpointLogicalFunction(a0, a1, a2, a3, a4, a5)); + } + break; + /* END CODEGEN PARSER GLUE: ALWAYSEQTNPOINTTNPOINT */ + + /* BEGIN CODEGEN PARSER GLUE: ALWAYSNENPOINTTNPOINT */ + case AntlrSQLLexer::ALWAYSNENPOINTTNPOINT: + { + const auto argCount = context->expression().size(); + if (argCount != 5) + throw InvalidQuerySyntax("ALWAYSNENPOINTTNPOINT requires exactly 5 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a4 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a3 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AlwaysNeNpointTnpointLogicalFunction(a0, a1, a2, a3, a4)); + } + break; + /* END CODEGEN PARSER GLUE: ALWAYSNENPOINTTNPOINT */ + + /* BEGIN CODEGEN PARSER GLUE: ALWAYSNETNPOINTNPOINT */ + case AntlrSQLLexer::ALWAYSNETNPOINTNPOINT: + { + const auto argCount = context->expression().size(); + if (argCount != 5) + throw InvalidQuerySyntax("ALWAYSNETNPOINTNPOINT requires exactly 5 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a4 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a3 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AlwaysNeTnpointNpointLogicalFunction(a0, a1, a2, a3, a4)); + } + break; + /* END CODEGEN PARSER GLUE: ALWAYSNETNPOINTNPOINT */ + + /* BEGIN CODEGEN PARSER GLUE: ALWAYSNETNPOINTTNPOINT */ + case AntlrSQLLexer::ALWAYSNETNPOINTTNPOINT: + { + const auto argCount = context->expression().size(); + if (argCount != 6) + throw InvalidQuerySyntax("ALWAYSNETNPOINTTNPOINT requires exactly 6 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a5 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a4 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a3 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AlwaysNeTnpointTnpointLogicalFunction(a0, a1, a2, a3, a4, a5)); + } + break; + /* END CODEGEN PARSER GLUE: ALWAYSNETNPOINTTNPOINT */ + + /* BEGIN CODEGEN PARSER GLUE: EVEREQPOSETPOSE */ + case AntlrSQLLexer::EVEREQPOSETPOSE: + { + const auto argCount = context->expression().size(); + if (argCount != 7) + throw InvalidQuerySyntax("EVEREQPOSETPOSE requires exactly 7 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a6 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a5 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a4 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a3 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverEqPoseTposeLogicalFunction(a0, a1, a2, a3, a4, a5, a6)); + } + break; + /* END CODEGEN PARSER GLUE: EVEREQPOSETPOSE */ + + /* BEGIN CODEGEN PARSER GLUE: EVEREQTPOSEPOSE */ + case AntlrSQLLexer::EVEREQTPOSEPOSE: + { + const auto argCount = context->expression().size(); + if (argCount != 7) + throw InvalidQuerySyntax("EVEREQTPOSEPOSE requires exactly 7 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a6 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a5 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a4 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a3 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverEqTposePoseLogicalFunction(a0, a1, a2, a3, a4, a5, a6)); + } + break; + /* END CODEGEN PARSER GLUE: EVEREQTPOSEPOSE */ + + /* BEGIN CODEGEN PARSER GLUE: EVEREQTPOSETPOSE */ + case AntlrSQLLexer::EVEREQTPOSETPOSE: + { + const auto argCount = context->expression().size(); + if (argCount != 8) + throw InvalidQuerySyntax("EVEREQTPOSETPOSE requires exactly 8 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a7 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a6 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a5 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a4 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a3 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverEqTposeTposeLogicalFunction(a0, a1, a2, a3, a4, a5, a6, a7)); + } + break; + /* END CODEGEN PARSER GLUE: EVEREQTPOSETPOSE */ + + /* BEGIN CODEGEN PARSER GLUE: EVERNEPOSETPOSE */ + case AntlrSQLLexer::EVERNEPOSETPOSE: + { + const auto argCount = context->expression().size(); + if (argCount != 7) + throw InvalidQuerySyntax("EVERNEPOSETPOSE requires exactly 7 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a6 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a5 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a4 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a3 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverNePoseTposeLogicalFunction(a0, a1, a2, a3, a4, a5, a6)); + } + break; + /* END CODEGEN PARSER GLUE: EVERNEPOSETPOSE */ + + /* BEGIN CODEGEN PARSER GLUE: EVERNETPOSEPOSE */ + case AntlrSQLLexer::EVERNETPOSEPOSE: + { + const auto argCount = context->expression().size(); + if (argCount != 7) + throw InvalidQuerySyntax("EVERNETPOSEPOSE requires exactly 7 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a6 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a5 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a4 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a3 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverNeTposePoseLogicalFunction(a0, a1, a2, a3, a4, a5, a6)); + } + break; + /* END CODEGEN PARSER GLUE: EVERNETPOSEPOSE */ + + /* BEGIN CODEGEN PARSER GLUE: EVERNETPOSETPOSE */ + case AntlrSQLLexer::EVERNETPOSETPOSE: + { + const auto argCount = context->expression().size(); + if (argCount != 8) + throw InvalidQuerySyntax("EVERNETPOSETPOSE requires exactly 8 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a7 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a6 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a5 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a4 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a3 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(EverNeTposeTposeLogicalFunction(a0, a1, a2, a3, a4, a5, a6, a7)); + } + break; + /* END CODEGEN PARSER GLUE: EVERNETPOSETPOSE */ + + /* BEGIN CODEGEN PARSER GLUE: ALWAYSEQPOSETPOSE */ + case AntlrSQLLexer::ALWAYSEQPOSETPOSE: + { + const auto argCount = context->expression().size(); + if (argCount != 7) + throw InvalidQuerySyntax("ALWAYSEQPOSETPOSE requires exactly 7 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a6 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a5 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a4 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a3 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AlwaysEqPoseTposeLogicalFunction(a0, a1, a2, a3, a4, a5, a6)); + } + break; + /* END CODEGEN PARSER GLUE: ALWAYSEQPOSETPOSE */ + + /* BEGIN CODEGEN PARSER GLUE: ALWAYSEQTPOSEPOSE */ + case AntlrSQLLexer::ALWAYSEQTPOSEPOSE: + { + const auto argCount = context->expression().size(); + if (argCount != 7) + throw InvalidQuerySyntax("ALWAYSEQTPOSEPOSE requires exactly 7 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a6 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a5 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a4 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a3 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AlwaysEqTposePoseLogicalFunction(a0, a1, a2, a3, a4, a5, a6)); + } + break; + /* END CODEGEN PARSER GLUE: ALWAYSEQTPOSEPOSE */ + + /* BEGIN CODEGEN PARSER GLUE: ALWAYSEQTPOSETPOSE */ + case AntlrSQLLexer::ALWAYSEQTPOSETPOSE: + { + const auto argCount = context->expression().size(); + if (argCount != 8) + throw InvalidQuerySyntax("ALWAYSEQTPOSETPOSE requires exactly 8 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a7 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a6 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a5 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a4 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a3 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AlwaysEqTposeTposeLogicalFunction(a0, a1, a2, a3, a4, a5, a6, a7)); + } + break; + /* END CODEGEN PARSER GLUE: ALWAYSEQTPOSETPOSE */ + + /* BEGIN CODEGEN PARSER GLUE: ALWAYSNEPOSETPOSE */ + case AntlrSQLLexer::ALWAYSNEPOSETPOSE: + { + const auto argCount = context->expression().size(); + if (argCount != 7) + throw InvalidQuerySyntax("ALWAYSNEPOSETPOSE requires exactly 7 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a6 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a5 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a4 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a3 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AlwaysNePoseTposeLogicalFunction(a0, a1, a2, a3, a4, a5, a6)); + } + break; + /* END CODEGEN PARSER GLUE: ALWAYSNEPOSETPOSE */ + + /* BEGIN CODEGEN PARSER GLUE: ALWAYSNETPOSEPOSE */ + case AntlrSQLLexer::ALWAYSNETPOSEPOSE: + { + const auto argCount = context->expression().size(); + if (argCount != 7) + throw InvalidQuerySyntax("ALWAYSNETPOSEPOSE requires exactly 7 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a6 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a5 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a4 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a3 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AlwaysNeTposePoseLogicalFunction(a0, a1, a2, a3, a4, a5, a6)); + } + break; + /* END CODEGEN PARSER GLUE: ALWAYSNETPOSEPOSE */ + + /* BEGIN CODEGEN PARSER GLUE: ALWAYSNETPOSETPOSE */ + case AntlrSQLLexer::ALWAYSNETPOSETPOSE: + { + const auto argCount = context->expression().size(); + if (argCount != 8) + throw InvalidQuerySyntax("ALWAYSNETPOSETPOSE requires exactly 8 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a7 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a6 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a5 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a4 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a3 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(AlwaysNeTposeTposeLogicalFunction(a0, a1, a2, a3, a4, a5, a6, a7)); + } + break; + /* END CODEGEN PARSER GLUE: ALWAYSNETPOSETPOSE */ + + /* BEGIN CODEGEN PARSER GLUE: GEOMBOUNDARY */ + case AntlrSQLLexer::GEOMBOUNDARY: + { + const auto argCount = context->expression().size(); + if (argCount != 1) + throw InvalidQuerySyntax("GEOMBOUNDARY requires exactly 1 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(GeomBoundaryLogicalFunction(a0)); + } + break; + /* END CODEGEN PARSER GLUE: GEOMBOUNDARY */ + + /* BEGIN CODEGEN PARSER GLUE: GEOMCENTROID */ + case AntlrSQLLexer::GEOMCENTROID: + { + const auto argCount = context->expression().size(); + if (argCount != 1) + throw InvalidQuerySyntax("GEOMCENTROID requires exactly 1 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(GeomCentroidLogicalFunction(a0)); + } + break; + /* END CODEGEN PARSER GLUE: GEOMCENTROID */ + + /* BEGIN CODEGEN PARSER GLUE: GEOMCONVEXHULL */ + case AntlrSQLLexer::GEOMCONVEXHULL: + { + const auto argCount = context->expression().size(); + if (argCount != 1) + throw InvalidQuerySyntax("GEOMCONVEXHULL requires exactly 1 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(GeomConvexHullLogicalFunction(a0)); + } + break; + /* END CODEGEN PARSER GLUE: GEOMCONVEXHULL */ + + /* BEGIN CODEGEN PARSER GLUE: GEOREVERSE */ + case AntlrSQLLexer::GEOREVERSE: + { + const auto argCount = context->expression().size(); + if (argCount != 1) + throw InvalidQuerySyntax("GEOREVERSE requires exactly 1 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(GeoReverseLogicalFunction(a0)); + } + break; + /* END CODEGEN PARSER GLUE: GEOREVERSE */ + + /* BEGIN CODEGEN PARSER GLUE: GEOPOINTS */ + case AntlrSQLLexer::GEOPOINTS: + { + const auto argCount = context->expression().size(); + if (argCount != 1) + throw InvalidQuerySyntax("GEOPOINTS requires exactly 1 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(GeoPointsLogicalFunction(a0)); + } + break; + /* END CODEGEN PARSER GLUE: GEOPOINTS */ + + /* BEGIN CODEGEN PARSER GLUE: GEOMUNARYUNION */ + case AntlrSQLLexer::GEOMUNARYUNION: + { + const auto argCount = context->expression().size(); + if (argCount != 1) + throw InvalidQuerySyntax("GEOMUNARYUNION requires exactly 1 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(GeomUnaryUnionLogicalFunction(a0)); + } + break; + /* END CODEGEN PARSER GLUE: GEOMUNARYUNION */ + + /* BEGIN CODEGEN PARSER GLUE: GEOSRID */ + case AntlrSQLLexer::GEOSRID: + { + const auto argCount = context->expression().size(); + if (argCount != 1) + throw InvalidQuerySyntax("GEOSRID requires exactly 1 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(GeoSridLogicalFunction(a0)); + } + break; + /* END CODEGEN PARSER GLUE: GEOSRID */ + + /* BEGIN CODEGEN PARSER GLUE: GEONUMGEOS */ + case AntlrSQLLexer::GEONUMGEOS: + { + const auto argCount = context->expression().size(); + if (argCount != 1) + throw InvalidQuerySyntax("GEONUMGEOS requires exactly 1 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(GeoNumGeosLogicalFunction(a0)); + } + break; + /* END CODEGEN PARSER GLUE: GEONUMGEOS */ + + /* BEGIN CODEGEN PARSER GLUE: GEONUMPOINTS */ + case AntlrSQLLexer::GEONUMPOINTS: + { + const auto argCount = context->expression().size(); + if (argCount != 1) + throw InvalidQuerySyntax("GEONUMPOINTS requires exactly 1 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(GeoNumPointsLogicalFunction(a0)); + } + break; + /* END CODEGEN PARSER GLUE: GEONUMPOINTS */ + + /* BEGIN CODEGEN PARSER GLUE: GEOMLENGTH */ + case AntlrSQLLexer::GEOMLENGTH: + { + const auto argCount = context->expression().size(); + if (argCount != 1) + throw InvalidQuerySyntax("GEOMLENGTH requires exactly 1 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(GeomLengthLogicalFunction(a0)); + } + break; + /* END CODEGEN PARSER GLUE: GEOMLENGTH */ + + /* BEGIN CODEGEN PARSER GLUE: GEOMPERIMETER */ + case AntlrSQLLexer::GEOMPERIMETER: + { + const auto argCount = context->expression().size(); + if (argCount != 1) + throw InvalidQuerySyntax("GEOMPERIMETER requires exactly 1 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(GeomPerimeterLogicalFunction(a0)); + } + break; + /* END CODEGEN PARSER GLUE: GEOMPERIMETER */ + + /* BEGIN CODEGEN PARSER GLUE: GEOMISEMPTY */ + case AntlrSQLLexer::GEOMISEMPTY: + { + const auto argCount = context->expression().size(); + if (argCount != 1) + throw InvalidQuerySyntax("GEOMISEMPTY requires exactly 1 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(GeomIsEmptyLogicalFunction(a0)); + } + break; + /* END CODEGEN PARSER GLUE: GEOMISEMPTY */ + + /* BEGIN CODEGEN PARSER GLUE: GEOMAZIMUTH */ + case AntlrSQLLexer::GEOMAZIMUTH: + { + const auto argCount = context->expression().size(); + if (argCount != 1) + throw InvalidQuerySyntax("GEOMAZIMUTH requires exactly 1 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(GeomAzimuthLogicalFunction(a0)); + } + break; + /* END CODEGEN PARSER GLUE: GEOMAZIMUTH */ + + /* BEGIN CODEGEN PARSER GLUE: GEOISUNITARY */ + case AntlrSQLLexer::GEOISUNITARY: + { + const auto argCount = context->expression().size(); + if (argCount != 1) + throw InvalidQuerySyntax("GEOISUNITARY requires exactly 1 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(GeoIsUnitaryLogicalFunction(a0)); + } + break; + /* END CODEGEN PARSER GLUE: GEOISUNITARY */ + + /* BEGIN CODEGEN PARSER GLUE: GEOEQUALS */ + case AntlrSQLLexer::GEOEQUALS: + { + const auto argCount = context->expression().size(); + if (argCount != 2) + throw InvalidQuerySyntax("GEOEQUALS requires exactly 2 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(GeoEqualsLogicalFunction(a0, a1)); + } + break; + /* END CODEGEN PARSER GLUE: GEOEQUALS */ + + /* BEGIN CODEGEN PARSER GLUE: GEOSAME */ + case AntlrSQLLexer::GEOSAME: + { + const auto argCount = context->expression().size(); + if (argCount != 2) + throw InvalidQuerySyntax("GEOSAME requires exactly 2 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(GeoSameLogicalFunction(a0, a1)); + } + break; + /* END CODEGEN PARSER GLUE: GEOSAME */ + + /* BEGIN CODEGEN PARSER GLUE: GEOMINTERSECTS */ + case AntlrSQLLexer::GEOMINTERSECTS: + { + const auto argCount = context->expression().size(); + if (argCount != 2) + throw InvalidQuerySyntax("GEOMINTERSECTS requires exactly 2 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(GeomIntersectsLogicalFunction(a0, a1)); + } + break; + /* END CODEGEN PARSER GLUE: GEOMINTERSECTS */ + + /* BEGIN CODEGEN PARSER GLUE: GEOMINTERSECTS2D */ + case AntlrSQLLexer::GEOMINTERSECTS2D: + { + const auto argCount = context->expression().size(); + if (argCount != 2) + throw InvalidQuerySyntax("GEOMINTERSECTS2D requires exactly 2 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(GeomIntersects2dLogicalFunction(a0, a1)); + } + break; + /* END CODEGEN PARSER GLUE: GEOMINTERSECTS2D */ + + /* BEGIN CODEGEN PARSER GLUE: GEOMINTERSECTS3D */ + case AntlrSQLLexer::GEOMINTERSECTS3D: + { + const auto argCount = context->expression().size(); + if (argCount != 2) + throw InvalidQuerySyntax("GEOMINTERSECTS3D requires exactly 2 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(GeomIntersects3dLogicalFunction(a0, a1)); + } + break; + /* END CODEGEN PARSER GLUE: GEOMINTERSECTS3D */ + + /* BEGIN CODEGEN PARSER GLUE: GEOMCONTAINS */ + case AntlrSQLLexer::GEOMCONTAINS: + { + const auto argCount = context->expression().size(); + if (argCount != 2) + throw InvalidQuerySyntax("GEOMCONTAINS requires exactly 2 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(GeomContainsLogicalFunction(a0, a1)); + } + break; + /* END CODEGEN PARSER GLUE: GEOMCONTAINS */ + + /* BEGIN CODEGEN PARSER GLUE: GEOMCOVERS */ + case AntlrSQLLexer::GEOMCOVERS: + { + const auto argCount = context->expression().size(); + if (argCount != 2) + throw InvalidQuerySyntax("GEOMCOVERS requires exactly 2 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(GeomCoversLogicalFunction(a0, a1)); + } + break; + /* END CODEGEN PARSER GLUE: GEOMCOVERS */ + + /* BEGIN CODEGEN PARSER GLUE: GEOMDISJOINT2D */ + case AntlrSQLLexer::GEOMDISJOINT2D: + { + const auto argCount = context->expression().size(); + if (argCount != 2) + throw InvalidQuerySyntax("GEOMDISJOINT2D requires exactly 2 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(GeomDisjoint2dLogicalFunction(a0, a1)); + } + break; + /* END CODEGEN PARSER GLUE: GEOMDISJOINT2D */ + + /* BEGIN CODEGEN PARSER GLUE: GEOMTOUCHES */ + case AntlrSQLLexer::GEOMTOUCHES: + { + const auto argCount = context->expression().size(); + if (argCount != 2) + throw InvalidQuerySyntax("GEOMTOUCHES requires exactly 2 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(GeomTouchesLogicalFunction(a0, a1)); + } + break; + /* END CODEGEN PARSER GLUE: GEOMTOUCHES */ + + /* BEGIN CODEGEN PARSER GLUE: GEOGINTERSECTS */ + case AntlrSQLLexer::GEOGINTERSECTS: + { + const auto argCount = context->expression().size(); + if (argCount != 2) + throw InvalidQuerySyntax("GEOGINTERSECTS requires exactly 2 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(GeogIntersectsLogicalFunction(a0, a1)); + } + break; + /* END CODEGEN PARSER GLUE: GEOGINTERSECTS */ + + /* BEGIN CODEGEN PARSER GLUE: GEOGDISTANCE */ + case AntlrSQLLexer::GEOGDISTANCE: + { + const auto argCount = context->expression().size(); + if (argCount != 2) + throw InvalidQuerySyntax("GEOGDISTANCE requires exactly 2 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(GeogDistanceLogicalFunction(a0, a1)); + } + break; + /* END CODEGEN PARSER GLUE: GEOGDISTANCE */ + + /* BEGIN CODEGEN PARSER GLUE: LINELOCATEPOINT */ + case AntlrSQLLexer::LINELOCATEPOINT: + { + const auto argCount = context->expression().size(); + if (argCount != 2) + throw InvalidQuerySyntax("LINELOCATEPOINT requires exactly 2 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(LineLocatePointLogicalFunction(a0, a1)); + } + break; + /* END CODEGEN PARSER GLUE: LINELOCATEPOINT */ + + /* BEGIN CODEGEN PARSER GLUE: GEOMDISTANCE2D */ + case AntlrSQLLexer::GEOMDISTANCE2D: + { + const auto argCount = context->expression().size(); + if (argCount != 2) + throw InvalidQuerySyntax("GEOMDISTANCE2D requires exactly 2 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(GeomDistance2dLogicalFunction(a0, a1)); + } + break; + /* END CODEGEN PARSER GLUE: GEOMDISTANCE2D */ + + /* BEGIN CODEGEN PARSER GLUE: GEOMDISTANCE3D */ + case AntlrSQLLexer::GEOMDISTANCE3D: + { + const auto argCount = context->expression().size(); + if (argCount != 2) + throw InvalidQuerySyntax("GEOMDISTANCE3D requires exactly 2 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(GeomDistance3dLogicalFunction(a0, a1)); + } + break; + /* END CODEGEN PARSER GLUE: GEOMDISTANCE3D */ + + /* BEGIN CODEGEN PARSER GLUE: GEOMDWITHIN2D */ + case AntlrSQLLexer::GEOMDWITHIN2D: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("GEOMDWITHIN2D requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(GeomDwithin2dLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: GEOMDWITHIN2D */ + + /* BEGIN CODEGEN PARSER GLUE: GEOMDWITHIN3D */ + case AntlrSQLLexer::GEOMDWITHIN3D: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("GEOMDWITHIN3D requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(GeomDwithin3dLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: GEOMDWITHIN3D */ + + /* BEGIN CODEGEN PARSER GLUE: GEOGDWITHIN */ + case AntlrSQLLexer::GEOGDWITHIN: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("GEOGDWITHIN requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(GeogDwithinLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: GEOGDWITHIN */ + + /* BEGIN CODEGEN PARSER GLUE: GEOMDWITHIN */ + case AntlrSQLLexer::GEOMDWITHIN: + { + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("GEOMDWITHIN requires exactly 3 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a2 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(GeomDwithinLogicalFunction(a0, a1, a2)); + } + break; + /* END CODEGEN PARSER GLUE: GEOMDWITHIN */ + + /* BEGIN CODEGEN PARSER GLUE: GEOMINTERSECTION2D */ + case AntlrSQLLexer::GEOMINTERSECTION2D: + { + const auto argCount = context->expression().size(); + if (argCount != 2) + throw InvalidQuerySyntax("GEOMINTERSECTION2D requires exactly 2 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(GeomIntersection2dLogicalFunction(a0, a1)); + } + break; + /* END CODEGEN PARSER GLUE: GEOMINTERSECTION2D */ + + /* BEGIN CODEGEN PARSER GLUE: GEOMINTERSECTION2DCOLL */ + case AntlrSQLLexer::GEOMINTERSECTION2DCOLL: + { + const auto argCount = context->expression().size(); + if (argCount != 2) + throw InvalidQuerySyntax("GEOMINTERSECTION2DCOLL requires exactly 2 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(GeomIntersection2dCollLogicalFunction(a0, a1)); + } + break; + /* END CODEGEN PARSER GLUE: GEOMINTERSECTION2DCOLL */ + + /* BEGIN CODEGEN PARSER GLUE: GEOMDIFFERENCE2D */ + case AntlrSQLLexer::GEOMDIFFERENCE2D: + { + const auto argCount = context->expression().size(); + if (argCount != 2) + throw InvalidQuerySyntax("GEOMDIFFERENCE2D requires exactly 2 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(GeomDifference2dLogicalFunction(a0, a1)); + } + break; + /* END CODEGEN PARSER GLUE: GEOMDIFFERENCE2D */ + + /* BEGIN CODEGEN PARSER GLUE: GEOMSHORTESTLINE2D */ + case AntlrSQLLexer::GEOMSHORTESTLINE2D: + { + const auto argCount = context->expression().size(); + if (argCount != 2) + throw InvalidQuerySyntax("GEOMSHORTESTLINE2D requires exactly 2 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(GeomShortestline2dLogicalFunction(a0, a1)); + } + break; + /* END CODEGEN PARSER GLUE: GEOMSHORTESTLINE2D */ + + /* BEGIN CODEGEN PARSER GLUE: GEOMSHORTESTLINE3D */ + case AntlrSQLLexer::GEOMSHORTESTLINE3D: + { + const auto argCount = context->expression().size(); + if (argCount != 2) + throw InvalidQuerySyntax("GEOMSHORTESTLINE3D requires exactly 2 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a1 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(GeomShortestline3dLogicalFunction(a0, a1)); + } + break; + /* END CODEGEN PARSER GLUE: GEOMSHORTESTLINE3D */ + + /* BEGIN CODEGEN PARSER GLUE: GEOGAREA */ + case AntlrSQLLexer::GEOGAREA: + { + const auto argCount = context->expression().size(); + if (argCount != 1) + throw InvalidQuerySyntax("GEOGAREA requires exactly 1 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(GeogAreaLogicalFunction(a0)); + } + break; + /* END CODEGEN PARSER GLUE: GEOGAREA */ + + /* BEGIN CODEGEN PARSER GLUE: GEOGLENGTH */ + case AntlrSQLLexer::GEOGLENGTH: + { + const auto argCount = context->expression().size(); + if (argCount != 1) + throw InvalidQuerySyntax("GEOGLENGTH requires exactly 1 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(GeogLengthLogicalFunction(a0)); + } + break; + /* END CODEGEN PARSER GLUE: GEOGLENGTH */ + + /* BEGIN CODEGEN PARSER GLUE: GEOGPERIMETER */ + case AntlrSQLLexer::GEOGPERIMETER: + { + const auto argCount = context->expression().size(); + if (argCount != 1) + throw InvalidQuerySyntax("GEOGPERIMETER requires exactly 1 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(GeogPerimeterLogicalFunction(a0)); + } + break; + /* END CODEGEN PARSER GLUE: GEOGPERIMETER */ + + /* BEGIN CODEGEN PARSER GLUE: GEOGTOGEOM */ + case AntlrSQLLexer::GEOGTOGEOM: + { + const auto argCount = context->expression().size(); + if (argCount != 1) + throw InvalidQuerySyntax("GEOGTOGEOM requires exactly 1 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(GeogToGeomLogicalFunction(a0)); + } + break; + /* END CODEGEN PARSER GLUE: GEOGTOGEOM */ + + /* BEGIN CODEGEN PARSER GLUE: GEOMTOGEOG */ + case AntlrSQLLexer::GEOMTOGEOG: + { + const auto argCount = context->expression().size(); + if (argCount != 1) + throw InvalidQuerySyntax("GEOMTOGEOG requires exactly 1 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(GeomToGeogLogicalFunction(a0)); + } + break; + /* END CODEGEN PARSER GLUE: GEOMTOGEOG */ + + /* BEGIN CODEGEN PARSER GLUE: INTSPANLOWER */ + case AntlrSQLLexer::INTSPANLOWER: + { + const auto argCount = context->expression().size(); + if (argCount != 1) + throw InvalidQuerySyntax("INTSPANLOWER requires exactly 1 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(IntspanLowerLogicalFunction(a0)); + } + break; + /* END CODEGEN PARSER GLUE: INTSPANLOWER */ + + /* BEGIN CODEGEN PARSER GLUE: INTSPANUPPER */ + case AntlrSQLLexer::INTSPANUPPER: + { + const auto argCount = context->expression().size(); + if (argCount != 1) + throw InvalidQuerySyntax("INTSPANUPPER requires exactly 1 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(IntspanUpperLogicalFunction(a0)); + } + break; + /* END CODEGEN PARSER GLUE: INTSPANUPPER */ + + /* BEGIN CODEGEN PARSER GLUE: INTSPANWIDTH */ + case AntlrSQLLexer::INTSPANWIDTH: + { + const auto argCount = context->expression().size(); + if (argCount != 1) + throw InvalidQuerySyntax("INTSPANWIDTH requires exactly 1 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(IntspanWidthLogicalFunction(a0)); + } + break; + /* END CODEGEN PARSER GLUE: INTSPANWIDTH */ + + /* BEGIN CODEGEN PARSER GLUE: INTSPANLOWERINC */ + case AntlrSQLLexer::INTSPANLOWERINC: + { + const auto argCount = context->expression().size(); + if (argCount != 1) + throw InvalidQuerySyntax("INTSPANLOWERINC requires exactly 1 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(IntspanLowerIncLogicalFunction(a0)); + } + break; + /* END CODEGEN PARSER GLUE: INTSPANLOWERINC */ + + /* BEGIN CODEGEN PARSER GLUE: INTSPANUPPERINC */ + case AntlrSQLLexer::INTSPANUPPERINC: + { + const auto argCount = context->expression().size(); + if (argCount != 1) + throw InvalidQuerySyntax("INTSPANUPPERINC requires exactly 1 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(IntspanUpperIncLogicalFunction(a0)); + } + break; + /* END CODEGEN PARSER GLUE: INTSPANUPPERINC */ + + /* BEGIN CODEGEN PARSER GLUE: FLOATSPANLOWER */ + case AntlrSQLLexer::FLOATSPANLOWER: + { + const auto argCount = context->expression().size(); + if (argCount != 1) + throw InvalidQuerySyntax("FLOATSPANLOWER requires exactly 1 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(FloatspanLowerLogicalFunction(a0)); + } + break; + /* END CODEGEN PARSER GLUE: FLOATSPANLOWER */ + + /* BEGIN CODEGEN PARSER GLUE: FLOATSPANUPPER */ + case AntlrSQLLexer::FLOATSPANUPPER: + { + const auto argCount = context->expression().size(); + if (argCount != 1) + throw InvalidQuerySyntax("FLOATSPANUPPER requires exactly 1 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(FloatspanUpperLogicalFunction(a0)); + } + break; + /* END CODEGEN PARSER GLUE: FLOATSPANUPPER */ + + /* BEGIN CODEGEN PARSER GLUE: FLOATSPANWIDTH */ + case AntlrSQLLexer::FLOATSPANWIDTH: + { + const auto argCount = context->expression().size(); + if (argCount != 1) + throw InvalidQuerySyntax("FLOATSPANWIDTH requires exactly 1 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(FloatspanWidthLogicalFunction(a0)); + } + break; + /* END CODEGEN PARSER GLUE: FLOATSPANWIDTH */ + + /* BEGIN CODEGEN PARSER GLUE: FLOATSPANLOWERINC */ + case AntlrSQLLexer::FLOATSPANLOWERINC: + { + const auto argCount = context->expression().size(); + if (argCount != 1) + throw InvalidQuerySyntax("FLOATSPANLOWERINC requires exactly 1 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(FloatspanLowerIncLogicalFunction(a0)); + } + break; + /* END CODEGEN PARSER GLUE: FLOATSPANLOWERINC */ + + /* BEGIN CODEGEN PARSER GLUE: FLOATSPANUPPERINC */ + case AntlrSQLLexer::FLOATSPANUPPERINC: + { + const auto argCount = context->expression().size(); + if (argCount != 1) + throw InvalidQuerySyntax("FLOATSPANUPPERINC requires exactly 1 arguments, but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto a0 = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back(FloatspanUpperIncLogicalFunction(a0)); + } + break; + /* END CODEGEN PARSER GLUE: FLOATSPANUPPERINC */ + + case AntlrSQLParser::ACONTAINS_GEO_TRGEOMETRY: { + PRECONDITION(ctx->functionParam().size() == 6, + "AcontainsGeoTrgeometry requires 6 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + auto arg5 = visit(ctx->functionParam(5)).as(); + return LogicalFunction(AcontainsGeoTrgeometryLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5))); + } + /* END CODEGEN PARSER GLUE: ACONTAINS_GEO_TRGEOMETRY */ + case AntlrSQLParser::ACOVERS_GEO_TRGEOMETRY: { + PRECONDITION(ctx->functionParam().size() == 6, + "AcoversGeoTrgeometry requires 6 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + auto arg5 = visit(ctx->functionParam(5)).as(); + return LogicalFunction(AcoversGeoTrgeometryLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5))); + } + /* END CODEGEN PARSER GLUE: ACOVERS_GEO_TRGEOMETRY */ + case AntlrSQLParser::ACOVERS_TRGEOMETRY_GEO: { + PRECONDITION(ctx->functionParam().size() == 6, + "AcoversTrgeometryGeo requires 6 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + auto arg5 = visit(ctx->functionParam(5)).as(); + return LogicalFunction(AcoversTrgeometryGeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5))); + } + /* END CODEGEN PARSER GLUE: ACOVERS_TRGEOMETRY_GEO */ + case AntlrSQLParser::ADISJOINT_TRGEOMETRY_GEO: { + PRECONDITION(ctx->functionParam().size() == 6, + "AdisjointTrgeometryGeo requires 6 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + auto arg5 = visit(ctx->functionParam(5)).as(); + return LogicalFunction(AdisjointTrgeometryGeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5))); + } + /* END CODEGEN PARSER GLUE: ADISJOINT_TRGEOMETRY_GEO */ + case AntlrSQLParser::ADISJOINT_TRGEOMETRY_TRGEOMETRY: { + PRECONDITION(ctx->functionParam().size() == 10, + "AdisjointTrgeometryTrgeometry requires 10 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + auto arg5 = visit(ctx->functionParam(5)).as(); + auto arg6 = visit(ctx->functionParam(6)).as(); + auto arg7 = visit(ctx->functionParam(7)).as(); + auto arg8 = visit(ctx->functionParam(8)).as(); + auto arg9 = visit(ctx->functionParam(9)).as(); + return LogicalFunction(AdisjointTrgeometryTrgeometryLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6), std::move(arg7), std::move(arg8), std::move(arg9))); + } + /* END CODEGEN PARSER GLUE: ADISJOINT_TRGEOMETRY_TRGEOMETRY */ + case AntlrSQLParser::ADWITHIN_TRGEOMETRY_GEO: { + PRECONDITION(ctx->functionParam().size() == 7, + "AdwithinTrgeometryGeo requires 7 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + auto arg5 = visit(ctx->functionParam(5)).as(); + auto arg6 = visit(ctx->functionParam(6)).as(); + return LogicalFunction(AdwithinTrgeometryGeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6))); + } + /* END CODEGEN PARSER GLUE: ADWITHIN_TRGEOMETRY_GEO */ + case AntlrSQLParser::ADWITHIN_TRGEOMETRY_TRGEOMETRY: { + PRECONDITION(ctx->functionParam().size() == 11, + "AdwithinTrgeometryTrgeometry requires 11 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + auto arg5 = visit(ctx->functionParam(5)).as(); + auto arg6 = visit(ctx->functionParam(6)).as(); + auto arg7 = visit(ctx->functionParam(7)).as(); + auto arg8 = visit(ctx->functionParam(8)).as(); + auto arg9 = visit(ctx->functionParam(9)).as(); + auto arg10 = visit(ctx->functionParam(10)).as(); + return LogicalFunction(AdwithinTrgeometryTrgeometryLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6), std::move(arg7), std::move(arg8), std::move(arg9), std::move(arg10))); + } + /* END CODEGEN PARSER GLUE: ADWITHIN_TRGEOMETRY_TRGEOMETRY */ + case AntlrSQLParser::AINTERSECTS_TRGEOMETRY_GEO: { + PRECONDITION(ctx->functionParam().size() == 6, + "AintersectsTrgeometryGeo requires 6 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + auto arg5 = visit(ctx->functionParam(5)).as(); + return LogicalFunction(AintersectsTrgeometryGeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5))); + } + /* END CODEGEN PARSER GLUE: AINTERSECTS_TRGEOMETRY_GEO */ + case AntlrSQLParser::AINTERSECTS_TRGEOMETRY_TRGEOMETRY: { + PRECONDITION(ctx->functionParam().size() == 10, + "AintersectsTrgeometryTrgeometry requires 10 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + auto arg5 = visit(ctx->functionParam(5)).as(); + auto arg6 = visit(ctx->functionParam(6)).as(); + auto arg7 = visit(ctx->functionParam(7)).as(); + auto arg8 = visit(ctx->functionParam(8)).as(); + auto arg9 = visit(ctx->functionParam(9)).as(); + return LogicalFunction(AintersectsTrgeometryTrgeometryLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6), std::move(arg7), std::move(arg8), std::move(arg9))); + } + /* END CODEGEN PARSER GLUE: AINTERSECTS_TRGEOMETRY_TRGEOMETRY */ + case AntlrSQLParser::ATOUCHES_TRGEOMETRY_GEO: { + PRECONDITION(ctx->functionParam().size() == 6, + "AtouchesTrgeometryGeo requires 6 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + auto arg5 = visit(ctx->functionParam(5)).as(); + return LogicalFunction(AtouchesTrgeometryGeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5))); + } + /* END CODEGEN PARSER GLUE: ATOUCHES_TRGEOMETRY_GEO */ + case AntlrSQLParser::ECONTAINS_GEO_TRGEOMETRY: { + PRECONDITION(ctx->functionParam().size() == 6, + "EcontainsGeoTrgeometry requires 6 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + auto arg5 = visit(ctx->functionParam(5)).as(); + return LogicalFunction(EcontainsGeoTrgeometryLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5))); + } + /* END CODEGEN PARSER GLUE: ECONTAINS_GEO_TRGEOMETRY */ + case AntlrSQLParser::ECOVERS_GEO_TRGEOMETRY: { + PRECONDITION(ctx->functionParam().size() == 6, + "EcoversGeoTrgeometry requires 6 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + auto arg5 = visit(ctx->functionParam(5)).as(); + return LogicalFunction(EcoversGeoTrgeometryLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5))); + } + /* END CODEGEN PARSER GLUE: ECOVERS_GEO_TRGEOMETRY */ + case AntlrSQLParser::ECOVERS_TRGEOMETRY_GEO: { + PRECONDITION(ctx->functionParam().size() == 6, + "EcoversTrgeometryGeo requires 6 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + auto arg5 = visit(ctx->functionParam(5)).as(); + return LogicalFunction(EcoversTrgeometryGeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5))); + } + /* END CODEGEN PARSER GLUE: ECOVERS_TRGEOMETRY_GEO */ + case AntlrSQLParser::EDISJOINT_TRGEOMETRY_GEO: { + PRECONDITION(ctx->functionParam().size() == 6, + "EdisjointTrgeometryGeo requires 6 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + auto arg5 = visit(ctx->functionParam(5)).as(); + return LogicalFunction(EdisjointTrgeometryGeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5))); + } + /* END CODEGEN PARSER GLUE: EDISJOINT_TRGEOMETRY_GEO */ + case AntlrSQLParser::EDISJOINT_TRGEOMETRY_TRGEOMETRY: { + PRECONDITION(ctx->functionParam().size() == 10, + "EdisjointTrgeometryTrgeometry requires 10 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + auto arg5 = visit(ctx->functionParam(5)).as(); + auto arg6 = visit(ctx->functionParam(6)).as(); + auto arg7 = visit(ctx->functionParam(7)).as(); + auto arg8 = visit(ctx->functionParam(8)).as(); + auto arg9 = visit(ctx->functionParam(9)).as(); + return LogicalFunction(EdisjointTrgeometryTrgeometryLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6), std::move(arg7), std::move(arg8), std::move(arg9))); + } + /* END CODEGEN PARSER GLUE: EDISJOINT_TRGEOMETRY_TRGEOMETRY */ + case AntlrSQLParser::EDWITHIN_TRGEOMETRY_GEO: { + PRECONDITION(ctx->functionParam().size() == 7, + "EdwithinTrgeometryGeo requires 7 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + auto arg5 = visit(ctx->functionParam(5)).as(); + auto arg6 = visit(ctx->functionParam(6)).as(); + return LogicalFunction(EdwithinTrgeometryGeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6))); + } + /* END CODEGEN PARSER GLUE: EDWITHIN_TRGEOMETRY_GEO */ + case AntlrSQLParser::EDWITHIN_TRGEOMETRY_TRGEOMETRY: { + PRECONDITION(ctx->functionParam().size() == 11, + "EdwithinTrgeometryTrgeometry requires 11 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + auto arg5 = visit(ctx->functionParam(5)).as(); + auto arg6 = visit(ctx->functionParam(6)).as(); + auto arg7 = visit(ctx->functionParam(7)).as(); + auto arg8 = visit(ctx->functionParam(8)).as(); + auto arg9 = visit(ctx->functionParam(9)).as(); + auto arg10 = visit(ctx->functionParam(10)).as(); + return LogicalFunction(EdwithinTrgeometryTrgeometryLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6), std::move(arg7), std::move(arg8), std::move(arg9), std::move(arg10))); + } + /* END CODEGEN PARSER GLUE: EDWITHIN_TRGEOMETRY_TRGEOMETRY */ + case AntlrSQLParser::EINTERSECTS_TRGEOMETRY_GEO: { + PRECONDITION(ctx->functionParam().size() == 6, + "EintersectsTrgeometryGeo requires 6 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + auto arg5 = visit(ctx->functionParam(5)).as(); + return LogicalFunction(EintersectsTrgeometryGeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5))); + } + /* END CODEGEN PARSER GLUE: EINTERSECTS_TRGEOMETRY_GEO */ + case AntlrSQLParser::EINTERSECTS_TRGEOMETRY_TRGEOMETRY: { + PRECONDITION(ctx->functionParam().size() == 10, + "EintersectsTrgeometryTrgeometry requires 10 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + auto arg5 = visit(ctx->functionParam(5)).as(); + auto arg6 = visit(ctx->functionParam(6)).as(); + auto arg7 = visit(ctx->functionParam(7)).as(); + auto arg8 = visit(ctx->functionParam(8)).as(); + auto arg9 = visit(ctx->functionParam(9)).as(); + return LogicalFunction(EintersectsTrgeometryTrgeometryLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5), std::move(arg6), std::move(arg7), std::move(arg8), std::move(arg9))); + } + /* END CODEGEN PARSER GLUE: EINTERSECTS_TRGEOMETRY_TRGEOMETRY */ + case AntlrSQLParser::ETOUCHES_TRGEOMETRY_GEO: { + PRECONDITION(ctx->functionParam().size() == 6, + "EtouchesTrgeometryGeo requires 6 args but got {}", + ctx->functionParam().size()); + auto arg0 = visit(ctx->functionParam(0)).as(); + auto arg1 = visit(ctx->functionParam(1)).as(); + auto arg2 = visit(ctx->functionParam(2)).as(); + auto arg3 = visit(ctx->functionParam(3)).as(); + auto arg4 = visit(ctx->functionParam(4)).as(); + auto arg5 = visit(ctx->functionParam(5)).as(); + return LogicalFunction(EtouchesTrgeometryGeoLogicalFunction(std::move(arg0), std::move(arg1), std::move(arg2), std::move(arg3), std::move(arg4), std::move(arg5))); + } + /* END CODEGEN PARSER GLUE: ETOUCHES_TRGEOMETRY_GEO */ + /* BEGIN CODEGEN PARSER GLUE: TEMPORAL_EINTERSECTS_TPOSE_GEOMETRY */ + case AntlrSQLLexer::TEMPORAL_EINTERSECTS_TPOSE_GEOMETRY: + { + const auto argCount = context->expression().size(); + if (argCount != 5) + throw InvalidQuerySyntax("TEMPORAL_EINTERSECTS_TPOSE_GEOMETRY requires exactly 5 arguments (lon, lat, radius, timestamp, geometry), but got {}", argCount); + + /* Lift the WKT constant into the function builder */ + while (!helpers.top().constantBuilder.empty()) + { + auto v = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + helpers.top().functionBuilder.emplace_back( + ConstantValueLogicalFunction( + DataTypeProvider::provideDataType(DataType::Type::VARSIZED), std::move(v))); + } + + auto geometry = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto timestamp = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto radius = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lat = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lon = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back( + TemporalEIntersectsTPoseGeometryLogicalFunction(lon, lat, radius, timestamp, geometry)); + } + break; + /* END CODEGEN PARSER GLUE: TEMPORAL_EINTERSECTS_TPOSE_GEOMETRY */ + + /* BEGIN CODEGEN PARSER GLUE: TEMPORAL_AINTERSECTS_TPOSE_GEOMETRY */ + case AntlrSQLLexer::TEMPORAL_AINTERSECTS_TPOSE_GEOMETRY: + { + const auto argCount = context->expression().size(); + if (argCount != 5) + throw InvalidQuerySyntax("TEMPORAL_AINTERSECTS_TPOSE_GEOMETRY requires exactly 5 arguments (lon, lat, radius, timestamp, geometry), but got {}", argCount); + + /* Lift the WKT constant into the function builder */ + while (!helpers.top().constantBuilder.empty()) + { + auto v = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + helpers.top().functionBuilder.emplace_back( + ConstantValueLogicalFunction( + DataTypeProvider::provideDataType(DataType::Type::VARSIZED), std::move(v))); + } + + auto geometry = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto timestamp = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto radius = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lat = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lon = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back( + TemporalAIntersectsTPoseGeometryLogicalFunction(lon, lat, radius, timestamp, geometry)); + } + break; + /* END CODEGEN PARSER GLUE: TEMPORAL_AINTERSECTS_TPOSE_GEOMETRY */ + + /* BEGIN CODEGEN PARSER GLUE: TEMPORAL_ECOVERS_TPOSE_GEOMETRY */ + case AntlrSQLLexer::TEMPORAL_ECOVERS_TPOSE_GEOMETRY: + { + const auto argCount = context->expression().size(); + if (argCount != 5) + throw InvalidQuerySyntax("TEMPORAL_ECOVERS_TPOSE_GEOMETRY requires exactly 5 arguments (lon, lat, radius, timestamp, geometry), but got {}", argCount); + + /* Lift the WKT constant into the function builder */ + while (!helpers.top().constantBuilder.empty()) + { + auto v = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + helpers.top().functionBuilder.emplace_back( + ConstantValueLogicalFunction( + DataTypeProvider::provideDataType(DataType::Type::VARSIZED), std::move(v))); + } + + auto geometry = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto timestamp = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto radius = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lat = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lon = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back( + TemporalECoversTPoseGeometryLogicalFunction(lon, lat, radius, timestamp, geometry)); + } + break; + /* END CODEGEN PARSER GLUE: TEMPORAL_ECOVERS_TPOSE_GEOMETRY */ + + /* BEGIN CODEGEN PARSER GLUE: TEMPORAL_EDISJOINT_TPOSE_GEOMETRY */ + case AntlrSQLLexer::TEMPORAL_EDISJOINT_TPOSE_GEOMETRY: + { + const auto argCount = context->expression().size(); + if (argCount != 5) + throw InvalidQuerySyntax("TEMPORAL_EDISJOINT_TPOSE_GEOMETRY requires exactly 5 arguments (lon, lat, radius, timestamp, geometry), but got {}", argCount); + + /* Lift the WKT constant into the function builder */ + while (!helpers.top().constantBuilder.empty()) + { + auto v = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + helpers.top().functionBuilder.emplace_back( + ConstantValueLogicalFunction( + DataTypeProvider::provideDataType(DataType::Type::VARSIZED), std::move(v))); + } + + auto geometry = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto timestamp = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto radius = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lat = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lon = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back( + TemporalEDisjointTPoseGeometryLogicalFunction(lon, lat, radius, timestamp, geometry)); + } + break; + /* END CODEGEN PARSER GLUE: TEMPORAL_EDISJOINT_TPOSE_GEOMETRY */ + + /* BEGIN CODEGEN PARSER GLUE: TEMPORAL_ADISJOINT_TPOSE_GEOMETRY */ + case AntlrSQLLexer::TEMPORAL_ADISJOINT_TPOSE_GEOMETRY: + { + const auto argCount = context->expression().size(); + if (argCount != 5) + throw InvalidQuerySyntax("TEMPORAL_ADISJOINT_TPOSE_GEOMETRY requires exactly 5 arguments (lon, lat, radius, timestamp, geometry), but got {}", argCount); + + /* Lift the WKT constant into the function builder */ + while (!helpers.top().constantBuilder.empty()) + { + auto v = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + helpers.top().functionBuilder.emplace_back( + ConstantValueLogicalFunction( + DataTypeProvider::provideDataType(DataType::Type::VARSIZED), std::move(v))); + } + + auto geometry = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto timestamp = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto radius = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lat = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lon = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back( + TemporalADisjointTPoseGeometryLogicalFunction(lon, lat, radius, timestamp, geometry)); + } + break; + /* END CODEGEN PARSER GLUE: TEMPORAL_ADISJOINT_TPOSE_GEOMETRY */ + + /* BEGIN CODEGEN PARSER GLUE: TEMPORAL_ETOUCHES_TPOSE_GEOMETRY */ + case AntlrSQLLexer::TEMPORAL_ETOUCHES_TPOSE_GEOMETRY: + { + const auto argCount = context->expression().size(); + if (argCount != 5) + throw InvalidQuerySyntax("TEMPORAL_ETOUCHES_TPOSE_GEOMETRY requires exactly 5 arguments (lon, lat, radius, timestamp, geometry), but got {}", argCount); + + /* Lift the WKT constant into the function builder */ + while (!helpers.top().constantBuilder.empty()) + { + auto v = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + helpers.top().functionBuilder.emplace_back( + ConstantValueLogicalFunction( + DataTypeProvider::provideDataType(DataType::Type::VARSIZED), std::move(v))); + } + + auto geometry = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto timestamp = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto radius = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lat = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lon = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back( + TemporalETouchesTPoseGeometryLogicalFunction(lon, lat, radius, timestamp, geometry)); + } + break; + /* END CODEGEN PARSER GLUE: TEMPORAL_ETOUCHES_TPOSE_GEOMETRY */ + + /* BEGIN CODEGEN PARSER GLUE: TEMPORAL_ATOUCHES_TPOSE_GEOMETRY */ + case AntlrSQLLexer::TEMPORAL_ATOUCHES_TPOSE_GEOMETRY: + { + const auto argCount = context->expression().size(); + if (argCount != 5) + throw InvalidQuerySyntax("TEMPORAL_ATOUCHES_TPOSE_GEOMETRY requires exactly 5 arguments (lon, lat, radius, timestamp, geometry), but got {}", argCount); + + /* Lift the WKT constant into the function builder */ + while (!helpers.top().constantBuilder.empty()) + { + auto v = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + helpers.top().functionBuilder.emplace_back( + ConstantValueLogicalFunction( + DataTypeProvider::provideDataType(DataType::Type::VARSIZED), std::move(v))); + } + + auto geometry = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto timestamp = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto radius = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lat = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lon = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back( + TemporalATouchesTPoseGeometryLogicalFunction(lon, lat, radius, timestamp, geometry)); + } + break; + /* END CODEGEN PARSER GLUE: TEMPORAL_ATOUCHES_TPOSE_GEOMETRY */ + + /* BEGIN CODEGEN PARSER GLUE: TEMPORAL_ECONTAINS_TPOSE_GEOMETRY */ + case AntlrSQLLexer::TEMPORAL_ECONTAINS_TPOSE_GEOMETRY: + { + const auto argCount = context->expression().size(); + if (argCount != 5) + throw InvalidQuerySyntax("TEMPORAL_ECONTAINS_TPOSE_GEOMETRY requires exactly 5 arguments (lon, lat, radius, timestamp, geometry), but got {}", argCount); + + /* Lift the WKT constant into the function builder */ + while (!helpers.top().constantBuilder.empty()) + { + auto v = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + helpers.top().functionBuilder.emplace_back( + ConstantValueLogicalFunction( + DataTypeProvider::provideDataType(DataType::Type::VARSIZED), std::move(v))); + } + + auto geometry = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto timestamp = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto radius = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lat = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lon = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back( + TemporalEContainsTPoseGeometryLogicalFunction(lon, lat, radius, timestamp, geometry)); + } + break; + /* END CODEGEN PARSER GLUE: TEMPORAL_ECONTAINS_TPOSE_GEOMETRY */ + + /* BEGIN CODEGEN PARSER GLUE: TEMPORAL_ACONTAINS_TPOSE_GEOMETRY */ + case AntlrSQLLexer::TEMPORAL_ACONTAINS_TPOSE_GEOMETRY: + { + const auto argCount = context->expression().size(); + if (argCount != 5) + throw InvalidQuerySyntax("TEMPORAL_ACONTAINS_TPOSE_GEOMETRY requires exactly 5 arguments (lon, lat, radius, timestamp, geometry), but got {}", argCount); + + /* Lift the WKT constant into the function builder */ + while (!helpers.top().constantBuilder.empty()) + { + auto v = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + helpers.top().functionBuilder.emplace_back( + ConstantValueLogicalFunction( + DataTypeProvider::provideDataType(DataType::Type::VARSIZED), std::move(v))); + } + + auto geometry = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto timestamp = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto radius = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lat = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lon = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back( + TemporalAContainsTPoseGeometryLogicalFunction(lon, lat, radius, timestamp, geometry)); + } + break; + /* END CODEGEN PARSER GLUE: TEMPORAL_ACONTAINS_TPOSE_GEOMETRY */ + + /* BEGIN CODEGEN PARSER GLUE: TEMPORAL_EDWITHIN_TPOSE_GEOMETRY */ + case AntlrSQLLexer::TEMPORAL_EDWITHIN_TPOSE_GEOMETRY: + { + const auto argCount = context->expression().size(); + if (argCount != 6) + throw InvalidQuerySyntax("TEMPORAL_EDWITHIN_TPOSE_GEOMETRY requires exactly 6 arguments (lon, lat, radius, timestamp, blob, distance), but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto blobLast = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto distLast = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto timestamp = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto radius = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lat = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lon = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back( + TemporalEDWithinTPoseGeometryLogicalFunction(lon, lat, radius, timestamp, blobLast, distLast)); + } + break; + /* END CODEGEN PARSER GLUE: TEMPORAL_EDWITHIN_TPOSE_GEOMETRY */ + + /* BEGIN CODEGEN PARSER GLUE: TEMPORAL_ADWITHIN_TPOSE_GEOMETRY */ + case AntlrSQLLexer::TEMPORAL_ADWITHIN_TPOSE_GEOMETRY: + { + const auto argCount = context->expression().size(); + if (argCount != 6) + throw InvalidQuerySyntax("TEMPORAL_ADWITHIN_TPOSE_GEOMETRY requires exactly 6 arguments (lon, lat, radius, timestamp, blob, distance), but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + auto blobLast = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto distLast = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto timestamp = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto radius = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lat = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lon = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back( + TemporalADWithinTPoseGeometryLogicalFunction(lon, lat, radius, timestamp, blobLast, distLast)); + } + break; + /* END CODEGEN PARSER GLUE: TEMPORAL_ADWITHIN_TPOSE_GEOMETRY */ + + /* BEGIN CODEGEN PARSER GLUE: TEMPORAL_EINTERSECTS_TPOSE_TPOSE */ + case AntlrSQLLexer::TEMPORAL_EINTERSECTS_TPOSE_TPOSE: + { + const auto argCount = context->expression().size(); + if (argCount != 8) + throw InvalidQuerySyntax("TEMPORAL_EINTERSECTS_TPOSE_TPOSE requires exactly 8 arguments (xA, yA, thetaA, tsA, xB, yB, thetaB, tsB), but got {}", argCount); + + auto tsB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto thetaB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto yB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto xB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto tsA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto thetaA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto yA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto xA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back( + TemporalEIntersectsTPoseTPoseLogicalFunction(xA, yA, thetaA, tsA, xB, yB, thetaB, tsB)); + } + break; + /* END CODEGEN PARSER GLUE: TEMPORAL_EINTERSECTS_TPOSE_TPOSE */ + + /* BEGIN CODEGEN PARSER GLUE: TEMPORAL_AINTERSECTS_TPOSE_TPOSE */ + case AntlrSQLLexer::TEMPORAL_AINTERSECTS_TPOSE_TPOSE: + { + const auto argCount = context->expression().size(); + if (argCount != 8) + throw InvalidQuerySyntax("TEMPORAL_AINTERSECTS_TPOSE_TPOSE requires exactly 8 arguments (xA, yA, thetaA, tsA, xB, yB, thetaB, tsB), but got {}", argCount); + + auto tsB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto thetaB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto yB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto xB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto tsA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto thetaA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto yA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto xA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back( + TemporalAIntersectsTPoseTPoseLogicalFunction(xA, yA, thetaA, tsA, xB, yB, thetaB, tsB)); + } + break; + /* END CODEGEN PARSER GLUE: TEMPORAL_AINTERSECTS_TPOSE_TPOSE */ + + /* BEGIN CODEGEN PARSER GLUE: TEMPORAL_ECOVERS_TPOSE_TPOSE */ + case AntlrSQLLexer::TEMPORAL_ECOVERS_TPOSE_TPOSE: + { + const auto argCount = context->expression().size(); + if (argCount != 8) + throw InvalidQuerySyntax("TEMPORAL_ECOVERS_TPOSE_TPOSE requires exactly 8 arguments (xA, yA, thetaA, tsA, xB, yB, thetaB, tsB), but got {}", argCount); + + auto tsB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto thetaB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto yB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto xB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto tsA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto thetaA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto yA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto xA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back( + TemporalECoversTPoseTPoseLogicalFunction(xA, yA, thetaA, tsA, xB, yB, thetaB, tsB)); + } + break; + /* END CODEGEN PARSER GLUE: TEMPORAL_ECOVERS_TPOSE_TPOSE */ + + /* BEGIN CODEGEN PARSER GLUE: TEMPORAL_EDISJOINT_TPOSE_TPOSE */ + case AntlrSQLLexer::TEMPORAL_EDISJOINT_TPOSE_TPOSE: + { + const auto argCount = context->expression().size(); + if (argCount != 8) + throw InvalidQuerySyntax("TEMPORAL_EDISJOINT_TPOSE_TPOSE requires exactly 8 arguments (xA, yA, thetaA, tsA, xB, yB, thetaB, tsB), but got {}", argCount); + + auto tsB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto thetaB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto yB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto xB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto tsA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto thetaA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto yA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto xA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back( + TemporalEDisjointTPoseTPoseLogicalFunction(xA, yA, thetaA, tsA, xB, yB, thetaB, tsB)); + } + break; + /* END CODEGEN PARSER GLUE: TEMPORAL_EDISJOINT_TPOSE_TPOSE */ + + /* BEGIN CODEGEN PARSER GLUE: TEMPORAL_ADISJOINT_TPOSE_TPOSE */ + case AntlrSQLLexer::TEMPORAL_ADISJOINT_TPOSE_TPOSE: + { + const auto argCount = context->expression().size(); + if (argCount != 8) + throw InvalidQuerySyntax("TEMPORAL_ADISJOINT_TPOSE_TPOSE requires exactly 8 arguments (xA, yA, thetaA, tsA, xB, yB, thetaB, tsB), but got {}", argCount); + + auto tsB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto thetaB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto yB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto xB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto tsA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto thetaA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto yA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto xA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back( + TemporalADisjointTPoseTPoseLogicalFunction(xA, yA, thetaA, tsA, xB, yB, thetaB, tsB)); + } + break; + /* END CODEGEN PARSER GLUE: TEMPORAL_ADISJOINT_TPOSE_TPOSE */ + + /* BEGIN CODEGEN PARSER GLUE: TEMPORAL_ETOUCHES_TPOSE_TPOSE */ + case AntlrSQLLexer::TEMPORAL_ETOUCHES_TPOSE_TPOSE: + { + const auto argCount = context->expression().size(); + if (argCount != 8) + throw InvalidQuerySyntax("TEMPORAL_ETOUCHES_TPOSE_TPOSE requires exactly 8 arguments (xA, yA, thetaA, tsA, xB, yB, thetaB, tsB), but got {}", argCount); + + auto tsB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto thetaB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto yB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto xB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto tsA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto thetaA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto yA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto xA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back( + TemporalETouchesTPoseTPoseLogicalFunction(xA, yA, thetaA, tsA, xB, yB, thetaB, tsB)); + } + break; + /* END CODEGEN PARSER GLUE: TEMPORAL_ETOUCHES_TPOSE_TPOSE */ + + /* BEGIN CODEGEN PARSER GLUE: TEMPORAL_ATOUCHES_TPOSE_TPOSE */ + case AntlrSQLLexer::TEMPORAL_ATOUCHES_TPOSE_TPOSE: + { + const auto argCount = context->expression().size(); + if (argCount != 8) + throw InvalidQuerySyntax("TEMPORAL_ATOUCHES_TPOSE_TPOSE requires exactly 8 arguments (xA, yA, thetaA, tsA, xB, yB, thetaB, tsB), but got {}", argCount); + + auto tsB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto thetaB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto yB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto xB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto tsA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto thetaA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto yA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto xA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back( + TemporalATouchesTPoseTPoseLogicalFunction(xA, yA, thetaA, tsA, xB, yB, thetaB, tsB)); + } + break; + /* END CODEGEN PARSER GLUE: TEMPORAL_ATOUCHES_TPOSE_TPOSE */ + + /* BEGIN CODEGEN PARSER GLUE: TEMPORAL_ECONTAINS_TPOSE_TPOSE */ + case AntlrSQLLexer::TEMPORAL_ECONTAINS_TPOSE_TPOSE: + { + const auto argCount = context->expression().size(); + if (argCount != 8) + throw InvalidQuerySyntax("TEMPORAL_ECONTAINS_TPOSE_TPOSE requires exactly 8 arguments (xA, yA, thetaA, tsA, xB, yB, thetaB, tsB), but got {}", argCount); + + auto tsB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto thetaB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto yB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto xB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto tsA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto thetaA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto yA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto xA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back( + TemporalEContainsTPoseTPoseLogicalFunction(xA, yA, thetaA, tsA, xB, yB, thetaB, tsB)); + } + break; + /* END CODEGEN PARSER GLUE: TEMPORAL_ECONTAINS_TPOSE_TPOSE */ + + /* BEGIN CODEGEN PARSER GLUE: TEMPORAL_ACONTAINS_TPOSE_TPOSE */ + case AntlrSQLLexer::TEMPORAL_ACONTAINS_TPOSE_TPOSE: + { + const auto argCount = context->expression().size(); + if (argCount != 8) + throw InvalidQuerySyntax("TEMPORAL_ACONTAINS_TPOSE_TPOSE requires exactly 8 arguments (xA, yA, thetaA, tsA, xB, yB, thetaB, tsB), but got {}", argCount); + + auto tsB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto thetaB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto yB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto xB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto tsA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto thetaA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto yA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto xA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back( + TemporalAContainsTPoseTPoseLogicalFunction(xA, yA, thetaA, tsA, xB, yB, thetaB, tsB)); + } + break; + /* END CODEGEN PARSER GLUE: TEMPORAL_ACONTAINS_TPOSE_TPOSE */ + + /* BEGIN CODEGEN PARSER GLUE: TEMPORAL_EDWITHIN_TPOSE_TPOSE */ + case AntlrSQLLexer::TEMPORAL_EDWITHIN_TPOSE_TPOSE: + { + const auto argCount = context->expression().size(); + if (argCount != 9) + throw InvalidQuerySyntax("TEMPORAL_EDWITHIN_TPOSE_TPOSE requires exactly 9 arguments (lonA, latA, radiusA, tsA, lonB, latB, radiusB, tsB, distance), but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto v = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + helpers.top().functionBuilder.emplace_back( + ConstantValueLogicalFunction( + DataTypeProvider::provideDataType(DataType::Type::FLOAT64), std::move(v))); + } + + auto dist = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto tsB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto radiusB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto latB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lonB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto tsA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto radiusA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto latA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lonA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back( + TemporalEDWithinTPoseTPoseLogicalFunction(lonA, latA, radiusA, tsA, lonB, latB, radiusB, tsB, dist)); + } + break; + /* END CODEGEN PARSER GLUE: TEMPORAL_EDWITHIN_TPOSE_TPOSE */ + + /* BEGIN CODEGEN PARSER GLUE: TEMPORAL_ADWITHIN_TPOSE_TPOSE */ + case AntlrSQLLexer::TEMPORAL_ADWITHIN_TPOSE_TPOSE: + { + const auto argCount = context->expression().size(); + if (argCount != 9) + throw InvalidQuerySyntax("TEMPORAL_ADWITHIN_TPOSE_TPOSE requires exactly 9 arguments (lonA, latA, radiusA, tsA, lonB, latB, radiusB, tsB, distance), but got {}", argCount); + + while (!helpers.top().constantBuilder.empty()) + { + auto v = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + helpers.top().functionBuilder.emplace_back( + ConstantValueLogicalFunction( + DataTypeProvider::provideDataType(DataType::Type::FLOAT64), std::move(v))); + } + + auto dist = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto tsB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto radiusB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto latB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lonB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto tsA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto radiusA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto latA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lonA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back( + TemporalADWithinTPoseTPoseLogicalFunction(lonA, latA, radiusA, tsA, lonB, latB, radiusB, tsB, dist)); + } + break; + /* END CODEGEN PARSER GLUE: TEMPORAL_ADWITHIN_TPOSE_TPOSE */ + + /* BEGIN CODEGEN PARSER GLUE: TEMPORAL_NAD_TPOSE_GEOMETRY */ + case AntlrSQLLexer::TEMPORAL_NAD_TPOSE_GEOMETRY: + { + const auto argCount = context->expression().size(); + if (argCount != 5) + throw InvalidQuerySyntax("TEMPORAL_NAD_TPOSE_GEOMETRY requires exactly 5 arguments (lon, lat, radius, timestamp, geometry), but got {}", argCount); + + /* Lift the WKT constant into the function builder */ + while (!helpers.top().constantBuilder.empty()) + { + auto v = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + helpers.top().functionBuilder.emplace_back( + ConstantValueLogicalFunction( + DataTypeProvider::provideDataType(DataType::Type::VARSIZED), std::move(v))); + } + + auto geometry = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto timestamp = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto radius = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lat = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lon = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back( + TemporalNADTPoseGeometryLogicalFunction(lon, lat, radius, timestamp, geometry)); + } + break; + /* END CODEGEN PARSER GLUE: TEMPORAL_NAD_TPOSE_GEOMETRY */ + + /* BEGIN CODEGEN PARSER GLUE: TEMPORAL_NAD_TPOSE_TPOSE */ + case AntlrSQLLexer::TEMPORAL_NAD_TPOSE_TPOSE: + { + const auto argCount = context->expression().size(); + if (argCount != 8) + throw InvalidQuerySyntax("TEMPORAL_NAD_TPOSE_TPOSE requires exactly 8 arguments (xA, yA, thetaA, tsA, xB, yB, thetaB, tsB), but got {}", argCount); + + auto tsB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto thetaB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto yB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto xB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto tsA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto thetaA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto yA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto xA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back( + TemporalNADTPoseTPoseLogicalFunction(xA, yA, thetaA, tsA, xB, yB, thetaB, tsB)); + } + break; + /* END CODEGEN PARSER GLUE: TEMPORAL_NAD_TPOSE_TPOSE */ + + /* BEGIN CODEGEN PARSER GLUE: TEMPORAL_EINTERSECTS_TNPOINT_GEOMETRY */ + case AntlrSQLLexer::TEMPORAL_EINTERSECTS_TNPOINT_GEOMETRY: + { + const auto argCount = context->expression().size(); + if (argCount != 4) + throw InvalidQuerySyntax("TEMPORAL_EINTERSECTS_TNPOINT_GEOMETRY requires exactly 4 arguments (lon, lat, timestamp, geometry), but got {}", argCount); + + /* Lift the WKT constant into the function builder */ + while (!helpers.top().constantBuilder.empty()) + { + auto v = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + helpers.top().functionBuilder.emplace_back( + ConstantValueLogicalFunction( + DataTypeProvider::provideDataType(DataType::Type::VARSIZED), std::move(v))); + } + + auto geometry = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto timestamp = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lat = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lon = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back( + TemporalEIntersectsTNpointGeometryLogicalFunction(lon, lat, timestamp, geometry)); + } + break; + /* END CODEGEN PARSER GLUE: TEMPORAL_EINTERSECTS_TNPOINT_GEOMETRY */ + + /* BEGIN CODEGEN PARSER GLUE: TEMPORAL_AINTERSECTS_TNPOINT_GEOMETRY */ + case AntlrSQLLexer::TEMPORAL_AINTERSECTS_TNPOINT_GEOMETRY: + { + const auto argCount = context->expression().size(); + if (argCount != 4) + throw InvalidQuerySyntax("TEMPORAL_AINTERSECTS_TNPOINT_GEOMETRY requires exactly 4 arguments (lon, lat, timestamp, geometry), but got {}", argCount); + + /* Lift the WKT constant into the function builder */ + while (!helpers.top().constantBuilder.empty()) + { + auto v = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + helpers.top().functionBuilder.emplace_back( + ConstantValueLogicalFunction( + DataTypeProvider::provideDataType(DataType::Type::VARSIZED), std::move(v))); + } + + auto geometry = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto timestamp = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lat = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lon = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back( + TemporalAIntersectsTNpointGeometryLogicalFunction(lon, lat, timestamp, geometry)); + } + break; + /* END CODEGEN PARSER GLUE: TEMPORAL_AINTERSECTS_TNPOINT_GEOMETRY */ + + /* BEGIN CODEGEN PARSER GLUE: TEMPORAL_ECOVERS_TNPOINT_GEOMETRY */ + case AntlrSQLLexer::TEMPORAL_ECOVERS_TNPOINT_GEOMETRY: + { + const auto argCount = context->expression().size(); + if (argCount != 4) + throw InvalidQuerySyntax("TEMPORAL_ECOVERS_TNPOINT_GEOMETRY requires exactly 4 arguments (lon, lat, timestamp, geometry), but got {}", argCount); + + /* Lift the WKT constant into the function builder */ + while (!helpers.top().constantBuilder.empty()) + { + auto v = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + helpers.top().functionBuilder.emplace_back( + ConstantValueLogicalFunction( + DataTypeProvider::provideDataType(DataType::Type::VARSIZED), std::move(v))); + } + + auto geometry = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto timestamp = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lat = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lon = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back( + TemporalECoversTNpointGeometryLogicalFunction(lon, lat, timestamp, geometry)); + } + break; + /* END CODEGEN PARSER GLUE: TEMPORAL_ECOVERS_TNPOINT_GEOMETRY */ + + /* BEGIN CODEGEN PARSER GLUE: TEMPORAL_EDISJOINT_TNPOINT_GEOMETRY */ + case AntlrSQLLexer::TEMPORAL_EDISJOINT_TNPOINT_GEOMETRY: + { + const auto argCount = context->expression().size(); + if (argCount != 4) + throw InvalidQuerySyntax("TEMPORAL_EDISJOINT_TNPOINT_GEOMETRY requires exactly 4 arguments (lon, lat, timestamp, geometry), but got {}", argCount); + + /* Lift the WKT constant into the function builder */ + while (!helpers.top().constantBuilder.empty()) + { + auto v = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + helpers.top().functionBuilder.emplace_back( + ConstantValueLogicalFunction( + DataTypeProvider::provideDataType(DataType::Type::VARSIZED), std::move(v))); + } + + auto geometry = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto timestamp = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lat = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lon = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back( + TemporalEDisjointTNpointGeometryLogicalFunction(lon, lat, timestamp, geometry)); + } + break; + /* END CODEGEN PARSER GLUE: TEMPORAL_EDISJOINT_TNPOINT_GEOMETRY */ + + /* BEGIN CODEGEN PARSER GLUE: TEMPORAL_ADISJOINT_TNPOINT_GEOMETRY */ + case AntlrSQLLexer::TEMPORAL_ADISJOINT_TNPOINT_GEOMETRY: + { + const auto argCount = context->expression().size(); + if (argCount != 4) + throw InvalidQuerySyntax("TEMPORAL_ADISJOINT_TNPOINT_GEOMETRY requires exactly 4 arguments (lon, lat, timestamp, geometry), but got {}", argCount); + + /* Lift the WKT constant into the function builder */ + while (!helpers.top().constantBuilder.empty()) + { + auto v = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + helpers.top().functionBuilder.emplace_back( + ConstantValueLogicalFunction( + DataTypeProvider::provideDataType(DataType::Type::VARSIZED), std::move(v))); + } + + auto geometry = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto timestamp = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lat = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lon = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back( + TemporalADisjointTNpointGeometryLogicalFunction(lon, lat, timestamp, geometry)); + } + break; + /* END CODEGEN PARSER GLUE: TEMPORAL_ADISJOINT_TNPOINT_GEOMETRY */ + + /* BEGIN CODEGEN PARSER GLUE: TEMPORAL_ETOUCHES_TNPOINT_GEOMETRY */ + case AntlrSQLLexer::TEMPORAL_ETOUCHES_TNPOINT_GEOMETRY: + { + const auto argCount = context->expression().size(); + if (argCount != 4) + throw InvalidQuerySyntax("TEMPORAL_ETOUCHES_TNPOINT_GEOMETRY requires exactly 4 arguments (lon, lat, timestamp, geometry), but got {}", argCount); + + /* Lift the WKT constant into the function builder */ + while (!helpers.top().constantBuilder.empty()) + { + auto v = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + helpers.top().functionBuilder.emplace_back( + ConstantValueLogicalFunction( + DataTypeProvider::provideDataType(DataType::Type::VARSIZED), std::move(v))); + } + + auto geometry = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto timestamp = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lat = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lon = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back( + TemporalETouchesTNpointGeometryLogicalFunction(lon, lat, timestamp, geometry)); + } + break; + /* END CODEGEN PARSER GLUE: TEMPORAL_ETOUCHES_TNPOINT_GEOMETRY */ + + /* BEGIN CODEGEN PARSER GLUE: TEMPORAL_ATOUCHES_TNPOINT_GEOMETRY */ + case AntlrSQLLexer::TEMPORAL_ATOUCHES_TNPOINT_GEOMETRY: + { + const auto argCount = context->expression().size(); + if (argCount != 4) + throw InvalidQuerySyntax("TEMPORAL_ATOUCHES_TNPOINT_GEOMETRY requires exactly 4 arguments (lon, lat, timestamp, geometry), but got {}", argCount); + + /* Lift the WKT constant into the function builder */ + while (!helpers.top().constantBuilder.empty()) + { + auto v = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + helpers.top().functionBuilder.emplace_back( + ConstantValueLogicalFunction( + DataTypeProvider::provideDataType(DataType::Type::VARSIZED), std::move(v))); + } + + auto geometry = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto timestamp = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lat = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lon = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back( + TemporalATouchesTNpointGeometryLogicalFunction(lon, lat, timestamp, geometry)); + } + break; + /* END CODEGEN PARSER GLUE: TEMPORAL_ATOUCHES_TNPOINT_GEOMETRY */ + + /* BEGIN CODEGEN PARSER GLUE: TEMPORAL_ECONTAINS_TNPOINT_GEOMETRY */ + case AntlrSQLLexer::TEMPORAL_ECONTAINS_TNPOINT_GEOMETRY: + { + const auto argCount = context->expression().size(); + if (argCount != 4) + throw InvalidQuerySyntax("TEMPORAL_ECONTAINS_TNPOINT_GEOMETRY requires exactly 4 arguments (lon, lat, timestamp, geometry), but got {}", argCount); + + /* Lift the WKT constant into the function builder */ + while (!helpers.top().constantBuilder.empty()) + { + auto v = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + helpers.top().functionBuilder.emplace_back( + ConstantValueLogicalFunction( + DataTypeProvider::provideDataType(DataType::Type::VARSIZED), std::move(v))); + } + + auto geometry = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto timestamp = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lat = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lon = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back( + TemporalEContainsTNpointGeometryLogicalFunction(lon, lat, timestamp, geometry)); + } + break; + /* END CODEGEN PARSER GLUE: TEMPORAL_ECONTAINS_TNPOINT_GEOMETRY */ + + /* BEGIN CODEGEN PARSER GLUE: TEMPORAL_ACONTAINS_TNPOINT_GEOMETRY */ + case AntlrSQLLexer::TEMPORAL_ACONTAINS_TNPOINT_GEOMETRY: + { + const auto argCount = context->expression().size(); + if (argCount != 4) + throw InvalidQuerySyntax("TEMPORAL_ACONTAINS_TNPOINT_GEOMETRY requires exactly 4 arguments (lon, lat, timestamp, geometry), but got {}", argCount); + + /* Lift the WKT constant into the function builder */ + while (!helpers.top().constantBuilder.empty()) + { + auto v = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + helpers.top().functionBuilder.emplace_back( + ConstantValueLogicalFunction( + DataTypeProvider::provideDataType(DataType::Type::VARSIZED), std::move(v))); + } + + auto geometry = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto timestamp = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lat = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lon = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back( + TemporalAContainsTNpointGeometryLogicalFunction(lon, lat, timestamp, geometry)); + } + break; + /* END CODEGEN PARSER GLUE: TEMPORAL_ACONTAINS_TNPOINT_GEOMETRY */ + + /* BEGIN CODEGEN PARSER GLUE: TEMPORAL_EDWITHIN_TNPOINT_GEOMETRY */ + case AntlrSQLLexer::TEMPORAL_EDWITHIN_TNPOINT_GEOMETRY: + { + const auto argCount = context->expression().size(); + if (argCount != 5) + throw InvalidQuerySyntax("TEMPORAL_EDWITHIN_TNPOINT_GEOMETRY requires exactly 5 arguments (lon, lat, timestamp, geometry, distance), but got {}", argCount); + + /* Lift constants (geometry + distance) — same shape as EDWITHIN_TGEO_GEO */ + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + + DataType dataType; + const auto upperValue = Util::toUpperCase(constantValue); + if (upperValue == "TRUE" || upperValue == "FALSE") + { + dataType = DataTypeProvider::provideDataType(DataType::Type::BOOLEAN); + } + else + { + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + } + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + /* After lift: [lon, lat, ts, distance, geometry] (geometry pushed last because lifted last in LIFO) */ + auto geometry = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto dist = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto timestamp = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lat = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lon = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back( + TemporalEDWithinTNpointGeometryLogicalFunction(lon, lat, timestamp, geometry, dist)); + } + break; + /* END CODEGEN PARSER GLUE: TEMPORAL_EDWITHIN_TNPOINT_GEOMETRY */ + + /* BEGIN CODEGEN PARSER GLUE: TEMPORAL_ADWITHIN_TNPOINT_GEOMETRY */ + case AntlrSQLLexer::TEMPORAL_ADWITHIN_TNPOINT_GEOMETRY: + { + const auto argCount = context->expression().size(); + if (argCount != 5) + throw InvalidQuerySyntax("TEMPORAL_ADWITHIN_TNPOINT_GEOMETRY requires exactly 5 arguments (lon, lat, timestamp, geometry, distance), but got {}", argCount); + + /* Lift constants (geometry + distance) — same shape as EDWITHIN_TGEO_GEO */ + while (!helpers.top().constantBuilder.empty()) + { + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + + DataType dataType; + const auto upperValue = Util::toUpperCase(constantValue); + if (upperValue == "TRUE" || upperValue == "FALSE") + { + dataType = DataTypeProvider::provideDataType(DataType::Type::BOOLEAN); + } + else + { + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + } + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + } + + /* After lift: [lon, lat, ts, distance, geometry] (geometry pushed last because lifted last in LIFO) */ + auto geometry = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto dist = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto timestamp = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lat = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lon = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back( + TemporalADWithinTNpointGeometryLogicalFunction(lon, lat, timestamp, geometry, dist)); + } + break; + /* END CODEGEN PARSER GLUE: TEMPORAL_ADWITHIN_TNPOINT_GEOMETRY */ + + /* BEGIN CODEGEN PARSER GLUE: TEMPORAL_EINTERSECTS_TNPOINT_TNPOINT */ + case AntlrSQLLexer::TEMPORAL_EINTERSECTS_TNPOINT_TNPOINT: + { + const auto argCount = context->expression().size(); + if (argCount != 6) + throw InvalidQuerySyntax("TEMPORAL_EINTERSECTS_TNPOINT_TNPOINT requires exactly 6 arguments (lonA, latA, tsA, lonB, latB, tsB), but got {}", argCount); + + auto tsB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto latB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lonB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto tsA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto latA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lonA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back( + TemporalEIntersectsTNpointTNpointLogicalFunction(lonA, latA, tsA, lonB, latB, tsB)); + } + break; + /* END CODEGEN PARSER GLUE: TEMPORAL_EINTERSECTS_TNPOINT_TNPOINT */ + + /* BEGIN CODEGEN PARSER GLUE: TEMPORAL_AINTERSECTS_TNPOINT_TNPOINT */ + case AntlrSQLLexer::TEMPORAL_AINTERSECTS_TNPOINT_TNPOINT: + { + const auto argCount = context->expression().size(); + if (argCount != 6) + throw InvalidQuerySyntax("TEMPORAL_AINTERSECTS_TNPOINT_TNPOINT requires exactly 6 arguments (lonA, latA, tsA, lonB, latB, tsB), but got {}", argCount); + + auto tsB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto latB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lonB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto tsA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto latA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lonA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back( + TemporalAIntersectsTNpointTNpointLogicalFunction(lonA, latA, tsA, lonB, latB, tsB)); + } + break; + /* END CODEGEN PARSER GLUE: TEMPORAL_AINTERSECTS_TNPOINT_TNPOINT */ + + /* BEGIN CODEGEN PARSER GLUE: TEMPORAL_ECOVERS_TNPOINT_TNPOINT */ + case AntlrSQLLexer::TEMPORAL_ECOVERS_TNPOINT_TNPOINT: + { + const auto argCount = context->expression().size(); + if (argCount != 6) + throw InvalidQuerySyntax("TEMPORAL_ECOVERS_TNPOINT_TNPOINT requires exactly 6 arguments (lonA, latA, tsA, lonB, latB, tsB), but got {}", argCount); + + auto tsB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto latB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lonB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto tsA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto latA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lonA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back( + TemporalECoversTNpointTNpointLogicalFunction(lonA, latA, tsA, lonB, latB, tsB)); + } + break; + /* END CODEGEN PARSER GLUE: TEMPORAL_ECOVERS_TNPOINT_TNPOINT */ + + /* BEGIN CODEGEN PARSER GLUE: TEMPORAL_EDISJOINT_TNPOINT_TNPOINT */ + case AntlrSQLLexer::TEMPORAL_EDISJOINT_TNPOINT_TNPOINT: + { + const auto argCount = context->expression().size(); + if (argCount != 6) + throw InvalidQuerySyntax("TEMPORAL_EDISJOINT_TNPOINT_TNPOINT requires exactly 6 arguments (lonA, latA, tsA, lonB, latB, tsB), but got {}", argCount); + + auto tsB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto latB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lonB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto tsA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto latA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lonA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back( + TemporalEDisjointTNpointTNpointLogicalFunction(lonA, latA, tsA, lonB, latB, tsB)); + } + break; + /* END CODEGEN PARSER GLUE: TEMPORAL_EDISJOINT_TNPOINT_TNPOINT */ + + /* BEGIN CODEGEN PARSER GLUE: TEMPORAL_ADISJOINT_TNPOINT_TNPOINT */ + case AntlrSQLLexer::TEMPORAL_ADISJOINT_TNPOINT_TNPOINT: + { + const auto argCount = context->expression().size(); + if (argCount != 6) + throw InvalidQuerySyntax("TEMPORAL_ADISJOINT_TNPOINT_TNPOINT requires exactly 6 arguments (lonA, latA, tsA, lonB, latB, tsB), but got {}", argCount); + + auto tsB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto latB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lonB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto tsA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto latA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lonA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back( + TemporalADisjointTNpointTNpointLogicalFunction(lonA, latA, tsA, lonB, latB, tsB)); + } + break; + /* END CODEGEN PARSER GLUE: TEMPORAL_ADISJOINT_TNPOINT_TNPOINT */ + + /* BEGIN CODEGEN PARSER GLUE: TEMPORAL_ETOUCHES_TNPOINT_TNPOINT */ + case AntlrSQLLexer::TEMPORAL_ETOUCHES_TNPOINT_TNPOINT: + { + const auto argCount = context->expression().size(); + if (argCount != 6) + throw InvalidQuerySyntax("TEMPORAL_ETOUCHES_TNPOINT_TNPOINT requires exactly 6 arguments (lonA, latA, tsA, lonB, latB, tsB), but got {}", argCount); + + auto tsB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto latB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lonB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto tsA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto latA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lonA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back( + TemporalETouchesTNpointTNpointLogicalFunction(lonA, latA, tsA, lonB, latB, tsB)); + } + break; + /* END CODEGEN PARSER GLUE: TEMPORAL_ETOUCHES_TNPOINT_TNPOINT */ + + /* BEGIN CODEGEN PARSER GLUE: TEMPORAL_ATOUCHES_TNPOINT_TNPOINT */ + case AntlrSQLLexer::TEMPORAL_ATOUCHES_TNPOINT_TNPOINT: + { + const auto argCount = context->expression().size(); + if (argCount != 6) + throw InvalidQuerySyntax("TEMPORAL_ATOUCHES_TNPOINT_TNPOINT requires exactly 6 arguments (lonA, latA, tsA, lonB, latB, tsB), but got {}", argCount); + + auto tsB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto latB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lonB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto tsA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto latA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lonA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back( + TemporalATouchesTNpointTNpointLogicalFunction(lonA, latA, tsA, lonB, latB, tsB)); + } + break; + /* END CODEGEN PARSER GLUE: TEMPORAL_ATOUCHES_TNPOINT_TNPOINT */ + + /* BEGIN CODEGEN PARSER GLUE: TEMPORAL_ECONTAINS_TNPOINT_TNPOINT */ + case AntlrSQLLexer::TEMPORAL_ECONTAINS_TNPOINT_TNPOINT: + { + const auto argCount = context->expression().size(); + if (argCount != 6) + throw InvalidQuerySyntax("TEMPORAL_ECONTAINS_TNPOINT_TNPOINT requires exactly 6 arguments (lonA, latA, tsA, lonB, latB, tsB), but got {}", argCount); + + auto tsB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto latB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lonB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto tsA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto latA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lonA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back( + TemporalEContainsTNpointTNpointLogicalFunction(lonA, latA, tsA, lonB, latB, tsB)); + } + break; + /* END CODEGEN PARSER GLUE: TEMPORAL_ECONTAINS_TNPOINT_TNPOINT */ + + /* BEGIN CODEGEN PARSER GLUE: TEMPORAL_ACONTAINS_TNPOINT_TNPOINT */ + case AntlrSQLLexer::TEMPORAL_ACONTAINS_TNPOINT_TNPOINT: + { + const auto argCount = context->expression().size(); + if (argCount != 6) + throw InvalidQuerySyntax("TEMPORAL_ACONTAINS_TNPOINT_TNPOINT requires exactly 6 arguments (lonA, latA, tsA, lonB, latB, tsB), but got {}", argCount); + + auto tsB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto latB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lonB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto tsA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto latA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lonA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back( + TemporalAContainsTNpointTNpointLogicalFunction(lonA, latA, tsA, lonB, latB, tsB)); + } + break; + /* END CODEGEN PARSER GLUE: TEMPORAL_ACONTAINS_TNPOINT_TNPOINT */ + + /* BEGIN CODEGEN PARSER GLUE: TEMPORAL_EDWITHIN_TNPOINT_TNPOINT */ + case AntlrSQLLexer::TEMPORAL_EDWITHIN_TNPOINT_TNPOINT: + { + const auto argCount = context->expression().size(); + if (argCount != 7) + throw InvalidQuerySyntax("TEMPORAL_EDWITHIN_TNPOINT_TNPOINT requires exactly 7 arguments (lonA, latA, tsA, lonB, latB, tsB, distance), but got {}", argCount); + + /* Lift the distance constant */ + while (!helpers.top().constantBuilder.empty()) + { + auto v = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + helpers.top().functionBuilder.emplace_back( + ConstantValueLogicalFunction( + DataTypeProvider::provideDataType(DataType::Type::FLOAT64), std::move(v))); + } + + auto dist = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto tsB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto latB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lonB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto tsA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto latA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lonA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back( + TemporalEDWithinTNpointTNpointLogicalFunction(lonA, latA, tsA, lonB, latB, tsB, dist)); + } + break; + /* END CODEGEN PARSER GLUE: TEMPORAL_EDWITHIN_TNPOINT_TNPOINT */ + + /* BEGIN CODEGEN PARSER GLUE: TEMPORAL_ADWITHIN_TNPOINT_TNPOINT */ + case AntlrSQLLexer::TEMPORAL_ADWITHIN_TNPOINT_TNPOINT: + { + const auto argCount = context->expression().size(); + if (argCount != 7) + throw InvalidQuerySyntax("TEMPORAL_ADWITHIN_TNPOINT_TNPOINT requires exactly 7 arguments (lonA, latA, tsA, lonB, latB, tsB, distance), but got {}", argCount); + + /* Lift the distance constant */ + while (!helpers.top().constantBuilder.empty()) + { + auto v = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + helpers.top().functionBuilder.emplace_back( + ConstantValueLogicalFunction( + DataTypeProvider::provideDataType(DataType::Type::FLOAT64), std::move(v))); + } + + auto dist = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto tsB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto latB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lonB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto tsA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto latA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lonA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back( + TemporalADWithinTNpointTNpointLogicalFunction(lonA, latA, tsA, lonB, latB, tsB, dist)); + } + break; + /* END CODEGEN PARSER GLUE: TEMPORAL_ADWITHIN_TNPOINT_TNPOINT */ + + /* BEGIN CODEGEN PARSER GLUE: TEMPORAL_NAD_TNPOINT_GEOMETRY */ + case AntlrSQLLexer::TEMPORAL_NAD_TNPOINT_GEOMETRY: + { + const auto argCount = context->expression().size(); + if (argCount != 4) + throw InvalidQuerySyntax("TEMPORAL_NAD_TNPOINT_GEOMETRY requires exactly 4 arguments (lon, lat, timestamp, geometry), but got {}", argCount); + + /* Lift the WKT constant into the function builder */ + while (!helpers.top().constantBuilder.empty()) + { + auto v = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + helpers.top().functionBuilder.emplace_back( + ConstantValueLogicalFunction( + DataTypeProvider::provideDataType(DataType::Type::VARSIZED), std::move(v))); + } + + auto geometry = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto timestamp = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lat = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lon = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back( + TemporalNADTNpointGeometryLogicalFunction(lon, lat, timestamp, geometry)); + } + break; + /* END CODEGEN PARSER GLUE: TEMPORAL_NAD_TNPOINT_GEOMETRY */ + + /* BEGIN CODEGEN PARSER GLUE: TEMPORAL_NAD_TNPOINT_TNPOINT */ + case AntlrSQLLexer::TEMPORAL_NAD_TNPOINT_TNPOINT: + { + const auto argCount = context->expression().size(); + if (argCount != 6) + throw InvalidQuerySyntax("TEMPORAL_NAD_TNPOINT_TNPOINT requires exactly 6 arguments (lonA, latA, tsA, lonB, latB, tsB), but got {}", argCount); + + auto tsB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto latB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lonB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto tsA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto latA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lonA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back( + TemporalNADTNpointTNpointLogicalFunction(lonA, latA, tsA, lonB, latB, tsB)); + } + break; + /* END CODEGEN PARSER GLUE: TEMPORAL_NAD_TNPOINT_TNPOINT */ + default: /// Check if the function is a constructor for a datatype diff --git a/tools/codegen/README.md b/tools/codegen/README.md new file mode 100644 index 0000000000..f203c8a380 --- /dev/null +++ b/tools/codegen/README.md @@ -0,0 +1,172 @@ +# MobilityNebula MEOS-operator codegen — design + generator + +This directory contains the design proposal and Python generator for +scaling MobilityNebula's MEOS-operator surface from the current +~17 hand-written operators (PRs #14, #15, #16, #17) to a larger +fraction of MEOS' ~1,949 streamable public functions, mirroring the +infrastructure parity that the Flink and Kafka platforms reached via +their codegen + wirings stacks. + +## Why codegen on Nebula + +The streaming-platform parity audit +([assessment](../../docs/berlinmod-streaming-forms.md)) shows: + +| Platform | Wirable MEOS surface | +|---|---:| +| Flink | 2,097 / 2,097 (100%) via codegen + 5 generic wiring classes | +| Kafka | 2,097 / 2,097 (100%) via codegen + 5 generic wiring classes | +| **Nebula** | **~17 / 2,097 (~1%)** via hand-written 4-layer pipeline per function | + +The Nebula gap is structural: each MEOS function on NebulaStream +requires a full **4-layer pipeline tuple** — logical class, physical +class, parser dispatch, lowering rule — totalling ~350–400 LOC of +mostly-mechanical boilerplate per function. Hand-writing all of MEOS' +streamable surface this way is multi-month engineering; codegen makes +it tractable. + +## What this codegen produces + +For each MEOS scalar function `f` in the input list, the generator +emits the four NebulaStream pipeline-layer files following the +established style of the existing hand-written operators +(`TemporalEDWithinGeometryLogicalFunction` etc.): + +``` +nes-logical-operators/include/Functions/Meos/LogicalFunction.hpp +nes-logical-operators/src/Functions/Meos/LogicalFunction.cpp +nes-physical-operators/include/Functions/Meos/PhysicalFunction.hpp +nes-physical-operators/src/Functions/Meos/PhysicalFunction.cpp +``` + +Plus updates to: +- `nes-logical-operators/src/Functions/Meos/CMakeLists.txt` +- `nes-physical-operators/src/Functions/Meos/CMakeLists.txt` +- Parser dispatch: a single block per generated function inserted into + `nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp` (manual edit + recommended; the generator emits the dispatch snippet for + copy-paste) +- Parser grammar: a single token per function added to + `nes-sql-parser/AntlrSQL.g4` (same) + +## Scope of this PR + +**Generator infrastructure only.** No generated C++ committed. Reasons: + +1. **Compile-environment constraint.** The generator's author cannot + build NebulaStream (full C++23 + vcpkg toolchain). Committing + unverified generated code would ship potentially broken operators. +2. **Per-function review value.** Mariana (maintainer) can run the + generator against a small input list (e.g. one MEOS family at a + time), review the output, iterate on the templates if needed, and + ship operators in follow-up PRs at a controlled pace. +3. **Template iteration cost.** First-pass templates may need + adjustment after the first build — better to land the generator + and iterate on templates than to ship a large batch of generated + operators that all have the same wrong shape. + +## How to use the generator + +```bash +# Edit the input list to choose which MEOS functions to generate +$EDITOR tools/codegen/codegen_input.example.json + +# Run the generator +python3 tools/codegen/codegen_nebula.py \ + --input tools/codegen/codegen_input.example.json \ + --output-root . + +# Output: +# nes-logical-operators/include/Functions/Meos/LogicalFunction.hpp +# nes-logical-operators/src/Functions/Meos/LogicalFunction.cpp +# nes-physical-operators/include/Functions/Meos/PhysicalFunction.hpp +# nes-physical-operators/src/Functions/Meos/PhysicalFunction.cpp +# +# Plus a stderr-printed "parser snippet" per function that you paste into +# nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp (the parser dispatch), +# and a "grammar snippet" that you paste into AntlrSQL.g4 +``` + +## Input format + +`codegen_input.example.json` is a list of MEOS-function descriptors. +One descriptor per output operator: + +```json +{ + "operators": [ + { + "nebula_name": "TemporalEDisjointGeometry", + "sql_token": "TEMPORAL_EDISJOINT_GEOMETRY", + "meos_call": "edisjoint_tgeo_geo", + "args": [ + {"name": "lon", "nautilus_type": "double", "cpp_type": "double"}, + {"name": "lat", "nautilus_type": "double", "cpp_type": "double"}, + {"name": "timestamp","nautilus_type": "uint64_t", "cpp_type": "uint64_t"}, + {"name": "geometry", "nautilus_type": "VariableSizedData", "cpp_type": "const char*"} + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_temporal_point": true, + "comment_one_liner": "Per-event ever-disjoint between a tgeompoint built from event fields and a static geometry." + } + ] +} +``` + +Field meanings: +- `nebula_name`: PascalCase NebulaStream class name (without `LogicalFunction` / `PhysicalFunction` suffix; the generator adds those) +- `sql_token`: the uppercase SQL function name (Antlr lexer token) +- `meos_call`: the underlying MEOS C function symbol the physical operator wraps +- `args`: ordered list of per-record argument fields; the generator builds the constructor + `parameters` vector from these +- `return_type` / `nautilus_return`: the MEOS function's C return type and the NebulaStream `DataType::Type` enum value +- `build_temporal_point`: if true, the physical operator builds a single-instant tgeompoint from `(lon, lat, timestamp)` before calling MEOS (the common pattern for spatial predicates); if false, the operator passes args directly to MEOS +- `comment_one_liner`: drops into the Javadoc-equivalent C++ doc comment + +## Templates + +The generator's templates are embedded in the Python source as +multi-line f-strings. They mirror the exact layout of the existing +hand-written operators (`TemporalEDWithinGeometryLogicalFunction` and +its physical sibling are the reference; the templates were derived by +1:1 inspection of those files). + +To adjust a template (e.g. when NebulaStream's `LogicalFunctionConcept` +adds a new override), edit the corresponding string in +`codegen_nebula.py`; the change applies to all subsequent +regenerations. + +## Scaling path (recommended sequence) + +| Wave | Scope | Expected output | Effort estimate | +|---|---|---|---| +| W1 | First batch: 5 MEOS spatial-relation E/A predicates (e.g. `TemporalEDisjoint`, `TemporalATouches`, `TemporalECovers`, `TemporalACrosses`, `TemporalAOverlaps`) | 20 generated files + 5 parser entries | Single follow-up PR after this generator lands | +| W2 | All ever / always spatial-relation predicates over `tgeo_geo` (~18 functions) | 72 generated files | ~1 follow-up PR | +| W3 | Distance functions over `tgeo_geo` and `tgeo_tgeo` (NAD, NAI, distance, etc.) | ~30 generated files | ~1 follow-up PR | +| W4 | Scalar accessors that decompose to per-event reads | template extension required (read MEOS handle) | design decision point | +| W5 | Aggregations (windowed / cross-stream) | separate generator (aggregation 4-layer pattern is different from scalar 4-layer pattern; the existing TEMPORAL_LENGTH / PAIR_MEETING / CROSS_DISTANCE shape) | full aggregation-codegen design | + +Per-PR scope keeps the review surface small and lets each batch land +with its own build verification. + +## What the generator does NOT do (deliberately) + +- **No build-system integration.** The CMakeLists updates are emitted + as text snippets for the maintainer to apply manually. This avoids + the generator silently corrupting CMakeLists on regeneration. +- **No parser/grammar integration.** Same reason — the dispatch and + grammar snippets are emitted to stderr for manual paste. +- **No aggregation-pattern support yet.** Aggregations require a + different 4-layer shape (lift/combine/lower/cleanup) that depends + on per-aggregation state design. A separate generator with the + aggregation-specific template is W5 in the table above. + +## Compile-verification note + +The generator's first output should be reviewed against an existing +hand-written operator for shape parity, then `mvn compile` (or the +NebulaStream `cmake --build` equivalent) should be run against a +single small batch (1–2 generated functions) before scaling up. The +generator's templates are derived 1:1 from the existing operator +shape but have not been compile-tested in this PR (out of the +generator author's environment). diff --git a/tools/codegen/__pycache__/codegen_nebula.cpython-312.pyc b/tools/codegen/__pycache__/codegen_nebula.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..16242ad09cc2f35b624b04daf829bdb129f9cec1 GIT binary patch literal 252238 zcmeFa34ByndMA2sm6ocK1d@=1#Cj1(NT3A}$U-1M2mvx67Ku$5i=yt8D3Ge;TO~k3 zO6YD+4BehK?j@F!cA9i&fjF7aNhYC_$%G_t-jHA3?@g&C8&dI`agu&Z&%Ak4YMhz2 zX5Ra~|99?wYtiC;MrC|-?%DVAegE$}=lpd}j)%jqw{`#J@s(-ZKhTHv%TX=Qekq;f z-rz*8ixYX#(Z_f3?60HC!TvhCoa}E}R~r60`_lU}x-xi9OzX-N)4N<^MweU6?DB}N zt}M~rl`VR@a>T5zMPhc>Vlk&HS6uWm*OezOhM6zs!dxQe!7LE-VHS#y#U(HET}Aj? zfWJ${Lbw)-MKDXmr7)L?#W0tPB`{Zr%V4e)m&05ou7J5(TnSSUSHWB(u7+9K%ZbAG z_^!41y9R&P;cqGamf`PO{4JN(itBp$VN||rJ>1IRRv}f0<*HkyR07xa-{TRkq9;vS zhObI|trIukYdO9);;W4Lt-x0mzRH>3N_hlMwoSK+#QI!RovONO>F9_7k70%C+_ZQ5chO#7n{2p#l2lS#Fnm|;=ZmXv9)WL zxW8++c%W;Kc(AKkZ0p)9KHt?M9_rdB9`0%tk96(#b7H%LlMbMyN5995$He2med2AW zGMc{0iyh=Ac8Vu^9q>D4@jI=?JA-&<#V(8AIo0n4_?;JDwD@(aeiz{96)#%+d@Mgv z%}=uU^)SC))$fwU&u@u$+2VJ_;@4;K>t}v}UaEP};xoW}USdA7#V5pk!mJ#F;#G^^ zHIv_UameB~%=~V!cq8Jd#qZ~s-_J9@o8p%&eqSa(^v{U+6^r}JEY3e+CHw`mkIDTN z!=1U_Lg<^~ZJX;?;W{FI&F1)y*KzR&T_?of>*^4HzpGRHgRYa} zKkqsv{$bZ?@sGOBh!4BYia+e?692gCocJeQFNpu5>%91zi#f1f`*)Gl2d?DGmoT90;A2L~kC8xG1suM|*hH6G6a|5Yg;eBM5fqXkq#rjP)+!HSdao?*^m19142LwRo_r+R;ATuRPT&X ztw#_-vaeRlC{%ky3c|HoXbyz??GLQ-)yAxXH{7xZ26c-mM6 zDM3H#AW{pV>B7R_-~5))@0G7eatH(DisZRayFu97dZ4XcXgRvC^+0R8aIE=6N9zgU zz~Pgvjlxb=;9bIoT15Q~0fAf5h6#cq#05{UH;hj6`YvgW%1Toup!ZmRDq~X!UGWcu z1e8sds^!6eaP1P>g!)@4nFmGo_Mx)kkT4)iA(R`#{A9@6D>b621z}()d?^^H6MR8Y z!c6E6uqjeAFeFr?X9otux)1xRk*<6D2l}L%%OT|X0!xCDN&Ks>4i1KqMztIahJ{)* z?WNjqu+}ymXG-NZo?==9#cLFqi@ww6_0py7ad!8`@(&KZiNBQZeZyj_WPtj2vck@AYuwrdp8fDuOvbBsS-|M zSkRc+QnN{@pa7++S83%Amc~$U5S=t61kf~t7;TttA+``;s`{jXFijU<5RL8k27Hom z4fBy@q$X3t5;?0T61*7pBD@zd&~@sRS3?Tkut#r|OX2W9sIj*8+O=ynURLCqpxj&A zr&K6Zd$_HowY{UY8pT#3oeW@U3SoG?H0YO6!Y_0JNJoAe1(D2yGpu!rtbNwvH;6 z%IUVwgGWzx3a6V-oM>+EY-{Zhj-J3AYTwt^*>X)vWod?5gV>3Hl#cCXscX>PktcO_6Fm~F}OgCOmROT8{c) zP{vWJuA%J|lL-?ow8Jwxia|O$D%92rmIcM*9a^-oA1>^N^V|;;?0}5YPql<9d!lJm z)W&wGR zJ<-c-aXpC*-5#x{KU@piq~9B^xn$ny^@vy*PI<8)1j74tp0#G+B89e60Un|PQZ;d7 zV=CW-dl=in8ujI+LThrZp&J_qlqT0a^bn1Ww4hU#U?ly0gQ0F&3J=PG(aK6HC{g*w zN>oGKi+ok8xDn7dPwSRCFbJ+UG>XN_hN~HKIl-G?^1n0;naXa7t-YuJNh* znKg{Qm)nY`W@Gfse49qkU>?MR)>g+(wCcovg+@@+g#5#_F*Y@!gOtHiWuw^a9jUT6 zL`^CYbn2u^0M7yjfM~_h(b6j2L(N6y=2CT<(Nv%uwL+%qGc(yUV?UXRBCT1}J|bdO z=^aKMrA|tt#^*phY1#RE1a*8tQD&8F z>Z>aNtpagFj=Gj*QoYM)T%|=ZO-)gHynP{1&NO$~Y*1QuhIu<{!cVKeIcXy7m68xU zSwTawn|OIqx{lu8v_rM-G%sz+c-0@SZ#$-Dr0icHxr{NtkaqGoibu+NUO{Wv6DJ!9M?m2f5;@lN4-$keb(6c2jh5_u zdPPaoD~jFP%3D!cy{iSAhY=;_jFhvdOl^Yus zt0brDt_rq}*)}RIyJop}kgywoP?}ArnJjyv?p>o*Khf^UvZ5tI|5*VJTPZX&Fu`_d z+b!c0PFf%|{0&(loV{|lnV3t+eZC2~&H@^{fX03@XzVdn(55Y{c9yIiy8>}6IujSF z1qXJ@8^^op0oww=Q+lu`)Si%hL0Pn?IBVEeE1HgWG2GgUwW>Jo$Aj=D1zWX}XpLl` zt#%(3c(cQ;mgUbLM`bn#)Sl3pKDMMNjSYxS@mMUfDXlC1mO;_ zG^>Oy8Oqk9su$S9E3Bj$kE1OC@&U8cRc%M`AV&zUgwmE$S_O^9ClQ$y)?-4mUMWbf zL~&YRcZzI9@a&CagYfL$iI-K45zyHiee~$8l7@^BoyJ621KP@Lrq$GiIpxaU*f^hc zTPvb@nO1T$Eza112PKvN*6X4;>J`!5jXEj}xJvrRaT(eOFtdMp+&DH+PhQQ|!U}3h zf#X(oE^V(;b|{1SV7nXxmHHqISAI>#CZwc&ZqxZ1hOKA-YGdP7Z{JQa2$`p}YgdJu zoRW+;oHUuuvri`Mhfp~T9T0#Swwj*Xk}#P;e;{1HwL5Gp4+c2XED{nVRHr6{?zOHU ztV*nD4Bi~ueQ2;RjAV>f@CU9!IY{B4sMZ_Lov%<@ML=`1##8hO)Fu%$Pj5JZr&a?& zuY7_)N`ZWryz&MJPnEhI3(MAQD5bhBz=O09v^G`>)w=|+J_LO;es|Q4>_C)YVWe!p z4^@KJ@Ww_Gp>$fwUC-4LXul$rM>)Go+^&F$v~$xA6n-$yY^RUQ4_>qw0{TFhCr8_ ztBvr$ufnYZLEoj$V5c@vE3Cby&Iv6O`fJHTRe(F7cH!wOG_tTa7|2)0iMD-BTkE#e z?>H7je=-mZH3ky4M}>&B7OjE?i8`R{WuKuKiXwuk5Ea^pp)qA0KB^LdxklF@T9?qb zamm!6df_2pB-g%A^Lm9HFmtHGKyW~T^ibNk@k+BP96x;YCQsOyYJV7@uDKzN z`4X3zdEjf>GFndx_EID&R)Y3s%Yi*^4P<0m!ssQewzN(G$WB?L4of%N22uPVNLCo@ zXh~j_xUxW7fm%o)bxtgR)v|<{2-;5|WhAD#8G?p`5W3_AVCN0RDIBd2B}!5f36u3> zmBwuB#{Y_NNY@u*S!!E6sfuBuGUZ}uQfcB9MfJ?w%P8v!35ve<0t+F3FEm-Pls7_X z5Egm@Dxa(Mx3B@yC{k4t4nWJat@&_USL;4uL;P4m4i$l*aKRf!gUaCxLQkK!m$d@a z8pG>DXeL$T4U$JxtG8RNs8B0tbw;SVYJhjbRYlTV8D9}~XqdFV;s&0z3$2@@xlK&= zlw-g;3RV1Ei|iv+UQIH^7I{Up662uU+DHjD)WqZ5l*8z#QG6`;Y^|>{mU&~5raHF} z&p}ITLT91^*b2x7otm>k+g2#l4JHU}k#=HUV}wo^=(9b@tl?*SM1^{?yJ|T$Yq0Yi z0cf3Wo(~LdFANqVrj`0J;L!GRp~2^ZM*r>N1-xeg@A)4Q?`fL>*S61DZ2_^vDGS&Q zwxtE^=D$1ara1w=F*n#IQ3`WGY(mY6FqS!iHK1?yCa8yo(-^=@D)=c;3R@FGMhO9| zaApphFE>bvDco0I)Tp!9vq~O!BisQuZo;en5a`W%2+92$2=5 zzA}=@VJ~`=^~eH$Z}hWO&CJd#d~W#r!E+1x9Lj0Xg|okNKl?kYvrhK0ukgnvMFAb5 zTF~d9%Nlkr=yR~^M;7!sbTtHhhRmSL-=k{uEa-Ct4S7WZ_I^$f0cgp2>T?h^z}RxS z0YV`S;&n@A1_~H$^--Ao1WFwm`>sjxEflrEw`-~f2~toBG#|APD`~8jgqn!u@;Sf= zSUKW&b;Z@jsvAK~oVp%zUW~fd=5ynywOB0g1T0o6zIwhaEz67X0jf<`NYU9^gCJIH z=3-dopD4tFDu~8PqcL>tio^;nCN+_y%cg2w~X^)m&WPL+dBIP6?U}ag7Ujgzof8sB59)A0|}`xGBr> z{GbqP6I+*idn2pg*0o?B2^jmw=La-lOXEkc0qrF-B77q_hxUL1^tNy{fW3^FAMq;3|;vM`V&Nb8VF51I8&cc z2ScHazmOUjR$}~fh`pFpE{wxD!GNK2VYqt3robln#RwaRzu38t1^tY~2a7@r`WX@v zZR?Z}S{yT=k&Krx!FhW~afC5;7c?#^78h5RJnq7AH%H8vkEo~9c^HWaVeTaYG zlRuU2a4&hka5?>55zFARR!(I)-78}*E=!nlr@4ighs#t8^KYvm_i@^*P@2oALri1CE&Vo+L6^bonau8DcK3(_?w+@D zXh;noR6$p~`ov!0X~fBae!Q%Kmn_&5OBJ||mgsc6c0>BqJ_#>A)ora-9^ard({#;h zAY559U8++*NiEa7$7il09vI~6@c*;tVSL+hh~qJPM!56KIBt}`?G!OrP*h%KyQjA)48OaPy|@rf}|^bm$$AXY3j- zQ-_-@^>(W*RmD>e zsC#fRvS|CbYx|?-$Nb~wze@j$wjXvxI!?XgIz8n?=ntP!5xyd<<)@E*+-IbRui4j& z`5cU9d~vFaIrSD-b=R7jrVA10c%V=GC36>9Ua_@U;ZniwlTKwAf+uJ{&G4kWQqB}2rv-pE_*q?FE z?2McHVjezg$@X}s&ednWW&Bk#~;DPagZ;1zi7>! z^O4eRNc2`YobrTNp2xi==FCpdkh75M=XOCl5Vs%&ykc!Xu0bL-2i$96S(f70ByByC zX_b}njtBQ?EIBfSyqsJ}MiC6_x*;!z)9@P8ih(L6SS{)>B;*y8#!50)QLLf(0ZPlO z-BoS0p=NEdGv)y<&z+9j5TDGlChSIb!4oEVH@g;tTmLY5M&b#^AIfa z8s@t(%=hrk{6ilG`ri2sbQD1UWy40_&qNrs>n7T9MaRqBh$F$y>I~~dpXg*;le*Kg zeO29QN1WKQTyJHmM4P*P+JUP~%)1^HfbDwau;_apHkeUf+40_Ts5@E~b~K*tXpZ4r z`$fg=Y`EQb$V-t-l=rGs6I*qZ5m&ADN1ysI6K(}eu~)UBT+fP;7Tc=Xc}47{SMDr5S<)dmVDuncOk$*T57ssxyh+i57w6l zXD17GPh{=Bxet6=jB_n31WQ%4{LTT8FDvri&s%XP2ews>?>DwST#4=A0KfR@;$^q` zBg;45+jp-%#x2^iI<|cIvei@Ea`)<(bEQV<(0Z%=K8p=Nu0ie}bqA0)ArXbZ*bH0z zVqck{%@dOuSI{6bZ9wu?GPaRXPsVdFhF#i=e{uspy?>&tV2pxTSiLINsrKwAW+o~x9+r2#&J!{GIxo6)n@6{0!Is8+vta|FjBq)x z^S52hwg_(N%(hsMk*nMCbX&e|TcXD;(A^4kw<6tbsctLQZ6&&GnQmLI$6W!p3|5wv zy6-C8wptG-=x#>7Yjn3#*fLovYhTw#hsqeNYyWii1v?XfccfD=0e7r>Lmc}|bAjd)(aW z@;d7Bj1U=xp(#53n2(g~e0cm}%fry*(w6a}(<)1oo6lReXM&AcC229x88on2FCfKH ze$+9lLz4_kbugaK$?R!wxz*~InBd48h?mU zzM6~nfZ%W%?o})ub_@N3*n2KY!mtysY^%Iq8sq(BV%nm7IO+)WTUWWnY+&jU@C|A; zBGNR(vLNH{vI}lC-+JjzDR9fINfvHYIE9fG?+N8Bm>At z&Z1a4=WgTwm%7I<{dN7g>v*K|%(&~!)7-o}&13xQt>19pUNRQ?M+h+1O*s)o#fmF7 z@=)@C!mB|5!=9uH-dxM?NT-VVj;xx+J@4d`0yIbrzuxYAhG9QBf@8``NnQGJ1P zhcFuV9O&@R#id1JAuX@CH$X-0NtzpqdabWXdGAy3=?{H2i958MeUv4ekjb9B8$KMD zKkA~tA!p>KBKt-QC9KWWxYVdNdUB=c8T%%Qnjg&0h4+0?K`otv}>rWVG?h+|fUpR<*PJ&$UEVD!%egnsPQ_zWMY=Lx#_&5M|u!AOq%WB+j~dec&#a%z_Z@AGs}wZFYmTS{-VC7^FZ3q`w8c(& z&N6N|X;PsR#vR(W;g#wN?cty;@I0PvWc{B?I1FM-7Yj3q)AUh&4V;^#*GNen&T8Yt z?a37$CdPuW-`OVx6pWKZF$&P>R)o4c;SlxUu@&V?_)ye|erfQ_jQ}oN_a69{eDib1(fbT>Y}u&&U9%x@=vHY){wK-ffCG$<5*33^0{!MO^mM zTh+0pioLi}vu)URFGsW2@8>n^0savG=#=`!AI5)*y_h?~ALAcyiXly;Xmh;<|E4B(HY$dr?@D>Ts$;++!zoceKr=Nh&@@Ws5$>jKX=u2St6d2aQFvGXw>^TF4~eZ29}%J1hN z)#=}k1ALMC(Zh2~OYfYI^|E;QTDwiPUqbNdqp#BA@ z4hsr+=>@1xgCPy5E)hg%z;^`NDNr3iySG&kRE6r+eo9cCU4%nBMPd=oQ*0L|5zfa0 z)5-fWbmk&rN?yLdq4Kp+a?iu~B*8WLuwLjRuqDF3X5Xw)D)uo-@VLF$pAvECQ<}@XBhK#dh5bowZ8BbrwUCF31_6zWj#GdL4g!f4ypX?uiw7X`2 z>E2skuLLsVkZliXB(fsFHHya;1Bhg1r+HWh{s*(htqc5B`SgQIb_q6wIZM`nI4 zF0quzOhCG(<)m^_DyXEu33xpo_vL9|4Zd`|2F|9q2C{%KOk*-7$2oi?u9S1YZ{jO` zJuW#bd&%C8N>!pb04I@}oCc$)EQ+BPN6HJsKc{mlR<&xrmY>MQ^t`%wFc2+&KmIrPaQKx}!vKzpW_jJ0H3BtwLe z2wJf#ai|2TJb>`;g8B*Fgz=fdDlI(WDrBm_3RzWTg}Exw3bSh1iuys|ifUER74?I` zE2>??SCmf`U|}By!lHaC5DT+w7>oKrAPci0W8a2Dl*0WHj`AuY;B8bK}0 zTBTqu)yfBfEsC{90WE5odyS)_Hl|p&aGN&Y^Tq0z`xbu7D%HAGfe^Ma_pJ;;(CjLJ zpnf_J0CG|6jSA+ngT-ki&_%KCR8W^D=DyRhvN5Jufu!u%&qJ56nP*;m__PDSUevFH zyaKJAK&QNQ*$6ilYsp)`?$KpFL8uR}p)S`@#%4uWNrk0}g$0%lry4Vi(u zl>T$UhKZ>imrS9BpGf)1VbQ{;gO!>VKAmgJc#9pN#M!pYkB4i&@0iZBpSBQEYN?c~ zs$~P(Bl6I@PjK3!24K}QQr%GX?e{#$i!80Umv_%OSy(k*u;)Xjo;m!7v(dG;7tk)M zZwGDf?;A9jxlpb024~WMGo9a6#G<=ARwf7nJ&&)?8wv@-d+cSRjSr8v`+aeTS6YGr zpEM9gWFSEbRV$8rs{=bnldhho zfuf+8`Id4h+Ql@i-0DG4<+wCE7A^ID1!k^cW+^k*GIJd}A5^B6tDL#5XJ!R6E19{0 znH!l|MP`@;NbEPljX1S-As?)0)q{j89QF>;Vch0MT>Xm!&+KM;ISS+UtEv45Kff(R4okoDubf&sc zPPf^YG~$LO-(Xl$H7{nlcp}&1lq3)|0%x*_;}lg49ZxC^hvKz6xv#rX+?eN#LP}*(TAdmjZA@*lS4!&q2;MnSDkw zAxj!~=OI-Z+M5eXlNhZW?hV^p84p9IN-0SzZ=ixHTcz54A)Km3dmC?DLZThKB2{>X z-=eVe+j#E0Izp6(9@IXs5~#R!Te`#8ZrLaZ4Qp413)eU6)*-{HG^!G@ek&q|L-16} zqol3Y)ReaB5*lW2La3J&VhrXhg;UJ1JVdi$o7s)*=KI;CKnRb`lk#I*z#mq$C`2}J zcH5)r_1xTzMG?(Y!CWf)aSKJzheylR>Ixf$%{1~(*c0fN`h5dK6p*D*rL~Z5L3Ie; zQ@qdV37$t@>tEQk9%&x7r)j>LUFfB_2u!Pgw?AOYsTw5`dSpq`-Kc~W_SD#=hb$H2 zrN5d@2)W-L@))lB*dWlQA8aV&FWWo1w}=(g%hbJEzcR(DDq$1lxZR!(%aJ96l}jn1 zlE02~ZbAW|T{eB%9<{R#JC-*P-hitnLSZU~v0dn!Sp`e2N-1fTP|>NqhS51(iE&0{ zV#D8@IBO@Z6zoGOVA2+2`P*77PS4mF%85pgKA^SHbIe>Kva6$q0wMu4uQL603mZJD z?>Rj=)7Uv=PtiJdLU>~n)9l4|v2+^hLbveflp6%#vYi~Jxa$jpl_o)tceZ>6? z#%e^}bc0Vft{v%5zFXE}B8+SH9-#sgjZrsU(tw6tfC#T@fp*u|x;Y!5QN4N0w z^K=bQH&6HQbn|o(&rzOk;yKFGRXnicE*{u%8BYgKxAAoFbREwLp6=s0!N&?%+(Hk< zE#k5orj};88)C&=))mK8Nw)inBesk#?^&LM%X?OESuOn3%0=!LKDLU>I>Jw_UhF=? z#{@3R%TKMzbwjq@AkTe+;W{M5E( zZYUnrb6E%Zsppov5Av}FE~o77*}I1#wTB~~BU9T~xZC+yBbT*(YR5|V_SjC!qG=Vf z*u`Z%&rj`M?S7tz$`F@TGS$or?vfZ(hO%}|weV})yJGububgV-OWl<*=nG}#P95Oa zx^q7O5SF!a?A*OI6P~K6Hh!JEI_4}-$zVSE0y3D41#>et(_>*X*+mXwHe)k$RCZ3e zo$GVKX0mdZF=n$|E!`~GOtG5crDQg11}`9p%53h9V>Y3eQmtIYLhs51f z@m85mM8q=q=`x(#Qm=YRlx(hI9sJmtPWc8}H5GF_zp`GVvW`&F1S83#WH3(AQHkB< zhDZK+av@a&`6d}(f-!yI<6#Ot)6dZsGiR0%``#Ws;&spkIu|(yzRyU3)E4v<=D_xu z_%&kt%&E+Q>ub?#5{AgyD9D_cKBFB~!oi$UQl@W*N4`zn`E4o!{bt9rLHAi_)2{2b zA>GF4dJDTY8*UA$T6s13t2ExeMg_FcUsO;{KLoo!*Tz+b8C zRh2M1?n)=gK}}QMaWr`xyJ6+7Pz1(Y>Fafcl90k!#qm{C_c#JvBhZ!n*%wud!mhVh zp0yKYW^1J+BSmFQP)aLLPVTc9DQa|`l~OFqNKyS5M`al)@*6aC6En0b&!Ta(tRnU% zm*1rL%k3PGnc+#?glcM9bE1G~Liv|zHhqVTw6TM0fwV=gX5Jbq#*E;EKAm-vZXVkcS| zJJHJ6iFU?LfW8Jh0Xx_U*uhSKwE#N-)&lIrah~{z<2*4Ghzo`SalueD5JS;G4291@ z4291@423}agh1>B*bJ}}U^Bo@fKCTH0XiM*#5tb$iE}(L6kq_rP=EmdL-8E(6VDMl zag4DO#~3>SHUsfn2~vAU&`VNN=akW*mxm4iiTKE(k0|1921$jG<^?3`GNDD3CUB6iA#{iW0_B zlrWZ}k+BqwF=8ny881;8d!DfxhxjtE8aRxQRWi2xu6M#yF?ED52PfjJNXcp}$g*%c z{);KgB4Si!FIpODqcw?v<}S-Z{OTURj5`tt_66_J*Y{aTv#eD~Ao>4|&xEmvlT*!D z&fiSJRLDO^8$tq(LjE#5hEs|z*b&&d3W!Wes{0(#N~9tRvE8{DxP>^zlnGddlgXTB z&pDWqu*#ff&o&IFk~z)5I+&zi!zLcaDsxK8G$`^oi_D2}5y>S#DjktXI%8!FbW-GF z5fLThCgfLX5dKp#zD~w#WZWU+buzv|#y83M78&0r;}^*wa!wv2g9tM~(Fzeqv@H%d z2W4;H1_hEPg6WqioR#D(V;3QLCpABz_L&RFrI86Js|6v*Dbx2fOwkxOo*p> z74@BD^wT}s2JVxQh=}?vcnqh60+SL^xB{ymEH`(*q9#oS?wC}=S;ip;1YB@_p7{UN1rAYlp&`qKb16)#g&R1|12 zKDCEbs2@_2iBUHNFVwV1R80U)w603)72O_2U~0h8 zfT;mT1EvNX4VW5mG+=6kd`q6}l;nDI``oSjTNWpx5 zOWV(8Cpm^R>66v=)n(9Bv81%m#{&SB+9h*PY1JShmVFW!s9tL`W9zpm#F{k#mAPi6 z2JTW%CZq-`W;;3Le}go546ac1MdVgMbaXdl0ZecMk%#dXlfzlXwlfdyua|cMk$K z2*E%YKnMoH0J?i144}IQ!k~fZf(9ZB>Pfs-PvSM`?tv(P?jDE&fL{=>0sMl14MYTp z0uT`(3ZT0OssOrsjk-|n1W7Owe2?X8pxAoDC~hgA&tEfCSNOI;1I zreBS!=~v5QZ(`%1rl<&cV|p|{z7o+v4vlpt|38*&K#U@c5h!p1ZG0<&Digm0tb>?JFeTz=S4H;IZQ;1KkHaG*eB^iCED2Hlw zq`$hlVA7LWY8^F|!IS3LWH(d>jiXs=QyDF!=nb*}q&TRiY3L5lLf)97>|2uQI;t%= zi?XvM*l9AgBeX8j4wkV1RCYB@qwKRdSw^E0K)iOcOwG)q_sHBp%%(V5hHf>TpGkSL zj7l9_uQf6hM4+?7&a8K(%E-Ii-js${j z^Z2`N>oA(tW_809a&PS&WgYl5xm_6E6tzdI69DoaA0z@qfneAns}<(lswgc{sQt;jDPsTo{3_mp95#b!q+hV zs#fK%X2DsB^)vEU&kde5_^SiS_$%vyDz*yhdl1C)co~FU37bGw@Pw~>hfp8 zUwxz^UrEMe%`CT{ZXhyq?u-_8%LF*DH8n=enHiv@>=aUa2SZMNmy9Q5JSBsj5{gg( z={H-h!6K~&#Hk9d=XA4!MvB^b220u?BDAy(t40IPieq4nuhdR46^?%I+umCd&{P|^lf zt=v&iZY~1ZRVn;t8#T?Ke{>Fd%0`7wAF;>kYy%w` ze?No1ctHk_nhxN98|}<)Whk>Jr=EAAoE6HMf-xmdWj2_@tKCbKdtCQ!F`o!Z+PxTP z#@J*wbSQQ27KMG9Tlbn-rx21hbuS~znQo4`0&4fpMEXxB>+d?NM#_dgQP@mU;P+RqLy;VqV2#y{xlw%{e8ZVO%l>bBq|z;A$; zuqj+1F8B?^1;2st;5QH+{08jcH(&?9fw*8e5EmQ=_z-X$;6uQ1G!VzpKpe-5PU1LT zbP~rQ5W^u5zX3i3k`?eFkgOmd@Egbn{07K>FdU%%!Er!}0*(Vx6mT3{iQ(8v{01aH z;5VQK0)AsJldbHHJG@j!EJqzFT+|c8QBV8^asj`AT)=N27cd;iWe>=AWJ4SW@*$1` zS}DYFKrLk-zK|Jl9LSA04pf|OLO{*w+!C}yi06QM2nkl|7^hLk7!7bEbY=x{GCQ(%$C9Uc+^P@GLBdU?PfX^0M|JSLMms+Wa!~i>Y)4$HE5KKSsX(8 zTMG9c8UGs@|CWq@N5=bP{2dv8PlitK3|Gwp?L|RJO9pgO0>WrmC)XM8qMQ&1DIRxI zmC<|&z+58>gT%T^CH)?ZxI^K!bDXfU1G~{(BD8+_zAXpGv0D3`e0fGgw1qc?z79dyy+A7AP4ITOedWYyo`*x(o0X@NNUayA1^I))T2!Pox%d0j-5xKx`ow z5L?Iv#1?V^v4vcS*s5o=Ry`xNkP(qu$cacTWJRPF@*+|TnGval+=$d_V3bw^BeW2X zFkOTLrmGQGFGM`&8O;TSTRXgKCbU3Y5xNWFis0Q6MroBWLJQO!p}U~w2;Qw^lvX7p zv~n4tmHPn^S~}EA^cJArO(}`1M_)kViV-PaSg7|Cx&EphYnw_ewKdZDD3d%&zi(OH zOB6{RB$jlZNhgp#n^RSB7f8hyJ%Jj`-+m?}()`N$UNWj^W_(tDo3^drCgXR=_-ADN zE*THVAcR!@0U7$OMYe-7@;@hEI`AU@5gGbn75R_p(|R69{!_RqH$Q4b5&hK$4PYzz zUs9|;qhQO-LCCI(e`W0K`h_p@BMNWq!hcSm33uVRt6AcQf$YLc^^`W=g{xV1YE5z^j^jga=0+>PBU;iWd8vE=2L!bYNj2IbHWc-wjXJmXp z#y^trEi(Qy8UKZhpONt)8PjC^S2F$^8UHUCjD^m?_GS_pWYVXxlg?jckaS4M*~r3$ z7F`e-EQk!|E;3Me^0N_7*A$5iz?IrX1{I8vt@uPm29+82oidOZF6uhfe4>M7*U?Pi zL!`|OpM3Jk+<*9Jb7%e5sN?$P`_7+GXgLpqKk68wZ>Rp9!36l^mPYY1PPVmEG$#&6 z!40%0CoiISnd(vM$_zON-*`!h@=?;{uj8`-uIlFyK9}mB=`060EhDGpFrtodNL~qx zUK5swyc$mT)r2Wic`=1CB`xPG4tnBpq2j=jruxanio+_hQ(p24a>$U^k-d!U=JW)` z!ANh7;$Wm#syGN~ob;S)S(Nzf((xoBM z<#GN72@_qN!jl!IEL8v_6SX$BjS+>_acR9=EfKSmiLN5{GwX(O>vhmzdrjgf3I+gte zA6Sar>YYp(8^r@H2hct)~D zvPW`y()MxZS0l|uBa1F)$Cvo>;&?YPU(EmQC0bkX+^cKSxDmHlaHRrsV*7~aa$bC# z@Dj~!#4(aKlKHmU;zm1+WF?GOXo{CP;);(KXh@RdQd7*iekf_e97nPfmUOu} zp4K|1`sE~w<={p#kdHG_i_Bwu6|!+sG?I={w)CxZBln@q%HrXF)7tM33tNRAf1eZ* zdV;dxHJxh^w1>Wh!4O^&r!yA9>CIakYGG^_!ngvj&l{FPH69N^P{9GAe-M`jT=HI( zz{W`z2m8EO7y9vdoc`_z-FVaAF9pKg!GP4==MT_zQr-Y=mI_Ehu!nMBX(=no2H}b{ zgks6Te!+a@@V>T=W6hl{2ZfM?m!X0}r#vXtuz1Roir+`ONAu!x8ct`|eGV@d=vhZ= zO$mpEURsUMyh6~7ufzY(_QUu#e~9C;vW#%&i!nR++m1x5$q28taEO1kaD@Lw{tX`U zVObhC#Ql!*8h@W}zt2aVczgXm=n^U?e0r&S2nEN~pjy#b87h+`lAsXr37{06_Z`tp zTqBCH8;ZK5>ky-M2d~I=7%%@w^p_y~{dc}84Ce^vjK-`TUUI%spl%FHqBhGsm5XEm zYFsoeAYBhf3la_Ns53Maie})QAxV~_>DOd`Sc+ySxkuCcuZVs*>S3}E;1MeM^i)I0VC>G<`{Y!^`e`EdIHL;KoavskK^#!P@fdd zRXe{MUD-Y04PP=`=<*@vlBac#5y)`TL-7M4+B_~`u`vCV$A*fNjdr;gg+GfX4!r}* z&u(&f$7f05o%7@QYi}NUnqP3|-0QVB+hBR4{PprkN!5e&2mS}=B74q7YF?PgKYz3J z$GHU)g)Nh7woMkcJnEdteIB7Rb0e9>@42#G^W644aTSldipRFz%^DkxRN)n(_DR># zr>;dm-n8%0+3`(B$J45B9=LUO%yYNx{o=Ke^3L(%&PbOOIolKI8H$`99xon_q!m0R zuVdrI$C7xR94|f@IoA{E>W%c?h@2T2FCK}c6|z{z$BU20d%eGCRYcen+0qheJr&70 z{Zm}su=N)I)a8E7b=&pYqT7qc!uP~mi{5e7#hmcMMdq%&JFP#;EP3iGe&Sj??piy! zuJPfH$LWuUCf1#ubamO>-I0#-6YE}l$JPD55nb$;6sNlWB*4oR;~@ z^Iv-YNm{{pTEU&GV^_w`->ZJ;esCkQ_f(|t^gC&1WFm|#D=)qkdXARhH@G3b(lNZf zW#dNW2|#(!7Y@qRxPV3o4-H7_zGYi^lskW=uq4++7u)>Un<}&p)73T@Rh;_hZY~W~ zZMaj?avywuo(3OrpEtSpvsTQmu#Gbm*1krWOPg!=RGxsL?Z#Z#JT|Y?wXU0$Hi#fE zn@hV=DXp1QrWSSL|7Q&_Ug6&Wp`2(VyTya-b-e5v;S6$D+uCrkq_cgvs)}v7rkR|= zYUy2SOSZ4lYGvA23us?;aJL=CE()rJ1HH;<`CsPVa;p1j5%yCD?WdK_Xo-ee(uiZ zuQlGPy5k+=$I9Py-?=gAT07+=-w)~W0`4ozR$`-Pud`J;WYEBz9H!2rZV)ag>)m2o z{_<6XxJ@~hArzLmr&*0pvUZPW?S96we5*Hqz_P$+c1DbIXlezBrvLQ5rP?R!S@bH1 zm?XU_FG5U9XHlB0vua?`NuV6+Ds$I}4!v_0qjQ|BbJFAkh$Pdfl@G#}@@?GpN{b8( zhAv4VZ5AfzmOIo)tB{)d7W$dT-pEpV5%<&&w?EwYsAICQZM@*jhtH_sUtUtk%Y(=s z-9i0eo^5XA3=fPUQ7$9;d+u1&J?+!kw1%@I zX;>781!x_x$1eN9F;&22ka)LHjqeg}0|qI4ZrXXia>sNQMbb17Xj_SY8eCsRXcp?L z2=GB=6+yG{`udTrE$(=9JI9i}j2%Kanhax9BCiirX?+&UjZ96J=ux0Xodekii&?GXr;An<- zU_c6p%A1_!NQgbriN|x;`p<~(UUH=ZNBM3>P*A(6q=yR4B`dM~bqvinsf=`sJ=Ue1 z#W(lAms>Kn?wgB=G(5)NPP@h5+6=n&wVc~IW7&6)-))JkKk%4;6neZiQq=yA>nPEQ z$N2ZtJg*%2(vhd0!aG;)oR5@liMZ+>h=1h&fgd%Te9<>4_C_xCO^E#yF9s%e2Pf)- zO8GYkD<{@G@h{AG0Dba|=?r7gdq zbMjXZSbmv|t4Q->nojaBP=W-X$*;f`KWnxmnKda^_}`)-iS<#PHhTslUFRM(MX<;p z>xgu8PBxz$-!q`h8~GMxPxOU+n{2OA8ED}%%>or;j++Hq3FL1e()TIPZy=(58aUHW zsnY<1)VLRYK55j*m^n)Rkda_%blrBa5 z{S#7PqB}UbXJF#FfpOPBBy?@ubuHCgKpFL)3pTdP{2@yH26qVy-S_!Xek3s#t*^$T zjuD64lq8gn6^m&MVXYi-?BiZ@zLw^5_HsVQc>qD$er4d;BYG^8Tbi~%^f+F3yt*=t z^I?x0b#`!JeMd4d#}Vvp1clQ7BEzM%*rVy#Ju}RER3er_%;@FpDCj=!j^jL3>{xk$ zZ;!adOiCX(H<0eDoLo8LN|=^QbZcn={mw{;t$Ri?!815UJUx250*l)YWI78eFHIdw z%(lepM64Xv+SN(oEmCr`#!C`*u^QHG$>SH0M=r~wB}u%zMDdb@&7VWqC5ghm`oHQJ z{!DFEXsO4)N4z3dkK!a{Q+r0V#Jj`4nu(Z8S7OSr>cn#@Z9Ac873J9Y5gR)d90D=<;;r7zeLZL!NW^xDt zNmLbrM8Yd~vzOc|75PuQbPYnNzOWz9mY_UJRKj%8?9)DSF8X^-ev1ZVf4^5ALj9;^DISTw3DJszEAoc@J}qX3 z7KF7FgR`P(RN<%-JrvDQbS330=)}sjXy&ClcuCiznJ*1`#f$zxG)KKKLoLXiLrG_6PW`l4xc*;&*va2@{-K}dmy4SSXk$OVM&bU z#a-7JU357V3|usVWQ3VRG>!f+U5{uwGL^Hz=K=@OuvFy8IR;_$x3% zggh{!S1}YoaFIG^)KuiZK*--EN;d-X@h10E4_A1Ezj@?+ch+k~w~HdV!i0Ox&Aoq< z>ArRGwVvBOcV3uSRC+h~qea`ER@XjRyy;gv?;gL$e{0E|k*;h zo$T$DV)u`7))_I?>O`t`M}$4^WH+<=l>I2DEJ=`eSrA)=)N)6v_e6x|$?UyGT&={7 zsL{JhjZS~H+wh-L%&s5htd5I%uM1V1MAh_GOpxdNW1js{&MG5mt@EjCllI&s>Y1uA zmIlxYJHIZSq27_g>hYZF_w~Y9IvYI+hBBwbIaA3TY<^U zl}{HhAGmOY-eE|RwH!)FrDf19N}VK( zdnCgM6V?@zD0j;1Z7iYm8_f*s3P_q?IA8HYD776&U78=5X*|2kSZOFgjk-k-$Tbh8 zC}t6PMQKpG8g(aW&1^A8Pd7_kBrYDw8U{;Eu}8C^E~G0lX{A8gxsc0v;`?$m zC#)+jX(iNawkS-+V!t@Q#bMG2vG@U$(rTLQdT<|R%$$?okvIyqVk;O2JM{;47Bx$u0ahX;=gj${?)N)Ix z6-h#^5LcSgT9qW!DsiN)l$BSf+(Z5~5sOKSPKLu~G{m zZupM#*ZI+Wh)6f;Dt%R|O5YN=R_m@cs%rsUYjxL6sw-5L#Lc?v7S*+AWXVXuNa0A4 zt`xX*Wa(v+z1e=3*Vr8JDb|T~zr9r}sj3vXr&E|P9TNJo-)z$fS8Fjw^7Xk{Jd!t3EEdx`n53_bHFw2GQNohc zYUvs)v6ep1-AM~PO_K69EtFiIB<0Oo%1P^3Y;AMo_Nz&9tDiA9k|49+9CEvyB)8{g z%x&8|a;r;{Tf>aGJvZmvoPqzAB)9D|=C*wvx&5moxi!w18>x!1->m!18TfjV+;+^E zThlypJDnuAoipaPdmgzZ+aa1}%&mFOxj6zqNm936Gv?MZkKBGQNp8Dm%&m1Ex!p*T z+nyP7J1~#j_9e-!dB)t@=8;=YlHB&rnA@Q_=f(%#O_E#7jJX||M{eIulH0x+b2~bZ z+%6@_t#!uSj?W{v%}H|Gujf{lWH;@YYi@!6nk26SGv-C075mM0O%5bm{}0ZX*XcRu z^;(j8wau8<**WKRHc4L3&zRS_Ip?)D{DL0mMa^dXz3esYnoT^!4qqHLAMTk)Do0o< z?ITMr`?QpezZO-=qh{5kA&7zv5TDr{qi(?Y$J?1Mcw#NTJxJQ5k_kR_=A#a(Qsz?V z?XW`*@?J3Batj%)FcN5AGNt%#?KD9Gb(|?eK8cr94>Wk{#`11$d9D6-{hc+hZ6Ej4 zDf)e1S-y&o<|t|lDt-zDP|_WX<^-U|Dan#PPBcqVSL!B|oE;a{ zU0CSFdSoS>lB7%1(1z(NOagy<&kCNow#MI5JcB}B3!|uKlzqJ zZAIV;nrf>YMiiEHN_D&$8#4oVPiPI&V!BOG!>h=6T2&qKEFWtg>v^+nY{#T)J(Tb& zRQ1&_=NItu9@InrKH>oLS0oB~tj?NtG-N8FXg+h&gdIw-C6-`{-c_`~8c=o3wd;9A zi^9;Sx+uvI3-k?2>~Uk(XWykBU92MbT2Dsvwa`HNyCD&R{AD=(#^|0KqmVzS3Hbxi z|BbrCJ$*rM7`+u;q$J(bAMS=U2&XI9cXUbk5=1zcf_-8)B>WzcCSd9_JsDuXhOqRX@vQl`5)xtJ(dKkiJ;q0VBZHRR_p7Y3m% z#5L-I*lMf>`cXtC77hdh)!HPfW)UHU4hjAcPP&DKAsiX>?jV>@fzx6eAwRx|bCA8EN)J=btK5Q9DS;swR}6CO=#wI-BxzuD zu_mHC(b{?PM0-cng9DJF)Z>N3n`xV}Lj>&1icF9iQ)Xvs(oB7nDbLBcqmYx&lkp;@ zS#bF1fi}oByCL81?rc4B>~M2uYcxYyO$}eju?^qCV+YT6#7DyA1HN#y#2X4p{TKTr z+Mr)EpLQ#zfrtp^N|5RIZcgsWM`Dp)G=`>>`0P=5!>jcxX62xM2@emJ~HCcXiAcX zrQXS-Cu=q;Ld)Kh`}en=&{|wiB)&(h)s zVJs(~qZJOMK8~sTuS(tFU}cH@KrHbXQQjAI$l<6XAj=VoH%?|-`=M#4{2fF>A!no5^`|mD^j%n zUjC%3>b;!YJNb9^zrO5i-8c6muab&;j(hd@J(FAaO%%7{bZpGS?cw+GkIH{I{BFVX z57*r38S~!Fc+-Dx!}zMLKPuc7DR}D$G*p+XaLlikC)p>2bLk1yX8 z%OaO-&Rujz9;+T-S`o`3hee!wMPy}7Y%zW0a_*IpRhwdY^pVfGS4CEDi7laz0?xe} zx-PLo`Y7Vu%f}AImXduH=U#KS^f$|YwLDVU{HS4~^l)r7xeLfzb8mcjaH6y|wuanG zk%i{o^zhn5>4DfKhDBT|`Bj+m4T{3p@yFG9AM9Q{3xHhqBcdVM+ zYf!i``MX!&yc#LrftFj{7ON%qP2B1=O6cbvE}2->^mLV=eAYiqi~s!THpIEPA9qLN zcy(FF_|lHZSut`(ib&TZr-sIt4pCn(Esc~N9bbAha`Hl?(;M-IBPRyOmkw%&vS&JZ zefnbLlrQ4D7U{e`UVI(HZtf?q({UVn^?2IqNnz^~VaGWAYkk-QV=`_3)3kzAp87%R z`X_6e#_8XIM;S0C(+>W)XxUi(H~VfLeY#=W&7+Zm^6|9w=IQy=Rr18OZrrtQvTWBw zd7^CZyRMd}ntIr_Nq4;|z?mmy-Q)C6j$C{R=DV(t9(2>B8#7-|tK&&o*Es#_kDTv= z`K~LV2i-X7t}+E}e^PdGoc>*koau%6uFJ0n-7@K}GX*{Qr0j)p`WK9J2VlPI8qk9_ zOuDz5f}VR)c5$5k4MwCe%y(T^^`Lc=?yaVvr=FCZAE$oxLe5-=w?M6twqA8Ja0D#c}0(9k}dJ=9?YL2W8P>WU+hFy~h;q z;*&D}IQ<)m^xc5@u4`1!Vh+`uLzjFq!>4A_U2Ce=@h4?x#_8Xc$hpff-*xrr)heHK zuQvs4ds236oc{SD9T-HucU#`nn!=!toDd>?WWu4>nuQzhK2j)AjOFuT>O7V12{+%6ns$(24 zyu`!Ik@*jtPPgX+50~z;->MMV&=lF#{$y9z_^vM8Co!?BH_~(|a_MTM@Y*|R*FSs~ zbaF)!|KU%Ixxzzy2nZzi=UKTI)@1x8mv>=(+Tef63>2`5 z!EGM!`tV2fsS-{>4;#3Uu%%{`P(cAoRj*RKEyMT`Nch_j1=w6X}^uyO$r<$5U` z9tbto)?T}It;WlWToaUgYx|T6g=!DCwY0W(v{s|oN~Dtk+D8A8{j#Egj)R;C z?*$7h^m(sA=Uwpj$`bsbHjY9NV-JSC3QFQV;cLJISas>*J=qU9z|v}JWe9vQ2SB@d z143zYhtSqhD(r3UXzNfeQy_x>=*dpubn}T5&F!6StsTPA6GF?;_I-?x#MgeIx&5p_ zD#%rWgf?UP@dH5WLR3&fHvE#PG+u{9t*-YO14rmPG$8r>J$@f*7w8@I_DVu8U5FGQ z5Cr=6{r(X3Y>4hVjkw9ij@`(_u=PaWSuTI&=) zX`D8oM{sj;)wZyc;@WC-iP|!%ecg z$~n6y%00Q~fD$u9D?e^pnbyV2lV9BBs7QM0?0MvWi~sjRk4x^+u~VRGlCuaG(Tg3>)b4TrO{$vni5;pdT> zK*IPqds;%Ms+#t-G^pFlu?6Toun zkfsHps>;Lq!sF<`FbGJz)3;#Wpw2Iss$mW9YW8$)ft?CcPHtHuKx9Vj*FDsVBfPd_ zF|a|I{T@G`G}X57hZUkB>T`8?RghtY1D+Zf4#*rvfsBmzw@88l;NL6$TPOQQL7xtV zO0^K?_Mr3H+Fc!29ipfTfdSEG-ckhuLL?Q%d+Zqs6fy^8@JvMTWeN`I9N_z$ z9XTq+9xC`@Sr3Vv;vsULZNg~3H{Yop`56kP>AlrRiYQn_*GSW%6F8tG&j^8-MeS^{=;XNPO9X%>-eRJzpDHH;7$mUH0Nrg63*;Xf?*0lKKI5mC-e;t00NuBLj zqJ8R=sx4=}tzh%#42{s_nL``;di(h7jPBEoGXk5&h&Tb$;!B|16q(A)X$OLq$XgBc z$qwP@U|Q5@27(E(u>oy_wgL_^)pB%$Q`;?+)`HZcqYwkZ#CLciVDyBR7?e1?S5`7` zz!cCl!OqPkQYK)hihQ#4O9F4(U_^_PN?$+T0|#Kt&C27}vX~pMLx7DP2-tT`=?EI7 zeBRN6Q%sM$lJ%lu468*IKsyc|0qpV)Zm&xYU3)w`6u+n3D%X$lu~X^j?dfs#`C-tC z4UfwVDs1Dx8A{l8;K&coZ>pqSN*g48;Hm)ZFPC=G3k5p9EzyD%Lxz$CQ`{}aOcLJ0 zaU`Vg4E;i-EjLkm+OFlSl=f4iO%*UK)K!T}%58nutvw z)1=SlO9sADGv{w%sZAUXP(X}fqRmh!L@U*aQ0w!|@LA~_N*jPZ>onUdlq5=6y`my{8r{-I5V2GPLvNIQ3#_TA1B^A z0h?YJV>0rXFeC;<+zg;haR^$i1?D-BhVU6iGr5?GKax@rqx9i3A{E(`l!_#!B1x%8 zQYx}QO_-Rv5|fpXNn}z`k`$CcP;ygcc;ZD9a}bn36Gi#O7c&9@p^?C<(XEUh9gC%Ortz9lXd7Ad!n#UM|43m zuZi5^EFQ-TEp!?*aSc$$+cbX!6$$du(v2!hOiC;Csyv@9-5Z787FAS1Ws;nN{xTtj zsAMJy1?8JgJfRVXba{H!Dgv;+XUZH7?p0gANhkW}0uX%T#E?-W4y-bRxWPD9K0SE| z!FqTaNaIHP41y7qH&3AmgCwpxE->LZjC=W*wdcg1|-LIAxRok1ZbryDn#O;R?rbwj7HKydu*D{Spljzh44G0#s~XU zTMwI$H5W}a*yhJ-F-TOZO~^?VsZ<+eD#)zY;n38_lA1~hK$@8KZKHmhRoiMbRTKO= ziOF2xz{fE#42`duuJKw3SYuQWW`-xO(`OdpR6~A2u$q9x1v1mVQ~->tSN+tipJRd^ zv$xNiqz4EZAS98jhyMC;xmiOaS$Rl*{e(Y;1qJ-1ArJ=Ui(&|L3IWHG&R-CIH0k^$ z>HLL!4HADAmgx1Zv`>45F?4g^pY0d)Rn4FrT)biVjGk9Fxtq zXx7}e+~O;S3=_6rxAEq4n8~iUDQ53du2UM(bc>-slKLN?3*Rd$$q2E8x&NBkxLncf z>v^fPvF9l!wun_VlO71qIeWo{rXt$B(pHfch`TzGy? z9E*G*DNjghh9osZlA0lls~N%P+UR7q@X$JiU>B$Oig1B>LNJXNhr86*BB83iUnzEh(c&PEi^F{RSVHD@mS4j zuArg5Cd`@(OvGa~D;mwk154)WHjcA5k#~rbdQgUT%Y>ZIujT@uw9RxErj?+GzBTss zthE(*y=M9f)7C2}LDVbmXVy@NHB`IrS9a^{{C!?Kex^ad%hqi9XQiv4Ks5VJzqT&Z zUBB6RwYu%sYAuMWXRo)wzhEi@ajl(|_JUG?M)-iuJ!vfP<5h{csbkiuV50+EzJB;9!QBXG<0XW{RZqz%lb zgMy}U(L=mQ#a!~BwN+tkDBncS$3jFeC=l)(6bS@VhE;OJWCr4}i@(sZ!5og+YFU&E zCnSUcR@$d-AHtw8*lX}-N&g^;*(>6$XP26LEto1NTbx*%qd#(_Gs zIA(fH5KQyx{2s4Pql#Qikjvk3AmhM#&crQ?y%RvMW!Gr_QVQOryZ7ADP1 z+)~oaBpG8k8Dp4*ZJuY0VS||oErUssOj0C6BAGjwBiC{Kbf3hAW<1}Q3heg zvL*@~=9(a;aNwkyV2T%g%t;9(=`bW(=>*p_6;R9}e9wLi9XbR=DpR6W;HY=qb_NhjKq*I%jD;%U4lc@1#N-=8VwTe6(B2zUUQ+VQfV`iz5P~w@Te8>#+ zn1CqpTaL>(_+p=$5ybN*Tmr6U^5dR+dbg-cDQ;(^zmj-7nCUF0b{;;S?-lzarxXm zUSC(-%bT7K)Yt2)1;6LH88E)@ycVeJ?3J&%@a9-{49d=aAM-tF%ntxii#8{<#v2&W zKDwTiT=>JuNIC52&k#t4JO(T%QV#fyq&Jjl?U97QfKC7n*neYY`2}?v6N4<&8;V+x zqK1O|cz9+GqQm%KE)-y3$sT`yPXI;5;{SMk*L$ye94e>0{f$cwRZK$kVlGe-kJYS; z?^NY^(K}I5L!ClD6Ddp5&zL(zLPLXpX^s#xg$5NNT1^cB zovE%y0@&iFgqZ~%i>9ri!W##KY6@gV4E&|qp16;nKgkF%CRSrY9tD)adKBkb1BPscqujHeny}z^5BPZ1}lIj^y&*-6`FYFh;WuAk9PmfFSDq^zp zo`a2#>~eei{RB=tG;=ZY5$E_O#mvdl2fTB_I5a}Q0dr~nWHfsnk7w<01)ZxGNT8ea z4>-b=XEE`Fz#o61V}JR6{>AmWB5)Sj8^P)pyLh)YCgJVT`vWlg}jKSm4$^;K0|Qtv3M<*P-!@yV@Q;jr^%x|Zo> zPqEg|kPSJ($Q&m zbzD{Q%t1w`ueYy_f0-x@ag6x1PJZLMQ@osZ_-G_CO0gj5fRbbyE}GhAitnRj)mEsb z7)pP7o>c^J2GLa9gffG$MJZ&VTJMBI1~|k_@p$&T~)<37S-+M z3oT7iRy7P(*x2+qw3Ml&XA-37OAxzviHw8{ue8QLiiOZLITFeq4Bv3uAj89UXtw$s zP7|#gA^$Oapu`t416v~xF^5`{VYWceS6X5YwN`Qww=G|4QAsVAByPimhS^^Mm_#xL z*k_Q+bhK+!W0X&g`Z;lJovje0qn#^AFae|qk#M~bwbr7_qE6D_+MpYZqjX|3BG_nuox>ecHlQe>GGoz8tY>knqeOm1kYVwSQ zYwc~~OpoH4GJ|M?j6q-p5}R@2MH5`8k=P8z%sA-z6K9~IG!+T04r(_U!O&F0sYJZN zEodVtwRq7DVU8xH7D=f^QfiTO=aE#xNJ=fpDx0xJY*$QNDzSO-JJF=n!VD{)L#YKL z7H(`Y7iS+r3=rD}i6_sCz~R%5YOL-MwQ$(budnNaO|kGL$kM!<(<{uJ}FXg z_4Jcj3(b1kpNTn<*cW4VoSnRa@2^b?*E%XmiWHzJ(hF6YZ4#5M7l_W#mre>f=Y^qW-b~N!ux}(HP?Snd;SutO zxXFmQ(pd0TeVPM);SWQ{#3);Oex7LZaqN&^Ajc#V-+6IA8A{v9u0vN56=byWcn#$FN`3gEyrT1+{WN<^mcfBer)Ue zeQu8|1-d;_b)TyPf0Q@n(s_^UN0FuMd8z;9cMA@^yHm8{R-St4JxPf&p?-DWtbO;6i>EzUUi}dONi_ zC08I8XRJFA=<`=qR^GUAqr$~NuIQD!DtmZ?{FRLjwe?Lc^*aDI|LB~r$K&^7GxB!7 zS568tl7ft+4~zNw1cj%xr2mQ+$KZpQFhjhJxkfu-b2K~ozD`GnjIE0o6wEQ!hbIj@;jyhc$PFrZJ=I=#NOPG8ue zfHtF2Gro>(B`S8tpHxE>BFR(%w?cFE^zg#b9j=*HfNR>qtk0F=pv7=l8xJBJj>&fvQc__jtz*>0 zh$Cqv9i#LY#YpXwEUKCUh_w7zoY zT&r}Uy1BW!skNcLMLN?gsU8b)cU-D&x+tA$XsRohJlL0D3q*4u?Gpf~m-Z|kH{YPN zcxY#%?u#T$pzPk?=jrfvdOOfMUsu1Y%OiF5!ji{_MoCE?JIP}wd2CPE7%;M`%EO{R zdXzQuGjLEyE7aoh*t<+v+Bq=TjG@?VQpVi5>raKX-lg)@*LQ0f>Q958_P1d<0xGqf zIk-J@gG~c}NQ9wf&cS?B&+5z=RW8|#GvB3U%>xXSnX90VpM4d(XH|usxu-^`a4XzB zwQV-6{jTYGdwoUJ6qAZ}&!(c?8s|^o^ml1IKN)y&>L&Un+E;)aX|J%`1od2zkryAg znNweyefcSEGtd@3J0v$5U4G3Tj8g!vFUlsPD=ElN3i6YijN~RGxyeXwGAP_iXTPr_ z0I_3**k1|NO9)ncE|Sd1_gtT2Md$|nP zSxJ!S;LlimOeUhkAT@A-2#jV5<5Op0H&C5jI0wFpnR$ay`z9ZdacP z5*LB0V~*Ag8s77!az*uY`mlr=O6M(KWQtc5NEg^$@*e@|&QzyOmXKhbgLJ7TT_)13 z(>}>zoz~au_f&KTKQ_`;0<_(DnjYxv>2(o8KNJWJP8l&b8%m=#D?viJh;ose%fMV{Yg2Jx zE!xV6iEMI$?>~?21)vLUZCaqcx3?$w9~Y&0Qt46VN%JMCEKnv@NoAc-K$_*6IJ-rW zfL&;lGXm{i#Qg{a|LZ~@&J&`{dGLhMY(J>>CR%b6 z12vk0G;4(GhRKW`H!rm~ke@XIe-pGpgnwboSc@)Njq*r|Qgig^R>d|b?l}c{A?-Uk zi~?jA)>!3c=BP8`D~)ZE_?AW8jjNTLD&euVQf>4YWAC=K*7V-o#=!%-&haTY^_F?` ziTp2sd#n(DKq~~>A7!!CwtElQlCZIQ6B_B>Y)h9uJd4edG)%A8NpR zl^3;e@P5oO$JSQb!F-ZVm;-~74o2MwWgI!5M?5ArBg7wogRqk2tE#PeE(Lqm9}l7fwYg?y677@ znx+;wbIZTaXe63>#oy~AZ3Q;pDZD>D1GUs5%Z$|0;t(Y;auGKPDCQ(eZdYcBlN6_k z^0%vPncX~b5+Rxt;hZVstPV1DHqwqeR%2|`v7S2FKAY))9nCBGO_+;>v&C-!kMcze zF5?{ODK`|+Lh!q@z%Md0)Z%Xfte$A8Z*Hh=Y)Aj_Y)Dq}C$x~09Si#Ow*V8=g`q#4=QO&L!Fg15z zOfpdMHvz0Vo`QcBKLabz6HUS}eVpEYeHQfQ@8g}=m!J<@`dq#ktYG>5 zco07-<}zg8U39S6E_lI!In(5S3Hpy_@i`yU86=6cl2Iy0G@Wj8V-?bE3f@7~cnZu* zG_9ejboP0>`^(INX8%AQek=1gOKbyGC0)79hmG(~ez zA*3R-e2OyVM&y)FQ}$)FQ^#uPk^^nm$!;l{C-U=iKa@)%e3|N#o9L55F3Qk-WEUT4 zK#|W+}vZ zU;R-!1^+)P#N}N}$m+IUbpS`!0b9u00{L6;M5F6kyW15zaF*Pj4xB-|=*SwZ6{**g zt&PyZr>CT5-|K@Z@pZ%%gjKPp$6diN)FdxQJ(!OD)OWv$i=QBnBsmLzqD5_89-l|{ zcC@i?+NdVE6FF+(#m!%YEQ6LO8QGD%(nlGkQ~5L#9| zQ5Ls#6&{7HZks!$+ZMKkELXJol@HyiU6%J0rVfY#ck`d1~SAucgB}2AzPj0J>`KYC5Zd@r{Prdasz}b_H$>766!4P zq;=T3EFHE>Ku0*uofS&^w#A*zt~vM9?%D3-rs6H$*h5yl$-SS_WuLp+!Z@VACm^}-oD~)K9j8&L6?sX*!vF$t`$3Fk zzQ>7O?)O2})bDkBh`L!pu^3QZ-}Tgy%L7^eEM16b*Wof_2T&bt5z%yDQ1bCYK`Zq?u6^7Z;)sMDij zUAm5RofT5GMDtfA zggb!&1#hgd0UE^sS_*pP-W@$2Ul%+A2)tLwMB{QbMvq*MOEj0wzK{yh@t$AK!&}`D zO~r#f`2P_m8_Ow+l?~HNAUq6G%t9bg>;05(THm!|fZ0SvEEZ+Px_UIS#N#xNrgk}fUka8r{hQN+2Y{g`1 zxq1K-m-S9o$f`6Z4~?<1#@HCTcoXCvAZ^~zUm)m91oV%#HjcW+T@Mca$+aI^C$={J z;-gHw`sM6m>(?@ht#UC2rToiuxl5N{q05(W3GNX?^|+#s1nw6BudiXSIS@x=CxoB6 z2fLt|6ufTy2==kAE24y$r6i5tx&7h_CKyD)!G0=C)qxU^{S|%v{_Zv=H;cilg-F=H z&hk@jo%mG#ZD7)w&WW9{${xs%2#1q&`72zU8FC%|L{nUDx4apdqUru#8G~5fLO1J9 z)Hh+LSlf2?m5VJ6wbhMnn84av>rbC;tZuEB|0k7@C7+M-bAP?Y+leDJ(13nnEJY8n7=M7z($XPpBHU~+5YM3tXf%CfvF0>c2Wy`!D}FcYUe<@No{wC3?eVJ@ z-_LygVfE0FVe4IgWcAAr3Ld09*z+js#G}mDr*c;g7Z0aL*1sCbX^v#K{4B+q)oT4H z#a3|6I@s_u-CELX9X$Os)tZ0GI(Yo2IgSr=`Q?d*jEIQ)?XK*QZvM zJ(#{mW_&WOmSWBz_VSG^#&3h#7>q2UA|b z`W`xmer_8vOku2vrukG(A)FRUlRHDHvOAQ9)jIv1jE)qxUZa*b(H-IRa7KXYWxr6m zC|~m|Lp~c6*~zHl%I`0 z+ls!(cROfIupV)${k4s~*{;4RSKsVVQx!-pyiY5&eHzL&rS+Xe(e7Q^oOf+^GSU0H zS?_;s;k~~IBeIx5xrbd#*mWe?0SGO=H5snz`f~yfrg@{qx*x}mQRbLL)x6c z(Qg1pRSZWvX28*5-K=E}%@NjyqlP;E5_KF~v^rj5b-Zk-P4%g#-tr7cXpzV zT2{v^GvKODhb!}WquyO4=8bTX`6?4Ck~7`MLq(v469m!yR9~uCt74RKH|0(kkiEhn zJ31%G%zLqc)umkn&DW@tIvD;9U^umCFf`5*hSM4tQtwy+LlcAHI|=Y`hL`Ks_mDYP za8}8yr~H{_c5__48iO;zdfiO5xm(z^m0i!V>v`RbkgF-jy!S59SNFBOXFg}X#!A1a z8%L>kehV0Uoni0~6JYQSUcOt86>|)}IfuNLO!LkU+iz*GWX>J6vDRN^R~Ngsvug*t z>T#a0Da{<`uhUnvz`2{1uE%-Woi~AV55xJx1UOgtQv>HX6K>2~zIc3Lr@GR2sj2Dt z!frL6S4~|}Q&-hgkD5A<)IxZOYqRVbpGnW8-*KX6dRfohS=62}pCkG-bY|XnoP$`- zVC5Xd+bk`!tDjx^u{l&lj7CM#6wfeL*#KOHIA4rb24UucplCHLSk(l?7pilqFGw)M#`cKqjzp7&H%W7&!P2E;gUr|$ERa1A=)YsJ1 zuc@in7w@Rg?y9MKYU+PcQ(sq8-%wM(uBN`JrasL+&b;$Y^zpl_j}vi9!=_{L*^gTd zSDAoQ`WBpx}Jf5xu*IcnWA?a7=ww=u$ghxO##_*Zj|YT+{J zc>Z;iVdV$x`nx6=nwfunkG`4(|N28#x}JZv-&qX|{fIE+x81ehDNR7{=KHUu#?tS7 zYFPSFszrYu#B@JW!WrRoXn*{^Yda3LTDqag;D!Q35A-sspg9EX1L#OFZ3}-nX-ANH zKsi&lfM%e44QU+B!g#R9>+|3S#vHIO@p$~sY&zE@#iI6JC>|(&Fi6Wo=pab^bYD_b zh`1_9pjY-+WV3HCbbEYE`@-$+)sE;gWiAwn~u< z-hlR$&vnfM82g|R(dW4Y0KKvT4|y@gsW?<9pvA~tbM*F+NhRzbx!x03^FV|JH{74X zu}7c>-c`9$N{>OY%Fn>0CSAVFtSm??2GGEBYC!fdH4su@;b9p(0gBYXyq=QAm4o6q zz-y}qwiRv`t$`JG`Lcrw!7;YqdHFK5JER7}0n@l)K_5spCeSbY@DXL?eZU)!YI{7L z(CcEFAOMS%Na`z;6ACzPz|a8&o6DDb`zpFT0Y{l0k!7fo9LACw4nsVBrvaLk2Th)K zpzm6R{4F~2W@_5Qlw!IhJLqJ)8(Cj%(qO0!lEA zDT)VE$a&mF990B2sOREJLTft!1O?MtNX;Rb$#g|2RhB?qRH*z?o&voY5j`qt5!Mzl zgC2TbtbNXOY3XT>Fe9Rytu3>#v7n60kFM*0vgh$iaBq0Y=8E~6sG+AIRsUfhU)|y}@qYZkNQUj%q!vshMjMkLGpkigx zSfN41!C2c0Fo+n*=1yk;N5yVIVKZ455W1M~!b4{oG>y)cln+w`yER+0OR1?{AMN>(4^AoEhnChhBN9Y^7YNSPv zUIKdL@A2otI*OjZOwa!*6+{Nw+$wt?p>nlxq%|?y>}`^-FSrJ1Q_PpSIT%1ELP;^fTiK6p+d=WGA`*{4QPIqstysXvi>rn?x4s!9qa8 zOw|dNw%u+=-_2kuR-l1kCa#$30k>u3rU!3Pae^6wFD zYYDeff*DdV;JDHr%tyss)f{GsRO7}O$0{sI>Zx$vzqlhSDS3=88ws&S>f%~yT)&dl z6-?*$P{AxVl~eV>Wm-7clQNo>jAg|JIT%yg|a_=YGPL_lWlBp zhk<&hH+GfD-$t<1@C~1{RWqi*SUzQomCh#8!s_@j zWj1cq`8K$&+N5jPg27Nr27kdV3C6++t=V3eKbQyDiIt=tr1=U{tYV-voz-5KKWf9r ze9G$bGaDOG6tk~GQHowDw?rddU-?e}nEVyGe3dSwE9xv}s-L9i*%wV`O4R;nDydvY zv%KU+nzkA;nXqx~(6kO>ju>++U#BvemS}d2myhOX_EXU;bw9wAfNu z{BFs;l41Mfg3Y5FCJGJ?HcVyZyi;viaLr9u+zx1uqY!PZYd7RkUWfWn|^IE=3Br4`oah6tSZ7M++Yp zltWuJYt2ygl)dPkQ@2kITff!>ZPlzbPnNG5%AP7&Ig~S1Tr!k3mB0M%jgjopQ{$^5 z`8AQunxEzt+}(J$``(VnxzgZqQiUxVe(hW9B6(Y9sSf+IY|F~hdxay{N4f`3P8Ajp zo|;-#IN0#hg4M(O9~YE;WNA-HtGJyuWF6W)m0xgo%kAJ$>Qqkt-Gh&E)=b$8-#LBz zG};8M^Wj4y?W4=T=Z&o1IceWDWiR=_zHY+44(jODBYTFue`R+}0oLZ(cmVbOH^qL)u6-rYC6W;l1GWum}2-ab?_Wnb}uef@-e{Xf`J z3toqsE?pyqyPmSdSm{`ilB(x_$4keRC*!a1Cl6kIP|H(KE!J186+AsvQ90W3G=)l= z+F7k6YHA-8DapFGltkO*$XhNY?Yf~PZVp6l1bO@T6u!i%9C}MlxJ_XMJ`=d(wF;{#Pu7I{+m1vwc-J5wN<%Ex71i` ztq)S3W>Cpb(=Bz@2CI5=(t67JP<>}@v~E{kWm?L2jBb3I#XickRMc42bgi}C`k+|7 zJ#IZ6d)H)bwmv+rzH6~ww0_LW_&6mk_YLb)yCoNW7Ndrd-pKm>@7oU$L7e-_rI`rA z_TBVvr4Qd6UHN$B?n(Qe+0sTMqm4#E8;w>$8%QzQXtWC2K#I{uqgBvGqcuhwjaHR5 zkmR(1grE&1Ic*@J(gxC;Hjq$h1BJ$DgWVWtgPsZ6Xtb)dfh4C5Bm`|B$!P-#l{S#( zw1I?58z_`$VTSl&Y?^vX4H}yJuvge?hJXAI2S8oo#q$Xds)>t1n{$*&~ zr#?DueU;G^E27!jVvU?_5ihN+oT%_FMpW#kVlNR2OYS=`7P~q4lKT8*Yn^qxQ@yPR zxe`4!T8W-OcX9OO8on}VcTU-te_&rbVP6Ycv5xphH%8V~yl<~0Dtqfu?#7wOY_{{x zRN*e7q_Gp@)#H1{yC1y$paZmW(z3#%N4aG)f3|PTHP$ko8ChTbzP*M%d-G9l>CB()9eZ`GcI@rQ`a|#AtLQTV@`+(> zxDr{tYtp`Zs%ZJU`|s@^-ZE15xM=fGoeK1i_l{UcHjR{w1V*bz_e`v>9QQxi^nON;@lo#jL}jXLjeYdh(b~v*z5wxsH0OQ$rUiT-S?PEmlm!4@dz8B_Apm?G zY#k{bDH^UCxyjeSX(uWUUH&ANMX{hw6_zvjD^EV$^>E|E^O4qbk(TqIqzl$=$^{lf=GUW=@*n8avN`YplZ^K3OgGP*Lddd9h!H!*k8z9qhi)elM^ z6g{YWSnx3A;XzG9%crmc?HTpxh71}?W8X$YM$^#Lkyl4*4I_VGv|u!4ba!mzo6w@l zaZKAm8ZP4$TS-odmE@GVk|4!al2htRf)raxPN^#iI!EO)PQ_LdB>75$gjh+Cth-En z0TQnE$mI?t-Em7vgu;L`(so*XWb2(YrAtp+T8+dk>;YVxI8>-c%~t_~9|tp!*SuohqyF|Gx}UN)rk zD?wRg-H!L|6`=gc^39KOHw)TV7}wbmgef`mrJ$Y|iSbuB^MKYWRNOo68gD`GSDTMt ztOPWEQ)v8ZR)X1#U+rY1%sP>+Rgu+)C+$a!Blz`M&qlhT`VY1=jJl63bd415e##PK zyT&#uDNIcCiWWg7<>h}LS|9j%3Qa!+YGL`KpG;L8QxY$|JPsPCXW)BktlN0{ z3C(p+)9CS&@?A<|_ujE$CAsg2k~msDj`fs%o(gtX$qKsMy=M&UEqjq}+1m=bRMO|H z=dCoSiu()J?$}GO^@=spbw#|iUIjorW2OZQdC}7>R!XLIN4b*B<|817JY$0_MFz2(K`@mWo87rxRahHE6+2YZy{aq-gaiF9--4?DlW6PVkoZ8bEvy=<$++{SQiv((zo#BR>oUZo6Y zY|ZL3YqPDAXMVzJ=j4Rid4ko>lc=31c^T=Xe<5=2wa9DU$d#)RZx3df zYhuP-Jig&sGziQj+omX^Y^qRc(d7tRcOxBvNdNUn;09WBbMad=EeCDNz|Ozt=Fiun z?U>1@cI~FFZjGD+7knXdp*!Ne66wB*mp#f_isTMcW--A=ajvsz0{%C_V*^_}f5hpQ zV0A-KLtCK-tq)5d7Cn50;{@%0P0&c^So2ujc*cX&@#}beJRW`VBL(>?7ae`tF=J${ z<|^G2yKEzCwR;MSd(l`EVT3i-bZfK#*6Q`i*i809HsWc02FYxnz5*u#g?A4OpB&8@ zyBNti7D+w!i;v#UuoPBX{p9@T_oeG4=^YTIt3Pt1!yE~;}_by%MsTIU;h~n1i2`P%6yCQtzkHu{Zr-qHgNA$PFh1 z$eGTr8M^!_X63Vdne3W%KQ&hRo%6GRCp(mmx^nKTZVM7Y#q!yy7Omk~C;>zoD82<1 zG;7EfO6g32ud3YOnHmZsfuQctX@K%r4^AOmq*BIx^EjDa6Wk2JUoj#@L-Pz;PYzYN zi>aA7xz-lf@!~$Kf?0Ip!J;n(i|AyF3We&E47a8I9{(G`wU;WW!Xt4$dX72ZA;r!k z%y)FV1I+hCNlln|;uP=bZ7YF>T1Pe3|D2KxtT&~m-^EiZ4 z-y^}aV^oVQqvPRLOFc}&VbizqD4NDl5zSCg5l!c)!1o(ur%$mnZEmQFO=fIY^aiM)nRLWxNAlsLTG!zV2xOAbwhCu@~IkI=nxUQyNJv z<*vn4_g!c%IWl5ndK@l8G_J)m61d$^O)lLjq)g&_}wy;%-vfQgi^nl>dpxjT(`(6p@MLs zZsoT)Nr9Y&+H3#KAf1Po46}04rTgF;0lDf2D_p< zDdY9f6;3L$epo0BoZ+Yy;cE3^^p0qZv6$ zl^kV;92;4VYUJ3IAjf8wV<&QOXB2j~v5c)O#|GqZC}lVewQOTK@&c;+68H8{wpQ`^ zm#yw{(>~k**K`$dO{Y3|b628QQ{sCyfor;z?wzLP?m{WH_)@~F62P%LLH^a|`2+ca znnHPE9e^{PH5%7#`B_1zlx{!j+q9JrriJ{H^uzhp75;XS2VQ72)= zeTc3GCwglG%LIgGBLEKbR)$uE@CW__Ma}hvxiTlIAFKM-%tsxM_)(EfYey?| zgJa8+;t)^Ka)#=&2fE)Vzy}pzxUIq}&6Y&OCE{WH*n)_=)2^FNw*Im*NgZ0$tuCAJ z9op~eY4rHGJ3S7_4cQBwXlPpd$y**4XNQ{2S;1bm_MY}!>y-x-Z*?(+<4d%n{RP&` zV3rD0Fkh{X0~IWSf_Y7Ur)Fu!vaD$^t;gb zj*hw_MH}htVx)btz&Ww(DEEvfS5Px=;qn6na6q|HYw(k`TJR{%6n98>7Fs(pak{~{ zEW8(hZ}3~6*bZk0|K3=L7a@I0kwNtgyt6;vqqgV`D6;!dl2#Q~ygEicp7Gj2WhGD} zqOXrhf;4$q{4T!AYo2QzeFF}>E+>NoFrglwNwEwERAqb#irO^3J1n;mcGel&uIP2b zsU;faA_qjq91J@!8t_kx9xaxsOmfexXo(^w2tJMnj`yAUyU$0LT&6BD;#*RpT1ed# z)`EKFY=T}-Ond^NEjGfu;K0C_lm*8 zLPsX+0ao<1eW2}iW@w>hNBHOQIA9&0=;i05>))a&dy{d>KB3cVS7z;mtRnn?&z@C; zdVHJ9&jWeThY1wpS=X?F;dAEs|Gs`3eYt z#Z^e)MSLzhy|st~A^WI6@^sFOaCQ4sl6}t0-MQSih)}L0DBq?6Wn4ZvvJgMxy5_0d zaN4S?-rON1V+S(Uu+43BPM;rhPA>-tWq*lDSlNH4Fu(NjFai2CJoXdzFi@F{o%^Ss zOW$ljt3M(m5#gl%qV?EMcI+N)9xI4suNkfx-aCAAGSdM+*?92_c>pyoV&i@Z#mQe# z8z=uRTD8Cil~RLBMS~udcqcBt6}k9EbP0Q~p&cSiG- zMyL;Xm}k~d>~o@-lp+TRJVkAd+S)r|;Y3G(w4sYKLrN@D@EGtfsHPiqQGMle1E`yL z=3fVF7}rnTJwFs%nMh(LKR_v8q!Y0*jBwaFWoq2%D`rVri>I7?xY^Ij89F_YwR*7T zr|S-mmpoqg@4|l_ri!H7nNNyVynE>0q2bpb z7deJ9r%E>7ZG+IRd*t=ewfJrRLr(e0RmY6~k*_!8MV(d9dMU>6R7JJzHdR-C)C$ zjI2oRhDRA20D1oQ(SxJg#%ibXR}Ni;t<#YEsVyxZDu9`}+kci~$yyF;ux$I#7anD; zr`+YEuZ&iWwP7%StD%~V| zI%Uri*-KdVvPW5Elzrz|=4f!dNLzXqWw(p$YjwbwWY3}Oc_O>SvP+M$qy(kMXIBxk zXYAnEws9RAb%^D}CBih5q z7*Q1;q4#c0QFKbwlsar_sAcq$0kKV^I ztmdfKibGZ#`8elCx^j-0G6$j~U{2saDRxwy8%A7(0A@e_3#o6z%R)AH2DR==k$4;X>xNp%53|H!usiz- zt-gj|>^O{$+7Ri$95d<>Hjn6l=m&*z!AvEF3vhg9Ql~o?N27T-8l{**?8gqgv*Hgm z38wg`I7T;zQazTFS8A}8E&9M+zz%t{aok%-IK$r}`rBm-XD2AJSbQtjXiBuXm(zFR zT^Psmp<;K*YIcb3E(sMQRf6Ng5{A>vP@x}v?JlGo?o5813B`o@^fr#)spjyCP&Skg zR)$tE<%1RBl~6udWrpimtda1l&=!%g#Uc0x%^~;(w#{3HJBcPR}d8$4#B0sY6U>kkq?!vqR_g~vQUEdg;Xz{ z?n*QK#*Y3&P;CjV4W*g4L~~d!{cz`dimHQp5WWEi;k$y>{2-j%TA3Y&Z&kdBZIy7O zM~tO%?^NB3DTm2)dMv+A940$f{tj`qSz_Pc7CRV~M<~xl;D`IVTAaveGs*zURo+!; zK$~c-Ni?)mw7vdRgaC5_vys45r2vX=1Gr`j@EB)!Ya#J~MgC*z8``2YnH|RK7JXVo z=X?$?e~0>%?H+#YLS0HIAQosAcdF{ z!oNfaCq`sZMJDo(78S@}B_MxK0QqT(Lgs|q+XVI)fvrkBu_vm|r%s`*Hr3NamKGX0IGB9B!Og<($agHdy=N z#@%DP$F5E6shikXKana8o)~)dZtC4DBA{R+tkrWjBW7RK#i`8fq1wA8!^Iz^SPyTQ zNIfukeCWj8*GJZjdLh}sORDaJjExf+8%It}X6*cF{?<|3Xzf_Z_=*SH9$t;S;eMR& ziDY^b3sIif^Y3QdZv4Q$VZy#)^6&p$4$o5);0 zls0r@IQ_$d;=AX+zGf)>Y4#$^jQ+Z010+COnFNSrP(R5jo?2fqdSlc()<6E*_{j$y zQyWT$-Bariz+c07sLN+WMxJ`W*n9e{{~*iXyL;B z3k|KWoH^GjU8rtuu5M~=sBe+ZG)uK-n(7)_8_qQ0?zmLlbWu9h&{S70d9Z4sdlc`! z1gQ5KK=-&g@>&qiS&Jv~iA?wYK2L|Y)7yd8`MUaDT^^~6;$-_M6g6CgUGw^>XGsB< zd-Cn^!Y?li{_Kx$T1ED@%4|)rWi`TX|6a@2{lj*R61R=C3@@)O=@`Q6D`!;WrJi z!I3*%9iGZ&PX}y-j2Vp$Xy!q92aNgHfyygDHT+n2#l5`g=|E$8eaz(NX2AHq^ID)1 zy?V`sH^(%c(5VDwHs&W1^>t};5~{p`0qrAbC-d)!TLD=}Wwm9}ty|f*6y*CMFbrpB zQ;+&F!aPzFs1)zBr|s*is%c+4Zgs%Twz}73M^a&DHj1TDty)s4)K!6Pghxie>03S} z@8N7i5ftIsqX5eZK$;eWswxjdx5vQ^v3S33!PG$gTP{_@T8S zB6B5q9d53BWwP(WVcD@5*zD-c&v!~{Tlhn@A?ov38%fz3K9c!&GieGlh8p0rmPVX6S_kmC5nM4BpTk{XL|F zZB*-bu$+{8`x}=Ww{&NcVW+g?m~@Np{g_o+TJ&DVx?WHCC;D*+Vl= zgAcQ`tB2IpVfL1NiwR}I1V5aYD+i!@x2|ZOsFnV9xB?yB0^_WA`MQPCxP@a^Is|p2da%FoQ)YhSL*ms)1v?qmD>4zce$QKAQF5-=$8N3gT#fcfMTJGw<275#-7$T((+_TN~>f%LSGI_>|j&4ZE zR9dazbWXmE#b}P~B8-5Wcna~s9vMC@yb zF?O1Ky=&U9+2;^q)KbJflB7wUu{cKMlByBHBz5YYMCS$UEFo~C7r_~C?znKOMikWx znLOm#?EFB2kd{l~SZ+m1NU?h8Fh%*0LgIKK)TgrvE(K%WIz)M#?ZL4MfTub7_+Dqi;RgA;~M0N287 zz++r92Tm{1)?`o@K)9tw=L|bs zh*4_NMrQnoYT~fXUYLCmr-NmLEUqY$ufm61Hz*n@z_l~JI!>R+a)$X*QM(KFn|OHR zYCDOa5!$X?+M<+`2xjCnd8J^HSD>%nfXKxVyibb~O?_GkJk7p3mpus2s((b-Bd>cj z(;9Lb9`T$&1M3UTej4p>WG-fAKdZpr7N;bdt+b#>zx0yi5YL@7Gs3Lgf$UY<$2$?e zPIJycod@?63S?}iyRH=!fI4OpBk(qeBBpN$X6J)#fo%u@>xbpKb}9rh3D}wI8*1eB zUN1j#rU7M`1c~gGV7g+s8FJ8L#j6gl4pjgnCdA0bmV;{B2D}+EBp?qRmJGemkxF5T zsdoit6q46{_*vez?>0GGneC~~?oaEu<`Jx51U*%5lWOWuG&DisqOKmAe$v_MW?08d zCmPSyS4p@0ZzJq6>?M6+2|5qrBOHi&q-tNFM{aqwu@MKTI91bRtx_`@s8us5VDhN# z?f22~DV~xmjUC5gA)6ge<$z2-Ytnd7KP-h%P=6>%;6bOc_XYwvL)zzczuNDS2U-Sv z0oP4OnFhd^%*1mOVktzO-b)jla-`?z>Gfe0xiEMUdl`e+bq!&wDefHw{>5CVKU||P zSyRLq5Lg0g8@-4TO^n)wQ>}a^aG}X6`zAJ4C=rK)U@tW|rcy*KN**HIUlHi-17;W& zQ4Ukihb{=XjKBaSW-8X{Qv>Gd5uf;gaK_YJ13&ASzF;0-(lAv}Nz;EeUDQ?mm!kce zmc$O|bQ~5-%JgQB_69 z$W>Lsq8Gg#!`5}DPzw-6W8Tz($xtjPg#x5b-(HU3!!zVcgiltPN})?p8ODUt@+D{) zM&UE7OxJ1C_mOUctNV_i(;d(o>2dmbL^G~5%P*YFxUR-#J4l!w_v@!JYSTQY_5Frv9nn)k!?*_glE$I6rbX7C%5AKJDOyjMZL+2xn&>&RlJp{cF)ME#jI{9gj8fq;^2yD??N z_QZP5MC212`bCf+=tdrqsMxAYZpGFmwp$Vu%)sFCj(#$i5n!K#*B*XLL)r~FnW%1-^B8j2W1@yqCXwmG&6E$bf zG}c!)nE2}o#bFc9O?XKr za8dz;T%{@q^OU-zEnB2*0)V5^);D)el^x698w5HD2oi>s4h- z@q}yAd-?%3t;DQ$I^mc=l~$l7hASH%GYYpbWmR|L=-k4&Kd6z*i=vcXGwt zMHjjyVGiR%_Z{`|{H1rC-nHUj&Cp$d4DY|Ce@6JQ1M!pgJY{$X415^2!--{hv3Y3j ztQa;#>MRyJtVtfpJSRsoV!75XV6!}tVRQOYOy^0FusEbNGAh#_VkJewv%#Bg{d$(` z-Yllr#b5d&@TSQbuNPbd@$8PT*veNf$u76IA1t@ZJwhd+r?-7RYu_`_Fwku(UI1AE zQ&JThPO%G(-NuGqTGOH?41&G;52+~F>$zG-&1bC|N8@m7{?D{0I$(uNdx zogTEgZ&AcVMt@ml#DXkYW$MJR6fNVk5jAuP(3sRfAw+9`v)scbSTl$u`MN==#b4B? zJ}Zm*p+(!z9!j*Ie6`9c{0%?%eNI;S>lp1zcnYAUcuG${Ur(9W%=~m$I*(g;FX_(c;G_Fgb4vbkN^Lp0^i&#y;~| zIbM9`YF>Q4)5%zce%9x(P~I5`H!*?3<4c z2`5H=XJR)zc5HICYp}K7rAyOP=2{ z!oQ8Fr;vWItAhm>P-IPT84!@6lewd#$K&!j$)&y2(A2tTw^6t5vvu~T9nh2(vN}~q zH2wf=w#u%_qrW*CO~<2p4y*pO3%od*)Go>$TD8|1wOH9?uZ$v)$r1>h)RDgwm9g1| zjfKT;+0w|j63&;4y>hw!0uh`Ts&ILsjb5IS9}LzL;yjAoJm;o|9LA*>W=m(L$2;K} zv}p-Pvl$I7_Gs=vEI9Q?p{eQrM}LYdg{QuveXC@1Ti;Wj%IUFy)Gdi}+cdeAaMBh_ z!rUpE++dLTFJW#qNHZYGoH2KrrffuBn4#=gAnWwN%#dVg%C^r~wi?bFa8s~W_Dk5x zEKS)nV^9tLJgeTx5oP-+5Vl!w+eHqPH#64MFuVS;1m)$4@)FjVFLIzp3Yb1Uc48s0 z(*uYvI799NQFg-G3q=mpK66hNX>!lplWK77gtaf%lvg}sYf3b^OJcbPRybD%tIvAL zbtYHN@1qDcJDC3|a@Pm(Gx^YjTN=cJLaa7&z^Miw-s#N(&ZoM@^^IkZ*=*4y8K7Fd`y>*=<;*A{ERODNS9yG4ZLJs1v{B^DGtJeFZD-G5OV-jxmYi+K)*9WW&wQo{ zALue`@|NoJniL#eZ<6Kg89>1+j!OFX@zq7Q=ySBz)|@+jyuO(ipaI6LmAbszR<50{ z(5P9v^hHIt8VYDSce+LoR7-7jV|BB!fec65%q>nU3ts9+k69!Z-!obOB|S!9ZA4&g zh(0BMh-jai5KPzqb>thgD3K^5d3z=^_I{XO70Ilc;=w5+c@>ixl^^CGiew&AA2}y8 zwtbktGm^PeeYAfv4moaF{fgkTSOWkM{p~f268?a!{XH$h`1 z0-280{L%3rACDZqFuC_NYVCnY=6R z2dIbHZ^+VVbz8rb8C&dQap>JP3UW-pur*|rmj`gR&401nAu9!!cc;)*Ojy3vv7EOp zSD@}@{JB%RETU}jRoHgh;!dM-@Hd_QhEu~S?u;ui!#DoinP0L5sF~~+QrVCg>}siL z?kv+1vS(dFx;rP7@@P87@8p0~M^SX6Db<&pzz* z`dmFy?e^`^Ut@li9ll-!mXlGaELHH(g3b!&b_+4nuHs>@4;}&?c+bjW6?3pVT(a!N zqJsjs6Gi?3T=c0lhfX6_hlNc)j>NB9Pg$&tCB3wgXzjMmj9Ce(tf}96XL-o_P3yZ> ztL4t>RLg+nM=3X~at$hwYw1#ti=PNyk_LI0;x)JlI@?4q@X4&BUq)n&fJs1m52iQy z6)LI$mnNBb57~iBG)wjV$m3BHU!ZFlv6HN2#xUh!tJ@N?f<`cwaJAh}Q(BOZ7Nk%M zoTSgg`Vi|Z+46emihf_mG;O35F!j1^!;=1Mtu5vmnT>c{l+Bk-@`6eFo{L6$6 z8p(+IPJ>CFBR0BevUlRczq9<~pylTl+ln<$?72@xsm8_{$| z-hTNA9{Xv*xXjzdnUE6mfh+$li25@1=@Wbb()>8vQn38-^4iJLeUr;;AGAJRc5<-c zCwq?ENtv`uBdaFt+efP>>=l!lmH&3*gZ4k~{Ikx7=OgDXJU;%~^ zk;0MF6Q#R{iU(^EKlz=Dw=e#TNdBhfkp9SG%Ud&e985^T@^`cDWr1}5 zG;Q4VCz+G0svj?_9&DJ(FCT3gt$%8dtUyyr<+g zS!7e)nWklB>B|!En3Ry_&Spz$4!hdf6q(D?c`TjJ7TINNc`abeZXtVHbiar#wad{| z)1{W;rMjf8T@>`v+p$&M2~{AFE7n4aAkgl*$^r;T4xenAe#ASz!r)vl9fs>A#2yVt06lYKOg8^t`2wHSS)=K^r5ge#=IPZ6Od5{cm#GR z#hl*qHQ6vY=euaLWlR3QFj5jMSo4~cohiXWG4s%0zElO97hfhf!y2aatA2toS<%BZ zO_YJw#TvGJtFnfz8-8`THnQRE$xIoG*Yd4=4PZ>6(Q&en-ldw(JC#jD^J(Ld9R z@q?1~3{T*D(Gs;)`eldJk2g~Pj+zbj-!nMbAOK7eRT*Sq_CkN=7jTf(2YUyDVl{O4}GhI#Yy}b?B~heGdnwYNbj0^4kyr@ zHLNyg4d>w8C74RnjWdNah%w$Uo%4poqsad^Emn*zOr_H%BU~ACx{QdTLo#Z?!&^EVlH)bg+6E2cH}~GIl+3^z=jT!#D8hMeAmK zyTv&|+~YRu(|v2~sZT9y(oz`%7)|HAdk31S{z#Nfi_%AbgQxF;`2%xjtFzp-UV0si zQVN*36vjBE-cJcaY7$NjrJC)q-%|?oZ;i=!t`K`*_?b#{(inr5&g#jyuO7!>hhB%; zOk_Bsws2Y~#hrN-TSD39&hlB^+2QmqOE@EBsk2-<3TQJSf5~*)i8Qcp&Si3zJXTMB z>^Xb7?0$AQE0h&VyKeF4nS51nKaJkW);l{w8CO*KQLK3(^*9D_zm#eTWkA;OeRtuN z+*lrw3aQ6J?!q7*hOvL38R5&k7;M$oON(l;f+SBWo zYEOgFZ-mjg9}Inu$Iq5-M7CfN6Qu1@U-y8Yf+xV2(f~Me2)r8HI8f;gps*^*f7J`t zo!EC*4;<3F2e29N!&zH}OheIWi)JV#MKeV~!Bn5ezav-<5D^P4&@1~Z{c=a82+rWI zB(N%DU{wTe27*PBR4R2`1E@QcMpQ|`<&dXg8-nN{Zm9VHl0K681v5CP+46q@4ABf_ z%Mi^xtF$DTqd^Sk|7C2Hg1G_&i2;}s15k>+tLW(KbIN~-{4zZL3 zF$TGbakc%_pN!(aWvQ0mks=jg>poA%!u7(Y2=pDHdH%9<)% z^K(l^)~2DFCxz>t-%VjU#I*I4T{zs~GeC-L3&o`0gw0i}f^cV8z`C;5%$d!1{Y-YK6kf1`>u zmU-GZwa8$)SGZQ_z3kH$cv@f>t7ES%`qMJkv+j4SD*UEY?`iKPV#?b%#+u4Db2k?^ z-QxnM+X_EQg;M$<~`WshZJc&8$qkd!3y^ggGZ`-%JKZQZ$ zd~|pst2WPXc08*2dH=TMXIDw<02vr1>0>+U>wdN2TTXAy8?UnJW3P2^O$@9N2kKfV?FRJ-$(#g3+9=p zZSHftYXu#0$fbe-9Wu1@taDauliZO^h+a#eC##+318h<}SMSKe)|BaxVH`4oKU-uz z?u4jc_(Xy?ecX2>@O}@u6HJH9{NX}^DhW>Fwv~if=NDD+#8W7Tb2W6PMAQ)sLW_#; zgd95Hl$e!@RuWbjhd5$PAp?52yiNH9eZo@)5o1h=Du~#Lo&>P(>HkW;B(@nM#+!B& z_buZOf@;4z;@LvLR{@Wdc@$6J+kj({V_%lU&&IQ9>Wdf^p8AsKn7yP} zwE;CGe_=n1?UgzZTfPN`VuE9a_DlioHX_J%9ZaaBM2a*OrvicwR^S1d6exPzp|oMdeE& zXC+GCU~Bzi`m?1jsbRg-K&pWjDIMlTH4V{F>mfRP4q8hO(^|Nv&~`>7t-<@Z;As0{ z>og-;l7O;0)4kA1c?S3@A$%sTgnmm7*iXT%*A4&Lykyi4|5bQ))HMZHaDq$)|BW=k z8dW+`#jAvm@~E`JFq=9LU*d!+O5JkgEGMdJt)InYCzX_urK;l3n5&;jhn%jCqi!q*I zf)D?~C-j_3ch(X8WLMiDd~I)_=S*97KWYnj_S32a#7GNNG@ARU!*Udg`)q#MaP-Ih z4&e+JmJQDqY0s`?#ZMfU8(y*gS-IJ^CDp!=dax*J8dtX}bSg#?)&BW5O zBX9Lu;<*IXa-239X z;qNWqwR|siJz=AdsLOvZ5i69O0-D&@h~)Y`WAeSzYo|$O`H!;SDSo@yXKVziEF>ol z_|(}R#;;O)YNF)5ktgcWr{?-cuJ;$;UEEIbH4d=m0dny+YrgI2e5$S39ALFIdnU`h z8*4ZGM%#zRageh7DXDuYX*h~cRB>kgnv~Ot%xT^;-qD8>_a`1q5mWv~4Qr~}bUkW% zzvJDG_c|Y)CMP;rQwIoDRQ#!Z<7=$?xThnkH}ya6-%5FJgw&ti2GR4U(GS?O~s~dAZFmPq?dIQLhg8S?m+-o)C3cl3>E zkIHXI^2n*6Dph28n*Dm?>gBaEPs^S*@$TZvqPO|mj)#l)7dH$KUL_f&8)L*$v01mH zZKMLH@ovvbkGJKC+R7=Q_{T~StW)ao-P95`wZxZNwt0+AJ@M$+`-SfoZVmcsyV=xk zPnX|d@~XU95A*KlJt!cC+>OjfX^%8pqa^PXYdE!CMS9Qe_MT^Z&-;2WlHS4X2G(%N z(;8z+%Z?zss$FR^D@|T??MTyr2A8{eZLJ)1C`TnkbY}+=7aeSY ztHU>p|KB7;&<~^THA^IV&1jRZ7JXiJ*Cmr9+L-PQIQ4e4*6w zPp**ubUFt2X^Rg#W5<*h;Vpo_J8`a%rW0hc7&2j)*AjSBl+D1N9;`tm`qKLBkQ+bn z%~Jg6#AhBT&20&x`(+ zLT$q;sv>z-kS7$l+F&by0m6DGz1ECmcmbAW`uHYnT46YqXs!Q)}D^gRDiX{LN)ag(A1~F{#JmlWjbPo zW9{%1VNUL7BKEN6OYULqlGbr;Nz3oSXYIW^pcR4rslz=;dE?kSF=XWl?m^xEX`iJ= z?6XkKuofVf3ZsU1$Om6AL+JwUoy4WYX=H4pe&Ki99sQF2x%5pLLL1PZwI%&@SyU4c zwOIt5FF%99cUkQEGKKnZuJ0J=`sk-Cj!N?wTK`4X%o@37AkU+lPt-5G z4ncW7%Y8Q}&*x0dUbipU#zB}DJdOE#In=6fSbnG9Vehq%&bENT1586`ZTUQb{w8{k zp@VnO+!g6qjSg&rK`JEa>rkATr=I5}P;af(Aw|X>PeBJN`KT$#ZH#s?o1C9-aOdY= z4UMC|ePNc$KS5K~<*N->iW)$00wKA`T^Zd9$YypMFY$x9#!8KD!j$mxgOb{gx~b^7 z01QS@dJA_ICW%gASc1zqq95pO>gxvuK}Xm5HW(RoZ9~JiJ1t5w)6`I^8;a^9T+yu`-FbeX%{ODlluCv<4U0?

=+;P zIx~US*_U*Q&kYJ)`~r+14TeQ|bg;NJ?`Wt3%_()8{!iZDOmo6}&f~ayW97!`=-owD zbK<`ozknmp@s9w&?Q9Z0$Oqp4!VcgsoJCkIaUGNe;s~Eabgy?GL)A>AzU9#JUA|g) zr3jQRv57`#DG!emn<3dsoZgj5ZJ-B~|A-whF_!H)$2Ek!Mfc99>UQo?JHYS8L z2fW}f>}AJIC>&7DfVF!B(okOzAH19xklJBs0xDby=LmgI2IBas2%x=rBp8+>!U$+B z0#X;;aSW)i7?@jaSeX=_PRF0Hhbh>NR0L@VP=Vn@LBSg17gRhX9@ztq3Mi{Us{aK9 zf(i)Z-Nu#19aUPCP+PQdYNM9Cc!pTIcI0QN2EwqbN@rE+K2>H|17S>F?xGq9sVoaL z5W0em?2RjIVI3)`C-uEVa}MmkD$Q!{N*z@<7w#K$oe=49S|^(aoWD!jyXN_8O==H&t(rY-ev@VNYLP zz3np%drtY~hFy6ID^Kyhv?I^;%eAW&E9%$cxeA!A{TD=X!zW4+=yvEbclwe~!vbp! zt7mqN`7D^wjXq?U;a>iU;RMi>BKcvdM(6|vuv-AMbdH?tBYihW`pqZmTOXNI9xCrE{klsB60rrU z2Q6A+3P0?1qfd9-(*(5cS&W(wu*=_gnwI{s<9^3_(}U9+MmDWvQ~HkLZN;M^UwJ#5 z26V-youz7)i!A6^1~2(~huE|s-tHe;UDft(+j||4PHn!*n%Y*SQ7yKDIX~6ccAm6e zAQ$FI)>n6Qj;B)fuGGXzO5#Uji@QCbucxQhs55D!@}m;o<$6s9&i6j4R|K z0PJnZNFPQQ*mZCl6F*yI2{XcQO;dz_f*1+zVW|E6OoE@GL#L79;ylsV+~ z04j@c3rjLkpn)I^Dyy6jb{wc-g0uy03OW#-ndw|1H~e%KJx8xXPKGe|A*BSU>LOZ% z*6`k4)X(|ybF>yxT0m<>LWS5GI5on0g-7WMsUK)=a#Zf0Kl`Rwvu`uIVNb#;gXucF z28%}=2ti?SHt0f_((R5fDVds`UvLe$(|W;&2Mk5l)BQc&z+*YDgK-38GU_G>Mkjgj zo`EeOMVD!JLP^Qof(we4IOgVDZu8l>u_-%TCh8s^Td50n2ovu~7HA-GOv*P4I zJO#T7S8#)KS|$i{Fp2K6s62GF6!K$9+wOQ}>)h;ksnwAJT%!9N?-Xhs#}0zSVm_>Y zC9DiCNeOkighUkf=vT*`)|*qVNuUCl2*KSGMQy9_FE|QHl?A4N9Il+ur44AB91{yO zV29@i6i}mQCgjqzfRZ9%-0Ao|GRrbbnvPBA8L-H6qc#UDwy@aIQgj_Zu*Ozd7x!o^S1`lS%Mk_gS zo=8nQ(hK2K?Pe}{`65jn45bot;by%*{T!UrGV>=QM%K?f73v}8;>}@ydUq(VmwBp6 zjIaQHq)71C?oO{v`xF-71Z5fCb9-=S)3RpqR=knsi32}DSq3nh2Ggo**ObSa@_hRI zU41#LF9${%7+JN6q*So#id|I=tE$;i)gk{cUy-k#@YZ=tNS>V}&g{r%pXz`MXLUKt zoqN*wZ=C-6>0POjl^RzUzi(K-^t}vXEhptoB&m5v+Cs$uMwaIh@5z%^$Gk;PEM!>l%Icmx&3kD>wIi>3s?zSNG9IfkqOgi~{|&KvLj_)}$aN0H>0MY4_;;{);$kj|!NM@HcPh9tsj7fb}=M@DRO*GEPi zCx8qn^*X2^icY?PcyyJtPmS@U{6|P~h>+A61jz{E5XcZnX%tERy9j=Y0J#+hYSbOY z2pSMHBbY`okKiVP?<4pbf?p!|HGM<2$TpC5U3Go5oi$T5hNneAuu2?A}}GaATT2kBls~k^gjq* z!RR7_H3at&Y$1>!_%(umK(K(|2?8I29R!aNun7Jc!7hRi5cm-U5PXP$Y8I%r;ddB4 zg8==f!|x>eQbBT?1=lDbE)?i_uMlKr!6Rh`{50(24UTRo2Hh4p{{U|%*i#JivDCy! z56VT1?n9C4Ly_V`k@8>&;m(GoQ-iZ`4GzGZb)8XN+49g z4N1Prya1t6Zdx+UoPbazH!n%h$1Q8PjD%DZ5t+CQbp||B_A}H>+yOaQG6 zz=Kl^-290<=oRRRCw1YJd*rMS$}`OiTefF_>7GEjX5N*jvTLNjrBy7h}n~pWi3svC&yoAjW0toymZRDnSGIHggGnb zM52r0SMV_@{whAo9AbajIhxza=Z^EaGc8R>PNo(@ z)!eI+nIPraC38$Yq`k!1p+qBu>bP0S0_Zv*coM3aWtuSfGB*kN?HFtZa-9v5@GDT9 zuX0ji4^}w|WX+TMq{P9LLy2O}A?af(AymfAiZ3$75X$FX756ix5Gv%lBqzmsv0tiN z%YB?NNJeKku|!ezi9~9s=4cl9`O9=`Mv~EhdWH0UGCV1u=&QK|EX^g0WZE_9<1{<0 z&kd$sEFdISb0&&l70J{q1CK2>GUMjNVr)R7sphh1X1++KS#dp1y-2Rj2_<#aTmj8| zK_p99v60kLQr=8bTDH4{;@WDil48_~WU7@`Vkv=}dBohjT`yoHRC9F{1FisI^CX3$ zSRzoM4=oJEISn|_3z7y3t`?Hox;-pZ16?`8;|v3iVXc*9H4tm#wpu_)s^+fn2=MZk zC9dU?%sP@$zXdf&ailVs${8ME2@qhWNO}dSY$KpWxy^|g#1X?(-QjUs#fNc7&qxGP zo0xXD8<6ObULv(!#B!EgxXOuTSW_H~sfS0p21s=B>PbT{NjXP`CIlpyy-^;?4M@hd zfpz`HsYlH_NsZiXJ{=f9zNP_xsg*~L@AObk>pdH3L`+*29n&tC16BD zb2>RKMu41^MBBufFp@2jnTVyG%fZNTm@ACrVWcn^DZ)r8RscC=7y+WCWhyc960p0N zQ-hI)AX+0vT7eppF{_P%D4YOYjFi#tYs^gUe)VZ7)3`q*S2NlB8Fn$GT$Np87~tyK zVLzwC-nDSku%C}ZD4TPMZ!lR9O6S_8X}J)vat+2~@XX@Mle6KO!BrLW8~!SjSq2G3 zTsxCf2!Z2V7h@GtlKC>#=~l=|<4(e*R|w<*uAbJqUs%KF_HQu;rhLEnI3wkTnPZG$ z)5wY7@hIm2A6zd}%NW*kIT1WIDi83%xtSgYVpW_7pPMZQ^to>nXESje>^-U4<9;l$ Rd?1zobvp ();` per line, as +produced from the in-container /usr/local/include/meos*.h) plus a gap list +(streamable functions not yet wired by a Nebula operator), classifies each +function into a known operator SHAPE, and emits the JSON descriptor that +codegen_nebula.py consumes. + +A SHAPE knows: the per-event SQL arg list, the `build_*` flag selecting the +physical-cpp template, the MEOS return marshaling, and the per-base-type input +ctor (tfloat_in / tint_in / ...). Adding a family = adding a classifier here; +the C++ templates live in codegen_nebula.py. + +This keeps the bulk-emission measured-not-guessed: only functions whose exact +in-header signature matches a SHAPE are emitted, and only if they are in the +gap. Functions that don't match any SHAPE are reported, never silently dropped. + +Usage: + build_descriptor.py --sigs /tmp/cmp_sigs.txt --gap /tmp/nebula_gap.txt \\ + --shapes cmp_scalar_tempfirst --out wave22.json +""" +import argparse +import json +import re +import sys + +# --- per-base-type input construction ------------------------------------- +# token in the meos-call name -> (tnumber_in_fn, cpp value type, wkt format) +BASE = { + "tfloat": ("tfloat_in", "double", "{}@{}"), + "tint": ("tint_in", "int", "{}@{}"), +} +SCALAR_CPP = {"double": "double", "int": "int"} + + +def pascal(meos_call): + return "".join(p.capitalize() for p in meos_call.split("_")) + + +def parse_sigs(path): + """name -> (ret, [normalized-arg-type, ...]).""" + out = {} + for ln in open(path): + m = re.match(r"extern\s+([\w ]+?)\s*(\*?)\s*(\w+)\(([^)]*)\);", ln.strip()) + if not m: + continue + ret = (m.group(1) + m.group(2)).strip() + name = m.group(3) + args = [] + for a in m.group(4).split(","): + a = a.strip() + if not a or a == "void": + continue + base = re.sub(r"^const\s+", "", a) + ty = base.split()[0] + ("*" if "*" in a else "") + args.append(ty) + out[name] = (ret, tuple(args)) + return out + + +# --- SHAPE classifiers ------------------------------------------------------ +# Each returns a descriptor dict for `fn` if it matches, else None. + +def cmp_scalar_tempfirst(fn, ret, args): + """ever/always comparison: int fn(const Temporal*, double|int), temp first. + Reuses build_tnumber_point_with_scalar (already in codegen_nebula.py).""" + if ret != "int" or args not in (("Temporal*", "double"), ("Temporal*", "int")): + return None + base = "tfloat" if args[1] == "double" else "tint" + in_fn, vcpp, wkt = BASE[base] + return { + "nebula_name": pascal(fn), + "sql_token": fn.upper(), + "meos_call": fn, + "args": [ + {"name": "value", "nautilus_type": vcpp, "cpp_type": vcpp}, + {"name": "timestamp", "nautilus_type": "uint64_t", "cpp_type": "uint64_t"}, + {"name": "scalar", "nautilus_type": vcpp, "cpp_type": vcpp}, + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_tnumber_point_with_scalar": True, + "tnumber_value_cpp_type": vcpp, + "scalar_cpp_type": SCALAR_CPP[vcpp], + "tnumber_wkt_format": wkt, + "tnumber_in_fn": in_fn, + "comment_one_liner": ( + f"Per-event {fn.split('_')[0]} comparison of a single-instant {base} " + f"(built from value+timestamp) against a scalar constant."), + } + + +def cmp_scalar_scalarfirst(fn, ret, args): + """ever/always comparison: int fn(double|int, const Temporal*), scalar first. + Reuses build_tnumber_scalar_first (MEOS call passes scalar as 1st arg).""" + if ret != "int" or args not in (("double", "Temporal*"), ("int", "Temporal*")): + return None + base = "tfloat" if args[0] == "double" else "tint" + in_fn, vcpp, wkt = BASE[base] + return { + "nebula_name": pascal(fn), + "sql_token": fn.upper(), + "meos_call": fn, + "args": [ + {"name": "value", "nautilus_type": vcpp, "cpp_type": vcpp}, + {"name": "timestamp", "nautilus_type": "uint64_t", "cpp_type": "uint64_t"}, + {"name": "scalar", "nautilus_type": vcpp, "cpp_type": vcpp}, + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_tnumber_scalar_first": True, + "tnumber_value_cpp_type": vcpp, + "scalar_cpp_type": SCALAR_CPP[vcpp], + "tnumber_wkt_format": wkt, + "tnumber_in_fn": in_fn, + "comment_one_liner": ( + f"Per-event {fn.split('_')[0]} comparison of a scalar constant against a " + f"single-instant {base} (built from value+timestamp); scalar-first MEOS arg order."), + } + + +def cmp_two_temporal(fn, ret, args): + """Generic two-temporal comparison: int fn(const Temporal*, const Temporal*) + on the *_temporal_temporal functions. Builds two single-instant tfloats from + (valueA,tsA)/(valueB,tsB) and reuses build_two_tnumber_points.""" + if ret != "int" or args != ("Temporal*", "Temporal*") or not fn.endswith("_temporal_temporal"): + return None + in_fn, vcpp, wkt = BASE["tfloat"] + return { + "nebula_name": pascal(fn), + "sql_token": fn.upper(), + "meos_call": fn, + "args": [ + {"name": "valueA", "nautilus_type": vcpp, "cpp_type": vcpp}, + {"name": "tsA", "nautilus_type": "uint64_t", "cpp_type": "uint64_t"}, + {"name": "valueB", "nautilus_type": vcpp, "cpp_type": vcpp}, + {"name": "tsB", "nautilus_type": "uint64_t", "cpp_type": "uint64_t"}, + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_two_tnumber_points": True, + "tnumber_value_cpp_type": vcpp, + "tnumber_wkt_format": wkt, + "tnumber_in_fn": in_fn, + "comment_one_liner": ( + f"Per-event {fn.split('_')[0]} comparison between two single-instant " + f"temporals (built from valueA/tsA and valueB/tsB)."), + } + + +def _args(spec): + return [{"name": n, "nautilus_type": t, + "cpp_type": "const char*" if t == "VariableSizedData" else t} for n, t in spec] + + +# per-template SQL arg layouts (must match the physical-cpp template's parameterValues order) +_A_TGEO_GEO = [("lon", "double"), ("lat", "double"), ("timestamp", "uint64_t"), ("geometry", "VariableSizedData")] +_A_TWO_TGEO = [("lonA", "double"), ("latA", "double"), ("tsA", "uint64_t"), + ("lonB", "double"), ("latB", "double"), ("tsB", "uint64_t")] +_A_TCB_CB = [("lon", "double"), ("lat", "double"), ("radius", "double"), ("timestamp", "uint64_t"), ("cbuffer", "VariableSizedData")] +_A_TWO_TCB = [("lonA", "double"), ("latA", "double"), ("radiusA", "double"), ("tsA", "uint64_t"), + ("lonB", "double"), ("latB", "double"), ("radiusB", "double"), ("tsB", "uint64_t")] + + +_SCALAR_RET = {"int": ("int", "INT32"), "double": ("double", "FLOAT64"), "bool": ("bool", "BOOLEAN")} + + +def _mk_scalar(fn, flag, argspec, note, ret="int"): + rt, nr = _SCALAR_RET[ret] + return { + "nebula_name": pascal(fn), + "sql_token": fn.upper(), + "meos_call": fn, + "args": _args(argspec), + "return_type": rt, + "nautilus_return": nr, + flag: True, + "comment_one_liner": note, + } + + +def sprel_scalar_existing(fn, ret, args): + """Scalar-returning (int/double/bool) spatial-relation / comparison / topological / + distance whose per-event input build is already covered by an existing + physical-cpp template. Routes by arg-shape + type token; returns None for + shapes needing a new template (tnpoint/tpose native two-temporal, reversed-arg, + text/bool object args, non-scalar return).""" + if ret not in _SCALAR_RET: + return None + if args == ("Temporal*", "GSERIALIZED*") and ("_tgeo_" in fn or "_tpoint_" in fn or "_tspatial_" in fn): + return _mk_scalar(fn, "build_temporal_point", _A_TGEO_GEO, + f"Per-event {fn}: single-instant tgeompoint vs a static geometry -> {ret}.", ret) + if args == ("Temporal*", "Temporal*") and "tcbuffer" in fn: + return _mk_scalar(fn, "build_two_tcbuffer_points", _A_TWO_TCB, + f"Per-event {fn} between two single-instant tcbuffers -> {ret}.", ret) + if args == ("Temporal*", "Temporal*") and not ("tnpoint" in fn or "tpose" in fn or "tnumber" in fn): + return _mk_scalar(fn, "build_two_temporal_points", _A_TWO_TGEO, + f"Per-event {fn} between two single-instant tgeompoints -> {ret}.", ret) + if args == ("Temporal*", "Cbuffer*"): + return _mk_scalar(fn, "build_tcbuffer_point_cbuffer", _A_TCB_CB, + f"Per-event {fn}: single-instant tcbuffer vs a static cbuffer -> {ret}.", ret) + return None + + +# leading/embedded type token -> generic input-builder key (codegen_nebula GENERIC_INPUTS) +_GENERIC_INPUT_FOR = [ + ("tgeompoint", "tgeompoint"), ("tgeogpoint", "tgeompoint"), ("tgeometry", "tgeometry"), + ("tcbuffer", "tcbuffer"), ("tnpoint", "tnpoint"), ("tpose", "tpose"), + ("tfloat", "tfloat"), ("tint", "tint"), ("tbool", "tbool"), + ("tnumber", "tfloat"), ("tgeo", "tgeompoint"), ("tpoint", "tgeompoint"), + ("tspatial", "tgeompoint"), +] + + +def _infer_input(fn): + for tok, inp in _GENERIC_INPUT_FOR: + if fn.startswith(tok + "_") or ("_" + tok + "_") in fn or fn.endswith("_" + tok): + return inp + return None + + +def temporal_unary_scalar(fn, ret, args): + """Unary scalar accessor: int|double|bool fn(const Temporal*). Generic shape; + input type inferred from the name token.""" + if args != ("Temporal*",): + return None + rk = {"int": "int", "double": "double", "bool": "bool"}.get(ret) + if not rk: + return None + inp = _infer_input(fn) + if not inp: + return None + return { + "nebula_name": pascal(fn), "sql_token": fn.upper(), "meos_call": fn, + "build_generic": True, "input_type": inp, "extra_args": [], "return_kind": rk, + "comment_one_liner": f"Per-event {fn}: {rk} accessor over a single-instant {inp}.", + } + + +_SCALAR_CPP = {"double": "double", "int": "int32_t", "bool": "bool"} + + +def temporal_x_scalar(fn, ret, args): + """int|double|bool fn(const Temporal*, scalar). Generic shape, one scalar extra.""" + if len(args) != 2 or args[0] != "Temporal*" or args[1] not in _SCALAR_CPP: + return None + rk = {"int": "int", "double": "double", "bool": "bool"}.get(ret) + inp = _infer_input(fn) + if not rk or not inp: + return None + return { + "nebula_name": pascal(fn), "sql_token": fn.upper(), "meos_call": fn, + "build_generic": True, "input_type": inp, + "extra_args": [{"kind": "scalar", "cpp": _SCALAR_CPP[args[1]]}], "return_kind": rk, + "comment_one_liner": f"Per-event {fn}: single-instant {inp} against a scalar -> {rk}.", + } + + +def temporal_x_geom(fn, ret, args): + """int|double|bool fn(const Temporal*, const GSERIALIZED*). Generic shape, one geom extra.""" + if args != ("Temporal*", "GSERIALIZED*"): + return None + rk = {"int": "int", "double": "double", "bool": "bool"}.get(ret) + inp = _infer_input(fn) + if not rk or not inp: + return None + return { + "nebula_name": pascal(fn), "sql_token": fn.upper(), "meos_call": fn, + "build_generic": True, "input_type": inp, + "extra_args": [{"kind": "geom"}], "return_kind": rk, + "comment_one_liner": f"Per-event {fn}: single-instant {inp} against a static geometry -> {rk}.", + } + + +def _result_extract_kind(fn): + """Scalar return_kind for a Temporal*-returning transform whose single-instant + result carries a tint/tfloat/tbool value — inferred from the function name.""" + if "_to_tint" in fn: + return "extract_int" + if "_to_tfloat" in fn: + return "extract_double" + if "_to_tbool" in fn: + return "extract_bool" + if fn.startswith("tfloat_"): + return "extract_double" + if fn.startswith("tint_"): + return "extract_int" + if fn.startswith("tbool_"): + return "extract_bool" + return None + + +def temporal_extract_scalar(fn, ret, args): + """Unary Temporal->Temporal* transform whose single-instant result carries a + scalar value (tfloat_ceil, tbool_to_tint, ...). Generic shape with an extract + marshaler. Result/text/geo-returning transforms are deferred (varsize).""" + if ret != "Temporal*" or args != ("Temporal*",): + return None + inp = _infer_input(fn) + rk = _result_extract_kind(fn) + if not inp or not rk: + return None + return { + "nebula_name": pascal(fn), "sql_token": fn.upper(), "meos_call": fn, + "build_generic": True, "input_type": inp, "extra_args": [], "return_kind": rk, + "comment_one_liner": f"Per-event {fn}: single-instant {inp} transform, value extracted -> {rk[8:]}.", + } + + +_BOX_PARSER = { # name-suffix token -> (cpp box type, MEOS parser, header) + "stbox": ("STBox", "stbox_in", "meos_geo.h"), + "tbox": ("TBox", "tbox_in", "meos.h"), + "tstzspan": ("Span", "tstzspan_in", "meos.h"), +} + + +# C arg-type -> (cpp box type, MEOS parser, header). Used for the box-first form +# where the box token is not the function-name suffix. STBox/TBox only: a bare +# `Span*` is ambiguous (tstzspan vs floatspan/numspan) so the box-first path +# skips it — the temporal-first path keeps resolving Span via the name suffix. +_BOXTYPE_PARSER = { + "STBox*": ("STBox", "stbox_in", "meos_geo.h"), + "TBox*": ("TBox", "tbox_in", "meos.h"), +} + + +def temporal_x_box(fn, ret, args): + """int|double|bool fn over a Temporal and an STBox/TBox/Span query LITERAL, + in EITHER argument order (e.g. `left_tspatial_stbox(temp, box)` and + `above_stbox_tspatial(box, temp)`). The literal is parsed at runtime + (stbox_in/tbox_in/tstzspan_in). For the temporal-first form the box type is + the name suffix (distinguishing tstzspan from numspan); for the box-first + form it is the C arg type (STBox/TBox).""" + if len(args) != 2: + return None + rk = {"int": "int", "double": "double", "bool": "bool"}.get(ret) + inp = _infer_input(fn) + if not rk or not inp: + return None + box_first = False + if args[0] == "Temporal*" and args[1] in ("STBox*", "TBox*", "Span*"): + tok = next((t for t in _BOX_PARSER if fn.endswith("_" + t)), None) + if not tok: + return None + bt, parser, hdr = _BOX_PARSER[tok] + elif args[1] == "Temporal*" and args[0] in _BOXTYPE_PARSER: + bt, parser, hdr = _BOXTYPE_PARSER[args[0]] + box_first = True + else: + return None + d = { + "nebula_name": pascal(fn), "sql_token": fn.upper(), "meos_call": fn, + "build_generic": True, "input_type": inp, "return_kind": rk, + "extra_args": [{"kind": "box", "box_type": bt, "parser": parser, "header": hdr}], + "comment_one_liner": f"Per-event {fn}: single-instant {inp} against a {bt} literal -> {rk}.", + } + if box_first: + d["box_first"] = True + return d + + +def stbox_x_stbox(fn, ret, args): + """bool|double fn(const STBox*, const STBox*) — a cross-vehicle comparison over + two per-vehicle extent boxes (each carried as a VARSIZED stbox-text field, e.g. + two TSPATIAL_EXTENT outputs in a self-join). The first box is the primary + stbox_text input; the second is a `box` extra arg; both are stbox_in-parsed and + freed. This is the production-faithful cross-stream shape: per-vehicle + aggregates (GROUP BY vehicle_id) compared pairwise downstream.""" + if len(args) != 2 or args[0] != "STBox*" or args[1] != "STBox*": + return None + rk = {"bool": "bool", "double": "double", "int": "int"}.get(ret) + if not rk: + return None + return { + "nebula_name": pascal(fn), "sql_token": fn.upper(), "meos_call": fn, + "build_generic": True, "input_type": "stbox_text", "return_kind": rk, + "extra_args": [{"kind": "box", "box_type": "STBox", "parser": "stbox_in", "header": "meos_geo.h"}], + "comment_one_liner": f"Per-event {fn}: two per-vehicle extent STBoxes -> {rk}.", + } + + +def two_temporal_scalar(fn, ret, args): + """bool|int|double fn(const Temporal*, const Temporal*) over TWO temporal + operands carried as hex-WKB VARSIZED fields — the cross-vehicle f(trajA, trajB) + scalar shape (e.g. two per-vehicle aggregate outputs compared in a self-join). + The first temporal is the primary wkb_temporal input; the second is a + wkb_temporal extra arg; both temporal_from_hexwkb-parsed and freed.""" + if len(args) != 2 or args[0] != "Temporal*" or args[1] != "Temporal*": + return None + rk = {"bool": "bool", "int": "int", "double": "double"}.get(ret) + if not rk: + return None + # the meos_call's type may live outside meos.h/meos_geo.h + extra_headers = [] + if "tnpoint" in fn: + extra_headers = ["meos_npoint.h"] + elif "tpose" in fn or "trgeometry" in fn: + extra_headers = ["meos_pose.h"] + d = { + "nebula_name": pascal(fn), "sql_token": fn.upper(), "meos_call": fn, + "build_generic": True, "input_type": "wkb_temporal", "return_kind": rk, + "extra_args": [{"kind": "wkb_temporal"}], + "comment_one_liner": f"Per-event {fn}: two hex-WKB temporal operands -> {rk}.", + } + if extra_headers: + d["extra_headers"] = extra_headers + return d + + +def two_temporal_temporal(fn, ret, args): + """Temporal* fn(const Temporal*, const Temporal*) over TWO temporal operands + carried as hex-WKB VARSIZED fields, returning a Temporal* serialized back to + hex-WKB VARSIZED — the cross-vehicle f(trajA, trajB) -> trajectory shape + (temporal distance / arithmetic / topology between two per-vehicle aggregate + outputs in a self-join). Both operands temporal_from_hexwkb-parsed and freed; + the result temporal_as_hexwkb-serialized into the arena and the MEOS result + freed. The output VARSIZED can itself feed another per-event MEOS operator.""" + if len(args) != 2 or args[0] != "Temporal*" or args[1] != "Temporal*": + return None + if ret != "Temporal*": + return None + # the meos_call symbol may live outside meos.h/meos_geo.h + extra_headers = [] + if "tcbuffer" in fn: + extra_headers = ["meos_cbuffer.h"] + elif "tnpoint" in fn: + extra_headers = ["meos_npoint.h"] + elif "tpose" in fn or "trgeometry" in fn: + extra_headers = ["meos_pose.h"] + d = { + "nebula_name": pascal(fn), "sql_token": fn.upper(), "meos_call": fn, + "build_generic": True, "input_type": "wkb_temporal", "return_kind": "wkb", + "extra_args": [{"kind": "wkb_temporal"}], + "comment_one_liner": f"Per-event {fn}: two hex-WKB temporal operands -> hex-WKB temporal.", + } + if extra_headers: + d["extra_headers"] = extra_headers + return d + + +SHAPES = { + "cmp_scalar_tempfirst": cmp_scalar_tempfirst, + "cmp_scalar_scalarfirst": cmp_scalar_scalarfirst, + "cmp_two_temporal": cmp_two_temporal, + "two_temporal_scalar": two_temporal_scalar, + "two_temporal_temporal": two_temporal_temporal, + "sprel_scalar_existing": sprel_scalar_existing, + "temporal_unary_scalar": temporal_unary_scalar, + "temporal_x_scalar": temporal_x_scalar, + "temporal_x_geom": temporal_x_geom, + "temporal_extract_scalar": temporal_extract_scalar, + "temporal_x_box": temporal_x_box, + "stbox_x_stbox": stbox_x_stbox, +} + + +def main(): + ap = argparse.ArgumentParser() + ap.add_argument("--sigs", required=True, help="header signature dump") + ap.add_argument("--gap", required=True, help="streamable-not-wired function list") + ap.add_argument("--shapes", required=True, + help="comma-separated SHAPE names to apply (order = match priority)") + ap.add_argument("--out", required=True, help="descriptor JSON output path") + a = ap.parse_args() + + sigs = parse_sigs(a.sigs) + gap = {ln.strip() for ln in open(a.gap) if ln.strip()} + shapes = [SHAPES[s] for s in a.shapes.split(",")] + + ops, unmatched = [], [] + for fn in sorted(gap): + if fn not in sigs: + continue + ret, args = sigs[fn] + for cls in shapes: + d = cls(fn, ret, args) + if d: + ops.append(d) + break + else: + unmatched.append(fn) + + json.dump({"_comment": f"codegen descriptor; shapes={a.shapes}", "operators": ops}, + open(a.out, "w"), indent=2) + sys.stderr.write(f"emitted {len(ops)} operator descriptor(s) -> {a.out}\n") + sys.stderr.write(f"(gap functions present in sig-dump but unmatched by these shapes: " + f"{len([f for f in unmatched if f in sigs])})\n") + + +if __name__ == "__main__": + main() diff --git a/tools/codegen/build_local.sh b/tools/codegen/build_local.sh new file mode 100755 index 0000000000..a3d78c139a --- /dev/null +++ b/tools/codegen/build_local.sh @@ -0,0 +1,31 @@ +#!/usr/bin/env bash +# +# Local compile-check of the generated MEOS operator + parser libraries in the +# NebulaStream dev image. +# +# The dev image ships without PahoMqttCpp (CI's image has it), so a configure +# that activates the optional MQTT Source/Sink plugins fails. Those plugins are +# irrelevant to the MEOS operator libraries, so this wrapper disables them for +# the local configure and ALWAYS restores nes-plugins/CMakeLists.txt afterwards +# (trap on EXIT) — no manual sed, and the working tree is never left modified +# even if the build fails or is interrupted. +# +# Usage: +# tools/codegen/build_local.sh [target ...] # default: the 3 op/parser libs +# NES_DEV_IMAGE=... BUILD_DIR=... tools/codegen/build_local.sh +# +set -euo pipefail +ROOT="$(git rev-parse --show-toplevel)" +PLUGINS="$ROOT/nes-plugins/CMakeLists.txt" +IMAGE="${NES_DEV_IMAGE:-localhost/nes-development:mobilitynebula-v3}" +BUILD_DIR="${BUILD_DIR:-build-w15}" +TARGETS="${*:-nes-physical-operators nes-logical-operators nes-sql-parser}" + +restore() { git -C "$ROOT" checkout -- "$PLUGINS" 2>/dev/null || true; } +trap restore EXIT + +# Disable the optional MQTT plugins for the local configure (absent in this image). +sed -i 's#"Sources/MQTTSource" ON)#"Sources/MQTTSource" OFF)#; s#"Sinks/MQTTSink" ON)#"Sinks/MQTTSink" OFF)#' "$PLUGINS" + +podman run --rm -v "$ROOT":/workspace -w /workspace "$IMAGE" \ + bash -lc "cmake --build '$BUILD_DIR' --target $TARGETS -j 8 -- -k 0; echo \"### EXIT=\$?\"" diff --git a/tools/codegen/codegen_aggregations.py b/tools/codegen/codegen_aggregations.py new file mode 100644 index 0000000000..e2b1e86bb8 --- /dev/null +++ b/tools/codegen/codegen_aggregations.py @@ -0,0 +1,2745 @@ +#!/usr/bin/env python3 +"""MobilityNebula MEOS-aggregation generator. + +Companion to ``codegen_nebula.py`` (per-event ops). This generator targets +the WINDOWED-aggregation surface: MEOS scalar functions of the shape +`` fn(const Temporal*)`` where the Temporal* is a per-(window, +group) sequence assembled across multiple events. + +For each operator in the JSON descriptor list, emits four C++ files +mirroring mariana's hand-written TemporalLengthAggregation 1:1: + + * nes-logical-operators/include/Operators/Windows/Aggregations/Meos/ + XXXAggregationLogicalFunction.hpp + * nes-logical-operators/src/Operators/Windows/Aggregations/Meos/ + XXXAggregationLogicalFunction.cpp + * nes-physical-operators/include/Aggregation/Function/Meos/ + XXXAggregationPhysicalFunction.hpp + * nes-physical-operators/src/Aggregation/Function/Meos/ + XXXAggregationPhysicalFunction.cpp + +And idempotently injects into 5 in-tree shared files: + + * nes-sql-parser/AntlrSQL.g4 + - lexer-token entries + - functionName: alternation list + * nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp + - case AntlrSQLLexer::TOKEN: dispatch in the dedicated-token switch + - else if (funcName == "TOKEN") dispatch in the IDENTIFIER fallback chain + * nes-query-optimizer/src/RewriteRules/LowerToPhysical/ + LowerToPhysicalWindowedAggregation.cpp + - if (name == "Xxx") { ... } block lowering logical → physical + * nes-{logical,physical}-operators/.../{Aggregation*}/CMakeLists.txt + - add_plugin(...) per layer + +All injections are bracketed with +``/* BEGIN CODEGEN AGGREGATION GLUE: TOKEN */ ... /* END ... */`` markers +so re-runs are no-ops and pre-existing hand-written cases (mariana's) are +detected by raw token match and skipped. + +Two lift-shape branches, picked by descriptor ``input_shape``: + * ``tgeo`` — 3 fields per event (lon, lat, ts); lower builds + ``{Point(lon lat)@ts, ...}`` trajectory string parsed via + ``MEOS::Meos::parseTemporalPoint``. + * ``tnumber``— 2 fields per event (value, ts); lower builds + ``{value@ts, ...}`` string parsed via ``tfloat_in`` or + ``tint_in`` per descriptor. + +Usage: + python3 codegen_aggregations.py --input \\ + --output-root /path/to/MobilityNebula \\ + [--no-parser-glue] [--no-cmake-entries] [--no-optimizer-glue] +""" +import argparse +import json +import re +import sys +from pathlib import Path + +# =========================================================================== +# Logical-layer .hpp template (mirrors TemporalLengthAggregationLogicalFunction.hpp). +# =========================================================================== +LOGICAL_HPP_TGEO = """\ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include + +namespace NES +{{ + +/** + * @brief {comment_one_liner} + * + * Three-input (lon, lat, ts) tgeo aggregation. Lift accumulates the events + * into a paged vector; lower assembles the per-(window, group) trajectory + * and calls MEOS `{meos_scalar_fn}` to fold it to a single scalar. + */ +class {nebula_name}AggregationLogicalFunction : public WindowAggregationLogicalFunction +{{ +public: + static std::shared_ptr + create(const FieldAccessLogicalFunction& lonField, const FieldAccessLogicalFunction& latField, const FieldAccessLogicalFunction& timestampField); + + {nebula_name}AggregationLogicalFunction( + const FieldAccessLogicalFunction& lonField, + const FieldAccessLogicalFunction& latField, + const FieldAccessLogicalFunction& timestampField, + const FieldAccessLogicalFunction& asField); + + void inferStamp(const Schema& schema) override; + ~{nebula_name}AggregationLogicalFunction() override = default; + [[nodiscard]] NES::SerializableAggregationFunction serialize() const override; + [[nodiscard]] std::string_view getName() const noexcept override; + [[nodiscard]] bool requiresSequentialAggregation() const {{ return true; }} + + [[nodiscard]] const FieldAccessLogicalFunction& getLonField() const noexcept {{ return lonField; }} + [[nodiscard]] const FieldAccessLogicalFunction& getLatField() const noexcept {{ return latField; }} + [[nodiscard]] const FieldAccessLogicalFunction& getTimestampField() const noexcept {{ return timestampField; }} + +private: + static constexpr std::string_view NAME = "{class_name_token}"; + static constexpr DataType::Type partialAggregateStampType = DataType::Type::UNDEFINED; + static constexpr DataType::Type finalAggregateStampType = DataType::Type::{final_stamp_type}; + + FieldAccessLogicalFunction lonField; + FieldAccessLogicalFunction latField; + FieldAccessLogicalFunction timestampField; +}}; +}} +""" + +LOGICAL_HPP_TNUMBER = """\ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include + +namespace NES +{{ + +/** + * @brief {comment_one_liner} + * + * Two-input (value, ts) tnumber aggregation. Lift accumulates the events + * into a paged vector; lower assembles the per-(window, group) tnumber + * sequence and calls MEOS `{meos_scalar_fn}` to fold it to a single scalar. + */ +class {nebula_name}AggregationLogicalFunction : public WindowAggregationLogicalFunction +{{ +public: + static std::shared_ptr + create(const FieldAccessLogicalFunction& valueField, const FieldAccessLogicalFunction& timestampField); + + {nebula_name}AggregationLogicalFunction( + const FieldAccessLogicalFunction& valueField, + const FieldAccessLogicalFunction& timestampField, + const FieldAccessLogicalFunction& asField); + + void inferStamp(const Schema& schema) override; + ~{nebula_name}AggregationLogicalFunction() override = default; + [[nodiscard]] NES::SerializableAggregationFunction serialize() const override; + [[nodiscard]] std::string_view getName() const noexcept override; + [[nodiscard]] bool requiresSequentialAggregation() const {{ return true; }} + + [[nodiscard]] const FieldAccessLogicalFunction& getValueField() const noexcept {{ return valueField; }} + [[nodiscard]] const FieldAccessLogicalFunction& getTimestampField() const noexcept {{ return timestampField; }} + +private: + static constexpr std::string_view NAME = "{class_name_token}"; + static constexpr DataType::Type partialAggregateStampType = DataType::Type::UNDEFINED; + static constexpr DataType::Type finalAggregateStampType = DataType::Type::{final_stamp_type}; + + FieldAccessLogicalFunction valueField; + FieldAccessLogicalFunction timestampField; +}}; +}} +""" + +# Logical .cpp templates — share scaffold (ctor, inferStamp, serialize, registry) +# but differ in field count (3 for tgeo, 2 for tnumber). +LOGICAL_CPP_TGEO = """\ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +namespace NES +{{ + +{nebula_name}AggregationLogicalFunction::{nebula_name}AggregationLogicalFunction( + const FieldAccessLogicalFunction& lonField, + const FieldAccessLogicalFunction& latField, + const FieldAccessLogicalFunction& timestampField, + const FieldAccessLogicalFunction& asField) + : WindowAggregationLogicalFunction( + lonField.getDataType(), + DataTypeProvider::provideDataType(partialAggregateStampType), + DataTypeProvider::provideDataType(finalAggregateStampType), + lonField, + asField) + , lonField(lonField) + , latField(latField) + , timestampField(timestampField) +{{ +}} + +std::shared_ptr +{nebula_name}AggregationLogicalFunction::create( + const FieldAccessLogicalFunction& lonField, + const FieldAccessLogicalFunction& latField, + const FieldAccessLogicalFunction& timestampField) +{{ + return std::make_shared<{nebula_name}AggregationLogicalFunction>(lonField, latField, timestampField, lonField); +}} + +std::string_view {nebula_name}AggregationLogicalFunction::getName() const noexcept +{{ + return NAME; +}} + +void {nebula_name}AggregationLogicalFunction::inferStamp(const Schema& schema) +{{ + lonField = lonField.withInferredDataType(schema).get(); + latField = latField.withInferredDataType(schema).get(); + timestampField = timestampField.withInferredDataType(schema).get(); + + onField = lonField; + + if (!lonField.getDataType().isNumeric() || !latField.getDataType().isNumeric() || !timestampField.getDataType().isNumeric()) + {{ + throw CannotInferSchema("{nebula_name}AggregationLogicalFunction: lon, lat, and timestamp fields must be numeric."); + }} + + const auto onFieldName = onField.getFieldName(); + const auto asFieldName = asField.getFieldName(); + const auto attributeNameResolver = onFieldName.substr(0, onFieldName.find(Schema::ATTRIBUTE_NAME_SEPARATOR) + 1); + if (asFieldName.find(Schema::ATTRIBUTE_NAME_SEPARATOR) == std::string::npos) + {{ + asField = asField.withFieldName(attributeNameResolver + asFieldName).get(); + }} + else + {{ + const auto fieldName = asFieldName.substr(asFieldName.find_last_of(Schema::ATTRIBUTE_NAME_SEPARATOR) + 1); + asField = asField.withFieldName(attributeNameResolver + fieldName).get(); + }} + asField = asField.withDataType(getFinalAggregateStamp()).get(); + inputStamp = onField.getDataType(); +}} + +NES::SerializableAggregationFunction {nebula_name}AggregationLogicalFunction::serialize() const +{{ + auto saf = TemporalAggregationSerde::serializeTemporalSequence(lonField, latField, timestampField, asField); + saf.set_type(std::string(NAME)); + return saf; +}} + +AggregationLogicalFunctionRegistryReturnType AggregationLogicalFunctionGeneratedRegistrar::Register{nebula_name}AggregationLogicalFunction( + AggregationLogicalFunctionRegistryArguments arguments) +{{ + if (arguments.fields.size() == 4) + {{ + auto ptr = std::make_shared<{nebula_name}AggregationLogicalFunction>( + arguments.fields[0], arguments.fields[1], arguments.fields[2], arguments.fields[3]); + return ptr; + }} + throw CannotDeserialize( + "{nebula_name}AggregationLogicalFunction requires lon, lat, timestamp, and alias fields but got {{}}", + arguments.fields.size()); +}} + +}} // namespace NES +""" + +LOGICAL_CPP_TNUMBER = """\ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +namespace NES +{{ + +{nebula_name}AggregationLogicalFunction::{nebula_name}AggregationLogicalFunction( + const FieldAccessLogicalFunction& valueField, + const FieldAccessLogicalFunction& timestampField, + const FieldAccessLogicalFunction& asField) + : WindowAggregationLogicalFunction( + valueField.getDataType(), + DataTypeProvider::provideDataType(partialAggregateStampType), + DataTypeProvider::provideDataType(finalAggregateStampType), + valueField, + asField) + , valueField(valueField) + , timestampField(timestampField) +{{ +}} + +std::shared_ptr +{nebula_name}AggregationLogicalFunction::create( + const FieldAccessLogicalFunction& valueField, + const FieldAccessLogicalFunction& timestampField) +{{ + return std::make_shared<{nebula_name}AggregationLogicalFunction>(valueField, timestampField, valueField); +}} + +std::string_view {nebula_name}AggregationLogicalFunction::getName() const noexcept +{{ + return NAME; +}} + +void {nebula_name}AggregationLogicalFunction::inferStamp(const Schema& schema) +{{ + valueField = valueField.withInferredDataType(schema).get(); + timestampField = timestampField.withInferredDataType(schema).get(); + + onField = valueField; + + if (!valueField.getDataType().isNumeric() || !timestampField.getDataType().isNumeric()) + {{ + throw CannotInferSchema("{nebula_name}AggregationLogicalFunction: value and timestamp fields must be numeric."); + }} + + const auto onFieldName = onField.getFieldName(); + const auto asFieldName = asField.getFieldName(); + const auto attributeNameResolver = onFieldName.substr(0, onFieldName.find(Schema::ATTRIBUTE_NAME_SEPARATOR) + 1); + if (asFieldName.find(Schema::ATTRIBUTE_NAME_SEPARATOR) == std::string::npos) + {{ + asField = asField.withFieldName(attributeNameResolver + asFieldName).get(); + }} + else + {{ + const auto fieldName = asFieldName.substr(asFieldName.find_last_of(Schema::ATTRIBUTE_NAME_SEPARATOR) + 1); + asField = asField.withFieldName(attributeNameResolver + fieldName).get(); + }} + asField = asField.withDataType(getFinalAggregateStamp()).get(); + inputStamp = onField.getDataType(); +}} + +NES::SerializableAggregationFunction {nebula_name}AggregationLogicalFunction::serialize() const +{{ + auto saf = TemporalAggregationSerde::serializeTemporalSequence(valueField, timestampField, valueField, asField); + saf.set_type(std::string(NAME)); + return saf; +}} + +AggregationLogicalFunctionRegistryReturnType AggregationLogicalFunctionGeneratedRegistrar::Register{nebula_name}AggregationLogicalFunction( + AggregationLogicalFunctionRegistryArguments arguments) +{{ + // serializeTemporalSequence only has a 4-field (lon, lat, ts, as) form, so + // the two-field (value, ts) shape packs the value field twice; fields[2] is + // that duplicate and is ignored here — the alias is fields[3]. + if (arguments.fields.size() == 4) + {{ + auto ptr = std::make_shared<{nebula_name}AggregationLogicalFunction>( + arguments.fields[0], arguments.fields[1], arguments.fields[3]); + return ptr; + }} + throw CannotDeserialize( + "{nebula_name}AggregationLogicalFunction requires value, timestamp, and alias fields but got {{}}", + arguments.fields.size()); +}} + +}} // namespace NES +""" + +# Physical-layer .hpp templates. +PHYSICAL_HPP_TGEO = """\ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include +#include +#include + +namespace NES +{{ + +class {nebula_name}AggregationPhysicalFunction : public AggregationPhysicalFunction +{{ +public: + {nebula_name}AggregationPhysicalFunction( + DataType inputType, + DataType resultType, + PhysicalFunction lonFunctionParam, + PhysicalFunction latFunctionParam, + PhysicalFunction timestampFunctionParam, + Nautilus::Record::RecordFieldIdentifier resultFieldIdentifier, + std::shared_ptr bufferRef); + void lift( + const nautilus::val& aggregationState, + PipelineMemoryProvider& pipelineMemoryProvider, + const Nautilus::Record& record) + override; + void combine( + nautilus::val aggregationState1, + nautilus::val aggregationState2, + PipelineMemoryProvider& pipelineMemoryProvider) override; + Nautilus::Record lower(nautilus::val aggregationState, [[maybe_unused]] PipelineMemoryProvider& pipelineMemoryProvider) override; + void reset(nautilus::val aggregationState, PipelineMemoryProvider& pipelineMemoryProvider) override; + [[nodiscard]] size_t getSizeOfStateInBytes() const override; + ~{nebula_name}AggregationPhysicalFunction() override = default; + void cleanup(nautilus::val aggregationState) override; + +private: + std::shared_ptr bufferRef; + PhysicalFunction lonFunction; + PhysicalFunction latFunction; + PhysicalFunction timestampFunction; +}}; + +}} +""" + +PHYSICAL_HPP_TNUMBER = """\ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include +#include +#include + +namespace NES +{{ + +class {nebula_name}AggregationPhysicalFunction : public AggregationPhysicalFunction +{{ +public: + {nebula_name}AggregationPhysicalFunction( + DataType inputType, + DataType resultType, + PhysicalFunction valueFunctionParam, + PhysicalFunction timestampFunctionParam, + Nautilus::Record::RecordFieldIdentifier resultFieldIdentifier, + std::shared_ptr bufferRef); + void lift( + const nautilus::val& aggregationState, + PipelineMemoryProvider& pipelineMemoryProvider, + const Nautilus::Record& record) + override; + void combine( + nautilus::val aggregationState1, + nautilus::val aggregationState2, + PipelineMemoryProvider& pipelineMemoryProvider) override; + Nautilus::Record lower(nautilus::val aggregationState, [[maybe_unused]] PipelineMemoryProvider& pipelineMemoryProvider) override; + void reset(nautilus::val aggregationState, PipelineMemoryProvider& pipelineMemoryProvider) override; + [[nodiscard]] size_t getSizeOfStateInBytes() const override; + ~{nebula_name}AggregationPhysicalFunction() override = default; + void cleanup(nautilus::val aggregationState) override; + +private: + std::shared_ptr bufferRef; + PhysicalFunction valueFunction; + PhysicalFunction timestampFunction; +}}; + +}} +""" + +# Physical .cpp templates — the core logic. lift/combine/reset/cleanup are identical +# scaffold; lower() is the per-op differential (builds trajectory string + MEOS call). +PHYSICAL_CPP_TGEO = """\ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +extern "C" {{ +#include +#include +}} + +namespace NES +{{ + +constexpr static std::string_view LonFieldName = "lon"; +constexpr static std::string_view LatFieldName = "lat"; +constexpr static std::string_view TimestampFieldName = "timestamp"; + +static std::mutex {mutex_name}; + + +{nebula_name}AggregationPhysicalFunction::{nebula_name}AggregationPhysicalFunction( + DataType inputType, + DataType resultType, + PhysicalFunction lonFunctionParam, + PhysicalFunction latFunctionParam, + PhysicalFunction timestampFunctionParam, + Nautilus::Record::RecordFieldIdentifier resultFieldIdentifier, + std::shared_ptr bufferRef) + : AggregationPhysicalFunction(std::move(inputType), std::move(resultType), lonFunctionParam, std::move(resultFieldIdentifier)) + , bufferRef(std::move(bufferRef)) + , lonFunction(std::move(lonFunctionParam)) + , latFunction(std::move(latFunctionParam)) + , timestampFunction(std::move(timestampFunctionParam)) +{{ +}} + +void {nebula_name}AggregationPhysicalFunction::lift( + const nautilus::val& aggregationState, PipelineMemoryProvider& pipelineMemoryProvider, const Nautilus::Record& record) +{{ + const auto pagedVectorPtr = static_cast>(aggregationState); + + auto lonValue = lonFunction.execute(record, pipelineMemoryProvider.arena); + auto latValue = latFunction.execute(record, pipelineMemoryProvider.arena); + auto timestampValue = timestampFunction.execute(record, pipelineMemoryProvider.arena); + + Record aggregateStateRecord({{ + {{std::string(LonFieldName), lonValue}}, + {{std::string(LatFieldName), latValue}}, + {{std::string(TimestampFieldName), timestampValue}} + }}); + + const Nautilus::Interface::PagedVectorRef pagedVectorRef(pagedVectorPtr, bufferRef); + pagedVectorRef.writeRecord(aggregateStateRecord, pipelineMemoryProvider.bufferProvider); +}} + +void {nebula_name}AggregationPhysicalFunction::combine( + const nautilus::val aggregationState1, + const nautilus::val aggregationState2, + PipelineMemoryProvider&) +{{ + const auto memArea1 = static_cast>(aggregationState1); + const auto memArea2 = static_cast>(aggregationState2); + + nautilus::invoke( + +[](Nautilus::Interface::PagedVector* vector1, const Nautilus::Interface::PagedVector* vector2) -> void + {{ vector1->copyFrom(*vector2); }}, + memArea1, + memArea2); +}} + +Nautilus::Record {nebula_name}AggregationPhysicalFunction::lower( + const nautilus::val aggregationState, [[maybe_unused]] PipelineMemoryProvider& pipelineMemoryProvider) +{{ + MEOS::Meos::ensureMeosInitialized(); + + const auto pagedVectorPtr = static_cast>(aggregationState); + const Nautilus::Interface::PagedVectorRef pagedVectorRef(pagedVectorPtr, bufferRef); + const auto allFieldNames = bufferRef->getMemoryLayout()->getSchema().getFieldNames(); + const auto numberOfEntries = invoke( + +[](const Nautilus::Interface::PagedVector* pagedVector) + {{ + return pagedVector->getTotalNumberOfEntries(); + }}, + pagedVectorPtr); + + if (numberOfEntries == nautilus::val(0)) {{ + Nautilus::Record resultRecord; + resultRecord.write(resultFieldIdentifier, nautilus::val<{return_cpp_type}>(0)); + return resultRecord; + }} + + auto trajectoryStr = nautilus::invoke( + +[](const Nautilus::Interface::PagedVector* pagedVector) -> char* + {{ + size_t bufferSize = pagedVector->getTotalNumberOfEntries() * 150 + 50; + char* buffer = (char*)malloc(bufferSize); + memset(buffer, 0, bufferSize); + strcpy(buffer, "{{"); + return buffer; + }}, + pagedVectorPtr); + + auto pointCounter = nautilus::val(0); + + const auto endIt = pagedVectorRef.end(allFieldNames); + for (auto candidateIt = pagedVectorRef.begin(allFieldNames); candidateIt != endIt; ++candidateIt) + {{ + const auto itemRecord = *candidateIt; + + const auto lonValue = itemRecord.read(std::string(LonFieldName)); + const auto latValue = itemRecord.read(std::string(LatFieldName)); + const auto timestampValue = itemRecord.read(std::string(TimestampFieldName)); + + auto lon = lonValue.cast>(); + auto lat = latValue.cast>(); + auto timestamp = timestampValue.cast>(); + + trajectoryStr = nautilus::invoke( + +[](char* buffer, double lonVal, double latVal, int64_t tsVal, int64_t counter) -> char* + {{ + if (counter > 0) {{ + strcat(buffer, ", "); + }} + + long long adjustedTime; + if (tsVal > 1000000000000LL) {{ + adjustedTime = tsVal / 1000; + }} else {{ + adjustedTime = tsVal; + }} + + std::string timestampString = MEOS::Meos::convertSecondsToTimestamp(adjustedTime); + const char* timestampStr = timestampString.c_str(); + + char pointStr[120]; + sprintf(pointStr, "Point(%.6f %.6f)@%s", lonVal, latVal, timestampStr); + strcat(buffer, pointStr); + return buffer; + }}, + trajectoryStr, + lon, + lat, + timestamp, + pointCounter); + + pointCounter = pointCounter + nautilus::val(1); + }} + + trajectoryStr = nautilus::invoke( + +[](char* buffer) -> char* + {{ + strcat(buffer, "}}"); + return buffer; + }}, + trajectoryStr); + + auto resultValue = nautilus::invoke( + +[](const char* trajStr) -> {return_cpp_type} + {{ + if (!trajStr || strlen(trajStr) == 0) {{ + free((void*)trajStr); + return ({return_cpp_type})0; + }} + + MEOS::Meos::ensureMeosInitialized(); + std::lock_guard lock({mutex_name}); + + std::string trajString(trajStr); + void* temp = MEOS::Meos::parseTemporalPoint(trajString); + if (!temp) {{ + free((void*)trajStr); + return ({return_cpp_type})0; + }} + + {value_compute} + + MEOS::Meos::freeTemporalObject(temp); + free((void*)trajStr); + return value; + }}, + trajectoryStr); + + Nautilus::Record resultRecord; + resultRecord.write(resultFieldIdentifier, resultValue); + return resultRecord; +}} + +void {nebula_name}AggregationPhysicalFunction::reset(const nautilus::val aggregationState, PipelineMemoryProvider&) +{{ + nautilus::invoke( + +[](AggregationState* pagedVectorMemArea) -> void + {{ + auto* pagedVector = reinterpret_cast(pagedVectorMemArea); + new (pagedVector) Nautilus::Interface::PagedVector(); + }}, + aggregationState); +}} + +size_t {nebula_name}AggregationPhysicalFunction::getSizeOfStateInBytes() const +{{ + return sizeof(Nautilus::Interface::PagedVector); +}} + +void {nebula_name}AggregationPhysicalFunction::cleanup(nautilus::val aggregationState) +{{ + nautilus::invoke( + +[](AggregationState* pagedVectorMemArea) -> void + {{ + auto* pagedVector = reinterpret_cast(pagedVectorMemArea); + pagedVector->~PagedVector(); + }}, + aggregationState); +}} + + +AggregationPhysicalFunctionRegistryReturnType AggregationPhysicalFunctionGeneratedRegistrar::Register{nebula_name}AggregationPhysicalFunction( + AggregationPhysicalFunctionRegistryArguments) +{{ + throw std::runtime_error("{class_name_token} aggregation cannot be created through the registry. " + "It requires three field functions (longitude, latitude, timestamp)"); +}} + +}} // namespace NES +""" + +PHYSICAL_CPP_TNUMBER = """\ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +extern "C" {{ +#include +}} + +namespace NES +{{ + +constexpr static std::string_view ValueFieldName = "value"; +constexpr static std::string_view TimestampFieldName = "timestamp"; + +static std::mutex {mutex_name}; + + +{nebula_name}AggregationPhysicalFunction::{nebula_name}AggregationPhysicalFunction( + DataType inputType, + DataType resultType, + PhysicalFunction valueFunctionParam, + PhysicalFunction timestampFunctionParam, + Nautilus::Record::RecordFieldIdentifier resultFieldIdentifier, + std::shared_ptr bufferRef) + : AggregationPhysicalFunction(std::move(inputType), std::move(resultType), valueFunctionParam, std::move(resultFieldIdentifier)) + , bufferRef(std::move(bufferRef)) + , valueFunction(std::move(valueFunctionParam)) + , timestampFunction(std::move(timestampFunctionParam)) +{{ +}} + +void {nebula_name}AggregationPhysicalFunction::lift( + const nautilus::val& aggregationState, PipelineMemoryProvider& pipelineMemoryProvider, const Nautilus::Record& record) +{{ + const auto pagedVectorPtr = static_cast>(aggregationState); + + auto valueValue = valueFunction.execute(record, pipelineMemoryProvider.arena); + auto timestampValue = timestampFunction.execute(record, pipelineMemoryProvider.arena); + + Record aggregateStateRecord({{ + {{std::string(ValueFieldName), valueValue}}, + {{std::string(TimestampFieldName), timestampValue}} + }}); + + const Nautilus::Interface::PagedVectorRef pagedVectorRef(pagedVectorPtr, bufferRef); + pagedVectorRef.writeRecord(aggregateStateRecord, pipelineMemoryProvider.bufferProvider); +}} + +void {nebula_name}AggregationPhysicalFunction::combine( + const nautilus::val aggregationState1, + const nautilus::val aggregationState2, + PipelineMemoryProvider&) +{{ + const auto memArea1 = static_cast>(aggregationState1); + const auto memArea2 = static_cast>(aggregationState2); + + nautilus::invoke( + +[](Nautilus::Interface::PagedVector* vector1, const Nautilus::Interface::PagedVector* vector2) -> void + {{ vector1->copyFrom(*vector2); }}, + memArea1, + memArea2); +}} + +Nautilus::Record {nebula_name}AggregationPhysicalFunction::lower( + const nautilus::val aggregationState, [[maybe_unused]] PipelineMemoryProvider& pipelineMemoryProvider) +{{ + MEOS::Meos::ensureMeosInitialized(); + + const auto pagedVectorPtr = static_cast>(aggregationState); + const Nautilus::Interface::PagedVectorRef pagedVectorRef(pagedVectorPtr, bufferRef); + const auto allFieldNames = bufferRef->getMemoryLayout()->getSchema().getFieldNames(); + const auto numberOfEntries = invoke( + +[](const Nautilus::Interface::PagedVector* pagedVector) + {{ + return pagedVector->getTotalNumberOfEntries(); + }}, + pagedVectorPtr); + + if (numberOfEntries == nautilus::val(0)) {{ + Nautilus::Record resultRecord; + resultRecord.write(resultFieldIdentifier, nautilus::val<{return_cpp_type}>(0)); + return resultRecord; + }} + + auto sequenceStr = nautilus::invoke( + +[](const Nautilus::Interface::PagedVector* pagedVector) -> char* + {{ + size_t bufferSize = pagedVector->getTotalNumberOfEntries() * 80 + 50; + char* buffer = (char*)malloc(bufferSize); + memset(buffer, 0, bufferSize); + strcpy(buffer, "{{"); + return buffer; + }}, + pagedVectorPtr); + + auto pointCounter = nautilus::val(0); + + const auto endIt = pagedVectorRef.end(allFieldNames); + for (auto candidateIt = pagedVectorRef.begin(allFieldNames); candidateIt != endIt; ++candidateIt) + {{ + const auto itemRecord = *candidateIt; + + const auto valueRaw = itemRecord.read(std::string(ValueFieldName)); + const auto timestampRaw = itemRecord.read(std::string(TimestampFieldName)); + + auto value = valueRaw.cast>(); + auto timestamp = timestampRaw.cast>(); + + sequenceStr = nautilus::invoke( + +[](char* buffer, {lift_value_cpp_type} valueVal, int64_t tsVal, int64_t counter) -> char* + {{ + if (counter > 0) {{ + strcat(buffer, ", "); + }} + + long long adjustedTime; + if (tsVal > 1000000000000LL) {{ + adjustedTime = tsVal / 1000; + }} else {{ + adjustedTime = tsVal; + }} + + std::string timestampString = MEOS::Meos::convertSecondsToTimestamp(adjustedTime); + const char* timestampStr = timestampString.c_str(); + + char itemStr[80]; + sprintf(itemStr, "{value_printf_fmt}@%s", valueVal, timestampStr); + strcat(buffer, itemStr); + return buffer; + }}, + sequenceStr, + value, + timestamp, + pointCounter); + + pointCounter = pointCounter + nautilus::val(1); + }} + + sequenceStr = nautilus::invoke( + +[](char* buffer) -> char* + {{ + strcat(buffer, "}}"); + return buffer; + }}, + sequenceStr); + + auto resultValue = nautilus::invoke( + +[](const char* seqStr) -> {return_cpp_type} + {{ + if (!seqStr || strlen(seqStr) == 0) {{ + free((void*)seqStr); + return ({return_cpp_type})0; + }} + + MEOS::Meos::ensureMeosInitialized(); + std::lock_guard lock({mutex_name}); + + Temporal* temp = {tnumber_in_fn}(seqStr); + if (!temp) {{ + free((void*)seqStr); + return ({return_cpp_type})0; + }} + + {return_cpp_type} value = {meos_scalar_fn}(temp); + + free(temp); + free((void*)seqStr); + return value; + }}, + sequenceStr); + + Nautilus::Record resultRecord; + resultRecord.write(resultFieldIdentifier, resultValue); + return resultRecord; +}} + +void {nebula_name}AggregationPhysicalFunction::reset(const nautilus::val aggregationState, PipelineMemoryProvider&) +{{ + nautilus::invoke( + +[](AggregationState* pagedVectorMemArea) -> void + {{ + auto* pagedVector = reinterpret_cast(pagedVectorMemArea); + new (pagedVector) Nautilus::Interface::PagedVector(); + }}, + aggregationState); +}} + +size_t {nebula_name}AggregationPhysicalFunction::getSizeOfStateInBytes() const +{{ + return sizeof(Nautilus::Interface::PagedVector); +}} + +void {nebula_name}AggregationPhysicalFunction::cleanup(nautilus::val aggregationState) +{{ + nautilus::invoke( + +[](AggregationState* pagedVectorMemArea) -> void + {{ + auto* pagedVector = reinterpret_cast(pagedVectorMemArea); + pagedVector->~PagedVector(); + }}, + aggregationState); +}} + + +AggregationPhysicalFunctionRegistryReturnType AggregationPhysicalFunctionGeneratedRegistrar::Register{nebula_name}AggregationPhysicalFunction( + AggregationPhysicalFunctionRegistryArguments) +{{ + throw std::runtime_error("{class_name_token} aggregation cannot be created through the registry. " + "It requires two field functions (value, timestamp)"); +}} + +}} // namespace NES +""" + +# =========================================================================== +# Box-output (VARSIZED) physical .cpp templates. +# +# The 11 MEOS `*_extent_transfn` aggregates do not fold a window to a scalar — +# they fold it to a *box* (a Span / TBox / STBox). NebulaStream emits such a +# windowed value through the same variable-sized-data path that +# TemporalSequenceAggregationPhysicalFunction already uses: in lower() we +# serialize the box to text (`*_out`) and write it as VARSIZED. +# +# To stay byte-identical to the proven scalar templates above (lift / combine / +# reset / cleanup / the trajectory-assembly loop are unchanged), the box +# templates are DERIVED from the scalar templates by swapping exactly two +# well-delimited regions: the empty-window early-return and the finalize tail. +# The swap is asserted (count == 1) so any drift in the scalar template fails +# loudly at import time rather than emitting silently-wrong C++. +# =========================================================================== + +# Empty-window early-return — identical in the TGEO and TNUMBER scalar templates. +_EMPTY_SCALAR = """\ + if (numberOfEntries == nautilus::val(0)) {{ + Nautilus::Record resultRecord; + resultRecord.write(resultFieldIdentifier, nautilus::val<{return_cpp_type}>(0)); + return resultRecord; + }}""" + +_EMPTY_BOX = """\ + if (numberOfEntries == nautilus::val(0)) {{ + auto emptyVarSized = pipelineMemoryProvider.arena.allocateVariableSizedData(0); + Nautilus::Record resultRecord; + resultRecord.write(resultFieldIdentifier, emptyVarSized); + return resultRecord; + }}""" + +# Finalize tail — TGEO scalar (parseTemporalPoint / trajectoryStr / freeTemporalObject). +_FINALIZE_SCALAR_TGEO = """\ + auto resultValue = nautilus::invoke( + +[](const char* trajStr) -> {return_cpp_type} + {{ + if (!trajStr || strlen(trajStr) == 0) {{ + free((void*)trajStr); + return ({return_cpp_type})0; + }} + + MEOS::Meos::ensureMeosInitialized(); + std::lock_guard lock({mutex_name}); + + std::string trajString(trajStr); + void* temp = MEOS::Meos::parseTemporalPoint(trajString); + if (!temp) {{ + free((void*)trajStr); + return ({return_cpp_type})0; + }} + + {value_compute} + + MEOS::Meos::freeTemporalObject(temp); + free((void*)trajStr); + return value; + }}, + trajectoryStr); + + Nautilus::Record resultRecord; + resultRecord.write(resultFieldIdentifier, resultValue); + return resultRecord;""" + +# Finalize tail — TGEO box: fold the windowed trajectory's extent box and emit +# its serialized text as VARSIZED. With a NULL initial state the MEOS extent +# transition fn returns the bbox of the whole-window temporal (e.g. +# tspatial_extent_transfn(NULL, traj) == tspatial_to_stbox(traj)). +_FINALIZE_BOX_TGEO = """\ + auto boxStr = nautilus::invoke( + +[](const char* trajStr) -> char* + {{ + if (!trajStr || strlen(trajStr) == 0) {{ + free((void*)trajStr); + return (char*)nullptr; + }} + + MEOS::Meos::ensureMeosInitialized(); + std::lock_guard lock({mutex_name}); + + std::string trajString(trajStr); + void* temp = MEOS::Meos::parseTemporalPoint(trajString); + free((void*)trajStr); + if (!temp) {{ + return (char*)nullptr; + }} + + {extent_box_type}* aggBox = {extent_transfn}(nullptr, static_cast(temp)); + MEOS::Meos::freeTemporalObject(temp); + if (!aggBox) {{ + return (char*)nullptr; + }} + + char* boxText = {box_out_fn}(aggBox, 15); + free(aggBox); + return boxText; + }}, + trajectoryStr); + + const auto boxStrLen = nautilus::invoke( + +[](const char* s) -> size_t {{ return s ? strlen(s) : (size_t) 0; }}, + boxStr); + + auto variableSized = pipelineMemoryProvider.arena.allocateVariableSizedData(boxStrLen); + + nautilus::invoke( + +[](int8_t* dest, const char* s, size_t len) -> void + {{ + if (s) {{ + memcpy(dest, s, len); + free((void*)s); + }} + }}, + variableSized.getContent(), + boxStr, + boxStrLen); + + Nautilus::Record resultRecord; + resultRecord.write(resultFieldIdentifier, variableSized); + return resultRecord;""" + +# Finalize tail — TNUMBER scalar ({tnumber_in_fn} / sequenceStr / free(temp)). +_FINALIZE_SCALAR_TNUMBER = """\ + auto resultValue = nautilus::invoke( + +[](const char* seqStr) -> {return_cpp_type} + {{ + if (!seqStr || strlen(seqStr) == 0) {{ + free((void*)seqStr); + return ({return_cpp_type})0; + }} + + MEOS::Meos::ensureMeosInitialized(); + std::lock_guard lock({mutex_name}); + + Temporal* temp = {tnumber_in_fn}(seqStr); + if (!temp) {{ + free((void*)seqStr); + return ({return_cpp_type})0; + }} + + {return_cpp_type} value = {meos_scalar_fn}(temp); + + free(temp); + free((void*)seqStr); + return value; + }}, + sequenceStr); + + Nautilus::Record resultRecord; + resultRecord.write(resultFieldIdentifier, resultValue); + return resultRecord;""" + +# Finalize tail — TNUMBER box. +_FINALIZE_BOX_TNUMBER = """\ + auto boxStr = nautilus::invoke( + +[](const char* seqStr) -> char* + {{ + if (!seqStr || strlen(seqStr) == 0) {{ + free((void*)seqStr); + return (char*)nullptr; + }} + + MEOS::Meos::ensureMeosInitialized(); + std::lock_guard lock({mutex_name}); + + Temporal* temp = {tnumber_in_fn}(seqStr); + free((void*)seqStr); + if (!temp) {{ + return (char*)nullptr; + }} + + {extent_box_type}* aggBox = {extent_transfn}(nullptr, temp); + free(temp); + if (!aggBox) {{ + return (char*)nullptr; + }} + + char* boxText = {box_out_fn}(aggBox, 15); + free(aggBox); + return boxText; + }}, + sequenceStr); + + const auto boxStrLen = nautilus::invoke( + +[](const char* s) -> size_t {{ return s ? strlen(s) : (size_t) 0; }}, + boxStr); + + auto variableSized = pipelineMemoryProvider.arena.allocateVariableSizedData(boxStrLen); + + nautilus::invoke( + +[](int8_t* dest, const char* s, size_t len) -> void + {{ + if (s) {{ + memcpy(dest, s, len); + free((void*)s); + }} + }}, + variableSized.getContent(), + boxStr, + boxStrLen); + + Nautilus::Record resultRecord; + resultRecord.write(resultFieldIdentifier, variableSized); + return resultRecord;""" + + +def _swap_once(template, old, new, what): + """Replace exactly one occurrence of `old` with `new`, asserting the count + so a drifted scalar template fails at import rather than emitting bad C++.""" + n = template.count(old) + if n != 1: + raise AssertionError( + f"box-template derivation: expected exactly 1 occurrence of {what}, found {n}") + return template.replace(old, new) + + +PHYSICAL_CPP_TGEO_BOX = _swap_once( + _swap_once(PHYSICAL_CPP_TGEO, _EMPTY_SCALAR, _EMPTY_BOX, "tgeo empty-window block"), + _FINALIZE_SCALAR_TGEO, _FINALIZE_BOX_TGEO, "tgeo finalize tail") + +PHYSICAL_CPP_TNUMBER_BOX = _swap_once( + _swap_once(PHYSICAL_CPP_TNUMBER, _EMPTY_SCALAR, _EMPTY_BOX, "tnumber empty-window block"), + _FINALIZE_SCALAR_TNUMBER, _FINALIZE_BOX_TNUMBER, "tnumber finalize tail") + +# =========================================================================== +# WKB-trajectory output (return_mode "wkb"): materialize the windowed mini-trip +# as a SEQUENCE ([ ... ], linear interpolation — so trajectory functions like +# length are meaningful) and emit its hex-WKB. This is the value the MEOS +# function library composes over (the efficient materialize-once mechanism). +# Derived from the tgeo scalar template by swapping the empty-window write, the +# instant-set braces for sequence brackets, and the finalize. +# =========================================================================== +_FINALIZE_WKB_TGEO = """\ + auto boxStr = nautilus::invoke( + +[](const char* trajStr) -> char* + {{ + if (!trajStr || strlen(trajStr) == 0) {{ + free((void*)trajStr); + return (char*)nullptr; + }} + + MEOS::Meos::ensureMeosInitialized(); + std::lock_guard lock({mutex_name}); + + std::string trajString(trajStr); + void* temp = MEOS::Meos::parseTemporalPoint(trajString); + free((void*)trajStr); + if (!temp) {{ + return (char*)nullptr; + }} + + size_t hexSize = 0; + char* hexOut = temporal_as_hexwkb(static_cast(temp), 0, &hexSize); + MEOS::Meos::freeTemporalObject(temp); + return hexOut; + }}, + trajectoryStr); + + const auto boxStrLen = nautilus::invoke( + +[](const char* s) -> size_t {{ return s ? strlen(s) : (size_t) 0; }}, + boxStr); + + auto variableSized = pipelineMemoryProvider.arena.allocateVariableSizedData(boxStrLen); + + nautilus::invoke( + +[](int8_t* dest, const char* s, size_t len) -> void + {{ + if (s) {{ + memcpy(dest, s, len); + free((void*)s); + }} + }}, + variableSized.getContent(), + boxStr, + boxStrLen); + + Nautilus::Record resultRecord; + resultRecord.write(resultFieldIdentifier, variableSized); + return resultRecord;""" + +PHYSICAL_CPP_TGEO_WKB = _swap_once( + _swap_once( + _swap_once( + _swap_once(PHYSICAL_CPP_TGEO, _EMPTY_SCALAR, _EMPTY_BOX, "tgeo-wkb empty-window block"), + ' strcpy(buffer, "{{");', ' strcpy(buffer, "[");', "tgeo-wkb open bracket -> sequence"), + ' strcat(buffer, "}}");', ' strcat(buffer, "]");', "tgeo-wkb close bracket -> sequence"), + _FINALIZE_SCALAR_TGEO, _FINALIZE_WKB_TGEO, "tgeo-wkb finalize tail") + +# =========================================================================== +# Expandable-Temporal* aggregate (return_mode "expand"): the MEOS-native +# streaming model — the aggregate STATE is a live expandable `Temporal*` (a +# mini-trip trajectory), grown in place per event via the public streaming +# primitive `temporal_append_tinstant(..., expand=true)` (amortized-O(1), +# doubling). lower() applies the invariant MEOS scalar fn DIRECTLY to the live +# trajectory — no per-event string build, no parse-the-whole-window, no WKB. +# State is a `Temporal*` slot (sizeof(Temporal*)); public funcs only +# (tgeompoint_in / tsequence_make / temporal_append_tinstant / temporal_merge). +# =========================================================================== +PHYSICAL_CPP_TGEO_EXPAND = """\ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +extern "C" {{ +#include +#include +}} + +namespace NES +{{ + +static std::mutex {mutex_name}; + + +{nebula_name}AggregationPhysicalFunction::{nebula_name}AggregationPhysicalFunction( + DataType inputType, + DataType resultType, + PhysicalFunction lonFunctionParam, + PhysicalFunction latFunctionParam, + PhysicalFunction timestampFunctionParam, + Nautilus::Record::RecordFieldIdentifier resultFieldIdentifier, + std::shared_ptr bufferRef) + : AggregationPhysicalFunction(std::move(inputType), std::move(resultType), lonFunctionParam, std::move(resultFieldIdentifier)) + , bufferRef(std::move(bufferRef)) + , lonFunction(std::move(lonFunctionParam)) + , latFunction(std::move(latFunctionParam)) + , timestampFunction(std::move(timestampFunctionParam)) +{{ +}} + +void {nebula_name}AggregationPhysicalFunction::lift( + const nautilus::val& aggregationState, PipelineMemoryProvider& pipelineMemoryProvider, const Nautilus::Record& record) +{{ + auto lonValue = lonFunction.execute(record, pipelineMemoryProvider.arena); + auto latValue = latFunction.execute(record, pipelineMemoryProvider.arena); + auto timestampValue = timestampFunction.execute(record, pipelineMemoryProvider.arena); + + auto lon = lonValue.cast>(); + auto lat = latValue.cast>(); + auto timestamp = timestampValue.cast>(); + + nautilus::invoke( + +[](AggregationState* st, double lonVal, double latVal, int64_t tsVal) -> void + {{ + MEOS::Meos::ensureMeosInitialized(); + std::lock_guard lock({mutex_name}); + Temporal** slot = reinterpret_cast(st); + + long long sec = (tsVal > 1000000000000LL) ? (tsVal / 1000) : tsVal; + std::string ts = MEOS::Meos::convertSecondsToTimestamp(sec); + char wkt[120]; + snprintf(wkt, sizeof(wkt), "SRID=4326;Point(%.6f %.6f)@%s", lonVal, latVal, ts.c_str()); + + // Public instant constructor: a single-instant tgeompoint Temporal. + Temporal* instTemp = tgeompoint_in(wkt); + if (!instTemp) {{ + return; + }} + if (*slot == nullptr) {{ + // First event: a 1-instant sequence; subsequent appendInstant calls + // grow it in place (expand=true doubles maxcount when full). + TInstant* arr[1]; + arr[0] = (TInstant*) instTemp; + *slot = (Temporal*) tsequence_make((TInstant**) arr, 1, true, true, LINEAR, false); + }} else {{ + *slot = temporal_append_tinstant(*slot, (const TInstant*) instTemp, LINEAR, 0.0, nullptr, true); + }} + free(instTemp); // copied by tsequence_make / temporal_append_tinstant + }}, + aggregationState, + lon, + lat, + timestamp); +}} + +void {nebula_name}AggregationPhysicalFunction::combine( + const nautilus::val aggregationState1, + const nautilus::val aggregationState2, + PipelineMemoryProvider&) +{{ + nautilus::invoke( + +[](AggregationState* st1, AggregationState* st2) -> void + {{ + MEOS::Meos::ensureMeosInitialized(); + std::lock_guard lock({mutex_name}); + Temporal** s1 = reinterpret_cast(st1); + Temporal** s2 = reinterpret_cast(st2); + if (*s2 == nullptr) {{ + return; + }} + if (*s1 == nullptr) {{ + *s1 = *s2; + *s2 = nullptr; + return; + }} + // temporal_merge returns a fresh temporal (copies inputs, frees nothing). + Temporal* merged = temporal_merge(*s1, *s2); + free(*s1); + free(*s2); + *s2 = nullptr; + *s1 = merged; + }}, + aggregationState1, + aggregationState2); +}} + +Nautilus::Record {nebula_name}AggregationPhysicalFunction::lower( + const nautilus::val aggregationState, [[maybe_unused]] PipelineMemoryProvider& pipelineMemoryProvider) +{{ + MEOS::Meos::ensureMeosInitialized(); + + auto resultValue = nautilus::invoke( + +[](AggregationState* st) -> {return_cpp_type} + {{ + MEOS::Meos::ensureMeosInitialized(); + std::lock_guard lock({mutex_name}); + Temporal** slot = reinterpret_cast(st); + if (*slot == nullptr) {{ + return ({return_cpp_type})0; + }} + return {meos_scalar_fn}(*slot); + }}, + aggregationState); + + Nautilus::Record resultRecord; + resultRecord.write(resultFieldIdentifier, resultValue); + return resultRecord; +}} + +void {nebula_name}AggregationPhysicalFunction::reset(const nautilus::val aggregationState, PipelineMemoryProvider&) +{{ + nautilus::invoke( + +[](AggregationState* st) -> void + {{ + Temporal** slot = reinterpret_cast(st); + *slot = nullptr; + }}, + aggregationState); +}} + +size_t {nebula_name}AggregationPhysicalFunction::getSizeOfStateInBytes() const +{{ + return sizeof(Temporal*); +}} + +void {nebula_name}AggregationPhysicalFunction::cleanup(nautilus::val aggregationState) +{{ + nautilus::invoke( + +[](AggregationState* st) -> void + {{ + Temporal** slot = reinterpret_cast(st); + if (*slot != nullptr) {{ + free(*slot); + *slot = nullptr; + }} + }}, + aggregationState); +}} + + +AggregationPhysicalFunctionRegistryReturnType AggregationPhysicalFunctionGeneratedRegistrar::Register{nebula_name}AggregationPhysicalFunction( + AggregationPhysicalFunctionRegistryArguments) +{{ + throw std::runtime_error("{class_name_token} aggregation cannot be created through the registry. " + "It requires three field functions (longitude, latitude, timestamp)"); +}} + +}} // namespace NES +""" + +# =========================================================================== +# Scalar-fold box-output template (value/time Span extents). +# +# Reuses the tnumber (value, ts) HPP / ctor / lift / combine / reset / cleanup +# verbatim — only lower() differs. There is NO trajectory/sequence string and +# NO MEOS parse: the chosen scalar field is folded DIRECTLY through the MEOS +# extent transition fn (`float_extent_transfn`, `timestamptz_extent_transfn`, +# …), the Span state threading across events as an opaque pointer (NULL initial +# state -> first call allocates via span_make, later calls span_expand in place; +# one allocation total, freed after serialization via the external typed +# wrapper `floatspan_out` / `intspan_out` / `bigintspan_out` / `tstzspan_out`). +# =========================================================================== +PHYSICAL_CPP_SCALARFOLD = """\ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +extern "C" {{ +#include +}} + +namespace NES +{{ + +constexpr static std::string_view ValueFieldName = "value"; +constexpr static std::string_view TimestampFieldName = "timestamp"; + +static std::mutex {mutex_name}; + + +{nebula_name}AggregationPhysicalFunction::{nebula_name}AggregationPhysicalFunction( + DataType inputType, + DataType resultType, + PhysicalFunction valueFunctionParam, + PhysicalFunction timestampFunctionParam, + Nautilus::Record::RecordFieldIdentifier resultFieldIdentifier, + std::shared_ptr bufferRef) + : AggregationPhysicalFunction(std::move(inputType), std::move(resultType), valueFunctionParam, std::move(resultFieldIdentifier)) + , bufferRef(std::move(bufferRef)) + , valueFunction(std::move(valueFunctionParam)) + , timestampFunction(std::move(timestampFunctionParam)) +{{ +}} + +void {nebula_name}AggregationPhysicalFunction::lift( + const nautilus::val& aggregationState, PipelineMemoryProvider& pipelineMemoryProvider, const Nautilus::Record& record) +{{ + const auto pagedVectorPtr = static_cast>(aggregationState); + + auto valueValue = valueFunction.execute(record, pipelineMemoryProvider.arena); + auto timestampValue = timestampFunction.execute(record, pipelineMemoryProvider.arena); + + Record aggregateStateRecord({{ + {{std::string(ValueFieldName), valueValue}}, + {{std::string(TimestampFieldName), timestampValue}} + }}); + + const Nautilus::Interface::PagedVectorRef pagedVectorRef(pagedVectorPtr, bufferRef); + pagedVectorRef.writeRecord(aggregateStateRecord, pipelineMemoryProvider.bufferProvider); +}} + +void {nebula_name}AggregationPhysicalFunction::combine( + const nautilus::val aggregationState1, + const nautilus::val aggregationState2, + PipelineMemoryProvider&) +{{ + const auto memArea1 = static_cast>(aggregationState1); + const auto memArea2 = static_cast>(aggregationState2); + + nautilus::invoke( + +[](Nautilus::Interface::PagedVector* vector1, const Nautilus::Interface::PagedVector* vector2) -> void + {{ vector1->copyFrom(*vector2); }}, + memArea1, + memArea2); +}} + +Nautilus::Record {nebula_name}AggregationPhysicalFunction::lower( + const nautilus::val aggregationState, [[maybe_unused]] PipelineMemoryProvider& pipelineMemoryProvider) +{{ + MEOS::Meos::ensureMeosInitialized(); + + const auto pagedVectorPtr = static_cast>(aggregationState); + const Nautilus::Interface::PagedVectorRef pagedVectorRef(pagedVectorPtr, bufferRef); + const auto allFieldNames = bufferRef->getMemoryLayout()->getSchema().getFieldNames(); + const auto numberOfEntries = invoke( + +[](const Nautilus::Interface::PagedVector* pagedVector) + {{ + return pagedVector->getTotalNumberOfEntries(); + }}, + pagedVectorPtr); + + if (numberOfEntries == nautilus::val(0)) {{ + auto emptyVarSized = pipelineMemoryProvider.arena.allocateVariableSizedData(0); + Nautilus::Record resultRecord; + resultRecord.write(resultFieldIdentifier, emptyVarSized); + return resultRecord; + }} + + // Fold the windowed scalar field through the MEOS extent transition fn. + // The Span state threads across events as an opaque pointer; a NULL initial + // state makes the first call allocate, later calls expand in place. + auto spanState = nautilus::invoke( + +[](const Nautilus::Interface::PagedVector*) -> void* {{ return nullptr; }}, + pagedVectorPtr); + + const auto endIt = pagedVectorRef.end(allFieldNames); + for (auto candidateIt = pagedVectorRef.begin(allFieldNames); candidateIt != endIt; ++candidateIt) + {{ + const auto itemRecord = *candidateIt; + const auto valueRaw = itemRecord.read(std::string(ValueFieldName)); + auto value = valueRaw.cast>(); + + spanState = nautilus::invoke( + +[](void* state, {fold_field_cpp_type} val) -> void* + {{ + MEOS::Meos::ensureMeosInitialized(); + std::lock_guard lock({mutex_name}); + {fold_invoke_body} + }}, + spanState, + value); + }} + + auto boxStr = nautilus::invoke( + +[](void* state) -> char* + {{ + if (!state) {{ + return (char*)nullptr; + }} + MEOS::Meos::ensureMeosInitialized(); + std::lock_guard lock({mutex_name}); + Span* sp = static_cast(state); + char* out = {box_out_call}; + free(state); + return out; + }}, + spanState); + + const auto boxStrLen = nautilus::invoke( + +[](const char* s) -> size_t {{ return s ? strlen(s) : (size_t) 0; }}, + boxStr); + + auto variableSized = pipelineMemoryProvider.arena.allocateVariableSizedData(boxStrLen); + + nautilus::invoke( + +[](int8_t* dest, const char* s, size_t len) -> void + {{ + if (s) {{ + memcpy(dest, s, len); + free((void*)s); + }} + }}, + variableSized.getContent(), + boxStr, + boxStrLen); + + Nautilus::Record resultRecord; + resultRecord.write(resultFieldIdentifier, variableSized); + return resultRecord; +}} + +void {nebula_name}AggregationPhysicalFunction::reset(const nautilus::val aggregationState, PipelineMemoryProvider&) +{{ + nautilus::invoke( + +[](AggregationState* pagedVectorMemArea) -> void + {{ + auto* pagedVector = reinterpret_cast(pagedVectorMemArea); + new (pagedVector) Nautilus::Interface::PagedVector(); + }}, + aggregationState); +}} + +size_t {nebula_name}AggregationPhysicalFunction::getSizeOfStateInBytes() const +{{ + return sizeof(Nautilus::Interface::PagedVector); +}} + +void {nebula_name}AggregationPhysicalFunction::cleanup(nautilus::val aggregationState) +{{ + nautilus::invoke( + +[](AggregationState* pagedVectorMemArea) -> void + {{ + auto* pagedVector = reinterpret_cast(pagedVectorMemArea); + pagedVector->~PagedVector(); + }}, + aggregationState); +}} + + +AggregationPhysicalFunctionRegistryReturnType AggregationPhysicalFunctionGeneratedRegistrar::Register{nebula_name}AggregationPhysicalFunction( + AggregationPhysicalFunctionRegistryArguments) +{{ + throw std::runtime_error("{class_name_token} aggregation cannot be created through the registry. " + "It requires two field functions (value, timestamp)"); +}} + +}} // namespace NES +""" + +# =========================================================================== +# Set-collect aggregate template (windowed union -> Set). +# +# Same scalar-fold mechanism as PHYSICAL_CPP_SCALARFOLD, but the per-event +# `*_union_transfn` accumulates an unordered Set state (not a Span); the window +# is finalized with `set_union_finalfn` into the canonical Set before +# serialization through an external typed wrapper (floatset_out / intset_out / +# bigintset_out / tstzset_out). Derived from the scalar-fold template by an +# asserted swap of only the serialize lambda — the fold loop / lift / combine / +# reset / cleanup stay byte-identical. +# =========================================================================== +_SCALARFOLD_SERIALIZE_SPAN = """\ + auto boxStr = nautilus::invoke( + +[](void* state) -> char* + {{ + if (!state) {{ + return (char*)nullptr; + }} + MEOS::Meos::ensureMeosInitialized(); + std::lock_guard lock({mutex_name}); + Span* sp = static_cast(state); + char* out = {box_out_call}; + free(state); + return out; + }}, + spanState);""" + +_SCALARFOLD_SERIALIZE_SET = """\ + auto boxStr = nautilus::invoke( + +[](void* state) -> char* + {{ + if (!state) {{ + return (char*)nullptr; + }} + MEOS::Meos::ensureMeosInitialized(); + std::lock_guard lock({mutex_name}); + // set_union_finalfn pfree()s the state internally and returns a new + // Set, so the state must NOT be freed again here (double free). + Set* sp = {finalfn}(static_cast(state)); + if (!sp) {{ + return (char*)nullptr; + }} + char* out = {box_out_call}; + free(sp); + return out; + }}, + spanState);""" + +PHYSICAL_CPP_SETFOLD = _swap_once( + PHYSICAL_CPP_SCALARFOLD, _SCALARFOLD_SERIALIZE_SPAN, _SCALARFOLD_SERIALIZE_SET, + "scalarfold serialize -> setfold (finalfn)") + +# =========================================================================== +# Parser-glue templates: TWO dispatch sites in AntlrSQLQueryPlanCreator.cpp. +# Site 1 is the dedicated-token case-switch (~line 965 in mariana's tree). +# Site 2 is the IDENTIFIER fallback `else if (funcName == "TOKEN")` chain +# (~line 2062 in mariana's tree). +# =========================================================================== + +# Site 1 — case-switch dispatch. Two shapes (tgeo 3-arg, tnumber 2-arg). +CASE_SWITCH_TGEO = """\ + /* BEGIN CODEGEN AGGREGATION GLUE: {sql_token} (case-switch) */ + case AntlrSQLLexer::{sql_token}: + // {comment_one_liner} + if (helpers.top().functionBuilder.size() != 3) {{ + throw InvalidQuerySyntax("{sql_token} requires exactly three arguments (longitude, latitude, timestamp), but got {{}}", helpers.top().functionBuilder.size()); + }} + {{ + const auto timestampFunction = helpers.top().functionBuilder.back(); + helpers.top().functionBuilder.pop_back(); + const auto latitudeFunction = helpers.top().functionBuilder.back(); + helpers.top().functionBuilder.pop_back(); + const auto longitudeFunction = helpers.top().functionBuilder.back(); + helpers.top().functionBuilder.pop_back(); + + if (!longitudeFunction.tryGet() || + !latitudeFunction.tryGet() || + !timestampFunction.tryGet()) {{ + throw InvalidQuerySyntax("{sql_token} arguments must be field references"); + }} + + helpers.top().windowAggs.push_back( + {nebula_name}AggregationLogicalFunction::create(longitudeFunction.get(), + latitudeFunction.get(), + timestampFunction.get())); + helpers.top().functionBuilder.push_back(longitudeFunction); + }} + break; + /* END CODEGEN AGGREGATION GLUE: {sql_token} (case-switch) */ +""" + +CASE_SWITCH_TNUMBER = """\ + /* BEGIN CODEGEN AGGREGATION GLUE: {sql_token} (case-switch) */ + case AntlrSQLLexer::{sql_token}: + // {comment_one_liner} + if (helpers.top().functionBuilder.size() != 2) {{ + throw InvalidQuerySyntax("{sql_token} requires exactly two arguments (value, timestamp), but got {{}}", helpers.top().functionBuilder.size()); + }} + {{ + const auto timestampFunction = helpers.top().functionBuilder.back(); + helpers.top().functionBuilder.pop_back(); + const auto valueFunction = helpers.top().functionBuilder.back(); + helpers.top().functionBuilder.pop_back(); + + if (!valueFunction.tryGet() || + !timestampFunction.tryGet()) {{ + throw InvalidQuerySyntax("{sql_token} arguments must be field references"); + }} + + helpers.top().windowAggs.push_back( + {nebula_name}AggregationLogicalFunction::create(valueFunction.get(), + timestampFunction.get())); + helpers.top().functionBuilder.push_back(valueFunction); + }} + break; + /* END CODEGEN AGGREGATION GLUE: {sql_token} (case-switch) */ +""" + +# Site 2 — funcName == "TOKEN" string chain. +FUNCNAME_CHAIN_TGEO = """\ + /* BEGIN CODEGEN AGGREGATION GLUE: {sql_token} (funcName chain) */ + else if (funcName == "{sql_token}") + {{ + if (helpers.top().functionBuilder.size() < 3) + {{ + throw InvalidQuerySyntax("{sql_token} requires three arguments at {{}}", context->getText()); + }} + const auto ts = helpers.top().functionBuilder.back().get(); + helpers.top().functionBuilder.pop_back(); + const auto lat = helpers.top().functionBuilder.back().get(); + helpers.top().functionBuilder.pop_back(); + const auto lon = helpers.top().functionBuilder.back().get(); + helpers.top().functionBuilder.pop_back(); + helpers.top().windowAggs.push_back({nebula_name}AggregationLogicalFunction::create(lon, lat, ts)); + }} + /* END CODEGEN AGGREGATION GLUE: {sql_token} (funcName chain) */ +""" + +FUNCNAME_CHAIN_TNUMBER = """\ + /* BEGIN CODEGEN AGGREGATION GLUE: {sql_token} (funcName chain) */ + else if (funcName == "{sql_token}") + {{ + if (helpers.top().functionBuilder.size() < 2) + {{ + throw InvalidQuerySyntax("{sql_token} requires two arguments at {{}}", context->getText()); + }} + const auto ts = helpers.top().functionBuilder.back().get(); + helpers.top().functionBuilder.pop_back(); + const auto value = helpers.top().functionBuilder.back().get(); + helpers.top().functionBuilder.pop_back(); + helpers.top().windowAggs.push_back({nebula_name}AggregationLogicalFunction::create(value, ts)); + }} + /* END CODEGEN AGGREGATION GLUE: {sql_token} (funcName chain) */ +""" + +# Site 3 — optimizer logical→physical lowering rule. +OPTIMIZER_LOWERING_TGEO = """\ + /* BEGIN CODEGEN AGGREGATION GLUE: {class_name_token} (optimizer lowering) */ + if (name == std::string_view("{class_name_token}")) + {{ + auto specificDescriptor = std::dynamic_pointer_cast<{nebula_name}AggregationLogicalFunction>(descriptor); + INVARIANT(specificDescriptor != nullptr, "Expected {nebula_name}AggregationLogicalFunction for {class_name_token}"); + + auto lonPF = QueryCompilation::FunctionProvider::lowerFunction(specificDescriptor->getLonField()); + auto latPF = QueryCompilation::FunctionProvider::lowerFunction(specificDescriptor->getLatField()); + auto tsPF = QueryCompilation::FunctionProvider::lowerFunction(specificDescriptor->getTimestampField()); + + Schema stateSchema; + stateSchema.addField("lon", specificDescriptor->getLonField().getDataType()); + stateSchema.addField("lat", specificDescriptor->getLatField().getDataType()); + stateSchema.addField("timestamp", specificDescriptor->getTimestampField().getDataType()); + auto tupleBufferRef = Interface::BufferRef::TupleBufferRef::create(configuration.pageSize.getValue(), stateSchema); + + auto phys = std::make_shared<{nebula_name}AggregationPhysicalFunction>( + std::move(physicalInputType), + std::move(physicalFinalType), + lonPF, + latPF, + tsPF, + resultFieldIdentifier, + tupleBufferRef); + aggregationPhysicalFunctions.push_back(std::move(phys)); + continue; + }} + /* END CODEGEN AGGREGATION GLUE: {class_name_token} (optimizer lowering) */ +""" + +OPTIMIZER_LOWERING_TNUMBER = """\ + /* BEGIN CODEGEN AGGREGATION GLUE: {class_name_token} (optimizer lowering) */ + if (name == std::string_view("{class_name_token}")) + {{ + auto specificDescriptor = std::dynamic_pointer_cast<{nebula_name}AggregationLogicalFunction>(descriptor); + INVARIANT(specificDescriptor != nullptr, "Expected {nebula_name}AggregationLogicalFunction for {class_name_token}"); + + auto valuePF = QueryCompilation::FunctionProvider::lowerFunction(specificDescriptor->getValueField()); + auto tsPF = QueryCompilation::FunctionProvider::lowerFunction(specificDescriptor->getTimestampField()); + + Schema stateSchema; + stateSchema.addField("value", specificDescriptor->getValueField().getDataType()); + stateSchema.addField("timestamp", specificDescriptor->getTimestampField().getDataType()); + auto tupleBufferRef = Interface::BufferRef::TupleBufferRef::create(configuration.pageSize.getValue(), stateSchema); + + auto phys = std::make_shared<{nebula_name}AggregationPhysicalFunction>( + std::move(physicalInputType), + std::move(physicalFinalType), + valuePF, + tsPF, + resultFieldIdentifier, + tupleBufferRef); + aggregationPhysicalFunctions.push_back(std::move(phys)); + continue; + }} + /* END CODEGEN AGGREGATION GLUE: {class_name_token} (optimizer lowering) */ +""" + +# =========================================================================== +# Expandable-Temporal* VALUE-OUTPUT: f(live mini-trip) -> Temporal* result, +# serialized to hex-WKB as VARSIZED (the proven box-output VARSIZED tail). +# Derived from PHYSICAL_CPP_TGEO_EXPAND by swapping only the scalar lower() for +# the value-output one. Wires the Temporal-returning single-temporal transforms +# (tgeo_centroid, tpoint_azimuth, tgeompoint_to_tgeometry, …) as windowed +# aggregates over the expandable trajectory. +# =========================================================================== +_EXPAND_LOWER_SCALAR = """\ + auto resultValue = nautilus::invoke( + +[](AggregationState* st) -> {return_cpp_type} + {{ + MEOS::Meos::ensureMeosInitialized(); + std::lock_guard lock({mutex_name}); + Temporal** slot = reinterpret_cast(st); + if (*slot == nullptr) {{ + return ({return_cpp_type})0; + }} + return {meos_scalar_fn}(*slot); + }}, + aggregationState); + + Nautilus::Record resultRecord; + resultRecord.write(resultFieldIdentifier, resultValue); + return resultRecord;""" + +_EXPAND_LOWER_WKB = """\ + auto hexStr = nautilus::invoke( + +[](AggregationState* st) -> char* + {{ + MEOS::Meos::ensureMeosInitialized(); + std::lock_guard lock({mutex_name}); + Temporal** slot = reinterpret_cast(st); + if (*slot == nullptr) {{ + return (char*)nullptr; + }} + Temporal* res = {meos_scalar_fn}(*slot); + if (!res) {{ + return (char*)nullptr; + }} + size_t hexSize = 0; + char* hexOut = temporal_as_hexwkb(res, 0, &hexSize); + free(res); + return hexOut; + }}, + aggregationState); + + const auto hexLen = nautilus::invoke( + +[](const char* s) -> size_t {{ return s ? strlen(s) : (size_t) 0; }}, + hexStr); + + auto variableSized = pipelineMemoryProvider.arena.allocateVariableSizedData(hexLen); + + nautilus::invoke( + +[](int8_t* dest, const char* s, size_t len) -> void + {{ + if (s) {{ + memcpy(dest, s, len); + free((void*)s); + }} + }}, + variableSized.getContent(), + hexStr, + hexLen); + + Nautilus::Record resultRecord; + resultRecord.write(resultFieldIdentifier, variableSized); + return resultRecord;""" + +PHYSICAL_CPP_TGEO_EXPAND_WKB = _swap_once( + PHYSICAL_CPP_TGEO_EXPAND, _EXPAND_LOWER_SCALAR, _EXPAND_LOWER_WKB, + "expand scalar lower -> value-output (hex-WKB) lower") + +# geometry value-output: f(traj) returns a GSERIALIZED (start/end point, convex +# hull, time-weighted centroid of the windowed trajectory), serialized as +# canonical hex-EWKB via geo_out. Same Temporal* slot/lift/append; only the +# finalize differs from the temporal value-output (GSERIALIZED + geo_out, no +# hexSize out-param). +_EXPAND_LOWER_GEO_WKB = _swap_once( + _swap_once(_EXPAND_LOWER_WKB, + "Temporal* res = {meos_scalar_fn}(*slot);", + "GSERIALIZED* res = {meos_scalar_fn}(*slot);", + "value-output res type Temporal -> GSERIALIZED"), + "size_t hexSize = 0;\n char* hexOut = temporal_as_hexwkb(res, 0, &hexSize);", + "char* hexOut = geo_out(res);", + "temporal hex-WKB -> geometry hex-EWKB (geo_out)") + +PHYSICAL_CPP_TGEO_EXPAND_GEO_WKB = _swap_once( + PHYSICAL_CPP_TGEO_EXPAND, _EXPAND_LOWER_SCALAR, _EXPAND_LOWER_GEO_WKB, + "expand scalar lower -> geometry value-output (hex-EWKB) lower") + +# tnumber expandable value-output: same Temporal*-slot lower/reset/cleanup, but +# the per-event instant is a tfloat ("value@ts" via tfloat_in) and the ctor takes +# (value, ts). Derived from the tgeo expand-wkb template by swapping only the ctor +# and lift (the rest — Temporal* slot, appendInstant, value-output finalize — is +# input-shape-independent). +_EXPAND_CTOR_TGEO = """\ +{nebula_name}AggregationPhysicalFunction::{nebula_name}AggregationPhysicalFunction( + DataType inputType, + DataType resultType, + PhysicalFunction lonFunctionParam, + PhysicalFunction latFunctionParam, + PhysicalFunction timestampFunctionParam, + Nautilus::Record::RecordFieldIdentifier resultFieldIdentifier, + std::shared_ptr bufferRef) + : AggregationPhysicalFunction(std::move(inputType), std::move(resultType), lonFunctionParam, std::move(resultFieldIdentifier)) + , bufferRef(std::move(bufferRef)) + , lonFunction(std::move(lonFunctionParam)) + , latFunction(std::move(latFunctionParam)) + , timestampFunction(std::move(timestampFunctionParam)) +{{ +}}""" +_EXPAND_CTOR_TNUMBER = """\ +{nebula_name}AggregationPhysicalFunction::{nebula_name}AggregationPhysicalFunction( + DataType inputType, + DataType resultType, + PhysicalFunction valueFunctionParam, + PhysicalFunction timestampFunctionParam, + Nautilus::Record::RecordFieldIdentifier resultFieldIdentifier, + std::shared_ptr bufferRef) + : AggregationPhysicalFunction(std::move(inputType), std::move(resultType), valueFunctionParam, std::move(resultFieldIdentifier)) + , bufferRef(std::move(bufferRef)) + , valueFunction(std::move(valueFunctionParam)) + , timestampFunction(std::move(timestampFunctionParam)) +{{ +}}""" +_EXPAND_LIFT_TGEO = """\ + auto lonValue = lonFunction.execute(record, pipelineMemoryProvider.arena); + auto latValue = latFunction.execute(record, pipelineMemoryProvider.arena); + auto timestampValue = timestampFunction.execute(record, pipelineMemoryProvider.arena); + + auto lon = lonValue.cast>(); + auto lat = latValue.cast>(); + auto timestamp = timestampValue.cast>(); + + nautilus::invoke( + +[](AggregationState* st, double lonVal, double latVal, int64_t tsVal) -> void + {{ + MEOS::Meos::ensureMeosInitialized(); + std::lock_guard lock({mutex_name}); + Temporal** slot = reinterpret_cast(st); + + long long sec = (tsVal > 1000000000000LL) ? (tsVal / 1000) : tsVal; + std::string ts = MEOS::Meos::convertSecondsToTimestamp(sec); + char wkt[120]; + snprintf(wkt, sizeof(wkt), "SRID=4326;Point(%.6f %.6f)@%s", lonVal, latVal, ts.c_str()); + + // Public instant constructor: a single-instant tgeompoint Temporal. + Temporal* instTemp = tgeompoint_in(wkt); + if (!instTemp) {{ + return; + }} + if (*slot == nullptr) {{ + // First event: a 1-instant sequence; subsequent appendInstant calls + // grow it in place (expand=true doubles maxcount when full). + TInstant* arr[1]; + arr[0] = (TInstant*) instTemp; + *slot = (Temporal*) tsequence_make((TInstant**) arr, 1, true, true, LINEAR, false); + }} else {{ + *slot = temporal_append_tinstant(*slot, (const TInstant*) instTemp, LINEAR, 0.0, nullptr, true); + }} + free(instTemp); // copied by tsequence_make / temporal_append_tinstant + }}, + aggregationState, + lon, + lat, + timestamp);""" +_EXPAND_LIFT_TNUMBER = """\ + auto valueValue = valueFunction.execute(record, pipelineMemoryProvider.arena); + auto timestampValue = timestampFunction.execute(record, pipelineMemoryProvider.arena); + + auto value = valueValue.cast>(); + auto timestamp = timestampValue.cast>(); + + nautilus::invoke( + +[](AggregationState* st, double valueVal, int64_t tsVal) -> void + {{ + MEOS::Meos::ensureMeosInitialized(); + std::lock_guard lock({mutex_name}); + Temporal** slot = reinterpret_cast(st); + + long long sec = (tsVal > 1000000000000LL) ? (tsVal / 1000) : tsVal; + std::string ts = MEOS::Meos::convertSecondsToTimestamp(sec); + char wkt[80]; + snprintf(wkt, sizeof(wkt), "%.6f@%s", valueVal, ts.c_str()); + + // Public instant constructor: a single-instant tfloat Temporal. + Temporal* instTemp = tfloat_in(wkt); + if (!instTemp) {{ + return; + }} + if (*slot == nullptr) {{ + TInstant* arr[1]; + arr[0] = (TInstant*) instTemp; + *slot = (Temporal*) tsequence_make((TInstant**) arr, 1, true, true, LINEAR, false); + }} else {{ + *slot = temporal_append_tinstant(*slot, (const TInstant*) instTemp, LINEAR, 0.0, nullptr, true); + }} + free(instTemp); + }}, + aggregationState, + value, + timestamp);""" + +PHYSICAL_CPP_TNUMBER_EXPAND_WKB = _swap_once( + _swap_once(PHYSICAL_CPP_TGEO_EXPAND_WKB, _EXPAND_CTOR_TGEO, _EXPAND_CTOR_TNUMBER, "expand ctor tgeo->tnumber"), + _EXPAND_LIFT_TGEO, _EXPAND_LIFT_TNUMBER, "expand lift tgeo->tnumber") + +# tnpoint expandable value-output: reuses the 3-field tgeo HPP/parser/optimizer +# (the 3 args are rid, frac, ts); only the lift (NPoint instant via tnpoint_in) +# and the npoint include change. Wires tnpoint trajectory transforms over the +# windowed tnpoint mini-series. +_EXPAND_LIFT_TNPOINT = """\ + auto ridValue = lonFunction.execute(record, pipelineMemoryProvider.arena); + auto fracValue = latFunction.execute(record, pipelineMemoryProvider.arena); + auto timestampValue = timestampFunction.execute(record, pipelineMemoryProvider.arena); + + auto rid = ridValue.cast>(); + auto frac = fracValue.cast>(); + auto timestamp = timestampValue.cast>(); + + nautilus::invoke( + +[](AggregationState* st, int64_t ridVal, double fracVal, int64_t tsVal) -> void + {{ + MEOS::Meos::ensureMeosInitialized(); + std::lock_guard lock({mutex_name}); + Temporal** slot = reinterpret_cast(st); + + long long sec = (tsVal > 1000000000000LL) ? (tsVal / 1000) : tsVal; + std::string ts = MEOS::Meos::convertSecondsToTimestamp(sec); + char wkt[80]; + snprintf(wkt, sizeof(wkt), "NPoint(%lld,%.6f)@%s", (long long) ridVal, fracVal, ts.c_str()); + + Temporal* instTemp = tnpoint_in(wkt); + if (!instTemp) {{ + return; + }} + if (*slot == nullptr) {{ + TInstant* arr[1]; + arr[0] = (TInstant*) instTemp; + *slot = (Temporal*) tsequence_make((TInstant**) arr, 1, true, true, LINEAR, false); + }} else {{ + *slot = temporal_append_tinstant(*slot, (const TInstant*) instTemp, LINEAR, 0.0, nullptr, true); + }} + free(instTemp); + }}, + aggregationState, + rid, + frac, + timestamp);""" + +PHYSICAL_CPP_TNPOINT_EXPAND_WKB = _swap_once( + _swap_once(PHYSICAL_CPP_TGEO_EXPAND_WKB, _EXPAND_LIFT_TGEO, _EXPAND_LIFT_TNPOINT, "expand lift tgeo->tnpoint"), + "#include ", "#include \n#include ", "tnpoint include") + + +# =========================================================================== +# Shape dispatchers + emit_operator. +# =========================================================================== + +def physical_template_for(op): + box = op.get("return_mode") == "box" + if op["input_shape"] == "tgeo": + if op.get("return_mode") == "wkb": + return PHYSICAL_HPP_TGEO, PHYSICAL_CPP_TGEO_WKB + if op.get("return_mode") == "expand": + return PHYSICAL_HPP_TGEO, PHYSICAL_CPP_TGEO_EXPAND + if op.get("return_mode") == "expand_wkb": + return PHYSICAL_HPP_TGEO, PHYSICAL_CPP_TGEO_EXPAND_WKB + if op.get("return_mode") == "expand_geo_wkb": + return PHYSICAL_HPP_TGEO, PHYSICAL_CPP_TGEO_EXPAND_GEO_WKB + if op.get("return_mode") == "expand_wkb_tnpoint": + return PHYSICAL_HPP_TGEO, PHYSICAL_CPP_TNPOINT_EXPAND_WKB + return PHYSICAL_HPP_TGEO, (PHYSICAL_CPP_TGEO_BOX if box else PHYSICAL_CPP_TGEO) + if op["input_shape"] == "tnumber": + # Scalar-fold reuses the tnumber (value, ts) HPP but folds the field + # directly through the MEOS extent transition fn (no string / no parse); + # set-collect is the same shape with a Set state + a union finalfn. + if op.get("return_mode") == "expand_wkb": + return PHYSICAL_HPP_TNUMBER, PHYSICAL_CPP_TNUMBER_EXPAND_WKB + if op.get("fold") == "scalar": + return PHYSICAL_HPP_TNUMBER, PHYSICAL_CPP_SCALARFOLD + if op.get("fold") == "set": + return PHYSICAL_HPP_TNUMBER, PHYSICAL_CPP_SETFOLD + return PHYSICAL_HPP_TNUMBER, (PHYSICAL_CPP_TNUMBER_BOX if box else PHYSICAL_CPP_TNUMBER) + raise ValueError(f"unknown input_shape: {op['input_shape']}") + + +def logical_template_for(op): + if op["input_shape"] == "tgeo": + return LOGICAL_HPP_TGEO, LOGICAL_CPP_TGEO + if op["input_shape"] == "tnumber": + return LOGICAL_HPP_TNUMBER, LOGICAL_CPP_TNUMBER + raise ValueError(f"unknown input_shape: {op['input_shape']}") + + +def case_switch_template_for(op): + return CASE_SWITCH_TGEO if op["input_shape"] == "tgeo" else CASE_SWITCH_TNUMBER + + +def funcname_chain_template_for(op): + return FUNCNAME_CHAIN_TGEO if op["input_shape"] == "tgeo" else FUNCNAME_CHAIN_TNUMBER + + +def optimizer_lowering_template_for(op): + return OPTIMIZER_LOWERING_TGEO if op["input_shape"] == "tgeo" else OPTIMIZER_LOWERING_TNUMBER + + +def emit_operator(op, output_root: Path): + nebula_name = op["nebula_name"] + logical_hpp_tmpl, logical_cpp_tmpl = logical_template_for(op) + physical_hpp_tmpl, physical_cpp_tmpl = physical_template_for(op) + + # Common substitution dict. + fmt = { + "nebula_name": nebula_name, + "class_name_token": op["class_name_token"], + "sql_token": op["sql_token"], + "comment_one_liner": op["comment_one_liner"], + "meos_scalar_fn": op.get("meos_scalar_fn", ""), + "return_cpp_type": op.get("return_cpp_type", "double"), + "final_stamp_type": op["final_stamp_type"], + "mutex_name": f"meos_{nebula_name.lower()}_mutex", + # tnumber-only extras (harmless for tgeo since unused) + "lift_value_cpp_type": op.get("lift_value_cpp_type", "double"), + "value_printf_fmt": op.get("value_printf_fmt", "%.6f"), + "tnumber_in_fn": op.get("tnumber_in_fn", "tfloat_in"), + # box-output (VARSIZED extent) extras — only referenced by the *_BOX + # physical templates; harmless for scalar ops. + "extent_transfn": op.get("extent_transfn", ""), + "extent_box_type": op.get("extent_box_type", "STBox"), + "box_out_fn": op.get("box_out_fn", ""), + # scalar-fold / set-collect extras — referenced by the *FOLD templates. + "fold_field_cpp_type": op.get("fold_field_cpp_type", "double"), + "fold_invoke_body": op.get("fold_invoke_body", ""), + "box_out_call": op.get("box_out_call", ""), + "finalfn": op.get("finalfn", ""), + } + + # value_compute (point/tgeo finalize): either fold the windowed sequence + # directly with meos_scalar_fn, or — for the EXTENT shape — first reduce the + # sequence to its bounding box (tspatial_to_stbox / ...) and apply a box + # accessor/predicate to that windowed extent. In box-output mode the + # finalize is the serialized extent box itself (no value_compute). + box_build = op.get("extent_box_build_fn") + if op.get("return_mode") in ("box", "wkb"): + fmt["value_compute"] = "" + elif box_build: + box_t = op.get("extent_box_type", "STBox") + fmt["value_compute"] = ( + f'{box_t}* aggBox = {box_build}(static_cast(temp));\n' + f' {op["return_cpp_type"]} value = aggBox ? ' + f'{op["meos_scalar_fn"]}(aggBox) : ({op["return_cpp_type"]})0;\n' + f' if (aggBox) free(aggBox);') + else: + fmt["value_compute"] = ( + f'{op["return_cpp_type"]} value = ' + f'{op["meos_scalar_fn"]}(static_cast(temp));') + + paths = { + "logical_hpp": output_root / "nes-logical-operators/include/Operators/Windows/Aggregations/Meos" / f"{nebula_name}AggregationLogicalFunction.hpp", + "logical_cpp": output_root / "nes-logical-operators/src/Operators/Windows/Aggregations/Meos" / f"{nebula_name}AggregationLogicalFunction.cpp", + "physical_hpp": output_root / "nes-physical-operators/include/Aggregation/Function/Meos" / f"{nebula_name}AggregationPhysicalFunction.hpp", + "physical_cpp": output_root / "nes-physical-operators/src/Aggregation/Function/Meos" / f"{nebula_name}AggregationPhysicalFunction.cpp", + } + for p in paths.values(): + p.parent.mkdir(parents=True, exist_ok=True) + + paths["logical_hpp"].write_text(logical_hpp_tmpl.format(**fmt)) + paths["logical_cpp"].write_text(logical_cpp_tmpl.format(**fmt)) + paths["physical_hpp"].write_text(physical_hpp_tmpl.format(**fmt)) + paths["physical_cpp"].write_text(physical_cpp_tmpl.format(**fmt)) + sys.stderr.write(f" ✓ {nebula_name}: emitted 4 files\n") + + +# =========================================================================== +# Idempotent injectors. +# =========================================================================== + +def inject_cmake_entries(operators, output_root: Path) -> int: + """Append per-op `add_plugin(...)` entries to both layers' aggregation + CMakeLists. Idempotent: skips entries already present.""" + n_added = 0 + # Layer (logical | physical) → (CMakeLists path, plugin suffix) + layers = [ + ("logical", output_root / "nes-logical-operators/src/Operators/Windows/Aggregations/Meos/CMakeLists.txt", "Logical"), + ("physical", output_root / "nes-physical-operators/src/Aggregation/Function/Meos/CMakeLists.txt", "Physical"), + ] + for label, cml, suffix in layers: + if not cml.exists(): + sys.stderr.write(f" ! cmake-entries: {cml} not found, skipping {label}\n") + continue + body = cml.read_text() + new_lines = [] + for op in operators: + # Target name must NOT include "Aggregation" suffix — the registry codegen + # appends "Aggregation" itself, so a "...Aggregation" target + # would yield a double-Aggregation symbol. Mariana's convention is the + # target name = the SQL-side aggregation name (e.g. "TemporalLength"), + # NOT the C++ class basename. We follow that. + target_name = op["nebula_name"] + suffix_kind = "AggregationLogicalFunction" if label == "logical" else "AggregationPhysicalFunction" + registry_kind = "AggregationLogicalFunction" if label == "logical" else "AggregationPhysicalFunction" + cpp_basename = f"{op['nebula_name']}{suffix_kind}.cpp" + entry = ( + f"add_plugin({target_name} {registry_kind} " + f"nes-{label}-operators {cpp_basename})" + ) + # Match by basename to be tolerant of formatting drift + marker = f"add_plugin({target_name} {registry_kind}" + if marker in body: + continue + new_lines.append(entry) + if new_lines: + with cml.open("a") as f: + f.write("\n".join(new_lines) + "\n") + sys.stderr.write(f" ✓ cmake-entries ({label}): appended {len(new_lines)} entry(ies)\n") + n_added += len(new_lines) + return n_added + + +def inject_g4(operators, g4_path: Path) -> int: + """Inject lexer-token + functionName alternation entries into AntlrSQL.g4.""" + if not g4_path.exists(): + sys.stderr.write(f" ! g4: {g4_path} not found, skipping\n") + return 0 + body = g4_path.read_text() + n_added = 0 + + new_tokens = [] + for op in operators: + tok = op["sql_token"] + if re.search(rf"^{re.escape(tok)}\s*:", body, re.MULTILINE): + continue + new_tokens.append(f"{tok}: '{tok}' | '{tok.lower()}';") + if new_tokens: + if "/* BEGIN CODEGEN AGGREGATION LEXER TOKENS */" in body: + body = re.sub( + r"(/\* BEGIN CODEGEN AGGREGATION LEXER TOKENS \*/\n)(.*?)(/\* END CODEGEN AGGREGATION LEXER TOKENS \*/)", + lambda mm: mm.group(1) + mm.group(2) + "\n".join(new_tokens) + "\n" + mm.group(3), + body, count=1, flags=re.DOTALL, + ) + else: + anchor_re = re.compile(r"^WATERMARK:.*$", re.MULTILINE) + m = anchor_re.search(body) + if m is None: + sys.stderr.write(f" ! g4: WATERMARK anchor not found\n") + else: + insertion = ( + "/* BEGIN CODEGEN AGGREGATION LEXER TOKENS */\n" + + "\n".join(new_tokens) + + "\n/* END CODEGEN AGGREGATION LEXER TOKENS */\n" + ) + body = body[: m.start()] + insertion + body[m.start():] + n_added += len(new_tokens) + sys.stderr.write(f" ✓ g4 lexer-tokens: added {len(new_tokens)} token(s)\n") + + # functionName alternation + fn_re = re.compile(r"^functionName:\s*([^;]+);", re.MULTILINE) + m = fn_re.search(body) + if m is None: + sys.stderr.write(f" ! g4: functionName production not found\n") + else: + alternation = m.group(1) + new_alts = [] + for op in operators: + tok = op["sql_token"] + if re.search(rf"\b{re.escape(tok)}\b", alternation): + continue + new_alts.append(tok) + if new_alts: + new_alt_text = alternation.rstrip() + " | " + " | ".join(new_alts) + body = body[: m.start()] + f"functionName: {new_alt_text};" + body[m.end():] + sys.stderr.write(f" ✓ g4 functionName: added {len(new_alts)} alternative(s)\n") + + g4_path.write_text(body) + return n_added + + +def inject_parser_cpp(operators, cpp_path: Path) -> int: + """Inject TWO dispatch sites + per-op #include.""" + if not cpp_path.exists(): + sys.stderr.write(f" ! parser-cpp: {cpp_path} not found, skipping\n") + return 0 + body = cpp_path.read_text() + n_added = 0 + + # 1) #includes — insert after the LAST `#include ` line. + new_includes = [] + for op in operators: + inc = f"#include " + if inc in body: + continue + new_includes.append(inc) + if new_includes: + agg_inc_re = re.compile(r"(^#include ]+>\s*\n)+", re.MULTILINE) + matches = list(agg_inc_re.finditer(body)) + if matches: + last = matches[-1] + body = body[: last.end()] + "\n".join(new_includes) + "\n" + body[last.end():] + sys.stderr.write(f" ✓ parser-cpp aggregation includes: added {len(new_includes)}\n") + else: + # Fall back: insert after any Meos include + meos_inc_re = re.compile(r"(^#include ]+>\s*\n)+", re.MULTILINE) + matches = list(meos_inc_re.finditer(body)) + if matches: + last = matches[-1] + body = body[: last.end()] + "\n".join(new_includes) + "\n" + body[last.end():] + sys.stderr.write(f" ✓ parser-cpp aggregation includes (fallback): added {len(new_includes)}\n") + else: + sys.stderr.write(f" ! parser-cpp: no Meos include anchor found\n") + + # 2) Case-switch dispatch — insert after the last `END CODEGEN AGGREGATION GLUE: ... (case-switch)` + # marker, else before the `default:` of the switch that contains TGEO_AT_STBOX. + new_case_blocks = [] + for op in operators: + tmpl = case_switch_template_for(op) + marker = f"/* BEGIN CODEGEN AGGREGATION GLUE: {op['sql_token']} (case-switch) */" + if marker in body: + continue + # Skip if pre-existing hand-written case + if re.search(rf"case\s+AntlrSQLLexer::{re.escape(op['sql_token'])}\s*:", body): + sys.stderr.write( + f" ! parser-cpp: pre-existing case for {op['sql_token']} (case-switch); skipping\n" + ) + continue + new_case_blocks.append(tmpl.format( + sql_token=op["sql_token"], nebula_name=op["nebula_name"], comment_one_liner=op["comment_one_liner"], + )) + if new_case_blocks: + # Anchor preference order: + # 1. last `END CODEGEN AGGREGATION GLUE: ... (case-switch)` (own marker) + # 2. last `END CODEGEN PARSER GLUE: ...` (codegen_nebula.py W4.5+) + # 3. TGEO_AT_STBOX → default: (pre-W4.5 layout) + last_end_agg = list(re.finditer(r"/\* END CODEGEN AGGREGATION GLUE: [^*]+\(case-switch\)\s*\*/", body)) + last_end_nebula = list(re.finditer(r"/\* END CODEGEN PARSER GLUE: [^*]+\*/", body)) + if last_end_agg: + insert_at = last_end_agg[-1].end() + body = body[:insert_at] + "\n" + "\n".join(new_case_blocks) + body[insert_at:] + sys.stderr.write(f" ✓ parser-cpp case-switch: added {len(new_case_blocks)} (after own marker)\n") + elif last_end_nebula: + insert_at = last_end_nebula[-1].end() + body = body[:insert_at] + "\n" + "\n".join(new_case_blocks) + body[insert_at:] + sys.stderr.write(f" ✓ parser-cpp case-switch: added {len(new_case_blocks)} (after codegen_nebula marker)\n") + else: + anchor_re = re.compile(r"(case AntlrSQLLexer::TGEO_AT_STBOX:[\s\S]+?\n\s*break;\n)(\s*default:)") + m = anchor_re.search(body) + if m is None: + sys.stderr.write(f" ! parser-cpp: no case-switch anchor found\n") + else: + insertion = m.group(1) + "\n" + "\n".join(new_case_blocks) + "\n" + m.group(2) + body = body[: m.start()] + insertion + body[m.end():] + sys.stderr.write(f" ✓ parser-cpp case-switch: added {len(new_case_blocks)} (before default:)\n") + n_added += len(new_case_blocks) + + # 3) funcName-chain dispatch — insert after the last `END CODEGEN AGGREGATION GLUE: ... (funcName chain)`, + # else after mariana's CrossDistance else-if block. + new_chain_blocks = [] + for op in operators: + tmpl = funcname_chain_template_for(op) + marker = f"/* BEGIN CODEGEN AGGREGATION GLUE: {op['sql_token']} (funcName chain) */" + if marker in body: + continue + if re.search(rf'funcName == "{re.escape(op["sql_token"])}"', body): + sys.stderr.write( + f" ! parser-cpp: pre-existing funcName chain for {op['sql_token']}; skipping\n" + ) + continue + new_chain_blocks.append(tmpl.format(sql_token=op["sql_token"], nebula_name=op["nebula_name"])) + if new_chain_blocks: + last_end_re = re.compile(r"/\* END CODEGEN AGGREGATION GLUE: [^*]+\(funcName chain\)\s*\*/") + ends = list(last_end_re.finditer(body)) + if ends: + insert_at = ends[-1].end() + body = body[:insert_at] + "\n" + "\n".join(new_chain_blocks) + body[insert_at:] + sys.stderr.write(f" ✓ parser-cpp funcName chain: added {len(new_chain_blocks)} (after marker)\n") + else: + anchor_re = re.compile( + r'(else if \(funcName == "CROSS_DISTANCE"\)[\s\S]+?\n\s*\}\n)', + ) + m = anchor_re.search(body) + if m is None: + sys.stderr.write(f" ! parser-cpp: no funcName chain anchor (after CROSS_DISTANCE) found\n") + else: + insertion = m.group(1) + "\n".join(new_chain_blocks) + body = body[: m.end()] + "\n".join(new_chain_blocks) + body[m.end():] + sys.stderr.write(f" ✓ parser-cpp funcName chain: added {len(new_chain_blocks)} (after CROSS_DISTANCE)\n") + n_added += len(new_chain_blocks) + + cpp_path.write_text(body) + return n_added + + +def inject_optimizer(operators, opt_path: Path) -> int: + """Inject `if (name == "...")` blocks into LowerToPhysicalWindowedAggregation.cpp.""" + if not opt_path.exists(): + sys.stderr.write(f" ! optimizer: {opt_path} not found, skipping\n") + return 0 + body = opt_path.read_text() + n_added = 0 + + # 1) #include for the physical class header + new_includes = [] + for op in operators: + inc = f"#include " + if inc in body: + continue + new_includes.append(inc) + # Also need the logical class header + new_logical_includes = [] + for op in operators: + inc = f"#include " + if inc in body: + continue + new_logical_includes.append(inc) + if new_includes or new_logical_includes: + agg_inc_re = re.compile(r"(^#include ]+>\s*\n)+", re.MULTILINE) + matches = list(agg_inc_re.finditer(body)) + if matches: + last = matches[-1] + inserts = [] + if new_includes: + inserts.extend(new_includes) + if new_logical_includes: + inserts.extend(new_logical_includes) + body = body[: last.end()] + "\n".join(inserts) + "\n" + body[last.end():] + sys.stderr.write(f" ✓ optimizer includes: added {len(new_includes)} phys + {len(new_logical_includes)} logical\n") + else: + sys.stderr.write(f" ! optimizer: no Aggregation/Function/Meos include anchor found\n") + + # 2) The if-name-match block. Insert after last codegen END marker, else after mariana's CrossDistance block. + new_blocks = [] + for op in operators: + tmpl = optimizer_lowering_template_for(op) + marker = f"/* BEGIN CODEGEN AGGREGATION GLUE: {op['class_name_token']} (optimizer lowering) */" + if marker in body: + continue + # Skip if a pre-existing hand-written block exists for this class_name_token + if re.search(rf'name == std::string_view\("{re.escape(op["class_name_token"])}"\)', body): + sys.stderr.write( + f" ! optimizer: pre-existing lowering block for {op['class_name_token']}; skipping\n" + ) + continue + new_blocks.append(tmpl.format(class_name_token=op["class_name_token"], nebula_name=op["nebula_name"])) + if new_blocks: + last_end_re = re.compile(r"/\* END CODEGEN AGGREGATION GLUE: [^*]+\(optimizer lowering\)\s*\*/") + ends = list(last_end_re.finditer(body)) + if ends: + insert_at = ends[-1].end() + body = body[:insert_at] + "\n" + "\n".join(new_blocks) + body[insert_at:] + sys.stderr.write(f" ✓ optimizer lowering: added {len(new_blocks)} (after marker)\n") + else: + # Anchor: insert just before the "Default path: use registry" comment. + anchor_re = re.compile(r"(\n\s*// Default path: use registry)") + m = anchor_re.search(body) + if m is None: + sys.stderr.write(f" ! optimizer: 'Default path' anchor not found\n") + else: + insertion = "\n" + "\n".join(new_blocks) + m.group(1) + body = body[: m.start()] + insertion + body[m.end():] + sys.stderr.write(f" ✓ optimizer lowering: added {len(new_blocks)} (before Default path)\n") + n_added += len(new_blocks) + + opt_path.write_text(body) + return n_added + + +def main(): + parser = argparse.ArgumentParser() + parser.add_argument("--input", required=True) + parser.add_argument("--output-root", required=True) + parser.add_argument("--no-parser-glue", action="store_true") + parser.add_argument("--no-cmake-entries", action="store_true") + parser.add_argument("--no-optimizer-glue", action="store_true") + args = parser.parse_args() + + with open(args.input) as f: + config = json.load(f) + operators = config["operators"] + + # The serialized aggregation type (NAME), the optimizer-lowering match, and + # the registry key must be the same string for the query plan to round-trip + # (serialize set_type(NAME) -> worker create(type) -> registry key). The + # registry key is the add_plugin target = nebula_name (PascalCase), so + # class_name_token (which drives NAME + the optimizer match) MUST equal + # nebula_name. Earlier specs set it to the SQL token (UPPER_SNAKE), which + # made create(type) miss the registry and throw UnknownLogicalOperator at + # deserialize. The SQL spelling lives in sql_token (lexer/parser); it never + # belongs in NAME. Normalize here so a stray spec value cannot reintroduce + # the mismatch. + for op in operators: + op["class_name_token"] = op["nebula_name"] + + output_root = Path(args.output_root).resolve() + if not (output_root / "nes-logical-operators").exists(): + sys.exit(f"ERROR: {output_root} does not look like MobilityNebula root") + + sys.stderr.write(f"Emitting {len(operators)} aggregation operator(s):\n\n") + for op in operators: + emit_operator(op, output_root) + + if not args.no_cmake_entries: + sys.stderr.write("\nCMakeLists.txt:\n") + inject_cmake_entries(operators, output_root) + + if not args.no_parser_glue: + sys.stderr.write("\nParser glue:\n") + inject_g4(operators, output_root / "nes-sql-parser/AntlrSQL.g4") + inject_parser_cpp(operators, output_root / "nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp") + + if not args.no_optimizer_glue: + sys.stderr.write("\nOptimizer lowering glue:\n") + inject_optimizer(operators, output_root / "nes-query-optimizer/src/RewriteRules/LowerToPhysical/LowerToPhysicalWindowedAggregation.cpp") + + sys.stderr.write(f"\nDone. {len(operators) * 4} files emitted.\n") + + +if __name__ == "__main__": + main() diff --git a/tools/codegen/codegen_input.example.json b/tools/codegen/codegen_input.example.json new file mode 100644 index 0000000000..cbfd0ed15e --- /dev/null +++ b/tools/codegen/codegen_input.example.json @@ -0,0 +1,160 @@ +{ + "_comment": "Example input for codegen_nebula.py \u2014 first wave of MEOS spatial-relation E/A predicates. Each operator descriptor produces one logical .hpp/.cpp + one physical .hpp/.cpp file. Adjust the list to control which functions get generated.", + "operators": [ + { + "nebula_name": "TemporalEDisjointGeometry", + "sql_token": "TEMPORAL_EDISJOINT_GEOMETRY", + "meos_call": "edisjoint_tgeo_geo", + "args": [ + { + "name": "lon", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "lat", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "timestamp", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "geometry", + "nautilus_type": "VariableSizedData", + "cpp_type": "const char*" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_temporal_point": true, + "comment_one_liner": "Per-event ever-disjoint between a single-instant tgeompoint built from event fields and a static geometry." + }, + { + "nebula_name": "TemporalATouchesGeometry", + "sql_token": "TEMPORAL_ATOUCHES_GEOMETRY", + "meos_call": "atouches_tgeo_geo", + "args": [ + { + "name": "lon", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "lat", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "timestamp", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "geometry", + "nautilus_type": "VariableSizedData", + "cpp_type": "const char*" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_temporal_point": true, + "comment_one_liner": "Per-event always-touches between a single-instant tgeompoint and a static geometry." + }, + { + "nebula_name": "TemporalECoversGeometry", + "sql_token": "TEMPORAL_ECOVERS_GEOMETRY", + "meos_call": "ecovers_tgeo_geo", + "args": [ + { + "name": "lon", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "lat", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "timestamp", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "geometry", + "nautilus_type": "VariableSizedData", + "cpp_type": "const char*" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_temporal_point": true, + "comment_one_liner": "Per-event ever-covers between a single-instant tgeompoint and a static geometry." + }, + { + "nebula_name": "TemporalAContainsGeometry", + "sql_token": "TEMPORAL_ACONTAINS_GEOMETRY", + "meos_call": "acontains_tgeo_geo", + "args": [ + { + "name": "lon", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "lat", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "timestamp", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "geometry", + "nautilus_type": "VariableSizedData", + "cpp_type": "const char*" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_temporal_point": true, + "comment_one_liner": "Per-event always-contains between a single-instant tgeompoint and a static geometry." + }, + { + "nebula_name": "TemporalETouchesGeometry", + "sql_token": "TEMPORAL_ETOUCHES_GEOMETRY", + "meos_call": "etouches_tgeo_geo", + "args": [ + { + "name": "lon", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "lat", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "timestamp", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "geometry", + "nautilus_type": "VariableSizedData", + "cpp_type": "const char*" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_temporal_point": true, + "comment_one_liner": "Per-event ever-touches between a single-instant tgeompoint and a static geometry." + } + ] +} diff --git a/tools/codegen/codegen_nebula.py b/tools/codegen/codegen_nebula.py new file mode 100644 index 0000000000..2f7218f21c --- /dev/null +++ b/tools/codegen/codegen_nebula.py @@ -0,0 +1,5761 @@ +#!/usr/bin/env python3 +"""MobilityNebula MEOS-operator generator. + +Given a JSON descriptor list of MEOS scalar functions to wrap as +NebulaStream operators, emits the 4 pipeline-layer C++ files per +function (logical .hpp/.cpp + physical .hpp/.cpp) following the +established style of the existing hand-written operators (e.g. +TemporalEDWithinGeometryLogicalFunction), AND auto-injects: + +- per-op CMakeLists.txt entries in nes-{logical,physical}-operators/ + src/Functions/Meos/ +- AntlrSQL.g4 lexer-token + functionName-alternation entries +- AntlrSQLQueryPlanCreator.cpp #include + dispatch-case block + +Injection is idempotent — markers like +`/* BEGIN CODEGEN PARSER GLUE: */ … /* END CODEGEN PARSER GLUE */` +gate each per-op block, and the script skips on re-run when the marker +is already present. + +Usage: + python3 codegen_nebula.py --input codegen_input.example.json \\ + --output-root /path/to/MobilityNebula \\ + [--no-parser-glue] # skip .g4 + parser .cpp + [--no-cmake-entries] # skip CMakeLists.txt +""" +import argparse +import json +import re +import sys +from pathlib import Path + +# =========================================================================== +# Templates (mirror the hand-written TemporalEDWithinGeometry style 1:1). +# =========================================================================== + +LOGICAL_HPP_TEMPLATE = """\ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES {{ + +/** + * @brief {comment_one_liner} + * + * Generated by tools/codegen/codegen_nebula.py from the MEOS function + * `{meos_call}`. Per-event scalar operator following the + * TemporalEDWithinGeometry pattern. + */ +class {nebula_name}LogicalFunction : public LogicalFunctionConcept {{ +public: + static constexpr std::string_view NAME = "{nebula_name}"; + + {nebula_name}LogicalFunction({ctor_logical_args}); + + DataType getDataType() const override; + LogicalFunction withDataType(const DataType& dataType) const override; + std::vector getChildren() const override; + LogicalFunction withChildren(const std::vector& children) const override; + std::string_view getType() const override; + bool operator==(const LogicalFunctionConcept& rhs) const override; + std::string explain(ExplainVerbosity verbosity) const override; + LogicalFunction withInferredDataType(const Schema& schema) const override; + SerializableFunction serialize() const override; + +private: + DataType dataType; + std::vector parameters; +}}; + +}} // namespace NES +""" + +LOGICAL_CPP_TEMPLATE = """\ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace NES +{{ + +{nebula_name}LogicalFunction::{nebula_name}LogicalFunction({ctor_logical_args}) + : dataType(DataTypeProvider::provideDataType(DataType::Type::{nautilus_return})) +{{ + parameters.reserve({n_args}); +{ctor_logical_pushes} +}} + +DataType {nebula_name}LogicalFunction::getDataType() const +{{ + return dataType; +}} + +LogicalFunction {nebula_name}LogicalFunction::withDataType(const DataType& newDataType) const +{{ + auto copy = *this; + copy.dataType = newDataType; + return copy; +}} + +std::vector {nebula_name}LogicalFunction::getChildren() const +{{ + return parameters; +}} + +LogicalFunction {nebula_name}LogicalFunction::withChildren(const std::vector& children) const +{{ + PRECONDITION(children.size() == {n_args}, "{nebula_name}LogicalFunction requires {n_args} children, but got {{}}", children.size()); + auto copy = *this; + copy.parameters = children; + return copy; +}} + +std::string_view {nebula_name}LogicalFunction::getType() const +{{ + return NAME; +}} + +bool {nebula_name}LogicalFunction::operator==(const LogicalFunctionConcept& rhs) const +{{ + if (const auto* other = dynamic_cast(&rhs)) + {{ + return parameters == other->parameters; + }} + return false; +}} + +std::string {nebula_name}LogicalFunction::explain(ExplainVerbosity verbosity) const +{{ + std::string args; + for (size_t index = 0; index < parameters.size(); ++index) + {{ + if (index > 0) + {{ + args += ", "; + }} + args += parameters[index].explain(verbosity); + }} + return fmt::format("{{}}({{}})", NAME, args); +}} + +LogicalFunction {nebula_name}LogicalFunction::withInferredDataType(const Schema& schema) const +{{ + std::vector newChildren; + newChildren.reserve(parameters.size()); + for (const auto& child : parameters) + {{ + newChildren.emplace_back(child.withInferredDataType(schema)); + }} + return withChildren(newChildren); +}} + +SerializableFunction {nebula_name}LogicalFunction::serialize() const +{{ + SerializableFunction proto; + proto.set_function_type(std::string(NAME)); + DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type()); + for (const auto& child : parameters) + {{ + proto.add_children()->CopyFrom(child.serialize()); + }} + return proto; +}} + +LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::Register{nebula_name}LogicalFunction( + LogicalFunctionRegistryArguments arguments) +{{ + PRECONDITION(arguments.children.size() == {n_args}, + "{nebula_name}LogicalFunction requires {n_args} children but got {{}}", + arguments.children.size()); +{registrar_pushes} +}} + +}} // namespace NES +""" + +PHYSICAL_HPP_TEMPLATE = """\ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#pragma once + +#include +#include +#include +#include + +namespace NES {{ + +/** + * @brief Physical operator for `{meos_call}`. + * + * {comment_one_liner} + * + * Generated by tools/codegen/codegen_nebula.py. + */ +class {nebula_name}PhysicalFunction : public PhysicalFunctionConcept {{ +public: + {nebula_name}PhysicalFunction({ctor_physical_args}); + + VarVal execute(const Record& record, ArenaRef& arena) const override; + +private: + std::vector parameterFunctions; +}}; + +}} // namespace NES +""" + +# Physical .cpp template; the `body` placeholder is the MEOS-call body +# (the heart of the operator). For `build_temporal_point` operators +# we emit a per-event temporal-point build + MEOS call, mirroring +# TemporalEDWithinGeometry; for non-temporal-point operators (future +# templates) the body shape differs and a separate template branch +# would be added here. +PHYSICAL_CPP_TEMPLATE_TEMPORAL_POINT = """\ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" {{ +#include +#include +}} + +namespace NES {{ + +{nebula_name}PhysicalFunction::{nebula_name}PhysicalFunction({ctor_physical_args}) +{{ + parameterFunctions.reserve({n_args}); +{ctor_physical_pushes} +}} + +VarVal {nebula_name}PhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + {{ + parameterValues.emplace_back(function.execute(record, arena)); + }} + + auto lon = parameterValues[0].cast>(); + auto lat = parameterValues[1].cast>(); + auto timestamp = parameterValues[2].cast>(); + auto geometry = parameterValues[3].cast(); + + const auto result = nautilus::invoke( + +[](double lonValue, + double latValue, + uint64_t timestampValue, + const char* geometryPtr, + uint32_t geometrySize) -> {return_type} {{ + try + {{ + MEOS::Meos::ensureMeosInitialized(); + if (!(lonValue >= -180.0 && lonValue <= 180.0 && latValue >= -90.0 && latValue <= 90.0)) {{ + return 0; + }} + + const std::string timestampString = MEOS::Meos::convertEpochToTimestamp(timestampValue); + std::string temporalGeometryWkt = fmt::format("SRID=4326;Point({{}} {{}})@{{}}", lonValue, latValue, timestampString); + std::string staticGeometryWkt(geometryPtr, geometrySize); + + while (!staticGeometryWkt.empty() && (staticGeometryWkt.front() == '\\'' || staticGeometryWkt.front() == '"')) + staticGeometryWkt.erase(staticGeometryWkt.begin()); + while (!staticGeometryWkt.empty() && (staticGeometryWkt.back() == '\\'' || staticGeometryWkt.back() == '"')) + staticGeometryWkt.pop_back(); + + if (temporalGeometryWkt.empty() || staticGeometryWkt.empty()) + return 0; + + MEOS::Meos::TemporalGeometry temporalGeometry(temporalGeometryWkt); + if (!temporalGeometry.getGeometry()) return 0; + MEOS::Meos::StaticGeometry staticGeometry(staticGeometryWkt); + if (!staticGeometry.getGeometry()) return 0; + + // MEOS spatial-relation call — same shape as TemporalEDWithin's + // edwithin_tgeo_geo, but specific MEOS function per generated operator. + // Real MEOS spatial-rel signature: int fn(const Temporal *, const GSERIALIZED *) + // (no `atstart` flag — that's specific to geog_dwithin / edwithin's 3-arg variant). + return {meos_call}(temporalGeometry.getGeometry(), + staticGeometry.getGeometry()); + }} + catch (const std::exception&) + {{ + return 0; + }} + }}, + lon, lat, timestamp, geometry.getContent(), geometry.getContentSize()); + + return VarVal(result); +}} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::Register{nebula_name}PhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{{ + PRECONDITION(arguments.childFunctions.size() == {n_args}, + "{nebula_name}PhysicalFunction requires {n_args} children but got {{}}", + arguments.childFunctions.size()); +{registrar_pushes} +}} + +}} // namespace NES +""" + +# Physical .cpp template for two-temporal-points operators (e.g. *_tgeo_tgeo +# spatial-relations). Two single-instant tgeompoints are built from event +# fields (lonA/latA/tsA + lonB/latB/tsB) and passed to a MEOS function whose +# C signature is `int fn(const Temporal*, const Temporal*)`. Mirrors the +# one-temporal-point template above; the bodies differ only in arg shape +# and in the absence of a static-geometry argument. +PHYSICAL_CPP_TEMPLATE_TWO_TEMPORAL_POINTS = """\ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" {{ +#include +#include +}} + +namespace NES {{ + +{nebula_name}PhysicalFunction::{nebula_name}PhysicalFunction({ctor_physical_args}) +{{ + parameterFunctions.reserve({n_args}); +{ctor_physical_pushes} +}} + +VarVal {nebula_name}PhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + {{ + parameterValues.emplace_back(function.execute(record, arena)); + }} + + auto lonA = parameterValues[0].cast>(); + auto latA = parameterValues[1].cast>(); + auto tsA = parameterValues[2].cast>(); + auto lonB = parameterValues[3].cast>(); + auto latB = parameterValues[4].cast>(); + auto tsB = parameterValues[5].cast>(); + + const auto result = nautilus::invoke( + +[](double lonAValue, double latAValue, uint64_t tsAValue, + double lonBValue, double latBValue, uint64_t tsBValue) -> {return_type} {{ + try + {{ + MEOS::Meos::ensureMeosInitialized(); + if (!(lonAValue >= -180.0 && lonAValue <= 180.0 && latAValue >= -90.0 && latAValue <= 90.0)) return 0; + if (!(lonBValue >= -180.0 && lonBValue <= 180.0 && latBValue >= -90.0 && latBValue <= 90.0)) return 0; + + const std::string tsAString = MEOS::Meos::convertEpochToTimestamp(tsAValue); + const std::string tsBString = MEOS::Meos::convertEpochToTimestamp(tsBValue); + std::string temporalGeometryAWkt = fmt::format("SRID=4326;Point({{}} {{}})@{{}}", lonAValue, latAValue, tsAString); + std::string temporalGeometryBWkt = fmt::format("SRID=4326;Point({{}} {{}})@{{}}", lonBValue, latBValue, tsBString); + + MEOS::Meos::TemporalGeometry temporalGeometryA(temporalGeometryAWkt); + if (!temporalGeometryA.getGeometry()) return 0; + MEOS::Meos::TemporalGeometry temporalGeometryB(temporalGeometryBWkt); + if (!temporalGeometryB.getGeometry()) return 0; + + // MEOS *_tgeo_tgeo spatial-relation: int fn(const Temporal*, const Temporal*). + return {meos_call}(temporalGeometryA.getGeometry(), + temporalGeometryB.getGeometry()); + }} + catch (const std::exception&) + {{ + return 0; + }} + }}, + lonA, latA, tsA, lonB, latB, tsB); + + return VarVal(result); +}} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::Register{nebula_name}PhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{{ + PRECONDITION(arguments.childFunctions.size() == {n_args}, + "{nebula_name}PhysicalFunction requires {n_args} children but got {{}}", + arguments.childFunctions.size()); +{registrar_pushes} +}} + +}} // namespace NES +""" + + +# Physical .cpp template for one-temporal-point operators with a trailing +# `double dist` argument (e.g. edwithin_tgeo_geo / adwithin_tgeo_geo). Same +# layout as PHYSICAL_CPP_TEMPLATE_TEMPORAL_POINT but the MEOS call passes +# `dist` as the 3rd argument. +PHYSICAL_CPP_TEMPLATE_TEMPORAL_POINT_WITH_DIST = """\ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" {{ +#include +#include +}} + +namespace NES {{ + +{nebula_name}PhysicalFunction::{nebula_name}PhysicalFunction({ctor_physical_args}) +{{ + parameterFunctions.reserve({n_args}); +{ctor_physical_pushes} +}} + +VarVal {nebula_name}PhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + {{ + parameterValues.emplace_back(function.execute(record, arena)); + }} + + auto lon = parameterValues[0].cast>(); + auto lat = parameterValues[1].cast>(); + auto timestamp = parameterValues[2].cast>(); + auto geometry = parameterValues[3].cast(); + auto dist = parameterValues[4].cast>(); + + const auto result = nautilus::invoke( + +[](double lonValue, + double latValue, + uint64_t timestampValue, + const char* geometryPtr, + uint32_t geometrySize, + double distValue) -> {return_type} {{ + try + {{ + MEOS::Meos::ensureMeosInitialized(); + if (!(lonValue >= -180.0 && lonValue <= 180.0 && latValue >= -90.0 && latValue <= 90.0)) return 0; + + const std::string timestampString = MEOS::Meos::convertEpochToTimestamp(timestampValue); + std::string temporalGeometryWkt = fmt::format("SRID=4326;Point({{}} {{}})@{{}}", lonValue, latValue, timestampString); + std::string staticGeometryWkt(geometryPtr, geometrySize); + + while (!staticGeometryWkt.empty() && (staticGeometryWkt.front() == '\\'' || staticGeometryWkt.front() == '"')) + staticGeometryWkt.erase(staticGeometryWkt.begin()); + while (!staticGeometryWkt.empty() && (staticGeometryWkt.back() == '\\'' || staticGeometryWkt.back() == '"')) + staticGeometryWkt.pop_back(); + + if (temporalGeometryWkt.empty() || staticGeometryWkt.empty()) return 0; + + MEOS::Meos::TemporalGeometry temporalGeometry(temporalGeometryWkt); + if (!temporalGeometry.getGeometry()) return 0; + MEOS::Meos::StaticGeometry staticGeometry(staticGeometryWkt); + if (!staticGeometry.getGeometry()) return 0; + + // MEOS *_tgeo_geo with trailing distance arg + // — int fn(const Temporal*, const GSERIALIZED*, double). + return {meos_call}(temporalGeometry.getGeometry(), + staticGeometry.getGeometry(), + distValue); + }} + catch (const std::exception&) + {{ + return 0; + }} + }}, + lon, lat, timestamp, geometry.getContent(), geometry.getContentSize(), dist); + + return VarVal(result); +}} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::Register{nebula_name}PhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{{ + PRECONDITION(arguments.childFunctions.size() == {n_args}, + "{nebula_name}PhysicalFunction requires {n_args} children but got {{}}", + arguments.childFunctions.size()); +{registrar_pushes} +}} + +}} // namespace NES +""" + +# Physical .cpp template for two-temporal-points operators with a trailing +# `double dist` argument (edwithin_tgeo_tgeo / adwithin_tgeo_tgeo). +PHYSICAL_CPP_TEMPLATE_TWO_TEMPORAL_POINTS_WITH_DIST = """\ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" {{ +#include +#include +}} + +namespace NES {{ + +{nebula_name}PhysicalFunction::{nebula_name}PhysicalFunction({ctor_physical_args}) +{{ + parameterFunctions.reserve({n_args}); +{ctor_physical_pushes} +}} + +VarVal {nebula_name}PhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + {{ + parameterValues.emplace_back(function.execute(record, arena)); + }} + + auto lonA = parameterValues[0].cast>(); + auto latA = parameterValues[1].cast>(); + auto tsA = parameterValues[2].cast>(); + auto lonB = parameterValues[3].cast>(); + auto latB = parameterValues[4].cast>(); + auto tsB = parameterValues[5].cast>(); + auto dist = parameterValues[6].cast>(); + + const auto result = nautilus::invoke( + +[](double lonAValue, double latAValue, uint64_t tsAValue, + double lonBValue, double latBValue, uint64_t tsBValue, + double distValue) -> {return_type} {{ + try + {{ + MEOS::Meos::ensureMeosInitialized(); + if (!(lonAValue >= -180.0 && lonAValue <= 180.0 && latAValue >= -90.0 && latAValue <= 90.0)) return 0; + if (!(lonBValue >= -180.0 && lonBValue <= 180.0 && latBValue >= -90.0 && latBValue <= 90.0)) return 0; + + const std::string tsAString = MEOS::Meos::convertEpochToTimestamp(tsAValue); + const std::string tsBString = MEOS::Meos::convertEpochToTimestamp(tsBValue); + std::string temporalGeometryAWkt = fmt::format("SRID=4326;Point({{}} {{}})@{{}}", lonAValue, latAValue, tsAString); + std::string temporalGeometryBWkt = fmt::format("SRID=4326;Point({{}} {{}})@{{}}", lonBValue, latBValue, tsBString); + + MEOS::Meos::TemporalGeometry temporalGeometryA(temporalGeometryAWkt); + if (!temporalGeometryA.getGeometry()) return 0; + MEOS::Meos::TemporalGeometry temporalGeometryB(temporalGeometryBWkt); + if (!temporalGeometryB.getGeometry()) return 0; + + // MEOS *_tgeo_tgeo with trailing distance arg + // — int fn(const Temporal*, const Temporal*, double). + return {meos_call}(temporalGeometryA.getGeometry(), + temporalGeometryB.getGeometry(), + distValue); + }} + catch (const std::exception&) + {{ + return 0; + }} + }}, + lonA, latA, tsA, lonB, latB, tsB, dist); + + return VarVal(result); +}} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::Register{nebula_name}PhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{{ + PRECONDITION(arguments.childFunctions.size() == {n_args}, + "{nebula_name}PhysicalFunction requires {n_args} children but got {{}}", + arguments.childFunctions.size()); +{registrar_pushes} +}} + +}} // namespace NES +""" + + +# =========================================================================== +# Trgeometry operator templates (W148/W149 wave). +# +# Physical CPP builders for the 5 trgeometry spatial-predicate layouts +# plus 2 NAD variants. Called directly from emit_operator() instead of +# being .format()-expanded, because the C++ bodies contain literal braces. +# +# Logical HPP/CPP: two style variants ("compact" = Eintersects style, +# "nad" = NadTrgeometry / AlwaysEq / EverEq multi-line style). +# =========================================================================== + +_TRGEO_LICENSE = """\ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/""" + +_TRGEO_PHYS_INCLUDES_VS = """\ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include """ + +_TRGEO_PHYS_INCLUDES_NO_VS = """\ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include """ + + +def _trgeo_phys_header(nebula_name, includes): + return ( + _TRGEO_LICENSE + "\n\n" + + f"#include \n" + + includes + "\n\n" + + "extern \"C\" {\n" + + "#include \n" + + "#include \n" + + "#include \n" + + "#include \n" + + "}\n\n" + + "namespace NES {\n\n" + ) + + +def _trgeo_reg_compact(nebula_name, n): + """Registrar block: compact style (== without spaces, 34-space arg indent).""" + pad = " " + args = "\n".join( + pad + f"std::move(arguments.childFunctions[{i}])" + ("," if i < n - 1 else ")") + for i in range(n) + ) + return ( + f"\nPhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::" + f"Register{nebula_name}PhysicalFunction(\n" + f" PhysicalFunctionRegistryArguments arguments)\n" + f"{{\n" + f" PRECONDITION(arguments.childFunctions.size()=={n},\n" + f" \"{nebula_name}PhysicalFunction requires {n} children but got {{}}\",\n" + f" arguments.childFunctions.size());\n" + f" return {nebula_name}PhysicalFunction(\n" + f"{args};\n" + f"}}\n\n" + f"}} // namespace NES\n" + ) + + +def _trgeo_reg_nad(nebula_name, n): + """Registrar block: nad/multiline style (== with spaces, 34-space indent).""" + pad = " " + args = "\n".join( + pad + f"std::move(arguments.childFunctions[{i}])" + ("," if i < n - 1 else ")") + for i in range(n) + ) + return ( + f"\nPhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::" + f"Register{nebula_name}PhysicalFunction(\n" + f" PhysicalFunctionRegistryArguments arguments)\n" + f"{{\n" + f" PRECONDITION(arguments.childFunctions.size() == {n},\n" + f" \"{nebula_name}PhysicalFunction requires {n} children but got {{}}\",\n" + f" arguments.childFunctions.size());\n" + f" return {nebula_name}PhysicalFunction(\n" + f"{args};\n" + f"}}\n\n" + f"}} // namespace NES\n" + ) + + +# ---------- Logical HPP helpers ---------------------------------------- + +def _trgeo_logical_hpp_compact(nebula_name, brief, ctor_args): + ctor = ", ".join(f"LogicalFunction {a}" for a in ctor_args) + return ( + _TRGEO_LICENSE + "\n\n" + "#pragma once\n\n" + "#include \n" + "#include \n" + "#include \n" + "#include \n\n" + "namespace NES {\n\n" + "/**\n" + f" * @brief {brief}\n" + " */\n" + f"class {nebula_name}LogicalFunction : public LogicalFunctionConcept {{\n" + "public:\n" + f" static constexpr std::string_view NAME = \"{nebula_name}\";\n" + f" {nebula_name}LogicalFunction({ctor});\n" + " DataType getDataType() const override;\n" + " LogicalFunction withDataType(const DataType& dataType) const override;\n" + " std::vector getChildren() const override;\n" + " LogicalFunction withChildren(const std::vector& children) const override;\n" + " std::string_view getType() const override;\n" + " bool operator==(const LogicalFunctionConcept& rhs) const override;\n" + " std::string explain(ExplainVerbosity verbosity) const override;\n" + " LogicalFunction withInferredDataType(const Schema& schema) const override;\n" + " SerializableFunction serialize() const override;\n" + "private:\n" + " DataType dataType;\n" + " std::vector parameters;\n" + "};\n\n" + "} // namespace NES\n" + ) + + +def _trgeo_logical_hpp_nad(nebula_name, brief, ctor_args): + ctor = ", ".join(f"LogicalFunction {a}" for a in ctor_args) + return ( + _TRGEO_LICENSE + "\n\n" + "#pragma once\n\n" + "#include \n" + "#include \n" + "#include \n" + "#include \n\n" + "namespace NES {\n\n" + "/**\n" + f" * @brief {brief}\n" + " */\n" + f"class {nebula_name}LogicalFunction : public LogicalFunctionConcept {{\n" + "public:\n" + f" static constexpr std::string_view NAME = \"{nebula_name}\";\n\n" + f" {nebula_name}LogicalFunction({ctor});\n\n" + " DataType getDataType() const override;\n" + " LogicalFunction withDataType(const DataType& dataType) const override;\n" + " std::vector getChildren() const override;\n" + " LogicalFunction withChildren(const std::vector& children) const override;\n" + " std::string_view getType() const override;\n" + " bool operator==(const LogicalFunctionConcept& rhs) const override;\n" + " std::string explain(ExplainVerbosity verbosity) const override;\n" + " LogicalFunction withInferredDataType(const Schema& schema) const override;\n" + " SerializableFunction serialize() const override;\n\n" + "private:\n" + " DataType dataType;\n" + " std::vector parameters;\n" + "};\n\n" + "} // namespace NES\n" + ) + + +# ---------- Logical CPP helpers ---------------------------------------- + +def _trgeo_logical_cpp_compact(nebula_name, ctor_args, invariants, ret="FLOAT64"): + n = len(ctor_args) + ctor = ", ".join(f"LogicalFunction {a}" for a in ctor_args) + pushes = "\n".join(f" parameters.push_back(std::move({a}));" for a in ctor_args) + inv = "\n".join( + f" INVARIANT(c[{i}].getDataType().isType(DataType::Type::{t}), \"{nm} must be {t}\");" + for i, t, nm in invariants + ) + reg_args = "\n".join( + " std::move(arguments.children[" + str(i) + "])" + + ("," if i < n - 1 else ")") + for i in range(n) + ) + return ( + _TRGEO_LICENSE + "\n\n" + f"#include \n" + "#include \n" + "#include \n" + "#include \n" + "#include \n" + "#include \n" + "#include \n" + "#include \n" + "#include \n\n" + "namespace NES\n{\n\n" + f"{nebula_name}LogicalFunction::{nebula_name}LogicalFunction({ctor})\n" + f" : dataType(DataTypeProvider::provideDataType(DataType::Type::{ret}))\n" + "{\n" + f" parameters.reserve({n});\n" + f"{pushes}\n" + "}\n" + f"DataType {nebula_name}LogicalFunction::getDataType() const {{ return dataType; }}\n" + f"LogicalFunction {nebula_name}LogicalFunction::withDataType(const DataType& d) const {{ auto c=*this; c.dataType=d; return c; }}\n" + f"std::vector {nebula_name}LogicalFunction::getChildren() const {{ return parameters; }}\n" + f"LogicalFunction {nebula_name}LogicalFunction::withChildren(const std::vector& children) const {{\n" + f" PRECONDITION(children.size()=={n},\"{nebula_name}LogicalFunction requires {n} children, but got {{}}\",children.size());\n" + f" auto c=*this; c.parameters=children; return c;\n" + "}\n" + f"std::string_view {nebula_name}LogicalFunction::getType() const {{ return NAME; }}\n" + f"bool {nebula_name}LogicalFunction::operator==(const LogicalFunctionConcept& rhs) const {{\n" + f" if (const auto* o=dynamic_cast(&rhs)) return parameters==o->parameters;\n" + " return false;\n" + "}\n" + f"std::string {nebula_name}LogicalFunction::explain(ExplainVerbosity v) const {{\n" + " return fmt::format(\"{}({})\",NAME,parameters[0].explain(v));\n" + "}\n" + f"LogicalFunction {nebula_name}LogicalFunction::withInferredDataType(const Schema& schema) const {{\n" + f" std::vector c; c.reserve({n});\n" + " for (const auto& p : parameters) c.emplace_back(p.withInferredDataType(schema));\n" + f"{inv}\n" + " return withChildren(c);\n" + "}\n" + f"SerializableFunction {nebula_name}LogicalFunction::serialize() const {{\n" + " SerializableFunction proto;\n" + " proto.set_function_type(std::string(NAME));\n" + " DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type());\n" + " for (const auto& ch : parameters) proto.add_children()->CopyFrom(ch.serialize());\n" + " return proto;\n" + "}\n" + f"LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::Register{nebula_name}LogicalFunction(\n" + " LogicalFunctionRegistryArguments arguments)\n" + "{\n" + f" PRECONDITION(arguments.children.size()=={n},\n" + f" \"{nebula_name}LogicalFunction requires {n} children but got {{}}\",\n" + " arguments.children.size());\n" + f" return {nebula_name}LogicalFunction(\n" + f"{reg_args};\n" + "}\n\n" + "} // namespace NES\n" + ) + + +def _trgeo_logical_cpp_nad(nebula_name, ctor_args, invariants, ret="FLOAT64"): + n = len(ctor_args) + ctor = ", ".join(f"LogicalFunction {a}" for a in ctor_args) + pushes = "\n".join(f" parameters.push_back(std::move({a}));" for a in ctor_args) + inv = "\n".join( + f" INVARIANT(c[{i}].getDataType().isType(DataType::Type::{t}), \"{nm} must be {t}\");" + for i, t, nm in invariants + ) + reg_args = "\n".join( + " std::move(arguments.children[" + str(i) + "])" + + ("," if i < n - 1 else ")") + for i in range(n) + ) + return ( + _TRGEO_LICENSE + "\n\n" + f"#include \n\n" + "#include \n" + "#include \n" + "#include \n" + "#include \n" + "#include \n" + "#include \n" + "#include \n" + "#include \n\n" + "namespace NES\n{\n\n" + f"{nebula_name}LogicalFunction::{nebula_name}LogicalFunction({ctor})\n" + f" : dataType(DataTypeProvider::provideDataType(DataType::Type::{ret}))\n" + "{\n" + f" parameters.reserve({n});\n" + f"{pushes}\n" + "}\n\n" + f"DataType {nebula_name}LogicalFunction::getDataType() const {{ return dataType; }}\n\n" + f"LogicalFunction {nebula_name}LogicalFunction::withDataType(const DataType& newDataType) const\n" + "{\n" + " auto copy = *this; copy.dataType = newDataType; return copy;\n" + "}\n\n" + f"std::vector {nebula_name}LogicalFunction::getChildren() const {{ return parameters; }}\n\n" + f"LogicalFunction {nebula_name}LogicalFunction::withChildren(const std::vector& children) const\n" + "{\n" + f" PRECONDITION(children.size() == {n},\n" + f" \"{nebula_name}LogicalFunction requires {n} children, but got {{}}\", children.size());\n" + " auto copy = *this; copy.parameters = children; return copy;\n" + "}\n\n" + f"std::string_view {nebula_name}LogicalFunction::getType() const {{ return NAME; }}\n\n" + f"bool {nebula_name}LogicalFunction::operator==(const LogicalFunctionConcept& rhs) const\n" + "{\n" + f" if (const auto* other = dynamic_cast(&rhs))\n" + " return parameters == other->parameters;\n" + " return false;\n" + "}\n\n" + f"std::string {nebula_name}LogicalFunction::explain(ExplainVerbosity verbosity) const\n" + "{\n" + " return fmt::format(\"{}({})\", NAME, parameters[0].explain(verbosity));\n" + "}\n\n" + f"LogicalFunction {nebula_name}LogicalFunction::withInferredDataType(const Schema& schema) const\n" + "{\n" + f" std::vector c;\n" + f" c.reserve({n});\n" + " for (const auto& p : parameters)\n" + " c.emplace_back(p.withInferredDataType(schema));\n" + f"{inv}\n" + " return withChildren(c);\n" + "}\n\n" + f"SerializableFunction {nebula_name}LogicalFunction::serialize() const\n" + "{\n" + " SerializableFunction proto;\n" + " proto.set_function_type(std::string(NAME));\n" + " DataTypeSerializationUtil::serializeDataType(dataType, proto.mutable_data_type());\n" + " for (const auto& child : parameters)\n" + " proto.add_children()->CopyFrom(child.serialize());\n" + " return proto;\n" + "}\n\n" + f"LogicalFunctionRegistryReturnType LogicalFunctionGeneratedRegistrar::Register{nebula_name}LogicalFunction(\n" + " LogicalFunctionRegistryArguments arguments)\n" + "{\n" + f" PRECONDITION(arguments.children.size() == {n},\n" + f" \"{nebula_name}LogicalFunction requires {n} children but got {{}}\",\n" + " arguments.children.size());\n" + f" return {nebula_name}LogicalFunction(\n" + f"{reg_args};\n" + "}\n\n" + "} // namespace NES\n" + ) + + +# ---------- Physical HPP ----------------------------------------------- + +def _trgeo_physical_hpp(nebula_name, ctor_args): + ctor = ", ".join(f"PhysicalFunction {a}" for a in ctor_args) + return ( + _TRGEO_LICENSE + "\n\n" + "#pragma once\n\n" + "#include \n" + "#include \n" + "#include \n" + "#include \n\n" + "namespace NES {\n\n" + f"class {nebula_name}PhysicalFunction : public PhysicalFunctionConcept {{\n" + "public:\n" + f" {nebula_name}PhysicalFunction({ctor});\n" + " VarVal execute(const Record& record, ArenaRef& arena) const override;\n" + "private:\n" + " std::vector paramFns;\n" + "};\n\n" + "} // namespace NES\n" + ) + + +# ---------- Physical CPP builders -------------------------------------- +# Each returns a complete file string for a specific layout. + +def _trgeo_phys_cpp_trgeometry_geo(nebula_name, meos_call, ctor_args): + """Layout A: trgeometry_geo — VariableSizedData cast, trgeometryinst_make, compact registrar.""" + n = len(ctor_args) + ctor = ", ".join(f"PhysicalFunction {a}" for a in ctor_args) + pushes = "\n".join(f" paramFns.push_back(std::move({a}));" for a in ctor_args) + return ( + _trgeo_phys_header(nebula_name, _TRGEO_PHYS_INCLUDES_VS) + + f"{nebula_name}PhysicalFunction::{nebula_name}PhysicalFunction({ctor}) {{\n" + + f" paramFns.reserve({n});\n" + + pushes + "\n}\n\n" + + f"VarVal {nebula_name}PhysicalFunction::execute(const Record& record, ArenaRef& arena) const {{\n" + + " auto ref_wkt = paramFns[0].execute(record, arena).cast();\n" + + " auto x1 = paramFns[1].execute(record, arena).cast();\n" + + " auto y1 = paramFns[2].execute(record, arena).cast();\n" + + " auto theta1 = paramFns[3].execute(record, arena).cast();\n" + + " auto ts1 = paramFns[4].execute(record, arena).cast();\n" + + " auto tgt_wkt = paramFns[5].execute(record, arena).cast();\n" + + " const auto result = nautilus::invoke(\n" + + " +[](const char* ref_wkt, uint32_t ref_wktsz, double x1, double y1, double theta1, uint64_t ts1, const char* tgt_wkt, uint32_t tgt_wktsz) -> double {\n" + + " try {\n" + + " MEOS::Meos::ensureMeosInitialized();\n" + + " char* ref1_str = (char*)malloc(ref_wktsz + 1);\n" + + " memcpy(ref1_str, ref_wkt, ref_wktsz); ref1_str[ref_wktsz] = '\\0';\n" + + " GSERIALIZED* gref1 = geom_in(ref1_str, -1); free(ref1_str);\n" + + " if (!gref1) return 0.0;\n" + + " Pose* pose1 = pose_make_2d(x1, y1, theta1, false, 0);\n" + + " if (!pose1) { free(gref1); return 0.0; }\n" + + " TInstant* inst1 = trgeometryinst_make(gref1, pose1, (TimestampTz)ts1);\n" + + " free(gref1); free(pose1);\n" + + " if (!inst1) return 0.0;\n" + + " char* tgt_str = (char*)malloc(tgt_wktsz + 1);\n" + + " memcpy(tgt_str, tgt_wkt, tgt_wktsz); tgt_str[tgt_wktsz] = '\\0';\n" + + " GSERIALIZED* gs_tgt = geom_in(tgt_str, -1); free(tgt_str);\n" + + " if (!gs_tgt) { free(inst1); return 0.0; }\n" + + f" int r = {meos_call}((Temporal*)inst1, gs_tgt);\n" + + " free(inst1); free(gs_tgt);\n" + + " return r > 0 ? 1.0 : 0.0;\n" + + " } catch (const std::exception&) { return 0.0; }\n" + + " },\n" + + " ref_wkt, x1, y1, theta1, ts1, tgt_wkt);\n" + + " return VarVal(result);\n" + + "}\n" + + _trgeo_reg_compact(nebula_name, n) + ) + + +def _trgeo_phys_cpp_trgeometry_geo_nad(nebula_name, meos_call, ctor_args): + """Layout B: trgeometry_geo nad-style — no VariableSizedData cast, trgeoinst_make, nad registrar.""" + n = len(ctor_args) + ctor = ", ".join(f"PhysicalFunction {a}" for a in ctor_args) + pushes = "\n".join(f" paramFns.push_back(std::move({a}));" for a in ctor_args) + return ( + _trgeo_phys_header(nebula_name, _TRGEO_PHYS_INCLUDES_NO_VS) + + f"{nebula_name}PhysicalFunction::{nebula_name}PhysicalFunction({ctor})\n" + + "{\n" + + f" paramFns.reserve({n});\n" + + pushes + "\n}\n\n" + + f"VarVal {nebula_name}PhysicalFunction::execute(const Record& record, ArenaRef& arena) const\n" + + "{\n" + + " auto ref_wkt = paramFns[0].execute(record, arena);\n" + + " auto x = paramFns[1].execute(record, arena).cast();\n" + + " auto y = paramFns[2].execute(record, arena).cast();\n" + + " auto theta = paramFns[3].execute(record, arena).cast();\n" + + " auto ts = paramFns[4].execute(record, arena).cast();\n" + + " auto tgt_wkt = paramFns[5].execute(record, arena);\n" + + " const auto result = nautilus::invoke(\n" + + " +[](const char* ref_wkt, uint32_t ref_len, double x, double y, double theta, uint64_t ts, const char* tgt_wkt, uint32_t tgt_len) -> double {\n" + + " try {\n" + + " MEOS::Meos::ensureMeosInitialized();\n" + + " char* ref_str = (char*)malloc(ref_len + 1);\n" + + " memcpy(ref_str, ref_wkt, ref_len); ref_str[ref_len] = '\\0';\n" + + " GSERIALIZED* gs_ref = geom_in(ref_str, -1); free(ref_str);\n" + + " if (!gs_ref) return 0.0;\n" + + " Pose* pose = pose_make_2d(x, y, theta, false, 0);\n" + + " if (!pose) { free(gs_ref); return 0.0; }\n" + + " TInstant* inst = trgeoinst_make(gs_ref, pose, (TimestampTz)ts);\n" + + " free(gs_ref); free(pose);\n" + + " if (!inst) return 0.0;\n" + + " char* tgt_str = (char*)malloc(tgt_len + 1);\n" + + " memcpy(tgt_str, tgt_wkt, tgt_len); tgt_str[tgt_len] = '\\0';\n" + + " GSERIALIZED* gs_tgt = geom_in(tgt_str, -1); free(tgt_str);\n" + + " if (!gs_tgt) { free(inst); return 0.0; }\n" + + f" int r = {meos_call}((Temporal*)inst, gs_tgt);\n" + + " free(inst); free(gs_tgt);\n" + + " return r > 0 ? 1.0 : 0.0;\n" + + " } catch (const std::exception&) { return 0.0; }\n" + + " },\n" + + " ref_wkt, x, y, theta, ts, tgt_wkt);\n" + + " return VarVal(result);\n" + + "}\n" + + _trgeo_reg_nad(nebula_name, n) + ) + + +def _trgeo_phys_cpp_geo_trgeometry(nebula_name, meos_call, ctor_args): + """Layout C: geo_trgeometry — VariableSizedData cast, trgeometryinst_make, geo-first MEOS call.""" + n = len(ctor_args) + ctor = ", ".join(f"PhysicalFunction {a}" for a in ctor_args) + pushes = "\n".join(f" paramFns.push_back(std::move({a}));" for a in ctor_args) + return ( + _trgeo_phys_header(nebula_name, _TRGEO_PHYS_INCLUDES_VS) + + f"{nebula_name}PhysicalFunction::{nebula_name}PhysicalFunction({ctor}) {{\n" + + f" paramFns.reserve({n});\n" + + pushes + "\n}\n\n" + + f"VarVal {nebula_name}PhysicalFunction::execute(const Record& record, ArenaRef& arena) const {{\n" + + " auto tgt_wkt = paramFns[0].execute(record, arena).cast();\n" + + " auto ref_wkt = paramFns[1].execute(record, arena).cast();\n" + + " auto x1 = paramFns[2].execute(record, arena).cast();\n" + + " auto y1 = paramFns[3].execute(record, arena).cast();\n" + + " auto theta1 = paramFns[4].execute(record, arena).cast();\n" + + " auto ts1 = paramFns[5].execute(record, arena).cast();\n" + + " const auto result = nautilus::invoke(\n" + + " +[](const char* tgt_wkt, uint32_t tgt_wktsz, const char* ref_wkt, uint32_t ref_wktsz, double x1, double y1, double theta1, uint64_t ts1) -> double {\n" + + " try {\n" + + " MEOS::Meos::ensureMeosInitialized();\n" + + " char* ref1_str = (char*)malloc(ref_wktsz + 1);\n" + + " memcpy(ref1_str, ref_wkt, ref_wktsz); ref1_str[ref_wktsz] = '\\0';\n" + + " GSERIALIZED* gref1 = geom_in(ref1_str, -1); free(ref1_str);\n" + + " if (!gref1) return 0.0;\n" + + " Pose* pose1 = pose_make_2d(x1, y1, theta1, false, 0);\n" + + " if (!pose1) { free(gref1); return 0.0; }\n" + + " TInstant* inst1 = trgeometryinst_make(gref1, pose1, (TimestampTz)ts1);\n" + + " free(gref1); free(pose1);\n" + + " if (!inst1) return 0.0;\n" + + " char* tgt_str = (char*)malloc(tgt_wktsz + 1);\n" + + " memcpy(tgt_str, tgt_wkt, tgt_wktsz); tgt_str[tgt_wktsz] = '\\0';\n" + + " GSERIALIZED* gs_tgt = geom_in(tgt_str, -1); free(tgt_str);\n" + + " if (!gs_tgt) { free(inst1); return 0.0; }\n" + + f" int r = {meos_call}(gs_tgt, (Temporal*)inst1);\n" + + " free(inst1); free(gs_tgt);\n" + + " return r > 0 ? 1.0 : 0.0;\n" + + " } catch (const std::exception&) { return 0.0; }\n" + + " },\n" + + " tgt_wkt, ref_wkt, x1, y1, theta1, ts1);\n" + + " return VarVal(result);\n" + + "}\n" + + _trgeo_reg_compact(nebula_name, n) + ) + + +def _trgeo_phys_cpp_geo_trgeometry_eq(nebula_name, meos_call, ctor_args): + """Layout D: geo_trgeometry eq-style — trgeoinst_make, gs_tgt-first build order, nad registrar.""" + n = len(ctor_args) + ctor = ", ".join(f"PhysicalFunction {a}" for a in ctor_args) + pushes = "\n".join(f" paramFns.push_back(std::move({a}));" for a in ctor_args) + return ( + _trgeo_phys_header(nebula_name, _TRGEO_PHYS_INCLUDES_NO_VS) + + f"{nebula_name}PhysicalFunction::{nebula_name}PhysicalFunction({ctor})\n" + + "{\n" + + f" paramFns.reserve({n});\n" + + pushes + "\n}\n\n" + + f"VarVal {nebula_name}PhysicalFunction::execute(const Record& record, ArenaRef& arena) const\n" + + "{\n" + + " auto tgt_wkt = paramFns[0].execute(record, arena);\n" + + " auto ref_wkt = paramFns[1].execute(record, arena);\n" + + " auto x = paramFns[2].execute(record, arena).cast();\n" + + " auto y = paramFns[3].execute(record, arena).cast();\n" + + " auto theta = paramFns[4].execute(record, arena).cast();\n" + + " auto ts = paramFns[5].execute(record, arena).cast();\n" + + " const auto result = nautilus::invoke(\n" + + " +[](const char* tgt_wkt, uint32_t tgt_len, const char* ref_wkt, uint32_t ref_len, double x, double y, double theta, uint64_t ts) -> double {\n" + + " try {\n" + + " MEOS::Meos::ensureMeosInitialized();\n" + + " char* tgt_str = (char*)malloc(tgt_len + 1);\n" + + " memcpy(tgt_str, tgt_wkt, tgt_len); tgt_str[tgt_len] = '\\0';\n" + + " GSERIALIZED* gs_tgt = geom_in(tgt_str, -1); free(tgt_str);\n" + + " if (!gs_tgt) return 0.0;\n" + + " char* ref_str = (char*)malloc(ref_len + 1);\n" + + " memcpy(ref_str, ref_wkt, ref_len); ref_str[ref_len] = '\\0';\n" + + " GSERIALIZED* gs_ref = geom_in(ref_str, -1); free(ref_str);\n" + + " if (!gs_ref) { free(gs_tgt); return 0.0; }\n" + + " Pose* pose = pose_make_2d(x, y, theta, false, 0);\n" + + " if (!pose) { free(gs_tgt); free(gs_ref); return 0.0; }\n" + + " TInstant* inst = trgeoinst_make(gs_ref, pose, (TimestampTz)ts);\n" + + " free(gs_ref); free(pose);\n" + + " if (!inst) { free(gs_tgt); return 0.0; }\n" + + f" int r = {meos_call}(gs_tgt, (Temporal*)inst);\n" + + " free(gs_tgt); free(inst);\n" + + " return r > 0 ? 1.0 : 0.0;\n" + + " } catch (const std::exception&) { return 0.0; }\n" + + " },\n" + + " tgt_wkt, ref_wkt, x, y, theta, ts);\n" + + " return VarVal(result);\n" + + "}\n" + + _trgeo_reg_nad(nebula_name, n) + ) + + +def _trgeo_phys_cpp_trgeometry_geo_with_dist(nebula_name, meos_call, ctor_args): + """Layout E: trgeometry_geo_with_dist — 7 args, dist as 3rd MEOS arg.""" + n = len(ctor_args) + ctor = ", ".join(f"PhysicalFunction {a}" for a in ctor_args) + pushes = "\n".join(f" paramFns.push_back(std::move({a}));" for a in ctor_args) + return ( + _trgeo_phys_header(nebula_name, _TRGEO_PHYS_INCLUDES_VS) + + f"{nebula_name}PhysicalFunction::{nebula_name}PhysicalFunction({ctor}) {{\n" + + f" paramFns.reserve({n});\n" + + pushes + "\n}\n\n" + + f"VarVal {nebula_name}PhysicalFunction::execute(const Record& record, ArenaRef& arena) const {{\n" + + " auto ref_wkt = paramFns[0].execute(record, arena).cast();\n" + + " auto x1 = paramFns[1].execute(record, arena).cast();\n" + + " auto y1 = paramFns[2].execute(record, arena).cast();\n" + + " auto theta1 = paramFns[3].execute(record, arena).cast();\n" + + " auto ts1 = paramFns[4].execute(record, arena).cast();\n" + + " auto tgt_wkt = paramFns[5].execute(record, arena).cast();\n" + + " auto dist = paramFns[6].execute(record, arena).cast();\n" + + " const auto result = nautilus::invoke(\n" + + " +[](const char* ref_wkt, uint32_t ref_wktsz, double x1, double y1, double theta1, uint64_t ts1, const char* tgt_wkt, uint32_t tgt_wktsz, double dist) -> double {\n" + + " try {\n" + + " MEOS::Meos::ensureMeosInitialized();\n" + + " char* ref1_str = (char*)malloc(ref_wktsz + 1);\n" + + " memcpy(ref1_str, ref_wkt, ref_wktsz); ref1_str[ref_wktsz] = '\\0';\n" + + " GSERIALIZED* gref1 = geom_in(ref1_str, -1); free(ref1_str);\n" + + " if (!gref1) return 0.0;\n" + + " Pose* pose1 = pose_make_2d(x1, y1, theta1, false, 0);\n" + + " if (!pose1) { free(gref1); return 0.0; }\n" + + " TInstant* inst1 = trgeometryinst_make(gref1, pose1, (TimestampTz)ts1);\n" + + " free(gref1); free(pose1);\n" + + " if (!inst1) return 0.0;\n" + + " char* tgt_str = (char*)malloc(tgt_wktsz + 1);\n" + + " memcpy(tgt_str, tgt_wkt, tgt_wktsz); tgt_str[tgt_wktsz] = '\\0';\n" + + " GSERIALIZED* gs_tgt = geom_in(tgt_str, -1); free(tgt_str);\n" + + " if (!gs_tgt) { free(inst1); return 0.0; }\n" + + f" int r = {meos_call}((Temporal*)inst1, gs_tgt, dist);\n" + + " free(inst1); free(gs_tgt);\n" + + " return r > 0 ? 1.0 : 0.0;\n" + + " } catch (const std::exception&) { return 0.0; }\n" + + " },\n" + + " ref_wkt, x1, y1, theta1, ts1, tgt_wkt, dist);\n" + + " return VarVal(result);\n" + + "}\n" + + _trgeo_reg_compact(nebula_name, n) + ) + + +def _trgeo_phys_cpp_trgeometry_trgeometry(nebula_name, meos_call, ctor_args): + """Layout F: trgeometry_trgeometry — 10 args, VariableSizedData cast, trgeometryinst_make.""" + n = len(ctor_args) + ctor = ", ".join(f"PhysicalFunction {a}" for a in ctor_args) + pushes = "\n".join(f" paramFns.push_back(std::move({a}));" for a in ctor_args) + return ( + _trgeo_phys_header(nebula_name, _TRGEO_PHYS_INCLUDES_VS) + + f"{nebula_name}PhysicalFunction::{nebula_name}PhysicalFunction({ctor}) {{\n" + + f" paramFns.reserve({n});\n" + + pushes + "\n}\n\n" + + f"VarVal {nebula_name}PhysicalFunction::execute(const Record& record, ArenaRef& arena) const {{\n" + + " auto ref1_wkt = paramFns[0].execute(record, arena).cast();\n" + + " auto x1 = paramFns[1].execute(record, arena).cast();\n" + + " auto y1 = paramFns[2].execute(record, arena).cast();\n" + + " auto theta1 = paramFns[3].execute(record, arena).cast();\n" + + " auto ts1 = paramFns[4].execute(record, arena).cast();\n" + + " auto ref2_wkt = paramFns[5].execute(record, arena).cast();\n" + + " auto x2 = paramFns[6].execute(record, arena).cast();\n" + + " auto y2 = paramFns[7].execute(record, arena).cast();\n" + + " auto theta2 = paramFns[8].execute(record, arena).cast();\n" + + " auto ts2 = paramFns[9].execute(record, arena).cast();\n" + + " const auto result = nautilus::invoke(\n" + + " +[](const char* ref1_wkt, uint32_t ref1_wktsz, double x1, double y1, double theta1, uint64_t ts1, const char* ref2_wkt, uint32_t ref2_wktsz, double x2, double y2, double theta2, uint64_t ts2) -> double {\n" + + " try {\n" + + " MEOS::Meos::ensureMeosInitialized();\n" + + " char* ref1_str = (char*)malloc(ref1_wktsz + 1);\n" + + " memcpy(ref1_str, ref1_wkt, ref1_wktsz); ref1_str[ref1_wktsz] = '\\0';\n" + + " GSERIALIZED* gref1 = geom_in(ref1_str, -1); free(ref1_str);\n" + + " if (!gref1) return 0.0;\n" + + " Pose* pose1 = pose_make_2d(x1, y1, theta1, false, 0);\n" + + " if (!pose1) { free(gref1); return 0.0; }\n" + + " TInstant* inst1 = trgeometryinst_make(gref1, pose1, (TimestampTz)ts1);\n" + + " free(gref1); free(pose1);\n" + + " if (!inst1) return 0.0;\n" + + " char* ref2_str = (char*)malloc(ref2_wktsz + 1);\n" + + " memcpy(ref2_str, ref2_wkt, ref2_wktsz); ref2_str[ref2_wktsz] = '\\0';\n" + + " GSERIALIZED* gref2 = geom_in(ref2_str, -1); free(ref2_str);\n" + + " if (!gref2) return 0.0;\n" + + " Pose* pose2 = pose_make_2d(x2, y2, theta2, false, 0);\n" + + " if (!pose2) { free(gref2); return 0.0; }\n" + + " TInstant* inst2 = trgeometryinst_make(gref2, pose2, (TimestampTz)ts2);\n" + + " free(gref2); free(pose2);\n" + + " if (!inst2) { free(inst1); return 0.0; }\n" + + f" int r = {meos_call}((Temporal*)inst1, (Temporal*)inst2);\n" + + " free(inst1); free(inst2);\n" + + " return r > 0 ? 1.0 : 0.0;\n" + + " } catch (const std::exception&) { return 0.0; }\n" + + " },\n" + + " ref1_wkt, x1, y1, theta1, ts1, ref2_wkt, x2, y2, theta2, ts2);\n" + + " return VarVal(result);\n" + + "}\n" + + _trgeo_reg_compact(nebula_name, n) + ) + + +def _trgeo_phys_cpp_trgeometry_trgeometry_nad(nebula_name, meos_call, ctor_args): + """Layout G: trgeometry_trgeometry nad-style — trgeoinst_make, no cast, nad registrar.""" + n = len(ctor_args) + ctor = ", ".join(f"PhysicalFunction {a}" for a in ctor_args) + pushes = "\n".join(f" paramFns.push_back(std::move({a}));" for a in ctor_args) + return ( + _trgeo_phys_header(nebula_name, _TRGEO_PHYS_INCLUDES_NO_VS) + + f"{nebula_name}PhysicalFunction::{nebula_name}PhysicalFunction({ctor})\n" + + "{\n" + + f" paramFns.reserve({n});\n" + + pushes + "\n}\n\n" + + f"VarVal {nebula_name}PhysicalFunction::execute(const Record& record, ArenaRef& arena) const\n" + + "{\n" + + " auto ref1_wkt = paramFns[0].execute(record, arena);\n" + + " auto x1 = paramFns[1].execute(record, arena).cast();\n" + + " auto y1 = paramFns[2].execute(record, arena).cast();\n" + + " auto theta1 = paramFns[3].execute(record, arena).cast();\n" + + " auto ts1 = paramFns[4].execute(record, arena).cast();\n" + + " auto ref2_wkt = paramFns[5].execute(record, arena);\n" + + " auto x2 = paramFns[6].execute(record, arena).cast();\n" + + " auto y2 = paramFns[7].execute(record, arena).cast();\n" + + " auto theta2 = paramFns[8].execute(record, arena).cast();\n" + + " auto ts2 = paramFns[9].execute(record, arena).cast();\n" + + " const auto result = nautilus::invoke(\n" + + " +[](const char* ref1_wkt, uint32_t ref1_len, double x1, double y1, double theta1, uint64_t ts1, const char* ref2_wkt, uint32_t ref2_len, double x2, double y2, double theta2, uint64_t ts2) -> double {\n" + + " try {\n" + + " MEOS::Meos::ensureMeosInitialized();\n" + + " char* s1 = (char*)malloc(ref1_len + 1);\n" + + " memcpy(s1, ref1_wkt, ref1_len); s1[ref1_len] = '\\0';\n" + + " GSERIALIZED* gs1 = geom_in(s1, -1); free(s1);\n" + + " if (!gs1) return 0.0;\n" + + " Pose* p1 = pose_make_2d(x1, y1, theta1, false, 0);\n" + + " if (!p1) { free(gs1); return 0.0; }\n" + + " TInstant* inst1 = trgeoinst_make(gs1, p1, (TimestampTz)ts1);\n" + + " free(gs1); free(p1);\n" + + " if (!inst1) return 0.0;\n" + + " char* s2 = (char*)malloc(ref2_len + 1);\n" + + " memcpy(s2, ref2_wkt, ref2_len); s2[ref2_len] = '\\0';\n" + + " GSERIALIZED* gs2 = geom_in(s2, -1); free(s2);\n" + + " if (!gs2) { free(inst1); return 0.0; }\n" + + " Pose* p2 = pose_make_2d(x2, y2, theta2, false, 0);\n" + + " if (!p2) { free(inst1); free(gs2); return 0.0; }\n" + + " TInstant* inst2 = trgeoinst_make(gs2, p2, (TimestampTz)ts2);\n" + + " free(gs2); free(p2);\n" + + " if (!inst2) { free(inst1); return 0.0; }\n" + + f" int r = {meos_call}((Temporal*)inst1, (Temporal*)inst2);\n" + + " free(inst1); free(inst2);\n" + + " return r > 0 ? 1.0 : 0.0;\n" + + " } catch (const std::exception&) { return 0.0; }\n" + + " },\n" + + " ref1_wkt, x1, y1, theta1, ts1, ref2_wkt, x2, y2, theta2, ts2);\n" + + " return VarVal(result);\n" + + "}\n" + + _trgeo_reg_nad(nebula_name, n) + ) + + +def _trgeo_phys_cpp_trgeometry_trgeometry_with_dist(nebula_name, meos_call, ctor_args): + """Layout H: trgeometry_trgeometry_with_dist — 11 args, trgeometryinst_make.""" + n = len(ctor_args) + ctor = ", ".join(f"PhysicalFunction {a}" for a in ctor_args) + pushes = "\n".join(f" paramFns.push_back(std::move({a}));" for a in ctor_args) + return ( + _trgeo_phys_header(nebula_name, _TRGEO_PHYS_INCLUDES_VS) + + f"{nebula_name}PhysicalFunction::{nebula_name}PhysicalFunction({ctor}) {{\n" + + f" paramFns.reserve({n});\n" + + pushes + "\n}\n\n" + + f"VarVal {nebula_name}PhysicalFunction::execute(const Record& record, ArenaRef& arena) const {{\n" + + " auto ref1_wkt = paramFns[0].execute(record, arena).cast();\n" + + " auto x1 = paramFns[1].execute(record, arena).cast();\n" + + " auto y1 = paramFns[2].execute(record, arena).cast();\n" + + " auto theta1 = paramFns[3].execute(record, arena).cast();\n" + + " auto ts1 = paramFns[4].execute(record, arena).cast();\n" + + " auto ref2_wkt = paramFns[5].execute(record, arena).cast();\n" + + " auto x2 = paramFns[6].execute(record, arena).cast();\n" + + " auto y2 = paramFns[7].execute(record, arena).cast();\n" + + " auto theta2 = paramFns[8].execute(record, arena).cast();\n" + + " auto ts2 = paramFns[9].execute(record, arena).cast();\n" + + " auto dist = paramFns[10].execute(record, arena).cast();\n" + + " const auto result = nautilus::invoke(\n" + + " +[](const char* ref1_wkt, uint32_t ref1_wktsz, double x1, double y1, double theta1, uint64_t ts1, const char* ref2_wkt, uint32_t ref2_wktsz, double x2, double y2, double theta2, uint64_t ts2, double dist) -> double {\n" + + " try {\n" + + " MEOS::Meos::ensureMeosInitialized();\n" + + " char* ref1_str = (char*)malloc(ref1_wktsz + 1);\n" + + " memcpy(ref1_str, ref1_wkt, ref1_wktsz); ref1_str[ref1_wktsz] = '\\0';\n" + + " GSERIALIZED* gref1 = geom_in(ref1_str, -1); free(ref1_str);\n" + + " if (!gref1) return 0.0;\n" + + " Pose* pose1 = pose_make_2d(x1, y1, theta1, false, 0);\n" + + " if (!pose1) { free(gref1); return 0.0; }\n" + + " TInstant* inst1 = trgeometryinst_make(gref1, pose1, (TimestampTz)ts1);\n" + + " free(gref1); free(pose1);\n" + + " if (!inst1) return 0.0;\n" + + " char* ref2_str = (char*)malloc(ref2_wktsz + 1);\n" + + " memcpy(ref2_str, ref2_wkt, ref2_wktsz); ref2_str[ref2_wktsz] = '\\0';\n" + + " GSERIALIZED* gref2 = geom_in(ref2_str, -1); free(ref2_str);\n" + + " if (!gref2) return 0.0;\n" + + " Pose* pose2 = pose_make_2d(x2, y2, theta2, false, 0);\n" + + " if (!pose2) { free(gref2); return 0.0; }\n" + + " TInstant* inst2 = trgeometryinst_make(gref2, pose2, (TimestampTz)ts2);\n" + + " free(gref2); free(pose2);\n" + + " if (!inst2) { free(inst1); return 0.0; }\n" + + f" int r = {meos_call}((Temporal*)inst1, (Temporal*)inst2, dist);\n" + + " free(inst1); free(inst2);\n" + + " return r > 0 ? 1.0 : 0.0;\n" + + " } catch (const std::exception&) { return 0.0; }\n" + + " },\n" + + " ref1_wkt, x1, y1, theta1, ts1, ref2_wkt, x2, y2, theta2, ts2, dist);\n" + + " return VarVal(result);\n" + + "}\n" + + _trgeo_reg_compact(nebula_name, n) + ) + + +def _trgeo_phys_cpp_nad_trgeometry_geo(nebula_name, meos_call, ctor_args): + """Layout I: nad_trgeometry_geo — double return, trgeoinst_make, nad registrar.""" + n = len(ctor_args) + ctor = ", ".join(f"PhysicalFunction {a}" for a in ctor_args) + pushes = "\n".join(f" paramFns.push_back(std::move({a}));" for a in ctor_args) + return ( + _trgeo_phys_header(nebula_name, _TRGEO_PHYS_INCLUDES_NO_VS) + + f"{nebula_name}PhysicalFunction::{nebula_name}PhysicalFunction({ctor})\n" + + "{\n" + + f" paramFns.reserve({n});\n" + + pushes + "\n}\n\n" + + f"VarVal {nebula_name}PhysicalFunction::execute(const Record& record, ArenaRef& arena) const\n" + + "{\n" + + " auto ref_wkt = paramFns[0].execute(record, arena);\n" + + " auto x = paramFns[1].execute(record, arena).cast();\n" + + " auto y = paramFns[2].execute(record, arena).cast();\n" + + " auto theta = paramFns[3].execute(record, arena).cast();\n" + + " auto ts = paramFns[4].execute(record, arena).cast();\n" + + " auto tgt_wkt = paramFns[5].execute(record, arena);\n" + + " const auto result = nautilus::invoke(\n" + + " +[](const char* ref_wkt, uint32_t ref_len, double x, double y, double theta, uint64_t ts, const char* tgt_wkt, uint32_t tgt_len) -> double {\n" + + " try {\n" + + " MEOS::Meos::ensureMeosInitialized();\n" + + " char* ref_str = (char*)malloc(ref_len + 1);\n" + + " memcpy(ref_str, ref_wkt, ref_len); ref_str[ref_len] = '\\0';\n" + + " GSERIALIZED* gs_ref = geom_in(ref_str, -1); free(ref_str);\n" + + " if (!gs_ref) return 0.0;\n" + + " Pose* pose = pose_make_2d(x, y, theta, false, 0);\n" + + " if (!pose) { free(gs_ref); return 0.0; }\n" + + " TInstant* inst = trgeoinst_make(gs_ref, pose, (TimestampTz)ts);\n" + + " free(gs_ref); free(pose);\n" + + " if (!inst) return 0.0;\n" + + " char* tgt_str = (char*)malloc(tgt_len + 1);\n" + + " memcpy(tgt_str, tgt_wkt, tgt_len); tgt_str[tgt_len] = '\\0';\n" + + " GSERIALIZED* gs_tgt = geom_in(tgt_str, -1); free(tgt_str);\n" + + " if (!gs_tgt) { free(inst); return 0.0; }\n" + + f" double r = {meos_call}((Temporal*)inst, gs_tgt);\n" + + " free(inst); free(gs_tgt);\n" + + " return r;\n" + + " } catch (const std::exception&) { return 0.0; }\n" + + " },\n" + + " ref_wkt, x, y, theta, ts, tgt_wkt);\n" + + " return VarVal(result);\n" + + "}\n" + + _trgeo_reg_nad(nebula_name, n) + ) + + +def _trgeo_phys_cpp_nad_trgeometry_trgeometry(nebula_name, meos_call, ctor_args): + """Layout J: nad_trgeometry_trgeometry — 10 args, double return, trgeoinst_make.""" + n = len(ctor_args) + ctor = ", ".join(f"PhysicalFunction {a}" for a in ctor_args) + pushes = "\n".join(f" paramFns.push_back(std::move({a}));" for a in ctor_args) + return ( + _trgeo_phys_header(nebula_name, _TRGEO_PHYS_INCLUDES_NO_VS) + + f"{nebula_name}PhysicalFunction::{nebula_name}PhysicalFunction({ctor})\n" + + "{\n" + + f" paramFns.reserve({n});\n" + + pushes + "\n}\n\n" + + f"VarVal {nebula_name}PhysicalFunction::execute(const Record& record, ArenaRef& arena) const\n" + + "{\n" + + " auto ref1_wkt = paramFns[0].execute(record, arena);\n" + + " auto x1 = paramFns[1].execute(record, arena).cast();\n" + + " auto y1 = paramFns[2].execute(record, arena).cast();\n" + + " auto theta1 = paramFns[3].execute(record, arena).cast();\n" + + " auto ts1 = paramFns[4].execute(record, arena).cast();\n" + + " auto ref2_wkt = paramFns[5].execute(record, arena);\n" + + " auto x2 = paramFns[6].execute(record, arena).cast();\n" + + " auto y2 = paramFns[7].execute(record, arena).cast();\n" + + " auto theta2 = paramFns[8].execute(record, arena).cast();\n" + + " auto ts2 = paramFns[9].execute(record, arena).cast();\n" + + " const auto result = nautilus::invoke(\n" + + " +[](const char* ref1_wkt, uint32_t ref1_len, double x1, double y1, double theta1, uint64_t ts1, const char* ref2_wkt, uint32_t ref2_len, double x2, double y2, double theta2, uint64_t ts2) -> double {\n" + + " try {\n" + + " MEOS::Meos::ensureMeosInitialized();\n" + + " char* s1 = (char*)malloc(ref1_len + 1);\n" + + " memcpy(s1, ref1_wkt, ref1_len); s1[ref1_len] = '\\0';\n" + + " GSERIALIZED* gs1 = geom_in(s1, -1); free(s1);\n" + + " if (!gs1) return 0.0;\n" + + " Pose* p1 = pose_make_2d(x1, y1, theta1, false, 0);\n" + + " if (!p1) { free(gs1); return 0.0; }\n" + + " TInstant* inst1 = trgeoinst_make(gs1, p1, (TimestampTz)ts1);\n" + + " free(gs1); free(p1);\n" + + " if (!inst1) return 0.0;\n" + + " char* s2 = (char*)malloc(ref2_len + 1);\n" + + " memcpy(s2, ref2_wkt, ref2_len); s2[ref2_len] = '\\0';\n" + + " GSERIALIZED* gs2 = geom_in(s2, -1); free(s2);\n" + + " if (!gs2) { free(inst1); return 0.0; }\n" + + " Pose* p2 = pose_make_2d(x2, y2, theta2, false, 0);\n" + + " if (!p2) { free(inst1); free(gs2); return 0.0; }\n" + + " TInstant* inst2 = trgeoinst_make(gs2, p2, (TimestampTz)ts2);\n" + + " free(gs2); free(p2);\n" + + " if (!inst2) { free(inst1); return 0.0; }\n" + + f" double r = {meos_call}((Temporal*)inst1, (Temporal*)inst2);\n" + + " free(inst1); free(inst2);\n" + + " return r;\n" + + " } catch (const std::exception&) { return 0.0; }\n" + + " },\n" + + " ref1_wkt, x1, y1, theta1, ts1, ref2_wkt, x2, y2, theta2, ts2);\n" + + " return VarVal(result);\n" + + "}\n" + + _trgeo_reg_nad(nebula_name, n) + ) + + +# Invariant sets used by build_descriptor.py classifiers (exported here so +# emit_trgeometry_operator can reference them by name). +_INV_TRG_GEO_X1 = [(0,"VARSIZED","ref_wkt"),(1,"FLOAT64","x1"),(2,"FLOAT64","y1"),(3,"FLOAT64","theta1"),(4,"UINT64","ts1"),(5,"VARSIZED","tgt_wkt")] +_INV_TRG_GEO_X = [(0,"VARSIZED","ref_wkt"),(1,"FLOAT64","x"),(2,"FLOAT64","y"),(3,"FLOAT64","theta"),(4,"UINT64","ts"),(5,"VARSIZED","tgt_wkt")] +_INV_GEO_TRG_X1 = [(0,"VARSIZED","tgt_wkt"),(1,"VARSIZED","ref_wkt"),(2,"FLOAT64","x1"),(3,"FLOAT64","y1"),(4,"FLOAT64","theta1"),(5,"UINT64","ts1")] +_INV_GEO_TRG_X = [(0,"VARSIZED","tgt_wkt"),(1,"VARSIZED","ref_wkt"),(2,"FLOAT64","x"),(3,"FLOAT64","y"),(4,"FLOAT64","theta"),(5,"UINT64","ts")] +_INV_TRG_GEO_DIST = _INV_TRG_GEO_X1 + [(6,"FLOAT64","dist")] +_INV_TRG_TRG_X1 = [(0,"VARSIZED","ref1_wkt"),(1,"FLOAT64","x1"),(2,"FLOAT64","y1"),(3,"FLOAT64","theta1"),(4,"UINT64","ts1"),(5,"VARSIZED","ref2_wkt"),(6,"FLOAT64","x2"),(7,"FLOAT64","y2"),(8,"FLOAT64","theta2"),(9,"UINT64","ts2")] +_INV_TRG_TRG_DIST = _INV_TRG_TRG_X1 + [(10,"FLOAT64","dist")] + +_TRGEO_PHYS_DISPATCH = { + "build_trgeometry_geo": (_trgeo_phys_cpp_trgeometry_geo, ["ref_wkt","x1","y1","theta1","ts1","tgt_wkt"], _INV_TRG_GEO_X1, "compact"), + "build_trgeometry_geo_nad": (_trgeo_phys_cpp_trgeometry_geo_nad, ["ref_wkt","x","y","theta","ts","tgt_wkt"], _INV_TRG_GEO_X, "nad"), + "build_geo_trgeometry": (_trgeo_phys_cpp_geo_trgeometry, ["tgt_wkt","ref_wkt","x1","y1","theta1","ts1"], _INV_GEO_TRG_X1, "compact"), + "build_geo_trgeometry_eq": (_trgeo_phys_cpp_geo_trgeometry_eq, ["tgt_wkt","ref_wkt","x","y","theta","ts"], _INV_GEO_TRG_X, "nad"), + "build_trgeometry_geo_with_dist": (_trgeo_phys_cpp_trgeometry_geo_with_dist, ["ref_wkt","x1","y1","theta1","ts1","tgt_wkt","dist"], _INV_TRG_GEO_DIST,"compact"), + "build_trgeometry_trgeometry": (_trgeo_phys_cpp_trgeometry_trgeometry, ["ref1_wkt","x1","y1","theta1","ts1","ref2_wkt","x2","y2","theta2","ts2"], _INV_TRG_TRG_X1, "compact"), + "build_trgeometry_trgeometry_nad": (_trgeo_phys_cpp_trgeometry_trgeometry_nad, ["ref1_wkt","x1","y1","theta1","ts1","ref2_wkt","x2","y2","theta2","ts2"], _INV_TRG_TRG_X1, "nad"), + "build_trgeometry_trgeometry_with_dist": (_trgeo_phys_cpp_trgeometry_trgeometry_with_dist,["ref1_wkt","x1","y1","theta1","ts1","ref2_wkt","x2","y2","theta2","ts2","dist"], _INV_TRG_TRG_DIST,"compact"), + "build_nad_trgeometry_geo": (_trgeo_phys_cpp_nad_trgeometry_geo, ["ref_wkt","x","y","theta","ts","tgt_wkt"], _INV_TRG_GEO_X, "nad"), + "build_nad_trgeometry_trgeometry": (_trgeo_phys_cpp_nad_trgeometry_trgeometry, ["ref1_wkt","x1","y1","theta1","ts1","ref2_wkt","x2","y2","theta2","ts2"], _INV_TRG_TRG_X1, "nad"), +} + + +def emit_trgeometry_operator(op, output_root: Path): + """Emit 4 files for a trgeometry operator using the W148/W149 templates. + + op must have: nebula_name, meos_call, comment_one_liner, and one of the + build_* keys from _TRGEO_PHYS_DISPATCH set to True. + """ + nebula_name = op["nebula_name"] + meos_call = op["meos_call"] + brief = op.get("comment_one_liner", f"MEOS {meos_call} over a trgeometry instant.") + + build_key = next((k for k in _TRGEO_PHYS_DISPATCH if op.get(k)), None) + if build_key is None: + sys.stderr.write(f" ! {nebula_name}: no trgeometry build key found\n") + return + + phys_fn, ctor_args, invariants, log_style = _TRGEO_PHYS_DISPATCH[build_key] + + logical_hpp_path = output_root / "nes-logical-operators/include/Functions/Meos" / f"{nebula_name}LogicalFunction.hpp" + logical_cpp_path = output_root / "nes-logical-operators/src/Functions/Meos" / f"{nebula_name}LogicalFunction.cpp" + physical_hpp_path = output_root / "nes-physical-operators/include/Functions/Meos" / f"{nebula_name}PhysicalFunction.hpp" + physical_cpp_path = output_root / "nes-physical-operators/src/Functions/Meos" / f"{nebula_name}PhysicalFunction.cpp" + + for p in (logical_hpp_path, logical_cpp_path, physical_hpp_path, physical_cpp_path): + p.parent.mkdir(parents=True, exist_ok=True) + + if log_style == "nad": + logical_hpp_path.write_text(_trgeo_logical_hpp_nad(nebula_name, brief, ctor_args)) + logical_cpp_path.write_text(_trgeo_logical_cpp_nad(nebula_name, ctor_args, invariants)) + else: + logical_hpp_path.write_text(_trgeo_logical_hpp_compact(nebula_name, brief, ctor_args)) + logical_cpp_path.write_text(_trgeo_logical_cpp_compact(nebula_name, ctor_args, invariants)) + + physical_hpp_path.write_text(_trgeo_physical_hpp(nebula_name, ctor_args)) + physical_cpp_path.write_text(phys_fn(nebula_name, meos_call, ctor_args)) + + sys.stderr.write(f" ✓ {nebula_name} [trgeometry/{build_key}]: emitted 4 files\n") + + +def cpp_logical_type(arg): + """C++ constructor-arg type for a LogicalFunction parameter.""" + return "LogicalFunction" + + +def cpp_physical_type(arg): + """C++ constructor-arg type for a PhysicalFunction parameter.""" + return "PhysicalFunction" + + +def build_ctor_args(args, type_fn): + return ",\n ".join( + f"{type_fn(a)} {a['name']}" for a in args + ) + + +def build_pushes_logical(args): + return "\n".join(f" parameters.push_back(std::move({a['name']}));" for a in args) + + +def build_pushes_physical(args): + return "\n".join( + f" parameterFunctions.push_back(std::move({a['name']}Function));" for a in args + ) + + +def build_registrar_pushes_logical(args, nebula_name): + pushes = [] + for i, _ in enumerate(args): + pushes.append(f" auto arg{i} = std::move(arguments.children[{i}]);") + pushes.append( + f" return {nebula_name}LogicalFunction(" + ", ".join(f"std::move(arg{i})" for i in range(len(args))) + ");" + ) + return "\n".join(pushes) + + +def build_registrar_pushes_physical(args, nebula_name): + pushes = [] + for i, _ in enumerate(args): + # PhysicalFunctionRegistryArguments uses `childFunctions`, not `children` + # (LogicalFunctionRegistryArguments uses `children` — see registry headers). + pushes.append(f" auto arg{i} = std::move(arguments.childFunctions[{i}]);") + pushes.append( + f" return {nebula_name}PhysicalFunction(" + ", ".join(f"std::move(arg{i})" for i in range(len(args))) + ");" + ) + return "\n".join(pushes) + + +def generic_fields(op): + """The ordered (name, cpp) event fields for a 'generic' operator: + the input type's fields followed by one (or more) per extra arg (reversed for scalar_first). + New multi-field extra_arg kinds expand to their constituent fields here so the + logical HPP / physical HPP ctor signatures match the physical CPP.""" + _SCALAR_KINDS = {"scalar", "bigint_scalar", "bool_scalar", "int_scalar"} + # primary_fields on a static_scalar op overrides the (empty) inp["fields"]. + pf = op.get("primary_fields") + if pf and op.get("input_type") == "static_scalar": + return [(str(n), str(t)) for n, t in pf] + inp_fields = list(GENERIC_INPUTS[op["input_type"]]["fields"]) + extra_fields = [] + for i, ex in enumerate(op.get("extra_args", [])): + kind = ex["kind"] + if kind in _SCALAR_KINDS: + cpp = ex.get("cpp", "double") + extra_fields.append((f"arg{i}", cpp)) + elif kind in ("h3index", "quadbin", "uint64_scalar", "th3index_scalar"): + extra_fields.append((f"arg{i}", "uint64_t")) + elif kind == "npoint": + extra_fields.append((f"rid{i}", "uint64_t")) + extra_fields.append((f"frac{i}", "double")) + elif kind == "pose": + extra_fields.append((f"px{i}", "double")) + extra_fields.append((f"py{i}", "double")) + extra_fields.append((f"ptheta{i}", "double")) + elif kind == "text_varsized": + extra_fields.append((f"arg{i}", "VariableSizedData")) + elif kind == "jsonb_varsized": + extra_fields.append((f"arg{i}", "VariableSizedData")) + elif kind == "tjsonb": + extra_fields.append((f"json{i}", "VariableSizedData")) + extra_fields.append((f"ts{i}", "uint64_t")) + elif kind == "ttext": + extra_fields.append((f"tval{i}", "VariableSizedData")) + extra_fields.append((f"ts{i}", "uint64_t")) + elif kind == "th3index": + extra_fields.append((f"cell{i}", "uint64_t")) + extra_fields.append((f"ts{i}", "uint64_t")) + elif kind == "tquadbin": + extra_fields.append((f"cell{i}", "uint64_t")) + extra_fields.append((f"ts{i}", "uint64_t")) + elif kind == "tnpoint": + extra_fields.append((f"rid{i}", "uint64_t")) + extra_fields.append((f"frac{i}", "double")) + extra_fields.append((f"ts{i}", "uint64_t")) + elif kind == "tpose": + extra_fields.append((f"px{i}", "double")) + extra_fields.append((f"py{i}", "double")) + extra_fields.append((f"ptheta{i}", "double")) + extra_fields.append((f"ts{i}", "uint64_t")) + elif kind in ("geom_wkt", "geog_wkt"): + # Second geometry arg as VARSIZED WKT + extra_fields.append((f"arg{i}", "VariableSizedData")) + else: + # Fallback for geom, box, wkb_temporal: single VARSIZED field + extra_fields.append((f"arg{i}", "VariableSizedData")) + if op.get("scalar_first"): + return extra_fields + inp_fields + return inp_fields + extra_fields + + +def emit_operator(op, output_root: Path): + nebula_name = op["nebula_name"] + # Trgeometry operators use dedicated per-layout builders (W148/W149 wave). + # Detected by any of the 10 trgeometry build keys registered in _TRGEO_PHYS_DISPATCH. + if any(op.get(k) for k in _TRGEO_PHYS_DISPATCH): + emit_trgeometry_operator(op, output_root) + return + if op.get("build_generic"): + # Derive the canonical arg list + return metadata so the shared logical + # and physical-hpp templates match the assembled physical .cpp. + op["args"] = [{"name": n, "nautilus_type": c, "cpp_type": c} for n, c in generic_fields(op)] + rt, nr = GENERIC_RETURNS[op["return_kind"]][:2] + op.setdefault("return_type", rt) + op.setdefault("nautilus_return", nr) + n_args = len(op["args"]) + + # Logical .hpp constructor args (LogicalFunction type each) + ctor_logical_args = build_ctor_args(op["args"], cpp_logical_type) + # Physical .hpp / .cpp constructor args use 'XxxFunction' naming convention. + # If the op descriptor specifies ctor_sep_indent, use that many spaces for the + # continuation indent (to match the committed file's alignment style); otherwise + # fall back to the legacy fixed 58-space separator used by other shapes. + physical_args = [{"name": a["name"] + "Function"} for a in op["args"]] + _phys_sep_indent = op.get("ctor_sep_indent", 58) + _phys_sep = ",\n" + " " * _phys_sep_indent + ctor_physical_args = _phys_sep.join( + f"PhysicalFunction {a['name']}" for a in physical_args + ) + + ctor_logical_pushes = build_pushes_logical(op["args"]) + ctor_physical_pushes = build_pushes_physical(op["args"]) + registrar_l = build_registrar_pushes_logical(op["args"], nebula_name) + registrar_p = build_registrar_pushes_physical(op["args"], nebula_name) + + common = { + "nebula_name": nebula_name, + "comment_one_liner": op["comment_one_liner"], + "meos_call": op["meos_call"], + "n_args": n_args, + "nautilus_return": op["nautilus_return"], + "return_type": op["return_type"], + "ctor_logical_args": ctor_logical_args, + "ctor_physical_args": ctor_physical_args, + "ctor_logical_pushes": ctor_logical_pushes, + "ctor_physical_pushes": ctor_physical_pushes, + "registrar_pushes": registrar_l, + # tnumber-shape extras (only consumed by the tnumber templates). + # tnumber_wkt_format is a fmt::format pattern that ends up in C++ as-is; + # Python single-pass .format() means we want raw `{}@{}` here (no doubling). + "tnumber_value_cpp_type": op.get("tnumber_value_cpp_type", "double"), + "scalar_cpp_type": op.get("scalar_cpp_type", "double"), + "tnumber_wkt_format": op.get("tnumber_wkt_format", "{}@{}"), + "tnumber_in_fn": op.get("tnumber_in_fn", "tfloat_in"), + # Cast expressions for tint operators: double-typed lambda args are cast to int + # before being passed to fmt::format or the MEOS call (matches committed style). + # For tfloat operators these are just the bare variable names (no cast). + "value_fmt_expr": op.get("value_fmt_expr", "value"), + "threshold_call_expr": op.get("threshold_call_expr", "threshold"), + "scalar_call_expr": op.get("scalar_call_expr", "d"), + "value1_fmt_expr": op.get("value1_fmt_expr", "v1"), + "value2_fmt_expr": op.get("value2_fmt_expr", "v2"), + } + + logical_hpp_path = output_root / "nes-logical-operators/include/Functions/Meos" / f"{nebula_name}LogicalFunction.hpp" + logical_cpp_path = output_root / "nes-logical-operators/src/Functions/Meos" / f"{nebula_name}LogicalFunction.cpp" + physical_hpp_path = output_root / "nes-physical-operators/include/Functions/Meos" / f"{nebula_name}PhysicalFunction.hpp" + physical_cpp_path = output_root / "nes-physical-operators/src/Functions/Meos" / f"{nebula_name}PhysicalFunction.cpp" + + for p in (logical_hpp_path, logical_cpp_path, physical_hpp_path, physical_cpp_path): + p.parent.mkdir(parents=True, exist_ok=True) + + logical_hpp_path.write_text(LOGICAL_HPP_TEMPLATE.format(**common)) + logical_cpp_path.write_text(LOGICAL_CPP_TEMPLATE.format(**common)) + physical_hpp_path.write_text(PHYSICAL_HPP_TEMPLATE.format(**common)) + + physical_common = dict(common) + physical_common["registrar_pushes"] = registrar_p + if op.get("build_generic"): + physical_cpp_path.write_text(assemble_generic_physical(op)) + elif op.get("build_two_temporal_points_with_dist"): + physical_cpp_path.write_text(PHYSICAL_CPP_TEMPLATE_TWO_TEMPORAL_POINTS_WITH_DIST.format(**physical_common)) + elif op.get("build_temporal_point_with_dist"): + physical_cpp_path.write_text(PHYSICAL_CPP_TEMPLATE_TEMPORAL_POINT_WITH_DIST.format(**physical_common)) + elif op.get("build_two_temporal_points"): + physical_cpp_path.write_text(PHYSICAL_CPP_TEMPLATE_TWO_TEMPORAL_POINTS.format(**physical_common)) + elif op.get("build_temporal_point_restriction"): + physical_cpp_path.write_text(PHYSICAL_CPP_TEMPLATE_TEMPORAL_POINT_RESTRICTION.format(**physical_common)) + elif op.get("build_two_tpose_points_via_composition"): + physical_cpp_path.write_text(PHYSICAL_CPP_TEMPLATE_TWO_TPOSE_POINTS_VIA_COMPOSITION.format(**physical_common)) + elif op.get("build_tpose_point_via_composition"): + physical_cpp_path.write_text(PHYSICAL_CPP_TEMPLATE_TPOSE_POINT_VIA_COMPOSITION.format(**physical_common)) + elif op.get("build_two_tnpoint_points_via_composition"): + physical_cpp_path.write_text(PHYSICAL_CPP_TEMPLATE_TWO_TNPOINT_POINTS_VIA_COMPOSITION.format(**physical_common)) + elif op.get("build_tnpoint_point_via_composition"): + physical_cpp_path.write_text(PHYSICAL_CPP_TEMPLATE_TNPOINT_POINT_VIA_COMPOSITION.format(**physical_common)) + elif op.get("build_two_tpose_points_with_dist_via_composition"): + physical_cpp_path.write_text(PHYSICAL_CPP_TEMPLATE_TWO_TPOSE_POINTS_WITH_DIST_VIA_COMPOSITION.format(**physical_common)) + elif op.get("build_tpose_point_with_dist_via_composition"): + physical_cpp_path.write_text(PHYSICAL_CPP_TEMPLATE_TPOSE_POINT_WITH_DIST_VIA_COMPOSITION.format(**physical_common)) + elif op.get("build_two_tnpoint_points_with_dist_via_composition"): + physical_cpp_path.write_text(PHYSICAL_CPP_TEMPLATE_TWO_TNPOINT_POINTS_WITH_DIST_VIA_COMPOSITION.format(**physical_common)) + elif op.get("build_tnpoint_point_with_dist_via_composition"): + physical_cpp_path.write_text(PHYSICAL_CPP_TEMPLATE_TNPOINT_POINT_WITH_DIST_VIA_COMPOSITION.format(**physical_common)) + elif op.get("build_two_tcbuffer_points_with_dist"): + physical_cpp_path.write_text(PHYSICAL_CPP_TEMPLATE_TWO_TCBUFFER_POINTS_WITH_DIST.format(**physical_common)) + elif op.get("build_tcbuffer_point_cbuffer_with_dist"): + physical_cpp_path.write_text(PHYSICAL_CPP_TEMPLATE_TCBUFFER_POINT_CBUFFER_WITH_DIST.format(**physical_common)) + elif op.get("build_tcbuffer_point_with_dist"): + physical_cpp_path.write_text(PHYSICAL_CPP_TEMPLATE_TCBUFFER_POINT_WITH_DIST.format(**physical_common)) + elif op.get("build_two_tcbuffer_points"): + physical_cpp_path.write_text(PHYSICAL_CPP_TEMPLATE_TWO_TCBUFFER_POINTS.format(**physical_common)) + elif op.get("build_tcbuffer_point_cbuffer"): + physical_cpp_path.write_text(PHYSICAL_CPP_TEMPLATE_TCBUFFER_POINT_CBUFFER.format(**physical_common)) + elif op.get("build_tcbuffer_point"): + physical_cpp_path.write_text(PHYSICAL_CPP_TEMPLATE_TCBUFFER_POINT.format(**physical_common)) + elif op.get("build_temporal_point"): + physical_cpp_path.write_text(PHYSICAL_CPP_TEMPLATE_TEMPORAL_POINT.format(**physical_common)) + elif op.get("build_tnumber_point_with_scalar"): + physical_cpp_path.write_text(PHYSICAL_CPP_TEMPLATE_TNUMBER_POINT_WITH_SCALAR.format(**physical_common)) + elif op.get("build_tnumber_scalar_first"): + physical_cpp_path.write_text(PHYSICAL_CPP_TEMPLATE_TNUMBER_SCALAR_FIRST.format(**physical_common)) + elif op.get("build_two_tnumber_points"): + physical_cpp_path.write_text(PHYSICAL_CPP_TEMPLATE_TWO_TNUMBER_POINTS.format(**physical_common)) + else: + sys.stderr.write( + f" ! {nebula_name}: physical-cpp template for non-temporal-point ops is not yet implemented; " + f"skipping .cpp — the .hpp + logical files are still emitted, but the .cpp must be hand-written.\n" + ) + + sys.stderr.write(f" ✓ {nebula_name}: emitted 4 files ({logical_hpp_path.relative_to(output_root)} + siblings)\n") + + +# Physical .cpp template for one-temporal-point restriction operators — +# MEOS signature `Temporal* fn(const Temporal*, const GSERIALIZED*)`. The +# returned Temporal* is checked for non-null (i.e. survived the restriction), +# freed, and reduced to an int (1 = survives, 0 = clipped/null/error). +# Per-event single-instant semantics: equivalent to a filter predicate. +# Mirrors mariana's TemporalAtStBox int-collapse pattern. +PHYSICAL_CPP_TEMPLATE_TEMPORAL_POINT_RESTRICTION = """\ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" {{ +#include +#include +}} + +namespace NES {{ + +{nebula_name}PhysicalFunction::{nebula_name}PhysicalFunction({ctor_physical_args}) +{{ + parameterFunctions.reserve({n_args}); +{ctor_physical_pushes} +}} + +VarVal {nebula_name}PhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + {{ + parameterValues.emplace_back(function.execute(record, arena)); + }} + + auto lon = parameterValues[0].cast>(); + auto lat = parameterValues[1].cast>(); + auto timestamp = parameterValues[2].cast>(); + auto geometry = parameterValues[3].cast(); + + const auto result = nautilus::invoke( + +[](double lonValue, + double latValue, + uint64_t timestampValue, + const char* geometryPtr, + uint32_t geometrySize) -> {return_type} {{ + try + {{ + MEOS::Meos::ensureMeosInitialized(); + if (!(lonValue >= -180.0 && lonValue <= 180.0 && latValue >= -90.0 && latValue <= 90.0)) return 0; + + const std::string timestampString = MEOS::Meos::convertEpochToTimestamp(timestampValue); + std::string temporalGeometryWkt = fmt::format("SRID=4326;Point({{}} {{}})@{{}}", lonValue, latValue, timestampString); + std::string staticGeometryWkt(geometryPtr, geometrySize); + + while (!staticGeometryWkt.empty() && (staticGeometryWkt.front() == '\\'' || staticGeometryWkt.front() == '"')) + staticGeometryWkt.erase(staticGeometryWkt.begin()); + while (!staticGeometryWkt.empty() && (staticGeometryWkt.back() == '\\'' || staticGeometryWkt.back() == '"')) + staticGeometryWkt.pop_back(); + + if (temporalGeometryWkt.empty() || staticGeometryWkt.empty()) return 0; + + MEOS::Meos::TemporalGeometry temporalGeometry(temporalGeometryWkt); + if (!temporalGeometry.getGeometry()) return 0; + MEOS::Meos::StaticGeometry staticGeometry(staticGeometryWkt); + if (!staticGeometry.getGeometry()) return 0; + + // MEOS restriction call — returns Temporal* (non-null if the + // input survived the restriction, null if clipped/empty). + // For per-event single-instant inputs this collapses to a + // filter predicate: 1 if the point survives, 0 if clipped. + Temporal* clipped = {meos_call}(temporalGeometry.getGeometry(), + staticGeometry.getGeometry()); + if (clipped == nullptr) return 0; + free(clipped); + return 1; + }} + catch (const std::exception&) + {{ + return 0; + }} + }}, + lon, lat, timestamp, geometry.getContent(), geometry.getContentSize()); + + return VarVal(result); +}} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::Register{nebula_name}PhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{{ + PRECONDITION(arguments.childFunctions.size() == {n_args}, + "{nebula_name}PhysicalFunction requires {n_args} children but got {{}}", + arguments.childFunctions.size()); +{registrar_pushes} +}} + +}} // namespace NES +""" + + +# Physical .cpp template for one-tcbuffer-point operators with a static +# geometry — e.g. econtains_tcbuffer_geo. The MEOS call signature is +# ` fn(const Temporal*, const GSERIALIZED*)` where the Temporal is a +# tcbuffer (Cbuffer instant) built per-event from (lon, lat, radius, ts). +# WKT format: "Cbuffer(Point(lon lat),radius)@ts". +# 5 SQL args: lon, lat, radius, ts, geometry. +PHYSICAL_CPP_TEMPLATE_TCBUFFER_POINT = """\ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" {{ +#include +#include +}} + +namespace NES {{ + +{nebula_name}PhysicalFunction::{nebula_name}PhysicalFunction({ctor_physical_args}) +{{ + parameterFunctions.reserve({n_args}); +{ctor_physical_pushes} +}} + +VarVal {nebula_name}PhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + {{ + parameterValues.emplace_back(function.execute(record, arena)); + }} + + auto lon = parameterValues[0].cast>(); + auto lat = parameterValues[1].cast>(); + auto radius = parameterValues[2].cast>(); + auto timestamp = parameterValues[3].cast>(); + auto geometry = parameterValues[4].cast(); + + const auto result = nautilus::invoke( + +[](double lonValue, + double latValue, + double radiusValue, + uint64_t timestampValue, + const char* geometryPtr, + uint32_t geometrySize) -> {return_type} {{ + try + {{ + MEOS::Meos::ensureMeosInitialized(); + if (!(lonValue >= -180.0 && lonValue <= 180.0 && latValue >= -90.0 && latValue <= 90.0)) return 0; + if (radiusValue < 0.0) return 0; + + const std::string timestampString = MEOS::Meos::convertEpochToTimestamp(timestampValue); + std::string tcbufferWkt = fmt::format("Cbuffer(Point({{}} {{}}),{{}})@{{}}", + lonValue, latValue, radiusValue, timestampString); + std::string staticGeometryWkt(geometryPtr, geometrySize); + + while (!staticGeometryWkt.empty() && (staticGeometryWkt.front() == '\\'' || staticGeometryWkt.front() == '"')) + staticGeometryWkt.erase(staticGeometryWkt.begin()); + while (!staticGeometryWkt.empty() && (staticGeometryWkt.back() == '\\'' || staticGeometryWkt.back() == '"')) + staticGeometryWkt.pop_back(); + + if (tcbufferWkt.empty() || staticGeometryWkt.empty()) return 0; + + Temporal* tcbuffer = tcbuffer_in(tcbufferWkt.c_str()); + if (!tcbuffer) return 0; + MEOS::Meos::StaticGeometry staticGeometry(staticGeometryWkt); + if (!staticGeometry.getGeometry()) {{ free(tcbuffer); return 0; }} + + {return_type} r = {meos_call}(tcbuffer, staticGeometry.getGeometry()); + free(tcbuffer); + return r; + }} + catch (const std::exception&) + {{ + return 0; + }} + }}, + lon, lat, radius, timestamp, geometry.getContent(), geometry.getContentSize()); + + return VarVal(result); +}} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::Register{nebula_name}PhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{{ + PRECONDITION(arguments.childFunctions.size() == {n_args}, + "{nebula_name}PhysicalFunction requires {n_args} children but got {{}}", + arguments.childFunctions.size()); +{registrar_pushes} +}} + +}} // namespace NES +""" + + +# Physical .cpp template for tpose × static geom spatial-rels VIA +# COMPOSITION — the existing _tgeo_geo MEOS call is applied to a tpose +# converted to tgeompoint at run time. Per-event tpose instant from +# (x, y, theta, ts), then tpose_to_tpoint(), then the MEOS spatial-rel +# call. Matches MobilityDB PR #987's SQL-level composition recipe at the +# binding layer (no new MEOS spatial-rel symbols are needed for tpose). +# 5 SQL args: x, y, theta, ts, geometry. +PHYSICAL_CPP_TEMPLATE_TPOSE_POINT_VIA_COMPOSITION = """\ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" {{ +#include +#include +#include +}} + +namespace NES {{ + +{nebula_name}PhysicalFunction::{nebula_name}PhysicalFunction({ctor_physical_args}) +{{ + parameterFunctions.reserve({n_args}); +{ctor_physical_pushes} +}} + +VarVal {nebula_name}PhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + {{ + parameterValues.emplace_back(function.execute(record, arena)); + }} + + auto x = parameterValues[0].cast>(); + auto y = parameterValues[1].cast>(); + auto theta = parameterValues[2].cast>(); + auto timestamp = parameterValues[3].cast>(); + auto geometry = parameterValues[4].cast(); + + const auto result = nautilus::invoke( + +[](double xValue, double yValue, double thetaValue, uint64_t timestampValue, + const char* geometryPtr, uint32_t geometrySize) -> {return_type} {{ + try + {{ + MEOS::Meos::ensureMeosInitialized(); + if (!(xValue >= -180.0 && xValue <= 180.0 && yValue >= -90.0 && yValue <= 90.0)) return 0; + + const std::string timestampString = MEOS::Meos::convertEpochToTimestamp(timestampValue); + std::string tposeWkt = fmt::format("Pose(Point({{}} {{}}), {{}})@{{}}", + xValue, yValue, thetaValue, timestampString); + std::string staticGeometryWkt(geometryPtr, geometrySize); + + while (!staticGeometryWkt.empty() && (staticGeometryWkt.front() == '\\'' || staticGeometryWkt.front() == '"')) + staticGeometryWkt.erase(staticGeometryWkt.begin()); + while (!staticGeometryWkt.empty() && (staticGeometryWkt.back() == '\\'' || staticGeometryWkt.back() == '"')) + staticGeometryWkt.pop_back(); + + if (tposeWkt.empty() || staticGeometryWkt.empty()) return 0; + + Temporal* tpose = tpose_in(tposeWkt.c_str()); + if (!tpose) return 0; + Temporal* tgeo = tpose_to_tpoint(tpose); + if (!tgeo) {{ free(tpose); return 0; }} + MEOS::Meos::StaticGeometry staticGeometry(staticGeometryWkt); + if (!staticGeometry.getGeometry()) {{ free(tgeo); free(tpose); return 0; }} + + {return_type} r = {meos_call}(tgeo, staticGeometry.getGeometry()); + free(tgeo); + free(tpose); + return r; + }} + catch (const std::exception&) + {{ + return 0; + }} + }}, + x, y, theta, timestamp, geometry.getContent(), geometry.getContentSize()); + + return VarVal(result); +}} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::Register{nebula_name}PhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{{ + PRECONDITION(arguments.childFunctions.size() == {n_args}, + "{nebula_name}PhysicalFunction requires {n_args} children but got {{}}", + arguments.childFunctions.size()); +{registrar_pushes} +}} + +}} // namespace NES +""" + + +# Physical .cpp template for tpose × tpose spatial-rels VIA COMPOSITION — +# the existing _tgeo_tgeo MEOS call is applied to two tposes each converted +# to a single-instant tgeompoint at run time. Per-event tpose instants from +# (xA, yA, thetaA, tsA) and (xB, yB, thetaB, tsB), each tpose_in() then +# tpose_to_tpoint(), then the MEOS two-temporal spatial-rel call. Mirrors the +# W14 one-tpose composition recipe; no new MEOS symbols are needed for tpose +# (the _tgeo_tgeo row was shipped in W3). 8 SQL args. +PHYSICAL_CPP_TEMPLATE_TWO_TPOSE_POINTS_VIA_COMPOSITION = """\ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" {{ +#include +#include +#include +}} + +namespace NES {{ + +{nebula_name}PhysicalFunction::{nebula_name}PhysicalFunction({ctor_physical_args}) +{{ + parameterFunctions.reserve({n_args}); +{ctor_physical_pushes} +}} + +VarVal {nebula_name}PhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + {{ + parameterValues.emplace_back(function.execute(record, arena)); + }} + + auto xA = parameterValues[0].cast>(); + auto yA = parameterValues[1].cast>(); + auto thetaA = parameterValues[2].cast>(); + auto tsA = parameterValues[3].cast>(); + auto xB = parameterValues[4].cast>(); + auto yB = parameterValues[5].cast>(); + auto thetaB = parameterValues[6].cast>(); + auto tsB = parameterValues[7].cast>(); + + const auto result = nautilus::invoke( + +[](double xAValue, double yAValue, double thetaAValue, uint64_t tsAValue, + double xBValue, double yBValue, double thetaBValue, uint64_t tsBValue) -> {return_type} {{ + try + {{ + MEOS::Meos::ensureMeosInitialized(); + if (!(xAValue >= -180.0 && xAValue <= 180.0 && yAValue >= -90.0 && yAValue <= 90.0)) return 0; + if (!(xBValue >= -180.0 && xBValue <= 180.0 && yBValue >= -90.0 && yBValue <= 90.0)) return 0; + + const std::string tsAString = MEOS::Meos::convertEpochToTimestamp(tsAValue); + const std::string tsBString = MEOS::Meos::convertEpochToTimestamp(tsBValue); + std::string tposeAWkt = fmt::format("Pose(Point({{}} {{}}), {{}})@{{}}", xAValue, yAValue, thetaAValue, tsAString); + std::string tposeBWkt = fmt::format("Pose(Point({{}} {{}}), {{}})@{{}}", xBValue, yBValue, thetaBValue, tsBString); + + if (tposeAWkt.empty() || tposeBWkt.empty()) return 0; + + Temporal* tposeA = tpose_in(tposeAWkt.c_str()); + if (!tposeA) return 0; + Temporal* tgeoA = tpose_to_tpoint(tposeA); + if (!tgeoA) {{ free(tposeA); return 0; }} + Temporal* tposeB = tpose_in(tposeBWkt.c_str()); + if (!tposeB) {{ free(tgeoA); free(tposeA); return 0; }} + Temporal* tgeoB = tpose_to_tpoint(tposeB); + if (!tgeoB) {{ free(tposeB); free(tgeoA); free(tposeA); return 0; }} + + {return_type} r = {meos_call}(tgeoA, tgeoB); + free(tgeoB); + free(tposeB); + free(tgeoA); + free(tposeA); + return r; + }} + catch (const std::exception&) + {{ + return 0; + }} + }}, + xA, yA, thetaA, tsA, xB, yB, thetaB, tsB); + + return VarVal(result); +}} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::Register{nebula_name}PhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{{ + PRECONDITION(arguments.childFunctions.size() == {n_args}, + "{nebula_name}PhysicalFunction requires {n_args} children but got {{}}", + arguments.childFunctions.size()); +{registrar_pushes} +}} + +}} // namespace NES +""" + + +# Physical .cpp template for tnpoint × static geom spatial-rels VIA +# COMPOSITION — a temporal network point is resolved to a temporal +# geometry point at run time (tnpoint_to_tgeompoint, which looks up each +# route's geometry from the MEOS ways network), then the existing +# _tgeo_geo spatial-rel is applied. Same shape as the tpose composition +# (W14); no new MEOS spatial-rel symbols are needed for tnpoint. +# NOTE: tnpoint_to_tgeompoint yields a tgeompoint in the *network* SRID, +# so the static geometry must use that SRID (else MEOS errors on mixed +# SRID). 4 SQL args: rid, fraction, ts, geometry. +PHYSICAL_CPP_TEMPLATE_TNPOINT_POINT_VIA_COMPOSITION = """\ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" {{ +#include +#include +#include +}} + +namespace NES {{ + +{nebula_name}PhysicalFunction::{nebula_name}PhysicalFunction({ctor_physical_args}) +{{ + parameterFunctions.reserve({n_args}); +{ctor_physical_pushes} +}} + +VarVal {nebula_name}PhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + {{ + parameterValues.emplace_back(function.execute(record, arena)); + }} + + auto rid = parameterValues[0].cast>(); + auto fraction = parameterValues[1].cast>(); + auto timestamp = parameterValues[2].cast>(); + auto geometry = parameterValues[3].cast(); + + const auto result = nautilus::invoke( + +[](uint64_t ridValue, double fractionValue, uint64_t timestampValue, + const char* geometryPtr, uint32_t geometrySize) -> {return_type} {{ + try + {{ + MEOS::Meos::ensureMeosInitialized(); + + const std::string timestampString = MEOS::Meos::convertEpochToTimestamp(timestampValue); + std::string tnpointWkt = fmt::format("NPoint({{}}, {{}})@{{}}", ridValue, fractionValue, timestampString); + std::string staticGeometryWkt(geometryPtr, geometrySize); + + while (!staticGeometryWkt.empty() && (staticGeometryWkt.front() == '\\'' || staticGeometryWkt.front() == '"')) + staticGeometryWkt.erase(staticGeometryWkt.begin()); + while (!staticGeometryWkt.empty() && (staticGeometryWkt.back() == '\\'' || staticGeometryWkt.back() == '"')) + staticGeometryWkt.pop_back(); + + if (tnpointWkt.empty() || staticGeometryWkt.empty()) return 0; + + Temporal* tnpoint = tnpoint_in(tnpointWkt.c_str()); + if (!tnpoint) return 0; + Temporal* tgeo = tnpoint_to_tgeompoint(tnpoint); + if (!tgeo) {{ free(tnpoint); return 0; }} + MEOS::Meos::StaticGeometry staticGeometry(staticGeometryWkt); + if (!staticGeometry.getGeometry()) {{ free(tgeo); free(tnpoint); return 0; }} + + {return_type} r = {meos_call}(tgeo, staticGeometry.getGeometry()); + free(tgeo); + free(tnpoint); + return r; + }} + catch (const std::exception&) + {{ + return 0; + }} + }}, + rid, fraction, timestamp, geometry.getContent(), geometry.getContentSize()); + + return VarVal(result); +}} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::Register{nebula_name}PhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{{ + PRECONDITION(arguments.childFunctions.size() == {n_args}, + "{nebula_name}PhysicalFunction requires {n_args} children but got {{}}", + arguments.childFunctions.size()); +{registrar_pushes} +}} + +}} // namespace NES +""" + + +# Physical .cpp template for tnpoint × tnpoint spatial-rels VIA +# COMPOSITION — two temporal network points each resolved to a temporal +# geometry point (tnpoint_to_tgeompoint), then the existing _tgeo_tgeo +# spatial-rel (W3) is applied. Both operands land in the network SRID, so +# no mixed-SRID concern (unlike tnpoint × static geom). 6 SQL args: +# ridA, fracA, tsA, ridB, fracB, tsB. +PHYSICAL_CPP_TEMPLATE_TWO_TNPOINT_POINTS_VIA_COMPOSITION = """\ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" {{ +#include +#include +#include +}} + +namespace NES {{ + +{nebula_name}PhysicalFunction::{nebula_name}PhysicalFunction({ctor_physical_args}) +{{ + parameterFunctions.reserve({n_args}); +{ctor_physical_pushes} +}} + +VarVal {nebula_name}PhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + {{ + parameterValues.emplace_back(function.execute(record, arena)); + }} + + auto ridA = parameterValues[0].cast>(); + auto fractionA = parameterValues[1].cast>(); + auto tsA = parameterValues[2].cast>(); + auto ridB = parameterValues[3].cast>(); + auto fractionB = parameterValues[4].cast>(); + auto tsB = parameterValues[5].cast>(); + + const auto result = nautilus::invoke( + +[](uint64_t ridAValue, double fractionAValue, uint64_t tsAValue, + uint64_t ridBValue, double fractionBValue, uint64_t tsBValue) -> {return_type} {{ + try + {{ + MEOS::Meos::ensureMeosInitialized(); + + const std::string tsAString = MEOS::Meos::convertEpochToTimestamp(tsAValue); + const std::string tsBString = MEOS::Meos::convertEpochToTimestamp(tsBValue); + std::string tnpointAWkt = fmt::format("NPoint({{}}, {{}})@{{}}", ridAValue, fractionAValue, tsAString); + std::string tnpointBWkt = fmt::format("NPoint({{}}, {{}})@{{}}", ridBValue, fractionBValue, tsBString); + + if (tnpointAWkt.empty() || tnpointBWkt.empty()) return 0; + + Temporal* tnpointA = tnpoint_in(tnpointAWkt.c_str()); + if (!tnpointA) return 0; + Temporal* tgeoA = tnpoint_to_tgeompoint(tnpointA); + if (!tgeoA) {{ free(tnpointA); return 0; }} + Temporal* tnpointB = tnpoint_in(tnpointBWkt.c_str()); + if (!tnpointB) {{ free(tgeoA); free(tnpointA); return 0; }} + Temporal* tgeoB = tnpoint_to_tgeompoint(tnpointB); + if (!tgeoB) {{ free(tnpointB); free(tgeoA); free(tnpointA); return 0; }} + + {return_type} r = {meos_call}(tgeoA, tgeoB); + free(tgeoB); + free(tnpointB); + free(tgeoA); + free(tnpointA); + return r; + }} + catch (const std::exception&) + {{ + return 0; + }} + }}, + ridA, fractionA, tsA, ridB, fractionB, tsB); + + return VarVal(result); +}} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::Register{nebula_name}PhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{{ + PRECONDITION(arguments.childFunctions.size() == {n_args}, + "{nebula_name}PhysicalFunction requires {n_args} children but got {{}}", + arguments.childFunctions.size()); +{registrar_pushes} +}} + +}} // namespace NES +""" + + +# Physical .cpp template for tpose × static geom dwithin VIA COMPOSITION — +# the tpose composition body (W14) plus a trailing `double dist` forwarded +# to the 3-arg `_tgeo_geo` dwithin call. 6 SQL args: x, y, theta, ts, +# geometry, dist. +PHYSICAL_CPP_TEMPLATE_TPOSE_POINT_WITH_DIST_VIA_COMPOSITION = """\ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" {{ +#include +#include +#include +}} + +namespace NES {{ + +{nebula_name}PhysicalFunction::{nebula_name}PhysicalFunction({ctor_physical_args}) +{{ + parameterFunctions.reserve({n_args}); +{ctor_physical_pushes} +}} + +VarVal {nebula_name}PhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + {{ + parameterValues.emplace_back(function.execute(record, arena)); + }} + + auto x = parameterValues[0].cast>(); + auto y = parameterValues[1].cast>(); + auto theta = parameterValues[2].cast>(); + auto timestamp = parameterValues[3].cast>(); + auto geometry = parameterValues[4].cast(); + auto dist = parameterValues[5].cast>(); + + const auto result = nautilus::invoke( + +[](double xValue, double yValue, double thetaValue, uint64_t timestampValue, + const char* geometryPtr, uint32_t geometrySize, double distValue) -> {return_type} {{ + try + {{ + MEOS::Meos::ensureMeosInitialized(); + if (!(xValue >= -180.0 && xValue <= 180.0 && yValue >= -90.0 && yValue <= 90.0)) return 0; + + const std::string timestampString = MEOS::Meos::convertEpochToTimestamp(timestampValue); + std::string tposeWkt = fmt::format("Pose(Point({{}} {{}}), {{}})@{{}}", + xValue, yValue, thetaValue, timestampString); + std::string staticGeometryWkt(geometryPtr, geometrySize); + + while (!staticGeometryWkt.empty() && (staticGeometryWkt.front() == '\\'' || staticGeometryWkt.front() == '"')) + staticGeometryWkt.erase(staticGeometryWkt.begin()); + while (!staticGeometryWkt.empty() && (staticGeometryWkt.back() == '\\'' || staticGeometryWkt.back() == '"')) + staticGeometryWkt.pop_back(); + + if (tposeWkt.empty() || staticGeometryWkt.empty()) return 0; + + Temporal* tpose = tpose_in(tposeWkt.c_str()); + if (!tpose) return 0; + Temporal* tgeo = tpose_to_tpoint(tpose); + if (!tgeo) {{ free(tpose); return 0; }} + MEOS::Meos::StaticGeometry staticGeometry(staticGeometryWkt); + if (!staticGeometry.getGeometry()) {{ free(tgeo); free(tpose); return 0; }} + + {return_type} r = {meos_call}(tgeo, staticGeometry.getGeometry(), distValue); + free(tgeo); + free(tpose); + return r; + }} + catch (const std::exception&) + {{ + return 0; + }} + }}, + x, y, theta, timestamp, geometry.getContent(), geometry.getContentSize(), dist); + + return VarVal(result); +}} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::Register{nebula_name}PhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{{ + PRECONDITION(arguments.childFunctions.size() == {n_args}, + "{nebula_name}PhysicalFunction requires {n_args} children but got {{}}", + arguments.childFunctions.size()); +{registrar_pushes} +}} + +}} // namespace NES +""" + + +# Physical .cpp template for tpose × tpose dwithin VIA COMPOSITION — the +# two-tpose composition body (W15) plus a trailing `double dist` forwarded +# to the 3-arg `_tgeo_tgeo` dwithin call. 9 SQL args. +PHYSICAL_CPP_TEMPLATE_TWO_TPOSE_POINTS_WITH_DIST_VIA_COMPOSITION = """\ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" {{ +#include +#include +#include +}} + +namespace NES {{ + +{nebula_name}PhysicalFunction::{nebula_name}PhysicalFunction({ctor_physical_args}) +{{ + parameterFunctions.reserve({n_args}); +{ctor_physical_pushes} +}} + +VarVal {nebula_name}PhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + {{ + parameterValues.emplace_back(function.execute(record, arena)); + }} + + auto xA = parameterValues[0].cast>(); + auto yA = parameterValues[1].cast>(); + auto thetaA = parameterValues[2].cast>(); + auto tsA = parameterValues[3].cast>(); + auto xB = parameterValues[4].cast>(); + auto yB = parameterValues[5].cast>(); + auto thetaB = parameterValues[6].cast>(); + auto tsB = parameterValues[7].cast>(); + auto dist = parameterValues[8].cast>(); + + const auto result = nautilus::invoke( + +[](double xAValue, double yAValue, double thetaAValue, uint64_t tsAValue, + double xBValue, double yBValue, double thetaBValue, uint64_t tsBValue, + double distValue) -> {return_type} {{ + try + {{ + MEOS::Meos::ensureMeosInitialized(); + if (!(xAValue >= -180.0 && xAValue <= 180.0 && yAValue >= -90.0 && yAValue <= 90.0)) return 0; + if (!(xBValue >= -180.0 && xBValue <= 180.0 && yBValue >= -90.0 && yBValue <= 90.0)) return 0; + + const std::string tsAString = MEOS::Meos::convertEpochToTimestamp(tsAValue); + const std::string tsBString = MEOS::Meos::convertEpochToTimestamp(tsBValue); + std::string tposeAWkt = fmt::format("Pose(Point({{}} {{}}), {{}})@{{}}", xAValue, yAValue, thetaAValue, tsAString); + std::string tposeBWkt = fmt::format("Pose(Point({{}} {{}}), {{}})@{{}}", xBValue, yBValue, thetaBValue, tsBString); + + if (tposeAWkt.empty() || tposeBWkt.empty()) return 0; + + Temporal* tposeA = tpose_in(tposeAWkt.c_str()); + if (!tposeA) return 0; + Temporal* tgeoA = tpose_to_tpoint(tposeA); + if (!tgeoA) {{ free(tposeA); return 0; }} + Temporal* tposeB = tpose_in(tposeBWkt.c_str()); + if (!tposeB) {{ free(tgeoA); free(tposeA); return 0; }} + Temporal* tgeoB = tpose_to_tpoint(tposeB); + if (!tgeoB) {{ free(tposeB); free(tgeoA); free(tposeA); return 0; }} + + {return_type} r = {meos_call}(tgeoA, tgeoB, distValue); + free(tgeoB); + free(tposeB); + free(tgeoA); + free(tposeA); + return r; + }} + catch (const std::exception&) + {{ + return 0; + }} + }}, + xA, yA, thetaA, tsA, xB, yB, thetaB, tsB, dist); + + return VarVal(result); +}} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::Register{nebula_name}PhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{{ + PRECONDITION(arguments.childFunctions.size() == {n_args}, + "{nebula_name}PhysicalFunction requires {n_args} children but got {{}}", + arguments.childFunctions.size()); +{registrar_pushes} +}} + +}} // namespace NES +""" + + +# Physical .cpp template for tnpoint × static geom dwithin VIA COMPOSITION — +# tnpoint composition body (W18) plus a trailing `double dist` forwarded to +# the 3-arg `_tgeo_geo` dwithin call. 5 SQL args: rid, fraction, ts, +# geometry, dist. +PHYSICAL_CPP_TEMPLATE_TNPOINT_POINT_WITH_DIST_VIA_COMPOSITION = """\ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" {{ +#include +#include +#include +}} + +namespace NES {{ + +{nebula_name}PhysicalFunction::{nebula_name}PhysicalFunction({ctor_physical_args}) +{{ + parameterFunctions.reserve({n_args}); +{ctor_physical_pushes} +}} + +VarVal {nebula_name}PhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + {{ + parameterValues.emplace_back(function.execute(record, arena)); + }} + + auto rid = parameterValues[0].cast>(); + auto fraction = parameterValues[1].cast>(); + auto timestamp = parameterValues[2].cast>(); + auto geometry = parameterValues[3].cast(); + auto dist = parameterValues[4].cast>(); + + const auto result = nautilus::invoke( + +[](uint64_t ridValue, double fractionValue, uint64_t timestampValue, + const char* geometryPtr, uint32_t geometrySize, double distValue) -> {return_type} {{ + try + {{ + MEOS::Meos::ensureMeosInitialized(); + + const std::string timestampString = MEOS::Meos::convertEpochToTimestamp(timestampValue); + std::string tnpointWkt = fmt::format("NPoint({{}}, {{}})@{{}}", ridValue, fractionValue, timestampString); + std::string staticGeometryWkt(geometryPtr, geometrySize); + + while (!staticGeometryWkt.empty() && (staticGeometryWkt.front() == '\\'' || staticGeometryWkt.front() == '"')) + staticGeometryWkt.erase(staticGeometryWkt.begin()); + while (!staticGeometryWkt.empty() && (staticGeometryWkt.back() == '\\'' || staticGeometryWkt.back() == '"')) + staticGeometryWkt.pop_back(); + + if (tnpointWkt.empty() || staticGeometryWkt.empty()) return 0; + + Temporal* tnpoint = tnpoint_in(tnpointWkt.c_str()); + if (!tnpoint) return 0; + Temporal* tgeo = tnpoint_to_tgeompoint(tnpoint); + if (!tgeo) {{ free(tnpoint); return 0; }} + MEOS::Meos::StaticGeometry staticGeometry(staticGeometryWkt); + if (!staticGeometry.getGeometry()) {{ free(tgeo); free(tnpoint); return 0; }} + + {return_type} r = {meos_call}(tgeo, staticGeometry.getGeometry(), distValue); + free(tgeo); + free(tnpoint); + return r; + }} + catch (const std::exception&) + {{ + return 0; + }} + }}, + rid, fraction, timestamp, geometry.getContent(), geometry.getContentSize(), dist); + + return VarVal(result); +}} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::Register{nebula_name}PhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{{ + PRECONDITION(arguments.childFunctions.size() == {n_args}, + "{nebula_name}PhysicalFunction requires {n_args} children but got {{}}", + arguments.childFunctions.size()); +{registrar_pushes} +}} + +}} // namespace NES +""" + + +# Physical .cpp template for tnpoint × tnpoint dwithin VIA COMPOSITION — the +# two-tnpoint composition body (W18) plus a trailing `double dist` forwarded +# to the 3-arg `_tgeo_tgeo` dwithin call. 7 SQL args. +PHYSICAL_CPP_TEMPLATE_TWO_TNPOINT_POINTS_WITH_DIST_VIA_COMPOSITION = """\ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" {{ +#include +#include +#include +}} + +namespace NES {{ + +{nebula_name}PhysicalFunction::{nebula_name}PhysicalFunction({ctor_physical_args}) +{{ + parameterFunctions.reserve({n_args}); +{ctor_physical_pushes} +}} + +VarVal {nebula_name}PhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + {{ + parameterValues.emplace_back(function.execute(record, arena)); + }} + + auto ridA = parameterValues[0].cast>(); + auto fractionA = parameterValues[1].cast>(); + auto tsA = parameterValues[2].cast>(); + auto ridB = parameterValues[3].cast>(); + auto fractionB = parameterValues[4].cast>(); + auto tsB = parameterValues[5].cast>(); + auto dist = parameterValues[6].cast>(); + + const auto result = nautilus::invoke( + +[](uint64_t ridAValue, double fractionAValue, uint64_t tsAValue, + uint64_t ridBValue, double fractionBValue, uint64_t tsBValue, + double distValue) -> {return_type} {{ + try + {{ + MEOS::Meos::ensureMeosInitialized(); + + const std::string tsAString = MEOS::Meos::convertEpochToTimestamp(tsAValue); + const std::string tsBString = MEOS::Meos::convertEpochToTimestamp(tsBValue); + std::string tnpointAWkt = fmt::format("NPoint({{}}, {{}})@{{}}", ridAValue, fractionAValue, tsAString); + std::string tnpointBWkt = fmt::format("NPoint({{}}, {{}})@{{}}", ridBValue, fractionBValue, tsBString); + + if (tnpointAWkt.empty() || tnpointBWkt.empty()) return 0; + + Temporal* tnpointA = tnpoint_in(tnpointAWkt.c_str()); + if (!tnpointA) return 0; + Temporal* tgeoA = tnpoint_to_tgeompoint(tnpointA); + if (!tgeoA) {{ free(tnpointA); return 0; }} + Temporal* tnpointB = tnpoint_in(tnpointBWkt.c_str()); + if (!tnpointB) {{ free(tgeoA); free(tnpointA); return 0; }} + Temporal* tgeoB = tnpoint_to_tgeompoint(tnpointB); + if (!tgeoB) {{ free(tnpointB); free(tgeoA); free(tnpointA); return 0; }} + + {return_type} r = {meos_call}(tgeoA, tgeoB, distValue); + free(tgeoB); + free(tnpointB); + free(tgeoA); + free(tnpointA); + return r; + }} + catch (const std::exception&) + {{ + return 0; + }} + }}, + ridA, fractionA, tsA, ridB, fractionB, tsB, dist); + + return VarVal(result); +}} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::Register{nebula_name}PhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{{ + PRECONDITION(arguments.childFunctions.size() == {n_args}, + "{nebula_name}PhysicalFunction requires {n_args} children but got {{}}", + arguments.childFunctions.size()); +{registrar_pushes} +}} + +}} // namespace NES +""" + + +# Physical .cpp template for one-tcbuffer-point + static geom + dist — +# e.g. edwithin_tcbuffer_geo. Same per-event tcbuffer construction as +# PHYSICAL_CPP_TEMPLATE_TCBUFFER_POINT but trailing `double dist`. +# 6 SQL args: lon, lat, radius, ts, geometry, dist. +PHYSICAL_CPP_TEMPLATE_TCBUFFER_POINT_WITH_DIST = """\ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" {{ +#include +#include +}} + +namespace NES {{ + +{nebula_name}PhysicalFunction::{nebula_name}PhysicalFunction({ctor_physical_args}) +{{ + parameterFunctions.reserve({n_args}); +{ctor_physical_pushes} +}} + +VarVal {nebula_name}PhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + {{ + parameterValues.emplace_back(function.execute(record, arena)); + }} + + auto lon = parameterValues[0].cast>(); + auto lat = parameterValues[1].cast>(); + auto radius = parameterValues[2].cast>(); + auto timestamp = parameterValues[3].cast>(); + auto geometry = parameterValues[4].cast(); + auto dist = parameterValues[5].cast>(); + + const auto result = nautilus::invoke( + +[](double lonValue, double latValue, double radiusValue, uint64_t timestampValue, + const char* geometryPtr, uint32_t geometrySize, double distValue) -> {return_type} {{ + try + {{ + MEOS::Meos::ensureMeosInitialized(); + if (!(lonValue >= -180.0 && lonValue <= 180.0 && latValue >= -90.0 && latValue <= 90.0)) return 0; + if (radiusValue < 0.0) return 0; + + const std::string timestampString = MEOS::Meos::convertEpochToTimestamp(timestampValue); + std::string tcbufferWkt = fmt::format("Cbuffer(Point({{}} {{}}),{{}})@{{}}", + lonValue, latValue, radiusValue, timestampString); + std::string staticGeometryWkt(geometryPtr, geometrySize); + + while (!staticGeometryWkt.empty() && (staticGeometryWkt.front() == '\\'' || staticGeometryWkt.front() == '"')) + staticGeometryWkt.erase(staticGeometryWkt.begin()); + while (!staticGeometryWkt.empty() && (staticGeometryWkt.back() == '\\'' || staticGeometryWkt.back() == '"')) + staticGeometryWkt.pop_back(); + + if (tcbufferWkt.empty() || staticGeometryWkt.empty()) return 0; + + Temporal* tcbuffer = tcbuffer_in(tcbufferWkt.c_str()); + if (!tcbuffer) return 0; + MEOS::Meos::StaticGeometry staticGeometry(staticGeometryWkt); + if (!staticGeometry.getGeometry()) {{ free(tcbuffer); return 0; }} + + {return_type} r = {meos_call}(tcbuffer, staticGeometry.getGeometry(), distValue); + free(tcbuffer); + return r; + }} + catch (const std::exception&) + {{ + return 0; + }} + }}, + lon, lat, radius, timestamp, geometry.getContent(), geometry.getContentSize(), dist); + + return VarVal(result); +}} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::Register{nebula_name}PhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{{ + PRECONDITION(arguments.childFunctions.size() == {n_args}, + "{nebula_name}PhysicalFunction requires {n_args} children but got {{}}", + arguments.childFunctions.size()); +{registrar_pushes} +}} + +}} // namespace NES +""" + +# Physical .cpp template for one-tcbuffer-point + static Cbuffer + dist — +# e.g. edwithin_tcbuffer_cbuffer. +# 6 SQL args: lon, lat, radius, ts, cbufferLiteral, dist. +PHYSICAL_CPP_TEMPLATE_TCBUFFER_POINT_CBUFFER_WITH_DIST = """\ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" {{ +#include +#include +}} + +namespace NES {{ + +{nebula_name}PhysicalFunction::{nebula_name}PhysicalFunction({ctor_physical_args}) +{{ + parameterFunctions.reserve({n_args}); +{ctor_physical_pushes} +}} + +VarVal {nebula_name}PhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + {{ + parameterValues.emplace_back(function.execute(record, arena)); + }} + + auto lon = parameterValues[0].cast>(); + auto lat = parameterValues[1].cast>(); + auto radius = parameterValues[2].cast>(); + auto timestamp = parameterValues[3].cast>(); + auto cbufLit = parameterValues[4].cast(); + auto dist = parameterValues[5].cast>(); + + const auto result = nautilus::invoke( + +[](double lonValue, double latValue, double radiusValue, uint64_t timestampValue, + const char* cbufLitPtr, uint32_t cbufLitSize, double distValue) -> {return_type} {{ + try + {{ + MEOS::Meos::ensureMeosInitialized(); + if (!(lonValue >= -180.0 && lonValue <= 180.0 && latValue >= -90.0 && latValue <= 90.0)) return 0; + if (radiusValue < 0.0) return 0; + + const std::string timestampString = MEOS::Meos::convertEpochToTimestamp(timestampValue); + std::string tcbufferWkt = fmt::format("Cbuffer(Point({{}} {{}}),{{}})@{{}}", + lonValue, latValue, radiusValue, timestampString); + std::string cbufferLiteral(cbufLitPtr, cbufLitSize); + + while (!cbufferLiteral.empty() && (cbufferLiteral.front() == '\\'' || cbufferLiteral.front() == '"')) + cbufferLiteral.erase(cbufferLiteral.begin()); + while (!cbufferLiteral.empty() && (cbufferLiteral.back() == '\\'' || cbufferLiteral.back() == '"')) + cbufferLiteral.pop_back(); + + if (tcbufferWkt.empty() || cbufferLiteral.empty()) return 0; + + Temporal* tcbuffer = tcbuffer_in(tcbufferWkt.c_str()); + if (!tcbuffer) return 0; + Cbuffer* cb = cbuffer_in(cbufferLiteral.c_str()); + if (!cb) {{ free(tcbuffer); return 0; }} + + {return_type} r = {meos_call}(tcbuffer, cb, distValue); + free(tcbuffer); + free(cb); + return r; + }} + catch (const std::exception&) + {{ + return 0; + }} + }}, + lon, lat, radius, timestamp, cbufLit.getContent(), cbufLit.getContentSize(), dist); + + return VarVal(result); +}} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::Register{nebula_name}PhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{{ + PRECONDITION(arguments.childFunctions.size() == {n_args}, + "{nebula_name}PhysicalFunction requires {n_args} children but got {{}}", + arguments.childFunctions.size()); +{registrar_pushes} +}} + +}} // namespace NES +""" + +# Physical .cpp template for two-tcbuffer-points + dist — e.g. +# edwithin_tcbuffer_tcbuffer. 9 SQL args: lonA, latA, radiusA, tsA, +# lonB, latB, radiusB, tsB, dist. +PHYSICAL_CPP_TEMPLATE_TWO_TCBUFFER_POINTS_WITH_DIST = """\ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" {{ +#include +#include +}} + +namespace NES {{ + +{nebula_name}PhysicalFunction::{nebula_name}PhysicalFunction({ctor_physical_args}) +{{ + parameterFunctions.reserve({n_args}); +{ctor_physical_pushes} +}} + +VarVal {nebula_name}PhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + {{ + parameterValues.emplace_back(function.execute(record, arena)); + }} + + auto lonA = parameterValues[0].cast>(); + auto latA = parameterValues[1].cast>(); + auto radiusA = parameterValues[2].cast>(); + auto tsA = parameterValues[3].cast>(); + auto lonB = parameterValues[4].cast>(); + auto latB = parameterValues[5].cast>(); + auto radiusB = parameterValues[6].cast>(); + auto tsB = parameterValues[7].cast>(); + auto dist = parameterValues[8].cast>(); + + const auto result = nautilus::invoke( + +[](double lonAValue, double latAValue, double radiusAValue, uint64_t tsAValue, + double lonBValue, double latBValue, double radiusBValue, uint64_t tsBValue, + double distValue) -> {return_type} {{ + try + {{ + MEOS::Meos::ensureMeosInitialized(); + if (!(lonAValue >= -180.0 && lonAValue <= 180.0 && latAValue >= -90.0 && latAValue <= 90.0)) return 0; + if (!(lonBValue >= -180.0 && lonBValue <= 180.0 && latBValue >= -90.0 && latBValue <= 90.0)) return 0; + if (radiusAValue < 0.0 || radiusBValue < 0.0) return 0; + + const std::string tsAString = MEOS::Meos::convertEpochToTimestamp(tsAValue); + const std::string tsBString = MEOS::Meos::convertEpochToTimestamp(tsBValue); + std::string wktA = fmt::format("Cbuffer(Point({{}} {{}}),{{}})@{{}}", lonAValue, latAValue, radiusAValue, tsAString); + std::string wktB = fmt::format("Cbuffer(Point({{}} {{}}),{{}})@{{}}", lonBValue, latBValue, radiusBValue, tsBString); + + Temporal* tA = tcbuffer_in(wktA.c_str()); + if (!tA) return 0; + Temporal* tB = tcbuffer_in(wktB.c_str()); + if (!tB) {{ free(tA); return 0; }} + + {return_type} r = {meos_call}(tA, tB, distValue); + free(tA); + free(tB); + return r; + }} + catch (const std::exception&) + {{ + return 0; + }} + }}, + lonA, latA, radiusA, tsA, lonB, latB, radiusB, tsB, dist); + + return VarVal(result); +}} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::Register{nebula_name}PhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{{ + PRECONDITION(arguments.childFunctions.size() == {n_args}, + "{nebula_name}PhysicalFunction requires {n_args} children but got {{}}", + arguments.childFunctions.size()); +{registrar_pushes} +}} + +}} // namespace NES +""" + + +# Physical .cpp template for TWO tcbuffer points (no static arg) — e.g. +# eintersects_tcbuffer_tcbuffer. Two per-event tcbuffer instants built +# from (lonA, latA, radiusA, tsA) and (lonB, latB, radiusB, tsB). +# MEOS signature: `int fn(const Temporal*, const Temporal*)`. +# 8 SQL args. +PHYSICAL_CPP_TEMPLATE_TWO_TCBUFFER_POINTS = """\ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" {{ +#include +#include +}} + +namespace NES {{ + +{nebula_name}PhysicalFunction::{nebula_name}PhysicalFunction({ctor_physical_args}) +{{ + parameterFunctions.reserve({n_args}); +{ctor_physical_pushes} +}} + +VarVal {nebula_name}PhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + {{ + parameterValues.emplace_back(function.execute(record, arena)); + }} + + auto lonA = parameterValues[0].cast>(); + auto latA = parameterValues[1].cast>(); + auto radiusA = parameterValues[2].cast>(); + auto tsA = parameterValues[3].cast>(); + auto lonB = parameterValues[4].cast>(); + auto latB = parameterValues[5].cast>(); + auto radiusB = parameterValues[6].cast>(); + auto tsB = parameterValues[7].cast>(); + + const auto result = nautilus::invoke( + +[](double lonAValue, double latAValue, double radiusAValue, uint64_t tsAValue, + double lonBValue, double latBValue, double radiusBValue, uint64_t tsBValue) -> {return_type} {{ + try + {{ + MEOS::Meos::ensureMeosInitialized(); + if (!(lonAValue >= -180.0 && lonAValue <= 180.0 && latAValue >= -90.0 && latAValue <= 90.0)) return 0; + if (!(lonBValue >= -180.0 && lonBValue <= 180.0 && latBValue >= -90.0 && latBValue <= 90.0)) return 0; + if (radiusAValue < 0.0 || radiusBValue < 0.0) return 0; + + const std::string tsAString = MEOS::Meos::convertEpochToTimestamp(tsAValue); + const std::string tsBString = MEOS::Meos::convertEpochToTimestamp(tsBValue); + std::string wktA = fmt::format("Cbuffer(Point({{}} {{}}),{{}})@{{}}", lonAValue, latAValue, radiusAValue, tsAString); + std::string wktB = fmt::format("Cbuffer(Point({{}} {{}}),{{}})@{{}}", lonBValue, latBValue, radiusBValue, tsBString); + + Temporal* tA = tcbuffer_in(wktA.c_str()); + if (!tA) return 0; + Temporal* tB = tcbuffer_in(wktB.c_str()); + if (!tB) {{ free(tA); return 0; }} + + {return_type} r = {meos_call}(tA, tB); + free(tA); + free(tB); + return r; + }} + catch (const std::exception&) + {{ + return 0; + }} + }}, + lonA, latA, radiusA, tsA, lonB, latB, radiusB, tsB); + + return VarVal(result); +}} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::Register{nebula_name}PhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{{ + PRECONDITION(arguments.childFunctions.size() == {n_args}, + "{nebula_name}PhysicalFunction requires {n_args} children but got {{}}", + arguments.childFunctions.size()); +{registrar_pushes} +}} + +}} // namespace NES +""" + + +# Physical .cpp template for one-tcbuffer-point operators with a STATIC +# CBUFFER second arg — e.g. econtains_tcbuffer_cbuffer. Same per-event +# tcbuffer construction as PHYSICAL_CPP_TEMPLATE_TCBUFFER_POINT; the +# second arg is parsed via cbuffer_in() from a literal WKT +# "Cbuffer(Point(lon lat),radius)" instead of as a GSERIALIZED geometry. +# MEOS signature: `int fn(const Temporal*, const Cbuffer*)`. +# 5 SQL args: lon, lat, radius, ts, cbufferLiteral. +PHYSICAL_CPP_TEMPLATE_TCBUFFER_POINT_CBUFFER = """\ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" {{ +#include +#include +}} + +namespace NES {{ + +{nebula_name}PhysicalFunction::{nebula_name}PhysicalFunction({ctor_physical_args}) +{{ + parameterFunctions.reserve({n_args}); +{ctor_physical_pushes} +}} + +VarVal {nebula_name}PhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + {{ + parameterValues.emplace_back(function.execute(record, arena)); + }} + + auto lon = parameterValues[0].cast>(); + auto lat = parameterValues[1].cast>(); + auto radius = parameterValues[2].cast>(); + auto timestamp = parameterValues[3].cast>(); + auto cbufLit = parameterValues[4].cast(); + + const auto result = nautilus::invoke( + +[](double lonValue, + double latValue, + double radiusValue, + uint64_t timestampValue, + const char* cbufLitPtr, + uint32_t cbufLitSize) -> {return_type} {{ + try + {{ + MEOS::Meos::ensureMeosInitialized(); + if (!(lonValue >= -180.0 && lonValue <= 180.0 && latValue >= -90.0 && latValue <= 90.0)) return 0; + if (radiusValue < 0.0) return 0; + + const std::string timestampString = MEOS::Meos::convertEpochToTimestamp(timestampValue); + std::string tcbufferWkt = fmt::format("Cbuffer(Point({{}} {{}}),{{}})@{{}}", + lonValue, latValue, radiusValue, timestampString); + std::string cbufferLiteral(cbufLitPtr, cbufLitSize); + + while (!cbufferLiteral.empty() && (cbufferLiteral.front() == '\\'' || cbufferLiteral.front() == '"')) + cbufferLiteral.erase(cbufferLiteral.begin()); + while (!cbufferLiteral.empty() && (cbufferLiteral.back() == '\\'' || cbufferLiteral.back() == '"')) + cbufferLiteral.pop_back(); + + if (tcbufferWkt.empty() || cbufferLiteral.empty()) return 0; + + Temporal* tcbuffer = tcbuffer_in(tcbufferWkt.c_str()); + if (!tcbuffer) return 0; + Cbuffer* cb = cbuffer_in(cbufferLiteral.c_str()); + if (!cb) {{ free(tcbuffer); return 0; }} + + {return_type} r = {meos_call}(tcbuffer, cb); + free(tcbuffer); + free(cb); + return r; + }} + catch (const std::exception&) + {{ + return 0; + }} + }}, + lon, lat, radius, timestamp, cbufLit.getContent(), cbufLit.getContentSize()); + + return VarVal(result); +}} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::Register{nebula_name}PhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{{ + PRECONDITION(arguments.childFunctions.size() == {n_args}, + "{nebula_name}PhysicalFunction requires {n_args} children but got {{}}", + arguments.childFunctions.size()); +{registrar_pushes} +}} + +}} // namespace NES +""" + + +# Physical .cpp template for one-tnumber-point operators with a trailing +# scalar (double or int) — e.g. nad_tfloat_float, nad_tint_int. The MEOS +# call signature is ` fn(const Temporal*, )`. +# 3 args: value, timestamp, scalar. +PHYSICAL_CPP_TEMPLATE_TNUMBER_POINT_WITH_SCALAR = """\ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" {{ +#include +#include +}} + +namespace NES {{ + +{nebula_name}PhysicalFunction::{nebula_name}PhysicalFunction({ctor_physical_args}) +{{ + parameterFunctions.reserve({n_args}); +{ctor_physical_pushes} +}} + +VarVal {nebula_name}PhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value = parameterValues[0].cast>(); + auto threshold = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double value, double threshold, uint64_t ts) -> double {{ + try {{ + MEOS::Meos::ensureMeosInitialized(); + std::string tempWkt = fmt::format("{tnumber_wkt_format}", {value_fmt_expr}, MEOS::Meos::convertEpochToTimestamp(ts)); + Temporal* temp = {tnumber_in_fn}(tempWkt.c_str()); + if (!temp) return 0.0; + int r = {meos_call}(temp, {threshold_call_expr}); + free(temp); + return static_cast(r); + }} catch (const std::exception&) {{ return 0.0; }} + }}, + value, threshold, ts); + + return VarVal(result); +}} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::Register{nebula_name}PhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{{ + PRECONDITION(arguments.childFunctions.size() == {n_args}, + "{nebula_name}PhysicalFunction requires {n_args} children but got {{}}", + arguments.childFunctions.size()); +{registrar_pushes} +}} + +}} // namespace NES +""" + +# Physical .cpp template for two-tnumber-point operators (e.g. nad_tfloat_tfloat, +# nad_tint_tint). MEOS signature ` fn(const Temporal*, const Temporal*)`. +# 4 args: valueA, tsA, valueB, tsB. +PHYSICAL_CPP_TEMPLATE_TWO_TNUMBER_POINTS = """\ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" {{ +#include +#include +}} + +namespace NES {{ + +{nebula_name}PhysicalFunction::{nebula_name}PhysicalFunction({ctor_physical_args}) +{{ + parameterFunctions.reserve({n_args}); +{ctor_physical_pushes} +}} + +VarVal {nebula_name}PhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto value1 = parameterValues[0].cast>(); + auto value2 = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double v1, double v2, uint64_t t) -> double {{ + try {{ + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt1 = fmt::format("{tnumber_wkt_format}", {value1_fmt_expr}, ts_str); + std::string wkt2 = fmt::format("{tnumber_wkt_format}", {value2_fmt_expr}, ts_str); + Temporal* temp1 = {tnumber_in_fn}(wkt1.c_str()); + if (!temp1) return 0.0; + Temporal* temp2 = {tnumber_in_fn}(wkt2.c_str()); + if (!temp2) {{ free(temp1); return 0.0; }} + int r = {meos_call}(temp1, temp2); + free(temp1); + free(temp2); + return static_cast(r); + }} catch (const std::exception&) {{ return 0.0; }} + }}, + value1, value2, ts); + + return VarVal(result); +}} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::Register{nebula_name}PhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{{ + PRECONDITION(arguments.childFunctions.size() == {n_args}, + "{nebula_name}PhysicalFunction requires {n_args} children but got {{}}", + arguments.childFunctions.size()); +{registrar_pushes} +}} + +}} // namespace NES +""" + + +# Physical .cpp for scalar-FIRST tnumber operators — the MEOS signature is +# ` fn(scalar, const Temporal*)` (e.g. ever_eq_float_tfloat, +# always_lt_int_tint). Identical to TNUMBER_POINT_WITH_SCALAR except the MEOS +# call passes the scalar as the FIRST argument. Per-event SQL shape is still +# (value, timestamp, scalar) so it reuses DISPATCH_CASE_TNUMBER_POINT_WITH_SCALAR. +PHYSICAL_CPP_TEMPLATE_TNUMBER_SCALAR_FIRST = """\ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" {{ +#include +#include +}} + +namespace NES {{ + +{nebula_name}PhysicalFunction::{nebula_name}PhysicalFunction({ctor_physical_args}) +{{ + parameterFunctions.reserve({n_args}); +{ctor_physical_pushes} +}} + +VarVal {nebula_name}PhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + parameterValues.emplace_back(function.execute(record, arena)); + + auto scalar = parameterValues[0].cast>(); + auto value = parameterValues[1].cast>(); + auto ts = parameterValues[2].cast>(); + + const auto result = nautilus::invoke( + +[](double d, double v, uint64_t t) -> double {{ + try {{ + MEOS::Meos::ensureMeosInitialized(); + std::string ts_str = MEOS::Meos::convertEpochToTimestamp(t); + std::string wkt = fmt::format("{tnumber_wkt_format}", {value_fmt_expr}, ts_str); + Temporal* temp = {tnumber_in_fn}(wkt.c_str()); + if (!temp) return 0.0; + int r = {meos_call}({scalar_call_expr}, temp); + free(temp); + return static_cast(r); + }} catch (const std::exception&) {{ return 0.0; }} + }}, + scalar, value, ts); + + return VarVal(result); +}} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::Register{nebula_name}PhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{{ + PRECONDITION(arguments.childFunctions.size() == {n_args}, + "{nebula_name}PhysicalFunction requires {n_args} children but got {{}}", + arguments.childFunctions.size()); +{registrar_pushes} +}} + +}} // namespace NES +""" + + +# =========================================================================== +# Generalized per-event operator assembler (the "generic" shape). +# +# Composes a physical .cpp from three orthogonal parts instead of a hand-written +# template per shape: +# - INPUT builder : how to construct the primary `Temporal* temp` of a +# given temporal type from per-event fields, +# - EXTRA args : 0+ trailing MEOS args (scalar / static geometry), +# - RETURN marshaler : how the scalar MEOS return becomes the VarVal. +# Scope: Temporal-input operators with a SCALAR return (int/double/bool) — the +# proven lambda-returns-scalar pattern. Variable-sized (text*/GSERIALIZED*) and +# Temporal*-extract returns, and Set/Span/Box inputs, are out of this assembler. +# =========================================================================== + +# input_type -> dict(fields=[(name,cpp)], header, build) where build is C++ that +# defines `Temporal* {var}` (NULL-checked) from the fields. {z} = zero-return literal. +GENERIC_INPUTS = { + "tgeompoint": dict(fields=[("lon", "double"), ("lat", "double"), ("ts", "uint64_t")], header="meos_geo.h", build=( + ' if (!(lon >= -180.0 && lon <= 180.0 && lat >= -90.0 && lat <= 90.0)) return {z};\n' + ' std::string {var}Wkt = fmt::format("SRID=4326;Point({{}} {{}})@{{}}", lon, lat, MEOS::Meos::convertEpochToTimestamp(ts));\n' + ' Temporal* {var} = tgeompoint_in({var}Wkt.c_str());\n' + ' if (!{var}) return {z};\n')), + "tgeometry": dict(fields=[("geomWkt", "VariableSizedData"), ("ts", "uint64_t")], header="meos_geo.h", build=( + ' std::string {var}G(geomWktPtr, geomWktSize);\n' + ' std::string {var}Wkt = {var}G + "@" + MEOS::Meos::convertEpochToTimestamp(ts);\n' + ' Temporal* {var} = tgeometry_in({var}Wkt.c_str());\n' + ' if (!{var}) return {z};\n')), + "tcbuffer": dict(fields=[("lon", "double"), ("lat", "double"), ("radius", "double"), ("ts", "uint64_t")], header="meos_cbuffer.h", build=( + ' if (!(lon >= -180.0 && lon <= 180.0 && lat >= -90.0 && lat <= 90.0) || radius < 0.0) return {z};\n' + ' std::string {var}Wkt = fmt::format("Cbuffer(Point({{}} {{}}),{{}})@{{}}", lon, lat, radius, MEOS::Meos::convertEpochToTimestamp(ts));\n' + ' Temporal* {var} = tcbuffer_in({var}Wkt.c_str());\n' + ' if (!{var}) return {z};\n')), + "tpose": dict(fields=[("x", "double"), ("y", "double"), ("theta", "double"), ("ts", "uint64_t")], header="meos_pose.h", build=( + ' std::string {var}Wkt = fmt::format("Pose(Point({{}} {{}}),{{}})@{{}}", x, y, theta, MEOS::Meos::convertEpochToTimestamp(ts));\n' + ' Temporal* {var} = tpose_in({var}Wkt.c_str());\n' + ' if (!{var}) return {z};\n')), + "tnpoint": dict(fields=[("rid", "int64_t"), ("frac", "double"), ("ts", "uint64_t")], header="meos_npoint.h", build=( + ' if (frac < 0.0 || frac > 1.0) return {z};\n' + ' std::string {var}Wkt = fmt::format("NPoint({{}},{{}})@{{}}", rid, frac, MEOS::Meos::convertEpochToTimestamp(ts));\n' + ' Temporal* {var} = tnpoint_in({var}Wkt.c_str());\n' + ' if (!{var}) return {z};\n')), + "tfloat": dict(fields=[("value", "double"), ("ts", "uint64_t")], header="meos_geo.h", build=( + ' std::string {var}Wkt = fmt::format("{{}}@{{}}", value, MEOS::Meos::convertEpochToTimestamp(ts));\n' + ' Temporal* {var} = tfloat_in({var}Wkt.c_str());\n' + ' if (!{var}) return {z};\n')), + "tint": dict(fields=[("value", "int32_t"), ("ts", "uint64_t")], header="meos_geo.h", build=( + ' std::string {var}Wkt = fmt::format("{{}}@{{}}", value, MEOS::Meos::convertEpochToTimestamp(ts));\n' + ' Temporal* {var} = tint_in({var}Wkt.c_str());\n' + ' if (!{var}) return {z};\n')), + "tbool": dict(fields=[("value", "double"), ("ts", "uint64_t")], header="meos_geo.h", build=( + ' std::string {var}Wkt = fmt::format("{{}}@{{}}", value != 0.0 ? "t" : "f", MEOS::Meos::convertEpochToTimestamp(ts));\n' + ' Temporal* {var} = tbool_in({var}Wkt.c_str());\n' + ' if (!{var}) return {z};\n')), + "tbigint": dict(fields=[("value", "double"), ("ts", "uint64_t")], header="meos_geo.h", build=( + ' std::string {var}Wkt = fmt::format("{{}}@{{}}", static_cast(value), MEOS::Meos::convertEpochToTimestamp(ts));\n' + ' Temporal* {var} = tbigint_in({var}Wkt.c_str());\n' + ' if (!{var}) return {z};\n')), + # The efficient mechanism: the operand is an UPSTREAM MEOS value (a windowed + # mini-trip trajectory, or any temporal) carried as a VARSIZED hex-WKB field, + # not rebuilt from per-event scalars. The MEOS function library composes over + # such values like scalar functions over a float. hex-WKB is the (testable, + # ASCII) canonical form; raw WKB is a later optimization. + "wkb_temporal": dict(fields=[("traj", "VariableSizedData")], header="meos_geo.h", build=( + ' std::string {var}Hex(trajPtr, trajSize);\n' + ' Temporal* {var} = temporal_from_hexwkb({var}Hex.c_str());\n' + ' if (!{var}) return {z};\n')), + # A bounding STBox carried as a VARSIZED text field — the per-vehicle + # TSPATIAL_EXTENT output (stbox_out). Used as the first operand of a + # cross-vehicle predicate f(boxA, boxB); the second box is a `box` extra arg + # (also stbox_in). Freed via free(temp) by the generic cleanup. + "stbox_text": dict(fields=[("box", "VariableSizedData")], header="meos_geo.h", build=( + ' std::string {var}S(boxPtr, boxSize);\n' + ' while (!{var}S.empty() && ({var}S.front()==\'\\\'\' || {var}S.front()==\'"\')) {var}S.erase({var}S.begin());\n' + ' while (!{var}S.empty() && ({var}S.back()==\'\\\'\' || {var}S.back()==\'"\')) {var}S.pop_back();\n' + ' STBox* {var} = stbox_in({var}S.c_str());\n' + ' if (!{var}) return {z};\n')), + # th3index temporal instant: 2 fields (cell:uint64, ts:uint64). + # Constructs a Temporal* via th3indexinst_make. Requires meos_h3.h. + "th3index": dict(fields=[("cell", "uint64_t"), ("ts", "uint64_t")], header="meos_h3.h", build=( + ' Temporal* {var} = th3indexinst_make((H3Index)cell, (TimestampTz)ts);\n' + ' if (!{var}) return {z};\n')), + # tquadbin temporal instant: 2 fields (cell:uint64, ts:uint64). + "tquadbin": dict(fields=[("cell", "uint64_t"), ("ts", "uint64_t")], header="meos_quadbin.h", build=( + ' Temporal* {var} = (Temporal*)tquadbininst_make((Quadbin)cell, (TimestampTz)ts);\n' + ' if (!{var}) return {z};\n')), + # ttext temporal instant: 2 fields (value:VARSIZED text string, ts:uint64). + # Strips outer quotes, builds WKT "'value'@ts", parses via ttext_in. + "ttext": dict(fields=[("value", "VariableSizedData"), ("ts", "uint64_t")], header="meos.h", build=( + ' std::string {var}Val(valuePtr, valueSize);\n' + ' while (!{var}Val.empty() && ({var}Val.front() == \'\\\'\' || {var}Val.front() == \'"\')) {var}Val.erase({var}Val.begin());\n' + ' while (!{var}Val.empty() && ({var}Val.back() == \'\\\'\' || {var}Val.back() == \'"\')) {var}Val.pop_back();\n' + ' std::string {var}Wkt = "\'" + {var}Val + "\'@" + MEOS::Meos::convertEpochToTimestamp(ts);\n' + ' Temporal* {var} = ttext_in({var}Wkt.c_str());\n' + ' if (!{var}) return {z};\n')), + # tjsonb temporal instant: 2 fields (json_str:VARSIZED, ts:uint64). + # Parses json_str via jsonb_in, then constructs instant via tjsonbinst_make. + "tjsonb": dict(fields=[("json_str", "VariableSizedData"), ("ts", "uint64_t")], header="meos_json.h", build=( + ' std::string {var}S(json_strPtr, json_strSize);\n' + ' Jsonb* {var}Jb = jsonb_in({var}S.c_str());\n' + ' if (!{var}Jb) return {z};\n' + ' Temporal* {var} = (Temporal*)tjsonbinst_make({var}Jb, (TimestampTz)ts);\n' + ' free({var}Jb);\n' + ' if (!{var}) return {z};\n')), + # static_scalar: no temporal construction; the "build" step is empty. + # All meaningful args are passed via extra_args. Primary fields must be + # declared and the call_terms assembled by the caller via extra_args only. + # Use primary_fields in descriptor to specify the leading fields, and + # extra_args for each call argument. The build string does nothing. + # (Helper: use "static_scalar" as input_type; override primary_fields.) + "static_scalar": dict(fields=[], header="meos.h", build=''), + # geom_wkt: a single geometry carried as a VARSIZED WKT/EWKT field. + # Parses via geom_in(s.c_str(), -1); result is GSERIALIZED* named "temp". + # Freed after the call by the free(temp) in call_marshal (like other temporals). + "geom_wkt": dict(fields=[("wkt", "VariableSizedData")], header="meos_geo.h", build=( + ' std::string {var}S(wktPtr, wktSize);\n' + ' GSERIALIZED* {var} = geom_in({var}S.c_str(), -1);\n' + ' if (!{var}) return {z};\n')), + # geog_wkt: geography variant (carried as VARSIZED WKT); parsed via geog_in. + "geog_wkt": dict(fields=[("wkt", "VariableSizedData")], header="meos_geo.h", build=( + ' std::string {var}S(wktPtr, wktSize);\n' + ' GSERIALIZED* {var} = geog_in({var}S.c_str(), -1);\n' + ' if (!{var}) return {z};\n')), + # jsonb_wkt: a single Jsonb value as a VARSIZED JSON string. + "jsonb_wkt": dict(fields=[("jb", "VariableSizedData")], header="meos_json.h", build=( + ' std::string {var}S(jbPtr, jbSize);\n' + ' Jsonb* {var} = jsonb_in({var}S.c_str());\n' + ' if (!{var}) return {z};\n')), + # text_wkt: a single text value as a VARSIZED string (strips quotes). + "text_wkt": dict(fields=[("str", "VariableSizedData")], header="meos.h", build=( + ' std::string {var}RawStr(strPtr, strSize);\n' + ' while (!{var}RawStr.empty() && ({var}RawStr.front() == \'\\\'\' || {var}RawStr.front() == \'"\')) {var}RawStr.erase({var}RawStr.begin());\n' + ' while (!{var}RawStr.empty() && ({var}RawStr.back() == \'\\\'\' || {var}RawStr.back() == \'"\')) {var}RawStr.pop_back();\n' + ' text* {var} = cstring_to_text({var}RawStr.c_str());\n' + ' if (!{var}) return {z};\n')), + # intspan_wkt: an intspan as VARSIZED text; parsed via intspan_in. + "intspan_wkt": dict(fields=[("sp", "VariableSizedData")], header="meos.h", build=( + ' std::string {var}S(spPtr, spSize);\n' + ' Span* {var} = intspan_in({var}S.c_str());\n' + ' if (!{var}) return {z};\n')), + # floatspan_wkt: a floatspan as VARSIZED text; parsed via floatspan_in. + "floatspan_wkt": dict(fields=[("sp", "VariableSizedData")], header="meos.h", build=( + ' std::string {var}S(spPtr, spSize);\n' + ' Span* {var} = floatspan_in({var}S.c_str());\n' + ' if (!{var}) return {z};\n')), +} + +# return_kind -> (cpp_return_type, nautilus_return, zero_literal, extract_fn|None) +# For a direct scalar return extract_fn is None. For a Temporal*-returning +# transform/restriction whose single-instant result carries a scalar value, the +# extract_fn is the result type's *_start_value accessor (the value at the +# single instant); the wrapper temporal is freed. +GENERIC_RETURNS = { + "int": ("int", "INT32", "0", None), + "double": ("double", "FLOAT64", "0.0", None), + "bool": ("bool", "BOOLEAN", "false", None), + "extract_int": ("int", "INT32", "0", "tint_start_value"), + "extract_double": ("double", "FLOAT64", "0.0", "tfloat_start_value"), + "extract_bool": ("bool", "BOOLEAN", "false", "tbool_start_value"), + "extract_bigint": ("double", "FLOAT64", "0.0", "tbigint_start_value"), + # A Temporal*-returning transform whose result is serialized back to hex-WKB + # and emitted as a VARSIZED field (the cross-operator exchange form). Handled + # by assemble_wkb_output, not the scalar GENERIC_PHYSICAL_TEMPLATE. + "wkb": ("VariableSizedData", "VARSIZED", "nullptr", None), + # VARSIZED output kinds — these route through assemble_varsized_output, + # not the scalar GENERIC_PHYSICAL_TEMPLATE. The zero literal "0u" means + # an empty arena slot (zero actualLen) on error. + # The meos_call returns char* directly (e.g. text_to_cstring, h3index_out, + # quadbin_index_to_string, quadbin_cell_to_quadkey); copied to arena, freed. + "varsized_cstring": ("VariableSizedData", "VARSIZED", "0u", None), + # The meos_call returns GSERIALIZED*; serialise via geo_as_text (WKT), copy to arena. + "varsized_geom": ("VariableSizedData", "VARSIZED", "0u", None), + # The meos_call returns text*; extract via text_to_cstring, copy to arena. + "varsized_text": ("VariableSizedData", "VARSIZED", "0u", None), + # The meos_call returns H3Index (uint64_t); serialise via h3index_out, copy. + "varsized_h3out": ("VariableSizedData", "VARSIZED", "0u", None), + # The meos_call returns Quadbin (uint64_t); serialise via quadbin_index_to_string. + "varsized_quadbin": ("VariableSizedData", "VARSIZED", "0u", None), + # The meos_call returns Temporal* (th3index) whose single-instant value is + # an H3Index; extract via th3index_start_value, serialise via h3index_out. + "varsized_th3index": ("VariableSizedData", "VARSIZED", "0u", None), + # The meos_call returns Temporal* (ttext) whose single-instant value is + # text*; extract via ttext_start_value, then text_to_cstring. + "varsized_ttext": ("VariableSizedData", "VARSIZED", "0u", None), + # The meos_call returns Temporal* (tjsonb) whose single-instant value is + # Jsonb*; extract via tjsonb_start_value, serialise via jsonb_to_cstring. + "varsized_tjsonb": ("VariableSizedData", "VARSIZED", "0u", None), +} + + +def _generic_field_decl(name, cpp): + """Lambda parameter declaration + the cast expression for one event field.""" + if cpp == "VariableSizedData": + return None # handled specially (pointer + size pair) + return cpp + + +def assemble_wkb_output(op): + """Physical .cpp for a per-event op that calls f(Temporal*, Temporal*) -> + Temporal* over two hex-WKB VARSIZED operands and emits the result as a + hex-WKB VARSIZED field. The MEOS call + serialization run inside one + nautilus::invoke (returning the heap hex string); the bytes are then copied + into an arena-allocated VariableSizedData (the canonical VARSIZED-output + idiom, see TemporalDerivativeExpAggregation::lower). A null/empty result + yields a zero-length VARSIZED.""" + name = op["nebula_name"] + headers = {"meos.h", "meos_geo.h"} + for h in op.get("extra_headers", []): + headers.add(h) + inc = "\n".join(f"#include <{h}>" for h in + ["meos.h"] + sorted(h for h in headers if h != "meos.h")) + registrar = "\n".join( + [f" auto arg{i} = std::move(arguments.childFunctions[{i}]);" for i in range(2)] + + [f" return {name}PhysicalFunction(std::move(arg0), std::move(arg1));"]) + physical_args = ("PhysicalFunction trajFunction,\n" + " PhysicalFunction arg0Function") + pushes = (" parameterFunctions.push_back(std::move(trajFunction));\n" + " parameterFunctions.push_back(std::move(arg0Function));") + return GENERIC_PHYSICAL_WKB_TEMPLATE.format( + nebula_name=name, includes=inc, meos_call=op["meos_call"], + ctor_physical_args=physical_args, ctor_physical_pushes=pushes, + registrar_pushes=registrar) + + +def _build_generic_fields_and_parse(op, inp, extras, zero): + """Shared helper: derive (fields, headers, call_terms, parse_lines, box_frees) + for both scalar and VARSIZED output generic operators. + + When the descriptor has ``primary_fields`` (a list of [varname, cpptype] pairs) + on a static_scalar op, those fields are used directly as the lambda parameters + and ``meos_call`` is treated as a complete expression (not appended with + ``(callargs)``). In that case the returned call_terms list is left empty and + the caller detects ``op.get("primary_fields")`` to emit the call expression + verbatim.""" + is_static = (op.get("input_type") == "static_scalar") + pf = op.get("primary_fields") # list of [varname, cpptype] or None + + if pf and is_static: + # primary_fields defines the lambda args directly; meos_call is a verbatim + # expression (already contains casts + varnames). We add the fields to the + # parameter list so the ctor/HPP/registrar signatures are correct, but we + # set call_terms to None to signal "emit meos_call as-is". + fields = [(str(name), str(ctype)) for name, ctype in pf] + headers = {"meos.h", inp["header"]} + for h in op.get("extra_headers", []): + headers.add(h) + call_terms = None # sentinel: caller emits op['meos_call'] verbatim + parse_lines = [] + box_frees = [] + return fields, headers, call_terms, parse_lines, box_frees + + fields = list(inp["fields"]) + headers = {"meos.h", inp["header"]} + for h in op.get("extra_headers", []): + headers.add(h) + + # For static_scalar input, the primary call term is just the extra args; + # there is no "temp" temporal object. + call_terms = [] if is_static else ["temp"] + parse_lines = [] + box_frees = [] + + for i, ex in enumerate(extras): + kind = ex["kind"] + if kind == "scalar": + fields.append((f"arg{i}", ex["cpp"])) + call_terms.append(f"arg{i}") + elif kind == "geom": + fields.append((f"arg{i}", "VariableSizedData")) + headers.add("meos_geo.h") + free_parent = "temp" if not is_static else None + fp = f"free({free_parent}); " if free_parent else "" + parse_lines.append( + f' std::string arg{i}S(arg{i}Ptr, arg{i}Size);\n' + f' while (!arg{i}S.empty() && (arg{i}S.front()==\'\\\'\' || arg{i}S.front()==\'"\')) arg{i}S.erase(arg{i}S.begin());\n' + f' while (!arg{i}S.empty() && (arg{i}S.back()==\'\\\'\' || arg{i}S.back()==\'"\')) arg{i}S.pop_back();\n' + f' MEOS::Meos::StaticGeometry arg{i}G(arg{i}S);\n' + f' if (!arg{i}G.getGeometry()) {{ {fp}return {zero}; }}\n') + call_terms.append(f"arg{i}G.getGeometry()") + elif kind == "box": + fields.append((f"arg{i}", "VariableSizedData")) + headers.add(ex.get("header", "meos.h")) + free_parent = "temp" if not is_static else None + fp = f"free({free_parent}); " if free_parent else "" + parse_lines.append( + f' std::string arg{i}S(arg{i}Ptr, arg{i}Size);\n' + f' while (!arg{i}S.empty() && (arg{i}S.front()==\'\\\'\' || arg{i}S.front()==\'"\')) arg{i}S.erase(arg{i}S.begin());\n' + f' while (!arg{i}S.empty() && (arg{i}S.back()==\'\\\'\' || arg{i}S.back()==\'"\')) arg{i}S.pop_back();\n' + f' {ex["box_type"]}* arg{i}B = {ex["parser"]}(arg{i}S.c_str());\n' + f' if (!arg{i}B) {{ {fp}return {zero}; }}\n') + call_terms.append(f"arg{i}B") + box_frees.append(f"free(arg{i}B);") + elif kind == "wkb_temporal": + fields.append((f"arg{i}", "VariableSizedData")) + headers.add("meos_geo.h") + free_parent = "temp" if not is_static else None + fp = f"free({free_parent}); " if free_parent else "" + parse_lines.append( + f' std::string arg{i}Hex(arg{i}Ptr, arg{i}Size);\n' + f' Temporal* arg{i}T = temporal_from_hexwkb(arg{i}Hex.c_str());\n' + f' if (!arg{i}T) {{ {fp}return {zero}; }}\n') + call_terms.append(f"arg{i}T") + box_frees.append(f"free(arg{i}T);") + elif kind == "bigint_scalar": + fields.append((f"arg{i}", "double")) + call_terms.append(f"static_cast(arg{i})") + elif kind == "bool_scalar": + fields.append((f"arg{i}", "double")) + call_terms.append(f"static_cast(arg{i} != 0.0)") + elif kind == "int_scalar": + fields.append((f"arg{i}", "double")) + call_terms.append(f"static_cast(arg{i})") + elif kind == "uint64_scalar": + # uint64_t argument exposed as uint64_t at Nautilus level (e.g. H3Index, Quadbin) + fields.append((f"arg{i}", "uint64_t")) + cast = ex.get("cast", "") + call_terms.append(f"({cast})arg{i}" if cast else f"arg{i}") + elif kind == "h3index": + # H3Index extra argument: uint64_t field, cast to (H3Index) in call + fields.append((f"arg{i}", "uint64_t")) + call_terms.append(f"(H3Index)arg{i}") + headers.add("meos_h3.h") + elif kind == "quadbin": + # Quadbin extra argument: uint64_t field, cast to (Quadbin) in call + fields.append((f"arg{i}", "uint64_t")) + call_terms.append(f"(Quadbin)arg{i}") + headers.add("meos_quadbin.h") + elif kind == "npoint": + # Static Npoint constructed from (rid:uint64, frac:double) extra fields + fields.append((f"rid{i}", "uint64_t")) + fields.append((f"frac{i}", "double")) + free_parent = "temp" if not is_static else None + fp = f"free({free_parent}); " if free_parent else "" + headers.add("meos_npoint.h") + parse_lines.append( + f' Npoint* np{i} = npoint_make((int64_t)rid{i}, frac{i});\n' + f' if (!np{i}) {{ {fp}return {zero}; }}\n') + call_terms.append(f"np{i}") + box_frees.append(f"free(np{i});") + elif kind == "pose": + # Static Pose constructed from (x:double, y:double, theta:double) extra fields + fields.append((f"px{i}", "double")) + fields.append((f"py{i}", "double")) + fields.append((f"ptheta{i}", "double")) + free_parent = "temp" if not is_static else None + fp = f"free({free_parent}); " if free_parent else "" + headers.add("meos_pose.h") + parse_lines.append( + f' Pose* pose{i} = pose_make_2d(px{i}, py{i}, ptheta{i}, false, 0);\n' + f' if (!pose{i}) {{ {fp}return {zero}; }}\n') + call_terms.append(f"pose{i}") + box_frees.append(f"free(pose{i});") + elif kind == "text_varsized": + # text* constructed from a VARSIZED cstring (strips outer quotes) + fields.append((f"arg{i}", "VariableSizedData")) + free_parent = "temp" if not is_static else None + fp = f"free({free_parent}); " if free_parent else "" + parse_lines.append( + f' std::string arg{i}S(arg{i}Ptr, arg{i}Size);\n' + f' while (!arg{i}S.empty() && (arg{i}S.front() == \'\\\'\' || arg{i}S.front() == \'"\')) arg{i}S.erase(arg{i}S.begin());\n' + f' while (!arg{i}S.empty() && (arg{i}S.back() == \'\\\'\' || arg{i}S.back() == \'"\')) arg{i}S.pop_back();\n' + f' text* txt{i} = cstring_to_text(arg{i}S.c_str());\n' + f' if (!txt{i}) {{ {fp}return {zero}; }}\n') + call_terms.append(f"txt{i}") + box_frees.append(f"free(txt{i});") + elif kind == "jsonb_varsized": + # Jsonb* constructed from a VARSIZED JSON string + fields.append((f"arg{i}", "VariableSizedData")) + free_parent = "temp" if not is_static else None + fp = f"free({free_parent}); " if free_parent else "" + headers.add("meos_json.h") + parse_lines.append( + f' std::string arg{i}S(arg{i}Ptr, arg{i}Size);\n' + f' Jsonb* jb{i} = jsonb_in(arg{i}S.c_str());\n' + f' if (!jb{i}) {{ {fp}return {zero}; }}\n') + call_terms.append(f"jb{i}") + box_frees.append(f"free(jb{i});") + elif kind == "tjsonb": + # Second tjsonb temporal: (json:VARSIZED, ts:uint64) extra fields + fields.append((f"json{i}", "VariableSizedData")) + fields.append((f"ts{i}", "uint64_t")) + free_parent = "temp" if not is_static else None + fp = f"free({free_parent}); " if free_parent else "" + headers.add("meos_json.h") + parse_lines.append( + f' std::string json{i}S(json{i}Ptr, json{i}Size);\n' + f' Jsonb* jb{i} = jsonb_in(json{i}S.c_str());\n' + f' if (!jb{i}) {{ {fp}return {zero}; }}\n' + f' Temporal* inst{i} = (Temporal*)tjsonbinst_make(jb{i}, (TimestampTz)ts{i});\n' + f' free(jb{i});\n' + f' if (!inst{i}) {{ {fp}return {zero}; }}\n') + call_terms.append(f"inst{i}") + box_frees.append(f"free(inst{i});") + elif kind == "ttext": + # Second ttext temporal: (value:VARSIZED, ts:uint64) extra fields + fields.append((f"tval{i}", "VariableSizedData")) + fields.append((f"ts{i}", "uint64_t")) + free_parent = "temp" if not is_static else None + fp = f"free({free_parent}); " if free_parent else "" + parse_lines.append( + f' std::string tval{i}S(tval{i}Ptr, tval{i}Size);\n' + f' while (!tval{i}S.empty() && (tval{i}S.front() == \'\\\'\' || tval{i}S.front() == \'"\')) tval{i}S.erase(tval{i}S.begin());\n' + f' while (!tval{i}S.empty() && (tval{i}S.back() == \'\\\'\' || tval{i}S.back() == \'"\')) tval{i}S.pop_back();\n' + f' std::string tval{i}Wkt = "\'" + tval{i}S + "\'@" + MEOS::Meos::convertEpochToTimestamp(ts{i});\n' + f' Temporal* inst{i} = ttext_in(tval{i}Wkt.c_str());\n' + f' if (!inst{i}) {{ {fp}return {zero}; }}\n') + call_terms.append(f"inst{i}") + box_frees.append(f"free(inst{i});") + elif kind == "th3index": + # Second th3index temporal: (cell:uint64, ts:uint64) extra fields + fields.append((f"cell{i}", "uint64_t")) + fields.append((f"ts{i}", "uint64_t")) + free_parent = "temp" if not is_static else None + fp = f"free({free_parent}); " if free_parent else "" + headers.add("meos_h3.h") + parse_lines.append( + f' Temporal* inst{i} = th3indexinst_make((H3Index)cell{i}, (TimestampTz)ts{i});\n' + f' if (!inst{i}) {{ {fp}return {zero}; }}\n') + call_terms.append(f"inst{i}") + box_frees.append(f"free(inst{i});") + elif kind == "tquadbin": + # Second tquadbin temporal: (cell:uint64, ts:uint64) extra fields + fields.append((f"cell{i}", "uint64_t")) + fields.append((f"ts{i}", "uint64_t")) + free_parent = "temp" if not is_static else None + fp = f"free({free_parent}); " if free_parent else "" + headers.add("meos_quadbin.h") + parse_lines.append( + f' Temporal* inst{i} = (Temporal*)tquadbininst_make((Quadbin)cell{i}, (TimestampTz)ts{i});\n' + f' if (!inst{i}) {{ {fp}return {zero}; }}\n') + call_terms.append(f"inst{i}") + box_frees.append(f"free(inst{i});") + elif kind == "tnpoint": + # Second tnpoint temporal: (rid:uint64, frac:double, ts:uint64) extra fields + fields.append((f"rid{i}", "uint64_t")) + fields.append((f"frac{i}", "double")) + fields.append((f"ts{i}", "uint64_t")) + free_parent = "temp" if not is_static else None + fp = f"free({free_parent}); " if free_parent else "" + headers.add("meos_npoint.h") + parse_lines.append( + f' Npoint* np{i} = npoint_make((int64_t)rid{i}, frac{i});\n' + f' if (!np{i}) {{ {fp}return {zero}; }}\n' + f' Temporal* inst{i} = (Temporal*)tnpointinst_make(np{i}, (TimestampTz)ts{i});\n' + f' free(np{i});\n' + f' if (!inst{i}) {{ {fp}return {zero}; }}\n') + call_terms.append(f"inst{i}") + box_frees.append(f"free(inst{i});") + elif kind == "tpose": + # Second tpose temporal: (x:double, y:double, theta:double, ts:uint64) + fields.append((f"px{i}", "double")) + fields.append((f"py{i}", "double")) + fields.append((f"ptheta{i}", "double")) + fields.append((f"ts{i}", "uint64_t")) + free_parent = "temp" if not is_static else None + fp = f"free({free_parent}); " if free_parent else "" + headers.add("meos_pose.h") + parse_lines.append( + f' Pose* pose{i}A = pose_make_2d(px{i}, py{i}, ptheta{i}, false, 0);\n' + f' if (!pose{i}A) {{ {fp}return {zero}; }}\n' + f' Temporal* inst{i} = (Temporal*)tposeinst_make(pose{i}A, (TimestampTz)ts{i});\n' + f' free(pose{i}A);\n' + f' if (!inst{i}) {{ {fp}return {zero}; }}\n') + call_terms.append(f"inst{i}") + box_frees.append(f"free(inst{i});") + elif kind == "geom_wkt": + # Extra geometry arg: VARSIZED WKT parsed via geom_in + fields.append((f"arg{i}", "VariableSizedData")) + headers.add("meos_geo.h") + free_parent = "temp" if not is_static else None + fp = f"free({free_parent}); " if free_parent else "" + parse_lines.append( + f' std::string arg{i}S(arg{i}Ptr, arg{i}Size);\n' + f' GSERIALIZED* gs{i} = geom_in(arg{i}S.c_str(), -1);\n' + f' if (!gs{i}) {{ {fp}return {zero}; }}\n') + call_terms.append(f"gs{i}") + box_frees.append(f"free(gs{i});") + elif kind == "geog_wkt": + # Extra geography arg: VARSIZED WKT parsed via geog_in + fields.append((f"arg{i}", "VariableSizedData")) + headers.add("meos_geo.h") + free_parent = "temp" if not is_static else None + fp = f"free({free_parent}); " if free_parent else "" + parse_lines.append( + f' std::string arg{i}S(arg{i}Ptr, arg{i}Size);\n' + f' GSERIALIZED* gs{i} = geog_in(arg{i}S.c_str(), -1);\n' + f' if (!gs{i}) {{ {fp}return {zero}; }}\n') + call_terms.append(f"gs{i}") + box_frees.append(f"free(gs{i});") + + return fields, headers, call_terms, parse_lines, box_frees + + +def _build_casts_lparams_invoke(fields): + """Build (casts, lparams, invoke) lists from ordered (name, cpp_type) field pairs.""" + casts, lparams, invoke = [], [], [] + for idx, (fn, cpp) in enumerate(fields): + if cpp == "VariableSizedData": + casts.append(f" auto {fn} = parameterValues[{idx}].cast();") + lparams.append(f"const char* {fn}Ptr, uint32_t {fn}Size") + invoke.append(f"{fn}.getContent(), {fn}.getContentSize()") + else: + casts.append(f" auto {fn} = parameterValues[{idx}].cast>();") + lparams.append(f"{cpp} {fn}") + invoke.append(fn) + return casts, lparams, invoke + + +def assemble_varsized_output(op, inp, fields, headers, call_terms, parse_lines, box_frees): + """Build physical .cpp for a build_generic op that returns a VARSIZED arena value. + The nautilus::invoke lambda receives an extra (char* buf, uint32_t bufMax) pair + and returns uint32_t actualLen; the arena write uses VarVal(actualLen).writeToMemory.""" + name = op["nebula_name"] + is_static = (op.get("input_type") == "static_scalar") + zero = "0u" + rk = op["return_kind"] + + casts, lparams, invoke = _build_casts_lparams_invoke(fields) + n_args = len(fields) + + # Add the arena buf/bufMax pair to lambda params and invoke args. + lparams_with_buf = lparams + ["char* buf", "uint32_t bufMax"] + invoke_with_buf = invoke + ["outBuf.getContent()", "nautilus::val(MAX_LEN)"] + + # When meos_call already contains '(' it is a verbatim expression; emit directly. + # call_terms == None also signals the primary_fields verbatim path. + meos_call_str = op['meos_call'] + if call_terms is None or '(' in meos_call_str: + callexpr = meos_call_str + else: + callargs = ", ".join(call_terms) + callexpr = f"{meos_call_str}({callargs})" + bf = "".join(f" {x}\n" for x in box_frees) + build_str = inp["build"].format(var="temp", z=zero) if not is_static else "" + build_str += "".join(parse_lines) + + # Free the primary temporal (if any) before and after the MEOS call. + free_temp = "" if is_static else " free(temp);\n" + + if rk == "varsized_cstring": + # callexpr → char* out; copy to buf, free out + call_marshal = ( + f" char* out = {callexpr};\n" + f"{free_temp}" + f"{bf}" + f" if (!out) return 0u;\n" + f" uint32_t len = static_cast(strlen(out));\n" + f" if (len > bufMax) len = bufMax;\n" + f" memcpy(buf, out, len);\n" + f" free(out);\n" + f" return len;") + elif rk == "varsized_text": + # callexpr → text*; text_to_cstring → char* → copy → free + call_marshal = ( + f" text* tres = {callexpr};\n" + f"{free_temp}" + f"{bf}" + f" if (!tres) return 0u;\n" + f" char* out = text_to_cstring(tres);\n" + f" free(tres);\n" + f" if (!out) return 0u;\n" + f" uint32_t len = static_cast(strlen(out));\n" + f" if (len > bufMax) len = bufMax;\n" + f" memcpy(buf, out, len);\n" + f" free(out);\n" + f" return len;") + elif rk == "varsized_h3out": + # callexpr → H3Index (uint64_t); h3index_out → char* hex → copy + call_marshal = ( + f" H3Index hcell = {callexpr};\n" + f"{free_temp}" + f"{bf}" + f" if (hcell == 0) return 0u;\n" + f" char* hex = h3index_out(hcell);\n" + f" if (!hex) return 0u;\n" + f" uint32_t len = static_cast(strlen(hex));\n" + f" if (len > bufMax) len = bufMax;\n" + f" memcpy(buf, hex, len);\n" + f" free(hex);\n" + f" return len;") + elif rk == "varsized_quadbin": + # callexpr → Quadbin (uint64_t); quadbin_index_to_string → char* → copy + call_marshal = ( + f" Quadbin qcell = {callexpr};\n" + f"{free_temp}" + f"{bf}" + f" char* qstr = quadbin_index_to_string(qcell);\n" + f" if (!qstr) return 0u;\n" + f" uint32_t len = static_cast(strlen(qstr));\n" + f" if (len > bufMax) len = bufMax;\n" + f" memcpy(buf, qstr, len);\n" + f" free(qstr);\n" + f" return len;") + elif rk == "varsized_th3index": + # callexpr → Temporal*(th3index); th3index_start_value → H3Index; h3index_out → char* + call_marshal = ( + f" Temporal* tres = {callexpr};\n" + f"{free_temp}" + f"{bf}" + f" if (!tres) return 0u;\n" + f" H3Index hcell = th3index_start_value(tres);\n" + f" free(tres);\n" + f" char* hex = h3index_out(hcell);\n" + f" if (!hex) return 0u;\n" + f" uint32_t len = static_cast(strlen(hex));\n" + f" if (len > bufMax) len = bufMax;\n" + f" memcpy(buf, hex, len);\n" + f" free(hex);\n" + f" return len;") + elif rk == "varsized_ttext": + # callexpr → Temporal*(ttext); ttext_start_value → text*; text_to_cstring → char* + call_marshal = ( + f" Temporal* tres = {callexpr};\n" + f"{free_temp}" + f"{bf}" + f" if (!tres) return 0u;\n" + f" text* txt = ttext_start_value(tres);\n" + f" free(tres);\n" + f" if (!txt) return 0u;\n" + f" char* out = text_to_cstring(txt);\n" + f" free(txt);\n" + f" if (!out) return 0u;\n" + f" uint32_t len = static_cast(strlen(out));\n" + f" if (len > bufMax) len = bufMax;\n" + f" memcpy(buf, out, len);\n" + f" free(out);\n" + f" return len;") + elif rk == "varsized_tjsonb": + # callexpr → Temporal*(tjsonb); tjsonb_start_value → Jsonb*; jsonb_to_cstring → char* + call_marshal = ( + f" Temporal* tres = {callexpr};\n" + f"{free_temp}" + f"{bf}" + f" if (!tres) return 0u;\n" + f" Jsonb* jbres = (Jsonb*)tjsonb_start_value(tres);\n" + f" free(tres);\n" + f" if (!jbres) return 0u;\n" + f" char* out = jsonb_to_cstring(jbres);\n" + f" free(jbres);\n" + f" if (!out) return 0u;\n" + f" uint32_t len = static_cast(strlen(out));\n" + f" if (len > bufMax) len = bufMax;\n" + f" memcpy(buf, out, len);\n" + f" free(out);\n" + f" return len;") + elif rk == "varsized_geom": + # callexpr → GSERIALIZED*; geo_as_text → char* WKT → copy to arena + call_marshal = ( + f" GSERIALIZED* gres = {callexpr};\n" + f"{free_temp}" + f"{bf}" + f" if (!gres) return 0u;\n" + f" char* out = geo_as_text(gres, -1);\n" + f" free(gres);\n" + f" if (!out) return 0u;\n" + f" uint32_t len = static_cast(strlen(out));\n" + f" if (len > bufMax) len = bufMax;\n" + f" memcpy(buf, out, len);\n" + f" free(out);\n" + f" return len;") + else: + raise ValueError(f"Unknown varsized return_kind: {rk}") + + inc = "\n".join(f"#include <{h}>" for h in + ["meos.h"] + sorted(h for h in headers if h != "meos.h")) + + physical_args = ",\n ".join( + f"PhysicalFunction {fn}Function" for fn, _ in fields) + pushes = "\n".join(f" parameterFunctions.push_back(std::move({fn}Function));" for fn, _ in fields) + registrar = "\n".join( + [f" auto arg{i} = std::move(arguments.childFunctions[{i}]);" for i in range(n_args)] + + [f" return {name}PhysicalFunction(" + ", ".join(f"std::move(arg{i})" for i in range(n_args)) + ");"]) + + return GENERIC_PHYSICAL_VARSIZED_TEMPLATE.format( + nebula_name=name, includes=inc, + ctor_physical_args=physical_args, n_args=n_args, ctor_physical_pushes=pushes, + casts="\n".join(casts), + lambda_params=",\n ".join(lparams_with_buf), + build=build_str, call_marshal=call_marshal, + invoke_args=", ".join(invoke_with_buf), + registrar_pushes=registrar) + + +def assemble_generic_physical(op): + """Build the physical .cpp for a 'generic' (build_generic) operator.""" + name = op["nebula_name"] + if op["return_kind"] == "wkb": + return assemble_wkb_output(op) + + inp = GENERIC_INPUTS[op["input_type"]] + ret_cpp, _, zero, extract_fn = GENERIC_RETURNS[op["return_kind"]] + extras = op.get("extra_args", []) + + fields, headers, call_terms, parse_lines, box_frees = _build_generic_fields_and_parse( + op, inp, extras, zero) + + # VARSIZED output path — arena allocation instead of VarVal(scalar). + if op["return_kind"].startswith("varsized_"): + # scalar_first/box_first reordering not currently needed for varsized ops + return assemble_varsized_output(op, inp, fields, headers, call_terms, parse_lines, box_frees) + + casts, lparams, invoke = _build_casts_lparams_invoke(fields) + n_args = len(fields) + + build = inp["build"].format(var="temp", z=zero) + "".join(parse_lines) + # static_scalar: build string is empty; call_terms has no "temp" sentinel. + is_static = (op.get("input_type") == "static_scalar") + if is_static: + build = "".join(parse_lines) + + inc = "\n".join(f"#include <{h}>" for h in + ["meos.h"] + sorted(h for h in headers if h != "meos.h")) + + # box_first ops (e.g. above_stbox_tspatial(box, temp)) call with the box/span + # literal before the temporal; the default order is temporal-first. + if op.get("box_first") and len(call_terms) == 2: + call_terms = [call_terms[1], call_terms[0]] + + if op.get("scalar_first"): + # For f(scalar, Temporal*) MEOS calls: the SQL args put scalar first, + # then temporal (value+ts). Reorder so extra arg fields precede the temporal fields. + n_temp_fields = len(inp["fields"]) + extra_fields = fields[n_temp_fields:] + temp_fields = fields[:n_temp_fields] + fields = extra_fields + temp_fields + # call_terms = ["temp", extra_call_terms...] -> [extra_call_terms..., "temp"] + if not is_static: + call_terms = call_terms[1:] + ["temp"] + # Rebuild casts, lparams, invoke from the reordered fields. + casts, lparams, invoke = _build_casts_lparams_invoke(fields) + n_args = len(fields) + + # When meos_call already contains '(' it is a verbatim expression (casts and + # varnames already embedded); emit it directly without appending (callargs). + # call_terms == None also signals the primary_fields verbatim path. + meos_call_str = op['meos_call'] + if call_terms is None or '(' in meos_call_str: + callexpr = meos_call_str + else: + callargs = ", ".join(call_terms) + callexpr = f"{meos_call_str}({callargs})" + bf = "".join(f" {x}\n" for x in box_frees) + + free_temp = "" if is_static else f" free(temp);\n" + + if extract_fn is None: + if is_static: + call_marshal = (f" {ret_cpp} r = {callexpr};\n" + f"{bf}" + f" return r;") + else: + call_marshal = (f" {ret_cpp} r = {callexpr};\n" + f"{free_temp}" + f"{bf}" + f" return r;") + else: + # Temporal*-returning transform: result is a single-instant temporal; take + # its value via the result type's *_start_value accessor, free both. + call_marshal = (f" Temporal* res = {callexpr};\n" + f"{free_temp}" + f"{bf}" + f" if (!res) return {zero};\n" + f" {ret_cpp} r = {extract_fn}(res);\n" + f" free(res);\n" + f" return r;") + + # physical-hpp/logical ctor args are PhysicalFunction/LogicalFunction per child. + physical_args = ",\n ".join( + f"PhysicalFunction {fn}Function" for fn, _ in fields) + pushes = "\n".join(f" parameterFunctions.push_back(std::move({fn}Function));" for fn, _ in fields) + registrar = "\n".join( + [f" auto arg{i} = std::move(arguments.childFunctions[{i}]);" for i in range(n_args)] + + [f" return {name}PhysicalFunction(" + ", ".join(f"std::move(arg{i})" for i in range(n_args)) + ");"]) + + return GENERIC_PHYSICAL_TEMPLATE.format( + nebula_name=name, includes=inc, + ctor_physical_args=physical_args, n_args=n_args, ctor_physical_pushes=pushes, + casts="\n".join(casts), lambda_params=",\n ".join(lparams), + return_type=ret_cpp, build=build, call_marshal=call_marshal, + zero=zero, invoke_args=", ".join(invoke), registrar_pushes=registrar) + + +GENERIC_PHYSICAL_TEMPLATE = """\ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" {{ +{includes} +}} + +namespace NES {{ + +{nebula_name}PhysicalFunction::{nebula_name}PhysicalFunction({ctor_physical_args}) +{{ + parameterFunctions.reserve({n_args}); +{ctor_physical_pushes} +}} + +VarVal {nebula_name}PhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + {{ + parameterValues.emplace_back(function.execute(record, arena)); + }} + +{casts} + + const auto result = nautilus::invoke( + +[]({lambda_params}) -> {return_type} {{ + try + {{ + MEOS::Meos::ensureMeosInitialized(); +{build} +{call_marshal} + }} + catch (const std::exception&) + {{ + return {zero}; + }} + }}, + {invoke_args}); + + return VarVal(result); +}} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::Register{nebula_name}PhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{{ + PRECONDITION(arguments.childFunctions.size() == {n_args}, + "{nebula_name}PhysicalFunction requires {n_args} children but got {{}}", + arguments.childFunctions.size()); +{registrar_pushes} +}} + +}} // namespace NES +""" + + +GENERIC_PHYSICAL_VARSIZED_TEMPLATE = """\ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" {{ +{includes} +}} + +namespace NES {{ + +{nebula_name}PhysicalFunction::{nebula_name}PhysicalFunction({ctor_physical_args}) +{{ + parameterFunctions.reserve({n_args}); +{ctor_physical_pushes} +}} + +VarVal {nebula_name}PhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + {{ + parameterValues.emplace_back(function.execute(record, arena)); + }} + +{casts} + + constexpr uint32_t MAX_LEN = 4096; + auto outBuf = arena.allocateVariableSizedData(nautilus::val(MAX_LEN)); + + const auto actualLen = nautilus::invoke( + +[]({lambda_params}) -> uint32_t {{ + try + {{ + MEOS::Meos::ensureMeosInitialized(); +{build} +{call_marshal} + }} + catch (const std::exception&) + {{ + return 0u; + }} + }}, + {invoke_args}); + + VarVal(actualLen).writeToMemory(outBuf.getReference()); + return outBuf; +}} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::Register{nebula_name}PhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{{ + PRECONDITION(arguments.childFunctions.size() == {n_args}, + "{nebula_name}PhysicalFunction requires {n_args} children but got {{}}", + arguments.childFunctions.size()); +{registrar_pushes} +}} + +}} // namespace NES +""" + + +GENERIC_PHYSICAL_WKB_TEMPLATE = """\ +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" {{ +{includes} +}} + +namespace NES {{ + +{nebula_name}PhysicalFunction::{nebula_name}PhysicalFunction({ctor_physical_args}) +{{ + parameterFunctions.reserve(2); +{ctor_physical_pushes} +}} + +VarVal {nebula_name}PhysicalFunction::execute(const Record& record, ArenaRef& arena) const +{{ + std::vector parameterValues; + parameterValues.reserve(parameterFunctions.size()); + for (const auto& function : parameterFunctions) + {{ + parameterValues.emplace_back(function.execute(record, arena)); + }} + + auto traj = parameterValues[0].cast(); + auto arg0 = parameterValues[1].cast(); + + // Call MEOS f(Temporal*, Temporal*) -> Temporal* over the two hex-WKB + // operands and serialize the result back to hex-WKB inside the invoke; the + // returned heap string is copied into the arena below. Both operands and the + // MEOS result are freed here. + auto hexStr = nautilus::invoke( + +[](const char* aPtr, uint32_t aSize, const char* bPtr, uint32_t bSize) -> char* + {{ + try + {{ + MEOS::Meos::ensureMeosInitialized(); + std::string aHex(aPtr, aSize); + std::string bHex(bPtr, bSize); + Temporal* a = temporal_from_hexwkb(aHex.c_str()); + if (!a) return (char*) nullptr; + Temporal* b = temporal_from_hexwkb(bHex.c_str()); + if (!b) {{ free(a); return (char*) nullptr; }} + Temporal* res = {meos_call}(a, b); + free(a); + free(b); + if (!res) return (char*) nullptr; + size_t hexSize = 0; + char* hexOut = temporal_as_hexwkb(res, 0, &hexSize); + free(res); + return hexOut; + }} + catch (const std::exception&) + {{ + return (char*) nullptr; + }} + }}, + traj.getContent(), traj.getContentSize(), arg0.getContent(), arg0.getContentSize()); + + const auto hexLen = nautilus::invoke( + +[](const char* s) -> uint32_t {{ return s ? (uint32_t) strlen(s) : (uint32_t) 0; }}, + hexStr); + + auto variableSized = arena.allocateVariableSizedData(hexLen); + + nautilus::invoke( + +[](int8_t* dest, const char* s, uint32_t len) -> void + {{ + if (s) + {{ + memcpy(dest, s, len); + free((void*) s); + }} + }}, + variableSized.getContent(), hexStr, hexLen); + + return variableSized; +}} + +PhysicalFunctionRegistryReturnType PhysicalFunctionGeneratedRegistrar::Register{nebula_name}PhysicalFunction( + PhysicalFunctionRegistryArguments arguments) +{{ + PRECONDITION(arguments.childFunctions.size() == 2, + "{nebula_name}PhysicalFunction requires 2 children but got {{}}", + arguments.childFunctions.size()); +{registrar_pushes} +}} + +}} // namespace NES +""" + + +# =========================================================================== +# Parser-glue dispatch-case templates (one per shape). +# The shape is encoded by the build_* flag; the dispatch block produces a +# LogicalFunction ctor invocation matching the C++ operator's arg order. +# +# Mariana's existing TGEO_AT_STBOX and EDWITHIN_TGEO_GEO blocks are the +# in-tree reference for the constantBuilder→functionBuilder lift pattern. +# =========================================================================== + +# 4-arg shape: lon, lat, ts, geometry (geometry is the only constant — WKT). +DISPATCH_CASE_ONE_TEMPORAL_POINT = """\ + /* BEGIN CODEGEN PARSER GLUE: {sql_token} */ + case AntlrSQLLexer::{sql_token}: + {{ + const auto argCount = context->expression().size(); + if (argCount != 4) + throw InvalidQuerySyntax("{sql_token} requires exactly 4 arguments (lon, lat, timestamp, geometry), but got {{}}", argCount); + + /* Lift the WKT constant into the function builder */ + while (!helpers.top().constantBuilder.empty()) + {{ + auto v = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + helpers.top().functionBuilder.emplace_back( + ConstantValueLogicalFunction( + DataTypeProvider::provideDataType(DataType::Type::VARSIZED), std::move(v))); + }} + + auto geometry = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto timestamp = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lat = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lon = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back( + {nebula_name}LogicalFunction(lon, lat, timestamp, geometry)); + }} + break; + /* END CODEGEN PARSER GLUE: {sql_token} */ +""" + +# 6-arg shape: lonA, latA, tsA, lonB, latB, tsB (no constants). +DISPATCH_CASE_TWO_TEMPORAL_POINTS = """\ + /* BEGIN CODEGEN PARSER GLUE: {sql_token} */ + case AntlrSQLLexer::{sql_token}: + {{ + const auto argCount = context->expression().size(); + if (argCount != 6) + throw InvalidQuerySyntax("{sql_token} requires exactly 6 arguments (lonA, latA, tsA, lonB, latB, tsB), but got {{}}", argCount); + + auto tsB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto latB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lonB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto tsA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto latA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lonA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back( + {nebula_name}LogicalFunction(lonA, latA, tsA, lonB, latB, tsB)); + }} + break; + /* END CODEGEN PARSER GLUE: {sql_token} */ +""" + +# 8-arg shape: xA, yA, thetaA, tsA, xB, yB, thetaB, tsB — two tpose instants, +# each lifted to a tgeompoint via tpose_to_tpoint at run time (W15 composition). +DISPATCH_CASE_TWO_TPOSE_POINTS = """\ + /* BEGIN CODEGEN PARSER GLUE: {sql_token} */ + case AntlrSQLLexer::{sql_token}: + {{ + const auto argCount = context->expression().size(); + if (argCount != 8) + throw InvalidQuerySyntax("{sql_token} requires exactly 8 arguments (xA, yA, thetaA, tsA, xB, yB, thetaB, tsB), but got {{}}", argCount); + + auto tsB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto thetaB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto yB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto xB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto tsA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto thetaA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto yA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto xA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back( + {nebula_name}LogicalFunction(xA, yA, thetaA, tsA, xB, yB, thetaB, tsB)); + }} + break; + /* END CODEGEN PARSER GLUE: {sql_token} */ +""" + +# 5-arg shape: lon, lat, ts, geometry, dist (both geometry and dist are constants). +# Constant lift uses mariana's pattern: TRUE/FALSE → BOOLEAN, strtod-clean → FLOAT64, else → VARSIZED. +DISPATCH_CASE_ONE_TEMPORAL_POINT_WITH_DIST = """\ + /* BEGIN CODEGEN PARSER GLUE: {sql_token} */ + case AntlrSQLLexer::{sql_token}: + {{ + const auto argCount = context->expression().size(); + if (argCount != 5) + throw InvalidQuerySyntax("{sql_token} requires exactly 5 arguments (lon, lat, timestamp, geometry, distance), but got {{}}", argCount); + + /* Lift constants (geometry + distance) — same shape as EDWITHIN_TGEO_GEO */ + while (!helpers.top().constantBuilder.empty()) + {{ + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + + DataType dataType; + const auto upperValue = Util::toUpperCase(constantValue); + if (upperValue == "TRUE" || upperValue == "FALSE") + {{ + dataType = DataTypeProvider::provideDataType(DataType::Type::BOOLEAN); + }} + else + {{ + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + }} + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + }} + + /* After lift: [lon, lat, ts, distance, geometry] (geometry pushed last because lifted last in LIFO) */ + auto geometry = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto dist = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto timestamp = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lat = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lon = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back( + {nebula_name}LogicalFunction(lon, lat, timestamp, geometry, dist)); + }} + break; + /* END CODEGEN PARSER GLUE: {sql_token} */ +""" + +# 7-arg shape: lonA, latA, tsA, lonB, latB, tsB, dist (only dist is constant). +DISPATCH_CASE_TWO_TEMPORAL_POINTS_WITH_DIST = """\ + /* BEGIN CODEGEN PARSER GLUE: {sql_token} */ + case AntlrSQLLexer::{sql_token}: + {{ + const auto argCount = context->expression().size(); + if (argCount != 7) + throw InvalidQuerySyntax("{sql_token} requires exactly 7 arguments (lonA, latA, tsA, lonB, latB, tsB, distance), but got {{}}", argCount); + + /* Lift the distance constant */ + while (!helpers.top().constantBuilder.empty()) + {{ + auto v = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + helpers.top().functionBuilder.emplace_back( + ConstantValueLogicalFunction( + DataTypeProvider::provideDataType(DataType::Type::FLOAT64), std::move(v))); + }} + + auto dist = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto tsB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto latB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lonB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto tsA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto latA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lonA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back( + {nebula_name}LogicalFunction(lonA, latA, tsA, lonB, latB, tsB, dist)); + }} + break; + /* END CODEGEN PARSER GLUE: {sql_token} */ +""" + + +# 6-arg shape: lon, lat, radius, ts, geometry, dist — tcbuffer × static geom + dist. +DISPATCH_CASE_TCBUFFER_POINT_WITH_DIST = """\ + /* BEGIN CODEGEN PARSER GLUE: {sql_token} */ + case AntlrSQLLexer::{sql_token}: + {{ + const auto argCount = context->expression().size(); + if (argCount != 6) + throw InvalidQuerySyntax("{sql_token} requires exactly 6 arguments (lon, lat, radius, timestamp, blob, distance), but got {{}}", argCount); + + while (!helpers.top().constantBuilder.empty()) + {{ + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + }} + + auto blobLast = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto distLast = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto timestamp = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto radius = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lat = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lon = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back( + {nebula_name}LogicalFunction(lon, lat, radius, timestamp, blobLast, distLast)); + }} + break; + /* END CODEGEN PARSER GLUE: {sql_token} */ +""" + +# 9-arg shape: lonA, latA, radiusA, tsA, lonB, latB, radiusB, tsB, dist — two tcbuffers + dist. +DISPATCH_CASE_TWO_TCBUFFER_POINTS_WITH_DIST = """\ + /* BEGIN CODEGEN PARSER GLUE: {sql_token} */ + case AntlrSQLLexer::{sql_token}: + {{ + const auto argCount = context->expression().size(); + if (argCount != 9) + throw InvalidQuerySyntax("{sql_token} requires exactly 9 arguments (lonA, latA, radiusA, tsA, lonB, latB, radiusB, tsB, distance), but got {{}}", argCount); + + while (!helpers.top().constantBuilder.empty()) + {{ + auto v = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + helpers.top().functionBuilder.emplace_back( + ConstantValueLogicalFunction( + DataTypeProvider::provideDataType(DataType::Type::FLOAT64), std::move(v))); + }} + + auto dist = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto tsB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto radiusB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto latB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lonB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto tsA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto radiusA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto latA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lonA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back( + {nebula_name}LogicalFunction(lonA, latA, radiusA, tsA, lonB, latB, radiusB, tsB, dist)); + }} + break; + /* END CODEGEN PARSER GLUE: {sql_token} */ +""" + +# 8-arg shape: lonA, latA, radiusA, tsA, lonB, latB, radiusB, tsB (no constants). +DISPATCH_CASE_TWO_TCBUFFER_POINTS = """\ + /* BEGIN CODEGEN PARSER GLUE: {sql_token} */ + case AntlrSQLLexer::{sql_token}: + {{ + const auto argCount = context->expression().size(); + if (argCount != 8) + throw InvalidQuerySyntax("{sql_token} requires exactly 8 arguments (lonA, latA, radiusA, tsA, lonB, latB, radiusB, tsB), but got {{}}", argCount); + + auto tsB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto radiusB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto latB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lonB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto tsA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto radiusA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto latA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lonA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back( + {nebula_name}LogicalFunction(lonA, latA, radiusA, tsA, lonB, latB, radiusB, tsB)); + }} + break; + /* END CODEGEN PARSER GLUE: {sql_token} */ +""" + +# 5-arg shape: lon, lat, radius, ts, geometry — tcbuffer × static geom. +# Geometry is the only constant (lifted to FLOAT64 / VARSIZED via the same lift +# pattern as the existing with-dist templates). +DISPATCH_CASE_TCBUFFER_POINT = """\ + /* BEGIN CODEGEN PARSER GLUE: {sql_token} */ + case AntlrSQLLexer::{sql_token}: + {{ + const auto argCount = context->expression().size(); + if (argCount != 5) + throw InvalidQuerySyntax("{sql_token} requires exactly 5 arguments (lon, lat, radius, timestamp, geometry), but got {{}}", argCount); + + /* Lift the WKT constant into the function builder */ + while (!helpers.top().constantBuilder.empty()) + {{ + auto v = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + helpers.top().functionBuilder.emplace_back( + ConstantValueLogicalFunction( + DataTypeProvider::provideDataType(DataType::Type::VARSIZED), std::move(v))); + }} + + auto geometry = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto timestamp = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto radius = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lat = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto lon = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back( + {nebula_name}LogicalFunction(lon, lat, radius, timestamp, geometry)); + }} + break; + /* END CODEGEN PARSER GLUE: {sql_token} */ +""" + +# 3-arg shape: value, ts, scalar (scalar may be FLOAT64 or INT32, only one constant). +DISPATCH_CASE_TNUMBER_POINT_WITH_SCALAR = """\ + /* BEGIN CODEGEN PARSER GLUE: {sql_token} */ + case AntlrSQLLexer::{sql_token}: + {{ + const auto argCount = context->expression().size(); + if (argCount != 3) + throw InvalidQuerySyntax("{sql_token} requires exactly 3 arguments (value, timestamp, scalar), but got {{}}", argCount); + + /* Lift the scalar constant — accept FLOAT64 (strtod-clean) and INT32 */ + while (!helpers.top().constantBuilder.empty()) + {{ + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + }} + + auto scalar = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto timestamp = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto value = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back( + {nebula_name}LogicalFunction(value, timestamp, scalar)); + }} + break; + /* END CODEGEN PARSER GLUE: {sql_token} */ +""" + +# 4-arg shape: valueA, tsA, valueB, tsB (no constants). +DISPATCH_CASE_TWO_TNUMBER_POINTS = """\ + /* BEGIN CODEGEN PARSER GLUE: {sql_token} */ + case AntlrSQLLexer::{sql_token}: + {{ + const auto argCount = context->expression().size(); + if (argCount != 4) + throw InvalidQuerySyntax("{sql_token} requires exactly 4 arguments (valueA, tsA, valueB, tsB), but got {{}}", argCount); + + auto tsB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto valueB = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto tsA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + auto valueA = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back(); + + helpers.top().functionBuilder.emplace_back( + {nebula_name}LogicalFunction(valueA, tsA, valueB, tsB)); + }} + break; + /* END CODEGEN PARSER GLUE: {sql_token} */ +""" + + +def dispatch_case_for(op): + """Pick the dispatch-case template that matches an operator's shape.""" + if op.get("build_two_temporal_points_with_dist"): + return DISPATCH_CASE_TWO_TEMPORAL_POINTS_WITH_DIST + if op.get("build_temporal_point_with_dist"): + return DISPATCH_CASE_ONE_TEMPORAL_POINT_WITH_DIST + if op.get("build_two_temporal_points"): + return DISPATCH_CASE_TWO_TEMPORAL_POINTS + if op.get("build_two_tpose_points_via_composition"): + return DISPATCH_CASE_TWO_TPOSE_POINTS + if op.get("build_tnpoint_point_via_composition"): + # 4-arg SQL shape (rid, fraction, ts, geometry) — same arity as a + # one-temporal-point op; the parser only pops/forwards by arity. + return DISPATCH_CASE_ONE_TEMPORAL_POINT + if op.get("build_two_tnpoint_points_via_composition"): + # 6-arg SQL shape (ridA, fracA, tsA, ridB, fracB, tsB) — same arity + # as a two-temporal-points op. + return DISPATCH_CASE_TWO_TEMPORAL_POINTS + # dwithin (W20): the with-dist composition shapes reuse existing with-dist + # dispatches by arity + constant pattern (geometry+dist or dist-only lifted). + if op.get("build_tpose_point_with_dist_via_composition"): + # 6-arg: x, y, theta, ts (cols) + geometry, dist (constants) — same + # shape as tcbuffer × geom + dist. + return DISPATCH_CASE_TCBUFFER_POINT_WITH_DIST + if op.get("build_two_tpose_points_with_dist_via_composition"): + # 9-arg: 8 cols + dist constant — same shape as two-tcbuffer + dist. + return DISPATCH_CASE_TWO_TCBUFFER_POINTS_WITH_DIST + if op.get("build_tnpoint_point_with_dist_via_composition"): + # 5-arg: rid, fraction, ts (cols) + geometry, dist (constants). + return DISPATCH_CASE_ONE_TEMPORAL_POINT_WITH_DIST + if op.get("build_two_tnpoint_points_with_dist_via_composition"): + # 7-arg: 6 cols + dist constant. + return DISPATCH_CASE_TWO_TEMPORAL_POINTS_WITH_DIST + if op.get("build_temporal_point") or op.get("build_temporal_point_restriction"): + # Both shapes share the same 4-arg dispatch (lon, lat, ts, geom); + # only the physical-cpp body differs (filter-predicate int return vs. + # restriction-survival int return). + return DISPATCH_CASE_ONE_TEMPORAL_POINT + if op.get("build_tcbuffer_point") or op.get("build_tcbuffer_point_cbuffer") \ + or op.get("build_tpose_point_via_composition"): + # All three shapes share the same 5-arg dispatch (lon/x, lat/y, radius/theta, ts, blob); + # only the physical-cpp body differs (blob parsed as GSERIALIZED vs Cbuffer; per-event + # type construction is tcbuffer vs tpose with optional tpose_to_tpoint composition). + return DISPATCH_CASE_TCBUFFER_POINT + if op.get("build_two_tcbuffer_points"): + return DISPATCH_CASE_TWO_TCBUFFER_POINTS + if op.get("build_tcbuffer_point_with_dist") or op.get("build_tcbuffer_point_cbuffer_with_dist"): + # Same 6-arg SQL dispatch for both — only physical-cpp body differs (blob parser). + return DISPATCH_CASE_TCBUFFER_POINT_WITH_DIST + if op.get("build_two_tcbuffer_points_with_dist"): + return DISPATCH_CASE_TWO_TCBUFFER_POINTS_WITH_DIST + if op.get("build_tnumber_point_with_scalar") or op.get("build_tnumber_scalar_first"): + # scalar-first reuses the same 3-arg (value, ts, scalar) SQL dispatch; + # only the physical-cpp body differs (MEOS call arg order). + return DISPATCH_CASE_TNUMBER_POINT_WITH_SCALAR + if op.get("build_two_tnumber_points"): + return DISPATCH_CASE_TWO_TNUMBER_POINTS + return None + + +def _dispatch_case_current(op): + """Parser dispatch case in the CURRENT AntlrSQLParser style (visit()/return + LogicalFunction), matching the live W2..W147 chain. Generic over arity. + Returns the final C++ string (no further .format). END marker only (the + live style carries no BEGIN marker).""" + build_key = next((k for k in _TRGEO_PHYS_DISPATCH if op.get(k)), None) + n = len(_TRGEO_PHYS_DISPATCH[build_key][1]) if build_key else len(op.get("args", [])) + tok, name = op["sql_token"], op["nebula_name"] + visits = "\n".join( + f" auto arg{i} = visit(ctx->functionParam({i})).as();" + for i in range(n)) + ctor_args = ", ".join(f"std::move(arg{i})" for i in range(n)) + return f""" case AntlrSQLParser::{tok}: {{ + PRECONDITION(ctx->functionParam().size() == {n}, + "{name} requires {n} args but got {{}}", + ctx->functionParam().size()); +{visits} + return LogicalFunction({name}LogicalFunction({ctor_args})); + }} + /* END CODEGEN PARSER GLUE: {tok} */""" + + +def _generic_dispatch_case(op): + """Parser dispatch case for a 'generic' operator. Arity is baked in (n = + number of event fields); lifts string/number constants (geometry blobs, + scalars) then pops n children in reverse and builds the LogicalFunction. + Returns the final C++ string (no further .format).""" + n = len(op["args"]) + tok, name = op["sql_token"], op["nebula_name"] + pops = "\n".join( + f" auto a{i} = helpers.top().functionBuilder.back(); helpers.top().functionBuilder.pop_back();" + for i in range(n - 1, -1, -1)) + ctor_args = ", ".join(f"a{i}" for i in range(n)) + return f""" /* BEGIN CODEGEN PARSER GLUE: {tok} */ + case AntlrSQLLexer::{tok}: + {{ + const auto argCount = context->expression().size(); + if (argCount != {n}) + throw InvalidQuerySyntax("{tok} requires exactly {n} arguments, but got {{}}", argCount); + + while (!helpers.top().constantBuilder.empty()) + {{ + auto constantValue = std::move(helpers.top().constantBuilder.back()); + helpers.top().constantBuilder.pop_back(); + DataType dataType; + char* endPtr = nullptr; + std::strtod(constantValue.c_str(), &endPtr); + if (endPtr != nullptr && *endPtr == '\\0') + dataType = DataTypeProvider::provideDataType(DataType::Type::FLOAT64); + else + dataType = DataTypeProvider::provideDataType(DataType::Type::VARSIZED); + helpers.top().functionBuilder.emplace_back(ConstantValueLogicalFunction(dataType, std::move(constantValue))); + }} + +{pops} + + helpers.top().functionBuilder.emplace_back({name}LogicalFunction({ctor_args})); + }} + break; + /* END CODEGEN PARSER GLUE: {tok} */ +""" + + +# =========================================================================== +# Idempotent injectors — each scans for a per-op marker and inserts only +# if not present, so re-runs are safe. +# =========================================================================== + +def inject_cmake_entries(operators, output_root: Path) -> int: + """Append per-op `add_plugin(...)` entries to the Meos CMakeLists files + (logical + physical layers). Idempotent: skips ops already listed.""" + n_added = 0 + for layer in ("logical", "physical"): + cml = output_root / f"nes-{layer}-operators/src/Functions/Meos/CMakeLists.txt" + if not cml.exists(): + sys.stderr.write(f" ! cmake-entries: {cml} not found, skipping {layer} layer\n") + continue + body = cml.read_text() + layer_suffix = "Logical" if layer == "logical" else "Physical" + new_lines = [] + for op in operators: + entry = ( + f"add_plugin({op['nebula_name']} {layer_suffix}Function " + f"nes-{layer}-operators {op['nebula_name']}{layer_suffix}Function.cpp)" + ) + if entry in body or f"add_plugin({op['nebula_name']} {layer_suffix}Function" in body: + continue + new_lines.append(entry) + if new_lines: + block = "\n".join(new_lines) + "\n" + # The physical Meos CMakeLists wraps its add_plugin calls in + # `if(NES_ENABLE_MEOS) ... endif()`; new entries MUST land inside the + # guard (before the final endif) so they inherit the MEOS plugin + # include dir that provides MEOSWrapper.hpp. The logical layer has no + # guard, so it appends at EOF. + idx = body.rfind("\nendif()") + if idx != -1: + insert_at = idx + 1 # just before the final `endif()` line + body = body[:insert_at] + block + body[insert_at:] + cml.write_text(body) + else: + with cml.open("a") as f: + f.write(block) + sys.stderr.write(f" ✓ cmake-entries ({layer}): added {len(new_lines)} entry(ies)\n") + n_added += len(new_lines) + return n_added + + +def inject_g4(operators, g4_path: Path) -> int: + """Inject lexer-token + functionName-alternation entries into AntlrSQL.g4. + Idempotent: skips tokens already present.""" + if not g4_path.exists(): + sys.stderr.write(f" ! g4: {g4_path} not found, skipping\n") + return 0 + body = g4_path.read_text() + n_added = 0 + + # 1) Lexer-token entries — insert just before the WATERMARK: lexer token. + new_tokens = [] + for op in operators: + tok = op["sql_token"] + if re.search(rf"^{re.escape(tok)}\s*:", body, re.MULTILINE): + continue + new_tokens.append( + f"{tok}: '{tok}' | '{tok.lower()}';" + ) + if new_tokens: + anchor_re = re.compile(r"^WATERMARK:.*$", re.MULTILINE) + m = anchor_re.search(body) + if m is None: + sys.stderr.write(f" ! g4: WATERMARK lexer anchor not found; cannot inject tokens\n") + else: + insertion = "/* BEGIN CODEGEN LEXER TOKENS */\n" + "\n".join(new_tokens) + "\n/* END CODEGEN LEXER TOKENS */\n" + # If the BEGIN marker already exists, append inside that block; else insert before WATERMARK. + if "/* BEGIN CODEGEN LEXER TOKENS */" in body: + body = re.sub( + r"(/\* BEGIN CODEGEN LEXER TOKENS \*/\n)(.*?)(/\* END CODEGEN LEXER TOKENS \*/)", + lambda mm: mm.group(1) + mm.group(2) + "\n".join(new_tokens) + "\n" + mm.group(3), + body, + count=1, + flags=re.DOTALL, + ) + else: + body = body[: m.start()] + insertion + body[m.start():] + n_added += len(new_tokens) + sys.stderr.write(f" ✓ g4 lexer-tokens: added {len(new_tokens)} token(s)\n") + + # 2) functionName: alternation — append missing tokens before the trailing ';'. + fn_re = re.compile(r"^functionName:\s*([^;]+);", re.MULTILINE) + m = fn_re.search(body) + if m is None: + sys.stderr.write(f" ! g4: functionName production not found\n") + else: + alternation = m.group(1) + new_alts = [] + for op in operators: + tok = op["sql_token"] + if re.search(rf"\b{re.escape(tok)}\b", alternation): + continue + new_alts.append(tok) + if new_alts: + new_alt_text = alternation.rstrip() + " | " + " | ".join(new_alts) + body = body[: m.start()] + f"functionName: {new_alt_text};" + body[m.end():] + sys.stderr.write(f" ✓ g4 functionName: added {len(new_alts)} alternative(s)\n") + + g4_path.write_text(body) + return n_added + + +def inject_parser_cpp(operators, cpp_path: Path) -> int: + """Inject #include + dispatch-case block into AntlrSQLQueryPlanCreator.cpp. + Idempotent: skips when the per-op BEGIN marker is already present.""" + if not cpp_path.exists(): + sys.stderr.write(f" ! parser-cpp: {cpp_path} not found, skipping\n") + return 0 + body = cpp_path.read_text() + n_added = 0 + + # 1) Per-op #include — append after the last existing Meos LogicalFunction include. + new_includes = [] + for op in operators: + inc = f"#include " + if inc in body: + continue + new_includes.append(inc) + if new_includes: + # Insert immediately after the last #include line. + meos_inc_re = re.compile(r"(^#include ]+>\s*\n)+", re.MULTILINE) + matches = list(meos_inc_re.finditer(body)) + if not matches: + sys.stderr.write(f" ! parser-cpp: could not find Meos include anchor\n") + else: + last = matches[-1] + body = body[: last.end()] + "\n".join(new_includes) + "\n" + body[last.end():] + sys.stderr.write(f" ✓ parser-cpp includes: added {len(new_includes)}\n") + + # 2) Per-op dispatch cases — insert just before the `default:` of the + # switch that already contains the TGEO_AT_STBOX case. + cases_block = [] + for op in operators: + marker = f"/* BEGIN CODEGEN PARSER GLUE: {op['sql_token']} */" + end_marker = f"/* END CODEGEN PARSER GLUE: {op['sql_token']} */" + if marker in body or end_marker in body: + continue + # Also skip if a pre-existing hand-written case for this token already + # exists (no marker, but a `case AntlrSQL{Lexer,Parser}::TOKEN:` line is present). + if re.search(rf"case\s+AntlrSQL(?:Lexer|Parser)::{re.escape(op['sql_token'])}\s*:", body): + sys.stderr.write( + f" ! parser-cpp: pre-existing hand-written case for {op['sql_token']} detected; " + f"skipping codegen injection (will not duplicate)\n" + ) + continue + if any(op.get(k) for k in _TRGEO_PHYS_DISPATCH): + case_str = _dispatch_case_current(op) # current AntlrSQLParser style; final string + elif op.get("build_generic"): + case_str = _generic_dispatch_case(op) # arity baked in; final string + else: + tmpl = dispatch_case_for(op) + if tmpl is None: + sys.stderr.write(f" ! parser-cpp: {op['nebula_name']} has no dispatch shape, skipping case\n") + continue + case_str = tmpl.format(sql_token=op["sql_token"], nebula_name=op["nebula_name"]) + cases_block.append(case_str) + n_added += 1 + if cases_block: + # Find the insertion point: prefer just after the LAST existing + # `/* END CODEGEN PARSER GLUE: ... */` marker (so successive codegen + # runs cluster their cases), else fall back to inserting before the + # `default:` that immediately follows the TGEO_AT_STBOX case block. + last_end_re = re.compile(r"/\* END CODEGEN PARSER GLUE: [^*]+\*/") + ends = list(last_end_re.finditer(body)) + if ends: + insert_at = ends[-1].end() + body = body[:insert_at] + "\n" + "\n".join(cases_block) + body[insert_at:] + sys.stderr.write(f" ✓ parser-cpp dispatch: added {len(cases_block)} case(s) after last codegen marker\n") + else: + anchor_re = re.compile( + r"(case AntlrSQLLexer::TGEO_AT_STBOX:[\s\S]+?\n\s*break;\n)(\s*default:)", + ) + m = anchor_re.search(body) + if m is None: + sys.stderr.write(f" ! parser-cpp: no anchor (TGEO_AT_STBOX→default or codegen END marker) found\n") + else: + insertion = m.group(1) + "\n" + "\n".join(cases_block) + "\n" + m.group(2) + body = body[: m.start()] + insertion + body[m.end():] + sys.stderr.write(f" ✓ parser-cpp dispatch: added {len(cases_block)} case(s) before default:\n") + + cpp_path.write_text(body) + return n_added + + +def main(): + parser = argparse.ArgumentParser() + parser.add_argument("--input", required=True, help="Path to JSON descriptor file") + parser.add_argument("--output-root", required=True, help="MobilityNebula repo root") + parser.add_argument("--no-parser-glue", action="store_true", + help="Skip .g4 + parser .cpp injection (default: inject)") + parser.add_argument("--no-cmake-entries", action="store_true", + help="Skip CMakeLists.txt injection (default: inject)") + args = parser.parse_args() + + with open(args.input) as f: + config = json.load(f) + + output_root = Path(args.output_root).resolve() + if not (output_root / "nes-logical-operators").exists(): + sys.exit(f"ERROR: {output_root} does not look like a MobilityNebula root (no nes-logical-operators/)") + + operators = config["operators"] + sys.stderr.write(f"Emitting {len(operators)} operator(s):\n\n") + for op in operators: + emit_operator(op, output_root) + + if not args.no_cmake_entries: + sys.stderr.write("\nCMakeLists.txt:\n") + inject_cmake_entries(operators, output_root) + + if not args.no_parser_glue: + sys.stderr.write("\nParser glue:\n") + inject_g4(operators, output_root / "nes-sql-parser/AntlrSQL.g4") + inject_parser_cpp(operators, output_root / "nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp") + + sys.stderr.write( + f"\nDone. {len(operators) * 4} files emitted " + f"(or 3 + .cpp-skipped for shapes without a physical-cpp template).\n" + ) + + +if __name__ == "__main__": + main() diff --git a/tools/codegen/gen_all.py b/tools/codegen/gen_all.py new file mode 100644 index 0000000000..e74d7aafb9 --- /dev/null +++ b/tools/codegen/gen_all.py @@ -0,0 +1,63 @@ +#!/usr/bin/env python3 +"""gen_all.py — regenerate the full per-event MobilityNebula surface from all descriptors in one run.""" +import sys +import json +import argparse +from pathlib import Path + +# Add nebula-generator dir to path so we can import codegen_nebula +sys.path.insert(0, str(Path(__file__).parent)) +from codegen_nebula import emit_operator, inject_cmake_entries, inject_g4, inject_parser_cpp + +DESCRIPTORS = [ + # ordered: smallest first, composed last + ("tfloat-transforms", "tfloat-transforms-descriptor.json"), + ("numeric", "numeric-descriptor.json"), + ("spatial-predicates", "spatial-predicates-descriptor.json"), + ("spatial-phasec-full", "spatial-phasec-full-descriptor.json"), + ("phasec-rest", "phasec-rest-descriptor.json"), + ("trgeo", "trgeo-descriptor.json"), + ("phasec-composed", "phasec-composed-descriptor.json"), +] + + +def main(): + parser = argparse.ArgumentParser( + description="Regenerate the full per-event MobilityNebula surface from all descriptors" + ) + parser.add_argument("--output-root", required=True, help="MobilityNebula repo root") + args = parser.parse_args() + + output_root = Path(args.output_root).resolve() + if not (output_root / "nes-logical-operators").exists(): + sys.exit(f"ERROR: {output_root} does not look like a MobilityNebula root (missing nes-logical-operators/)") + + script_dir = Path(__file__).parent + grand_total = 0 + all_operators = [] + + for family_name, desc_file in DESCRIPTORS: + desc_path = script_dir / desc_file + if not desc_path.exists(): + sys.exit(f"ERROR: descriptor not found: {desc_path}") + with open(desc_path) as f: + config = json.load(f) + operators = config["operators"] + sys.stderr.write(f" {family_name}: {len(operators)} operators\n") + for op in operators: + emit_operator(op, output_root) + all_operators.extend(operators) + grand_total += len(operators) + + sys.stderr.write(f"\nCMakeLists.txt injection:\n") + inject_cmake_entries(all_operators, output_root) + + sys.stderr.write(f"\nParser glue injection:\n") + inject_g4(all_operators, output_root / "nes-sql-parser/AntlrSQL.g4") + inject_parser_cpp(all_operators, output_root / "nes-sql-parser/src/AntlrSQLQueryPlanCreator.cpp") + + sys.stderr.write(f"\nDone. {grand_total} operators regenerated.\n") + + +if __name__ == "__main__": + main() diff --git a/tools/codegen/meos-idl-22a.json b/tools/codegen/meos-idl-22a.json new file mode 100644 index 0000000000..f229dbd51c --- /dev/null +++ b/tools/codegen/meos-idl-22a.json @@ -0,0 +1,97368 @@ +{ + "functions": [ + { + "name": "meos_error", + "file": "meos_error.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "errlevel", + "cType": "int", + "canonical": "int" + }, + { + "name": "errcode", + "cType": "int", + "canonical": "int" + }, + { + "name": "format", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "meos_errno", + "file": "meos_error.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [] + }, + { + "name": "meos_errno_set", + "file": "meos_error.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "err", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "meos_errno_restore", + "file": "meos_error.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "err", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "meos_errno_reset", + "file": "meos_error.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [] + }, + { + "name": "meos_array_create", + "file": "meos.h", + "returnType": { + "c": "MeosArray *", + "canonical": "struct MeosArray *" + }, + "params": [ + { + "name": "elem_size", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "meos_array_add", + "file": "meos.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "array", + "cType": "MeosArray *", + "canonical": "struct MeosArray *" + }, + { + "name": "value", + "cType": "void *", + "canonical": "void *" + } + ] + }, + { + "name": "meos_array_get", + "file": "meos.h", + "returnType": { + "c": "void *", + "canonical": "void *" + }, + "params": [ + { + "name": "array", + "cType": "const MeosArray *", + "canonical": "const struct MeosArray *" + }, + { + "name": "n", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "meos_array_count", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "array", + "cType": "const MeosArray *", + "canonical": "const struct MeosArray *" + } + ] + }, + { + "name": "meos_array_reset", + "file": "meos.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "array", + "cType": "MeosArray *", + "canonical": "struct MeosArray *" + } + ] + }, + { + "name": "meos_array_reset_free", + "file": "meos.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "array", + "cType": "MeosArray *", + "canonical": "struct MeosArray *" + } + ] + }, + { + "name": "meos_array_destroy", + "file": "meos.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "array", + "cType": "MeosArray *", + "canonical": "struct MeosArray *" + } + ] + }, + { + "name": "meos_array_destroy_free", + "file": "meos.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "array", + "cType": "MeosArray *", + "canonical": "struct MeosArray *" + } + ] + }, + { + "name": "rtree_create_intspan", + "file": "meos.h", + "returnType": { + "c": "RTree *", + "canonical": "struct RTree *" + }, + "params": [] + }, + { + "name": "rtree_create_bigintspan", + "file": "meos.h", + "returnType": { + "c": "RTree *", + "canonical": "struct RTree *" + }, + "params": [] + }, + { + "name": "rtree_create_floatspan", + "file": "meos.h", + "returnType": { + "c": "RTree *", + "canonical": "struct RTree *" + }, + "params": [] + }, + { + "name": "rtree_create_datespan", + "file": "meos.h", + "returnType": { + "c": "RTree *", + "canonical": "struct RTree *" + }, + "params": [] + }, + { + "name": "rtree_create_tstzspan", + "file": "meos.h", + "returnType": { + "c": "RTree *", + "canonical": "struct RTree *" + }, + "params": [] + }, + { + "name": "rtree_create_tbox", + "file": "meos.h", + "returnType": { + "c": "RTree *", + "canonical": "struct RTree *" + }, + "params": [] + }, + { + "name": "rtree_create_stbox", + "file": "meos.h", + "returnType": { + "c": "RTree *", + "canonical": "struct RTree *" + }, + "params": [] + }, + { + "name": "rtree_free", + "file": "meos.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "rtree", + "cType": "RTree *", + "canonical": "struct RTree *" + } + ] + }, + { + "name": "rtree_insert", + "file": "meos.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "rtree", + "cType": "RTree *", + "canonical": "struct RTree *" + }, + { + "name": "box", + "cType": "void *", + "canonical": "void *" + }, + { + "name": "id", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "rtree_insert_temporal", + "file": "meos.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "rtree", + "cType": "RTree *", + "canonical": "struct RTree *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "id", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "rtree_insert_temporal_split", + "file": "meos.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "rtree", + "cType": "RTree *", + "canonical": "struct RTree *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "id", + "cType": "int", + "canonical": "int" + }, + { + "name": "maxboxes", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "rtree_search", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "rtree", + "cType": "const RTree *", + "canonical": "const struct RTree *" + }, + { + "name": "op", + "cType": "RTreeSearchOp", + "canonical": "RTreeSearchOp" + }, + { + "name": "query", + "cType": "const void *", + "canonical": "const void *" + }, + { + "name": "result", + "cType": "MeosArray *", + "canonical": "struct MeosArray *" + } + ] + }, + { + "name": "rtree_search_temporal", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "rtree", + "cType": "const RTree *", + "canonical": "const struct RTree *" + }, + { + "name": "op", + "cType": "RTreeSearchOp", + "canonical": "RTreeSearchOp" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "result", + "cType": "MeosArray *", + "canonical": "struct MeosArray *" + } + ] + }, + { + "name": "rtree_search_temporal_dedup", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "rtree", + "cType": "const RTree *", + "canonical": "const struct RTree *" + }, + { + "name": "op", + "cType": "RTreeSearchOp", + "canonical": "RTreeSearchOp" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "maxboxes", + "cType": "int", + "canonical": "int" + }, + { + "name": "result", + "cType": "MeosArray *", + "canonical": "struct MeosArray *" + } + ] + }, + { + "name": "meos_initialize_error_handler", + "file": "meos.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "err_handler", + "cType": "error_handler_fn", + "canonical": "void (*)(int, int, const char *)" + } + ] + }, + { + "name": "meos_initialize_noexit_error_handler", + "file": "meos.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [] + }, + { + "name": "meos_initialize_timezone", + "file": "meos.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "name", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "meos_initialize_collation", + "file": "meos.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [] + }, + { + "name": "meos_finalize_timezone", + "file": "meos.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [] + }, + { + "name": "meos_finalize_collation", + "file": "meos.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [] + }, + { + "name": "meos_finalize_projsrs", + "file": "meos.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [] + }, + { + "name": "meos_finalize_ways", + "file": "meos.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [] + }, + { + "name": "meos_set_datestyle", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "newval", + "cType": "const char *", + "canonical": "const char *" + }, + { + "name": "extra", + "cType": "void *", + "canonical": "void *" + } + ] + }, + { + "name": "meos_set_intervalstyle", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "newval", + "cType": "const char *", + "canonical": "const char *" + }, + { + "name": "extra", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "meos_get_datestyle", + "file": "meos.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [] + }, + { + "name": "meos_get_intervalstyle", + "file": "meos.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [] + }, + { + "name": "meos_set_spatial_ref_sys_csv", + "file": "meos.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "path", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "meos_set_ways_csv", + "file": "meos.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "path", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "meos_initialize", + "file": "meos.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [] + }, + { + "name": "meos_finalize", + "file": "meos.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [] + }, + { + "name": "bigintset_in", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "bigintset_out", + "file": "meos.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "set", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "bigintspan_expand", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "value", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "bigintspan_in", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "bigintspan_out", + "file": "meos.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "bigintspanset_in", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "bigintspanset_out", + "file": "meos.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "dateset_in", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "dateset_out", + "file": "meos.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "datespan_in", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "datespan_out", + "file": "meos.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "datespanset_in", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "datespanset_out", + "file": "meos.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "floatset_in", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "floatset_out", + "file": "meos.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "set", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "floatspan_expand", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "value", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "floatspan_in", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "floatspan_out", + "file": "meos.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "floatspanset_in", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "floatspanset_out", + "file": "meos.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "intset_in", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "intset_out", + "file": "meos.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "set", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "intspan_expand", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "value", + "cType": "int32", + "canonical": "int" + } + ] + }, + { + "name": "intspan_in", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "intspan_out", + "file": "meos.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "intspanset_in", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "intspanset_out", + "file": "meos.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "set_as_hexwkb", + "file": "meos.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "variant", + "cType": "uint8_t", + "canonical": "unsigned char" + }, + { + "name": "size_out", + "cType": "size_t *", + "canonical": "unsigned long *" + } + ] + }, + { + "name": "set_as_wkb", + "file": "meos.h", + "returnType": { + "c": "uint8_t *", + "canonical": "unsigned char *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "variant", + "cType": "uint8_t", + "canonical": "unsigned char" + }, + { + "name": "size_out", + "cType": "size_t *", + "canonical": "unsigned long *" + } + ] + }, + { + "name": "set_from_hexwkb", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "hexwkb", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "set_from_wkb", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "wkb", + "cType": "const uint8_t *", + "canonical": "const unsigned char *" + }, + { + "name": "size", + "cType": "size_t", + "canonical": "unsigned long" + } + ] + }, + { + "name": "span_as_hexwkb", + "file": "meos.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "variant", + "cType": "uint8_t", + "canonical": "unsigned char" + }, + { + "name": "size_out", + "cType": "size_t *", + "canonical": "unsigned long *" + } + ] + }, + { + "name": "span_as_wkb", + "file": "meos.h", + "returnType": { + "c": "uint8_t *", + "canonical": "unsigned char *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "variant", + "cType": "uint8_t", + "canonical": "unsigned char" + }, + { + "name": "size_out", + "cType": "size_t *", + "canonical": "unsigned long *" + } + ] + }, + { + "name": "span_from_hexwkb", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "hexwkb", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "span_from_wkb", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "wkb", + "cType": "const uint8_t *", + "canonical": "const unsigned char *" + }, + { + "name": "size", + "cType": "size_t", + "canonical": "unsigned long" + } + ] + }, + { + "name": "spanset_as_hexwkb", + "file": "meos.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "variant", + "cType": "uint8_t", + "canonical": "unsigned char" + }, + { + "name": "size_out", + "cType": "size_t *", + "canonical": "unsigned long *" + } + ] + }, + { + "name": "spanset_as_wkb", + "file": "meos.h", + "returnType": { + "c": "uint8_t *", + "canonical": "unsigned char *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "variant", + "cType": "uint8_t", + "canonical": "unsigned char" + }, + { + "name": "size_out", + "cType": "size_t *", + "canonical": "unsigned long *" + } + ] + }, + { + "name": "spanset_from_hexwkb", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "hexwkb", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "spanset_from_wkb", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "wkb", + "cType": "const uint8_t *", + "canonical": "const unsigned char *" + }, + { + "name": "size", + "cType": "size_t", + "canonical": "unsigned long" + } + ] + }, + { + "name": "textset_in", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "textset_out", + "file": "meos.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "set", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "tstzset_in", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "tstzset_out", + "file": "meos.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "set", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "tstzspan_in", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "tstzspan_out", + "file": "meos.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "tstzspanset_in", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "tstzspanset_out", + "file": "meos.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "bigintset_make", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "values", + "cType": "const int64 *", + "canonical": "const long *" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "bigintspan_make", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "lower", + "cType": "int64", + "canonical": "long" + }, + { + "name": "upper", + "cType": "int64", + "canonical": "long" + }, + { + "name": "lower_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "upper_inc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "dateset_make", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "values", + "cType": "const DateADT *", + "canonical": "const int *" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "datespan_make", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "lower", + "cType": "DateADT", + "canonical": "int" + }, + { + "name": "upper", + "cType": "DateADT", + "canonical": "int" + }, + { + "name": "lower_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "upper_inc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "floatset_make", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "values", + "cType": "const double *", + "canonical": "const double *" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "floatspan_make", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "lower", + "cType": "double", + "canonical": "double" + }, + { + "name": "upper", + "cType": "double", + "canonical": "double" + }, + { + "name": "lower_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "upper_inc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "intset_make", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "values", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "intspan_make", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "lower", + "cType": "int", + "canonical": "int" + }, + { + "name": "upper", + "cType": "int", + "canonical": "int" + }, + { + "name": "lower_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "upper_inc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "set_copy", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "span_copy", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "spanset_copy", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "spanset_make", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "spans", + "cType": "Span *", + "canonical": "struct Span *" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "textset_make", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "values", + "cType": "int **", + "canonical": "int **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "tstzset_make", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "values", + "cType": "const TimestampTz *", + "canonical": "const long *" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "tstzspan_make", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "lower", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "upper", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "lower_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "upper_inc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "bigint_to_set", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "i", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "bigint_to_span", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "bigint_to_spanset", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "date_to_set", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + } + ] + }, + { + "name": "date_to_span", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + } + ] + }, + { + "name": "date_to_spanset", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + } + ] + }, + { + "name": "dateset_to_tstzset", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "datespan_to_tstzspan", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "datespanset_to_tstzspanset", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "float_to_set", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "float_to_span", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "float_to_spanset", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "floatset_to_intset", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "floatspan_to_intspan", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "floatspan_to_bigintspan", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "floatspanset_to_intspanset", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "int_to_set", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "int_to_span", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "int_to_spanset", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "intset_to_floatset", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "intspan_to_floatspan", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "intspan_to_bigintspan", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "bigintspan_to_intspan", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "bigintspan_to_floatspan", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "intspanset_to_floatspanset", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "set_to_span", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "set_to_spanset", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "span_to_spanset", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "text_to_set", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "txt", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "timestamptz_to_set", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "timestamptz_to_span", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "timestamptz_to_spanset", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "tstzset_to_dateset", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "tstzspan_to_datespan", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "tstzspanset_to_datespanset", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "bigintset_end_value", + "file": "meos.h", + "returnType": { + "c": "int64", + "canonical": "long" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "bigintset_start_value", + "file": "meos.h", + "returnType": { + "c": "int64", + "canonical": "long" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "bigintset_value_n", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "n", + "cType": "int", + "canonical": "int" + }, + { + "name": "result", + "cType": "int64 *", + "canonical": "long *" + } + ] + }, + { + "name": "bigintset_values", + "file": "meos.h", + "returnType": { + "c": "int64 *", + "canonical": "long *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "bigintspan_lower", + "file": "meos.h", + "returnType": { + "c": "int64", + "canonical": "long" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "bigintspan_upper", + "file": "meos.h", + "returnType": { + "c": "int64", + "canonical": "long" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "bigintspan_width", + "file": "meos.h", + "returnType": { + "c": "int64", + "canonical": "long" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "bigintspanset_lower", + "file": "meos.h", + "returnType": { + "c": "int64", + "canonical": "long" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "bigintspanset_upper", + "file": "meos.h", + "returnType": { + "c": "int64", + "canonical": "long" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "bigintspanset_width", + "file": "meos.h", + "returnType": { + "c": "int64", + "canonical": "long" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "boundspan", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "dateset_end_value", + "file": "meos.h", + "returnType": { + "c": "DateADT", + "canonical": "int" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "dateset_start_value", + "file": "meos.h", + "returnType": { + "c": "DateADT", + "canonical": "int" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "dateset_value_n", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "n", + "cType": "int", + "canonical": "int" + }, + { + "name": "result", + "cType": "DateADT *", + "canonical": "int *" + } + ] + }, + { + "name": "dateset_values", + "file": "meos.h", + "returnType": { + "c": "DateADT *", + "canonical": "int *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "datespan_duration", + "file": "meos.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "datespan_lower", + "file": "meos.h", + "returnType": { + "c": "DateADT", + "canonical": "int" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "datespan_upper", + "file": "meos.h", + "returnType": { + "c": "DateADT", + "canonical": "int" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "datespanset_date_n", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "n", + "cType": "int", + "canonical": "int" + }, + { + "name": "result", + "cType": "DateADT *", + "canonical": "int *" + } + ] + }, + { + "name": "datespanset_dates", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "datespanset_duration", + "file": "meos.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "boundspan", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "datespanset_end_date", + "file": "meos.h", + "returnType": { + "c": "DateADT", + "canonical": "int" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "datespanset_num_dates", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "datespanset_start_date", + "file": "meos.h", + "returnType": { + "c": "DateADT", + "canonical": "int" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "floatset_end_value", + "file": "meos.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "floatset_start_value", + "file": "meos.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "floatset_value_n", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "n", + "cType": "int", + "canonical": "int" + }, + { + "name": "result", + "cType": "double *", + "canonical": "double *" + } + ] + }, + { + "name": "floatset_values", + "file": "meos.h", + "returnType": { + "c": "double *", + "canonical": "double *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "floatspan_lower", + "file": "meos.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "floatspan_upper", + "file": "meos.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "floatspan_width", + "file": "meos.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "floatspanset_lower", + "file": "meos.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "floatspanset_upper", + "file": "meos.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "floatspanset_width", + "file": "meos.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "boundspan", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "intset_end_value", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "intset_start_value", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "intset_value_n", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "n", + "cType": "int", + "canonical": "int" + }, + { + "name": "result", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "intset_values", + "file": "meos.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "intspan_lower", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "intspan_upper", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "intspan_width", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "intspanset_lower", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "intspanset_upper", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "intspanset_width", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "boundspan", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "set_hash", + "file": "meos.h", + "returnType": { + "c": "uint32", + "canonical": "unsigned int" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "set_hash_extended", + "file": "meos.h", + "returnType": { + "c": "uint64", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "seed", + "cType": "uint64", + "canonical": "unsigned long" + } + ] + }, + { + "name": "set_num_values", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "span_hash", + "file": "meos.h", + "returnType": { + "c": "uint32", + "canonical": "unsigned int" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "span_hash_extended", + "file": "meos.h", + "returnType": { + "c": "uint64", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "seed", + "cType": "uint64", + "canonical": "unsigned long" + } + ] + }, + { + "name": "span_lower_inc", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "span_upper_inc", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "spanset_end_span", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "spanset_hash", + "file": "meos.h", + "returnType": { + "c": "uint32", + "canonical": "unsigned int" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "spanset_hash_extended", + "file": "meos.h", + "returnType": { + "c": "uint64", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "seed", + "cType": "uint64", + "canonical": "unsigned long" + } + ] + }, + { + "name": "spanset_lower_inc", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "spanset_num_spans", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "spanset_span", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "spanset_span_n", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "spanset_spanarr", + "file": "meos.h", + "returnType": { + "c": "Span **", + "canonical": "struct Span **" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "spanset_start_span", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "spanset_upper_inc", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "textset_end_value", + "file": "meos.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "textset_start_value", + "file": "meos.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "textset_value_n", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "n", + "cType": "int", + "canonical": "int" + }, + { + "name": "result", + "cType": "int **", + "canonical": "int **" + } + ] + }, + { + "name": "textset_values", + "file": "meos.h", + "returnType": { + "c": "int **", + "canonical": "int **" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tstzset_end_value", + "file": "meos.h", + "returnType": { + "c": "TimestampTz", + "canonical": "long" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "tstzset_start_value", + "file": "meos.h", + "returnType": { + "c": "TimestampTz", + "canonical": "long" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "tstzset_value_n", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "n", + "cType": "int", + "canonical": "int" + }, + { + "name": "result", + "cType": "TimestampTz *", + "canonical": "long *" + } + ] + }, + { + "name": "tstzset_values", + "file": "meos.h", + "returnType": { + "c": "TimestampTz *", + "canonical": "long *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tstzspan_duration", + "file": "meos.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "tstzspan_lower", + "file": "meos.h", + "returnType": { + "c": "TimestampTz", + "canonical": "long" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "tstzspan_upper", + "file": "meos.h", + "returnType": { + "c": "TimestampTz", + "canonical": "long" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "tstzspanset_duration", + "file": "meos.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "boundspan", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tstzspanset_end_timestamptz", + "file": "meos.h", + "returnType": { + "c": "TimestampTz", + "canonical": "long" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "tstzspanset_lower", + "file": "meos.h", + "returnType": { + "c": "TimestampTz", + "canonical": "long" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "tstzspanset_num_timestamps", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "tstzspanset_start_timestamptz", + "file": "meos.h", + "returnType": { + "c": "TimestampTz", + "canonical": "long" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "tstzspanset_timestamps", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "tstzspanset_timestamptz_n", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "n", + "cType": "int", + "canonical": "int" + }, + { + "name": "result", + "cType": "TimestampTz *", + "canonical": "long *" + } + ] + }, + { + "name": "tstzspanset_upper", + "file": "meos.h", + "returnType": { + "c": "TimestampTz", + "canonical": "long" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "bigintset_shift_scale", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "shift", + "cType": "int64", + "canonical": "long" + }, + { + "name": "width", + "cType": "int64", + "canonical": "long" + }, + { + "name": "hasshift", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "haswidth", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "bigintspan_shift_scale", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "shift", + "cType": "int64", + "canonical": "long" + }, + { + "name": "width", + "cType": "int64", + "canonical": "long" + }, + { + "name": "hasshift", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "haswidth", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "bigintspanset_shift_scale", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "shift", + "cType": "int64", + "canonical": "long" + }, + { + "name": "width", + "cType": "int64", + "canonical": "long" + }, + { + "name": "hasshift", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "haswidth", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "dateset_shift_scale", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "shift", + "cType": "int", + "canonical": "int" + }, + { + "name": "width", + "cType": "int", + "canonical": "int" + }, + { + "name": "hasshift", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "haswidth", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "datespan_shift_scale", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "shift", + "cType": "int", + "canonical": "int" + }, + { + "name": "width", + "cType": "int", + "canonical": "int" + }, + { + "name": "hasshift", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "haswidth", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "datespanset_shift_scale", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "shift", + "cType": "int", + "canonical": "int" + }, + { + "name": "width", + "cType": "int", + "canonical": "int" + }, + { + "name": "hasshift", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "haswidth", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "floatset_ceil", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "floatset_degrees", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "normalize", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "floatset_floor", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "floatset_radians", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "floatset_shift_scale", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "shift", + "cType": "double", + "canonical": "double" + }, + { + "name": "width", + "cType": "double", + "canonical": "double" + }, + { + "name": "hasshift", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "haswidth", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "floatspan_ceil", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "floatspan_degrees", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "normalize", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "floatspan_floor", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "floatspan_radians", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "floatspan_round", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "floatspan_shift_scale", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "shift", + "cType": "double", + "canonical": "double" + }, + { + "name": "width", + "cType": "double", + "canonical": "double" + }, + { + "name": "hasshift", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "haswidth", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "floatspanset_ceil", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "floatspanset_floor", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "floatspanset_degrees", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "normalize", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "floatspanset_radians", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "floatspanset_round", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "floatspanset_shift_scale", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "shift", + "cType": "double", + "canonical": "double" + }, + { + "name": "width", + "cType": "double", + "canonical": "double" + }, + { + "name": "hasshift", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "haswidth", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "intset_shift_scale", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "shift", + "cType": "int", + "canonical": "int" + }, + { + "name": "width", + "cType": "int", + "canonical": "int" + }, + { + "name": "hasshift", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "haswidth", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "intspan_shift_scale", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "shift", + "cType": "int", + "canonical": "int" + }, + { + "name": "width", + "cType": "int", + "canonical": "int" + }, + { + "name": "hasshift", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "haswidth", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "intspanset_shift_scale", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "shift", + "cType": "int", + "canonical": "int" + }, + { + "name": "width", + "cType": "int", + "canonical": "int" + }, + { + "name": "hasshift", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "haswidth", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tstzspan_expand", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "interv", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "set_round", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "textcat_text_textset", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "txt", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "textcat_textset_text", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "txt", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "textset_initcap", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "textset_lower", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "textset_upper", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "timestamptz_tprecision", + "file": "meos.h", + "returnType": { + "c": "TimestampTz", + "canonical": "long" + }, + "params": [ + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "duration", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "torigin", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "tstzset_shift_scale", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "shift", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "duration", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "tstzset_tprecision", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "duration", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "torigin", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "tstzspan_shift_scale", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "shift", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "duration", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "tstzspan_tprecision", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "duration", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "torigin", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "tstzspanset_shift_scale", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "shift", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "duration", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "tstzspanset_tprecision", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "duration", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "torigin", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "set_cmp", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "s1", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "s2", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "set_eq", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s1", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "s2", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "set_ge", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s1", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "s2", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "set_gt", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s1", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "s2", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "set_le", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s1", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "s2", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "set_lt", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s1", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "s2", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "set_ne", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s1", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "s2", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "span_cmp", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "s1", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "s2", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "span_eq", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s1", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "s2", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "span_ge", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s1", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "s2", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "span_gt", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s1", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "s2", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "span_le", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s1", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "s2", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "span_lt", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s1", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "s2", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "span_ne", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s1", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "s2", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "spanset_cmp", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "ss1", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "ss2", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "spanset_eq", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss1", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "ss2", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "spanset_ge", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss1", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "ss2", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "spanset_gt", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss1", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "ss2", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "spanset_le", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss1", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "ss2", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "spanset_lt", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss1", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "ss2", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "spanset_ne", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss1", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "ss2", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "set_spans", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "set_split_each_n_spans", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "elems_per_span", + "cType": "int", + "canonical": "int" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "set_split_n_spans", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "span_count", + "cType": "int", + "canonical": "int" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "spanset_spans", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "spanset_split_each_n_spans", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "elems_per_span", + "cType": "int", + "canonical": "int" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "spanset_split_n_spans", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "span_count", + "cType": "int", + "canonical": "int" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "adjacent_span_bigint", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "i", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "adjacent_span_date", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + } + ] + }, + { + "name": "adjacent_span_float", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "adjacent_span_int", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "adjacent_span_span", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s1", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "s2", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "adjacent_span_spanset", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "adjacent_span_timestamptz", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "adjacent_spanset_bigint", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "i", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "adjacent_spanset_date", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + } + ] + }, + { + "name": "adjacent_spanset_float", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "adjacent_spanset_int", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "adjacent_spanset_timestamptz", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "adjacent_spanset_span", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "adjacent_spanset_spanset", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss1", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "ss2", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "contained_bigint_set", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "i", + "cType": "int64", + "canonical": "long" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "contained_bigint_span", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "i", + "cType": "int64", + "canonical": "long" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "contained_bigint_spanset", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "i", + "cType": "int64", + "canonical": "long" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "contained_date_set", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "contained_date_span", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "contained_date_spanset", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "contained_float_set", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "contained_float_span", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "contained_float_spanset", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "contained_int_set", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "contained_int_span", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "contained_int_spanset", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "contained_set_set", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s1", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "s2", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "contained_span_span", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s1", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "s2", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "contained_span_spanset", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "contained_spanset_span", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "contained_spanset_spanset", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss1", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "ss2", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "contained_text_set", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "txt", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "contained_timestamptz_set", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "contained_timestamptz_span", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "contained_timestamptz_spanset", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "contains_set_bigint", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "i", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "contains_set_date", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + } + ] + }, + { + "name": "contains_set_float", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "contains_set_int", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "contains_set_set", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s1", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "s2", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "contains_set_text", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "t", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "contains_set_timestamptz", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "contains_span_bigint", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "i", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "contains_span_date", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + } + ] + }, + { + "name": "contains_span_float", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "contains_span_int", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "contains_span_span", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s1", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "s2", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "contains_span_spanset", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "contains_span_timestamptz", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "contains_spanset_bigint", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "i", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "contains_spanset_date", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + } + ] + }, + { + "name": "contains_spanset_float", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "contains_spanset_int", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "contains_spanset_span", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "contains_spanset_spanset", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss1", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "ss2", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "contains_spanset_timestamptz", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "overlaps_set_set", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s1", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "s2", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "overlaps_span_span", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s1", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "s2", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "overlaps_span_spanset", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "overlaps_spanset_span", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "overlaps_spanset_spanset", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss1", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "ss2", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "after_date_set", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "after_date_span", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "after_date_spanset", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "after_set_date", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + } + ] + }, + { + "name": "after_set_timestamptz", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "after_span_date", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + } + ] + }, + { + "name": "after_span_timestamptz", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "after_spanset_date", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + } + ] + }, + { + "name": "after_spanset_timestamptz", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "after_timestamptz_set", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "after_timestamptz_span", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "after_timestamptz_spanset", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "before_date_set", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "before_date_span", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "before_date_spanset", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "before_set_date", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + } + ] + }, + { + "name": "before_set_timestamptz", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "before_span_date", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + } + ] + }, + { + "name": "before_span_timestamptz", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "before_spanset_date", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + } + ] + }, + { + "name": "before_spanset_timestamptz", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "before_timestamptz_set", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "before_timestamptz_span", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "before_timestamptz_spanset", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "left_bigint_set", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "i", + "cType": "int64", + "canonical": "long" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "left_bigint_span", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "i", + "cType": "int64", + "canonical": "long" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "left_bigint_spanset", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "i", + "cType": "int64", + "canonical": "long" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "left_float_set", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "left_float_span", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "left_float_spanset", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "left_int_set", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "left_int_span", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "left_int_spanset", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "left_set_bigint", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "i", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "left_set_float", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "left_set_int", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "left_set_set", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s1", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "s2", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "left_set_text", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "txt", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "left_span_bigint", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "i", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "left_span_float", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "left_span_int", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "left_span_span", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s1", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "s2", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "left_span_spanset", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "left_spanset_bigint", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "i", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "left_spanset_float", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "left_spanset_int", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "left_spanset_span", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "left_spanset_spanset", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss1", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "ss2", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "left_text_set", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "txt", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "overafter_date_set", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "overafter_date_span", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "overafter_date_spanset", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "overafter_set_date", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + } + ] + }, + { + "name": "overafter_set_timestamptz", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "overafter_span_date", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + } + ] + }, + { + "name": "overafter_span_timestamptz", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "overafter_spanset_date", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + } + ] + }, + { + "name": "overafter_spanset_timestamptz", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "overafter_timestamptz_set", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "overafter_timestamptz_span", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "overafter_timestamptz_spanset", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "overbefore_date_set", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "overbefore_date_span", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "overbefore_date_spanset", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "overbefore_set_date", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + } + ] + }, + { + "name": "overbefore_set_timestamptz", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "overbefore_span_date", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + } + ] + }, + { + "name": "overbefore_span_timestamptz", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "overbefore_spanset_date", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + } + ] + }, + { + "name": "overbefore_spanset_timestamptz", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "overbefore_timestamptz_set", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "overbefore_timestamptz_span", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "overbefore_timestamptz_spanset", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "overleft_bigint_set", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "i", + "cType": "int64", + "canonical": "long" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "overleft_bigint_span", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "i", + "cType": "int64", + "canonical": "long" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "overleft_bigint_spanset", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "i", + "cType": "int64", + "canonical": "long" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "overleft_float_set", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "overleft_float_span", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "overleft_float_spanset", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "overleft_int_set", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "overleft_int_span", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "overleft_int_spanset", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "overleft_set_bigint", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "i", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "overleft_set_float", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "overleft_set_int", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "overleft_set_set", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s1", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "s2", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "overleft_set_text", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "txt", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "overleft_span_bigint", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "i", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "overleft_span_float", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "overleft_span_int", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "overleft_span_span", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s1", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "s2", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "overleft_span_spanset", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "overleft_spanset_bigint", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "i", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "overleft_spanset_float", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "overleft_spanset_int", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "overleft_spanset_span", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "overleft_spanset_spanset", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss1", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "ss2", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "overleft_text_set", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "txt", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "overright_bigint_set", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "i", + "cType": "int64", + "canonical": "long" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "overright_bigint_span", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "i", + "cType": "int64", + "canonical": "long" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "overright_bigint_spanset", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "i", + "cType": "int64", + "canonical": "long" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "overright_float_set", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "overright_float_span", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "overright_float_spanset", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "overright_int_set", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "overright_int_span", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "overright_int_spanset", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "overright_set_bigint", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "i", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "overright_set_float", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "overright_set_int", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "overright_set_set", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s1", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "s2", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "overright_set_text", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "txt", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "overright_span_bigint", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "i", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "overright_span_float", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "overright_span_int", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "overright_span_span", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s1", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "s2", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "overright_span_spanset", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "overright_spanset_bigint", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "i", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "overright_spanset_float", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "overright_spanset_int", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "overright_spanset_span", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "overright_spanset_spanset", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss1", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "ss2", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "overright_text_set", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "txt", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "right_bigint_set", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "i", + "cType": "int64", + "canonical": "long" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "right_bigint_span", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "i", + "cType": "int64", + "canonical": "long" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "right_bigint_spanset", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "i", + "cType": "int64", + "canonical": "long" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "right_float_set", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "right_float_span", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "right_float_spanset", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "right_int_set", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "right_int_span", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "right_int_spanset", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "right_set_bigint", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "i", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "right_set_float", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "right_set_int", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "right_set_set", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s1", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "s2", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "right_set_text", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "txt", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "right_span_bigint", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "i", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "right_span_float", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "right_span_int", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "right_span_span", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s1", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "s2", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "right_span_spanset", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "right_spanset_bigint", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "i", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "right_spanset_float", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "right_spanset_int", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "right_spanset_span", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "right_spanset_spanset", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss1", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "ss2", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "right_text_set", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "txt", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "intersection_bigint_set", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "i", + "cType": "int64", + "canonical": "long" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "intersection_date_set", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "intersection_float_set", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "intersection_int_set", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "intersection_set_bigint", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "i", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "intersection_set_date", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + } + ] + }, + { + "name": "intersection_set_float", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "intersection_set_int", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "intersection_set_set", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s1", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "s2", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "intersection_set_text", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "txt", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "intersection_set_timestamptz", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "intersection_span_bigint", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "i", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "intersection_span_date", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + } + ] + }, + { + "name": "intersection_span_float", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "intersection_span_int", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "intersection_span_span", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "s1", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "s2", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "intersection_span_spanset", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "intersection_span_timestamptz", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "intersection_spanset_bigint", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "i", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "intersection_spanset_date", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + } + ] + }, + { + "name": "intersection_spanset_float", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "intersection_spanset_int", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "intersection_spanset_span", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "intersection_spanset_spanset", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "ss1", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "ss2", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "intersection_spanset_timestamptz", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "intersection_text_set", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "txt", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "intersection_timestamptz_set", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "minus_bigint_set", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "i", + "cType": "int64", + "canonical": "long" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "minus_bigint_span", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "i", + "cType": "int64", + "canonical": "long" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "minus_bigint_spanset", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "i", + "cType": "int64", + "canonical": "long" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "minus_date_set", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "minus_date_span", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "minus_date_spanset", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "minus_float_set", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "minus_float_span", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "minus_float_spanset", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "minus_int_set", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "minus_int_span", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "minus_int_spanset", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "minus_set_bigint", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "i", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "minus_set_date", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + } + ] + }, + { + "name": "minus_set_float", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "minus_set_int", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "minus_set_set", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s1", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "s2", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "minus_set_text", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "txt", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "minus_set_timestamptz", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "minus_span_bigint", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "i", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "minus_span_date", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + } + ] + }, + { + "name": "minus_span_float", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "minus_span_int", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "minus_span_span", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "s1", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "s2", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "minus_span_spanset", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "minus_span_timestamptz", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "minus_spanset_bigint", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "i", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "minus_spanset_date", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + } + ] + }, + { + "name": "minus_spanset_float", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "minus_spanset_int", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "minus_spanset_span", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "minus_spanset_spanset", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "ss1", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "ss2", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "minus_spanset_timestamptz", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "minus_text_set", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "txt", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "minus_timestamptz_set", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "minus_timestamptz_span", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "minus_timestamptz_spanset", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "union_bigint_set", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "i", + "cType": "int64", + "canonical": "long" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "union_bigint_span", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "i", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "union_bigint_spanset", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "i", + "cType": "int64", + "canonical": "long" + }, + { + "name": "ss", + "cType": "SpanSet *", + "canonical": "struct SpanSet *" + } + ] + }, + { + "name": "union_date_set", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "union_date_span", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + } + ] + }, + { + "name": "union_date_spanset", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + }, + { + "name": "ss", + "cType": "SpanSet *", + "canonical": "struct SpanSet *" + } + ] + }, + { + "name": "union_float_set", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "union_float_span", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "union_float_spanset", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + }, + { + "name": "ss", + "cType": "SpanSet *", + "canonical": "struct SpanSet *" + } + ] + }, + { + "name": "union_int_set", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "union_int_span", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "union_int_spanset", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + }, + { + "name": "ss", + "cType": "SpanSet *", + "canonical": "struct SpanSet *" + } + ] + }, + { + "name": "union_set_bigint", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "i", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "union_set_date", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + } + ] + }, + { + "name": "union_set_float", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "union_set_int", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "union_set_set", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s1", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "s2", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "union_set_text", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "txt", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "union_set_timestamptz", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "union_span_bigint", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "i", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "union_span_date", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + } + ] + }, + { + "name": "union_span_float", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "union_span_int", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "union_span_span", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "s1", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "s2", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "super_union_span_span", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "s1", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "s2", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "union_span_spanset", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "union_span_timestamptz", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "union_spanset_bigint", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "i", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "union_spanset_date", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + } + ] + }, + { + "name": "union_spanset_float", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "union_spanset_int", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "union_spanset_span", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "union_spanset_spanset", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "ss1", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "ss2", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "union_spanset_timestamptz", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "union_text_set", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "txt", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "union_timestamptz_set", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "union_timestamptz_span", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "union_timestamptz_spanset", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "ss", + "cType": "SpanSet *", + "canonical": "struct SpanSet *" + } + ] + }, + { + "name": "distance_bigintset_bigintset", + "file": "meos.h", + "returnType": { + "c": "int64", + "canonical": "long" + }, + "params": [ + { + "name": "s1", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "s2", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "distance_bigintspan_bigintspan", + "file": "meos.h", + "returnType": { + "c": "int64", + "canonical": "long" + }, + "params": [ + { + "name": "s1", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "s2", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "distance_bigintspanset_bigintspan", + "file": "meos.h", + "returnType": { + "c": "int64", + "canonical": "long" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "distance_bigintspanset_bigintspanset", + "file": "meos.h", + "returnType": { + "c": "int64", + "canonical": "long" + }, + "params": [ + { + "name": "ss1", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "ss2", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "distance_dateset_dateset", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "s1", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "s2", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "distance_datespan_datespan", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "s1", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "s2", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "distance_datespanset_datespan", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "distance_datespanset_datespanset", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "ss1", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "ss2", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "distance_floatset_floatset", + "file": "meos.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "s1", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "s2", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "distance_floatspan_floatspan", + "file": "meos.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "s1", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "s2", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "distance_floatspanset_floatspan", + "file": "meos.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "distance_floatspanset_floatspanset", + "file": "meos.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "ss1", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "ss2", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "distance_intset_intset", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "s1", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "s2", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "distance_intspan_intspan", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "s1", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "s2", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "distance_intspanset_intspan", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "distance_intspanset_intspanset", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "ss1", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "ss2", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "distance_set_bigint", + "file": "meos.h", + "returnType": { + "c": "int64", + "canonical": "long" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "i", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "distance_set_date", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + } + ] + }, + { + "name": "distance_set_float", + "file": "meos.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "distance_set_int", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "distance_set_timestamptz", + "file": "meos.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "distance_span_bigint", + "file": "meos.h", + "returnType": { + "c": "int64", + "canonical": "long" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "i", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "distance_span_date", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + } + ] + }, + { + "name": "distance_span_float", + "file": "meos.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "distance_span_int", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "distance_span_timestamptz", + "file": "meos.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "distance_spanset_bigint", + "file": "meos.h", + "returnType": { + "c": "int64", + "canonical": "long" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "i", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "distance_spanset_date", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + } + ] + }, + { + "name": "distance_spanset_float", + "file": "meos.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "distance_spanset_int", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "distance_spanset_timestamptz", + "file": "meos.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "distance_tstzset_tstzset", + "file": "meos.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "s1", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "s2", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "distance_tstzspan_tstzspan", + "file": "meos.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "s1", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "s2", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "distance_tstzspanset_tstzspan", + "file": "meos.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "distance_tstzspanset_tstzspanset", + "file": "meos.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "ss1", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "ss2", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "bigint_extent_transfn", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "state", + "cType": "Span *", + "canonical": "struct Span *" + }, + { + "name": "i", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "bigint_union_transfn", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "state", + "cType": "Set *", + "canonical": "Set *" + }, + { + "name": "i", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "date_extent_transfn", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "state", + "cType": "Span *", + "canonical": "struct Span *" + }, + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + } + ] + }, + { + "name": "date_union_transfn", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "state", + "cType": "Set *", + "canonical": "Set *" + }, + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + } + ] + }, + { + "name": "float_extent_transfn", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "state", + "cType": "Span *", + "canonical": "struct Span *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "float_union_transfn", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "state", + "cType": "Set *", + "canonical": "Set *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "int_extent_transfn", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "state", + "cType": "Span *", + "canonical": "struct Span *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "int_union_transfn", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "state", + "cType": "Set *", + "canonical": "Set *" + }, + { + "name": "i", + "cType": "int32", + "canonical": "int" + } + ] + }, + { + "name": "set_extent_transfn", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "state", + "cType": "Span *", + "canonical": "struct Span *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "set_union_finalfn", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "state", + "cType": "Set *", + "canonical": "Set *" + } + ] + }, + { + "name": "set_union_transfn", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "state", + "cType": "Set *", + "canonical": "Set *" + }, + { + "name": "s", + "cType": "Set *", + "canonical": "Set *" + } + ] + }, + { + "name": "span_extent_transfn", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "state", + "cType": "Span *", + "canonical": "struct Span *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "span_union_transfn", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "state", + "cType": "SpanSet *", + "canonical": "struct SpanSet *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "spanset_extent_transfn", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "state", + "cType": "Span *", + "canonical": "struct Span *" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "spanset_union_finalfn", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "state", + "cType": "SpanSet *", + "canonical": "struct SpanSet *" + } + ] + }, + { + "name": "spanset_union_transfn", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "state", + "cType": "SpanSet *", + "canonical": "struct SpanSet *" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "text_union_transfn", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "state", + "cType": "Set *", + "canonical": "Set *" + }, + { + "name": "txt", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "timestamptz_extent_transfn", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "state", + "cType": "Span *", + "canonical": "struct Span *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "timestamptz_union_transfn", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "state", + "cType": "Set *", + "canonical": "Set *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "bigint_get_bin", + "file": "meos.h", + "returnType": { + "c": "int64", + "canonical": "long" + }, + "params": [ + { + "name": "value", + "cType": "int64", + "canonical": "long" + }, + { + "name": "vsize", + "cType": "int64", + "canonical": "long" + }, + { + "name": "vorigin", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "bigintspan_bins", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "vsize", + "cType": "int64", + "canonical": "long" + }, + { + "name": "vorigin", + "cType": "int64", + "canonical": "long" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "bigintspanset_bins", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "vsize", + "cType": "int64", + "canonical": "long" + }, + { + "name": "vorigin", + "cType": "int64", + "canonical": "long" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "date_get_bin", + "file": "meos.h", + "returnType": { + "c": "DateADT", + "canonical": "int" + }, + "params": [ + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + }, + { + "name": "duration", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "torigin", + "cType": "DateADT", + "canonical": "int" + } + ] + }, + { + "name": "datespan_bins", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "duration", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "torigin", + "cType": "DateADT", + "canonical": "int" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "datespanset_bins", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "duration", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "torigin", + "cType": "DateADT", + "canonical": "int" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "float_get_bin", + "file": "meos.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "value", + "cType": "double", + "canonical": "double" + }, + { + "name": "vsize", + "cType": "double", + "canonical": "double" + }, + { + "name": "vorigin", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "floatspan_bins", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "vsize", + "cType": "double", + "canonical": "double" + }, + { + "name": "vorigin", + "cType": "double", + "canonical": "double" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "floatspanset_bins", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "vsize", + "cType": "double", + "canonical": "double" + }, + { + "name": "vorigin", + "cType": "double", + "canonical": "double" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "int_get_bin", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "value", + "cType": "int", + "canonical": "int" + }, + { + "name": "vsize", + "cType": "int", + "canonical": "int" + }, + { + "name": "vorigin", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "intspan_bins", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "vsize", + "cType": "int", + "canonical": "int" + }, + { + "name": "vorigin", + "cType": "int", + "canonical": "int" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "intspanset_bins", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "vsize", + "cType": "int", + "canonical": "int" + }, + { + "name": "vorigin", + "cType": "int", + "canonical": "int" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "timestamptz_get_bin", + "file": "meos.h", + "returnType": { + "c": "TimestampTz", + "canonical": "long" + }, + "params": [ + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "duration", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "torigin", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "tstzspan_bins", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "duration", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "origin", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tstzspanset_bins", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "duration", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "torigin", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tbox_as_hexwkb", + "file": "meos.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const struct TBox *" + }, + { + "name": "variant", + "cType": "uint8_t", + "canonical": "unsigned char" + }, + { + "name": "size", + "cType": "size_t *", + "canonical": "unsigned long *" + } + ] + }, + { + "name": "tbox_as_wkb", + "file": "meos.h", + "returnType": { + "c": "uint8_t *", + "canonical": "unsigned char *" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const struct TBox *" + }, + { + "name": "variant", + "cType": "uint8_t", + "canonical": "unsigned char" + }, + { + "name": "size_out", + "cType": "size_t *", + "canonical": "unsigned long *" + } + ] + }, + { + "name": "tbox_from_hexwkb", + "file": "meos.h", + "returnType": { + "c": "TBox *", + "canonical": "struct TBox *" + }, + "params": [ + { + "name": "hexwkb", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "tbox_from_wkb", + "file": "meos.h", + "returnType": { + "c": "TBox *", + "canonical": "struct TBox *" + }, + "params": [ + { + "name": "wkb", + "cType": "const uint8_t *", + "canonical": "const unsigned char *" + }, + { + "name": "size", + "cType": "size_t", + "canonical": "unsigned long" + } + ] + }, + { + "name": "tbox_in", + "file": "meos.h", + "returnType": { + "c": "TBox *", + "canonical": "struct TBox *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "tbox_out", + "file": "meos.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const struct TBox *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "float_timestamptz_to_tbox", + "file": "meos.h", + "returnType": { + "c": "TBox *", + "canonical": "struct TBox *" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "float_tstzspan_to_tbox", + "file": "meos.h", + "returnType": { + "c": "TBox *", + "canonical": "struct TBox *" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "int_timestamptz_to_tbox", + "file": "meos.h", + "returnType": { + "c": "TBox *", + "canonical": "struct TBox *" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "bigint_timestamptz_to_tbox", + "file": "meos.h", + "returnType": { + "c": "TBox *", + "canonical": "struct TBox *" + }, + "params": [ + { + "name": "i", + "cType": "int64", + "canonical": "long" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "int_tstzspan_to_tbox", + "file": "meos.h", + "returnType": { + "c": "TBox *", + "canonical": "struct TBox *" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "bigint_tstzspan_to_tbox", + "file": "meos.h", + "returnType": { + "c": "TBox *", + "canonical": "struct TBox *" + }, + "params": [ + { + "name": "i", + "cType": "int64", + "canonical": "long" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "numspan_tstzspan_to_tbox", + "file": "meos.h", + "returnType": { + "c": "TBox *", + "canonical": "struct TBox *" + }, + "params": [ + { + "name": "span", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "numspan_timestamptz_to_tbox", + "file": "meos.h", + "returnType": { + "c": "TBox *", + "canonical": "struct TBox *" + }, + "params": [ + { + "name": "span", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "tbox_copy", + "file": "meos.h", + "returnType": { + "c": "TBox *", + "canonical": "struct TBox *" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const struct TBox *" + } + ] + }, + { + "name": "tbox_make", + "file": "meos.h", + "returnType": { + "c": "TBox *", + "canonical": "struct TBox *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "p", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "float_to_tbox", + "file": "meos.h", + "returnType": { + "c": "TBox *", + "canonical": "struct TBox *" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "int_to_tbox", + "file": "meos.h", + "returnType": { + "c": "TBox *", + "canonical": "struct TBox *" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "bigint_to_tbox", + "file": "meos.h", + "returnType": { + "c": "TBox *", + "canonical": "struct TBox *" + }, + "params": [ + { + "name": "i", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "set_to_tbox", + "file": "meos.h", + "returnType": { + "c": "TBox *", + "canonical": "struct TBox *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "span_to_tbox", + "file": "meos.h", + "returnType": { + "c": "TBox *", + "canonical": "struct TBox *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "spanset_to_tbox", + "file": "meos.h", + "returnType": { + "c": "TBox *", + "canonical": "struct TBox *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "tbox_to_intspan", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const struct TBox *" + } + ] + }, + { + "name": "tbox_to_bigintspan", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const struct TBox *" + } + ] + }, + { + "name": "tbox_to_floatspan", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const struct TBox *" + } + ] + }, + { + "name": "tbox_to_tstzspan", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const struct TBox *" + } + ] + }, + { + "name": "timestamptz_to_tbox", + "file": "meos.h", + "returnType": { + "c": "TBox *", + "canonical": "struct TBox *" + }, + "params": [ + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "tbox_hash", + "file": "meos.h", + "returnType": { + "c": "uint32", + "canonical": "unsigned int" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const struct TBox *" + } + ] + }, + { + "name": "tbox_hash_extended", + "file": "meos.h", + "returnType": { + "c": "uint64", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const struct TBox *" + }, + { + "name": "seed", + "cType": "uint64", + "canonical": "unsigned long" + } + ] + }, + { + "name": "tbox_hast", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const struct TBox *" + } + ] + }, + { + "name": "tbox_hasx", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const struct TBox *" + } + ] + }, + { + "name": "tbox_tmax", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const struct TBox *" + }, + { + "name": "result", + "cType": "TimestampTz *", + "canonical": "long *" + } + ] + }, + { + "name": "tbox_tmax_inc", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const struct TBox *" + }, + { + "name": "result", + "cType": "bool *", + "canonical": "_Bool *" + } + ] + }, + { + "name": "tbox_tmin", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const struct TBox *" + }, + { + "name": "result", + "cType": "TimestampTz *", + "canonical": "long *" + } + ] + }, + { + "name": "tbox_tmin_inc", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const struct TBox *" + }, + { + "name": "result", + "cType": "bool *", + "canonical": "_Bool *" + } + ] + }, + { + "name": "tbox_xmax", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const struct TBox *" + }, + { + "name": "result", + "cType": "double *", + "canonical": "double *" + } + ] + }, + { + "name": "tbox_xmax_inc", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const struct TBox *" + }, + { + "name": "result", + "cType": "bool *", + "canonical": "_Bool *" + } + ] + }, + { + "name": "tbox_xmin", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const struct TBox *" + }, + { + "name": "result", + "cType": "double *", + "canonical": "double *" + } + ] + }, + { + "name": "tbox_xmin_inc", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const struct TBox *" + }, + { + "name": "result", + "cType": "bool *", + "canonical": "_Bool *" + } + ] + }, + { + "name": "tboxfloat_xmax", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const struct TBox *" + }, + { + "name": "result", + "cType": "double *", + "canonical": "double *" + } + ] + }, + { + "name": "tboxfloat_xmin", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const struct TBox *" + }, + { + "name": "result", + "cType": "double *", + "canonical": "double *" + } + ] + }, + { + "name": "tboxint_xmax", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const struct TBox *" + }, + { + "name": "result", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tboxbigint_xmax", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const struct TBox *" + }, + { + "name": "result", + "cType": "int64 *", + "canonical": "long *" + } + ] + }, + { + "name": "tboxint_xmin", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const struct TBox *" + }, + { + "name": "result", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tboxbigint_xmin", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const struct TBox *" + }, + { + "name": "result", + "cType": "int64 *", + "canonical": "long *" + } + ] + }, + { + "name": "tfloatbox_expand", + "file": "meos.h", + "returnType": { + "c": "TBox *", + "canonical": "struct TBox *" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const struct TBox *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "tintbox_expand", + "file": "meos.h", + "returnType": { + "c": "TBox *", + "canonical": "struct TBox *" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const struct TBox *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "tbox_expand_time", + "file": "meos.h", + "returnType": { + "c": "TBox *", + "canonical": "struct TBox *" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const struct TBox *" + }, + { + "name": "interv", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "tbox_round", + "file": "meos.h", + "returnType": { + "c": "TBox *", + "canonical": "struct TBox *" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const struct TBox *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "tfloatbox_shift_scale", + "file": "meos.h", + "returnType": { + "c": "TBox *", + "canonical": "struct TBox *" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const struct TBox *" + }, + { + "name": "shift", + "cType": "double", + "canonical": "double" + }, + { + "name": "width", + "cType": "double", + "canonical": "double" + }, + { + "name": "hasshift", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "haswidth", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tintbox_shift_scale", + "file": "meos.h", + "returnType": { + "c": "TBox *", + "canonical": "struct TBox *" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const struct TBox *" + }, + { + "name": "shift", + "cType": "int", + "canonical": "int" + }, + { + "name": "width", + "cType": "int", + "canonical": "int" + }, + { + "name": "hasshift", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "haswidth", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tbox_shift_scale_time", + "file": "meos.h", + "returnType": { + "c": "TBox *", + "canonical": "struct TBox *" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const struct TBox *" + }, + { + "name": "shift", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "duration", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "tbigintbox_expand", + "file": "meos.h", + "returnType": { + "c": "TBox *", + "canonical": "struct TBox *" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const struct TBox *" + }, + { + "name": "i", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "tbigintbox_shift_scale", + "file": "meos.h", + "returnType": { + "c": "TBox *", + "canonical": "struct TBox *" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const struct TBox *" + }, + { + "name": "shift", + "cType": "int64", + "canonical": "long" + }, + { + "name": "width", + "cType": "int64", + "canonical": "long" + }, + { + "name": "hasshift", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "haswidth", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "union_tbox_tbox", + "file": "meos.h", + "returnType": { + "c": "TBox *", + "canonical": "struct TBox *" + }, + "params": [ + { + "name": "box1", + "cType": "const TBox *", + "canonical": "const struct TBox *" + }, + { + "name": "box2", + "cType": "const TBox *", + "canonical": "const struct TBox *" + }, + { + "name": "strict", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "intersection_tbox_tbox", + "file": "meos.h", + "returnType": { + "c": "TBox *", + "canonical": "struct TBox *" + }, + "params": [ + { + "name": "box1", + "cType": "const TBox *", + "canonical": "const struct TBox *" + }, + { + "name": "box2", + "cType": "const TBox *", + "canonical": "const struct TBox *" + } + ] + }, + { + "name": "adjacent_tbox_tbox", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const TBox *", + "canonical": "const struct TBox *" + }, + { + "name": "box2", + "cType": "const TBox *", + "canonical": "const struct TBox *" + } + ] + }, + { + "name": "contained_tbox_tbox", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const TBox *", + "canonical": "const struct TBox *" + }, + { + "name": "box2", + "cType": "const TBox *", + "canonical": "const struct TBox *" + } + ] + }, + { + "name": "contains_tbox_tbox", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const TBox *", + "canonical": "const struct TBox *" + }, + { + "name": "box2", + "cType": "const TBox *", + "canonical": "const struct TBox *" + } + ] + }, + { + "name": "overlaps_tbox_tbox", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const TBox *", + "canonical": "const struct TBox *" + }, + { + "name": "box2", + "cType": "const TBox *", + "canonical": "const struct TBox *" + } + ] + }, + { + "name": "same_tbox_tbox", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const TBox *", + "canonical": "const struct TBox *" + }, + { + "name": "box2", + "cType": "const TBox *", + "canonical": "const struct TBox *" + } + ] + }, + { + "name": "after_tbox_tbox", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const TBox *", + "canonical": "const struct TBox *" + }, + { + "name": "box2", + "cType": "const TBox *", + "canonical": "const struct TBox *" + } + ] + }, + { + "name": "before_tbox_tbox", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const TBox *", + "canonical": "const struct TBox *" + }, + { + "name": "box2", + "cType": "const TBox *", + "canonical": "const struct TBox *" + } + ] + }, + { + "name": "left_tbox_tbox", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const TBox *", + "canonical": "const struct TBox *" + }, + { + "name": "box2", + "cType": "const TBox *", + "canonical": "const struct TBox *" + } + ] + }, + { + "name": "overafter_tbox_tbox", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const TBox *", + "canonical": "const struct TBox *" + }, + { + "name": "box2", + "cType": "const TBox *", + "canonical": "const struct TBox *" + } + ] + }, + { + "name": "overbefore_tbox_tbox", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const TBox *", + "canonical": "const struct TBox *" + }, + { + "name": "box2", + "cType": "const TBox *", + "canonical": "const struct TBox *" + } + ] + }, + { + "name": "overleft_tbox_tbox", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const TBox *", + "canonical": "const struct TBox *" + }, + { + "name": "box2", + "cType": "const TBox *", + "canonical": "const struct TBox *" + } + ] + }, + { + "name": "overright_tbox_tbox", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const TBox *", + "canonical": "const struct TBox *" + }, + { + "name": "box2", + "cType": "const TBox *", + "canonical": "const struct TBox *" + } + ] + }, + { + "name": "right_tbox_tbox", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const TBox *", + "canonical": "const struct TBox *" + }, + { + "name": "box2", + "cType": "const TBox *", + "canonical": "const struct TBox *" + } + ] + }, + { + "name": "tbox_cmp", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "box1", + "cType": "const TBox *", + "canonical": "const struct TBox *" + }, + { + "name": "box2", + "cType": "const TBox *", + "canonical": "const struct TBox *" + } + ] + }, + { + "name": "tbox_eq", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const TBox *", + "canonical": "const struct TBox *" + }, + { + "name": "box2", + "cType": "const TBox *", + "canonical": "const struct TBox *" + } + ] + }, + { + "name": "tbox_ge", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const TBox *", + "canonical": "const struct TBox *" + }, + { + "name": "box2", + "cType": "const TBox *", + "canonical": "const struct TBox *" + } + ] + }, + { + "name": "tbox_gt", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const TBox *", + "canonical": "const struct TBox *" + }, + { + "name": "box2", + "cType": "const TBox *", + "canonical": "const struct TBox *" + } + ] + }, + { + "name": "tbox_le", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const TBox *", + "canonical": "const struct TBox *" + }, + { + "name": "box2", + "cType": "const TBox *", + "canonical": "const struct TBox *" + } + ] + }, + { + "name": "tbox_lt", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const TBox *", + "canonical": "const struct TBox *" + }, + { + "name": "box2", + "cType": "const TBox *", + "canonical": "const struct TBox *" + } + ] + }, + { + "name": "tbox_ne", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const TBox *", + "canonical": "const struct TBox *" + }, + { + "name": "box2", + "cType": "const TBox *", + "canonical": "const struct TBox *" + } + ] + }, + { + "name": "tbool_from_mfjson", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "tbool_in", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "tbool_out", + "file": "meos.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "temporal_as_hexwkb", + "file": "meos.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "variant", + "cType": "uint8_t", + "canonical": "unsigned char" + }, + { + "name": "size_out", + "cType": "size_t *", + "canonical": "unsigned long *" + } + ] + }, + { + "name": "temporal_as_mfjson", + "file": "meos.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "with_bbox", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "flags", + "cType": "int", + "canonical": "int" + }, + { + "name": "precision", + "cType": "int", + "canonical": "int" + }, + { + "name": "srs", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "temporal_as_wkb", + "file": "meos.h", + "returnType": { + "c": "uint8_t *", + "canonical": "unsigned char *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "variant", + "cType": "uint8_t", + "canonical": "unsigned char" + }, + { + "name": "size_out", + "cType": "size_t *", + "canonical": "unsigned long *" + } + ] + }, + { + "name": "temporal_from_hexwkb", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "hexwkb", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "temporal_from_wkb", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "wkb", + "cType": "const uint8_t *", + "canonical": "const unsigned char *" + }, + { + "name": "size", + "cType": "size_t", + "canonical": "unsigned long" + } + ] + }, + { + "name": "tfloat_from_mfjson", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "tfloat_in", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "tfloat_out", + "file": "meos.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "tint_from_mfjson", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "tbigint_from_mfjson", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "tint_in", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "tbigint_in", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "tint_out", + "file": "meos.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tbigint_out", + "file": "meos.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ttext_from_mfjson", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "ttext_in", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "ttext_out", + "file": "meos.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tbool_from_base_temp", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "b", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tboolinst_make", + "file": "meos.h", + "returnType": { + "c": "TInstant *", + "canonical": "struct TInstant *" + }, + "params": [ + { + "name": "b", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "tboolseq_from_base_tstzset", + "file": "meos.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "b", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "tboolseq_from_base_tstzspan", + "file": "meos.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "b", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "tboolseqset_from_base_tstzspanset", + "file": "meos.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "b", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "temporal_copy", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tfloat_from_base_temp", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tfloatinst_make", + "file": "meos.h", + "returnType": { + "c": "TInstant *", + "canonical": "struct TInstant *" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "tfloatseq_from_base_tstzset", + "file": "meos.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "tfloatseq_from_base_tstzspan", + "file": "meos.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "tfloatseqset_from_base_tstzspanset", + "file": "meos.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "tint_from_base_temp", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tbigint_from_base_temp", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "i", + "cType": "int64", + "canonical": "long" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tintinst_make", + "file": "meos.h", + "returnType": { + "c": "TInstant *", + "canonical": "struct TInstant *" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "tbigintinst_make", + "file": "meos.h", + "returnType": { + "c": "TInstant *", + "canonical": "struct TInstant *" + }, + "params": [ + { + "name": "i", + "cType": "int64", + "canonical": "long" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "tintseq_from_base_tstzset", + "file": "meos.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "tbigintseq_from_base_tstzset", + "file": "meos.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "i", + "cType": "int64", + "canonical": "long" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "tintseq_from_base_tstzspan", + "file": "meos.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "tbigintseq_from_base_tstzspan", + "file": "meos.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "i", + "cType": "int64", + "canonical": "long" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "tintseqset_from_base_tstzspanset", + "file": "meos.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "tbigintseqset_from_base_tstzspanset", + "file": "meos.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "i", + "cType": "int64", + "canonical": "long" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "tsequence_make", + "file": "meos.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "instants", + "cType": "TInstant **", + "canonical": "struct TInstant **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "lower_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "upper_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + }, + { + "name": "normalize", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tsequenceset_make", + "file": "meos.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "sequences", + "cType": "TSequence **", + "canonical": "struct TSequence **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "normalize", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tsequenceset_make_gaps", + "file": "meos.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "instants", + "cType": "TInstant **", + "canonical": "struct TInstant **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + }, + { + "name": "maxt", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "maxdist", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "ttext_from_base_temp", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "txt", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ttextinst_make", + "file": "meos.h", + "returnType": { + "c": "TInstant *", + "canonical": "struct TInstant *" + }, + "params": [ + { + "name": "txt", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "ttextseq_from_base_tstzset", + "file": "meos.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "txt", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "ttextseq_from_base_tstzspan", + "file": "meos.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "txt", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "ttextseqset_from_base_tstzspanset", + "file": "meos.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "txt", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "tbool_to_tint", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "temporal_to_tstzspan", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tfloat_to_tint", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tfloat_to_tbigint", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tint_to_tfloat", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tint_to_tbigint", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tbigint_to_tint", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tbigint_to_tfloat", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tnumber_to_span", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tnumber_to_tbox", + "file": "meos.h", + "returnType": { + "c": "TBox *", + "canonical": "struct TBox *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tbool_end_value", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tbool_start_value", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tbool_value_at_timestamptz", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "strict", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "value", + "cType": "bool *", + "canonical": "_Bool *" + } + ] + }, + { + "name": "tbool_value_n", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "n", + "cType": "int", + "canonical": "int" + }, + { + "name": "result", + "cType": "bool *", + "canonical": "_Bool *" + } + ] + }, + { + "name": "tbool_values", + "file": "meos.h", + "returnType": { + "c": "bool *", + "canonical": "_Bool *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "temporal_duration", + "file": "meos.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "boundspan", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "temporal_end_instant", + "file": "meos.h", + "returnType": { + "c": "TInstant *", + "canonical": "struct TInstant *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "temporal_end_sequence", + "file": "meos.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "temporal_end_timestamptz", + "file": "meos.h", + "returnType": { + "c": "TimestampTz", + "canonical": "long" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "temporal_hash", + "file": "meos.h", + "returnType": { + "c": "uint32", + "canonical": "unsigned int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "temporal_instant_n", + "file": "meos.h", + "returnType": { + "c": "TInstant *", + "canonical": "struct TInstant *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "n", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "temporal_instants", + "file": "meos.h", + "returnType": { + "c": "TInstant **", + "canonical": "struct TInstant **" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "temporal_interp", + "file": "meos.h", + "returnType": { + "c": "const char *", + "canonical": "const char *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "temporal_lower_inc", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "temporal_max_instant", + "file": "meos.h", + "returnType": { + "c": "TInstant *", + "canonical": "struct TInstant *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "temporal_min_instant", + "file": "meos.h", + "returnType": { + "c": "TInstant *", + "canonical": "struct TInstant *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "temporal_num_instants", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "temporal_num_sequences", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "temporal_num_timestamps", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "temporal_segm_duration", + "file": "meos.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "duration", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "atleast", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "strict", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "temporal_segments", + "file": "meos.h", + "returnType": { + "c": "TSequence **", + "canonical": "struct TSequence **" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "temporal_sequence_n", + "file": "meos.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "temporal_sequences", + "file": "meos.h", + "returnType": { + "c": "TSequence **", + "canonical": "struct TSequence **" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "temporal_start_instant", + "file": "meos.h", + "returnType": { + "c": "TInstant *", + "canonical": "struct TInstant *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "temporal_start_sequence", + "file": "meos.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "temporal_start_timestamptz", + "file": "meos.h", + "returnType": { + "c": "TimestampTz", + "canonical": "long" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "temporal_stops", + "file": "meos.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "maxdist", + "cType": "double", + "canonical": "double" + }, + { + "name": "minduration", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "temporal_subtype", + "file": "meos.h", + "returnType": { + "c": "const char *", + "canonical": "const char *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "temporal_basetype_name", + "file": "meos.h", + "returnType": { + "c": "const char *", + "canonical": "const char *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "temporal_time", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "temporal_timestamps", + "file": "meos.h", + "returnType": { + "c": "TimestampTz *", + "canonical": "long *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "temporal_timestamptz_n", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "n", + "cType": "int", + "canonical": "int" + }, + { + "name": "result", + "cType": "TimestampTz *", + "canonical": "long *" + } + ] + }, + { + "name": "temporal_upper_inc", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tfloat_end_value", + "file": "meos.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tfloat_min_value", + "file": "meos.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tfloat_max_value", + "file": "meos.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tfloat_start_value", + "file": "meos.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tfloat_value_at_timestamptz", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "strict", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "value", + "cType": "double *", + "canonical": "double *" + } + ] + }, + { + "name": "tfloat_value_n", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "n", + "cType": "int", + "canonical": "int" + }, + { + "name": "result", + "cType": "double *", + "canonical": "double *" + } + ] + }, + { + "name": "tfloat_values", + "file": "meos.h", + "returnType": { + "c": "double *", + "canonical": "double *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tint_end_value", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tbigint_end_value", + "file": "meos.h", + "returnType": { + "c": "int64", + "canonical": "long" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tint_max_value", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tbigint_max_value", + "file": "meos.h", + "returnType": { + "c": "int64", + "canonical": "long" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tint_min_value", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tbigint_min_value", + "file": "meos.h", + "returnType": { + "c": "int64", + "canonical": "long" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tint_start_value", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tbigint_start_value", + "file": "meos.h", + "returnType": { + "c": "int64", + "canonical": "long" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tbigint_value_at_timestamptz", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "strict", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "value", + "cType": "int64 *", + "canonical": "long *" + } + ] + }, + { + "name": "tint_value_at_timestamptz", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "strict", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "value", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tint_value_n", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "n", + "cType": "int", + "canonical": "int" + }, + { + "name": "result", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tbigint_value_n", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "n", + "cType": "int64", + "canonical": "long" + }, + { + "name": "result", + "cType": "int64 *", + "canonical": "long *" + } + ] + }, + { + "name": "tint_values", + "file": "meos.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tbigint_values", + "file": "meos.h", + "returnType": { + "c": "int64 *", + "canonical": "long *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "count", + "cType": "int32 *", + "canonical": "int *" + } + ] + }, + { + "name": "tnumber_avg_value", + "file": "meos.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tnumber_integral", + "file": "meos.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tnumber_twavg", + "file": "meos.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tnumber_valuespans", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ttext_end_value", + "file": "meos.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ttext_max_value", + "file": "meos.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ttext_min_value", + "file": "meos.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ttext_start_value", + "file": "meos.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ttext_value_at_timestamptz", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "strict", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "value", + "cType": "int **", + "canonical": "int **" + } + ] + }, + { + "name": "ttext_value_n", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "n", + "cType": "int", + "canonical": "int" + }, + { + "name": "result", + "cType": "int **", + "canonical": "int **" + } + ] + }, + { + "name": "ttext_values", + "file": "meos.h", + "returnType": { + "c": "int **", + "canonical": "int **" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "float_degrees", + "file": "meos.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "value", + "cType": "double", + "canonical": "double" + }, + { + "name": "normalize", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "temparr_round", + "file": "meos.h", + "returnType": { + "c": "Temporal **", + "canonical": "Temporal **" + }, + "params": [ + { + "name": "temp", + "cType": "Temporal **", + "canonical": "Temporal **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "temporal_round", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "temporal_scale_time", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "duration", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "temporal_set_interp", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "temporal_shift_scale_time", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "shift", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "duration", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "temporal_shift_time", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "shift", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "temporal_to_tinstant", + "file": "meos.h", + "returnType": { + "c": "TInstant *", + "canonical": "struct TInstant *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "temporal_to_tsequence", + "file": "meos.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "temporal_to_tsequenceset", + "file": "meos.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "tfloat_ceil", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tfloat_degrees", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "normalize", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tfloat_floor", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tfloat_radians", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tfloat_scale_value", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "width", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "tfloat_shift_scale_value", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "shift", + "cType": "double", + "canonical": "double" + }, + { + "name": "width", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "tfloat_shift_value", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "shift", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "tint_scale_value", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "width", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "tbigint_scale_value", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "width", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "tint_shift_scale_value", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "shift", + "cType": "int", + "canonical": "int" + }, + { + "name": "width", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "tbigint_shift_scale_value", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "shift", + "cType": "int64", + "canonical": "long" + }, + { + "name": "width", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "tint_shift_value", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "shift", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "tbigint_shift_value", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "shift", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "temporal_append_tinstant", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "Temporal *", + "canonical": "Temporal *" + }, + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const struct TInstant *" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + }, + { + "name": "maxdist", + "cType": "double", + "canonical": "double" + }, + { + "name": "maxt", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "expand", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "temporal_append_tsequence", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "Temporal *", + "canonical": "Temporal *" + }, + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "expand", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "temporal_delete_timestamptz", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "connect", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "temporal_delete_tstzset", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "connect", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "temporal_delete_tstzspan", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "connect", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "temporal_delete_tstzspanset", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "connect", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "temporal_insert", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "connect", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "temporal_merge", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "temporal_merge_array", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temparr", + "cType": "Temporal **", + "canonical": "Temporal **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "temporal_update", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "connect", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tbool_at_value", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "b", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tbool_minus_value", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "b", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "temporal_after_timestamptz", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "strict", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "temporal_at_max", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "temporal_at_min", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "temporal_at_timestamptz", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "temporal_at_tstzset", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "temporal_at_tstzspan", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "temporal_at_tstzspanset", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "temporal_at_values", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "set", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "temporal_before_timestamptz", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "strict", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "temporal_minus_max", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "temporal_minus_min", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "temporal_minus_timestamptz", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "temporal_minus_tstzset", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "temporal_minus_tstzspan", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "temporal_minus_tstzspanset", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "temporal_minus_values", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "set", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "tfloat_at_value", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "tfloat_minus_value", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "tint_at_value", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "tint_minus_value", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "tnumber_at_span", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "span", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "tnumber_at_spanset", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "tnumber_at_tbox", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const TBox *", + "canonical": "const struct TBox *" + } + ] + }, + { + "name": "tnumber_minus_span", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "span", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "tnumber_minus_spanset", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "tnumber_minus_tbox", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const TBox *", + "canonical": "const struct TBox *" + } + ] + }, + { + "name": "ttext_at_value", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "txt", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "ttext_minus_value", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "txt", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "temporal_cmp", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "temporal_eq", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ], + "ownership": "caller", + "nullable": true, + "doc": "Returns the temporal equality between two temporal values.", + "meos": { + "temporalDim": "any", + "spatialDim": null, + "interpolation": false, + "subtype": "any" + } + }, + { + "name": "temporal_ge", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "temporal_gt", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "temporal_le", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "temporal_lt", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "temporal_ne", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_eq_bool_tbool", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "b", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_eq_float_tfloat", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_eq_int_tint", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_eq_tbool_bool", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "b", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "always_eq_temporal_temporal", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_eq_text_ttext", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "txt", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_eq_tfloat_float", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "always_eq_tint_int", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "always_eq_bigint_tbigint", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "i", + "cType": "int64", + "canonical": "long" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_eq_tbigint_bigint", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "i", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "always_eq_ttext_text", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "txt", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "always_ge_float_tfloat", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_ge_int_tint", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_ge_temporal_temporal", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_ge_text_ttext", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "txt", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_ge_tfloat_float", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "always_ge_tint_int", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "always_ge_bigint_tbigint", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "i", + "cType": "int64", + "canonical": "long" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_ge_tbigint_bigint", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "i", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "always_ge_ttext_text", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "txt", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "always_gt_float_tfloat", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_gt_int_tint", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_gt_temporal_temporal", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_gt_text_ttext", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "txt", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_gt_tfloat_float", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "always_gt_tint_int", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "always_gt_bigint_tbigint", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "i", + "cType": "int64", + "canonical": "long" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_gt_tbigint_bigint", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "i", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "always_gt_ttext_text", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "txt", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "always_le_float_tfloat", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_le_int_tint", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_le_temporal_temporal", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_le_text_ttext", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "txt", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_le_tfloat_float", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "always_le_tint_int", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "always_le_bigint_tbigint", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "i", + "cType": "int64", + "canonical": "long" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_le_tbigint_bigint", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "i", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "always_le_ttext_text", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "txt", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "always_lt_float_tfloat", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_lt_int_tint", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_lt_temporal_temporal", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_lt_text_ttext", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "txt", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_lt_tfloat_float", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "always_lt_tint_int", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "always_lt_bigint_tbigint", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "i", + "cType": "int64", + "canonical": "long" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_lt_tbigint_bigint", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "i", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "always_lt_ttext_text", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "txt", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "always_ne_bool_tbool", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "b", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_ne_float_tfloat", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_ne_int_tint", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_ne_tbool_bool", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "b", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "always_ne_temporal_temporal", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_ne_text_ttext", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "txt", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_ne_tfloat_float", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "always_ne_tint_int", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "always_ne_bigint_tbigint", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "i", + "cType": "int64", + "canonical": "long" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_ne_tbigint_bigint", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "i", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "always_ne_ttext_text", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "txt", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "ever_eq_bool_tbool", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "b", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_eq_float_tfloat", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_eq_int_tint", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_eq_tbool_bool", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "b", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ever_eq_temporal_temporal", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_eq_text_ttext", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "txt", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_eq_tfloat_float", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "ever_eq_tint_int", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "ever_eq_bigint_tbigint", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "i", + "cType": "int64", + "canonical": "long" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_eq_tbigint_bigint", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "i", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "ever_eq_ttext_text", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "txt", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "ever_ge_float_tfloat", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_ge_int_tint", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_ge_temporal_temporal", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_ge_text_ttext", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "txt", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_ge_tfloat_float", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "ever_ge_tint_int", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "ever_ge_bigint_tbigint", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "i", + "cType": "int64", + "canonical": "long" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_ge_tbigint_bigint", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "i", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "ever_ge_ttext_text", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "txt", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "ever_gt_float_tfloat", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_gt_int_tint", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_gt_temporal_temporal", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_gt_text_ttext", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "txt", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_gt_tfloat_float", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "ever_gt_tint_int", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "ever_gt_bigint_tbigint", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "i", + "cType": "int64", + "canonical": "long" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_gt_tbigint_bigint", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "i", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "ever_gt_ttext_text", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "txt", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "ever_le_float_tfloat", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_le_int_tint", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_le_temporal_temporal", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_le_text_ttext", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "txt", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_le_tfloat_float", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "ever_le_tint_int", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "ever_le_bigint_tbigint", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "i", + "cType": "int64", + "canonical": "long" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_le_tbigint_bigint", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "i", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "ever_le_ttext_text", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "txt", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "ever_lt_float_tfloat", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_lt_int_tint", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_lt_temporal_temporal", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_lt_text_ttext", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "txt", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_lt_tfloat_float", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "ever_lt_tint_int", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "ever_lt_bigint_tbigint", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "i", + "cType": "int64", + "canonical": "long" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_lt_tbigint_bigint", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "i", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "ever_lt_ttext_text", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "txt", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "ever_ne_bool_tbool", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "b", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_ne_float_tfloat", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_ne_int_tint", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_ne_tbool_bool", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "b", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ever_ne_temporal_temporal", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_ne_text_ttext", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "txt", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_ne_tfloat_float", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "ever_ne_tint_int", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "ever_ne_bigint_tbigint", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "i", + "cType": "int64", + "canonical": "long" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_ne_tbigint_bigint", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "i", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "ever_ne_ttext_text", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "txt", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "teq_bool_tbool", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "b", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "teq_float_tfloat", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "teq_int_tint", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "teq_tbool_bool", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "b", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "teq_temporal_temporal", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "teq_text_ttext", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "txt", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "teq_tfloat_float", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "teq_tint_int", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "teq_ttext_text", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "txt", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "tge_float_tfloat", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tge_int_tint", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tge_temporal_temporal", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tge_text_ttext", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "txt", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tge_tfloat_float", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "tge_tint_int", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "tge_ttext_text", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "txt", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "tgt_float_tfloat", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tgt_int_tint", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tgt_temporal_temporal", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tgt_text_ttext", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "txt", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tgt_tfloat_float", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "tgt_tint_int", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "tgt_ttext_text", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "txt", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "tle_float_tfloat", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tle_int_tint", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tle_temporal_temporal", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tle_text_ttext", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "txt", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tle_tfloat_float", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "tle_tint_int", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "tle_ttext_text", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "txt", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "tlt_float_tfloat", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tlt_int_tint", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tlt_temporal_temporal", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tlt_text_ttext", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "txt", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tlt_tfloat_float", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "tlt_tint_int", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "tlt_ttext_text", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "txt", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "tne_bool_tbool", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "b", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tne_float_tfloat", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tne_int_tint", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tne_tbool_bool", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "b", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tne_temporal_temporal", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tne_text_ttext", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "txt", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tne_tfloat_float", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "tne_tint_int", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "tne_ttext_text", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "txt", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "temporal_spans", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "temporal_split_each_n_spans", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "elem_count", + "cType": "int", + "canonical": "int" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "temporal_split_n_spans", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "span_count", + "cType": "int", + "canonical": "int" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tnumber_split_each_n_tboxes", + "file": "meos.h", + "returnType": { + "c": "TBox *", + "canonical": "struct TBox *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "elem_count", + "cType": "int", + "canonical": "int" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tnumber_split_n_tboxes", + "file": "meos.h", + "returnType": { + "c": "TBox *", + "canonical": "struct TBox *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box_count", + "cType": "int", + "canonical": "int" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tnumber_tboxes", + "file": "meos.h", + "returnType": { + "c": "TBox *", + "canonical": "struct TBox *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "adjacent_numspan_tnumber", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "adjacent_tbox_tnumber", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const struct TBox *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "adjacent_temporal_temporal", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "adjacent_temporal_tstzspan", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "adjacent_tnumber_numspan", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "adjacent_tnumber_tbox", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const TBox *", + "canonical": "const struct TBox *" + } + ] + }, + { + "name": "adjacent_tnumber_tnumber", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "adjacent_tstzspan_temporal", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "contained_numspan_tnumber", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "contained_tbox_tnumber", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const struct TBox *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "contained_temporal_temporal", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "contained_temporal_tstzspan", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "contained_tnumber_numspan", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "contained_tnumber_tbox", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const TBox *", + "canonical": "const struct TBox *" + } + ] + }, + { + "name": "contained_tnumber_tnumber", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "contained_tstzspan_temporal", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "contains_numspan_tnumber", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "contains_tbox_tnumber", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const struct TBox *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "contains_temporal_tstzspan", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "contains_temporal_temporal", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "contains_tnumber_numspan", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "contains_tnumber_tbox", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const TBox *", + "canonical": "const struct TBox *" + } + ] + }, + { + "name": "contains_tnumber_tnumber", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "contains_tstzspan_temporal", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "overlaps_numspan_tnumber", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "overlaps_tbox_tnumber", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const struct TBox *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "overlaps_temporal_temporal", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "overlaps_temporal_tstzspan", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "overlaps_tnumber_numspan", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "overlaps_tnumber_tbox", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const TBox *", + "canonical": "const struct TBox *" + } + ] + }, + { + "name": "overlaps_tnumber_tnumber", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "overlaps_tstzspan_temporal", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "same_numspan_tnumber", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "same_tbox_tnumber", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const struct TBox *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "same_temporal_temporal", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "same_temporal_tstzspan", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "same_tnumber_numspan", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "same_tnumber_tbox", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const TBox *", + "canonical": "const struct TBox *" + } + ] + }, + { + "name": "same_tnumber_tnumber", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "same_tstzspan_temporal", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "after_tbox_tnumber", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const struct TBox *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "after_temporal_tstzspan", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "after_temporal_temporal", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "after_tnumber_tbox", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const TBox *", + "canonical": "const struct TBox *" + } + ] + }, + { + "name": "after_tnumber_tnumber", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "after_tstzspan_temporal", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "before_tbox_tnumber", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const struct TBox *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "before_temporal_tstzspan", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "before_temporal_temporal", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "before_tnumber_tbox", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const TBox *", + "canonical": "const struct TBox *" + } + ] + }, + { + "name": "before_tnumber_tnumber", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "before_tstzspan_temporal", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "left_tbox_tnumber", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const struct TBox *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "left_numspan_tnumber", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "left_tnumber_numspan", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "left_tnumber_tbox", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const TBox *", + "canonical": "const struct TBox *" + } + ] + }, + { + "name": "left_tnumber_tnumber", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "overafter_tbox_tnumber", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const struct TBox *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "overafter_temporal_tstzspan", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "overafter_temporal_temporal", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "overafter_tnumber_tbox", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const TBox *", + "canonical": "const struct TBox *" + } + ] + }, + { + "name": "overafter_tnumber_tnumber", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "overafter_tstzspan_temporal", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "overbefore_tbox_tnumber", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const struct TBox *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "overbefore_temporal_tstzspan", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "overbefore_temporal_temporal", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "overbefore_tnumber_tbox", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const TBox *", + "canonical": "const struct TBox *" + } + ] + }, + { + "name": "overbefore_tnumber_tnumber", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "overbefore_tstzspan_temporal", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "overleft_numspan_tnumber", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "overleft_tbox_tnumber", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const struct TBox *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "overleft_tnumber_numspan", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "overleft_tnumber_tbox", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const TBox *", + "canonical": "const struct TBox *" + } + ] + }, + { + "name": "overleft_tnumber_tnumber", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "overright_numspan_tnumber", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "overright_tbox_tnumber", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const struct TBox *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "overright_tnumber_numspan", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "overright_tnumber_tbox", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const TBox *", + "canonical": "const struct TBox *" + } + ] + }, + { + "name": "overright_tnumber_tnumber", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "right_numspan_tnumber", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "right_tbox_tnumber", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const struct TBox *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "right_tnumber_numspan", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "right_tnumber_tbox", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const TBox *", + "canonical": "const struct TBox *" + } + ] + }, + { + "name": "right_tnumber_tnumber", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tand_bool_tbool", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "b", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tand_tbool_bool", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "b", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tand_tbool_tbool", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tbool_when_true", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tnot_tbool", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tor_bool_tbool", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "b", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tor_tbool_bool", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "b", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tor_tbool_tbool", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "add_float_tfloat", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + }, + { + "name": "tnumber", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "add_int_tint", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + }, + { + "name": "tnumber", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "add_tfloat_float", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "tnumber", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "add_tint_int", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "tnumber", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "add_bigint_tbigint", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "i", + "cType": "int64", + "canonical": "long" + }, + { + "name": "tnumber", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "add_tbigint_bigint", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "tnumber", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "i", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "add_tnumber_tnumber", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "tnumber1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "tnumber2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "div_float_tfloat", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + }, + { + "name": "tnumber", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "div_int_tint", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + }, + { + "name": "tnumber", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "div_tfloat_float", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "tnumber", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "div_tint_int", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "tnumber", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "div_bigint_tbigint", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "i", + "cType": "int64", + "canonical": "long" + }, + { + "name": "tnumber", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "div_tbigint_bigint", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "tnumber", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "i", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "div_tnumber_tnumber", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "tnumber1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "tnumber2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "mul_float_tfloat", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + }, + { + "name": "tnumber", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "mul_int_tint", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + }, + { + "name": "tnumber", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "mul_tfloat_float", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "tnumber", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "mul_tint_int", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "tnumber", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "mul_bigint_tbigint", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "i", + "cType": "int64", + "canonical": "long" + }, + { + "name": "tnumber", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "mul_tbigint_bigint", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "tnumber", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "i", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "mul_tnumber_tnumber", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "tnumber1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "tnumber2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "sub_float_tfloat", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + }, + { + "name": "tnumber", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "sub_int_tint", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + }, + { + "name": "tnumber", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "sub_tfloat_float", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "tnumber", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "sub_tint_int", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "tnumber", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "sub_bigint_tbigint", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "i", + "cType": "int64", + "canonical": "long" + }, + { + "name": "tnumber", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "sub_tbigint_bigint", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "tnumber", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "i", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "sub_tnumber_tnumber", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "tnumber1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "tnumber2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "temporal_derivative", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tfloat_exp", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tfloat_ln", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tfloat_log10", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tfloat_sin", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tfloat_cos", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tfloat_tan", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tnumber_abs", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tnumber_trend", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "float_angular_difference", + "file": "meos.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "degrees1", + "cType": "double", + "canonical": "double" + }, + { + "name": "degrees2", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "tnumber_angular_difference", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tnumber_delta_value", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "textcat_text_ttext", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "txt", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "textcat_ttext_text", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "txt", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "textcat_ttext_ttext", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ttext_initcap", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ttext_upper", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ttext_lower", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tdistance_tfloat_float", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "tdistance_tint_int", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "tdistance_tnumber_tnumber", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "nad_tboxfloat_tboxfloat", + "file": "meos.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "box1", + "cType": "const TBox *", + "canonical": "const struct TBox *" + }, + { + "name": "box2", + "cType": "const TBox *", + "canonical": "const struct TBox *" + } + ] + }, + { + "name": "nad_tboxint_tboxint", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "box1", + "cType": "const TBox *", + "canonical": "const struct TBox *" + }, + { + "name": "box2", + "cType": "const TBox *", + "canonical": "const struct TBox *" + } + ] + }, + { + "name": "nad_tfloat_float", + "file": "meos.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "nad_tfloat_tfloat", + "file": "meos.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "nad_tfloat_tbox", + "file": "meos.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const TBox *", + "canonical": "const struct TBox *" + } + ] + }, + { + "name": "nad_tint_int", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "nad_tint_tbox", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const TBox *", + "canonical": "const struct TBox *" + } + ] + }, + { + "name": "nad_tint_tint", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tbool_tand_transfn", + "file": "meos.h", + "returnType": { + "c": "SkipList *", + "canonical": "struct SkipList *" + }, + "params": [ + { + "name": "state", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tbool_tand_combinefn", + "file": "meos.h", + "returnType": { + "c": "SkipList *", + "canonical": "struct SkipList *" + }, + "params": [ + { + "name": "state1", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "state2", + "cType": "SkipList *", + "canonical": "struct SkipList *" + } + ] + }, + { + "name": "tbool_tor_transfn", + "file": "meos.h", + "returnType": { + "c": "SkipList *", + "canonical": "struct SkipList *" + }, + "params": [ + { + "name": "state", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tbool_tor_combinefn", + "file": "meos.h", + "returnType": { + "c": "SkipList *", + "canonical": "struct SkipList *" + }, + "params": [ + { + "name": "state1", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "state2", + "cType": "SkipList *", + "canonical": "struct SkipList *" + } + ] + }, + { + "name": "temporal_extent_transfn", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "s", + "cType": "Span *", + "canonical": "struct Span *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "temporal_tagg_finalfn", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "state", + "cType": "SkipList *", + "canonical": "struct SkipList *" + } + ] + }, + { + "name": "temporal_tcount_transfn", + "file": "meos.h", + "returnType": { + "c": "SkipList *", + "canonical": "struct SkipList *" + }, + "params": [ + { + "name": "state", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "temporal_tcount_combinefn", + "file": "meos.h", + "returnType": { + "c": "SkipList *", + "canonical": "struct SkipList *" + }, + "params": [ + { + "name": "state1", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "state2", + "cType": "SkipList *", + "canonical": "struct SkipList *" + } + ] + }, + { + "name": "tfloat_tmax_transfn", + "file": "meos.h", + "returnType": { + "c": "SkipList *", + "canonical": "struct SkipList *" + }, + "params": [ + { + "name": "state", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tfloat_tmax_combinefn", + "file": "meos.h", + "returnType": { + "c": "SkipList *", + "canonical": "struct SkipList *" + }, + "params": [ + { + "name": "state1", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "state2", + "cType": "SkipList *", + "canonical": "struct SkipList *" + } + ] + }, + { + "name": "tfloat_tmin_transfn", + "file": "meos.h", + "returnType": { + "c": "SkipList *", + "canonical": "struct SkipList *" + }, + "params": [ + { + "name": "state", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tfloat_tmin_combinefn", + "file": "meos.h", + "returnType": { + "c": "SkipList *", + "canonical": "struct SkipList *" + }, + "params": [ + { + "name": "state1", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "state2", + "cType": "SkipList *", + "canonical": "struct SkipList *" + } + ] + }, + { + "name": "tfloat_tsum_transfn", + "file": "meos.h", + "returnType": { + "c": "SkipList *", + "canonical": "struct SkipList *" + }, + "params": [ + { + "name": "state", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tfloat_tsum_combinefn", + "file": "meos.h", + "returnType": { + "c": "SkipList *", + "canonical": "struct SkipList *" + }, + "params": [ + { + "name": "state1", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "state2", + "cType": "SkipList *", + "canonical": "struct SkipList *" + } + ] + }, + { + "name": "tfloat_wmax_transfn", + "file": "meos.h", + "returnType": { + "c": "SkipList *", + "canonical": "struct SkipList *" + }, + "params": [ + { + "name": "state", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "interv", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "tfloat_wmin_transfn", + "file": "meos.h", + "returnType": { + "c": "SkipList *", + "canonical": "struct SkipList *" + }, + "params": [ + { + "name": "state", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "interv", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "tfloat_wsum_transfn", + "file": "meos.h", + "returnType": { + "c": "SkipList *", + "canonical": "struct SkipList *" + }, + "params": [ + { + "name": "state", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "interv", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "timestamptz_tcount_transfn", + "file": "meos.h", + "returnType": { + "c": "SkipList *", + "canonical": "struct SkipList *" + }, + "params": [ + { + "name": "state", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "tint_tmax_transfn", + "file": "meos.h", + "returnType": { + "c": "SkipList *", + "canonical": "struct SkipList *" + }, + "params": [ + { + "name": "state", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tint_tmax_combinefn", + "file": "meos.h", + "returnType": { + "c": "SkipList *", + "canonical": "struct SkipList *" + }, + "params": [ + { + "name": "state1", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "state2", + "cType": "SkipList *", + "canonical": "struct SkipList *" + } + ] + }, + { + "name": "tint_tmin_transfn", + "file": "meos.h", + "returnType": { + "c": "SkipList *", + "canonical": "struct SkipList *" + }, + "params": [ + { + "name": "state", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tint_tmin_combinefn", + "file": "meos.h", + "returnType": { + "c": "SkipList *", + "canonical": "struct SkipList *" + }, + "params": [ + { + "name": "state1", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "state2", + "cType": "SkipList *", + "canonical": "struct SkipList *" + } + ] + }, + { + "name": "tint_tsum_transfn", + "file": "meos.h", + "returnType": { + "c": "SkipList *", + "canonical": "struct SkipList *" + }, + "params": [ + { + "name": "state", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tint_tsum_combinefn", + "file": "meos.h", + "returnType": { + "c": "SkipList *", + "canonical": "struct SkipList *" + }, + "params": [ + { + "name": "state1", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "state2", + "cType": "SkipList *", + "canonical": "struct SkipList *" + } + ] + }, + { + "name": "tint_wmax_transfn", + "file": "meos.h", + "returnType": { + "c": "SkipList *", + "canonical": "struct SkipList *" + }, + "params": [ + { + "name": "state", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "interv", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "tint_wmin_transfn", + "file": "meos.h", + "returnType": { + "c": "SkipList *", + "canonical": "struct SkipList *" + }, + "params": [ + { + "name": "state", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "interv", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "tint_wsum_transfn", + "file": "meos.h", + "returnType": { + "c": "SkipList *", + "canonical": "struct SkipList *" + }, + "params": [ + { + "name": "state", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "interv", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "tnumber_extent_transfn", + "file": "meos.h", + "returnType": { + "c": "TBox *", + "canonical": "struct TBox *" + }, + "params": [ + { + "name": "box", + "cType": "TBox *", + "canonical": "struct TBox *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tnumber_tavg_finalfn", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "state", + "cType": "SkipList *", + "canonical": "struct SkipList *" + } + ] + }, + { + "name": "tnumber_tavg_transfn", + "file": "meos.h", + "returnType": { + "c": "SkipList *", + "canonical": "struct SkipList *" + }, + "params": [ + { + "name": "state", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tnumber_tavg_combinefn", + "file": "meos.h", + "returnType": { + "c": "SkipList *", + "canonical": "struct SkipList *" + }, + "params": [ + { + "name": "state1", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "state2", + "cType": "SkipList *", + "canonical": "struct SkipList *" + } + ] + }, + { + "name": "tnumber_wavg_transfn", + "file": "meos.h", + "returnType": { + "c": "SkipList *", + "canonical": "struct SkipList *" + }, + "params": [ + { + "name": "state", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "interv", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "tstzset_tcount_transfn", + "file": "meos.h", + "returnType": { + "c": "SkipList *", + "canonical": "struct SkipList *" + }, + "params": [ + { + "name": "state", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "tstzspan_tcount_transfn", + "file": "meos.h", + "returnType": { + "c": "SkipList *", + "canonical": "struct SkipList *" + }, + "params": [ + { + "name": "state", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "tstzspanset_tcount_transfn", + "file": "meos.h", + "returnType": { + "c": "SkipList *", + "canonical": "struct SkipList *" + }, + "params": [ + { + "name": "state", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "temporal_merge_transfn", + "file": "meos.h", + "returnType": { + "c": "SkipList *", + "canonical": "struct SkipList *" + }, + "params": [ + { + "name": "state", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "temporal_merge_combinefn", + "file": "meos.h", + "returnType": { + "c": "SkipList *", + "canonical": "struct SkipList *" + }, + "params": [ + { + "name": "state1", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "state2", + "cType": "SkipList *", + "canonical": "struct SkipList *" + } + ] + }, + { + "name": "ttext_tmax_transfn", + "file": "meos.h", + "returnType": { + "c": "SkipList *", + "canonical": "struct SkipList *" + }, + "params": [ + { + "name": "state", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ttext_tmax_combinefn", + "file": "meos.h", + "returnType": { + "c": "SkipList *", + "canonical": "struct SkipList *" + }, + "params": [ + { + "name": "state1", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "state2", + "cType": "SkipList *", + "canonical": "struct SkipList *" + } + ] + }, + { + "name": "ttext_tmin_transfn", + "file": "meos.h", + "returnType": { + "c": "SkipList *", + "canonical": "struct SkipList *" + }, + "params": [ + { + "name": "state", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ttext_tmin_combinefn", + "file": "meos.h", + "returnType": { + "c": "SkipList *", + "canonical": "struct SkipList *" + }, + "params": [ + { + "name": "state1", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "state2", + "cType": "SkipList *", + "canonical": "struct SkipList *" + } + ] + }, + { + "name": "temporal_simplify_dp", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "dist", + "cType": "double", + "canonical": "double" + }, + { + "name": "synchronized", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "temporal_simplify_max_dist", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "dist", + "cType": "double", + "canonical": "double" + }, + { + "name": "synchronized", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "temporal_simplify_min_dist", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "dist", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "temporal_simplify_min_tdelta", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "mint", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "temporal_tprecision", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "duration", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "origin", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "temporal_tsample", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "duration", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "origin", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "temporal_dyntimewarp_distance", + "file": "meos.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "temporal_dyntimewarp_path", + "file": "meos.h", + "returnType": { + "c": "Match *", + "canonical": "Match *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "temporal_frechet_distance", + "file": "meos.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "temporal_frechet_path", + "file": "meos.h", + "returnType": { + "c": "Match *", + "canonical": "Match *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "temporal_hausdorff_distance", + "file": "meos.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "temporal_time_bins", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "duration", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "origin", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "temporal_time_split", + "file": "meos.h", + "returnType": { + "c": "Temporal **", + "canonical": "Temporal **" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "duration", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "torigin", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "time_bins", + "cType": "TimestampTz **", + "canonical": "long **" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tfloat_time_boxes", + "file": "meos.h", + "returnType": { + "c": "TBox *", + "canonical": "struct TBox *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "duration", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "torigin", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tfloat_value_bins", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "vsize", + "cType": "double", + "canonical": "double" + }, + { + "name": "vorigin", + "cType": "double", + "canonical": "double" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tfloat_value_boxes", + "file": "meos.h", + "returnType": { + "c": "TBox *", + "canonical": "struct TBox *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "vsize", + "cType": "double", + "canonical": "double" + }, + { + "name": "vorigin", + "cType": "double", + "canonical": "double" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tfloat_value_split", + "file": "meos.h", + "returnType": { + "c": "Temporal **", + "canonical": "Temporal **" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "size", + "cType": "double", + "canonical": "double" + }, + { + "name": "origin", + "cType": "double", + "canonical": "double" + }, + { + "name": "bins", + "cType": "double **", + "canonical": "double **" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tfloat_value_time_boxes", + "file": "meos.h", + "returnType": { + "c": "TBox *", + "canonical": "struct TBox *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "vsize", + "cType": "double", + "canonical": "double" + }, + { + "name": "duration", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "vorigin", + "cType": "double", + "canonical": "double" + }, + { + "name": "torigin", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tfloat_value_time_split", + "file": "meos.h", + "returnType": { + "c": "Temporal **", + "canonical": "Temporal **" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "vsize", + "cType": "double", + "canonical": "double" + }, + { + "name": "duration", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "vorigin", + "cType": "double", + "canonical": "double" + }, + { + "name": "torigin", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "value_bins", + "cType": "double **", + "canonical": "double **" + }, + { + "name": "time_bins", + "cType": "TimestampTz **", + "canonical": "long **" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tfloatbox_time_tiles", + "file": "meos.h", + "returnType": { + "c": "TBox *", + "canonical": "struct TBox *" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const struct TBox *" + }, + { + "name": "duration", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "torigin", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tfloatbox_value_tiles", + "file": "meos.h", + "returnType": { + "c": "TBox *", + "canonical": "struct TBox *" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const struct TBox *" + }, + { + "name": "vsize", + "cType": "double", + "canonical": "double" + }, + { + "name": "vorigin", + "cType": "double", + "canonical": "double" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tfloatbox_value_time_tiles", + "file": "meos.h", + "returnType": { + "c": "TBox *", + "canonical": "struct TBox *" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const struct TBox *" + }, + { + "name": "vsize", + "cType": "double", + "canonical": "double" + }, + { + "name": "duration", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "vorigin", + "cType": "double", + "canonical": "double" + }, + { + "name": "torigin", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tint_time_boxes", + "file": "meos.h", + "returnType": { + "c": "TBox *", + "canonical": "struct TBox *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "duration", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "torigin", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tint_value_bins", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "vsize", + "cType": "int", + "canonical": "int" + }, + { + "name": "vorigin", + "cType": "int", + "canonical": "int" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tint_value_boxes", + "file": "meos.h", + "returnType": { + "c": "TBox *", + "canonical": "struct TBox *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "vsize", + "cType": "int", + "canonical": "int" + }, + { + "name": "vorigin", + "cType": "int", + "canonical": "int" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tint_value_split", + "file": "meos.h", + "returnType": { + "c": "Temporal **", + "canonical": "Temporal **" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "vsize", + "cType": "int", + "canonical": "int" + }, + { + "name": "vorigin", + "cType": "int", + "canonical": "int" + }, + { + "name": "bins", + "cType": "int **", + "canonical": "int **" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tint_value_time_boxes", + "file": "meos.h", + "returnType": { + "c": "TBox *", + "canonical": "struct TBox *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "vsize", + "cType": "int", + "canonical": "int" + }, + { + "name": "duration", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "vorigin", + "cType": "int", + "canonical": "int" + }, + { + "name": "torigin", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tint_value_time_split", + "file": "meos.h", + "returnType": { + "c": "Temporal **", + "canonical": "Temporal **" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "size", + "cType": "int", + "canonical": "int" + }, + { + "name": "duration", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "vorigin", + "cType": "int", + "canonical": "int" + }, + { + "name": "torigin", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "value_bins", + "cType": "int **", + "canonical": "int **" + }, + { + "name": "time_bins", + "cType": "TimestampTz **", + "canonical": "long **" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tintbox_time_tiles", + "file": "meos.h", + "returnType": { + "c": "TBox *", + "canonical": "struct TBox *" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const struct TBox *" + }, + { + "name": "duration", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "torigin", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tintbox_value_tiles", + "file": "meos.h", + "returnType": { + "c": "TBox *", + "canonical": "struct TBox *" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const struct TBox *" + }, + { + "name": "xsize", + "cType": "int", + "canonical": "int" + }, + { + "name": "xorigin", + "cType": "int", + "canonical": "int" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tintbox_value_time_tiles", + "file": "meos.h", + "returnType": { + "c": "TBox *", + "canonical": "struct TBox *" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const struct TBox *" + }, + { + "name": "xsize", + "cType": "int", + "canonical": "int" + }, + { + "name": "duration", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "xorigin", + "cType": "int", + "canonical": "int" + }, + { + "name": "torigin", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "box3d_from_gbox", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "box", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "box3d_make", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "xmin", + "cType": "double", + "canonical": "double" + }, + { + "name": "xmax", + "cType": "double", + "canonical": "double" + }, + { + "name": "ymin", + "cType": "double", + "canonical": "double" + }, + { + "name": "ymax", + "cType": "double", + "canonical": "double" + }, + { + "name": "zmin", + "cType": "double", + "canonical": "double" + }, + { + "name": "zmax", + "cType": "double", + "canonical": "double" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + } + ] + }, + { + "name": "box3d_in", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "box3d_out", + "file": "meos_geo.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "box", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "gbox_make", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "hasz", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "hasm", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "geodetic", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "xmin", + "cType": "double", + "canonical": "double" + }, + { + "name": "xmax", + "cType": "double", + "canonical": "double" + }, + { + "name": "ymin", + "cType": "double", + "canonical": "double" + }, + { + "name": "ymax", + "cType": "double", + "canonical": "double" + }, + { + "name": "zmin", + "cType": "double", + "canonical": "double" + }, + { + "name": "zmax", + "cType": "double", + "canonical": "double" + }, + { + "name": "mmin", + "cType": "double", + "canonical": "double" + }, + { + "name": "mmax", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "gbox_in", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "gbox_out", + "file": "meos_geo.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "box", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "geo_as_ewkb", + "file": "meos_geo.h", + "returnType": { + "c": "uint8_t *", + "canonical": "unsigned char *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "endian", + "cType": "const char *", + "canonical": "const char *" + }, + { + "name": "size", + "cType": "size_t *", + "canonical": "unsigned long *" + } + ] + }, + { + "name": "geo_as_ewkt", + "file": "meos_geo.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "precision", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "geo_as_geojson", + "file": "meos_geo.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "option", + "cType": "int", + "canonical": "int" + }, + { + "name": "precision", + "cType": "int", + "canonical": "int" + }, + { + "name": "srs", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "geo_as_hexewkb", + "file": "meos_geo.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "endian", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "geo_as_text", + "file": "meos_geo.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "precision", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "geo_from_ewkb", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "wkb", + "cType": "const uint8_t *", + "canonical": "const unsigned char *" + }, + { + "name": "wkb_size", + "cType": "size_t", + "canonical": "unsigned long" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + } + ] + }, + { + "name": "geo_from_geojson", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "geojson", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "geo_from_text", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "wkt", + "cType": "const char *", + "canonical": "const char *" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + } + ] + }, + { + "name": "geo_out", + "file": "meos_geo.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "geog_from_hexewkb", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "wkt", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "geog_in", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + }, + { + "name": "typmod", + "cType": "int32", + "canonical": "int" + } + ] + }, + { + "name": "geom_from_hexewkb", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "wkt", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "geom_in", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + }, + { + "name": "typmod", + "cType": "int32", + "canonical": "int" + } + ] + }, + { + "name": "geo_copy", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "geogpoint_make2d", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + }, + { + "name": "x", + "cType": "double", + "canonical": "double" + }, + { + "name": "y", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "geogpoint_make3dz", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + }, + { + "name": "x", + "cType": "double", + "canonical": "double" + }, + { + "name": "y", + "cType": "double", + "canonical": "double" + }, + { + "name": "z", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "geompoint_make2d", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + }, + { + "name": "x", + "cType": "double", + "canonical": "double" + }, + { + "name": "y", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "geompoint_make3dz", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + }, + { + "name": "x", + "cType": "double", + "canonical": "double" + }, + { + "name": "y", + "cType": "double", + "canonical": "double" + }, + { + "name": "z", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "geom_to_geog", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "geom", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "geog_to_geom", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "geog", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "geo_is_empty", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "geo_is_unitary", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "geo_typename", + "file": "meos_geo.h", + "returnType": { + "c": "const char *", + "canonical": "const char *" + }, + "params": [ + { + "name": "type", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "geog_area", + "file": "meos_geo.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "use_spheroid", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "geog_centroid", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "use_spheroid", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "geog_length", + "file": "meos_geo.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "use_spheroid", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "geog_perimeter", + "file": "meos_geo.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "use_spheroid", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "geom_azimuth", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "gs1", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "gs2", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "result", + "cType": "double *", + "canonical": "double *" + } + ] + }, + { + "name": "geom_length", + "file": "meos_geo.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "geom_perimeter", + "file": "meos_geo.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "line_numpoints", + "file": "meos_geo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "line_point_n", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "geom", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "n", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "geo_wlof", + "file": "meos_geo.h", + "returnType": { + "c": "double *", + "canonical": "double *" + }, + "params": [ + { + "name": "geoms", + "cType": "const int **", + "canonical": "const int **" + }, + { + "name": "ngeoms", + "cType": "uint32_t", + "canonical": "unsigned int" + }, + { + "name": "k", + "cType": "uint32_t", + "canonical": "unsigned int" + }, + { + "name": "epsilon", + "cType": "double", + "canonical": "double" + }, + { + "name": "newcount", + "cType": "uint32_t *", + "canonical": "unsigned int *" + }, + { + "name": "clusters", + "cType": "int ***", + "canonical": "int ***" + } + ] + }, + { + "name": "geo_reverse", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "geo_round", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "geo_set_srid", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + } + ] + }, + { + "name": "geo_srid", + "file": "meos_geo.h", + "returnType": { + "c": "int32_t", + "canonical": "int" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "geo_transform", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "geom", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "srid_to", + "cType": "int32_t", + "canonical": "int" + } + ] + }, + { + "name": "geo_transform_pipeline", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "pipeline", + "cType": "char *", + "canonical": "char *" + }, + { + "name": "srid_to", + "cType": "int32_t", + "canonical": "int" + }, + { + "name": "is_forward", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "geo_collect_garray", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "gsarr", + "cType": "int **", + "canonical": "int **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "geo_makeline_garray", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "gsarr", + "cType": "int **", + "canonical": "int **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "geo_num_points", + "file": "meos_geo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "geo_num_geos", + "file": "meos_geo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "geo_geo_n", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "geom", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "n", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "geo_pointarr", + "file": "meos_geo.h", + "returnType": { + "c": "int **", + "canonical": "int **" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "geo_points", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "geom_array_union", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "gsarr", + "cType": "int **", + "canonical": "int **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "geom_boundary", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "geom_buffer", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "size", + "cType": "double", + "canonical": "double" + }, + { + "name": "params", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "geom_centroid", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "geom_convex_hull", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "geom_difference2d", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "gs1", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "gs2", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "geom_intersection2d", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "gs1", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "gs2", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "geom_intersection2d_coll", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "gs1", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "gs2", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "geom_min_bounding_radius", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "geom", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "radius", + "cType": "double *", + "canonical": "double *" + } + ] + }, + { + "name": "geom_shortestline2d", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "gs1", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "gs2", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "geom_shortestline3d", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "gs1", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "gs2", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "geom_unary_union", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "prec", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "line_interpolate_point", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "distance_fraction", + "cType": "double", + "canonical": "double" + }, + { + "name": "repeat", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "line_locate_point", + "file": "meos_geo.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "gs1", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "gs2", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "line_substring", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "from", + "cType": "double", + "canonical": "double" + }, + { + "name": "to", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "geog_dwithin", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "g1", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "g2", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "tolerance", + "cType": "double", + "canonical": "double" + }, + { + "name": "use_spheroid", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "geog_intersects", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "gs1", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "gs2", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "use_spheroid", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "geom_contains", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "gs1", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "gs2", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "geom_covers", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "gs1", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "gs2", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "geom_disjoint2d", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "gs1", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "gs2", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "geom_dwithin", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "gs1", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "gs2", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "tolerance", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "geom_dwithin2d", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "gs1", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "gs2", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "tolerance", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "geom_dwithin3d", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "gs1", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "gs2", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "tolerance", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "geom_intersects", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "gs1", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "gs2", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "geom_intersects2d", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "gs1", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "gs2", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "geom_intersects3d", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "gs1", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "gs2", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "geom_relate_pattern", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "gs1", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "gs2", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "patt", + "cType": "char *", + "canonical": "char *" + } + ] + }, + { + "name": "geom_touches", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "gs1", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "gs2", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "geo_stboxes", + "file": "meos_geo.h", + "returnType": { + "c": "STBox *", + "canonical": "struct STBox *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "geo_split_each_n_stboxes", + "file": "meos_geo.h", + "returnType": { + "c": "STBox *", + "canonical": "struct STBox *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "elem_count", + "cType": "int", + "canonical": "int" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "geo_split_n_stboxes", + "file": "meos_geo.h", + "returnType": { + "c": "STBox *", + "canonical": "struct STBox *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "box_count", + "cType": "int", + "canonical": "int" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "geog_distance", + "file": "meos_geo.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "g1", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "g2", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "geom_distance2d", + "file": "meos_geo.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "gs1", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "gs2", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "geom_distance3d", + "file": "meos_geo.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "gs1", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "gs2", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "geo_equals", + "file": "meos_geo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "gs1", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "gs2", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "geo_same", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "gs1", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "gs2", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "geogset_in", + "file": "meos_geo.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "geomset_in", + "file": "meos_geo.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "spatialset_out", + "file": "meos_geo.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "spatialset_as_text", + "file": "meos_geo.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "set", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "spatialset_as_ewkt", + "file": "meos_geo.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "set", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "geoset_make", + "file": "meos_geo.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "values", + "cType": "int **", + "canonical": "int **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "geo_to_set", + "file": "meos_geo.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "geoset_end_value", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "geoset_start_value", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "geoset_value_n", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "n", + "cType": "int", + "canonical": "int" + }, + { + "name": "result", + "cType": "int **", + "canonical": "int **" + } + ] + }, + { + "name": "geoset_values", + "file": "meos_geo.h", + "returnType": { + "c": "int **", + "canonical": "int **" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "contained_geo_set", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "contains_set_geo", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "gs", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "geo_union_transfn", + "file": "meos_geo.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "state", + "cType": "Set *", + "canonical": "Set *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "intersection_geo_set", + "file": "meos_geo.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "intersection_set_geo", + "file": "meos_geo.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "minus_geo_set", + "file": "meos_geo.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "minus_set_geo", + "file": "meos_geo.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "union_geo_set", + "file": "meos_geo.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "union_set_geo", + "file": "meos_geo.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "spatialset_set_srid", + "file": "meos_geo.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + } + ] + }, + { + "name": "spatialset_srid", + "file": "meos_geo.h", + "returnType": { + "c": "int32_t", + "canonical": "int" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "spatialset_transform", + "file": "meos_geo.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + } + ] + }, + { + "name": "spatialset_transform_pipeline", + "file": "meos_geo.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "pipelinestr", + "cType": "const char *", + "canonical": "const char *" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + }, + { + "name": "is_forward", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "stbox_as_hexwkb", + "file": "meos_geo.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "variant", + "cType": "uint8_t", + "canonical": "unsigned char" + }, + { + "name": "size", + "cType": "size_t *", + "canonical": "unsigned long *" + } + ] + }, + { + "name": "stbox_as_wkb", + "file": "meos_geo.h", + "returnType": { + "c": "uint8_t *", + "canonical": "unsigned char *" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "variant", + "cType": "uint8_t", + "canonical": "unsigned char" + }, + { + "name": "size_out", + "cType": "size_t *", + "canonical": "unsigned long *" + } + ] + }, + { + "name": "stbox_from_hexwkb", + "file": "meos_geo.h", + "returnType": { + "c": "STBox *", + "canonical": "struct STBox *" + }, + "params": [ + { + "name": "hexwkb", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "stbox_from_wkb", + "file": "meos_geo.h", + "returnType": { + "c": "STBox *", + "canonical": "struct STBox *" + }, + "params": [ + { + "name": "wkb", + "cType": "const uint8_t *", + "canonical": "const unsigned char *" + }, + { + "name": "size", + "cType": "size_t", + "canonical": "unsigned long" + } + ] + }, + { + "name": "stbox_in", + "file": "meos_geo.h", + "returnType": { + "c": "STBox *", + "canonical": "struct STBox *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "stbox_out", + "file": "meos_geo.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "geo_timestamptz_to_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "STBox *", + "canonical": "struct STBox *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "geo_tstzspan_to_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "STBox *", + "canonical": "struct STBox *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "stbox_copy", + "file": "meos_geo.h", + "returnType": { + "c": "STBox *", + "canonical": "struct STBox *" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + } + ] + }, + { + "name": "stbox_make", + "file": "meos_geo.h", + "returnType": { + "c": "STBox *", + "canonical": "struct STBox *" + }, + "params": [ + { + "name": "hasx", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "hasz", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "geodetic", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + }, + { + "name": "xmin", + "cType": "double", + "canonical": "double" + }, + { + "name": "xmax", + "cType": "double", + "canonical": "double" + }, + { + "name": "ymin", + "cType": "double", + "canonical": "double" + }, + { + "name": "ymax", + "cType": "double", + "canonical": "double" + }, + { + "name": "zmin", + "cType": "double", + "canonical": "double" + }, + { + "name": "zmax", + "cType": "double", + "canonical": "double" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "geo_to_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "STBox *", + "canonical": "struct STBox *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "spatialset_to_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "STBox *", + "canonical": "struct STBox *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "stbox_to_box3d", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + } + ] + }, + { + "name": "stbox_to_gbox", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + } + ] + }, + { + "name": "stbox_to_geo", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + } + ] + }, + { + "name": "stbox_to_tstzspan", + "file": "meos_geo.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + } + ] + }, + { + "name": "timestamptz_to_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "STBox *", + "canonical": "struct STBox *" + }, + "params": [ + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "tstzset_to_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "STBox *", + "canonical": "struct STBox *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "tstzspan_to_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "STBox *", + "canonical": "struct STBox *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "tstzspanset_to_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "STBox *", + "canonical": "struct STBox *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "stbox_area", + "file": "meos_geo.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "spheroid", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "stbox_hash", + "file": "meos_geo.h", + "returnType": { + "c": "uint32", + "canonical": "unsigned int" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + } + ] + }, + { + "name": "stbox_hash_extended", + "file": "meos_geo.h", + "returnType": { + "c": "uint64", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "seed", + "cType": "uint64", + "canonical": "unsigned long" + } + ] + }, + { + "name": "stbox_hast", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + } + ] + }, + { + "name": "stbox_hasx", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + } + ] + }, + { + "name": "stbox_hasz", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + } + ] + }, + { + "name": "stbox_isgeodetic", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + } + ] + }, + { + "name": "stbox_perimeter", + "file": "meos_geo.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "spheroid", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "stbox_tmax", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "result", + "cType": "TimestampTz *", + "canonical": "long *" + } + ] + }, + { + "name": "stbox_tmax_inc", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "result", + "cType": "bool *", + "canonical": "_Bool *" + } + ] + }, + { + "name": "stbox_tmin", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "result", + "cType": "TimestampTz *", + "canonical": "long *" + } + ] + }, + { + "name": "stbox_tmin_inc", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "result", + "cType": "bool *", + "canonical": "_Bool *" + } + ] + }, + { + "name": "stbox_volume", + "file": "meos_geo.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + } + ] + }, + { + "name": "stbox_xmax", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "result", + "cType": "double *", + "canonical": "double *" + } + ] + }, + { + "name": "stbox_xmin", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "result", + "cType": "double *", + "canonical": "double *" + } + ] + }, + { + "name": "stbox_ymax", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "result", + "cType": "double *", + "canonical": "double *" + } + ] + }, + { + "name": "stbox_ymin", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "result", + "cType": "double *", + "canonical": "double *" + } + ] + }, + { + "name": "stbox_zmax", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "result", + "cType": "double *", + "canonical": "double *" + } + ] + }, + { + "name": "stbox_zmin", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "result", + "cType": "double *", + "canonical": "double *" + } + ] + }, + { + "name": "stbox_expand_space", + "file": "meos_geo.h", + "returnType": { + "c": "STBox *", + "canonical": "struct STBox *" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "stbox_expand_time", + "file": "meos_geo.h", + "returnType": { + "c": "STBox *", + "canonical": "struct STBox *" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "interv", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "stbox_get_space", + "file": "meos_geo.h", + "returnType": { + "c": "STBox *", + "canonical": "struct STBox *" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + } + ] + }, + { + "name": "stbox_quad_split", + "file": "meos_geo.h", + "returnType": { + "c": "STBox *", + "canonical": "struct STBox *" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "stbox_round", + "file": "meos_geo.h", + "returnType": { + "c": "STBox *", + "canonical": "struct STBox *" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "stbox_shift_scale_time", + "file": "meos_geo.h", + "returnType": { + "c": "STBox *", + "canonical": "struct STBox *" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "shift", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "duration", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "stboxarr_round", + "file": "meos_geo.h", + "returnType": { + "c": "STBox *", + "canonical": "struct STBox *" + }, + "params": [ + { + "name": "boxarr", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "stbox_set_srid", + "file": "meos_geo.h", + "returnType": { + "c": "STBox *", + "canonical": "struct STBox *" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + } + ] + }, + { + "name": "stbox_srid", + "file": "meos_geo.h", + "returnType": { + "c": "int32_t", + "canonical": "int" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + } + ] + }, + { + "name": "stbox_transform", + "file": "meos_geo.h", + "returnType": { + "c": "STBox *", + "canonical": "struct STBox *" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + } + ] + }, + { + "name": "stbox_transform_pipeline", + "file": "meos_geo.h", + "returnType": { + "c": "STBox *", + "canonical": "struct STBox *" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "pipelinestr", + "cType": "const char *", + "canonical": "const char *" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + }, + { + "name": "is_forward", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "adjacent_stbox_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "box2", + "cType": "const STBox *", + "canonical": "const struct STBox *" + } + ] + }, + { + "name": "contained_stbox_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "box2", + "cType": "const STBox *", + "canonical": "const struct STBox *" + } + ] + }, + { + "name": "contains_stbox_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "box2", + "cType": "const STBox *", + "canonical": "const struct STBox *" + } + ] + }, + { + "name": "overlaps_stbox_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "box2", + "cType": "const STBox *", + "canonical": "const struct STBox *" + } + ] + }, + { + "name": "same_stbox_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "box2", + "cType": "const STBox *", + "canonical": "const struct STBox *" + } + ] + }, + { + "name": "above_stbox_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "box2", + "cType": "const STBox *", + "canonical": "const struct STBox *" + } + ] + }, + { + "name": "after_stbox_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "box2", + "cType": "const STBox *", + "canonical": "const struct STBox *" + } + ] + }, + { + "name": "back_stbox_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "box2", + "cType": "const STBox *", + "canonical": "const struct STBox *" + } + ] + }, + { + "name": "before_stbox_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "box2", + "cType": "const STBox *", + "canonical": "const struct STBox *" + } + ] + }, + { + "name": "below_stbox_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "box2", + "cType": "const STBox *", + "canonical": "const struct STBox *" + } + ] + }, + { + "name": "front_stbox_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "box2", + "cType": "const STBox *", + "canonical": "const struct STBox *" + } + ] + }, + { + "name": "left_stbox_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "box2", + "cType": "const STBox *", + "canonical": "const struct STBox *" + } + ] + }, + { + "name": "overabove_stbox_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "box2", + "cType": "const STBox *", + "canonical": "const struct STBox *" + } + ] + }, + { + "name": "overafter_stbox_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "box2", + "cType": "const STBox *", + "canonical": "const struct STBox *" + } + ] + }, + { + "name": "overback_stbox_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "box2", + "cType": "const STBox *", + "canonical": "const struct STBox *" + } + ] + }, + { + "name": "overbefore_stbox_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "box2", + "cType": "const STBox *", + "canonical": "const struct STBox *" + } + ] + }, + { + "name": "overbelow_stbox_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "box2", + "cType": "const STBox *", + "canonical": "const struct STBox *" + } + ] + }, + { + "name": "overfront_stbox_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "box2", + "cType": "const STBox *", + "canonical": "const struct STBox *" + } + ] + }, + { + "name": "overleft_stbox_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "box2", + "cType": "const STBox *", + "canonical": "const struct STBox *" + } + ] + }, + { + "name": "overright_stbox_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "box2", + "cType": "const STBox *", + "canonical": "const struct STBox *" + } + ] + }, + { + "name": "right_stbox_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "box2", + "cType": "const STBox *", + "canonical": "const struct STBox *" + } + ] + }, + { + "name": "union_stbox_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "STBox *", + "canonical": "struct STBox *" + }, + "params": [ + { + "name": "box1", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "box2", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "strict", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "intersection_stbox_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "STBox *", + "canonical": "struct STBox *" + }, + "params": [ + { + "name": "box1", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "box2", + "cType": "const STBox *", + "canonical": "const struct STBox *" + } + ] + }, + { + "name": "stbox_cmp", + "file": "meos_geo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "box1", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "box2", + "cType": "const STBox *", + "canonical": "const struct STBox *" + } + ] + }, + { + "name": "stbox_eq", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "box2", + "cType": "const STBox *", + "canonical": "const struct STBox *" + } + ] + }, + { + "name": "stbox_ge", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "box2", + "cType": "const STBox *", + "canonical": "const struct STBox *" + } + ] + }, + { + "name": "stbox_gt", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "box2", + "cType": "const STBox *", + "canonical": "const struct STBox *" + } + ] + }, + { + "name": "stbox_le", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "box2", + "cType": "const STBox *", + "canonical": "const struct STBox *" + } + ] + }, + { + "name": "stbox_lt", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "box2", + "cType": "const STBox *", + "canonical": "const struct STBox *" + } + ] + }, + { + "name": "stbox_ne", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "box2", + "cType": "const STBox *", + "canonical": "const struct STBox *" + } + ] + }, + { + "name": "tspatial_out", + "file": "meos_geo.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "tgeogpoint_from_mfjson", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "tgeogpoint_in", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "tgeography_from_mfjson", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "mfjson", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "tgeography_in", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "tgeometry_from_mfjson", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "tgeometry_in", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "tgeompoint_from_mfjson", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "tgeompoint_in", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "tspatial_as_ewkt", + "file": "meos_geo.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "tspatial_as_text", + "file": "meos_geo.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "tgeo_from_base_temp", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tgeoinst_make", + "file": "meos_geo.h", + "returnType": { + "c": "TInstant *", + "canonical": "struct TInstant *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "tgeoseq_from_base_tstzset", + "file": "meos_geo.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "tgeoseq_from_base_tstzspan", + "file": "meos_geo.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "tgeoseqset_from_base_tstzspanset", + "file": "meos_geo.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "tpoint_from_base_temp", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tpointinst_make", + "file": "meos_geo.h", + "returnType": { + "c": "TInstant *", + "canonical": "struct TInstant *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "tpointseq_from_base_tstzset", + "file": "meos_geo.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "tpointseq_from_base_tstzspan", + "file": "meos_geo.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "tpointseq_make_coords", + "file": "meos_geo.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "xcoords", + "cType": "const double *", + "canonical": "const double *" + }, + { + "name": "ycoords", + "cType": "const double *", + "canonical": "const double *" + }, + { + "name": "zcoords", + "cType": "const double *", + "canonical": "const double *" + }, + { + "name": "times", + "cType": "const TimestampTz *", + "canonical": "const long *" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + }, + { + "name": "geodetic", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "lower_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "upper_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + }, + { + "name": "normalize", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tpointseqset_from_base_tstzspanset", + "file": "meos_geo.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "box3d_to_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "STBox *", + "canonical": "struct STBox *" + }, + "params": [ + { + "name": "box", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "gbox_to_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "STBox *", + "canonical": "struct STBox *" + }, + "params": [ + { + "name": "box", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "geomeas_to_tpoint", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "tgeogpoint_to_tgeography", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tgeography_to_tgeogpoint", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tgeography_to_tgeometry", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tgeometry_to_tgeography", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tgeometry_to_tgeompoint", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tgeompoint_to_tgeometry", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tpoint_as_mvtgeom", + "file": "meos_geo.h", + "returnType": { + "c": "MvtGeom", + "canonical": "struct MvtGeom" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "bounds", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "extent", + "cType": "int32_t", + "canonical": "int" + }, + { + "name": "buffer", + "cType": "int32_t", + "canonical": "int" + }, + { + "name": "clip_geom", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tpoint_tfloat_to_geomeas", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "tpoint", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "measure", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "segmentize", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "result", + "cType": "int **", + "canonical": "int **" + } + ] + }, + { + "name": "tspatial_to_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "STBox *", + "canonical": "struct STBox *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "bearing_point_point", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "gs1", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "gs2", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "result", + "cType": "double *", + "canonical": "double *" + } + ] + }, + { + "name": "bearing_tpoint_point", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "invert", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "bearing_tpoint_tpoint", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tgeo_centroid", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tgeo_convex_hull", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tgeo_end_value", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tgeo_start_value", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tgeo_traversed_area", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "unary_union", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tgeo_value_at_timestamptz", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "strict", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "result", + "cType": "int **", + "canonical": "int **" + } + ] + }, + { + "name": "tgeo_value_n", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "n", + "cType": "int", + "canonical": "int" + }, + { + "name": "result", + "cType": "int **", + "canonical": "int **" + } + ] + }, + { + "name": "tgeo_values", + "file": "meos_geo.h", + "returnType": { + "c": "int **", + "canonical": "int **" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tpoint_angular_difference", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tpoint_azimuth", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tpoint_cumulative_length", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tpoint_direction", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "result", + "cType": "double *", + "canonical": "double *" + } + ] + }, + { + "name": "tpoint_get_x", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tpoint_get_y", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tpoint_get_z", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tpoint_is_simple", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tpoint_length", + "file": "meos_geo.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tpoint_speed", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ], + "ownership": "caller", + "nullable": true, + "doc": "Computes the instantaneous speed of a temporal point.", + "meos": { + "temporalDim": "sequence", + "spatialDim": null, + "interpolation": true, + "subtype": "TPoint" + } + }, + { + "name": "tpoint_trajectory", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "unary_union", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tpoint_twcentroid", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tgeo_affine", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "a", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "tgeo_scale", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "scale", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "sorigin", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "tpoint_make_simple", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal **", + "canonical": "Temporal **" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tspatial_srid", + "file": "meos_geo.h", + "returnType": { + "c": "int32_t", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tspatial_set_srid", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + } + ] + }, + { + "name": "tspatial_transform", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + } + ] + }, + { + "name": "tspatial_transform_pipeline", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "pipelinestr", + "cType": "const char *", + "canonical": "const char *" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + }, + { + "name": "is_forward", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tgeo_at_geom", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "tgeo_at_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "border_inc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tgeo_at_value", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tgeo_minus_geom", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "tgeo_minus_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "border_inc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tgeo_minus_value", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tpoint_at_elevation", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "tpoint_at_geom", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "tpoint_at_value", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tpoint_minus_elevation", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "tpoint_minus_geom", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "tpoint_minus_value", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "always_eq_geo_tgeo", + "file": "meos_geo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_eq_tgeo_geo", + "file": "meos_geo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "always_eq_tgeo_tgeo", + "file": "meos_geo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_ne_geo_tgeo", + "file": "meos_geo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_ne_tgeo_geo", + "file": "meos_geo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "always_ne_tgeo_tgeo", + "file": "meos_geo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_eq_geo_tgeo", + "file": "meos_geo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_eq_tgeo_geo", + "file": "meos_geo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "ever_eq_tgeo_tgeo", + "file": "meos_geo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_ne_geo_tgeo", + "file": "meos_geo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_ne_tgeo_geo", + "file": "meos_geo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "ever_ne_tgeo_tgeo", + "file": "meos_geo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "teq_geo_tgeo", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "teq_tgeo_geo", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "tne_geo_tgeo", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tne_tgeo_geo", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "tgeo_stboxes", + "file": "meos_geo.h", + "returnType": { + "c": "STBox *", + "canonical": "struct STBox *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tgeo_space_boxes", + "file": "meos_geo.h", + "returnType": { + "c": "STBox *", + "canonical": "struct STBox *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "xsize", + "cType": "double", + "canonical": "double" + }, + { + "name": "ysize", + "cType": "double", + "canonical": "double" + }, + { + "name": "zsize", + "cType": "double", + "canonical": "double" + }, + { + "name": "sorigin", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "bitmatrix", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "border_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tgeo_space_time_boxes", + "file": "meos_geo.h", + "returnType": { + "c": "STBox *", + "canonical": "struct STBox *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "xsize", + "cType": "double", + "canonical": "double" + }, + { + "name": "ysize", + "cType": "double", + "canonical": "double" + }, + { + "name": "zsize", + "cType": "double", + "canonical": "double" + }, + { + "name": "duration", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "sorigin", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "torigin", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "bitmatrix", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "border_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tgeo_split_each_n_stboxes", + "file": "meos_geo.h", + "returnType": { + "c": "STBox *", + "canonical": "struct STBox *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "elem_count", + "cType": "int", + "canonical": "int" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tgeo_split_n_stboxes", + "file": "meos_geo.h", + "returnType": { + "c": "STBox *", + "canonical": "struct STBox *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box_count", + "cType": "int", + "canonical": "int" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "adjacent_stbox_tspatial", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "adjacent_tspatial_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + } + ] + }, + { + "name": "adjacent_tspatial_tspatial", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "contained_stbox_tspatial", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "contained_tspatial_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + } + ] + }, + { + "name": "contained_tspatial_tspatial", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "contains_stbox_tspatial", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "contains_tspatial_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + } + ] + }, + { + "name": "contains_tspatial_tspatial", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "overlaps_stbox_tspatial", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "overlaps_tspatial_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + } + ] + }, + { + "name": "overlaps_tspatial_tspatial", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "same_stbox_tspatial", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "same_tspatial_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + } + ] + }, + { + "name": "same_tspatial_tspatial", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "above_stbox_tspatial", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "above_tspatial_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + } + ] + }, + { + "name": "above_tspatial_tspatial", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "after_stbox_tspatial", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "after_tspatial_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + } + ] + }, + { + "name": "after_tspatial_tspatial", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "back_stbox_tspatial", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "back_tspatial_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + } + ] + }, + { + "name": "back_tspatial_tspatial", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "before_stbox_tspatial", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "before_tspatial_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + } + ] + }, + { + "name": "before_tspatial_tspatial", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "below_stbox_tspatial", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "below_tspatial_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + } + ] + }, + { + "name": "below_tspatial_tspatial", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "front_stbox_tspatial", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "front_tspatial_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + } + ] + }, + { + "name": "front_tspatial_tspatial", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "left_stbox_tspatial", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "left_tspatial_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + } + ] + }, + { + "name": "left_tspatial_tspatial", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "overabove_stbox_tspatial", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "overabove_tspatial_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + } + ] + }, + { + "name": "overabove_tspatial_tspatial", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "overafter_stbox_tspatial", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "overafter_tspatial_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + } + ] + }, + { + "name": "overafter_tspatial_tspatial", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "overback_stbox_tspatial", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "overback_tspatial_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + } + ] + }, + { + "name": "overback_tspatial_tspatial", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "overbefore_stbox_tspatial", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "overbefore_tspatial_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + } + ] + }, + { + "name": "overbefore_tspatial_tspatial", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "overbelow_stbox_tspatial", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "overbelow_tspatial_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + } + ] + }, + { + "name": "overbelow_tspatial_tspatial", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "overfront_stbox_tspatial", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "overfront_tspatial_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + } + ] + }, + { + "name": "overfront_tspatial_tspatial", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "overleft_stbox_tspatial", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "overleft_tspatial_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + } + ] + }, + { + "name": "overleft_tspatial_tspatial", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "overright_stbox_tspatial", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "overright_tspatial_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + } + ] + }, + { + "name": "overright_tspatial_tspatial", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "right_stbox_tspatial", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "right_tspatial_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + } + ] + }, + { + "name": "right_tspatial_tspatial", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "acontains_geo_tgeo", + "file": "meos_geo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "acontains_tgeo_geo", + "file": "meos_geo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "acontains_tgeo_tgeo", + "file": "meos_geo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "acovers_geo_tgeo", + "file": "meos_geo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "acovers_tgeo_geo", + "file": "meos_geo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "acovers_tgeo_tgeo", + "file": "meos_geo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "adisjoint_tgeo_geo", + "file": "meos_geo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "adisjoint_tgeo_tgeo", + "file": "meos_geo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "adwithin_tgeo_geo", + "file": "meos_geo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "dist", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "adwithin_tgeo_tgeo", + "file": "meos_geo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "dist", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "aintersects_tgeo_geo", + "file": "meos_geo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "aintersects_tgeo_tgeo", + "file": "meos_geo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "atouches_tgeo_geo", + "file": "meos_geo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "atouches_tgeo_tgeo", + "file": "meos_geo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "atouches_tpoint_geo", + "file": "meos_geo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "econtains_geo_tgeo", + "file": "meos_geo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "econtains_tgeo_geo", + "file": "meos_geo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "econtains_tgeo_tgeo", + "file": "meos_geo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ecovers_geo_tgeo", + "file": "meos_geo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ecovers_tgeo_geo", + "file": "meos_geo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "ecovers_tgeo_tgeo", + "file": "meos_geo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "edisjoint_tgeo_geo", + "file": "meos_geo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "edisjoint_tgeo_tgeo", + "file": "meos_geo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "edwithin_tgeo_geo", + "file": "meos_geo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "dist", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "edwithin_tgeo_tgeo", + "file": "meos_geo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "dist", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "eintersects_tgeo_geo", + "file": "meos_geo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "eintersects_tgeo_tgeo", + "file": "meos_geo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "etouches_tgeo_geo", + "file": "meos_geo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "etouches_tgeo_tgeo", + "file": "meos_geo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "etouches_tpoint_geo", + "file": "meos_geo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "tcontains_geo_tgeo", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tcontains_tgeo_geo", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "tcontains_tgeo_tgeo", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tcovers_geo_tgeo", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tcovers_tgeo_geo", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "tcovers_tgeo_tgeo", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tdisjoint_geo_tgeo", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tdisjoint_tgeo_geo", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "tdisjoint_tgeo_tgeo", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tdwithin_geo_tgeo", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "dist", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "tdwithin_tgeo_geo", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "dist", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "tdwithin_tgeo_tgeo", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "dist", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "tintersects_geo_tgeo", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tintersects_tgeo_geo", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "tintersects_tgeo_tgeo", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ttouches_geo_tgeo", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ttouches_tgeo_geo", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "ttouches_tgeo_tgeo", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "edwithin_tgeoarr_tgeoarr", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "arr1", + "cType": "const Temporal **", + "canonical": "const Temporal **" + }, + { + "name": "count1", + "cType": "int", + "canonical": "int" + }, + { + "name": "arr2", + "cType": "const Temporal **", + "canonical": "const Temporal **" + }, + { + "name": "count2", + "cType": "int", + "canonical": "int" + }, + { + "name": "dist", + "cType": "double", + "canonical": "double" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "adwithin_tgeoarr_tgeoarr", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "arr1", + "cType": "const Temporal **", + "canonical": "const Temporal **" + }, + { + "name": "count1", + "cType": "int", + "canonical": "int" + }, + { + "name": "arr2", + "cType": "const Temporal **", + "canonical": "const Temporal **" + }, + { + "name": "count2", + "cType": "int", + "canonical": "int" + }, + { + "name": "dist", + "cType": "double", + "canonical": "double" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "eintersects_tgeoarr_tgeoarr", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "arr1", + "cType": "const Temporal **", + "canonical": "const Temporal **" + }, + { + "name": "count1", + "cType": "int", + "canonical": "int" + }, + { + "name": "arr2", + "cType": "const Temporal **", + "canonical": "const Temporal **" + }, + { + "name": "count2", + "cType": "int", + "canonical": "int" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "aintersects_tgeoarr_tgeoarr", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "arr1", + "cType": "const Temporal **", + "canonical": "const Temporal **" + }, + { + "name": "count1", + "cType": "int", + "canonical": "int" + }, + { + "name": "arr2", + "cType": "const Temporal **", + "canonical": "const Temporal **" + }, + { + "name": "count2", + "cType": "int", + "canonical": "int" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "etouches_tgeoarr_tgeoarr", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "arr1", + "cType": "const Temporal **", + "canonical": "const Temporal **" + }, + { + "name": "count1", + "cType": "int", + "canonical": "int" + }, + { + "name": "arr2", + "cType": "const Temporal **", + "canonical": "const Temporal **" + }, + { + "name": "count2", + "cType": "int", + "canonical": "int" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "atouches_tgeoarr_tgeoarr", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "arr1", + "cType": "const Temporal **", + "canonical": "const Temporal **" + }, + { + "name": "count1", + "cType": "int", + "canonical": "int" + }, + { + "name": "arr2", + "cType": "const Temporal **", + "canonical": "const Temporal **" + }, + { + "name": "count2", + "cType": "int", + "canonical": "int" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "edisjoint_tgeoarr_tgeoarr", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "arr1", + "cType": "const Temporal **", + "canonical": "const Temporal **" + }, + { + "name": "count1", + "cType": "int", + "canonical": "int" + }, + { + "name": "arr2", + "cType": "const Temporal **", + "canonical": "const Temporal **" + }, + { + "name": "count2", + "cType": "int", + "canonical": "int" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "adisjoint_tgeoarr_tgeoarr", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "arr1", + "cType": "const Temporal **", + "canonical": "const Temporal **" + }, + { + "name": "count1", + "cType": "int", + "canonical": "int" + }, + { + "name": "arr2", + "cType": "const Temporal **", + "canonical": "const Temporal **" + }, + { + "name": "count2", + "cType": "int", + "canonical": "int" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tdwithin_tgeoarr_tgeoarr", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "arr1", + "cType": "const Temporal **", + "canonical": "const Temporal **" + }, + { + "name": "count1", + "cType": "int", + "canonical": "int" + }, + { + "name": "arr2", + "cType": "const Temporal **", + "canonical": "const Temporal **" + }, + { + "name": "count2", + "cType": "int", + "canonical": "int" + }, + { + "name": "dist", + "cType": "double", + "canonical": "double" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + }, + { + "name": "periods", + "cType": "SpanSet ***", + "canonical": "struct SpanSet ***" + } + ] + }, + { + "name": "tintersects_tgeoarr_tgeoarr", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "arr1", + "cType": "const Temporal **", + "canonical": "const Temporal **" + }, + { + "name": "count1", + "cType": "int", + "canonical": "int" + }, + { + "name": "arr2", + "cType": "const Temporal **", + "canonical": "const Temporal **" + }, + { + "name": "count2", + "cType": "int", + "canonical": "int" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + }, + { + "name": "periods", + "cType": "SpanSet ***", + "canonical": "struct SpanSet ***" + } + ] + }, + { + "name": "ttouches_tgeoarr_tgeoarr", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "arr1", + "cType": "const Temporal **", + "canonical": "const Temporal **" + }, + { + "name": "count1", + "cType": "int", + "canonical": "int" + }, + { + "name": "arr2", + "cType": "const Temporal **", + "canonical": "const Temporal **" + }, + { + "name": "count2", + "cType": "int", + "canonical": "int" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + }, + { + "name": "periods", + "cType": "SpanSet ***", + "canonical": "struct SpanSet ***" + } + ] + }, + { + "name": "tdisjoint_tgeoarr_tgeoarr", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "arr1", + "cType": "const Temporal **", + "canonical": "const Temporal **" + }, + { + "name": "count1", + "cType": "int", + "canonical": "int" + }, + { + "name": "arr2", + "cType": "const Temporal **", + "canonical": "const Temporal **" + }, + { + "name": "count2", + "cType": "int", + "canonical": "int" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + }, + { + "name": "periods", + "cType": "SpanSet ***", + "canonical": "struct SpanSet ***" + } + ] + }, + { + "name": "tdistance_tgeo_geo", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "tdistance_tgeo_tgeo", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "nad_stbox_geo", + "file": "meos_geo.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "nad_stbox_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "box1", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "box2", + "cType": "const STBox *", + "canonical": "const struct STBox *" + } + ] + }, + { + "name": "nad_tgeo_geo", + "file": "meos_geo.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "nad_tgeo_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + } + ] + }, + { + "name": "nad_tgeo_tgeo", + "file": "meos_geo.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "nai_tgeo_geo", + "file": "meos_geo.h", + "returnType": { + "c": "TInstant *", + "canonical": "struct TInstant *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "nai_tgeo_tgeo", + "file": "meos_geo.h", + "returnType": { + "c": "TInstant *", + "canonical": "struct TInstant *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "shortestline_tgeo_geo", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "shortestline_tgeo_tgeo", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tgeoarr_tgeoarr_mindist", + "file": "meos_geo.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "arr1", + "cType": "const Temporal **", + "canonical": "const Temporal **" + }, + { + "name": "count1", + "cType": "int", + "canonical": "int" + }, + { + "name": "arr2", + "cType": "const Temporal **", + "canonical": "const Temporal **" + }, + { + "name": "count2", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "mindistance_tgeo_tgeo", + "file": "meos_geo.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "threshold", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "tpoint_tcentroid_finalfn", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "state", + "cType": "SkipList *", + "canonical": "struct SkipList *" + } + ] + }, + { + "name": "tpoint_tcentroid_transfn", + "file": "meos_geo.h", + "returnType": { + "c": "SkipList *", + "canonical": "struct SkipList *" + }, + "params": [ + { + "name": "state", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "temp", + "cType": "Temporal *", + "canonical": "Temporal *" + } + ] + }, + { + "name": "tspatial_extent_transfn", + "file": "meos_geo.h", + "returnType": { + "c": "STBox *", + "canonical": "struct STBox *" + }, + "params": [ + { + "name": "box", + "cType": "STBox *", + "canonical": "struct STBox *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "stbox_get_space_tile", + "file": "meos_geo.h", + "returnType": { + "c": "STBox *", + "canonical": "struct STBox *" + }, + "params": [ + { + "name": "point", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "xsize", + "cType": "double", + "canonical": "double" + }, + { + "name": "ysize", + "cType": "double", + "canonical": "double" + }, + { + "name": "zsize", + "cType": "double", + "canonical": "double" + }, + { + "name": "sorigin", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "stbox_get_space_time_tile", + "file": "meos_geo.h", + "returnType": { + "c": "STBox *", + "canonical": "struct STBox *" + }, + "params": [ + { + "name": "point", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "xsize", + "cType": "double", + "canonical": "double" + }, + { + "name": "ysize", + "cType": "double", + "canonical": "double" + }, + { + "name": "zsize", + "cType": "double", + "canonical": "double" + }, + { + "name": "duration", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "sorigin", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "torigin", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "stbox_get_time_tile", + "file": "meos_geo.h", + "returnType": { + "c": "STBox *", + "canonical": "struct STBox *" + }, + "params": [ + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "duration", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "torigin", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "stbox_space_tiles", + "file": "meos_geo.h", + "returnType": { + "c": "STBox *", + "canonical": "struct STBox *" + }, + "params": [ + { + "name": "bounds", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "xsize", + "cType": "double", + "canonical": "double" + }, + { + "name": "ysize", + "cType": "double", + "canonical": "double" + }, + { + "name": "zsize", + "cType": "double", + "canonical": "double" + }, + { + "name": "sorigin", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "border_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "stbox_space_time_tiles", + "file": "meos_geo.h", + "returnType": { + "c": "STBox *", + "canonical": "struct STBox *" + }, + "params": [ + { + "name": "bounds", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "xsize", + "cType": "double", + "canonical": "double" + }, + { + "name": "ysize", + "cType": "double", + "canonical": "double" + }, + { + "name": "zsize", + "cType": "double", + "canonical": "double" + }, + { + "name": "duration", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "sorigin", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "torigin", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "border_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "stbox_time_tiles", + "file": "meos_geo.h", + "returnType": { + "c": "STBox *", + "canonical": "struct STBox *" + }, + "params": [ + { + "name": "bounds", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "duration", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "torigin", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "border_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tgeo_space_split", + "file": "meos_geo.h", + "returnType": { + "c": "SpaceSplit", + "canonical": "struct SpaceSplit" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "xsize", + "cType": "double", + "canonical": "double" + }, + { + "name": "ysize", + "cType": "double", + "canonical": "double" + }, + { + "name": "zsize", + "cType": "double", + "canonical": "double" + }, + { + "name": "sorigin", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "bitmatrix", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "border_inc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tgeo_space_time_split", + "file": "meos_geo.h", + "returnType": { + "c": "SpaceTimeSplit", + "canonical": "struct SpaceTimeSplit" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "xsize", + "cType": "double", + "canonical": "double" + }, + { + "name": "ysize", + "cType": "double", + "canonical": "double" + }, + { + "name": "zsize", + "cType": "double", + "canonical": "double" + }, + { + "name": "duration", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "sorigin", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "torigin", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "bitmatrix", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "border_inc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "geo_cluster_kmeans", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "geoms", + "cType": "const int **", + "canonical": "const int **" + }, + { + "name": "ngeoms", + "cType": "uint32_t", + "canonical": "unsigned int" + }, + { + "name": "k", + "cType": "uint32_t", + "canonical": "unsigned int" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "geo_cluster_dbscan", + "file": "meos_geo.h", + "returnType": { + "c": "uint32_t *", + "canonical": "unsigned int *" + }, + "params": [ + { + "name": "geoms", + "cType": "const int **", + "canonical": "const int **" + }, + { + "name": "ngeoms", + "cType": "uint32_t", + "canonical": "unsigned int" + }, + { + "name": "tolerance", + "cType": "double", + "canonical": "double" + }, + { + "name": "minpoints", + "cType": "int", + "canonical": "int" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "geo_cluster_intersecting", + "file": "meos_geo.h", + "returnType": { + "c": "int **", + "canonical": "int **" + }, + "params": [ + { + "name": "geoms", + "cType": "const int **", + "canonical": "const int **" + }, + { + "name": "ngeoms", + "cType": "uint32_t", + "canonical": "unsigned int" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "geo_cluster_within", + "file": "meos_geo.h", + "returnType": { + "c": "int **", + "canonical": "int **" + }, + "params": [ + { + "name": "geoms", + "cType": "const int **", + "canonical": "const int **" + }, + { + "name": "ngeoms", + "cType": "uint32_t", + "canonical": "unsigned int" + }, + { + "name": "tolerance", + "cType": "double", + "canonical": "double" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "cbuffer_as_ewkt", + "file": "meos_cbuffer.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "cbuffer_as_hexwkb", + "file": "meos_cbuffer.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "variant", + "cType": "uint8_t", + "canonical": "unsigned char" + }, + { + "name": "size", + "cType": "size_t *", + "canonical": "unsigned long *" + } + ] + }, + { + "name": "cbuffer_as_text", + "file": "meos_cbuffer.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "cbuffer_as_wkb", + "file": "meos_cbuffer.h", + "returnType": { + "c": "uint8_t *", + "canonical": "unsigned char *" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "variant", + "cType": "uint8_t", + "canonical": "unsigned char" + }, + { + "name": "size_out", + "cType": "size_t *", + "canonical": "unsigned long *" + } + ] + }, + { + "name": "cbuffer_from_hexwkb", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Cbuffer *", + "canonical": "struct Cbuffer *" + }, + "params": [ + { + "name": "hexwkb", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "cbuffer_from_wkb", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Cbuffer *", + "canonical": "struct Cbuffer *" + }, + "params": [ + { + "name": "wkb", + "cType": "const uint8_t *", + "canonical": "const unsigned char *" + }, + { + "name": "size", + "cType": "size_t", + "canonical": "unsigned long" + } + ] + }, + { + "name": "cbuffer_in", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Cbuffer *", + "canonical": "struct Cbuffer *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "cbuffer_out", + "file": "meos_cbuffer.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "cbuffer_copy", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Cbuffer *", + "canonical": "struct Cbuffer *" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "cbuffer_make", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Cbuffer *", + "canonical": "struct Cbuffer *" + }, + "params": [ + { + "name": "point", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "radius", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "cbuffer_to_geom", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "cbuffer_to_stbox", + "file": "meos_cbuffer.h", + "returnType": { + "c": "STBox *", + "canonical": "struct STBox *" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "cbufferarr_to_geom", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "cbarr", + "cType": "const Cbuffer **", + "canonical": "const struct Cbuffer **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "geom_to_cbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Cbuffer *", + "canonical": "struct Cbuffer *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "cbuffer_hash", + "file": "meos_cbuffer.h", + "returnType": { + "c": "uint32", + "canonical": "unsigned int" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "cbuffer_hash_extended", + "file": "meos_cbuffer.h", + "returnType": { + "c": "uint64", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "seed", + "cType": "uint64", + "canonical": "unsigned long" + } + ] + }, + { + "name": "cbuffer_point", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "cbuffer_radius", + "file": "meos_cbuffer.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "cbuffer_round", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Cbuffer *", + "canonical": "struct Cbuffer *" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "cbufferarr_round", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Cbuffer **", + "canonical": "struct Cbuffer **" + }, + "params": [ + { + "name": "cbarr", + "cType": "const Cbuffer **", + "canonical": "const struct Cbuffer **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "cbuffer_set_srid", + "file": "meos_cbuffer.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "cb", + "cType": "Cbuffer *", + "canonical": "struct Cbuffer *" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + } + ] + }, + { + "name": "cbuffer_srid", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int32_t", + "canonical": "int" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "cbuffer_transform", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Cbuffer *", + "canonical": "struct Cbuffer *" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + } + ] + }, + { + "name": "cbuffer_transform_pipeline", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Cbuffer *", + "canonical": "struct Cbuffer *" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "pipelinestr", + "cType": "const char *", + "canonical": "const char *" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + }, + { + "name": "is_forward", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "contains_cbuffer_cbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "cb1", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "cb2", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "covers_cbuffer_cbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "cb1", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "cb2", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "disjoint_cbuffer_cbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "cb1", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "cb2", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "dwithin_cbuffer_cbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "cb1", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "cb2", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "dist", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "intersects_cbuffer_cbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "cb1", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "cb2", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "touches_cbuffer_cbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "cb1", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "cb2", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "cbuffer_tstzspan_to_stbox", + "file": "meos_cbuffer.h", + "returnType": { + "c": "STBox *", + "canonical": "struct STBox *" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "cbuffer_timestamptz_to_stbox", + "file": "meos_cbuffer.h", + "returnType": { + "c": "STBox *", + "canonical": "struct STBox *" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "distance_cbuffer_cbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "cb1", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "cb2", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "distance_cbuffer_geo", + "file": "meos_cbuffer.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "distance_cbuffer_stbox", + "file": "meos_cbuffer.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + } + ] + }, + { + "name": "nad_cbuffer_stbox", + "file": "meos_cbuffer.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + } + ] + }, + { + "name": "cbuffer_cmp", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "cb1", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "cb2", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "cbuffer_eq", + "file": "meos_cbuffer.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "cb1", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "cb2", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "cbuffer_ge", + "file": "meos_cbuffer.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "cb1", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "cb2", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "cbuffer_gt", + "file": "meos_cbuffer.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "cb1", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "cb2", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "cbuffer_le", + "file": "meos_cbuffer.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "cb1", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "cb2", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "cbuffer_lt", + "file": "meos_cbuffer.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "cb1", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "cb2", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "cbuffer_ne", + "file": "meos_cbuffer.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "cb1", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "cb2", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "cbuffer_nsame", + "file": "meos_cbuffer.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "cb1", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "cb2", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "cbuffer_same", + "file": "meos_cbuffer.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "cb1", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "cb2", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "cbufferset_in", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "cbufferset_out", + "file": "meos_cbuffer.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "cbufferset_make", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "values", + "cType": "Cbuffer **", + "canonical": "struct Cbuffer **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "cbuffer_to_set", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "cbufferset_end_value", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Cbuffer *", + "canonical": "struct Cbuffer *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "cbufferset_start_value", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Cbuffer *", + "canonical": "struct Cbuffer *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "cbufferset_value_n", + "file": "meos_cbuffer.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "n", + "cType": "int", + "canonical": "int" + }, + { + "name": "result", + "cType": "Cbuffer **", + "canonical": "struct Cbuffer **" + } + ] + }, + { + "name": "cbufferset_values", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Cbuffer **", + "canonical": "struct Cbuffer **" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "cbuffer_union_transfn", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "state", + "cType": "Set *", + "canonical": "Set *" + }, + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "contained_cbuffer_set", + "file": "meos_cbuffer.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "contains_set_cbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "cb", + "cType": "Cbuffer *", + "canonical": "struct Cbuffer *" + } + ] + }, + { + "name": "intersection_cbuffer_set", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "intersection_set_cbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "minus_cbuffer_set", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "minus_set_cbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "union_cbuffer_set", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "union_set_cbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "tcbuffer_in", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "tcbuffer_from_mfjson", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "mfjson", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "tcbufferinst_make", + "file": "meos_cbuffer.h", + "returnType": { + "c": "TInstant *", + "canonical": "struct TInstant *" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "tcbuffer_make", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "tpoint", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "tfloat", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tcbuffer_from_base_temp", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tcbufferseq_from_base_tstzset", + "file": "meos_cbuffer.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "tcbufferseq_from_base_tstzspan", + "file": "meos_cbuffer.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "tcbufferseqset_from_base_tstzspanset", + "file": "meos_cbuffer.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "tcbuffer_end_value", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Cbuffer *", + "canonical": "struct Cbuffer *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tcbuffer_points", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tcbuffer_radius", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tcbuffer_traversed_area", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "unary_union", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tcbuffer_convex_hull", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tcbuffer_start_value", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Cbuffer *", + "canonical": "struct Cbuffer *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tcbuffer_value_at_timestamptz", + "file": "meos_cbuffer.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "strict", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "value", + "cType": "Cbuffer **", + "canonical": "struct Cbuffer **" + } + ] + }, + { + "name": "tcbuffer_value_n", + "file": "meos_cbuffer.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "n", + "cType": "int", + "canonical": "int" + }, + { + "name": "result", + "cType": "Cbuffer **", + "canonical": "struct Cbuffer **" + } + ] + }, + { + "name": "tcbuffer_values", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Cbuffer **", + "canonical": "struct Cbuffer **" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tcbuffer_to_tfloat", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tcbuffer_to_tgeompoint", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tgeometry_to_tcbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tcbuffer_expand", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "dist", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "tcbuffer_at_cbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "tcbuffer_at_geom", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "tcbuffer_at_stbox", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "border_inc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tcbuffer_minus_cbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "tcbuffer_minus_geom", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "tcbuffer_minus_stbox", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "border_inc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tdistance_tcbuffer_cbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "tdistance_tcbuffer_geo", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "tdistance_tcbuffer_tcbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "nad_tcbuffer_cbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "nad_tcbuffer_geo", + "file": "meos_cbuffer.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "nad_tcbuffer_stbox", + "file": "meos_cbuffer.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + } + ] + }, + { + "name": "nad_tcbuffer_tcbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "mindistance_tcbuffer_tcbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "threshold", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "nai_tcbuffer_cbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "TInstant *", + "canonical": "struct TInstant *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "nai_tcbuffer_geo", + "file": "meos_cbuffer.h", + "returnType": { + "c": "TInstant *", + "canonical": "struct TInstant *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "nai_tcbuffer_tcbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "TInstant *", + "canonical": "struct TInstant *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "shortestline_tcbuffer_cbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "shortestline_tcbuffer_geo", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "shortestline_tcbuffer_tcbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_eq_cbuffer_tcbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_eq_tcbuffer_cbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "always_eq_tcbuffer_tcbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_ne_cbuffer_tcbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_ne_tcbuffer_cbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "always_ne_tcbuffer_tcbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_eq_cbuffer_tcbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_eq_tcbuffer_cbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "ever_eq_tcbuffer_tcbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_ne_cbuffer_tcbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_ne_tcbuffer_cbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "ever_ne_tcbuffer_tcbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "teq_cbuffer_tcbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "teq_tcbuffer_cbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "tne_cbuffer_tcbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tne_tcbuffer_cbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "acontains_cbuffer_tcbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "acontains_geo_tcbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "acontains_tcbuffer_cbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "acontains_tcbuffer_geo", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "acovers_cbuffer_tcbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "acovers_geo_tcbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "acovers_tcbuffer_cbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "acovers_tcbuffer_geo", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "acovers_tcbuffer_tcbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "adisjoint_tcbuffer_geo", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "adisjoint_tcbuffer_cbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "adisjoint_tcbuffer_tcbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "adwithin_tcbuffer_geo", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "dist", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "adwithin_tcbuffer_cbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "dist", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "adwithin_tcbuffer_tcbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "dist", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "aintersects_tcbuffer_geo", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "aintersects_tcbuffer_cbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "aintersects_tcbuffer_tcbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "atouches_tcbuffer_geo", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "atouches_tcbuffer_cbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "atouches_tcbuffer_tcbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "econtains_cbuffer_tcbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "econtains_tcbuffer_cbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "econtains_tcbuffer_geo", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "ecovers_cbuffer_tcbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ecovers_geo_tcbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ecovers_tcbuffer_cbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "ecovers_tcbuffer_geo", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "ecovers_tcbuffer_tcbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "edisjoint_tcbuffer_geo", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "edisjoint_tcbuffer_cbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "edwithin_tcbuffer_geo", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "dist", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "edwithin_tcbuffer_cbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "dist", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "edwithin_tcbuffer_tcbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "dist", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "eintersects_tcbuffer_geo", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "eintersects_tcbuffer_cbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "eintersects_tcbuffer_tcbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "etouches_tcbuffer_geo", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "etouches_tcbuffer_cbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "etouches_tcbuffer_tcbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tcontains_cbuffer_tcbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tcontains_geo_tcbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tcontains_tcbuffer_geo", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "tcontains_tcbuffer_cbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "tcontains_tcbuffer_tcbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tcovers_cbuffer_tcbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tcovers_geo_tcbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tcovers_tcbuffer_geo", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "tcovers_tcbuffer_cbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "tcovers_tcbuffer_tcbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tdwithin_geo_tcbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "dist", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "tdwithin_tcbuffer_geo", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "dist", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "tdwithin_tcbuffer_cbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "dist", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "tdwithin_tcbuffer_tcbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "dist", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "tdisjoint_cbuffer_tcbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tdisjoint_geo_tcbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tdisjoint_tcbuffer_geo", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "tdisjoint_tcbuffer_cbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "tdisjoint_tcbuffer_tcbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tintersects_cbuffer_tcbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tintersects_geo_tcbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tintersects_tcbuffer_geo", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "tintersects_tcbuffer_cbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "tintersects_tcbuffer_tcbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ttouches_geo_tcbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ttouches_tcbuffer_geo", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "ttouches_cbuffer_tcbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ttouches_tcbuffer_cbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "ttouches_tcbuffer_tcbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ensure_valid_cbuffer_cbuffer", + "file": "cbuffer.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "cb1", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "cb2", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "ensure_valid_cbuffer_geo", + "file": "cbuffer.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "ensure_valid_cbuffer_stbox", + "file": "cbuffer.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + } + ] + }, + { + "name": "ensure_valid_cbufferset_cbuffer", + "file": "cbuffer.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "cbuffer_collinear", + "file": "cbuffer.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "cb1", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "cb2", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "cbuf3", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "ratio", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "cbuffersegm_interpolate", + "file": "cbuffer.h", + "returnType": { + "c": "Cbuffer *", + "canonical": "struct Cbuffer *" + }, + "params": [ + { + "name": "start", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "end", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "ratio", + "cType": "long double", + "canonical": "long double" + } + ] + }, + { + "name": "cbuffersegm_locate", + "file": "cbuffer.h", + "returnType": { + "c": "long double", + "canonical": "long double" + }, + "params": [ + { + "name": "start", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "end", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "value", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "cbuffer_parse", + "file": "cbuffer.h", + "returnType": { + "c": "Cbuffer *", + "canonical": "struct Cbuffer *" + }, + "params": [ + { + "name": "str", + "cType": "const char **", + "canonical": "const char **" + }, + { + "name": "end", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "cbuffer_wkt_out", + "file": "cbuffer.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "value", + "cType": "int", + "canonical": "int" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + }, + { + "name": "extended", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "cbuffer_point_p", + "file": "cbuffer.h", + "returnType": { + "c": "const int *", + "canonical": "const int *" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "datum_cbuffer_round", + "file": "cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "buffer", + "cType": "int", + "canonical": "int" + }, + { + "name": "size", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "cbuffer_transf_pj", + "file": "cbuffer.h", + "returnType": { + "c": "Cbuffer *", + "canonical": "struct Cbuffer *" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "srid_to", + "cType": "int32_t", + "canonical": "int" + }, + { + "name": "pj", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "cbuffer_distance", + "file": "cbuffer.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "cb1", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "cb2", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "datum_cbuffer_distance", + "file": "cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "cb1", + "cType": "int", + "canonical": "int" + }, + { + "name": "cb2", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "cbuffersegm_distance_turnpt", + "file": "cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "start1", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "end1", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "start2", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "end2", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "lower", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "upper", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "t1", + "cType": "TimestampTz *", + "canonical": "long *" + }, + { + "name": "t2", + "cType": "TimestampTz *", + "canonical": "long *" + } + ] + }, + { + "name": "cbuffer_contains", + "file": "cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "cb1", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "cb2", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "cbuffer_covers", + "file": "cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "cb1", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "cb2", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "cbuffer_disjoint", + "file": "cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "cb1", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "cb2", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "cbuffer_intersects", + "file": "cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "cb1", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "cb2", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "cbuffer_dwithin", + "file": "cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "cb1", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "cb2", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "dist", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "cbuffer_touches", + "file": "cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "cb1", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "cb2", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "datum_cbuffer_contains", + "file": "cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "cb1", + "cType": "int", + "canonical": "int" + }, + { + "name": "cb2", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "datum_cbuffer_covers", + "file": "cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "cb1", + "cType": "int", + "canonical": "int" + }, + { + "name": "cb2", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "datum_cbuffer_disjoint", + "file": "cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "cb1", + "cType": "int", + "canonical": "int" + }, + { + "name": "cb2", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "datum_cbuffer_intersects", + "file": "cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "cb1", + "cType": "int", + "canonical": "int" + }, + { + "name": "cb2", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "datum_cbuffer_dwithin", + "file": "cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "cb1", + "cType": "int", + "canonical": "int" + }, + { + "name": "cb2", + "cType": "int", + "canonical": "int" + }, + { + "name": "dist", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "datum_cbuffer_touches", + "file": "cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "cb1", + "cType": "int", + "canonical": "int" + }, + { + "name": "cb2", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "temptype_subtype", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "subtype", + "cType": "tempSubtype", + "canonical": "tempSubtype" + } + ] + }, + { + "name": "temptype_subtype_all", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "subtype", + "cType": "tempSubtype", + "canonical": "tempSubtype" + } + ] + }, + { + "name": "tempsubtype_name", + "file": "meos_catalog.h", + "returnType": { + "c": "const char *", + "canonical": "const char *" + }, + "params": [ + { + "name": "subtype", + "cType": "tempSubtype", + "canonical": "tempSubtype" + } + ] + }, + { + "name": "tempsubtype_from_string", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + }, + { + "name": "subtype", + "cType": "int16 *", + "canonical": "short *" + } + ] + }, + { + "name": "meosoper_name", + "file": "meos_catalog.h", + "returnType": { + "c": "const char *", + "canonical": "const char *" + }, + "params": [ + { + "name": "oper", + "cType": "MeosOper", + "canonical": "MeosOper" + } + ] + }, + { + "name": "meosoper_from_string", + "file": "meos_catalog.h", + "returnType": { + "c": "MeosOper", + "canonical": "MeosOper" + }, + "params": [ + { + "name": "name", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "interptype_name", + "file": "meos_catalog.h", + "returnType": { + "c": "const char *", + "canonical": "const char *" + }, + "params": [ + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "interptype_from_string", + "file": "meos_catalog.h", + "returnType": { + "c": "interpType", + "canonical": "interpType" + }, + "params": [ + { + "name": "interp_str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "meos_typeof_hexwkb", + "file": "meos_catalog.h", + "returnType": { + "c": "MeosType", + "canonical": "MeosType" + }, + "params": [ + { + "name": "hexwkb", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "meostype_name", + "file": "meos_catalog.h", + "returnType": { + "c": "const char *", + "canonical": "const char *" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "temptype_basetype", + "file": "meos_catalog.h", + "returnType": { + "c": "MeosType", + "canonical": "MeosType" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "settype_basetype", + "file": "meos_catalog.h", + "returnType": { + "c": "MeosType", + "canonical": "MeosType" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "spantype_basetype", + "file": "meos_catalog.h", + "returnType": { + "c": "MeosType", + "canonical": "MeosType" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "spantype_spansettype", + "file": "meos_catalog.h", + "returnType": { + "c": "MeosType", + "canonical": "MeosType" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "spansettype_spantype", + "file": "meos_catalog.h", + "returnType": { + "c": "MeosType", + "canonical": "MeosType" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "basetype_spantype", + "file": "meos_catalog.h", + "returnType": { + "c": "MeosType", + "canonical": "MeosType" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "basetype_settype", + "file": "meos_catalog.h", + "returnType": { + "c": "MeosType", + "canonical": "MeosType" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "tnumber_basetype", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "geo_basetype", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "meos_basetype", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "alphanum_basetype", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "alphanum_temptype", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "time_type", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "set_basetype", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "set_type", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "numset_type", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "ensure_numset_type", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "timeset_type", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "set_spantype", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "ensure_set_spantype", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "alphanumset_type", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "settype", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "geoset_type", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "ensure_geoset_type", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "spatialset_type", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "ensure_spatialset_type", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "span_basetype", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "span_canon_basetype", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "span_type", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "type_span_bbox", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "span_tbox_type", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "ensure_span_tbox_type", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "numspan_basetype", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "numspan_type", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "ensure_numspan_type", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "timespan_basetype", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "timespan_type", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "spanset_type", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "timespanset_type", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "ensure_timespanset_type", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "temporal_type", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "temporal_basetype", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "temptype_supports_linear", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "basetype_byvalue", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "basetype_varlength", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "meostype_length", + "file": "meos_catalog.h", + "returnType": { + "c": "int16", + "canonical": "short" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "talphanum_type", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "talpha_type", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "tnumber_type", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "ensure_tnumber_type", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "ensure_tnumber_basetype", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "tnumber_spantype", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "spatial_basetype", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "tspatial_type", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "ensure_tspatial_type", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "tpoint_type", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "ensure_tpoint_type", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "tgeo_type", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "ensure_tgeo_type", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "tgeo_type_all", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "ensure_tgeo_type_all", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "tgeometry_type", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "ensure_tgeometry_type", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "tgeodetic_type", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "ensure_tgeodetic_type", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "ensure_tnumber_tpoint_type", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "gsl_get_generation_rng", + "file": "meos_internal.h", + "returnType": { + "c": "gsl_rng *", + "canonical": "gsl_rng *" + }, + "params": [] + }, + { + "name": "gsl_get_aggregation_rng", + "file": "meos_internal.h", + "returnType": { + "c": "gsl_rng *", + "canonical": "gsl_rng *" + }, + "params": [] + }, + { + "name": "datum_ceil", + "file": "meos_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "d", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_degrees", + "file": "meos_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "d", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "normalize", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_float_round", + "file": "meos_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "size", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_floor", + "file": "meos_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "d", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_hash", + "file": "meos_internal.h", + "returnType": { + "c": "uint32", + "canonical": "unsigned int" + }, + "params": [ + { + "name": "d", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "basetype", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "datum_hash_extended", + "file": "meos_internal.h", + "returnType": { + "c": "uint64", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "d", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "basetype", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "seed", + "cType": "uint64", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_radians", + "file": "meos_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "d", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "floatspan_round_set", + "file": "meos_internal.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + }, + { + "name": "result", + "cType": "Span *", + "canonical": "struct Span *" + } + ] + }, + { + "name": "set_in", + "file": "meos_internal.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + }, + { + "name": "basetype", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "set_out", + "file": "meos_internal.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "span_in", + "file": "meos_internal.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + }, + { + "name": "spantype", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "span_out", + "file": "meos_internal.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "spanset_in", + "file": "meos_internal.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + }, + { + "name": "spantype", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "spanset_out", + "file": "meos_internal.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "set_make", + "file": "meos_internal.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "values", + "cType": "Datum *", + "canonical": "int ((*)(int *))()" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "basetype", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "order", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "set_make_exp", + "file": "meos_internal.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "values", + "cType": "Datum *", + "canonical": "int ((*)(int *))()" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "maxcount", + "cType": "int", + "canonical": "int" + }, + { + "name": "basetype", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "order", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "set_make_free", + "file": "meos_internal.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "values", + "cType": "Datum *", + "canonical": "int ((*)(int *))()" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "basetype", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "order", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "span_make", + "file": "meos_internal.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "lower", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "upper", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "lower_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "upper_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "basetype", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "span_set", + "file": "meos_internal.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "lower", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "upper", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "lower_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "upper_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "basetype", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "spantype", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "s", + "cType": "Span *", + "canonical": "struct Span *" + } + ] + }, + { + "name": "spanset_make_exp", + "file": "meos_internal.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "spans", + "cType": "Span *", + "canonical": "struct Span *" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "maxcount", + "cType": "int", + "canonical": "int" + }, + { + "name": "normalize", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "order", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "spanset_make_free", + "file": "meos_internal.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "spans", + "cType": "Span *", + "canonical": "struct Span *" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "normalize", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "order", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "set_span", + "file": "meos_internal.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "set_spanset", + "file": "meos_internal.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "value_set_span", + "file": "meos_internal.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "basetype", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "s", + "cType": "Span *", + "canonical": "struct Span *" + } + ] + }, + { + "name": "value_set", + "file": "meos_internal.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "d", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "basetype", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "value_span", + "file": "meos_internal.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "d", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "basetype", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "value_spanset", + "file": "meos_internal.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "d", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "basetype", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "numspan_width", + "file": "meos_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "numspanset_width", + "file": "meos_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "boundspan", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "set_end_value", + "file": "meos_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "set_mem_size", + "file": "meos_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "set_set_subspan", + "file": "meos_internal.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "minidx", + "cType": "int", + "canonical": "int" + }, + { + "name": "maxidx", + "cType": "int", + "canonical": "int" + }, + { + "name": "result", + "cType": "Span *", + "canonical": "struct Span *" + } + ] + }, + { + "name": "set_set_span", + "file": "meos_internal.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "result", + "cType": "Span *", + "canonical": "struct Span *" + } + ] + }, + { + "name": "set_start_value", + "file": "meos_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "set_value_n", + "file": "meos_internal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "n", + "cType": "int", + "canonical": "int" + }, + { + "name": "result", + "cType": "Datum *", + "canonical": "int ((*)(int *))()" + } + ] + }, + { + "name": "set_vals", + "file": "meos_internal.h", + "returnType": { + "c": "Datum *", + "canonical": "int ((*)(int *))()" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "set_values", + "file": "meos_internal.h", + "returnType": { + "c": "Datum *", + "canonical": "int ((*)(int *))()" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "spanset_lower", + "file": "meos_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "spanset_mem_size", + "file": "meos_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "spanset_sps", + "file": "meos_internal.h", + "returnType": { + "c": "const Span **", + "canonical": "const struct Span **" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "spanset_upper", + "file": "meos_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "datespan_set_tstzspan", + "file": "meos_internal.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "s1", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "s2", + "cType": "Span *", + "canonical": "struct Span *" + } + ] + }, + { + "name": "bigintspan_set_floatspan", + "file": "meos_internal.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "s1", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "s2", + "cType": "Span *", + "canonical": "struct Span *" + } + ] + }, + { + "name": "bigintspan_set_intspan", + "file": "meos_internal.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "s1", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "s2", + "cType": "Span *", + "canonical": "struct Span *" + } + ] + }, + { + "name": "floatspan_set_bigintspan", + "file": "meos_internal.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "s1", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "s2", + "cType": "Span *", + "canonical": "struct Span *" + } + ] + }, + { + "name": "floatspan_set_intspan", + "file": "meos_internal.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "s1", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "s2", + "cType": "Span *", + "canonical": "struct Span *" + } + ] + }, + { + "name": "intspan_set_bigintspan", + "file": "meos_internal.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "s1", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "s2", + "cType": "Span *", + "canonical": "struct Span *" + } + ] + }, + { + "name": "intspan_set_floatspan", + "file": "meos_internal.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "s1", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "s2", + "cType": "Span *", + "canonical": "struct Span *" + } + ] + }, + { + "name": "numset_shift_scale", + "file": "meos_internal.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "shift", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "width", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "hasshift", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "haswidth", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "numspan_expand", + "file": "meos_internal.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "numspan_shift_scale", + "file": "meos_internal.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "shift", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "width", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "hasshift", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "haswidth", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "numspanset_shift_scale", + "file": "meos_internal.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "shift", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "width", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "hasshift", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "haswidth", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "set_compact", + "file": "meos_internal.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "span_expand", + "file": "meos_internal.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "s1", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "s2", + "cType": "Span *", + "canonical": "struct Span *" + } + ] + }, + { + "name": "spanset_compact", + "file": "meos_internal.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "tbox_expand_value", + "file": "meos_internal.h", + "returnType": { + "c": "TBox *", + "canonical": "struct TBox *" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const struct TBox *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "basetyp", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "textcat_textset_text_common", + "file": "meos_internal.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "txt", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "invert", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tstzspan_set_datespan", + "file": "meos_internal.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "s1", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "s2", + "cType": "Span *", + "canonical": "struct Span *" + } + ] + }, + { + "name": "adjacent_span_value", + "file": "meos_internal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "adjacent_spanset_value", + "file": "meos_internal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "adjacent_value_spanset", + "file": "meos_internal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "contained_value_set", + "file": "meos_internal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "contained_value_span", + "file": "meos_internal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "contained_value_spanset", + "file": "meos_internal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "contains_set_value", + "file": "meos_internal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "contains_span_value", + "file": "meos_internal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "contains_spanset_value", + "file": "meos_internal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "ovadj_span_span", + "file": "meos_internal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s1", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "s2", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "left_set_value", + "file": "meos_internal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "left_span_value", + "file": "meos_internal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "left_spanset_value", + "file": "meos_internal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "left_value_set", + "file": "meos_internal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "left_value_span", + "file": "meos_internal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "left_value_spanset", + "file": "meos_internal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "lfnadj_span_span", + "file": "meos_internal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s1", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "s2", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "overleft_set_value", + "file": "meos_internal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "overleft_span_value", + "file": "meos_internal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "overleft_spanset_value", + "file": "meos_internal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "overleft_value_set", + "file": "meos_internal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "overleft_value_span", + "file": "meos_internal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "overleft_value_spanset", + "file": "meos_internal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "overright_set_value", + "file": "meos_internal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "overright_span_value", + "file": "meos_internal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "overright_spanset_value", + "file": "meos_internal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "overright_value_set", + "file": "meos_internal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "overright_value_span", + "file": "meos_internal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "overright_value_spanset", + "file": "meos_internal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "right_value_set", + "file": "meos_internal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "right_set_value", + "file": "meos_internal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "right_value_span", + "file": "meos_internal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "right_value_spanset", + "file": "meos_internal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "right_span_value", + "file": "meos_internal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "right_spanset_value", + "file": "meos_internal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "bbox_type", + "file": "meos_internal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "bboxtype", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "bbox_get_size", + "file": "meos_internal.h", + "returnType": { + "c": "size_t", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "bboxtype", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "bbox_max_dims", + "file": "meos_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "bboxtype", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "temporal_bbox_eq", + "file": "meos_internal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const void *", + "canonical": "const void *" + }, + { + "name": "box2", + "cType": "const void *", + "canonical": "const void *" + }, + { + "name": "temptype", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "temporal_bbox_cmp", + "file": "meos_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "box1", + "cType": "const void *", + "canonical": "const void *" + }, + { + "name": "box2", + "cType": "const void *", + "canonical": "const void *" + }, + { + "name": "temptype", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "bbox_union_span_span", + "file": "meos_internal.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "s1", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "s2", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "result", + "cType": "Span *", + "canonical": "struct Span *" + } + ] + }, + { + "name": "inter_span_span", + "file": "meos_internal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s1", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "s2", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "result", + "cType": "Span *", + "canonical": "struct Span *" + } + ] + }, + { + "name": "intersection_set_value", + "file": "meos_internal.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "intersection_span_value", + "file": "meos_internal.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "intersection_spanset_value", + "file": "meos_internal.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "intersection_value_set", + "file": "meos_internal.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "intersection_value_span", + "file": "meos_internal.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "intersection_value_spanset", + "file": "meos_internal.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "mi_span_span", + "file": "meos_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "s1", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "s2", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "result", + "cType": "Span *", + "canonical": "struct Span *" + } + ] + }, + { + "name": "minus_set_value", + "file": "meos_internal.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "minus_span_value", + "file": "meos_internal.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "minus_spanset_value", + "file": "meos_internal.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "minus_value_set", + "file": "meos_internal.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "minus_value_span", + "file": "meos_internal.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "minus_value_spanset", + "file": "meos_internal.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "union_set_value", + "file": "meos_internal.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "union_span_value", + "file": "meos_internal.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "union_spanset_value", + "file": "meos_internal.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "union_value_set", + "file": "meos_internal.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "union_value_span", + "file": "meos_internal.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "union_value_spanset", + "file": "meos_internal.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "distance_set_set", + "file": "meos_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "s1", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "s2", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "distance_set_value", + "file": "meos_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "distance_span_span", + "file": "meos_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "s1", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "s2", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "distance_span_value", + "file": "meos_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "distance_spanset_span", + "file": "meos_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "distance_spanset_spanset", + "file": "meos_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "ss1", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "ss2", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "distance_spanset_value", + "file": "meos_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "distance_value_value", + "file": "meos_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "l", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "r", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "basetype", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "spanbase_extent_transfn", + "file": "meos_internal.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "state", + "cType": "Span *", + "canonical": "struct Span *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "basetype", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "value_union_transfn", + "file": "meos_internal.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "state", + "cType": "Set *", + "canonical": "Set *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "basetype", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "number_tstzspan_to_tbox", + "file": "meos_internal.h", + "returnType": { + "c": "TBox *", + "canonical": "struct TBox *" + }, + "params": [ + { + "name": "d", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "basetype", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "number_timestamptz_to_tbox", + "file": "meos_internal.h", + "returnType": { + "c": "TBox *", + "canonical": "struct TBox *" + }, + "params": [ + { + "name": "d", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "basetype", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "tbox_set", + "file": "meos_internal.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "p", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "box", + "cType": "TBox *", + "canonical": "struct TBox *" + } + ] + }, + { + "name": "float_set_tbox", + "file": "meos_internal.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + }, + { + "name": "box", + "cType": "TBox *", + "canonical": "struct TBox *" + } + ] + }, + { + "name": "int_set_tbox", + "file": "meos_internal.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + }, + { + "name": "box", + "cType": "TBox *", + "canonical": "struct TBox *" + } + ] + }, + { + "name": "number_set_tbox", + "file": "meos_internal.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "d", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "basetype", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "box", + "cType": "TBox *", + "canonical": "struct TBox *" + } + ] + }, + { + "name": "number_tbox", + "file": "meos_internal.h", + "returnType": { + "c": "TBox *", + "canonical": "struct TBox *" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "basetype", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "numset_set_tbox", + "file": "meos_internal.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "box", + "cType": "TBox *", + "canonical": "struct TBox *" + } + ] + }, + { + "name": "numspan_set_tbox", + "file": "meos_internal.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "span", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "box", + "cType": "TBox *", + "canonical": "struct TBox *" + } + ] + }, + { + "name": "timestamptz_set_tbox", + "file": "meos_internal.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "box", + "cType": "TBox *", + "canonical": "struct TBox *" + } + ] + }, + { + "name": "tstzset_set_tbox", + "file": "meos_internal.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "box", + "cType": "TBox *", + "canonical": "struct TBox *" + } + ] + }, + { + "name": "tstzspan_set_tbox", + "file": "meos_internal.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "box", + "cType": "TBox *", + "canonical": "struct TBox *" + } + ] + }, + { + "name": "tbox_shift_scale_value", + "file": "meos_internal.h", + "returnType": { + "c": "TBox *", + "canonical": "struct TBox *" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const struct TBox *" + }, + { + "name": "shift", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "width", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "hasshift", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "haswidth", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tbox_expand", + "file": "meos_internal.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "box1", + "cType": "const TBox *", + "canonical": "const struct TBox *" + }, + { + "name": "box2", + "cType": "TBox *", + "canonical": "struct TBox *" + } + ] + }, + { + "name": "inter_tbox_tbox", + "file": "meos_internal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const TBox *", + "canonical": "const struct TBox *" + }, + { + "name": "box2", + "cType": "const TBox *", + "canonical": "const struct TBox *" + }, + { + "name": "result", + "cType": "TBox *", + "canonical": "struct TBox *" + } + ] + }, + { + "name": "tboolinst_from_mfjson", + "file": "meos_internal.h", + "returnType": { + "c": "TInstant *", + "canonical": "struct TInstant *" + }, + "params": [ + { + "name": "mfjson", + "cType": "json_object *", + "canonical": "struct json_object *" + } + ] + }, + { + "name": "tboolinst_in", + "file": "meos_internal.h", + "returnType": { + "c": "TInstant *", + "canonical": "struct TInstant *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "tboolseq_from_mfjson", + "file": "meos_internal.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "mfjson", + "cType": "json_object *", + "canonical": "struct json_object *" + } + ] + }, + { + "name": "tboolseq_in", + "file": "meos_internal.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "tboolseqset_from_mfjson", + "file": "meos_internal.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "mfjson", + "cType": "json_object *", + "canonical": "struct json_object *" + } + ] + }, + { + "name": "tboolseqset_in", + "file": "meos_internal.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "temporal_in", + "file": "meos_internal.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + }, + { + "name": "temptype", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "temporal_out", + "file": "meos_internal.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "temparr_out", + "file": "meos_internal.h", + "returnType": { + "c": "char **", + "canonical": "char **" + }, + "params": [ + { + "name": "temparr", + "cType": "Temporal **", + "canonical": "Temporal **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "tfloatinst_from_mfjson", + "file": "meos_internal.h", + "returnType": { + "c": "TInstant *", + "canonical": "struct TInstant *" + }, + "params": [ + { + "name": "mfjson", + "cType": "json_object *", + "canonical": "struct json_object *" + } + ] + }, + { + "name": "tfloatinst_in", + "file": "meos_internal.h", + "returnType": { + "c": "TInstant *", + "canonical": "struct TInstant *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "tfloatseq_from_mfjson", + "file": "meos_internal.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "mfjson", + "cType": "json_object *", + "canonical": "struct json_object *" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "tfloatseq_in", + "file": "meos_internal.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "tfloatseqset_from_mfjson", + "file": "meos_internal.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "mfjson", + "cType": "json_object *", + "canonical": "struct json_object *" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "tfloatseqset_in", + "file": "meos_internal.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "tinstant_from_mfjson", + "file": "meos_internal.h", + "returnType": { + "c": "TInstant *", + "canonical": "struct TInstant *" + }, + "params": [ + { + "name": "mfjson", + "cType": "json_object *", + "canonical": "struct json_object *" + }, + { + "name": "spatial", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + }, + { + "name": "temptype", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "tinstant_in", + "file": "meos_internal.h", + "returnType": { + "c": "TInstant *", + "canonical": "struct TInstant *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + }, + { + "name": "temptype", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "tinstant_out", + "file": "meos_internal.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const struct TInstant *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "tbigintinst_from_mfjson", + "file": "meos_internal.h", + "returnType": { + "c": "TInstant *", + "canonical": "struct TInstant *" + }, + "params": [ + { + "name": "mfjson", + "cType": "json_object *", + "canonical": "struct json_object *" + } + ] + }, + { + "name": "tbigintinst_in", + "file": "meos_internal.h", + "returnType": { + "c": "TInstant *", + "canonical": "struct TInstant *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "tbigintseq_from_mfjson", + "file": "meos_internal.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "mfjson", + "cType": "json_object *", + "canonical": "struct json_object *" + } + ] + }, + { + "name": "tbigintseqset_from_mfjson", + "file": "meos_internal.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "mfjson", + "cType": "json_object *", + "canonical": "struct json_object *" + } + ] + }, + { + "name": "tbigintseqset_in", + "file": "meos_internal.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "tintinst_from_mfjson", + "file": "meos_internal.h", + "returnType": { + "c": "TInstant *", + "canonical": "struct TInstant *" + }, + "params": [ + { + "name": "mfjson", + "cType": "json_object *", + "canonical": "struct json_object *" + } + ] + }, + { + "name": "tintinst_in", + "file": "meos_internal.h", + "returnType": { + "c": "TInstant *", + "canonical": "struct TInstant *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "tintseq_from_mfjson", + "file": "meos_internal.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "mfjson", + "cType": "json_object *", + "canonical": "struct json_object *" + } + ] + }, + { + "name": "tintseq_in", + "file": "meos_internal.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "tintseqset_from_mfjson", + "file": "meos_internal.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "mfjson", + "cType": "json_object *", + "canonical": "struct json_object *" + } + ] + }, + { + "name": "tintseqset_in", + "file": "meos_internal.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "tsequence_from_mfjson", + "file": "meos_internal.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "mfjson", + "cType": "json_object *", + "canonical": "struct json_object *" + }, + { + "name": "spatial", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + }, + { + "name": "temptype", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "tsequence_in", + "file": "meos_internal.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + }, + { + "name": "temptype", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "tsequence_out", + "file": "meos_internal.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "tsequenceset_from_mfjson", + "file": "meos_internal.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "mfjson", + "cType": "json_object *", + "canonical": "struct json_object *" + }, + { + "name": "spatial", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + }, + { + "name": "temptype", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "tsequenceset_in", + "file": "meos_internal.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + }, + { + "name": "temptype", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "tsequenceset_out", + "file": "meos_internal.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const struct TSequenceSet *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "ttextinst_from_mfjson", + "file": "meos_internal.h", + "returnType": { + "c": "TInstant *", + "canonical": "struct TInstant *" + }, + "params": [ + { + "name": "mfjson", + "cType": "json_object *", + "canonical": "struct json_object *" + } + ] + }, + { + "name": "ttextinst_in", + "file": "meos_internal.h", + "returnType": { + "c": "TInstant *", + "canonical": "struct TInstant *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "ttextseq_from_mfjson", + "file": "meos_internal.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "mfjson", + "cType": "json_object *", + "canonical": "struct json_object *" + } + ] + }, + { + "name": "ttextseq_in", + "file": "meos_internal.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "ttextseqset_from_mfjson", + "file": "meos_internal.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "mfjson", + "cType": "json_object *", + "canonical": "struct json_object *" + } + ] + }, + { + "name": "ttextseqset_in", + "file": "meos_internal.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "temporal_from_mfjson", + "file": "meos_internal.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "mfjson", + "cType": "const char *", + "canonical": "const char *" + }, + { + "name": "temptype", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "temporal_from_base_temp", + "file": "meos_internal.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "temptype", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tinstant_copy", + "file": "meos_internal.h", + "returnType": { + "c": "TInstant *", + "canonical": "struct TInstant *" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const struct TInstant *" + } + ] + }, + { + "name": "tinstant_make", + "file": "meos_internal.h", + "returnType": { + "c": "TInstant *", + "canonical": "struct TInstant *" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "temptype", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "tinstant_make_free", + "file": "meos_internal.h", + "returnType": { + "c": "TInstant *", + "canonical": "struct TInstant *" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "temptype", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "tsequence_copy", + "file": "meos_internal.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + } + ] + }, + { + "name": "tsequence_from_base_temp", + "file": "meos_internal.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "temptype", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + } + ] + }, + { + "name": "tsequence_from_base_tstzset", + "file": "meos_internal.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "temptype", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "tsequence_from_base_tstzspan", + "file": "meos_internal.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "temptype", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "tsequence_make_exp", + "file": "meos_internal.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "instants", + "cType": "TInstant **", + "canonical": "struct TInstant **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "maxcount", + "cType": "int", + "canonical": "int" + }, + { + "name": "lower_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "upper_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + }, + { + "name": "normalize", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tsequence_make_free", + "file": "meos_internal.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "instants", + "cType": "TInstant **", + "canonical": "struct TInstant **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "lower_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "upper_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + }, + { + "name": "normalize", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tsequenceset_copy", + "file": "meos_internal.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const struct TSequenceSet *" + } + ] + }, + { + "name": "tseqsetarr_to_tseqset", + "file": "meos_internal.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "seqsets", + "cType": "TSequenceSet **", + "canonical": "struct TSequenceSet **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "totalseqs", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "tsequenceset_from_base_temp", + "file": "meos_internal.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "temptype", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const struct TSequenceSet *" + } + ] + }, + { + "name": "tsequenceset_from_base_tstzspanset", + "file": "meos_internal.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "temptype", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "tsequenceset_make_exp", + "file": "meos_internal.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "sequences", + "cType": "TSequence **", + "canonical": "struct TSequence **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "maxcount", + "cType": "int", + "canonical": "int" + }, + { + "name": "normalize", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tsequenceset_make_free", + "file": "meos_internal.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "sequences", + "cType": "TSequence **", + "canonical": "struct TSequence **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "normalize", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "temporal_set_tstzspan", + "file": "meos_internal.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "s", + "cType": "Span *", + "canonical": "struct Span *" + } + ] + }, + { + "name": "tinstant_set_tstzspan", + "file": "meos_internal.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const struct TInstant *" + }, + { + "name": "s", + "cType": "Span *", + "canonical": "struct Span *" + } + ] + }, + { + "name": "tnumber_set_tbox", + "file": "meos_internal.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "TBox *", + "canonical": "struct TBox *" + } + ] + }, + { + "name": "tnumberinst_set_tbox", + "file": "meos_internal.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const struct TInstant *" + }, + { + "name": "box", + "cType": "TBox *", + "canonical": "struct TBox *" + } + ] + }, + { + "name": "tnumberseq_set_tbox", + "file": "meos_internal.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "box", + "cType": "TBox *", + "canonical": "struct TBox *" + } + ] + }, + { + "name": "tnumberseqset_set_tbox", + "file": "meos_internal.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const struct TSequenceSet *" + }, + { + "name": "box", + "cType": "TBox *", + "canonical": "struct TBox *" + } + ] + }, + { + "name": "tsequence_set_tstzspan", + "file": "meos_internal.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "s", + "cType": "Span *", + "canonical": "struct Span *" + } + ] + }, + { + "name": "tsequenceset_set_tstzspan", + "file": "meos_internal.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const struct TSequenceSet *" + }, + { + "name": "s", + "cType": "Span *", + "canonical": "struct Span *" + } + ] + }, + { + "name": "temporal_end_inst", + "file": "meos_internal.h", + "returnType": { + "c": "const TInstant *", + "canonical": "const struct TInstant *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "temporal_end_value", + "file": "meos_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "temporal_inst_n", + "file": "meos_internal.h", + "returnType": { + "c": "const TInstant *", + "canonical": "const struct TInstant *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "n", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "temporal_insts_p", + "file": "meos_internal.h", + "returnType": { + "c": "const TInstant **", + "canonical": "const struct TInstant **" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "temporal_max_inst_p", + "file": "meos_internal.h", + "returnType": { + "c": "const TInstant *", + "canonical": "const struct TInstant *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "temporal_max_value", + "file": "meos_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "temporal_mem_size", + "file": "meos_internal.h", + "returnType": { + "c": "size_t", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "temporal_min_inst_p", + "file": "meos_internal.h", + "returnType": { + "c": "const TInstant *", + "canonical": "const struct TInstant *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "temporal_min_value", + "file": "meos_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "temporal_sequences_p", + "file": "meos_internal.h", + "returnType": { + "c": "const TSequence **", + "canonical": "const struct TSequence **" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "temporal_set_bbox", + "file": "meos_internal.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "void *", + "canonical": "void *" + } + ] + }, + { + "name": "temporal_start_inst", + "file": "meos_internal.h", + "returnType": { + "c": "const TInstant *", + "canonical": "const struct TInstant *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "temporal_start_value", + "file": "meos_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "temporal_values_p", + "file": "meos_internal.h", + "returnType": { + "c": "Datum *", + "canonical": "int ((*)(int *))()" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "temporal_value_n", + "file": "meos_internal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "n", + "cType": "int", + "canonical": "int" + }, + { + "name": "result", + "cType": "Datum *", + "canonical": "int ((*)(int *))()" + } + ] + }, + { + "name": "temporal_values", + "file": "meos_internal.h", + "returnType": { + "c": "Datum *", + "canonical": "int ((*)(int *))()" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tinstant_hash", + "file": "meos_internal.h", + "returnType": { + "c": "uint32", + "canonical": "unsigned int" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const struct TInstant *" + } + ] + }, + { + "name": "tinstant_insts", + "file": "meos_internal.h", + "returnType": { + "c": "const TInstant **", + "canonical": "const struct TInstant **" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const struct TInstant *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tinstant_set_bbox", + "file": "meos_internal.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const struct TInstant *" + }, + { + "name": "box", + "cType": "void *", + "canonical": "void *" + } + ] + }, + { + "name": "tinstant_time", + "file": "meos_internal.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const struct TInstant *" + } + ] + }, + { + "name": "tinstant_timestamps", + "file": "meos_internal.h", + "returnType": { + "c": "TimestampTz *", + "canonical": "long *" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const struct TInstant *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tinstant_value_p", + "file": "meos_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const struct TInstant *" + } + ] + }, + { + "name": "tinstant_value", + "file": "meos_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const struct TInstant *" + } + ] + }, + { + "name": "tinstant_value_at_timestamptz", + "file": "meos_internal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const struct TInstant *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "result", + "cType": "Datum *", + "canonical": "int ((*)(int *))()" + } + ] + }, + { + "name": "tinstant_values_p", + "file": "meos_internal.h", + "returnType": { + "c": "Datum *", + "canonical": "int ((*)(int *))()" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const struct TInstant *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tnumber_set_span", + "file": "meos_internal.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "span", + "cType": "Span *", + "canonical": "struct Span *" + } + ] + }, + { + "name": "tnumberinst_valuespans", + "file": "meos_internal.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const struct TInstant *" + } + ] + }, + { + "name": "tnumberseq_avg_val", + "file": "meos_internal.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + } + ] + }, + { + "name": "tnumberseq_valuespans", + "file": "meos_internal.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + } + ] + }, + { + "name": "tnumberseqset_avg_val", + "file": "meos_internal.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const struct TSequenceSet *" + } + ] + }, + { + "name": "tnumberseqset_valuespans", + "file": "meos_internal.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const struct TSequenceSet *" + } + ] + }, + { + "name": "tsequence_duration", + "file": "meos_internal.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + } + ] + }, + { + "name": "tsequence_end_timestamptz", + "file": "meos_internal.h", + "returnType": { + "c": "TimestampTz", + "canonical": "long" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + } + ] + }, + { + "name": "tsequence_hash", + "file": "meos_internal.h", + "returnType": { + "c": "uint32", + "canonical": "unsigned int" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + } + ] + }, + { + "name": "tsequence_insts_p", + "file": "meos_internal.h", + "returnType": { + "c": "const TInstant **", + "canonical": "const struct TInstant **" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tsequence_max_inst_p", + "file": "meos_internal.h", + "returnType": { + "c": "const TInstant *", + "canonical": "const struct TInstant *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + } + ] + }, + { + "name": "tsequence_max_val", + "file": "meos_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + } + ] + }, + { + "name": "tsequence_min_inst_p", + "file": "meos_internal.h", + "returnType": { + "c": "const TInstant *", + "canonical": "const struct TInstant *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + } + ] + }, + { + "name": "tsequence_min_val", + "file": "meos_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + } + ] + }, + { + "name": "tsequence_segments", + "file": "meos_internal.h", + "returnType": { + "c": "TSequence **", + "canonical": "struct TSequence **" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tsequence_seqs", + "file": "meos_internal.h", + "returnType": { + "c": "const TSequence **", + "canonical": "const struct TSequence **" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tsequence_start_timestamptz", + "file": "meos_internal.h", + "returnType": { + "c": "TimestampTz", + "canonical": "long" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + } + ] + }, + { + "name": "tsequence_time", + "file": "meos_internal.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + } + ] + }, + { + "name": "tsequence_timestamps", + "file": "meos_internal.h", + "returnType": { + "c": "TimestampTz *", + "canonical": "long *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tsequence_value_at_timestamptz", + "file": "meos_internal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "strict", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "result", + "cType": "Datum *", + "canonical": "int ((*)(int *))()" + } + ] + }, + { + "name": "tsequence_values_p", + "file": "meos_internal.h", + "returnType": { + "c": "Datum *", + "canonical": "int ((*)(int *))()" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tsequenceset_duration", + "file": "meos_internal.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const struct TSequenceSet *" + }, + { + "name": "boundspan", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tsequenceset_end_timestamptz", + "file": "meos_internal.h", + "returnType": { + "c": "TimestampTz", + "canonical": "long" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const struct TSequenceSet *" + } + ] + }, + { + "name": "tsequenceset_hash", + "file": "meos_internal.h", + "returnType": { + "c": "uint32", + "canonical": "unsigned int" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const struct TSequenceSet *" + } + ] + }, + { + "name": "tsequenceset_inst_n", + "file": "meos_internal.h", + "returnType": { + "c": "const TInstant *", + "canonical": "const struct TInstant *" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const struct TSequenceSet *" + }, + { + "name": "n", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "tsequenceset_insts_p", + "file": "meos_internal.h", + "returnType": { + "c": "const TInstant **", + "canonical": "const struct TInstant **" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const struct TSequenceSet *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tsequenceset_max_inst_p", + "file": "meos_internal.h", + "returnType": { + "c": "const TInstant *", + "canonical": "const struct TInstant *" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const struct TSequenceSet *" + } + ] + }, + { + "name": "tsequenceset_max_val", + "file": "meos_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const struct TSequenceSet *" + } + ] + }, + { + "name": "tsequenceset_min_inst_p", + "file": "meos_internal.h", + "returnType": { + "c": "const TInstant *", + "canonical": "const struct TInstant *" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const struct TSequenceSet *" + } + ] + }, + { + "name": "tsequenceset_min_val", + "file": "meos_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const struct TSequenceSet *" + } + ] + }, + { + "name": "tsequenceset_num_instants", + "file": "meos_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const struct TSequenceSet *" + } + ] + }, + { + "name": "tsequenceset_num_timestamps", + "file": "meos_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const struct TSequenceSet *" + } + ] + }, + { + "name": "tsequenceset_segments", + "file": "meos_internal.h", + "returnType": { + "c": "TSequence **", + "canonical": "struct TSequence **" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const struct TSequenceSet *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tsequenceset_sequences_p", + "file": "meos_internal.h", + "returnType": { + "c": "const TSequence **", + "canonical": "const struct TSequence **" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const struct TSequenceSet *" + } + ] + }, + { + "name": "tsequenceset_start_timestamptz", + "file": "meos_internal.h", + "returnType": { + "c": "TimestampTz", + "canonical": "long" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const struct TSequenceSet *" + } + ] + }, + { + "name": "tsequenceset_time", + "file": "meos_internal.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const struct TSequenceSet *" + } + ] + }, + { + "name": "tsequenceset_timestamptz_n", + "file": "meos_internal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const struct TSequenceSet *" + }, + { + "name": "n", + "cType": "int", + "canonical": "int" + }, + { + "name": "result", + "cType": "TimestampTz *", + "canonical": "long *" + } + ] + }, + { + "name": "tsequenceset_timestamps", + "file": "meos_internal.h", + "returnType": { + "c": "TimestampTz *", + "canonical": "long *" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const struct TSequenceSet *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tsequenceset_value_at_timestamptz", + "file": "meos_internal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const struct TSequenceSet *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "strict", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "result", + "cType": "Datum *", + "canonical": "int ((*)(int *))()" + } + ] + }, + { + "name": "tsequenceset_value_n", + "file": "meos_internal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const struct TSequenceSet *" + }, + { + "name": "n", + "cType": "int", + "canonical": "int" + }, + { + "name": "result", + "cType": "Datum *", + "canonical": "int ((*)(int *))()" + } + ] + }, + { + "name": "tsequenceset_value_n_p", + "file": "meos_internal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const struct TSequenceSet *" + }, + { + "name": "n", + "cType": "int", + "canonical": "int" + }, + { + "name": "result", + "cType": "Datum *", + "canonical": "int ((*)(int *))()" + } + ] + }, + { + "name": "tsequenceset_values_p", + "file": "meos_internal.h", + "returnType": { + "c": "Datum *", + "canonical": "int ((*)(int *))()" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const struct TSequenceSet *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "temporal_restart", + "file": "meos_internal.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "temp", + "cType": "Temporal *", + "canonical": "Temporal *" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "temporal_tsequence", + "file": "meos_internal.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "temporal_tsequenceset", + "file": "meos_internal.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "tinstant_shift_time", + "file": "meos_internal.h", + "returnType": { + "c": "TInstant *", + "canonical": "struct TInstant *" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const struct TInstant *" + }, + { + "name": "interv", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "tinstant_to_tsequence", + "file": "meos_internal.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const struct TInstant *" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "tinstant_to_tsequence_free", + "file": "meos_internal.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "inst", + "cType": "TInstant *", + "canonical": "struct TInstant *" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "tinstant_to_tsequenceset", + "file": "meos_internal.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const struct TInstant *" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "tnumber_shift_scale_value", + "file": "meos_internal.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "shift", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "width", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "hasshift", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "haswidth", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tnumberinst_shift_value", + "file": "meos_internal.h", + "returnType": { + "c": "TInstant *", + "canonical": "struct TInstant *" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const struct TInstant *" + }, + { + "name": "shift", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "tnumberseq_shift_scale_value", + "file": "meos_internal.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "shift", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "width", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "hasshift", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "haswidth", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tnumberseqset_shift_scale_value", + "file": "meos_internal.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const struct TSequenceSet *" + }, + { + "name": "start", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "width", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "hasshift", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "haswidth", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tsequence_restart", + "file": "meos_internal.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "seq", + "cType": "TSequence *", + "canonical": "struct TSequence *" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "tsequence_set_interp", + "file": "meos_internal.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "tsequence_shift_scale_time", + "file": "meos_internal.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "shift", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "duration", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "tsequence_subseq", + "file": "meos_internal.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "from", + "cType": "int", + "canonical": "int" + }, + { + "name": "to", + "cType": "int", + "canonical": "int" + }, + { + "name": "lower_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "upper_inc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tsequence_to_tinstant", + "file": "meos_internal.h", + "returnType": { + "c": "TInstant *", + "canonical": "struct TInstant *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + } + ] + }, + { + "name": "tsequence_to_tsequenceset", + "file": "meos_internal.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + } + ] + }, + { + "name": "tsequence_to_tsequenceset_free", + "file": "meos_internal.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "seq", + "cType": "TSequence *", + "canonical": "struct TSequence *" + } + ] + }, + { + "name": "tsequence_to_tsequenceset_interp", + "file": "meos_internal.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "tsequenceset_restart", + "file": "meos_internal.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "ss", + "cType": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "tsequenceset_set_interp", + "file": "meos_internal.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const struct TSequenceSet *" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "tsequenceset_shift_scale_time", + "file": "meos_internal.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const struct TSequenceSet *" + }, + { + "name": "start", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "duration", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "tsequenceset_to_discrete", + "file": "meos_internal.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const struct TSequenceSet *" + } + ] + }, + { + "name": "tsequenceset_to_linear", + "file": "meos_internal.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const struct TSequenceSet *" + } + ] + }, + { + "name": "tsequenceset_to_step", + "file": "meos_internal.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const struct TSequenceSet *" + } + ] + }, + { + "name": "tsequenceset_to_tinstant", + "file": "meos_internal.h", + "returnType": { + "c": "TInstant *", + "canonical": "struct TInstant *" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const struct TSequenceSet *" + } + ] + }, + { + "name": "tsequenceset_to_tsequence", + "file": "meos_internal.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const struct TSequenceSet *" + } + ] + }, + { + "name": "tinstant_merge", + "file": "meos_internal.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "inst1", + "cType": "const TInstant *", + "canonical": "const struct TInstant *" + }, + { + "name": "inst2", + "cType": "const TInstant *", + "canonical": "const struct TInstant *" + } + ] + }, + { + "name": "tinstant_merge_array", + "file": "meos_internal.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "instants", + "cType": "TInstant **", + "canonical": "struct TInstant **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "tsequence_append_tinstant", + "file": "meos_internal.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "seq", + "cType": "TSequence *", + "canonical": "struct TSequence *" + }, + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const struct TInstant *" + }, + { + "name": "maxdist", + "cType": "double", + "canonical": "double" + }, + { + "name": "maxt", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "expand", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tsequence_append_tsequence", + "file": "meos_internal.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "seq1", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "seq2", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "expand", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tsequence_delete_timestamptz", + "file": "meos_internal.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "connect", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tsequence_delete_tstzset", + "file": "meos_internal.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "connect", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tsequence_delete_tstzspan", + "file": "meos_internal.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "connect", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tsequence_delete_tstzspanset", + "file": "meos_internal.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "connect", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tsequence_insert", + "file": "meos_internal.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "seq1", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "seq2", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "connect", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tsequence_merge", + "file": "meos_internal.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "seq1", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "seq2", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + } + ] + }, + { + "name": "tsequence_merge_array", + "file": "meos_internal.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "sequences", + "cType": "TSequence **", + "canonical": "struct TSequence **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "tsequenceset_append_tinstant", + "file": "meos_internal.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "ss", + "cType": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const struct TInstant *" + }, + { + "name": "maxdist", + "cType": "double", + "canonical": "double" + }, + { + "name": "maxt", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "expand", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tsequenceset_append_tsequence", + "file": "meos_internal.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "ss", + "cType": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "expand", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tsequenceset_delete_timestamptz", + "file": "meos_internal.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const struct TSequenceSet *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "tsequenceset_delete_tstzset", + "file": "meos_internal.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const struct TSequenceSet *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "tsequenceset_delete_tstzspan", + "file": "meos_internal.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const struct TSequenceSet *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "tsequenceset_delete_tstzspanset", + "file": "meos_internal.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const struct TSequenceSet *" + }, + { + "name": "ps", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "tsequenceset_insert", + "file": "meos_internal.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "ss1", + "cType": "const TSequenceSet *", + "canonical": "const struct TSequenceSet *" + }, + { + "name": "ss2", + "cType": "const TSequenceSet *", + "canonical": "const struct TSequenceSet *" + } + ] + }, + { + "name": "tsequenceset_merge", + "file": "meos_internal.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "ss1", + "cType": "const TSequenceSet *", + "canonical": "const struct TSequenceSet *" + }, + { + "name": "ss2", + "cType": "const TSequenceSet *", + "canonical": "const struct TSequenceSet *" + } + ] + }, + { + "name": "tsequenceset_merge_array", + "file": "meos_internal.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "seqsets", + "cType": "TSequenceSet **", + "canonical": "struct TSequenceSet **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "tsequence_expand_bbox", + "file": "meos_internal.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "seq", + "cType": "TSequence *", + "canonical": "struct TSequence *" + }, + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const struct TInstant *" + } + ] + }, + { + "name": "tsequence_set_bbox", + "file": "meos_internal.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "box", + "cType": "void *", + "canonical": "void *" + } + ] + }, + { + "name": "tsequenceset_expand_bbox", + "file": "meos_internal.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "ss", + "cType": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + } + ] + }, + { + "name": "tsequenceset_set_bbox", + "file": "meos_internal.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const struct TSequenceSet *" + }, + { + "name": "box", + "cType": "void *", + "canonical": "void *" + } + ] + }, + { + "name": "tcontseq_after_timestamptz", + "file": "meos_internal.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "strict", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tcontseq_before_timestamptz", + "file": "meos_internal.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "strict", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tcontseq_restrict_minmax", + "file": "meos_internal.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "min", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tdiscseq_after_timestamptz", + "file": "meos_internal.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "strict", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tdiscseq_before_timestamptz", + "file": "meos_internal.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "strict", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tdiscseq_restrict_minmax", + "file": "meos_internal.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "min", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "temporal_bbox_restrict_set", + "file": "meos_internal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "set", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "temporal_restrict_minmax", + "file": "meos_internal.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "min", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "temporal_restrict_timestamptz", + "file": "meos_internal.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "temporal_restrict_tstzset", + "file": "meos_internal.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "temporal_restrict_tstzspan", + "file": "meos_internal.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "temporal_restrict_tstzspanset", + "file": "meos_internal.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "temporal_restrict_value", + "file": "meos_internal.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "temporal_restrict_values", + "file": "meos_internal.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "set", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "temporal_value_at_timestamptz", + "file": "meos_internal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "strict", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "result", + "cType": "Datum *", + "canonical": "int ((*)(int *))()" + } + ] + }, + { + "name": "tinstant_after_timestamptz", + "file": "meos_internal.h", + "returnType": { + "c": "TInstant *", + "canonical": "struct TInstant *" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const struct TInstant *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "strict", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tinstant_before_timestamptz", + "file": "meos_internal.h", + "returnType": { + "c": "TInstant *", + "canonical": "struct TInstant *" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const struct TInstant *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "strict", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tinstant_restrict_tstzspan", + "file": "meos_internal.h", + "returnType": { + "c": "TInstant *", + "canonical": "struct TInstant *" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const struct TInstant *" + }, + { + "name": "period", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tinstant_restrict_tstzspanset", + "file": "meos_internal.h", + "returnType": { + "c": "TInstant *", + "canonical": "struct TInstant *" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const struct TInstant *" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tinstant_restrict_timestamptz", + "file": "meos_internal.h", + "returnType": { + "c": "TInstant *", + "canonical": "struct TInstant *" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const struct TInstant *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tinstant_restrict_tstzset", + "file": "meos_internal.h", + "returnType": { + "c": "TInstant *", + "canonical": "struct TInstant *" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const struct TInstant *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tinstant_restrict_value", + "file": "meos_internal.h", + "returnType": { + "c": "TInstant *", + "canonical": "struct TInstant *" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const struct TInstant *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tinstant_restrict_values", + "file": "meos_internal.h", + "returnType": { + "c": "TInstant *", + "canonical": "struct TInstant *" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const struct TInstant *" + }, + { + "name": "set", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tnumber_restrict_span", + "file": "meos_internal.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "span", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tnumber_restrict_spanset", + "file": "meos_internal.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tnumberinst_restrict_span", + "file": "meos_internal.h", + "returnType": { + "c": "TInstant *", + "canonical": "struct TInstant *" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const struct TInstant *" + }, + { + "name": "span", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tnumberinst_restrict_spanset", + "file": "meos_internal.h", + "returnType": { + "c": "TInstant *", + "canonical": "struct TInstant *" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const struct TInstant *" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tnumberseqset_restrict_span", + "file": "meos_internal.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const struct TSequenceSet *" + }, + { + "name": "span", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tnumberseqset_restrict_spanset", + "file": "meos_internal.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const struct TSequenceSet *" + }, + { + "name": "spanset", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tsequence_at_timestamptz", + "file": "meos_internal.h", + "returnType": { + "c": "TInstant *", + "canonical": "struct TInstant *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "tsequence_restrict_tstzspan", + "file": "meos_internal.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tsequence_restrict_tstzspanset", + "file": "meos_internal.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tsequenceset_after_timestamptz", + "file": "meos_internal.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const struct TSequenceSet *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "strict", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tsequenceset_before_timestamptz", + "file": "meos_internal.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const struct TSequenceSet *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "strict", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tsequenceset_restrict_minmax", + "file": "meos_internal.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const struct TSequenceSet *" + }, + { + "name": "min", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tsequenceset_restrict_tstzspan", + "file": "meos_internal.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const struct TSequenceSet *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tsequenceset_restrict_tstzspanset", + "file": "meos_internal.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const struct TSequenceSet *" + }, + { + "name": "ps", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tsequenceset_restrict_timestamptz", + "file": "meos_internal.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const struct TSequenceSet *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tsequenceset_restrict_tstzset", + "file": "meos_internal.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const struct TSequenceSet *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tsequenceset_restrict_value", + "file": "meos_internal.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const struct TSequenceSet *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tsequenceset_restrict_values", + "file": "meos_internal.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const struct TSequenceSet *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tinstant_cmp", + "file": "meos_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "inst1", + "cType": "const TInstant *", + "canonical": "const struct TInstant *" + }, + { + "name": "inst2", + "cType": "const TInstant *", + "canonical": "const struct TInstant *" + } + ] + }, + { + "name": "tinstant_eq", + "file": "meos_internal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "inst1", + "cType": "const TInstant *", + "canonical": "const struct TInstant *" + }, + { + "name": "inst2", + "cType": "const TInstant *", + "canonical": "const struct TInstant *" + } + ] + }, + { + "name": "tsequence_cmp", + "file": "meos_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "seq1", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "seq2", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + } + ] + }, + { + "name": "tsequence_eq", + "file": "meos_internal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "seq1", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "seq2", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + } + ] + }, + { + "name": "tsequenceset_cmp", + "file": "meos_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "ss1", + "cType": "const TSequenceSet *", + "canonical": "const struct TSequenceSet *" + }, + { + "name": "ss2", + "cType": "const TSequenceSet *", + "canonical": "const struct TSequenceSet *" + } + ] + }, + { + "name": "tsequenceset_eq", + "file": "meos_internal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss1", + "cType": "const TSequenceSet *", + "canonical": "const struct TSequenceSet *" + }, + { + "name": "ss2", + "cType": "const TSequenceSet *", + "canonical": "const struct TSequenceSet *" + } + ] + }, + { + "name": "always_eq_base_temporal", + "file": "meos_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_eq_temporal_base", + "file": "meos_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "always_ne_base_temporal", + "file": "meos_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_ne_temporal_base", + "file": "meos_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "always_ge_base_temporal", + "file": "meos_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_ge_temporal_base", + "file": "meos_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "always_gt_base_temporal", + "file": "meos_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_gt_temporal_base", + "file": "meos_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "always_le_base_temporal", + "file": "meos_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_le_temporal_base", + "file": "meos_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "always_lt_base_temporal", + "file": "meos_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_lt_temporal_base", + "file": "meos_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "ever_eq_base_temporal", + "file": "meos_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_eq_temporal_base", + "file": "meos_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "ever_ne_base_temporal", + "file": "meos_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_ne_temporal_base", + "file": "meos_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "ever_ge_base_temporal", + "file": "meos_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_ge_temporal_base", + "file": "meos_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "ever_gt_base_temporal", + "file": "meos_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_gt_temporal_base", + "file": "meos_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "ever_le_base_temporal", + "file": "meos_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_le_temporal_base", + "file": "meos_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "ever_lt_base_temporal", + "file": "meos_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_lt_temporal_base", + "file": "meos_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "tnumberinst_abs", + "file": "meos_internal.h", + "returnType": { + "c": "TInstant *", + "canonical": "struct TInstant *" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const struct TInstant *" + } + ] + }, + { + "name": "tnumberinst_distance", + "file": "meos_internal.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "inst1", + "cType": "const TInstant *", + "canonical": "const struct TInstant *" + }, + { + "name": "inst2", + "cType": "const TInstant *", + "canonical": "const struct TInstant *" + } + ] + }, + { + "name": "tnumberseq_abs", + "file": "meos_internal.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + } + ] + }, + { + "name": "tnumberseq_angular_difference", + "file": "meos_internal.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + } + ] + }, + { + "name": "tnumberseq_delta_value", + "file": "meos_internal.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + } + ] + }, + { + "name": "tnumberseqset_abs", + "file": "meos_internal.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const struct TSequenceSet *" + } + ] + }, + { + "name": "tnumberseqset_angular_difference", + "file": "meos_internal.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const struct TSequenceSet *" + } + ] + }, + { + "name": "tnumberseqset_delta_value", + "file": "meos_internal.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const struct TSequenceSet *" + } + ] + }, + { + "name": "tdistance_tnumber_number", + "file": "meos_internal.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "nad_tbox_tbox", + "file": "meos_internal.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "box1", + "cType": "const TBox *", + "canonical": "const struct TBox *" + }, + { + "name": "box2", + "cType": "const TBox *", + "canonical": "const struct TBox *" + } + ] + }, + { + "name": "nad_tnumber_number", + "file": "meos_internal.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "nad_tnumber_tbox", + "file": "meos_internal.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const TBox *", + "canonical": "const struct TBox *" + } + ] + }, + { + "name": "nad_tnumber_tnumber", + "file": "meos_internal.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tnumberseq_integral", + "file": "meos_internal.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + } + ] + }, + { + "name": "tnumberseq_twavg", + "file": "meos_internal.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + } + ] + }, + { + "name": "tnumberseqset_integral", + "file": "meos_internal.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const struct TSequenceSet *" + } + ] + }, + { + "name": "tnumberseqset_twavg", + "file": "meos_internal.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const struct TSequenceSet *" + } + ] + }, + { + "name": "temporal_compact", + "file": "meos_internal.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tsequence_compact", + "file": "meos_internal.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + } + ] + }, + { + "name": "tsequenceset_compact", + "file": "meos_internal.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const struct TSequenceSet *" + } + ] + }, + { + "name": "temporal_skiplist_make", + "file": "meos_internal.h", + "returnType": { + "c": "SkipList *", + "canonical": "struct SkipList *" + }, + "params": [] + }, + { + "name": "skiplist_make", + "file": "meos_internal.h", + "returnType": { + "c": "SkipList *", + "canonical": "struct SkipList *" + }, + "params": [ + { + "name": "key_size", + "cType": "size_t", + "canonical": "unsigned long" + }, + { + "name": "value_size", + "cType": "size_t", + "canonical": "unsigned long" + }, + { + "name": "comp_fn", + "cType": "int (*)(void *, void *)", + "canonical": "int (*)(void *, void *)" + }, + { + "name": "merge_fn", + "cType": "void *(*)(void *, void *)", + "canonical": "void *(*)(void *, void *)" + } + ] + }, + { + "name": "skiplist_search", + "file": "meos_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "list", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "key", + "cType": "void *", + "canonical": "void *" + }, + { + "name": "value", + "cType": "void *", + "canonical": "void *" + } + ] + }, + { + "name": "skiplist_free", + "file": "meos_internal.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "list", + "cType": "SkipList *", + "canonical": "struct SkipList *" + } + ] + }, + { + "name": "skiplist_splice", + "file": "meos_internal.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "list", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "keys", + "cType": "void **", + "canonical": "void **" + }, + { + "name": "values", + "cType": "void **", + "canonical": "void **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "func", + "cType": "datum_func2", + "canonical": "int (*)(int ((*)(int *))(), int ((*)(int *))())" + }, + { + "name": "crossings", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "sktype", + "cType": "SkipListType", + "canonical": "SkipListType" + } + ] + }, + { + "name": "temporal_skiplist_splice", + "file": "meos_internal.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "list", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "values", + "cType": "void **", + "canonical": "void **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "func", + "cType": "datum_func2", + "canonical": "int (*)(int ((*)(int *))(), int ((*)(int *))())" + }, + { + "name": "crossings", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "skiplist_values", + "file": "meos_internal.h", + "returnType": { + "c": "void **", + "canonical": "void **" + }, + "params": [ + { + "name": "list", + "cType": "SkipList *", + "canonical": "struct SkipList *" + } + ] + }, + { + "name": "skiplist_keys_values", + "file": "meos_internal.h", + "returnType": { + "c": "void **", + "canonical": "void **" + }, + "params": [ + { + "name": "list", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "values", + "cType": "void **", + "canonical": "void **" + } + ] + }, + { + "name": "temporal_app_tinst_transfn", + "file": "meos_internal.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "state", + "cType": "Temporal *", + "canonical": "Temporal *" + }, + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const struct TInstant *" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + }, + { + "name": "maxdist", + "cType": "double", + "canonical": "double" + }, + { + "name": "maxt", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "temporal_app_tseq_transfn", + "file": "meos_internal.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "state", + "cType": "Temporal *", + "canonical": "Temporal *" + }, + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + } + ] + }, + { + "name": "span_bins", + "file": "meos_internal.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "size", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "origin", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "spanset_bins", + "file": "meos_internal.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "size", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "origin", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tnumber_value_bins", + "file": "meos_internal.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "size", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "origin", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tnumber_value_time_boxes", + "file": "meos_internal.h", + "returnType": { + "c": "TBox *", + "canonical": "struct TBox *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "vsize", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "duration", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "vorigin", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "torigin", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tnumber_value_split", + "file": "meos_internal.h", + "returnType": { + "c": "Temporal **", + "canonical": "Temporal **" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "vsize", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "vorigin", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "bins", + "cType": "Datum **", + "canonical": "int ((**)(int *))()" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tbox_get_value_time_tile", + "file": "meos_internal.h", + "returnType": { + "c": "TBox *", + "canonical": "struct TBox *" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "vsize", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "duration", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "vorigin", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "torigin", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "basetype", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "spantype", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "tnumber_value_time_split", + "file": "meos_internal.h", + "returnType": { + "c": "Temporal **", + "canonical": "Temporal **" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "size", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "duration", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "vorigin", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "torigin", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "value_bins", + "cType": "Datum **", + "canonical": "int ((**)(int *))()" + }, + { + "name": "time_bins", + "cType": "TimestampTz **", + "canonical": "long **" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "double2_out", + "file": "doublen.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "d", + "cType": "const double2 *", + "canonical": "const double2 *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "double2_set", + "file": "doublen.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "a", + "cType": "double", + "canonical": "double" + }, + { + "name": "b", + "cType": "double", + "canonical": "double" + }, + { + "name": "result", + "cType": "double2 *", + "canonical": "double2 *" + } + ] + }, + { + "name": "double2_add", + "file": "doublen.h", + "returnType": { + "c": "double2 *", + "canonical": "double2 *" + }, + "params": [ + { + "name": "d1", + "cType": "const double2 *", + "canonical": "const double2 *" + }, + { + "name": "d2", + "cType": "const double2 *", + "canonical": "const double2 *" + } + ] + }, + { + "name": "double2_eq", + "file": "doublen.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "d1", + "cType": "const double2 *", + "canonical": "const double2 *" + }, + { + "name": "d2", + "cType": "const double2 *", + "canonical": "const double2 *" + } + ] + }, + { + "name": "double3_out", + "file": "doublen.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "d", + "cType": "const double3 *", + "canonical": "const double3 *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "double3_set", + "file": "doublen.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "a", + "cType": "double", + "canonical": "double" + }, + { + "name": "b", + "cType": "double", + "canonical": "double" + }, + { + "name": "c", + "cType": "double", + "canonical": "double" + }, + { + "name": "result", + "cType": "double3 *", + "canonical": "double3 *" + } + ] + }, + { + "name": "double3_add", + "file": "doublen.h", + "returnType": { + "c": "double3 *", + "canonical": "double3 *" + }, + "params": [ + { + "name": "d1", + "cType": "const double3 *", + "canonical": "const double3 *" + }, + { + "name": "d2", + "cType": "const double3 *", + "canonical": "const double3 *" + } + ] + }, + { + "name": "double3_eq", + "file": "doublen.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "d1", + "cType": "const double3 *", + "canonical": "const double3 *" + }, + { + "name": "d2", + "cType": "const double3 *", + "canonical": "const double3 *" + } + ] + }, + { + "name": "double4_out", + "file": "doublen.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "d", + "cType": "const double4 *", + "canonical": "const double4 *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "double4_set", + "file": "doublen.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "a", + "cType": "double", + "canonical": "double" + }, + { + "name": "b", + "cType": "double", + "canonical": "double" + }, + { + "name": "c", + "cType": "double", + "canonical": "double" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + }, + { + "name": "result", + "cType": "double4 *", + "canonical": "double4 *" + } + ] + }, + { + "name": "double4_add", + "file": "doublen.h", + "returnType": { + "c": "double4 *", + "canonical": "double4 *" + }, + "params": [ + { + "name": "d1", + "cType": "const double4 *", + "canonical": "const double4 *" + }, + { + "name": "d2", + "cType": "const double4 *", + "canonical": "const double4 *" + } + ] + }, + { + "name": "double4_eq", + "file": "doublen.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "d1", + "cType": "const double4 *", + "canonical": "const double4 *" + }, + { + "name": "d2", + "cType": "const double4 *", + "canonical": "const double4 *" + } + ] + }, + { + "name": "double2_collinear", + "file": "doublen.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "x1", + "cType": "const double2 *", + "canonical": "const double2 *" + }, + { + "name": "x2", + "cType": "const double2 *", + "canonical": "const double2 *" + }, + { + "name": "x3", + "cType": "const double2 *", + "canonical": "const double2 *" + }, + { + "name": "ratio", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "double3_collinear", + "file": "doublen.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "x1", + "cType": "const double3 *", + "canonical": "const double3 *" + }, + { + "name": "x2", + "cType": "const double3 *", + "canonical": "const double3 *" + }, + { + "name": "x3", + "cType": "const double3 *", + "canonical": "const double3 *" + }, + { + "name": "ratio", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "double4_collinear", + "file": "doublen.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "x1", + "cType": "const double4 *", + "canonical": "const double4 *" + }, + { + "name": "x2", + "cType": "const double4 *", + "canonical": "const double4 *" + }, + { + "name": "x3", + "cType": "const double4 *", + "canonical": "const double4 *" + }, + { + "name": "ratio", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "double2segm_interpolate", + "file": "doublen.h", + "returnType": { + "c": "double2 *", + "canonical": "double2 *" + }, + "params": [ + { + "name": "start", + "cType": "const double2 *", + "canonical": "const double2 *" + }, + { + "name": "end", + "cType": "const double2 *", + "canonical": "const double2 *" + }, + { + "name": "ratio", + "cType": "long double", + "canonical": "long double" + } + ] + }, + { + "name": "double3segm_interpolate", + "file": "doublen.h", + "returnType": { + "c": "double3 *", + "canonical": "double3 *" + }, + "params": [ + { + "name": "start", + "cType": "const double3 *", + "canonical": "const double3 *" + }, + { + "name": "end", + "cType": "const double3 *", + "canonical": "const double3 *" + }, + { + "name": "ratio", + "cType": "long double", + "canonical": "long double" + } + ] + }, + { + "name": "double4segm_interpolate", + "file": "doublen.h", + "returnType": { + "c": "double4 *", + "canonical": "double4 *" + }, + "params": [ + { + "name": "start", + "cType": "const double4 *", + "canonical": "const double4 *" + }, + { + "name": "end", + "cType": "const double4 *", + "canonical": "const double4 *" + }, + { + "name": "ratio", + "cType": "long double", + "canonical": "long double" + } + ] + }, + { + "name": "pg_atoi", + "file": "temporal.h", + "returnType": { + "c": "int32", + "canonical": "int" + }, + "params": [ + { + "name": "s", + "cType": "const char *", + "canonical": "const char *" + }, + { + "name": "size", + "cType": "int", + "canonical": "int" + }, + { + "name": "c", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "ensure_has_X", + "file": "temporal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "flags", + "cType": "int16", + "canonical": "short" + } + ] + }, + { + "name": "ensure_has_Z", + "file": "temporal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "flags", + "cType": "int16", + "canonical": "short" + } + ] + }, + { + "name": "ensure_has_T", + "file": "temporal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "flags", + "cType": "int16", + "canonical": "short" + } + ] + }, + { + "name": "ensure_has_not_Z", + "file": "temporal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "flags", + "cType": "int16", + "canonical": "short" + } + ] + }, + { + "name": "ensure_not_null", + "file": "temporal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ptr", + "cType": "void *", + "canonical": "void *" + } + ] + }, + { + "name": "ensure_one_not_null", + "file": "temporal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ptr1", + "cType": "void *", + "canonical": "void *" + }, + { + "name": "ptr2", + "cType": "void *", + "canonical": "void *" + } + ] + }, + { + "name": "ensure_one_true", + "file": "temporal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "hasshift", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "haswidth", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ensure_valid_interp", + "file": "temporal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temptype", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "ensure_continuous", + "file": "temporal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ensure_same_interp", + "file": "temporal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ensure_same_continuous_interp", + "file": "temporal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "flags1", + "cType": "int16", + "canonical": "short" + }, + { + "name": "flags2", + "cType": "int16", + "canonical": "short" + } + ] + }, + { + "name": "ensure_linear_interp", + "file": "temporal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "flags", + "cType": "int16", + "canonical": "short" + } + ] + }, + { + "name": "ensure_nonlinear_interp", + "file": "temporal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "flags", + "cType": "int16", + "canonical": "short" + } + ] + }, + { + "name": "ensure_common_dimension", + "file": "temporal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "flags1", + "cType": "int16", + "canonical": "short" + }, + { + "name": "flags2", + "cType": "int16", + "canonical": "short" + } + ] + }, + { + "name": "ensure_temporal_isof_type", + "file": "temporal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "ensure_temporal_isof_basetype", + "file": "temporal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "basetype", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "ensure_temporal_isof_subtype", + "file": "temporal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "type", + "cType": "tempSubtype", + "canonical": "tempSubtype" + } + ] + }, + { + "name": "ensure_same_temporal_type", + "file": "temporal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ensure_valid_tnumber_numspan", + "file": "temporal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "ensure_valid_tnumber_numspanset", + "file": "temporal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "ensure_valid_tnumber_tbox", + "file": "temporal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const TBox *", + "canonical": "const struct TBox *" + } + ] + }, + { + "name": "ensure_valid_temporal_set", + "file": "temporal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "ensure_valid_temporal_temporal", + "file": "temporal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ensure_valid_tnumber_tnumber", + "file": "temporal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ensure_not_negative", + "file": "temporal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "ensure_positive", + "file": "temporal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "not_negative_datum", + "file": "temporal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "size", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "basetype", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "ensure_not_negative_datum", + "file": "temporal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "size", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "basetype", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "positive_datum", + "file": "temporal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "size", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "basetype", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "ensure_positive_datum", + "file": "temporal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "size", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "basetype", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "ensure_valid_day_duration", + "file": "temporal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "duration", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "positive_duration", + "file": "temporal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "duration", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "ensure_positive_duration", + "file": "temporal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "duration", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "temporal_bbox_ptr", + "file": "temporal.h", + "returnType": { + "c": "void *", + "canonical": "void *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "intersection_temporal_temporal", + "file": "temporal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "mode", + "cType": "SyncMode", + "canonical": "SyncMode" + }, + { + "name": "inter1", + "cType": "Temporal **", + "canonical": "Temporal **" + }, + { + "name": "inter2", + "cType": "Temporal **", + "canonical": "Temporal **" + } + ] + }, + { + "name": "mobilitydb_version", + "file": "temporal.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [] + }, + { + "name": "mobilitydb_full_version", + "file": "temporal.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [] + }, + { + "name": "round_fn", + "file": "temporal.h", + "returnType": { + "c": "datum_func2", + "canonical": "int (*)(int ((*)(int *))(), int ((*)(int *))())" + }, + "params": [ + { + "name": "basetype", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "temporal_bbox_restrict_value", + "file": "temporal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "ensure_valid_tcbuffer_cbuffer", + "file": "tcbuffer.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "ensure_valid_tcbuffer_geo", + "file": "tcbuffer.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "ensure_valid_tcbuffer_stbox", + "file": "tcbuffer.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + } + ] + }, + { + "name": "ensure_valid_tcbuffer_tcbuffer", + "file": "tcbuffer.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tcbuffersegm_intersection_value", + "file": "tcbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "start", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "end", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "lower", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "upper", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "t1", + "cType": "TimestampTz *", + "canonical": "long *" + }, + { + "name": "t2", + "cType": "TimestampTz *", + "canonical": "long *" + } + ] + }, + { + "name": "tcbuffersegm_intersection", + "file": "tcbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "start1", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "end1", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "start2", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "end2", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "lower", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "upper", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "t1", + "cType": "TimestampTz *", + "canonical": "long *" + }, + { + "name": "t2", + "cType": "TimestampTz *", + "canonical": "long *" + } + ] + }, + { + "name": "tcbuffersegm_dwithin_turnpt", + "file": "tcbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "start1", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "end1", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "start2", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "end2", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "dist", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "lower", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "upper", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "t1", + "cType": "TimestampTz *", + "canonical": "long *" + }, + { + "name": "t2", + "cType": "TimestampTz *", + "canonical": "long *" + } + ] + }, + { + "name": "tcbuffersegm_tdwithin_turnpt", + "file": "tcbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "start1", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "end1", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "start2", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "end2", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "dist", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "lower", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "upper", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "t1", + "cType": "TimestampTz *", + "canonical": "long *" + }, + { + "name": "t2", + "cType": "TimestampTz *", + "canonical": "long *" + } + ] + }, + { + "name": "tcbuffersegm_distance_turnpt", + "file": "tcbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "start1", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "end1", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "start2", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "end2", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "dist", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "cbuffer_set_stbox", + "file": "tcbuffer_boxops.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "box", + "cType": "STBox *", + "canonical": "struct STBox *" + } + ] + }, + { + "name": "cbufferarr_set_stbox", + "file": "tcbuffer_boxops.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "values", + "cType": "Datum *", + "canonical": "int ((*)(int *))()" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "box", + "cType": "STBox *", + "canonical": "struct STBox *" + } + ] + }, + { + "name": "cbuffer_timestamptz_set_stbox", + "file": "tcbuffer_boxops.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "box", + "cType": "STBox *", + "canonical": "struct STBox *" + } + ] + }, + { + "name": "cbuffer_tstzspan_set_stbox", + "file": "tcbuffer_boxops.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "box", + "cType": "STBox *", + "canonical": "struct STBox *" + } + ] + }, + { + "name": "tcbufferinst_set_stbox", + "file": "tcbuffer_boxops.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const struct TInstant *" + }, + { + "name": "box", + "cType": "STBox *", + "canonical": "struct STBox *" + } + ] + }, + { + "name": "tcbufferinstarr_set_stbox", + "file": "tcbuffer_boxops.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "instants", + "cType": "TInstant **", + "canonical": "struct TInstant **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "box", + "cType": "STBox *", + "canonical": "struct STBox *" + } + ] + }, + { + "name": "tcbufferseq_expand_stbox", + "file": "tcbuffer_boxops.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const struct TInstant *" + } + ] + }, + { + "name": "tcbufferinst_traversed_area", + "file": "tcbuffer_spatialfuncs.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const struct TInstant *" + } + ] + }, + { + "name": "tcbufferseq_traversed_area", + "file": "tcbuffer_spatialfuncs.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "unary_union", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tcbufferseqset_traversed_area", + "file": "tcbuffer_spatialfuncs.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const struct TSequenceSet *" + }, + { + "name": "unary_union", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tcbuffersegm_traversed_area", + "file": "tcbuffer_spatialfuncs.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "inst1", + "cType": "const TInstant *", + "canonical": "const struct TInstant *" + }, + { + "name": "inst2", + "cType": "const TInstant *", + "canonical": "const struct TInstant *" + } + ] + }, + { + "name": "tcbuffer_restrict_cbuffer", + "file": "tcbuffer_spatialfuncs.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tcbuffer_restrict_stbox", + "file": "tcbuffer_spatialfuncs.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "border_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tcbuffer_restrict_geom", + "file": "tcbuffer_spatialfuncs.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_contains_geo_tcbuffer", + "file": "tcbuffer_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_contains_tcbuffer_geo", + "file": "tcbuffer_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_contains_tcbuffer_cbuffer", + "file": "tcbuffer_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_contains_cbuffer_tcbuffer", + "file": "tcbuffer_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_covers_geo_tcbuffer", + "file": "tcbuffer_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_covers_tcbuffer_geo", + "file": "tcbuffer_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_covers_tcbuffer_cbuffer", + "file": "tcbuffer_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_covers_cbuffer_tcbuffer", + "file": "tcbuffer_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_covers_tcbuffer_tcbuffer", + "file": "tcbuffer_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_disjoint_tcbuffer_geo", + "file": "tcbuffer_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_disjoint_geo_tcbuffer", + "file": "tcbuffer_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_disjoint_tcbuffer_cbuffer", + "file": "tcbuffer_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_disjoint_cbuffer_tcbuffer", + "file": "tcbuffer_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_disjoint_tcbuffer_tcbuffer", + "file": "tcbuffer_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_intersects_tcbuffer_geo", + "file": "tcbuffer_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_intersects_geo_tcbuffer", + "file": "tcbuffer_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_intersects_tcbuffer_cbuffer", + "file": "tcbuffer_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_intersects_cbuffer_tcbuffer", + "file": "tcbuffer_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_intersects_tcbuffer_tcbuffer", + "file": "tcbuffer_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_touches_tcbuffer_geo", + "file": "tcbuffer_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_touches_geo_tcbuffer", + "file": "tcbuffer_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_touches_tcbuffer_cbuffer", + "file": "tcbuffer_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_touches_cbuffer_tcbuffer", + "file": "tcbuffer_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_touches_tcbuffer_tcbuffer", + "file": "tcbuffer_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tinterrel_tcbuffer_cbuffer", + "file": "tcbuffer_tempspatialrels.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "tinter", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tinterrel_tcbuffer_geo", + "file": "tcbuffer_tempspatialrels.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "tinter", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "clipper2_clip_poly_poly", + "file": "clip_clipper2.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "subj", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "clip", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "op", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "clipper2_traj_poly_periods", + "file": "clip_clipper2.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "out_count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "clip_poly_poly", + "file": "geo_poly_clip.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "subj", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "clip", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "operation", + "cType": "ClipOper", + "canonical": "ClipOper" + } + ] + }, + { + "name": "lwproj_lookup", + "file": "meos_transform.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "srid_from", + "cType": "int32_t", + "canonical": "int" + }, + { + "name": "srid_to", + "cType": "int32_t", + "canonical": "int" + }, + { + "name": "pj", + "cType": "int **", + "canonical": "int **" + } + ] + }, + { + "name": "spheroid_init_from_srid", + "file": "meos_transform.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + }, + { + "name": "s", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "srid_check_latlong", + "file": "meos_transform.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + } + ] + }, + { + "name": "srid_is_latlong", + "file": "meos_transform.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + } + ] + }, + { + "name": "geom_serialize", + "file": "postgis_funcs.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "lwgeom", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "geog_serialize", + "file": "postgis_funcs.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "lwgeom", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "meos_postgis_valid_typmod", + "file": "postgis_funcs.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "gs", + "cType": "int *", + "canonical": "int *" + }, + { + "name": "typmod", + "cType": "int32_t", + "canonical": "int" + } + ] + }, + { + "name": "geo_as_wkt", + "file": "postgis_funcs.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "precision", + "cType": "int", + "canonical": "int" + }, + { + "name": "extended", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "box2d_to_lwgeom", + "file": "postgis_funcs.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "box", + "cType": "int *", + "canonical": "int *" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + } + ] + }, + { + "name": "box3d_to_lwgeom", + "file": "postgis_funcs.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "box", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "MEOS_POSTGIS2GEOS", + "file": "postgis_funcs.h", + "returnType": { + "c": "GEOSGeometry *", + "canonical": "struct GEOSGeom_t *" + }, + "params": [ + { + "name": "pglwgeom", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "MEOS_GEOS2POSTGIS", + "file": "postgis_funcs.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "geom", + "cType": "GEOSGeom", + "canonical": "struct GEOSGeom_t *" + }, + { + "name": "want3d", + "cType": "char", + "canonical": "char" + } + ] + }, + { + "name": "geom_spatialrel", + "file": "postgis_funcs.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "gs1", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "gs2", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "rel", + "cType": "spatialRel", + "canonical": "spatialRel" + } + ] + }, + { + "name": "lwgeom_line_interpolate_point", + "file": "postgis_funcs.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "geom", + "cType": "int *", + "canonical": "int *" + }, + { + "name": "fraction", + "cType": "double", + "canonical": "double" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + }, + { + "name": "repeat", + "cType": "char", + "canonical": "char" + } + ] + }, + { + "name": "point_get_coords", + "file": "stbox.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "point", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "hasz", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "x", + "cType": "double *", + "canonical": "double *" + }, + { + "name": "y", + "cType": "double *", + "canonical": "double *" + }, + { + "name": "z", + "cType": "double *", + "canonical": "double *" + } + ] + }, + { + "name": "tstzset_stbox_slice", + "file": "stbox.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "tsdatum", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "box", + "cType": "STBox *", + "canonical": "struct STBox *" + } + ] + }, + { + "name": "tstzspanset_stbox_slice", + "file": "stbox.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "psdatum", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "box", + "cType": "STBox *", + "canonical": "struct STBox *" + } + ] + }, + { + "name": "stbox_index_leaf_consistent", + "file": "stbox_index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "key", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "query", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "strategy", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "stbox_gist_inner_consistent", + "file": "stbox_index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "key", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "query", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "strategy", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "stbox_index_recheck", + "file": "stbox_index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "strategy", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "stboxnode_copy", + "file": "stbox_index.h", + "returnType": { + "c": "STboxNode *", + "canonical": "struct STboxNode *" + }, + "params": [ + { + "name": "box", + "cType": "const STboxNode *", + "canonical": "const struct STboxNode *" + } + ] + }, + { + "name": "getQuadrant8D", + "file": "stbox_index.h", + "returnType": { + "c": "uint8", + "canonical": "unsigned char" + }, + "params": [ + { + "name": "centroid", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "inBox", + "cType": "const STBox *", + "canonical": "const struct STBox *" + } + ] + }, + { + "name": "stboxnode_init", + "file": "stbox_index.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "centroid", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "nodebox", + "cType": "STboxNode *", + "canonical": "struct STboxNode *" + } + ] + }, + { + "name": "stboxnode_quadtree_next", + "file": "stbox_index.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "nodebox", + "cType": "const STboxNode *", + "canonical": "const struct STboxNode *" + }, + { + "name": "centroid", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "quadrant", + "cType": "uint8", + "canonical": "unsigned char" + }, + { + "name": "next_nodebox", + "cType": "STboxNode *", + "canonical": "struct STboxNode *" + } + ] + }, + { + "name": "stboxnode_kdtree_next", + "file": "stbox_index.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "nodebox", + "cType": "const STboxNode *", + "canonical": "const struct STboxNode *" + }, + { + "name": "centroid", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "node", + "cType": "uint8", + "canonical": "unsigned char" + }, + { + "name": "level", + "cType": "int", + "canonical": "int" + }, + { + "name": "next_nodebox", + "cType": "STboxNode *", + "canonical": "struct STboxNode *" + } + ] + }, + { + "name": "overlap8D", + "file": "stbox_index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "nodebox", + "cType": "const STboxNode *", + "canonical": "const struct STboxNode *" + }, + { + "name": "query", + "cType": "const STBox *", + "canonical": "const struct STBox *" + } + ] + }, + { + "name": "overlapKD", + "file": "stbox_index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "nodebox", + "cType": "const STboxNode *", + "canonical": "const struct STboxNode *" + }, + { + "name": "query", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "level", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "contain8D", + "file": "stbox_index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "nodebox", + "cType": "const STboxNode *", + "canonical": "const struct STboxNode *" + }, + { + "name": "query", + "cType": "const STBox *", + "canonical": "const struct STBox *" + } + ] + }, + { + "name": "containKD", + "file": "stbox_index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "nodebox", + "cType": "const STboxNode *", + "canonical": "const struct STboxNode *" + }, + { + "name": "query", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "level", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "left8D", + "file": "stbox_index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "nodebox", + "cType": "const STboxNode *", + "canonical": "const struct STboxNode *" + }, + { + "name": "query", + "cType": "const STBox *", + "canonical": "const struct STBox *" + } + ] + }, + { + "name": "overLeft8D", + "file": "stbox_index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "nodebox", + "cType": "const STboxNode *", + "canonical": "const struct STboxNode *" + }, + { + "name": "query", + "cType": "const STBox *", + "canonical": "const struct STBox *" + } + ] + }, + { + "name": "right8D", + "file": "stbox_index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "nodebox", + "cType": "const STboxNode *", + "canonical": "const struct STboxNode *" + }, + { + "name": "query", + "cType": "const STBox *", + "canonical": "const struct STBox *" + } + ] + }, + { + "name": "overRight8D", + "file": "stbox_index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "nodebox", + "cType": "const STboxNode *", + "canonical": "const struct STboxNode *" + }, + { + "name": "query", + "cType": "const STBox *", + "canonical": "const struct STBox *" + } + ] + }, + { + "name": "below8D", + "file": "stbox_index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "nodebox", + "cType": "const STboxNode *", + "canonical": "const struct STboxNode *" + }, + { + "name": "query", + "cType": "const STBox *", + "canonical": "const struct STBox *" + } + ] + }, + { + "name": "overBelow8D", + "file": "stbox_index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "nodebox", + "cType": "const STboxNode *", + "canonical": "const struct STboxNode *" + }, + { + "name": "query", + "cType": "const STBox *", + "canonical": "const struct STBox *" + } + ] + }, + { + "name": "above8D", + "file": "stbox_index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "nodebox", + "cType": "const STboxNode *", + "canonical": "const struct STboxNode *" + }, + { + "name": "query", + "cType": "const STBox *", + "canonical": "const struct STBox *" + } + ] + }, + { + "name": "overAbove8D", + "file": "stbox_index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "nodebox", + "cType": "const STboxNode *", + "canonical": "const struct STboxNode *" + }, + { + "name": "query", + "cType": "const STBox *", + "canonical": "const struct STBox *" + } + ] + }, + { + "name": "front8D", + "file": "stbox_index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "nodebox", + "cType": "const STboxNode *", + "canonical": "const struct STboxNode *" + }, + { + "name": "query", + "cType": "const STBox *", + "canonical": "const struct STBox *" + } + ] + }, + { + "name": "overFront8D", + "file": "stbox_index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "nodebox", + "cType": "const STboxNode *", + "canonical": "const struct STboxNode *" + }, + { + "name": "query", + "cType": "const STBox *", + "canonical": "const struct STBox *" + } + ] + }, + { + "name": "back8D", + "file": "stbox_index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "nodebox", + "cType": "const STboxNode *", + "canonical": "const struct STboxNode *" + }, + { + "name": "query", + "cType": "const STBox *", + "canonical": "const struct STBox *" + } + ] + }, + { + "name": "overBack8D", + "file": "stbox_index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "nodebox", + "cType": "const STboxNode *", + "canonical": "const struct STboxNode *" + }, + { + "name": "query", + "cType": "const STBox *", + "canonical": "const struct STBox *" + } + ] + }, + { + "name": "before8D", + "file": "stbox_index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "nodebox", + "cType": "const STboxNode *", + "canonical": "const struct STboxNode *" + }, + { + "name": "query", + "cType": "const STBox *", + "canonical": "const struct STBox *" + } + ] + }, + { + "name": "overBefore8D", + "file": "stbox_index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "nodebox", + "cType": "const STboxNode *", + "canonical": "const struct STboxNode *" + }, + { + "name": "query", + "cType": "const STBox *", + "canonical": "const struct STBox *" + } + ] + }, + { + "name": "after8D", + "file": "stbox_index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "nodebox", + "cType": "const STboxNode *", + "canonical": "const struct STboxNode *" + }, + { + "name": "query", + "cType": "const STBox *", + "canonical": "const struct STBox *" + } + ] + }, + { + "name": "overAfter8D", + "file": "stbox_index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "nodebox", + "cType": "const STboxNode *", + "canonical": "const struct STboxNode *" + }, + { + "name": "query", + "cType": "const STBox *", + "canonical": "const struct STBox *" + } + ] + }, + { + "name": "distance_stbox_nodebox", + "file": "stbox_index.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "query", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "nodebox", + "cType": "const STboxNode *", + "canonical": "const struct STboxNode *" + } + ] + }, + { + "name": "tspatial_spgist_get_stbox", + "file": "stbox_index.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "result", + "cType": "STBox *", + "canonical": "struct STBox *" + } + ] + }, + { + "name": "mobilitydb_init", + "file": "tgeo.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [] + }, + { + "name": "geo_stbox", + "file": "tgeo.h", + "returnType": { + "c": "STBox *", + "canonical": "struct STBox *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "stbox_geo", + "file": "tgeo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + } + ] + }, + { + "name": "tcomp_geo_tgeo", + "file": "tgeo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "func", + "cType": "int (*)(Datum *, Datum *, MeosType)", + "canonical": "int (*)(int ((*)(int *))(), int ((*)(int *))(), MeosType)" + } + ] + }, + { + "name": "tcomp_tgeo_geo", + "file": "tgeo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "func", + "cType": "int (*)(Datum *, Datum *, MeosType)", + "canonical": "int (*)(int ((*)(int *))(), int ((*)(int *))(), MeosType)" + } + ] + }, + { + "name": "ensure_geoaggstate", + "file": "tgeo_aggfuncs.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "state", + "cType": "const SkipList *", + "canonical": "const struct SkipList *" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + }, + { + "name": "hasz", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ensure_geoaggstate_state", + "file": "tgeo_aggfuncs.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "state1", + "cType": "const SkipList *", + "canonical": "const struct SkipList *" + }, + { + "name": "state2", + "cType": "const SkipList *", + "canonical": "const struct SkipList *" + } + ] + }, + { + "name": "tpoint_transform_tcentroid", + "file": "tgeo_aggfuncs.h", + "returnType": { + "c": "Temporal **", + "canonical": "Temporal **" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tpointinst_tcentroid_finalfn", + "file": "tgeo_aggfuncs.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "instants", + "cType": "TInstant **", + "canonical": "struct TInstant **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + } + ] + }, + { + "name": "tpointseq_tcentroid_finalfn", + "file": "tgeo_aggfuncs.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "sequences", + "cType": "TSequence **", + "canonical": "struct TSequence **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + } + ] + }, + { + "name": "point3d_min_dist", + "file": "tgeo_distance.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "p1", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "p2", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "p3", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "p4", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "fraction", + "cType": "double *", + "canonical": "double *" + } + ] + }, + { + "name": "tgeompointsegm_distance_turnpt", + "file": "tgeo_distance.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "start1", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "end1", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "start2", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "end2", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "param", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "tgeogpointsegm_distance_turnpt", + "file": "tgeo_distance.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "start1", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "end1", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "start2", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "end2", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "param", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "tinstant_distance", + "file": "tgeo_distance.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "inst1", + "cType": "const TInstant *", + "canonical": "const struct TInstant *" + }, + { + "name": "inst2", + "cType": "const TInstant *", + "canonical": "const struct TInstant *" + }, + { + "name": "func", + "cType": "datum_func2", + "canonical": "int (*)(int ((*)(int *))(), int ((*)(int *))())" + } + ] + }, + { + "name": "tpointseq_at_geom", + "file": "tgeo_restrict.h", + "returnType": { + "c": "TSequence **", + "canonical": "struct TSequence **" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tpointseq_interperiods", + "file": "tgeo_restrict.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "datum_point4d", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "p", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "geopoint_cmp", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "gs1", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "gs2", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "geopoint_eq", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "gs1", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "gs2", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "geopoint_same", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "gs1", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "gs2", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "datum_point_eq", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "point1", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "point2", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_point_same", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "point1", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "point2", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum2_point_eq", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "point1", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "point2", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum2_point_ne", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "point1", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "point2", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum2_point_same", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "point1", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "point2", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum2_point_nsame", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "point1", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "point2", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum2_geom_centroid", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "geo", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum2_geog_centroid", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "geo", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "geo_extract_elements", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "int **", + "canonical": "int **" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "geo_serialize", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "geom", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "geo_distance_fn", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "datum_func2", + "canonical": "int (*)(int ((*)(int *))(), int ((*)(int *))())" + }, + "params": [ + { + "name": "flags", + "cType": "int16", + "canonical": "short" + } + ] + }, + { + "name": "pt_distance_fn", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "datum_func2", + "canonical": "int (*)(int ((*)(int *))(), int ((*)(int *))())" + }, + "params": [ + { + "name": "flags", + "cType": "int16", + "canonical": "short" + } + ] + }, + { + "name": "datum_geom_distance2d", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "geom1", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "geom2", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_geom_distance3d", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "geom1", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "geom2", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_geog_distance", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "geog1", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "geog2", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_pt_distance2d", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "geom1", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "geom2", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_pt_distance3d", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "geom1", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "geom2", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "spatial_flags", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "int16", + "canonical": "short" + }, + "params": [ + { + "name": "d", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "basetype", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "ensure_srid_is_latlong", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + } + ] + }, + { + "name": "ensure_spatial_validity", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ensure_not_geodetic", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "flags", + "cType": "int16", + "canonical": "short" + } + ] + }, + { + "name": "ensure_same_geodetic", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "flags1", + "cType": "int16", + "canonical": "short" + }, + { + "name": "flags2", + "cType": "int16", + "canonical": "short" + } + ] + }, + { + "name": "ensure_same_geodetic_geo", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "gs1", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "gs2", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "ensure_same_geodetic_tspatial_geo", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "ensure_same_geodetic_tspatial_base", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "base", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "ensure_srid_known", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + } + ] + }, + { + "name": "ensure_same_srid", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "srid1", + "cType": "int32_t", + "canonical": "int" + }, + { + "name": "srid2", + "cType": "int32_t", + "canonical": "int" + } + ] + }, + { + "name": "ensure_srid_reconcile", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "srid1", + "cType": "int32_t", + "canonical": "int" + }, + { + "name": "srid2", + "cType": "int32_t", + "canonical": "int" + }, + { + "name": "result", + "cType": "int32_t *", + "canonical": "int *" + } + ] + }, + { + "name": "ensure_same_dimensionality", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "flags1", + "cType": "int16", + "canonical": "short" + }, + { + "name": "flags2", + "cType": "int16", + "canonical": "short" + } + ] + }, + { + "name": "same_spatial_dimensionality", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "flags1", + "cType": "int16", + "canonical": "short" + }, + { + "name": "flags2", + "cType": "int16", + "canonical": "short" + } + ] + }, + { + "name": "ensure_same_spatial_dimensionality", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "flags1", + "cType": "int16", + "canonical": "short" + }, + { + "name": "flags2", + "cType": "int16", + "canonical": "short" + } + ] + }, + { + "name": "ensure_same_dimensionality_geo", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "gs1", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "gs2", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "same_dimensionality_tspatial_geo", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "ensure_same_dimensionality_tspatial_geo", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "ensure_same_spatial_dimensionality_stbox_geo", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "ensure_same_geodetic_stbox_geo", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "ensure_has_Z_geo", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "ensure_has_not_Z_geo", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "ensure_has_M_geo", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "ensure_has_not_M_geo", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "ensure_not_geodetic_geo", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "ensure_point_type", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "ensure_mline_type", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "circle_type", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "ensure_circle_type", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "ensure_not_empty", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "ensure_valid_stbox_geo", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "ensure_valid_tspatial_geo", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "ensure_valid_tspatial_base", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "base", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "ensure_valid_tspatial_tspatial", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ensure_valid_spatial_stbox_stbox", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "box2", + "cType": "const STBox *", + "canonical": "const struct STBox *" + } + ] + }, + { + "name": "ensure_valid_tgeo_stbox", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + } + ] + }, + { + "name": "ensure_valid_geo_geo", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "gs1", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "gs2", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "ensure_valid_tgeo_geo", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "ensure_valid_tgeo_tgeo", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ensure_valid_tpoint_geo", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "ensure_valid_tpoint_tpoint", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "mline_type", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "tpoint_get_coord", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "coord", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "eacomp_tgeo_geo", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "func", + "cType": "int (*)(Datum *, Datum *, MeosType)", + "canonical": "int (*)(int ((*)(int *))(), int ((*)(int *))(), MeosType)" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "closest_point2d_on_segment_ratio", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "long double", + "canonical": "long double" + }, + "params": [ + { + "name": "p", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "A", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "B", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "closest", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "closest_point3dz_on_segment_ratio", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "long double", + "canonical": "long double" + }, + "params": [ + { + "name": "p", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "A", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "B", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "closest", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "closest_point_on_segment_sphere", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "long double", + "canonical": "long double" + }, + "params": [ + { + "name": "p", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "A", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "B", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "closest", + "cType": "int *", + "canonical": "int *" + }, + { + "name": "dist", + "cType": "double *", + "canonical": "double *" + } + ] + }, + { + "name": "interpolate_point4d_spheroid", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "p1", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "p2", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "p", + "cType": "int *", + "canonical": "int *" + }, + { + "name": "s", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "f", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "geopoint_make", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "x", + "cType": "double", + "canonical": "double" + }, + { + "name": "y", + "cType": "double", + "canonical": "double" + }, + { + "name": "z", + "cType": "double", + "canonical": "double" + }, + { + "name": "hasz", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "geodetic", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + } + ] + }, + { + "name": "lwcircle_make", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "x", + "cType": "double", + "canonical": "double" + }, + { + "name": "y", + "cType": "double", + "canonical": "double" + }, + { + "name": "radius", + "cType": "double", + "canonical": "double" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + } + ] + }, + { + "name": "geocircle_make", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "x", + "cType": "double", + "canonical": "double" + }, + { + "name": "y", + "cType": "double", + "canonical": "double" + }, + { + "name": "radius", + "cType": "double", + "canonical": "double" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + } + ] + }, + { + "name": "pointsegm_interpolate", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "start", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "end", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "ratio", + "cType": "long double", + "canonical": "long double" + } + ] + }, + { + "name": "pointsegm_locate", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "long double", + "canonical": "long double" + }, + "params": [ + { + "name": "start", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "end", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "point", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "dist", + "cType": "double *", + "canonical": "double *" + } + ] + }, + { + "name": "tgeompointsegm_intersection", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "start1", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "end1", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "start2", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "end2", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "lower", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "upper", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "t1", + "cType": "TimestampTz *", + "canonical": "long *" + }, + { + "name": "t2", + "cType": "TimestampTz *", + "canonical": "long *" + } + ] + }, + { + "name": "tgeogpointsegm_intersection", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "start1", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "end1", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "start2", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "end2", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "lower", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "upper", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "t1", + "cType": "TimestampTz *", + "canonical": "long *" + }, + { + "name": "t2", + "cType": "TimestampTz *", + "canonical": "long *" + } + ] + }, + { + "name": "geopoint_collinear", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "value1", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "value2", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "value3", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "ratio", + "cType": "double", + "canonical": "double" + }, + { + "name": "hasz", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "geodetic", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "lwpointarr_remove_duplicates", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "int **", + "canonical": "int **" + }, + "params": [ + { + "name": "points", + "cType": "int **", + "canonical": "int **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "newcount", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "lwpointarr_make_trajectory", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "points", + "cType": "int **", + "canonical": "int **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "lwline_make", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "value1", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "value2", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "lwcoll_from_points_lines", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "points", + "cType": "int **", + "canonical": "int **" + }, + { + "name": "lines", + "cType": "int **", + "canonical": "int **" + }, + { + "name": "npoints", + "cType": "int", + "canonical": "int" + }, + { + "name": "nlines", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "tpointseq_stops_iter", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "maxdist", + "cType": "double", + "canonical": "double" + }, + { + "name": "mintunits", + "cType": "int64", + "canonical": "long" + }, + { + "name": "result", + "cType": "TSequence **", + "canonical": "struct TSequence **" + } + ] + }, + { + "name": "datum_geom_contains", + "file": "tgeo_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "geom1", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "geom2", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_geom_covers", + "file": "tgeo_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "geom1", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "geom2", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_geom_disjoint2d", + "file": "tgeo_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "geom1", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "geom2", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_geom_disjoint3d", + "file": "tgeo_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "geom1", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "geom2", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_geog_disjoint", + "file": "tgeo_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "geog1", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "geog2", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_geom_intersects2d", + "file": "tgeo_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "geom1", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "geom2", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_geom_intersects3d", + "file": "tgeo_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "geom1", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "geom2", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_geog_intersects", + "file": "tgeo_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "geog1", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "geog2", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_geom_touches", + "file": "tgeo_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "geom1", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "geom2", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_geom_dwithin2d", + "file": "tgeo_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "geom1", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "geom2", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "dist", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_geom_dwithin3d", + "file": "tgeo_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "geom1", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "geom2", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "dist", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_geog_dwithin", + "file": "tgeo_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "geog1", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "geog2", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "dist", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_geom_relate_pattern", + "file": "tgeo_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "geog1", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "geog2", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "p", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "geo_disjoint_fn", + "file": "tgeo_spatialrels.h", + "returnType": { + "c": "datum_func2", + "canonical": "int (*)(int ((*)(int *))(), int ((*)(int *))())" + }, + "params": [ + { + "name": "flags1", + "cType": "int16", + "canonical": "short" + }, + { + "name": "flags2", + "cType": "int16", + "canonical": "short" + } + ] + }, + { + "name": "geo_disjoint_fn_geo", + "file": "tgeo_spatialrels.h", + "returnType": { + "c": "datum_func2", + "canonical": "int (*)(int ((*)(int *))(), int ((*)(int *))())" + }, + "params": [ + { + "name": "flags1", + "cType": "int16", + "canonical": "short" + }, + { + "name": "flags2", + "cType": "uint8_t", + "canonical": "unsigned char" + } + ] + }, + { + "name": "geo_intersects_fn", + "file": "tgeo_spatialrels.h", + "returnType": { + "c": "datum_func2", + "canonical": "int (*)(int ((*)(int *))(), int ((*)(int *))())" + }, + "params": [ + { + "name": "flags1", + "cType": "int16", + "canonical": "short" + }, + { + "name": "flags2", + "cType": "int16", + "canonical": "short" + } + ] + }, + { + "name": "geo_intersects_fn_geo", + "file": "tgeo_spatialrels.h", + "returnType": { + "c": "datum_func2", + "canonical": "int (*)(int ((*)(int *))(), int ((*)(int *))())" + }, + "params": [ + { + "name": "flags1", + "cType": "int16", + "canonical": "short" + }, + { + "name": "flags2", + "cType": "uint8_t", + "canonical": "unsigned char" + } + ] + }, + { + "name": "geo_dwithin_fn", + "file": "tgeo_spatialrels.h", + "returnType": { + "c": "datum_func3", + "canonical": "int (*)(int ((*)(int *))(), int ((*)(int *))(), int ((*)(int *))())" + }, + "params": [ + { + "name": "flags1", + "cType": "int16", + "canonical": "short" + }, + { + "name": "flags2", + "cType": "int16", + "canonical": "short" + } + ] + }, + { + "name": "geo_dwithin_fn_geo", + "file": "tgeo_spatialrels.h", + "returnType": { + "c": "datum_func3", + "canonical": "int (*)(int ((*)(int *))(), int ((*)(int *))(), int ((*)(int *))())" + }, + "params": [ + { + "name": "flags1", + "cType": "int16", + "canonical": "short" + }, + { + "name": "flags2", + "cType": "uint8_t", + "canonical": "unsigned char" + } + ] + }, + { + "name": "tpointsegm_tdwithin_turnpt", + "file": "tgeo_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "start1", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "end1", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "start2", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "end2", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "lower", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "upper", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "t1", + "cType": "TimestampTz *", + "canonical": "long *" + }, + { + "name": "t2", + "cType": "TimestampTz *", + "canonical": "long *" + } + ] + }, + { + "name": "spatialrel_geo_geo", + "file": "tgeo_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "gs1", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "gs2", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "param", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "func", + "cType": "varfunc", + "canonical": "int (*)(int ((*)(int *))(), ...)" + }, + { + "name": "numparam", + "cType": "int", + "canonical": "int" + }, + { + "name": "invert", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "spatialrel_tgeo_tgeo", + "file": "tgeo_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "param", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "func", + "cType": "varfunc", + "canonical": "int (*)(int ((*)(int *))(), ...)" + }, + { + "name": "numparam", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "ea_contains_geo_tgeo", + "file": "tgeo_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_contains_tgeo_geo", + "file": "tgeo_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_contains_tgeo_tgeo", + "file": "tgeo_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_covers_geo_tgeo", + "file": "tgeo_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_covers_tgeo_geo", + "file": "tgeo_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_covers_tgeo_tgeo", + "file": "tgeo_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_disjoint_geo_tgeo", + "file": "tgeo_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_disjoint_tgeo_geo", + "file": "tgeo_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_disjoint_tgeo_tgeo", + "file": "tgeo_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_intersects_geo_tgeo", + "file": "tgeo_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_intersects_tgeo_geo", + "file": "tgeo_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_intersects_tgeo_tgeo", + "file": "tgeo_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_touches_tpoint_geo", + "file": "tgeo_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_touches_tgeo_geo", + "file": "tgeo_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_touches_tgeo_tgeo", + "file": "tgeo_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_dwithin_tgeo_geo", + "file": "tgeo_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "dist", + "cType": "double", + "canonical": "double" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_dwithin_tgeo_tgeo", + "file": "tgeo_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "dist", + "cType": "double", + "canonical": "double" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_spatialrel_tspatial_geo", + "file": "tgeo_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "func", + "cType": "datum_func2", + "canonical": "int (*)(int ((*)(int *))(), int ((*)(int *))())" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "invert", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_spatialrel_tspatial_tspatial", + "file": "tgeo_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "func", + "cType": "datum_func2", + "canonical": "int (*)(int ((*)(int *))(), int ((*)(int *))())" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tspatialrel_tspatial_base", + "file": "tgeo_tempspatialrels.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "base", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "param", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "func", + "cType": "varfunc", + "canonical": "int (*)(int ((*)(int *))(), ...)" + }, + { + "name": "numparam", + "cType": "int", + "canonical": "int" + }, + { + "name": "invert", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tspatialrel_tspatial_tspatial", + "file": "tgeo_tempspatialrels.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "param", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "func", + "cType": "varfunc", + "canonical": "int (*)(int ((*)(int *))(), ...)" + }, + { + "name": "numparam", + "cType": "int", + "canonical": "int" + }, + { + "name": "invert", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tinterrel_tgeo_geo", + "file": "tgeo_tempspatialrels.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "tinter", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tinterrel_tspatial_base", + "file": "tgeo_tempspatialrels.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "base", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "tinter", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "func", + "cType": "datum_func2", + "canonical": "int (*)(int ((*)(int *))(), int ((*)(int *))())" + } + ] + }, + { + "name": "tinterrel_tspatial_tspatial", + "file": "tgeo_tempspatialrels.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "tinter", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tdwithin_tspatial_tspatial", + "file": "tgeo_tempspatialrels.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "sync1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "sync2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "dist", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "func", + "cType": "datum_func3", + "canonical": "int (*)(int ((*)(int *))(), int ((*)(int *))(), int ((*)(int *))())" + }, + { + "name": "tpfn", + "cType": "tpfunc_temp", + "canonical": "int (*)(int ((*)(int *))(), int ((*)(int *))(), int ((*)(int *))(), int ((*)(int *))(), int ((*)(int *))(), long, long, long *, long *)" + } + ] + }, + { + "name": "tdwithin_add_solutions", + "file": "tgeo_tempspatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "solutions", + "cType": "int", + "canonical": "int" + }, + { + "name": "lower", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "upper", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "lower_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "upper_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "upper_inc1", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "t1", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "t2", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "instants", + "cType": "TInstant **", + "canonical": "struct TInstant **" + }, + { + "name": "result", + "cType": "TSequence **", + "canonical": "struct TSequence **" + } + ] + }, + { + "name": "tdwithin_tspatial_spatial", + "file": "tgeo_tempspatialrels.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "base", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "dist", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "func", + "cType": "datum_func3", + "canonical": "int (*)(int ((*)(int *))(), int ((*)(int *))(), int ((*)(int *))())" + }, + { + "name": "tpfn", + "cType": "tpfunc_temp", + "canonical": "int (*)(int ((*)(int *))(), int ((*)(int *))(), int ((*)(int *))(), int ((*)(int *))(), int ((*)(int *))(), long, long, long *, long *)" + } + ] + }, + { + "name": "bitmatrix_make", + "file": "tgeo_tile.h", + "returnType": { + "c": "BitMatrix *", + "canonical": "BitMatrix *" + }, + "params": [ + { + "name": "count", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "ndims", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "tpoint_set_tiles", + "file": "tgeo_tile.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "state", + "cType": "const STboxGridState *", + "canonical": "const struct STboxGridState *" + }, + { + "name": "bm", + "cType": "BitMatrix *", + "canonical": "BitMatrix *" + } + ] + }, + { + "name": "tpoint_at_tile", + "file": "tgeo_tile.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + } + ] + }, + { + "name": "stbox_tile_state_set", + "file": "tgeo_tile.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "x", + "cType": "double", + "canonical": "double" + }, + { + "name": "y", + "cType": "double", + "canonical": "double" + }, + { + "name": "z", + "cType": "double", + "canonical": "double" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "xsize", + "cType": "double", + "canonical": "double" + }, + { + "name": "ysize", + "cType": "double", + "canonical": "double" + }, + { + "name": "zsize", + "cType": "double", + "canonical": "double" + }, + { + "name": "tunits", + "cType": "int64", + "canonical": "long" + }, + { + "name": "hasx", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "hasz", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "hast", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "srid", + "cType": "int32", + "canonical": "int" + }, + { + "name": "result", + "cType": "STBox *", + "canonical": "struct STBox *" + } + ] + }, + { + "name": "stbox_tile_state_make", + "file": "tgeo_tile.h", + "returnType": { + "c": "STboxGridState *", + "canonical": "struct STboxGridState *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "xsize", + "cType": "double", + "canonical": "double" + }, + { + "name": "ysize", + "cType": "double", + "canonical": "double" + }, + { + "name": "zsize", + "cType": "double", + "canonical": "double" + }, + { + "name": "duration", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "sorigin", + "cType": "int", + "canonical": "int" + }, + { + "name": "torigin", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "border_inc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "stbox_tile_state_next", + "file": "tgeo_tile.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "state", + "cType": "STboxGridState *", + "canonical": "struct STboxGridState *" + } + ] + }, + { + "name": "stbox_tile_state_get", + "file": "tgeo_tile.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "state", + "cType": "STboxGridState *", + "canonical": "struct STboxGridState *" + }, + { + "name": "box", + "cType": "STBox *", + "canonical": "struct STBox *" + } + ] + }, + { + "name": "tgeo_space_time_tile_init", + "file": "tgeo_tile.h", + "returnType": { + "c": "STboxGridState *", + "canonical": "struct STboxGridState *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "xsize", + "cType": "double", + "canonical": "double" + }, + { + "name": "ysize", + "cType": "double", + "canonical": "double" + }, + { + "name": "zsize", + "cType": "double", + "canonical": "double" + }, + { + "name": "duration", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "sorigin", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "torigin", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "bitmatrix", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "border_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "ntiles", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "stbox_space_time_tile", + "file": "tgeo_tile.h", + "returnType": { + "c": "STBox *", + "canonical": "struct STBox *" + }, + "params": [ + { + "name": "point", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "xsize", + "cType": "double", + "canonical": "double" + }, + { + "name": "ysize", + "cType": "double", + "canonical": "double" + }, + { + "name": "zsize", + "cType": "double", + "canonical": "double" + }, + { + "name": "duration", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "sorigin", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "torigin", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "hasx", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "hast", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "create_trip", + "file": "tpoint_datagen.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "lines", + "cType": "int **", + "canonical": "int **" + }, + { + "name": "maxSpeeds", + "cType": "const double *", + "canonical": "const double *" + }, + { + "name": "categories", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "noEdges", + "cType": "uint32_t", + "canonical": "unsigned int" + }, + { + "name": "startTime", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "disturbData", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "verbosity", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "spatialarr_wkt_out", + "file": "tspatial.h", + "returnType": { + "c": "char **", + "canonical": "char **" + }, + "params": [ + { + "name": "spatialarr", + "cType": "Datum *", + "canonical": "int ((*)(int *))()" + }, + { + "name": "basetype", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + }, + { + "name": "extended", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "spatialbase_as_text", + "file": "tspatial.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "spatialbase_as_ewkt", + "file": "tspatial.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "point_transf_pj", + "file": "tspatial.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "gs", + "cType": "int *", + "canonical": "int *" + }, + { + "name": "srid_to", + "cType": "int32_t", + "canonical": "int" + }, + { + "name": "pj", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "tgeoinst_set_stbox", + "file": "tspatial_boxops.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const struct TInstant *" + }, + { + "name": "box", + "cType": "STBox *", + "canonical": "struct STBox *" + } + ] + }, + { + "name": "tgeoinstarr_set_stbox", + "file": "tspatial_boxops.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "instants", + "cType": "TInstant **", + "canonical": "struct TInstant **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "box", + "cType": "STBox *", + "canonical": "struct STBox *" + } + ] + }, + { + "name": "tgeoseq_expand_stbox", + "file": "tspatial_boxops.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "seq", + "cType": "TSequence *", + "canonical": "struct TSequence *" + }, + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const struct TInstant *" + } + ] + }, + { + "name": "tspatialinst_set_stbox", + "file": "tspatial_boxops.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const struct TInstant *" + }, + { + "name": "box", + "cType": "STBox *", + "canonical": "struct STBox *" + } + ] + }, + { + "name": "tspatialinstarr_set_stbox", + "file": "tspatial_boxops.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "instants", + "cType": "TInstant **", + "canonical": "struct TInstant **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "lower_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "upper_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + }, + { + "name": "box", + "cType": "void *", + "canonical": "void *" + } + ] + }, + { + "name": "tspatialseqarr_set_stbox", + "file": "tspatial_boxops.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "sequences", + "cType": "TSequence **", + "canonical": "struct TSequence **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "box", + "cType": "STBox *", + "canonical": "struct STBox *" + } + ] + }, + { + "name": "tspatialseq_expand_stbox", + "file": "tspatial_boxops.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "seq", + "cType": "TSequence *", + "canonical": "struct TSequence *" + }, + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const struct TInstant *" + } + ] + }, + { + "name": "spatialarr_set_bbox", + "file": "tspatial_boxops.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "values", + "cType": "Datum *", + "canonical": "int ((*)(int *))()" + }, + { + "name": "basetype", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "box", + "cType": "void *", + "canonical": "void *" + } + ] + }, + { + "name": "boxop_tspatial_stbox", + "file": "tspatial_boxops.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "func", + "cType": "bool (*)(const STBox *, const STBox *)", + "canonical": "_Bool (*)(const struct _Bool ()( STBox , STBox ) *, const struct _Bool ()( STBox , STBox ) *)" + }, + { + "name": "invert", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "boxop_tspatial_tspatial", + "file": "tspatial_boxops.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "func", + "cType": "bool (*)(const STBox *, const STBox *)", + "canonical": "_Bool (*)(const struct _Bool ()( STBox , STBox ) *, const struct _Bool ()( STBox , STBox ) *)" + } + ] + }, + { + "name": "srid_parse", + "file": "tspatial_parser.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "str", + "cType": "const char **", + "canonical": "const char **" + }, + { + "name": "srid", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "spatial_parse_elem", + "file": "tspatial_parser.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "str", + "cType": "const char **", + "canonical": "const char **" + }, + { + "name": "temptype", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "delim", + "cType": "char", + "canonical": "char" + }, + { + "name": "temp_srid", + "cType": "int *", + "canonical": "int *" + }, + { + "name": "result", + "cType": "Datum *", + "canonical": "int ((*)(int *))()" + } + ] + }, + { + "name": "geo_parse", + "file": "tspatial_parser.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "str", + "cType": "const char **", + "canonical": "const char **" + }, + { + "name": "basetype", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "delim", + "cType": "char", + "canonical": "char" + }, + { + "name": "srid", + "cType": "int *", + "canonical": "int *" + }, + { + "name": "result", + "cType": "int **", + "canonical": "int **" + } + ] + }, + { + "name": "stbox_parse", + "file": "tspatial_parser.h", + "returnType": { + "c": "STBox *", + "canonical": "struct STBox *" + }, + "params": [ + { + "name": "str", + "cType": "const char **", + "canonical": "const char **" + } + ] + }, + { + "name": "tpoint_parse", + "file": "tspatial_parser.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "str", + "cType": "const char **", + "canonical": "const char **" + }, + { + "name": "temptype", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "tspatialinst_parse", + "file": "tspatial_parser.h", + "returnType": { + "c": "TInstant *", + "canonical": "struct TInstant *" + }, + "params": [ + { + "name": "str", + "cType": "const char **", + "canonical": "const char **" + }, + { + "name": "temptype", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "end", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "temp_srid", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tspatialseq_disc_parse", + "file": "tspatial_parser.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "str", + "cType": "const char **", + "canonical": "const char **" + }, + { + "name": "temptype", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "temp_srid", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tspatialseq_cont_parse", + "file": "tspatial_parser.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "str", + "cType": "const char **", + "canonical": "const char **" + }, + { + "name": "temptype", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + }, + { + "name": "end", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "temp_srid", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tspatialseqset_parse", + "file": "tspatial_parser.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "str", + "cType": "const char **", + "canonical": "const char **" + }, + { + "name": "temptype", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + }, + { + "name": "temp_srid", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tspatial_parse", + "file": "tspatial_parser.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "str", + "cType": "const char **", + "canonical": "const char **" + }, + { + "name": "temptype", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "h3_are_neighbor_cells_meos", + "file": "h3_generated.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "origin", + "cType": "H3Index", + "canonical": "unsigned long" + }, + { + "name": "destination", + "cType": "H3Index", + "canonical": "unsigned long" + } + ] + }, + { + "name": "h3_cells_to_directed_edge_meos", + "file": "h3_generated.h", + "returnType": { + "c": "H3Index", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "origin", + "cType": "H3Index", + "canonical": "unsigned long" + }, + { + "name": "destination", + "cType": "H3Index", + "canonical": "unsigned long" + } + ] + }, + { + "name": "h3_is_valid_directed_edge_meos", + "file": "h3_generated.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "edge", + "cType": "H3Index", + "canonical": "unsigned long" + } + ] + }, + { + "name": "h3_get_directed_edge_origin_meos", + "file": "h3_generated.h", + "returnType": { + "c": "H3Index", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "edge", + "cType": "H3Index", + "canonical": "unsigned long" + } + ] + }, + { + "name": "h3_get_directed_edge_destination_meos", + "file": "h3_generated.h", + "returnType": { + "c": "H3Index", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "edge", + "cType": "H3Index", + "canonical": "unsigned long" + } + ] + }, + { + "name": "h3_cell_to_parent_meos", + "file": "h3_generated.h", + "returnType": { + "c": "H3Index", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "origin", + "cType": "H3Index", + "canonical": "unsigned long" + }, + { + "name": "resolution", + "cType": "int32", + "canonical": "int" + } + ] + }, + { + "name": "h3_cell_to_center_child_meos", + "file": "h3_generated.h", + "returnType": { + "c": "H3Index", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "origin", + "cType": "H3Index", + "canonical": "unsigned long" + }, + { + "name": "resolution", + "cType": "int32", + "canonical": "int" + } + ] + }, + { + "name": "h3_cell_to_child_pos_meos", + "file": "h3_generated.h", + "returnType": { + "c": "int64", + "canonical": "long" + }, + "params": [ + { + "name": "child", + "cType": "H3Index", + "canonical": "unsigned long" + }, + { + "name": "parentRes", + "cType": "int32", + "canonical": "int" + } + ] + }, + { + "name": "h3_child_pos_to_cell_meos", + "file": "h3_generated.h", + "returnType": { + "c": "H3Index", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "childPos", + "cType": "int64", + "canonical": "long" + }, + { + "name": "parent", + "cType": "H3Index", + "canonical": "unsigned long" + }, + { + "name": "childRes", + "cType": "int32", + "canonical": "int" + } + ] + }, + { + "name": "h3_get_resolution_meos", + "file": "h3_generated.h", + "returnType": { + "c": "int32", + "canonical": "int" + }, + "params": [ + { + "name": "hex", + "cType": "H3Index", + "canonical": "unsigned long" + } + ] + }, + { + "name": "h3_get_base_cell_number_meos", + "file": "h3_generated.h", + "returnType": { + "c": "int32", + "canonical": "int" + }, + "params": [ + { + "name": "hex", + "cType": "H3Index", + "canonical": "unsigned long" + } + ] + }, + { + "name": "h3_is_valid_cell_meos", + "file": "h3_generated.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "hex", + "cType": "H3Index", + "canonical": "unsigned long" + } + ] + }, + { + "name": "h3_is_res_class_iii_meos", + "file": "h3_generated.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "hex", + "cType": "H3Index", + "canonical": "unsigned long" + } + ] + }, + { + "name": "h3_is_pentagon_meos", + "file": "h3_generated.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "hex", + "cType": "H3Index", + "canonical": "unsigned long" + } + ] + }, + { + "name": "h3_get_num_cells_meos", + "file": "h3_generated.h", + "returnType": { + "c": "int64", + "canonical": "long" + }, + "params": [ + { + "name": "resolution", + "cType": "int32", + "canonical": "int" + } + ] + }, + { + "name": "h3_grid_distance_meos", + "file": "h3_generated.h", + "returnType": { + "c": "int64", + "canonical": "long" + }, + "params": [ + { + "name": "originIndex", + "cType": "H3Index", + "canonical": "unsigned long" + }, + { + "name": "h3Index", + "cType": "H3Index", + "canonical": "unsigned long" + } + ] + }, + { + "name": "h3_cell_to_vertex_meos", + "file": "h3_generated.h", + "returnType": { + "c": "H3Index", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "cell", + "cType": "H3Index", + "canonical": "unsigned long" + }, + { + "name": "vertexNum", + "cType": "int32", + "canonical": "int" + } + ] + }, + { + "name": "h3_is_valid_vertex_meos", + "file": "h3_generated.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "vertex", + "cType": "H3Index", + "canonical": "unsigned long" + } + ] + }, + { + "name": "h3index_in", + "file": "h3index.h", + "returnType": { + "c": "H3Index", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "h3index_out", + "file": "h3index.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "cell", + "cType": "H3Index", + "canonical": "unsigned long" + } + ] + }, + { + "name": "h3index_eq", + "file": "h3index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "a", + "cType": "H3Index", + "canonical": "unsigned long" + }, + { + "name": "b", + "cType": "H3Index", + "canonical": "unsigned long" + } + ] + }, + { + "name": "h3index_ne", + "file": "h3index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "a", + "cType": "H3Index", + "canonical": "unsigned long" + }, + { + "name": "b", + "cType": "H3Index", + "canonical": "unsigned long" + } + ] + }, + { + "name": "h3index_lt", + "file": "h3index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "a", + "cType": "H3Index", + "canonical": "unsigned long" + }, + { + "name": "b", + "cType": "H3Index", + "canonical": "unsigned long" + } + ] + }, + { + "name": "h3index_le", + "file": "h3index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "a", + "cType": "H3Index", + "canonical": "unsigned long" + }, + { + "name": "b", + "cType": "H3Index", + "canonical": "unsigned long" + } + ] + }, + { + "name": "h3index_gt", + "file": "h3index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "a", + "cType": "H3Index", + "canonical": "unsigned long" + }, + { + "name": "b", + "cType": "H3Index", + "canonical": "unsigned long" + } + ] + }, + { + "name": "h3index_ge", + "file": "h3index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "a", + "cType": "H3Index", + "canonical": "unsigned long" + }, + { + "name": "b", + "cType": "H3Index", + "canonical": "unsigned long" + } + ] + }, + { + "name": "h3index_cmp", + "file": "h3index.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "a", + "cType": "H3Index", + "canonical": "unsigned long" + }, + { + "name": "b", + "cType": "H3Index", + "canonical": "unsigned long" + } + ] + }, + { + "name": "h3index_hash", + "file": "h3index.h", + "returnType": { + "c": "uint32", + "canonical": "unsigned int" + }, + "params": [ + { + "name": "cell", + "cType": "H3Index", + "canonical": "unsigned long" + } + ] + }, + { + "name": "h3_grid_disk", + "file": "h3index_sets.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "origin", + "cType": "H3Index", + "canonical": "unsigned long" + }, + { + "name": "k", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "h3_grid_ring", + "file": "h3index_sets.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "origin", + "cType": "H3Index", + "canonical": "unsigned long" + }, + { + "name": "k", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "h3_grid_path_cells", + "file": "h3index_sets.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "start", + "cType": "H3Index", + "canonical": "unsigned long" + }, + { + "name": "end", + "cType": "H3Index", + "canonical": "unsigned long" + } + ] + }, + { + "name": "h3_cell_to_children", + "file": "h3index_sets.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "origin", + "cType": "H3Index", + "canonical": "unsigned long" + }, + { + "name": "childRes", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "h3_compact_cells", + "file": "h3index_sets.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "cells", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "h3_uncompact_cells", + "file": "h3index_sets.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "cells", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "res", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "h3_origin_to_directed_edges", + "file": "h3index_sets.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "origin", + "cType": "H3Index", + "canonical": "unsigned long" + } + ] + }, + { + "name": "h3_cell_to_vertexes", + "file": "h3index_sets.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "cell", + "cType": "H3Index", + "canonical": "unsigned long" + } + ] + }, + { + "name": "h3_get_icosahedron_faces", + "file": "h3index_sets.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "cell", + "cType": "H3Index", + "canonical": "unsigned long" + } + ] + }, + { + "name": "ensure_valid_th3index_th3index", + "file": "th3index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ensure_valid_th3index_h3index", + "file": "th3index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "cell", + "cType": "H3Index", + "canonical": "unsigned long" + } + ] + }, + { + "name": "ensure_valid_th3index_tgeogpoint", + "file": "th3index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "datum2_h3index_eq", + "file": "th3index.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "d1", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "d2", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "datum2_h3index_ne", + "file": "th3index.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "d1", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "d2", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "h3index_set_stbox", + "file": "th3index_boxops.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "cell", + "cType": "H3Index", + "canonical": "unsigned long" + }, + { + "name": "box", + "cType": "STBox *", + "canonical": "struct STBox *" + } + ] + }, + { + "name": "h3indexarr_set_stbox", + "file": "th3index_boxops.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "values", + "cType": "Datum *", + "canonical": "int ((*)(int *))()" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "box", + "cType": "STBox *", + "canonical": "struct STBox *" + } + ] + }, + { + "name": "th3indexinst_set_stbox", + "file": "th3index_boxops.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const struct TInstant *" + }, + { + "name": "box", + "cType": "STBox *", + "canonical": "struct STBox *" + } + ] + }, + { + "name": "th3indexinstarr_set_stbox", + "file": "th3index_boxops.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "instants", + "cType": "TInstant **", + "canonical": "struct TInstant **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "box", + "cType": "STBox *", + "canonical": "struct STBox *" + } + ] + }, + { + "name": "th3indexseq_expand_stbox", + "file": "th3index_boxops.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const struct TInstant *" + } + ] + }, + { + "name": "h3_gs_point_to_cell", + "file": "th3index_internal.h", + "returnType": { + "c": "H3Index", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "point", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "resolution", + "cType": "int32", + "canonical": "int" + } + ] + }, + { + "name": "h3_cell_to_gs_point", + "file": "th3index_internal.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "cell", + "cType": "H3Index", + "canonical": "unsigned long" + } + ] + }, + { + "name": "h3_cell_to_gs_boundary", + "file": "th3index_internal.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "cell", + "cType": "H3Index", + "canonical": "unsigned long" + } + ] + }, + { + "name": "cell_boundary_to_gs", + "file": "th3index_internal.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "bnd", + "cType": "const CellBoundary *", + "canonical": "const CellBoundary *" + } + ] + }, + { + "name": "h3_sample_step_deg", + "file": "th3index_internal.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "resolution", + "cType": "int32", + "canonical": "int" + } + ] + }, + { + "name": "h3_latlng_deg_to_cell", + "file": "th3index_internal.h", + "returnType": { + "c": "H3Index", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "lat_deg", + "cType": "double", + "canonical": "double" + }, + { + "name": "lng_deg", + "cType": "double", + "canonical": "double" + }, + { + "name": "resolution", + "cType": "int32", + "canonical": "int" + } + ] + }, + { + "name": "h3_cell_to_parent_next_meos", + "file": "th3index_internal.h", + "returnType": { + "c": "H3Index", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "cell", + "cType": "H3Index", + "canonical": "unsigned long" + } + ] + }, + { + "name": "h3_cell_to_center_child_next_meos", + "file": "th3index_internal.h", + "returnType": { + "c": "H3Index", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "cell", + "cType": "H3Index", + "canonical": "unsigned long" + } + ] + }, + { + "name": "h3_directed_edge_to_gs_boundary", + "file": "th3index_internal.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "edge", + "cType": "H3Index", + "canonical": "unsigned long" + } + ] + }, + { + "name": "h3_vertex_to_gs_point", + "file": "th3index_internal.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "vertex", + "cType": "H3Index", + "canonical": "unsigned long" + } + ] + }, + { + "name": "h3_cell_to_local_ij_meos", + "file": "th3index_internal.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "origin", + "cType": "H3Index", + "canonical": "unsigned long" + }, + { + "name": "cell", + "cType": "H3Index", + "canonical": "unsigned long" + } + ] + }, + { + "name": "h3_local_ij_to_cell_meos", + "file": "th3index_internal.h", + "returnType": { + "c": "H3Index", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "origin", + "cType": "H3Index", + "canonical": "unsigned long" + }, + { + "name": "coord", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "h3_unit_from_cstring", + "file": "th3index_internal.h", + "returnType": { + "c": "H3Unit", + "canonical": "H3Unit" + }, + "params": [ + { + "name": "unit", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "h3_cell_area_meos", + "file": "th3index_internal.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "cell", + "cType": "H3Index", + "canonical": "unsigned long" + }, + { + "name": "unit", + "cType": "H3Unit", + "canonical": "H3Unit" + } + ] + }, + { + "name": "h3_edge_length_meos", + "file": "th3index_internal.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "edge", + "cType": "H3Index", + "canonical": "unsigned long" + }, + { + "name": "unit", + "cType": "H3Unit", + "canonical": "H3Unit" + } + ] + }, + { + "name": "h3_gs_great_circle_distance_meos", + "file": "th3index_internal.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "a", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "b", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "unit", + "cType": "H3Unit", + "canonical": "H3Unit" + } + ] + }, + { + "name": "datum_h3_get_resolution", + "file": "th3index_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "d", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_h3_get_base_cell_number", + "file": "th3index_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "d", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_h3_is_valid_cell", + "file": "th3index_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "d", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_h3_is_res_class_iii", + "file": "th3index_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "d", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_h3_is_pentagon", + "file": "th3index_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "d", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_h3_cell_to_parent", + "file": "th3index_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "cell_d", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "res_d", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_h3_cell_to_parent_next", + "file": "th3index_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "cell_d", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_h3_cell_to_center_child", + "file": "th3index_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "cell_d", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "res_d", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_h3_cell_to_center_child_next", + "file": "th3index_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "cell_d", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_h3_cell_to_child_pos", + "file": "th3index_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "cell_d", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "parent_res_d", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_h3_child_pos_to_cell", + "file": "th3index_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "pos_d", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "parent_d", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "child_res_d", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_h3_are_neighbor_cells", + "file": "th3index_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "origin_d", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "dest_d", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_h3_cells_to_directed_edge", + "file": "th3index_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "origin_d", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "dest_d", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_h3_is_valid_directed_edge", + "file": "th3index_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "d", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_h3_get_directed_edge_origin", + "file": "th3index_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "d", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_h3_get_directed_edge_destination", + "file": "th3index_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "d", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_h3_directed_edge_to_boundary", + "file": "th3index_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "d", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_h3_cell_to_vertex", + "file": "th3index_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "cell_d", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "vnum_d", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_h3_vertex_to_latlng", + "file": "th3index_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "d", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_h3_is_valid_vertex", + "file": "th3index_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "d", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_h3_grid_distance", + "file": "th3index_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "origin_d", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "dest_d", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_h3_cell_to_local_ij", + "file": "th3index_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "origin_d", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "cell_d", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_h3_local_ij_to_cell", + "file": "th3index_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "origin_d", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "coord_d", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_h3_latlng_to_cell", + "file": "th3index_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "point_d", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "res_d", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_h3_cell_to_latlng", + "file": "th3index_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "d", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_h3_cell_to_boundary", + "file": "th3index_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "d", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_h3_cell_area", + "file": "th3index_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "cell_d", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "unit_d", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_h3_edge_length", + "file": "th3index_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "edge_d", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "unit_d", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_h3_great_circle_distance", + "file": "th3index_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "a_d", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "b_d", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "unit_d", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "json_in", + "file": "meos_json.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "json_out", + "file": "meos_json.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "js", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "jsonb_from_text", + "file": "meos_json.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "txt", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "unique_keys", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "jsonb_in", + "file": "meos_json.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "jsonb_out", + "file": "meos_json.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "json_make", + "file": "meos_json.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "keys_vals", + "cType": "int **", + "canonical": "int **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "json_make_two_arg", + "file": "meos_json.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "keys", + "cType": "int **", + "canonical": "int **" + }, + { + "name": "values", + "cType": "int **", + "canonical": "int **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "jsonb_copy", + "file": "meos_json.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "jsonb_make", + "file": "meos_json.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "keys_vals", + "cType": "int **", + "canonical": "int **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "jsonb_make_two_arg", + "file": "meos_json.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "keys", + "cType": "int **", + "canonical": "int **" + }, + { + "name": "values", + "cType": "int **", + "canonical": "int **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "jsonb_to_bool", + "file": "meos_json.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "jsonb_to_cstring", + "file": "meos_json.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "jsonb_to_float4", + "file": "meos_json.h", + "returnType": { + "c": "float4", + "canonical": "float" + }, + "params": [ + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "jsonb_to_float8", + "file": "meos_json.h", + "returnType": { + "c": "float8", + "canonical": "double" + }, + "params": [ + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "jsonb_to_int16", + "file": "meos_json.h", + "returnType": { + "c": "int16", + "canonical": "short" + }, + "params": [ + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "jsonb_to_int32", + "file": "meos_json.h", + "returnType": { + "c": "int32", + "canonical": "int" + }, + "params": [ + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "jsonb_to_int64", + "file": "meos_json.h", + "returnType": { + "c": "int64", + "canonical": "long" + }, + "params": [ + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "jsonb_to_numeric", + "file": "meos_json.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "jsonb_to_text", + "file": "meos_json.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "json_array_element", + "file": "meos_json.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "js", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "element", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "json_array_element_text", + "file": "meos_json.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "js", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "element", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "json_array_elements", + "file": "meos_json.h", + "returnType": { + "c": "int **", + "canonical": "int **" + }, + "params": [ + { + "name": "js", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "json_array_elements_text", + "file": "meos_json.h", + "returnType": { + "c": "int **", + "canonical": "int **" + }, + "params": [ + { + "name": "js", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "json_array_length", + "file": "meos_json.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "js", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "json_each", + "file": "meos_json.h", + "returnType": { + "c": "int **", + "canonical": "int **" + }, + "params": [ + { + "name": "js", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "values", + "cType": "int **", + "canonical": "int **" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "json_each_text", + "file": "meos_json.h", + "returnType": { + "c": "int **", + "canonical": "int **" + }, + "params": [ + { + "name": "js", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "values", + "cType": "int **", + "canonical": "int **" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "json_extract_path", + "file": "meos_json.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "js", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "path_elems", + "cType": "int **", + "canonical": "int **" + }, + { + "name": "path_len", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "json_extract_path_text", + "file": "meos_json.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "js", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "path_elems", + "cType": "int **", + "canonical": "int **" + }, + { + "name": "path_len", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "json_object_field", + "file": "meos_json.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "js", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "key", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "json_object_field_text", + "file": "meos_json.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "js", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "key", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "json_object_keys", + "file": "meos_json.h", + "returnType": { + "c": "int **", + "canonical": "int **" + }, + "params": [ + { + "name": "js", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "json_typeof", + "file": "meos_json.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "js", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "jsonb_array_element", + "file": "meos_json.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "element", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "jsonb_array_element_text", + "file": "meos_json.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "element", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "jsonb_array_elements", + "file": "meos_json.h", + "returnType": { + "c": "int **", + "canonical": "int **" + }, + "params": [ + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "jsonb_array_elements_text", + "file": "meos_json.h", + "returnType": { + "c": "int **", + "canonical": "int **" + }, + "params": [ + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "jsonb_array_length", + "file": "meos_json.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "jsonb_contained", + "file": "meos_json.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "jb1", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "jb2", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "jsonb_contains", + "file": "meos_json.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "jb1", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "jb2", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "jsonb_each", + "file": "meos_json.h", + "returnType": { + "c": "int **", + "canonical": "int **" + }, + "params": [ + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "values", + "cType": "int **", + "canonical": "int **" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "jsonb_each_text", + "file": "meos_json.h", + "returnType": { + "c": "int **", + "canonical": "int **" + }, + "params": [ + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "values", + "cType": "int **", + "canonical": "int **" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "jsonb_exists", + "file": "meos_json.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "key", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "jsonb_exists_array", + "file": "meos_json.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "keys_elems", + "cType": "int **", + "canonical": "int **" + }, + { + "name": "keys_len", + "cType": "int", + "canonical": "int" + }, + { + "name": "any", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "jsonb_extract_path", + "file": "meos_json.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "path_elems", + "cType": "int **", + "canonical": "int **" + }, + { + "name": "path_len", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "jsonb_extract_path_text", + "file": "meos_json.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "path_elems", + "cType": "int **", + "canonical": "int **" + }, + { + "name": "path_len", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "jsonb_hash", + "file": "meos_json.h", + "returnType": { + "c": "uint32", + "canonical": "unsigned int" + }, + "params": [ + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "jsonb_hash_extended", + "file": "meos_json.h", + "returnType": { + "c": "uint64", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "seed", + "cType": "uint64", + "canonical": "unsigned long" + } + ] + }, + { + "name": "jsonb_object_field", + "file": "meos_json.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "key", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "jsonb_object_field_text", + "file": "meos_json.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "key", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "jsonb_object_keys", + "file": "meos_json.h", + "returnType": { + "c": "int **", + "canonical": "int **" + }, + "params": [ + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "json_strip_nulls", + "file": "meos_json.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "js", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "strip_in_arrays", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "jsonb_concat", + "file": "meos_json.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "jb1", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "jb2", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "jsonb_delete", + "file": "meos_json.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "key", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "jsonb_delete_array", + "file": "meos_json.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "keys_elems", + "cType": "int **", + "canonical": "int **" + }, + { + "name": "keys_len", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "jsonb_delete_index", + "file": "meos_json.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "idx", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "jsonb_delete_path", + "file": "meos_json.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "path_elems", + "cType": "int **", + "canonical": "int **" + }, + { + "name": "path_len", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "jsonb_insert", + "file": "meos_json.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "path_elems", + "cType": "int **", + "canonical": "int **" + }, + { + "name": "path_len", + "cType": "int", + "canonical": "int" + }, + { + "name": "newjb", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "after", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "jsonb_pretty", + "file": "meos_json.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "jsonb_set", + "file": "meos_json.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "path_elems", + "cType": "int **", + "canonical": "int **" + }, + { + "name": "path_len", + "cType": "int", + "canonical": "int" + }, + { + "name": "newjb", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "create", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "jsonb_set_lax", + "file": "meos_json.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "path_elems", + "cType": "int **", + "canonical": "int **" + }, + { + "name": "path_len", + "cType": "int", + "canonical": "int" + }, + { + "name": "newjb", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "create", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "handle_null", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "jsonb_strip_nulls", + "file": "meos_json.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "strip_in_arrays", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "jsonb_cmp", + "file": "meos_json.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "jb1", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "jb2", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "jsonb_eq", + "file": "meos_json.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "jb1", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "jb2", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "jsonb_ge", + "file": "meos_json.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "jb1", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "jb2", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "jsonb_gt", + "file": "meos_json.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "jb1", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "jb2", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "jsonb_le", + "file": "meos_json.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "jb1", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "jb2", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "jsonb_lt", + "file": "meos_json.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "jb1", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "jb2", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "jsonb_ne", + "file": "meos_json.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "jb1", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "jb2", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "jsonb_path_exists", + "file": "meos_json.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "jp", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "vars", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "silent", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "tz", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "jsonb_path_match", + "file": "meos_json.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "jp", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "vars", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "silent", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "tz", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "jsonb_path_query_all", + "file": "meos_json.h", + "returnType": { + "c": "int **", + "canonical": "int **" + }, + "params": [ + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "jp", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "vars", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "silent", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "tz", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "jsonb_path_query_array", + "file": "meos_json.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "jp", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "vars", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "silent", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "tz", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "jsonb_path_query_first", + "file": "meos_json.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "jp", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "vars", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "silent", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "tz", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "jsonpath_in", + "file": "meos_json.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "jsonpath_copy", + "file": "meos_json.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "jp", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "jsonpath_out", + "file": "meos_json.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "jp", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "jsonbset_in", + "file": "meos_json.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "jsonbset_out", + "file": "meos_json.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "jsonbset_make", + "file": "meos_json.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "values", + "cType": "const int **", + "canonical": "const int **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "jsonb_to_set", + "file": "meos_json.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "jsonbset_end_value", + "file": "meos_json.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "jsonbset_start_value", + "file": "meos_json.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "jsonbset_value_n", + "file": "meos_json.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "n", + "cType": "int", + "canonical": "int" + }, + { + "name": "result", + "cType": "int **", + "canonical": "int **" + } + ] + }, + { + "name": "jsonbset_values", + "file": "meos_json.h", + "returnType": { + "c": "int **", + "canonical": "int **" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "concat_jsonbset_jsonb", + "file": "meos_json.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "invert", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "jsonbset_array_length", + "file": "meos_json.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "set", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "jsonbset_object_field", + "file": "meos_json.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "set", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "key", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "astext", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "null_handle", + "cType": "nullHandleType", + "canonical": "nullHandleType" + } + ] + }, + { + "name": "jsonbset_array_element", + "file": "meos_json.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "set", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "idx", + "cType": "int", + "canonical": "int" + }, + { + "name": "astext", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "null_handle", + "cType": "nullHandleType", + "canonical": "nullHandleType" + } + ] + }, + { + "name": "jsonbset_delete_index", + "file": "meos_json.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "set", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "idx", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "jsonbset_delete", + "file": "meos_json.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "set", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "key", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "jsonbset_delete_array", + "file": "meos_json.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "set", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "keys", + "cType": "int **", + "canonical": "int **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "jsonbset_exists", + "file": "meos_json.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "set", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "key", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "jsonbset_exists_array", + "file": "meos_json.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "set", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "keys", + "cType": "int **", + "canonical": "int **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "any", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "jsonbset_set", + "file": "meos_json.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "set", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "keys", + "cType": "int **", + "canonical": "int **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "newjb", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "create", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "null_handle", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "lax", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "jsonbset_to_alphanumset", + "file": "meos_json.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "set", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "key", + "cType": "const char *", + "canonical": "const char *" + }, + { + "name": "settype", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "null_handle", + "cType": "nullHandleType", + "canonical": "nullHandleType" + } + ] + }, + { + "name": "jsonbset_to_intset", + "file": "meos_json.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "set", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "key", + "cType": "const char *", + "canonical": "const char *" + }, + { + "name": "null_handle", + "cType": "nullHandleType", + "canonical": "nullHandleType" + } + ] + }, + { + "name": "jsonbset_to_floatset", + "file": "meos_json.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "set", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "key", + "cType": "const char *", + "canonical": "const char *" + }, + { + "name": "null_handle", + "cType": "nullHandleType", + "canonical": "nullHandleType" + } + ] + }, + { + "name": "jsonbset_to_textset_key", + "file": "meos_json.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "set", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "key", + "cType": "const char *", + "canonical": "const char *" + }, + { + "name": "null_handle", + "cType": "nullHandleType", + "canonical": "nullHandleType" + } + ] + }, + { + "name": "jsonbset_strip_nulls", + "file": "meos_json.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "set", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "strip_in_arrays", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "jsonbset_pretty", + "file": "meos_json.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "set", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "jsonbset_delete_path", + "file": "meos_json.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "set", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "path_elems", + "cType": "int **", + "canonical": "int **" + }, + { + "name": "path_len", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "jsonbset_extract_path", + "file": "meos_json.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "set", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "path_elems", + "cType": "int **", + "canonical": "int **" + }, + { + "name": "path_len", + "cType": "int", + "canonical": "int" + }, + { + "name": "astext", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "null_handle", + "cType": "nullHandleType", + "canonical": "nullHandleType" + } + ] + }, + { + "name": "jsonbset_insert", + "file": "meos_json.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "set", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "path_elems", + "cType": "int **", + "canonical": "int **" + }, + { + "name": "path_len", + "cType": "int", + "canonical": "int" + }, + { + "name": "newjb", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "after", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "jsonbset_path_exists", + "file": "meos_json.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "set", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "jp", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "vars", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "silent", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "tz", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "jsonbset_path_match", + "file": "meos_json.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "set", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "jp", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "vars", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "silent", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "tz", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "jsonbset_path_query_array", + "file": "meos_json.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "set", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "jp", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "vars", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "silent", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "tz", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "jsonbset_path_query_first", + "file": "meos_json.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "set", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "jp", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "vars", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "silent", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "tz", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "contained_jsonb_set", + "file": "meos_json.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "contains_set_jsonb", + "file": "meos_json.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "jb", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "intersection_jsonb_set", + "file": "meos_json.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "intersection_set_jsonb", + "file": "meos_json.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "jsonb_union_transfn", + "file": "meos_json.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "state", + "cType": "Set *", + "canonical": "Set *" + }, + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "minus_jsonb_set", + "file": "meos_json.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "minus_set_jsonb", + "file": "meos_json.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "union_jsonb_set", + "file": "meos_json.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "union_set_jsonb", + "file": "meos_json.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "tjsonb_from_mfjson", + "file": "meos_json.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "tjsonb_in", + "file": "meos_json.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "tjsonb_out", + "file": "meos_json.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tjsonbinst_from_mfjson", + "file": "meos_json.h", + "returnType": { + "c": "TInstant *", + "canonical": "struct TInstant *" + }, + "params": [ + { + "name": "mfjson", + "cType": "json_object *", + "canonical": "struct json_object *" + } + ] + }, + { + "name": "tjsonbinst_in", + "file": "meos_json.h", + "returnType": { + "c": "TInstant *", + "canonical": "struct TInstant *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "tjsonbseq_from_mfjson", + "file": "meos_json.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "mfjson", + "cType": "json_object *", + "canonical": "struct json_object *" + } + ] + }, + { + "name": "tjsonbseq_in", + "file": "meos_json.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "tjsonbseqset_from_mfjson", + "file": "meos_json.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "mfjson", + "cType": "json_object *", + "canonical": "struct json_object *" + } + ] + }, + { + "name": "tjsonbseqset_in", + "file": "meos_json.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "tjsonb_from_base_temp", + "file": "meos_json.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "jsonb", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tjsonbinst_make", + "file": "meos_json.h", + "returnType": { + "c": "TInstant *", + "canonical": "struct TInstant *" + }, + "params": [ + { + "name": "jsonb", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "tjsonbseq_from_base_tstzset", + "file": "meos_json.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "jsonb", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "tjsonbseq_from_base_tstzspan", + "file": "meos_json.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "jsonb", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "sp", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "tjsonbseqset_from_base_tstzspanset", + "file": "meos_json.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "jsonb", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "tjsonb_to_ttext", + "file": "meos_json.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ttext_to_tjsonb", + "file": "meos_json.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tjsonb_end_value", + "file": "meos_json.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tjsonb_start_value", + "file": "meos_json.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tjsonb_value_at_timestamptz", + "file": "meos_json.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "strict", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "value", + "cType": "int **", + "canonical": "int **" + } + ] + }, + { + "name": "tjsonb_value_n", + "file": "meos_json.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "n", + "cType": "int", + "canonical": "int" + }, + { + "name": "result", + "cType": "int **", + "canonical": "int **" + } + ] + }, + { + "name": "tjsonb_values", + "file": "meos_json.h", + "returnType": { + "c": "int **", + "canonical": "int **" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "concat_tjsonb_jsonb", + "file": "meos_json.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "invert", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "concat_tjsonb_tjsonb", + "file": "meos_json.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "contains_tjsonb_jsonb", + "file": "meos_json.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "invert", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "contains_tjsonb_tjsonb", + "file": "meos_json.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "null_handle_type_from_string", + "file": "meos_json.h", + "returnType": { + "c": "nullHandleType", + "canonical": "nullHandleType" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "tjson_array_element", + "file": "meos_json.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "idx", + "cType": "int", + "canonical": "int" + }, + { + "name": "null_handle", + "cType": "nullHandleType", + "canonical": "nullHandleType" + } + ] + }, + { + "name": "tjson_array_length", + "file": "meos_json.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tjson_extract_path", + "file": "meos_json.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "path_elems", + "cType": "int **", + "canonical": "int **" + }, + { + "name": "path_len", + "cType": "int", + "canonical": "int" + }, + { + "name": "null_handle", + "cType": "nullHandleType", + "canonical": "nullHandleType" + } + ] + }, + { + "name": "tjson_object_field", + "file": "meos_json.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "key", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "astext", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "null_handle", + "cType": "nullHandleType", + "canonical": "nullHandleType" + } + ] + }, + { + "name": "tjson_strip_nulls", + "file": "meos_json.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "strip_in_arrays", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tjsonb_array_element", + "file": "meos_json.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "idx", + "cType": "int", + "canonical": "int" + }, + { + "name": "astext", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "null_handle", + "cType": "nullHandleType", + "canonical": "nullHandleType" + } + ] + }, + { + "name": "tjsonb_array_length", + "file": "meos_json.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tjsonb_delete", + "file": "meos_json.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "key", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "tjsonb_delete_array", + "file": "meos_json.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "keys", + "cType": "int **", + "canonical": "int **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "tjsonb_delete_index", + "file": "meos_json.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "idx", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "tjsonb_delete_path", + "file": "meos_json.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "path_elems", + "cType": "int **", + "canonical": "int **" + }, + { + "name": "path_len", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "tjsonb_exists", + "file": "meos_json.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "key", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "tjsonb_exists_array", + "file": "meos_json.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "keys", + "cType": "int **", + "canonical": "int **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "any", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tjsonb_extract_path", + "file": "meos_json.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "path_elems", + "cType": "int **", + "canonical": "int **" + }, + { + "name": "path_len", + "cType": "int", + "canonical": "int" + }, + { + "name": "astext", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "null_handle", + "cType": "nullHandleType", + "canonical": "nullHandleType" + } + ] + }, + { + "name": "tjsonb_insert", + "file": "meos_json.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "keys", + "cType": "int **", + "canonical": "int **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "newjb", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "after", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tjsonb_object_field", + "file": "meos_json.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "key", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "astext", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "null_handle", + "cType": "nullHandleType", + "canonical": "nullHandleType" + } + ] + }, + { + "name": "tjsonb_path_exists", + "file": "meos_json.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "jp", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "vars", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "silent", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "tz", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tjsonb_path_match", + "file": "meos_json.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "jp", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "vars", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "silent", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "tz", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tjsonb_path_query_array", + "file": "meos_json.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "jp", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "vars", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "silent", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "tz", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tjsonb_path_query_first", + "file": "meos_json.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "jp", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "vars", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "silent", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "tz", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tjsonb_pretty", + "file": "meos_json.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tjsonb_set", + "file": "meos_json.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "keys", + "cType": "int **", + "canonical": "int **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "newjb", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "create", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "handle_null", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "lax", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tjsonb_strip_nulls", + "file": "meos_json.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "strip_in_arrays", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tjsonb_to_tbool", + "file": "meos_json.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "key", + "cType": "const char *", + "canonical": "const char *" + }, + { + "name": "null_handle", + "cType": "nullHandleType", + "canonical": "nullHandleType" + } + ] + }, + { + "name": "tjsonb_to_tfloat", + "file": "meos_json.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "key", + "cType": "const char *", + "canonical": "const char *" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + }, + { + "name": "null_handle", + "cType": "nullHandleType", + "canonical": "nullHandleType" + } + ] + }, + { + "name": "tjsonb_to_tint", + "file": "meos_json.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "key", + "cType": "const char *", + "canonical": "const char *" + }, + { + "name": "null_handle", + "cType": "nullHandleType", + "canonical": "nullHandleType" + } + ] + }, + { + "name": "tjsonb_to_ttext_key", + "file": "meos_json.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "key", + "cType": "const char *", + "canonical": "const char *" + }, + { + "name": "null_handle", + "cType": "nullHandleType", + "canonical": "nullHandleType" + } + ] + }, + { + "name": "tjsonb_at_value", + "file": "meos_json.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "jsb", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "tjsonb_minus_value", + "file": "meos_json.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "jsb", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "always_eq_jsonb_tjsonb", + "file": "meos_json.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_eq_tjsonb_jsonb", + "file": "meos_json.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "always_eq_tjsonb_tjsonb", + "file": "meos_json.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_ne_jsonb_tjsonb", + "file": "meos_json.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_ne_tjsonb_jsonb", + "file": "meos_json.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "always_ne_tjsonb_tjsonb", + "file": "meos_json.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_eq_jsonb_tjsonb", + "file": "meos_json.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_eq_tjsonb_jsonb", + "file": "meos_json.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "ever_eq_tjsonb_tjsonb", + "file": "meos_json.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_ne_jsonb_tjsonb", + "file": "meos_json.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_ne_tjsonb_jsonb", + "file": "meos_json.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "ever_ne_tjsonb_tjsonb", + "file": "meos_json.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "teq_jsonb_tjsonb", + "file": "meos_json.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "teq_tjsonb_jsonb", + "file": "meos_json.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "tne_jsonb_tjsonb", + "file": "meos_json.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tne_tjsonb_jsonb", + "file": "meos_json.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "setPath", + "file": "tjsonb.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "it", + "cType": "int **", + "canonical": "int **" + }, + { + "name": "path_elems", + "cType": "Datum *", + "canonical": "int ((*)(int *))()" + }, + { + "name": "path_nulls", + "cType": "bool *", + "canonical": "_Bool *" + }, + { + "name": "path_len", + "cType": "int", + "canonical": "int" + }, + { + "name": "st", + "cType": "int **", + "canonical": "int **" + }, + { + "name": "level", + "cType": "int", + "canonical": "int" + }, + { + "name": "newval", + "cType": "int *", + "canonical": "int *" + }, + { + "name": "op_type", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "setPathObject", + "file": "tjsonb.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "it", + "cType": "int **", + "canonical": "int **" + }, + { + "name": "path_elems", + "cType": "Datum *", + "canonical": "int ((*)(int *))()" + }, + { + "name": "path_nulls", + "cType": "bool *", + "canonical": "_Bool *" + }, + { + "name": "path_len", + "cType": "int", + "canonical": "int" + }, + { + "name": "st", + "cType": "int **", + "canonical": "int **" + }, + { + "name": "level", + "cType": "int", + "canonical": "int" + }, + { + "name": "newval", + "cType": "int *", + "canonical": "int *" + }, + { + "name": "npairs", + "cType": "uint32_t", + "canonical": "unsigned int" + }, + { + "name": "op_type", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "setPathArray", + "file": "tjsonb.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "it", + "cType": "int **", + "canonical": "int **" + }, + { + "name": "path_elems", + "cType": "Datum *", + "canonical": "int ((*)(int *))()" + }, + { + "name": "path_nulls", + "cType": "bool *", + "canonical": "_Bool *" + }, + { + "name": "path_len", + "cType": "int", + "canonical": "int" + }, + { + "name": "st", + "cType": "int **", + "canonical": "int **" + }, + { + "name": "level", + "cType": "int", + "canonical": "int" + }, + { + "name": "newval", + "cType": "int *", + "canonical": "int *" + }, + { + "name": "nelems", + "cType": "uint32_t", + "canonical": "unsigned int" + }, + { + "name": "op_type", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "datum_jsonb_concat", + "file": "tjsonb.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "l", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "r", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_jsonb_contained", + "file": "tjsonb.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "l", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "r", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_jsonb_contains", + "file": "tjsonb.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "l", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "r", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_jsonb_delete", + "file": "tjsonb.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "jb", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "key", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_jsonb_delete_array", + "file": "tjsonb.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "jb", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "array", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "count", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_jsonb_delete_index", + "file": "tjsonb.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "jb", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "idx", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_json_array_element", + "file": "tjsonb.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "txt", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "element", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_jsonb_array_element", + "file": "tjsonb.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "jb", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "element", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_json_array_element_text", + "file": "tjsonb.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "txt", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "element", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_jsonb_array_element_text", + "file": "tjsonb.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "jb", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "element", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_jsonb_exists", + "file": "tjsonb.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "l", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "r", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_jsonb_exists_array", + "file": "tjsonb.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "array", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "count", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "any", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_json_array_length", + "file": "tjsonb.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "txt", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_jsonb_array_length", + "file": "tjsonb.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "txt", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_json_object_field", + "file": "tjsonb.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "txt", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "key", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_jsonb_object_field", + "file": "tjsonb.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "jb", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "key", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_json_object_field_text", + "file": "tjsonb.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "txt", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "key", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_jsonb_object_field_text", + "file": "tjsonb.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "jb", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "key", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_json_strip_nulls", + "file": "tjsonb.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "txt", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "strip_in_arrays", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_jsonb_strip_nulls", + "file": "tjsonb.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "jb", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "strip_in_arrays", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_jsonb_pretty", + "file": "tjsonb.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "jb", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_json_extract_path", + "file": "tjsonb.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "txt", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "path_elems", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "path_len", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_jsonb_extract_path", + "file": "tjsonb.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "jb", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "path_elems", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "path_len", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_json_extract_path_text", + "file": "tjsonb.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "txt", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "path_elems", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "path_len", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_jsonb_extract_path_text", + "file": "tjsonb.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "jb", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "path_elems", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "path_len", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_jsonb_set", + "file": "tjsonb.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "jb", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "keys", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "count", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "newjb", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "create", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_jsonb_set_lax", + "file": "tjsonb.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "jb", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "keys", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "count", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "newjb", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "create", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "null_handle", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_jsonb_delete_path", + "file": "tjsonb.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "jb", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "keys", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "count", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_jsonb_insert", + "file": "tjsonb.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "jb", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "keys", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "count", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "newjb", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "after", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_jsonb_path_exists", + "file": "tjsonb.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "jb", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "jp", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "vars", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "silent", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "tz", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_jsonb_path_match", + "file": "tjsonb.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "jb", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "jp", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "vars", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "silent", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "tz", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_jsonb_path_query_array", + "file": "tjsonb.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "jb", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "jp", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "vars", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "silent", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "tz", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_jsonb_path_query_first", + "file": "tjsonb.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "jb", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "jp", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "vars", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "silent", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "tz", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_jsonb_to_text", + "file": "tjsonb.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "jb", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_text_to_jsonb", + "file": "tjsonb.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "txt", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_jsonb_to_alphanum", + "file": "tjsonb.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "jb", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "key", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "temptype", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "null_handle", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "tjsonb_to_talphanum", + "file": "tjsonb.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "key", + "cType": "const char *", + "canonical": "const char *" + }, + { + "name": "resbasetype", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + }, + { + "name": "null_handle", + "cType": "nullHandleType", + "canonical": "nullHandleType" + } + ] + }, + { + "name": "jsonbfunc_jsonbset", + "file": "tjsonb.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "func", + "cType": "int", + "canonical": "int" + }, + { + "name": "intype", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "restype", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "jsonbfunc_jsonbset_jsonb", + "file": "tjsonb.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "func", + "cType": "datum_func2", + "canonical": "int (*)(int ((*)(int *))(), int ((*)(int *))())" + }, + { + "name": "invert", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "jsonbfunc_jsonbset_text", + "file": "tjsonb.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "txt", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "func", + "cType": "datum_func2", + "canonical": "int (*)(int ((*)(int *))(), int ((*)(int *))())" + } + ] + }, + { + "name": "meos_temporal_to_arrow", + "file": "meos_arrow.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "out_schema", + "cType": "struct ArrowSchema *", + "canonical": "struct ArrowSchema *" + }, + { + "name": "out_array", + "cType": "struct ArrowArray *", + "canonical": "struct ArrowArray *" + } + ] + }, + { + "name": "meos_temporal_from_arrow", + "file": "meos_arrow.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "schema", + "cType": "const struct ArrowSchema *", + "canonical": "const struct ArrowSchema *" + }, + { + "name": "array", + "cType": "const struct ArrowArray *", + "canonical": "const struct ArrowArray *" + } + ] + }, + { + "name": "meos_temporal_arrow_roundtrip", + "file": "meos_arrow.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "meos_set_to_arrow", + "file": "meos_arrow.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "out_schema", + "cType": "struct ArrowSchema *", + "canonical": "struct ArrowSchema *" + }, + { + "name": "out_array", + "cType": "struct ArrowArray *", + "canonical": "struct ArrowArray *" + } + ] + }, + { + "name": "meos_set_from_arrow", + "file": "meos_arrow.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "schema", + "cType": "const struct ArrowSchema *", + "canonical": "const struct ArrowSchema *" + }, + { + "name": "array", + "cType": "const struct ArrowArray *", + "canonical": "const struct ArrowArray *" + } + ] + }, + { + "name": "meos_set_arrow_roundtrip", + "file": "meos_arrow.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "meos_span_to_arrow", + "file": "meos_arrow.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "out_schema", + "cType": "struct ArrowSchema *", + "canonical": "struct ArrowSchema *" + }, + { + "name": "out_array", + "cType": "struct ArrowArray *", + "canonical": "struct ArrowArray *" + } + ] + }, + { + "name": "meos_span_from_arrow", + "file": "meos_arrow.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "schema", + "cType": "const struct ArrowSchema *", + "canonical": "const struct ArrowSchema *" + }, + { + "name": "array", + "cType": "const struct ArrowArray *", + "canonical": "const struct ArrowArray *" + } + ] + }, + { + "name": "meos_span_arrow_roundtrip", + "file": "meos_arrow.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "meos_spanset_to_arrow", + "file": "meos_arrow.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "out_schema", + "cType": "struct ArrowSchema *", + "canonical": "struct ArrowSchema *" + }, + { + "name": "out_array", + "cType": "struct ArrowArray *", + "canonical": "struct ArrowArray *" + } + ] + }, + { + "name": "meos_spanset_from_arrow", + "file": "meos_arrow.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "schema", + "cType": "const struct ArrowSchema *", + "canonical": "const struct ArrowSchema *" + }, + { + "name": "array", + "cType": "const struct ArrowArray *", + "canonical": "const struct ArrowArray *" + } + ] + }, + { + "name": "meos_spanset_arrow_roundtrip", + "file": "meos_arrow.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "meos_tbox_to_arrow", + "file": "meos_arrow.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const struct TBox *" + }, + { + "name": "out_schema", + "cType": "struct ArrowSchema *", + "canonical": "struct ArrowSchema *" + }, + { + "name": "out_array", + "cType": "struct ArrowArray *", + "canonical": "struct ArrowArray *" + } + ] + }, + { + "name": "meos_tbox_from_arrow", + "file": "meos_arrow.h", + "returnType": { + "c": "TBox *", + "canonical": "struct TBox *" + }, + "params": [ + { + "name": "schema", + "cType": "const struct ArrowSchema *", + "canonical": "const struct ArrowSchema *" + }, + { + "name": "array", + "cType": "const struct ArrowArray *", + "canonical": "const struct ArrowArray *" + } + ] + }, + { + "name": "meos_tbox_arrow_roundtrip", + "file": "meos_arrow.h", + "returnType": { + "c": "TBox *", + "canonical": "struct TBox *" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const struct TBox *" + } + ] + }, + { + "name": "meos_stbox_to_arrow", + "file": "meos_arrow.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "out_schema", + "cType": "struct ArrowSchema *", + "canonical": "struct ArrowSchema *" + }, + { + "name": "out_array", + "cType": "struct ArrowArray *", + "canonical": "struct ArrowArray *" + } + ] + }, + { + "name": "meos_stbox_from_arrow", + "file": "meos_arrow.h", + "returnType": { + "c": "STBox *", + "canonical": "struct STBox *" + }, + "params": [ + { + "name": "schema", + "cType": "const struct ArrowSchema *", + "canonical": "const struct ArrowSchema *" + }, + { + "name": "array", + "cType": "const struct ArrowArray *", + "canonical": "const struct ArrowArray *" + } + ] + }, + { + "name": "meos_stbox_arrow_roundtrip", + "file": "meos_arrow.h", + "returnType": { + "c": "STBox *", + "canonical": "struct STBox *" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + } + ] + }, + { + "name": "th3index_in", + "file": "meos_h3.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "th3indexinst_in", + "file": "meos_h3.h", + "returnType": { + "c": "TInstant *", + "canonical": "struct TInstant *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "th3indexseq_in", + "file": "meos_h3.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "th3indexseqset_in", + "file": "meos_h3.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "th3index_make", + "file": "meos_h3.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "value", + "cType": "H3Index", + "canonical": "unsigned long" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "th3indexinst_make", + "file": "meos_h3.h", + "returnType": { + "c": "TInstant *", + "canonical": "struct TInstant *" + }, + "params": [ + { + "name": "value", + "cType": "H3Index", + "canonical": "unsigned long" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "th3indexseq_make", + "file": "meos_h3.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "values", + "cType": "const H3Index *", + "canonical": "const unsigned long *" + }, + { + "name": "times", + "cType": "const TimestampTz *", + "canonical": "const long *" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "lower_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "upper_inc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "th3indexseqset_make", + "file": "meos_h3.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "sequences", + "cType": "const TSequence **", + "canonical": "const struct TSequence **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "th3index_start_value", + "file": "meos_h3.h", + "returnType": { + "c": "H3Index", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "th3index_end_value", + "file": "meos_h3.h", + "returnType": { + "c": "H3Index", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "th3index_value_n", + "file": "meos_h3.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "n", + "cType": "int", + "canonical": "int" + }, + { + "name": "result", + "cType": "H3Index *", + "canonical": "unsigned long *" + } + ] + }, + { + "name": "th3index_values", + "file": "meos_h3.h", + "returnType": { + "c": "H3Index *", + "canonical": "unsigned long *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "th3index_value_at_timestamptz", + "file": "meos_h3.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "strict", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "result", + "cType": "H3Index *", + "canonical": "unsigned long *" + } + ] + }, + { + "name": "tbigint_to_th3index", + "file": "meos_h3.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "th3index_to_tbigint", + "file": "meos_h3.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_eq_h3index_th3index", + "file": "meos_h3.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "cell", + "cType": "H3Index", + "canonical": "unsigned long" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_eq_th3index_h3index", + "file": "meos_h3.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "cell", + "cType": "H3Index", + "canonical": "unsigned long" + } + ] + }, + { + "name": "ever_ne_h3index_th3index", + "file": "meos_h3.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "cell", + "cType": "H3Index", + "canonical": "unsigned long" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_ne_th3index_h3index", + "file": "meos_h3.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "cell", + "cType": "H3Index", + "canonical": "unsigned long" + } + ] + }, + { + "name": "always_eq_h3index_th3index", + "file": "meos_h3.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "cell", + "cType": "H3Index", + "canonical": "unsigned long" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_eq_th3index_h3index", + "file": "meos_h3.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "cell", + "cType": "H3Index", + "canonical": "unsigned long" + } + ] + }, + { + "name": "always_ne_h3index_th3index", + "file": "meos_h3.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "cell", + "cType": "H3Index", + "canonical": "unsigned long" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_ne_th3index_h3index", + "file": "meos_h3.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "cell", + "cType": "H3Index", + "canonical": "unsigned long" + } + ] + }, + { + "name": "ever_eq_th3index_th3index", + "file": "meos_h3.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_ne_th3index_th3index", + "file": "meos_h3.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_eq_th3index_th3index", + "file": "meos_h3.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_ne_th3index_th3index", + "file": "meos_h3.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "teq_h3index_th3index", + "file": "meos_h3.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "cell", + "cType": "H3Index", + "canonical": "unsigned long" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "teq_th3index_h3index", + "file": "meos_h3.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "cell", + "cType": "H3Index", + "canonical": "unsigned long" + } + ] + }, + { + "name": "teq_th3index_th3index", + "file": "meos_h3.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tne_h3index_th3index", + "file": "meos_h3.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "cell", + "cType": "H3Index", + "canonical": "unsigned long" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tne_th3index_h3index", + "file": "meos_h3.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "cell", + "cType": "H3Index", + "canonical": "unsigned long" + } + ] + }, + { + "name": "tne_th3index_th3index", + "file": "meos_h3.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "th3index_get_resolution", + "file": "meos_h3.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "th3index_get_base_cell_number", + "file": "meos_h3.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "th3index_is_valid_cell", + "file": "meos_h3.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "th3index_is_res_class_iii", + "file": "meos_h3.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "th3index_is_pentagon", + "file": "meos_h3.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "th3index_cell_to_parent", + "file": "meos_h3.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "resolution", + "cType": "int32", + "canonical": "int" + } + ] + }, + { + "name": "th3index_cell_to_parent_next", + "file": "meos_h3.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "th3index_cell_to_center_child", + "file": "meos_h3.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "resolution", + "cType": "int32", + "canonical": "int" + } + ] + }, + { + "name": "th3index_cell_to_center_child_next", + "file": "meos_h3.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "th3index_cell_to_child_pos", + "file": "meos_h3.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "parent_res", + "cType": "int32", + "canonical": "int" + } + ] + }, + { + "name": "th3index_child_pos_to_cell", + "file": "meos_h3.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "child_pos", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "parent", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "child_res", + "cType": "int32", + "canonical": "int" + } + ] + }, + { + "name": "tgeogpoint_to_th3index", + "file": "meos_h3.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "resolution", + "cType": "int32", + "canonical": "int" + } + ] + }, + { + "name": "tgeompoint_to_th3index", + "file": "meos_h3.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "resolution", + "cType": "int32", + "canonical": "int" + } + ] + }, + { + "name": "th3index_to_tgeogpoint", + "file": "meos_h3.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "th3index_to_tgeompoint", + "file": "meos_h3.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "th3index_cell_to_boundary", + "file": "meos_h3.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "geo_to_h3index_set", + "file": "meos_h3.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "resolution", + "cType": "int32", + "canonical": "int" + } + ] + }, + { + "name": "ever_eq_h3indexset_th3index", + "file": "meos_h3.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "cells", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "th3idx", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "th3index_are_neighbor_cells", + "file": "meos_h3.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "origin", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "dest", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "th3index_cells_to_directed_edge", + "file": "meos_h3.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "origin", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "dest", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "th3index_is_valid_directed_edge", + "file": "meos_h3.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "edge", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "th3index_get_directed_edge_origin", + "file": "meos_h3.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "edge", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "th3index_get_directed_edge_destination", + "file": "meos_h3.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "edge", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "th3index_directed_edge_to_boundary", + "file": "meos_h3.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "edge", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "th3index_cell_to_vertex", + "file": "meos_h3.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "vertex_num", + "cType": "int32", + "canonical": "int" + } + ] + }, + { + "name": "th3index_vertex_to_latlng", + "file": "meos_h3.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "th3index_is_valid_vertex", + "file": "meos_h3.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "th3index_grid_distance", + "file": "meos_h3.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "origin", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "dest", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "th3index_cell_to_local_ij", + "file": "meos_h3.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "origin", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "cell", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "th3index_local_ij_to_cell", + "file": "meos_h3.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "origin", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "coord", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "th3index_cell_area", + "file": "meos_h3.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "unit", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "th3index_edge_length", + "file": "meos_h3.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "unit", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "tgeogpoint_great_circle_distance", + "file": "meos_h3.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "a", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "b", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "unit", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "proj_get_context", + "file": "meos_internal_geo.h", + "returnType": { + "c": "PJ_CONTEXT *", + "canonical": "struct pj_ctx *" + }, + "params": [] + }, + { + "name": "geos_get_context", + "file": "meos_internal_geo.h", + "returnType": { + "c": "GEOSContextHandle_t", + "canonical": "struct GEOSContextHandle_HS *" + }, + "params": [] + }, + { + "name": "datum_geo_round", + "file": "meos_internal_geo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "size", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "point_round", + "file": "meos_internal_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "stbox_set", + "file": "meos_internal_geo.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "hasx", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "hasz", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "geodetic", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "srid", + "cType": "int32", + "canonical": "int" + }, + { + "name": "xmin", + "cType": "double", + "canonical": "double" + }, + { + "name": "xmax", + "cType": "double", + "canonical": "double" + }, + { + "name": "ymin", + "cType": "double", + "canonical": "double" + }, + { + "name": "ymax", + "cType": "double", + "canonical": "double" + }, + { + "name": "zmin", + "cType": "double", + "canonical": "double" + }, + { + "name": "zmax", + "cType": "double", + "canonical": "double" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "box", + "cType": "STBox *", + "canonical": "struct STBox *" + } + ] + }, + { + "name": "gbox_set_stbox", + "file": "meos_internal_geo.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "box", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + }, + { + "name": "result", + "cType": "STBox *", + "canonical": "struct STBox *" + } + ] + }, + { + "name": "geo_set_stbox", + "file": "meos_internal_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "box", + "cType": "STBox *", + "canonical": "struct STBox *" + } + ] + }, + { + "name": "geoarr_set_stbox", + "file": "meos_internal_geo.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "values", + "cType": "Datum *", + "canonical": "int ((*)(int *))()" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "box", + "cType": "STBox *", + "canonical": "struct STBox *" + } + ] + }, + { + "name": "spatial_set_stbox", + "file": "meos_internal_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "d", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "basetype", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "box", + "cType": "STBox *", + "canonical": "struct STBox *" + } + ] + }, + { + "name": "spatialset_set_stbox", + "file": "meos_internal_geo.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "set", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "box", + "cType": "STBox *", + "canonical": "struct STBox *" + } + ] + }, + { + "name": "stbox_set_box3d", + "file": "meos_internal_geo.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "box3d", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "stbox_set_gbox", + "file": "meos_internal_geo.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "gbox", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tstzset_set_stbox", + "file": "meos_internal_geo.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "box", + "cType": "STBox *", + "canonical": "struct STBox *" + } + ] + }, + { + "name": "tstzspan_set_stbox", + "file": "meos_internal_geo.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "box", + "cType": "STBox *", + "canonical": "struct STBox *" + } + ] + }, + { + "name": "tstzspanset_set_stbox", + "file": "meos_internal_geo.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "s", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "box", + "cType": "STBox *", + "canonical": "struct STBox *" + } + ] + }, + { + "name": "stbox_expand", + "file": "meos_internal_geo.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "box1", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "box2", + "cType": "STBox *", + "canonical": "struct STBox *" + } + ] + }, + { + "name": "inter_stbox_stbox", + "file": "meos_internal_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "box2", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "result", + "cType": "STBox *", + "canonical": "struct STBox *" + } + ] + }, + { + "name": "tgeogpointinst_from_mfjson", + "file": "meos_internal_geo.h", + "returnType": { + "c": "TInstant *", + "canonical": "struct TInstant *" + }, + "params": [ + { + "name": "mfjson", + "cType": "json_object *", + "canonical": "struct json_object *" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + } + ] + }, + { + "name": "tgeogpointinst_in", + "file": "meos_internal_geo.h", + "returnType": { + "c": "TInstant *", + "canonical": "struct TInstant *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "tgeogpointseq_from_mfjson", + "file": "meos_internal_geo.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "mfjson", + "cType": "json_object *", + "canonical": "struct json_object *" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "tgeogpointseq_in", + "file": "meos_internal_geo.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "tgeogpointseqset_from_mfjson", + "file": "meos_internal_geo.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "mfjson", + "cType": "json_object *", + "canonical": "struct json_object *" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "tgeogpointseqset_in", + "file": "meos_internal_geo.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "tgeompointinst_from_mfjson", + "file": "meos_internal_geo.h", + "returnType": { + "c": "TInstant *", + "canonical": "struct TInstant *" + }, + "params": [ + { + "name": "mfjson", + "cType": "json_object *", + "canonical": "struct json_object *" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + } + ] + }, + { + "name": "tgeompointinst_in", + "file": "meos_internal_geo.h", + "returnType": { + "c": "TInstant *", + "canonical": "struct TInstant *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "tgeompointseq_from_mfjson", + "file": "meos_internal_geo.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "mfjson", + "cType": "json_object *", + "canonical": "struct json_object *" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "tgeompointseq_in", + "file": "meos_internal_geo.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "tgeompointseqset_from_mfjson", + "file": "meos_internal_geo.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "mfjson", + "cType": "json_object *", + "canonical": "struct json_object *" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "tgeompointseqset_in", + "file": "meos_internal_geo.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "tgeographyinst_from_mfjson", + "file": "meos_internal_geo.h", + "returnType": { + "c": "TInstant *", + "canonical": "struct TInstant *" + }, + "params": [ + { + "name": "mfjson", + "cType": "json_object *", + "canonical": "struct json_object *" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + } + ] + }, + { + "name": "tgeographyinst_in", + "file": "meos_internal_geo.h", + "returnType": { + "c": "TInstant *", + "canonical": "struct TInstant *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "tgeographyseq_from_mfjson", + "file": "meos_internal_geo.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "mfjson", + "cType": "json_object *", + "canonical": "struct json_object *" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "tgeographyseq_in", + "file": "meos_internal_geo.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "tgeographyseqset_from_mfjson", + "file": "meos_internal_geo.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "mfjson", + "cType": "json_object *", + "canonical": "struct json_object *" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "tgeographyseqset_in", + "file": "meos_internal_geo.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "tgeometryinst_from_mfjson", + "file": "meos_internal_geo.h", + "returnType": { + "c": "TInstant *", + "canonical": "struct TInstant *" + }, + "params": [ + { + "name": "mfjson", + "cType": "json_object *", + "canonical": "struct json_object *" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + } + ] + }, + { + "name": "tgeometryinst_in", + "file": "meos_internal_geo.h", + "returnType": { + "c": "TInstant *", + "canonical": "struct TInstant *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "tgeometryseq_from_mfjson", + "file": "meos_internal_geo.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "mfjson", + "cType": "json_object *", + "canonical": "struct json_object *" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "tgeometryseq_in", + "file": "meos_internal_geo.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "tgeometryseqset_from_mfjson", + "file": "meos_internal_geo.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "mfjson", + "cType": "json_object *", + "canonical": "struct json_object *" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "tgeometryseqset_in", + "file": "meos_internal_geo.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "tspatial_set_stbox", + "file": "meos_internal_geo.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "STBox *", + "canonical": "struct STBox *" + } + ] + }, + { + "name": "tspatialseq_set_stbox", + "file": "meos_internal_geo.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "box", + "cType": "STBox *", + "canonical": "struct STBox *" + } + ] + }, + { + "name": "tspatialseqset_set_stbox", + "file": "meos_internal_geo.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const struct TSequenceSet *" + }, + { + "name": "box", + "cType": "STBox *", + "canonical": "struct STBox *" + } + ] + }, + { + "name": "tgeo_restrict_elevation", + "file": "meos_internal_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tgeo_restrict_geom", + "file": "meos_internal_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tgeo_restrict_stbox", + "file": "meos_internal_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "border_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tgeoinst_restrict_geom", + "file": "meos_internal_geo.h", + "returnType": { + "c": "TInstant *", + "canonical": "struct TInstant *" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const struct TInstant *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tgeoinst_restrict_stbox", + "file": "meos_internal_geo.h", + "returnType": { + "c": "TInstant *", + "canonical": "struct TInstant *" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const struct TInstant *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "border_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tgeoseq_restrict_geom", + "file": "meos_internal_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tgeoseq_restrict_stbox", + "file": "meos_internal_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "border_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tgeoseqset_restrict_geom", + "file": "meos_internal_geo.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const struct TSequenceSet *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tgeoseqset_restrict_stbox", + "file": "meos_internal_geo.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const struct TSequenceSet *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "border_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "spatial_srid", + "file": "meos_internal_geo.h", + "returnType": { + "c": "int32_t", + "canonical": "int" + }, + "params": [ + { + "name": "d", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "basetype", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "spatial_set_srid", + "file": "meos_internal_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "d", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "basetype", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + } + ] + }, + { + "name": "tspatialinst_srid", + "file": "meos_internal_geo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const struct TInstant *" + } + ] + }, + { + "name": "tpointseq_azimuth", + "file": "meos_internal_geo.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + } + ] + }, + { + "name": "tpointseq_cumulative_length", + "file": "meos_internal_geo.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "prevlength", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "tpointseq_is_simple", + "file": "meos_internal_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + } + ] + }, + { + "name": "tpointseq_length", + "file": "meos_internal_geo.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + } + ] + }, + { + "name": "tpointseq_linear_trajectory", + "file": "meos_internal_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "unary_union", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tgeoseq_stboxes", + "file": "meos_internal_geo.h", + "returnType": { + "c": "STBox *", + "canonical": "struct STBox *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tgeoseq_split_n_stboxes", + "file": "meos_internal_geo.h", + "returnType": { + "c": "STBox *", + "canonical": "struct STBox *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "max_count", + "cType": "int", + "canonical": "int" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tpointseqset_azimuth", + "file": "meos_internal_geo.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const struct TSequenceSet *" + } + ] + }, + { + "name": "tpointseqset_cumulative_length", + "file": "meos_internal_geo.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const struct TSequenceSet *" + } + ] + }, + { + "name": "tpointseqset_is_simple", + "file": "meos_internal_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const struct TSequenceSet *" + } + ] + }, + { + "name": "tpointseqset_length", + "file": "meos_internal_geo.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const struct TSequenceSet *" + } + ] + }, + { + "name": "tgeoseqset_stboxes", + "file": "meos_internal_geo.h", + "returnType": { + "c": "STBox *", + "canonical": "struct STBox *" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const struct TSequenceSet *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tgeoseqset_split_n_stboxes", + "file": "meos_internal_geo.h", + "returnType": { + "c": "STBox *", + "canonical": "struct STBox *" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const struct TSequenceSet *" + }, + { + "name": "max_count", + "cType": "int", + "canonical": "int" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tgeominst_tgeoginst", + "file": "meos_internal_geo.h", + "returnType": { + "c": "TInstant *", + "canonical": "struct TInstant *" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const struct TInstant *" + }, + { + "name": "oper", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tgeomseq_tgeogseq", + "file": "meos_internal_geo.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "oper", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tgeomseqset_tgeogseqset", + "file": "meos_internal_geo.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const struct TSequenceSet *" + }, + { + "name": "oper", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tgeom_tgeog", + "file": "meos_internal_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "oper", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tgeo_tpoint", + "file": "meos_internal_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "oper", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tspatialinst_set_srid", + "file": "meos_internal_geo.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "inst", + "cType": "TInstant *", + "canonical": "struct TInstant *" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + } + ] + }, + { + "name": "tpointseq_make_simple", + "file": "meos_internal_geo.h", + "returnType": { + "c": "TSequence **", + "canonical": "struct TSequence **" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tspatialseq_set_srid", + "file": "meos_internal_geo.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "seq", + "cType": "TSequence *", + "canonical": "struct TSequence *" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + } + ] + }, + { + "name": "tpointseqset_make_simple", + "file": "meos_internal_geo.h", + "returnType": { + "c": "TSequence **", + "canonical": "struct TSequence **" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const struct TSequenceSet *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tspatialseqset_set_srid", + "file": "meos_internal_geo.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "ss", + "cType": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + } + ] + }, + { + "name": "tpointseq_twcentroid", + "file": "meos_internal_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + } + ] + }, + { + "name": "tpointseqset_twcentroid", + "file": "meos_internal_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const struct TSequenceSet *" + } + ] + }, + { + "name": "npoint_as_ewkt", + "file": "meos_npoint.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "npoint_as_hexwkb", + "file": "meos_npoint.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + }, + { + "name": "variant", + "cType": "uint8_t", + "canonical": "unsigned char" + }, + { + "name": "size_out", + "cType": "size_t *", + "canonical": "unsigned long *" + } + ] + }, + { + "name": "npoint_as_text", + "file": "meos_npoint.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "npoint_as_wkb", + "file": "meos_npoint.h", + "returnType": { + "c": "uint8_t *", + "canonical": "unsigned char *" + }, + "params": [ + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + }, + { + "name": "variant", + "cType": "uint8_t", + "canonical": "unsigned char" + }, + { + "name": "size_out", + "cType": "size_t *", + "canonical": "unsigned long *" + } + ] + }, + { + "name": "npoint_from_hexwkb", + "file": "meos_npoint.h", + "returnType": { + "c": "Npoint *", + "canonical": "Npoint *" + }, + "params": [ + { + "name": "hexwkb", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "npoint_from_wkb", + "file": "meos_npoint.h", + "returnType": { + "c": "Npoint *", + "canonical": "Npoint *" + }, + "params": [ + { + "name": "wkb", + "cType": "const uint8_t *", + "canonical": "const unsigned char *" + }, + { + "name": "size", + "cType": "size_t", + "canonical": "unsigned long" + } + ] + }, + { + "name": "npoint_in", + "file": "meos_npoint.h", + "returnType": { + "c": "Npoint *", + "canonical": "Npoint *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "npoint_out", + "file": "meos_npoint.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "nsegment_in", + "file": "meos_npoint.h", + "returnType": { + "c": "Nsegment *", + "canonical": "Nsegment *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "nsegment_out", + "file": "meos_npoint.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "ns", + "cType": "const Nsegment *", + "canonical": "const Nsegment *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "npoint_make", + "file": "meos_npoint.h", + "returnType": { + "c": "Npoint *", + "canonical": "Npoint *" + }, + "params": [ + { + "name": "rid", + "cType": "int64", + "canonical": "long" + }, + { + "name": "pos", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "nsegment_make", + "file": "meos_npoint.h", + "returnType": { + "c": "Nsegment *", + "canonical": "Nsegment *" + }, + "params": [ + { + "name": "rid", + "cType": "int64", + "canonical": "long" + }, + { + "name": "pos1", + "cType": "double", + "canonical": "double" + }, + { + "name": "pos2", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "geompoint_to_npoint", + "file": "meos_npoint.h", + "returnType": { + "c": "Npoint *", + "canonical": "Npoint *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "geom_to_nsegment", + "file": "meos_npoint.h", + "returnType": { + "c": "Nsegment *", + "canonical": "Nsegment *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "npoint_to_geompoint", + "file": "meos_npoint.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + } + ] + }, + { + "name": "npoint_to_nsegment", + "file": "meos_npoint.h", + "returnType": { + "c": "Nsegment *", + "canonical": "Nsegment *" + }, + "params": [ + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + } + ] + }, + { + "name": "npoint_to_stbox", + "file": "meos_npoint.h", + "returnType": { + "c": "STBox *", + "canonical": "struct STBox *" + }, + "params": [ + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + } + ] + }, + { + "name": "nsegment_to_geom", + "file": "meos_npoint.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "ns", + "cType": "const Nsegment *", + "canonical": "const Nsegment *" + } + ] + }, + { + "name": "nsegment_to_stbox", + "file": "meos_npoint.h", + "returnType": { + "c": "STBox *", + "canonical": "struct STBox *" + }, + "params": [ + { + "name": "ns", + "cType": "const Nsegment *", + "canonical": "const Nsegment *" + } + ] + }, + { + "name": "npoint_hash", + "file": "meos_npoint.h", + "returnType": { + "c": "uint32", + "canonical": "unsigned int" + }, + "params": [ + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + } + ] + }, + { + "name": "npoint_hash_extended", + "file": "meos_npoint.h", + "returnType": { + "c": "uint64", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + }, + { + "name": "seed", + "cType": "uint64", + "canonical": "unsigned long" + } + ] + }, + { + "name": "npoint_position", + "file": "meos_npoint.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + } + ] + }, + { + "name": "npoint_route", + "file": "meos_npoint.h", + "returnType": { + "c": "int64", + "canonical": "long" + }, + "params": [ + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + } + ] + }, + { + "name": "nsegment_end_position", + "file": "meos_npoint.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "ns", + "cType": "const Nsegment *", + "canonical": "const Nsegment *" + } + ] + }, + { + "name": "nsegment_route", + "file": "meos_npoint.h", + "returnType": { + "c": "int64", + "canonical": "long" + }, + "params": [ + { + "name": "ns", + "cType": "const Nsegment *", + "canonical": "const Nsegment *" + } + ] + }, + { + "name": "nsegment_start_position", + "file": "meos_npoint.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "ns", + "cType": "const Nsegment *", + "canonical": "const Nsegment *" + } + ] + }, + { + "name": "route_exists", + "file": "meos_npoint.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "rid", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "route_geom", + "file": "meos_npoint.h", + "returnType": { + "c": "const int *", + "canonical": "const int *" + }, + "params": [ + { + "name": "rid", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "route_length", + "file": "meos_npoint.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "rid", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "npoint_round", + "file": "meos_npoint.h", + "returnType": { + "c": "Npoint *", + "canonical": "Npoint *" + }, + "params": [ + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "nsegment_round", + "file": "meos_npoint.h", + "returnType": { + "c": "Nsegment *", + "canonical": "Nsegment *" + }, + "params": [ + { + "name": "ns", + "cType": "const Nsegment *", + "canonical": "const Nsegment *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "get_srid_ways", + "file": "meos_npoint.h", + "returnType": { + "c": "int32_t", + "canonical": "int" + }, + "params": [] + }, + { + "name": "npoint_srid", + "file": "meos_npoint.h", + "returnType": { + "c": "int32_t", + "canonical": "int" + }, + "params": [ + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + } + ] + }, + { + "name": "nsegment_srid", + "file": "meos_npoint.h", + "returnType": { + "c": "int32_t", + "canonical": "int" + }, + "params": [ + { + "name": "ns", + "cType": "const Nsegment *", + "canonical": "const Nsegment *" + } + ] + }, + { + "name": "npoint_timestamptz_to_stbox", + "file": "meos_npoint.h", + "returnType": { + "c": "STBox *", + "canonical": "struct STBox *" + }, + "params": [ + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "npoint_tstzspan_to_stbox", + "file": "meos_npoint.h", + "returnType": { + "c": "STBox *", + "canonical": "struct STBox *" + }, + "params": [ + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "npoint_cmp", + "file": "meos_npoint.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "np1", + "cType": "const Npoint *", + "canonical": "const Npoint *" + }, + { + "name": "np2", + "cType": "const Npoint *", + "canonical": "const Npoint *" + } + ] + }, + { + "name": "npoint_eq", + "file": "meos_npoint.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "np1", + "cType": "const Npoint *", + "canonical": "const Npoint *" + }, + { + "name": "np2", + "cType": "const Npoint *", + "canonical": "const Npoint *" + } + ] + }, + { + "name": "npoint_ge", + "file": "meos_npoint.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "np1", + "cType": "const Npoint *", + "canonical": "const Npoint *" + }, + { + "name": "np2", + "cType": "const Npoint *", + "canonical": "const Npoint *" + } + ] + }, + { + "name": "npoint_gt", + "file": "meos_npoint.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "np1", + "cType": "const Npoint *", + "canonical": "const Npoint *" + }, + { + "name": "np2", + "cType": "const Npoint *", + "canonical": "const Npoint *" + } + ] + }, + { + "name": "npoint_le", + "file": "meos_npoint.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "np1", + "cType": "const Npoint *", + "canonical": "const Npoint *" + }, + { + "name": "np2", + "cType": "const Npoint *", + "canonical": "const Npoint *" + } + ] + }, + { + "name": "npoint_lt", + "file": "meos_npoint.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "np1", + "cType": "const Npoint *", + "canonical": "const Npoint *" + }, + { + "name": "np2", + "cType": "const Npoint *", + "canonical": "const Npoint *" + } + ] + }, + { + "name": "npoint_ne", + "file": "meos_npoint.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "np1", + "cType": "const Npoint *", + "canonical": "const Npoint *" + }, + { + "name": "np2", + "cType": "const Npoint *", + "canonical": "const Npoint *" + } + ] + }, + { + "name": "npoint_same", + "file": "meos_npoint.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "np1", + "cType": "const Npoint *", + "canonical": "const Npoint *" + }, + { + "name": "np2", + "cType": "const Npoint *", + "canonical": "const Npoint *" + } + ] + }, + { + "name": "nsegment_cmp", + "file": "meos_npoint.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "ns1", + "cType": "const Nsegment *", + "canonical": "const Nsegment *" + }, + { + "name": "ns2", + "cType": "const Nsegment *", + "canonical": "const Nsegment *" + } + ] + }, + { + "name": "nsegment_eq", + "file": "meos_npoint.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ns1", + "cType": "const Nsegment *", + "canonical": "const Nsegment *" + }, + { + "name": "ns2", + "cType": "const Nsegment *", + "canonical": "const Nsegment *" + } + ] + }, + { + "name": "nsegment_ge", + "file": "meos_npoint.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ns1", + "cType": "const Nsegment *", + "canonical": "const Nsegment *" + }, + { + "name": "ns2", + "cType": "const Nsegment *", + "canonical": "const Nsegment *" + } + ] + }, + { + "name": "nsegment_gt", + "file": "meos_npoint.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ns1", + "cType": "const Nsegment *", + "canonical": "const Nsegment *" + }, + { + "name": "ns2", + "cType": "const Nsegment *", + "canonical": "const Nsegment *" + } + ] + }, + { + "name": "nsegment_le", + "file": "meos_npoint.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ns1", + "cType": "const Nsegment *", + "canonical": "const Nsegment *" + }, + { + "name": "ns2", + "cType": "const Nsegment *", + "canonical": "const Nsegment *" + } + ] + }, + { + "name": "nsegment_lt", + "file": "meos_npoint.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ns1", + "cType": "const Nsegment *", + "canonical": "const Nsegment *" + }, + { + "name": "ns2", + "cType": "const Nsegment *", + "canonical": "const Nsegment *" + } + ] + }, + { + "name": "nsegment_ne", + "file": "meos_npoint.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ns1", + "cType": "const Nsegment *", + "canonical": "const Nsegment *" + }, + { + "name": "ns2", + "cType": "const Nsegment *", + "canonical": "const Nsegment *" + } + ] + }, + { + "name": "npointset_in", + "file": "meos_npoint.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "npointset_out", + "file": "meos_npoint.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "npointset_make", + "file": "meos_npoint.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "values", + "cType": "Npoint **", + "canonical": "Npoint **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "npoint_to_set", + "file": "meos_npoint.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + } + ] + }, + { + "name": "npointset_end_value", + "file": "meos_npoint.h", + "returnType": { + "c": "Npoint *", + "canonical": "Npoint *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "npointset_routes", + "file": "meos_npoint.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "npointset_start_value", + "file": "meos_npoint.h", + "returnType": { + "c": "Npoint *", + "canonical": "Npoint *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "npointset_value_n", + "file": "meos_npoint.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "n", + "cType": "int", + "canonical": "int" + }, + { + "name": "result", + "cType": "Npoint **", + "canonical": "Npoint **" + } + ] + }, + { + "name": "npointset_values", + "file": "meos_npoint.h", + "returnType": { + "c": "Npoint **", + "canonical": "Npoint **" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "contained_npoint_set", + "file": "meos_npoint.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "contains_set_npoint", + "file": "meos_npoint.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + } + ] + }, + { + "name": "intersection_npoint_set", + "file": "meos_npoint.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "intersection_set_npoint", + "file": "meos_npoint.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + } + ] + }, + { + "name": "minus_npoint_set", + "file": "meos_npoint.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "minus_set_npoint", + "file": "meos_npoint.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + } + ] + }, + { + "name": "npoint_union_transfn", + "file": "meos_npoint.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "state", + "cType": "Set *", + "canonical": "Set *" + }, + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + } + ] + }, + { + "name": "union_npoint_set", + "file": "meos_npoint.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "union_set_npoint", + "file": "meos_npoint.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + } + ] + }, + { + "name": "tnpoint_in", + "file": "meos_npoint.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "tnpoint_from_mfjson", + "file": "meos_npoint.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "mfjson", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "tnpoint_out", + "file": "meos_npoint.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "tnpointinst_make", + "file": "meos_npoint.h", + "returnType": { + "c": "TInstant *", + "canonical": "struct TInstant *" + }, + "params": [ + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "tnpoint_from_base_temp", + "file": "meos_npoint.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tnpointseq_from_base_tstzset", + "file": "meos_npoint.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "tnpointseq_from_base_tstzspan", + "file": "meos_npoint.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "tnpointseqset_from_base_tstzspanset", + "file": "meos_npoint.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "tgeompoint_to_tnpoint", + "file": "meos_npoint.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tnpoint_to_tgeompoint", + "file": "meos_npoint.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tnpoint_cumulative_length", + "file": "meos_npoint.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tnpoint_end_value", + "file": "meos_npoint.h", + "returnType": { + "c": "Npoint *", + "canonical": "Npoint *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tnpoint_length", + "file": "meos_npoint.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tnpoint_positions", + "file": "meos_npoint.h", + "returnType": { + "c": "Nsegment **", + "canonical": "Nsegment **" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tnpoint_route", + "file": "meos_npoint.h", + "returnType": { + "c": "int64", + "canonical": "long" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tnpoint_routes", + "file": "meos_npoint.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tnpoint_speed", + "file": "meos_npoint.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tnpoint_start_value", + "file": "meos_npoint.h", + "returnType": { + "c": "Npoint *", + "canonical": "Npoint *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tnpoint_trajectory", + "file": "meos_npoint.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tnpoint_value_at_timestamptz", + "file": "meos_npoint.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "strict", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "value", + "cType": "Npoint **", + "canonical": "Npoint **" + } + ] + }, + { + "name": "tnpoint_value_n", + "file": "meos_npoint.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "n", + "cType": "int", + "canonical": "int" + }, + { + "name": "result", + "cType": "Npoint **", + "canonical": "Npoint **" + } + ] + }, + { + "name": "tnpoint_values", + "file": "meos_npoint.h", + "returnType": { + "c": "Npoint **", + "canonical": "Npoint **" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tnpoint_twcentroid", + "file": "meos_npoint.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tnpoint_at_geom", + "file": "meos_npoint.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "tnpoint_at_npoint", + "file": "meos_npoint.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + } + ] + }, + { + "name": "tnpoint_at_npointset", + "file": "meos_npoint.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "tnpoint_at_stbox", + "file": "meos_npoint.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "border_inc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tnpoint_minus_geom", + "file": "meos_npoint.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "tnpoint_minus_npoint", + "file": "meos_npoint.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + } + ] + }, + { + "name": "tnpoint_minus_npointset", + "file": "meos_npoint.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "tnpoint_minus_stbox", + "file": "meos_npoint.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "border_inc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tdistance_tnpoint_npoint", + "file": "meos_npoint.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + } + ] + }, + { + "name": "tdistance_tnpoint_geo", + "file": "meos_npoint.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "tdistance_tnpoint_tnpoint", + "file": "meos_npoint.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "nad_tnpoint_geo", + "file": "meos_npoint.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "nad_tnpoint_npoint", + "file": "meos_npoint.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + } + ] + }, + { + "name": "nad_tnpoint_stbox", + "file": "meos_npoint.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + } + ] + }, + { + "name": "nad_tnpoint_tnpoint", + "file": "meos_npoint.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "nai_tnpoint_geo", + "file": "meos_npoint.h", + "returnType": { + "c": "TInstant *", + "canonical": "struct TInstant *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "nai_tnpoint_npoint", + "file": "meos_npoint.h", + "returnType": { + "c": "TInstant *", + "canonical": "struct TInstant *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + } + ] + }, + { + "name": "nai_tnpoint_tnpoint", + "file": "meos_npoint.h", + "returnType": { + "c": "TInstant *", + "canonical": "struct TInstant *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "shortestline_tnpoint_geo", + "file": "meos_npoint.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "shortestline_tnpoint_npoint", + "file": "meos_npoint.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + } + ] + }, + { + "name": "shortestline_tnpoint_tnpoint", + "file": "meos_npoint.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tnpoint_tcentroid_transfn", + "file": "meos_npoint.h", + "returnType": { + "c": "SkipList *", + "canonical": "struct SkipList *" + }, + "params": [ + { + "name": "state", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_eq_npoint_tnpoint", + "file": "meos_npoint.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_eq_tnpoint_npoint", + "file": "meos_npoint.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + } + ] + }, + { + "name": "always_eq_tnpoint_tnpoint", + "file": "meos_npoint.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_ne_npoint_tnpoint", + "file": "meos_npoint.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_ne_tnpoint_npoint", + "file": "meos_npoint.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + } + ] + }, + { + "name": "always_ne_tnpoint_tnpoint", + "file": "meos_npoint.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_eq_npoint_tnpoint", + "file": "meos_npoint.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_eq_tnpoint_npoint", + "file": "meos_npoint.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + } + ] + }, + { + "name": "ever_eq_tnpoint_tnpoint", + "file": "meos_npoint.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_ne_npoint_tnpoint", + "file": "meos_npoint.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_ne_tnpoint_npoint", + "file": "meos_npoint.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + } + ] + }, + { + "name": "ever_ne_tnpoint_tnpoint", + "file": "meos_npoint.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "teq_tnpoint_npoint", + "file": "meos_npoint.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + } + ] + }, + { + "name": "tne_tnpoint_npoint", + "file": "meos_npoint.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + } + ] + }, + { + "name": "pcpoint_hex_in", + "file": "meos_pointcloud.h", + "returnType": { + "c": "Pcpoint *", + "canonical": "struct Pcpoint *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "pcpoint_hex_out", + "file": "meos_pointcloud.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "pt", + "cType": "const Pcpoint *", + "canonical": "const struct Pcpoint *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "pcpoint_from_hexwkb", + "file": "meos_pointcloud.h", + "returnType": { + "c": "Pcpoint *", + "canonical": "struct Pcpoint *" + }, + "params": [ + { + "name": "hexwkb", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "pcpoint_as_hexwkb", + "file": "meos_pointcloud.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "pt", + "cType": "const Pcpoint *", + "canonical": "const struct Pcpoint *" + } + ] + }, + { + "name": "pcpoint_copy", + "file": "meos_pointcloud.h", + "returnType": { + "c": "Pcpoint *", + "canonical": "struct Pcpoint *" + }, + "params": [ + { + "name": "pt", + "cType": "const Pcpoint *", + "canonical": "const struct Pcpoint *" + } + ] + }, + { + "name": "pcpoint_get_pcid", + "file": "meos_pointcloud.h", + "returnType": { + "c": "uint32_t", + "canonical": "unsigned int" + }, + "params": [ + { + "name": "pt", + "cType": "const Pcpoint *", + "canonical": "const struct Pcpoint *" + } + ] + }, + { + "name": "pcpoint_hash", + "file": "meos_pointcloud.h", + "returnType": { + "c": "uint32", + "canonical": "unsigned int" + }, + "params": [ + { + "name": "pt", + "cType": "const Pcpoint *", + "canonical": "const struct Pcpoint *" + } + ] + }, + { + "name": "pcpoint_hash_extended", + "file": "meos_pointcloud.h", + "returnType": { + "c": "uint64", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "pt", + "cType": "const Pcpoint *", + "canonical": "const struct Pcpoint *" + }, + { + "name": "seed", + "cType": "uint64", + "canonical": "unsigned long" + } + ] + }, + { + "name": "pcpoint_get_x", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "pt", + "cType": "const Pcpoint *", + "canonical": "const struct Pcpoint *" + }, + { + "name": "schema", + "cType": "PCSCHEMA *", + "canonical": "struct PCSCHEMA *" + }, + { + "name": "out", + "cType": "double *", + "canonical": "double *" + } + ] + }, + { + "name": "pcpoint_get_y", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "pt", + "cType": "const Pcpoint *", + "canonical": "const struct Pcpoint *" + }, + { + "name": "schema", + "cType": "PCSCHEMA *", + "canonical": "struct PCSCHEMA *" + }, + { + "name": "out", + "cType": "double *", + "canonical": "double *" + } + ] + }, + { + "name": "pcpoint_get_z", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "pt", + "cType": "const Pcpoint *", + "canonical": "const struct Pcpoint *" + }, + { + "name": "schema", + "cType": "PCSCHEMA *", + "canonical": "struct PCSCHEMA *" + }, + { + "name": "out", + "cType": "double *", + "canonical": "double *" + } + ] + }, + { + "name": "pcpoint_get_dim", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "pt", + "cType": "const Pcpoint *", + "canonical": "const struct Pcpoint *" + }, + { + "name": "schema", + "cType": "PCSCHEMA *", + "canonical": "struct PCSCHEMA *" + }, + { + "name": "name", + "cType": "const char *", + "canonical": "const char *" + }, + { + "name": "out", + "cType": "double *", + "canonical": "double *" + } + ] + }, + { + "name": "pcpoint_to_tpcbox", + "file": "meos_pointcloud.h", + "returnType": { + "c": "TPCBox *", + "canonical": "struct TPCBox *" + }, + "params": [ + { + "name": "pt", + "cType": "const Pcpoint *", + "canonical": "const struct Pcpoint *" + }, + { + "name": "schema", + "cType": "PCSCHEMA *", + "canonical": "struct PCSCHEMA *" + } + ] + }, + { + "name": "meos_pc_schema", + "file": "meos_pointcloud.h", + "returnType": { + "c": "PCSCHEMA *", + "canonical": "struct PCSCHEMA *" + }, + "params": [ + { + "name": "pcid", + "cType": "uint32_t", + "canonical": "unsigned int" + } + ] + }, + { + "name": "meos_pc_schema_register", + "file": "meos_pointcloud.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "pcid", + "cType": "uint32_t", + "canonical": "unsigned int" + }, + { + "name": "schema", + "cType": "PCSCHEMA *", + "canonical": "struct PCSCHEMA *" + } + ] + }, + { + "name": "meos_pc_schema_register_xml", + "file": "meos_pointcloud.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "pcid", + "cType": "uint32_t", + "canonical": "unsigned int" + }, + { + "name": "schema", + "cType": "PCSCHEMA *", + "canonical": "struct PCSCHEMA *" + }, + { + "name": "xml_text", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "meos_pc_schema_xml", + "file": "meos_pointcloud.h", + "returnType": { + "c": "const char *", + "canonical": "const char *" + }, + "params": [ + { + "name": "pcid", + "cType": "uint32_t", + "canonical": "unsigned int" + } + ] + }, + { + "name": "meos_pc_schema_clear", + "file": "meos_pointcloud.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [] + }, + { + "name": "pcpoint_cmp", + "file": "meos_pointcloud.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "pt1", + "cType": "const Pcpoint *", + "canonical": "const struct Pcpoint *" + }, + { + "name": "pt2", + "cType": "const Pcpoint *", + "canonical": "const struct Pcpoint *" + } + ] + }, + { + "name": "pcpoint_eq", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "pt1", + "cType": "const Pcpoint *", + "canonical": "const struct Pcpoint *" + }, + { + "name": "pt2", + "cType": "const Pcpoint *", + "canonical": "const struct Pcpoint *" + } + ] + }, + { + "name": "pcpoint_ne", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "pt1", + "cType": "const Pcpoint *", + "canonical": "const struct Pcpoint *" + }, + { + "name": "pt2", + "cType": "const Pcpoint *", + "canonical": "const struct Pcpoint *" + } + ] + }, + { + "name": "pcpoint_lt", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "pt1", + "cType": "const Pcpoint *", + "canonical": "const struct Pcpoint *" + }, + { + "name": "pt2", + "cType": "const Pcpoint *", + "canonical": "const struct Pcpoint *" + } + ] + }, + { + "name": "pcpoint_le", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "pt1", + "cType": "const Pcpoint *", + "canonical": "const struct Pcpoint *" + }, + { + "name": "pt2", + "cType": "const Pcpoint *", + "canonical": "const struct Pcpoint *" + } + ] + }, + { + "name": "pcpoint_gt", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "pt1", + "cType": "const Pcpoint *", + "canonical": "const struct Pcpoint *" + }, + { + "name": "pt2", + "cType": "const Pcpoint *", + "canonical": "const struct Pcpoint *" + } + ] + }, + { + "name": "pcpoint_ge", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "pt1", + "cType": "const Pcpoint *", + "canonical": "const struct Pcpoint *" + }, + { + "name": "pt2", + "cType": "const Pcpoint *", + "canonical": "const struct Pcpoint *" + } + ] + }, + { + "name": "pcpatch_hex_in", + "file": "meos_pointcloud.h", + "returnType": { + "c": "Pcpatch *", + "canonical": "struct Pcpatch *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "pcpatch_hex_out", + "file": "meos_pointcloud.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "pa", + "cType": "const Pcpatch *", + "canonical": "const struct Pcpatch *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "pcpatch_from_hexwkb", + "file": "meos_pointcloud.h", + "returnType": { + "c": "Pcpatch *", + "canonical": "struct Pcpatch *" + }, + "params": [ + { + "name": "hexwkb", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "pcpatch_as_hexwkb", + "file": "meos_pointcloud.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "pa", + "cType": "const Pcpatch *", + "canonical": "const struct Pcpatch *" + } + ] + }, + { + "name": "pcpatch_copy", + "file": "meos_pointcloud.h", + "returnType": { + "c": "Pcpatch *", + "canonical": "struct Pcpatch *" + }, + "params": [ + { + "name": "pa", + "cType": "const Pcpatch *", + "canonical": "const struct Pcpatch *" + } + ] + }, + { + "name": "pcpatch_get_pcid", + "file": "meos_pointcloud.h", + "returnType": { + "c": "uint32_t", + "canonical": "unsigned int" + }, + "params": [ + { + "name": "pa", + "cType": "const Pcpatch *", + "canonical": "const struct Pcpatch *" + } + ] + }, + { + "name": "pcpatch_npoints", + "file": "meos_pointcloud.h", + "returnType": { + "c": "uint32_t", + "canonical": "unsigned int" + }, + "params": [ + { + "name": "pa", + "cType": "const Pcpatch *", + "canonical": "const struct Pcpatch *" + } + ] + }, + { + "name": "pcpatch_hash", + "file": "meos_pointcloud.h", + "returnType": { + "c": "uint32", + "canonical": "unsigned int" + }, + "params": [ + { + "name": "pa", + "cType": "const Pcpatch *", + "canonical": "const struct Pcpatch *" + } + ] + }, + { + "name": "pcpatch_hash_extended", + "file": "meos_pointcloud.h", + "returnType": { + "c": "uint64", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "pa", + "cType": "const Pcpatch *", + "canonical": "const struct Pcpatch *" + }, + { + "name": "seed", + "cType": "uint64", + "canonical": "unsigned long" + } + ] + }, + { + "name": "pcpatch_cmp", + "file": "meos_pointcloud.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "pa1", + "cType": "const Pcpatch *", + "canonical": "const struct Pcpatch *" + }, + { + "name": "pa2", + "cType": "const Pcpatch *", + "canonical": "const struct Pcpatch *" + } + ] + }, + { + "name": "pcpatch_eq", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "pa1", + "cType": "const Pcpatch *", + "canonical": "const struct Pcpatch *" + }, + { + "name": "pa2", + "cType": "const Pcpatch *", + "canonical": "const struct Pcpatch *" + } + ] + }, + { + "name": "pcpatch_ne", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "pa1", + "cType": "const Pcpatch *", + "canonical": "const struct Pcpatch *" + }, + { + "name": "pa2", + "cType": "const Pcpatch *", + "canonical": "const struct Pcpatch *" + } + ] + }, + { + "name": "pcpatch_lt", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "pa1", + "cType": "const Pcpatch *", + "canonical": "const struct Pcpatch *" + }, + { + "name": "pa2", + "cType": "const Pcpatch *", + "canonical": "const struct Pcpatch *" + } + ] + }, + { + "name": "pcpatch_le", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "pa1", + "cType": "const Pcpatch *", + "canonical": "const struct Pcpatch *" + }, + { + "name": "pa2", + "cType": "const Pcpatch *", + "canonical": "const struct Pcpatch *" + } + ] + }, + { + "name": "pcpatch_gt", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "pa1", + "cType": "const Pcpatch *", + "canonical": "const struct Pcpatch *" + }, + { + "name": "pa2", + "cType": "const Pcpatch *", + "canonical": "const struct Pcpatch *" + } + ] + }, + { + "name": "pcpatch_ge", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "pa1", + "cType": "const Pcpatch *", + "canonical": "const struct Pcpatch *" + }, + { + "name": "pa2", + "cType": "const Pcpatch *", + "canonical": "const struct Pcpatch *" + } + ] + }, + { + "name": "pcpointset_in", + "file": "meos_pointcloud.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "pcpointset_out", + "file": "meos_pointcloud.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "pcpointset_make", + "file": "meos_pointcloud.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "values", + "cType": "Pcpoint **", + "canonical": "struct Pcpoint **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "pcpoint_to_set", + "file": "meos_pointcloud.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "pt", + "cType": "const Pcpoint *", + "canonical": "const struct Pcpoint *" + } + ] + }, + { + "name": "pcpointset_start_value", + "file": "meos_pointcloud.h", + "returnType": { + "c": "Pcpoint *", + "canonical": "struct Pcpoint *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "pcpointset_end_value", + "file": "meos_pointcloud.h", + "returnType": { + "c": "Pcpoint *", + "canonical": "struct Pcpoint *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "pcpointset_value_n", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "n", + "cType": "int", + "canonical": "int" + }, + { + "name": "result", + "cType": "Pcpoint **", + "canonical": "struct Pcpoint **" + } + ] + }, + { + "name": "pcpointset_values", + "file": "meos_pointcloud.h", + "returnType": { + "c": "Pcpoint **", + "canonical": "struct Pcpoint **" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "contains_set_pcpoint", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "pt", + "cType": "Pcpoint *", + "canonical": "struct Pcpoint *" + } + ] + }, + { + "name": "contained_pcpoint_set", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "pt", + "cType": "const Pcpoint *", + "canonical": "const struct Pcpoint *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "intersection_pcpoint_set", + "file": "meos_pointcloud.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "pt", + "cType": "const Pcpoint *", + "canonical": "const struct Pcpoint *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "intersection_set_pcpoint", + "file": "meos_pointcloud.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "pt", + "cType": "const Pcpoint *", + "canonical": "const struct Pcpoint *" + } + ] + }, + { + "name": "minus_pcpoint_set", + "file": "meos_pointcloud.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "pt", + "cType": "const Pcpoint *", + "canonical": "const struct Pcpoint *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "minus_set_pcpoint", + "file": "meos_pointcloud.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "pt", + "cType": "const Pcpoint *", + "canonical": "const struct Pcpoint *" + } + ] + }, + { + "name": "union_pcpoint_set", + "file": "meos_pointcloud.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "pt", + "cType": "const Pcpoint *", + "canonical": "const struct Pcpoint *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "union_set_pcpoint", + "file": "meos_pointcloud.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "pt", + "cType": "const Pcpoint *", + "canonical": "const struct Pcpoint *" + } + ] + }, + { + "name": "pcpoint_union_transfn", + "file": "meos_pointcloud.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "state", + "cType": "Set *", + "canonical": "Set *" + }, + { + "name": "pt", + "cType": "const Pcpoint *", + "canonical": "const struct Pcpoint *" + } + ] + }, + { + "name": "pcpatchset_in", + "file": "meos_pointcloud.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "pcpatchset_out", + "file": "meos_pointcloud.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "pcpatchset_make", + "file": "meos_pointcloud.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "values", + "cType": "Pcpatch **", + "canonical": "struct Pcpatch **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "pcpatch_to_set", + "file": "meos_pointcloud.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "pa", + "cType": "const Pcpatch *", + "canonical": "const struct Pcpatch *" + } + ] + }, + { + "name": "pcpatchset_start_value", + "file": "meos_pointcloud.h", + "returnType": { + "c": "Pcpatch *", + "canonical": "struct Pcpatch *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "pcpatchset_end_value", + "file": "meos_pointcloud.h", + "returnType": { + "c": "Pcpatch *", + "canonical": "struct Pcpatch *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "pcpatchset_value_n", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "n", + "cType": "int", + "canonical": "int" + }, + { + "name": "result", + "cType": "Pcpatch **", + "canonical": "struct Pcpatch **" + } + ] + }, + { + "name": "pcpatchset_values", + "file": "meos_pointcloud.h", + "returnType": { + "c": "Pcpatch **", + "canonical": "struct Pcpatch **" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "contains_set_pcpatch", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "pa", + "cType": "Pcpatch *", + "canonical": "struct Pcpatch *" + } + ] + }, + { + "name": "contained_pcpatch_set", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "pa", + "cType": "const Pcpatch *", + "canonical": "const struct Pcpatch *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "intersection_pcpatch_set", + "file": "meos_pointcloud.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "pa", + "cType": "const Pcpatch *", + "canonical": "const struct Pcpatch *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "intersection_set_pcpatch", + "file": "meos_pointcloud.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "pa", + "cType": "const Pcpatch *", + "canonical": "const struct Pcpatch *" + } + ] + }, + { + "name": "minus_pcpatch_set", + "file": "meos_pointcloud.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "pa", + "cType": "const Pcpatch *", + "canonical": "const struct Pcpatch *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "minus_set_pcpatch", + "file": "meos_pointcloud.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "pa", + "cType": "const Pcpatch *", + "canonical": "const struct Pcpatch *" + } + ] + }, + { + "name": "union_pcpatch_set", + "file": "meos_pointcloud.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "pa", + "cType": "const Pcpatch *", + "canonical": "const struct Pcpatch *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "union_set_pcpatch", + "file": "meos_pointcloud.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "pa", + "cType": "const Pcpatch *", + "canonical": "const struct Pcpatch *" + } + ] + }, + { + "name": "pcpatch_union_transfn", + "file": "meos_pointcloud.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "state", + "cType": "Set *", + "canonical": "Set *" + }, + { + "name": "pa", + "cType": "const Pcpatch *", + "canonical": "const struct Pcpatch *" + } + ] + }, + { + "name": "tpcbox_in", + "file": "meos_pointcloud.h", + "returnType": { + "c": "TPCBox *", + "canonical": "struct TPCBox *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "tpcbox_out", + "file": "meos_pointcloud.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "box", + "cType": "const TPCBox *", + "canonical": "const struct TPCBox *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "tpcbox_make", + "file": "meos_pointcloud.h", + "returnType": { + "c": "TPCBox *", + "canonical": "struct TPCBox *" + }, + "params": [ + { + "name": "hasx", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "hasz", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "hast", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "geodetic", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + }, + { + "name": "pcid", + "cType": "uint32_t", + "canonical": "unsigned int" + }, + { + "name": "xmin", + "cType": "double", + "canonical": "double" + }, + { + "name": "xmax", + "cType": "double", + "canonical": "double" + }, + { + "name": "ymin", + "cType": "double", + "canonical": "double" + }, + { + "name": "ymax", + "cType": "double", + "canonical": "double" + }, + { + "name": "zmin", + "cType": "double", + "canonical": "double" + }, + { + "name": "zmax", + "cType": "double", + "canonical": "double" + }, + { + "name": "period", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "tpcbox_copy", + "file": "meos_pointcloud.h", + "returnType": { + "c": "TPCBox *", + "canonical": "struct TPCBox *" + }, + "params": [ + { + "name": "box", + "cType": "const TPCBox *", + "canonical": "const struct TPCBox *" + } + ] + }, + { + "name": "pcpatch_to_tpcbox", + "file": "meos_pointcloud.h", + "returnType": { + "c": "TPCBox *", + "canonical": "struct TPCBox *" + }, + "params": [ + { + "name": "pa", + "cType": "const Pcpatch *", + "canonical": "const struct Pcpatch *" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + } + ] + }, + { + "name": "tpcbox_hasx", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const TPCBox *", + "canonical": "const struct TPCBox *" + } + ] + }, + { + "name": "tpcbox_hasz", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const TPCBox *", + "canonical": "const struct TPCBox *" + } + ] + }, + { + "name": "tpcbox_hast", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const TPCBox *", + "canonical": "const struct TPCBox *" + } + ] + }, + { + "name": "tpcbox_geodetic", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const TPCBox *", + "canonical": "const struct TPCBox *" + } + ] + }, + { + "name": "tpcbox_xmin", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const TPCBox *", + "canonical": "const struct TPCBox *" + }, + { + "name": "result", + "cType": "double *", + "canonical": "double *" + } + ] + }, + { + "name": "tpcbox_xmax", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const TPCBox *", + "canonical": "const struct TPCBox *" + }, + { + "name": "result", + "cType": "double *", + "canonical": "double *" + } + ] + }, + { + "name": "tpcbox_ymin", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const TPCBox *", + "canonical": "const struct TPCBox *" + }, + { + "name": "result", + "cType": "double *", + "canonical": "double *" + } + ] + }, + { + "name": "tpcbox_ymax", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const TPCBox *", + "canonical": "const struct TPCBox *" + }, + { + "name": "result", + "cType": "double *", + "canonical": "double *" + } + ] + }, + { + "name": "tpcbox_zmin", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const TPCBox *", + "canonical": "const struct TPCBox *" + }, + { + "name": "result", + "cType": "double *", + "canonical": "double *" + } + ] + }, + { + "name": "tpcbox_zmax", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const TPCBox *", + "canonical": "const struct TPCBox *" + }, + { + "name": "result", + "cType": "double *", + "canonical": "double *" + } + ] + }, + { + "name": "tpcbox_tmin", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const TPCBox *", + "canonical": "const struct TPCBox *" + }, + { + "name": "result", + "cType": "TimestampTz *", + "canonical": "long *" + } + ] + }, + { + "name": "tpcbox_tmax", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const TPCBox *", + "canonical": "const struct TPCBox *" + }, + { + "name": "result", + "cType": "TimestampTz *", + "canonical": "long *" + } + ] + }, + { + "name": "tpcbox_srid", + "file": "meos_pointcloud.h", + "returnType": { + "c": "int32_t", + "canonical": "int" + }, + "params": [ + { + "name": "box", + "cType": "const TPCBox *", + "canonical": "const struct TPCBox *" + } + ] + }, + { + "name": "tpcbox_pcid", + "file": "meos_pointcloud.h", + "returnType": { + "c": "uint32_t", + "canonical": "unsigned int" + }, + "params": [ + { + "name": "box", + "cType": "const TPCBox *", + "canonical": "const struct TPCBox *" + } + ] + }, + { + "name": "tpcbox_to_stbox", + "file": "meos_pointcloud.h", + "returnType": { + "c": "STBox *", + "canonical": "struct STBox *" + }, + "params": [ + { + "name": "box", + "cType": "const TPCBox *", + "canonical": "const struct TPCBox *" + } + ] + }, + { + "name": "tpcbox_expand", + "file": "meos_pointcloud.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "box1", + "cType": "const TPCBox *", + "canonical": "const struct TPCBox *" + }, + { + "name": "box2", + "cType": "TPCBox *", + "canonical": "struct TPCBox *" + } + ] + }, + { + "name": "tpcbox_round", + "file": "meos_pointcloud.h", + "returnType": { + "c": "TPCBox *", + "canonical": "struct TPCBox *" + }, + "params": [ + { + "name": "box", + "cType": "const TPCBox *", + "canonical": "const struct TPCBox *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "tpcbox_set_srid", + "file": "meos_pointcloud.h", + "returnType": { + "c": "TPCBox *", + "canonical": "struct TPCBox *" + }, + "params": [ + { + "name": "box", + "cType": "const TPCBox *", + "canonical": "const struct TPCBox *" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + } + ] + }, + { + "name": "union_tpcbox_tpcbox", + "file": "meos_pointcloud.h", + "returnType": { + "c": "TPCBox *", + "canonical": "struct TPCBox *" + }, + "params": [ + { + "name": "box1", + "cType": "const TPCBox *", + "canonical": "const struct TPCBox *" + }, + { + "name": "box2", + "cType": "const TPCBox *", + "canonical": "const struct TPCBox *" + }, + { + "name": "strict", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "inter_tpcbox_tpcbox", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const TPCBox *", + "canonical": "const struct TPCBox *" + }, + { + "name": "box2", + "cType": "const TPCBox *", + "canonical": "const struct TPCBox *" + }, + { + "name": "result", + "cType": "TPCBox *", + "canonical": "struct TPCBox *" + } + ] + }, + { + "name": "intersection_tpcbox_tpcbox", + "file": "meos_pointcloud.h", + "returnType": { + "c": "TPCBox *", + "canonical": "struct TPCBox *" + }, + "params": [ + { + "name": "box1", + "cType": "const TPCBox *", + "canonical": "const struct TPCBox *" + }, + { + "name": "box2", + "cType": "const TPCBox *", + "canonical": "const struct TPCBox *" + } + ] + }, + { + "name": "contains_tpcbox_tpcbox", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const TPCBox *", + "canonical": "const struct TPCBox *" + }, + { + "name": "box2", + "cType": "const TPCBox *", + "canonical": "const struct TPCBox *" + } + ] + }, + { + "name": "contained_tpcbox_tpcbox", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const TPCBox *", + "canonical": "const struct TPCBox *" + }, + { + "name": "box2", + "cType": "const TPCBox *", + "canonical": "const struct TPCBox *" + } + ] + }, + { + "name": "overlaps_tpcbox_tpcbox", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const TPCBox *", + "canonical": "const struct TPCBox *" + }, + { + "name": "box2", + "cType": "const TPCBox *", + "canonical": "const struct TPCBox *" + } + ] + }, + { + "name": "same_tpcbox_tpcbox", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const TPCBox *", + "canonical": "const struct TPCBox *" + }, + { + "name": "box2", + "cType": "const TPCBox *", + "canonical": "const struct TPCBox *" + } + ] + }, + { + "name": "adjacent_tpcbox_tpcbox", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const TPCBox *", + "canonical": "const struct TPCBox *" + }, + { + "name": "box2", + "cType": "const TPCBox *", + "canonical": "const struct TPCBox *" + } + ] + }, + { + "name": "tpcbox_cmp", + "file": "meos_pointcloud.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "box1", + "cType": "const TPCBox *", + "canonical": "const struct TPCBox *" + }, + { + "name": "box2", + "cType": "const TPCBox *", + "canonical": "const struct TPCBox *" + } + ] + }, + { + "name": "tpcbox_eq", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const TPCBox *", + "canonical": "const struct TPCBox *" + }, + { + "name": "box2", + "cType": "const TPCBox *", + "canonical": "const struct TPCBox *" + } + ] + }, + { + "name": "tpcbox_ne", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const TPCBox *", + "canonical": "const struct TPCBox *" + }, + { + "name": "box2", + "cType": "const TPCBox *", + "canonical": "const struct TPCBox *" + } + ] + }, + { + "name": "tpcbox_lt", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const TPCBox *", + "canonical": "const struct TPCBox *" + }, + { + "name": "box2", + "cType": "const TPCBox *", + "canonical": "const struct TPCBox *" + } + ] + }, + { + "name": "tpcbox_le", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const TPCBox *", + "canonical": "const struct TPCBox *" + }, + { + "name": "box2", + "cType": "const TPCBox *", + "canonical": "const struct TPCBox *" + } + ] + }, + { + "name": "tpcbox_gt", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const TPCBox *", + "canonical": "const struct TPCBox *" + }, + { + "name": "box2", + "cType": "const TPCBox *", + "canonical": "const struct TPCBox *" + } + ] + }, + { + "name": "tpcbox_ge", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const TPCBox *", + "canonical": "const struct TPCBox *" + }, + { + "name": "box2", + "cType": "const TPCBox *", + "canonical": "const struct TPCBox *" + } + ] + }, + { + "name": "left_tpcbox_tpcbox", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const TPCBox *", + "canonical": "const struct TPCBox *" + }, + { + "name": "box2", + "cType": "const TPCBox *", + "canonical": "const struct TPCBox *" + } + ] + }, + { + "name": "overleft_tpcbox_tpcbox", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const TPCBox *", + "canonical": "const struct TPCBox *" + }, + { + "name": "box2", + "cType": "const TPCBox *", + "canonical": "const struct TPCBox *" + } + ] + }, + { + "name": "right_tpcbox_tpcbox", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const TPCBox *", + "canonical": "const struct TPCBox *" + }, + { + "name": "box2", + "cType": "const TPCBox *", + "canonical": "const struct TPCBox *" + } + ] + }, + { + "name": "overright_tpcbox_tpcbox", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const TPCBox *", + "canonical": "const struct TPCBox *" + }, + { + "name": "box2", + "cType": "const TPCBox *", + "canonical": "const struct TPCBox *" + } + ] + }, + { + "name": "below_tpcbox_tpcbox", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const TPCBox *", + "canonical": "const struct TPCBox *" + }, + { + "name": "box2", + "cType": "const TPCBox *", + "canonical": "const struct TPCBox *" + } + ] + }, + { + "name": "overbelow_tpcbox_tpcbox", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const TPCBox *", + "canonical": "const struct TPCBox *" + }, + { + "name": "box2", + "cType": "const TPCBox *", + "canonical": "const struct TPCBox *" + } + ] + }, + { + "name": "above_tpcbox_tpcbox", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const TPCBox *", + "canonical": "const struct TPCBox *" + }, + { + "name": "box2", + "cType": "const TPCBox *", + "canonical": "const struct TPCBox *" + } + ] + }, + { + "name": "overabove_tpcbox_tpcbox", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const TPCBox *", + "canonical": "const struct TPCBox *" + }, + { + "name": "box2", + "cType": "const TPCBox *", + "canonical": "const struct TPCBox *" + } + ] + }, + { + "name": "front_tpcbox_tpcbox", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const TPCBox *", + "canonical": "const struct TPCBox *" + }, + { + "name": "box2", + "cType": "const TPCBox *", + "canonical": "const struct TPCBox *" + } + ] + }, + { + "name": "overfront_tpcbox_tpcbox", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const TPCBox *", + "canonical": "const struct TPCBox *" + }, + { + "name": "box2", + "cType": "const TPCBox *", + "canonical": "const struct TPCBox *" + } + ] + }, + { + "name": "back_tpcbox_tpcbox", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const TPCBox *", + "canonical": "const struct TPCBox *" + }, + { + "name": "box2", + "cType": "const TPCBox *", + "canonical": "const struct TPCBox *" + } + ] + }, + { + "name": "overback_tpcbox_tpcbox", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const TPCBox *", + "canonical": "const struct TPCBox *" + }, + { + "name": "box2", + "cType": "const TPCBox *", + "canonical": "const struct TPCBox *" + } + ] + }, + { + "name": "before_tpcbox_tpcbox", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const TPCBox *", + "canonical": "const struct TPCBox *" + }, + { + "name": "box2", + "cType": "const TPCBox *", + "canonical": "const struct TPCBox *" + } + ] + }, + { + "name": "overbefore_tpcbox_tpcbox", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const TPCBox *", + "canonical": "const struct TPCBox *" + }, + { + "name": "box2", + "cType": "const TPCBox *", + "canonical": "const struct TPCBox *" + } + ] + }, + { + "name": "after_tpcbox_tpcbox", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const TPCBox *", + "canonical": "const struct TPCBox *" + }, + { + "name": "box2", + "cType": "const TPCBox *", + "canonical": "const struct TPCBox *" + } + ] + }, + { + "name": "overafter_tpcbox_tpcbox", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const TPCBox *", + "canonical": "const struct TPCBox *" + }, + { + "name": "box2", + "cType": "const TPCBox *", + "canonical": "const struct TPCBox *" + } + ] + }, + { + "name": "ensure_same_pcid_tpcbox", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const TPCBox *", + "canonical": "const struct TPCBox *" + }, + { + "name": "box2", + "cType": "const TPCBox *", + "canonical": "const struct TPCBox *" + } + ] + }, + { + "name": "tpointcloudinst_make", + "file": "meos_pointcloud.h", + "returnType": { + "c": "TInstant *", + "canonical": "struct TInstant *" + }, + "params": [ + { + "name": "pt", + "cType": "const Pcpoint *", + "canonical": "const struct Pcpoint *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "eintersects_tpcpoint_geo", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "nad_tpcpoint_geo", + "file": "meos_pointcloud.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "pose_as_ewkt", + "file": "meos_pose.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "pose_as_hexwkb", + "file": "meos_pose.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "variant", + "cType": "uint8_t", + "canonical": "unsigned char" + }, + { + "name": "size", + "cType": "size_t *", + "canonical": "unsigned long *" + } + ] + }, + { + "name": "pose_as_text", + "file": "meos_pose.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "pose_as_wkb", + "file": "meos_pose.h", + "returnType": { + "c": "uint8_t *", + "canonical": "unsigned char *" + }, + "params": [ + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "variant", + "cType": "uint8_t", + "canonical": "unsigned char" + }, + { + "name": "size_out", + "cType": "size_t *", + "canonical": "unsigned long *" + } + ] + }, + { + "name": "pose_from_wkb", + "file": "meos_pose.h", + "returnType": { + "c": "Pose *", + "canonical": "struct Pose *" + }, + "params": [ + { + "name": "wkb", + "cType": "const uint8_t *", + "canonical": "const unsigned char *" + }, + { + "name": "size", + "cType": "size_t", + "canonical": "unsigned long" + } + ] + }, + { + "name": "pose_from_hexwkb", + "file": "meos_pose.h", + "returnType": { + "c": "Pose *", + "canonical": "struct Pose *" + }, + "params": [ + { + "name": "hexwkb", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "pose_in", + "file": "meos_pose.h", + "returnType": { + "c": "Pose *", + "canonical": "struct Pose *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "pose_out", + "file": "meos_pose.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "pose_from_geopose", + "file": "meos_pose.h", + "returnType": { + "c": "Pose *", + "canonical": "struct Pose *" + }, + "params": [ + { + "name": "json", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "pose_as_geopose", + "file": "meos_pose.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "conformance", + "cType": "int", + "canonical": "int" + }, + { + "name": "precision", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "tpose_from_geopose", + "file": "meos_pose.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "json", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "tpose_as_geopose", + "file": "meos_pose.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "conformance", + "cType": "int", + "canonical": "int" + }, + { + "name": "precision", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "pose_apply_geo", + "file": "meos_pose.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "body", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "tpose_apply_geo", + "file": "meos_pose.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "body", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "pose_copy", + "file": "meos_pose.h", + "returnType": { + "c": "Pose *", + "canonical": "struct Pose *" + }, + "params": [ + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + } + ] + }, + { + "name": "pose_make_2d", + "file": "meos_pose.h", + "returnType": { + "c": "Pose *", + "canonical": "struct Pose *" + }, + "params": [ + { + "name": "x", + "cType": "double", + "canonical": "double" + }, + { + "name": "y", + "cType": "double", + "canonical": "double" + }, + { + "name": "theta", + "cType": "double", + "canonical": "double" + }, + { + "name": "geodetic", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + } + ] + }, + { + "name": "pose_make_3d", + "file": "meos_pose.h", + "returnType": { + "c": "Pose *", + "canonical": "struct Pose *" + }, + "params": [ + { + "name": "x", + "cType": "double", + "canonical": "double" + }, + { + "name": "y", + "cType": "double", + "canonical": "double" + }, + { + "name": "z", + "cType": "double", + "canonical": "double" + }, + { + "name": "W", + "cType": "double", + "canonical": "double" + }, + { + "name": "X", + "cType": "double", + "canonical": "double" + }, + { + "name": "Y", + "cType": "double", + "canonical": "double" + }, + { + "name": "Z", + "cType": "double", + "canonical": "double" + }, + { + "name": "geodetic", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + } + ] + }, + { + "name": "pose_make_point2d", + "file": "meos_pose.h", + "returnType": { + "c": "Pose *", + "canonical": "struct Pose *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "theta", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "pose_make_point3d", + "file": "meos_pose.h", + "returnType": { + "c": "Pose *", + "canonical": "struct Pose *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "W", + "cType": "double", + "canonical": "double" + }, + { + "name": "X", + "cType": "double", + "canonical": "double" + }, + { + "name": "Y", + "cType": "double", + "canonical": "double" + }, + { + "name": "Z", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "pose_to_point", + "file": "meos_pose.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + } + ] + }, + { + "name": "pose_to_stbox", + "file": "meos_pose.h", + "returnType": { + "c": "STBox *", + "canonical": "struct STBox *" + }, + "params": [ + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + } + ] + }, + { + "name": "pose_hash", + "file": "meos_pose.h", + "returnType": { + "c": "uint32", + "canonical": "unsigned int" + }, + "params": [ + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + } + ] + }, + { + "name": "pose_hash_extended", + "file": "meos_pose.h", + "returnType": { + "c": "uint64", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "seed", + "cType": "uint64", + "canonical": "unsigned long" + } + ] + }, + { + "name": "pose_orientation", + "file": "meos_pose.h", + "returnType": { + "c": "double *", + "canonical": "double *" + }, + "params": [ + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "pose_rotation", + "file": "meos_pose.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + } + ] + }, + { + "name": "pose_yaw", + "file": "meos_pose.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + } + ] + }, + { + "name": "pose_pitch", + "file": "meos_pose.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + } + ] + }, + { + "name": "pose_roll", + "file": "meos_pose.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + } + ] + }, + { + "name": "pose_angular_distance", + "file": "meos_pose.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "pose1", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "pose2", + "cType": "const Pose *", + "canonical": "const struct Pose *" + } + ] + }, + { + "name": "pose_normalise", + "file": "meos_pose.h", + "returnType": { + "c": "Pose *", + "canonical": "struct Pose *" + }, + "params": [ + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + } + ] + }, + { + "name": "pose_round", + "file": "meos_pose.h", + "returnType": { + "c": "Pose *", + "canonical": "struct Pose *" + }, + "params": [ + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "posearr_round", + "file": "meos_pose.h", + "returnType": { + "c": "Pose **", + "canonical": "struct Pose **" + }, + "params": [ + { + "name": "posearr", + "cType": "const Pose **", + "canonical": "const struct Pose **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "pose_set_srid", + "file": "meos_pose.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "pose", + "cType": "Pose *", + "canonical": "struct Pose *" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + } + ] + }, + { + "name": "pose_srid", + "file": "meos_pose.h", + "returnType": { + "c": "int32_t", + "canonical": "int" + }, + "params": [ + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + } + ] + }, + { + "name": "pose_transform", + "file": "meos_pose.h", + "returnType": { + "c": "Pose *", + "canonical": "struct Pose *" + }, + "params": [ + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + } + ] + }, + { + "name": "pose_transform_pipeline", + "file": "meos_pose.h", + "returnType": { + "c": "Pose *", + "canonical": "struct Pose *" + }, + "params": [ + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "pipelinestr", + "cType": "const char *", + "canonical": "const char *" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + }, + { + "name": "is_forward", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "pose_tstzspan_to_stbox", + "file": "meos_pose.h", + "returnType": { + "c": "STBox *", + "canonical": "struct STBox *" + }, + "params": [ + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "pose_timestamptz_to_stbox", + "file": "meos_pose.h", + "returnType": { + "c": "STBox *", + "canonical": "struct STBox *" + }, + "params": [ + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "distance_pose_geo", + "file": "meos_pose.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "distance_pose_pose", + "file": "meos_pose.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "pose1", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "pose2", + "cType": "const Pose *", + "canonical": "const struct Pose *" + } + ] + }, + { + "name": "distance_pose_stbox", + "file": "meos_pose.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + } + ] + }, + { + "name": "pose_cmp", + "file": "meos_pose.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "pose1", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "pose2", + "cType": "const Pose *", + "canonical": "const struct Pose *" + } + ] + }, + { + "name": "pose_eq", + "file": "meos_pose.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "pose1", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "pose2", + "cType": "const Pose *", + "canonical": "const struct Pose *" + } + ] + }, + { + "name": "pose_ge", + "file": "meos_pose.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "pose1", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "pose2", + "cType": "const Pose *", + "canonical": "const struct Pose *" + } + ] + }, + { + "name": "pose_gt", + "file": "meos_pose.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "pose1", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "pose2", + "cType": "const Pose *", + "canonical": "const struct Pose *" + } + ] + }, + { + "name": "pose_le", + "file": "meos_pose.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "pose1", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "pose2", + "cType": "const Pose *", + "canonical": "const struct Pose *" + } + ] + }, + { + "name": "pose_lt", + "file": "meos_pose.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "pose1", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "pose2", + "cType": "const Pose *", + "canonical": "const struct Pose *" + } + ] + }, + { + "name": "pose_ne", + "file": "meos_pose.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "pose1", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "pose2", + "cType": "const Pose *", + "canonical": "const struct Pose *" + } + ] + }, + { + "name": "pose_nsame", + "file": "meos_pose.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "pose1", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "pose2", + "cType": "const Pose *", + "canonical": "const struct Pose *" + } + ] + }, + { + "name": "pose_same", + "file": "meos_pose.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "pose1", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "pose2", + "cType": "const Pose *", + "canonical": "const struct Pose *" + } + ] + }, + { + "name": "poseset_in", + "file": "meos_pose.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "poseset_out", + "file": "meos_pose.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "poseset_make", + "file": "meos_pose.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "values", + "cType": "const Pose **", + "canonical": "const struct Pose **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "pose_to_set", + "file": "meos_pose.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + } + ] + }, + { + "name": "poseset_end_value", + "file": "meos_pose.h", + "returnType": { + "c": "Pose *", + "canonical": "struct Pose *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "poseset_start_value", + "file": "meos_pose.h", + "returnType": { + "c": "Pose *", + "canonical": "struct Pose *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "poseset_value_n", + "file": "meos_pose.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "n", + "cType": "int", + "canonical": "int" + }, + { + "name": "result", + "cType": "Pose **", + "canonical": "struct Pose **" + } + ] + }, + { + "name": "poseset_values", + "file": "meos_pose.h", + "returnType": { + "c": "Pose **", + "canonical": "struct Pose **" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "contained_pose_set", + "file": "meos_pose.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "contains_set_pose", + "file": "meos_pose.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "pose", + "cType": "Pose *", + "canonical": "struct Pose *" + } + ] + }, + { + "name": "intersection_pose_set", + "file": "meos_pose.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "intersection_set_pose", + "file": "meos_pose.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + } + ] + }, + { + "name": "minus_pose_set", + "file": "meos_pose.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "minus_set_pose", + "file": "meos_pose.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + } + ] + }, + { + "name": "pose_union_transfn", + "file": "meos_pose.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "state", + "cType": "Set *", + "canonical": "Set *" + }, + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + } + ] + }, + { + "name": "union_pose_set", + "file": "meos_pose.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "union_set_pose", + "file": "meos_pose.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + } + ] + }, + { + "name": "tpose_from_mfjson", + "file": "meos_pose.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "tpose_in", + "file": "meos_pose.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "tposeinst_make", + "file": "meos_pose.h", + "returnType": { + "c": "TInstant *", + "canonical": "struct TInstant *" + }, + "params": [ + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "tpose_from_base_temp", + "file": "meos_pose.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tposeseq_from_base_tstzset", + "file": "meos_pose.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "tposeseq_from_base_tstzspan", + "file": "meos_pose.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "tposeseqset_from_base_tstzspanset", + "file": "meos_pose.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "tpose_make", + "file": "meos_pose.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "tpoint", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "tradius", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tpose_to_tpoint", + "file": "meos_pose.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tpose_end_value", + "file": "meos_pose.h", + "returnType": { + "c": "Pose *", + "canonical": "struct Pose *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tpose_points", + "file": "meos_pose.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tpose_rotation", + "file": "meos_pose.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tpose_yaw", + "file": "meos_pose.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tpose_pitch", + "file": "meos_pose.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tpose_roll", + "file": "meos_pose.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tpose_speed", + "file": "meos_pose.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tpose_angular_speed", + "file": "meos_pose.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tpose_start_value", + "file": "meos_pose.h", + "returnType": { + "c": "Pose *", + "canonical": "struct Pose *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tpose_trajectory", + "file": "meos_pose.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tpose_value_at_timestamptz", + "file": "meos_pose.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "strict", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "result", + "cType": "Pose **", + "canonical": "struct Pose **" + } + ] + }, + { + "name": "tpose_value_n", + "file": "meos_pose.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "n", + "cType": "int", + "canonical": "int" + }, + { + "name": "result", + "cType": "Pose **", + "canonical": "struct Pose **" + } + ] + }, + { + "name": "tpose_values", + "file": "meos_pose.h", + "returnType": { + "c": "Pose **", + "canonical": "struct Pose **" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tpose_at_geom", + "file": "meos_pose.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "tpose_at_stbox", + "file": "meos_pose.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "border_inc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tpose_at_pose", + "file": "meos_pose.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + } + ] + }, + { + "name": "tpose_minus_geom", + "file": "meos_pose.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "tpose_minus_pose", + "file": "meos_pose.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + } + ] + }, + { + "name": "tpose_minus_stbox", + "file": "meos_pose.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "border_inc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tdistance_tpose_pose", + "file": "meos_pose.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + } + ] + }, + { + "name": "tdistance_tpose_geo", + "file": "meos_pose.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "tdistance_tpose_tpose", + "file": "meos_pose.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "nad_tpose_geo", + "file": "meos_pose.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "nad_tpose_pose", + "file": "meos_pose.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + } + ] + }, + { + "name": "nad_tpose_stbox", + "file": "meos_pose.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + } + ] + }, + { + "name": "nad_tpose_tpose", + "file": "meos_pose.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "nai_tpose_geo", + "file": "meos_pose.h", + "returnType": { + "c": "TInstant *", + "canonical": "struct TInstant *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "nai_tpose_pose", + "file": "meos_pose.h", + "returnType": { + "c": "TInstant *", + "canonical": "struct TInstant *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + } + ] + }, + { + "name": "nai_tpose_tpose", + "file": "meos_pose.h", + "returnType": { + "c": "TInstant *", + "canonical": "struct TInstant *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "shortestline_tpose_geo", + "file": "meos_pose.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "shortestline_tpose_pose", + "file": "meos_pose.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + } + ] + }, + { + "name": "shortestline_tpose_tpose", + "file": "meos_pose.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_eq_pose_tpose", + "file": "meos_pose.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_eq_tpose_pose", + "file": "meos_pose.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + } + ] + }, + { + "name": "always_eq_tpose_tpose", + "file": "meos_pose.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_ne_pose_tpose", + "file": "meos_pose.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_ne_tpose_pose", + "file": "meos_pose.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + } + ] + }, + { + "name": "always_ne_tpose_tpose", + "file": "meos_pose.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_eq_pose_tpose", + "file": "meos_pose.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_eq_tpose_pose", + "file": "meos_pose.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + } + ] + }, + { + "name": "ever_eq_tpose_tpose", + "file": "meos_pose.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_ne_pose_tpose", + "file": "meos_pose.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_ne_tpose_pose", + "file": "meos_pose.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + } + ] + }, + { + "name": "ever_ne_tpose_tpose", + "file": "meos_pose.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "teq_pose_tpose", + "file": "meos_pose.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "teq_tpose_pose", + "file": "meos_pose.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + } + ] + }, + { + "name": "tne_pose_tpose", + "file": "meos_pose.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tne_tpose_pose", + "file": "meos_pose.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + } + ] + }, + { + "name": "quadbin_is_valid_index", + "file": "meos_quadbin.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "index", + "cType": "Quadbin", + "canonical": "unsigned long" + } + ] + }, + { + "name": "quadbin_is_valid_cell", + "file": "meos_quadbin.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "cell", + "cType": "Quadbin", + "canonical": "unsigned long" + } + ] + }, + { + "name": "quadbin_tile_to_cell", + "file": "meos_quadbin.h", + "returnType": { + "c": "Quadbin", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "x", + "cType": "uint32_t", + "canonical": "unsigned int" + }, + { + "name": "y", + "cType": "uint32_t", + "canonical": "unsigned int" + }, + { + "name": "z", + "cType": "uint32_t", + "canonical": "unsigned int" + } + ] + }, + { + "name": "quadbin_cell_to_tile", + "file": "meos_quadbin.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "cell", + "cType": "Quadbin", + "canonical": "unsigned long" + }, + { + "name": "x", + "cType": "uint32_t *", + "canonical": "unsigned int *" + }, + { + "name": "y", + "cType": "uint32_t *", + "canonical": "unsigned int *" + }, + { + "name": "z", + "cType": "uint32_t *", + "canonical": "unsigned int *" + } + ] + }, + { + "name": "quadbin_get_resolution", + "file": "meos_quadbin.h", + "returnType": { + "c": "uint32_t", + "canonical": "unsigned int" + }, + "params": [ + { + "name": "cell", + "cType": "Quadbin", + "canonical": "unsigned long" + } + ] + }, + { + "name": "quadbin_cell_to_parent", + "file": "meos_quadbin.h", + "returnType": { + "c": "Quadbin", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "cell", + "cType": "Quadbin", + "canonical": "unsigned long" + }, + { + "name": "parent_resolution", + "cType": "uint32_t", + "canonical": "unsigned int" + } + ] + }, + { + "name": "quadbin_cell_to_children", + "file": "meos_quadbin.h", + "returnType": { + "c": "Quadbin *", + "canonical": "unsigned long *" + }, + "params": [ + { + "name": "cell", + "cType": "Quadbin", + "canonical": "unsigned long" + }, + { + "name": "children_resolution", + "cType": "uint32_t", + "canonical": "unsigned int" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "quadbin_cell_sibling", + "file": "meos_quadbin.h", + "returnType": { + "c": "Quadbin", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "cell", + "cType": "Quadbin", + "canonical": "unsigned long" + }, + { + "name": "direction", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "quadbin_k_ring", + "file": "meos_quadbin.h", + "returnType": { + "c": "Quadbin *", + "canonical": "unsigned long *" + }, + "params": [ + { + "name": "cell", + "cType": "Quadbin", + "canonical": "unsigned long" + }, + { + "name": "k", + "cType": "int", + "canonical": "int" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "quadbin_point_to_cell", + "file": "meos_quadbin.h", + "returnType": { + "c": "Quadbin", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "longitude", + "cType": "double", + "canonical": "double" + }, + { + "name": "latitude", + "cType": "double", + "canonical": "double" + }, + { + "name": "resolution", + "cType": "uint32_t", + "canonical": "unsigned int" + } + ] + }, + { + "name": "quadbin_cell_to_point", + "file": "meos_quadbin.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "cell", + "cType": "Quadbin", + "canonical": "unsigned long" + }, + { + "name": "longitude", + "cType": "double *", + "canonical": "double *" + }, + { + "name": "latitude", + "cType": "double *", + "canonical": "double *" + } + ] + }, + { + "name": "quadbin_cell_to_bounding_box", + "file": "meos_quadbin.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "cell", + "cType": "Quadbin", + "canonical": "unsigned long" + }, + { + "name": "xmin", + "cType": "double *", + "canonical": "double *" + }, + { + "name": "ymin", + "cType": "double *", + "canonical": "double *" + }, + { + "name": "xmax", + "cType": "double *", + "canonical": "double *" + }, + { + "name": "ymax", + "cType": "double *", + "canonical": "double *" + } + ] + }, + { + "name": "quadbin_cell_area", + "file": "meos_quadbin.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "cell", + "cType": "Quadbin", + "canonical": "unsigned long" + } + ] + }, + { + "name": "quadbin_index_to_string", + "file": "meos_quadbin.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "index", + "cType": "Quadbin", + "canonical": "unsigned long" + } + ] + }, + { + "name": "quadbin_string_to_index", + "file": "meos_quadbin.h", + "returnType": { + "c": "Quadbin", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "quadbin_cell_to_quadkey", + "file": "meos_quadbin.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "cell", + "cType": "Quadbin", + "canonical": "unsigned long" + } + ] + }, + { + "name": "quadbin_parse", + "file": "meos_quadbin.h", + "returnType": { + "c": "Quadbin", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "quadbin_eq", + "file": "meos_quadbin.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "a", + "cType": "Quadbin", + "canonical": "unsigned long" + }, + { + "name": "b", + "cType": "Quadbin", + "canonical": "unsigned long" + } + ] + }, + { + "name": "quadbin_ne", + "file": "meos_quadbin.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "a", + "cType": "Quadbin", + "canonical": "unsigned long" + }, + { + "name": "b", + "cType": "Quadbin", + "canonical": "unsigned long" + } + ] + }, + { + "name": "quadbin_lt", + "file": "meos_quadbin.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "a", + "cType": "Quadbin", + "canonical": "unsigned long" + }, + { + "name": "b", + "cType": "Quadbin", + "canonical": "unsigned long" + } + ] + }, + { + "name": "quadbin_le", + "file": "meos_quadbin.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "a", + "cType": "Quadbin", + "canonical": "unsigned long" + }, + { + "name": "b", + "cType": "Quadbin", + "canonical": "unsigned long" + } + ] + }, + { + "name": "quadbin_gt", + "file": "meos_quadbin.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "a", + "cType": "Quadbin", + "canonical": "unsigned long" + }, + { + "name": "b", + "cType": "Quadbin", + "canonical": "unsigned long" + } + ] + }, + { + "name": "quadbin_ge", + "file": "meos_quadbin.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "a", + "cType": "Quadbin", + "canonical": "unsigned long" + }, + { + "name": "b", + "cType": "Quadbin", + "canonical": "unsigned long" + } + ] + }, + { + "name": "quadbin_cmp", + "file": "meos_quadbin.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "a", + "cType": "Quadbin", + "canonical": "unsigned long" + }, + { + "name": "b", + "cType": "Quadbin", + "canonical": "unsigned long" + } + ] + }, + { + "name": "quadbin_hash", + "file": "meos_quadbin.h", + "returnType": { + "c": "uint32_t", + "canonical": "unsigned int" + }, + "params": [ + { + "name": "cell", + "cType": "Quadbin", + "canonical": "unsigned long" + } + ] + }, + { + "name": "quadbin_grid_disk", + "file": "meos_quadbin.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "origin", + "cType": "Quadbin", + "canonical": "unsigned long" + }, + { + "name": "k", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "quadbin_cell_to_children_set", + "file": "meos_quadbin.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "origin", + "cType": "Quadbin", + "canonical": "unsigned long" + }, + { + "name": "children_resolution", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "tquadbin_in", + "file": "meos_quadbin.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "tquadbininst_in", + "file": "meos_quadbin.h", + "returnType": { + "c": "TInstant *", + "canonical": "struct TInstant *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "tquadbinseq_in", + "file": "meos_quadbin.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "tquadbinseqset_in", + "file": "meos_quadbin.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "tquadbin_make", + "file": "meos_quadbin.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "value", + "cType": "Quadbin", + "canonical": "unsigned long" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "tquadbininst_make", + "file": "meos_quadbin.h", + "returnType": { + "c": "TInstant *", + "canonical": "struct TInstant *" + }, + "params": [ + { + "name": "value", + "cType": "Quadbin", + "canonical": "unsigned long" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "tquadbinseq_make", + "file": "meos_quadbin.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "values", + "cType": "const Quadbin *", + "canonical": "const unsigned long *" + }, + { + "name": "times", + "cType": "const TimestampTz *", + "canonical": "const long *" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "lower_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "upper_inc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tquadbinseqset_make", + "file": "meos_quadbin.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "sequences", + "cType": "const TSequence **", + "canonical": "const struct TSequence **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "tquadbin_start_value", + "file": "meos_quadbin.h", + "returnType": { + "c": "Quadbin", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tquadbin_end_value", + "file": "meos_quadbin.h", + "returnType": { + "c": "Quadbin", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tquadbin_value_n", + "file": "meos_quadbin.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "n", + "cType": "int", + "canonical": "int" + }, + { + "name": "result", + "cType": "Quadbin *", + "canonical": "unsigned long *" + } + ] + }, + { + "name": "tquadbin_values", + "file": "meos_quadbin.h", + "returnType": { + "c": "Quadbin *", + "canonical": "unsigned long *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tquadbin_value_at_timestamptz", + "file": "meos_quadbin.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "strict", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "result", + "cType": "Quadbin *", + "canonical": "unsigned long *" + } + ] + }, + { + "name": "tbigint_to_tquadbin", + "file": "meos_quadbin.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tquadbin_to_tbigint", + "file": "meos_quadbin.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_eq_quadbin_tquadbin", + "file": "meos_quadbin.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "cell", + "cType": "Quadbin", + "canonical": "unsigned long" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_eq_tquadbin_quadbin", + "file": "meos_quadbin.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "cell", + "cType": "Quadbin", + "canonical": "unsigned long" + } + ] + }, + { + "name": "ever_ne_quadbin_tquadbin", + "file": "meos_quadbin.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "cell", + "cType": "Quadbin", + "canonical": "unsigned long" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_ne_tquadbin_quadbin", + "file": "meos_quadbin.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "cell", + "cType": "Quadbin", + "canonical": "unsigned long" + } + ] + }, + { + "name": "always_eq_quadbin_tquadbin", + "file": "meos_quadbin.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "cell", + "cType": "Quadbin", + "canonical": "unsigned long" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_eq_tquadbin_quadbin", + "file": "meos_quadbin.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "cell", + "cType": "Quadbin", + "canonical": "unsigned long" + } + ] + }, + { + "name": "always_ne_quadbin_tquadbin", + "file": "meos_quadbin.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "cell", + "cType": "Quadbin", + "canonical": "unsigned long" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_ne_tquadbin_quadbin", + "file": "meos_quadbin.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "cell", + "cType": "Quadbin", + "canonical": "unsigned long" + } + ] + }, + { + "name": "ever_eq_tquadbin_tquadbin", + "file": "meos_quadbin.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_ne_tquadbin_tquadbin", + "file": "meos_quadbin.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_eq_tquadbin_tquadbin", + "file": "meos_quadbin.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_ne_tquadbin_tquadbin", + "file": "meos_quadbin.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "teq_quadbin_tquadbin", + "file": "meos_quadbin.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "cell", + "cType": "Quadbin", + "canonical": "unsigned long" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "teq_tquadbin_quadbin", + "file": "meos_quadbin.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "cell", + "cType": "Quadbin", + "canonical": "unsigned long" + } + ] + }, + { + "name": "teq_tquadbin_tquadbin", + "file": "meos_quadbin.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tne_quadbin_tquadbin", + "file": "meos_quadbin.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "cell", + "cType": "Quadbin", + "canonical": "unsigned long" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tne_tquadbin_quadbin", + "file": "meos_quadbin.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "cell", + "cType": "Quadbin", + "canonical": "unsigned long" + } + ] + }, + { + "name": "tne_tquadbin_tquadbin", + "file": "meos_quadbin.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tquadbin_cell_to_quadkey", + "file": "meos_quadbin.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "trgeometry_out", + "file": "meos_rgeo.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "trgeometryinst_make", + "file": "meos_rgeo.h", + "returnType": { + "c": "TInstant *", + "canonical": "struct TInstant *" + }, + "params": [ + { + "name": "geom", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "geo_tpose_to_trgeometry", + "file": "meos_rgeo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "trgeometry_to_tpose", + "file": "meos_rgeo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "trgeometry_to_tpoint", + "file": "meos_rgeo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "trgeometry_to_tgeometry", + "file": "meos_rgeo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "trgeometry_end_instant", + "file": "meos_rgeo.h", + "returnType": { + "c": "TInstant *", + "canonical": "struct TInstant *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "trgeometry_end_sequence", + "file": "meos_rgeo.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "trgeometry_end_value", + "file": "meos_rgeo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "trgeometry_geom", + "file": "meos_rgeo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "trgeometry_instant_n", + "file": "meos_rgeo.h", + "returnType": { + "c": "TInstant *", + "canonical": "struct TInstant *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "n", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "trgeometry_instants", + "file": "meos_rgeo.h", + "returnType": { + "c": "TInstant **", + "canonical": "struct TInstant **" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "trgeometry_points", + "file": "meos_rgeo.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "trgeometry_rotation", + "file": "meos_rgeo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "trgeometry_segments", + "file": "meos_rgeo.h", + "returnType": { + "c": "TSequence **", + "canonical": "struct TSequence **" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "trgeometry_sequence_n", + "file": "meos_rgeo.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "trgeometry_sequences", + "file": "meos_rgeo.h", + "returnType": { + "c": "TSequence **", + "canonical": "struct TSequence **" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "trgeometry_start_instant", + "file": "meos_rgeo.h", + "returnType": { + "c": "TInstant *", + "canonical": "struct TInstant *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "trgeometry_start_sequence", + "file": "meos_rgeo.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "trgeometry_start_value", + "file": "meos_rgeo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "trgeometry_value_n", + "file": "meos_rgeo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "n", + "cType": "int", + "canonical": "int" + }, + { + "name": "result", + "cType": "int **", + "canonical": "int **" + } + ] + }, + { + "name": "trgeometry_traversed_area", + "file": "meos_rgeo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "unary_union", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "trgeometry_centroid", + "file": "meos_rgeo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "trgeometry_convex_hull", + "file": "meos_rgeo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "trgeometry_body_point_trajectory", + "file": "meos_rgeo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "trgeometry_space_boxes", + "file": "meos_rgeo.h", + "returnType": { + "c": "STBox *", + "canonical": "struct STBox *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "xsize", + "cType": "double", + "canonical": "double" + }, + { + "name": "ysize", + "cType": "double", + "canonical": "double" + }, + { + "name": "zsize", + "cType": "double", + "canonical": "double" + }, + { + "name": "sorigin", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "bitmatrix", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "border_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "trgeometry_space_time_boxes", + "file": "meos_rgeo.h", + "returnType": { + "c": "STBox *", + "canonical": "struct STBox *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "xsize", + "cType": "double", + "canonical": "double" + }, + { + "name": "ysize", + "cType": "double", + "canonical": "double" + }, + { + "name": "zsize", + "cType": "double", + "canonical": "double" + }, + { + "name": "duration", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "sorigin", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "torigin", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "bitmatrix", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "border_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "trgeometry_stboxes", + "file": "meos_rgeo.h", + "returnType": { + "c": "STBox *", + "canonical": "struct STBox *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "trgeometry_split_n_stboxes", + "file": "meos_rgeo.h", + "returnType": { + "c": "STBox *", + "canonical": "struct STBox *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box_count", + "cType": "int", + "canonical": "int" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "trgeometry_split_each_n_stboxes", + "file": "meos_rgeo.h", + "returnType": { + "c": "STBox *", + "canonical": "struct STBox *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "elem_count", + "cType": "int", + "canonical": "int" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "trgeometry_hausdorff_distance", + "file": "meos_rgeo.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "trgeometry_frechet_distance", + "file": "meos_rgeo.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "trgeometry_dyntimewarp_distance", + "file": "meos_rgeo.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "trgeometry_frechet_path", + "file": "meos_rgeo.h", + "returnType": { + "c": "Match *", + "canonical": "Match *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "trgeometry_dyntimewarp_path", + "file": "meos_rgeo.h", + "returnType": { + "c": "Match *", + "canonical": "Match *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "trgeometry_length", + "file": "meos_rgeo.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "trgeometry_cumulative_length", + "file": "meos_rgeo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "trgeometry_speed", + "file": "meos_rgeo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "trgeometry_twcentroid", + "file": "meos_rgeo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "trgeometry_append_tinstant", + "file": "meos_rgeo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "Temporal *", + "canonical": "Temporal *" + }, + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const struct TInstant *" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + }, + { + "name": "maxdist", + "cType": "double", + "canonical": "double" + }, + { + "name": "maxt", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "expand", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "trgeometry_append_tsequence", + "file": "meos_rgeo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "Temporal *", + "canonical": "Temporal *" + }, + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "expand", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "trgeometry_delete_timestamptz", + "file": "meos_rgeo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "connect", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "trgeometry_delete_tstzset", + "file": "meos_rgeo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "connect", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "trgeometry_delete_tstzspan", + "file": "meos_rgeo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "connect", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "trgeometry_delete_tstzspanset", + "file": "meos_rgeo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "connect", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "trgeometry_round", + "file": "meos_rgeo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "trgeometry_set_interp", + "file": "meos_rgeo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "trgeometry_to_tinstant", + "file": "meos_rgeo.h", + "returnType": { + "c": "TInstant *", + "canonical": "struct TInstant *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "trgeometry_after_timestamptz", + "file": "meos_rgeo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "strict", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "trgeometry_before_timestamptz", + "file": "meos_rgeo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "strict", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "trgeometry_restrict_values", + "file": "meos_rgeo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "trgeometry_restrict_timestamptz", + "file": "meos_rgeo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "trgeometry_restrict_tstzset", + "file": "meos_rgeo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "trgeometry_restrict_tstzspan", + "file": "meos_rgeo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "trgeometry_restrict_tstzspanset", + "file": "meos_rgeo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "trgeometry_at_geom", + "file": "meos_rgeo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "trgeometry_minus_geom", + "file": "meos_rgeo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "trgeometry_at_stbox", + "file": "meos_rgeo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "border_inc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "trgeometry_minus_stbox", + "file": "meos_rgeo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "border_inc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tdistance_trgeometry_geo", + "file": "meos_rgeo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "tdistance_trgeometry_tpoint", + "file": "meos_rgeo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tdistance_trgeometry_trgeometry", + "file": "meos_rgeo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "nad_stbox_trgeometry", + "file": "meos_rgeo.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "nad_trgeometry_geo", + "file": "meos_rgeo.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "nad_trgeometry_stbox", + "file": "meos_rgeo.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + } + ] + }, + { + "name": "nad_trgeometry_tpoint", + "file": "meos_rgeo.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "nad_trgeometry_trgeometry", + "file": "meos_rgeo.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "nai_trgeometry_geo", + "file": "meos_rgeo.h", + "returnType": { + "c": "TInstant *", + "canonical": "struct TInstant *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "nai_trgeometry_tpoint", + "file": "meos_rgeo.h", + "returnType": { + "c": "TInstant *", + "canonical": "struct TInstant *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "nai_trgeometry_trgeometry", + "file": "meos_rgeo.h", + "returnType": { + "c": "TInstant *", + "canonical": "struct TInstant *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "shortestline_trgeometry_geo", + "file": "meos_rgeo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "shortestline_trgeometry_tpoint", + "file": "meos_rgeo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "shortestline_trgeometry_trgeometry", + "file": "meos_rgeo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_eq_geo_trgeometry", + "file": "meos_rgeo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_eq_trgeometry_geo", + "file": "meos_rgeo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "always_eq_trgeometry_trgeometry", + "file": "meos_rgeo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_ne_geo_trgeometry", + "file": "meos_rgeo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_ne_trgeometry_geo", + "file": "meos_rgeo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "always_ne_trgeometry_trgeometry", + "file": "meos_rgeo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_eq_geo_trgeometry", + "file": "meos_rgeo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_eq_trgeometry_geo", + "file": "meos_rgeo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "ever_eq_trgeometry_trgeometry", + "file": "meos_rgeo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_ne_geo_trgeometry", + "file": "meos_rgeo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_ne_trgeometry_geo", + "file": "meos_rgeo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "ever_ne_trgeometry_trgeometry", + "file": "meos_rgeo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "teq_geo_trgeometry", + "file": "meos_rgeo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "teq_trgeometry_geo", + "file": "meos_rgeo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "tne_geo_trgeometry", + "file": "meos_rgeo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tne_trgeometry_geo", + "file": "meos_rgeo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "econtains_geo_trgeometry", + "file": "meos_rgeo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "acontains_geo_trgeometry", + "file": "meos_rgeo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ecovers_geo_trgeometry", + "file": "meos_rgeo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "acovers_geo_trgeometry", + "file": "meos_rgeo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ecovers_trgeometry_geo", + "file": "meos_rgeo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "acovers_trgeometry_geo", + "file": "meos_rgeo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "edisjoint_trgeometry_geo", + "file": "meos_rgeo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "adisjoint_trgeometry_geo", + "file": "meos_rgeo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "eintersects_trgeometry_geo", + "file": "meos_rgeo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "aintersects_trgeometry_geo", + "file": "meos_rgeo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "etouches_trgeometry_geo", + "file": "meos_rgeo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "atouches_trgeometry_geo", + "file": "meos_rgeo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "edwithin_trgeometry_geo", + "file": "meos_rgeo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "dist", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "adwithin_trgeometry_geo", + "file": "meos_rgeo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "dist", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "edisjoint_trgeometry_trgeometry", + "file": "meos_rgeo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "adisjoint_trgeometry_trgeometry", + "file": "meos_rgeo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "eintersects_trgeometry_trgeometry", + "file": "meos_rgeo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "aintersects_trgeometry_trgeometry", + "file": "meos_rgeo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "edwithin_trgeometry_trgeometry", + "file": "meos_rgeo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "dist", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "adwithin_trgeometry_trgeometry", + "file": "meos_rgeo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "dist", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "ensure_valid_tnpoint_npoint", + "file": "tnpoint.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + } + ] + }, + { + "name": "ensure_valid_tnpoint_npointset", + "file": "tnpoint.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "ensure_valid_tnpoint_geo", + "file": "tnpoint.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "ensure_valid_tnpoint_stbox", + "file": "tnpoint.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + } + ] + }, + { + "name": "ensure_valid_tnpoint_tnpoint", + "file": "tnpoint.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tnpointsegm_intersection", + "file": "tnpoint.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "start1", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "end1", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "start2", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "end2", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "lower", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "upper", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "t1", + "cType": "TimestampTz *", + "canonical": "long *" + }, + { + "name": "t2", + "cType": "TimestampTz *", + "canonical": "long *" + } + ] + }, + { + "name": "common_rid_tnpoint_npoint", + "file": "tnpoint.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + } + ] + }, + { + "name": "common_rid_tnpoint_npointset", + "file": "tnpoint.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "common_rid_tnpoint_tnpoint", + "file": "tnpoint.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "npoint_collinear", + "file": "tnpoint.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "np1", + "cType": "const Npoint *", + "canonical": "const Npoint *" + }, + { + "name": "np2", + "cType": "const Npoint *", + "canonical": "const Npoint *" + }, + { + "name": "np3", + "cType": "const Npoint *", + "canonical": "const Npoint *" + }, + { + "name": "ratio", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "npointsegm_interpolate", + "file": "tnpoint.h", + "returnType": { + "c": "Npoint *", + "canonical": "Npoint *" + }, + "params": [ + { + "name": "start", + "cType": "const Npoint *", + "canonical": "const Npoint *" + }, + { + "name": "end", + "cType": "const Npoint *", + "canonical": "const Npoint *" + }, + { + "name": "ratio", + "cType": "long double", + "canonical": "long double" + } + ] + }, + { + "name": "npointsegm_locate", + "file": "tnpoint.h", + "returnType": { + "c": "long double", + "canonical": "long double" + }, + "params": [ + { + "name": "start", + "cType": "const Npoint *", + "canonical": "const Npoint *" + }, + { + "name": "end", + "cType": "const Npoint *", + "canonical": "const Npoint *" + }, + { + "name": "value", + "cType": "const Npoint *", + "canonical": "const Npoint *" + } + ] + }, + { + "name": "npointarr_geom", + "file": "tnpoint.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "points", + "cType": "Npoint **", + "canonical": "Npoint **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "nsegmentarr_geom", + "file": "tnpoint.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "segments", + "cType": "Nsegment **", + "canonical": "Nsegment **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "nsegmentarr_normalize", + "file": "tnpoint.h", + "returnType": { + "c": "Nsegment **", + "canonical": "Nsegment **" + }, + "params": [ + { + "name": "segments", + "cType": "Nsegment **", + "canonical": "Nsegment **" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "npoint_wkt_out", + "file": "tnpoint.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "npoint_set", + "file": "tnpoint.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "rid", + "cType": "int64", + "canonical": "long" + }, + { + "name": "pos", + "cType": "double", + "canonical": "double" + }, + { + "name": "np", + "cType": "Npoint *", + "canonical": "Npoint *" + } + ] + }, + { + "name": "nsegment_set", + "file": "tnpoint.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "rid", + "cType": "int64", + "canonical": "long" + }, + { + "name": "pos1", + "cType": "double", + "canonical": "double" + }, + { + "name": "pos2", + "cType": "double", + "canonical": "double" + }, + { + "name": "ns", + "cType": "Nsegment *", + "canonical": "Nsegment *" + } + ] + }, + { + "name": "datum_npoint_round", + "file": "tnpoint.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "npoint", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "size", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "tnpointinst_tgeompointinst", + "file": "tnpoint.h", + "returnType": { + "c": "TInstant *", + "canonical": "struct TInstant *" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const struct TInstant *" + } + ] + }, + { + "name": "tnpointseq_tgeompointseq_disc", + "file": "tnpoint.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "is", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + } + ] + }, + { + "name": "tnpointseq_tgeompointseq_cont", + "file": "tnpoint.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + } + ] + }, + { + "name": "tnpointseqset_tgeompointseqset", + "file": "tnpoint.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const struct TSequenceSet *" + } + ] + }, + { + "name": "tgeompointinst_tnpointinst", + "file": "tnpoint.h", + "returnType": { + "c": "TInstant *", + "canonical": "struct TInstant *" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const struct TInstant *" + } + ] + }, + { + "name": "tgeompointseq_tnpointseq", + "file": "tnpoint.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + } + ] + }, + { + "name": "tgeompointseqset_tnpointseqset", + "file": "tnpoint.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const struct TSequenceSet *" + } + ] + }, + { + "name": "tnpointinst_positions", + "file": "tnpoint.h", + "returnType": { + "c": "Nsegment **", + "canonical": "Nsegment **" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const struct TInstant *" + } + ] + }, + { + "name": "tnpointseq_positions", + "file": "tnpoint.h", + "returnType": { + "c": "Nsegment **", + "canonical": "Nsegment **" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tnpointseqset_positions", + "file": "tnpoint.h", + "returnType": { + "c": "Nsegment **", + "canonical": "Nsegment **" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const struct TSequenceSet *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tnpointinst_route", + "file": "tnpoint.h", + "returnType": { + "c": "int64", + "canonical": "long" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const struct TInstant *" + } + ] + }, + { + "name": "tnpointinst_routes", + "file": "tnpoint.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const struct TInstant *" + } + ] + }, + { + "name": "tnpointseq_disc_routes", + "file": "tnpoint.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "is", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + } + ] + }, + { + "name": "tnpointseq_cont_routes", + "file": "tnpoint.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + } + ] + }, + { + "name": "tnpointseqset_routes", + "file": "tnpoint.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const struct TSequenceSet *" + } + ] + }, + { + "name": "tnpointseq_linear_positions", + "file": "tnpoint.h", + "returnType": { + "c": "Nsegment *", + "canonical": "Nsegment *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + } + ] + }, + { + "name": "tnpoint_restrict_stbox", + "file": "tnpoint.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "border_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tnpoint_restrict_npoint", + "file": "tnpoint.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tnpoint_restrict_npointset", + "file": "tnpoint.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "npoint_set_stbox", + "file": "tnpoint_boxops.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + }, + { + "name": "box", + "cType": "STBox *", + "canonical": "struct STBox *" + } + ] + }, + { + "name": "npointarr_set_stbox", + "file": "tnpoint_boxops.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "values", + "cType": "Datum *", + "canonical": "int ((*)(int *))()" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "box", + "cType": "STBox *", + "canonical": "struct STBox *" + } + ] + }, + { + "name": "nsegment_set_stbox", + "file": "tnpoint_boxops.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ns", + "cType": "const Nsegment *", + "canonical": "const Nsegment *" + }, + { + "name": "box", + "cType": "STBox *", + "canonical": "struct STBox *" + } + ] + }, + { + "name": "npoint_timestamptz_set_stbox", + "file": "tnpoint_boxops.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "box", + "cType": "STBox *", + "canonical": "struct STBox *" + } + ] + }, + { + "name": "npoint_tstzspan_set_stbox", + "file": "tnpoint_boxops.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "box", + "cType": "STBox *", + "canonical": "struct STBox *" + } + ] + }, + { + "name": "tnpointinst_set_stbox", + "file": "tnpoint_boxops.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const struct TInstant *" + }, + { + "name": "box", + "cType": "STBox *", + "canonical": "struct STBox *" + } + ] + }, + { + "name": "tnpointinstarr_set_stbox", + "file": "tnpoint_boxops.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "inst", + "cType": "TInstant **", + "canonical": "struct TInstant **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + }, + { + "name": "box", + "cType": "STBox *", + "canonical": "struct STBox *" + } + ] + }, + { + "name": "tnpointseq_expand_stbox", + "file": "tnpoint_boxops.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const struct TInstant *" + } + ] + }, + { + "name": "datum_npoint_distance", + "file": "tnpoint_distance.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "np1", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "np2", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "npoint_parse", + "file": "tnpoint_parser.h", + "returnType": { + "c": "Npoint *", + "canonical": "Npoint *" + }, + "params": [ + { + "name": "str", + "cType": "const char **", + "canonical": "const char **" + }, + { + "name": "end", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "nsegment_parse", + "file": "tnpoint_parser.h", + "returnType": { + "c": "Nsegment *", + "canonical": "Nsegment *" + }, + "params": [ + { + "name": "str", + "cType": "const char **", + "canonical": "const char **" + } + ] + }, + { + "name": "contains_rid_tnpoint_bigint", + "file": "tnpoint_routeops.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "rid", + "cType": "int64", + "canonical": "long" + }, + { + "name": "invert", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "contained_rid_tnpoint_bigint", + "file": "tnpoint_routeops.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "rid", + "cType": "int64", + "canonical": "long" + }, + { + "name": "invert", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "same_rid_tnpoint_bigint", + "file": "tnpoint_routeops.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "rid", + "cType": "int64", + "canonical": "long" + }, + { + "name": "invert", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "overlaps_rid_tnpoint_bigintset", + "file": "tnpoint_routeops.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "invert", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "contains_rid_tnpoint_bigintset", + "file": "tnpoint_routeops.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "invert", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "contained_rid_tnpoint_bigintset", + "file": "tnpoint_routeops.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "invert", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "same_rid_tnpoint_bigintset", + "file": "tnpoint_routeops.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "invert", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "contains_rid_tnpoint_npoint", + "file": "tnpoint_routeops.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + }, + { + "name": "invert", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "contained_rid_npoint_tnpoint", + "file": "tnpoint_routeops.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + }, + { + "name": "invert", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "same_rid_tnpoint_npoint", + "file": "tnpoint_routeops.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + }, + { + "name": "invert", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "overlaps_rid_tnpoint_tnpoint", + "file": "tnpoint_routeops.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "contains_rid_tnpoint_tnpoint", + "file": "tnpoint_routeops.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "contained_rid_tnpoint_tnpoint", + "file": "tnpoint_routeops.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "same_rid_tnpoint_tnpoint", + "file": "tnpoint_routeops.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ensure_same_rid_tnpointinst", + "file": "tnpoint_spatialfuncs.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "inst1", + "cType": "const TInstant *", + "canonical": "const struct TInstant *" + }, + { + "name": "inst2", + "cType": "const TInstant *", + "canonical": "const struct TInstant *" + } + ] + }, + { + "name": "tnpoint_restrict_geom", + "file": "tnpoint_spatialfuncs.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "meos_pc_schema_get_srid", + "file": "meos_schema_hook.h", + "returnType": { + "c": "int32_t", + "canonical": "int" + }, + "params": [ + { + "name": "pcid", + "cType": "uint32_t", + "canonical": "unsigned int" + } + ] + }, + { + "name": "ensure_same_pcid_pcpatch", + "file": "pcpatch.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "pa1", + "cType": "const Pcpatch *", + "canonical": "const struct Pcpatch *" + }, + { + "name": "pa2", + "cType": "const Pcpatch *", + "canonical": "const struct Pcpatch *" + } + ] + }, + { + "name": "ensure_valid_pcpatchset_pcpatch", + "file": "pcpatch.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "pa", + "cType": "const Pcpatch *", + "canonical": "const struct Pcpatch *" + } + ] + }, + { + "name": "pcpatch_parse", + "file": "pcpatch.h", + "returnType": { + "c": "Pcpatch *", + "canonical": "struct Pcpatch *" + }, + "params": [ + { + "name": "str", + "cType": "const char **", + "canonical": "const char **" + }, + { + "name": "end", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "pcpatch_filter_per_point", + "file": "pcpatch_decompose.h", + "returnType": { + "c": "Pcpatch *", + "canonical": "struct Pcpatch *" + }, + "params": [ + { + "name": "pa", + "cType": "const Pcpatch *", + "canonical": "const struct Pcpatch *" + }, + { + "name": "pred", + "cType": "pcpatch_pointpred_fn", + "canonical": "_Bool (*)(const int *, void *)" + }, + { + "name": "extra", + "cType": "void *", + "canonical": "void *" + }, + { + "name": "keep_when_true", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "pcpatch_any_point_matches", + "file": "pcpatch_decompose.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "pa", + "cType": "const Pcpatch *", + "canonical": "const struct Pcpatch *" + }, + { + "name": "pred", + "cType": "pcpatch_pointpred_fn", + "canonical": "_Bool (*)(const int *, void *)" + }, + { + "name": "extra", + "cType": "void *", + "canonical": "void *" + } + ] + }, + { + "name": "pcpoint_in_tpcbox", + "file": "pcpatch_decompose.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "pt", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "extra", + "cType": "void *", + "canonical": "void *" + } + ] + }, + { + "name": "pcpoint_intersects_geometry", + "file": "pcpatch_decompose.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "pt", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "extra", + "cType": "void *", + "canonical": "void *" + } + ] + }, + { + "name": "ensure_same_pcid_pcpoint", + "file": "pcpoint.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "pt1", + "cType": "const Pcpoint *", + "canonical": "const struct Pcpoint *" + }, + { + "name": "pt2", + "cType": "const Pcpoint *", + "canonical": "const struct Pcpoint *" + } + ] + }, + { + "name": "ensure_valid_pcpointset_pcpoint", + "file": "pcpoint.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "pt", + "cType": "const Pcpoint *", + "canonical": "const struct Pcpoint *" + } + ] + }, + { + "name": "pcpoint_parse", + "file": "pcpoint.h", + "returnType": { + "c": "Pcpoint *", + "canonical": "struct Pcpoint *" + }, + "params": [ + { + "name": "str", + "cType": "const char **", + "canonical": "const char **" + }, + { + "name": "end", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "meos_pc_point_serialize", + "file": "pgsql_compat.h", + "returnType": { + "c": "SERIALIZED_POINT *", + "canonical": "SERIALIZED_POINT *" + }, + "params": [ + { + "name": "pcpt", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "meos_pc_point_deserialize", + "file": "pgsql_compat.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "serpt", + "cType": "const SERIALIZED_POINT *", + "canonical": "const SERIALIZED_POINT *" + }, + { + "name": "schema", + "cType": "const PCSCHEMA *", + "canonical": "const struct PCSCHEMA *" + } + ] + }, + { + "name": "meos_pc_patch_serialized_size", + "file": "pgsql_compat.h", + "returnType": { + "c": "size_t", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "patch", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "meos_pc_patch_serialize", + "file": "pgsql_compat.h", + "returnType": { + "c": "SERIALIZED_PATCH *", + "canonical": "struct SERIALIZED_PATCH *" + }, + "params": [ + { + "name": "patch_in", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "userdata", + "cType": "void *", + "canonical": "void *" + } + ] + }, + { + "name": "meos_pc_patch_serialize_to_uncompressed", + "file": "pgsql_compat.h", + "returnType": { + "c": "SERIALIZED_PATCH *", + "canonical": "struct SERIALIZED_PATCH *" + }, + "params": [ + { + "name": "patch_in", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "meos_pc_patch_deserialize", + "file": "pgsql_compat.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "serpatch", + "cType": "const SERIALIZED_PATCH *", + "canonical": "const struct SERIALIZED_PATCH *" + }, + { + "name": "schema", + "cType": "const PCSCHEMA *", + "canonical": "const struct PCSCHEMA *" + } + ] + }, + { + "name": "tpointcloudinst_set_tpcbox", + "file": "tpc_boxops.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const struct TInstant *" + }, + { + "name": "box", + "cType": "TPCBox *", + "canonical": "struct TPCBox *" + } + ] + }, + { + "name": "tpointcloudinstarr_set_tpcbox", + "file": "tpc_boxops.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "instants", + "cType": "TInstant **", + "canonical": "struct TInstant **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "lower_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "upper_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + }, + { + "name": "box", + "cType": "TPCBox *", + "canonical": "struct TPCBox *" + } + ] + }, + { + "name": "tpointcloudseq_expand_tpcbox", + "file": "tpc_boxops.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "seq", + "cType": "TSequence *", + "canonical": "struct TSequence *" + }, + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const struct TInstant *" + } + ] + }, + { + "name": "tpointcloudseqarr_set_tpcbox", + "file": "tpc_boxops.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "sequences", + "cType": "TSequence **", + "canonical": "struct TSequence **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "box", + "cType": "TPCBox *", + "canonical": "struct TPCBox *" + } + ] + }, + { + "name": "tpcbox_extent_transfn", + "file": "tpc_boxops.h", + "returnType": { + "c": "TPCBox *", + "canonical": "struct TPCBox *" + }, + "params": [ + { + "name": "state", + "cType": "TPCBox *", + "canonical": "struct TPCBox *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "boxop_tpointcloud_tpcbox", + "file": "tpc_boxops.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const TPCBox *", + "canonical": "const struct TPCBox *" + }, + { + "name": "func", + "cType": "bool (*)(const TPCBox *, const TPCBox *)", + "canonical": "_Bool (*)(const struct _Bool ()( TPCBox , TPCBox ) *, const struct _Bool ()( TPCBox , TPCBox ) *)" + }, + { + "name": "inverted", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "boxop_tpointcloud_tpointcloud", + "file": "tpc_boxops.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "func", + "cType": "bool (*)(const TPCBox *, const TPCBox *)", + "canonical": "_Bool (*)(const struct _Bool ()( TPCBox , TPCBox ) *, const struct _Bool ()( TPCBox , TPCBox ) *)" + } + ] + }, + { + "name": "tpcbox_set_stbox", + "file": "tpc_boxops.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "src", + "cType": "const TPCBox *", + "canonical": "const struct TPCBox *" + }, + { + "name": "dst", + "cType": "STBox *", + "canonical": "struct STBox *" + } + ] + }, + { + "name": "nad_tpcbox_tpcbox", + "file": "tpc_boxops.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "box1", + "cType": "const TPCBox *", + "canonical": "const struct TPCBox *" + }, + { + "name": "box2", + "cType": "const TPCBox *", + "canonical": "const struct TPCBox *" + } + ] + }, + { + "name": "nad_tpointcloud_tpcbox", + "file": "tpc_boxops.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const TPCBox *", + "canonical": "const struct TPCBox *" + } + ] + }, + { + "name": "nad_tpointcloud_tpointcloud", + "file": "tpc_boxops.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tpcbox_index_leaf_consistent", + "file": "tpcbox_index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "key", + "cType": "const TPCBox *", + "canonical": "const struct TPCBox *" + }, + { + "name": "query", + "cType": "const TPCBox *", + "canonical": "const struct TPCBox *" + }, + { + "name": "strategy", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "tpcbox_gist_inner_consistent", + "file": "tpcbox_index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "key", + "cType": "const TPCBox *", + "canonical": "const struct TPCBox *" + }, + { + "name": "query", + "cType": "const TPCBox *", + "canonical": "const struct TPCBox *" + }, + { + "name": "strategy", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "tpcbox_index_recheck", + "file": "tpcbox_index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "strategy", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "ensure_valid_pose_geo", + "file": "pose.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "ensure_valid_pose_stbox", + "file": "pose.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + } + ] + }, + { + "name": "ensure_valid_pose_pose", + "file": "pose.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "pose1", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "pose2", + "cType": "const Pose *", + "canonical": "const struct Pose *" + } + ] + }, + { + "name": "ensure_valid_poseset_pose", + "file": "pose.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + } + ] + }, + { + "name": "pose_collinear", + "file": "pose.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "pose1", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "pose2", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "pose3", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "ratio", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "posesegm_interpolate", + "file": "pose.h", + "returnType": { + "c": "Pose *", + "canonical": "struct Pose *" + }, + "params": [ + { + "name": "start", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "end", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "ratio", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "posesegm_locate", + "file": "pose.h", + "returnType": { + "c": "long double", + "canonical": "long double" + }, + "params": [ + { + "name": "start", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "end", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "value", + "cType": "const Pose *", + "canonical": "const struct Pose *" + } + ] + }, + { + "name": "pose_wkt_out", + "file": "pose.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "extended", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "pose_parse", + "file": "pose.h", + "returnType": { + "c": "Pose *", + "canonical": "struct Pose *" + }, + "params": [ + { + "name": "str", + "cType": "const char **", + "canonical": "const char **" + }, + { + "name": "end", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "datum_pose_point", + "file": "pose.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "pose", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_pose_geopoint", + "file": "pose.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "pose", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_pose_rotation", + "file": "pose.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "pose", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_pose_yaw", + "file": "pose.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "pose", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_pose_pitch", + "file": "pose.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "pose", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_pose_roll", + "file": "pose.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "pose", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_pose_apply_geo", + "file": "pose.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "pose", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "body", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_pose_round", + "file": "pose.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "pose", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "size", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "pose_distance", + "file": "pose.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "pose1", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "pose2", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "pose_set_stbox", + "file": "pose.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "box", + "cType": "STBox *", + "canonical": "struct STBox *" + } + ] + }, + { + "name": "posearr_set_stbox", + "file": "pose.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "values", + "cType": "Datum *", + "canonical": "int ((*)(int *))()" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "box", + "cType": "STBox *", + "canonical": "struct STBox *" + } + ] + }, + { + "name": "pose_timestamptz_set_stbox", + "file": "pose.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "box", + "cType": "STBox *", + "canonical": "struct STBox *" + } + ] + }, + { + "name": "pose_tstzspan_set_stbox", + "file": "pose.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "p", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "box", + "cType": "STBox *", + "canonical": "struct STBox *" + } + ] + }, + { + "name": "ensure_valid_tpose_geo", + "file": "tpose.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "ensure_valid_tpose_pose", + "file": "tpose.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + } + ] + }, + { + "name": "ensure_valid_tpose_stbox", + "file": "tpose.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + } + ] + }, + { + "name": "ensure_valid_tpose_tpose", + "file": "tpose.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tposesegm_intersection_value", + "file": "tpose.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "start", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "end", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "lower", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "upper", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "t1", + "cType": "TimestampTz *", + "canonical": "long *" + }, + { + "name": "t2", + "cType": "TimestampTz *", + "canonical": "long *" + } + ] + }, + { + "name": "tposesegm_intersection", + "file": "tpose.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "start1", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "end1", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "start2", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "end2", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "lower", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "upper", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "t1", + "cType": "TimestampTz *", + "canonical": "long *" + }, + { + "name": "t2", + "cType": "TimestampTz *", + "canonical": "long *" + } + ] + }, + { + "name": "tposeinst_set_stbox", + "file": "tpose_boxops.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const struct TInstant *" + }, + { + "name": "box", + "cType": "STBox *", + "canonical": "struct STBox *" + } + ] + }, + { + "name": "tposeinstarr_set_stbox", + "file": "tpose_boxops.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "instants", + "cType": "TInstant **", + "canonical": "struct TInstant **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "box", + "cType": "STBox *", + "canonical": "struct STBox *" + } + ] + }, + { + "name": "tposeseq_expand_stbox", + "file": "tpose_boxops.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "seq", + "cType": "TSequence *", + "canonical": "struct TSequence *" + }, + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const struct TInstant *" + } + ] + }, + { + "name": "tpose_restrict_geom", + "file": "tpose_spatialfuncs.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tpose_restrict_stbox", + "file": "tpose_spatialfuncs.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "border_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tpose_restrict_elevation", + "file": "tpose_spatialfuncs.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "bool_in", + "file": "postgres_ext_defs.in.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "bool_out", + "file": "postgres_ext_defs.in.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "b", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "float8_out", + "file": "postgres_ext_defs.in.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "num", + "cType": "double", + "canonical": "double" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "date_in", + "file": "postgres_ext_defs.in.h", + "returnType": { + "c": "DateADT", + "canonical": "int" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "date_out", + "file": "postgres_ext_defs.in.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "date", + "cType": "DateADT", + "canonical": "int" + } + ] + }, + { + "name": "interval_cmp", + "file": "postgres_ext_defs.in.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "interv1", + "cType": "const Interval *", + "canonical": "const Interval *" + }, + { + "name": "interv2", + "cType": "const Interval *", + "canonical": "const Interval *" + } + ] + }, + { + "name": "interval_in", + "file": "postgres_ext_defs.in.h", + "returnType": { + "c": "Interval *", + "canonical": "Interval *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + }, + { + "name": "typmod", + "cType": "int32", + "canonical": "int" + } + ] + }, + { + "name": "interval_out", + "file": "postgres_ext_defs.in.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "interv", + "cType": "const Interval *", + "canonical": "const Interval *" + } + ] + }, + { + "name": "time_in", + "file": "postgres_ext_defs.in.h", + "returnType": { + "c": "TimeADT", + "canonical": "long" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + }, + { + "name": "typmod", + "cType": "int32", + "canonical": "int" + } + ] + }, + { + "name": "time_out", + "file": "postgres_ext_defs.in.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "time", + "cType": "TimeADT", + "canonical": "long" + } + ] + }, + { + "name": "timestamp_in", + "file": "postgres_ext_defs.in.h", + "returnType": { + "c": "Timestamp", + "canonical": "long" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + }, + { + "name": "typmod", + "cType": "int32", + "canonical": "int" + } + ] + }, + { + "name": "timestamp_out", + "file": "postgres_ext_defs.in.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "ts", + "cType": "Timestamp", + "canonical": "long" + } + ] + }, + { + "name": "timestamptz_in", + "file": "postgres_ext_defs.in.h", + "returnType": { + "c": "TimestampTz", + "canonical": "long" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + }, + { + "name": "typmod", + "cType": "int32", + "canonical": "int" + } + ] + }, + { + "name": "timestamptz_out", + "file": "postgres_ext_defs.in.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "tstz", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "cstring_to_text", + "file": "postgres_ext_defs.in.h", + "returnType": { + "c": "text *", + "canonical": "struct varlena *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "text_to_cstring", + "file": "postgres_ext_defs.in.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "txt", + "cType": "const text *", + "canonical": "const struct varlena *" + } + ] + }, + { + "name": "text_in", + "file": "postgres_ext_defs.in.h", + "returnType": { + "c": "text *", + "canonical": "struct varlena *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "text_out", + "file": "postgres_ext_defs.in.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "txt", + "cType": "const text *", + "canonical": "const struct varlena *" + } + ] + }, + { + "name": "text_cmp", + "file": "postgres_ext_defs.in.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "txt1", + "cType": "const text *", + "canonical": "const struct varlena *" + }, + { + "name": "txt2", + "cType": "const text *", + "canonical": "const struct varlena *" + }, + { + "name": "collid", + "cType": "Oid", + "canonical": "unsigned int" + } + ] + }, + { + "name": "text_copy", + "file": "postgres_ext_defs.in.h", + "returnType": { + "c": "text *", + "canonical": "struct varlena *" + }, + "params": [ + { + "name": "txt", + "cType": "const text *", + "canonical": "const struct varlena *" + } + ] + }, + { + "name": "text_initcap", + "file": "postgres_ext_defs.in.h", + "returnType": { + "c": "text *", + "canonical": "struct varlena *" + }, + "params": [ + { + "name": "txt", + "cType": "const text *", + "canonical": "const struct varlena *" + } + ] + }, + { + "name": "text_lower", + "file": "postgres_ext_defs.in.h", + "returnType": { + "c": "text *", + "canonical": "struct varlena *" + }, + "params": [ + { + "name": "txt", + "cType": "const text *", + "canonical": "const struct varlena *" + } + ] + }, + { + "name": "text_upper", + "file": "postgres_ext_defs.in.h", + "returnType": { + "c": "text *", + "canonical": "struct varlena *" + }, + "params": [ + { + "name": "txt", + "cType": "const text *", + "canonical": "const struct varlena *" + } + ] + }, + { + "name": "textcat_text_text", + "file": "postgres_ext_defs.in.h", + "returnType": { + "c": "text *", + "canonical": "struct varlena *" + }, + "params": [ + { + "name": "txt1", + "cType": "const text *", + "canonical": "const struct varlena *" + }, + { + "name": "txt2", + "cType": "const text *", + "canonical": "const struct varlena *" + } + ] + }, + { + "name": "ensure_valid_tquadbin_tquadbin", + "file": "tquadbin.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ensure_valid_tquadbin_quadbin", + "file": "tquadbin.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "cell", + "cType": "Quadbin", + "canonical": "unsigned long" + } + ] + }, + { + "name": "ensure_valid_tquadbin_tgeompoint", + "file": "tquadbin.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "datum2_quadbin_eq", + "file": "tquadbin.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "d1", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "d2", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "datum2_quadbin_ne", + "file": "tquadbin.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "d1", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "d2", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "quadbin_set_stbox", + "file": "tquadbin_boxops.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "cell", + "cType": "Quadbin", + "canonical": "unsigned long" + }, + { + "name": "box", + "cType": "STBox *", + "canonical": "struct STBox *" + } + ] + }, + { + "name": "quadbinarr_set_stbox", + "file": "tquadbin_boxops.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "values", + "cType": "Datum *", + "canonical": "int ((*)(int *))()" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "box", + "cType": "STBox *", + "canonical": "struct STBox *" + } + ] + }, + { + "name": "tquadbininst_set_stbox", + "file": "tquadbin_boxops.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const struct TInstant *" + }, + { + "name": "box", + "cType": "STBox *", + "canonical": "struct STBox *" + } + ] + }, + { + "name": "tquadbininstarr_set_stbox", + "file": "tquadbin_boxops.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "instants", + "cType": "TInstant **", + "canonical": "struct TInstant **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "box", + "cType": "STBox *", + "canonical": "struct STBox *" + } + ] + }, + { + "name": "tquadbinseq_expand_stbox", + "file": "tquadbin_boxops.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const struct TInstant *" + } + ] + }, + { + "name": "raster_tile_value_quadbin", + "file": "raster_quadbin.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "pixels", + "cType": "const uint8_t *", + "canonical": "const unsigned char *" + }, + { + "name": "width", + "cType": "uint16_t", + "canonical": "unsigned short" + }, + { + "name": "height", + "cType": "uint16_t", + "canonical": "unsigned short" + }, + { + "name": "quadbin", + "cType": "uint64", + "canonical": "unsigned long" + }, + { + "name": "pixtype", + "cType": "int", + "canonical": "int" + }, + { + "name": "nodata", + "cType": "double", + "canonical": "double" + }, + { + "name": "has_nodata", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "traj", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "trajectory_quadbins", + "file": "raster_quadbin.h", + "returnType": { + "c": "uint64 *", + "canonical": "unsigned long *" + }, + "params": [ + { + "name": "traj", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "zoom", + "cType": "uint32_t", + "canonical": "unsigned int" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "ensure_has_geom", + "file": "trgeo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "flags", + "cType": "int16", + "canonical": "short" + } + ] + }, + { + "name": "ensure_valid_trgeo_geo", + "file": "trgeo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const GSERIALIZED *", + "canonical": "const GSERIALIZED *" + } + ] + }, + { + "name": "ensure_valid_trgeo_stbox", + "file": "trgeo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + } + ] + }, + { + "name": "ensure_valid_trgeo_trgeo", + "file": "trgeo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ensure_valid_trgeo_tpoint", + "file": "trgeo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "trgeo_geom_p", + "file": "trgeo.h", + "returnType": { + "c": "const GSERIALIZED *", + "canonical": "const GSERIALIZED *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "trgeo_wkt_out", + "file": "trgeo.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + }, + { + "name": "extended", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "geo_tposeinst_to_trgeo", + "file": "trgeo.h", + "returnType": { + "c": "TInstant *", + "canonical": "struct TInstant *" + }, + "params": [ + { + "name": "gs", + "cType": "const GSERIALIZED *", + "canonical": "const GSERIALIZED *" + }, + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const struct TInstant *" + } + ] + }, + { + "name": "geo_tposeseq_to_trgeo", + "file": "trgeo.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "gs", + "cType": "const GSERIALIZED *", + "canonical": "const GSERIALIZED *" + }, + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + } + ] + }, + { + "name": "geo_tposeseqset_to_trgeo", + "file": "trgeo.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "gs", + "cType": "const GSERIALIZED *", + "canonical": "const GSERIALIZED *" + }, + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const struct TSequenceSet *" + } + ] + }, + { + "name": "trgeo_value_at_timestamptz", + "file": "trgeo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "strict", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "result", + "cType": "Datum *", + "canonical": "int ((*)(int *))()" + } + ] + }, + { + "name": "trgeometry_restrict_value", + "file": "trgeo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "trgeoinst_geom_p", + "file": "trgeo_inst.h", + "returnType": { + "c": "const GSERIALIZED *", + "canonical": "const GSERIALIZED *" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const struct TInstant *" + } + ] + }, + { + "name": "trgeoinst_pose_varsize", + "file": "trgeo_inst.h", + "returnType": { + "c": "size_t", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const struct TInstant *" + } + ] + }, + { + "name": "trgeoinst_set_pose", + "file": "trgeo_inst.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "inst", + "cType": "TInstant *", + "canonical": "struct TInstant *" + } + ] + }, + { + "name": "trgeoinst_tposeinst", + "file": "trgeo_inst.h", + "returnType": { + "c": "TInstant *", + "canonical": "struct TInstant *" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const struct TInstant *" + } + ] + }, + { + "name": "trgeoinst_make1", + "file": "trgeo_inst.h", + "returnType": { + "c": "TInstant *", + "canonical": "struct TInstant *" + }, + "params": [ + { + "name": "geom", + "cType": "const GSERIALIZED *", + "canonical": "const GSERIALIZED *" + }, + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "trgeoseq_to_tinstant", + "file": "trgeo_inst.h", + "returnType": { + "c": "TInstant *", + "canonical": "struct TInstant *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + } + ] + }, + { + "name": "trgeoseqset_to_tinstant", + "file": "trgeo_inst.h", + "returnType": { + "c": "TInstant *", + "canonical": "struct TInstant *" + }, + "params": [ + { + "name": "ts", + "cType": "const TSequenceSet *", + "canonical": "const struct TSequenceSet *" + } + ] + }, + { + "name": "trgeo_restrict_geom", + "file": "trgeo_spatialfuncs.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const GSERIALIZED *", + "canonical": "const GSERIALIZED *" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "trgeo_restrict_stbox", + "file": "trgeo_spatialfuncs.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const struct STBox *" + }, + { + "name": "border_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "spatialrel_trgeo_trav_geo", + "file": "trgeo_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const GSERIALIZED *", + "canonical": "const GSERIALIZED *" + }, + { + "name": "param", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "func", + "cType": "varfunc", + "canonical": "int (*)(int ((*)(int *))(), ...)" + }, + { + "name": "numparam", + "cType": "int", + "canonical": "int" + }, + { + "name": "invert", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_contains_geo_trgeo", + "file": "trgeo_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "gs", + "cType": "const GSERIALIZED *", + "canonical": "const GSERIALIZED *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_contains_trgeo_geo", + "file": "trgeo_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const GSERIALIZED *", + "canonical": "const GSERIALIZED *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_contains_trgeo_trgeo", + "file": "trgeo_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_covers_geo_trgeo", + "file": "trgeo_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "gs", + "cType": "const GSERIALIZED *", + "canonical": "const GSERIALIZED *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_covers_trgeo_geo", + "file": "trgeo_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const GSERIALIZED *", + "canonical": "const GSERIALIZED *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_covers_trgeo_trgeo", + "file": "trgeo_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_disjoint_geo_trgeo", + "file": "trgeo_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "gs", + "cType": "const GSERIALIZED *", + "canonical": "const GSERIALIZED *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_disjoint_trgeo_geo", + "file": "trgeo_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const GSERIALIZED *", + "canonical": "const GSERIALIZED *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_disjoint_trgeo_trgeo", + "file": "trgeo_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_intersects_geo_trgeo", + "file": "trgeo_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "gs", + "cType": "const GSERIALIZED *", + "canonical": "const GSERIALIZED *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_intersects_trgeo_geo", + "file": "trgeo_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const GSERIALIZED *", + "canonical": "const GSERIALIZED *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_intersects_trgeo_trgeo", + "file": "trgeo_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_touches_geo_trgeo", + "file": "trgeo_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "gs", + "cType": "const GSERIALIZED *", + "canonical": "const GSERIALIZED *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_touches_trgeo_geo", + "file": "trgeo_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const GSERIALIZED *", + "canonical": "const GSERIALIZED *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_touches_trgeo_trgeo", + "file": "trgeo_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_dwithin_trgeo_geo", + "file": "trgeo_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const GSERIALIZED *", + "canonical": "const GSERIALIZED *" + }, + { + "name": "dist", + "cType": "double", + "canonical": "double" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_dwithin_trgeo_trgeo", + "file": "trgeo_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "dist", + "cType": "double", + "canonical": "double" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "trgeoseq_geom_p", + "file": "trgeo_seq.h", + "returnType": { + "c": "const GSERIALIZED *", + "canonical": "const GSERIALIZED *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + } + ] + }, + { + "name": "trgeoseq_pose_varsize", + "file": "trgeo_seq.h", + "returnType": { + "c": "size_t", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + } + ] + }, + { + "name": "trgeoseq_set_pose", + "file": "trgeo_seq.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "seq", + "cType": "TSequence *", + "canonical": "struct TSequence *" + } + ] + }, + { + "name": "trgeoseq_tposeseq", + "file": "trgeo_seq.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + } + ] + }, + { + "name": "trgeoseq_make_valid", + "file": "trgeo_seq.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "geom", + "cType": "const GSERIALIZED *", + "canonical": "const GSERIALIZED *" + }, + { + "name": "instants", + "cType": "TInstant **", + "canonical": "struct TInstant **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "lower_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "upper_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "linear", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "trgeoseq_make1_exp", + "file": "trgeo_seq.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "geom", + "cType": "const GSERIALIZED *", + "canonical": "const GSERIALIZED *" + }, + { + "name": "instants", + "cType": "TInstant **", + "canonical": "struct TInstant **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "maxcount", + "cType": "int", + "canonical": "int" + }, + { + "name": "lower_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "upper_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + }, + { + "name": "normalize", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "trgeoseq_make1", + "file": "trgeo_seq.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "geom", + "cType": "const GSERIALIZED *", + "canonical": "const GSERIALIZED *" + }, + { + "name": "instants", + "cType": "TInstant **", + "canonical": "struct TInstant **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "lower_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "upper_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + }, + { + "name": "normalize", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "trgeoseq_make_exp", + "file": "trgeo_seq.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "geom", + "cType": "const GSERIALIZED *", + "canonical": "const GSERIALIZED *" + }, + { + "name": "instants", + "cType": "TInstant **", + "canonical": "struct TInstant **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "maxcount", + "cType": "int", + "canonical": "int" + }, + { + "name": "lower_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "upper_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + }, + { + "name": "normalize", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "trgeoseq_make", + "file": "trgeo_seq.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "geom", + "cType": "const GSERIALIZED *", + "canonical": "const GSERIALIZED *" + }, + { + "name": "instants", + "cType": "TInstant **", + "canonical": "struct TInstant **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "lower_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "upper_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + }, + { + "name": "normalize", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "trgeoseq_make_free_exp", + "file": "trgeo_seq.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "geom", + "cType": "const GSERIALIZED *", + "canonical": "const GSERIALIZED *" + }, + { + "name": "instants", + "cType": "TInstant **", + "canonical": "struct TInstant **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "maxcount", + "cType": "int", + "canonical": "int" + }, + { + "name": "lower_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "upper_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + }, + { + "name": "normalize", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "trgeoseq_make_free", + "file": "trgeo_seq.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "geom", + "cType": "const GSERIALIZED *", + "canonical": "const GSERIALIZED *" + }, + { + "name": "instants", + "cType": "TInstant **", + "canonical": "struct TInstant **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "lower_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "upper_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + }, + { + "name": "normalize", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "trgeoinst_to_tsequence", + "file": "trgeo_seq.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const struct TInstant *" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "trgeoseqset_geom_p", + "file": "trgeo_seqset.h", + "returnType": { + "c": "const GSERIALIZED *", + "canonical": "const GSERIALIZED *" + }, + "params": [ + { + "name": "ts", + "cType": "const TSequenceSet *", + "canonical": "const struct TSequenceSet *" + } + ] + }, + { + "name": "trgeoseqset_tposeseqset", + "file": "trgeo_seqset.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const struct TSequenceSet *" + } + ] + }, + { + "name": "trgeoseqset_make1_exp", + "file": "trgeo_seqset.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "geom", + "cType": "const GSERIALIZED *", + "canonical": "const GSERIALIZED *" + }, + { + "name": "sequences", + "cType": "TSequence **", + "canonical": "struct TSequence **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "maxcount", + "cType": "int", + "canonical": "int" + }, + { + "name": "normalize", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "trgeoseqset_make_exp", + "file": "trgeo_seqset.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "geom", + "cType": "const GSERIALIZED *", + "canonical": "const GSERIALIZED *" + }, + { + "name": "sequences", + "cType": "TSequence **", + "canonical": "struct TSequence **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "maxcount", + "cType": "int", + "canonical": "int" + }, + { + "name": "normalize", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "trgeoseqset_make", + "file": "trgeo_seqset.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "geom", + "cType": "const GSERIALIZED *", + "canonical": "const GSERIALIZED *" + }, + { + "name": "sequences", + "cType": "TSequence **", + "canonical": "struct TSequence **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "normalize", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "trgeoseqset_make_free", + "file": "trgeo_seqset.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "geom", + "cType": "const GSERIALIZED *", + "canonical": "const GSERIALIZED *" + }, + { + "name": "sequences", + "cType": "TSequence **", + "canonical": "struct TSequence **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "normalize", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "trgeoseqset_make_gaps", + "file": "trgeo_seqset.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "geom", + "cType": "const GSERIALIZED *", + "canonical": "const GSERIALIZED *" + }, + { + "name": "instants", + "cType": "TInstant **", + "canonical": "struct TInstant **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + }, + { + "name": "maxt", + "cType": "const Interval *", + "canonical": "const Interval *" + }, + { + "name": "maxdist", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "trgeoseqset_to_tsequence", + "file": "trgeo_seqset.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const struct TSequenceSet *" + } + ] + }, + { + "name": "trgeo_to_tsequence", + "file": "trgeo_seqset.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "interp_str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "trgeo_to_tsequenceset", + "file": "trgeo_seqset.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "interp_str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "trgeoinst_set_stbox", + "file": "trgeo_boxops.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "geom", + "cType": "const GSERIALIZED *", + "canonical": "const GSERIALIZED *" + }, + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const struct TInstant *" + }, + { + "name": "box", + "cType": "STBox *", + "canonical": "struct STBox *" + } + ] + }, + { + "name": "trgeoinstarr_static_stbox", + "file": "trgeo_boxops.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "geom", + "cType": "const GSERIALIZED *", + "canonical": "const GSERIALIZED *" + }, + { + "name": "instants", + "cType": "TInstant **", + "canonical": "struct TInstant **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "box", + "cType": "STBox *", + "canonical": "struct STBox *" + } + ] + }, + { + "name": "trgeoinstarr_rotating_stbox", + "file": "trgeo_boxops.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "geom", + "cType": "const GSERIALIZED *", + "canonical": "const GSERIALIZED *" + }, + { + "name": "instants", + "cType": "TInstant **", + "canonical": "struct TInstant **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "box", + "cType": "STBox *", + "canonical": "struct STBox *" + } + ] + }, + { + "name": "trgeoinstarr_compute_bbox", + "file": "trgeo_boxops.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "geom", + "cType": "const GSERIALIZED *", + "canonical": "const GSERIALIZED *" + }, + { + "name": "instants", + "cType": "TInstant **", + "canonical": "struct TInstant **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + }, + { + "name": "box", + "cType": "void *", + "canonical": "void *" + } + ] + }, + { + "name": "ensure_span_isof_type", + "file": "span.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "spantype", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "ensure_span_isof_basetype", + "file": "span.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "basetype", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "ensure_same_span_type", + "file": "span.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s1", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "s2", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "ensure_valid_span_span", + "file": "span.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s1", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "s2", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "span_deserialize", + "file": "span.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "lower", + "cType": "SpanBound *", + "canonical": "struct SpanBound *" + }, + { + "name": "upper", + "cType": "SpanBound *", + "canonical": "struct SpanBound *" + } + ] + }, + { + "name": "span_bound_cmp", + "file": "span.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "b1", + "cType": "const SpanBound *", + "canonical": "const struct SpanBound *" + }, + { + "name": "b2", + "cType": "const SpanBound *", + "canonical": "const struct SpanBound *" + } + ] + }, + { + "name": "span_bound_qsort_cmp", + "file": "span.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "s1", + "cType": "const void *", + "canonical": "const void *" + }, + { + "name": "s2", + "cType": "const void *", + "canonical": "const void *" + } + ] + }, + { + "name": "span_lower_cmp", + "file": "span.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "s1", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "s2", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "span_upper_cmp", + "file": "span.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "s1", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "s2", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "span_decr_bound", + "file": "span.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "upper", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "basetype", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "span_incr_bound", + "file": "span.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "upper", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "basetype", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "spanarr_normalize", + "file": "span.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "spans", + "cType": "Span *", + "canonical": "struct Span *" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "sort", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "newcount", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "span_bounds_shift_scale_value", + "file": "span.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "shift", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "width", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "hasshift", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "haswidth", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "lower", + "cType": "Datum *", + "canonical": "int ((*)(int *))()" + }, + { + "name": "upper", + "cType": "Datum *", + "canonical": "int ((*)(int *))()" + } + ] + }, + { + "name": "span_bounds_shift_scale_time", + "file": "span.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "shift", + "cType": "const Interval *", + "canonical": "const Interval *" + }, + { + "name": "duration", + "cType": "const Interval *", + "canonical": "const Interval *" + }, + { + "name": "lower", + "cType": "TimestampTz *", + "canonical": "long *" + }, + { + "name": "upper", + "cType": "TimestampTz *", + "canonical": "long *" + } + ] + }, + { + "name": "floatspan_floor_ceil_iter", + "file": "span.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "s", + "cType": "Span *", + "canonical": "struct Span *" + }, + { + "name": "func", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "numspan_delta_scale_iter", + "file": "span.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "s", + "cType": "Span *", + "canonical": "struct Span *" + }, + { + "name": "origin", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "delta", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "hasdelta", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "scale", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "tstzspan_delta_scale_iter", + "file": "span.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "s", + "cType": "Span *", + "canonical": "struct Span *" + }, + { + "name": "origin", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "delta", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "scale", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "numspan_shift_scale_iter", + "file": "span.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "s", + "cType": "Span *", + "canonical": "struct Span *" + }, + { + "name": "shift", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "width", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "hasshift", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "haswidth", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "delta", + "cType": "Datum *", + "canonical": "int ((*)(int *))()" + }, + { + "name": "scale", + "cType": "double *", + "canonical": "double *" + } + ] + }, + { + "name": "tstzspan_shift_scale1", + "file": "span.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "s", + "cType": "Span *", + "canonical": "struct Span *" + }, + { + "name": "shift", + "cType": "const Interval *", + "canonical": "const Interval *" + }, + { + "name": "duration", + "cType": "const Interval *", + "canonical": "const Interval *" + }, + { + "name": "delta", + "cType": "TimestampTz *", + "canonical": "long *" + }, + { + "name": "scale", + "cType": "double *", + "canonical": "double *" + } + ] + }, + { + "name": "mi_span_value", + "file": "span.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "result", + "cType": "Span *", + "canonical": "struct Span *" + } + ] + }, + { + "name": "dist_double_value_value", + "file": "span.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "l", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "r", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "trgeo_geom_clip_polygon", + "file": "trgeo_geom_clip.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "a1", + "cType": "const POINT2D *", + "canonical": "const POINT2D *" + }, + { + "name": "b1", + "cType": "const POINT2D *", + "canonical": "const POINT2D *" + }, + { + "name": "a2", + "cType": "const POINT2D *", + "canonical": "const POINT2D *" + }, + { + "name": "b2", + "cType": "const POINT2D *", + "canonical": "const POINT2D *" + }, + { + "name": "pa", + "cType": "const POINTARRAY *", + "canonical": "const POINTARRAY *" + }, + { + "name": "intervals_out", + "cType": "Span **", + "canonical": "struct Span **" + } + ] + }, + { + "name": "trgeo_geom_clip_lwpoly", + "file": "trgeo_geom_clip.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "a1", + "cType": "const POINT2D *", + "canonical": "const POINT2D *" + }, + { + "name": "b1", + "cType": "const POINT2D *", + "canonical": "const POINT2D *" + }, + { + "name": "a2", + "cType": "const POINT2D *", + "canonical": "const POINT2D *" + }, + { + "name": "b2", + "cType": "const POINT2D *", + "canonical": "const POINT2D *" + }, + { + "name": "poly", + "cType": "const LWPOLY *", + "canonical": "const LWPOLY *" + }, + { + "name": "intervals_out", + "cType": "Span **", + "canonical": "struct Span **" + } + ] + }, + { + "name": "trgeo_geom_clip_box", + "file": "trgeo_geom_clip.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "a1", + "cType": "const POINT2D *", + "canonical": "const POINT2D *" + }, + { + "name": "b1", + "cType": "const POINT2D *", + "canonical": "const POINT2D *" + }, + { + "name": "a2", + "cType": "const POINT2D *", + "canonical": "const POINT2D *" + }, + { + "name": "b2", + "cType": "const POINT2D *", + "canonical": "const POINT2D *" + }, + { + "name": "xmin", + "cType": "double", + "canonical": "double" + }, + { + "name": "ymin", + "cType": "double", + "canonical": "double" + }, + { + "name": "xmax", + "cType": "double", + "canonical": "double" + }, + { + "name": "ymax", + "cType": "double", + "canonical": "double" + }, + { + "name": "intervals_out", + "cType": "Span **", + "canonical": "struct Span **" + } + ] + }, + { + "name": "trgeo_geom_clip_polygon_posed", + "file": "trgeo_geom_clip.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "p_a_local", + "cType": "const POINT2D *", + "canonical": "const POINT2D *" + }, + { + "name": "p_b_local", + "cType": "const POINT2D *", + "canonical": "const POINT2D *" + }, + { + "name": "pose1", + "cType": "const struct Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "pose2", + "cType": "const struct Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "pa", + "cType": "const POINTARRAY *", + "canonical": "const POINTARRAY *" + }, + { + "name": "intervals_out", + "cType": "Span **", + "canonical": "struct Span **" + } + ] + }, + { + "name": "trgeo_geom_clip_lwpoly_posed", + "file": "trgeo_geom_clip.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "p_a_local", + "cType": "const POINT2D *", + "canonical": "const POINT2D *" + }, + { + "name": "p_b_local", + "cType": "const POINT2D *", + "canonical": "const POINT2D *" + }, + { + "name": "pose1", + "cType": "const struct Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "pose2", + "cType": "const struct Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "poly", + "cType": "const LWPOLY *", + "canonical": "const LWPOLY *" + }, + { + "name": "intervals_out", + "cType": "Span **", + "canonical": "struct Span **" + } + ] + }, + { + "name": "trgeo_geom_clip_box_posed", + "file": "trgeo_geom_clip.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "p_a_local", + "cType": "const POINT2D *", + "canonical": "const POINT2D *" + }, + { + "name": "p_b_local", + "cType": "const POINT2D *", + "canonical": "const POINT2D *" + }, + { + "name": "pose1", + "cType": "const struct Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "pose2", + "cType": "const struct Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "xmin", + "cType": "double", + "canonical": "double" + }, + { + "name": "ymin", + "cType": "double", + "canonical": "double" + }, + { + "name": "xmax", + "cType": "double", + "canonical": "double" + }, + { + "name": "ymax", + "cType": "double", + "canonical": "double" + }, + { + "name": "intervals_out", + "cType": "Span **", + "canonical": "struct Span **" + } + ] + }, + { + "name": "trgeo_geom_clip_lwgeom", + "file": "trgeo_geom_clip.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "a1", + "cType": "const POINT2D *", + "canonical": "const POINT2D *" + }, + { + "name": "b1", + "cType": "const POINT2D *", + "canonical": "const POINT2D *" + }, + { + "name": "a2", + "cType": "const POINT2D *", + "canonical": "const POINT2D *" + }, + { + "name": "b2", + "cType": "const POINT2D *", + "canonical": "const POINT2D *" + }, + { + "name": "geom", + "cType": "const LWGEOM *", + "canonical": "const LWGEOM *" + }, + { + "name": "intervals_out", + "cType": "Span **", + "canonical": "struct Span **" + } + ] + }, + { + "name": "trgeo_geom_clip_lwgeom_posed", + "file": "trgeo_geom_clip.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "p_a_local", + "cType": "const POINT2D *", + "canonical": "const POINT2D *" + }, + { + "name": "p_b_local", + "cType": "const POINT2D *", + "canonical": "const POINT2D *" + }, + { + "name": "pose1", + "cType": "const struct Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "pose2", + "cType": "const struct Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "geom", + "cType": "const LWGEOM *", + "canonical": "const LWGEOM *" + }, + { + "name": "intervals_out", + "cType": "Span **", + "canonical": "struct Span **" + } + ] + }, + { + "name": "trgeo_parse", + "file": "trgeo_parser.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "str", + "cType": "const char **", + "canonical": "const char **" + }, + { + "name": "temptype", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "ensure_same_geom", + "file": "trgeo_utils.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "gs1", + "cType": "const GSERIALIZED *", + "canonical": "const GSERIALIZED *" + }, + { + "name": "gs2", + "cType": "const GSERIALIZED *", + "canonical": "const GSERIALIZED *" + } + ] + }, + { + "name": "lwgeom_apply_pose", + "file": "trgeo_utils.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "geom", + "cType": "LWGEOM *", + "canonical": "LWGEOM *" + } + ] + }, + { + "name": "geom_apply_pose", + "file": "trgeo_utils.h", + "returnType": { + "c": "GSERIALIZED *", + "canonical": "GSERIALIZED *" + }, + "params": [ + { + "name": "gs", + "cType": "const GSERIALIZED *", + "canonical": "const GSERIALIZED *" + }, + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + } + ] + }, + { + "name": "geom_radius", + "file": "trgeo_utils.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "gs", + "cType": "const GSERIALIZED *", + "canonical": "const GSERIALIZED *" + } + ] + }, + { + "name": "v_clip_tpoly_point", + "file": "trgeo_vclip.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "poly", + "cType": "const LWPOLY *", + "canonical": "const LWPOLY *" + }, + { + "name": "point", + "cType": "const LWPOINT *", + "canonical": "const LWPOINT *" + }, + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "poly_feature", + "cType": "uint32_t *", + "canonical": "unsigned int *" + }, + { + "name": "dist", + "cType": "double *", + "canonical": "double *" + } + ] + }, + { + "name": "v_clip_tpoly_tpoly", + "file": "trgeo_vclip.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "poly1", + "cType": "const LWPOLY *", + "canonical": "const LWPOLY *" + }, + { + "name": "poly2", + "cType": "const LWPOLY *", + "canonical": "const LWPOLY *" + }, + { + "name": "pose1", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "pose2", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "poly1_feature", + "cType": "uint32_t *", + "canonical": "unsigned int *" + }, + { + "name": "poly2_feature", + "cType": "uint32_t *", + "canonical": "unsigned int *" + }, + { + "name": "dist", + "cType": "double *", + "canonical": "double *" + } + ] + }, + { + "name": "apply_pose_point4d", + "file": "trgeo_vclip.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "p", + "cType": "POINT4D *", + "canonical": "POINT4D *" + }, + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + } + ] + }, + { + "name": "tfunc_tinstant", + "file": "lifting.h", + "returnType": { + "c": "TInstant *", + "canonical": "struct TInstant *" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const struct TInstant *" + }, + { + "name": "lfinfo", + "cType": "LiftedFunctionInfo *", + "canonical": "struct LiftedFunctionInfo *" + } + ] + }, + { + "name": "tfunc_tsequence", + "file": "lifting.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "lfinfo", + "cType": "LiftedFunctionInfo *", + "canonical": "struct LiftedFunctionInfo *" + } + ] + }, + { + "name": "tfunc_tsequenceset", + "file": "lifting.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const struct TSequenceSet *" + }, + { + "name": "lfinfo", + "cType": "LiftedFunctionInfo *", + "canonical": "struct LiftedFunctionInfo *" + } + ] + }, + { + "name": "tfunc_temporal", + "file": "lifting.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "lfinfo", + "cType": "LiftedFunctionInfo *", + "canonical": "struct LiftedFunctionInfo *" + } + ] + }, + { + "name": "tfunc_tinstant_base", + "file": "lifting.h", + "returnType": { + "c": "TInstant *", + "canonical": "struct TInstant *" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const struct TInstant *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "lfinfo", + "cType": "LiftedFunctionInfo *", + "canonical": "struct LiftedFunctionInfo *" + } + ] + }, + { + "name": "tfunc_tsequence_base", + "file": "lifting.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "lfinfo", + "cType": "LiftedFunctionInfo *", + "canonical": "struct LiftedFunctionInfo *" + } + ] + }, + { + "name": "tfunc_tsequenceset_base", + "file": "lifting.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const struct TSequenceSet *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "lfinfo", + "cType": "LiftedFunctionInfo *", + "canonical": "struct LiftedFunctionInfo *" + } + ] + }, + { + "name": "tfunc_temporal_base", + "file": "lifting.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "lfinfo", + "cType": "LiftedFunctionInfo *", + "canonical": "struct LiftedFunctionInfo *" + } + ] + }, + { + "name": "tfunc_tinstant_tinstant", + "file": "lifting.h", + "returnType": { + "c": "TInstant *", + "canonical": "struct TInstant *" + }, + "params": [ + { + "name": "inst1", + "cType": "const TInstant *", + "canonical": "const struct TInstant *" + }, + { + "name": "inst2", + "cType": "const TInstant *", + "canonical": "const struct TInstant *" + }, + { + "name": "lfinfo", + "cType": "LiftedFunctionInfo *", + "canonical": "struct LiftedFunctionInfo *" + } + ] + }, + { + "name": "tfunc_tdiscseq_tdiscseq", + "file": "lifting.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "seq1", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "seq2", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "lfinfo", + "cType": "LiftedFunctionInfo *", + "canonical": "struct LiftedFunctionInfo *" + } + ] + }, + { + "name": "tfunc_tcontseq_tcontseq", + "file": "lifting.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "seq1", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "seq2", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "lfinfo", + "cType": "LiftedFunctionInfo *", + "canonical": "struct LiftedFunctionInfo *" + } + ] + }, + { + "name": "tfunc_tsequenceset_tsequenceset", + "file": "lifting.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "ss1", + "cType": "const TSequenceSet *", + "canonical": "const struct TSequenceSet *" + }, + { + "name": "ss2", + "cType": "const TSequenceSet *", + "canonical": "const struct TSequenceSet *" + }, + { + "name": "lfinfo", + "cType": "LiftedFunctionInfo *", + "canonical": "struct LiftedFunctionInfo *" + } + ] + }, + { + "name": "tfunc_temporal_temporal", + "file": "lifting.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "lfinfo", + "cType": "LiftedFunctionInfo *", + "canonical": "struct LiftedFunctionInfo *" + } + ] + }, + { + "name": "eafunc_temporal_base", + "file": "lifting.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "lfinfo", + "cType": "LiftedFunctionInfo *", + "canonical": "struct LiftedFunctionInfo *" + } + ] + }, + { + "name": "eafunc_temporal_temporal", + "file": "lifting.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "lfinfo", + "cType": "LiftedFunctionInfo *", + "canonical": "struct LiftedFunctionInfo *" + } + ] + }, + { + "name": "lfunc_set", + "file": "lifting.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "set", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "lfinfo", + "cType": "LiftedFunctionInfo *", + "canonical": "struct LiftedFunctionInfo *" + } + ] + }, + { + "name": "set_out_fn", + "file": "set.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + }, + { + "name": "value_out", + "cType": "outfunc", + "canonical": "char *(*)(int ((*)(int *))(), MeosType, int)" + } + ] + }, + { + "name": "ensure_set_isof_type", + "file": "set.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "settype", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "ensure_valid_set_set", + "file": "set.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s1", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "s2", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "set_find_value", + "file": "set.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "arg1", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "loc", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "set_unnest_state_make", + "file": "set.h", + "returnType": { + "c": "SetUnnestState *", + "canonical": "SetUnnestState *" + }, + "params": [ + { + "name": "set", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "set_unnest_state_next", + "file": "set.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "state", + "cType": "SetUnnestState *", + "canonical": "SetUnnestState *" + } + ] + }, + { + "name": "ensure_same_skiplist_subtype", + "file": "skiplist.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "state", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "subtype", + "cType": "uint8", + "canonical": "unsigned char" + } + ] + }, + { + "name": "skiplist_set_extra", + "file": "skiplist.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "state", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "data", + "cType": "void *", + "canonical": "void *" + }, + { + "name": "size", + "cType": "size_t", + "canonical": "unsigned long" + } + ] + }, + { + "name": "skiplist_headval", + "file": "skiplist.h", + "returnType": { + "c": "void *", + "canonical": "void *" + }, + "params": [ + { + "name": "list", + "cType": "SkipList *", + "canonical": "struct SkipList *" + } + ] + }, + { + "name": "common_entry_cmp", + "file": "span_index.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "i1", + "cType": "const void *", + "canonical": "const void *" + }, + { + "name": "i2", + "cType": "const void *", + "canonical": "const void *" + } + ] + }, + { + "name": "span_index_leaf_consistent", + "file": "span_index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "key", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "query", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "strategy", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "span_gist_inner_consistent", + "file": "span_index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "key", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "query", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "strategy", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "span_index_recheck", + "file": "span_index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "strategy", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "span_lower_qsort_cmp", + "file": "span_index.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "a", + "cType": "const void *", + "canonical": "const void *" + }, + { + "name": "b", + "cType": "const void *", + "canonical": "const void *" + } + ] + }, + { + "name": "span_upper_qsort_cmp", + "file": "span_index.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "a", + "cType": "const void *", + "canonical": "const void *" + }, + { + "name": "b", + "cType": "const void *", + "canonical": "const void *" + } + ] + }, + { + "name": "getQuadrant2D", + "file": "span_index.h", + "returnType": { + "c": "uint8", + "canonical": "unsigned char" + }, + "params": [ + { + "name": "centroid", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "query", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "overlap2D", + "file": "span_index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "nodebox", + "cType": "const SpanNode *", + "canonical": "const struct SpanNode *" + }, + { + "name": "query", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "contain2D", + "file": "span_index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "nodebox", + "cType": "const SpanNode *", + "canonical": "const struct SpanNode *" + }, + { + "name": "query", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "left2D", + "file": "span_index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "nodebox", + "cType": "const SpanNode *", + "canonical": "const struct SpanNode *" + }, + { + "name": "query", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "overLeft2D", + "file": "span_index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "nodebox", + "cType": "const SpanNode *", + "canonical": "const struct SpanNode *" + }, + { + "name": "query", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "right2D", + "file": "span_index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "nodebox", + "cType": "const SpanNode *", + "canonical": "const struct SpanNode *" + }, + { + "name": "query", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "overRight2D", + "file": "span_index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "nodebox", + "cType": "const SpanNode *", + "canonical": "const struct SpanNode *" + }, + { + "name": "query", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "adjacent2D", + "file": "span_index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "nodebox", + "cType": "const SpanNode *", + "canonical": "const struct SpanNode *" + }, + { + "name": "query", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "distance_span_nodespan", + "file": "span_index.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "query", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "nodebox", + "cType": "const SpanNode *", + "canonical": "const struct SpanNode *" + } + ] + }, + { + "name": "span_spgist_get_span", + "file": "span_index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "result", + "cType": "Span *", + "canonical": "struct Span *" + } + ] + }, + { + "name": "spannode_init", + "file": "span_index.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "nodebox", + "cType": "SpanNode *", + "canonical": "struct SpanNode *" + }, + { + "name": "spantype", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "basetype", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "spannode_copy", + "file": "span_index.h", + "returnType": { + "c": "SpanNode *", + "canonical": "struct SpanNode *" + }, + "params": [ + { + "name": "orig", + "cType": "const SpanNode *", + "canonical": "const struct SpanNode *" + } + ] + }, + { + "name": "spannode_quadtree_next", + "file": "span_index.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "nodebox", + "cType": "const SpanNode *", + "canonical": "const struct SpanNode *" + }, + { + "name": "centroid", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "quadrant", + "cType": "uint8", + "canonical": "unsigned char" + }, + { + "name": "next_nodespan", + "cType": "SpanNode *", + "canonical": "struct SpanNode *" + } + ] + }, + { + "name": "spannode_kdtree_next", + "file": "span_index.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "nodebox", + "cType": "const SpanNode *", + "canonical": "const struct SpanNode *" + }, + { + "name": "centroid", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "node", + "cType": "uint8", + "canonical": "unsigned char" + }, + { + "name": "level", + "cType": "int", + "canonical": "int" + }, + { + "name": "next_nodespan", + "cType": "SpanNode *", + "canonical": "struct SpanNode *" + } + ] + }, + { + "name": "ensure_spanset_isof_type", + "file": "spanset.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "spansettype", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "ensure_same_spanset_type", + "file": "spanset.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss1", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "ss2", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "ensure_same_spanset_span_type", + "file": "spanset.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "ensure_valid_spanset_span", + "file": "spanset.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "ensure_valid_spanset_spanset", + "file": "spanset.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss1", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "ss2", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "spanset_find_value", + "file": "spanset.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "v", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "loc", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "datum_and", + "file": "tbool_ops.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "l", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "r", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_or", + "file": "tbool_ops.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "l", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "r", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "boolop_tbool_bool", + "file": "tbool_ops.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "b", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "func", + "cType": "datum_func2", + "canonical": "int (*)(int ((*)(int *))(), int ((*)(int *))())" + }, + { + "name": "invert", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "boolop_tbool_tbool", + "file": "tbool_ops.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "func", + "cType": "datum_func2", + "canonical": "int (*)(int ((*)(int *))(), int ((*)(int *))())" + } + ] + }, + { + "name": "ensure_same_dimensionality_tbox", + "file": "tbox.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const TBox *", + "canonical": "const struct TBox *" + }, + { + "name": "box2", + "cType": "const TBox *", + "canonical": "const struct TBox *" + } + ] + }, + { + "name": "set_tbox", + "file": "tbox.h", + "returnType": { + "c": "TBox *", + "canonical": "struct TBox *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "span_tbox", + "file": "tbox.h", + "returnType": { + "c": "TBox *", + "canonical": "struct TBox *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "tbox_tstzspan", + "file": "tbox.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const struct TBox *" + } + ] + }, + { + "name": "tbox_intspan", + "file": "tbox.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const struct TBox *" + } + ] + }, + { + "name": "tbox_floatspan", + "file": "tbox.h", + "returnType": { + "c": "Span *", + "canonical": "struct Span *" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const struct TBox *" + } + ] + }, + { + "name": "tbox_index_leaf_consistent", + "file": "tbox_index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "key", + "cType": "const TBox *", + "canonical": "const struct TBox *" + }, + { + "name": "query", + "cType": "const TBox *", + "canonical": "const struct TBox *" + }, + { + "name": "strategy", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "tbox_gist_inner_consistent", + "file": "tbox_index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "key", + "cType": "const TBox *", + "canonical": "const struct TBox *" + }, + { + "name": "query", + "cType": "const TBox *", + "canonical": "const struct TBox *" + }, + { + "name": "strategy", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "tbox_index_recheck", + "file": "tbox_index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "strategy", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "tboxnode_init", + "file": "tbox_index.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "centroid", + "cType": "TBox *", + "canonical": "struct TBox *" + }, + { + "name": "nodebox", + "cType": "TboxNode *", + "canonical": "struct TboxNode *" + } + ] + }, + { + "name": "tboxnode_copy", + "file": "tbox_index.h", + "returnType": { + "c": "TboxNode *", + "canonical": "struct TboxNode *" + }, + "params": [ + { + "name": "box", + "cType": "const TboxNode *", + "canonical": "const struct TboxNode *" + } + ] + }, + { + "name": "getQuadrant4D", + "file": "tbox_index.h", + "returnType": { + "c": "uint8", + "canonical": "unsigned char" + }, + "params": [ + { + "name": "centroid", + "cType": "const TBox *", + "canonical": "const struct TBox *" + }, + { + "name": "inBox", + "cType": "const TBox *", + "canonical": "const struct TBox *" + } + ] + }, + { + "name": "tboxnode_quadtree_next", + "file": "tbox_index.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "nodebox", + "cType": "const TboxNode *", + "canonical": "const struct TboxNode *" + }, + { + "name": "centroid", + "cType": "const TBox *", + "canonical": "const struct TBox *" + }, + { + "name": "quadrant", + "cType": "uint8", + "canonical": "unsigned char" + }, + { + "name": "next_nodebox", + "cType": "TboxNode *", + "canonical": "struct TboxNode *" + } + ] + }, + { + "name": "tboxnode_kdtree_next", + "file": "tbox_index.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "nodebox", + "cType": "const TboxNode *", + "canonical": "const struct TboxNode *" + }, + { + "name": "centroid", + "cType": "const TBox *", + "canonical": "const struct TBox *" + }, + { + "name": "node", + "cType": "uint8", + "canonical": "unsigned char" + }, + { + "name": "level", + "cType": "int", + "canonical": "int" + }, + { + "name": "next_nodebox", + "cType": "TboxNode *", + "canonical": "struct TboxNode *" + } + ] + }, + { + "name": "overlap4D", + "file": "tbox_index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "nodebox", + "cType": "const TboxNode *", + "canonical": "const struct TboxNode *" + }, + { + "name": "query", + "cType": "const TBox *", + "canonical": "const struct TBox *" + } + ] + }, + { + "name": "contain4D", + "file": "tbox_index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "nodebox", + "cType": "const TboxNode *", + "canonical": "const struct TboxNode *" + }, + { + "name": "query", + "cType": "const TBox *", + "canonical": "const struct TBox *" + } + ] + }, + { + "name": "left4D", + "file": "tbox_index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "nodebox", + "cType": "const TboxNode *", + "canonical": "const struct TboxNode *" + }, + { + "name": "query", + "cType": "const TBox *", + "canonical": "const struct TBox *" + } + ] + }, + { + "name": "overLeft4D", + "file": "tbox_index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "nodebox", + "cType": "const TboxNode *", + "canonical": "const struct TboxNode *" + }, + { + "name": "query", + "cType": "const TBox *", + "canonical": "const struct TBox *" + } + ] + }, + { + "name": "right4D", + "file": "tbox_index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "nodebox", + "cType": "const TboxNode *", + "canonical": "const struct TboxNode *" + }, + { + "name": "query", + "cType": "const TBox *", + "canonical": "const struct TBox *" + } + ] + }, + { + "name": "overRight4D", + "file": "tbox_index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "nodebox", + "cType": "const TboxNode *", + "canonical": "const struct TboxNode *" + }, + { + "name": "query", + "cType": "const TBox *", + "canonical": "const struct TBox *" + } + ] + }, + { + "name": "before4D", + "file": "tbox_index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "nodebox", + "cType": "const TboxNode *", + "canonical": "const struct TboxNode *" + }, + { + "name": "query", + "cType": "const TBox *", + "canonical": "const struct TBox *" + } + ] + }, + { + "name": "overBefore4D", + "file": "tbox_index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "nodebox", + "cType": "const TboxNode *", + "canonical": "const struct TboxNode *" + }, + { + "name": "query", + "cType": "const TBox *", + "canonical": "const struct TBox *" + } + ] + }, + { + "name": "after4D", + "file": "tbox_index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "nodebox", + "cType": "const TboxNode *", + "canonical": "const struct TboxNode *" + }, + { + "name": "query", + "cType": "const TBox *", + "canonical": "const struct TBox *" + } + ] + }, + { + "name": "overAfter4D", + "file": "tbox_index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "nodebox", + "cType": "const TboxNode *", + "canonical": "const struct TboxNode *" + }, + { + "name": "query", + "cType": "const TBox *", + "canonical": "const struct TBox *" + } + ] + }, + { + "name": "distance_tbox_nodebox", + "file": "tbox_index.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "query", + "cType": "const TBox *", + "canonical": "const struct TBox *" + }, + { + "name": "nodebox", + "cType": "const TboxNode *", + "canonical": "const struct TboxNode *" + } + ] + }, + { + "name": "tnumber_spgist_get_tbox", + "file": "tbox_index.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "result", + "cType": "TBox *", + "canonical": "struct TBox *" + } + ] + }, + { + "name": "tbox_xmin_cmp", + "file": "tbox_index.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "box1", + "cType": "const TBox *", + "canonical": "const struct TBox *" + }, + { + "name": "box2", + "cType": "const TBox *", + "canonical": "const struct TBox *" + } + ] + }, + { + "name": "tbox_xmax_cmp", + "file": "tbox_index.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "box1", + "cType": "const TBox *", + "canonical": "const struct TBox *" + }, + { + "name": "box2", + "cType": "const TBox *", + "canonical": "const struct TBox *" + } + ] + }, + { + "name": "tbox_tmin_cmp", + "file": "tbox_index.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "box1", + "cType": "const TBox *", + "canonical": "const struct TBox *" + }, + { + "name": "box2", + "cType": "const TBox *", + "canonical": "const struct TBox *" + } + ] + }, + { + "name": "tbox_tmax_cmp", + "file": "tbox_index.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "box1", + "cType": "const TBox *", + "canonical": "const struct TBox *" + }, + { + "name": "box2", + "cType": "const TBox *", + "canonical": "const struct TBox *" + } + ] + }, + { + "name": "tbox_level_cmp", + "file": "tbox_index.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "centroid", + "cType": "const TBox *", + "canonical": "const struct TBox *" + }, + { + "name": "query", + "cType": "const TBox *", + "canonical": "const struct TBox *" + }, + { + "name": "level", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "tcellindex_type", + "file": "tcellindex.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "dggs_cellops", + "file": "tcellindex.h", + "returnType": { + "c": "const DggsCellOps *", + "canonical": "const struct DggsCellOps *" + }, + "params": [ + { + "name": "temptype", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "tcellindex_get_resolution", + "file": "tcellindex.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tcellindex_is_valid_cell", + "file": "tcellindex.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tcellindex_cell_to_parent", + "file": "tcellindex.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "resolution", + "cType": "int32", + "canonical": "int" + } + ] + }, + { + "name": "tcellindex_cell_to_point", + "file": "tcellindex.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tcellindex_cell_to_boundary", + "file": "tcellindex.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tcellindex_cell_area", + "file": "tcellindex.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "datum_min_int32", + "file": "temporal_aggfuncs.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "l", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "r", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_max_int32", + "file": "temporal_aggfuncs.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "l", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "r", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_min_int64", + "file": "temporal_aggfuncs.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "l", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "r", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_max_int64", + "file": "temporal_aggfuncs.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "l", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "r", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_min_float8", + "file": "temporal_aggfuncs.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "l", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "r", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_max_float8", + "file": "temporal_aggfuncs.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "l", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "r", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_sum_int32", + "file": "temporal_aggfuncs.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "l", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "r", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_sum_int64", + "file": "temporal_aggfuncs.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "l", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "r", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_sum_float8", + "file": "temporal_aggfuncs.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "l", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "r", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_min_text", + "file": "temporal_aggfuncs.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "l", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "r", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_max_text", + "file": "temporal_aggfuncs.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "l", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "r", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_sum_double2", + "file": "temporal_aggfuncs.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "l", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "r", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_sum_double3", + "file": "temporal_aggfuncs.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "l", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "r", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_sum_double4", + "file": "temporal_aggfuncs.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "l", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "r", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "temporal_skiplist_common", + "file": "temporal_aggfuncs.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "list", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "values", + "cType": "void **", + "canonical": "void **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "lower", + "cType": "int *", + "canonical": "int *" + }, + { + "name": "upper", + "cType": "int *", + "canonical": "int *" + }, + { + "name": "update", + "cType": "int[32]", + "canonical": "int[32]" + } + ] + }, + { + "name": "temporal_skiplist_merge", + "file": "temporal_aggfuncs.h", + "returnType": { + "c": "void **", + "canonical": "void **" + }, + "params": [ + { + "name": "spliced", + "cType": "void **", + "canonical": "void **" + }, + { + "name": "spliced_count", + "cType": "int", + "canonical": "int" + }, + { + "name": "values", + "cType": "void **", + "canonical": "void **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "func", + "cType": "datum_func2", + "canonical": "int (*)(int ((*)(int *))(), int ((*)(int *))())" + }, + { + "name": "crossings", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "newcount", + "cType": "int *", + "canonical": "int *" + }, + { + "name": "tofree", + "cType": "void ***", + "canonical": "void ***" + }, + { + "name": "nfree", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tinstant_tagg", + "file": "temporal_aggfuncs.h", + "returnType": { + "c": "TInstant **", + "canonical": "struct TInstant **" + }, + "params": [ + { + "name": "instants1", + "cType": "TInstant **", + "canonical": "struct TInstant **" + }, + { + "name": "count1", + "cType": "int", + "canonical": "int" + }, + { + "name": "instants2", + "cType": "TInstant **", + "canonical": "struct TInstant **" + }, + { + "name": "count2", + "cType": "int", + "canonical": "int" + }, + { + "name": "func", + "cType": "datum_func2", + "canonical": "int (*)(int ((*)(int *))(), int ((*)(int *))())" + }, + { + "name": "newcount", + "cType": "int *", + "canonical": "int *" + }, + { + "name": "tofree", + "cType": "void ***", + "canonical": "void ***" + }, + { + "name": "nfree", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tsequence_tagg", + "file": "temporal_aggfuncs.h", + "returnType": { + "c": "TSequence **", + "canonical": "struct TSequence **" + }, + "params": [ + { + "name": "sequences1", + "cType": "TSequence **", + "canonical": "struct TSequence **" + }, + { + "name": "count1", + "cType": "int", + "canonical": "int" + }, + { + "name": "sequences2", + "cType": "TSequence **", + "canonical": "struct TSequence **" + }, + { + "name": "count2", + "cType": "int", + "canonical": "int" + }, + { + "name": "func", + "cType": "datum_func2", + "canonical": "int (*)(int ((*)(int *))(), int ((*)(int *))())" + }, + { + "name": "crossings", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "newcount", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tcontseq_tagg_transfn", + "file": "temporal_aggfuncs.h", + "returnType": { + "c": "SkipList *", + "canonical": "struct SkipList *" + }, + "params": [ + { + "name": "state", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "func", + "cType": "datum_func2", + "canonical": "int (*)(int ((*)(int *))(), int ((*)(int *))())" + }, + { + "name": "interpoint", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "temporal_tagg_combinefn", + "file": "temporal_aggfuncs.h", + "returnType": { + "c": "SkipList *", + "canonical": "struct SkipList *" + }, + "params": [ + { + "name": "state1", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "state2", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "func", + "cType": "datum_func2", + "canonical": "int (*)(int ((*)(int *))(), int ((*)(int *))())" + }, + { + "name": "crossings", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tinstant_tagg_transfn", + "file": "temporal_aggfuncs.h", + "returnType": { + "c": "SkipList *", + "canonical": "struct SkipList *" + }, + "params": [ + { + "name": "state", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const struct TInstant *" + }, + { + "name": "func", + "cType": "datum_func2", + "canonical": "int (*)(int ((*)(int *))(), int ((*)(int *))())" + } + ] + }, + { + "name": "tinstant_tavg_finalfn", + "file": "temporal_aggfuncs.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "instants", + "cType": "TInstant **", + "canonical": "struct TInstant **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "tsequence_tavg_finalfn", + "file": "temporal_aggfuncs.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "sequences", + "cType": "TSequence **", + "canonical": "struct TSequence **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "tnumberinst_transform_tavg", + "file": "temporal_aggfuncs.h", + "returnType": { + "c": "TInstant *", + "canonical": "struct TInstant *" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const struct TInstant *" + } + ] + }, + { + "name": "temporal_transform_tcount", + "file": "temporal_aggfuncs.h", + "returnType": { + "c": "Temporal **", + "canonical": "Temporal **" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "temporal_transform_tagg", + "file": "temporal_aggfuncs.h", + "returnType": { + "c": "Temporal **", + "canonical": "Temporal **" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + }, + { + "name": "func", + "cType": "TInstant *(*)(const TInstant *)", + "canonical": "struct TInstant ()( TInstant ) *(*)(const struct TInstant ()( TInstant ) *)" + } + ] + }, + { + "name": "tsequenceset_tagg_transfn", + "file": "temporal_aggfuncs.h", + "returnType": { + "c": "SkipList *", + "canonical": "struct SkipList *" + }, + "params": [ + { + "name": "state", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const struct TSequenceSet *" + }, + { + "name": "func", + "cType": "datum_func2", + "canonical": "int (*)(int ((*)(int *))(), int ((*)(int *))())" + }, + { + "name": "crossings", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tdiscseq_tagg_transfn", + "file": "temporal_aggfuncs.h", + "returnType": { + "c": "SkipList *", + "canonical": "struct SkipList *" + }, + "params": [ + { + "name": "state", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "func", + "cType": "datum_func2", + "canonical": "int (*)(int ((*)(int *))(), int ((*)(int *))())" + } + ] + }, + { + "name": "temporal_tagg_transfn", + "file": "temporal_aggfuncs.h", + "returnType": { + "c": "SkipList *", + "canonical": "struct SkipList *" + }, + "params": [ + { + "name": "state", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "arg2", + "cType": "datum_func2", + "canonical": "int (*)(int ((*)(int *))(), int ((*)(int *))())" + }, + { + "name": "crossings", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "temporal_tagg_transform_transfn", + "file": "temporal_aggfuncs.h", + "returnType": { + "c": "SkipList *", + "canonical": "struct SkipList *" + }, + "params": [ + { + "name": "state", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "func", + "cType": "datum_func2", + "canonical": "int (*)(int ((*)(int *))(), int ((*)(int *))())" + }, + { + "name": "crossings", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "transform", + "cType": "TInstant *(*)(const TInstant *)", + "canonical": "struct TInstant ()( TInstant ) *(*)(const struct TInstant ()( TInstant ) *)" + } + ] + }, + { + "name": "temporal_similarity", + "file": "temporal_analytics.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "simfunc", + "cType": "SimFunc", + "canonical": "SimFunc" + } + ] + }, + { + "name": "temporal_similarity_path", + "file": "temporal_analytics.h", + "returnType": { + "c": "Match *", + "canonical": "Match *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + }, + { + "name": "simfunc", + "cType": "SimFunc", + "canonical": "SimFunc" + } + ] + }, + { + "name": "temporal_bbox_size", + "file": "temporal_boxops.h", + "returnType": { + "c": "size_t", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "tempype", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "tinstarr_set_bbox", + "file": "temporal_boxops.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "instants", + "cType": "TInstant **", + "canonical": "struct TInstant **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "lower_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "upper_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + }, + { + "name": "bbox", + "cType": "void *", + "canonical": "void *" + } + ] + }, + { + "name": "tsequence_compute_bbox", + "file": "temporal_boxops.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "seq", + "cType": "TSequence *", + "canonical": "struct TSequence *" + } + ] + }, + { + "name": "tseqarr_compute_bbox", + "file": "temporal_boxops.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "sequences", + "cType": "TSequence **", + "canonical": "struct TSequence **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "bbox", + "cType": "void *", + "canonical": "void *" + } + ] + }, + { + "name": "tsequenceset_compute_bbox", + "file": "temporal_boxops.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "ss", + "cType": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + } + ] + }, + { + "name": "boxop_temporal_tstzspan", + "file": "temporal_boxops.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "func", + "cType": "bool (*)(const Span *, const Span *)", + "canonical": "_Bool (*)(const struct _Bool ()( Span , Span ) *, const struct _Bool ()( Span , Span ) *)" + }, + { + "name": "invert", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "boxop_temporal_temporal", + "file": "temporal_boxops.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "func", + "cType": "bool (*)(const Span *, const Span *)", + "canonical": "_Bool (*)(const struct _Bool ()( Span , Span ) *, const struct _Bool ()( Span , Span ) *)" + } + ] + }, + { + "name": "boxop_tnumber_numspan", + "file": "temporal_boxops.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "span", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "func", + "cType": "bool (*)(const Span *, const Span *)", + "canonical": "_Bool (*)(const struct _Bool ()( Span , Span ) *, const struct _Bool ()( Span , Span ) *)" + }, + { + "name": "invert", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "boxop_tnumber_tbox", + "file": "temporal_boxops.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const TBox *", + "canonical": "const struct TBox *" + }, + { + "name": "func", + "cType": "bool (*)(const TBox *, const TBox *)", + "canonical": "_Bool (*)(const struct _Bool ()( TBox , TBox ) *, const struct _Bool ()( TBox , TBox ) *)" + }, + { + "name": "invert", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "boxop_tnumber_tnumber", + "file": "temporal_boxops.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "func", + "cType": "bool (*)(const TBox *, const TBox *)", + "canonical": "_Bool (*)(const struct _Bool ()( TBox , TBox ) *, const struct _Bool ()( TBox , TBox ) *)" + } + ] + }, + { + "name": "eacomp_base_temporal", + "file": "temporal_compops.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "func", + "cType": "int (*)(Datum *, Datum *, MeosType)", + "canonical": "int (*)(int ((*)(int *))(), int ((*)(int *))(), MeosType)" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "eacomp_temporal_base", + "file": "temporal_compops.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "func", + "cType": "int (*)(Datum *, Datum *, MeosType)", + "canonical": "int (*)(int ((*)(int *))(), int ((*)(int *))(), MeosType)" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "eacomp_temporal_temporal", + "file": "temporal_compops.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "func", + "cType": "int (*)(Datum *, Datum *, MeosType)", + "canonical": "int (*)(int ((*)(int *))(), int ((*)(int *))(), MeosType)" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tcomp_base_temporal", + "file": "temporal_compops.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "func", + "cType": "int (*)(Datum *, Datum *, MeosType)", + "canonical": "int (*)(int ((*)(int *))(), int ((*)(int *))(), MeosType)" + } + ] + }, + { + "name": "tcomp_temporal_base", + "file": "temporal_compops.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "func", + "cType": "int (*)(Datum *, Datum *, MeosType)", + "canonical": "int (*)(int ((*)(int *))(), int ((*)(int *))(), MeosType)" + } + ] + }, + { + "name": "tcomp_temporal_temporal", + "file": "temporal_compops.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "func", + "cType": "int (*)(Datum *, Datum *, MeosType)", + "canonical": "int (*)(int ((*)(int *))(), int ((*)(int *))(), MeosType)" + } + ] + }, + { + "name": "tdiscseq_at_timestamptz", + "file": "temporal_restrict.h", + "returnType": { + "c": "TInstant *", + "canonical": "struct TInstant *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "tdiscseq_restrict_value", + "file": "temporal_restrict.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tdiscseq_restrict_values", + "file": "temporal_restrict.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tdiscseq_minus_timestamptz", + "file": "temporal_restrict.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "tdiscseq_restrict_tstzset", + "file": "temporal_restrict.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tdiscseq_restrict_tstzspanset", + "file": "temporal_restrict.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tcontseq_restrict_value_iter", + "file": "temporal_restrict.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "result", + "cType": "TSequence **", + "canonical": "struct TSequence **" + } + ] + }, + { + "name": "tcontseq_delete_timestamptz", + "file": "temporal_restrict.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "tcontseq_delete_tstzset", + "file": "temporal_restrict.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "tcontseq_delete_tstzspanset", + "file": "temporal_restrict.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + } + ] + }, + { + "name": "tcontseq_at_tstzset", + "file": "temporal_restrict.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "tcontseq_minus_timestamptz", + "file": "temporal_restrict.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "tcontseq_minus_tstzset", + "file": "temporal_restrict.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "tcontseq_minus_tstzspan", + "file": "temporal_restrict.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "tcontseq_restrict_value", + "file": "temporal_restrict.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tcontseq_restrict_values", + "file": "temporal_restrict.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tsequence_at_values_iter", + "file": "temporal_restrict.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "set", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "result", + "cType": "TSequence **", + "canonical": "struct TSequence **" + } + ] + }, + { + "name": "tnumberseq_cont_restrict_span_iter", + "file": "temporal_restrict.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "span", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "result", + "cType": "TSequence **", + "canonical": "struct TSequence **" + } + ] + }, + { + "name": "tnumberseq_cont_restrict_spanset_iter", + "file": "temporal_restrict.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "result", + "cType": "TSequence **", + "canonical": "struct TSequence **" + } + ] + }, + { + "name": "tsegment_at_timestamptz", + "file": "temporal_restrict.h", + "returnType": { + "c": "TInstant *", + "canonical": "struct TInstant *" + }, + "params": [ + { + "name": "inst1", + "cType": "const TInstant *", + "canonical": "const struct TInstant *" + }, + { + "name": "inst2", + "cType": "const TInstant *", + "canonical": "const struct TInstant *" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "tcontseq_minus_timestamp_iter", + "file": "temporal_restrict.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "result", + "cType": "TSequence **", + "canonical": "struct TSequence **" + } + ] + }, + { + "name": "tcontseq_minus_tstzset_iter", + "file": "temporal_restrict.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "result", + "cType": "TSequence **", + "canonical": "struct TSequence **" + } + ] + }, + { + "name": "tcontseq_at_tstzspanset1", + "file": "temporal_restrict.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "result", + "cType": "TSequence **", + "canonical": "struct TSequence **" + } + ] + }, + { + "name": "tcontseq_minus_tstzspanset_iter", + "file": "temporal_restrict.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "result", + "cType": "TSequence **", + "canonical": "struct TSequence **" + } + ] + }, + { + "name": "tcontseq_at_tstzspan", + "file": "temporal_restrict.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + } + ] + }, + { + "name": "tcontseq_at_timestamptz", + "file": "temporal_restrict.h", + "returnType": { + "c": "TInstant *", + "canonical": "struct TInstant *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "tcontseq_restrict_tstzspanset", + "file": "temporal_restrict.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tdiscseq_value_at_timestamptz", + "file": "temporal_restrict.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "result", + "cType": "Datum *", + "canonical": "int ((*)(int *))()" + } + ] + }, + { + "name": "tnumberseq_disc_restrict_span", + "file": "temporal_restrict.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "span", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tnumberseq_disc_restrict_spanset", + "file": "temporal_restrict.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tnumberseq_cont_restrict_span", + "file": "temporal_restrict.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "span", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tnumberseq_cont_restrict_spanset", + "file": "temporal_restrict.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tnumberseq_cont_twavg", + "file": "temporal_restrict.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + } + ] + }, + { + "name": "span_num_bins", + "file": "temporal_tile.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "size", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "origin", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "start_bin", + "cType": "Datum *", + "canonical": "int ((*)(int *))()" + }, + { + "name": "end_bin", + "cType": "Datum *", + "canonical": "int ((*)(int *))()" + } + ] + }, + { + "name": "temporal_time_bin_init", + "file": "temporal_tile.h", + "returnType": { + "c": "SpanBinState *", + "canonical": "struct SpanBinState *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "duration", + "cType": "const Interval *", + "canonical": "const Interval *" + }, + { + "name": "torigin", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "nbins", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tbox_tile_state_make", + "file": "temporal_tile.h", + "returnType": { + "c": "TboxGridState *", + "canonical": "struct TboxGridState *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const TBox *", + "canonical": "const struct TBox *" + }, + { + "name": "vsize", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "duration", + "cType": "const Interval *", + "canonical": "const Interval *" + }, + { + "name": "xorigin", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "torigin", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "tbox_tile_state_next", + "file": "temporal_tile.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "state", + "cType": "TboxGridState *", + "canonical": "struct TboxGridState *" + } + ] + }, + { + "name": "tbox_tile_state_set", + "file": "temporal_tile.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "vsize", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "tunits", + "cType": "int64", + "canonical": "long" + }, + { + "name": "basetype", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "spantype", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "box", + "cType": "TBox *", + "canonical": "struct TBox *" + } + ] + }, + { + "name": "interval_units", + "file": "temporal_tile.h", + "returnType": { + "c": "int64", + "canonical": "long" + }, + "params": [ + { + "name": "interval", + "cType": "const Interval *", + "canonical": "const Interval *" + } + ] + }, + { + "name": "timestamptz_bin_start", + "file": "temporal_tile.h", + "returnType": { + "c": "TimestampTz", + "canonical": "long" + }, + "params": [ + { + "name": "timestamp", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "tunits", + "cType": "int64", + "canonical": "long" + }, + { + "name": "torigin", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "datum_bin", + "file": "temporal_tile.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "size", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "offset", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "basetype", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "tnumber_value_time_tile_init", + "file": "temporal_tile.h", + "returnType": { + "c": "TboxGridState *", + "canonical": "struct TboxGridState *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "vsize", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "duration", + "cType": "const Interval *", + "canonical": "const Interval *" + }, + { + "name": "vorigin", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "torigin", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "ntiles", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tbox_tile_state_get", + "file": "temporal_tile.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "state", + "cType": "TboxGridState *", + "canonical": "struct TboxGridState *" + }, + { + "name": "box", + "cType": "TBox *", + "canonical": "struct TBox *" + } + ] + }, + { + "name": "temporal_transform_wcount", + "file": "temporal_waggfuncs.h", + "returnType": { + "c": "TSequence **", + "canonical": "struct TSequence **" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "interval", + "cType": "const Interval *", + "canonical": "const Interval *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tnumber_transform_wavg", + "file": "temporal_waggfuncs.h", + "returnType": { + "c": "TSequence **", + "canonical": "struct TSequence **" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "interval", + "cType": "const Interval *", + "canonical": "const Interval *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "temporal_wagg_transfn", + "file": "temporal_waggfuncs.h", + "returnType": { + "c": "SkipList *", + "canonical": "struct SkipList *" + }, + "params": [ + { + "name": "state", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "interval", + "cType": "const Interval *", + "canonical": "const Interval *" + }, + { + "name": "func", + "cType": "datum_func2", + "canonical": "int (*)(int ((*)(int *))(), int ((*)(int *))())" + }, + { + "name": "min", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "crossings", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "temporal_wagg_transform_transfn", + "file": "temporal_waggfuncs.h", + "returnType": { + "c": "SkipList *", + "canonical": "struct SkipList *" + }, + "params": [ + { + "name": "state", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "interval", + "cType": "const Interval *", + "canonical": "const Interval *" + }, + { + "name": "func", + "cType": "datum_func2", + "canonical": "int (*)(int ((*)(int *))(), int ((*)(int *))())" + }, + { + "name": "transform", + "cType": "TSequence **(*)(const Temporal *, const Interval *, int *)", + "canonical": "struct TSequence ()( Temporal , Interval , int ) **(*)(const Temporal *, const Interval *, int *)" + } + ] + }, + { + "name": "tinstant_set", + "file": "tinstant.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "inst", + "cType": "TInstant *", + "canonical": "struct TInstant *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "tnumberinst_double", + "file": "tinstant.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const struct TInstant *" + } + ] + }, + { + "name": "tinstant_to_string", + "file": "tinstant.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const struct TInstant *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + }, + { + "name": "value_out", + "cType": "outfunc", + "canonical": "char *(*)(int ((*)(int *))(), MeosType, int)" + } + ] + }, + { + "name": "tinstant_restrict_values_test", + "file": "tinstant.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const struct TInstant *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tnumberinst_restrict_span_test", + "file": "tinstant.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const struct TInstant *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const struct Span *" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tnumberinst_restrict_spanset_test", + "file": "tinstant.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const struct TInstant *" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tinstant_restrict_tstzset_test", + "file": "tinstant.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const struct TInstant *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tinstant_restrict_tstzspanset_test", + "file": "tinstant.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const struct TInstant *" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const struct SpanSet *" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "intersection_tinstant_tinstant", + "file": "tinstant.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "inst1", + "cType": "const TInstant *", + "canonical": "const struct TInstant *" + }, + { + "name": "inst2", + "cType": "const TInstant *", + "canonical": "const struct TInstant *" + }, + { + "name": "inter1", + "cType": "TInstant **", + "canonical": "struct TInstant **" + }, + { + "name": "inter2", + "cType": "TInstant **", + "canonical": "struct TInstant **" + } + ] + }, + { + "name": "tfloat_arithop_turnpt", + "file": "tnumber_mathfuncs.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "start1", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "end1", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "start2", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "end2", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "param", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "arithop_tnumber_number", + "file": "tnumber_mathfuncs.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "oper", + "cType": "TArithmetic", + "canonical": "TArithmetic" + }, + { + "name": "func", + "cType": "int (*)(Datum *, Datum *, MeosType)", + "canonical": "int (*)(int ((*)(int *))(), int ((*)(int *))(), MeosType)" + }, + { + "name": "invert", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "arithop_tnumber_tnumber", + "file": "tnumber_mathfuncs.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "oper", + "cType": "TArithmetic", + "canonical": "TArithmetic" + }, + { + "name": "func", + "cType": "int (*)(Datum *, Datum *, MeosType)", + "canonical": "int (*)(int ((*)(int *))(), int ((*)(int *))(), MeosType)" + }, + { + "name": "tpfunc", + "cType": "tpfunc_temp", + "canonical": "int (*)(int ((*)(int *))(), int ((*)(int *))(), int ((*)(int *))(), int ((*)(int *))(), int ((*)(int *))(), long, long, long *, long *)" + } + ] + }, + { + "name": "float_collinear", + "file": "tsequence.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "x1", + "cType": "double", + "canonical": "double" + }, + { + "name": "x2", + "cType": "double", + "canonical": "double" + }, + { + "name": "x3", + "cType": "double", + "canonical": "double" + }, + { + "name": "ratio", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "floatsegm_interpolate", + "file": "tsequence.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "value1", + "cType": "double", + "canonical": "double" + }, + { + "name": "value2", + "cType": "double", + "canonical": "double" + }, + { + "name": "value", + "cType": "long double", + "canonical": "long double" + } + ] + }, + { + "name": "floatsegm_locate", + "file": "tsequence.h", + "returnType": { + "c": "long double", + "canonical": "long double" + }, + "params": [ + { + "name": "value1", + "cType": "double", + "canonical": "double" + }, + { + "name": "value2", + "cType": "double", + "canonical": "double" + }, + { + "name": "value", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "tnumbersegm_intersection", + "file": "tsequence.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "start1", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "end1", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "start2", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "end2", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "basetype", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "lower", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "upper", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "t1", + "cType": "TimestampTz *", + "canonical": "long *" + }, + { + "name": "t2", + "cType": "TimestampTz *", + "canonical": "long *" + } + ] + }, + { + "name": "tsequence_norm_test", + "file": "tsequence.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "value1", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "value2", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "value3", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "basetype", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + }, + { + "name": "t1", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "t2", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "t3", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "tsequence_join_test", + "file": "tsequence.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "seq1", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "seq2", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "removelast", + "cType": "bool *", + "canonical": "_Bool *" + }, + { + "name": "removefirst", + "cType": "bool *", + "canonical": "_Bool *" + } + ] + }, + { + "name": "tsequence_join", + "file": "tsequence.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "seq1", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "seq2", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "removelast", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "removefirst", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tinstarr_normalize", + "file": "tsequence.h", + "returnType": { + "c": "TInstant **", + "canonical": "struct TInstant **" + }, + "params": [ + { + "name": "instants", + "cType": "TInstant **", + "canonical": "struct TInstant **" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "newcount", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tcontseq_find_timestamptz", + "file": "tsequence.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "tdiscseq_find_timestamptz", + "file": "tsequence.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "tseqarr2_to_tseqarr", + "file": "tsequence.h", + "returnType": { + "c": "TSequence **", + "canonical": "struct TSequence **" + }, + "params": [ + { + "name": "sequences", + "cType": "TSequence ***", + "canonical": "struct TSequence ***" + }, + { + "name": "countseqs", + "cType": "int *", + "canonical": "int *" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "totalseqs", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "ensure_valid_tinstarr_common", + "file": "tsequence.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "instants", + "cType": "TInstant **", + "canonical": "struct TInstant **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "lower_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "upper_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "tsequence_make_exp1", + "file": "tsequence.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "instants", + "cType": "TInstant **", + "canonical": "struct TInstant **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "maxcount", + "cType": "int", + "canonical": "int" + }, + { + "name": "lower_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "upper_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + }, + { + "name": "normalize", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "bbox", + "cType": "void *", + "canonical": "void *" + } + ] + }, + { + "name": "synchronize_tsequence_tsequence", + "file": "tsequence.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "seq1", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "seq2", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "sync1", + "cType": "TSequence **", + "canonical": "struct TSequence **" + }, + { + "name": "sync2", + "cType": "TSequence **", + "canonical": "struct TSequence **" + }, + { + "name": "interpoint", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tfloatsegm_intersection_value", + "file": "tsequence.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "start", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "end", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "lower", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "upper", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "t", + "cType": "TimestampTz *", + "canonical": "long *" + } + ] + }, + { + "name": "tsegment_intersection_value", + "file": "tsequence.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "start", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "end", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "temptype", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "lower", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "upper", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "t1", + "cType": "TimestampTz *", + "canonical": "long *" + }, + { + "name": "t2", + "cType": "TimestampTz *", + "canonical": "long *" + } + ] + }, + { + "name": "tsegment_intersection", + "file": "tsequence.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "start1", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "end1", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "start2", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "end2", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "temptype", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "lower", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "upper", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "t1", + "cType": "TimestampTz *", + "canonical": "long *" + }, + { + "name": "t2", + "cType": "TimestampTz *", + "canonical": "long *" + } + ] + }, + { + "name": "tsegment_value_at_timestamptz", + "file": "tsequence.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "start", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "end", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "temptype", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "lower", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "upper", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "intersection_tdiscseq_tdiscseq", + "file": "tsequence.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "seq1", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "seq2", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "inter1", + "cType": "TSequence **", + "canonical": "struct TSequence **" + }, + { + "name": "inter2", + "cType": "TSequence **", + "canonical": "struct TSequence **" + } + ] + }, + { + "name": "intersection_tcontseq_tdiscseq", + "file": "tsequence.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "seq1", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "seq2", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "inter1", + "cType": "TSequence **", + "canonical": "struct TSequence **" + }, + { + "name": "inter2", + "cType": "TSequence **", + "canonical": "struct TSequence **" + } + ] + }, + { + "name": "intersection_tdiscseq_tcontseq", + "file": "tsequence.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "is", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "seq2", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "inter1", + "cType": "TSequence **", + "canonical": "struct TSequence **" + }, + { + "name": "inter2", + "cType": "TSequence **", + "canonical": "struct TSequence **" + } + ] + }, + { + "name": "intersection_tsequence_tinstant", + "file": "tsequence.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const struct TInstant *" + }, + { + "name": "inter1", + "cType": "TInstant **", + "canonical": "struct TInstant **" + }, + { + "name": "inter2", + "cType": "TInstant **", + "canonical": "struct TInstant **" + } + ] + }, + { + "name": "intersection_tinstant_tsequence", + "file": "tsequence.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const struct TInstant *" + }, + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "inter1", + "cType": "TInstant **", + "canonical": "struct TInstant **" + }, + { + "name": "inter2", + "cType": "TInstant **", + "canonical": "struct TInstant **" + } + ] + }, + { + "name": "tsequence_to_string", + "file": "tsequence.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + }, + { + "name": "component", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "value_out", + "cType": "outfunc", + "canonical": "char *(*)(int ((*)(int *))(), MeosType, int)" + } + ] + }, + { + "name": "ensure_increasing_timestamps", + "file": "tsequence.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "inst1", + "cType": "const TInstant *", + "canonical": "const struct TInstant *" + }, + { + "name": "inst2", + "cType": "const TInstant *", + "canonical": "const struct TInstant *" + }, + { + "name": "strict", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "bbox_expand", + "file": "tsequence.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "box1", + "cType": "const void *", + "canonical": "const void *" + }, + { + "name": "box2", + "cType": "void *", + "canonical": "void *" + }, + { + "name": "temptype", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "ensure_valid_tinstarr", + "file": "tsequence.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "instants", + "cType": "TInstant **", + "canonical": "struct TInstant **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "merge", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "tsequence_make_valid", + "file": "tsequence.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "instants", + "cType": "TInstant **", + "canonical": "struct TInstant **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "lower_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "upper_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "tnumberseq_shift_scale_value_iter", + "file": "tsequence.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "seq", + "cType": "TSequence *", + "canonical": "struct TSequence *" + }, + { + "name": "origin", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "delta", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "hasdelta", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "scale", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "tsequence_shift_scale_time_iter", + "file": "tsequence.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "seq", + "cType": "TSequence *", + "canonical": "struct TSequence *" + }, + { + "name": "delta", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "scale", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "tstepseq_to_linear_iter", + "file": "tsequence.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "result", + "cType": "TSequence **", + "canonical": "struct TSequence **" + } + ] + }, + { + "name": "tstepseq_to_linear", + "file": "tsequence.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + } + ] + }, + { + "name": "tsequence_segments_iter", + "file": "tsequence.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "result", + "cType": "TSequence **", + "canonical": "struct TSequence **" + } + ] + }, + { + "name": "tsequence_timestamps_iter", + "file": "tsequence.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "result", + "cType": "TimestampTz *", + "canonical": "long *" + } + ] + }, + { + "name": "tsequenceset_find_timestamptz", + "file": "tsequenceset.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const struct TSequenceSet *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "loc", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tseqarr_normalize", + "file": "tsequenceset.h", + "returnType": { + "c": "TSequence **", + "canonical": "struct TSequence **" + }, + "params": [ + { + "name": "sequences", + "cType": "TSequence **", + "canonical": "struct TSequence **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "newcount", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "datum_distance", + "file": "tsequenceset.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "value1", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "value2", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "basetype", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "flags", + "cType": "int16", + "canonical": "short" + } + ] + }, + { + "name": "ensure_valid_tinstarr_gaps", + "file": "tsequenceset.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "instants", + "cType": "TInstant **", + "canonical": "struct TInstant **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "merge", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "maxdist", + "cType": "double", + "canonical": "double" + }, + { + "name": "maxt", + "cType": "const Interval *", + "canonical": "const Interval *" + }, + { + "name": "nsplits", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "ensure_valid_tseqarr", + "file": "tsequenceset.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "sequences", + "cType": "TSequence **", + "canonical": "struct TSequence **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "synchronize_tsequenceset_tsequence", + "file": "tsequenceset.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const struct TSequenceSet *" + }, + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "mode", + "cType": "SyncMode", + "canonical": "SyncMode" + }, + { + "name": "inter1", + "cType": "TSequenceSet **", + "canonical": "struct TSequenceSet **" + }, + { + "name": "inter2", + "cType": "TSequenceSet **", + "canonical": "struct TSequenceSet **" + } + ] + }, + { + "name": "synchronize_tsequenceset_tsequenceset", + "file": "tsequenceset.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss1", + "cType": "const TSequenceSet *", + "canonical": "const struct TSequenceSet *" + }, + { + "name": "ss2", + "cType": "const TSequenceSet *", + "canonical": "const struct TSequenceSet *" + }, + { + "name": "mode", + "cType": "SyncMode", + "canonical": "SyncMode" + }, + { + "name": "inter1", + "cType": "TSequenceSet **", + "canonical": "struct TSequenceSet **" + }, + { + "name": "inter2", + "cType": "TSequenceSet **", + "canonical": "struct TSequenceSet **" + } + ] + }, + { + "name": "intersection_tsequenceset_tinstant", + "file": "tsequenceset.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const struct TSequenceSet *" + }, + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const struct TInstant *" + }, + { + "name": "inter1", + "cType": "TInstant **", + "canonical": "struct TInstant **" + }, + { + "name": "inter2", + "cType": "TInstant **", + "canonical": "struct TInstant **" + } + ] + }, + { + "name": "intersection_tinstant_tsequenceset", + "file": "tsequenceset.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const struct TInstant *" + }, + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const struct TSequenceSet *" + }, + { + "name": "inter1", + "cType": "TInstant **", + "canonical": "struct TInstant **" + }, + { + "name": "inter2", + "cType": "TInstant **", + "canonical": "struct TInstant **" + } + ] + }, + { + "name": "intersection_tsequenceset_tdiscseq", + "file": "tsequenceset.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const struct TSequenceSet *" + }, + { + "name": "is", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "inter1", + "cType": "TSequence **", + "canonical": "struct TSequence **" + }, + { + "name": "inter2", + "cType": "TSequence **", + "canonical": "struct TSequence **" + } + ] + }, + { + "name": "intersection_tdiscseq_tsequenceset", + "file": "tsequenceset.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "is", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const struct TSequenceSet *" + }, + { + "name": "inter1", + "cType": "TSequence **", + "canonical": "struct TSequence **" + }, + { + "name": "inter2", + "cType": "TSequence **", + "canonical": "struct TSequence **" + } + ] + }, + { + "name": "intersection_tsequence_tsequenceset", + "file": "tsequenceset.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const struct TSequence *" + }, + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const struct TSequenceSet *" + }, + { + "name": "mode", + "cType": "SyncMode", + "canonical": "SyncMode" + }, + { + "name": "inter1", + "cType": "TSequenceSet **", + "canonical": "struct TSequenceSet **" + }, + { + "name": "inter2", + "cType": "TSequenceSet **", + "canonical": "struct TSequenceSet **" + } + ] + }, + { + "name": "tsequenceset_to_string", + "file": "tsequenceset.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const struct TSequenceSet *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + }, + { + "name": "value_out", + "cType": "outfunc", + "canonical": "char *(*)(int ((*)(int *))(), MeosType, int)" + } + ] + }, + { + "name": "datum_textcat", + "file": "ttext_funcs.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "l", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "r", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_lower", + "file": "ttext_funcs.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_upper", + "file": "ttext_funcs.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "datum_initcap", + "file": "ttext_funcs.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + } + ] + }, + { + "name": "textfunc_ttext", + "file": "ttext_funcs.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "func", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "textfunc_ttext_text", + "file": "ttext_funcs.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "func", + "cType": "datum_func2", + "canonical": "int (*)(int ((*)(int *))(), int ((*)(int *))())" + }, + { + "name": "invert", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "textfunc_ttext_ttext", + "file": "ttext_funcs.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "func", + "cType": "datum_func2", + "canonical": "int (*)(int ((*)(int *))(), int ((*)(int *))())" + } + ] + }, + { + "name": "datum_as_wkb", + "file": "type_inout.h", + "returnType": { + "c": "uint8_t *", + "canonical": "unsigned char *" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "variant", + "cType": "uint8_t", + "canonical": "unsigned char" + }, + { + "name": "size_out", + "cType": "size_t *", + "canonical": "unsigned long *" + } + ] + }, + { + "name": "datum_as_hexwkb", + "file": "type_inout.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "variant", + "cType": "uint8_t", + "canonical": "unsigned char" + }, + { + "name": "size", + "cType": "size_t *", + "canonical": "unsigned long *" + } + ] + }, + { + "name": "type_from_wkb", + "file": "type_inout.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "wkb", + "cType": "const uint8_t *", + "canonical": "const unsigned char *" + }, + { + "name": "size", + "cType": "size_t", + "canonical": "unsigned long" + }, + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "type_from_hexwkb", + "file": "type_inout.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "hexwkb", + "cType": "const char *", + "canonical": "const char *" + }, + { + "name": "size", + "cType": "size_t", + "canonical": "unsigned long" + }, + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "ensure_end_input", + "file": "type_parser.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "str", + "cType": "const char **", + "canonical": "const char **" + }, + { + "name": "type", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "p_whitespace", + "file": "type_parser.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "str", + "cType": "const char **", + "canonical": "const char **" + } + ] + }, + { + "name": "p_delimchar", + "file": "type_parser.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "str", + "cType": "const char **", + "canonical": "const char **" + }, + { + "name": "delim", + "cType": "char", + "canonical": "char" + } + ] + }, + { + "name": "p_obrace", + "file": "type_parser.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "str", + "cType": "const char **", + "canonical": "const char **" + } + ] + }, + { + "name": "ensure_obrace", + "file": "type_parser.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "str", + "cType": "const char **", + "canonical": "const char **" + }, + { + "name": "type", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "p_cbrace", + "file": "type_parser.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "str", + "cType": "const char **", + "canonical": "const char **" + } + ] + }, + { + "name": "ensure_cbrace", + "file": "type_parser.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "str", + "cType": "const char **", + "canonical": "const char **" + }, + { + "name": "type", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "p_obracket", + "file": "type_parser.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "str", + "cType": "const char **", + "canonical": "const char **" + } + ] + }, + { + "name": "p_cbracket", + "file": "type_parser.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "str", + "cType": "const char **", + "canonical": "const char **" + } + ] + }, + { + "name": "p_oparen", + "file": "type_parser.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "str", + "cType": "const char **", + "canonical": "const char **" + } + ] + }, + { + "name": "ensure_oparen", + "file": "type_parser.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "str", + "cType": "const char **", + "canonical": "const char **" + }, + { + "name": "type", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "p_cparen", + "file": "type_parser.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "str", + "cType": "const char **", + "canonical": "const char **" + } + ] + }, + { + "name": "ensure_cparen", + "file": "type_parser.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "str", + "cType": "const char **", + "canonical": "const char **" + }, + { + "name": "type", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "p_comma", + "file": "type_parser.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "str", + "cType": "const char **", + "canonical": "const char **" + } + ] + }, + { + "name": "basetype_parse", + "file": "type_parser.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "str", + "cType": "const char **", + "canonical": "const char **" + }, + { + "name": "basetypid", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "delim", + "cType": "char", + "canonical": "char" + }, + { + "name": "result", + "cType": "Datum *", + "canonical": "int ((*)(int *))()" + } + ] + }, + { + "name": "double_parse", + "file": "type_parser.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "str", + "cType": "const char **", + "canonical": "const char **" + }, + { + "name": "result", + "cType": "double *", + "canonical": "double *" + } + ] + }, + { + "name": "elem_parse", + "file": "type_parser.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "str", + "cType": "const char **", + "canonical": "const char **" + }, + { + "name": "basetype", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "result", + "cType": "Datum *", + "canonical": "int ((*)(int *))()" + } + ] + }, + { + "name": "set_parse", + "file": "type_parser.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "str", + "cType": "const char **", + "canonical": "const char **" + }, + { + "name": "basetype", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "span_parse", + "file": "type_parser.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "str", + "cType": "const char **", + "canonical": "const char **" + }, + { + "name": "spantype", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "end", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "span", + "cType": "Span *", + "canonical": "struct Span *" + } + ] + }, + { + "name": "spanset_parse", + "file": "type_parser.h", + "returnType": { + "c": "SpanSet *", + "canonical": "struct SpanSet *" + }, + "params": [ + { + "name": "str", + "cType": "const char **", + "canonical": "const char **" + }, + { + "name": "spantype", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "tbox_parse", + "file": "type_parser.h", + "returnType": { + "c": "TBox *", + "canonical": "struct TBox *" + }, + "params": [ + { + "name": "str", + "cType": "const char **", + "canonical": "const char **" + } + ] + }, + { + "name": "timestamp_parse", + "file": "type_parser.h", + "returnType": { + "c": "TimestampTz", + "canonical": "long" + }, + "params": [ + { + "name": "str", + "cType": "const char **", + "canonical": "const char **" + } + ] + }, + { + "name": "tinstant_parse", + "file": "type_parser.h", + "returnType": { + "c": "TInstant *", + "canonical": "struct TInstant *" + }, + "params": [ + { + "name": "str", + "cType": "const char **", + "canonical": "const char **" + }, + { + "name": "temptype", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "end", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tdiscseq_parse", + "file": "type_parser.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "str", + "cType": "const char **", + "canonical": "const char **" + }, + { + "name": "temptype", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "tcontseq_parse", + "file": "type_parser.h", + "returnType": { + "c": "TSequence *", + "canonical": "struct TSequence *" + }, + "params": [ + { + "name": "str", + "cType": "const char **", + "canonical": "const char **" + }, + { + "name": "temptype", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + }, + { + "name": "end", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tsequenceset_parse", + "file": "type_parser.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "struct TSequenceSet *" + }, + "params": [ + { + "name": "str", + "cType": "const char **", + "canonical": "const char **" + }, + { + "name": "temptype", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "temporal_parse", + "file": "type_parser.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "str", + "cType": "const char **", + "canonical": "const char **" + }, + { + "name": "temptype", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "datum_copy", + "file": "type_util.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "typid", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "datum_double", + "file": "type_util.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "d", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "double_datum", + "file": "type_util.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + }, + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "bstring2bytea", + "file": "type_util.h", + "returnType": { + "c": "bytea *", + "canonical": "struct varlena *" + }, + "params": [ + { + "name": "wkb", + "cType": "const uint8_t *", + "canonical": "const unsigned char *" + }, + { + "name": "size", + "cType": "size_t", + "canonical": "unsigned long" + } + ] + }, + { + "name": "basetype_in", + "file": "type_util.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + }, + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "end", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "result", + "cType": "Datum *", + "canonical": "int ((*)(int *))()" + } + ] + }, + { + "name": "basetype_out", + "file": "type_util.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "pfree_array", + "file": "type_util.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "array", + "cType": "void **", + "canonical": "void **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "string_escape", + "file": "type_util.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + }, + { + "name": "quotes", + "cType": "int", + "canonical": "int" + }, + { + "name": "result", + "cType": "char **", + "canonical": "char **" + } + ] + }, + { + "name": "string_unescape", + "file": "type_util.h", + "returnType": { + "c": "size_t", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + }, + { + "name": "result", + "cType": "char **", + "canonical": "char **" + } + ] + }, + { + "name": "stringarr_to_string", + "file": "type_util.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "strings", + "cType": "char **", + "canonical": "char **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "prefix", + "cType": "char *", + "canonical": "char *" + }, + { + "name": "open", + "cType": "char", + "canonical": "char" + }, + { + "name": "close", + "cType": "char", + "canonical": "char" + }, + { + "name": "quotes", + "cType": "int", + "canonical": "int" + }, + { + "name": "spaces", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "datumarr_sort", + "file": "type_util.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "values", + "cType": "Datum *", + "canonical": "int ((*)(int *))()" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "basetype", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "tstzarr_sort", + "file": "type_util.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "times", + "cType": "TimestampTz *", + "canonical": "long *" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "spanarr_sort", + "file": "type_util.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "spans", + "cType": "Span *", + "canonical": "struct Span *" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "tinstarr_sort", + "file": "type_util.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "instants", + "cType": "TInstant **", + "canonical": "struct TInstant **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "tseqarr_sort", + "file": "type_util.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "sequences", + "cType": "TSequence **", + "canonical": "struct TSequence **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "datumarr_remove_duplicates", + "file": "type_util.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "values", + "cType": "Datum *", + "canonical": "int ((*)(int *))()" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "basetype", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "tstzarr_remove_duplicates", + "file": "type_util.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "values", + "cType": "TimestampTz *", + "canonical": "long *" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "tinstarr_remove_duplicates", + "file": "type_util.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "instants", + "cType": "TInstant **", + "canonical": "struct TInstant **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "datum_add", + "file": "type_util.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "l", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "r", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "datum_sub", + "file": "type_util.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "l", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "r", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "datum_mul", + "file": "type_util.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "l", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "r", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "datum_div", + "file": "type_util.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "l", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "r", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "datum_cmp", + "file": "type_util.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "l", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "r", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "datum_eq", + "file": "type_util.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "l", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "r", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "datum_ne", + "file": "type_util.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "l", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "r", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "datum_lt", + "file": "type_util.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "l", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "r", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "datum_le", + "file": "type_util.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "l", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "r", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "datum_gt", + "file": "type_util.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "l", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "r", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "datum_ge", + "file": "type_util.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "l", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "r", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "datum2_eq", + "file": "type_util.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "l", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "r", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "datum2_ne", + "file": "type_util.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "l", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "r", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "datum2_lt", + "file": "type_util.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "l", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "r", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "datum2_le", + "file": "type_util.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "l", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "r", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "datum2_gt", + "file": "type_util.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "l", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "r", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "datum2_ge", + "file": "type_util.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "l", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "r", + "cType": "Datum", + "canonical": "int ((int *))()" + }, + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "hypot3d", + "file": "type_util.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "x", + "cType": "double", + "canonical": "double" + }, + { + "name": "y", + "cType": "double", + "canonical": "double" + }, + { + "name": "z", + "cType": "double", + "canonical": "double" + } + ] + } + ], + "structs": [ + { + "name": "Set", + "file": "meos.h", + "fields": [ + { + "name": "vl_len_", + "cType": "int32", + "offset_bits": 0 + }, + { + "name": "settype", + "cType": "uint8", + "offset_bits": 32 + }, + { + "name": "basetype", + "cType": "uint8", + "offset_bits": 40 + }, + { + "name": "flags", + "cType": "int16", + "offset_bits": 48 + }, + { + "name": "count", + "cType": "int32", + "offset_bits": 64 + }, + { + "name": "maxcount", + "cType": "int32", + "offset_bits": 96 + }, + { + "name": "bboxsize", + "cType": "int16", + "offset_bits": 128 + } + ] + }, + { + "name": "Span", + "file": "meos.h", + "fields": [ + { + "name": "spantype", + "cType": "uint8", + "offset_bits": -1 + }, + { + "name": "basetype", + "cType": "uint8", + "offset_bits": -1 + }, + { + "name": "lower_inc", + "cType": "_Bool", + "offset_bits": -1 + }, + { + "name": "upper_inc", + "cType": "_Bool", + "offset_bits": -1 + }, + { + "name": "padding", + "cType": "char[4]", + "offset_bits": -1 + }, + { + "name": "lower", + "cType": "int", + "offset_bits": -1 + }, + { + "name": "upper", + "cType": "int", + "offset_bits": -1 + } + ] + }, + { + "name": "SpanSet", + "file": "meos.h", + "fields": [ + { + "name": "vl_len_", + "cType": "int32", + "offset_bits": -1 + }, + { + "name": "spansettype", + "cType": "uint8", + "offset_bits": -1 + }, + { + "name": "spantype", + "cType": "uint8", + "offset_bits": -1 + }, + { + "name": "basetype", + "cType": "uint8", + "offset_bits": -1 + }, + { + "name": "padding", + "cType": "char", + "offset_bits": -1 + }, + { + "name": "count", + "cType": "int32", + "offset_bits": -1 + }, + { + "name": "maxcount", + "cType": "int32", + "offset_bits": -1 + }, + { + "name": "span", + "cType": "Span", + "offset_bits": -1 + }, + { + "name": "elems", + "cType": "Span[1]", + "offset_bits": -1 + } + ] + }, + { + "name": "TBox", + "file": "meos.h", + "fields": [ + { + "name": "period", + "cType": "Span", + "offset_bits": -1 + }, + { + "name": "span", + "cType": "Span", + "offset_bits": -1 + }, + { + "name": "flags", + "cType": "int16", + "offset_bits": -1 + } + ] + }, + { + "name": "STBox", + "file": "meos.h", + "fields": [ + { + "name": "period", + "cType": "Span", + "offset_bits": -1 + }, + { + "name": "xmin", + "cType": "double", + "offset_bits": -1 + }, + { + "name": "ymin", + "cType": "double", + "offset_bits": -1 + }, + { + "name": "zmin", + "cType": "double", + "offset_bits": -1 + }, + { + "name": "xmax", + "cType": "double", + "offset_bits": -1 + }, + { + "name": "ymax", + "cType": "double", + "offset_bits": -1 + }, + { + "name": "zmax", + "cType": "double", + "offset_bits": -1 + }, + { + "name": "srid", + "cType": "int32_t", + "offset_bits": -1 + }, + { + "name": "flags", + "cType": "int16", + "offset_bits": -1 + } + ] + }, + { + "name": "Temporal", + "file": "meos.h", + "fields": [ + { + "name": "vl_len_", + "cType": "int32", + "offset_bits": 0 + }, + { + "name": "temptype", + "cType": "uint8", + "offset_bits": 32 + }, + { + "name": "subtype", + "cType": "uint8", + "offset_bits": 40 + }, + { + "name": "flags", + "cType": "int16", + "offset_bits": 48 + } + ] + }, + { + "name": "TInstant", + "file": "meos.h", + "fields": [ + { + "name": "vl_len_", + "cType": "int32", + "offset_bits": -1 + }, + { + "name": "temptype", + "cType": "uint8", + "offset_bits": -1 + }, + { + "name": "subtype", + "cType": "uint8", + "offset_bits": -1 + }, + { + "name": "flags", + "cType": "int16", + "offset_bits": -1 + }, + { + "name": "t", + "cType": "TimestampTz", + "offset_bits": -1 + }, + { + "name": "value", + "cType": "int", + "offset_bits": -1 + } + ], + "meosType": "TPointInst" + }, + { + "name": "TSequence", + "file": "meos.h", + "fields": [ + { + "name": "vl_len_", + "cType": "int32", + "offset_bits": -1 + }, + { + "name": "temptype", + "cType": "uint8", + "offset_bits": -1 + }, + { + "name": "subtype", + "cType": "uint8", + "offset_bits": -1 + }, + { + "name": "flags", + "cType": "int16", + "offset_bits": -1 + }, + { + "name": "count", + "cType": "int32", + "offset_bits": -1 + }, + { + "name": "maxcount", + "cType": "int32", + "offset_bits": -1 + }, + { + "name": "bboxsize", + "cType": "int16", + "offset_bits": -1 + }, + { + "name": "padding", + "cType": "char[6]", + "offset_bits": -1 + }, + { + "name": "period", + "cType": "Span", + "offset_bits": -1 + } + ], + "meosType": "TPointSeq" + }, + { + "name": "TSequenceSet", + "file": "meos.h", + "fields": [ + { + "name": "vl_len_", + "cType": "int32", + "offset_bits": -1 + }, + { + "name": "temptype", + "cType": "uint8", + "offset_bits": -1 + }, + { + "name": "subtype", + "cType": "uint8", + "offset_bits": -1 + }, + { + "name": "flags", + "cType": "int16", + "offset_bits": -1 + }, + { + "name": "count", + "cType": "int32", + "offset_bits": -1 + }, + { + "name": "totalcount", + "cType": "int32", + "offset_bits": -1 + }, + { + "name": "maxcount", + "cType": "int32", + "offset_bits": -1 + }, + { + "name": "bboxsize", + "cType": "int16", + "offset_bits": -1 + }, + { + "name": "padding", + "cType": "int16", + "offset_bits": -1 + }, + { + "name": "period", + "cType": "Span", + "offset_bits": -1 + } + ] + }, + { + "name": "Match", + "file": "meos.h", + "fields": [ + { + "name": "i", + "cType": "int", + "offset_bits": 0 + }, + { + "name": "j", + "cType": "int", + "offset_bits": 32 + } + ] + }, + { + "name": "SkipList", + "file": "meos.h", + "fields": [] + }, + { + "name": "MeosArray", + "file": "meos.h", + "fields": [] + }, + { + "name": "RTree", + "file": "meos.h", + "fields": [] + }, + { + "name": "MvtGeom", + "file": "meos_geo.h", + "fields": [ + { + "name": "geom", + "cType": "int *", + "offset_bits": -1 + }, + { + "name": "times", + "cType": "int64 *", + "offset_bits": -1 + }, + { + "name": "count", + "cType": "int", + "offset_bits": -1 + } + ] + }, + { + "name": "SpaceSplit", + "file": "meos_geo.h", + "fields": [ + { + "name": "fragments", + "cType": "Temporal **", + "offset_bits": -1 + }, + { + "name": "bins", + "cType": "int **", + "offset_bits": -1 + }, + { + "name": "count", + "cType": "int", + "offset_bits": -1 + } + ] + }, + { + "name": "SpaceTimeSplit", + "file": "meos_geo.h", + "fields": [ + { + "name": "fragments", + "cType": "Temporal **", + "offset_bits": -1 + }, + { + "name": "space_bins", + "cType": "int **", + "offset_bits": -1 + }, + { + "name": "time_bins", + "cType": "TimestampTz *", + "offset_bits": -1 + }, + { + "name": "count", + "cType": "int", + "offset_bits": -1 + } + ] + }, + { + "name": "Cbuffer", + "file": "meos_cbuffer.h", + "fields": [] + }, + { + "name": "temptype_catalog_struct", + "file": "meos_catalog.h", + "fields": [ + { + "name": "temptype", + "cType": "MeosType", + "offset_bits": 0 + }, + { + "name": "basetype", + "cType": "MeosType", + "offset_bits": 32 + } + ] + }, + { + "name": "settype_catalog_struct", + "file": "meos_catalog.h", + "fields": [ + { + "name": "settype", + "cType": "MeosType", + "offset_bits": 0 + }, + { + "name": "basetype", + "cType": "MeosType", + "offset_bits": 32 + } + ] + }, + { + "name": "spantype_catalog_struct", + "file": "meos_catalog.h", + "fields": [ + { + "name": "spantype", + "cType": "MeosType", + "offset_bits": 0 + }, + { + "name": "basetype", + "cType": "MeosType", + "offset_bits": 32 + } + ] + }, + { + "name": "spansettype_catalog_struct", + "file": "meos_catalog.h", + "fields": [ + { + "name": "spansettype", + "cType": "MeosType", + "offset_bits": 0 + }, + { + "name": "spantype", + "cType": "MeosType", + "offset_bits": 32 + } + ] + }, + { + "name": "SkipListElem", + "file": "meos_internal.h", + "fields": [ + { + "name": "key", + "cType": "void *", + "offset_bits": 0 + }, + { + "name": "value", + "cType": "void *", + "offset_bits": 64 + }, + { + "name": "height", + "cType": "int", + "offset_bits": 128 + }, + { + "name": "next", + "cType": "int[32]", + "offset_bits": 160 + } + ] + }, + { + "name": "double2", + "file": "doublen.h", + "fields": [ + { + "name": "a", + "cType": "double", + "offset_bits": 0 + }, + { + "name": "b", + "cType": "double", + "offset_bits": 64 + } + ] + }, + { + "name": "double3", + "file": "doublen.h", + "fields": [ + { + "name": "a", + "cType": "double", + "offset_bits": 0 + }, + { + "name": "b", + "cType": "double", + "offset_bits": 64 + }, + { + "name": "c", + "cType": "double", + "offset_bits": 128 + } + ] + }, + { + "name": "double4", + "file": "doublen.h", + "fields": [ + { + "name": "a", + "cType": "double", + "offset_bits": 0 + }, + { + "name": "b", + "cType": "double", + "offset_bits": 64 + }, + { + "name": "c", + "cType": "double", + "offset_bits": 128 + }, + { + "name": "d", + "cType": "double", + "offset_bits": 192 + } + ] + }, + { + "name": "STboxNode", + "file": "stbox_index.h", + "fields": [ + { + "name": "left", + "cType": "STBox", + "offset_bits": -1 + }, + { + "name": "right", + "cType": "STBox", + "offset_bits": -1 + } + ] + }, + { + "name": "SortedSTbox", + "file": "stbox_index.h", + "fields": [ + { + "name": "box", + "cType": "STBox", + "offset_bits": -1 + }, + { + "name": "i", + "cType": "int", + "offset_bits": -1 + } + ] + }, + { + "name": "GeoAggregateState", + "file": "tgeo_aggfuncs.h", + "fields": [ + { + "name": "srid", + "cType": "int32_t", + "offset_bits": 0 + }, + { + "name": "hasz", + "cType": "_Bool", + "offset_bits": 32 + } + ] + }, + { + "name": "BitMatrix", + "file": "tgeo_tile.h", + "fields": [ + { + "name": "ndims", + "cType": "int", + "offset_bits": 0 + }, + { + "name": "count", + "cType": "int[4]", + "offset_bits": 32 + }, + { + "name": "byte", + "cType": "uint8_t[1]", + "offset_bits": 160 + } + ] + }, + { + "name": "STboxGridState", + "file": "tgeo_tile.h", + "fields": [ + { + "name": "done", + "cType": "_Bool", + "offset_bits": -1 + }, + { + "name": "hasx", + "cType": "_Bool", + "offset_bits": -1 + }, + { + "name": "hasz", + "cType": "_Bool", + "offset_bits": -1 + }, + { + "name": "hast", + "cType": "_Bool", + "offset_bits": -1 + }, + { + "name": "i", + "cType": "int", + "offset_bits": -1 + }, + { + "name": "xsize", + "cType": "double", + "offset_bits": -1 + }, + { + "name": "ysize", + "cType": "double", + "offset_bits": -1 + }, + { + "name": "zsize", + "cType": "double", + "offset_bits": -1 + }, + { + "name": "tunits", + "cType": "int64", + "offset_bits": -1 + }, + { + "name": "box", + "cType": "STBox", + "offset_bits": -1 + }, + { + "name": "temp", + "cType": "const Temporal *", + "offset_bits": -1 + }, + { + "name": "bm", + "cType": "BitMatrix *", + "offset_bits": -1 + }, + { + "name": "x", + "cType": "double", + "offset_bits": -1 + }, + { + "name": "y", + "cType": "double", + "offset_bits": -1 + }, + { + "name": "z", + "cType": "double", + "offset_bits": -1 + }, + { + "name": "t", + "cType": "TimestampTz", + "offset_bits": -1 + }, + { + "name": "ntiles", + "cType": "int", + "offset_bits": -1 + }, + { + "name": "max_coords", + "cType": "int[4]", + "offset_bits": -1 + }, + { + "name": "coords", + "cType": "int[4]", + "offset_bits": -1 + } + ] + }, + { + "name": "ArrowSchema", + "file": "meos_arrow.h", + "fields": [] + }, + { + "name": "ArrowArray", + "file": "meos_arrow.h", + "fields": [] + }, + { + "name": "Npoint", + "file": "meos_npoint.h", + "fields": [ + { + "name": "rid", + "cType": "int64", + "offset_bits": 0 + }, + { + "name": "pos", + "cType": "double", + "offset_bits": 64 + } + ] + }, + { + "name": "Nsegment", + "file": "meos_npoint.h", + "fields": [ + { + "name": "rid", + "cType": "int64", + "offset_bits": 0 + }, + { + "name": "pos1", + "cType": "double", + "offset_bits": 64 + }, + { + "name": "pos2", + "cType": "double", + "offset_bits": 128 + } + ] + }, + { + "name": "Pcpoint", + "file": "meos_pointcloud.h", + "fields": [] + }, + { + "name": "Pcpatch", + "file": "meos_pointcloud.h", + "fields": [] + }, + { + "name": "PCSCHEMA", + "file": "meos_pointcloud.h", + "fields": [] + }, + { + "name": "TPCBox", + "file": "meos_pointcloud.h", + "fields": [ + { + "name": "period", + "cType": "Span", + "offset_bits": -1 + }, + { + "name": "xmin", + "cType": "double", + "offset_bits": -1 + }, + { + "name": "ymin", + "cType": "double", + "offset_bits": -1 + }, + { + "name": "zmin", + "cType": "double", + "offset_bits": -1 + }, + { + "name": "xmax", + "cType": "double", + "offset_bits": -1 + }, + { + "name": "ymax", + "cType": "double", + "offset_bits": -1 + }, + { + "name": "zmax", + "cType": "double", + "offset_bits": -1 + }, + { + "name": "srid", + "cType": "int32_t", + "offset_bits": -1 + }, + { + "name": "pcid", + "cType": "uint32_t", + "offset_bits": -1 + }, + { + "name": "flags", + "cType": "int16", + "offset_bits": -1 + }, + { + "name": "padding", + "cType": "char[6]", + "offset_bits": -1 + } + ] + }, + { + "name": "Pose", + "file": "meos_pose.h", + "fields": [] + }, + { + "name": "PcpointInTpcboxArgs", + "file": "pcpatch_decompose.h", + "fields": [ + { + "name": "box", + "cType": "const TPCBox *", + "offset_bits": 0 + }, + { + "name": "border_inc", + "cType": "_Bool", + "offset_bits": 64 + } + ] + }, + { + "name": "SERIALIZED_POINT", + "file": "pgsql_compat.h", + "fields": [ + { + "name": "size", + "cType": "uint32_t", + "offset_bits": 0 + }, + { + "name": "pcid", + "cType": "uint32_t", + "offset_bits": 32 + }, + { + "name": "data", + "cType": "uint8_t[1]", + "offset_bits": 64 + } + ] + }, + { + "name": "SERIALIZED_PATCH", + "file": "pgsql_compat.h", + "fields": [ + { + "name": "size", + "cType": "uint32_t", + "offset_bits": -1 + }, + { + "name": "pcid", + "cType": "uint32_t", + "offset_bits": -1 + }, + { + "name": "compression", + "cType": "uint32_t", + "offset_bits": -1 + }, + { + "name": "npoints", + "cType": "uint32_t", + "offset_bits": -1 + }, + { + "name": "bounds", + "cType": "int", + "offset_bits": -1 + }, + { + "name": "data", + "cType": "uint8_t[1]", + "offset_bits": -1 + } + ] + }, + { + "name": "AFFINE", + "file": "postgis_ext_defs.in.h", + "fields": [ + { + "name": "afac", + "cType": "double", + "offset_bits": 0 + }, + { + "name": "bfac", + "cType": "double", + "offset_bits": 64 + }, + { + "name": "cfac", + "cType": "double", + "offset_bits": 128 + }, + { + "name": "dfac", + "cType": "double", + "offset_bits": 192 + }, + { + "name": "efac", + "cType": "double", + "offset_bits": 256 + }, + { + "name": "ffac", + "cType": "double", + "offset_bits": 320 + }, + { + "name": "gfac", + "cType": "double", + "offset_bits": 384 + }, + { + "name": "hfac", + "cType": "double", + "offset_bits": 448 + }, + { + "name": "ifac", + "cType": "double", + "offset_bits": 512 + }, + { + "name": "xoff", + "cType": "double", + "offset_bits": 576 + }, + { + "name": "yoff", + "cType": "double", + "offset_bits": 640 + }, + { + "name": "zoff", + "cType": "double", + "offset_bits": 704 + } + ] + }, + { + "name": "BOX3D", + "file": "postgis_ext_defs.in.h", + "fields": [ + { + "name": "xmin", + "cType": "double", + "offset_bits": 0 + }, + { + "name": "ymin", + "cType": "double", + "offset_bits": 64 + }, + { + "name": "zmin", + "cType": "double", + "offset_bits": 128 + }, + { + "name": "xmax", + "cType": "double", + "offset_bits": 192 + }, + { + "name": "ymax", + "cType": "double", + "offset_bits": 256 + }, + { + "name": "zmax", + "cType": "double", + "offset_bits": 320 + }, + { + "name": "srid", + "cType": "int32_t", + "offset_bits": 384 + } + ] + }, + { + "name": "GBOX", + "file": "postgis_ext_defs.in.h", + "fields": [ + { + "name": "flags", + "cType": "lwflags_t", + "offset_bits": 0 + }, + { + "name": "xmin", + "cType": "double", + "offset_bits": 64 + }, + { + "name": "xmax", + "cType": "double", + "offset_bits": 128 + }, + { + "name": "ymin", + "cType": "double", + "offset_bits": 192 + }, + { + "name": "ymax", + "cType": "double", + "offset_bits": 256 + }, + { + "name": "zmin", + "cType": "double", + "offset_bits": 320 + }, + { + "name": "zmax", + "cType": "double", + "offset_bits": 384 + }, + { + "name": "mmin", + "cType": "double", + "offset_bits": 448 + }, + { + "name": "mmax", + "cType": "double", + "offset_bits": 512 + } + ] + }, + { + "name": "SPHEROID", + "file": "postgis_ext_defs.in.h", + "fields": [ + { + "name": "a", + "cType": "double", + "offset_bits": 0 + }, + { + "name": "b", + "cType": "double", + "offset_bits": 64 + }, + { + "name": "f", + "cType": "double", + "offset_bits": 128 + }, + { + "name": "e", + "cType": "double", + "offset_bits": 192 + }, + { + "name": "e_sq", + "cType": "double", + "offset_bits": 256 + }, + { + "name": "radius", + "cType": "double", + "offset_bits": 320 + }, + { + "name": "name", + "cType": "char[20]", + "offset_bits": 384 + } + ] + }, + { + "name": "POINT2D", + "file": "postgis_ext_defs.in.h", + "fields": [ + { + "name": "x", + "cType": "double", + "offset_bits": 0 + }, + { + "name": "y", + "cType": "double", + "offset_bits": 64 + } + ] + }, + { + "name": "POINT3DZ", + "file": "postgis_ext_defs.in.h", + "fields": [ + { + "name": "x", + "cType": "double", + "offset_bits": 0 + }, + { + "name": "y", + "cType": "double", + "offset_bits": 64 + }, + { + "name": "z", + "cType": "double", + "offset_bits": 128 + } + ] + }, + { + "name": "POINT3D", + "file": "postgis_ext_defs.in.h", + "fields": [ + { + "name": "x", + "cType": "double", + "offset_bits": 0 + }, + { + "name": "y", + "cType": "double", + "offset_bits": 64 + }, + { + "name": "z", + "cType": "double", + "offset_bits": 128 + } + ] + }, + { + "name": "POINT3DM", + "file": "postgis_ext_defs.in.h", + "fields": [ + { + "name": "x", + "cType": "double", + "offset_bits": 0 + }, + { + "name": "y", + "cType": "double", + "offset_bits": 64 + }, + { + "name": "m", + "cType": "double", + "offset_bits": 128 + } + ] + }, + { + "name": "POINT4D", + "file": "postgis_ext_defs.in.h", + "fields": [ + { + "name": "x", + "cType": "double", + "offset_bits": 0 + }, + { + "name": "y", + "cType": "double", + "offset_bits": 64 + }, + { + "name": "z", + "cType": "double", + "offset_bits": 128 + }, + { + "name": "m", + "cType": "double", + "offset_bits": 192 + } + ] + }, + { + "name": "POINTARRAY", + "file": "postgis_ext_defs.in.h", + "fields": [ + { + "name": "npoints", + "cType": "uint32_t", + "offset_bits": 0 + }, + { + "name": "maxpoints", + "cType": "uint32_t", + "offset_bits": 32 + }, + { + "name": "flags", + "cType": "lwflags_t", + "offset_bits": 64 + }, + { + "name": "serialized_pointlist", + "cType": "uint8_t *", + "offset_bits": 128 + } + ] + }, + { + "name": "GSERIALIZED", + "file": "postgis_ext_defs.in.h", + "fields": [ + { + "name": "size", + "cType": "uint32_t", + "offset_bits": 0 + }, + { + "name": "srid", + "cType": "uint8_t[3]", + "offset_bits": 32 + }, + { + "name": "gflags", + "cType": "uint8_t", + "offset_bits": 56 + }, + { + "name": "data", + "cType": "uint8_t[1]", + "offset_bits": 64 + } + ] + }, + { + "name": "LWGEOM", + "file": "postgis_ext_defs.in.h", + "fields": [ + { + "name": "bbox", + "cType": "GBOX *", + "offset_bits": 0 + }, + { + "name": "data", + "cType": "void *", + "offset_bits": 64 + }, + { + "name": "srid", + "cType": "int32_t", + "offset_bits": 128 + }, + { + "name": "flags", + "cType": "lwflags_t", + "offset_bits": 160 + }, + { + "name": "type", + "cType": "uint8_t", + "offset_bits": 176 + }, + { + "name": "pad", + "cType": "char[1]", + "offset_bits": 184 + } + ] + }, + { + "name": "LWPOINT", + "file": "postgis_ext_defs.in.h", + "fields": [ + { + "name": "bbox", + "cType": "GBOX *", + "offset_bits": 0 + }, + { + "name": "point", + "cType": "POINTARRAY *", + "offset_bits": 64 + }, + { + "name": "srid", + "cType": "int32_t", + "offset_bits": 128 + }, + { + "name": "flags", + "cType": "lwflags_t", + "offset_bits": 160 + }, + { + "name": "type", + "cType": "uint8_t", + "offset_bits": 176 + }, + { + "name": "pad", + "cType": "char[1]", + "offset_bits": 184 + } + ] + }, + { + "name": "LWLINE", + "file": "postgis_ext_defs.in.h", + "fields": [ + { + "name": "bbox", + "cType": "GBOX *", + "offset_bits": 0 + }, + { + "name": "points", + "cType": "POINTARRAY *", + "offset_bits": 64 + }, + { + "name": "srid", + "cType": "int32_t", + "offset_bits": 128 + }, + { + "name": "flags", + "cType": "lwflags_t", + "offset_bits": 160 + }, + { + "name": "type", + "cType": "uint8_t", + "offset_bits": 176 + }, + { + "name": "pad", + "cType": "char[1]", + "offset_bits": 184 + } + ] + }, + { + "name": "LWTRIANGLE", + "file": "postgis_ext_defs.in.h", + "fields": [ + { + "name": "bbox", + "cType": "GBOX *", + "offset_bits": 0 + }, + { + "name": "points", + "cType": "POINTARRAY *", + "offset_bits": 64 + }, + { + "name": "srid", + "cType": "int32_t", + "offset_bits": 128 + }, + { + "name": "flags", + "cType": "lwflags_t", + "offset_bits": 160 + }, + { + "name": "type", + "cType": "uint8_t", + "offset_bits": 176 + }, + { + "name": "pad", + "cType": "char[1]", + "offset_bits": 184 + } + ] + }, + { + "name": "LWCIRCSTRING", + "file": "postgis_ext_defs.in.h", + "fields": [ + { + "name": "bbox", + "cType": "GBOX *", + "offset_bits": 0 + }, + { + "name": "points", + "cType": "POINTARRAY *", + "offset_bits": 64 + }, + { + "name": "srid", + "cType": "int32_t", + "offset_bits": 128 + }, + { + "name": "flags", + "cType": "lwflags_t", + "offset_bits": 160 + }, + { + "name": "type", + "cType": "uint8_t", + "offset_bits": 176 + }, + { + "name": "pad", + "cType": "char[1]", + "offset_bits": 184 + } + ] + }, + { + "name": "LWPOLY", + "file": "postgis_ext_defs.in.h", + "fields": [ + { + "name": "bbox", + "cType": "GBOX *", + "offset_bits": 0 + }, + { + "name": "rings", + "cType": "POINTARRAY **", + "offset_bits": 64 + }, + { + "name": "srid", + "cType": "int32_t", + "offset_bits": 128 + }, + { + "name": "flags", + "cType": "lwflags_t", + "offset_bits": 160 + }, + { + "name": "type", + "cType": "uint8_t", + "offset_bits": 176 + }, + { + "name": "pad", + "cType": "char[1]", + "offset_bits": 184 + }, + { + "name": "nrings", + "cType": "uint32_t", + "offset_bits": 192 + }, + { + "name": "maxrings", + "cType": "uint32_t", + "offset_bits": 224 + } + ] + }, + { + "name": "LWMPOINT", + "file": "postgis_ext_defs.in.h", + "fields": [ + { + "name": "bbox", + "cType": "GBOX *", + "offset_bits": 0 + }, + { + "name": "geoms", + "cType": "LWPOINT **", + "offset_bits": 64 + }, + { + "name": "srid", + "cType": "int32_t", + "offset_bits": 128 + }, + { + "name": "flags", + "cType": "lwflags_t", + "offset_bits": 160 + }, + { + "name": "type", + "cType": "uint8_t", + "offset_bits": 176 + }, + { + "name": "pad", + "cType": "char[1]", + "offset_bits": 184 + }, + { + "name": "ngeoms", + "cType": "uint32_t", + "offset_bits": 192 + }, + { + "name": "maxgeoms", + "cType": "uint32_t", + "offset_bits": 224 + } + ] + }, + { + "name": "LWMLINE", + "file": "postgis_ext_defs.in.h", + "fields": [ + { + "name": "bbox", + "cType": "GBOX *", + "offset_bits": 0 + }, + { + "name": "geoms", + "cType": "LWLINE **", + "offset_bits": 64 + }, + { + "name": "srid", + "cType": "int32_t", + "offset_bits": 128 + }, + { + "name": "flags", + "cType": "lwflags_t", + "offset_bits": 160 + }, + { + "name": "type", + "cType": "uint8_t", + "offset_bits": 176 + }, + { + "name": "pad", + "cType": "char[1]", + "offset_bits": 184 + }, + { + "name": "ngeoms", + "cType": "uint32_t", + "offset_bits": 192 + }, + { + "name": "maxgeoms", + "cType": "uint32_t", + "offset_bits": 224 + } + ] + }, + { + "name": "LWMPOLY", + "file": "postgis_ext_defs.in.h", + "fields": [ + { + "name": "bbox", + "cType": "GBOX *", + "offset_bits": 0 + }, + { + "name": "geoms", + "cType": "LWPOLY **", + "offset_bits": 64 + }, + { + "name": "srid", + "cType": "int32_t", + "offset_bits": 128 + }, + { + "name": "flags", + "cType": "lwflags_t", + "offset_bits": 160 + }, + { + "name": "type", + "cType": "uint8_t", + "offset_bits": 176 + }, + { + "name": "pad", + "cType": "char[1]", + "offset_bits": 184 + }, + { + "name": "ngeoms", + "cType": "uint32_t", + "offset_bits": 192 + }, + { + "name": "maxgeoms", + "cType": "uint32_t", + "offset_bits": 224 + } + ] + }, + { + "name": "LWCOLLECTION", + "file": "postgis_ext_defs.in.h", + "fields": [ + { + "name": "bbox", + "cType": "GBOX *", + "offset_bits": 0 + }, + { + "name": "geoms", + "cType": "LWGEOM **", + "offset_bits": 64 + }, + { + "name": "srid", + "cType": "int32_t", + "offset_bits": 128 + }, + { + "name": "flags", + "cType": "lwflags_t", + "offset_bits": 160 + }, + { + "name": "type", + "cType": "uint8_t", + "offset_bits": 176 + }, + { + "name": "pad", + "cType": "char[1]", + "offset_bits": 184 + }, + { + "name": "ngeoms", + "cType": "uint32_t", + "offset_bits": 192 + }, + { + "name": "maxgeoms", + "cType": "uint32_t", + "offset_bits": 224 + } + ] + }, + { + "name": "LWCOMPOUND", + "file": "postgis_ext_defs.in.h", + "fields": [ + { + "name": "bbox", + "cType": "GBOX *", + "offset_bits": 0 + }, + { + "name": "geoms", + "cType": "LWGEOM **", + "offset_bits": 64 + }, + { + "name": "srid", + "cType": "int32_t", + "offset_bits": 128 + }, + { + "name": "flags", + "cType": "lwflags_t", + "offset_bits": 160 + }, + { + "name": "type", + "cType": "uint8_t", + "offset_bits": 176 + }, + { + "name": "pad", + "cType": "char[1]", + "offset_bits": 184 + }, + { + "name": "ngeoms", + "cType": "uint32_t", + "offset_bits": 192 + }, + { + "name": "maxgeoms", + "cType": "uint32_t", + "offset_bits": 224 + } + ] + }, + { + "name": "LWCURVEPOLY", + "file": "postgis_ext_defs.in.h", + "fields": [ + { + "name": "bbox", + "cType": "GBOX *", + "offset_bits": 0 + }, + { + "name": "rings", + "cType": "LWGEOM **", + "offset_bits": 64 + }, + { + "name": "srid", + "cType": "int32_t", + "offset_bits": 128 + }, + { + "name": "flags", + "cType": "lwflags_t", + "offset_bits": 160 + }, + { + "name": "type", + "cType": "uint8_t", + "offset_bits": 176 + }, + { + "name": "pad", + "cType": "char[1]", + "offset_bits": 184 + }, + { + "name": "nrings", + "cType": "uint32_t", + "offset_bits": 192 + }, + { + "name": "maxrings", + "cType": "uint32_t", + "offset_bits": 224 + } + ] + }, + { + "name": "LWMCURVE", + "file": "postgis_ext_defs.in.h", + "fields": [ + { + "name": "bbox", + "cType": "GBOX *", + "offset_bits": 0 + }, + { + "name": "geoms", + "cType": "LWGEOM **", + "offset_bits": 64 + }, + { + "name": "srid", + "cType": "int32_t", + "offset_bits": 128 + }, + { + "name": "flags", + "cType": "lwflags_t", + "offset_bits": 160 + }, + { + "name": "type", + "cType": "uint8_t", + "offset_bits": 176 + }, + { + "name": "pad", + "cType": "char[1]", + "offset_bits": 184 + }, + { + "name": "ngeoms", + "cType": "uint32_t", + "offset_bits": 192 + }, + { + "name": "maxgeoms", + "cType": "uint32_t", + "offset_bits": 224 + } + ] + }, + { + "name": "LWMSURFACE", + "file": "postgis_ext_defs.in.h", + "fields": [ + { + "name": "bbox", + "cType": "GBOX *", + "offset_bits": 0 + }, + { + "name": "geoms", + "cType": "LWGEOM **", + "offset_bits": 64 + }, + { + "name": "srid", + "cType": "int32_t", + "offset_bits": 128 + }, + { + "name": "flags", + "cType": "lwflags_t", + "offset_bits": 160 + }, + { + "name": "type", + "cType": "uint8_t", + "offset_bits": 176 + }, + { + "name": "pad", + "cType": "char[1]", + "offset_bits": 184 + }, + { + "name": "ngeoms", + "cType": "uint32_t", + "offset_bits": 192 + }, + { + "name": "maxgeoms", + "cType": "uint32_t", + "offset_bits": 224 + } + ] + }, + { + "name": "LWPSURFACE", + "file": "postgis_ext_defs.in.h", + "fields": [ + { + "name": "bbox", + "cType": "GBOX *", + "offset_bits": 0 + }, + { + "name": "geoms", + "cType": "LWPOLY **", + "offset_bits": 64 + }, + { + "name": "srid", + "cType": "int32_t", + "offset_bits": 128 + }, + { + "name": "flags", + "cType": "lwflags_t", + "offset_bits": 160 + }, + { + "name": "type", + "cType": "uint8_t", + "offset_bits": 176 + }, + { + "name": "pad", + "cType": "char[1]", + "offset_bits": 184 + }, + { + "name": "ngeoms", + "cType": "uint32_t", + "offset_bits": 192 + }, + { + "name": "maxgeoms", + "cType": "uint32_t", + "offset_bits": 224 + } + ] + }, + { + "name": "LWTIN", + "file": "postgis_ext_defs.in.h", + "fields": [ + { + "name": "bbox", + "cType": "GBOX *", + "offset_bits": 0 + }, + { + "name": "geoms", + "cType": "LWTRIANGLE **", + "offset_bits": 64 + }, + { + "name": "srid", + "cType": "int32_t", + "offset_bits": 128 + }, + { + "name": "flags", + "cType": "lwflags_t", + "offset_bits": 160 + }, + { + "name": "type", + "cType": "uint8_t", + "offset_bits": 176 + }, + { + "name": "pad", + "cType": "char[1]", + "offset_bits": 184 + }, + { + "name": "ngeoms", + "cType": "uint32_t", + "offset_bits": 192 + }, + { + "name": "maxgeoms", + "cType": "uint32_t", + "offset_bits": 224 + } + ] + }, + { + "name": "PJconsts", + "file": "postgis_ext_defs.in.h", + "fields": [] + }, + { + "name": "LWPROJ", + "file": "postgis_ext_defs.in.h", + "fields": [ + { + "name": "pj", + "cType": "PJ *", + "offset_bits": 0 + }, + { + "name": "pipeline_is_forward", + "cType": "_Bool", + "offset_bits": 64 + }, + { + "name": "source_is_latlong", + "cType": "uint8_t", + "offset_bits": 72 + }, + { + "name": "source_semi_major_metre", + "cType": "double", + "offset_bits": 128 + }, + { + "name": "source_semi_minor_metre", + "cType": "double", + "offset_bits": 192 + } + ] + }, + { + "name": "Interval", + "file": "postgres_ext_defs.in.h", + "fields": [ + { + "name": "time", + "cType": "TimeOffset", + "offset_bits": 0 + }, + { + "name": "day", + "cType": "int32", + "offset_bits": 64 + }, + { + "name": "month", + "cType": "int32", + "offset_bits": 96 + } + ] + }, + { + "name": "varlena", + "file": "postgres_ext_defs.in.h", + "fields": [ + { + "name": "vl_len_", + "cType": "char[4]", + "offset_bits": 0 + }, + { + "name": "vl_dat", + "cType": "char[]", + "offset_bits": 32 + } + ] + }, + { + "name": "cfp_elem", + "file": "trgeo_distance.h", + "fields": [ + { + "name": "geom_1", + "cType": "LWGEOM *", + "offset_bits": 0 + }, + { + "name": "geom_2", + "cType": "LWGEOM *", + "offset_bits": 64 + }, + { + "name": "pose_1", + "cType": "Pose *", + "offset_bits": 128 + }, + { + "name": "pose_2", + "cType": "Pose *", + "offset_bits": 192 + }, + { + "name": "free_pose_1", + "cType": "_Bool", + "offset_bits": 256 + }, + { + "name": "free_pose_2", + "cType": "_Bool", + "offset_bits": 264 + }, + { + "name": "cf_1", + "cType": "uint32_t", + "offset_bits": 288 + }, + { + "name": "cf_2", + "cType": "uint32_t", + "offset_bits": 320 + }, + { + "name": "t", + "cType": "TimestampTz", + "offset_bits": 384 + }, + { + "name": "store", + "cType": "_Bool", + "offset_bits": 448 + } + ] + }, + { + "name": "cfp_array", + "file": "trgeo_distance.h", + "fields": [ + { + "name": "count", + "cType": "size_t", + "offset_bits": 0 + }, + { + "name": "size", + "cType": "size_t", + "offset_bits": 64 + }, + { + "name": "arr", + "cType": "cfp_elem *", + "offset_bits": 128 + } + ] + }, + { + "name": "tdist_elem", + "file": "trgeo_distance.h", + "fields": [ + { + "name": "dist", + "cType": "double", + "offset_bits": 0 + }, + { + "name": "t", + "cType": "TimestampTz", + "offset_bits": 64 + } + ] + }, + { + "name": "tdist_array", + "file": "trgeo_distance.h", + "fields": [ + { + "name": "count", + "cType": "size_t", + "offset_bits": 0 + }, + { + "name": "size", + "cType": "size_t", + "offset_bits": 64 + }, + { + "name": "arr", + "cType": "tdist_elem *", + "offset_bits": 128 + } + ] + }, + { + "name": "SpanBound", + "file": "span.h", + "fields": [ + { + "name": "val", + "cType": "Datum", + "offset_bits": -1 + }, + { + "name": "inclusive", + "cType": "_Bool", + "offset_bits": -1 + }, + { + "name": "lower", + "cType": "_Bool", + "offset_bits": -1 + }, + { + "name": "spantype", + "cType": "uint8", + "offset_bits": -1 + }, + { + "name": "basetype", + "cType": "uint8", + "offset_bits": -1 + } + ] + }, + { + "name": "LiftedFunctionInfo", + "file": "lifting.h", + "fields": [ + { + "name": "func", + "cType": "varfunc", + "offset_bits": -1 + }, + { + "name": "numparam", + "cType": "int", + "offset_bits": -1 + }, + { + "name": "param", + "cType": "int", + "offset_bits": -1 + }, + { + "name": "argtype", + "cType": "MeosType[2]", + "offset_bits": -1 + }, + { + "name": "restype", + "cType": "MeosType", + "offset_bits": -1 + }, + { + "name": "reserror", + "cType": "Datum", + "offset_bits": -1 + }, + { + "name": "resnull", + "cType": "int", + "offset_bits": -1 + }, + { + "name": "reslinear", + "cType": "_Bool", + "offset_bits": -1 + }, + { + "name": "invert", + "cType": "_Bool", + "offset_bits": -1 + }, + { + "name": "discont", + "cType": "_Bool", + "offset_bits": -1 + }, + { + "name": "ever", + "cType": "_Bool", + "offset_bits": -1 + }, + { + "name": "tpfn_unary", + "cType": "tpfunc_unary", + "offset_bits": -1 + }, + { + "name": "tpfn_adaptive", + "cType": "_Bool", + "offset_bits": -1 + }, + { + "name": "cross_type", + "cType": "_Bool", + "offset_bits": -1 + }, + { + "name": "tpfn_base", + "cType": "tpfunc_base", + "offset_bits": -1 + }, + { + "name": "tpfn_temp", + "cType": "tpfunc_temp", + "offset_bits": -1 + } + ] + }, + { + "name": "SetUnnestState", + "file": "set.h", + "fields": [ + { + "name": "done", + "cType": "_Bool", + "offset_bits": 0 + }, + { + "name": "i", + "cType": "int", + "offset_bits": 32 + }, + { + "name": "count", + "cType": "int", + "offset_bits": 64 + }, + { + "name": "set", + "cType": "Set *", + "offset_bits": 128 + }, + { + "name": "values", + "cType": "Datum *", + "offset_bits": 192 + } + ] + }, + { + "name": "SpanNode", + "file": "span_index.h", + "fields": [ + { + "name": "left", + "cType": "Span", + "offset_bits": -1 + }, + { + "name": "right", + "cType": "Span", + "offset_bits": -1 + } + ] + }, + { + "name": "SortedSpan", + "file": "span_index.h", + "fields": [ + { + "name": "s", + "cType": "Span", + "offset_bits": -1 + }, + { + "name": "i", + "cType": "int", + "offset_bits": -1 + } + ] + }, + { + "name": "TboxNode", + "file": "tbox_index.h", + "fields": [ + { + "name": "left", + "cType": "TBox", + "offset_bits": -1 + }, + { + "name": "right", + "cType": "TBox", + "offset_bits": -1 + } + ] + }, + { + "name": "SortedTbox", + "file": "tbox_index.h", + "fields": [ + { + "name": "box", + "cType": "TBox", + "offset_bits": -1 + }, + { + "name": "i", + "cType": "int", + "offset_bits": -1 + } + ] + }, + { + "name": "DggsCellOps", + "file": "tcellindex.h", + "fields": [ + { + "name": "celltype", + "cType": "MeosType", + "offset_bits": -1 + }, + { + "name": "settype", + "cType": "MeosType", + "offset_bits": -1 + }, + { + "name": "temptype", + "cType": "MeosType", + "offset_bits": -1 + }, + { + "name": "min_resolution", + "cType": "int32", + "offset_bits": -1 + }, + { + "name": "max_resolution", + "cType": "int32", + "offset_bits": -1 + }, + { + "name": "point_temptype", + "cType": "MeosType", + "offset_bits": -1 + }, + { + "name": "point_srid", + "cType": "int32", + "offset_bits": -1 + }, + { + "name": "get_resolution", + "cType": "int (*)(Datum *)", + "offset_bits": -1 + }, + { + "name": "is_valid_cell", + "cType": "int (*)(Datum *)", + "offset_bits": -1 + }, + { + "name": "cell_to_parent", + "cType": "int (*)(Datum *, Datum *)", + "offset_bits": -1 + }, + { + "name": "cell_to_point", + "cType": "int (*)(Datum *)", + "offset_bits": -1 + }, + { + "name": "cell_to_boundary", + "cType": "int (*)(Datum *)", + "offset_bits": -1 + }, + { + "name": "cell_area", + "cType": "int (*)(Datum *)", + "offset_bits": -1 + } + ] + }, + { + "name": "SimilarityPathState", + "file": "temporal_analytics.h", + "fields": [ + { + "name": "done", + "cType": "_Bool", + "offset_bits": 0 + }, + { + "name": "i", + "cType": "int", + "offset_bits": 32 + }, + { + "name": "size", + "cType": "int", + "offset_bits": 64 + }, + { + "name": "path", + "cType": "Match *", + "offset_bits": 128 + } + ] + }, + { + "name": "RTreeNode", + "file": "temporal_rtree.h", + "fields": [ + { + "name": "bboxsize", + "cType": "size_t", + "offset_bits": 0 + }, + { + "name": "count", + "cType": "int", + "offset_bits": 64 + }, + { + "name": "node_type", + "cType": "RTreeNodeType", + "offset_bits": 96 + }, + { + "name": "boxes", + "cType": "char[]", + "offset_bits": 4224 + } + ] + }, + { + "name": "SpanBinState", + "file": "temporal_tile.h", + "fields": [ + { + "name": "done", + "cType": "_Bool", + "offset_bits": -1 + }, + { + "name": "basetype", + "cType": "uint8", + "offset_bits": -1 + }, + { + "name": "i", + "cType": "int", + "offset_bits": -1 + }, + { + "name": "size", + "cType": "Datum", + "offset_bits": -1 + }, + { + "name": "origin", + "cType": "Datum", + "offset_bits": -1 + }, + { + "name": "span", + "cType": "Span", + "offset_bits": -1 + }, + { + "name": "to_split", + "cType": "const void *", + "offset_bits": -1 + }, + { + "name": "value", + "cType": "Datum", + "offset_bits": -1 + }, + { + "name": "nbins", + "cType": "int", + "offset_bits": -1 + } + ] + }, + { + "name": "TboxGridState", + "file": "temporal_tile.h", + "fields": [ + { + "name": "done", + "cType": "_Bool", + "offset_bits": -1 + }, + { + "name": "i", + "cType": "int", + "offset_bits": -1 + }, + { + "name": "vsize", + "cType": "Datum", + "offset_bits": -1 + }, + { + "name": "tunits", + "cType": "int64", + "offset_bits": -1 + }, + { + "name": "box", + "cType": "TBox", + "offset_bits": -1 + }, + { + "name": "temp", + "cType": "const Temporal *", + "offset_bits": -1 + }, + { + "name": "value", + "cType": "Datum", + "offset_bits": -1 + }, + { + "name": "t", + "cType": "TimestampTz", + "offset_bits": -1 + }, + { + "name": "ntiles", + "cType": "int", + "offset_bits": -1 + }, + { + "name": "max_coords", + "cType": "int[2]", + "offset_bits": -1 + }, + { + "name": "coords", + "cType": "int[2]", + "offset_bits": -1 + } + ] + } + ], + "enums": [ + { + "name": "errorCode", + "file": "meos_error.h", + "values": [ + { + "name": "MEOS_SUCCESS", + "value": 0 + }, + { + "name": "MEOS_ERR_INTERNAL_ERROR", + "value": 1 + }, + { + "name": "MEOS_ERR_INTERNAL_TYPE_ERROR", + "value": 2 + }, + { + "name": "MEOS_ERR_VALUE_OUT_OF_RANGE", + "value": 3 + }, + { + "name": "MEOS_ERR_DIVISION_BY_ZERO", + "value": 4 + }, + { + "name": "MEOS_ERR_MEMORY_ALLOC_ERROR", + "value": 5 + }, + { + "name": "MEOS_ERR_AGGREGATION_ERROR", + "value": 6 + }, + { + "name": "MEOS_ERR_DIRECTORY_ERROR", + "value": 7 + }, + { + "name": "MEOS_ERR_FILE_ERROR", + "value": 8 + }, + { + "name": "MEOS_ERR_OUT_OF_MEMORY", + "value": 9 + }, + { + "name": "MEOS_ERR_INVALID_ARG", + "value": 10 + }, + { + "name": "MEOS_ERR_INVALID_ARG_TYPE", + "value": 11 + }, + { + "name": "MEOS_ERR_INVALID_ARG_VALUE", + "value": 12 + }, + { + "name": "MEOS_ERR_FEATURE_NOT_SUPPORTED", + "value": 13 + }, + { + "name": "MEOS_ERR_INDETERMINATE_COLLATION", + "value": 14 + }, + { + "name": "MEOS_ERR_SYNTAX_ERROR", + "value": 15 + }, + { + "name": "MEOS_ERR_NULL_RESULT", + "value": 16 + }, + { + "name": "MEOS_ERR_MFJSON_INPUT", + "value": 20 + }, + { + "name": "MEOS_ERR_MFJSON_OUTPUT", + "value": 21 + }, + { + "name": "MEOS_ERR_TEXT_INPUT", + "value": 22 + }, + { + "name": "MEOS_ERR_TEXT_OUTPUT", + "value": 23 + }, + { + "name": "MEOS_ERR_WKB_INPUT", + "value": 24 + }, + { + "name": "MEOS_ERR_WKB_OUTPUT", + "value": 25 + }, + { + "name": "MEOS_ERR_GEOJSON_INPUT", + "value": 26 + }, + { + "name": "MEOS_ERR_GEOJSON_OUTPUT", + "value": 27 + }, + { + "name": "MEOS_ERR_SQL_JSON_ERROR", + "value": 28 + }, + { + "name": "MEOS_ERR_INVALID_REGULAR_EXPRESSION", + "value": 29 + } + ] + }, + { + "name": "tempSubtype", + "file": "meos.h", + "values": [ + { + "name": "ANYTEMPSUBTYPE", + "value": 0 + }, + { + "name": "TINSTANT", + "value": 1 + }, + { + "name": "TSEQUENCE", + "value": 2 + }, + { + "name": "TSEQUENCESET", + "value": 3 + } + ] + }, + { + "name": "interpType", + "file": "meos.h", + "values": [ + { + "name": "INTERP_NONE", + "value": 0 + }, + { + "name": "DISCRETE", + "value": 1 + }, + { + "name": "STEP", + "value": 2 + }, + { + "name": "LINEAR", + "value": 3 + } + ] + }, + { + "name": "RTreeSearchOp", + "file": "meos.h", + "values": [ + { + "name": "RTREE_OVERLAPS", + "value": 0 + }, + { + "name": "RTREE_CONTAINS", + "value": 1 + }, + { + "name": "RTREE_CONTAINED_BY", + "value": 2 + } + ] + }, + { + "name": "spatialRel", + "file": "meos_geo.h", + "values": [ + { + "name": "INTERSECTS", + "value": 0 + }, + { + "name": "CONTAINS", + "value": 1 + }, + { + "name": "TOUCHES", + "value": 2 + }, + { + "name": "COVERS", + "value": 3 + } + ] + }, + { + "name": "MeosType", + "file": "meos_catalog.h", + "values": [ + { + "name": "T_UNKNOWN", + "value": 0 + }, + { + "name": "T_BOOL", + "value": 1 + }, + { + "name": "T_DATE", + "value": 2 + }, + { + "name": "T_DATEMULTIRANGE", + "value": 3 + }, + { + "name": "T_DATERANGE", + "value": 4 + }, + { + "name": "T_DATESET", + "value": 5 + }, + { + "name": "T_DATESPAN", + "value": 6 + }, + { + "name": "T_DATESPANSET", + "value": 7 + }, + { + "name": "T_DOUBLE2", + "value": 8 + }, + { + "name": "T_DOUBLE3", + "value": 9 + }, + { + "name": "T_DOUBLE4", + "value": 10 + }, + { + "name": "T_FLOAT8", + "value": 11 + }, + { + "name": "T_FLOATSET", + "value": 12 + }, + { + "name": "T_FLOATSPAN", + "value": 13 + }, + { + "name": "T_FLOATSPANSET", + "value": 14 + }, + { + "name": "T_INT4", + "value": 15 + }, + { + "name": "T_INT4MULTIRANGE", + "value": 16 + }, + { + "name": "T_INT4RANGE", + "value": 17 + }, + { + "name": "T_INTSET", + "value": 18 + }, + { + "name": "T_INTSPAN", + "value": 19 + }, + { + "name": "T_INTSPANSET", + "value": 20 + }, + { + "name": "T_INT8", + "value": 21 + }, + { + "name": "T_INT8MULTIRANGE", + "value": 52 + }, + { + "name": "T_INT8RANGE", + "value": 53 + }, + { + "name": "T_BIGINTSET", + "value": 22 + }, + { + "name": "T_BIGINTSPAN", + "value": 23 + }, + { + "name": "T_BIGINTSPANSET", + "value": 24 + }, + { + "name": "T_STBOX", + "value": 25 + }, + { + "name": "T_TBOOL", + "value": 26 + }, + { + "name": "T_TBOX", + "value": 27 + }, + { + "name": "T_TDOUBLE2", + "value": 28 + }, + { + "name": "T_TDOUBLE3", + "value": 29 + }, + { + "name": "T_TDOUBLE4", + "value": 30 + }, + { + "name": "T_TEXT", + "value": 31 + }, + { + "name": "T_TEXTSET", + "value": 32 + }, + { + "name": "T_TFLOAT", + "value": 33 + }, + { + "name": "T_TIMESTAMPTZ", + "value": 34 + }, + { + "name": "T_TINT", + "value": 35 + }, + { + "name": "T_TSTZMULTIRANGE", + "value": 36 + }, + { + "name": "T_TSTZRANGE", + "value": 37 + }, + { + "name": "T_TSTZSET", + "value": 38 + }, + { + "name": "T_TSTZSPAN", + "value": 39 + }, + { + "name": "T_TSTZSPANSET", + "value": 40 + }, + { + "name": "T_TTEXT", + "value": 41 + }, + { + "name": "T_GEOMETRY", + "value": 42 + }, + { + "name": "T_GEOMSET", + "value": 43 + }, + { + "name": "T_GEOGRAPHY", + "value": 44 + }, + { + "name": "T_GEOGSET", + "value": 45 + }, + { + "name": "T_TGEOMPOINT", + "value": 46 + }, + { + "name": "T_TGEOGPOINT", + "value": 47 + }, + { + "name": "T_NPOINT", + "value": 48 + }, + { + "name": "T_NPOINTSET", + "value": 49 + }, + { + "name": "T_NSEGMENT", + "value": 50 + }, + { + "name": "T_TNPOINT", + "value": 51 + }, + { + "name": "T_POSE", + "value": 54 + }, + { + "name": "T_POSESET", + "value": 55 + }, + { + "name": "T_TPOSE", + "value": 56 + }, + { + "name": "T_CBUFFER", + "value": 57 + }, + { + "name": "T_CBUFFERSET", + "value": 58 + }, + { + "name": "T_TCBUFFER", + "value": 59 + }, + { + "name": "T_TGEOMETRY", + "value": 60 + }, + { + "name": "T_TGEOGRAPHY", + "value": 61 + }, + { + "name": "T_TRGEOMETRY", + "value": 62 + }, + { + "name": "T_TBIGINT", + "value": 63 + }, + { + "name": "T_H3INDEX", + "value": 64 + }, + { + "name": "T_H3INDEXSET", + "value": 65 + }, + { + "name": "T_TH3INDEX", + "value": 66 + }, + { + "name": "T_PCPOINT", + "value": 67 + }, + { + "name": "T_PCPOINTSET", + "value": 68 + }, + { + "name": "T_TPCPOINT", + "value": 69 + }, + { + "name": "T_PCPATCH", + "value": 70 + }, + { + "name": "T_PCPATCHSET", + "value": 71 + }, + { + "name": "T_TPCPATCH", + "value": 72 + }, + { + "name": "T_TPCBOX", + "value": 73 + }, + { + "name": "T_QUADBIN", + "value": 78 + }, + { + "name": "T_QUADBINSET", + "value": 79 + }, + { + "name": "T_TQUADBIN", + "value": 80 + }, + { + "name": "NUM_MEOS_TYPES", + "value": 81 + } + ] + }, + { + "name": "MeosOper", + "file": "meos_catalog.h", + "values": [ + { + "name": "UNKNOWN_OP", + "value": 0 + }, + { + "name": "EQ_OP", + "value": 1 + }, + { + "name": "NE_OP", + "value": 2 + }, + { + "name": "LT_OP", + "value": 3 + }, + { + "name": "LE_OP", + "value": 4 + }, + { + "name": "GT_OP", + "value": 5 + }, + { + "name": "GE_OP", + "value": 6 + }, + { + "name": "ADJACENT_OP", + "value": 7 + }, + { + "name": "UNION_OP", + "value": 8 + }, + { + "name": "MINUS_OP", + "value": 9 + }, + { + "name": "INTERSECT_OP", + "value": 10 + }, + { + "name": "OVERLAPS_OP", + "value": 11 + }, + { + "name": "CONTAINS_OP", + "value": 12 + }, + { + "name": "CONTAINED_OP", + "value": 13 + }, + { + "name": "SAME_OP", + "value": 14 + }, + { + "name": "LEFT_OP", + "value": 15 + }, + { + "name": "OVERLEFT_OP", + "value": 16 + }, + { + "name": "RIGHT_OP", + "value": 17 + }, + { + "name": "OVERRIGHT_OP", + "value": 18 + }, + { + "name": "BELOW_OP", + "value": 19 + }, + { + "name": "OVERBELOW_OP", + "value": 20 + }, + { + "name": "ABOVE_OP", + "value": 21 + }, + { + "name": "OVERABOVE_OP", + "value": 22 + }, + { + "name": "FRONT_OP", + "value": 23 + }, + { + "name": "OVERFRONT_OP", + "value": 24 + }, + { + "name": "BACK_OP", + "value": 25 + }, + { + "name": "OVERBACK_OP", + "value": 26 + }, + { + "name": "BEFORE_OP", + "value": 27 + }, + { + "name": "OVERBEFORE_OP", + "value": 28 + }, + { + "name": "AFTER_OP", + "value": 29 + }, + { + "name": "OVERAFTER_OP", + "value": 30 + }, + { + "name": "EVEREQ_OP", + "value": 31 + }, + { + "name": "EVERNE_OP", + "value": 32 + }, + { + "name": "EVERLT_OP", + "value": 33 + }, + { + "name": "EVERLE_OP", + "value": 34 + }, + { + "name": "EVERGT_OP", + "value": 35 + }, + { + "name": "EVERGE_OP", + "value": 36 + }, + { + "name": "ALWAYSEQ_OP", + "value": 37 + }, + { + "name": "ALWAYSNE_OP", + "value": 38 + }, + { + "name": "ALWAYSLT_OP", + "value": 39 + }, + { + "name": "ALWAYSLE_OP", + "value": 40 + }, + { + "name": "ALWAYSGT_OP", + "value": 41 + }, + { + "name": "ALWAYSGE_OP", + "value": 42 + } + ] + }, + { + "name": "SkipListType", + "file": "meos_internal.h", + "values": [ + { + "name": "SKIPLIST_TEMPORAL", + "value": 0 + }, + { + "name": "SKIPLIST_KEYVALUE", + "value": 1 + } + ] + }, + { + "name": "SyncMode", + "file": "temporal.h", + "values": [ + { + "name": "SYNCHRONIZE_NOCROSS", + "value": 0 + }, + { + "name": "SYNCHRONIZE_CROSS", + "value": 1 + } + ] + }, + { + "name": "TemporalFamily", + "file": "temporal.h", + "values": [ + { + "name": "TEMPORALTYPE", + "value": 0 + }, + { + "name": "TNUMBERTYPE", + "value": 1 + }, + { + "name": "TSPATIALTYPE", + "value": 2 + } + ] + }, + { + "name": "SetOper", + "file": "temporal.h", + "values": [ + { + "name": "UNION", + "value": 0 + }, + { + "name": "INTER", + "value": 1 + }, + { + "name": "MINUS", + "value": 2 + } + ] + }, + { + "name": "CompOper", + "file": "temporal.h", + "values": [ + { + "name": "EQ", + "value": 0 + }, + { + "name": "NE", + "value": 1 + }, + { + "name": "LT", + "value": 2 + }, + { + "name": "LE", + "value": 3 + }, + { + "name": "GT", + "value": 4 + }, + { + "name": "GE", + "value": 5 + } + ] + }, + { + "name": "MEOS_WKB_TSUBTYPE", + "file": "temporal.h", + "values": [ + { + "name": "MEOS_WKB_TINSTANT", + "value": 1 + }, + { + "name": "MEOS_WKB_TSEQUENCE", + "value": 2 + }, + { + "name": "MEOS_WKB_TSEQUENCESET", + "value": 3 + } + ] + }, + { + "name": "ClipOper", + "file": "geo_poly_clip.h", + "values": [ + { + "name": "CL_INTERSECTION", + "value": 0 + }, + { + "name": "CL_UNION", + "value": 1 + }, + { + "name": "CL_DIFFERENCE", + "value": 2 + }, + { + "name": "CL_XOR", + "value": 3 + } + ] + }, + { + "name": "H3Unit", + "file": "th3index_internal.h", + "values": [ + { + "name": "H3_UNIT_KM", + "value": 0 + }, + { + "name": "H3_UNIT_M", + "value": 1 + }, + { + "name": "H3_UNIT_RADS", + "value": 2 + }, + { + "name": "H3_UNIT_KM2", + "value": 3 + }, + { + "name": "H3_UNIT_M2", + "value": 4 + }, + { + "name": "H3_UNIT_RADS2", + "value": 5 + } + ] + }, + { + "name": "nullHandleType", + "file": "meos_json.h", + "values": [ + { + "name": "NULL_INVALID", + "value": 0 + }, + { + "name": "NULL_ERROR", + "value": 1 + }, + { + "name": "NULL_JSON_NULL", + "value": 2 + }, + { + "name": "NULL_DELETE", + "value": 3 + }, + { + "name": "NULL_RETURN", + "value": 4 + } + ] + }, + { + "name": "GeoPoseClass", + "file": "pose_geopose.h", + "values": [ + { + "name": "GEOPOSE_BASIC_QUATERNION", + "value": 0 + }, + { + "name": "GEOPOSE_BASIC_YPR", + "value": 1 + } + ] + }, + { + "name": "SimFunc", + "file": "temporal_analytics.h", + "values": [ + { + "name": "FRECHET", + "value": 0 + }, + { + "name": "DYNTIMEWARP", + "value": 1 + }, + { + "name": "HAUSDORFF", + "value": 2 + } + ] + }, + { + "name": "RTreeNodeType", + "file": "temporal_rtree.h", + "values": [ + { + "name": "RTREE_LEAF", + "value": 0 + }, + { + "name": "RTREE_INNER", + "value": 1 + } + ] + }, + { + "name": "TArithmetic", + "file": "tnumber_mathfuncs.h", + "values": [ + { + "name": "ADD", + "value": 0 + }, + { + "name": "SUB", + "value": 1 + }, + { + "name": "MUL", + "value": 2 + }, + { + "name": "DIV", + "value": 3 + }, + { + "name": "DIST", + "value": 4 + } + ] + } + ] +} \ No newline at end of file diff --git a/tools/codegen/meos-idl-master.json b/tools/codegen/meos-idl-master.json new file mode 100644 index 0000000000..35a383084a --- /dev/null +++ b/tools/codegen/meos-idl-master.json @@ -0,0 +1,97078 @@ +{ + "functions": [ + { + "name": "meos_error", + "file": "meos_error.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "errlevel", + "cType": "int", + "canonical": "int" + }, + { + "name": "errcode", + "cType": "int", + "canonical": "int" + }, + { + "name": "format", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "meos_errno", + "file": "meos_error.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [] + }, + { + "name": "meos_errno_set", + "file": "meos_error.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "err", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "meos_errno_restore", + "file": "meos_error.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "err", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "meos_errno_reset", + "file": "meos_error.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [] + }, + { + "name": "meos_array_create", + "file": "meos.h", + "returnType": { + "c": "MeosArray *", + "canonical": "struct MeosArray *" + }, + "params": [ + { + "name": "elem_size", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "meos_array_add", + "file": "meos.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "array", + "cType": "MeosArray *", + "canonical": "struct MeosArray *" + }, + { + "name": "value", + "cType": "void *", + "canonical": "void *" + } + ] + }, + { + "name": "meos_array_get", + "file": "meos.h", + "returnType": { + "c": "void *", + "canonical": "void *" + }, + "params": [ + { + "name": "array", + "cType": "const MeosArray *", + "canonical": "const struct MeosArray *" + }, + { + "name": "n", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "meos_array_count", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "array", + "cType": "const MeosArray *", + "canonical": "const struct MeosArray *" + } + ] + }, + { + "name": "meos_array_reset", + "file": "meos.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "array", + "cType": "MeosArray *", + "canonical": "struct MeosArray *" + } + ] + }, + { + "name": "meos_array_reset_free", + "file": "meos.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "array", + "cType": "MeosArray *", + "canonical": "struct MeosArray *" + } + ] + }, + { + "name": "meos_array_destroy", + "file": "meos.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "array", + "cType": "MeosArray *", + "canonical": "struct MeosArray *" + } + ] + }, + { + "name": "meos_array_destroy_free", + "file": "meos.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "array", + "cType": "MeosArray *", + "canonical": "struct MeosArray *" + } + ] + }, + { + "name": "rtree_create_intspan", + "file": "meos.h", + "returnType": { + "c": "RTree *", + "canonical": "struct RTree *" + }, + "params": [] + }, + { + "name": "rtree_create_bigintspan", + "file": "meos.h", + "returnType": { + "c": "RTree *", + "canonical": "struct RTree *" + }, + "params": [] + }, + { + "name": "rtree_create_floatspan", + "file": "meos.h", + "returnType": { + "c": "RTree *", + "canonical": "struct RTree *" + }, + "params": [] + }, + { + "name": "rtree_create_datespan", + "file": "meos.h", + "returnType": { + "c": "RTree *", + "canonical": "struct RTree *" + }, + "params": [] + }, + { + "name": "rtree_create_tstzspan", + "file": "meos.h", + "returnType": { + "c": "RTree *", + "canonical": "struct RTree *" + }, + "params": [] + }, + { + "name": "rtree_create_tbox", + "file": "meos.h", + "returnType": { + "c": "RTree *", + "canonical": "struct RTree *" + }, + "params": [] + }, + { + "name": "rtree_create_stbox", + "file": "meos.h", + "returnType": { + "c": "RTree *", + "canonical": "struct RTree *" + }, + "params": [] + }, + { + "name": "rtree_free", + "file": "meos.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "rtree", + "cType": "RTree *", + "canonical": "struct RTree *" + } + ] + }, + { + "name": "rtree_insert", + "file": "meos.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "rtree", + "cType": "RTree *", + "canonical": "struct RTree *" + }, + { + "name": "box", + "cType": "void *", + "canonical": "void *" + }, + { + "name": "id", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "rtree_insert_temporal", + "file": "meos.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "rtree", + "cType": "RTree *", + "canonical": "struct RTree *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "id", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "rtree_insert_temporal_split", + "file": "meos.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "rtree", + "cType": "RTree *", + "canonical": "struct RTree *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "id", + "cType": "int", + "canonical": "int" + }, + { + "name": "maxboxes", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "rtree_search", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "rtree", + "cType": "const RTree *", + "canonical": "const struct RTree *" + }, + { + "name": "op", + "cType": "RTreeSearchOp", + "canonical": "RTreeSearchOp" + }, + { + "name": "query", + "cType": "const void *", + "canonical": "const void *" + }, + { + "name": "result", + "cType": "MeosArray *", + "canonical": "struct MeosArray *" + } + ] + }, + { + "name": "rtree_search_temporal", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "rtree", + "cType": "const RTree *", + "canonical": "const struct RTree *" + }, + { + "name": "op", + "cType": "RTreeSearchOp", + "canonical": "RTreeSearchOp" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "result", + "cType": "MeosArray *", + "canonical": "struct MeosArray *" + } + ] + }, + { + "name": "rtree_search_temporal_dedup", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "rtree", + "cType": "const RTree *", + "canonical": "const struct RTree *" + }, + { + "name": "op", + "cType": "RTreeSearchOp", + "canonical": "RTreeSearchOp" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "maxboxes", + "cType": "int", + "canonical": "int" + }, + { + "name": "result", + "cType": "MeosArray *", + "canonical": "struct MeosArray *" + } + ] + }, + { + "name": "meos_initialize_error_handler", + "file": "meos.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "err_handler", + "cType": "error_handler_fn", + "canonical": "void (*)(int, int, const char *)" + } + ] + }, + { + "name": "meos_initialize_allocator", + "file": "meos.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "malloc_fn", + "cType": "meos_malloc_fn", + "canonical": "void *(*)(unsigned long)" + }, + { + "name": "realloc_fn", + "cType": "meos_realloc_fn", + "canonical": "void *(*)(void *, unsigned long)" + }, + { + "name": "free_fn", + "cType": "meos_free_fn", + "canonical": "void (*)(void *)" + } + ] + }, + { + "name": "meos_initialize_noexit_error_handler", + "file": "meos.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [] + }, + { + "name": "meos_initialize_timezone", + "file": "meos.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "name", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "meos_initialize_collation", + "file": "meos.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [] + }, + { + "name": "meos_finalize_timezone", + "file": "meos.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [] + }, + { + "name": "meos_finalize_collation", + "file": "meos.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [] + }, + { + "name": "meos_finalize_projsrs", + "file": "meos.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [] + }, + { + "name": "meos_finalize_ways", + "file": "meos.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [] + }, + { + "name": "meos_set_datestyle", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "newval", + "cType": "const char *", + "canonical": "const char *" + }, + { + "name": "extra", + "cType": "void *", + "canonical": "void *" + } + ] + }, + { + "name": "meos_set_intervalstyle", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "newval", + "cType": "const char *", + "canonical": "const char *" + }, + { + "name": "extra", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "meos_get_datestyle", + "file": "meos.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [] + }, + { + "name": "meos_get_intervalstyle", + "file": "meos.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [] + }, + { + "name": "meos_set_spatial_ref_sys_csv", + "file": "meos.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "path", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "meos_set_ways_csv", + "file": "meos.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "path", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "meos_initialize", + "file": "meos.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [] + }, + { + "name": "meos_finalize", + "file": "meos.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [] + }, + { + "name": "bigintset_in", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "bigintset_out", + "file": "meos.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "set", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "bigintspan_expand", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "value", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "bigintspan_in", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "bigintspan_out", + "file": "meos.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "bigintspanset_in", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "bigintspanset_out", + "file": "meos.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "dateset_in", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "dateset_out", + "file": "meos.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "datespan_in", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "datespan_out", + "file": "meos.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "datespanset_in", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "datespanset_out", + "file": "meos.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "floatset_in", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "floatset_out", + "file": "meos.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "set", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "floatspan_expand", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "value", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "floatspan_in", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "floatspan_out", + "file": "meos.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "floatspanset_in", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "floatspanset_out", + "file": "meos.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "intset_in", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "intset_out", + "file": "meos.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "set", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "intspan_expand", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "value", + "cType": "int32", + "canonical": "int" + } + ] + }, + { + "name": "intspan_in", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "intspan_out", + "file": "meos.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "intspanset_in", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "intspanset_out", + "file": "meos.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "set_as_hexwkb", + "file": "meos.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "variant", + "cType": "uint8_t", + "canonical": "unsigned char" + }, + { + "name": "size_out", + "cType": "size_t *", + "canonical": "unsigned long *" + } + ] + }, + { + "name": "set_as_wkb", + "file": "meos.h", + "returnType": { + "c": "uint8_t *", + "canonical": "unsigned char *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "variant", + "cType": "uint8_t", + "canonical": "unsigned char" + }, + { + "name": "size_out", + "cType": "size_t *", + "canonical": "unsigned long *" + } + ] + }, + { + "name": "set_from_hexwkb", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "hexwkb", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "set_from_wkb", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "wkb", + "cType": "const uint8_t *", + "canonical": "const unsigned char *" + }, + { + "name": "size", + "cType": "size_t", + "canonical": "unsigned long" + } + ] + }, + { + "name": "span_as_hexwkb", + "file": "meos.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "variant", + "cType": "uint8_t", + "canonical": "unsigned char" + }, + { + "name": "size_out", + "cType": "size_t *", + "canonical": "unsigned long *" + } + ] + }, + { + "name": "span_as_wkb", + "file": "meos.h", + "returnType": { + "c": "uint8_t *", + "canonical": "unsigned char *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "variant", + "cType": "uint8_t", + "canonical": "unsigned char" + }, + { + "name": "size_out", + "cType": "size_t *", + "canonical": "unsigned long *" + } + ] + }, + { + "name": "span_from_hexwkb", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "hexwkb", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "span_from_wkb", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "wkb", + "cType": "const uint8_t *", + "canonical": "const unsigned char *" + }, + { + "name": "size", + "cType": "size_t", + "canonical": "unsigned long" + } + ] + }, + { + "name": "spanset_as_hexwkb", + "file": "meos.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "variant", + "cType": "uint8_t", + "canonical": "unsigned char" + }, + { + "name": "size_out", + "cType": "size_t *", + "canonical": "unsigned long *" + } + ] + }, + { + "name": "spanset_as_wkb", + "file": "meos.h", + "returnType": { + "c": "uint8_t *", + "canonical": "unsigned char *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "variant", + "cType": "uint8_t", + "canonical": "unsigned char" + }, + { + "name": "size_out", + "cType": "size_t *", + "canonical": "unsigned long *" + } + ] + }, + { + "name": "spanset_from_hexwkb", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "hexwkb", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "spanset_from_wkb", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "wkb", + "cType": "const uint8_t *", + "canonical": "const unsigned char *" + }, + { + "name": "size", + "cType": "size_t", + "canonical": "unsigned long" + } + ] + }, + { + "name": "textset_in", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "textset_out", + "file": "meos.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "set", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "tstzset_in", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "tstzset_out", + "file": "meos.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "set", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "tstzspan_in", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "tstzspan_out", + "file": "meos.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "tstzspanset_in", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "tstzspanset_out", + "file": "meos.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "bigintset_make", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "values", + "cType": "const int64 *", + "canonical": "const long *" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "bigintspan_make", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "lower", + "cType": "int64", + "canonical": "long" + }, + { + "name": "upper", + "cType": "int64", + "canonical": "long" + }, + { + "name": "lower_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "upper_inc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "dateset_make", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "values", + "cType": "const DateADT *", + "canonical": "const int *" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "datespan_make", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "lower", + "cType": "DateADT", + "canonical": "int" + }, + { + "name": "upper", + "cType": "DateADT", + "canonical": "int" + }, + { + "name": "lower_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "upper_inc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "floatset_make", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "values", + "cType": "const double *", + "canonical": "const double *" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "floatspan_make", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "lower", + "cType": "double", + "canonical": "double" + }, + { + "name": "upper", + "cType": "double", + "canonical": "double" + }, + { + "name": "lower_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "upper_inc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "intset_make", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "values", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "intspan_make", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "lower", + "cType": "int", + "canonical": "int" + }, + { + "name": "upper", + "cType": "int", + "canonical": "int" + }, + { + "name": "lower_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "upper_inc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "set_copy", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "span_copy", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "spanset_copy", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "spanset_make", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "spans", + "cType": "Span *", + "canonical": "Span *" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "textset_make", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "values", + "cType": "text **", + "canonical": "struct varlena **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "tstzset_make", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "values", + "cType": "const TimestampTz *", + "canonical": "const long *" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "tstzspan_make", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "lower", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "upper", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "lower_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "upper_inc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "bigint_to_set", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "i", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "bigint_to_span", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "bigint_to_spanset", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "date_to_set", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + } + ] + }, + { + "name": "date_to_span", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + } + ] + }, + { + "name": "date_to_spanset", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + } + ] + }, + { + "name": "dateset_to_tstzset", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "datespan_to_tstzspan", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "datespanset_to_tstzspanset", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "float_to_set", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "float_to_span", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "float_to_spanset", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "floatset_to_intset", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "floatspan_to_intspan", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "floatspan_to_bigintspan", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "floatspanset_to_intspanset", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "int_to_set", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "int_to_span", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "int_to_spanset", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "intset_to_floatset", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "intspan_to_floatspan", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "intspan_to_bigintspan", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "bigintspan_to_intspan", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "bigintspan_to_floatspan", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "intspanset_to_floatspanset", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "set_to_span", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "set_to_spanset", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "span_to_spanset", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "text_to_set", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "txt", + "cType": "const text *", + "canonical": "const struct varlena *" + } + ] + }, + { + "name": "timestamptz_to_set", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "timestamptz_to_span", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "timestamptz_to_spanset", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "tstzset_to_dateset", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "tstzspan_to_datespan", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "tstzspanset_to_datespanset", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "bigintset_end_value", + "file": "meos.h", + "returnType": { + "c": "int64", + "canonical": "long" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "bigintset_start_value", + "file": "meos.h", + "returnType": { + "c": "int64", + "canonical": "long" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "bigintset_value_n", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "n", + "cType": "int", + "canonical": "int" + }, + { + "name": "result", + "cType": "int64 *", + "canonical": "long *" + } + ] + }, + { + "name": "bigintset_values", + "file": "meos.h", + "returnType": { + "c": "int64 *", + "canonical": "long *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "bigintspan_lower", + "file": "meos.h", + "returnType": { + "c": "int64", + "canonical": "long" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "bigintspan_upper", + "file": "meos.h", + "returnType": { + "c": "int64", + "canonical": "long" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "bigintspan_width", + "file": "meos.h", + "returnType": { + "c": "int64", + "canonical": "long" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "bigintspanset_lower", + "file": "meos.h", + "returnType": { + "c": "int64", + "canonical": "long" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "bigintspanset_upper", + "file": "meos.h", + "returnType": { + "c": "int64", + "canonical": "long" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "bigintspanset_width", + "file": "meos.h", + "returnType": { + "c": "int64", + "canonical": "long" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "boundspan", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "dateset_end_value", + "file": "meos.h", + "returnType": { + "c": "DateADT", + "canonical": "int" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "dateset_start_value", + "file": "meos.h", + "returnType": { + "c": "DateADT", + "canonical": "int" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "dateset_value_n", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "n", + "cType": "int", + "canonical": "int" + }, + { + "name": "result", + "cType": "DateADT *", + "canonical": "int *" + } + ] + }, + { + "name": "dateset_values", + "file": "meos.h", + "returnType": { + "c": "DateADT *", + "canonical": "int *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "datespan_duration", + "file": "meos.h", + "returnType": { + "c": "Interval *", + "canonical": "Interval *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "datespan_lower", + "file": "meos.h", + "returnType": { + "c": "DateADT", + "canonical": "int" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "datespan_upper", + "file": "meos.h", + "returnType": { + "c": "DateADT", + "canonical": "int" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "datespanset_date_n", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "n", + "cType": "int", + "canonical": "int" + }, + { + "name": "result", + "cType": "DateADT *", + "canonical": "int *" + } + ] + }, + { + "name": "datespanset_dates", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "datespanset_duration", + "file": "meos.h", + "returnType": { + "c": "Interval *", + "canonical": "Interval *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "boundspan", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "datespanset_end_date", + "file": "meos.h", + "returnType": { + "c": "DateADT", + "canonical": "int" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "datespanset_num_dates", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "datespanset_start_date", + "file": "meos.h", + "returnType": { + "c": "DateADT", + "canonical": "int" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "floatset_end_value", + "file": "meos.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "floatset_start_value", + "file": "meos.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "floatset_value_n", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "n", + "cType": "int", + "canonical": "int" + }, + { + "name": "result", + "cType": "double *", + "canonical": "double *" + } + ] + }, + { + "name": "floatset_values", + "file": "meos.h", + "returnType": { + "c": "double *", + "canonical": "double *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "floatspan_lower", + "file": "meos.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "floatspan_upper", + "file": "meos.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "floatspan_width", + "file": "meos.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "floatspanset_lower", + "file": "meos.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "floatspanset_upper", + "file": "meos.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "floatspanset_width", + "file": "meos.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "boundspan", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "intset_end_value", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "intset_start_value", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "intset_value_n", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "n", + "cType": "int", + "canonical": "int" + }, + { + "name": "result", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "intset_values", + "file": "meos.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "intspan_lower", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "intspan_upper", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "intspan_width", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "intspanset_lower", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "intspanset_upper", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "intspanset_width", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "boundspan", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "set_hash", + "file": "meos.h", + "returnType": { + "c": "uint32", + "canonical": "unsigned int" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "set_hash_extended", + "file": "meos.h", + "returnType": { + "c": "uint64", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "seed", + "cType": "uint64", + "canonical": "unsigned long" + } + ] + }, + { + "name": "set_num_values", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "span_hash", + "file": "meos.h", + "returnType": { + "c": "uint32", + "canonical": "unsigned int" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "span_hash_extended", + "file": "meos.h", + "returnType": { + "c": "uint64", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "seed", + "cType": "uint64", + "canonical": "unsigned long" + } + ] + }, + { + "name": "span_lower_inc", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "span_upper_inc", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "spanset_end_span", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "spanset_hash", + "file": "meos.h", + "returnType": { + "c": "uint32", + "canonical": "unsigned int" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "spanset_hash_extended", + "file": "meos.h", + "returnType": { + "c": "uint64", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "seed", + "cType": "uint64", + "canonical": "unsigned long" + } + ] + }, + { + "name": "spanset_lower_inc", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "spanset_num_spans", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "spanset_span", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "spanset_span_n", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "spanset_spanarr", + "file": "meos.h", + "returnType": { + "c": "Span **", + "canonical": "Span **" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "spanset_start_span", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "spanset_upper_inc", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "textset_end_value", + "file": "meos.h", + "returnType": { + "c": "text *", + "canonical": "struct varlena *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "textset_start_value", + "file": "meos.h", + "returnType": { + "c": "text *", + "canonical": "struct varlena *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "textset_value_n", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "n", + "cType": "int", + "canonical": "int" + }, + { + "name": "result", + "cType": "text **", + "canonical": "struct varlena **" + } + ] + }, + { + "name": "textset_values", + "file": "meos.h", + "returnType": { + "c": "text **", + "canonical": "struct varlena **" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tstzset_end_value", + "file": "meos.h", + "returnType": { + "c": "TimestampTz", + "canonical": "long" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "tstzset_start_value", + "file": "meos.h", + "returnType": { + "c": "TimestampTz", + "canonical": "long" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "tstzset_value_n", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "n", + "cType": "int", + "canonical": "int" + }, + { + "name": "result", + "cType": "TimestampTz *", + "canonical": "long *" + } + ] + }, + { + "name": "tstzset_values", + "file": "meos.h", + "returnType": { + "c": "TimestampTz *", + "canonical": "long *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tstzspan_duration", + "file": "meos.h", + "returnType": { + "c": "Interval *", + "canonical": "Interval *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "tstzspan_lower", + "file": "meos.h", + "returnType": { + "c": "TimestampTz", + "canonical": "long" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "tstzspan_upper", + "file": "meos.h", + "returnType": { + "c": "TimestampTz", + "canonical": "long" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "tstzspanset_duration", + "file": "meos.h", + "returnType": { + "c": "Interval *", + "canonical": "Interval *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "boundspan", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tstzspanset_end_timestamptz", + "file": "meos.h", + "returnType": { + "c": "TimestampTz", + "canonical": "long" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "tstzspanset_lower", + "file": "meos.h", + "returnType": { + "c": "TimestampTz", + "canonical": "long" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "tstzspanset_num_timestamps", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "tstzspanset_start_timestamptz", + "file": "meos.h", + "returnType": { + "c": "TimestampTz", + "canonical": "long" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "tstzspanset_timestamps", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "tstzspanset_timestamptz_n", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "n", + "cType": "int", + "canonical": "int" + }, + { + "name": "result", + "cType": "TimestampTz *", + "canonical": "long *" + } + ] + }, + { + "name": "tstzspanset_upper", + "file": "meos.h", + "returnType": { + "c": "TimestampTz", + "canonical": "long" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "bigintset_shift_scale", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "shift", + "cType": "int64", + "canonical": "long" + }, + { + "name": "width", + "cType": "int64", + "canonical": "long" + }, + { + "name": "hasshift", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "haswidth", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "bigintspan_shift_scale", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "shift", + "cType": "int64", + "canonical": "long" + }, + { + "name": "width", + "cType": "int64", + "canonical": "long" + }, + { + "name": "hasshift", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "haswidth", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "bigintspanset_shift_scale", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "shift", + "cType": "int64", + "canonical": "long" + }, + { + "name": "width", + "cType": "int64", + "canonical": "long" + }, + { + "name": "hasshift", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "haswidth", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "dateset_shift_scale", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "shift", + "cType": "int", + "canonical": "int" + }, + { + "name": "width", + "cType": "int", + "canonical": "int" + }, + { + "name": "hasshift", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "haswidth", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "datespan_shift_scale", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "shift", + "cType": "int", + "canonical": "int" + }, + { + "name": "width", + "cType": "int", + "canonical": "int" + }, + { + "name": "hasshift", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "haswidth", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "datespanset_shift_scale", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "shift", + "cType": "int", + "canonical": "int" + }, + { + "name": "width", + "cType": "int", + "canonical": "int" + }, + { + "name": "hasshift", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "haswidth", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "floatset_ceil", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "floatset_degrees", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "normalize", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "floatset_floor", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "floatset_radians", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "floatset_shift_scale", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "shift", + "cType": "double", + "canonical": "double" + }, + { + "name": "width", + "cType": "double", + "canonical": "double" + }, + { + "name": "hasshift", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "haswidth", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "floatspan_ceil", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "floatspan_degrees", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "normalize", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "floatspan_floor", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "floatspan_radians", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "floatspan_round", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "floatspan_shift_scale", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "shift", + "cType": "double", + "canonical": "double" + }, + { + "name": "width", + "cType": "double", + "canonical": "double" + }, + { + "name": "hasshift", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "haswidth", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "floatspanset_ceil", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "floatspanset_floor", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "floatspanset_degrees", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "normalize", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "floatspanset_radians", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "floatspanset_round", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "floatspanset_shift_scale", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "shift", + "cType": "double", + "canonical": "double" + }, + { + "name": "width", + "cType": "double", + "canonical": "double" + }, + { + "name": "hasshift", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "haswidth", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "intset_shift_scale", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "shift", + "cType": "int", + "canonical": "int" + }, + { + "name": "width", + "cType": "int", + "canonical": "int" + }, + { + "name": "hasshift", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "haswidth", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "intspan_shift_scale", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "shift", + "cType": "int", + "canonical": "int" + }, + { + "name": "width", + "cType": "int", + "canonical": "int" + }, + { + "name": "hasshift", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "haswidth", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "intspanset_shift_scale", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "shift", + "cType": "int", + "canonical": "int" + }, + { + "name": "width", + "cType": "int", + "canonical": "int" + }, + { + "name": "hasshift", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "haswidth", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tstzspan_expand", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "interv", + "cType": "const Interval *", + "canonical": "const Interval *" + } + ] + }, + { + "name": "set_round", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "textcat_text_textset", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "txt", + "cType": "const text *", + "canonical": "const struct varlena *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "textcat_textset_text", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "txt", + "cType": "const text *", + "canonical": "const struct varlena *" + } + ] + }, + { + "name": "textset_initcap", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "textset_lower", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "textset_upper", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "timestamptz_tprecision", + "file": "meos.h", + "returnType": { + "c": "TimestampTz", + "canonical": "long" + }, + "params": [ + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "duration", + "cType": "const Interval *", + "canonical": "const Interval *" + }, + { + "name": "torigin", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "tstzset_shift_scale", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "shift", + "cType": "const Interval *", + "canonical": "const Interval *" + }, + { + "name": "duration", + "cType": "const Interval *", + "canonical": "const Interval *" + } + ] + }, + { + "name": "tstzset_tprecision", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "duration", + "cType": "const Interval *", + "canonical": "const Interval *" + }, + { + "name": "torigin", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "tstzspan_shift_scale", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "shift", + "cType": "const Interval *", + "canonical": "const Interval *" + }, + { + "name": "duration", + "cType": "const Interval *", + "canonical": "const Interval *" + } + ] + }, + { + "name": "tstzspan_tprecision", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "duration", + "cType": "const Interval *", + "canonical": "const Interval *" + }, + { + "name": "torigin", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "tstzspanset_shift_scale", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "shift", + "cType": "const Interval *", + "canonical": "const Interval *" + }, + { + "name": "duration", + "cType": "const Interval *", + "canonical": "const Interval *" + } + ] + }, + { + "name": "tstzspanset_tprecision", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "duration", + "cType": "const Interval *", + "canonical": "const Interval *" + }, + { + "name": "torigin", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "set_cmp", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "s1", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "s2", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "set_eq", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s1", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "s2", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "set_ge", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s1", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "s2", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "set_gt", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s1", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "s2", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "set_le", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s1", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "s2", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "set_lt", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s1", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "s2", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "set_ne", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s1", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "s2", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "span_cmp", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "s1", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "s2", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "span_eq", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s1", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "s2", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "span_ge", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s1", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "s2", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "span_gt", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s1", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "s2", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "span_le", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s1", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "s2", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "span_lt", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s1", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "s2", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "span_ne", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s1", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "s2", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "spanset_cmp", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "ss1", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "ss2", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "spanset_eq", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss1", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "ss2", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "spanset_ge", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss1", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "ss2", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "spanset_gt", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss1", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "ss2", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "spanset_le", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss1", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "ss2", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "spanset_lt", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss1", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "ss2", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "spanset_ne", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss1", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "ss2", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "set_spans", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "set_split_each_n_spans", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "elems_per_span", + "cType": "int", + "canonical": "int" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "set_split_n_spans", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "span_count", + "cType": "int", + "canonical": "int" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "spanset_spans", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "spanset_split_each_n_spans", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "elems_per_span", + "cType": "int", + "canonical": "int" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "spanset_split_n_spans", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "span_count", + "cType": "int", + "canonical": "int" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "adjacent_span_bigint", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "i", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "adjacent_span_date", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + } + ] + }, + { + "name": "adjacent_span_float", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "adjacent_span_int", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "adjacent_span_span", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s1", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "s2", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "adjacent_span_spanset", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "adjacent_span_timestamptz", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "adjacent_spanset_bigint", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "i", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "adjacent_spanset_date", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + } + ] + }, + { + "name": "adjacent_spanset_float", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "adjacent_spanset_int", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "adjacent_spanset_timestamptz", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "adjacent_spanset_span", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "adjacent_spanset_spanset", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss1", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "ss2", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "contained_bigint_set", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "i", + "cType": "int64", + "canonical": "long" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "contained_bigint_span", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "i", + "cType": "int64", + "canonical": "long" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "contained_bigint_spanset", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "i", + "cType": "int64", + "canonical": "long" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "contained_date_set", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "contained_date_span", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "contained_date_spanset", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "contained_float_set", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "contained_float_span", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "contained_float_spanset", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "contained_int_set", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "contained_int_span", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "contained_int_spanset", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "contained_set_set", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s1", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "s2", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "contained_span_span", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s1", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "s2", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "contained_span_spanset", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "contained_spanset_span", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "contained_spanset_spanset", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss1", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "ss2", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "contained_text_set", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "txt", + "cType": "const text *", + "canonical": "const struct varlena *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "contained_timestamptz_set", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "contained_timestamptz_span", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "contained_timestamptz_spanset", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "contains_set_bigint", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "i", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "contains_set_date", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + } + ] + }, + { + "name": "contains_set_float", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "contains_set_int", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "contains_set_set", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s1", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "s2", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "contains_set_text", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "t", + "cType": "text *", + "canonical": "struct varlena *" + } + ] + }, + { + "name": "contains_set_timestamptz", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "contains_span_bigint", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "i", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "contains_span_date", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + } + ] + }, + { + "name": "contains_span_float", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "contains_span_int", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "contains_span_span", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s1", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "s2", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "contains_span_spanset", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "contains_span_timestamptz", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "contains_spanset_bigint", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "i", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "contains_spanset_date", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + } + ] + }, + { + "name": "contains_spanset_float", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "contains_spanset_int", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "contains_spanset_span", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "contains_spanset_spanset", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss1", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "ss2", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "contains_spanset_timestamptz", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "overlaps_set_set", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s1", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "s2", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "overlaps_span_span", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s1", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "s2", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "overlaps_span_spanset", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "overlaps_spanset_span", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "overlaps_spanset_spanset", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss1", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "ss2", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "after_date_set", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "after_date_span", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "after_date_spanset", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "after_set_date", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + } + ] + }, + { + "name": "after_set_timestamptz", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "after_span_date", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + } + ] + }, + { + "name": "after_span_timestamptz", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "after_spanset_date", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + } + ] + }, + { + "name": "after_spanset_timestamptz", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "after_timestamptz_set", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "after_timestamptz_span", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "after_timestamptz_spanset", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "before_date_set", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "before_date_span", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "before_date_spanset", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "before_set_date", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + } + ] + }, + { + "name": "before_set_timestamptz", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "before_span_date", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + } + ] + }, + { + "name": "before_span_timestamptz", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "before_spanset_date", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + } + ] + }, + { + "name": "before_spanset_timestamptz", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "before_timestamptz_set", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "before_timestamptz_span", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "before_timestamptz_spanset", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "left_bigint_set", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "i", + "cType": "int64", + "canonical": "long" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "left_bigint_span", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "i", + "cType": "int64", + "canonical": "long" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "left_bigint_spanset", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "i", + "cType": "int64", + "canonical": "long" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "left_float_set", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "left_float_span", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "left_float_spanset", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "left_int_set", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "left_int_span", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "left_int_spanset", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "left_set_bigint", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "i", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "left_set_float", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "left_set_int", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "left_set_set", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s1", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "s2", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "left_set_text", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "txt", + "cType": "text *", + "canonical": "struct varlena *" + } + ] + }, + { + "name": "left_span_bigint", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "i", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "left_span_float", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "left_span_int", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "left_span_span", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s1", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "s2", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "left_span_spanset", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "left_spanset_bigint", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "i", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "left_spanset_float", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "left_spanset_int", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "left_spanset_span", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "left_spanset_spanset", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss1", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "ss2", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "left_text_set", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "txt", + "cType": "const text *", + "canonical": "const struct varlena *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "overafter_date_set", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "overafter_date_span", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "overafter_date_spanset", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "overafter_set_date", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + } + ] + }, + { + "name": "overafter_set_timestamptz", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "overafter_span_date", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + } + ] + }, + { + "name": "overafter_span_timestamptz", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "overafter_spanset_date", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + } + ] + }, + { + "name": "overafter_spanset_timestamptz", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "overafter_timestamptz_set", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "overafter_timestamptz_span", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "overafter_timestamptz_spanset", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "overbefore_date_set", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "overbefore_date_span", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "overbefore_date_spanset", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "overbefore_set_date", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + } + ] + }, + { + "name": "overbefore_set_timestamptz", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "overbefore_span_date", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + } + ] + }, + { + "name": "overbefore_span_timestamptz", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "overbefore_spanset_date", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + } + ] + }, + { + "name": "overbefore_spanset_timestamptz", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "overbefore_timestamptz_set", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "overbefore_timestamptz_span", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "overbefore_timestamptz_spanset", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "overleft_bigint_set", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "i", + "cType": "int64", + "canonical": "long" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "overleft_bigint_span", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "i", + "cType": "int64", + "canonical": "long" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "overleft_bigint_spanset", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "i", + "cType": "int64", + "canonical": "long" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "overleft_float_set", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "overleft_float_span", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "overleft_float_spanset", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "overleft_int_set", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "overleft_int_span", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "overleft_int_spanset", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "overleft_set_bigint", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "i", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "overleft_set_float", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "overleft_set_int", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "overleft_set_set", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s1", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "s2", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "overleft_set_text", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "txt", + "cType": "text *", + "canonical": "struct varlena *" + } + ] + }, + { + "name": "overleft_span_bigint", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "i", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "overleft_span_float", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "overleft_span_int", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "overleft_span_span", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s1", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "s2", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "overleft_span_spanset", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "overleft_spanset_bigint", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "i", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "overleft_spanset_float", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "overleft_spanset_int", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "overleft_spanset_span", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "overleft_spanset_spanset", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss1", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "ss2", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "overleft_text_set", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "txt", + "cType": "const text *", + "canonical": "const struct varlena *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "overright_bigint_set", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "i", + "cType": "int64", + "canonical": "long" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "overright_bigint_span", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "i", + "cType": "int64", + "canonical": "long" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "overright_bigint_spanset", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "i", + "cType": "int64", + "canonical": "long" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "overright_float_set", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "overright_float_span", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "overright_float_spanset", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "overright_int_set", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "overright_int_span", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "overright_int_spanset", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "overright_set_bigint", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "i", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "overright_set_float", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "overright_set_int", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "overright_set_set", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s1", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "s2", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "overright_set_text", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "txt", + "cType": "text *", + "canonical": "struct varlena *" + } + ] + }, + { + "name": "overright_span_bigint", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "i", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "overright_span_float", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "overright_span_int", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "overright_span_span", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s1", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "s2", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "overright_span_spanset", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "overright_spanset_bigint", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "i", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "overright_spanset_float", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "overright_spanset_int", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "overright_spanset_span", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "overright_spanset_spanset", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss1", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "ss2", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "overright_text_set", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "txt", + "cType": "const text *", + "canonical": "const struct varlena *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "right_bigint_set", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "i", + "cType": "int64", + "canonical": "long" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "right_bigint_span", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "i", + "cType": "int64", + "canonical": "long" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "right_bigint_spanset", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "i", + "cType": "int64", + "canonical": "long" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "right_float_set", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "right_float_span", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "right_float_spanset", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "right_int_set", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "right_int_span", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "right_int_spanset", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "right_set_bigint", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "i", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "right_set_float", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "right_set_int", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "right_set_set", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s1", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "s2", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "right_set_text", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "txt", + "cType": "text *", + "canonical": "struct varlena *" + } + ] + }, + { + "name": "right_span_bigint", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "i", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "right_span_float", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "right_span_int", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "right_span_span", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s1", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "s2", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "right_span_spanset", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "right_spanset_bigint", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "i", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "right_spanset_float", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "right_spanset_int", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "right_spanset_span", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "right_spanset_spanset", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss1", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "ss2", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "right_text_set", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "txt", + "cType": "const text *", + "canonical": "const struct varlena *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "intersection_bigint_set", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "i", + "cType": "int64", + "canonical": "long" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "intersection_date_set", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "intersection_float_set", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "intersection_int_set", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "intersection_set_bigint", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "i", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "intersection_set_date", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + } + ] + }, + { + "name": "intersection_set_float", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "intersection_set_int", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "intersection_set_set", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s1", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "s2", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "intersection_set_text", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "txt", + "cType": "const text *", + "canonical": "const struct varlena *" + } + ] + }, + { + "name": "intersection_set_timestamptz", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "intersection_span_bigint", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "i", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "intersection_span_date", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + } + ] + }, + { + "name": "intersection_span_float", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "intersection_span_int", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "intersection_span_span", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "s1", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "s2", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "intersection_span_spanset", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "intersection_span_timestamptz", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "intersection_spanset_bigint", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "i", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "intersection_spanset_date", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + } + ] + }, + { + "name": "intersection_spanset_float", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "intersection_spanset_int", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "intersection_spanset_span", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "intersection_spanset_spanset", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "ss1", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "ss2", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "intersection_spanset_timestamptz", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "intersection_text_set", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "txt", + "cType": "const text *", + "canonical": "const struct varlena *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "intersection_timestamptz_set", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "minus_bigint_set", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "i", + "cType": "int64", + "canonical": "long" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "minus_bigint_span", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "i", + "cType": "int64", + "canonical": "long" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "minus_bigint_spanset", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "i", + "cType": "int64", + "canonical": "long" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "minus_date_set", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "minus_date_span", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "minus_date_spanset", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "minus_float_set", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "minus_float_span", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "minus_float_spanset", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "minus_int_set", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "minus_int_span", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "minus_int_spanset", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "minus_set_bigint", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "i", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "minus_set_date", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + } + ] + }, + { + "name": "minus_set_float", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "minus_set_int", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "minus_set_set", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s1", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "s2", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "minus_set_text", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "txt", + "cType": "const text *", + "canonical": "const struct varlena *" + } + ] + }, + { + "name": "minus_set_timestamptz", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "minus_span_bigint", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "i", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "minus_span_date", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + } + ] + }, + { + "name": "minus_span_float", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "minus_span_int", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "minus_span_span", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "s1", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "s2", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "minus_span_spanset", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "minus_span_timestamptz", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "minus_spanset_bigint", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "i", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "minus_spanset_date", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + } + ] + }, + { + "name": "minus_spanset_float", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "minus_spanset_int", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "minus_spanset_span", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "minus_spanset_spanset", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "ss1", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "ss2", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "minus_spanset_timestamptz", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "minus_text_set", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "txt", + "cType": "const text *", + "canonical": "const struct varlena *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "minus_timestamptz_set", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "minus_timestamptz_span", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "minus_timestamptz_spanset", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "union_bigint_set", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "i", + "cType": "int64", + "canonical": "long" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "union_bigint_span", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "i", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "union_bigint_spanset", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "i", + "cType": "int64", + "canonical": "long" + }, + { + "name": "ss", + "cType": "SpanSet *", + "canonical": "SpanSet *" + } + ] + }, + { + "name": "union_date_set", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "union_date_span", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + } + ] + }, + { + "name": "union_date_spanset", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + }, + { + "name": "ss", + "cType": "SpanSet *", + "canonical": "SpanSet *" + } + ] + }, + { + "name": "union_float_set", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "union_float_span", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "union_float_spanset", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + }, + { + "name": "ss", + "cType": "SpanSet *", + "canonical": "SpanSet *" + } + ] + }, + { + "name": "union_int_set", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "union_int_span", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "union_int_spanset", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + }, + { + "name": "ss", + "cType": "SpanSet *", + "canonical": "SpanSet *" + } + ] + }, + { + "name": "union_set_bigint", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "i", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "union_set_date", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + } + ] + }, + { + "name": "union_set_float", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "union_set_int", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "union_set_set", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s1", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "s2", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "union_set_text", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "txt", + "cType": "const text *", + "canonical": "const struct varlena *" + } + ] + }, + { + "name": "union_set_timestamptz", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "union_span_bigint", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "i", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "union_span_date", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + } + ] + }, + { + "name": "union_span_float", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "union_span_int", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "union_span_span", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "s1", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "s2", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "super_union_span_span", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "s1", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "s2", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "union_span_spanset", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "union_span_timestamptz", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "union_spanset_bigint", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "i", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "union_spanset_date", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + } + ] + }, + { + "name": "union_spanset_float", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "union_spanset_int", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "union_spanset_span", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "union_spanset_spanset", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "ss1", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "ss2", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "union_spanset_timestamptz", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "union_text_set", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "txt", + "cType": "const text *", + "canonical": "const struct varlena *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "union_timestamptz_set", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "union_timestamptz_span", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "union_timestamptz_spanset", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "ss", + "cType": "SpanSet *", + "canonical": "SpanSet *" + } + ] + }, + { + "name": "distance_bigintset_bigintset", + "file": "meos.h", + "returnType": { + "c": "int64", + "canonical": "long" + }, + "params": [ + { + "name": "s1", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "s2", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "distance_bigintspan_bigintspan", + "file": "meos.h", + "returnType": { + "c": "int64", + "canonical": "long" + }, + "params": [ + { + "name": "s1", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "s2", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "distance_bigintspanset_bigintspan", + "file": "meos.h", + "returnType": { + "c": "int64", + "canonical": "long" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "distance_bigintspanset_bigintspanset", + "file": "meos.h", + "returnType": { + "c": "int64", + "canonical": "long" + }, + "params": [ + { + "name": "ss1", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "ss2", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "distance_dateset_dateset", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "s1", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "s2", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "distance_datespan_datespan", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "s1", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "s2", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "distance_datespanset_datespan", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "distance_datespanset_datespanset", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "ss1", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "ss2", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "distance_floatset_floatset", + "file": "meos.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "s1", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "s2", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "distance_floatspan_floatspan", + "file": "meos.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "s1", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "s2", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "distance_floatspanset_floatspan", + "file": "meos.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "distance_floatspanset_floatspanset", + "file": "meos.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "ss1", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "ss2", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "distance_intset_intset", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "s1", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "s2", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "distance_intspan_intspan", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "s1", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "s2", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "distance_intspanset_intspan", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "distance_intspanset_intspanset", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "ss1", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "ss2", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "distance_set_bigint", + "file": "meos.h", + "returnType": { + "c": "int64", + "canonical": "long" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "i", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "distance_set_date", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + } + ] + }, + { + "name": "distance_set_float", + "file": "meos.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "distance_set_int", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "distance_set_timestamptz", + "file": "meos.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "distance_span_bigint", + "file": "meos.h", + "returnType": { + "c": "int64", + "canonical": "long" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "i", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "distance_span_date", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + } + ] + }, + { + "name": "distance_span_float", + "file": "meos.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "distance_span_int", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "distance_span_timestamptz", + "file": "meos.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "distance_spanset_bigint", + "file": "meos.h", + "returnType": { + "c": "int64", + "canonical": "long" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "i", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "distance_spanset_date", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + } + ] + }, + { + "name": "distance_spanset_float", + "file": "meos.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "distance_spanset_int", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "distance_spanset_timestamptz", + "file": "meos.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "distance_tstzset_tstzset", + "file": "meos.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "s1", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "s2", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "distance_tstzspan_tstzspan", + "file": "meos.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "s1", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "s2", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "distance_tstzspanset_tstzspan", + "file": "meos.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "distance_tstzspanset_tstzspanset", + "file": "meos.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "ss1", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "ss2", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "bigint_extent_transfn", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "state", + "cType": "Span *", + "canonical": "Span *" + }, + { + "name": "i", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "bigint_union_transfn", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "state", + "cType": "Set *", + "canonical": "Set *" + }, + { + "name": "i", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "date_extent_transfn", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "state", + "cType": "Span *", + "canonical": "Span *" + }, + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + } + ] + }, + { + "name": "date_union_transfn", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "state", + "cType": "Set *", + "canonical": "Set *" + }, + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + } + ] + }, + { + "name": "float_extent_transfn", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "state", + "cType": "Span *", + "canonical": "Span *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "float_union_transfn", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "state", + "cType": "Set *", + "canonical": "Set *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "int_extent_transfn", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "state", + "cType": "Span *", + "canonical": "Span *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "int_union_transfn", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "state", + "cType": "Set *", + "canonical": "Set *" + }, + { + "name": "i", + "cType": "int32", + "canonical": "int" + } + ] + }, + { + "name": "set_extent_transfn", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "state", + "cType": "Span *", + "canonical": "Span *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "set_union_finalfn", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "state", + "cType": "Set *", + "canonical": "Set *" + } + ] + }, + { + "name": "set_union_transfn", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "state", + "cType": "Set *", + "canonical": "Set *" + }, + { + "name": "s", + "cType": "Set *", + "canonical": "Set *" + } + ] + }, + { + "name": "span_extent_transfn", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "state", + "cType": "Span *", + "canonical": "Span *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "span_union_transfn", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "state", + "cType": "SpanSet *", + "canonical": "SpanSet *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "spanset_extent_transfn", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "state", + "cType": "Span *", + "canonical": "Span *" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "spanset_union_finalfn", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "state", + "cType": "SpanSet *", + "canonical": "SpanSet *" + } + ] + }, + { + "name": "spanset_union_transfn", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "state", + "cType": "SpanSet *", + "canonical": "SpanSet *" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "text_union_transfn", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "state", + "cType": "Set *", + "canonical": "Set *" + }, + { + "name": "txt", + "cType": "const text *", + "canonical": "const struct varlena *" + } + ] + }, + { + "name": "timestamptz_extent_transfn", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "state", + "cType": "Span *", + "canonical": "Span *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "timestamptz_union_transfn", + "file": "meos.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "state", + "cType": "Set *", + "canonical": "Set *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "bigint_get_bin", + "file": "meos.h", + "returnType": { + "c": "int64", + "canonical": "long" + }, + "params": [ + { + "name": "value", + "cType": "int64", + "canonical": "long" + }, + { + "name": "vsize", + "cType": "int64", + "canonical": "long" + }, + { + "name": "vorigin", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "bigintspan_bins", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "vsize", + "cType": "int64", + "canonical": "long" + }, + { + "name": "vorigin", + "cType": "int64", + "canonical": "long" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "bigintspanset_bins", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "vsize", + "cType": "int64", + "canonical": "long" + }, + { + "name": "vorigin", + "cType": "int64", + "canonical": "long" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "date_get_bin", + "file": "meos.h", + "returnType": { + "c": "DateADT", + "canonical": "int" + }, + "params": [ + { + "name": "d", + "cType": "DateADT", + "canonical": "int" + }, + { + "name": "duration", + "cType": "const Interval *", + "canonical": "const Interval *" + }, + { + "name": "torigin", + "cType": "DateADT", + "canonical": "int" + } + ] + }, + { + "name": "datespan_bins", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "duration", + "cType": "const Interval *", + "canonical": "const Interval *" + }, + { + "name": "torigin", + "cType": "DateADT", + "canonical": "int" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "datespanset_bins", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "duration", + "cType": "const Interval *", + "canonical": "const Interval *" + }, + { + "name": "torigin", + "cType": "DateADT", + "canonical": "int" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "float_get_bin", + "file": "meos.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "value", + "cType": "double", + "canonical": "double" + }, + { + "name": "vsize", + "cType": "double", + "canonical": "double" + }, + { + "name": "vorigin", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "floatspan_bins", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "vsize", + "cType": "double", + "canonical": "double" + }, + { + "name": "vorigin", + "cType": "double", + "canonical": "double" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "floatspanset_bins", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "vsize", + "cType": "double", + "canonical": "double" + }, + { + "name": "vorigin", + "cType": "double", + "canonical": "double" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "int_get_bin", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "value", + "cType": "int", + "canonical": "int" + }, + { + "name": "vsize", + "cType": "int", + "canonical": "int" + }, + { + "name": "vorigin", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "intspan_bins", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "vsize", + "cType": "int", + "canonical": "int" + }, + { + "name": "vorigin", + "cType": "int", + "canonical": "int" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "intspanset_bins", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "vsize", + "cType": "int", + "canonical": "int" + }, + { + "name": "vorigin", + "cType": "int", + "canonical": "int" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "timestamptz_get_bin", + "file": "meos.h", + "returnType": { + "c": "TimestampTz", + "canonical": "long" + }, + "params": [ + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "duration", + "cType": "const Interval *", + "canonical": "const Interval *" + }, + { + "name": "torigin", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "tstzspan_bins", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "duration", + "cType": "const Interval *", + "canonical": "const Interval *" + }, + { + "name": "origin", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tstzspanset_bins", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "duration", + "cType": "const Interval *", + "canonical": "const Interval *" + }, + { + "name": "torigin", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tbox_as_hexwkb", + "file": "meos.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const TBox *" + }, + { + "name": "variant", + "cType": "uint8_t", + "canonical": "unsigned char" + }, + { + "name": "size", + "cType": "size_t *", + "canonical": "unsigned long *" + } + ] + }, + { + "name": "tbox_as_wkb", + "file": "meos.h", + "returnType": { + "c": "uint8_t *", + "canonical": "unsigned char *" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const TBox *" + }, + { + "name": "variant", + "cType": "uint8_t", + "canonical": "unsigned char" + }, + { + "name": "size_out", + "cType": "size_t *", + "canonical": "unsigned long *" + } + ] + }, + { + "name": "tbox_from_hexwkb", + "file": "meos.h", + "returnType": { + "c": "TBox *", + "canonical": "TBox *" + }, + "params": [ + { + "name": "hexwkb", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "tbox_from_wkb", + "file": "meos.h", + "returnType": { + "c": "TBox *", + "canonical": "TBox *" + }, + "params": [ + { + "name": "wkb", + "cType": "const uint8_t *", + "canonical": "const unsigned char *" + }, + { + "name": "size", + "cType": "size_t", + "canonical": "unsigned long" + } + ] + }, + { + "name": "tbox_in", + "file": "meos.h", + "returnType": { + "c": "TBox *", + "canonical": "TBox *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "tbox_out", + "file": "meos.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const TBox *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "float_timestamptz_to_tbox", + "file": "meos.h", + "returnType": { + "c": "TBox *", + "canonical": "TBox *" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "float_tstzspan_to_tbox", + "file": "meos.h", + "returnType": { + "c": "TBox *", + "canonical": "TBox *" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "int_timestamptz_to_tbox", + "file": "meos.h", + "returnType": { + "c": "TBox *", + "canonical": "TBox *" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "bigint_timestamptz_to_tbox", + "file": "meos.h", + "returnType": { + "c": "TBox *", + "canonical": "TBox *" + }, + "params": [ + { + "name": "i", + "cType": "int64", + "canonical": "long" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "int_tstzspan_to_tbox", + "file": "meos.h", + "returnType": { + "c": "TBox *", + "canonical": "TBox *" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "bigint_tstzspan_to_tbox", + "file": "meos.h", + "returnType": { + "c": "TBox *", + "canonical": "TBox *" + }, + "params": [ + { + "name": "i", + "cType": "int64", + "canonical": "long" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "numspan_tstzspan_to_tbox", + "file": "meos.h", + "returnType": { + "c": "TBox *", + "canonical": "TBox *" + }, + "params": [ + { + "name": "span", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "numspan_timestamptz_to_tbox", + "file": "meos.h", + "returnType": { + "c": "TBox *", + "canonical": "TBox *" + }, + "params": [ + { + "name": "span", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "tbox_copy", + "file": "meos.h", + "returnType": { + "c": "TBox *", + "canonical": "TBox *" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const TBox *" + } + ] + }, + { + "name": "tbox_make", + "file": "meos.h", + "returnType": { + "c": "TBox *", + "canonical": "TBox *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "p", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "float_to_tbox", + "file": "meos.h", + "returnType": { + "c": "TBox *", + "canonical": "TBox *" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "int_to_tbox", + "file": "meos.h", + "returnType": { + "c": "TBox *", + "canonical": "TBox *" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "bigint_to_tbox", + "file": "meos.h", + "returnType": { + "c": "TBox *", + "canonical": "TBox *" + }, + "params": [ + { + "name": "i", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "set_to_tbox", + "file": "meos.h", + "returnType": { + "c": "TBox *", + "canonical": "TBox *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "span_to_tbox", + "file": "meos.h", + "returnType": { + "c": "TBox *", + "canonical": "TBox *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "spanset_to_tbox", + "file": "meos.h", + "returnType": { + "c": "TBox *", + "canonical": "TBox *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "tbox_to_intspan", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const TBox *" + } + ] + }, + { + "name": "tbox_to_bigintspan", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const TBox *" + } + ] + }, + { + "name": "tbox_to_floatspan", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const TBox *" + } + ] + }, + { + "name": "tbox_to_tstzspan", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const TBox *" + } + ] + }, + { + "name": "timestamptz_to_tbox", + "file": "meos.h", + "returnType": { + "c": "TBox *", + "canonical": "TBox *" + }, + "params": [ + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "tbox_hash", + "file": "meos.h", + "returnType": { + "c": "uint32", + "canonical": "unsigned int" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const TBox *" + } + ] + }, + { + "name": "tbox_hash_extended", + "file": "meos.h", + "returnType": { + "c": "uint64", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const TBox *" + }, + { + "name": "seed", + "cType": "uint64", + "canonical": "unsigned long" + } + ] + }, + { + "name": "tbox_hast", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const TBox *" + } + ] + }, + { + "name": "tbox_hasx", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const TBox *" + } + ] + }, + { + "name": "tbox_tmax", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const TBox *" + }, + { + "name": "result", + "cType": "TimestampTz *", + "canonical": "long *" + } + ] + }, + { + "name": "tbox_tmax_inc", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const TBox *" + }, + { + "name": "result", + "cType": "bool *", + "canonical": "_Bool *" + } + ] + }, + { + "name": "tbox_tmin", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const TBox *" + }, + { + "name": "result", + "cType": "TimestampTz *", + "canonical": "long *" + } + ] + }, + { + "name": "tbox_tmin_inc", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const TBox *" + }, + { + "name": "result", + "cType": "bool *", + "canonical": "_Bool *" + } + ] + }, + { + "name": "tbox_xmax", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const TBox *" + }, + { + "name": "result", + "cType": "double *", + "canonical": "double *" + } + ] + }, + { + "name": "tbox_xmax_inc", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const TBox *" + }, + { + "name": "result", + "cType": "bool *", + "canonical": "_Bool *" + } + ] + }, + { + "name": "tbox_xmin", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const TBox *" + }, + { + "name": "result", + "cType": "double *", + "canonical": "double *" + } + ] + }, + { + "name": "tbox_xmin_inc", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const TBox *" + }, + { + "name": "result", + "cType": "bool *", + "canonical": "_Bool *" + } + ] + }, + { + "name": "tboxfloat_xmax", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const TBox *" + }, + { + "name": "result", + "cType": "double *", + "canonical": "double *" + } + ] + }, + { + "name": "tboxfloat_xmin", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const TBox *" + }, + { + "name": "result", + "cType": "double *", + "canonical": "double *" + } + ] + }, + { + "name": "tboxint_xmax", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const TBox *" + }, + { + "name": "result", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tboxbigint_xmax", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const TBox *" + }, + { + "name": "result", + "cType": "int64 *", + "canonical": "long *" + } + ] + }, + { + "name": "tboxint_xmin", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const TBox *" + }, + { + "name": "result", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tboxbigint_xmin", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const TBox *" + }, + { + "name": "result", + "cType": "int64 *", + "canonical": "long *" + } + ] + }, + { + "name": "tfloatbox_expand", + "file": "meos.h", + "returnType": { + "c": "TBox *", + "canonical": "TBox *" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const TBox *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "tintbox_expand", + "file": "meos.h", + "returnType": { + "c": "TBox *", + "canonical": "TBox *" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const TBox *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "tbox_expand_time", + "file": "meos.h", + "returnType": { + "c": "TBox *", + "canonical": "TBox *" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const TBox *" + }, + { + "name": "interv", + "cType": "const Interval *", + "canonical": "const Interval *" + } + ] + }, + { + "name": "tbox_round", + "file": "meos.h", + "returnType": { + "c": "TBox *", + "canonical": "TBox *" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const TBox *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "tfloatbox_shift_scale", + "file": "meos.h", + "returnType": { + "c": "TBox *", + "canonical": "TBox *" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const TBox *" + }, + { + "name": "shift", + "cType": "double", + "canonical": "double" + }, + { + "name": "width", + "cType": "double", + "canonical": "double" + }, + { + "name": "hasshift", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "haswidth", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tintbox_shift_scale", + "file": "meos.h", + "returnType": { + "c": "TBox *", + "canonical": "TBox *" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const TBox *" + }, + { + "name": "shift", + "cType": "int", + "canonical": "int" + }, + { + "name": "width", + "cType": "int", + "canonical": "int" + }, + { + "name": "hasshift", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "haswidth", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tbox_shift_scale_time", + "file": "meos.h", + "returnType": { + "c": "TBox *", + "canonical": "TBox *" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const TBox *" + }, + { + "name": "shift", + "cType": "const Interval *", + "canonical": "const Interval *" + }, + { + "name": "duration", + "cType": "const Interval *", + "canonical": "const Interval *" + } + ] + }, + { + "name": "tbigintbox_expand", + "file": "meos.h", + "returnType": { + "c": "TBox *", + "canonical": "TBox *" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const TBox *" + }, + { + "name": "i", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "tbigintbox_shift_scale", + "file": "meos.h", + "returnType": { + "c": "TBox *", + "canonical": "TBox *" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const TBox *" + }, + { + "name": "shift", + "cType": "int64", + "canonical": "long" + }, + { + "name": "width", + "cType": "int64", + "canonical": "long" + }, + { + "name": "hasshift", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "haswidth", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "union_tbox_tbox", + "file": "meos.h", + "returnType": { + "c": "TBox *", + "canonical": "TBox *" + }, + "params": [ + { + "name": "box1", + "cType": "const TBox *", + "canonical": "const TBox *" + }, + { + "name": "box2", + "cType": "const TBox *", + "canonical": "const TBox *" + }, + { + "name": "strict", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "intersection_tbox_tbox", + "file": "meos.h", + "returnType": { + "c": "TBox *", + "canonical": "TBox *" + }, + "params": [ + { + "name": "box1", + "cType": "const TBox *", + "canonical": "const TBox *" + }, + { + "name": "box2", + "cType": "const TBox *", + "canonical": "const TBox *" + } + ] + }, + { + "name": "adjacent_tbox_tbox", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const TBox *", + "canonical": "const TBox *" + }, + { + "name": "box2", + "cType": "const TBox *", + "canonical": "const TBox *" + } + ] + }, + { + "name": "contained_tbox_tbox", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const TBox *", + "canonical": "const TBox *" + }, + { + "name": "box2", + "cType": "const TBox *", + "canonical": "const TBox *" + } + ] + }, + { + "name": "contains_tbox_tbox", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const TBox *", + "canonical": "const TBox *" + }, + { + "name": "box2", + "cType": "const TBox *", + "canonical": "const TBox *" + } + ] + }, + { + "name": "overlaps_tbox_tbox", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const TBox *", + "canonical": "const TBox *" + }, + { + "name": "box2", + "cType": "const TBox *", + "canonical": "const TBox *" + } + ] + }, + { + "name": "same_tbox_tbox", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const TBox *", + "canonical": "const TBox *" + }, + { + "name": "box2", + "cType": "const TBox *", + "canonical": "const TBox *" + } + ] + }, + { + "name": "after_tbox_tbox", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const TBox *", + "canonical": "const TBox *" + }, + { + "name": "box2", + "cType": "const TBox *", + "canonical": "const TBox *" + } + ] + }, + { + "name": "before_tbox_tbox", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const TBox *", + "canonical": "const TBox *" + }, + { + "name": "box2", + "cType": "const TBox *", + "canonical": "const TBox *" + } + ] + }, + { + "name": "left_tbox_tbox", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const TBox *", + "canonical": "const TBox *" + }, + { + "name": "box2", + "cType": "const TBox *", + "canonical": "const TBox *" + } + ] + }, + { + "name": "overafter_tbox_tbox", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const TBox *", + "canonical": "const TBox *" + }, + { + "name": "box2", + "cType": "const TBox *", + "canonical": "const TBox *" + } + ] + }, + { + "name": "overbefore_tbox_tbox", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const TBox *", + "canonical": "const TBox *" + }, + { + "name": "box2", + "cType": "const TBox *", + "canonical": "const TBox *" + } + ] + }, + { + "name": "overleft_tbox_tbox", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const TBox *", + "canonical": "const TBox *" + }, + { + "name": "box2", + "cType": "const TBox *", + "canonical": "const TBox *" + } + ] + }, + { + "name": "overright_tbox_tbox", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const TBox *", + "canonical": "const TBox *" + }, + { + "name": "box2", + "cType": "const TBox *", + "canonical": "const TBox *" + } + ] + }, + { + "name": "right_tbox_tbox", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const TBox *", + "canonical": "const TBox *" + }, + { + "name": "box2", + "cType": "const TBox *", + "canonical": "const TBox *" + } + ] + }, + { + "name": "tbox_cmp", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "box1", + "cType": "const TBox *", + "canonical": "const TBox *" + }, + { + "name": "box2", + "cType": "const TBox *", + "canonical": "const TBox *" + } + ] + }, + { + "name": "tbox_eq", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const TBox *", + "canonical": "const TBox *" + }, + { + "name": "box2", + "cType": "const TBox *", + "canonical": "const TBox *" + } + ] + }, + { + "name": "tbox_ge", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const TBox *", + "canonical": "const TBox *" + }, + { + "name": "box2", + "cType": "const TBox *", + "canonical": "const TBox *" + } + ] + }, + { + "name": "tbox_gt", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const TBox *", + "canonical": "const TBox *" + }, + { + "name": "box2", + "cType": "const TBox *", + "canonical": "const TBox *" + } + ] + }, + { + "name": "tbox_le", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const TBox *", + "canonical": "const TBox *" + }, + { + "name": "box2", + "cType": "const TBox *", + "canonical": "const TBox *" + } + ] + }, + { + "name": "tbox_lt", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const TBox *", + "canonical": "const TBox *" + }, + { + "name": "box2", + "cType": "const TBox *", + "canonical": "const TBox *" + } + ] + }, + { + "name": "tbox_ne", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const TBox *", + "canonical": "const TBox *" + }, + { + "name": "box2", + "cType": "const TBox *", + "canonical": "const TBox *" + } + ] + }, + { + "name": "tbool_from_mfjson", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "tbool_in", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "tbool_out", + "file": "meos.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "temporal_as_hexwkb", + "file": "meos.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "variant", + "cType": "uint8_t", + "canonical": "unsigned char" + }, + { + "name": "size_out", + "cType": "size_t *", + "canonical": "unsigned long *" + } + ] + }, + { + "name": "temporal_as_mfjson", + "file": "meos.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "with_bbox", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "flags", + "cType": "int", + "canonical": "int" + }, + { + "name": "precision", + "cType": "int", + "canonical": "int" + }, + { + "name": "srs", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "temporal_as_wkb", + "file": "meos.h", + "returnType": { + "c": "uint8_t *", + "canonical": "unsigned char *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "variant", + "cType": "uint8_t", + "canonical": "unsigned char" + }, + { + "name": "size_out", + "cType": "size_t *", + "canonical": "unsigned long *" + } + ] + }, + { + "name": "temporal_from_hexwkb", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "hexwkb", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "temporal_from_wkb", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "wkb", + "cType": "const uint8_t *", + "canonical": "const unsigned char *" + }, + { + "name": "size", + "cType": "size_t", + "canonical": "unsigned long" + } + ] + }, + { + "name": "tfloat_from_mfjson", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "tfloat_in", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "tfloat_out", + "file": "meos.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "tint_from_mfjson", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "tbigint_from_mfjson", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "tint_in", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "tbigint_in", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "tint_out", + "file": "meos.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tbigint_out", + "file": "meos.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ttext_from_mfjson", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "ttext_in", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "ttext_out", + "file": "meos.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tbool_from_base_temp", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "b", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tboolinst_make", + "file": "meos.h", + "returnType": { + "c": "TInstant *", + "canonical": "TInstant *" + }, + "params": [ + { + "name": "b", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "tboolseq_from_base_tstzset", + "file": "meos.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "b", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "tboolseq_from_base_tstzspan", + "file": "meos.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "b", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "tboolseqset_from_base_tstzspanset", + "file": "meos.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "b", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "temporal_copy", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tfloat_from_base_temp", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tfloatinst_make", + "file": "meos.h", + "returnType": { + "c": "TInstant *", + "canonical": "TInstant *" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "tfloatseq_from_base_tstzset", + "file": "meos.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "tfloatseq_from_base_tstzspan", + "file": "meos.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "tfloatseqset_from_base_tstzspanset", + "file": "meos.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "tint_from_base_temp", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tbigint_from_base_temp", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "i", + "cType": "int64", + "canonical": "long" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tintinst_make", + "file": "meos.h", + "returnType": { + "c": "TInstant *", + "canonical": "TInstant *" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "tbigintinst_make", + "file": "meos.h", + "returnType": { + "c": "TInstant *", + "canonical": "TInstant *" + }, + "params": [ + { + "name": "i", + "cType": "int64", + "canonical": "long" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "tintseq_from_base_tstzset", + "file": "meos.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "tbigintseq_from_base_tstzset", + "file": "meos.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "i", + "cType": "int64", + "canonical": "long" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "tintseq_from_base_tstzspan", + "file": "meos.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "tbigintseq_from_base_tstzspan", + "file": "meos.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "i", + "cType": "int64", + "canonical": "long" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "tintseqset_from_base_tstzspanset", + "file": "meos.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "tbigintseqset_from_base_tstzspanset", + "file": "meos.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "i", + "cType": "int64", + "canonical": "long" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "tsequence_make", + "file": "meos.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "instants", + "cType": "TInstant **", + "canonical": "TInstant **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "lower_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "upper_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + }, + { + "name": "normalize", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tsequenceset_make", + "file": "meos.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "sequences", + "cType": "TSequence **", + "canonical": "TSequence **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "normalize", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tsequenceset_make_gaps", + "file": "meos.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "instants", + "cType": "TInstant **", + "canonical": "TInstant **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + }, + { + "name": "maxt", + "cType": "const Interval *", + "canonical": "const Interval *" + }, + { + "name": "maxdist", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "ttext_from_base_temp", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "txt", + "cType": "const text *", + "canonical": "const struct varlena *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ttextinst_make", + "file": "meos.h", + "returnType": { + "c": "TInstant *", + "canonical": "TInstant *" + }, + "params": [ + { + "name": "txt", + "cType": "const text *", + "canonical": "const struct varlena *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "ttextseq_from_base_tstzset", + "file": "meos.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "txt", + "cType": "const text *", + "canonical": "const struct varlena *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "ttextseq_from_base_tstzspan", + "file": "meos.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "txt", + "cType": "const text *", + "canonical": "const struct varlena *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "ttextseqset_from_base_tstzspanset", + "file": "meos.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "txt", + "cType": "const text *", + "canonical": "const struct varlena *" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "tbool_to_tint", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "temporal_to_tstzspan", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tfloat_to_tint", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tfloat_to_tbigint", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tint_to_tfloat", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tint_to_tbigint", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tbigint_to_tint", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tbigint_to_tfloat", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tnumber_to_span", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tnumber_to_tbox", + "file": "meos.h", + "returnType": { + "c": "TBox *", + "canonical": "TBox *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tbool_end_value", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tbool_start_value", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tbool_value_at_timestamptz", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "strict", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "value", + "cType": "bool *", + "canonical": "_Bool *" + } + ] + }, + { + "name": "tbool_value_n", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "n", + "cType": "int", + "canonical": "int" + }, + { + "name": "result", + "cType": "bool *", + "canonical": "_Bool *" + } + ] + }, + { + "name": "tbool_values", + "file": "meos.h", + "returnType": { + "c": "bool *", + "canonical": "_Bool *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "temporal_duration", + "file": "meos.h", + "returnType": { + "c": "Interval *", + "canonical": "Interval *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "boundspan", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "temporal_end_instant", + "file": "meos.h", + "returnType": { + "c": "TInstant *", + "canonical": "TInstant *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "temporal_end_sequence", + "file": "meos.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "temporal_end_timestamptz", + "file": "meos.h", + "returnType": { + "c": "TimestampTz", + "canonical": "long" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "temporal_hash", + "file": "meos.h", + "returnType": { + "c": "uint32", + "canonical": "unsigned int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "temporal_instant_n", + "file": "meos.h", + "returnType": { + "c": "TInstant *", + "canonical": "TInstant *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "n", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "temporal_instants", + "file": "meos.h", + "returnType": { + "c": "TInstant **", + "canonical": "TInstant **" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "temporal_interp", + "file": "meos.h", + "returnType": { + "c": "const char *", + "canonical": "const char *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "temporal_lower_inc", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "temporal_max_instant", + "file": "meos.h", + "returnType": { + "c": "TInstant *", + "canonical": "TInstant *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "temporal_min_instant", + "file": "meos.h", + "returnType": { + "c": "TInstant *", + "canonical": "TInstant *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "temporal_num_instants", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "temporal_num_sequences", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "temporal_num_timestamps", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "temporal_segm_duration", + "file": "meos.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "duration", + "cType": "const Interval *", + "canonical": "const Interval *" + }, + { + "name": "atleast", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "strict", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "temporal_segments", + "file": "meos.h", + "returnType": { + "c": "TSequence **", + "canonical": "TSequence **" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "temporal_sequence_n", + "file": "meos.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "temporal_sequences", + "file": "meos.h", + "returnType": { + "c": "TSequence **", + "canonical": "TSequence **" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "temporal_start_instant", + "file": "meos.h", + "returnType": { + "c": "TInstant *", + "canonical": "TInstant *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "temporal_start_sequence", + "file": "meos.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "temporal_start_timestamptz", + "file": "meos.h", + "returnType": { + "c": "TimestampTz", + "canonical": "long" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "temporal_stops", + "file": "meos.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "maxdist", + "cType": "double", + "canonical": "double" + }, + { + "name": "minduration", + "cType": "const Interval *", + "canonical": "const Interval *" + } + ] + }, + { + "name": "temporal_subtype", + "file": "meos.h", + "returnType": { + "c": "const char *", + "canonical": "const char *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "temporal_basetype_name", + "file": "meos.h", + "returnType": { + "c": "const char *", + "canonical": "const char *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "temporal_time", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "temporal_timestamps", + "file": "meos.h", + "returnType": { + "c": "TimestampTz *", + "canonical": "long *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "temporal_timestamptz_n", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "n", + "cType": "int", + "canonical": "int" + }, + { + "name": "result", + "cType": "TimestampTz *", + "canonical": "long *" + } + ] + }, + { + "name": "temporal_upper_inc", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tfloat_end_value", + "file": "meos.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tfloat_min_value", + "file": "meos.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tfloat_max_value", + "file": "meos.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tfloat_start_value", + "file": "meos.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tfloat_value_at_timestamptz", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "strict", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "value", + "cType": "double *", + "canonical": "double *" + } + ] + }, + { + "name": "tfloat_value_n", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "n", + "cType": "int", + "canonical": "int" + }, + { + "name": "result", + "cType": "double *", + "canonical": "double *" + } + ] + }, + { + "name": "tfloat_values", + "file": "meos.h", + "returnType": { + "c": "double *", + "canonical": "double *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tint_end_value", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tbigint_end_value", + "file": "meos.h", + "returnType": { + "c": "int64", + "canonical": "long" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tint_max_value", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tbigint_max_value", + "file": "meos.h", + "returnType": { + "c": "int64", + "canonical": "long" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tint_min_value", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tbigint_min_value", + "file": "meos.h", + "returnType": { + "c": "int64", + "canonical": "long" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tint_start_value", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tbigint_start_value", + "file": "meos.h", + "returnType": { + "c": "int64", + "canonical": "long" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tbigint_value_at_timestamptz", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "strict", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "value", + "cType": "int64 *", + "canonical": "long *" + } + ] + }, + { + "name": "tint_value_at_timestamptz", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "strict", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "value", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tint_value_n", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "n", + "cType": "int", + "canonical": "int" + }, + { + "name": "result", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tbigint_value_n", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "n", + "cType": "int64", + "canonical": "long" + }, + { + "name": "result", + "cType": "int64 *", + "canonical": "long *" + } + ] + }, + { + "name": "tint_values", + "file": "meos.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tbigint_values", + "file": "meos.h", + "returnType": { + "c": "int64 *", + "canonical": "long *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "count", + "cType": "int32 *", + "canonical": "int *" + } + ] + }, + { + "name": "tnumber_avg_value", + "file": "meos.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tnumber_integral", + "file": "meos.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tnumber_twavg", + "file": "meos.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tnumber_valuespans", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ttext_end_value", + "file": "meos.h", + "returnType": { + "c": "text *", + "canonical": "struct varlena *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ttext_max_value", + "file": "meos.h", + "returnType": { + "c": "text *", + "canonical": "struct varlena *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ttext_min_value", + "file": "meos.h", + "returnType": { + "c": "text *", + "canonical": "struct varlena *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ttext_start_value", + "file": "meos.h", + "returnType": { + "c": "text *", + "canonical": "struct varlena *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ttext_value_at_timestamptz", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "strict", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "value", + "cType": "text **", + "canonical": "struct varlena **" + } + ] + }, + { + "name": "ttext_value_n", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "n", + "cType": "int", + "canonical": "int" + }, + { + "name": "result", + "cType": "text **", + "canonical": "struct varlena **" + } + ] + }, + { + "name": "ttext_values", + "file": "meos.h", + "returnType": { + "c": "text **", + "canonical": "struct varlena **" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "float_degrees", + "file": "meos.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "value", + "cType": "double", + "canonical": "double" + }, + { + "name": "normalize", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "temparr_round", + "file": "meos.h", + "returnType": { + "c": "Temporal **", + "canonical": "Temporal **" + }, + "params": [ + { + "name": "temp", + "cType": "Temporal **", + "canonical": "Temporal **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "temporal_round", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "temporal_scale_time", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "duration", + "cType": "const Interval *", + "canonical": "const Interval *" + } + ] + }, + { + "name": "temporal_set_interp", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "temporal_shift_scale_time", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "shift", + "cType": "const Interval *", + "canonical": "const Interval *" + }, + { + "name": "duration", + "cType": "const Interval *", + "canonical": "const Interval *" + } + ] + }, + { + "name": "temporal_shift_time", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "shift", + "cType": "const Interval *", + "canonical": "const Interval *" + } + ] + }, + { + "name": "temporal_to_tinstant", + "file": "meos.h", + "returnType": { + "c": "TInstant *", + "canonical": "TInstant *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "temporal_to_tsequence", + "file": "meos.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "temporal_to_tsequenceset", + "file": "meos.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "tfloat_ceil", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tfloat_degrees", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "normalize", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tfloat_floor", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tfloat_radians", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tfloat_scale_value", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "width", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "tfloat_shift_scale_value", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "shift", + "cType": "double", + "canonical": "double" + }, + { + "name": "width", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "tfloat_shift_value", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "shift", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "tint_scale_value", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "width", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "tbigint_scale_value", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "width", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "tint_shift_scale_value", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "shift", + "cType": "int", + "canonical": "int" + }, + { + "name": "width", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "tbigint_shift_scale_value", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "shift", + "cType": "int64", + "canonical": "long" + }, + { + "name": "width", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "tint_shift_value", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "shift", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "tbigint_shift_value", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "shift", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "temporal_append_tinstant", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "Temporal *", + "canonical": "Temporal *" + }, + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const TInstant *" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + }, + { + "name": "maxdist", + "cType": "double", + "canonical": "double" + }, + { + "name": "maxt", + "cType": "const Interval *", + "canonical": "const Interval *" + }, + { + "name": "expand", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "temporal_append_tsequence", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "Temporal *", + "canonical": "Temporal *" + }, + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "expand", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "temporal_delete_timestamptz", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "connect", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "temporal_delete_tstzset", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "connect", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "temporal_delete_tstzspan", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "connect", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "temporal_delete_tstzspanset", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "connect", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "temporal_insert", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "connect", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "temporal_merge", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "temporal_merge_array", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temparr", + "cType": "Temporal **", + "canonical": "Temporal **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "temporal_update", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "connect", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tbool_at_value", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "b", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tbool_minus_value", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "b", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "temporal_after_timestamptz", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "strict", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "temporal_at_max", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "temporal_at_min", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "temporal_at_timestamptz", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "temporal_at_tstzset", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "temporal_at_tstzspan", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "temporal_at_tstzspanset", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "temporal_at_values", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "set", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "temporal_before_timestamptz", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "strict", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "temporal_minus_max", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "temporal_minus_min", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "temporal_minus_timestamptz", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "temporal_minus_tstzset", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "temporal_minus_tstzspan", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "temporal_minus_tstzspanset", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "temporal_minus_values", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "set", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "tfloat_at_value", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "tfloat_minus_value", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "tint_at_value", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "tint_minus_value", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "tnumber_at_span", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "span", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "tnumber_at_spanset", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "tnumber_at_tbox", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const TBox *", + "canonical": "const TBox *" + } + ] + }, + { + "name": "tnumber_minus_span", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "span", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "tnumber_minus_spanset", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "tnumber_minus_tbox", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const TBox *", + "canonical": "const TBox *" + } + ] + }, + { + "name": "ttext_at_value", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "txt", + "cType": "text *", + "canonical": "struct varlena *" + } + ] + }, + { + "name": "ttext_minus_value", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "txt", + "cType": "text *", + "canonical": "struct varlena *" + } + ] + }, + { + "name": "temporal_cmp", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "temporal_eq", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ], + "ownership": "caller", + "nullable": true, + "doc": "Returns the temporal equality between two temporal values.", + "meos": { + "temporalDim": "any", + "spatialDim": null, + "interpolation": false, + "subtype": "any" + } + }, + { + "name": "temporal_ge", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "temporal_gt", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "temporal_le", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "temporal_lt", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "temporal_ne", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_eq_bool_tbool", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "b", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_eq_float_tfloat", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_eq_int_tint", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_eq_tbool_bool", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "b", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "always_eq_temporal_temporal", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_eq_text_ttext", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "txt", + "cType": "const text *", + "canonical": "const struct varlena *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_eq_tfloat_float", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "always_eq_tint_int", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "always_eq_bigint_tbigint", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "i", + "cType": "int64", + "canonical": "long" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_eq_tbigint_bigint", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "i", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "always_eq_ttext_text", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "txt", + "cType": "const text *", + "canonical": "const struct varlena *" + } + ] + }, + { + "name": "always_ge_float_tfloat", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_ge_int_tint", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_ge_temporal_temporal", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_ge_text_ttext", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "txt", + "cType": "const text *", + "canonical": "const struct varlena *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_ge_tfloat_float", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "always_ge_tint_int", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "always_ge_bigint_tbigint", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "i", + "cType": "int64", + "canonical": "long" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_ge_tbigint_bigint", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "i", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "always_ge_ttext_text", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "txt", + "cType": "const text *", + "canonical": "const struct varlena *" + } + ] + }, + { + "name": "always_gt_float_tfloat", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_gt_int_tint", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_gt_temporal_temporal", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_gt_text_ttext", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "txt", + "cType": "const text *", + "canonical": "const struct varlena *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_gt_tfloat_float", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "always_gt_tint_int", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "always_gt_bigint_tbigint", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "i", + "cType": "int64", + "canonical": "long" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_gt_tbigint_bigint", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "i", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "always_gt_ttext_text", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "txt", + "cType": "const text *", + "canonical": "const struct varlena *" + } + ] + }, + { + "name": "always_le_float_tfloat", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_le_int_tint", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_le_temporal_temporal", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_le_text_ttext", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "txt", + "cType": "const text *", + "canonical": "const struct varlena *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_le_tfloat_float", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "always_le_tint_int", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "always_le_bigint_tbigint", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "i", + "cType": "int64", + "canonical": "long" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_le_tbigint_bigint", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "i", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "always_le_ttext_text", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "txt", + "cType": "const text *", + "canonical": "const struct varlena *" + } + ] + }, + { + "name": "always_lt_float_tfloat", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_lt_int_tint", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_lt_temporal_temporal", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_lt_text_ttext", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "txt", + "cType": "const text *", + "canonical": "const struct varlena *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_lt_tfloat_float", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "always_lt_tint_int", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "always_lt_bigint_tbigint", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "i", + "cType": "int64", + "canonical": "long" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_lt_tbigint_bigint", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "i", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "always_lt_ttext_text", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "txt", + "cType": "const text *", + "canonical": "const struct varlena *" + } + ] + }, + { + "name": "always_ne_bool_tbool", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "b", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_ne_float_tfloat", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_ne_int_tint", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_ne_tbool_bool", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "b", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "always_ne_temporal_temporal", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_ne_text_ttext", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "txt", + "cType": "const text *", + "canonical": "const struct varlena *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_ne_tfloat_float", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "always_ne_tint_int", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "always_ne_bigint_tbigint", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "i", + "cType": "int64", + "canonical": "long" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_ne_tbigint_bigint", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "i", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "always_ne_ttext_text", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "txt", + "cType": "const text *", + "canonical": "const struct varlena *" + } + ] + }, + { + "name": "ever_eq_bool_tbool", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "b", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_eq_float_tfloat", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_eq_int_tint", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_eq_tbool_bool", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "b", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ever_eq_temporal_temporal", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_eq_text_ttext", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "txt", + "cType": "const text *", + "canonical": "const struct varlena *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_eq_tfloat_float", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "ever_eq_tint_int", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "ever_eq_bigint_tbigint", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "i", + "cType": "int64", + "canonical": "long" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_eq_tbigint_bigint", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "i", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "ever_eq_ttext_text", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "txt", + "cType": "const text *", + "canonical": "const struct varlena *" + } + ] + }, + { + "name": "ever_ge_float_tfloat", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_ge_int_tint", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_ge_temporal_temporal", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_ge_text_ttext", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "txt", + "cType": "const text *", + "canonical": "const struct varlena *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_ge_tfloat_float", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "ever_ge_tint_int", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "ever_ge_bigint_tbigint", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "i", + "cType": "int64", + "canonical": "long" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_ge_tbigint_bigint", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "i", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "ever_ge_ttext_text", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "txt", + "cType": "const text *", + "canonical": "const struct varlena *" + } + ] + }, + { + "name": "ever_gt_float_tfloat", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_gt_int_tint", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_gt_temporal_temporal", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_gt_text_ttext", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "txt", + "cType": "const text *", + "canonical": "const struct varlena *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_gt_tfloat_float", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "ever_gt_tint_int", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "ever_gt_bigint_tbigint", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "i", + "cType": "int64", + "canonical": "long" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_gt_tbigint_bigint", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "i", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "ever_gt_ttext_text", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "txt", + "cType": "const text *", + "canonical": "const struct varlena *" + } + ] + }, + { + "name": "ever_le_float_tfloat", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_le_int_tint", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_le_temporal_temporal", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_le_text_ttext", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "txt", + "cType": "const text *", + "canonical": "const struct varlena *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_le_tfloat_float", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "ever_le_tint_int", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "ever_le_bigint_tbigint", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "i", + "cType": "int64", + "canonical": "long" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_le_tbigint_bigint", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "i", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "ever_le_ttext_text", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "txt", + "cType": "const text *", + "canonical": "const struct varlena *" + } + ] + }, + { + "name": "ever_lt_float_tfloat", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_lt_int_tint", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_lt_temporal_temporal", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_lt_text_ttext", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "txt", + "cType": "const text *", + "canonical": "const struct varlena *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_lt_tfloat_float", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "ever_lt_tint_int", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "ever_lt_bigint_tbigint", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "i", + "cType": "int64", + "canonical": "long" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_lt_tbigint_bigint", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "i", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "ever_lt_ttext_text", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "txt", + "cType": "const text *", + "canonical": "const struct varlena *" + } + ] + }, + { + "name": "ever_ne_bool_tbool", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "b", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_ne_float_tfloat", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_ne_int_tint", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_ne_tbool_bool", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "b", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ever_ne_temporal_temporal", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_ne_text_ttext", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "txt", + "cType": "const text *", + "canonical": "const struct varlena *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_ne_tfloat_float", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "ever_ne_tint_int", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "ever_ne_bigint_tbigint", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "i", + "cType": "int64", + "canonical": "long" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_ne_tbigint_bigint", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "i", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "ever_ne_ttext_text", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "txt", + "cType": "const text *", + "canonical": "const struct varlena *" + } + ] + }, + { + "name": "teq_bool_tbool", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "b", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "teq_float_tfloat", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "teq_int_tint", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "teq_tbool_bool", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "b", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "teq_temporal_temporal", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "teq_text_ttext", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "txt", + "cType": "const text *", + "canonical": "const struct varlena *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "teq_tfloat_float", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "teq_tint_int", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "teq_ttext_text", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "txt", + "cType": "const text *", + "canonical": "const struct varlena *" + } + ] + }, + { + "name": "tge_float_tfloat", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tge_int_tint", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tge_temporal_temporal", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tge_text_ttext", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "txt", + "cType": "const text *", + "canonical": "const struct varlena *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tge_tfloat_float", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "tge_tint_int", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "tge_ttext_text", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "txt", + "cType": "const text *", + "canonical": "const struct varlena *" + } + ] + }, + { + "name": "tgt_float_tfloat", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tgt_int_tint", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tgt_temporal_temporal", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tgt_text_ttext", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "txt", + "cType": "const text *", + "canonical": "const struct varlena *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tgt_tfloat_float", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "tgt_tint_int", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "tgt_ttext_text", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "txt", + "cType": "const text *", + "canonical": "const struct varlena *" + } + ] + }, + { + "name": "tle_float_tfloat", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tle_int_tint", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tle_temporal_temporal", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tle_text_ttext", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "txt", + "cType": "const text *", + "canonical": "const struct varlena *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tle_tfloat_float", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "tle_tint_int", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "tle_ttext_text", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "txt", + "cType": "const text *", + "canonical": "const struct varlena *" + } + ] + }, + { + "name": "tlt_float_tfloat", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tlt_int_tint", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tlt_temporal_temporal", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tlt_text_ttext", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "txt", + "cType": "const text *", + "canonical": "const struct varlena *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tlt_tfloat_float", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "tlt_tint_int", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "tlt_ttext_text", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "txt", + "cType": "const text *", + "canonical": "const struct varlena *" + } + ] + }, + { + "name": "tne_bool_tbool", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "b", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tne_float_tfloat", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tne_int_tint", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tne_tbool_bool", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "b", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tne_temporal_temporal", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tne_text_ttext", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "txt", + "cType": "const text *", + "canonical": "const struct varlena *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tne_tfloat_float", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "tne_tint_int", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "tne_ttext_text", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "txt", + "cType": "const text *", + "canonical": "const struct varlena *" + } + ] + }, + { + "name": "temporal_spans", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "temporal_split_each_n_spans", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "elem_count", + "cType": "int", + "canonical": "int" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "temporal_split_n_spans", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "span_count", + "cType": "int", + "canonical": "int" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tnumber_split_each_n_tboxes", + "file": "meos.h", + "returnType": { + "c": "TBox *", + "canonical": "TBox *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "elem_count", + "cType": "int", + "canonical": "int" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tnumber_split_n_tboxes", + "file": "meos.h", + "returnType": { + "c": "TBox *", + "canonical": "TBox *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box_count", + "cType": "int", + "canonical": "int" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tnumber_tboxes", + "file": "meos.h", + "returnType": { + "c": "TBox *", + "canonical": "TBox *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "adjacent_numspan_tnumber", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "adjacent_tbox_tnumber", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const TBox *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "adjacent_temporal_temporal", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "adjacent_temporal_tstzspan", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "adjacent_tnumber_numspan", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "adjacent_tnumber_tbox", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const TBox *", + "canonical": "const TBox *" + } + ] + }, + { + "name": "adjacent_tnumber_tnumber", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "adjacent_tstzspan_temporal", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "contained_numspan_tnumber", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "contained_tbox_tnumber", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const TBox *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "contained_temporal_temporal", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "contained_temporal_tstzspan", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "contained_tnumber_numspan", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "contained_tnumber_tbox", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const TBox *", + "canonical": "const TBox *" + } + ] + }, + { + "name": "contained_tnumber_tnumber", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "contained_tstzspan_temporal", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "contains_numspan_tnumber", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "contains_tbox_tnumber", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const TBox *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "contains_temporal_tstzspan", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "contains_temporal_temporal", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "contains_tnumber_numspan", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "contains_tnumber_tbox", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const TBox *", + "canonical": "const TBox *" + } + ] + }, + { + "name": "contains_tnumber_tnumber", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "contains_tstzspan_temporal", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "overlaps_numspan_tnumber", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "overlaps_tbox_tnumber", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const TBox *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "overlaps_temporal_temporal", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "overlaps_temporal_tstzspan", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "overlaps_tnumber_numspan", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "overlaps_tnumber_tbox", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const TBox *", + "canonical": "const TBox *" + } + ] + }, + { + "name": "overlaps_tnumber_tnumber", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "overlaps_tstzspan_temporal", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "same_numspan_tnumber", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "same_tbox_tnumber", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const TBox *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "same_temporal_temporal", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "same_temporal_tstzspan", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "same_tnumber_numspan", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "same_tnumber_tbox", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const TBox *", + "canonical": "const TBox *" + } + ] + }, + { + "name": "same_tnumber_tnumber", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "same_tstzspan_temporal", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "after_tbox_tnumber", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const TBox *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "after_temporal_tstzspan", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "after_temporal_temporal", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "after_tnumber_tbox", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const TBox *", + "canonical": "const TBox *" + } + ] + }, + { + "name": "after_tnumber_tnumber", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "after_tstzspan_temporal", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "before_tbox_tnumber", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const TBox *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "before_temporal_tstzspan", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "before_temporal_temporal", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "before_tnumber_tbox", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const TBox *", + "canonical": "const TBox *" + } + ] + }, + { + "name": "before_tnumber_tnumber", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "before_tstzspan_temporal", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "left_tbox_tnumber", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const TBox *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "left_numspan_tnumber", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "left_tnumber_numspan", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "left_tnumber_tbox", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const TBox *", + "canonical": "const TBox *" + } + ] + }, + { + "name": "left_tnumber_tnumber", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "overafter_tbox_tnumber", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const TBox *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "overafter_temporal_tstzspan", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "overafter_temporal_temporal", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "overafter_tnumber_tbox", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const TBox *", + "canonical": "const TBox *" + } + ] + }, + { + "name": "overafter_tnumber_tnumber", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "overafter_tstzspan_temporal", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "overbefore_tbox_tnumber", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const TBox *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "overbefore_temporal_tstzspan", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "overbefore_temporal_temporal", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "overbefore_tnumber_tbox", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const TBox *", + "canonical": "const TBox *" + } + ] + }, + { + "name": "overbefore_tnumber_tnumber", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "overbefore_tstzspan_temporal", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "overleft_numspan_tnumber", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "overleft_tbox_tnumber", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const TBox *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "overleft_tnumber_numspan", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "overleft_tnumber_tbox", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const TBox *", + "canonical": "const TBox *" + } + ] + }, + { + "name": "overleft_tnumber_tnumber", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "overright_numspan_tnumber", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "overright_tbox_tnumber", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const TBox *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "overright_tnumber_numspan", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "overright_tnumber_tbox", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const TBox *", + "canonical": "const TBox *" + } + ] + }, + { + "name": "overright_tnumber_tnumber", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "right_numspan_tnumber", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "right_tbox_tnumber", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const TBox *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "right_tnumber_numspan", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "right_tnumber_tbox", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const TBox *", + "canonical": "const TBox *" + } + ] + }, + { + "name": "right_tnumber_tnumber", + "file": "meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tand_bool_tbool", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "b", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tand_tbool_bool", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "b", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tand_tbool_tbool", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tbool_when_true", + "file": "meos.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tnot_tbool", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tor_bool_tbool", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "b", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tor_tbool_bool", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "b", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tor_tbool_tbool", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "add_float_tfloat", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + }, + { + "name": "tnumber", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "add_int_tint", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + }, + { + "name": "tnumber", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "add_tfloat_float", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "tnumber", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "add_tint_int", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "tnumber", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "add_bigint_tbigint", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "i", + "cType": "int64", + "canonical": "long" + }, + { + "name": "tnumber", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "add_tbigint_bigint", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "tnumber", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "i", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "add_tnumber_tnumber", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "tnumber1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "tnumber2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "div_float_tfloat", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + }, + { + "name": "tnumber", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "div_int_tint", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + }, + { + "name": "tnumber", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "div_tfloat_float", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "tnumber", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "div_tint_int", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "tnumber", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "div_bigint_tbigint", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "i", + "cType": "int64", + "canonical": "long" + }, + { + "name": "tnumber", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "div_tbigint_bigint", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "tnumber", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "i", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "div_tnumber_tnumber", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "tnumber1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "tnumber2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "mul_float_tfloat", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + }, + { + "name": "tnumber", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "mul_int_tint", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + }, + { + "name": "tnumber", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "mul_tfloat_float", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "tnumber", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "mul_tint_int", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "tnumber", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "mul_bigint_tbigint", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "i", + "cType": "int64", + "canonical": "long" + }, + { + "name": "tnumber", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "mul_tbigint_bigint", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "tnumber", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "i", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "mul_tnumber_tnumber", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "tnumber1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "tnumber2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "sub_float_tfloat", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + }, + { + "name": "tnumber", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "sub_int_tint", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + }, + { + "name": "tnumber", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "sub_tfloat_float", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "tnumber", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "sub_tint_int", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "tnumber", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "sub_bigint_tbigint", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "i", + "cType": "int64", + "canonical": "long" + }, + { + "name": "tnumber", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "sub_tbigint_bigint", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "tnumber", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "i", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "sub_tnumber_tnumber", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "tnumber1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "tnumber2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "temporal_derivative", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tfloat_exp", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tfloat_ln", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tfloat_log10", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tfloat_sin", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tfloat_cos", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tfloat_tan", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tnumber_abs", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tnumber_trend", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "float_angular_difference", + "file": "meos.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "degrees1", + "cType": "double", + "canonical": "double" + }, + { + "name": "degrees2", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "tnumber_angular_difference", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tnumber_delta_value", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "textcat_text_ttext", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "txt", + "cType": "const text *", + "canonical": "const struct varlena *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "textcat_ttext_text", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "txt", + "cType": "const text *", + "canonical": "const struct varlena *" + } + ] + }, + { + "name": "textcat_ttext_ttext", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ttext_initcap", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ttext_upper", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ttext_lower", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tdistance_tfloat_float", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "tdistance_tint_int", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "tdistance_tnumber_tnumber", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "nad_tboxfloat_tboxfloat", + "file": "meos.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "box1", + "cType": "const TBox *", + "canonical": "const TBox *" + }, + { + "name": "box2", + "cType": "const TBox *", + "canonical": "const TBox *" + } + ] + }, + { + "name": "nad_tboxint_tboxint", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "box1", + "cType": "const TBox *", + "canonical": "const TBox *" + }, + { + "name": "box2", + "cType": "const TBox *", + "canonical": "const TBox *" + } + ] + }, + { + "name": "nad_tfloat_float", + "file": "meos.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "nad_tfloat_tfloat", + "file": "meos.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "nad_tfloat_tbox", + "file": "meos.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const TBox *", + "canonical": "const TBox *" + } + ] + }, + { + "name": "nad_tint_int", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "nad_tint_tbox", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const TBox *", + "canonical": "const TBox *" + } + ] + }, + { + "name": "nad_tint_tint", + "file": "meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tbool_tand_transfn", + "file": "meos.h", + "returnType": { + "c": "SkipList *", + "canonical": "struct SkipList *" + }, + "params": [ + { + "name": "state", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tbool_tand_combinefn", + "file": "meos.h", + "returnType": { + "c": "SkipList *", + "canonical": "struct SkipList *" + }, + "params": [ + { + "name": "state1", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "state2", + "cType": "SkipList *", + "canonical": "struct SkipList *" + } + ] + }, + { + "name": "tbool_tor_transfn", + "file": "meos.h", + "returnType": { + "c": "SkipList *", + "canonical": "struct SkipList *" + }, + "params": [ + { + "name": "state", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tbool_tor_combinefn", + "file": "meos.h", + "returnType": { + "c": "SkipList *", + "canonical": "struct SkipList *" + }, + "params": [ + { + "name": "state1", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "state2", + "cType": "SkipList *", + "canonical": "struct SkipList *" + } + ] + }, + { + "name": "temporal_extent_transfn", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "s", + "cType": "Span *", + "canonical": "Span *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "temporal_tagg_finalfn", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "state", + "cType": "SkipList *", + "canonical": "struct SkipList *" + } + ] + }, + { + "name": "temporal_tcount_transfn", + "file": "meos.h", + "returnType": { + "c": "SkipList *", + "canonical": "struct SkipList *" + }, + "params": [ + { + "name": "state", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "temporal_tcount_combinefn", + "file": "meos.h", + "returnType": { + "c": "SkipList *", + "canonical": "struct SkipList *" + }, + "params": [ + { + "name": "state1", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "state2", + "cType": "SkipList *", + "canonical": "struct SkipList *" + } + ] + }, + { + "name": "tfloat_tmax_transfn", + "file": "meos.h", + "returnType": { + "c": "SkipList *", + "canonical": "struct SkipList *" + }, + "params": [ + { + "name": "state", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tfloat_tmax_combinefn", + "file": "meos.h", + "returnType": { + "c": "SkipList *", + "canonical": "struct SkipList *" + }, + "params": [ + { + "name": "state1", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "state2", + "cType": "SkipList *", + "canonical": "struct SkipList *" + } + ] + }, + { + "name": "tfloat_tmin_transfn", + "file": "meos.h", + "returnType": { + "c": "SkipList *", + "canonical": "struct SkipList *" + }, + "params": [ + { + "name": "state", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tfloat_tmin_combinefn", + "file": "meos.h", + "returnType": { + "c": "SkipList *", + "canonical": "struct SkipList *" + }, + "params": [ + { + "name": "state1", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "state2", + "cType": "SkipList *", + "canonical": "struct SkipList *" + } + ] + }, + { + "name": "tfloat_tsum_transfn", + "file": "meos.h", + "returnType": { + "c": "SkipList *", + "canonical": "struct SkipList *" + }, + "params": [ + { + "name": "state", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tfloat_tsum_combinefn", + "file": "meos.h", + "returnType": { + "c": "SkipList *", + "canonical": "struct SkipList *" + }, + "params": [ + { + "name": "state1", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "state2", + "cType": "SkipList *", + "canonical": "struct SkipList *" + } + ] + }, + { + "name": "tfloat_wmax_transfn", + "file": "meos.h", + "returnType": { + "c": "SkipList *", + "canonical": "struct SkipList *" + }, + "params": [ + { + "name": "state", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "interv", + "cType": "const Interval *", + "canonical": "const Interval *" + } + ] + }, + { + "name": "tfloat_wmin_transfn", + "file": "meos.h", + "returnType": { + "c": "SkipList *", + "canonical": "struct SkipList *" + }, + "params": [ + { + "name": "state", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "interv", + "cType": "const Interval *", + "canonical": "const Interval *" + } + ] + }, + { + "name": "tfloat_wsum_transfn", + "file": "meos.h", + "returnType": { + "c": "SkipList *", + "canonical": "struct SkipList *" + }, + "params": [ + { + "name": "state", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "interv", + "cType": "const Interval *", + "canonical": "const Interval *" + } + ] + }, + { + "name": "timestamptz_tcount_transfn", + "file": "meos.h", + "returnType": { + "c": "SkipList *", + "canonical": "struct SkipList *" + }, + "params": [ + { + "name": "state", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "tint_tmax_transfn", + "file": "meos.h", + "returnType": { + "c": "SkipList *", + "canonical": "struct SkipList *" + }, + "params": [ + { + "name": "state", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tint_tmax_combinefn", + "file": "meos.h", + "returnType": { + "c": "SkipList *", + "canonical": "struct SkipList *" + }, + "params": [ + { + "name": "state1", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "state2", + "cType": "SkipList *", + "canonical": "struct SkipList *" + } + ] + }, + { + "name": "tint_tmin_transfn", + "file": "meos.h", + "returnType": { + "c": "SkipList *", + "canonical": "struct SkipList *" + }, + "params": [ + { + "name": "state", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tint_tmin_combinefn", + "file": "meos.h", + "returnType": { + "c": "SkipList *", + "canonical": "struct SkipList *" + }, + "params": [ + { + "name": "state1", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "state2", + "cType": "SkipList *", + "canonical": "struct SkipList *" + } + ] + }, + { + "name": "tint_tsum_transfn", + "file": "meos.h", + "returnType": { + "c": "SkipList *", + "canonical": "struct SkipList *" + }, + "params": [ + { + "name": "state", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tint_tsum_combinefn", + "file": "meos.h", + "returnType": { + "c": "SkipList *", + "canonical": "struct SkipList *" + }, + "params": [ + { + "name": "state1", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "state2", + "cType": "SkipList *", + "canonical": "struct SkipList *" + } + ] + }, + { + "name": "tint_wmax_transfn", + "file": "meos.h", + "returnType": { + "c": "SkipList *", + "canonical": "struct SkipList *" + }, + "params": [ + { + "name": "state", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "interv", + "cType": "const Interval *", + "canonical": "const Interval *" + } + ] + }, + { + "name": "tint_wmin_transfn", + "file": "meos.h", + "returnType": { + "c": "SkipList *", + "canonical": "struct SkipList *" + }, + "params": [ + { + "name": "state", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "interv", + "cType": "const Interval *", + "canonical": "const Interval *" + } + ] + }, + { + "name": "tint_wsum_transfn", + "file": "meos.h", + "returnType": { + "c": "SkipList *", + "canonical": "struct SkipList *" + }, + "params": [ + { + "name": "state", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "interv", + "cType": "const Interval *", + "canonical": "const Interval *" + } + ] + }, + { + "name": "tnumber_extent_transfn", + "file": "meos.h", + "returnType": { + "c": "TBox *", + "canonical": "TBox *" + }, + "params": [ + { + "name": "box", + "cType": "TBox *", + "canonical": "TBox *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tnumber_tavg_finalfn", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "state", + "cType": "SkipList *", + "canonical": "struct SkipList *" + } + ] + }, + { + "name": "tnumber_tavg_transfn", + "file": "meos.h", + "returnType": { + "c": "SkipList *", + "canonical": "struct SkipList *" + }, + "params": [ + { + "name": "state", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tnumber_tavg_combinefn", + "file": "meos.h", + "returnType": { + "c": "SkipList *", + "canonical": "struct SkipList *" + }, + "params": [ + { + "name": "state1", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "state2", + "cType": "SkipList *", + "canonical": "struct SkipList *" + } + ] + }, + { + "name": "tnumber_wavg_transfn", + "file": "meos.h", + "returnType": { + "c": "SkipList *", + "canonical": "struct SkipList *" + }, + "params": [ + { + "name": "state", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "interv", + "cType": "const Interval *", + "canonical": "const Interval *" + } + ] + }, + { + "name": "tstzset_tcount_transfn", + "file": "meos.h", + "returnType": { + "c": "SkipList *", + "canonical": "struct SkipList *" + }, + "params": [ + { + "name": "state", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "tstzspan_tcount_transfn", + "file": "meos.h", + "returnType": { + "c": "SkipList *", + "canonical": "struct SkipList *" + }, + "params": [ + { + "name": "state", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "tstzspanset_tcount_transfn", + "file": "meos.h", + "returnType": { + "c": "SkipList *", + "canonical": "struct SkipList *" + }, + "params": [ + { + "name": "state", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "temporal_merge_transfn", + "file": "meos.h", + "returnType": { + "c": "SkipList *", + "canonical": "struct SkipList *" + }, + "params": [ + { + "name": "state", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "temporal_merge_combinefn", + "file": "meos.h", + "returnType": { + "c": "SkipList *", + "canonical": "struct SkipList *" + }, + "params": [ + { + "name": "state1", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "state2", + "cType": "SkipList *", + "canonical": "struct SkipList *" + } + ] + }, + { + "name": "ttext_tmax_transfn", + "file": "meos.h", + "returnType": { + "c": "SkipList *", + "canonical": "struct SkipList *" + }, + "params": [ + { + "name": "state", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ttext_tmax_combinefn", + "file": "meos.h", + "returnType": { + "c": "SkipList *", + "canonical": "struct SkipList *" + }, + "params": [ + { + "name": "state1", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "state2", + "cType": "SkipList *", + "canonical": "struct SkipList *" + } + ] + }, + { + "name": "ttext_tmin_transfn", + "file": "meos.h", + "returnType": { + "c": "SkipList *", + "canonical": "struct SkipList *" + }, + "params": [ + { + "name": "state", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ttext_tmin_combinefn", + "file": "meos.h", + "returnType": { + "c": "SkipList *", + "canonical": "struct SkipList *" + }, + "params": [ + { + "name": "state1", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "state2", + "cType": "SkipList *", + "canonical": "struct SkipList *" + } + ] + }, + { + "name": "temporal_simplify_dp", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "dist", + "cType": "double", + "canonical": "double" + }, + { + "name": "synchronized", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "temporal_simplify_max_dist", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "dist", + "cType": "double", + "canonical": "double" + }, + { + "name": "synchronized", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "temporal_simplify_min_dist", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "dist", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "temporal_simplify_min_tdelta", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "mint", + "cType": "const Interval *", + "canonical": "const Interval *" + } + ] + }, + { + "name": "temporal_tprecision", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "duration", + "cType": "const Interval *", + "canonical": "const Interval *" + }, + { + "name": "origin", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "temporal_tsample", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "duration", + "cType": "const Interval *", + "canonical": "const Interval *" + }, + { + "name": "origin", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "temporal_dyntimewarp_distance", + "file": "meos.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "temporal_dyntimewarp_path", + "file": "meos.h", + "returnType": { + "c": "Match *", + "canonical": "Match *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "temporal_frechet_distance", + "file": "meos.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "temporal_frechet_path", + "file": "meos.h", + "returnType": { + "c": "Match *", + "canonical": "Match *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "temporal_hausdorff_distance", + "file": "meos.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "temporal_ext_kalman_filter", + "file": "meos.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gate", + "cType": "double", + "canonical": "double" + }, + { + "name": "q", + "cType": "double", + "canonical": "double" + }, + { + "name": "variance", + "cType": "double", + "canonical": "double" + }, + { + "name": "to_drop", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "temporal_time_bins", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "duration", + "cType": "const Interval *", + "canonical": "const Interval *" + }, + { + "name": "origin", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "temporal_time_split", + "file": "meos.h", + "returnType": { + "c": "Temporal **", + "canonical": "Temporal **" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "duration", + "cType": "const Interval *", + "canonical": "const Interval *" + }, + { + "name": "torigin", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "time_bins", + "cType": "TimestampTz **", + "canonical": "long **" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tfloat_time_boxes", + "file": "meos.h", + "returnType": { + "c": "TBox *", + "canonical": "TBox *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "duration", + "cType": "const Interval *", + "canonical": "const Interval *" + }, + { + "name": "torigin", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tfloat_value_bins", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "vsize", + "cType": "double", + "canonical": "double" + }, + { + "name": "vorigin", + "cType": "double", + "canonical": "double" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tfloat_value_boxes", + "file": "meos.h", + "returnType": { + "c": "TBox *", + "canonical": "TBox *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "vsize", + "cType": "double", + "canonical": "double" + }, + { + "name": "vorigin", + "cType": "double", + "canonical": "double" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tfloat_value_split", + "file": "meos.h", + "returnType": { + "c": "Temporal **", + "canonical": "Temporal **" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "size", + "cType": "double", + "canonical": "double" + }, + { + "name": "origin", + "cType": "double", + "canonical": "double" + }, + { + "name": "bins", + "cType": "double **", + "canonical": "double **" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tfloat_value_time_boxes", + "file": "meos.h", + "returnType": { + "c": "TBox *", + "canonical": "TBox *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "vsize", + "cType": "double", + "canonical": "double" + }, + { + "name": "duration", + "cType": "const Interval *", + "canonical": "const Interval *" + }, + { + "name": "vorigin", + "cType": "double", + "canonical": "double" + }, + { + "name": "torigin", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tfloat_value_time_split", + "file": "meos.h", + "returnType": { + "c": "Temporal **", + "canonical": "Temporal **" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "vsize", + "cType": "double", + "canonical": "double" + }, + { + "name": "duration", + "cType": "const Interval *", + "canonical": "const Interval *" + }, + { + "name": "vorigin", + "cType": "double", + "canonical": "double" + }, + { + "name": "torigin", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "value_bins", + "cType": "double **", + "canonical": "double **" + }, + { + "name": "time_bins", + "cType": "TimestampTz **", + "canonical": "long **" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tfloatbox_time_tiles", + "file": "meos.h", + "returnType": { + "c": "TBox *", + "canonical": "TBox *" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const TBox *" + }, + { + "name": "duration", + "cType": "const Interval *", + "canonical": "const Interval *" + }, + { + "name": "torigin", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tfloatbox_value_tiles", + "file": "meos.h", + "returnType": { + "c": "TBox *", + "canonical": "TBox *" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const TBox *" + }, + { + "name": "vsize", + "cType": "double", + "canonical": "double" + }, + { + "name": "vorigin", + "cType": "double", + "canonical": "double" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tfloatbox_value_time_tiles", + "file": "meos.h", + "returnType": { + "c": "TBox *", + "canonical": "TBox *" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const TBox *" + }, + { + "name": "vsize", + "cType": "double", + "canonical": "double" + }, + { + "name": "duration", + "cType": "const Interval *", + "canonical": "const Interval *" + }, + { + "name": "vorigin", + "cType": "double", + "canonical": "double" + }, + { + "name": "torigin", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tint_time_boxes", + "file": "meos.h", + "returnType": { + "c": "TBox *", + "canonical": "TBox *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "duration", + "cType": "const Interval *", + "canonical": "const Interval *" + }, + { + "name": "torigin", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tint_value_bins", + "file": "meos.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "vsize", + "cType": "int", + "canonical": "int" + }, + { + "name": "vorigin", + "cType": "int", + "canonical": "int" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tint_value_boxes", + "file": "meos.h", + "returnType": { + "c": "TBox *", + "canonical": "TBox *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "vsize", + "cType": "int", + "canonical": "int" + }, + { + "name": "vorigin", + "cType": "int", + "canonical": "int" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tint_value_split", + "file": "meos.h", + "returnType": { + "c": "Temporal **", + "canonical": "Temporal **" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "vsize", + "cType": "int", + "canonical": "int" + }, + { + "name": "vorigin", + "cType": "int", + "canonical": "int" + }, + { + "name": "bins", + "cType": "int **", + "canonical": "int **" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tint_value_time_boxes", + "file": "meos.h", + "returnType": { + "c": "TBox *", + "canonical": "TBox *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "vsize", + "cType": "int", + "canonical": "int" + }, + { + "name": "duration", + "cType": "const Interval *", + "canonical": "const Interval *" + }, + { + "name": "vorigin", + "cType": "int", + "canonical": "int" + }, + { + "name": "torigin", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tint_value_time_split", + "file": "meos.h", + "returnType": { + "c": "Temporal **", + "canonical": "Temporal **" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "size", + "cType": "int", + "canonical": "int" + }, + { + "name": "duration", + "cType": "const Interval *", + "canonical": "const Interval *" + }, + { + "name": "vorigin", + "cType": "int", + "canonical": "int" + }, + { + "name": "torigin", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "value_bins", + "cType": "int **", + "canonical": "int **" + }, + { + "name": "time_bins", + "cType": "TimestampTz **", + "canonical": "long **" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tintbox_time_tiles", + "file": "meos.h", + "returnType": { + "c": "TBox *", + "canonical": "TBox *" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const TBox *" + }, + { + "name": "duration", + "cType": "const Interval *", + "canonical": "const Interval *" + }, + { + "name": "torigin", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tintbox_value_tiles", + "file": "meos.h", + "returnType": { + "c": "TBox *", + "canonical": "TBox *" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const TBox *" + }, + { + "name": "xsize", + "cType": "int", + "canonical": "int" + }, + { + "name": "xorigin", + "cType": "int", + "canonical": "int" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tintbox_value_time_tiles", + "file": "meos.h", + "returnType": { + "c": "TBox *", + "canonical": "TBox *" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const TBox *" + }, + { + "name": "xsize", + "cType": "int", + "canonical": "int" + }, + { + "name": "duration", + "cType": "const Interval *", + "canonical": "const Interval *" + }, + { + "name": "xorigin", + "cType": "int", + "canonical": "int" + }, + { + "name": "torigin", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "box3d_from_gbox", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "box", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "box3d_make", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "xmin", + "cType": "double", + "canonical": "double" + }, + { + "name": "xmax", + "cType": "double", + "canonical": "double" + }, + { + "name": "ymin", + "cType": "double", + "canonical": "double" + }, + { + "name": "ymax", + "cType": "double", + "canonical": "double" + }, + { + "name": "zmin", + "cType": "double", + "canonical": "double" + }, + { + "name": "zmax", + "cType": "double", + "canonical": "double" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + } + ] + }, + { + "name": "box3d_in", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "box3d_out", + "file": "meos_geo.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "box", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "gbox_make", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "hasz", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "hasm", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "geodetic", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "xmin", + "cType": "double", + "canonical": "double" + }, + { + "name": "xmax", + "cType": "double", + "canonical": "double" + }, + { + "name": "ymin", + "cType": "double", + "canonical": "double" + }, + { + "name": "ymax", + "cType": "double", + "canonical": "double" + }, + { + "name": "zmin", + "cType": "double", + "canonical": "double" + }, + { + "name": "zmax", + "cType": "double", + "canonical": "double" + }, + { + "name": "mmin", + "cType": "double", + "canonical": "double" + }, + { + "name": "mmax", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "gbox_in", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "gbox_out", + "file": "meos_geo.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "box", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "geo_as_ewkb", + "file": "meos_geo.h", + "returnType": { + "c": "uint8_t *", + "canonical": "unsigned char *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "endian", + "cType": "const char *", + "canonical": "const char *" + }, + { + "name": "size", + "cType": "size_t *", + "canonical": "unsigned long *" + } + ] + }, + { + "name": "geo_as_ewkt", + "file": "meos_geo.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "precision", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "geo_as_geojson", + "file": "meos_geo.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "option", + "cType": "int", + "canonical": "int" + }, + { + "name": "precision", + "cType": "int", + "canonical": "int" + }, + { + "name": "srs", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "geo_as_hexewkb", + "file": "meos_geo.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "endian", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "geo_as_text", + "file": "meos_geo.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "precision", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "geo_from_ewkb", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "wkb", + "cType": "const uint8_t *", + "canonical": "const unsigned char *" + }, + { + "name": "wkb_size", + "cType": "size_t", + "canonical": "unsigned long" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + } + ] + }, + { + "name": "geo_from_geojson", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "geojson", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "geo_from_text", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "wkt", + "cType": "const char *", + "canonical": "const char *" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + } + ] + }, + { + "name": "geo_out", + "file": "meos_geo.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "geog_from_hexewkb", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "wkt", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "geog_in", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + }, + { + "name": "typmod", + "cType": "int32", + "canonical": "int" + } + ] + }, + { + "name": "geom_from_hexewkb", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "wkt", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "geom_in", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + }, + { + "name": "typmod", + "cType": "int32", + "canonical": "int" + } + ] + }, + { + "name": "geo_copy", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "geogpoint_make2d", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + }, + { + "name": "x", + "cType": "double", + "canonical": "double" + }, + { + "name": "y", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "geogpoint_make3dz", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + }, + { + "name": "x", + "cType": "double", + "canonical": "double" + }, + { + "name": "y", + "cType": "double", + "canonical": "double" + }, + { + "name": "z", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "geompoint_make2d", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + }, + { + "name": "x", + "cType": "double", + "canonical": "double" + }, + { + "name": "y", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "geompoint_make3dz", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + }, + { + "name": "x", + "cType": "double", + "canonical": "double" + }, + { + "name": "y", + "cType": "double", + "canonical": "double" + }, + { + "name": "z", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "geom_to_geog", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "geom", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "geog_to_geom", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "geog", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "geo_is_empty", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "geo_is_unitary", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "geo_typename", + "file": "meos_geo.h", + "returnType": { + "c": "const char *", + "canonical": "const char *" + }, + "params": [ + { + "name": "type", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "geog_area", + "file": "meos_geo.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "use_spheroid", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "geog_centroid", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "use_spheroid", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "geog_length", + "file": "meos_geo.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "use_spheroid", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "geog_perimeter", + "file": "meos_geo.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "use_spheroid", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "geom_azimuth", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "gs1", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "gs2", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "result", + "cType": "double *", + "canonical": "double *" + } + ] + }, + { + "name": "geom_length", + "file": "meos_geo.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "geom_perimeter", + "file": "meos_geo.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "line_numpoints", + "file": "meos_geo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "line_point_n", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "geom", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "n", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "geo_reverse", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "geo_round", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "geo_set_srid", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + } + ] + }, + { + "name": "geo_srid", + "file": "meos_geo.h", + "returnType": { + "c": "int32_t", + "canonical": "int" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "geo_transform", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "geom", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "srid_to", + "cType": "int32_t", + "canonical": "int" + } + ] + }, + { + "name": "geo_transform_pipeline", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "pipeline", + "cType": "char *", + "canonical": "char *" + }, + { + "name": "srid_to", + "cType": "int32_t", + "canonical": "int" + }, + { + "name": "is_forward", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "geo_collect_garray", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "gsarr", + "cType": "int **", + "canonical": "int **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "geo_makeline_garray", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "gsarr", + "cType": "int **", + "canonical": "int **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "geo_num_points", + "file": "meos_geo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "geo_num_geos", + "file": "meos_geo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "geo_geo_n", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "geom", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "n", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "geo_pointarr", + "file": "meos_geo.h", + "returnType": { + "c": "int **", + "canonical": "int **" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "geo_points", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "geom_array_union", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "gsarr", + "cType": "int **", + "canonical": "int **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "geom_boundary", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "geom_buffer", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "size", + "cType": "double", + "canonical": "double" + }, + { + "name": "params", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "geom_centroid", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "geom_convex_hull", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "geom_difference2d", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "gs1", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "gs2", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "geom_intersection2d", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "gs1", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "gs2", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "geom_intersection2d_coll", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "gs1", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "gs2", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "geom_min_bounding_radius", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "geom", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "radius", + "cType": "double *", + "canonical": "double *" + } + ] + }, + { + "name": "geom_shortestline2d", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "gs1", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "gs2", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "geom_shortestline3d", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "gs1", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "gs2", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "geom_unary_union", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "prec", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "line_interpolate_point", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "distance_fraction", + "cType": "double", + "canonical": "double" + }, + { + "name": "repeat", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "line_locate_point", + "file": "meos_geo.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "gs1", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "gs2", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "line_substring", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "from", + "cType": "double", + "canonical": "double" + }, + { + "name": "to", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "geog_dwithin", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "g1", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "g2", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "tolerance", + "cType": "double", + "canonical": "double" + }, + { + "name": "use_spheroid", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "geog_intersects", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "gs1", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "gs2", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "use_spheroid", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "geom_contains", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "gs1", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "gs2", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "geom_covers", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "gs1", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "gs2", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "geom_disjoint2d", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "gs1", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "gs2", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "geom_dwithin", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "gs1", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "gs2", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "tolerance", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "geom_dwithin2d", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "gs1", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "gs2", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "tolerance", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "geom_dwithin3d", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "gs1", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "gs2", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "tolerance", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "geom_intersects", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "gs1", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "gs2", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "geom_intersects2d", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "gs1", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "gs2", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "geom_intersects3d", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "gs1", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "gs2", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "geom_relate_pattern", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "gs1", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "gs2", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "patt", + "cType": "char *", + "canonical": "char *" + } + ] + }, + { + "name": "geom_touches", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "gs1", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "gs2", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "geo_stboxes", + "file": "meos_geo.h", + "returnType": { + "c": "STBox *", + "canonical": "STBox *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "geo_split_each_n_stboxes", + "file": "meos_geo.h", + "returnType": { + "c": "STBox *", + "canonical": "STBox *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "elem_count", + "cType": "int", + "canonical": "int" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "geo_split_n_stboxes", + "file": "meos_geo.h", + "returnType": { + "c": "STBox *", + "canonical": "STBox *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "box_count", + "cType": "int", + "canonical": "int" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "geog_distance", + "file": "meos_geo.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "g1", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "g2", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "geom_distance2d", + "file": "meos_geo.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "gs1", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "gs2", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "geom_distance3d", + "file": "meos_geo.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "gs1", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "gs2", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "geo_equals", + "file": "meos_geo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "gs1", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "gs2", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "geo_same", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "gs1", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "gs2", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "geogset_in", + "file": "meos_geo.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "geomset_in", + "file": "meos_geo.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "spatialset_out", + "file": "meos_geo.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "spatialset_as_text", + "file": "meos_geo.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "set", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "spatialset_as_ewkt", + "file": "meos_geo.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "set", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "geoset_make", + "file": "meos_geo.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "values", + "cType": "int **", + "canonical": "int **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "geo_to_set", + "file": "meos_geo.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "geoset_end_value", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "geoset_start_value", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "geoset_value_n", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "n", + "cType": "int", + "canonical": "int" + }, + { + "name": "result", + "cType": "int **", + "canonical": "int **" + } + ] + }, + { + "name": "geoset_values", + "file": "meos_geo.h", + "returnType": { + "c": "int **", + "canonical": "int **" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "contained_geo_set", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "contains_set_geo", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "gs", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "geo_union_transfn", + "file": "meos_geo.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "state", + "cType": "Set *", + "canonical": "Set *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "intersection_geo_set", + "file": "meos_geo.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "intersection_set_geo", + "file": "meos_geo.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "minus_geo_set", + "file": "meos_geo.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "minus_set_geo", + "file": "meos_geo.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "union_geo_set", + "file": "meos_geo.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "union_set_geo", + "file": "meos_geo.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "spatialset_set_srid", + "file": "meos_geo.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + } + ] + }, + { + "name": "spatialset_srid", + "file": "meos_geo.h", + "returnType": { + "c": "int32_t", + "canonical": "int" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "spatialset_transform", + "file": "meos_geo.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + } + ] + }, + { + "name": "spatialset_transform_pipeline", + "file": "meos_geo.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "pipelinestr", + "cType": "const char *", + "canonical": "const char *" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + }, + { + "name": "is_forward", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "stbox_as_hexwkb", + "file": "meos_geo.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "variant", + "cType": "uint8_t", + "canonical": "unsigned char" + }, + { + "name": "size", + "cType": "size_t *", + "canonical": "unsigned long *" + } + ] + }, + { + "name": "stbox_as_wkb", + "file": "meos_geo.h", + "returnType": { + "c": "uint8_t *", + "canonical": "unsigned char *" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "variant", + "cType": "uint8_t", + "canonical": "unsigned char" + }, + { + "name": "size_out", + "cType": "size_t *", + "canonical": "unsigned long *" + } + ] + }, + { + "name": "stbox_from_hexwkb", + "file": "meos_geo.h", + "returnType": { + "c": "STBox *", + "canonical": "STBox *" + }, + "params": [ + { + "name": "hexwkb", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "stbox_from_wkb", + "file": "meos_geo.h", + "returnType": { + "c": "STBox *", + "canonical": "STBox *" + }, + "params": [ + { + "name": "wkb", + "cType": "const uint8_t *", + "canonical": "const unsigned char *" + }, + { + "name": "size", + "cType": "size_t", + "canonical": "unsigned long" + } + ] + }, + { + "name": "stbox_in", + "file": "meos_geo.h", + "returnType": { + "c": "STBox *", + "canonical": "STBox *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "stbox_out", + "file": "meos_geo.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "geo_timestamptz_to_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "STBox *", + "canonical": "STBox *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "geo_tstzspan_to_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "STBox *", + "canonical": "STBox *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "stbox_copy", + "file": "meos_geo.h", + "returnType": { + "c": "STBox *", + "canonical": "STBox *" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + } + ] + }, + { + "name": "stbox_make", + "file": "meos_geo.h", + "returnType": { + "c": "STBox *", + "canonical": "STBox *" + }, + "params": [ + { + "name": "hasx", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "hasz", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "geodetic", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + }, + { + "name": "xmin", + "cType": "double", + "canonical": "double" + }, + { + "name": "xmax", + "cType": "double", + "canonical": "double" + }, + { + "name": "ymin", + "cType": "double", + "canonical": "double" + }, + { + "name": "ymax", + "cType": "double", + "canonical": "double" + }, + { + "name": "zmin", + "cType": "double", + "canonical": "double" + }, + { + "name": "zmax", + "cType": "double", + "canonical": "double" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "geo_to_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "STBox *", + "canonical": "STBox *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "spatialset_to_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "STBox *", + "canonical": "STBox *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "stbox_to_box3d", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + } + ] + }, + { + "name": "stbox_to_gbox", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + } + ] + }, + { + "name": "stbox_to_geo", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + } + ] + }, + { + "name": "stbox_to_tstzspan", + "file": "meos_geo.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + } + ] + }, + { + "name": "timestamptz_to_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "STBox *", + "canonical": "STBox *" + }, + "params": [ + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "tstzset_to_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "STBox *", + "canonical": "STBox *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "tstzspan_to_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "STBox *", + "canonical": "STBox *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "tstzspanset_to_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "STBox *", + "canonical": "STBox *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "stbox_area", + "file": "meos_geo.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "spheroid", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "stbox_hash", + "file": "meos_geo.h", + "returnType": { + "c": "uint32", + "canonical": "unsigned int" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + } + ] + }, + { + "name": "stbox_hash_extended", + "file": "meos_geo.h", + "returnType": { + "c": "uint64", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "seed", + "cType": "uint64", + "canonical": "unsigned long" + } + ] + }, + { + "name": "stbox_hast", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + } + ] + }, + { + "name": "stbox_hasx", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + } + ] + }, + { + "name": "stbox_hasz", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + } + ] + }, + { + "name": "stbox_isgeodetic", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + } + ] + }, + { + "name": "stbox_perimeter", + "file": "meos_geo.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "spheroid", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "stbox_tmax", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "result", + "cType": "TimestampTz *", + "canonical": "long *" + } + ] + }, + { + "name": "stbox_tmax_inc", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "result", + "cType": "bool *", + "canonical": "_Bool *" + } + ] + }, + { + "name": "stbox_tmin", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "result", + "cType": "TimestampTz *", + "canonical": "long *" + } + ] + }, + { + "name": "stbox_tmin_inc", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "result", + "cType": "bool *", + "canonical": "_Bool *" + } + ] + }, + { + "name": "stbox_volume", + "file": "meos_geo.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + } + ] + }, + { + "name": "stbox_xmax", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "result", + "cType": "double *", + "canonical": "double *" + } + ] + }, + { + "name": "stbox_xmin", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "result", + "cType": "double *", + "canonical": "double *" + } + ] + }, + { + "name": "stbox_ymax", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "result", + "cType": "double *", + "canonical": "double *" + } + ] + }, + { + "name": "stbox_ymin", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "result", + "cType": "double *", + "canonical": "double *" + } + ] + }, + { + "name": "stbox_zmax", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "result", + "cType": "double *", + "canonical": "double *" + } + ] + }, + { + "name": "stbox_zmin", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "result", + "cType": "double *", + "canonical": "double *" + } + ] + }, + { + "name": "stbox_expand_space", + "file": "meos_geo.h", + "returnType": { + "c": "STBox *", + "canonical": "STBox *" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "stbox_expand_time", + "file": "meos_geo.h", + "returnType": { + "c": "STBox *", + "canonical": "STBox *" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "interv", + "cType": "const Interval *", + "canonical": "const Interval *" + } + ] + }, + { + "name": "stbox_get_space", + "file": "meos_geo.h", + "returnType": { + "c": "STBox *", + "canonical": "STBox *" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + } + ] + }, + { + "name": "stbox_quad_split", + "file": "meos_geo.h", + "returnType": { + "c": "STBox *", + "canonical": "STBox *" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "stbox_round", + "file": "meos_geo.h", + "returnType": { + "c": "STBox *", + "canonical": "STBox *" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "stbox_shift_scale_time", + "file": "meos_geo.h", + "returnType": { + "c": "STBox *", + "canonical": "STBox *" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "shift", + "cType": "const Interval *", + "canonical": "const Interval *" + }, + { + "name": "duration", + "cType": "const Interval *", + "canonical": "const Interval *" + } + ] + }, + { + "name": "stboxarr_round", + "file": "meos_geo.h", + "returnType": { + "c": "STBox *", + "canonical": "STBox *" + }, + "params": [ + { + "name": "boxarr", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "stbox_set_srid", + "file": "meos_geo.h", + "returnType": { + "c": "STBox *", + "canonical": "STBox *" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + } + ] + }, + { + "name": "stbox_srid", + "file": "meos_geo.h", + "returnType": { + "c": "int32_t", + "canonical": "int" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + } + ] + }, + { + "name": "stbox_transform", + "file": "meos_geo.h", + "returnType": { + "c": "STBox *", + "canonical": "STBox *" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + } + ] + }, + { + "name": "stbox_transform_pipeline", + "file": "meos_geo.h", + "returnType": { + "c": "STBox *", + "canonical": "STBox *" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "pipelinestr", + "cType": "const char *", + "canonical": "const char *" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + }, + { + "name": "is_forward", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "adjacent_stbox_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "box2", + "cType": "const STBox *", + "canonical": "const STBox *" + } + ] + }, + { + "name": "contained_stbox_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "box2", + "cType": "const STBox *", + "canonical": "const STBox *" + } + ] + }, + { + "name": "contains_stbox_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "box2", + "cType": "const STBox *", + "canonical": "const STBox *" + } + ] + }, + { + "name": "overlaps_stbox_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "box2", + "cType": "const STBox *", + "canonical": "const STBox *" + } + ] + }, + { + "name": "same_stbox_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "box2", + "cType": "const STBox *", + "canonical": "const STBox *" + } + ] + }, + { + "name": "above_stbox_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "box2", + "cType": "const STBox *", + "canonical": "const STBox *" + } + ] + }, + { + "name": "after_stbox_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "box2", + "cType": "const STBox *", + "canonical": "const STBox *" + } + ] + }, + { + "name": "back_stbox_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "box2", + "cType": "const STBox *", + "canonical": "const STBox *" + } + ] + }, + { + "name": "before_stbox_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "box2", + "cType": "const STBox *", + "canonical": "const STBox *" + } + ] + }, + { + "name": "below_stbox_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "box2", + "cType": "const STBox *", + "canonical": "const STBox *" + } + ] + }, + { + "name": "front_stbox_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "box2", + "cType": "const STBox *", + "canonical": "const STBox *" + } + ] + }, + { + "name": "left_stbox_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "box2", + "cType": "const STBox *", + "canonical": "const STBox *" + } + ] + }, + { + "name": "overabove_stbox_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "box2", + "cType": "const STBox *", + "canonical": "const STBox *" + } + ] + }, + { + "name": "overafter_stbox_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "box2", + "cType": "const STBox *", + "canonical": "const STBox *" + } + ] + }, + { + "name": "overback_stbox_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "box2", + "cType": "const STBox *", + "canonical": "const STBox *" + } + ] + }, + { + "name": "overbefore_stbox_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "box2", + "cType": "const STBox *", + "canonical": "const STBox *" + } + ] + }, + { + "name": "overbelow_stbox_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "box2", + "cType": "const STBox *", + "canonical": "const STBox *" + } + ] + }, + { + "name": "overfront_stbox_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "box2", + "cType": "const STBox *", + "canonical": "const STBox *" + } + ] + }, + { + "name": "overleft_stbox_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "box2", + "cType": "const STBox *", + "canonical": "const STBox *" + } + ] + }, + { + "name": "overright_stbox_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "box2", + "cType": "const STBox *", + "canonical": "const STBox *" + } + ] + }, + { + "name": "right_stbox_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "box2", + "cType": "const STBox *", + "canonical": "const STBox *" + } + ] + }, + { + "name": "union_stbox_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "STBox *", + "canonical": "STBox *" + }, + "params": [ + { + "name": "box1", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "box2", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "strict", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "intersection_stbox_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "STBox *", + "canonical": "STBox *" + }, + "params": [ + { + "name": "box1", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "box2", + "cType": "const STBox *", + "canonical": "const STBox *" + } + ] + }, + { + "name": "stbox_cmp", + "file": "meos_geo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "box1", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "box2", + "cType": "const STBox *", + "canonical": "const STBox *" + } + ] + }, + { + "name": "stbox_eq", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "box2", + "cType": "const STBox *", + "canonical": "const STBox *" + } + ] + }, + { + "name": "stbox_ge", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "box2", + "cType": "const STBox *", + "canonical": "const STBox *" + } + ] + }, + { + "name": "stbox_gt", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "box2", + "cType": "const STBox *", + "canonical": "const STBox *" + } + ] + }, + { + "name": "stbox_le", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "box2", + "cType": "const STBox *", + "canonical": "const STBox *" + } + ] + }, + { + "name": "stbox_lt", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "box2", + "cType": "const STBox *", + "canonical": "const STBox *" + } + ] + }, + { + "name": "stbox_ne", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "box2", + "cType": "const STBox *", + "canonical": "const STBox *" + } + ] + }, + { + "name": "tspatial_out", + "file": "meos_geo.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "tgeogpoint_from_mfjson", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "tgeogpoint_in", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "tgeography_from_mfjson", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "mfjson", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "tgeography_in", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "tgeometry_from_mfjson", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "tgeometry_in", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "tgeompoint_from_mfjson", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "tgeompoint_in", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "tspatial_as_ewkt", + "file": "meos_geo.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "tspatial_as_text", + "file": "meos_geo.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "tgeo_from_base_temp", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tgeoinst_make", + "file": "meos_geo.h", + "returnType": { + "c": "TInstant *", + "canonical": "TInstant *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "tgeoseq_from_base_tstzset", + "file": "meos_geo.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "tgeoseq_from_base_tstzspan", + "file": "meos_geo.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "tgeoseqset_from_base_tstzspanset", + "file": "meos_geo.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "tpoint_from_base_temp", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tpointinst_make", + "file": "meos_geo.h", + "returnType": { + "c": "TInstant *", + "canonical": "TInstant *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "tpointseq_from_base_tstzset", + "file": "meos_geo.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "tpointseq_from_base_tstzspan", + "file": "meos_geo.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "tpointseq_make_coords", + "file": "meos_geo.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "xcoords", + "cType": "const double *", + "canonical": "const double *" + }, + { + "name": "ycoords", + "cType": "const double *", + "canonical": "const double *" + }, + { + "name": "zcoords", + "cType": "const double *", + "canonical": "const double *" + }, + { + "name": "times", + "cType": "const TimestampTz *", + "canonical": "const long *" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + }, + { + "name": "geodetic", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "lower_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "upper_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + }, + { + "name": "normalize", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tpointseqset_from_base_tstzspanset", + "file": "meos_geo.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "box3d_to_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "STBox *", + "canonical": "STBox *" + }, + "params": [ + { + "name": "box", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "gbox_to_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "STBox *", + "canonical": "STBox *" + }, + "params": [ + { + "name": "box", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "geomeas_to_tpoint", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "tgeogpoint_to_tgeography", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tgeography_to_tgeogpoint", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tgeography_to_tgeometry", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tgeometry_to_tgeography", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tgeometry_to_tgeompoint", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tgeompoint_to_tgeometry", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tpoint_as_mvtgeom", + "file": "meos_geo.h", + "returnType": { + "c": "MvtGeom", + "canonical": "struct MvtGeom" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "bounds", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "extent", + "cType": "int32_t", + "canonical": "int" + }, + { + "name": "buffer", + "cType": "int32_t", + "canonical": "int" + }, + { + "name": "clip_geom", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tpoint_tfloat_to_geomeas", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "tpoint", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "measure", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "segmentize", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "result", + "cType": "int **", + "canonical": "int **" + } + ] + }, + { + "name": "tspatial_to_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "STBox *", + "canonical": "STBox *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "bearing_point_point", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "gs1", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "gs2", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "result", + "cType": "double *", + "canonical": "double *" + } + ] + }, + { + "name": "bearing_tpoint_point", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "invert", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "bearing_tpoint_tpoint", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tgeo_centroid", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tgeo_convex_hull", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tgeo_end_value", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tgeo_start_value", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tgeo_traversed_area", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "unary_union", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tgeo_value_at_timestamptz", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "strict", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "result", + "cType": "int **", + "canonical": "int **" + } + ] + }, + { + "name": "tgeo_value_n", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "n", + "cType": "int", + "canonical": "int" + }, + { + "name": "result", + "cType": "int **", + "canonical": "int **" + } + ] + }, + { + "name": "tgeo_values", + "file": "meos_geo.h", + "returnType": { + "c": "int **", + "canonical": "int **" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tpoint_angular_difference", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tpoint_azimuth", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tpoint_cumulative_length", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tpoint_direction", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "result", + "cType": "double *", + "canonical": "double *" + } + ] + }, + { + "name": "tpoint_get_x", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tpoint_get_y", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tpoint_get_z", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tpoint_is_simple", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tpoint_length", + "file": "meos_geo.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tpoint_speed", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ], + "ownership": "caller", + "nullable": true, + "doc": "Computes the instantaneous speed of a temporal point.", + "meos": { + "temporalDim": "sequence", + "spatialDim": null, + "interpolation": true, + "subtype": "TPoint" + } + }, + { + "name": "tpoint_trajectory", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "unary_union", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tpoint_twcentroid", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tgeo_affine", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "a", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "tgeo_scale", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "scale", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "sorigin", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "tpoint_make_simple", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal **", + "canonical": "Temporal **" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tspatial_srid", + "file": "meos_geo.h", + "returnType": { + "c": "int32_t", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tspatial_set_srid", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + } + ] + }, + { + "name": "tspatial_transform", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + } + ] + }, + { + "name": "tspatial_transform_pipeline", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "pipelinestr", + "cType": "const char *", + "canonical": "const char *" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + }, + { + "name": "is_forward", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tgeo_at_geom", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "tgeo_at_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "border_inc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tgeo_at_value", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tgeo_minus_geom", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "tgeo_minus_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "border_inc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tgeo_minus_value", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tpoint_at_elevation", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "tpoint_at_geom", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "tpoint_at_value", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tpoint_minus_elevation", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "tpoint_minus_geom", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "tpoint_minus_value", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "always_eq_geo_tgeo", + "file": "meos_geo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_eq_tgeo_geo", + "file": "meos_geo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "always_eq_tgeo_tgeo", + "file": "meos_geo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_ne_geo_tgeo", + "file": "meos_geo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_ne_tgeo_geo", + "file": "meos_geo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "always_ne_tgeo_tgeo", + "file": "meos_geo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_eq_geo_tgeo", + "file": "meos_geo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_eq_tgeo_geo", + "file": "meos_geo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "ever_eq_tgeo_tgeo", + "file": "meos_geo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_ne_geo_tgeo", + "file": "meos_geo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_ne_tgeo_geo", + "file": "meos_geo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "ever_ne_tgeo_tgeo", + "file": "meos_geo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "teq_geo_tgeo", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "teq_tgeo_geo", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "tne_geo_tgeo", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tne_tgeo_geo", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "tgeo_stboxes", + "file": "meos_geo.h", + "returnType": { + "c": "STBox *", + "canonical": "STBox *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tgeo_space_boxes", + "file": "meos_geo.h", + "returnType": { + "c": "STBox *", + "canonical": "STBox *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "xsize", + "cType": "double", + "canonical": "double" + }, + { + "name": "ysize", + "cType": "double", + "canonical": "double" + }, + { + "name": "zsize", + "cType": "double", + "canonical": "double" + }, + { + "name": "sorigin", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "bitmatrix", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "border_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tgeo_space_time_boxes", + "file": "meos_geo.h", + "returnType": { + "c": "STBox *", + "canonical": "STBox *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "xsize", + "cType": "double", + "canonical": "double" + }, + { + "name": "ysize", + "cType": "double", + "canonical": "double" + }, + { + "name": "zsize", + "cType": "double", + "canonical": "double" + }, + { + "name": "duration", + "cType": "const Interval *", + "canonical": "const Interval *" + }, + { + "name": "sorigin", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "torigin", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "bitmatrix", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "border_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tgeo_split_each_n_stboxes", + "file": "meos_geo.h", + "returnType": { + "c": "STBox *", + "canonical": "STBox *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "elem_count", + "cType": "int", + "canonical": "int" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tgeo_split_n_stboxes", + "file": "meos_geo.h", + "returnType": { + "c": "STBox *", + "canonical": "STBox *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box_count", + "cType": "int", + "canonical": "int" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "adjacent_stbox_tspatial", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "adjacent_tspatial_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + } + ] + }, + { + "name": "adjacent_tspatial_tspatial", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "contained_stbox_tspatial", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "contained_tspatial_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + } + ] + }, + { + "name": "contained_tspatial_tspatial", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "contains_stbox_tspatial", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "contains_tspatial_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + } + ] + }, + { + "name": "contains_tspatial_tspatial", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "overlaps_stbox_tspatial", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "overlaps_tspatial_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + } + ] + }, + { + "name": "overlaps_tspatial_tspatial", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "same_stbox_tspatial", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "same_tspatial_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + } + ] + }, + { + "name": "same_tspatial_tspatial", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "above_stbox_tspatial", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "above_tspatial_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + } + ] + }, + { + "name": "above_tspatial_tspatial", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "after_stbox_tspatial", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "after_tspatial_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + } + ] + }, + { + "name": "after_tspatial_tspatial", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "back_stbox_tspatial", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "back_tspatial_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + } + ] + }, + { + "name": "back_tspatial_tspatial", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "before_stbox_tspatial", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "before_tspatial_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + } + ] + }, + { + "name": "before_tspatial_tspatial", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "below_stbox_tspatial", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "below_tspatial_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + } + ] + }, + { + "name": "below_tspatial_tspatial", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "front_stbox_tspatial", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "front_tspatial_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + } + ] + }, + { + "name": "front_tspatial_tspatial", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "left_stbox_tspatial", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "left_tspatial_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + } + ] + }, + { + "name": "left_tspatial_tspatial", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "overabove_stbox_tspatial", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "overabove_tspatial_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + } + ] + }, + { + "name": "overabove_tspatial_tspatial", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "overafter_stbox_tspatial", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "overafter_tspatial_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + } + ] + }, + { + "name": "overafter_tspatial_tspatial", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "overback_stbox_tspatial", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "overback_tspatial_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + } + ] + }, + { + "name": "overback_tspatial_tspatial", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "overbefore_stbox_tspatial", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "overbefore_tspatial_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + } + ] + }, + { + "name": "overbefore_tspatial_tspatial", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "overbelow_stbox_tspatial", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "overbelow_tspatial_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + } + ] + }, + { + "name": "overbelow_tspatial_tspatial", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "overfront_stbox_tspatial", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "overfront_tspatial_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + } + ] + }, + { + "name": "overfront_tspatial_tspatial", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "overleft_stbox_tspatial", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "overleft_tspatial_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + } + ] + }, + { + "name": "overleft_tspatial_tspatial", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "overright_stbox_tspatial", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "overright_tspatial_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + } + ] + }, + { + "name": "overright_tspatial_tspatial", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "right_stbox_tspatial", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "right_tspatial_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + } + ] + }, + { + "name": "right_tspatial_tspatial", + "file": "meos_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "acontains_geo_tgeo", + "file": "meos_geo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "acontains_tgeo_geo", + "file": "meos_geo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "acontains_tgeo_tgeo", + "file": "meos_geo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "acovers_geo_tgeo", + "file": "meos_geo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "acovers_tgeo_geo", + "file": "meos_geo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "acovers_tgeo_tgeo", + "file": "meos_geo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "adisjoint_tgeo_geo", + "file": "meos_geo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "adisjoint_tgeo_tgeo", + "file": "meos_geo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "adwithin_tgeo_geo", + "file": "meos_geo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "dist", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "adwithin_tgeo_tgeo", + "file": "meos_geo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "dist", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "aintersects_tgeo_geo", + "file": "meos_geo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "aintersects_tgeo_tgeo", + "file": "meos_geo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "atouches_tgeo_geo", + "file": "meos_geo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "atouches_tgeo_tgeo", + "file": "meos_geo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "atouches_tpoint_geo", + "file": "meos_geo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "econtains_geo_tgeo", + "file": "meos_geo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "econtains_tgeo_geo", + "file": "meos_geo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "econtains_tgeo_tgeo", + "file": "meos_geo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ecovers_geo_tgeo", + "file": "meos_geo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ecovers_tgeo_geo", + "file": "meos_geo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "ecovers_tgeo_tgeo", + "file": "meos_geo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "edisjoint_tgeo_geo", + "file": "meos_geo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "edisjoint_tgeo_tgeo", + "file": "meos_geo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "edwithin_tgeo_geo", + "file": "meos_geo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "dist", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "edwithin_tgeo_tgeo", + "file": "meos_geo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "dist", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "eintersects_tgeo_geo", + "file": "meos_geo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "eintersects_tgeo_tgeo", + "file": "meos_geo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "etouches_tgeo_geo", + "file": "meos_geo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "etouches_tgeo_tgeo", + "file": "meos_geo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "etouches_tpoint_geo", + "file": "meos_geo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "tcontains_geo_tgeo", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tcontains_tgeo_geo", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "tcontains_tgeo_tgeo", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tcovers_geo_tgeo", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tcovers_tgeo_geo", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "tcovers_tgeo_tgeo", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tdisjoint_geo_tgeo", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tdisjoint_tgeo_geo", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "tdisjoint_tgeo_tgeo", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tdwithin_geo_tgeo", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "dist", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "tdwithin_tgeo_geo", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "dist", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "tdwithin_tgeo_tgeo", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "dist", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "tintersects_geo_tgeo", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tintersects_tgeo_geo", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "tintersects_tgeo_tgeo", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ttouches_geo_tgeo", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ttouches_tgeo_geo", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "ttouches_tgeo_tgeo", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tdistance_tgeo_geo", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "tdistance_tgeo_tgeo", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "nad_stbox_geo", + "file": "meos_geo.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "nad_stbox_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "box1", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "box2", + "cType": "const STBox *", + "canonical": "const STBox *" + } + ] + }, + { + "name": "nad_tgeo_geo", + "file": "meos_geo.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "nad_tgeo_stbox", + "file": "meos_geo.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + } + ] + }, + { + "name": "nad_tgeo_tgeo", + "file": "meos_geo.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "nai_tgeo_geo", + "file": "meos_geo.h", + "returnType": { + "c": "TInstant *", + "canonical": "TInstant *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "nai_tgeo_tgeo", + "file": "meos_geo.h", + "returnType": { + "c": "TInstant *", + "canonical": "TInstant *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "shortestline_tgeo_geo", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "shortestline_tgeo_tgeo", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tpoint_tcentroid_finalfn", + "file": "meos_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "state", + "cType": "SkipList *", + "canonical": "struct SkipList *" + } + ] + }, + { + "name": "tpoint_tcentroid_transfn", + "file": "meos_geo.h", + "returnType": { + "c": "SkipList *", + "canonical": "struct SkipList *" + }, + "params": [ + { + "name": "state", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "temp", + "cType": "Temporal *", + "canonical": "Temporal *" + } + ] + }, + { + "name": "tspatial_extent_transfn", + "file": "meos_geo.h", + "returnType": { + "c": "STBox *", + "canonical": "STBox *" + }, + "params": [ + { + "name": "box", + "cType": "STBox *", + "canonical": "STBox *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "stbox_get_space_tile", + "file": "meos_geo.h", + "returnType": { + "c": "STBox *", + "canonical": "STBox *" + }, + "params": [ + { + "name": "point", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "xsize", + "cType": "double", + "canonical": "double" + }, + { + "name": "ysize", + "cType": "double", + "canonical": "double" + }, + { + "name": "zsize", + "cType": "double", + "canonical": "double" + }, + { + "name": "sorigin", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "stbox_get_space_time_tile", + "file": "meos_geo.h", + "returnType": { + "c": "STBox *", + "canonical": "STBox *" + }, + "params": [ + { + "name": "point", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "xsize", + "cType": "double", + "canonical": "double" + }, + { + "name": "ysize", + "cType": "double", + "canonical": "double" + }, + { + "name": "zsize", + "cType": "double", + "canonical": "double" + }, + { + "name": "duration", + "cType": "const Interval *", + "canonical": "const Interval *" + }, + { + "name": "sorigin", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "torigin", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "stbox_get_time_tile", + "file": "meos_geo.h", + "returnType": { + "c": "STBox *", + "canonical": "STBox *" + }, + "params": [ + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "duration", + "cType": "const Interval *", + "canonical": "const Interval *" + }, + { + "name": "torigin", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "stbox_space_tiles", + "file": "meos_geo.h", + "returnType": { + "c": "STBox *", + "canonical": "STBox *" + }, + "params": [ + { + "name": "bounds", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "xsize", + "cType": "double", + "canonical": "double" + }, + { + "name": "ysize", + "cType": "double", + "canonical": "double" + }, + { + "name": "zsize", + "cType": "double", + "canonical": "double" + }, + { + "name": "sorigin", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "border_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "stbox_space_time_tiles", + "file": "meos_geo.h", + "returnType": { + "c": "STBox *", + "canonical": "STBox *" + }, + "params": [ + { + "name": "bounds", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "xsize", + "cType": "double", + "canonical": "double" + }, + { + "name": "ysize", + "cType": "double", + "canonical": "double" + }, + { + "name": "zsize", + "cType": "double", + "canonical": "double" + }, + { + "name": "duration", + "cType": "const Interval *", + "canonical": "const Interval *" + }, + { + "name": "sorigin", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "torigin", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "border_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "stbox_time_tiles", + "file": "meos_geo.h", + "returnType": { + "c": "STBox *", + "canonical": "STBox *" + }, + "params": [ + { + "name": "bounds", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "duration", + "cType": "const Interval *", + "canonical": "const Interval *" + }, + { + "name": "torigin", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "border_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tgeo_space_split", + "file": "meos_geo.h", + "returnType": { + "c": "SpaceSplit", + "canonical": "struct SpaceSplit" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "xsize", + "cType": "double", + "canonical": "double" + }, + { + "name": "ysize", + "cType": "double", + "canonical": "double" + }, + { + "name": "zsize", + "cType": "double", + "canonical": "double" + }, + { + "name": "sorigin", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "bitmatrix", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "border_inc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tgeo_space_time_split", + "file": "meos_geo.h", + "returnType": { + "c": "SpaceTimeSplit", + "canonical": "struct SpaceTimeSplit" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "xsize", + "cType": "double", + "canonical": "double" + }, + { + "name": "ysize", + "cType": "double", + "canonical": "double" + }, + { + "name": "zsize", + "cType": "double", + "canonical": "double" + }, + { + "name": "duration", + "cType": "const Interval *", + "canonical": "const Interval *" + }, + { + "name": "sorigin", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "torigin", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "bitmatrix", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "border_inc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "geo_cluster_kmeans", + "file": "meos_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "geoms", + "cType": "const int **", + "canonical": "const int **" + }, + { + "name": "ngeoms", + "cType": "uint32_t", + "canonical": "unsigned int" + }, + { + "name": "k", + "cType": "uint32_t", + "canonical": "unsigned int" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "geo_cluster_dbscan", + "file": "meos_geo.h", + "returnType": { + "c": "uint32_t *", + "canonical": "unsigned int *" + }, + "params": [ + { + "name": "geoms", + "cType": "const int **", + "canonical": "const int **" + }, + { + "name": "ngeoms", + "cType": "uint32_t", + "canonical": "unsigned int" + }, + { + "name": "tolerance", + "cType": "double", + "canonical": "double" + }, + { + "name": "minpoints", + "cType": "int", + "canonical": "int" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "geo_cluster_intersecting", + "file": "meos_geo.h", + "returnType": { + "c": "int **", + "canonical": "int **" + }, + "params": [ + { + "name": "geoms", + "cType": "const int **", + "canonical": "const int **" + }, + { + "name": "ngeoms", + "cType": "uint32_t", + "canonical": "unsigned int" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "geo_cluster_within", + "file": "meos_geo.h", + "returnType": { + "c": "int **", + "canonical": "int **" + }, + "params": [ + { + "name": "geoms", + "cType": "const int **", + "canonical": "const int **" + }, + { + "name": "ngeoms", + "cType": "uint32_t", + "canonical": "unsigned int" + }, + { + "name": "tolerance", + "cType": "double", + "canonical": "double" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "cbuffer_as_ewkt", + "file": "meos_cbuffer.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "cbuffer_as_hexwkb", + "file": "meos_cbuffer.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "variant", + "cType": "uint8_t", + "canonical": "unsigned char" + }, + { + "name": "size", + "cType": "size_t *", + "canonical": "unsigned long *" + } + ] + }, + { + "name": "cbuffer_as_text", + "file": "meos_cbuffer.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "cbuffer_as_wkb", + "file": "meos_cbuffer.h", + "returnType": { + "c": "uint8_t *", + "canonical": "unsigned char *" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "variant", + "cType": "uint8_t", + "canonical": "unsigned char" + }, + { + "name": "size_out", + "cType": "size_t *", + "canonical": "unsigned long *" + } + ] + }, + { + "name": "cbuffer_from_hexwkb", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Cbuffer *", + "canonical": "struct Cbuffer *" + }, + "params": [ + { + "name": "hexwkb", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "cbuffer_from_wkb", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Cbuffer *", + "canonical": "struct Cbuffer *" + }, + "params": [ + { + "name": "wkb", + "cType": "const uint8_t *", + "canonical": "const unsigned char *" + }, + { + "name": "size", + "cType": "size_t", + "canonical": "unsigned long" + } + ] + }, + { + "name": "cbuffer_in", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Cbuffer *", + "canonical": "struct Cbuffer *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "cbuffer_out", + "file": "meos_cbuffer.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "cbuffer_copy", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Cbuffer *", + "canonical": "struct Cbuffer *" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "cbuffer_make", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Cbuffer *", + "canonical": "struct Cbuffer *" + }, + "params": [ + { + "name": "point", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "radius", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "cbuffer_to_geom", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "cbuffer_to_stbox", + "file": "meos_cbuffer.h", + "returnType": { + "c": "STBox *", + "canonical": "STBox *" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "cbufferarr_to_geom", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "cbarr", + "cType": "const Cbuffer **", + "canonical": "const struct Cbuffer **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "geom_to_cbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Cbuffer *", + "canonical": "struct Cbuffer *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "cbuffer_hash", + "file": "meos_cbuffer.h", + "returnType": { + "c": "uint32", + "canonical": "unsigned int" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "cbuffer_hash_extended", + "file": "meos_cbuffer.h", + "returnType": { + "c": "uint64", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "seed", + "cType": "uint64", + "canonical": "unsigned long" + } + ] + }, + { + "name": "cbuffer_point", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "cbuffer_radius", + "file": "meos_cbuffer.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "cbuffer_round", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Cbuffer *", + "canonical": "struct Cbuffer *" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "cbufferarr_round", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Cbuffer **", + "canonical": "struct Cbuffer **" + }, + "params": [ + { + "name": "cbarr", + "cType": "const Cbuffer **", + "canonical": "const struct Cbuffer **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "cbuffer_set_srid", + "file": "meos_cbuffer.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "cb", + "cType": "Cbuffer *", + "canonical": "struct Cbuffer *" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + } + ] + }, + { + "name": "cbuffer_srid", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int32_t", + "canonical": "int" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "cbuffer_transform", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Cbuffer *", + "canonical": "struct Cbuffer *" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + } + ] + }, + { + "name": "cbuffer_transform_pipeline", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Cbuffer *", + "canonical": "struct Cbuffer *" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "pipelinestr", + "cType": "const char *", + "canonical": "const char *" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + }, + { + "name": "is_forward", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "contains_cbuffer_cbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "cb1", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "cb2", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "covers_cbuffer_cbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "cb1", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "cb2", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "disjoint_cbuffer_cbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "cb1", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "cb2", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "dwithin_cbuffer_cbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "cb1", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "cb2", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "dist", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "intersects_cbuffer_cbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "cb1", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "cb2", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "touches_cbuffer_cbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "cb1", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "cb2", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "cbuffer_tstzspan_to_stbox", + "file": "meos_cbuffer.h", + "returnType": { + "c": "STBox *", + "canonical": "STBox *" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "cbuffer_timestamptz_to_stbox", + "file": "meos_cbuffer.h", + "returnType": { + "c": "STBox *", + "canonical": "STBox *" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "distance_cbuffer_cbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "cb1", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "cb2", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "distance_cbuffer_geo", + "file": "meos_cbuffer.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "distance_cbuffer_stbox", + "file": "meos_cbuffer.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + } + ] + }, + { + "name": "nad_cbuffer_stbox", + "file": "meos_cbuffer.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + } + ] + }, + { + "name": "cbuffer_cmp", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "cb1", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "cb2", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "cbuffer_eq", + "file": "meos_cbuffer.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "cb1", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "cb2", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "cbuffer_ge", + "file": "meos_cbuffer.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "cb1", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "cb2", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "cbuffer_gt", + "file": "meos_cbuffer.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "cb1", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "cb2", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "cbuffer_le", + "file": "meos_cbuffer.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "cb1", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "cb2", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "cbuffer_lt", + "file": "meos_cbuffer.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "cb1", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "cb2", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "cbuffer_ne", + "file": "meos_cbuffer.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "cb1", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "cb2", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "cbuffer_nsame", + "file": "meos_cbuffer.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "cb1", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "cb2", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "cbuffer_same", + "file": "meos_cbuffer.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "cb1", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "cb2", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "cbufferset_in", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "cbufferset_out", + "file": "meos_cbuffer.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "cbufferset_make", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "values", + "cType": "Cbuffer **", + "canonical": "struct Cbuffer **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "cbuffer_to_set", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "cbufferset_end_value", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Cbuffer *", + "canonical": "struct Cbuffer *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "cbufferset_start_value", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Cbuffer *", + "canonical": "struct Cbuffer *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "cbufferset_value_n", + "file": "meos_cbuffer.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "n", + "cType": "int", + "canonical": "int" + }, + { + "name": "result", + "cType": "Cbuffer **", + "canonical": "struct Cbuffer **" + } + ] + }, + { + "name": "cbufferset_values", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Cbuffer **", + "canonical": "struct Cbuffer **" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "cbuffer_union_transfn", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "state", + "cType": "Set *", + "canonical": "Set *" + }, + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "contained_cbuffer_set", + "file": "meos_cbuffer.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "contains_set_cbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "cb", + "cType": "Cbuffer *", + "canonical": "struct Cbuffer *" + } + ] + }, + { + "name": "intersection_cbuffer_set", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "intersection_set_cbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "minus_cbuffer_set", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "minus_set_cbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "union_cbuffer_set", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "union_set_cbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "tcbuffer_in", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "tcbuffer_from_mfjson", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "mfjson", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "tcbufferinst_make", + "file": "meos_cbuffer.h", + "returnType": { + "c": "TInstant *", + "canonical": "TInstant *" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "tcbuffer_make", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "tpoint", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "tfloat", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tcbuffer_from_base_temp", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tcbufferseq_from_base_tstzset", + "file": "meos_cbuffer.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "tcbufferseq_from_base_tstzspan", + "file": "meos_cbuffer.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "tcbufferseqset_from_base_tstzspanset", + "file": "meos_cbuffer.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "tcbuffer_end_value", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Cbuffer *", + "canonical": "struct Cbuffer *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tcbuffer_points", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tcbuffer_radius", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tcbuffer_traversed_area", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "unary_union", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tcbuffer_convex_hull", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tcbuffer_start_value", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Cbuffer *", + "canonical": "struct Cbuffer *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tcbuffer_value_at_timestamptz", + "file": "meos_cbuffer.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "strict", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "value", + "cType": "Cbuffer **", + "canonical": "struct Cbuffer **" + } + ] + }, + { + "name": "tcbuffer_value_n", + "file": "meos_cbuffer.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "n", + "cType": "int", + "canonical": "int" + }, + { + "name": "result", + "cType": "Cbuffer **", + "canonical": "struct Cbuffer **" + } + ] + }, + { + "name": "tcbuffer_values", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Cbuffer **", + "canonical": "struct Cbuffer **" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tcbuffer_to_tfloat", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tcbuffer_to_tgeompoint", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tgeometry_to_tcbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tcbuffer_expand", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "dist", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "tcbuffer_at_cbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "tcbuffer_at_geom", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "tcbuffer_at_stbox", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "border_inc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tcbuffer_minus_cbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "tcbuffer_minus_geom", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "tcbuffer_minus_stbox", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "border_inc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tdistance_tcbuffer_cbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "tdistance_tcbuffer_geo", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "tdistance_tcbuffer_tcbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "nad_tcbuffer_cbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "nad_tcbuffer_geo", + "file": "meos_cbuffer.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "nad_tcbuffer_stbox", + "file": "meos_cbuffer.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + } + ] + }, + { + "name": "nad_tcbuffer_tcbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "mindistance_tcbuffer_tcbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "threshold", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "nai_tcbuffer_cbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "TInstant *", + "canonical": "TInstant *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "nai_tcbuffer_geo", + "file": "meos_cbuffer.h", + "returnType": { + "c": "TInstant *", + "canonical": "TInstant *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "nai_tcbuffer_tcbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "TInstant *", + "canonical": "TInstant *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "shortestline_tcbuffer_cbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "shortestline_tcbuffer_geo", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "shortestline_tcbuffer_tcbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_eq_cbuffer_tcbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_eq_tcbuffer_cbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "always_eq_tcbuffer_tcbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_ne_cbuffer_tcbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_ne_tcbuffer_cbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "always_ne_tcbuffer_tcbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_eq_cbuffer_tcbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_eq_tcbuffer_cbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "ever_eq_tcbuffer_tcbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_ne_cbuffer_tcbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_ne_tcbuffer_cbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "ever_ne_tcbuffer_tcbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "teq_cbuffer_tcbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "teq_tcbuffer_cbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "tne_cbuffer_tcbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tne_tcbuffer_cbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "acontains_cbuffer_tcbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "acontains_geo_tcbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "acontains_tcbuffer_cbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "acontains_tcbuffer_geo", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "acovers_cbuffer_tcbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "acovers_geo_tcbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "acovers_tcbuffer_cbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "acovers_tcbuffer_geo", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "acovers_tcbuffer_tcbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "adisjoint_tcbuffer_geo", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "adisjoint_tcbuffer_cbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "adisjoint_tcbuffer_tcbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "adwithin_tcbuffer_geo", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "dist", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "adwithin_tcbuffer_cbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "dist", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "adwithin_tcbuffer_tcbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "dist", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "aintersects_tcbuffer_geo", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "aintersects_tcbuffer_cbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "aintersects_tcbuffer_tcbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "atouches_tcbuffer_geo", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "atouches_tcbuffer_cbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "atouches_tcbuffer_tcbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "econtains_cbuffer_tcbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "econtains_tcbuffer_cbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "econtains_tcbuffer_geo", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "ecovers_cbuffer_tcbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ecovers_geo_tcbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ecovers_tcbuffer_cbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "ecovers_tcbuffer_geo", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "ecovers_tcbuffer_tcbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "edisjoint_tcbuffer_geo", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "edisjoint_tcbuffer_cbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "edwithin_tcbuffer_geo", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "dist", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "edwithin_tcbuffer_cbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "dist", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "edwithin_tcbuffer_tcbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "dist", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "eintersects_tcbuffer_geo", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "eintersects_tcbuffer_cbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "eintersects_tcbuffer_tcbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "etouches_tcbuffer_geo", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "etouches_tcbuffer_cbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "etouches_tcbuffer_tcbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tcontains_cbuffer_tcbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tcontains_geo_tcbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tcontains_tcbuffer_geo", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "tcontains_tcbuffer_cbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "tcontains_tcbuffer_tcbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tcovers_cbuffer_tcbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tcovers_geo_tcbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tcovers_tcbuffer_geo", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "tcovers_tcbuffer_cbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "tcovers_tcbuffer_tcbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tdwithin_geo_tcbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "dist", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "tdwithin_tcbuffer_geo", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "dist", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "tdwithin_tcbuffer_cbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "dist", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "tdwithin_tcbuffer_tcbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "dist", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "tdisjoint_cbuffer_tcbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tdisjoint_geo_tcbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tdisjoint_tcbuffer_geo", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "tdisjoint_tcbuffer_cbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "tdisjoint_tcbuffer_tcbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tintersects_cbuffer_tcbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tintersects_geo_tcbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tintersects_tcbuffer_geo", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "tintersects_tcbuffer_cbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "tintersects_tcbuffer_tcbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ttouches_geo_tcbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ttouches_tcbuffer_geo", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "ttouches_cbuffer_tcbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ttouches_tcbuffer_cbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "ttouches_tcbuffer_tcbuffer", + "file": "meos_cbuffer.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ensure_valid_cbuffer_cbuffer", + "file": "cbuffer.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "cb1", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "cb2", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "ensure_valid_cbuffer_geo", + "file": "cbuffer.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "ensure_valid_cbuffer_stbox", + "file": "cbuffer.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + } + ] + }, + { + "name": "ensure_valid_cbufferset_cbuffer", + "file": "cbuffer.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "cbuffer_collinear", + "file": "cbuffer.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "cb1", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "cb2", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "cbuf3", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "ratio", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "cbuffersegm_interpolate", + "file": "cbuffer.h", + "returnType": { + "c": "Cbuffer *", + "canonical": "struct Cbuffer *" + }, + "params": [ + { + "name": "start", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "end", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "ratio", + "cType": "long double", + "canonical": "long double" + } + ] + }, + { + "name": "cbuffersegm_locate", + "file": "cbuffer.h", + "returnType": { + "c": "long double", + "canonical": "long double" + }, + "params": [ + { + "name": "start", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "end", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "value", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "cbuffer_parse", + "file": "cbuffer.h", + "returnType": { + "c": "Cbuffer *", + "canonical": "struct Cbuffer *" + }, + "params": [ + { + "name": "str", + "cType": "const char **", + "canonical": "const char **" + }, + { + "name": "end", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "cbuffer_wkt_out", + "file": "cbuffer.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + }, + { + "name": "extended", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "cbuffer_point_p", + "file": "cbuffer.h", + "returnType": { + "c": "const int *", + "canonical": "const int *" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "datum_cbuffer_round", + "file": "cbuffer.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "buffer", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "size", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "cbuffer_transf_pj", + "file": "cbuffer.h", + "returnType": { + "c": "Cbuffer *", + "canonical": "struct Cbuffer *" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "srid_to", + "cType": "int32_t", + "canonical": "int" + }, + { + "name": "pj", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "cbuffer_distance", + "file": "cbuffer.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "cb1", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "cb2", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "datum_cbuffer_distance", + "file": "cbuffer.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "cb1", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "cb2", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "cbuffersegm_distance_turnpt", + "file": "cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "start1", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "end1", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "start2", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "end2", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "lower", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "upper", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "t1", + "cType": "TimestampTz *", + "canonical": "long *" + }, + { + "name": "t2", + "cType": "TimestampTz *", + "canonical": "long *" + } + ] + }, + { + "name": "cbuffer_contains", + "file": "cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "cb1", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "cb2", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "cbuffer_covers", + "file": "cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "cb1", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "cb2", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "cbuffer_disjoint", + "file": "cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "cb1", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "cb2", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "cbuffer_intersects", + "file": "cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "cb1", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "cb2", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "cbuffer_dwithin", + "file": "cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "cb1", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "cb2", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "dist", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "cbuffer_touches", + "file": "cbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "cb1", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "cb2", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "datum_cbuffer_contains", + "file": "cbuffer.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "cb1", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "cb2", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_cbuffer_covers", + "file": "cbuffer.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "cb1", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "cb2", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_cbuffer_disjoint", + "file": "cbuffer.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "cb1", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "cb2", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_cbuffer_intersects", + "file": "cbuffer.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "cb1", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "cb2", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_cbuffer_dwithin", + "file": "cbuffer.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "cb1", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "cb2", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "dist", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_cbuffer_touches", + "file": "cbuffer.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "cb1", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "cb2", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "temptype_subtype", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "subtype", + "cType": "tempSubtype", + "canonical": "tempSubtype" + } + ] + }, + { + "name": "temptype_subtype_all", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "subtype", + "cType": "tempSubtype", + "canonical": "tempSubtype" + } + ] + }, + { + "name": "tempsubtype_name", + "file": "meos_catalog.h", + "returnType": { + "c": "const char *", + "canonical": "const char *" + }, + "params": [ + { + "name": "subtype", + "cType": "tempSubtype", + "canonical": "tempSubtype" + } + ] + }, + { + "name": "tempsubtype_from_string", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + }, + { + "name": "subtype", + "cType": "int16 *", + "canonical": "short *" + } + ] + }, + { + "name": "meosoper_name", + "file": "meos_catalog.h", + "returnType": { + "c": "const char *", + "canonical": "const char *" + }, + "params": [ + { + "name": "oper", + "cType": "MeosOper", + "canonical": "MeosOper" + } + ] + }, + { + "name": "meosoper_from_string", + "file": "meos_catalog.h", + "returnType": { + "c": "MeosOper", + "canonical": "MeosOper" + }, + "params": [ + { + "name": "name", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "interptype_name", + "file": "meos_catalog.h", + "returnType": { + "c": "const char *", + "canonical": "const char *" + }, + "params": [ + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "interptype_from_string", + "file": "meos_catalog.h", + "returnType": { + "c": "interpType", + "canonical": "interpType" + }, + "params": [ + { + "name": "interp_str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "meos_typeof_hexwkb", + "file": "meos_catalog.h", + "returnType": { + "c": "MeosType", + "canonical": "MeosType" + }, + "params": [ + { + "name": "hexwkb", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "meostype_name", + "file": "meos_catalog.h", + "returnType": { + "c": "const char *", + "canonical": "const char *" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "temptype_basetype", + "file": "meos_catalog.h", + "returnType": { + "c": "MeosType", + "canonical": "MeosType" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "settype_basetype", + "file": "meos_catalog.h", + "returnType": { + "c": "MeosType", + "canonical": "MeosType" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "spantype_basetype", + "file": "meos_catalog.h", + "returnType": { + "c": "MeosType", + "canonical": "MeosType" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "spantype_spansettype", + "file": "meos_catalog.h", + "returnType": { + "c": "MeosType", + "canonical": "MeosType" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "spansettype_spantype", + "file": "meos_catalog.h", + "returnType": { + "c": "MeosType", + "canonical": "MeosType" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "basetype_spantype", + "file": "meos_catalog.h", + "returnType": { + "c": "MeosType", + "canonical": "MeosType" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "basetype_settype", + "file": "meos_catalog.h", + "returnType": { + "c": "MeosType", + "canonical": "MeosType" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "tnumber_basetype", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "geo_basetype", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "meos_basetype", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "alphanum_basetype", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "alphanum_temptype", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "time_type", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "set_basetype", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "set_type", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "numset_type", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "ensure_numset_type", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "timeset_type", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "set_spantype", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "ensure_set_spantype", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "alphanumset_type", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "settype", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "geoset_type", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "ensure_geoset_type", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "spatialset_type", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "ensure_spatialset_type", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "span_basetype", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "span_canon_basetype", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "span_type", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "type_span_bbox", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "span_tbox_type", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "ensure_span_tbox_type", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "numspan_basetype", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "numspan_type", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "ensure_numspan_type", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "timespan_basetype", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "timespan_type", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "spanset_type", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "timespanset_type", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "ensure_timespanset_type", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "temporal_type", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "temporal_basetype", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "temptype_supports_linear", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "basetype_byvalue", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "basetype_varlength", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "meostype_length", + "file": "meos_catalog.h", + "returnType": { + "c": "int16", + "canonical": "short" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "talphanum_type", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "talpha_type", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "tnumber_type", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "ensure_tnumber_type", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "ensure_tnumber_basetype", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "tnumber_spantype", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "spatial_basetype", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "tspatial_type", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "ensure_tspatial_type", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "tpoint_type", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "ensure_tpoint_type", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "tgeo_type", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "ensure_tgeo_type", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "tgeo_type_all", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "ensure_tgeo_type_all", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "tgeometry_type", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "ensure_tgeometry_type", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "tgeodetic_type", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "ensure_tgeodetic_type", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "ensure_tnumber_tpoint_type", + "file": "meos_catalog.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "gsl_get_generation_rng", + "file": "meos_internal.h", + "returnType": { + "c": "gsl_rng *", + "canonical": "gsl_rng *" + }, + "params": [] + }, + { + "name": "gsl_get_aggregation_rng", + "file": "meos_internal.h", + "returnType": { + "c": "gsl_rng *", + "canonical": "gsl_rng *" + }, + "params": [] + }, + { + "name": "datum_ceil", + "file": "meos_internal.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "d", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_degrees", + "file": "meos_internal.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "d", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "normalize", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_float_round", + "file": "meos_internal.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "size", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_floor", + "file": "meos_internal.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "d", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_hash", + "file": "meos_internal.h", + "returnType": { + "c": "uint32", + "canonical": "unsigned int" + }, + "params": [ + { + "name": "d", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "basetype", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "datum_hash_extended", + "file": "meos_internal.h", + "returnType": { + "c": "uint64", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "d", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "basetype", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "seed", + "cType": "uint64", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_radians", + "file": "meos_internal.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "d", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "floatspan_round_set", + "file": "meos_internal.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + }, + { + "name": "result", + "cType": "Span *", + "canonical": "Span *" + } + ] + }, + { + "name": "set_in", + "file": "meos_internal.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + }, + { + "name": "basetype", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "set_out", + "file": "meos_internal.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "span_in", + "file": "meos_internal.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + }, + { + "name": "spantype", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "span_out", + "file": "meos_internal.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "spanset_in", + "file": "meos_internal.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + }, + { + "name": "spantype", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "spanset_out", + "file": "meos_internal.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "set_make", + "file": "meos_internal.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "values", + "cType": "const Datum *", + "canonical": "const unsigned long *" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "basetype", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "order", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "set_make_exp", + "file": "meos_internal.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "values", + "cType": "const Datum *", + "canonical": "const unsigned long *" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "maxcount", + "cType": "int", + "canonical": "int" + }, + { + "name": "basetype", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "order", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "set_make_free", + "file": "meos_internal.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "values", + "cType": "Datum *", + "canonical": "unsigned long *" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "basetype", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "order", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "span_make", + "file": "meos_internal.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "lower", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "upper", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "lower_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "upper_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "basetype", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "span_set", + "file": "meos_internal.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "lower", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "upper", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "lower_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "upper_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "basetype", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "spantype", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "s", + "cType": "Span *", + "canonical": "Span *" + } + ] + }, + { + "name": "spanset_make_exp", + "file": "meos_internal.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "spans", + "cType": "Span *", + "canonical": "Span *" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "maxcount", + "cType": "int", + "canonical": "int" + }, + { + "name": "normalize", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "order", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "spanset_make_free", + "file": "meos_internal.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "spans", + "cType": "Span *", + "canonical": "Span *" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "normalize", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "order", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "set_span", + "file": "meos_internal.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "set_spanset", + "file": "meos_internal.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "value_set_span", + "file": "meos_internal.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "basetype", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "s", + "cType": "Span *", + "canonical": "Span *" + } + ] + }, + { + "name": "value_set", + "file": "meos_internal.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "d", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "basetype", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "value_span", + "file": "meos_internal.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "d", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "basetype", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "value_spanset", + "file": "meos_internal.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "d", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "basetype", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "numspan_width", + "file": "meos_internal.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "numspanset_width", + "file": "meos_internal.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "boundspan", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "set_end_value", + "file": "meos_internal.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "set_mem_size", + "file": "meos_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "set_set_subspan", + "file": "meos_internal.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "minidx", + "cType": "int", + "canonical": "int" + }, + { + "name": "maxidx", + "cType": "int", + "canonical": "int" + }, + { + "name": "result", + "cType": "Span *", + "canonical": "Span *" + } + ] + }, + { + "name": "set_set_span", + "file": "meos_internal.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "result", + "cType": "Span *", + "canonical": "Span *" + } + ] + }, + { + "name": "set_start_value", + "file": "meos_internal.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "set_value_n", + "file": "meos_internal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "n", + "cType": "int", + "canonical": "int" + }, + { + "name": "result", + "cType": "Datum *", + "canonical": "unsigned long *" + } + ] + }, + { + "name": "set_vals", + "file": "meos_internal.h", + "returnType": { + "c": "Datum *", + "canonical": "unsigned long *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "set_values", + "file": "meos_internal.h", + "returnType": { + "c": "Datum *", + "canonical": "unsigned long *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "spanset_lower", + "file": "meos_internal.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "spanset_mem_size", + "file": "meos_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "spanset_sps", + "file": "meos_internal.h", + "returnType": { + "c": "const Span **", + "canonical": "const Span **" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "spanset_upper", + "file": "meos_internal.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "datespan_set_tstzspan", + "file": "meos_internal.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "s1", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "s2", + "cType": "Span *", + "canonical": "Span *" + } + ] + }, + { + "name": "bigintspan_set_floatspan", + "file": "meos_internal.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "s1", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "s2", + "cType": "Span *", + "canonical": "Span *" + } + ] + }, + { + "name": "bigintspan_set_intspan", + "file": "meos_internal.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "s1", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "s2", + "cType": "Span *", + "canonical": "Span *" + } + ] + }, + { + "name": "floatspan_set_bigintspan", + "file": "meos_internal.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "s1", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "s2", + "cType": "Span *", + "canonical": "Span *" + } + ] + }, + { + "name": "floatspan_set_intspan", + "file": "meos_internal.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "s1", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "s2", + "cType": "Span *", + "canonical": "Span *" + } + ] + }, + { + "name": "intspan_set_bigintspan", + "file": "meos_internal.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "s1", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "s2", + "cType": "Span *", + "canonical": "Span *" + } + ] + }, + { + "name": "intspan_set_floatspan", + "file": "meos_internal.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "s1", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "s2", + "cType": "Span *", + "canonical": "Span *" + } + ] + }, + { + "name": "numset_shift_scale", + "file": "meos_internal.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "shift", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "width", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "hasshift", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "haswidth", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "numspan_expand", + "file": "meos_internal.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "numspan_shift_scale", + "file": "meos_internal.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "shift", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "width", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "hasshift", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "haswidth", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "numspanset_shift_scale", + "file": "meos_internal.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "shift", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "width", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "hasshift", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "haswidth", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "set_compact", + "file": "meos_internal.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "span_expand", + "file": "meos_internal.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "s1", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "s2", + "cType": "Span *", + "canonical": "Span *" + } + ] + }, + { + "name": "spanset_compact", + "file": "meos_internal.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "tbox_expand_value", + "file": "meos_internal.h", + "returnType": { + "c": "TBox *", + "canonical": "TBox *" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const TBox *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "basetyp", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "textcat_textset_text_common", + "file": "meos_internal.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "txt", + "cType": "const text *", + "canonical": "const struct varlena *" + }, + { + "name": "invert", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tstzspan_set_datespan", + "file": "meos_internal.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "s1", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "s2", + "cType": "Span *", + "canonical": "Span *" + } + ] + }, + { + "name": "adjacent_span_value", + "file": "meos_internal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "adjacent_spanset_value", + "file": "meos_internal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "adjacent_value_spanset", + "file": "meos_internal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "contained_value_set", + "file": "meos_internal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "contained_value_span", + "file": "meos_internal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "contained_value_spanset", + "file": "meos_internal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "contains_set_value", + "file": "meos_internal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "contains_span_value", + "file": "meos_internal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "contains_spanset_value", + "file": "meos_internal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "ovadj_span_span", + "file": "meos_internal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s1", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "s2", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "left_set_value", + "file": "meos_internal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "left_span_value", + "file": "meos_internal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "left_spanset_value", + "file": "meos_internal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "left_value_set", + "file": "meos_internal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "left_value_span", + "file": "meos_internal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "left_value_spanset", + "file": "meos_internal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "lfnadj_span_span", + "file": "meos_internal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s1", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "s2", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "overleft_set_value", + "file": "meos_internal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "overleft_span_value", + "file": "meos_internal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "overleft_spanset_value", + "file": "meos_internal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "overleft_value_set", + "file": "meos_internal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "overleft_value_span", + "file": "meos_internal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "overleft_value_spanset", + "file": "meos_internal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "overright_set_value", + "file": "meos_internal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "overright_span_value", + "file": "meos_internal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "overright_spanset_value", + "file": "meos_internal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "overright_value_set", + "file": "meos_internal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "overright_value_span", + "file": "meos_internal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "overright_value_spanset", + "file": "meos_internal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "right_value_set", + "file": "meos_internal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "right_set_value", + "file": "meos_internal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "right_value_span", + "file": "meos_internal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "right_value_spanset", + "file": "meos_internal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "right_span_value", + "file": "meos_internal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "right_spanset_value", + "file": "meos_internal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "bbox_type", + "file": "meos_internal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "bboxtype", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "bbox_get_size", + "file": "meos_internal.h", + "returnType": { + "c": "size_t", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "bboxtype", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "bbox_max_dims", + "file": "meos_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "bboxtype", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "temporal_bbox_eq", + "file": "meos_internal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const void *", + "canonical": "const void *" + }, + { + "name": "box2", + "cType": "const void *", + "canonical": "const void *" + }, + { + "name": "temptype", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "temporal_bbox_cmp", + "file": "meos_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "box1", + "cType": "const void *", + "canonical": "const void *" + }, + { + "name": "box2", + "cType": "const void *", + "canonical": "const void *" + }, + { + "name": "temptype", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "bbox_union_span_span", + "file": "meos_internal.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "s1", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "s2", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "result", + "cType": "Span *", + "canonical": "Span *" + } + ] + }, + { + "name": "inter_span_span", + "file": "meos_internal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s1", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "s2", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "result", + "cType": "Span *", + "canonical": "Span *" + } + ] + }, + { + "name": "intersection_set_value", + "file": "meos_internal.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "intersection_span_value", + "file": "meos_internal.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "intersection_spanset_value", + "file": "meos_internal.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "intersection_value_set", + "file": "meos_internal.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "intersection_value_span", + "file": "meos_internal.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "intersection_value_spanset", + "file": "meos_internal.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "mi_span_span", + "file": "meos_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "s1", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "s2", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "result", + "cType": "Span *", + "canonical": "Span *" + } + ] + }, + { + "name": "minus_set_value", + "file": "meos_internal.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "minus_span_value", + "file": "meos_internal.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "minus_spanset_value", + "file": "meos_internal.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "minus_value_set", + "file": "meos_internal.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "minus_value_span", + "file": "meos_internal.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "minus_value_spanset", + "file": "meos_internal.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "union_set_value", + "file": "meos_internal.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "union_span_value", + "file": "meos_internal.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "union_spanset_value", + "file": "meos_internal.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "union_value_set", + "file": "meos_internal.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "union_value_span", + "file": "meos_internal.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "union_value_spanset", + "file": "meos_internal.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "distance_set_set", + "file": "meos_internal.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "s1", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "s2", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "distance_set_value", + "file": "meos_internal.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "distance_span_span", + "file": "meos_internal.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "s1", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "s2", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "distance_span_value", + "file": "meos_internal.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "distance_spanset_span", + "file": "meos_internal.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "distance_spanset_spanset", + "file": "meos_internal.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "ss1", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "ss2", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "distance_spanset_value", + "file": "meos_internal.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "distance_value_value", + "file": "meos_internal.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "l", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "r", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "basetype", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "spanbase_extent_transfn", + "file": "meos_internal.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "state", + "cType": "Span *", + "canonical": "Span *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "basetype", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "value_union_transfn", + "file": "meos_internal.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "state", + "cType": "Set *", + "canonical": "Set *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "basetype", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "number_tstzspan_to_tbox", + "file": "meos_internal.h", + "returnType": { + "c": "TBox *", + "canonical": "TBox *" + }, + "params": [ + { + "name": "d", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "basetype", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "number_timestamptz_to_tbox", + "file": "meos_internal.h", + "returnType": { + "c": "TBox *", + "canonical": "TBox *" + }, + "params": [ + { + "name": "d", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "basetype", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "tbox_set", + "file": "meos_internal.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "p", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "box", + "cType": "TBox *", + "canonical": "TBox *" + } + ] + }, + { + "name": "float_set_tbox", + "file": "meos_internal.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + }, + { + "name": "box", + "cType": "TBox *", + "canonical": "TBox *" + } + ] + }, + { + "name": "int_set_tbox", + "file": "meos_internal.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + }, + { + "name": "box", + "cType": "TBox *", + "canonical": "TBox *" + } + ] + }, + { + "name": "number_set_tbox", + "file": "meos_internal.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "d", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "basetype", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "box", + "cType": "TBox *", + "canonical": "TBox *" + } + ] + }, + { + "name": "number_tbox", + "file": "meos_internal.h", + "returnType": { + "c": "TBox *", + "canonical": "TBox *" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "basetype", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "numset_set_tbox", + "file": "meos_internal.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "box", + "cType": "TBox *", + "canonical": "TBox *" + } + ] + }, + { + "name": "numspan_set_tbox", + "file": "meos_internal.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "span", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "box", + "cType": "TBox *", + "canonical": "TBox *" + } + ] + }, + { + "name": "timestamptz_set_tbox", + "file": "meos_internal.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "box", + "cType": "TBox *", + "canonical": "TBox *" + } + ] + }, + { + "name": "tstzset_set_tbox", + "file": "meos_internal.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "box", + "cType": "TBox *", + "canonical": "TBox *" + } + ] + }, + { + "name": "tstzspan_set_tbox", + "file": "meos_internal.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "box", + "cType": "TBox *", + "canonical": "TBox *" + } + ] + }, + { + "name": "tbox_shift_scale_value", + "file": "meos_internal.h", + "returnType": { + "c": "TBox *", + "canonical": "TBox *" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const TBox *" + }, + { + "name": "shift", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "width", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "hasshift", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "haswidth", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tbox_expand", + "file": "meos_internal.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "box1", + "cType": "const TBox *", + "canonical": "const TBox *" + }, + { + "name": "box2", + "cType": "TBox *", + "canonical": "TBox *" + } + ] + }, + { + "name": "inter_tbox_tbox", + "file": "meos_internal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const TBox *", + "canonical": "const TBox *" + }, + { + "name": "box2", + "cType": "const TBox *", + "canonical": "const TBox *" + }, + { + "name": "result", + "cType": "TBox *", + "canonical": "TBox *" + } + ] + }, + { + "name": "tboolinst_from_mfjson", + "file": "meos_internal.h", + "returnType": { + "c": "TInstant *", + "canonical": "TInstant *" + }, + "params": [ + { + "name": "mfjson", + "cType": "json_object *", + "canonical": "struct json_object *" + } + ] + }, + { + "name": "tboolinst_in", + "file": "meos_internal.h", + "returnType": { + "c": "TInstant *", + "canonical": "TInstant *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "tboolseq_from_mfjson", + "file": "meos_internal.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "mfjson", + "cType": "json_object *", + "canonical": "struct json_object *" + } + ] + }, + { + "name": "tboolseq_in", + "file": "meos_internal.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "tboolseqset_from_mfjson", + "file": "meos_internal.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "mfjson", + "cType": "json_object *", + "canonical": "struct json_object *" + } + ] + }, + { + "name": "tboolseqset_in", + "file": "meos_internal.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "temporal_in", + "file": "meos_internal.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + }, + { + "name": "temptype", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "temporal_out", + "file": "meos_internal.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "temparr_out", + "file": "meos_internal.h", + "returnType": { + "c": "char **", + "canonical": "char **" + }, + "params": [ + { + "name": "temparr", + "cType": "Temporal **", + "canonical": "Temporal **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "tfloatinst_from_mfjson", + "file": "meos_internal.h", + "returnType": { + "c": "TInstant *", + "canonical": "TInstant *" + }, + "params": [ + { + "name": "mfjson", + "cType": "json_object *", + "canonical": "struct json_object *" + } + ] + }, + { + "name": "tfloatinst_in", + "file": "meos_internal.h", + "returnType": { + "c": "TInstant *", + "canonical": "TInstant *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "tfloatseq_from_mfjson", + "file": "meos_internal.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "mfjson", + "cType": "json_object *", + "canonical": "struct json_object *" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "tfloatseq_in", + "file": "meos_internal.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "tfloatseqset_from_mfjson", + "file": "meos_internal.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "mfjson", + "cType": "json_object *", + "canonical": "struct json_object *" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "tfloatseqset_in", + "file": "meos_internal.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "tinstant_from_mfjson", + "file": "meos_internal.h", + "returnType": { + "c": "TInstant *", + "canonical": "TInstant *" + }, + "params": [ + { + "name": "mfjson", + "cType": "json_object *", + "canonical": "struct json_object *" + }, + { + "name": "spatial", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + }, + { + "name": "temptype", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "tinstant_in", + "file": "meos_internal.h", + "returnType": { + "c": "TInstant *", + "canonical": "TInstant *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + }, + { + "name": "temptype", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "tinstant_out", + "file": "meos_internal.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const TInstant *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "tbigintinst_from_mfjson", + "file": "meos_internal.h", + "returnType": { + "c": "TInstant *", + "canonical": "TInstant *" + }, + "params": [ + { + "name": "mfjson", + "cType": "json_object *", + "canonical": "struct json_object *" + } + ] + }, + { + "name": "tbigintinst_in", + "file": "meos_internal.h", + "returnType": { + "c": "TInstant *", + "canonical": "TInstant *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "tbigintseq_from_mfjson", + "file": "meos_internal.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "mfjson", + "cType": "json_object *", + "canonical": "struct json_object *" + } + ] + }, + { + "name": "tbigintseqset_from_mfjson", + "file": "meos_internal.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "mfjson", + "cType": "json_object *", + "canonical": "struct json_object *" + } + ] + }, + { + "name": "tbigintseqset_in", + "file": "meos_internal.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "tintinst_from_mfjson", + "file": "meos_internal.h", + "returnType": { + "c": "TInstant *", + "canonical": "TInstant *" + }, + "params": [ + { + "name": "mfjson", + "cType": "json_object *", + "canonical": "struct json_object *" + } + ] + }, + { + "name": "tintinst_in", + "file": "meos_internal.h", + "returnType": { + "c": "TInstant *", + "canonical": "TInstant *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "tintseq_from_mfjson", + "file": "meos_internal.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "mfjson", + "cType": "json_object *", + "canonical": "struct json_object *" + } + ] + }, + { + "name": "tintseq_in", + "file": "meos_internal.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "tintseqset_from_mfjson", + "file": "meos_internal.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "mfjson", + "cType": "json_object *", + "canonical": "struct json_object *" + } + ] + }, + { + "name": "tintseqset_in", + "file": "meos_internal.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "tsequence_from_mfjson", + "file": "meos_internal.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "mfjson", + "cType": "json_object *", + "canonical": "struct json_object *" + }, + { + "name": "spatial", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + }, + { + "name": "temptype", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "tsequence_in", + "file": "meos_internal.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + }, + { + "name": "temptype", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "tsequence_out", + "file": "meos_internal.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "tsequenceset_from_mfjson", + "file": "meos_internal.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "mfjson", + "cType": "json_object *", + "canonical": "struct json_object *" + }, + { + "name": "spatial", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + }, + { + "name": "temptype", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "tsequenceset_in", + "file": "meos_internal.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + }, + { + "name": "temptype", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "tsequenceset_out", + "file": "meos_internal.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const TSequenceSet *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "ttextinst_from_mfjson", + "file": "meos_internal.h", + "returnType": { + "c": "TInstant *", + "canonical": "TInstant *" + }, + "params": [ + { + "name": "mfjson", + "cType": "json_object *", + "canonical": "struct json_object *" + } + ] + }, + { + "name": "ttextinst_in", + "file": "meos_internal.h", + "returnType": { + "c": "TInstant *", + "canonical": "TInstant *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "ttextseq_from_mfjson", + "file": "meos_internal.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "mfjson", + "cType": "json_object *", + "canonical": "struct json_object *" + } + ] + }, + { + "name": "ttextseq_in", + "file": "meos_internal.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "ttextseqset_from_mfjson", + "file": "meos_internal.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "mfjson", + "cType": "json_object *", + "canonical": "struct json_object *" + } + ] + }, + { + "name": "ttextseqset_in", + "file": "meos_internal.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "temporal_from_mfjson", + "file": "meos_internal.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "mfjson", + "cType": "const char *", + "canonical": "const char *" + }, + { + "name": "temptype", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "temporal_from_base_temp", + "file": "meos_internal.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "temptype", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tinstant_copy", + "file": "meos_internal.h", + "returnType": { + "c": "TInstant *", + "canonical": "TInstant *" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const TInstant *" + } + ] + }, + { + "name": "tinstant_make", + "file": "meos_internal.h", + "returnType": { + "c": "TInstant *", + "canonical": "TInstant *" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "temptype", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "tinstant_make_free", + "file": "meos_internal.h", + "returnType": { + "c": "TInstant *", + "canonical": "TInstant *" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "temptype", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "tsequence_copy", + "file": "meos_internal.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + } + ] + }, + { + "name": "tsequence_from_base_temp", + "file": "meos_internal.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "temptype", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + } + ] + }, + { + "name": "tsequence_from_base_tstzset", + "file": "meos_internal.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "temptype", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "tsequence_from_base_tstzspan", + "file": "meos_internal.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "temptype", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "tsequence_make_exp", + "file": "meos_internal.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "instants", + "cType": "TInstant **", + "canonical": "TInstant **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "maxcount", + "cType": "int", + "canonical": "int" + }, + { + "name": "lower_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "upper_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + }, + { + "name": "normalize", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tsequence_make_free", + "file": "meos_internal.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "instants", + "cType": "TInstant **", + "canonical": "TInstant **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "lower_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "upper_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + }, + { + "name": "normalize", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tsequenceset_copy", + "file": "meos_internal.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const TSequenceSet *" + } + ] + }, + { + "name": "tseqsetarr_to_tseqset", + "file": "meos_internal.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "seqsets", + "cType": "TSequenceSet **", + "canonical": "TSequenceSet **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "totalseqs", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "tsequenceset_from_base_temp", + "file": "meos_internal.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "temptype", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const TSequenceSet *" + } + ] + }, + { + "name": "tsequenceset_from_base_tstzspanset", + "file": "meos_internal.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "temptype", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "tsequenceset_make_exp", + "file": "meos_internal.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "sequences", + "cType": "TSequence **", + "canonical": "TSequence **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "maxcount", + "cType": "int", + "canonical": "int" + }, + { + "name": "normalize", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tsequenceset_make_free", + "file": "meos_internal.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "sequences", + "cType": "TSequence **", + "canonical": "TSequence **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "normalize", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "temporal_set_tstzspan", + "file": "meos_internal.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "s", + "cType": "Span *", + "canonical": "Span *" + } + ] + }, + { + "name": "tinstant_set_tstzspan", + "file": "meos_internal.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const TInstant *" + }, + { + "name": "s", + "cType": "Span *", + "canonical": "Span *" + } + ] + }, + { + "name": "tnumber_set_tbox", + "file": "meos_internal.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "TBox *", + "canonical": "TBox *" + } + ] + }, + { + "name": "tnumberinst_set_tbox", + "file": "meos_internal.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const TInstant *" + }, + { + "name": "box", + "cType": "TBox *", + "canonical": "TBox *" + } + ] + }, + { + "name": "tnumberseq_set_tbox", + "file": "meos_internal.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "box", + "cType": "TBox *", + "canonical": "TBox *" + } + ] + }, + { + "name": "tnumberseqset_set_tbox", + "file": "meos_internal.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const TSequenceSet *" + }, + { + "name": "box", + "cType": "TBox *", + "canonical": "TBox *" + } + ] + }, + { + "name": "tsequence_set_tstzspan", + "file": "meos_internal.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "s", + "cType": "Span *", + "canonical": "Span *" + } + ] + }, + { + "name": "tsequenceset_set_tstzspan", + "file": "meos_internal.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const TSequenceSet *" + }, + { + "name": "s", + "cType": "Span *", + "canonical": "Span *" + } + ] + }, + { + "name": "temporal_end_inst", + "file": "meos_internal.h", + "returnType": { + "c": "const TInstant *", + "canonical": "const TInstant *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "temporal_end_value", + "file": "meos_internal.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "temporal_inst_n", + "file": "meos_internal.h", + "returnType": { + "c": "const TInstant *", + "canonical": "const TInstant *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "n", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "temporal_insts_p", + "file": "meos_internal.h", + "returnType": { + "c": "const TInstant **", + "canonical": "const TInstant **" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "temporal_max_inst_p", + "file": "meos_internal.h", + "returnType": { + "c": "const TInstant *", + "canonical": "const TInstant *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "temporal_max_value", + "file": "meos_internal.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "temporal_mem_size", + "file": "meos_internal.h", + "returnType": { + "c": "size_t", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "temporal_min_inst_p", + "file": "meos_internal.h", + "returnType": { + "c": "const TInstant *", + "canonical": "const TInstant *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "temporal_min_value", + "file": "meos_internal.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "temporal_sequences_p", + "file": "meos_internal.h", + "returnType": { + "c": "const TSequence **", + "canonical": "const TSequence **" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "temporal_set_bbox", + "file": "meos_internal.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "void *", + "canonical": "void *" + } + ] + }, + { + "name": "temporal_start_inst", + "file": "meos_internal.h", + "returnType": { + "c": "const TInstant *", + "canonical": "const TInstant *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "temporal_start_value", + "file": "meos_internal.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "temporal_values_p", + "file": "meos_internal.h", + "returnType": { + "c": "Datum *", + "canonical": "unsigned long *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "temporal_value_n", + "file": "meos_internal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "n", + "cType": "int", + "canonical": "int" + }, + { + "name": "result", + "cType": "Datum *", + "canonical": "unsigned long *" + } + ] + }, + { + "name": "temporal_values", + "file": "meos_internal.h", + "returnType": { + "c": "Datum *", + "canonical": "unsigned long *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tinstant_hash", + "file": "meos_internal.h", + "returnType": { + "c": "uint32", + "canonical": "unsigned int" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const TInstant *" + } + ] + }, + { + "name": "tinstant_insts", + "file": "meos_internal.h", + "returnType": { + "c": "const TInstant **", + "canonical": "const TInstant **" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const TInstant *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tinstant_set_bbox", + "file": "meos_internal.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const TInstant *" + }, + { + "name": "box", + "cType": "void *", + "canonical": "void *" + } + ] + }, + { + "name": "tinstant_time", + "file": "meos_internal.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const TInstant *" + } + ] + }, + { + "name": "tinstant_timestamps", + "file": "meos_internal.h", + "returnType": { + "c": "TimestampTz *", + "canonical": "long *" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const TInstant *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tinstant_value_p", + "file": "meos_internal.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const TInstant *" + } + ] + }, + { + "name": "tinstant_value", + "file": "meos_internal.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const TInstant *" + } + ] + }, + { + "name": "tinstant_value_at_timestamptz", + "file": "meos_internal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const TInstant *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "result", + "cType": "Datum *", + "canonical": "unsigned long *" + } + ] + }, + { + "name": "tinstant_values_p", + "file": "meos_internal.h", + "returnType": { + "c": "Datum *", + "canonical": "unsigned long *" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const TInstant *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tnumber_set_span", + "file": "meos_internal.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "span", + "cType": "Span *", + "canonical": "Span *" + } + ] + }, + { + "name": "tnumberinst_valuespans", + "file": "meos_internal.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const TInstant *" + } + ] + }, + { + "name": "tnumberseq_avg_val", + "file": "meos_internal.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + } + ] + }, + { + "name": "tnumberseq_valuespans", + "file": "meos_internal.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + } + ] + }, + { + "name": "tnumberseqset_avg_val", + "file": "meos_internal.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const TSequenceSet *" + } + ] + }, + { + "name": "tnumberseqset_valuespans", + "file": "meos_internal.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const TSequenceSet *" + } + ] + }, + { + "name": "tsequence_duration", + "file": "meos_internal.h", + "returnType": { + "c": "Interval *", + "canonical": "Interval *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + } + ] + }, + { + "name": "tsequence_end_timestamptz", + "file": "meos_internal.h", + "returnType": { + "c": "TimestampTz", + "canonical": "long" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + } + ] + }, + { + "name": "tsequence_hash", + "file": "meos_internal.h", + "returnType": { + "c": "uint32", + "canonical": "unsigned int" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + } + ] + }, + { + "name": "tsequence_insts_p", + "file": "meos_internal.h", + "returnType": { + "c": "const TInstant **", + "canonical": "const TInstant **" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tsequence_max_inst_p", + "file": "meos_internal.h", + "returnType": { + "c": "const TInstant *", + "canonical": "const TInstant *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + } + ] + }, + { + "name": "tsequence_max_val", + "file": "meos_internal.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + } + ] + }, + { + "name": "tsequence_min_inst_p", + "file": "meos_internal.h", + "returnType": { + "c": "const TInstant *", + "canonical": "const TInstant *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + } + ] + }, + { + "name": "tsequence_min_val", + "file": "meos_internal.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + } + ] + }, + { + "name": "tsequence_segments", + "file": "meos_internal.h", + "returnType": { + "c": "TSequence **", + "canonical": "TSequence **" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tsequence_seqs", + "file": "meos_internal.h", + "returnType": { + "c": "const TSequence **", + "canonical": "const TSequence **" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tsequence_start_timestamptz", + "file": "meos_internal.h", + "returnType": { + "c": "TimestampTz", + "canonical": "long" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + } + ] + }, + { + "name": "tsequence_time", + "file": "meos_internal.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + } + ] + }, + { + "name": "tsequence_timestamps", + "file": "meos_internal.h", + "returnType": { + "c": "TimestampTz *", + "canonical": "long *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tsequence_value_at_timestamptz", + "file": "meos_internal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "strict", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "result", + "cType": "Datum *", + "canonical": "unsigned long *" + } + ] + }, + { + "name": "tsequence_values_p", + "file": "meos_internal.h", + "returnType": { + "c": "Datum *", + "canonical": "unsigned long *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tsequenceset_duration", + "file": "meos_internal.h", + "returnType": { + "c": "Interval *", + "canonical": "Interval *" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const TSequenceSet *" + }, + { + "name": "boundspan", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tsequenceset_end_timestamptz", + "file": "meos_internal.h", + "returnType": { + "c": "TimestampTz", + "canonical": "long" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const TSequenceSet *" + } + ] + }, + { + "name": "tsequenceset_hash", + "file": "meos_internal.h", + "returnType": { + "c": "uint32", + "canonical": "unsigned int" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const TSequenceSet *" + } + ] + }, + { + "name": "tsequenceset_inst_n", + "file": "meos_internal.h", + "returnType": { + "c": "const TInstant *", + "canonical": "const TInstant *" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const TSequenceSet *" + }, + { + "name": "n", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "tsequenceset_insts_p", + "file": "meos_internal.h", + "returnType": { + "c": "const TInstant **", + "canonical": "const TInstant **" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const TSequenceSet *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tsequenceset_max_inst_p", + "file": "meos_internal.h", + "returnType": { + "c": "const TInstant *", + "canonical": "const TInstant *" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const TSequenceSet *" + } + ] + }, + { + "name": "tsequenceset_max_val", + "file": "meos_internal.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const TSequenceSet *" + } + ] + }, + { + "name": "tsequenceset_min_inst_p", + "file": "meos_internal.h", + "returnType": { + "c": "const TInstant *", + "canonical": "const TInstant *" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const TSequenceSet *" + } + ] + }, + { + "name": "tsequenceset_min_val", + "file": "meos_internal.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const TSequenceSet *" + } + ] + }, + { + "name": "tsequenceset_num_instants", + "file": "meos_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const TSequenceSet *" + } + ] + }, + { + "name": "tsequenceset_num_timestamps", + "file": "meos_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const TSequenceSet *" + } + ] + }, + { + "name": "tsequenceset_segments", + "file": "meos_internal.h", + "returnType": { + "c": "TSequence **", + "canonical": "TSequence **" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const TSequenceSet *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tsequenceset_sequences_p", + "file": "meos_internal.h", + "returnType": { + "c": "const TSequence **", + "canonical": "const TSequence **" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const TSequenceSet *" + } + ] + }, + { + "name": "tsequenceset_start_timestamptz", + "file": "meos_internal.h", + "returnType": { + "c": "TimestampTz", + "canonical": "long" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const TSequenceSet *" + } + ] + }, + { + "name": "tsequenceset_time", + "file": "meos_internal.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const TSequenceSet *" + } + ] + }, + { + "name": "tsequenceset_timestamptz_n", + "file": "meos_internal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const TSequenceSet *" + }, + { + "name": "n", + "cType": "int", + "canonical": "int" + }, + { + "name": "result", + "cType": "TimestampTz *", + "canonical": "long *" + } + ] + }, + { + "name": "tsequenceset_timestamps", + "file": "meos_internal.h", + "returnType": { + "c": "TimestampTz *", + "canonical": "long *" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const TSequenceSet *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tsequenceset_value_at_timestamptz", + "file": "meos_internal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const TSequenceSet *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "strict", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "result", + "cType": "Datum *", + "canonical": "unsigned long *" + } + ] + }, + { + "name": "tsequenceset_value_n", + "file": "meos_internal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const TSequenceSet *" + }, + { + "name": "n", + "cType": "int", + "canonical": "int" + }, + { + "name": "result", + "cType": "Datum *", + "canonical": "unsigned long *" + } + ] + }, + { + "name": "tsequenceset_value_n_p", + "file": "meos_internal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const TSequenceSet *" + }, + { + "name": "n", + "cType": "int", + "canonical": "int" + }, + { + "name": "result", + "cType": "Datum *", + "canonical": "unsigned long *" + } + ] + }, + { + "name": "tsequenceset_values_p", + "file": "meos_internal.h", + "returnType": { + "c": "Datum *", + "canonical": "unsigned long *" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const TSequenceSet *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "temporal_restart", + "file": "meos_internal.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "temp", + "cType": "Temporal *", + "canonical": "Temporal *" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "temporal_tsequence", + "file": "meos_internal.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "temporal_tsequenceset", + "file": "meos_internal.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "tinstant_shift_time", + "file": "meos_internal.h", + "returnType": { + "c": "TInstant *", + "canonical": "TInstant *" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const TInstant *" + }, + { + "name": "interv", + "cType": "const Interval *", + "canonical": "const Interval *" + } + ] + }, + { + "name": "tinstant_to_tsequence", + "file": "meos_internal.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const TInstant *" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "tinstant_to_tsequence_free", + "file": "meos_internal.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "inst", + "cType": "TInstant *", + "canonical": "TInstant *" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "tinstant_to_tsequenceset", + "file": "meos_internal.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const TInstant *" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "tnumber_shift_scale_value", + "file": "meos_internal.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "shift", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "width", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "hasshift", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "haswidth", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tnumberinst_shift_value", + "file": "meos_internal.h", + "returnType": { + "c": "TInstant *", + "canonical": "TInstant *" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const TInstant *" + }, + { + "name": "shift", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "tnumberseq_shift_scale_value", + "file": "meos_internal.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "shift", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "width", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "hasshift", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "haswidth", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tnumberseqset_shift_scale_value", + "file": "meos_internal.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const TSequenceSet *" + }, + { + "name": "start", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "width", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "hasshift", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "haswidth", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tsequence_restart", + "file": "meos_internal.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "seq", + "cType": "TSequence *", + "canonical": "TSequence *" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "tsequence_set_interp", + "file": "meos_internal.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "tsequence_shift_scale_time", + "file": "meos_internal.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "shift", + "cType": "const Interval *", + "canonical": "const Interval *" + }, + { + "name": "duration", + "cType": "const Interval *", + "canonical": "const Interval *" + } + ] + }, + { + "name": "tsequence_subseq", + "file": "meos_internal.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "from", + "cType": "int", + "canonical": "int" + }, + { + "name": "to", + "cType": "int", + "canonical": "int" + }, + { + "name": "lower_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "upper_inc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tsequence_to_tinstant", + "file": "meos_internal.h", + "returnType": { + "c": "TInstant *", + "canonical": "TInstant *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + } + ] + }, + { + "name": "tsequence_to_tsequenceset", + "file": "meos_internal.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + } + ] + }, + { + "name": "tsequence_to_tsequenceset_free", + "file": "meos_internal.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "seq", + "cType": "TSequence *", + "canonical": "TSequence *" + } + ] + }, + { + "name": "tsequence_to_tsequenceset_interp", + "file": "meos_internal.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "tsequenceset_restart", + "file": "meos_internal.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "ss", + "cType": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "tsequenceset_set_interp", + "file": "meos_internal.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const TSequenceSet *" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "tsequenceset_shift_scale_time", + "file": "meos_internal.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const TSequenceSet *" + }, + { + "name": "start", + "cType": "const Interval *", + "canonical": "const Interval *" + }, + { + "name": "duration", + "cType": "const Interval *", + "canonical": "const Interval *" + } + ] + }, + { + "name": "tsequenceset_to_discrete", + "file": "meos_internal.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const TSequenceSet *" + } + ] + }, + { + "name": "tsequenceset_to_linear", + "file": "meos_internal.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const TSequenceSet *" + } + ] + }, + { + "name": "tsequenceset_to_step", + "file": "meos_internal.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const TSequenceSet *" + } + ] + }, + { + "name": "tsequenceset_to_tinstant", + "file": "meos_internal.h", + "returnType": { + "c": "TInstant *", + "canonical": "TInstant *" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const TSequenceSet *" + } + ] + }, + { + "name": "tsequenceset_to_tsequence", + "file": "meos_internal.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const TSequenceSet *" + } + ] + }, + { + "name": "tinstant_merge", + "file": "meos_internal.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "inst1", + "cType": "const TInstant *", + "canonical": "const TInstant *" + }, + { + "name": "inst2", + "cType": "const TInstant *", + "canonical": "const TInstant *" + } + ] + }, + { + "name": "tinstant_merge_array", + "file": "meos_internal.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "instants", + "cType": "TInstant **", + "canonical": "TInstant **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "tsequence_append_tinstant", + "file": "meos_internal.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "seq", + "cType": "TSequence *", + "canonical": "TSequence *" + }, + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const TInstant *" + }, + { + "name": "maxdist", + "cType": "double", + "canonical": "double" + }, + { + "name": "maxt", + "cType": "const Interval *", + "canonical": "const Interval *" + }, + { + "name": "expand", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tsequence_append_tsequence", + "file": "meos_internal.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "seq1", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "seq2", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "expand", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tsequence_delete_timestamptz", + "file": "meos_internal.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "connect", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tsequence_delete_tstzset", + "file": "meos_internal.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "connect", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tsequence_delete_tstzspan", + "file": "meos_internal.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "connect", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tsequence_delete_tstzspanset", + "file": "meos_internal.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "connect", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tsequence_insert", + "file": "meos_internal.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "seq1", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "seq2", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "connect", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tsequence_merge", + "file": "meos_internal.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "seq1", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "seq2", + "cType": "const TSequence *", + "canonical": "const TSequence *" + } + ] + }, + { + "name": "tsequence_merge_array", + "file": "meos_internal.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "sequences", + "cType": "TSequence **", + "canonical": "TSequence **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "tsequenceset_append_tinstant", + "file": "meos_internal.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "ss", + "cType": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const TInstant *" + }, + { + "name": "maxdist", + "cType": "double", + "canonical": "double" + }, + { + "name": "maxt", + "cType": "const Interval *", + "canonical": "const Interval *" + }, + { + "name": "expand", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tsequenceset_append_tsequence", + "file": "meos_internal.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "ss", + "cType": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "expand", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tsequenceset_delete_timestamptz", + "file": "meos_internal.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const TSequenceSet *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "tsequenceset_delete_tstzset", + "file": "meos_internal.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const TSequenceSet *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "tsequenceset_delete_tstzspan", + "file": "meos_internal.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const TSequenceSet *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "tsequenceset_delete_tstzspanset", + "file": "meos_internal.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const TSequenceSet *" + }, + { + "name": "ps", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "tsequenceset_insert", + "file": "meos_internal.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "ss1", + "cType": "const TSequenceSet *", + "canonical": "const TSequenceSet *" + }, + { + "name": "ss2", + "cType": "const TSequenceSet *", + "canonical": "const TSequenceSet *" + } + ] + }, + { + "name": "tsequenceset_merge", + "file": "meos_internal.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "ss1", + "cType": "const TSequenceSet *", + "canonical": "const TSequenceSet *" + }, + { + "name": "ss2", + "cType": "const TSequenceSet *", + "canonical": "const TSequenceSet *" + } + ] + }, + { + "name": "tsequenceset_merge_array", + "file": "meos_internal.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "seqsets", + "cType": "TSequenceSet **", + "canonical": "TSequenceSet **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "tsequence_expand_bbox", + "file": "meos_internal.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "seq", + "cType": "TSequence *", + "canonical": "TSequence *" + }, + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const TInstant *" + } + ] + }, + { + "name": "tsequence_set_bbox", + "file": "meos_internal.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "box", + "cType": "void *", + "canonical": "void *" + } + ] + }, + { + "name": "tsequenceset_expand_bbox", + "file": "meos_internal.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "ss", + "cType": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + } + ] + }, + { + "name": "tsequenceset_set_bbox", + "file": "meos_internal.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const TSequenceSet *" + }, + { + "name": "box", + "cType": "void *", + "canonical": "void *" + } + ] + }, + { + "name": "tcontseq_after_timestamptz", + "file": "meos_internal.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "strict", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tcontseq_before_timestamptz", + "file": "meos_internal.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "strict", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tcontseq_restrict_minmax", + "file": "meos_internal.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "min", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tdiscseq_after_timestamptz", + "file": "meos_internal.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "strict", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tdiscseq_before_timestamptz", + "file": "meos_internal.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "strict", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tdiscseq_restrict_minmax", + "file": "meos_internal.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "min", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "temporal_bbox_restrict_set", + "file": "meos_internal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "set", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "temporal_restrict_minmax", + "file": "meos_internal.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "min", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "temporal_restrict_timestamptz", + "file": "meos_internal.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "temporal_restrict_tstzset", + "file": "meos_internal.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "temporal_restrict_tstzspan", + "file": "meos_internal.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "temporal_restrict_tstzspanset", + "file": "meos_internal.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "temporal_restrict_value", + "file": "meos_internal.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "temporal_restrict_values", + "file": "meos_internal.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "set", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "temporal_value_at_timestamptz", + "file": "meos_internal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "strict", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "result", + "cType": "Datum *", + "canonical": "unsigned long *" + } + ] + }, + { + "name": "tinstant_after_timestamptz", + "file": "meos_internal.h", + "returnType": { + "c": "TInstant *", + "canonical": "TInstant *" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const TInstant *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "strict", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tinstant_before_timestamptz", + "file": "meos_internal.h", + "returnType": { + "c": "TInstant *", + "canonical": "TInstant *" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const TInstant *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "strict", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tinstant_restrict_tstzspan", + "file": "meos_internal.h", + "returnType": { + "c": "TInstant *", + "canonical": "TInstant *" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const TInstant *" + }, + { + "name": "period", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tinstant_restrict_tstzspanset", + "file": "meos_internal.h", + "returnType": { + "c": "TInstant *", + "canonical": "TInstant *" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const TInstant *" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tinstant_restrict_timestamptz", + "file": "meos_internal.h", + "returnType": { + "c": "TInstant *", + "canonical": "TInstant *" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const TInstant *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tinstant_restrict_tstzset", + "file": "meos_internal.h", + "returnType": { + "c": "TInstant *", + "canonical": "TInstant *" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const TInstant *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tinstant_restrict_value", + "file": "meos_internal.h", + "returnType": { + "c": "TInstant *", + "canonical": "TInstant *" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const TInstant *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tinstant_restrict_values", + "file": "meos_internal.h", + "returnType": { + "c": "TInstant *", + "canonical": "TInstant *" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const TInstant *" + }, + { + "name": "set", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tnumber_restrict_span", + "file": "meos_internal.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "span", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tnumber_restrict_spanset", + "file": "meos_internal.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tnumberinst_restrict_span", + "file": "meos_internal.h", + "returnType": { + "c": "TInstant *", + "canonical": "TInstant *" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const TInstant *" + }, + { + "name": "span", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tnumberinst_restrict_spanset", + "file": "meos_internal.h", + "returnType": { + "c": "TInstant *", + "canonical": "TInstant *" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const TInstant *" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tnumberseqset_restrict_span", + "file": "meos_internal.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const TSequenceSet *" + }, + { + "name": "span", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tnumberseqset_restrict_spanset", + "file": "meos_internal.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const TSequenceSet *" + }, + { + "name": "spanset", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tsequence_at_timestamptz", + "file": "meos_internal.h", + "returnType": { + "c": "TInstant *", + "canonical": "TInstant *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "tsequence_restrict_tstzspan", + "file": "meos_internal.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tsequence_restrict_tstzspanset", + "file": "meos_internal.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tsequenceset_after_timestamptz", + "file": "meos_internal.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const TSequenceSet *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "strict", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tsequenceset_before_timestamptz", + "file": "meos_internal.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const TSequenceSet *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "strict", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tsequenceset_restrict_minmax", + "file": "meos_internal.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const TSequenceSet *" + }, + { + "name": "min", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tsequenceset_restrict_tstzspan", + "file": "meos_internal.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const TSequenceSet *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tsequenceset_restrict_tstzspanset", + "file": "meos_internal.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const TSequenceSet *" + }, + { + "name": "ps", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tsequenceset_restrict_timestamptz", + "file": "meos_internal.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const TSequenceSet *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tsequenceset_restrict_tstzset", + "file": "meos_internal.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const TSequenceSet *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tsequenceset_restrict_value", + "file": "meos_internal.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const TSequenceSet *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tsequenceset_restrict_values", + "file": "meos_internal.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const TSequenceSet *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tinstant_cmp", + "file": "meos_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "inst1", + "cType": "const TInstant *", + "canonical": "const TInstant *" + }, + { + "name": "inst2", + "cType": "const TInstant *", + "canonical": "const TInstant *" + } + ] + }, + { + "name": "tinstant_eq", + "file": "meos_internal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "inst1", + "cType": "const TInstant *", + "canonical": "const TInstant *" + }, + { + "name": "inst2", + "cType": "const TInstant *", + "canonical": "const TInstant *" + } + ] + }, + { + "name": "tsequence_cmp", + "file": "meos_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "seq1", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "seq2", + "cType": "const TSequence *", + "canonical": "const TSequence *" + } + ] + }, + { + "name": "tsequence_eq", + "file": "meos_internal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "seq1", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "seq2", + "cType": "const TSequence *", + "canonical": "const TSequence *" + } + ] + }, + { + "name": "tsequenceset_cmp", + "file": "meos_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "ss1", + "cType": "const TSequenceSet *", + "canonical": "const TSequenceSet *" + }, + { + "name": "ss2", + "cType": "const TSequenceSet *", + "canonical": "const TSequenceSet *" + } + ] + }, + { + "name": "tsequenceset_eq", + "file": "meos_internal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss1", + "cType": "const TSequenceSet *", + "canonical": "const TSequenceSet *" + }, + { + "name": "ss2", + "cType": "const TSequenceSet *", + "canonical": "const TSequenceSet *" + } + ] + }, + { + "name": "always_eq_base_temporal", + "file": "meos_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_eq_temporal_base", + "file": "meos_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "always_ne_base_temporal", + "file": "meos_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_ne_temporal_base", + "file": "meos_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "always_ge_base_temporal", + "file": "meos_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_ge_temporal_base", + "file": "meos_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "always_gt_base_temporal", + "file": "meos_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_gt_temporal_base", + "file": "meos_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "always_le_base_temporal", + "file": "meos_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_le_temporal_base", + "file": "meos_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "always_lt_base_temporal", + "file": "meos_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_lt_temporal_base", + "file": "meos_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "ever_eq_base_temporal", + "file": "meos_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_eq_temporal_base", + "file": "meos_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "ever_ne_base_temporal", + "file": "meos_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_ne_temporal_base", + "file": "meos_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "ever_ge_base_temporal", + "file": "meos_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_ge_temporal_base", + "file": "meos_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "ever_gt_base_temporal", + "file": "meos_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_gt_temporal_base", + "file": "meos_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "ever_le_base_temporal", + "file": "meos_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_le_temporal_base", + "file": "meos_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "ever_lt_base_temporal", + "file": "meos_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_lt_temporal_base", + "file": "meos_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "tnumberinst_abs", + "file": "meos_internal.h", + "returnType": { + "c": "TInstant *", + "canonical": "TInstant *" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const TInstant *" + } + ] + }, + { + "name": "tnumberinst_distance", + "file": "meos_internal.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "inst1", + "cType": "const TInstant *", + "canonical": "const TInstant *" + }, + { + "name": "inst2", + "cType": "const TInstant *", + "canonical": "const TInstant *" + } + ] + }, + { + "name": "tnumberseq_abs", + "file": "meos_internal.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + } + ] + }, + { + "name": "tnumberseq_angular_difference", + "file": "meos_internal.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + } + ] + }, + { + "name": "tnumberseq_delta_value", + "file": "meos_internal.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + } + ] + }, + { + "name": "tnumberseqset_abs", + "file": "meos_internal.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const TSequenceSet *" + } + ] + }, + { + "name": "tnumberseqset_angular_difference", + "file": "meos_internal.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const TSequenceSet *" + } + ] + }, + { + "name": "tnumberseqset_delta_value", + "file": "meos_internal.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const TSequenceSet *" + } + ] + }, + { + "name": "tdistance_tnumber_number", + "file": "meos_internal.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "nad_tbox_tbox", + "file": "meos_internal.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "box1", + "cType": "const TBox *", + "canonical": "const TBox *" + }, + { + "name": "box2", + "cType": "const TBox *", + "canonical": "const TBox *" + } + ] + }, + { + "name": "nad_tnumber_number", + "file": "meos_internal.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "nad_tnumber_tbox", + "file": "meos_internal.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const TBox *", + "canonical": "const TBox *" + } + ] + }, + { + "name": "nad_tnumber_tnumber", + "file": "meos_internal.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tnumberseq_integral", + "file": "meos_internal.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + } + ] + }, + { + "name": "tnumberseq_twavg", + "file": "meos_internal.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + } + ] + }, + { + "name": "tnumberseqset_integral", + "file": "meos_internal.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const TSequenceSet *" + } + ] + }, + { + "name": "tnumberseqset_twavg", + "file": "meos_internal.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const TSequenceSet *" + } + ] + }, + { + "name": "temporal_compact", + "file": "meos_internal.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tsequence_compact", + "file": "meos_internal.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + } + ] + }, + { + "name": "tsequenceset_compact", + "file": "meos_internal.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const TSequenceSet *" + } + ] + }, + { + "name": "temporal_skiplist_make", + "file": "meos_internal.h", + "returnType": { + "c": "SkipList *", + "canonical": "struct SkipList *" + }, + "params": [] + }, + { + "name": "skiplist_make", + "file": "meos_internal.h", + "returnType": { + "c": "SkipList *", + "canonical": "struct SkipList *" + }, + "params": [ + { + "name": "key_size", + "cType": "size_t", + "canonical": "unsigned long" + }, + { + "name": "value_size", + "cType": "size_t", + "canonical": "unsigned long" + }, + { + "name": "comp_fn", + "cType": "int (*)(void *, void *)", + "canonical": "int (*)(void *, void *)" + }, + { + "name": "merge_fn", + "cType": "void *(*)(void *, void *)", + "canonical": "void *(*)(void *, void *)" + } + ] + }, + { + "name": "skiplist_search", + "file": "meos_internal.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "list", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "key", + "cType": "void *", + "canonical": "void *" + }, + { + "name": "value", + "cType": "void *", + "canonical": "void *" + } + ] + }, + { + "name": "skiplist_free", + "file": "meos_internal.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "list", + "cType": "SkipList *", + "canonical": "struct SkipList *" + } + ] + }, + { + "name": "skiplist_splice", + "file": "meos_internal.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "list", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "keys", + "cType": "void **", + "canonical": "void **" + }, + { + "name": "values", + "cType": "void **", + "canonical": "void **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "func", + "cType": "datum_func2", + "canonical": "unsigned long (*)(unsigned long, unsigned long)" + }, + { + "name": "crossings", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "sktype", + "cType": "SkipListType", + "canonical": "SkipListType" + } + ] + }, + { + "name": "temporal_skiplist_splice", + "file": "meos_internal.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "list", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "values", + "cType": "void **", + "canonical": "void **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "func", + "cType": "datum_func2", + "canonical": "unsigned long (*)(unsigned long, unsigned long)" + }, + { + "name": "crossings", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "skiplist_values", + "file": "meos_internal.h", + "returnType": { + "c": "void **", + "canonical": "void **" + }, + "params": [ + { + "name": "list", + "cType": "SkipList *", + "canonical": "struct SkipList *" + } + ] + }, + { + "name": "skiplist_keys_values", + "file": "meos_internal.h", + "returnType": { + "c": "void **", + "canonical": "void **" + }, + "params": [ + { + "name": "list", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "values", + "cType": "void **", + "canonical": "void **" + } + ] + }, + { + "name": "temporal_app_tinst_transfn", + "file": "meos_internal.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "state", + "cType": "Temporal *", + "canonical": "Temporal *" + }, + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const TInstant *" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + }, + { + "name": "maxdist", + "cType": "double", + "canonical": "double" + }, + { + "name": "maxt", + "cType": "const Interval *", + "canonical": "const Interval *" + } + ] + }, + { + "name": "temporal_app_tseq_transfn", + "file": "meos_internal.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "state", + "cType": "Temporal *", + "canonical": "Temporal *" + }, + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + } + ] + }, + { + "name": "span_bins", + "file": "meos_internal.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "size", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "origin", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "spanset_bins", + "file": "meos_internal.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "size", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "origin", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tnumber_value_bins", + "file": "meos_internal.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "size", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "origin", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tnumber_value_time_boxes", + "file": "meos_internal.h", + "returnType": { + "c": "TBox *", + "canonical": "TBox *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "vsize", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "duration", + "cType": "const Interval *", + "canonical": "const Interval *" + }, + { + "name": "vorigin", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "torigin", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tnumber_value_split", + "file": "meos_internal.h", + "returnType": { + "c": "Temporal **", + "canonical": "Temporal **" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "vsize", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "vorigin", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "bins", + "cType": "Datum **", + "canonical": "unsigned long **" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tbox_get_value_time_tile", + "file": "meos_internal.h", + "returnType": { + "c": "TBox *", + "canonical": "TBox *" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "vsize", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "duration", + "cType": "const Interval *", + "canonical": "const Interval *" + }, + { + "name": "vorigin", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "torigin", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "basetype", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "spantype", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "tnumber_value_time_split", + "file": "meos_internal.h", + "returnType": { + "c": "Temporal **", + "canonical": "Temporal **" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "size", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "duration", + "cType": "const Interval *", + "canonical": "const Interval *" + }, + { + "name": "vorigin", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "torigin", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "value_bins", + "cType": "Datum **", + "canonical": "unsigned long **" + }, + { + "name": "time_bins", + "cType": "TimestampTz **", + "canonical": "long **" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "double2_out", + "file": "doublen.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "d", + "cType": "const double2 *", + "canonical": "const double2 *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "double2_set", + "file": "doublen.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "a", + "cType": "double", + "canonical": "double" + }, + { + "name": "b", + "cType": "double", + "canonical": "double" + }, + { + "name": "result", + "cType": "double2 *", + "canonical": "double2 *" + } + ] + }, + { + "name": "double2_add", + "file": "doublen.h", + "returnType": { + "c": "double2 *", + "canonical": "double2 *" + }, + "params": [ + { + "name": "d1", + "cType": "const double2 *", + "canonical": "const double2 *" + }, + { + "name": "d2", + "cType": "const double2 *", + "canonical": "const double2 *" + } + ] + }, + { + "name": "double2_eq", + "file": "doublen.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "d1", + "cType": "const double2 *", + "canonical": "const double2 *" + }, + { + "name": "d2", + "cType": "const double2 *", + "canonical": "const double2 *" + } + ] + }, + { + "name": "double3_out", + "file": "doublen.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "d", + "cType": "const double3 *", + "canonical": "const double3 *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "double3_set", + "file": "doublen.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "a", + "cType": "double", + "canonical": "double" + }, + { + "name": "b", + "cType": "double", + "canonical": "double" + }, + { + "name": "c", + "cType": "double", + "canonical": "double" + }, + { + "name": "result", + "cType": "double3 *", + "canonical": "double3 *" + } + ] + }, + { + "name": "double3_add", + "file": "doublen.h", + "returnType": { + "c": "double3 *", + "canonical": "double3 *" + }, + "params": [ + { + "name": "d1", + "cType": "const double3 *", + "canonical": "const double3 *" + }, + { + "name": "d2", + "cType": "const double3 *", + "canonical": "const double3 *" + } + ] + }, + { + "name": "double3_eq", + "file": "doublen.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "d1", + "cType": "const double3 *", + "canonical": "const double3 *" + }, + { + "name": "d2", + "cType": "const double3 *", + "canonical": "const double3 *" + } + ] + }, + { + "name": "double4_out", + "file": "doublen.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "d", + "cType": "const double4 *", + "canonical": "const double4 *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "double4_set", + "file": "doublen.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "a", + "cType": "double", + "canonical": "double" + }, + { + "name": "b", + "cType": "double", + "canonical": "double" + }, + { + "name": "c", + "cType": "double", + "canonical": "double" + }, + { + "name": "d", + "cType": "double", + "canonical": "double" + }, + { + "name": "result", + "cType": "double4 *", + "canonical": "double4 *" + } + ] + }, + { + "name": "double4_add", + "file": "doublen.h", + "returnType": { + "c": "double4 *", + "canonical": "double4 *" + }, + "params": [ + { + "name": "d1", + "cType": "const double4 *", + "canonical": "const double4 *" + }, + { + "name": "d2", + "cType": "const double4 *", + "canonical": "const double4 *" + } + ] + }, + { + "name": "double4_eq", + "file": "doublen.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "d1", + "cType": "const double4 *", + "canonical": "const double4 *" + }, + { + "name": "d2", + "cType": "const double4 *", + "canonical": "const double4 *" + } + ] + }, + { + "name": "double2_collinear", + "file": "doublen.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "x1", + "cType": "const double2 *", + "canonical": "const double2 *" + }, + { + "name": "x2", + "cType": "const double2 *", + "canonical": "const double2 *" + }, + { + "name": "x3", + "cType": "const double2 *", + "canonical": "const double2 *" + }, + { + "name": "ratio", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "double3_collinear", + "file": "doublen.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "x1", + "cType": "const double3 *", + "canonical": "const double3 *" + }, + { + "name": "x2", + "cType": "const double3 *", + "canonical": "const double3 *" + }, + { + "name": "x3", + "cType": "const double3 *", + "canonical": "const double3 *" + }, + { + "name": "ratio", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "double4_collinear", + "file": "doublen.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "x1", + "cType": "const double4 *", + "canonical": "const double4 *" + }, + { + "name": "x2", + "cType": "const double4 *", + "canonical": "const double4 *" + }, + { + "name": "x3", + "cType": "const double4 *", + "canonical": "const double4 *" + }, + { + "name": "ratio", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "double2segm_interpolate", + "file": "doublen.h", + "returnType": { + "c": "double2 *", + "canonical": "double2 *" + }, + "params": [ + { + "name": "start", + "cType": "const double2 *", + "canonical": "const double2 *" + }, + { + "name": "end", + "cType": "const double2 *", + "canonical": "const double2 *" + }, + { + "name": "ratio", + "cType": "long double", + "canonical": "long double" + } + ] + }, + { + "name": "double3segm_interpolate", + "file": "doublen.h", + "returnType": { + "c": "double3 *", + "canonical": "double3 *" + }, + "params": [ + { + "name": "start", + "cType": "const double3 *", + "canonical": "const double3 *" + }, + { + "name": "end", + "cType": "const double3 *", + "canonical": "const double3 *" + }, + { + "name": "ratio", + "cType": "long double", + "canonical": "long double" + } + ] + }, + { + "name": "double4segm_interpolate", + "file": "doublen.h", + "returnType": { + "c": "double4 *", + "canonical": "double4 *" + }, + "params": [ + { + "name": "start", + "cType": "const double4 *", + "canonical": "const double4 *" + }, + { + "name": "end", + "cType": "const double4 *", + "canonical": "const double4 *" + }, + { + "name": "ratio", + "cType": "long double", + "canonical": "long double" + } + ] + }, + { + "name": "pg_atoi", + "file": "temporal.h", + "returnType": { + "c": "int32", + "canonical": "int" + }, + "params": [ + { + "name": "s", + "cType": "const char *", + "canonical": "const char *" + }, + { + "name": "size", + "cType": "int", + "canonical": "int" + }, + { + "name": "c", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "ensure_has_X", + "file": "temporal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "flags", + "cType": "int16", + "canonical": "short" + } + ] + }, + { + "name": "ensure_has_Z", + "file": "temporal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "flags", + "cType": "int16", + "canonical": "short" + } + ] + }, + { + "name": "ensure_has_T", + "file": "temporal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "flags", + "cType": "int16", + "canonical": "short" + } + ] + }, + { + "name": "ensure_has_not_Z", + "file": "temporal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "flags", + "cType": "int16", + "canonical": "short" + } + ] + }, + { + "name": "ensure_not_null", + "file": "temporal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ptr", + "cType": "void *", + "canonical": "void *" + } + ] + }, + { + "name": "ensure_one_not_null", + "file": "temporal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ptr1", + "cType": "void *", + "canonical": "void *" + }, + { + "name": "ptr2", + "cType": "void *", + "canonical": "void *" + } + ] + }, + { + "name": "ensure_one_true", + "file": "temporal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "hasshift", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "haswidth", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ensure_valid_interp", + "file": "temporal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temptype", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "ensure_continuous", + "file": "temporal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ensure_same_interp", + "file": "temporal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ensure_same_continuous_interp", + "file": "temporal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "flags1", + "cType": "int16", + "canonical": "short" + }, + { + "name": "flags2", + "cType": "int16", + "canonical": "short" + } + ] + }, + { + "name": "ensure_linear_interp", + "file": "temporal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "flags", + "cType": "int16", + "canonical": "short" + } + ] + }, + { + "name": "ensure_nonlinear_interp", + "file": "temporal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "flags", + "cType": "int16", + "canonical": "short" + } + ] + }, + { + "name": "ensure_common_dimension", + "file": "temporal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "flags1", + "cType": "int16", + "canonical": "short" + }, + { + "name": "flags2", + "cType": "int16", + "canonical": "short" + } + ] + }, + { + "name": "ensure_temporal_isof_type", + "file": "temporal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "ensure_temporal_isof_basetype", + "file": "temporal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "basetype", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "ensure_temporal_isof_subtype", + "file": "temporal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "type", + "cType": "tempSubtype", + "canonical": "tempSubtype" + } + ] + }, + { + "name": "ensure_same_temporal_type", + "file": "temporal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ensure_valid_tnumber_numspan", + "file": "temporal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "ensure_valid_tnumber_numspanset", + "file": "temporal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "ensure_valid_tnumber_tbox", + "file": "temporal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const TBox *", + "canonical": "const TBox *" + } + ] + }, + { + "name": "ensure_valid_temporal_set", + "file": "temporal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "ensure_valid_temporal_temporal", + "file": "temporal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ensure_valid_tnumber_tnumber", + "file": "temporal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ensure_not_negative", + "file": "temporal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "ensure_positive", + "file": "temporal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "not_negative_datum", + "file": "temporal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "size", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "basetype", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "ensure_not_negative_datum", + "file": "temporal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "size", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "basetype", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "positive_datum", + "file": "temporal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "size", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "basetype", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "ensure_positive_datum", + "file": "temporal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "size", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "basetype", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "ensure_valid_day_duration", + "file": "temporal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "duration", + "cType": "const Interval *", + "canonical": "const Interval *" + } + ] + }, + { + "name": "positive_duration", + "file": "temporal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "duration", + "cType": "const Interval *", + "canonical": "const Interval *" + } + ] + }, + { + "name": "ensure_positive_duration", + "file": "temporal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "duration", + "cType": "const Interval *", + "canonical": "const Interval *" + } + ] + }, + { + "name": "temporal_bbox_ptr", + "file": "temporal.h", + "returnType": { + "c": "void *", + "canonical": "void *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "intersection_temporal_temporal", + "file": "temporal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "mode", + "cType": "SyncMode", + "canonical": "SyncMode" + }, + { + "name": "inter1", + "cType": "Temporal **", + "canonical": "Temporal **" + }, + { + "name": "inter2", + "cType": "Temporal **", + "canonical": "Temporal **" + } + ] + }, + { + "name": "mobilitydb_version", + "file": "temporal.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [] + }, + { + "name": "mobilitydb_full_version", + "file": "temporal.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [] + }, + { + "name": "round_fn", + "file": "temporal.h", + "returnType": { + "c": "datum_func2", + "canonical": "unsigned long (*)(unsigned long, unsigned long)" + }, + "params": [ + { + "name": "basetype", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "temporal_bbox_restrict_value", + "file": "temporal.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "ensure_valid_tcbuffer_cbuffer", + "file": "tcbuffer.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + } + ] + }, + { + "name": "ensure_valid_tcbuffer_geo", + "file": "tcbuffer.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "ensure_valid_tcbuffer_stbox", + "file": "tcbuffer.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + } + ] + }, + { + "name": "ensure_valid_tcbuffer_tcbuffer", + "file": "tcbuffer.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tcbuffersegm_intersection_value", + "file": "tcbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "start", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "end", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "lower", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "upper", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "t1", + "cType": "TimestampTz *", + "canonical": "long *" + }, + { + "name": "t2", + "cType": "TimestampTz *", + "canonical": "long *" + } + ] + }, + { + "name": "tcbuffersegm_intersection", + "file": "tcbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "start1", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "end1", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "start2", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "end2", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "lower", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "upper", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "t1", + "cType": "TimestampTz *", + "canonical": "long *" + }, + { + "name": "t2", + "cType": "TimestampTz *", + "canonical": "long *" + } + ] + }, + { + "name": "tcbuffersegm_dwithin_turnpt", + "file": "tcbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "start1", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "end1", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "start2", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "end2", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "dist", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "lower", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "upper", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "t1", + "cType": "TimestampTz *", + "canonical": "long *" + }, + { + "name": "t2", + "cType": "TimestampTz *", + "canonical": "long *" + } + ] + }, + { + "name": "tcbuffersegm_tdwithin_turnpt", + "file": "tcbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "start1", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "end1", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "start2", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "end2", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "dist", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "lower", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "upper", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "t1", + "cType": "TimestampTz *", + "canonical": "long *" + }, + { + "name": "t2", + "cType": "TimestampTz *", + "canonical": "long *" + } + ] + }, + { + "name": "tcbuffersegm_distance_turnpt", + "file": "tcbuffer.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "start1", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "end1", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "start2", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "end2", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "dist", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "cbuffer_set_stbox", + "file": "tcbuffer_boxops.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "box", + "cType": "STBox *", + "canonical": "STBox *" + } + ] + }, + { + "name": "cbufferarr_set_stbox", + "file": "tcbuffer_boxops.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "values", + "cType": "const Datum *", + "canonical": "const unsigned long *" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "box", + "cType": "STBox *", + "canonical": "STBox *" + } + ] + }, + { + "name": "cbuffer_timestamptz_set_stbox", + "file": "tcbuffer_boxops.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "box", + "cType": "STBox *", + "canonical": "STBox *" + } + ] + }, + { + "name": "cbuffer_tstzspan_set_stbox", + "file": "tcbuffer_boxops.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "box", + "cType": "STBox *", + "canonical": "STBox *" + } + ] + }, + { + "name": "tcbufferinst_set_stbox", + "file": "tcbuffer_boxops.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const TInstant *" + }, + { + "name": "box", + "cType": "STBox *", + "canonical": "STBox *" + } + ] + }, + { + "name": "tcbufferinstarr_set_stbox", + "file": "tcbuffer_boxops.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "instants", + "cType": "TInstant **", + "canonical": "TInstant **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "box", + "cType": "STBox *", + "canonical": "STBox *" + } + ] + }, + { + "name": "tcbufferseq_expand_stbox", + "file": "tcbuffer_boxops.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const TInstant *" + } + ] + }, + { + "name": "tcbufferinst_traversed_area", + "file": "tcbuffer_spatialfuncs.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const TInstant *" + } + ] + }, + { + "name": "tcbufferseq_traversed_area", + "file": "tcbuffer_spatialfuncs.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "unary_union", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tcbufferseqset_traversed_area", + "file": "tcbuffer_spatialfuncs.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const TSequenceSet *" + }, + { + "name": "unary_union", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tcbuffersegm_traversed_area", + "file": "tcbuffer_spatialfuncs.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "inst1", + "cType": "const TInstant *", + "canonical": "const TInstant *" + }, + { + "name": "inst2", + "cType": "const TInstant *", + "canonical": "const TInstant *" + } + ] + }, + { + "name": "tcbuffer_restrict_cbuffer", + "file": "tcbuffer_spatialfuncs.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tcbuffer_restrict_stbox", + "file": "tcbuffer_spatialfuncs.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "border_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tcbuffer_restrict_geom", + "file": "tcbuffer_spatialfuncs.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_contains_geo_tcbuffer", + "file": "tcbuffer_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_contains_tcbuffer_geo", + "file": "tcbuffer_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_contains_tcbuffer_cbuffer", + "file": "tcbuffer_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_contains_cbuffer_tcbuffer", + "file": "tcbuffer_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_covers_geo_tcbuffer", + "file": "tcbuffer_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_covers_tcbuffer_geo", + "file": "tcbuffer_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_covers_tcbuffer_cbuffer", + "file": "tcbuffer_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_covers_cbuffer_tcbuffer", + "file": "tcbuffer_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_covers_tcbuffer_tcbuffer", + "file": "tcbuffer_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_disjoint_tcbuffer_geo", + "file": "tcbuffer_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_disjoint_geo_tcbuffer", + "file": "tcbuffer_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_disjoint_tcbuffer_cbuffer", + "file": "tcbuffer_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_disjoint_cbuffer_tcbuffer", + "file": "tcbuffer_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_disjoint_tcbuffer_tcbuffer", + "file": "tcbuffer_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_intersects_tcbuffer_geo", + "file": "tcbuffer_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_intersects_geo_tcbuffer", + "file": "tcbuffer_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_intersects_tcbuffer_cbuffer", + "file": "tcbuffer_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_intersects_cbuffer_tcbuffer", + "file": "tcbuffer_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_intersects_tcbuffer_tcbuffer", + "file": "tcbuffer_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_touches_tcbuffer_geo", + "file": "tcbuffer_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_touches_geo_tcbuffer", + "file": "tcbuffer_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_touches_tcbuffer_cbuffer", + "file": "tcbuffer_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_touches_cbuffer_tcbuffer", + "file": "tcbuffer_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_touches_tcbuffer_tcbuffer", + "file": "tcbuffer_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tinterrel_tcbuffer_cbuffer", + "file": "tcbuffer_tempspatialrels.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "cb", + "cType": "const Cbuffer *", + "canonical": "const struct Cbuffer *" + }, + { + "name": "tinter", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tinterrel_tcbuffer_geo", + "file": "tcbuffer_tempspatialrels.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "tinter", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "clipper2_clip_poly_poly", + "file": "clip_clipper2.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "subj", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "clip", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "op", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "clipper2_traj_poly_periods", + "file": "clip_clipper2.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "out_count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "clip_poly_poly", + "file": "geo_poly_clip.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "subj", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "clip", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "operation", + "cType": "ClipOper", + "canonical": "ClipOper" + } + ] + }, + { + "name": "lwproj_lookup", + "file": "meos_transform.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "srid_from", + "cType": "int32_t", + "canonical": "int" + }, + { + "name": "srid_to", + "cType": "int32_t", + "canonical": "int" + }, + { + "name": "pj", + "cType": "int **", + "canonical": "int **" + } + ] + }, + { + "name": "spheroid_init_from_srid", + "file": "meos_transform.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + }, + { + "name": "s", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "srid_check_latlong", + "file": "meos_transform.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + } + ] + }, + { + "name": "srid_is_latlong", + "file": "meos_transform.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + } + ] + }, + { + "name": "geom_serialize", + "file": "postgis_funcs.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "lwgeom", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "geog_serialize", + "file": "postgis_funcs.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "lwgeom", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "meos_postgis_valid_typmod", + "file": "postgis_funcs.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "gs", + "cType": "int *", + "canonical": "int *" + }, + { + "name": "typmod", + "cType": "int32_t", + "canonical": "int" + } + ] + }, + { + "name": "geo_as_wkt", + "file": "postgis_funcs.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "precision", + "cType": "int", + "canonical": "int" + }, + { + "name": "extended", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "box2d_to_lwgeom", + "file": "postgis_funcs.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "box", + "cType": "int *", + "canonical": "int *" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + } + ] + }, + { + "name": "box3d_to_lwgeom", + "file": "postgis_funcs.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "box", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "MEOS_POSTGIS2GEOS", + "file": "postgis_funcs.h", + "returnType": { + "c": "GEOSGeometry *", + "canonical": "struct GEOSGeom_t *" + }, + "params": [ + { + "name": "pglwgeom", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "MEOS_GEOS2POSTGIS", + "file": "postgis_funcs.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "geom", + "cType": "GEOSGeom", + "canonical": "struct GEOSGeom_t *" + }, + { + "name": "want3d", + "cType": "char", + "canonical": "char" + } + ] + }, + { + "name": "geom_spatialrel", + "file": "postgis_funcs.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "gs1", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "gs2", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "rel", + "cType": "spatialRel", + "canonical": "spatialRel" + } + ] + }, + { + "name": "lwgeom_line_interpolate_point", + "file": "postgis_funcs.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "geom", + "cType": "int *", + "canonical": "int *" + }, + { + "name": "fraction", + "cType": "double", + "canonical": "double" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + }, + { + "name": "repeat", + "cType": "char", + "canonical": "char" + } + ] + }, + { + "name": "point_get_coords", + "file": "stbox.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "point", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "hasz", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "x", + "cType": "double *", + "canonical": "double *" + }, + { + "name": "y", + "cType": "double *", + "canonical": "double *" + }, + { + "name": "z", + "cType": "double *", + "canonical": "double *" + } + ] + }, + { + "name": "tstzset_stbox_slice", + "file": "stbox.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "tsdatum", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "box", + "cType": "STBox *", + "canonical": "STBox *" + } + ] + }, + { + "name": "tstzspanset_stbox_slice", + "file": "stbox.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "psdatum", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "box", + "cType": "STBox *", + "canonical": "STBox *" + } + ] + }, + { + "name": "stbox_index_leaf_consistent", + "file": "stbox_index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "key", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "query", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "strategy", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "stbox_gist_inner_consistent", + "file": "stbox_index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "key", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "query", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "strategy", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "stbox_index_recheck", + "file": "stbox_index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "strategy", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "stboxnode_copy", + "file": "stbox_index.h", + "returnType": { + "c": "STboxNode *", + "canonical": "STboxNode *" + }, + "params": [ + { + "name": "box", + "cType": "const STboxNode *", + "canonical": "const STboxNode *" + } + ] + }, + { + "name": "getQuadrant8D", + "file": "stbox_index.h", + "returnType": { + "c": "uint8", + "canonical": "unsigned char" + }, + "params": [ + { + "name": "centroid", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "inBox", + "cType": "const STBox *", + "canonical": "const STBox *" + } + ] + }, + { + "name": "stboxnode_init", + "file": "stbox_index.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "centroid", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "nodebox", + "cType": "STboxNode *", + "canonical": "STboxNode *" + } + ] + }, + { + "name": "stboxnode_quadtree_next", + "file": "stbox_index.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "nodebox", + "cType": "const STboxNode *", + "canonical": "const STboxNode *" + }, + { + "name": "centroid", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "quadrant", + "cType": "uint8", + "canonical": "unsigned char" + }, + { + "name": "next_nodebox", + "cType": "STboxNode *", + "canonical": "STboxNode *" + } + ] + }, + { + "name": "stboxnode_kdtree_next", + "file": "stbox_index.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "nodebox", + "cType": "const STboxNode *", + "canonical": "const STboxNode *" + }, + { + "name": "centroid", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "node", + "cType": "uint8", + "canonical": "unsigned char" + }, + { + "name": "level", + "cType": "int", + "canonical": "int" + }, + { + "name": "next_nodebox", + "cType": "STboxNode *", + "canonical": "STboxNode *" + } + ] + }, + { + "name": "overlap8D", + "file": "stbox_index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "nodebox", + "cType": "const STboxNode *", + "canonical": "const STboxNode *" + }, + { + "name": "query", + "cType": "const STBox *", + "canonical": "const STBox *" + } + ] + }, + { + "name": "overlapKD", + "file": "stbox_index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "nodebox", + "cType": "const STboxNode *", + "canonical": "const STboxNode *" + }, + { + "name": "query", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "level", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "contain8D", + "file": "stbox_index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "nodebox", + "cType": "const STboxNode *", + "canonical": "const STboxNode *" + }, + { + "name": "query", + "cType": "const STBox *", + "canonical": "const STBox *" + } + ] + }, + { + "name": "containKD", + "file": "stbox_index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "nodebox", + "cType": "const STboxNode *", + "canonical": "const STboxNode *" + }, + { + "name": "query", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "level", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "left8D", + "file": "stbox_index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "nodebox", + "cType": "const STboxNode *", + "canonical": "const STboxNode *" + }, + { + "name": "query", + "cType": "const STBox *", + "canonical": "const STBox *" + } + ] + }, + { + "name": "overLeft8D", + "file": "stbox_index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "nodebox", + "cType": "const STboxNode *", + "canonical": "const STboxNode *" + }, + { + "name": "query", + "cType": "const STBox *", + "canonical": "const STBox *" + } + ] + }, + { + "name": "right8D", + "file": "stbox_index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "nodebox", + "cType": "const STboxNode *", + "canonical": "const STboxNode *" + }, + { + "name": "query", + "cType": "const STBox *", + "canonical": "const STBox *" + } + ] + }, + { + "name": "overRight8D", + "file": "stbox_index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "nodebox", + "cType": "const STboxNode *", + "canonical": "const STboxNode *" + }, + { + "name": "query", + "cType": "const STBox *", + "canonical": "const STBox *" + } + ] + }, + { + "name": "below8D", + "file": "stbox_index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "nodebox", + "cType": "const STboxNode *", + "canonical": "const STboxNode *" + }, + { + "name": "query", + "cType": "const STBox *", + "canonical": "const STBox *" + } + ] + }, + { + "name": "overBelow8D", + "file": "stbox_index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "nodebox", + "cType": "const STboxNode *", + "canonical": "const STboxNode *" + }, + { + "name": "query", + "cType": "const STBox *", + "canonical": "const STBox *" + } + ] + }, + { + "name": "above8D", + "file": "stbox_index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "nodebox", + "cType": "const STboxNode *", + "canonical": "const STboxNode *" + }, + { + "name": "query", + "cType": "const STBox *", + "canonical": "const STBox *" + } + ] + }, + { + "name": "overAbove8D", + "file": "stbox_index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "nodebox", + "cType": "const STboxNode *", + "canonical": "const STboxNode *" + }, + { + "name": "query", + "cType": "const STBox *", + "canonical": "const STBox *" + } + ] + }, + { + "name": "front8D", + "file": "stbox_index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "nodebox", + "cType": "const STboxNode *", + "canonical": "const STboxNode *" + }, + { + "name": "query", + "cType": "const STBox *", + "canonical": "const STBox *" + } + ] + }, + { + "name": "overFront8D", + "file": "stbox_index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "nodebox", + "cType": "const STboxNode *", + "canonical": "const STboxNode *" + }, + { + "name": "query", + "cType": "const STBox *", + "canonical": "const STBox *" + } + ] + }, + { + "name": "back8D", + "file": "stbox_index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "nodebox", + "cType": "const STboxNode *", + "canonical": "const STboxNode *" + }, + { + "name": "query", + "cType": "const STBox *", + "canonical": "const STBox *" + } + ] + }, + { + "name": "overBack8D", + "file": "stbox_index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "nodebox", + "cType": "const STboxNode *", + "canonical": "const STboxNode *" + }, + { + "name": "query", + "cType": "const STBox *", + "canonical": "const STBox *" + } + ] + }, + { + "name": "before8D", + "file": "stbox_index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "nodebox", + "cType": "const STboxNode *", + "canonical": "const STboxNode *" + }, + { + "name": "query", + "cType": "const STBox *", + "canonical": "const STBox *" + } + ] + }, + { + "name": "overBefore8D", + "file": "stbox_index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "nodebox", + "cType": "const STboxNode *", + "canonical": "const STboxNode *" + }, + { + "name": "query", + "cType": "const STBox *", + "canonical": "const STBox *" + } + ] + }, + { + "name": "after8D", + "file": "stbox_index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "nodebox", + "cType": "const STboxNode *", + "canonical": "const STboxNode *" + }, + { + "name": "query", + "cType": "const STBox *", + "canonical": "const STBox *" + } + ] + }, + { + "name": "overAfter8D", + "file": "stbox_index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "nodebox", + "cType": "const STboxNode *", + "canonical": "const STboxNode *" + }, + { + "name": "query", + "cType": "const STBox *", + "canonical": "const STBox *" + } + ] + }, + { + "name": "distance_stbox_nodebox", + "file": "stbox_index.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "query", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "nodebox", + "cType": "const STboxNode *", + "canonical": "const STboxNode *" + } + ] + }, + { + "name": "tspatial_spgist_get_stbox", + "file": "stbox_index.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "result", + "cType": "STBox *", + "canonical": "STBox *" + } + ] + }, + { + "name": "mobilitydb_init", + "file": "tgeo.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [] + }, + { + "name": "geo_stbox", + "file": "tgeo.h", + "returnType": { + "c": "STBox *", + "canonical": "STBox *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "stbox_geo", + "file": "tgeo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + } + ] + }, + { + "name": "tcomp_geo_tgeo", + "file": "tgeo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "func", + "cType": "Datum (*)(Datum, Datum, MeosType)", + "canonical": "unsigned long (*)(unsigned long, unsigned long, MeosType)" + } + ] + }, + { + "name": "tcomp_tgeo_geo", + "file": "tgeo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "func", + "cType": "Datum (*)(Datum, Datum, MeosType)", + "canonical": "unsigned long (*)(unsigned long, unsigned long, MeosType)" + } + ] + }, + { + "name": "ensure_geoaggstate", + "file": "tgeo_aggfuncs.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "state", + "cType": "const SkipList *", + "canonical": "const struct SkipList *" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + }, + { + "name": "hasz", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ensure_geoaggstate_state", + "file": "tgeo_aggfuncs.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "state1", + "cType": "const SkipList *", + "canonical": "const struct SkipList *" + }, + { + "name": "state2", + "cType": "const SkipList *", + "canonical": "const struct SkipList *" + } + ] + }, + { + "name": "tpoint_transform_tcentroid", + "file": "tgeo_aggfuncs.h", + "returnType": { + "c": "Temporal **", + "canonical": "Temporal **" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tpointinst_tcentroid_finalfn", + "file": "tgeo_aggfuncs.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "instants", + "cType": "TInstant **", + "canonical": "TInstant **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + } + ] + }, + { + "name": "tpointseq_tcentroid_finalfn", + "file": "tgeo_aggfuncs.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "sequences", + "cType": "TSequence **", + "canonical": "TSequence **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + } + ] + }, + { + "name": "point3d_min_dist", + "file": "tgeo_distance.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "p1", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "p2", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "p3", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "p4", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "fraction", + "cType": "double *", + "canonical": "double *" + } + ] + }, + { + "name": "tgeompointsegm_distance_turnpt", + "file": "tgeo_distance.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "start1", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "end1", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "start2", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "end2", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "param", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "tgeogpointsegm_distance_turnpt", + "file": "tgeo_distance.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "start1", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "end1", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "start2", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "end2", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "param", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "tinstant_distance", + "file": "tgeo_distance.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "inst1", + "cType": "const TInstant *", + "canonical": "const TInstant *" + }, + { + "name": "inst2", + "cType": "const TInstant *", + "canonical": "const TInstant *" + }, + { + "name": "func", + "cType": "datum_func2", + "canonical": "unsigned long (*)(unsigned long, unsigned long)" + } + ] + }, + { + "name": "tpointseq_at_geom", + "file": "tgeo_restrict.h", + "returnType": { + "c": "TSequence **", + "canonical": "TSequence **" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tpointseq_interperiods", + "file": "tgeo_restrict.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "datum_point4d", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "p", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "geopoint_cmp", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "gs1", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "gs2", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "geopoint_eq", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "gs1", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "gs2", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "geopoint_same", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "gs1", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "gs2", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "datum_point_eq", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "point1", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "point2", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_point_same", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "point1", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "point2", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum2_point_eq", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "point1", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "point2", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum2_point_ne", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "point1", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "point2", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum2_point_same", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "point1", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "point2", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum2_point_nsame", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "point1", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "point2", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum2_geom_centroid", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "geo", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum2_geog_centroid", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "geo", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "geo_extract_elements", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "int **", + "canonical": "int **" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "geo_serialize", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "geom", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "geo_distance_fn", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "datum_func2", + "canonical": "unsigned long (*)(unsigned long, unsigned long)" + }, + "params": [ + { + "name": "flags", + "cType": "int16", + "canonical": "short" + } + ] + }, + { + "name": "pt_distance_fn", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "datum_func2", + "canonical": "unsigned long (*)(unsigned long, unsigned long)" + }, + "params": [ + { + "name": "flags", + "cType": "int16", + "canonical": "short" + } + ] + }, + { + "name": "datum_geom_distance2d", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "geom1", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "geom2", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_geom_distance3d", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "geom1", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "geom2", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_geog_distance", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "geog1", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "geog2", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_pt_distance2d", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "geom1", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "geom2", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_pt_distance3d", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "geom1", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "geom2", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "spatial_flags", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "int16", + "canonical": "short" + }, + "params": [ + { + "name": "d", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "basetype", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "ensure_srid_is_latlong", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + } + ] + }, + { + "name": "ensure_spatial_validity", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ensure_not_geodetic", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "flags", + "cType": "int16", + "canonical": "short" + } + ] + }, + { + "name": "ensure_same_geodetic", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "flags1", + "cType": "int16", + "canonical": "short" + }, + { + "name": "flags2", + "cType": "int16", + "canonical": "short" + } + ] + }, + { + "name": "ensure_same_geodetic_geo", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "gs1", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "gs2", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "ensure_same_geodetic_tspatial_geo", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "ensure_same_geodetic_tspatial_base", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "base", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "ensure_srid_known", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + } + ] + }, + { + "name": "ensure_same_srid", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "srid1", + "cType": "int32_t", + "canonical": "int" + }, + { + "name": "srid2", + "cType": "int32_t", + "canonical": "int" + } + ] + }, + { + "name": "ensure_srid_reconcile", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "srid1", + "cType": "int32_t", + "canonical": "int" + }, + { + "name": "srid2", + "cType": "int32_t", + "canonical": "int" + }, + { + "name": "result", + "cType": "int32_t *", + "canonical": "int *" + } + ] + }, + { + "name": "ensure_same_dimensionality", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "flags1", + "cType": "int16", + "canonical": "short" + }, + { + "name": "flags2", + "cType": "int16", + "canonical": "short" + } + ] + }, + { + "name": "same_spatial_dimensionality", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "flags1", + "cType": "int16", + "canonical": "short" + }, + { + "name": "flags2", + "cType": "int16", + "canonical": "short" + } + ] + }, + { + "name": "ensure_same_spatial_dimensionality", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "flags1", + "cType": "int16", + "canonical": "short" + }, + { + "name": "flags2", + "cType": "int16", + "canonical": "short" + } + ] + }, + { + "name": "ensure_same_dimensionality_geo", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "gs1", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "gs2", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "same_dimensionality_tspatial_geo", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "ensure_same_dimensionality_tspatial_geo", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "ensure_same_spatial_dimensionality_stbox_geo", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "ensure_same_geodetic_stbox_geo", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "ensure_has_Z_geo", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "ensure_has_not_Z_geo", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "ensure_has_M_geo", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "ensure_has_not_M_geo", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "ensure_not_geodetic_geo", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "ensure_point_type", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "ensure_mline_type", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "circle_type", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "ensure_circle_type", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "ensure_not_empty", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "ensure_valid_stbox_geo", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "ensure_valid_tspatial_geo", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "ensure_valid_tspatial_base", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "base", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "ensure_valid_tspatial_tspatial", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ensure_valid_spatial_stbox_stbox", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "box2", + "cType": "const STBox *", + "canonical": "const STBox *" + } + ] + }, + { + "name": "ensure_valid_tgeo_stbox", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + } + ] + }, + { + "name": "ensure_valid_geo_geo", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "gs1", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "gs2", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "ensure_valid_tgeo_geo", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "ensure_valid_tgeo_tgeo", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ensure_valid_tpoint_geo", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "ensure_valid_tpoint_tpoint", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "mline_type", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "tpoint_get_coord", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "coord", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "eacomp_tgeo_geo", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "func", + "cType": "Datum (*)(Datum, Datum, MeosType)", + "canonical": "unsigned long (*)(unsigned long, unsigned long, MeosType)" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "closest_point2d_on_segment_ratio", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "long double", + "canonical": "long double" + }, + "params": [ + { + "name": "p", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "A", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "B", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "closest", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "closest_point3dz_on_segment_ratio", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "long double", + "canonical": "long double" + }, + "params": [ + { + "name": "p", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "A", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "B", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "closest", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "closest_point_on_segment_sphere", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "long double", + "canonical": "long double" + }, + "params": [ + { + "name": "p", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "A", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "B", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "closest", + "cType": "int *", + "canonical": "int *" + }, + { + "name": "dist", + "cType": "double *", + "canonical": "double *" + } + ] + }, + { + "name": "interpolate_point4d_spheroid", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "p1", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "p2", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "p", + "cType": "int *", + "canonical": "int *" + }, + { + "name": "s", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "f", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "geopoint_make", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "x", + "cType": "double", + "canonical": "double" + }, + { + "name": "y", + "cType": "double", + "canonical": "double" + }, + { + "name": "z", + "cType": "double", + "canonical": "double" + }, + { + "name": "hasz", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "geodetic", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + } + ] + }, + { + "name": "lwcircle_make", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "x", + "cType": "double", + "canonical": "double" + }, + { + "name": "y", + "cType": "double", + "canonical": "double" + }, + { + "name": "radius", + "cType": "double", + "canonical": "double" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + } + ] + }, + { + "name": "geocircle_make", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "x", + "cType": "double", + "canonical": "double" + }, + { + "name": "y", + "cType": "double", + "canonical": "double" + }, + { + "name": "radius", + "cType": "double", + "canonical": "double" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + } + ] + }, + { + "name": "pointsegm_interpolate", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "start", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "end", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "ratio", + "cType": "long double", + "canonical": "long double" + } + ] + }, + { + "name": "pointsegm_locate", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "long double", + "canonical": "long double" + }, + "params": [ + { + "name": "start", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "end", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "point", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "dist", + "cType": "double *", + "canonical": "double *" + } + ] + }, + { + "name": "tgeompointsegm_intersection", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "start1", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "end1", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "start2", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "end2", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "lower", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "upper", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "t1", + "cType": "TimestampTz *", + "canonical": "long *" + }, + { + "name": "t2", + "cType": "TimestampTz *", + "canonical": "long *" + } + ] + }, + { + "name": "tgeogpointsegm_intersection", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "start1", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "end1", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "start2", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "end2", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "lower", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "upper", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "t1", + "cType": "TimestampTz *", + "canonical": "long *" + }, + { + "name": "t2", + "cType": "TimestampTz *", + "canonical": "long *" + } + ] + }, + { + "name": "geopoint_collinear", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "value1", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "value2", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "value3", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "ratio", + "cType": "double", + "canonical": "double" + }, + { + "name": "hasz", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "geodetic", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "lwpointarr_remove_duplicates", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "int **", + "canonical": "int **" + }, + "params": [ + { + "name": "points", + "cType": "int **", + "canonical": "int **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "newcount", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "lwpointarr_make_trajectory", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "points", + "cType": "int **", + "canonical": "int **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "lwline_make", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "value1", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "value2", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "lwcoll_from_points_lines", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "points", + "cType": "int **", + "canonical": "int **" + }, + { + "name": "lines", + "cType": "int **", + "canonical": "int **" + }, + { + "name": "npoints", + "cType": "int", + "canonical": "int" + }, + { + "name": "nlines", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "tpointseq_stops_iter", + "file": "tgeo_spatialfuncs.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "maxdist", + "cType": "double", + "canonical": "double" + }, + { + "name": "mintunits", + "cType": "int64", + "canonical": "long" + }, + { + "name": "result", + "cType": "TSequence **", + "canonical": "TSequence **" + } + ] + }, + { + "name": "datum_geom_contains", + "file": "tgeo_spatialrels.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "geom1", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "geom2", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_geom_covers", + "file": "tgeo_spatialrels.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "geom1", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "geom2", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_geom_disjoint2d", + "file": "tgeo_spatialrels.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "geom1", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "geom2", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_geom_disjoint3d", + "file": "tgeo_spatialrels.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "geom1", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "geom2", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_geog_disjoint", + "file": "tgeo_spatialrels.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "geog1", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "geog2", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_geom_intersects2d", + "file": "tgeo_spatialrels.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "geom1", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "geom2", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_geom_intersects3d", + "file": "tgeo_spatialrels.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "geom1", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "geom2", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_geog_intersects", + "file": "tgeo_spatialrels.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "geog1", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "geog2", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_geom_touches", + "file": "tgeo_spatialrels.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "geom1", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "geom2", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_geom_dwithin2d", + "file": "tgeo_spatialrels.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "geom1", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "geom2", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "dist", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_geom_dwithin3d", + "file": "tgeo_spatialrels.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "geom1", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "geom2", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "dist", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_geog_dwithin", + "file": "tgeo_spatialrels.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "geog1", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "geog2", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "dist", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_geom_relate_pattern", + "file": "tgeo_spatialrels.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "geog1", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "geog2", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "p", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "geo_disjoint_fn", + "file": "tgeo_spatialrels.h", + "returnType": { + "c": "datum_func2", + "canonical": "unsigned long (*)(unsigned long, unsigned long)" + }, + "params": [ + { + "name": "flags1", + "cType": "int16", + "canonical": "short" + }, + { + "name": "flags2", + "cType": "int16", + "canonical": "short" + } + ] + }, + { + "name": "geo_disjoint_fn_geo", + "file": "tgeo_spatialrels.h", + "returnType": { + "c": "datum_func2", + "canonical": "unsigned long (*)(unsigned long, unsigned long)" + }, + "params": [ + { + "name": "flags1", + "cType": "int16", + "canonical": "short" + }, + { + "name": "flags2", + "cType": "uint8_t", + "canonical": "unsigned char" + } + ] + }, + { + "name": "geo_intersects_fn", + "file": "tgeo_spatialrels.h", + "returnType": { + "c": "datum_func2", + "canonical": "unsigned long (*)(unsigned long, unsigned long)" + }, + "params": [ + { + "name": "flags1", + "cType": "int16", + "canonical": "short" + }, + { + "name": "flags2", + "cType": "int16", + "canonical": "short" + } + ] + }, + { + "name": "geo_intersects_fn_geo", + "file": "tgeo_spatialrels.h", + "returnType": { + "c": "datum_func2", + "canonical": "unsigned long (*)(unsigned long, unsigned long)" + }, + "params": [ + { + "name": "flags1", + "cType": "int16", + "canonical": "short" + }, + { + "name": "flags2", + "cType": "uint8_t", + "canonical": "unsigned char" + } + ] + }, + { + "name": "geo_dwithin_fn", + "file": "tgeo_spatialrels.h", + "returnType": { + "c": "datum_func3", + "canonical": "unsigned long (*)(unsigned long, unsigned long, unsigned long)" + }, + "params": [ + { + "name": "flags1", + "cType": "int16", + "canonical": "short" + }, + { + "name": "flags2", + "cType": "int16", + "canonical": "short" + } + ] + }, + { + "name": "geo_dwithin_fn_geo", + "file": "tgeo_spatialrels.h", + "returnType": { + "c": "datum_func3", + "canonical": "unsigned long (*)(unsigned long, unsigned long, unsigned long)" + }, + "params": [ + { + "name": "flags1", + "cType": "int16", + "canonical": "short" + }, + { + "name": "flags2", + "cType": "uint8_t", + "canonical": "unsigned char" + } + ] + }, + { + "name": "tpointsegm_tdwithin_turnpt", + "file": "tgeo_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "start1", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "end1", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "start2", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "end2", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "lower", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "upper", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "t1", + "cType": "TimestampTz *", + "canonical": "long *" + }, + { + "name": "t2", + "cType": "TimestampTz *", + "canonical": "long *" + } + ] + }, + { + "name": "spatialrel_geo_geo", + "file": "tgeo_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "gs1", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "gs2", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "param", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "func", + "cType": "varfunc", + "canonical": "unsigned long (*)(unsigned long, ...)" + }, + { + "name": "numparam", + "cType": "int", + "canonical": "int" + }, + { + "name": "invert", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "spatialrel_tgeo_tgeo", + "file": "tgeo_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "param", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "func", + "cType": "varfunc", + "canonical": "unsigned long (*)(unsigned long, ...)" + }, + { + "name": "numparam", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "ea_contains_geo_tgeo", + "file": "tgeo_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_contains_tgeo_geo", + "file": "tgeo_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_contains_tgeo_tgeo", + "file": "tgeo_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_covers_geo_tgeo", + "file": "tgeo_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_covers_tgeo_geo", + "file": "tgeo_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_covers_tgeo_tgeo", + "file": "tgeo_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_disjoint_geo_tgeo", + "file": "tgeo_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_disjoint_tgeo_geo", + "file": "tgeo_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_disjoint_tgeo_tgeo", + "file": "tgeo_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_intersects_geo_tgeo", + "file": "tgeo_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_intersects_tgeo_geo", + "file": "tgeo_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_intersects_tgeo_tgeo", + "file": "tgeo_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_touches_tpoint_geo", + "file": "tgeo_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_touches_tgeo_geo", + "file": "tgeo_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_touches_tgeo_tgeo", + "file": "tgeo_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_dwithin_tgeo_geo", + "file": "tgeo_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "dist", + "cType": "double", + "canonical": "double" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_dwithin_tgeo_tgeo", + "file": "tgeo_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "dist", + "cType": "double", + "canonical": "double" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_spatialrel_tspatial_geo", + "file": "tgeo_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "func", + "cType": "datum_func2", + "canonical": "unsigned long (*)(unsigned long, unsigned long)" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "invert", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_spatialrel_tspatial_tspatial", + "file": "tgeo_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "func", + "cType": "datum_func2", + "canonical": "unsigned long (*)(unsigned long, unsigned long)" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tspatialrel_tspatial_base", + "file": "tgeo_tempspatialrels.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "base", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "param", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "func", + "cType": "varfunc", + "canonical": "unsigned long (*)(unsigned long, ...)" + }, + { + "name": "numparam", + "cType": "int", + "canonical": "int" + }, + { + "name": "invert", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tspatialrel_tspatial_tspatial", + "file": "tgeo_tempspatialrels.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "param", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "func", + "cType": "varfunc", + "canonical": "unsigned long (*)(unsigned long, ...)" + }, + { + "name": "numparam", + "cType": "int", + "canonical": "int" + }, + { + "name": "invert", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tinterrel_tgeo_geo", + "file": "tgeo_tempspatialrels.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "tinter", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tinterrel_tspatial_base", + "file": "tgeo_tempspatialrels.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "base", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "tinter", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "func", + "cType": "datum_func2", + "canonical": "unsigned long (*)(unsigned long, unsigned long)" + } + ] + }, + { + "name": "tinterrel_tspatial_tspatial", + "file": "tgeo_tempspatialrels.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "tinter", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tdwithin_tspatial_tspatial", + "file": "tgeo_tempspatialrels.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "sync1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "sync2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "dist", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "func", + "cType": "datum_func3", + "canonical": "unsigned long (*)(unsigned long, unsigned long, unsigned long)" + }, + { + "name": "tpfn", + "cType": "tpfunc_temp", + "canonical": "int (*)(unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, long, long, long *, long *)" + } + ] + }, + { + "name": "tdwithin_add_solutions", + "file": "tgeo_tempspatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "solutions", + "cType": "int", + "canonical": "int" + }, + { + "name": "lower", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "upper", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "lower_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "upper_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "upper_inc1", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "t1", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "t2", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "instants", + "cType": "TInstant **", + "canonical": "TInstant **" + }, + { + "name": "result", + "cType": "TSequence **", + "canonical": "TSequence **" + } + ] + }, + { + "name": "tdwithin_tspatial_spatial", + "file": "tgeo_tempspatialrels.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "base", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "dist", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "func", + "cType": "datum_func3", + "canonical": "unsigned long (*)(unsigned long, unsigned long, unsigned long)" + }, + { + "name": "tpfn", + "cType": "tpfunc_temp", + "canonical": "int (*)(unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, long, long, long *, long *)" + } + ] + }, + { + "name": "bitmatrix_make", + "file": "tgeo_tile.h", + "returnType": { + "c": "BitMatrix *", + "canonical": "BitMatrix *" + }, + "params": [ + { + "name": "count", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "ndims", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "tpoint_set_tiles", + "file": "tgeo_tile.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "state", + "cType": "const STboxGridState *", + "canonical": "const struct STboxGridState *" + }, + { + "name": "bm", + "cType": "BitMatrix *", + "canonical": "BitMatrix *" + } + ] + }, + { + "name": "tpoint_at_tile", + "file": "tgeo_tile.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + } + ] + }, + { + "name": "stbox_tile_state_set", + "file": "tgeo_tile.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "x", + "cType": "double", + "canonical": "double" + }, + { + "name": "y", + "cType": "double", + "canonical": "double" + }, + { + "name": "z", + "cType": "double", + "canonical": "double" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "xsize", + "cType": "double", + "canonical": "double" + }, + { + "name": "ysize", + "cType": "double", + "canonical": "double" + }, + { + "name": "zsize", + "cType": "double", + "canonical": "double" + }, + { + "name": "tunits", + "cType": "int64", + "canonical": "long" + }, + { + "name": "hasx", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "hasz", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "hast", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "srid", + "cType": "int32", + "canonical": "int" + }, + { + "name": "result", + "cType": "STBox *", + "canonical": "STBox *" + } + ] + }, + { + "name": "stbox_tile_state_make", + "file": "tgeo_tile.h", + "returnType": { + "c": "STboxGridState *", + "canonical": "struct STboxGridState *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "xsize", + "cType": "double", + "canonical": "double" + }, + { + "name": "ysize", + "cType": "double", + "canonical": "double" + }, + { + "name": "zsize", + "cType": "double", + "canonical": "double" + }, + { + "name": "duration", + "cType": "const Interval *", + "canonical": "const Interval *" + }, + { + "name": "sorigin", + "cType": "int", + "canonical": "int" + }, + { + "name": "torigin", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "border_inc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "stbox_tile_state_next", + "file": "tgeo_tile.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "state", + "cType": "STboxGridState *", + "canonical": "struct STboxGridState *" + } + ] + }, + { + "name": "stbox_tile_state_get", + "file": "tgeo_tile.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "state", + "cType": "STboxGridState *", + "canonical": "struct STboxGridState *" + }, + { + "name": "box", + "cType": "STBox *", + "canonical": "STBox *" + } + ] + }, + { + "name": "tgeo_space_time_tile_init", + "file": "tgeo_tile.h", + "returnType": { + "c": "STboxGridState *", + "canonical": "struct STboxGridState *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "xsize", + "cType": "double", + "canonical": "double" + }, + { + "name": "ysize", + "cType": "double", + "canonical": "double" + }, + { + "name": "zsize", + "cType": "double", + "canonical": "double" + }, + { + "name": "duration", + "cType": "const Interval *", + "canonical": "const Interval *" + }, + { + "name": "sorigin", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "torigin", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "bitmatrix", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "border_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "ntiles", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "stbox_space_time_tile", + "file": "tgeo_tile.h", + "returnType": { + "c": "STBox *", + "canonical": "STBox *" + }, + "params": [ + { + "name": "point", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "xsize", + "cType": "double", + "canonical": "double" + }, + { + "name": "ysize", + "cType": "double", + "canonical": "double" + }, + { + "name": "zsize", + "cType": "double", + "canonical": "double" + }, + { + "name": "duration", + "cType": "const Interval *", + "canonical": "const Interval *" + }, + { + "name": "sorigin", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "torigin", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "hasx", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "hast", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "create_trip", + "file": "tpoint_datagen.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "lines", + "cType": "int **", + "canonical": "int **" + }, + { + "name": "maxSpeeds", + "cType": "const double *", + "canonical": "const double *" + }, + { + "name": "categories", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "noEdges", + "cType": "uint32_t", + "canonical": "unsigned int" + }, + { + "name": "startTime", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "disturbData", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "verbosity", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "spatialarr_wkt_out", + "file": "tspatial.h", + "returnType": { + "c": "char **", + "canonical": "char **" + }, + "params": [ + { + "name": "spatialarr", + "cType": "const Datum *", + "canonical": "const unsigned long *" + }, + { + "name": "basetype", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + }, + { + "name": "extended", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "spatialbase_as_text", + "file": "tspatial.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "spatialbase_as_ewkt", + "file": "tspatial.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "point_transf_pj", + "file": "tspatial.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "gs", + "cType": "int *", + "canonical": "int *" + }, + { + "name": "srid_to", + "cType": "int32_t", + "canonical": "int" + }, + { + "name": "pj", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "tgeoinst_set_stbox", + "file": "tspatial_boxops.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const TInstant *" + }, + { + "name": "box", + "cType": "STBox *", + "canonical": "STBox *" + } + ] + }, + { + "name": "tgeoinstarr_set_stbox", + "file": "tspatial_boxops.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "instants", + "cType": "TInstant **", + "canonical": "TInstant **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "box", + "cType": "STBox *", + "canonical": "STBox *" + } + ] + }, + { + "name": "tgeoseq_expand_stbox", + "file": "tspatial_boxops.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "seq", + "cType": "TSequence *", + "canonical": "TSequence *" + }, + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const TInstant *" + } + ] + }, + { + "name": "tspatialinst_set_stbox", + "file": "tspatial_boxops.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const TInstant *" + }, + { + "name": "box", + "cType": "STBox *", + "canonical": "STBox *" + } + ] + }, + { + "name": "tspatialinstarr_set_stbox", + "file": "tspatial_boxops.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "instants", + "cType": "TInstant **", + "canonical": "TInstant **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "lower_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "upper_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + }, + { + "name": "box", + "cType": "void *", + "canonical": "void *" + } + ] + }, + { + "name": "tspatialseqarr_set_stbox", + "file": "tspatial_boxops.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "sequences", + "cType": "TSequence **", + "canonical": "TSequence **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "box", + "cType": "STBox *", + "canonical": "STBox *" + } + ] + }, + { + "name": "tspatialseq_expand_stbox", + "file": "tspatial_boxops.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "seq", + "cType": "TSequence *", + "canonical": "TSequence *" + }, + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const TInstant *" + } + ] + }, + { + "name": "spatialarr_set_bbox", + "file": "tspatial_boxops.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "values", + "cType": "const Datum *", + "canonical": "const unsigned long *" + }, + { + "name": "basetype", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "box", + "cType": "void *", + "canonical": "void *" + } + ] + }, + { + "name": "boxop_tspatial_stbox", + "file": "tspatial_boxops.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "func", + "cType": "bool (*)(const STBox *, const STBox *)", + "canonical": "_Bool (*)(const STBox *, const STBox *)" + }, + { + "name": "invert", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "boxop_tspatial_tspatial", + "file": "tspatial_boxops.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "func", + "cType": "bool (*)(const STBox *, const STBox *)", + "canonical": "_Bool (*)(const STBox *, const STBox *)" + } + ] + }, + { + "name": "srid_parse", + "file": "tspatial_parser.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "str", + "cType": "const char **", + "canonical": "const char **" + }, + { + "name": "srid", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "spatial_parse_elem", + "file": "tspatial_parser.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "str", + "cType": "const char **", + "canonical": "const char **" + }, + { + "name": "temptype", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "delim", + "cType": "char", + "canonical": "char" + }, + { + "name": "temp_srid", + "cType": "int *", + "canonical": "int *" + }, + { + "name": "result", + "cType": "Datum *", + "canonical": "unsigned long *" + } + ] + }, + { + "name": "geo_parse", + "file": "tspatial_parser.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "str", + "cType": "const char **", + "canonical": "const char **" + }, + { + "name": "basetype", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "delim", + "cType": "char", + "canonical": "char" + }, + { + "name": "srid", + "cType": "int *", + "canonical": "int *" + }, + { + "name": "result", + "cType": "int **", + "canonical": "int **" + } + ] + }, + { + "name": "stbox_parse", + "file": "tspatial_parser.h", + "returnType": { + "c": "STBox *", + "canonical": "STBox *" + }, + "params": [ + { + "name": "str", + "cType": "const char **", + "canonical": "const char **" + } + ] + }, + { + "name": "tpoint_parse", + "file": "tspatial_parser.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "str", + "cType": "const char **", + "canonical": "const char **" + }, + { + "name": "temptype", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "tspatialinst_parse", + "file": "tspatial_parser.h", + "returnType": { + "c": "TInstant *", + "canonical": "TInstant *" + }, + "params": [ + { + "name": "str", + "cType": "const char **", + "canonical": "const char **" + }, + { + "name": "temptype", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "end", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "temp_srid", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tspatialseq_disc_parse", + "file": "tspatial_parser.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "str", + "cType": "const char **", + "canonical": "const char **" + }, + { + "name": "temptype", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "temp_srid", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tspatialseq_cont_parse", + "file": "tspatial_parser.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "str", + "cType": "const char **", + "canonical": "const char **" + }, + { + "name": "temptype", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + }, + { + "name": "end", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "temp_srid", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tspatialseqset_parse", + "file": "tspatial_parser.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "str", + "cType": "const char **", + "canonical": "const char **" + }, + { + "name": "temptype", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + }, + { + "name": "temp_srid", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tspatial_parse", + "file": "tspatial_parser.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "str", + "cType": "const char **", + "canonical": "const char **" + }, + { + "name": "temptype", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "h3_are_neighbor_cells_meos", + "file": "h3_generated.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "origin", + "cType": "H3Index", + "canonical": "unsigned long" + }, + { + "name": "destination", + "cType": "H3Index", + "canonical": "unsigned long" + } + ] + }, + { + "name": "h3_cells_to_directed_edge_meos", + "file": "h3_generated.h", + "returnType": { + "c": "H3Index", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "origin", + "cType": "H3Index", + "canonical": "unsigned long" + }, + { + "name": "destination", + "cType": "H3Index", + "canonical": "unsigned long" + } + ] + }, + { + "name": "h3_is_valid_directed_edge_meos", + "file": "h3_generated.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "edge", + "cType": "H3Index", + "canonical": "unsigned long" + } + ] + }, + { + "name": "h3_get_directed_edge_origin_meos", + "file": "h3_generated.h", + "returnType": { + "c": "H3Index", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "edge", + "cType": "H3Index", + "canonical": "unsigned long" + } + ] + }, + { + "name": "h3_get_directed_edge_destination_meos", + "file": "h3_generated.h", + "returnType": { + "c": "H3Index", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "edge", + "cType": "H3Index", + "canonical": "unsigned long" + } + ] + }, + { + "name": "h3_cell_to_parent_meos", + "file": "h3_generated.h", + "returnType": { + "c": "H3Index", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "origin", + "cType": "H3Index", + "canonical": "unsigned long" + }, + { + "name": "resolution", + "cType": "int32", + "canonical": "int" + } + ] + }, + { + "name": "h3_cell_to_center_child_meos", + "file": "h3_generated.h", + "returnType": { + "c": "H3Index", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "origin", + "cType": "H3Index", + "canonical": "unsigned long" + }, + { + "name": "resolution", + "cType": "int32", + "canonical": "int" + } + ] + }, + { + "name": "h3_cell_to_child_pos_meos", + "file": "h3_generated.h", + "returnType": { + "c": "int64", + "canonical": "long" + }, + "params": [ + { + "name": "child", + "cType": "H3Index", + "canonical": "unsigned long" + }, + { + "name": "parentRes", + "cType": "int32", + "canonical": "int" + } + ] + }, + { + "name": "h3_child_pos_to_cell_meos", + "file": "h3_generated.h", + "returnType": { + "c": "H3Index", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "childPos", + "cType": "int64", + "canonical": "long" + }, + { + "name": "parent", + "cType": "H3Index", + "canonical": "unsigned long" + }, + { + "name": "childRes", + "cType": "int32", + "canonical": "int" + } + ] + }, + { + "name": "h3_get_resolution_meos", + "file": "h3_generated.h", + "returnType": { + "c": "int32", + "canonical": "int" + }, + "params": [ + { + "name": "hex", + "cType": "H3Index", + "canonical": "unsigned long" + } + ] + }, + { + "name": "h3_get_base_cell_number_meos", + "file": "h3_generated.h", + "returnType": { + "c": "int32", + "canonical": "int" + }, + "params": [ + { + "name": "hex", + "cType": "H3Index", + "canonical": "unsigned long" + } + ] + }, + { + "name": "h3_is_valid_cell_meos", + "file": "h3_generated.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "hex", + "cType": "H3Index", + "canonical": "unsigned long" + } + ] + }, + { + "name": "h3_is_res_class_iii_meos", + "file": "h3_generated.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "hex", + "cType": "H3Index", + "canonical": "unsigned long" + } + ] + }, + { + "name": "h3_is_pentagon_meos", + "file": "h3_generated.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "hex", + "cType": "H3Index", + "canonical": "unsigned long" + } + ] + }, + { + "name": "h3_get_num_cells_meos", + "file": "h3_generated.h", + "returnType": { + "c": "int64", + "canonical": "long" + }, + "params": [ + { + "name": "resolution", + "cType": "int32", + "canonical": "int" + } + ] + }, + { + "name": "h3_grid_distance_meos", + "file": "h3_generated.h", + "returnType": { + "c": "int64", + "canonical": "long" + }, + "params": [ + { + "name": "originIndex", + "cType": "H3Index", + "canonical": "unsigned long" + }, + { + "name": "h3Index", + "cType": "H3Index", + "canonical": "unsigned long" + } + ] + }, + { + "name": "h3_cell_to_vertex_meos", + "file": "h3_generated.h", + "returnType": { + "c": "H3Index", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "cell", + "cType": "H3Index", + "canonical": "unsigned long" + }, + { + "name": "vertexNum", + "cType": "int32", + "canonical": "int" + } + ] + }, + { + "name": "h3_is_valid_vertex_meos", + "file": "h3_generated.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "vertex", + "cType": "H3Index", + "canonical": "unsigned long" + } + ] + }, + { + "name": "h3index_in", + "file": "h3index.h", + "returnType": { + "c": "H3Index", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "h3index_out", + "file": "h3index.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "cell", + "cType": "H3Index", + "canonical": "unsigned long" + } + ] + }, + { + "name": "h3index_eq", + "file": "h3index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "a", + "cType": "H3Index", + "canonical": "unsigned long" + }, + { + "name": "b", + "cType": "H3Index", + "canonical": "unsigned long" + } + ] + }, + { + "name": "h3index_ne", + "file": "h3index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "a", + "cType": "H3Index", + "canonical": "unsigned long" + }, + { + "name": "b", + "cType": "H3Index", + "canonical": "unsigned long" + } + ] + }, + { + "name": "h3index_lt", + "file": "h3index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "a", + "cType": "H3Index", + "canonical": "unsigned long" + }, + { + "name": "b", + "cType": "H3Index", + "canonical": "unsigned long" + } + ] + }, + { + "name": "h3index_le", + "file": "h3index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "a", + "cType": "H3Index", + "canonical": "unsigned long" + }, + { + "name": "b", + "cType": "H3Index", + "canonical": "unsigned long" + } + ] + }, + { + "name": "h3index_gt", + "file": "h3index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "a", + "cType": "H3Index", + "canonical": "unsigned long" + }, + { + "name": "b", + "cType": "H3Index", + "canonical": "unsigned long" + } + ] + }, + { + "name": "h3index_ge", + "file": "h3index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "a", + "cType": "H3Index", + "canonical": "unsigned long" + }, + { + "name": "b", + "cType": "H3Index", + "canonical": "unsigned long" + } + ] + }, + { + "name": "h3index_cmp", + "file": "h3index.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "a", + "cType": "H3Index", + "canonical": "unsigned long" + }, + { + "name": "b", + "cType": "H3Index", + "canonical": "unsigned long" + } + ] + }, + { + "name": "h3index_hash", + "file": "h3index.h", + "returnType": { + "c": "uint32", + "canonical": "unsigned int" + }, + "params": [ + { + "name": "cell", + "cType": "H3Index", + "canonical": "unsigned long" + } + ] + }, + { + "name": "h3_grid_disk", + "file": "h3index_sets.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "origin", + "cType": "H3Index", + "canonical": "unsigned long" + }, + { + "name": "k", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "h3_grid_ring", + "file": "h3index_sets.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "origin", + "cType": "H3Index", + "canonical": "unsigned long" + }, + { + "name": "k", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "h3_grid_path_cells", + "file": "h3index_sets.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "start", + "cType": "H3Index", + "canonical": "unsigned long" + }, + { + "name": "end", + "cType": "H3Index", + "canonical": "unsigned long" + } + ] + }, + { + "name": "h3_cell_to_children", + "file": "h3index_sets.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "origin", + "cType": "H3Index", + "canonical": "unsigned long" + }, + { + "name": "childRes", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "h3_compact_cells", + "file": "h3index_sets.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "cells", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "h3_uncompact_cells", + "file": "h3index_sets.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "cells", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "res", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "h3_origin_to_directed_edges", + "file": "h3index_sets.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "origin", + "cType": "H3Index", + "canonical": "unsigned long" + } + ] + }, + { + "name": "h3_cell_to_vertexes", + "file": "h3index_sets.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "cell", + "cType": "H3Index", + "canonical": "unsigned long" + } + ] + }, + { + "name": "h3_get_icosahedron_faces", + "file": "h3index_sets.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "cell", + "cType": "H3Index", + "canonical": "unsigned long" + } + ] + }, + { + "name": "ensure_valid_th3index_th3index", + "file": "th3index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ensure_valid_th3index_h3index", + "file": "th3index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "cell", + "cType": "H3Index", + "canonical": "unsigned long" + } + ] + }, + { + "name": "ensure_valid_th3index_tgeogpoint", + "file": "th3index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "datum2_h3index_eq", + "file": "th3index.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "d1", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "d2", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "datum2_h3index_ne", + "file": "th3index.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "d1", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "d2", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "h3index_set_stbox", + "file": "th3index_boxops.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "cell", + "cType": "H3Index", + "canonical": "unsigned long" + }, + { + "name": "box", + "cType": "STBox *", + "canonical": "STBox *" + } + ] + }, + { + "name": "h3indexarr_set_stbox", + "file": "th3index_boxops.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "values", + "cType": "const Datum *", + "canonical": "const unsigned long *" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "box", + "cType": "STBox *", + "canonical": "STBox *" + } + ] + }, + { + "name": "th3indexinst_set_stbox", + "file": "th3index_boxops.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const TInstant *" + }, + { + "name": "box", + "cType": "STBox *", + "canonical": "STBox *" + } + ] + }, + { + "name": "th3indexinstarr_set_stbox", + "file": "th3index_boxops.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "instants", + "cType": "TInstant **", + "canonical": "TInstant **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "box", + "cType": "STBox *", + "canonical": "STBox *" + } + ] + }, + { + "name": "th3indexseq_expand_stbox", + "file": "th3index_boxops.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const TInstant *" + } + ] + }, + { + "name": "h3_gs_point_to_cell", + "file": "th3index_internal.h", + "returnType": { + "c": "H3Index", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "point", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "resolution", + "cType": "int32", + "canonical": "int" + } + ] + }, + { + "name": "h3_cell_to_gs_point", + "file": "th3index_internal.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "cell", + "cType": "H3Index", + "canonical": "unsigned long" + } + ] + }, + { + "name": "h3_cell_to_gs_boundary", + "file": "th3index_internal.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "cell", + "cType": "H3Index", + "canonical": "unsigned long" + } + ] + }, + { + "name": "cell_boundary_to_gs", + "file": "th3index_internal.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "bnd", + "cType": "const CellBoundary *", + "canonical": "const CellBoundary *" + } + ] + }, + { + "name": "h3_sample_step_deg", + "file": "th3index_internal.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "resolution", + "cType": "int32", + "canonical": "int" + } + ] + }, + { + "name": "h3_latlng_deg_to_cell", + "file": "th3index_internal.h", + "returnType": { + "c": "H3Index", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "lat_deg", + "cType": "double", + "canonical": "double" + }, + { + "name": "lng_deg", + "cType": "double", + "canonical": "double" + }, + { + "name": "resolution", + "cType": "int32", + "canonical": "int" + } + ] + }, + { + "name": "h3_cell_to_parent_next_meos", + "file": "th3index_internal.h", + "returnType": { + "c": "H3Index", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "cell", + "cType": "H3Index", + "canonical": "unsigned long" + } + ] + }, + { + "name": "h3_cell_to_center_child_next_meos", + "file": "th3index_internal.h", + "returnType": { + "c": "H3Index", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "cell", + "cType": "H3Index", + "canonical": "unsigned long" + } + ] + }, + { + "name": "h3_directed_edge_to_gs_boundary", + "file": "th3index_internal.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "edge", + "cType": "H3Index", + "canonical": "unsigned long" + } + ] + }, + { + "name": "h3_vertex_to_gs_point", + "file": "th3index_internal.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "vertex", + "cType": "H3Index", + "canonical": "unsigned long" + } + ] + }, + { + "name": "h3_cell_to_local_ij_meos", + "file": "th3index_internal.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "origin", + "cType": "H3Index", + "canonical": "unsigned long" + }, + { + "name": "cell", + "cType": "H3Index", + "canonical": "unsigned long" + } + ] + }, + { + "name": "h3_local_ij_to_cell_meos", + "file": "th3index_internal.h", + "returnType": { + "c": "H3Index", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "origin", + "cType": "H3Index", + "canonical": "unsigned long" + }, + { + "name": "coord", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "h3_unit_from_cstring", + "file": "th3index_internal.h", + "returnType": { + "c": "H3Unit", + "canonical": "H3Unit" + }, + "params": [ + { + "name": "unit", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "h3_cell_area_meos", + "file": "th3index_internal.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "cell", + "cType": "H3Index", + "canonical": "unsigned long" + }, + { + "name": "unit", + "cType": "H3Unit", + "canonical": "H3Unit" + } + ] + }, + { + "name": "h3_edge_length_meos", + "file": "th3index_internal.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "edge", + "cType": "H3Index", + "canonical": "unsigned long" + }, + { + "name": "unit", + "cType": "H3Unit", + "canonical": "H3Unit" + } + ] + }, + { + "name": "h3_gs_great_circle_distance_meos", + "file": "th3index_internal.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "a", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "b", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "unit", + "cType": "H3Unit", + "canonical": "H3Unit" + } + ] + }, + { + "name": "datum_h3_get_resolution", + "file": "th3index_internal.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "d", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_h3_get_base_cell_number", + "file": "th3index_internal.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "d", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_h3_is_valid_cell", + "file": "th3index_internal.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "d", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_h3_is_res_class_iii", + "file": "th3index_internal.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "d", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_h3_is_pentagon", + "file": "th3index_internal.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "d", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_h3_cell_to_parent", + "file": "th3index_internal.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "cell_d", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "res_d", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_h3_cell_to_parent_next", + "file": "th3index_internal.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "cell_d", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_h3_cell_to_center_child", + "file": "th3index_internal.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "cell_d", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "res_d", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_h3_cell_to_center_child_next", + "file": "th3index_internal.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "cell_d", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_h3_cell_to_child_pos", + "file": "th3index_internal.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "cell_d", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "parent_res_d", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_h3_child_pos_to_cell", + "file": "th3index_internal.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "pos_d", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "parent_d", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "child_res_d", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_h3_are_neighbor_cells", + "file": "th3index_internal.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "origin_d", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "dest_d", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_h3_cells_to_directed_edge", + "file": "th3index_internal.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "origin_d", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "dest_d", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_h3_is_valid_directed_edge", + "file": "th3index_internal.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "d", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_h3_get_directed_edge_origin", + "file": "th3index_internal.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "d", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_h3_get_directed_edge_destination", + "file": "th3index_internal.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "d", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_h3_directed_edge_to_boundary", + "file": "th3index_internal.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "d", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_h3_cell_to_vertex", + "file": "th3index_internal.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "cell_d", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "vnum_d", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_h3_vertex_to_latlng", + "file": "th3index_internal.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "d", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_h3_is_valid_vertex", + "file": "th3index_internal.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "d", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_h3_grid_distance", + "file": "th3index_internal.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "origin_d", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "dest_d", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_h3_cell_to_local_ij", + "file": "th3index_internal.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "origin_d", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "cell_d", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_h3_local_ij_to_cell", + "file": "th3index_internal.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "origin_d", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "coord_d", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_h3_latlng_to_cell", + "file": "th3index_internal.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "point_d", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "res_d", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_h3_cell_to_latlng", + "file": "th3index_internal.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "d", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_h3_cell_to_boundary", + "file": "th3index_internal.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "d", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_h3_cell_area", + "file": "th3index_internal.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "cell_d", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "unit_d", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_h3_edge_length", + "file": "th3index_internal.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "edge_d", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "unit_d", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_h3_great_circle_distance", + "file": "th3index_internal.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "a_d", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "b_d", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "unit_d", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "json_in", + "file": "meos_json.h", + "returnType": { + "c": "text *", + "canonical": "struct varlena *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "json_out", + "file": "meos_json.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "js", + "cType": "const text *", + "canonical": "const struct varlena *" + } + ] + }, + { + "name": "jsonb_from_text", + "file": "meos_json.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "txt", + "cType": "const text *", + "canonical": "const struct varlena *" + }, + { + "name": "unique_keys", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "jsonb_in", + "file": "meos_json.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "jsonb_out", + "file": "meos_json.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "json_make", + "file": "meos_json.h", + "returnType": { + "c": "text *", + "canonical": "struct varlena *" + }, + "params": [ + { + "name": "keys_vals", + "cType": "text **", + "canonical": "struct varlena **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "json_make_two_arg", + "file": "meos_json.h", + "returnType": { + "c": "text *", + "canonical": "struct varlena *" + }, + "params": [ + { + "name": "keys", + "cType": "text **", + "canonical": "struct varlena **" + }, + { + "name": "values", + "cType": "text **", + "canonical": "struct varlena **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "jsonb_copy", + "file": "meos_json.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "jsonb_make", + "file": "meos_json.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "keys_vals", + "cType": "text **", + "canonical": "struct varlena **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "jsonb_make_two_arg", + "file": "meos_json.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "keys", + "cType": "text **", + "canonical": "struct varlena **" + }, + { + "name": "values", + "cType": "text **", + "canonical": "struct varlena **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "jsonb_to_bool", + "file": "meos_json.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "jsonb_to_cstring", + "file": "meos_json.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "jsonb_to_float4", + "file": "meos_json.h", + "returnType": { + "c": "float4", + "canonical": "float" + }, + "params": [ + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "jsonb_to_float8", + "file": "meos_json.h", + "returnType": { + "c": "float8", + "canonical": "double" + }, + "params": [ + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "jsonb_to_int16", + "file": "meos_json.h", + "returnType": { + "c": "int16", + "canonical": "short" + }, + "params": [ + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "jsonb_to_int32", + "file": "meos_json.h", + "returnType": { + "c": "int32", + "canonical": "int" + }, + "params": [ + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "jsonb_to_int64", + "file": "meos_json.h", + "returnType": { + "c": "int64", + "canonical": "long" + }, + "params": [ + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "jsonb_to_numeric", + "file": "meos_json.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "jsonb_to_text", + "file": "meos_json.h", + "returnType": { + "c": "text *", + "canonical": "struct varlena *" + }, + "params": [ + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "json_array_element", + "file": "meos_json.h", + "returnType": { + "c": "text *", + "canonical": "struct varlena *" + }, + "params": [ + { + "name": "js", + "cType": "const text *", + "canonical": "const struct varlena *" + }, + { + "name": "element", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "json_array_element_text", + "file": "meos_json.h", + "returnType": { + "c": "text *", + "canonical": "struct varlena *" + }, + "params": [ + { + "name": "js", + "cType": "const text *", + "canonical": "const struct varlena *" + }, + { + "name": "element", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "json_array_elements", + "file": "meos_json.h", + "returnType": { + "c": "text **", + "canonical": "struct varlena **" + }, + "params": [ + { + "name": "js", + "cType": "const text *", + "canonical": "const struct varlena *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "json_array_elements_text", + "file": "meos_json.h", + "returnType": { + "c": "text **", + "canonical": "struct varlena **" + }, + "params": [ + { + "name": "js", + "cType": "const text *", + "canonical": "const struct varlena *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "json_array_length", + "file": "meos_json.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "js", + "cType": "const text *", + "canonical": "const struct varlena *" + } + ] + }, + { + "name": "json_each", + "file": "meos_json.h", + "returnType": { + "c": "text **", + "canonical": "struct varlena **" + }, + "params": [ + { + "name": "js", + "cType": "const text *", + "canonical": "const struct varlena *" + }, + { + "name": "values", + "cType": "text **", + "canonical": "struct varlena **" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "json_each_text", + "file": "meos_json.h", + "returnType": { + "c": "text **", + "canonical": "struct varlena **" + }, + "params": [ + { + "name": "js", + "cType": "const text *", + "canonical": "const struct varlena *" + }, + { + "name": "values", + "cType": "text **", + "canonical": "struct varlena **" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "json_extract_path", + "file": "meos_json.h", + "returnType": { + "c": "text *", + "canonical": "struct varlena *" + }, + "params": [ + { + "name": "js", + "cType": "const text *", + "canonical": "const struct varlena *" + }, + { + "name": "path_elems", + "cType": "text **", + "canonical": "struct varlena **" + }, + { + "name": "path_len", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "json_extract_path_text", + "file": "meos_json.h", + "returnType": { + "c": "text *", + "canonical": "struct varlena *" + }, + "params": [ + { + "name": "js", + "cType": "const text *", + "canonical": "const struct varlena *" + }, + { + "name": "path_elems", + "cType": "text **", + "canonical": "struct varlena **" + }, + { + "name": "path_len", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "json_object_field", + "file": "meos_json.h", + "returnType": { + "c": "text *", + "canonical": "struct varlena *" + }, + "params": [ + { + "name": "js", + "cType": "const text *", + "canonical": "const struct varlena *" + }, + { + "name": "key", + "cType": "const text *", + "canonical": "const struct varlena *" + } + ] + }, + { + "name": "json_object_field_text", + "file": "meos_json.h", + "returnType": { + "c": "text *", + "canonical": "struct varlena *" + }, + "params": [ + { + "name": "js", + "cType": "const text *", + "canonical": "const struct varlena *" + }, + { + "name": "key", + "cType": "const text *", + "canonical": "const struct varlena *" + } + ] + }, + { + "name": "json_object_keys", + "file": "meos_json.h", + "returnType": { + "c": "text **", + "canonical": "struct varlena **" + }, + "params": [ + { + "name": "js", + "cType": "const text *", + "canonical": "const struct varlena *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "json_typeof", + "file": "meos_json.h", + "returnType": { + "c": "text *", + "canonical": "struct varlena *" + }, + "params": [ + { + "name": "js", + "cType": "const text *", + "canonical": "const struct varlena *" + } + ] + }, + { + "name": "jsonb_array_element", + "file": "meos_json.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "element", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "jsonb_array_element_text", + "file": "meos_json.h", + "returnType": { + "c": "text *", + "canonical": "struct varlena *" + }, + "params": [ + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "element", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "jsonb_array_elements", + "file": "meos_json.h", + "returnType": { + "c": "int **", + "canonical": "int **" + }, + "params": [ + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "jsonb_array_elements_text", + "file": "meos_json.h", + "returnType": { + "c": "text **", + "canonical": "struct varlena **" + }, + "params": [ + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "jsonb_array_length", + "file": "meos_json.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "jsonb_contained", + "file": "meos_json.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "jb1", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "jb2", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "jsonb_contains", + "file": "meos_json.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "jb1", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "jb2", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "jsonb_each", + "file": "meos_json.h", + "returnType": { + "c": "text **", + "canonical": "struct varlena **" + }, + "params": [ + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "values", + "cType": "int **", + "canonical": "int **" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "jsonb_each_text", + "file": "meos_json.h", + "returnType": { + "c": "text **", + "canonical": "struct varlena **" + }, + "params": [ + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "values", + "cType": "text **", + "canonical": "struct varlena **" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "jsonb_exists", + "file": "meos_json.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "key", + "cType": "const text *", + "canonical": "const struct varlena *" + } + ] + }, + { + "name": "jsonb_exists_array", + "file": "meos_json.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "keys_elems", + "cType": "text **", + "canonical": "struct varlena **" + }, + { + "name": "keys_len", + "cType": "int", + "canonical": "int" + }, + { + "name": "any", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "jsonb_extract_path", + "file": "meos_json.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "path_elems", + "cType": "text **", + "canonical": "struct varlena **" + }, + { + "name": "path_len", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "jsonb_extract_path_text", + "file": "meos_json.h", + "returnType": { + "c": "text *", + "canonical": "struct varlena *" + }, + "params": [ + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "path_elems", + "cType": "text **", + "canonical": "struct varlena **" + }, + { + "name": "path_len", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "jsonb_hash", + "file": "meos_json.h", + "returnType": { + "c": "uint32", + "canonical": "unsigned int" + }, + "params": [ + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "jsonb_hash_extended", + "file": "meos_json.h", + "returnType": { + "c": "uint64", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "seed", + "cType": "uint64", + "canonical": "unsigned long" + } + ] + }, + { + "name": "jsonb_object_field", + "file": "meos_json.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "key", + "cType": "const text *", + "canonical": "const struct varlena *" + } + ] + }, + { + "name": "jsonb_object_field_text", + "file": "meos_json.h", + "returnType": { + "c": "text *", + "canonical": "struct varlena *" + }, + "params": [ + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "key", + "cType": "const text *", + "canonical": "const struct varlena *" + } + ] + }, + { + "name": "jsonb_object_keys", + "file": "meos_json.h", + "returnType": { + "c": "text **", + "canonical": "struct varlena **" + }, + "params": [ + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "json_strip_nulls", + "file": "meos_json.h", + "returnType": { + "c": "text *", + "canonical": "struct varlena *" + }, + "params": [ + { + "name": "js", + "cType": "const text *", + "canonical": "const struct varlena *" + }, + { + "name": "strip_in_arrays", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "jsonb_concat", + "file": "meos_json.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "jb1", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "jb2", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "jsonb_delete", + "file": "meos_json.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "key", + "cType": "const text *", + "canonical": "const struct varlena *" + } + ] + }, + { + "name": "jsonb_delete_array", + "file": "meos_json.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "keys_elems", + "cType": "text **", + "canonical": "struct varlena **" + }, + { + "name": "keys_len", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "jsonb_delete_index", + "file": "meos_json.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "idx", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "jsonb_delete_path", + "file": "meos_json.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "path_elems", + "cType": "text **", + "canonical": "struct varlena **" + }, + { + "name": "path_len", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "jsonb_insert", + "file": "meos_json.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "path_elems", + "cType": "text **", + "canonical": "struct varlena **" + }, + { + "name": "path_len", + "cType": "int", + "canonical": "int" + }, + { + "name": "newjb", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "after", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "jsonb_pretty", + "file": "meos_json.h", + "returnType": { + "c": "text *", + "canonical": "struct varlena *" + }, + "params": [ + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "jsonb_set", + "file": "meos_json.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "path_elems", + "cType": "text **", + "canonical": "struct varlena **" + }, + { + "name": "path_len", + "cType": "int", + "canonical": "int" + }, + { + "name": "newjb", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "create", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "jsonb_set_lax", + "file": "meos_json.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "path_elems", + "cType": "text **", + "canonical": "struct varlena **" + }, + { + "name": "path_len", + "cType": "int", + "canonical": "int" + }, + { + "name": "newjb", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "create", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "handle_null", + "cType": "const text *", + "canonical": "const struct varlena *" + } + ] + }, + { + "name": "jsonb_strip_nulls", + "file": "meos_json.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "strip_in_arrays", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "jsonb_cmp", + "file": "meos_json.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "jb1", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "jb2", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "jsonb_eq", + "file": "meos_json.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "jb1", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "jb2", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "jsonb_ge", + "file": "meos_json.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "jb1", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "jb2", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "jsonb_gt", + "file": "meos_json.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "jb1", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "jb2", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "jsonb_le", + "file": "meos_json.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "jb1", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "jb2", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "jsonb_lt", + "file": "meos_json.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "jb1", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "jb2", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "jsonb_ne", + "file": "meos_json.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "jb1", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "jb2", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "jsonb_path_exists", + "file": "meos_json.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "jp", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "vars", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "silent", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "tz", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "jsonb_path_match", + "file": "meos_json.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "jp", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "vars", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "silent", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "tz", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "jsonb_path_query_all", + "file": "meos_json.h", + "returnType": { + "c": "int **", + "canonical": "int **" + }, + "params": [ + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "jp", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "vars", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "silent", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "tz", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "jsonb_path_query_array", + "file": "meos_json.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "jp", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "vars", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "silent", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "tz", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "jsonb_path_query_first", + "file": "meos_json.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "jp", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "vars", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "silent", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "tz", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "jsonpath_in", + "file": "meos_json.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "jsonpath_copy", + "file": "meos_json.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "jp", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "jsonpath_out", + "file": "meos_json.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "jp", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "jsonbset_in", + "file": "meos_json.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "jsonbset_out", + "file": "meos_json.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "jsonbset_make", + "file": "meos_json.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "values", + "cType": "const int **", + "canonical": "const int **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "jsonb_to_set", + "file": "meos_json.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "jsonbset_end_value", + "file": "meos_json.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "jsonbset_start_value", + "file": "meos_json.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "jsonbset_value_n", + "file": "meos_json.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "n", + "cType": "int", + "canonical": "int" + }, + { + "name": "result", + "cType": "int **", + "canonical": "int **" + } + ] + }, + { + "name": "jsonbset_values", + "file": "meos_json.h", + "returnType": { + "c": "int **", + "canonical": "int **" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "concat_jsonbset_jsonb", + "file": "meos_json.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "invert", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "jsonbset_array_length", + "file": "meos_json.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "set", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "jsonbset_object_field", + "file": "meos_json.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "set", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "key", + "cType": "const text *", + "canonical": "const struct varlena *" + }, + { + "name": "astext", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "null_handle", + "cType": "nullHandleType", + "canonical": "nullHandleType" + } + ] + }, + { + "name": "jsonbset_array_element", + "file": "meos_json.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "set", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "idx", + "cType": "int", + "canonical": "int" + }, + { + "name": "astext", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "null_handle", + "cType": "nullHandleType", + "canonical": "nullHandleType" + } + ] + }, + { + "name": "jsonbset_delete_index", + "file": "meos_json.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "set", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "idx", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "jsonbset_delete", + "file": "meos_json.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "set", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "key", + "cType": "const text *", + "canonical": "const struct varlena *" + } + ] + }, + { + "name": "jsonbset_delete_array", + "file": "meos_json.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "set", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "keys", + "cType": "text **", + "canonical": "struct varlena **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "jsonbset_exists", + "file": "meos_json.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "set", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "key", + "cType": "const text *", + "canonical": "const struct varlena *" + } + ] + }, + { + "name": "jsonbset_exists_array", + "file": "meos_json.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "set", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "keys", + "cType": "text **", + "canonical": "struct varlena **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "any", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "jsonbset_set", + "file": "meos_json.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "set", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "keys", + "cType": "text **", + "canonical": "struct varlena **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "newjb", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "create", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "null_handle", + "cType": "const text *", + "canonical": "const struct varlena *" + }, + { + "name": "lax", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "jsonbset_to_alphanumset", + "file": "meos_json.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "set", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "key", + "cType": "const char *", + "canonical": "const char *" + }, + { + "name": "settype", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "null_handle", + "cType": "nullHandleType", + "canonical": "nullHandleType" + } + ] + }, + { + "name": "jsonbset_to_intset", + "file": "meos_json.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "set", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "key", + "cType": "const char *", + "canonical": "const char *" + }, + { + "name": "null_handle", + "cType": "nullHandleType", + "canonical": "nullHandleType" + } + ] + }, + { + "name": "jsonbset_to_floatset", + "file": "meos_json.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "set", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "key", + "cType": "const char *", + "canonical": "const char *" + }, + { + "name": "null_handle", + "cType": "nullHandleType", + "canonical": "nullHandleType" + } + ] + }, + { + "name": "jsonbset_to_textset_key", + "file": "meos_json.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "set", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "key", + "cType": "const char *", + "canonical": "const char *" + }, + { + "name": "null_handle", + "cType": "nullHandleType", + "canonical": "nullHandleType" + } + ] + }, + { + "name": "jsonbset_strip_nulls", + "file": "meos_json.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "set", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "strip_in_arrays", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "jsonbset_pretty", + "file": "meos_json.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "set", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "jsonbset_delete_path", + "file": "meos_json.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "set", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "path_elems", + "cType": "text **", + "canonical": "struct varlena **" + }, + { + "name": "path_len", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "jsonbset_extract_path", + "file": "meos_json.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "set", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "path_elems", + "cType": "text **", + "canonical": "struct varlena **" + }, + { + "name": "path_len", + "cType": "int", + "canonical": "int" + }, + { + "name": "astext", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "null_handle", + "cType": "nullHandleType", + "canonical": "nullHandleType" + } + ] + }, + { + "name": "jsonbset_insert", + "file": "meos_json.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "set", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "path_elems", + "cType": "text **", + "canonical": "struct varlena **" + }, + { + "name": "path_len", + "cType": "int", + "canonical": "int" + }, + { + "name": "newjb", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "after", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "jsonbset_path_exists", + "file": "meos_json.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "set", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "jp", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "vars", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "silent", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "tz", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "jsonbset_path_match", + "file": "meos_json.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "set", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "jp", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "vars", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "silent", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "tz", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "jsonbset_path_query_array", + "file": "meos_json.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "set", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "jp", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "vars", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "silent", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "tz", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "jsonbset_path_query_first", + "file": "meos_json.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "set", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "jp", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "vars", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "silent", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "tz", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "contained_jsonb_set", + "file": "meos_json.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "contains_set_jsonb", + "file": "meos_json.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "jb", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "intersection_jsonb_set", + "file": "meos_json.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "intersection_set_jsonb", + "file": "meos_json.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "jsonb_union_transfn", + "file": "meos_json.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "state", + "cType": "Set *", + "canonical": "Set *" + }, + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "minus_jsonb_set", + "file": "meos_json.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "minus_set_jsonb", + "file": "meos_json.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "union_jsonb_set", + "file": "meos_json.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "union_set_jsonb", + "file": "meos_json.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "tjsonb_from_mfjson", + "file": "meos_json.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "tjsonb_in", + "file": "meos_json.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "tjsonb_out", + "file": "meos_json.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tjsonbinst_from_mfjson", + "file": "meos_json.h", + "returnType": { + "c": "TInstant *", + "canonical": "TInstant *" + }, + "params": [ + { + "name": "mfjson", + "cType": "json_object *", + "canonical": "struct json_object *" + } + ] + }, + { + "name": "tjsonbinst_in", + "file": "meos_json.h", + "returnType": { + "c": "TInstant *", + "canonical": "TInstant *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "tjsonbseq_from_mfjson", + "file": "meos_json.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "mfjson", + "cType": "json_object *", + "canonical": "struct json_object *" + } + ] + }, + { + "name": "tjsonbseq_in", + "file": "meos_json.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "tjsonbseqset_from_mfjson", + "file": "meos_json.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "mfjson", + "cType": "json_object *", + "canonical": "struct json_object *" + } + ] + }, + { + "name": "tjsonbseqset_in", + "file": "meos_json.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "tjsonb_from_base_temp", + "file": "meos_json.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "jsonb", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tjsonbinst_make", + "file": "meos_json.h", + "returnType": { + "c": "TInstant *", + "canonical": "TInstant *" + }, + "params": [ + { + "name": "jsonb", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "tjsonbseq_from_base_tstzset", + "file": "meos_json.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "jsonb", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "tjsonbseq_from_base_tstzspan", + "file": "meos_json.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "jsonb", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "sp", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "tjsonbseqset_from_base_tstzspanset", + "file": "meos_json.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "jsonb", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "tjsonb_to_ttext", + "file": "meos_json.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ttext_to_tjsonb", + "file": "meos_json.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tjsonb_end_value", + "file": "meos_json.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tjsonb_start_value", + "file": "meos_json.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tjsonb_value_at_timestamptz", + "file": "meos_json.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "strict", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "value", + "cType": "int **", + "canonical": "int **" + } + ] + }, + { + "name": "tjsonb_value_n", + "file": "meos_json.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "n", + "cType": "int", + "canonical": "int" + }, + { + "name": "result", + "cType": "int **", + "canonical": "int **" + } + ] + }, + { + "name": "tjsonb_values", + "file": "meos_json.h", + "returnType": { + "c": "int **", + "canonical": "int **" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "concat_tjsonb_jsonb", + "file": "meos_json.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "invert", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "concat_tjsonb_tjsonb", + "file": "meos_json.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "contains_tjsonb_jsonb", + "file": "meos_json.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "invert", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "contains_tjsonb_tjsonb", + "file": "meos_json.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "null_handle_type_from_string", + "file": "meos_json.h", + "returnType": { + "c": "nullHandleType", + "canonical": "nullHandleType" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "tjson_array_element", + "file": "meos_json.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "idx", + "cType": "int", + "canonical": "int" + }, + { + "name": "null_handle", + "cType": "nullHandleType", + "canonical": "nullHandleType" + } + ] + }, + { + "name": "tjson_array_length", + "file": "meos_json.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tjson_extract_path", + "file": "meos_json.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "path_elems", + "cType": "text **", + "canonical": "struct varlena **" + }, + { + "name": "path_len", + "cType": "int", + "canonical": "int" + }, + { + "name": "null_handle", + "cType": "nullHandleType", + "canonical": "nullHandleType" + } + ] + }, + { + "name": "tjson_object_field", + "file": "meos_json.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "key", + "cType": "const text *", + "canonical": "const struct varlena *" + }, + { + "name": "astext", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "null_handle", + "cType": "nullHandleType", + "canonical": "nullHandleType" + } + ] + }, + { + "name": "tjson_strip_nulls", + "file": "meos_json.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "strip_in_arrays", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tjsonb_array_element", + "file": "meos_json.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "idx", + "cType": "int", + "canonical": "int" + }, + { + "name": "astext", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "null_handle", + "cType": "nullHandleType", + "canonical": "nullHandleType" + } + ] + }, + { + "name": "tjsonb_array_length", + "file": "meos_json.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tjsonb_delete", + "file": "meos_json.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "key", + "cType": "const text *", + "canonical": "const struct varlena *" + } + ] + }, + { + "name": "tjsonb_delete_array", + "file": "meos_json.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "keys", + "cType": "text **", + "canonical": "struct varlena **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "tjsonb_delete_index", + "file": "meos_json.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "idx", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "tjsonb_delete_path", + "file": "meos_json.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "path_elems", + "cType": "text **", + "canonical": "struct varlena **" + }, + { + "name": "path_len", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "tjsonb_exists", + "file": "meos_json.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "key", + "cType": "const text *", + "canonical": "const struct varlena *" + } + ] + }, + { + "name": "tjsonb_exists_array", + "file": "meos_json.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "keys", + "cType": "text **", + "canonical": "struct varlena **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "any", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tjsonb_extract_path", + "file": "meos_json.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "path_elems", + "cType": "text **", + "canonical": "struct varlena **" + }, + { + "name": "path_len", + "cType": "int", + "canonical": "int" + }, + { + "name": "astext", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "null_handle", + "cType": "nullHandleType", + "canonical": "nullHandleType" + } + ] + }, + { + "name": "tjsonb_insert", + "file": "meos_json.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "keys", + "cType": "text **", + "canonical": "struct varlena **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "newjb", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "after", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tjsonb_object_field", + "file": "meos_json.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "key", + "cType": "const text *", + "canonical": "const struct varlena *" + }, + { + "name": "astext", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "null_handle", + "cType": "nullHandleType", + "canonical": "nullHandleType" + } + ] + }, + { + "name": "tjsonb_path_exists", + "file": "meos_json.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "jp", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "vars", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "silent", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "tz", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tjsonb_path_match", + "file": "meos_json.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "jp", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "vars", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "silent", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "tz", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tjsonb_path_query_array", + "file": "meos_json.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "jp", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "vars", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "silent", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "tz", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tjsonb_path_query_first", + "file": "meos_json.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "jp", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "vars", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "silent", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "tz", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tjsonb_pretty", + "file": "meos_json.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tjsonb_set", + "file": "meos_json.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "keys", + "cType": "text **", + "canonical": "struct varlena **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "newjb", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "create", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "handle_null", + "cType": "const text *", + "canonical": "const struct varlena *" + }, + { + "name": "lax", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tjsonb_strip_nulls", + "file": "meos_json.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "strip_in_arrays", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tjsonb_to_tbool", + "file": "meos_json.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "key", + "cType": "const char *", + "canonical": "const char *" + }, + { + "name": "null_handle", + "cType": "nullHandleType", + "canonical": "nullHandleType" + } + ] + }, + { + "name": "tjsonb_to_tfloat", + "file": "meos_json.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "key", + "cType": "const char *", + "canonical": "const char *" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + }, + { + "name": "null_handle", + "cType": "nullHandleType", + "canonical": "nullHandleType" + } + ] + }, + { + "name": "tjsonb_to_tint", + "file": "meos_json.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "key", + "cType": "const char *", + "canonical": "const char *" + }, + { + "name": "null_handle", + "cType": "nullHandleType", + "canonical": "nullHandleType" + } + ] + }, + { + "name": "tjsonb_to_ttext_key", + "file": "meos_json.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "key", + "cType": "const char *", + "canonical": "const char *" + }, + { + "name": "null_handle", + "cType": "nullHandleType", + "canonical": "nullHandleType" + } + ] + }, + { + "name": "tjsonb_at_value", + "file": "meos_json.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "jsb", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "tjsonb_minus_value", + "file": "meos_json.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "jsb", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "always_eq_jsonb_tjsonb", + "file": "meos_json.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_eq_tjsonb_jsonb", + "file": "meos_json.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "always_eq_tjsonb_tjsonb", + "file": "meos_json.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_ne_jsonb_tjsonb", + "file": "meos_json.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_ne_tjsonb_jsonb", + "file": "meos_json.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "always_ne_tjsonb_tjsonb", + "file": "meos_json.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_eq_jsonb_tjsonb", + "file": "meos_json.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_eq_tjsonb_jsonb", + "file": "meos_json.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "ever_eq_tjsonb_tjsonb", + "file": "meos_json.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_ne_jsonb_tjsonb", + "file": "meos_json.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_ne_tjsonb_jsonb", + "file": "meos_json.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "ever_ne_tjsonb_tjsonb", + "file": "meos_json.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "teq_jsonb_tjsonb", + "file": "meos_json.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "teq_tjsonb_jsonb", + "file": "meos_json.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "tne_jsonb_tjsonb", + "file": "meos_json.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tne_tjsonb_jsonb", + "file": "meos_json.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "setPath", + "file": "tjsonb.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "it", + "cType": "int **", + "canonical": "int **" + }, + { + "name": "path_elems", + "cType": "Datum *", + "canonical": "unsigned long *" + }, + { + "name": "path_nulls", + "cType": "bool *", + "canonical": "_Bool *" + }, + { + "name": "path_len", + "cType": "int", + "canonical": "int" + }, + { + "name": "st", + "cType": "int **", + "canonical": "int **" + }, + { + "name": "level", + "cType": "int", + "canonical": "int" + }, + { + "name": "newval", + "cType": "int *", + "canonical": "int *" + }, + { + "name": "op_type", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "setPathObject", + "file": "tjsonb.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "it", + "cType": "int **", + "canonical": "int **" + }, + { + "name": "path_elems", + "cType": "Datum *", + "canonical": "unsigned long *" + }, + { + "name": "path_nulls", + "cType": "bool *", + "canonical": "_Bool *" + }, + { + "name": "path_len", + "cType": "int", + "canonical": "int" + }, + { + "name": "st", + "cType": "int **", + "canonical": "int **" + }, + { + "name": "level", + "cType": "int", + "canonical": "int" + }, + { + "name": "newval", + "cType": "int *", + "canonical": "int *" + }, + { + "name": "npairs", + "cType": "uint32_t", + "canonical": "unsigned int" + }, + { + "name": "op_type", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "setPathArray", + "file": "tjsonb.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "it", + "cType": "int **", + "canonical": "int **" + }, + { + "name": "path_elems", + "cType": "Datum *", + "canonical": "unsigned long *" + }, + { + "name": "path_nulls", + "cType": "bool *", + "canonical": "_Bool *" + }, + { + "name": "path_len", + "cType": "int", + "canonical": "int" + }, + { + "name": "st", + "cType": "int **", + "canonical": "int **" + }, + { + "name": "level", + "cType": "int", + "canonical": "int" + }, + { + "name": "newval", + "cType": "int *", + "canonical": "int *" + }, + { + "name": "nelems", + "cType": "uint32_t", + "canonical": "unsigned int" + }, + { + "name": "op_type", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "datum_jsonb_concat", + "file": "tjsonb.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "l", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "r", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_jsonb_contained", + "file": "tjsonb.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "l", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "r", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_jsonb_contains", + "file": "tjsonb.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "l", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "r", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_jsonb_delete", + "file": "tjsonb.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "jb", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "key", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_jsonb_delete_array", + "file": "tjsonb.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "jb", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "array", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "count", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_jsonb_delete_index", + "file": "tjsonb.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "jb", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "idx", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_json_array_element", + "file": "tjsonb.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "txt", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "element", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_jsonb_array_element", + "file": "tjsonb.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "jb", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "element", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_json_array_element_text", + "file": "tjsonb.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "txt", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "element", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_jsonb_array_element_text", + "file": "tjsonb.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "jb", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "element", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_jsonb_exists", + "file": "tjsonb.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "l", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "r", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_jsonb_exists_array", + "file": "tjsonb.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "array", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "count", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "any", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_json_array_length", + "file": "tjsonb.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "txt", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_jsonb_array_length", + "file": "tjsonb.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "txt", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_json_object_field", + "file": "tjsonb.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "txt", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "key", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_jsonb_object_field", + "file": "tjsonb.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "jb", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "key", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_json_object_field_text", + "file": "tjsonb.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "txt", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "key", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_jsonb_object_field_text", + "file": "tjsonb.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "jb", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "key", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_json_strip_nulls", + "file": "tjsonb.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "txt", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "strip_in_arrays", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_jsonb_strip_nulls", + "file": "tjsonb.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "jb", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "strip_in_arrays", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_jsonb_pretty", + "file": "tjsonb.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "jb", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_json_extract_path", + "file": "tjsonb.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "txt", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "path_elems", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "path_len", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_jsonb_extract_path", + "file": "tjsonb.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "jb", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "path_elems", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "path_len", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_json_extract_path_text", + "file": "tjsonb.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "txt", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "path_elems", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "path_len", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_jsonb_extract_path_text", + "file": "tjsonb.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "jb", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "path_elems", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "path_len", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_jsonb_set", + "file": "tjsonb.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "jb", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "keys", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "count", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "newjb", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "create", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_jsonb_set_lax", + "file": "tjsonb.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "jb", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "keys", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "count", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "newjb", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "create", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "null_handle", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_jsonb_delete_path", + "file": "tjsonb.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "jb", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "keys", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "count", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_jsonb_insert", + "file": "tjsonb.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "jb", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "keys", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "count", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "newjb", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "after", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_jsonb_path_exists", + "file": "tjsonb.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "jb", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "jp", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "vars", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "silent", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "tz", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_jsonb_path_match", + "file": "tjsonb.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "jb", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "jp", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "vars", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "silent", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "tz", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_jsonb_path_query_array", + "file": "tjsonb.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "jb", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "jp", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "vars", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "silent", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "tz", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_jsonb_path_query_first", + "file": "tjsonb.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "jb", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "jp", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "vars", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "silent", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "tz", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_jsonb_to_text", + "file": "tjsonb.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "jb", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_text_to_jsonb", + "file": "tjsonb.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "txt", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_jsonb_to_alphanum", + "file": "tjsonb.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "jb", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "key", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "temptype", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "null_handle", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "tjsonb_to_talphanum", + "file": "tjsonb.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "key", + "cType": "const char *", + "canonical": "const char *" + }, + { + "name": "resbasetype", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + }, + { + "name": "null_handle", + "cType": "nullHandleType", + "canonical": "nullHandleType" + } + ] + }, + { + "name": "jsonbfunc_jsonbset", + "file": "tjsonb.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "func", + "cType": "datum_func1", + "canonical": "unsigned long (*)(unsigned long)" + }, + { + "name": "intype", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "restype", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "jsonbfunc_jsonbset_jsonb", + "file": "tjsonb.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "jb", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "func", + "cType": "datum_func2", + "canonical": "unsigned long (*)(unsigned long, unsigned long)" + }, + { + "name": "invert", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "jsonbfunc_jsonbset_text", + "file": "tjsonb.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "txt", + "cType": "const text *", + "canonical": "const struct varlena *" + }, + { + "name": "func", + "cType": "datum_func2", + "canonical": "unsigned long (*)(unsigned long, unsigned long)" + } + ] + }, + { + "name": "meos_temporal_to_arrow", + "file": "meos_arrow.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "out_schema", + "cType": "struct ArrowSchema *", + "canonical": "struct ArrowSchema *" + }, + { + "name": "out_array", + "cType": "struct ArrowArray *", + "canonical": "struct ArrowArray *" + } + ] + }, + { + "name": "meos_temporal_from_arrow", + "file": "meos_arrow.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "schema", + "cType": "const struct ArrowSchema *", + "canonical": "const struct ArrowSchema *" + }, + { + "name": "array", + "cType": "const struct ArrowArray *", + "canonical": "const struct ArrowArray *" + } + ] + }, + { + "name": "meos_temporal_arrow_roundtrip", + "file": "meos_arrow.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "meos_set_to_arrow", + "file": "meos_arrow.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "out_schema", + "cType": "struct ArrowSchema *", + "canonical": "struct ArrowSchema *" + }, + { + "name": "out_array", + "cType": "struct ArrowArray *", + "canonical": "struct ArrowArray *" + } + ] + }, + { + "name": "meos_set_from_arrow", + "file": "meos_arrow.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "schema", + "cType": "const struct ArrowSchema *", + "canonical": "const struct ArrowSchema *" + }, + { + "name": "array", + "cType": "const struct ArrowArray *", + "canonical": "const struct ArrowArray *" + } + ] + }, + { + "name": "meos_set_arrow_roundtrip", + "file": "meos_arrow.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "meos_span_to_arrow", + "file": "meos_arrow.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "out_schema", + "cType": "struct ArrowSchema *", + "canonical": "struct ArrowSchema *" + }, + { + "name": "out_array", + "cType": "struct ArrowArray *", + "canonical": "struct ArrowArray *" + } + ] + }, + { + "name": "meos_span_from_arrow", + "file": "meos_arrow.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "schema", + "cType": "const struct ArrowSchema *", + "canonical": "const struct ArrowSchema *" + }, + { + "name": "array", + "cType": "const struct ArrowArray *", + "canonical": "const struct ArrowArray *" + } + ] + }, + { + "name": "meos_span_arrow_roundtrip", + "file": "meos_arrow.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "meos_spanset_to_arrow", + "file": "meos_arrow.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "out_schema", + "cType": "struct ArrowSchema *", + "canonical": "struct ArrowSchema *" + }, + { + "name": "out_array", + "cType": "struct ArrowArray *", + "canonical": "struct ArrowArray *" + } + ] + }, + { + "name": "meos_spanset_from_arrow", + "file": "meos_arrow.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "schema", + "cType": "const struct ArrowSchema *", + "canonical": "const struct ArrowSchema *" + }, + { + "name": "array", + "cType": "const struct ArrowArray *", + "canonical": "const struct ArrowArray *" + } + ] + }, + { + "name": "meos_spanset_arrow_roundtrip", + "file": "meos_arrow.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "meos_tbox_to_arrow", + "file": "meos_arrow.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const TBox *" + }, + { + "name": "out_schema", + "cType": "struct ArrowSchema *", + "canonical": "struct ArrowSchema *" + }, + { + "name": "out_array", + "cType": "struct ArrowArray *", + "canonical": "struct ArrowArray *" + } + ] + }, + { + "name": "meos_tbox_from_arrow", + "file": "meos_arrow.h", + "returnType": { + "c": "TBox *", + "canonical": "TBox *" + }, + "params": [ + { + "name": "schema", + "cType": "const struct ArrowSchema *", + "canonical": "const struct ArrowSchema *" + }, + { + "name": "array", + "cType": "const struct ArrowArray *", + "canonical": "const struct ArrowArray *" + } + ] + }, + { + "name": "meos_tbox_arrow_roundtrip", + "file": "meos_arrow.h", + "returnType": { + "c": "TBox *", + "canonical": "TBox *" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const TBox *" + } + ] + }, + { + "name": "meos_stbox_to_arrow", + "file": "meos_arrow.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "out_schema", + "cType": "struct ArrowSchema *", + "canonical": "struct ArrowSchema *" + }, + { + "name": "out_array", + "cType": "struct ArrowArray *", + "canonical": "struct ArrowArray *" + } + ] + }, + { + "name": "meos_stbox_from_arrow", + "file": "meos_arrow.h", + "returnType": { + "c": "STBox *", + "canonical": "STBox *" + }, + "params": [ + { + "name": "schema", + "cType": "const struct ArrowSchema *", + "canonical": "const struct ArrowSchema *" + }, + { + "name": "array", + "cType": "const struct ArrowArray *", + "canonical": "const struct ArrowArray *" + } + ] + }, + { + "name": "meos_stbox_arrow_roundtrip", + "file": "meos_arrow.h", + "returnType": { + "c": "STBox *", + "canonical": "STBox *" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + } + ] + }, + { + "name": "h3index_from_wkb", + "file": "meos_h3.h", + "returnType": { + "c": "H3Index", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "wkb", + "cType": "const uint8_t *", + "canonical": "const unsigned char *" + }, + { + "name": "size", + "cType": "size_t", + "canonical": "unsigned long" + } + ] + }, + { + "name": "h3index_from_hexwkb", + "file": "meos_h3.h", + "returnType": { + "c": "H3Index", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "hexwkb", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "h3index_as_wkb", + "file": "meos_h3.h", + "returnType": { + "c": "uint8_t *", + "canonical": "unsigned char *" + }, + "params": [ + { + "name": "cell", + "cType": "H3Index", + "canonical": "unsigned long" + }, + { + "name": "variant", + "cType": "uint8_t", + "canonical": "unsigned char" + }, + { + "name": "size_out", + "cType": "size_t *", + "canonical": "unsigned long *" + } + ] + }, + { + "name": "h3index_as_hexwkb", + "file": "meos_h3.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "cell", + "cType": "H3Index", + "canonical": "unsigned long" + }, + { + "name": "variant", + "cType": "uint8_t", + "canonical": "unsigned char" + }, + { + "name": "size_out", + "cType": "size_t *", + "canonical": "unsigned long *" + } + ] + }, + { + "name": "th3index_in", + "file": "meos_h3.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "th3indexinst_in", + "file": "meos_h3.h", + "returnType": { + "c": "TInstant *", + "canonical": "TInstant *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "th3indexseq_in", + "file": "meos_h3.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "th3indexseqset_in", + "file": "meos_h3.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "th3index_make", + "file": "meos_h3.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "value", + "cType": "H3Index", + "canonical": "unsigned long" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "th3indexinst_make", + "file": "meos_h3.h", + "returnType": { + "c": "TInstant *", + "canonical": "TInstant *" + }, + "params": [ + { + "name": "value", + "cType": "H3Index", + "canonical": "unsigned long" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "th3indexseq_make", + "file": "meos_h3.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "values", + "cType": "const H3Index *", + "canonical": "const unsigned long *" + }, + { + "name": "times", + "cType": "const TimestampTz *", + "canonical": "const long *" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "lower_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "upper_inc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "th3indexseqset_make", + "file": "meos_h3.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "sequences", + "cType": "const TSequence **", + "canonical": "const TSequence **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "th3index_start_value", + "file": "meos_h3.h", + "returnType": { + "c": "H3Index", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "th3index_end_value", + "file": "meos_h3.h", + "returnType": { + "c": "H3Index", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "th3index_value_n", + "file": "meos_h3.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "n", + "cType": "int", + "canonical": "int" + }, + { + "name": "result", + "cType": "H3Index *", + "canonical": "unsigned long *" + } + ] + }, + { + "name": "th3index_values", + "file": "meos_h3.h", + "returnType": { + "c": "H3Index *", + "canonical": "unsigned long *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "th3index_value_at_timestamptz", + "file": "meos_h3.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "strict", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "result", + "cType": "H3Index *", + "canonical": "unsigned long *" + } + ] + }, + { + "name": "tbigint_to_th3index", + "file": "meos_h3.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "th3index_to_tbigint", + "file": "meos_h3.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_eq_h3index_th3index", + "file": "meos_h3.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "cell", + "cType": "H3Index", + "canonical": "unsigned long" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_eq_th3index_h3index", + "file": "meos_h3.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "cell", + "cType": "H3Index", + "canonical": "unsigned long" + } + ] + }, + { + "name": "ever_ne_h3index_th3index", + "file": "meos_h3.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "cell", + "cType": "H3Index", + "canonical": "unsigned long" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_ne_th3index_h3index", + "file": "meos_h3.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "cell", + "cType": "H3Index", + "canonical": "unsigned long" + } + ] + }, + { + "name": "always_eq_h3index_th3index", + "file": "meos_h3.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "cell", + "cType": "H3Index", + "canonical": "unsigned long" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_eq_th3index_h3index", + "file": "meos_h3.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "cell", + "cType": "H3Index", + "canonical": "unsigned long" + } + ] + }, + { + "name": "always_ne_h3index_th3index", + "file": "meos_h3.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "cell", + "cType": "H3Index", + "canonical": "unsigned long" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_ne_th3index_h3index", + "file": "meos_h3.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "cell", + "cType": "H3Index", + "canonical": "unsigned long" + } + ] + }, + { + "name": "ever_eq_th3index_th3index", + "file": "meos_h3.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_ne_th3index_th3index", + "file": "meos_h3.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_eq_th3index_th3index", + "file": "meos_h3.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_ne_th3index_th3index", + "file": "meos_h3.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "teq_h3index_th3index", + "file": "meos_h3.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "cell", + "cType": "H3Index", + "canonical": "unsigned long" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "teq_th3index_h3index", + "file": "meos_h3.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "cell", + "cType": "H3Index", + "canonical": "unsigned long" + } + ] + }, + { + "name": "teq_th3index_th3index", + "file": "meos_h3.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tne_h3index_th3index", + "file": "meos_h3.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "cell", + "cType": "H3Index", + "canonical": "unsigned long" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tne_th3index_h3index", + "file": "meos_h3.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "cell", + "cType": "H3Index", + "canonical": "unsigned long" + } + ] + }, + { + "name": "tne_th3index_th3index", + "file": "meos_h3.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "th3index_get_resolution", + "file": "meos_h3.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "th3index_get_base_cell_number", + "file": "meos_h3.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "th3index_is_valid_cell", + "file": "meos_h3.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "th3index_is_res_class_iii", + "file": "meos_h3.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "th3index_is_pentagon", + "file": "meos_h3.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "th3index_cell_to_parent", + "file": "meos_h3.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "resolution", + "cType": "int32", + "canonical": "int" + } + ] + }, + { + "name": "th3index_cell_to_parent_next", + "file": "meos_h3.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "th3index_cell_to_center_child", + "file": "meos_h3.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "resolution", + "cType": "int32", + "canonical": "int" + } + ] + }, + { + "name": "th3index_cell_to_center_child_next", + "file": "meos_h3.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "th3index_cell_to_child_pos", + "file": "meos_h3.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "parent_res", + "cType": "int32", + "canonical": "int" + } + ] + }, + { + "name": "th3index_child_pos_to_cell", + "file": "meos_h3.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "child_pos", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "parent", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "child_res", + "cType": "int32", + "canonical": "int" + } + ] + }, + { + "name": "tgeogpoint_to_th3index", + "file": "meos_h3.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "resolution", + "cType": "int32", + "canonical": "int" + } + ] + }, + { + "name": "tgeompoint_to_th3index", + "file": "meos_h3.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "resolution", + "cType": "int32", + "canonical": "int" + } + ] + }, + { + "name": "th3index_to_tgeogpoint", + "file": "meos_h3.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "th3index_to_tgeompoint", + "file": "meos_h3.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "th3index_cell_to_boundary", + "file": "meos_h3.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "geo_to_h3index_set", + "file": "meos_h3.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "resolution", + "cType": "int32", + "canonical": "int" + } + ] + }, + { + "name": "ever_eq_h3indexset_th3index", + "file": "meos_h3.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "cells", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "th3idx", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "th3index_are_neighbor_cells", + "file": "meos_h3.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "origin", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "dest", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "th3index_cells_to_directed_edge", + "file": "meos_h3.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "origin", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "dest", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "th3index_is_valid_directed_edge", + "file": "meos_h3.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "edge", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "th3index_get_directed_edge_origin", + "file": "meos_h3.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "edge", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "th3index_get_directed_edge_destination", + "file": "meos_h3.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "edge", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "th3index_directed_edge_to_boundary", + "file": "meos_h3.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "edge", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "th3index_cell_to_vertex", + "file": "meos_h3.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "vertex_num", + "cType": "int32", + "canonical": "int" + } + ] + }, + { + "name": "th3index_vertex_to_latlng", + "file": "meos_h3.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "th3index_is_valid_vertex", + "file": "meos_h3.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "th3index_grid_distance", + "file": "meos_h3.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "origin", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "dest", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "th3index_cell_to_local_ij", + "file": "meos_h3.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "origin", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "cell", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "th3index_local_ij_to_cell", + "file": "meos_h3.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "origin", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "coord", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "th3index_cell_area", + "file": "meos_h3.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "unit", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "th3index_edge_length", + "file": "meos_h3.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "unit", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "tgeogpoint_great_circle_distance", + "file": "meos_h3.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "a", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "b", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "unit", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "proj_get_context", + "file": "meos_internal_geo.h", + "returnType": { + "c": "PJ_CONTEXT *", + "canonical": "struct pj_ctx *" + }, + "params": [] + }, + { + "name": "geos_get_context", + "file": "meos_internal_geo.h", + "returnType": { + "c": "GEOSContextHandle_t", + "canonical": "struct GEOSContextHandle_HS *" + }, + "params": [] + }, + { + "name": "datum_geo_round", + "file": "meos_internal_geo.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "size", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "point_round", + "file": "meos_internal_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "stbox_set", + "file": "meos_internal_geo.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "hasx", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "hasz", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "geodetic", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "srid", + "cType": "int32", + "canonical": "int" + }, + { + "name": "xmin", + "cType": "double", + "canonical": "double" + }, + { + "name": "xmax", + "cType": "double", + "canonical": "double" + }, + { + "name": "ymin", + "cType": "double", + "canonical": "double" + }, + { + "name": "ymax", + "cType": "double", + "canonical": "double" + }, + { + "name": "zmin", + "cType": "double", + "canonical": "double" + }, + { + "name": "zmax", + "cType": "double", + "canonical": "double" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "box", + "cType": "STBox *", + "canonical": "STBox *" + } + ] + }, + { + "name": "gbox_set_stbox", + "file": "meos_internal_geo.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "box", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + }, + { + "name": "result", + "cType": "STBox *", + "canonical": "STBox *" + } + ] + }, + { + "name": "geo_set_stbox", + "file": "meos_internal_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "box", + "cType": "STBox *", + "canonical": "STBox *" + } + ] + }, + { + "name": "geoarr_set_stbox", + "file": "meos_internal_geo.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "values", + "cType": "const Datum *", + "canonical": "const unsigned long *" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "box", + "cType": "STBox *", + "canonical": "STBox *" + } + ] + }, + { + "name": "spatial_set_stbox", + "file": "meos_internal_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "d", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "basetype", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "box", + "cType": "STBox *", + "canonical": "STBox *" + } + ] + }, + { + "name": "spatialset_set_stbox", + "file": "meos_internal_geo.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "set", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "box", + "cType": "STBox *", + "canonical": "STBox *" + } + ] + }, + { + "name": "stbox_set_box3d", + "file": "meos_internal_geo.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "box3d", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "stbox_set_gbox", + "file": "meos_internal_geo.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "gbox", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tstzset_set_stbox", + "file": "meos_internal_geo.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "box", + "cType": "STBox *", + "canonical": "STBox *" + } + ] + }, + { + "name": "tstzspan_set_stbox", + "file": "meos_internal_geo.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "box", + "cType": "STBox *", + "canonical": "STBox *" + } + ] + }, + { + "name": "tstzspanset_set_stbox", + "file": "meos_internal_geo.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "s", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "box", + "cType": "STBox *", + "canonical": "STBox *" + } + ] + }, + { + "name": "stbox_expand", + "file": "meos_internal_geo.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "box1", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "box2", + "cType": "STBox *", + "canonical": "STBox *" + } + ] + }, + { + "name": "inter_stbox_stbox", + "file": "meos_internal_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "box2", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "result", + "cType": "STBox *", + "canonical": "STBox *" + } + ] + }, + { + "name": "tgeogpointinst_from_mfjson", + "file": "meos_internal_geo.h", + "returnType": { + "c": "TInstant *", + "canonical": "TInstant *" + }, + "params": [ + { + "name": "mfjson", + "cType": "json_object *", + "canonical": "struct json_object *" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + } + ] + }, + { + "name": "tgeogpointinst_in", + "file": "meos_internal_geo.h", + "returnType": { + "c": "TInstant *", + "canonical": "TInstant *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "tgeogpointseq_from_mfjson", + "file": "meos_internal_geo.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "mfjson", + "cType": "json_object *", + "canonical": "struct json_object *" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "tgeogpointseq_in", + "file": "meos_internal_geo.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "tgeogpointseqset_from_mfjson", + "file": "meos_internal_geo.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "mfjson", + "cType": "json_object *", + "canonical": "struct json_object *" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "tgeogpointseqset_in", + "file": "meos_internal_geo.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "tgeompointinst_from_mfjson", + "file": "meos_internal_geo.h", + "returnType": { + "c": "TInstant *", + "canonical": "TInstant *" + }, + "params": [ + { + "name": "mfjson", + "cType": "json_object *", + "canonical": "struct json_object *" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + } + ] + }, + { + "name": "tgeompointinst_in", + "file": "meos_internal_geo.h", + "returnType": { + "c": "TInstant *", + "canonical": "TInstant *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "tgeompointseq_from_mfjson", + "file": "meos_internal_geo.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "mfjson", + "cType": "json_object *", + "canonical": "struct json_object *" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "tgeompointseq_in", + "file": "meos_internal_geo.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "tgeompointseqset_from_mfjson", + "file": "meos_internal_geo.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "mfjson", + "cType": "json_object *", + "canonical": "struct json_object *" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "tgeompointseqset_in", + "file": "meos_internal_geo.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "tgeographyinst_from_mfjson", + "file": "meos_internal_geo.h", + "returnType": { + "c": "TInstant *", + "canonical": "TInstant *" + }, + "params": [ + { + "name": "mfjson", + "cType": "json_object *", + "canonical": "struct json_object *" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + } + ] + }, + { + "name": "tgeographyinst_in", + "file": "meos_internal_geo.h", + "returnType": { + "c": "TInstant *", + "canonical": "TInstant *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "tgeographyseq_from_mfjson", + "file": "meos_internal_geo.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "mfjson", + "cType": "json_object *", + "canonical": "struct json_object *" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "tgeographyseq_in", + "file": "meos_internal_geo.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "tgeographyseqset_from_mfjson", + "file": "meos_internal_geo.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "mfjson", + "cType": "json_object *", + "canonical": "struct json_object *" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "tgeographyseqset_in", + "file": "meos_internal_geo.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "tgeometryinst_from_mfjson", + "file": "meos_internal_geo.h", + "returnType": { + "c": "TInstant *", + "canonical": "TInstant *" + }, + "params": [ + { + "name": "mfjson", + "cType": "json_object *", + "canonical": "struct json_object *" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + } + ] + }, + { + "name": "tgeometryinst_in", + "file": "meos_internal_geo.h", + "returnType": { + "c": "TInstant *", + "canonical": "TInstant *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "tgeometryseq_from_mfjson", + "file": "meos_internal_geo.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "mfjson", + "cType": "json_object *", + "canonical": "struct json_object *" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "tgeometryseq_in", + "file": "meos_internal_geo.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "tgeometryseqset_from_mfjson", + "file": "meos_internal_geo.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "mfjson", + "cType": "json_object *", + "canonical": "struct json_object *" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "tgeometryseqset_in", + "file": "meos_internal_geo.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "tspatial_set_stbox", + "file": "meos_internal_geo.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "STBox *", + "canonical": "STBox *" + } + ] + }, + { + "name": "tspatialseq_set_stbox", + "file": "meos_internal_geo.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "box", + "cType": "STBox *", + "canonical": "STBox *" + } + ] + }, + { + "name": "tspatialseqset_set_stbox", + "file": "meos_internal_geo.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const TSequenceSet *" + }, + { + "name": "box", + "cType": "STBox *", + "canonical": "STBox *" + } + ] + }, + { + "name": "tgeo_restrict_elevation", + "file": "meos_internal_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tgeo_restrict_geom", + "file": "meos_internal_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tgeo_restrict_stbox", + "file": "meos_internal_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "border_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tgeoinst_restrict_geom", + "file": "meos_internal_geo.h", + "returnType": { + "c": "TInstant *", + "canonical": "TInstant *" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const TInstant *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tgeoinst_restrict_stbox", + "file": "meos_internal_geo.h", + "returnType": { + "c": "TInstant *", + "canonical": "TInstant *" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const TInstant *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "border_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tgeoseq_restrict_geom", + "file": "meos_internal_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tgeoseq_restrict_stbox", + "file": "meos_internal_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "border_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tgeoseqset_restrict_geom", + "file": "meos_internal_geo.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const TSequenceSet *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tgeoseqset_restrict_stbox", + "file": "meos_internal_geo.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const TSequenceSet *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "border_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "spatial_srid", + "file": "meos_internal_geo.h", + "returnType": { + "c": "int32_t", + "canonical": "int" + }, + "params": [ + { + "name": "d", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "basetype", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "spatial_set_srid", + "file": "meos_internal_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "d", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "basetype", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + } + ] + }, + { + "name": "tspatialinst_srid", + "file": "meos_internal_geo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const TInstant *" + } + ] + }, + { + "name": "tpointseq_azimuth", + "file": "meos_internal_geo.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + } + ] + }, + { + "name": "tpointseq_cumulative_length", + "file": "meos_internal_geo.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "prevlength", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "tpointseq_is_simple", + "file": "meos_internal_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + } + ] + }, + { + "name": "tpointseq_length", + "file": "meos_internal_geo.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + } + ] + }, + { + "name": "tpointseq_linear_trajectory", + "file": "meos_internal_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "unary_union", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tgeoseq_stboxes", + "file": "meos_internal_geo.h", + "returnType": { + "c": "STBox *", + "canonical": "STBox *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tgeoseq_split_n_stboxes", + "file": "meos_internal_geo.h", + "returnType": { + "c": "STBox *", + "canonical": "STBox *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "max_count", + "cType": "int", + "canonical": "int" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tpointseqset_azimuth", + "file": "meos_internal_geo.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const TSequenceSet *" + } + ] + }, + { + "name": "tpointseqset_cumulative_length", + "file": "meos_internal_geo.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const TSequenceSet *" + } + ] + }, + { + "name": "tpointseqset_is_simple", + "file": "meos_internal_geo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const TSequenceSet *" + } + ] + }, + { + "name": "tpointseqset_length", + "file": "meos_internal_geo.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const TSequenceSet *" + } + ] + }, + { + "name": "tgeoseqset_stboxes", + "file": "meos_internal_geo.h", + "returnType": { + "c": "STBox *", + "canonical": "STBox *" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const TSequenceSet *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tgeoseqset_split_n_stboxes", + "file": "meos_internal_geo.h", + "returnType": { + "c": "STBox *", + "canonical": "STBox *" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const TSequenceSet *" + }, + { + "name": "max_count", + "cType": "int", + "canonical": "int" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tgeominst_tgeoginst", + "file": "meos_internal_geo.h", + "returnType": { + "c": "TInstant *", + "canonical": "TInstant *" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const TInstant *" + }, + { + "name": "oper", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tgeomseq_tgeogseq", + "file": "meos_internal_geo.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "oper", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tgeomseqset_tgeogseqset", + "file": "meos_internal_geo.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const TSequenceSet *" + }, + { + "name": "oper", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tgeom_tgeog", + "file": "meos_internal_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "oper", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tgeo_tpoint", + "file": "meos_internal_geo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "oper", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tspatialinst_set_srid", + "file": "meos_internal_geo.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "inst", + "cType": "TInstant *", + "canonical": "TInstant *" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + } + ] + }, + { + "name": "tpointseq_make_simple", + "file": "meos_internal_geo.h", + "returnType": { + "c": "TSequence **", + "canonical": "TSequence **" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tspatialseq_set_srid", + "file": "meos_internal_geo.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "seq", + "cType": "TSequence *", + "canonical": "TSequence *" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + } + ] + }, + { + "name": "tpointseqset_make_simple", + "file": "meos_internal_geo.h", + "returnType": { + "c": "TSequence **", + "canonical": "TSequence **" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const TSequenceSet *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tspatialseqset_set_srid", + "file": "meos_internal_geo.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "ss", + "cType": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + } + ] + }, + { + "name": "tpointseq_twcentroid", + "file": "meos_internal_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + } + ] + }, + { + "name": "tpointseqset_twcentroid", + "file": "meos_internal_geo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const TSequenceSet *" + } + ] + }, + { + "name": "npoint_as_ewkt", + "file": "meos_npoint.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "npoint_as_hexwkb", + "file": "meos_npoint.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + }, + { + "name": "variant", + "cType": "uint8_t", + "canonical": "unsigned char" + }, + { + "name": "size_out", + "cType": "size_t *", + "canonical": "unsigned long *" + } + ] + }, + { + "name": "npoint_as_text", + "file": "meos_npoint.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "npoint_as_wkb", + "file": "meos_npoint.h", + "returnType": { + "c": "uint8_t *", + "canonical": "unsigned char *" + }, + "params": [ + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + }, + { + "name": "variant", + "cType": "uint8_t", + "canonical": "unsigned char" + }, + { + "name": "size_out", + "cType": "size_t *", + "canonical": "unsigned long *" + } + ] + }, + { + "name": "npoint_from_hexwkb", + "file": "meos_npoint.h", + "returnType": { + "c": "Npoint *", + "canonical": "Npoint *" + }, + "params": [ + { + "name": "hexwkb", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "npoint_from_wkb", + "file": "meos_npoint.h", + "returnType": { + "c": "Npoint *", + "canonical": "Npoint *" + }, + "params": [ + { + "name": "wkb", + "cType": "const uint8_t *", + "canonical": "const unsigned char *" + }, + { + "name": "size", + "cType": "size_t", + "canonical": "unsigned long" + } + ] + }, + { + "name": "npoint_in", + "file": "meos_npoint.h", + "returnType": { + "c": "Npoint *", + "canonical": "Npoint *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "npoint_out", + "file": "meos_npoint.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "nsegment_in", + "file": "meos_npoint.h", + "returnType": { + "c": "Nsegment *", + "canonical": "Nsegment *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "nsegment_out", + "file": "meos_npoint.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "ns", + "cType": "const Nsegment *", + "canonical": "const Nsegment *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "npoint_make", + "file": "meos_npoint.h", + "returnType": { + "c": "Npoint *", + "canonical": "Npoint *" + }, + "params": [ + { + "name": "rid", + "cType": "int64", + "canonical": "long" + }, + { + "name": "pos", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "nsegment_make", + "file": "meos_npoint.h", + "returnType": { + "c": "Nsegment *", + "canonical": "Nsegment *" + }, + "params": [ + { + "name": "rid", + "cType": "int64", + "canonical": "long" + }, + { + "name": "pos1", + "cType": "double", + "canonical": "double" + }, + { + "name": "pos2", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "geompoint_to_npoint", + "file": "meos_npoint.h", + "returnType": { + "c": "Npoint *", + "canonical": "Npoint *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "geom_to_nsegment", + "file": "meos_npoint.h", + "returnType": { + "c": "Nsegment *", + "canonical": "Nsegment *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "npoint_to_geompoint", + "file": "meos_npoint.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + } + ] + }, + { + "name": "npoint_to_nsegment", + "file": "meos_npoint.h", + "returnType": { + "c": "Nsegment *", + "canonical": "Nsegment *" + }, + "params": [ + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + } + ] + }, + { + "name": "npoint_to_stbox", + "file": "meos_npoint.h", + "returnType": { + "c": "STBox *", + "canonical": "STBox *" + }, + "params": [ + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + } + ] + }, + { + "name": "nsegment_to_geom", + "file": "meos_npoint.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "ns", + "cType": "const Nsegment *", + "canonical": "const Nsegment *" + } + ] + }, + { + "name": "nsegment_to_stbox", + "file": "meos_npoint.h", + "returnType": { + "c": "STBox *", + "canonical": "STBox *" + }, + "params": [ + { + "name": "ns", + "cType": "const Nsegment *", + "canonical": "const Nsegment *" + } + ] + }, + { + "name": "npoint_hash", + "file": "meos_npoint.h", + "returnType": { + "c": "uint32", + "canonical": "unsigned int" + }, + "params": [ + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + } + ] + }, + { + "name": "npoint_hash_extended", + "file": "meos_npoint.h", + "returnType": { + "c": "uint64", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + }, + { + "name": "seed", + "cType": "uint64", + "canonical": "unsigned long" + } + ] + }, + { + "name": "npoint_position", + "file": "meos_npoint.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + } + ] + }, + { + "name": "npoint_route", + "file": "meos_npoint.h", + "returnType": { + "c": "int64", + "canonical": "long" + }, + "params": [ + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + } + ] + }, + { + "name": "nsegment_end_position", + "file": "meos_npoint.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "ns", + "cType": "const Nsegment *", + "canonical": "const Nsegment *" + } + ] + }, + { + "name": "nsegment_route", + "file": "meos_npoint.h", + "returnType": { + "c": "int64", + "canonical": "long" + }, + "params": [ + { + "name": "ns", + "cType": "const Nsegment *", + "canonical": "const Nsegment *" + } + ] + }, + { + "name": "nsegment_start_position", + "file": "meos_npoint.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "ns", + "cType": "const Nsegment *", + "canonical": "const Nsegment *" + } + ] + }, + { + "name": "route_exists", + "file": "meos_npoint.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "rid", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "route_geom", + "file": "meos_npoint.h", + "returnType": { + "c": "const int *", + "canonical": "const int *" + }, + "params": [ + { + "name": "rid", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "route_length", + "file": "meos_npoint.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "rid", + "cType": "int64", + "canonical": "long" + } + ] + }, + { + "name": "npoint_round", + "file": "meos_npoint.h", + "returnType": { + "c": "Npoint *", + "canonical": "Npoint *" + }, + "params": [ + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "nsegment_round", + "file": "meos_npoint.h", + "returnType": { + "c": "Nsegment *", + "canonical": "Nsegment *" + }, + "params": [ + { + "name": "ns", + "cType": "const Nsegment *", + "canonical": "const Nsegment *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "get_srid_ways", + "file": "meos_npoint.h", + "returnType": { + "c": "int32_t", + "canonical": "int" + }, + "params": [] + }, + { + "name": "npoint_srid", + "file": "meos_npoint.h", + "returnType": { + "c": "int32_t", + "canonical": "int" + }, + "params": [ + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + } + ] + }, + { + "name": "nsegment_srid", + "file": "meos_npoint.h", + "returnType": { + "c": "int32_t", + "canonical": "int" + }, + "params": [ + { + "name": "ns", + "cType": "const Nsegment *", + "canonical": "const Nsegment *" + } + ] + }, + { + "name": "npoint_timestamptz_to_stbox", + "file": "meos_npoint.h", + "returnType": { + "c": "STBox *", + "canonical": "STBox *" + }, + "params": [ + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "npoint_tstzspan_to_stbox", + "file": "meos_npoint.h", + "returnType": { + "c": "STBox *", + "canonical": "STBox *" + }, + "params": [ + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "npoint_cmp", + "file": "meos_npoint.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "np1", + "cType": "const Npoint *", + "canonical": "const Npoint *" + }, + { + "name": "np2", + "cType": "const Npoint *", + "canonical": "const Npoint *" + } + ] + }, + { + "name": "npoint_eq", + "file": "meos_npoint.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "np1", + "cType": "const Npoint *", + "canonical": "const Npoint *" + }, + { + "name": "np2", + "cType": "const Npoint *", + "canonical": "const Npoint *" + } + ] + }, + { + "name": "npoint_ge", + "file": "meos_npoint.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "np1", + "cType": "const Npoint *", + "canonical": "const Npoint *" + }, + { + "name": "np2", + "cType": "const Npoint *", + "canonical": "const Npoint *" + } + ] + }, + { + "name": "npoint_gt", + "file": "meos_npoint.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "np1", + "cType": "const Npoint *", + "canonical": "const Npoint *" + }, + { + "name": "np2", + "cType": "const Npoint *", + "canonical": "const Npoint *" + } + ] + }, + { + "name": "npoint_le", + "file": "meos_npoint.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "np1", + "cType": "const Npoint *", + "canonical": "const Npoint *" + }, + { + "name": "np2", + "cType": "const Npoint *", + "canonical": "const Npoint *" + } + ] + }, + { + "name": "npoint_lt", + "file": "meos_npoint.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "np1", + "cType": "const Npoint *", + "canonical": "const Npoint *" + }, + { + "name": "np2", + "cType": "const Npoint *", + "canonical": "const Npoint *" + } + ] + }, + { + "name": "npoint_ne", + "file": "meos_npoint.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "np1", + "cType": "const Npoint *", + "canonical": "const Npoint *" + }, + { + "name": "np2", + "cType": "const Npoint *", + "canonical": "const Npoint *" + } + ] + }, + { + "name": "npoint_same", + "file": "meos_npoint.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "np1", + "cType": "const Npoint *", + "canonical": "const Npoint *" + }, + { + "name": "np2", + "cType": "const Npoint *", + "canonical": "const Npoint *" + } + ] + }, + { + "name": "nsegment_cmp", + "file": "meos_npoint.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "ns1", + "cType": "const Nsegment *", + "canonical": "const Nsegment *" + }, + { + "name": "ns2", + "cType": "const Nsegment *", + "canonical": "const Nsegment *" + } + ] + }, + { + "name": "nsegment_eq", + "file": "meos_npoint.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ns1", + "cType": "const Nsegment *", + "canonical": "const Nsegment *" + }, + { + "name": "ns2", + "cType": "const Nsegment *", + "canonical": "const Nsegment *" + } + ] + }, + { + "name": "nsegment_ge", + "file": "meos_npoint.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ns1", + "cType": "const Nsegment *", + "canonical": "const Nsegment *" + }, + { + "name": "ns2", + "cType": "const Nsegment *", + "canonical": "const Nsegment *" + } + ] + }, + { + "name": "nsegment_gt", + "file": "meos_npoint.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ns1", + "cType": "const Nsegment *", + "canonical": "const Nsegment *" + }, + { + "name": "ns2", + "cType": "const Nsegment *", + "canonical": "const Nsegment *" + } + ] + }, + { + "name": "nsegment_le", + "file": "meos_npoint.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ns1", + "cType": "const Nsegment *", + "canonical": "const Nsegment *" + }, + { + "name": "ns2", + "cType": "const Nsegment *", + "canonical": "const Nsegment *" + } + ] + }, + { + "name": "nsegment_lt", + "file": "meos_npoint.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ns1", + "cType": "const Nsegment *", + "canonical": "const Nsegment *" + }, + { + "name": "ns2", + "cType": "const Nsegment *", + "canonical": "const Nsegment *" + } + ] + }, + { + "name": "nsegment_ne", + "file": "meos_npoint.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ns1", + "cType": "const Nsegment *", + "canonical": "const Nsegment *" + }, + { + "name": "ns2", + "cType": "const Nsegment *", + "canonical": "const Nsegment *" + } + ] + }, + { + "name": "npointset_in", + "file": "meos_npoint.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "npointset_out", + "file": "meos_npoint.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "npointset_make", + "file": "meos_npoint.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "values", + "cType": "Npoint **", + "canonical": "Npoint **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "npoint_to_set", + "file": "meos_npoint.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + } + ] + }, + { + "name": "npointset_end_value", + "file": "meos_npoint.h", + "returnType": { + "c": "Npoint *", + "canonical": "Npoint *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "npointset_routes", + "file": "meos_npoint.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "npointset_start_value", + "file": "meos_npoint.h", + "returnType": { + "c": "Npoint *", + "canonical": "Npoint *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "npointset_value_n", + "file": "meos_npoint.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "n", + "cType": "int", + "canonical": "int" + }, + { + "name": "result", + "cType": "Npoint **", + "canonical": "Npoint **" + } + ] + }, + { + "name": "npointset_values", + "file": "meos_npoint.h", + "returnType": { + "c": "Npoint **", + "canonical": "Npoint **" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "contained_npoint_set", + "file": "meos_npoint.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "contains_set_npoint", + "file": "meos_npoint.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + } + ] + }, + { + "name": "intersection_npoint_set", + "file": "meos_npoint.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "intersection_set_npoint", + "file": "meos_npoint.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + } + ] + }, + { + "name": "minus_npoint_set", + "file": "meos_npoint.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "minus_set_npoint", + "file": "meos_npoint.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + } + ] + }, + { + "name": "npoint_union_transfn", + "file": "meos_npoint.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "state", + "cType": "Set *", + "canonical": "Set *" + }, + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + } + ] + }, + { + "name": "union_npoint_set", + "file": "meos_npoint.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "union_set_npoint", + "file": "meos_npoint.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + } + ] + }, + { + "name": "tnpoint_in", + "file": "meos_npoint.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "tnpoint_from_mfjson", + "file": "meos_npoint.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "mfjson", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "tnpoint_out", + "file": "meos_npoint.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "tnpointinst_make", + "file": "meos_npoint.h", + "returnType": { + "c": "TInstant *", + "canonical": "TInstant *" + }, + "params": [ + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "tnpoint_from_base_temp", + "file": "meos_npoint.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tnpointseq_from_base_tstzset", + "file": "meos_npoint.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "tnpointseq_from_base_tstzspan", + "file": "meos_npoint.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "tnpointseqset_from_base_tstzspanset", + "file": "meos_npoint.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "tgeompoint_to_tnpoint", + "file": "meos_npoint.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tnpoint_to_tgeompoint", + "file": "meos_npoint.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tnpoint_cumulative_length", + "file": "meos_npoint.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tnpoint_end_value", + "file": "meos_npoint.h", + "returnType": { + "c": "Npoint *", + "canonical": "Npoint *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tnpoint_length", + "file": "meos_npoint.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tnpoint_positions", + "file": "meos_npoint.h", + "returnType": { + "c": "Nsegment **", + "canonical": "Nsegment **" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tnpoint_route", + "file": "meos_npoint.h", + "returnType": { + "c": "int64", + "canonical": "long" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tnpoint_routes", + "file": "meos_npoint.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tnpoint_speed", + "file": "meos_npoint.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tnpoint_start_value", + "file": "meos_npoint.h", + "returnType": { + "c": "Npoint *", + "canonical": "Npoint *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tnpoint_trajectory", + "file": "meos_npoint.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tnpoint_value_at_timestamptz", + "file": "meos_npoint.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "strict", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "value", + "cType": "Npoint **", + "canonical": "Npoint **" + } + ] + }, + { + "name": "tnpoint_value_n", + "file": "meos_npoint.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "n", + "cType": "int", + "canonical": "int" + }, + { + "name": "result", + "cType": "Npoint **", + "canonical": "Npoint **" + } + ] + }, + { + "name": "tnpoint_values", + "file": "meos_npoint.h", + "returnType": { + "c": "Npoint **", + "canonical": "Npoint **" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tnpoint_twcentroid", + "file": "meos_npoint.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tnpoint_at_geom", + "file": "meos_npoint.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "tnpoint_at_npoint", + "file": "meos_npoint.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + } + ] + }, + { + "name": "tnpoint_at_npointset", + "file": "meos_npoint.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "tnpoint_at_stbox", + "file": "meos_npoint.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "border_inc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tnpoint_minus_geom", + "file": "meos_npoint.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "tnpoint_minus_npoint", + "file": "meos_npoint.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + } + ] + }, + { + "name": "tnpoint_minus_npointset", + "file": "meos_npoint.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "tnpoint_minus_stbox", + "file": "meos_npoint.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "border_inc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tdistance_tnpoint_npoint", + "file": "meos_npoint.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + } + ] + }, + { + "name": "tdistance_tnpoint_geo", + "file": "meos_npoint.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "tdistance_tnpoint_tnpoint", + "file": "meos_npoint.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "nad_tnpoint_geo", + "file": "meos_npoint.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "nad_tnpoint_npoint", + "file": "meos_npoint.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + } + ] + }, + { + "name": "nad_tnpoint_stbox", + "file": "meos_npoint.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + } + ] + }, + { + "name": "nad_tnpoint_tnpoint", + "file": "meos_npoint.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "nai_tnpoint_geo", + "file": "meos_npoint.h", + "returnType": { + "c": "TInstant *", + "canonical": "TInstant *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "nai_tnpoint_npoint", + "file": "meos_npoint.h", + "returnType": { + "c": "TInstant *", + "canonical": "TInstant *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + } + ] + }, + { + "name": "nai_tnpoint_tnpoint", + "file": "meos_npoint.h", + "returnType": { + "c": "TInstant *", + "canonical": "TInstant *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "shortestline_tnpoint_geo", + "file": "meos_npoint.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "shortestline_tnpoint_npoint", + "file": "meos_npoint.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + } + ] + }, + { + "name": "shortestline_tnpoint_tnpoint", + "file": "meos_npoint.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tnpoint_tcentroid_transfn", + "file": "meos_npoint.h", + "returnType": { + "c": "SkipList *", + "canonical": "struct SkipList *" + }, + "params": [ + { + "name": "state", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_eq_npoint_tnpoint", + "file": "meos_npoint.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_eq_tnpoint_npoint", + "file": "meos_npoint.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + } + ] + }, + { + "name": "always_eq_tnpoint_tnpoint", + "file": "meos_npoint.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_ne_npoint_tnpoint", + "file": "meos_npoint.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_ne_tnpoint_npoint", + "file": "meos_npoint.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + } + ] + }, + { + "name": "always_ne_tnpoint_tnpoint", + "file": "meos_npoint.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_eq_npoint_tnpoint", + "file": "meos_npoint.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_eq_tnpoint_npoint", + "file": "meos_npoint.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + } + ] + }, + { + "name": "ever_eq_tnpoint_tnpoint", + "file": "meos_npoint.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_ne_npoint_tnpoint", + "file": "meos_npoint.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_ne_tnpoint_npoint", + "file": "meos_npoint.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + } + ] + }, + { + "name": "ever_ne_tnpoint_tnpoint", + "file": "meos_npoint.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "teq_tnpoint_npoint", + "file": "meos_npoint.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + } + ] + }, + { + "name": "tne_tnpoint_npoint", + "file": "meos_npoint.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + } + ] + }, + { + "name": "pcpoint_hex_in", + "file": "meos_pointcloud.h", + "returnType": { + "c": "Pcpoint *", + "canonical": "struct Pcpoint *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "pcpoint_hex_out", + "file": "meos_pointcloud.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "pt", + "cType": "const Pcpoint *", + "canonical": "const struct Pcpoint *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "pcpoint_from_hexwkb", + "file": "meos_pointcloud.h", + "returnType": { + "c": "Pcpoint *", + "canonical": "struct Pcpoint *" + }, + "params": [ + { + "name": "hexwkb", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "pcpoint_as_hexwkb", + "file": "meos_pointcloud.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "pt", + "cType": "const Pcpoint *", + "canonical": "const struct Pcpoint *" + } + ] + }, + { + "name": "pcpoint_copy", + "file": "meos_pointcloud.h", + "returnType": { + "c": "Pcpoint *", + "canonical": "struct Pcpoint *" + }, + "params": [ + { + "name": "pt", + "cType": "const Pcpoint *", + "canonical": "const struct Pcpoint *" + } + ] + }, + { + "name": "pcpoint_get_pcid", + "file": "meos_pointcloud.h", + "returnType": { + "c": "uint32_t", + "canonical": "unsigned int" + }, + "params": [ + { + "name": "pt", + "cType": "const Pcpoint *", + "canonical": "const struct Pcpoint *" + } + ] + }, + { + "name": "pcpoint_hash", + "file": "meos_pointcloud.h", + "returnType": { + "c": "uint32", + "canonical": "unsigned int" + }, + "params": [ + { + "name": "pt", + "cType": "const Pcpoint *", + "canonical": "const struct Pcpoint *" + } + ] + }, + { + "name": "pcpoint_hash_extended", + "file": "meos_pointcloud.h", + "returnType": { + "c": "uint64", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "pt", + "cType": "const Pcpoint *", + "canonical": "const struct Pcpoint *" + }, + { + "name": "seed", + "cType": "uint64", + "canonical": "unsigned long" + } + ] + }, + { + "name": "pcpoint_get_x", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "pt", + "cType": "const Pcpoint *", + "canonical": "const struct Pcpoint *" + }, + { + "name": "schema", + "cType": "PCSCHEMA *", + "canonical": "struct PCSCHEMA *" + }, + { + "name": "out", + "cType": "double *", + "canonical": "double *" + } + ] + }, + { + "name": "pcpoint_get_y", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "pt", + "cType": "const Pcpoint *", + "canonical": "const struct Pcpoint *" + }, + { + "name": "schema", + "cType": "PCSCHEMA *", + "canonical": "struct PCSCHEMA *" + }, + { + "name": "out", + "cType": "double *", + "canonical": "double *" + } + ] + }, + { + "name": "pcpoint_get_z", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "pt", + "cType": "const Pcpoint *", + "canonical": "const struct Pcpoint *" + }, + { + "name": "schema", + "cType": "PCSCHEMA *", + "canonical": "struct PCSCHEMA *" + }, + { + "name": "out", + "cType": "double *", + "canonical": "double *" + } + ] + }, + { + "name": "pcpoint_get_dim", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "pt", + "cType": "const Pcpoint *", + "canonical": "const struct Pcpoint *" + }, + { + "name": "schema", + "cType": "PCSCHEMA *", + "canonical": "struct PCSCHEMA *" + }, + { + "name": "name", + "cType": "const char *", + "canonical": "const char *" + }, + { + "name": "out", + "cType": "double *", + "canonical": "double *" + } + ] + }, + { + "name": "pcpoint_to_tpcbox", + "file": "meos_pointcloud.h", + "returnType": { + "c": "TPCBox *", + "canonical": "TPCBox *" + }, + "params": [ + { + "name": "pt", + "cType": "const Pcpoint *", + "canonical": "const struct Pcpoint *" + }, + { + "name": "schema", + "cType": "PCSCHEMA *", + "canonical": "struct PCSCHEMA *" + } + ] + }, + { + "name": "meos_pc_schema", + "file": "meos_pointcloud.h", + "returnType": { + "c": "PCSCHEMA *", + "canonical": "struct PCSCHEMA *" + }, + "params": [ + { + "name": "pcid", + "cType": "uint32_t", + "canonical": "unsigned int" + } + ] + }, + { + "name": "meos_pc_schema_register", + "file": "meos_pointcloud.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "pcid", + "cType": "uint32_t", + "canonical": "unsigned int" + }, + { + "name": "schema", + "cType": "PCSCHEMA *", + "canonical": "struct PCSCHEMA *" + } + ] + }, + { + "name": "meos_pc_schema_register_xml", + "file": "meos_pointcloud.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "pcid", + "cType": "uint32_t", + "canonical": "unsigned int" + }, + { + "name": "schema", + "cType": "PCSCHEMA *", + "canonical": "struct PCSCHEMA *" + }, + { + "name": "xml_text", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "meos_pc_schema_xml", + "file": "meos_pointcloud.h", + "returnType": { + "c": "const char *", + "canonical": "const char *" + }, + "params": [ + { + "name": "pcid", + "cType": "uint32_t", + "canonical": "unsigned int" + } + ] + }, + { + "name": "meos_pc_schema_clear", + "file": "meos_pointcloud.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [] + }, + { + "name": "pcpoint_cmp", + "file": "meos_pointcloud.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "pt1", + "cType": "const Pcpoint *", + "canonical": "const struct Pcpoint *" + }, + { + "name": "pt2", + "cType": "const Pcpoint *", + "canonical": "const struct Pcpoint *" + } + ] + }, + { + "name": "pcpoint_eq", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "pt1", + "cType": "const Pcpoint *", + "canonical": "const struct Pcpoint *" + }, + { + "name": "pt2", + "cType": "const Pcpoint *", + "canonical": "const struct Pcpoint *" + } + ] + }, + { + "name": "pcpoint_ne", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "pt1", + "cType": "const Pcpoint *", + "canonical": "const struct Pcpoint *" + }, + { + "name": "pt2", + "cType": "const Pcpoint *", + "canonical": "const struct Pcpoint *" + } + ] + }, + { + "name": "pcpoint_lt", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "pt1", + "cType": "const Pcpoint *", + "canonical": "const struct Pcpoint *" + }, + { + "name": "pt2", + "cType": "const Pcpoint *", + "canonical": "const struct Pcpoint *" + } + ] + }, + { + "name": "pcpoint_le", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "pt1", + "cType": "const Pcpoint *", + "canonical": "const struct Pcpoint *" + }, + { + "name": "pt2", + "cType": "const Pcpoint *", + "canonical": "const struct Pcpoint *" + } + ] + }, + { + "name": "pcpoint_gt", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "pt1", + "cType": "const Pcpoint *", + "canonical": "const struct Pcpoint *" + }, + { + "name": "pt2", + "cType": "const Pcpoint *", + "canonical": "const struct Pcpoint *" + } + ] + }, + { + "name": "pcpoint_ge", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "pt1", + "cType": "const Pcpoint *", + "canonical": "const struct Pcpoint *" + }, + { + "name": "pt2", + "cType": "const Pcpoint *", + "canonical": "const struct Pcpoint *" + } + ] + }, + { + "name": "pcpatch_hex_in", + "file": "meos_pointcloud.h", + "returnType": { + "c": "Pcpatch *", + "canonical": "struct Pcpatch *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "pcpatch_hex_out", + "file": "meos_pointcloud.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "pa", + "cType": "const Pcpatch *", + "canonical": "const struct Pcpatch *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "pcpatch_from_hexwkb", + "file": "meos_pointcloud.h", + "returnType": { + "c": "Pcpatch *", + "canonical": "struct Pcpatch *" + }, + "params": [ + { + "name": "hexwkb", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "pcpatch_as_hexwkb", + "file": "meos_pointcloud.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "pa", + "cType": "const Pcpatch *", + "canonical": "const struct Pcpatch *" + } + ] + }, + { + "name": "pcpatch_copy", + "file": "meos_pointcloud.h", + "returnType": { + "c": "Pcpatch *", + "canonical": "struct Pcpatch *" + }, + "params": [ + { + "name": "pa", + "cType": "const Pcpatch *", + "canonical": "const struct Pcpatch *" + } + ] + }, + { + "name": "pcpatch_get_pcid", + "file": "meos_pointcloud.h", + "returnType": { + "c": "uint32_t", + "canonical": "unsigned int" + }, + "params": [ + { + "name": "pa", + "cType": "const Pcpatch *", + "canonical": "const struct Pcpatch *" + } + ] + }, + { + "name": "pcpatch_npoints", + "file": "meos_pointcloud.h", + "returnType": { + "c": "uint32_t", + "canonical": "unsigned int" + }, + "params": [ + { + "name": "pa", + "cType": "const Pcpatch *", + "canonical": "const struct Pcpatch *" + } + ] + }, + { + "name": "pcpatch_hash", + "file": "meos_pointcloud.h", + "returnType": { + "c": "uint32", + "canonical": "unsigned int" + }, + "params": [ + { + "name": "pa", + "cType": "const Pcpatch *", + "canonical": "const struct Pcpatch *" + } + ] + }, + { + "name": "pcpatch_hash_extended", + "file": "meos_pointcloud.h", + "returnType": { + "c": "uint64", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "pa", + "cType": "const Pcpatch *", + "canonical": "const struct Pcpatch *" + }, + { + "name": "seed", + "cType": "uint64", + "canonical": "unsigned long" + } + ] + }, + { + "name": "pcpatch_cmp", + "file": "meos_pointcloud.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "pa1", + "cType": "const Pcpatch *", + "canonical": "const struct Pcpatch *" + }, + { + "name": "pa2", + "cType": "const Pcpatch *", + "canonical": "const struct Pcpatch *" + } + ] + }, + { + "name": "pcpatch_eq", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "pa1", + "cType": "const Pcpatch *", + "canonical": "const struct Pcpatch *" + }, + { + "name": "pa2", + "cType": "const Pcpatch *", + "canonical": "const struct Pcpatch *" + } + ] + }, + { + "name": "pcpatch_ne", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "pa1", + "cType": "const Pcpatch *", + "canonical": "const struct Pcpatch *" + }, + { + "name": "pa2", + "cType": "const Pcpatch *", + "canonical": "const struct Pcpatch *" + } + ] + }, + { + "name": "pcpatch_lt", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "pa1", + "cType": "const Pcpatch *", + "canonical": "const struct Pcpatch *" + }, + { + "name": "pa2", + "cType": "const Pcpatch *", + "canonical": "const struct Pcpatch *" + } + ] + }, + { + "name": "pcpatch_le", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "pa1", + "cType": "const Pcpatch *", + "canonical": "const struct Pcpatch *" + }, + { + "name": "pa2", + "cType": "const Pcpatch *", + "canonical": "const struct Pcpatch *" + } + ] + }, + { + "name": "pcpatch_gt", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "pa1", + "cType": "const Pcpatch *", + "canonical": "const struct Pcpatch *" + }, + { + "name": "pa2", + "cType": "const Pcpatch *", + "canonical": "const struct Pcpatch *" + } + ] + }, + { + "name": "pcpatch_ge", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "pa1", + "cType": "const Pcpatch *", + "canonical": "const struct Pcpatch *" + }, + { + "name": "pa2", + "cType": "const Pcpatch *", + "canonical": "const struct Pcpatch *" + } + ] + }, + { + "name": "pcpointset_in", + "file": "meos_pointcloud.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "pcpointset_out", + "file": "meos_pointcloud.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "pcpointset_make", + "file": "meos_pointcloud.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "values", + "cType": "Pcpoint **", + "canonical": "struct Pcpoint **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "pcpoint_to_set", + "file": "meos_pointcloud.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "pt", + "cType": "const Pcpoint *", + "canonical": "const struct Pcpoint *" + } + ] + }, + { + "name": "pcpointset_start_value", + "file": "meos_pointcloud.h", + "returnType": { + "c": "Pcpoint *", + "canonical": "struct Pcpoint *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "pcpointset_end_value", + "file": "meos_pointcloud.h", + "returnType": { + "c": "Pcpoint *", + "canonical": "struct Pcpoint *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "pcpointset_value_n", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "n", + "cType": "int", + "canonical": "int" + }, + { + "name": "result", + "cType": "Pcpoint **", + "canonical": "struct Pcpoint **" + } + ] + }, + { + "name": "pcpointset_values", + "file": "meos_pointcloud.h", + "returnType": { + "c": "Pcpoint **", + "canonical": "struct Pcpoint **" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "contains_set_pcpoint", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "pt", + "cType": "Pcpoint *", + "canonical": "struct Pcpoint *" + } + ] + }, + { + "name": "contained_pcpoint_set", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "pt", + "cType": "const Pcpoint *", + "canonical": "const struct Pcpoint *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "intersection_pcpoint_set", + "file": "meos_pointcloud.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "pt", + "cType": "const Pcpoint *", + "canonical": "const struct Pcpoint *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "intersection_set_pcpoint", + "file": "meos_pointcloud.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "pt", + "cType": "const Pcpoint *", + "canonical": "const struct Pcpoint *" + } + ] + }, + { + "name": "minus_pcpoint_set", + "file": "meos_pointcloud.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "pt", + "cType": "const Pcpoint *", + "canonical": "const struct Pcpoint *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "minus_set_pcpoint", + "file": "meos_pointcloud.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "pt", + "cType": "const Pcpoint *", + "canonical": "const struct Pcpoint *" + } + ] + }, + { + "name": "union_pcpoint_set", + "file": "meos_pointcloud.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "pt", + "cType": "const Pcpoint *", + "canonical": "const struct Pcpoint *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "union_set_pcpoint", + "file": "meos_pointcloud.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "pt", + "cType": "const Pcpoint *", + "canonical": "const struct Pcpoint *" + } + ] + }, + { + "name": "pcpoint_union_transfn", + "file": "meos_pointcloud.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "state", + "cType": "Set *", + "canonical": "Set *" + }, + { + "name": "pt", + "cType": "const Pcpoint *", + "canonical": "const struct Pcpoint *" + } + ] + }, + { + "name": "pcpatchset_in", + "file": "meos_pointcloud.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "pcpatchset_out", + "file": "meos_pointcloud.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "pcpatchset_make", + "file": "meos_pointcloud.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "values", + "cType": "Pcpatch **", + "canonical": "struct Pcpatch **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "pcpatch_to_set", + "file": "meos_pointcloud.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "pa", + "cType": "const Pcpatch *", + "canonical": "const struct Pcpatch *" + } + ] + }, + { + "name": "pcpatchset_start_value", + "file": "meos_pointcloud.h", + "returnType": { + "c": "Pcpatch *", + "canonical": "struct Pcpatch *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "pcpatchset_end_value", + "file": "meos_pointcloud.h", + "returnType": { + "c": "Pcpatch *", + "canonical": "struct Pcpatch *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "pcpatchset_value_n", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "n", + "cType": "int", + "canonical": "int" + }, + { + "name": "result", + "cType": "Pcpatch **", + "canonical": "struct Pcpatch **" + } + ] + }, + { + "name": "pcpatchset_values", + "file": "meos_pointcloud.h", + "returnType": { + "c": "Pcpatch **", + "canonical": "struct Pcpatch **" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "contains_set_pcpatch", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "pa", + "cType": "Pcpatch *", + "canonical": "struct Pcpatch *" + } + ] + }, + { + "name": "contained_pcpatch_set", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "pa", + "cType": "const Pcpatch *", + "canonical": "const struct Pcpatch *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "intersection_pcpatch_set", + "file": "meos_pointcloud.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "pa", + "cType": "const Pcpatch *", + "canonical": "const struct Pcpatch *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "intersection_set_pcpatch", + "file": "meos_pointcloud.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "pa", + "cType": "const Pcpatch *", + "canonical": "const struct Pcpatch *" + } + ] + }, + { + "name": "minus_pcpatch_set", + "file": "meos_pointcloud.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "pa", + "cType": "const Pcpatch *", + "canonical": "const struct Pcpatch *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "minus_set_pcpatch", + "file": "meos_pointcloud.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "pa", + "cType": "const Pcpatch *", + "canonical": "const struct Pcpatch *" + } + ] + }, + { + "name": "union_pcpatch_set", + "file": "meos_pointcloud.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "pa", + "cType": "const Pcpatch *", + "canonical": "const struct Pcpatch *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "union_set_pcpatch", + "file": "meos_pointcloud.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "pa", + "cType": "const Pcpatch *", + "canonical": "const struct Pcpatch *" + } + ] + }, + { + "name": "pcpatch_union_transfn", + "file": "meos_pointcloud.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "state", + "cType": "Set *", + "canonical": "Set *" + }, + { + "name": "pa", + "cType": "const Pcpatch *", + "canonical": "const struct Pcpatch *" + } + ] + }, + { + "name": "tpcbox_in", + "file": "meos_pointcloud.h", + "returnType": { + "c": "TPCBox *", + "canonical": "TPCBox *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "tpcbox_out", + "file": "meos_pointcloud.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "box", + "cType": "const TPCBox *", + "canonical": "const TPCBox *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "tpcbox_make", + "file": "meos_pointcloud.h", + "returnType": { + "c": "TPCBox *", + "canonical": "TPCBox *" + }, + "params": [ + { + "name": "hasx", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "hasz", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "hast", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "geodetic", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + }, + { + "name": "pcid", + "cType": "uint32_t", + "canonical": "unsigned int" + }, + { + "name": "xmin", + "cType": "double", + "canonical": "double" + }, + { + "name": "xmax", + "cType": "double", + "canonical": "double" + }, + { + "name": "ymin", + "cType": "double", + "canonical": "double" + }, + { + "name": "ymax", + "cType": "double", + "canonical": "double" + }, + { + "name": "zmin", + "cType": "double", + "canonical": "double" + }, + { + "name": "zmax", + "cType": "double", + "canonical": "double" + }, + { + "name": "period", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "tpcbox_copy", + "file": "meos_pointcloud.h", + "returnType": { + "c": "TPCBox *", + "canonical": "TPCBox *" + }, + "params": [ + { + "name": "box", + "cType": "const TPCBox *", + "canonical": "const TPCBox *" + } + ] + }, + { + "name": "pcpatch_to_tpcbox", + "file": "meos_pointcloud.h", + "returnType": { + "c": "TPCBox *", + "canonical": "TPCBox *" + }, + "params": [ + { + "name": "pa", + "cType": "const Pcpatch *", + "canonical": "const struct Pcpatch *" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + } + ] + }, + { + "name": "tpcbox_hasx", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const TPCBox *", + "canonical": "const TPCBox *" + } + ] + }, + { + "name": "tpcbox_hasz", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const TPCBox *", + "canonical": "const TPCBox *" + } + ] + }, + { + "name": "tpcbox_hast", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const TPCBox *", + "canonical": "const TPCBox *" + } + ] + }, + { + "name": "tpcbox_geodetic", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const TPCBox *", + "canonical": "const TPCBox *" + } + ] + }, + { + "name": "tpcbox_xmin", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const TPCBox *", + "canonical": "const TPCBox *" + }, + { + "name": "result", + "cType": "double *", + "canonical": "double *" + } + ] + }, + { + "name": "tpcbox_xmax", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const TPCBox *", + "canonical": "const TPCBox *" + }, + { + "name": "result", + "cType": "double *", + "canonical": "double *" + } + ] + }, + { + "name": "tpcbox_ymin", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const TPCBox *", + "canonical": "const TPCBox *" + }, + { + "name": "result", + "cType": "double *", + "canonical": "double *" + } + ] + }, + { + "name": "tpcbox_ymax", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const TPCBox *", + "canonical": "const TPCBox *" + }, + { + "name": "result", + "cType": "double *", + "canonical": "double *" + } + ] + }, + { + "name": "tpcbox_zmin", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const TPCBox *", + "canonical": "const TPCBox *" + }, + { + "name": "result", + "cType": "double *", + "canonical": "double *" + } + ] + }, + { + "name": "tpcbox_zmax", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const TPCBox *", + "canonical": "const TPCBox *" + }, + { + "name": "result", + "cType": "double *", + "canonical": "double *" + } + ] + }, + { + "name": "tpcbox_tmin", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const TPCBox *", + "canonical": "const TPCBox *" + }, + { + "name": "result", + "cType": "TimestampTz *", + "canonical": "long *" + } + ] + }, + { + "name": "tpcbox_tmin_inc", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const TPCBox *", + "canonical": "const TPCBox *" + }, + { + "name": "result", + "cType": "bool *", + "canonical": "_Bool *" + } + ] + }, + { + "name": "tpcbox_tmax", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const TPCBox *", + "canonical": "const TPCBox *" + }, + { + "name": "result", + "cType": "TimestampTz *", + "canonical": "long *" + } + ] + }, + { + "name": "tpcbox_tmax_inc", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box", + "cType": "const TPCBox *", + "canonical": "const TPCBox *" + }, + { + "name": "result", + "cType": "bool *", + "canonical": "_Bool *" + } + ] + }, + { + "name": "tpcbox_srid", + "file": "meos_pointcloud.h", + "returnType": { + "c": "int32_t", + "canonical": "int" + }, + "params": [ + { + "name": "box", + "cType": "const TPCBox *", + "canonical": "const TPCBox *" + } + ] + }, + { + "name": "tpcbox_pcid", + "file": "meos_pointcloud.h", + "returnType": { + "c": "uint32_t", + "canonical": "unsigned int" + }, + "params": [ + { + "name": "box", + "cType": "const TPCBox *", + "canonical": "const TPCBox *" + } + ] + }, + { + "name": "tpcbox_to_stbox", + "file": "meos_pointcloud.h", + "returnType": { + "c": "STBox *", + "canonical": "STBox *" + }, + "params": [ + { + "name": "box", + "cType": "const TPCBox *", + "canonical": "const TPCBox *" + } + ] + }, + { + "name": "tpcbox_expand", + "file": "meos_pointcloud.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "box1", + "cType": "const TPCBox *", + "canonical": "const TPCBox *" + }, + { + "name": "box2", + "cType": "TPCBox *", + "canonical": "TPCBox *" + } + ] + }, + { + "name": "tpcbox_round", + "file": "meos_pointcloud.h", + "returnType": { + "c": "TPCBox *", + "canonical": "TPCBox *" + }, + "params": [ + { + "name": "box", + "cType": "const TPCBox *", + "canonical": "const TPCBox *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "tpcbox_set_srid", + "file": "meos_pointcloud.h", + "returnType": { + "c": "TPCBox *", + "canonical": "TPCBox *" + }, + "params": [ + { + "name": "box", + "cType": "const TPCBox *", + "canonical": "const TPCBox *" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + } + ] + }, + { + "name": "union_tpcbox_tpcbox", + "file": "meos_pointcloud.h", + "returnType": { + "c": "TPCBox *", + "canonical": "TPCBox *" + }, + "params": [ + { + "name": "box1", + "cType": "const TPCBox *", + "canonical": "const TPCBox *" + }, + { + "name": "box2", + "cType": "const TPCBox *", + "canonical": "const TPCBox *" + }, + { + "name": "strict", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "inter_tpcbox_tpcbox", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const TPCBox *", + "canonical": "const TPCBox *" + }, + { + "name": "box2", + "cType": "const TPCBox *", + "canonical": "const TPCBox *" + }, + { + "name": "result", + "cType": "TPCBox *", + "canonical": "TPCBox *" + } + ] + }, + { + "name": "intersection_tpcbox_tpcbox", + "file": "meos_pointcloud.h", + "returnType": { + "c": "TPCBox *", + "canonical": "TPCBox *" + }, + "params": [ + { + "name": "box1", + "cType": "const TPCBox *", + "canonical": "const TPCBox *" + }, + { + "name": "box2", + "cType": "const TPCBox *", + "canonical": "const TPCBox *" + } + ] + }, + { + "name": "contains_tpcbox_tpcbox", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const TPCBox *", + "canonical": "const TPCBox *" + }, + { + "name": "box2", + "cType": "const TPCBox *", + "canonical": "const TPCBox *" + } + ] + }, + { + "name": "contained_tpcbox_tpcbox", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const TPCBox *", + "canonical": "const TPCBox *" + }, + { + "name": "box2", + "cType": "const TPCBox *", + "canonical": "const TPCBox *" + } + ] + }, + { + "name": "overlaps_tpcbox_tpcbox", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const TPCBox *", + "canonical": "const TPCBox *" + }, + { + "name": "box2", + "cType": "const TPCBox *", + "canonical": "const TPCBox *" + } + ] + }, + { + "name": "same_tpcbox_tpcbox", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const TPCBox *", + "canonical": "const TPCBox *" + }, + { + "name": "box2", + "cType": "const TPCBox *", + "canonical": "const TPCBox *" + } + ] + }, + { + "name": "adjacent_tpcbox_tpcbox", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const TPCBox *", + "canonical": "const TPCBox *" + }, + { + "name": "box2", + "cType": "const TPCBox *", + "canonical": "const TPCBox *" + } + ] + }, + { + "name": "tpcbox_cmp", + "file": "meos_pointcloud.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "box1", + "cType": "const TPCBox *", + "canonical": "const TPCBox *" + }, + { + "name": "box2", + "cType": "const TPCBox *", + "canonical": "const TPCBox *" + } + ] + }, + { + "name": "tpcbox_eq", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const TPCBox *", + "canonical": "const TPCBox *" + }, + { + "name": "box2", + "cType": "const TPCBox *", + "canonical": "const TPCBox *" + } + ] + }, + { + "name": "tpcbox_ne", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const TPCBox *", + "canonical": "const TPCBox *" + }, + { + "name": "box2", + "cType": "const TPCBox *", + "canonical": "const TPCBox *" + } + ] + }, + { + "name": "tpcbox_lt", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const TPCBox *", + "canonical": "const TPCBox *" + }, + { + "name": "box2", + "cType": "const TPCBox *", + "canonical": "const TPCBox *" + } + ] + }, + { + "name": "tpcbox_le", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const TPCBox *", + "canonical": "const TPCBox *" + }, + { + "name": "box2", + "cType": "const TPCBox *", + "canonical": "const TPCBox *" + } + ] + }, + { + "name": "tpcbox_gt", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const TPCBox *", + "canonical": "const TPCBox *" + }, + { + "name": "box2", + "cType": "const TPCBox *", + "canonical": "const TPCBox *" + } + ] + }, + { + "name": "tpcbox_ge", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const TPCBox *", + "canonical": "const TPCBox *" + }, + { + "name": "box2", + "cType": "const TPCBox *", + "canonical": "const TPCBox *" + } + ] + }, + { + "name": "left_tpcbox_tpcbox", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const TPCBox *", + "canonical": "const TPCBox *" + }, + { + "name": "box2", + "cType": "const TPCBox *", + "canonical": "const TPCBox *" + } + ] + }, + { + "name": "overleft_tpcbox_tpcbox", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const TPCBox *", + "canonical": "const TPCBox *" + }, + { + "name": "box2", + "cType": "const TPCBox *", + "canonical": "const TPCBox *" + } + ] + }, + { + "name": "right_tpcbox_tpcbox", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const TPCBox *", + "canonical": "const TPCBox *" + }, + { + "name": "box2", + "cType": "const TPCBox *", + "canonical": "const TPCBox *" + } + ] + }, + { + "name": "overright_tpcbox_tpcbox", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const TPCBox *", + "canonical": "const TPCBox *" + }, + { + "name": "box2", + "cType": "const TPCBox *", + "canonical": "const TPCBox *" + } + ] + }, + { + "name": "below_tpcbox_tpcbox", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const TPCBox *", + "canonical": "const TPCBox *" + }, + { + "name": "box2", + "cType": "const TPCBox *", + "canonical": "const TPCBox *" + } + ] + }, + { + "name": "overbelow_tpcbox_tpcbox", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const TPCBox *", + "canonical": "const TPCBox *" + }, + { + "name": "box2", + "cType": "const TPCBox *", + "canonical": "const TPCBox *" + } + ] + }, + { + "name": "above_tpcbox_tpcbox", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const TPCBox *", + "canonical": "const TPCBox *" + }, + { + "name": "box2", + "cType": "const TPCBox *", + "canonical": "const TPCBox *" + } + ] + }, + { + "name": "overabove_tpcbox_tpcbox", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const TPCBox *", + "canonical": "const TPCBox *" + }, + { + "name": "box2", + "cType": "const TPCBox *", + "canonical": "const TPCBox *" + } + ] + }, + { + "name": "front_tpcbox_tpcbox", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const TPCBox *", + "canonical": "const TPCBox *" + }, + { + "name": "box2", + "cType": "const TPCBox *", + "canonical": "const TPCBox *" + } + ] + }, + { + "name": "overfront_tpcbox_tpcbox", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const TPCBox *", + "canonical": "const TPCBox *" + }, + { + "name": "box2", + "cType": "const TPCBox *", + "canonical": "const TPCBox *" + } + ] + }, + { + "name": "back_tpcbox_tpcbox", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const TPCBox *", + "canonical": "const TPCBox *" + }, + { + "name": "box2", + "cType": "const TPCBox *", + "canonical": "const TPCBox *" + } + ] + }, + { + "name": "overback_tpcbox_tpcbox", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const TPCBox *", + "canonical": "const TPCBox *" + }, + { + "name": "box2", + "cType": "const TPCBox *", + "canonical": "const TPCBox *" + } + ] + }, + { + "name": "before_tpcbox_tpcbox", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const TPCBox *", + "canonical": "const TPCBox *" + }, + { + "name": "box2", + "cType": "const TPCBox *", + "canonical": "const TPCBox *" + } + ] + }, + { + "name": "overbefore_tpcbox_tpcbox", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const TPCBox *", + "canonical": "const TPCBox *" + }, + { + "name": "box2", + "cType": "const TPCBox *", + "canonical": "const TPCBox *" + } + ] + }, + { + "name": "after_tpcbox_tpcbox", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const TPCBox *", + "canonical": "const TPCBox *" + }, + { + "name": "box2", + "cType": "const TPCBox *", + "canonical": "const TPCBox *" + } + ] + }, + { + "name": "overafter_tpcbox_tpcbox", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const TPCBox *", + "canonical": "const TPCBox *" + }, + { + "name": "box2", + "cType": "const TPCBox *", + "canonical": "const TPCBox *" + } + ] + }, + { + "name": "ensure_same_pcid_tpcbox", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const TPCBox *", + "canonical": "const TPCBox *" + }, + { + "name": "box2", + "cType": "const TPCBox *", + "canonical": "const TPCBox *" + } + ] + }, + { + "name": "tpointcloudinst_make", + "file": "meos_pointcloud.h", + "returnType": { + "c": "TInstant *", + "canonical": "TInstant *" + }, + "params": [ + { + "name": "pt", + "cType": "const Pcpoint *", + "canonical": "const struct Pcpoint *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "eintersects_tpcpoint_geo", + "file": "meos_pointcloud.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "nad_tpcpoint_geo", + "file": "meos_pointcloud.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "pose_as_ewkt", + "file": "meos_pose.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "pose_as_hexwkb", + "file": "meos_pose.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "variant", + "cType": "uint8_t", + "canonical": "unsigned char" + }, + { + "name": "size", + "cType": "size_t *", + "canonical": "unsigned long *" + } + ] + }, + { + "name": "pose_as_text", + "file": "meos_pose.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "pose_as_wkb", + "file": "meos_pose.h", + "returnType": { + "c": "uint8_t *", + "canonical": "unsigned char *" + }, + "params": [ + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "variant", + "cType": "uint8_t", + "canonical": "unsigned char" + }, + { + "name": "size_out", + "cType": "size_t *", + "canonical": "unsigned long *" + } + ] + }, + { + "name": "pose_from_wkb", + "file": "meos_pose.h", + "returnType": { + "c": "Pose *", + "canonical": "struct Pose *" + }, + "params": [ + { + "name": "wkb", + "cType": "const uint8_t *", + "canonical": "const unsigned char *" + }, + { + "name": "size", + "cType": "size_t", + "canonical": "unsigned long" + } + ] + }, + { + "name": "pose_from_hexwkb", + "file": "meos_pose.h", + "returnType": { + "c": "Pose *", + "canonical": "struct Pose *" + }, + "params": [ + { + "name": "hexwkb", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "pose_in", + "file": "meos_pose.h", + "returnType": { + "c": "Pose *", + "canonical": "struct Pose *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "pose_out", + "file": "meos_pose.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "pose_from_geopose", + "file": "meos_pose.h", + "returnType": { + "c": "Pose *", + "canonical": "struct Pose *" + }, + "params": [ + { + "name": "json", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "pose_as_geopose", + "file": "meos_pose.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "conformance", + "cType": "int", + "canonical": "int" + }, + { + "name": "precision", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "tpose_from_geopose", + "file": "meos_pose.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "json", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "tpose_as_geopose", + "file": "meos_pose.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "conformance", + "cType": "int", + "canonical": "int" + }, + { + "name": "precision", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "pose_apply_geo", + "file": "meos_pose.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "body", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "tpose_apply_geo", + "file": "meos_pose.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "body", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "pose_copy", + "file": "meos_pose.h", + "returnType": { + "c": "Pose *", + "canonical": "struct Pose *" + }, + "params": [ + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + } + ] + }, + { + "name": "pose_make_2d", + "file": "meos_pose.h", + "returnType": { + "c": "Pose *", + "canonical": "struct Pose *" + }, + "params": [ + { + "name": "x", + "cType": "double", + "canonical": "double" + }, + { + "name": "y", + "cType": "double", + "canonical": "double" + }, + { + "name": "theta", + "cType": "double", + "canonical": "double" + }, + { + "name": "geodetic", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + } + ] + }, + { + "name": "pose_make_3d", + "file": "meos_pose.h", + "returnType": { + "c": "Pose *", + "canonical": "struct Pose *" + }, + "params": [ + { + "name": "x", + "cType": "double", + "canonical": "double" + }, + { + "name": "y", + "cType": "double", + "canonical": "double" + }, + { + "name": "z", + "cType": "double", + "canonical": "double" + }, + { + "name": "W", + "cType": "double", + "canonical": "double" + }, + { + "name": "X", + "cType": "double", + "canonical": "double" + }, + { + "name": "Y", + "cType": "double", + "canonical": "double" + }, + { + "name": "Z", + "cType": "double", + "canonical": "double" + }, + { + "name": "geodetic", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + } + ] + }, + { + "name": "pose_make_point2d", + "file": "meos_pose.h", + "returnType": { + "c": "Pose *", + "canonical": "struct Pose *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "theta", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "pose_make_point3d", + "file": "meos_pose.h", + "returnType": { + "c": "Pose *", + "canonical": "struct Pose *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "W", + "cType": "double", + "canonical": "double" + }, + { + "name": "X", + "cType": "double", + "canonical": "double" + }, + { + "name": "Y", + "cType": "double", + "canonical": "double" + }, + { + "name": "Z", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "pose_to_point", + "file": "meos_pose.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + } + ] + }, + { + "name": "pose_to_stbox", + "file": "meos_pose.h", + "returnType": { + "c": "STBox *", + "canonical": "STBox *" + }, + "params": [ + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + } + ] + }, + { + "name": "pose_hash", + "file": "meos_pose.h", + "returnType": { + "c": "uint32", + "canonical": "unsigned int" + }, + "params": [ + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + } + ] + }, + { + "name": "pose_hash_extended", + "file": "meos_pose.h", + "returnType": { + "c": "uint64", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "seed", + "cType": "uint64", + "canonical": "unsigned long" + } + ] + }, + { + "name": "pose_orientation", + "file": "meos_pose.h", + "returnType": { + "c": "double *", + "canonical": "double *" + }, + "params": [ + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "pose_rotation", + "file": "meos_pose.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + } + ] + }, + { + "name": "pose_yaw", + "file": "meos_pose.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + } + ] + }, + { + "name": "pose_pitch", + "file": "meos_pose.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + } + ] + }, + { + "name": "pose_roll", + "file": "meos_pose.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + } + ] + }, + { + "name": "pose_angular_distance", + "file": "meos_pose.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "pose1", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "pose2", + "cType": "const Pose *", + "canonical": "const struct Pose *" + } + ] + }, + { + "name": "pose_normalize", + "file": "meos_pose.h", + "returnType": { + "c": "Pose *", + "canonical": "struct Pose *" + }, + "params": [ + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + } + ] + }, + { + "name": "pose_round", + "file": "meos_pose.h", + "returnType": { + "c": "Pose *", + "canonical": "struct Pose *" + }, + "params": [ + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "posearr_round", + "file": "meos_pose.h", + "returnType": { + "c": "Pose **", + "canonical": "struct Pose **" + }, + "params": [ + { + "name": "posearr", + "cType": "const Pose **", + "canonical": "const struct Pose **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "pose_set_srid", + "file": "meos_pose.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "pose", + "cType": "Pose *", + "canonical": "struct Pose *" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + } + ] + }, + { + "name": "pose_srid", + "file": "meos_pose.h", + "returnType": { + "c": "int32_t", + "canonical": "int" + }, + "params": [ + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + } + ] + }, + { + "name": "pose_transform", + "file": "meos_pose.h", + "returnType": { + "c": "Pose *", + "canonical": "struct Pose *" + }, + "params": [ + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + } + ] + }, + { + "name": "pose_transform_pipeline", + "file": "meos_pose.h", + "returnType": { + "c": "Pose *", + "canonical": "struct Pose *" + }, + "params": [ + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "pipelinestr", + "cType": "const char *", + "canonical": "const char *" + }, + { + "name": "srid", + "cType": "int32_t", + "canonical": "int" + }, + { + "name": "is_forward", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "pose_tstzspan_to_stbox", + "file": "meos_pose.h", + "returnType": { + "c": "STBox *", + "canonical": "STBox *" + }, + "params": [ + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "pose_timestamptz_to_stbox", + "file": "meos_pose.h", + "returnType": { + "c": "STBox *", + "canonical": "STBox *" + }, + "params": [ + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "distance_pose_geo", + "file": "meos_pose.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "distance_pose_pose", + "file": "meos_pose.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "pose1", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "pose2", + "cType": "const Pose *", + "canonical": "const struct Pose *" + } + ] + }, + { + "name": "distance_pose_stbox", + "file": "meos_pose.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + } + ] + }, + { + "name": "pose_cmp", + "file": "meos_pose.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "pose1", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "pose2", + "cType": "const Pose *", + "canonical": "const struct Pose *" + } + ] + }, + { + "name": "pose_eq", + "file": "meos_pose.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "pose1", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "pose2", + "cType": "const Pose *", + "canonical": "const struct Pose *" + } + ] + }, + { + "name": "pose_ge", + "file": "meos_pose.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "pose1", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "pose2", + "cType": "const Pose *", + "canonical": "const struct Pose *" + } + ] + }, + { + "name": "pose_gt", + "file": "meos_pose.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "pose1", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "pose2", + "cType": "const Pose *", + "canonical": "const struct Pose *" + } + ] + }, + { + "name": "pose_le", + "file": "meos_pose.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "pose1", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "pose2", + "cType": "const Pose *", + "canonical": "const struct Pose *" + } + ] + }, + { + "name": "pose_lt", + "file": "meos_pose.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "pose1", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "pose2", + "cType": "const Pose *", + "canonical": "const struct Pose *" + } + ] + }, + { + "name": "pose_ne", + "file": "meos_pose.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "pose1", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "pose2", + "cType": "const Pose *", + "canonical": "const struct Pose *" + } + ] + }, + { + "name": "pose_nsame", + "file": "meos_pose.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "pose1", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "pose2", + "cType": "const Pose *", + "canonical": "const struct Pose *" + } + ] + }, + { + "name": "pose_same", + "file": "meos_pose.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "pose1", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "pose2", + "cType": "const Pose *", + "canonical": "const struct Pose *" + } + ] + }, + { + "name": "poseset_in", + "file": "meos_pose.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "poseset_out", + "file": "meos_pose.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "poseset_make", + "file": "meos_pose.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "values", + "cType": "const Pose **", + "canonical": "const struct Pose **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "pose_to_set", + "file": "meos_pose.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + } + ] + }, + { + "name": "poseset_end_value", + "file": "meos_pose.h", + "returnType": { + "c": "Pose *", + "canonical": "struct Pose *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "poseset_start_value", + "file": "meos_pose.h", + "returnType": { + "c": "Pose *", + "canonical": "struct Pose *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "poseset_value_n", + "file": "meos_pose.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "n", + "cType": "int", + "canonical": "int" + }, + { + "name": "result", + "cType": "Pose **", + "canonical": "struct Pose **" + } + ] + }, + { + "name": "poseset_values", + "file": "meos_pose.h", + "returnType": { + "c": "Pose **", + "canonical": "struct Pose **" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "contained_pose_set", + "file": "meos_pose.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "contains_set_pose", + "file": "meos_pose.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "pose", + "cType": "Pose *", + "canonical": "struct Pose *" + } + ] + }, + { + "name": "intersection_pose_set", + "file": "meos_pose.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "intersection_set_pose", + "file": "meos_pose.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + } + ] + }, + { + "name": "minus_pose_set", + "file": "meos_pose.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "minus_set_pose", + "file": "meos_pose.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + } + ] + }, + { + "name": "pose_union_transfn", + "file": "meos_pose.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "state", + "cType": "Set *", + "canonical": "Set *" + }, + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + } + ] + }, + { + "name": "union_pose_set", + "file": "meos_pose.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "union_set_pose", + "file": "meos_pose.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + } + ] + }, + { + "name": "tpose_from_mfjson", + "file": "meos_pose.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "tpose_in", + "file": "meos_pose.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "tposeinst_make", + "file": "meos_pose.h", + "returnType": { + "c": "TInstant *", + "canonical": "TInstant *" + }, + "params": [ + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "tpose_from_base_temp", + "file": "meos_pose.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tposeseq_from_base_tstzset", + "file": "meos_pose.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "tposeseq_from_base_tstzspan", + "file": "meos_pose.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "tposeseqset_from_base_tstzspanset", + "file": "meos_pose.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "tpose_make", + "file": "meos_pose.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "tpoint", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "tradius", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tpose_to_tpoint", + "file": "meos_pose.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tpose_end_value", + "file": "meos_pose.h", + "returnType": { + "c": "Pose *", + "canonical": "struct Pose *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tpose_points", + "file": "meos_pose.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tpose_rotation", + "file": "meos_pose.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tpose_yaw", + "file": "meos_pose.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tpose_pitch", + "file": "meos_pose.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tpose_roll", + "file": "meos_pose.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tpose_speed", + "file": "meos_pose.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tpose_angular_speed", + "file": "meos_pose.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tpose_start_value", + "file": "meos_pose.h", + "returnType": { + "c": "Pose *", + "canonical": "struct Pose *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tpose_trajectory", + "file": "meos_pose.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tpose_value_at_timestamptz", + "file": "meos_pose.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "strict", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "result", + "cType": "Pose **", + "canonical": "struct Pose **" + } + ] + }, + { + "name": "tpose_value_n", + "file": "meos_pose.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "n", + "cType": "int", + "canonical": "int" + }, + { + "name": "result", + "cType": "Pose **", + "canonical": "struct Pose **" + } + ] + }, + { + "name": "tpose_values", + "file": "meos_pose.h", + "returnType": { + "c": "Pose **", + "canonical": "struct Pose **" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tpose_at_geom", + "file": "meos_pose.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "tpose_at_stbox", + "file": "meos_pose.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "border_inc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tpose_at_pose", + "file": "meos_pose.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + } + ] + }, + { + "name": "tpose_minus_geom", + "file": "meos_pose.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "tpose_minus_pose", + "file": "meos_pose.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + } + ] + }, + { + "name": "tpose_minus_stbox", + "file": "meos_pose.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "border_inc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tdistance_tpose_pose", + "file": "meos_pose.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + } + ] + }, + { + "name": "tdistance_tpose_geo", + "file": "meos_pose.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "tdistance_tpose_tpose", + "file": "meos_pose.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "nad_tpose_geo", + "file": "meos_pose.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "nad_tpose_pose", + "file": "meos_pose.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + } + ] + }, + { + "name": "nad_tpose_stbox", + "file": "meos_pose.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + } + ] + }, + { + "name": "nad_tpose_tpose", + "file": "meos_pose.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "nai_tpose_geo", + "file": "meos_pose.h", + "returnType": { + "c": "TInstant *", + "canonical": "TInstant *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "nai_tpose_pose", + "file": "meos_pose.h", + "returnType": { + "c": "TInstant *", + "canonical": "TInstant *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + } + ] + }, + { + "name": "nai_tpose_tpose", + "file": "meos_pose.h", + "returnType": { + "c": "TInstant *", + "canonical": "TInstant *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "shortestline_tpose_geo", + "file": "meos_pose.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "shortestline_tpose_pose", + "file": "meos_pose.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + } + ] + }, + { + "name": "shortestline_tpose_tpose", + "file": "meos_pose.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_eq_pose_tpose", + "file": "meos_pose.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_eq_tpose_pose", + "file": "meos_pose.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + } + ] + }, + { + "name": "always_eq_tpose_tpose", + "file": "meos_pose.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_ne_pose_tpose", + "file": "meos_pose.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_ne_tpose_pose", + "file": "meos_pose.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + } + ] + }, + { + "name": "always_ne_tpose_tpose", + "file": "meos_pose.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_eq_pose_tpose", + "file": "meos_pose.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_eq_tpose_pose", + "file": "meos_pose.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + } + ] + }, + { + "name": "ever_eq_tpose_tpose", + "file": "meos_pose.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_ne_pose_tpose", + "file": "meos_pose.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_ne_tpose_pose", + "file": "meos_pose.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + } + ] + }, + { + "name": "ever_ne_tpose_tpose", + "file": "meos_pose.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "teq_pose_tpose", + "file": "meos_pose.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "teq_tpose_pose", + "file": "meos_pose.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + } + ] + }, + { + "name": "tne_pose_tpose", + "file": "meos_pose.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tne_tpose_pose", + "file": "meos_pose.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + } + ] + }, + { + "name": "quadbin_is_valid_index", + "file": "meos_quadbin.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "index", + "cType": "Quadbin", + "canonical": "unsigned long" + } + ] + }, + { + "name": "quadbin_is_valid_cell", + "file": "meos_quadbin.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "cell", + "cType": "Quadbin", + "canonical": "unsigned long" + } + ] + }, + { + "name": "quadbin_tile_to_cell", + "file": "meos_quadbin.h", + "returnType": { + "c": "Quadbin", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "x", + "cType": "uint32_t", + "canonical": "unsigned int" + }, + { + "name": "y", + "cType": "uint32_t", + "canonical": "unsigned int" + }, + { + "name": "z", + "cType": "uint32_t", + "canonical": "unsigned int" + } + ] + }, + { + "name": "quadbin_cell_to_tile", + "file": "meos_quadbin.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "cell", + "cType": "Quadbin", + "canonical": "unsigned long" + }, + { + "name": "x", + "cType": "uint32_t *", + "canonical": "unsigned int *" + }, + { + "name": "y", + "cType": "uint32_t *", + "canonical": "unsigned int *" + }, + { + "name": "z", + "cType": "uint32_t *", + "canonical": "unsigned int *" + } + ] + }, + { + "name": "quadbin_get_resolution", + "file": "meos_quadbin.h", + "returnType": { + "c": "uint32_t", + "canonical": "unsigned int" + }, + "params": [ + { + "name": "cell", + "cType": "Quadbin", + "canonical": "unsigned long" + } + ] + }, + { + "name": "quadbin_cell_to_parent", + "file": "meos_quadbin.h", + "returnType": { + "c": "Quadbin", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "cell", + "cType": "Quadbin", + "canonical": "unsigned long" + }, + { + "name": "parent_resolution", + "cType": "uint32_t", + "canonical": "unsigned int" + } + ] + }, + { + "name": "quadbin_cell_to_children", + "file": "meos_quadbin.h", + "returnType": { + "c": "Quadbin *", + "canonical": "unsigned long *" + }, + "params": [ + { + "name": "cell", + "cType": "Quadbin", + "canonical": "unsigned long" + }, + { + "name": "children_resolution", + "cType": "uint32_t", + "canonical": "unsigned int" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "quadbin_cell_sibling", + "file": "meos_quadbin.h", + "returnType": { + "c": "Quadbin", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "cell", + "cType": "Quadbin", + "canonical": "unsigned long" + }, + { + "name": "direction", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "quadbin_k_ring", + "file": "meos_quadbin.h", + "returnType": { + "c": "Quadbin *", + "canonical": "unsigned long *" + }, + "params": [ + { + "name": "cell", + "cType": "Quadbin", + "canonical": "unsigned long" + }, + { + "name": "k", + "cType": "int", + "canonical": "int" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "quadbin_point_to_cell", + "file": "meos_quadbin.h", + "returnType": { + "c": "Quadbin", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "longitude", + "cType": "double", + "canonical": "double" + }, + { + "name": "latitude", + "cType": "double", + "canonical": "double" + }, + { + "name": "resolution", + "cType": "uint32_t", + "canonical": "unsigned int" + } + ] + }, + { + "name": "quadbin_cell_to_point", + "file": "meos_quadbin.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "cell", + "cType": "Quadbin", + "canonical": "unsigned long" + }, + { + "name": "longitude", + "cType": "double *", + "canonical": "double *" + }, + { + "name": "latitude", + "cType": "double *", + "canonical": "double *" + } + ] + }, + { + "name": "quadbin_cell_to_bounding_box", + "file": "meos_quadbin.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "cell", + "cType": "Quadbin", + "canonical": "unsigned long" + }, + { + "name": "xmin", + "cType": "double *", + "canonical": "double *" + }, + { + "name": "ymin", + "cType": "double *", + "canonical": "double *" + }, + { + "name": "xmax", + "cType": "double *", + "canonical": "double *" + }, + { + "name": "ymax", + "cType": "double *", + "canonical": "double *" + } + ] + }, + { + "name": "quadbin_cell_area", + "file": "meos_quadbin.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "cell", + "cType": "Quadbin", + "canonical": "unsigned long" + } + ] + }, + { + "name": "quadbin_index_to_string", + "file": "meos_quadbin.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "index", + "cType": "Quadbin", + "canonical": "unsigned long" + } + ] + }, + { + "name": "quadbin_string_to_index", + "file": "meos_quadbin.h", + "returnType": { + "c": "Quadbin", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "quadbin_cell_to_quadkey", + "file": "meos_quadbin.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "cell", + "cType": "Quadbin", + "canonical": "unsigned long" + } + ] + }, + { + "name": "quadbin_parse", + "file": "meos_quadbin.h", + "returnType": { + "c": "Quadbin", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "quadbin_eq", + "file": "meos_quadbin.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "a", + "cType": "Quadbin", + "canonical": "unsigned long" + }, + { + "name": "b", + "cType": "Quadbin", + "canonical": "unsigned long" + } + ] + }, + { + "name": "quadbin_ne", + "file": "meos_quadbin.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "a", + "cType": "Quadbin", + "canonical": "unsigned long" + }, + { + "name": "b", + "cType": "Quadbin", + "canonical": "unsigned long" + } + ] + }, + { + "name": "quadbin_lt", + "file": "meos_quadbin.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "a", + "cType": "Quadbin", + "canonical": "unsigned long" + }, + { + "name": "b", + "cType": "Quadbin", + "canonical": "unsigned long" + } + ] + }, + { + "name": "quadbin_le", + "file": "meos_quadbin.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "a", + "cType": "Quadbin", + "canonical": "unsigned long" + }, + { + "name": "b", + "cType": "Quadbin", + "canonical": "unsigned long" + } + ] + }, + { + "name": "quadbin_gt", + "file": "meos_quadbin.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "a", + "cType": "Quadbin", + "canonical": "unsigned long" + }, + { + "name": "b", + "cType": "Quadbin", + "canonical": "unsigned long" + } + ] + }, + { + "name": "quadbin_ge", + "file": "meos_quadbin.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "a", + "cType": "Quadbin", + "canonical": "unsigned long" + }, + { + "name": "b", + "cType": "Quadbin", + "canonical": "unsigned long" + } + ] + }, + { + "name": "quadbin_cmp", + "file": "meos_quadbin.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "a", + "cType": "Quadbin", + "canonical": "unsigned long" + }, + { + "name": "b", + "cType": "Quadbin", + "canonical": "unsigned long" + } + ] + }, + { + "name": "quadbin_hash", + "file": "meos_quadbin.h", + "returnType": { + "c": "uint32_t", + "canonical": "unsigned int" + }, + "params": [ + { + "name": "cell", + "cType": "Quadbin", + "canonical": "unsigned long" + } + ] + }, + { + "name": "quadbin_grid_disk", + "file": "meos_quadbin.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "origin", + "cType": "Quadbin", + "canonical": "unsigned long" + }, + { + "name": "k", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "quadbin_cell_to_children_set", + "file": "meos_quadbin.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "origin", + "cType": "Quadbin", + "canonical": "unsigned long" + }, + { + "name": "children_resolution", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "tquadbin_in", + "file": "meos_quadbin.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "tquadbininst_in", + "file": "meos_quadbin.h", + "returnType": { + "c": "TInstant *", + "canonical": "TInstant *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "tquadbinseq_in", + "file": "meos_quadbin.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "tquadbinseqset_in", + "file": "meos_quadbin.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "tquadbin_make", + "file": "meos_quadbin.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "value", + "cType": "Quadbin", + "canonical": "unsigned long" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "tquadbininst_make", + "file": "meos_quadbin.h", + "returnType": { + "c": "TInstant *", + "canonical": "TInstant *" + }, + "params": [ + { + "name": "value", + "cType": "Quadbin", + "canonical": "unsigned long" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "tquadbinseq_make", + "file": "meos_quadbin.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "values", + "cType": "const Quadbin *", + "canonical": "const unsigned long *" + }, + { + "name": "times", + "cType": "const TimestampTz *", + "canonical": "const long *" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "lower_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "upper_inc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tquadbinseqset_make", + "file": "meos_quadbin.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "sequences", + "cType": "const TSequence **", + "canonical": "const TSequence **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "tquadbin_start_value", + "file": "meos_quadbin.h", + "returnType": { + "c": "Quadbin", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tquadbin_end_value", + "file": "meos_quadbin.h", + "returnType": { + "c": "Quadbin", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tquadbin_value_n", + "file": "meos_quadbin.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "n", + "cType": "int", + "canonical": "int" + }, + { + "name": "result", + "cType": "Quadbin *", + "canonical": "unsigned long *" + } + ] + }, + { + "name": "tquadbin_values", + "file": "meos_quadbin.h", + "returnType": { + "c": "Quadbin *", + "canonical": "unsigned long *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tquadbin_value_at_timestamptz", + "file": "meos_quadbin.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "strict", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "result", + "cType": "Quadbin *", + "canonical": "unsigned long *" + } + ] + }, + { + "name": "tbigint_to_tquadbin", + "file": "meos_quadbin.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tquadbin_to_tbigint", + "file": "meos_quadbin.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_eq_quadbin_tquadbin", + "file": "meos_quadbin.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "cell", + "cType": "Quadbin", + "canonical": "unsigned long" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_eq_tquadbin_quadbin", + "file": "meos_quadbin.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "cell", + "cType": "Quadbin", + "canonical": "unsigned long" + } + ] + }, + { + "name": "ever_ne_quadbin_tquadbin", + "file": "meos_quadbin.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "cell", + "cType": "Quadbin", + "canonical": "unsigned long" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_ne_tquadbin_quadbin", + "file": "meos_quadbin.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "cell", + "cType": "Quadbin", + "canonical": "unsigned long" + } + ] + }, + { + "name": "always_eq_quadbin_tquadbin", + "file": "meos_quadbin.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "cell", + "cType": "Quadbin", + "canonical": "unsigned long" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_eq_tquadbin_quadbin", + "file": "meos_quadbin.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "cell", + "cType": "Quadbin", + "canonical": "unsigned long" + } + ] + }, + { + "name": "always_ne_quadbin_tquadbin", + "file": "meos_quadbin.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "cell", + "cType": "Quadbin", + "canonical": "unsigned long" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_ne_tquadbin_quadbin", + "file": "meos_quadbin.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "cell", + "cType": "Quadbin", + "canonical": "unsigned long" + } + ] + }, + { + "name": "ever_eq_tquadbin_tquadbin", + "file": "meos_quadbin.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_ne_tquadbin_tquadbin", + "file": "meos_quadbin.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_eq_tquadbin_tquadbin", + "file": "meos_quadbin.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_ne_tquadbin_tquadbin", + "file": "meos_quadbin.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "teq_quadbin_tquadbin", + "file": "meos_quadbin.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "cell", + "cType": "Quadbin", + "canonical": "unsigned long" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "teq_tquadbin_quadbin", + "file": "meos_quadbin.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "cell", + "cType": "Quadbin", + "canonical": "unsigned long" + } + ] + }, + { + "name": "teq_tquadbin_tquadbin", + "file": "meos_quadbin.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tne_quadbin_tquadbin", + "file": "meos_quadbin.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "cell", + "cType": "Quadbin", + "canonical": "unsigned long" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tne_tquadbin_quadbin", + "file": "meos_quadbin.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "cell", + "cType": "Quadbin", + "canonical": "unsigned long" + } + ] + }, + { + "name": "tne_tquadbin_tquadbin", + "file": "meos_quadbin.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tquadbin_cell_to_quadkey", + "file": "meos_quadbin.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "raster_tile_value_quadbin", + "file": "meos_raster.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "pixels", + "cType": "const uint8_t *", + "canonical": "const unsigned char *" + }, + { + "name": "width", + "cType": "uint16_t", + "canonical": "unsigned short" + }, + { + "name": "height", + "cType": "uint16_t", + "canonical": "unsigned short" + }, + { + "name": "quadbin", + "cType": "uint64", + "canonical": "unsigned long" + }, + { + "name": "pixtype", + "cType": "MeosPixType", + "canonical": "MeosPixType" + }, + { + "name": "nodata", + "cType": "double", + "canonical": "double" + }, + { + "name": "has_nodata", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "traj", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "trajectory_quadbins", + "file": "meos_raster.h", + "returnType": { + "c": "uint64 *", + "canonical": "unsigned long *" + }, + "params": [ + { + "name": "traj", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "zoom", + "cType": "uint32_t", + "canonical": "unsigned int" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "trgeometry_out", + "file": "meos_rgeo.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "trgeometryinst_make", + "file": "meos_rgeo.h", + "returnType": { + "c": "TInstant *", + "canonical": "TInstant *" + }, + "params": [ + { + "name": "geom", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "geo_tpose_to_trgeometry", + "file": "meos_rgeo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "trgeometry_to_tpose", + "file": "meos_rgeo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "trgeometry_to_tpoint", + "file": "meos_rgeo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "trgeometry_to_tgeometry", + "file": "meos_rgeo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "trgeometry_end_instant", + "file": "meos_rgeo.h", + "returnType": { + "c": "TInstant *", + "canonical": "TInstant *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "trgeometry_end_sequence", + "file": "meos_rgeo.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "trgeometry_end_value", + "file": "meos_rgeo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "trgeometry_geom", + "file": "meos_rgeo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "trgeometry_instant_n", + "file": "meos_rgeo.h", + "returnType": { + "c": "TInstant *", + "canonical": "TInstant *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "n", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "trgeometry_instants", + "file": "meos_rgeo.h", + "returnType": { + "c": "TInstant **", + "canonical": "TInstant **" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "trgeometry_points", + "file": "meos_rgeo.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "trgeometry_rotation", + "file": "meos_rgeo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "trgeometry_segments", + "file": "meos_rgeo.h", + "returnType": { + "c": "TSequence **", + "canonical": "TSequence **" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "trgeometry_sequence_n", + "file": "meos_rgeo.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "i", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "trgeometry_sequences", + "file": "meos_rgeo.h", + "returnType": { + "c": "TSequence **", + "canonical": "TSequence **" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "trgeometry_start_instant", + "file": "meos_rgeo.h", + "returnType": { + "c": "TInstant *", + "canonical": "TInstant *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "trgeometry_start_sequence", + "file": "meos_rgeo.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "trgeometry_start_value", + "file": "meos_rgeo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "trgeometry_value_n", + "file": "meos_rgeo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "n", + "cType": "int", + "canonical": "int" + }, + { + "name": "result", + "cType": "int **", + "canonical": "int **" + } + ] + }, + { + "name": "trgeometry_traversed_area", + "file": "meos_rgeo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "unary_union", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "trgeometry_centroid", + "file": "meos_rgeo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "trgeometry_convex_hull", + "file": "meos_rgeo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "trgeometry_body_point_trajectory", + "file": "meos_rgeo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "trgeometry_space_boxes", + "file": "meos_rgeo.h", + "returnType": { + "c": "STBox *", + "canonical": "STBox *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "xsize", + "cType": "double", + "canonical": "double" + }, + { + "name": "ysize", + "cType": "double", + "canonical": "double" + }, + { + "name": "zsize", + "cType": "double", + "canonical": "double" + }, + { + "name": "sorigin", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "bitmatrix", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "border_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "trgeometry_space_time_boxes", + "file": "meos_rgeo.h", + "returnType": { + "c": "STBox *", + "canonical": "STBox *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "xsize", + "cType": "double", + "canonical": "double" + }, + { + "name": "ysize", + "cType": "double", + "canonical": "double" + }, + { + "name": "zsize", + "cType": "double", + "canonical": "double" + }, + { + "name": "duration", + "cType": "const Interval *", + "canonical": "const Interval *" + }, + { + "name": "sorigin", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "torigin", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "bitmatrix", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "border_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "trgeometry_stboxes", + "file": "meos_rgeo.h", + "returnType": { + "c": "STBox *", + "canonical": "STBox *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "trgeometry_split_n_stboxes", + "file": "meos_rgeo.h", + "returnType": { + "c": "STBox *", + "canonical": "STBox *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box_count", + "cType": "int", + "canonical": "int" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "trgeometry_split_each_n_stboxes", + "file": "meos_rgeo.h", + "returnType": { + "c": "STBox *", + "canonical": "STBox *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "elem_count", + "cType": "int", + "canonical": "int" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "trgeometry_hausdorff_distance", + "file": "meos_rgeo.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "trgeometry_frechet_distance", + "file": "meos_rgeo.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "trgeometry_dyntimewarp_distance", + "file": "meos_rgeo.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "trgeometry_frechet_path", + "file": "meos_rgeo.h", + "returnType": { + "c": "Match *", + "canonical": "Match *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "trgeometry_dyntimewarp_path", + "file": "meos_rgeo.h", + "returnType": { + "c": "Match *", + "canonical": "Match *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "trgeometry_length", + "file": "meos_rgeo.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "trgeometry_cumulative_length", + "file": "meos_rgeo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "trgeometry_speed", + "file": "meos_rgeo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "trgeometry_twcentroid", + "file": "meos_rgeo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "trgeometry_append_tinstant", + "file": "meos_rgeo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "Temporal *", + "canonical": "Temporal *" + }, + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const TInstant *" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + }, + { + "name": "maxdist", + "cType": "double", + "canonical": "double" + }, + { + "name": "maxt", + "cType": "const Interval *", + "canonical": "const Interval *" + }, + { + "name": "expand", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "trgeometry_append_tsequence", + "file": "meos_rgeo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "Temporal *", + "canonical": "Temporal *" + }, + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "expand", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "trgeometry_delete_timestamptz", + "file": "meos_rgeo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "connect", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "trgeometry_delete_tstzset", + "file": "meos_rgeo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "connect", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "trgeometry_delete_tstzspan", + "file": "meos_rgeo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "connect", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "trgeometry_delete_tstzspanset", + "file": "meos_rgeo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "connect", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "trgeometry_round", + "file": "meos_rgeo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "trgeometry_set_interp", + "file": "meos_rgeo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "trgeometry_to_tinstant", + "file": "meos_rgeo.h", + "returnType": { + "c": "TInstant *", + "canonical": "TInstant *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "trgeometry_after_timestamptz", + "file": "meos_rgeo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "strict", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "trgeometry_before_timestamptz", + "file": "meos_rgeo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "strict", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "trgeometry_restrict_values", + "file": "meos_rgeo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "trgeometry_restrict_timestamptz", + "file": "meos_rgeo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "trgeometry_restrict_tstzset", + "file": "meos_rgeo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "trgeometry_restrict_tstzspan", + "file": "meos_rgeo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "trgeometry_restrict_tstzspanset", + "file": "meos_rgeo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "trgeometry_at_geom", + "file": "meos_rgeo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "trgeometry_minus_geom", + "file": "meos_rgeo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "trgeometry_at_stbox", + "file": "meos_rgeo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "border_inc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "trgeometry_minus_stbox", + "file": "meos_rgeo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "border_inc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tdistance_trgeometry_geo", + "file": "meos_rgeo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "tdistance_trgeometry_tpoint", + "file": "meos_rgeo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tdistance_trgeometry_trgeometry", + "file": "meos_rgeo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "nad_stbox_trgeometry", + "file": "meos_rgeo.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "nad_trgeometry_geo", + "file": "meos_rgeo.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "nad_trgeometry_stbox", + "file": "meos_rgeo.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + } + ] + }, + { + "name": "nad_trgeometry_tpoint", + "file": "meos_rgeo.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "nad_trgeometry_trgeometry", + "file": "meos_rgeo.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "nai_trgeometry_geo", + "file": "meos_rgeo.h", + "returnType": { + "c": "TInstant *", + "canonical": "TInstant *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "nai_trgeometry_tpoint", + "file": "meos_rgeo.h", + "returnType": { + "c": "TInstant *", + "canonical": "TInstant *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "nai_trgeometry_trgeometry", + "file": "meos_rgeo.h", + "returnType": { + "c": "TInstant *", + "canonical": "TInstant *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "shortestline_trgeometry_geo", + "file": "meos_rgeo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "shortestline_trgeometry_tpoint", + "file": "meos_rgeo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "shortestline_trgeometry_trgeometry", + "file": "meos_rgeo.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_eq_geo_trgeometry", + "file": "meos_rgeo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_eq_trgeometry_geo", + "file": "meos_rgeo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "always_eq_trgeometry_trgeometry", + "file": "meos_rgeo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_ne_geo_trgeometry", + "file": "meos_rgeo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "always_ne_trgeometry_geo", + "file": "meos_rgeo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "always_ne_trgeometry_trgeometry", + "file": "meos_rgeo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_eq_geo_trgeometry", + "file": "meos_rgeo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_eq_trgeometry_geo", + "file": "meos_rgeo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "ever_eq_trgeometry_trgeometry", + "file": "meos_rgeo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_ne_geo_trgeometry", + "file": "meos_rgeo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ever_ne_trgeometry_geo", + "file": "meos_rgeo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "ever_ne_trgeometry_trgeometry", + "file": "meos_rgeo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "teq_geo_trgeometry", + "file": "meos_rgeo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "teq_trgeometry_geo", + "file": "meos_rgeo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "tne_geo_trgeometry", + "file": "meos_rgeo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tne_trgeometry_geo", + "file": "meos_rgeo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "econtains_geo_trgeometry", + "file": "meos_rgeo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "acontains_geo_trgeometry", + "file": "meos_rgeo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ecovers_geo_trgeometry", + "file": "meos_rgeo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "acovers_geo_trgeometry", + "file": "meos_rgeo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ecovers_trgeometry_geo", + "file": "meos_rgeo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "acovers_trgeometry_geo", + "file": "meos_rgeo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "edisjoint_trgeometry_geo", + "file": "meos_rgeo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "adisjoint_trgeometry_geo", + "file": "meos_rgeo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "eintersects_trgeometry_geo", + "file": "meos_rgeo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "aintersects_trgeometry_geo", + "file": "meos_rgeo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "etouches_trgeometry_geo", + "file": "meos_rgeo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "atouches_trgeometry_geo", + "file": "meos_rgeo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "edwithin_trgeometry_geo", + "file": "meos_rgeo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "dist", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "adwithin_trgeometry_geo", + "file": "meos_rgeo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "dist", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "edisjoint_trgeometry_trgeometry", + "file": "meos_rgeo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "adisjoint_trgeometry_trgeometry", + "file": "meos_rgeo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "eintersects_trgeometry_trgeometry", + "file": "meos_rgeo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "aintersects_trgeometry_trgeometry", + "file": "meos_rgeo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "edwithin_trgeometry_trgeometry", + "file": "meos_rgeo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "dist", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "adwithin_trgeometry_trgeometry", + "file": "meos_rgeo.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "dist", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "ensure_valid_tnpoint_npoint", + "file": "tnpoint.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + } + ] + }, + { + "name": "ensure_valid_tnpoint_npointset", + "file": "tnpoint.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "ensure_valid_tnpoint_geo", + "file": "tnpoint.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "ensure_valid_tnpoint_stbox", + "file": "tnpoint.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + } + ] + }, + { + "name": "ensure_valid_tnpoint_tnpoint", + "file": "tnpoint.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tnpointsegm_intersection", + "file": "tnpoint.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "start1", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "end1", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "start2", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "end2", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "lower", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "upper", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "t1", + "cType": "TimestampTz *", + "canonical": "long *" + }, + { + "name": "t2", + "cType": "TimestampTz *", + "canonical": "long *" + } + ] + }, + { + "name": "common_rid_tnpoint_npoint", + "file": "tnpoint.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + } + ] + }, + { + "name": "common_rid_tnpoint_npointset", + "file": "tnpoint.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "common_rid_tnpoint_tnpoint", + "file": "tnpoint.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "npoint_collinear", + "file": "tnpoint.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "np1", + "cType": "const Npoint *", + "canonical": "const Npoint *" + }, + { + "name": "np2", + "cType": "const Npoint *", + "canonical": "const Npoint *" + }, + { + "name": "np3", + "cType": "const Npoint *", + "canonical": "const Npoint *" + }, + { + "name": "ratio", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "npointsegm_interpolate", + "file": "tnpoint.h", + "returnType": { + "c": "Npoint *", + "canonical": "Npoint *" + }, + "params": [ + { + "name": "start", + "cType": "const Npoint *", + "canonical": "const Npoint *" + }, + { + "name": "end", + "cType": "const Npoint *", + "canonical": "const Npoint *" + }, + { + "name": "ratio", + "cType": "long double", + "canonical": "long double" + } + ] + }, + { + "name": "npointsegm_locate", + "file": "tnpoint.h", + "returnType": { + "c": "long double", + "canonical": "long double" + }, + "params": [ + { + "name": "start", + "cType": "const Npoint *", + "canonical": "const Npoint *" + }, + { + "name": "end", + "cType": "const Npoint *", + "canonical": "const Npoint *" + }, + { + "name": "value", + "cType": "const Npoint *", + "canonical": "const Npoint *" + } + ] + }, + { + "name": "npointarr_geom", + "file": "tnpoint.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "points", + "cType": "Npoint **", + "canonical": "Npoint **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "nsegmentarr_geom", + "file": "tnpoint.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "segments", + "cType": "Nsegment **", + "canonical": "Nsegment **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "nsegmentarr_normalize", + "file": "tnpoint.h", + "returnType": { + "c": "Nsegment **", + "canonical": "Nsegment **" + }, + "params": [ + { + "name": "segments", + "cType": "Nsegment **", + "canonical": "Nsegment **" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "npoint_wkt_out", + "file": "tnpoint.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "npoint_set", + "file": "tnpoint.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "rid", + "cType": "int64", + "canonical": "long" + }, + { + "name": "pos", + "cType": "double", + "canonical": "double" + }, + { + "name": "np", + "cType": "Npoint *", + "canonical": "Npoint *" + } + ] + }, + { + "name": "nsegment_set", + "file": "tnpoint.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "rid", + "cType": "int64", + "canonical": "long" + }, + { + "name": "pos1", + "cType": "double", + "canonical": "double" + }, + { + "name": "pos2", + "cType": "double", + "canonical": "double" + }, + { + "name": "ns", + "cType": "Nsegment *", + "canonical": "Nsegment *" + } + ] + }, + { + "name": "datum_npoint_round", + "file": "tnpoint.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "npoint", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "size", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "tnpointinst_tgeompointinst", + "file": "tnpoint.h", + "returnType": { + "c": "TInstant *", + "canonical": "TInstant *" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const TInstant *" + } + ] + }, + { + "name": "tnpointseq_tgeompointseq_disc", + "file": "tnpoint.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "is", + "cType": "const TSequence *", + "canonical": "const TSequence *" + } + ] + }, + { + "name": "tnpointseq_tgeompointseq_cont", + "file": "tnpoint.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + } + ] + }, + { + "name": "tnpointseqset_tgeompointseqset", + "file": "tnpoint.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const TSequenceSet *" + } + ] + }, + { + "name": "tgeompointinst_tnpointinst", + "file": "tnpoint.h", + "returnType": { + "c": "TInstant *", + "canonical": "TInstant *" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const TInstant *" + } + ] + }, + { + "name": "tgeompointseq_tnpointseq", + "file": "tnpoint.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + } + ] + }, + { + "name": "tgeompointseqset_tnpointseqset", + "file": "tnpoint.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const TSequenceSet *" + } + ] + }, + { + "name": "tnpointinst_positions", + "file": "tnpoint.h", + "returnType": { + "c": "Nsegment **", + "canonical": "Nsegment **" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const TInstant *" + } + ] + }, + { + "name": "tnpointseq_positions", + "file": "tnpoint.h", + "returnType": { + "c": "Nsegment **", + "canonical": "Nsegment **" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tnpointseqset_positions", + "file": "tnpoint.h", + "returnType": { + "c": "Nsegment **", + "canonical": "Nsegment **" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const TSequenceSet *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tnpointinst_route", + "file": "tnpoint.h", + "returnType": { + "c": "int64", + "canonical": "long" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const TInstant *" + } + ] + }, + { + "name": "tnpointinst_routes", + "file": "tnpoint.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const TInstant *" + } + ] + }, + { + "name": "tnpointseq_disc_routes", + "file": "tnpoint.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "is", + "cType": "const TSequence *", + "canonical": "const TSequence *" + } + ] + }, + { + "name": "tnpointseq_cont_routes", + "file": "tnpoint.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + } + ] + }, + { + "name": "tnpointseqset_routes", + "file": "tnpoint.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const TSequenceSet *" + } + ] + }, + { + "name": "tnpointseq_linear_positions", + "file": "tnpoint.h", + "returnType": { + "c": "Nsegment *", + "canonical": "Nsegment *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + } + ] + }, + { + "name": "tnpoint_restrict_stbox", + "file": "tnpoint.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "border_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tnpoint_restrict_npoint", + "file": "tnpoint.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tnpoint_restrict_npointset", + "file": "tnpoint.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "npoint_set_stbox", + "file": "tnpoint_boxops.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + }, + { + "name": "box", + "cType": "STBox *", + "canonical": "STBox *" + } + ] + }, + { + "name": "npointarr_set_stbox", + "file": "tnpoint_boxops.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "values", + "cType": "const Datum *", + "canonical": "const unsigned long *" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "box", + "cType": "STBox *", + "canonical": "STBox *" + } + ] + }, + { + "name": "nsegment_set_stbox", + "file": "tnpoint_boxops.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ns", + "cType": "const Nsegment *", + "canonical": "const Nsegment *" + }, + { + "name": "box", + "cType": "STBox *", + "canonical": "STBox *" + } + ] + }, + { + "name": "npoint_timestamptz_set_stbox", + "file": "tnpoint_boxops.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "box", + "cType": "STBox *", + "canonical": "STBox *" + } + ] + }, + { + "name": "npoint_tstzspan_set_stbox", + "file": "tnpoint_boxops.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "box", + "cType": "STBox *", + "canonical": "STBox *" + } + ] + }, + { + "name": "tnpointinst_set_stbox", + "file": "tnpoint_boxops.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const TInstant *" + }, + { + "name": "box", + "cType": "STBox *", + "canonical": "STBox *" + } + ] + }, + { + "name": "tnpointinstarr_set_stbox", + "file": "tnpoint_boxops.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "inst", + "cType": "TInstant **", + "canonical": "TInstant **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + }, + { + "name": "box", + "cType": "STBox *", + "canonical": "STBox *" + } + ] + }, + { + "name": "tnpointseq_expand_stbox", + "file": "tnpoint_boxops.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const TInstant *" + } + ] + }, + { + "name": "datum_npoint_distance", + "file": "tnpoint_distance.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "np1", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "np2", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "npoint_parse", + "file": "tnpoint_parser.h", + "returnType": { + "c": "Npoint *", + "canonical": "Npoint *" + }, + "params": [ + { + "name": "str", + "cType": "const char **", + "canonical": "const char **" + }, + { + "name": "end", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "nsegment_parse", + "file": "tnpoint_parser.h", + "returnType": { + "c": "Nsegment *", + "canonical": "Nsegment *" + }, + "params": [ + { + "name": "str", + "cType": "const char **", + "canonical": "const char **" + } + ] + }, + { + "name": "contains_rid_tnpoint_bigint", + "file": "tnpoint_routeops.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "rid", + "cType": "int64", + "canonical": "long" + }, + { + "name": "invert", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "contained_rid_tnpoint_bigint", + "file": "tnpoint_routeops.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "rid", + "cType": "int64", + "canonical": "long" + }, + { + "name": "invert", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "same_rid_tnpoint_bigint", + "file": "tnpoint_routeops.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "rid", + "cType": "int64", + "canonical": "long" + }, + { + "name": "invert", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "overlaps_rid_tnpoint_bigintset", + "file": "tnpoint_routeops.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "invert", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "contains_rid_tnpoint_bigintset", + "file": "tnpoint_routeops.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "invert", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "contained_rid_tnpoint_bigintset", + "file": "tnpoint_routeops.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "invert", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "same_rid_tnpoint_bigintset", + "file": "tnpoint_routeops.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "invert", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "contains_rid_tnpoint_npoint", + "file": "tnpoint_routeops.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + }, + { + "name": "invert", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "contained_rid_npoint_tnpoint", + "file": "tnpoint_routeops.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + }, + { + "name": "invert", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "same_rid_tnpoint_npoint", + "file": "tnpoint_routeops.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "np", + "cType": "const Npoint *", + "canonical": "const Npoint *" + }, + { + "name": "invert", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "overlaps_rid_tnpoint_tnpoint", + "file": "tnpoint_routeops.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "contains_rid_tnpoint_tnpoint", + "file": "tnpoint_routeops.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "contained_rid_tnpoint_tnpoint", + "file": "tnpoint_routeops.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "same_rid_tnpoint_tnpoint", + "file": "tnpoint_routeops.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ensure_same_rid_tnpointinst", + "file": "tnpoint_spatialfuncs.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "inst1", + "cType": "const TInstant *", + "canonical": "const TInstant *" + }, + { + "name": "inst2", + "cType": "const TInstant *", + "canonical": "const TInstant *" + } + ] + }, + { + "name": "tnpoint_restrict_geom", + "file": "tnpoint_spatialfuncs.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "meos_pc_schema_get_srid", + "file": "meos_schema_hook.h", + "returnType": { + "c": "int32_t", + "canonical": "int" + }, + "params": [ + { + "name": "pcid", + "cType": "uint32_t", + "canonical": "unsigned int" + } + ] + }, + { + "name": "ensure_same_pcid_pcpatch", + "file": "pcpatch.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "pa1", + "cType": "const Pcpatch *", + "canonical": "const struct Pcpatch *" + }, + { + "name": "pa2", + "cType": "const Pcpatch *", + "canonical": "const struct Pcpatch *" + } + ] + }, + { + "name": "ensure_valid_pcpatchset_pcpatch", + "file": "pcpatch.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "pa", + "cType": "const Pcpatch *", + "canonical": "const struct Pcpatch *" + } + ] + }, + { + "name": "pcpatch_parse", + "file": "pcpatch.h", + "returnType": { + "c": "Pcpatch *", + "canonical": "struct Pcpatch *" + }, + "params": [ + { + "name": "str", + "cType": "const char **", + "canonical": "const char **" + }, + { + "name": "end", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "pcpatch_filter_per_point", + "file": "pcpatch_decompose.h", + "returnType": { + "c": "Pcpatch *", + "canonical": "struct Pcpatch *" + }, + "params": [ + { + "name": "pa", + "cType": "const Pcpatch *", + "canonical": "const struct Pcpatch *" + }, + { + "name": "pred", + "cType": "pcpatch_pointpred_fn", + "canonical": "_Bool (*)(const int *, void *)" + }, + { + "name": "extra", + "cType": "void *", + "canonical": "void *" + }, + { + "name": "keep_when_true", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "pcpatch_any_point_matches", + "file": "pcpatch_decompose.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "pa", + "cType": "const Pcpatch *", + "canonical": "const struct Pcpatch *" + }, + { + "name": "pred", + "cType": "pcpatch_pointpred_fn", + "canonical": "_Bool (*)(const int *, void *)" + }, + { + "name": "extra", + "cType": "void *", + "canonical": "void *" + } + ] + }, + { + "name": "pcpoint_in_tpcbox", + "file": "pcpatch_decompose.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "pt", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "extra", + "cType": "void *", + "canonical": "void *" + } + ] + }, + { + "name": "pcpoint_intersects_geometry", + "file": "pcpatch_decompose.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "pt", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "extra", + "cType": "void *", + "canonical": "void *" + } + ] + }, + { + "name": "ensure_same_pcid_pcpoint", + "file": "pcpoint.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "pt1", + "cType": "const Pcpoint *", + "canonical": "const struct Pcpoint *" + }, + { + "name": "pt2", + "cType": "const Pcpoint *", + "canonical": "const struct Pcpoint *" + } + ] + }, + { + "name": "ensure_valid_pcpointset_pcpoint", + "file": "pcpoint.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "pt", + "cType": "const Pcpoint *", + "canonical": "const struct Pcpoint *" + } + ] + }, + { + "name": "pcpoint_parse", + "file": "pcpoint.h", + "returnType": { + "c": "Pcpoint *", + "canonical": "struct Pcpoint *" + }, + "params": [ + { + "name": "str", + "cType": "const char **", + "canonical": "const char **" + }, + { + "name": "end", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "meos_pc_point_serialize", + "file": "pgsql_compat.h", + "returnType": { + "c": "SERIALIZED_POINT *", + "canonical": "SERIALIZED_POINT *" + }, + "params": [ + { + "name": "pcpt", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "meos_pc_point_deserialize", + "file": "pgsql_compat.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "serpt", + "cType": "const SERIALIZED_POINT *", + "canonical": "const SERIALIZED_POINT *" + }, + { + "name": "schema", + "cType": "const PCSCHEMA *", + "canonical": "const struct PCSCHEMA *" + } + ] + }, + { + "name": "meos_pc_patch_serialized_size", + "file": "pgsql_compat.h", + "returnType": { + "c": "size_t", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "patch", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "meos_pc_patch_serialize", + "file": "pgsql_compat.h", + "returnType": { + "c": "SERIALIZED_PATCH *", + "canonical": "struct SERIALIZED_PATCH *" + }, + "params": [ + { + "name": "patch_in", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "userdata", + "cType": "void *", + "canonical": "void *" + } + ] + }, + { + "name": "meos_pc_patch_serialize_to_uncompressed", + "file": "pgsql_compat.h", + "returnType": { + "c": "SERIALIZED_PATCH *", + "canonical": "struct SERIALIZED_PATCH *" + }, + "params": [ + { + "name": "patch_in", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "meos_pc_patch_deserialize", + "file": "pgsql_compat.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "serpatch", + "cType": "const SERIALIZED_PATCH *", + "canonical": "const struct SERIALIZED_PATCH *" + }, + { + "name": "schema", + "cType": "const PCSCHEMA *", + "canonical": "const struct PCSCHEMA *" + } + ] + }, + { + "name": "tpointcloudinst_set_tpcbox", + "file": "tpc_boxops.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const TInstant *" + }, + { + "name": "box", + "cType": "TPCBox *", + "canonical": "TPCBox *" + } + ] + }, + { + "name": "tpointcloudinstarr_set_tpcbox", + "file": "tpc_boxops.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "instants", + "cType": "TInstant **", + "canonical": "TInstant **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "lower_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "upper_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + }, + { + "name": "box", + "cType": "TPCBox *", + "canonical": "TPCBox *" + } + ] + }, + { + "name": "tpointcloudseq_expand_tpcbox", + "file": "tpc_boxops.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "seq", + "cType": "TSequence *", + "canonical": "TSequence *" + }, + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const TInstant *" + } + ] + }, + { + "name": "tpointcloudseqarr_set_tpcbox", + "file": "tpc_boxops.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "sequences", + "cType": "TSequence **", + "canonical": "TSequence **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "box", + "cType": "TPCBox *", + "canonical": "TPCBox *" + } + ] + }, + { + "name": "tpcbox_extent_transfn", + "file": "tpc_boxops.h", + "returnType": { + "c": "TPCBox *", + "canonical": "TPCBox *" + }, + "params": [ + { + "name": "state", + "cType": "TPCBox *", + "canonical": "TPCBox *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "boxop_tpointcloud_tpcbox", + "file": "tpc_boxops.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const TPCBox *", + "canonical": "const TPCBox *" + }, + { + "name": "func", + "cType": "bool (*)(const TPCBox *, const TPCBox *)", + "canonical": "_Bool (*)(const TPCBox *, const TPCBox *)" + }, + { + "name": "inverted", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "boxop_tpointcloud_tpointcloud", + "file": "tpc_boxops.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "func", + "cType": "bool (*)(const TPCBox *, const TPCBox *)", + "canonical": "_Bool (*)(const TPCBox *, const TPCBox *)" + } + ] + }, + { + "name": "tpcbox_set_stbox", + "file": "tpc_boxops.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "src", + "cType": "const TPCBox *", + "canonical": "const TPCBox *" + }, + { + "name": "dst", + "cType": "STBox *", + "canonical": "STBox *" + } + ] + }, + { + "name": "nad_tpcbox_tpcbox", + "file": "tpc_boxops.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "box1", + "cType": "const TPCBox *", + "canonical": "const TPCBox *" + }, + { + "name": "box2", + "cType": "const TPCBox *", + "canonical": "const TPCBox *" + } + ] + }, + { + "name": "nad_tpointcloud_tpcbox", + "file": "tpc_boxops.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const TPCBox *", + "canonical": "const TPCBox *" + } + ] + }, + { + "name": "nad_tpointcloud_tpointcloud", + "file": "tpc_boxops.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tpcbox_index_leaf_consistent", + "file": "tpcbox_index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "key", + "cType": "const TPCBox *", + "canonical": "const TPCBox *" + }, + { + "name": "query", + "cType": "const TPCBox *", + "canonical": "const TPCBox *" + }, + { + "name": "strategy", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "tpcbox_gist_inner_consistent", + "file": "tpcbox_index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "key", + "cType": "const TPCBox *", + "canonical": "const TPCBox *" + }, + { + "name": "query", + "cType": "const TPCBox *", + "canonical": "const TPCBox *" + }, + { + "name": "strategy", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "tpcbox_index_recheck", + "file": "tpcbox_index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "strategy", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "ensure_valid_pose_geo", + "file": "pose.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "ensure_valid_pose_stbox", + "file": "pose.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + } + ] + }, + { + "name": "ensure_valid_pose_pose", + "file": "pose.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "pose1", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "pose2", + "cType": "const Pose *", + "canonical": "const struct Pose *" + } + ] + }, + { + "name": "ensure_valid_poseset_pose", + "file": "pose.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + } + ] + }, + { + "name": "pose_collinear", + "file": "pose.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "pose1", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "pose2", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "pose3", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "ratio", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "posesegm_interpolate", + "file": "pose.h", + "returnType": { + "c": "Pose *", + "canonical": "struct Pose *" + }, + "params": [ + { + "name": "start", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "end", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "ratio", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "posesegm_locate", + "file": "pose.h", + "returnType": { + "c": "long double", + "canonical": "long double" + }, + "params": [ + { + "name": "start", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "end", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "value", + "cType": "const Pose *", + "canonical": "const struct Pose *" + } + ] + }, + { + "name": "pose_wkt_out", + "file": "pose.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "extended", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "pose_parse", + "file": "pose.h", + "returnType": { + "c": "Pose *", + "canonical": "struct Pose *" + }, + "params": [ + { + "name": "str", + "cType": "const char **", + "canonical": "const char **" + }, + { + "name": "end", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "datum_pose_point", + "file": "pose.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "pose", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_pose_geopoint", + "file": "pose.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "pose", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_pose_rotation", + "file": "pose.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "pose", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_pose_yaw", + "file": "pose.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "pose", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_pose_pitch", + "file": "pose.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "pose", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_pose_roll", + "file": "pose.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "pose", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_pose_apply_geo", + "file": "pose.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "pose", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "body", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_pose_round", + "file": "pose.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "pose", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "size", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "pose_distance", + "file": "pose.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "pose1", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "pose2", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "pose_set_stbox", + "file": "pose.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "box", + "cType": "STBox *", + "canonical": "STBox *" + } + ] + }, + { + "name": "posearr_set_stbox", + "file": "pose.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "values", + "cType": "const Datum *", + "canonical": "const unsigned long *" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "box", + "cType": "STBox *", + "canonical": "STBox *" + } + ] + }, + { + "name": "pose_timestamptz_set_stbox", + "file": "pose.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "box", + "cType": "STBox *", + "canonical": "STBox *" + } + ] + }, + { + "name": "pose_tstzspan_set_stbox", + "file": "pose.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "p", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "box", + "cType": "STBox *", + "canonical": "STBox *" + } + ] + }, + { + "name": "ensure_valid_tpose_geo", + "file": "tpose.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + } + ] + }, + { + "name": "ensure_valid_tpose_pose", + "file": "tpose.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + } + ] + }, + { + "name": "ensure_valid_tpose_stbox", + "file": "tpose.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + } + ] + }, + { + "name": "ensure_valid_tpose_tpose", + "file": "tpose.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tposesegm_intersection_value", + "file": "tpose.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "start", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "end", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "lower", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "upper", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "t1", + "cType": "TimestampTz *", + "canonical": "long *" + }, + { + "name": "t2", + "cType": "TimestampTz *", + "canonical": "long *" + } + ] + }, + { + "name": "tposesegm_intersection", + "file": "tpose.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "start1", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "end1", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "start2", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "end2", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "lower", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "upper", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "t1", + "cType": "TimestampTz *", + "canonical": "long *" + }, + { + "name": "t2", + "cType": "TimestampTz *", + "canonical": "long *" + } + ] + }, + { + "name": "tposeinst_set_stbox", + "file": "tpose_boxops.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const TInstant *" + }, + { + "name": "box", + "cType": "STBox *", + "canonical": "STBox *" + } + ] + }, + { + "name": "tposeinstarr_set_stbox", + "file": "tpose_boxops.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "instants", + "cType": "TInstant **", + "canonical": "TInstant **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "box", + "cType": "STBox *", + "canonical": "STBox *" + } + ] + }, + { + "name": "tposeseq_expand_stbox", + "file": "tpose_boxops.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "seq", + "cType": "TSequence *", + "canonical": "TSequence *" + }, + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const TInstant *" + } + ] + }, + { + "name": "tpose_restrict_geom", + "file": "tpose_spatialfuncs.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const int *", + "canonical": "const int *" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tpose_restrict_stbox", + "file": "tpose_spatialfuncs.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "border_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tpose_restrict_elevation", + "file": "tpose_spatialfuncs.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "geo_get_srid", + "file": "postgis_ext_defs.in.h", + "returnType": { + "c": "int32", + "canonical": "int" + }, + "params": [ + { + "name": "g", + "cType": "const GSERIALIZED *", + "canonical": "const GSERIALIZED *" + } + ] + }, + { + "name": "ensure_valid_tquadbin_tquadbin", + "file": "tquadbin.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ensure_valid_tquadbin_quadbin", + "file": "tquadbin.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "cell", + "cType": "Quadbin", + "canonical": "unsigned long" + } + ] + }, + { + "name": "ensure_valid_tquadbin_tgeompoint", + "file": "tquadbin.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "datum2_quadbin_eq", + "file": "tquadbin.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "d1", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "d2", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "datum2_quadbin_ne", + "file": "tquadbin.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "d1", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "d2", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "quadbin_set_stbox", + "file": "tquadbin_boxops.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "cell", + "cType": "Quadbin", + "canonical": "unsigned long" + }, + { + "name": "box", + "cType": "STBox *", + "canonical": "STBox *" + } + ] + }, + { + "name": "quadbinarr_set_stbox", + "file": "tquadbin_boxops.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "values", + "cType": "const Datum *", + "canonical": "const unsigned long *" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "box", + "cType": "STBox *", + "canonical": "STBox *" + } + ] + }, + { + "name": "tquadbininst_set_stbox", + "file": "tquadbin_boxops.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const TInstant *" + }, + { + "name": "box", + "cType": "STBox *", + "canonical": "STBox *" + } + ] + }, + { + "name": "tquadbininstarr_set_stbox", + "file": "tquadbin_boxops.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "instants", + "cType": "TInstant **", + "canonical": "TInstant **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "box", + "cType": "STBox *", + "canonical": "STBox *" + } + ] + }, + { + "name": "tquadbinseq_expand_stbox", + "file": "tquadbin_boxops.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const TInstant *" + } + ] + }, + { + "name": "ensure_has_geom", + "file": "trgeo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "flags", + "cType": "int16", + "canonical": "short" + } + ] + }, + { + "name": "ensure_valid_trgeo_geo", + "file": "trgeo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const GSERIALIZED *", + "canonical": "const GSERIALIZED *" + } + ] + }, + { + "name": "ensure_valid_trgeo_stbox", + "file": "trgeo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + } + ] + }, + { + "name": "ensure_valid_trgeo_trgeo", + "file": "trgeo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "ensure_valid_trgeo_tpoint", + "file": "trgeo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "trgeo_geom_p", + "file": "trgeo.h", + "returnType": { + "c": "const GSERIALIZED *", + "canonical": "const GSERIALIZED *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "trgeo_wkt_out", + "file": "trgeo.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + }, + { + "name": "extended", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "geo_tposeinst_to_trgeo", + "file": "trgeo.h", + "returnType": { + "c": "TInstant *", + "canonical": "TInstant *" + }, + "params": [ + { + "name": "gs", + "cType": "const GSERIALIZED *", + "canonical": "const GSERIALIZED *" + }, + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const TInstant *" + } + ] + }, + { + "name": "geo_tposeseq_to_trgeo", + "file": "trgeo.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "gs", + "cType": "const GSERIALIZED *", + "canonical": "const GSERIALIZED *" + }, + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + } + ] + }, + { + "name": "geo_tposeseqset_to_trgeo", + "file": "trgeo.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "gs", + "cType": "const GSERIALIZED *", + "canonical": "const GSERIALIZED *" + }, + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const TSequenceSet *" + } + ] + }, + { + "name": "trgeo_value_at_timestamptz", + "file": "trgeo.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "strict", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "result", + "cType": "Datum *", + "canonical": "unsigned long *" + } + ] + }, + { + "name": "trgeometry_restrict_value", + "file": "trgeo.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "trgeoinst_geom_p", + "file": "trgeo_inst.h", + "returnType": { + "c": "const GSERIALIZED *", + "canonical": "const GSERIALIZED *" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const TInstant *" + } + ] + }, + { + "name": "trgeoinst_pose_varsize", + "file": "trgeo_inst.h", + "returnType": { + "c": "size_t", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const TInstant *" + } + ] + }, + { + "name": "trgeoinst_set_pose", + "file": "trgeo_inst.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "inst", + "cType": "TInstant *", + "canonical": "TInstant *" + } + ] + }, + { + "name": "trgeoinst_tposeinst", + "file": "trgeo_inst.h", + "returnType": { + "c": "TInstant *", + "canonical": "TInstant *" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const TInstant *" + } + ] + }, + { + "name": "trgeoinst_make1", + "file": "trgeo_inst.h", + "returnType": { + "c": "TInstant *", + "canonical": "TInstant *" + }, + "params": [ + { + "name": "geom", + "cType": "const GSERIALIZED *", + "canonical": "const GSERIALIZED *" + }, + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "trgeoseq_to_tinstant", + "file": "trgeo_inst.h", + "returnType": { + "c": "TInstant *", + "canonical": "TInstant *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + } + ] + }, + { + "name": "trgeoseqset_to_tinstant", + "file": "trgeo_inst.h", + "returnType": { + "c": "TInstant *", + "canonical": "TInstant *" + }, + "params": [ + { + "name": "ts", + "cType": "const TSequenceSet *", + "canonical": "const TSequenceSet *" + } + ] + }, + { + "name": "trgeo_restrict_geom", + "file": "trgeo_spatialfuncs.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const GSERIALIZED *", + "canonical": "const GSERIALIZED *" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "trgeo_restrict_stbox", + "file": "trgeo_spatialfuncs.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const STBox *", + "canonical": "const STBox *" + }, + { + "name": "border_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "spatialrel_trgeo_trav_geo", + "file": "trgeo_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const GSERIALIZED *", + "canonical": "const GSERIALIZED *" + }, + { + "name": "param", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "func", + "cType": "varfunc", + "canonical": "unsigned long (*)(unsigned long, ...)" + }, + { + "name": "numparam", + "cType": "int", + "canonical": "int" + }, + { + "name": "invert", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_contains_geo_trgeo", + "file": "trgeo_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "gs", + "cType": "const GSERIALIZED *", + "canonical": "const GSERIALIZED *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_contains_trgeo_geo", + "file": "trgeo_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const GSERIALIZED *", + "canonical": "const GSERIALIZED *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_contains_trgeo_trgeo", + "file": "trgeo_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_covers_geo_trgeo", + "file": "trgeo_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "gs", + "cType": "const GSERIALIZED *", + "canonical": "const GSERIALIZED *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_covers_trgeo_geo", + "file": "trgeo_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const GSERIALIZED *", + "canonical": "const GSERIALIZED *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_covers_trgeo_trgeo", + "file": "trgeo_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_disjoint_geo_trgeo", + "file": "trgeo_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "gs", + "cType": "const GSERIALIZED *", + "canonical": "const GSERIALIZED *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_disjoint_trgeo_geo", + "file": "trgeo_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const GSERIALIZED *", + "canonical": "const GSERIALIZED *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_disjoint_trgeo_trgeo", + "file": "trgeo_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_intersects_geo_trgeo", + "file": "trgeo_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "gs", + "cType": "const GSERIALIZED *", + "canonical": "const GSERIALIZED *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_intersects_trgeo_geo", + "file": "trgeo_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const GSERIALIZED *", + "canonical": "const GSERIALIZED *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_intersects_trgeo_trgeo", + "file": "trgeo_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_touches_geo_trgeo", + "file": "trgeo_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "gs", + "cType": "const GSERIALIZED *", + "canonical": "const GSERIALIZED *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_touches_trgeo_geo", + "file": "trgeo_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const GSERIALIZED *", + "canonical": "const GSERIALIZED *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_touches_trgeo_trgeo", + "file": "trgeo_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_dwithin_trgeo_geo", + "file": "trgeo_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "gs", + "cType": "const GSERIALIZED *", + "canonical": "const GSERIALIZED *" + }, + { + "name": "dist", + "cType": "double", + "canonical": "double" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "ea_dwithin_trgeo_trgeo", + "file": "trgeo_spatialrels.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "dist", + "cType": "double", + "canonical": "double" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "trgeoseq_geom_p", + "file": "trgeo_seq.h", + "returnType": { + "c": "const GSERIALIZED *", + "canonical": "const GSERIALIZED *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + } + ] + }, + { + "name": "trgeoseq_pose_varsize", + "file": "trgeo_seq.h", + "returnType": { + "c": "size_t", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + } + ] + }, + { + "name": "trgeoseq_set_pose", + "file": "trgeo_seq.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "seq", + "cType": "TSequence *", + "canonical": "TSequence *" + } + ] + }, + { + "name": "trgeoseq_tposeseq", + "file": "trgeo_seq.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + } + ] + }, + { + "name": "trgeoseq_make_valid", + "file": "trgeo_seq.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "geom", + "cType": "const GSERIALIZED *", + "canonical": "const GSERIALIZED *" + }, + { + "name": "instants", + "cType": "TInstant **", + "canonical": "TInstant **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "lower_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "upper_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "linear", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "trgeoseq_make1_exp", + "file": "trgeo_seq.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "geom", + "cType": "const GSERIALIZED *", + "canonical": "const GSERIALIZED *" + }, + { + "name": "instants", + "cType": "TInstant **", + "canonical": "TInstant **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "maxcount", + "cType": "int", + "canonical": "int" + }, + { + "name": "lower_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "upper_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + }, + { + "name": "normalize", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "trgeoseq_make1", + "file": "trgeo_seq.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "geom", + "cType": "const GSERIALIZED *", + "canonical": "const GSERIALIZED *" + }, + { + "name": "instants", + "cType": "TInstant **", + "canonical": "TInstant **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "lower_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "upper_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + }, + { + "name": "normalize", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "trgeoseq_make_exp", + "file": "trgeo_seq.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "geom", + "cType": "const GSERIALIZED *", + "canonical": "const GSERIALIZED *" + }, + { + "name": "instants", + "cType": "TInstant **", + "canonical": "TInstant **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "maxcount", + "cType": "int", + "canonical": "int" + }, + { + "name": "lower_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "upper_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + }, + { + "name": "normalize", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "trgeoseq_make", + "file": "trgeo_seq.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "geom", + "cType": "const GSERIALIZED *", + "canonical": "const GSERIALIZED *" + }, + { + "name": "instants", + "cType": "TInstant **", + "canonical": "TInstant **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "lower_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "upper_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + }, + { + "name": "normalize", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "trgeoseq_make_free_exp", + "file": "trgeo_seq.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "geom", + "cType": "const GSERIALIZED *", + "canonical": "const GSERIALIZED *" + }, + { + "name": "instants", + "cType": "TInstant **", + "canonical": "TInstant **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "maxcount", + "cType": "int", + "canonical": "int" + }, + { + "name": "lower_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "upper_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + }, + { + "name": "normalize", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "trgeoseq_make_free", + "file": "trgeo_seq.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "geom", + "cType": "const GSERIALIZED *", + "canonical": "const GSERIALIZED *" + }, + { + "name": "instants", + "cType": "TInstant **", + "canonical": "TInstant **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "lower_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "upper_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + }, + { + "name": "normalize", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "trgeoinst_to_tsequence", + "file": "trgeo_seq.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const TInstant *" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "trgeoseqset_geom_p", + "file": "trgeo_seqset.h", + "returnType": { + "c": "const GSERIALIZED *", + "canonical": "const GSERIALIZED *" + }, + "params": [ + { + "name": "ts", + "cType": "const TSequenceSet *", + "canonical": "const TSequenceSet *" + } + ] + }, + { + "name": "trgeoseqset_tposeseqset", + "file": "trgeo_seqset.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const TSequenceSet *" + } + ] + }, + { + "name": "trgeoseqset_make1_exp", + "file": "trgeo_seqset.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "geom", + "cType": "const GSERIALIZED *", + "canonical": "const GSERIALIZED *" + }, + { + "name": "sequences", + "cType": "TSequence **", + "canonical": "TSequence **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "maxcount", + "cType": "int", + "canonical": "int" + }, + { + "name": "normalize", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "trgeoseqset_make_exp", + "file": "trgeo_seqset.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "geom", + "cType": "const GSERIALIZED *", + "canonical": "const GSERIALIZED *" + }, + { + "name": "sequences", + "cType": "TSequence **", + "canonical": "TSequence **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "maxcount", + "cType": "int", + "canonical": "int" + }, + { + "name": "normalize", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "trgeoseqset_make", + "file": "trgeo_seqset.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "geom", + "cType": "const GSERIALIZED *", + "canonical": "const GSERIALIZED *" + }, + { + "name": "sequences", + "cType": "TSequence **", + "canonical": "TSequence **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "normalize", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "trgeoseqset_make_free", + "file": "trgeo_seqset.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "geom", + "cType": "const GSERIALIZED *", + "canonical": "const GSERIALIZED *" + }, + { + "name": "sequences", + "cType": "TSequence **", + "canonical": "TSequence **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "normalize", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "trgeoseqset_make_gaps", + "file": "trgeo_seqset.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "geom", + "cType": "const GSERIALIZED *", + "canonical": "const GSERIALIZED *" + }, + { + "name": "instants", + "cType": "TInstant **", + "canonical": "TInstant **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + }, + { + "name": "maxt", + "cType": "const Interval *", + "canonical": "const Interval *" + }, + { + "name": "maxdist", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "trgeoseqset_to_tsequence", + "file": "trgeo_seqset.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const TSequenceSet *" + } + ] + }, + { + "name": "trgeo_to_tsequence", + "file": "trgeo_seqset.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "interp_str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "trgeo_to_tsequenceset", + "file": "trgeo_seqset.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "interp_str", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "trgeoinst_set_stbox", + "file": "trgeo_boxops.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "geom", + "cType": "const GSERIALIZED *", + "canonical": "const GSERIALIZED *" + }, + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const TInstant *" + }, + { + "name": "box", + "cType": "STBox *", + "canonical": "STBox *" + } + ] + }, + { + "name": "trgeoinstarr_static_stbox", + "file": "trgeo_boxops.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "geom", + "cType": "const GSERIALIZED *", + "canonical": "const GSERIALIZED *" + }, + { + "name": "instants", + "cType": "TInstant **", + "canonical": "TInstant **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "box", + "cType": "STBox *", + "canonical": "STBox *" + } + ] + }, + { + "name": "trgeoinstarr_rotating_stbox", + "file": "trgeo_boxops.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "geom", + "cType": "const GSERIALIZED *", + "canonical": "const GSERIALIZED *" + }, + { + "name": "instants", + "cType": "TInstant **", + "canonical": "TInstant **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "box", + "cType": "STBox *", + "canonical": "STBox *" + } + ] + }, + { + "name": "trgeoinstarr_compute_bbox", + "file": "trgeo_boxops.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "geom", + "cType": "const GSERIALIZED *", + "canonical": "const GSERIALIZED *" + }, + { + "name": "instants", + "cType": "TInstant **", + "canonical": "TInstant **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + }, + { + "name": "box", + "cType": "void *", + "canonical": "void *" + } + ] + }, + { + "name": "ensure_span_isof_type", + "file": "span.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "spantype", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "ensure_span_isof_basetype", + "file": "span.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "basetype", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "ensure_same_span_type", + "file": "span.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s1", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "s2", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "ensure_valid_span_span", + "file": "span.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s1", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "s2", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "span_deserialize", + "file": "span.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "lower", + "cType": "SpanBound *", + "canonical": "SpanBound *" + }, + { + "name": "upper", + "cType": "SpanBound *", + "canonical": "SpanBound *" + } + ] + }, + { + "name": "span_bound_cmp", + "file": "span.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "b1", + "cType": "const SpanBound *", + "canonical": "const SpanBound *" + }, + { + "name": "b2", + "cType": "const SpanBound *", + "canonical": "const SpanBound *" + } + ] + }, + { + "name": "span_bound_qsort_cmp", + "file": "span.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "s1", + "cType": "const void *", + "canonical": "const void *" + }, + { + "name": "s2", + "cType": "const void *", + "canonical": "const void *" + } + ] + }, + { + "name": "span_lower_cmp", + "file": "span.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "s1", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "s2", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "span_upper_cmp", + "file": "span.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "s1", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "s2", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "span_decr_bound", + "file": "span.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "upper", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "basetype", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "span_incr_bound", + "file": "span.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "upper", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "basetype", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "spanarr_normalize", + "file": "span.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "spans", + "cType": "Span *", + "canonical": "Span *" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "sort", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "newcount", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "span_bounds_shift_scale_value", + "file": "span.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "shift", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "width", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "hasshift", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "haswidth", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "lower", + "cType": "Datum *", + "canonical": "unsigned long *" + }, + { + "name": "upper", + "cType": "Datum *", + "canonical": "unsigned long *" + } + ] + }, + { + "name": "span_bounds_shift_scale_time", + "file": "span.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "shift", + "cType": "const Interval *", + "canonical": "const Interval *" + }, + { + "name": "duration", + "cType": "const Interval *", + "canonical": "const Interval *" + }, + { + "name": "lower", + "cType": "TimestampTz *", + "canonical": "long *" + }, + { + "name": "upper", + "cType": "TimestampTz *", + "canonical": "long *" + } + ] + }, + { + "name": "floatspan_floor_ceil_iter", + "file": "span.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "s", + "cType": "Span *", + "canonical": "Span *" + }, + { + "name": "func", + "cType": "datum_func1", + "canonical": "unsigned long (*)(unsigned long)" + } + ] + }, + { + "name": "numspan_delta_scale_iter", + "file": "span.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "s", + "cType": "Span *", + "canonical": "Span *" + }, + { + "name": "origin", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "delta", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "hasdelta", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "scale", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "tstzspan_delta_scale_iter", + "file": "span.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "s", + "cType": "Span *", + "canonical": "Span *" + }, + { + "name": "origin", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "delta", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "scale", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "numspan_shift_scale_iter", + "file": "span.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "s", + "cType": "Span *", + "canonical": "Span *" + }, + { + "name": "shift", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "width", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "hasshift", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "haswidth", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "delta", + "cType": "Datum *", + "canonical": "unsigned long *" + }, + { + "name": "scale", + "cType": "double *", + "canonical": "double *" + } + ] + }, + { + "name": "tstzspan_shift_scale1", + "file": "span.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "s", + "cType": "Span *", + "canonical": "Span *" + }, + { + "name": "shift", + "cType": "const Interval *", + "canonical": "const Interval *" + }, + { + "name": "duration", + "cType": "const Interval *", + "canonical": "const Interval *" + }, + { + "name": "delta", + "cType": "TimestampTz *", + "canonical": "long *" + }, + { + "name": "scale", + "cType": "double *", + "canonical": "double *" + } + ] + }, + { + "name": "mi_span_value", + "file": "span.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "result", + "cType": "Span *", + "canonical": "Span *" + } + ] + }, + { + "name": "dist_double_value_value", + "file": "span.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "l", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "r", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "trgeo_geom_clip_polygon", + "file": "trgeo_geom_clip.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "a1", + "cType": "const POINT2D *", + "canonical": "const POINT2D *" + }, + { + "name": "b1", + "cType": "const POINT2D *", + "canonical": "const POINT2D *" + }, + { + "name": "a2", + "cType": "const POINT2D *", + "canonical": "const POINT2D *" + }, + { + "name": "b2", + "cType": "const POINT2D *", + "canonical": "const POINT2D *" + }, + { + "name": "pa", + "cType": "const POINTARRAY *", + "canonical": "const POINTARRAY *" + }, + { + "name": "intervals_out", + "cType": "Span **", + "canonical": "Span **" + } + ] + }, + { + "name": "trgeo_geom_clip_lwpoly", + "file": "trgeo_geom_clip.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "a1", + "cType": "const POINT2D *", + "canonical": "const POINT2D *" + }, + { + "name": "b1", + "cType": "const POINT2D *", + "canonical": "const POINT2D *" + }, + { + "name": "a2", + "cType": "const POINT2D *", + "canonical": "const POINT2D *" + }, + { + "name": "b2", + "cType": "const POINT2D *", + "canonical": "const POINT2D *" + }, + { + "name": "poly", + "cType": "const LWPOLY *", + "canonical": "const LWPOLY *" + }, + { + "name": "intervals_out", + "cType": "Span **", + "canonical": "Span **" + } + ] + }, + { + "name": "trgeo_geom_clip_box", + "file": "trgeo_geom_clip.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "a1", + "cType": "const POINT2D *", + "canonical": "const POINT2D *" + }, + { + "name": "b1", + "cType": "const POINT2D *", + "canonical": "const POINT2D *" + }, + { + "name": "a2", + "cType": "const POINT2D *", + "canonical": "const POINT2D *" + }, + { + "name": "b2", + "cType": "const POINT2D *", + "canonical": "const POINT2D *" + }, + { + "name": "xmin", + "cType": "double", + "canonical": "double" + }, + { + "name": "ymin", + "cType": "double", + "canonical": "double" + }, + { + "name": "xmax", + "cType": "double", + "canonical": "double" + }, + { + "name": "ymax", + "cType": "double", + "canonical": "double" + }, + { + "name": "intervals_out", + "cType": "Span **", + "canonical": "Span **" + } + ] + }, + { + "name": "trgeo_geom_clip_polygon_posed", + "file": "trgeo_geom_clip.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "p_a_local", + "cType": "const POINT2D *", + "canonical": "const POINT2D *" + }, + { + "name": "p_b_local", + "cType": "const POINT2D *", + "canonical": "const POINT2D *" + }, + { + "name": "pose1", + "cType": "const struct Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "pose2", + "cType": "const struct Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "pa", + "cType": "const POINTARRAY *", + "canonical": "const POINTARRAY *" + }, + { + "name": "intervals_out", + "cType": "Span **", + "canonical": "Span **" + } + ] + }, + { + "name": "trgeo_geom_clip_lwpoly_posed", + "file": "trgeo_geom_clip.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "p_a_local", + "cType": "const POINT2D *", + "canonical": "const POINT2D *" + }, + { + "name": "p_b_local", + "cType": "const POINT2D *", + "canonical": "const POINT2D *" + }, + { + "name": "pose1", + "cType": "const struct Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "pose2", + "cType": "const struct Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "poly", + "cType": "const LWPOLY *", + "canonical": "const LWPOLY *" + }, + { + "name": "intervals_out", + "cType": "Span **", + "canonical": "Span **" + } + ] + }, + { + "name": "trgeo_geom_clip_box_posed", + "file": "trgeo_geom_clip.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "p_a_local", + "cType": "const POINT2D *", + "canonical": "const POINT2D *" + }, + { + "name": "p_b_local", + "cType": "const POINT2D *", + "canonical": "const POINT2D *" + }, + { + "name": "pose1", + "cType": "const struct Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "pose2", + "cType": "const struct Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "xmin", + "cType": "double", + "canonical": "double" + }, + { + "name": "ymin", + "cType": "double", + "canonical": "double" + }, + { + "name": "xmax", + "cType": "double", + "canonical": "double" + }, + { + "name": "ymax", + "cType": "double", + "canonical": "double" + }, + { + "name": "intervals_out", + "cType": "Span **", + "canonical": "Span **" + } + ] + }, + { + "name": "trgeo_geom_clip_lwgeom", + "file": "trgeo_geom_clip.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "a1", + "cType": "const POINT2D *", + "canonical": "const POINT2D *" + }, + { + "name": "b1", + "cType": "const POINT2D *", + "canonical": "const POINT2D *" + }, + { + "name": "a2", + "cType": "const POINT2D *", + "canonical": "const POINT2D *" + }, + { + "name": "b2", + "cType": "const POINT2D *", + "canonical": "const POINT2D *" + }, + { + "name": "geom", + "cType": "const LWGEOM *", + "canonical": "const LWGEOM *" + }, + { + "name": "intervals_out", + "cType": "Span **", + "canonical": "Span **" + } + ] + }, + { + "name": "trgeo_geom_clip_lwgeom_posed", + "file": "trgeo_geom_clip.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "p_a_local", + "cType": "const POINT2D *", + "canonical": "const POINT2D *" + }, + { + "name": "p_b_local", + "cType": "const POINT2D *", + "canonical": "const POINT2D *" + }, + { + "name": "pose1", + "cType": "const struct Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "pose2", + "cType": "const struct Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "geom", + "cType": "const LWGEOM *", + "canonical": "const LWGEOM *" + }, + { + "name": "intervals_out", + "cType": "Span **", + "canonical": "Span **" + } + ] + }, + { + "name": "trgeo_parse", + "file": "trgeo_parser.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "str", + "cType": "const char **", + "canonical": "const char **" + }, + { + "name": "temptype", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "ensure_same_geom", + "file": "trgeo_utils.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "gs1", + "cType": "const GSERIALIZED *", + "canonical": "const GSERIALIZED *" + }, + { + "name": "gs2", + "cType": "const GSERIALIZED *", + "canonical": "const GSERIALIZED *" + } + ] + }, + { + "name": "lwgeom_apply_pose", + "file": "trgeo_utils.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "geom", + "cType": "LWGEOM *", + "canonical": "LWGEOM *" + } + ] + }, + { + "name": "geom_apply_pose", + "file": "trgeo_utils.h", + "returnType": { + "c": "GSERIALIZED *", + "canonical": "GSERIALIZED *" + }, + "params": [ + { + "name": "gs", + "cType": "const GSERIALIZED *", + "canonical": "const GSERIALIZED *" + }, + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + } + ] + }, + { + "name": "geom_radius", + "file": "trgeo_utils.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "gs", + "cType": "const GSERIALIZED *", + "canonical": "const GSERIALIZED *" + } + ] + }, + { + "name": "v_clip_tpoly_point", + "file": "trgeo_vclip.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "poly", + "cType": "const LWPOLY *", + "canonical": "const LWPOLY *" + }, + { + "name": "point", + "cType": "const LWPOINT *", + "canonical": "const LWPOINT *" + }, + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "poly_feature", + "cType": "uint32_t *", + "canonical": "unsigned int *" + }, + { + "name": "dist", + "cType": "double *", + "canonical": "double *" + } + ] + }, + { + "name": "v_clip_tpoly_tpoly", + "file": "trgeo_vclip.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "poly1", + "cType": "const LWPOLY *", + "canonical": "const LWPOLY *" + }, + { + "name": "poly2", + "cType": "const LWPOLY *", + "canonical": "const LWPOLY *" + }, + { + "name": "pose1", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "pose2", + "cType": "const Pose *", + "canonical": "const struct Pose *" + }, + { + "name": "poly1_feature", + "cType": "uint32_t *", + "canonical": "unsigned int *" + }, + { + "name": "poly2_feature", + "cType": "uint32_t *", + "canonical": "unsigned int *" + }, + { + "name": "dist", + "cType": "double *", + "canonical": "double *" + } + ] + }, + { + "name": "apply_pose_point4d", + "file": "trgeo_vclip.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "p", + "cType": "POINT4D *", + "canonical": "POINT4D *" + }, + { + "name": "pose", + "cType": "const Pose *", + "canonical": "const struct Pose *" + } + ] + }, + { + "name": "tfunc_tinstant", + "file": "lifting.h", + "returnType": { + "c": "TInstant *", + "canonical": "TInstant *" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const TInstant *" + }, + { + "name": "lfinfo", + "cType": "LiftedFunctionInfo *", + "canonical": "LiftedFunctionInfo *" + } + ] + }, + { + "name": "tfunc_tsequence", + "file": "lifting.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "lfinfo", + "cType": "LiftedFunctionInfo *", + "canonical": "LiftedFunctionInfo *" + } + ] + }, + { + "name": "tfunc_tsequenceset", + "file": "lifting.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const TSequenceSet *" + }, + { + "name": "lfinfo", + "cType": "LiftedFunctionInfo *", + "canonical": "LiftedFunctionInfo *" + } + ] + }, + { + "name": "tfunc_temporal", + "file": "lifting.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "lfinfo", + "cType": "LiftedFunctionInfo *", + "canonical": "LiftedFunctionInfo *" + } + ] + }, + { + "name": "tfunc_tinstant_base", + "file": "lifting.h", + "returnType": { + "c": "TInstant *", + "canonical": "TInstant *" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const TInstant *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "lfinfo", + "cType": "LiftedFunctionInfo *", + "canonical": "LiftedFunctionInfo *" + } + ] + }, + { + "name": "tfunc_tsequence_base", + "file": "lifting.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "lfinfo", + "cType": "LiftedFunctionInfo *", + "canonical": "LiftedFunctionInfo *" + } + ] + }, + { + "name": "tfunc_tsequenceset_base", + "file": "lifting.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const TSequenceSet *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "lfinfo", + "cType": "LiftedFunctionInfo *", + "canonical": "LiftedFunctionInfo *" + } + ] + }, + { + "name": "tfunc_temporal_base", + "file": "lifting.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "lfinfo", + "cType": "LiftedFunctionInfo *", + "canonical": "LiftedFunctionInfo *" + } + ] + }, + { + "name": "tfunc_tinstant_tinstant", + "file": "lifting.h", + "returnType": { + "c": "TInstant *", + "canonical": "TInstant *" + }, + "params": [ + { + "name": "inst1", + "cType": "const TInstant *", + "canonical": "const TInstant *" + }, + { + "name": "inst2", + "cType": "const TInstant *", + "canonical": "const TInstant *" + }, + { + "name": "lfinfo", + "cType": "LiftedFunctionInfo *", + "canonical": "LiftedFunctionInfo *" + } + ] + }, + { + "name": "tfunc_tdiscseq_tdiscseq", + "file": "lifting.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "seq1", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "seq2", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "lfinfo", + "cType": "LiftedFunctionInfo *", + "canonical": "LiftedFunctionInfo *" + } + ] + }, + { + "name": "tfunc_tcontseq_tcontseq", + "file": "lifting.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "seq1", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "seq2", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "lfinfo", + "cType": "LiftedFunctionInfo *", + "canonical": "LiftedFunctionInfo *" + } + ] + }, + { + "name": "tfunc_tsequenceset_tsequenceset", + "file": "lifting.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "ss1", + "cType": "const TSequenceSet *", + "canonical": "const TSequenceSet *" + }, + { + "name": "ss2", + "cType": "const TSequenceSet *", + "canonical": "const TSequenceSet *" + }, + { + "name": "lfinfo", + "cType": "LiftedFunctionInfo *", + "canonical": "LiftedFunctionInfo *" + } + ] + }, + { + "name": "tfunc_temporal_temporal", + "file": "lifting.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "lfinfo", + "cType": "LiftedFunctionInfo *", + "canonical": "LiftedFunctionInfo *" + } + ] + }, + { + "name": "eafunc_temporal_base", + "file": "lifting.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "lfinfo", + "cType": "LiftedFunctionInfo *", + "canonical": "LiftedFunctionInfo *" + } + ] + }, + { + "name": "eafunc_temporal_temporal", + "file": "lifting.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "lfinfo", + "cType": "LiftedFunctionInfo *", + "canonical": "LiftedFunctionInfo *" + } + ] + }, + { + "name": "lfunc_set", + "file": "lifting.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "set", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "lfinfo", + "cType": "LiftedFunctionInfo *", + "canonical": "LiftedFunctionInfo *" + } + ] + }, + { + "name": "set_out_fn", + "file": "set.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + }, + { + "name": "value_out", + "cType": "outfunc", + "canonical": "char *(*)(unsigned long, MeosType, int)" + } + ] + }, + { + "name": "ensure_set_isof_type", + "file": "set.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "settype", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "ensure_valid_set_set", + "file": "set.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s1", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "s2", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "set_find_value", + "file": "set.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "arg1", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "loc", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "set_unnest_state_make", + "file": "set.h", + "returnType": { + "c": "SetUnnestState *", + "canonical": "SetUnnestState *" + }, + "params": [ + { + "name": "set", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "set_unnest_state_next", + "file": "set.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "state", + "cType": "SetUnnestState *", + "canonical": "SetUnnestState *" + } + ] + }, + { + "name": "ensure_same_skiplist_subtype", + "file": "skiplist.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "state", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "subtype", + "cType": "uint8", + "canonical": "unsigned char" + } + ] + }, + { + "name": "skiplist_set_extra", + "file": "skiplist.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "state", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "data", + "cType": "void *", + "canonical": "void *" + }, + { + "name": "size", + "cType": "size_t", + "canonical": "unsigned long" + } + ] + }, + { + "name": "skiplist_headval", + "file": "skiplist.h", + "returnType": { + "c": "void *", + "canonical": "void *" + }, + "params": [ + { + "name": "list", + "cType": "SkipList *", + "canonical": "struct SkipList *" + } + ] + }, + { + "name": "common_entry_cmp", + "file": "span_index.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "i1", + "cType": "const void *", + "canonical": "const void *" + }, + { + "name": "i2", + "cType": "const void *", + "canonical": "const void *" + } + ] + }, + { + "name": "span_index_leaf_consistent", + "file": "span_index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "key", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "query", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "strategy", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "span_gist_inner_consistent", + "file": "span_index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "key", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "query", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "strategy", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "span_index_recheck", + "file": "span_index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "strategy", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "span_lower_qsort_cmp", + "file": "span_index.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "a", + "cType": "const void *", + "canonical": "const void *" + }, + { + "name": "b", + "cType": "const void *", + "canonical": "const void *" + } + ] + }, + { + "name": "span_upper_qsort_cmp", + "file": "span_index.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "a", + "cType": "const void *", + "canonical": "const void *" + }, + { + "name": "b", + "cType": "const void *", + "canonical": "const void *" + } + ] + }, + { + "name": "getQuadrant2D", + "file": "span_index.h", + "returnType": { + "c": "uint8", + "canonical": "unsigned char" + }, + "params": [ + { + "name": "centroid", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "query", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "overlap2D", + "file": "span_index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "nodebox", + "cType": "const SpanNode *", + "canonical": "const SpanNode *" + }, + { + "name": "query", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "contain2D", + "file": "span_index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "nodebox", + "cType": "const SpanNode *", + "canonical": "const SpanNode *" + }, + { + "name": "query", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "left2D", + "file": "span_index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "nodebox", + "cType": "const SpanNode *", + "canonical": "const SpanNode *" + }, + { + "name": "query", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "overLeft2D", + "file": "span_index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "nodebox", + "cType": "const SpanNode *", + "canonical": "const SpanNode *" + }, + { + "name": "query", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "right2D", + "file": "span_index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "nodebox", + "cType": "const SpanNode *", + "canonical": "const SpanNode *" + }, + { + "name": "query", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "overRight2D", + "file": "span_index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "nodebox", + "cType": "const SpanNode *", + "canonical": "const SpanNode *" + }, + { + "name": "query", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "adjacent2D", + "file": "span_index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "nodebox", + "cType": "const SpanNode *", + "canonical": "const SpanNode *" + }, + { + "name": "query", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "distance_span_nodespan", + "file": "span_index.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "query", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "nodebox", + "cType": "const SpanNode *", + "canonical": "const SpanNode *" + } + ] + }, + { + "name": "span_spgist_get_span", + "file": "span_index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "result", + "cType": "Span *", + "canonical": "Span *" + } + ] + }, + { + "name": "spannode_init", + "file": "span_index.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "nodebox", + "cType": "SpanNode *", + "canonical": "SpanNode *" + }, + { + "name": "spantype", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "basetype", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "spannode_copy", + "file": "span_index.h", + "returnType": { + "c": "SpanNode *", + "canonical": "SpanNode *" + }, + "params": [ + { + "name": "orig", + "cType": "const SpanNode *", + "canonical": "const SpanNode *" + } + ] + }, + { + "name": "spannode_quadtree_next", + "file": "span_index.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "nodebox", + "cType": "const SpanNode *", + "canonical": "const SpanNode *" + }, + { + "name": "centroid", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "quadrant", + "cType": "uint8", + "canonical": "unsigned char" + }, + { + "name": "next_nodespan", + "cType": "SpanNode *", + "canonical": "SpanNode *" + } + ] + }, + { + "name": "spannode_kdtree_next", + "file": "span_index.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "nodebox", + "cType": "const SpanNode *", + "canonical": "const SpanNode *" + }, + { + "name": "centroid", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "node", + "cType": "uint8", + "canonical": "unsigned char" + }, + { + "name": "level", + "cType": "int", + "canonical": "int" + }, + { + "name": "next_nodespan", + "cType": "SpanNode *", + "canonical": "SpanNode *" + } + ] + }, + { + "name": "ensure_spanset_isof_type", + "file": "spanset.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "spansettype", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "ensure_same_spanset_type", + "file": "spanset.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss1", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "ss2", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "ensure_same_spanset_span_type", + "file": "spanset.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "ensure_valid_spanset_span", + "file": "spanset.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "ensure_valid_spanset_spanset", + "file": "spanset.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss1", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "ss2", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "spanset_find_value", + "file": "spanset.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "v", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "loc", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "datum_and", + "file": "tbool_ops.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "l", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "r", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_or", + "file": "tbool_ops.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "l", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "r", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "boolop_tbool_bool", + "file": "tbool_ops.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "b", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "func", + "cType": "datum_func2", + "canonical": "unsigned long (*)(unsigned long, unsigned long)" + }, + { + "name": "invert", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "boolop_tbool_tbool", + "file": "tbool_ops.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "func", + "cType": "datum_func2", + "canonical": "unsigned long (*)(unsigned long, unsigned long)" + } + ] + }, + { + "name": "ensure_same_dimensionality_tbox", + "file": "tbox.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "box1", + "cType": "const TBox *", + "canonical": "const TBox *" + }, + { + "name": "box2", + "cType": "const TBox *", + "canonical": "const TBox *" + } + ] + }, + { + "name": "set_tbox", + "file": "tbox.h", + "returnType": { + "c": "TBox *", + "canonical": "TBox *" + }, + "params": [ + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "span_tbox", + "file": "tbox.h", + "returnType": { + "c": "TBox *", + "canonical": "TBox *" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "tbox_tstzspan", + "file": "tbox.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const TBox *" + } + ] + }, + { + "name": "tbox_intspan", + "file": "tbox.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const TBox *" + } + ] + }, + { + "name": "tbox_floatspan", + "file": "tbox.h", + "returnType": { + "c": "Span *", + "canonical": "Span *" + }, + "params": [ + { + "name": "box", + "cType": "const TBox *", + "canonical": "const TBox *" + } + ] + }, + { + "name": "tbox_index_leaf_consistent", + "file": "tbox_index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "key", + "cType": "const TBox *", + "canonical": "const TBox *" + }, + { + "name": "query", + "cType": "const TBox *", + "canonical": "const TBox *" + }, + { + "name": "strategy", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "tbox_gist_inner_consistent", + "file": "tbox_index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "key", + "cType": "const TBox *", + "canonical": "const TBox *" + }, + { + "name": "query", + "cType": "const TBox *", + "canonical": "const TBox *" + }, + { + "name": "strategy", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "tbox_index_recheck", + "file": "tbox_index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "strategy", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "tboxnode_init", + "file": "tbox_index.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "centroid", + "cType": "TBox *", + "canonical": "TBox *" + }, + { + "name": "nodebox", + "cType": "TboxNode *", + "canonical": "TboxNode *" + } + ] + }, + { + "name": "tboxnode_copy", + "file": "tbox_index.h", + "returnType": { + "c": "TboxNode *", + "canonical": "TboxNode *" + }, + "params": [ + { + "name": "box", + "cType": "const TboxNode *", + "canonical": "const TboxNode *" + } + ] + }, + { + "name": "getQuadrant4D", + "file": "tbox_index.h", + "returnType": { + "c": "uint8", + "canonical": "unsigned char" + }, + "params": [ + { + "name": "centroid", + "cType": "const TBox *", + "canonical": "const TBox *" + }, + { + "name": "inBox", + "cType": "const TBox *", + "canonical": "const TBox *" + } + ] + }, + { + "name": "tboxnode_quadtree_next", + "file": "tbox_index.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "nodebox", + "cType": "const TboxNode *", + "canonical": "const TboxNode *" + }, + { + "name": "centroid", + "cType": "const TBox *", + "canonical": "const TBox *" + }, + { + "name": "quadrant", + "cType": "uint8", + "canonical": "unsigned char" + }, + { + "name": "next_nodebox", + "cType": "TboxNode *", + "canonical": "TboxNode *" + } + ] + }, + { + "name": "tboxnode_kdtree_next", + "file": "tbox_index.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "nodebox", + "cType": "const TboxNode *", + "canonical": "const TboxNode *" + }, + { + "name": "centroid", + "cType": "const TBox *", + "canonical": "const TBox *" + }, + { + "name": "node", + "cType": "uint8", + "canonical": "unsigned char" + }, + { + "name": "level", + "cType": "int", + "canonical": "int" + }, + { + "name": "next_nodebox", + "cType": "TboxNode *", + "canonical": "TboxNode *" + } + ] + }, + { + "name": "overlap4D", + "file": "tbox_index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "nodebox", + "cType": "const TboxNode *", + "canonical": "const TboxNode *" + }, + { + "name": "query", + "cType": "const TBox *", + "canonical": "const TBox *" + } + ] + }, + { + "name": "contain4D", + "file": "tbox_index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "nodebox", + "cType": "const TboxNode *", + "canonical": "const TboxNode *" + }, + { + "name": "query", + "cType": "const TBox *", + "canonical": "const TBox *" + } + ] + }, + { + "name": "left4D", + "file": "tbox_index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "nodebox", + "cType": "const TboxNode *", + "canonical": "const TboxNode *" + }, + { + "name": "query", + "cType": "const TBox *", + "canonical": "const TBox *" + } + ] + }, + { + "name": "overLeft4D", + "file": "tbox_index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "nodebox", + "cType": "const TboxNode *", + "canonical": "const TboxNode *" + }, + { + "name": "query", + "cType": "const TBox *", + "canonical": "const TBox *" + } + ] + }, + { + "name": "right4D", + "file": "tbox_index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "nodebox", + "cType": "const TboxNode *", + "canonical": "const TboxNode *" + }, + { + "name": "query", + "cType": "const TBox *", + "canonical": "const TBox *" + } + ] + }, + { + "name": "overRight4D", + "file": "tbox_index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "nodebox", + "cType": "const TboxNode *", + "canonical": "const TboxNode *" + }, + { + "name": "query", + "cType": "const TBox *", + "canonical": "const TBox *" + } + ] + }, + { + "name": "before4D", + "file": "tbox_index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "nodebox", + "cType": "const TboxNode *", + "canonical": "const TboxNode *" + }, + { + "name": "query", + "cType": "const TBox *", + "canonical": "const TBox *" + } + ] + }, + { + "name": "overBefore4D", + "file": "tbox_index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "nodebox", + "cType": "const TboxNode *", + "canonical": "const TboxNode *" + }, + { + "name": "query", + "cType": "const TBox *", + "canonical": "const TBox *" + } + ] + }, + { + "name": "after4D", + "file": "tbox_index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "nodebox", + "cType": "const TboxNode *", + "canonical": "const TboxNode *" + }, + { + "name": "query", + "cType": "const TBox *", + "canonical": "const TBox *" + } + ] + }, + { + "name": "overAfter4D", + "file": "tbox_index.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "nodebox", + "cType": "const TboxNode *", + "canonical": "const TboxNode *" + }, + { + "name": "query", + "cType": "const TBox *", + "canonical": "const TBox *" + } + ] + }, + { + "name": "distance_tbox_nodebox", + "file": "tbox_index.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "query", + "cType": "const TBox *", + "canonical": "const TBox *" + }, + { + "name": "nodebox", + "cType": "const TboxNode *", + "canonical": "const TboxNode *" + } + ] + }, + { + "name": "tnumber_spgist_get_tbox", + "file": "tbox_index.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "result", + "cType": "TBox *", + "canonical": "TBox *" + } + ] + }, + { + "name": "tbox_xmin_cmp", + "file": "tbox_index.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "box1", + "cType": "const TBox *", + "canonical": "const TBox *" + }, + { + "name": "box2", + "cType": "const TBox *", + "canonical": "const TBox *" + } + ] + }, + { + "name": "tbox_xmax_cmp", + "file": "tbox_index.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "box1", + "cType": "const TBox *", + "canonical": "const TBox *" + }, + { + "name": "box2", + "cType": "const TBox *", + "canonical": "const TBox *" + } + ] + }, + { + "name": "tbox_tmin_cmp", + "file": "tbox_index.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "box1", + "cType": "const TBox *", + "canonical": "const TBox *" + }, + { + "name": "box2", + "cType": "const TBox *", + "canonical": "const TBox *" + } + ] + }, + { + "name": "tbox_tmax_cmp", + "file": "tbox_index.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "box1", + "cType": "const TBox *", + "canonical": "const TBox *" + }, + { + "name": "box2", + "cType": "const TBox *", + "canonical": "const TBox *" + } + ] + }, + { + "name": "tbox_level_cmp", + "file": "tbox_index.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "centroid", + "cType": "const TBox *", + "canonical": "const TBox *" + }, + { + "name": "query", + "cType": "const TBox *", + "canonical": "const TBox *" + }, + { + "name": "level", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "tcellindex_type", + "file": "tcellindex.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "dggs_cellops", + "file": "tcellindex.h", + "returnType": { + "c": "const DggsCellOps *", + "canonical": "const struct DggsCellOps *" + }, + "params": [ + { + "name": "temptype", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "tcellindex_get_resolution", + "file": "tcellindex.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tcellindex_is_valid_cell", + "file": "tcellindex.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tcellindex_cell_to_parent", + "file": "tcellindex.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "resolution", + "cType": "int32", + "canonical": "int" + } + ] + }, + { + "name": "tcellindex_cell_to_point", + "file": "tcellindex.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tcellindex_cell_to_boundary", + "file": "tcellindex.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "tcellindex_cell_area", + "file": "tcellindex.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + } + ] + }, + { + "name": "datum_min_int32", + "file": "temporal_aggfuncs.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "l", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "r", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_max_int32", + "file": "temporal_aggfuncs.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "l", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "r", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_min_int64", + "file": "temporal_aggfuncs.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "l", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "r", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_max_int64", + "file": "temporal_aggfuncs.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "l", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "r", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_min_float8", + "file": "temporal_aggfuncs.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "l", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "r", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_max_float8", + "file": "temporal_aggfuncs.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "l", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "r", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_sum_int32", + "file": "temporal_aggfuncs.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "l", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "r", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_sum_int64", + "file": "temporal_aggfuncs.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "l", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "r", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_sum_float8", + "file": "temporal_aggfuncs.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "l", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "r", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_min_text", + "file": "temporal_aggfuncs.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "l", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "r", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_max_text", + "file": "temporal_aggfuncs.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "l", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "r", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_sum_double2", + "file": "temporal_aggfuncs.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "l", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "r", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_sum_double3", + "file": "temporal_aggfuncs.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "l", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "r", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_sum_double4", + "file": "temporal_aggfuncs.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "l", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "r", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "temporal_skiplist_common", + "file": "temporal_aggfuncs.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "list", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "values", + "cType": "void **", + "canonical": "void **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "lower", + "cType": "int *", + "canonical": "int *" + }, + { + "name": "upper", + "cType": "int *", + "canonical": "int *" + }, + { + "name": "update", + "cType": "int[32]", + "canonical": "int[32]" + } + ] + }, + { + "name": "temporal_skiplist_merge", + "file": "temporal_aggfuncs.h", + "returnType": { + "c": "void **", + "canonical": "void **" + }, + "params": [ + { + "name": "spliced", + "cType": "void **", + "canonical": "void **" + }, + { + "name": "spliced_count", + "cType": "int", + "canonical": "int" + }, + { + "name": "values", + "cType": "void **", + "canonical": "void **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "func", + "cType": "datum_func2", + "canonical": "unsigned long (*)(unsigned long, unsigned long)" + }, + { + "name": "crossings", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "newcount", + "cType": "int *", + "canonical": "int *" + }, + { + "name": "tofree", + "cType": "void ***", + "canonical": "void ***" + }, + { + "name": "nfree", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tinstant_tagg", + "file": "temporal_aggfuncs.h", + "returnType": { + "c": "TInstant **", + "canonical": "TInstant **" + }, + "params": [ + { + "name": "instants1", + "cType": "TInstant **", + "canonical": "TInstant **" + }, + { + "name": "count1", + "cType": "int", + "canonical": "int" + }, + { + "name": "instants2", + "cType": "TInstant **", + "canonical": "TInstant **" + }, + { + "name": "count2", + "cType": "int", + "canonical": "int" + }, + { + "name": "func", + "cType": "datum_func2", + "canonical": "unsigned long (*)(unsigned long, unsigned long)" + }, + { + "name": "newcount", + "cType": "int *", + "canonical": "int *" + }, + { + "name": "tofree", + "cType": "void ***", + "canonical": "void ***" + }, + { + "name": "nfree", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tsequence_tagg", + "file": "temporal_aggfuncs.h", + "returnType": { + "c": "TSequence **", + "canonical": "TSequence **" + }, + "params": [ + { + "name": "sequences1", + "cType": "TSequence **", + "canonical": "TSequence **" + }, + { + "name": "count1", + "cType": "int", + "canonical": "int" + }, + { + "name": "sequences2", + "cType": "TSequence **", + "canonical": "TSequence **" + }, + { + "name": "count2", + "cType": "int", + "canonical": "int" + }, + { + "name": "func", + "cType": "datum_func2", + "canonical": "unsigned long (*)(unsigned long, unsigned long)" + }, + { + "name": "crossings", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "newcount", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tcontseq_tagg_transfn", + "file": "temporal_aggfuncs.h", + "returnType": { + "c": "SkipList *", + "canonical": "struct SkipList *" + }, + "params": [ + { + "name": "state", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "func", + "cType": "datum_func2", + "canonical": "unsigned long (*)(unsigned long, unsigned long)" + }, + { + "name": "interpoint", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "temporal_tagg_combinefn", + "file": "temporal_aggfuncs.h", + "returnType": { + "c": "SkipList *", + "canonical": "struct SkipList *" + }, + "params": [ + { + "name": "state1", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "state2", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "func", + "cType": "datum_func2", + "canonical": "unsigned long (*)(unsigned long, unsigned long)" + }, + { + "name": "crossings", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tinstant_tagg_transfn", + "file": "temporal_aggfuncs.h", + "returnType": { + "c": "SkipList *", + "canonical": "struct SkipList *" + }, + "params": [ + { + "name": "state", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const TInstant *" + }, + { + "name": "func", + "cType": "datum_func2", + "canonical": "unsigned long (*)(unsigned long, unsigned long)" + } + ] + }, + { + "name": "tinstant_tavg_finalfn", + "file": "temporal_aggfuncs.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "instants", + "cType": "TInstant **", + "canonical": "TInstant **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "tsequence_tavg_finalfn", + "file": "temporal_aggfuncs.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "sequences", + "cType": "TSequence **", + "canonical": "TSequence **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "tnumberinst_transform_tavg", + "file": "temporal_aggfuncs.h", + "returnType": { + "c": "TInstant *", + "canonical": "TInstant *" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const TInstant *" + } + ] + }, + { + "name": "temporal_transform_tcount", + "file": "temporal_aggfuncs.h", + "returnType": { + "c": "Temporal **", + "canonical": "Temporal **" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "temporal_transform_tagg", + "file": "temporal_aggfuncs.h", + "returnType": { + "c": "Temporal **", + "canonical": "Temporal **" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + }, + { + "name": "func", + "cType": "TInstant *(*)(const TInstant *)", + "canonical": "TInstant *(*)(const TInstant *)" + } + ] + }, + { + "name": "tsequenceset_tagg_transfn", + "file": "temporal_aggfuncs.h", + "returnType": { + "c": "SkipList *", + "canonical": "struct SkipList *" + }, + "params": [ + { + "name": "state", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const TSequenceSet *" + }, + { + "name": "func", + "cType": "datum_func2", + "canonical": "unsigned long (*)(unsigned long, unsigned long)" + }, + { + "name": "crossings", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tdiscseq_tagg_transfn", + "file": "temporal_aggfuncs.h", + "returnType": { + "c": "SkipList *", + "canonical": "struct SkipList *" + }, + "params": [ + { + "name": "state", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "func", + "cType": "datum_func2", + "canonical": "unsigned long (*)(unsigned long, unsigned long)" + } + ] + }, + { + "name": "temporal_tagg_transfn", + "file": "temporal_aggfuncs.h", + "returnType": { + "c": "SkipList *", + "canonical": "struct SkipList *" + }, + "params": [ + { + "name": "state", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "arg2", + "cType": "datum_func2", + "canonical": "unsigned long (*)(unsigned long, unsigned long)" + }, + { + "name": "crossings", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "temporal_tagg_transform_transfn", + "file": "temporal_aggfuncs.h", + "returnType": { + "c": "SkipList *", + "canonical": "struct SkipList *" + }, + "params": [ + { + "name": "state", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "func", + "cType": "datum_func2", + "canonical": "unsigned long (*)(unsigned long, unsigned long)" + }, + { + "name": "crossings", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "transform", + "cType": "TInstant *(*)(const TInstant *)", + "canonical": "TInstant *(*)(const TInstant *)" + } + ] + }, + { + "name": "temporal_similarity", + "file": "temporal_analytics.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "simfunc", + "cType": "SimFunc", + "canonical": "SimFunc" + } + ] + }, + { + "name": "temporal_similarity_path", + "file": "temporal_analytics.h", + "returnType": { + "c": "Match *", + "canonical": "Match *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + }, + { + "name": "simfunc", + "cType": "SimFunc", + "canonical": "SimFunc" + } + ] + }, + { + "name": "temporal_bbox_size", + "file": "temporal_boxops.h", + "returnType": { + "c": "size_t", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "tempype", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "tinstarr_set_bbox", + "file": "temporal_boxops.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "instants", + "cType": "TInstant **", + "canonical": "TInstant **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "lower_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "upper_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + }, + { + "name": "bbox", + "cType": "void *", + "canonical": "void *" + } + ] + }, + { + "name": "tsequence_compute_bbox", + "file": "temporal_boxops.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "seq", + "cType": "TSequence *", + "canonical": "TSequence *" + } + ] + }, + { + "name": "tseqarr_compute_bbox", + "file": "temporal_boxops.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "sequences", + "cType": "TSequence **", + "canonical": "TSequence **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "bbox", + "cType": "void *", + "canonical": "void *" + } + ] + }, + { + "name": "tsequenceset_compute_bbox", + "file": "temporal_boxops.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "ss", + "cType": "TSequenceSet *", + "canonical": "TSequenceSet *" + } + ] + }, + { + "name": "boxop_temporal_tstzspan", + "file": "temporal_boxops.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "func", + "cType": "bool (*)(const Span *, const Span *)", + "canonical": "_Bool (*)(const Span *, const Span *)" + }, + { + "name": "invert", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "boxop_temporal_temporal", + "file": "temporal_boxops.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "func", + "cType": "bool (*)(const Span *, const Span *)", + "canonical": "_Bool (*)(const Span *, const Span *)" + } + ] + }, + { + "name": "boxop_tnumber_numspan", + "file": "temporal_boxops.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "span", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "func", + "cType": "bool (*)(const Span *, const Span *)", + "canonical": "_Bool (*)(const Span *, const Span *)" + }, + { + "name": "invert", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "boxop_tnumber_tbox", + "file": "temporal_boxops.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const TBox *", + "canonical": "const TBox *" + }, + { + "name": "func", + "cType": "bool (*)(const TBox *, const TBox *)", + "canonical": "_Bool (*)(const TBox *, const TBox *)" + }, + { + "name": "invert", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "boxop_tnumber_tnumber", + "file": "temporal_boxops.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "func", + "cType": "bool (*)(const TBox *, const TBox *)", + "canonical": "_Bool (*)(const TBox *, const TBox *)" + } + ] + }, + { + "name": "eacomp_base_temporal", + "file": "temporal_compops.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "func", + "cType": "Datum (*)(Datum, Datum, MeosType)", + "canonical": "unsigned long (*)(unsigned long, unsigned long, MeosType)" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "eacomp_temporal_base", + "file": "temporal_compops.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "func", + "cType": "Datum (*)(Datum, Datum, MeosType)", + "canonical": "unsigned long (*)(unsigned long, unsigned long, MeosType)" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "eacomp_temporal_temporal", + "file": "temporal_compops.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "func", + "cType": "Datum (*)(Datum, Datum, MeosType)", + "canonical": "unsigned long (*)(unsigned long, unsigned long, MeosType)" + }, + { + "name": "ever", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tcomp_base_temporal", + "file": "temporal_compops.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "func", + "cType": "Datum (*)(Datum, Datum, MeosType)", + "canonical": "unsigned long (*)(unsigned long, unsigned long, MeosType)" + } + ] + }, + { + "name": "tcomp_temporal_base", + "file": "temporal_compops.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "func", + "cType": "Datum (*)(Datum, Datum, MeosType)", + "canonical": "unsigned long (*)(unsigned long, unsigned long, MeosType)" + } + ] + }, + { + "name": "tcomp_temporal_temporal", + "file": "temporal_compops.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "func", + "cType": "Datum (*)(Datum, Datum, MeosType)", + "canonical": "unsigned long (*)(unsigned long, unsigned long, MeosType)" + } + ] + }, + { + "name": "tdiscseq_at_timestamptz", + "file": "temporal_restrict.h", + "returnType": { + "c": "TInstant *", + "canonical": "TInstant *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "tdiscseq_restrict_value", + "file": "temporal_restrict.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tdiscseq_restrict_values", + "file": "temporal_restrict.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tdiscseq_minus_timestamptz", + "file": "temporal_restrict.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "tdiscseq_restrict_tstzset", + "file": "temporal_restrict.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tdiscseq_restrict_tstzspanset", + "file": "temporal_restrict.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tcontseq_restrict_value_iter", + "file": "temporal_restrict.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "result", + "cType": "TSequence **", + "canonical": "TSequence **" + } + ] + }, + { + "name": "tcontseq_delete_timestamptz", + "file": "temporal_restrict.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "tcontseq_delete_tstzset", + "file": "temporal_restrict.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "tcontseq_delete_tstzspanset", + "file": "temporal_restrict.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + } + ] + }, + { + "name": "tcontseq_at_tstzset", + "file": "temporal_restrict.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "tcontseq_minus_timestamptz", + "file": "temporal_restrict.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "tcontseq_minus_tstzset", + "file": "temporal_restrict.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + } + ] + }, + { + "name": "tcontseq_minus_tstzspan", + "file": "temporal_restrict.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "tcontseq_restrict_value", + "file": "temporal_restrict.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tcontseq_restrict_values", + "file": "temporal_restrict.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tsequence_at_values_iter", + "file": "temporal_restrict.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "set", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "result", + "cType": "TSequence **", + "canonical": "TSequence **" + } + ] + }, + { + "name": "tnumberseq_cont_restrict_span_iter", + "file": "temporal_restrict.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "span", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "result", + "cType": "TSequence **", + "canonical": "TSequence **" + } + ] + }, + { + "name": "tnumberseq_cont_restrict_spanset_iter", + "file": "temporal_restrict.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "result", + "cType": "TSequence **", + "canonical": "TSequence **" + } + ] + }, + { + "name": "tsegment_at_timestamptz", + "file": "temporal_restrict.h", + "returnType": { + "c": "TInstant *", + "canonical": "TInstant *" + }, + "params": [ + { + "name": "inst1", + "cType": "const TInstant *", + "canonical": "const TInstant *" + }, + { + "name": "inst2", + "cType": "const TInstant *", + "canonical": "const TInstant *" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "tcontseq_minus_timestamp_iter", + "file": "temporal_restrict.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "result", + "cType": "TSequence **", + "canonical": "TSequence **" + } + ] + }, + { + "name": "tcontseq_minus_tstzset_iter", + "file": "temporal_restrict.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "result", + "cType": "TSequence **", + "canonical": "TSequence **" + } + ] + }, + { + "name": "tcontseq_at_tstzspanset1", + "file": "temporal_restrict.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "result", + "cType": "TSequence **", + "canonical": "TSequence **" + } + ] + }, + { + "name": "tcontseq_minus_tstzspanset_iter", + "file": "temporal_restrict.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "result", + "cType": "TSequence **", + "canonical": "TSequence **" + } + ] + }, + { + "name": "tcontseq_at_tstzspan", + "file": "temporal_restrict.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + } + ] + }, + { + "name": "tcontseq_at_timestamptz", + "file": "temporal_restrict.h", + "returnType": { + "c": "TInstant *", + "canonical": "TInstant *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "tcontseq_restrict_tstzspanset", + "file": "temporal_restrict.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tdiscseq_value_at_timestamptz", + "file": "temporal_restrict.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "result", + "cType": "Datum *", + "canonical": "unsigned long *" + } + ] + }, + { + "name": "tnumberseq_disc_restrict_span", + "file": "temporal_restrict.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "span", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tnumberseq_disc_restrict_spanset", + "file": "temporal_restrict.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tnumberseq_cont_restrict_span", + "file": "temporal_restrict.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "span", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tnumberseq_cont_restrict_spanset", + "file": "temporal_restrict.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tnumberseq_cont_twavg", + "file": "temporal_restrict.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + } + ] + }, + { + "name": "span_num_bins", + "file": "temporal_tile.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "size", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "origin", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "start_bin", + "cType": "Datum *", + "canonical": "unsigned long *" + }, + { + "name": "end_bin", + "cType": "Datum *", + "canonical": "unsigned long *" + } + ] + }, + { + "name": "temporal_time_bin_init", + "file": "temporal_tile.h", + "returnType": { + "c": "SpanBinState *", + "canonical": "struct SpanBinState *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "duration", + "cType": "const Interval *", + "canonical": "const Interval *" + }, + { + "name": "torigin", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "nbins", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tbox_tile_state_make", + "file": "temporal_tile.h", + "returnType": { + "c": "TboxGridState *", + "canonical": "struct TboxGridState *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "box", + "cType": "const TBox *", + "canonical": "const TBox *" + }, + { + "name": "vsize", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "duration", + "cType": "const Interval *", + "canonical": "const Interval *" + }, + { + "name": "xorigin", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "torigin", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "tbox_tile_state_next", + "file": "temporal_tile.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "state", + "cType": "TboxGridState *", + "canonical": "struct TboxGridState *" + } + ] + }, + { + "name": "tbox_tile_state_set", + "file": "temporal_tile.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "vsize", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "tunits", + "cType": "int64", + "canonical": "long" + }, + { + "name": "basetype", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "spantype", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "box", + "cType": "TBox *", + "canonical": "TBox *" + } + ] + }, + { + "name": "interval_units", + "file": "temporal_tile.h", + "returnType": { + "c": "int64", + "canonical": "long" + }, + "params": [ + { + "name": "interval", + "cType": "const Interval *", + "canonical": "const Interval *" + } + ] + }, + { + "name": "timestamptz_bin_start", + "file": "temporal_tile.h", + "returnType": { + "c": "TimestampTz", + "canonical": "long" + }, + "params": [ + { + "name": "timestamp", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "tunits", + "cType": "int64", + "canonical": "long" + }, + { + "name": "torigin", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "datum_bin", + "file": "temporal_tile.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "size", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "offset", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "basetype", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "tnumber_value_time_tile_init", + "file": "temporal_tile.h", + "returnType": { + "c": "TboxGridState *", + "canonical": "struct TboxGridState *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "vsize", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "duration", + "cType": "const Interval *", + "canonical": "const Interval *" + }, + { + "name": "vorigin", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "torigin", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "ntiles", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tbox_tile_state_get", + "file": "temporal_tile.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "state", + "cType": "TboxGridState *", + "canonical": "struct TboxGridState *" + }, + { + "name": "box", + "cType": "TBox *", + "canonical": "TBox *" + } + ] + }, + { + "name": "temporal_transform_wcount", + "file": "temporal_waggfuncs.h", + "returnType": { + "c": "TSequence **", + "canonical": "TSequence **" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "interval", + "cType": "const Interval *", + "canonical": "const Interval *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tnumber_transform_wavg", + "file": "temporal_waggfuncs.h", + "returnType": { + "c": "TSequence **", + "canonical": "TSequence **" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "interval", + "cType": "const Interval *", + "canonical": "const Interval *" + }, + { + "name": "count", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "temporal_wagg_transfn", + "file": "temporal_waggfuncs.h", + "returnType": { + "c": "SkipList *", + "canonical": "struct SkipList *" + }, + "params": [ + { + "name": "state", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "interval", + "cType": "const Interval *", + "canonical": "const Interval *" + }, + { + "name": "func", + "cType": "datum_func2", + "canonical": "unsigned long (*)(unsigned long, unsigned long)" + }, + { + "name": "min", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "crossings", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "temporal_wagg_transform_transfn", + "file": "temporal_waggfuncs.h", + "returnType": { + "c": "SkipList *", + "canonical": "struct SkipList *" + }, + "params": [ + { + "name": "state", + "cType": "SkipList *", + "canonical": "struct SkipList *" + }, + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "interval", + "cType": "const Interval *", + "canonical": "const Interval *" + }, + { + "name": "func", + "cType": "datum_func2", + "canonical": "unsigned long (*)(unsigned long, unsigned long)" + }, + { + "name": "transform", + "cType": "TSequence **(*)(const Temporal *, const Interval *, int *)", + "canonical": "TSequence **(*)(const Temporal *, const Interval *, int *)" + } + ] + }, + { + "name": "tinstant_set", + "file": "tinstant.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "inst", + "cType": "TInstant *", + "canonical": "TInstant *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "tnumberinst_double", + "file": "tinstant.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const TInstant *" + } + ] + }, + { + "name": "tinstant_to_string", + "file": "tinstant.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const TInstant *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + }, + { + "name": "value_out", + "cType": "outfunc", + "canonical": "char *(*)(unsigned long, MeosType, int)" + } + ] + }, + { + "name": "tinstant_restrict_values_test", + "file": "tinstant.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const TInstant *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tnumberinst_restrict_span_test", + "file": "tinstant.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const TInstant *" + }, + { + "name": "s", + "cType": "const Span *", + "canonical": "const Span *" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tnumberinst_restrict_spanset_test", + "file": "tinstant.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const TInstant *" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tinstant_restrict_tstzset_test", + "file": "tinstant.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const TInstant *" + }, + { + "name": "s", + "cType": "const Set *", + "canonical": "const Set *" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tinstant_restrict_tstzspanset_test", + "file": "tinstant.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const TInstant *" + }, + { + "name": "ss", + "cType": "const SpanSet *", + "canonical": "const SpanSet *" + }, + { + "name": "atfunc", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "intersection_tinstant_tinstant", + "file": "tinstant.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "inst1", + "cType": "const TInstant *", + "canonical": "const TInstant *" + }, + { + "name": "inst2", + "cType": "const TInstant *", + "canonical": "const TInstant *" + }, + { + "name": "inter1", + "cType": "TInstant **", + "canonical": "TInstant **" + }, + { + "name": "inter2", + "cType": "TInstant **", + "canonical": "TInstant **" + } + ] + }, + { + "name": "_mulmat", + "file": "tinyekf_meos.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "a", + "cType": "const float *", + "canonical": "const float *" + }, + { + "name": "b", + "cType": "const float *", + "canonical": "const float *" + }, + { + "name": "c", + "cType": "float *", + "canonical": "float *" + }, + { + "name": "arows", + "cType": "const int", + "canonical": "const int" + }, + { + "name": "acols", + "cType": "const int", + "canonical": "const int" + }, + { + "name": "bcols", + "cType": "const int", + "canonical": "const int" + } + ] + }, + { + "name": "_mulvec", + "file": "tinyekf_meos.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "a", + "cType": "const float *", + "canonical": "const float *" + }, + { + "name": "x", + "cType": "const float *", + "canonical": "const float *" + }, + { + "name": "y", + "cType": "float *", + "canonical": "float *" + }, + { + "name": "m", + "cType": "const int", + "canonical": "const int" + }, + { + "name": "n", + "cType": "const int", + "canonical": "const int" + } + ] + }, + { + "name": "_transpose", + "file": "tinyekf_meos.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "a", + "cType": "const float *", + "canonical": "const float *" + }, + { + "name": "at", + "cType": "float *", + "canonical": "float *" + }, + { + "name": "m", + "cType": "const int", + "canonical": "const int" + }, + { + "name": "n", + "cType": "const int", + "canonical": "const int" + } + ] + }, + { + "name": "_addmat", + "file": "tinyekf_meos.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "a", + "cType": "const float *", + "canonical": "const float *" + }, + { + "name": "b", + "cType": "const float *", + "canonical": "const float *" + }, + { + "name": "c", + "cType": "float *", + "canonical": "float *" + }, + { + "name": "m", + "cType": "const int", + "canonical": "const int" + }, + { + "name": "n", + "cType": "const int", + "canonical": "const int" + } + ] + }, + { + "name": "_negate", + "file": "tinyekf_meos.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "a", + "cType": "float *", + "canonical": "float *" + }, + { + "name": "m", + "cType": "const int", + "canonical": "const int" + }, + { + "name": "n", + "cType": "const int", + "canonical": "const int" + } + ] + }, + { + "name": "_addeye", + "file": "tinyekf_meos.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "a", + "cType": "float *", + "canonical": "float *" + }, + { + "name": "n", + "cType": "const int", + "canonical": "const int" + } + ] + }, + { + "name": "_choldc1", + "file": "tinyekf_meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "a", + "cType": "float *", + "canonical": "float *" + }, + { + "name": "p", + "cType": "float *", + "canonical": "float *" + }, + { + "name": "n", + "cType": "const int", + "canonical": "const int" + } + ] + }, + { + "name": "_choldcsl", + "file": "tinyekf_meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "A", + "cType": "const float *", + "canonical": "const float *" + }, + { + "name": "a", + "cType": "float *", + "canonical": "float *" + }, + { + "name": "p", + "cType": "float *", + "canonical": "float *" + }, + { + "name": "n", + "cType": "const int", + "canonical": "const int" + } + ] + }, + { + "name": "_cholsl", + "file": "tinyekf_meos.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "A", + "cType": "const float *", + "canonical": "const float *" + }, + { + "name": "a", + "cType": "float *", + "canonical": "float *" + }, + { + "name": "p", + "cType": "float *", + "canonical": "float *" + }, + { + "name": "n", + "cType": "const int", + "canonical": "const int" + } + ] + }, + { + "name": "_addvec", + "file": "tinyekf_meos.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "a", + "cType": "const float *", + "canonical": "const float *" + }, + { + "name": "b", + "cType": "const float *", + "canonical": "const float *" + }, + { + "name": "c", + "cType": "float *", + "canonical": "float *" + }, + { + "name": "n", + "cType": "const int", + "canonical": "const int" + } + ] + }, + { + "name": "_sub", + "file": "tinyekf_meos.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "a", + "cType": "const float *", + "canonical": "const float *" + }, + { + "name": "b", + "cType": "const float *", + "canonical": "const float *" + }, + { + "name": "c", + "cType": "float *", + "canonical": "float *" + }, + { + "name": "n", + "cType": "const int", + "canonical": "const int" + } + ] + }, + { + "name": "invert", + "file": "tinyekf_meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "a", + "cType": "const float *", + "canonical": "const float *" + }, + { + "name": "ainv", + "cType": "float *", + "canonical": "float *" + } + ] + }, + { + "name": "ekf_initialize", + "file": "tinyekf_meos.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "ekf", + "cType": "ekf_t *", + "canonical": "struct ekf_t *" + }, + { + "name": "pdiag", + "cType": "const float", + "canonical": "const float" + } + ] + }, + { + "name": "ekf_predict", + "file": "tinyekf_meos.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "ekf", + "cType": "ekf_t *", + "canonical": "struct ekf_t *" + }, + { + "name": "fx", + "cType": "const float", + "canonical": "const float" + }, + { + "name": "F", + "cType": "const float", + "canonical": "const float" + }, + { + "name": "Q", + "cType": "const float", + "canonical": "const float" + } + ] + }, + { + "name": "ekf_update_step3", + "file": "tinyekf_meos.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "ekf", + "cType": "ekf_t *", + "canonical": "struct ekf_t *" + }, + { + "name": "GH", + "cType": "float", + "canonical": "float" + } + ] + }, + { + "name": "ekf_update", + "file": "tinyekf_meos.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ekf", + "cType": "ekf_t *", + "canonical": "struct ekf_t *" + }, + { + "name": "z", + "cType": "const float", + "canonical": "const float" + }, + { + "name": "hx", + "cType": "const float", + "canonical": "const float" + }, + { + "name": "H", + "cType": "const float", + "canonical": "const float" + }, + { + "name": "R", + "cType": "const float", + "canonical": "const float" + } + ] + }, + { + "name": "tfloat_arithop_turnpt", + "file": "tnumber_mathfuncs.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "start1", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "end1", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "start2", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "end2", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "param", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "arithop_tnumber_number", + "file": "tnumber_mathfuncs.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "oper", + "cType": "TArithmetic", + "canonical": "TArithmetic" + }, + { + "name": "func", + "cType": "Datum (*)(Datum, Datum, MeosType)", + "canonical": "unsigned long (*)(unsigned long, unsigned long, MeosType)" + }, + { + "name": "invert", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "arithop_tnumber_tnumber", + "file": "tnumber_mathfuncs.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "oper", + "cType": "TArithmetic", + "canonical": "TArithmetic" + }, + { + "name": "func", + "cType": "Datum (*)(Datum, Datum, MeosType)", + "canonical": "unsigned long (*)(unsigned long, unsigned long, MeosType)" + }, + { + "name": "tpfunc", + "cType": "tpfunc_temp", + "canonical": "int (*)(unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, long, long, long *, long *)" + } + ] + }, + { + "name": "float_collinear", + "file": "tsequence.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "x1", + "cType": "double", + "canonical": "double" + }, + { + "name": "x2", + "cType": "double", + "canonical": "double" + }, + { + "name": "x3", + "cType": "double", + "canonical": "double" + }, + { + "name": "ratio", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "floatsegm_interpolate", + "file": "tsequence.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "value1", + "cType": "double", + "canonical": "double" + }, + { + "name": "value2", + "cType": "double", + "canonical": "double" + }, + { + "name": "value", + "cType": "long double", + "canonical": "long double" + } + ] + }, + { + "name": "floatsegm_locate", + "file": "tsequence.h", + "returnType": { + "c": "long double", + "canonical": "long double" + }, + "params": [ + { + "name": "value1", + "cType": "double", + "canonical": "double" + }, + { + "name": "value2", + "cType": "double", + "canonical": "double" + }, + { + "name": "value", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "tnumbersegm_intersection", + "file": "tsequence.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "start1", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "end1", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "start2", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "end2", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "basetype", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "lower", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "upper", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "t1", + "cType": "TimestampTz *", + "canonical": "long *" + }, + { + "name": "t2", + "cType": "TimestampTz *", + "canonical": "long *" + } + ] + }, + { + "name": "tsequence_norm_test", + "file": "tsequence.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "value1", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "value2", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "value3", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "basetype", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + }, + { + "name": "t1", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "t2", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "t3", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "tsequence_join_test", + "file": "tsequence.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "seq1", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "seq2", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "removelast", + "cType": "bool *", + "canonical": "_Bool *" + }, + { + "name": "removefirst", + "cType": "bool *", + "canonical": "_Bool *" + } + ] + }, + { + "name": "tsequence_join", + "file": "tsequence.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "seq1", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "seq2", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "removelast", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "removefirst", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tinstarr_normalize", + "file": "tsequence.h", + "returnType": { + "c": "TInstant **", + "canonical": "TInstant **" + }, + "params": [ + { + "name": "instants", + "cType": "TInstant **", + "canonical": "TInstant **" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "newcount", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tcontseq_find_timestamptz", + "file": "tsequence.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "tdiscseq_find_timestamptz", + "file": "tsequence.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "tseqarr2_to_tseqarr", + "file": "tsequence.h", + "returnType": { + "c": "TSequence **", + "canonical": "TSequence **" + }, + "params": [ + { + "name": "sequences", + "cType": "TSequence ***", + "canonical": "TSequence ***" + }, + { + "name": "countseqs", + "cType": "int *", + "canonical": "int *" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "totalseqs", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "ensure_valid_tinstarr_common", + "file": "tsequence.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "instants", + "cType": "TInstant **", + "canonical": "TInstant **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "lower_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "upper_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "tsequence_make_exp1", + "file": "tsequence.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "instants", + "cType": "TInstant **", + "canonical": "TInstant **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "maxcount", + "cType": "int", + "canonical": "int" + }, + { + "name": "lower_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "upper_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + }, + { + "name": "normalize", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "bbox", + "cType": "void *", + "canonical": "void *" + } + ] + }, + { + "name": "synchronize_tsequence_tsequence", + "file": "tsequence.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "seq1", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "seq2", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "sync1", + "cType": "TSequence **", + "canonical": "TSequence **" + }, + { + "name": "sync2", + "cType": "TSequence **", + "canonical": "TSequence **" + }, + { + "name": "interpoint", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tfloatsegm_intersection_value", + "file": "tsequence.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "start", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "end", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "lower", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "upper", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "t", + "cType": "TimestampTz *", + "canonical": "long *" + } + ] + }, + { + "name": "tsegment_intersection_value", + "file": "tsequence.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "start", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "end", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "temptype", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "lower", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "upper", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "t1", + "cType": "TimestampTz *", + "canonical": "long *" + }, + { + "name": "t2", + "cType": "TimestampTz *", + "canonical": "long *" + } + ] + }, + { + "name": "tsegment_intersection", + "file": "tsequence.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "start1", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "end1", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "start2", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "end2", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "temptype", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "lower", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "upper", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "t1", + "cType": "TimestampTz *", + "canonical": "long *" + }, + { + "name": "t2", + "cType": "TimestampTz *", + "canonical": "long *" + } + ] + }, + { + "name": "tsegment_value_at_timestamptz", + "file": "tsequence.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "start", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "end", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "temptype", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "lower", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "upper", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + } + ] + }, + { + "name": "intersection_tdiscseq_tdiscseq", + "file": "tsequence.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "seq1", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "seq2", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "inter1", + "cType": "TSequence **", + "canonical": "TSequence **" + }, + { + "name": "inter2", + "cType": "TSequence **", + "canonical": "TSequence **" + } + ] + }, + { + "name": "intersection_tcontseq_tdiscseq", + "file": "tsequence.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "seq1", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "seq2", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "inter1", + "cType": "TSequence **", + "canonical": "TSequence **" + }, + { + "name": "inter2", + "cType": "TSequence **", + "canonical": "TSequence **" + } + ] + }, + { + "name": "intersection_tdiscseq_tcontseq", + "file": "tsequence.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "is", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "seq2", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "inter1", + "cType": "TSequence **", + "canonical": "TSequence **" + }, + { + "name": "inter2", + "cType": "TSequence **", + "canonical": "TSequence **" + } + ] + }, + { + "name": "intersection_tsequence_tinstant", + "file": "tsequence.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const TInstant *" + }, + { + "name": "inter1", + "cType": "TInstant **", + "canonical": "TInstant **" + }, + { + "name": "inter2", + "cType": "TInstant **", + "canonical": "TInstant **" + } + ] + }, + { + "name": "intersection_tinstant_tsequence", + "file": "tsequence.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const TInstant *" + }, + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "inter1", + "cType": "TInstant **", + "canonical": "TInstant **" + }, + { + "name": "inter2", + "cType": "TInstant **", + "canonical": "TInstant **" + } + ] + }, + { + "name": "tsequence_to_string", + "file": "tsequence.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + }, + { + "name": "component", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "value_out", + "cType": "outfunc", + "canonical": "char *(*)(unsigned long, MeosType, int)" + } + ] + }, + { + "name": "ensure_increasing_timestamps", + "file": "tsequence.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "inst1", + "cType": "const TInstant *", + "canonical": "const TInstant *" + }, + { + "name": "inst2", + "cType": "const TInstant *", + "canonical": "const TInstant *" + }, + { + "name": "strict", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "bbox_expand", + "file": "tsequence.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "box1", + "cType": "const void *", + "canonical": "const void *" + }, + { + "name": "box2", + "cType": "void *", + "canonical": "void *" + }, + { + "name": "temptype", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "ensure_valid_tinstarr", + "file": "tsequence.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "instants", + "cType": "TInstant **", + "canonical": "TInstant **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "merge", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "tsequence_make_valid", + "file": "tsequence.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "instants", + "cType": "TInstant **", + "canonical": "TInstant **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "lower_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "upper_inc", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "tnumberseq_shift_scale_value_iter", + "file": "tsequence.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "seq", + "cType": "TSequence *", + "canonical": "TSequence *" + }, + { + "name": "origin", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "delta", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "hasdelta", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "scale", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "tsequence_shift_scale_time_iter", + "file": "tsequence.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "seq", + "cType": "TSequence *", + "canonical": "TSequence *" + }, + { + "name": "delta", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "scale", + "cType": "double", + "canonical": "double" + } + ] + }, + { + "name": "tstepseq_to_linear_iter", + "file": "tsequence.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "result", + "cType": "TSequence **", + "canonical": "TSequence **" + } + ] + }, + { + "name": "tstepseq_to_linear", + "file": "tsequence.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + } + ] + }, + { + "name": "tsequence_segments_iter", + "file": "tsequence.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "result", + "cType": "TSequence **", + "canonical": "TSequence **" + } + ] + }, + { + "name": "tsequence_timestamps_iter", + "file": "tsequence.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "result", + "cType": "TimestampTz *", + "canonical": "long *" + } + ] + }, + { + "name": "tsequenceset_find_timestamptz", + "file": "tsequenceset.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const TSequenceSet *" + }, + { + "name": "t", + "cType": "TimestampTz", + "canonical": "long" + }, + { + "name": "loc", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "tseqarr_normalize", + "file": "tsequenceset.h", + "returnType": { + "c": "TSequence **", + "canonical": "TSequence **" + }, + "params": [ + { + "name": "sequences", + "cType": "TSequence **", + "canonical": "TSequence **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "newcount", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "datum_distance", + "file": "tsequenceset.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "value1", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "value2", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "basetype", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "flags", + "cType": "int16", + "canonical": "short" + } + ] + }, + { + "name": "ensure_valid_tinstarr_gaps", + "file": "tsequenceset.h", + "returnType": { + "c": "int *", + "canonical": "int *" + }, + "params": [ + { + "name": "instants", + "cType": "TInstant **", + "canonical": "TInstant **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "merge", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "maxdist", + "cType": "double", + "canonical": "double" + }, + { + "name": "maxt", + "cType": "const Interval *", + "canonical": "const Interval *" + }, + { + "name": "nsplits", + "cType": "int *", + "canonical": "int *" + } + ] + }, + { + "name": "ensure_valid_tseqarr", + "file": "tsequenceset.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "sequences", + "cType": "TSequence **", + "canonical": "TSequence **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "synchronize_tsequenceset_tsequence", + "file": "tsequenceset.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const TSequenceSet *" + }, + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "mode", + "cType": "SyncMode", + "canonical": "SyncMode" + }, + { + "name": "inter1", + "cType": "TSequenceSet **", + "canonical": "TSequenceSet **" + }, + { + "name": "inter2", + "cType": "TSequenceSet **", + "canonical": "TSequenceSet **" + } + ] + }, + { + "name": "synchronize_tsequenceset_tsequenceset", + "file": "tsequenceset.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss1", + "cType": "const TSequenceSet *", + "canonical": "const TSequenceSet *" + }, + { + "name": "ss2", + "cType": "const TSequenceSet *", + "canonical": "const TSequenceSet *" + }, + { + "name": "mode", + "cType": "SyncMode", + "canonical": "SyncMode" + }, + { + "name": "inter1", + "cType": "TSequenceSet **", + "canonical": "TSequenceSet **" + }, + { + "name": "inter2", + "cType": "TSequenceSet **", + "canonical": "TSequenceSet **" + } + ] + }, + { + "name": "intersection_tsequenceset_tinstant", + "file": "tsequenceset.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const TSequenceSet *" + }, + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const TInstant *" + }, + { + "name": "inter1", + "cType": "TInstant **", + "canonical": "TInstant **" + }, + { + "name": "inter2", + "cType": "TInstant **", + "canonical": "TInstant **" + } + ] + }, + { + "name": "intersection_tinstant_tsequenceset", + "file": "tsequenceset.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "inst", + "cType": "const TInstant *", + "canonical": "const TInstant *" + }, + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const TSequenceSet *" + }, + { + "name": "inter1", + "cType": "TInstant **", + "canonical": "TInstant **" + }, + { + "name": "inter2", + "cType": "TInstant **", + "canonical": "TInstant **" + } + ] + }, + { + "name": "intersection_tsequenceset_tdiscseq", + "file": "tsequenceset.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const TSequenceSet *" + }, + { + "name": "is", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "inter1", + "cType": "TSequence **", + "canonical": "TSequence **" + }, + { + "name": "inter2", + "cType": "TSequence **", + "canonical": "TSequence **" + } + ] + }, + { + "name": "intersection_tdiscseq_tsequenceset", + "file": "tsequenceset.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "is", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const TSequenceSet *" + }, + { + "name": "inter1", + "cType": "TSequence **", + "canonical": "TSequence **" + }, + { + "name": "inter2", + "cType": "TSequence **", + "canonical": "TSequence **" + } + ] + }, + { + "name": "intersection_tsequence_tsequenceset", + "file": "tsequenceset.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "seq", + "cType": "const TSequence *", + "canonical": "const TSequence *" + }, + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const TSequenceSet *" + }, + { + "name": "mode", + "cType": "SyncMode", + "canonical": "SyncMode" + }, + { + "name": "inter1", + "cType": "TSequenceSet **", + "canonical": "TSequenceSet **" + }, + { + "name": "inter2", + "cType": "TSequenceSet **", + "canonical": "TSequenceSet **" + } + ] + }, + { + "name": "tsequenceset_to_string", + "file": "tsequenceset.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "ss", + "cType": "const TSequenceSet *", + "canonical": "const TSequenceSet *" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + }, + { + "name": "value_out", + "cType": "outfunc", + "canonical": "char *(*)(unsigned long, MeosType, int)" + } + ] + }, + { + "name": "datum_textcat", + "file": "ttext_funcs.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "l", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "r", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_lower", + "file": "ttext_funcs.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_upper", + "file": "ttext_funcs.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "datum_initcap", + "file": "ttext_funcs.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + } + ] + }, + { + "name": "textfunc_ttext", + "file": "ttext_funcs.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "func", + "cType": "datum_func1", + "canonical": "unsigned long (*)(unsigned long)" + } + ] + }, + { + "name": "textfunc_ttext_text", + "file": "ttext_funcs.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "func", + "cType": "datum_func2", + "canonical": "unsigned long (*)(unsigned long, unsigned long)" + }, + { + "name": "invert", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "textfunc_ttext_ttext", + "file": "ttext_funcs.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "temp1", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "temp2", + "cType": "const Temporal *", + "canonical": "const Temporal *" + }, + { + "name": "func", + "cType": "datum_func2", + "canonical": "unsigned long (*)(unsigned long, unsigned long)" + } + ] + }, + { + "name": "datum_as_wkb", + "file": "type_inout.h", + "returnType": { + "c": "uint8_t *", + "canonical": "unsigned char *" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "variant", + "cType": "uint8_t", + "canonical": "unsigned char" + }, + { + "name": "size_out", + "cType": "size_t *", + "canonical": "unsigned long *" + } + ] + }, + { + "name": "datum_as_hexwkb", + "file": "type_inout.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "variant", + "cType": "uint8_t", + "canonical": "unsigned char" + }, + { + "name": "size", + "cType": "size_t *", + "canonical": "unsigned long *" + } + ] + }, + { + "name": "type_from_wkb", + "file": "type_inout.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "wkb", + "cType": "const uint8_t *", + "canonical": "const unsigned char *" + }, + { + "name": "size", + "cType": "size_t", + "canonical": "unsigned long" + }, + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "type_from_hexwkb", + "file": "type_inout.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "hexwkb", + "cType": "const char *", + "canonical": "const char *" + }, + { + "name": "size", + "cType": "size_t", + "canonical": "unsigned long" + }, + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "ensure_end_input", + "file": "type_parser.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "str", + "cType": "const char **", + "canonical": "const char **" + }, + { + "name": "type", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "p_whitespace", + "file": "type_parser.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "str", + "cType": "const char **", + "canonical": "const char **" + } + ] + }, + { + "name": "p_delimchar", + "file": "type_parser.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "str", + "cType": "const char **", + "canonical": "const char **" + }, + { + "name": "delim", + "cType": "char", + "canonical": "char" + } + ] + }, + { + "name": "p_obrace", + "file": "type_parser.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "str", + "cType": "const char **", + "canonical": "const char **" + } + ] + }, + { + "name": "ensure_obrace", + "file": "type_parser.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "str", + "cType": "const char **", + "canonical": "const char **" + }, + { + "name": "type", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "p_cbrace", + "file": "type_parser.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "str", + "cType": "const char **", + "canonical": "const char **" + } + ] + }, + { + "name": "ensure_cbrace", + "file": "type_parser.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "str", + "cType": "const char **", + "canonical": "const char **" + }, + { + "name": "type", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "p_obracket", + "file": "type_parser.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "str", + "cType": "const char **", + "canonical": "const char **" + } + ] + }, + { + "name": "p_cbracket", + "file": "type_parser.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "str", + "cType": "const char **", + "canonical": "const char **" + } + ] + }, + { + "name": "p_oparen", + "file": "type_parser.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "str", + "cType": "const char **", + "canonical": "const char **" + } + ] + }, + { + "name": "ensure_oparen", + "file": "type_parser.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "str", + "cType": "const char **", + "canonical": "const char **" + }, + { + "name": "type", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "p_cparen", + "file": "type_parser.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "str", + "cType": "const char **", + "canonical": "const char **" + } + ] + }, + { + "name": "ensure_cparen", + "file": "type_parser.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "str", + "cType": "const char **", + "canonical": "const char **" + }, + { + "name": "type", + "cType": "const char *", + "canonical": "const char *" + } + ] + }, + { + "name": "p_comma", + "file": "type_parser.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "str", + "cType": "const char **", + "canonical": "const char **" + } + ] + }, + { + "name": "basetype_parse", + "file": "type_parser.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "str", + "cType": "const char **", + "canonical": "const char **" + }, + { + "name": "basetypid", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "delim", + "cType": "char", + "canonical": "char" + }, + { + "name": "result", + "cType": "Datum *", + "canonical": "unsigned long *" + } + ] + }, + { + "name": "double_parse", + "file": "type_parser.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "str", + "cType": "const char **", + "canonical": "const char **" + }, + { + "name": "result", + "cType": "double *", + "canonical": "double *" + } + ] + }, + { + "name": "elem_parse", + "file": "type_parser.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "str", + "cType": "const char **", + "canonical": "const char **" + }, + { + "name": "basetype", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "result", + "cType": "Datum *", + "canonical": "unsigned long *" + } + ] + }, + { + "name": "set_parse", + "file": "type_parser.h", + "returnType": { + "c": "Set *", + "canonical": "Set *" + }, + "params": [ + { + "name": "str", + "cType": "const char **", + "canonical": "const char **" + }, + { + "name": "basetype", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "span_parse", + "file": "type_parser.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "str", + "cType": "const char **", + "canonical": "const char **" + }, + { + "name": "spantype", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "end", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "span", + "cType": "Span *", + "canonical": "Span *" + } + ] + }, + { + "name": "spanset_parse", + "file": "type_parser.h", + "returnType": { + "c": "SpanSet *", + "canonical": "SpanSet *" + }, + "params": [ + { + "name": "str", + "cType": "const char **", + "canonical": "const char **" + }, + { + "name": "spantype", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "tbox_parse", + "file": "type_parser.h", + "returnType": { + "c": "TBox *", + "canonical": "TBox *" + }, + "params": [ + { + "name": "str", + "cType": "const char **", + "canonical": "const char **" + } + ] + }, + { + "name": "timestamp_parse", + "file": "type_parser.h", + "returnType": { + "c": "TimestampTz", + "canonical": "long" + }, + "params": [ + { + "name": "str", + "cType": "const char **", + "canonical": "const char **" + } + ] + }, + { + "name": "tinstant_parse", + "file": "type_parser.h", + "returnType": { + "c": "TInstant *", + "canonical": "TInstant *" + }, + "params": [ + { + "name": "str", + "cType": "const char **", + "canonical": "const char **" + }, + { + "name": "temptype", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "end", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tdiscseq_parse", + "file": "type_parser.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "str", + "cType": "const char **", + "canonical": "const char **" + }, + { + "name": "temptype", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "tcontseq_parse", + "file": "type_parser.h", + "returnType": { + "c": "TSequence *", + "canonical": "TSequence *" + }, + "params": [ + { + "name": "str", + "cType": "const char **", + "canonical": "const char **" + }, + { + "name": "temptype", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + }, + { + "name": "end", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "tsequenceset_parse", + "file": "type_parser.h", + "returnType": { + "c": "TSequenceSet *", + "canonical": "TSequenceSet *" + }, + "params": [ + { + "name": "str", + "cType": "const char **", + "canonical": "const char **" + }, + { + "name": "temptype", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "interp", + "cType": "interpType", + "canonical": "interpType" + } + ] + }, + { + "name": "temporal_parse", + "file": "type_parser.h", + "returnType": { + "c": "Temporal *", + "canonical": "Temporal *" + }, + "params": [ + { + "name": "str", + "cType": "const char **", + "canonical": "const char **" + }, + { + "name": "temptype", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "datum_copy", + "file": "type_util.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "typid", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "datum_double", + "file": "type_util.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "d", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "double_datum", + "file": "type_util.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "d", + "cType": "double", + "canonical": "double" + }, + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "bstring2bytea", + "file": "type_util.h", + "returnType": { + "c": "bytea *", + "canonical": "struct varlena *" + }, + "params": [ + { + "name": "wkb", + "cType": "const uint8_t *", + "canonical": "const unsigned char *" + }, + { + "name": "size", + "cType": "size_t", + "canonical": "unsigned long" + } + ] + }, + { + "name": "basetype_in", + "file": "type_util.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + }, + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "end", + "cType": "bool", + "canonical": "bool" + }, + { + "name": "result", + "cType": "Datum *", + "canonical": "unsigned long *" + } + ] + }, + { + "name": "basetype_out", + "file": "type_util.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "value", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + }, + { + "name": "maxdd", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "pfree_array", + "file": "type_util.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "array", + "cType": "void **", + "canonical": "void **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "string_escape", + "file": "type_util.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + }, + { + "name": "quotes", + "cType": "int", + "canonical": "int" + }, + { + "name": "result", + "cType": "char **", + "canonical": "char **" + } + ] + }, + { + "name": "string_unescape", + "file": "type_util.h", + "returnType": { + "c": "size_t", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "str", + "cType": "const char *", + "canonical": "const char *" + }, + { + "name": "result", + "cType": "char **", + "canonical": "char **" + } + ] + }, + { + "name": "stringarr_to_string", + "file": "type_util.h", + "returnType": { + "c": "char *", + "canonical": "char *" + }, + "params": [ + { + "name": "strings", + "cType": "char **", + "canonical": "char **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "prefix", + "cType": "char *", + "canonical": "char *" + }, + { + "name": "open", + "cType": "char", + "canonical": "char" + }, + { + "name": "close", + "cType": "char", + "canonical": "char" + }, + { + "name": "quotes", + "cType": "int", + "canonical": "int" + }, + { + "name": "spaces", + "cType": "bool", + "canonical": "bool" + } + ] + }, + { + "name": "datumarr_sort", + "file": "type_util.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "values", + "cType": "Datum *", + "canonical": "unsigned long *" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "basetype", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "tstzarr_sort", + "file": "type_util.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "times", + "cType": "TimestampTz *", + "canonical": "long *" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "spanarr_sort", + "file": "type_util.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "spans", + "cType": "Span *", + "canonical": "Span *" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "tinstarr_sort", + "file": "type_util.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "instants", + "cType": "TInstant **", + "canonical": "TInstant **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "tseqarr_sort", + "file": "type_util.h", + "returnType": { + "c": "void", + "canonical": "void" + }, + "params": [ + { + "name": "sequences", + "cType": "TSequence **", + "canonical": "TSequence **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "datumarr_remove_duplicates", + "file": "type_util.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "values", + "cType": "Datum *", + "canonical": "unsigned long *" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + }, + { + "name": "basetype", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "tstzarr_remove_duplicates", + "file": "type_util.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "values", + "cType": "TimestampTz *", + "canonical": "long *" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "tinstarr_remove_duplicates", + "file": "type_util.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "instants", + "cType": "TInstant **", + "canonical": "TInstant **" + }, + { + "name": "count", + "cType": "int", + "canonical": "int" + } + ] + }, + { + "name": "datum_add", + "file": "type_util.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "l", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "r", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "datum_sub", + "file": "type_util.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "l", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "r", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "datum_mul", + "file": "type_util.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "l", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "r", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "datum_div", + "file": "type_util.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "l", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "r", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "datum_cmp", + "file": "type_util.h", + "returnType": { + "c": "int", + "canonical": "int" + }, + "params": [ + { + "name": "l", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "r", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "datum_eq", + "file": "type_util.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "l", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "r", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "datum_ne", + "file": "type_util.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "l", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "r", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "datum_lt", + "file": "type_util.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "l", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "r", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "datum_le", + "file": "type_util.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "l", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "r", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "datum_gt", + "file": "type_util.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "l", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "r", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "datum_ge", + "file": "type_util.h", + "returnType": { + "c": "bool", + "canonical": "bool" + }, + "params": [ + { + "name": "l", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "r", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "datum2_eq", + "file": "type_util.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "l", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "r", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "datum2_ne", + "file": "type_util.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "l", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "r", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "datum2_lt", + "file": "type_util.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "l", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "r", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "datum2_le", + "file": "type_util.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "l", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "r", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "datum2_gt", + "file": "type_util.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "l", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "r", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "datum2_ge", + "file": "type_util.h", + "returnType": { + "c": "Datum", + "canonical": "unsigned long" + }, + "params": [ + { + "name": "l", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "r", + "cType": "Datum", + "canonical": "unsigned long" + }, + { + "name": "type", + "cType": "MeosType", + "canonical": "MeosType" + } + ] + }, + { + "name": "hypot3d", + "file": "type_util.h", + "returnType": { + "c": "double", + "canonical": "double" + }, + "params": [ + { + "name": "x", + "cType": "double", + "canonical": "double" + }, + { + "name": "y", + "cType": "double", + "canonical": "double" + }, + { + "name": "z", + "cType": "double", + "canonical": "double" + } + ] + } + ], + "structs": [ + { + "name": "Set", + "file": "meos.h", + "fields": [ + { + "name": "vl_len_", + "cType": "int32", + "offset_bits": 0 + }, + { + "name": "settype", + "cType": "uint8", + "offset_bits": 32 + }, + { + "name": "basetype", + "cType": "uint8", + "offset_bits": 40 + }, + { + "name": "flags", + "cType": "int16", + "offset_bits": 48 + }, + { + "name": "count", + "cType": "int32", + "offset_bits": 64 + }, + { + "name": "maxcount", + "cType": "int32", + "offset_bits": 96 + }, + { + "name": "bboxsize", + "cType": "int16", + "offset_bits": 128 + } + ] + }, + { + "name": "Span", + "file": "meos.h", + "fields": [ + { + "name": "spantype", + "cType": "uint8", + "offset_bits": 0 + }, + { + "name": "basetype", + "cType": "uint8", + "offset_bits": 8 + }, + { + "name": "lower_inc", + "cType": "_Bool", + "offset_bits": 16 + }, + { + "name": "upper_inc", + "cType": "_Bool", + "offset_bits": 24 + }, + { + "name": "padding", + "cType": "char[4]", + "offset_bits": 32 + }, + { + "name": "lower", + "cType": "Datum", + "offset_bits": 64 + }, + { + "name": "upper", + "cType": "Datum", + "offset_bits": 128 + } + ] + }, + { + "name": "SpanSet", + "file": "meos.h", + "fields": [ + { + "name": "vl_len_", + "cType": "int32", + "offset_bits": 0 + }, + { + "name": "spansettype", + "cType": "uint8", + "offset_bits": 32 + }, + { + "name": "spantype", + "cType": "uint8", + "offset_bits": 40 + }, + { + "name": "basetype", + "cType": "uint8", + "offset_bits": 48 + }, + { + "name": "padding", + "cType": "char", + "offset_bits": 56 + }, + { + "name": "count", + "cType": "int32", + "offset_bits": 64 + }, + { + "name": "maxcount", + "cType": "int32", + "offset_bits": 96 + }, + { + "name": "span", + "cType": "Span", + "offset_bits": 128 + }, + { + "name": "elems", + "cType": "Span[1]", + "offset_bits": 320 + } + ] + }, + { + "name": "TBox", + "file": "meos.h", + "fields": [ + { + "name": "period", + "cType": "Span", + "offset_bits": 0 + }, + { + "name": "span", + "cType": "Span", + "offset_bits": 192 + }, + { + "name": "flags", + "cType": "int16", + "offset_bits": 384 + } + ] + }, + { + "name": "STBox", + "file": "meos.h", + "fields": [ + { + "name": "period", + "cType": "Span", + "offset_bits": 0 + }, + { + "name": "xmin", + "cType": "double", + "offset_bits": 192 + }, + { + "name": "ymin", + "cType": "double", + "offset_bits": 256 + }, + { + "name": "zmin", + "cType": "double", + "offset_bits": 320 + }, + { + "name": "xmax", + "cType": "double", + "offset_bits": 384 + }, + { + "name": "ymax", + "cType": "double", + "offset_bits": 448 + }, + { + "name": "zmax", + "cType": "double", + "offset_bits": 512 + }, + { + "name": "srid", + "cType": "int32_t", + "offset_bits": 576 + }, + { + "name": "flags", + "cType": "int16", + "offset_bits": 608 + } + ] + }, + { + "name": "Temporal", + "file": "meos.h", + "fields": [ + { + "name": "vl_len_", + "cType": "int32", + "offset_bits": 0 + }, + { + "name": "temptype", + "cType": "uint8", + "offset_bits": 32 + }, + { + "name": "subtype", + "cType": "uint8", + "offset_bits": 40 + }, + { + "name": "flags", + "cType": "int16", + "offset_bits": 48 + } + ] + }, + { + "name": "TInstant", + "file": "meos.h", + "fields": [ + { + "name": "vl_len_", + "cType": "int32", + "offset_bits": 0 + }, + { + "name": "temptype", + "cType": "uint8", + "offset_bits": 32 + }, + { + "name": "subtype", + "cType": "uint8", + "offset_bits": 40 + }, + { + "name": "flags", + "cType": "int16", + "offset_bits": 48 + }, + { + "name": "t", + "cType": "TimestampTz", + "offset_bits": 64 + }, + { + "name": "value", + "cType": "Datum", + "offset_bits": 128 + } + ], + "meosType": "TPointInst" + }, + { + "name": "TSequence", + "file": "meos.h", + "fields": [ + { + "name": "vl_len_", + "cType": "int32", + "offset_bits": 0 + }, + { + "name": "temptype", + "cType": "uint8", + "offset_bits": 32 + }, + { + "name": "subtype", + "cType": "uint8", + "offset_bits": 40 + }, + { + "name": "flags", + "cType": "int16", + "offset_bits": 48 + }, + { + "name": "count", + "cType": "int32", + "offset_bits": 64 + }, + { + "name": "maxcount", + "cType": "int32", + "offset_bits": 96 + }, + { + "name": "bboxsize", + "cType": "int16", + "offset_bits": 128 + }, + { + "name": "padding", + "cType": "char[6]", + "offset_bits": 144 + }, + { + "name": "period", + "cType": "Span", + "offset_bits": 192 + } + ], + "meosType": "TPointSeq" + }, + { + "name": "TSequenceSet", + "file": "meos.h", + "fields": [ + { + "name": "vl_len_", + "cType": "int32", + "offset_bits": 0 + }, + { + "name": "temptype", + "cType": "uint8", + "offset_bits": 32 + }, + { + "name": "subtype", + "cType": "uint8", + "offset_bits": 40 + }, + { + "name": "flags", + "cType": "int16", + "offset_bits": 48 + }, + { + "name": "count", + "cType": "int32", + "offset_bits": 64 + }, + { + "name": "totalcount", + "cType": "int32", + "offset_bits": 96 + }, + { + "name": "maxcount", + "cType": "int32", + "offset_bits": 128 + }, + { + "name": "bboxsize", + "cType": "int16", + "offset_bits": 160 + }, + { + "name": "padding", + "cType": "int16", + "offset_bits": 176 + }, + { + "name": "period", + "cType": "Span", + "offset_bits": 192 + } + ] + }, + { + "name": "Match", + "file": "meos.h", + "fields": [ + { + "name": "i", + "cType": "int", + "offset_bits": 0 + }, + { + "name": "j", + "cType": "int", + "offset_bits": 32 + } + ] + }, + { + "name": "SkipList", + "file": "meos.h", + "fields": [] + }, + { + "name": "MeosArray", + "file": "meos.h", + "fields": [] + }, + { + "name": "RTree", + "file": "meos.h", + "fields": [] + }, + { + "name": "MvtGeom", + "file": "meos_geo.h", + "fields": [ + { + "name": "geom", + "cType": "int *", + "offset_bits": -1 + }, + { + "name": "times", + "cType": "int64 *", + "offset_bits": -1 + }, + { + "name": "count", + "cType": "int", + "offset_bits": -1 + } + ] + }, + { + "name": "SpaceSplit", + "file": "meos_geo.h", + "fields": [ + { + "name": "fragments", + "cType": "Temporal **", + "offset_bits": -1 + }, + { + "name": "bins", + "cType": "int **", + "offset_bits": -1 + }, + { + "name": "count", + "cType": "int", + "offset_bits": -1 + } + ] + }, + { + "name": "SpaceTimeSplit", + "file": "meos_geo.h", + "fields": [ + { + "name": "fragments", + "cType": "Temporal **", + "offset_bits": -1 + }, + { + "name": "space_bins", + "cType": "int **", + "offset_bits": -1 + }, + { + "name": "time_bins", + "cType": "TimestampTz *", + "offset_bits": -1 + }, + { + "name": "count", + "cType": "int", + "offset_bits": -1 + } + ] + }, + { + "name": "Cbuffer", + "file": "meos_cbuffer.h", + "fields": [] + }, + { + "name": "temptype_catalog_struct", + "file": "meos_catalog.h", + "fields": [ + { + "name": "temptype", + "cType": "MeosType", + "offset_bits": 0 + }, + { + "name": "basetype", + "cType": "MeosType", + "offset_bits": 32 + } + ] + }, + { + "name": "settype_catalog_struct", + "file": "meos_catalog.h", + "fields": [ + { + "name": "settype", + "cType": "MeosType", + "offset_bits": 0 + }, + { + "name": "basetype", + "cType": "MeosType", + "offset_bits": 32 + } + ] + }, + { + "name": "spantype_catalog_struct", + "file": "meos_catalog.h", + "fields": [ + { + "name": "spantype", + "cType": "MeosType", + "offset_bits": 0 + }, + { + "name": "basetype", + "cType": "MeosType", + "offset_bits": 32 + } + ] + }, + { + "name": "spansettype_catalog_struct", + "file": "meos_catalog.h", + "fields": [ + { + "name": "spansettype", + "cType": "MeosType", + "offset_bits": 0 + }, + { + "name": "spantype", + "cType": "MeosType", + "offset_bits": 32 + } + ] + }, + { + "name": "SkipListElem", + "file": "meos_internal.h", + "fields": [ + { + "name": "key", + "cType": "void *", + "offset_bits": 0 + }, + { + "name": "value", + "cType": "void *", + "offset_bits": 64 + }, + { + "name": "height", + "cType": "int", + "offset_bits": 128 + }, + { + "name": "next", + "cType": "int[32]", + "offset_bits": 160 + } + ] + }, + { + "name": "double2", + "file": "doublen.h", + "fields": [ + { + "name": "a", + "cType": "double", + "offset_bits": 0 + }, + { + "name": "b", + "cType": "double", + "offset_bits": 64 + } + ] + }, + { + "name": "double3", + "file": "doublen.h", + "fields": [ + { + "name": "a", + "cType": "double", + "offset_bits": 0 + }, + { + "name": "b", + "cType": "double", + "offset_bits": 64 + }, + { + "name": "c", + "cType": "double", + "offset_bits": 128 + } + ] + }, + { + "name": "double4", + "file": "doublen.h", + "fields": [ + { + "name": "a", + "cType": "double", + "offset_bits": 0 + }, + { + "name": "b", + "cType": "double", + "offset_bits": 64 + }, + { + "name": "c", + "cType": "double", + "offset_bits": 128 + }, + { + "name": "d", + "cType": "double", + "offset_bits": 192 + } + ] + }, + { + "name": "STboxNode", + "file": "stbox_index.h", + "fields": [ + { + "name": "left", + "cType": "STBox", + "offset_bits": 0 + }, + { + "name": "right", + "cType": "STBox", + "offset_bits": 640 + } + ] + }, + { + "name": "SortedSTbox", + "file": "stbox_index.h", + "fields": [ + { + "name": "box", + "cType": "STBox", + "offset_bits": 0 + }, + { + "name": "i", + "cType": "int", + "offset_bits": 640 + } + ] + }, + { + "name": "GeoAggregateState", + "file": "tgeo_aggfuncs.h", + "fields": [ + { + "name": "srid", + "cType": "int32_t", + "offset_bits": 0 + }, + { + "name": "hasz", + "cType": "_Bool", + "offset_bits": 32 + } + ] + }, + { + "name": "BitMatrix", + "file": "tgeo_tile.h", + "fields": [ + { + "name": "ndims", + "cType": "int", + "offset_bits": 0 + }, + { + "name": "count", + "cType": "int[4]", + "offset_bits": 32 + }, + { + "name": "byte", + "cType": "uint8_t[1]", + "offset_bits": 160 + } + ] + }, + { + "name": "STboxGridState", + "file": "tgeo_tile.h", + "fields": [ + { + "name": "done", + "cType": "_Bool", + "offset_bits": 0 + }, + { + "name": "hasx", + "cType": "_Bool", + "offset_bits": 8 + }, + { + "name": "hasz", + "cType": "_Bool", + "offset_bits": 16 + }, + { + "name": "hast", + "cType": "_Bool", + "offset_bits": 24 + }, + { + "name": "i", + "cType": "int", + "offset_bits": 32 + }, + { + "name": "xsize", + "cType": "double", + "offset_bits": 64 + }, + { + "name": "ysize", + "cType": "double", + "offset_bits": 128 + }, + { + "name": "zsize", + "cType": "double", + "offset_bits": 192 + }, + { + "name": "tunits", + "cType": "int64", + "offset_bits": 256 + }, + { + "name": "box", + "cType": "STBox", + "offset_bits": 320 + }, + { + "name": "temp", + "cType": "const Temporal *", + "offset_bits": 960 + }, + { + "name": "bm", + "cType": "BitMatrix *", + "offset_bits": 1024 + }, + { + "name": "x", + "cType": "double", + "offset_bits": 1088 + }, + { + "name": "y", + "cType": "double", + "offset_bits": 1152 + }, + { + "name": "z", + "cType": "double", + "offset_bits": 1216 + }, + { + "name": "t", + "cType": "TimestampTz", + "offset_bits": 1280 + }, + { + "name": "ntiles", + "cType": "int", + "offset_bits": 1344 + }, + { + "name": "max_coords", + "cType": "int[4]", + "offset_bits": 1376 + }, + { + "name": "coords", + "cType": "int[4]", + "offset_bits": 1504 + } + ] + }, + { + "name": "ArrowSchema", + "file": "meos_arrow.h", + "fields": [] + }, + { + "name": "ArrowArray", + "file": "meos_arrow.h", + "fields": [] + }, + { + "name": "Npoint", + "file": "meos_npoint.h", + "fields": [ + { + "name": "rid", + "cType": "int64", + "offset_bits": 0 + }, + { + "name": "pos", + "cType": "double", + "offset_bits": 64 + } + ] + }, + { + "name": "Nsegment", + "file": "meos_npoint.h", + "fields": [ + { + "name": "rid", + "cType": "int64", + "offset_bits": 0 + }, + { + "name": "pos1", + "cType": "double", + "offset_bits": 64 + }, + { + "name": "pos2", + "cType": "double", + "offset_bits": 128 + } + ] + }, + { + "name": "Pcpoint", + "file": "meos_pointcloud.h", + "fields": [] + }, + { + "name": "Pcpatch", + "file": "meos_pointcloud.h", + "fields": [] + }, + { + "name": "PCSCHEMA", + "file": "meos_pointcloud.h", + "fields": [] + }, + { + "name": "TPCBox", + "file": "meos_pointcloud.h", + "fields": [ + { + "name": "period", + "cType": "Span", + "offset_bits": 0 + }, + { + "name": "xmin", + "cType": "double", + "offset_bits": 192 + }, + { + "name": "ymin", + "cType": "double", + "offset_bits": 256 + }, + { + "name": "zmin", + "cType": "double", + "offset_bits": 320 + }, + { + "name": "xmax", + "cType": "double", + "offset_bits": 384 + }, + { + "name": "ymax", + "cType": "double", + "offset_bits": 448 + }, + { + "name": "zmax", + "cType": "double", + "offset_bits": 512 + }, + { + "name": "srid", + "cType": "int32_t", + "offset_bits": 576 + }, + { + "name": "pcid", + "cType": "uint32_t", + "offset_bits": 608 + }, + { + "name": "flags", + "cType": "int16", + "offset_bits": 640 + }, + { + "name": "padding", + "cType": "char[6]", + "offset_bits": 656 + } + ] + }, + { + "name": "Pose", + "file": "meos_pose.h", + "fields": [] + }, + { + "name": "PcpointInTpcboxArgs", + "file": "pcpatch_decompose.h", + "fields": [ + { + "name": "box", + "cType": "const TPCBox *", + "offset_bits": 0 + }, + { + "name": "border_inc", + "cType": "_Bool", + "offset_bits": 64 + } + ] + }, + { + "name": "SERIALIZED_POINT", + "file": "pgsql_compat.h", + "fields": [ + { + "name": "size", + "cType": "uint32_t", + "offset_bits": 0 + }, + { + "name": "pcid", + "cType": "uint32_t", + "offset_bits": 32 + }, + { + "name": "data", + "cType": "uint8_t[1]", + "offset_bits": 64 + } + ] + }, + { + "name": "SERIALIZED_PATCH", + "file": "pgsql_compat.h", + "fields": [ + { + "name": "size", + "cType": "uint32_t", + "offset_bits": -1 + }, + { + "name": "pcid", + "cType": "uint32_t", + "offset_bits": -1 + }, + { + "name": "compression", + "cType": "uint32_t", + "offset_bits": -1 + }, + { + "name": "npoints", + "cType": "uint32_t", + "offset_bits": -1 + }, + { + "name": "bounds", + "cType": "int", + "offset_bits": -1 + }, + { + "name": "data", + "cType": "uint8_t[1]", + "offset_bits": -1 + } + ] + }, + { + "name": "AFFINE", + "file": "postgis_ext_defs.in.h", + "fields": [ + { + "name": "afac", + "cType": "double", + "offset_bits": 0 + }, + { + "name": "bfac", + "cType": "double", + "offset_bits": 64 + }, + { + "name": "cfac", + "cType": "double", + "offset_bits": 128 + }, + { + "name": "dfac", + "cType": "double", + "offset_bits": 192 + }, + { + "name": "efac", + "cType": "double", + "offset_bits": 256 + }, + { + "name": "ffac", + "cType": "double", + "offset_bits": 320 + }, + { + "name": "gfac", + "cType": "double", + "offset_bits": 384 + }, + { + "name": "hfac", + "cType": "double", + "offset_bits": 448 + }, + { + "name": "ifac", + "cType": "double", + "offset_bits": 512 + }, + { + "name": "xoff", + "cType": "double", + "offset_bits": 576 + }, + { + "name": "yoff", + "cType": "double", + "offset_bits": 640 + }, + { + "name": "zoff", + "cType": "double", + "offset_bits": 704 + } + ] + }, + { + "name": "BOX3D", + "file": "postgis_ext_defs.in.h", + "fields": [ + { + "name": "xmin", + "cType": "double", + "offset_bits": 0 + }, + { + "name": "ymin", + "cType": "double", + "offset_bits": 64 + }, + { + "name": "zmin", + "cType": "double", + "offset_bits": 128 + }, + { + "name": "xmax", + "cType": "double", + "offset_bits": 192 + }, + { + "name": "ymax", + "cType": "double", + "offset_bits": 256 + }, + { + "name": "zmax", + "cType": "double", + "offset_bits": 320 + }, + { + "name": "srid", + "cType": "int32_t", + "offset_bits": 384 + } + ] + }, + { + "name": "GBOX", + "file": "postgis_ext_defs.in.h", + "fields": [ + { + "name": "flags", + "cType": "lwflags_t", + "offset_bits": 0 + }, + { + "name": "xmin", + "cType": "double", + "offset_bits": 64 + }, + { + "name": "xmax", + "cType": "double", + "offset_bits": 128 + }, + { + "name": "ymin", + "cType": "double", + "offset_bits": 192 + }, + { + "name": "ymax", + "cType": "double", + "offset_bits": 256 + }, + { + "name": "zmin", + "cType": "double", + "offset_bits": 320 + }, + { + "name": "zmax", + "cType": "double", + "offset_bits": 384 + }, + { + "name": "mmin", + "cType": "double", + "offset_bits": 448 + }, + { + "name": "mmax", + "cType": "double", + "offset_bits": 512 + } + ] + }, + { + "name": "SPHEROID", + "file": "postgis_ext_defs.in.h", + "fields": [ + { + "name": "a", + "cType": "double", + "offset_bits": 0 + }, + { + "name": "b", + "cType": "double", + "offset_bits": 64 + }, + { + "name": "f", + "cType": "double", + "offset_bits": 128 + }, + { + "name": "e", + "cType": "double", + "offset_bits": 192 + }, + { + "name": "e_sq", + "cType": "double", + "offset_bits": 256 + }, + { + "name": "radius", + "cType": "double", + "offset_bits": 320 + }, + { + "name": "name", + "cType": "char[20]", + "offset_bits": 384 + } + ] + }, + { + "name": "POINT2D", + "file": "postgis_ext_defs.in.h", + "fields": [ + { + "name": "x", + "cType": "double", + "offset_bits": 0 + }, + { + "name": "y", + "cType": "double", + "offset_bits": 64 + } + ] + }, + { + "name": "POINT3DZ", + "file": "postgis_ext_defs.in.h", + "fields": [ + { + "name": "x", + "cType": "double", + "offset_bits": 0 + }, + { + "name": "y", + "cType": "double", + "offset_bits": 64 + }, + { + "name": "z", + "cType": "double", + "offset_bits": 128 + } + ] + }, + { + "name": "POINT3D", + "file": "postgis_ext_defs.in.h", + "fields": [ + { + "name": "x", + "cType": "double", + "offset_bits": 0 + }, + { + "name": "y", + "cType": "double", + "offset_bits": 64 + }, + { + "name": "z", + "cType": "double", + "offset_bits": 128 + } + ] + }, + { + "name": "POINT3DM", + "file": "postgis_ext_defs.in.h", + "fields": [ + { + "name": "x", + "cType": "double", + "offset_bits": 0 + }, + { + "name": "y", + "cType": "double", + "offset_bits": 64 + }, + { + "name": "m", + "cType": "double", + "offset_bits": 128 + } + ] + }, + { + "name": "POINT4D", + "file": "postgis_ext_defs.in.h", + "fields": [ + { + "name": "x", + "cType": "double", + "offset_bits": 0 + }, + { + "name": "y", + "cType": "double", + "offset_bits": 64 + }, + { + "name": "z", + "cType": "double", + "offset_bits": 128 + }, + { + "name": "m", + "cType": "double", + "offset_bits": 192 + } + ] + }, + { + "name": "POINTARRAY", + "file": "postgis_ext_defs.in.h", + "fields": [ + { + "name": "npoints", + "cType": "uint32_t", + "offset_bits": 0 + }, + { + "name": "maxpoints", + "cType": "uint32_t", + "offset_bits": 32 + }, + { + "name": "flags", + "cType": "lwflags_t", + "offset_bits": 64 + }, + { + "name": "serialized_pointlist", + "cType": "uint8_t *", + "offset_bits": 128 + } + ] + }, + { + "name": "GSERIALIZED", + "file": "postgis_ext_defs.in.h", + "fields": [ + { + "name": "size", + "cType": "uint32_t", + "offset_bits": 0 + }, + { + "name": "srid", + "cType": "uint8_t[3]", + "offset_bits": 32 + }, + { + "name": "gflags", + "cType": "uint8_t", + "offset_bits": 56 + }, + { + "name": "data", + "cType": "uint8_t[1]", + "offset_bits": 64 + } + ] + }, + { + "name": "LWGEOM", + "file": "postgis_ext_defs.in.h", + "fields": [ + { + "name": "bbox", + "cType": "GBOX *", + "offset_bits": 0 + }, + { + "name": "data", + "cType": "void *", + "offset_bits": 64 + }, + { + "name": "srid", + "cType": "int32_t", + "offset_bits": 128 + }, + { + "name": "flags", + "cType": "lwflags_t", + "offset_bits": 160 + }, + { + "name": "type", + "cType": "uint8_t", + "offset_bits": 176 + }, + { + "name": "pad", + "cType": "char[1]", + "offset_bits": 184 + } + ] + }, + { + "name": "LWPOINT", + "file": "postgis_ext_defs.in.h", + "fields": [ + { + "name": "bbox", + "cType": "GBOX *", + "offset_bits": 0 + }, + { + "name": "point", + "cType": "POINTARRAY *", + "offset_bits": 64 + }, + { + "name": "srid", + "cType": "int32_t", + "offset_bits": 128 + }, + { + "name": "flags", + "cType": "lwflags_t", + "offset_bits": 160 + }, + { + "name": "type", + "cType": "uint8_t", + "offset_bits": 176 + }, + { + "name": "pad", + "cType": "char[1]", + "offset_bits": 184 + } + ] + }, + { + "name": "LWLINE", + "file": "postgis_ext_defs.in.h", + "fields": [ + { + "name": "bbox", + "cType": "GBOX *", + "offset_bits": 0 + }, + { + "name": "points", + "cType": "POINTARRAY *", + "offset_bits": 64 + }, + { + "name": "srid", + "cType": "int32_t", + "offset_bits": 128 + }, + { + "name": "flags", + "cType": "lwflags_t", + "offset_bits": 160 + }, + { + "name": "type", + "cType": "uint8_t", + "offset_bits": 176 + }, + { + "name": "pad", + "cType": "char[1]", + "offset_bits": 184 + } + ] + }, + { + "name": "LWTRIANGLE", + "file": "postgis_ext_defs.in.h", + "fields": [ + { + "name": "bbox", + "cType": "GBOX *", + "offset_bits": 0 + }, + { + "name": "points", + "cType": "POINTARRAY *", + "offset_bits": 64 + }, + { + "name": "srid", + "cType": "int32_t", + "offset_bits": 128 + }, + { + "name": "flags", + "cType": "lwflags_t", + "offset_bits": 160 + }, + { + "name": "type", + "cType": "uint8_t", + "offset_bits": 176 + }, + { + "name": "pad", + "cType": "char[1]", + "offset_bits": 184 + } + ] + }, + { + "name": "LWCIRCSTRING", + "file": "postgis_ext_defs.in.h", + "fields": [ + { + "name": "bbox", + "cType": "GBOX *", + "offset_bits": 0 + }, + { + "name": "points", + "cType": "POINTARRAY *", + "offset_bits": 64 + }, + { + "name": "srid", + "cType": "int32_t", + "offset_bits": 128 + }, + { + "name": "flags", + "cType": "lwflags_t", + "offset_bits": 160 + }, + { + "name": "type", + "cType": "uint8_t", + "offset_bits": 176 + }, + { + "name": "pad", + "cType": "char[1]", + "offset_bits": 184 + } + ] + }, + { + "name": "LWPOLY", + "file": "postgis_ext_defs.in.h", + "fields": [ + { + "name": "bbox", + "cType": "GBOX *", + "offset_bits": 0 + }, + { + "name": "rings", + "cType": "POINTARRAY **", + "offset_bits": 64 + }, + { + "name": "srid", + "cType": "int32_t", + "offset_bits": 128 + }, + { + "name": "flags", + "cType": "lwflags_t", + "offset_bits": 160 + }, + { + "name": "type", + "cType": "uint8_t", + "offset_bits": 176 + }, + { + "name": "pad", + "cType": "char[1]", + "offset_bits": 184 + }, + { + "name": "nrings", + "cType": "uint32_t", + "offset_bits": 192 + }, + { + "name": "maxrings", + "cType": "uint32_t", + "offset_bits": 224 + } + ] + }, + { + "name": "LWMPOINT", + "file": "postgis_ext_defs.in.h", + "fields": [ + { + "name": "bbox", + "cType": "GBOX *", + "offset_bits": 0 + }, + { + "name": "geoms", + "cType": "LWPOINT **", + "offset_bits": 64 + }, + { + "name": "srid", + "cType": "int32_t", + "offset_bits": 128 + }, + { + "name": "flags", + "cType": "lwflags_t", + "offset_bits": 160 + }, + { + "name": "type", + "cType": "uint8_t", + "offset_bits": 176 + }, + { + "name": "pad", + "cType": "char[1]", + "offset_bits": 184 + }, + { + "name": "ngeoms", + "cType": "uint32_t", + "offset_bits": 192 + }, + { + "name": "maxgeoms", + "cType": "uint32_t", + "offset_bits": 224 + } + ] + }, + { + "name": "LWMLINE", + "file": "postgis_ext_defs.in.h", + "fields": [ + { + "name": "bbox", + "cType": "GBOX *", + "offset_bits": 0 + }, + { + "name": "geoms", + "cType": "LWLINE **", + "offset_bits": 64 + }, + { + "name": "srid", + "cType": "int32_t", + "offset_bits": 128 + }, + { + "name": "flags", + "cType": "lwflags_t", + "offset_bits": 160 + }, + { + "name": "type", + "cType": "uint8_t", + "offset_bits": 176 + }, + { + "name": "pad", + "cType": "char[1]", + "offset_bits": 184 + }, + { + "name": "ngeoms", + "cType": "uint32_t", + "offset_bits": 192 + }, + { + "name": "maxgeoms", + "cType": "uint32_t", + "offset_bits": 224 + } + ] + }, + { + "name": "LWMPOLY", + "file": "postgis_ext_defs.in.h", + "fields": [ + { + "name": "bbox", + "cType": "GBOX *", + "offset_bits": 0 + }, + { + "name": "geoms", + "cType": "LWPOLY **", + "offset_bits": 64 + }, + { + "name": "srid", + "cType": "int32_t", + "offset_bits": 128 + }, + { + "name": "flags", + "cType": "lwflags_t", + "offset_bits": 160 + }, + { + "name": "type", + "cType": "uint8_t", + "offset_bits": 176 + }, + { + "name": "pad", + "cType": "char[1]", + "offset_bits": 184 + }, + { + "name": "ngeoms", + "cType": "uint32_t", + "offset_bits": 192 + }, + { + "name": "maxgeoms", + "cType": "uint32_t", + "offset_bits": 224 + } + ] + }, + { + "name": "LWCOLLECTION", + "file": "postgis_ext_defs.in.h", + "fields": [ + { + "name": "bbox", + "cType": "GBOX *", + "offset_bits": 0 + }, + { + "name": "geoms", + "cType": "LWGEOM **", + "offset_bits": 64 + }, + { + "name": "srid", + "cType": "int32_t", + "offset_bits": 128 + }, + { + "name": "flags", + "cType": "lwflags_t", + "offset_bits": 160 + }, + { + "name": "type", + "cType": "uint8_t", + "offset_bits": 176 + }, + { + "name": "pad", + "cType": "char[1]", + "offset_bits": 184 + }, + { + "name": "ngeoms", + "cType": "uint32_t", + "offset_bits": 192 + }, + { + "name": "maxgeoms", + "cType": "uint32_t", + "offset_bits": 224 + } + ] + }, + { + "name": "LWCOMPOUND", + "file": "postgis_ext_defs.in.h", + "fields": [ + { + "name": "bbox", + "cType": "GBOX *", + "offset_bits": 0 + }, + { + "name": "geoms", + "cType": "LWGEOM **", + "offset_bits": 64 + }, + { + "name": "srid", + "cType": "int32_t", + "offset_bits": 128 + }, + { + "name": "flags", + "cType": "lwflags_t", + "offset_bits": 160 + }, + { + "name": "type", + "cType": "uint8_t", + "offset_bits": 176 + }, + { + "name": "pad", + "cType": "char[1]", + "offset_bits": 184 + }, + { + "name": "ngeoms", + "cType": "uint32_t", + "offset_bits": 192 + }, + { + "name": "maxgeoms", + "cType": "uint32_t", + "offset_bits": 224 + } + ] + }, + { + "name": "LWCURVEPOLY", + "file": "postgis_ext_defs.in.h", + "fields": [ + { + "name": "bbox", + "cType": "GBOX *", + "offset_bits": 0 + }, + { + "name": "rings", + "cType": "LWGEOM **", + "offset_bits": 64 + }, + { + "name": "srid", + "cType": "int32_t", + "offset_bits": 128 + }, + { + "name": "flags", + "cType": "lwflags_t", + "offset_bits": 160 + }, + { + "name": "type", + "cType": "uint8_t", + "offset_bits": 176 + }, + { + "name": "pad", + "cType": "char[1]", + "offset_bits": 184 + }, + { + "name": "nrings", + "cType": "uint32_t", + "offset_bits": 192 + }, + { + "name": "maxrings", + "cType": "uint32_t", + "offset_bits": 224 + } + ] + }, + { + "name": "LWMCURVE", + "file": "postgis_ext_defs.in.h", + "fields": [ + { + "name": "bbox", + "cType": "GBOX *", + "offset_bits": 0 + }, + { + "name": "geoms", + "cType": "LWGEOM **", + "offset_bits": 64 + }, + { + "name": "srid", + "cType": "int32_t", + "offset_bits": 128 + }, + { + "name": "flags", + "cType": "lwflags_t", + "offset_bits": 160 + }, + { + "name": "type", + "cType": "uint8_t", + "offset_bits": 176 + }, + { + "name": "pad", + "cType": "char[1]", + "offset_bits": 184 + }, + { + "name": "ngeoms", + "cType": "uint32_t", + "offset_bits": 192 + }, + { + "name": "maxgeoms", + "cType": "uint32_t", + "offset_bits": 224 + } + ] + }, + { + "name": "LWMSURFACE", + "file": "postgis_ext_defs.in.h", + "fields": [ + { + "name": "bbox", + "cType": "GBOX *", + "offset_bits": 0 + }, + { + "name": "geoms", + "cType": "LWGEOM **", + "offset_bits": 64 + }, + { + "name": "srid", + "cType": "int32_t", + "offset_bits": 128 + }, + { + "name": "flags", + "cType": "lwflags_t", + "offset_bits": 160 + }, + { + "name": "type", + "cType": "uint8_t", + "offset_bits": 176 + }, + { + "name": "pad", + "cType": "char[1]", + "offset_bits": 184 + }, + { + "name": "ngeoms", + "cType": "uint32_t", + "offset_bits": 192 + }, + { + "name": "maxgeoms", + "cType": "uint32_t", + "offset_bits": 224 + } + ] + }, + { + "name": "LWPSURFACE", + "file": "postgis_ext_defs.in.h", + "fields": [ + { + "name": "bbox", + "cType": "GBOX *", + "offset_bits": 0 + }, + { + "name": "geoms", + "cType": "LWPOLY **", + "offset_bits": 64 + }, + { + "name": "srid", + "cType": "int32_t", + "offset_bits": 128 + }, + { + "name": "flags", + "cType": "lwflags_t", + "offset_bits": 160 + }, + { + "name": "type", + "cType": "uint8_t", + "offset_bits": 176 + }, + { + "name": "pad", + "cType": "char[1]", + "offset_bits": 184 + }, + { + "name": "ngeoms", + "cType": "uint32_t", + "offset_bits": 192 + }, + { + "name": "maxgeoms", + "cType": "uint32_t", + "offset_bits": 224 + } + ] + }, + { + "name": "LWTIN", + "file": "postgis_ext_defs.in.h", + "fields": [ + { + "name": "bbox", + "cType": "GBOX *", + "offset_bits": 0 + }, + { + "name": "geoms", + "cType": "LWTRIANGLE **", + "offset_bits": 64 + }, + { + "name": "srid", + "cType": "int32_t", + "offset_bits": 128 + }, + { + "name": "flags", + "cType": "lwflags_t", + "offset_bits": 160 + }, + { + "name": "type", + "cType": "uint8_t", + "offset_bits": 176 + }, + { + "name": "pad", + "cType": "char[1]", + "offset_bits": 184 + }, + { + "name": "ngeoms", + "cType": "uint32_t", + "offset_bits": 192 + }, + { + "name": "maxgeoms", + "cType": "uint32_t", + "offset_bits": 224 + } + ] + }, + { + "name": "PJconsts", + "file": "postgis_ext_defs.in.h", + "fields": [] + }, + { + "name": "LWPROJ", + "file": "postgis_ext_defs.in.h", + "fields": [ + { + "name": "pj", + "cType": "PJ *", + "offset_bits": 0 + }, + { + "name": "pipeline_is_forward", + "cType": "_Bool", + "offset_bits": 64 + }, + { + "name": "source_is_latlong", + "cType": "uint8_t", + "offset_bits": 72 + }, + { + "name": "source_semi_major_metre", + "cType": "double", + "offset_bits": 128 + }, + { + "name": "source_semi_minor_metre", + "cType": "double", + "offset_bits": 192 + } + ] + }, + { + "name": "cfp_elem", + "file": "trgeo_distance.h", + "fields": [ + { + "name": "geom_1", + "cType": "LWGEOM *", + "offset_bits": 0 + }, + { + "name": "geom_2", + "cType": "LWGEOM *", + "offset_bits": 64 + }, + { + "name": "pose_1", + "cType": "Pose *", + "offset_bits": 128 + }, + { + "name": "pose_2", + "cType": "Pose *", + "offset_bits": 192 + }, + { + "name": "free_pose_1", + "cType": "_Bool", + "offset_bits": 256 + }, + { + "name": "free_pose_2", + "cType": "_Bool", + "offset_bits": 264 + }, + { + "name": "cf_1", + "cType": "uint32_t", + "offset_bits": 288 + }, + { + "name": "cf_2", + "cType": "uint32_t", + "offset_bits": 320 + }, + { + "name": "t", + "cType": "TimestampTz", + "offset_bits": 384 + }, + { + "name": "store", + "cType": "_Bool", + "offset_bits": 448 + } + ] + }, + { + "name": "cfp_array", + "file": "trgeo_distance.h", + "fields": [ + { + "name": "count", + "cType": "size_t", + "offset_bits": 0 + }, + { + "name": "size", + "cType": "size_t", + "offset_bits": 64 + }, + { + "name": "arr", + "cType": "cfp_elem *", + "offset_bits": 128 + } + ] + }, + { + "name": "tdist_elem", + "file": "trgeo_distance.h", + "fields": [ + { + "name": "dist", + "cType": "double", + "offset_bits": 0 + }, + { + "name": "t", + "cType": "TimestampTz", + "offset_bits": 64 + } + ] + }, + { + "name": "tdist_array", + "file": "trgeo_distance.h", + "fields": [ + { + "name": "count", + "cType": "size_t", + "offset_bits": 0 + }, + { + "name": "size", + "cType": "size_t", + "offset_bits": 64 + }, + { + "name": "arr", + "cType": "tdist_elem *", + "offset_bits": 128 + } + ] + }, + { + "name": "SpanBound", + "file": "span.h", + "fields": [ + { + "name": "val", + "cType": "Datum", + "offset_bits": 0 + }, + { + "name": "inclusive", + "cType": "_Bool", + "offset_bits": 64 + }, + { + "name": "lower", + "cType": "_Bool", + "offset_bits": 72 + }, + { + "name": "spantype", + "cType": "uint8", + "offset_bits": 80 + }, + { + "name": "basetype", + "cType": "uint8", + "offset_bits": 88 + } + ] + }, + { + "name": "LiftedFunctionInfo", + "file": "lifting.h", + "fields": [ + { + "name": "func", + "cType": "varfunc", + "offset_bits": 0 + }, + { + "name": "numparam", + "cType": "int", + "offset_bits": 64 + }, + { + "name": "param", + "cType": "Datum[5]", + "offset_bits": 128 + }, + { + "name": "argtype", + "cType": "MeosType[2]", + "offset_bits": 448 + }, + { + "name": "restype", + "cType": "MeosType", + "offset_bits": 512 + }, + { + "name": "reserror", + "cType": "Datum", + "offset_bits": 576 + }, + { + "name": "resnull", + "cType": "int", + "offset_bits": 640 + }, + { + "name": "reslinear", + "cType": "_Bool", + "offset_bits": 672 + }, + { + "name": "invert", + "cType": "_Bool", + "offset_bits": 680 + }, + { + "name": "discont", + "cType": "_Bool", + "offset_bits": 688 + }, + { + "name": "ever", + "cType": "_Bool", + "offset_bits": 696 + }, + { + "name": "tpfn_unary", + "cType": "tpfunc_unary", + "offset_bits": 704 + }, + { + "name": "tpfn_adaptive", + "cType": "_Bool", + "offset_bits": 768 + }, + { + "name": "tpfn_set", + "cType": "tpfunc_set", + "offset_bits": 832 + }, + { + "name": "cross_type", + "cType": "_Bool", + "offset_bits": 896 + }, + { + "name": "tpfn_base", + "cType": "tpfunc_base", + "offset_bits": 960 + }, + { + "name": "tpfn_temp", + "cType": "tpfunc_temp", + "offset_bits": 1024 + } + ] + }, + { + "name": "SetUnnestState", + "file": "set.h", + "fields": [ + { + "name": "done", + "cType": "_Bool", + "offset_bits": 0 + }, + { + "name": "i", + "cType": "int", + "offset_bits": 32 + }, + { + "name": "count", + "cType": "int", + "offset_bits": 64 + }, + { + "name": "set", + "cType": "Set *", + "offset_bits": 128 + }, + { + "name": "values", + "cType": "Datum *", + "offset_bits": 192 + } + ] + }, + { + "name": "SpanNode", + "file": "span_index.h", + "fields": [ + { + "name": "left", + "cType": "Span", + "offset_bits": 0 + }, + { + "name": "right", + "cType": "Span", + "offset_bits": 192 + } + ] + }, + { + "name": "SortedSpan", + "file": "span_index.h", + "fields": [ + { + "name": "s", + "cType": "Span", + "offset_bits": 0 + }, + { + "name": "i", + "cType": "int", + "offset_bits": 192 + } + ] + }, + { + "name": "TboxNode", + "file": "tbox_index.h", + "fields": [ + { + "name": "left", + "cType": "TBox", + "offset_bits": 0 + }, + { + "name": "right", + "cType": "TBox", + "offset_bits": 448 + } + ] + }, + { + "name": "SortedTbox", + "file": "tbox_index.h", + "fields": [ + { + "name": "box", + "cType": "TBox", + "offset_bits": 0 + }, + { + "name": "i", + "cType": "int", + "offset_bits": 448 + } + ] + }, + { + "name": "DggsCellOps", + "file": "tcellindex.h", + "fields": [ + { + "name": "celltype", + "cType": "MeosType", + "offset_bits": 0 + }, + { + "name": "settype", + "cType": "MeosType", + "offset_bits": 32 + }, + { + "name": "temptype", + "cType": "MeosType", + "offset_bits": 64 + }, + { + "name": "min_resolution", + "cType": "int32", + "offset_bits": 96 + }, + { + "name": "max_resolution", + "cType": "int32", + "offset_bits": 128 + }, + { + "name": "point_temptype", + "cType": "MeosType", + "offset_bits": 160 + }, + { + "name": "point_srid", + "cType": "int32", + "offset_bits": 192 + }, + { + "name": "get_resolution", + "cType": "Datum (*)(Datum)", + "offset_bits": 256 + }, + { + "name": "is_valid_cell", + "cType": "Datum (*)(Datum)", + "offset_bits": 320 + }, + { + "name": "cell_to_parent", + "cType": "Datum (*)(Datum, Datum)", + "offset_bits": 384 + }, + { + "name": "cell_to_point", + "cType": "Datum (*)(Datum)", + "offset_bits": 448 + }, + { + "name": "cell_to_boundary", + "cType": "Datum (*)(Datum)", + "offset_bits": 512 + }, + { + "name": "cell_area", + "cType": "Datum (*)(Datum)", + "offset_bits": 576 + } + ] + }, + { + "name": "SimilarityPathState", + "file": "temporal_analytics.h", + "fields": [ + { + "name": "done", + "cType": "_Bool", + "offset_bits": 0 + }, + { + "name": "i", + "cType": "int", + "offset_bits": 32 + }, + { + "name": "size", + "cType": "int", + "offset_bits": 64 + }, + { + "name": "path", + "cType": "Match *", + "offset_bits": 128 + } + ] + }, + { + "name": "RTreeNode", + "file": "temporal_rtree.h", + "fields": [ + { + "name": "bboxsize", + "cType": "size_t", + "offset_bits": 0 + }, + { + "name": "count", + "cType": "int", + "offset_bits": 64 + }, + { + "name": "node_type", + "cType": "RTreeNodeType", + "offset_bits": 96 + }, + { + "name": "boxes", + "cType": "char[]", + "offset_bits": 4224 + } + ] + }, + { + "name": "SpanBinState", + "file": "temporal_tile.h", + "fields": [ + { + "name": "done", + "cType": "_Bool", + "offset_bits": 0 + }, + { + "name": "basetype", + "cType": "uint8", + "offset_bits": 8 + }, + { + "name": "i", + "cType": "int", + "offset_bits": 32 + }, + { + "name": "size", + "cType": "Datum", + "offset_bits": 64 + }, + { + "name": "origin", + "cType": "Datum", + "offset_bits": 128 + }, + { + "name": "span", + "cType": "Span", + "offset_bits": 192 + }, + { + "name": "to_split", + "cType": "const void *", + "offset_bits": 384 + }, + { + "name": "value", + "cType": "Datum", + "offset_bits": 448 + }, + { + "name": "nbins", + "cType": "int", + "offset_bits": 512 + } + ] + }, + { + "name": "TboxGridState", + "file": "temporal_tile.h", + "fields": [ + { + "name": "done", + "cType": "_Bool", + "offset_bits": 0 + }, + { + "name": "i", + "cType": "int", + "offset_bits": 32 + }, + { + "name": "vsize", + "cType": "Datum", + "offset_bits": 64 + }, + { + "name": "tunits", + "cType": "int64", + "offset_bits": 128 + }, + { + "name": "box", + "cType": "TBox", + "offset_bits": 192 + }, + { + "name": "temp", + "cType": "const Temporal *", + "offset_bits": 640 + }, + { + "name": "value", + "cType": "Datum", + "offset_bits": 704 + }, + { + "name": "t", + "cType": "TimestampTz", + "offset_bits": 768 + }, + { + "name": "ntiles", + "cType": "int", + "offset_bits": 832 + }, + { + "name": "max_coords", + "cType": "int[2]", + "offset_bits": 864 + }, + { + "name": "coords", + "cType": "int[2]", + "offset_bits": 928 + } + ] + }, + { + "name": "ekf_t", + "file": "tinyekf_meos.h", + "fields": [ + { + "name": "x", + "cType": "float", + "offset_bits": -1 + }, + { + "name": "P", + "cType": "float", + "offset_bits": -1 + } + ] + } + ], + "enums": [ + { + "name": "errorCode", + "file": "meos_error.h", + "values": [ + { + "name": "MEOS_SUCCESS", + "value": 0 + }, + { + "name": "MEOS_ERR_INTERNAL_ERROR", + "value": 1 + }, + { + "name": "MEOS_ERR_INTERNAL_TYPE_ERROR", + "value": 2 + }, + { + "name": "MEOS_ERR_VALUE_OUT_OF_RANGE", + "value": 3 + }, + { + "name": "MEOS_ERR_DIVISION_BY_ZERO", + "value": 4 + }, + { + "name": "MEOS_ERR_MEMORY_ALLOC_ERROR", + "value": 5 + }, + { + "name": "MEOS_ERR_AGGREGATION_ERROR", + "value": 6 + }, + { + "name": "MEOS_ERR_DIRECTORY_ERROR", + "value": 7 + }, + { + "name": "MEOS_ERR_FILE_ERROR", + "value": 8 + }, + { + "name": "MEOS_ERR_OUT_OF_MEMORY", + "value": 9 + }, + { + "name": "MEOS_ERR_INVALID_ARG", + "value": 10 + }, + { + "name": "MEOS_ERR_INVALID_ARG_TYPE", + "value": 11 + }, + { + "name": "MEOS_ERR_INVALID_ARG_VALUE", + "value": 12 + }, + { + "name": "MEOS_ERR_FEATURE_NOT_SUPPORTED", + "value": 13 + }, + { + "name": "MEOS_ERR_INDETERMINATE_COLLATION", + "value": 14 + }, + { + "name": "MEOS_ERR_SYNTAX_ERROR", + "value": 15 + }, + { + "name": "MEOS_ERR_NULL_RESULT", + "value": 16 + }, + { + "name": "MEOS_ERR_MFJSON_INPUT", + "value": 20 + }, + { + "name": "MEOS_ERR_MFJSON_OUTPUT", + "value": 21 + }, + { + "name": "MEOS_ERR_TEXT_INPUT", + "value": 22 + }, + { + "name": "MEOS_ERR_TEXT_OUTPUT", + "value": 23 + }, + { + "name": "MEOS_ERR_WKB_INPUT", + "value": 24 + }, + { + "name": "MEOS_ERR_WKB_OUTPUT", + "value": 25 + }, + { + "name": "MEOS_ERR_GEOJSON_INPUT", + "value": 26 + }, + { + "name": "MEOS_ERR_GEOJSON_OUTPUT", + "value": 27 + }, + { + "name": "MEOS_ERR_SQL_JSON_ERROR", + "value": 28 + }, + { + "name": "MEOS_ERR_INVALID_REGULAR_EXPRESSION", + "value": 29 + } + ] + }, + { + "name": "tempSubtype", + "file": "meos.h", + "values": [ + { + "name": "ANYTEMPSUBTYPE", + "value": 0 + }, + { + "name": "TINSTANT", + "value": 1 + }, + { + "name": "TSEQUENCE", + "value": 2 + }, + { + "name": "TSEQUENCESET", + "value": 3 + } + ] + }, + { + "name": "interpType", + "file": "meos.h", + "values": [ + { + "name": "INTERP_NONE", + "value": 0 + }, + { + "name": "DISCRETE", + "value": 1 + }, + { + "name": "STEP", + "value": 2 + }, + { + "name": "LINEAR", + "value": 3 + } + ] + }, + { + "name": "RTreeSearchOp", + "file": "meos.h", + "values": [ + { + "name": "RTREE_OVERLAPS", + "value": 0 + }, + { + "name": "RTREE_CONTAINS", + "value": 1 + }, + { + "name": "RTREE_CONTAINED_BY", + "value": 2 + } + ] + }, + { + "name": "spatialRel", + "file": "meos_geo.h", + "values": [ + { + "name": "INTERSECTS", + "value": 0 + }, + { + "name": "CONTAINS", + "value": 1 + }, + { + "name": "TOUCHES", + "value": 2 + }, + { + "name": "COVERS", + "value": 3 + } + ] + }, + { + "name": "MeosType", + "file": "meos_catalog.h", + "values": [ + { + "name": "T_UNKNOWN", + "value": 0 + }, + { + "name": "T_BOOL", + "value": 1 + }, + { + "name": "T_DATE", + "value": 2 + }, + { + "name": "T_DATEMULTIRANGE", + "value": 3 + }, + { + "name": "T_DATERANGE", + "value": 4 + }, + { + "name": "T_DATESET", + "value": 5 + }, + { + "name": "T_DATESPAN", + "value": 6 + }, + { + "name": "T_DATESPANSET", + "value": 7 + }, + { + "name": "T_DOUBLE2", + "value": 8 + }, + { + "name": "T_DOUBLE3", + "value": 9 + }, + { + "name": "T_DOUBLE4", + "value": 10 + }, + { + "name": "T_FLOAT8", + "value": 11 + }, + { + "name": "T_FLOATSET", + "value": 12 + }, + { + "name": "T_FLOATSPAN", + "value": 13 + }, + { + "name": "T_FLOATSPANSET", + "value": 14 + }, + { + "name": "T_INT4", + "value": 15 + }, + { + "name": "T_INT4MULTIRANGE", + "value": 16 + }, + { + "name": "T_INT4RANGE", + "value": 17 + }, + { + "name": "T_INTSET", + "value": 18 + }, + { + "name": "T_INTSPAN", + "value": 19 + }, + { + "name": "T_INTSPANSET", + "value": 20 + }, + { + "name": "T_INT8", + "value": 21 + }, + { + "name": "T_INT8MULTIRANGE", + "value": 52 + }, + { + "name": "T_INT8RANGE", + "value": 53 + }, + { + "name": "T_BIGINTSET", + "value": 22 + }, + { + "name": "T_BIGINTSPAN", + "value": 23 + }, + { + "name": "T_BIGINTSPANSET", + "value": 24 + }, + { + "name": "T_STBOX", + "value": 25 + }, + { + "name": "T_TBOOL", + "value": 26 + }, + { + "name": "T_TBOX", + "value": 27 + }, + { + "name": "T_TDOUBLE2", + "value": 28 + }, + { + "name": "T_TDOUBLE3", + "value": 29 + }, + { + "name": "T_TDOUBLE4", + "value": 30 + }, + { + "name": "T_TEXT", + "value": 31 + }, + { + "name": "T_TEXTSET", + "value": 32 + }, + { + "name": "T_TFLOAT", + "value": 33 + }, + { + "name": "T_TIMESTAMPTZ", + "value": 34 + }, + { + "name": "T_TINT", + "value": 35 + }, + { + "name": "T_TSTZMULTIRANGE", + "value": 36 + }, + { + "name": "T_TSTZRANGE", + "value": 37 + }, + { + "name": "T_TSTZSET", + "value": 38 + }, + { + "name": "T_TSTZSPAN", + "value": 39 + }, + { + "name": "T_TSTZSPANSET", + "value": 40 + }, + { + "name": "T_TTEXT", + "value": 41 + }, + { + "name": "T_GEOMETRY", + "value": 42 + }, + { + "name": "T_GEOMSET", + "value": 43 + }, + { + "name": "T_GEOGRAPHY", + "value": 44 + }, + { + "name": "T_GEOGSET", + "value": 45 + }, + { + "name": "T_TGEOMPOINT", + "value": 46 + }, + { + "name": "T_TGEOGPOINT", + "value": 47 + }, + { + "name": "T_NPOINT", + "value": 48 + }, + { + "name": "T_NPOINTSET", + "value": 49 + }, + { + "name": "T_NSEGMENT", + "value": 50 + }, + { + "name": "T_TNPOINT", + "value": 51 + }, + { + "name": "T_POSE", + "value": 54 + }, + { + "name": "T_POSESET", + "value": 55 + }, + { + "name": "T_TPOSE", + "value": 56 + }, + { + "name": "T_CBUFFER", + "value": 57 + }, + { + "name": "T_CBUFFERSET", + "value": 58 + }, + { + "name": "T_TCBUFFER", + "value": 59 + }, + { + "name": "T_TGEOMETRY", + "value": 60 + }, + { + "name": "T_TGEOGRAPHY", + "value": 61 + }, + { + "name": "T_TRGEOMETRY", + "value": 62 + }, + { + "name": "T_TBIGINT", + "value": 67 + }, + { + "name": "T_H3INDEX", + "value": 68 + }, + { + "name": "T_H3INDEXSET", + "value": 69 + }, + { + "name": "T_TH3INDEX", + "value": 70 + }, + { + "name": "T_QUADBIN", + "value": 71 + }, + { + "name": "T_QUADBINSET", + "value": 72 + }, + { + "name": "T_TQUADBIN", + "value": 73 + }, + { + "name": "T_PCPOINT", + "value": 74 + }, + { + "name": "T_PCPOINTSET", + "value": 75 + }, + { + "name": "T_TPCPOINT", + "value": 76 + }, + { + "name": "T_PCPATCH", + "value": 77 + }, + { + "name": "T_PCPATCHSET", + "value": 78 + }, + { + "name": "T_TPCPATCH", + "value": 79 + }, + { + "name": "T_TPCBOX", + "value": 80 + }, + { + "name": "NUM_MEOS_TYPES", + "value": 81 + } + ] + }, + { + "name": "MeosOper", + "file": "meos_catalog.h", + "values": [ + { + "name": "UNKNOWN_OP", + "value": 0 + }, + { + "name": "EQ_OP", + "value": 1 + }, + { + "name": "NE_OP", + "value": 2 + }, + { + "name": "LT_OP", + "value": 3 + }, + { + "name": "LE_OP", + "value": 4 + }, + { + "name": "GT_OP", + "value": 5 + }, + { + "name": "GE_OP", + "value": 6 + }, + { + "name": "ADJACENT_OP", + "value": 7 + }, + { + "name": "UNION_OP", + "value": 8 + }, + { + "name": "MINUS_OP", + "value": 9 + }, + { + "name": "INTERSECT_OP", + "value": 10 + }, + { + "name": "OVERLAPS_OP", + "value": 11 + }, + { + "name": "CONTAINS_OP", + "value": 12 + }, + { + "name": "CONTAINED_OP", + "value": 13 + }, + { + "name": "SAME_OP", + "value": 14 + }, + { + "name": "LEFT_OP", + "value": 15 + }, + { + "name": "OVERLEFT_OP", + "value": 16 + }, + { + "name": "RIGHT_OP", + "value": 17 + }, + { + "name": "OVERRIGHT_OP", + "value": 18 + }, + { + "name": "BELOW_OP", + "value": 19 + }, + { + "name": "OVERBELOW_OP", + "value": 20 + }, + { + "name": "ABOVE_OP", + "value": 21 + }, + { + "name": "OVERABOVE_OP", + "value": 22 + }, + { + "name": "FRONT_OP", + "value": 23 + }, + { + "name": "OVERFRONT_OP", + "value": 24 + }, + { + "name": "BACK_OP", + "value": 25 + }, + { + "name": "OVERBACK_OP", + "value": 26 + }, + { + "name": "BEFORE_OP", + "value": 27 + }, + { + "name": "OVERBEFORE_OP", + "value": 28 + }, + { + "name": "AFTER_OP", + "value": 29 + }, + { + "name": "OVERAFTER_OP", + "value": 30 + }, + { + "name": "EVEREQ_OP", + "value": 31 + }, + { + "name": "EVERNE_OP", + "value": 32 + }, + { + "name": "EVERLT_OP", + "value": 33 + }, + { + "name": "EVERLE_OP", + "value": 34 + }, + { + "name": "EVERGT_OP", + "value": 35 + }, + { + "name": "EVERGE_OP", + "value": 36 + }, + { + "name": "ALWAYSEQ_OP", + "value": 37 + }, + { + "name": "ALWAYSNE_OP", + "value": 38 + }, + { + "name": "ALWAYSLT_OP", + "value": 39 + }, + { + "name": "ALWAYSLE_OP", + "value": 40 + }, + { + "name": "ALWAYSGT_OP", + "value": 41 + }, + { + "name": "ALWAYSGE_OP", + "value": 42 + } + ] + }, + { + "name": "SkipListType", + "file": "meos_internal.h", + "values": [ + { + "name": "SKIPLIST_TEMPORAL", + "value": 0 + }, + { + "name": "SKIPLIST_KEYVALUE", + "value": 1 + } + ] + }, + { + "name": "SyncMode", + "file": "temporal.h", + "values": [ + { + "name": "SYNCHRONIZE_NOCROSS", + "value": 0 + }, + { + "name": "SYNCHRONIZE_CROSS", + "value": 1 + } + ] + }, + { + "name": "TemporalFamily", + "file": "temporal.h", + "values": [ + { + "name": "TEMPORALTYPE", + "value": 0 + }, + { + "name": "TNUMBERTYPE", + "value": 1 + }, + { + "name": "TSPATIALTYPE", + "value": 2 + } + ] + }, + { + "name": "SetOper", + "file": "temporal.h", + "values": [ + { + "name": "UNION", + "value": 0 + }, + { + "name": "INTER", + "value": 1 + }, + { + "name": "MINUS", + "value": 2 + } + ] + }, + { + "name": "CompOper", + "file": "temporal.h", + "values": [ + { + "name": "EQ", + "value": 0 + }, + { + "name": "NE", + "value": 1 + }, + { + "name": "LT", + "value": 2 + }, + { + "name": "LE", + "value": 3 + }, + { + "name": "GT", + "value": 4 + }, + { + "name": "GE", + "value": 5 + } + ] + }, + { + "name": "MEOS_WKB_TSUBTYPE", + "file": "temporal.h", + "values": [ + { + "name": "MEOS_WKB_TINSTANT", + "value": 1 + }, + { + "name": "MEOS_WKB_TSEQUENCE", + "value": 2 + }, + { + "name": "MEOS_WKB_TSEQUENCESET", + "value": 3 + } + ] + }, + { + "name": "ClipOper", + "file": "geo_poly_clip.h", + "values": [ + { + "name": "CL_INTERSECTION", + "value": 0 + }, + { + "name": "CL_UNION", + "value": 1 + }, + { + "name": "CL_DIFFERENCE", + "value": 2 + }, + { + "name": "CL_XOR", + "value": 3 + } + ] + }, + { + "name": "H3Unit", + "file": "th3index_internal.h", + "values": [ + { + "name": "H3_UNIT_KM", + "value": 0 + }, + { + "name": "H3_UNIT_M", + "value": 1 + }, + { + "name": "H3_UNIT_RADS", + "value": 2 + }, + { + "name": "H3_UNIT_KM2", + "value": 3 + }, + { + "name": "H3_UNIT_M2", + "value": 4 + }, + { + "name": "H3_UNIT_RADS2", + "value": 5 + } + ] + }, + { + "name": "nullHandleType", + "file": "meos_json.h", + "values": [ + { + "name": "NULL_INVALID", + "value": 0 + }, + { + "name": "NULL_ERROR", + "value": 1 + }, + { + "name": "NULL_JSON_NULL", + "value": 2 + }, + { + "name": "NULL_DELETE", + "value": 3 + }, + { + "name": "NULL_RETURN", + "value": 4 + } + ] + }, + { + "name": "MeosPixType", + "file": "meos_raster.h", + "values": [ + { + "name": "MEOS_PT_UINT8", + "value": 0 + }, + { + "name": "MEOS_PT_INT16", + "value": 1 + }, + { + "name": "MEOS_PT_INT32", + "value": 2 + }, + { + "name": "MEOS_PT_FLOAT32", + "value": 3 + }, + { + "name": "MEOS_PT_FLOAT64", + "value": 4 + } + ] + }, + { + "name": "GeoPoseClass", + "file": "pose_geopose.h", + "values": [ + { + "name": "GEOPOSE_BASIC_QUATERNION", + "value": 0 + }, + { + "name": "GEOPOSE_BASIC_YPR", + "value": 1 + } + ] + }, + { + "name": "SimFunc", + "file": "temporal_analytics.h", + "values": [ + { + "name": "FRECHET", + "value": 0 + }, + { + "name": "DYNTIMEWARP", + "value": 1 + }, + { + "name": "HAUSDORFF", + "value": 2 + } + ] + }, + { + "name": "RTreeNodeType", + "file": "temporal_rtree.h", + "values": [ + { + "name": "RTREE_LEAF", + "value": 0 + }, + { + "name": "RTREE_INNER", + "value": 1 + } + ] + }, + { + "name": "TArithmetic", + "file": "tnumber_mathfuncs.h", + "values": [ + { + "name": "ADD", + "value": 0 + }, + { + "name": "SUB", + "value": 1 + }, + { + "name": "MUL", + "value": 2 + }, + { + "name": "DIV", + "value": 3 + }, + { + "name": "DIST", + "value": 4 + } + ] + } + ] +} \ No newline at end of file diff --git a/tools/codegen/numeric-descriptor.json b/tools/codegen/numeric-descriptor.json new file mode 100644 index 0000000000..737c37fc13 --- /dev/null +++ b/tools/codegen/numeric-descriptor.json @@ -0,0 +1,927 @@ +{ + "_comment": "Numeric + tbool families descriptor; input ac7e7d1469", + "operators": [ + { + "nebula_name": "AddTfloatFloat", + "sql_token": "ADD_TFLOAT_FLOAT", + "meos_call": "add_tfloat_float", + "build_generic": true, + "input_type": "tfloat", + "extra_args": [{"kind": "scalar", "cpp": "double"}], + "return_kind": "extract_double", + "comment_one_liner": "Per-event add_tfloat_float: single-instant tfloat plus scalar float." + }, + { + "nebula_name": "SubTfloatFloat", + "sql_token": "SUB_TFLOAT_FLOAT", + "meos_call": "sub_tfloat_float", + "build_generic": true, + "input_type": "tfloat", + "extra_args": [{"kind": "scalar", "cpp": "double"}], + "return_kind": "extract_double", + "comment_one_liner": "Per-event sub_tfloat_float: single-instant tfloat minus scalar float." + }, + { + "nebula_name": "MulTfloatFloat", + "sql_token": "MUL_TFLOAT_FLOAT", + "meos_call": "mul_tfloat_float", + "build_generic": true, + "input_type": "tfloat", + "extra_args": [{"kind": "scalar", "cpp": "double"}], + "return_kind": "extract_double", + "comment_one_liner": "Per-event mul_tfloat_float: single-instant tfloat times scalar float." + }, + { + "nebula_name": "DivTfloatFloat", + "sql_token": "DIV_TFLOAT_FLOAT", + "meos_call": "div_tfloat_float", + "build_generic": true, + "input_type": "tfloat", + "extra_args": [{"kind": "scalar", "cpp": "double"}], + "return_kind": "extract_double", + "comment_one_liner": "Per-event div_tfloat_float: single-instant tfloat divided by scalar float." + }, + { + "nebula_name": "AddTintInt", + "sql_token": "ADD_TINT_INT", + "meos_call": "add_tint_int", + "build_generic": true, + "input_type": "tint", + "extra_args": [{"kind": "scalar", "cpp": "int32_t"}], + "return_kind": "extract_int", + "comment_one_liner": "Per-event add_tint_int: single-instant tint plus scalar int." + }, + { + "nebula_name": "SubTintInt", + "sql_token": "SUB_TINT_INT", + "meos_call": "sub_tint_int", + "build_generic": true, + "input_type": "tint", + "extra_args": [{"kind": "scalar", "cpp": "int32_t"}], + "return_kind": "extract_int", + "comment_one_liner": "Per-event sub_tint_int: single-instant tint minus scalar int." + }, + { + "nebula_name": "MulTintInt", + "sql_token": "MUL_TINT_INT", + "meos_call": "mul_tint_int", + "build_generic": true, + "input_type": "tint", + "extra_args": [{"kind": "scalar", "cpp": "int32_t"}], + "return_kind": "extract_int", + "comment_one_liner": "Per-event mul_tint_int: single-instant tint times scalar int." + }, + { + "nebula_name": "DivTintInt", + "sql_token": "DIV_TINT_INT", + "meos_call": "div_tint_int", + "build_generic": true, + "input_type": "tint", + "extra_args": [{"kind": "scalar", "cpp": "int32_t"}], + "return_kind": "extract_int", + "comment_one_liner": "Per-event div_tint_int: single-instant tint divided by scalar int." + }, + { + "nebula_name": "AddFloatTfloat", + "sql_token": "ADD_FLOAT_TFLOAT", + "meos_call": "add_float_tfloat", + "build_generic": true, + "input_type": "tfloat", + "extra_args": [{"kind": "scalar", "cpp": "double"}], + "return_kind": "extract_double", + "scalar_first": true, + "comment_one_liner": "Per-event add_float_tfloat: scalar float plus single-instant tfloat." + }, + { + "nebula_name": "SubFloatTfloat", + "sql_token": "SUB_FLOAT_TFLOAT", + "meos_call": "sub_float_tfloat", + "build_generic": true, + "input_type": "tfloat", + "extra_args": [{"kind": "scalar", "cpp": "double"}], + "return_kind": "extract_double", + "scalar_first": true, + "comment_one_liner": "Per-event sub_float_tfloat: scalar float minus single-instant tfloat." + }, + { + "nebula_name": "MulFloatTfloat", + "sql_token": "MUL_FLOAT_TFLOAT", + "meos_call": "mul_float_tfloat", + "build_generic": true, + "input_type": "tfloat", + "extra_args": [{"kind": "scalar", "cpp": "double"}], + "return_kind": "extract_double", + "scalar_first": true, + "comment_one_liner": "Per-event mul_float_tfloat: scalar float times single-instant tfloat." + }, + { + "nebula_name": "DivFloatTfloat", + "sql_token": "DIV_FLOAT_TFLOAT", + "meos_call": "div_float_tfloat", + "build_generic": true, + "input_type": "tfloat", + "extra_args": [{"kind": "scalar", "cpp": "double"}], + "return_kind": "extract_double", + "scalar_first": true, + "comment_one_liner": "Per-event div_float_tfloat: scalar float divided by single-instant tfloat." + }, + { + "nebula_name": "AddIntTint", + "sql_token": "ADD_INT_TINT", + "meos_call": "add_int_tint", + "build_generic": true, + "input_type": "tint", + "extra_args": [{"kind": "scalar", "cpp": "int32_t"}], + "return_kind": "extract_int", + "scalar_first": true, + "comment_one_liner": "Per-event add_int_tint: scalar int plus single-instant tint." + }, + { + "nebula_name": "SubIntTint", + "sql_token": "SUB_INT_TINT", + "meos_call": "sub_int_tint", + "build_generic": true, + "input_type": "tint", + "extra_args": [{"kind": "scalar", "cpp": "int32_t"}], + "return_kind": "extract_int", + "scalar_first": true, + "comment_one_liner": "Per-event sub_int_tint: scalar int minus single-instant tint." + }, + { + "nebula_name": "MulIntTint", + "sql_token": "MUL_INT_TINT", + "meos_call": "mul_int_tint", + "build_generic": true, + "input_type": "tint", + "extra_args": [{"kind": "scalar", "cpp": "int32_t"}], + "return_kind": "extract_int", + "scalar_first": true, + "comment_one_liner": "Per-event mul_int_tint: scalar int times single-instant tint." + }, + { + "nebula_name": "DivIntTint", + "sql_token": "DIV_INT_TINT", + "meos_call": "div_int_tint", + "build_generic": true, + "input_type": "tint", + "extra_args": [{"kind": "scalar", "cpp": "int32_t"}], + "return_kind": "extract_int", + "scalar_first": true, + "comment_one_liner": "Per-event div_int_tint: scalar int divided by single-instant tint." + }, + { + "nebula_name": "AddTbigintBigint", + "sql_token": "ADD_TBIGINT_BIGINT", + "meos_call": "add_tbigint_bigint", + "build_generic": true, + "input_type": "tbigint", + "extra_args": [{"kind": "bigint_scalar"}], + "return_kind": "extract_bigint", + "comment_one_liner": "Per-event add_tbigint_bigint: single-instant tbigint plus scalar bigint." + }, + { + "nebula_name": "SubTbigintBigint", + "sql_token": "SUB_TBIGINT_BIGINT", + "meos_call": "sub_tbigint_bigint", + "build_generic": true, + "input_type": "tbigint", + "extra_args": [{"kind": "bigint_scalar"}], + "return_kind": "extract_bigint", + "comment_one_liner": "Per-event sub_tbigint_bigint: single-instant tbigint minus scalar bigint." + }, + { + "nebula_name": "MulTbigintBigint", + "sql_token": "MUL_TBIGINT_BIGINT", + "meos_call": "mul_tbigint_bigint", + "build_generic": true, + "input_type": "tbigint", + "extra_args": [{"kind": "bigint_scalar"}], + "return_kind": "extract_bigint", + "comment_one_liner": "Per-event mul_tbigint_bigint: single-instant tbigint times scalar bigint." + }, + { + "nebula_name": "DivTbigintBigint", + "sql_token": "DIV_TBIGINT_BIGINT", + "meos_call": "div_tbigint_bigint", + "build_generic": true, + "input_type": "tbigint", + "extra_args": [{"kind": "bigint_scalar"}], + "return_kind": "extract_bigint", + "comment_one_liner": "Per-event div_tbigint_bigint: single-instant tbigint divided by scalar bigint." + }, + { + "nebula_name": "AddBigintTbigint", + "sql_token": "ADD_BIGINT_TBIGINT", + "meos_call": "add_bigint_tbigint", + "build_generic": true, + "input_type": "tbigint", + "extra_args": [{"kind": "bigint_scalar"}], + "return_kind": "extract_bigint", + "scalar_first": true, + "comment_one_liner": "Per-event add_bigint_tbigint: scalar bigint plus single-instant tbigint." + }, + { + "nebula_name": "SubBigintTbigint", + "sql_token": "SUB_BIGINT_TBIGINT", + "meos_call": "sub_bigint_tbigint", + "build_generic": true, + "input_type": "tbigint", + "extra_args": [{"kind": "bigint_scalar"}], + "return_kind": "extract_bigint", + "scalar_first": true, + "comment_one_liner": "Per-event sub_bigint_tbigint: scalar bigint minus single-instant tbigint." + }, + { + "nebula_name": "MulBigintTbigint", + "sql_token": "MUL_BIGINT_TBIGINT", + "meos_call": "mul_bigint_tbigint", + "build_generic": true, + "input_type": "tbigint", + "extra_args": [{"kind": "bigint_scalar"}], + "return_kind": "extract_bigint", + "scalar_first": true, + "comment_one_liner": "Per-event mul_bigint_tbigint: scalar bigint times single-instant tbigint." + }, + { + "nebula_name": "DivBigintTbigint", + "sql_token": "DIV_BIGINT_TBIGINT", + "meos_call": "div_bigint_tbigint", + "build_generic": true, + "input_type": "tbigint", + "extra_args": [{"kind": "bigint_scalar"}], + "return_kind": "extract_bigint", + "scalar_first": true, + "comment_one_liner": "Per-event div_bigint_tbigint: scalar bigint divided by single-instant tbigint." + }, + { + "nebula_name": "AddTnumberTnumber", + "sql_token": "ADD_TNUMBER_TNUMBER", + "meos_call": "add_tnumber_tnumber", + "build_generic": true, + "input_type": "wkb_temporal", + "extra_args": [{"kind": "wkb_temporal"}], + "return_kind": "wkb", + "comment_one_liner": "Per-event add_tnumber_tnumber: two temporal numbers added (WKB result)." + }, + { + "nebula_name": "SubTnumberTnumber", + "sql_token": "SUB_TNUMBER_TNUMBER", + "meos_call": "sub_tnumber_tnumber", + "build_generic": true, + "input_type": "wkb_temporal", + "extra_args": [{"kind": "wkb_temporal"}], + "return_kind": "wkb", + "comment_one_liner": "Per-event sub_tnumber_tnumber: two temporal numbers subtracted (WKB result)." + }, + { + "nebula_name": "MulTnumberTnumber", + "sql_token": "MUL_TNUMBER_TNUMBER", + "meos_call": "mul_tnumber_tnumber", + "build_generic": true, + "input_type": "wkb_temporal", + "extra_args": [{"kind": "wkb_temporal"}], + "return_kind": "wkb", + "comment_one_liner": "Per-event mul_tnumber_tnumber: two temporal numbers multiplied (WKB result)." + }, + { + "nebula_name": "DivTnumberTnumber", + "sql_token": "DIV_TNUMBER_TNUMBER", + "meos_call": "div_tnumber_tnumber", + "build_generic": true, + "input_type": "wkb_temporal", + "extra_args": [{"kind": "wkb_temporal"}], + "return_kind": "wkb", + "comment_one_liner": "Per-event div_tnumber_tnumber: two temporal numbers divided (WKB result)." + }, + { + "nebula_name": "TfloatShiftValue", + "sql_token": "TFLOAT_SHIFT_VALUE", + "meos_call": "tfloat_shift_value", + "build_generic": true, + "input_type": "tfloat", + "extra_args": [{"kind": "scalar", "cpp": "double"}], + "return_kind": "extract_double", + "comment_one_liner": "Per-event tfloat_shift_value: shift single-instant tfloat value by scalar." + }, + { + "nebula_name": "TfloatScaleValue", + "sql_token": "TFLOAT_SCALE_VALUE", + "meos_call": "tfloat_scale_value", + "build_generic": true, + "input_type": "tfloat", + "extra_args": [{"kind": "scalar", "cpp": "double"}], + "return_kind": "extract_double", + "comment_one_liner": "Per-event tfloat_scale_value: scale single-instant tfloat value by scalar." + }, + { + "nebula_name": "TfloatShiftScaleValue", + "sql_token": "TFLOAT_SHIFT_SCALE_VALUE", + "meos_call": "tfloat_shift_scale_value", + "build_generic": true, + "input_type": "tfloat", + "extra_args": [{"kind": "scalar", "cpp": "double"}, {"kind": "scalar", "cpp": "double"}], + "return_kind": "extract_double", + "comment_one_liner": "Per-event tfloat_shift_scale_value: shift then scale single-instant tfloat value." + }, + { + "nebula_name": "TintShiftValue", + "sql_token": "TINT_SHIFT_VALUE", + "meos_call": "tint_shift_value", + "build_generic": true, + "input_type": "tint", + "extra_args": [{"kind": "scalar", "cpp": "int32_t"}], + "return_kind": "extract_int", + "comment_one_liner": "Per-event tint_shift_value: shift single-instant tint value by scalar." + }, + { + "nebula_name": "TintScaleValue", + "sql_token": "TINT_SCALE_VALUE", + "meos_call": "tint_scale_value", + "build_generic": true, + "input_type": "tint", + "extra_args": [{"kind": "scalar", "cpp": "int32_t"}], + "return_kind": "extract_int", + "comment_one_liner": "Per-event tint_scale_value: scale single-instant tint value by scalar." + }, + { + "nebula_name": "TintShiftScaleValue", + "sql_token": "TINT_SHIFT_SCALE_VALUE", + "meos_call": "tint_shift_scale_value", + "build_generic": true, + "input_type": "tint", + "extra_args": [{"kind": "scalar", "cpp": "int32_t"}, {"kind": "scalar", "cpp": "int32_t"}], + "return_kind": "extract_int", + "comment_one_liner": "Per-event tint_shift_scale_value: shift then scale single-instant tint value." + }, + { + "nebula_name": "TbigintShiftValue", + "sql_token": "TBIGINT_SHIFT_VALUE", + "meos_call": "tbigint_shift_value", + "build_generic": true, + "input_type": "tbigint", + "extra_args": [{"kind": "bigint_scalar"}], + "return_kind": "extract_bigint", + "comment_one_liner": "Per-event tbigint_shift_value: shift single-instant tbigint value by scalar." + }, + { + "nebula_name": "TbigintScaleValue", + "sql_token": "TBIGINT_SCALE_VALUE", + "meos_call": "tbigint_scale_value", + "build_generic": true, + "input_type": "tbigint", + "extra_args": [{"kind": "bigint_scalar"}], + "return_kind": "extract_bigint", + "comment_one_liner": "Per-event tbigint_scale_value: scale single-instant tbigint value by scalar." + }, + { + "nebula_name": "TbigintShiftScaleValue", + "sql_token": "TBIGINT_SHIFT_SCALE_VALUE", + "meos_call": "tbigint_shift_scale_value", + "build_generic": true, + "input_type": "tbigint", + "extra_args": [{"kind": "bigint_scalar"}, {"kind": "bigint_scalar"}], + "return_kind": "extract_bigint", + "comment_one_liner": "Per-event tbigint_shift_scale_value: shift then scale single-instant tbigint value." + }, + { + "nebula_name": "TdistanceTfloatFloat", + "sql_token": "TDISTANCE_TFLOAT_FLOAT", + "meos_call": "tdistance_tfloat_float", + "build_generic": true, + "input_type": "tfloat", + "extra_args": [{"kind": "scalar", "cpp": "double"}], + "return_kind": "extract_double", + "comment_one_liner": "Per-event tdistance_tfloat_float: temporal distance between tfloat and scalar float." + }, + { + "nebula_name": "TdistanceTintInt", + "sql_token": "TDISTANCE_TINT_INT", + "meos_call": "tdistance_tint_int", + "build_generic": true, + "input_type": "tint", + "extra_args": [{"kind": "scalar", "cpp": "int32_t"}], + "return_kind": "extract_int", + "comment_one_liner": "Per-event tdistance_tint_int: temporal distance between tint and scalar int." + }, + { + "nebula_name": "TdistanceTnumberTnumber", + "sql_token": "TDISTANCE_TNUMBER_TNUMBER", + "meos_call": "tdistance_tnumber_tnumber", + "build_generic": true, + "input_type": "wkb_temporal", + "extra_args": [{"kind": "wkb_temporal"}], + "return_kind": "wkb", + "comment_one_liner": "Per-event tdistance_tnumber_tnumber: temporal distance between two tnumbers (WKB result)." + }, + { + "nebula_name": "TemporalRound", + "sql_token": "TEMPORAL_ROUND", + "meos_call": "temporal_round", + "build_generic": true, + "input_type": "tfloat", + "extra_args": [{"kind": "int_scalar"}], + "return_kind": "extract_double", + "comment_one_liner": "Per-event temporal_round: round single-instant tfloat to given decimal places." + }, + { + "nebula_name": "EverEqTbigintBigint", + "sql_token": "EVER_EQ_TBIGINT_BIGINT", + "meos_call": "ever_eq_tbigint_bigint", + "build_generic": true, + "input_type": "tbigint", + "extra_args": [{"kind": "bigint_scalar"}], + "return_kind": "int", + "comment_one_liner": "Per-event ever_eq_tbigint_bigint: ever-equal tbigint vs scalar bigint." + }, + { + "nebula_name": "EverNeTbigintBigint", + "sql_token": "EVER_NE_TBIGINT_BIGINT", + "meos_call": "ever_ne_tbigint_bigint", + "build_generic": true, + "input_type": "tbigint", + "extra_args": [{"kind": "bigint_scalar"}], + "return_kind": "int", + "comment_one_liner": "Per-event ever_ne_tbigint_bigint: ever-not-equal tbigint vs scalar bigint." + }, + { + "nebula_name": "EverLtTbigintBigint", + "sql_token": "EVER_LT_TBIGINT_BIGINT", + "meos_call": "ever_lt_tbigint_bigint", + "build_generic": true, + "input_type": "tbigint", + "extra_args": [{"kind": "bigint_scalar"}], + "return_kind": "int", + "comment_one_liner": "Per-event ever_lt_tbigint_bigint: ever-less-than tbigint vs scalar bigint." + }, + { + "nebula_name": "EverLeTbigintBigint", + "sql_token": "EVER_LE_TBIGINT_BIGINT", + "meos_call": "ever_le_tbigint_bigint", + "build_generic": true, + "input_type": "tbigint", + "extra_args": [{"kind": "bigint_scalar"}], + "return_kind": "int", + "comment_one_liner": "Per-event ever_le_tbigint_bigint: ever-less-or-equal tbigint vs scalar bigint." + }, + { + "nebula_name": "EverGtTbigintBigint", + "sql_token": "EVER_GT_TBIGINT_BIGINT", + "meos_call": "ever_gt_tbigint_bigint", + "build_generic": true, + "input_type": "tbigint", + "extra_args": [{"kind": "bigint_scalar"}], + "return_kind": "int", + "comment_one_liner": "Per-event ever_gt_tbigint_bigint: ever-greater-than tbigint vs scalar bigint." + }, + { + "nebula_name": "EverGeTbigintBigint", + "sql_token": "EVER_GE_TBIGINT_BIGINT", + "meos_call": "ever_ge_tbigint_bigint", + "build_generic": true, + "input_type": "tbigint", + "extra_args": [{"kind": "bigint_scalar"}], + "return_kind": "int", + "comment_one_liner": "Per-event ever_ge_tbigint_bigint: ever-greater-or-equal tbigint vs scalar bigint." + }, + { + "nebula_name": "AlwaysEqTbigintBigint", + "sql_token": "ALWAYS_EQ_TBIGINT_BIGINT", + "meos_call": "always_eq_tbigint_bigint", + "build_generic": true, + "input_type": "tbigint", + "extra_args": [{"kind": "bigint_scalar"}], + "return_kind": "int", + "comment_one_liner": "Per-event always_eq_tbigint_bigint: always-equal tbigint vs scalar bigint." + }, + { + "nebula_name": "AlwaysNeTbigintBigint", + "sql_token": "ALWAYS_NE_TBIGINT_BIGINT", + "meos_call": "always_ne_tbigint_bigint", + "build_generic": true, + "input_type": "tbigint", + "extra_args": [{"kind": "bigint_scalar"}], + "return_kind": "int", + "comment_one_liner": "Per-event always_ne_tbigint_bigint: always-not-equal tbigint vs scalar bigint." + }, + { + "nebula_name": "AlwaysLtTbigintBigint", + "sql_token": "ALWAYS_LT_TBIGINT_BIGINT", + "meos_call": "always_lt_tbigint_bigint", + "build_generic": true, + "input_type": "tbigint", + "extra_args": [{"kind": "bigint_scalar"}], + "return_kind": "int", + "comment_one_liner": "Per-event always_lt_tbigint_bigint: always-less-than tbigint vs scalar bigint." + }, + { + "nebula_name": "AlwaysLeTbigintBigint", + "sql_token": "ALWAYS_LE_TBIGINT_BIGINT", + "meos_call": "always_le_tbigint_bigint", + "build_generic": true, + "input_type": "tbigint", + "extra_args": [{"kind": "bigint_scalar"}], + "return_kind": "int", + "comment_one_liner": "Per-event always_le_tbigint_bigint: always-less-or-equal tbigint vs scalar bigint." + }, + { + "nebula_name": "AlwaysGtTbigintBigint", + "sql_token": "ALWAYS_GT_TBIGINT_BIGINT", + "meos_call": "always_gt_tbigint_bigint", + "build_generic": true, + "input_type": "tbigint", + "extra_args": [{"kind": "bigint_scalar"}], + "return_kind": "int", + "comment_one_liner": "Per-event always_gt_tbigint_bigint: always-greater-than tbigint vs scalar bigint." + }, + { + "nebula_name": "AlwaysGeTbigintBigint", + "sql_token": "ALWAYS_GE_TBIGINT_BIGINT", + "meos_call": "always_ge_tbigint_bigint", + "build_generic": true, + "input_type": "tbigint", + "extra_args": [{"kind": "bigint_scalar"}], + "return_kind": "int", + "comment_one_liner": "Per-event always_ge_tbigint_bigint: always-greater-or-equal tbigint vs scalar bigint." + }, + { + "nebula_name": "EverEqBigintTbigint", + "sql_token": "EVER_EQ_BIGINT_TBIGINT", + "meos_call": "ever_eq_bigint_tbigint", + "build_generic": true, + "input_type": "tbigint", + "extra_args": [{"kind": "bigint_scalar"}], + "return_kind": "int", + "scalar_first": true, + "comment_one_liner": "Per-event ever_eq_bigint_tbigint: ever-equal scalar bigint vs tbigint." + }, + { + "nebula_name": "EverNeBigintTbigint", + "sql_token": "EVER_NE_BIGINT_TBIGINT", + "meos_call": "ever_ne_bigint_tbigint", + "build_generic": true, + "input_type": "tbigint", + "extra_args": [{"kind": "bigint_scalar"}], + "return_kind": "int", + "scalar_first": true, + "comment_one_liner": "Per-event ever_ne_bigint_tbigint: ever-not-equal scalar bigint vs tbigint." + }, + { + "nebula_name": "EverLtBigintTbigint", + "sql_token": "EVER_LT_BIGINT_TBIGINT", + "meos_call": "ever_lt_bigint_tbigint", + "build_generic": true, + "input_type": "tbigint", + "extra_args": [{"kind": "bigint_scalar"}], + "return_kind": "int", + "scalar_first": true, + "comment_one_liner": "Per-event ever_lt_bigint_tbigint: ever-less-than scalar bigint vs tbigint." + }, + { + "nebula_name": "EverLeBigintTbigint", + "sql_token": "EVER_LE_BIGINT_TBIGINT", + "meos_call": "ever_le_bigint_tbigint", + "build_generic": true, + "input_type": "tbigint", + "extra_args": [{"kind": "bigint_scalar"}], + "return_kind": "int", + "scalar_first": true, + "comment_one_liner": "Per-event ever_le_bigint_tbigint: ever-less-or-equal scalar bigint vs tbigint." + }, + { + "nebula_name": "EverGtBigintTbigint", + "sql_token": "EVER_GT_BIGINT_TBIGINT", + "meos_call": "ever_gt_bigint_tbigint", + "build_generic": true, + "input_type": "tbigint", + "extra_args": [{"kind": "bigint_scalar"}], + "return_kind": "int", + "scalar_first": true, + "comment_one_liner": "Per-event ever_gt_bigint_tbigint: ever-greater-than scalar bigint vs tbigint." + }, + { + "nebula_name": "EverGeBigintTbigint", + "sql_token": "EVER_GE_BIGINT_TBIGINT", + "meos_call": "ever_ge_bigint_tbigint", + "build_generic": true, + "input_type": "tbigint", + "extra_args": [{"kind": "bigint_scalar"}], + "return_kind": "int", + "scalar_first": true, + "comment_one_liner": "Per-event ever_ge_bigint_tbigint: ever-greater-or-equal scalar bigint vs tbigint." + }, + { + "nebula_name": "AlwaysEqBigintTbigint", + "sql_token": "ALWAYS_EQ_BIGINT_TBIGINT", + "meos_call": "always_eq_bigint_tbigint", + "build_generic": true, + "input_type": "tbigint", + "extra_args": [{"kind": "bigint_scalar"}], + "return_kind": "int", + "scalar_first": true, + "comment_one_liner": "Per-event always_eq_bigint_tbigint: always-equal scalar bigint vs tbigint." + }, + { + "nebula_name": "AlwaysNeBigintTbigint", + "sql_token": "ALWAYS_NE_BIGINT_TBIGINT", + "meos_call": "always_ne_bigint_tbigint", + "build_generic": true, + "input_type": "tbigint", + "extra_args": [{"kind": "bigint_scalar"}], + "return_kind": "int", + "scalar_first": true, + "comment_one_liner": "Per-event always_ne_bigint_tbigint: always-not-equal scalar bigint vs tbigint." + }, + { + "nebula_name": "AlwaysLtBigintTbigint", + "sql_token": "ALWAYS_LT_BIGINT_TBIGINT", + "meos_call": "always_lt_bigint_tbigint", + "build_generic": true, + "input_type": "tbigint", + "extra_args": [{"kind": "bigint_scalar"}], + "return_kind": "int", + "scalar_first": true, + "comment_one_liner": "Per-event always_lt_bigint_tbigint: always-less-than scalar bigint vs tbigint." + }, + { + "nebula_name": "AlwaysLeBigintTbigint", + "sql_token": "ALWAYS_LE_BIGINT_TBIGINT", + "meos_call": "always_le_bigint_tbigint", + "build_generic": true, + "input_type": "tbigint", + "extra_args": [{"kind": "bigint_scalar"}], + "return_kind": "int", + "scalar_first": true, + "comment_one_liner": "Per-event always_le_bigint_tbigint: always-less-or-equal scalar bigint vs tbigint." + }, + { + "nebula_name": "AlwaysGtBigintTbigint", + "sql_token": "ALWAYS_GT_BIGINT_TBIGINT", + "meos_call": "always_gt_bigint_tbigint", + "build_generic": true, + "input_type": "tbigint", + "extra_args": [{"kind": "bigint_scalar"}], + "return_kind": "int", + "scalar_first": true, + "comment_one_liner": "Per-event always_gt_bigint_tbigint: always-greater-than scalar bigint vs tbigint." + }, + { + "nebula_name": "AlwaysGeBigintTbigint", + "sql_token": "ALWAYS_GE_BIGINT_TBIGINT", + "meos_call": "always_ge_bigint_tbigint", + "build_generic": true, + "input_type": "tbigint", + "extra_args": [{"kind": "bigint_scalar"}], + "return_kind": "int", + "scalar_first": true, + "comment_one_liner": "Per-event always_ge_bigint_tbigint: always-greater-or-equal scalar bigint vs tbigint." + }, + { + "nebula_name": "EverEqTboolBool", + "sql_token": "EVER_EQ_TBOOL_BOOL", + "meos_call": "ever_eq_tbool_bool", + "build_generic": true, + "input_type": "tbool", + "extra_args": [{"kind": "bool_scalar"}], + "return_kind": "int", + "comment_one_liner": "Per-event ever_eq_tbool_bool: ever-equal tbool vs scalar bool." + }, + { + "nebula_name": "EverNeTboolBool", + "sql_token": "EVER_NE_TBOOL_BOOL", + "meos_call": "ever_ne_tbool_bool", + "build_generic": true, + "input_type": "tbool", + "extra_args": [{"kind": "bool_scalar"}], + "return_kind": "int", + "comment_one_liner": "Per-event ever_ne_tbool_bool: ever-not-equal tbool vs scalar bool." + }, + { + "nebula_name": "AlwaysEqTboolBool", + "sql_token": "ALWAYS_EQ_TBOOL_BOOL", + "meos_call": "always_eq_tbool_bool", + "build_generic": true, + "input_type": "tbool", + "extra_args": [{"kind": "bool_scalar"}], + "return_kind": "int", + "comment_one_liner": "Per-event always_eq_tbool_bool: always-equal tbool vs scalar bool." + }, + { + "nebula_name": "AlwaysNeTboolBool", + "sql_token": "ALWAYS_NE_TBOOL_BOOL", + "meos_call": "always_ne_tbool_bool", + "build_generic": true, + "input_type": "tbool", + "extra_args": [{"kind": "bool_scalar"}], + "return_kind": "int", + "comment_one_liner": "Per-event always_ne_tbool_bool: always-not-equal tbool vs scalar bool." + }, + { + "nebula_name": "EverEqBoolTbool", + "sql_token": "EVER_EQ_BOOL_TBOOL", + "meos_call": "ever_eq_bool_tbool", + "build_generic": true, + "input_type": "tbool", + "extra_args": [{"kind": "bool_scalar"}], + "return_kind": "int", + "scalar_first": true, + "comment_one_liner": "Per-event ever_eq_bool_tbool: ever-equal scalar bool vs tbool." + }, + { + "nebula_name": "EverNeBoolTbool", + "sql_token": "EVER_NE_BOOL_TBOOL", + "meos_call": "ever_ne_bool_tbool", + "build_generic": true, + "input_type": "tbool", + "extra_args": [{"kind": "bool_scalar"}], + "return_kind": "int", + "scalar_first": true, + "comment_one_liner": "Per-event ever_ne_bool_tbool: ever-not-equal scalar bool vs tbool." + }, + { + "nebula_name": "AlwaysEqBoolTbool", + "sql_token": "ALWAYS_EQ_BOOL_TBOOL", + "meos_call": "always_eq_bool_tbool", + "build_generic": true, + "input_type": "tbool", + "extra_args": [{"kind": "bool_scalar"}], + "return_kind": "int", + "scalar_first": true, + "comment_one_liner": "Per-event always_eq_bool_tbool: always-equal scalar bool vs tbool." + }, + { + "nebula_name": "AlwaysNeBoolTbool", + "sql_token": "ALWAYS_NE_BOOL_TBOOL", + "meos_call": "always_ne_bool_tbool", + "build_generic": true, + "input_type": "tbool", + "extra_args": [{"kind": "bool_scalar"}], + "return_kind": "int", + "scalar_first": true, + "comment_one_liner": "Per-event always_ne_bool_tbool: always-not-equal scalar bool vs tbool." + }, + { + "nebula_name": "TbigintToTint", + "sql_token": "TBIGINT_TO_TINT", + "meos_call": "tbigint_to_tint", + "build_generic": true, + "input_type": "tbigint", + "extra_args": [], + "return_kind": "extract_int", + "comment_one_liner": "Per-event tbigint_to_tint: convert single-instant tbigint to tint." + }, + { + "nebula_name": "TbigintToTfloat", + "sql_token": "TBIGINT_TO_TFLOAT", + "meos_call": "tbigint_to_tfloat", + "build_generic": true, + "input_type": "tbigint", + "extra_args": [], + "return_kind": "extract_double", + "comment_one_liner": "Per-event tbigint_to_tfloat: convert single-instant tbigint to tfloat." + }, + { + "nebula_name": "TintToTbigint", + "sql_token": "TINT_TO_TBIGINT", + "meos_call": "tint_to_tbigint", + "build_generic": true, + "input_type": "tint", + "extra_args": [], + "return_kind": "extract_bigint", + "comment_one_liner": "Per-event tint_to_tbigint: convert single-instant tint to tbigint." + }, + { + "nebula_name": "TfloatToTbigint", + "sql_token": "TFLOAT_TO_TBIGINT", + "meos_call": "tfloat_to_tbigint", + "build_generic": true, + "input_type": "tfloat", + "extra_args": [], + "return_kind": "extract_bigint", + "comment_one_liner": "Per-event tfloat_to_tbigint: convert single-instant tfloat to tbigint." + }, + { + "nebula_name": "TboolToTint", + "sql_token": "TBOOL_TO_TINT", + "meos_call": "tbool_to_tint", + "build_generic": true, + "input_type": "tbool", + "extra_args": [], + "return_kind": "extract_int", + "comment_one_liner": "Per-event tbool_to_tint: convert single-instant tbool to tint." + }, + { + "nebula_name": "TnotTbool", + "sql_token": "TNOT_TBOOL", + "meos_call": "tnot_tbool", + "build_generic": true, + "input_type": "tbool", + "extra_args": [], + "return_kind": "extract_bool", + "comment_one_liner": "Per-event tnot_tbool: logical NOT of single-instant tbool." + }, + { + "nebula_name": "TandTboolBool", + "sql_token": "TAND_TBOOL_BOOL", + "meos_call": "tand_tbool_bool", + "build_generic": true, + "input_type": "tbool", + "extra_args": [{"kind": "bool_scalar"}], + "return_kind": "extract_bool", + "comment_one_liner": "Per-event tand_tbool_bool: temporal AND of tbool and scalar bool." + }, + { + "nebula_name": "TorTboolBool", + "sql_token": "TOR_TBOOL_BOOL", + "meos_call": "tor_tbool_bool", + "build_generic": true, + "input_type": "tbool", + "extra_args": [{"kind": "bool_scalar"}], + "return_kind": "extract_bool", + "comment_one_liner": "Per-event tor_tbool_bool: temporal OR of tbool and scalar bool." + }, + { + "nebula_name": "TeqTboolBool", + "sql_token": "TEQ_TBOOL_BOOL", + "meos_call": "teq_tbool_bool", + "build_generic": true, + "input_type": "tbool", + "extra_args": [{"kind": "bool_scalar"}], + "return_kind": "extract_bool", + "comment_one_liner": "Per-event teq_tbool_bool: temporal equality of tbool and scalar bool." + }, + { + "nebula_name": "TneTboolBool", + "sql_token": "TNE_TBOOL_BOOL", + "meos_call": "tne_tbool_bool", + "build_generic": true, + "input_type": "tbool", + "extra_args": [{"kind": "bool_scalar"}], + "return_kind": "extract_bool", + "comment_one_liner": "Per-event tne_tbool_bool: temporal inequality of tbool and scalar bool." + }, + { + "nebula_name": "TandBoolTbool", + "sql_token": "TAND_BOOL_TBOOL", + "meos_call": "tand_bool_tbool", + "build_generic": true, + "input_type": "tbool", + "extra_args": [{"kind": "bool_scalar"}], + "return_kind": "extract_bool", + "scalar_first": true, + "comment_one_liner": "Per-event tand_bool_tbool: temporal AND of scalar bool and tbool." + }, + { + "nebula_name": "TorBoolTbool", + "sql_token": "TOR_BOOL_TBOOL", + "meos_call": "tor_bool_tbool", + "build_generic": true, + "input_type": "tbool", + "extra_args": [{"kind": "bool_scalar"}], + "return_kind": "extract_bool", + "scalar_first": true, + "comment_one_liner": "Per-event tor_bool_tbool: temporal OR of scalar bool and tbool." + }, + { + "nebula_name": "TeqBoolTbool", + "sql_token": "TEQ_BOOL_TBOOL", + "meos_call": "teq_bool_tbool", + "build_generic": true, + "input_type": "tbool", + "extra_args": [{"kind": "bool_scalar"}], + "return_kind": "extract_bool", + "scalar_first": true, + "comment_one_liner": "Per-event teq_bool_tbool: temporal equality of scalar bool and tbool." + }, + { + "nebula_name": "TneBoolTbool", + "sql_token": "TNE_BOOL_TBOOL", + "meos_call": "tne_bool_tbool", + "build_generic": true, + "input_type": "tbool", + "extra_args": [{"kind": "bool_scalar"}], + "return_kind": "extract_bool", + "scalar_first": true, + "comment_one_liner": "Per-event tne_bool_tbool: temporal inequality of scalar bool and tbool." + }, + { + "nebula_name": "TandTboolTbool", + "sql_token": "TAND_TBOOL_TBOOL", + "meos_call": "tand_tbool_tbool", + "build_generic": true, + "input_type": "wkb_temporal", + "extra_args": [{"kind": "wkb_temporal"}], + "return_kind": "wkb", + "comment_one_liner": "Per-event tand_tbool_tbool: temporal AND of two tbool values (WKB result)." + }, + { + "nebula_name": "TorTboolTbool", + "sql_token": "TOR_TBOOL_TBOOL", + "meos_call": "tor_tbool_tbool", + "build_generic": true, + "input_type": "wkb_temporal", + "extra_args": [{"kind": "wkb_temporal"}], + "return_kind": "wkb", + "comment_one_liner": "Per-event tor_tbool_tbool: temporal OR of two tbool values (WKB result)." + } + ] +} diff --git a/tools/codegen/phasec-composed-descriptor.json b/tools/codegen/phasec-composed-descriptor.json new file mode 100644 index 0000000000..ec689a452c --- /dev/null +++ b/tools/codegen/phasec-composed-descriptor.json @@ -0,0 +1,1953 @@ +{ + "_comment": "Phase C composed spatial predicates: tpose/tnpoint composed via tpose_to_tpoint / tnpoint_to_tgeompoint then tgeo predicate. 48 ops: 12 tpose_geo + 12 tpose_tpose + 12 tnpoint_geo + 12 tnpoint_tnpoint (10 int-returning predicates + 2 dwithin per category). Plus 4 NAD (double-returning) ops.", + "operators": [ + { + "nebula_name": "TemporalEIntersectsTPoseGeometry", + "sql_token": "TEMPORAL_EINTERSECTS_TPOSE_GEOMETRY", + "meos_call": "eintersects_tgeo_geo", + "args": [ + { + "name": "x", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "y", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "theta", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "timestamp", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "geometry", + "nautilus_type": "VariableSizedData", + "cpp_type": "const char*" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_tpose_point_via_composition": true, + "comment_one_liner": "Per-event eintersects_tgeo_geo via tpose\u2192tgeompoint composition." + }, + { + "nebula_name": "TemporalAIntersectsTPoseGeometry", + "sql_token": "TEMPORAL_AINTERSECTS_TPOSE_GEOMETRY", + "meos_call": "aintersects_tgeo_geo", + "args": [ + { + "name": "x", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "y", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "theta", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "timestamp", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "geometry", + "nautilus_type": "VariableSizedData", + "cpp_type": "const char*" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_tpose_point_via_composition": true, + "comment_one_liner": "Per-event aintersects_tgeo_geo via tpose\u2192tgeompoint composition." + }, + { + "nebula_name": "TemporalECoversTPoseGeometry", + "sql_token": "TEMPORAL_ECOVERS_TPOSE_GEOMETRY", + "meos_call": "ecovers_tgeo_geo", + "args": [ + { + "name": "x", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "y", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "theta", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "timestamp", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "geometry", + "nautilus_type": "VariableSizedData", + "cpp_type": "const char*" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_tpose_point_via_composition": true, + "comment_one_liner": "Per-event ecovers_tgeo_geo via tpose\u2192tgeompoint composition." + }, + { + "nebula_name": "TemporalEDisjointTPoseGeometry", + "sql_token": "TEMPORAL_EDISJOINT_TPOSE_GEOMETRY", + "meos_call": "edisjoint_tgeo_geo", + "args": [ + { + "name": "x", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "y", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "theta", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "timestamp", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "geometry", + "nautilus_type": "VariableSizedData", + "cpp_type": "const char*" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_tpose_point_via_composition": true, + "comment_one_liner": "Per-event edisjoint_tgeo_geo via tpose\u2192tgeompoint composition." + }, + { + "nebula_name": "TemporalADisjointTPoseGeometry", + "sql_token": "TEMPORAL_ADISJOINT_TPOSE_GEOMETRY", + "meos_call": "adisjoint_tgeo_geo", + "args": [ + { + "name": "x", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "y", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "theta", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "timestamp", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "geometry", + "nautilus_type": "VariableSizedData", + "cpp_type": "const char*" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_tpose_point_via_composition": true, + "comment_one_liner": "Per-event adisjoint_tgeo_geo via tpose\u2192tgeompoint composition." + }, + { + "nebula_name": "TemporalETouchesTPoseGeometry", + "sql_token": "TEMPORAL_ETOUCHES_TPOSE_GEOMETRY", + "meos_call": "etouches_tgeo_geo", + "args": [ + { + "name": "x", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "y", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "theta", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "timestamp", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "geometry", + "nautilus_type": "VariableSizedData", + "cpp_type": "const char*" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_tpose_point_via_composition": true, + "comment_one_liner": "Per-event etouches_tgeo_geo via tpose\u2192tgeompoint composition." + }, + { + "nebula_name": "TemporalATouchesTPoseGeometry", + "sql_token": "TEMPORAL_ATOUCHES_TPOSE_GEOMETRY", + "meos_call": "atouches_tgeo_geo", + "args": [ + { + "name": "x", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "y", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "theta", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "timestamp", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "geometry", + "nautilus_type": "VariableSizedData", + "cpp_type": "const char*" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_tpose_point_via_composition": true, + "comment_one_liner": "Per-event atouches_tgeo_geo via tpose\u2192tgeompoint composition." + }, + { + "nebula_name": "TemporalEContainsTPoseGeometry", + "sql_token": "TEMPORAL_ECONTAINS_TPOSE_GEOMETRY", + "meos_call": "econtains_tgeo_geo", + "args": [ + { + "name": "x", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "y", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "theta", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "timestamp", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "geometry", + "nautilus_type": "VariableSizedData", + "cpp_type": "const char*" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_tpose_point_via_composition": true, + "comment_one_liner": "Per-event econtains_tgeo_geo via tpose\u2192tgeompoint composition." + }, + { + "nebula_name": "TemporalAContainsTPoseGeometry", + "sql_token": "TEMPORAL_ACONTAINS_TPOSE_GEOMETRY", + "meos_call": "acontains_tgeo_geo", + "args": [ + { + "name": "x", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "y", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "theta", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "timestamp", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "geometry", + "nautilus_type": "VariableSizedData", + "cpp_type": "const char*" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_tpose_point_via_composition": true, + "comment_one_liner": "Per-event acontains_tgeo_geo via tpose\u2192tgeompoint composition." + }, + { + "nebula_name": "TemporalEDWithinTPoseGeometry", + "sql_token": "TEMPORAL_EDWITHIN_TPOSE_GEOMETRY", + "meos_call": "edwithin_tgeo_geo", + "args": [ + { + "name": "x", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "y", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "theta", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "timestamp", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "geometry", + "nautilus_type": "VariableSizedData", + "cpp_type": "const char*" + }, + { + "name": "dist", + "nautilus_type": "double", + "cpp_type": "double" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_tpose_point_with_dist_via_composition": true, + "comment_one_liner": "Per-event edwithin_tgeo_geo via tpose\u2192tgeompoint composition." + }, + { + "nebula_name": "TemporalADWithinTPoseGeometry", + "sql_token": "TEMPORAL_ADWITHIN_TPOSE_GEOMETRY", + "meos_call": "adwithin_tgeo_geo", + "args": [ + { + "name": "x", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "y", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "theta", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "timestamp", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "geometry", + "nautilus_type": "VariableSizedData", + "cpp_type": "const char*" + }, + { + "name": "dist", + "nautilus_type": "double", + "cpp_type": "double" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_tpose_point_with_dist_via_composition": true, + "comment_one_liner": "Per-event adwithin_tgeo_geo via tpose\u2192tgeompoint composition." + }, + { + "nebula_name": "TemporalEIntersectsTPoseTPose", + "sql_token": "TEMPORAL_EINTERSECTS_TPOSE_TPOSE", + "meos_call": "eintersects_tgeo_tgeo", + "args": [ + { + "name": "xA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "yA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "thetaA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsA", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "xB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "yB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "thetaB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsB", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_two_tpose_points_via_composition": true, + "comment_one_liner": "Per-event eintersects_tgeo_tgeo via tpose\u00d7tpose\u2192tgeompoint composition." + }, + { + "nebula_name": "TemporalAIntersectsTPoseTPose", + "sql_token": "TEMPORAL_AINTERSECTS_TPOSE_TPOSE", + "meos_call": "aintersects_tgeo_tgeo", + "args": [ + { + "name": "xA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "yA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "thetaA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsA", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "xB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "yB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "thetaB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsB", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_two_tpose_points_via_composition": true, + "comment_one_liner": "Per-event aintersects_tgeo_tgeo via tpose\u00d7tpose\u2192tgeompoint composition." + }, + { + "nebula_name": "TemporalECoversTPoseTPose", + "sql_token": "TEMPORAL_ECOVERS_TPOSE_TPOSE", + "meos_call": "ecovers_tgeo_tgeo", + "args": [ + { + "name": "xA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "yA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "thetaA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsA", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "xB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "yB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "thetaB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsB", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_two_tpose_points_via_composition": true, + "comment_one_liner": "Per-event ecovers_tgeo_tgeo via tpose\u00d7tpose\u2192tgeompoint composition." + }, + { + "nebula_name": "TemporalEDisjointTPoseTPose", + "sql_token": "TEMPORAL_EDISJOINT_TPOSE_TPOSE", + "meos_call": "edisjoint_tgeo_tgeo", + "args": [ + { + "name": "xA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "yA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "thetaA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsA", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "xB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "yB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "thetaB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsB", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_two_tpose_points_via_composition": true, + "comment_one_liner": "Per-event edisjoint_tgeo_tgeo via tpose\u00d7tpose\u2192tgeompoint composition." + }, + { + "nebula_name": "TemporalADisjointTPoseTPose", + "sql_token": "TEMPORAL_ADISJOINT_TPOSE_TPOSE", + "meos_call": "adisjoint_tgeo_tgeo", + "args": [ + { + "name": "xA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "yA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "thetaA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsA", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "xB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "yB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "thetaB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsB", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_two_tpose_points_via_composition": true, + "comment_one_liner": "Per-event adisjoint_tgeo_tgeo via tpose\u00d7tpose\u2192tgeompoint composition." + }, + { + "nebula_name": "TemporalETouchesTPoseTPose", + "sql_token": "TEMPORAL_ETOUCHES_TPOSE_TPOSE", + "meos_call": "etouches_tgeo_tgeo", + "args": [ + { + "name": "xA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "yA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "thetaA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsA", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "xB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "yB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "thetaB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsB", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_two_tpose_points_via_composition": true, + "comment_one_liner": "Per-event etouches_tgeo_tgeo via tpose\u00d7tpose\u2192tgeompoint composition." + }, + { + "nebula_name": "TemporalATouchesTPoseTPose", + "sql_token": "TEMPORAL_ATOUCHES_TPOSE_TPOSE", + "meos_call": "atouches_tgeo_tgeo", + "args": [ + { + "name": "xA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "yA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "thetaA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsA", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "xB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "yB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "thetaB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsB", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_two_tpose_points_via_composition": true, + "comment_one_liner": "Per-event atouches_tgeo_tgeo via tpose\u00d7tpose\u2192tgeompoint composition." + }, + { + "nebula_name": "TemporalEContainsTPoseTPose", + "sql_token": "TEMPORAL_ECONTAINS_TPOSE_TPOSE", + "meos_call": "econtains_tgeo_tgeo", + "args": [ + { + "name": "xA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "yA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "thetaA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsA", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "xB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "yB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "thetaB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsB", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_two_tpose_points_via_composition": true, + "comment_one_liner": "Per-event econtains_tgeo_tgeo via tpose\u00d7tpose\u2192tgeompoint composition." + }, + { + "nebula_name": "TemporalAContainsTPoseTPose", + "sql_token": "TEMPORAL_ACONTAINS_TPOSE_TPOSE", + "meos_call": "acontains_tgeo_tgeo", + "args": [ + { + "name": "xA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "yA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "thetaA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsA", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "xB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "yB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "thetaB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsB", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_two_tpose_points_via_composition": true, + "comment_one_liner": "Per-event acontains_tgeo_tgeo via tpose\u00d7tpose\u2192tgeompoint composition." + }, + { + "nebula_name": "TemporalEDWithinTPoseTPose", + "sql_token": "TEMPORAL_EDWITHIN_TPOSE_TPOSE", + "meos_call": "edwithin_tgeo_tgeo", + "args": [ + { + "name": "xA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "yA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "thetaA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsA", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "xB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "yB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "thetaB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsB", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "dist", + "nautilus_type": "double", + "cpp_type": "double" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_two_tpose_points_with_dist_via_composition": true, + "comment_one_liner": "Per-event edwithin_tgeo_tgeo via tpose\u00d7tpose\u2192tgeompoint composition." + }, + { + "nebula_name": "TemporalADWithinTPoseTPose", + "sql_token": "TEMPORAL_ADWITHIN_TPOSE_TPOSE", + "meos_call": "adwithin_tgeo_tgeo", + "args": [ + { + "name": "xA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "yA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "thetaA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsA", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "xB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "yB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "thetaB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsB", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "dist", + "nautilus_type": "double", + "cpp_type": "double" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_two_tpose_points_with_dist_via_composition": true, + "comment_one_liner": "Per-event adwithin_tgeo_tgeo via tpose\u00d7tpose\u2192tgeompoint composition." + }, + { + "nebula_name": "TemporalNADTPoseGeometry", + "sql_token": "TEMPORAL_NAD_TPOSE_GEOMETRY", + "meos_call": "nad_tgeo_geo", + "args": [ + { + "name": "x", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "y", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "theta", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "timestamp", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "geometry", + "nautilus_type": "VariableSizedData", + "cpp_type": "const char*" + } + ], + "return_type": "double", + "nautilus_return": "FLOAT64", + "build_tpose_point_via_composition": true, + "comment_one_liner": "Per-event nad_tgeo_geo (nearest approach distance) via tpose\u2192tgeompoint composition." + }, + { + "nebula_name": "TemporalNADTPoseTPose", + "sql_token": "TEMPORAL_NAD_TPOSE_TPOSE", + "meos_call": "nad_tgeo_tgeo", + "args": [ + { + "name": "xA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "yA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "thetaA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsA", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "xB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "yB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "thetaB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsB", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + } + ], + "return_type": "double", + "nautilus_return": "FLOAT64", + "build_two_tpose_points_via_composition": true, + "comment_one_liner": "Per-event nad_tgeo_tgeo (nearest approach distance) via tpose\u00d7tpose\u2192tgeompoint composition." + }, + { + "nebula_name": "TemporalEIntersectsTNpointGeometry", + "sql_token": "TEMPORAL_EINTERSECTS_TNPOINT_GEOMETRY", + "meos_call": "eintersects_tgeo_geo", + "args": [ + { + "name": "rid", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "fraction", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "timestamp", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "geometry", + "nautilus_type": "VariableSizedData", + "cpp_type": "const char*" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_tnpoint_point_via_composition": true, + "comment_one_liner": "Per-event eintersects_tgeo_geo via tnpoint\u2192tgeompoint composition." + }, + { + "nebula_name": "TemporalAIntersectsTNpointGeometry", + "sql_token": "TEMPORAL_AINTERSECTS_TNPOINT_GEOMETRY", + "meos_call": "aintersects_tgeo_geo", + "args": [ + { + "name": "rid", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "fraction", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "timestamp", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "geometry", + "nautilus_type": "VariableSizedData", + "cpp_type": "const char*" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_tnpoint_point_via_composition": true, + "comment_one_liner": "Per-event aintersects_tgeo_geo via tnpoint\u2192tgeompoint composition." + }, + { + "nebula_name": "TemporalECoversTNpointGeometry", + "sql_token": "TEMPORAL_ECOVERS_TNPOINT_GEOMETRY", + "meos_call": "ecovers_tgeo_geo", + "args": [ + { + "name": "rid", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "fraction", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "timestamp", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "geometry", + "nautilus_type": "VariableSizedData", + "cpp_type": "const char*" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_tnpoint_point_via_composition": true, + "comment_one_liner": "Per-event ecovers_tgeo_geo via tnpoint\u2192tgeompoint composition." + }, + { + "nebula_name": "TemporalEDisjointTNpointGeometry", + "sql_token": "TEMPORAL_EDISJOINT_TNPOINT_GEOMETRY", + "meos_call": "edisjoint_tgeo_geo", + "args": [ + { + "name": "rid", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "fraction", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "timestamp", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "geometry", + "nautilus_type": "VariableSizedData", + "cpp_type": "const char*" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_tnpoint_point_via_composition": true, + "comment_one_liner": "Per-event edisjoint_tgeo_geo via tnpoint\u2192tgeompoint composition." + }, + { + "nebula_name": "TemporalADisjointTNpointGeometry", + "sql_token": "TEMPORAL_ADISJOINT_TNPOINT_GEOMETRY", + "meos_call": "adisjoint_tgeo_geo", + "args": [ + { + "name": "rid", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "fraction", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "timestamp", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "geometry", + "nautilus_type": "VariableSizedData", + "cpp_type": "const char*" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_tnpoint_point_via_composition": true, + "comment_one_liner": "Per-event adisjoint_tgeo_geo via tnpoint\u2192tgeompoint composition." + }, + { + "nebula_name": "TemporalETouchesTNpointGeometry", + "sql_token": "TEMPORAL_ETOUCHES_TNPOINT_GEOMETRY", + "meos_call": "etouches_tgeo_geo", + "args": [ + { + "name": "rid", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "fraction", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "timestamp", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "geometry", + "nautilus_type": "VariableSizedData", + "cpp_type": "const char*" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_tnpoint_point_via_composition": true, + "comment_one_liner": "Per-event etouches_tgeo_geo via tnpoint\u2192tgeompoint composition." + }, + { + "nebula_name": "TemporalATouchesTNpointGeometry", + "sql_token": "TEMPORAL_ATOUCHES_TNPOINT_GEOMETRY", + "meos_call": "atouches_tgeo_geo", + "args": [ + { + "name": "rid", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "fraction", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "timestamp", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "geometry", + "nautilus_type": "VariableSizedData", + "cpp_type": "const char*" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_tnpoint_point_via_composition": true, + "comment_one_liner": "Per-event atouches_tgeo_geo via tnpoint\u2192tgeompoint composition." + }, + { + "nebula_name": "TemporalEContainsTNpointGeometry", + "sql_token": "TEMPORAL_ECONTAINS_TNPOINT_GEOMETRY", + "meos_call": "econtains_tgeo_geo", + "args": [ + { + "name": "rid", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "fraction", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "timestamp", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "geometry", + "nautilus_type": "VariableSizedData", + "cpp_type": "const char*" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_tnpoint_point_via_composition": true, + "comment_one_liner": "Per-event econtains_tgeo_geo via tnpoint\u2192tgeompoint composition." + }, + { + "nebula_name": "TemporalAContainsTNpointGeometry", + "sql_token": "TEMPORAL_ACONTAINS_TNPOINT_GEOMETRY", + "meos_call": "acontains_tgeo_geo", + "args": [ + { + "name": "rid", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "fraction", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "timestamp", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "geometry", + "nautilus_type": "VariableSizedData", + "cpp_type": "const char*" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_tnpoint_point_via_composition": true, + "comment_one_liner": "Per-event acontains_tgeo_geo via tnpoint\u2192tgeompoint composition." + }, + { + "nebula_name": "TemporalEDWithinTNpointGeometry", + "sql_token": "TEMPORAL_EDWITHIN_TNPOINT_GEOMETRY", + "meos_call": "edwithin_tgeo_geo", + "args": [ + { + "name": "rid", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "fraction", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "timestamp", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "geometry", + "nautilus_type": "VariableSizedData", + "cpp_type": "const char*" + }, + { + "name": "dist", + "nautilus_type": "double", + "cpp_type": "double" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_tnpoint_point_with_dist_via_composition": true, + "comment_one_liner": "Per-event edwithin_tgeo_geo via tnpoint\u2192tgeompoint composition." + }, + { + "nebula_name": "TemporalADWithinTNpointGeometry", + "sql_token": "TEMPORAL_ADWITHIN_TNPOINT_GEOMETRY", + "meos_call": "adwithin_tgeo_geo", + "args": [ + { + "name": "rid", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "fraction", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "timestamp", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "geometry", + "nautilus_type": "VariableSizedData", + "cpp_type": "const char*" + }, + { + "name": "dist", + "nautilus_type": "double", + "cpp_type": "double" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_tnpoint_point_with_dist_via_composition": true, + "comment_one_liner": "Per-event adwithin_tgeo_geo via tnpoint\u2192tgeompoint composition." + }, + { + "nebula_name": "TemporalEIntersectsTNpointTNpoint", + "sql_token": "TEMPORAL_EINTERSECTS_TNPOINT_TNPOINT", + "meos_call": "eintersects_tgeo_tgeo", + "args": [ + { + "name": "ridA", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "fractionA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsA", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "ridB", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "fractionB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsB", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_two_tnpoint_points_via_composition": true, + "comment_one_liner": "Per-event eintersects_tgeo_tgeo via tnpoint\u00d7tnpoint\u2192tgeompoint composition." + }, + { + "nebula_name": "TemporalAIntersectsTNpointTNpoint", + "sql_token": "TEMPORAL_AINTERSECTS_TNPOINT_TNPOINT", + "meos_call": "aintersects_tgeo_tgeo", + "args": [ + { + "name": "ridA", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "fractionA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsA", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "ridB", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "fractionB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsB", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_two_tnpoint_points_via_composition": true, + "comment_one_liner": "Per-event aintersects_tgeo_tgeo via tnpoint\u00d7tnpoint\u2192tgeompoint composition." + }, + { + "nebula_name": "TemporalECoversTNpointTNpoint", + "sql_token": "TEMPORAL_ECOVERS_TNPOINT_TNPOINT", + "meos_call": "ecovers_tgeo_tgeo", + "args": [ + { + "name": "ridA", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "fractionA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsA", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "ridB", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "fractionB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsB", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_two_tnpoint_points_via_composition": true, + "comment_one_liner": "Per-event ecovers_tgeo_tgeo via tnpoint\u00d7tnpoint\u2192tgeompoint composition." + }, + { + "nebula_name": "TemporalEDisjointTNpointTNpoint", + "sql_token": "TEMPORAL_EDISJOINT_TNPOINT_TNPOINT", + "meos_call": "edisjoint_tgeo_tgeo", + "args": [ + { + "name": "ridA", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "fractionA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsA", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "ridB", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "fractionB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsB", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_two_tnpoint_points_via_composition": true, + "comment_one_liner": "Per-event edisjoint_tgeo_tgeo via tnpoint\u00d7tnpoint\u2192tgeompoint composition." + }, + { + "nebula_name": "TemporalADisjointTNpointTNpoint", + "sql_token": "TEMPORAL_ADISJOINT_TNPOINT_TNPOINT", + "meos_call": "adisjoint_tgeo_tgeo", + "args": [ + { + "name": "ridA", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "fractionA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsA", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "ridB", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "fractionB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsB", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_two_tnpoint_points_via_composition": true, + "comment_one_liner": "Per-event adisjoint_tgeo_tgeo via tnpoint\u00d7tnpoint\u2192tgeompoint composition." + }, + { + "nebula_name": "TemporalETouchesTNpointTNpoint", + "sql_token": "TEMPORAL_ETOUCHES_TNPOINT_TNPOINT", + "meos_call": "etouches_tgeo_tgeo", + "args": [ + { + "name": "ridA", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "fractionA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsA", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "ridB", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "fractionB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsB", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_two_tnpoint_points_via_composition": true, + "comment_one_liner": "Per-event etouches_tgeo_tgeo via tnpoint\u00d7tnpoint\u2192tgeompoint composition." + }, + { + "nebula_name": "TemporalATouchesTNpointTNpoint", + "sql_token": "TEMPORAL_ATOUCHES_TNPOINT_TNPOINT", + "meos_call": "atouches_tgeo_tgeo", + "args": [ + { + "name": "ridA", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "fractionA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsA", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "ridB", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "fractionB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsB", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_two_tnpoint_points_via_composition": true, + "comment_one_liner": "Per-event atouches_tgeo_tgeo via tnpoint\u00d7tnpoint\u2192tgeompoint composition." + }, + { + "nebula_name": "TemporalEContainsTNpointTNpoint", + "sql_token": "TEMPORAL_ECONTAINS_TNPOINT_TNPOINT", + "meos_call": "econtains_tgeo_tgeo", + "args": [ + { + "name": "ridA", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "fractionA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsA", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "ridB", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "fractionB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsB", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_two_tnpoint_points_via_composition": true, + "comment_one_liner": "Per-event econtains_tgeo_tgeo via tnpoint\u00d7tnpoint\u2192tgeompoint composition." + }, + { + "nebula_name": "TemporalAContainsTNpointTNpoint", + "sql_token": "TEMPORAL_ACONTAINS_TNPOINT_TNPOINT", + "meos_call": "acontains_tgeo_tgeo", + "args": [ + { + "name": "ridA", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "fractionA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsA", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "ridB", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "fractionB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsB", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_two_tnpoint_points_via_composition": true, + "comment_one_liner": "Per-event acontains_tgeo_tgeo via tnpoint\u00d7tnpoint\u2192tgeompoint composition." + }, + { + "nebula_name": "TemporalEDWithinTNpointTNpoint", + "sql_token": "TEMPORAL_EDWITHIN_TNPOINT_TNPOINT", + "meos_call": "edwithin_tgeo_tgeo", + "args": [ + { + "name": "ridA", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "fractionA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsA", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "ridB", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "fractionB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsB", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "dist", + "nautilus_type": "double", + "cpp_type": "double" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_two_tnpoint_points_with_dist_via_composition": true, + "comment_one_liner": "Per-event edwithin_tgeo_tgeo via tnpoint\u00d7tnpoint\u2192tgeompoint composition." + }, + { + "nebula_name": "TemporalADWithinTNpointTNpoint", + "sql_token": "TEMPORAL_ADWITHIN_TNPOINT_TNPOINT", + "meos_call": "adwithin_tgeo_tgeo", + "args": [ + { + "name": "ridA", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "fractionA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsA", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "ridB", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "fractionB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsB", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "dist", + "nautilus_type": "double", + "cpp_type": "double" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_two_tnpoint_points_with_dist_via_composition": true, + "comment_one_liner": "Per-event adwithin_tgeo_tgeo via tnpoint\u00d7tnpoint\u2192tgeompoint composition." + }, + { + "nebula_name": "TemporalNADTNpointGeometry", + "sql_token": "TEMPORAL_NAD_TNPOINT_GEOMETRY", + "meos_call": "nad_tgeo_geo", + "args": [ + { + "name": "rid", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "fraction", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "timestamp", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "geometry", + "nautilus_type": "VariableSizedData", + "cpp_type": "const char*" + } + ], + "return_type": "double", + "nautilus_return": "FLOAT64", + "build_tnpoint_point_via_composition": true, + "comment_one_liner": "Per-event nad_tgeo_geo (nearest approach distance) via tnpoint\u2192tgeompoint composition." + }, + { + "nebula_name": "TemporalNADTNpointTNpoint", + "sql_token": "TEMPORAL_NAD_TNPOINT_TNPOINT", + "meos_call": "nad_tgeo_tgeo", + "args": [ + { + "name": "ridA", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "fractionA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsA", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "ridB", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "fractionB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsB", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + } + ], + "return_type": "double", + "nautilus_return": "FLOAT64", + "build_two_tnpoint_points_via_composition": true, + "comment_one_liner": "Per-event nad_tgeo_tgeo (nearest approach distance) via tnpoint\u00d7tnpoint\u2192tgeompoint composition." + } + ] +} \ No newline at end of file diff --git a/tools/codegen/phasec-rest-descriptor.json b/tools/codegen/phasec-rest-descriptor.json new file mode 100644 index 0000000000..49d9b2dc5a --- /dev/null +++ b/tools/codegen/phasec-rest-descriptor.json @@ -0,0 +1,3583 @@ +{ + "operators": [ + { + "nebula_name": "H3indexEq", + "sql_token": "H3INDEX_EQ", + "input_type": "static_scalar", + "meos_call": "h3index_eq((H3Index)a, (H3Index)b)", + "return_kind": "double", + "extra_headers": [ + "meos_h3.h" + ], + "extra_args": [], + "build_generic": true, + "comment_one_liner": "H3Index eq comparison", + "primary_fields": [ + [ + "a", + "uint64_t" + ], + [ + "b", + "uint64_t" + ] + ] + }, + { + "nebula_name": "H3indexNe", + "sql_token": "H3INDEX_NE", + "input_type": "static_scalar", + "meos_call": "h3index_ne((H3Index)a, (H3Index)b)", + "return_kind": "double", + "extra_headers": [ + "meos_h3.h" + ], + "extra_args": [], + "build_generic": true, + "comment_one_liner": "H3Index ne comparison", + "primary_fields": [ + [ + "a", + "uint64_t" + ], + [ + "b", + "uint64_t" + ] + ] + }, + { + "nebula_name": "H3indexLt", + "sql_token": "H3INDEX_LT", + "input_type": "static_scalar", + "meos_call": "h3index_lt((H3Index)a, (H3Index)b)", + "return_kind": "double", + "extra_headers": [ + "meos_h3.h" + ], + "extra_args": [], + "build_generic": true, + "comment_one_liner": "H3Index lt comparison", + "primary_fields": [ + [ + "a", + "uint64_t" + ], + [ + "b", + "uint64_t" + ] + ] + }, + { + "nebula_name": "H3indexLe", + "sql_token": "H3INDEX_LE", + "input_type": "static_scalar", + "meos_call": "h3index_le((H3Index)a, (H3Index)b)", + "return_kind": "double", + "extra_headers": [ + "meos_h3.h" + ], + "extra_args": [], + "build_generic": true, + "comment_one_liner": "H3Index le comparison", + "primary_fields": [ + [ + "a", + "uint64_t" + ], + [ + "b", + "uint64_t" + ] + ] + }, + { + "nebula_name": "H3indexGt", + "sql_token": "H3INDEX_GT", + "input_type": "static_scalar", + "meos_call": "h3index_gt((H3Index)a, (H3Index)b)", + "return_kind": "double", + "extra_headers": [ + "meos_h3.h" + ], + "extra_args": [], + "build_generic": true, + "comment_one_liner": "H3Index gt comparison", + "primary_fields": [ + [ + "a", + "uint64_t" + ], + [ + "b", + "uint64_t" + ] + ] + }, + { + "nebula_name": "H3indexGe", + "sql_token": "H3INDEX_GE", + "input_type": "static_scalar", + "meos_call": "h3index_ge((H3Index)a, (H3Index)b)", + "return_kind": "double", + "extra_headers": [ + "meos_h3.h" + ], + "extra_args": [], + "build_generic": true, + "comment_one_liner": "H3Index ge comparison", + "primary_fields": [ + [ + "a", + "uint64_t" + ], + [ + "b", + "uint64_t" + ] + ] + }, + { + "nebula_name": "H3indexCmp", + "sql_token": "H3INDEX_CMP", + "input_type": "static_scalar", + "meos_call": "h3index_cmp((H3Index)a, (H3Index)b)", + "return_kind": "double", + "extra_headers": [ + "meos_h3.h" + ], + "extra_args": [], + "build_generic": true, + "comment_one_liner": "H3Index comparison (cmp)", + "primary_fields": [ + [ + "a", + "uint64_t" + ], + [ + "b", + "uint64_t" + ] + ] + }, + { + "nebula_name": "H3indexOut", + "sql_token": "H3INDEX_OUT", + "input_type": "static_scalar", + "meos_call": "h3index_out((H3Index)cell)", + "return_kind": "varsized_h3out", + "extra_headers": [ + "meos_h3.h" + ], + "extra_args": [], + "build_generic": true, + "comment_one_liner": "H3Index to hex string", + "primary_fields": [ + [ + "cell", + "uint64_t" + ] + ] + }, + { + "nebula_name": "Th3indexGetResolution", + "sql_token": "TH3INDEX_GET_RESOLUTION", + "input_type": "th3index", + "meos_call": "th3index_get_resolution(temp)", + "return_kind": "double", + "extra_headers": [ + "meos_h3.h" + ], + "extra_args": [], + "build_generic": true, + "comment_one_liner": "Th3index th3index get resolution" + }, + { + "nebula_name": "Th3indexGetBaseCellNumber", + "sql_token": "TH3INDEX_GET_BASE_CELL_NUMBER", + "input_type": "th3index", + "meos_call": "th3index_get_base_cell_number(temp)", + "return_kind": "double", + "extra_headers": [ + "meos_h3.h" + ], + "extra_args": [], + "build_generic": true, + "comment_one_liner": "Th3index th3index get base cell number" + }, + { + "nebula_name": "Th3indexIsValidCell", + "sql_token": "TH3INDEX_IS_VALID_CELL", + "input_type": "th3index", + "meos_call": "th3index_is_valid_cell(temp)", + "return_kind": "double", + "extra_headers": [ + "meos_h3.h" + ], + "extra_args": [], + "build_generic": true, + "comment_one_liner": "Th3index th3index is valid cell" + }, + { + "nebula_name": "Th3indexIsPentagon", + "sql_token": "TH3INDEX_IS_PENTAGON", + "input_type": "th3index", + "meos_call": "th3index_is_pentagon(temp)", + "return_kind": "double", + "extra_headers": [ + "meos_h3.h" + ], + "extra_args": [], + "build_generic": true, + "comment_one_liner": "Th3index th3index is pentagon" + }, + { + "nebula_name": "Th3indexCellToParent", + "sql_token": "TH3INDEX_CELL_TO_PARENT", + "input_type": "th3index", + "meos_call": "th3index_cell_to_parent(temp, (int32_t)arg0)", + "return_kind": "varsized_th3index", + "extra_headers": [ + "meos_h3.h" + ], + "extra_args": [ + { + "kind": "int_scalar" + } + ], + "build_generic": true, + "comment_one_liner": "Th3index th3index cell to parent" + }, + { + "nebula_name": "Th3indexCellToParentNext", + "sql_token": "TH3INDEX_CELL_TO_PARENT_NEXT", + "input_type": "th3index", + "meos_call": "th3index_cell_to_parent_next(temp, (int32_t)arg0)", + "return_kind": "varsized_th3index", + "extra_headers": [ + "meos_h3.h" + ], + "extra_args": [ + { + "kind": "int_scalar" + } + ], + "build_generic": true, + "comment_one_liner": "Th3index th3index cell to parent next" + }, + { + "nebula_name": "Th3indexCellToCenterChild", + "sql_token": "TH3INDEX_CELL_TO_CENTER_CHILD", + "input_type": "th3index", + "meos_call": "th3index_cell_to_center_child(temp, (int32_t)arg0)", + "return_kind": "varsized_th3index", + "extra_headers": [ + "meos_h3.h" + ], + "extra_args": [ + { + "kind": "int_scalar" + } + ], + "build_generic": true, + "comment_one_liner": "Th3index th3index cell to center child" + }, + { + "nebula_name": "Th3indexCellToCenterChildNext", + "sql_token": "TH3INDEX_CELL_TO_CENTER_CHILD_NEXT", + "input_type": "th3index", + "meos_call": "th3index_cell_to_center_child_next(temp, (int32_t)arg0)", + "return_kind": "varsized_th3index", + "extra_headers": [ + "meos_h3.h" + ], + "extra_args": [ + { + "kind": "int_scalar" + } + ], + "build_generic": true, + "comment_one_liner": "Th3index th3index cell to center child next" + }, + { + "nebula_name": "Th3indexCellToChildPos", + "sql_token": "TH3INDEX_CELL_TO_CHILD_POS", + "input_type": "th3index", + "meos_call": "th3index_cell_to_child_pos(temp, (int32_t)arg0)", + "return_kind": "double", + "extra_headers": [ + "meos_h3.h" + ], + "extra_args": [ + { + "kind": "int_scalar" + } + ], + "build_generic": true, + "comment_one_liner": "Th3index cell to child position" + }, + { + "nebula_name": "Th3indexAreNeighborCells", + "sql_token": "TH3INDEX_ARE_NEIGHBOR_CELLS", + "input_type": "th3index", + "meos_call": "th3index_are_neighbor_cells(temp, inst0)", + "return_kind": "double", + "extra_headers": [ + "meos_h3.h" + ], + "extra_args": [ + { + "kind": "th3index" + } + ], + "build_generic": true, + "comment_one_liner": "Th3index are neighbor cells" + }, + { + "nebula_name": "Th3indexGridDistance", + "sql_token": "TH3INDEX_GRID_DISTANCE", + "input_type": "th3index", + "meos_call": "th3index_grid_distance(temp, inst0)", + "return_kind": "double", + "extra_headers": [ + "meos_h3.h" + ], + "extra_args": [ + { + "kind": "th3index" + } + ], + "build_generic": true, + "comment_one_liner": "Th3index grid distance" + }, + { + "nebula_name": "EverEqTh3indexH3index", + "sql_token": "EVEREQTH3INDEXH3INDEX", + "input_type": "th3index", + "meos_call": "ever_eq_th3index_h3index(temp, (H3Index)arg0)", + "return_kind": "double", + "extra_headers": [ + "meos_h3.h" + ], + "extra_args": [ + { + "kind": "h3index" + } + ], + "build_generic": true, + "comment_one_liner": "Ever equal th3index vs h3index" + }, + { + "nebula_name": "EverNeTh3indexH3index", + "sql_token": "EVERNETH3INDEXH3INDEX", + "input_type": "th3index", + "meos_call": "ever_ne_th3index_h3index(temp, (H3Index)arg0)", + "return_kind": "double", + "extra_headers": [ + "meos_h3.h" + ], + "extra_args": [ + { + "kind": "h3index" + } + ], + "build_generic": true, + "comment_one_liner": "Ever neual th3index vs h3index" + }, + { + "nebula_name": "AlwaysEqTh3indexH3index", + "sql_token": "ALWAYSEQTH3INDEXH3INDEX", + "input_type": "th3index", + "meos_call": "always_eq_th3index_h3index(temp, (H3Index)arg0)", + "return_kind": "double", + "extra_headers": [ + "meos_h3.h" + ], + "extra_args": [ + { + "kind": "h3index" + } + ], + "build_generic": true, + "comment_one_liner": "Always equal th3index vs h3index" + }, + { + "nebula_name": "AlwaysNeTh3indexH3index", + "sql_token": "ALWAYSNETH3INDEXH3INDEX", + "input_type": "th3index", + "meos_call": "always_ne_th3index_h3index(temp, (H3Index)arg0)", + "return_kind": "double", + "extra_headers": [ + "meos_h3.h" + ], + "extra_args": [ + { + "kind": "h3index" + } + ], + "build_generic": true, + "comment_one_liner": "Always neual th3index vs h3index" + }, + { + "nebula_name": "QuadbinEq", + "sql_token": "QUADBIN_EQ", + "input_type": "static_scalar", + "meos_call": "quadbin_eq((Quadbin)a, (Quadbin)b)", + "return_kind": "double", + "extra_headers": [ + "meos_quadbin.h" + ], + "extra_args": [], + "build_generic": true, + "comment_one_liner": "Quadbin eq comparison", + "primary_fields": [ + [ + "a", + "uint64_t" + ], + [ + "b", + "uint64_t" + ] + ] + }, + { + "nebula_name": "QuadbinNe", + "sql_token": "QUADBIN_NE", + "input_type": "static_scalar", + "meos_call": "quadbin_ne((Quadbin)a, (Quadbin)b)", + "return_kind": "double", + "extra_headers": [ + "meos_quadbin.h" + ], + "extra_args": [], + "build_generic": true, + "comment_one_liner": "Quadbin ne comparison", + "primary_fields": [ + [ + "a", + "uint64_t" + ], + [ + "b", + "uint64_t" + ] + ] + }, + { + "nebula_name": "QuadbinLt", + "sql_token": "QUADBIN_LT", + "input_type": "static_scalar", + "meos_call": "quadbin_lt((Quadbin)a, (Quadbin)b)", + "return_kind": "double", + "extra_headers": [ + "meos_quadbin.h" + ], + "extra_args": [], + "build_generic": true, + "comment_one_liner": "Quadbin lt comparison", + "primary_fields": [ + [ + "a", + "uint64_t" + ], + [ + "b", + "uint64_t" + ] + ] + }, + { + "nebula_name": "QuadbinLe", + "sql_token": "QUADBIN_LE", + "input_type": "static_scalar", + "meos_call": "quadbin_le((Quadbin)a, (Quadbin)b)", + "return_kind": "double", + "extra_headers": [ + "meos_quadbin.h" + ], + "extra_args": [], + "build_generic": true, + "comment_one_liner": "Quadbin le comparison", + "primary_fields": [ + [ + "a", + "uint64_t" + ], + [ + "b", + "uint64_t" + ] + ] + }, + { + "nebula_name": "QuadbinGt", + "sql_token": "QUADBIN_GT", + "input_type": "static_scalar", + "meos_call": "quadbin_gt((Quadbin)a, (Quadbin)b)", + "return_kind": "double", + "extra_headers": [ + "meos_quadbin.h" + ], + "extra_args": [], + "build_generic": true, + "comment_one_liner": "Quadbin gt comparison", + "primary_fields": [ + [ + "a", + "uint64_t" + ], + [ + "b", + "uint64_t" + ] + ] + }, + { + "nebula_name": "QuadbinGe", + "sql_token": "QUADBIN_GE", + "input_type": "static_scalar", + "meos_call": "quadbin_ge((Quadbin)a, (Quadbin)b)", + "return_kind": "double", + "extra_headers": [ + "meos_quadbin.h" + ], + "extra_args": [], + "build_generic": true, + "comment_one_liner": "Quadbin ge comparison", + "primary_fields": [ + [ + "a", + "uint64_t" + ], + [ + "b", + "uint64_t" + ] + ] + }, + { + "nebula_name": "QuadbinCmp", + "sql_token": "QUADBIN_CMP", + "input_type": "static_scalar", + "meos_call": "quadbin_cmp((Quadbin)a, (Quadbin)b)", + "return_kind": "double", + "extra_headers": [ + "meos_quadbin.h" + ], + "extra_args": [], + "build_generic": true, + "comment_one_liner": "Quadbin cmp", + "primary_fields": [ + [ + "a", + "uint64_t" + ], + [ + "b", + "uint64_t" + ] + ] + }, + { + "nebula_name": "QuadbinGetResolution", + "sql_token": "QUADBIN_GET_RESOLUTION", + "input_type": "static_scalar", + "meos_call": "quadbin_get_resolution((Quadbin)cell)", + "return_kind": "double", + "extra_headers": [ + "meos_quadbin.h" + ], + "extra_args": [], + "build_generic": true, + "comment_one_liner": "Quadbin get resolution", + "primary_fields": [ + [ + "cell", + "uint64_t" + ] + ] + }, + { + "nebula_name": "QuadbinIsValidCell", + "sql_token": "QUADBIN_IS_VALID_CELL", + "input_type": "static_scalar", + "meos_call": "quadbin_is_valid_cell((Quadbin)cell)", + "return_kind": "double", + "extra_headers": [ + "meos_quadbin.h" + ], + "extra_args": [], + "build_generic": true, + "comment_one_liner": "Quadbin is valid cell", + "primary_fields": [ + [ + "cell", + "uint64_t" + ] + ] + }, + { + "nebula_name": "QuadbinCellArea", + "sql_token": "QUADBIN_CELL_AREA", + "input_type": "static_scalar", + "meos_call": "quadbin_cell_area((Quadbin)cell)", + "return_kind": "double", + "extra_headers": [ + "meos_quadbin.h" + ], + "extra_args": [], + "build_generic": true, + "comment_one_liner": "Quadbin cell area", + "primary_fields": [ + [ + "cell", + "uint64_t" + ] + ] + }, + { + "nebula_name": "QuadbinCellToParent", + "sql_token": "QUADBIN_CELL_TO_PARENT", + "input_type": "static_scalar", + "meos_call": "quadbin_cell_to_parent((Quadbin)cell, (uint32_t)res)", + "return_kind": "varsized_quadbin", + "extra_headers": [ + "meos_quadbin.h" + ], + "extra_args": [], + "build_generic": true, + "comment_one_liner": "Quadbin cell to parent", + "primary_fields": [ + [ + "cell", + "uint64_t" + ], + [ + "res", + "uint64_t" + ] + ] + }, + { + "nebula_name": "QuadbinCellToQuadkey", + "sql_token": "QUADBIN_CELL_TO_QUADKEY", + "input_type": "static_scalar", + "meos_call": "quadbin_cell_to_quadkey((Quadbin)cell)", + "return_kind": "varsized_cstring", + "extra_headers": [ + "meos_quadbin.h" + ], + "extra_args": [], + "build_generic": true, + "comment_one_liner": "Quadbin cell to quadkey", + "primary_fields": [ + [ + "cell", + "uint64_t" + ] + ] + }, + { + "nebula_name": "QuadbinPointToCell", + "sql_token": "QUADBIN_POINT_TO_CELL", + "input_type": "static_scalar", + "meos_call": "quadbin_point_to_cell(lon, lat, (uint32_t)res)", + "return_kind": "varsized_quadbin", + "extra_headers": [ + "meos_quadbin.h" + ], + "extra_args": [], + "build_generic": true, + "comment_one_liner": "Quadbin point to cell", + "primary_fields": [ + [ + "lon", + "double" + ], + [ + "lat", + "double" + ], + [ + "res", + "uint64_t" + ] + ] + }, + { + "nebula_name": "QuadbinTileToCell", + "sql_token": "QUADBIN_TILE_TO_CELL", + "input_type": "static_scalar", + "meos_call": "quadbin_tile_to_cell((uint32_t)x, (uint32_t)y, (uint32_t)z)", + "return_kind": "varsized_quadbin", + "extra_headers": [ + "meos_quadbin.h" + ], + "extra_args": [], + "build_generic": true, + "comment_one_liner": "Quadbin tile to cell", + "primary_fields": [ + [ + "x", + "uint64_t" + ], + [ + "y", + "uint64_t" + ], + [ + "z", + "uint64_t" + ] + ] + }, + { + "nebula_name": "EverEqTquadbinQuadbin", + "sql_token": "EVEREQTQUADBINQUADBIN", + "input_type": "tquadbin", + "meos_call": "ever_eq_tquadbin_quadbin(temp, (Quadbin)arg0)", + "return_kind": "double", + "extra_headers": [ + "meos_quadbin.h" + ], + "extra_args": [ + { + "kind": "quadbin" + } + ], + "build_generic": true, + "comment_one_liner": "Ever equal tquadbin vs quadbin" + }, + { + "nebula_name": "EverNeTquadbinQuadbin", + "sql_token": "EVERNETQUADBINQUADBIN", + "input_type": "tquadbin", + "meos_call": "ever_ne_tquadbin_quadbin(temp, (Quadbin)arg0)", + "return_kind": "double", + "extra_headers": [ + "meos_quadbin.h" + ], + "extra_args": [ + { + "kind": "quadbin" + } + ], + "build_generic": true, + "comment_one_liner": "Ever neual tquadbin vs quadbin" + }, + { + "nebula_name": "AlwaysEqTquadbinQuadbin", + "sql_token": "ALWAYSEQTQUADBINQUADBIN", + "input_type": "tquadbin", + "meos_call": "always_eq_tquadbin_quadbin(temp, (Quadbin)arg0)", + "return_kind": "double", + "extra_headers": [ + "meos_quadbin.h" + ], + "extra_args": [ + { + "kind": "quadbin" + } + ], + "build_generic": true, + "comment_one_liner": "Always equal tquadbin vs quadbin" + }, + { + "nebula_name": "AlwaysNeTquadbinQuadbin", + "sql_token": "ALWAYSNETQUADBINQUADBIN", + "input_type": "tquadbin", + "meos_call": "always_ne_tquadbin_quadbin(temp, (Quadbin)arg0)", + "return_kind": "double", + "extra_headers": [ + "meos_quadbin.h" + ], + "extra_args": [ + { + "kind": "quadbin" + } + ], + "build_generic": true, + "comment_one_liner": "Always neual tquadbin vs quadbin" + }, + { + "nebula_name": "EverEqTtextText", + "sql_token": "EVEREQTTEXTTEXT", + "input_type": "ttext", + "meos_call": "ever_eq_ttext_text(temp, txt0)", + "return_kind": "double", + "extra_headers": [], + "extra_args": [ + { + "kind": "text_varsized" + } + ], + "build_generic": true, + "comment_one_liner": "Ever eqqual ttext vs text" + }, + { + "nebula_name": "EverEqTextTtext", + "sql_token": "EVEREQTEXTTTEXT", + "input_type": "ttext", + "meos_call": "ever_eq_text_ttext(txt0, temp)", + "return_kind": "double", + "extra_headers": [], + "extra_args": [ + { + "kind": "text_varsized" + } + ], + "build_generic": true, + "comment_one_liner": "Ever eqqual text vs ttext", + "scalar_first": true + }, + { + "nebula_name": "EverNeTtextText", + "sql_token": "EVERNETTEXTTEXT", + "input_type": "ttext", + "meos_call": "ever_ne_ttext_text(temp, txt0)", + "return_kind": "double", + "extra_headers": [], + "extra_args": [ + { + "kind": "text_varsized" + } + ], + "build_generic": true, + "comment_one_liner": "Ever nequal ttext vs text" + }, + { + "nebula_name": "EverNeTextTtext", + "sql_token": "EVERNETEXTTTEXT", + "input_type": "ttext", + "meos_call": "ever_ne_text_ttext(txt0, temp)", + "return_kind": "double", + "extra_headers": [], + "extra_args": [ + { + "kind": "text_varsized" + } + ], + "build_generic": true, + "comment_one_liner": "Ever nequal text vs ttext", + "scalar_first": true + }, + { + "nebula_name": "EverGeTtextText", + "sql_token": "EVERGETTEXTTEXT", + "input_type": "ttext", + "meos_call": "ever_ge_ttext_text(temp, txt0)", + "return_kind": "double", + "extra_headers": [], + "extra_args": [ + { + "kind": "text_varsized" + } + ], + "build_generic": true, + "comment_one_liner": "Ever gequal ttext vs text" + }, + { + "nebula_name": "EverGeTextTtext", + "sql_token": "EVERGETEXTTTEXT", + "input_type": "ttext", + "meos_call": "ever_ge_text_ttext(txt0, temp)", + "return_kind": "double", + "extra_headers": [], + "extra_args": [ + { + "kind": "text_varsized" + } + ], + "build_generic": true, + "comment_one_liner": "Ever gequal text vs ttext", + "scalar_first": true + }, + { + "nebula_name": "EverGtTtextText", + "sql_token": "EVERGTTTEXTTEXT", + "input_type": "ttext", + "meos_call": "ever_gt_ttext_text(temp, txt0)", + "return_kind": "double", + "extra_headers": [], + "extra_args": [ + { + "kind": "text_varsized" + } + ], + "build_generic": true, + "comment_one_liner": "Ever gtqual ttext vs text" + }, + { + "nebula_name": "EverGtTextTtext", + "sql_token": "EVERGTTEXTTTEXT", + "input_type": "ttext", + "meos_call": "ever_gt_text_ttext(txt0, temp)", + "return_kind": "double", + "extra_headers": [], + "extra_args": [ + { + "kind": "text_varsized" + } + ], + "build_generic": true, + "comment_one_liner": "Ever gtqual text vs ttext", + "scalar_first": true + }, + { + "nebula_name": "EverLeTtextText", + "sql_token": "EVERLETTEXTTEXT", + "input_type": "ttext", + "meos_call": "ever_le_ttext_text(temp, txt0)", + "return_kind": "double", + "extra_headers": [], + "extra_args": [ + { + "kind": "text_varsized" + } + ], + "build_generic": true, + "comment_one_liner": "Ever lequal ttext vs text" + }, + { + "nebula_name": "EverLeTextTtext", + "sql_token": "EVERLETEXTTTEXT", + "input_type": "ttext", + "meos_call": "ever_le_text_ttext(txt0, temp)", + "return_kind": "double", + "extra_headers": [], + "extra_args": [ + { + "kind": "text_varsized" + } + ], + "build_generic": true, + "comment_one_liner": "Ever lequal text vs ttext", + "scalar_first": true + }, + { + "nebula_name": "EverLtTtextText", + "sql_token": "EVERLTTTEXTTEXT", + "input_type": "ttext", + "meos_call": "ever_lt_ttext_text(temp, txt0)", + "return_kind": "double", + "extra_headers": [], + "extra_args": [ + { + "kind": "text_varsized" + } + ], + "build_generic": true, + "comment_one_liner": "Ever ltqual ttext vs text" + }, + { + "nebula_name": "EverLtTextTtext", + "sql_token": "EVERLTTEXTTTEXT", + "input_type": "ttext", + "meos_call": "ever_lt_text_ttext(txt0, temp)", + "return_kind": "double", + "extra_headers": [], + "extra_args": [ + { + "kind": "text_varsized" + } + ], + "build_generic": true, + "comment_one_liner": "Ever ltqual text vs ttext", + "scalar_first": true + }, + { + "nebula_name": "AlwaysEqTtextText", + "sql_token": "ALWAYSEQTTEXTTEXT", + "input_type": "ttext", + "meos_call": "always_eq_ttext_text(temp, txt0)", + "return_kind": "double", + "extra_headers": [], + "extra_args": [ + { + "kind": "text_varsized" + } + ], + "build_generic": true, + "comment_one_liner": "Always eqqual ttext vs text" + }, + { + "nebula_name": "AlwaysEqTextTtext", + "sql_token": "ALWAYSEQTEXTTTEXT", + "input_type": "ttext", + "meos_call": "always_eq_text_ttext(txt0, temp)", + "return_kind": "double", + "extra_headers": [], + "extra_args": [ + { + "kind": "text_varsized" + } + ], + "build_generic": true, + "comment_one_liner": "Always eqqual text vs ttext", + "scalar_first": true + }, + { + "nebula_name": "AlwaysNeTtextText", + "sql_token": "ALWAYSNETTEXTTEXT", + "input_type": "ttext", + "meos_call": "always_ne_ttext_text(temp, txt0)", + "return_kind": "double", + "extra_headers": [], + "extra_args": [ + { + "kind": "text_varsized" + } + ], + "build_generic": true, + "comment_one_liner": "Always nequal ttext vs text" + }, + { + "nebula_name": "AlwaysNeTextTtext", + "sql_token": "ALWAYSNETEXTTTEXT", + "input_type": "ttext", + "meos_call": "always_ne_text_ttext(txt0, temp)", + "return_kind": "double", + "extra_headers": [], + "extra_args": [ + { + "kind": "text_varsized" + } + ], + "build_generic": true, + "comment_one_liner": "Always nequal text vs ttext", + "scalar_first": true + }, + { + "nebula_name": "AlwaysGeTtextText", + "sql_token": "ALWAYSGETTEXTTEXT", + "input_type": "ttext", + "meos_call": "always_ge_ttext_text(temp, txt0)", + "return_kind": "double", + "extra_headers": [], + "extra_args": [ + { + "kind": "text_varsized" + } + ], + "build_generic": true, + "comment_one_liner": "Always gequal ttext vs text" + }, + { + "nebula_name": "AlwaysGeTextTtext", + "sql_token": "ALWAYSGETEXTTTEXT", + "input_type": "ttext", + "meos_call": "always_ge_text_ttext(txt0, temp)", + "return_kind": "double", + "extra_headers": [], + "extra_args": [ + { + "kind": "text_varsized" + } + ], + "build_generic": true, + "comment_one_liner": "Always gequal text vs ttext", + "scalar_first": true + }, + { + "nebula_name": "AlwaysGtTtextText", + "sql_token": "ALWAYSGTTTEXTTEXT", + "input_type": "ttext", + "meos_call": "always_gt_ttext_text(temp, txt0)", + "return_kind": "double", + "extra_headers": [], + "extra_args": [ + { + "kind": "text_varsized" + } + ], + "build_generic": true, + "comment_one_liner": "Always gtqual ttext vs text" + }, + { + "nebula_name": "AlwaysGtTextTtext", + "sql_token": "ALWAYSGTTEXTTTEXT", + "input_type": "ttext", + "meos_call": "always_gt_text_ttext(txt0, temp)", + "return_kind": "double", + "extra_headers": [], + "extra_args": [ + { + "kind": "text_varsized" + } + ], + "build_generic": true, + "comment_one_liner": "Always gtqual text vs ttext", + "scalar_first": true + }, + { + "nebula_name": "AlwaysLeTtextText", + "sql_token": "ALWAYSLETTEXTTEXT", + "input_type": "ttext", + "meos_call": "always_le_ttext_text(temp, txt0)", + "return_kind": "double", + "extra_headers": [], + "extra_args": [ + { + "kind": "text_varsized" + } + ], + "build_generic": true, + "comment_one_liner": "Always lequal ttext vs text" + }, + { + "nebula_name": "AlwaysLeTextTtext", + "sql_token": "ALWAYSLETEXTTTEXT", + "input_type": "ttext", + "meos_call": "always_le_text_ttext(txt0, temp)", + "return_kind": "double", + "extra_headers": [], + "extra_args": [ + { + "kind": "text_varsized" + } + ], + "build_generic": true, + "comment_one_liner": "Always lequal text vs ttext", + "scalar_first": true + }, + { + "nebula_name": "AlwaysLtTtextText", + "sql_token": "ALWAYSLTTTEXTTEXT", + "input_type": "ttext", + "meos_call": "always_lt_ttext_text(temp, txt0)", + "return_kind": "double", + "extra_headers": [], + "extra_args": [ + { + "kind": "text_varsized" + } + ], + "build_generic": true, + "comment_one_liner": "Always ltqual ttext vs text" + }, + { + "nebula_name": "AlwaysLtTextTtext", + "sql_token": "ALWAYSLTTEXTTTEXT", + "input_type": "ttext", + "meos_call": "always_lt_text_ttext(txt0, temp)", + "return_kind": "double", + "extra_headers": [], + "extra_args": [ + { + "kind": "text_varsized" + } + ], + "build_generic": true, + "comment_one_liner": "Always ltqual text vs ttext", + "scalar_first": true + }, + { + "nebula_name": "TEqTtextText", + "sql_token": "TEQ_TTEXT_TEXT", + "input_type": "ttext", + "meos_call": "teq_ttext_text(temp, txt0)", + "return_kind": "double", + "extra_headers": [], + "extra_args": [ + { + "kind": "text_varsized" + } + ], + "build_generic": true, + "comment_one_liner": "Temporal eqqual ttext vs text" + }, + { + "nebula_name": "TEqTextTtext", + "sql_token": "TEQ_TEXT_TTEXT", + "input_type": "ttext", + "meos_call": "teq_text_ttext(txt0, temp)", + "return_kind": "double", + "extra_headers": [], + "extra_args": [ + { + "kind": "text_varsized" + } + ], + "build_generic": true, + "comment_one_liner": "Temporal eqqual text vs ttext", + "scalar_first": true + }, + { + "nebula_name": "TNeTtextText", + "sql_token": "TNE_TTEXT_TEXT", + "input_type": "ttext", + "meos_call": "tne_ttext_text(temp, txt0)", + "return_kind": "double", + "extra_headers": [], + "extra_args": [ + { + "kind": "text_varsized" + } + ], + "build_generic": true, + "comment_one_liner": "Temporal nequal ttext vs text" + }, + { + "nebula_name": "TNeTextTtext", + "sql_token": "TNE_TEXT_TTEXT", + "input_type": "ttext", + "meos_call": "tne_text_ttext(txt0, temp)", + "return_kind": "double", + "extra_headers": [], + "extra_args": [ + { + "kind": "text_varsized" + } + ], + "build_generic": true, + "comment_one_liner": "Temporal nequal text vs ttext", + "scalar_first": true + }, + { + "nebula_name": "TtextUpper", + "sql_token": "TTEXT_UPPER", + "input_type": "ttext", + "meos_call": "ttext_upper", + "return_kind": "varsized_ttext", + "extra_headers": [], + "extra_args": [], + "build_generic": true, + "comment_one_liner": "Temporal text uppercase" + }, + { + "nebula_name": "TtextLower", + "sql_token": "TTEXT_LOWER", + "input_type": "ttext", + "meos_call": "ttext_lower", + "return_kind": "varsized_ttext", + "extra_headers": [], + "extra_args": [], + "build_generic": true, + "comment_one_liner": "Temporal text lowercase" + }, + { + "nebula_name": "TtextInitcap", + "sql_token": "TTEXT_INITCAP", + "input_type": "ttext", + "meos_call": "ttext_initcap", + "return_kind": "varsized_ttext", + "extra_headers": [], + "extra_args": [], + "build_generic": true, + "comment_one_liner": "Temporal text initcapcase" + }, + { + "nebula_name": "TextUpper", + "sql_token": "TEXT_UPPER", + "input_type": "text_wkt", + "meos_call": "text_upper", + "return_kind": "varsized_text", + "extra_headers": [], + "extra_args": [], + "build_generic": true, + "comment_one_liner": "Text uppercase" + }, + { + "nebula_name": "TextLower", + "sql_token": "TEXT_LOWER", + "input_type": "text_wkt", + "meos_call": "text_lower", + "return_kind": "varsized_text", + "extra_headers": [], + "extra_args": [], + "build_generic": true, + "comment_one_liner": "Text lowercase" + }, + { + "nebula_name": "TextInitcap", + "sql_token": "TEXT_INITCAP", + "input_type": "text_wkt", + "meos_call": "text_initcap", + "return_kind": "varsized_text", + "extra_headers": [], + "extra_args": [], + "build_generic": true, + "comment_one_liner": "Text initcapcase" + }, + { + "nebula_name": "TextcatTtextText", + "sql_token": "TEXTCAT_TTEXT_TEXT", + "input_type": "ttext", + "meos_call": "textcat_ttext_text(temp, txt0)", + "return_kind": "varsized_ttext", + "extra_headers": [], + "extra_args": [ + { + "kind": "text_varsized" + } + ], + "build_generic": true, + "comment_one_liner": "Concatenate ttext and text" + }, + { + "nebula_name": "TextcatTextTtext", + "sql_token": "TEXTCAT_TEXT_TTEXT", + "input_type": "ttext", + "meos_call": "textcat_text_ttext(txt0, temp)", + "return_kind": "varsized_ttext", + "extra_headers": [], + "extra_args": [ + { + "kind": "text_varsized" + } + ], + "build_generic": true, + "comment_one_liner": "Concatenate text and ttext", + "scalar_first": true + }, + { + "nebula_name": "TextcatTtextTtext", + "sql_token": "TEXTCAT_TTEXT_TTEXT", + "input_type": "ttext", + "meos_call": "textcat_ttext_ttext(temp, inst0)", + "return_kind": "varsized_ttext", + "extra_headers": [], + "extra_args": [ + { + "kind": "ttext" + } + ], + "build_generic": true, + "comment_one_liner": "Concatenate ttext and ttext" + }, + { + "nebula_name": "TGeTtextText", + "sql_token": "TGE_TTEXT_TEXT", + "input_type": "ttext", + "meos_call": "tge_ttext_text(temp, txt0)", + "return_kind": "double", + "extra_headers": [], + "extra_args": [ + { + "kind": "text_varsized" + } + ], + "build_generic": true, + "comment_one_liner": "Temporal ge ttext vs text" + }, + { + "nebula_name": "TGeTextTtext", + "sql_token": "TGE_TEXT_TTEXT", + "input_type": "ttext", + "meos_call": "tge_text_ttext(txt0, temp)", + "return_kind": "double", + "extra_headers": [], + "extra_args": [ + { + "kind": "text_varsized" + } + ], + "build_generic": true, + "comment_one_liner": "Temporal ge text vs ttext", + "scalar_first": true + }, + { + "nebula_name": "TGtTtextText", + "sql_token": "TGT_TTEXT_TEXT", + "input_type": "ttext", + "meos_call": "tgt_ttext_text(temp, txt0)", + "return_kind": "double", + "extra_headers": [], + "extra_args": [ + { + "kind": "text_varsized" + } + ], + "build_generic": true, + "comment_one_liner": "Temporal gt ttext vs text" + }, + { + "nebula_name": "TGtTextTtext", + "sql_token": "TGT_TEXT_TTEXT", + "input_type": "ttext", + "meos_call": "tgt_text_ttext(txt0, temp)", + "return_kind": "double", + "extra_headers": [], + "extra_args": [ + { + "kind": "text_varsized" + } + ], + "build_generic": true, + "comment_one_liner": "Temporal gt text vs ttext", + "scalar_first": true + }, + { + "nebula_name": "TLeTtextText", + "sql_token": "TLE_TTEXT_TEXT", + "input_type": "ttext", + "meos_call": "tle_ttext_text(temp, txt0)", + "return_kind": "double", + "extra_headers": [], + "extra_args": [ + { + "kind": "text_varsized" + } + ], + "build_generic": true, + "comment_one_liner": "Temporal le ttext vs text" + }, + { + "nebula_name": "TLeTextTtext", + "sql_token": "TLE_TEXT_TTEXT", + "input_type": "ttext", + "meos_call": "tle_text_ttext(txt0, temp)", + "return_kind": "double", + "extra_headers": [], + "extra_args": [ + { + "kind": "text_varsized" + } + ], + "build_generic": true, + "comment_one_liner": "Temporal le text vs ttext", + "scalar_first": true + }, + { + "nebula_name": "TLtTtextText", + "sql_token": "TLT_TTEXT_TEXT", + "input_type": "ttext", + "meos_call": "tlt_ttext_text(temp, txt0)", + "return_kind": "double", + "extra_headers": [], + "extra_args": [ + { + "kind": "text_varsized" + } + ], + "build_generic": true, + "comment_one_liner": "Temporal lt ttext vs text" + }, + { + "nebula_name": "TLtTextTtext", + "sql_token": "TLT_TEXT_TTEXT", + "input_type": "ttext", + "meos_call": "tlt_text_ttext(txt0, temp)", + "return_kind": "double", + "extra_headers": [], + "extra_args": [ + { + "kind": "text_varsized" + } + ], + "build_generic": true, + "comment_one_liner": "Temporal lt text vs ttext", + "scalar_first": true + }, + { + "nebula_name": "JsonbEq", + "sql_token": "JSONB_EQ", + "input_type": "jsonb_wkt", + "meos_call": "jsonb_eq(temp, jb0)", + "return_kind": "double", + "extra_headers": [ + "meos_json.h" + ], + "extra_args": [ + { + "kind": "jsonb_varsized" + } + ], + "build_generic": true, + "comment_one_liner": "Jsonb eq comparison" + }, + { + "nebula_name": "JsonbNe", + "sql_token": "JSONB_NE", + "input_type": "jsonb_wkt", + "meos_call": "jsonb_ne(temp, jb0)", + "return_kind": "double", + "extra_headers": [ + "meos_json.h" + ], + "extra_args": [ + { + "kind": "jsonb_varsized" + } + ], + "build_generic": true, + "comment_one_liner": "Jsonb ne comparison" + }, + { + "nebula_name": "JsonbLt", + "sql_token": "JSONB_LT", + "input_type": "jsonb_wkt", + "meos_call": "jsonb_lt(temp, jb0)", + "return_kind": "double", + "extra_headers": [ + "meos_json.h" + ], + "extra_args": [ + { + "kind": "jsonb_varsized" + } + ], + "build_generic": true, + "comment_one_liner": "Jsonb lt comparison" + }, + { + "nebula_name": "JsonbLe", + "sql_token": "JSONB_LE", + "input_type": "jsonb_wkt", + "meos_call": "jsonb_le(temp, jb0)", + "return_kind": "double", + "extra_headers": [ + "meos_json.h" + ], + "extra_args": [ + { + "kind": "jsonb_varsized" + } + ], + "build_generic": true, + "comment_one_liner": "Jsonb le comparison" + }, + { + "nebula_name": "JsonbGt", + "sql_token": "JSONB_GT", + "input_type": "jsonb_wkt", + "meos_call": "jsonb_gt(temp, jb0)", + "return_kind": "double", + "extra_headers": [ + "meos_json.h" + ], + "extra_args": [ + { + "kind": "jsonb_varsized" + } + ], + "build_generic": true, + "comment_one_liner": "Jsonb gt comparison" + }, + { + "nebula_name": "JsonbGe", + "sql_token": "JSONB_GE", + "input_type": "jsonb_wkt", + "meos_call": "jsonb_ge(temp, jb0)", + "return_kind": "double", + "extra_headers": [ + "meos_json.h" + ], + "extra_args": [ + { + "kind": "jsonb_varsized" + } + ], + "build_generic": true, + "comment_one_liner": "Jsonb ge comparison" + }, + { + "nebula_name": "JsonbCmp", + "sql_token": "JSONB_CMP", + "input_type": "jsonb_wkt", + "meos_call": "jsonb_cmp(temp, jb0)", + "return_kind": "double", + "extra_headers": [ + "meos_json.h" + ], + "extra_args": [ + { + "kind": "jsonb_varsized" + } + ], + "build_generic": true, + "comment_one_liner": "Jsonb cmp" + }, + { + "nebula_name": "JsonbContained", + "sql_token": "JSONB_CONTAINED", + "input_type": "jsonb_wkt", + "meos_call": "jsonb_contained(temp, jb0)", + "return_kind": "double", + "extra_headers": [ + "meos_json.h" + ], + "extra_args": [ + { + "kind": "jsonb_varsized" + } + ], + "build_generic": true, + "comment_one_liner": "Jsonb contained" + }, + { + "nebula_name": "JsonbContains", + "sql_token": "JSONB_CONTAINS", + "input_type": "jsonb_wkt", + "meos_call": "jsonb_contains(temp, jb0)", + "return_kind": "double", + "extra_headers": [ + "meos_json.h" + ], + "extra_args": [ + { + "kind": "jsonb_varsized" + } + ], + "build_generic": true, + "comment_one_liner": "Jsonb contains" + }, + { + "nebula_name": "JsonbExists", + "sql_token": "JSONB_EXISTS", + "input_type": "jsonb_wkt", + "meos_call": "jsonb_exists(temp, txt0)", + "return_kind": "double", + "extra_headers": [ + "meos_json.h" + ], + "extra_args": [ + { + "kind": "text_varsized" + } + ], + "build_generic": true, + "comment_one_liner": "Jsonb exists key" + }, + { + "nebula_name": "JsonbArrayLength", + "sql_token": "JSONB_ARRAY_LENGTH", + "input_type": "jsonb_wkt", + "meos_call": "jsonb_array_length(temp)", + "return_kind": "double", + "extra_headers": [ + "meos_json.h" + ], + "extra_args": [], + "build_generic": true, + "comment_one_liner": "Jsonb array length" + }, + { + "nebula_name": "JsonbToCstring", + "sql_token": "JSONB_TO_CSTRING", + "input_type": "jsonb_wkt", + "meos_call": "jsonb_to_cstring(temp)", + "return_kind": "varsized_cstring", + "extra_headers": [ + "meos_json.h" + ], + "extra_args": [], + "build_generic": true, + "comment_one_liner": "Jsonb to cstring" + }, + { + "nebula_name": "JsonbPretty", + "sql_token": "JSONB_PRETTY", + "input_type": "jsonb_wkt", + "meos_call": "jsonb_pretty(temp)", + "return_kind": "varsized_cstring", + "extra_headers": [ + "meos_json.h" + ], + "extra_args": [], + "build_generic": true, + "comment_one_liner": "Jsonb pretty print" + }, + { + "nebula_name": "JsonbObjectFieldText", + "sql_token": "JSONB_OBJECT_FIELD_TEXT", + "input_type": "jsonb_wkt", + "meos_call": "jsonb_object_field_text(temp, txt0)", + "return_kind": "varsized_text", + "extra_headers": [ + "meos_json.h" + ], + "extra_args": [ + { + "kind": "text_varsized" + } + ], + "build_generic": true, + "comment_one_liner": "Jsonb object field text" + }, + { + "nebula_name": "JsonbArrayElementText", + "sql_token": "JSONB_ARRAY_ELEMENT_TEXT", + "input_type": "jsonb_wkt", + "meos_call": "jsonb_array_element_text(temp, (int)idx_d)", + "return_kind": "varsized_text", + "extra_headers": [ + "meos_json.h" + ], + "extra_args": [ + { + "kind": "scalar", + "cpp": "double", + "name": "idx_d" + } + ], + "build_generic": true, + "comment_one_liner": "Jsonb array element text" + }, + { + "nebula_name": "EverEqTjsonbJsonb", + "sql_token": "EVEREQTJSONBJSONB", + "input_type": "tjsonb", + "meos_call": "ever_eq_tjsonb_jsonb", + "return_kind": "double", + "extra_headers": [ + "meos_json.h" + ], + "extra_args": [ + { + "kind": "jsonb_varsized" + } + ], + "build_generic": true, + "comment_one_liner": "Ever equal tjsonb vs jsonb" + }, + { + "nebula_name": "EverNeTjsonbJsonb", + "sql_token": "EVERNETJSONBJSONB", + "input_type": "tjsonb", + "meos_call": "ever_ne_tjsonb_jsonb", + "return_kind": "double", + "extra_headers": [ + "meos_json.h" + ], + "extra_args": [ + { + "kind": "jsonb_varsized" + } + ], + "build_generic": true, + "comment_one_liner": "Ever neual tjsonb vs jsonb" + }, + { + "nebula_name": "AlwaysEqTjsonbJsonb", + "sql_token": "ALWAYSEQTJSONBJSONB", + "input_type": "tjsonb", + "meos_call": "always_eq_tjsonb_jsonb", + "return_kind": "double", + "extra_headers": [ + "meos_json.h" + ], + "extra_args": [ + { + "kind": "jsonb_varsized" + } + ], + "build_generic": true, + "comment_one_liner": "Always equal tjsonb vs jsonb" + }, + { + "nebula_name": "AlwaysNeTjsonbJsonb", + "sql_token": "ALWAYSNETJSONBJSONB", + "input_type": "tjsonb", + "meos_call": "always_ne_tjsonb_jsonb", + "return_kind": "double", + "extra_headers": [ + "meos_json.h" + ], + "extra_args": [ + { + "kind": "jsonb_varsized" + } + ], + "build_generic": true, + "comment_one_liner": "Always neual tjsonb vs jsonb" + }, + { + "nebula_name": "EverEqTjsonbTjsonb", + "sql_token": "EVEREQTJSONBTJSONB", + "input_type": "tjsonb", + "meos_call": "ever_eq_tjsonb_tjsonb", + "return_kind": "double", + "extra_headers": [ + "meos_json.h" + ], + "extra_args": [ + { + "kind": "tjsonb" + } + ], + "build_generic": true, + "comment_one_liner": "Ever equal tjsonb vs tjsonb" + }, + { + "nebula_name": "EverNeTjsonbTjsonb", + "sql_token": "EVERNETJSONBTJSONB", + "input_type": "tjsonb", + "meos_call": "ever_ne_tjsonb_tjsonb", + "return_kind": "double", + "extra_headers": [ + "meos_json.h" + ], + "extra_args": [ + { + "kind": "tjsonb" + } + ], + "build_generic": true, + "comment_one_liner": "Ever neual tjsonb vs tjsonb" + }, + { + "nebula_name": "AlwaysEqTjsonbTjsonb", + "sql_token": "ALWAYSEQTJSONBTJSONB", + "input_type": "tjsonb", + "meos_call": "always_eq_tjsonb_tjsonb", + "return_kind": "double", + "extra_headers": [ + "meos_json.h" + ], + "extra_args": [ + { + "kind": "tjsonb" + } + ], + "build_generic": true, + "comment_one_liner": "Always equal tjsonb vs tjsonb" + }, + { + "nebula_name": "AlwaysNeTjsonbTjsonb", + "sql_token": "ALWAYSNETJSONBTJSONB", + "input_type": "tjsonb", + "meos_call": "always_ne_tjsonb_tjsonb", + "return_kind": "double", + "extra_headers": [ + "meos_json.h" + ], + "extra_args": [ + { + "kind": "tjsonb" + } + ], + "build_generic": true, + "comment_one_liner": "Always neual tjsonb vs tjsonb" + }, + { + "nebula_name": "NadTnpointGeo", + "sql_token": "NAD_TNPOINT_GEO", + "input_type": "tnpoint", + "meos_call": "nad_tnpoint_geo(temp, gs0)", + "return_kind": "double", + "extra_headers": [ + "meos_geo.h", + "meos_npoint.h" + ], + "extra_args": [ + { + "kind": "geom_wkt" + } + ], + "build_generic": true, + "comment_one_liner": "NAD tnpoint vs geo" + }, + { + "nebula_name": "NadTnpointNpoint", + "sql_token": "NAD_TNPOINT_NPOINT", + "input_type": "tnpoint", + "meos_call": "nad_tnpoint_npoint(temp, np0)", + "return_kind": "double", + "extra_headers": [ + "meos_npoint.h" + ], + "extra_args": [ + { + "kind": "npoint" + } + ], + "build_generic": true, + "comment_one_liner": "NAD tnpoint vs npoint" + }, + { + "nebula_name": "NadTnpointTnpoint", + "sql_token": "NAD_TNPOINT_TNPOINT", + "input_type": "tnpoint", + "meos_call": "nad_tnpoint_tnpoint(temp, inst0)", + "return_kind": "double", + "extra_headers": [ + "meos_npoint.h" + ], + "extra_args": [ + { + "kind": "tnpoint" + } + ], + "build_generic": true, + "comment_one_liner": "NAD tnpoint vs tnpoint" + }, + { + "nebula_name": "EverEqNpointTnpoint", + "sql_token": "EVEREQNPOINTTNPOINT", + "input_type": "tnpoint", + "meos_call": "ever_eq_npoint_tnpoint", + "return_kind": "double", + "extra_headers": [ + "meos_npoint.h" + ], + "extra_args": [ + { + "kind": "npoint" + } + ], + "build_generic": true, + "comment_one_liner": "Ever eq npoint vs tnpoint", + "scalar_first": true + }, + { + "nebula_name": "EverEqTnpointNpoint", + "sql_token": "EVEREQTNPOINTNPOINT", + "input_type": "tnpoint", + "meos_call": "ever_eq_tnpoint_npoint", + "return_kind": "double", + "extra_headers": [ + "meos_npoint.h" + ], + "extra_args": [ + { + "kind": "npoint" + } + ], + "build_generic": true, + "comment_one_liner": "Ever eq tnpoint vs npoint" + }, + { + "nebula_name": "EverEqTnpointTnpoint", + "sql_token": "EVEREQTNPOINTTNPOINT", + "input_type": "tnpoint", + "meos_call": "ever_eq_tnpoint_tnpoint", + "return_kind": "double", + "extra_headers": [ + "meos_npoint.h" + ], + "extra_args": [ + { + "kind": "tnpoint" + } + ], + "build_generic": true, + "comment_one_liner": "Ever eq tnpoint vs tnpoint" + }, + { + "nebula_name": "EverNeNpointTnpoint", + "sql_token": "EVERNENPOINTTNPOINT", + "input_type": "tnpoint", + "meos_call": "ever_ne_npoint_tnpoint", + "return_kind": "double", + "extra_headers": [ + "meos_npoint.h" + ], + "extra_args": [ + { + "kind": "npoint" + } + ], + "build_generic": true, + "comment_one_liner": "Ever ne npoint vs tnpoint", + "scalar_first": true + }, + { + "nebula_name": "EverNeTnpointNpoint", + "sql_token": "EVERNETNPOINTNPOINT", + "input_type": "tnpoint", + "meos_call": "ever_ne_tnpoint_npoint", + "return_kind": "double", + "extra_headers": [ + "meos_npoint.h" + ], + "extra_args": [ + { + "kind": "npoint" + } + ], + "build_generic": true, + "comment_one_liner": "Ever ne tnpoint vs npoint" + }, + { + "nebula_name": "EverNeTnpointTnpoint", + "sql_token": "EVERNETNPOINTTNPOINT", + "input_type": "tnpoint", + "meos_call": "ever_ne_tnpoint_tnpoint", + "return_kind": "double", + "extra_headers": [ + "meos_npoint.h" + ], + "extra_args": [ + { + "kind": "tnpoint" + } + ], + "build_generic": true, + "comment_one_liner": "Ever ne tnpoint vs tnpoint" + }, + { + "nebula_name": "AlwaysEqNpointTnpoint", + "sql_token": "ALWAYSEQNPOINTTNPOINT", + "input_type": "tnpoint", + "meos_call": "always_eq_npoint_tnpoint", + "return_kind": "double", + "extra_headers": [ + "meos_npoint.h" + ], + "extra_args": [ + { + "kind": "npoint" + } + ], + "build_generic": true, + "comment_one_liner": "Always eq npoint vs tnpoint", + "scalar_first": true + }, + { + "nebula_name": "AlwaysEqTnpointNpoint", + "sql_token": "ALWAYSEQTNPOINTNPOINT", + "input_type": "tnpoint", + "meos_call": "always_eq_tnpoint_npoint", + "return_kind": "double", + "extra_headers": [ + "meos_npoint.h" + ], + "extra_args": [ + { + "kind": "npoint" + } + ], + "build_generic": true, + "comment_one_liner": "Always eq tnpoint vs npoint" + }, + { + "nebula_name": "AlwaysEqTnpointTnpoint", + "sql_token": "ALWAYSEQTNPOINTTNPOINT", + "input_type": "tnpoint", + "meos_call": "always_eq_tnpoint_tnpoint", + "return_kind": "double", + "extra_headers": [ + "meos_npoint.h" + ], + "extra_args": [ + { + "kind": "tnpoint" + } + ], + "build_generic": true, + "comment_one_liner": "Always eq tnpoint vs tnpoint" + }, + { + "nebula_name": "AlwaysNeNpointTnpoint", + "sql_token": "ALWAYSNENPOINTTNPOINT", + "input_type": "tnpoint", + "meos_call": "always_ne_npoint_tnpoint", + "return_kind": "double", + "extra_headers": [ + "meos_npoint.h" + ], + "extra_args": [ + { + "kind": "npoint" + } + ], + "build_generic": true, + "comment_one_liner": "Always ne npoint vs tnpoint", + "scalar_first": true + }, + { + "nebula_name": "AlwaysNeTnpointNpoint", + "sql_token": "ALWAYSNETNPOINTNPOINT", + "input_type": "tnpoint", + "meos_call": "always_ne_tnpoint_npoint", + "return_kind": "double", + "extra_headers": [ + "meos_npoint.h" + ], + "extra_args": [ + { + "kind": "npoint" + } + ], + "build_generic": true, + "comment_one_liner": "Always ne tnpoint vs npoint" + }, + { + "nebula_name": "AlwaysNeTnpointTnpoint", + "sql_token": "ALWAYSNETNPOINTTNPOINT", + "input_type": "tnpoint", + "meos_call": "always_ne_tnpoint_tnpoint", + "return_kind": "double", + "extra_headers": [ + "meos_npoint.h" + ], + "extra_args": [ + { + "kind": "tnpoint" + } + ], + "build_generic": true, + "comment_one_liner": "Always ne tnpoint vs tnpoint" + }, + { + "nebula_name": "NadTposePose", + "sql_token": "NAD_TPOSE_POSE", + "input_type": "tpose", + "meos_call": "nad_tpose_pose(temp, pose0)", + "return_kind": "double", + "extra_headers": [ + "meos_geo.h", + "meos_pose.h" + ], + "extra_args": [ + { + "kind": "pose" + } + ], + "build_generic": true, + "comment_one_liner": "NAD tpose vs pose" + }, + { + "nebula_name": "NadTposeTpose", + "sql_token": "NAD_TPOSE_TPOSE", + "input_type": "tpose", + "meos_call": "nad_tpose_tpose(temp, inst0)", + "return_kind": "double", + "extra_headers": [ + "meos_pose.h" + ], + "extra_args": [ + { + "kind": "tpose" + } + ], + "build_generic": true, + "comment_one_liner": "NAD tpose vs tpose" + }, + { + "nebula_name": "NadTposeGeo", + "sql_token": "NAD_TPOSE_GEO", + "input_type": "tpose", + "meos_call": "nad_tpose_geo(temp, gs0)", + "return_kind": "double", + "extra_headers": [ + "meos_geo.h", + "meos_pose.h" + ], + "extra_args": [ + { + "kind": "geom_wkt" + } + ], + "build_generic": true, + "comment_one_liner": "NAD tpose vs geo" + }, + { + "nebula_name": "EverEqPoseTpose", + "sql_token": "EVEREQPOSETPOSE", + "input_type": "tpose", + "meos_call": "ever_eq_pose_tpose", + "return_kind": "double", + "extra_headers": [ + "meos_pose.h" + ], + "extra_args": [ + { + "kind": "pose" + } + ], + "build_generic": true, + "comment_one_liner": "Ever eq pose vs tpose", + "scalar_first": true + }, + { + "nebula_name": "EverEqTposePose", + "sql_token": "EVEREQTPOSEPOSE", + "input_type": "tpose", + "meos_call": "ever_eq_tpose_pose", + "return_kind": "double", + "extra_headers": [ + "meos_pose.h" + ], + "extra_args": [ + { + "kind": "pose" + } + ], + "build_generic": true, + "comment_one_liner": "Ever eq tpose vs pose" + }, + { + "nebula_name": "EverEqTposeTpose", + "sql_token": "EVEREQTPOSETPOSE", + "input_type": "tpose", + "meos_call": "ever_eq_tpose_tpose", + "return_kind": "double", + "extra_headers": [ + "meos_pose.h" + ], + "extra_args": [ + { + "kind": "tpose" + } + ], + "build_generic": true, + "comment_one_liner": "Ever eq tpose vs tpose" + }, + { + "nebula_name": "EverNePoseTpose", + "sql_token": "EVERNEPOSETPOSE", + "input_type": "tpose", + "meos_call": "ever_ne_pose_tpose", + "return_kind": "double", + "extra_headers": [ + "meos_pose.h" + ], + "extra_args": [ + { + "kind": "pose" + } + ], + "build_generic": true, + "comment_one_liner": "Ever ne pose vs tpose", + "scalar_first": true + }, + { + "nebula_name": "EverNeTposePose", + "sql_token": "EVERNETPOSEPOSE", + "input_type": "tpose", + "meos_call": "ever_ne_tpose_pose", + "return_kind": "double", + "extra_headers": [ + "meos_pose.h" + ], + "extra_args": [ + { + "kind": "pose" + } + ], + "build_generic": true, + "comment_one_liner": "Ever ne tpose vs pose" + }, + { + "nebula_name": "EverNeTposeTpose", + "sql_token": "EVERNETPOSETPOSE", + "input_type": "tpose", + "meos_call": "ever_ne_tpose_tpose", + "return_kind": "double", + "extra_headers": [ + "meos_pose.h" + ], + "extra_args": [ + { + "kind": "tpose" + } + ], + "build_generic": true, + "comment_one_liner": "Ever ne tpose vs tpose" + }, + { + "nebula_name": "AlwaysEqPoseTpose", + "sql_token": "ALWAYSEQPOSETPOSE", + "input_type": "tpose", + "meos_call": "always_eq_pose_tpose", + "return_kind": "double", + "extra_headers": [ + "meos_pose.h" + ], + "extra_args": [ + { + "kind": "pose" + } + ], + "build_generic": true, + "comment_one_liner": "Always eq pose vs tpose", + "scalar_first": true + }, + { + "nebula_name": "AlwaysEqTposePose", + "sql_token": "ALWAYSEQTPOSEPOSE", + "input_type": "tpose", + "meos_call": "always_eq_tpose_pose", + "return_kind": "double", + "extra_headers": [ + "meos_pose.h" + ], + "extra_args": [ + { + "kind": "pose" + } + ], + "build_generic": true, + "comment_one_liner": "Always eq tpose vs pose" + }, + { + "nebula_name": "AlwaysEqTposeTpose", + "sql_token": "ALWAYSEQTPOSETPOSE", + "input_type": "tpose", + "meos_call": "always_eq_tpose_tpose", + "return_kind": "double", + "extra_headers": [ + "meos_pose.h" + ], + "extra_args": [ + { + "kind": "tpose" + } + ], + "build_generic": true, + "comment_one_liner": "Always eq tpose vs tpose" + }, + { + "nebula_name": "AlwaysNePoseTpose", + "sql_token": "ALWAYSNEPOSETPOSE", + "input_type": "tpose", + "meos_call": "always_ne_pose_tpose", + "return_kind": "double", + "extra_headers": [ + "meos_pose.h" + ], + "extra_args": [ + { + "kind": "pose" + } + ], + "build_generic": true, + "comment_one_liner": "Always ne pose vs tpose", + "scalar_first": true + }, + { + "nebula_name": "AlwaysNeTposePose", + "sql_token": "ALWAYSNETPOSEPOSE", + "input_type": "tpose", + "meos_call": "always_ne_tpose_pose", + "return_kind": "double", + "extra_headers": [ + "meos_pose.h" + ], + "extra_args": [ + { + "kind": "pose" + } + ], + "build_generic": true, + "comment_one_liner": "Always ne tpose vs pose" + }, + { + "nebula_name": "AlwaysNeTposeTpose", + "sql_token": "ALWAYSNETPOSETPOSE", + "input_type": "tpose", + "meos_call": "always_ne_tpose_tpose", + "return_kind": "double", + "extra_headers": [ + "meos_pose.h" + ], + "extra_args": [ + { + "kind": "tpose" + } + ], + "build_generic": true, + "comment_one_liner": "Always ne tpose vs tpose" + }, + { + "nebula_name": "GeomBoundary", + "sql_token": "GEOMBOUNDARY", + "input_type": "geom_wkt", + "meos_call": "geom_boundary", + "return_kind": "varsized_geom", + "extra_headers": [ + "meos_geo.h" + ], + "extra_args": [], + "build_generic": true, + "comment_one_liner": "Geometry geom boundary" + }, + { + "nebula_name": "GeomCentroid", + "sql_token": "GEOMCENTROID", + "input_type": "geom_wkt", + "meos_call": "geom_centroid", + "return_kind": "varsized_geom", + "extra_headers": [ + "meos_geo.h" + ], + "extra_args": [], + "build_generic": true, + "comment_one_liner": "Geometry geom centroid" + }, + { + "nebula_name": "GeomConvexHull", + "sql_token": "GEOMCONVEXHULL", + "input_type": "geom_wkt", + "meos_call": "geom_convex_hull", + "return_kind": "varsized_geom", + "extra_headers": [ + "meos_geo.h" + ], + "extra_args": [], + "build_generic": true, + "comment_one_liner": "Geometry geom convex hull" + }, + { + "nebula_name": "GeoReverse", + "sql_token": "GEOREVERSE", + "input_type": "geom_wkt", + "meos_call": "geo_reverse", + "return_kind": "varsized_geom", + "extra_headers": [ + "meos_geo.h" + ], + "extra_args": [], + "build_generic": true, + "comment_one_liner": "Geometry geo reverse" + }, + { + "nebula_name": "GeoPoints", + "sql_token": "GEOPOINTS", + "input_type": "geom_wkt", + "meos_call": "geo_points", + "return_kind": "varsized_geom", + "extra_headers": [ + "meos_geo.h" + ], + "extra_args": [], + "build_generic": true, + "comment_one_liner": "Geometry geo points" + }, + { + "nebula_name": "GeomUnaryUnion", + "sql_token": "GEOMUNARYUNION", + "input_type": "geom_wkt", + "meos_call": "geom_unary_union", + "return_kind": "varsized_geom", + "extra_headers": [ + "meos_geo.h" + ], + "extra_args": [], + "build_generic": true, + "comment_one_liner": "Geometry geom unary union" + }, + { + "nebula_name": "GeoSetSrid", + "sql_token": "GEO_SET_SRID", + "input_type": "geom_wkt", + "meos_call": "geo_set_srid(temp, (int32_t)srid)", + "return_kind": "varsized_geom", + "extra_headers": [ + "meos_geo.h" + ], + "extra_args": [ + { + "kind": "uint64_scalar", + "cast": "int32_t" + } + ], + "build_generic": true, + "comment_one_liner": "Set geometry SRID" + }, + { + "nebula_name": "GeoRound", + "sql_token": "GEO_ROUND", + "input_type": "geom_wkt", + "meos_call": "geo_round(temp, (int)dec)", + "return_kind": "varsized_geom", + "extra_headers": [ + "meos_geo.h" + ], + "extra_args": [ + { + "kind": "int_scalar" + } + ], + "build_generic": true, + "comment_one_liner": "Round geometry coordinates" + }, + { + "nebula_name": "GeoTransform", + "sql_token": "GEO_TRANSFORM", + "input_type": "geom_wkt", + "meos_call": "geo_transform(temp, (int32_t)srid)", + "return_kind": "varsized_geom", + "extra_headers": [ + "meos_geo.h" + ], + "extra_args": [ + { + "kind": "uint64_scalar", + "cast": "int32_t" + } + ], + "build_generic": true, + "comment_one_liner": "Transform geometry SRID" + }, + { + "nebula_name": "GeoSrid", + "sql_token": "GEOSRID", + "input_type": "geom_wkt", + "meos_call": "geo_srid", + "return_kind": "double", + "extra_headers": [ + "meos_geo.h" + ], + "extra_args": [], + "build_generic": true, + "comment_one_liner": "Get geometry SRID" + }, + { + "nebula_name": "GeoNumGeos", + "sql_token": "GEONUMGEOS", + "input_type": "geom_wkt", + "meos_call": "geo_num_geos", + "return_kind": "double", + "extra_headers": [ + "meos_geo.h" + ], + "extra_args": [], + "build_generic": true, + "comment_one_liner": "Count geometry components" + }, + { + "nebula_name": "GeoNumPoints", + "sql_token": "GEONUMPOINTS", + "input_type": "geom_wkt", + "meos_call": "geo_num_points", + "return_kind": "double", + "extra_headers": [ + "meos_geo.h" + ], + "extra_args": [], + "build_generic": true, + "comment_one_liner": "Count geometry points" + }, + { + "nebula_name": "GeomLength", + "sql_token": "GEOMLENGTH", + "input_type": "geom_wkt", + "meos_call": "geom_length", + "return_kind": "double", + "extra_headers": [ + "meos_geo.h" + ], + "extra_args": [], + "build_generic": true, + "comment_one_liner": "Geometry length" + }, + { + "nebula_name": "GeomPerimeter", + "sql_token": "GEOMPERIMETER", + "input_type": "geom_wkt", + "meos_call": "geom_perimeter", + "return_kind": "double", + "extra_headers": [ + "meos_geo.h" + ], + "extra_args": [], + "build_generic": true, + "comment_one_liner": "Geometry perimeter" + }, + { + "nebula_name": "GeomIsEmpty", + "sql_token": "GEOMISEMPTY", + "input_type": "geom_wkt", + "meos_call": "geom_is_empty", + "return_kind": "double", + "extra_headers": [ + "meos_geo.h" + ], + "extra_args": [], + "build_generic": true, + "comment_one_liner": "Is geometry empty" + }, + { + "nebula_name": "GeomAzimuth", + "sql_token": "GEOMAZIMUTH", + "input_type": "geom_wkt", + "meos_call": "geom_azimuth", + "return_kind": "double", + "extra_headers": [ + "meos_geo.h" + ], + "extra_args": [], + "build_generic": true, + "comment_one_liner": "Geometry azimuth (single point)" + }, + { + "nebula_name": "GeoIsUnitary", + "sql_token": "GEOISUNITARY", + "input_type": "geom_wkt", + "meos_call": "geo_is_unitary", + "return_kind": "double", + "extra_headers": [ + "meos_geo.h" + ], + "extra_args": [], + "build_generic": true, + "comment_one_liner": "Is geometry unitary" + }, + { + "nebula_name": "GeoEquals", + "sql_token": "GEOEQUALS", + "input_type": "geom_wkt", + "meos_call": "geom_equals", + "return_kind": "double", + "extra_headers": [ + "meos_geo.h" + ], + "extra_args": [ + { + "kind": "geom_wkt" + } + ], + "build_generic": true, + "comment_one_liner": "Geometry equals" + }, + { + "nebula_name": "GeoSame", + "sql_token": "GEOSAME", + "input_type": "geom_wkt", + "meos_call": "geo_same", + "return_kind": "double", + "extra_headers": [ + "meos_geo.h" + ], + "extra_args": [ + { + "kind": "geom_wkt" + } + ], + "build_generic": true, + "comment_one_liner": "Geometry same" + }, + { + "nebula_name": "GeomIntersects", + "sql_token": "GEOMINTERSECTS", + "input_type": "geom_wkt", + "meos_call": "geom_intersects", + "return_kind": "double", + "extra_headers": [ + "meos_geo.h" + ], + "extra_args": [ + { + "kind": "geom_wkt" + } + ], + "build_generic": true, + "comment_one_liner": "Geometry intersects" + }, + { + "nebula_name": "GeomIntersects2d", + "sql_token": "GEOMINTERSECTS2D", + "input_type": "geom_wkt", + "meos_call": "geom_intersects2d", + "return_kind": "double", + "extra_headers": [ + "meos_geo.h" + ], + "extra_args": [ + { + "kind": "geom_wkt" + } + ], + "build_generic": true, + "comment_one_liner": "Geometry intersects 2D" + }, + { + "nebula_name": "GeomIntersects3d", + "sql_token": "GEOMINTERSECTS3D", + "input_type": "geom_wkt", + "meos_call": "geom_intersects3d", + "return_kind": "double", + "extra_headers": [ + "meos_geo.h" + ], + "extra_args": [ + { + "kind": "geom_wkt" + } + ], + "build_generic": true, + "comment_one_liner": "Geometry intersects 3D" + }, + { + "nebula_name": "GeomContains", + "sql_token": "GEOMCONTAINS", + "input_type": "geom_wkt", + "meos_call": "geom_contains", + "return_kind": "double", + "extra_headers": [ + "meos_geo.h" + ], + "extra_args": [ + { + "kind": "geom_wkt" + } + ], + "build_generic": true, + "comment_one_liner": "Geometry contains" + }, + { + "nebula_name": "GeomCovers", + "sql_token": "GEOMCOVERS", + "input_type": "geom_wkt", + "meos_call": "geom_covers", + "return_kind": "double", + "extra_headers": [ + "meos_geo.h" + ], + "extra_args": [ + { + "kind": "geom_wkt" + } + ], + "build_generic": true, + "comment_one_liner": "Geometry covers" + }, + { + "nebula_name": "GeomDisjoint2d", + "sql_token": "GEOMDISJOINT2D", + "input_type": "geom_wkt", + "meos_call": "geom_disjoint2d", + "return_kind": "double", + "extra_headers": [ + "meos_geo.h" + ], + "extra_args": [ + { + "kind": "geom_wkt" + } + ], + "build_generic": true, + "comment_one_liner": "Geometry disjoint 2D" + }, + { + "nebula_name": "GeomTouches", + "sql_token": "GEOMTOUCHES", + "input_type": "geom_wkt", + "meos_call": "geom_touches", + "return_kind": "double", + "extra_headers": [ + "meos_geo.h" + ], + "extra_args": [ + { + "kind": "geom_wkt" + } + ], + "build_generic": true, + "comment_one_liner": "Geometry touches" + }, + { + "nebula_name": "GeogIntersects", + "sql_token": "GEOGINTERSECTS", + "input_type": "geom_wkt", + "meos_call": "geog_intersects", + "return_kind": "double", + "extra_headers": [ + "meos_geo.h" + ], + "extra_args": [ + { + "kind": "geom_wkt" + } + ], + "build_generic": true, + "comment_one_liner": "Geography intersects" + }, + { + "nebula_name": "GeogDistance", + "sql_token": "GEOGDISTANCE", + "input_type": "geom_wkt", + "meos_call": "geog_distance", + "return_kind": "double", + "extra_headers": [ + "meos_geo.h" + ], + "extra_args": [ + { + "kind": "geom_wkt" + } + ], + "build_generic": true, + "comment_one_liner": "Geography distance" + }, + { + "nebula_name": "LineLocatePoint", + "sql_token": "LINELOCATEPOINT", + "input_type": "geom_wkt", + "meos_call": "line_locate_point", + "return_kind": "double", + "extra_headers": [ + "meos_geo.h" + ], + "extra_args": [ + { + "kind": "geom_wkt" + } + ], + "build_generic": true, + "comment_one_liner": "Locate point on line" + }, + { + "nebula_name": "GeomDistance2d", + "sql_token": "GEOMDISTANCE2D", + "input_type": "geom_wkt", + "meos_call": "geom_distance2d", + "return_kind": "double", + "extra_headers": [ + "meos_geo.h" + ], + "extra_args": [ + { + "kind": "geom_wkt" + } + ], + "build_generic": true, + "comment_one_liner": "Geometry 2D distance" + }, + { + "nebula_name": "GeomDistance3d", + "sql_token": "GEOMDISTANCE3D", + "input_type": "geom_wkt", + "meos_call": "geom_distance3d", + "return_kind": "double", + "extra_headers": [ + "meos_geo.h" + ], + "extra_args": [ + { + "kind": "geom_wkt" + } + ], + "build_generic": true, + "comment_one_liner": "Geometry 3D distance" + }, + { + "nebula_name": "GeomDwithin2d", + "sql_token": "GEOMDWITHIN2D", + "input_type": "geom_wkt", + "meos_call": "geom_dwithin2d", + "return_kind": "double", + "extra_headers": [ + "meos_geo.h" + ], + "extra_args": [ + { + "kind": "geom_wkt" + }, + { + "kind": "scalar", + "cpp": "double" + } + ], + "build_generic": true, + "comment_one_liner": "geom_dwithin2d with distance" + }, + { + "nebula_name": "GeomDwithin3d", + "sql_token": "GEOMDWITHIN3D", + "input_type": "geom_wkt", + "meos_call": "geom_dwithin3d", + "return_kind": "double", + "extra_headers": [ + "meos_geo.h" + ], + "extra_args": [ + { + "kind": "geom_wkt" + }, + { + "kind": "scalar", + "cpp": "double" + } + ], + "build_generic": true, + "comment_one_liner": "geom_dwithin3d with distance" + }, + { + "nebula_name": "GeogDwithin", + "sql_token": "GEOGDWITHIN", + "input_type": "geom_wkt", + "meos_call": "geog_dwithin", + "return_kind": "double", + "extra_headers": [ + "meos_geo.h" + ], + "extra_args": [ + { + "kind": "geom_wkt" + }, + { + "kind": "scalar", + "cpp": "double" + } + ], + "build_generic": true, + "comment_one_liner": "geog_dwithin with distance" + }, + { + "nebula_name": "GeomDwithin", + "sql_token": "GEOMDWITHIN", + "input_type": "geom_wkt", + "meos_call": "geom_dwithin", + "return_kind": "double", + "extra_headers": [ + "meos_geo.h" + ], + "extra_args": [ + { + "kind": "geom_wkt" + }, + { + "kind": "scalar", + "cpp": "double" + } + ], + "build_generic": true, + "comment_one_liner": "geom_dwithin with distance" + }, + { + "nebula_name": "GeomIntersection2d", + "sql_token": "GEOMINTERSECTION2D", + "input_type": "geom_wkt", + "meos_call": "geom_intersection2d", + "return_kind": "varsized_geom", + "extra_headers": [ + "meos_geo.h" + ], + "extra_args": [ + { + "kind": "geom_wkt" + } + ], + "build_generic": true, + "comment_one_liner": "geom_intersection2d" + }, + { + "nebula_name": "GeomIntersection2dColl", + "sql_token": "GEOMINTERSECTION2DCOLL", + "input_type": "geom_wkt", + "meos_call": "geom_intersection2d_coll", + "return_kind": "varsized_geom", + "extra_headers": [ + "meos_geo.h" + ], + "extra_args": [ + { + "kind": "geom_wkt" + } + ], + "build_generic": true, + "comment_one_liner": "geom_intersection2d_coll" + }, + { + "nebula_name": "GeomDifference2d", + "sql_token": "GEOMDIFFERENCE2D", + "input_type": "geom_wkt", + "meos_call": "geom_difference2d", + "return_kind": "varsized_geom", + "extra_headers": [ + "meos_geo.h" + ], + "extra_args": [ + { + "kind": "geom_wkt" + } + ], + "build_generic": true, + "comment_one_liner": "geom_difference2d" + }, + { + "nebula_name": "GeomShortestline2d", + "sql_token": "GEOMSHORTESTLINE2D", + "input_type": "geom_wkt", + "meos_call": "geom_shortestline2d", + "return_kind": "varsized_geom", + "extra_headers": [ + "meos_geo.h" + ], + "extra_args": [ + { + "kind": "geom_wkt" + } + ], + "build_generic": true, + "comment_one_liner": "geom_shortestline2d" + }, + { + "nebula_name": "GeomShortestline3d", + "sql_token": "GEOMSHORTESTLINE3D", + "input_type": "geom_wkt", + "meos_call": "geom_shortestline3d", + "return_kind": "varsized_geom", + "extra_headers": [ + "meos_geo.h" + ], + "extra_args": [ + { + "kind": "geom_wkt" + } + ], + "build_generic": true, + "comment_one_liner": "geom_shortestline3d" + }, + { + "nebula_name": "LineInterpolatePoint", + "sql_token": "LINE_INTERPOLATE_POINT", + "input_type": "geom_wkt", + "meos_call": "line_interpolate_point(temp, arg0)", + "return_kind": "varsized_geom", + "extra_headers": [ + "meos_geo.h" + ], + "extra_args": [ + { + "kind": "scalar", + "cpp": "double" + } + ], + "build_generic": true, + "comment_one_liner": "Interpolate point on line" + }, + { + "nebula_name": "LineSubstring", + "sql_token": "LINE_SUBSTRING", + "input_type": "geom_wkt", + "meos_call": "line_substring(temp, arg0, arg1)", + "return_kind": "varsized_geom", + "extra_headers": [ + "meos_geo.h" + ], + "extra_args": [ + { + "kind": "scalar", + "cpp": "double" + }, + { + "kind": "scalar", + "cpp": "double" + } + ], + "build_generic": true, + "comment_one_liner": "Line substring" + }, + { + "nebula_name": "LineNumpoints", + "sql_token": "LINE_NUMPOINTS", + "input_type": "geom_wkt", + "meos_call": "line_numpoints(temp)", + "return_kind": "double", + "extra_headers": [ + "meos_geo.h" + ], + "extra_args": [], + "build_generic": true, + "comment_one_liner": "Line num points" + }, + { + "nebula_name": "LinePointN", + "sql_token": "LINE_POINT_N", + "input_type": "geom_wkt", + "meos_call": "line_point_n(temp, (int)arg0)", + "return_kind": "varsized_geom", + "extra_headers": [ + "meos_geo.h" + ], + "extra_args": [ + { + "kind": "int_scalar" + } + ], + "build_generic": true, + "comment_one_liner": "Nth point on line" + }, + { + "nebula_name": "GeoGeoN", + "sql_token": "GEO_GEO_N", + "input_type": "geom_wkt", + "meos_call": "geo_geo_n(temp, (int)arg0)", + "return_kind": "varsized_geom", + "extra_headers": [ + "meos_geo.h" + ], + "extra_args": [ + { + "kind": "int_scalar" + } + ], + "build_generic": true, + "comment_one_liner": "Nth geometry in collection" + }, + { + "nebula_name": "GeoAsEwkt", + "sql_token": "GEO_AS_EWKT", + "input_type": "geom_wkt", + "meos_call": "geo_as_ewkt(temp, (int)arg0)", + "return_kind": "varsized_cstring", + "extra_headers": [ + "meos_geo.h" + ], + "extra_args": [ + { + "kind": "int_scalar" + } + ], + "build_generic": true, + "comment_one_liner": "Geometry as EWKT" + }, + { + "nebula_name": "GeoAsGeojson", + "sql_token": "GEO_AS_GEOJSON", + "input_type": "geom_wkt", + "meos_call": "geo_as_geojson(temp, (int)arg0, (int)arg1, nullptr)", + "return_kind": "varsized_cstring", + "extra_headers": [ + "meos_geo.h" + ], + "extra_args": [ + { + "kind": "int_scalar" + }, + { + "kind": "int_scalar" + } + ], + "build_generic": true, + "comment_one_liner": "Geometry as GeoJSON" + }, + { + "nebula_name": "GeomPointMake2d", + "sql_token": "GEOM_POINT_MAKE2D", + "input_type": "static_scalar", + "meos_call": "geompoint_make2d((int32_t)srid, x, y)", + "return_kind": "varsized_geom", + "extra_headers": [ + "meos_geo.h" + ], + "extra_args": [], + "build_generic": true, + "comment_one_liner": "Make 2D geometry point", + "primary_fields": [ + [ + "srid", + "uint64_t" + ], + [ + "x", + "double" + ], + [ + "y", + "double" + ] + ] + }, + { + "nebula_name": "GeomPointMake3dz", + "sql_token": "GEOM_POINT_MAKE3DZ", + "input_type": "static_scalar", + "meos_call": "geompoint_make3dz((int32_t)srid, x, y, z)", + "return_kind": "varsized_geom", + "extra_headers": [ + "meos_geo.h" + ], + "extra_args": [], + "build_generic": true, + "comment_one_liner": "Make 3D geometry point", + "primary_fields": [ + [ + "srid", + "uint64_t" + ], + [ + "x", + "double" + ], + [ + "y", + "double" + ], + [ + "z", + "double" + ] + ] + }, + { + "nebula_name": "GeogPointMake2d", + "sql_token": "GEOG_POINT_MAKE2D", + "input_type": "static_scalar", + "meos_call": "geogpoint_make2d((int32_t)srid, x, y)", + "return_kind": "varsized_geom", + "extra_headers": [ + "meos_geo.h" + ], + "extra_args": [], + "build_generic": true, + "comment_one_liner": "Make 2D geography point", + "primary_fields": [ + [ + "srid", + "uint64_t" + ], + [ + "x", + "double" + ], + [ + "y", + "double" + ] + ] + }, + { + "nebula_name": "GeogPointMake3dz", + "sql_token": "GEOG_POINT_MAKE3DZ", + "input_type": "static_scalar", + "meos_call": "geogpoint_make3dz((int32_t)srid, x, y, z)", + "return_kind": "varsized_geom", + "extra_headers": [ + "meos_geo.h" + ], + "extra_args": [], + "build_generic": true, + "comment_one_liner": "Make 3D geography point", + "primary_fields": [ + [ + "srid", + "uint64_t" + ], + [ + "x", + "double" + ], + [ + "y", + "double" + ], + [ + "z", + "double" + ] + ] + }, + { + "nebula_name": "GeogArea", + "sql_token": "GEOGAREA", + "input_type": "geog_wkt", + "meos_call": "geog_area", + "return_kind": "double", + "extra_headers": [ + "meos_geo.h" + ], + "extra_args": [], + "build_generic": true, + "comment_one_liner": "geog area" + }, + { + "nebula_name": "GeogLength", + "sql_token": "GEOGLENGTH", + "input_type": "geog_wkt", + "meos_call": "geog_length", + "return_kind": "double", + "extra_headers": [ + "meos_geo.h" + ], + "extra_args": [], + "build_generic": true, + "comment_one_liner": "geog length" + }, + { + "nebula_name": "GeogPerimeter", + "sql_token": "GEOGPERIMETER", + "input_type": "geog_wkt", + "meos_call": "geog_perimeter", + "return_kind": "double", + "extra_headers": [ + "meos_geo.h" + ], + "extra_args": [], + "build_generic": true, + "comment_one_liner": "geog perimeter" + }, + { + "nebula_name": "GeogToGeom", + "sql_token": "GEOGTOGEOM", + "input_type": "geog_wkt", + "meos_call": "geog_to_geom", + "return_kind": "varsized_geom", + "extra_headers": [ + "meos_geo.h" + ], + "extra_args": [], + "build_generic": true, + "comment_one_liner": "geog to geom" + }, + { + "nebula_name": "GeomToGeog", + "sql_token": "GEOMTOGEOG", + "input_type": "geog_wkt", + "meos_call": "geom_to_geog", + "return_kind": "varsized_geom", + "extra_headers": [ + "meos_geo.h" + ], + "extra_args": [], + "build_generic": true, + "comment_one_liner": "geom to geog" + }, + { + "nebula_name": "GeogCentroid", + "sql_token": "GEOG_CENTROID", + "input_type": "geog_wkt", + "meos_call": "geog_centroid(temp, (bool)arg0)", + "return_kind": "varsized_geom", + "extra_headers": [ + "meos_geo.h" + ], + "extra_args": [ + { + "kind": "bool_scalar" + } + ], + "build_generic": true, + "comment_one_liner": "Geography centroid" + }, + { + "nebula_name": "IntspanLower", + "sql_token": "INTSPANLOWER", + "input_type": "intspan_wkt", + "meos_call": "intspan_lower", + "return_kind": "double", + "extra_headers": [], + "extra_args": [], + "build_generic": true, + "comment_one_liner": "Intspan lower" + }, + { + "nebula_name": "IntspanUpper", + "sql_token": "INTSPANUPPER", + "input_type": "intspan_wkt", + "meos_call": "intspan_upper", + "return_kind": "double", + "extra_headers": [], + "extra_args": [], + "build_generic": true, + "comment_one_liner": "Intspan upper" + }, + { + "nebula_name": "IntspanWidth", + "sql_token": "INTSPANWIDTH", + "input_type": "intspan_wkt", + "meos_call": "intspan_width", + "return_kind": "double", + "extra_headers": [], + "extra_args": [], + "build_generic": true, + "comment_one_liner": "Intspan width" + }, + { + "nebula_name": "IntspanLowerInc", + "sql_token": "INTSPANLOWERINC", + "input_type": "intspan_wkt", + "meos_call": "span_lower_inc", + "return_kind": "double", + "extra_headers": [], + "extra_args": [], + "build_generic": true, + "comment_one_liner": "Intspan lower_inc" + }, + { + "nebula_name": "IntspanUpperInc", + "sql_token": "INTSPANUPPERINC", + "input_type": "intspan_wkt", + "meos_call": "span_upper_inc", + "return_kind": "double", + "extra_headers": [], + "extra_args": [], + "build_generic": true, + "comment_one_liner": "Intspan upper_inc" + }, + { + "nebula_name": "FloatspanLower", + "sql_token": "FLOATSPANLOWER", + "input_type": "floatspan_wkt", + "meos_call": "floatspan_lower", + "return_kind": "double", + "extra_headers": [], + "extra_args": [], + "build_generic": true, + "comment_one_liner": "Floatspan lower" + }, + { + "nebula_name": "FloatspanUpper", + "sql_token": "FLOATSPANUPPER", + "input_type": "floatspan_wkt", + "meos_call": "floatspan_upper", + "return_kind": "double", + "extra_headers": [], + "extra_args": [], + "build_generic": true, + "comment_one_liner": "Floatspan upper" + }, + { + "nebula_name": "FloatspanWidth", + "sql_token": "FLOATSPANWIDTH", + "input_type": "floatspan_wkt", + "meos_call": "floatspan_width", + "return_kind": "double", + "extra_headers": [], + "extra_args": [], + "build_generic": true, + "comment_one_liner": "Floatspan width" + }, + { + "nebula_name": "FloatspanLowerInc", + "sql_token": "FLOATSPANLOWERINC", + "input_type": "floatspan_wkt", + "meos_call": "span_lower_inc", + "return_kind": "double", + "extra_headers": [], + "extra_args": [], + "build_generic": true, + "comment_one_liner": "Floatspan lower_inc" + }, + { + "nebula_name": "FloatspanUpperInc", + "sql_token": "FLOATSPANUPPERINC", + "input_type": "floatspan_wkt", + "meos_call": "span_upper_inc", + "return_kind": "double", + "extra_headers": [], + "extra_args": [], + "build_generic": true, + "comment_one_liner": "Floatspan upper_inc" + }, + { + "nebula_name": "ContainedIntSpan", + "sql_token": "CONTAINED_INT_SPAN", + "input_type": "intspan_wkt", + "meos_call": "contained_int_span((int)arg0, temp)", + "return_kind": "double", + "extra_headers": [], + "extra_args": [ + { + "kind": "int_scalar" + } + ], + "build_generic": true, + "comment_one_liner": "Int contained in span", + "scalar_first": true + }, + { + "nebula_name": "ContainedFloatSpan", + "sql_token": "CONTAINED_FLOAT_SPAN", + "input_type": "floatspan_wkt", + "meos_call": "contained_float_span(arg0, temp)", + "return_kind": "double", + "extra_headers": [], + "extra_args": [ + { + "kind": "scalar", + "cpp": "double" + } + ], + "build_generic": true, + "comment_one_liner": "Float contained in span", + "scalar_first": true + }, + { + "nebula_name": "ContainedSpanSpan", + "sql_token": "CONTAINED_SPAN_SPAN", + "input_type": "intspan_wkt", + "meos_call": "contained_span_span(temp, sp0)", + "return_kind": "double", + "extra_headers": [], + "extra_args": [ + { + "kind": "box", + "box_type": "Span", + "parser": "intspan_in" + } + ], + "build_generic": true, + "comment_one_liner": "Intspan contained in intspan" + }, + { + "nebula_name": "ContainedFloatspanSpan", + "sql_token": "CONTAINED_FLOATSPAN_SPAN", + "input_type": "floatspan_wkt", + "meos_call": "contained_span_span(temp, sp0)", + "return_kind": "double", + "extra_headers": [], + "extra_args": [ + { + "kind": "box", + "box_type": "Span", + "parser": "floatspan_in" + } + ], + "build_generic": true, + "comment_one_liner": "Floatspan contained in floatspan" + }, + { + "nebula_name": "ContainsSpanInt", + "sql_token": "CONTAINS_SPAN_INT", + "input_type": "intspan_wkt", + "meos_call": "contains_span_int(temp, (int)arg0)", + "return_kind": "double", + "extra_headers": [], + "extra_args": [ + { + "kind": "int_scalar" + } + ], + "build_generic": true, + "comment_one_liner": "Intspan contains int" + }, + { + "nebula_name": "ContainsSpanFloat", + "sql_token": "CONTAINS_SPAN_FLOAT", + "input_type": "floatspan_wkt", + "meos_call": "contains_span_float(temp, arg0)", + "return_kind": "double", + "extra_headers": [], + "extra_args": [ + { + "kind": "scalar", + "cpp": "double" + } + ], + "build_generic": true, + "comment_one_liner": "Floatspan contains float" + }, + { + "nebula_name": "ContainsSpanSpan", + "sql_token": "CONTAINS_SPAN_SPAN", + "input_type": "intspan_wkt", + "meos_call": "contains_span_span(temp, sp0)", + "return_kind": "double", + "extra_headers": [], + "extra_args": [ + { + "kind": "box", + "box_type": "Span", + "parser": "intspan_in" + } + ], + "build_generic": true, + "comment_one_liner": "Intspan contains intspan" + }, + { + "nebula_name": "ContainsFloatspanSpan", + "sql_token": "CONTAINS_FLOATSPAN_SPAN", + "input_type": "floatspan_wkt", + "meos_call": "contains_span_span(temp, sp0)", + "return_kind": "double", + "extra_headers": [], + "extra_args": [ + { + "kind": "box", + "box_type": "Span", + "parser": "floatspan_in" + } + ], + "build_generic": true, + "comment_one_liner": "Floatspan contains floatspan" + } + ] +} \ No newline at end of file diff --git a/tools/codegen/spatial-phasec-full-descriptor.json b/tools/codegen/spatial-phasec-full-descriptor.json new file mode 100644 index 0000000000..73e4177047 --- /dev/null +++ b/tools/codegen/spatial-phasec-full-descriptor.json @@ -0,0 +1,2660 @@ +{ + "_comment": "Phase C full spatial descriptor: tgeo_geo (14 ops, excl. AcoversGeoTgeo), tgeo_tgeo (18 ops), tcbuffer_geo (13 ops), tcbuffer_tcbuffer (18 ops). tcbuffer_cbuffer excluded (arity mismatch: 5-arg blob vs committed 7-arg coordinates).", + "operators": [ + { + "nebula_name": "AcontainsTgeoGeo", + "sql_token": "ACONTAINS_TGEO_GEO", + "meos_call": "acontains_tgeo_geo", + "args": [ + { + "name": "lon", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "lat", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "timestamp", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "geometry", + "nautilus_type": "VariableSizedData", + "cpp_type": "const char*" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_temporal_point": true, + "comment_one_liner": "Per-event acontains_tgeo_geo spatial predicate." + }, + { + "nebula_name": "AcoversTgeoGeo", + "sql_token": "ACOVERS_TGEO_GEO", + "meos_call": "acovers_tgeo_geo", + "args": [ + { + "name": "lon", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "lat", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "timestamp", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "geometry", + "nautilus_type": "VariableSizedData", + "cpp_type": "const char*" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_temporal_point": true, + "comment_one_liner": "Per-event acovers_tgeo_geo spatial predicate." + }, + { + "nebula_name": "AdisjointTgeoGeo", + "sql_token": "ADISJOINT_TGEO_GEO", + "meos_call": "adisjoint_tgeo_geo", + "args": [ + { + "name": "lon", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "lat", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "timestamp", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "geometry", + "nautilus_type": "VariableSizedData", + "cpp_type": "const char*" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_temporal_point": true, + "comment_one_liner": "Per-event adisjoint_tgeo_geo spatial predicate." + }, + { + "nebula_name": "AintersectsTgeoGeo", + "sql_token": "AINTERSECTS_TGEO_GEO", + "meos_call": "aintersects_tgeo_geo", + "args": [ + { + "name": "lon", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "lat", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "timestamp", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "geometry", + "nautilus_type": "VariableSizedData", + "cpp_type": "const char*" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_temporal_point": true, + "comment_one_liner": "Per-event aintersects_tgeo_geo spatial predicate." + }, + { + "nebula_name": "AtouchesTgeoGeo", + "sql_token": "ATOUCHES_TGEO_GEO", + "meos_call": "atouches_tgeo_geo", + "args": [ + { + "name": "lon", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "lat", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "timestamp", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "geometry", + "nautilus_type": "VariableSizedData", + "cpp_type": "const char*" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_temporal_point": true, + "comment_one_liner": "Per-event atouches_tgeo_geo spatial predicate." + }, + { + "nebula_name": "EcontainsTgeoGeo", + "sql_token": "ECONTAINS_TGEO_GEO", + "meos_call": "econtains_tgeo_geo", + "args": [ + { + "name": "lon", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "lat", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "timestamp", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "geometry", + "nautilus_type": "VariableSizedData", + "cpp_type": "const char*" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_temporal_point": true, + "comment_one_liner": "Per-event econtains_tgeo_geo spatial predicate." + }, + { + "nebula_name": "EcoversTgeoGeo", + "sql_token": "ECOVERS_TGEO_GEO", + "meos_call": "ecovers_tgeo_geo", + "args": [ + { + "name": "lon", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "lat", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "timestamp", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "geometry", + "nautilus_type": "VariableSizedData", + "cpp_type": "const char*" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_temporal_point": true, + "comment_one_liner": "Per-event ecovers_tgeo_geo spatial predicate." + }, + { + "nebula_name": "EdisjointTgeoGeo", + "sql_token": "EDISJOINT_TGEO_GEO", + "meos_call": "edisjoint_tgeo_geo", + "args": [ + { + "name": "lon", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "lat", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "timestamp", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "geometry", + "nautilus_type": "VariableSizedData", + "cpp_type": "const char*" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_temporal_point": true, + "comment_one_liner": "Per-event edisjoint_tgeo_geo spatial predicate." + }, + { + "nebula_name": "EintersectsTgeoGeo", + "sql_token": "EINTERSECTS_TGEO_GEO", + "meos_call": "eintersects_tgeo_geo", + "args": [ + { + "name": "lon", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "lat", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "timestamp", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "geometry", + "nautilus_type": "VariableSizedData", + "cpp_type": "const char*" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_temporal_point": true, + "comment_one_liner": "Per-event eintersects_tgeo_geo spatial predicate." + }, + { + "nebula_name": "EtouchesTgeoGeo", + "sql_token": "ETOUCHES_TGEO_GEO", + "meos_call": "etouches_tgeo_geo", + "args": [ + { + "name": "lon", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "lat", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "timestamp", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "geometry", + "nautilus_type": "VariableSizedData", + "cpp_type": "const char*" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_temporal_point": true, + "comment_one_liner": "Per-event etouches_tgeo_geo spatial predicate." + }, + { + "nebula_name": "EverEqTgeoGeo", + "sql_token": "EVER_EQ_TGEO_GEO", + "meos_call": "ever_eq_tgeo_geo", + "args": [ + { + "name": "lon", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "lat", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "timestamp", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "geometry", + "nautilus_type": "VariableSizedData", + "cpp_type": "const char*" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_temporal_point": true, + "comment_one_liner": "Per-event ever_eq_tgeo_geo spatial predicate." + }, + { + "nebula_name": "EverNeTgeoGeo", + "sql_token": "EVER_NE_TGEO_GEO", + "meos_call": "ever_ne_tgeo_geo", + "args": [ + { + "name": "lon", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "lat", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "timestamp", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "geometry", + "nautilus_type": "VariableSizedData", + "cpp_type": "const char*" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_temporal_point": true, + "comment_one_liner": "Per-event ever_ne_tgeo_geo spatial predicate." + }, + { + "nebula_name": "AlwaysEqTgeoGeo", + "sql_token": "ALWAYS_EQ_TGEO_GEO", + "meos_call": "always_eq_tgeo_geo", + "args": [ + { + "name": "lon", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "lat", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "timestamp", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "geometry", + "nautilus_type": "VariableSizedData", + "cpp_type": "const char*" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_temporal_point": true, + "comment_one_liner": "Per-event always_eq_tgeo_geo spatial predicate." + }, + { + "nebula_name": "AlwaysNeTgeoGeo", + "sql_token": "ALWAYS_NE_TGEO_GEO", + "meos_call": "always_ne_tgeo_geo", + "args": [ + { + "name": "lon", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "lat", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "timestamp", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "geometry", + "nautilus_type": "VariableSizedData", + "cpp_type": "const char*" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_temporal_point": true, + "comment_one_liner": "Per-event always_ne_tgeo_geo spatial predicate." + }, + { + "nebula_name": "NadTgeoGeo", + "sql_token": "NAD_TGEO_GEO", + "meos_call": "nad_tgeo_geo", + "args": [ + { + "name": "lon", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "lat", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "timestamp", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "geometry", + "nautilus_type": "VariableSizedData", + "cpp_type": "const char*" + } + ], + "return_type": "double", + "nautilus_return": "FLOAT64", + "build_temporal_point": true, + "comment_one_liner": "Per-event nearest approach distance between tgeo and static geometry." + }, + { + "nebula_name": "EdwithinTgeoGeo", + "sql_token": "EDWITHIN_TGEO_GEO", + "meos_call": "edwithin_tgeo_geo", + "args": [ + { + "name": "lon", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "lat", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "timestamp", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "geometry", + "nautilus_type": "VariableSizedData", + "cpp_type": "const char*" + }, + { + "name": "dist", + "nautilus_type": "double", + "cpp_type": "double" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_temporal_point_with_dist": true, + "comment_one_liner": "Per-event edwithin_tgeo_geo spatial predicate." + }, + { + "nebula_name": "AdwithinTgeoGeo", + "sql_token": "ADWITHIN_TGEO_GEO", + "meos_call": "adwithin_tgeo_geo", + "args": [ + { + "name": "lon", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "lat", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "timestamp", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "geometry", + "nautilus_type": "VariableSizedData", + "cpp_type": "const char*" + }, + { + "name": "dist", + "nautilus_type": "double", + "cpp_type": "double" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_temporal_point_with_dist": true, + "comment_one_liner": "Per-event adwithin_tgeo_geo spatial predicate." + }, + { + "nebula_name": "AcontainsTgeoTgeo", + "sql_token": "ACONTAINS_TGEO_TGEO", + "meos_call": "acontains_tgeo_tgeo", + "args": [ + { + "name": "lonA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "latA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsA", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "lonB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "latB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsB", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_two_temporal_points": true, + "comment_one_liner": "Per-event acontains_tgeo_tgeo spatial predicate." + }, + { + "nebula_name": "AcoversTgeoTgeo", + "sql_token": "ACOVERS_TGEO_TGEO", + "meos_call": "acovers_tgeo_tgeo", + "args": [ + { + "name": "lonA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "latA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsA", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "lonB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "latB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsB", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_two_temporal_points": true, + "comment_one_liner": "Per-event acovers_tgeo_tgeo spatial predicate." + }, + { + "nebula_name": "AdisjointTgeoTgeo", + "sql_token": "ADISJOINT_TGEO_TGEO", + "meos_call": "adisjoint_tgeo_tgeo", + "args": [ + { + "name": "lonA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "latA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsA", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "lonB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "latB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsB", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_two_temporal_points": true, + "comment_one_liner": "Per-event adisjoint_tgeo_tgeo spatial predicate." + }, + { + "nebula_name": "AintersectsTgeoTgeo", + "sql_token": "AINTERSECTS_TGEO_TGEO", + "meos_call": "aintersects_tgeo_tgeo", + "args": [ + { + "name": "lonA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "latA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsA", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "lonB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "latB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsB", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_two_temporal_points": true, + "comment_one_liner": "Per-event aintersects_tgeo_tgeo spatial predicate." + }, + { + "nebula_name": "AtouchesTgeoTgeo", + "sql_token": "ATOUCHES_TGEO_TGEO", + "meos_call": "atouches_tgeo_tgeo", + "args": [ + { + "name": "lonA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "latA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsA", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "lonB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "latB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsB", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_two_temporal_points": true, + "comment_one_liner": "Per-event atouches_tgeo_tgeo spatial predicate." + }, + { + "nebula_name": "EcontainsTgeoTgeo", + "sql_token": "ECONTAINS_TGEO_TGEO", + "meos_call": "econtains_tgeo_tgeo", + "args": [ + { + "name": "lonA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "latA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsA", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "lonB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "latB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsB", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_two_temporal_points": true, + "comment_one_liner": "Per-event econtains_tgeo_tgeo spatial predicate." + }, + { + "nebula_name": "EcoversTgeoTgeo", + "sql_token": "ECOVERS_TGEO_TGEO", + "meos_call": "ecovers_tgeo_tgeo", + "args": [ + { + "name": "lonA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "latA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsA", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "lonB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "latB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsB", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_two_temporal_points": true, + "comment_one_liner": "Per-event ecovers_tgeo_tgeo spatial predicate." + }, + { + "nebula_name": "EdisjointTgeoTgeo", + "sql_token": "EDISJOINT_TGEO_TGEO", + "meos_call": "edisjoint_tgeo_tgeo", + "args": [ + { + "name": "lonA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "latA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsA", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "lonB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "latB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsB", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_two_temporal_points": true, + "comment_one_liner": "Per-event edisjoint_tgeo_tgeo spatial predicate." + }, + { + "nebula_name": "EintersectsTgeoTgeo", + "sql_token": "EINTERSECTS_TGEO_TGEO", + "meos_call": "eintersects_tgeo_tgeo", + "args": [ + { + "name": "lonA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "latA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsA", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "lonB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "latB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsB", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_two_temporal_points": true, + "comment_one_liner": "Per-event eintersects_tgeo_tgeo spatial predicate." + }, + { + "nebula_name": "EtouchesTgeoTgeo", + "sql_token": "ETOUCHES_TGEO_TGEO", + "meos_call": "etouches_tgeo_tgeo", + "args": [ + { + "name": "lonA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "latA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsA", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "lonB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "latB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsB", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_two_temporal_points": true, + "comment_one_liner": "Per-event etouches_tgeo_tgeo spatial predicate." + }, + { + "nebula_name": "EverEqTgeoTgeo", + "sql_token": "EVER_EQ_TGEO_TGEO", + "meos_call": "ever_eq_tgeo_tgeo", + "args": [ + { + "name": "lonA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "latA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsA", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "lonB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "latB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsB", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_two_temporal_points": true, + "comment_one_liner": "Per-event ever_eq_tgeo_tgeo spatial predicate." + }, + { + "nebula_name": "EverNeTgeoTgeo", + "sql_token": "EVER_NE_TGEO_TGEO", + "meos_call": "ever_ne_tgeo_tgeo", + "args": [ + { + "name": "lonA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "latA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsA", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "lonB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "latB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsB", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_two_temporal_points": true, + "comment_one_liner": "Per-event ever_ne_tgeo_tgeo spatial predicate." + }, + { + "nebula_name": "AlwaysEqTgeoTgeo", + "sql_token": "ALWAYS_EQ_TGEO_TGEO", + "meos_call": "always_eq_tgeo_tgeo", + "args": [ + { + "name": "lonA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "latA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsA", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "lonB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "latB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsB", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_two_temporal_points": true, + "comment_one_liner": "Per-event always_eq_tgeo_tgeo spatial predicate." + }, + { + "nebula_name": "AlwaysNeTgeoTgeo", + "sql_token": "ALWAYS_NE_TGEO_TGEO", + "meos_call": "always_ne_tgeo_tgeo", + "args": [ + { + "name": "lonA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "latA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsA", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "lonB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "latB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsB", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_two_temporal_points": true, + "comment_one_liner": "Per-event always_ne_tgeo_tgeo spatial predicate." + }, + { + "nebula_name": "NadTgeoTgeo", + "sql_token": "NAD_TGEO_TGEO", + "meos_call": "nad_tgeo_tgeo", + "args": [ + { + "name": "lonA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "latA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsA", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "lonB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "latB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsB", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + } + ], + "return_type": "double", + "nautilus_return": "FLOAT64", + "build_two_temporal_points": true, + "comment_one_liner": "Per-event nearest approach distance between two tgeo instants." + }, + { + "nebula_name": "EdwithinTgeoTgeo", + "sql_token": "EDWITHIN_TGEO_TGEO", + "meos_call": "edwithin_tgeo_tgeo", + "args": [ + { + "name": "lonA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "latA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsA", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "lonB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "latB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsB", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "dist", + "nautilus_type": "double", + "cpp_type": "double" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_two_temporal_points_with_dist": true, + "comment_one_liner": "Per-event edwithin_tgeo_tgeo spatial predicate." + }, + { + "nebula_name": "AdwithinTgeoTgeo", + "sql_token": "ADWITHIN_TGEO_TGEO", + "meos_call": "adwithin_tgeo_tgeo", + "args": [ + { + "name": "lonA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "latA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsA", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "lonB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "latB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsB", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "dist", + "nautilus_type": "double", + "cpp_type": "double" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_two_temporal_points_with_dist": true, + "comment_one_liner": "Per-event adwithin_tgeo_tgeo spatial predicate." + }, + { + "nebula_name": "AcontainsTcbufferGeo", + "sql_token": "ACONTAINS_TCBUFFER_GEO", + "meos_call": "acontains_tcbuffer_geo", + "args": [ + { + "name": "lon", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "lat", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "radius", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "timestamp", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "geometry", + "nautilus_type": "VariableSizedData", + "cpp_type": "const char*" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_tcbuffer_point": true, + "comment_one_liner": "Per-event acontains_tcbuffer_geo spatial predicate." + }, + { + "nebula_name": "AcoversTcbufferGeo", + "sql_token": "ACOVERS_TCBUFFER_GEO", + "meos_call": "acovers_tcbuffer_geo", + "args": [ + { + "name": "lon", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "lat", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "radius", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "timestamp", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "geometry", + "nautilus_type": "VariableSizedData", + "cpp_type": "const char*" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_tcbuffer_point": true, + "comment_one_liner": "Per-event acovers_tcbuffer_geo spatial predicate." + }, + { + "nebula_name": "AdisjointTcbufferGeo", + "sql_token": "ADISJOINT_TCBUFFER_GEO", + "meos_call": "adisjoint_tcbuffer_geo", + "args": [ + { + "name": "lon", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "lat", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "radius", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "timestamp", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "geometry", + "nautilus_type": "VariableSizedData", + "cpp_type": "const char*" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_tcbuffer_point": true, + "comment_one_liner": "Per-event adisjoint_tcbuffer_geo spatial predicate." + }, + { + "nebula_name": "AintersectsTcbufferGeo", + "sql_token": "AINTERSECTS_TCBUFFER_GEO", + "meos_call": "aintersects_tcbuffer_geo", + "args": [ + { + "name": "lon", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "lat", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "radius", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "timestamp", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "geometry", + "nautilus_type": "VariableSizedData", + "cpp_type": "const char*" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_tcbuffer_point": true, + "comment_one_liner": "Per-event aintersects_tcbuffer_geo spatial predicate." + }, + { + "nebula_name": "AtouchesTcbufferGeo", + "sql_token": "ATOUCHES_TCBUFFER_GEO", + "meos_call": "atouches_tcbuffer_geo", + "args": [ + { + "name": "lon", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "lat", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "radius", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "timestamp", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "geometry", + "nautilus_type": "VariableSizedData", + "cpp_type": "const char*" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_tcbuffer_point": true, + "comment_one_liner": "Per-event atouches_tcbuffer_geo spatial predicate." + }, + { + "nebula_name": "EcontainsTcbufferGeo", + "sql_token": "ECONTAINS_TCBUFFER_GEO", + "meos_call": "econtains_tcbuffer_geo", + "args": [ + { + "name": "lon", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "lat", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "radius", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "timestamp", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "geometry", + "nautilus_type": "VariableSizedData", + "cpp_type": "const char*" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_tcbuffer_point": true, + "comment_one_liner": "Per-event econtains_tcbuffer_geo spatial predicate." + }, + { + "nebula_name": "EcoversTcbufferGeo", + "sql_token": "ECOVERS_TCBUFFER_GEO", + "meos_call": "ecovers_tcbuffer_geo", + "args": [ + { + "name": "lon", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "lat", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "radius", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "timestamp", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "geometry", + "nautilus_type": "VariableSizedData", + "cpp_type": "const char*" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_tcbuffer_point": true, + "comment_one_liner": "Per-event ecovers_tcbuffer_geo spatial predicate." + }, + { + "nebula_name": "EdisjointTcbufferGeo", + "sql_token": "EDISJOINT_TCBUFFER_GEO", + "meos_call": "edisjoint_tcbuffer_geo", + "args": [ + { + "name": "lon", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "lat", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "radius", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "timestamp", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "geometry", + "nautilus_type": "VariableSizedData", + "cpp_type": "const char*" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_tcbuffer_point": true, + "comment_one_liner": "Per-event edisjoint_tcbuffer_geo spatial predicate." + }, + { + "nebula_name": "EintersectsTcbufferGeo", + "sql_token": "EINTERSECTS_TCBUFFER_GEO", + "meos_call": "eintersects_tcbuffer_geo", + "args": [ + { + "name": "lon", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "lat", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "radius", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "timestamp", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "geometry", + "nautilus_type": "VariableSizedData", + "cpp_type": "const char*" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_tcbuffer_point": true, + "comment_one_liner": "Per-event eintersects_tcbuffer_geo spatial predicate." + }, + { + "nebula_name": "EtouchesTcbufferGeo", + "sql_token": "ETOUCHES_TCBUFFER_GEO", + "meos_call": "etouches_tcbuffer_geo", + "args": [ + { + "name": "lon", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "lat", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "radius", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "timestamp", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "geometry", + "nautilus_type": "VariableSizedData", + "cpp_type": "const char*" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_tcbuffer_point": true, + "comment_one_liner": "Per-event etouches_tcbuffer_geo spatial predicate." + }, + { + "nebula_name": "NadTcbufferGeo", + "sql_token": "NAD_TCBUFFER_GEO", + "meos_call": "nad_tcbuffer_geo", + "args": [ + { + "name": "lon", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "lat", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "radius", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "timestamp", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "geometry", + "nautilus_type": "VariableSizedData", + "cpp_type": "const char*" + } + ], + "return_type": "double", + "nautilus_return": "FLOAT64", + "build_tcbuffer_point": true, + "comment_one_liner": "Per-event nearest approach distance between tcbuffer and static geometry." + }, + { + "nebula_name": "EdwithinTcbufferGeo", + "sql_token": "EDWITHIN_TCBUFFER_GEO", + "meos_call": "edwithin_tcbuffer_geo", + "args": [ + { + "name": "lon", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "lat", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "radius", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "timestamp", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "geometry", + "nautilus_type": "VariableSizedData", + "cpp_type": "const char*" + }, + { + "name": "dist", + "nautilus_type": "double", + "cpp_type": "double" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_tcbuffer_point_with_dist": true, + "comment_one_liner": "Per-event edwithin_tcbuffer_geo spatial predicate." + }, + { + "nebula_name": "AdwithinTcbufferGeo", + "sql_token": "ADWITHIN_TCBUFFER_GEO", + "meos_call": "adwithin_tcbuffer_geo", + "args": [ + { + "name": "lon", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "lat", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "radius", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "timestamp", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "geometry", + "nautilus_type": "VariableSizedData", + "cpp_type": "const char*" + }, + { + "name": "dist", + "nautilus_type": "double", + "cpp_type": "double" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_tcbuffer_point_with_dist": true, + "comment_one_liner": "Per-event adwithin_tcbuffer_geo spatial predicate." + }, + { + "nebula_name": "AcontainsTcbufferTcbuffer", + "sql_token": "ACONTAINS_TCBUFFER_TCBUFFER", + "meos_call": "acontains_tcbuffer_tcbuffer", + "args": [ + { + "name": "lonA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "latA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "radiusA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsA", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "lonB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "latB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "radiusB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsB", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_two_tcbuffer_points": true, + "comment_one_liner": "Per-event acontains_tcbuffer_tcbuffer spatial predicate." + }, + { + "nebula_name": "AcoversTcbufferTcbuffer", + "sql_token": "ACOVERS_TCBUFFER_TCBUFFER", + "meos_call": "acovers_tcbuffer_tcbuffer", + "args": [ + { + "name": "lonA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "latA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "radiusA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsA", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "lonB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "latB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "radiusB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsB", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_two_tcbuffer_points": true, + "comment_one_liner": "Per-event acovers_tcbuffer_tcbuffer spatial predicate." + }, + { + "nebula_name": "AdisjointTcbufferTcbuffer", + "sql_token": "ADISJOINT_TCBUFFER_TCBUFFER", + "meos_call": "adisjoint_tcbuffer_tcbuffer", + "args": [ + { + "name": "lonA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "latA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "radiusA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsA", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "lonB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "latB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "radiusB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsB", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_two_tcbuffer_points": true, + "comment_one_liner": "Per-event adisjoint_tcbuffer_tcbuffer spatial predicate." + }, + { + "nebula_name": "AintersectsTcbufferTcbuffer", + "sql_token": "AINTERSECTS_TCBUFFER_TCBUFFER", + "meos_call": "aintersects_tcbuffer_tcbuffer", + "args": [ + { + "name": "lonA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "latA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "radiusA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsA", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "lonB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "latB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "radiusB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsB", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_two_tcbuffer_points": true, + "comment_one_liner": "Per-event aintersects_tcbuffer_tcbuffer spatial predicate." + }, + { + "nebula_name": "AtouchesTcbufferTcbuffer", + "sql_token": "ATOUCHES_TCBUFFER_TCBUFFER", + "meos_call": "atouches_tcbuffer_tcbuffer", + "args": [ + { + "name": "lonA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "latA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "radiusA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsA", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "lonB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "latB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "radiusB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsB", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_two_tcbuffer_points": true, + "comment_one_liner": "Per-event atouches_tcbuffer_tcbuffer spatial predicate." + }, + { + "nebula_name": "EcontainsTcbufferTcbuffer", + "sql_token": "ECONTAINS_TCBUFFER_TCBUFFER", + "meos_call": "econtains_tcbuffer_tcbuffer", + "args": [ + { + "name": "lonA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "latA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "radiusA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsA", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "lonB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "latB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "radiusB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsB", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_two_tcbuffer_points": true, + "comment_one_liner": "Per-event econtains_tcbuffer_tcbuffer spatial predicate." + }, + { + "nebula_name": "EcoversTcbufferTcbuffer", + "sql_token": "ECOVERS_TCBUFFER_TCBUFFER", + "meos_call": "ecovers_tcbuffer_tcbuffer", + "args": [ + { + "name": "lonA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "latA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "radiusA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsA", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "lonB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "latB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "radiusB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsB", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_two_tcbuffer_points": true, + "comment_one_liner": "Per-event ecovers_tcbuffer_tcbuffer spatial predicate." + }, + { + "nebula_name": "EdisjointTcbufferTcbuffer", + "sql_token": "EDISJOINT_TCBUFFER_TCBUFFER", + "meos_call": "edisjoint_tcbuffer_tcbuffer", + "args": [ + { + "name": "lonA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "latA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "radiusA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsA", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "lonB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "latB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "radiusB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsB", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_two_tcbuffer_points": true, + "comment_one_liner": "Per-event edisjoint_tcbuffer_tcbuffer spatial predicate." + }, + { + "nebula_name": "EintersectsTcbufferTcbuffer", + "sql_token": "EINTERSECTS_TCBUFFER_TCBUFFER", + "meos_call": "eintersects_tcbuffer_tcbuffer", + "args": [ + { + "name": "lonA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "latA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "radiusA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsA", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "lonB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "latB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "radiusB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsB", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_two_tcbuffer_points": true, + "comment_one_liner": "Per-event eintersects_tcbuffer_tcbuffer spatial predicate." + }, + { + "nebula_name": "EtouchesTcbufferTcbuffer", + "sql_token": "ETOUCHES_TCBUFFER_TCBUFFER", + "meos_call": "etouches_tcbuffer_tcbuffer", + "args": [ + { + "name": "lonA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "latA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "radiusA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsA", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "lonB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "latB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "radiusB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsB", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_two_tcbuffer_points": true, + "comment_one_liner": "Per-event etouches_tcbuffer_tcbuffer spatial predicate." + }, + { + "nebula_name": "EverEqTcbufferTcbuffer", + "sql_token": "EVER_EQ_TCBUFFER_TCBUFFER", + "meos_call": "ever_eq_tcbuffer_tcbuffer", + "args": [ + { + "name": "lonA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "latA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "radiusA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsA", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "lonB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "latB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "radiusB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsB", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_two_tcbuffer_points": true, + "comment_one_liner": "Per-event ever_eq_tcbuffer_tcbuffer spatial predicate." + }, + { + "nebula_name": "EverNeTcbufferTcbuffer", + "sql_token": "EVER_NE_TCBUFFER_TCBUFFER", + "meos_call": "ever_ne_tcbuffer_tcbuffer", + "args": [ + { + "name": "lonA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "latA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "radiusA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsA", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "lonB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "latB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "radiusB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsB", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_two_tcbuffer_points": true, + "comment_one_liner": "Per-event ever_ne_tcbuffer_tcbuffer spatial predicate." + }, + { + "nebula_name": "AlwaysEqTcbufferTcbuffer", + "sql_token": "ALWAYS_EQ_TCBUFFER_TCBUFFER", + "meos_call": "always_eq_tcbuffer_tcbuffer", + "args": [ + { + "name": "lonA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "latA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "radiusA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsA", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "lonB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "latB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "radiusB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsB", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_two_tcbuffer_points": true, + "comment_one_liner": "Per-event always_eq_tcbuffer_tcbuffer spatial predicate." + }, + { + "nebula_name": "AlwaysNeTcbufferTcbuffer", + "sql_token": "ALWAYS_NE_TCBUFFER_TCBUFFER", + "meos_call": "always_ne_tcbuffer_tcbuffer", + "args": [ + { + "name": "lonA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "latA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "radiusA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsA", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "lonB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "latB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "radiusB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsB", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_two_tcbuffer_points": true, + "comment_one_liner": "Per-event always_ne_tcbuffer_tcbuffer spatial predicate." + }, + { + "nebula_name": "NadTcbufferTcbuffer", + "sql_token": "NAD_TCBUFFER_TCBUFFER", + "meos_call": "nad_tcbuffer_tcbuffer", + "args": [ + { + "name": "lonA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "latA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "radiusA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsA", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "lonB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "latB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "radiusB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsB", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + } + ], + "return_type": "double", + "nautilus_return": "FLOAT64", + "build_two_tcbuffer_points": true, + "comment_one_liner": "Per-event nearest approach distance between two tcbuffer instants." + }, + { + "nebula_name": "EdwithinTcbufferTcbuffer", + "sql_token": "EDWITHIN_TCBUFFER_TCBUFFER", + "meos_call": "edwithin_tcbuffer_tcbuffer", + "args": [ + { + "name": "lonA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "latA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "radiusA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsA", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "lonB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "latB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "radiusB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsB", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "dist", + "nautilus_type": "double", + "cpp_type": "double" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_two_tcbuffer_points_with_dist": true, + "comment_one_liner": "Per-event edwithin_tcbuffer_tcbuffer spatial predicate." + }, + { + "nebula_name": "AdwithinTcbufferTcbuffer", + "sql_token": "ADWITHIN_TCBUFFER_TCBUFFER", + "meos_call": "adwithin_tcbuffer_tcbuffer", + "args": [ + { + "name": "lonA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "latA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "radiusA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsA", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "lonB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "latB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "radiusB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsB", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "dist", + "nautilus_type": "double", + "cpp_type": "double" + } + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_two_tcbuffer_points_with_dist": true, + "comment_one_liner": "Per-event adwithin_tcbuffer_tcbuffer spatial predicate." + }, + { + "nebula_name": "MindistanceTcbufferTcbuffer", + "sql_token": "MINDISTANCE_TCBUFFER_TCBUFFER", + "meos_call": "mindistance_tcbuffer_tcbuffer", + "args": [ + { + "name": "lonA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "latA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "radiusA", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsA", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "lonB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "latB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "radiusB", + "nautilus_type": "double", + "cpp_type": "double" + }, + { + "name": "tsB", + "nautilus_type": "uint64_t", + "cpp_type": "uint64_t" + }, + { + "name": "dist", + "nautilus_type": "double", + "cpp_type": "double" + } + ], + "return_type": "double", + "nautilus_return": "FLOAT64", + "build_two_tcbuffer_points_with_dist": true, + "comment_one_liner": "Per-event minimum distance between two tcbuffer instants within threshold." + } + ] +} diff --git a/tools/codegen/spatial-predicates-descriptor.json b/tools/codegen/spatial-predicates-descriptor.json new file mode 100644 index 0000000000..7bbedfd950 --- /dev/null +++ b/tools/codegen/spatial-predicates-descriptor.json @@ -0,0 +1,159 @@ +{ + "_comment": "Spatial predicate descriptor for 9 missing tgeo/tcbuffer operators (W148-wave gap-fill); input verify/nebula-gen-spatial", + "operators": [ + { + "nebula_name": "EcoversTgeoGeo", + "sql_token": "ECOVERS_TGEO_GEO", + "meos_call": "ecovers_tgeo_geo", + "args": [ + {"name": "lon", "nautilus_type": "double", "cpp_type": "double"}, + {"name": "lat", "nautilus_type": "double", "cpp_type": "double"}, + {"name": "timestamp", "nautilus_type": "uint64_t", "cpp_type": "uint64_t"}, + {"name": "geometry", "nautilus_type": "VariableSizedData", "cpp_type": "const char*"} + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_temporal_point": true, + "comment_one_liner": "Per-event ever-covers between a single-instant tgeo built from event fields and a static geometry." + }, + { + "nebula_name": "EdisjointTgeoGeo", + "sql_token": "EDISJOINT_TGEO_GEO", + "meos_call": "edisjoint_tgeo_geo", + "args": [ + {"name": "lon", "nautilus_type": "double", "cpp_type": "double"}, + {"name": "lat", "nautilus_type": "double", "cpp_type": "double"}, + {"name": "timestamp", "nautilus_type": "uint64_t", "cpp_type": "uint64_t"}, + {"name": "geometry", "nautilus_type": "VariableSizedData", "cpp_type": "const char*"} + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_temporal_point": true, + "comment_one_liner": "Per-event ever-disjoint between a single-instant tgeo built from event fields and a static geometry." + }, + { + "nebula_name": "EdwithinTgeoGeo", + "sql_token": "EDWITHIN_TGEO_GEO", + "meos_call": "edwithin_tgeo_geo", + "args": [ + {"name": "lon", "nautilus_type": "double", "cpp_type": "double"}, + {"name": "lat", "nautilus_type": "double", "cpp_type": "double"}, + {"name": "timestamp", "nautilus_type": "uint64_t", "cpp_type": "uint64_t"}, + {"name": "geometry", "nautilus_type": "VariableSizedData", "cpp_type": "const char*"}, + {"name": "dist", "nautilus_type": "double", "cpp_type": "double"} + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_temporal_point_with_dist": true, + "comment_one_liner": "Per-event ever-within-distance between a single-instant tgeo and a static geometry." + }, + { + "nebula_name": "NadTgeoTgeo", + "sql_token": "NAD_TGEO_TGEO", + "meos_call": "nad_tgeo_tgeo", + "args": [ + {"name": "lonA", "nautilus_type": "double", "cpp_type": "double"}, + {"name": "latA", "nautilus_type": "double", "cpp_type": "double"}, + {"name": "tsA", "nautilus_type": "uint64_t", "cpp_type": "uint64_t"}, + {"name": "lonB", "nautilus_type": "double", "cpp_type": "double"}, + {"name": "latB", "nautilus_type": "double", "cpp_type": "double"}, + {"name": "tsB", "nautilus_type": "uint64_t", "cpp_type": "uint64_t"} + ], + "return_type": "double", + "nautilus_return": "FLOAT64", + "build_two_temporal_points": true, + "comment_one_liner": "Per-event nearest-approach distance between two single-instant tgeo built from event fields." + }, + { + "nebula_name": "EcontainsTcbufferTcbuffer", + "sql_token": "ECONTAINS_TCBUFFER_TCBUFFER", + "meos_call": "econtains_tcbuffer_tcbuffer", + "args": [ + {"name": "lonA", "nautilus_type": "double", "cpp_type": "double"}, + {"name": "latA", "nautilus_type": "double", "cpp_type": "double"}, + {"name": "radiusA", "nautilus_type": "double", "cpp_type": "double"}, + {"name": "tsA", "nautilus_type": "uint64_t", "cpp_type": "uint64_t"}, + {"name": "lonB", "nautilus_type": "double", "cpp_type": "double"}, + {"name": "latB", "nautilus_type": "double", "cpp_type": "double"}, + {"name": "radiusB", "nautilus_type": "double", "cpp_type": "double"}, + {"name": "tsB", "nautilus_type": "uint64_t", "cpp_type": "uint64_t"} + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_two_tcbuffer_points": true, + "comment_one_liner": "Per-event ever-contains between two single-instant tcbuffer built from event fields." + }, + { + "nebula_name": "AcontainsTcbufferTcbuffer", + "sql_token": "ACONTAINS_TCBUFFER_TCBUFFER", + "meos_call": "acontains_tcbuffer_tcbuffer", + "args": [ + {"name": "lonA", "nautilus_type": "double", "cpp_type": "double"}, + {"name": "latA", "nautilus_type": "double", "cpp_type": "double"}, + {"name": "radiusA", "nautilus_type": "double", "cpp_type": "double"}, + {"name": "tsA", "nautilus_type": "uint64_t", "cpp_type": "uint64_t"}, + {"name": "lonB", "nautilus_type": "double", "cpp_type": "double"}, + {"name": "latB", "nautilus_type": "double", "cpp_type": "double"}, + {"name": "radiusB", "nautilus_type": "double", "cpp_type": "double"}, + {"name": "tsB", "nautilus_type": "uint64_t", "cpp_type": "uint64_t"} + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_two_tcbuffer_points": true, + "comment_one_liner": "Per-event always-contains between two single-instant tcbuffer built from event fields." + }, + { + "nebula_name": "EdisjointTcbufferTcbuffer", + "sql_token": "EDISJOINT_TCBUFFER_TCBUFFER", + "meos_call": "edisjoint_tcbuffer_tcbuffer", + "args": [ + {"name": "lonA", "nautilus_type": "double", "cpp_type": "double"}, + {"name": "latA", "nautilus_type": "double", "cpp_type": "double"}, + {"name": "radiusA", "nautilus_type": "double", "cpp_type": "double"}, + {"name": "tsA", "nautilus_type": "uint64_t", "cpp_type": "uint64_t"}, + {"name": "lonB", "nautilus_type": "double", "cpp_type": "double"}, + {"name": "latB", "nautilus_type": "double", "cpp_type": "double"}, + {"name": "radiusB", "nautilus_type": "double", "cpp_type": "double"}, + {"name": "tsB", "nautilus_type": "uint64_t", "cpp_type": "uint64_t"} + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_two_tcbuffer_points": true, + "comment_one_liner": "Per-event ever-disjoint between two single-instant tcbuffer built from event fields." + }, + { + "nebula_name": "EdwithinTcbufferCbuffer", + "sql_token": "EDWITHIN_TCBUFFER_CBUFFER", + "meos_call": "edwithin_tcbuffer_cbuffer", + "args": [ + {"name": "lon", "nautilus_type": "double", "cpp_type": "double"}, + {"name": "lat", "nautilus_type": "double", "cpp_type": "double"}, + {"name": "radius", "nautilus_type": "double", "cpp_type": "double"}, + {"name": "timestamp","nautilus_type": "uint64_t", "cpp_type": "uint64_t"}, + {"name": "cbufLit", "nautilus_type": "VariableSizedData", "cpp_type": "const char*"}, + {"name": "dist", "nautilus_type": "double", "cpp_type": "double"} + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_tcbuffer_point_cbuffer_with_dist": true, + "comment_one_liner": "Per-event ever-within-distance between a single-instant tcbuffer and a static cbuffer." + }, + { + "nebula_name": "AdwithinTcbufferCbuffer", + "sql_token": "ADWITHIN_TCBUFFER_CBUFFER", + "meos_call": "adwithin_tcbuffer_cbuffer", + "args": [ + {"name": "lon", "nautilus_type": "double", "cpp_type": "double"}, + {"name": "lat", "nautilus_type": "double", "cpp_type": "double"}, + {"name": "radius", "nautilus_type": "double", "cpp_type": "double"}, + {"name": "timestamp","nautilus_type": "uint64_t", "cpp_type": "uint64_t"}, + {"name": "cbufLit", "nautilus_type": "VariableSizedData", "cpp_type": "const char*"}, + {"name": "dist", "nautilus_type": "double", "cpp_type": "double"} + ], + "return_type": "int", + "nautilus_return": "INT32", + "build_tcbuffer_point_cbuffer_with_dist": true, + "comment_one_liner": "Per-event always-within-distance between a single-instant tcbuffer and a static cbuffer." + } + ] +} diff --git a/tools/codegen/tfloat-transforms-descriptor.json b/tools/codegen/tfloat-transforms-descriptor.json new file mode 100644 index 0000000000..31db94d4fe --- /dev/null +++ b/tools/codegen/tfloat-transforms-descriptor.json @@ -0,0 +1,85 @@ +{ + "_comment": "tfloat/tint unary transform family descriptor (8 ops)", + "operators": [ + { + "nebula_name": "TfloatCeil", + "sql_token": "TFLOAT_CEIL", + "meos_call": "tfloat_ceil", + "build_generic": true, + "input_type": "tfloat", + "extra_args": [], + "return_kind": "extract_double", + "comment_one_liner": "Per-event tfloat_ceil: single-instant tfloat transform, value extracted -> double." + }, + { + "nebula_name": "TfloatExp", + "sql_token": "TFLOAT_EXP", + "meos_call": "tfloat_exp", + "build_generic": true, + "input_type": "tfloat", + "extra_args": [], + "return_kind": "extract_double", + "comment_one_liner": "Per-event tfloat_exp: single-instant tfloat transform, value extracted -> double." + }, + { + "nebula_name": "TfloatFloor", + "sql_token": "TFLOAT_FLOOR", + "meos_call": "tfloat_floor", + "build_generic": true, + "input_type": "tfloat", + "extra_args": [], + "return_kind": "extract_double", + "comment_one_liner": "Per-event tfloat_floor: single-instant tfloat transform, value extracted -> double." + }, + { + "nebula_name": "TfloatLn", + "sql_token": "TFLOAT_LN", + "meos_call": "tfloat_ln", + "build_generic": true, + "input_type": "tfloat", + "extra_args": [], + "return_kind": "extract_double", + "comment_one_liner": "Per-event tfloat_ln: single-instant tfloat transform, value extracted -> double." + }, + { + "nebula_name": "TfloatLog10", + "sql_token": "TFLOAT_LOG10", + "meos_call": "tfloat_log10", + "build_generic": true, + "input_type": "tfloat", + "extra_args": [], + "return_kind": "extract_double", + "comment_one_liner": "Per-event tfloat_log10: single-instant tfloat transform, value extracted -> double." + }, + { + "nebula_name": "TfloatRadians", + "sql_token": "TFLOAT_RADIANS", + "meos_call": "tfloat_radians", + "build_generic": true, + "input_type": "tfloat", + "extra_args": [], + "return_kind": "extract_double", + "comment_one_liner": "Per-event tfloat_radians: single-instant tfloat transform, value extracted -> double." + }, + { + "nebula_name": "TfloatToTint", + "sql_token": "TFLOAT_TO_TINT", + "meos_call": "tfloat_to_tint", + "build_generic": true, + "input_type": "tfloat", + "extra_args": [], + "return_kind": "extract_int", + "comment_one_liner": "Per-event tfloat_to_tint: single-instant tfloat transform, value extracted -> int." + }, + { + "nebula_name": "TintToTfloat", + "sql_token": "TINT_TO_TFLOAT", + "meos_call": "tint_to_tfloat", + "build_generic": true, + "input_type": "tfloat", + "extra_args": [], + "return_kind": "extract_double", + "comment_one_liner": "Per-event tint_to_tfloat: single-instant tfloat transform, value extracted -> double." + } + ] +} diff --git a/tools/codegen/trgeo-descriptor.json b/tools/codegen/trgeo-descriptor.json new file mode 100644 index 0000000000..015f98474b --- /dev/null +++ b/tools/codegen/trgeo-descriptor.json @@ -0,0 +1,311 @@ +{ + "_comment": "codegen descriptor; shapes=trgeometry_geo_predicate,geo_trgeometry_predicate,trgeometry_geo_dwithin,trgeometry_trgeometry_predicate,trgeometry_trgeometry_dwithin,trgeometry_nad", + "operators": [ + { + "nebula_name": "AcontainsGeoTrgeometry", + "sql_token": "ACONTAINS_GEO_TRGEOMETRY", + "meos_call": "acontains_geo_trgeometry", + "return_type": "int", + "nautilus_return": "INT32", + "build_geo_trgeometry": true, + "comment_one_liner": "Returns 1 if the geometry acontains the trgeometry instant." + }, + { + "nebula_name": "AcoversGeoTrgeometry", + "sql_token": "ACOVERS_GEO_TRGEOMETRY", + "meos_call": "acovers_geo_trgeometry", + "return_type": "int", + "nautilus_return": "INT32", + "build_geo_trgeometry": true, + "comment_one_liner": "Returns 1 if the geometry acovers the trgeometry instant." + }, + { + "nebula_name": "AcoversTrgeometryGeo", + "sql_token": "ACOVERS_TRGEOMETRY_GEO", + "meos_call": "acovers_trgeometry_geo", + "return_type": "int", + "nautilus_return": "INT32", + "build_trgeometry_geo": true, + "comment_one_liner": "Returns 1 if the trgeometry instant acovers the geometry." + }, + { + "nebula_name": "AdisjointTrgeometryGeo", + "sql_token": "ADISJOINT_TRGEOMETRY_GEO", + "meos_call": "adisjoint_trgeometry_geo", + "return_type": "int", + "nautilus_return": "INT32", + "build_trgeometry_geo": true, + "comment_one_liner": "Returns 1 if the trgeometry instant adisjoint the geometry." + }, + { + "nebula_name": "AdisjointTrgeometryTrgeometry", + "sql_token": "ADISJOINT_TRGEOMETRY_TRGEOMETRY", + "meos_call": "adisjoint_trgeometry_trgeometry", + "return_type": "int", + "nautilus_return": "INT32", + "build_trgeometry_trgeometry": true, + "comment_one_liner": "Returns 1 if the two trgeometry instants adisjoint." + }, + { + "nebula_name": "AdwithinTrgeometryGeo", + "sql_token": "ADWITHIN_TRGEOMETRY_GEO", + "meos_call": "adwithin_trgeometry_geo", + "return_type": "int", + "nautilus_return": "INT32", + "build_trgeometry_geo_with_dist": true, + "comment_one_liner": "Returns 1 if the trgeometry instant is within dist of the geometry (adwithin)." + }, + { + "nebula_name": "AdwithinTrgeometryTrgeometry", + "sql_token": "ADWITHIN_TRGEOMETRY_TRGEOMETRY", + "meos_call": "adwithin_trgeometry_trgeometry", + "return_type": "int", + "nautilus_return": "INT32", + "build_trgeometry_trgeometry_with_dist": true, + "comment_one_liner": "Returns 1 if the two trgeometry instants are within dist (adwithin)." + }, + { + "nebula_name": "AintersectsTrgeometryGeo", + "sql_token": "AINTERSECTS_TRGEOMETRY_GEO", + "meos_call": "aintersects_trgeometry_geo", + "return_type": "int", + "nautilus_return": "INT32", + "build_trgeometry_geo": true, + "comment_one_liner": "Returns 1 if the trgeometry instant aintersects the geometry." + }, + { + "nebula_name": "AintersectsTrgeometryTrgeometry", + "sql_token": "AINTERSECTS_TRGEOMETRY_TRGEOMETRY", + "meos_call": "aintersects_trgeometry_trgeometry", + "return_type": "int", + "nautilus_return": "INT32", + "build_trgeometry_trgeometry": true, + "comment_one_liner": "Returns 1 if the two trgeometry instants aintersects." + }, + { + "nebula_name": "AlwaysEqGeoTrgeometry", + "sql_token": "ALWAYS_EQ_GEO_TRGEOMETRY", + "meos_call": "always_eq_geo_trgeometry", + "return_type": "int", + "nautilus_return": "INT32", + "build_geo_trgeometry_eq": true, + "comment_one_liner": "Returns 1.0 if the static geometry is always equal to the 2D trgeometry instant." + }, + { + "nebula_name": "AlwaysEqTrgeometryGeo", + "sql_token": "ALWAYS_EQ_TRGEOMETRY_GEO", + "meos_call": "always_eq_trgeometry_geo", + "return_type": "int", + "nautilus_return": "INT32", + "build_trgeometry_geo_nad": true, + "comment_one_liner": "Returns 1.0 if the 2D trgeometry instant is always equal to the static geometry." + }, + { + "nebula_name": "AlwaysEqTrgeometryTrgeometry", + "sql_token": "ALWAYS_EQ_TRGEOMETRY_TRGEOMETRY", + "meos_call": "always_eq_trgeometry_trgeometry", + "return_type": "int", + "nautilus_return": "INT32", + "build_trgeometry_trgeometry_nad": true, + "comment_one_liner": "Returns 1.0 if the two 2D trgeometry instants are always equal." + }, + { + "nebula_name": "AlwaysNeGeoTrgeometry", + "sql_token": "ALWAYS_NE_GEO_TRGEOMETRY", + "meos_call": "always_ne_geo_trgeometry", + "return_type": "int", + "nautilus_return": "INT32", + "build_geo_trgeometry_eq": true, + "comment_one_liner": "Returns 1.0 if the static geometry is always not equal to the 2D trgeometry instant." + }, + { + "nebula_name": "AlwaysNeTrgeometryGeo", + "sql_token": "ALWAYS_NE_TRGEOMETRY_GEO", + "meos_call": "always_ne_trgeometry_geo", + "return_type": "int", + "nautilus_return": "INT32", + "build_trgeometry_geo_nad": true, + "comment_one_liner": "Returns 1.0 if the 2D trgeometry instant is always not equal to the static geometry." + }, + { + "nebula_name": "AlwaysNeTrgeometryTrgeometry", + "sql_token": "ALWAYS_NE_TRGEOMETRY_TRGEOMETRY", + "meos_call": "always_ne_trgeometry_trgeometry", + "return_type": "int", + "nautilus_return": "INT32", + "build_trgeometry_trgeometry_nad": true, + "comment_one_liner": "Returns 1.0 if the two 2D trgeometry instants are always not equal." + }, + { + "nebula_name": "AtouchesTrgeometryGeo", + "sql_token": "ATOUCHES_TRGEOMETRY_GEO", + "meos_call": "atouches_trgeometry_geo", + "return_type": "int", + "nautilus_return": "INT32", + "build_trgeometry_geo": true, + "comment_one_liner": "Returns 1 if the trgeometry instant atouches the geometry." + }, + { + "nebula_name": "EcontainsGeoTrgeometry", + "sql_token": "ECONTAINS_GEO_TRGEOMETRY", + "meos_call": "econtains_geo_trgeometry", + "return_type": "int", + "nautilus_return": "INT32", + "build_geo_trgeometry": true, + "comment_one_liner": "Returns 1 if the geometry econtains the trgeometry instant." + }, + { + "nebula_name": "EcoversGeoTrgeometry", + "sql_token": "ECOVERS_GEO_TRGEOMETRY", + "meos_call": "ecovers_geo_trgeometry", + "return_type": "int", + "nautilus_return": "INT32", + "build_geo_trgeometry": true, + "comment_one_liner": "Returns 1 if the geometry ecovers the trgeometry instant." + }, + { + "nebula_name": "EcoversTrgeometryGeo", + "sql_token": "ECOVERS_TRGEOMETRY_GEO", + "meos_call": "ecovers_trgeometry_geo", + "return_type": "int", + "nautilus_return": "INT32", + "build_trgeometry_geo": true, + "comment_one_liner": "Returns 1 if the trgeometry instant ecovers the geometry." + }, + { + "nebula_name": "EdisjointTrgeometryGeo", + "sql_token": "EDISJOINT_TRGEOMETRY_GEO", + "meos_call": "edisjoint_trgeometry_geo", + "return_type": "int", + "nautilus_return": "INT32", + "build_trgeometry_geo": true, + "comment_one_liner": "Returns 1 if the trgeometry instant edisjoint the geometry." + }, + { + "nebula_name": "EdisjointTrgeometryTrgeometry", + "sql_token": "EDISJOINT_TRGEOMETRY_TRGEOMETRY", + "meos_call": "edisjoint_trgeometry_trgeometry", + "return_type": "int", + "nautilus_return": "INT32", + "build_trgeometry_trgeometry": true, + "comment_one_liner": "Returns 1 if the two trgeometry instants edisjoint." + }, + { + "nebula_name": "EdwithinTrgeometryGeo", + "sql_token": "EDWITHIN_TRGEOMETRY_GEO", + "meos_call": "edwithin_trgeometry_geo", + "return_type": "int", + "nautilus_return": "INT32", + "build_trgeometry_geo_with_dist": true, + "comment_one_liner": "Returns 1 if the trgeometry instant is within dist of the geometry (edwithin)." + }, + { + "nebula_name": "EdwithinTrgeometryTrgeometry", + "sql_token": "EDWITHIN_TRGEOMETRY_TRGEOMETRY", + "meos_call": "edwithin_trgeometry_trgeometry", + "return_type": "int", + "nautilus_return": "INT32", + "build_trgeometry_trgeometry_with_dist": true, + "comment_one_liner": "Returns 1 if the two trgeometry instants are within dist (edwithin)." + }, + { + "nebula_name": "EintersectsTrgeometryGeo", + "sql_token": "EINTERSECTS_TRGEOMETRY_GEO", + "meos_call": "eintersects_trgeometry_geo", + "return_type": "int", + "nautilus_return": "INT32", + "build_trgeometry_geo": true, + "comment_one_liner": "Returns 1 if the trgeometry instant eintersects the geometry." + }, + { + "nebula_name": "EintersectsTrgeometryTrgeometry", + "sql_token": "EINTERSECTS_TRGEOMETRY_TRGEOMETRY", + "meos_call": "eintersects_trgeometry_trgeometry", + "return_type": "int", + "nautilus_return": "INT32", + "build_trgeometry_trgeometry": true, + "comment_one_liner": "Returns 1 if the two trgeometry instants eintersects." + }, + { + "nebula_name": "EtouchesTrgeometryGeo", + "sql_token": "ETOUCHES_TRGEOMETRY_GEO", + "meos_call": "etouches_trgeometry_geo", + "return_type": "int", + "nautilus_return": "INT32", + "build_trgeometry_geo": true, + "comment_one_liner": "Returns 1 if the trgeometry instant etouches the geometry." + }, + { + "nebula_name": "EverEqGeoTrgeometry", + "sql_token": "EVER_EQ_GEO_TRGEOMETRY", + "meos_call": "ever_eq_geo_trgeometry", + "return_type": "int", + "nautilus_return": "INT32", + "build_geo_trgeometry_eq": true, + "comment_one_liner": "Returns 1.0 if the static geometry is ever equal to the 2D trgeometry instant." + }, + { + "nebula_name": "EverEqTrgeometryGeo", + "sql_token": "EVER_EQ_TRGEOMETRY_GEO", + "meos_call": "ever_eq_trgeometry_geo", + "return_type": "int", + "nautilus_return": "INT32", + "build_trgeometry_geo_nad": true, + "comment_one_liner": "Returns 1.0 if the 2D trgeometry instant is ever equal to the static geometry." + }, + { + "nebula_name": "EverEqTrgeometryTrgeometry", + "sql_token": "EVER_EQ_TRGEOMETRY_TRGEOMETRY", + "meos_call": "ever_eq_trgeometry_trgeometry", + "return_type": "int", + "nautilus_return": "INT32", + "build_trgeometry_trgeometry_nad": true, + "comment_one_liner": "Returns 1.0 if the two 2D trgeometry instants are ever equal." + }, + { + "nebula_name": "EverNeGeoTrgeometry", + "sql_token": "EVER_NE_GEO_TRGEOMETRY", + "meos_call": "ever_ne_geo_trgeometry", + "return_type": "int", + "nautilus_return": "INT32", + "build_geo_trgeometry_eq": true, + "comment_one_liner": "Returns 1.0 if the static geometry is ever not equal to the 2D trgeometry instant." + }, + { + "nebula_name": "EverNeTrgeometryGeo", + "sql_token": "EVER_NE_TRGEOMETRY_GEO", + "meos_call": "ever_ne_trgeometry_geo", + "return_type": "int", + "nautilus_return": "INT32", + "build_trgeometry_geo_nad": true, + "comment_one_liner": "Returns 1.0 if the 2D trgeometry instant is ever not equal to the static geometry." + }, + { + "nebula_name": "EverNeTrgeometryTrgeometry", + "sql_token": "EVER_NE_TRGEOMETRY_TRGEOMETRY", + "meos_call": "ever_ne_trgeometry_trgeometry", + "return_type": "int", + "nautilus_return": "INT32", + "build_trgeometry_trgeometry_nad": true, + "comment_one_liner": "Returns 1.0 if the two 2D trgeometry instants are ever not equal." + }, + { + "nebula_name": "NadTrgeometryGeo", + "sql_token": "NAD_TRGEOMETRY_GEO", + "meos_call": "nad_trgeometry_geo", + "return_type": "double", + "nautilus_return": "FLOAT64", + "build_nad_trgeometry_geo": true, + "comment_one_liner": "Returns the nearest approach distance between a 2D trgeometry instant and a static geometry." + }, + { + "nebula_name": "NadTrgeometryTrgeometry", + "sql_token": "NAD_TRGEOMETRY_TRGEOMETRY", + "meos_call": "nad_trgeometry_trgeometry", + "return_type": "double", + "nautilus_return": "FLOAT64", + "build_nad_trgeometry_trgeometry": true, + "comment_one_liner": "Returns the nearest approach distance between two 2D trgeometry instants." + } + ] +} \ No newline at end of file